summaryrefslogtreecommitdiff
path: root/kicad
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-22 04:01:19 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-22 04:01:19 -0300
commit7efc1b155cebbcc3adc6316e9140abb960d30f63 (patch)
tree2bdd9d619a9a5bed916fd243b3cf1129a0a7cf77 /kicad
parent5b0d719813961c47ff45c49833959cde274cc274 (diff)
downloadeeshow-7efc1b155cebbcc3adc6316e9140abb960d30f63.tar.gz
eeshow-7efc1b155cebbcc3adc6316e9140abb960d30f63.tar.bz2
eeshow-7efc1b155cebbcc3adc6316e9140abb960d30f63.zip
eeshow/kicad/sch.h, sch-parse.c: also retrieve sheet width and height
Diffstat (limited to 'kicad')
-rw-r--r--kicad/sch-parse.c5
-rw-r--r--kicad/sch.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/kicad/sch-parse.c b/kicad/sch-parse.c
index 3cdebb4..4d60da5 100644
--- a/kicad/sch-parse.c
+++ b/kicad/sch-parse.c
@@ -310,6 +310,8 @@ static struct sheet *new_sheet(struct sch_ctx *ctx)
sheet->next_obj = &sheet->objs;
sheet->next = NULL;
+ sheet->w = sheet->h = 0;
+
sheet->has_children = 0;
sheet->oid = NULL;
@@ -490,6 +492,9 @@ static bool parse_line(const struct file *file, void *user, const char *line)
}
break;
case sch_descr:
+ if (sscanf(line, "$Descr %*s %d %d",
+ &ctx->curr_sheet->w, &ctx->curr_sheet->h) == 2)
+ return 1;
if (sscanf(line, "Title \"%m[^\"]\"", &s) == 1) {
ctx->curr_sheet->title = s;
return 1;
diff --git a/kicad/sch.h b/kicad/sch.h
index 29ecc83..117ce16 100644
--- a/kicad/sch.h
+++ b/kicad/sch.h
@@ -103,6 +103,8 @@ struct sheet {
struct sch_obj **next_obj;
struct sheet *next;
+ int w, h;
+
bool has_children; /* aka sub-sheets */
/* caching */