]> git.draconx.ca Git - liblbx.git/log
liblbx.git
4 months agoTrivial manual fixes. master
Nick Bowler [Fri, 1 Dec 2023 04:10:05 +0000 (23:10 -0500)]
Trivial manual fixes.

For literal strings, we need to use \- instead of just - as some troff
processors turn plain "-" into "proper" unicode hyphens (as opposed to
hyphen-minus), which breaks copy+paste and searching.

Ensure that .Os follows .Dt in the mdoc prologue as apparently not doing
this results in broken manpage headings with groff 1.23.

4 months agoReplace gnulib patch with new common helper macro.
Nick Bowler [Fri, 1 Dec 2023 04:07:04 +0000 (23:07 -0500)]
Replace gnulib patch with new common helper macro.

Using the new DX_PATCH_GNULIB macro allows m4 to implement the
conditional dependency patches that were previously being done
in bootstrap.

10 months agoStop using gnulib's flexmember module.
Nick Bowler [Sat, 27 May 2023 06:27:13 +0000 (02:27 -0400)]
Stop using gnulib's flexmember module.

The only thing we're actually using from this module is provided
directly by Autoconf, via AC_C_FLEXIBLE_ARRAY_MEMBER, so we can
just use that macro instead.

17 months agoAvoid Gnulib std-gnu11 module.
Nick Bowler [Fri, 18 Nov 2022 03:45:07 +0000 (22:45 -0500)]
Avoid Gnulib std-gnu11 module.

It has come to my attention that this module rewrites AC_PROG_CC in
a way that actually breaks Automake's AM_PROG_CC_C_O functionality.
This results in the "compile" script not being included or used in
packages bootstrapped with Autoconf 2.69.

With later versions of Autoconf things work because this module
doesn't touch things and thus disables itself.

I don't care about building with C11 one way or the other.  Let's
just skip the module.

2 years agoUpdate gitmodule URLs.
Nick Bowler [Thu, 23 Sep 2021 00:06:49 +0000 (20:06 -0400)]
Update gitmodule URLs.

2 years agoUse gnulib flexmember module.
Nick Bowler [Sun, 26 Sep 2021 06:06:47 +0000 (02:06 -0400)]
Use gnulib flexmember module.

For increased portability to older C compilers.

2 years agoWork around shell redirection bug on HP-UX /bin/sh.
Nick Bowler [Sun, 26 Sep 2021 06:05:26 +0000 (02:05 -0400)]
Work around shell redirection bug on HP-UX /bin/sh.

On HP-UX /bin/sh, when "read" is used in a subshell with redirections,
it seems that some of the input gets dropped on the floor.  For example:

  % cat >test.txt <<'EOF'
  hello
  world
EOF
  % ( exec 3<test.txt; read a <&3; read b <&3; echo $a $b )
  hello

In TEST_CHECK_PAM_MD5, we hit this bug because AT_CHECK runs its
commands in a subshell, and as a result some of the image data is
lost after reading the header and verification fails.

Work around the issue by performing only a single AT_CHECK with a
single redirection.

2 years agoUse AC_CONFIG_HEADERS rather than AC_CONFIG_HEADER.
Nick Bowler [Thu, 23 Sep 2021 00:03:49 +0000 (20:03 -0400)]
Use AC_CONFIG_HEADERS rather than AC_CONFIG_HEADER.

The former name has been supported since approximately forever ago and
the latter form is now formally deprecated (with a warning) in recent
versions of Autoconf.

2 years agoImprove lbx_colour structure layout.
Nick Bowler [Wed, 22 Sep 2021 06:42:24 +0000 (02:42 -0400)]
Improve lbx_colour structure layout.

There is no point in using bit-fields for the components of this
structure.  The structure will never be smaller than 4 bytes so
there is no space savings compared to just using four unsigned
char members.  This avoids the compiler needing to do any kind
of bit shuffling.

In the typical case where such a structure has no padding, this
means the layout of these members will now exactly match the PAM
format, enabling a modest speedup.

2 years agolbximg: Improve performance of PAM output.
Nick Bowler [Wed, 22 Sep 2021 05:24:25 +0000 (01:24 -0400)]
lbximg: Improve performance of PAM output.

The PAM output currently calls fwrite for every pixel, which amounts to
about half a million fwrite calls to output a full screen image.  For a
fullscreen animation like logo.lbx.001, the majority of the execution
time is spent in fwrite.

Let's reduce this a lot by formatting and outputting an entire row at
a time, which almost completely eliminates fwrite from the profile.

2 years agolbximg: Avoid %zu printf format.
Nick Bowler [Wed, 22 Sep 2021 01:32:17 +0000 (21:32 -0400)]
lbximg: Avoid %zu printf format.

Some older library implementations don't support %zu conversions.
Since the use in lbximg is entirely pointless, this is just
gratuitious incompatibility.

2 years agoBack out incomplete i18n support in the library.
Nick Bowler [Wed, 22 Sep 2021 00:56:19 +0000 (20:56 -0400)]
Back out incomplete i18n support in the library.

We are a long way from actually having working i18n, so all this
is doing right now is adding unneeeded build dependencies.

2 years agoImprove portability of testcase MD5 generation.
Nick Bowler [Wed, 22 Sep 2021 00:44:32 +0000 (20:44 -0400)]
Improve portability of testcase MD5 generation.

GNU md5sum is not always available, but many systems have some form of
MD5 utility available in the base install.  Use the new DX_PROG_MD5
macro to locate such a utility and adjust the test suite to use it.

This will enable the original-data testcases to run on more systems.

2 years agolbximg: Simplify pnm text output.
Nick Bowler [Tue, 21 Sep 2021 03:21:05 +0000 (23:21 -0400)]
lbximg: Simplify pnm text output.

The ASCII output routine here is pointlessly complex, we are only
printing very short lines and a fixed length buffer will do just
fine.

Moreover, let's just optimize it out completely in the case where
the C character set is an ASCII superset and assertions are disabled.

2 years agoUse (size_t)-1 instead of SIZE_MAX.
Nick Bowler [Tue, 21 Sep 2021 04:53:26 +0000 (00:53 -0400)]
Use (size_t)-1 instead of SIZE_MAX.

We do not require the special characteristics of SIZE_MAX (that it be
suitable for use in #if directives), and older library implementations
do not define it.  Outside of the preprocessor, (size_t)-1 is exactly
equivalent so let's just use that instead.

2 years agoAdd missing <config.h> include to fops.c.
Nick Bowler [Tue, 21 Sep 2021 03:26:32 +0000 (23:26 -0400)]
Add missing <config.h> include to fops.c.

2 years agoDon't use [static n] in function prototypes.
Nick Bowler [Tue, 21 Sep 2021 02:56:14 +0000 (22:56 -0400)]
Don't use [static n] in function prototypes.

This modern C feature is mostly useless and introduces compatibility
problems for no good reason.

2 years agoPort all test cases to Autotest.
Nick Bowler [Sat, 18 Sep 2021 18:30:21 +0000 (14:30 -0400)]
Port all test cases to Autotest.

I can't say I'm a huge fan of the Automake test harness.  All my other
projects use Autotest, let's convert this one to use it too.

2 years agoConvert tools to use option generator script from dxcommon.
Nick Bowler [Mon, 13 Sep 2021 17:49:40 +0000 (13:49 -0400)]
Convert tools to use option generator script from dxcommon.

This generator makes it simple to maintain long and short option lists,
as well as provide an actually useful --help output.

2 years agoUse shared code from dxcommon.
Nick Bowler [Mon, 6 Sep 2021 15:42:03 +0000 (11:42 -0400)]
Use shared code from dxcommon.

The needed library tests and integer packing code have been part of
dxcommon since forever ago, probably adapted originally from this very
package.  No point carrying around redundant and outdated copies.

2 years agoUpdate gnulib/dxcommon to lastest bits.
Nick Bowler [Sun, 5 Sep 2021 19:49:18 +0000 (15:49 -0400)]
Update gnulib/dxcommon to lastest bits.

10 years agoliblbx: Correct EOF handling in lbx_file_read.
Nick Bowler [Fri, 31 Jan 2014 05:21:04 +0000 (00:21 -0500)]
liblbx: Correct EOF handling in lbx_file_read.

We should never see an EOF from the underlying I/O when reading archive
members, because we setup the read request to only return bytes that are
supposed to be there.

So if EOF happens, flag this as an error and do *not* set the eof flag
in the state structure.  Also fixup lbxtool to properly handle this.

10 years agotests: Add test for truncated archives.
Nick Bowler [Fri, 31 Jan 2014 05:01:40 +0000 (00:01 -0500)]
tests: Add test for truncated archives.

If a real EOF is encountered while reading an archive member this
will not be properly reported as a read error.  So we'll never notice
if extracted files are missing a chunk because the archive is truncated.

Add a test which exposes this behaviour.

10 years agoliblbx: Remove use of SEEK_CUR in the image reader.
Nick Bowler [Fri, 31 Jan 2014 03:32:28 +0000 (22:32 -0500)]
liblbx: Remove use of SEEK_CUR in the image reader.

Other than this one seek, all other seeks used by the library are of the
SEEK_SET type.  Only requiring SEEK_SET will simplify implementations of
lbx_file_ops quite a lot, so let's get rid of this one.

The whole point of this seek is to skip just one byte — a normal read
works just as well.

10 years agoliblbx: Remove tell function from lbx_file_ops.
Nick Bowler [Fri, 31 Jan 2014 03:22:53 +0000 (22:22 -0500)]
liblbx: Remove tell function from lbx_file_ops.

There is no longer any user of this function, so we don't really need
it in the lbx_file_ops structure.

10 years agoliblbx: Remove declaration of lbx_mopen.
Nick Bowler [Fri, 31 Jan 2014 03:21:21 +0000 (22:21 -0500)]
liblbx: Remove declaration of lbx_mopen.

This function was removed a long time ago, but its declaration was
never deleted from the header file.  Better late than never.

10 years agoliblbx: Add a hard check for image leadin versus frame count.
Nick Bowler [Fri, 31 Jan 2014 03:17:43 +0000 (22:17 -0500)]
liblbx: Add a hard check for image leadin versus frame count.

Our "official" image spec says that the leadin is a frame number, so
it does not make sense for the leadin to be greater than or equal to
the frame count.

Convert the existing "soft" check into a hard failure.

10 years agoliblbx: Kill lbx_img_getinfo
Nick Bowler [Fri, 31 Jan 2014 03:12:11 +0000 (22:12 -0500)]
liblbx: Kill lbx_img_getinfo

There is no longer any reason to use this function.  Its removal has
been a long time coming; it is time for it to go.

10 years agoliblbx: Clean up embedded palette handling
Nick Bowler [Fri, 31 Jan 2014 03:00:27 +0000 (22:00 -0500)]
liblbx: Clean up embedded palette handling

We don't need to read the embedded palette information with the rest of
the header, we can defer that to much later when the palette is actually
needed.  This makes more sense conceptually, simplifies the code a bit,
and saves some bytes in the image state structure.

Since we're basically rewriting lbx_img_getpalette anyway, take this
opportunity to give it a better interface.  It now returns the number
of embedded palette entries, allowing us to eliminate the palette size
feature in lbx_img_getinfo.

10 years agoliblbx: Kill the old LBX image API.
Nick Bowler [Wed, 29 Jan 2014 05:54:53 +0000 (00:54 -0500)]
liblbx: Kill the old LBX image API.

Now that both users have been ported we can get rid of this cruft.

10 years agolbxgui: Render LBX directly to Cairo surfaces.
Nick Bowler [Wed, 29 Jan 2014 05:30:13 +0000 (00:30 -0500)]
lbxgui: Render LBX directly to Cairo surfaces.

This replaces the GDK pixbuf with a Cairo image surface, and updates
the render path to the new liblbx API.

10 years agolbxgui: Use Cairo for drawing.
Nick Bowler [Wed, 29 Jan 2014 00:34:17 +0000 (19:34 -0500)]
lbxgui: Use Cairo for drawing.

The GDK stuff is deprecated so let's convert all the GDK drawing bits to
Cairo.  Unlike GDK, Cairo does not include an XBM loader so we have to
implement that from scratch.

Keep the GDK pixbuf bits around for now.

10 years agoliblbx: Fix uninitialized value warning in pipe_seek.
Nick Bowler [Tue, 28 Jan 2014 02:43:42 +0000 (21:43 -0500)]
liblbx: Fix uninitialized value warning in pipe_seek.

If whence is invalid then we will proceed with an uninitialized value.
However, unlike the similar problem in lbx_file_seek, pipe_seek is an
internal function so this scenario can Never Happen™.

Add an assertion to silence the warning.

10 years agoliblbx: Always return a value in file_seek.
Nick Bowler [Tue, 28 Jan 2014 02:41:55 +0000 (21:41 -0500)]
liblbx: Always return a value in file_seek.

This function did not return any value on success so it was only by
chance that it seemed to work.

10 years agoliblbx: Improve error handling in lbx_file_seek.
Nick Bowler [Tue, 28 Jan 2014 01:28:09 +0000 (20:28 -0500)]
liblbx: Improve error handling in lbx_file_seek.

  - Return an error code for an invaled whence value instead of
    proceeding with uninitialized values.

  - Set an error code on one of the error paths that did not set one.

10 years agotests: Enable shell traces early in all scripts.
Nick Bowler [Tue, 28 Jan 2014 01:10:30 +0000 (20:10 -0500)]
tests: Enable shell traces early in all scripts.

The result_ function we snarfed from Automake turns on set -x in our
test suite, but since we do not enable it from the beginning the test
logs have traces starting from the first test result and not before.

The result is very strange; enable traces early so we see everything.

10 years agolbximg: Fix management of external palette file handles.
Nick Bowler [Tue, 28 Jan 2014 01:03:34 +0000 (20:03 -0500)]
lbximg: Fix management of external palette file handles.

We leak file handles for the external and override palettes because the
file is opened every time the --palette or --override options are set.
Fix that up, and also close the handles when finished.

10 years agotests: Allow custom test command wrappers
Nick Bowler [Sat, 25 Jan 2014 19:10:33 +0000 (14:10 -0500)]
tests: Allow custom test command wrappers

Add a new environment variable, TESTWRAPPER, which allows the tests
to be run easily in tools like valgrind or qemu.

10 years agodocs: Add palette information for the tanm_xxx animations.
Nick Bowler [Fri, 24 Jan 2014 00:06:08 +0000 (19:06 -0500)]
docs: Add palette information for the tanm_xxx animations.

I thought these all had embedded palettes but at least tanm_001
has some unspecified palette entries.  The only palette for this
image that does not look horrible is fonts.lbx.002, so let's go
with that one.

10 years agobuild: Remove call to AC_CONFIG_MACRO_DIR.
Nick Bowler [Thu, 23 Jan 2014 03:04:38 +0000 (22:04 -0500)]
build: Remove call to AC_CONFIG_MACRO_DIR.

This macro never did anything useful and should not be used.  The new-
fangled way is AC_CONFIG_MACRO_DIRS which might even work, but stick
with the tried-and-true method for now.

10 years agolbximg: Convert to new decoding API.
Nick Bowler [Thu, 23 Jan 2014 02:30:01 +0000 (21:30 -0500)]
lbximg: Convert to new decoding API.

Convert lbximg to the new API.  The implementation looks a lot
like getframe, but we can make the memory usage much more compact.
Not really a coincidence because getframe was originally designed
to support this application.

10 years agoliblbx: Implement new image reading API.
Nick Bowler [Thu, 23 Jan 2014 02:13:45 +0000 (21:13 -0500)]
liblbx: Implement new image reading API.

Add a new API which allows the application to essentially loop over
the drawing commands in an LBX frame.  This requires no runtime memory
allocations in the library, pushing all that out to the caller.

Conceptually this simplifies many applications because they can use
this to handle image data row-at-a-time.

For now, keep the old getframe function but change it to use the new
API under the hood.

10 years agoliblbx: Rename LBX_ENOENT to LBX_EINVAL.
Nick Bowler [Thu, 23 Jan 2014 01:54:33 +0000 (20:54 -0500)]
liblbx: Rename LBX_ENOENT to LBX_EINVAL.

General invalid argument makes more sense to have.

10 years agotests: Source image header in a subshell.
Nick Bowler [Thu, 23 Jan 2014 01:50:33 +0000 (20:50 -0500)]
tests: Source image header in a subshell.

Use a subshell when sourcing the image header in pam-formats so that
the shell variables do not persist past the end of the test.  While
unlikely, a value left over from an earlier test might result in
false positives in later tests.

10 years agotests: Add info on what each MOO2 image is actually testing.
Nick Bowler [Thu, 23 Jan 2014 01:14:16 +0000 (20:14 -0500)]
tests: Add info on what each MOO2 image is actually testing.

Each MOO2 test image was selected to test a particular feature of the
image decoder.  That information was in the old regress.zsh script but
for some reason got dropped in the conversion.  Add that information
back as a TAP diagnostic line for each image.

10 years agotests: Zero out transparent pixels before calculating digest.
Nick Bowler [Thu, 23 Jan 2014 01:12:02 +0000 (20:12 -0500)]
tests: Zero out transparent pixels before calculating digest.

The colour value of transparent pixels is irrelevant from a correctness
perspective, but we are nevertheless including that information in the
tests.  While we could zero out the values in the PAM output code it's
better to make the tests more robust.

This adds an external dependency on netpbm's pamarith and pamchannel
tools for the test suite.  Restructure the tests so that these tools
are optional.  If the tools are not available (or not working) then we
must accept the fact that images with an alpha channel may have false
negatives (but not false positives) -- record a SKIP result for an MD5
mismatch in that case.

10 years agotests: Remove toplevel set -e usage.
Nick Bowler [Thu, 23 Jan 2014 01:06:27 +0000 (20:06 -0500)]
tests: Remove toplevel set -e usage.

Using set -e at the top level affects the entire script and makes it
difficult to work with commands that may legitimately return an error.
Regardless, set -e is still not so great for error checks because it
has some incredibly non-obvious semantics.

Better to just have correct error checks everywhere.  Fortunately, this
is the case for almost all the existing test code -- only the testdir
creation needs fixing.

10 years agoliblbx: Expose image lead-in in public struct.
Nick Bowler [Thu, 2 Jan 2014 01:33:18 +0000 (20:33 -0500)]
liblbx: Expose image lead-in in public struct.

Since we've finally defined the meaning of this value it makes sense to
expose it to the user.  This eliminates another need for lbx_img_getinfo,
but maintain the old functionality there for now.

10 years agolbximg: Fix wart in frame scanline header format
Nick Bowler [Tue, 17 Dec 2013 04:49:30 +0000 (23:49 -0500)]
lbximg: Fix wart in frame scanline header format

The format of frame scanlines has been a little weird since day 1: We
had 2 "types" of scanline headers disambiguated by some non-trivial
logic, including whether or not it was the first decoded scanline in
the frame.

Here's a new, simpler approach, which has only one type of scanline
header, consistent meanings to the header fields, and by interpreting
the first 4 bytes as a "frame header" we get rid of the special case
for the first scanline, too.

Add a document in English which describes the LBX image file format, to
be used as the baseline format specification going forward.

Finally, update the contrived test cases for the new format.  All the
test cases using actual MOO2 data still pass.

10 years agolbximg: Return failure if there was a decoding error.
Nick Bowler [Tue, 17 Dec 2013 01:01:57 +0000 (20:01 -0500)]
lbximg: Return failure if there was a decoding error.

If any frame was not decoded because liblbx returned an error, we should
return a non-zero exit status from the tool.  Previously this would only
happen if *all* frames failed.

10 years agotests: Migrate remaining regress.zsh tests to TAP.
Nick Bowler [Sun, 23 Jun 2013 19:11:14 +0000 (15:11 -0400)]
tests: Migrate remaining regress.zsh tests to TAP.

10 years agotests: Migrate the mainmenu.lbx tests to the TAP system.
Nick Bowler [Sat, 22 Jun 2013 14:01:39 +0000 (10:01 -0400)]
tests: Migrate the mainmenu.lbx tests to the TAP system.

This moves the first set of regress.zsh tests to the new framework.

10 years agobuild: Bump dxcommon for relevant fix-gnulib updates.
Nick Bowler [Fri, 21 Jun 2013 20:01:01 +0000 (16:01 -0400)]
build: Bump dxcommon for relevant fix-gnulib updates.

10 years agoliblbx: Fix framebuffer allocation for 0x0 images.
Nick Bowler [Fri, 21 Jun 2013 14:22:48 +0000 (10:22 -0400)]
liblbx: Fix framebuffer allocation for 0x0 images.

The allocation strategy for the framebuffer is the "array2" method from
c-faq: an array of row pointers into a single large array containing all
rows.  This was not being freed correctly in the case with 0 rows, since
there would be no pointer to the row data at all in order to free it.

Fix that up by simply allocating a 1x1 framebuffer when it would
otherwise be empty.  While we're at it, also add an overflow check
on the multiplication.

10 years agotests: Add a simple test to validate PAM output formats.
Nick Bowler [Fri, 21 Jun 2013 14:18:39 +0000 (10:18 -0400)]
tests: Add a simple test to validate PAM output formats.

This tests that the PAM output produces the correct image type for
all four of the lbximg modes.

10 years agolbximg: Add an option to control the output filenames.
Nick Bowler [Wed, 19 Jun 2013 01:07:51 +0000 (21:07 -0400)]
lbximg: Add an option to control the output filenames.

This will be needed for postmortem analysis of test cases that extract
multiple images, since otherwise there is no easy way to prevent the
tool from overwriting the earlier outputs.

This was clearly intended to be a user setting from the start but for
some reason it was never wired up to a command-line option.

10 years agolbximg: Allow --identify as a long option.
Nick Bowler [Wed, 19 Jun 2013 00:45:04 +0000 (20:45 -0400)]
lbximg: Allow --identify as a long option.

There is no reason to not have a full word here.  The getopt_long
function allows abbreviations anyway, so --ident remains perfectly
fine as an option.

10 years agolbximg: Fix exit status in identify mode.
Nick Bowler [Wed, 19 Jun 2013 00:43:36 +0000 (20:43 -0400)]
lbximg: Fix exit status in identify mode.

The tool was always returning an exit status of failure, because in
identify mode there was no case to set the exit status to success.

10 years agolbximg: Fix --override long option.
Nick Bowler [Wed, 19 Jun 2013 00:40:42 +0000 (20:40 -0400)]
lbximg: Fix --override long option.

The long option for this feature was clearly never tested, as only the
short option spec was actually correct.

10 years agotests: First stab at a proper test suite.
Nick Bowler [Wed, 19 Jun 2013 00:30:08 +0000 (20:30 -0400)]
tests: First stab at a proper test suite.

Not much of a suite at the moment since it consists of a single test,
which exposes a corner-case in the memory allocation spotted by clang.

Eventually we will move the regress.zsh tests into this framework.

10 years agolbximg: Make libpng a soft dependency.
Nick Bowler [Fri, 14 Jun 2013 22:15:25 +0000 (18:15 -0400)]
lbximg: Make libpng a soft dependency.

Now that we have Netpbm output formats which do not depend on
any external libraries, we can make it possible to build lbximg
without libpng.  Adjust the build system so that lbximg is built
unconditionally and PNG output can be selectively disabled.

10 years agolbximg: Add support for Netpbm output.
Nick Bowler [Fri, 14 Jun 2013 22:11:46 +0000 (18:11 -0400)]
lbximg: Add support for Netpbm output.

These netpbm formats are extremely simple image formats which can
be written with a very small amount of code.  Implement the ASCII
PBM and PPM formats for eventual use in test scripts, and PAM as a
fully-featured format so that we can make libpng optional.

10 years agoliblbx: Don't scale palette values internally.
Nick Bowler [Fri, 14 Jun 2013 01:57:11 +0000 (21:57 -0400)]
liblbx: Don't scale palette values internally.

Output the 18-bit palette values unadulterated, leaving it up to the
users to do conversion if necessary.  Push the conversion down into the
consumers (currently PNG output and the GTK GUI) where a 24-bit palette
is required.

While we're at it, adjust the conversion to scale to the full output
range of [0, 255].  This is a slight change to the output, so all the
image hashes need to be adjusted in the regression test.

10 years agolbximg: Fix printf format string in identify mode.
Nick Bowler [Fri, 14 Jun 2013 01:23:52 +0000 (21:23 -0400)]
lbximg: Fix printf format string in identify mode.

One of the flag strings would never be printed because there was
simply not enough conversion specifiers in this format string.  Fix
that up, and also adjust the length modifiers to match the actual
passed integer types.

10 years agolbximg: Push no-palette mode down into the PNG writer.
Nick Bowler [Fri, 14 Jun 2013 01:16:36 +0000 (21:16 -0400)]
lbximg: Push no-palette mode down into the PNG writer.

This allows the writer to select the most appropriate output format to
support this mode.  Switch the PNG writer to emit true grayscale images
in this case.

10 years agoliblbx: Properly report errors in lbx_(img_)fopen.
Nick Bowler [Wed, 12 Jun 2013 01:07:30 +0000 (21:07 -0400)]
liblbx: Properly report errors in lbx_(img_)fopen.

The lbx_fopen and lbx_img_fopen functions were not properly pushing an
error code when they failed, leading to extremely helpful messages of
the form:

  lbximg: failed to open image: Success.

It further turns out that pushing negative errors (i.e., -errno) was
documented but never actually tested or used, so fix that up, too.
It is likely that many other sites are lacking appropriate calls to
lbx_error_raise, which can be added later.

10 years agolbximg: Add a new PNG writing routine.
Nick Bowler [Tue, 11 Jun 2013 22:29:07 +0000 (18:29 -0400)]
lbximg: Add a new PNG writing routine.

This splits out the PNG output from the rest of the lbximg processing,
so that it will be easier to add additional output formats (in par-
ticular, it would be nice to have some sort of text-based format to
facilitate automated testing).

Take this opportunity to vastly improve the error handling.

10 years agotools: Add some smarter error printing routines.
Nick Bowler [Wed, 5 Jun 2013 03:34:06 +0000 (23:34 -0400)]
tools: Add some smarter error printing routines.

These ones can fill in strerror(errno) automatically.

10 years agotools: Move progname handling into a common source file.
Nick Bowler [Wed, 5 Jun 2013 03:26:04 +0000 (23:26 -0400)]
tools: Move progname handling into a common source file.

Less code duplication is nice.

11 years agobuild: Remove use of per-target CFLAGS.
Nick Bowler [Sat, 23 Mar 2013 17:12:30 +0000 (13:12 -0400)]
build: Remove use of per-target CFLAGS.

These are not necessary, and result in ugly object file names for no
reason.

11 years agobuild: clean up XML -> C conversion.
Nick Bowler [Sat, 23 Mar 2013 16:28:55 +0000 (12:28 -0400)]
build: clean up XML -> C conversion.

Use a suffix rule so the rule avoids hardcoding names and other details.

11 years agobuild: Flatten the build system.
Nick Bowler [Sat, 23 Mar 2013 15:47:35 +0000 (11:47 -0400)]
build: Flatten the build system.

Move everything into a single Makefile.am so that it's all in one place.

11 years agodocs: Add a more realistic statement about development pace.
Nick Bowler [Thu, 14 Mar 2013 00:14:24 +0000 (20:14 -0400)]
docs: Add a more realistic statement about development pace.

I don't think "under heavy development" even begins to resemble reality.

11 years agobuild: Integrate Gnulib non-recursively using fix-gnulib.
Nick Bowler [Thu, 14 Mar 2013 00:10:47 +0000 (20:10 -0400)]
build: Integrate Gnulib non-recursively using fix-gnulib.

11 years agognulib: Update to latest version.
Nick Bowler [Tue, 12 Mar 2013 22:38:40 +0000 (18:38 -0400)]
gnulib: Update to latest version.

11 years agobuild: Fixes for newer tools.
Nick Bowler [Tue, 12 Mar 2013 22:22:56 +0000 (18:22 -0400)]
build: Fixes for newer tools.

Some trivial updates to fix the build with latest Automake.  Drop
support for Automake versions < 1.11.

12 years agodoc: Update moo2-data.
Nick Bowler [Tue, 6 Dec 2011 23:33:02 +0000 (18:33 -0500)]
doc: Update moo2-data.

12 years agoliblbx: Remove now-redundant fields from lbx_imginfo.
Nick Bowler [Mon, 5 Dec 2011 04:28:37 +0000 (23:28 -0500)]
liblbx: Remove now-redundant fields from lbx_imginfo.

Ideally I'd like to kill this structure completely, but there's still
some non-trivial logic in it.  So leave those fields for now.

12 years agoliblbx: Kill the LBXimg typedef.
Nick Bowler [Mon, 5 Dec 2011 04:22:18 +0000 (23:22 -0500)]
liblbx: Kill the LBXimg typedef.

12 years agoliblbx: Start conversion of LBXimg to public/private structs.
Nick Bowler [Mon, 5 Dec 2011 04:12:40 +0000 (23:12 -0500)]
liblbx: Start conversion of LBXimg to public/private structs.

12 years agoliblbx: Kill the LBX typedef.
Nick Bowler [Sat, 14 May 2011 01:12:13 +0000 (21:12 -0400)]
liblbx: Kill the LBX typedef.

More stuff rendered redundant.

12 years agoliblbx: Kill lbx_numfiles.
Nick Bowler [Sat, 14 May 2011 01:08:37 +0000 (21:08 -0400)]
liblbx: Kill lbx_numfiles.

This function is now redundant.

12 years agoliblbx: Start conversion to public/private structure bits.
Nick Bowler [Sat, 14 May 2011 01:03:17 +0000 (21:03 -0400)]
liblbx: Start conversion to public/private structure bits.

This sort of interface is really a lot nicer, and avoids stupid
accessor functions.

14 years agobuild: Reset pkg_failed before checking pkg-config.
Nick Bowler [Thu, 11 Mar 2010 01:04:16 +0000 (20:04 -0500)]
build: Reset pkg_failed before checking pkg-config.

If this is not done, the first pkg-config check to fail will cause all
subsequent pkg-config checks to "fail".

14 years agoliblbx: Namespace cleanup.
Nick Bowler [Thu, 11 Feb 2010 14:06:00 +0000 (09:06 -0500)]
liblbx: Namespace cleanup.

14 years agolbxgui: Fix an error handling regression.
Nick Bowler [Thu, 11 Feb 2010 13:53:56 +0000 (08:53 -0500)]
lbxgui: Fix an error handling regression.

If the framebuffer allocation fails, it still gets passed to
render_to_pixbuf.  This causes an assertion failure.

14 years agolbxgui: Implement frame dropping for animation.
Nick Bowler [Thu, 11 Feb 2010 05:06:54 +0000 (00:06 -0500)]
lbxgui: Implement frame dropping for animation.

Currently, if it takes longer than 1/15th of a second to draw a frame,
the next frame will be queued before it has a chance to finish, which
then takes longer than 1/15th of a second to draw, so the next one gets
queued, ad infinitum.

We do two things to solve this problem.  First, the timer runs at a
low priority so that a redraw doesn't get queued while a redraw is in
progress.  Second, the timer skips queueing any frames that have missed
their time.

14 years agoliblbx: Use unconditional includes of <config.h>.
Nick Bowler [Thu, 11 Feb 2010 03:14:13 +0000 (22:14 -0500)]
liblbx: Use unconditional includes of <config.h>.

14 years agoliblbx: Implement improved error reporting mechanism.
Nick Bowler [Thu, 11 Feb 2010 03:08:04 +0000 (22:08 -0500)]
liblbx: Implement improved error reporting mechanism.

We now use a FIFO-of-errors approach (similar to libltdl) as opposed to
an errno-esque approach.

14 years agoliblbx: Replace feof call with lbx_file_ops.
Nick Bowler [Thu, 11 Feb 2010 02:57:21 +0000 (21:57 -0500)]
liblbx: Replace feof call with lbx_file_ops.

This feof call was missed when converting this function.

14 years agoliblbx: Reset EOF flag after a successful seek on a pipe.
Nick Bowler [Thu, 11 Feb 2010 02:48:51 +0000 (21:48 -0500)]
liblbx: Reset EOF flag after a successful seek on a pipe.

This will probably never happen in practice.

14 years agoliblbx: Rename lbx_stat to lbx_file_stat.
Nick Bowler [Thu, 11 Feb 2010 00:42:12 +0000 (19:42 -0500)]
liblbx: Rename lbx_stat to lbx_file_stat.

14 years agoliblbx: Rename LBX_IMG to LBXimg.
Nick Bowler [Thu, 11 Feb 2010 00:36:49 +0000 (19:36 -0500)]
liblbx: Rename LBX_IMG to LBXimg.

This makes it consistent with LBXfile.

14 years agobuild: Implement a better GTK+ detection macro.
Nick Bowler [Thu, 11 Feb 2010 00:08:25 +0000 (19:08 -0500)]
build: Implement a better GTK+ detection macro.

This macro uses the same ideas behind the libpng detection, does not
suffer from the POSIXLY_CORRECT nonsense, doesn't duplicate checks
for pkg-config, supports caching, and properly fails when it should.

14 years agobuild: Split out core logic from libpng detection.
Nick Bowler [Thu, 11 Feb 2010 00:06:52 +0000 (19:06 -0500)]
build: Split out core logic from libpng detection.

This allows it to be used for other libraries.  This new method also
better handles the various mechanisms for setting cflags/libs.

14 years agolbxgui: Fix pointer type error.
Nick Bowler [Wed, 10 Feb 2010 06:24:37 +0000 (01:24 -0500)]
lbxgui: Fix pointer type error.

The XBM format is an array of unsigned char, yet for some reason
unknown to me, the gdk_bitmap_create_from_data function wants a
char pointer.  Add the appropriate cast.

14 years agolbxgui: Compile in the glade UI description.
Nick Bowler [Wed, 10 Feb 2010 05:40:17 +0000 (00:40 -0500)]
lbxgui: Compile in the glade UI description.

I don't think it makes any sense to try and jump through hoops to find
this data at runtime, given that the data and the code are so intimately
connected.

14 years agolicense: Fix copyright years in source files.
Nick Bowler [Wed, 10 Feb 2010 04:54:52 +0000 (23:54 -0500)]
license: Fix copyright years in source files.

14 years agolbxgui: Add copyright notices.
Nick Bowler [Wed, 10 Feb 2010 04:51:11 +0000 (23:51 -0500)]
lbxgui: Add copyright notices.

14 years agodoc: Update man pages to reflect reality.
Nick Bowler [Wed, 10 Feb 2010 04:48:33 +0000 (23:48 -0500)]
doc: Update man pages to reflect reality.