1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-09-30 02:19:27 +03:00

eeshow/fmt-pango.c, fmt-pango.h: also move to gui/

This commit is contained in:
Werner Almesberger 2016-08-17 21:00:02 -03:00
parent 4d40267974
commit b9329b09d2
8 changed files with 17 additions and 15 deletions

View File

@ -12,7 +12,7 @@
NAME = eeshow
OBJS = main.o sch-parse.o sch-render.o lib-parse.o lib-render.o \
gui/gui.o gui/over.o gui/style.o gui/aoi.o fmt-pango.o \
gui/gui.o gui/over.o gui/style.o gui/aoi.o gui/fmt-pango.o \
file.o git-util.o git-file.o git-hist.o delta.o \
style.o fig.o record.o cro.o diff.o gfx.o dwg.o text.o misc.o diag.o

View File

@ -18,7 +18,6 @@
#include "util.h"
#include "diag.h"
#include "fmt-pango.h" /* for vcs_long_for_pango */
#include "git-util.h"
#include "git-file.h"
#include "git-hist.h"
@ -211,7 +210,8 @@ const char *vcs_git_summary(struct hist *h)
* the very specific constraints imposed by the markup format of Pango.
*/
char *vcs_git_long_for_pango(struct hist *h)
char *vcs_git_long_for_pango(struct hist *h,
char *(*formatter)(const char *fmt, ...))
{
const git_error *e;
git_buf buf = { 0 };
@ -225,7 +225,7 @@ char *vcs_git_long_for_pango(struct hist *h)
goto fail;
commit_time = git_commit_time(h->commit);
sig = git_commit_committer(h->commit);
s = fmt_pango("<b>%s</b> %s%s &lt;%s&gt;<small>\n%s</small>",
s = formatter("<b>%s</b> %s%s &lt;%s&gt;<small>\n%s</small>",
buf.ptr, ctime(&commit_time), sig->name, sig->email,
git_commit_summary(h->commit));
git_buf_free(&buf);

View File

@ -35,7 +35,8 @@ bool vcs_git_try(const char *path);
struct hist *vcs_git_hist(const char *path);
char *vcs_git_get_rev(struct hist *h);
const char *vcs_git_summary(struct hist *hist);
char *vcs_git_long_for_pango(struct hist *hist);
char *vcs_git_long_for_pango(struct hist *hist,
char *(*formatter)(const char *fmt, ...));
void hist_iterate(struct hist *h,
void (*fn)(void *user, struct hist *h), void *user);
void dump_hist(struct hist *h);

View File

@ -1,5 +1,5 @@
/*
* fmt-pango.c - Format strings for Pango markup
* gui/fmt-pango.c - Format strings for Pango markup
*
* Written 2016 by Werner Almesberger
* Copyright 2016 by Werner Almesberger
@ -20,7 +20,7 @@
#include "util.h"
#include "diag.h"
#include "fmt-pango.h"
#include "gui/fmt-pango.h"
unsigned vsfmt_pango(char *buf, const char *fmt, va_list ap)

View File

@ -1,5 +1,5 @@
/*
* fmt-pango.h - Format strings for Pango markup
* gui/fmt-pango.h - Format strings for Pango markup
*
* Written 2016 by Werner Almesberger
* Copyright 2016 by Werner Almesberger
@ -11,8 +11,8 @@
*/
#ifndef FMT_PANGO_H
#define FMT_PANGO_H
#ifndef GUI_FMT_PANGO_H
#define GUI_FMT_PANGO_H
#include <stdarg.h>
@ -22,4 +22,4 @@ char *vfmt_pango(const char *fmt, va_list ap);
char *fmt_pango(const char *fmt, ...)
__attribute__((format(printf, 1, 2)));
#endif /* !FMT_PANGO_H */
#endif /* !GUI_FMT_PANGO_H */

View File

@ -38,6 +38,7 @@
#include "delta.h"
#include "diff.h"
#include "dwg.h"
#include "gui/fmt-pango.h"
#include "gui/aoi.h"
#include "gui/style.h"
#include "gui/over.h"
@ -489,7 +490,7 @@ static bool hover_history(void *user, bool on)
char *s;
if (on) {
s = vcs_git_long_for_pango(h->vcs_hist);
s = vcs_git_long_for_pango(h->vcs_hist, fmt_pango);
overlay_text_raw(h->over, s);
free(s);
} else {
@ -680,7 +681,7 @@ static bool show_history_details(void *user, bool on)
char *s;
if (on) {
s = vcs_git_long_for_pango(h->vcs_hist);
s = vcs_git_long_for_pango(h->vcs_hist, fmt_pango);
overlay_text_raw(h->over, s);
free(s);
} else {

View File

@ -31,7 +31,7 @@
#include <pango/pangocairo.h>
#include "util.h"
#include "fmt-pango.h"
#include "gui/fmt-pango.h"
#include "gui/aoi.h"
#include "gui/style.h"
#include "gui/over.h"

View File

@ -28,7 +28,7 @@
#include "file.h"
#include "lib.h"
#include "sch.h"
#include "fmt-pango.h"
#include "gui/fmt-pango.h"
#include "git-hist.h"
#include "gui/gui.h"
#include "main.h"