sent.git
8 years agoSimplify LICENSE wording
FRIGN [Thu, 14 Jul 2016 11:05:37 +0000 (13:05 +0200)]
Simplify LICENSE wording

Now, before you call your lawyers, here is some explanation:
The MIT/X Consortium-License and ISC-License are equivalent
according to the Berne-convention. This means that a court
of law presented with either licenses will act the same.

The advantage of the ISC license is that it has a simpler wording
and is recommended by the OpenBSD-project for new projects[0].
And as we at suckless.org love removing cruft, this also includes
removing legal cruft wording that is not needed any more.

[0]: http://www.openbsd.org/policy.html

8 years agoSimplify usage()
FRIGN [Thu, 14 Jul 2016 11:10:34 +0000 (13:10 +0200)]
Simplify usage()

8 years agoUpdate example presentation
Markus Teich [Thu, 14 Jul 2016 10:44:05 +0000 (12:44 +0200)]
Update example presentation

- Add a small transparent farbfeld test image

8 years agoadd ff and ff.bz2 support in config.def.h
FRIGN [Thu, 14 Jul 2016 09:23:17 +0000 (11:23 +0200)]
add ff and ff.bz2 support in config.def.h

9 years agoAlso call ffload on the current slide in advance()
Markus Teich [Thu, 30 Jun 2016 14:57:31 +0000 (16:57 +0200)]
Also call ffload on the current slide in advance()

This fixes a bug where the image would not be loaded if the user setup a
keybinding which advances multiple slides at once. Then the preloading for the
previous/next slide in advance() would not catch that case and instead of an
image the text version (`@filename`) would be rendered on the slide.

9 years agoclean ffread and rename to ffload
Markus Teich [Thu, 30 Jun 2016 14:42:34 +0000 (16:42 +0200)]
clean ffread and rename to ffload

- also remove unneeded memmove in load()

9 years agoload slide image on-demand
Hiltjo Posthuma [Sat, 4 Jun 2016 19:47:39 +0000 (21:47 +0200)]
load slide image on-demand

On Sat, Jun 04, 2016 at 05:28:31PM +0200, Markus Teich wrote:
> Hiltjo Posthuma wrote:
> > previously an image file would be opened but only ffread when advancing to
> > the slide, but when the slide was not used it gave an error:
> >
> >  /usr/local/bin/2ff: failed to convert image/png
>
> Heyho Hiltjo,
>
> thanks for the patch. Unfortunately it does not work if the first slide contains
> an image (ffopen is only called in advance). I think it would be good to merge
> ffopen and ffread instead into a single function ffload. This makes the `LOADED`
> state clearer and also enforces that the fd is closed in the same function where
> it is opened. This ffload function should then be called in advance() replacing
> the ffread() calls if the image is not loaded yet and once in load() for the
> first slide if it is an image.
>

Ah yes, sorry for the oversight.

> If you want to take this new approach, go for it, otherwise I'll look into it
> myself.
>

I have attached a patch that does this, I hope you'll like it.

Also I'm not sure if we need the below code in advance(), I have removed it in
the patch:

        if (slidecount > idx + 1 && slides[idx + 1].img)
                ffread(slides[idx + 1].img);
        if (0 < idx && slides[idx - 1].img)
                ffread(slides[idx - 1].img);

That seems to preload the next and previous slide image right? A minor issue I
notice also is that images seem to flicker, it uses XPutImage directly to
xw.win. Maybe it can be replaced with a backbuffer then XCopyArea? What do you
think?

In advance() it should also not always be needed to rescale the image.

--
Kind regards,
Hiltjo

From 97bebdcab4003f9acdfdd4bdf424449299ffd61d Mon Sep 17 00:00:00 2001
From: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 4 Jun 2016 21:34:25 +0200
Subject: [PATCH] merge ffread and ffopen into one function

9 years agoload slide image on-demand
Hiltjo Posthuma [Sat, 4 Jun 2016 14:33:15 +0000 (16:33 +0200)]
load slide image on-demand

previously an image file would be opened but only ffread when advancing to
the slide, but when the slide was not used it gave an error:

/usr/local/bin/2ff: failed to convert image/png

this changes it to load the image on-demand once and "cache" it.

9 years agoimport new drw and util from libsl.
Markus Teich [Sat, 21 May 2016 19:39:58 +0000 (21:39 +0200)]
import new drw and util from libsl.

9 years agofix include and lib paths for the BSDs
Markus Teich [Tue, 15 Mar 2016 22:51:30 +0000 (23:51 +0100)]
fix include and lib paths for the BSDs

9 years agosupport FreeBSD
Markus Teich [Tue, 15 Mar 2016 19:21:54 +0000 (20:21 +0100)]
support FreeBSD

On FreeBSD the lib and include directories are in /usr/local rather than /usr.

9 years agoImport arg.h OOB fix from Lucas Gabriel Vuotto.
Markus Teich [Sun, 6 Mar 2016 19:56:29 +0000 (20:56 +0100)]
Import arg.h OOB fix from Lucas Gabriel Vuotto.

This is a small fix for arg.h where it's possible to perform an out-of-boundary
memory access in argv's internal string.

9 years agoFix cmdline argument check
Markus Teich [Sun, 6 Mar 2016 19:49:18 +0000 (20:49 +0100)]
Fix cmdline argument check

There was a segfault when sent was called without arguments. Now we use stdin
when there's no argument or - is used. Thanks to izabera for the report.

9 years agono need to reimplement cat here
Markus Teich [Sat, 6 Feb 2016 13:12:47 +0000 (14:12 +0100)]
no need to reimplement cat here

9 years agoimprove error handling
Markus Teich [Sat, 6 Feb 2016 13:08:43 +0000 (14:08 +0100)]
improve error handling

- errors are now fatal
- no need to clean up when dying
- no need for status return codes => ffread and ffprepare now return void

9 years agostyle: move function return types to own line
Markus Teich [Fri, 5 Feb 2016 15:17:43 +0000 (16:17 +0100)]
style: move function return types to own line

9 years agoUse 2ff exclusively in config.def.h
FRIGN [Sun, 31 Jan 2016 10:09:23 +0000 (11:09 +0100)]
Use 2ff exclusively in config.def.h

9 years agoFix alpha blending
FRIGN [Sun, 31 Jan 2016 10:05:00 +0000 (11:05 +0100)]
Fix alpha blending

- "/ 257", because 255 * 257 = UINT16_MAX
- "/ 255", because that's the maximum possible RGB value

9 years agoreadme: update reference to farbfeld
Markus Teich [Fri, 5 Feb 2016 14:25:29 +0000 (15:25 +0100)]
readme: update reference to farbfeld

9 years agoChange an eprintf to a die to stop child from running its own slideshow
David Phillips [Thu, 10 Dec 2015 23:23:45 +0000 (12:23 +1300)]
Change an eprintf to a die to stop child from running its own slideshow

The child thread was created because execlp will not return if successful.
The eprintf was placed after the call to execlp to catch any error, but the
child continued to return a (closed) fds[0], resulting in a second slideshow
being run by the child.

This commit fixes the issue by killing the child.

9 years agofilter via shell pipeline
Grant Mathews [Thu, 10 Dec 2015 04:56:07 +0000 (20:56 -0800)]
filter via shell pipeline

Instead of requiring an executable, allow building arbitrary shell
pipelines to filter filetypes through.

9 years agounbreak the build
Markus Teich [Tue, 8 Dec 2015 23:52:39 +0000 (00:52 +0100)]
unbreak the build

9 years agofix 2 uninitialized variables and bin == NULL check
Markus Teich [Tue, 8 Dec 2015 23:50:05 +0000 (00:50 +0100)]
fix 2 uninitialized variables and bin == NULL check

9 years agocheck for bin == NULL
Markus Teich [Tue, 8 Dec 2015 21:34:48 +0000 (22:34 +0100)]
check for bin == NULL

9 years agominor syntax, style and README fixes
Markus Teich [Tue, 8 Dec 2015 21:09:26 +0000 (22:09 +0100)]
minor syntax, style and README fixes

9 years agosupport transparent images
Markus Teich [Tue, 8 Dec 2015 20:46:18 +0000 (21:46 +0100)]
support transparent images

9 years agoSupport farbfeld as an intermediate format
sin [Wed, 18 Nov 2015 10:41:02 +0000 (10:41 +0000)]
Support farbfeld as an intermediate format

Sent now uses farbfeld[0] as an intermediate format.  A series of
filters is specified in config.h that matches file extensions to
filter programs.  The programs will convert between formats such as
png to farbfeld.  Internally in sent we do not need to worry on how
to parse png or any other format.

This also works with jpg and gif and others.  The 2ff wrapper will
use imagemagick conversion tools.  This is temporary as jpg2ff and
gif2ff will also be implemented.

To make this work, you will have to clone[0] and put png2ff and 2ff
in your PATH.

[0] http://git.2f30.org/farbfeld/

9 years agoadd 'sent: ' prefix to errors
Markus Teich [Thu, 3 Dec 2015 21:59:29 +0000 (22:59 +0100)]
add 'sent: ' prefix to errors

9 years agoAdd 'n' and 'p' keys to navigate slides
Alexis [Thu, 26 Nov 2015 14:22:01 +0000 (15:22 +0100)]
Add 'n' and 'p' keys to navigate slides

9 years agoRefactor die() to use eprintf()
Alexis [Thu, 26 Nov 2015 14:20:09 +0000 (15:20 +0100)]
Refactor die() to use eprintf()

9 years agoUse consistent wording for error messages
Alexis [Thu, 26 Nov 2015 14:18:44 +0000 (15:18 +0100)]
Use consistent wording for error messages

9 years agoUse right click as previous and enable scrolling to switch slides
Ivan Tham [Thu, 19 Nov 2015 13:13:25 +0000 (21:13 +0800)]
Use right click as previous and enable scrolling to switch slides

9 years agoBail out before allocating slides if file is empty
Quentin Rameau [Wed, 18 Nov 2015 22:21:33 +0000 (23:21 +0100)]
Bail out before allocating slides if file is empty

In load() we allocated slides before checking if we actually read
anything from the FILE fp and then continue with an allocated but
“empty” space wich would lead to errors.

9 years agofix dying on empty slidefile
Markus Teich [Wed, 18 Nov 2015 22:24:53 +0000 (23:24 +0100)]
fix dying on empty slidefile

9 years agodrw.c: Avoid potential memory leak in drw_cur_create()
Quentin Rameau [Wed, 18 Nov 2015 21:45:26 +0000 (22:45 +0100)]
drw.c: Avoid potential memory leak in drw_cur_create()

If drw was NULL, memory was still allocated for cur.

9 years agoAdd Escape key to quit sent
Ivan Tham [Wed, 18 Nov 2015 02:01:50 +0000 (10:01 +0800)]
Add Escape key to quit sent

9 years agodie if no font could be loaded
Markus Teich [Tue, 17 Nov 2015 23:41:38 +0000 (00:41 +0100)]
die if no font could be loaded

9 years agoRegister space to advance to the next slide
Jan Christoph Ebersbach [Tue, 17 Nov 2015 05:42:34 +0000 (06:42 +0100)]
Register space to advance to the next slide

9 years agoshorten bulletpoints in example presentation
Markus Teich [Tue, 17 Nov 2015 01:26:34 +0000 (02:26 +0100)]
shorten bulletpoints in example presentation

9 years agofix dejavu font name
Markus Teich [Tue, 17 Nov 2015 01:07:56 +0000 (02:07 +0100)]
fix dejavu font name

9 years agosupport even larger screens
Markus Teich [Tue, 17 Nov 2015 00:39:40 +0000 (01:39 +0100)]
support even larger screens

9 years agoprevent flickering when changing slides
Markus Teich [Tue, 17 Nov 2015 00:00:30 +0000 (01:00 +0100)]
prevent flickering when changing slides

When the window background is left at WhitePixel (from initialization) and the
user has set a dark background color in config.h, the window shortly displays
the white default background when clearing after advancing to another slide.
This was very disturbing and is fixed now by setting the default window
background color to the bgcol chosen in config.h.

9 years agoupdate README
Markus Teich [Mon, 16 Nov 2015 23:32:45 +0000 (00:32 +0100)]
update README

9 years agofix another index overflow issue
Markus Teich [Mon, 16 Nov 2015 23:23:51 +0000 (00:23 +0100)]
fix another index overflow issue

9 years agofix several number overflow issues
Markus Teich [Mon, 16 Nov 2015 23:19:39 +0000 (00:19 +0100)]
fix several number overflow issues

9 years agoupdate version
Markus Teich [Mon, 16 Nov 2015 23:18:54 +0000 (00:18 +0100)]
update version

9 years agoadd multiline support
Markus Teich [Sat, 7 Nov 2015 22:54:23 +0000 (23:54 +0100)]
add multiline support

9 years agofix more memory leaks
Markus Teich [Wed, 11 Nov 2015 18:09:13 +0000 (19:09 +0100)]
fix more memory leaks

9 years agofree all fonts correctly
Markus Teich [Wed, 11 Nov 2015 18:00:54 +0000 (19:00 +0100)]
free all fonts correctly

9 years agofree temporary fontstr arrays
Markus Teich [Wed, 11 Nov 2015 17:53:54 +0000 (18:53 +0100)]
free temporary fontstr arrays

9 years agosimplify png cleanup
Markus Teich [Wed, 11 Nov 2015 17:49:57 +0000 (18:49 +0100)]
simplify png cleanup

9 years agomake usable screensize config const
Markus Teich [Wed, 11 Nov 2015 17:41:51 +0000 (18:41 +0100)]
make usable screensize config const

9 years agodon't assume we get a ConfigureNotify event
Tony Lainson [Tue, 10 Nov 2015 03:54:16 +0000 (14:54 +1100)]
don't assume we get a ConfigureNotify event

If the window manager maps our window at the requested size, we may not get a
ConfigureNotify event.  This happens e.g. under ratpoison.

The result is that xw.uw and xw.uh are never set, so text is too small and
pngscale() tries to divide by 0.

9 years agoinitialize .img
Szabolcs Nagy [Mon, 9 Nov 2015 01:58:26 +0000 (02:58 +0100)]
initialize .img

without the attached patch ./sent example segfaults here

9 years agodon't use EXIT_… cpp defines
Markus Teich [Sat, 7 Nov 2015 22:52:35 +0000 (23:52 +0100)]
don't use EXIT_… cpp defines

9 years agofix comment wording in drw.c
Markus Teich [Sat, 7 Nov 2015 22:48:40 +0000 (23:48 +0100)]
fix comment wording in drw.c

9 years agomake colors configurable
Markus Teich [Wed, 4 Nov 2015 00:43:13 +0000 (01:43 +0100)]
make colors configurable

9 years agoupdate license year
Markus Teich [Wed, 4 Nov 2015 00:40:50 +0000 (01:40 +0100)]
update license year

9 years agofix default fonts in config.def.h
Markus Teich [Sun, 1 Nov 2015 17:09:22 +0000 (18:09 +0100)]
fix default fonts in config.def.h

9 years agoremove unused font configuration, update license year
Markus Teich [Sat, 31 Oct 2015 17:10:47 +0000 (18:10 +0100)]
remove unused font configuration, update license year

9 years agofix font width calculations
Markus Teich [Sat, 31 Oct 2015 17:07:07 +0000 (18:07 +0100)]
fix font width calculations

9 years agoremove unused type qualifiers
Markus Teich [Sat, 31 Oct 2015 15:25:02 +0000 (16:25 +0100)]
remove unused type qualifiers

9 years agoupdate example presentation
Markus Teich [Sat, 31 Oct 2015 15:24:38 +0000 (16:24 +0100)]
update example presentation

9 years agofonts are automatically cleaned up
Markus Teich [Sat, 29 Aug 2015 00:24:42 +0000 (02:24 +0200)]
fonts are automatically cleaned up

10 years agodrw_resize should be called on mapping as well
Markus Teich [Sun, 3 May 2015 20:07:51 +0000 (22:07 +0200)]
drw_resize should be called on mapping as well

10 years agoremove debug statement
Markus Teich [Sat, 2 May 2015 11:29:03 +0000 (13:29 +0200)]
remove debug statement

10 years agotypedef image struct
Markus Teich [Fri, 1 May 2015 19:34:52 +0000 (21:34 +0200)]
typedef image struct

10 years agominor style adaptions
Markus Teich [Thu, 30 Apr 2015 20:00:14 +0000 (22:00 +0200)]
minor style adaptions

10 years agofonts cleanup
Markus Teich [Mon, 27 Apr 2015 22:27:43 +0000 (00:27 +0200)]
fonts cleanup

10 years agoremove unused dc/gc variables
Markus Teich [Mon, 27 Apr 2015 21:26:03 +0000 (23:26 +0200)]
remove unused dc/gc variables

10 years agoremove utf8 support from todo list
Markus Teich [Sun, 26 Apr 2015 18:40:42 +0000 (20:40 +0200)]
remove utf8 support from todo list

10 years agoremove old stuff and fix warnings
Markus Teich [Sat, 25 Apr 2015 18:18:43 +0000 (20:18 +0200)]
remove old stuff and fix warnings

10 years agoblank screen before drawing text
Markus Teich [Wed, 22 Apr 2015 09:57:08 +0000 (11:57 +0200)]
blank screen before drawing text

10 years agofix calculation of correct font size to use
Markus Teich [Wed, 22 Apr 2015 09:56:41 +0000 (11:56 +0200)]
fix calculation of correct font size to use

10 years agodrw: fixup font handling
Markus Teich [Tue, 21 Apr 2015 20:57:52 +0000 (22:57 +0200)]
drw: fixup font handling

10 years agouse new font system from drw
Markus Teich [Mon, 20 Apr 2015 20:20:16 +0000 (22:20 +0200)]
use new font system from drw

10 years agominor style fix and new var for fonts
Markus Teich [Sun, 19 Apr 2015 15:36:18 +0000 (17:36 +0200)]
minor style fix and new var for fonts

10 years agodrw: fixup drw_rect function
Markus Teich [Sun, 12 Apr 2015 20:56:56 +0000 (22:56 +0200)]
drw: fixup drw_rect function

10 years agouse die() where it should be used
Markus Teich [Sat, 11 Apr 2015 10:05:39 +0000 (12:05 +0200)]
use die() where it should be used

10 years agouse drw color scheme fixup
Markus Teich [Fri, 10 Apr 2015 21:13:33 +0000 (23:13 +0200)]
use drw color scheme fixup

10 years agodrw: fixup color schemes
Markus Teich [Fri, 10 Apr 2015 21:12:50 +0000 (23:12 +0200)]
drw: fixup color schemes

10 years agosome work on using drw.c done
Markus Teich [Thu, 9 Apr 2015 17:23:31 +0000 (19:23 +0200)]
some work on using drw.c done

10 years agodrw: fixup font_getexts
Markus Teich [Wed, 8 Apr 2015 19:13:45 +0000 (21:13 +0200)]
drw: fixup font_getexts

10 years agoadd utf8 support, scaling and positioning missing.
Markus Teich [Tue, 7 Apr 2015 20:03:02 +0000 (22:03 +0200)]
add utf8 support, scaling and positioning missing.

10 years agoinit and clear drw context
Markus Teich [Mon, 6 Apr 2015 21:06:36 +0000 (23:06 +0200)]
init and clear drw context

10 years agoprepare switch to libsl
Markus Teich [Sun, 5 Apr 2015 13:48:47 +0000 (15:48 +0200)]
prepare switch to libsl

10 years agoupdate TODO
Markus Teich [Tue, 3 Mar 2015 18:40:07 +0000 (19:40 +0100)]
update TODO

10 years agoupdate example
Markus Teich [Mon, 19 Jan 2015 17:39:04 +0000 (18:39 +0100)]
update example

10 years agosupport for comments to ignore lines
Jonas Jelten [Mon, 19 Jan 2015 03:28:24 +0000 (04:28 +0100)]
support for comments to ignore lines

use # as first character in a line to skip this line
from the slides.

10 years agomake: fix warnings because of BSD_SOURCE
Jonas Jelten [Mon, 19 Jan 2015 03:28:11 +0000 (04:28 +0100)]
make: fix warnings because of BSD_SOURCE

10 years agomake: don't build cscope by default
Jonas Jelten [Mon, 19 Jan 2015 03:27:54 +0000 (04:27 +0100)]
make: don't build cscope by default

11 years agoupdate README
Markus Teich [Sun, 29 Jun 2014 21:48:49 +0000 (23:48 +0200)]
update README

11 years agolarge jumps don't work well with presenters
Markus Teich [Sun, 29 Jun 2014 21:45:04 +0000 (23:45 +0200)]
large jumps don't work well with presenters

11 years agoadd png support
Markus Teich [Sun, 29 Jun 2014 21:43:01 +0000 (23:43 +0200)]
add png support

11 years agoadd further instructions for missing font path
Markus Teich [Mon, 23 Jun 2014 19:41:38 +0000 (21:41 +0200)]
add further instructions for missing font path

11 years agoadd explanation to example presentation
Markus Teich [Mon, 23 Jun 2014 12:30:46 +0000 (14:30 +0200)]
add explanation to example presentation

11 years agoadd note to scalable fonts in config.def.h
Markus Teich [Mon, 23 Jun 2014 09:58:33 +0000 (11:58 +0200)]
add note to scalable fonts in config.def.h

11 years agoadd configuration explanation to README
Markus Teich [Mon, 23 Jun 2014 09:57:19 +0000 (11:57 +0200)]
add configuration explanation to README

11 years agofix Makefile for users w/o cscope
Markus Teich [Mon, 23 Jun 2014 09:55:38 +0000 (11:55 +0200)]
fix Makefile for users w/o cscope

11 years agoadd link to takahashi method
Markus Teich [Mon, 23 Jun 2014 09:54:02 +0000 (11:54 +0200)]
add link to takahashi method