Merge pull request #2151 from Areloch/Library_Trimming

Removes the LibMNG and LunGIF libraries
This commit is contained in:
Areloch 2018-01-09 01:43:33 -06:00 committed by GitHub
commit 94eb457be4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
211 changed files with 0 additions and 136386 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,57 +0,0 @@
/* ************************************************************************** */
/* * * */
/* * COPYRIGHT NOTICE: * */
/* * * */
/* * Copyright (c) 2000-2007 Gerard Juyn (gerard@libmng.com) * */
/* * [You may insert additional notices after this sentence if you modify * */
/* * this source] * */
/* * * */
/* * For the purposes of this copyright and license, "Contributing Authors" * */
/* * is defined as the following set of individuals: * */
/* * * */
/* * Gerard Juyn * */
/* * Glenn Randers-Pehrson * */
/* * * */
/* * The MNG Library is supplied "AS IS". The Contributing Authors * */
/* * disclaim all warranties, expressed or implied, including, without * */
/* * limitation, the warranties of merchantability and of fitness for any * */
/* * purpose. The Contributing Authors assume no liability for direct, * */
/* * indirect, incidental, special, exemplary, or consequential damages, * */
/* * which may result from the use of the MNG Library, even if advised of * */
/* * the possibility of such damage. * */
/* * * */
/* * Permission is hereby granted to use, copy, modify, and distribute this * */
/* * source code, or portions hereof, for any purpose, without fee, subject * */
/* * to the following restrictions: * */
/* * * */
/* * 1. The origin of this source code must not be misrepresented; * */
/* * you must not claim that you wrote the original software. * */
/* * * */
/* * 2. Altered versions must be plainly marked as such and must not be * */
/* * misrepresented as being the original source. * */
/* * * */
/* * 3. This Copyright notice may not be removed or altered from any source * */
/* * or altered source distribution. * */
/* * * */
/* * The Contributing Authors specifically permit, without fee, and * */
/* * encourage the use of this source code as a component to supporting * */
/* * the MNG and JNG file format in commercial products. If you use this * */
/* * source code in a product, acknowledgment would be highly appreciated. * */
/* * * */
/* ************************************************************************** */
/* * * */
/* * Parts of this software have been adapted from the libpng package. * */
/* * Although this library supports all features from the PNG specification * */
/* * (as MNG descends from it) it does not require the libpng package. * */
/* * It does require the zlib library and optionally the IJG jpeg library, * */
/* * and/or the "little-cms" library by Marti Maria (depending on the * */
/* * inclusion of support for JNG and Full-Color-Management respectively. * */
/* * * */
/* * This library's function is primarily to read and display MNG * */
/* * animations. It is not meant as a full-featured image-editing * */
/* * component! It does however offer creation and editing functionality * */
/* * at the chunk level. * */
/* * (future modifications may include some more support for creation * */
/* * and or editing) * */
/* * * */
/* ************************************************************************** */

View file

@ -1,36 +0,0 @@
libmng 1.0.10
-------------
Added provisional ANG and anIM support, and made some minor bugfixes.
libmng 1.0.9
------------
A number of optimizations in the chunk handling and reader/writer code.
This saves over 20KB on binary footprint!
Also several bugfixes and a couple of patches bring it another step
closer to perfection.... :-)
See CHANGELOG for details.
Y.T.
Gerard
For more information please visit:
The official libmng web-site:
http://www.libmng.com/
Libmng's community on SourceForge:
https://sourceforge.net/project/?group_id=5635
The official MNG homepage:
http://www.libpng.org/pub/mng/
The official PNG homepage:
http://www.libpng.org/pub/png/

View file

@ -1,213 +0,0 @@
**********************************************************************
**********************************************************************
***** this is unmaintained *****
If you happen to find problems with autoconfiguration and building,
I simply cannot help you. I'm looking for a maintainer that doesn't mind
spending a few minutes every now and then on the next release to make sure
things are still in working order.
For the moment all autoconf stuff ahs been moved into unmaintained!!
**********************************************************************
**********************************************************************
Configuration from CVS
======================
If you're using source checked out from CVS, rather than a source
distribution tarball, please be aware that you can use ./autogen.sh in
place of ./configure below.
Because this is a cross-platform project, the source templates for
the autoconf scripts are sequestered in the 'makefiles' directory.
Running './autogen.sh' will copy them into their conventional places at
the lop level. If you already see the files there, you don't need to
worry about this step.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.

View file

@ -1,104 +0,0 @@
Configuration options in libmng
===============================
The library is fairly configurable through the use of a number of defines.
Please note however that certain defines are for internal use only.
The following list gives a summary of options that can be used externally to
define the functionality of the library:
========================================
#define MNG_BUILD_DLL
This is used to indicate that a "standard" DLL should result from compiling
the library. Please note the remarks in README.dll if you intend to work
with the library as a DLL. The purpose of this option is to ensure that
DLL builds have the same set of functions.
#define MNG_BUILD_SO
This is used to indicate that a "standard" shared library (SO) should result
from a compilation. The purpose of this option is to ensure that all
shared libraries generated this way will have the same set of functions.
#define MNG_USE_DLL / #define MNG_USE_SO
These should be used when including the library header in the compilation
of an application to indicate that the compiler/linker must take the
necessary steps to make the binary executable to use the standard DLL
or shared library (SO).
#define MNG_SKIP_ZLIB / #define MNG_SKIP_LCMS / #define MNG_SKIP_IJG6B
Use these in conjunction with MNG_USE_DLL / MNG_USE_SO. This is useful if
you only need the external definitions of the MNG library and not the others,
which will speed up the compilation process.
#define MNG_SUPPORT_FULL / #define MNG_SUPPORT_LC / #define MNG_SUPPORT_VLC
These can be used to indicate the level of MNG spec compliance required.
Currently only full MNG compliance is supported.
#define MNG_SUPPORT_IJG6B
This can be used to indicate if JNG support is required. This option will
include the IJG JPEG-library. Note that MNG_SUPPORT_FULL will automatically
set this option. Use this only if you need JNG support with MNG-(V)LC.
#define MNG_FULL_CMS / #define MNG_GAMMA_ONLY / #define MNG_NO_CMS /
#define MNG_APP_CMS
These indicate the color-correction support level of the library.
If you are on a platform that supports lcms (Little CMS by Marti Maria Saguar)
then it is highly recommended to define MNG_FULL_CMS.
If your platform has it's own CMS then select MNG_APP_CMS and be sure to
include the appropriate callbacks in your app.
In all other cases it is recommended to define MNG_GAMMA_ONLY.
#define MNG_SUPPORT_READ / #define MNG_SUPPORT_WRITE /
#define MNG_SUPPORT_DISPLAY
These indicate the high-level support for reading, writing and/or
displaying files. Note that in order to display a file, you'll need to read
it first. (yes, really!)
#define MNG_STORE_CHUNKS
This indicates that the library should store chunk-information when reading
a file. This information can then be processed through the
MNG_ITERATE_CHUNKS() function. Note that you must specify this option if
you want to create and write a new file.
#define MNG_ACCESS_CHUNKS
This is used to indicate that the app may need access to internally stored
chunk information. MNG_STORE_CHUNKS must be defined as well for this option
to function properly.
#define MNG_INTERNAL_MEMMNGMT
You can use this to have the library handle it's own memory allocation and
deallocation through the "standard" memory functions. This option is turned
off by default, which means your app must define the memory callbacks.
#define MNG_ERROR_TELLTALE
Set this on to allow human-readable error-messages to be included in the
library and the error function and callback.
#define MNG_BIGENDIAN_SUPPORTED
This option should be used to indicate the hardware is based on big endian
integers.
#define MNG_SUPPORT_TRACE / #define MNG_TRACE_TELLTALE
These two can be used when debugging an app. You'll need to have the trace
callback setup also. This allows for a rather thorough investigation of the
libraries function paths.
========================================
Any other optional defines you may encounter are for internal use only.
please do not specify them externally. In case of doubt, consult the
support email lists. More info can be found on http://www.libmng.com

View file

@ -1,95 +0,0 @@
The contrib directory contains contributions made by fellow
enthousiasts. (Check respective web-sites for the latest version)
----------------------------------------------------------------------
mngplg - A Netscape plugin for MNG - by Jason Summers
http://pobox.com/~jason1/imaging/mngplg/
The very first contribution, and what a start!
GIF look out, MNG is on the prowl and ready to swat you like a fly!
----------------------------------------------------------------------
mngplay - An SDL based MNG viewer - by Ralph Giles
http://snow.ashlu.bc.ca/~giles/mng/
Another nice contribution. View MNG files on practically any platform
with this standalone viewer.
Source-code only; Requires SDL library and libmng.so
(Modified by Greg Roelofs)
----------------------------------------------------------------------
mngview - A BCB port of the Delphi sample - by Andy Protano
I have added this nice little port to the BCB samples directory.
It adds a nifty progressbar while reading a file. Excellent work!
Requires libmng.dll
(note: this is in the BCB samples directory)
----------------------------------------------------------------------
mngdump - A BCB GUI-based dump utility - by Andy Protano
Andy has sent me this fully functional MNG dump utility, that gives
detailed information of the contents of any MNG file.
Requires libmng.dll
----------------------------------------------------------------------
mng-view - A GTK-based MNG viewer - by Vova Babin
Vova has been hacking away with the libmng code and has come up with
this nice little sample how to write a MNG viewer using GTK.
Thanks mate!
Source-code only
Requires GTK+ (1.2 or higher) and libmng (0.9.2 or higher)
(Modified by Greg Roelofs)
----------------------------------------------------------------------
mngview - Another MNG viewer; this one for MSVC - by Nicholaus Brennig
A welcome contribution from Nicholaus. Author of SlowView. A very nice
image-handling utility for Windows. A welcome contribution since there
have been numerous questions about linking libmng with MSVC.
Well, look no further. Here it is!
----------------------------------------------------------------------
MSVC libmng project - An MSVC project to build libmng.dll
- by Chad Austin
Chad has contributed some project-files that you could use to build
libmng.dll with MSVC. Please be sure to read the README file included.
----------------------------------------------------------------------
fbmngplay - A simple fbcon based mng player - by Stefan Reinauer
Stefan has contributed this little example, based on Ralph's
SDL player. It uses the kernel framebuffer device to display mng
animations through the libmng interface.
(currently for 16-bit buffers only)
----------------------------------------------------------------------
xmngview - Lesstif/Motif standalone player for MNG files
- by Winfried Szukalski
Winfried contributed this MNG player for X-based systems.
(recently updated)
----------------------------------------------------------------------
makemng - A delta-MNG creation utility for MSVC - by Alex Volkov
Alex sent me this nice utility that will allow you to create highly
optmized MNGs using the delta-PNG capabilities of MNG.
----------------------------------------------------------------------

View file

@ -1,41 +0,0 @@
Standard Windows DLL
====================
The DLL provided in the BCB/win32dll directory is meant as the sole candidate
for distributions, based on libmng.dll, that install the DLL into the public
Windows system-directory. The outline herein defines the requirements to
which such a distribution must comply. If you cannot comply with these
requirements please install the dll in the same directory as your application
and NOT in the Windows system-directory!!!
1) Only the DLL already assembled in the libmng distribution may be used for
other distributions!
2) Only stable public releases are eligible for distribution! A public release
is one where the y-value of the x.y.z version-code is an even number.
Eg. 1.0.0, 1.2.1, 2.4.7, etc.
3) The installation program MUST store the DLL in the Windows system-directory!
Eg. C:\WinNT\System32, C:\Windows98\System
(Note: InstallShield users can use the <SYSDIR> variable)
3) The installation program MUST flag the file as a shared library!
4) The installation program MUST NOT install the DLL if a newer version
already exists in the Windows system-directory! The standard DLL provided
contains the Windows-default version-numbering system. PLEASE USE IT!!
DO NOT rely on the date or size of the files.
5) An uninstall procedure MAY NOT remove the DLL if other applications are
still linked to it! Proper handling as a shared library is imperitive.
6) TEST IT, TEST IT, TEST IT!!! (I just can't stress this enough)
If you don't have enough time, let someone else test it BEFORE you
distribute!
The penalty for violating these rules is inclusion of your name in the list
of endangered but useless species (just below the GIF entry!), and on my
blacklist. YOU HAVE BEEN FOREWARNED!

View file

@ -1,48 +0,0 @@
The samples are in platform-specific directories.
!!! contributions are very welcome !!!
bcb - Borland C++ Builder (3.0) (found under bcb/xxx)
-----------------------------------------------------
win32dll - sample project to create a Windows dll. Requires zlib1.2.1,
IJG jpgsrc6b and lcms1.0.14. The directories containing these
libraries must be at the same level as the libmng directory.
So if you're in the directory with this file and the libmng
sources, they should be in ..\zlib , ..\jpgsrc6b and ..\lcms
respectively.
!!! To run the other Win32 samples you need to copy the libmng.dll
file from here into the sample's directory !!!
mngtree - sample project to create a little command-line tool that dumps
the chunk-structure of a given file onto stdout.
bogus - a completely bogus example on how to create a perfectly valid
(though slightly biased) MNG.
mngview - port of the Delphi mngview sample. contributed by Andy Protano.
see also README.contrib
mngrepair- an example on how to fix invalid MNG files
uses the new mng_copy_chunks() function and MNG_SOFTERRORS to
'ignore' certain input-errors. This conditional *MUST* only be used
for exactly this kind of software; eg. repair utilities.
delphi - Borland Delphi (3.0+) (found under contrib/delphi/xxx)
---------------------------------------------------------------
mngview - sample project for a simple mng-viewer. The general unit in
the delphi directory was translated from libmng.h It can be
used in other projects to access libmng.dll created with the
win32dll example above.
unix - Unix (found under contrib/gcc/xxx)
-----------------------------------------
mngtree - basically a copy of the BCB sample. It includes a makefile for
Linux and it's been tested on RedHat6.2

View file

@ -1,46 +0,0 @@
/*
You can use one or more of the following defines to
reduce the size of the compiled library. Define the
SKIPCANVAS macros for any canvas configurations that
your application doesn't use. Define the SKIPCHUNK
macros for any chunks that your application doesn't
process. Define MNG_OPTIMIZE_FOOTPRINT to choose
smaller code size over faster execution and less memory
usage. These macros became available in version 1.0.6.
*/
/* eliminate unused features from libmng */
#define MNG_OPTIMIZE_FOOTPRINT
#define MNG_OPTIMIZE_OBJCLEANUP
#define MNG_OPTIMIZE_CHUNKINITFREE
#define MNG_OPTIMIZE_CHUNKASSIGN
#define MNG_OPTIMIZE_CHUNKREADER
#define MNG_SKIPCANVAS_ABGR8
#define MNG_SKIPCANVAS_ARGB8
#define MNG_SKIPCANVAS_BGR8
#define MNG_SKIPCANVAS_BGRA8
#define MNG_SKIPCANVAS_BGRA8_PM
#define MNG_SKIPCANVAS_BGRX8
#define MNG_SKIPCANVAS_RGBA8
#define MNG_SKIPCANVAS_BGR565
#define MNG_SKIPCANVAS_RGB565
#define MNG_SKIPCANVAS_BGRA565
#define MNG_SKIPCANVAS_RGBA565
#define MNG_SKIPCHUNK_iCCP
#define MNG_SKIPCHUNK_tEXt
#define MNG_SKIPCHUNK_zTXt
#define MNG_SKIPCHUNK_iTXt
#define MNG_SKIPCHUNK_bKGD
#define MNG_SKIPCHUNK_pHYs
#define MNG_SKIPCHUNK_sBIT
#define MNG_SKIPCHUNK_sPLT
#define MNG_SKIPCHUNK_hIST
#define MNG_SKIPCHUNK_tIME
#define MNG_SKIPCHUNK_eXPI
#define MNG_SKIPCHUNK_fPRI
#define MNG_SKIPCHUNK_nEED
#define MNG_SKIPCHUNK_pHYg

View file

@ -1,24 +0,0 @@
Packaging Libmng for distribution
---------------------------------
These are some notes for those building binaries for distribution.
We're interested to hear about anywhere libmng is helpful, so let us
know if you're including it with your application or OS. Also, if your
build is publicly accessible, we'd be happy to link to it from
the libmng site.
However, We respectfully request that you *not* distribute binaries as a
shared library (DLL) with any of the major features disabled. While
there is support for this in terms of #ifdef directives (in
libmng_conf.h) and autoconf switches they are intended for embedded
application and testing. The default compilation options support the
full MNG specification, and we wish to avoid the confusion among
general users that partial support would engender.
Platform specific notes:
We have a basic .spec file for generating rpms. Send us a note if you'd
like to clean it up.

View file

@ -1,184 +0,0 @@
# ---------------------------------------------------------------------------
!if !$d(BCB)
BCB = $(MAKEDIR)\..
!endif
# ---------------------------------------------------------------------------
# IDE SECTION
# ---------------------------------------------------------------------------
# The following section of the project makefile is managed by the BCB IDE.
# It is recommended to use the IDE to change any of the values in this
# section.
# ---------------------------------------------------------------------------
VERSION = BCB.03
# ---------------------------------------------------------------------------
PROJECT = bogus.exe
OBJFILES = bogus.obj
RESFILES = bogus.res
RESDEPEN = $(RESFILES)
LIBFILES = ..\win32dll\libmng.lib
LIBRARIES =
SPARELIBS =
PACKAGES = vclx35.bpi VCL35.bpi vcldb35.bpi vcldbx35.bpi bcbsmp35.bpi dclocx35.bpi \
Qrpt35.bpi
DEFFILE =
# ---------------------------------------------------------------------------
PATHCPP = .;
PATHASM = .;
PATHPAS = .;
PATHRC = .;
DEBUGLIBPATH = $(BCB)\lib\debug
RELEASELIBPATH = $(BCB)\lib\release
# ---------------------------------------------------------------------------
CFLAG1 = -O2 -w -r- -k -y -v -vi- -c -tWC
CFLAG2 = -D_NO_VCL;MNG_SUPPORT_WRITE;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS;MNG_USE_DLL \
-I..\win32dll;..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms;$(BCB)\include
CFLAG3 = -Tkh30000
PFLAGS = -D_NO_VCL;MNG_SUPPORT_WRITE;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS;MNG_USE_DLL \
-U..\win32dll;$(BCB)\lib;$(DEBUGLIBPATH) \
-I..\win32dll;..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms;$(BCB)\include \
-$Y -$W -$O- -v -JPHN -M
RFLAGS = -D_NO_VCL;MNG_SUPPORT_WRITE;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS;MNG_USE_DLL \
-i..\win32dll;..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms;$(BCB)\include
AFLAGS = /i..\win32dll /i..\..\..\libmng-devel /i..\..\..\zlib /i..\..\..\jpgsrc6b \
/i..\..\..\lcms /i$(BCB)\include /d_NO_VCL /dMNG_SUPPORT_WRITE \
/dMNG_ACCESS_CHUNKS /dMNG_STORE_CHUNKS /dMNG_NO_CMS /dMNG_USE_DLL /mx /w2 /zd
LFLAGS = -L..\win32dll;$(BCB)\lib;$(DEBUGLIBPATH) -ap -Tpe -x -Gn -v
IFLAGS =
# ---------------------------------------------------------------------------
ALLOBJ = c0x32.obj $(OBJFILES)
ALLRES = $(RESFILES)
ALLLIB = $(LIBFILES) import32.lib cw32mt.lib
# ---------------------------------------------------------------------------
!ifdef IDEOPTIONS
[Version Info]
IncludeVerInfo=1
AutoIncBuild=1
MajorVer=1
MinorVer=0
Release=1
Build=9
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1033
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=Executable (Console)
FileVersion=1.0.1.9
InternalName=bogus
LegalCopyright=copyright (c) 2000,2002 G. Juyn
LegalTrademarks=
OriginalFilename=bogus.exe
ProductName=bogus
ProductVersion=1.0.1
Comments=
[Excluded Packages]
C:\Program Files\Borland\CBuilder3\Bin\DbX35.bpl=(untitled)
[HistoryLists\hlIncludePath]
Count=3
Item0=..\win32dll;..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms;$(BCB)\include
Item1=..\..\..\libmng-devel;..\..\..\zlib;$(BCB)\include
Item2=..\..\..\libmng;..\..\..\zlib;$(BCB)\include
[HistoryLists\hlLibraryPath]
Count=2
Item0=..\win32dll;$(BCB)\lib
Item1=$(BCB)\lib
[HistoryLists\hlConditionals]
Count=2
Item0=_NO_VCL;MNG_SUPPORT_WRITE;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS;MNG_USE_DLL
Item1=_NO_VCL;MNG_SUPPORT_WRITE;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_USE_DLL
[Debugging]
DebugSourceDirs=
[Parameters]
RunParams=
HostApplication=
!endif
# ---------------------------------------------------------------------------
# MAKE SECTION
# ---------------------------------------------------------------------------
# This section of the project file is not used by the BCB IDE. It is for
# the benefit of building from the command-line using the MAKE utility.
# ---------------------------------------------------------------------------
.autodepend
# ---------------------------------------------------------------------------
!if !$d(BCC32)
BCC32 = bcc32
!endif
!if !$d(DCC32)
DCC32 = dcc32
!endif
!if !$d(TASM32)
TASM32 = tasm32
!endif
!if !$d(LINKER)
LINKER = ilink32
!endif
!if !$d(BRCC32)
BRCC32 = brcc32
!endif
# ---------------------------------------------------------------------------
!if $d(PATHCPP)
.PATH.CPP = $(PATHCPP)
.PATH.C = $(PATHCPP)
!endif
!if $d(PATHPAS)
.PATH.PAS = $(PATHPAS)
!endif
!if $d(PATHASM)
.PATH.ASM = $(PATHASM)
!endif
!if $d(PATHRC)
.PATH.RC = $(PATHRC)
!endif
# ---------------------------------------------------------------------------
$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE)
$(BCB)\BIN\$(LINKER) @&&!
$(LFLAGS) +
$(ALLOBJ), +
$(PROJECT),, +
$(ALLLIB), +
$(DEFFILE), +
$(ALLRES)
!
# ---------------------------------------------------------------------------
.pas.hpp:
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
.pas.obj:
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
.cpp.obj:
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
.c.obj:
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
.asm.obj:
$(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@
.rc.res:
$(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $<
# ---------------------------------------------------------------------------

View file

@ -1,212 +0,0 @@
/* ************************************************************************** */
/* * * */
/* * COPYRIGHT NOTICE: * */
/* * * */
/* * Copyright (c) 2000,2002 Gerard Juyn (gerard@libmng.com) * */
/* * [You may insert additional notices after this sentence if you modify * */
/* * this source] * */
/* * * */
/* * For the purposes of this copyright and license, "Contributing Authors" * */
/* * is defined as the following set of individuals: * */
/* * * */
/* * Gerard Juyn * */
/* * (hopefully some more to come...) * */
/* * * */
/* * The MNG Library is supplied "AS IS". The Contributing Authors * */
/* * disclaim all warranties, expressed or implied, including, without * */
/* * limitation, the warranties of merchantability and of fitness for any * */
/* * purpose. The Contributing Authors assume no liability for direct, * */
/* * indirect, incidental, special, exemplary, or consequential damages, * */
/* * which may result from the use of the MNG Library, even if advised of * */
/* * the possibility of such damage. * */
/* * * */
/* * Permission is hereby granted to use, copy, modify, and distribute this * */
/* * source code, or portions hereof, for any purpose, without fee, subject * */
/* * to the following restrictions: * */
/* * * */
/* * 1. The origin of this source code must not be misrepresented; * */
/* * you must not claim that you wrote the original software. * */
/* * * */
/* * 2. Altered versions must be plainly marked as such and must not be * */
/* * misrepresented as being the original source. * */
/* * * */
/* * 3. This Copyright notice may not be removed or altered from any source * */
/* * or altered source distribution. * */
/* * * */
/* * The Contributing Authors specifically permit, without fee, and * */
/* * encourage the use of this source code as a component to supporting * */
/* * the MNG and JNG file format in commercial products. If you use this * */
/* * source code in a product, acknowledgment would be highly appreciated. * */
/* * * */
/* ************************************************************************** */
/* * * */
/* * project : bogus * */
/* * file : bogus.cpp copyright (c) 2000,2002 G.Juyn * */
/* * version : 1.0.1 * */
/* * * */
/* * purpose : main project file * */
/* * * */
/* * author : G.Juyn * */
/* * web : http://www.3-t.com * */
/* * email : mailto:info@3-t.com * */
/* * * */
/* * comment : bogus is (quite literally) a bogus sample which creates and* */
/* * writes a totally valid, be it somewhat trivial, MNG-file * */
/* * * */
/* * changes : 0.5.3 - 06/26/2000 - G.Juyn * */
/* * - changed userdata variable to mng_ptr * */
/* * 0.5.3 - 06/28/2000 - G.Juyn * */
/* * - changed memory allocation size parameters to mng_size_t * */
/* * * */
/* * 1.0.1 - 10/07/2002 - G.Juyn * */
/* * - fixed copyright notice * */
/* * - updated MHDR simplicity flag * */
/* * * */
/* ************************************************************************** */
#pragma hdrstop
#include <condefs.h>
#include <stdio.h>
#include <stdlib.h>
#include <mem.h>
#include "libmng.h"
/* ************************************************************************** */
USERES("bogus.res");
USELIB("..\win32dll\libmng.lib");
//---------------------------------------------------------------------------
typedef struct user_struct {
FILE *hFile; /* file handle */
} userdata;
typedef userdata * userdatap;
/* ************************************************************************** */
#define MY_DECL __stdcall /* get the right callback convention */
/* ************************************************************************** */
mng_ptr MY_DECL myalloc (mng_size_t iSize)
{
return (mng_ptr)calloc (1, iSize); /* duh! */
}
/* ************************************************************************** */
#pragma argsused
void MY_DECL myfree (mng_ptr pPtr, mng_size_t iSize)
{
free (pPtr); /* duh! */
return;
}
/* ************************************************************************** */
#pragma argsused
mng_bool MY_DECL myopenstream (mng_handle hMNG)
{
return MNG_TRUE; /* already opened in main function */
}
/* ************************************************************************** */
#pragma argsused
mng_bool MY_DECL myclosestream (mng_handle hMNG)
{
return MNG_TRUE; /* gets closed in main function */
}
/* ************************************************************************** */
mng_bool MY_DECL mywritedata (mng_handle hMNG,
mng_ptr pBuf,
mng_uint32 iSize,
mng_uint32 *iWritten)
{ /* get to my file handle */
userdatap pMydata = (userdatap)mng_get_userdata (hMNG);
/* write it */
*iWritten = fwrite (pBuf, 1, iSize, pMydata->hFile);
/* iWritten will indicate errors */
return MNG_TRUE;
}
/* ************************************************************************** */
int makeimage (char * zFilename)
{
userdatap pMydata;
mng_handle hMNG;
mng_retcode iRC;
/* get a data buffer */
pMydata = (userdatap)calloc (1, sizeof (userdata));
if (pMydata == NULL) /* oke ? */
{
fprintf (stderr, "Cannot allocate a data buffer.\n");
return 1;
}
/* can we open the file ? */
if ((pMydata->hFile = fopen (zFilename, "wb")) == NULL)
{ /* error out if we can't */
fprintf (stderr, "Cannot open output file %s.\n", zFilename);
return 1;
}
/* let's initialize the library */
hMNG = mng_initialize ((mng_ptr)pMydata, myalloc, myfree, MNG_NULL);
if (!hMNG) /* did that work out ? */
{
fprintf (stderr, "Cannot initialize libmng.\n");
iRC = 1;
}
else
{ /* setup callbacks */
if ( ((iRC = mng_setcb_openstream (hMNG, myopenstream )) != 0) ||
((iRC = mng_setcb_closestream (hMNG, myclosestream)) != 0) ||
((iRC = mng_setcb_writedata (hMNG, mywritedata )) != 0) )
fprintf (stderr, "Cannot set callbacks for libmng.\n");
else
{ /* create the file in memory */
if ( ((iRC = mng_create (hMNG) ) != 0) ||
((iRC = mng_putchunk_mhdr (hMNG, 640, 480, 1000, 3, 1, 3, 0x0047) ) != 0) ||
((iRC = mng_putchunk_basi (hMNG, 640, 160, 8, 2, 0, 0, 0, 0xFF, 0x00, 0x00, 0xFF, 1)) != 0) ||
((iRC = mng_putchunk_iend (hMNG) ) != 0) ||
((iRC = mng_putchunk_defi (hMNG, 0, 0, 0, MNG_TRUE, 0, 160, MNG_FALSE, 0, 0, 0, 0 )) != 0) ||
((iRC = mng_putchunk_basi (hMNG, 640, 160, 8, 2, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 1)) != 0) ||
((iRC = mng_putchunk_iend (hMNG) ) != 0) ||
((iRC = mng_putchunk_defi (hMNG, 0, 0, 0, MNG_TRUE, 0, 320, MNG_FALSE, 0, 0, 0, 0 )) != 0) ||
((iRC = mng_putchunk_basi (hMNG, 640, 160, 8, 2, 0, 0, 0, 0x00, 0x00, 0xFF, 0xFF, 1)) != 0) ||
((iRC = mng_putchunk_iend (hMNG) ) != 0) ||
((iRC = mng_putchunk_mend (hMNG) ) != 0) )
fprintf (stderr, "Cannot create the chunks for the image.\n");
else
{
if ((iRC = mng_write (hMNG)) != 0)
fprintf (stderr, "Cannot write the image.\n");
}
}
mng_cleanup (&hMNG); /* cleanup the library */
}
fclose (pMydata->hFile); /* cleanup */
free (pMydata);
return iRC;
}
/* ************************************************************************** */
#pragma argsused
int main (int argc, char *argv[])
{
return makeimage ("dutch.mng");
}
/* ************************************************************************** */

View file

@ -1,235 +0,0 @@
# ---------------------------------------------------------------------------
!if !$d(BCB)
BCB = $(MAKEDIR)\..
!endif
# ---------------------------------------------------------------------------
# IDE SECTION
# ---------------------------------------------------------------------------
# The following section of the project makefile is managed by the BCB IDE.
# It is recommended to use the IDE to change any of the values in this
# section.
# ---------------------------------------------------------------------------
VERSION = BCB.03
# ---------------------------------------------------------------------------
PROJECT = mngrepair.exe
OBJFILES = obj\mngrepair.obj obj\libmng_hlapi.obj obj\libmng_callback_xs.obj \
obj\libmng_prop_xs.obj obj\libmng_chunk_xs.obj obj\libmng_object_prc.obj \
obj\libmng_chunk_prc.obj obj\libmng_chunk_io.obj obj\libmng_read.obj \
obj\libmng_write.obj obj\libmng_display.obj obj\libmng_dither.obj \
obj\libmng_pixels.obj obj\libmng_filter.obj obj\libmng_error.obj \
obj\libmng_trace.obj obj\libmng_cms.obj obj\libmng_zlib.obj obj\libmng_jpeg.obj \
obj\adler32.obj obj\compress.obj obj\crc32.obj obj\deflate.obj obj\infblock.obj \
obj\infcodes.obj obj\inffast.obj obj\inflate.obj obj\inftrees.obj \
obj\infutil.obj obj\trees.obj obj\uncompr.obj obj\zutil.obj
RESFILES = mngrepair.res
RESDEPEN = $(RESFILES)
LIBFILES =
LIBRARIES = VCL35.lib
SPARELIBS = VCL35.lib
PACKAGES = vclx35.bpi VCL35.bpi vcldb35.bpi vcldbx35.bpi bcbsmp35.bpi dclocx35.bpi \
Qrpt35.bpi
DEFFILE =
# ---------------------------------------------------------------------------
PATHCPP = .;..\..;..\..\..\zlib
PATHASM = .;
PATHPAS = .;
PATHRC = .;
DEBUGLIBPATH = $(BCB)\lib\debug
RELEASELIBPATH = $(BCB)\lib\release
# ---------------------------------------------------------------------------
CFLAG1 = -Od -Hc -w -r- -d -k -y -v -vi- -w-par -c -tWC
CFLAG2 = -D_NO_VCL;MNG_SUPPORT_FULL;MNG_SUPPORT_READ;MNG_SUPPORT_WRITE;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_INCLUDE_ZLIB;MNG_NO_CMS;MNG_SOFTERRORS \
-I..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;$(BCB)\include \
-H=$(BCB)\lib\vcl35.csm
CFLAG3 = -Tkh30000 -ff -5 -wuse -wucp -wstv -wstu -wsig -wpin -wnod -wnak -wdef -wcln \
-wbbf -wasm -wamp -wamb
PFLAGS = -D_NO_VCL;MNG_SUPPORT_FULL;MNG_SUPPORT_READ;MNG_SUPPORT_WRITE;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_INCLUDE_ZLIB;MNG_NO_CMS;MNG_SOFTERRORS \
-N2.\obj -N0.\obj \
-U..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;$(BCB)\lib;$(RELEASELIBPATH) \
-I..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;$(BCB)\include -H -W \
-$Y -$W -$O- -v -JPHN -M
RFLAGS = -D_NO_VCL;MNG_SUPPORT_FULL;MNG_SUPPORT_READ;MNG_SUPPORT_WRITE;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_INCLUDE_ZLIB;MNG_NO_CMS;MNG_SOFTERRORS \
-i..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;$(BCB)\include
AFLAGS = /i..\..\..\libmng-devel /i..\..\..\zlib /i..\..\..\jpgsrc6b /i$(BCB)\include \
/d_NO_VCL /dMNG_SUPPORT_FULL /dMNG_SUPPORT_READ /dMNG_SUPPORT_WRITE \
/dMNG_ACCESS_CHUNKS /dMNG_STORE_CHUNKS /dMNG_INCLUDE_ZLIB /dMNG_NO_CMS \
/dMNG_SOFTERRORS /mx /w2 /zd
LFLAGS = -L..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;$(BCB)\lib;$(RELEASELIBPATH) \
-ap -Tpe -x -Gn -wdef -wdpl -v
IFLAGS =
# ---------------------------------------------------------------------------
ALLOBJ = c0x32.obj $(OBJFILES)
ALLRES = $(RESFILES)
ALLLIB = $(LIBFILES) import32.lib cw32mt.lib
# ---------------------------------------------------------------------------
!ifdef IDEOPTIONS
[Version Info]
IncludeVerInfo=1
AutoIncBuild=1
MajorVer=1
MinorVer=0
Release=0
Build=27
Debug=1
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1033
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=Executable (Console)
FileVersion=1.0.0.27
InternalName=mngrepair
LegalCopyright=copyright (c) 2002 G.Juyn
LegalTrademarks=
OriginalFilename=mngrepair.exe
ProductName=mngrepair
ProductVersion=1.0
Comments=
[Excluded Packages]
C:\Program Files\Borland\CBuilder3\Bin\DbX35.bpl=(untitled)
[HistoryLists\hlIncludePath]
Count=9
Item0=..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;$(BCB)\include
Item1=..\..\..\libmng-devel;..\..;..\..\..\zlib;..\..\..\jpgsrc6b;$(BCB)\include
Item2=..\..;..\..\..\zlib;..\..\..\jpgsrc6b;$(BCB)\include
Item3=..\..\..\libmng-devel;..\..;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms;$(BCB)\include
Item4=..\..;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms;$(BCB)\include
Item5=..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms;$(BCB)\include
Item6=..\..\..\libmng;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms;$(BCB)\include
Item7=..\..\..\libmng;..\..\..\zlib;$(BCB)\include
Item8=..\..\..\libmng;$(BCB)\include
[HistoryLists\hlLibraryPath]
Count=7
Item0=..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;$(BCB)\lib
Item1=..\..\..\libmng-devel;..\..;..\..\..\zlib;..\..\..\jpgsrc6b;$(BCB)\lib
Item2=..\..;..\..\..\zlib;..\..\..\jpgsrc6b;$(BCB)\lib
Item3=..\..\..\jpgsrc6b;..\..\..\zlib;..\..\..\libmng-devel;..\win32dll;$(BCB)\lib
Item4=..\win32dll;$(BCB)\lib
Item5=..\..\..\libmng\bcb\win32dll;$(BCB)\lib
Item6=..\..\..\libmng;$(BCB)\lib
[HistoryLists\hlDebugSourcePath]
Count=1
Item0=..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b
[HistoryLists\hlConditionals]
Count=13
Item0=_NO_VCL;MNG_SUPPORT_FULL;MNG_SUPPORT_READ;MNG_SUPPORT_WRITE;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_INCLUDE_ZLIB;MNG_NO_CMS;MNG_SOFTERRORS
Item1=_NO_VCL;MNG_SUPPORT_FULL;MNG_SUPPORT_READ;MNG_SUPPORT_WRITE;MNG_SUPPORT_DISPLAY;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_INCLUDE_ZLIB;MNG_INCLUDE_IJG6B;MNG_NO_CMS;MNG_DEFINE_JPEG_STDCALL;MNG_SOFTERRORS
Item2=_NO_VCL;MNG_SUPPORT_FULL;MNG_SUPPORT_READ;MNG_SUPPORT_WRITE;MNG_SUPPORT_DISPLAY;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_INCLUDE_ZLIB;MNG_INCLUDE_IJG6B;MNG_NO_CMS;MNG_DEFINE_JPEG_STDCALL;MNG_SOFTERROR
Item3=_NO_VCL;MNG_SUPPORT_FULL;MNG_SUPPORT_READ;MNG_SUPPORT_WRITE;MNG_SUPPORT_DISPLAY;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_INCLUDE_ZLIB;MNG_INCLUDE_IJG6B;MNG_NO_CMS;MNG_DEFINE_JPEG_STDCALL
Item4=_NO_VCL;MNG_SUPPORT_FULL;MNG_SUPPORT_READ;MNG_SUPPORT_WRITE;MNG_SUPPORT_DISPLAY;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_INCLUDE_ZLIB;MNG_INCLUDE_IJG;MNG_NO_CMS;MNG_DEFINE_JPEG_STDCALL
Item5=_NO_VCL;MNG_SUPPORT_FULL;MNG_SUPPORT_READ;MNG_SUPPORT_WRITE;MNG_SUPPORT_DISPLAY;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS;MNG_DEFINE_JPEG_STDCALL
Item6=_NO_VCL;MNG_SUPPORT_READ;MNG_SUPPORT_WRITE;MNG_SUPPORT_DISPLAY;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS;MNG_DEFINE_JPEG_STDCALL;MNG_SUPPORT_IJG6B
Item7=_NO_VCL;MNG_SUPPORT_READ;MNG_SUPPORT_WRITE;MNG_SUPPORT_DISPLAY;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS;MNG_DEFINE_JPEG_STDCALL
Item8=_NO_VCL;MNG_SUPPORT_READ;MNG_SUPPORT_WRITE;MNG_SUPPORT_DISPLAY;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS
Item9=_NO_VCL;MNG_SUPPORT_READ;MNG_SUPPORT_WRITE;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS
Item10=_NO_VCL;MNG_SUPPORT_READ;MNG_SUPPORT_WRITE;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS;MNG_USE_DLL
Item11=_NO_VCL;MNG_SUPPORT_READ;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS;MNG_USE_DLL
Item12=_NO_VCL;MNG_SUPPORT_READ;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS
[HistoryLists\hlIntOutputDir]
Count=2
Item0=.\obj
Item1=..\..\..\obj
[HistoryLists\hlRunParameters]
Count=4
Item0=roilion02.mng roilion02-fixed.mng
Item1=roilion.mng roilion-fixed.mng
Item2=dutch.mng
Item3=usflag-lc-d63.mng
[Debugging]
DebugSourceDirs=..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b
[Parameters]
RunParams=roilion02.mng roilion02-fixed.mng
HostApplication=
!endif
# ---------------------------------------------------------------------------
# MAKE SECTION
# ---------------------------------------------------------------------------
# This section of the project file is not used by the BCB IDE. It is for
# the benefit of building from the command-line using the MAKE utility.
# ---------------------------------------------------------------------------
.autodepend
# ---------------------------------------------------------------------------
!if !$d(BCC32)
BCC32 = bcc32
!endif
!if !$d(DCC32)
DCC32 = dcc32
!endif
!if !$d(TASM32)
TASM32 = tasm32
!endif
!if !$d(LINKER)
LINKER = ilink32
!endif
!if !$d(BRCC32)
BRCC32 = brcc32
!endif
# ---------------------------------------------------------------------------
!if $d(PATHCPP)
.PATH.CPP = $(PATHCPP)
.PATH.C = $(PATHCPP)
!endif
!if $d(PATHPAS)
.PATH.PAS = $(PATHPAS)
!endif
!if $d(PATHASM)
.PATH.ASM = $(PATHASM)
!endif
!if $d(PATHRC)
.PATH.RC = $(PATHRC)
!endif
# ---------------------------------------------------------------------------
$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE)
$(BCB)\BIN\$(LINKER) @&&!
$(LFLAGS) +
$(ALLOBJ), +
$(PROJECT),, +
$(ALLLIB), +
$(DEFFILE), +
$(ALLRES)
!
# ---------------------------------------------------------------------------
.pas.hpp:
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
.pas.obj:
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
.cpp.obj:
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
.c.obj:
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
.asm.obj:
$(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@
.rc.res:
$(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $<
# ---------------------------------------------------------------------------

View file

@ -1,489 +0,0 @@
/* ************************************************************************** */
/* * * */
/* * COPYRIGHT NOTICE: * */
/* * * */
/* * Copyright (c) 2000-2002 Gerard Juyn (gerard@libmng.com) * */
/* * [You may insert additional notices after this sentence if you modify * */
/* * this source] * */
/* * * */
/* * For the purposes of this copyright and license, "Contributing Authors" * */
/* * is defined as the following set of individuals: * */
/* * * */
/* * Gerard Juyn * */
/* * (hopefully some more to come...) * */
/* * * */
/* * The MNG Library is supplied "AS IS". The Contributing Authors * */
/* * disclaim all warranties, expressed or implied, including, without * */
/* * limitation, the warranties of merchantability and of fitness for any * */
/* * purpose. The Contributing Authors assume no liability for direct, * */
/* * indirect, incidental, special, exemplary, or consequential damages, * */
/* * which may result from the use of the MNG Library, even if advised of * */
/* * the possibility of such damage. * */
/* * * */
/* * Permission is hereby granted to use, copy, modify, and distribute this * */
/* * source code, or portions hereof, for any purpose, without fee, subject * */
/* * to the following restrictions: * */
/* * * */
/* * 1. The origin of this source code must not be misrepresented; * */
/* * you must not claim that you wrote the original software. * */
/* * * */
/* * 2. Altered versions must be plainly marked as such and must not be * */
/* * misrepresented as being the original source. * */
/* * * */
/* * 3. This Copyright notice may not be removed or altered from any source * */
/* * or altered source distribution. * */
/* * * */
/* * The Contributing Authors specifically permit, without fee, and * */
/* * encourage the use of this source code as a component to supporting * */
/* * the MNG and JNG file format in commercial products. If you use this * */
/* * source code in a product, acknowledgment would be highly appreciated. * */
/* * * */
/* ************************************************************************** */
/* * * */
/* * project : mngrepair * */
/* * file : mngrepair.cpp copyright (c) 2002 G.Juyn * */
/* * version : 1.0.0 * */
/* * * */
/* * purpose : main project file * */
/* * * */
/* * author : G.Juyn * */
/* * web : http://www.3-t.com * */
/* * email : mailto:info@3-t.com * */
/* * * */
/* * comment : mngrepair iterates tries to fix a couple of 'common' * */
/* * MNG encoding errors (such as in JASC Animation Shop) * */
/* * * */
/* * changes : * */
/* * * */
/* ************************************************************************** */
#define HAVE_BOOLEAN
#include <windows.h>
#pragma hdrstop
#include <condefs.h>
#include "libmng.h"
/* ************************************************************************** */
USERES("mngrepair.res");
USEUNIT("..\..\libmng_hlapi.c");
USEUNIT("..\..\libmng_callback_xs.c");
USEUNIT("..\..\libmng_prop_xs.c");
USEUNIT("..\..\libmng_chunk_xs.c");
USEUNIT("..\..\libmng_object_prc.c");
USEUNIT("..\..\libmng_chunk_prc.c");
USEUNIT("..\..\libmng_chunk_io.c");
USEUNIT("..\..\libmng_read.c");
USEUNIT("..\..\libmng_write.c");
USEUNIT("..\..\libmng_display.c");
USEUNIT("..\..\libmng_dither.c");
USEUNIT("..\..\libmng_pixels.c");
USEUNIT("..\..\libmng_filter.c");
USEUNIT("..\..\libmng_error.c");
USEUNIT("..\..\libmng_trace.c");
USEUNIT("..\..\libmng_cms.c");
USEUNIT("..\..\libmng_zlib.c");
USEUNIT("..\..\libmng_jpeg.c");
USEUNIT("..\..\..\zlib\adler32.c");
USEUNIT("..\..\..\zlib\compress.c");
USEUNIT("..\..\..\zlib\crc32.c");
USEUNIT("..\..\..\zlib\deflate.c");
USEUNIT("..\..\..\zlib\infblock.c");
USEUNIT("..\..\..\zlib\infcodes.c");
USEUNIT("..\..\..\zlib\inffast.c");
USEUNIT("..\..\..\zlib\inflate.c");
USEUNIT("..\..\..\zlib\inftrees.c");
USEUNIT("..\..\..\zlib\infutil.c");
USEUNIT("..\..\..\zlib\trees.c");
USEUNIT("..\..\..\zlib\uncompr.c");
USEUNIT("..\..\..\zlib\zutil.c");
//---------------------------------------------------------------------------
typedef struct user_struct {
FILE *hFileI; /* input file handle */
FILE *hFileO; /* output file handle */
mng_handle hHandleI; /* input mng handle */
mng_handle hHandleO; /* output mng handle */
mng_bool bHasSAVE; /* indicates a SAVE in the input */
mng_bool bHasTERM; /* indicates we saved the TERM */
mng_bool bIsJASC; /* indicates if this is an AS file */
mng_chunkid iLastchunk; /* last processed chunk */
mng_retcode iError; /* errorcode from function in callback */
mng_uint8 iTermaction; /* saved TERM parameters */
mng_uint8 iIteraction;
mng_uint32 iDelay;
mng_uint32 iItermax;
} userdata;
typedef userdata * userdatap;
/* ************************************************************************** */
#define MY_DECL /* get the right callback convention */
/* ************************************************************************** */
mng_ptr MY_DECL myalloc (mng_size_t iSize)
{ /* duh! */
return (mng_ptr)calloc (1, (size_t)iSize);
}
/* ************************************************************************** */
#pragma argsused
void MY_DECL myfree (mng_ptr pPtr, mng_size_t iSize)
{
free (pPtr); /* duh! */
return;
}
/* ************************************************************************** */
#pragma argsused
mng_bool MY_DECL myopenstream (mng_handle hMNG)
{
return MNG_TRUE; /* already opened in main function */
}
/* ************************************************************************** */
#pragma argsused
mng_bool MY_DECL myclosestream (mng_handle hMNG)
{
return MNG_TRUE; /* gets closed in main function */
}
/* ************************************************************************** */
mng_bool MY_DECL myreaddata (mng_handle hMNG,
mng_ptr pBuf,
mng_uint32 iSize,
mng_uint32 *iRead)
{ /* get to my file handle */
userdatap pMydata = (userdatap)mng_get_userdata (hMNG);
/* read it */
*iRead = fread (pBuf, 1, iSize, pMydata->hFileI);
/* iRead will indicate EOF */
return MNG_TRUE;
}
/* ************************************************************************** */
mng_bool MY_DECL mywritedata (mng_handle hMNG,
mng_ptr pBuf,
mng_uint32 iSize,
mng_uint32 *iWritten)
{ /* get to my file handle */
userdatap pMydata = (userdatap)mng_get_userdata (hMNG);
/* write it */
*iWritten = fwrite (pBuf, 1, iSize, pMydata->hFileO);
/* iWritten will indicate errors */
return MNG_TRUE;
}
/* ************************************************************************** */
mng_bool MY_DECL myprocesserror (mng_handle hMNG,
mng_int32 iErrorcode,
mng_int8 iSeverity,
mng_chunkid iChunkname,
mng_uint32 iChunkseq,
mng_int32 iExtra1,
mng_int32 iExtra2,
mng_pchar zErrortext)
{ /* sequence error for TERM we ignore ! */
if ((iErrorcode == MNG_SEQUENCEERROR) && (iChunkname == MNG_UINT_TERM))
return MNG_TRUE;
return MNG_FALSE; /* all others get dumped ! */
}
/* ************************************************************************** */
#pragma argsused
mng_bool MY_DECL myiterchunk (mng_handle hMNG,
mng_handle hChunk,
mng_chunkid iChunktype,
mng_uint32 iChunkseq)
{
mng_uint32 iWidth; /* temps for IHDR processing */
mng_uint32 iHeight;
mng_uint8 iBitdepth;
mng_uint8 iColortype;
mng_uint8 iCompression;
mng_uint8 iFilter;
mng_uint8 iInterlace;
mng_bool bEmpty; /* temps for FRAM processing */
mng_uint8 iMode;
mng_uint32 iNamesize;
mng_pchar zName;
mng_uint8 iChangedelay;
mng_uint8 iChangetimeout;
mng_uint8 iChangeclipping;
mng_uint8 iChangesyncid;
mng_uint32 iDelay;
mng_uint32 iTimeout;
mng_uint8 iBoundarytype;
mng_int32 iBoundaryl;
mng_int32 iBoundaryr;
mng_int32 iBoundaryt;
mng_int32 iBoundaryb;
mng_uint32 iCount;
mng_uint32p pSyncids;
/* get to my userdata */
userdatap pMydata = (userdatap)mng_get_userdata (hMNG);
if (pMydata->hFileO) /* are we writing this time ? */
{ /* do we need to 'forget' the TERM ? */
if ((iChunktype == MNG_UINT_TERM) && (pMydata->bHasTERM))
;
else
{ /* fix JASC AS frame_type ? */
if ((iChunktype == MNG_UINT_FRAM) && (pMydata->bIsJASC))
{
if ((pMydata->iError = mng_getchunk_fram (hMNG, hChunk,
&bEmpty, &iMode, &iNamesize, &zName,
&iChangedelay, &iChangetimeout,
&iChangeclipping, &iChangesyncid,
&iDelay, &iTimeout, &iBoundarytype,
&iBoundaryl, &iBoundaryr,
&iBoundaryt, &iBoundaryb,
&iCount, &pSyncids)) != 0)
{
fprintf (stderr, "Cannot get FRAM fields.\n");
return MNG_FALSE; /* stop the process ! */
}
if (iMode == 1) /* really ? */
iMode = 3;
if ((pMydata->iError = mng_putchunk_fram (pMydata->hHandleO,
bEmpty, iMode, iNamesize, zName,
iChangedelay, iChangetimeout,
iChangeclipping, iChangesyncid,
iDelay, iTimeout, iBoundarytype,
iBoundaryl, iBoundaryr,
iBoundaryt, iBoundaryb,
iCount, pSyncids)) != 0)
{
fprintf (stderr, "Cannot write FRAM chunk.\n");
return MNG_FALSE; /* stop the process ! */
}
}
else
{
if ((pMydata->iError = mng_copy_chunk (hMNG, hChunk, pMydata->hHandleO)) != 0)
{
fprintf (stderr, "Cannot copy the chunk.\n");
return MNG_FALSE; /* stop the process ! */
}
}
}
/* need to insert TERM in the proper place ? */
if ((iChunktype == MNG_UINT_MHDR) && (pMydata->bHasTERM))
{
if ((pMydata->iError = mng_putchunk_term (pMydata->hHandleO,
pMydata->iTermaction,
pMydata->iIteraction,
pMydata->iDelay,
pMydata->iItermax)) != 0)
{
fprintf (stderr, "Cannot write TERM chunk.\n");
return MNG_FALSE; /* stop the process ! */
}
}
}
else /* first iteration; just checking stuff */
{
if (iChunktype == MNG_UINT_SAVE) /* SAVE ? */
{
pMydata->bHasSAVE = MNG_TRUE; /* we got a SAVE ! */
pMydata->bIsJASC = MNG_FALSE; /* so it's definitely not an invalid AS file */
}
else
{ /* TERM ? */
if (iChunktype == MNG_UINT_TERM)
{ /* is it in the wrong place ? */
if ((pMydata->iLastchunk != MNG_UINT_MHDR) ||
(pMydata->iLastchunk != MNG_UINT_SAVE) )
{
pMydata->bHasTERM = MNG_TRUE;
if ((pMydata->iError = mng_getchunk_term (hMNG, hChunk,
&pMydata->iTermaction,
&pMydata->iIteraction,
&pMydata->iDelay,
&pMydata->iItermax)) != 0)
{
fprintf (stderr, "Cannot get TERM fields.\n");
return MNG_FALSE; /* stop the process ! */
}
}
}
else
{ /* IHDR ? */
if (iChunktype == MNG_UINT_IHDR)
{
if ((pMydata->iError = mng_getchunk_ihdr (hMNG, hChunk,
&iWidth, &iHeight, &iBitdepth,
&iColortype, &iCompression,
&iFilter, &iInterlace)) != 0)
{
fprintf (stderr, "Cannot get IHDR fields.\n");
return MNG_FALSE; /* stop the process ! */
}
/* is it not a typical JASC AS file */
if ((iBitdepth != 8) || (iColortype != 6))
pMydata->bIsJASC = MNG_FALSE;
}
}
}
pMydata->iLastchunk = iChunktype;
}
return MNG_TRUE; /* keep'm coming... */
}
/* ************************************************************************** */
int fixit (char * zFilenameI,
char * zFilenameO)
{
userdatap pMydata;
mng_retcode iRC;
/* get a data buffer */
pMydata = (userdatap)calloc (1, sizeof (userdata));
if (pMydata == NULL) /* oke ? */
{
fprintf (stderr, "Cannot allocate a data buffer.\n");
return 1;
}
pMydata->hFileO = 0; /* initialize some stuff! */
pMydata->hHandleI = MNG_NULL;
pMydata->hHandleO = MNG_NULL;
pMydata->bHasSAVE = MNG_FALSE;
pMydata->bHasTERM = MNG_FALSE;
pMydata->bIsJASC = MNG_TRUE;
pMydata->iLastchunk = MNG_UINT_HUH;
pMydata->iTermaction = 0;
pMydata->iIteraction = 0;
pMydata->iDelay = 0;
pMydata->iItermax = 0;
/* can we open the input file ? */
if ((pMydata->hFileI = fopen (zFilenameI, "rb")) == NULL)
{ /* error out if we can't */
fprintf (stderr, "Cannot open input file %s.\n", zFilenameI);
return 1;
}
/* let's initialize the library */
pMydata->hHandleI = mng_initialize ((mng_ptr)pMydata, myalloc, myfree, MNG_NULL);
if (!pMydata->hHandleI) /* did that work out ? */
{
fprintf (stderr, "Cannot initialize libmng.\n");
iRC = 1;
}
else
{ /* some informatory messages */
fprintf (stderr, "Compiled with libmng %s.\n", MNG_VERSION_TEXT);
fprintf (stderr, "Running with libmng %s.\n", mng_version_text());
/* setup callbacks */
if ( ((iRC = mng_setcb_openstream (pMydata->hHandleI, myopenstream )) != 0) ||
((iRC = mng_setcb_closestream (pMydata->hHandleI, myclosestream )) != 0) ||
((iRC = mng_setcb_readdata (pMydata->hHandleI, myreaddata )) != 0) ||
((iRC = mng_setcb_errorproc (pMydata->hHandleI, myprocesserror)) != 0) )
fprintf (stderr, "Cannot set callbacks for libmng.\n");
else
{ /* reaad the file into memory */
if ((iRC = mng_read (pMydata->hHandleI)) != 0)
fprintf (stderr, "Cannot read the input file.\n");
else
{ /* run through the chunk list to get TERM */
if ((iRC = mng_iterate_chunks (pMydata->hHandleI, 0, myiterchunk)) != 0)
fprintf (stderr, "Cannot iterate the chunks.\n");
else
{
if (pMydata->iError) /* did the iteration fail somehow ? */
iRC = pMydata->iError;
else
{ /* can we open the output file ? */
if ((pMydata->hFileO = fopen (zFilenameO, "wb")) == NULL)
{ /* error out if we can't */
fprintf (stderr, "Cannot open output file %s.\n", zFilenameO);
iRC = 1;
}
else
{ /* let's initialize the library */
pMydata->hHandleO = mng_initialize ((mng_ptr)pMydata, myalloc, myfree, MNG_NULL);
if (!pMydata->hHandleO) /* did that work out ? */
{
fprintf (stderr, "Cannot initialize libmng.\n");
iRC = 1;
}
else
{ /* setup callbacks */
if ( ((iRC = mng_setcb_openstream (pMydata->hHandleO, myopenstream )) != 0) ||
((iRC = mng_setcb_closestream (pMydata->hHandleO, myclosestream)) != 0) ||
((iRC = mng_setcb_writedata (pMydata->hHandleO, mywritedata )) != 0) )
fprintf (stderr, "Cannot set callbacks for libmng.\n");
else
{
if ((iRC = mng_create (pMydata->hHandleO)) != 0)
fprintf (stderr, "Cannot create a new MNG.\n");
else
{ /* run through the chunk again and create the new file */
if ((iRC = mng_iterate_chunks (pMydata->hHandleI, 0, myiterchunk)) != 0)
fprintf (stderr, "Cannot iterate the chunks.\n");
else
{ /* did the iteration fail somehow ? */
if (pMydata->iError)
iRC = pMydata->iError;
else
{ /* now write the created new file !! */
if ((iRC = mng_write (pMydata->hHandleO)) != 0)
fprintf (stderr, "Cannot write the output file.\n");
}
}
}
}
/* cleanup the library */
mng_cleanup (&pMydata->hHandleO);
}
/* cleanup output file */
fclose (pMydata->hFileO);
}
}
}
}
}
mng_cleanup (&pMydata->hHandleI); /* cleanup the library */
}
fclose (pMydata->hFileI); /* cleanup input file and userdata */
free (pMydata);
return iRC;
}
/* ************************************************************************** */
int main(int argc, char *argv[])
{
if (argc > 2) /* need two (2) parameters ! */
return fixit (argv[1], argv[2]);
else
fprintf (stdout, "\nUsage: mngrepair <input.mng> <output.mng>\n\n");
return 0;
}
/* ************************************************************************** */

View file

@ -1,188 +0,0 @@
# ---------------------------------------------------------------------------
!if !$d(BCB)
BCB = $(MAKEDIR)\..
!endif
# ---------------------------------------------------------------------------
# IDE SECTION
# ---------------------------------------------------------------------------
# The following section of the project makefile is managed by the BCB IDE.
# It is recommended to use the IDE to change any of the values in this
# section.
# ---------------------------------------------------------------------------
VERSION = BCB.03
# ---------------------------------------------------------------------------
PROJECT = mngtree.exe
OBJFILES = mngtree.obj
RESFILES = mngtree.res
RESDEPEN = $(RESFILES)
LIBFILES = ..\win32dll\libmng.lib
LIBRARIES = VCL35.lib
SPARELIBS = VCL35.lib
PACKAGES = vclx35.bpi VCL35.bpi vcldb35.bpi vcldbx35.bpi bcbsmp35.bpi dclocx35.bpi \
Qrpt35.bpi
DEFFILE =
# ---------------------------------------------------------------------------
PATHCPP = .;
PATHASM = .;
PATHPAS = .;
PATHRC = .;
DEBUGLIBPATH = $(BCB)\lib\debug
RELEASELIBPATH = $(BCB)\lib\release
# ---------------------------------------------------------------------------
CFLAG1 = -Od -w -r- -k -y -v -vi- -c -tWC
CFLAG2 = -D_NO_VCL;MNG_SUPPORT_READ;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS;MNG_USE_DLL \
-I..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms;$(BCB)\include
CFLAG3 = -Tkh30000
PFLAGS = -D_NO_VCL;MNG_SUPPORT_READ;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS;MNG_USE_DLL \
-U..\win32dll;$(BCB)\lib;$(DEBUGLIBPATH) \
-I..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms;$(BCB)\include \
-$Y -$W -$O- -v -JPHN -M
RFLAGS = -D_NO_VCL;MNG_SUPPORT_READ;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS;MNG_USE_DLL \
-i..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms;$(BCB)\include
AFLAGS = /i..\..\..\libmng-devel /i..\..\..\zlib /i..\..\..\jpgsrc6b /i..\..\..\lcms \
/i$(BCB)\include /d_NO_VCL /dMNG_SUPPORT_READ /dMNG_ACCESS_CHUNKS \
/dMNG_STORE_CHUNKS /dMNG_NO_CMS /dMNG_USE_DLL /mx /w2 /zd
LFLAGS = -L..\win32dll;$(BCB)\lib;$(DEBUGLIBPATH) -ap -Tpe -x -Gn -v
IFLAGS =
# ---------------------------------------------------------------------------
ALLOBJ = c0x32.obj $(OBJFILES)
ALLRES = $(RESFILES)
ALLLIB = $(LIBFILES) import32.lib cw32mt.lib libmng.lib
# ---------------------------------------------------------------------------
!ifdef IDEOPTIONS
[Version Info]
IncludeVerInfo=1
AutoIncBuild=1
MajorVer=0
MinorVer=9
Release=0
Build=13
Debug=1
PreRelease=1
Special=0
Private=0
DLL=0
Locale=1033
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=Executable (Console)
FileVersion=0.9.0.13
InternalName=mngtree
LegalCopyright=copyright (c) 2000 G.Juyn
LegalTrademarks=
OriginalFilename=mngtree.exe
ProductName=mngtree
ProductVersion=0.9.0
Comments=
[HistoryLists\hlIncludePath]
Count=4
Item0=..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms;$(BCB)\include
Item1=..\..\..\libmng;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms;$(BCB)\include
Item2=..\..\..\libmng;..\..\..\zlib;$(BCB)\include
Item3=..\..\..\libmng;$(BCB)\include
[HistoryLists\hlLibraryPath]
Count=3
Item0=..\win32dll;$(BCB)\lib
Item1=..\..\..\libmng\bcb\win32dll;$(BCB)\lib
Item2=..\..\..\libmng;$(BCB)\lib
[HistoryLists\hlConditionals]
Count=2
Item0=_NO_VCL;MNG_SUPPORT_READ;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS;MNG_USE_DLL
Item1=_NO_VCL;MNG_SUPPORT_READ;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS
[HistoryLists\hlRunParameters]
Count=2
Item0=dutch.mng
Item1=usflag-lc-d63.mng
[Debugging]
DebugSourceDirs=
[Parameters]
RunParams=dutch.mng
HostApplication=
!endif
# ---------------------------------------------------------------------------
# MAKE SECTION
# ---------------------------------------------------------------------------
# This section of the project file is not used by the BCB IDE. It is for
# the benefit of building from the command-line using the MAKE utility.
# ---------------------------------------------------------------------------
.autodepend
# ---------------------------------------------------------------------------
!if !$d(BCC32)
BCC32 = bcc32
!endif
!if !$d(DCC32)
DCC32 = dcc32
!endif
!if !$d(TASM32)
TASM32 = tasm32
!endif
!if !$d(LINKER)
LINKER = ilink32
!endif
!if !$d(BRCC32)
BRCC32 = brcc32
!endif
# ---------------------------------------------------------------------------
!if $d(PATHCPP)
.PATH.CPP = $(PATHCPP)
.PATH.C = $(PATHCPP)
!endif
!if $d(PATHPAS)
.PATH.PAS = $(PATHPAS)
!endif
!if $d(PATHASM)
.PATH.ASM = $(PATHASM)
!endif
!if $d(PATHRC)
.PATH.RC = $(PATHRC)
!endif
# ---------------------------------------------------------------------------
$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE)
$(BCB)\BIN\$(LINKER) @&&!
$(LFLAGS) +
$(ALLOBJ), +
$(PROJECT),, +
$(ALLLIB), +
$(DEFFILE), +
$(ALLRES)
!
# ---------------------------------------------------------------------------
.pas.hpp:
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
.pas.obj:
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
.cpp.obj:
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
.c.obj:
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
.asm.obj:
$(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@
.rc.res:
$(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $<
# ---------------------------------------------------------------------------

View file

@ -1,249 +0,0 @@
/* ************************************************************************** */
/* * * */
/* * COPYRIGHT NOTICE: * */
/* * * */
/* * Copyright (c) 2000 Gerard Juyn (gerard@libmng.com) * */
/* * [You may insert additional notices after this sentence if you modify * */
/* * this source] * */
/* * * */
/* * For the purposes of this copyright and license, "Contributing Authors" * */
/* * is defined as the following set of individuals: * */
/* * * */
/* * Gerard Juyn * */
/* * (hopefully some more to come...) * */
/* * * */
/* * The MNG Library is supplied "AS IS". The Contributing Authors * */
/* * disclaim all warranties, expressed or implied, including, without * */
/* * limitation, the warranties of merchantability and of fitness for any * */
/* * purpose. The Contributing Authors assume no liability for direct, * */
/* * indirect, incidental, special, exemplary, or consequential damages, * */
/* * which may result from the use of the MNG Library, even if advised of * */
/* * the possibility of such damage. * */
/* * * */
/* * Permission is hereby granted to use, copy, modify, and distribute this * */
/* * source code, or portions hereof, for any purpose, without fee, subject * */
/* * to the following restrictions: * */
/* * * */
/* * 1. The origin of this source code must not be misrepresented; * */
/* * you must not claim that you wrote the original software. * */
/* * * */
/* * 2. Altered versions must be plainly marked as such and must not be * */
/* * misrepresented as being the original source. * */
/* * * */
/* * 3. This Copyright notice may not be removed or altered from any source * */
/* * or altered source distribution. * */
/* * * */
/* * The Contributing Authors specifically permit, without fee, and * */
/* * encourage the use of this source code as a component to supporting * */
/* * the MNG and JNG file format in commercial products. If you use this * */
/* * source code in a product, acknowledgment would be highly appreciated. * */
/* * * */
/* ************************************************************************** */
/* * * */
/* * project : mngtree * */
/* * file : mngtree.cpp copyright (c) 2000 G.Juyn * */
/* * version : 1.0.0 * */
/* * * */
/* * purpose : main project file * */
/* * * */
/* * author : G.Juyn * */
/* * web : http://www.3-t.com * */
/* * email : mailto:info@3-t.com * */
/* * * */
/* * comment : mngtree simply dumps the chunk-structure of the supplied * */
/* * first parameter to stdout (should be a xNG-file) * */
/* * * */
/* * changes : 0.5.3 - 06/26/2000 - G.Juyn * */
/* * - changed userdata variable to mng_ptr * */
/* * 0.5.3 - 06/28/2000 - G.Juyn * */
/* * - changed memory allocation size parameters to mng_size_t * */
/* * * */
/* ************************************************************************** */
#pragma hdrstop
#include <condefs.h>
#include <stdio.h>
#include <stdlib.h>
#include <mem.h>
#include "libmng.h"
/* ************************************************************************** */
USERES("mngtree.res");
USELIB("..\win32dll\libmng.lib");
//---------------------------------------------------------------------------
/* ************************************************************************** */
typedef struct user_struct {
FILE *hFile; /* file handle */
int iIndent; /* for nice indented formatting */
} userdata;
typedef userdata * userdatap;
/* ************************************************************************** */
#define MY_DECL __stdcall /* get the right callback convention */
/* ************************************************************************** */
mng_ptr MY_DECL myalloc (mng_size_t iSize)
{ /* duh! */
return (mng_ptr)calloc (1, (size_t)iSize);
}
/* ************************************************************************** */
#pragma argsused
void MY_DECL myfree (mng_ptr pPtr, mng_size_t iSize)
{
free (pPtr); /* duh! */
return;
}
/* ************************************************************************** */
#pragma argsused
mng_bool MY_DECL myopenstream (mng_handle hMNG)
{
return MNG_TRUE; /* already opened in main function */
}
/* ************************************************************************** */
#pragma argsused
mng_bool MY_DECL myclosestream (mng_handle hMNG)
{
return MNG_TRUE; /* gets closed in main function */
}
/* ************************************************************************** */
mng_bool MY_DECL myreaddata (mng_handle hMNG,
mng_ptr pBuf,
mng_uint32 iSize,
mng_uint32 *iRead)
{ /* get to my file handle */
userdatap pMydata = (userdatap)mng_get_userdata (hMNG);
/* read it */
*iRead = fread (pBuf, 1, iSize, pMydata->hFile);
/* iRead will indicate EOF */
return MNG_TRUE;
}
/* ************************************************************************** */
#pragma argsused
mng_bool MY_DECL myiterchunk (mng_handle hMNG,
mng_handle hChunk,
mng_chunkid iChunktype,
mng_uint32 iChunkseq)
{ /* get to my file handle */
userdatap pMydata = (userdatap)mng_get_userdata (hMNG);
char aCh[4];
char zIndent[80];
int iX;
/* decode the chunkname */
aCh[0] = (char)((iChunktype >> 24) & 0xFF);
aCh[1] = (char)((iChunktype >> 16) & 0xFF);
aCh[2] = (char)((iChunktype >> 8) & 0xFF);
aCh[3] = (char)((iChunktype ) & 0xFF);
/* indent less ? */
if ( (iChunktype == MNG_UINT_MEND) || (iChunktype == MNG_UINT_IEND) ||
(iChunktype == MNG_UINT_ENDL) )
pMydata->iIndent -= 2;
/* this looks ugly; but I haven't
figured out how to do it prettier */
for (iX = 0; iX < pMydata->iIndent; iX++)
zIndent[iX] = ' ';
zIndent[pMydata->iIndent] = '\0';
/* print a nicely indented line */
printf ("%s%c%c%c%c\n", &zIndent, aCh[0], aCh[1], aCh[2], aCh[3]);
/* indent more ? */
if ( (iChunktype == MNG_UINT_MHDR) || (iChunktype == MNG_UINT_IHDR) ||
(iChunktype == MNG_UINT_JHDR) || (iChunktype == MNG_UINT_DHDR) ||
(iChunktype == MNG_UINT_BASI) || (iChunktype == MNG_UINT_LOOP) )
pMydata->iIndent += 2;
return MNG_TRUE; /* keep'm coming... */
}
/* ************************************************************************** */
int dumptree (char * zFilename)
{
userdatap pMydata;
mng_handle hMNG;
mng_retcode iRC;
/* get a data buffer */
pMydata = (userdatap)calloc (1, sizeof (userdata));
if (pMydata == NULL) /* oke ? */
{
fprintf (stderr, "Cannot allocate a data buffer.\n");
return 1;
}
/* can we open the file ? */
if ((pMydata->hFile = fopen (zFilename, "rb")) == NULL)
{ /* error out if we can't */
fprintf (stderr, "Cannot open input file %s.\n", zFilename);
return 1;
}
/* let's initialize the library */
hMNG = mng_initialize ((mng_ptr)pMydata, myalloc, myfree, MNG_NULL);
if (!hMNG) /* did that work out ? */
{
fprintf (stderr, "Cannot initialize libmng.\n");
iRC = 1;
}
else
{ /* setup callbacks */
if ( ((iRC = mng_setcb_openstream (hMNG, myopenstream )) != 0) ||
((iRC = mng_setcb_closestream (hMNG, myclosestream)) != 0) ||
((iRC = mng_setcb_readdata (hMNG, myreaddata )) != 0) )
fprintf (stderr, "Cannot set callbacks for libmng.\n");
else
{ /* reaad the file into memory */
if ((iRC = mng_read (hMNG)) != 0)
fprintf (stderr, "Cannot read the file.\n");
else
{
pMydata->iIndent = 2; /* start of the indenting at a nice level */
printf ("Starting dump of %s.\n\n", zFilename);
/* run through the chunk list */
if ((iRC = mng_iterate_chunks (hMNG, 0, myiterchunk)) != 0)
fprintf (stderr, "Cannot iterate the chunks.\n");
printf ("\nDone.\n");
}
}
mng_cleanup (&hMNG); /* cleanup the library */
}
fclose (pMydata->hFile); /* cleanup */
free (pMydata);
return iRC;
}
/* ************************************************************************** */
#pragma argsused
int main(int argc, char *argv[])
{
if (argc > 1) /* need that first parameter ! */
return dumptree (argv[1]);
else
fprintf (stdout, "\nUsage: mngtree <file.mng>\n\n");
return 0;
}
/* ************************************************************************** */

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

View file

@ -1,573 +0,0 @@
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <stdlib.h> // for : malloc & free
#include "Main.h"
/****************************************************************************}
{* For conditions of distribution and use, *}
{* see copyright notice in libmng.pas *}
{****************************************************************************}
{* *}
{* project : libmng *}
{* file : main.pas copyright (c) 2000 G.Juyn *}
{* version : 1.0.1 *}
{* *}
{* purpose : Main form for mngview application *}
{* *}
{* author : G.Juyn *}
{* web : http://www.3-t.com *}
{* email : mailto:info@3-t.com *}
{* *}
{* comment : this is the heart of the mngview applciation *}
{* *}
{* changes : This project is a converted version of "mngview" - AP *}
{* - AP - 15/9/2000 - revisions ... *}
{* - made the callbacks calling convention explicit *}
(* - Moved the defines from "project options" to "main.h" *}
{* - Added Readme.txt to the project - Please READ IT ! *}
(* *}
{* 0.5.1 - 05/02/2000 - G.Juyn *}
{* - added this version block *}
{* - made the initialization part more robust *}
{* eg. program aborts on initialization errors *}
{* - B002(105797) - added check for existence of default sRGB *}
{* profile (now included in distribution) *}
{* - added mng_cleanup to program exit *}
{* 0.5.1 - 05/08/2000 - G.Juyn *}
{* - changed to stdcall convention *}
{* 0.5.1 - 05/11/2000 - G.Juyn *}
{* - changed callback function declarations *}
{* *}
{* 0.5.3 - 06/16/2000 - G.Juyn *}
{* - removed processmessages call from refresh callback *}
{* 0.5.3 - 06/17/2000 - G.Juyn *}
{* - switched "storechunks" off *}
{* 0.5.3 - 06/26/2000 - G.Juyn *}
{* - changed definition of userdata to mng_ptr *}
{* 0.5.3 - 06/28/2000 - G.Juyn *}
{* - changed the default icon to something more appropriate *}
{* - changed definition of memory alloc size to mng_size_t *}
{* 0.5.3 - 06/29/2000 - G.Juyn *}
{* - changed order of refresh parameters *}
{* *}
{* 0.9.0 - 06/30/2000 - G.Juyn *}
{* - changed refresh parameters to 'x,y,width,height' *}
{* *}
{* 0.9.1 - 07/08/2000 - G.Juyn *}
{* - fixed to use returncode constants *}
{* - changed to accomodate MNG_NEEDTIMERWAIT returncode *}
{* 0.9.1 - 07/10/2000 - G.Juyn *}
{* - changed to use suspension-mode *}
{* *}
{* 1.0.1 - 05/02/2000 - G.Juyn *}
{* - removed loading of default sRGB profile (auto in libmng) *}
{* *}
{****************************************************************************/
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TMainForm *MainForm;
# define _OR_ |
# define _AND_ &
# define _DIV_ /
# define _NOT_ !
# define _NIL_ 0
# define _SHR_ >>
# define _SHL_ <<
// Prototypes for static functions - the LibMng Callbacks.
static mng_ptr __stdcall Memalloc( mng_uint32 iLen );
static void __stdcall Memfree( mng_ptr iPtr, mng_size_t iLen );
static mng_bool __stdcall Openstream( mng_handle hHandle );
static mng_bool __stdcall Closestream( mng_handle hHandle );
static mng_bool __stdcall Readdata ( mng_handle hHandle, mng_ptr pBuf,
mng_uint32 iBuflen, mng_uint32 *pRead );
static mng_bool __stdcall ProcessHeader ( mng_handle hHandle,
mng_uint32 iWidth, mng_uint32 iHeight );
static mng_ptr __stdcall GetCanvasLine ( mng_handle hHandle,
mng_uint32 iLinenr );
static mng_ptr __stdcall GetAlphaLine( mng_handle hHandle, mng_uint32 iLinenr );
static mng_bool __stdcall ImageRefresh ( mng_handle hHandle,
mng_uint32 iX, mng_uint32 iY, mng_uint32 iWidth, mng_uint32 iHeight );
static mng_uint32 __stdcall GetTickCount( mng_handle hHandle );
static mng_bool __stdcall SetTimer( mng_handle hHandle, mng_uint32 iMsecs );
//---------------------------------------------------------------------------
__fastcall TMainForm::TMainForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
static mng_ptr __stdcall Memalloc( mng_uint32 iLen )
{
mng_ptr pResult =
malloc( iLen ); /* get memory from the heap */
if( pResult ) /* Added - condition */
memset( pResult, 0, iLen );
return pResult;
}
//---------------------------------------------------------------------------
static void __stdcall Memfree( mng_ptr iPtr, mng_size_t iLen )
{
free( iPtr ); /* free the memory */
(void)iLen; // Kill compiler warning
}
//---------------------------------------------------------------------------
static mng_bool __stdcall Openstream( mng_handle hHandle )
{
TMainForm *OHForm;
/* get a fix on our form */
OHForm = (TMainForm *)mng_get_userdata( hHandle );
if( OHForm->OFFile != _NIL_ ) /* free previous stream (if any) */
OHForm->OFFile->Free();
/* open a new stream */
OHForm->OFFile = new TFileStream(
OHForm->SFFileName, fmOpenRead _OR_ fmShareDenyWrite);
OHForm->ProgressBar1->Position = 0; /* Added */
OHForm->ProgressBar1->Min =0; /* Added */
OHForm->ProgressBar1->Max = OHForm->OFFile->Size; /* Added */
return MNG_TRUE;
}
//---------------------------------------------------------------------------
static mng_bool __stdcall Closestream( mng_handle hHandle )
{
TMainForm *OHForm;
/* get a fix on our form */
OHForm = (TMainForm *)mng_get_userdata( hHandle );
OHForm->OFFile->Free(); /* cleanup the stream */
OHForm->OFFile = 0; /* don't use it again ! */
OHForm->ProgressBar1->Position = 0; /* Added */
return MNG_TRUE;
}
//---------------------------------------------------------------------------
static mng_bool __stdcall Readdata ( mng_handle hHandle, mng_ptr pBuf,
mng_uint32 iBuflen, mng_uint32 *pRead )
{
TMainForm *OHForm;
unsigned int IHTicks;
unsigned int IHByte1;
unsigned int IHByte2;
unsigned int IHBytesPerSec ;
/* get a fix on our form */
OHForm = (TMainForm *)mng_get_userdata( hHandle );
/* are we at EOF ? */
if( OHForm->OFFile->Position >= OHForm->OFFile->Size )
{
*pRead = 0; /* indicate so */
}
else
{
IHBytesPerSec = OHForm->IFBytesPerSec; /* fake a slow connection */
if( IHBytesPerSec > 0 )
{
IHTicks = (unsigned int)GetTickCount();
IHByte1 = (IHTicks - OHForm->IFTicks) * IHBytesPerSec;
IHByte2 = (OHForm->IFBytes + iBuflen) * 1000;
if( IHByte2 > IHByte1 ) /* Added - condition */
if( ((IHByte2 - IHByte1) _DIV_ IHBytesPerSec) > 10 )
{
Sleep( (DWORD)((IHByte2 - IHByte1) _DIV_ IHBytesPerSec) );
}
};
/* read the requested data */
*pRead = OHForm->OFFile->Read( pBuf, iBuflen);
OHForm->IFBytes = OHForm->IFBytes + *pRead;
OHForm->ProgressBar1->Position = (int)OHForm->IFBytes; /* Added */
} // end else;
return MNG_TRUE;
}
//---------------------------------------------------------------------------
static mng_bool __stdcall ProcessHeader ( mng_handle hHandle,
mng_uint32 iWidth, mng_uint32 iHeight )
{
TMainForm *OHForm;
/* get a fix on our form */
OHForm = (TMainForm *)mng_get_userdata( hHandle );
/* Added */
OHForm->Caption = ExtractFileName( OHForm->SFFileName ) +
" [" +
String( iWidth ) +
"x" +
String( iHeight ) +
"]";
OHForm->OFBitmap->Width = iWidth; /* store the new dimensions */
OHForm->OFBitmap->Height = iHeight;
OHForm->OFImage->Left = 0; /* adjust the visible component */
OHForm->OFImage->Top = 0;
OHForm->OFImage->Width = iWidth;
OHForm->OFImage->Height = iHeight;
OHForm->FormResize (OHForm); /* force re-centering the image*/
/* clear the canvas & draw an outline */
OHForm->OFBitmap->Canvas->Brush->Color = clGray;
OHForm->OFBitmap->Canvas->Brush->Style = bsSolid;
OHForm->OFBitmap->Canvas->FillRect( OHForm->OFBitmap->Canvas->ClipRect );
OHForm->OFBitmap->Canvas->Brush->Color = clRed;
OHForm->OFBitmap->Canvas->Brush->Style = bsSolid;
OHForm->OFBitmap->Canvas->Pen->Color = clRed;
OHForm->OFBitmap->Canvas->Pen->Style = psSolid;
OHForm->OFBitmap->Canvas->FrameRect( OHForm->OFBitmap->Canvas->ClipRect);
/* make sure it gets out there */
OHForm->OFImage->Picture->Assign( OHForm->OFBitmap );
/* tell the library we want funny windows-bgr*/
if( mng_set_canvasstyle( hHandle, MNG_CANVAS_BGR8 ) )
OHForm->MNGerror( "libmng reported an error setting the canvas style" );
return MNG_TRUE;
}
//---------------------------------------------------------------------------
static mng_ptr __stdcall GetCanvasLine ( mng_handle hHandle,
mng_uint32 iLinenr )
{
TMainForm *OHForm;
/* get a fix on our form */
OHForm = (TMainForm *)mng_get_userdata( hHandle );
/* easy with these bitmap objects ! */
return OHForm->OFBitmap->ScanLine[ iLinenr ];
}
//---------------------------------------------------------------------------
static mng_bool __stdcall ImageRefresh ( mng_handle hHandle,
mng_uint32 iX, mng_uint32 iY, mng_uint32 iWidth, mng_uint32 iHeight )
{
TMainForm *OHForm;
/* get a fix on our form */
OHForm = (TMainForm *)mng_get_userdata( hHandle );
/* force redraw */
OHForm->OFImage->Picture->Assign( OHForm->OFBitmap );
return MNG_TRUE;
}
//---------------------------------------------------------------------------
static mng_uint32 __stdcall GetTickCount( mng_handle hHandle )
{
return GetTickCount(); /* windows knows that */
}
//---------------------------------------------------------------------------
static mng_bool __stdcall SetTimer( mng_handle hHandle, mng_uint32 iMsecs )
{
TMainForm *OHForm;
/* get a fix on our form */
OHForm = (TMainForm *)mng_get_userdata( hHandle );
OHForm->OFTimer->Interval = iMsecs; /* and set the timer */
OHForm->OFTimer->Enabled = true;
return MNG_TRUE;
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
void __fastcall TMainForm::FormCreate(TObject *Sender)
{
String SHProfileName;
mng_uint16 IHRed, IHGreen, IHBlue; /* word */
OFBitmap = new Graphics::TBitmap(); /* initialize */
IFBytesPerSec = 10000000;
OFFile = 0;
OFOpenDialog->InitialDir = "";
OFBitmap->HandleType = bmDIB; /* make it a 24-bit DIB */
OFBitmap->PixelFormat = pf24bit;
/* now initialize the library */
IFHandle = mng_initialize( mng_ptr(this), Memalloc, Memfree, _NIL_ );
if( IFHandle == _NIL_ )
{
MNGerror ("libmng initializiation error"\
"\n"\
"Program aborted"
);
PostMessage( Handle, WM_CLOSE, 0, 0);
return; // was Exit
};
/* no need to store chunk-info ! */
mng_set_storechunks( IFHandle, MNG_FALSE );
/* use suspension-buffer */
mng_set_suspensionmode( IFHandle, MNG_TRUE );
/* set all the callbacks */
if(
(mng_setcb_openstream (IFHandle, Openstream ) != MNG_NOERROR) _OR_
(mng_setcb_closestream (IFHandle, Closestream ) != MNG_NOERROR) _OR_
(mng_setcb_readdata (IFHandle, Readdata ) != MNG_NOERROR) _OR_
(mng_setcb_processheader(IFHandle, ProcessHeader) != MNG_NOERROR) _OR_
(mng_setcb_getcanvasline(IFHandle, GetCanvasLine) != MNG_NOERROR) _OR_
(mng_setcb_refresh (IFHandle, ImageRefresh ) != MNG_NOERROR) _OR_
(mng_setcb_gettickcount (IFHandle, GetTickCount ) != MNG_NOERROR) _OR_
(mng_setcb_settimer (IFHandle, SetTimer ) != MNG_NOERROR)
)
{
MNGerror ("libmng reported an error setting a callback function!"\
"\n"\
"Program aborted"
);
PostMessage( Handle, WM_CLOSE, 0, 0 );
return; // was Exit
};
/* supply our own bg-color */
IHRed = (mng_uint16)((Color ) _AND_ 0xFF);
IHGreen = (mng_uint16)((Color _SHR_ 8) _AND_ 0xFF);
IHBlue = (mng_uint16)((Color _SHR_ 16) _AND_ 0xFF);
IHRed = (mng_uint16)((IHRed _SHL_ 8) + IHRed);
IHGreen = (mng_uint16)((IHGreen _SHL_ 8) + IHGreen);
IHBlue = (mng_uint16)((IHBlue _SHL_ 8) + IHBlue);
if( mng_set_bgcolor (IFHandle, IHRed, IHGreen, IHBlue) != MNG_NOERROR )
MNGerror( "libmng reported an error setting the background color!");
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::FormCloseQuery(TObject *Sender,
bool &CanClose)
{
BFCancelled = true;
/* if we're still animating then stop it */
if( OFTimer->Enabled )
{
if( mng_display_freeze (IFHandle) != MNG_NOERROR )
MNGerror ("libmng reported an error during display_freeze!" );
}
OFTimer->Enabled = false;
mng_cleanup( &IFHandle );
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::FormShow(TObject *Sender)
{
FormResize( this );
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::FormResize(TObject *Sender)
{
/* center the image in the window */
if( ClientWidth < OFImage->Width )
OFImage->Left = 0;
else
OFImage->Left = (ClientWidth - OFImage->Width ) _DIV_ 2;
if( ClientHeight < OFImage->Height )
OFImage->Top = 0;
else
OFImage->Top = (ClientHeight - OFImage->Height) _DIV_ 2;
ProgressBar1->Width = Panel1->Width - 8; /* Added */
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::FormKeyDown(TObject *Sender, WORD &Key,
TShiftState Shift)
{
/* pressing <esc> will freeze an animation */
if( Key == VK_ESCAPE )
{
if( OFTimer->Enabled )
{
if( mng_display_freeze( IFHandle) != MNG_NOERROR )
MNGerror( "libmng reported an error during display_freeze!" );
}
OFTimer->Enabled = false; /* don't let that timer go off then ! */
BFCancelled = true;
}
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::OFTimerTimer(TObject *Sender)
{
mng_retcode IHRslt;
OFTimer->Enabled = false; /* only once ! */
if( _NOT_ BFCancelled )
{
/* and inform the library */
IHRslt = mng_display_resume( IFHandle );
if( (IHRslt != MNG_NOERROR) _AND_ (IHRslt != MNG_NEEDTIMERWAIT) )
MNGerror( "libmng reported an error during display_resume!" );
};
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::OFMenuFileOpenClick(TObject *Sender)
{
mng_retcode IHRslt;
OFOpenDialog->InitialDir = "";
OFOpenDialog->InitialDir = GetCurrentDir(); //@@
OFOpenDialog->FileName = SFFileName;
if( OFOpenDialog->Execute() ) /* get the filename */
{
if( OFTimer->Enabled ) /* if the lib was active; stop it */
{
OFTimer->Enabled = false;
Application->ProcessMessages(); /* process any timer requests (for safety) */
/* now freeze the animation */
if( mng_display_freeze( IFHandle ) != MNG_NOERROR )
MNGerror( "libmng reported an error during display_freeze!" );
};
/* save interesting fields */
SFFileName = OFOpenDialog->FileName;
IFTicks = GetTickCount();
IFBytes = 0;
BFCancelled = false;
/* always reset (just in case) */
if( mng_reset( IFHandle ) != MNG_NOERROR )
{
MNGerror( "libmng reported an error during reset!" );
}
else
{
/* and let the lib do it's job ! */
IHRslt = mng_readdisplay (IFHandle);
if( (IHRslt != MNG_NOERROR) _AND_ (IHRslt != MNG_NEEDTIMERWAIT) )
MNGerror( "libmng reported an error reading the input file!" );
};
};
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::OFMenuFileProfileClick(TObject *Sender)
{
char SHProfileDir[ MAX_PATH ];
GetSystemDirectory( SHProfileDir, MAX_PATH );
strcat( SHProfileDir, "\\Color" );
OFOpenDialogProfile->InitialDir = String( SHProfileDir );
if( OFOpenDialogProfile->Execute() )
{
if( mng_set_outputprofile( IFHandle, OFOpenDialogProfile->FileName.c_str()) != 0 )
MNGerror( "libmng reported an error setting the output-profile!" );
}
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::OFMenuFileExitClick(TObject *Sender)
{
if( mng_cleanup( &IFHandle ) != MNG_NOERROR )
MNGerror( "libmng cleanup error" );
Close();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::OFMenuOptionsModemSpeedClick(TObject *Sender)
{
OFMenuOptionsModem28k8->Checked = false;
OFMenuOptionsModem33k6->Checked = false;
OFMenuOptionsModem56k->Checked = false;
OFMenuOptionsModemISDN64->Checked = false;
OFMenuOptionsModemISDN128->Checked = false;
OFMenuOptionsModemCable512->Checked = false;
OFMenuOptionsModemUnlimited->Checked = false;
if( IFBytesPerSec == (unsigned int)OFMenuOptionsModem28k8->Tag _DIV_ 10 )
OFMenuOptionsModem28k8->Checked = true;
else
if( IFBytesPerSec == (unsigned int)OFMenuOptionsModem33k6->Tag _DIV_ 10 )
OFMenuOptionsModem33k6->Checked = true;
else
if( IFBytesPerSec == (unsigned int)OFMenuOptionsModem56k->Tag _DIV_ 10 )
OFMenuOptionsModem56k->Checked = true;
else
if( IFBytesPerSec == (unsigned int)OFMenuOptionsModemISDN64->Tag _DIV_ 10 )
OFMenuOptionsModemISDN64->Checked = true;
else
if( IFBytesPerSec == (unsigned int)OFMenuOptionsModemISDN128->Tag _DIV_ 10 )
OFMenuOptionsModemISDN128->Checked = true;
else
/* Added - changedit was the line below ! */
// if( IFBytesPerSec == (unsigned int)OFMenuOptionsModemUnlimited->Tag _DIV_ 10 )
if( IFBytesPerSec == (unsigned int)OFMenuOptionsModemCable512->Tag _DIV_ 10 )
OFMenuOptionsModemCable512->Checked = true;
else
OFMenuOptionsModemUnlimited->Checked = true;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::OFMenuOptionsModemXClick(TObject *Sender)
{
IFBytesPerSec = ((TMenuItem*)Sender)->Tag _DIV_ 10;
}
//---------------------------------------------------------------------------
void TMainForm::MNGerror( String SHMsg )
{
/* get extended info */
mng_uint32 iErrorcode;
mng_uint8 iSeverity;
mng_chunkid iChunkname;
mng_uint32 iChunkseq;
mng_int32 iExtra1;
mng_int32 iExtra2;
mng_pchar zErrortext;
char szFormatStr[ 256 ];
iErrorcode = mng_getlasterror (IFHandle, &iSeverity,
&iChunkname, &iChunkseq, &iExtra1, &iExtra2,
(mng_pchar*)&zErrortext);
wsprintf( szFormatStr,
"Error = %d; Severity = %d; Chunknr = %d; Extra1 = %d",
(int)iErrorcode, (int)iSeverity, (int)iChunkseq, (int)iExtra1
);
MessageDlg( SHMsg +
"\n\n" +
String(zErrortext) +
"\n\n" +
szFormatStr, /* see wsprintf above */
mtError,
TMsgDlgButtons() << mbOK,
0
);
}
//---------------------------------------------------------------------------

Binary file not shown.

View file

@ -1,84 +0,0 @@
//---------------------------------------------------------------------------
#ifndef MainH
#define MainH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Dialogs.hpp>
#include <ExtCtrls.hpp>
#include <Menus.hpp>
#include <ComCtrls.hpp>
//---------------------------------------------------------------------------
// These MUST be defined before we include "Libmng.h
# define MNG_SUPPORT_READ
# define MNG_ACCESS_CHUNKS
# define MNG_STORE_CHUNKS
# define MNG_NO_CMS
# define MNG_USE_DLL
# define MNG_SUPPORT_DISPLAY
# define MNG_SKIP_ZLIB // we don't need the zlib definitions here
# define MNG_SKIP_IJG6B // we don't need the IJG definitions here
#include "libmng.h"
//---------------------------------------------------------------------------
class TMainForm : public TForm
{
__published: // IDE-managed Components
TMainMenu *OFMainMenu;
TMenuItem *OFMenuFile;
TMenuItem *OFMenuFileOpen;
TMenuItem *OFMenuFileProfile;
TMenuItem *OFMenuFileN1;
TMenuItem *OFMenuFileExit;
TMenuItem *OFMenuOptions;
TMenuItem *OFMenuOptionsModemSpeed;
TMenuItem *OFMenuOptionsModem28k8;
TMenuItem *OFMenuOptionsModem33k6;
TMenuItem *OFMenuOptionsModem56k;
TMenuItem *OFMenuOptionsModemISDN64;
TMenuItem *OFMenuOptionsModemISDN128;
TMenuItem *OFMenuOptionsModemCable512;
TMenuItem *OFMenuOptionsModemUnlimited;
TOpenDialog *OFOpenDialog;
TTimer *OFTimer;
TOpenDialog *OFOpenDialogProfile;
TImage *OFImage;
TPanel *Panel1;
TProgressBar *ProgressBar1;
void __fastcall FormCreate(TObject *Sender);
void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
void __fastcall FormShow(TObject *Sender);
void __fastcall FormResize(TObject *Sender);
void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
TShiftState Shift);
void __fastcall OFTimerTimer(TObject *Sender);
void __fastcall OFMenuFileOpenClick(TObject *Sender);
void __fastcall OFMenuFileProfileClick(TObject *Sender);
void __fastcall OFMenuFileExitClick(TObject *Sender);
void __fastcall OFMenuOptionsModemSpeedClick(TObject *Sender);
void __fastcall OFMenuOptionsModemXClick(TObject *Sender);
private: // User declarations
public :
// Data - was private in the pascal version
String SFFileName; /* filename of the input stream */
TFileStream *OFFile; /* input stream */
mng_handle IFHandle; /* the libray handle */
Graphics::TBitmap *OFBitmap; /* drawing canvas */
# ifdef TEST_RGB8_A8
void *OFAlpha;
# endif
bool BFCancelled; /* <esc> or app-exit */
unsigned int IFTicks; /* used to fake slow connections */
unsigned int IFBytes;
unsigned int IFBytesPerSec;
// Methods
void MNGerror( String SHMsg );
public: // User declarations
__fastcall TMainForm(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TMainForm *MainForm;
//---------------------------------------------------------------------------
#endif

View file

@ -1,187 +0,0 @@
# ---------------------------------------------------------------------------
!if !$d(BCB)
BCB = $(MAKEDIR)\..
!endif
# ---------------------------------------------------------------------------
# IDE SECTION
# ---------------------------------------------------------------------------
# The following section of the project makefile is managed by the BCB IDE.
# It is recommended to use the IDE to change any of the values in this
# section.
# ---------------------------------------------------------------------------
VERSION = BCB.03
# ---------------------------------------------------------------------------
PROJECT = MngView.exe
OBJFILES = MngView.obj Main.obj
RESFILES = MngView.res
DEFFILE =
RESDEPEN = $(RESFILES) Main.dfm
LIBFILES = ..\win32dll\libmng.lib
LIBRARIES = VCL35.lib
SPARELIBS = VCL35.lib
PACKAGES = VCLX35.bpi VCL35.bpi VCLDB35.bpi VCLDBX35.bpi bcbsmp35.bpi dclocx35.bpi \
QRPT35.bpi
# ---------------------------------------------------------------------------
PATHCPP = .;
PATHASM = .;
PATHPAS = .;
PATHRC = .;
DEBUGLIBPATH = $(BCB)\lib\debug
RELEASELIBPATH = $(BCB)\lib\release
# ---------------------------------------------------------------------------
CFLAG1 = -Od -w -Ve -r- -k -y -v -vi- -c -b- -w-par -w-inl -Vx -tW
CFLAG2 = -I$(BCB)\include;$(BCB)\include\vcl;..\..;..\..\..\zlib;..\..\..\jpgsrc6b
CFLAG3 = -Tkh30000 -6
PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \
-I$(BCB)\include;$(BCB)\include\vcl;..\..;..\..\..\zlib;..\..\..\jpgsrc6b -$Y \
-$W -$O- -v -JPHN -M
RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl;..\..;..\..\..\zlib;..\..\..\jpgsrc6b
AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /i..\.. /i..\..\..\zlib \
/i..\..\..\jpgsrc6b /mx /w2 /zd /dMNG_USE_DLL
LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) -aa -Tpe -x -Gn
IFLAGS =
# ---------------------------------------------------------------------------
ALLOBJ = c0w32.obj sysinit.obj $(OBJFILES)
ALLRES = $(RESFILES)
ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib
# ---------------------------------------------------------------------------
!ifdef IDEOPTIONS
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=2057
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
[HistoryLists\hlIncludePath]
Count=8
Item0=$(BCB)\include;$(BCB)\include\vcl;..\..;..\..\..\zlib;..\..\..\jpgsrc6b
Item1=$(BCB)\include;$(BCB)\include\vcl;..\..;..\..\..\zlib;..\..\..\jpgsrc6b;..\win32dll
Item2=$(BCB)\include;$(BCB)\include\vcl;..\..;..\..\..\zlib;..\..\..\ijgsrc6b
Item3=$(BCB)\include;$(BCB)\include\vcl;..\..;..\..\..\zlib;..\..\..\libjpeg
Item4=$(BCB)\include;$(BCB)\include\vcl;..\..;..\..\zlib
Item5=$(BCB)\include;$(BCB)\include\vcl;..\..
Item6=$(BCB)\include;$(BCB)\include\vcl
Item7=..\..\delphi;$(BCB)\include;$(BCB)\include\vcl
[HistoryLists\hlLibraryPath]
Count=2
Item0=$(BCB)\lib\obj;$(BCB)\lib
Item1=..\..\delphi;$(BCB)\lib\obj;$(BCB)\lib
[HistoryLists\hlDebugSourcePath]
Count=1
Item0=$(BCB)\source\vcl
[HistoryLists\hlConditionals]
Count=3
Item0=MNG_USE_DLL
Item1=_RTLDLL
Item2=_RTLDLL;USEPACKAGES
[Debugging]
DebugSourceDirs=$(BCB)\source\vcl
[Parameters]
RunParams=
HostApplication=
!endif
# ---------------------------------------------------------------------------
# MAKE SECTION
# ---------------------------------------------------------------------------
# This section of the project file is not used by the BCB IDE. It is for
# the benefit of building from the command-line using the MAKE utility.
# ---------------------------------------------------------------------------
.autodepend
# ---------------------------------------------------------------------------
!if !$d(BCC32)
BCC32 = bcc32
!endif
!if !$d(DCC32)
DCC32 = dcc32
!endif
!if !$d(TASM32)
TASM32 = tasm32
!endif
!if !$d(LINKER)
LINKER = ilink32
!endif
!if !$d(BRCC32)
BRCC32 = brcc32
!endif
# ---------------------------------------------------------------------------
!if $d(PATHCPP)
.PATH.CPP = $(PATHCPP)
.PATH.C = $(PATHCPP)
!endif
!if $d(PATHPAS)
.PATH.PAS = $(PATHPAS)
!endif
!if $d(PATHASM)
.PATH.ASM = $(PATHASM)
!endif
!if $d(PATHRC)
.PATH.RC = $(PATHRC)
!endif
# ---------------------------------------------------------------------------
$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE)
$(BCB)\BIN\$(LINKER) @&&!
$(LFLAGS) +
$(ALLOBJ), +
$(PROJECT),, +
$(ALLLIB), +
$(DEFFILE), +
$(ALLRES)
!
# ---------------------------------------------------------------------------
.pas.hpp:
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
.pas.obj:
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
.cpp.obj:
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
.c.obj:
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
.asm.obj:
$(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@
.rc.res:
$(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $<
# ---------------------------------------------------------------------------

View file

@ -1,23 +0,0 @@
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
USERES("MngView.res");
USEFORM("Main.cpp", MainForm);
USEFILE("README.txt");
USELIB("..\win32dll\libmng.lib");
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->CreateForm(__classid(TMainForm), &MainForm);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
return 0;
}
//---------------------------------------------------------------------------

View file

@ -1,22 +0,0 @@
Please note :
If your project includes the header file "Rpcndr.h", then
you will then have to define "HAVE_BOOLEAN" before "libmng.h"
is included. Why ? ...
"jmorecfg.h" has
#ifndef HAVE_BOOLEAN
typedef int boolean;
#endif
and "Rpcndr.h" has
typedef unsigned char boolean
This >>MAY<< affect other libraries used in the same project
that depend on the jpeg source - especially as "boolean" is
used in structures (possible alignment problems). For example
"Sam leffler's" LibTiff can be built with the Jpeg codec.
Just a little something to be aware of !. AP - 15/9/2000.

View file

@ -1,315 +0,0 @@
# ---------------------------------------------------------------------------
!if !$d(BCB)
BCB = $(MAKEDIR)\..
!endif
# ---------------------------------------------------------------------------
# IDE SECTION
# ---------------------------------------------------------------------------
# The following section of the project makefile is managed by the BCB IDE.
# It is recommended to use the IDE to change any of the values in this
# section.
# ---------------------------------------------------------------------------
VERSION = BCB.03
# ---------------------------------------------------------------------------
PROJECT = libmng.dll
OBJFILES = ..\..\..\obj\libmng.obj ..\..\..\obj\libmng_hlapi.obj \
..\..\..\obj\libmng_callback_xs.obj ..\..\..\obj\libmng_prop_xs.obj \
..\..\..\obj\libmng_chunk_xs.obj ..\..\..\obj\libmng_object_prc.obj \
..\..\..\obj\libmng_chunk_descr.obj ..\..\..\obj\libmng_chunk_prc.obj \
..\..\..\obj\libmng_chunk_io.obj ..\..\..\obj\libmng_read.obj \
..\..\..\obj\libmng_write.obj ..\..\..\obj\libmng_display.obj \
..\..\..\obj\libmng_dither.obj ..\..\..\obj\libmng_pixels.obj \
..\..\..\obj\libmng_filter.obj ..\..\..\obj\libmng_error.obj \
..\..\..\obj\libmng_trace.obj ..\..\..\obj\libmng_cms.obj \
..\..\..\obj\libmng_zlib.obj ..\..\..\obj\libmng_jpeg.obj \
..\..\..\obj\adler32.obj ..\..\..\obj\compress.obj ..\..\..\obj\crc32.obj \
..\..\..\obj\deflate.obj ..\..\..\obj\inffast.obj ..\..\..\obj\inflate.obj \
..\..\..\obj\inftrees.obj ..\..\..\obj\trees.obj ..\..\..\obj\uncompr.obj \
..\..\..\obj\zutil.obj ..\..\..\obj\jquant2.obj ..\..\..\obj\jcapistd.obj \
..\..\..\obj\jccoefct.obj ..\..\..\obj\jccolor.obj ..\..\..\obj\jcdctmgr.obj \
..\..\..\obj\jchuff.obj ..\..\..\obj\jcinit.obj ..\..\..\obj\jcmainct.obj \
..\..\..\obj\jcmarker.obj ..\..\..\obj\jcmaster.obj ..\..\..\obj\jcomapi.obj \
..\..\..\obj\jcparam.obj ..\..\..\obj\jcphuff.obj ..\..\..\obj\jcprepct.obj \
..\..\..\obj\jcsample.obj ..\..\..\obj\jctrans.obj ..\..\..\obj\jdapistd.obj \
..\..\..\obj\jdatadst.obj ..\..\..\obj\jdatasrc.obj ..\..\..\obj\jdcoefct.obj \
..\..\..\obj\jdcolor.obj ..\..\..\obj\jddctmgr.obj ..\..\..\obj\jdhuff.obj \
..\..\..\obj\jdinput.obj ..\..\..\obj\jdmainct.obj ..\..\..\obj\jdmarker.obj \
..\..\..\obj\jdmaster.obj ..\..\..\obj\jdmerge.obj ..\..\..\obj\jdphuff.obj \
..\..\..\obj\jdpostct.obj ..\..\..\obj\jdsample.obj ..\..\..\obj\jdtrans.obj \
..\..\..\obj\jerror.obj ..\..\..\obj\jfdctflt.obj ..\..\..\obj\jfdctfst.obj \
..\..\..\obj\jfdctint.obj ..\..\..\obj\jidctflt.obj ..\..\..\obj\jidctfst.obj \
..\..\..\obj\jidctint.obj ..\..\..\obj\jidctred.obj ..\..\..\obj\jmemmgr.obj \
..\..\..\obj\jmemnobs.obj ..\..\..\obj\jquant1.obj ..\..\..\obj\jcapimin.obj \
..\..\..\obj\jutils.obj ..\..\..\obj\jdapimin.obj
RESFILES = libmng.res
RESDEPEN = $(RESFILES)
LIBFILES = ..\..\..\lcms\Projects\Bcc-5.5-static\lcmsstat.lib
LIBRARIES = VCL35.lib
SPARELIBS = VCL35.lib
PACKAGES = vclx35.bpi VCL35.bpi vcldb35.bpi vcldbx35.bpi bcbsmp35.bpi dclocx35.bpi \
Qrpt35.bpi
DEFFILE =
# ---------------------------------------------------------------------------
PATHCPP = .;..\..;..\..\..\zlib;..\..\..\jpgsrc6b
PATHASM = .;
PATHPAS = .;
PATHRC = .;
DEBUGLIBPATH = $(BCB)\lib\debug
RELEASELIBPATH = $(BCB)\lib\release
# ---------------------------------------------------------------------------
CFLAG1 = -WD -O2 -Hc -w- -d -k- -vi -w-par -c -tWD
CFLAG2 = -D_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;XMNG_DECREMENT_LOOPS;MNG_OPTIMIZE_FOOTPRINT_INIT;XMNG_OPTIMIZE_FOOTPRINT_MAGN;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER;XMNG_OPTIMIZE_DISPLAYCALLS;XMNG_INCLUDE_MPNG_PROPOSAL;XMNG_INCLUDE_ANG_PROPOSAL \
-I"c:\program files\borland\cbuilder3\projects";..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms\include;..\..\..\lcms\src;$(BCB)\include;$(BCB)\bin \
-H=$(BCB)\lib\vcl35.csm
CFLAG3 = -Tkh30000 -ff -pr -wuse -wucp -wstv -wstu -wsig -wpin -wnod -wnak -wdef -wcln \
-wbbf -wasm -wamp -wamb
PFLAGS = -D_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;XMNG_DECREMENT_LOOPS;MNG_OPTIMIZE_FOOTPRINT_INIT;XMNG_OPTIMIZE_FOOTPRINT_MAGN;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER;XMNG_OPTIMIZE_DISPLAYCALLS;XMNG_INCLUDE_MPNG_PROPOSAL;XMNG_INCLUDE_ANG_PROPOSAL \
-N2..\..\..\obj -N0..\..\..\obj \
-U"c:\program files\borland\cbuilder3\projects";..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms\include;..\..\..\lcms\src;$(BCB)\lib;$(BCB)\bin;$(RELEASELIBPATH) \
-I"c:\program files\borland\cbuilder3\projects";..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms\include;..\..\..\lcms\src;$(BCB)\include;$(BCB)\bin \
-H -W -$L- -$D- -v -JPHN -M
RFLAGS = -D_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;XMNG_DECREMENT_LOOPS;MNG_OPTIMIZE_FOOTPRINT_INIT;XMNG_OPTIMIZE_FOOTPRINT_MAGN;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER;XMNG_OPTIMIZE_DISPLAYCALLS;XMNG_INCLUDE_MPNG_PROPOSAL;XMNG_INCLUDE_ANG_PROPOSAL \
-i"c:\program files\borland\cbuilder3\projects";..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms\include;..\..\..\lcms\src;$(BCB)\include;$(BCB)\bin
AFLAGS = /i"c:\program files\borland\cbuilder3\projects" /i..\..\..\libmng-devel \
/i..\..\..\zlib /i..\..\..\jpgsrc6b /i..\..\..\lcms\include /i..\..\..\lcms\src \
/i$(BCB)\include /i$(BCB)\bin /d_NO_VCL /dMNG_BUILD_DLL /dMNG_FULL_CMS \
/dMNG_STRICT_ANSI /dMNG_CHECK_BAD_ICCP /dZLIB_DLL /dZLIB_WINAPI \
/dMNG_OPTIMIZE_FOOTPRINT_COMPOSE /dMNG_OPTIMIZE_FOOTPRINT_DIV \
/dMNG_OPTIMIZE_FOOTPRINT_SWITCH /dXMNG_DECREMENT_LOOPS \
/dMNG_OPTIMIZE_FOOTPRINT_INIT /dXMNG_OPTIMIZE_FOOTPRINT_MAGN \
/dMNG_OPTIMIZE_OBJCLEANUP /dMNG_OPTIMIZE_CHUNKINITFREE \
/dMNG_OPTIMIZE_CHUNKASSIGN /dMNG_OPTIMIZE_CHUNKREADER \
/dXMNG_OPTIMIZE_DISPLAYCALLS /dXMNG_INCLUDE_MPNG_PROPOSAL \
/dXMNG_INCLUDE_ANG_PROPOSAL /mx /w2 /zd
LFLAGS = -L"c:\program files\borland\cbuilder3\projects";..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms\include;..\..\..\lcms\src;$(BCB)\lib;$(BCB)\bin;$(RELEASELIBPATH) \
-H:0x1000000 -Hc:0x10000 -B:0x60000000 -aa -Tpd -s -Gn -Gi -M -wdpl -d
IFLAGS =
# ---------------------------------------------------------------------------
ALLOBJ = c0d32.obj $(OBJFILES)
ALLRES = $(RESFILES)
ALLLIB = $(LIBFILES) import32.lib cw32mt.lib
# ---------------------------------------------------------------------------
!ifdef IDEOPTIONS
[Version Info]
IncludeVerInfo=1
AutoIncBuild=1
MajorVer=1
MinorVer=0
Release=10
Build=1440
Debug=0
PreRelease=0
Special=0
Private=0
DLL=1
Locale=1033
CodePage=1252
[Version Info Keys]
CompanyName=PNG/MNG Group
FileDescription=libmng - THE MNG library
FileVersion=1.0.10.1440
InternalName=libmng
LegalCopyright=Copyright © 2000-2007 G. Juyn, 2007 G.Randers-Pherson
LegalTrademarks=
OriginalFilename=libmng.dll
ProductName=libmng
ProductVersion=1.0.10
Comments=
[HistoryLists\hlIncludePath]
Count=12
Item0=c:\program files\borland\cbuilder3\projects;..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms\include;..\..\..\lcms\src;$(BCB)\include;$(BCB)\bin
Item1=..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms\include;..\..\..\lcms\src;$(BCB)\include;$(BCB)\bin
Item2=c:\program files\borland\cbuilder3\projects;..\..\..\libmng;..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms\include;..\..\..\lcms\src;$(BCB)\include;$(BCB)\bin
Item3=..\..\..\libmng;..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms\include;..\..\..\lcms\src;$(BCB)\include;$(BCB)\bin
Item4=..\..\..\libmng;..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms\include;$(BCB)\include;$(BCB)\bin
Item5=..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms\include;$(BCB)\include;$(BCB)\bin
Item6=..\..\..\libmng;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms\include;$(BCB)\include;$(BCB)\bin
Item7=..\..\..\..\jpgsrc6b;..\..\..\..\lcms\include;..\..\..\..\lcms\source;..\..\..\..\zlib;..\..\..\..\libmng;$(BCB)\include;$(BCB)\bin
Item8=..\..\..\..\lcms\include;..\..\..\..\lcms\source;..\..\..\..\zlib;..\..\..\..\libmng;$(BCB)\include;$(BCB)\bin
Item9=..\..\..\..\zlib;..\..\..\..\libmng;$(BCB)\include;$(BCB)\bin
Item10=..\..\libmng;$(BCB)\include;$(BCB)\bin
Item11=..\..\libmng;$(BCB)\include
[HistoryLists\hlLibraryPath]
Count=12
Item0=c:\program files\borland\cbuilder3\projects;..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms\include;..\..\..\lcms\src;$(BCB)\lib;$(BCB)\bin
Item1=..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms\include;..\..\..\lcms\src;$(BCB)\lib;$(BCB)\bin
Item2=c:\program files\borland\cbuilder3\projects;..\..\..\lcms\src;..\..\..\libmng;..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;$(BCB)\lib;$(BCB)\bin
Item3=..\..\..\lcms\src;..\..\..\libmng;..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;$(BCB)\lib;$(BCB)\bin
Item4=..\..\..\libmng;..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;$(BCB)\lib;$(BCB)\bin
Item5=..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;$(BCB)\lib;$(BCB)\bin
Item6=..\..\..\libmng;..\..\..\jpgsrc6b;..\..\..\zlib;$(BCB)\lib;$(BCB)\bin
Item7=..\..\..\..\jpgsrc6b;..\..\..\..\lcms\source;..\..\..\..\zlib;..\..\..\..\libmng;$(BCB)\lib;$(BCB)\bin
Item8=..\..\..\..\lcms\source;..\..\..\..\zlib;..\..\..\..\libmng;$(BCB)\lib;$(BCB)\bin
Item9=..\..\..\..\zlib;..\..\..\..\libmng;$(BCB)\lib;$(BCB)\bin
Item10=..\..\libmng;$(BCB)\lib;$(BCB)\bin
Item11=..\..\libmng;$(BCB)\lib
[HistoryLists\hlDebugSourcePath]
Count=7
Item0=..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms\src
Item1=..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms\source;..\..\..\lcms\src
Item2=..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms\source
Item3=..\..\..\jpgsrc6b;..\..\..\lcms\source;..\..\..\zlib;..\..\..\libmng
Item4=..\..\..\..\jpgsrc6b;..\..\..\..\lcms\source;..\..\..\..\zlib;..\..\..\..\libmng
Item5=..\..\..\..\libmng
Item6=..\..\libmng
[HistoryLists\hlConditionals]
Count=30
Item0=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;XMNG_DECREMENT_LOOPS;MNG_OPTIMIZE_FOOTPRINT_INIT;XMNG_OPTIMIZE_FOOTPRINT_MAGN;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER;XMNG_OPTIMIZE_DISPLAYCALLS;XMNG_INCLUDE_MPNG_PROPOSAL;XMNG_INCLUDE_ANG_PROPOSAL
Item1=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;XMNG_DECREMENT_LOOPS;MNG_OPTIMIZE_FOOTPRINT_INIT;XMNG_OPTIMIZE_FOOTPRINT_MAGN;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER;XMNG_OPTIMIZE_DISPLAYCALLS;MNG_INCLUDE_MPNG_PROPOSAL;MNG_INCLUDE_ANG_PROPOSAL
Item2=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;XMNG_DECREMENT_LOOPS;MNG_OPTIMIZE_FOOTPRINT_INIT;XMNG_OPTIMIZE_FOOTPRINT_MAGN;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER;XMNG_OPTIMIZE_DISPLAYCALLS;XMNG_INCLUDE_MPNG_PROPOSAL;MNG_INCLUDE_ANG_PROPOSAL
Item3=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;XMNG_DECREMENT_LOOPS;MNG_OPTIMIZE_FOOTPRINT_INIT;XMNG_OPTIMIZE_FOOTPRINT_MAGN;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER;XMNG_OPTIMIZE_DISPLAYCALLS;MNG_INCLUDE_MPNG_PROPOSAL;XMNG_INCLUDE_ANG_PROPOSAL
Item4=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;XMNG_DECREMENT_LOOPS;MNG_OPTIMIZE_FOOTPRINT_INIT;XMNG_OPTIMIZE_FOOTPRINT_MAGN;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER;XMNG_OPTIMIZE_DISPLAYCALLS;MNG_INCLUDE_MPNG_PROPOSAL;MNG_INCLUDE_ANG6_PROPOSAL
Item5=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;XMNG_DECREMENT_LOOPS;MNG_OPTIMIZE_FOOTPRINT_INIT;XMNG_OPTIMIZE_FOOTPRINT_MAGN;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER;XMNG_OPTIMIZE_DISPLAYCALLS;MNG_INCLUDE_MPNG_PROPOSAL
Item6=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;XMNG_DECREMENT_LOOPS;MNG_OPTIMIZE_FOOTPRINT_INIT;XMNG_OPTIMIZE_FOOTPRINT_MAGN;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER;XMNG_OPTIMIZE_DISPLAYCALLS;XMNG_INCLUDE_MPNG_PROPOSAL
Item7=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;XMNG_DECREMENT_LOOPS;MNG_OPTIMIZE_FOOTPRINT_INIT;XMNG_OPTIMIZE_FOOTPRINT_MAGN;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;XMNG_OPTIMIZE_CHUNKREADER;XMNG_OPTIMIZE_DISPLAYCALLS;MNG_INCLUDE_MPNG_PROPOSAL
Item8=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;XMNG_DECREMENT_LOOPS;MNG_OPTIMIZE_FOOTPRINT_INIT;XMNG_OPTIMIZE_FOOTPRINT_MAGN;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER;XMNG_OPTIMIZE_DISPLAYCALLS;MNG_SUPPORT_MPNG_PROPOSAL
Item9=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;XMNG_DECREMENT_LOOPS;MNG_OPTIMIZE_FOOTPRINT_INIT;XMNG_OPTIMIZE_FOOTPRINT_MAGN;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER;XMNG_OPTIMIZE_DISPLAYCALLS
Item10=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;XMNG_DECREMENT_LOOPS;MNG_OPTIMIZE_FOOTPRINT_INIT;XMNG_OPTIMIZE_FOOTPRINT_MAGN;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER;MNG_OPTIMIZE_DISPLAYCALLS
Item11=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;MNG_DECREMENT_LOOPS;MNG_OPTIMIZE_FOOTPRINT_INIT;XMNG_OPTIMIZE_FOOTPRINT_MAGN;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER;XMNG_OPTIMIZE_DISPLAYCALLS
Item12=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;MNG_DECREMENT_LOOPS;MNG_OPTIMIZE_FOOTPRINT_INIT;MNG_OPTIMIZE_FOOTPRINT_MAGN;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER;XMNG_OPTIMIZE_DISPLAYCALLS
Item13=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;MNG_OPTIMIZE_FOOTPRINT_INIT;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER;XMNG_OPTIMIZE_DISPLAYCALLS
Item14=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;MNG_OPTIMIZE_FOOTPRINT_INIT;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER;XMNG_OPTIMIZE_DISPLAYCALLS;MNG_NO_OLD_VERSIONS
Item15=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;MNG_OPTIMIZE_FOOTPRINT_INIT;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER;MNG_OPTIMIZE_DISPLAYCALLS
Item16=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;MNG_OPTIMIZE_FOOTPRINT_INIT;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER
Item17=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;MNG_OPTIMIZE_FOOTPRINT_INIT;XMNG_OPTIMIZE_OBJCLEANUP;XMNG_OPTIMIZE_CHUNKINITFREE;XMNG_OPTIMIZE_CHUNKASSIGN;XMNG_OPTIMIZE_CHUNKREADER
Item18=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;MNG_OPTIMIZE_FOOTPRINT_INIT;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_CHUNKASSIGN;XMNG_OPTIMIZE_CHUNKREADER
Item19=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;MNG_OPTIMIZE_FOOTPRINT_INIT;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKASSIGN;MNG_OPTIMIZE_CHUNKREADER
Item20=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;MNG_OPTIMIZE_FOOTPRINT_INIT;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKASSIGN;XMNG_OPTIMIZE_CHUNKREADER
Item21=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;MNG_OPTIMIZE_FOOTPRINT_INIT;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_OBJCLEANUP;MNG_OPTIMIZE_CHUNKASSIGN
Item22=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;MNG_OPTIMIZE_FOOTPRINT_INIT;MNG_OPTIMIZE_CHUNKINITFREE;MNG_OPTIMIZE_OBJCLEANUP
Item23=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;MNG_OPTIMIZE_FOOTPRINT_INIT;MNG_OPTIMIZE_CHUNKINITFREE
Item24=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;MNG_OPTIMIZE_FOOTPRINT_INIT;XMNG_OPTIMIZE_CHUNKINITFREE
Item25=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;MNG_OPTIMIZE_FOOTPRINT_INIT
Item26=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;XMNG_OPTIMIZE_FOOTPRINT_COMPOSE;XMNG_OPTIMIZE_FOOTPRINT_DIV;XMNG_OPTIMIZE_FOOTPRINT_SWITCH;XMNG_OPTIMIZE_FOOTPRINT_INIT
Item27=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;MNG_OPTIMIZE_FOOTPRINT_INIT;MNG_SUPPORT_TRACE
Item28=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;MNG_OPTIMIZE_FOOTPRINT_INIT;x_MNG_NO_16BIT_SUPPORT
Item29=_NO_VCL;MNG_BUILD_DLL;MNG_FULL_CMS;MNG_STRICT_ANSI;MNG_CHECK_BAD_ICCP;ZLIB_DLL;ZLIB_WINAPI;MNG_OPTIMIZE_FOOTPRINT_COMPOSE;MNG_OPTIMIZE_FOOTPRINT_DIV;MNG_OPTIMIZE_FOOTPRINT_SWITCH;MNG_OPTIMIZE_FOOTPRINT_INIT;MNG_NO_16BIT_SUPPORT
[HistoryLists\hlIntOutputDir]
Count=2
Item0=..\..\..\obj
Item1=..\..\..\..\obj
[HistoryLists\hlHostApplication]
Count=23
Item0=D:\Triple-T\Software\mnglib3t\libmng-devel\bcb\win32dll\mngview.exe
Item1=D:\Triple-T\Software\mnglib3t\libmng-devel\bcb\win32dll\MNGJNGportal.exe
Item2=D:\Triple-T\Software\mnglib3t\libmng-devel\bcb\win32dll\gif2mng.exe
Item3=D:\Triple-T\Software\mnglib3t\libmng-devel\bcb\win32dll\mngview_push.exe
Item4=D:\Triple-T\Software\mnglib3t\libmng-devel\bcb\win32dll\mngtree.exe
Item5=D:\Triple-T\Software\mnglib3t\libmng-devel\bcb\win32dll\mngdump.exe
Item6=D:\Triple-T\Software\mnglib3t\libmng-devel\bcb\win32dll\lm_diag.exe
Item7=D:\Triple-T\Software\mnglib3t\libmng-devel\bcb\win32dll\eMNGma.exe
Item8=D:\Triple-T\Software\mnglib3t\libmng-devel\bcb\win32dll\bogus.exe
Item9=D:\Triple-T\Software\mnglib3t\libmng-devel\bcb\win32dll\TestNGImage.exe
Item10=D:\Triple-T\Software\mnglib3t\libmng-devel\bcb\win32dll\mngrepair.exe
Item11=D:\Triple-T\Software\mnglib3t\libmng-devel\bcb\win32dll\Test_lz.exe
Item12=D:\Triple-T\Software\LossyPNG\Bin\Test_lz.exe
Item13=D:\Triple-T\Software\mnglib3t\libmng-devel\bcb\win32dll\SlowView.exe
Item14=D:\Triple-T\Software\mnglib3t\libmng-devel\bcb\win32dll\Bin\eMNGma.exe
Item15=D:\Triple-T\Software\mnglib3t\libmng-devel\bcb\win32dll\mngpromo.exe
Item16=D:\Triple-T\Software\mnglib3t\libmng\bcb\win32dll\mngdump.exe
Item17=D:\Triple-T\Software\mnglib3t\libmng\bcb\win32dll\mngview.exe
Item18=D:\Triple-T\Software\mnglib3t\libmng\bcb\win32dll\bogus.exe
Item19=D:\Triple-T\Software\mnglib3t\libmng\bcb\win32dll\mngtree.exe
Item20=D:\Triple-T\Software\mnglib3t\libmng\samples\bcb\win32dll\mngview.exe
Item21=D:\Triple-T\Software\mnglib3t\libmng\samples\bcb\win32dll\mngdump.exe
Item22=D:\Triple-T\Software\mnglib3t\libmng\samples\Delphi3\mngdump\mngdump.exe
[HistoryLists\hlRunParameters]
Count=3
Item0=sample.mng
Item1=roilion02.mng roilion02-fixed.mng
Item2=usflag-lc-d63.mng
[Debugging]
DebugSourceDirs=..\..\..\libmng-devel;..\..\..\zlib;..\..\..\jpgsrc6b;..\..\..\lcms\src
[Parameters]
RunParams=
HostApplication=D:\Triple-T\Software\mnglib3t\libmng-devel\bcb\win32dll\mngview.exe
!endif
# ---------------------------------------------------------------------------
# MAKE SECTION
# ---------------------------------------------------------------------------
# This section of the project file is not used by the BCB IDE. It is for
# the benefit of building from the command-line using the MAKE utility.
# ---------------------------------------------------------------------------
.autodepend
# ---------------------------------------------------------------------------
!if !$d(BCC32)
BCC32 = bcc32
!endif
!if !$d(DCC32)
DCC32 = dcc32
!endif
!if !$d(TASM32)
TASM32 = tasm32
!endif
!if !$d(LINKER)
LINKER = ilink32
!endif
!if !$d(BRCC32)
BRCC32 = brcc32
!endif
# ---------------------------------------------------------------------------
!if $d(PATHCPP)
.PATH.CPP = $(PATHCPP)
.PATH.C = $(PATHCPP)
!endif
!if $d(PATHPAS)
.PATH.PAS = $(PATHPAS)
!endif
!if $d(PATHASM)
.PATH.ASM = $(PATHASM)
!endif
!if $d(PATHRC)
.PATH.RC = $(PATHRC)
!endif
# ---------------------------------------------------------------------------
$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE)
$(BCB)\BIN\$(LINKER) @&&!
$(LFLAGS) +
$(ALLOBJ), +
$(PROJECT),, +
$(ALLLIB), +
$(DEFFILE), +
$(ALLRES)
!
# ---------------------------------------------------------------------------
.pas.hpp:
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
.pas.obj:
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
.cpp.obj:
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
.c.obj:
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
.asm.obj:
$(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@
.rc.res:
$(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $<
# ---------------------------------------------------------------------------

View file

@ -1,153 +0,0 @@
/* ************************************************************************** */
/* * * */
/* * COPYRIGHT NOTICE: * */
/* * * */
/* * Copyright (c) 2000-2007 Gerard Juyn (gerard@libmng.com) * */
/* * [You may insert additional notices after this sentence if you modify * */
/* * this source] * */
/* * * */
/* * For the purposes of this copyright and license, "Contributing Authors" * */
/* * is defined as the following set of individuals: * */
/* * * */
/* * Gerard Juyn * */
/* * (hopefully some more to come...) * */
/* * * */
/* * The MNG Library is supplied "AS IS". The Contributing Authors * */
/* * disclaim all warranties, expressed or implied, including, without * */
/* * limitation, the warranties of merchantability and of fitness for any * */
/* * purpose. The Contributing Authors assume no liability for direct, * */
/* * indirect, incidental, special, exemplary, or consequential damages, * */
/* * which may result from the use of the MNG Library, even if advised of * */
/* * the possibility of such damage. * */
/* * * */
/* * Permission is hereby granted to use, copy, modify, and distribute this * */
/* * source code, or portions hereof, for any purpose, without fee, subject * */
/* * to the following restrictions: * */
/* * * */
/* * 1. The origin of this source code must not be misrepresented; * */
/* * you must not claim that you wrote the original software. * */
/* * * */
/* * 2. Altered versions must be plainly marked as such and must not be * */
/* * misrepresented as being the original source. * */
/* * * */
/* * 3. This Copyright notice may not be removed or altered from any source * */
/* * or altered source distribution. * */
/* * * */
/* * The Contributing Authors specifically permit, without fee, and * */
/* * encourage the use of this source code as a component to supporting * */
/* * the MNG and JNG file format in commercial products. If you use this * */
/* * source code in a product, acknowledgment would be highly appreciated. * */
/* * * */
/* ************************************************************************** */
/* * * */
/* * project : libmng * */
/* * file : libmng.cpp copyright (c) 2000-2002 G.Juyn * */
/* * version : 1.0.5 * */
/* * * */
/* * purpose : generic dll project assembly file * */
/* * * */
/* * author : G.Juyn * */
/* * web : http://www.3-t.com * */
/* * email : mailto:info@3-t.com * */
/* * * */
/* * comment : Autogenerated file with the libmng.dll BCB project * */
/* * * */
/* * changes : 0.5.1 - 05/14/2000 - G.Juyn * */
/* * - added this block * */
/* * * */
/* * 1.0.5 - 08/20/2000 - G.Juyn * */
/* * - version-number & copyright * */
/* * * */
/* ************************************************************************** */
#include <windows.h>
#pragma hdrstop
#include <condefs.h>
/* ************************************************************************** */
USERES("libmng.res");
USEUNIT("..\..\libmng_hlapi.c");
USEUNIT("..\..\libmng_callback_xs.c");
USEUNIT("..\..\libmng_prop_xs.c");
USEUNIT("..\..\libmng_chunk_xs.c");
USEUNIT("..\..\libmng_object_prc.c");
USEUNIT("..\..\libmng_chunk_descr.c");
USEUNIT("..\..\libmng_chunk_prc.c");
USEUNIT("..\..\libmng_chunk_io.c");
USEUNIT("..\..\libmng_read.c");
USEUNIT("..\..\libmng_write.c");
USEUNIT("..\..\libmng_display.c");
USEUNIT("..\..\libmng_dither.c");
USEUNIT("..\..\libmng_pixels.c");
USEUNIT("..\..\libmng_filter.c");
USEUNIT("..\..\libmng_error.c");
USEUNIT("..\..\libmng_trace.c");
USEUNIT("..\..\libmng_cms.c");
USEUNIT("..\..\libmng_zlib.c");
USEUNIT("..\..\libmng_jpeg.c");
USEUNIT("..\..\..\zlib\adler32.c");
USEUNIT("..\..\..\zlib\compress.c");
USEUNIT("..\..\..\zlib\crc32.c");
USEUNIT("..\..\..\zlib\deflate.c");
USEUNIT("..\..\..\zlib\inffast.c");
USEUNIT("..\..\..\zlib\inflate.c");
USEUNIT("..\..\..\zlib\inftrees.c");
USEUNIT("..\..\..\zlib\trees.c");
USEUNIT("..\..\..\zlib\uncompr.c");
USEUNIT("..\..\..\zlib\zutil.c");
USEUNIT("..\..\..\jpgsrc6b\jquant2.c");
USEUNIT("..\..\..\jpgsrc6b\jcapistd.c");
USEUNIT("..\..\..\jpgsrc6b\jccoefct.c");
USEUNIT("..\..\..\jpgsrc6b\jccolor.c");
USEUNIT("..\..\..\jpgsrc6b\jcdctmgr.c");
USEUNIT("..\..\..\jpgsrc6b\jchuff.c");
USEUNIT("..\..\..\jpgsrc6b\jcinit.c");
USEUNIT("..\..\..\jpgsrc6b\jcmainct.c");
USEUNIT("..\..\..\jpgsrc6b\jcmarker.c");
USEUNIT("..\..\..\jpgsrc6b\jcmaster.c");
USEUNIT("..\..\..\jpgsrc6b\jcomapi.c");
USEUNIT("..\..\..\jpgsrc6b\jcparam.c");
USEUNIT("..\..\..\jpgsrc6b\jcphuff.c");
USEUNIT("..\..\..\jpgsrc6b\jcprepct.c");
USEUNIT("..\..\..\jpgsrc6b\jcsample.c");
USEUNIT("..\..\..\jpgsrc6b\jctrans.c");
USEUNIT("..\..\..\jpgsrc6b\jdapistd.c");
USEUNIT("..\..\..\jpgsrc6b\jdatadst.c");
USEUNIT("..\..\..\jpgsrc6b\jdatasrc.c");
USEUNIT("..\..\..\jpgsrc6b\jdcoefct.c");
USEUNIT("..\..\..\jpgsrc6b\jdcolor.c");
USEUNIT("..\..\..\jpgsrc6b\jddctmgr.c");
USEUNIT("..\..\..\jpgsrc6b\jdhuff.c");
USEUNIT("..\..\..\jpgsrc6b\jdinput.c");
USEUNIT("..\..\..\jpgsrc6b\jdmainct.c");
USEUNIT("..\..\..\jpgsrc6b\jdmarker.c");
USEUNIT("..\..\..\jpgsrc6b\jdmaster.c");
USEUNIT("..\..\..\jpgsrc6b\jdmerge.c");
USEUNIT("..\..\..\jpgsrc6b\jdphuff.c");
USEUNIT("..\..\..\jpgsrc6b\jdpostct.c");
USEUNIT("..\..\..\jpgsrc6b\jdsample.c");
USEUNIT("..\..\..\jpgsrc6b\jdtrans.c");
USEUNIT("..\..\..\jpgsrc6b\jerror.c");
USEUNIT("..\..\..\jpgsrc6b\jfdctflt.c");
USEUNIT("..\..\..\jpgsrc6b\jfdctfst.c");
USEUNIT("..\..\..\jpgsrc6b\jfdctint.c");
USEUNIT("..\..\..\jpgsrc6b\jidctflt.c");
USEUNIT("..\..\..\jpgsrc6b\jidctfst.c");
USEUNIT("..\..\..\jpgsrc6b\jidctint.c");
USEUNIT("..\..\..\jpgsrc6b\jidctred.c");
USEUNIT("..\..\..\jpgsrc6b\jmemmgr.c");
USEUNIT("..\..\..\jpgsrc6b\jmemnobs.c");
USEUNIT("..\..\..\jpgsrc6b\jquant1.c");
USEUNIT("..\..\..\jpgsrc6b\jcapimin.c");
USEUNIT("..\..\..\jpgsrc6b\jutils.c");
USEUNIT("..\..\..\jpgsrc6b\jdapimin.c");
USELIB("..\..\..\lcms\Projects\Bcc-5.5-static\lcmsstat.lib");
//---------------------------------------------------------------------------
#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
{
return 1;
}
/* ************************************************************************** */

View file

@ -1 +0,0 @@
For details check the README.contrib file in the parent directory!

View file

@ -1,25 +0,0 @@
//---------------------------------------------------------------------------
// About.cpp : About pane text
//---------------------------------------------------------------------------
#include "About.h"
// NB : If more text is to go in here don't forget to enlarge min/max
extern char *_szAbout = {
"\nCopyright (c) 2000 Andy Protano (a.a.protano@care4free.net)"\
"\n Gerard Juyn (gerard@libmng.com)"\
"\n"\
"\nLibmng website - www.libmng.com"
"\nMNG Homepage - www.libpng.org/pub/mng"
"\nPNG Homepage - www.libpng.org/pub/png"
"\n"
"\nThis program is based upon the orignal \'MngTree\' by Gerard Juyn"\
"\nAuthor & current maintainer : Andy Protano (a.a.protano@care4free.net)"\
"\n"\
"\nThis software is based on libmng which in its turn is based on software by :"\
"\n"\
"\nIndependant JPEG Group - http://www.ijg.org"\
"\nLcms (little CMS) library by Marti Maria Saguar - http://www.lcms.colorid.de"\
"\nZlib - http://www.info-zip.org/pub/infozip/zlib"\
};
//---------------------------------------------------------------------------

View file

@ -1,7 +0,0 @@
//---------------------------------------------------------------------------
#ifndef AboutH
#define AboutH
//---------------------------------------------------------------------------
extern char *_szAbout;
#endif

View file

@ -1,96 +0,0 @@
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
# include <stdlib.h>
#include "Main.h"
//---------------------------------------------------------------------------
mng_ptr __stdcall TMainForm::Alloc( mng_size_t iSize )
{
return (mng_ptr)calloc( 1, (size_t)iSize );
}
//---------------------------------------------------------------------------
void __stdcall TMainForm::Free( mng_ptr pPtr, mng_size_t iSize )
{
free( pPtr );
return;
}
//---------------------------------------------------------------------------
mng_bool __stdcall TMainForm::FileReadData( mng_handle hMNG,
mng_ptr pBuf,
mng_uint32 iSize,
mng_uint32 *iRead )
{
TMainForm *MainForm = (TMainForm *)mng_get_userdata( hMNG );
*iRead = fread( pBuf, 1, iSize, MainForm->GetFd() );
// iRead will indicate EOF
MainForm->ProgressBar1->Position += (int)iRead;
return MNG_TRUE;
}
//---------------------------------------------------------------------------
mng_bool __stdcall TMainForm::ProcessHeader( mng_handle hHandle,
mng_uint32 iWidth,
mng_uint32 iHeight )
{
TMainForm *MainForm = (TMainForm *)mng_get_userdata( hHandle );
MainForm->Caption = ExtractFileName( MainForm->OpenDialog1->FileName ) +
" [" +
String( iWidth ) +
"x" +
String( iHeight ) +
"]";
Application->Title = MainForm->asAppName + " " + MainForm->Caption;
MainForm->ProgressBar1->Max = iWidth * iHeight;
return MNG_TRUE;
}
//---------------------------------------------------------------------------
mng_bool __stdcall TMainForm::OpenStream( mng_handle hMNG )
{
// nothing to do !
return MNG_TRUE;
}
//---------------------------------------------------------------------------
mng_bool __stdcall TMainForm::CloseStream( mng_handle hMNG )
{
MainForm->ProgressBar1->Position = 0;
return MNG_TRUE;
}
//---------------------------------------------------------------------------
mng_bool __stdcall TMainForm::IterateChunks( mng_handle hMNG,
mng_handle hChunk,
mng_chunkid iChunktype,
mng_uint32 iChunkseq )
{
TMainForm *MainForm = (TMainForm *)mng_get_userdata( hMNG );
char aCh[5];
// decode the chunkname
aCh[0] = (char)((iChunktype >> 24) & 0xFF);
aCh[1] = (char)((iChunktype >> 16) & 0xFF);
aCh[2] = (char)((iChunktype >> 8) & 0xFF);
aCh[3] = (char)((iChunktype ) & 0xFF);
aCh[4] = (char)0; // zero terminate - used as a "C" string below
MainForm->RichEditReport->Lines->Add( "" );
MainForm->RichEditReport->Lines->Add(
"Chunk " + String( iChunkseq + 1 ) + " : " + String( aCh ) );
// Add Chunk text to listbox
MainForm->ListBoxChunks->Items->Add( aCh );
// keep'm coming ... unless we encounter an error
return MainForm->ShowChunk( hMNG, hChunk, iChunktype );
}
//---------------------------------------------------------------------------

View file

@ -1,39 +0,0 @@
//---------------------------------------------------------------------------
#include <vcl.h>
#include "Main.h"
#include "libmng.h"
#pragma hdrstop
#ifndef CallbackH
#define CallbackH
//---------------------------------------------------------------------------
extern mng_ptr __stdcall myalloc( mng_size_t iSize );
//---------------------------------------------------------------------------
extern void __stdcall myfree( mng_ptr pPtr, mng_size_t iSize );
//---------------------------------------------------------------------------
extern mng_bool __stdcall myreaddata( mng_handle hMNG,
mng_ptr pBuf,
mng_uint32 iSize,
mng_uint32 *iRead );
//---------------------------------------------------------------------------
extern mng_bool __stdcall ProcessHeader( mng_handle hHandle,
mng_uint32 iWidth,
mng_uint32 iHeight );
//---------------------------------------------------------------------------
extern mng_bool __stdcall myopenstream( mng_handle hMNG );
//---------------------------------------------------------------------------
extern mng_bool __stdcall myclosestream( mng_handle hMNG );
//---------------------------------------------------------------------------
extern mng_bool __stdcall myiterchunk ( mng_handle hMNG,
mng_handle hChunk,
mng_chunkid iChunktype,
mng_uint32 iChunkseq );
//---------------------------------------------------------------------------
extern mng_bool __stdcall mytraceproc( mng_handle hHandle,
mng_int32 iFuncnr,
mng_int32 iFuncseq,
mng_pchar zFuncname );
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,23 +0,0 @@
//---------------------------------------------------------------------------
// Help.cpp : Help pane text
//---------------------------------------------------------------------------
#include "Help.h"
// NB : If more text is to go in here don't forget to enlarge min/max
extern char *_szHelp = {
"\nA MNG developers tool to display the chunk data of MNG/JNG/PNG files."\
"\n"
"\nMngDump - Version 1.0 - September 2000"\
"\n"\
"\n NOTE - This program comes with NO warranties whatsoever."\
"\n"\
"\nInstruction for use ... press the folder button and load a file !"\
"\n"\
"\nThe following chunks are (currently) unsupported :"\
"\nIJNG, IPNG, JSEP, MaGN, MAGN, oFFs, pCAL, sCAL"\
"\n"\
"\nThe program will be periodically updated, inline with libmng's growth."\
"\nPlease report any bugs, suggestions, etc to the maintainer."
};
//---------------------------------------------------------------------------

View file

@ -1,6 +0,0 @@
//---------------------------------------------------------------------------
#ifndef HelpH
#define HelpH
//---------------------------------------------------------------------------
extern char *_szHelp;
#endif

View file

@ -1,195 +0,0 @@
# ---------------------------------------------------------------------------
!if !$d(BCB)
BCB = $(MAKEDIR)\..
!endif
# ---------------------------------------------------------------------------
# IDE SECTION
# ---------------------------------------------------------------------------
# The following section of the project makefile is managed by the BCB IDE.
# It is recommended to use the IDE to change any of the values in this
# section.
# ---------------------------------------------------------------------------
VERSION = BCB.03
# ---------------------------------------------------------------------------
PROJECT = MNGDUMP.exe
OBJFILES = MNGDUMP.obj Main.obj Chunks.obj About.obj Callback.obj Help.obj
RESFILES = MngDump.res
DEFFILE =
RESDEPEN = $(RESFILES) Main.dfm
LIBFILES = ..\..\..\bcb\win32dll\libmng.lib
LIBRARIES = VCL35.lib
SPARELIBS = VCL35.lib
PACKAGES = VCLX35.bpi VCL35.bpi VCLDB35.bpi VCLDBX35.bpi bcbsmp35.bpi dclocx35.bpi \
QRPT35.bpi
# ---------------------------------------------------------------------------
PATHCPP = .;
PATHASM = .;
PATHPAS = .;
PATHRC = .;
DEBUGLIBPATH = $(BCB)\lib\debug
RELEASELIBPATH = $(BCB)\lib\release
# ---------------------------------------------------------------------------
CFLAG1 = -O2 -w -Ve -k- -vi -c -b- -w-par -w-inl -Vx -tW
CFLAG2 = -I..\win32dll;$(BCB)\include;$(BCB)\include\vcl;..\..\..\libmng;..\..\..\zlib;..\..\..\jpgsrc6b
CFLAG3 = -Tkh30000 -6
PFLAGS = -U..\win32dll;$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \
-I..\win32dll;$(BCB)\include;$(BCB)\include\vcl;..\..\..\libmng;..\..\..\zlib;..\..\..\jpgsrc6b \
-$L- -$D- -v -JPHN -M
RFLAGS = -i..\win32dll;$(BCB)\include;$(BCB)\include\vcl;..\..\..\libmng;..\..\..\zlib;..\..\..\jpgsrc6b
AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /i..\..\..\libmng /i..\..\..\zlib \
/i..\..\..\jpgsrc6b /mx /w2 /zd /dMNG_SUPPORT_READ /dMNG_ACCESS_CHUNKS \
/dMNG_STORE_CHUNKS /dMNG_NO_CMS /dMNG_USE_DLL /dHAVE_BOOLEAN
LFLAGS = -L..\win32dll;$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) -aa -Tpe -x -Gn
IFLAGS =
# ---------------------------------------------------------------------------
ALLOBJ = c0w32.obj sysinit.obj $(OBJFILES)
ALLRES = $(RESFILES)
ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib
# ---------------------------------------------------------------------------
!ifdef IDEOPTIONS
[Version Info]
IncludeVerInfo=1
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=1
Special=0
Private=0
DLL=0
Locale=2057
CodePage=1252
[Version Info Keys]
CompanyName=RDS
FileDescription=MngDump
FileVersion=1.0.0.0
InternalName=
LegalCopyright=Copyright (c) 2000 G.Juyn
LegalTrademarks=
OriginalFilename=MngTree
ProductName=
ProductVersion=1.0.0.0
Comments=Author Andy Protano - September 2000
[HistoryLists\hlIncludePath]
Count=10
Item0=$(BCB)\include;$(BCB)\include\vcl;..\..\..\libmng;..\..\..\zlib;..\..\..\jpgsrc6b
Item1=$(BCB)\include;$(BCB)\include\vcl;..\..;..\..\..\zlib;..\..\..\jpgsrc6b
Item2=..\mngtree;..\..\delphi\mngview;$(BCB)\include;$(BCB)\include\vcl;..\..\..\libmng;..\..\..\zlib;..\..\..\jpgsrc6b
Item3=..\mngtree;..\..\delphi\mngview;$(BCB)\include;$(BCB)\include\vcl;..\..\..\libmng;..\..\..\zlib;..\..\..\libjpeg
Item4=..\..\delphi\mngview;$(BCB)\include;$(BCB)\include\vcl;..\..;..\..\..\zlib;..\..\..\libjpeg
Item5=$(BCB)\include;$(BCB)\include\vcl;..\..;..\..\..\zlib;..\..\..\libjpeg
Item6=$(BCB)\include;$(BCB)\include\vcl;..\..;..\..\zlib;..\..\libjpeg
Item7=$(BCB)\include;$(BCB)\include\vcl;..\..
Item8=$(BCB)\include;$(BCB)\include\vcl;..
Item9=$(BCB)\include;$(BCB)\include\vcl
[HistoryLists\hlLibraryPath]
Count=4
Item0=$(BCB)\lib\obj;$(BCB)\lib
Item1=..\mngtree;$(BCB)\lib\obj;$(BCB)\lib
Item2=..\mngtree;..\..\delphi\mngview;$(BCB)\lib\obj;$(BCB)\lib
Item3=..\..\delphi\mngview;$(BCB)\lib\obj;$(BCB)\lib
[HistoryLists\hlDebugSourcePath]
Count=1
Item0=$(BCB)\source\vcl
[HistoryLists\hlConditionals]
Count=6
Item0=MNG_SUPPORT_READ;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS;MNG_USE_DLL;HAVE_BOOLEAN
Item1=_RTLDLL;MNG_SUPPORT_READ;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS;MNG_USE_DLL;HAVE_BOOLEAN
Item2=_RTLDLL;MNG_SUPPORT_READ;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;MNG_NO_CMS;MNG_USE_DLL
Item3=_RTLDLL;HAVE_BOOLEAN
Item4=_RTLDLL
Item5=_RTLDLL;USEPACKAGES
[Debugging]
DebugSourceDirs=$(BCB)\source\vcl
[Parameters]
RunParams=
HostApplication=
!endif
# ---------------------------------------------------------------------------
# MAKE SECTION
# ---------------------------------------------------------------------------
# This section of the project file is not used by the BCB IDE. It is for
# the benefit of building from the command-line using the MAKE utility.
# ---------------------------------------------------------------------------
.autodepend
# ---------------------------------------------------------------------------
!if !$d(BCC32)
BCC32 = bcc32
!endif
!if !$d(DCC32)
DCC32 = dcc32
!endif
!if !$d(TASM32)
TASM32 = tasm32
!endif
!if !$d(LINKER)
LINKER = ilink32
!endif
!if !$d(BRCC32)
BRCC32 = brcc32
!endif
# ---------------------------------------------------------------------------
!if $d(PATHCPP)
.PATH.CPP = $(PATHCPP)
.PATH.C = $(PATHCPP)
!endif
!if $d(PATHPAS)
.PATH.PAS = $(PATHPAS)
!endif
!if $d(PATHASM)
.PATH.ASM = $(PATHASM)
!endif
!if $d(PATHRC)
.PATH.RC = $(PATHRC)
!endif
# ---------------------------------------------------------------------------
$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE)
$(BCB)\BIN\$(LINKER) @&&!
$(LFLAGS) +
$(ALLOBJ), +
$(PROJECT),, +
$(ALLLIB), +
$(DEFFILE), +
$(ALLRES)
!
# ---------------------------------------------------------------------------
.pas.hpp:
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
.pas.obj:
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
.cpp.obj:
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
.c.obj:
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
.asm.obj:
$(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@
.rc.res:
$(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $<
# ---------------------------------------------------------------------------

View file

@ -1,27 +0,0 @@
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
USERES("MngDump.res");
USEFORM("Main.cpp", MainForm);
USEUNIT("Chunks.cpp");
USEUNIT("About.cpp");
USEUNIT("Callback.cpp");
USEUNIT("Help.cpp");
USELIB("..\..\..\bcb\win32dll\libmng.lib");
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->Title = "MngDump";
Application->CreateForm(__classid(TMainForm), &MainForm);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
return 0;
}
//---------------------------------------------------------------------------

View file

@ -1,793 +0,0 @@
//---------------------------------------------------------------------------
#include <vcl.h>
#include <stdlib.h>
#include <dir.h>
#pragma hdrstop
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
#include "Main.h"
TMainForm *MainForm;
//---------------------------------------------------------------------------
#include "About.h"
#include "Help.h"
# define PAGE_CHUNKS 1
# define PAGE_REPORT 2
# define PAGE_OPTIONS 3
# define PAGE_ABOUT 4
# define PAGE_HELP 5
/* ************************************************************************** */
/* * * */
/* * MngDump is based on Gerard Juyn's MngTree * */
/* * * */
/* * COPYRIGHT NOTICE: * */
/* * * */
/* * Copyright (c) 2000 Andy Protano * */
/* * Gerard Juyn (gerard@libmng.com) * */
/* * [You may insert additional notices after this sentence if you modify * */
/* * this source] * */
/* * * */
/* * For the purposes of this copyright and license, "Contributing Authors" * */
/* * is defined as the following set of individuals: * */
/* * * */
/* * Gerard Juyn (gerard@libmng.com) * */
/* * Andy Protano (a.a.protano@care4free.net) * */
/* * * */
/* * This program is supplied "AS IS". The Contributing Authors * */
/* * disclaim all warranties, expressed or implied, including, without * */
/* * limitation, the warranties of merchantability and of fitness for any * */
/* * purpose. The Contributing Authors assume no liability for direct, * */
/* * indirect, incidental, special, exemplary, or consequential damages, * */
/* * which may result from the use of the MNG Library, even if advised of * */
/* * the possibility of such damage. * */
/* * * */
/* * Permission is hereby granted to use, copy, modify, and distribute this * */
/* * source code, or portions hereof, for any purpose, without fee, subject * */
/* * to the following restrictions: * */
/* * * */
/* * 1. The origin of this source code must not be misrepresented; * */
/* * you must not claim that you wrote the original software. * */
/* * * */
/* * 2. Altered versions must be plainly marked as such and must not be * */
/* * misrepresented as being the original source. * */
/* * * */
/* * 3. This Copyright notice may not be removed or altered from any source * */
/* * or altered source distribution. * */
/* * * */
/* * The Contributing Authors specifically permit, without fee, and * */
/* * encourage the use of this source code as a component to supporting * */
/* * the MNG and JNG file format in commercial products. If you use this * */
/* * source code in a product, acknowledgment would be highly appreciated. * */
/* * * */
/* ************************************************************************** */
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
__fastcall TMainForm::TMainForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
__fastcall TMainForm::~TMainForm( void )
{
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::OnMinMax(TMessage& Msg)
{
((POINT far *)Msg.LParam)[3].x = 500;
((POINT far *)Msg.LParam)[3].y = 450;
TForm::Dispatch(&Msg);
}
//---------------------------------------------------------------------------
// MessageBox Methods
// ----------------------------------------------------------------------
int __fastcall TMainForm::MessageBox( String &as, UINT flags )
{
return ::MessageBox( Handle, as.c_str(), Application->Title.c_str(), flags );
}
// ----------------------------------------------------------------------
void __fastcall TMainForm::MsgBoxOk( String as )
{
(void)MessageBox( as, MB_ICONINFORMATION );
}
//-------------------------------------------------------------------------
int __fastcall TMainForm::MsgBoxYN( String as )
{
return MessageBox( as, MB_YESNO + MB_ICONQUESTION + MB_DEFBUTTON1 );
}
//-------------------------------------------------------------------------
int __fastcall TMainForm::MsgBoxYNC( String as )
{
return MessageBox( as, MB_YESNOCANCEL | MB_ICONQUESTION );
}
//-------------------------------------------------------------------------
void __fastcall TMainForm::MsgBoxStop( String as )
{
(void)MessageBox( as, MB_ICONSTOP );
}
//-------------------------------------------------------------------------
void __fastcall TMainForm::MsgBoxInfo( String as )
{
(void)MessageBox( as, MB_OK | MB_ICONINFORMATION );
}
//-------------------------------------------------------------------------
void __fastcall TMainForm::MsgBoxWarn( String as )
{
(void)MessageBox( as, MB_OK | MB_ICONWARNING );
}
//-------------------------------------------------------------------------
void __fastcall TMainForm::FormCreate(TObject *Sender)
{
// For when the application name changes - coz i'll forget !
asAppName = Application->Title;
// And while we've got it set the caption
Caption = Application->Title;
// Load About Screen
LabelAbout->Caption = _szAbout;
// Load Help Screen
LabelHelp->Caption = _szHelp;
fd = NULL;
strList = new TStringList();
asTab = " ";// default tab size 2
RadioGroupTabSize->ItemIndex = 1; // range is zero based
// Start with the help pane
PageControl1->ActivePage = tsHelp;
mnuWordWrap->Checked = false;
// This call will TOGGLE and set word wrap for all the applicables
// editors and enable/disable the Horz scroll bar.
mnuWordWrapClick( this ); // So start with false to get to true;
// Clear things from design time settings
StaticTextStatus->Caption = "";
//strList->Clear(); constructor dodid that
pnlChunks->Caption = "";
ListBoxChunks->Clear();
RichEditChunks->Clear();
RichEditReport->Clear();
ProgressBar1->Min = 0;
ProgressBar1->Position = 0;
SetChunkCount( 0 );
// Set default states for switches
cbPaletteEntries->Checked = false;
cbRGBOrder->Checked = true;
cbRawData->Checked = true;
cbComments->Checked = true;
cbMacroIdentifier->Checked = true;
cbBool->Checked = true;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::FormDestroy(TObject *Sender)
{
delete strList;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::mnuExitClick(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::mnuFileOpenClick(TObject *Sender)
{
if( !OpenDialog1->Execute() )
return;
Application->ProcessMessages(); // Refresh the screen
LoadFile();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::mnuReloadClick(TObject *Sender)
{
// Only reload - if we have something to reload
if( OpenDialog1->FileName.Length() )
LoadFile();
else
MsgBoxStop( "Nothing to reload yet !" );
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::mnuUndoClick(TObject *Sender)
{
if( RichEditReport->Lines->Count ) // Do we have something in there ?
RichEditReport->Undo();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::mnuCutClick(TObject *Sender)
{
if( RichEditReport->Lines->Count ) // Do we have something in there ?
RichEditReport->CutToClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::mnuCopyClick(TObject *Sender)
{
if( RichEditReport->Lines->Count ) // Do we have something in there ?
RichEditReport->CopyToClipboard();
}
//-------------------------------------------------------------------------
void __fastcall TMainForm::sbtnCopyChunkClick(TObject *Sender)
{
if( RichEditChunks->Lines->Count ) // Do we have something in there ?
{
// Copy chunk data from Chunks pane to clipboard
RichEditChunks->SelectAll();
RichEditChunks->CopyToClipboard();
RichEditChunks->SelLength = 0;
}
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::mnuPasteClick(TObject *Sender)
{
if( RichEditReport->Lines->Count ) // Do we have something in there ?
RichEditReport->PasteFromClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::mnuSelectAllClick(TObject *Sender)
{
if( RichEditReport->Lines->Count ) // Do we have something in there ?
RichEditReport->SelectAll();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::mnuWordWrapClick(TObject *Sender)
{
bool bWrap;
mnuWordWrap->Checked = !mnuWordWrap->Checked;
bWrap = mnuWordWrap->Checked;
RichEditChunks->WordWrap = bWrap;
RichEditReport->WordWrap = bWrap;
if( bWrap ) { // if Word wrap on then no need for horizontal scrollbar
RichEditChunks->ScrollBars = ssVertical;
RichEditReport->ScrollBars = ssVertical;
} else { // Horizontal scrollbar required (auto)
RichEditChunks->ScrollBars = ssBoth;
RichEditReport->ScrollBars = ssBoth;
}
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::mnuSetFontClick(TObject *Sender)
{
if( FontDialog1->Execute() )
{
RichEditChunks->Font = FontDialog1->Font;
RichEditReport->Font = FontDialog1->Font;
}
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::FontDialog1Apply(TObject *Sender, HWND Wnd)
{
RichEditChunks->Font = FontDialog1->Font;
RichEditReport->Font = FontDialog1->Font;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::mnuFindClick(TObject *Sender)
{
if( RichEditReport->Lines->Count == 0 )
{
MsgBoxStop( "Find what ?.");
return;
}
FindDialog->Execute();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::FindDialogFind(TObject *Sender)
{
TSearchTypes st;
TFindDialog *fd;
int newpos;
if( RichEditReport->Lines->Count == 0 )
{
MsgBoxStop( "Find what ?.");
return;
}
fd = dynamic_cast<TFindDialog *>( Sender );
if( fd->Options.Contains( frMatchCase ) )
st << stMatchCase;
if( fd->Options.Contains( frWholeWord ) )
st << stWholeWord;
if( RichEditReport->SelLength )
RichEditReport->SelStart += 1;
newpos = RichEditReport->FindText( fd->FindText,
RichEditReport->SelStart, RichEditReport->Text.Length(), st );
if( newpos != -1 ) {
RichEditReport->SelStart = newpos;
RichEditReport->SelLength = fd->FindText.Length();
} else {
MsgBoxInfo( "End of document reached." );
RichEditReport->SelStart = 0;
}
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::mnuFindNextClick(TObject *Sender)
{
if( RichEditReport->Lines->Count == 0 )
{
MsgBoxStop( "Find what ?.");
return;
}
FindDialogFind( FindDialog );
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::mnuPrintClick(TObject *Sender)
{
if( RichEditReport->Lines->Count == 0 )
{
MsgBoxStop( "I can't find anything to print !.");
return;
}
RichEditReport->Print( ExtractFileName( OpenDialog1->FileName ) );
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::mnuPrintSetupClick(TObject *Sender)
{
PrinterSetupDialog->Execute();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::mnuSaveClick(TObject *Sender)
{
if( RichEditReport->Lines->Count == 0 )
{
MsgBoxStop( "I can't find anything to save !.");
return;
}
// Grab the graphic's filename and change to "txt" extension
{
char szFile[ MAXFILE ];
char szExt[ MAXEXT ];
char szDest[ MAXPATH ];
String as;
fnsplit( OpenDialog1->FileName.c_str(), NULL, NULL, szFile, szExt );
memset( szDest, 0, MAXPATH );
strcat( szDest, szFile );
strcat( szDest, "\." );
strcat( szDest, "txt" );
as = szDest;
// Initially create a text file of the same name as the graphic
// but with "txt" extension
SaveDialog1->FileName = as;
}
if( !SaveDialog1->Execute() )
return; // Given up hey ?
RichEditReport->Lines->SaveToFile( SaveDialog1->FileName );
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
void __fastcall TMainForm::LoadFile( void )
{
int bStatus;
// Can we open the file ?
if( (fd = fopen( OpenDialog1->FileName.c_str(), "rb") ) == NULL )
{
MsgBoxStop( "Cannot open input file\n\n" + OpenDialog1->FileName );
return;
}
pnlChunks->Caption = "";
strList->Clear();
ListBoxChunks->Clear();
RichEditChunks->Clear();
RichEditReport->Clear();
ProgressBar1->Min = 0;
ProgressBar1->Position = 0;
SetChunkCount( 0 );
RichEditReport->Lines->Add( "" );
RichEditReport->Lines->Add( "Chunk contents of file :" );
RichEditReport->Lines->Add( OpenDialog1->FileName );
RichEditReport->Lines->Add( "" );
// Make report pane visible - prove we are working and not locked up
PageControl1->ActivePage = tsReport;
try {
StaticTextStatus->Caption = "Working ... please wait";
StaticTextStatus->Update();
bStatus = DumpTree(); // true indicates success
}
__finally {
ProgressBar1->Position = 0;
StaticTextStatus->Caption = "Ok";
fclose( fd );
fd = NULL;
}
if( !bStatus ) // We have an error
{
pnlChunks->Caption = "";
strList->Clear();
ListBoxChunks->Clear();
RichEditChunks->Clear();
RichEditReport->Lines->Add("");
RichEditReport->Lines->Add("An error occurred while reading the file.");
} else { // Read file and chunks without any problems
// Set Report Panels caption
pnlChunks->Caption = "Chunk 1 of " + String( ListBoxChunks->Items->Count );
// Set Listbox to first item
ListBoxChunks->ItemIndex = 0;
// Put gleeful message in report pane
RichEditChunks->Lines->Add( "" );
RichEditChunks->Lines->Add(
"No error's found when reading file ... " );
RichEditChunks->Lines->Add(
"Click the list box to display the data for each chunk.");
// Place cursor at top of editor
RichEditChunks->SelStart = 0;
RichEditChunks->SelLength = 0;
// Place cursor at top of editor
RichEditReport->SelStart = 0;
RichEditReport->SelLength = 0;
// Lock richedits - so an immediate undo does not make data vanish !
RichEditReport->Modified = false;
// @ap@ Borland should fix this ! (it don't work)
}
}
//---------------------------------------------------------------------------
bool __fastcall TMainForm::DumpTree( void )
{
mng_handle hMNG;
// let's initialize the library
hMNG = mng_initialize( (mng_ptr)this, Alloc, Free, NULL );
if( !hMNG ) // did that work out ?
{
MNGError( hMNG, "Cannot initialize libmng." );
mng_cleanup( &hMNG ); // Always cleanup the library
MsgBoxStop( "Bye!" );
Application->Terminate(); // Exit now
}
// setup callbacks
if( (mng_setcb_openstream ( hMNG, OpenStream ) != 0) ||
(mng_setcb_closestream ( hMNG, CloseStream ) != 0) ||
(mng_setcb_processheader( hMNG,ProcessHeader ) != 0) ||
(mng_setcb_readdata ( hMNG, FileReadData ) != 0)
)
{
MNGError( hMNG, "Cannot set callbacks for libmng.");
mng_cleanup( &hMNG ); // Always cleanup the library
MsgBoxStop( "Bye!" );
Application->Terminate(); // Exit now
}
else
{
// read the file into memory
if( mng_read( hMNG ) != 0 )
{
// Because we read the whole file in first,
// here is where bad input files first choke !
MNGError( hMNG, "Cannot read the file." );
mng_cleanup( &hMNG ); // Always cleanup the library
return false;
}
else
{
// run through the chunk list
if( mng_iterate_chunks( hMNG, 0, IterateChunks ) != 0 )
{
MNGError( hMNG, "Error Getting Chunk info!" );
mng_cleanup( &hMNG ); // Always cleanup the library
return false; // Errors may occur with bad chunk data
}
}
}
mng_cleanup( &hMNG ); // Always cleanup the library
return true;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::MNGError( mng_handle hMNG, String SHMsg )
{
// get extended info
mng_uint32 iErrorcode;
mng_uint8 iSeverity;
mng_chunkid iChunkname;
mng_uint32 iChunkseq;
mng_int32 iExtra1;
mng_int32 iExtra2;
mng_pchar zErrortext;
char szFormatStr[ 256 ];
iErrorcode = mng_getlasterror( hMNG, &iSeverity, &iChunkname,
&iChunkseq, &iExtra1, &iExtra2,
&zErrortext);
wsprintf( szFormatStr,
"Error = %d; Severity = %d; Chunknr = %d; Extra1 = %d",
(int)iErrorcode, (int)iSeverity, (int)iChunkseq, (int)iExtra1
);
MsgBoxStop( SHMsg + "\n\n" + String( zErrortext ) + "\n\n" + String( szFormatStr ) );
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::ListBoxChunksClick(TObject *Sender)
{
// When the Chunks listbox is clicked ...
// display strings from strlist in the RichEditChunks window.
int iIndex = ListBoxChunks->ItemIndex;
if( !ListBoxChunks->Items->Count )
return;
// Update panel to reflect the selection : "Chunk N of NChunks"
pnlChunks->Caption = "Chunk " + String( iIndex + 1) +
" of " + String( ListBoxChunks->Items->Count );
// Reset Chunks windows ...
RichEditChunks->Clear();
RichEditChunks->Lines->Add( "" );
// ... Chunks header string : "Chunk N : XXXX" (XXXX == Chunk name)
RichEditChunks->Lines->Add( "Chunk " + String( iIndex + 1 ) + " : " +
ListBoxChunks->Items->Strings[ iIndex ] );
// ... Seperator line
//RichEditChunks->Lines->Add("");
// ... add the data from the stringlist
{
String as = strList->Strings[ iIndex ] + 1;
String z;
int n =1;
do{
if( as[n] == '\n' )
{
RichEditChunks->Lines->Add( z );
z = "";
}
else
z = z + as[n];
n+=1;
} while( n < as.Length() );
RichEditChunks->Lines->Add( z );
}
// ... Seperator line
RichEditChunks->Lines->Add("");
// Place cursor at top of editor
RichEditChunks->SelStart = 0;
RichEditChunks->SelLength = 0;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::EventShowPage(TObject *Sender)
{
switch( ((TTabSheet *)Sender)->Tag ) {
case PAGE_REPORT :
mnuPrint->Enabled = true;
mnuEdit->Enabled = true;
mnuUndo->Enabled = true;
mnuSave->Enabled = true;
sbtnSave->Enabled = true;
sbtnUndo->Enabled = true;
mnuCut->Enabled = true;
sbtnCut->Enabled = true;
mnuCopy->Enabled = true;
sbtnCopy->Enabled = true;
mnuPaste->Enabled = true;
sbtnPaste->Enabled = true;
mnuSearch->Enabled = true;
sbtnPrint->Enabled = true;
break;
//case PAGE_CHUNKS :
//case PAGE_OPTIONS :
///case PAGE_ABOUT :
//case PAGE_HELP :
default :
mnuPrint->Enabled = false;
mnuEdit->Enabled = false;
// no need to enable/disable menu commands as none will be available
mnuSave->Enabled = false;
sbtnSave->Enabled = false;
sbtnUndo->Enabled = false;
sbtnCut->Enabled = false;
sbtnCopy->Enabled = false;
sbtnPaste->Enabled = false;
mnuSearch->Enabled = false;
sbtnPrint->Enabled = false;
}
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::RadioGroupTabSizeClick(TObject *Sender)
{
switch( RadioGroupTabSize->ItemIndex ) {
case 0 : asTab = " "; break;
case 1 : asTab = " "; break;
case 2 : asTab = " "; break;
case 3 : asTab = " "; break;
case 4 : asTab = " "; break;
case 5 : asTab = " "; break;
}
}
//---------------------------------------------------------------------------
String __fastcall TMainForm::PadInt( int iInt, int iWidth )
{
char szFmtStr[ 24 ];
char szInt[ 24 ]; // Should be wide enough !
String as;
wsprintf( szFmtStr,"%%%d\d\0",iWidth ); //"%[iWidth]d"
as = szFmtStr;
wsprintf( szInt, szFmtStr, iInt );
return String( szInt );
}
//---------------------------------------------------------------------------
mng_bool __fastcall TMainForm::ShowChunk(
mng_handle hMNG, mng_handle hChunk, mng_chunkid iChunktype )
{
String asDataText;
// Fill asDataText with string data including newline's ...
// this is added to string list for each chunk
// and also added to the tail end of "Report"
// NOTE :
// Return True to continue processing.
// If mng_getchunk_xxxx fails just return false to the
// caller "(bool) myiterchunk" which inturn will then return false
// to "(mng_retcode) mng_iterate_chunks(...)" which will then
// give us the correct error code.
// In other words DON'T check for errors in "(bool) myiterchunk" !
switch( iChunktype ) {
case MNG_UINT_BACK :
if( !Info_BACK( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_BASI :
if( !Info_BASI( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_CLIP :
if( !Info_CLIP( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_CLON :
if( !Info_CLON( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_DBYK : // untested @ap@
if( !Info_DBYK( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_DEFI :
if( !Info_DEFI( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_DHDR :
if( !Info_DHDR( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_DISC : // untested @ap@
if( !Info_DISC( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_DROP : // untested @ap@
if( !Info_DROP( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_ENDL :
if( !Info_ENDL( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_FRAM :
if( !Info_FRAM( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_IDAT :
if( !Info_IDAT( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_IEND :
if( !Info_IEND( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_IHDR :
if( !Info_IHDR( hMNG, hChunk, asDataText ) ) return false; break;
#define MNG_UINT_IJNG 0x494a4e47L // Function AWOL @ap@
#define MNG_UINT_IPNG 0x49504e47L // Function AWOL @ap@
case MNG_UINT_JDAT :
if( !Info_JDAT( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_JHDR :
if( !Info_JHDR( hMNG, hChunk, asDataText ) ) return false; break;
#define MNG_UINT_JSEP 0x4a534550L // Function AWOL @ap@
case MNG_UINT_LOOP :
if( !Info_LOOP( hMNG, hChunk, asDataText ) ) return false; break;
#define MNG_UINT_MaGN 0x4d61474eL // which one "mng_getchunk_magn" ?
case MNG_UINT_MEND :
if( !Info_MEND( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_MHDR :
if( !Info_MHDR( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_MOVE :
if( !Info_MOVE( hMNG, hChunk, asDataText ) ) return false; break;
#define MNG_UINT_MaGN 0x4d61474eL // which one "mng_getchunk_magn" ?
case MNG_UINT_ORDR :
if( !Info_ORDR( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_PAST :
if( !Info_PAST( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_PLTE :
if( !Info_PLTE( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_PPLT :
if( !Info_PPLT( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_PROM :
if( !Info_PROM( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_SAVE :
if( !Info_SAVE( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_SEEK :
if( !Info_SEEK( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_SHOW :
if( !Info_SHOW( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_TERM :
if( !Info_TERM( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_bKGD :
if( !Info_bKGD( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_cHRM :
if( !Info_cHRM( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_eXPI :
if( !Info_eXPI( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_fPRI :
if( !Info_fPRI( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_gAMA :
if( !Info_gAMA( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_hIST :
if( !Info_hIST( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_iCCP :
if( !Info_iCCP( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_iTXt : // untested @ap@
if( !Info_iTXt( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_nEED :
if( !Info_nEED( hMNG, hChunk, asDataText ) ) return false; break;
#define MNG_UINT_oFFs 0x6f464673L // Function AWOL @ap@
#define MNG_UINT_pCAL 0x7043414cL // Function AWOL @ap@
case MNG_UINT_pHYg : // untested @ap@
if( !Info_pHYg( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_pHYs :
if( !Info_pHYs( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_sBIT :
if( !Info_sBIT( hMNG, hChunk, asDataText ) ) return false; break;
#define MNG_UINT_sCAL 0x7343414cL // Function AWOL @ap@
case MNG_UINT_sPLT : // untested @ap@
if( !Info_sPLT( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_sRGB :
if( !Info_sRGB( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_tEXt :
if( !Info_tEXt( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_tIME :
if( !Info_tIME( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_tRNS :
if( !Info_tRNS( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_zTXt :
if( !Info_zTXt( hMNG, hChunk, asDataText ) ) return false; break;
case MNG_UINT_HUH :
default : // this will catch unknown chunks - Huh !
if( !Info_Unknown( hMNG, hChunk, asDataText ) ) return false; break;
} // end of switch
//-------------------------------------------------
// Add this chunk's string to our string list
strList->Insert( GetChunkCount(), asDataText );
// Now's the time to bump chunk count
IncChunkCount();
// Add this chunk's string to the Report
MainForm->RichEditReport->Lines->Add( asDataText );
return true;
}
//---------------------------------------------------------------------------

View file

@ -1,296 +0,0 @@
//---------------------------------------------------------------------------
#ifndef MainH
#define MainH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Buttons.hpp>
#include <ComCtrls.hpp>
#include <Dialogs.hpp>
#include <ExtCtrls.hpp>
#include <Menus.hpp>
#include <stdio.h>
//---------------------------------------------------------------------------
// These MUST be defined before we include "Libmng.h
//# define MNG_SUPPORT_READ
//# define MNG_ACCESS_CHUNKS
//# define MNG_STORE_CHUNKS
//# define MNG_NO_CMS
# define MNG_USE_DLL
# define MNG_SKIP_ZLIB
# define MNG_SKIP_LCMS
# define MNG_SKIP_IJG6B
#include "../../../libmng.h"
//---------------------------------------------------------------------------
class TMainForm : public TForm
{
__published: // IDE-managed Components
TMainMenu *MainMenu1;
TMenuItem *mnuFile;
TMenuItem *mnuOpen;
TMenuItem *mnuReload;
TMenuItem *mnuSave;
TMenuItem *N1;
TMenuItem *mnuPrint;
TMenuItem *mnuPrintSetup;
TMenuItem *N2;
TMenuItem *mnuExit;
TMenuItem *mnuEdit;
TMenuItem *mnuUndo;
TMenuItem *N3;
TMenuItem *mnuCut;
TMenuItem *mnuCopy;
TMenuItem *mnuPaste;
TMenuItem *N4;
TMenuItem *mnuSelectAll;
TMenuItem *N5;
TMenuItem *mnuSetFont;
TMenuItem *mnuWordWrap;
TMenuItem *mnuSearch;
TMenuItem *mnuFind;
TMenuItem *mnuFindNext;
TPanel *Panel1;
TSpeedButton *sbtnOpen;
TSpeedButton *sbtnReload;
TSpeedButton *sbtnSave;
TSpeedButton *sbtnPrint;
TSpeedButton *sbtnPrintSetup;
TSpeedButton *sbtnUndo;
TSpeedButton *sbtnCut;
TSpeedButton *sbtnCopy;
TSpeedButton *sbtnPaste;
TOpenDialog *OpenDialog1;
TSaveDialog *SaveDialog1;
TPrintDialog *PrintDialog;
TPrinterSetupDialog *PrinterSetupDialog;
TFontDialog *FontDialog1;
TFindDialog *FindDialog;
TPageControl *PageControl1;
TTabSheet *tsChunks;
TTabSheet *tsReport;
TPanel *pnlChunks;
TListBox *ListBoxChunks;
TSpeedButton *sbtnCopyChunk;
TRichEdit *RichEditChunks;
TRichEdit *RichEditReport;
TPanel *PanelStatusBar;
TProgressBar *ProgressBar1;
TTabSheet *tsOptions;
TTabSheet *tsAbout;
TLabel *LabelAbout;
TTabSheet *tsHelp;
TLabel *LabelHelp;
TCheckBox *cbBool;
TCheckBox *cbMacroIdentifier;
TCheckBox *cbRawData;
TCheckBox *cbRGBOrder;
TCheckBox *cbPaletteEntries;
TCheckBox *cbComments;
TRadioGroup *RadioGroupTabSize;
TStaticText *StaticTextStatus;
TStaticText *StaticText1;
void __fastcall mnuFileOpenClick(TObject *Sender);
void __fastcall FormCreate(TObject *Sender);
void __fastcall ListBoxChunksClick(TObject *Sender);
void __fastcall mnuReloadClick(TObject *Sender);
void __fastcall mnuExitClick(TObject *Sender);
void __fastcall FormDestroy(TObject *Sender);
void __fastcall mnuUndoClick(TObject *Sender);
void __fastcall mnuCutClick(TObject *Sender);
void __fastcall mnuCopyClick(TObject *Sender);
void __fastcall mnuPasteClick(TObject *Sender);
void __fastcall mnuSelectAllClick(TObject *Sender);
void __fastcall mnuWordWrapClick(TObject *Sender);
void __fastcall mnuSetFontClick(TObject *Sender);
void __fastcall FontDialog1Apply(TObject *Sender, HWND Wnd);
void __fastcall mnuFindClick(TObject *Sender);
void __fastcall FindDialogFind(TObject *Sender);
void __fastcall mnuFindNextClick(TObject *Sender);
void __fastcall sbtnCopyChunkClick(TObject *Sender);
void __fastcall mnuPrintClick(TObject *Sender);
void __fastcall mnuPrintSetupClick(TObject *Sender);
void __fastcall mnuSaveClick(TObject *Sender);
void __fastcall EventShowPage(TObject *Sender);
void __fastcall RadioGroupTabSizeClick(TObject *Sender);
protected :
void virtual __fastcall OnMinMax(TMessage& Msg);
BEGIN_MESSAGE_MAP // to limit minimum form size for about/help panes
MESSAGE_HANDLER( WM_GETMINMAXINFO, TMessage, OnMinMax )
END_MESSAGE_MAP(TForm)
private: // User declarations
FILE *fd;
int iChunkCount; // To link stringList to listbox
String asTab; // Number of spaces to use as tab stop
public: // User declarations
// Constructor
__fastcall TMainForm(TComponent* Owner);
// Destructor
__fastcall ~TMainForm( void );
// ------------------------------------------------------------------
// Callbacks ... as static member functions
// ------------------------------------------------------------------
static mng_ptr __stdcall Alloc( mng_size_t iSize );
static void __stdcall Free( mng_ptr pPtr, mng_size_t iSize );
static mng_bool __stdcall FileReadData( mng_handle hMNG,
mng_ptr pBuf,
mng_uint32 iSize,
mng_uint32 *iRead );
static mng_bool __stdcall ProcessHeader( mng_handle hHandle,
mng_uint32 iWidth,
mng_uint32 iHeight );
static mng_bool __stdcall OpenStream( mng_handle hMNG );
static mng_bool __stdcall CloseStream( mng_handle hMNG );
static mng_bool __stdcall IterateChunks( mng_handle hMNG,
mng_handle hChunk,
mng_chunkid iChunktype,
mng_uint32 iChunkseq );
// ------------------------------------------------------------------
//public data members
// ------------------------------------------------------------------
// Associates a string, strList[n], with a chunk in the listbox[N]
TStringList *strList;
String asAppName; // pinch Application->Title at startup
// ------------------------------------------------------------------
// MessageBox functions
// ------------------------------------------------------------------
int __fastcall MessageBox( String &as, UINT flags );
void __fastcall MsgBoxOk( String as );
int __fastcall MsgBoxYN( String as );
int __fastcall MsgBoxYNC( String as );
void __fastcall MsgBoxStop( String as );
void __fastcall MsgBoxInfo( String as );
void __fastcall MsgBoxWarn( String as );
// ------------------------------------------------------------------
// Just to isolate teh "FILE *fd" variable from possible change.
inline FILE* __fastcall GetFd( void )
{ return fd; };
// ------------------------------------------------------------------
// Options
// ------------------------------------------------------------------
inline bool _fastcall WantsComments( void )
{ return cbComments->Checked; };
inline bool _fastcall WantsPaletteEntries( void )
{ return cbPaletteEntries->Checked; };
inline bool _fastcall WantsRgbOrder( void )
{ return cbRGBOrder->Checked; };
inline bool _fastcall WantsRawData( void )
{ return cbRawData->Checked; };
inline bool _fastcall WantsMacroIds( void )
{ return cbMacroIdentifier->Checked; };
inline bool _fastcall WantsBool( void )
{ return cbBool->Checked; };
// ------------------------------------------------------------------
// Chunk count stuff
// ------------------------------------------------------------------
inline int __fastcall IncChunkCount( void )
{ return iChunkCount += 1; };
inline int __fastcall SetChunkCount( int anInt )
{ iChunkCount = anInt; };
inline int __fastcall GetChunkCount( void )
{ return iChunkCount; };
// ------------------------------------------------------------------
// Open a file, initialise things, and then calls "Dumptree(...)"
void __fastcall LoadFile( void );
// All LibMng calls involving the library handle are made from here :
// Initialize the library
// Setup callbacks
// Read the file into memory
// Run through the chunk list (mng_iterate_chunks)
// Cleanup the library
// Show Report page, all done. (then explode into the starry heavens!)
bool __fastcall DumpTree( void );
// Handle library errors gracefully.
void __fastcall MNGError( mng_handle hMNG, String SHMsg );
// Uesd with Palette entries - to right align int's to N chars width
String __fastcall PadInt( int iInt, int iWidth = 3 ); // default = 3
// A long switch that calls Info_XXXX's to assemble the chunks string
mng_bool __fastcall ShowChunk( mng_handle hMNG,
mng_handle hChunk,
mng_chunkid iChunktype );
// ------------------------------------------------------------------
// The following functions are to assemble a string for each chunk.
// The function name "Info_????" denotes which chunk it handles
// Definitions can be found in "Chunks.cpp"
// ------------------------------------------------------------------
bool __fastcall Info_BACK( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_BASI( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_CLIP( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_CLON( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_DBYK( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_DEFI( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_DHDR( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_DISC( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_DROP( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_ENDL( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_FRAM( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_IDAT( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_IEND( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_IHDR( mng_handle hMNG, mng_handle hChunk, String &as );
// MNG_UINT_IJNG - Function missing @ap@
// MNG_UINT_IPNG - Function missing @ap@
bool __fastcall Info_JDAT( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_JHDR( mng_handle hMNG, mng_handle hChunk, String &as );
// MNG_UINT_JSEP - Function missing @ap@
bool __fastcall Info_LOOP( mng_handle hMNG, mng_handle hChunk, String &as );
// MAGN ? MNG_UINT_MAGN @ap@
bool __fastcall Info_MEND( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_MHDR( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_MOVE( mng_handle hMNG, mng_handle hChunk, String &as );
// MaGN ? MNG_UINT_MaGN @ap@
bool __fastcall Info_ORDR( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_PAST( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_PLTE( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_PPLT( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_PROM( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_SAVE( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_SEEK( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_SHOW( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_TERM( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_bKGD( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_cHRM( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_eXPI( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_fPRI( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_gAMA( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_hIST( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_iCCP( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_iTXt( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_nEED( mng_handle hMNG, mng_handle hChunk, String &as );
// MNG_UINT_oFFs - Function missing @ap@
// MNG_UINT_pCAL - Function missing @ap@
bool __fastcall Info_pHYg( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_pHYs( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_sBIT( mng_handle hMNG, mng_handle hChunk, String &as );
// MNG_UINT_sCAL - Function missing @ap@
bool __fastcall Info_sPLT( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_sRGB( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_tEXt( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_tIME( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_tRNS( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_zTXt( mng_handle hMNG, mng_handle hChunk, String &as );
bool __fastcall Info_Unknown( mng_handle hMNG, mng_handle hChunk, String &as );
};
//---------------------------------------------------------------------------
extern PACKAGE TMainForm *MainForm;
//---------------------------------------------------------------------------
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,692 +0,0 @@
unit Main;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Menus, StdCtrls, ExtCtrls, Buttons,
libmng;
{****************************************************************************}
{* For conditions of distribution and use, *}
{* see copyright notice in libmng.pas *}
{****************************************************************************}
{* *}
{* project : libmng *}
{* file : main.pas copyright (c) 2000-2002 G.Juyn *}
{* version : 1.0.5 *}
{* *}
{* purpose : Main form for mngview application *}
{* *}
{* author : G.Juyn *}
{* web : http://www.3-t.com *}
{* email : mailto:info@3-t.com *}
{* *}
{* comment : this is the heart of the mngview applciation *}
{* *}
{* changes : 0.5.1 - 05/02/2000 - G.Juyn *}
{* - added this version block *}
{* - made the initialization part more robust *}
{* eg. program aborts on initialization errors *}
{* - B002(105797) - added check for existence of default sRGB *}
{* profile (now included in distribution) *}
{* - added mng_cleanup to program exit *}
{* 0.5.1 - 05/08/2000 - G.Juyn *}
{* - changed to stdcall convention *}
{* 0.5.1 - 05/11/2000 - G.Juyn *}
{* - changed callback function declarations *}
{* *}
{* 0.5.3 - 06/16/2000 - G.Juyn *}
{* - removed processmessages call from refresh callback *}
{* 0.5.3 - 06/17/2000 - G.Juyn *}
{* - switched "storechunks" off *}
{* 0.5.3 - 06/26/2000 - G.Juyn *}
{* - changed definition of userdata to mng_ptr *}
{* 0.5.3 - 06/28/2000 - G.Juyn *}
{* - changed the default icon to something more appropriate *}
{* - changed definition of memory alloc size to mng_size_t *}
{* 0.5.3 - 06/29/2000 - G.Juyn *}
{* - changed order of refresh parameters *}
{* *}
{* 0.9.0 - 06/30/2000 - G.Juyn *}
{* - changed refresh parameters to 'x,y,width,height' *}
{* *}
{* 0.9.1 - 07/08/2000 - G.Juyn *}
{* - fixed to use returncode constants *}
{* - changed to accomodate MNG_NEEDTIMERWAIT returncode *}
{* 0.9.1 - 07/10/2000 - G.Juyn *}
{* - changed to use suspension-mode *}
{* *}
{* 0.9.3 - 09/11/2000 - G.Juyn *}
{* - removed some tesst-stuff *}
{* *}
{* 1.0.1 - 05/02/2000 - G.Juyn *}
{* - removed loading default sRGB profile (auto in libmng) *}
{* *}
{* 1.0.5 - 09/16/2002 - G.Juyn *}
{* - added dynamic MNG features *}
{* 1.0.5 - 11/27/2002 - G.Juyn *}
{* - fixed freeze during read-cycle *}
{* *}
{****************************************************************************}
type
TMainForm = class(TForm)
OFMainMenu: TMainMenu;
OFMenuFile: TMenuItem;
OFMenuFileOpen: TMenuItem;
OFMenuFileProfile: TMenuItem;
OFMenuFileN1: TMenuItem;
OFMenuFileExit: TMenuItem;
OFMenuOptions: TMenuItem;
OFMenuOptionsModemSpeed: TMenuItem;
OFMenuOptionsModem28k8: TMenuItem;
OFMenuOptionsModem33k6: TMenuItem;
OFMenuOptionsModem56k: TMenuItem;
OFMenuOptionsModemISDN64: TMenuItem;
OFMenuOptionsModemISDN128: TMenuItem;
OFMenuOptionsModemCable512: TMenuItem;
OFMenuOptionsModemUnlimited: TMenuItem;
OFTimer: TTimer;
OFOpenDialog: TOpenDialog;
OFOpenDialogProfile: TOpenDialog;
OFImage: TImage;
procedure FormCreate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure FormShow(Sender: TObject);
procedure FormResize(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure OFImageMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure OFImageMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure OFImageMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure OFTimerTimer(Sender: TObject);
procedure OFMenuFileOpenClick(Sender: TObject);
procedure OFMenuFileProfileClick(Sender: TObject);
procedure OFMenuFileExitClick(Sender: TObject);
procedure OFMenuOptionsModemSpeedClick(Sender: TObject);
procedure OFMenuOptionsModemXClick(Sender: TObject);
private
{ Private declarations }
SFFileName : string; { filename of the input stream }
OFFile : TFileStream; { input stream }
IFHandle : mng_handle; { the libray handle }
OFBitmap : TBitmap; { drawing canvas }
BFCancelled : boolean; { <esc> or app-exit }
BFHasMouse : boolean; { mouse is/was over image }
IFTicks : cardinal; { used to fake slow connections }
IFBytes : cardinal;
IFBytesPerSec : integer;
procedure MNGerror (SHMsg : string);
public
{ Public declarations }
end;
var
MainForm: TMainForm;
{****************************************************************************}
implementation
{$R *.DFM}
{****************************************************************************}
{$F+}
function Memalloc (iLen : mng_uint32) : mng_ptr; stdcall;
{$F-}
begin
getmem (Result, iLen); { get memory from the heap }
fillchar (Result^, iLen, 0); { and initialize it }
end;
{****************************************************************************}
{$F+}
procedure Memfree (iPtr : mng_ptr;
iLen : mng_size_t); stdcall;
{$F-}
begin
freemem (iPtr, iLen); { free the memory }
end;
{****************************************************************************}
{$F+}
function Openstream (hHandle : mng_handle) : mng_bool; stdcall;
{$F-}
var OHForm : TMainForm;
begin { get a fix on our form }
OHForm := TMainForm (mng_get_userdata (hHandle));
with OHFORM do
begin
if OFFile <> nil then { free previous stream (if any) }
OFFile.Free;
{ open a new stream }
OFFile := TFileStream.Create (SFFileName, fmOpenRead or fmShareDenyWrite);
end;
Result := MNG_TRUE;
end;
{****************************************************************************}
{$F+}
function Closestream (hHandle : mng_handle) : mng_bool; stdcall;
{$F-}
var OHForm : TMainForm;
begin { get a fix on our form }
OHForm := TMainForm (mng_get_userdata (hHandle));
with OHFORM do
begin
OFFile.Free; { cleanup the stream }
OFFile := nil; { don't use it again ! }
end;
Result := MNG_TRUE;
end;
{****************************************************************************}
{$F+}
function Readdata ( hHandle : mng_handle;
pBuf : mng_ptr;
iBuflen : mng_uint32;
var pRead : mng_uint32) : mng_bool; stdcall;
{$F-}
var OHForm : TMainForm;
IHTicks : cardinal;
IHByte1 : cardinal;
IHByte2 : cardinal;
IHBytesPerSec : cardinal;
begin
{ get a fix on our form }
OHForm := TMainForm (mng_get_userdata (hHandle));
with OHForm do
begin { are we at EOF ? }
if OFFile.Position >= OFFile.Size then
begin
pRead := 0; { indicate so }
end
else
begin
IHBytesPerSec := IFBytesPerSec; { fake a slow connection }
if IHBytesPerSec > 0 then
begin
IHTicks := Windows.GetTickCount;
IHByte1 := round (((IHTicks - IFTicks) / 1000) * IHBytesPerSec);
IHByte2 := (IFBytes + iBuflen);
if ((IHByte2 - IHByte1) div IHBytesPerSec) > 10 then
Windows.Sleep ((IHByte2 - IHByte1) div IHBytesPerSec);
end;
{ read the requested data }
pRead := OFFile.Read (pBuf^, iBuflen);
IFBytes := IFBytes + pRead;
end;
end;
Result := MNG_TRUE;
end;
{****************************************************************************}
{$F+}
function ProcessHeader (hHandle : mng_handle;
iWidth : mng_uint32;
iHeight : mng_uint32) : mng_bool; stdcall;
{$F-}
var OHForm : TMainForm;
begin { get a fix on our form }
OHForm := TMainForm (mng_get_userdata (hHandle));
with OHForm do
begin
OFBitmap.Width := iWidth; { store the new dimensions }
OFBitmap.Height := iHeight;
OFImage.Left := 0; { adjust the visible component }
OFImage.Top := 0;
OFImage.Width := iWidth;
OFImage.Height := iHeight;
FormResize (OHForm); { force re-centering the image}
{ clear the canvas & draw an outline }
OFBitmap.Canvas.Brush.Color := clGray;
OFBitmap.Canvas.Brush.Style := bsSolid;
OFBitmap.Canvas.FillRect (OFBitmap.Canvas.ClipRect);
OFBitmap.Canvas.Brush.Color := clRed;
OFBitmap.Canvas.Brush.Style := bsSolid;
OFBitmap.Canvas.Pen.Color := clRed;
OFBitmap.Canvas.Pen.Style := psSolid;
OFBitmap.Canvas.FrameRect (OFBitmap.Canvas.ClipRect);
OFImage.Picture.Assign (OFBitmap); { make sure it gets out there }
{ tell the library we want funny windows-bgr}
if mng_set_canvasstyle (hHandle, MNG_CANVAS_BGRX8) <> 0 then
MNGerror ('libmng reported an error setting the canvas style');
end;
Result := MNG_TRUE;
end;
{****************************************************************************}
{$F+}
function GetCanvasLine (hHandle : mng_handle;
iLinenr : mng_uint32) : mng_ptr; stdcall;
{$F-}
var OHForm : TMainForm;
begin { get a fix on our form }
OHForm := TMainForm (mng_get_userdata (hHandle));
{ easy with these bitmap objects ! }
Result := OHForm.OFBitmap.ScanLine [iLinenr];
end;
{****************************************************************************}
{$F+}
function ImageRefresh (hHandle : mng_handle;
iX : mng_uint32;
iY : mng_uint32;
iWidth : mng_uint32;
iHeight : mng_uint32) : mng_bool; stdcall;
{$F-}
var OHForm : TMainForm;
begin { get a fix on our form }
OHForm := TMainForm (mng_get_userdata (hHandle));
{ force redraw }
OHForm.OFImage.Picture.Assign (OHForm.OFBitmap);
Result := MNG_TRUE;
end;
{****************************************************************************}
{$F+}
function GetTickCount (hHandle : mng_handle) : mng_uint32; stdcall;
{$F-}
begin
Result := Windows.GetTickCount; { windows knows that }
end;
{****************************************************************************}
{$F+}
function SetTimer (hHandle : mng_handle;
iMsecs : mng_uint32) : mng_bool; stdcall;
{$F-}
var OHForm : TMainForm;
begin { get a fix on our form }
OHForm := TMainForm (mng_get_userdata (hHandle));
OHForm.OFTimer.Interval := iMsecs; { and set the timer }
OHForm.OFTimer.Enabled := true;
Result := MNG_TRUE;
end;
{****************************************************************************}
procedure TMainForm.FormCreate(Sender: TObject);
var IHRed, IHGreen, IHBlue : word;
begin { initialize }
OFBitmap := TBitmap.Create;
IFBytesPerSec := 10000000;
BFHasMouse := false;
OFFile := nil;
OFOpenDialog.Initialdir := '';
OFBitmap.HandleType := bmDIB; { make it a 24-bit DIB }
OFBitmap.PixelFormat := pf32bit;
{ now initialize the library }
IFHandle := mng_initialize (mng_ptr(self), Memalloc, Memfree, nil);
if IFHandle = NIL then
begin
MNGerror ('libmng initialization error' + #13#10 +
'Program aborted');
Windows.Postmessage (handle, WM_Close, 0, 0);
Exit;
end;
{ no need to store chunk-info ! }
mng_set_storechunks (IFHandle, MNG_FALSE);
{ do not use suspension-buffer }
mng_set_suspensionmode (IFHandle, MNG_FALSE);
{ set all the callbacks }
if (mng_setcb_openstream (IFHandle, Openstream ) <> MNG_NOERROR) or
(mng_setcb_closestream (IFHandle, Closestream ) <> MNG_NOERROR) or
(mng_setcb_readdata (IFHandle, Readdata ) <> MNG_NOERROR) or
(mng_setcb_processheader (IFHandle, ProcessHeader) <> MNG_NOERROR) or
(mng_setcb_getcanvasline (IFHandle, GetCanvasLine) <> MNG_NOERROR) or
(mng_setcb_refresh (IFHandle, ImageRefresh ) <> MNG_NOERROR) or
(mng_setcb_gettickcount (IFHandle, GetTickCount ) <> MNG_NOERROR) or
(mng_setcb_settimer (IFHandle, SetTimer ) <> MNG_NOERROR) then
begin
MNGerror ('libmng reported an error setting a callback function!' + #13#10 +
'Program aborted');
Windows.Postmessage (handle, WM_Close, 0, 0);
Exit;
end;
IHRed := (Color ) and $FF; { supply our own bg-color }
IHGreen := (Color shr 8) and $FF;
IHBlue := (Color shr 16) and $FF;
IHRed := (IHRed shl 8) + IHRed;
IHGreen := (IHGreen shl 8) + IHGreen;
IHBlue := (IHBlue shl 8) + IHBlue;
if mng_set_bgcolor (IFHandle, IHRed, IHGreen, IHBlue) <> MNG_NOERROR then
MNGerror ('libmng reported an error setting the background color!');
end;
{****************************************************************************}
procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
OFTimer.Enabled := false;
BFCancelled := true;
{ if we're still animating then stop it }
if mng_status_running (IFHandle) and not mng_status_reading (IFHandle) then
if mng_display_freeze (IFHandle) <> MNG_NOERROR then
MNGerror ('libmng reported an error during display_freeze!');
mng_cleanup (IFHandle);
end;
{****************************************************************************}
procedure TMainForm.FormShow(Sender: TObject);
begin
FormResize (self);
end;
{****************************************************************************}
procedure TMainForm.FormResize(Sender: TObject);
begin { center the image in the window }
if ClientWidth < OFImage.Width then
OFImage.Left := 0
else
OFImage.Left := (ClientWidth - OFImage.Width ) div 2;
if ClientHeight < OFImage.Height then
OFImage.Top := 0
else
OFImage.Top := (ClientHeight - OFImage.Height) div 2;
end;
{****************************************************************************}
procedure TMainForm.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = vk_Escape then { pressing <esc> will freeze an animation }
begin
OFTimer.Enabled := false; { don't let that timer go off then ! }
BFCancelled := true;
if mng_status_running (IFHandle) and not mng_status_reading (IFHandle) then
if mng_display_freeze (IFHandle) <> MNG_NOERROR then
MNGerror ('libmng reported an error during display_freeze!');
end;
end;
{****************************************************************************}
procedure TMainForm.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if mng_status_dynamic (IFHandle) then
begin
if BFHasMouse then { if we had the mouse, it's left ! }
begin
if mng_trapevent (IFHandle, 3, 0, 0) <> MNG_NOERROR then
MNGerror ('libmng reported an error during trapevent!');
BFHasMouse := false;
end;
end;
end;
{****************************************************************************}
procedure TMainForm.OFImageMouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
begin
if mng_status_dynamic (IFHandle) then
begin
if BFHasMouse then { did we have the mouse already ? }
begin
if mng_trapevent (IFHandle, 2, X, Y) <> MNG_NOERROR then
MNGerror ('libmng reported an error during trapevent!');
end
else
begin { if not, it has entered ! }
if mng_trapevent (IFHandle, 1, X, Y) <> MNG_NOERROR then
MNGerror ('libmng reported an error during trapevent!');
BFHasMouse := true;
end;
end;
end;
{****************************************************************************}
procedure TMainForm.OFImageMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if mng_status_dynamic (IFHandle) then
if mng_trapevent (IFHandle, 4, X, Y) <> MNG_NOERROR then
MNGerror ('libmng reported an error during trapevent!');
end;
{****************************************************************************}
procedure TMainForm.OFImageMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if mng_status_dynamic (IFHandle) then
if mng_trapevent (IFHandle, 5, X, Y) <> MNG_NOERROR then
MNGerror ('libmng reported an error during trapevent!');
end;
{****************************************************************************}
procedure TMainForm.OFTimerTimer(Sender: TObject);
var IHRslt : mng_retcode;
begin
OFTimer.Enabled := false; { only once ! }
if not BFCancelled then
begin { and inform the library }
IHRslt := mng_display_resume (IFHandle);
if (IHRslt <> MNG_NOERROR) and (IHRslt <> MNG_NEEDTIMERWAIT) then
MNGerror ('libmng reported an error during display_resume!');
end;
end;
{****************************************************************************}
procedure TMainForm.OFMenuFileOpenClick(Sender: TObject);
var IHRslt : mng_retcode;
begin
OFOpenDialog.InitialDir := '';
OFOpenDialog.FileName := SFFileName;
if OFOpenDialog.Execute then { get the filename }
begin
if OFTimer.Enabled then { if the lib was active; stop it }
begin
OFTimer.Enabled := false;
Application.ProcessMessages; { process any timer requests (for safety) }
{ now freeze the animation }
if mng_display_freeze (IFHandle) <> MNG_NOERROR then
MNGerror ('libmng reported an error during display_freeze!');
end;
{ save interesting fields }
SFFileName := OFOpenDialog.FileName;
IFTicks := Windows.GetTickCount;
IFBytes := 0;
BFCancelled := false;
{ always reset (just in case) }
if mng_reset (IFHandle) <> MNG_NOERROR then
MNGerror ('libmng reported an error during reset!')
else
begin { and let the lib do it's job ! }
IHRslt := mng_readdisplay (IFHandle);
if (IHRslt <> MNG_NOERROR) and (IHRSLT <> MNG_NEEDTIMERWAIT) then
MNGerror ('libmng reported an error reading the input file!');
end;
end;
end;
{****************************************************************************}
procedure TMainForm.OFMenuFileProfileClick(Sender: TObject);
var SHProfileDir : array [0 .. MAX_PATH + 20] of char;
begin
GetSystemDirectory (@SHProfileDir, MAX_PATH);
strcat (@SHProfileDir, '\Color');
OFOpenDialogProfile.InitialDir := strpas (@SHProfileDir);
if OFOpenDialogProfile.Execute then
if mng_set_outputprofile (IFHandle, pchar (OFOpenDialogProfile.FileName)) <> 0 then
MNGerror ('libmng reported an error setting the output-profile!');
end;
{****************************************************************************}
procedure TMainForm.OFMenuFileExitClick(Sender: TObject);
begin
if mng_cleanup (IFHandle) <> MNG_NOERROR then
MNGerror ('libmng cleanup error');
Close;
end;
{****************************************************************************}
procedure TMainForm.OFMenuOptionsModemSpeedClick(Sender: TObject);
begin
OFMenuOptionsModem28k8.Checked := false;
OFMenuOptionsModem33k6.Checked := false;
OFMenuOptionsModem56k.Checked := false;
OFMenuOptionsModemISDN64.Checked := false;
OFMenuOptionsModemISDN128.Checked := false;
OFMenuOptionsModemCable512.Checked := false;
OFMenuOptionsModemUnlimited.Checked := false;
if IFBytesPerSec = OFMenuOptionsModem28k8.Tag div 10 then
OFMenuOptionsModem28k8.Checked := true
else
if IFBytesPerSec = OFMenuOptionsModem33k6.Tag div 10 then
OFMenuOptionsModem33k6.Checked := true
else
if IFBytesPerSec = OFMenuOptionsModem56k.Tag div 10 then
OFMenuOptionsModem56k.Checked := true
else
if IFBytesPerSec = OFMenuOptionsModemISDN64.Tag div 10 then
OFMenuOptionsModemISDN64.Checked := true
else
if IFBytesPerSec = OFMenuOptionsModemISDN128.Tag div 10 then
OFMenuOptionsModemISDN128.Checked := true
else
if IFBytesPerSec = OFMenuOptionsModemUnlimited.Tag div 10 then
OFMenuOptionsModemCable512.Checked := true
else
OFMenuOptionsModemUnlimited.Checked := true;
end;
{****************************************************************************}
procedure TMainForm.OFMenuOptionsModemXClick(Sender: TObject);
begin
IFBytesPerSec := TMenuItem (Sender).Tag div 10;
end;
{****************************************************************************}
procedure TMainForm.MNGerror;
var iErrorcode : mng_uint32;
iSeverity : mng_uint8;
iChunkname : mng_chunkid;
iChunkseq : mng_uint32;
iExtra1 : mng_int32;
iExtra2 : mng_int32;
zErrortext : mng_pchar;
begin { get extended info }
iErrorcode := mng_getlasterror (IFHandle, iSeverity, iChunkname, iChunkseq,
iExtra1, iExtra2, zErrortext);
MessageDlg (SHMsg + #13#10#13#10 + strpas (zErrortext) + #13#10#13#10 +
Format ('Error = %d; Severity = %d; Chunknr = %d; Extra1 = %d',
[iErrorcode, iSeverity, iChunkseq, iExtra1]),
mtError, [mbOK], 0);
end;
{****************************************************************************}
end.

View file

@ -1,14 +0,0 @@
program mngview;
uses
Forms,
Main in 'Main.pas' {MainForm},
libmng in '..\libmng.pas';
{$R *.RES}
begin
Application.Initialize;
Application.CreateForm(TMainForm, MainForm);
Application.Run;
end.

View file

@ -1,340 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View file

@ -1,10 +0,0 @@
******************* Thu Sep 13 15:28:01 CEST 2001 ********************
* new option -S to play on start console only.
* new option -c to play animationon any fb console
* split fbmngplay to several files.
******************* Wed Sep 12 14:51:44 CEST 2001 ********************
* new option -p for dynamic positioning of the mng animation in the
upper right corner.

View file

@ -1,50 +0,0 @@
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = /bin/sh
CC = gcc
SOURCES = fbmngplay.c
PROGRAMS = fbmngplay fbmngplay.static
OBJECTS = fbmngplay.o messages.o mng.o console.o
LDFLAGS = -L/usr/lib
LIBSS = /usr/lib/libmng-mini.a /usr/lib/libz.a -lm
LIBSD = -lmng -lz -lm
CFLAGS = -Os -Wall -Wmissing-prototypes -Wstrict-prototypes -D_REENTRANT
COMPILE = $(CC) $(CFLAGS)
LINKS = $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@
LINKD = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
all: $(PROGRAMS)
strip -s $(PROGRAMS)
.SUFFIXES:
.SUFFIXES: .S .c .o .s
.s.o:
$(COMPILE) -c $<
.S.o:
$(COMPILE) -c $<
mostlyclean:
-rm -f *.o core
clean: mostlyclean
-rm -f fbmngplay fbmngplay.static
fbmngplay: $(OBJECTS)
@rm -f fbmngplay
$(LINKD) $(LDFLAGS) $(OBJECTS) $(LIBSD)
fbmngplay.static: $(OBJECTS)
@rm -f fbmngplay.static
$(LINKS) $(LDFLAGS) $(OBJECTS) $(LIBSS)
.PHONY: mostlyclean clean fbmngplay fbmngplay.static all

View file

@ -1,30 +0,0 @@
* fbmngplay *
a simple fbcon based mng player
This is a simple example program, using the kernel framebuffer device
to display mng animation decoded by the new libmng implementation.
This player is based on the SDL version included in the libmng package
from Ralph Giles <giles@ashlu.bc.ca>. The code's fairly rough at this
point, but there was no example player for *nix in the distribution.
Patches welcome, of course.
On a unix-like system, the build instructions are simple:
(install and/or build the mng library from libmng.com)
make
make install
To use the player:
fbmngplay <filename>.mng <filename>.mng ...
To stop looping animations, press CTRL C or send a TERM or INT signal.
See the options with
fbmngplay -h
---
Stefan Reinauer, <stepan@suse.de>
$Date: 2002/09/26 18:09:36 $

View file

@ -1,107 +0,0 @@
/*
fbmngplay - fb console MNG player.
(c) 2001 by Stefan Reinauer, <stepan :at: suse.de>
This program is based on mngplay, part of libmng, written and (C) by
Ralph Giles <giles :at: ashlu.bc.ca>
This program my be redistributed under the terms of the
GNU General Public Licence, version 2, or at your preference,
any later version.
This file is based on getfd.c from the kbd package.
*/
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <linux/kd.h>
#include <linux/vt.h>
#include <sys/ioctl.h>
#include "console.h"
int start_console = 0;
/*
* getfd.c
*
* Get an fd for use with kbd/console ioctls.
* We try several things because opening /dev/console will fail
* if someone else used X (which does a chown on /dev/console).
*/
static int
is_a_console(const int fd) {
char arg;
arg = 0;
return (ioctl(fd, KDGKBTYPE, &arg) == 0
&& ((arg == KB_101) || (arg == KB_84)));
}
static int
open_a_console(const char * const fnam) {
int fd;
fd = open(fnam, O_RDONLY);
if (fd < 0 && errno == EACCES)
fd = open(fnam, O_WRONLY);
if (fd < 0)
return -1;
if (!is_a_console(fd)) {
close(fd);
return -1;
}
return fd;
}
int getfd (const char * const nm) {
int fd;
if (nm) {
fd = open_a_console(nm);
if (fd >= 0)
return fd;
} else {
fd = open_a_console("/dev/tty");
if (fd >= 0)
return fd;
fd = open_a_console("/dev/tty0");
if (fd >= 0)
return fd;
fd = open_a_console("/dev/console");
if (fd >= 0)
return fd;
for (fd = 0; fd < 3; fd++)
if (is_a_console(fd))
return fd;
}
fprintf(stderr,
"Couldnt get a file descriptor referring to the console\n");
exit(1); /* total failure */
}
int fd;
int current_console(void)
{
struct vt_stat vtstat;
if (ioctl(fd, VT_GETSTATE, &vtstat)) {
fprintf(stderr,"fbmngplay: VT_GETSTATE\n");
exit(1);
}
return vtstat.v_active;
}
void init_consoles(void)
{
// get current tty
fd = getfd(0);
start_console=current_console();
}

View file

@ -1,21 +0,0 @@
/*
fbmngplay - fb console MNG player.
(c) 2001 by Stefan Reinauer, <stepan :at: suse.de>
This program is based on mngplay, part of libmng, written and (C) by
Ralph Giles <giles :at: ashlu.bc.ca>
This program my be redistributed under the terms of the
GNU General Public Licence, version 2, or at your preference,
any later version.
*/
#ifndef __CONSOLES_H
#define __CONSOLES_H
extern int getfd(const char* const);
extern void init_consoles(void);
extern int current_console(void);
extern int start_console;
#endif

View file

@ -1,228 +0,0 @@
/*
fbmngplay - fb console MNG player.
(c) 2001 by Stefan Reinauer, <stepan :at: suse.de>
This program is based on mngplay, part of libmng, written and (C) by
Ralph Giles <giles :at: ashlu.bc.ca>
This program my be redistributed under the terms of the
GNU General Public Licence, version 2, or at your preference,
any later version.
*/
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
#include <getopt.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <linux/fb.h>
#include "fbmngplay.h"
#include "messages.h"
#include "console.h"
#include "mng.h"
volatile int run = 1;
int verbose = 0;
int buffered = 0;
int dynpos = 0;
int waitsignal = 0;
int delta = 16;
int sconly=0;
void sigint_handler(int signal);
void sigterm_handler(int signal);
void sigusr1_handler(int signal);
void sigint_handler(int signal)
{
run = 2;
}
void sigterm_handler(int signal)
{
restore_area();
run = 0;
}
void sigusr1_handler(int signal)
{
run = 0;
}
int main(int argc, char *argv[])
{
int fbdev,c,option_index;
unsigned int alpha;
struct fb_var_screeninfo var;
/* Check which console we're running on */
init_consoles();
/* allocate our stream data structure */
mng = (mngstuff *) calloc(1, sizeof(*mng));
if (mng == NULL) {
fprintf(stderr, "could not allocate stream structure.\n");
exit(0);
}
alpha = 100;
mng->alpha = 100;
mng->fbx = 15;
mng->fby = 15;
mng->background = NULL;
while (1) {
static struct option long_options[] = {
{"help", 0, 0, 'h'},
{"verbose", 0, 0, 'v'},
{"alpha", 1, 0, 'a'},
{"buffered", 0, 0, 'b'},
{"signal", 0, 0, 's'},
{"delta", 0, 0, 'd'},
{"position", 0, 0, 'p'},
{"version", 0, 0, 'V'},
{"start-console",0,0,'S'},
{"console",1,0,'c'},
{0, 0, 0, 0}
};
c = getopt_long(argc, argv, "a:x:y:bh?vsd:pVSc:",
long_options, &option_index);
if (c == -1)
break;
switch (c) {
case 'a':
alpha = atoi(optarg);
if (alpha > 100)
alpha = 100;
mng->alpha = alpha;
break;
case 'x':
mng->fbx = atoi(optarg);
break;
case 'y':
mng->fby = atoi(optarg);
break;
case 'd':
delta = atoi(optarg);
break;
case '?':
case 'h':
usage(argv[0]);
exit(0);
case 'v':
verbose = 1;
break;
case 's':
waitsignal = 1;
break;
case 'b':
buffered = 1;
break;
case 'p':
dynpos = 1;
break;
case 'V':
version();
exit(0);
case 'c':
start_console=atoi(optarg);
case 'S':
sconly=1;
break;
default:
break;
}
}
if (optind >= argc) {
printf("Which files do you want to play?\n");
exit(0);
}
//init_consoles();
/* Initialize framebuffer */
fbdev = open("/dev/fb0", O_RDWR);
if (fbdev < 0) {
fprintf(stderr, "error while opening framebuffer.\n");
exit(fbdev);
}
ioctl(fbdev, FBIOGET_VSCREENINFO, &var);
mng->fbwidth = var.xres;
mng->fbheight = var.yres;
mng->fbbpp = var.bits_per_pixel;
mng->display =
mmap(NULL, var.xres * var.yres * (var.bits_per_pixel >> 3),
PROT_WRITE | PROT_READ, MAP_SHARED, fbdev, 0);
/* arrange to call the shutdown routine before we exit */
atexit(&cleanup);
while (optind < argc) {
// leftover arguements are filenames.
mng->filename = argv[optind++];
/* set up the mng decoder for our stream */
mng->mng = mng_initialize(mng, mngalloc, mngfree, MNG_NULL);
if (mng->mng == MNG_NULL) {
fprintf(stderr, "could not initialize libmng.\n");
exit(1);
}
/* set the callbacks */
mng_setcb_errorproc(mng->mng, mngerror);
mng_setcb_openstream(mng->mng, mngopenstream);
mng_setcb_closestream(mng->mng, mngclosestream);
mng_setcb_readdata(mng->mng, mngreadstream);
mng_setcb_gettickcount(mng->mng, mnggetticks);
mng_setcb_settimer(mng->mng, mngsettimer);
mng_setcb_processheader(mng->mng, mngprocessheader);
mng_setcb_getcanvasline(mng->mng, mnggetcanvasline);
mng_setcb_refresh(mng->mng, mngrefresh);
/* FIXME: should check for errors here */
signal(SIGINT, sigint_handler);
signal(SIGTERM, sigterm_handler);
mng_readdisplay(mng->mng);
/* loop though the frames */
while (mng->delay && run) {
mdelay(mng->delay);
mng->delay = 0;
mng_display_resume(mng->mng);
if (run == 2) {
if (mng->alpha == 0)
run = 0;
mng->alpha -= delta;
if (mng->alpha < 0)
mng->alpha = 0;
}
}
if (waitsignal && optind < argc) {
signal(SIGUSR1, sigusr1_handler);
run = 1;
while (run) {
sleep(2);
}
}
memset(mng->copybuffer, 0,
4 * mng->width * mng->height);
run = 1;
mng->alpha = alpha;
if (optind == argc) { /* last file */
restore_area();
}
}
/* cleanup and quit */
return mngquit(mng->mng);
}

View file

@ -1,43 +0,0 @@
/*
fbmngplay - fb console MNG player.
(c) 2001 by Stefan Reinauer, <stepan :at: suse.de>
This program is based on mngplay, part of libmng, written and (C) by
Ralph Giles <giles :at: ashlu.bc.ca>
This program my be redistributed under the terms of the
GNU General Public Licence, version 2, or at your preference,
any later version.
*/
#ifndef __FBMNGPLAY_H
#define __FBMNGPLAY_H
#include <libmng.h>
#define FBMNGPLAY_VERSION "0.3"
/* structure for keeping track of our mng stream inside the callbacks */
typedef struct {
FILE *file; /* pointer to the file we're decoding */
char *filename; /* pointer to the file's path/name */
mng_uint32 delay; /* ticks to wait before resuming decode */
unsigned char *display; /* pointer to display */
unsigned char *copybuffer;
unsigned char *background;
mng_handle mng; /* mng handle */
int width, height;
int fbwidth, fbheight, fbbpp;
int fbx, fby;
int alpha;
} mngstuff;
extern volatile int run;
extern int verbose;
extern int buffered;
extern int dynpos;
extern int waitsignal;
extern int delta;
extern int sconly;
#endif

View file

@ -1,40 +0,0 @@
/*
fbmngplay - fb console MNG player.
(c) 2001 by Stefan Reinauer, <stepan :at: suse.de>
This program is based on mngplay, part of libmng, written and (C) by
Ralph Giles <giles :at: ashlu.bc.ca>
This program my be redistributed under the terms of the
GNU General Public Licence, version 2, or at your preference,
any later version.
*/
#include <stdio.h>
#include "fbmngplay.h"
#include "messages.h"
void usage(char *name)
{
fprintf(stderr, "\nusage: %s [ -x <val> ] [ -y <val> ] [ -a <val> ] [-b] [-v]"
" [-s] [file.mng [file.mng [...]]]\n", name);
fprintf(stderr, "\n -x: x coordinate\n");
fprintf(stderr, " -y: y coordinate\n");
fprintf(stderr, " -a, --alpha: default alpha channel 1..100\n");
fprintf(stderr, " -v, --verbose: verbose mode\n");
fprintf(stderr, " -b, --buffered: buffered mode\n");
fprintf(stderr, " -s, --signal: wait for SIGUSR1 between animations\n");
fprintf(stderr, " -p, --position: dynamically select position\n");
fprintf(stderr, " -V, --version: show version and exit\n");
fprintf(stderr, " -?, -h, --help: print this help.\n\n");
fprintf(stderr, " -S --start-console: only output animation on console it was started on.\n");
}
void version(void)
{
fprintf(stderr, "fbmngplay v%s, Copyright (C) 2001 Stefan Reinauer\n",FBMNGPLAY_VERSION);
fprintf(stderr, "fbmngplay comes with ABSOLUTELY NO WARRANTY;\n");
fprintf(stderr,"This is free software, and you are welcome to redistribute it\n");
fprintf(stderr,"under certain conditions; Check the GPL for details.\n");
}

View file

@ -1,19 +0,0 @@
/*
fbmngplay - fb console MNG player.
(c) 2001 by Stefan Reinauer, <stepan :at: suse.de>
This program is based on mngplay, part of libmng, written and (C) by
Ralph Giles <giles :at: ashlu.bc.ca>
This program my be redistributed under the terms of the
GNU General Public Licence, version 2, or at your preference,
any later version.
*/
#ifndef __MESSAGES_H
#define __MESSAGES_H
extern void usage(char *name);
extern void version(void);
#endif

View file

@ -1,398 +0,0 @@
/*
fbmngplay - fb console MNG player.
(c) 2001 by Stefan Reinauer, <stepan :at: suse.de>
This program is based on mngplay, part of libmng, written and (C) by
Ralph Giles <giles :at: ashlu.bc.ca>
This program my be redistributed under the terms of the
GNU General Public Licence, version 2, or at your preference,
any later version.
*/
#include <unistd.h>
#include <sys/time.h>
#include <linux/vt.h>
#include "fbmngplay.h"
#include "console.h"
#include "mng.h"
mngstuff *mng;
unsigned char *bufferstream;
unsigned long bufferpos = 0, buffersize = 0;
inline void mdelay(unsigned long msec)
{
usleep(msec * 1000);
}
/* callbacks for the mng decoder */
/* memory allocation; data must be zeroed */
mng_ptr mngalloc(mng_uint32 size)
{
return (mng_ptr) calloc(1, size);
}
/* memory deallocation */
void mngfree(mng_ptr p, mng_uint32 size)
{
free(p);
return;
}
mng_bool mngopenstream(mng_handle mng)
{
mngstuff *mymng;
/* look up our stream struct */
mymng = (mngstuff *) mng_get_userdata(mng);
/* open the file */
mymng->file = fopen(mymng->filename, "rb");
if (mymng->file == NULL) {
fprintf(stderr, "unable to open '%s'\n", mymng->filename);
run = 0;
return MNG_FALSE;
}
if (buffered) {
unsigned long len;
fseek(mymng->file, 0, SEEK_END);
len = ftell(mymng->file);
rewind(mymng->file);
bufferstream = malloc(len);
if (!bufferstream) {
/* Not enough memory for buffers
* -> we go back to unbuffered mode
*/
printf("Reverted to non buffered mode.\n");
buffered = 0;
return MNG_TRUE;
}
buffersize = len;
fread(bufferstream, 1, len, mymng->file);
bufferpos = 0;
fclose(mymng->file);
mymng->file = NULL;
}
return MNG_TRUE;
}
mng_bool mngclosestream(mng_handle mng)
{
mngstuff *mymng;
/* look up our stream struct */
mymng = (mngstuff *) mng_get_userdata(mng);
/* close the file */
if (mymng->file)
fclose(mymng->file);
mymng->file = NULL; /* for safety */
if (bufferstream) {
free(bufferstream);
bufferstream = 0;
buffersize = 0;
bufferpos = 0;
}
return MNG_TRUE;
}
/* feed data to the decoder */
mng_bool mngreadstream(mng_handle mng, mng_ptr buffer,
mng_uint32 size, mng_uint32 * bytesread)
{
mngstuff *mymng;
/* look up our stream struct */
mymng = (mngstuff *) mng_get_userdata(mng);
if (!buffered) {
/* read the requested amount of data from the file */
*bytesread = fread(buffer, 1, size, mymng->file);
} else {
*bytesread = (buffersize - bufferpos) <
size ? (buffersize - bufferpos) : size;
memcpy(buffer, bufferstream + bufferpos, *bytesread);
bufferpos += (*bytesread);
}
return MNG_TRUE;
}
/* the header's been read. set up the display stuff */
mng_bool mngprocessheader(mng_handle mng,
mng_uint32 width, mng_uint32 height)
{
mngstuff *mymng;
unsigned char *copybuffer, *background;
unsigned char *src;
mymng = (mngstuff *) mng_get_userdata(mng);
mymng->width = width;
mymng->height = height;
if (dynpos) {
mymng->fbx = (mymng->fbwidth)-width-15;
switch (mymng->fbheight) {
case 768:
mymng->fby = 15;
break;
case 1024:
mymng->fby = 30;
break;
default:
mymng->fby = 0;
break;
}
}
copybuffer = (unsigned char *) malloc(width * height * 4);
if (copybuffer == NULL) {
fprintf(stderr, "could not allocate copy buffer.\n");
exit(0);
}
mymng->copybuffer = copybuffer;
if (!mymng->background) {
background =
(unsigned char *) malloc(width * height *
(mymng->fbbpp >> 3));
if (background == NULL) {
fprintf(stderr,
"could not allocate background buffer.\n");
exit(0);
}
mymng->background = background;
src = mymng->display + (mymng->fbwidth * mymng->fby +
mymng->fbx) * (mymng->fbbpp >> 3);
while (height--) {
memcpy(background, src,
width * (mymng->fbbpp >> 3));
background += width * (mymng->fbbpp >> 3);
src += mymng->fbwidth * (mymng->fbbpp >> 3);
}
}
/* tell the mng decoder about our bit-depth choice */
/* FIXME: this works on intel. is it correct in general? */
mng_set_canvasstyle(mng, MNG_CANVAS_BGRA8);
return MNG_TRUE;
}
/* return a row pointer for the decoder to fill */
mng_ptr mnggetcanvasline(mng_handle mng, mng_uint32 line)
{
mngstuff *mymng;
mng_ptr row;
/* dereference our structure */
mymng = (mngstuff *) mng_get_userdata(mng);
/* we assume any necessary locking has happened
outside, in the frame level code */
row = mymng->copybuffer + mymng->width * 4 * line;
return (row);
}
/* timer */
mng_uint32 mnggetticks(mng_handle mng)
{
mng_uint32 ticks;
struct timeval tv;
struct timezone tz;
gettimeofday(&tv, &tz);
ticks = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
return (ticks);
}
static inline void copyline(unsigned char *dest, unsigned char *src,
unsigned char *background, mngstuff * mymng)
{
// BGRA8
unsigned int i = mymng->width;
unsigned int fr, fg, fb, br, bg, bb, r, g, b, a;
unsigned short output, input;
while (i--) {
fb = *src++;
fg = *src++;
fr = *src++;
a = *src++;
a = a * mymng->alpha / 100;
switch (mymng->fbbpp) {
case 16:
input = *((unsigned short *) background)++;
br = (input >> 8) & 0xf8;
bg = (input >> 3) & 0xfc;
bb = input << 3 & 0xff;
break;
case 24:
bb = *background++;
bg = *background++;
br = *background++;
break;
case 32:
bb = *background++;
bg = *background++;
br = *background++;
background++;
break;
default:
br = 0;
bg = 0;
bb = 0;
printf("depth not supported.\n");
run = 0;
break;
}
r = ((fr * a) + (br * (0x100 - a))) >> 8;
g = ((fg * a) + (bg * (0x100 - a))) >> 8;
b = ((fb * a) + (bb * (0x100 - a))) >> 8;
switch (mymng->fbbpp) {
case 16:
// dumb 24->16 bit conversion.
r >>= 3;
g >>= 2;
b >>= 3;
output = (r << 11) | (g << 5) | b;
*((unsigned short *) dest)++ = output;
break;
case 24:
*dest++ = b;
*dest++ = g;
*dest++ = r;
break;
case 32:
*dest++ = b;
*dest++ = g;
*dest++ = r;
dest++;
break;
default:
break;
}
}
}
mng_bool mngrefresh(mng_handle mng, mng_uint32 x, mng_uint32 y,
mng_uint32 w, mng_uint32 h)
{
mngstuff *mymng;
unsigned char *dest, *src, *background;
if (sconly && current_console()!=start_console)
return MNG_TRUE;
/* dereference our structure */
mymng = (mngstuff *) mng_get_userdata(mng);
dest = mymng->display + ((mymng->fby * mymng->fbwidth + mymng->fbx)
* (mymng->fbbpp >> 3));
src = mymng->copybuffer;
background = mymng->background;
/* refresh the screen with the new frame */
while (h-- > 0) {
copyline(dest, src, background, mymng);
dest += mymng->fbwidth * (mymng->fbbpp >> 3);
background += mymng->width * (mymng->fbbpp >> 3);
src += 4 * mymng->width; // 4 bytes per pixel due to RGBA
}
// remove traces
memset(mymng->copybuffer, 0, 4 * mymng->width * mymng->height);
return MNG_TRUE;
}
/* interframe delay callback */
mng_bool mngsettimer(mng_handle mng, mng_uint32 msecs)
{
mngstuff *mymng;
/* look up our stream struct */
mymng = (mngstuff *) mng_get_userdata(mng);
/* set the timer for when the decoder wants to be woken */
mymng->delay = msecs;
return MNG_TRUE;
}
mng_bool mngerror(mng_handle mng, mng_int32 code, mng_int8 severity,
mng_chunkid chunktype, mng_uint32 chunkseq,
mng_int32 extra1, mng_int32 extra2, mng_pchar text)
{
mngstuff *mymng;
char chunk[5];
/* dereference our data so we can get the filename */
mymng = (mngstuff *) mng_get_userdata(mng);
/* pull out the chuck type as a string */
// FIXME: does this assume unsigned char?
chunk[0] = (char) ((chunktype >> 24) & 0xFF);
chunk[1] = (char) ((chunktype >> 16) & 0xFF);
chunk[2] = (char) ((chunktype >> 8) & 0xFF);
chunk[3] = (char) ((chunktype) & 0xFF);
chunk[4] = '\0';
/* output the error */
fprintf(stderr, "error playing '%s' chunk %s (%d):\n",
mymng->filename, chunk, chunkseq);
fprintf(stderr, "%s\n", text);
return 0;
}
int mngquit(mng_handle mng)
{
mngstuff *mymng;
/* dereference our data so we can free it */
mymng = (mngstuff *) mng_get_userdata(mng);
/* cleanup. this will call mymngclosestream */
mng_cleanup(&mng);
/* free our data */
free(mymng);
/* quit */
exit(0);
}
void cleanup(void)
{
mngquit(mng->mng);
exit(0);
}
void restore_area(void)
{
int height, width;
unsigned char *dest, *background;
if (sconly && current_console()!=start_console)
return;
background = mng->background;
height = mng->height;
width = mng->width;
dest = mng->display + (mng->fbwidth * mng->fby +
mng->fbx) * (mng->fbbpp >> 3);
while (height--) {
memcpy(dest, background, width * (mng->fbbpp >> 3));
background += width * (mng->fbbpp >> 3);
dest += mng->fbwidth * (mng->fbbpp >> 3);
}
}

View file

@ -1,38 +0,0 @@
/*
fbmngplay - fb console MNG player.
(c) 2001 by Stefan Reinauer, <stepan :at: suse.de>
This program is based on mngplay, part of libmng, written and (C) by
Ralph Giles <giles :at: ashlu.bc.ca>
This program my be redistributed under the terms of the
GNU General Public Licence, version 2, or at your preference,
any later version.
*/
#ifndef __HOOKS_H
#define __HOOKS_H
#include "fbmngplay.h"
extern mngstuff *mng;
extern inline void mdelay(unsigned long msec);
extern mng_ptr mngalloc(mng_uint32 size);
extern void mngfree(mng_ptr p, mng_uint32 size);
extern mng_bool mngopenstream(mng_handle mng);
extern mng_bool mngclosestream(mng_handle mng);
extern mng_bool mngreadstream( mng_handle mng, mng_ptr buffer, mng_uint32 size, mng_uint32 * bytesread);
extern mng_bool mngprocessheader( mng_handle mng, mng_uint32 width, mng_uint32 height);
extern mng_ptr mnggetcanvasline(mng_handle mng, mng_uint32 line);
extern mng_uint32 mnggetticks(mng_handle mng);
extern mng_bool mngrefresh(mng_handle mng, mng_uint32 x, mng_uint32 y, mng_uint32 w, mng_uint32 h);
extern mng_bool mngsettimer(mng_handle mng, mng_uint32 msecs);
extern mng_bool mngerror(mng_handle mng, mng_int32 code, mng_int8 severity,
mng_chunkid chunktype, mng_uint32 chunkseq,
mng_int32 extra1, mng_int32 extra2, mng_pchar text);
extern int mngquit(mng_handle mng);
extern void cleanup(void);
extern void restore_area(void);
#endif

View file

@ -1,481 +0,0 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View file

@ -1,29 +0,0 @@
LIBMNG_PREFIX = /usr/local
CC = gcc
CFLAGS = -g -O2 -Wall \
`pkg-config --cflags gtk+-2.0` \
-I$(LIBMNG_PREFIX)/include
LIBS = `pkg-config --libs gtk+-2.0` \
-L$(LIBMNG_PREFIX)/lib -lmng -ljpeg -llcms -lz
OBJ = dummy.o \
gtk-mng-view.o
EXE_BASENAME=gmngview
all: $(EXE_BASENAME)
$(EXE_BASENAME): $(OBJ)
$(CC) -o $(EXE_BASENAME) $(OBJ) $(LIBS)
#$(EXE_BASENAME)-static: $(OBJ)
# $(CC) -static -o $(EXE_BASENAME)-static $(OBJ) $(LIBS)
.c.o: gtk-mng-view.h
$(CC) -c $(CFLAGS) $<
clean:
rm -f core $(EXE_BASENAME) $(EXE_BASENAME)-static $(OBJ)

View file

@ -1,38 +0,0 @@
From dummy.c:
/*
* Very simple program, that has been used by us
* (V. Babin <babin@users.sourceforge.net> and
* S. Kondrat <valiska@users.sourceforge.net>)
* during toying with libmng (http://www.limng.com)
*
* License: GPL :-))
*
* 7 July 2001: added key-press/button-press handling to exit viewer without
* window-manager help; added libmng version info [Greg Roelofs]
*/
From gtk-mng-view.c:
/* Toy widget for GTK+ for displaying MNG animations.
*
* Copyright (C) 2000 The Free Software Foundation
*
* Author(s): Volodymyr Babin <vb@dwuj.ichf.edu.pl>
*
* This code is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/

View file

@ -1,8 +0,0 @@
Require:
* gtk+ >= 1.2.0 (tested on 1.2.8)
* libmng (tested on 0.9.2)
You have specify Your libmng instalation prefix
before typing `make' in the first line of a Makefile
in this directory. Later type `make'.

View file

@ -1,139 +0,0 @@
/*
* Very simple program, that has been used by us
* (V. Babin <babin :at: users.sourceforge.net> and
* S. Kondrat <valiska :at: users.sourceforge.net>)
* during toying with libmng (http://www.libmng.com)
*
* License: GPL :-))
*
* 7 July 2001: added key-press/button-press handling to exit viewer without
* window-manager help; added libmng version info [Greg Roelofs]
*/
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <gtk/gtk.h>
#include "gtk-mng-view.h"
#define BLOCK_SIZE 4096
static guint
read_file (const gchar* file_name, guchar ** ptr)
{
gint fd;
guint size = 0;
guint bytes_read = 0;
if ((fd = open (file_name, O_RDONLY)) == -1)
{
perror (file_name);
* ptr = NULL;
return 0;
}
* ptr = g_new (guchar, BLOCK_SIZE);
while ((bytes_read = read (fd, * ptr + size, BLOCK_SIZE)))
{
size += bytes_read;
* ptr = (guchar *) g_realloc (* ptr, size + BLOCK_SIZE);
}
close (fd);
* ptr = (guchar *) g_realloc (* ptr, size);
return size;
}
int
main (int argc, char ** argv)
{
GtkMngView * mng_view;
GtkWidget * window;
GtkWidget * align;
GtkWidget * frame;
guchar * mng_data = NULL;
guint mng_data_size;
if (argc < 2)
{
g_print ("Usage: %s <file.mng>\n\n", argv[0]);
g_print (" Compiled with GTK+ %d.%d.%d; using GTK+ %d.%d.%d.\n",
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION,
gtk_major_version, gtk_minor_version, gtk_micro_version);
#ifdef GDK_PIXBUF_VERSION
g_print (" Compiled with gdk-pixbuf %s; using gdk-pixbuf %s.\n",
GDK_PIXBUF_VERSION, gdk_pixbuf_version);
#endif
g_print (" Compiled with libmng %s; using libmng %s.\n",
MNG_VERSION_TEXT, mng_version_text());
g_print (" Compiled with zlib %s; using zlib %s.\n",
ZLIB_VERSION, zlib_version);
#ifdef JPEG_LIB_VERSION
{
int major = JPEG_LIB_VERSION / 10;
int minor = JPEG_LIB_VERSION % 10;
char minoralpha[2];
if (minor)
{
minoralpha[0] = (char)(minor - 1 + 'a');
minoralpha[1] = '\0';
}
else
minoralpha[0] = '\0';
g_print (" Compiled with libjpeg %d%s.\n", major, minoralpha);
}
#endif
g_print ("\nPress Esc or Q, or click mouse button, to quit.\n");
return 1;
}
mng_data_size = read_file (* (argv + 1), &mng_data);
if (mng_data == NULL)
return 1;
gtk_init (&argc, &argv);
gdk_rgb_init ();
gdk_rgb_set_verbose (TRUE);
gtk_widget_set_default_visual (gdk_rgb_get_visual ());
gtk_widget_set_default_colormap (gdk_rgb_get_cmap ());
window = gtk_widget_new (GTK_TYPE_WINDOW,
"GtkWindow::type", GTK_WINDOW_TOPLEVEL,
"GtkWindow::title", "MNG animation",
"GtkContainer::border_width", 5,
NULL);
gtk_signal_connect (GTK_OBJECT (window), "delete_event",
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
/* any keypress (e.g., Esc or Q) or mouse-button click will quit viewer */
gtk_signal_connect (GTK_OBJECT (window), "key_press_event",
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
gtk_widget_add_events(window, GDK_BUTTON_PRESS_MASK);
gtk_signal_connect (GTK_OBJECT (window), "button_press_event",
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_container_add (GTK_CONTAINER (window), align);
frame = gtk_frame_new (NULL);
gtk_container_add (GTK_CONTAINER (align), frame);
/* actually it */
mng_view = GTK_MNG_VIEW (gtk_mng_view_new ());
gtk_container_add (GTK_CONTAINER (frame), GTK_WIDGET (mng_view));
gtk_mng_view_load_mng_from_memory (mng_view, mng_data, mng_data_size);
g_free (mng_data);
/* rest in piece */
gtk_widget_show_all (window);
gtk_main ();
return 0;
}

View file

@ -1,471 +0,0 @@
/* Toy widget for GTK+ for displaying MNG animations.
*
* Copyright (C) 2000 The Free Software Foundation
*
* Author(s): Volodymyr Babin <vb :at: dwuj.ichf.edu.pl>
*
* This code is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <gtk/gtkmain.h>
#include "gtk-mng-view.h"
#include <gdk-pixbuf/gdk-pixbuf.h>
/* MNG callbacks */
static mng_ptr
mng_malloc_callback (mng_size_t how_many)
{
return (mng_ptr) g_new0 (gchar, how_many);
}
static void
mng_free_callback (mng_ptr pointer, mng_size_t number)
{
g_free (pointer);
}
static mng_bool
mng_open_stream_callback (mng_handle mng_h)
{
return MNG_TRUE;
}
static mng_bool
mng_close_stream_callback (mng_handle mng_h)
{
return MNG_TRUE;
}
static mng_bool
mng_read_data_callback (mng_handle mng_h,
mng_ptr buffer,
mng_uint32 bytes_requested,
mng_uint32 * bytes_read)
{
guint available_mng_food;
GtkMngView * mng_view = GTK_MNG_VIEW (mng_get_userdata (mng_h));
available_mng_food = mng_view->bytes_to_eat - mng_view->bytes_eaten;
if (available_mng_food > 0 && mng_view->mng_food != NULL)
{
* bytes_read = (mng_uint32) MIN ((mng_uint32) available_mng_food, bytes_requested);
memcpy (buffer, mng_view->mng_food + mng_view->bytes_eaten, * bytes_read);
mng_view->bytes_eaten += * bytes_read;
return MNG_TRUE;
}
else
return MNG_FALSE;
}
static mng_bool
mng_process_header_callback (mng_handle mng_h,
mng_uint32 width,
mng_uint32 height)
{
GtkMngView * mng_view;
mng_view = GTK_MNG_VIEW (mng_get_userdata (mng_h));
mng_view->width = width;
mng_view->height = height;
g_free (mng_view->MNG_drawing_buffer);
mng_view->MNG_drawing_buffer = g_new0 (guchar, 3 * width * height);
gtk_widget_queue_resize (GTK_WIDGET (mng_view));
return MNG_TRUE;
}
static gboolean
gtk_mng_view_animator (GtkMngView * mng_view)
{
mng_retcode retcode;
retcode = mng_display_resume (mng_view->MNG_handle);
if (retcode == MNG_NOERROR)
{
mng_view->timeout_ID = 0;
return FALSE;
}
else if (retcode == MNG_NEEDTIMERWAIT)
return FALSE;
else
g_warning ("mng_display_resume() return not good value");
return FALSE;
}
static mng_bool
mng_set_timer_callback (mng_handle mng_h,
mng_uint32 delay)
{
GtkMngView * mng_view;
mng_view = GTK_MNG_VIEW (mng_get_userdata (mng_h));
mng_view->timeout_ID = gtk_timeout_add (delay,
(GtkFunction) gtk_mng_view_animator,
mng_view);
return MNG_TRUE;
}
static mng_uint32
mng_get_tickcount_callback (mng_handle mng_h)
{
gdouble seconds;
gulong microseconds;
GtkMngView * mng_view;
mng_view = GTK_MNG_VIEW (mng_get_userdata (mng_h));
seconds = g_timer_elapsed (mng_view->timer,
&microseconds);
return ((mng_uint32) (seconds*1000.0 + ((gdouble) microseconds)/1000.0));
}
static mng_ptr
mng_get_canvas_line_callback (mng_handle mng_h,
mng_uint32 line)
{
GtkMngView * mng_view;
mng_view = GTK_MNG_VIEW (mng_get_userdata (mng_h));
return mng_view->MNG_drawing_buffer + 3 * line * mng_view->width;
}
static void gtk_mng_view_paint (GtkMngView *, GdkRectangle *);
static mng_bool
mng_refresh_callback (mng_handle mng_h,
mng_uint32 x,
mng_uint32 y,
mng_uint32 width,
mng_uint32 height)
{
GtkMngView * mng_view;
mng_view = GTK_MNG_VIEW (mng_get_userdata (mng_h));
if (GTK_WIDGET_REALIZED (mng_view))
{
GdkRectangle rectangle;
rectangle.x = x;
rectangle.y = y;
rectangle.width = width;
rectangle.height = height;
gtk_mng_view_paint (mng_view, &rectangle);
}
return MNG_TRUE;
}
static gboolean
gtk_mng_view_init_libmng (GtkMngView * mng_view)
{
GtkWidget * widget;
g_return_val_if_fail (IS_GTK_MNG_VIEW (mng_view), FALSE);
if (mng_view->MNG_handle)
mng_cleanup (&mng_view->MNG_handle);
mng_view->MNG_handle = mng_initialize (mng_view,
mng_malloc_callback,
mng_free_callback,
MNG_NULL);
if (mng_view->MNG_handle == MNG_NULL)
return FALSE;
if (mng_setcb_openstream (mng_view->MNG_handle, mng_open_stream_callback) != MNG_NOERROR ||
mng_setcb_closestream (mng_view->MNG_handle, mng_close_stream_callback) != MNG_NOERROR ||
mng_setcb_readdata (mng_view->MNG_handle, mng_read_data_callback) != MNG_NOERROR ||
mng_setcb_processheader (mng_view->MNG_handle, mng_process_header_callback) != MNG_NOERROR ||
mng_setcb_settimer (mng_view->MNG_handle, mng_set_timer_callback) != MNG_NOERROR ||
mng_setcb_gettickcount (mng_view->MNG_handle, mng_get_tickcount_callback) != MNG_NOERROR ||
mng_setcb_getcanvasline (mng_view->MNG_handle, mng_get_canvas_line_callback) != MNG_NOERROR ||
mng_setcb_refresh (mng_view->MNG_handle, mng_refresh_callback) != MNG_NOERROR)
{
mng_cleanup (&mng_view->MNG_handle);
return FALSE;
}
mng_set_canvasstyle (mng_view->MNG_handle, MNG_CANVAS_RGB8);
widget = GTK_WIDGET (mng_view);
if (!GTK_WIDGET_REALIZED (widget))
gtk_widget_realize (widget);
mng_set_bgcolor (mng_view->MNG_handle,
widget->style->bg[GTK_STATE_NORMAL].red,
widget->style->bg[GTK_STATE_NORMAL].green,
widget->style->bg[GTK_STATE_NORMAL].blue);
return TRUE;
}
/* GTK+ widget methods */
static GtkWidgetClass * parent_class = NULL;
static void
gtk_mng_view_finalize (GObject * obj)
{
GtkMngView * mng_view = GTK_MNG_VIEW (obj);
g_timer_destroy (mng_view->timer);
if (mng_view->timeout_ID)
gtk_timeout_remove (mng_view->timeout_ID);
g_free (mng_view->MNG_drawing_buffer);
if (mng_view->MNG_handle)
mng_cleanup (&mng_view->MNG_handle);
G_OBJECT_CLASS (parent_class)->finalize (obj);
}
static void
gtk_mng_view_size_request (GtkWidget * widget, GtkRequisition * requisition)
{
GtkMngView * mng_view;
g_return_if_fail (IS_GTK_MNG_VIEW (widget));
g_return_if_fail (requisition != NULL);
mng_view = (GtkMngView *) widget;
requisition->width = mng_view->width;
requisition->height = mng_view->height;
}
static void
gtk_mng_view_size_allocate (GtkWidget * widget, GtkAllocation * allocation)
{
g_return_if_fail (IS_GTK_MNG_VIEW (widget));
g_return_if_fail (allocation != NULL);
if (GTK_WIDGET_REALIZED (widget))
gdk_window_move_resize (widget->window,
allocation->x,
allocation->y,
allocation->width,
allocation->height);
}
static void
gtk_mng_view_paint (GtkMngView * mng_view,
GdkRectangle * area)
{
GtkWidget * widget;
guint rowstride;
guchar * buffer;
register guchar * ptr;
register guchar * bptr;
widget = GTK_WIDGET (mng_view);
g_assert (GTK_WIDGET_REALIZED (widget));
rowstride = 3 * area->width;
buffer = g_new (guchar, rowstride * area->height);
bptr = buffer;
ptr = mng_view->MNG_drawing_buffer
+ 3 * (area->y * mng_view->width + area->x);
while (bptr < buffer + rowstride * area->height)
{
memcpy (bptr, ptr, rowstride);
bptr += rowstride;
ptr += 3 * mng_view->width;
}
gdk_draw_rgb_image (widget->window,
widget->style->white_gc,
area->x,
area->y,
area->width,
area->height,
GDK_RGB_DITHER_NORMAL,
buffer,
rowstride);
g_free (buffer);
gdk_flush ();
}
static gboolean
gtk_mng_view_expose (GtkWidget * widget, GdkEventExpose * event)
{
g_return_val_if_fail (IS_GTK_MNG_VIEW (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (GTK_WIDGET_REALIZED (widget))
{
GdkRectangle dummy;
GdkRectangle rectangle;
GtkMngView * mng_view;
mng_view = GTK_MNG_VIEW (widget);
dummy.x = dummy.y = 0;
dummy.width = mng_view->width;
dummy.height = mng_view->height;
if (gdk_rectangle_intersect (&dummy, &event->area, &rectangle))
gtk_mng_view_paint (mng_view, &rectangle);
}
return FALSE;
}
static void
gtk_mng_view_realize (GtkWidget * widget)
{
GdkWindowAttr attributes;
gint attributes_mask;
g_return_if_fail (IS_GTK_MNG_VIEW (widget));
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;
attributes.width = widget->allocation.width;
attributes.height = widget->allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget);
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |= GDK_EXPOSURE_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
gdk_window_set_user_data (widget->window, widget);
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
}
static void
gtk_mng_view_init (GtkMngView * mng_view)
{
g_return_if_fail (IS_GTK_MNG_VIEW (mng_view));
GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (mng_view), GTK_NO_WINDOW);
mng_view->MNG_handle = NULL;
mng_view->MNG_drawing_buffer = NULL;
mng_view->timeout_ID = 0;
mng_view->timer = g_timer_new ();
g_timer_start (mng_view->timer);
mng_view->mng_food = NULL;
}
static void
gtk_mng_view_class_init (GtkMngViewClass * klass)
{
GObjectClass * object_class;
GtkWidgetClass * widget_class;
parent_class = g_type_class_peek_parent (klass);
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gtk_mng_view_finalize;
widget_class = GTK_WIDGET_CLASS (klass);
widget_class->size_request = gtk_mng_view_size_request;
widget_class->size_allocate = gtk_mng_view_size_allocate;
widget_class->expose_event = gtk_mng_view_expose;
widget_class->realize = gtk_mng_view_realize;
}
GtkType
gtk_mng_view_get_type (void)
{
static GtkType type = 0;
if (!type)
{
static const GtkTypeInfo type_info =
{
"GtkMngView",
sizeof (GtkMngView),
sizeof (GtkMngViewClass),
(GtkClassInitFunc) gtk_mng_view_class_init,
(GtkObjectInitFunc) gtk_mng_view_init,
NULL, NULL,
(GtkClassInitFunc) NULL
};
type = gtk_type_unique (GTK_TYPE_WIDGET, &type_info);
}
return type;
}
GtkWidget *
gtk_mng_view_new (void)
{
return GTK_WIDGET (gtk_type_new (GTK_MNG_VIEW_TYPE));
}
gboolean
gtk_mng_view_load_mng_from_memory (GtkMngView * mng_view,
guchar * data_to_eat,
guint data_size)
{
g_return_val_if_fail (IS_GTK_MNG_VIEW (mng_view), FALSE);
g_return_val_if_fail (data_size > 27, FALSE);
g_return_val_if_fail (data_to_eat != NULL, FALSE);
if (data_to_eat[0] != 0x8a ||
data_to_eat[1] != 'M' ||
data_to_eat[2] != 'N' ||
data_to_eat[3] != 'G' ||
data_to_eat[4] != 0x0d ||
data_to_eat[5] != 0x0a ||
data_to_eat[6] != 0x1a ||
data_to_eat[7] != 0x0a)
{
g_warning ("not mng format");
return FALSE;
}
if (gtk_mng_view_init_libmng (mng_view))
{
mng_view->bytes_to_eat = data_size;
mng_view->bytes_eaten = 0;
mng_view->mng_food = data_to_eat;
if (mng_read (mng_view->MNG_handle) != MNG_NOERROR)
{
g_warning ("libmng read error");
mng_cleanup (&mng_view->MNG_handle);
return FALSE;
}
else
return mng_display (mng_view->MNG_handle);
}
else
{
g_warning ("error initializing libmng");
return FALSE;
}
return TRUE;
}

View file

@ -1,64 +0,0 @@
/* Toy widget for GTK+ for displaying MNG animations.
*
* Copyright (C) 2000 The Free Software Foundation
*
* Author(s): Volodymyr Babin <vb :at: dwuj.ichf.edu.pl>
*
* This code is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_MNG_VIEW_H__
#define __GTK_MNG_VIEW_H__
#include <libmng.h>
#include <gtk/gtkwidget.h>
#define GTK_MNG_VIEW_TYPE (gtk_mng_view_get_type ())
#define GTK_MNG_VIEW(o) (GTK_CHECK_CAST ((o), GTK_MNG_VIEW_TYPE, GtkMngView))
#define GTK_MNG_VIEW_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), GTK_MNG_VIEW_TYPE, GtkMngViewClass))
#define IS_GTK_MNG_VIEW(o) (GTK_CHECK_TYPE ((o), GTK_MNG_VIEW_TYPE))
#define IS_GTK_MNG_VIEW_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), GTK_MNG_VIEW_TYPE))
typedef struct _GtkMngView GtkMngView;
typedef struct _GtkMngViewClass GtkMngViewClass;
struct _GtkMngView
{
GtkWidget widget;
/* private */
GTimer * timer;
guint timeout_ID;
guint width;
guint height;
mng_handle MNG_handle;
guchar * MNG_drawing_buffer;
guchar * mng_food;
guint bytes_to_eat;
guint bytes_eaten;
};
struct _GtkMngViewClass
{
GtkWidgetClass klass;
};
GtkType gtk_mng_view_get_type (void);
GtkWidget * gtk_mng_view_new (void);
/* returns !FALSE on success */
gboolean gtk_mng_view_load_mng_from_memory (GtkMngView *, guchar *, guint);
#endif /* __GTK_MNG_VIEW_H__ */

View file

@ -1,43 +0,0 @@
# makefile for mngtree test-program on Linux ELF with gcc
prefix=/usr/local
CC=gcc
INCPATH=$(prefix)/include
LIBPATH=$(prefix)/lib
JPEGLIB=/usr/lib
ALIGN=
# for i386:
#ALIGN=-malign-loops=2 -malign-functions=2
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
-Wmissing-declarations -Wtraditional -Wcast-align \
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
# for pgcc version 2.95.1, -O3 is buggy; don't use it.
CFLAGS=-I$(INCPATH) -Wall -O3 -funroll-loops -DMNG_USE_SO $(ALIGN) # $(WARNMORE) -g
LDFLAGS=-L. -Wl,-rpath,. -L$(LIBPATH) -Wl,-rpath,$(LIBPATH) \
-L$(JPEGLIB) -Wl,-rpath,$(JPEGLIB) -lmng -lz -ljpeg -lm
OBJS = mngtree.o
.SUFFIXES: .c .o
.c.o:
$(CC) -c $(CFLAGS) -o $@ $*.c
all: mngtree
mngtree: mngtree.o
$(CC) -o mngtree $(CFLAGS) mngtree.o $(LDFLAGS)
clean:
/bin/rm -f *.o mngtree
# DO NOT DELETE THIS LINE -- make depend depends on it.
mngtree.o: mngtree.c

View file

@ -1,237 +0,0 @@
/* ************************************************************************** */
/* * * */
/* * COPYRIGHT NOTICE: * */
/* * * */
/* * Copyright (c) 2000 Gerard Juyn (gerard :at: libmng.com) * */
/* * [You may insert additional notices after this sentence if you modify * */
/* * this source] * */
/* * * */
/* * For the purposes of this copyright and license, "Contributing Authors" * */
/* * is defined as the following set of individuals: * */
/* * * */
/* * Gerard Juyn * */
/* * (hopefully some more to come...) * */
/* * * */
/* * The MNG Library is supplied "AS IS". The Contributing Authors * */
/* * disclaim all warranties, expressed or implied, including, without * */
/* * limitation, the warranties of merchantability and of fitness for any * */
/* * purpose. The Contributing Authors assume no liability for direct, * */
/* * indirect, incidental, special, exemplary, or consequential damages, * */
/* * which may result from the use of the MNG Library, even if advised of * */
/* * the possibility of such damage. * */
/* * * */
/* * Permission is hereby granted to use, copy, modify, and distribute this * */
/* * source code, or portions hereof, for any purpose, without fee, subject * */
/* * to the following restrictions: * */
/* * * */
/* * 1. The origin of this source code must not be misrepresented; * */
/* * you must not claim that you wrote the original software. * */
/* * * */
/* * 2. Altered versions must be plainly marked as such and must not be * */
/* * misrepresented as being the original source. * */
/* * * */
/* * 3. This Copyright notice may not be removed or altered from any source * */
/* * or altered source distribution. * */
/* * * */
/* * The Contributing Authors specifically permit, without fee, and * */
/* * encourage the use of this source code as a component to supporting * */
/* * the MNG and JNG file format in commercial products. If you use this * */
/* * source code in a product, acknowledgment would be highly appreciated. * */
/* * * */
/* ************************************************************************** */
/* * * */
/* * project : mngtree * */
/* * file : mngtree.c copyright (c) 2000 G.Juyn * */
/* * version : 1.0.1 * */
/* * * */
/* * purpose : main project file * */
/* * * */
/* * author : G.Juyn * */
/* * web : http://www.3-t.com * */
/* * email : mailto:info@3-t.com * */
/* * * */
/* * comment : mngtree simply dumps the chunk-structure of the supplied * */
/* * first parameter to stdout (should be a xNG-file) * */
/* * * */
/* * changes : 0.5.2 - 06/03/2000 - G.Juyn * */
/* * - fixed for compilation under Linux * */
/* * 0.5.3 - 06/26/2000 - G.Juyn * */
/* * - changed definition of userdata to mng_ptr * */
/* * 0.5.3 - 06/28/2000 - G.Juyn * */
/* * - changed memory allocation size parameters to mng_size_t * */
/* * * */
/* * 1.0.1 - 12/07/2003 - G.Juyn * */
/* * - fixed inclusion of libmng.h (Thanks Raphael) * */
/* * * */
/* ************************************************************************** */
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include "../../../libmng.h"
/* ************************************************************************** */
typedef struct user_struct {
FILE *hFile; /* file handle */
int iIndent; /* for nice indented formatting */
} userdata;
typedef userdata * userdatap;
/* ************************************************************************** */
mng_ptr myalloc (mng_size_t iSize)
{ /* duh! */
return (mng_ptr)calloc (1, (size_t)iSize);
}
/* ************************************************************************** */
void myfree (mng_ptr pPtr, mng_size_t iSize)
{
free (pPtr); /* duh! */
return;
}
/* ************************************************************************** */
mng_bool myopenstream (mng_handle hMNG)
{
return MNG_TRUE; /* already opened in main function */
}
/* ************************************************************************** */
mng_bool myclosestream (mng_handle hMNG)
{
return MNG_TRUE; /* gets closed in main function */
}
/* ************************************************************************** */
mng_bool myreaddata (mng_handle hMNG,
mng_ptr pBuf,
mng_uint32 iSize,
mng_uint32 *iRead)
{ /* get to my file handle */
userdatap pMydata = (userdatap)mng_get_userdata (hMNG);
/* read it */
*iRead = fread (pBuf, 1, iSize, pMydata->hFile);
/* iRead will indicate EOF */
return MNG_TRUE;
}
/* ************************************************************************** */
mng_bool myiterchunk (mng_handle hMNG,
mng_handle hChunk,
mng_chunkid iChunktype,
mng_uint32 iChunkseq)
{ /* get to my file handle */
userdatap pMydata = (userdatap)mng_get_userdata (hMNG);
char aCh[4];
char zIndent[80];
int iX;
/* decode the chunkname */
aCh[0] = (char)((iChunktype >> 24) & 0xFF);
aCh[1] = (char)((iChunktype >> 16) & 0xFF);
aCh[2] = (char)((iChunktype >> 8) & 0xFF);
aCh[3] = (char)((iChunktype ) & 0xFF);
/* indent less ? */
if ( (iChunktype == MNG_UINT_MEND) || (iChunktype == MNG_UINT_IEND) ||
(iChunktype == MNG_UINT_ENDL) )
pMydata->iIndent -= 2;
/* this looks ugly; but I haven't
figured out how to do it prettier */
for (iX = 0; iX < pMydata->iIndent; iX++)
zIndent[iX] = ' ';
zIndent[pMydata->iIndent] = '\0';
/* print a nicely indented line */
printf ("%s%c%c%c%c\n", zIndent, aCh[0], aCh[1], aCh[2], aCh[3]);
/* indent more ? */
if ( (iChunktype == MNG_UINT_MHDR) || (iChunktype == MNG_UINT_IHDR) ||
(iChunktype == MNG_UINT_JHDR) || (iChunktype == MNG_UINT_DHDR) ||
(iChunktype == MNG_UINT_BASI) || (iChunktype == MNG_UINT_LOOP) )
pMydata->iIndent += 2;
return MNG_TRUE; /* keep'm coming... */
}
/* ************************************************************************** */
int dumptree (char * zFilename)
{
userdatap pMydata;
mng_handle hMNG;
mng_retcode iRC;
/* get a data buffer */
pMydata = (userdatap)calloc (1, sizeof (userdata));
if (pMydata == NULL) /* oke ? */
{
fprintf (stderr, "Cannot allocate a data buffer.\n");
return 1;
}
/* can we open the file ? */
if ((pMydata->hFile = fopen (zFilename, "rb")) == NULL)
{ /* error out if we can't */
fprintf (stderr, "Cannot open input file %s.\n", zFilename);
return 1;
}
/* let's initialize the library */
hMNG = mng_initialize ((mng_ptr)pMydata, myalloc, myfree, MNG_NULL);
if (!hMNG) /* did that work out ? */
{
fprintf (stderr, "Cannot initialize libmng.\n");
iRC = 1;
}
else
{ /* setup callbacks */
if ( ((iRC = mng_setcb_openstream (hMNG, myopenstream )) != 0) ||
((iRC = mng_setcb_closestream (hMNG, myclosestream)) != 0) ||
((iRC = mng_setcb_readdata (hMNG, myreaddata )) != 0) )
fprintf (stderr, "Cannot set callbacks for libmng.\n");
else
{ /* read the file into memory */
if ((iRC = mng_read (hMNG)) != 0)
fprintf (stderr, "Cannot read the file.\n");
else
{
pMydata->iIndent = 2; /* start of the indenting at a nice level */
printf ("Starting dump of %s.\n\n", zFilename);
/* run through the chunk list */
if ((iRC = mng_iterate_chunks (hMNG, 0, myiterchunk)) != 0)
fprintf (stderr, "Cannot iterate the chunks.\n");
printf ("\nDone.\n");
}
}
mng_cleanup (&hMNG); /* cleanup the library */
}
fclose (pMydata->hFile); /* cleanup */
free (pMydata);
return iRC;
}
/* ************************************************************************** */
int main(int argc, char *argv[])
{
if (argc > 1) /* need that first parameter ! */
return dumptree (argv[1]);
else
printf ("\nUsage: mngtree <file.mng>\n\n");
return 0;
}
/* ************************************************************************** */

View file

@ -1,114 +0,0 @@
mngplay.o: mngplay.c /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/lib/gcc-lib/i386-slackware-linux/egcs-2.91.66/include/stddef.h \
/usr/lib/gcc-lib/i386-slackware-linux/egcs-2.91.66/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/stdio.h /usr/include/stdlib.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/alloca.h \
/usr/local/include/SDL/SDL.h /usr/local/include/SDL/SDL_main.h \
/usr/local/include/SDL/SDL_types.h \
/usr/local/include/SDL/SDL_getenv.h \
/usr/local/include/SDL/SDL_error.h \
/usr/local/include/SDL/begin_code.h \
/usr/local/include/SDL/close_code.h \
/usr/local/include/SDL/SDL_rwops.h /usr/local/include/SDL/SDL_timer.h \
/usr/local/include/SDL/SDL_audio.h \
/usr/local/include/SDL/SDL_byteorder.h \
/usr/local/include/SDL/SDL_cdrom.h \
/usr/local/include/SDL/SDL_joystick.h \
/usr/local/include/SDL/SDL_events.h \
/usr/local/include/SDL/SDL_active.h \
/usr/local/include/SDL/SDL_keyboard.h \
/usr/local/include/SDL/SDL_keysym.h \
/usr/local/include/SDL/SDL_mouse.h /usr/local/include/SDL/SDL_video.h \
/usr/local/include/SDL/SDL_mutex.h /usr/local/include/SDL/SDL_quit.h \
/usr/local/include/SDL/SDL_version.h /usr/local/include/libmng.h \
/usr/local/include/libmng_conf.h /usr/local/include/libmng_types.h \
/usr/local/include/zlib.h /usr/local/include/zconf.h \
/usr/include/setjmp.h /usr/include/bits/setjmp.h \
/usr/local/include/jpeglib.h /usr/local/include/jconfig.h \
/usr/local/include/jmorecfg.h \
/usr/lib/gcc-lib/i386-slackware-linux/egcs-2.91.66/include/limits.h \
/usr/lib/gcc-lib/i386-slackware-linux/egcs-2.91.66/include/syslimits.h \
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
/usr/include/bits/posix2_lim.h /usr/include/string.h \
/usr/include/bits/string.h /usr/include/bits/string2.h \
/usr/include/math.h /usr/include/bits/huge_val.h \
/usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \
/usr/lib/gcc-lib/i386-slackware-linux/egcs-2.91.66/include/float.h \
/usr/include/bits/mathinline.h
mngplay.c :
/usr/include/stdio.h :
/usr/include/features.h :
/usr/include/sys/cdefs.h :
/usr/include/gnu/stubs.h :
/usr/lib/gcc-lib/i386-slackware-linux/egcs-2.91.66/include/stddef.h :
/usr/lib/gcc-lib/i386-slackware-linux/egcs-2.91.66/include/stdarg.h :
/usr/include/bits/types.h :
/usr/include/libio.h :
/usr/include/_G_config.h :
/usr/include/bits/stdio_lim.h :
/usr/include/bits/stdio.h :
/usr/include/stdlib.h :
/usr/include/sys/types.h :
/usr/include/time.h :
/usr/include/endian.h :
/usr/include/bits/endian.h :
/usr/include/sys/select.h :
/usr/include/bits/select.h :
/usr/include/bits/sigset.h :
/usr/include/sys/sysmacros.h :
/usr/include/alloca.h :
/usr/local/include/SDL/SDL.h :
/usr/local/include/SDL/SDL_main.h :
/usr/local/include/SDL/SDL_types.h :
/usr/local/include/SDL/SDL_getenv.h :
/usr/local/include/SDL/SDL_error.h :
/usr/local/include/SDL/begin_code.h :
/usr/local/include/SDL/close_code.h :
/usr/local/include/SDL/SDL_rwops.h :
/usr/local/include/SDL/SDL_timer.h :
/usr/local/include/SDL/SDL_audio.h :
/usr/local/include/SDL/SDL_byteorder.h :
/usr/local/include/SDL/SDL_cdrom.h :
/usr/local/include/SDL/SDL_joystick.h :
/usr/local/include/SDL/SDL_events.h :
/usr/local/include/SDL/SDL_active.h :
/usr/local/include/SDL/SDL_keyboard.h :
/usr/local/include/SDL/SDL_keysym.h :
/usr/local/include/SDL/SDL_mouse.h :
/usr/local/include/SDL/SDL_video.h :
/usr/local/include/SDL/SDL_mutex.h :
/usr/local/include/SDL/SDL_quit.h :
/usr/local/include/SDL/SDL_version.h :
/usr/local/include/libmng.h :
/usr/local/include/libmng_conf.h :
/usr/local/include/libmng_types.h :
/usr/local/include/zlib.h :
/usr/local/include/zconf.h :
/usr/include/setjmp.h :
/usr/include/bits/setjmp.h :
/usr/local/include/jpeglib.h :
/usr/local/include/jconfig.h :
/usr/local/include/jmorecfg.h :
/usr/lib/gcc-lib/i386-slackware-linux/egcs-2.91.66/include/limits.h :
/usr/lib/gcc-lib/i386-slackware-linux/egcs-2.91.66/include/syslimits.h :
/usr/include/limits.h :
/usr/include/bits/posix1_lim.h :
/usr/include/bits/local_lim.h :
/usr/include/linux/limits.h :
/usr/include/bits/posix2_lim.h :
/usr/include/string.h :
/usr/include/bits/string.h :
/usr/include/bits/string2.h :
/usr/include/math.h :
/usr/include/bits/huge_val.h :
/usr/include/bits/mathdef.h :
/usr/include/bits/mathcalls.h :
/usr/lib/gcc-lib/i386-slackware-linux/egcs-2.91.66/include/float.h :
/usr/include/bits/mathinline.h :

View file

@ -1,7 +0,0 @@
Contributors to mnyplay
Ralph Giles <giles@ashlu.bc.ca>
Greg Roelofs <newt@pobox.com> (minor contribs!)
--
$Date: 2002/09/26 18:09:37 $

View file

@ -1,340 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View file

@ -1,29 +0,0 @@
2001-07-08 Greg Roelofs <newt@pobox.com>
- added SDL/libmng/zlib/libjpeg version info to usage screen
- added mouse-click handling (as an alternate quit mode)
- added completely static build
- fixed automake setup to order options and libraries correctly on
link line, and included resulting files (configure, Makefile.in,
etc.) in order to match instructions in INSTALL file
2000-07-06 Ralph Giles <giles@ashlu.bc.ca>
* Release 0.1
- added error handling callback
- added event system so you can actually quit
(click the window closebox or type 'escape' or 'q')
- window titles from the filename
- added basic auto*
2000-07-05 Ralph Giles <giles@ashlu.bc.ca>
* snapshot;
- changed refresh parameters to patch libmng 0.9
2000-06-06 Ralph Giles <giles@ashlu.bc.ca>
* snapshot;
- basic playing works now with the MNGsuite tests
2000-06-06 Ralph Giles <giles@ashlu.bc.ca>
* snapshot;
- doesn't really work yet
# beginning =)

View file

@ -1,182 +0,0 @@
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.

View file

@ -1,10 +0,0 @@
# process this with automake to create Makefile.in
bin_PROGRAMS = mngplay mngplay-static
mngplay_SOURCES = mngplay.c
mngplay_static_SOURCES = mngplay.c
mngplay_static_LDFLAGS = -static
# end

View file

@ -1,534 +0,0 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# process this with automake to create Makefile.in
SOURCES = $(mngplay_SOURCES) $(mngplay_static_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
bin_PROGRAMS = mngplay$(EXEEXT) mngplay-static$(EXEEXT)
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \
ChangeLog INSTALL depcomp install-sh missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_mngplay_OBJECTS = mngplay.$(OBJEXT)
mngplay_OBJECTS = $(am_mngplay_OBJECTS)
mngplay_DEPENDENCIES =
am_mngplay_static_OBJECTS = mngplay.$(OBJEXT)
mngplay_static_OBJECTS = $(am_mngplay_static_OBJECTS)
mngplay_static_DEPENDENCIES =
DEFAULT_INCLUDES = -I. -I$(srcdir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(mngplay_SOURCES) $(mngplay_static_SOURCES)
DIST_SOURCES = $(mngplay_SOURCES) $(mngplay_static_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
HAS_SDL = @HAS_SDL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
mngplay_LDADD = @mngplay_LDADD@
mngplay_static_LDADD = @mngplay_static_LDADD@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
mngplay_SOURCES = mngplay.c
mngplay_static_SOURCES = mngplay.c
mngplay_static_LDFLAGS = -static
all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
am--refresh:
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
cd $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
mngplay$(EXEEXT): $(mngplay_OBJECTS) $(mngplay_DEPENDENCIES)
@rm -f mngplay$(EXEEXT)
$(LINK) $(mngplay_LDFLAGS) $(mngplay_OBJECTS) $(mngplay_LDADD) $(LIBS)
mngplay-static$(EXEEXT): $(mngplay_static_OBJECTS) $(mngplay_static_DEPENDENCIES)
@rm -f mngplay-static$(EXEEXT)
$(LINK) $(mngplay_static_LDFLAGS) $(mngplay_static_OBJECTS) $(mngplay_static_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mngplay.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
mkdir $(distdir)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am: install-binPROGRAMS
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-info-am
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-compile distclean-generic distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
html-am info info-am install install-am install-binPROGRAMS \
install-data install-data-am install-exec install-exec-am \
install-info install-info-am install-man install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-binPROGRAMS uninstall-info-am
# end
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View file

@ -1,27 +0,0 @@
* mngplay *
a simple SDL-based mng player
This is a simple example program, using the Simple Direct media Layer
to display mng animation decoded by the new libmng implementation.
SDL and libmng are quite portable, but I've only tried it on x86 Linux.
Project files for MacOS, BeOS and Win32 are welcome. The code's fairly
rough at this point, but there was no example player for *nix in the
distribution. Patches welcome, of course.
On a unix-like system, the build instructions are simple:
(install and/or build the SDL libraries from libsdl.org)
(install and/or build the mng library from libmng.com)
./configure (or ./autogen.sh if you're using the cvs source)
make
make install
To use the player:
mngplay <filename>.mng
---
Ralph Giles <giles@ashlu.bc.ca>
$Date: 2002/09/26 18:09:37 $

View file

@ -1,34 +0,0 @@
dnl autoconf macros for detecting libmng
dnl add this to your aclocal or acinclude to make use of it
dnl
dnl (c) 2000 Ralph Giles <giles@ashlu.bc.ca>
dnl
dnl A basic check: looks for libmng and its dependencies
dnl and adds the required bits to CFLAGS and LIBS
# check for libmng
AC_DEFUN(LIBMNG_CHECK, [
dnl prerequisites first
AC_CHECK_LIB(jpeg, jpeg_set_defaults)
AC_CHECK_LIB(z, inflate)
dnl now the library
AC_CHECK_LIB(mng, mng_readdisplay, [_libmng_present=1])
AC_CHECK_HEADER(libmng.h)
dnl see if we need the optional link dependency
AC_CHECK_LIB(lcms, cmsCreateRGBProfile, [
AC_CHECK_HEADER(lcms.h)
AC_CHECK_LIB(mng, mnglcms_initlibrary, [
LIBS="$LIBS -llcms"
AC_DEFINE(HAVE_LIBLCMS)
_libmng_present=1
])
])
if test $_libmng_present -eq 1; then
LIBS="-lmng $LIBS"
AC_DEFINE(HAVE_LIBMNG)
fi
_libmng_present=
])
dnl end LIBMNG macros

View file

@ -1,851 +0,0 @@
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION so it can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.9.6])])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is `.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[dnl Rely on autoconf to set up CDPATH properly.
AC_PREREQ([2.50])dnl
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 7
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])
AC_SUBST([$1_FALSE])
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 8
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "GCJ", or "OBJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
# Solaris 8's {/usr,}/bin/sh.
touch sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
case $depmode in
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
none) break ;;
esac
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this.
if depmode=$depmode \
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE(dependency-tracking,
[ --disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
#serial 3
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[for mf in $CONFIG_FILES; do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named `Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# So let's grep whole file.
if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running `make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each `.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 12
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.58])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
# test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" &&
test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AM_PROG_INSTALL_SH
AM_PROG_INSTALL_STRIP
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES(CC)],
[define([AC_PROG_CC],
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_CXX],
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
])
])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$1 | $1:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
install_sh=${install_sh-"$am_aux_dir/install-sh"}
AC_SUBST(install_sh)])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 3
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo done
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# We grep out `Entering directory' and `Leaving directory'
# messages which can occur if `w' ends up in MAKEFLAGS.
# In particular we don't look at `^make:' because GNU make might
# be invoked under some other name (usually "gmake"), in which
# case it prints its new name instead of `make'.
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
am__include=include
am__quote=
_am_result=GNU
fi
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
am__include=.include
am__quote="\""
_am_result=BSD
fi
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it supports --run.
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
AC_MSG_WARN([`missing' script is too old or missing])
fi
])
# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_MKDIR_P
# ---------------
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
#
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
# created by `make install' are always world readable, even if the
# installer happens to have an overly restrictive umask (e.g. 077).
# This was a mistake. There are at least two reasons why we must not
# use `-m 0755':
# - it causes special bits like SGID to be ignored,
# - it may be too restrictive (some setups expect 775 directories).
#
# Do not use -m 0755 and let people choose whatever they expect by
# setting umask.
#
# We cannot accept any implementation of `mkdir' that recognizes `-p'.
# Some implementations (such as Solaris 8's) are not thread-safe: if a
# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
# concurrently, both version can detect that a/ is missing, but only
# one can create it and the other will error out. Consequently we
# restrict ourselves to GNU make (using the --version option ensures
# this.)
AC_DEFUN([AM_PROG_MKDIR_P],
[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
# We used to keeping the `.' as first argument, in order to
# allow $(mkdir_p) to be used without argument. As in
# $(mkdir_p) $(somedir)
# where $(somedir) is conditionally defined. However this is wrong
# for two reasons:
# 1. if the package is installed by a user who cannot write `.'
# make install will fail,
# 2. the above comment should most certainly read
# $(mkdir_p) $(DESTDIR)$(somedir)
# so it does not work when $(somedir) is undefined and
# $(DESTDIR) is not.
# To support the latter case, we have to write
# test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
# so the `.' trick is pointless.
mkdir_p='mkdir -p --'
else
# On NextStep and OpenStep, the `mkdir' command does not
# recognize any option. It will interpret all options as
# directories to create, and then abort because `.' already
# exists.
for d in ./-p ./--version;
do
test -d $d && rmdir $d
done
# $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
if test -f "$ac_aux_dir/mkinstalldirs"; then
mkdir_p='$(mkinstalldirs)'
else
mkdir_p='$(install_sh) -d'
fi
fi
AC_SUBST([mkdir_p])])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 3
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# ------------------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
# _AM_SET_OPTIONS(OPTIONS)
# ----------------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT(yes)])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in `make install-strip', and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'. However `strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the `STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of `v7', `ustar', or `pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility.
AM_MISSING_PROG([AMTAR], [tar])
m4_if([$1], [v7],
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
[m4_case([$1], [ustar],, [pax],,
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
# Do not fold the above two line into one, because Tru64 sh and
# Solaris sh will not grok spaces in the rhs of `-'.
for _am_tool in $_am_tools
do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar;
do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar <conftest.tar])
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([acinclude.m4])

View file

@ -1,54 +0,0 @@
[The end of this file is the result of the following command, executed
under tcsh:
(time /bin/sh autogen.sh) >>&! autogen.log &
If you have automake and autoconf, the following minimal set of files
is sufficient to rerun the autogen.sh script:
Makefile.am
acinclude.m4
autogen.sh
configure.in
mngplay.c
It will then create the following files:
aclocal.m4
mkinstalldirs [symbolic link to utility supplied with automake]
missing [symbolic link to utility supplied with automake]
install-sh [symbolic link to utility supplied with automake]
Makefile.in
configure
The following documentation files are also part of mngplay:
AUTHORS
COPYING
ChangeLog
INSTALL
README
I have replaced the symbolic links with copies of the actual utilities and
included all files in order to match the instructions in the INSTALL file.
Either run configure and make in the usual manner, or, if you prefer, rerun
autogen.sh from scratch and then run configure and make.
Greg Roelofs, 20010708
]
------------------------------------------------------------------------------
If you wish to pass any options to configure, please specify them on the
`autogen.sh' command line.
For example use --prefix= to specify the install directory.
processing .
Running aclocal ...
Running automake --foreign ...
automake: configure.in: installing `./install-sh'
automake: configure.in: installing `./mkinstalldirs'
automake: configure.in: installing `./missing'
Running autoconf ...
Skipping configure process.
1.370u 0.220s 0:03.32 47.8% 0+0k 0+0io 3201pf+0w

View file

@ -1,135 +0,0 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
PKGNAME="mngplay"
# GRR 20010708: added this; just want to create configure script, not run it:
NOCONFIGURE="true"
am_opt="--foreign"
DIE=0
# try to guess the proper treetop
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
(test -f $srcdir/configure.in \
&& test -f $srcdir/mngplay.c) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level $PKGNAME directory"
exit 1
}
# check for autoconf
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`autoconf' installed to compile $PKGNAME."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
# check for automake
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`automake' installed to compile $PKGNAME."
echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
echo "(or a newer version if it is available)."
DIE=1
NO_AUTOMAKE=yes
}
# if no automake, don't bother testing for aclocal
test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
echo "installed doesn't appear recent enough."
echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
echo "(or a newer version if it is available)."
DIE=1
}
if test "$DIE" -eq 1; then
exit 1
fi
if test -z "$*"; then
echo
echo "If you wish to pass any options to configure, please specify them on the"
echo \`$0\'" command line."
echo "For example use --prefix= to specify the install directory."
echo
fi
case $CC in
xlc )
am_opt="$(am_opt) --include-deps";;
esac
for coin in `find $srcdir -name configure.in -print`
do
dr=`dirname $coin`
if test -f $dr/NO-AUTO-GEN; then
echo skipping $dr -- flagged as no auto-gen
else
echo processing $dr
macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
( cd $dr
aclocalinclude="$ACLOCAL_FLAGS"
for k in $macrodirs; do
if test -d $k; then
aclocalinclude="$aclocalinclude -I $k"
##else
## echo "**Warning**: No such directory \`$k'. Ignored."
fi
done
if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then
if grep "sed.*POTFILES" configure.in >/dev/null; then
: do nothing -- we still have an old unmodified configure.in
else
echo "Creating $dr/aclocal.m4 ..."
test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
echo "Running gettextize... Ignore non-fatal messages."
echo "no" | gettextize --force --copy
echo "Making $dr/aclocal.m4 writable ..."
test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
fi
fi
if grep "^AM_GNOME_GETTEXT" configure.in >/dev/null; then
echo "Creating $dr/aclocal.m4 ..."
test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
echo "Running gettextize... Ignore non-fatal messages."
echo "no" | gettextize --force --copy
echo "Making $dr/aclocal.m4 writable ..."
test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
fi
if grep "^AC_PROG_LIBTOOL" configure.in >/dev/null; then
echo "Running libtoolize..."
libtoolize --force --copy
fi
echo "Running aclocal $aclocalinclude ..."
aclocal $aclocalinclude
if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
echo "Running autoheader..."
autoheader
fi
echo "Running automake $am_opt ..."
automake --add-missing $am_opt
echo "Running autoconf ..."
autoconf
)
fi
done
#conf_flags="--enable-maintainer-mode --enable-debug "
if test x$NOCONFIGURE = x; then
echo Running $srcdir/configure $conf_flags "$@" ...
$srcdir/configure $conf_flags "$@"
else
echo Skipping configure process.
fi
# end

File diff suppressed because it is too large Load diff

View file

@ -1,35 +0,0 @@
dnl Process this file with autoconf to produce a configure script.
dnl Version of this release
VERSION=0.1
AC_INIT(mngplay.c)
AM_INIT_AUTOMAKE(mngplay, $VERSION)
dnl AC_CANONICAL_SYSTEM
AC_LANG_C
dnl Checks for programs.
AC_PROG_CC
dnl Checks for header files.
AC_HEADER_STDC
dnl check for Simple Direct Media Layer
AC_CHECK_PROG(HAS_SDL, sdl-config, yes)
if test "x$HAS_SDL" != "xyes"; then
AC_MSG_ERROR([ SDL library not found!
You need this for any display to happen. (rather the point)
You can get a copy at <http://libsdl.org/>])
fi
CFLAGS="$CFLAGS `sdl-config --cflags`"
mngplay_LDADD="`sdl-config --libs`"
mngplay_static_LDADD="`sdl-config --static-libs`"
AC_SUBST(mngplay_LDADD)
AC_SUBST(mngplay_static_LDADD)
dnl check for libmng - macro in acinclude.m4
LIBMNG_CHECK()
AC_OUTPUT(Makefile)

View file

@ -1,530 +0,0 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2005-07-09.11
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test -f "$tmpdepfile"; then :
else
stripped=`echo "$stripped" | sed 's,^.*/,,'`
tmpdepfile="$stripped.u"
fi
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
outname="$stripped.o"
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mecanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View file

@ -1,323 +0,0 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2005-05-14.22
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
chmodcmd="$chmodprog 0755"
chowncmd=
chgrpcmd=
stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=
dst=
dir_arg=
dstarg=
no_target_directory=
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
-c (ignored)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
--help display this help and exit.
--version display version info and exit.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
while test -n "$1"; do
case $1 in
-c) shift
continue;;
-d) dir_arg=true
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
--help) echo "$usage"; exit $?;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t) dstarg=$2
shift
shift
continue;;
-T) no_target_directory=true
shift
continue;;
--version) echo "$0 $scriptversion"; exit $?;;
*) # When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
test -n "$dir_arg$dstarg" && break
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dstarg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
shift # fnord
fi
shift # arg
dstarg=$arg
done
break;;
esac
done
if test -z "$1"; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src ;;
esac
if test -n "$dir_arg"; then
dst=$src
src=
if test -d "$dst"; then
mkdircmd=:
chmodcmd=
else
mkdircmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dstarg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dstarg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst ;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dstarg: Is a directory" >&2
exit 1
fi
dst=$dst/`basename "$src"`
fi
fi
# This sed command emulates the dirname command.
dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# Skip lots of stat calls in the usual case.
if test ! -d "$dstdir"; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
shift
IFS=$oIFS
pathcomp=
while test $# -ne 0 ; do
pathcomp=$pathcomp$1
shift
if test ! -d "$pathcomp"; then
$mkdirprog "$pathcomp"
# mkdir can fail with a `File exist' error in case several
# install-sh are creating the directory concurrently. This
# is OK.
test -d "$pathcomp" || exit
fi
pathcomp=$pathcomp/
done
fi
if test -n "$dir_arg"; then
$doit $mkdircmd "$dst" \
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
else
dstfile=`basename "$dst"`
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
trap '(exit $?); exit' 1 2 13 15
# Copy the file name to the temp name.
$doit $cpprog "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
if test -f "$dstdir/$dstfile"; then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|| {
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit 1
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
}
}
fi || { (exit 1); exit 1; }
done
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); exit 0
}
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View file

@ -1,360 +0,0 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2005-06-08.21
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case "$1" in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
tar)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
tar)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View file

@ -1,507 +0,0 @@
/*
mngplay
$Date: 2003/12/07 09:45:16 $
Ralph Giles <giles :at: ashlu.bc.ca>
This program my be redistributed under the terms of the
GNU General Public Licence, version 2, or at your preference,
any later version.
(this assuming there's no problem with libmng not being GPL...)
this is an SDL based mng player. the code is very rough;
patches welcome.
GRR 20010708: added SDL/libmng/zlib/libjpeg version info, mouse-click
handling (alternate quit mode); improved automake setup
Raphael Assenat <raph :at: raphnet.net>
2003/11/26: added command line options to run in alternate color depths.
*/
#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>
#include <libmng.h>
#include <libgen.h> // basename
#define DEFAULT_SDL_VIDEO_DEPTH 32
/* structure for keeping track of our mng stream inside the callbacks */
typedef struct {
FILE *file; /* pointer to the file we're decoding */
char *filename; /* pointer to the file's path/name */
SDL_Surface *surface; /* SDL display */
mng_uint32 delay; /* ticks to wait before resuming decode */
int sdl_video_depth; /* The depth for SDL_SetVideoMode */
} mngstuff;
/* callbacks for the mng decoder */
/* memory allocation; data must be zeroed */
mng_ptr mymngalloc(mng_uint32 size)
{
return (mng_ptr)calloc(1, size);
}
/* memory deallocation */
void mymngfree(mng_ptr p, mng_uint32 size)
{
free(p);
return;
}
mng_bool mymngopenstream(mng_handle mng)
{
mngstuff *mymng;
/* look up our stream struct */
mymng = (mngstuff*)mng_get_userdata(mng);
/* open the file */
mymng->file = fopen(mymng->filename, "rb");
if (mymng->file == NULL) {
fprintf(stderr, "unable to open '%s'\n", mymng->filename);
return MNG_FALSE;
}
return MNG_TRUE;
}
mng_bool mymngclosestream(mng_handle mng)
{
mngstuff *mymng;
/* look up our stream struct */
mymng = (mngstuff*)mng_get_userdata(mng);
/* close the file */
fclose(mymng->file);
mymng->file = NULL; /* for safety */
return MNG_TRUE;
}
/* feed data to the decoder */
mng_bool mymngreadstream(mng_handle mng, mng_ptr buffer,
mng_uint32 size, mng_uint32 *bytesread)
{
mngstuff *mymng;
/* look up our stream struct */
mymng = (mngstuff*)mng_get_userdata(mng);
/* read the requested amount of data from the file */
*bytesread = fread(buffer, 1, size, mymng->file);
return MNG_TRUE;
}
/* the header's been read. set up the display stuff */
mng_bool mymngprocessheader(mng_handle mng,
mng_uint32 width, mng_uint32 height)
{
mngstuff *mymng;
SDL_Surface *screen;
char title[256];
// fprintf(stderr, "our mng is %dx%d\n", width,height);
/* retreive our user data */
mymng = (mngstuff*)mng_get_userdata(mng);
screen = SDL_SetVideoMode(width,height, mymng->sdl_video_depth, SDL_SWSURFACE);
if (screen == NULL) {
fprintf(stderr, "unable to allocate %dx%d video memory: %s\n",
width, height, SDL_GetError());
return MNG_FALSE;
}
printf("SDL Video Mode: %dx%d bpp=%d\n", width, height, mymng->sdl_video_depth);
/* save the surface pointer */
mymng->surface = screen;
/* set a descriptive window title */
snprintf(title, 256, "mngplay: %s", mymng->filename);
SDL_WM_SetCaption(title, "mngplay");
/* in necessary, lock the drawing surface to the decoder
can safely fill it. We'll unlock elsewhere before display */
if (SDL_MUSTLOCK(mymng->surface)) {
if ( SDL_LockSurface(mymng->surface) < 0 ) {
fprintf(stderr, "could not lock display surface\n");
exit(1);
}
}
/*
printf("RGBA Masks: %08X %08X %08X %08X\n",
mymng->surface->format->Rmask,
mymng->surface->format->Gmask,
mymng->surface->format->Bmask,
mymng->surface->format->Amask);
printf("RGBA Shifts: %08X %08X %08X %08X\n",
mymng->surface->format->Rshift,
mymng->surface->format->Gshift,
mymng->surface->format->Bshift,
mymng->surface->format->Ashift);
*/
/* Choose a canvas style which matches the SDL_Surface pixel format */
switch(mymng->surface->format->BitsPerPixel)
{
case 32:
if (mymng->surface->format->Amask==0) {
/* No alpha (padding byte) */
if (mymng->surface->format->Bshift==0) {
/* Blue first */
mng_set_canvasstyle(mng, MNG_CANVAS_BGRX8);
} else {
/* Red first */
fprintf(stderr, "No matching mng canvas for sdl pixel format. Colors may be wrong.\n");
mng_set_canvasstyle(mng, MNG_CANVAS_BGRX8);
}
}
else {
/* Real alpha */
if (mymng->surface->format->Bshift==0) {
/* Blue first */
mng_set_canvasstyle(mng, MNG_CANVAS_BGRA8);
} else {
/* Red first */
mng_set_canvasstyle(mng, MNG_CANVAS_RGBA8);
}
}
break;
case 24:
if (mymng->surface->format->Amask==0) {
/* No alpha here should mean true rgb24bit */
if (mymng->surface->format->Bshift==0) {
/* Blue first */
mng_set_canvasstyle(mng, MNG_CANVAS_BGR8);
} else {
/* Red first */
mng_set_canvasstyle(mng, MNG_CANVAS_RGB8);
}
}
else {
/* If there is an alpha and we are in 24 bpp, this must
* mean rgb5658 */
if (mymng->surface->format->Bshift==0) {
/* Blue first */
mng_set_canvasstyle(mng, MNG_CANVAS_BGRA565);
} else {
/* Red first */
mng_set_canvasstyle(mng, MNG_CANVAS_RGBA565);
}
}
break;
case 16:
if (mymng->surface->format->Bshift==0) {
/* Blue first */
mng_set_canvasstyle(mng, MNG_CANVAS_BGR565);
} else {
/* Red first */
mng_set_canvasstyle(mng, MNG_CANVAS_RGB565);
}
break;
default:
return MNG_FALSE;
}
return MNG_TRUE;
}
/* return a row pointer for the decoder to fill */
mng_ptr mymnggetcanvasline(mng_handle mng, mng_uint32 line)
{
mngstuff *mymng;
SDL_Surface *surface;
mng_ptr row;
/* dereference our structure */
mymng = (mngstuff*)mng_get_userdata(mng);
/* we assume any necessary locking has happened
outside, in the frame level code */
row = mymng->surface->pixels + mymng->surface->pitch*line;
// fprintf(stderr, " returning pointer to line %d (%p)\n", line, row);
return (row);
}
/* timer */
mng_uint32 mymnggetticks(mng_handle mng)
{
mng_uint32 ticks;
ticks = (mng_uint32)SDL_GetTicks();
// fprintf(stderr, " %d\t(returning tick count)\n",ticks);
return(ticks);
}
mng_bool mymngrefresh(mng_handle mng, mng_uint32 x, mng_uint32 y,
mng_uint32 w, mng_uint32 h)
{
mngstuff *mymng;
SDL_Rect frame;
frame.x = x;
frame.y = y;
frame.w = w;
frame.h = h;
/* dereference our structure */
mymng = (mngstuff*)mng_get_userdata(mng);
/* if necessary, unlock the display */
if (SDL_MUSTLOCK(mymng->surface)) {
SDL_UnlockSurface(mymng->surface);
}
/* refresh the screen with the new frame */
SDL_UpdateRects(mymng->surface, 1, &frame);
/* in necessary, relock the drawing surface */
if (SDL_MUSTLOCK(mymng->surface)) {
if ( SDL_LockSurface(mymng->surface) < 0 ) {
fprintf(stderr, "could not lock display surface\n");
return MNG_FALSE;
}
}
return MNG_TRUE;
}
/* interframe delay callback */
mng_bool mymngsettimer(mng_handle mng, mng_uint32 msecs)
{
mngstuff *mymng;
// fprintf(stderr," pausing for %d ms\n", msecs);
/* look up our stream struct */
mymng = (mngstuff*)mng_get_userdata(mng);
/* set the timer for when the decoder wants to be woken */
mymng->delay = msecs;
return MNG_TRUE;
}
mng_bool mymngerror(mng_handle mng, mng_int32 code, mng_int8 severity,
mng_chunkid chunktype, mng_uint32 chunkseq,
mng_int32 extra1, mng_int32 extra2, mng_pchar text)
{
mngstuff *mymng;
char chunk[5];
/* dereference our data so we can get the filename */
mymng = (mngstuff*)mng_get_userdata(mng);
/* pull out the chuck type as a string */
// FIXME: does this assume unsigned char?
chunk[0] = (char)((chunktype >> 24) & 0xFF);
chunk[1] = (char)((chunktype >> 16) & 0xFF);
chunk[2] = (char)((chunktype >> 8) & 0xFF);
chunk[3] = (char)((chunktype ) & 0xFF);
chunk[4] = '\0';
/* output the error */
fprintf(stderr, "error playing '%s' chunk %s (%d):\n",
mymng->filename, chunk, chunkseq);
fprintf(stderr, "%s\n", text);
return (0);
}
int mymngquit(mng_handle mng)
{
mngstuff *mymng;
/* dereference our data so we can free it */
mymng = (mngstuff*)mng_get_userdata(mng);
/* cleanup. this will call mymngclosestream */
mng_cleanup(&mng);
/* free our data */
free(mymng);
/* quit */
exit(0);
}
int checkevents(mng_handle mng)
{
SDL_Event event;
/* check if there's an event pending */
if (!SDL_PollEvent(&event)) {
return 0; /* no events pending */
}
/* we have an event; process it */
switch (event.type) {
case SDL_QUIT:
mymngquit(mng); /* quit */
break;
case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP:
mymngquit(mng);
break;
case SDL_KEYUP:
switch (event.key.keysym.sym) {
case SDLK_ESCAPE:
case SDLK_q:
mymngquit(mng);
break;
}
/* FALL THROUGH */
default:
return 1;
}
return 0; /* GRR ADDED: non-void function */
}
int main(int argc, char *argv[])
{
mngstuff *mymng;
mng_handle mng;
SDL_Rect updaterect;
if (argc < 2) {
const SDL_version *pSDLver = SDL_Linked_Version();
fprintf(stderr, "Usage: %s mngfile [depth]\n\n", basename(argv[0]));
fprintf(stderr, " where 'depth' is 15,16,24 or 32\n");
fprintf(stderr,
" Compiled with SDL %d.%d.%d; using SDL %d.%d.%d.\n",
SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL,
pSDLver->major, pSDLver->minor, pSDLver->patch);
fprintf(stderr, " Compiled with libmng %s; using libmng %s.\n",
MNG_VERSION_TEXT, mng_version_text());
fprintf(stderr, " Compiled with zlib %s; using zlib %s.\n",
ZLIB_VERSION, zlib_version);
#ifdef JPEG_LIB_VERSION
{
int major = JPEG_LIB_VERSION / 10;
int minor = JPEG_LIB_VERSION % 10;
char minoralpha[2];
if (minor) {
minoralpha[0] = (char)(minor - 1 + 'a');
minoralpha[1] = '\0';
} else
minoralpha[0] = '\0';
fprintf(stderr, " Compiled with libjpeg %d%s.\n",
major, minoralpha);
}
#endif
fprintf(stderr,
"\nPress Esc or Q, or click mouse button, to quit.\n");
exit(1);
}
/* allocate our stream data structure */
mymng = (mngstuff*)calloc(1, sizeof(*mymng));
if (mymng == NULL) {
fprintf(stderr, "could not allocate stream structure.\n");
exit(0);
}
/* pass the name of the file we want to play */
mymng->filename = argv[1];
/* pass the color depth we wish to use */
if (argc>=3) {
mymng->sdl_video_depth = atoi(argv[2]);
switch(mymng->sdl_video_depth) {
case 15:
case 16:
case 24:
case 32:
break;
default:
fprintf(stderr, "Unsupported color depth. Choices are: 15, 16, 24 and 32\n");
exit(1);
}
}
else {
mymng->sdl_video_depth = DEFAULT_SDL_VIDEO_DEPTH;
}
/* set up the mng decoder for our stream */
mng = mng_initialize(mymng, mymngalloc, mymngfree, MNG_NULL);
if (mng == MNG_NULL) {
fprintf(stderr, "could not initialize libmng.\n");
exit(1);
}
/* set the callbacks */
mng_setcb_errorproc(mng, mymngerror);
mng_setcb_openstream(mng, mymngopenstream);
mng_setcb_closestream(mng, mymngclosestream);
mng_setcb_readdata(mng, mymngreadstream);
mng_setcb_gettickcount(mng, mymnggetticks);
mng_setcb_settimer(mng, mymngsettimer);
mng_setcb_processheader(mng, mymngprocessheader);
mng_setcb_getcanvasline(mng, mymnggetcanvasline);
mng_setcb_refresh(mng, mymngrefresh);
/* FIXME: should check for errors here */
/* initialize SDL */
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
fprintf(stderr, "%s: Unable to initialize SDL (%s)\n",
argv[0], SDL_GetError());
exit(1);
}
/* arrange to call the shutdown routine before we exit */
atexit(SDL_Quit);
/* restrict event handling to the relevant bits */
SDL_EventState(SDL_KEYDOWN, SDL_IGNORE); /* keyup only */
SDL_EventState(SDL_MOUSEMOTION, SDL_IGNORE);
// SDL_EventState(SDL_MOUSEBUTTONDOWN, SDL_IGNORE);
// SDL_EventState(SDL_MOUSEBUTTONUP, SDL_IGNORE);
// fprintf(stderr, "playing mng...maybe.\n");
mng_readdisplay(mng);
/* loop though the frames */
while (mymng->delay) {
// fprintf(stderr, " waiting for %d ms\n", mymng->delay);
SDL_Delay(mymng->delay);
/* reset the delay in case the decoder
doesn't update it again */
mymng->delay = 0;
mng_display_resume(mng);
/* check for user input (just quit at this point) */
checkevents(mng);
}
/* ¿hay alguno? pause before quitting */
fprintf(stderr, "pausing before shutdown...\n");
SDL_Delay(1000);
/* cleanup and quit */
mymngquit(mng);
}

View file

@ -1,20 +0,0 @@
PROC=athlon
CFLAGS=-g -Wall -O2 -march=$(PROC) -mcpu=$(PROC)
MOTIFLIB=/usr/local/lesstif/lib
MOTIFINC=/usr/local/lesstif/include
MNGLIB=-lmng
LIBS=-L/usr/X11R6/lib -L$(MOTIFLIB) -lXm -lXt -lX11 $(MNGLIB) -lm
INC=-I/usr/X11R6/include -I$(MOTIFINC)
CC=gcc
LDFLAGS=
all: clean compile
compile:
$(CC) $(CFLAGS) $(INC) color.c xmngview.c -o xmngview $(LIBS)
clean:
rm -f xmngview core
install:
cp -a xmngview /usr/local/bin/xmngview

View file

@ -1,23 +0,0 @@
Program:
========
'xmngview' displays MNG/JNG/PNG files. The program can be called
xmngview
xmngview filename
This program is used within a plugin library for a browser:
xmngview -wWINDOWID -bgBGPIXEL filename
Limitations:
============
needs Lesstif/Motif, i.e. '-lXm -lXt -lX11'.
depth >= 8 (tested with 8bpp, 16bpp, 24bpp)
perhaps INTEL only
perhaps LINUX only
libmng:
=======
read the first lines of xmngview.c
szukw000, March 2003

View file

@ -1,645 +0,0 @@
/*
* This code is mainly code I have found in
* ida-0.14 Gerd Knorr <kraxel@bytesex.org>
* http://bytesex.org/ida
* Ida is a small and fast image viewer, motif-based.
*
* Copyright (C) 2002 Gerd Knorr <kraxel@bytesex.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <libmng.h>
#include <assert.h>
#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
#include <X11/extensions/XShm.h>
#include "xmng.h"
static void (*dither_line)(unsigned char *src, unsigned char *dest,
unsigned int y, unsigned int width);
static void dither_line_gray(unsigned char *src, unsigned char *dest,
unsigned int y, unsigned int width);
static void dither_line_color(unsigned char *src, unsigned char *dest,
unsigned int y, unsigned int width);
static void init_dither(int shades_r, int shades_g, int shades_b,
int shades_gray);
static XVisualInfo *vis_info;
/* PseudoColor: ditherresult => colormap-entry
*/
static int x11_colors;
static int x11_grays;
static unsigned long *x11_map;
static unsigned long x11_map_color[256];
static unsigned long x11_map_gray[64];
static unsigned long x11_red;
static unsigned long x11_green;
static unsigned long x11_blue;
static int try_red[] = {4, 6, 6, 5, 4};
static int try_green[] = {8, 6, 6, 5, 4};
static int try_blue[] = {4, 6, 4, 5, 4};
/* TrueColor: r,g,b => X11-color
*/
static unsigned long x11_lut_red[256];
static unsigned long x11_lut_green[256];
static unsigned long x11_lut_blue[256];
static unsigned long x11_lut_gray[256];
#define x11_black x11_map_gray[0]
#define x11_gray x11_map_gray[47*x11_grays/64]
#define x11_lightgray x11_map_gray[55*x11_grays/64]
#define x11_white x11_map_gray[63*x11_grays/64]
static int x11_alloc_grays(Display * dpy, Colormap cmap, unsigned long *colors,
int gray)
{
XColor akt_color;
int i, upb;
upb = gray - 1;
for (i = 0; i < gray; i++)
{
/* FIXME: original code
akt_color.red = i * 65535 / upb;
akt_color.green = i * 65535 / upb;
akt_color.blue = i * 65535 / upb;
*/
akt_color.red = i * 255 / upb;
akt_color.green = i * 255 / upb;
akt_color.blue = i * 255 / upb;
if (!XAllocColor(dpy, cmap, &akt_color))
{
/* no free color cell available
*/
XFreeColors(dpy, cmap, colors, i, 0);
return 1;
}
colors[i] = akt_color.pixel;
}
return 0;
}
static int x11_alloc_colorcube(Display * dpy, Colormap cmap,
unsigned long *colors, int red, int green, int blue)
{
XColor akt_color;
int i, upb_r, upb_g, upb_b;
upb_r = red - 1; upb_g = green - 1; upb_b = blue - 1;
for (i = 0; i < red * green * blue; i++)
{
akt_color.red = ((i / (green * blue)) % red) * 65535 / upb_r;
akt_color.green = ((i / blue) % green) * 65535 / upb_g;
akt_color.blue = (i % blue) * 65535 / upb_b;
if (!XAllocColor(dpy, cmap, &akt_color))
{
/* no free color cell available
*/
XFreeColors(dpy, cmap, colors, i, 0);
return 1;
}
colors[i] = akt_color.pixel;
}
return 0;
}
static unsigned long x11_alloc_color(Display * dpy, Colormap cmap, int red,
int green, int blue)
{
XColor akt_color;
akt_color.red = red;
akt_color.green = green;
akt_color.blue = blue;
XAllocColor(dpy, cmap, &akt_color);
return akt_color.pixel;
}
static void x11_create_lut(unsigned long red_mask,
unsigned long green_mask,
unsigned long blue_mask)
{
int rgb_red_bits = 0;
int rgb_red_shift = 0;
int rgb_green_bits = 0;
int rgb_green_shift = 0;
int rgb_blue_bits = 0;
int rgb_blue_shift = 0;
int i;
unsigned long mask;
for (i = 0; i < 24; i++)
{
mask = (1 << i);
if (red_mask & mask)
rgb_red_bits++;
else
if (!rgb_red_bits)
rgb_red_shift++;
if (green_mask & mask)
rgb_green_bits++;
else
if (!rgb_green_bits)
rgb_green_shift++;
if (blue_mask & mask)
rgb_blue_bits++;
else
if (!rgb_blue_bits)
rgb_blue_shift++;
}
for (i = 0; i < 256; i++)
{
x11_lut_red[i] = (i >> (8 - rgb_red_bits)) << rgb_red_shift;
x11_lut_green[i] = (i >> (8 - rgb_green_bits)) << rgb_green_shift;
x11_lut_blue[i] = (i >> (8 - rgb_blue_bits)) << rgb_blue_shift;
x11_lut_gray[i] =
x11_lut_red[i] | x11_lut_green[i] | x11_lut_blue[i];
}
}
void x11_init_color(ImageInfo *img)
{
Colormap cmap;
XVisualInfo vis_template;
int found, vis_class;
unsigned int i;
Display *dpy;
dpy = img->dpy;
cmap = DefaultColormap(dpy, DefaultScreen(dpy));
if (0 == x11_grays)
x11_grays = 8;
/* Ask for visual type
*/
vis_template.screen = XDefaultScreen(dpy);
vis_template.visualid =
XVisualIDFromVisual(img->visual);
vis_info =
XGetVisualInfo(dpy, VisualIDMask | VisualScreenMask, &vis_template,
&found);
if (XShmQueryExtension(dpy))
img->have_shmem = 1;
#if defined(__cplusplus) || defined(c_plusplus)
vis_class = vis_info->c_class;
#else
vis_class = vis_info->class;
#endif
if(vis_class == TrueColor)
{
img->gray = 0; /* XXX testing... */
img->display_depth = 4;
img->display_type = TRUECOLOR;
x11_create_lut(vis_info->red_mask, vis_info->green_mask,
vis_info->blue_mask);
x11_black = x11_alloc_color(dpy, cmap, 0, 0, 0);
x11_gray = x11_alloc_color(dpy, cmap, 0xc000, 0xc000, 0xc000);
x11_lightgray = x11_alloc_color(dpy, cmap, 0xe000, 0xe000, 0xe000);
x11_white = x11_alloc_color(dpy, cmap, 0xffff, 0xffff, 0xffff);
}
else
if(vis_class == PseudoColor && vis_info->depth == 8)
{
img->display_depth = 1;
img->display_type = PSEUDOCOLOR;
if (0 != x11_alloc_grays(dpy, cmap, x11_map_gray, x11_grays))
{
fprintf(stderr, "%s:%d:Sorry, can't allocate %d grays\n",
__FILE__,__LINE__,x11_grays);
Viewer_postlude();
exit(1);
}
if (!img->gray)
{
for (i = 0; i < sizeof(try_red) / sizeof(int); i++)
{
if (0 == x11_alloc_colorcube
(dpy, cmap, x11_map_color,
try_red[i], try_green[i], try_blue[i]))
{
x11_colors = try_red[i] * try_green[i] * try_blue[i];
init_dither(try_red[i], try_green[i], try_blue[i], x11_grays);
break;
}
}
if (i == sizeof(try_red) / sizeof(int))
{
img->gray = 1;
fputs("failed to allocate colors, using grayscaled\n", stderr);
}
}
if (img->gray)
init_dither(2, 2, 2, x11_grays);
}
else
if(vis_class == StaticGray || vis_class == GrayScale)
{
img->display_depth = 1;
img->display_type = PSEUDOCOLOR;
x11_grays = 64;
img->gray = 1;
init_dither(2, 2, 2, x11_grays);
if (0 != x11_alloc_grays(dpy, cmap, x11_map_gray, x11_grays))
{
fprintf(stderr, "%s:%d: Sorry, can't allocate %d grays\n",
__FILE__,__LINE__, x11_grays);
Viewer_postlude();
exit(1);
}
}
else
{
fprintf(stderr, "%s:%d: Sorry, can't handle visual\n", __FILE__,__LINE__);
Viewer_postlude();
exit(1);
}
/* some common colors
*/
x11_red = x11_alloc_color(dpy, cmap, 65535, 0, 0);
x11_green = x11_alloc_color(dpy, cmap, 0, 65535, 0);
x11_blue = x11_alloc_color(dpy, cmap, 0, 0, 65535);
if (img->gray)
{
x11_map = x11_map_gray;
dither_line = dither_line_gray;
}
else
{
x11_map = x11_map_color;
dither_line = dither_line_color;
}
}
static int mitshm_bang = 0;
static int x11_error_dev_null(Display * dpy, XErrorEvent * event)
{
mitshm_bang = 1;
return 0;
}
XImage *x11_create_ximage(ImageInfo *img)
{
XImage *ximage = NULL;
unsigned char *data;
XShmSegmentInfo *shminfo = NULL;
int (*old_handler)(Display * dpy, XErrorEvent * event);
if (img->have_shmem)
{
old_handler = XSetErrorHandler(x11_error_dev_null);
img->shm = shminfo = (XShmSegmentInfo*)malloc(sizeof(XShmSegmentInfo));
memset(shminfo, 0, sizeof(XShmSegmentInfo));
ximage = XShmCreateImage(img->dpy,
img->visual,
img->depth,
ZPixmap, NULL,
shminfo, img->img_width, img->img_height);
if (ximage)
{
shminfo->shmid = shmget(IPC_PRIVATE,
ximage->bytes_per_line * ximage->height,
IPC_CREAT | 0777);
if (-1 == shminfo->shmid)
{
fprintf(stderr,"shmget(%dMB): %s\n",
ximage->bytes_per_line * ximage->height / 1024 / 1024,
strerror(errno));
goto oom;
}
shminfo->shmaddr = (char *) shmat(shminfo->shmid, 0, 0);
if ((void *) -1 == shminfo->shmaddr)
{
perror("shmat");
goto oom;
}
ximage->data = shminfo->shmaddr;
shminfo->readOnly = False;
XShmAttach(img->dpy, shminfo);
XSync(img->dpy, False);
shmctl(shminfo->shmid, IPC_RMID, 0);
if (mitshm_bang)
{
img->have_shmem = 0;
shmdt(shminfo->shmaddr);
free(shminfo);
img->shm = shminfo = NULL;
XDestroyImage(ximage);
ximage = NULL;
}
}
else
{
img->have_shmem = 0;
free(shminfo);
img->shm = shminfo = NULL;
}
XSetErrorHandler(old_handler);
}
if (ximage == NULL)
{
img->shm = NULL;
if (NULL == (data = (unsigned char*)
malloc(img->img_width * img->img_height * img->display_depth)))
{
fprintf(stderr,"Oops: out of memory\n");
goto oom;
}
ximage = XCreateImage(img->dpy,
img->visual,
img->depth,
ZPixmap, 0, (char*)data,
img->img_width, img->img_height,
8, 0);
}
memset(ximage->data, 0, ximage->bytes_per_line * ximage->height);
return ximage;
oom:
if (shminfo)
{
if (shminfo->shmid && shminfo->shmid != -1)
shmctl(shminfo->shmid, IPC_RMID, 0);
free(shminfo);
}
if (ximage)
XDestroyImage(ximage);
img->shm = 0;
return NULL;
}
void x11_destroy_ximage(ImageInfo *img)
{
XShmSegmentInfo *shminfo = (XShmSegmentInfo*)img->shm;
if (shminfo)
{
XShmDetach(img->dpy, shminfo);
XDestroyImage(img->ximage);
shmdt(shminfo->shmaddr);
free(shminfo);
}
else
XDestroyImage(img->ximage);
}
/*
* ordered dither routines
*
* stolen from The GIMP and trimmed for speed
*/
#define DITHER_LEVEL 8
static long red_mult, green_mult;
static long red_dither[256];
static long green_dither[256];
static long blue_dither[256];
static long gray_dither[256];
typedef unsigned long vector[DITHER_LEVEL];
typedef vector matrix[DITHER_LEVEL];
#if DITHER_LEVEL == 8
#define DITHER_MASK 7
static matrix origDM =
{
{0, 32, 8, 40, 2, 34, 10, 42},
{48, 16, 56, 24, 50, 18, 58, 26},
{12, 44, 4, 36, 14, 46, 6, 38},
{60, 28, 52, 20, 62, 30, 54, 22},
{3, 35, 11, 43, 1, 33, 9, 41},
{51, 19, 59, 27, 49, 17, 57, 25},
{15, 47, 7, 39, 13, 45, 5, 37},
{63, 31, 55, 23, 61, 29, 53, 21}
};
static matrix DM;
#endif /* DITHER_LEVEL == 8 */
#if DITHER_LEVEL == 4
#define DITHER_MASK 3
static matrix origDM =
{
{0, 8, 2, 10},
{12, 4, 14, 6},
{3, 11, 1, 9},
{15, 7, 13, 5}
};
static matrix DM;
#endif
static void init_dither(int shades_r, int shades_g, int shades_b,
int shades_gray)
{
int i, j;
unsigned char low_shade, high_shade;
unsigned short index;
float red_colors_per_shade;
float green_colors_per_shade;
float blue_colors_per_shade;
float gray_colors_per_shade;
red_mult = shades_g * shades_b;
green_mult = shades_b;
red_colors_per_shade = 256.0 / (shades_r - 1);
green_colors_per_shade = 256.0 / (shades_g - 1);
blue_colors_per_shade = 256.0 / (shades_b - 1);
gray_colors_per_shade = 256.0 / (shades_gray - 1);
/* this avoids a shift when checking these values
*/
memcpy(DM, origDM, sizeof(unsigned long)*DITHER_LEVEL*DITHER_LEVEL);
for (i = 0; i < DITHER_LEVEL; i++)
for (j = 0; j < DITHER_LEVEL; j++)
DM[i][j] *= 0x10000;
/* setup arrays containing three bytes of information for red, green, & blue
* the arrays contain :
* 1st byte: low end shade value
* 2nd byte: high end shade value
* 3rd & 4th bytes: ordered dither matrix index
*/
for (i = 0; i < 256; i++)
{
/* setup the red information
*/
low_shade = (unsigned char) (i / red_colors_per_shade);
high_shade = low_shade + 1;
index = (unsigned short)
(((i - low_shade * red_colors_per_shade) / red_colors_per_shade) *
(DITHER_LEVEL * DITHER_LEVEL + 1));
low_shade *= red_mult;
high_shade *= red_mult;
red_dither[i] = (index << 16) + (high_shade << 8) + (low_shade);
/* setup the green information
*/
low_shade = (unsigned char) (i / green_colors_per_shade);
high_shade = low_shade + 1;
index = (unsigned short)
(((i - low_shade * green_colors_per_shade) / green_colors_per_shade) *
(DITHER_LEVEL * DITHER_LEVEL + 1));
low_shade *= green_mult;
high_shade *= green_mult;
green_dither[i] = (index << 16) + (high_shade << 8) + (low_shade);
/* setup the blue information
*/
low_shade = (unsigned char) (i / blue_colors_per_shade);
high_shade = low_shade + 1;
index = (unsigned short)
(((i - low_shade * blue_colors_per_shade) / blue_colors_per_shade) *
(DITHER_LEVEL * DITHER_LEVEL + 1));
blue_dither[i] = (index << 16) + (high_shade << 8) + (low_shade);
/* setup the gray information
*/
low_shade = (unsigned char) (i / gray_colors_per_shade);
high_shade = low_shade + 1;
index = (unsigned short)
(((i - low_shade * gray_colors_per_shade) / gray_colors_per_shade) *
(DITHER_LEVEL * DITHER_LEVEL + 1));
gray_dither[i] = (index << 16) + (high_shade << 8) + (low_shade);
}
}
static void dither_line_color(unsigned char *src, unsigned char *dest,
unsigned int y, unsigned int width)
{
unsigned long a, b, dval, *ymod;
unsigned int x;
ymod = DM[y & DITHER_MASK];
for(x = 0; x < width; x++)
{
dval = ymod[x & DITHER_MASK];
b = red_dither[src[0]];
if (dval < b)
b >>= 8;
a = green_dither[src[1]];
if (dval < a)
a >>= 8;
b += a;
a = blue_dither[src[2]];
if (dval < a)
a >>= 8;
b += a;
src += RGB_SIZE;
*dest++ = (unsigned char)(b & 0xff);
}
}
static void dither_line_gray(unsigned char *src, unsigned char *dest,
unsigned int y, unsigned int width)
{
unsigned long a, g, *ymod;
unsigned int x;
ymod = DM[y & DITHER_MASK];
for(x = 0; x < width; x++)
{
g = (src[0]*3 + src[1]*6 + src[2]) / 10;
a = gray_dither[g];
src += RGB_SIZE;
if (ymod[x & DITHER_MASK] < a)
a >>= 8;
*dest++ = a & 0xff;
}
}
void viewer_renderline(ImageInfo *img, unsigned char *scanline,
unsigned int row, unsigned int x, unsigned int width)
{
unsigned char *src, *dst;
unsigned long pix;
XImage *ximage;
unsigned int col, max_col;
unsigned short mng_rgb_size;
mng_rgb_size = img->mng_rgb_size;
ximage = img->ximage;
src = scanline;
col = x;
max_col = x + width;
if (img->display_type == PSEUDOCOLOR)
{
dst = img->dither_line;
dither_line(src, dst, row, width);
while(col < max_col)
{
XPutPixel(ximage, col, row, x11_map[dst[0]]);
++col;
++dst;
}
return;
}
/* display_type == TRUECOLOR
*/
while(col < max_col)
{
pix = x11_lut_red[src[0]] | x11_lut_green[src[1]] | x11_lut_blue[src[2]];
XPutPixel(ximage, col, row, pix);
++col;
src += RGB_SIZE;
}
}

View file

@ -1,103 +0,0 @@
#ifndef _XMNG_H_
#define _XMNG_H
#define RGB_SIZE 3
#define CANVAS_RGB8_SIZE 3
#define CANVAS_RGBA8_SIZE 4
#define CANVAS_ARGB8_SIZE 4
#define CANVAS_RGB8_A8_SIZE 4
#define CANVAS_BGR8_SIZE 3
#define CANVAS_BGRA8_SIZE 4
#define CANVAS_BGRA8PM_SIZE 4
#define CANVAS_ABGR8_SIZE 4
#define MNG_MAGIC "\x8aMNG\x0d\x0a\x1a\x0a"
#define JNG_MAGIC "\x8bJNG\x0d\x0a\x1a\x0a"
#define PNG_MAGIC "\x89PNG\x0d\x0a\x1a\x0a"
#define PSEUDOCOLOR 1
#define TRUECOLOR 2
#define MNG_TYPE 1
#define JNG_TYPE 2
#define PNG_TYPE 3
#define SPACE_X 10
#define SPACE_Y 10
#define BUT_ENTRY_BORDER 0
#define FRAME_SHADOW_WIDTH 2
#define ANY_WIDTH 4
#define OK MNG_NOERROR
#define MAX_COLORBUF 64
typedef struct
{
unsigned int frozen:1;
unsigned int restarted:1;
unsigned int stopped:1;
unsigned int single_step_wanted:1;
unsigned int single_step_served:1;
unsigned int has_bg_color:1;
unsigned int has_bg_pixel:1;
unsigned int x11_init:1;
unsigned int timer_active:1;
mng_handle user_handle;
Widget canvas;
int type;
XtIntervalId timeout_ID;
mng_uint32 counter;
mng_uint32 delay;
mng_uint32 img_width, img_height;
mng_uint32 read_len;
mng_uint32 read_pos;
unsigned char *read_buf;
unsigned char *mng_buf;
unsigned char *dither_line;
Window external_win;
Window frame_win;
Window control_win;
GC gc;
Display *dpy;
Window win;
unsigned short mng_rgb_size;
unsigned short mng_bytes_per_line;
XImage *ximage;
int src_x, src_y;
int dst_x, dst_y;
unsigned int frame_w, frame_h;
void *shm;
int gray;
int display_depth, display_type;
int have_shmem;
Pixel bg_pixel;
unsigned short xbg_red, xbg_green, xbg_blue;
unsigned char bg_red, bg_green, bg_blue;
Visual *visual;
unsigned int depth;
/* do not free */
struct timeval timer_start;
struct timeval timer_end;
char *read_idf;
FILE *reader;
int *argc_ptr;
char **argv;
char bg_color[MAX_COLORBUF];
} ImageInfo;
#define XPUTIMAGE(dpy,dr,gc,xi,a,b,c,d,w,h) \
if (have_shmem) \
XShmPutImage(dpy,dr,gc,xi,a,b,c,d,w,h,True); \
else \
XPutImage(dpy,dr,gc,xi,a,b,c,d,w,h)
extern void Viewer_postlude(void);
extern XImage *x11_create_ximage(ImageInfo *data);
extern void x11_destroy_ximage(ImageInfo *data);
extern void x11_init_color(ImageInfo *data);
extern void viewer_renderline(ImageInfo *data, unsigned char *scanline,
unsigned int row, unsigned int x, unsigned int width);
#endif

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,555 +0,0 @@
unit Main;
interface
uses
Qt, QExtCtrls, QDialogs, QMenus, QTypes, QGraphics, QControls, QForms,
SysUtils, Classes, QStdCtrls, IdGlobal,
libmng;
{****************************************************************************}
{* For conditions of distribution and use, *}
{* see copyright notice in libmng.pas *}
{****************************************************************************}
{* *}
{* project : libmng *}
{* file : main.pas copyright (c) 2000-2002 G.Juyn *}
{* version : 1.0.5 *}
{* *}
{* purpose : Main form for mngview application *}
{* *}
{* author : G.Juyn *}
{* web : http://www.3-t.com *}
{* email : mailto:info@3-t.com *}
{* *}
{* comment : this is the heart of the mngview applciation *}
{* *}
{* changes : 1.0.5 - 09/21/2002 - G.Juyn *}
{* - modified for Kylix use *}
{* *}
{****************************************************************************}
type
TMainForm = class(TForm)
OFMainMenu: TMainMenu;
OFMenuFile: TMenuItem;
OFMenuFileOpen: TMenuItem;
OFMenuFileN1: TMenuItem;
OFMenuFileExit: TMenuItem;
OFTimer: TTimer;
OFOpenDialog: TOpenDialog;
OFPanel: TPanel;
OFImage: TImage;
procedure FormCreate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure FormShow(Sender: TObject);
procedure FormResize(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure OFImageMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure OFImageMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure OFImageMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure OFTimerTimer(Sender: TObject);
procedure OFMenuFileOpenClick(Sender: TObject);
procedure OFMenuFileExitClick(Sender: TObject);
private
{ Private declarations }
SFFileName : string; { filename of the input stream }
OFFile : TFileStream; { input stream }
IFHandle : mng_handle; { the libray handle }
OFBitmap : TBitmap; { drawing canvas }
BFCancelled : boolean; { <esc> or app-exit }
BFHasMouse : boolean; { mouse is/was over image }
procedure MNGerror (SHMsg : string);
public
{ Public declarations }
end;
var
MainForm: TMainForm;
{****************************************************************************}
implementation
{$R *.dfm}
{****************************************************************************}
{$F+}
function Memalloc (iLen : mng_uint32) : mng_ptr; cdecl;
{$F-}
begin
getmem (Result, iLen); { get memory from the heap }
fillchar (Result^, iLen, 0); { and initialize it }
end;
{****************************************************************************}
{$F+}
procedure Memfree (iPtr : mng_ptr;
iLen : mng_size_t); cdecl;
{$F-}
begin
freemem (iPtr, iLen); { free the memory }
end;
{****************************************************************************}
{$F+}
function Openstream (hHandle : mng_handle) : mng_bool; cdecl;
{$F-}
var OHForm : TMainForm;
begin { get a fix on our form }
OHForm := TMainForm (mng_get_userdata (hHandle));
with OHFORM do
begin
if OFFile <> nil then { free previous stream (if any) }
OFFile.Free;
{ open a new stream }
OFFile := TFileStream.Create (SFFileName, fmOpenRead or fmShareDenyWrite);
end;
Result := MNG_TRUE;
end;
{****************************************************************************}
{$F+}
function Closestream (hHandle : mng_handle) : mng_bool; cdecl;
{$F-}
var OHForm : TMainForm;
begin { get a fix on our form }
OHForm := TMainForm (mng_get_userdata (hHandle));
with OHFORM do
begin
OFFile.Free; { cleanup the stream }
OFFile := nil; { don't use it again ! }
end;
Result := MNG_TRUE;
end;
{****************************************************************************}
{$F+}
function Readdata ( hHandle : mng_handle;
pBuf : mng_ptr;
iBuflen : mng_uint32;
var pRead : mng_uint32) : mng_bool; cdecl;
{$F-}
var OHForm : TMainForm;
begin
{ get a fix on our form }
OHForm := TMainForm (mng_get_userdata (hHandle));
with OHForm do
begin { are we at EOF ? }
if OFFile.Position >= OFFile.Size then
begin
pRead := 0; { indicate so }
end
else
begin
{ read the requested data }
pRead := OFFile.Read (pBuf^, iBuflen);
end;
end;
Result := MNG_TRUE;
end;
{****************************************************************************}
{$F+}
function ProcessHeader (hHandle : mng_handle;
iWidth : mng_uint32;
iHeight : mng_uint32) : mng_bool; cdecl;
{$F-}
var OHForm : TMainForm;
begin { get a fix on our form }
OHForm := TMainForm (mng_get_userdata (hHandle));
with OHForm do
begin
OFBitmap.Width := iWidth; { store the new dimensions }
OFBitmap.Height := iHeight;
OFBitmap.PixelFormat := pf32bit;
OFImage.Left := 0; { adjust the visible component }
OFImage.Top := 0;
OFImage.Width := iWidth;
OFImage.Height := iHeight;
FormResize (OHForm); { force re-centering the image}
{ clear the canvas & draw an outline }
OFBitmap.Canvas.Brush.Color := clGray;
OFBitmap.Canvas.Brush.Style := bsSolid;
OFBitmap.Canvas.FillRect (OFBitmap.Canvas.ClipRect);
OFImage.Picture.Assign (OFBitmap); { make sure it gets out there }
{ tell the library we want funny windows-bgr}
if mng_set_canvasstyle (hHandle, MNG_CANVAS_BGRX8) <> 0 then
MNGerror ('libmng reported an error setting the canvas style');
end;
Result := MNG_TRUE;
end;
{****************************************************************************}
{$F+}
function GetCanvasLine (hHandle : mng_handle;
iLinenr : mng_uint32) : mng_ptr; cdecl;
{$F-}
var OHForm : TMainForm;
begin { get a fix on our form }
OHForm := TMainForm (mng_get_userdata (hHandle));
{ easy with these bitmap objects ! }
Result := TBitmap(OHForm.OFImage.Picture.Graphic).ScanLine [iLinenr];
end;
{****************************************************************************}
{$F+}
function ImageRefresh (hHandle : mng_handle;
iX : mng_uint32;
iY : mng_uint32;
iWidth : mng_uint32;
iHeight : mng_uint32) : mng_bool; cdecl;
{$F-}
var OHForm : TMainForm;
begin { get a fix on our form }
OHForm := TMainForm (mng_get_userdata (hHandle));
{ force redraw }
OHForm.OFImage.Refresh;
Result := MNG_TRUE;
end;
{****************************************************************************}
{$F+}
function MyGetTickCount (hHandle : mng_handle) : mng_uint32; cdecl;
{$F-}
begin
Result := GetTickCount; { the system knows that }
end;
{****************************************************************************}
{$F+}
function SetTimer (hHandle : mng_handle;
iMsecs : mng_uint32) : mng_bool; cdecl;
{$F-}
var OHForm : TMainForm;
begin { get a fix on our form }
OHForm := TMainForm (mng_get_userdata (hHandle));
OHForm.OFTimer.Interval := iMsecs; { and set the timer }
OHForm.OFTimer.Enabled := true;
Result := MNG_TRUE;
end;
{****************************************************************************}
procedure TMainForm.FormCreate(Sender: TObject);
var IHRed, IHGreen, IHBlue : word;
begin { initialize }
OFBitmap := TBitmap.Create;
BFHasMouse := false;
OFFile := nil;
OFOpenDialog.Initialdir := '';
{ now initialize the library }
IFHandle := mng_initialize (mng_ptr(self), Memalloc, Memfree, nil);
if IFHandle = NIL then
begin
MNGerror ('libmng initialization error' + #13#10 +
'Program aborted');
Application.Terminate;
end;
{ no need to store chunk-info ! }
mng_set_storechunks (IFHandle, MNG_FALSE);
{ do not use suspension-buffer }
mng_set_suspensionmode (IFHandle, MNG_FALSE);
{ set all the callbacks }
if (mng_setcb_openstream (IFHandle, Openstream ) <> MNG_NOERROR) or
(mng_setcb_closestream (IFHandle, Closestream ) <> MNG_NOERROR) or
(mng_setcb_readdata (IFHandle, Readdata ) <> MNG_NOERROR) or
(mng_setcb_processheader (IFHandle, ProcessHeader ) <> MNG_NOERROR) or
(mng_setcb_getcanvasline (IFHandle, GetCanvasLine ) <> MNG_NOERROR) or
(mng_setcb_refresh (IFHandle, ImageRefresh ) <> MNG_NOERROR) or
(mng_setcb_gettickcount (IFHandle, MyGetTickCount ) <> MNG_NOERROR) or
(mng_setcb_settimer (IFHandle, SetTimer ) <> MNG_NOERROR) then
begin
MNGerror ('libmng reported an error setting a callback function!' + #13#10 +
'Program aborted');
Application.Terminate;
end;
IHRed := (Color ) and $FF; { supply our own bg-color }
IHGreen := (Color shr 8) and $FF;
IHBlue := (Color shr 16) and $FF;
IHRed := (IHRed shl 8) + IHRed;
IHGreen := (IHGreen shl 8) + IHGreen;
IHBlue := (IHBlue shl 8) + IHBlue;
if mng_set_bgcolor (IFHandle, IHRed, IHGreen, IHBlue) <> MNG_NOERROR then
MNGerror ('libmng reported an error setting the background color!');
end;
{****************************************************************************}
procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
BFCancelled := true;
if OFTimer.Enabled then { if we're still animating then stop it }
begin
OFTimer.Enabled := false;
Application.ProcessMessages;
if mng_reset (IFHandle) <> MNG_NOERROR then
MNGerror ('libmng reported an error during reset!');
end;
mng_cleanup (IFHandle);
end;
{****************************************************************************}
procedure TMainForm.FormShow(Sender: TObject);
begin
FormResize (self);
end;
{****************************************************************************}
procedure TMainForm.FormResize(Sender: TObject);
begin { center the image in the window }
if ClientWidth < OFImage.Width then
OFImage.Left := 0
else
OFImage.Left := (ClientWidth - OFImage.Width ) div 2;
if ClientHeight < OFImage.Height then
OFImage.Top := 0
else
OFImage.Top := (ClientHeight - OFImage.Height) div 2;
end;
{****************************************************************************}
procedure TMainForm.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = Key_Escape then { pressing <esc> will freeze an animation }
begin
if OFTimer.Enabled then
if mng_display_freeze (IFHandle) <> MNG_NOERROR then
MNGerror ('libmng reported an error during display_freeze!');
OFTimer.Enabled := false; { don't let that timer go off then ! }
BFCancelled := true;
end;
end;
{****************************************************************************}
procedure TMainForm.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if mng_status_dynamic (IFHandle) then
begin
if BFHasMouse then { if we had the mouse, it's left ! }
begin
if mng_trapevent (IFHandle, 3, 0, 0) <> MNG_NOERROR then
MNGerror ('libmng reported an error during trapevent!');
BFHasMouse := false;
end;
end;
end;
{****************************************************************************}
procedure TMainForm.OFImageMouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
begin
if mng_status_dynamic (IFHandle) then
begin
if BFHasMouse then { did we have the mouse already ? }
begin
if mng_trapevent (IFHandle, 2, X, Y) <> MNG_NOERROR then
MNGerror ('libmng reported an error during trapevent!');
end
else
begin { if not, it has entered ! }
if mng_trapevent (IFHandle, 1, X, Y) <> MNG_NOERROR then
MNGerror ('libmng reported an error during trapevent!');
BFHasMouse := true;
end;
end;
end;
{****************************************************************************}
procedure TMainForm.OFImageMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if mng_status_dynamic (IFHandle) then
if mng_trapevent (IFHandle, 4, X, Y) <> MNG_NOERROR then
MNGerror ('libmng reported an error during trapevent!');
end;
{****************************************************************************}
procedure TMainForm.OFImageMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if mng_status_dynamic (IFHandle) then
if mng_trapevent (IFHandle, 5, X, Y) <> MNG_NOERROR then
MNGerror ('libmng reported an error during trapevent!');
end;
{****************************************************************************}
procedure TMainForm.OFTimerTimer(Sender: TObject);
var IHRslt : mng_retcode;
begin
OFTimer.Enabled := false; { only once ! }
if not BFCancelled then
begin { and inform the library }
IHRslt := mng_display_resume (IFHandle);
if (IHRslt <> MNG_NOERROR) and (IHRslt <> MNG_NEEDTIMERWAIT) then
MNGerror ('libmng reported an error during display_resume!');
end;
end;
{****************************************************************************}
procedure TMainForm.OFMenuFileOpenClick(Sender: TObject);
var IHRslt : mng_retcode;
begin
OFOpenDialog.InitialDir := '';
OFOpenDialog.FileName := SFFileName;
if OFOpenDialog.Execute then { get the filename }
begin
if OFTimer.Enabled then { if the lib was active; stop it }
begin
OFTimer.Enabled := false;
Application.ProcessMessages; { process any timer requests (for safety) }
{ now freeze the animation }
if mng_reset (IFHandle) <> MNG_NOERROR then
MNGerror ('libmng reported an error during reset!');
end;
{ save interesting fields }
SFFileName := OFOpenDialog.FileName;
BFCancelled := false;
OFImage.Picture.Graphic := nil; { clear the output-canvas }
OFImage.Refresh;
{ always reset (just in case) }
if mng_reset (IFHandle) <> MNG_NOERROR then
MNGerror ('libmng reported an error during reset!')
else
begin { and let the lib do it's job ! }
IHRslt := mng_readdisplay (IFHandle);
if (IHRslt <> MNG_NOERROR) and (IHRSLT <> MNG_NEEDTIMERWAIT) then
MNGerror ('libmng reported an error reading the input file!');
end;
end;
end;
{****************************************************************************}
procedure TMainForm.OFMenuFileExitClick(Sender: TObject);
begin
if mng_cleanup (IFHandle) <> MNG_NOERROR then
MNGerror ('libmng cleanup error');
Close;
end;
{****************************************************************************}
procedure TMainForm.MNGerror;
var iErrorcode : mng_uint32;
iSeverity : mng_uint8;
iChunkname : mng_chunkid;
iChunkseq : mng_uint32;
iExtra1 : mng_int32;
iExtra2 : mng_int32;
zErrortext : mng_pchar;
begin { get extended info }
iErrorcode := mng_getlasterror (IFHandle, iSeverity, iChunkname, iChunkseq,
iExtra1, iExtra2, zErrortext);
MessageDlg (SHMsg + #13#10#13#10 + strpas (zErrortext) + #13#10#13#10 +
Format ('Error = %d; Severity = %d; Chunknr = %d; Extra1 = %d',
[iErrorcode, iSeverity, iChunkseq, iExtra1]),
mtError, [mbOK], 0);
Application.Terminate;
end;
{****************************************************************************}
end.

View file

@ -1,17 +0,0 @@
#!/bin/bash
#
app_install_dir=/data/Triple-T/Software/mnglib3t/libmng-devel/contrib/kylix/mngview
app_path=$app_install_dir/mngview.bin
app_ld_path=$app_install_dir/lib
#
if [ -n "$LD_LIBRARY_PATH" ]; then
export LD_LIBRARY_PATH="$app_ld_path:$LD_LIBRARY_PATH"
else
export LD_LIBRARY_PATH="$app_ld_path"
fi
#
if [ -z "$LANG" ]; then
export LANG="en_US"
fi
#
exec $app_path $*

View file

@ -1,33 +0,0 @@
-$A8
-$B-
-$C+
-$D+
-$E-
-$F-
-$G+
-$H+
-$I+
-$J-
-$K-
-$L+
-$M-
-$N+
-$O+
-$P+
-$Q-
-$R-
-$S-
-$T-
-$U-
-$V+
-$W-
-$X+
-$YD
-$Z1
-cg
-H+
-W+
-M
-$M16384,1048576
-K$00400000
-DCLX_USE_LIBQT

View file

@ -1,17 +0,0 @@
program mngview;
uses
QForms,
Main in 'Main.pas' {MainForm},
libmng in '../libmng.pas';
{$E .bin}
{$R *.res}
begin
Application.Initialize;
Application.Title := 'mngview - libmng test-viewer in Kylix';
Application.CreateForm(TMainForm, MainForm);
Application.Run;
end.

View file

@ -1,61 +0,0 @@
[Compiler]
A=8
B=0
C=1
D=1
E=0
F=0
G=1
H=1
I=1
J=0
K=0
L=1
M=0
N=1
O=1
P=1
Q=0
R=0
S=0
T=0
U=0
V=1
W=0
X=1
Y=1
Z=1
ShowHints=1
ShowWarnings=1
UnitAliases=
[Linker]
MapFile=0
OutputObjs=0
ConsoleApp=1
DebugInfo=0
RemoteSymbols=0
MinStackSize=16384
MaxStackSize=1048576
ImageBase=4194304
ExeDescription=
DynamicLoader=/lib/ld-linux.so.2
[Directories]
OutputDir=
UnitOutputDir=
PackageDLLOutputDir=
PackageDCPOutputDir=
SearchPath=
Packages=baseclx:visualclx:dataclx:visualdbclx:netclx:netdataclx:xmlrtl:indy:webdsnapclx:websnapclx
Conditionals=CLX_USE_LIBQT
DebugSourceDirs=
UsePackages=0
[Parameters]
RunParams=
HostApplication=
Launcher=/usr/X11R6/bin/xterm -T KylixDebuggerOutput -e bash -i -c %debuggee%
UseLauncher=0
DebugCWD=

View file

@ -1,26 +0,0 @@
.lib & .def files to link an MSVC project against the standard DLL build with BCB.
Please note that this version is created for libmng 1.0.5, but should work with
1.0.6 as there were no API changes between the two versions.
These files are courtesy of Alex Volkov. Here's what he had to say about it:
-------------------------------------------------------------------------------
That reminds me, I remade the MSVC libmng.lib for linking to the
bcb-generated dll. The .lib and its corresponding .def are attached. The
.def I generated by simply dumping all the exports from the bcb .dll and
later added the .def to the contrib/msvc/win32dll project. The .def is
necessary for MSVC to name the imports correctly, otherwise it produces
mangled symbol names. What is ironic is that it is not necessary to
completely build the dll with msvc -- you need just the resulting .lib --
but you still have to setup the entire project for building the dll because of
the stdcall calling convention. The resulting .lib is not perfect -- the hints
are all off, of course -- but it does the job. In any case, the win32 exes
linked with the attached .lib in fact work with bcb-generated dll just fine. I
know the building process can be somehow automated, but I have not had the time
to work on that, and for me it was a one-shot deal.
Alex.
-------------------------------------------------------------------------------

Some files were not shown because too many files have changed in this diff Show more