summaryrefslogtreecommitdiff
path: root/kicad/pl-common.h
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-22 04:40:40 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-22 04:40:40 -0300
commitf4e780e0101b81d373a6fec3fc41bd8e382f9c21 (patch)
tree7a04e437be2ca642758e6bfb012777e3fa4eaeb2 /kicad/pl-common.h
parent01e563c537c8503b86c833d351207396ec6c9fc2 (diff)
downloadeeshow-f4e780e0101b81d373a6fec3fc41bd8e382f9c21.tar.gz
eeshow-f4e780e0101b81d373a6fec3fc41bd8e382f9c21.tar.bz2
eeshow-f4e780e0101b81d373a6fec3fc41bd8e382f9c21.zip
eeshow/kicad/: begin text support for page layout (WIP); add missing pl-common.h
Diffstat (limited to 'kicad/pl-common.h')
-rw-r--r--kicad/pl-common.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/kicad/pl-common.h b/kicad/pl-common.h
new file mode 100644
index 0000000..72ce0f3
--- /dev/null
+++ b/kicad/pl-common.h
@@ -0,0 +1,52 @@
+/*
+ * kicad/pl-common.h - Shared definitions for KiCad page layout handling
+ *
+ * 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_PL_COMMON_H
+#define KICAD_PL_COMMON_H
+
+#include "kicad/sexpr.h"
+
+
+enum font_flag {
+ font_bold = 1 << 0,
+ font_italic = 1 << 1,
+};
+
+
+struct pl_obj {
+ enum pl_obj_type {
+ pl_obj_rect,
+ pl_obj_line,
+ pl_obj_text,
+ } type;
+
+ const char *s; /* tbtext */
+ int repeat; /* line, rect, tbtext */
+ float x, y; /* line, rect, tbtext */
+ int dx, dy;
+ float ex, ey; /* line, rect; font size for tbtext */
+ int edx, edy;
+ float incrx, incry;
+ int incrlabel; /* tbtext */
+ int font; /* tbtext (flags) */
+
+ struct pl_obj *next;
+};
+
+struct pl_ctx {
+ struct sexpr_ctx *sexpr_ctx;
+ float l, r, t, b; /* margins */
+ struct pl_obj *objs;
+};
+
+#endif /* !KICAD_PL_COMMON_H */