aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-06-26 11:53:44 +0200
committerThomas White <taw@physics.org>2018-06-26 14:07:42 +0200
commit946ee4bc4a0bc13a965d170ab959cfe7a2cf1b27 (patch)
treeda7397b4df4346724115023c5ac04ed50358b37b /data
parenta604828f8a21399574a39d9b3ce38b116fd98ee6 (diff)
Embed diffraction.cl and hdfsee.ui into executables
Having to install these causes problems, e.g. you can't run from build directory nor run tests without installing. For hdfsee.ui, the XML is now embedded in the code just as it is for cell_explorer. diffraction.cl is a bit too long and complicated for that. There are a number of nasty ways to embed such files. This one seems to be the overall least nasty, although it requires data/gen-resources to be run whenever diffraction.cl is changed.
Diffstat (limited to 'data')
-rwxr-xr-xdata/gen-resources20
-rw-r--r--data/hdfsee.ui53
2 files changed, 20 insertions, 53 deletions
diff --git a/data/gen-resources b/data/gen-resources
new file mode 100755
index 00000000..273f7db7
--- /dev/null
+++ b/data/gen-resources
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+function gen_resource()
+{
+ INFILE=$1
+ OUTFILE=$2
+
+ echo "/*" > $OUTFILE
+ echo " * This file was generated from $INFILE" >> $OUTFILE
+ echo " * using the following command:" >> $OUTFILE
+ echo " * xxd -i $INFILE $OUTFILE" >> $OUTFILE
+ echo " *" >> $OUTFILE
+ echo " * If you have 'xxd' installed, you can run the script" >> $OUTFILE
+ echo " * data/gen-resources to re-create this file." >> $OUTFILE
+ echo " */" >> $OUTFILE
+ echo >> $OUTFILE
+ xxd -i $INFILE >> $OUTFILE
+}
+
+gen_resource data/diffraction.cl src/diffraction.cl.h
diff --git a/data/hdfsee.ui b/data/hdfsee.ui
deleted file mode 100644
index 9294d932..00000000
--- a/data/hdfsee.ui
+++ /dev/null
@@ -1,53 +0,0 @@
-<ui>
- <menubar name="displaywindow">
-
- <menu name="file" action="FileAction">
- <menuitem name="save" action="SaveAction" />
- <separator />
- <menuitem name="close" action="CloseAction" />
- </menu>
-
- <menu name="view" action="ViewAction">
- <menuitem name="images" action="ImagesAction" />
- <separator />
- <menuitem name="binning" action="BinningAction" />
- <menuitem name="boostint" action="BoostIntAction" />
- <menuitem name="rings" action="RingsAction" />
- <menuitem name="showpeaks" action="ShowPeaksAction" />
- <menuitem name="ringradius" action="RingRadiusAction" />
- <separator />
- <menuitem name="col" action="ColAction" />
- <menuitem name="monoscale" action="MonoAction" />
- <menuitem name="invmonoscale" action="InvMonoAction" />
- <separator />
- <menuitem name="colscale" action="ColScaleAction" />
- </menu>
-
- <menu name="tools" action="ToolsAction">
- <menuitem name="calibmode" action="CalibModeAction" />
- <menuitem name="numbers" action="NumbersAction" />
- <menuitem name="peaks" action="PeaksAction" />
- </menu>
-
- <menu name="calibration" action="CalibrationAction">
- <menuitem name="calibrationprevious" action="CalibPreviousAction" />
- <menuitem name="calibrationnext" action="CalibNextAction" />
- <menuitem name="switchcalibmode" action="SwitchCalibModeAction" />
- <menuitem name="focus" action="ToggleFocusAction" />
- <menuitem name="savegeometry" action="SaveGeometryAction" />
- </menu>
-
- <menu name="events" action="EventsAction">
- <menuitem name="eventprevious" action="EventPreviousAction" />
- <menuitem name="eventnext" action="EventNextAction" />
- <menuitem name="gotoevent" action="GotoEventAction" />
- <menuitem name="randomevent" action="RandomEventAction" />
- </menu>
-
- <menu name="help" action="HelpAction">
- <menuitem name="about" action="AboutAction" />
- </menu>
-
- </menubar>
-
-</ui>