1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2025-04-21 12:27:27 +03:00

eeshow/gui/: experimental support for page layout; option -P pl-file.kicad_wks

Unlike libraries and schematics, page layouts are not (yet) tracked through
revision history.
This commit is contained in:
Werner Almesberger
2016-08-22 04:05:41 -03:00
parent 2d964c0f35
commit 6c4eae22e1
5 changed files with 30 additions and 4 deletions

View File

@@ -66,6 +66,8 @@ struct gui_ctx {
unsigned zoom; /* scale by 1.0 / (1 << zoom) */
int x, y; /* center, in eeschema coordinates */
struct pl_ctx *pl; // @@@
struct gui_hist *hist; /* revision history; NULL if none */
struct hist *vcs_hist; /* underlying VCS data; NULL if none */

View File

@@ -30,6 +30,7 @@
#include "misc/util.h"
#include "misc/diag.h"
#include "file/git-hist.h"
#include "kicad/pl.h"
#include "kicad/lib.h"
#include "kicad/sch.h"
#include "kicad/delta.h"
@@ -381,12 +382,14 @@ static void get_history(struct gui_ctx *ctx, const char *sch_name, int limit)
/* ----- Initialization ---------------------------------------------------- */
int gui(unsigned n_args, char **args, bool recurse, int limit)
int gui(unsigned n_args, char **args, bool recurse, int limit,
struct pl_ctx *pl)
{
GtkWidget *window;
char *title;
struct gui_ctx ctx = {
.zoom = 4, /* scale by 1 / 16 */
.pl = pl, // @@@
.hist = NULL,
.vcs_hist = NULL,
.showing_history= 0,

View File

@@ -20,6 +20,7 @@
* and there is no NULL at the end.
*/
int gui(unsigned n_args, char **args, bool recurse, int limit);
int gui(unsigned n_args, char **args, bool recurse, int limit,
struct pl_ctx *pl);
#endif /* !GUI_GUI_H */

View File

@@ -21,6 +21,7 @@
#include "gfx/style.h"
#include "gfx/cro.h"
#include "gfx/gfx.h"
#include "kicad/pl.h"
#include "kicad/sch.h"
#include "kicad/delta.h"
#include "gfx/diff.h"
@@ -230,6 +231,8 @@ void render_sheet(struct gui_sheet *sheet)
char *argv[] = { "gui", NULL };
gfx_init(&cro_canvas_ops, 1, argv);
if (sheet->ctx->pl)
pl_render(sheet->ctx->pl, sheet->sch->w, sheet->sch->h);
sch_render(sheet->sch);
cro_canvas_end(gfx_ctx,
&sheet->w, &sheet->h, &sheet->xmin, &sheet->ymin);