pcb 4.1.1
An interactive printed circuit board layout editor.
|
HID exporter for gsvit. More...
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <time.h>
#include "global.h"
#include "error.h"
#include "data.h"
#include "misc.h"
#include "rats.h"
#include "find.h"
#include "hid.h"
#include "hid_draw.h"
#include "../hidint.h"
#include "hid/common/hidnogui.h"
#include "hid/common/draw_helpers.h"
#include <gd.h>
#include "xmlout.h"
#include "hid/common/hidinit.h"
#include "pcb-printf.h"
Go to the source code of this file.
Data Structures | |
struct | color_struct |
struct | hid_gc_struct |
struct | gsvit_net_layer |
struct | gsvit_netlist |
struct | drill_hole |
Structure to represent a single hole. More... | |
struct | single_size_drills |
Structure to represent all holes of a given size. More... | |
struct | _StringList |
struct | _BomList |
Defines | |
#define | CRASH fprintf(stderr, "HID error: pcb called unimplemented PNG function %s.\n", __FUNCTION__); abort() |
#define | MAXREFPINS 32 |
Typedefs | |
typedef struct _StringList | StringList |
typedef struct _BomList | BomList |
Functions | |
REGISTER_ATTRIBUTES (gsvit_attribute_list) | |
void | gsvit_build_net_from_selected (struct gsvit_netlist *currNet) |
void | gsvit_create_netlist (void) |
void | gsvit_destroy_netlist (void) |
static int | pcb_to_gsvit (Coord pcb) |
Convert from default PCB units to gsvit units. | |
static char * | gsvit_get_png_name (const char *basename, const char *suffix) |
static void | gsvit_write_xspace (void) |
static void | gsvit_write_xnets (void) |
static StringList * | string_insert (char *str, StringList *list) |
static BomList * | bom_insert (char *refdes, char *descr, char *value, BomList *bom) |
static double | xyToAngle (double x, double y, bool morethan2pins) |
static void | gsvit_parse_arguments (int *argc, char ***argv) |
Main export callback. | |
static HID_Attribute * | gsvit_get_export_options (int *n) |
static char * | CleanXBOMString (char *in) |
static void | gsvit_write_xdrills (void) |
static void | gsvit_write_xcentroids (void) |
void | gsvit_choose_groups () |
Populates gsvit_export_group array. | |
static void | gsvit_alloc_colors () |
Allocate colors. | |
static void | gsvit_start_png (const char *basename, const char *suffix) |
static void | gsvit_finish_png () |
void | gsvit_start_png_export () |
static void | gsvit_do_export (HID_Attr_Val *options) |
void | gsvit_xml_out (char *gsvit_basename) |
static int | gsvit_set_layer (const char *name, int group, int empty) |
static hidGC | gsvit_make_gc (void) |
static void | gsvit_destroy_gc (hidGC gc) |
static void | gsvit_use_mask (enum mask_mode mode) |
static void | gsvit_set_color (hidGC gc, const char *name) |
static void | gsvit_set_line_cap (hidGC gc, EndCapStyle style) |
static void | gsvit_set_line_width (hidGC gc, Coord width) |
static void | gsvit_set_draw_xor (hidGC gc, int xor_) |
static void | gsvit_set_draw_faded (hidGC gc, int faded) |
static void | use_gc (hidGC gc) |
static void | gsvit_draw_rect (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2) |
static void | gsvit_fill_rect (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2) |
struct gsvit_netlist * | gsvit_lookup_net_from_arc (ArcType *targetArc) |
struct gsvit_netlist * | gsvit_lookup_net_from_line (LineType *targetLine) |
struct gsvit_netlist * | gsvit_lookup_net_from_polygon (PolygonType *targetPolygon) |
struct gsvit_netlist * | gsvit_lookup_net_from_pad (PadType *targetPad) |
struct gsvit_netlist * | gsvit_lookup_net_from_pv (PinType *targetPv) |
static void | add_hole (struct single_size_drills *drill, int cx, int cy) |
static int | _drill_size_comparator (const void *_size0, const void *_size1) |
Given a hole size, return the structure that currently holds the data for that hole size. | |
static struct single_size_drills * | get_drill (double diameter_inches, Coord radius) |
static void | gsvit_draw_line (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2) |
static void | gsvit_draw_arc (hidGC gc, Coord cx, Coord cy, Coord width, Coord height, Angle start_angle, Angle delta_angle) |
static void | gsvit_fill_circle (hidGC gc, Coord cx, Coord cy, Coord radius) |
static void | gsvit_fill_polygon (hidGC gc, int n_coords, Coord *x, Coord *y) |
static void | gsvit_calibrate (double xval, double yval) |
static void | gsvit_set_crosshair (int x, int y, int a) |
static void | gsvit_draw_pcb_arc (hidGC gc, ArcType *arc) |
static void | gsvit_draw_pcb_line (hidGC gc, LineType *line) |
void | gsvit_fill_pcb_polygon (hidGC gc, PolygonType *poly, const BoxType *clip_box) |
void | gsvit_fill_pcb_pad (hidGC gc, PadType *pad, bool clear, bool mask) |
void | gsvit_fill_pcb_pv (hidGC fg_gc, hidGC bg_gc, PinType *pv, bool drawHole, bool mask) |
void | hid_gsvit_init () |
Variables | |
static char * | reference_pin_names [] = {"1", "2", "A1", "A2", "B1", "B2", 0} |
static struct single_size_drills * | drills = NULL |
static int | n_drills = 0 |
static int | n_drills_allocated = 0 |
static int | save_drill = 0 |
static int | is_plated = 0 |
struct gsvit_netlist * | gsvit_netlist = NULL |
int | hashColor = gdBrushed |
static struct color_struct * | color_array [0x100] |
static HID | gsvit_hid |
static HID_DRAW | gsvit_graphics |
static struct color_struct * | black = NULL |
static struct color_struct * | white = NULL |
static Coord | linewidth = -1 |
static gdImagePtr | lastbrush = (gdImagePtr)((void *) -1) |
static gdImagePtr | gsvit_im = NULL |
gd image for PNG export. | |
static FILE * | gsvit_f = NULL |
file for PNG export. | |
static int | is_mask |
static int | is_drill |
static int | gsvit_export_group [MAX_GROUP] |
Which groups of layers to export into PNG layer masks. | |
static int | gsvit_cur_group |
Group that is currently exported. | |
static const char * | gsvit_basename = NULL |
Filename prefix that will be used when saving files. | |
static int | gsvit_dpi = -1 |
Horizontal DPI (grid points per inch). | |
HID_Attribute | gsvit_attribute_list [] |
HID exporter for gsvit.
This HID exports a PCB layout into:
PCB, interactive printed circuit board design
Copyright (C) 1994, 1995, 1996, 2004 Thomas Nau
Based on the NELMA (Numerical capacitance calculator) export HID Copyright (C) 2006 Tomaz Solc (tomaz.solc@tablix.org)
PNG export code is based on the PNG export HID Copyright (C) 2006 Dan McMahill
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Contact addresses for paper mail and Email: Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany Thomas.Nau@rz.uni-ulm.de
Definition in file gsvit.c.
#define CRASH fprintf(stderr, "HID error: pcb called unimplemented PNG function %s.\n", __FUNCTION__); abort() |
Definition at line 86 of file gsvit.c.
Referenced by gsvit_calibrate().
#define MAXREFPINS 32 |
Maximum length of following list.
Definition at line 87 of file gsvit.c.
Referenced by gsvit_write_xcentroids(), and PrintBOM().
typedef struct _StringList StringList |
static int _drill_size_comparator | ( | const void * | _size0, |
const void * | _size1 | ||
) | [static] |
Given a hole size, return the structure that currently holds the data for that hole size.
If there isn't one, make it.
Definition at line 1737 of file gsvit.c.
Referenced by get_drill().
static void add_hole | ( | struct single_size_drills * | drill, |
int | cx, | ||
int | cy | ||
) | [static] |
Definition at line 1716 of file gsvit.c.
References cx, drill_hole::cx, cy, drill_hole::cy, single_size_drills::holes, is_plated, drill_hole::is_plated, single_size_drills::n_holes, single_size_drills::n_holes_allocated, and realloc().
Referenced by gsvit_fill_circle().
Definition at line 670 of file gsvit.c.
References _BomList::descr, malloc(), _BomList::next, NSTRCMP, _BomList::num, _BomList::refdes, string_insert(), and _BomList::value.
Referenced by gsvit_write_xcentroids().
static char* CleanXBOMString | ( | char * | in | ) | [static] |
Definition at line 802 of file gsvit.c.
References malloc().
Referenced by gsvit_write_xcentroids().
static struct single_size_drills* get_drill | ( | double | diameter_inches, |
Coord | radius | ||
) | [static, read] |
Definition at line 1750 of file gsvit.c.
References _drill_size_comparator(), single_size_drills::diameter_inches, single_size_drills::holes, n_drills, n_drills_allocated, single_size_drills::n_holes, single_size_drills::n_holes_allocated, single_size_drills::radius, and realloc().
Referenced by gsvit_fill_circle().
static void gsvit_alloc_colors | ( | ) | [static] |
Allocate colors.
White and black, the first color allocated becomes the background color.
Definition at line 1139 of file gsvit.c.
References color_struct::b, color_struct::c, gsvit_netlist::color, gsvit_netlist::colorIndex, color_struct::g, malloc(), LibraryType::MenuN, PCBType::NetlistLib, PCB, color_struct::r, rgb(), and white.
Referenced by gsvit_start_png().
void gsvit_build_net_from_selected | ( | struct gsvit_netlist * | currNet | ) |
Definition at line 351 of file gsvit.c.
References ALLPAD_LOOP, ALLPIN_LOOP, gsvit_net_layer::Arc, COPPERARC_LOOP, COPPERLINE_LOOP, COPPERPOLYGON_LOOP, PCBType::Data, END_LOOP, ENDALL_LOOP, gsvit_netlist::layer, gsvit_net_layer::Line, line, gsvit_netlist::Pad, PCB, gsvit_netlist::Pin, pin, gsvit_net_layer::Polygon, TEST_FLAG, gsvit_netlist::Via, and VIA_LOOP.
Referenced by gsvit_create_netlist().
static void gsvit_calibrate | ( | double | xval, |
double | yval | ||
) | [static] |
void gsvit_choose_groups | ( | ) |
Populates gsvit_export_group array.
Definition at line 1103 of file gsvit.c.
References LayerType::ArcN, PCBType::Data, GetLayerGroupNumberByNumber(), DataType::Layer, layer, LayerType::LineN, m, max_copper_layer, n, PCB, LayerType::PolygonN, SL_TYPE, and LayerType::TextN.
Referenced by gsvit_do_export().
void gsvit_create_netlist | ( | void | ) |
Definition at line 410 of file gsvit.c.
References color_struct::b, ClearFlagOnAllObjects(), gsvit_netlist::color, LibraryMenuType::Entry, LibraryMenuType::EntryN, FreeConnectionLookupMemory(), color_struct::g, gsvit_build_net_from_selected(), InitConnectionLookup(), malloc(), LibraryType::Menu, LibraryType::MenuN, LibraryMenuType::Name, gsvit_netlist::name, PCBType::NetlistLib, PCB, ConnectionType::ptr1, ConnectionType::ptr2, color_struct::r, RatFindHook(), rgb(), SeekPad(), and ConnectionType::type.
Referenced by gsvit_do_export().
static void gsvit_destroy_gc | ( | hidGC | gc | ) | [static] |
Definition at line 1395 of file gsvit.c.
Referenced by hid_gsvit_init().
void gsvit_destroy_netlist | ( | void | ) |
Definition at line 480 of file gsvit.c.
References gsvit_net_layer::Arc, gsvit_netlist::layer, gsvit_net_layer::Line, LibraryType::MenuN, PCBType::NetlistLib, gsvit_netlist::Pad, PCB, gsvit_netlist::Pin, gsvit_net_layer::Polygon, and gsvit_netlist::Via.
Referenced by gsvit_do_export().
static void gsvit_do_export | ( | HID_Attr_Val * | options | ) | [static] |
Definition at line 1235 of file gsvit.c.
References BOTTOM_SIDE, HID_Attribute::default_val, LayerGroupType::Entries, FNS_fixed, GetLayerGroupNumberByNumber(), GetLayerGroupNumberBySide(), gsvit_choose_groups(), gsvit_create_netlist(), gsvit_destroy_netlist(), gsvit_finish_png(), gsvit_get_export_options(), gsvit_start_png(), gsvit_start_png_export(), gsvit_xml_out(), hid_restore_layer_ons(), hid_save_and_show_layer_ons(), HID_Attr_Val::int_value, layer_type_to_file_name(), PCBType::LayerGroups, len, malloc(), MAX_ALL_LAYER, max_group, PCB, save_drill, and HID_Attr_Val::str_value.
Referenced by hid_gsvit_init().
static void gsvit_draw_arc | ( | hidGC | gc, |
Coord | cx, | ||
Coord | cy, | ||
Coord | width, | ||
Coord | height, | ||
Angle | start_angle, | ||
Angle | delta_angle | ||
) | [static] |
Definition at line 1813 of file gsvit.c.
References color_struct::c, hid_gc_struct::color, im, linewidth, NormalizeAngle(), pcb_to_gsvit(), SCALE, SCALE_X, SCALE_Y, start_angle, and use_gc().
Referenced by hid_gsvit_init().
Definition at line 1793 of file gsvit.c.
References gsvit_fill_rect(), linewidth, pcb_to_gsvit(), use_gc(), and hid_gc_struct::width.
Referenced by hid_gsvit_init().
Definition at line 1918 of file gsvit.c.
References gsvit_netlist::colorIndex, common_draw_pcb_arc(), gsvit_lookup_net_from_arc(), hashColor, LibraryType::MenuN, PCBType::NetlistLib, and PCB.
Referenced by hid_gsvit_init().
Definition at line 1937 of file gsvit.c.
References gsvit_netlist::colorIndex, common_draw_pcb_line(), gsvit_lookup_net_from_line(), hashColor, LibraryType::MenuN, PCBType::NetlistLib, and PCB.
Referenced by hid_gsvit_init().
Definition at line 1561 of file gsvit.c.
References color_struct::c, hid_gc_struct::color, pcb_to_gsvit(), and use_gc().
Referenced by hid_gsvit_init().
Definition at line 1853 of file gsvit.c.
References add_hole(), c, COORD_TO_INCH, single_size_drills::diameter_inches, get_drill(), hashColor, linewidth, pcb_to_gsvit(), save_drill, and use_gc().
Referenced by hid_gsvit_init().
Definition at line 1979 of file gsvit.c.
References gsvit_netlist::colorIndex, common_fill_pcb_pad(), gsvit_lookup_net_from_pad(), hashColor, LibraryType::MenuN, PCBType::NetlistLib, and PCB.
Referenced by hid_gsvit_init().
void gsvit_fill_pcb_polygon | ( | hidGC | gc, |
PolygonType * | poly, | ||
const BoxType * | clip_box | ||
) |
Definition at line 1957 of file gsvit.c.
References gsvit_netlist::colorIndex, common_fill_pcb_polygon(), gsvit_lookup_net_from_polygon(), hashColor, LibraryType::MenuN, PCBType::NetlistLib, and PCB.
Referenced by hid_gsvit_init().
Definition at line 1998 of file gsvit.c.
References gsvit_netlist::colorIndex, common_fill_pcb_pv(), gsvit_lookup_net_from_pv(), hashColor, LibraryType::MenuN, PCBType::NetlistLib, and PCB.
Referenced by hid_gsvit_init().
Definition at line 1876 of file gsvit.c.
References c, hashColor, linewidth, malloc(), pcb_to_gsvit(), and use_gc().
Referenced by hid_gsvit_init().
Definition at line 1571 of file gsvit.c.
References color_struct::c, hid_gc_struct::color, linewidth, pcb_to_gsvit(), and use_gc().
Referenced by gsvit_draw_line(), and hid_gsvit_init().
static void gsvit_finish_png | ( | ) | [static] |
Definition at line 1197 of file gsvit.c.
References Message().
Referenced by gsvit_do_export().
static HID_Attribute* gsvit_get_export_options | ( | int * | n | ) | [static] |
Definition at line 785 of file gsvit.c.
References derive_default_filename(), PCBType::Filename, gsvit_attribute_list, and PCB.
Referenced by gsvit_do_export(), and hid_gsvit_init().
static char* gsvit_get_png_name | ( | const char * | basename, |
const char * | suffix | ||
) | [static] |
Definition at line 512 of file gsvit.c.
Referenced by gsvit_start_png(), and gsvit_write_xspace().
struct gsvit_netlist* gsvit_lookup_net_from_arc | ( | ArcType * | targetArc | ) | [read] |
Definition at line 1583 of file gsvit.c.
References ARC_LOOP, END_LOOP, LayerGroupType::Entries, gsvit_cur_group, gsvit_netlist::layer, layer, PCBType::LayerGroups, LibraryType::MenuN, PCBType::NetlistLib, LayerGroupType::Number, and PCB.
Referenced by gsvit_draw_pcb_arc().
struct gsvit_netlist* gsvit_lookup_net_from_line | ( | LineType * | targetLine | ) | [read] |
Definition at line 1610 of file gsvit.c.
References END_LOOP, LayerGroupType::Entries, gsvit_cur_group, gsvit_netlist::layer, layer, PCBType::LayerGroups, line, LINE_LOOP, LibraryType::MenuN, PCBType::NetlistLib, LayerGroupType::Number, and PCB.
Referenced by gsvit_draw_pcb_line().
struct gsvit_netlist* gsvit_lookup_net_from_pad | ( | PadType * | targetPad | ) | [read] |
Definition at line 1666 of file gsvit.c.
References END_LOOP, LibraryType::MenuN, PCBType::NetlistLib, PAD_LOOP, and PCB.
Referenced by gsvit_fill_pcb_pad().
struct gsvit_netlist* gsvit_lookup_net_from_polygon | ( | PolygonType * | targetPolygon | ) | [read] |
Definition at line 1638 of file gsvit.c.
References END_LOOP, LayerGroupType::Entries, gsvit_cur_group, gsvit_netlist::layer, layer, PCBType::LayerGroups, LibraryType::MenuN, PCBType::NetlistLib, LayerGroupType::Number, PCB, and POLYGON_LOOP.
Referenced by gsvit_fill_pcb_polygon().
struct gsvit_netlist* gsvit_lookup_net_from_pv | ( | PinType * | targetPv | ) | [read] |
Definition at line 1688 of file gsvit.c.
References END_LOOP, LibraryType::MenuN, PCBType::NetlistLib, PCB, pin, PIN_LOOP, and VIA_LOOP.
Referenced by gsvit_fill_pcb_pv().
static hidGC gsvit_make_gc | ( | void | ) | [static] |
Definition at line 1381 of file gsvit.c.
References color_struct::b, color_struct::c, hid_gc_struct::cap, hid_gc_struct::color, color_struct::g, gsvit_hid, malloc(), hid_gc_struct::me_pointer, color_struct::r, Trace_Cap, and hid_gc_struct::width.
Referenced by hid_gsvit_init().
static void gsvit_parse_arguments | ( | int * | argc, |
char *** | argv | ||
) | [static] |
Main export callback.
Definition at line 775 of file gsvit.c.
References hid_parse_command_line(), and hid_register_attributes().
Referenced by hid_gsvit_init().
static void gsvit_set_color | ( | hidGC | gc, |
const char * | name | ||
) | [static] |
Definition at line 1409 of file gsvit.c.
References black, hid_gc_struct::color, hid_gc_struct::erase, and white.
Referenced by hid_gsvit_init().
static void gsvit_set_crosshair | ( | int | x, |
int | y, | ||
int | a | ||
) | [static] |
Definition at line 1911 of file gsvit.c.
Referenced by hid_gsvit_init().
static void gsvit_set_draw_faded | ( | hidGC | gc, |
int | faded | ||
) | [static] |
Definition at line 1460 of file gsvit.c.
Referenced by hid_gsvit_init().
static void gsvit_set_draw_xor | ( | hidGC | gc, |
int | xor_ | ||
) | [static] |
Definition at line 1453 of file gsvit.c.
Referenced by hid_gsvit_init().
static int gsvit_set_layer | ( | const char * | name, |
int | group, | ||
int | empty | ||
) | [static] |
Definition at line 1342 of file gsvit.c.
References PCBType::Data, LayerGroupType::Entries, is_plated, DataType::Layer, PCBType::LayerGroups, max_group, LayerType::Name, PCB, SL_MASK, SL_PDRILL, SL_TYPE, and SL_UDRILL.
Referenced by hid_gsvit_init().
static void gsvit_set_line_cap | ( | hidGC | gc, |
EndCapStyle | style | ||
) | [static] |
Definition at line 1439 of file gsvit.c.
References hid_gc_struct::cap, and style.
Referenced by hid_gsvit_init().
Definition at line 1446 of file gsvit.c.
References hid_gc_struct::width.
Referenced by hid_gsvit_init().
static void gsvit_start_png | ( | const char * | basename, |
const char * | suffix | ||
) | [static] |
Definition at line 1176 of file gsvit.c.
References gsvit_alloc_colors(), gsvit_get_png_name(), PCBType::MaxHeight, PCBType::MaxWidth, PCB, and pcb_to_gsvit().
Referenced by gsvit_do_export().
void gsvit_start_png_export | ( | ) |
Definition at line 1218 of file gsvit.c.
References hid_expose_callback(), lastbrush, linewidth, PCBType::MaxHeight, PCBType::MaxWidth, PCB, region, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Referenced by gsvit_do_export().
static void gsvit_use_mask | ( | enum mask_mode | mode | ) | [static] |
Definition at line 1402 of file gsvit.c.
Referenced by hid_gsvit_init().
static void gsvit_write_xcentroids | ( | void | ) | [static] |
Definition at line 895 of file gsvit.c.
References AttributeGetFromList(), bom_insert(), CleanXBOMString(), PCBType::Data, DESCRIPTION_NAME, ELEMENT_LOOP, END_LOOP, FRONT, M_PI, PCBType::MaxHeight, MAXREFPINS, Message(), gsvit_netlist::name, NAMEONPCB_NAME, NSTRCMP, pin_st::Number, PAD_LOOP, PCB, pcb_snprintf(), pcb_to_gsvit(), pin, PIN_LOOP, reference_pin_names, UNKNOWN, VALUE_NAME, pin_st::X, x, XOUT_DETENT, XOUT_ELEMENT, XOUT_ELEMENT_ATTR_START, XOUT_ELEMENT_END, XOUT_ELEMENT_START, XOUT_INDENT, XOUT_NEWLINE, xyToAngle(), pin_st::Y, and y.
Referenced by gsvit_xml_out().
static void gsvit_write_xdrills | ( | void | ) | [static] |
Definition at line 843 of file gsvit.c.
References cx, cy, is_plated, n_drills, single_size_drills::n_holes, pcb_to_gsvit(), XOUT_DETENT, XOUT_ELEMENT, XOUT_ELEMENT_ATTR_START, XOUT_ELEMENT_DATA, XOUT_ELEMENT_END, XOUT_ELEMENT_START, XOUT_INDENT, and XOUT_NEWLINE.
Referenced by gsvit_xml_out().
static void gsvit_write_xnets | ( | void | ) | [static] |
Definition at line 578 of file gsvit.c.
References LayerGroupType::Entries, LibraryMenuType::Entry, LibraryMenuType::EntryN, FNS_fixed, layer_type_to_file_name(), PCBType::LayerGroups, LibraryEntryType::ListEntry, m, max_group, LibraryType::Menu, LibraryType::MenuN, n, LibraryMenuType::Name, PCBType::NetlistLib, PCB, pin, XOUT_DETENT, XOUT_ELEMENT, XOUT_ELEMENT_ATTR_START, XOUT_ELEMENT_DATA, XOUT_ELEMENT_END, XOUT_ELEMENT_START, XOUT_INDENT, and XOUT_NEWLINE.
Referenced by gsvit_xml_out().
static void gsvit_write_xspace | ( | void | ) | [static] |
Definition at line 527 of file gsvit.c.
References LayerGroupType::Entries, FNS_fixed, gsvit_dpi, gsvit_get_png_name(), layer_type_to_file_name(), PCBType::LayerGroups, max_group, PCBType::MaxHeight, PCBType::MaxWidth, PCB, pcb_to_gsvit(), XOUT_DETENT, XOUT_ELEMENT, XOUT_ELEMENT_ATTR, XOUT_ELEMENT_END, XOUT_ELEMENT_START, XOUT_INDENT, and XOUT_NEWLINE.
Referenced by gsvit_xml_out().
void gsvit_xml_out | ( | char * | gsvit_basename | ) |
Definition at line 1293 of file gsvit.c.
References gsvit_write_xcentroids(), gsvit_write_xdrills(), gsvit_write_xnets(), gsvit_write_xspace(), len, malloc(), XOUT_CLOSE, XOUT_ELEMENT, XOUT_ELEMENT_END, XOUT_ELEMENT_START, XOUT_HEADER, XOUT_INDENT, XOUT_INIT, and XOUT_NEWLINE.
Referenced by gsvit_do_export().
void hid_gsvit_init | ( | ) |
Definition at line 2020 of file gsvit.c.
References hid_st::calibrate, common_draw_helpers_init(), common_nogui_init(), hid_st::description, hid_draw_st::destroy_gc, hid_st::do_export, hid_draw_st::draw_arc, hid_draw_st::draw_line, hid_draw_st::draw_pcb_arc, hid_draw_st::draw_pcb_line, hid_draw_st::draw_pcb_polygon, hid_draw_st::draw_rect, hid_st::exporter, hid_draw_st::fill_circle, hid_draw_st::fill_pcb_pad, hid_draw_st::fill_pcb_polygon, hid_draw_st::fill_pcb_pv, hid_draw_st::fill_polygon, hid_draw_st::fill_rect, hid_st::get_export_options, hid_st::graphics, gsvit_calibrate(), gsvit_destroy_gc(), gsvit_do_export(), gsvit_draw_arc(), gsvit_draw_line(), gsvit_draw_pcb_arc(), gsvit_draw_pcb_line(), gsvit_draw_rect(), gsvit_fill_circle(), gsvit_fill_pcb_pad(), gsvit_fill_pcb_polygon(), gsvit_fill_pcb_pv(), gsvit_fill_polygon(), gsvit_fill_rect(), gsvit_get_export_options(), gsvit_graphics, gsvit_make_gc(), gsvit_parse_arguments(), gsvit_set_color(), gsvit_set_crosshair(), gsvit_set_draw_faded(), gsvit_set_draw_xor(), gsvit_set_layer(), gsvit_set_line_cap(), gsvit_set_line_width(), gsvit_use_mask(), hid_register_hid(), hid_draw_st::make_gc, hid_st::name, hid_st::parse_arguments, hid_st::poly_before, hid_draw_st::set_color, hid_st::set_crosshair, hid_draw_st::set_draw_faded, hid_draw_st::set_draw_xor, hid_st::set_layer, hid_draw_st::set_line_cap, hid_draw_st::set_line_width, hid_st::struct_size, and hid_draw_st::use_mask.
static int pcb_to_gsvit | ( | Coord | pcb | ) | [static] |
Convert from default PCB units to gsvit units.
Definition at line 505 of file gsvit.c.
References COORD_TO_INCH, and gsvit_dpi.
Referenced by gsvit_draw_arc(), gsvit_draw_line(), gsvit_draw_rect(), gsvit_fill_circle(), gsvit_fill_polygon(), gsvit_fill_rect(), gsvit_start_png(), gsvit_write_xcentroids(), gsvit_write_xdrills(), gsvit_write_xspace(), and use_gc().
REGISTER_ATTRIBUTES | ( | gsvit_attribute_list | ) |
static StringList* string_insert | ( | char * | str, |
StringList * | list | ||
) | [static] |
Definition at line 643 of file gsvit.c.
References malloc(), _StringList::next, and _StringList::str.
Referenced by bom_insert().
static void use_gc | ( | hidGC | gc | ) | [static] |
Definition at line 1467 of file gsvit.c.
References color_struct::b, hid_gc_struct::brush, hid_gc_struct::cap, hid_gc_struct::color, color_struct::g, hashColor, hid_cache_color(), lastbrush, linewidth, hid_gc_struct::me_pointer, pcb_to_gsvit(), hidval::ptr, color_struct::r, Round_Cap, Square_Cap, Trace_Cap, and hid_gc_struct::width.
Referenced by gsvit_draw_arc(), gsvit_draw_line(), gsvit_draw_rect(), gsvit_fill_circle(), gsvit_fill_polygon(), and gsvit_fill_rect().
static double xyToAngle | ( | double | x, |
double | y, | ||
bool | morethan2pins | ||
) | [static] |
struct color_struct* black = NULL [static] |
Definition at line 182 of file gsvit.c.
Referenced by gsvit_set_color().
struct color_struct* color_array[0x100] [static] |
struct single_size_drills* drills = NULL [static] |
{ {"basename", "File name prefix", HID_String, 0, 0, {0, 0, 0}, 0, 0}, #define HA_basename 0 {"dpi", "Horizontal scale factor (grid points/inch)", HID_Integer, 0, 1000, {1000, 0, 0}, 0, 0}, #define HA_dpi 1 }
Definition at line 224 of file gsvit.c.
Referenced by gsvit_get_export_options().
const char* gsvit_basename = NULL [static] |
int gsvit_cur_group [static] |
Group that is currently exported.
Definition at line 212 of file gsvit.c.
Referenced by gsvit_lookup_net_from_arc(), gsvit_lookup_net_from_line(), and gsvit_lookup_net_from_polygon().
int gsvit_dpi = -1 [static] |
Horizontal DPI (grid points per inch).
Definition at line 222 of file gsvit.c.
Referenced by gsvit_write_xspace(), and pcb_to_gsvit().
int gsvit_export_group[MAX_GROUP] [static] |
HID_DRAW gsvit_graphics [static] |
Definition at line 180 of file gsvit.c.
Referenced by hid_gsvit_init().
Definition at line 178 of file gsvit.c.
Referenced by gsvit_make_gc().
gdImagePtr gsvit_im = NULL [static] |
struct gsvit_netlist* gsvit_netlist = NULL |
int hashColor = gdBrushed |
Definition at line 174 of file gsvit.c.
Referenced by gsvit_draw_pcb_arc(), gsvit_draw_pcb_line(), gsvit_fill_circle(), gsvit_fill_pcb_pad(), gsvit_fill_pcb_polygon(), gsvit_fill_pcb_pv(), gsvit_fill_polygon(), and use_gc().
int is_plated = 0 [static] |
Definition at line 170 of file gsvit.c.
Referenced by add_hole(), gsvit_set_layer(), and gsvit_write_xdrills().
gdImagePtr lastbrush = (gdImagePtr)((void *) -1) [static] |
Definition at line 186 of file gsvit.c.
Referenced by gsvit_start_png_export(), and use_gc().
Definition at line 184 of file gsvit.c.
Referenced by gsvit_draw_arc(), gsvit_draw_line(), gsvit_fill_circle(), gsvit_fill_polygon(), gsvit_fill_rect(), gsvit_start_png_export(), and use_gc().
int n_drills = 0 [static] |
At the start we have no drills at all
Definition at line 164 of file gsvit.c.
Referenced by get_drill(), and gsvit_write_xdrills().
int n_drills_allocated = 0 [static] |
Definition at line 166 of file gsvit.c.
Referenced by get_drill().
char* reference_pin_names[] = {"1", "2", "A1", "A2", "B1", "B2", 0} [static] |
Definition at line 88 of file gsvit.c.
Referenced by gsvit_write_xcentroids().
int save_drill = 0 [static] |
Definition at line 168 of file gsvit.c.
Referenced by gsvit_do_export(), and gsvit_fill_circle().
struct color_struct * white = NULL |