From b925268c90086e2f2c248ba02b095a63f29c8725 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Mon, 22 Aug 2016 05:37:23 -0300 Subject: [PATCH] eeshow/gui/common.h (struct gui_sheet): add back link to history --- eeshow/gui/common.h | 2 ++ eeshow/gui/gui.c | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/eeshow/gui/common.h b/eeshow/gui/common.h index 9882121..cf82f47 100644 --- a/eeshow/gui/common.h +++ b/eeshow/gui/common.h @@ -26,10 +26,12 @@ struct gui_ctx; +struct gui_hist; struct gui_sheet { const struct sheet *sch; struct gui_ctx *ctx; /* back link */ + struct gui_hist *hist; /* back link */ struct cro_ctx *gfx_ctx; int w, h; /* in eeschema coordinates */ diff --git a/eeshow/gui/gui.c b/eeshow/gui/gui.c index f7f2038..d880be6 100644 --- a/eeshow/gui/gui.c +++ b/eeshow/gui/gui.c @@ -154,7 +154,7 @@ void mark_aois(struct gui_ctx *ctx, struct gui_sheet *sheet) } -static struct gui_sheet *get_sheets(struct gui_ctx *ctx, +static struct gui_sheet *get_sheets(struct gui_ctx *ctx, struct gui_hist *hist, const struct sheet *sheets) { const struct sheet *sheet; @@ -166,6 +166,7 @@ static struct gui_sheet *get_sheets(struct gui_ctx *ctx, new = alloc_type(struct gui_sheet); new->sch = sheet; new->ctx = ctx; + new->hist = hist; new->rendered = 0; *next = new; @@ -324,7 +325,7 @@ static void add_hist(void *user, struct hist *h) hist->libs_open = 0; hist->identical = 0; sch = parse_files(hist, ahc->n_args, ahc->args, ahc->recurse, prev); - hist->sheets = sch ? get_sheets(ctx, sch) : NULL; + hist->sheets = sch ? get_sheets(ctx, hist, sch) : NULL; hist->age = age; hist->next = NULL;