pcb 4.1.1
An interactive printed circuit board layout editor.
|
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "global.h"
#include "data.h"
#include "misc.h"
#include "pcb-printf.h"
#include "hid.h"
#include "hid_draw.h"
#include "../hidint.h"
#include "hid/common/hidnogui.h"
#include "hid/common/draw_helpers.h"
#include "../ps/ps.h"
#include "hid/common/hidinit.h"
Go to the source code of this file.
Data Structures | |
struct | hid_gc_struct |
Defines | |
#define | CRASH fprintf(stderr, "HID error: pcb called unimplemented EPS function %s.\n", __FUNCTION__); abort() |
Typedefs | |
typedef struct hid_gc_struct | hid_gc_struct |
Functions | |
static HID_Attribute * | eps_get_export_options (int *n) |
static void | eps_do_export (HID_Attr_Val *options) |
static void | eps_parse_arguments (int *argc, char ***argv) |
static int | eps_set_layer (const char *name, int group, int empty) |
static hidGC | eps_make_gc (void) |
static void | eps_destroy_gc (hidGC gc) |
static void | eps_use_mask (enum mask_mode mode) |
static void | eps_set_color (hidGC gc, const char *name) |
static void | eps_set_line_cap (hidGC gc, EndCapStyle style) |
static void | eps_set_line_width (hidGC gc, Coord width) |
static void | eps_set_draw_xor (hidGC gc, int _xor) |
static void | eps_draw_rect (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2) |
static void | eps_draw_line (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2) |
static void | eps_draw_arc (hidGC gc, Coord cx, Coord cy, Coord width, Coord height, Angle start_angle, Angle delta_angle) |
static void | eps_fill_rect (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2) |
static void | eps_fill_circle (hidGC gc, Coord cx, Coord cy, Coord radius) |
static void | eps_fill_polygon (hidGC gc, int n_coords, Coord *x, Coord *y) |
static void | eps_calibrate (double xval, double yval) |
static void | eps_set_crosshair (int x, int y, int action) |
REGISTER_ATTRIBUTES (eps_attribute_list) | |
static int | layer_stack_sort (const void *va, const void *vb) |
void | eps_hid_export_to_file (FILE *the_file, HID_Attr_Val *options) |
static void | use_gc (hidGC gc) |
void | hid_eps_init () |
Variables | |
static HID | eps_hid |
static HID_DRAW | eps_graphics |
static FILE * | f = 0 |
static Coord | linewidth = -1 |
static int | lastcap = -1 |
static int | lastcolor = -1 |
static int | print_group [MAX_GROUP] |
static int | print_layer [MAX_ALL_LAYER] |
static int | fast_erase = -1 |
static HID_Attribute | eps_attribute_list [] |
static int | top_group |
static int | bottom_group |
static const char * | filename |
static BoxType * | bounds |
static int | in_mono |
static int | as_shown |
static int | is_mask |
static int | is_paste |
static int | is_drill |
#define CRASH fprintf(stderr, "HID error: pcb called unimplemented EPS function %s.\n", __FUNCTION__); abort() |
Definition at line 28 of file eps.c.
Referenced by eps_calibrate().
typedef struct hid_gc_struct hid_gc_struct |
static void eps_calibrate | ( | double | xval, |
double | yval | ||
) | [static] |
static void eps_destroy_gc | ( | hidGC | gc | ) | [static] |
Definition at line 430 of file eps.c.
Referenced by hid_eps_init().
static void eps_do_export | ( | HID_Attr_Val * | options | ) | [static] |
Definition at line 317 of file eps.c.
References eps_get_export_options(), eps_hid_export_to_file(), f, filename, hid_restore_layer_ons(), hid_save_and_show_layer_ons(), MAX_ALL_LAYER, and HID_Attr_Val::str_value.
Referenced by hid_eps_init().
static void eps_draw_arc | ( | hidGC | gc, |
Coord | cx, | ||
Coord | cy, | ||
Coord | width, | ||
Coord | height, | ||
Angle | start_angle, | ||
Angle | delta_angle | ||
) | [static] |
Definition at line 594 of file eps.c.
References f, linewidth, pcb_fprintf(), start_angle, and use_gc().
Referenced by hid_eps_init().
Definition at line 562 of file eps.c.
References hid_gc_struct::cap, eps_fill_circle(), eps_fill_rect(), hid_gc_struct::erase, f, M_PI, pcb_fprintf(), Square_Cap, use_gc(), and hid_gc_struct::width.
Referenced by hid_eps_init().
Definition at line 555 of file eps.c.
References f, pcb_fprintf(), and use_gc().
Referenced by hid_eps_init().
Definition at line 618 of file eps.c.
References hid_gc_struct::erase, f, pcb_fprintf(), and use_gc().
Referenced by eps_draw_line(), and hid_eps_init().
Definition at line 625 of file eps.c.
References f, pcb_fprintf(), and use_gc().
Referenced by hid_eps_init().
Definition at line 639 of file eps.c.
References f, pcb_fprintf(), and use_gc().
Referenced by eps_draw_line(), and hid_eps_init().
static HID_Attribute* eps_get_export_options | ( | int * | n | ) | [static] |
Referenced by eps_do_export(), and hid_eps_init().
void eps_hid_export_to_file | ( | FILE * | the_file, |
HID_Attr_Val * | options | ||
) |
Definition at line 178 of file eps.c.
References LayerType::ArcN, as_shown, bottom_group, BOTTOM_SIDE, CLEAR_FLAG, PCBType::Data, f, fast_erase, filename, PCBType::Flags, GetDataBoundingBox(), GetLayerGroupNumberByNumber(), GetLayerGroupNumberBySide(), hid_expose_callback(), in_mono, HID_Attr_Val::int_value, lastcap, lastcolor, DataType::Layer, layer, layer_stack_sort(), LayerStack, LayerType::LineN, linewidth, max_copper_layer, max_group, PCBType::MaxHeight, PCBType::MaxWidth, LayerType::On, PCB, pcb_fprintf(), hid_st::poly_after, hid_st::poly_before, LayerType::PolygonN, print_group, print_layer, region, Settings, SettingType::ShowBottomSide, LayerType::TextN, top_group, TOP_SIDE, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Referenced by eps_do_export().
static hidGC eps_make_gc | ( | void | ) | [static] |
Definition at line 420 of file eps.c.
References hid_gc_struct::cap, hid_gc_struct::color, malloc(), Trace_Cap, and hid_gc_struct::width.
Referenced by hid_eps_init().
static void eps_parse_arguments | ( | int * | argc, |
char *** | argv | ||
) | [static] |
Definition at line 351 of file eps.c.
References hid_parse_command_line(), and hid_register_attributes().
Referenced by hid_eps_init().
static void eps_set_color | ( | hidGC | gc, |
const char * | name | ||
) | [static] |
Definition at line 463 of file eps.c.
References hid_gc_struct::color, hid_gc_struct::erase, fast_erase, hid_cache_color(), in_mono, and hidval::lval.
Referenced by hid_eps_init().
static void eps_set_crosshair | ( | int | x, |
int | y, | ||
int | action | ||
) | [static] |
Definition at line 652 of file eps.c.
Referenced by hid_eps_init().
static void eps_set_draw_xor | ( | hidGC | gc, |
int | _xor | ||
) | [static] |
Definition at line 512 of file eps.c.
Referenced by hid_eps_init().
static int eps_set_layer | ( | const char * | name, |
int | group, | ||
int | empty | ||
) | [static] |
Definition at line 364 of file eps.c.
References as_shown, PCBType::Data, PCBType::ElementOn, LayerGroupType::Entries, f, is_drill, is_mask, is_paste, DataType::Layer, PCBType::LayerGroups, max_copper_layer, max_group, LayerType::Name, PCB, print_layer, SL, SL_ASSY, SL_FAB, SL_MASK, SL_MYSIDE, SL_PASTE, SL_PDRILL, SL_TYPE, and SL_UDRILL.
Referenced by hid_eps_init().
static void eps_set_line_cap | ( | hidGC | gc, |
EndCapStyle | style | ||
) | [static] |
Definition at line 500 of file eps.c.
References hid_gc_struct::cap, and style.
Referenced by hid_eps_init().
Definition at line 506 of file eps.c.
References hid_gc_struct::width.
Referenced by hid_eps_init().
static void eps_use_mask | ( | enum mask_mode | mode | ) | [static] |
Definition at line 436 of file eps.c.
References f, HID_MASK_AFTER, HID_MASK_BEFORE, HID_MASK_CLEAR, HID_MASK_OFF, and lastcolor.
Referenced by hid_eps_init().
void hid_eps_init | ( | ) |
Definition at line 657 of file eps.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_rect, eps_calibrate(), eps_destroy_gc(), eps_do_export(), eps_draw_arc(), eps_draw_line(), eps_draw_rect(), eps_fill_circle(), eps_fill_polygon(), eps_fill_rect(), eps_get_export_options(), eps_graphics, eps_make_gc(), eps_parse_arguments(), eps_set_color(), eps_set_crosshair(), eps_set_draw_xor(), eps_set_layer(), eps_set_line_cap(), eps_set_line_width(), eps_use_mask(), hid_st::exporter, hid_draw_st::fill_circle, hid_draw_st::fill_polygon, hid_draw_st::fill_rect, hid_st::get_export_options, hid_st::graphics, hid_register_hid(), hid_draw_st::make_gc, hid_st::name, hid_st::parse_arguments, hid_st::poly_after, hid_draw_st::set_color, hid_st::set_crosshair, 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.
Referenced by hid_ps_init().
static int layer_stack_sort | ( | const void * | va, |
const void * | vb | ||
) | [static] |
Definition at line 155 of file eps.c.
References bottom_group, GetLayerGroupNumberByNumber(), and top_group.
Referenced by eps_hid_export_to_file().
REGISTER_ATTRIBUTES | ( | eps_attribute_list | ) |
Definition at line 136 of file eps.c.
References derive_default_filename(), eps_attribute_list, PCBType::Filename, and PCB.
static void use_gc | ( | hidGC | gc | ) | [static] |
Definition at line 518 of file eps.c.
References c, hid_gc_struct::cap, hid_gc_struct::color, f, lastcap, lastcolor, linewidth, pcb_fprintf(), Round_Cap, Square_Cap, Trace_Cap, and hid_gc_struct::width.
Referenced by eps_draw_arc(), eps_draw_line(), eps_draw_rect(), eps_fill_circle(), eps_fill_polygon(), and eps_fill_rect().
int bottom_group |
HID_Attribute eps_attribute_list[] [static] |
{ {"eps-file", "Encapsulated Postscript output file", HID_String, 0, 0, {0, 0, 0}, 0, 0}, #define HA_psfile 0 {"eps-scale", "EPS scale", HID_Real, 0, 100, {0, 0, 1.0}, 0, 0}, #define HA_scale 1 {"screen-layer-order", "Export layers in the order shown on screen", HID_Boolean, 0, 0, {0, 0, 0}, 0, 0}, #define HA_as_shown 2 {"monochrome", "Convert to monochrome", HID_Boolean, 0, 0, {0, 0, 0}, 0, 0}, #define HA_mono 3 {"only-visible", "Limit the bounds of the EPS file to the visible items", HID_Boolean, 0, 0, {0, 0, 0}, 0, 0}, #define HA_only_visible 4 }
Definition at line 73 of file eps.c.
Referenced by REGISTER_ATTRIBUTES().
HID_DRAW eps_graphics [static] |
Definition at line 63 of file eps.c.
Referenced by hid_eps_init().
FILE* f = 0 [static] |
Definition at line 65 of file eps.c.
Referenced by eps_do_export(), eps_draw_arc(), eps_draw_line(), eps_draw_rect(), eps_fill_circle(), eps_fill_polygon(), eps_fill_rect(), eps_hid_export_to_file(), eps_set_layer(), eps_use_mask(), and use_gc().
int fast_erase = -1 [static] |
Definition at line 71 of file eps.c.
Referenced by eps_hid_export_to_file(), and eps_set_color().
const char* filename [static] |
Definition at line 173 of file eps.c.
Referenced by eps_do_export(), and eps_hid_export_to_file().
int in_mono [static] |
Definition at line 175 of file eps.c.
Referenced by eps_hid_export_to_file(), and eps_set_color().
int is_drill [static] |
Definition at line 361 of file eps.c.
Referenced by eps_set_layer().
int is_mask [static] |
Definition at line 359 of file eps.c.
Referenced by eps_set_layer().
int is_paste [static] |
Definition at line 360 of file eps.c.
Referenced by eps_set_layer(), ps_draw_line(), ps_fill_rect(), and REGISTER_ATTRIBUTES().
int lastcap = -1 [static] |
Definition at line 67 of file eps.c.
Referenced by eps_hid_export_to_file(), and use_gc().
int lastcolor = -1 [static] |
Definition at line 68 of file eps.c.
Referenced by eps_hid_export_to_file(), eps_use_mask(), lesstif_set_color(), and use_gc().
Definition at line 66 of file eps.c.
Referenced by eps_draw_arc(), eps_hid_export_to_file(), and use_gc().
int print_group[MAX_GROUP] [static] |
Definition at line 69 of file eps.c.
Referenced by eps_hid_export_to_file().
int print_layer[MAX_ALL_LAYER] [static] |
Definition at line 70 of file eps.c.
Referenced by eps_hid_export_to_file(), and eps_set_layer().
int top_group [static] |
Definition at line 152 of file eps.c.
Referenced by eps_hid_export_to_file(), and layer_stack_sort().