1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-12-23 16:25:10 +02:00

sch2fig/: make *_line accept color and layer from dwg

This commit is contained in:
Werner Almesberger 2016-07-30 21:55:23 -03:00
parent 4267efae0d
commit 3b18e8b604
6 changed files with 24 additions and 7 deletions

View File

@ -385,6 +385,19 @@ void dwg_noconn(int x, int y)
}
/* ----- Lines ------------------------------------------------------------- */
/*
* We can't use gfx_poly because lines are dashed and we don't have that
* property at the gfx_poly API.
*/
void dwg_line(int sx, int sy, int ex, int ey)
{
gfx_line(sx, sy, ex, ey, COLOR_SHEET_DWG, LAYER_LINES);
}
/* ----- Wires and busses -------------------------------------------------- */

View File

@ -36,6 +36,8 @@ void dwg_glabel(int x, int y, const char *s, int dir, int dim,
void dwg_junction(int x, int y);
void dwg_noconn(int x, int y);
void dwg_line(int sx, int sy, int ex, int ey);
void dwg_wire(int sx, int sy, int ex, int ey);
void dwg_bus(int sx, int sy, int ex, int ey);

View File

@ -51,13 +51,14 @@ static inline float pt(int x)
/* ----- Schematics items -------------------------------------------------- */
void fig_line(void *ctx, int sx, int sy, int ex, int ey)
void fig_line(void *ctx, int sx, int sy, int ex, int ey,
int color, unsigned layer)
{
// TypeStyle FillCol AreaFil Cap FwdAr
// SubTy Color Pen StyleV Rad BwdAr
// Thick Depth Join Points
printf("2 1 2 %d %d 7 %d -1 -1 3.0 1 1 -1 0 0 2\n",
WIDTH_LINE, COLOR_SHEET_DWG, LAYER_LINES);
WIDTH_LINE, color, layer);
printf("\t%d %d %d %d\n", cx(sx), cy(sy), cx(ex), cy(ey));
}

View File

@ -19,9 +19,9 @@ static const struct gfx_ops *gfx_ops;
static void *gfx_ctx;
void gfx_line(int sx, int sy, int ex, int ey)
void gfx_line(int sx, int sy, int ex, int ey, int color, unsigned layer)
{
gfx_ops->line(gfx_ctx, sx, sy, ex, ey);
gfx_ops->line(gfx_ctx, sx, sy, ex, ey, color, layer);
}

View File

@ -18,7 +18,8 @@
struct gfx_ops {
void (*line)(void *ctx, int sx, int sy, int ex, int ey);
void (*line)(void *ctx, int sx, int sy, int ex, int ey,
int color, unsigned layer);
void (*rect)(void *ctx, int sx, int sy, int ex, int ey,
int color, int fill_color, unsigned layer);
void (*poly)(void *ctx, int points, int x[points], int y[points],
@ -35,7 +36,7 @@ struct gfx_ops {
/* wrappers */
void gfx_line(int sx, int sy, int ex, int ey);
void gfx_line(int sx, int sy, int ex, int ey, int color, unsigned layer);
void gfx_rect(int sx, int sy, int ex, int ey,
int color, int fill_color, unsigned layer);
void gfx_poly(int points, int x[points], int y[points],

View File

@ -479,7 +479,7 @@ bool sch_parse(struct sch_ctx *ctx, const char *line)
}
if (sscanf(line, "Wire Notes Line%n", &n) == 0 && n) {
ctx->state = sch_wire;
ctx->wire = gfx_line;
ctx->wire = dwg_line;
return 1;
}