From 9829f7070fea75182308482f9ffb1465596db0a9 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Wed, 17 Aug 2016 21:28:42 -0300 Subject: [PATCH] eeshow/: move graphics low-level functions to gfx/ --- eeshow/Makefile | 4 +++- eeshow/delta.c | 2 +- eeshow/{ => gfx}/cro.c | 12 ++++++------ eeshow/{ => gfx}/cro.h | 10 +++++----- eeshow/{ => gfx}/diff.c | 8 ++++---- eeshow/{ => gfx}/diff.h | 12 ++++++------ eeshow/{ => gfx}/fig.c | 8 ++++---- eeshow/{ => gfx}/fig.h | 10 +++++----- eeshow/{ => gfx}/gfx.c | 8 ++++---- eeshow/{ => gfx}/gfx.h | 10 +++++----- eeshow/{ => gfx}/record.c | 10 +++++----- eeshow/{ => gfx}/record.h | 10 +++++----- eeshow/{ => gfx}/style.c | 4 ++-- eeshow/{ => gfx}/style.h | 8 ++++---- eeshow/{ => gfx}/text.c | 8 ++++---- eeshow/{ => gfx}/text.h | 8 ++++---- eeshow/gui/gui.c | 8 ++++---- eeshow/kicad/dwg.c | 6 +++--- eeshow/kicad/lib-parse.c | 2 +- eeshow/kicad/lib-render.c | 6 +++--- eeshow/kicad/lib.h | 2 +- eeshow/kicad/sch-render.c | 4 ++-- eeshow/kicad/sch.h | 4 ++-- eeshow/main.c | 8 ++++---- 24 files changed, 87 insertions(+), 85 deletions(-) rename eeshow/{ => gfx}/cro.c (98%) rename eeshow/{ => gfx}/cro.h (91%) rename eeshow/{ => gfx}/diff.c (98%) rename eeshow/{ => gfx}/diff.h (78%) rename eeshow/{ => gfx}/fig.c (98%) rename eeshow/{ => gfx}/fig.h (74%) rename eeshow/{ => gfx}/gfx.c (94%) rename eeshow/{ => gfx}/gfx.h (94%) rename eeshow/{ => gfx}/record.c (97%) rename eeshow/{ => gfx}/record.h (91%) rename eeshow/{ => gfx}/style.c (95%) rename eeshow/{ => gfx}/style.h (96%) rename eeshow/{ => gfx}/text.c (96%) rename eeshow/{ => gfx}/text.h (93%) diff --git a/eeshow/Makefile b/eeshow/Makefile index 56a294f..96791ee 100644 --- a/eeshow/Makefile +++ b/eeshow/Makefile @@ -17,7 +17,9 @@ OBJS = main.o \ gui/gui.o gui/over.o gui/style.o gui/aoi.o gui/fmt-pango.o \ file/file.o file/git-util.o file/git-file.o file/git-hist.o \ delta.o \ - style.o fig.o record.o cro.o diff.o gfx.o text.o misc.o diag.o + gfx/style.o gfx/fig.o gfx/record.o gfx/cro.o gfx/diff.o gfx/gfx.o \ + gfx/text.o \ + misc.o diag.o CFLAGS = -g -Wall -Wextra -Wno-unused-parameter -Wshadow \ -Wmissing-prototypes -Wmissing-declarations \ diff --git a/eeshow/delta.c b/eeshow/delta.c index 29b96d5..46c76df 100644 --- a/eeshow/delta.c +++ b/eeshow/delta.c @@ -17,7 +17,7 @@ #include #include "util.h" -#include "text.h" +#include "gfx/text.h" #include "kicad/lib.h" #include "kicad/sch.h" #include "delta.h" diff --git a/eeshow/cro.c b/eeshow/gfx/cro.c similarity index 98% rename from eeshow/cro.c rename to eeshow/gfx/cro.c index 0b66eb2..e3e1658 100644 --- a/eeshow/cro.c +++ b/eeshow/gfx/cro.c @@ -1,5 +1,5 @@ /* - * cro.c - Cairo graphics back-end + * gfx/cro.c - Cairo graphics back-end * * Written 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger @@ -24,12 +24,12 @@ #include "util.h" #include "diag.h" -#include "style.h" -#include "text.h" -#include "gfx.h" -#include "record.h" +#include "gfx/style.h" +#include "gfx/text.h" +#include "gfx/gfx.h" +#include "gfx/record.h" #include "main.h" -#include "cro.h" +#include "gfx/cro.h" /* diff --git a/eeshow/cro.h b/eeshow/gfx/cro.h similarity index 91% rename from eeshow/cro.h rename to eeshow/gfx/cro.h index 8c3fd97..954a3d7 100644 --- a/eeshow/cro.h +++ b/eeshow/gfx/cro.h @@ -1,5 +1,5 @@ /* - * cro.h - Cairo graphics back-end + * gfx/cro.h - Cairo graphics back-end * * Written 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger @@ -11,14 +11,14 @@ */ -#ifndef CRO_H -#define CRO_H +#ifndef GFX_CRO_H +#define GFX_CRO_H #include #include -#include "gfx.h" +#include "gfx/gfx.h" struct cro_ctx; @@ -47,4 +47,4 @@ uint32_t *cro_img(struct cro_ctx *ctx, int x0, int yo, int w, int h, int xe, int ye, float scale, cairo_t **res_cr, int *res_stride); -#endif /* !CRO_H */ +#endif /* !GFX_CRO_H */ diff --git a/eeshow/diff.c b/eeshow/gfx/diff.c similarity index 98% rename from eeshow/diff.c rename to eeshow/gfx/diff.c index 1ce1b35..9544693 100644 --- a/eeshow/diff.c +++ b/eeshow/gfx/diff.c @@ -1,5 +1,5 @@ /* - * diff.c - Schematics difference + * gfx/diff.c - Schematics difference * * Written 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger @@ -22,12 +22,12 @@ #include "util.h" #include "diag.h" #include "main.h" -#include "cro.h" +#include "gfx/cro.h" #include "file/file.h" #include "kicad/sch.h" #include "kicad/lib.h" -#include "record.h" -#include "diff.h" +#include "gfx/record.h" +#include "gfx/diff.h" #define DEFAULT_FRAME_RADIUS 30 diff --git a/eeshow/diff.h b/eeshow/gfx/diff.h similarity index 78% rename from eeshow/diff.h rename to eeshow/gfx/diff.h index 786fb70..4042ccc 100644 --- a/eeshow/diff.h +++ b/eeshow/gfx/diff.h @@ -1,5 +1,5 @@ /* - * diff.h - Schematics difference + * gfx/diff.h - Schematics difference * * Written 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger @@ -11,13 +11,13 @@ */ -#ifndef DIFF_H -#define DIFF_H +#ifndef GFX_DIFF_H +#define GFX_DIFF_H #include -#include "gfx.h" -#include "cro.h" +#include "gfx/gfx.h" +#include "gfx/cro.h" extern const struct gfx_ops diff_ops; @@ -26,4 +26,4 @@ extern const struct gfx_ops diff_ops; void diff_to_canvas(cairo_t *cr, int cx, int cy, float scale, struct cro_ctx *old, struct cro_ctx *new); -#endif /* !DIFF_H */ +#endif /* !GFX_DIFF_H */ diff --git a/eeshow/fig.c b/eeshow/gfx/fig.c similarity index 98% rename from eeshow/fig.c rename to eeshow/gfx/fig.c index 4735c5c..0b1cbcc 100644 --- a/eeshow/fig.c +++ b/eeshow/gfx/fig.c @@ -1,5 +1,5 @@ /* - * fig.c - Generate FIG output for Eeschema items + * gfx/fig.c - Generate FIG output for Eeschema items * * Written 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger @@ -21,10 +21,10 @@ #include "util.h" #include "diag.h" -#include "style.h" -#include "text.h" +#include "gfx/style.h" +#include "gfx/text.h" #include "main.h" -#include "fig.h" +#include "gfx/fig.h" /* diff --git a/eeshow/fig.h b/eeshow/gfx/fig.h similarity index 74% rename from eeshow/fig.h rename to eeshow/gfx/fig.h index 6e6a361..06701e1 100644 --- a/eeshow/fig.h +++ b/eeshow/gfx/fig.h @@ -1,5 +1,5 @@ /* - * fig.h - Generate FIG output for Eeschema items + * gfx/fig.h - Generate FIG output for Eeschema items * * Written 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger @@ -11,12 +11,12 @@ */ -#ifndef FIG_H -#define FIG_H +#ifndef GFX_FIG_H +#define GFX_FIG_H -#include "gfx.h" +#include "gfx/gfx.h" extern const struct gfx_ops fig_ops; -#endif /* !FIG_H */ +#endif /* !GFX_FIG_H */ diff --git a/eeshow/gfx.c b/eeshow/gfx/gfx.c similarity index 94% rename from eeshow/gfx.c rename to eeshow/gfx/gfx.c index ba88134..a0ac9bd 100644 --- a/eeshow/gfx.c +++ b/eeshow/gfx/gfx.c @@ -1,5 +1,5 @@ /* - * gfx.c - Generate graphical output for Eeschema items + * gfx/gfx.c - Generate graphical output for Eeschema items * * Written 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger @@ -13,9 +13,9 @@ #include -#include "style.h" -#include "text.h" -#include "gfx.h" +#include "gfx/style.h" +#include "gfx/text.h" +#include "gfx/gfx.h" void *gfx_ctx; diff --git a/eeshow/gfx.h b/eeshow/gfx/gfx.h similarity index 94% rename from eeshow/gfx.h rename to eeshow/gfx/gfx.h index 94425c0..327a963 100644 --- a/eeshow/gfx.h +++ b/eeshow/gfx/gfx.h @@ -1,5 +1,5 @@ /* - * gfx.h - Generate graphical output for Eeschema items + * gfx/gfx.h - Generate graphical output for Eeschema items * * Written 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger @@ -11,12 +11,12 @@ */ -#ifndef GFX_H -#define GFX_H +#ifndef GFX_GFX_H +#define GFX_GFX_H #include -#include "text.h" +#include "gfx/text.h" struct gfx_ops { @@ -69,4 +69,4 @@ void gfx_new_sheet(void); bool gfx_multi_sheet(void); void gfx_end(void); -#endif /* !GFX_H */ +#endif /* !GFX_GFX_H */ diff --git a/eeshow/record.c b/eeshow/gfx/record.c similarity index 97% rename from eeshow/record.c rename to eeshow/gfx/record.c index 03cf90c..91a2652 100644 --- a/eeshow/record.c +++ b/eeshow/gfx/record.c @@ -1,5 +1,5 @@ /* - * record.c - Record graphics operations by layers and replay + * gfx/record.c - Record graphics operations by layers and replay * * Written 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger @@ -16,10 +16,10 @@ #include #include "util.h" -#include "style.h" -#include "gfx.h" -#include "text.h" -#include "record.h" +#include "gfx/style.h" +#include "gfx/gfx.h" +#include "gfx/text.h" +#include "gfx/record.h" struct record_obj { diff --git a/eeshow/record.h b/eeshow/gfx/record.h similarity index 91% rename from eeshow/record.h rename to eeshow/gfx/record.h index 3ff26f8..85e44b2 100644 --- a/eeshow/record.h +++ b/eeshow/gfx/record.h @@ -1,5 +1,5 @@ /* - * record.h - Record graphics operations by layers and replay + * gfx/record.h - Record graphics operations by layers and replay * * Written 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger @@ -11,10 +11,10 @@ */ -#ifndef RECORD_H -#define RECORD_H +#ifndef GFX_RECORD_H +#define GFX_RECORD_H -#include "gfx.h" +#include "gfx/gfx.h" struct record_obj; @@ -55,4 +55,4 @@ void record_replay(const struct record *rec); void record_bbox(const struct record *rec, int *x, int *y, int *w, int *h); void record_destroy(struct record *rec); -#endif /* !RECORD_H */ +#endif /* !GFX_RECORD_H */ diff --git a/eeshow/style.c b/eeshow/gfx/style.c similarity index 95% rename from eeshow/style.c rename to eeshow/gfx/style.c index 9bd0790..5628b41 100644 --- a/eeshow/style.c +++ b/eeshow/gfx/style.c @@ -1,5 +1,5 @@ /* - * style.c - Drawing style + * gfx/style.c - Drawing style * * Written 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger @@ -13,7 +13,7 @@ #include #include "util.h" -#include "style.h" +#include "gfx/style.h" uint32_t color_rgb[] = { diff --git a/eeshow/style.h b/eeshow/gfx/style.h similarity index 96% rename from eeshow/style.h rename to eeshow/gfx/style.h index 4a090ef..15c4d8b 100644 --- a/eeshow/style.h +++ b/eeshow/gfx/style.h @@ -1,5 +1,5 @@ /* - * style.h - Drawing style + * gfx/style.h - Drawing style * * Written 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger @@ -10,8 +10,8 @@ * (at your option) any later version. */ -#ifndef STYLE_H -#define STYLE_H +#ifndef GFX_STYLE_H +#define GFX_STYLE_H #include @@ -100,4 +100,4 @@ extern uint32_t color_rgb[]; extern unsigned n_color_rgb; -#endif /* !STYLE_H */ +#endif /* !GFX_STYLE_H */ diff --git a/eeshow/text.c b/eeshow/gfx/text.c similarity index 96% rename from eeshow/text.c rename to eeshow/gfx/text.c index 4c7d94d..bc9625d 100644 --- a/eeshow/text.c +++ b/eeshow/gfx/text.c @@ -1,5 +1,5 @@ /* - * text.c - FIG text object + * gfx/text.c - FIG text object * * Written 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger @@ -18,9 +18,9 @@ #include "util.h" #include "misc.h" -#include "style.h" -#include "gfx.h" -#include "text.h" +#include "gfx/style.h" +#include "gfx/gfx.h" +#include "gfx/text.h" void text_init(struct text *txt) diff --git a/eeshow/text.h b/eeshow/gfx/text.h similarity index 93% rename from eeshow/text.h rename to eeshow/gfx/text.h index febca34..e6327fd 100644 --- a/eeshow/text.h +++ b/eeshow/gfx/text.h @@ -1,5 +1,5 @@ /* - * text.h - FIG text object + * gfx/text.h - FIG text object * * Written 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger @@ -11,8 +11,8 @@ */ -#ifndef TEXT_H -#define TEXT_H +#ifndef GFX_TEXT_H +#define GFX_TEXT_H /* use constants of FIG text sub_type */ @@ -56,4 +56,4 @@ int text_rel_x(const struct text *txt, enum text_align xr, enum text_align yr, int text_rel_y(const struct text *txt, enum text_align xr, enum text_align yr, int dx, int dy); -#endif /* !TEXT_H */ +#endif /* !GFX_TEXT_H */ diff --git a/eeshow/gui/gui.c b/eeshow/gui/gui.c index 36ddf81..47ee87f 100644 --- a/eeshow/gui/gui.c +++ b/eeshow/gui/gui.c @@ -30,14 +30,14 @@ #include "util.h" #include "diag.h" -#include "style.h" -#include "cro.h" -#include "gfx.h" +#include "gfx/style.h" +#include "gfx/cro.h" +#include "gfx/gfx.h" #include "file/git-hist.h" #include "kicad/lib.h" #include "kicad/sch.h" #include "delta.h" -#include "diff.h" +#include "gfx/diff.h" #include "kicad/dwg.h" #include "gui/fmt-pango.h" #include "gui/aoi.h" diff --git a/eeshow/kicad/dwg.c b/eeshow/kicad/dwg.c index 9943775..d9f4b1a 100644 --- a/eeshow/kicad/dwg.c +++ b/eeshow/kicad/dwg.c @@ -19,9 +19,9 @@ #include "util.h" #include "misc.h" -#include "style.h" -#include "text.h" -#include "gfx.h" +#include "gfx/style.h" +#include "gfx/text.h" +#include "gfx/gfx.h" #include "kicad/dwg.h" diff --git a/eeshow/kicad/lib-parse.c b/eeshow/kicad/lib-parse.c index a4c8d6f..edd429f 100644 --- a/eeshow/kicad/lib-parse.c +++ b/eeshow/kicad/lib-parse.c @@ -17,7 +17,7 @@ #include "util.h" #include "diag.h" -#include "text.h" +#include "gfx/text.h" #include "file/file.h" #include "kicad/lib.h" diff --git a/eeshow/kicad/lib-render.c b/eeshow/kicad/lib-render.c index 079d776..d4e8caf 100644 --- a/eeshow/kicad/lib-render.c +++ b/eeshow/kicad/lib-render.c @@ -18,9 +18,9 @@ #include "util.h" #include "diag.h" #include "misc.h" -#include "style.h" -#include "gfx.h" -#include "text.h" +#include "gfx/style.h" +#include "gfx/gfx.h" +#include "gfx/text.h" #include "kicad/sch.h" #include "kicad/lib.h" diff --git a/eeshow/kicad/lib.h b/eeshow/kicad/lib.h index 7bf07ac..c9b1a00 100644 --- a/eeshow/kicad/lib.h +++ b/eeshow/kicad/lib.h @@ -17,7 +17,7 @@ #include #include "file/file.h" -#include "text.h" +#include "gfx/text.h" enum lib_state { diff --git a/eeshow/kicad/sch-render.c b/eeshow/kicad/sch-render.c index 34effb1..9d56d54 100644 --- a/eeshow/kicad/sch-render.c +++ b/eeshow/kicad/sch-render.c @@ -16,8 +16,8 @@ #include #include "misc.h" -#include "style.h" -#include "gfx.h" +#include "gfx/style.h" +#include "gfx/gfx.h" #include "kicad/dwg.h" #include "kicad/lib.h" #include "kicad/sch.h" diff --git a/eeshow/kicad/sch.h b/eeshow/kicad/sch.h index d7e82f1..29ecc83 100644 --- a/eeshow/kicad/sch.h +++ b/eeshow/kicad/sch.h @@ -16,8 +16,8 @@ #include -#include "dwg.h" -#include "text.h" +#include "kicad/dwg.h" +#include "gfx/text.h" #include "file/file.h" #include "kicad/lib.h" diff --git a/eeshow/main.c b/eeshow/main.c index 1ca8032..1e85b71 100644 --- a/eeshow/main.c +++ b/eeshow/main.c @@ -21,10 +21,10 @@ #include "util.h" #include "diag.h" -#include "fig.h" -#include "cro.h" -#include "diff.h" -#include "gfx.h" +#include "gfx/fig.h" +#include "gfx/cro.h" +#include "gfx/diff.h" +#include "gfx/gfx.h" #include "file/file.h" #include "kicad/lib.h" #include "kicad/sch.h"