2016-08-22 10:40:40 +03:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
|
2016-08-22 10:52:18 +03:00
|
|
|
#include "gfx/text.h"
|
2016-08-22 10:40:40 +03:00
|
|
|
#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) */
|
2016-08-22 10:52:18 +03:00
|
|
|
enum text_align hor; /* tbtext */
|
|
|
|
enum text_align vert; /* tbtext */
|
2016-08-22 10:40:40 +03:00
|
|
|
|
|
|
|
struct pl_obj *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct pl_ctx {
|
|
|
|
struct sexpr_ctx *sexpr_ctx;
|
|
|
|
float l, r, t, b; /* margins */
|
2016-08-22 11:00:38 +03:00
|
|
|
float tx, ty; /* text size */
|
2016-08-22 10:40:40 +03:00
|
|
|
struct pl_obj *objs;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* !KICAD_PL_COMMON_H */
|