Markus Teich [Mon, 26 Sep 2016 10:26:11 +0000 (12:26 +0200)]
always redraw images
Previously when covering the sent window with an image slide selected and
exposing it again, the image was lost. This change always redraws the image and
also removes the now redundant bit flag in the state enum.
Hiltjo Posthuma [Fri, 12 Aug 2016 08:57:44 +0000 (10:57 +0200)]
improve some more error messages
- remove \n in die() messages in drw.c
- add a few more ':' suffix for functions that set errno.
- minor typo.
FRIGN [Fri, 12 Aug 2016 09:36:15 +0000 (11:36 +0200)]
Add a manpage
FRIGN [Thu, 11 Aug 2016 19:48:56 +0000 (21:48 +0200)]
Use Plan 9 style for ARGEND
FRIGN [Thu, 11 Aug 2016 19:47:57 +0000 (21:47 +0200)]
Fix error-messages
FRIGN [Thu, 11 Aug 2016 19:30:34 +0000 (21:30 +0200)]
Fix memory leak and print a warning on invalid regex
This will minimize the already low memory usage of sent.
FRIGN [Thu, 11 Aug 2016 19:20:07 +0000 (21:20 +0200)]
_exit() instead of exit() after failed exec
die() calls exit(), but actually at this point the program could be in a
state not allowing this. It's better to call _exit to stop the libc from
calling any handlers that might fail at this moment anyway.
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
FRIGN [Thu, 14 Jul 2016 11:10:34 +0000 (13:10 +0200)]
Simplify usage()
Markus Teich [Thu, 14 Jul 2016 10:44:05 +0000 (12:44 +0200)]
Update example presentation
- Add a small transparent farbfeld test image
FRIGN [Thu, 14 Jul 2016 09:23:17 +0000 (11:23 +0200)]
add ff and ff.bz2 support in config.def.h
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.
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()
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
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.
Markus Teich [Sat, 21 May 2016 19:39:58 +0000 (21:39 +0200)]
import new drw and util from libsl.
Markus Teich [Tue, 15 Mar 2016 22:51:30 +0000 (23:51 +0100)]
fix include and lib paths for the BSDs
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.
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.
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.
Markus Teich [Sat, 6 Feb 2016 13:12:47 +0000 (14:12 +0100)]
no need to reimplement cat here
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
Markus Teich [Fri, 5 Feb 2016 15:17:43 +0000 (16:17 +0100)]
style: move function return types to own line
FRIGN [Sun, 31 Jan 2016 10:09:23 +0000 (11:09 +0100)]
Use 2ff exclusively in config.def.h
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
Markus Teich [Fri, 5 Feb 2016 14:25:29 +0000 (15:25 +0100)]
readme: update reference to farbfeld
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.
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.
Markus Teich [Tue, 8 Dec 2015 23:52:39 +0000 (00:52 +0100)]
unbreak the build
Markus Teich [Tue, 8 Dec 2015 23:50:05 +0000 (00:50 +0100)]
fix 2 uninitialized variables and bin == NULL check
Markus Teich [Tue, 8 Dec 2015 21:34:48 +0000 (22:34 +0100)]
check for bin == NULL
Markus Teich [Tue, 8 Dec 2015 21:09:26 +0000 (22:09 +0100)]
minor syntax, style and README fixes
Markus Teich [Tue, 8 Dec 2015 20:46:18 +0000 (21:46 +0100)]
support transparent images
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/
Markus Teich [Thu, 3 Dec 2015 21:59:29 +0000 (22:59 +0100)]
add 'sent: ' prefix to errors
Alexis [Thu, 26 Nov 2015 14:22:01 +0000 (15:22 +0100)]
Add 'n' and 'p' keys to navigate slides
Alexis [Thu, 26 Nov 2015 14:20:09 +0000 (15:20 +0100)]
Refactor die() to use eprintf()
Alexis [Thu, 26 Nov 2015 14:18:44 +0000 (15:18 +0100)]
Use consistent wording for error messages
Ivan Tham [Thu, 19 Nov 2015 13:13:25 +0000 (21:13 +0800)]
Use right click as previous and enable scrolling to switch slides
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.
Markus Teich [Wed, 18 Nov 2015 22:24:53 +0000 (23:24 +0100)]
fix dying on empty slidefile
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.
Ivan Tham [Wed, 18 Nov 2015 02:01:50 +0000 (10:01 +0800)]
Add Escape key to quit sent
Markus Teich [Tue, 17 Nov 2015 23:41:38 +0000 (00:41 +0100)]
die if no font could be loaded
Jan Christoph Ebersbach [Tue, 17 Nov 2015 05:42:34 +0000 (06:42 +0100)]
Register space to advance to the next slide
Markus Teich [Tue, 17 Nov 2015 01:26:34 +0000 (02:26 +0100)]
shorten bulletpoints in example presentation
Markus Teich [Tue, 17 Nov 2015 01:07:56 +0000 (02:07 +0100)]
fix dejavu font name
Markus Teich [Tue, 17 Nov 2015 00:39:40 +0000 (01:39 +0100)]
support even larger screens
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.
Markus Teich [Mon, 16 Nov 2015 23:32:45 +0000 (00:32 +0100)]
update README
Markus Teich [Mon, 16 Nov 2015 23:23:51 +0000 (00:23 +0100)]
fix another index overflow issue
Markus Teich [Mon, 16 Nov 2015 23:19:39 +0000 (00:19 +0100)]
fix several number overflow issues
Markus Teich [Mon, 16 Nov 2015 23:18:54 +0000 (00:18 +0100)]
update version
Markus Teich [Sat, 7 Nov 2015 22:54:23 +0000 (23:54 +0100)]
add multiline support
Markus Teich [Wed, 11 Nov 2015 18:09:13 +0000 (19:09 +0100)]
fix more memory leaks
Markus Teich [Wed, 11 Nov 2015 18:00:54 +0000 (19:00 +0100)]
free all fonts correctly
Markus Teich [Wed, 11 Nov 2015 17:53:54 +0000 (18:53 +0100)]
free temporary fontstr arrays
Markus Teich [Wed, 11 Nov 2015 17:49:57 +0000 (18:49 +0100)]
simplify png cleanup
Markus Teich [Wed, 11 Nov 2015 17:41:51 +0000 (18:41 +0100)]
make usable screensize config const
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.
Szabolcs Nagy [Mon, 9 Nov 2015 01:58:26 +0000 (02:58 +0100)]
initialize .img
without the attached patch ./sent example segfaults here
Markus Teich [Sat, 7 Nov 2015 22:52:35 +0000 (23:52 +0100)]
don't use EXIT_… cpp defines
Markus Teich [Sat, 7 Nov 2015 22:48:40 +0000 (23:48 +0100)]
fix comment wording in drw.c
Markus Teich [Wed, 4 Nov 2015 00:43:13 +0000 (01:43 +0100)]
make colors configurable
Markus Teich [Wed, 4 Nov 2015 00:40:50 +0000 (01:40 +0100)]
update license year
Markus Teich [Sun, 1 Nov 2015 17:09:22 +0000 (18:09 +0100)]
fix default fonts in config.def.h
Markus Teich [Sat, 31 Oct 2015 17:10:47 +0000 (18:10 +0100)]
remove unused font configuration, update license year
Markus Teich [Sat, 31 Oct 2015 17:07:07 +0000 (18:07 +0100)]
fix font width calculations
Markus Teich [Sat, 31 Oct 2015 15:25:02 +0000 (16:25 +0100)]
remove unused type qualifiers
Markus Teich [Sat, 31 Oct 2015 15:24:38 +0000 (16:24 +0100)]
update example presentation
Markus Teich [Sat, 29 Aug 2015 00:24:42 +0000 (02:24 +0200)]
fonts are automatically cleaned up
Markus Teich [Sun, 3 May 2015 20:07:51 +0000 (22:07 +0200)]
drw_resize should be called on mapping as well
Markus Teich [Sat, 2 May 2015 11:29:03 +0000 (13:29 +0200)]
remove debug statement
Markus Teich [Fri, 1 May 2015 19:34:52 +0000 (21:34 +0200)]
typedef image struct
Markus Teich [Thu, 30 Apr 2015 20:00:14 +0000 (22:00 +0200)]
minor style adaptions
Markus Teich [Mon, 27 Apr 2015 22:27:43 +0000 (00:27 +0200)]
fonts cleanup
Markus Teich [Mon, 27 Apr 2015 21:26:03 +0000 (23:26 +0200)]
remove unused dc/gc variables
Markus Teich [Sun, 26 Apr 2015 18:40:42 +0000 (20:40 +0200)]
remove utf8 support from todo list
Markus Teich [Sat, 25 Apr 2015 18:18:43 +0000 (20:18 +0200)]
remove old stuff and fix warnings
Markus Teich [Wed, 22 Apr 2015 09:57:08 +0000 (11:57 +0200)]
blank screen before drawing text
Markus Teich [Wed, 22 Apr 2015 09:56:41 +0000 (11:56 +0200)]
fix calculation of correct font size to use
Markus Teich [Tue, 21 Apr 2015 20:57:52 +0000 (22:57 +0200)]
drw: fixup font handling
Markus Teich [Mon, 20 Apr 2015 20:20:16 +0000 (22:20 +0200)]
use new font system from drw
Markus Teich [Sun, 19 Apr 2015 15:36:18 +0000 (17:36 +0200)]
minor style fix and new var for fonts
Markus Teich [Sun, 12 Apr 2015 20:56:56 +0000 (22:56 +0200)]
drw: fixup drw_rect function
Markus Teich [Sat, 11 Apr 2015 10:05:39 +0000 (12:05 +0200)]
use die() where it should be used
Markus Teich [Fri, 10 Apr 2015 21:13:33 +0000 (23:13 +0200)]
use drw color scheme fixup
Markus Teich [Fri, 10 Apr 2015 21:12:50 +0000 (23:12 +0200)]
drw: fixup color schemes
Markus Teich [Thu, 9 Apr 2015 17:23:31 +0000 (19:23 +0200)]
some work on using drw.c done
Markus Teich [Wed, 8 Apr 2015 19:13:45 +0000 (21:13 +0200)]
drw: fixup font_getexts
Markus Teich [Tue, 7 Apr 2015 20:03:02 +0000 (22:03 +0200)]
add utf8 support, scaling and positioning missing.
Markus Teich [Mon, 6 Apr 2015 21:06:36 +0000 (23:06 +0200)]
init and clear drw context
Markus Teich [Sun, 5 Apr 2015 13:48:47 +0000 (15:48 +0200)]
prepare switch to libsl
Markus Teich [Tue, 3 Mar 2015 18:40:07 +0000 (19:40 +0100)]
update TODO
Markus Teich [Mon, 19 Jan 2015 17:39:04 +0000 (18:39 +0100)]
update example
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.
Jonas Jelten [Mon, 19 Jan 2015 03:28:11 +0000 (04:28 +0100)]
make: fix warnings because of BSD_SOURCE
Jonas Jelten [Mon, 19 Jan 2015 03:27:54 +0000 (04:27 +0100)]
make: don't build cscope by default
Markus Teich [Sun, 29 Jun 2014 21:48:49 +0000 (23:48 +0200)]
update README
Markus Teich [Sun, 29 Jun 2014 21:45:04 +0000 (23:45 +0200)]
large jumps don't work well with presenters