Index: trunk/doc-rnd/hacking/renames =================================================================== --- trunk/doc-rnd/hacking/renames (revision 5047) +++ trunk/doc-rnd/hacking/renames (revision 5048) @@ -1052,3 +1052,6 @@ EMARK_SIZE -> PCB_EMARK_SIZE FONT_CAPHEIGHT -> PCB_FONT_CAPHEIGHT DEFAULT_CELLSIZE -> PCB_DEFAULT_CELLSIZE +next_gui -> pcb_next_gui +current_action -> pcb_current_action +pixel_slop -> pcb_pixel_slop Index: trunk/scconfig/hooks.c =================================================================== --- trunk/scconfig/hooks.c (revision 5047) +++ trunk/scconfig/hooks.c (revision 5048) @@ -17,12 +17,12 @@ int want_intl = 0, want_coord_bits; const arg_auto_set_t disable_libs[] = { /* list of --disable-LIBs and the subtree they affect */ - {"disable-xrender", "libs/gui/xrender", arg_lib_nodes, "$do not use xrender for lesstif"}, - {"disable-xinerama", "libs/gui/xinerama", arg_lib_nodes, "$do not use xinerama for lesstif"}, - {"disable-gd", "libs/gui/gd", arg_lib_nodes, "$do not use gd (many exporters need it)"}, - {"disable-gd-gif", "libs/gui/gd/gdImageGif", arg_lib_nodes, "$no gif support in the png exporter"}, - {"disable-gd-png", "libs/gui/gd/gdImagePng", arg_lib_nodes, "$no png support in the png exporter"}, - {"disable-gd-jpg", "libs/gui/gd/gdImageJpeg", arg_lib_nodes, "$no jpeg support in the png exporter"}, + {"disable-xrender", "libs/pcb_gui/xrender", arg_lib_nodes, "$do not use xrender for lesstif"}, + {"disable-xinerama", "libs/pcb_gui/xinerama", arg_lib_nodes, "$do not use xinerama for lesstif"}, + {"disable-gd", "libs/pcb_gui/gd", arg_lib_nodes, "$do not use gd (many exporters need it)"}, + {"disable-gd-gif", "libs/pcb_gui/gd/gdImageGif", arg_lib_nodes, "$no gif support in the png pcb_exporter"}, + {"disable-gd-png", "libs/pcb_gui/gd/gdImagePng", arg_lib_nodes, "$no png support in the png pcb_exporter"}, + {"disable-gd-jpg", "libs/pcb_gui/gd/gdImageJpeg", arg_lib_nodes, "$no jpeg support in the png pcb_exporter"}, {"enable-bison", "/local/pcb/want_bison", arg_true, "$enable generating language files"}, {"disable-bison", "/local/pcb/want_bison", arg_false, "$disable generating language files"}, {"enable-dmalloc", "/local/pcb/want_dmalloc", arg_true, "$compile with lib dmalloc"}, @@ -328,8 +328,8 @@ put("/local/pcb/want_nls", sfalse); if (want_stroke) { - require("libs/gui/libstroke/presents", 0, 0); - if (!istrue(get("libs/gui/libstroke/presents"))) { + require("libs/pcb_gui/libstroke/presents", 0, 0); + if (!istrue(get("libs/pcb_gui/libstroke/presents"))) { report_repeat("WARNING: Since there's no libstroke found, disabling the stroke plugin...\n"); hook_custom_arg("disable-stroke", NULL); } @@ -336,8 +336,8 @@ } if (want_gtk) { - require("libs/gui/gtk2/presents", 0, 0); - if (!istrue(get("libs/gui/gtk2/presents"))) { + require("libs/pcb_gui/gtk2/presents", 0, 0); + if (!istrue(get("libs/pcb_gui/gtk2/presents"))) { report_repeat("WARNING: Since there's no libgtk2 found, disabling the gtk hid...\n"); hook_custom_arg("disable-hid_gtk", NULL); } @@ -344,10 +344,10 @@ } if (plug_is_enabled("hid_lesstif")) { - require("libs/gui/lesstif2/presents", 0, 0); - if (istrue(get("libs/gui/lesstif2/presents"))) { - require("libs/gui/xinerama/presents", 0, 0); - require("libs/gui/xrender/presents", 0, 0); + require("libs/pcb_gui/lesstif2/presents", 0, 0); + if (istrue(get("libs/pcb_gui/lesstif2/presents"))) { + require("libs/pcb_gui/xinerama/presents", 0, 0); + require("libs/pcb_gui/xrender/presents", 0, 0); } else { report_repeat("WARNING: Since there's no lesstif2 found, disabling the lesstif HID and xinerama and xrender...\n"); @@ -390,7 +390,7 @@ hook_custom_arg("disable-puller", NULL); } if (plug_is_enabled("export_dsn")) { - report_repeat("WARNING: Since GLIB is not found, disabling the dsn exporter...\n"); + report_repeat("WARNING: Since GLIB is not found, disabling the dsn pcb_exporter...\n"); hook_custom_arg("disable-export_dsn", NULL); } } @@ -409,8 +409,8 @@ } if (want_gd) { - require("libs/gui/gd/presents", 0, 0); - if (!istrue(get("libs/gui/gd/presents"))) { + require("libs/pcb_gui/gd/presents", 0, 0); + if (!istrue(get("libs/pcb_gui/gd/presents"))) { report_repeat("WARNING: Since there's no libgd, disabling gd based exports (png, nelma, gcode)...\n"); hook_custom_arg("disable-gd-gif", NULL); hook_custom_arg("disable-gd-png", NULL); @@ -422,20 +422,20 @@ goto disable_gd_formats; } else { - require("libs/gui/gd/gdImagePng/presents", 0, 0); - require("libs/gui/gd/gdImageGif/presents", 0, 0); - require("libs/gui/gd/gdImageJpeg/presents", 0, 0); - if (!istrue(get("libs/gui/gd/gdImagePng/presents"))) { + require("libs/pcb_gui/gd/gdImagePng/presents", 0, 0); + require("libs/pcb_gui/gd/gdImageGif/presents", 0, 0); + require("libs/pcb_gui/gd/gdImageJpeg/presents", 0, 0); + if (!istrue(get("libs/pcb_gui/gd/gdImagePng/presents"))) { report_repeat("WARNING: libgd is installed, but its png code fails, some exporters will be compiled with reduced functionality; exporters affected: export_nelma, export_gcode\n"); } } } else { - put("libs/gui/gd/presents", sfalse); + put("libs/pcb_gui/gd/presents", sfalse); disable_gd_formats:; - put("libs/gui/gd/gdImagePng/presents", sfalse); - put("libs/gui/gd/gdImageGif/presents", sfalse); - put("libs/gui/gd/gdImageJpeg/presents", sfalse); + put("libs/pcb_gui/gd/gdImagePng/presents", sfalse); + put("libs/pcb_gui/gd/gdImageGif/presents", sfalse); + put("libs/pcb_gui/gd/gdImageJpeg/presents", sfalse); } /* generic utils for Makefiles */ Index: trunk/scconfig/plugins.h =================================================================== --- trunk/scconfig/plugins.h (revision 5047) +++ trunk/scconfig/plugins.h (revision 5048) @@ -45,21 +45,21 @@ plugin_def("import_hyp", "hyperlynx .hyp importer", sdisable, 0) plugin_header("\nExport plugins:\n") -plugin_def("export_gcode", "gcode exporter", sbuildin, 1) -plugin_def("export_nelma", "nelma exporter", sbuildin, 1) -plugin_def("export_png", "png/gif/jpg exporter", sbuildin, 1) -plugin_def("export_bom", "bom exporter", sbuildin, 1) -plugin_def("export_xy", "xy (centroid) exporter", sbuildin, 1) -plugin_def("export_gerber", "gerber exporter", sbuildin, 1) -plugin_def("export_lpr", "lpr exporter (printer)", sbuildin, 1) -plugin_def("export_ps", "postscript exporter", sbuildin, 1) -plugin_def("export_dxf", "DXF exporter", sdisable, 0) -plugin_def("export_test", "dummy test exporter", sdisable, 1) -plugin_def("export_bboard", "breadboard exporter", sdisable, 0) -plugin_def("export_openscad", "openscad exporter", sdisable, 0) -plugin_def("export_dsn", "specctra .dsn exporter", sdisable, 0) -plugin_def("export_ipcd356", "IPC-D-356 Netlist exporter",sdisable, 0) -plugin_def("export_svg", "SVG exporter", sbuildin, 1) +plugin_def("export_gcode", "gcode pcb_exporter", sbuildin, 1) +plugin_def("export_nelma", "nelma pcb_exporter", sbuildin, 1) +plugin_def("export_png", "png/gif/jpg pcb_exporter", sbuildin, 1) +plugin_def("export_bom", "bom pcb_exporter", sbuildin, 1) +plugin_def("export_xy", "xy (centroid) pcb_exporter", sbuildin, 1) +plugin_def("export_gerber", "gerber pcb_exporter", sbuildin, 1) +plugin_def("export_lpr", "lpr pcb_exporter (printer)", sbuildin, 1) +plugin_def("export_ps", "postscript pcb_exporter", sbuildin, 1) +plugin_def("export_dxf", "DXF pcb_exporter", sdisable, 0) +plugin_def("export_test", "dummy test pcb_exporter", sdisable, 1) +plugin_def("export_bboard", "breadboard pcb_exporter", sdisable, 0) +plugin_def("export_openscad", "openscad pcb_exporter", sdisable, 0) +plugin_def("export_dsn", "specctra .dsn pcb_exporter", sdisable, 0) +plugin_def("export_ipcd356", "IPC-D-356 Netlist pcb_exporter",sdisable, 0) +plugin_def("export_svg", "SVG pcb_exporter", sbuildin, 1) plugin_header("\nIO plugins (file formats):\n") plugin_def("io_lihata", "lihata board format", sbuildin, 1) @@ -68,9 +68,9 @@ plugin_def("io_kicad", "Kicad's s-expr format", sbuildin, 1) plugin_header("\nHID plugins:\n") -plugin_def("hid_batch", "batch process (no-gui HID)",sbuildin, 1) -plugin_def("hid_gtk", "the GTK gui", sbuildin, 1) -plugin_def("hid_lesstif", "the lesstif gui", sbuildin, 1) +plugin_def("hid_batch", "batch process (no-pcb_gui HID)",sbuildin, 1) +plugin_def("hid_gtk", "the GTK pcb_gui", sbuildin, 1) +plugin_def("hid_lesstif", "the lesstif pcb_gui", sbuildin, 1) plugin_def("hid_remote", "remote HID server", sdisable, 1) plugin_dep("export_lpr", "export_ps") Index: trunk/src/action_act.c =================================================================== --- trunk/src/action_act.c (revision 5047) +++ trunk/src/action_act.c (revision 5048) @@ -95,7 +95,7 @@ defer_updates = 0; if (defer_needs_update) { pcb_undo_inc_serial(); - gui->invalidate_all(); + pcb_gui->invalidate_all(); } fclose(fp); return 0; Index: trunk/src/action_helper.c =================================================================== --- trunk/src/action_helper.c (revision 5047) +++ trunk/src/action_helper.c (revision 5048) @@ -299,7 +299,7 @@ if (Note.Click) { pcb_notify_crosshair_change(pcb_false); Note.Click = pcb_false; - if (Note.Moving && !gui->shift_is_pressed()) { + if (Note.Moving && !pcb_gui->shift_is_pressed()) { Note.Buffer = conf_core.editor.buffer_number; pcb_buffer_set_number(PCB_MAX_BUFFER - 1); pcb_buffer_clear(PCB_PASTEBUFFER); @@ -310,12 +310,12 @@ saved_mode = pcb_true; pcb_crosshair_set_mode(PCB_MODE_PASTE_BUFFER); } - else if (Note.Hit && !gui->shift_is_pressed()) { + else if (Note.Hit && !pcb_gui->shift_is_pressed()) { pcb_box_t box; pcb_crosshair_save_mode(); saved_mode = pcb_true; - pcb_crosshair_set_mode(gui->control_is_pressed()? PCB_MODE_COPY : PCB_MODE_MOVE); + pcb_crosshair_set_mode(pcb_gui->control_is_pressed()? PCB_MODE_COPY : PCB_MODE_MOVE); pcb_crosshair.AttachedObject.Ptr1 = Note.ptr1; pcb_crosshair.AttachedObject.Ptr2 = Note.ptr2; pcb_crosshair.AttachedObject.Ptr3 = Note.ptr3; @@ -327,10 +327,10 @@ } pcb_crosshair.dragx = Note.X; pcb_crosshair.dragy = Note.Y; - box.X1 = Note.X + SLOP * pixel_slop; - box.X2 = Note.X - SLOP * pixel_slop; - box.Y1 = Note.Y + SLOP * pixel_slop; - box.Y2 = Note.Y - SLOP * pixel_slop; + box.X1 = Note.X + SLOP * pcb_pixel_slop; + box.X2 = Note.X - SLOP * pcb_pixel_slop; + box.Y1 = Note.Y + SLOP * pcb_pixel_slop; + box.Y2 = Note.Y - SLOP * pcb_pixel_slop; pcb_crosshair.drags = pcb_list_block(&box, &pcb_crosshair.drags_len); pcb_crosshair.drags_current = 0; AttachForCopy(Note.X, Note.Y); @@ -346,7 +346,7 @@ box.X2 = PCB_MAX_COORD; box.Y2 = PCB_MAX_COORD; /* unselect first if shift key not down */ - if (!gui->shift_is_pressed() && pcb_select_block(&box, pcb_false)) + if (!pcb_gui->shift_is_pressed() && pcb_select_block(&box, pcb_false)) pcb_board_set_changed_flag(pcb_true); pcb_notify_block(); pcb_crosshair.AttachedBox.Point1.X = Note.X; @@ -371,7 +371,7 @@ Note.Click = pcb_false; /* inhibit timer action */ pcb_undo_save_serial(); /* unselect first if shift key not down */ - if (!gui->shift_is_pressed()) { + if (!pcb_gui->shift_is_pressed()) { if (pcb_select_block(&box, pcb_false)) pcb_board_set_changed_flag(pcb_true); if (Note.Moving) { @@ -427,7 +427,7 @@ static void AdjustAttachedBox(void) { if (conf_core.editor.mode == PCB_MODE_ARC) { - pcb_crosshair.AttachedBox.otherway = gui->shift_is_pressed(); + pcb_crosshair.AttachedBox.otherway = pcb_gui->shift_is_pressed(); return; } switch (pcb_crosshair.AttachedBox.State) { @@ -493,7 +493,7 @@ switch (pcb_crosshair.AttachedLine.State) { case PCB_CH_STATE_FIRST: /* first point */ if (PCB->RatDraw && pcb_search_screen(pcb_crosshair.X, pcb_crosshair.Y, PCB_TYPE_PAD | PCB_TYPE_PIN, &ptr1, &ptr1, &ptr1) == PCB_TYPE_NONE) { - gui->beep(); + pcb_gui->beep(); break; } if (conf_core.editor.auto_drc && conf_core.editor.mode == PCB_MODE_LINE) { @@ -568,7 +568,7 @@ Note.Click = pcb_true; /* do something after click time */ - gui->add_timer(click_cb, conf_core.editor.click_time, hv); + pcb_gui->add_timer(click_cb, conf_core.editor.click_time, hv); /* see if we clicked on something already selected * (Note.Moving) or clicked on a MOVE_TYPE @@ -602,7 +602,7 @@ conf_core.design.via_thickness, 2 * conf_core.design.clearance, 0, conf_core.design.via_drilling_hole, NULL, pcb_no_flags())) != NULL) { pcb_undo_add_obj_to_create(PCB_TYPE_VIA, via, via, via); - if (gui->shift_is_pressed()) + if (pcb_gui->shift_is_pressed()) pcb_chg_obj_thermal(PCB_TYPE_VIA, via, via, via, PCB->ThermStyle); pcb_undo_inc_serial(); DrawVia(via); @@ -722,7 +722,7 @@ { if (((type = pcb_search_screen(Note.X, Note.Y, PCB_TYPEMASK_PIN, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) && !PCB_FLAG_TEST(PCB_FLAG_HOLE, (pcb_pin_t *) ptr3)) { - if (gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed()) { int tstyle = PCB_FLAG_THERM_GET(INDEXOFCURRENT, (pcb_pin_t *) ptr3); tstyle++; if (tstyle > 5) @@ -903,7 +903,7 @@ { char *string; - if ((string = gui->prompt_for(_("Enter text:"), "")) != NULL) { + if ((string = pcb_gui->prompt_for(_("Enter text:"), "")) != NULL) { if (strlen(string) > 0) { pcb_text_t *text; int flag = PCB_FLAG_CLEARLINE; @@ -1058,7 +1058,7 @@ pcb_text_t estr[PCB_MAX_ELEMENTNAMES]; pcb_element_t *e = 0; - if (gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed()) { int type = pcb_search_screen(Note.X, Note.Y, PCB_TYPE_ELEMENT, &ptr1, &ptr2, &ptr3); if (type == PCB_TYPE_ELEMENT) { @@ -1130,7 +1130,7 @@ break; case PCB_MODE_ROTATE: - pcb_screen_obj_rotate90(Note.X, Note.Y, gui->shift_is_pressed()? (SWAP_IDENT ? 1 : 3) + pcb_screen_obj_rotate90(Note.X, Note.Y, pcb_gui->shift_is_pressed()? (SWAP_IDENT ? 1 : 3) : (SWAP_IDENT ? 3 : 1)); break; Index: trunk/src/board.c =================================================================== --- trunk/src/board.c (revision 5047) +++ trunk/src/board.c (revision 5048) @@ -221,7 +221,7 @@ { free(PCB->Name); PCB->Name = Name; - if (gui != NULL) + if (pcb_gui != NULL) pcb_hid_action("PCBChanged"); return (pcb_true); } @@ -243,7 +243,7 @@ else pcb_crosshair_set_range(0, 0, Width, Height); - if (gui != NULL) + if (pcb_gui != NULL) pcb_hid_action("PCBChanged"); } Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 5047) +++ trunk/src/buffer.c (revision 5048) @@ -367,7 +367,7 @@ const char *angle_s; if (argc < 1) - angle_s = gui->prompt_for("Enter Rotation (degrees, CCW):", "0"); + angle_s = pcb_gui->prompt_for("Enter Rotation (degrees, CCW):", "0"); else angle_s = argv[0]; @@ -822,7 +822,7 @@ } free_name = pcb_false; if (argc <= 1) { - name = gui->fileselect(_("Save Paste Buffer As ..."), + name = pcb_gui->fileselect(_("Save Paste Buffer As ..."), _("Choose a file to save the contents of the\n" "paste buffer to.\n"), default_file, ".fp", "footprint", 0); @@ -844,7 +844,7 @@ if ((!force) && ((exist = fopen(name, "r")))) { fclose(exist); - if (gui->confirm_dialog(_("File exists! Ok to overwrite?"), 0)) + if (pcb_gui->confirm_dialog(_("File exists! Ok to overwrite?"), 0)) pcb_save_buffer_elements(name, fmt); } else Index: trunk/src/build_run.c =================================================================== --- trunk/src/build_run.c (revision 5047) +++ trunk/src/build_run.c (revision 5048) @@ -50,12 +50,12 @@ else pcb_disable_emergency_save(); - if (gui->do_exit == NULL) { + if (pcb_gui->do_exit == NULL) { pcb_main_uninit(); exit(0); } else - gui->do_exit(gui); + pcb_gui->do_exit(pcb_gui); } /* --------------------------------------------------------------------------- Index: trunk/src/change.c =================================================================== --- trunk/src/change.c (revision 5047) +++ trunk/src/change.c (revision 5048) @@ -1176,11 +1176,11 @@ } switch (Type) { case PCB_TYPE_LINE: - name = gui->prompt_for(_("Linename:"), PCB_EMPTY(((pcb_line_t *) Ptr2)->Number)); + name = pcb_gui->prompt_for(_("Linename:"), PCB_EMPTY(((pcb_line_t *) Ptr2)->Number)); break; case PCB_TYPE_VIA: - name = gui->prompt_for(_("Vianame:"), PCB_EMPTY(((pcb_pin_t *) Ptr2)->Name)); + name = pcb_gui->prompt_for(_("Vianame:"), PCB_EMPTY(((pcb_pin_t *) Ptr2)->Name)); break; case PCB_TYPE_PIN: @@ -1188,7 +1188,7 @@ sprintf(msg, _("%s Pin Number:"), PCB_EMPTY(((pcb_pin_t *) Ptr2)->Number)); else sprintf(msg, _("%s Pin Name:"), PCB_EMPTY(((pcb_pin_t *) Ptr2)->Number)); - name = gui->prompt_for(msg, PCB_EMPTY(((pcb_pin_t *) Ptr2)->Name)); + name = pcb_gui->prompt_for(msg, PCB_EMPTY(((pcb_pin_t *) Ptr2)->Name)); break; case PCB_TYPE_PAD: @@ -1196,15 +1196,15 @@ sprintf(msg, _("%s Pad Number:"), PCB_EMPTY(((pcb_pad_t *) Ptr2)->Number)); else sprintf(msg, _("%s Pad Name:"), PCB_EMPTY(((pcb_pad_t *) Ptr2)->Number)); - name = gui->prompt_for(msg, PCB_EMPTY(((pcb_pad_t *) Ptr2)->Name)); + name = pcb_gui->prompt_for(msg, PCB_EMPTY(((pcb_pad_t *) Ptr2)->Name)); break; case PCB_TYPE_TEXT: - name = gui->prompt_for(_("Enter text:"), PCB_EMPTY(((pcb_text_t *) Ptr2)->TextString)); + name = pcb_gui->prompt_for(_("Enter text:"), PCB_EMPTY(((pcb_text_t *) Ptr2)->TextString)); break; case PCB_TYPE_ELEMENT: - name = gui->prompt_for(_("Elementname:"), PCB_EMPTY(ELEMENT_NAME(PCB, (pcb_element_t *) Ptr2))); + name = pcb_gui->prompt_for(_("Elementname:"), PCB_EMPTY(ELEMENT_NAME(PCB, (pcb_element_t *) Ptr2))); break; } if (name) { Index: trunk/src/change_act.c =================================================================== --- trunk/src/change_act.c (revision 5047) +++ trunk/src/change_act.c (revision 5048) @@ -80,7 +80,7 @@ int funcid = pcb_funchash_get(function, NULL); if (funcid == F_Object) { - gui->get_coords(_("Select an Object"), &x, &y); + pcb_gui->get_coords(_("Select an Object"), &x, &y); type = pcb_search_screen(x, y, PCB_CHANGECLEARSIZE_TYPES, &ptr1, &ptr2, &ptr3); } @@ -270,7 +270,7 @@ int type; void *ptr1, *ptr2, *ptr3; - gui->get_coords(_("Select an Object"), &x, &y); + pcb_gui->get_coords(_("Select an Object"), &x, &y); if ((type = pcb_search_screen(x, y, PCB_TYPE_VIA, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE && pcb_pin_change_hole((pcb_pin_t *) ptr3)) pcb_undo_inc_serial(); break; @@ -312,7 +312,7 @@ int type; void *ptr1, *ptr2, *ptr3; - gui->get_coords(_("Select an Object"), &x, &y); + pcb_gui->get_coords(_("Select an Object"), &x, &y); if ((type = pcb_search_screen(x, y, PCB_TYPE_PAD, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE && pcb_pad_change_paste((pcb_pad_t *) ptr3)) pcb_undo_inc_serial(); break; @@ -496,7 +496,7 @@ int funcid = pcb_funchash_get(function, NULL); if (funcid == F_Object) { - gui->get_coords(_("Select an Object"), &x, &y); + pcb_gui->get_coords(_("Select an Object"), &x, &y); type = pcb_search_screen(x, y, PCB_CHANGE2NDSIZE_TYPES, &ptr1, &ptr2, &ptr3); } @@ -612,7 +612,7 @@ defer_needs_update = 1; else { pcb_undo_inc_serial(); - gui->invalidate_all(); + pcb_gui->invalidate_all(); } } @@ -657,7 +657,7 @@ int type; void *ptr1, *ptr2, *ptr3; - gui->get_coords(_("Select an Object"), &x, &y); + pcb_gui->get_coords(_("Select an Object"), &x, &y); if ((type = pcb_search_screen(x, y, PCB_CHANGENAME_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) { pcb_undo_save_serial(); if ((pinnums != NULL) && (strcasecmp(pinnums, "Number") == 0)) @@ -689,7 +689,7 @@ /* change the layout's name */ case F_Layout: - name = gui->prompt_for(_("Enter the layout name:"), PCB_EMPTY(PCB->Name)); + name = pcb_gui->prompt_for(_("Enter the layout name:"), PCB_EMPTY(PCB->Name)); /* NB: ChangeLayoutName takes ownership of the passed memory */ if (name && pcb_board_change_name(name)) pcb_board_set_changed_flag(pcb_true); @@ -697,7 +697,7 @@ /* change the name of the active layer */ case F_Layer: - name = gui->prompt_for(_("Enter the layer name:"), PCB_EMPTY(CURRENT->Name)); + name = pcb_gui->prompt_for(_("Enter the layer name:"), PCB_EMPTY(CURRENT->Name)); /* NB: ChangeLayerName takes ownership of the passed memory */ if (name && pcb_layer_change_name(CURRENT, name)) pcb_board_set_changed_flag(pcb_true); @@ -734,7 +734,7 @@ int type; void *ptr1, *ptr2, *ptr3; - gui->get_coords(_("Select an Object"), &x, &y); + pcb_gui->get_coords(_("Select an Object"), &x, &y); if ((type = pcb_search_screen(x, y, PCB_CHANGEJOIN_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) if (pcb_chg_obj_join(type, ptr1, ptr2, ptr3)) pcb_board_set_changed_flag(pcb_true); @@ -787,7 +787,7 @@ { int type; void *ptr1, *ptr2, *ptr3; - gui->get_coords(_("Select an Element"), &x, &y); + pcb_gui->get_coords(_("Select an Element"), &x, &y); ptr3 = NULL; type = pcb_search_screen(x, y, PCB_CHANGENONETLIST_TYPES, &ptr1, &ptr2, &ptr3); @@ -833,7 +833,7 @@ int type; void *ptr1, *ptr2, *ptr3; - gui->get_coords(_("Select an Object"), &x, &y); + pcb_gui->get_coords(_("Select an Object"), &x, &y); ptr3 = NULL; type = pcb_search_screen(x, y, PCB_CHANGESQUARE_TYPES, &ptr1, &ptr2, &ptr3); @@ -895,7 +895,7 @@ int type; void *ptr1, *ptr2, *ptr3; - gui->get_coords(_("Select an Object"), &x, &y); + pcb_gui->get_coords(_("Select an Object"), &x, &y); if ((type = pcb_search_screen(x, y, PCB_CHANGESQUARE_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) if (pcb_set_obj_square(type, ptr1, ptr2, ptr3)) pcb_board_set_changed_flag(pcb_true); @@ -947,7 +947,7 @@ int type; void *ptr1, *ptr2, *ptr3; - gui->get_coords(_("Select an Object"), &x, &y); + pcb_gui->get_coords(_("Select an Object"), &x, &y); if ((type = pcb_search_screen(x, y, PCB_CHANGESQUARE_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) if (pcb_clr_obj_square(type, ptr1, ptr2, ptr3)) pcb_board_set_changed_flag(pcb_true); @@ -998,7 +998,7 @@ int type; void *ptr1, *ptr2, *ptr3; - gui->get_coords(_("Select an Object"), &x, &y); + pcb_gui->get_coords(_("Select an Object"), &x, &y); if ((type = pcb_search_screen(x, y, PCB_CHANGEOCTAGON_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) if (pcb_chg_obj_octagon(type, ptr1, ptr2, ptr3)) pcb_board_set_changed_flag(pcb_true); @@ -1053,7 +1053,7 @@ int type; void *ptr1, *ptr2, *ptr3; - gui->get_coords(_("Select an Object"), &x, &y); + pcb_gui->get_coords(_("Select an Object"), &x, &y); if ((type = pcb_search_screen(x, y, PCB_CHANGEOCTAGON_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) if (pcb_set_obj_octagon(type, ptr1, ptr2, ptr3)) pcb_board_set_changed_flag(pcb_true); @@ -1109,7 +1109,7 @@ int type; void *ptr1, *ptr2, *ptr3; - gui->get_coords(_("Select an Object"), &x, &y); + pcb_gui->get_coords(_("Select an Object"), &x, &y); if ((type = pcb_search_screen(pcb_crosshair.X, pcb_crosshair.Y, PCB_CHANGEOCTAGON_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) if (pcb_clr_obj_octagon(type, ptr1, ptr2, ptr3)) pcb_board_set_changed_flag(pcb_true); Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 5047) +++ trunk/src/crosshair.c (revision 5048) @@ -73,7 +73,7 @@ moved_pv.X += x; moved_pv.Y += y; - gui->thindraw_pcb_pv(pcb_crosshair.GC, pcb_crosshair.GC, &moved_pv, pcb_true, pcb_false); + pcb_gui->thindraw_pcb_pv(pcb_crosshair.GC, pcb_crosshair.GC, &moved_pv, pcb_true, pcb_false); } static void draw_dashed_line(pcb_hid_gc_t GC, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) @@ -86,13 +86,13 @@ if (len_squared < 1000000) { /* line too short, just draw it - TODO: magic value; with a proper geo lib this would be gone anyway */ - gui->draw_line(pcb_crosshair.GC, x1, y1, x2, y2); + pcb_gui->draw_line(pcb_crosshair.GC, x1, y1, x2, y2); return; } /* first seg is drawn from x1, y1 with no rounding error due to n-1 == 0 */ for(n = 1; n < segs; n+=2) - gui->draw_line(pcb_crosshair.GC, + pcb_gui->draw_line(pcb_crosshair.GC, x1 + (dx * (double)(n-1) / (double)segs), y1 + (dy * (double)(n-1) / (double)segs), x1 + (dx * (double)n / (double)segs), y1 + (dy * (double)n / (double)segs)); @@ -99,7 +99,7 @@ /* make sure the last segment is drawn properly to x2 and y2, don't leave room for rounding errors */ - gui->draw_line(pcb_crosshair.GC, + pcb_gui->draw_line(pcb_crosshair.GC, x2 - (dx / (double)segs), y2 - (dy / (double)segs), x2, y2); } @@ -126,7 +126,7 @@ } /* normal contour line */ - gui->draw_line(pcb_crosshair.GC, + pcb_gui->draw_line(pcb_crosshair.GC, polygon->Points[i].X + dx, polygon->Points[i].Y + dy, polygon->Points[next].X + dx, polygon->Points[next].Y + dy); } @@ -176,11 +176,11 @@ arc.Width = arc.Height = wy; bx = pcb_arc_get_ends(&arc); /* sa = sa - 180; */ - gui->draw_arc(pcb_crosshair.GC, arc.X, arc.Y, wy + wid, wy + wid, sa, dir); - if (wid > pixel_slop) { - gui->draw_arc(pcb_crosshair.GC, arc.X, arc.Y, wy - wid, wy - wid, sa, dir); - gui->draw_arc(pcb_crosshair.GC, bx->X1, bx->Y1, wid, wid, sa, -180 * SGN(dir)); - gui->draw_arc(pcb_crosshair.GC, bx->X2, bx->Y2, wid, wid, sa + dir, 180 * SGN(dir)); + pcb_gui->draw_arc(pcb_crosshair.GC, arc.X, arc.Y, wy + wid, wy + wid, sa, dir); + if (wid > pcb_pixel_slop) { + pcb_gui->draw_arc(pcb_crosshair.GC, arc.X, arc.Y, wy - wid, wy - wid, sa, dir); + pcb_gui->draw_arc(pcb_crosshair.GC, bx->X1, bx->Y1, wid, wid, sa, -180 * SGN(dir)); + pcb_gui->draw_arc(pcb_crosshair.GC, bx->X2, bx->Y2, wid, wid, sa + dir, 180 * SGN(dir)); } } @@ -200,12 +200,12 @@ h = 0.0; ox = dy * h + 0.5 * SGN(dy); oy = -(dx * h + 0.5 * SGN(dx)); - gui->draw_line(pcb_crosshair.GC, x1 + ox, y1 + oy, x2 + ox, y2 + oy); - if (coord_abs(ox) >= pixel_slop || coord_abs(oy) >= pixel_slop) { + pcb_gui->draw_line(pcb_crosshair.GC, x1 + ox, y1 + oy, x2 + ox, y2 + oy); + if (coord_abs(ox) >= pcb_pixel_slop || coord_abs(oy) >= pcb_pixel_slop) { pcb_angle_t angle = atan2(dx, dy) * 57.295779; - gui->draw_line(pcb_crosshair.GC, x1 - ox, y1 - oy, x2 - ox, y2 - oy); - gui->draw_arc(pcb_crosshair.GC, x1, y1, thick / 2, thick / 2, angle - 180, 180); - gui->draw_arc(pcb_crosshair.GC, x2, y2, thick / 2, thick / 2, angle, 180); + pcb_gui->draw_line(pcb_crosshair.GC, x1 - ox, y1 - oy, x2 - ox, y2 - oy); + pcb_gui->draw_arc(pcb_crosshair.GC, x1, y1, thick / 2, thick / 2, angle - 180, 180); + pcb_gui->draw_arc(pcb_crosshair.GC, x2, y2, thick / 2, thick / 2, angle, 180); } } @@ -216,16 +216,16 @@ { /* if no silkscreen, draw the bounding box */ if (arclist_length(&Element->Arc) == 0 && linelist_length(&Element->Line) == 0) { - gui->draw_line(pcb_crosshair.GC, + pcb_gui->draw_line(pcb_crosshair.GC, DX + Element->BoundingBox.X1, DY + Element->BoundingBox.Y1, DX + Element->BoundingBox.X1, DY + Element->BoundingBox.Y2); - gui->draw_line(pcb_crosshair.GC, + pcb_gui->draw_line(pcb_crosshair.GC, DX + Element->BoundingBox.X1, DY + Element->BoundingBox.Y2, DX + Element->BoundingBox.X2, DY + Element->BoundingBox.Y2); - gui->draw_line(pcb_crosshair.GC, + pcb_gui->draw_line(pcb_crosshair.GC, DX + Element->BoundingBox.X2, DY + Element->BoundingBox.Y2, DX + Element->BoundingBox.X2, DY + Element->BoundingBox.Y1); - gui->draw_line(pcb_crosshair.GC, + pcb_gui->draw_line(pcb_crosshair.GC, DX + Element->BoundingBox.X2, DY + Element->BoundingBox.Y1, DX + Element->BoundingBox.X1, DY + Element->BoundingBox.Y1); } @@ -232,7 +232,7 @@ else { PCB_ELEMENT_PCB_LINE_LOOP(Element); { - gui->draw_line(pcb_crosshair.GC, DX + line->Point1.X, DY + line->Point1.Y, DX + line->Point2.X, DY + line->Point2.Y); + pcb_gui->draw_line(pcb_crosshair.GC, DX + line->Point1.X, DY + line->Point1.Y, DX + line->Point2.X, DY + line->Point2.Y); } END_LOOP; @@ -239,7 +239,7 @@ /* arc coordinates and angles have to be converted to X11 notation */ PCB_ARC_LOOP(Element); { - gui->draw_arc(pcb_crosshair.GC, DX + arc->X, DY + arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta); + pcb_gui->draw_arc(pcb_crosshair.GC, DX + arc->X, DY + arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta); } END_LOOP; } @@ -261,18 +261,18 @@ moved_pad.Point2.X += DX; moved_pad.Point2.Y += DY; - gui->thindraw_pcb_pad(pcb_crosshair.GC, &moved_pad, pcb_false, pcb_false); + pcb_gui->thindraw_pcb_pad(pcb_crosshair.GC, &moved_pad, pcb_false, pcb_false); } } END_LOOP; /* mark */ - gui->draw_line(pcb_crosshair.GC, + pcb_gui->draw_line(pcb_crosshair.GC, Element->MarkX + DX - PCB_EMARK_SIZE, Element->MarkY + DY, Element->MarkX + DX, Element->MarkY + DY - PCB_EMARK_SIZE); - gui->draw_line(pcb_crosshair.GC, + pcb_gui->draw_line(pcb_crosshair.GC, Element->MarkX + DX + PCB_EMARK_SIZE, Element->MarkY + DY, Element->MarkX + DX, Element->MarkY + DY - PCB_EMARK_SIZE); - gui->draw_line(pcb_crosshair.GC, + pcb_gui->draw_line(pcb_crosshair.GC, Element->MarkX + DX - PCB_EMARK_SIZE, Element->MarkY + DY, Element->MarkX + DX, Element->MarkY + DY + PCB_EMARK_SIZE); - gui->draw_line(pcb_crosshair.GC, + pcb_gui->draw_line(pcb_crosshair.GC, Element->MarkX + DX + PCB_EMARK_SIZE, Element->MarkY + DY, Element->MarkX + DX, Element->MarkY + DY + PCB_EMARK_SIZE); } @@ -300,18 +300,18 @@ y +line->Point1.Y, x +line->Point2.X, y +line->Point2.Y, line->Thickness); */ - gui->draw_line(pcb_crosshair.GC, x + line->Point1.X, y + line->Point1.Y, x + line->Point2.X, y + line->Point2.Y); + pcb_gui->draw_line(pcb_crosshair.GC, x + line->Point1.X, y + line->Point1.Y, x + line->Point2.X, y + line->Point2.Y); } END_LOOP; PCB_ARC_LOOP(layer); { - gui->draw_arc(pcb_crosshair.GC, x + arc->X, y + arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta); + pcb_gui->draw_arc(pcb_crosshair.GC, x + arc->X, y + arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta); } END_LOOP; PCB_TEXT_LOOP(layer); { pcb_box_t *box = &text->BoundingBox; - gui->draw_rect(pcb_crosshair.GC, x + box->X1, y + box->Y1, x + box->X2, y + box->Y2); + pcb_gui->draw_rect(pcb_crosshair.GC, x + box->X1, y + box->Y1, x + box->X2, y + box->Y2); } END_LOOP; /* the tmp polygon has n+1 points because the first @@ -351,8 +351,8 @@ pcb_point_t *point = (pcb_point_t *) pcb_crosshair.AttachedObject.Ptr3; if (pcb_crosshair.AttachedObject.Type != PCB_TYPE_NONE) { - gui->draw_line(pcb_crosshair.GC, point->X, point->Y, line->Point1.X, line->Point1.Y); - gui->draw_line(pcb_crosshair.GC, point->X, point->Y, line->Point2.X, line->Point2.Y); + pcb_gui->draw_line(pcb_crosshair.GC, point->X, point->Y, line->Point1.X, line->Point1.Y); + pcb_gui->draw_line(pcb_crosshair.GC, point->X, point->Y, line->Point2.X, line->Point2.Y); } } @@ -385,7 +385,7 @@ { pcb_arc_t *Arc = (pcb_arc_t *) pcb_crosshair.AttachedObject.Ptr2; - gui->draw_arc(pcb_crosshair.GC, Arc->X + dx, Arc->Y + dy, Arc->Width, Arc->Height, Arc->StartAngle, Arc->Delta); + pcb_gui->draw_arc(pcb_crosshair.GC, Arc->X + dx, Arc->Y + dy, Arc->Width, Arc->Height, Arc->StartAngle, Arc->Delta); break; } @@ -429,8 +429,8 @@ next = pcb_poly_contour_next_point(polygon, point_idx); /* draw the two segments */ - gui->draw_line(pcb_crosshair.GC, polygon->Points[prev].X, polygon->Points[prev].Y, point->X + dx, point->Y + dy); - gui->draw_line(pcb_crosshair.GC, point->X + dx, point->Y + dy, polygon->Points[next].X, polygon->Points[next].Y); + pcb_gui->draw_line(pcb_crosshair.GC, polygon->Points[prev].X, polygon->Points[prev].Y, point->X + dx, point->Y + dy); + pcb_gui->draw_line(pcb_crosshair.GC, point->X + dx, point->Y + dy, polygon->Points[next].X, polygon->Points[next].Y); break; } @@ -439,7 +439,7 @@ /* locate the element "mark" and draw an association line from crosshair to it */ pcb_element_t *element = (pcb_element_t *) pcb_crosshair.AttachedObject.Ptr1; - gui->draw_line(pcb_crosshair.GC, element->MarkX, element->MarkY, pcb_crosshair.X, pcb_crosshair.Y); + pcb_gui->draw_line(pcb_crosshair.GC, element->MarkX, element->MarkY, pcb_crosshair.X, pcb_crosshair.Y); /* fall through to move the text as a box outline */ } case PCB_TYPE_TEXT: @@ -446,7 +446,7 @@ { pcb_text_t *text = (pcb_text_t *) pcb_crosshair.AttachedObject.Ptr2; pcb_box_t *box = &text->BoundingBox; - gui->draw_rect(pcb_crosshair.GC, box->X1 + dx, box->Y1 + dy, box->X2 + dx, box->Y2 + dy); + pcb_gui->draw_rect(pcb_crosshair.GC, box->X1 + dx, box->Y1 + dy, box->X2 + dx, box->Y2 + dy); break; } @@ -506,14 +506,14 @@ via.Mask = 0; via.Flags = pcb_no_flags(); - gui->thindraw_pcb_pv(pcb_crosshair.GC, pcb_crosshair.GC, &via, pcb_true, pcb_false); + pcb_gui->thindraw_pcb_pv(pcb_crosshair.GC, pcb_crosshair.GC, &via, pcb_true, pcb_false); if (conf_core.editor.show_drc) { /* XXX: Naughty cheat - use the mask to draw DRC clearance! */ via.Mask = conf_core.design.via_thickness + PCB->Bloat * 2; - gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.cross); - gui->thindraw_pcb_pv(pcb_crosshair.GC, pcb_crosshair.GC, &via, pcb_false, pcb_true); - gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.crosshair); + pcb_gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.cross); + pcb_gui->thindraw_pcb_pv(pcb_crosshair.GC, pcb_crosshair.GC, &via, pcb_false, pcb_true); + pcb_gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.crosshair); } break; } @@ -523,7 +523,7 @@ case PCB_MODE_POLYGON_HOLE: /* draw only if starting point is set */ if (pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST) - gui->draw_line(pcb_crosshair.GC, + pcb_gui->draw_line(pcb_crosshair.GC, pcb_crosshair.AttachedLine.Point1.X, pcb_crosshair.AttachedLine.Point1.Y, pcb_crosshair.AttachedLine.Point2.X, pcb_crosshair.AttachedLine.Point2.Y); @@ -537,9 +537,9 @@ if (pcb_crosshair.AttachedBox.State != PCB_CH_STATE_FIRST) { XORDrawAttachedArc(conf_core.design.line_thickness); if (conf_core.editor.show_drc) { - gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.cross); + pcb_gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.cross); XORDrawAttachedArc(conf_core.design.line_thickness + 2 * (PCB->Bloat + 1)); - gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.crosshair); + pcb_gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.crosshair); } } @@ -558,7 +558,7 @@ pcb_crosshair.AttachedLine.Point2.Y, pcb_crosshair.X, pcb_crosshair.Y, PCB->RatDraw ? 10 : conf_core.design.line_thickness); if (conf_core.editor.show_drc) { - gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.cross); + pcb_gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.cross); XORDrawAttachedLine(pcb_crosshair.AttachedLine.Point1.X, pcb_crosshair.AttachedLine.Point1.Y, pcb_crosshair.AttachedLine.Point2.X, @@ -567,7 +567,7 @@ XORDrawAttachedLine(pcb_crosshair.AttachedLine.Point2.X, pcb_crosshair.AttachedLine.Point2.Y, pcb_crosshair.X, pcb_crosshair.Y, PCB->RatDraw ? 10 : conf_core.design.line_thickness + 2 * (PCB->Bloat + 1)); - gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.crosshair); + pcb_gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.crosshair); } } break; @@ -594,7 +594,7 @@ y1 = pcb_crosshair.AttachedBox.Point1.Y; x2 = pcb_crosshair.AttachedBox.Point2.X; y2 = pcb_crosshair.AttachedBox.Point2.Y; - gui->draw_rect(pcb_crosshair.GC, x1, y1, x2, y2); + pcb_gui->draw_rect(pcb_crosshair.GC, x1, y1, x2, y2); } } @@ -610,8 +610,8 @@ if (!pcb_marked.status) return; - gui->draw_line(pcb_crosshair.GC, pcb_marked.X - ms, pcb_marked.Y - ms, pcb_marked.X + ms, pcb_marked.Y + ms); - gui->draw_line(pcb_crosshair.GC, pcb_marked.X + ms, pcb_marked.Y - ms, pcb_marked.X - ms, pcb_marked.Y + ms); + pcb_gui->draw_line(pcb_crosshair.GC, pcb_marked.X - ms, pcb_marked.Y - ms, pcb_marked.X + ms, pcb_marked.Y + ms); + pcb_gui->draw_line(pcb_crosshair.GC, pcb_marked.X + ms, pcb_marked.Y - ms, pcb_marked.X - ms, pcb_marked.Y + ms); } /* --------------------------------------------------------------------------- @@ -643,8 +643,8 @@ */ void pcb_notify_crosshair_change(pcb_bool changes_complete) { - if (gui->notify_crosshair_change) - gui->notify_crosshair_change(changes_complete); + if (pcb_gui->notify_crosshair_change) + pcb_gui->notify_crosshair_change(changes_complete); } @@ -664,8 +664,8 @@ */ void pcb_notify_mark_change(pcb_bool changes_complete) { - if (gui->notify_mark_change) - gui->notify_mark_change(changes_complete); + if (pcb_gui->notify_mark_change) + pcb_gui->notify_mark_change(changes_complete); } @@ -902,7 +902,7 @@ double sq_dist; sq_dist = crosshair_sq_dist(snap_data->crosshair, x, y); - if (sq_dist < snap_data->nearest_sq_dist || (prefer_to_grid && snap_data->nearest_is_grid && !gui->shift_is_pressed())) { + if (sq_dist < snap_data->nearest_sq_dist || (prefer_to_grid && snap_data->nearest_is_grid && !pcb_gui->shift_is_pressed())) { snap_data->x = x; snap_data->y = y; snap_data->nearest_sq_dist = sq_dist; @@ -1152,7 +1152,7 @@ if (conf_core.editor.mode == PCB_MODE_LINE && pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST && conf_core.editor.auto_drc) EnforceLineDRC(); - gui->set_crosshair(pcb_crosshair.X, pcb_crosshair.Y, HID_SC_DO_NOTHING); + pcb_gui->set_crosshair(pcb_crosshair.X, pcb_crosshair.Y, HID_SC_DO_NOTHING); } /* --------------------------------------------------------------------------- @@ -1213,7 +1213,7 @@ PCB->Grid = 1; if (pcb_crosshair_move_absolute(X, Y)) pcb_notify_crosshair_change(pcb_true); - gui->set_crosshair(pcb_crosshair.X, pcb_crosshair.Y, HID_SC_WARP_POINTER); + pcb_gui->set_crosshair(pcb_crosshair.X, pcb_crosshair.Y, HID_SC_WARP_POINTER); PCB->Grid = save_grid; } @@ -1223,12 +1223,12 @@ */ void pcb_crosshair_init(void) { - pcb_crosshair.GC = gui->make_gc(); + pcb_crosshair.GC = pcb_gui->make_gc(); - gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.crosshair); - gui->set_draw_xor(pcb_crosshair.GC, 1); - gui->set_line_cap(pcb_crosshair.GC, Trace_Cap); - gui->set_line_width(pcb_crosshair.GC, 1); + pcb_gui->set_color(pcb_crosshair.GC, conf_core.appearance.color.crosshair); + pcb_gui->set_draw_xor(pcb_crosshair.GC, 1); + pcb_gui->set_line_cap(pcb_crosshair.GC, Trace_Cap); + pcb_gui->set_line_width(pcb_crosshair.GC, 1); /* set initial shape */ pcb_crosshair.shape = pcb_ch_shape_basic; @@ -1252,7 +1252,7 @@ void pcb_crosshair_uninit(void) { pcb_poly_free_fields(&pcb_crosshair.AttachedPolygon); - gui->destroy_gc(pcb_crosshair.GC); + pcb_gui->destroy_gc(pcb_crosshair.GC); } /************************* mode *************************************/ Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 5047) +++ trunk/src/draw.c (revision 5048) @@ -111,7 +111,7 @@ if (pcb_draw_inhibit) return; if (pcb_draw_invalidated.X1 <= pcb_draw_invalidated.X2 && pcb_draw_invalidated.Y1 <= pcb_draw_invalidated.Y2) - gui->invalidate_lr(pcb_draw_invalidated.X1, pcb_draw_invalidated.X2, pcb_draw_invalidated.Y1, pcb_draw_invalidated.Y2); + pcb_gui->invalidate_lr(pcb_draw_invalidated.X1, pcb_draw_invalidated.X2, pcb_draw_invalidated.Y1, pcb_draw_invalidated.Y2); /* shrink the update block */ pcb_draw_invalidated.X1 = pcb_draw_invalidated.Y1 = MAXINT; @@ -123,7 +123,7 @@ */ void pcb_redraw(void) { - gui->invalidate_all(); + pcb_gui->invalidate_all(); } static void DrawHoles(pcb_bool draw_plated, pcb_bool draw_unplated, const pcb_box_t * drawn_area) @@ -147,9 +147,9 @@ int side_group = GetLayerGroupNumberByNumber(pcb_max_copper_layer + side); pcb_draw_doing_assy = pcb_true; - gui->set_draw_faded(Output.fgGC, 1); + pcb_gui->set_draw_faded(Output.fgGC, 1); DrawLayerGroup(side_group, drawn_area); - gui->set_draw_faded(Output.fgGC, 0); + pcb_gui->set_draw_faded(Output.fgGC, 0); /* draw package */ DrawSilk(side, drawn_area); @@ -161,14 +161,14 @@ int plated, unplated; pcb_board_count_holes(&plated, &unplated, drawn_area); - if (plated && gui->set_layer("plated-drill", SL(PDRILL, 0), 0)) { + if (plated && pcb_gui->set_layer("plated-drill", SL(PDRILL, 0), 0)) { DrawHoles(pcb_true, pcb_false, drawn_area); - gui->end_layer(); + pcb_gui->end_layer(); } - if (unplated && gui->set_layer("unplated-drill", SL(UDRILL, 0), 0)) { + if (unplated && pcb_gui->set_layer("unplated-drill", SL(UDRILL, 0), 0)) { DrawHoles(pcb_false, pcb_true, drawn_area); - gui->end_layer(); + pcb_gui->end_layer(); } } @@ -206,7 +206,7 @@ * first draw all 'invisible' stuff */ if (!conf_core.editor.check_planes - && gui->set_layer("invisible", SL(INVISIBLE, 0), 0)) { + && pcb_gui->set_layer("invisible", SL(INVISIBLE, 0), 0)) { side = SWAP_IDENT ? COMPONENT_LAYER : SOLDER_LAYER; if (PCB->ElementOn) { pcb_r_search(PCB->Data->element_tree, drawn_area, NULL, draw_element_callback, &side, NULL); @@ -214,7 +214,7 @@ pcb_draw_layer(&(PCB->Data->Layer[pcb_max_copper_layer + side]), drawn_area); } pcb_r_search(PCB->Data->pad_tree, drawn_area, NULL, draw_pad_callback, &side, NULL); - gui->end_layer(); + pcb_gui->end_layer(); } /* draw all layers in layerstack order */ @@ -221,81 +221,81 @@ for (i = ngroups - 1; i >= 0; i--) { int group = drawn_groups[i]; - if (gui->set_layer(0, group, 0)) { + if (pcb_gui->set_layer(0, group, 0)) { DrawLayerGroup(group, drawn_area); - gui->end_layer(); + pcb_gui->end_layer(); } } - if (conf_core.editor.check_planes && gui->gui) + if (conf_core.editor.check_planes && pcb_gui->gui) return; /* Draw pins, pads, vias below silk */ - if (gui->gui) + if (pcb_gui->gui) DrawPPV(SWAP_IDENT ? solder : component, drawn_area); - else if (!gui->holes_after) + else if (!pcb_gui->holes_after) DrawEverything_holes(drawn_area); /* Draw the solder mask if turned on */ - if (gui->set_layer("componentmask", SL(MASK, TOP), 0)) { + if (pcb_gui->set_layer("componentmask", SL(MASK, TOP), 0)) { DrawMask(COMPONENT_LAYER, drawn_area); - gui->end_layer(); + pcb_gui->end_layer(); } - if (gui->set_layer("soldermask", SL(MASK, BOTTOM), 0)) { + if (pcb_gui->set_layer("soldermask", SL(MASK, BOTTOM), 0)) { DrawMask(SOLDER_LAYER, drawn_area); - gui->end_layer(); + pcb_gui->end_layer(); } - if (gui->set_layer("topsilk", SL(SILK, TOP), 0)) { + if (pcb_gui->set_layer("topsilk", SL(SILK, TOP), 0)) { DrawSilk(COMPONENT_LAYER, drawn_area); - gui->end_layer(); + pcb_gui->end_layer(); } - if (gui->set_layer("bottomsilk", SL(SILK, BOTTOM), 0)) { + if (pcb_gui->set_layer("bottomsilk", SL(SILK, BOTTOM), 0)) { DrawSilk(SOLDER_LAYER, drawn_area); - gui->end_layer(); + pcb_gui->end_layer(); } - if (gui->holes_after) + if (pcb_gui->holes_after) DrawEverything_holes(drawn_area); - if (gui->gui) { + if (pcb_gui->gui) { /* Draw element Marks */ if (PCB->PinOn) pcb_r_search(PCB->Data->element_tree, drawn_area, NULL, draw_element_mark_callback, NULL, NULL); /* Draw rat lines on top */ - if (gui->set_layer("rats", SL(RATS, 0), 0)) { + if (pcb_gui->set_layer("rats", SL(RATS, 0), 0)) { DrawRats(drawn_area); - gui->end_layer(); + pcb_gui->end_layer(); } } paste_empty = IsPasteEmpty(COMPONENT_LAYER); - if (gui->set_layer("toppaste", SL(PASTE, TOP), paste_empty)) { + if (pcb_gui->set_layer("toppaste", SL(PASTE, TOP), paste_empty)) { DrawPaste(COMPONENT_LAYER, drawn_area); - gui->end_layer(); + pcb_gui->end_layer(); } paste_empty = IsPasteEmpty(SOLDER_LAYER); - if (gui->set_layer("bottompaste", SL(PASTE, BOTTOM), paste_empty)) { + if (pcb_gui->set_layer("bottompaste", SL(PASTE, BOTTOM), paste_empty)) { DrawPaste(SOLDER_LAYER, drawn_area); - gui->end_layer(); + pcb_gui->end_layer(); } - if (gui->set_layer("topassembly", SL(ASSY, TOP), 0)) { + if (pcb_gui->set_layer("topassembly", SL(ASSY, TOP), 0)) { PrintAssembly(COMPONENT_LAYER, drawn_area); - gui->end_layer(); + pcb_gui->end_layer(); } - if (gui->set_layer("bottomassembly", SL(ASSY, BOTTOM), 0)) { + if (pcb_gui->set_layer("bottomassembly", SL(ASSY, BOTTOM), 0)) { PrintAssembly(SOLDER_LAYER, drawn_area); - gui->end_layer(); + pcb_gui->end_layer(); } - if (gui->set_layer("fab", SL(FAB, 0), 0)) { + if (pcb_gui->set_layer("fab", SL(FAB, 0), 0)) { pcb_stub_draw_fab(Output.fgGC); - gui->end_layer(); + pcb_gui->end_layer(); } } @@ -309,7 +309,7 @@ int solder_group = GetLayerGroupNumberByNumber(pcb_solder_silk_layer); int side; - if (PCB->PinOn || !gui->gui) { + if (PCB->PinOn || !pcb_gui->gui) { /* draw element pins */ pcb_r_search(PCB->Data->pin_tree, drawn_area, NULL, draw_pin_callback, NULL, NULL); @@ -326,7 +326,7 @@ } /* draw vias */ - if (PCB->ViaOn || !gui->gui) { + if (PCB->ViaOn || !pcb_gui->gui) { pcb_r_search(PCB->Data->via_tree, drawn_area, NULL, draw_via_callback, NULL, NULL); pcb_r_search(PCB->Data->via_tree, drawn_area, NULL, draw_hole_callback, NULL, NULL); } @@ -347,8 +347,8 @@ #endif #if 0 - if (gui->poly_before) { - gui->use_mask(HID_MASK_BEFORE); + if (pcb_gui->poly_before) { + pcb_gui->use_mask(HID_MASK_BEFORE); #endif pcb_draw_layer(LAYER_PTR(pcb_max_copper_layer + side), drawn_area); /* draw package */ @@ -357,19 +357,19 @@ #if 0 } - gui->use_mask(HID_MASK_CLEAR); + pcb_gui->use_mask(HID_MASK_CLEAR); pcb_r_search(PCB->Data->pin_tree, drawn_area, NULL, clear_pin_callback, NULL, NULL); pcb_r_search(PCB->Data->via_tree, drawn_area, NULL, clear_pin_callback, NULL, NULL); pcb_r_search(PCB->Data->pad_tree, drawn_area, NULL, clear_pad_callback, &side, NULL); - if (gui->poly_after) { - gui->use_mask(HID_MASK_AFTER); + if (pcb_gui->poly_after) { + pcb_gui->use_mask(HID_MASK_AFTER); pcb_draw_layer(LAYER_PTR(pcb_max_copper_layer + layer), drawn_area); /* draw package */ pcb_r_search(PCB->Data->element_tree, drawn_area, NULL, draw_element_callback, &side, NULL); pcb_r_search(PCB->Data->name_tree[NAME_INDEX()], drawn_area, NULL, draw_element_name_callback, &side, NULL); } - gui->use_mask(HID_MASK_OFF); + pcb_gui->use_mask(HID_MASK_OFF); #endif } @@ -377,15 +377,15 @@ static void DrawMaskBoardArea(int mask_type, const pcb_box_t * drawn_area) { /* Skip the mask drawing if the GUI doesn't want this type */ - if ((mask_type == HID_MASK_BEFORE && !gui->poly_before) || (mask_type == HID_MASK_AFTER && !gui->poly_after)) + if ((mask_type == HID_MASK_BEFORE && !pcb_gui->poly_before) || (mask_type == HID_MASK_AFTER && !pcb_gui->poly_after)) return; - gui->use_mask(mask_type); - gui->set_color(Output.fgGC, PCB->MaskColor); + pcb_gui->use_mask(mask_type); + pcb_gui->set_color(Output.fgGC, PCB->MaskColor); if (drawn_area == NULL) - gui->fill_rect(Output.fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight); + pcb_gui->fill_rect(Output.fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight); else - gui->fill_rect(Output.fgGC, drawn_area->X1, drawn_area->Y1, drawn_area->X2, drawn_area->Y2); + pcb_gui->fill_rect(Output.fgGC, drawn_area->X1, drawn_area->Y1, drawn_area->X2, drawn_area->Y2); } /* --------------------------------------------------------------------------- @@ -396,10 +396,10 @@ int thin = conf_core.editor.thin_draw || conf_core.editor.thin_draw_poly; if (thin) - gui->set_color(Output.pmGC, PCB->MaskColor); + pcb_gui->set_color(Output.pmGC, PCB->MaskColor); else { DrawMaskBoardArea(HID_MASK_BEFORE, screen); - gui->use_mask(HID_MASK_CLEAR); + pcb_gui->use_mask(HID_MASK_CLEAR); } pcb_r_search(PCB->Data->pin_tree, screen, NULL, clear_pin_callback, NULL, NULL); @@ -407,10 +407,10 @@ pcb_r_search(PCB->Data->pad_tree, screen, NULL, clear_pad_callback, &side, NULL); if (thin) - gui->set_color(Output.pmGC, "erase"); + pcb_gui->set_color(Output.pmGC, "erase"); else { DrawMaskBoardArea(HID_MASK_AFTER, screen); - gui->use_mask(HID_MASK_OFF); + pcb_gui->use_mask(HID_MASK_OFF); } } @@ -422,13 +422,13 @@ * XXX using the mask here is to get rat transparency */ #warning TODO: make this a pcb_hid_t struct item instead - int can_mask = strcmp(gui->name, "lesstif") == 0; + int can_mask = strcmp(pcb_gui->name, "lesstif") == 0; if (can_mask) - gui->use_mask(HID_MASK_CLEAR); + pcb_gui->use_mask(HID_MASK_CLEAR); pcb_r_search(PCB->Data->rat_tree, drawn_area, NULL, draw_rat_callback, NULL, NULL); if (can_mask) - gui->use_mask(HID_MASK_OFF); + pcb_gui->use_mask(HID_MASK_OFF); } void pcb_draw_layer(pcb_layer_t *Layer, const pcb_box_t * screen) @@ -453,14 +453,14 @@ /* draw the layer text on screen */ pcb_r_search(Layer->text_tree, screen, NULL, draw_text_callback, Layer, NULL); - /* We should check for gui->gui here, but it's kinda cool seeing the + /* We should check for pcb_gui->gui here, but it's kinda cool seeing the auto-outline magically disappear when you first add something to the "outline" layer. */ if (IsLayerEmpty(Layer) && (strcmp(Layer->Name, "outline") == 0 || strcmp(Layer->Name, "route") == 0)) { - gui->set_color(Output.fgGC, Layer->Color); - gui->set_line_width(Output.fgGC, PCB->minWid); - gui->draw_rect(Output.fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight); + pcb_gui->set_color(Output.fgGC, Layer->Color); + pcb_gui->set_line_width(Output.fgGC, PCB->minWid); + pcb_gui->draw_rect(Output.fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight); } } @@ -487,7 +487,7 @@ if (n_entries > 1) rv = 1; - if (rv && !gui->gui) + if (rv && !pcb_gui->gui) DrawPPV(group, drawn_area); } @@ -578,12 +578,12 @@ void pcb_hid_expose_callback(pcb_hid_t * hid, pcb_box_t * region, void *item) { - pcb_hid_t *old_gui = gui; + pcb_hid_t *old_gui = pcb_gui; - gui = hid; - Output.fgGC = gui->make_gc(); - Output.bgGC = gui->make_gc(); - Output.pmGC = gui->make_gc(); + pcb_gui = hid; + Output.fgGC = pcb_gui->make_gc(); + Output.bgGC = pcb_gui->make_gc(); + Output.pmGC = pcb_gui->make_gc(); hid->set_color(Output.pmGC, "erase"); hid->set_color(Output.bgGC, "drill"); @@ -596,8 +596,8 @@ else DrawEverything(region); - gui->destroy_gc(Output.fgGC); - gui->destroy_gc(Output.bgGC); - gui->destroy_gc(Output.pmGC); - gui = old_gui; + pcb_gui->destroy_gc(Output.fgGC); + pcb_gui->destroy_gc(Output.bgGC); + pcb_gui->destroy_gc(Output.pmGC); + pcb_gui = old_gui; } Index: trunk/src/error.c =================================================================== --- trunk/src/error.c (revision 5047) +++ trunk/src/error.c (revision 5048) @@ -61,9 +61,9 @@ /* TODO(hzeller): do something useful with the level, e.g. color coding. */ - if (gui != NULL) { + if (pcb_gui != NULL) { va_start(args, Format); - gui->logv(level, Format, args); + pcb_gui->logv(level, Format, args); va_end(args); } Index: trunk/src/file_act.c =================================================================== --- trunk/src/file_act.c (revision 5047) +++ trunk/src/file_act.c (revision 5048) @@ -131,7 +131,7 @@ } else if (strcasecmp(function, "Layout") == 0) { - if (!PCB->Changed || gui->confirm_dialog(_("OK to override layout data?"), 0)) + if (!PCB->Changed || pcb_gui->confirm_dialog(_("OK to override layout data?"), 0)) pcb_load_pcb(name, format, pcb_true, 0); } @@ -148,7 +148,7 @@ pcb_netlist_changed(1); } else if (strcasecmp(function, "Revert") == 0 && PCB->Filename - && (!PCB->Changed || gui->confirm_dialog(_("OK to override changes?"), 0))) { + && (!PCB->Changed || pcb_gui->confirm_dialog(_("OK to override changes?"), 0))) { pcb_revert_pcb(); } @@ -172,11 +172,11 @@ const char *argument_name = PCB_ACTION_ARG(0); char *name = NULL; - if (!PCB->Changed || gui->confirm_dialog(_("OK to clear layout data?"), 0)) { + if (!PCB->Changed || pcb_gui->confirm_dialog(_("OK to clear layout data?"), 0)) { if (argument_name) name = pcb_strdup(argument_name); else - name = gui->prompt_for(_("Enter the layout name:"), ""); + name = pcb_gui->prompt_for(_("Enter the layout name:"), ""); if (!name) return 1; @@ -200,7 +200,7 @@ pcb_center_display(PCB->MaxWidth / 2, PCB->MaxHeight / 2); pcb_redraw(); - if (gui != NULL) + if (pcb_gui != NULL) pcb_hid_action("PCBChanged"); pcb_notify_crosshair_change(pcb_true); return 0; @@ -254,8 +254,8 @@ if (strcasecmp(function, "Layout") == 0) { if (pcb_save_pcb(PCB->Filename, NULL) == 0) pcb_board_set_changed_flag(pcb_false); - if (gui->notify_filename_changed != NULL) - gui->notify_filename_changed(); + if (pcb_gui->notify_filename_changed != NULL) + pcb_gui->notify_filename_changed(); return 0; } @@ -270,8 +270,8 @@ pcb_board_set_changed_flag(pcb_false); free(PCB->Filename); PCB->Filename = pcb_strdup(name); - if (gui->notify_filename_changed != NULL) - gui->notify_filename_changed(); + if (pcb_gui->notify_filename_changed != NULL) + pcb_gui->notify_filename_changed(); } return 0; } @@ -342,7 +342,7 @@ PCB->Changed = 0; exit(0); } - if (!PCB->Changed || gui->close_confirm_dialog() == HID_CLOSE_CONFIRM_OK) + if (!PCB->Changed || pcb_gui->close_confirm_dialog() == HID_CLOSE_CONFIRM_OK) pcb_quit_app(); return 1; } Index: trunk/src/find_act.c =================================================================== --- trunk/src/find_act.c (revision 5047) +++ trunk/src/find_act.c (revision 5048) @@ -49,7 +49,7 @@ { int count; - if (gui->drc_gui == NULL || gui->drc_gui->log_drc_overview) { + if (pcb_gui->drc_gui == NULL || pcb_gui->drc_gui->log_drc_overview) { pcb_message(PCB_MSG_DEFAULT, _("%m+Rules are minspace %$mS, minoverlap %$mS " "minwidth %$mS, minsilk %$mS\n" "min drill %$mS, min annular ring %$mS\n"), @@ -56,7 +56,7 @@ conf_core.editor.grid_unit->allow, PCB->Bloat, PCB->Shrink, PCB->minWid, PCB->minSlk, PCB->minDrill, PCB->minRing); } count = pcb_drc_all(); - if (gui->drc_gui == NULL || gui->drc_gui->log_drc_overview) { + if (pcb_gui->drc_gui == NULL || pcb_gui->drc_gui->log_drc_overview) { if (count == 0) pcb_message(PCB_MSG_DEFAULT, _("No DRC problems found.\n")); else if (count > 0) Index: trunk/src/find_drc.c =================================================================== --- trunk/src/find_drc.c (revision 5047) +++ trunk/src/find_drc.c (revision 5048) @@ -78,8 +78,8 @@ static void reset_drc_dialog_message(void) { gds_truncate(&drc_dialog_message, 0); - if (gui->drc_gui != NULL) - gui->drc_gui->reset_drc_dialog_message(); + if (pcb_gui->drc_gui != NULL) + pcb_gui->drc_gui->reset_drc_dialog_message(); } static void append_drc_dialog_message(const char *fmt, ...) @@ -181,8 +181,8 @@ static void append_drc_violation(pcb_drc_violation_t * violation) { - if (gui->drc_gui != NULL) { - gui->drc_gui->append_drc_violation(violation); + if (pcb_gui->drc_gui != NULL) { + pcb_gui->drc_gui->append_drc_violation(violation); } else { /* Fallback to formatting the violation message as text */ @@ -191,7 +191,7 @@ GotoError(); } - if (gui->drc_gui == NULL || gui->drc_gui->log_drc_violations) { + if (pcb_gui->drc_gui == NULL || pcb_gui->drc_gui->log_drc_violations) { pcb_message(PCB_MSG_DEFAULT, _("WARNING! Design Rule error - %s\n"), violation->title); pcb_message(PCB_MSG_DEFAULT, _("%m+near location %$mD\n"), conf_core.editor.grid_unit->allow, violation->x, violation->y); } @@ -210,13 +210,13 @@ { int r; - if (gui->drc_gui != NULL) { - r = gui->drc_gui->throw_drc_dialog(); + if (pcb_gui->drc_gui != NULL) { + r = pcb_gui->drc_gui->throw_drc_dialog(); } else { /* Fallback to formatting the violation message as text */ append_drc_dialog_message(DRC_CONTINUE); - r = gui->confirm_dialog(drc_dialog_message.array, DRC_CANCEL, DRC_NEXT); + r = pcb_gui->confirm_dialog(drc_dialog_message.array, DRC_CANCEL, DRC_NEXT); reset_drc_dialog_message(); } return r; @@ -691,7 +691,7 @@ RestoreStackAndVisibility(); pcb_hid_action("LayersChanged"); - gui->invalidate_all(); + pcb_gui->invalidate_all(); if (nopastecnt > 0) { pcb_message(PCB_MSG_DEFAULT, _("Warning: %d pad%s the nopaste flag set.\n"), nopastecnt, nopastecnt > 1 ? "s have" : " has"); Index: trunk/src/find_misc.c =================================================================== --- trunk/src/find_misc.c (revision 5047) +++ trunk/src/find_misc.c (revision 5048) @@ -260,7 +260,7 @@ if (AndDraw) pcb_draw(); if (AndDraw && conf_core.editor.beep_when_finished) - gui->beep(); + pcb_gui->beep(); pcb_conn_lookup_uninit(); } Index: trunk/src/find_print.c =================================================================== --- trunk/src/find_print.c (revision 5047) +++ trunk/src/find_print.c (revision 5048) @@ -231,7 +231,7 @@ END_LOOP; if (conf_core.editor.beep_when_finished) - gui->beep(); + pcb_gui->beep(); pcb_conn_lookup_uninit(); pcb_undo_inc_serial(); User = pcb_false; @@ -251,7 +251,7 @@ PrintElementConnections(Element, FP, pcb_true); pcb_board_set_changed_flag(pcb_true); if (conf_core.editor.beep_when_finished) - gui->beep(); + pcb_gui->beep(); pcb_conn_lookup_uninit(); pcb_undo_inc_serial(); User = pcb_false; @@ -281,7 +281,7 @@ } END_LOOP; if (conf_core.editor.beep_when_finished) - gui->beep(); + pcb_gui->beep(); pcb_reset_conns(pcb_false); pcb_conn_lookup_uninit(); pcb_redraw(); Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 5047) +++ trunk/src/gui_act.c (revision 5048) @@ -440,10 +440,10 @@ void *ptrtmp; pcb_coord_t x, y; - gui->get_coords(_("Click on an element"), &x, &y); + pcb_gui->get_coords(_("Click on an element"), &x, &y); if ((pcb_search_screen(x, y, PCB_TYPE_ELEMENT, &ptrtmp, &ptrtmp, &ptrtmp)) != PCB_TYPE_NONE) { element = (pcb_element_t *) ptrtmp; - gui->show_item(element); + pcb_gui->show_item(element); } break; } @@ -453,7 +453,7 @@ { void *ptr1, *ptr2, *ptr3; pcb_coord_t x, y; - gui->get_coords(_("Click on an element"), &x, &y); + pcb_gui->get_coords(_("Click on an element"), &x, &y); switch (pcb_search_screen(x, y, PCB_TYPE_ELEMENT | PCB_TYPE_PIN | PCB_TYPE_PAD | @@ -800,7 +800,7 @@ static const char cycledrag_help[] = "Cycle through which object is being dragged"; -#define close_enough(a, b) ((((a)-(b)) > 0) ? ((a)-(b) < (SLOP * pixel_slop)) : ((a)-(b) > -(SLOP * pixel_slop))) +#define close_enough(a, b) ((((a)-(b)) > 0) ? ((a)-(b) < (SLOP * pcb_pixel_slop)) : ((a)-(b) > -(SLOP * pcb_pixel_slop))) static int ActionCycleDrag(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { void *ptr1, *ptr2, *ptr3; @@ -916,7 +916,7 @@ int type; void *ptr1, *ptr2, *ptr3; - gui->get_coords(_("Select an Object"), &x, &y); + pcb_gui->get_coords(_("Select an Object"), &x, &y); if ((type = pcb_search_screen(x, y, PCB_TYPE_ELEMENT, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) { pcb_undo_add_obj_to_flag(type, ptr1, ptr2, ptr3); EraseElementName((pcb_element_t *) ptr2); @@ -1058,13 +1058,13 @@ static int ActionCreateMenu(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { - if (gui == NULL) { + if (pcb_gui == NULL) { pcb_message(PCB_MSG_DEFAULT, "Error: can't create menu, there's no GUI hid loaded\n"); return 1; } if (argc > 0) { - gui->create_menu(argv[0], (argc > 1) ? argv[1] : NULL, (argc > 2) ? argv[2] : NULL, (argc > 3) ? argv[3] : NULL, (argc > 4) ? argv[4] : NULL, (argc > 5) ? argv[5] : NULL); + pcb_gui->create_menu(argv[0], (argc > 1) ? argv[1] : NULL, (argc > 2) ? argv[2] : NULL, (argc > 3) ? argv[3] : NULL, (argc > 4) ? argv[4] : NULL, (argc > 5) ? argv[5] : NULL); return 0; } @@ -1082,18 +1082,18 @@ static int ActionRemoveMenu(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { - if (gui == NULL) { + if (pcb_gui == NULL) { pcb_message(PCB_MSG_ERROR, "can't remove menu, there's no GUI hid loaded\n"); return 1; } - if (gui->remove_menu == NULL) { + if (pcb_gui->remove_menu == NULL) { pcb_message(PCB_MSG_ERROR, "can't remove menu, the GUI doesn't support it\n"); return 1; } if (argc > 0) { - if (gui->remove_menu(argv[0]) != 0) + if (pcb_gui->remove_menu(argv[0]) != 0) pcb_message(PCB_MSG_ERROR, "failed to remove some of the menu items\n"); return 0; } @@ -1203,7 +1203,7 @@ return 1; } - next_gui = ng; + pcb_next_gui = ng; chg = PCB->Changed; pcb_quit_app(); PCB->Changed = chg; Index: trunk/src/hid.h =================================================================== --- trunk/src/hid.h (revision 5047) +++ trunk/src/hid.h (revision 5048) @@ -555,23 +555,23 @@ /* This is initially set to a "no-gui" gui, and later reset by main. hid_expose_callback also temporarily set it for drawing. */ -extern pcb_hid_t *gui; +extern pcb_hid_t *pcb_gui; /* When not NULL, auto-start the next gui after the current one quits */ -extern pcb_hid_t *next_gui; +extern pcb_hid_t *pcb_next_gui; /* This is either NULL or points to the current HID that is being called to do the exporting. The gui HIDs set and unset this var.*/ -extern pcb_hid_t *exporter; +extern pcb_hid_t *pcb_exporter; /* This is either NULL or points to the current pcb_hid_action_t that is being called. The action launcher sets and unsets this variable. */ -extern const pcb_hid_action_t *current_action; +extern const pcb_hid_action_t *pcb_current_action; /* The GUI may set this to be approximately the PCB size of a pixel, to allow for near-misses in selection and changes in drawing items smaller than a screen pixel. */ -extern int pixel_slop; +extern int pcb_pixel_slop; /* Init and uninit the whole action framework */ void pcb_hid_actions_init(void); Index: trunk/src/hid_actions.c =================================================================== --- trunk/src/hid_actions.c (revision 5047) +++ trunk/src/hid_actions.c (revision 5048) @@ -29,7 +29,7 @@ } static htsp_t *all_actions = NULL; -const pcb_hid_action_t *current_action = NULL; +const pcb_hid_action_t *pcb_current_action = NULL; static const char *check_action_name(const char *s) { @@ -226,7 +226,7 @@ const pcb_hid_action_t *old_action; if (a->need_coord_msg) - gui->get_coords(_(a->need_coord_msg), &x, &y); + pcb_gui->get_coords(_(a->need_coord_msg), &x, &y); if (conf_core.rc.verbose) { printf("Action: \033[34m%s(", a->name); @@ -235,10 +235,10 @@ printf(")\033[0m\n"); } - old_action = current_action; - current_action = a; - ret = current_action->trigger_cb(argc, argv, x, y); - current_action = old_action; + old_action = pcb_current_action; + pcb_current_action = a; + ret = pcb_current_action->trigger_cb(argc, argv, x, y); + pcb_current_action = old_action; return ret; } Index: trunk/src/hid_draw_helpers.c =================================================================== --- trunk/src/hid_draw_helpers.c (revision 5047) +++ trunk/src/hid_draw_helpers.c (revision 5048) @@ -21,7 +21,7 @@ y[i++] = v->point[1]; } - gui->fill_polygon(gc, n, x, y); + pcb_gui->fill_polygon(gc, n, x, y); free(x); free(y); @@ -33,12 +33,12 @@ pcb_coord_t last_x, last_y; pcb_coord_t this_x, this_y; - gui->set_line_width(gc, 0); - gui->set_line_cap(gc, Round_Cap); + pcb_gui->set_line_width(gc, 0); + pcb_gui->set_line_cap(gc, Round_Cap); /* If the contour is round, use an arc drawing routine. */ if (pl->is_round) { - gui->draw_arc(gc, pl->cx, pl->cy, pl->radius, pl->radius, 0, 360); + pcb_gui->draw_arc(gc, pl->cx, pl->cy, pl->radius, pl->radius, 0, 360); return; } @@ -54,8 +54,8 @@ this_x = v->point[0]; this_y = v->point[1]; - gui->draw_line(gc, last_x, last_y, this_x, this_y); - /* gui->fill_circle (gc, this_x, this_y, 30); */ + pcb_gui->draw_line(gc, last_x, last_y, this_x, this_y); + /* pcb_gui->fill_circle (gc, this_x, this_y, 30); */ last_x = this_x; last_y = this_y; @@ -198,8 +198,8 @@ y1 = y2; y2 = temp_y; } - gui->set_line_cap(gc, Round_Cap); - gui->set_line_width(gc, 0); + pcb_gui->set_line_cap(gc, Round_Cap); + pcb_gui->set_line_width(gc, 0); if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pad)) { /* slanted square pad */ double tx, ty, theta; @@ -214,13 +214,13 @@ tx = t * cos(theta + M_PI / 4) * sqrt(2.0); ty = t * sin(theta + M_PI / 4) * sqrt(2.0); - gui->draw_line(gc, x1 - tx, y1 - ty, x2 + ty, y2 - tx); - gui->draw_line(gc, x2 + ty, y2 - tx, x2 + tx, y2 + ty); - gui->draw_line(gc, x2 + tx, y2 + ty, x1 - ty, y1 + tx); - gui->draw_line(gc, x1 - ty, y1 + tx, x1 - tx, y1 - ty); + pcb_gui->draw_line(gc, x1 - tx, y1 - ty, x2 + ty, y2 - tx); + pcb_gui->draw_line(gc, x2 + ty, y2 - tx, x2 + tx, y2 + ty); + pcb_gui->draw_line(gc, x2 + tx, y2 + ty, x1 - ty, y1 + tx); + pcb_gui->draw_line(gc, x1 - ty, y1 + tx, x1 - tx, y1 - ty); } else if (x1 == x2 && y1 == y2) { - gui->draw_arc(gc, x1, y1, t, t, 0, 360); + pcb_gui->draw_arc(gc, x1, y1, t, t, 0, 360); } else { /* Slanted round-end pads. */ @@ -233,13 +233,13 @@ ox = dy * h + 0.5 * SGN(dy); oy = -(dx * h + 0.5 * SGN(dx)); - gui->draw_line(gc, x1 + ox, y1 + oy, x2 + ox, y2 + oy); + pcb_gui->draw_line(gc, x1 + ox, y1 + oy, x2 + ox, y2 + oy); - if (labs(ox) >= pixel_slop || coord_abs(oy) >= pixel_slop) { + if (labs(ox) >= pcb_pixel_slop || coord_abs(oy) >= pcb_pixel_slop) { pcb_angle_t angle = atan2(dx, dy) * 57.295779; - gui->draw_line(gc, x1 - ox, y1 - oy, x2 - ox, y2 - oy); - gui->draw_arc(gc, x1, y1, t, t, angle - 180, 180); - gui->draw_arc(gc, x2, y2, t, t, angle, 180); + pcb_gui->draw_line(gc, x1 - ox, y1 - oy, x2 - ox, y2 - oy); + pcb_gui->draw_arc(gc, x1, y1, t, t, angle - 180, 180); + pcb_gui->draw_arc(gc, x2, y2, t, t, angle, 180); } } } @@ -256,17 +256,17 @@ b = pad->Point1.Y - w / 2; r = l + w; t = b + w; - gui->fill_rect(gc, l, b, r, t); + pcb_gui->fill_rect(gc, l, b, r, t); } else { - gui->fill_circle(gc, pad->Point1.X, pad->Point1.Y, w / 2); + pcb_gui->fill_circle(gc, pad->Point1.X, pad->Point1.Y, w / 2); } } else { - gui->set_line_cap(gc, PCB_FLAG_TEST(PCB_FLAG_SQUARE, pad) ? Square_Cap : Round_Cap); - gui->set_line_width(gc, w); + pcb_gui->set_line_cap(gc, PCB_FLAG_TEST(PCB_FLAG_SQUARE, pad) ? Square_Cap : Round_Cap); + pcb_gui->set_line_width(gc, w); - gui->draw_line(gc, pad->Point1.X, pad->Point1.Y, pad->Point2.X, pad->Point2.Y); + pcb_gui->draw_line(gc, pad->Point1.X, pad->Point1.Y, pad->Point2.X, pad->Point2.Y); } } @@ -325,15 +325,15 @@ if (thin_draw) { int i; - gui->set_line_cap(gc, Round_Cap); - gui->set_line_width(gc, 0); + pcb_gui->set_line_cap(gc, Round_Cap); + pcb_gui->set_line_width(gc, 0); polygon_x[8] = X + scaled_x[0] * xm[0]; polygon_y[8] = Y + scaled_y[0] * ym[0]; for (i = 0; i < 8; i++) - gui->draw_line(gc, polygon_x[i], polygon_y[i], polygon_x[i + 1], polygon_y[i + 1]); + pcb_gui->draw_line(gc, polygon_x[i], polygon_y[i], polygon_x[i + 1], polygon_y[i + 1]); } else - gui->fill_polygon(gc, 8, polygon_x, polygon_y); + pcb_gui->fill_polygon(gc, 8, polygon_x, polygon_y); } static void draw_octagon_poly(pcb_hid_gc_t gc, pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Thickness, pcb_coord_t thin_draw) @@ -349,12 +349,12 @@ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pv)) { if (mask) - gui->fill_circle(bg_gc, pv->X, pv->Y, r); + pcb_gui->fill_circle(bg_gc, pv->X, pv->Y, r); if (drawHole) { - gui->fill_circle(bg_gc, pv->X, pv->Y, r); - gui->set_line_cap(fg_gc, Round_Cap); - gui->set_line_width(fg_gc, 0); - gui->draw_arc(fg_gc, pv->X, pv->Y, r, r, 0, 360); + pcb_gui->fill_circle(bg_gc, pv->X, pv->Y, r); + pcb_gui->set_line_cap(fg_gc, Round_Cap); + pcb_gui->set_line_width(fg_gc, 0); + pcb_gui->draw_arc(fg_gc, pv->X, pv->Y, r, r, 0, 360); } return; } @@ -366,7 +366,7 @@ pcb_coord_t b = pv->Y - r; pcb_coord_t r = l + w; pcb_coord_t t = b + w; - gui->fill_rect(fg_gc, l, b, r, t); + pcb_gui->fill_rect(fg_gc, l, b, r, t); } else draw_square_pin_poly(fg_gc, pv->X, pv->Y, w, pcb_false, PCB_FLAG_SQUARE_GET(pv)); @@ -374,11 +374,11 @@ else if (PCB_FLAG_TEST(PCB_FLAG_OCTAGON, pv)) draw_octagon_poly(fg_gc, pv->X, pv->Y, w, pcb_false); else /* draw a round pin or via */ - gui->fill_circle(fg_gc, pv->X, pv->Y, r); + pcb_gui->fill_circle(fg_gc, pv->X, pv->Y, r); /* and the drilling hole (which is always round) */ if (drawHole) - gui->fill_circle(bg_gc, pv->X, pv->Y, pv->DrillingHole / 2); + pcb_gui->fill_circle(bg_gc, pv->X, pv->Y, pv->DrillingHole / 2); } void pcb_dhlp_thindraw_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t * pv, pcb_bool drawHole, pcb_bool mask) @@ -388,12 +388,12 @@ if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pv)) { if (mask) - gui->draw_arc(fg_gc, pv->X, pv->Y, r, r, 0, 360); + pcb_gui->draw_arc(fg_gc, pv->X, pv->Y, r, r, 0, 360); if (drawHole) { r = pv->DrillingHole / 2; - gui->set_line_cap(bg_gc, Round_Cap); - gui->set_line_width(bg_gc, 0); - gui->draw_arc(bg_gc, pv->X, pv->Y, r, r, 0, 360); + pcb_gui->set_line_cap(bg_gc, Round_Cap); + pcb_gui->set_line_width(bg_gc, 0); + pcb_gui->draw_arc(bg_gc, pv->X, pv->Y, r, r, 0, 360); } return; } @@ -404,12 +404,12 @@ pcb_coord_t r = l + w; pcb_coord_t t = b + w; - gui->set_line_cap(fg_gc, Round_Cap); - gui->set_line_width(fg_gc, 0); - gui->draw_line(fg_gc, r, t, r, b); - gui->draw_line(fg_gc, l, t, l, b); - gui->draw_line(fg_gc, r, t, l, t); - gui->draw_line(fg_gc, r, b, l, b); + pcb_gui->set_line_cap(fg_gc, Round_Cap); + pcb_gui->set_line_width(fg_gc, 0); + pcb_gui->draw_line(fg_gc, r, t, r, b); + pcb_gui->draw_line(fg_gc, l, t, l, b); + pcb_gui->draw_line(fg_gc, r, t, l, t); + pcb_gui->draw_line(fg_gc, r, b, l, b); } else if (PCB_FLAG_TEST(PCB_FLAG_OCTAGON, pv)) { @@ -417,16 +417,16 @@ } else { /* draw a round pin or via */ - gui->set_line_cap(fg_gc, Round_Cap); - gui->set_line_width(fg_gc, 0); - gui->draw_arc(fg_gc, pv->X, pv->Y, r, r, 0, 360); + pcb_gui->set_line_cap(fg_gc, Round_Cap); + pcb_gui->set_line_width(fg_gc, 0); + pcb_gui->draw_arc(fg_gc, pv->X, pv->Y, r, r, 0, 360); } /* and the drilling hole (which is always round */ if (drawHole) { - gui->set_line_cap(bg_gc, Round_Cap); - gui->set_line_width(bg_gc, 0); - gui->draw_arc(bg_gc, pv->X, pv->Y, pv->DrillingHole / 2, pv->DrillingHole / 2, 0, 360); + pcb_gui->set_line_cap(bg_gc, Round_Cap); + pcb_gui->set_line_width(bg_gc, 0); + pcb_gui->draw_arc(bg_gc, pv->X, pv->Y, pv->DrillingHole / 2, pv->DrillingHole / 2, 0, 360); } } Index: trunk/src/hid_init.c =================================================================== --- trunk/src/hid_init.c (revision 5047) +++ trunk/src/hid_init.c (revision 5048) @@ -20,11 +20,11 @@ pcb_hid_t **hid_list = 0; int hid_num_hids = 0; -pcb_hid_t *gui = NULL; -pcb_hid_t *next_gui = NULL; -pcb_hid_t *exporter = NULL; +pcb_hid_t *pcb_gui = NULL; +pcb_hid_t *pcb_next_gui = NULL; +pcb_hid_t *pcb_exporter = NULL; -int pixel_slop = 1; +int pcb_pixel_slop = 1; static void hid_load_dir(char *dirname) { @@ -97,7 +97,7 @@ pcb_hid_actions_init(); /* Setup a "nogui" default HID */ - gui = pcb_hid_nogui_get_hid(); + pcb_gui = pcb_hid_nogui_get_hid(); #warning TODO: make this configurable hid_load_dir(pcb_concat(conf_core.rc.path.exec_prefix, PCB_DIR_SEPARATOR_S, "lib", Index: trunk/src/insert.c =================================================================== --- trunk/src/insert.c (revision 5047) +++ trunk/src/insert.c (revision 5048) @@ -93,7 +93,7 @@ if (pcb_crosshair.AttachedObject.State == PCB_CH_STATE_FIRST) return NULL; pcb_crosshair.AttachedObject.Ptr3 = &InsertedPoint; - if (gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed()) { pcb_attached_line_t myline; /* only force 45 degree for nearest point */ if (pcb_distance(pcb_crosshair.X, pcb_crosshair.Y, line->Point1.X, line->Point1.Y) < Index: trunk/src/layer.c =================================================================== --- trunk/src/layer.c (revision 5047) +++ trunk/src/layer.c (revision 5048) @@ -943,12 +943,12 @@ return 0; if (new_index == -1 && LastLayerInComponentGroup(old_index)) { - gui->confirm_dialog("You can't delete the last top-side layer\n", "Ok", NULL); + pcb_gui->confirm_dialog("You can't delete the last top-side layer\n", "Ok", NULL); return 1; } if (new_index == -1 && LastLayerInSolderGroup(old_index)) { - gui->confirm_dialog("You can't delete the last bottom-side layer\n", "Ok", NULL); + pcb_gui->confirm_dialog("You can't delete the last bottom-side layer\n", "Ok", NULL); return 1; } @@ -1033,6 +1033,6 @@ } pcb_hid_action("LayersChanged"); - gui->invalidate_all(); + pcb_gui->invalidate_all(); return 0; } Index: trunk/src/main.c =================================================================== --- trunk/src/main.c (revision 5047) +++ trunk/src/main.c (revision 5048) @@ -387,11 +387,11 @@ /* Export pcb from command line if requested. */ switch(do_what) { - case DO_PRINT: exporter = gui = pcb_hid_find_printer(); break; - case DO_EXPORT: exporter = gui = pcb_hid_find_exporter(hid_name); break; + case DO_PRINT: pcb_exporter = pcb_gui = pcb_hid_find_printer(); break; + case DO_EXPORT: pcb_exporter = pcb_gui = pcb_hid_find_exporter(hid_name); break; case DO_GUI: - gui = pcb_hid_find_gui(argv[2]); - if (gui == NULL) { + pcb_gui = pcb_hid_find_gui(argv[2]); + if (pcb_gui == NULL) { pcb_message(PCB_MSG_DEFAULT, "Can't find the gui requested.\n"); exit(1); } @@ -401,23 +401,23 @@ int n; const char *g; - gui = NULL; + pcb_gui = NULL; conf_loop_list_str(&conf_core.rc.preferred_gui, i, g, n) { - gui = pcb_hid_find_gui(g); - if (gui != NULL) + pcb_gui = pcb_hid_find_gui(g); + if (pcb_gui != NULL) break; } /* try anything */ - if (gui == NULL) { + if (pcb_gui == NULL) { pcb_message(PCB_MSG_DEFAULT, "Warning: can't find any of the preferred GUIs, falling back to anything available...\n"); - gui = pcb_hid_find_gui(NULL); + pcb_gui = pcb_hid_find_gui(NULL); } } } /* Exit with error if GUI failed to start. */ - if (!gui) + if (!pcb_gui) exit(1); /* Initialize actions only when the gui is already known so only the right @@ -433,7 +433,7 @@ exit(0); } - gui->parse_arguments(&hid_argc, &hid_argv); + pcb_gui->parse_arguments(&hid_argc, &hid_argv); /* Create a new PCB object in memory */ PCB = pcb_board_new(); @@ -450,7 +450,7 @@ ResetStackAndVisibility(); - if (gui->gui) + if (pcb_gui->gui) pcb_crosshair_init(); InitHandler(); pcb_init_buffers(); @@ -483,10 +483,10 @@ pcb_hid_parse_actions(conf_core.rc.action_string); } - if (gui->printer || gui->exporter) { + if (pcb_gui->printer || pcb_gui->exporter) { /* Workaround to fix batch output for non-C locales */ setlocale(LC_NUMERIC, "C"); - gui->do_export(0); + pcb_gui->do_export(0); exit(0); } @@ -494,18 +494,18 @@ /* main loop */ do { - gui->do_export(0); - gui = next_gui; - next_gui = NULL; - if (gui != NULL) { + pcb_gui->do_export(0); + pcb_gui = pcb_next_gui; + pcb_next_gui = NULL; + if (pcb_gui != NULL) { /* init the next GUI */ - gui->parse_arguments(&hid_argc, &hid_argv); - if (gui->gui) + pcb_gui->parse_arguments(&hid_argc, &hid_argv); + if (pcb_gui->gui) pcb_crosshair_init(); pcb_crosshair_set_mode(PCB_MODE_ARROW); pcb_hid_action("LibraryChanged"); } - } while(gui != NULL); + } while(pcb_gui != NULL); pcb_main_uninit(); Index: trunk/src/netlist_act.c =================================================================== --- trunk/src/netlist_act.c (revision 5047) +++ trunk/src/netlist_act.c (revision 5048) @@ -320,11 +320,11 @@ } if (argc > 2 && !pin_found) { - gui->log("Net %s has no pin %s\n", argv[1], argv[2]); + pcb_gui->log("Net %s has no pin %s\n", argv[1], argv[2]); return 1; } else if (!net_found) { - gui->log("No net named %s\n", argv[1]); + pcb_gui->log("No net named %s\n", argv[1]); } if (use_re) Index: trunk/src/obj_arc.c =================================================================== --- trunk/src/obj_arc.c (revision 5047) +++ trunk/src/obj_arc.c (revision 5048) @@ -559,12 +559,12 @@ return; if (conf_core.editor.thin_draw) - gui->set_line_width(Output.fgGC, 0); + pcb_gui->set_line_width(Output.fgGC, 0); else - gui->set_line_width(Output.fgGC, arc->Thickness); - gui->set_line_cap(Output.fgGC, Trace_Cap); + pcb_gui->set_line_width(Output.fgGC, arc->Thickness); + pcb_gui->set_line_cap(Output.fgGC, Trace_Cap); - gui->draw_arc(Output.fgGC, arc->X, arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta); + pcb_gui->draw_arc(Output.fgGC, arc->X, arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta); } void draw_arc(pcb_layer_t * layer, pcb_arc_t * arc) @@ -588,7 +588,7 @@ pcb_lighten_color(color, buf, 1.75); color = buf; } - gui->set_color(Output.fgGC, color); + pcb_gui->set_color(Output.fgGC, color); _draw_arc(arc); } Index: trunk/src/obj_elem.c =================================================================== --- trunk/src/obj_elem.c (revision 5047) +++ trunk/src/obj_elem.c (revision 5048) @@ -1660,21 +1660,21 @@ /*** draw ***/ void draw_element_name(pcb_element_t * element) { - if ((conf_core.editor.hide_names && gui->gui) || PCB_FLAG_TEST(PCB_FLAG_HIDENAME, element)) + if ((conf_core.editor.hide_names && pcb_gui->gui) || PCB_FLAG_TEST(PCB_FLAG_HIDENAME, element)) return; if (pcb_draw_doing_pinout || pcb_draw_doing_assy) - gui->set_color(Output.fgGC, PCB->ElementColor); + pcb_gui->set_color(Output.fgGC, PCB->ElementColor); else if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, &ELEMENT_TEXT(PCB, element))) - gui->set_color(Output.fgGC, PCB->ElementSelectedColor); + pcb_gui->set_color(Output.fgGC, PCB->ElementSelectedColor); else if (PCB_FRONT(element)) { #warning TODO: why do we test for Names flag here instead of elements flag? if (PCB_FLAG_TEST(PCB_FLAG_NONETLIST, element)) - gui->set_color(Output.fgGC, PCB->ElementColor_nonetlist); + pcb_gui->set_color(Output.fgGC, PCB->ElementColor_nonetlist); else - gui->set_color(Output.fgGC, PCB->ElementColor); + pcb_gui->set_color(Output.fgGC, PCB->ElementColor); } else - gui->set_color(Output.fgGC, PCB->InvisibleObjectsColor); + pcb_gui->set_color(Output.fgGC, PCB->InvisibleObjectsColor); DrawTextLowLevel(&ELEMENT_TEXT(PCB, element), PCB->minSlk); @@ -1714,13 +1714,13 @@ { /* set color and draw lines, arcs, text and pins */ if (pcb_draw_doing_pinout || pcb_draw_doing_assy) - gui->set_color(Output.fgGC, PCB->ElementColor); + pcb_gui->set_color(Output.fgGC, PCB->ElementColor); else if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, element)) - gui->set_color(Output.fgGC, PCB->ElementSelectedColor); + pcb_gui->set_color(Output.fgGC, PCB->ElementSelectedColor); else if (PCB_FRONT(element)) - gui->set_color(Output.fgGC, PCB->ElementColor); + pcb_gui->set_color(Output.fgGC, PCB->ElementColor); else - gui->set_color(Output.fgGC, PCB->InvisibleObjectsColor); + pcb_gui->set_color(Output.fgGC, PCB->InvisibleObjectsColor); /* draw lines, arcs, text and pins */ PCB_ELEMENT_PCB_LINE_LOOP(element); @@ -1771,13 +1771,13 @@ mark_size = MIN(mark_size, pad0->Thickness / 2); } - gui->set_color(Output.fgGC, invisible ? PCB->InvisibleMarkColor : PCB->ElementColor); - gui->set_line_cap(Output.fgGC, Trace_Cap); - gui->set_line_width(Output.fgGC, 0); - gui->draw_line(Output.fgGC, X - mark_size, Y, X, Y - mark_size); - gui->draw_line(Output.fgGC, X + mark_size, Y, X, Y - mark_size); - gui->draw_line(Output.fgGC, X - mark_size, Y, X, Y + mark_size); - gui->draw_line(Output.fgGC, X + mark_size, Y, X, Y + mark_size); + pcb_gui->set_color(Output.fgGC, invisible ? PCB->InvisibleMarkColor : PCB->ElementColor); + pcb_gui->set_line_cap(Output.fgGC, Trace_Cap); + pcb_gui->set_line_width(Output.fgGC, 0); + pcb_gui->draw_line(Output.fgGC, X - mark_size, Y, X, Y - mark_size); + pcb_gui->draw_line(Output.fgGC, X + mark_size, Y, X, Y - mark_size); + pcb_gui->draw_line(Output.fgGC, X - mark_size, Y, X, Y + mark_size); + pcb_gui->draw_line(Output.fgGC, X + mark_size, Y, X, Y + mark_size); /* * If an element is locked, place a "L" on top of the "diamond". @@ -1785,8 +1785,8 @@ * works even for color blind users. */ if (PCB_FLAG_TEST(PCB_FLAG_LOCK, e)) { - gui->draw_line(Output.fgGC, X, Y, X + 2 * mark_size, Y); - gui->draw_line(Output.fgGC, X, Y, X, Y - 4 * mark_size); + pcb_gui->draw_line(Output.fgGC, X, Y, X + 2 * mark_size, Y); + pcb_gui->draw_line(Output.fgGC, X, Y, X, Y - 4 * mark_size); } } Index: trunk/src/obj_line.c =================================================================== --- trunk/src/obj_line.c (revision 5047) +++ trunk/src/obj_line.c (revision 5048) @@ -706,13 +706,13 @@ /*** draw ***/ void _draw_line(pcb_line_t * line) { - gui->set_line_cap(Output.fgGC, Trace_Cap); + pcb_gui->set_line_cap(Output.fgGC, Trace_Cap); if (conf_core.editor.thin_draw) - gui->set_line_width(Output.fgGC, 0); + pcb_gui->set_line_width(Output.fgGC, 0); else - gui->set_line_width(Output.fgGC, line->Thickness); + pcb_gui->set_line_width(Output.fgGC, line->Thickness); - gui->draw_line(Output.fgGC, line->Point1.X, line->Point1.Y, line->Point2.X, line->Point2.Y); + pcb_gui->draw_line(Output.fgGC, line->Point1.X, line->Point1.Y, line->Point2.X, line->Point2.Y); } void draw_line(pcb_layer_t * layer, pcb_line_t * line) @@ -737,7 +737,7 @@ color = buf; } - gui->set_color(Output.fgGC, color); + pcb_gui->set_color(Output.fgGC, color); _draw_line(line); } Index: trunk/src/obj_line_drcenf.c =================================================================== --- trunk/src/obj_line_drcenf.c (revision 5047) +++ trunk/src/obj_line_drcenf.c (revision 5048) @@ -50,7 +50,7 @@ if (line->State == PCB_CH_STATE_FIRST) return; /* don't draw outline when ctrl key is pressed */ - if (conf_core.editor.mode == PCB_MODE_LINE && gui->control_is_pressed()) { + if (conf_core.editor.mode == PCB_MODE_LINE && pcb_gui->control_is_pressed()) { line->draw = pcb_false; return; } @@ -155,7 +155,7 @@ if (pcb_crosshair.AttachedLine.State == PCB_CH_STATE_FIRST) return; /* don't draw outline when ctrl key is pressed */ - if (gui->control_is_pressed()) { + if (pcb_gui->control_is_pressed()) { line->draw = pcb_false; return; } @@ -167,7 +167,7 @@ return; } /* swap the modes if shift is held down */ - if (gui->shift_is_pressed()) + if (pcb_gui->shift_is_pressed()) way = !way; dx = pcb_crosshair.X - line->Point1.X; dy = pcb_crosshair.Y - line->Point1.Y; @@ -478,7 +478,7 @@ /* Silence a bogus compiler warning by storing this in a variable */ int layer_idx = INDEXOFCURRENT; - if (gui->mod1_is_pressed() || gui->control_is_pressed() || PCB->RatDraw || layer_idx >= pcb_max_copper_layer) + if (pcb_gui->mod1_is_pressed() || pcb_gui->control_is_pressed() || PCB->RatDraw || layer_idx >= pcb_max_copper_layer) return; rs.X = r45.X = pcb_crosshair.X; @@ -498,7 +498,7 @@ #undef sqr } /* shift forces the line lookahead path to refract the alternate way */ - shift = gui->shift_is_pressed(); + shift = pcb_gui->shift_is_pressed(); if (PCB_XOR(r1 > r2, shift)) { if (conf_core.editor.line_refraction != 0) { Index: trunk/src/obj_pad.c =================================================================== --- trunk/src/obj_pad.c (revision 5047) +++ trunk/src/obj_pad.c (revision 5048) @@ -331,7 +331,7 @@ box.Y1 += conf_core.appearance.pinout.text_offset_y; } - gui->set_color(Output.fgGC, PCB->PinNameColor); + pcb_gui->set_color(Output.fgGC, PCB->PinNameColor); text.Flags = pcb_no_flags(); /* Set font height to approx 90% of pin thickness */ @@ -349,9 +349,9 @@ return; if (conf_core.editor.thin_draw || (clear && conf_core.editor.thin_draw_poly)) - gui->thindraw_pcb_pad(gc, pad, clear, mask); + pcb_gui->thindraw_pcb_pad(gc, pad, clear, mask); else - gui->fill_pcb_pad(gc, pad, clear, mask); + pcb_gui->fill_pcb_pad(gc, pad, clear, mask); } void draw_pad(pcb_pad_t * pad) @@ -360,7 +360,7 @@ char buf[sizeof("#XXXXXX")]; if (pcb_draw_doing_pinout) - gui->set_color(Output.fgGC, PCB->PinColor); + pcb_gui->set_color(Output.fgGC, PCB->PinColor); else if (PCB_FLAG_TEST(PCB_FLAG_WARN | PCB_FLAG_SELECTED | PCB_FLAG_FOUND, pad)) { if (PCB_FLAG_TEST(PCB_FLAG_WARN, pad)) color = PCB->WarnColor; @@ -381,7 +381,7 @@ } if (color != NULL) - gui->set_color(Output.fgGC, color); + pcb_gui->set_color(Output.fgGC, color); _draw_pad(Output.fgGC, pad, pcb_false, pcb_false); @@ -411,7 +411,7 @@ /* draws solder paste layer for a given side of the board - only pads get paste */ void DrawPaste(int side, const pcb_box_t * drawn_area) { - gui->set_color(Output.fgGC, PCB->ElementColor); + pcb_gui->set_color(Output.fgGC, PCB->ElementColor); PCB_PAD_ALL_LOOP(PCB->Data); { if (PCB_ON_SIDE(pad, side) && !PCB_FLAG_TEST(PCB_FLAG_NOPASTE, pad) && pad->Mask > 0) { Index: trunk/src/obj_pinvia.c =================================================================== --- trunk/src/obj_pinvia.c (revision 5047) +++ trunk/src/obj_pinvia.c (revision 5048) @@ -798,7 +798,7 @@ color = PCB->PinColor; } - gui->set_color(Output.fgGC, color); + pcb_gui->set_color(Output.fgGC, color); } static void _draw_pv_name(pcb_pin_t * pv) @@ -831,7 +831,7 @@ box.Y1 = pv->Y - pv->Thickness / 2 + conf_core.appearance.pinout.text_offset_y; } - gui->set_color(Output.fgGC, PCB->PinNameColor); + pcb_gui->set_color(Output.fgGC, PCB->PinNameColor); text.Flags = pcb_no_flags(); /* Set font height to approx 56% of pin thickness */ @@ -840,10 +840,10 @@ text.Y = box.Y1; text.Direction = vert ? 1 : 0; - if (gui->gui) + if (pcb_gui->gui) pcb_draw_doing_pinout++; DrawTextLowLevel(&text, 0); - if (gui->gui) + if (pcb_gui->gui) pcb_draw_doing_pinout--; } @@ -850,9 +850,9 @@ static void _draw_pv(pcb_pin_t *pv, pcb_bool draw_hole) { if (conf_core.editor.thin_draw) - gui->thindraw_pcb_pv(Output.fgGC, Output.fgGC, pv, draw_hole, pcb_false); + pcb_gui->thindraw_pcb_pv(Output.fgGC, Output.fgGC, pv, draw_hole, pcb_false); else - gui->fill_pcb_pv(Output.fgGC, Output.bgGC, pv, draw_hole, pcb_false); + pcb_gui->fill_pcb_pv(Output.fgGC, Output.bgGC, pv, draw_hole, pcb_false); if (!PCB_FLAG_TEST(PCB_FLAG_HOLE, pv) && PCB_FLAG_TEST(PCB_FLAG_DISPLAYNAME, pv)) _draw_pv_name(pv); @@ -874,9 +874,9 @@ { pcb_pin_t *pin = (pcb_pin_t *) b; if (conf_core.editor.thin_draw || conf_core.editor.thin_draw_poly) - gui->thindraw_pcb_pv(Output.pmGC, Output.pmGC, pin, pcb_false, pcb_true); + pcb_gui->thindraw_pcb_pv(Output.pmGC, Output.pmGC, pin, pcb_false, pcb_true); else - gui->fill_pcb_pv(Output.pmGC, Output.pmGC, pin, pcb_false, pcb_true); + pcb_gui->fill_pcb_pv(Output.pmGC, Output.pmGC, pin, pcb_false, pcb_true); return R_DIR_FOUND_CONTINUE; } @@ -905,13 +905,13 @@ if (conf_core.editor.thin_draw) { if (!PCB_FLAG_TEST(PCB_FLAG_HOLE, pv)) { - gui->set_line_cap(Output.fgGC, Round_Cap); - gui->set_line_width(Output.fgGC, 0); - gui->draw_arc(Output.fgGC, pv->X, pv->Y, pv->DrillingHole / 2, pv->DrillingHole / 2, 0, 360); + pcb_gui->set_line_cap(Output.fgGC, Round_Cap); + pcb_gui->set_line_width(Output.fgGC, 0); + pcb_gui->draw_arc(Output.fgGC, pv->X, pv->Y, pv->DrillingHole / 2, pv->DrillingHole / 2, 0, 360); } } else - gui->fill_circle(Output.bgGC, pv->X, pv->Y, pv->DrillingHole / 2); + pcb_gui->fill_circle(Output.bgGC, pv->X, pv->Y, pv->DrillingHole / 2); if (PCB_FLAG_TEST(PCB_FLAG_HOLE, pv)) { if (PCB_FLAG_TEST(PCB_FLAG_WARN, pv)) @@ -926,11 +926,11 @@ pcb_lighten_color(color, buf, 1.75); color = buf; } - gui->set_color(Output.fgGC, color); + pcb_gui->set_color(Output.fgGC, color); - gui->set_line_cap(Output.fgGC, Round_Cap); - gui->set_line_width(Output.fgGC, 0); - gui->draw_arc(Output.fgGC, pv->X, pv->Y, pv->DrillingHole / 2, pv->DrillingHole / 2, 0, 360); + pcb_gui->set_line_cap(Output.fgGC, Round_Cap); + pcb_gui->set_line_width(Output.fgGC, 0); + pcb_gui->draw_arc(Output.fgGC, pv->X, pv->Y, pv->DrillingHole / 2, pv->DrillingHole / 2, 0, 360); } return R_DIR_FOUND_CONTINUE; } Index: trunk/src/obj_poly.c =================================================================== --- trunk/src/obj_poly.c (revision 5047) +++ trunk/src/obj_poly.c (revision 5048) @@ -270,7 +270,7 @@ { static int shown_this_message = 0; if (!shown_this_message) { - gui->confirm_dialog(_("To change the clearance of objects in a polygon, " + pcb_gui->confirm_dialog(_("To change the clearance of objects in a polygon, " "change the objects, not the polygon.\n" "Hint: To set a minimum clearance for a group of objects, " "select them all then :MinClearGap(Selected,=10,mil)"), "Ok", NULL); @@ -656,19 +656,19 @@ } else color = i->layer->Color; - gui->set_color(Output.fgGC, color); + pcb_gui->set_color(Output.fgGC, color); - if ((gui->thindraw_pcb_polygon != NULL) && (conf_core.editor.thin_draw || conf_core.editor.thin_draw_poly)) - gui->thindraw_pcb_polygon(Output.fgGC, polygon, i->drawn_area); + if ((pcb_gui->thindraw_pcb_polygon != NULL) && (conf_core.editor.thin_draw || conf_core.editor.thin_draw_poly)) + pcb_gui->thindraw_pcb_polygon(Output.fgGC, polygon, i->drawn_area); else - gui->fill_pcb_polygon(Output.fgGC, polygon, i->drawn_area); + pcb_gui->fill_pcb_polygon(Output.fgGC, polygon, i->drawn_area); /* If checking planes, thin-draw any pieces which have been clipped away */ - if (gui->thindraw_pcb_polygon != NULL && conf_core.editor.check_planes && !PCB_FLAG_TEST(PCB_FLAG_FULLPOLY, polygon)) { + if (pcb_gui->thindraw_pcb_polygon != NULL && conf_core.editor.check_planes && !PCB_FLAG_TEST(PCB_FLAG_FULLPOLY, polygon)) { pcb_polygon_t poly = *polygon; for (poly.Clipped = polygon->Clipped->f; poly.Clipped != polygon->Clipped; poly.Clipped = poly.Clipped->f) - gui->thindraw_pcb_polygon(Output.fgGC, &poly, i->drawn_area); + pcb_gui->thindraw_pcb_polygon(Output.fgGC, &poly, i->drawn_area); } return R_DIR_FOUND_CONTINUE; Index: trunk/src/obj_rat.c =================================================================== --- trunk/src/obj_rat.c (revision 5047) +++ trunk/src/obj_rat.c (revision 5048) @@ -226,24 +226,24 @@ if (PCB_FLAG_TEST(PCB_FLAG_SELECTED | PCB_FLAG_FOUND, rat)) { if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, rat)) - gui->set_color(Output.fgGC, PCB->RatSelectedColor); + pcb_gui->set_color(Output.fgGC, PCB->RatSelectedColor); else - gui->set_color(Output.fgGC, PCB->ConnectedColor); + pcb_gui->set_color(Output.fgGC, PCB->ConnectedColor); } else - gui->set_color(Output.fgGC, PCB->RatColor); + pcb_gui->set_color(Output.fgGC, PCB->RatColor); if (conf_core.appearance.rat_thickness < 20) - rat->Thickness = pixel_slop * conf_core.appearance.rat_thickness; + rat->Thickness = pcb_pixel_slop * conf_core.appearance.rat_thickness; /* rats.c set PCB_FLAG_VIA if this rat goes to a containing poly: draw a donut */ if (PCB_FLAG_TEST(PCB_FLAG_VIA, rat)) { int w = rat->Thickness; if (conf_core.editor.thin_draw) - gui->set_line_width(Output.fgGC, 0); + pcb_gui->set_line_width(Output.fgGC, 0); else - gui->set_line_width(Output.fgGC, w); - gui->draw_arc(Output.fgGC, rat->Point1.X, rat->Point1.Y, w * 2, w * 2, 0, 360); + pcb_gui->set_line_width(Output.fgGC, w); + pcb_gui->draw_arc(Output.fgGC, rat->Point1.X, rat->Point1.Y, w * 2, w * 2, 0, 360); } else _draw_line((pcb_line_t *) rat); @@ -271,7 +271,7 @@ void DrawRat(pcb_rat_t *Rat) { if (conf_core.appearance.rat_thickness < 20) - Rat->Thickness = pixel_slop * conf_core.appearance.rat_thickness; + Rat->Thickness = pcb_pixel_slop * conf_core.appearance.rat_thickness; /* rats.c set PCB_FLAG_VIA if this rat goes to a containing poly: draw a donut */ if (PCB_FLAG_TEST(PCB_FLAG_VIA, Rat)) { pcb_coord_t w = Rat->Thickness; Index: trunk/src/obj_text.c =================================================================== --- trunk/src/obj_text.c (revision 5047) +++ trunk/src/obj_text.c (revision 5048) @@ -531,7 +531,7 @@ defaultsymbol.Y1 += Text->Y; defaultsymbol.X2 += Text->X; defaultsymbol.Y2 += Text->Y; - gui->fill_rect(Output.fgGC, defaultsymbol.X1, defaultsymbol.Y1, defaultsymbol.X2, defaultsymbol.Y2); + pcb_gui->fill_rect(Output.fgGC, defaultsymbol.X1, defaultsymbol.Y1, defaultsymbol.X2, defaultsymbol.Y2); /* move on to next cursor position */ x += size; @@ -548,9 +548,9 @@ int min_silk_line; if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, text)) - gui->set_color(Output.fgGC, layer->SelectedColor); + pcb_gui->set_color(Output.fgGC, layer->SelectedColor); else - gui->set_color(Output.fgGC, layer->Color); + pcb_gui->set_color(Output.fgGC, layer->Color); if (layer == &PCB->Data->SILKLAYER || layer == &PCB->Data->BACKSILKLAYER) min_silk_line = PCB->minSlk; else Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 5047) +++ trunk/src/object_act.c (revision 5048) @@ -107,7 +107,7 @@ if (!function) PCB_AFAIL(attributes); - if (!gui->edit_attributes) { + if (!pcb_gui->edit_attributes) { pcb_message(PCB_MSG_DEFAULT, _("This GUI doesn't support Attribute Editing\n")); return 1; } @@ -115,7 +115,7 @@ switch (pcb_funchash_get(function, NULL)) { case F_Layout: { - gui->edit_attributes("Layout Attributes", &(PCB->Attributes)); + pcb_gui->edit_attributes("Layout Attributes", &(PCB->Attributes)); return 0; } @@ -137,7 +137,7 @@ } buf = (char *) malloc(strlen(layer->Name) + strlen("Layer X Attributes")); sprintf(buf, "Layer %s Attributes", layer->Name); - gui->edit_attributes(buf, &(layer->Attributes)); + pcb_gui->edit_attributes(buf, &(layer->Attributes)); free(buf); return 0; } @@ -160,7 +160,7 @@ } if (n_found == 0) { void *ptrtmp; - gui->get_coords(_("Click on an element"), &x, &y); + pcb_gui->get_coords(_("Click on an element"), &x, &y); if ((pcb_search_screen(x, y, PCB_TYPE_ELEMENT, &ptrtmp, &ptrtmp, &ptrtmp)) != PCB_TYPE_NONE) e = (pcb_element_t *) ptrtmp; else { @@ -176,7 +176,7 @@ else { buf = pcb_strdup("Unnamed Element Attributes"); } - gui->edit_attributes(buf, &(e->Attributes)); + pcb_gui->edit_attributes(buf, &(e->Attributes)); free(buf); break; } @@ -420,7 +420,7 @@ int type; void *ptr1, *ptr2, *ptr3; - gui->get_coords(_("Select an Object"), &x, &y); + pcb_gui->get_coords(_("Select an Object"), &x, &y); if ((type = pcb_search_screen(x, y, PCB_MOVETOLAYER_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) if (pcb_move_obj_to_layer(type, ptr1, ptr2, ptr3, CURRENT, pcb_false)) pcb_board_set_changed_flag(pcb_true); @@ -513,7 +513,7 @@ } END_LOOP; if (number_of_footprints_not_found > 0) - gui->confirm_dialog("Not all requested footprints were found.\n" "See the message log for details", "Ok", NULL); + pcb_gui->confirm_dialog("Not all requested footprints were found.\n" "See the message log for details", "Ok", NULL); return 0; } Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 5047) +++ trunk/src/plug_io.c (revision 5048) @@ -358,7 +358,7 @@ if (pcb_hid_get_flag("GetStyle()") < 0) pcb_use_route_style_idx(&PCB->RouteStyle, 0); - if (((how == 0) || (revert)) && (gui != NULL)) { + if (((how == 0) || (revert)) && (pcb_gui != NULL)) { if (revert) pcb_hid_actionl("PCBChanged", "revert", NULL); else @@ -368,7 +368,7 @@ #ifdef DEBUG end = clock(); elapsed = ((double) (end - start)) / CLOCKS_PER_SEC; - gui->log("Loading file %s took %f seconds of CPU time\n", new_filename, elapsed); + pcb_gui->log("Loading file %s took %f seconds of CPU time\n", new_filename, elapsed); #endif return (0); @@ -384,7 +384,7 @@ } } - if (gui != NULL) + if (pcb_gui != NULL) pcb_hid_action("PCBChanged"); /* release unused memory */ @@ -491,9 +491,9 @@ if (WasCancelButton) *WasCancelButton = pcb_false; if (AllButton) - response = gui->confirm_dialog(message, "Cancel", "Ok", AllButton ? "Sequence OK" : 0); + response = pcb_gui->confirm_dialog(message, "Cancel", "Ok", AllButton ? "Sequence OK" : 0); else - response = gui->confirm_dialog(message, "Cancel", "Ok", "Sequence OK"); + response = pcb_gui->confirm_dialog(message, "Cancel", "Ok", "Sequence OK"); switch (response) { case 2: @@ -522,7 +522,7 @@ pcb_bool result; /* not used */ /* CheckAndOpenFile deals with the case where fname already exists */ - fname = gui->fileselect(_("Save Connection Data As ..."), + fname = pcb_gui->fileselect(_("Save Connection Data As ..."), _("Choose a file to save all connection data to."), default_file, ".net", "connection_data", 0); if (fname == NULL) return NULL; @@ -563,12 +563,12 @@ { int retcode; - if (gui->notify_save_pcb == NULL) + if (pcb_gui->notify_save_pcb == NULL) return pcb_write_pipe(file, pcb_true, fmt); - gui->notify_save_pcb(file, pcb_false); + pcb_gui->notify_save_pcb(file, pcb_false); retcode = pcb_write_pipe(file, pcb_true, fmt); - gui->notify_save_pcb(file, pcb_true); + pcb_gui->notify_save_pcb(file, pcb_true); return retcode; } @@ -665,8 +665,8 @@ { backup_timer.ptr = NULL; pcb_backup(); - if (conf_core.rc.backup_interval > 0 && gui->add_timer) - backup_timer = gui->add_timer(backup_cb, 1000 * conf_core.rc.backup_interval, data); + if (conf_core.rc.backup_interval > 0 && pcb_gui->add_timer) + backup_timer = pcb_gui->add_timer(backup_cb, 1000 * conf_core.rc.backup_interval, data); } void pcb_enable_autosave(void) @@ -676,13 +676,13 @@ x.ptr = NULL; /* If we already have a timer going, then cancel it out */ - if (backup_timer.ptr != NULL && gui->stop_timer) - gui->stop_timer(backup_timer); + if (backup_timer.ptr != NULL && pcb_gui->stop_timer) + pcb_gui->stop_timer(backup_timer); backup_timer.ptr = NULL; /* Start up a new timer */ - if (conf_core.rc.backup_interval > 0 && gui->add_timer) - backup_timer = gui->add_timer(backup_cb, 1000 * conf_core.rc.backup_interval, x); + if (conf_core.rc.backup_interval > 0 && pcb_gui->add_timer) + backup_timer = pcb_gui->add_timer(backup_cb, 1000 * conf_core.rc.backup_interval, x); } /* --------------------------------------------------------------------------- Index: trunk/src/plugins.c =================================================================== --- trunk/src/plugins.c (revision 5047) +++ trunk/src/plugins.c (revision 5048) @@ -127,7 +127,7 @@ gds_append_str(&str, " (none)\n"); gds_append_str(&str, "\n\nNOTE: this is the alpha version, can only list plugins/buildins\n"); - gui->report_dialog("Manage plugins", str.array); + pcb_gui->report_dialog("Manage plugins", str.array); gds_uninit(&str); return 0; } Index: trunk/src/polygon_act.c =================================================================== --- trunk/src/polygon_act.c (revision 5047) +++ trunk/src/polygon_act.c (revision 5048) @@ -67,7 +67,7 @@ int type; void *ptr1, *ptr2, *ptr3; - gui->get_coords(_("Select an Object"), &x, &y); + pcb_gui->get_coords(_("Select an Object"), &x, &y); if ((type = pcb_search_screen(x, y, PCB_TYPE_POLYGON, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) { pcb_poly_morph((pcb_layer_t *) ptr1, (pcb_polygon_t *) ptr3); pcb_draw(); Index: trunk/src/rats_act.c =================================================================== --- trunk/src/rats_act.c (revision 5047) +++ trunk/src/rats_act.c (revision 5048) @@ -150,7 +150,7 @@ switch (pcb_funchash_get(function, NULL)) { case F_Find: { - gui->get_coords(_("Click on a connection"), &x, &y); + pcb_gui->get_coords(_("Click on a connection"), &x, &y); pcb_lookup_conn(x, y, pcb_true, 1, PCB_FLAG_FOUND); break; } Index: trunk/src/rats_patch.c =================================================================== --- trunk/src/rats_patch.c (revision 5047) +++ trunk/src/rats_patch.c (revision 5048) @@ -404,7 +404,7 @@ /* fetch the name of the new footprint */ if (argc == 0) { - fpname = gui->prompt_for("Footprint name", ""); + fpname = pcb_gui->prompt_for("Footprint name", ""); if (fpname == NULL) { pcb_message(PCB_MSG_DEFAULT, "No footprint name supplied\n"); return 1; @@ -469,7 +469,7 @@ else default_file = pcb_strdup("unnamed.bap"); - fn = gui->fileselect(_("Save netlist patch as ..."), + fn = pcb_gui->fileselect(_("Save netlist patch as ..."), _("Choose a file to save netlist patch to\n" "for back annotation\n"), default_file, ".bap", "patch", 0); Index: trunk/src/search.c =================================================================== --- trunk/src/search.c (revision 5047) +++ trunk/src/search.c (revision 5048) @@ -1325,7 +1325,7 @@ { int ans; - ans = pcb_search_obj_by_location(Type, Result1, Result2, Result3, X, Y, SLOP * pixel_slop); + ans = pcb_search_obj_by_location(Type, Result1, Result2, Result3, X, Y, SLOP * pcb_pixel_slop); return (ans); } Index: trunk/src/select_act.c =================================================================== --- trunk/src/select_act.c (revision 5047) +++ trunk/src/select_act.c (revision 5048) @@ -64,7 +64,7 @@ attrs[1].enumerations = methods; attrs[1].default_val.int_value = results[1].int_value; - gui->attribute_dialog(attrs, nattr, results, "Find element", "Find element by name"); + pcb_gui->attribute_dialog(attrs, nattr, results, "Find element", "Find element by name"); *method = results[1].int_value; if (results[0].str_value == NULL) @@ -221,7 +221,7 @@ Note.Buffer = conf_core.editor.buffer_number; pcb_buffer_set_number(PCB_MAX_BUFFER - 1); pcb_buffer_clear(PCB_PASTEBUFFER); - gui->get_coords(_("Select the Element's Mark Location"), &x, &y); + pcb_gui->get_coords(_("Select the Element's Mark Location"), &x, &y); x = pcb_grid_fit(x, PCB->Grid, PCB->GridOffsetX); y = pcb_grid_fit(y, PCB->Grid, PCB->GridOffsetY); pcb_buffer_add_selected(PCB_PASTEBUFFER, x, y, pcb_true); Index: trunk/src/undo.c =================================================================== --- trunk/src/undo.c (revision 5047) +++ trunk/src/undo.c (revision 5048) @@ -1154,7 +1154,7 @@ { UndoListTypePtr undo; - if (UndoN && (Force || gui->confirm_dialog("OK to clear 'undo' buffer?", 0))) { + if (UndoN && (Force || pcb_gui->confirm_dialog("OK to clear 'undo' buffer?", 0))) { /* release memory allocated by objects in undo list */ for (undo = UndoList; UndoN; undo++, UndoN--) { if ((undo->Type == PCB_UNDO_CHANGENAME) || (undo->Type == PCB_UNDO_CHANGEPINNUM)) Index: trunk/src_plugins/autoplace/action.c =================================================================== --- trunk/src_plugins/autoplace/action.c (revision 5047) +++ trunk/src_plugins/autoplace/action.c (revision 5048) @@ -46,7 +46,7 @@ static int ActionAutoPlaceSelected(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { pcb_hid_action("Busy"); - if (gui->confirm_dialog(_("Auto-placement can NOT be undone.\n" "Do you want to continue anyway?\n"), 0)) { + if (pcb_gui->confirm_dialog(_("Auto-placement can NOT be undone.\n" "Do you want to continue anyway?\n"), 0)) { if (AutoPlaceSelected()) pcb_board_set_changed_flag(pcb_true); } Index: trunk/src_plugins/autoroute/autoroute.c =================================================================== --- trunk/src_plugins/autoroute/autoroute.c (revision 5047) +++ trunk/src_plugins/autoroute/autoroute.c (revision 5048) @@ -4313,7 +4313,7 @@ * to route a net from a particular starting point, but perfectly * able to route it from some other. */ percent = calculate_progress(this_heap_item, this_heap_size, &ras); - request_cancel = gui->progress(percent * 100., 100, _("Autorouting tracks")); + request_cancel = pcb_gui->progress(percent * 100., 100, _("Autorouting tracks")); if (request_cancel) { ras.total_nets_routed = 0; ras.conflict_subnets = 0; @@ -4544,7 +4544,7 @@ total_via_count = 0; #ifdef ROUTE_DEBUG - ddraw = gui->request_debug_draw(); + ddraw = pcb_gui->request_debug_draw(); if (ddraw != NULL) { ar_gc = ddraw->make_gc(); ddraw->set_line_cap(ar_gc, Round_Cap); @@ -4684,7 +4684,7 @@ /* auto-route all nets */ changed = (RouteAll(rd).total_nets_routed > 0) || changed; donerouting: - gui->progress(0, 0, NULL); + pcb_gui->progress(0, 0, NULL); if (conf_core.editor.live_routing) { int i; pcb_box_t big = { 0, 0, PCB_MAX_COORD, PCB_MAX_COORD }; Index: trunk/src_plugins/dbus/dbus-pcbmain.c =================================================================== --- trunk/src_plugins/dbus/dbus-pcbmain.c (revision 5047) +++ trunk/src_plugins/dbus/dbus-pcbmain.c (revision 5048) @@ -70,8 +70,8 @@ handler = (IOWatchHandler *) data; /* Remove the watch registered with the HID */ - if (gui != NULL) - gui->unwatch_file(handler->pcb_watch); + if (pcb_gui != NULL) + pcb_gui->unwatch_file(handler->pcb_watch); free(handler); } @@ -115,7 +115,7 @@ handler = (TimeoutHandler *) data; /* Remove the timeout registered with the HID */ - gui->stop_timer(handler->pcb_timer); + pcb_gui->stop_timer(handler->pcb_timer); free(handler); } @@ -128,7 +128,7 @@ /* Re-add the timeout, as PCB will remove the current one Do this before calling to dbus, incase DBus removes the timeout. We can't touch handler after libdbus has been run for this reason. */ - handler->pcb_timer = gui->add_timer(timeout_handler_cb, handler->interval, data); + handler->pcb_timer = pcb_gui->add_timer(timeout_handler_cb, handler->interval, data); dbus_timeout_handle(handler->dbus_timeout); } @@ -163,7 +163,7 @@ handler = (IOWatchHandler *) malloc(sizeof(IOWatchHandler)); temp.ptr = (void *) handler; handler->dbus_watch = dbus_watch; - handler->pcb_watch = gui->watch_file(fd, pcb_condition, io_watch_handler_cb, temp); + handler->pcb_watch = pcb_gui->watch_file(fd, pcb_condition, io_watch_handler_cb, temp); dbus_watch_set_data(dbus_watch, handler, io_watch_handler_dbus_freed); return TRUE; @@ -191,7 +191,7 @@ pcb_hidval_t temp; /* We can't create a timeout without a GUI */ - if (gui == NULL) + if (pcb_gui == NULL) return TRUE; /* We won't create a timeout until it becomes enabled. */ @@ -206,7 +206,7 @@ temp.ptr = (void *) handler; handler->dbus_timeout = timeout; handler->interval = dbus_timeout_get_interval(timeout); - handler->pcb_timer = gui->add_timer(timeout_handler_cb, handler->interval, temp); + handler->pcb_timer = pcb_gui->add_timer(timeout_handler_cb, handler->interval, temp); dbus_timeout_set_data(timeout, handler, timeout_handler_dbus_freed); return TRUE; @@ -277,7 +277,7 @@ /* Register a new mainloop hook to mop up any unfinished IO. */ temp.ptr = (void *) connection; - gui->add_block_hook(block_hook_cb, temp); + pcb_gui->add_block_hook(block_hook_cb, temp); return; nomem: Index: trunk/src_plugins/djopt/djopt.c =================================================================== --- trunk/src_plugins/djopt/djopt.c (revision 5047) +++ trunk/src_plugins/djopt/djopt.c (revision 5048) @@ -781,7 +781,7 @@ break; } } - gui->progress(0, 0, 0); + pcb_gui->progress(0, 0, 0); check(c, 0); } Index: trunk/src_plugins/draw_fab/draw_fab.c =================================================================== --- trunk/src_plugins/draw_fab/draw_fab.c (revision 5047) +++ trunk/src_plugins/draw_fab/draw_fab.c (revision 5048) @@ -52,13 +52,13 @@ static void fab_line(pcb_hid_gc_t gc, int x1, int y1, int x2, int y2) { - gui->draw_line(gc, x1, y1, x2, y2); + pcb_gui->draw_line(gc, x1, y1, x2, y2); } static void fab_circle(pcb_hid_gc_t gc, int x, int y, int r) { - gui->draw_arc(gc, x, y, r, r, 0, 180); - gui->draw_arc(gc, x, y, r, r, 180, 180); + pcb_gui->draw_arc(gc, x, y, r, r, 0, 180); + pcb_gui->draw_arc(gc, x, y, r, r, 180, 180); } /* align is 0=left, 1=center, 2=right, add 8 for underline */ @@ -187,7 +187,7 @@ yoff -= (4 - ds) * TEXT_LINE; } - gui->set_line_width(gc, FAB_LINE_W); + pcb_gui->set_line_width(gc, FAB_LINE_W); for (n = AllDrills->DrillN - 1; n >= 0; n--) { int plated_sym = -1, unplated_sym = -1; @@ -196,7 +196,7 @@ plated_sym = --ds; if (drill->UnplatedCount) unplated_sym = --ds; - gui->set_color(gc, PCB->PinColor); + pcb_gui->set_color(gc, PCB->PinColor); for (i = 0; i < drill->PinN; i++) drill_sym(gc, PCB_FLAG_TEST(PCB_FLAG_HOLE, drill->Pin[i]) ? unplated_sym : plated_sym, drill->Pin[i]->X, drill->Pin[i]->Y); if (plated_sym != -1) { @@ -212,7 +212,7 @@ text_at(gc, PCB_MIL_TO_COORD(1400), yoff, PCB_MIL_TO_COORD(2), "NO"); text_at(gc, PCB_MIL_TO_COORD(980), yoff, PCB_MIL_TO_COORD(2), "%d", drill->UnplatedCount); } - gui->set_color(gc, PCB->ElementColor); + pcb_gui->set_color(gc, PCB->ElementColor); text_at(gc, PCB_MIL_TO_COORD(450), yoff, PCB_MIL_TO_COORD(2), "%0.3f", PCB_COORD_TO_INCH(drill->DrillSize) + 0.0004); if (plated_sym != -1 && unplated_sym != -1) text_at(gc, PCB_MIL_TO_COORD(450), yoff + TEXT_LINE, PCB_MIL_TO_COORD(2), "%0.3f", PCB_COORD_TO_INCH(drill->DrillSize) + 0.0004); @@ -221,7 +221,7 @@ total_drills += drill->ViaCount; } - gui->set_color(gc, PCB->ElementColor); + pcb_gui->set_color(gc, PCB->ElementColor); text_at(gc, 0, yoff, PCB_MIL_TO_COORD(9), "Symbol"); text_at(gc, PCB_MIL_TO_COORD(410), yoff, PCB_MIL_TO_COORD(9), "Diam. (Inch)"); text_at(gc, PCB_MIL_TO_COORD(950), yoff, PCB_MIL_TO_COORD(9), "Count"); @@ -247,13 +247,13 @@ } } if (i == pcb_max_copper_layer) { - gui->set_line_width(gc, PCB_MIL_TO_COORD(10)); - gui->draw_line(gc, 0, 0, PCB->MaxWidth, 0); - gui->draw_line(gc, 0, 0, 0, PCB->MaxHeight); - gui->draw_line(gc, PCB->MaxWidth, 0, PCB->MaxWidth, PCB->MaxHeight); - gui->draw_line(gc, 0, PCB->MaxHeight, PCB->MaxWidth, PCB->MaxHeight); + pcb_gui->set_line_width(gc, PCB_MIL_TO_COORD(10)); + pcb_gui->draw_line(gc, 0, 0, PCB->MaxWidth, 0); + pcb_gui->draw_line(gc, 0, 0, 0, PCB->MaxHeight); + pcb_gui->draw_line(gc, PCB->MaxWidth, 0, PCB->MaxWidth, PCB->MaxHeight); + pcb_gui->draw_line(gc, 0, PCB->MaxHeight, PCB->MaxWidth, PCB->MaxHeight); /*FPrintOutline (); */ - gui->set_line_width(gc, FAB_LINE_W); + pcb_gui->set_line_width(gc, FAB_LINE_W); text_at(gc, PCB_MIL_TO_COORD(2000), yoff, 0, "Maximum Dimensions: %f mils wide, %f mils high", PCB_COORD_TO_MIL(PCB->MaxWidth), PCB_COORD_TO_MIL(PCB->MaxHeight)); text_at(gc, PCB->MaxWidth / 2, PCB->MaxHeight + PCB_MIL_TO_COORD(20), 1, @@ -263,15 +263,15 @@ } else { pcb_layer_t *layer = LAYER_PTR(i); - gui->set_line_width(gc, PCB_MIL_TO_COORD(10)); + pcb_gui->set_line_width(gc, PCB_MIL_TO_COORD(10)); PCB_LINE_LOOP(layer); { - gui->draw_line(gc, line->Point1.X, line->Point1.Y, line->Point2.X, line->Point2.Y); + pcb_gui->draw_line(gc, line->Point1.X, line->Point1.Y, line->Point2.X, line->Point2.Y); } END_LOOP; PCB_ARC_LOOP(layer); { - gui->draw_arc(gc, arc->X, arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta); + pcb_gui->draw_arc(gc, arc->X, arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta); } END_LOOP; PCB_TEXT_LOOP(layer); @@ -279,7 +279,7 @@ DrawTextLowLevel(text, 0); } END_LOOP; - gui->set_line_width(gc, FAB_LINE_W); + pcb_gui->set_line_width(gc, FAB_LINE_W); text_at(gc, PCB->MaxWidth / 2, PCB->MaxHeight + PCB_MIL_TO_COORD(20), 1, "Board outline is the centerline of this path"); } yoff -= TEXT_LINE; Index: trunk/src_plugins/export_bom/bom.c =================================================================== --- trunk/src_plugins/export_bom/bom.c (revision 5047) +++ trunk/src_plugins/export_bom/bom.c (revision 5048) @@ -247,7 +247,7 @@ fp = fopen(bom_filename, "w"); if (!fp) { - gui->log("Cannot open file %s for writing\n", bom_filename); + pcb_gui->log("Cannot open file %s for writing\n", bom_filename); print_and_free(NULL, bom); return 1; } Index: trunk/src_plugins/export_dsn/dsn.c =================================================================== --- trunk/src_plugins/export_dsn/dsn.c (revision 5047) +++ trunk/src_plugins/export_dsn/dsn.c (revision 5048) @@ -163,7 +163,7 @@ layerlist = g_list_append(layerlist, &PCB->Data->Layer[top_layer]); } else { - gui->log("WARNING! DSN export does not include the top layer. " + pcb_gui->log("WARNING! DSN export does not include the top layer. " "Router will consider an inner layer to be the \"top\" layer.\n"); } @@ -182,12 +182,12 @@ layerlist = g_list_append(layerlist, first_layer); if (group < top_group) { - gui->log("WARNING! DSN export moved layer group with the \"%s\" layer " + pcb_gui->log("WARNING! DSN export moved layer group with the \"%s\" layer " "after the top layer group. DSN files must have the top " "layer first.\n", first_layer->Name); } if (group > bot_group) { - gui->log("WARNING! DSN export moved layer group with the \"%s\" layer " + pcb_gui->log("WARNING! DSN export moved layer group with the \"%s\" layer " "before the bottom layer group. DSN files must have the " "bottom layer last.\n", first_layer->Name); } @@ -194,7 +194,7 @@ GROUP_LOOP(PCB->Data, group); { if (entry > 0) { - gui->log("WARNING! DSN export squashed layer \"%s\" into layer " + pcb_gui->log("WARNING! DSN export squashed layer \"%s\" into layer " "\"%s\", DSN files do not have layer groups.", layer->Name, first_layer->Name); } } @@ -205,7 +205,7 @@ layerlist = g_list_append(layerlist, &PCB->Data->Layer[bot_layer]); } else { - gui->log("WARNING! DSN export does not include the bottom layer. " + pcb_gui->log("WARNING! DSN export does not include the bottom layer. " "Router will consider an inner layer to be the \"bottom\" layer.\n"); } @@ -476,7 +476,7 @@ /* Print out the dsn .dsn file. */ fp = fopen(dsn_filename, "w"); if (!fp) { - gui->log("Cannot open file %s for writing\n", dsn_filename); + pcb_gui->log("Cannot open file %s for writing\n", dsn_filename); return 1; } Index: trunk/src_plugins/export_dxf/dxf.c =================================================================== --- trunk/src_plugins/export_dxf/dxf.c (revision 5047) +++ trunk/src_plugins/export_dxf/dxf.c (revision 5048) @@ -2603,7 +2603,7 @@ fclose(f_temp); } else { - gui->log("Error in dxf_write_header_from_template (): cannot open file %s for reading.\n", dxf_header_filename); + pcb_gui->log("Error in dxf_write_header_from_template (): cannot open file %s for reading.\n", dxf_header_filename); if (dxf_metric) { dxf_write_header_metric_new(); } @@ -3211,7 +3211,7 @@ fclose(f_temp); } else { - gui->log("Error in dxf_write_footer (): cannot open file %s for reading.\n", dxf_footer_filename); + pcb_gui->log("Error in dxf_write_footer (): cannot open file %s for reading.\n", dxf_footer_filename); if (dxf_metric) { dxf_write_footer_metric_new(); } @@ -3925,7 +3925,7 @@ fp = fopen(dxf_xref_filename, "w"); if (!fp) { - gui->log("Error in dxf.c|dxf_export_xref_file (): cannot open file %s for writing.\n", dxf_xref_filename); + pcb_gui->log("Error in dxf.c|dxf_export_xref_file (): cannot open file %s for writing.\n", dxf_xref_filename); return 1; } /* Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 5047) +++ trunk/src_plugins/export_gerber/gerber.c (revision 5048) @@ -774,19 +774,19 @@ if (outline_layer && outline_layer != PCB->Data->Layer + idx) pcb_draw_layer(outline_layer, ®ion); else if (!outline_layer) { - pcb_hid_gc_t gc = gui->make_gc(); + pcb_hid_gc_t gc = pcb_gui->make_gc(); printf("name %s idx %d\n", name, idx); if (SL_TYPE(idx) == SL_SILK) - gui->set_line_width(gc, PCB->minSlk); + pcb_gui->set_line_width(gc, PCB->minSlk); else if (group >= 0) - gui->set_line_width(gc, PCB->minWid); + pcb_gui->set_line_width(gc, PCB->minWid); else - gui->set_line_width(gc, AUTO_OUTLINE_WIDTH); - gui->draw_line(gc, 0, 0, PCB->MaxWidth, 0); - gui->draw_line(gc, 0, 0, 0, PCB->MaxHeight); - gui->draw_line(gc, PCB->MaxWidth, 0, PCB->MaxWidth, PCB->MaxHeight); - gui->draw_line(gc, 0, PCB->MaxHeight, PCB->MaxWidth, PCB->MaxHeight); - gui->destroy_gc(gc); + pcb_gui->set_line_width(gc, AUTO_OUTLINE_WIDTH); + pcb_gui->draw_line(gc, 0, 0, PCB->MaxWidth, 0); + pcb_gui->draw_line(gc, 0, 0, 0, PCB->MaxHeight); + pcb_gui->draw_line(gc, PCB->MaxWidth, 0, PCB->MaxWidth, PCB->MaxHeight); + pcb_gui->draw_line(gc, 0, PCB->MaxHeight, PCB->MaxWidth, PCB->MaxHeight); + pcb_gui->destroy_gc(gc); } } Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 5047) +++ trunk/src_plugins/export_ps/ps.c (revision 5048) @@ -1499,7 +1499,7 @@ ps_calib_attribute_list[0].default_val.str_value = pcb_strdup("lpr"); } - if (gui-> + if (pcb_gui-> attribute_dialog(ps_calib_attribute_list, 1, vals, _("Print Calibration Page"), _("Generates a printer calibration page"))) return; Index: trunk/src_plugins/export_xy/xy.c =================================================================== --- trunk/src_plugins/export_xy/xy.c (revision 5047) +++ trunk/src_plugins/export_xy/xy.c (revision 5048) @@ -159,7 +159,7 @@ fp = fopen(xy_filename, "w"); if (!fp) { - gui->log("Cannot open file %s for writing\n", xy_filename); + pcb_gui->log("Cannot open file %s for writing\n", xy_filename); return 1; } Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/actions/actions.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/actions/actions.c (revision 5047) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/actions/actions.c (revision 5048) @@ -32,7 +32,7 @@ static int action_cb(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { - acontext_t *ctx = (acontext_t *)current_action; + acontext_t *ctx = (acontext_t *)pcb_current_action; int action_argc_old; const char **action_argv_old; @@ -98,5 +98,5 @@ void create_menu(const char *path, const char *action, const char *mnemonic, const char *hotkey, const char *tooltip) { - gui->create_menu(path, action, mnemonic, hotkey, tooltip, "TODO#2"); + pcb_gui->create_menu(path, action, mnemonic, hotkey, tooltip, "TODO#2"); } Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/dialogs/dialogs.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/dialogs/dialogs.c (revision 5047) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/dialogs/dialogs.c (revision 5048) @@ -2,11 +2,11 @@ #include "src/error.h" #include "dialogs.h" -extern pcb_hid_t *gui; +extern pcb_hid_t *pcb_gui; void dialog_log(const char *msg) { - if (gui == NULL) + if (pcb_gui == NULL) fprintf(stderr, "couldn't find gui for log: \"%s\"\n", msg); else pcb_message(PCB_MSG_DEFAULT, "%s", msg); @@ -15,7 +15,7 @@ #define empty(s) (((s) == NULL) || ((*s) == '\0')) int dialog_confirm(const char *msg, const char *ok, const char *cancel) { - if (gui == NULL) { + if (pcb_gui == NULL) { fprintf(stderr, "couldn't find gui for dialog_confirm: \"%s\"\n", msg); return -1; } @@ -25,58 +25,58 @@ if (empty(cancel)) cancel = NULL; - return gui->confirm_dialog(msg, cancel, ok, NULL); + return pcb_gui->confirm_dialog(msg, cancel, ok, NULL); } #undef empty void dialog_report(const char *title, const char *msg) { - if (gui == NULL) + if (pcb_gui == NULL) fprintf(stderr, "couldn't find gui for dialog_report: \"%s\" \"%s\"\n", title, msg); else - gui->report_dialog(title, msg); + pcb_gui->report_dialog(title, msg); } dynamic char *dialog_prompt(const char *msg, const char *default_) { - if (gui == NULL) { + if (pcb_gui == NULL) { fprintf(stderr, "couldn't find gui for dialog_prompt: \"%s\" \"%s\"\n", msg, default_); return NULL; } else - return gui->prompt_for(msg, default_); + return pcb_gui->prompt_for(msg, default_); } dynamic char *dialog_fileselect(const char *title, const char *descr, char *default_file, char *default_ext, const char *history_tag, multiple dialog_fileselect_t flags) { - if (gui == NULL) { + if (pcb_gui == NULL) { fprintf(stderr, "couldn't find gui for dialog_fileselect\n"); return NULL; } else - return gui->fileselect(title, descr, default_file, default_ext, history_tag, flags); + return pcb_gui->fileselect(title, descr, default_file, default_ext, history_tag, flags); } void dialog_beep(void) { - if (gui == NULL) + if (pcb_gui == NULL) fprintf(stderr, "couldn't find gui for dialog_beep\n"); else - gui->beep(); + pcb_gui->beep(); } int dialog_progress(int so_far, int total, const char *message) { - if (gui == NULL) { + if (pcb_gui == NULL) { fprintf(stderr, "couldn't find gui for dialog_process: %d/%d \"%s\"\n", so_far, total, message); return -1; } - return gui->progress(so_far, total, message); + return pcb_gui->progress(so_far, total, message); } int dialog_attribute(gpmi_hid_t *hid, const char *title, const char *descr) { - if (gui == NULL) { + if (pcb_gui == NULL) { fprintf(stderr, "couldn't find gui for dialog_attribute: \"%s\" \"%s\"\n", title, descr); return -1; } @@ -87,5 +87,5 @@ else hid->result = calloc(sizeof(pcb_hid_attribute_t), hid->attr_num); - return gui->attribute_dialog(hid->attr, hid->attr_num, hid->result, title, descr); + return pcb_gui->attribute_dialog(hid->attr, hid->attr_num, hid->result, title, descr); } Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid.c (revision 5047) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid.c (revision 5048) @@ -41,8 +41,8 @@ h->hid->name = pcb_strdup(hid_name); h->hid->description = pcb_strdup(description); - h->hid->exporter = 1; - h->hid->gui = 0; + h->hid->pcb_exporter = 1; + h->hid->pcb_gui = 0; h->hid->struct_size = sizeof(pcb_hid_t); h->hid->get_export_options = gpmi_hid_get_export_options; Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid.h =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid.h (revision 5047) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid.h (revision 5048) @@ -50,7 +50,7 @@ } gpmi_hid_t; /* Creates a new hid context. Name and description matters only if the hid is -registered as an exporter later. */ +registered as an pcb_exporter later. */ gpmi_hid_t *hid_create(char *hid_name, char *description); /* Append an attribute in a hid previously created using hid_create(). Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.c (revision 5047) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.c (revision 5048) @@ -18,7 +18,7 @@ { gpmi_hid_t *h; - h = hid_gpmi_data_get(exporter); + h = hid_gpmi_data_get(pcb_exporter); if (h == NULL) return NULL; @@ -34,7 +34,7 @@ pcb_hid_gc_t gpmi_hid_make_gc(void) { pcb_hid_gc_t ret; - gpmi_hid_t *h = hid_gpmi_data_get(exporter); + gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter); /* TODO: fix gc handling... */ h->new_gc = (void *)(gcs++); @@ -46,13 +46,13 @@ void gpmi_hid_destroy_gc(pcb_hid_gc_t gc) { - gpmi_hid_t *h = hid_gpmi_data_get(exporter); + gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter); gpmi_event(h->module, HIDE_destroy_gc, h, gc); } void gpmi_hid_do_export(pcb_hid_attr_val_t * options) { - gpmi_hid_t *h = hid_gpmi_data_get(exporter); + gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter); int save_ons[PCB_MAX_LAYER + 2]; pcb_box_t region; @@ -85,7 +85,7 @@ int gpmi_hid_set_layer(const char *name, int group, int empty) { - gpmi_hid_t *h = hid_gpmi_data_get(exporter); + gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter); gpmi_event(h->module, HIDE_set_layer, h, name, group, empty); return 1; } @@ -92,61 +92,61 @@ void gpmi_hid_set_color(pcb_hid_gc_t gc, const char *name) { - gpmi_hid_t *h = hid_gpmi_data_get(exporter); + gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter); gpmi_event(h->module, HIDE_set_color, h, gc, name); } void gpmi_hid_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style) { - gpmi_hid_t *h = hid_gpmi_data_get(exporter); + gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter); gpmi_event(h->module, HIDE_set_line_cap, h, gc, style); } void gpmi_hid_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) { - gpmi_hid_t *h = hid_gpmi_data_get(exporter); + gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter); gpmi_event(h->module, HIDE_set_line_width, h, gc, width); } void gpmi_hid_set_draw_xor(pcb_hid_gc_t gc, int xor) { - gpmi_hid_t *h = hid_gpmi_data_get(exporter); + gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter); gpmi_event(h->module, HIDE_set_draw_xor, h, gc, xor); } void gpmi_hid_set_draw_faded(pcb_hid_gc_t gc, int faded) { - gpmi_hid_t *h = hid_gpmi_data_get(exporter); + gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter); gpmi_event(h->module, HIDE_set_draw_faded, h, gc, faded); } void gpmi_hid_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { - gpmi_hid_t *h = hid_gpmi_data_get(exporter); + gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter); gpmi_event(h->module, HIDE_draw_line, h, gc, x1, y1, x2, y2); } void gpmi_hid_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t xradius, pcb_coord_t yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle) { - gpmi_hid_t *h = hid_gpmi_data_get(exporter); + gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter); gpmi_event(h->module, HIDE_draw_arc, h, gc, cx, cy, xradius, yradius, start_angle, delta_angle); } void gpmi_hid_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { - gpmi_hid_t *h = hid_gpmi_data_get(exporter); + gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter); gpmi_event(h->module, HIDE_draw_rect, h, gc, x1, y1, x2, y2); } void gpmi_hid_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius) { - gpmi_hid_t *h = hid_gpmi_data_get(exporter); + gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter); gpmi_event(h->module, HIDE_fill_circle, h, gc, cx, cy, radius); } void gpmi_hid_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t *x, pcb_coord_t *y) { - gpmi_hid_t *h = hid_gpmi_data_get(exporter); + gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter); /* TODO: need accessor for these */ gpmi_event(h->module, HIDE_fill_polygon, h, gc, x, y); } @@ -158,24 +158,24 @@ void gpmi_hid_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { - gpmi_hid_t *h = hid_gpmi_data_get(exporter); + gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter); gpmi_event(h->module, HIDE_fill_rect, h, gc, x1, y1, x2, y2); } void gpmi_hid_use_mask(int use_it) { - gpmi_hid_t *h = hid_gpmi_data_get(exporter); + gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter); gpmi_event(h->module, HIDE_use_mask, h, use_it); } void gpmi_hid_fill_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t *pad, pcb_bool drawHole, pcb_bool mask) { - gpmi_hid_t *h = hid_gpmi_data_get(exporter); + gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter); gpmi_event(h->module, HIDE_fill_pcb_pv, h, fg_gc, bg_gc, pad, drawHole, mask); } void gpmi_hid_fill_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask) { - gpmi_hid_t *h = hid_gpmi_data_get(exporter); + gpmi_hid_t *h = hid_gpmi_data_get(pcb_exporter); gpmi_event(h->module, HIDE_fill_pcb_pad, h, gc, pad, clear, mask); } Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/debug_draw.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/debug_draw.c (revision 5047) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/debug_draw.c (revision 5048) @@ -11,7 +11,7 @@ int debug_draw_request(void) { - ddh = gui->request_debug_draw(); + ddh = pcb_gui->request_debug_draw(); if (ddh == NULL) return 0; return 1; @@ -20,7 +20,7 @@ void debug_draw_flush(void) { need_ddh; - gui->flush_debug_draw(); + pcb_gui->flush_debug_draw(); } void debug_draw_finish(dctx_t *ctx) @@ -27,7 +27,7 @@ { need_ddh; ddh->destroy_gc(ctx->gc); - gui->finish_debug_draw(); + pcb_gui->finish_debug_draw(); free(ctx); ddh = NULL; } Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c (revision 5047) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c (revision 5048) @@ -31,7 +31,7 @@ hid_gpmi_script_info_t *i; const char *menu = "/main_menu/Plugins/GPMI scripting/Scripts"; - gui->create_menu(menu, "gpmi_scripts()", "S", "Altg", "Manage GPMI scripts", gpmi_cookie); + pcb_gui->create_menu(menu, "gpmi_scripts()", "S", "Altg", "Manage GPMI scripts", gpmi_cookie); ev = gpmi_event_find("ACTE_gui_init", &ev_args); if (ev >= 0) { Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.h =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.h (revision 5047) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.h (revision 5048) @@ -1,4 +1,4 @@ extern const char *gpmi_cookie; -extern int gpmi_hid_gui_inited; /* whether the gui is already initialzied */ +extern int gpmi_hid_gui_inited; /* whether the pcb_gui is already initialized */ void gpmi_hid_print_error(gpmi_err_stack_t *entry, char *string); Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/manage_scripts.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/manage_scripts.c (revision 5047) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/manage_scripts.c (revision 5048) @@ -11,7 +11,7 @@ #include "src/hid_attrib.h" -extern pcb_hid_t *gui; +extern pcb_hid_t *pcb_gui; #define attr_make_label(attr, name_, help_) \ do { \ @@ -68,7 +68,7 @@ if (operations != NULL) attr_make_enum(&attr[1], "operation", "Choose what to do with the script", operations, *operation); - res = gui->attribute_dialog(attr, 1 + (operations != NULL), result, "GPMI manage scripts - select script", "Select one of the scripts already loaded"); + res = pcb_gui->attribute_dialog(attr, 1 + (operations != NULL), result, "GPMI manage scripts - select script", "Select one of the scripts already loaded"); /* free scrl slots before return */ for(s = scrl; *s != NULL; s++) @@ -121,7 +121,7 @@ "stutter", "ghli", "perl", "php", "cli", NULL }; - fn = gui->fileselect("Load script", "Load a GPMI script", NULL, NULL, "gpmi_load_script", HID_FILESELECT_READ); + fn = pcb_gui->fileselect("Load script", "Load a GPMI script", NULL, NULL, "gpmi_load_script", HID_FILESELECT_READ); if (fn == NULL) return NULL; @@ -149,7 +149,7 @@ attr_make_enum(&attr[0], "module", "Select a GPMI module to interpret the script", modules, default_mod); - if (gui->attribute_dialog(attr, 1, result, "GPMI manage scripts - select module", "Select one of GPMI modules to interpret the script")) + if (pcb_gui->attribute_dialog(attr, 1, result, "GPMI manage scripts - select module", "Select one of GPMI modules to interpret the script")) return NULL; if (result[0].int_value < 0) @@ -157,7 +157,7 @@ info = hid_gpmi_load_module(NULL, modules[result[0].int_value], fn, NULL); if (info == NULL) - gui->report_dialog("GPMI script load", "Error loading the script.\nPlease consult the message log for details."); + pcb_gui->report_dialog("GPMI script load", "Error loading the script.\nPlease consult the message log for details."); return info; } @@ -173,7 +173,7 @@ attr_make_label_str(&attr[0], "File name: ", i->name, "File name of the script (if not absolute, it's relative to the config file)"); attr_make_label_str(&attr[1], "GPMI module: ", i->module_name, "Name of the GPMI module that is interpreting the script"); attr_make_label_str(&attr[2], "Config file: ", cf, "Name of config file that requested the script to be loaded "); - gui->attribute_dialog(attr, 3, result, "GPMI manage scripts - script details", "Displaying detailed info on a script already loaded"); + pcb_gui->attribute_dialog(attr, 3, result, "GPMI manage scripts - script details", "Displaying detailed info on a script already loaded"); free((char *)attr[0].name); free((char *)attr[1].name); free((char *)attr[2].name); @@ -193,24 +193,24 @@ if (i != NULL) script_details(i); else - gui->report_dialog("GPMI script details", err_no_script); + pcb_gui->report_dialog("GPMI script details", err_no_script); break; case 1: if (i != NULL) { i = hid_gpmi_reload_module(i); if (i == NULL) - gui->report_dialog("GPMI script reload", "Error reloading the script.\nThe script is now unloaded.\n" CONSULT "\n(e.g. there may be syntax errors in the script source)."); + pcb_gui->report_dialog("GPMI script reload", "Error reloading the script.\nThe script is now unloaded.\n" CONSULT "\n(e.g. there may be syntax errors in the script source)."); } else - gui->report_dialog("GPMI script reload", err_no_script); + pcb_gui->report_dialog("GPMI script reload", err_no_script); break; case 2: if (i != NULL) { if (gpmi_hid_script_unload(i) != 0) - gui->report_dialog("GPMI script unload", "Error unloading the script.\n" CONSULT "\n"); + pcb_gui->report_dialog("GPMI script unload", "Error unloading the script.\n" CONSULT "\n"); } else - gui->report_dialog("GPMI script unload", err_no_script); + pcb_gui->report_dialog("GPMI script unload", err_no_script); break; case 3: if (i != NULL) { @@ -223,11 +223,11 @@ (r1 ? "couldnt't remove the script from the config file;" : ""), (r2 ? "couldnt't unload the script;" : ""), "\n" CONSULT "\n", NULL); - gui->report_dialog("GPMI script unload and remove", msg); + pcb_gui->report_dialog("GPMI script unload and remove", msg); free(msg); } else - gui->report_dialog("GPMI script unload and remove", err_no_script); + pcb_gui->report_dialog("GPMI script unload and remove", err_no_script); } break; case 4: @@ -237,7 +237,7 @@ i = load_script(); if (i != NULL) { if (gpmi_hid_script_addcfg(i) != 0) - gui->report_dialog("GPMI script add to config", "Error adding the script in user configuration.\n" CONSULT "\n"); + pcb_gui->report_dialog("GPMI script add to config", "Error adding the script in user configuration.\n" CONSULT "\n"); } break; } Index: trunk/src_plugins/hid_gtk/gtkhid-main.c =================================================================== --- trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 5047) +++ trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 5048) @@ -117,7 +117,7 @@ ytmp = (SIDE_Y(center_y) - gport->view.y0) / (double) gport->view.height; gport->view.coord_per_px = new_zoom; - pixel_slop = new_zoom; + pcb_pixel_slop = new_zoom; ghid_port_ranges_scale(); gport->view.x0 = SIDE_X(center_x) - xtmp * gport->view.width; @@ -1386,7 +1386,7 @@ } if (printer == NULL) { - gui->log(_("Can't find a suitable printer HID")); + pcb_gui->log(_("Can't find a suitable printer HID")); return -1; } @@ -1395,7 +1395,7 @@ ghid_dialog_print(printer); } else - gui->log(_("Can't print empty layout")); + pcb_gui->log(_("Can't print empty layout")); return 0; } @@ -1430,7 +1430,7 @@ pcb_hid_t *printer = pcb_hid_find_printer(); printer->calibrate(0.0, 0.0); - if (gui->attribute_dialog(printer_calibrate_attrs, 3, + if (pcb_gui->attribute_dialog(printer_calibrate_attrs, 3, printer_calibrate_values, _("Printer Calibration Values"), _("Enter calibration values for your printer"))) return 1; @@ -1448,7 +1448,7 @@ ghid_dialog_export(); } else - gui->log(_("Can't export empty layout")); + pcb_gui->log(_("Can't export empty layout")); return 0; } @@ -1602,7 +1602,7 @@ dy = -dy; pcb_event_move_crosshair(pcb_crosshair.X + dx, pcb_crosshair.Y + dy); - gui->set_crosshair(pcb_crosshair.X, pcb_crosshair.Y, pan_warp); + pcb_gui->set_crosshair(pcb_crosshair.X, pcb_crosshair.Y, pan_warp); return 0; } Index: trunk/src_plugins/hid_gtk/gui-dialog-print.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-dialog-print.c (revision 5047) +++ trunk/src_plugins/hid_gtk/gui-dialog-print.c (revision 5048) @@ -310,7 +310,7 @@ static void exporter_clicked_cb(GtkButton * button, pcb_hid_t * exporter) { - ghid_dialog_print(exporter); + ghid_dialog_print(pcb_exporter); } void ghid_dialog_print(pcb_hid_t * hid) @@ -324,9 +324,9 @@ if (export_dialog) gtk_dialog_response(GTK_DIALOG(export_dialog), GTK_RESPONSE_CANCEL); - exporter = hid; + pcb_exporter = hid; - attr = exporter->get_export_options(&n); + attr = pcb_exporter->get_export_options(&n); if (n > 0) { results = (pcb_hid_attr_val_t *) malloc(n * sizeof(pcb_hid_attr_val_t)); if (results == NULL) { @@ -335,12 +335,12 @@ } /* non-zero means cancel was picked */ - if (ghid_attribute_dialog(attr, n, results, _("PCB Print Layout"), exporter->description)) + if (ghid_attribute_dialog(attr, n, results, _("PCB Print Layout"), pcb_exporter->description)) return; } - exporter->do_export(results); + pcb_exporter->do_export(results); for (i = 0; i < n; i++) { if (results[i].str_value) @@ -350,7 +350,7 @@ if (results) free(results); - exporter = NULL; + pcb_exporter = NULL; } void ghid_dialog_export(void) Index: trunk/src_plugins/hid_gtk/gui-netlist-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-netlist-window.c (revision 5047) +++ trunk/src_plugins/hid_gtk/gui-netlist-window.c (revision 5048) @@ -269,7 +269,7 @@ pcb_pin_t *pin = (pcb_pin_t *) conn.ptr2; x = pin->X; y = pin->Y; - gui->set_crosshair(x, y, 0); + pcb_gui->set_crosshair(x, y, 0); ghid_lead_user_to_location(x, y); break; } @@ -278,7 +278,7 @@ pcb_pad_t *pad = (pcb_pad_t *) conn.ptr2; x = pad->Point1.X + (pad->Point2.X - pad->Point1.X) / 2; y = pad->Point1.Y + (pad->Point2.Y - pad->Point2.Y) / 2; - gui->set_crosshair(x, y, 0); + pcb_gui->set_crosshair(x, y, 0); ghid_lead_user_to_location(x, y); break; } Index: trunk/src_plugins/hid_gtk/gui-top-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-top-window.c (revision 5047) +++ trunk/src_plugins/hid_gtk/gui-top-window.c (revision 5048) @@ -1312,7 +1312,7 @@ if (condition & G_IO_HUP) { - gui->log("Read end of pipe died!\n"); + pcb_gui->log("Read end of pipe died!\n"); return FALSE; } @@ -1325,17 +1325,17 @@ break; case G_IO_STATUS_ERROR: - gui->log("ERROR status from g_io_channel_read_line\n"); + pcb_gui->log("ERROR status from g_io_channel_read_line\n"); return FALSE; break; case G_IO_STATUS_EOF: - gui->log("Input pipe returned EOF. The --listen option is \n" "probably not running anymore in this session.\n"); + pcb_gui->log("Input pipe returned EOF. The --listen option is \n" "probably not running anymore in this session.\n"); return FALSE; break; case G_IO_STATUS_AGAIN: - gui->log("AGAIN status from g_io_channel_read_line\n"); + pcb_gui->log("AGAIN status from g_io_channel_read_line\n"); return FALSE; break; @@ -1427,7 +1427,7 @@ gport = &ghid_port; gport->view.coord_per_px = 300.0; - pixel_slop = 300; + pcb_pixel_slop = 300; ghid_init_renderer(argc, argv, gport); Index: trunk/src_plugins/hid_lesstif/dialogs.c =================================================================== --- trunk/src_plugins/hid_lesstif/dialogs.c (revision 5047) +++ trunk/src_plugins/hid_lesstif/dialogs.c (revision 5048) @@ -936,7 +936,7 @@ { pcb_hid_t *printer = pcb_hid_find_printer(); printer->calibrate(0.0, 0.0); - if (gui->attribute_dialog(printer_calibrate_attrs, 3, + if (pcb_gui->attribute_dialog(printer_calibrate_attrs, 3, printer_calibrate_values, "Printer Calibration Values", "Enter calibration values for your printer")) return 1; @@ -1011,7 +1011,7 @@ return 1; printer = hids[i - 1]; - exporter = printer; + pcb_exporter = printer; opts = printer->get_export_options(&n); vals = (pcb_hid_attr_val_t *) calloc(n, sizeof(pcb_hid_attr_val_t)); @@ -1021,7 +1021,7 @@ } printer->do_export(vals); free(vals); - exporter = NULL; + pcb_exporter = NULL; return 0; } @@ -1315,7 +1315,7 @@ group = MoveLayerToGroup(layer, group); lg_setcol[layer] = group; lgbutton_expose(w, 0, 0); - gui->invalidate_all(); + pcb_gui->invalidate_all(); } static void lgbutton_resize(Widget w, XtPointer u, XmDrawingAreaCallbackStruct * cbs) Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 5047) +++ trunk/src_plugins/hid_lesstif/main.c (revision 5048) @@ -864,7 +864,7 @@ dy = -dy; pcb_event_move_crosshair(pcb_crosshair.X + dx, pcb_crosshair.Y + dy); - gui->set_crosshair(pcb_crosshair.X, pcb_crosshair.Y, pan_warp); + pcb_gui->set_crosshair(pcb_crosshair.X, pcb_crosshair.Y, pan_warp); return 0; } @@ -1123,7 +1123,7 @@ view_left_x = -(view_width * new_zoom - PCB->MaxWidth) / 2; view_top_y = -(view_height * new_zoom - PCB->MaxHeight) / 2; view_zoom = new_zoom; - pixel_slop = view_zoom; + pcb_pixel_slop = view_zoom; lesstif_pan_fixup(); } @@ -1159,7 +1159,7 @@ if (view_zoom != new_zoom) { view_zoom = new_zoom; - pixel_slop = view_zoom; + pcb_pixel_slop = view_zoom; view_left_x = cx - view_width * xfrac * view_zoom; view_top_y = cy - view_height * yfrac * view_zoom; Index: trunk/src_plugins/hid_lesstif/netlist.c =================================================================== --- trunk/src_plugins/hid_lesstif/netlist.c (revision 5047) +++ trunk/src_plugins/hid_lesstif/netlist.c (revision 5048) @@ -228,7 +228,7 @@ if (strcmp(pad->Number, pname) == 0) { int x = (pad->Point1.X + pad->Point2.X) / 2; int y = (pad->Point1.Y + pad->Point2.Y) / 2; - gui->set_crosshair(x, y, HID_SC_PAN_VIEWPORT); + pcb_gui->set_crosshair(x, y, HID_SC_PAN_VIEWPORT); free(ename); return; } Index: trunk/src_plugins/import_dsn/dsn.c =================================================================== --- trunk/src_plugins/import_dsn/dsn.c (revision 5047) +++ trunk/src_plugins/import_dsn/dsn.c (revision 5048) @@ -99,7 +99,7 @@ fname = argc ? argv[0] : 0; if (!fname || !*fname) { - fname = gui->fileselect(_("Load dsn routing session Resource File..."), + fname = pcb_gui->fileselect(_("Load dsn routing session Resource File..."), _("Picks a dsn session resource file to load.\n" "This file could be generated by freeroute.net\n"), default_file, ".ses", "ses", HID_FILESELECT_READ); Index: trunk/src_plugins/import_sch/import_sch.c =================================================================== --- trunk/src_plugins/import_sch/import_sch.c (revision 5047) +++ trunk/src_plugins/import_sch/import_sch.c (revision 5048) @@ -189,7 +189,7 @@ units = PCB_ACTION_ARG(2); if (!ds) { const char *as = pcb_attrib_get(PCB, "import::disperse"); - ds = gui->prompt_for(_("Enter dispersion:"), as ? as : "0"); + ds = pcb_gui->prompt_for(_("Enter dispersion:"), as ? as : "0"); } if (units) { sprintf(buf, "%s%s", ds, units); @@ -212,7 +212,7 @@ units = PCB_ACTION_ARG(3); if (!xs) { - gui->get_coords(_("Click on a location"), &x, &y); + pcb_gui->get_coords(_("Click on a location"), &x, &y); } else if (strcasecmp(xs, "center") == 0) { pcb_attrib_remove(PCB, "import::newX"); Index: trunk/src_plugins/jostle/jostle.c =================================================================== --- trunk/src_plugins/jostle/jostle.c (revision 5047) +++ trunk/src_plugins/jostle/jostle.c (revision 5048) @@ -88,7 +88,7 @@ #ifndef DEBUG_pcb_polyarea_t return; #endif - ddraw = gui->request_debug_draw(); + ddraw = pcb_gui->request_debug_draw(); ddgc = ddraw->make_gc(); p = s; @@ -102,13 +102,13 @@ y[i++] = v->point[1]; } if (1) { - gui->set_color(ddgc, color ? color : PCB->ConnectedColor); - gui->set_line_width(ddgc, 1); + pcb_gui->set_color(ddgc, color ? color : PCB->ConnectedColor); + pcb_gui->set_line_width(ddgc, 1); for (i = 0; i < n - 1; i++) { - gui->draw_line(ddgc, x[i], y[i], x[i + 1], y[i + 1]); - /* gui->fill_circle (ddgc, x[i], y[i], 30);*/ + pcb_gui->draw_line(ddgc, x[i], y[i], x[i + 1], y[i + 1]); + /* pcb_gui->fill_circle (ddgc, x[i], y[i], 30);*/ } - gui->draw_line(ddgc, x[n - 1], y[n - 1], x[0], y[0]); + pcb_gui->draw_line(ddgc, x[n - 1], y[n - 1], x[0], y[0]); } free(x); free(y); Index: trunk/src_plugins/oldactions/oldactions.c =================================================================== --- trunk/src_plugins/oldactions/oldactions.c (revision 5047) +++ trunk/src_plugins/oldactions/oldactions.c (revision 5048) @@ -124,7 +124,7 @@ static int ActionBell(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { - gui->beep(); + pcb_gui->beep(); return 0; } Index: trunk/src_plugins/propedit/propedit.c =================================================================== --- trunk/src_plugins/propedit/propedit.c (revision 5047) +++ trunk/src_plugins/propedit/propedit.c (revision 5048) @@ -39,7 +39,7 @@ pe_ctx_t ctx; htsp_entry_t *pe; - if ((gui == NULL) || (gui->propedit_start == NULL)) { + if ((pcb_gui == NULL) || (pcb_gui->propedit_start == NULL)) { pcb_message(PCB_MSG_DEFAULT, "Error: there's no GUI or the active GUI can't edit properties.\n"); return 1; } @@ -47,11 +47,11 @@ ctx.core_props = pcb_props_init(); pcb_propsel_map_core(ctx.core_props); - gui->propedit_start(&ctx, ctx.core_props->fill, propedit_query); + pcb_gui->propedit_start(&ctx, ctx.core_props->fill, propedit_query); for (pe = htsp_first(ctx.core_props); pe; pe = htsp_next(ctx.core_props, pe)) propedit_ins_prop(&ctx, pe); - gui->propedit_end(&ctx); + pcb_gui->propedit_end(&ctx); pcb_props_uninit(ctx.core_props); return 0; } Index: trunk/src_plugins/propedit/props.c =================================================================== --- trunk/src_plugins/propedit/props.c (revision 5047) +++ trunk/src_plugins/propedit/props.c (revision 5048) @@ -230,23 +230,23 @@ pcb_props_t *p = pe->value; pcb_propval_t common, min, max, avg; - if (gui->propedit_add_prop != NULL) - rowid = gui->propedit_add_prop(ctx, pe->key, 1, p->values.fill); + if (pcb_gui->propedit_add_prop != NULL) + rowid = pcb_gui->propedit_add_prop(ctx, pe->key, 1, p->values.fill); - if (gui->propedit_add_stat != NULL) { + if (pcb_gui->propedit_add_stat != NULL) { if (p->type == PCB_PROPT_STRING) { pcb_props_stat(ctx->core_props, pe->key, &common, NULL, NULL, NULL); - gui->propedit_add_stat(ctx, pe->key, rowid, propedit_sprint_val(p->type, common), NULL, NULL, NULL); + pcb_gui->propedit_add_stat(ctx, pe->key, rowid, propedit_sprint_val(p->type, common), NULL, NULL, NULL); } else { pcb_props_stat(ctx->core_props, pe->key, &common, &min, &max, &avg); - gui->propedit_add_stat(ctx, pe->key, rowid, propedit_sprint_val(p->type, common), propedit_sprint_val(p->type, min), propedit_sprint_val(p->type, max), propedit_sprint_val(p->type, avg)); + pcb_gui->propedit_add_stat(ctx, pe->key, rowid, propedit_sprint_val(p->type, common), propedit_sprint_val(p->type, min), propedit_sprint_val(p->type, max), propedit_sprint_val(p->type, avg)); } } - if (gui->propedit_add_value != NULL) + if (pcb_gui->propedit_add_value != NULL) for (e = htprop_first(&p->values); e; e = htprop_next(&p->values, e)) - gui->propedit_add_value(ctx, pe->key, rowid, propedit_sprint_val(p->type, e->key), e->value); + pcb_gui->propedit_add_value(ctx, pe->key, rowid, propedit_sprint_val(p->type, e->key), e->value); } Index: trunk/src_plugins/puller/puller.c =================================================================== --- trunk/src_plugins/puller/puller.c (revision 5047) +++ trunk/src_plugins/puller/puller.c (revision 5048) @@ -473,7 +473,7 @@ pcb_move_obj(PCB_TYPE_LINE_POINT, CURRENT, the_line, &(the_line->Point2), x - the_line->Point2.X, y - the_line->Point2.Y); - gui->invalidate_all(); + pcb_gui->invalidate_all(); pcb_undo_inc_serial(); return 1; @@ -2170,7 +2170,7 @@ #if TRACE0 printf("\033[35mdid_something: recursing\033[0m\n"); { - int i = gui->confirm_dialog("recurse?", 0); + int i = pcb_gui->confirm_dialog("recurse?", 0); printf("confirm = %d\n", i); if (i == 0) return; @@ -2331,13 +2331,13 @@ if (did_something != old_did_something) { pcb_undo_inc_serial(); old_did_something = did_something; - if (gui->confirm_dialog("more?", 0) == 0) { + if (pcb_gui->confirm_dialog("more?", 0) == 0) { did_something = 0; break; } } #endif - /*gui->progress(0,0,0); */ + /*pcb_gui->progress(0,0,0); */ } END_LOOP; } Index: trunk/src_plugins/renumber/renumber.c =================================================================== --- trunk/src_plugins/renumber/renumber.c (revision 5047) +++ trunk/src_plugins/renumber/renumber.c (revision 5048) @@ -81,7 +81,7 @@ * We deal with the case where name already exists in this * function so the GUI doesn't need to deal with it */ - name = gui->fileselect(_("Save Renumber Annotation File As ..."), + name = pcb_gui->fileselect(_("Save Renumber Annotation File As ..."), _("Choose a file to record the renumbering to.\n" "This file may be used to back annotate the\n" "change to the schematics.\n"), default_file, ".eco", "eco", 0); @@ -102,7 +102,7 @@ if ((out = fopen(name, "r"))) { fclose(out); - if (!gui->confirm_dialog(_("File exists! Ok to overwrite?"), 0)) { + if (!pcb_gui->confirm_dialog(_("File exists! Ok to overwrite?"), 0)) { if (free_name && name) free((char*)name); return 0; Index: trunk/src_plugins/report/report.c =================================================================== --- trunk/src_plugins/report/report.c (revision 5047) +++ trunk/src_plugins/report/report.c (revision 5048) @@ -105,7 +105,7 @@ } FreeDrillInfo(AllDrills); /* create dialog box */ - gui->report_dialog("Drill Report", stringlist); + pcb_gui->report_dialog("Drill Report", stringlist); free(stringlist); return 0; @@ -137,7 +137,7 @@ { pcb_pin_t *via; #ifndef NDEBUG - if (gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed()) { pcb_r_dump_tree(PCB->Data->via_tree->root, 0); return 0; } @@ -173,7 +173,7 @@ pcb_pin_t *Pin; pcb_element_t *element; #ifndef NDEBUG - if (gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed()) { pcb_r_dump_tree(PCB->Data->pin_tree->root, 0); return 0; } @@ -220,7 +220,7 @@ { pcb_line_t *line; #ifndef NDEBUG - if (gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed()) { pcb_layer_t *layer = (pcb_layer_t *) ptr1; pcb_r_dump_tree(layer->line_tree->root, 0); return 0; @@ -246,7 +246,7 @@ { pcb_rat_t *line; #ifndef NDEBUG - if (gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed()) { pcb_r_dump_tree(PCB->Data->rat_tree->root, 0); return 0; } @@ -267,7 +267,7 @@ pcb_arc_t *Arc; pcb_box_t *box; #ifndef NDEBUG - if (gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed()) { pcb_layer_t *layer = (pcb_layer_t *) ptr1; pcb_r_dump_tree(layer->arc_tree->root, 0); return 0; @@ -299,7 +299,7 @@ { pcb_polygon_t *Polygon; #ifndef NDEBUG - if (gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed()) { pcb_layer_t *layer = (pcb_layer_t *) ptr1; pcb_r_dump_tree(layer->polygon_tree->root, 0); return 0; @@ -327,7 +327,7 @@ pcb_pad_t *Pad; pcb_element_t *element; #ifndef NDEBUG - if (gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed()) { pcb_r_dump_tree(PCB->Data->pad_tree->root, 0); return 0; } @@ -373,7 +373,7 @@ { pcb_element_t *element; #ifndef NDEBUG - if (gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed()) { pcb_r_dump_tree(PCB->Data->element_tree->root, 0); return 0; } @@ -404,7 +404,7 @@ } case PCB_TYPE_TEXT: #ifndef NDEBUG - if (gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed()) { pcb_layer_t *layer = (pcb_layer_t *) ptr1; pcb_r_dump_tree(layer->text_tree->root, 0); return 0; @@ -415,7 +415,7 @@ char laynum[32]; pcb_text_t *text; #ifndef NDEBUG - if (gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed()) { pcb_r_dump_tree(PCB->Data->name_tree[NAME_INDEX()]->root, 0); return 0; } @@ -466,7 +466,7 @@ if (report != NULL) { /* create dialog box */ - gui->report_dialog("Report", report); + pcb_gui->report_dialog("Report", report); free(report); } return 0; @@ -496,7 +496,7 @@ } END_LOOP; - gui->report_dialog("Report", list.array); + pcb_gui->report_dialog("Report", list.array); gds_uninit(&list); return 0; } @@ -619,7 +619,7 @@ pcb_reset_conns(pcb_false); pcb_snprintf(buf, sizeof(buf), "%$m*", units_name, length); - gui->log("Net %s length %s\n", netname, buf); + pcb_gui->log("Net %s length %s\n", netname, buf); } } @@ -634,7 +634,7 @@ char *netname = 0; int found = 0; - gui->get_coords("Click on a connection", &x, &y); + pcb_gui->get_coords("Click on a connection", &x, &y); /* Reset all connection flags and save an undo-state to get back * to the state the board was in when we started this function. @@ -652,7 +652,7 @@ if (!found) { pcb_reset_conns(pcb_false); pcb_undo(pcb_true); - gui->log("No net under cursor.\n"); + pcb_gui->log("No net under cursor.\n"); return 1; } @@ -711,9 +711,9 @@ char buf[50]; pcb_snprintf(buf, sizeof(buf), "%$m*", conf_core.editor.grid_unit->suffix, length); if (netname) - gui->log("Net \"%s\" length: %s\n", netname, buf); + pcb_gui->log("Net \"%s\" length: %s\n", netname, buf); else - gui->log("Net length: %s\n", buf); + pcb_gui->log("Net length: %s\n", buf); } return 0; @@ -783,7 +783,7 @@ } if (!net_found) { - gui->log("No net named %s\n", tofind); + pcb_gui->log("No net named %s\n", tofind); return 1; } @@ -809,9 +809,9 @@ if (!found) { if (net_found) - gui->log("Net found, but no lines or arcs were flagged.\n"); + pcb_gui->log("Net found, but no lines or arcs were flagged.\n"); else - gui->log("Net not found.\n"); + pcb_gui->log("Net not found.\n"); return 1; } @@ -820,9 +820,9 @@ char buf[50]; pcb_snprintf(buf, sizeof(buf), "%$m*", conf_core.editor.grid_unit->suffix, length); if (netname) - gui->log("Net \"%s\" length: %s\n", netname, buf); + pcb_gui->log("Net \"%s\" length: %s\n", netname, buf); else - gui->log("Net length: %s\n", buf); + pcb_gui->log("Net length: %s\n", buf); } return 0; @@ -871,7 +871,7 @@ if ((argc < 1) || (argc > 2)) AUSAGE(report); else if (strcasecmp(argv[0], "Object") == 0) { - gui->get_coords("Click on an object", &x, &y); + pcb_gui->get_coords("Click on an object", &x, &y); return ReportDialog(argc - 1, argv + 1, x, y); } else if (strcasecmp(argv[0], "DrillReport") == 0) Index: trunk/src_plugins/shand_cmd/command.c =================================================================== --- trunk/src_plugins/shand_cmd/command.c (revision 5047) +++ trunk/src_plugins/shand_cmd/command.c (revision 5048) @@ -125,7 +125,7 @@ return (1); } - if (!PCB->Changed || gui->confirm_dialog("OK to override layout data?", 0)) + if (!PCB->Changed || pcb_gui->confirm_dialog("OK to override layout data?", 0)) pcb_load_pcb(filename, format, pcb_true, 0); return (0); } @@ -216,7 +216,7 @@ static int CommandQuit(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { - if (!PCB->Changed || gui->close_confirm_dialog() == HID_CLOSE_CONFIRM_OK) + if (!PCB->Changed || pcb_gui->close_confirm_dialog() == HID_CLOSE_CONFIRM_OK) pcb_quit_app(); return 0; } @@ -327,8 +327,8 @@ pcb_board_set_changed_flag(pcb_false); free(PCB->Filename); PCB->Filename = pcb_strdup(argv[0]); - if (gui->notify_filename_changed != NULL) - gui->notify_filename_changed(); + if (pcb_gui->notify_filename_changed != NULL) + pcb_gui->notify_filename_changed(); } break; Index: trunk/src_plugins/stroke/stroke.c =================================================================== --- trunk/src_plugins/stroke/stroke.c (revision 5047) +++ trunk/src_plugins/stroke/stroke.c (revision 5048) @@ -136,7 +136,7 @@ } } else - gui->beep(); + pcb_gui->beep(); } static void real_stroke_record(int ev_x, int ev_y) Index: trunk/src_plugins/teardrops/teardrops.c =================================================================== --- trunk/src_plugins/teardrops/teardrops.c (revision 5047) +++ trunk/src_plugins/teardrops/teardrops.c (revision 5048) @@ -300,7 +300,7 @@ } ENDALL_LOOP; - gui->invalidate_all(); + pcb_gui->invalidate_all(); if (new_arcs) pcb_undo_inc_serial(); Index: trunk/src_plugins/vendordrill/vendor.c =================================================================== --- trunk/src_plugins/vendordrill/vendor.c (revision 5047) +++ trunk/src_plugins/vendordrill/vendor.c (revision 5048) @@ -166,7 +166,7 @@ fname = argc ? argv[0] : NULL; if (!fname || !*fname) { - fname = gui->fileselect(_("Load Vendor Resource File..."), + fname = pcb_gui->fileselect(_("Load Vendor Resource File..."), _("Picks a vendor resource file to load.\n" "This file can contain drc settings for a\n" "particular vendor as well as a list of\n"