Root/
| 1 | /* |
| 2 | * kicad/pl-common.h - Shared definitions for KiCad page layout handling |
| 3 | * |
| 4 | * Written 2016 by Werner Almesberger |
| 5 | * Copyright 2016 by Werner Almesberger |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | */ |
| 12 | |
| 13 | |
| 14 | #ifndef KICAD_PL_COMMON_H |
| 15 | #define KICAD_PL_COMMON_H |
| 16 | |
| 17 | #include "gfx/text.h" |
| 18 | #include "kicad/sexpr.h" |
| 19 | |
| 20 | |
| 21 | enum font_flag { |
| 22 | font_bold = 1 << 0, |
| 23 | font_italic = 1 << 1, |
| 24 | }; |
| 25 | |
| 26 | |
| 27 | struct pl_obj { |
| 28 | enum pl_obj_type { |
| 29 | pl_obj_rect, |
| 30 | pl_obj_line, |
| 31 | pl_obj_text, |
| 32 | } type; |
| 33 | |
| 34 | const char *s; /* tbtext */ |
| 35 | int repeat; /* line, rect, tbtext */ |
| 36 | float x, y; /* line, rect, tbtext */ |
| 37 | int dx, dy; |
| 38 | float ex, ey; /* line, rect; font size for tbtext */ |
| 39 | int edx, edy; |
| 40 | float incrx, incry; |
| 41 | int incrlabel; /* tbtext */ |
| 42 | int font; /* tbtext (flags) */ |
| 43 | enum text_align hor; /* tbtext */ |
| 44 | enum text_align vert; /* tbtext */ |
| 45 | |
| 46 | struct pl_obj *next; |
| 47 | }; |
| 48 | |
| 49 | struct pl_ctx { |
| 50 | struct sexpr_ctx *sexpr_ctx; |
| 51 | float l, r, t, b; /* margins */ |
| 52 | float tx, ty; /* text size */ |
| 53 | struct pl_obj *objs; |
| 54 | }; |
| 55 | |
| 56 | #endif /* !KICAD_PL_COMMON_H */ |
| 57 |
Branches:
master
