1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-12-23 08:38:58 +02:00

eeshow/: move graphics low-level functions to gfx/

This commit is contained in:
Werner Almesberger 2016-08-17 21:28:42 -03:00
parent c353129172
commit 9829f7070f
24 changed files with 87 additions and 85 deletions

View File

@ -17,7 +17,9 @@ OBJS = main.o \
gui/gui.o gui/over.o gui/style.o gui/aoi.o gui/fmt-pango.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 \ file/file.o file/git-util.o file/git-file.o file/git-hist.o \
delta.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 \ CFLAGS = -g -Wall -Wextra -Wno-unused-parameter -Wshadow \
-Wmissing-prototypes -Wmissing-declarations \ -Wmissing-prototypes -Wmissing-declarations \

View File

@ -17,7 +17,7 @@
#include <string.h> #include <string.h>
#include "util.h" #include "util.h"
#include "text.h" #include "gfx/text.h"
#include "kicad/lib.h" #include "kicad/lib.h"
#include "kicad/sch.h" #include "kicad/sch.h"
#include "delta.h" #include "delta.h"

View File

@ -1,5 +1,5 @@
/* /*
* cro.c - Cairo graphics back-end * gfx/cro.c - Cairo graphics back-end
* *
* Written 2016 by Werner Almesberger * Written 2016 by Werner Almesberger
* Copyright 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger
@ -24,12 +24,12 @@
#include "util.h" #include "util.h"
#include "diag.h" #include "diag.h"
#include "style.h" #include "gfx/style.h"
#include "text.h" #include "gfx/text.h"
#include "gfx.h" #include "gfx/gfx.h"
#include "record.h" #include "gfx/record.h"
#include "main.h" #include "main.h"
#include "cro.h" #include "gfx/cro.h"
/* /*

View File

@ -1,5 +1,5 @@
/* /*
* cro.h - Cairo graphics back-end * gfx/cro.h - Cairo graphics back-end
* *
* Written 2016 by Werner Almesberger * Written 2016 by Werner Almesberger
* Copyright 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger
@ -11,14 +11,14 @@
*/ */
#ifndef CRO_H #ifndef GFX_CRO_H
#define CRO_H #define GFX_CRO_H
#include <stdint.h> #include <stdint.h>
#include <cairo/cairo.h> #include <cairo/cairo.h>
#include "gfx.h" #include "gfx/gfx.h"
struct cro_ctx; 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, int xe, int ye,
float scale, cairo_t **res_cr, int *res_stride); float scale, cairo_t **res_cr, int *res_stride);
#endif /* !CRO_H */ #endif /* !GFX_CRO_H */

View File

@ -1,5 +1,5 @@
/* /*
* diff.c - Schematics difference * gfx/diff.c - Schematics difference
* *
* Written 2016 by Werner Almesberger * Written 2016 by Werner Almesberger
* Copyright 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger
@ -22,12 +22,12 @@
#include "util.h" #include "util.h"
#include "diag.h" #include "diag.h"
#include "main.h" #include "main.h"
#include "cro.h" #include "gfx/cro.h"
#include "file/file.h" #include "file/file.h"
#include "kicad/sch.h" #include "kicad/sch.h"
#include "kicad/lib.h" #include "kicad/lib.h"
#include "record.h" #include "gfx/record.h"
#include "diff.h" #include "gfx/diff.h"
#define DEFAULT_FRAME_RADIUS 30 #define DEFAULT_FRAME_RADIUS 30

View File

@ -1,5 +1,5 @@
/* /*
* diff.h - Schematics difference * gfx/diff.h - Schematics difference
* *
* Written 2016 by Werner Almesberger * Written 2016 by Werner Almesberger
* Copyright 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger
@ -11,13 +11,13 @@
*/ */
#ifndef DIFF_H #ifndef GFX_DIFF_H
#define DIFF_H #define GFX_DIFF_H
#include <cairo/cairo.h> #include <cairo/cairo.h>
#include "gfx.h" #include "gfx/gfx.h"
#include "cro.h" #include "gfx/cro.h"
extern const struct gfx_ops diff_ops; 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, void diff_to_canvas(cairo_t *cr, int cx, int cy, float scale,
struct cro_ctx *old, struct cro_ctx *new); struct cro_ctx *old, struct cro_ctx *new);
#endif /* !DIFF_H */ #endif /* !GFX_DIFF_H */

View File

@ -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 * Written 2016 by Werner Almesberger
* Copyright 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger
@ -21,10 +21,10 @@
#include "util.h" #include "util.h"
#include "diag.h" #include "diag.h"
#include "style.h" #include "gfx/style.h"
#include "text.h" #include "gfx/text.h"
#include "main.h" #include "main.h"
#include "fig.h" #include "gfx/fig.h"
/* /*

View File

@ -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 * Written 2016 by Werner Almesberger
* Copyright 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger
@ -11,12 +11,12 @@
*/ */
#ifndef FIG_H #ifndef GFX_FIG_H
#define FIG_H #define GFX_FIG_H
#include "gfx.h" #include "gfx/gfx.h"
extern const struct gfx_ops fig_ops; extern const struct gfx_ops fig_ops;
#endif /* !FIG_H */ #endif /* !GFX_FIG_H */

View File

@ -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 * Written 2016 by Werner Almesberger
* Copyright 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger
@ -13,9 +13,9 @@
#include <stdbool.h> #include <stdbool.h>
#include "style.h" #include "gfx/style.h"
#include "text.h" #include "gfx/text.h"
#include "gfx.h" #include "gfx/gfx.h"
void *gfx_ctx; void *gfx_ctx;

View File

@ -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 * Written 2016 by Werner Almesberger
* Copyright 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger
@ -11,12 +11,12 @@
*/ */
#ifndef GFX_H #ifndef GFX_GFX_H
#define GFX_H #define GFX_GFX_H
#include <stdbool.h> #include <stdbool.h>
#include "text.h" #include "gfx/text.h"
struct gfx_ops { struct gfx_ops {
@ -69,4 +69,4 @@ void gfx_new_sheet(void);
bool gfx_multi_sheet(void); bool gfx_multi_sheet(void);
void gfx_end(void); void gfx_end(void);
#endif /* !GFX_H */ #endif /* !GFX_GFX_H */

View File

@ -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 * Written 2016 by Werner Almesberger
* Copyright 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger
@ -16,10 +16,10 @@
#include <math.h> #include <math.h>
#include "util.h" #include "util.h"
#include "style.h" #include "gfx/style.h"
#include "gfx.h" #include "gfx/gfx.h"
#include "text.h" #include "gfx/text.h"
#include "record.h" #include "gfx/record.h"
struct record_obj { struct record_obj {

View File

@ -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 * Written 2016 by Werner Almesberger
* Copyright 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger
@ -11,10 +11,10 @@
*/ */
#ifndef RECORD_H #ifndef GFX_RECORD_H
#define RECORD_H #define GFX_RECORD_H
#include "gfx.h" #include "gfx/gfx.h"
struct record_obj; 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_bbox(const struct record *rec, int *x, int *y, int *w, int *h);
void record_destroy(struct record *rec); void record_destroy(struct record *rec);
#endif /* !RECORD_H */ #endif /* !GFX_RECORD_H */

View File

@ -1,5 +1,5 @@
/* /*
* style.c - Drawing style * gfx/style.c - Drawing style
* *
* Written 2016 by Werner Almesberger * Written 2016 by Werner Almesberger
* Copyright 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger
@ -13,7 +13,7 @@
#include <stdint.h> #include <stdint.h>
#include "util.h" #include "util.h"
#include "style.h" #include "gfx/style.h"
uint32_t color_rgb[] = { uint32_t color_rgb[] = {

View File

@ -1,5 +1,5 @@
/* /*
* style.h - Drawing style * gfx/style.h - Drawing style
* *
* Written 2016 by Werner Almesberger * Written 2016 by Werner Almesberger
* Copyright 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger
@ -10,8 +10,8 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#ifndef STYLE_H #ifndef GFX_STYLE_H
#define STYLE_H #define GFX_STYLE_H
#include <stdint.h> #include <stdint.h>
@ -100,4 +100,4 @@
extern uint32_t color_rgb[]; extern uint32_t color_rgb[];
extern unsigned n_color_rgb; extern unsigned n_color_rgb;
#endif /* !STYLE_H */ #endif /* !GFX_STYLE_H */

View File

@ -1,5 +1,5 @@
/* /*
* text.c - FIG text object * gfx/text.c - FIG text object
* *
* Written 2016 by Werner Almesberger * Written 2016 by Werner Almesberger
* Copyright 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger
@ -18,9 +18,9 @@
#include "util.h" #include "util.h"
#include "misc.h" #include "misc.h"
#include "style.h" #include "gfx/style.h"
#include "gfx.h" #include "gfx/gfx.h"
#include "text.h" #include "gfx/text.h"
void text_init(struct text *txt) void text_init(struct text *txt)

View File

@ -1,5 +1,5 @@
/* /*
* text.h - FIG text object * gfx/text.h - FIG text object
* *
* Written 2016 by Werner Almesberger * Written 2016 by Werner Almesberger
* Copyright 2016 by Werner Almesberger * Copyright 2016 by Werner Almesberger
@ -11,8 +11,8 @@
*/ */
#ifndef TEXT_H #ifndef GFX_TEXT_H
#define TEXT_H #define GFX_TEXT_H
/* use constants of FIG text sub_type */ /* 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 text_rel_y(const struct text *txt, enum text_align xr, enum text_align yr,
int dx, int dy); int dx, int dy);
#endif /* !TEXT_H */ #endif /* !GFX_TEXT_H */

View File

@ -30,14 +30,14 @@
#include "util.h" #include "util.h"
#include "diag.h" #include "diag.h"
#include "style.h" #include "gfx/style.h"
#include "cro.h" #include "gfx/cro.h"
#include "gfx.h" #include "gfx/gfx.h"
#include "file/git-hist.h" #include "file/git-hist.h"
#include "kicad/lib.h" #include "kicad/lib.h"
#include "kicad/sch.h" #include "kicad/sch.h"
#include "delta.h" #include "delta.h"
#include "diff.h" #include "gfx/diff.h"
#include "kicad/dwg.h" #include "kicad/dwg.h"
#include "gui/fmt-pango.h" #include "gui/fmt-pango.h"
#include "gui/aoi.h" #include "gui/aoi.h"

View File

@ -19,9 +19,9 @@
#include "util.h" #include "util.h"
#include "misc.h" #include "misc.h"
#include "style.h" #include "gfx/style.h"
#include "text.h" #include "gfx/text.h"
#include "gfx.h" #include "gfx/gfx.h"
#include "kicad/dwg.h" #include "kicad/dwg.h"

View File

@ -17,7 +17,7 @@
#include "util.h" #include "util.h"
#include "diag.h" #include "diag.h"
#include "text.h" #include "gfx/text.h"
#include "file/file.h" #include "file/file.h"
#include "kicad/lib.h" #include "kicad/lib.h"

View File

@ -18,9 +18,9 @@
#include "util.h" #include "util.h"
#include "diag.h" #include "diag.h"
#include "misc.h" #include "misc.h"
#include "style.h" #include "gfx/style.h"
#include "gfx.h" #include "gfx/gfx.h"
#include "text.h" #include "gfx/text.h"
#include "kicad/sch.h" #include "kicad/sch.h"
#include "kicad/lib.h" #include "kicad/lib.h"

View File

@ -17,7 +17,7 @@
#include <stdbool.h> #include <stdbool.h>
#include "file/file.h" #include "file/file.h"
#include "text.h" #include "gfx/text.h"
enum lib_state { enum lib_state {

View File

@ -16,8 +16,8 @@
#include <assert.h> #include <assert.h>
#include "misc.h" #include "misc.h"
#include "style.h" #include "gfx/style.h"
#include "gfx.h" #include "gfx/gfx.h"
#include "kicad/dwg.h" #include "kicad/dwg.h"
#include "kicad/lib.h" #include "kicad/lib.h"
#include "kicad/sch.h" #include "kicad/sch.h"

View File

@ -16,8 +16,8 @@
#include <stdbool.h> #include <stdbool.h>
#include "dwg.h" #include "kicad/dwg.h"
#include "text.h" #include "gfx/text.h"
#include "file/file.h" #include "file/file.h"
#include "kicad/lib.h" #include "kicad/lib.h"

View File

@ -21,10 +21,10 @@
#include "util.h" #include "util.h"
#include "diag.h" #include "diag.h"
#include "fig.h" #include "gfx/fig.h"
#include "cro.h" #include "gfx/cro.h"
#include "diff.h" #include "gfx/diff.h"
#include "gfx.h" #include "gfx/gfx.h"
#include "file/file.h" #include "file/file.h"
#include "kicad/lib.h" #include "kicad/lib.h"
#include "kicad/sch.h" #include "kicad/sch.h"