aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2010-12-02 22:42:54 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:07 +0100
commitde010513c22947a905b27a164fa9975d6a8b5d63 (patch)
tree4eff34327102ea12cbb28bc2e4c8f2f738351f8b /src
parent4560e69b51b9e517bc5c7edbb80bc567f5bae2fd (diff)
Improve autoconf conditionals (i.e. make them work..)
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.in4
-rw-r--r--src/render.c2
-rw-r--r--src/render.h7
-rw-r--r--src/render_hkl.c37
4 files changed, 42 insertions, 8 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
index 4cc04b36..d7833b13 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -203,6 +203,8 @@ CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
+Cairo_CFLAGS = @Cairo_CFLAGS@
+Cairo_LIBS = @Cairo_LIBS@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
@@ -262,6 +264,8 @@ htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
+libPNG_CFLAGS = @libPNG_CFLAGS@
+libPNG_LIBS = @libPNG_LIBS@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
diff --git a/src/render.c b/src/render.c
index 128ede3a..2cc6a63b 100644
--- a/src/render.c
+++ b/src/render.c
@@ -250,6 +250,7 @@ static void show_marked_features(struct image *image, guchar *data,
}
+#ifdef HAVE_GTK
/* Return a pixbuf containing a rendered version of the image after binning.
* This pixbuf might be scaled later - hopefully mostly in a downward
* direction. */
@@ -344,6 +345,7 @@ GdkPixbuf *render_get_colour_scale(size_t w, size_t h, int scale)
return gdk_pixbuf_new_from_data(data, GDK_COLORSPACE_RGB, FALSE, 8,
w, h, w*3, render_free_data, NULL);
}
+#endif /* HAVE_GTK */
int render_png(DisplayWindow *dw, const char *filename)
diff --git a/src/render.h b/src/render.h
index 0be9ae97..902ec278 100644
--- a/src/render.h
+++ b/src/render.h
@@ -18,7 +18,6 @@
#define RENDER_H
-#include <gdk-pixbuf/gdk-pixbuf.h>
#include <stddef.h>
#include "displaywindow.h"
@@ -33,9 +32,15 @@ enum {
extern void render_scale(float val, float max, int scale,
float *rp, float *gp, float *bp);
+#ifdef HAVE_GTK
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+
extern GdkPixbuf *render_get_image(DisplayWindow *dw);
extern GdkPixbuf *render_get_colour_scale(size_t w, size_t h, int scale);
+#endif /* HAVE_GTK */
+
extern int render_png(DisplayWindow *dw, const char *filename);
extern int render_tiff_fp(DisplayWindow *dw, const char *filename);
extern int render_tiff_int16(DisplayWindow *dw, const char *filename);
diff --git a/src/render_hkl.c b/src/render_hkl.c
index a4ad340a..bfe40260 100644
--- a/src/render_hkl.c
+++ b/src/render_hkl.c
@@ -76,6 +76,8 @@ static void show_help(const char *s)
#ifdef HAVE_CAIRO
+
+
static void draw_circles(signed int xh, signed int xk, signed int xl,
signed int yh, signed int yk, signed int yl,
signed int zh, signed int zk, signed int zl,
@@ -426,7 +428,34 @@ static int render_key(int colscale)
return 0;
}
-#endif
+
+
+#else /* HAVE_CAIRO */
+
+
+static int render_key(int colscale)
+{
+ ERROR("This version of CrystFEL was compiled without Cairo");
+ ERROR(" support, which is required to draw the colour");
+ ERROR(" scale. Sorry!\n");
+ return 1;
+}
+
+
+static void render_za(UnitCell *cell, ReflItemList *items,
+ double *ref, unsigned int *counts,
+ double boost, const char *sym, int wght, int colscale,
+ signed int xh, signed int xk, signed int xl,
+ signed int yh, signed int yk, signed int yl,
+ const char *outfile)
+{
+ ERROR("This version of CrystFEL was compiled without Cairo");
+ ERROR(" support, which is required to plot a zone axis");
+ ERROR(" pattern. Sorry!\n");
+}
+
+
+#endif /* HAVE_CAIRO */
int main(int argc, char *argv[])
@@ -624,14 +653,8 @@ int main(int argc, char *argv[])
r = povray_render_animation(cell, ref, cts, items,
nproc, sym, wght, boost);
} else if ( config_zoneaxis ) {
-#ifdef HAVE_CAIRO
render_za(cell, items, ref, cts, boost, sym, wght, colscale,
rh, rk, rl, dh, dk, dl, outfile);
-#else
- ERROR("This version of CrystFEL was compiled without Cairo");
- ERROR(" support, which is required to plot a zone axis");
- ERROR(" pattern. Sorry!\n");
-#endif
} else {
ERROR("Try again with either --povray or --zone-axis.\n");
}