Compare commits
No commits in common. "master" and "1" have entirely different histories.
25
LICENSE
25
LICENSE
@ -1,6 +1,6 @@
|
||||
ISC-License
|
||||
|
||||
(c) 2014-2017 Markus Teich <markus.teich@stusta.mhn.de>
|
||||
(c) 2014-2016 Markus Teich <markus.teich@stusta.mhn.de>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
@ -14,16 +14,15 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
(c) 2016,2017 Laslo Hunhold <dev@frign.de>
|
||||
(c) 2016 ssd <ssd@mailless.org>
|
||||
(c) 2016 Hiltjo Posthuma <hiltjo@codemadness.org>
|
||||
(c) 2015 David Phillips <dbphillipsnz@gmail.com>
|
||||
(c) 2015 Grant Mathews <grant.m.mathews@gmail.com>
|
||||
(c) 2015 Dimitris Papastamos <sin@2f30.org>
|
||||
(c) 2015 Alexis <surryhill@gmail.com>
|
||||
(c) 2015 Quentin Rameau <quinq@fifth.space>
|
||||
(c) 2015 Ivan Tham <pickfire@riseup.net>
|
||||
(c) 2015 Jan Christoph Ebersbach <jceb@e-jc.de>
|
||||
(c) 2015 Tony Lainson <t.lainson@gmail.com>
|
||||
(c) 2015 Szabolcs Nagy <nsz@port70.net>
|
||||
(c) 2015 Jonas Jelten <jj@sft.mx>
|
||||
(c) 2015 Szabolcs Nagy <nsz@port70.net>
|
||||
(c) 2015 Tony Lainson <t.lainson@gmail.com>
|
||||
(c) 2015 Jan Christoph Ebersbach <jceb@e-jc.de>
|
||||
(c) 2015 Ivan Tham <pickfire@riseup.net>
|
||||
(c) 2015 Quentin Rameau <quinq@fifth.space>
|
||||
(c) 2015 Alexis <surryhill@gmail.com>
|
||||
(c) 2015 Dimitris Papastamos <sin@2f30.org>
|
||||
(c) 2015 Grant Mathews <grant.m.mathews@gmail.com>
|
||||
(c) 2015 David Phillips <dbphillipsnz@gmail.com>
|
||||
(c) 2016 Laslo Hunhold <dev@frign.de>
|
||||
(c) 2016 Hiltjo Posthuma <hiltjo@codemadness.org>
|
||||
|
40
Makefile
40
Makefile
@ -18,35 +18,43 @@ config.h:
|
||||
cp config.def.h config.h
|
||||
|
||||
.c.o:
|
||||
${CC} -c ${CFLAGS} $<
|
||||
@echo CC $<
|
||||
@${CC} -c ${CFLAGS} $<
|
||||
|
||||
${OBJ}: config.h config.mk
|
||||
|
||||
sent: ${OBJ}
|
||||
${CC} -o $@ ${OBJ} ${LDFLAGS}
|
||||
@echo CC -o $@
|
||||
@${CC} -o $@ ${OBJ} ${LDFLAGS}
|
||||
|
||||
cscope: ${SRC} config.h
|
||||
cscope -R -b || echo cScope not installed
|
||||
@echo cScope
|
||||
@cscope -R -b || echo cScope not installed
|
||||
|
||||
clean:
|
||||
rm -f sent ${OBJ} sent-${VERSION}.tar.gz
|
||||
@echo cleaning
|
||||
@rm -f sent ${OBJ} sent-${VERSION}.tar.gz
|
||||
|
||||
dist: clean
|
||||
mkdir -p sent-${VERSION}
|
||||
cp -R LICENSE Makefile config.mk config.def.h ${SRC} sent-${VERSION}
|
||||
tar -cf sent-${VERSION}.tar sent-${VERSION}
|
||||
gzip sent-${VERSION}.tar
|
||||
rm -rf sent-${VERSION}
|
||||
@echo creating dist tarball
|
||||
@mkdir -p sent-${VERSION}
|
||||
@cp -R LICENSE Makefile config.mk config.def.h ${SRC} sent-${VERSION}
|
||||
@tar -cf sent-${VERSION}.tar sent-${VERSION}
|
||||
@gzip sent-${VERSION}.tar
|
||||
@rm -rf sent-${VERSION}
|
||||
|
||||
install: all
|
||||
mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||
cp -f sent ${DESTDIR}${PREFIX}/bin
|
||||
chmod 755 ${DESTDIR}${PREFIX}/bin/sent
|
||||
mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
||||
cp sent.1 ${DESTDIR}${MANPREFIX}/man1/sent.1
|
||||
chmod 644 ${DESTDIR}${MANPREFIX}/man1/sent.1
|
||||
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
|
||||
@mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||
@cp -f sent ${DESTDIR}${PREFIX}/bin
|
||||
@chmod 755 ${DESTDIR}${PREFIX}/bin/sent
|
||||
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
|
||||
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
||||
@cp sent.1 ${DESTDIR}${MANPREFIX}/man1/sent.1
|
||||
@chmod 644 ${DESTDIR}${MANPREFIX}/man1/sent.1
|
||||
|
||||
uninstall:
|
||||
rm -f ${DESTDIR}${PREFIX}/bin/sent
|
||||
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
|
||||
@rm -f ${DESTDIR}${PREFIX}/bin/sent
|
||||
|
||||
.PHONY: all options clean dist install uninstall cscope
|
||||
|
22
sent.1
22
sent.1
@ -1,6 +1,5 @@
|
||||
.Dd August 12, 2016
|
||||
.Dd 2016-08-12
|
||||
.Dt SENT 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm sent
|
||||
.Nd simple plaintext presentation tool
|
||||
@ -11,14 +10,13 @@
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
is a simple plain text presentation tool for X. sent does not need LaTeX,
|
||||
LibreOffice or any other fancy file format.
|
||||
Instead, sent reads plain text describing the slides. sent can also draw
|
||||
images.
|
||||
LibreOffice or any other fancy file format. Instead, sent reads plain text
|
||||
describing the slides. sent can also draw images.
|
||||
.Pp
|
||||
Every paragraph represents a slide in the presentation.
|
||||
Especially for presentations using the Takahashi method this is very nice and
|
||||
allows you to write the presentation for a quick lightning talk within a few
|
||||
minutes.
|
||||
Every paragraph represents a slide in the presentation. Especially for
|
||||
presentations using the Takahashi method this is very nice and allows
|
||||
you to write the presentation for a quick lightning talk within a
|
||||
few minutes.
|
||||
.Sh OPTIONS
|
||||
.Bl -tag -width Ds
|
||||
.It Fl v
|
||||
@ -38,8 +36,7 @@ Go to previous slide, if existent.
|
||||
.It Sy Escape | q
|
||||
Quit.
|
||||
.It Sy r
|
||||
Reload the slides.
|
||||
Only works on file input.
|
||||
Reload the slides. Only works on file input.
|
||||
.It Sy Right | Return | Space | l | j | Down | Next | n
|
||||
Go to next slide, if existent.
|
||||
.It Sy Left | Backspace | h | k | Up | Prior | p
|
||||
@ -66,7 +63,6 @@ without interpreting them.
|
||||
.Sh CUSTOMIZATION
|
||||
.Nm
|
||||
can be customized by creating a custom config.h and (re)compiling the
|
||||
source code.
|
||||
This keeps it fast, secure and simple.
|
||||
source code. This keeps it fast, secure and simple.
|
||||
.Sh SEE ALSO
|
||||
.Xr 2ff 1
|
||||
|
43
sent.c
43
sent.c
@ -99,12 +99,12 @@ static void load(FILE *fp);
|
||||
static void advance(const Arg *arg);
|
||||
static void quit(const Arg *arg);
|
||||
static void resize(int width, int height);
|
||||
static void run(void);
|
||||
static void usage(void);
|
||||
static void xdraw(void);
|
||||
static void xhints(void);
|
||||
static void xinit(void);
|
||||
static void xloadfonts(void);
|
||||
static void run();
|
||||
static void usage();
|
||||
static void xdraw();
|
||||
static void xhints();
|
||||
static void xinit();
|
||||
static void xloadfonts();
|
||||
|
||||
static void bpress(XEvent *);
|
||||
static void cmessage(XEvent *);
|
||||
@ -216,7 +216,8 @@ ffload(Slide *s)
|
||||
s->img->bufwidth = ntohl(*(uint32_t *)&hdr[8]);
|
||||
s->img->bufheight = ntohl(*(uint32_t *)&hdr[12]);
|
||||
|
||||
free(s->img->buf);
|
||||
if (s->img->buf)
|
||||
free(s->img->buf);
|
||||
/* internally the image is stored in 888 format */
|
||||
s->img->buf = ecalloc(s->img->bufwidth * s->img->bufheight, strlen("888"));
|
||||
|
||||
@ -269,9 +270,6 @@ ffprepare(Image *img)
|
||||
if (depth < 24)
|
||||
die("sent: Display color depths < 24 not supported");
|
||||
|
||||
if (img->ximg)
|
||||
XDestroyImage(img->ximg);
|
||||
|
||||
if (!(img->ximg = XCreateImage(xw.dpy, CopyFromParent, depth, ZPixmap, 0,
|
||||
NULL, width, height, 32, 0)))
|
||||
die("sent: Unable to create XImage");
|
||||
@ -430,10 +428,6 @@ load(FILE *fp)
|
||||
maxlines = 0;
|
||||
memset((s = &slides[slidecount]), 0, sizeof(Slide));
|
||||
do {
|
||||
/* if there's a leading null, we can't do blen-1 */
|
||||
if (buf[0] == '\0')
|
||||
continue;
|
||||
|
||||
if (buf[0] == '#')
|
||||
continue;
|
||||
|
||||
@ -463,9 +457,6 @@ load(FILE *fp)
|
||||
if (!p)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!slidecount)
|
||||
die("sent: No slides in file");
|
||||
}
|
||||
|
||||
void
|
||||
@ -498,7 +489,7 @@ resize(int width, int height)
|
||||
}
|
||||
|
||||
void
|
||||
run(void)
|
||||
run()
|
||||
{
|
||||
XEvent ev;
|
||||
|
||||
@ -520,7 +511,7 @@ run(void)
|
||||
}
|
||||
|
||||
void
|
||||
xdraw(void)
|
||||
xdraw()
|
||||
{
|
||||
unsigned int height, width, i;
|
||||
Image *im = slides[idx].img;
|
||||
@ -548,7 +539,7 @@ xdraw(void)
|
||||
}
|
||||
|
||||
void
|
||||
xhints(void)
|
||||
xhints()
|
||||
{
|
||||
XClassHint class = {.res_name = "sent", .res_class = "presenter"};
|
||||
XWMHints wm = {.flags = InputHint, .input = True};
|
||||
@ -566,7 +557,7 @@ xhints(void)
|
||||
}
|
||||
|
||||
void
|
||||
xinit(void)
|
||||
xinit()
|
||||
{
|
||||
XTextProperty prop;
|
||||
unsigned int i;
|
||||
@ -610,7 +601,7 @@ xinit(void)
|
||||
}
|
||||
|
||||
void
|
||||
xloadfonts(void)
|
||||
xloadfonts()
|
||||
{
|
||||
int i, j;
|
||||
char *fstrs[LEN(fontfallbacks)];
|
||||
@ -629,7 +620,8 @@ xloadfonts(void)
|
||||
}
|
||||
|
||||
for (j = 0; j < LEN(fontfallbacks); j++)
|
||||
free(fstrs[j]);
|
||||
if (fstrs[j])
|
||||
free(fstrs[j]);
|
||||
}
|
||||
|
||||
void
|
||||
@ -678,7 +670,7 @@ configure(XEvent *e)
|
||||
}
|
||||
|
||||
void
|
||||
usage(void)
|
||||
usage()
|
||||
{
|
||||
die("usage: %s [file]", argv0);
|
||||
}
|
||||
@ -703,6 +695,9 @@ main(int argc, char *argv[])
|
||||
load(fp);
|
||||
fclose(fp);
|
||||
|
||||
if (!slidecount)
|
||||
usage();
|
||||
|
||||
xinit();
|
||||
run();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user