summaryrefslogtreecommitdiff
path: root/kicad/dwg.h
blob: 16242b74249d3907236c1af0b6e1baf2d192f9e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * kicad/dwg.h - Complex drawing functions for KiCad items
 *
 * Written 2016 by Werner Almesberger
 * Copyright 2016 by Werner Almesberger
 *
 * 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.
 */


#ifndef KICAD_DWG_H
#define	KICAD_DWG_H

#include "gfx/gfx.h"
#include "gfx/text.h"


enum dwg_shape {
	dwg_unspec,	// UnSpc
	dwg_in,		// Input
	dwg_out,	// Output
	dwg_tri,	// 3State
	dwg_bidir,	// Bidirectional
};

struct dwg_bbox {
	int x, y;
	int w, h;
};


void dwg_label(struct gfx *gfx, int x, int y, const char *s, int dir, int dim,
    enum dwg_shape shape, enum text_style style, struct dwg_bbox *bbox);
void dwg_hlabel(struct gfx *gfx, int x, int y, const char *s, int dir, int dim,
    enum dwg_shape shape, enum text_style style, struct dwg_bbox *bbox);
void dwg_glabel(struct gfx *gfx, int x, int y, const char *s, int dir, int dim,
    enum dwg_shape shape, enum text_style style, struct dwg_bbox *bbox);
void dwg_text(struct gfx *gfx, int x, int y, const char *s, int dir, int dim,
    enum dwg_shape shape, enum text_style style, struct dwg_bbox *bbox);

void dwg_junction(struct gfx *gfx, int x, int y);
void dwg_noconn(struct gfx *gfx, int x, int y);

void dwg_line(struct gfx *gfx, int sx, int sy, int ex, int ey);

void dwg_wire(struct gfx *gfx, int sx, int sy, int ex, int ey);
void dwg_bus(struct gfx *gfx, int sx, int sy, int ex, int ey);

#endif /* !KICAD_DWG_H */