From 1c6116a8d6229362808429fa235a97df9f90967d Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 4 Aug 2016 19:25:31 -0300 Subject: [PATCH] eeshow/: fix some whitespace issues - trailing space - space before semicolon - indentation with spaces instead of tabs (copy & paste) --- eeshow/TODO | 8 ++++++++ eeshow/fig.c | 2 +- eeshow/gfx.h | 2 +- eeshow/git-file.c | 4 ++-- eeshow/gui-aoi.h | 2 +- eeshow/gui-over.c | 2 +- eeshow/gui.c | 4 ++-- eeshow/lib-parse.c | 2 +- eeshow/lib.h | 2 +- eeshow/sch2pdf | 2 +- eeshow/text.h | 8 ++++---- 11 files changed, 23 insertions(+), 15 deletions(-) diff --git a/eeshow/TODO b/eeshow/TODO index cecca65..7d5874b 100644 --- a/eeshow/TODO +++ b/eeshow/TODO @@ -8,6 +8,8 @@ Parsing and input processing: Data model: - implement destructors - check for memory leaks +- sheets appearing multiple times are parsed anew each time. Should we try + to combine them ? Visualization (dwg.c and such): - glabel: build for "right" style, then rotate poly (like hlabel) @@ -21,6 +23,8 @@ Visualization (dwg.c and such): Rendering: - better text size guessing also for FIG +- consider switching to Hershey fonts (that's what eeschema uses, right ?) + (goal: prevent font geometry from changing when scaling) - support fonts attributes ? - support line thickness ? - ~ as overline (grep for ~ in out.fig) @@ -34,3 +38,7 @@ GUI: - fonts grow beyond their bounding boxes when zooming in - dragging can be slow. maybe reusing old content and only redrawing new will help ? + +On-going: +- use Pango to support markup in overlay boxes: + https://developer.gnome.org/pango/unstable/PangoMarkupFormat.html diff --git a/eeshow/fig.c b/eeshow/fig.c index 30a3d2c..d24f8e7 100644 --- a/eeshow/fig.c +++ b/eeshow/fig.c @@ -110,7 +110,7 @@ static void fig_circ(void *ctx, int x, int y, int r, { // Type Thick Depth StyleV Cx Rx Sx Ex // SubTy Color Pen Dir Cy Ry Sy Ey - // Style FillCol AreaFil Angle + // Style FillCol AreaFil Angle printf("1 3 0 %d %d %d %d -1 %d 0.0 1 0.0 %d %d %d %d %d %d %d %d\n", color == -1 ? 0 : WIDTH_COMP_DWG, color, fill_color, layer, fill_color == -1 ? -1 : 20, diff --git a/eeshow/gfx.h b/eeshow/gfx.h index d707c24..94425c0 100644 --- a/eeshow/gfx.h +++ b/eeshow/gfx.h @@ -58,7 +58,7 @@ void gfx_arc(int x, int y, int r, int sa, int ea, int color, int fill_color, unsigned layer); void gfx_text(int x, int y, const char *s, unsigned size, enum text_align align, int rot, unsigned color, unsigned layer); -void gfx_tag(const char *s, +void gfx_tag(const char *s, unsigned points, const int x[points], int const y[points]); unsigned gfx_text_width(const char *s, unsigned size); diff --git a/eeshow/git-file.c b/eeshow/git-file.c index 0e8f419..1aaea6a 100644 --- a/eeshow/git-file.c +++ b/eeshow/git-file.c @@ -312,7 +312,7 @@ static const void *get_data(git_repository *repo, git_tree_entry *entry, } if (verbose > 2) { - git_buf buf = { 0 } ; + git_buf buf = { 0 }; if (git_object_short_id(&buf, obj)) { const git_error *e = giterr_last(); @@ -459,7 +459,7 @@ struct vcs_git *vcs_git_open(const char *revision, const char *name, void vcs_git_read(void *ctx, struct file *file, - bool (*parse)(const struct file *file, void *user, const char *line), + bool (*parse)(const struct file *file, void *user, const char *line), void *user) { const struct vcs_git *vcs_git = ctx; diff --git a/eeshow/gui-aoi.h b/eeshow/gui-aoi.h index 040bc99..83e5719 100644 --- a/eeshow/gui-aoi.h +++ b/eeshow/gui-aoi.h @@ -17,7 +17,7 @@ struct aoi { - int x, y, w, h; /* activation box, eeschema coordinates */ + int x, y, w, h; /* activation box, eeschema coordinates */ /* points to hovered aoi, or NULL */ bool (*hover)(void *user, bool on); diff --git a/eeshow/gui-over.c b/eeshow/gui-over.c index 3a0d295..baedf98 100644 --- a/eeshow/gui-over.c +++ b/eeshow/gui-over.c @@ -124,7 +124,7 @@ struct overlay *overlay_add(struct overlay **overlays, const char *s, { struct overlay *over; struct overlay **anchor; - + over = alloc_type(struct overlay); over->s = stralloc(s); diff --git a/eeshow/gui.c b/eeshow/gui.c index c8b4d51..f1986b2 100644 --- a/eeshow/gui.c +++ b/eeshow/gui.c @@ -153,7 +153,7 @@ static void pan_update(struct gui_ctx *ctx, int x, int y) { if (!ctx->panning) return; - + ctx->x -= (x - ctx->pan_x) << ctx->zoom; ctx->y -= (y - ctx->pan_y) << ctx->zoom; ctx->pan_x = x; @@ -433,7 +433,7 @@ static void select_subsheet(void *user) const struct sheet_aoi_ctx *aoi_ctx = user; struct gui_ctx *ctx = aoi_ctx->gui_ctx; const struct sch_obj *obj = aoi_ctx->obj; - struct gui_sheet *sheet; + struct gui_sheet *sheet; for (sheet = ctx->sheets; sheet; sheet = sheet->next) if (sheet->sch == obj->u.sheet.sheet) { diff --git a/eeshow/lib-parse.c b/eeshow/lib-parse.c index df20f9c..3dde578 100644 --- a/eeshow/lib-parse.c +++ b/eeshow/lib-parse.c @@ -235,7 +235,7 @@ static bool lib_parse_line(const struct file *file, return 1; } if (sscanf(line, "X %ms %ms %d %d %d %c %d %d %u %u %c", - &obj->u.pin.name, &obj->u.pin.number, + &obj->u.pin.name, &obj->u.pin.number, &obj->u.pin.x, &obj->u.pin.y, &obj->u.pin.length, &obj->u.pin.orient, &obj->u.pin.number_size, &obj->u.pin.name_size, diff --git a/eeshow/lib.h b/eeshow/lib.h index 04121e5..4bd4029 100644 --- a/eeshow/lib.h +++ b/eeshow/lib.h @@ -91,7 +91,7 @@ struct comp { const char *name; unsigned units; - unsigned visible; /* visible fields, bit mask */ + unsigned visible; /* visible fields, bit mask */ bool show_pin_name; bool show_pin_num; unsigned name_offset; diff --git a/eeshow/sch2pdf b/eeshow/sch2pdf index 8e3c275..c085246 100755 --- a/eeshow/sch2pdf +++ b/eeshow/sch2pdf @@ -84,7 +84,7 @@ while read line; do $quiet || echo "$file" 1>&2 ./eeshow $libs `dirname "$1"`/$file \ - -- fig $template "TITLE=$name" NUMBER=$num | + -- fig $template "TITLE=$name" NUMBER=$num | fig2dev -L pdf >_tmp.pdf pdfunite "$out" _tmp.pdf _tmp2.pdf mv _tmp2.pdf "$out" diff --git a/eeshow/text.h b/eeshow/text.h index 05f1ffb..560a1a7 100644 --- a/eeshow/text.h +++ b/eeshow/text.h @@ -28,11 +28,11 @@ enum text_style { }; struct text { - const char *s; + const char *s; int size; - int x, y; - int rot; - enum text_align hor; + int x, y; + int rot; + enum text_align hor; enum text_align vert; };