mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-17 21:46:15 +02:00
eeshow/fmt-pango.c, fmt-pango.h: also move to gui/
This commit is contained in:
parent
4d40267974
commit
b9329b09d2
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
NAME = eeshow
|
NAME = eeshow
|
||||||
OBJS = main.o sch-parse.o sch-render.o lib-parse.o lib-render.o \
|
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 \
|
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
|
style.o fig.o record.o cro.o diff.o gfx.o dwg.o text.o misc.o diag.o
|
||||||
|
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "diag.h"
|
#include "diag.h"
|
||||||
#include "fmt-pango.h" /* for vcs_long_for_pango */
|
|
||||||
#include "git-util.h"
|
#include "git-util.h"
|
||||||
#include "git-file.h"
|
#include "git-file.h"
|
||||||
#include "git-hist.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.
|
* 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;
|
const git_error *e;
|
||||||
git_buf buf = { 0 };
|
git_buf buf = { 0 };
|
||||||
@ -225,7 +225,7 @@ char *vcs_git_long_for_pango(struct hist *h)
|
|||||||
goto fail;
|
goto fail;
|
||||||
commit_time = git_commit_time(h->commit);
|
commit_time = git_commit_time(h->commit);
|
||||||
sig = git_commit_committer(h->commit);
|
sig = git_commit_committer(h->commit);
|
||||||
s = fmt_pango("<b>%s</b> %s%s <%s><small>\n%s</small>",
|
s = formatter("<b>%s</b> %s%s <%s><small>\n%s</small>",
|
||||||
buf.ptr, ctime(&commit_time), sig->name, sig->email,
|
buf.ptr, ctime(&commit_time), sig->name, sig->email,
|
||||||
git_commit_summary(h->commit));
|
git_commit_summary(h->commit));
|
||||||
git_buf_free(&buf);
|
git_buf_free(&buf);
|
||||||
|
@ -35,7 +35,8 @@ bool vcs_git_try(const char *path);
|
|||||||
struct hist *vcs_git_hist(const char *path);
|
struct hist *vcs_git_hist(const char *path);
|
||||||
char *vcs_git_get_rev(struct hist *h);
|
char *vcs_git_get_rev(struct hist *h);
|
||||||
const char *vcs_git_summary(struct hist *hist);
|
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 hist_iterate(struct hist *h,
|
||||||
void (*fn)(void *user, struct hist *h), void *user);
|
void (*fn)(void *user, struct hist *h), void *user);
|
||||||
void dump_hist(struct hist *h);
|
void dump_hist(struct hist *h);
|
||||||
|
@ -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
|
* Written 2016 by Werner Almesberger
|
||||||
* Copyright 2016 by Werner Almesberger
|
* Copyright 2016 by Werner Almesberger
|
||||||
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "diag.h"
|
#include "diag.h"
|
||||||
#include "fmt-pango.h"
|
#include "gui/fmt-pango.h"
|
||||||
|
|
||||||
|
|
||||||
unsigned vsfmt_pango(char *buf, const char *fmt, va_list ap)
|
unsigned vsfmt_pango(char *buf, const char *fmt, va_list ap)
|
@ -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
|
* Written 2016 by Werner Almesberger
|
||||||
* Copyright 2016 by Werner Almesberger
|
* Copyright 2016 by Werner Almesberger
|
||||||
@ -11,8 +11,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef FMT_PANGO_H
|
#ifndef GUI_FMT_PANGO_H
|
||||||
#define FMT_PANGO_H
|
#define GUI_FMT_PANGO_H
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
@ -22,4 +22,4 @@ char *vfmt_pango(const char *fmt, va_list ap);
|
|||||||
char *fmt_pango(const char *fmt, ...)
|
char *fmt_pango(const char *fmt, ...)
|
||||||
__attribute__((format(printf, 1, 2)));
|
__attribute__((format(printf, 1, 2)));
|
||||||
|
|
||||||
#endif /* !FMT_PANGO_H */
|
#endif /* !GUI_FMT_PANGO_H */
|
@ -38,6 +38,7 @@
|
|||||||
#include "delta.h"
|
#include "delta.h"
|
||||||
#include "diff.h"
|
#include "diff.h"
|
||||||
#include "dwg.h"
|
#include "dwg.h"
|
||||||
|
#include "gui/fmt-pango.h"
|
||||||
#include "gui/aoi.h"
|
#include "gui/aoi.h"
|
||||||
#include "gui/style.h"
|
#include "gui/style.h"
|
||||||
#include "gui/over.h"
|
#include "gui/over.h"
|
||||||
@ -489,7 +490,7 @@ static bool hover_history(void *user, bool on)
|
|||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
if (on) {
|
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);
|
overlay_text_raw(h->over, s);
|
||||||
free(s);
|
free(s);
|
||||||
} else {
|
} else {
|
||||||
@ -680,7 +681,7 @@ static bool show_history_details(void *user, bool on)
|
|||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
if (on) {
|
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);
|
overlay_text_raw(h->over, s);
|
||||||
free(s);
|
free(s);
|
||||||
} else {
|
} else {
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include <pango/pangocairo.h>
|
#include <pango/pangocairo.h>
|
||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "fmt-pango.h"
|
#include "gui/fmt-pango.h"
|
||||||
#include "gui/aoi.h"
|
#include "gui/aoi.h"
|
||||||
#include "gui/style.h"
|
#include "gui/style.h"
|
||||||
#include "gui/over.h"
|
#include "gui/over.h"
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include "lib.h"
|
#include "lib.h"
|
||||||
#include "sch.h"
|
#include "sch.h"
|
||||||
#include "fmt-pango.h"
|
#include "gui/fmt-pango.h"
|
||||||
#include "git-hist.h"
|
#include "git-hist.h"
|
||||||
#include "gui/gui.h"
|
#include "gui/gui.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user