From 7f193b33048e6c270f7a6cd99dd31a94f03fe26c Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Sat, 12 Jan 2008 22:38:32 +0100 Subject: add flcurve --- .hgignore | 1 + configure.ac | 12 ++++++++++++ src/Makefile.am | 5 ++++- src/flcurve.cxx | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 src/flcurve.cxx diff --git a/.hgignore b/.hgignore index af2979d..443fd19 100644 --- a/.hgignore +++ b/.hgignore @@ -23,3 +23,4 @@ stamp-h1 missing tags pnmlcms +flcurve diff --git a/configure.ac b/configure.ac index 2476943..fd814ac 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,7 @@ LDFLAGS="-g $LDFLAGS" AC_PROG_CC AC_LANG_C +AC_LANG_CPLUSPLUS # Checks for libraries. @@ -36,6 +37,17 @@ AC_FUNC_REALLOC AC_TYPE_SIGNAL AC_CHECK_FUNCS([strchr strdup strrchr strstr]) +# Check for fltk +AC_PATH_PROG(FLTKCONFIG,fltk-config) +if test "x$FLTKCONFIG" = x; then + echo "fltk-config not found" + exit 1 +fi + +CXXFLAGS="`$FLTKCONFIG --use-images --cflags` $CXXFLAGS" +LIBS="`$FLTKCONFIG --use-images --ldflags` $LIBS" + + # Check for lcms AC_CHECK_HEADERS([lcms.h], [], [echo "Error: lcms.h not found."; exit 1;]) AC_CHECK_LIB([lcms], [open], [], [echo "Error: liblcms.so not found."; exit 1;]) diff --git a/src/Makefile.am b/src/Makefile.am index 629a3df..12380e5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -bin_PROGRAMS = pnmlcms +bin_PROGRAMS = pnmlcms flcurve pnmlcms_SOURCES = \ pnmlcms.c \ @@ -6,3 +6,6 @@ pnmlcms_SOURCES = \ noinst_HEADERS = \ pnm.h + +flcurve_SOURCES = \ + flcurve.cxx diff --git a/src/flcurve.cxx b/src/flcurve.cxx new file mode 100644 index 0000000..ca0f8ff --- /dev/null +++ b/src/flcurve.cxx @@ -0,0 +1,55 @@ +// +// Copyright 2008 Johannes Hofmann +// +// This software may be used and distributed according to the terms +// of the GNU General Public License, incorporated herein by reference. + +#include +#include +#include +#include + +#include +#include +#include + +#include <../config.h> + + +void +usage() { + fprintf(stderr, + "flcurve %s\n" + VERSION); +} + +int +main(int argc, char **argv) { + int c, n, i, err; + + while ((c = getopt(argc, argv, "?hs:g:d:f:i:")) != EOF) { + switch (c) { + case '?': + case 'h': + usage(); + exit(0); + default: + i = optind - 1; + n = Fl::arg(argc, argv, i); + if (n == 0) { + err++; + } else { + optind = i; + } + break; + } + } + + Fl_Window window(800, 600); + window.end(); + + + window.show(1, argv); + + return Fl::run(); +} -- cgit v1.2.3