Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBernie Innocenti <bernie@codewiz.org>2010-05-03 21:53:47 (GMT)
committer Bernie Innocenti <bernie@codewiz.org>2010-05-03 21:53:47 (GMT)
commit1030dc837b10a03a02a85d5504cbeec168ce49e2 (patch)
tree698eefa87ac437deaf36a4141b326f8ce7986692 /src
Import XaoS r489 (trunk after version 3.5)
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.in62
-rw-r--r--src/engine/3d.c240
-rw-r--r--src/engine/3dd.c200
-rw-r--r--src/engine/Makefile.in70
-rw-r--r--src/engine/anti.c358
-rw-r--r--src/engine/blur.c393
-rw-r--r--src/engine/btrace.c596
-rw-r--r--src/engine/btraced.c466
-rw-r--r--src/engine/calculate.h37
-rw-r--r--src/engine/dither.c1200
-rw-r--r--src/engine/docalc.c790
-rw-r--r--src/engine/edge.c113
-rw-r--r--src/engine/edge2.c113
-rw-r--r--src/engine/edge2d.c53
-rw-r--r--src/engine/edged.c66
-rw-r--r--src/engine/emboss.c266
-rw-r--r--src/engine/engine.pri35
-rw-r--r--src/engine/formulas.c3038
-rw-r--r--src/engine/fractal.c471
-rw-r--r--src/engine/i386.c187
-rw-r--r--src/engine/interlace.c134
-rw-r--r--src/engine/itersmall.c171
-rw-r--r--src/engine/julia.c120
-rw-r--r--src/engine/julia.h18
-rw-r--r--src/engine/paletted.c22
-rw-r--r--src/engine/palettef.c165
-rw-r--r--src/engine/plane.c144
-rw-r--r--src/engine/rotate.c200
-rw-r--r--src/engine/rotated.c56
-rw-r--r--src/engine/star.c135
-rw-r--r--src/engine/stard.c31
-rw-r--r--src/engine/stereod.c51
-rw-r--r--src/engine/stereogram.c193
-rw-r--r--src/engine/subwindow.c236
-rw-r--r--src/engine/zoom.c1762
-rw-r--r--src/engine/zoomd.c309
-rw-r--r--src/filter/Makefile.in45
-rw-r--r--src/filter/filter.c297
-rw-r--r--src/filter/filter.pri10
-rw-r--r--src/filter/font.c1814
-rw-r--r--src/filter/font2.c35
-rw-r--r--src/filter/font23.c36
-rw-r--r--src/filter/font3.c41
-rw-r--r--src/filter/grlib.c995
-rw-r--r--src/filter/grlibd.c322
-rw-r--r--src/filter/image.c268
-rw-r--r--src/filter/palette.c1097
-rw-r--r--src/filter/random.c50
-rw-r--r--src/filter/xfont16.c517
-rw-r--r--src/filter/xfont32.c1989
-rw-r--r--src/filter/xfont48.c2100
-rw-r--r--src/i18n/Makefile.in.in53
-rw-r--r--src/i18n/README156
-rw-r--r--src/i18n/cs.po1836
-rw-r--r--src/i18n/de.po1481
-rw-r--r--src/i18n/es.po1561
-rw-r--r--src/i18n/fr.po1506
-rw-r--r--src/i18n/hu.po1477
-rw-r--r--src/i18n/it.po1483
-rw-r--r--src/i18n/pt.po1570
-rw-r--r--src/i18n/ro.po1504
-rw-r--r--src/include/aconfig.h.in60
-rw-r--r--src/include/archaccel.h14
-rw-r--r--src/include/btrace.h12
-rw-r--r--src/include/c256.h12
-rw-r--r--src/include/catalog.h27
-rw-r--r--src/include/complex.h63
-rw-r--r--src/include/config/aconfig.std28
-rw-r--r--src/include/config/config.autoconf141
-rw-r--r--src/include/config/config.std28
-rw-r--r--src/include/cursor.h56
-rw-r--r--src/include/fconfig.h63
-rw-r--r--src/include/filter.h335
-rw-r--r--src/include/formulas.h64
-rw-r--r--src/include/fractal.h170
-rw-r--r--src/include/gccaccel.h40
-rw-r--r--src/include/gccbuild.h65
-rw-r--r--src/include/generic.h15
-rw-r--r--src/include/grlib.h40
-rw-r--r--src/include/hicolor.h16
-rw-r--r--src/include/i386/__math.h586
-rw-r--r--src/include/i386/ctrl87.h120
-rw-r--r--src/include/i386/sstring.h414
-rw-r--r--src/include/include.pri38
-rw-r--r--src/include/misc-f.h17
-rw-r--r--src/include/param.h48
-rw-r--r--src/include/pixel_t.h21
-rw-r--r--src/include/plane.h58
-rw-r--r--src/include/sffe.h139
-rw-r--r--src/include/sffe_cmplx_asm.h140
-rw-r--r--src/include/sffe_cmplx_gsl.h82
-rw-r--r--src/include/timers.h67
-rw-r--r--src/include/true24.h31
-rw-r--r--src/include/truecolor.h13
-rw-r--r--src/include/ui.h160
-rw-r--r--src/include/ui_helper.h550
-rw-r--r--src/include/version.h.in23
-rw-r--r--src/include/xerror.h12
-rw-r--r--src/include/xio.h107
-rw-r--r--src/include/xldio.h14
-rw-r--r--src/include/xmenu.h377
-rw-r--r--src/include/xshl.h50
-rw-r--r--src/include/xthread.h208
-rw-r--r--src/include/zoom.h40
-rw-r--r--src/sffe/About4
-rw-r--r--src/sffe/Makefile.in36
-rw-r--r--src/sffe/asm/build.sh3
-rw-r--r--src/sffe/asm/build_win.sh3
-rw-r--r--src/sffe/asm/cmplx.asm901
-rw-r--r--src/sffe/sffe.c1013
-rw-r--r--src/sffe/sffe.pri23
-rw-r--r--src/sffe/sffe_cmplx_asm.c331
-rw-r--r--src/sffe/sffe_cmplx_gsl.c294
-rw-r--r--src/ui-hlp/Makefile.in47
-rw-r--r--src/ui-hlp/autod.c112
-rw-r--r--src/ui-hlp/autopilot.c214
-rw-r--r--src/ui-hlp/autopilot.h33
-rw-r--r--src/ui-hlp/menu.c1678
-rw-r--r--src/ui-hlp/messg.c145
-rw-r--r--src/ui-hlp/play.c946
-rw-r--r--src/ui-hlp/play.h50
-rw-r--r--src/ui-hlp/playtext.c174
-rw-r--r--src/ui-hlp/render.c664
-rw-r--r--src/ui-hlp/save.c704
-rw-r--r--src/ui-hlp/ui-hlp.pri12
-rw-r--r--src/ui-hlp/ui_helper.c2303
-rw-r--r--src/ui-hlp/wstack.c528
-rw-r--r--src/ui/Makefile.in51
-rw-r--r--src/ui/dialog.c1521
-rw-r--r--src/ui/drivers.c89
-rw-r--r--src/ui/filesel.c677
-rw-r--r--src/ui/fparams.c112
-rw-r--r--src/ui/param.c172
-rw-r--r--src/ui/pipecmd.c113
-rw-r--r--src/ui/ui-drv/aa/Makefile.in39
-rw-r--r--src/ui/ui-drv/aa/ui_aa.c724
-rw-r--r--src/ui/ui-drv/cocoa/AppController.h59
-rw-r--r--src/ui/ui-drv/cocoa/AppController.m542
-rw-r--r--src/ui/ui-drv/cocoa/CustomDialog.h38
-rw-r--r--src/ui/ui-drv/cocoa/CustomDialog.m433
-rw-r--r--src/ui/ui-drv/cocoa/English.lproj/Credits.html26
-rw-r--r--src/ui/ui-drv/cocoa/English.lproj/InfoPlist.stringsbin0 -> 420 bytes
-rw-r--r--src/ui/ui-drv/cocoa/English.lproj/MainMenu.nib/designable.nib498
-rw-r--r--src/ui/ui-drv/cocoa/English.lproj/MainMenu.nib/keyedobjects.nibbin0 -> 4197 bytes
-rw-r--r--src/ui/ui-drv/cocoa/FractalView.h70
-rw-r--r--src/ui/ui-drv/cocoa/FractalView.m347
-rw-r--r--src/ui/ui-drv/cocoa/HowToBuild.txt47
-rw-r--r--src/ui/ui-drv/cocoa/Info.plist69
-rw-r--r--src/ui/ui-drv/cocoa/Japanese.lproj/InfoPlist.stringsbin0 -> 208 bytes
-rw-r--r--src/ui/ui-drv/cocoa/Japanese.lproj/MainMenu.nib/classes.nib4
-rw-r--r--src/ui/ui-drv/cocoa/Japanese.lproj/MainMenu.nib/info.nib17
-rw-r--r--src/ui/ui-drv/cocoa/Japanese.lproj/MainMenu.nib/keyedobjects.nibbin0 -> 10793 bytes
-rw-r--r--src/ui/ui-drv/cocoa/Read Me.rtf193
-rw-r--r--src/ui/ui-drv/cocoa/Readme Cocoa390
-rw-r--r--src/ui/ui-drv/cocoa/VideatorProxy.h42
-rw-r--r--src/ui/ui-drv/cocoa/VideatorProxy.m157
-rw-r--r--src/ui/ui-drv/cocoa/XaoS.icnsbin0 -> 223269 bytes
-rw-r--r--src/ui/ui-drv/cocoa/XaoS.xcodeproj/project.pbxproj831
-rw-r--r--src/ui/ui-drv/cocoa/XaoSDocument.icnsbin0 -> 127993 bytes
-rw-r--r--src/ui/ui-drv/cocoa/XaoS_Prefix.pch7
-rw-r--r--src/ui/ui-drv/cocoa/aconfig.h123
-rw-r--r--src/ui/ui-drv/cocoa/grlib_cocoa.m142
-rw-r--r--src/ui/ui-drv/cocoa/performanceCursor.tiffbin0 -> 4478 bytes
-rw-r--r--src/ui/ui-drv/cocoa/ui_cocoa.m267
-rw-r--r--src/ui/ui-drv/cocoa/version.h22
-rw-r--r--src/ui/ui-drv/gtk/Makefile.in39
-rw-r--r--src/ui/ui-drv/gtk/ui_gtk.c764
-rw-r--r--src/ui/ui-drv/qt/XaoS.icnsbin0 -> 223269 bytes
-rw-r--r--src/ui/ui-drv/qt/XaoS.pro29
-rw-r--r--src/ui/ui-drv/qt/XaoS.qrc5
-rw-r--r--src/ui/ui-drv/qt/aconfig.h63
-rw-r--r--src/ui/ui-drv/qt/config.h149
-rw-r--r--src/ui/ui-drv/qt/config.pri4
-rw-r--r--src/ui/ui-drv/qt/customdialog.cpp179
-rw-r--r--src/ui/ui-drv/qt/customdialog.h29
-rw-r--r--src/ui/ui-drv/qt/fractalwidget.cpp228
-rw-r--r--src/ui/ui-drv/qt/fractalwidget.h57
-rw-r--r--src/ui/ui-drv/qt/images/xaosbig.pngbin0 -> 27584 bytes
-rw-r--r--src/ui/ui-drv/qt/main.cpp180
-rw-r--r--src/ui/ui-drv/qt/mainwindow.cpp172
-rw-r--r--src/ui/ui-drv/qt/mainwindow.h43
-rw-r--r--src/ui/ui-drv/qt/ui_qt.c99
-rw-r--r--src/ui/ui-drv/qt/version.h23
-rw-r--r--src/ui/ui-drv/qt/xaos.icobin0 -> 120841 bytes
-rw-r--r--src/ui/ui-drv/qt/xaos.rc1
-rw-r--r--src/ui/ui-drv/template/Makefile.in39
-rw-r--r--src/ui/ui-drv/template/ui_template.c99
-rw-r--r--src/ui/ui-drv/win32/Makefile.in43
-rw-r--r--src/ui/ui-drv/win32/about.c239
-rw-r--r--src/ui/ui-drv/win32/about.h20
-rw-r--r--src/ui/ui-drv/win32/about.rc19
-rw-r--r--src/ui/ui-drv/win32/dxguid.c1102
-rw-r--r--src/ui/ui-drv/win32/installer/XaoS Installer.nsi138
-rw-r--r--src/ui/ui-drv/win32/installer/XaoS.bmpbin0 -> 25818 bytes
-rw-r--r--src/ui/ui-drv/win32/resource.h3
-rw-r--r--src/ui/ui-drv/win32/small.icobin0 -> 2294 bytes
-rw-r--r--src/ui/ui-drv/win32/ui_win32.c1886
-rw-r--r--src/ui/ui-drv/win32/ui_win32.h20
-rw-r--r--src/ui/ui-drv/win32/version.rc39
-rw-r--r--src/ui/ui-drv/win32/windialo.c471
-rw-r--r--src/ui/ui-drv/win32/winmenu.c243
-rw-r--r--src/ui/ui-drv/win32/xaos.dlg228
-rw-r--r--src/ui/ui-drv/win32/xaos.exe.manifest10
-rw-r--r--src/ui/ui-drv/win32/xaos.icobin0 -> 135286 bytes
-rw-r--r--src/ui/ui-drv/win32/xaos.rc16
-rw-r--r--src/ui/ui-drv/x11/Makefile.in40
-rw-r--r--src/ui/ui-drv/x11/ui_x11.c597
-rw-r--r--src/ui/ui-drv/x11/xlib.c663
-rw-r--r--src/ui/ui-drv/x11/xlib.h139
-rw-r--r--src/ui/ui.c1761
-rw-r--r--src/ui/ui.pri10
-rw-r--r--src/ui/uihelp.c486
-rw-r--r--src/ui/uiint.h75
-rw-r--r--src/ui/uimenu.c572
-rw-r--r--src/util/Makefile.in50
-rw-r--r--src/util/catalog.c253
-rw-r--r--src/util/help.c95
-rw-r--r--src/util/png.c201
-rw-r--r--src/util/thread.c221
-rw-r--r--src/util/timers.c670
-rw-r--r--src/util/util.pri12
-rw-r--r--src/util/xerror.c43
-rw-r--r--src/util/xldio.c603
-rw-r--r--src/util/xmenu.c998
-rw-r--r--src/util/xshl.c470
-rw-r--r--src/util/xstdio.c488
-rw-r--r--src/util/xstring.c141
227 files changed, 72615 insertions, 0 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644
index 0000000..a5e1010
--- /dev/null
+++ b/src/Makefile.in
@@ -0,0 +1,62 @@
+CC = @CC@
+CFLAGS = @CFLAGS@
+LIBS = @LIBICONV@ @LIBINTL@ @LIBS@
+LFLAGS = @LDFLAGS@
+AR = @AR@
+RANLIB = @RANLIB@
+@SET_MAKE@
+
+TLIBS = @DRIVERLIBS@
+
+DIRS = \
+ sffe \
+ filter \
+ engine \
+ ui-hlp \
+ ui \
+ util \
+ @DRIVERDIRS@
+
+PROG = @BINPATH@/xaos
+OBJS = $(SRCS:.c=.o)
+
+TLIB =
+
+
+all default: $(PROG) internationalization
+
+@BINPATH@:
+ mkdir $@
+
+@LIBPATH@:
+ mkdir $@
+
+libs:
+ @for name in $(DIRS) ; do sh -c "cd $$name ; $(MAKE) all"; done
+
+$(PROG): @BINPATH@ @LIBPATH@ include/config.h libs
+ $(CC) $(CFLAGS) $(LFLAGS) -o $@ $(TLIBS) $(LIBS)
+
+include/config.h:
+ cp include/config/config.autoconf include/config.h
+
+internationalization:
+ if [ "@USE_NLS@" = "yes" ]; then $(MAKE) -C i18n/ all; fi
+
+clean:
+ @for name in $(DIRS) i18n ; do sh -c "cd $$name ; $(MAKE) $@"; done
+ rm -f include/config.h
+ rm -f $(PROG) lib/lib*.a
+
+distclean: clean
+ rm -f Makefile
+
+#dep:
+# rm -f .depend
+# make .depend
+#
+#.depend:
+# echo '# Program dependencies' >.depend
+# gcc -I svgalib $(DEFINES) -MM $(patsubst %.o,%.c,$(OBJS)) >>.depend
+#
+#include .depend
diff --git a/src/engine/3d.c b/src/engine/3d.c
new file mode 100644
index 0000000..517d3db
--- /dev/null
+++ b/src/engine/3d.c
@@ -0,0 +1,240 @@
+#ifndef _plan9_
+#include <config.h>
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#include <stdio.h> /*for NULL */
+#include <math.h>
+#else
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#endif
+#define SLARGEITER
+#include <xthread.h>
+#include <filter.h>
+
+struct threeddata {
+ struct palette *pal;
+ struct palette *savedpalette;
+ unsigned int *pixels;
+ unsigned int maxiter;
+ unsigned int height;
+ unsigned int colheight;
+ unsigned int midcolor;
+ unsigned int darkcolor;
+ unsigned int stereogrammode;
+};
+
+#define spixel_t pixel16_t
+#include <c256.h>
+#define do_3d do_3d8
+#define convert_3d convert_3d8
+#define convertup_3d convertup_3d8
+#include "3dd.c"
+
+#include <truecolor.h>
+#define do_3d do_3d32
+#define convert_3d convert_3d32
+#define convertup_3d convertup_3d32
+#include "3dd.c"
+
+#include <true24.h>
+#define do_3d do_3d24
+#define convert_3d convert_3d24
+#define convertup_3d convertup_3d24
+#include "3dd.c"
+
+#include <hicolor.h>
+#define do_3d do_3d16
+#define convert_3d convert_3d16
+#define convertup_3d convertup_3d16
+#include "3dd.c"
+
+static int requirement(struct filter *f, struct requirements *r)
+{
+ f->req = *r;
+ r->nimages = 1;
+ r->flags &= ~IMAGEDATA;
+ r->supportedmask = MASK1BPP | MASK3BPP | MASK2BPP | MASK4BPP;
+ return (f->next->action->requirement(f->next, r));
+}
+
+extern CONST struct filteraction stereogram_filter;
+static int initialize(struct filter *f, struct initdata *i)
+{
+ struct threeddata *d = (struct threeddata *) f->data;
+ struct filter *f1 = f;
+ inhermisc(f, i);
+ d->stereogrammode = 0;
+ while (f1) {
+ if (f1->action == &stereogram_filter)
+ d->stereogrammode = 1;
+ f1 = f1->next;
+ }
+ d->maxiter = -1;
+ d->height = i->image->height / 3;
+ if (d->pal != NULL)
+ destroypalette(d->pal);
+ d->pal =
+ createpalette(0, 65536, LARGEITER, 0, 65536, NULL, NULL, NULL,
+ NULL, NULL);
+ /*in/out coloring modes looks better in iter modes. This also saves some
+ memory in truecolor. */
+ if (i->image->palette->type == LARGEITER
+ || i->image->palette->type == SMALLITER) {
+ } else {
+ if (d->savedpalette == NULL)
+ d->savedpalette = clonepalette(i->image->palette);
+
+ mkgraypalette(i->image->palette);
+ }
+ if (d->pixels != NULL) {
+ free(d->pixels);
+ d->pixels = NULL;
+ }
+ if (!inherimage
+ (f, i, TOUCHIMAGE | NEWIMAGE,
+ i->image->width + 6 + (i->image->height + d->height + 6) / 2,
+ i->image->height + d->height + 6, d->pal, i->image->pixelwidth,
+ i->image->pixelheight * 2))
+ return 0;
+ setfractalpalette(f, d->savedpalette);
+ fractalc_resize_to(f->fractalc,
+ f->childimage->pixelwidth * f->childimage->width,
+ f->childimage->pixelheight * f->childimage->height);
+ f->fractalc->version++;
+ return (f->previous->action->initialize(f->previous, i));
+}
+
+static struct filter *getinstance(CONST struct filteraction *a)
+{
+ struct filter *f = createfilter(a);
+ struct threeddata *d = calloc(sizeof(*d), 1);
+ f->data = d;
+ f->name = "3d";
+ return (f);
+}
+
+static void destroyinstance(struct filter *f)
+{
+ struct threeddata *d = (struct threeddata *) f->data;
+ if (d->pal != NULL)
+ destroypalette((struct palette *) d->pal);
+ if (d->savedpalette != NULL)
+ destroypalette(d->savedpalette);
+ if (d->pixels) {
+ d->pixels = 0;
+ free(d->pixels);
+ }
+ free(d);
+ destroyinheredimage(f);
+ free(f);
+}
+
+static int doit(struct filter *f, int flags, int time)
+{
+ int val;
+ int size = f->childimage->palette->type == SMALLITER ? 240 : 65520;
+ struct threeddata *d = (struct threeddata *) f->data;
+ if (f->image->palette->size < size)
+ size = f->image->palette->size;
+
+ /* Update logarithmic scale palette. */
+ if (f->fractalc->maxiter != d->maxiter) {
+ unsigned int i;
+ int palsize = f->fractalc->maxiter;
+ if (palsize >= 65536)
+ palsize = 65535;
+ d->colheight = d->height * (64 + 32) / 64;
+ d->midcolor = d->height * 60 / 100;
+ d->darkcolor = d->height * 30 / 100;
+ d->pal->size = palsize;
+ for (i = 0; i < (unsigned int) palsize; i++) {
+ unsigned int y;
+ y = (log10(1 + 10.0 * (i ? i : palsize) / palsize)) *
+ d->colheight / 9.0 * 16.0 / 2.0;
+ /*y = (i ? i : palsize) * d->colheight / 9.0 / 2.0 * 16.0 / palsize; */
+ if (y != d->pal->pixels[i])
+ f->fractalc->version++;
+ d->pal->pixels[i] = y;
+ }
+ d->maxiter = f->fractalc->maxiter;
+ if (d->pixels)
+ free(d->pixels);
+ i = 0;
+ if (d->stereogrammode) {
+ d->pixels =
+ malloc((f->childimage->height) * sizeof(*d->pixels));
+ for (i = 0; i < (unsigned int) f->childimage->height; i++) {
+ d->pixels[i] =
+ (f->childimage->height -
+ i) * 255 / f->childimage->height;
+ }
+ } else {
+ d->pixels = malloc((d->colheight + 5) * sizeof(*d->pixels));
+ for (; i < d->colheight; i++) {
+ int c = i * (f->image->palette->size) / d->colheight;
+ if (c > f->image->palette->size - 1)
+ c = f->image->palette->size - 1;
+ d->pixels[i] = f->image->palette->pixels[c];
+ }
+ d->pixels[i] = f->image->palette->pixels[0];
+ }
+ }
+ updateinheredimage(f);
+ val = f->previous->action->doit(f->previous, flags, time);
+ drivercall(*f->image,
+ xth_function(do_3d8, f, f->image->width),
+ xth_function(do_3d16, f, f->image->width),
+ xth_function(do_3d24, f, f->image->width),
+ xth_function(do_3d32, f, f->image->width));
+ xth_sync();
+ return val;
+}
+
+static void myremove(struct filter *f)
+{
+ struct threeddata *d = (struct threeddata *) f->data;
+ fractalc_resize_to(f->fractalc, f->image->width * f->image->pixelwidth,
+ f->image->height * f->image->pixelheight);
+ if (d->savedpalette != NULL) {
+ restorepalette(f->image->palette, d->savedpalette);
+ destroypalette(d->savedpalette);
+ d->savedpalette = NULL;
+ }
+
+}
+
+static void convertup(struct filter *f, int *x, int *y)
+{
+ drivercall(*f->image,
+ convertup_3d8(f, x, y),
+ convertup_3d16(f, x, y),
+ convertup_3d24(f, x, y), convertup_3d32(f, x, y));
+ f->next->action->convertup(f->next, x, y);
+}
+
+static void convertdown(struct filter *f, int *x, int *y)
+{
+ drivercall(*f->image,
+ convert_3d8(f, x, y),
+ convert_3d16(f, x, y),
+ convert_3d24(f, x, y), convert_3d32(f, x, y));
+ if (f->previous != NULL)
+ f->previous->action->convertdown(f->previous, x, y);
+}
+
+CONST struct filteraction threed_filter = {
+ "Pseudo 3d",
+ "threed",
+ 0,
+ getinstance,
+ destroyinstance,
+ doit,
+ requirement,
+ initialize,
+ convertup,
+ convertdown,
+ myremove
+};
diff --git a/src/engine/3dd.c b/src/engine/3dd.c
new file mode 100644
index 0000000..f6a92fb
--- /dev/null
+++ b/src/engine/3dd.c
@@ -0,0 +1,200 @@
+#ifndef UNSUPPORTED
+static void convert_3d(struct filter *f, int *x1, int *y1)
+{
+ struct threeddata *data = (struct threeddata *) f->data;
+ int y;
+ int x = *x1;
+ unsigned int inp;
+ unsigned int height = data->height;
+ register CONST spixel_t *input;
+ if (x >= f->childimage->width - 5 || x < 0
+ || *y1 > f->childimage->height) {
+ *x1 += *y1 / 2;
+ return;
+ }
+ if (x < 0)
+ x = 0;
+ for (y = f->childimage->height - 3; y >= 0; y--) {
+ int d;
+ input = ((spixel_t *) f->childimage->currlines[y] + y / 2);
+ inp = (input[x] + input[x + 1] + input[x + 2] +
+ input[x + 3] + input[x + 4] + input[x + 5]);
+ input = ((spixel_t *) f->childimage->currlines[y + 1] + y / 2);
+ inp += (input[x] + input[x + 1] + input[x + 2] +
+ input[x + 3] + input[x + 4] + input[x + 5]);
+ input = ((spixel_t *) f->childimage->currlines[y + 2] + y / 2);
+ inp += (input[x] + input[x + 1] + input[x + 2] +
+ input[x + 3] + input[x + 4] + input[x + 5]);
+ d = y - (inp / 16 > height ? height : inp / 16);
+ if (d <= *y1) {
+ *y1 = y;
+ *x1 = x + y / 2;
+ return;
+ }
+ }
+ *x1 += *y1 / 2;
+ return;
+}
+
+static void convertup_3d(struct filter *f, int *x1, int *y1)
+{
+ struct threeddata *data = (struct threeddata *) f->data;
+ int y = *y1;
+ int x = *x1;
+ unsigned int inp;
+ unsigned int height = data->height;
+ register CONST spixel_t *input;
+ if (x >= f->childimage->width - 5)
+ x = f->childimage->width - 6;
+ if (y >= f->childimage->height - 3)
+ y = f->childimage->height - 3;
+ if (x < 0)
+ x = 0;
+ if (y < 0)
+ y = 0;
+ input = ((spixel_t *) f->childimage->currlines[y] + y / 2);
+ inp = (input[x] + input[x + 1] + input[x + 2] +
+ input[x + 3] + input[x + 4] + input[x + 5]);
+ input = ((spixel_t *) f->childimage->currlines[y + 1] + y / 2);
+ inp += (input[x] + input[x + 1] + input[x + 2] +
+ input[x + 3] + input[x + 4] + input[x + 5]);
+ input = ((spixel_t *) f->childimage->currlines[y + 2] + y / 2);
+ inp += (input[x] + input[x + 1] + input[x + 2] +
+ input[x + 3] + input[x + 4] + input[x + 5]);
+ *x1 -= *y1 / 2;
+ *y1 = y - (inp / 16 > height ? height : inp / 16);
+}
+
+static void do_3d(void *dataptr, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *RESTRICT f = (struct filter *) dataptr;
+ unsigned int y;
+ int maxinp = 0;
+ unsigned int x;
+ unsigned int end;
+ unsigned int sum;
+ spixel_t CONST *RESTRICT input;
+ unsigned int *RESTRICT lengths;
+ unsigned int *RESTRICT sums;
+ unsigned int *RESTRICT relsums;
+ struct threeddata *data = (struct threeddata *) f->data;
+
+
+ /* Copy to local variables to improve cse and memory references. */
+ unsigned int height = data->height;
+ unsigned int stereogrammode = data->stereogrammode;
+ unsigned int colheight = data->colheight;
+ unsigned int midcolor = data->midcolor;
+ unsigned int darkcolor = data->darkcolor;
+ CONST unsigned int *RESTRICT pixels = data->pixels;
+ cpixel_t *RESTRICT * RESTRICT currlines =
+ (cpixel_t * RESTRICT * RESTRICT) f->image->currlines;
+ struct inp {
+ int max;
+ unsigned int down;
+ } *inpdata;
+
+#ifdef HAVE_ALLOCA1
+ lengths =
+ (unsigned int *) alloca(sizeof(unsigned int) * f->image->width);
+ inpdata =
+ (struct inp *) alloca(sizeof(struct inp) * (f->image->width + 2));
+ sums =
+ (unsigned int *) alloca(sizeof(unsigned int) *
+ (f->image->width + 2) * 2);
+#else
+ lengths =
+ (unsigned int *) malloc(sizeof(unsigned int) * f->image->width);
+ inpdata =
+ (struct inp *) malloc(sizeof(struct inp) * (f->image->width + 2));
+ sums =
+ (unsigned int *) malloc(sizeof(unsigned int) *
+ (f->image->width + 2) * 2);
+#endif
+ for (x = 0; x < (unsigned int) f->image->width; x++)
+ lengths[x] = f->image->height - 1,
+ sums[x * 2 + 0] = 0, sums[x * 2 + 1] = 0, inpdata[x].max = 0;
+ sums[x * 2 + 0] = 0, sums[x * 2 + 1] = 0, inpdata[x].max = 0;
+ inpdata[x + 1].max = 0;
+ end = r2;
+ for (y = f->childimage->height - 2; y > 0;) {
+ y--;
+ input = ((spixel_t *) f->childimage->currlines[y] + y / 2);
+ x = r1;
+ relsums = sums + (y & 1);
+
+ /* Fix boundary cases. */
+ /*relsums[0] = relsums[1];
+ relsums[end*2-1] = relsums[end*2-2]; */
+ inpdata[end + 1] = inpdata[end] = inpdata[end - 1];
+ sum =
+ input[x] + input[x + 1] + input[x + 2] + input[x + 3] +
+ input[x + 4] + input[x + 5];
+
+ while (x < end) {
+ unsigned int inp;
+ unsigned int d;
+
+ /* Average pixel values of 5*3 square to get nicer shapes. */
+ sum += input[x + 6] - input[x];
+ inp = sum + sums[x * 2 + 1] + sums[x * 2];
+ relsums[x * 2] = sum;
+ inpdata[x].down = inp;
+
+ /* Calculate shades. */
+ maxinp = inpdata[x + 2].max;
+ if ((int) inp > maxinp)
+ inpdata[x].max = inp - 32;
+ else
+ inpdata[x].max = maxinp - 32;
+
+ /* caluclate top of mountain. */
+ d = inp / 16;
+ d = y - (d > height ? height : d);
+
+ /* Underflow */
+ if (d > 65535U)
+ d = 0;
+ if (d < lengths[x]) {
+ int y1;
+ unsigned int color;
+ if (stereogrammode)
+ color = pixels[y];
+ else if (inp / 16 > height)
+ /*Red thinks on the top. */
+ color =
+ pixels[inp / 16 >=
+ colheight ? colheight : inp / 16];
+ else {
+ int c;
+ /* Simple shading model.
+ Depends only on the preceding voxel. */
+
+ c = ((int) inpdata[x + 2].down - (int) inp) / 8;
+
+ /* Get shades. */
+ color =
+ ((int) inp > maxinp ? midcolor : darkcolor) - c;
+ color =
+ pixels[color <
+ 65535 ? (color <
+ height ? color : height) : 0];
+ }
+ for (y1 = lengths[x]; y1 >= (int) d; y1--) {
+ p_setp(currlines[y1], x, color);
+ }
+ lengths[x] = d;
+ }
+ x++;
+ }
+ }
+#ifndef HAVE_ALLOCA1
+ free(lengths);
+ free(inpdata);
+ free(sums);
+#endif
+}
+#endif
+#undef do_3d
+#undef convert_3d
+#undef convertup_3d
diff --git a/src/engine/Makefile.in b/src/engine/Makefile.in
new file mode 100644
index 0000000..5615ae6
--- /dev/null
+++ b/src/engine/Makefile.in
@@ -0,0 +1,70 @@
+CC = @CC@
+CFLAGS = @CFLAGS@
+LIBS = @LIBS@ -lm
+LFLAGS = @LDFLAGS@
+AR = @AR@
+RANLIB = @RANLIB@
+
+SRCS = formulas.c \
+ fractal.c \
+ btrace.c \
+ palettef.c \
+ emboss.c \
+ star.c \
+ anti.c \
+ dither.c \
+ edge.c \
+ edge2.c \
+ rotate.c \
+ zoom.c \
+ blur.c \
+ interlace.c \
+ itersmall.c \
+ stereogram.c \
+ 3d.c \
+ subwindow.c \
+ plane.c \
+ julia.c \
+ i386.c
+
+
+OBJS = $(SRCS:.c=.o)
+
+TLIB = ../lib/libengine.a
+
+
+all: $(TLIB)
+
+$(TLIB):$(OBJS)
+ rm -f $@
+ $(AR) rc $@ $(OBJS)
+ $(RANLIB) $@
+
+formulas.o: docalc.c
+3d.o: 3dd.c
+btrace.o: btraced.c
+edge2.o: edge2d.c
+palette.o: paletted.c
+rotate.o: rotated.c
+stereogram.o: stereod.c
+star.o: stard.c
+zoom.o: zoomd.c
+
+clean:
+ rm -f $(TLIB)
+ rm -f *.[oas]
+ rm -f *~
+ rm -f core
+
+distclean:clean
+ rm Makefile
+
+#dep:
+# rm -f .depend
+# make .depend
+#
+#.depend:
+# echo '# Program dependencies' >.depend
+# gcc -I svgalib $(DEFINES) -MM $(patsubst %.o,%.c,$(OBJS)) >>.depend
+#
+#include .depend
diff --git a/src/engine/anti.c b/src/engine/anti.c
new file mode 100644
index 0000000..819d33e
--- /dev/null
+++ b/src/engine/anti.c
@@ -0,0 +1,358 @@
+#include <config.h>
+#ifndef _plan9_
+#ifndef __cplusplus
+#include <math.h>
+#endif
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#include <string.h>
+#include <config.h>
+#include <stdio.h>
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+#include <stdlib.h>
+#else
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#endif
+#include <xerror.h>
+#include <filter.h>
+#include <fractal.h>
+#include <xthread.h>
+struct antidata {
+ int shift;
+};
+static int requirement(struct filter *f, struct requirements *r)
+{
+ f->req = *r;
+ r->nimages = 1;
+ r->supportedmask = TRUECOLOR24 | TRUECOLOR | TRUECOLOR16 | GRAYSCALE;
+ return (f->next->action->requirement(f->next, r));
+}
+
+static int initialize(struct filter *f, struct initdata *i)
+{
+ struct antidata *s = (struct antidata *) f->data;
+ if (i->image->width * i->image->height * i->image->bytesperpixel * 2 *
+ 16 > 15 * 1024 * 1024) {
+ s->shift = 1;
+ } else {
+ s->shift = 2;
+ }
+ inhermisc(f, i);
+ if (!inherimage
+ (f, i, TOUCHIMAGE | IMAGEDATA,
+ (int) (((unsigned int) i->image->width) << s->shift),
+ (int) (((unsigned int) i->image->height) << s->shift), NULL, 0,
+ 0))
+ return 0;
+ if (i->image == NULL) {
+ return 0;
+ }
+ return (f->previous->action->initialize(f->previous, i));
+}
+
+static struct filter *getinstance(CONST struct filteraction *a)
+{
+ struct filter *f = createfilter(a);
+ struct antidata *i = (struct antidata *) calloc(1, sizeof(*i));
+ f->childimage = NULL;
+ f->data = i;
+ f->name = "Antialiasing";
+ return (f);
+}
+
+static void destroyinstance(struct filter *f)
+{
+ destroyinheredimage(f);
+ free(f->data);
+ free(f);
+}
+
+static void antigray(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ struct image *srci = f->childimage, *desti = f->image;
+ struct antidata *s = (struct antidata *) f->data;
+ register unsigned char *src;
+ unsigned char *destend, *dest;
+ unsigned int ystart, y;
+ unsigned int xstart;
+ register unsigned int sum;
+ unsigned int xstep = (1U << (s->shift));
+ int i;
+ for (i = r1; i < r2; i++) {
+ dest = (unsigned char *) desti->currlines[i];
+ destend = dest + desti->width;
+ ystart = ((unsigned int) i) << s->shift;
+ xstart = 0;
+ for (; dest < destend; dest++) {
+ if (xstep > 2) {
+ sum = 0;
+ for (y = 0; y < 4; y++) {
+ src =
+ (unsigned char *) srci->currlines[y + ystart] +
+ xstart;
+ sum += (unsigned int) src[0];
+ sum += (unsigned int) src[1];
+ sum += (unsigned int) src[2];
+ sum += (unsigned int) src[3];
+ }
+ sum >>= 4;
+ } else {
+ src = (unsigned char *) srci->currlines[ystart] + xstart;
+ sum = (unsigned int) src[0];
+ sum += (unsigned int) src[1];
+ src =
+ (unsigned char *) srci->currlines[ystart + 1] + xstart;
+ sum += (unsigned int) src[0];
+ sum += (unsigned int) src[1];
+ sum >>= 2;
+ }
+ *dest = (pixel8_t) sum;
+ xstart += xstep;
+ }
+ }
+}
+
+#ifdef STRUECOLOR24
+static void anti24(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ struct image *srci = f->childimage, *desti = f->image;
+ struct antidata *s = (struct antidata *) f->data;
+ register unsigned char *src;
+ unsigned char *destend, *dest;
+ unsigned int ystart, y;
+ unsigned int xstart;
+ register unsigned int sum;
+ unsigned int xstep = ((1U << s->shift) - 1) * 3;
+ int c = 0;
+ int i;
+ if (!srci->palette->info.truec.byteexact) {
+ x_fatalerror
+ ("Antialiasing filter:Unsupported colormask! Ask authors to add support for this :)");
+ }
+ for (i = r1; i < r2; i++) {
+ dest = (unsigned char *) desti->currlines[i];
+ destend = dest + desti->width * 3;
+ ystart = ((unsigned int) i) << s->shift;
+ xstart = 0;
+ c = 1;
+ for (; dest < destend; dest++) {
+ if (s->shift > 1) {
+ sum = 0;
+ for (y = 0; y < 4; y++) {
+ src =
+ (unsigned char *) srci->currlines[y + ystart] +
+ xstart;
+ sum += (unsigned int) src[0];
+ sum += (unsigned int) src[3];
+ sum += (unsigned int) src[6];
+ sum += (unsigned int) src[9];
+ }
+ sum >>= 4;
+ } else {
+ src = (unsigned char *) srci->currlines[ystart] + xstart;
+ sum = (unsigned int) src[0];
+ sum += (unsigned int) src[3];
+ src =
+ (unsigned char *) srci->currlines[ystart + 1] + xstart;
+ sum += (unsigned int) src[0];
+ sum += (unsigned int) src[3];
+ sum >>= 2;
+ }
+ *dest = (unsigned char) sum;
+ if (c == 3)
+ c = 0, xstart += xstep;
+ c++;
+ xstart++;
+ }
+ }
+}
+#endif
+#ifdef SUPPORT16
+#define MASKR1 ((unsigned int)((31+31744)+(31*65536*32)))
+#define MASKR2 ((unsigned int)((31+31744)*(65536/32)+31))
+
+#define MASKRH1 (31+31744)
+#define MASKRH2 (31*32)
+static void anti16(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ struct image *srci = f->childimage, *desti = f->image;
+ struct antidata *s = (struct antidata *) f->data;
+ register unsigned int *src;
+ unsigned short *destend, *dest;
+ int ystart, y;
+ int xstart;
+ register unsigned int sum1 = 0, sum2 = 0, sum;
+ unsigned int xstep = 1U << (s->shift - 1);
+ int i;
+ unsigned int mask1 =
+ (srci->palette->info.truec.
+ mask2 | (srci->palette->info.truec.mask1 << 16)) >> 4;
+ unsigned int mask2 =
+ srci->palette->info.truec.mask1 | (srci->palette->info.truec.
+ mask2 << 16);
+ for (i = r1; i < r2; i++) {
+ dest = (unsigned short *) desti->currlines[i];
+ destend = dest + desti->width;
+ ystart = ((unsigned int) i) << s->shift;
+ xstart = 0;
+ for (; dest < destend; dest++) {
+ if (xstep > 2) {
+ sum1 = sum2 = 0;
+ for (y = 0; y < 4; y++) {
+ src =
+ (unsigned int *) srci->currlines[y + ystart] +
+ xstart;
+ sum1 += ((unsigned int) src[0] >> 4) & mask1;
+ sum2 += ((unsigned int) src[0] >> 4) & mask2;
+ sum1 += (unsigned int) src[1] & mask1;
+ sum2 += (unsigned int) src[1] & mask2;
+ }
+ sum = ((sum1 >> 4) + (sum2 >> 16)) >> 4;
+ sum1 = (sum2 + (sum1 >> 12)) >> 4;
+ } else {
+ src = (unsigned int *) srci->currlines[ystart] + xstart;
+ sum1 = ((unsigned int) src[0] >> 4) & mask1;
+ sum2 = (unsigned int) src[0] & mask2;
+ src =
+ (unsigned int *) srci->currlines[ystart + 1] + xstart;
+ sum1 += ((unsigned int) src[0] >> 4) & mask1;
+ sum2 += (unsigned int) src[0] & mask2;
+ sum = ((sum1 << 4) + (sum2 >> 16)) >> 2;
+ sum1 = (sum2 + (sum1 >> 12)) >> 2;
+ }
+ *dest =
+ (sum & srci->palette->info.truec.
+ mask2) | (sum1 & srci->palette->info.truec.mask1);
+ xstart += xstep;
+ }
+ }
+}
+#endif
+
+
+#define MASK1 0x00ff00ff
+static void anti32(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ struct image *srci = f->childimage, *desti = f->image;
+ struct antidata *s = (struct antidata *) f->data;
+ register unsigned int *src;
+ unsigned int *destend, *dest;
+ unsigned int ystart, y;
+ unsigned int xstart;
+ register unsigned int sum1 = 0, sum2 = 0;
+ unsigned int xstep = 1U << s->shift;
+ int i;
+ if (!srci->palette->info.truec.byteexact) {
+ x_fatalerror
+ ("Antialiasing filter:Unsupported colormask2! ask authors to add support for this :)");
+ }
+ for (i = r1; i < r2; i++) {
+ dest = (unsigned int *) desti->currlines[i];
+ destend = dest + desti->width;
+ ystart = ((unsigned int) i) << s->shift;
+ xstart = 0;
+ for (; dest < destend; dest++) {
+ if (xstep > 2) {
+ sum1 = sum2 = 0;
+ for (y = 0; y < 4; y++) {
+ src =
+ (unsigned int *) srci->currlines[y + ystart] +
+ xstart;
+ sum1 += (unsigned int) src[0] & MASK1;
+ sum2 += ((unsigned int) src[0] >> 8) & MASK1;
+ sum1 += (unsigned int) src[1] & MASK1;
+ sum2 += ((unsigned int) src[1] >> 8) & MASK1;
+ sum1 += (unsigned int) src[2] & MASK1;
+ sum2 += ((unsigned int) src[2] >> 8) & MASK1;
+ sum1 += (unsigned int) src[3] & MASK1;
+ sum2 += ((unsigned int) src[3] >> 8) & MASK1;
+ }
+ sum1 >>= 4;
+ sum2 >>= 4;
+ } else {
+ src = (unsigned int *) srci->currlines[ystart] + xstart;
+ sum1 = (unsigned int) src[0] & MASK1;
+ sum2 = ((unsigned int) src[0] >> 8) & MASK1;
+ sum1 += (unsigned int) src[1] & MASK1;
+ sum2 += ((unsigned int) src[1] >> 8) & MASK1;
+ src =
+ (unsigned int *) srci->currlines[ystart + 1] + xstart;
+ sum1 += (unsigned int) src[0] & MASK1;
+ sum2 += ((unsigned int) src[0] >> 8) & MASK1;
+ sum1 += (unsigned int) src[1] & MASK1;
+ sum2 += ((unsigned int) src[1] >> 8) & MASK1;
+ sum1 >>= 2;
+ sum2 >>= 2;
+ }
+ *dest = (sum1 & MASK1) | ((sum2 & MASK1) << 8);
+ xstart += xstep;
+ }
+ }
+}
+
+static int doit(struct filter *f, int flags, int time1)
+{
+ int val;
+ updateinheredimage(f);
+ val = f->previous->action->doit(f->previous, flags, time1);
+ switch (f->image->palette->type) {
+ case GRAYSCALE:
+ xth_function(antigray, f, f->image->height);
+ break;
+#ifdef STRUECOLOR24
+ case TRUECOLOR24:
+ xth_function(anti24, f, f->image->height);
+ break;
+#endif
+#ifdef SUPPORT16
+ case TRUECOLOR16:
+ xth_function(anti16, f, f->image->height);
+ break;
+#endif
+ case TRUECOLOR:
+ xth_function(anti32, f, f->image->height);
+ break;
+ }
+ xth_sync();
+ return val;
+}
+
+static void convertup(struct filter *f, int *x, int *y)
+{
+ struct antidata *s = (struct antidata *) f->data;
+ *x >>= s->shift;
+ *y >>= s->shift;
+ f->next->action->convertup(f->next, x, y);
+}
+
+static void convertdown(struct filter *f, int *x, int *y)
+{
+ struct antidata *s = (struct antidata *) f->data;
+ *x <<= s->shift;
+ *y <<= s->shift;
+ f->previous->action->convertdown(f->previous, x, y);
+}
+
+
+CONST struct filteraction antialias_filter = {
+ "Antialiasing",
+ "anti",
+ 0,
+ getinstance,
+ destroyinstance,
+ doit,
+ requirement,
+ initialize,
+ convertup,
+ convertdown,
+ NULL,
+};
diff --git a/src/engine/blur.c b/src/engine/blur.c
new file mode 100644
index 0000000..bfef8f3
--- /dev/null
+++ b/src/engine/blur.c
@@ -0,0 +1,393 @@
+#include <config.h>
+#ifndef _plan9_
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#include <string.h>
+#include <math.h>
+#include <stdio.h>
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+#include <stdlib.h>
+#else
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#endif
+#include <filter.h>
+#include <fractal.h>
+#include <xthread.h>
+#include <xerror.h>
+#include <archaccel.h>
+#define SIZE 64
+#define SIZE2 8
+#define AMOUNT 0.005
+#define DIV 1000.0
+#define MAXFRAMES 800*1000 /*after 800 frames should be OK */
+struct blurdata {
+ int bckuptime;
+ int counter;
+ struct palette *savedpalette, *palette;
+ unsigned char (*table)[256]; /*Used by blur routines */
+ int n;
+};
+static int requirement(struct filter *f, struct requirements *r)
+{
+ f->req = *r;
+ r->nimages = 1;
+ r->flags |= IMAGEDATA;
+ r->supportedmask =
+ C256 | TRUECOLOR24 | TRUECOLOR | TRUECOLOR16 | GRAYSCALE;
+ return (f->next->action->requirement(f->next, r));
+}
+
+static void blur8(struct filter *f)
+{
+ struct image *desti = f->image;
+ struct blurdata *s = (struct blurdata *) f->data;
+ unsigned char (*table)[256] = s->table;
+ unsigned int i, i1, im, im1, ipl, ii;
+ if (f->image->palette->type == C256)
+ for (i = im = 0; i < SIZE; i++, im += 256 - s->n) {
+ for (i1 = im1 = 0; i1 < SIZE2;
+ i1++, im1 += s->n * (SIZE / SIZE2)) {
+ ipl = (im + im1 + 128) >> 8;
+ ii = i1 * (SIZE / SIZE2);
+ if (ipl == i && i != ii) {
+ if (i < ii)
+ ipl++;
+ else
+ ipl--;
+ }
+ ii = desti->palette->pixels[i];
+ table[i1][ii] =
+ (unsigned char) desti->palette->pixels[ipl];
+ }
+ } else
+ for (i = im = desti->palette->start, im *= 256 - s->n;
+ i < (unsigned int) desti->palette->end; i++, im += 256 - s->n)
+ {
+ for (i1 = im1 = desti->palette->start, im1 *= s->n;
+ i1 < (unsigned int) desti->palette->end;
+ i1++, im1 += s->n) {
+ ipl = (im + im1 + 128) >> 8;
+ if (ipl == i && i != i1) {
+ if (i < i1)
+ ipl++;
+ else
+ ipl--;
+ }
+ table[i1][i] = (unsigned char) ipl;
+ }
+ }
+}
+
+static void blurtruecolor(struct filter *f)
+{
+ struct blurdata *s = (struct blurdata *) f->data;
+ unsigned int i, i1, im, im1;
+ unsigned char (*table)[256] = s->table;
+ for (i = im = 0; i < 256; i++, im += 256 - s->n) {
+ for (i1 = im1 = 0; i1 < 256; i1++, im1 += s->n)
+ table[i1][i] = (unsigned char) ((im + im1) >> 8);
+ }
+}
+
+static void clear_image2(struct image *img)
+{
+ int i;
+ int color = img->palette->pixels[0];
+ int width = img->width * img->bytesperpixel;
+ if (!width)
+ width = (img->width + 7) / 8;
+ for (i = 0; i < img->height; i++)
+ memset_long(img->currlines[i], color, (size_t) width);
+}
+
+
+static int initialize(struct filter *f, struct initdata *i)
+{
+ struct blurdata *s = (struct blurdata *) f->data;
+ unsigned int x;
+ inhermisc(f, i);
+ s->counter = 0;
+ s->palette->size = SIZE2;
+ for (x = 0; x < SIZE2; x++)
+ s->palette->pixels[x] = x;
+ if (datalost(f, i) || i->image->version != f->imageversion) {
+ s->bckuptime = MAXFRAMES;
+ s->counter = MAXFRAMES;
+ if (i->image->palette->type == C256) {
+ if (s->savedpalette == NULL)
+ s->savedpalette = clonepalette(i->image->palette);
+ mkblurpalette(i->image->palette);
+ } else {
+ if (s->savedpalette != NULL) {
+ restorepalette(i->image->palette, s->savedpalette);
+ destroypalette(s->savedpalette);
+ s->savedpalette = NULL;
+ }
+ }
+ clear_image2(i->image);
+ }
+ if (!inherimage
+ (f, i, TOUCHIMAGE | IMAGEDATA, 0, 0,
+ i->image->palette->type == C256 ? s->palette : NULL, 0, 0))
+ return 0;
+ if (f->image->palette->type == C256) {
+ setfractalpalette(f, s->savedpalette);
+ }
+ if (i->image == NULL) {
+ return 0;
+ }
+ return (f->previous->action->initialize(f->previous, i));
+}
+
+static struct filter *getinstance(CONST struct filteraction *a)
+{
+ struct filter *f = createfilter(a);
+ struct blurdata *i = (struct blurdata *) calloc(1, sizeof(*i));
+ i->savedpalette = NULL;
+ i->palette =
+ createpalette(0, 256, SMALLITER, 0, 256, NULL, NULL, NULL, NULL,
+ NULL);
+ i->palette->size = SIZE2;
+ i->palette->end = SIZE2;
+ i->table = NULL;
+ f->childimage = NULL;
+ f->data = i;
+ f->name = "Motionblur";
+ return (f);
+}
+
+static void destroyinstance(struct filter *f)
+{
+ struct blurdata *i = (struct blurdata *) f->data;
+ if (i->table != NULL)
+ free(i->table);
+ if (i->savedpalette != NULL)
+ destroypalette(i->savedpalette);
+ destroypalette(i->palette);
+ destroyinheredimage(f);
+ free(f->data);
+ free(f);
+}
+
+/* An part of blur function that should be done paraely */
+static void blur82(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ struct image *srci = f->childimage, *desti = f->image;
+ struct blurdata *s = (struct blurdata *) f->data;
+ unsigned char (*table)[256];
+ int i, im;
+ unsigned char *src, *dest, *srcend;
+
+ im = srci->width;
+ table = s->table;
+ for (i = r1; i < r2; i++) {
+ src = srci->currlines[i];
+ srcend = src + im;
+ dest = desti->currlines[i];
+ for (; src < srcend; src++, dest++) {
+ dest[0] = table[src[0]][dest[0]];
+ }
+ }
+}
+
+#ifdef SUPPORT16
+static void blur16(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ struct image *srci = f->childimage, *desti = f->image;
+ struct blurdata *s = (struct blurdata *) f->data;
+ struct truec *info = &srci->palette->info.truec;
+ unsigned int rmask = info->rmask;
+ unsigned int gmask = info->gmask;
+ unsigned int bmask = info->bmask;
+ unsigned int n = (unsigned int) s->n;
+ int i;
+ pixel16_t *src, *dest, *srcend;
+ for (i = r1; i < r2; i++) {
+ src = (pixel16_t *) srci->currlines[i];
+ srcend = src + srci->width;
+ dest = (pixel16_t *) desti->currlines[i];
+ for (; src < srcend; src++, dest++) {
+ *dest = interpol(*src, *dest, n, rmask, gmask, bmask);
+ }
+ }
+}
+#endif
+#ifdef STRUECOLOR24
+static void blur24(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ struct image *srci = f->childimage, *desti = f->image;
+ struct blurdata *s = (struct blurdata *) f->data;
+ unsigned char (*table)[256] = s->table;
+ unsigned char *src, *dest, *srcend;
+ int i, im;
+ im = srci->width * 3;
+ if (!srci->palette->info.truec.byteexact) {
+ x_fatalerror
+ ("Blur filter:unsupported color configuration! Please contact authors.");
+ }
+ for (i = r1; i < r2; i++) {
+ src = srci->currlines[i];
+ srcend = src + im;
+ dest = desti->currlines[i];
+ for (; src < srcend; src += 3, dest += 3) {
+ dest[0] = table[src[0]][dest[0]];
+ dest[1] = table[src[1]][dest[1]];
+ dest[2] = table[src[2]][dest[2]];
+ }
+ }
+}
+#endif
+static void blur32(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ struct image *srci = f->childimage, *desti = f->image;
+ struct blurdata *s = (struct blurdata *) f->data;
+ unsigned char (*table)[256] = s->table;
+ unsigned char *src, *dest, *srcend;
+ int i, im;
+ im = srci->width * 4;
+ if (!srci->palette->info.truec.byteexact) {
+ x_fatalerror
+ ("Blur filter:unsupported color configuration! Please contact authors.");
+ }
+ for (i = r1; i < r2; i++) {
+ src = srci->currlines[i];
+ srcend = src + im;
+ dest = desti->currlines[i];
+ switch (f->image->palette->info.truec.missingbyte) {
+ case 3:
+ for (; src < srcend; src += 4, dest += 4) {
+ dest[0] = table[src[0]][dest[0]];
+ dest[1] = table[src[1]][dest[1]];
+ dest[2] = table[src[2]][dest[2]];
+ }
+ break;
+ case 2:
+ for (; src < srcend; src += 4, dest += 4) {
+ dest[0] = table[src[0]][dest[0]];
+ dest[1] = table[src[1]][dest[1]];
+ dest[3] = table[src[2]][dest[2]];
+ }
+ break;
+ case 1:
+ for (; src < srcend; src += 4, dest += 4) {
+ dest[0] = table[src[0]][dest[0]];
+ dest[2] = table[src[1]][dest[1]];
+ dest[3] = table[src[2]][dest[2]];
+ }
+ break;
+ case 0:
+ for (; src < srcend; src += 4, dest += 4) {
+ dest[1] = table[src[1]][dest[1]];
+ dest[2] = table[src[2]][dest[2]];
+ dest[3] = table[src[3]][dest[3]];
+ }
+ break;
+ default:
+ for (; src < srcend; src += 4, dest += 4) {
+ dest[1] = table[src[1]][dest[1]];
+ dest[2] = table[src[2]][dest[2]];
+ dest[3] = table[src[3]][dest[3]];
+ dest[4] = table[src[4]][dest[4]];
+ }
+ }
+ }
+}
+
+static int doit(struct filter *f, int flags, int time1)
+{
+ int val, n;
+ int time = time1;
+ struct blurdata *s = (struct blurdata *) f->data;
+ updateinheredimage(f);
+ val = f->previous->action->doit(f->previous, flags, time);
+ s->counter += time;
+ if (val & CHANGED)
+ s->counter = 0;
+ n = (int) ((1 - pow(1.0 - AMOUNT, (time + s->bckuptime) / DIV)) * 256);
+ if (s->counter >= 2 * MAXFRAMES) {
+ return val;
+ }
+ if (n < 10) {
+ s->bckuptime += time;
+ return val | ANIMATION;
+ }
+ s->bckuptime = 0;
+ if (s->counter >= MAXFRAMES)
+ n = 256, s->counter = 2 * MAXFRAMES;
+ if (s->n != n) {
+ s->n = n;
+ switch (f->image->bytesperpixel) {
+ case 1:
+ if (s->table == NULL)
+ s->table = (unsigned char (*)[256]) malloc(256 * 256);
+ blur8(f);
+ break;
+ case 3:
+ case 4:
+ if (s->table == NULL)
+ s->table = (unsigned char (*)[256]) malloc(256 * 256);
+ blurtruecolor(f);
+ break;
+ default:
+ if (s->table != NULL)
+ free(s->table), s->table = NULL;
+ }
+ }
+ switch (f->image->palette->type) {
+ case C256:
+ case GRAYSCALE:
+ xth_function(blur82, f, f->image->height);
+ break;
+#ifdef SUPPORT16
+ case TRUECOLOR16:
+ xth_function(blur16, f, f->image->height);
+ break;
+#endif
+ case TRUECOLOR:
+ xth_function(blur32, f, f->image->height);
+ break;
+#ifdef STRUECOLOR24
+ case TRUECOLOR24:
+ xth_function(blur24, f, f->image->height);
+ break;
+#endif
+ }
+ xth_sync();
+ if (s->counter == 2 * MAXFRAMES) {
+ return val | CHANGED;
+ }
+ return val | CHANGED | ANIMATION;
+}
+
+static void myremovefilter(struct filter *f)
+{
+ struct blurdata *s = (struct blurdata *) f->data;
+ if (s->savedpalette != NULL) {
+ restorepalette(f->image->palette, s->savedpalette);
+ destroypalette(s->savedpalette);
+ s->savedpalette = NULL;
+ }
+}
+
+CONST struct filteraction blur_filter = {
+ "Motionblur",
+ "blur",
+ 0,
+ getinstance,
+ destroyinstance,
+ doit,
+ requirement,
+ initialize,
+ convertupgeneric,
+ convertdowngeneric,
+ myremovefilter
+};
diff --git a/src/engine/btrace.c b/src/engine/btrace.c
new file mode 100644
index 0000000..3c02570
--- /dev/null
+++ b/src/engine/btrace.c
@@ -0,0 +1,596 @@
+#include <config.h>
+#ifndef _plan9_
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+#include <limits.h>
+#else
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#endif
+#define SLARGEITER
+#include <filter.h>
+#include <fractal.h>
+#include <xthread.h>
+/*
+ * This is an implementation of famous boundary trace algorithm.
+ * See fractint documentation if you don't know what this means :)
+ *
+ * Here is two different implentation of this algorithm - one is faster
+ * and second is threadable.
+ *
+ * An faster one is quite usual implementation - get first uncalculated pixel,
+ * trace algorithm using labirinth "right hand rule" way (well, I currently
+ * use left hand rule) then trace same boundary again and fill. It is
+ * implemented in tracerectangle/tracecolor
+ *
+ * An threaded one follows description I sent to sci.fractals:
+ Hi
+ few weeks ago I asked for multithreaded algorithm for boundary trace
+ I received following reply by Paul Derbyshire
+ > One method is this. One b-trace algorithm pushes pixels onto a stack.
+ > Initially the screen border pixels are all pushed. Then a loop starts. A
+ > pixel is popped and calculated or recalled, with 4 orthogonal neighbors
+ > calculated or recalled if already calculated; if the central pixel is at a
+ > color boundary the neighbors are pushed. The image is done when the stack
+ > hits empty, then empty areas of image are floodfilled by their boundary
+ > color. (Fractint does it differently, not sure how). By this method, the
+ > stack will usually have at least 4 pixels, and so four substacks can be
+ > assigned to each of 4 processors, and each processor has a "processor to
+ > its left" designated as if they were in a "logical" ring. Each processor
+ > pushes new pixels on the processor to its left's substack, and pops from
+ > its own. This way, busy parts of the image wind up spread among all
+ > processors. By adding substacks, this can be expanded to accomodate more
+ > processors. Some amount is optimal, after which a point of diminishing
+ > returns is reached when most processors only do a few pixels and spend
+ > most of their time waiting for new stuff from the processor to its right.
+ > You'll need to figure out this optimum somehow; I can't guess what it
+ > would be. Probably around 64 processors. (More than that, you would do
+ > well just to assign separate processors small rectangular subsets of the
+ > image anyways.) Also, the end is only reached when NO processors have
+ > anything in their stacks.
+ This method looks very interesting but has few serious problems.
+ Most significant probably is that it always caluclates pixels up
+ to distance 3 from boundary. Simple modification should lower it
+ to distance 2. But "right hand rule" based algorithm should actualy
+ calculate points just to distance 1. So I want to implement such alrogithm,
+ since number of caluclated points is still significant.
+
+ So I think I have to extend stack for two informations:
+ 1) direction
+ 2) color of boundary I am tracking(not color I am at)
+ and main algorithm should look like:
+ 1) detect color of current point
+ 2) look right. Is there same color?
+ yes:add point at the right to stack and exit
+ is there boundary color?
+ no:we are meeting boundary with different color - so we need
+ to track this boundary too. add point at right to stack with oposite
+ direction and boundary color set to current color
+ 3) look forward: similiar scheme as to look right
+ 4) look left: again similiar
+ 5) exit
+
+ This hould trace boundaries to distance 1 (I hope) and do not miss anything.
+ Problem is that this algorithm never ends, since boundaries will be rescaned
+ again and again. So I need to add an caluclated array wich should looks like:
+ for every point has mask for all directions that were scaned+calculated mask
+ (set to 1 if pixel is already calculated)+inprocess mask(set to 1 if some
+ other processor is currently calculating it)
+
+ Scan masks should be set in thime when pixel is added to stack and pixel
+ should not be added in case that mask is already set. I don't this that locks
+ to this array is required since time spent by setting masks should be quite
+ small and possible race conditions should not be drastical(except recalculating
+ some point)
+
+ I was also thinking about perCPU queues. I think that one queue is OK,
+ it is simplier and should not take much more time(except it will be locked
+ more often but time spend in locked queue in comparsion to time spent
+ in rest should be so small so this should not be drastical for less than 10
+ procesors)
+
+ At the other hand - perCPU queues should have one advantage - each
+ cpu should own part of image and points from its part will be added to
+ this cpu. This should avoid procesor cache conflict and speed up process.
+ At the other hand, when cpu's queue is empty, cpu will have to browse
+ others queues too and steal some points from other CPU, wich should introduce
+ some slowdown and I am not sure if this way will bring any improvement.
+
+ Other think that should vote for perCPU queue is fact, that in one CPU
+ queue should be more often situations when queue is empty since one procesor
+ is caluclating points and other has wait, since it had tendency to trace
+ just one boundary at the time. At the other hand, most of boundaries should
+ cross broders, so they should be added to queue at the initialization, so
+ this should be OK.
+
+ I am beginer to threds, SMP etc. So I looking for ideas, and suggestions
+ to improve this alg. (or design different one).
+ Also someone with SMP box, who should test me code is welcomed.
+ BTW whats is the average/maximal number of CPU in todays SMP boxes?
+
+ Please reply directly to my email:hubicka@paru.cas.cz
+
+ Thanks
+ Honza
+ * This way is implemented in tracerectangle2/tracepoint. It is enabled
+ * just when threads are compiled in. Also when nthreads=1, old faster
+ * algorithm is used.
+ *
+ * Implementation notes:
+ * 1) I decided to use one queue instead of stack, since I expect, it will
+ * have tendency to trace all boundaries at the time, not just one.
+ * This will make queue bigger and reduce probability of situation, where
+ * queue is empty and other processors has to wait for one, that is
+ * calculating and should add something there (maybe :)
+ * 2) Stack (queue :) is used just when neccesary - in situations where queue
+ * is quite full (there is more items than 10) procesor just continues in
+ * tracing path it started. This reduces number of slow stack operations,
+ * locks/unlocks, cache conflicts and other bad thinks.
+ * 3) Just each fourth pixel should be added into queue
+ * 4) Foodfill algorithm should be avoided since colors at the boundaries
+ * are always correct, we should simply go trought each scanline and when
+ * pixel is uncalcualted, copy value from its left neighbor
+ *
+ * Current implementation has about 6% lower results than "fast" algorithm
+ * using one thread. When two threads enabled (at my one processor linux
+ * box) lock/unlock overhead eats next 8%, three threads eats next 1% :)
+ */
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+#include <archaccel.h>
+
+#include <filter.h>
+#include <btrace.h>
+#include <plane.h>
+#include "calculate.h"
+
+#define UP 0
+#define RIGHT 1
+#define DOWN 2
+#define LEFT 3
+#define turnleft(d) (((d)+3)&3)
+#define turnright(d) (((d)+1)&3)
+#define turnoposite(d) (((d)+2)&3)
+#define callwait() if(cfilter.wait_function!=NULL) cfilter.wait_function(&cfilter);
+
+
+#ifndef nthreads
+static int size;
+static unsigned int inset;
+static int nwaiting;
+static int exitnow;
+#define PAGESHIFT 14
+#define PAGESIZE (1<<PAGESHIFT)
+#define MAXPAGES 200 /*Well limit is about 6MB of stack..Hope it will never owerflow */
+#define MAXSIZE (MAXPAGES*PAGESIZE-1)
+struct stack {
+ int color;
+ short x, y;
+ char direction;
+};
+static int npages[MAXTHREADS];
+static struct stack *pages[MAXPAGES];
+static struct stack **starts[MAXTHREADS];
+static int sizes[MAXTHREADS];
+static int maxsize, maxsize2;
+static CONST char dirrections[][2] = {
+ {0, -1},
+ {1, 0},
+ {0, 1},
+ {-1, 0},
+};
+
+#define addstack(sx,sy,d,c,periodicity) { \
+ int page; \
+ int nstack=(((sy)-ystart)*nthreads)/(yend-ystart+1); \
+ struct stack *ptr; \
+ calculated[sx+sy*CALCWIDTH]|=1<<d; \
+ xth_lock(0); \
+ if(size<maxsize2) {\
+ while(sizes[nstack]>=maxsize) if(nstack>=nthreads-1) nstack=0; else nstack++; \
+ page=sizes[nstack]>>PAGESHIFT; \
+ if(page==npages[nstack]) starts[nstack][npages[nstack]]=(struct stack *)malloc(sizeof(struct stack)*PAGESIZE),npages[nstack]++;\
+ ptr=starts[nstack][page]+(sizes[nstack]&(PAGESIZE-1)); \
+ ptr->x=sx; \
+ ptr->y=sy; \
+ if(periodicity) \
+ ptr->direction=d|8; else \
+ ptr->direction=d; \
+ ptr->color=c; \
+ size++; \
+ sizes[nstack]++; \
+ if(nwaiting) xth_wakefirst(0); \
+ } \
+ xth_unlock(0); \
+}
+/*Non locking one used by init code */
+#define addstack1(sx,sy,d,c) { \
+ int page; \
+ struct stack *ptr; \
+ int nstack=(((sy)-y1)*nthreads)/(y2-y1+1); \
+ calculated[sx+sy*CALCWIDTH]|=1<<d; \
+ if(size<maxsize2) {\
+ while(sizes[nstack]>=maxsize) if(nstack==nthreads-1) nstack=0; else nstack++; \
+ page=sizes[nstack]>>PAGESHIFT; \
+ if(page==npages[nstack]) starts[nstack][npages[nstack]]=(struct stack *)malloc(sizeof(struct stack)*PAGESIZE),npages[nstack]++; \
+ ptr=starts[nstack][page]+(sizes[nstack]&(PAGESIZE-1)); \
+ ptr->x=sx; \
+ ptr->y=sy; \
+ ptr->direction=d|8; \
+ ptr->color=c; \
+ size++; \
+ sizes[nstack]++; \
+ } \
+}
+static int xstart, ystart, xend, yend;
+#endif
+
+static unsigned char *calculated;
+#define CALCULATED 16
+#define CALCULATING 32
+#define CALCWIDTH cimage.width
+
+static number_t *xcoord, *ycoord;
+#ifndef inline
+REGISTERS(3)
+CONSTF static pixel32_t calculatepixel(int x, int y, int peri)
+{
+ return (calculate(xcoord[x], ycoord[y], peri));
+}
+#else
+#define calculatepixel(x,y,peri) (calculate(xcoord[x],ycoord[y],peri))
+#endif
+#define putpixel(x,y,c) p_setp((cpixel_t *)cimage.currlines[y],x,c)
+#define getpixel(x,y) p_getp((cpixel_t *)cimage.currlines[y],x)
+#include <c256.h>
+#define tracecolor tracecolor8
+#define tracepoint tracepoint8
+#define dosymetries dosymetries8
+#define queue queue8
+#define bfill bfill8
+#include "btraced.c"
+#include <hicolor.h>
+#define tracecolor tracecolor16
+#define tracepoint tracepoint16
+#define dosymetries dosymetries16
+#define queue queue16
+#define bfill bfill16
+#include "btraced.c"
+#include <true24.h>
+#define tracecolor tracecolor24
+#define tracepoint tracepoint24
+#define dosymetries dosymetries24
+#define queue queue24
+#define bfill bfill24
+#include "btraced.c"
+#include <truecolor.h>
+#define tracecolor tracecolor32
+#define tracepoint tracepoint32
+#define dosymetries dosymetries32
+#define queue queue32
+#define bfill bfill32
+#include "btraced.c"
+
+#ifdef HAVE_GETTEXT
+#include <libintl.h>
+#else
+#define gettext(STRING) STRING
+#endif
+
+#ifndef SLOWCACHESYNC
+#ifndef nthreads
+static int tracerectangle2(int x1, int y1, int x2, int y2)
+{
+ int x, y;
+ cfilter.max = y2 - y1;
+ cfilter.pass = gettext("Boundary trace");
+ cfilter.pos = 0;
+ maxsize = MAXPAGES / nthreads;
+ for (y = 0; y < nthreads; y++) {
+ npages[y] = 0; /*stack is empty */
+ sizes[y] = 0;
+ starts[y] = pages + y * maxsize;
+ }
+ maxsize *= PAGESIZE;
+ maxsize2 = maxsize * nthreads;
+ size = 0;
+ nwaiting = 0;
+ exitnow = 0;
+ inset = cpalette.pixels[0];
+ for (y = y1; y <= y2; y++) {
+ memset_long(calculated + x1 + y * CALCWIDTH, 0, x2 - x1 + 1);
+ }
+ for (x = x1; x <= x2; x += 4) {
+ addstack1(x, y1, LEFT, INT_MAX);
+ addstack1(x, y2, RIGHT, INT_MAX);
+ }
+ for (y = y1; y <= y2; y += 4) {
+ addstack1(x1, y, DOWN, INT_MAX);
+ addstack1(x2, y, UP, INT_MAX);
+ }
+ xstart = x1;
+ ystart = y1;
+ xend = x2;
+ yend = y2;
+ switch (cimage.bytesperpixel) {
+ case 1:
+ xth_function(queue8, NULL, 1);
+ xth_sync();
+ xth_function(bfill8, NULL, yend - ystart - 1);
+ break;
+#ifdef SUPPORT16
+ case 2:
+ xth_function(queue16, NULL, 1);
+ xth_sync();
+ xth_function(bfill16, NULL, yend - ystart - 1);
+ break;
+#endif
+#ifdef STRUECOLOR24
+ case 3:
+ xth_function(queue24, NULL, 1);
+ xth_sync();
+ xth_function(bfill24, NULL, yend - ystart - 1);
+ break;
+#endif
+ case 4:
+ xth_function(queue32, NULL, 1);
+ xth_sync();
+ xth_function(bfill32, NULL, yend - ystart - 1);
+ break;
+ }
+ xth_sync();
+ for (y = 0; y < nthreads; y++)
+ for (x = 0; x < npages[y]; x++)
+ free(starts[y][x]); /*free memory allocated for stack */
+ return 1;
+}
+#endif
+#endif
+static void skip(int x1, int y1, int x2, int y2)
+{
+ int src = y1;
+ int xstart = x1 * cimage.bytesperpixel;
+ int xsize = (x2 - x1 + 1) * cimage.bytesperpixel;
+ y1++;
+ for (; y1 <= y2; y1++) {
+ memcpy(cimage.currlines[y1] + xstart,
+ cimage.currlines[src] + xstart, xsize);
+ ycoord[y1] = ycoord[src];
+ }
+}
+
+static int tracerectangle(int x1, int y1, int x2, int y2)
+{
+ int x, y;
+ unsigned char *calc;
+ cfilter.max = y2 - y1;
+ cfilter.pass = gettext("Boundary trace");
+ cfilter.pos = 0;
+ for (y = y1; y <= y2; y++) {
+ memset_long(calculated + x1 + y * CALCWIDTH, 0,
+ (size_t) (x2 - x1 + 1));
+ }
+ switch (cimage.bytesperpixel) {
+ case 1:
+ for (y = y1; y <= y2; y++) {
+ calc = calculated + y * CALCWIDTH;
+ for (x = x1; x <= x2; x++)
+ if (!calc[x]) {
+ tracecolor8(x1, y1, x2, y2, x, y);
+ }
+ cfilter.pos = y - y1;
+ callwait();
+ if (cfilter.interrupt) {
+ skip(x1, y, x2, y2);
+ return 0;
+ }
+ }
+ break;
+#ifdef SUPPORT16
+ case 2:
+ for (y = y1; y <= y2; y++) {
+ calc = calculated + y * CALCWIDTH;
+ for (x = x1; x <= x2; x++)
+ if (!calc[x]) {
+ tracecolor16(x1, y1, x2, y2, x, y);
+ }
+ cfilter.pos = y - y1;
+ callwait();
+ if (cfilter.interrupt) {
+ skip(x1, y, x2, y2);
+ return 0;
+ }
+ }
+ break;
+#endif
+#ifdef STRUECOLOR24
+ case 3:
+ for (y = y1; y <= y2; y++) {
+ calc = calculated + y * CALCWIDTH;
+ for (x = x1; x <= x2; x++)
+ if (!calc[x]) {
+ tracecolor24(x1, y1, x2, y2, x, y);
+ }
+ cfilter.pos = y - y1;
+ callwait();
+ if (cfilter.interrupt) {
+ skip(x1, y, x2, y2);
+ return 0;
+ }
+ }
+#endif
+ case 4:
+ for (y = y1; y <= y2; y++) {
+ calc = calculated + y * CALCWIDTH;
+ for (x = x1; x <= x2; x++)
+ if (!calc[x]) {
+ tracecolor32(x1, y1, x2, y2, x, y);
+ }
+ cfilter.pos = y - y1;
+ callwait();
+ if (cfilter.interrupt) {
+ skip(x1, y, x2, y2);
+ return 0;
+ }
+ }
+ break;
+ }
+ return 1;
+}
+
+int
+boundarytrace(int x1, int y1, int x2, int y2, number_t * xpos,
+ number_t * ypos)
+{
+ int i;
+ int i1;
+ int xsym, ysym;
+ int cy1, cy2;
+ int cx1, cx2;
+ int ydiv;
+#ifdef HAVE_ALLOCA
+ calculated = (unsigned char *) alloca(cimage.width * (y2 + 1));
+#else
+ calculated = (unsigned char *) malloc(cimage.width * (y2 + 1));
+#endif
+ if (calculated == NULL) {
+ return 0;
+ }
+ xcoord = xpos;
+ ycoord = ypos;
+
+
+ if (cursymetry.xsym < cfractalc.rs.nc
+ || cursymetry.xsym > cfractalc.rs.mc)
+ xsym = -10;
+ else
+ xsym =
+ (int) (0.5 +
+ ((cursymetry.xsym -
+ cfractalc.rs.nc) * cimage.width / (cfractalc.rs.mc -
+ cfractalc.rs.nc)));
+ if (cursymetry.ysym < cfractalc.rs.ni
+ || cursymetry.ysym > cfractalc.rs.mi)
+ ysym = -10;
+ else
+ ysym =
+ (int) (0.5 +
+ ((cursymetry.ysym -
+ cfractalc.rs.ni) * cimage.height / (cfractalc.rs.mi -
+ cfractalc.rs.
+ ni)));
+ ydiv =
+ (int) (0.5 +
+ ((-cfractalc.rs.ni) * cimage.height /
+ (cfractalc.rs.mi - cfractalc.rs.ni)));
+ if (xsym > x1 && xsym < x2) {
+ if (xsym - x1 > x2 - xsym)
+ cx1 = x1, cx2 = xsym;
+ else
+ /*xsym--, */ cx1 = xsym, cx2 = x2;
+ } else
+ xsym = -1, cx1 = x1, cx2 = x2;
+ if (ysym > y1 && ysym < y2) {
+ if (ysym - y1 > y2 - ysym)
+ cy1 = y1, cy2 = ysym;
+ else
+ cy1 = ysym, cy2 = y2;
+ } else
+ ysym = -1, cy1 = y1, cy2 = y2;
+ for (i = cx1; i <= cx2; i++) {
+ xcoord[i] =
+ cfractalc.rs.nc + i * (cfractalc.rs.mc -
+ cfractalc.rs.nc) / cimage.width;
+ }
+ for (i = cy1; i <= cy2; i++) {
+ ycoord[i] =
+ cfractalc.rs.ni + i * (cfractalc.rs.mi -
+ cfractalc.rs.ni) / cimage.height;
+ }
+ i = 1;
+#ifndef SLOWCACHESYNC
+#ifndef nthreads
+ if (nthreads != 1) {
+ if (ydiv > cy1 && ydiv < cy2) {
+ i |= tracerectangle2(cx1, cy1, cx2, ydiv),
+ i |= tracerectangle2(cx1, ydiv, cx2, cy2);
+ } else
+ i |= tracerectangle2(cx1, cy1, cx2, cy2);
+ } else
+#endif
+#endif
+ {
+ if (ydiv > cy1 && ydiv < cy2) {
+ i |= tracerectangle(cx1, cy1, cx2, ydiv),
+ i |= tracerectangle(cx1, ydiv, cx2, cy2);
+ } else
+ i |= tracerectangle(cx1, cy1, cx2, cy2);
+ }
+ if (!i) {
+#ifndef HAVE_ALLOCA
+ free(calculated);
+#endif
+ return 0;
+ }
+#ifndef HAVE_ALLOCA
+ free(calculated);
+#endif
+ drivercall(cimage,
+ dosymetries8(x1, x2, y1, y2, xsym, cx1, cx2),
+ dosymetries16(x1, x2, y1, y2, xsym, cx1, cx2),
+ dosymetries24(x1, x2, y1, y2, xsym, cx1, cx2),
+ dosymetries32(x1, x2, y1, y2, xsym, cx1, cx2));
+ for (i = cx1; i <= cx2; i++) {
+ if (xsym != -1) {
+ i1 = 2 * xsym - i;
+ if (i1 >= x1 && i1 <= x2 && i != i1)
+ xcoord[i1] = 2 * cursymetry.xsym - xcoord[i];
+ }
+ }
+ for (i = cy1; i <= cy2; i++) {
+ if (ysym != -1) {
+ i1 = 2 * ysym - i;
+ if (i1 >= y1 && i1 <= y2 && i != i1)
+ ycoord[i1] = 2 * cursymetry.ysym - ycoord[i];
+ }
+ }
+ if (cy1 != y1) {
+ register int yy1, yy2;
+ int xstart = x1 * cimage.bytesperpixel;
+ int xsize = (x2 - x1 + 1) * cimage.bytesperpixel;
+ yy1 = y1;
+ yy2 = 2 * ysym - y1;
+ while (yy1 < yy2) {
+ memcpy(cimage.currlines[yy1] + xstart,
+ cimage.currlines[yy2] + xstart, (size_t) xsize);
+ yy1++;
+ yy2--;
+ }
+ }
+ if (cy2 != y2) {
+ register int yy1, yy2;
+ int xstart = x1 * cimage.bytesperpixel;
+ int xsize = (x2 - x1 + 1) * cimage.bytesperpixel;
+ yy1 = y2;
+ yy2 = 2 * ysym - y2;
+ while (yy1 > yy2) {
+ memcpy(cimage.currlines[yy1] + xstart,
+ cimage.currlines[yy2] + xstart, (size_t) xsize);
+ yy1--;
+ yy2++;
+ }
+ }
+ return 1;
+}
+
+int boundarytraceall(number_t * xpos, number_t * ypos)
+{
+ return (boundarytrace
+ (0, 0, cimage.width - 1, cimage.height - 1, xpos, ypos));
+}
diff --git a/src/engine/btraced.c b/src/engine/btraced.c
new file mode 100644
index 0000000..e0073c0
--- /dev/null
+++ b/src/engine/btraced.c
@@ -0,0 +1,466 @@
+#ifndef UNSUPPORTED
+REGISTERS(3)
+static void
+tracecolor(int xstart, int ystart, int xend, int yend, register int
+ x, register int y)
+{
+ int dir = RIGHT, fill = 0;
+ register unsigned char *calc;
+ int peri = 0;
+ cpixeldata_t c = (cpixeldata_t) calculatepixel(x, y, 0);
+ cpixeldata_t w = (cpixeldata_t) 0;
+ cpixeldata_t inset = (cpixeldata_t) cpalette.pixels[0];
+ putpixel(x, y, c);
+ calc = calculated + x + y * CALCWIDTH;
+ *calc = (unsigned char) 1;
+ while (x > xstart && getpixel(x - 1, y) == c)
+ x--, calc--;
+ *calc = (unsigned char) 2;
+ if (c == inset)
+ peri = 1;
+ do {
+ if (!fill && !*calc) {
+ *calc = (unsigned char) 1;
+ putpixel(x, y, c);
+ }
+ switch (dir) {
+ case RIGHT:
+ if (y > ystart) {
+ if (!*(calc - CALCWIDTH)) {
+ w = (cpixeldata_t) calculatepixel(x, y - 1, peri);
+ putpixel(x, y - 1, w);
+ *(calc - CALCWIDTH) = (unsigned char) 1;
+ } else
+ w = getpixel(x, y - 1);
+ if (w == c) {
+ dir = UP;
+ calc -= CALCWIDTH;
+ y--;
+ break;
+ }
+ }
+
+ if (x < xend) {
+ if (!*(calc + 1)) {
+ w = (cpixeldata_t) calculatepixel(x + 1, y, peri);
+ putpixel(x + 1, y, w);
+ *(calc + 1) = (unsigned char) 1;
+ } else
+ w = getpixel(x + 1, y);
+ if (w == c) {
+ calc++;
+ x++;
+ break;
+ }
+ }
+
+ if (y < yend) {
+ if (!*(calc + CALCWIDTH)) {
+ w = (cpixeldata_t) calculatepixel(x, y + 1, peri);
+ putpixel(x, y + 1, w);
+ *(calc + CALCWIDTH) = (unsigned char) 1;
+ } else
+ w = getpixel(x, y + 1);
+ if (w == c) {
+ dir = DOWN;
+ calc += CALCWIDTH;
+ y++;
+ break;
+ }
+ }
+
+ if (*calc == (unsigned char) 2) {
+ *calc = (unsigned char) 1;
+ return;
+ }
+
+ dir = LEFT;
+ x--;
+ calc--;
+ break;
+
+ case LEFT:
+ if (y < yend) {
+ if (!*(calc + CALCWIDTH)) {
+ w = (cpixeldata_t) calculatepixel(x, y + 1, peri);
+ putpixel(x, y + 1, w);
+ *(calc + CALCWIDTH) = (unsigned char) 1;
+ } else
+ w = getpixel(x, y + 1);
+ if (w == c) {
+ dir = DOWN;
+ calc += CALCWIDTH;
+ y++;
+ break;
+ }
+ }
+
+ if (x > xstart) {
+ if (!*(calc - 1)) {
+ w = (cpixeldata_t) calculatepixel(x - 1, y, peri);
+ putpixel(x - 1, y, w);
+ *(calc - 1) = (unsigned char) 1;
+ } else
+ w = getpixel(x - 1, y);
+ if (w == c) {
+ calc--;
+ x--;
+ break;
+ }
+ }
+
+ if (y > ystart) {
+ if (!*(calc - CALCWIDTH)) {
+ w = (cpixeldata_t) calculatepixel(x, y - 1, peri);
+ putpixel(x, y - 1, w);
+ *(calc - CALCWIDTH) = (unsigned char) 1;
+ } else
+ w = getpixel(x, y - 1);
+ if (w == c) {
+ dir = UP;
+ calc -= CALCWIDTH;
+ y--;
+ break;
+ }
+ }
+
+
+ dir = RIGHT;
+ x++;
+ calc++;
+ break;
+
+ case UP:
+ if (fill) {
+ unsigned char *calc1;
+ cpixel_t *pixel1;
+ calc1 = calc + 1;
+ pixel1 = p_add((cpixel_t *) cimage.currlines[y], x + 1);
+ while (pixel1 <=
+ p_add((cpixel_t *) cimage.currlines[y], xend)) {
+ if (!*calc1)
+ *calc1 = (unsigned char) 1, p_set(pixel1, c);
+ else if (p_get(pixel1) != c)
+ break;
+ p_inc(pixel1, 1);
+ calc1++;
+ }
+ }
+ if (x > xstart) {
+ if (!*(calc - 1)) {
+ w = (cpixeldata_t) calculatepixel(x - 1, y, peri);
+ putpixel(x - 1, y, w);
+ *(calc - 1) = (unsigned char) 1;
+ }
+ w = getpixel(x - 1, y);
+ if (w == c) {
+ dir = LEFT;
+ calc--;
+ x--;
+ break;
+ }
+ }
+
+ if (y > ystart) {
+ if (!*(calc - CALCWIDTH)) {
+ w = (cpixeldata_t) calculatepixel(x, y - 1, peri);
+ putpixel(x, y - 1, w);
+ *(calc - CALCWIDTH) = (unsigned char) 1;
+ }
+ w = getpixel(x, y - 1);
+ if (w == c) {
+ calc -= CALCWIDTH;
+ y--;
+ break;
+ }
+ }
+
+ if (x < xend) {
+ if (!*(calc + 1)) {
+ w = (cpixeldata_t) calculatepixel(x + 1, y, peri);
+ putpixel(x + 1, y, w);
+ *(calc + 1) = (unsigned char) 1;
+ } else
+ w = getpixel(x + 1, y);
+ if (w == c) {
+ dir = RIGHT;
+ calc++;
+ x++;
+ break;
+ }
+ }
+
+ dir = DOWN;
+ y++;
+ calc += CALCWIDTH;
+ break;
+ case DOWN:
+ if (x < xend) {
+ if (!*(calc + 1)) {
+ w = (cpixeldata_t) calculatepixel(x + 1, y, peri);
+ putpixel(x + 1, y, w);
+ *(calc + 1) = (unsigned char) 1;
+ } else
+ w = getpixel(x + 1, y);
+ if (w == c) {
+ dir = RIGHT;
+ calc++;
+ x++;
+ break;
+ }
+ }
+
+ if (y < yend) {
+ if (!*(calc + CALCWIDTH)) {
+ w = (cpixeldata_t) calculatepixel(x, y + 1, peri);
+ putpixel(x, y + 1, w);
+ *(calc + CALCWIDTH) = (unsigned char) 1;
+ } else
+ w = getpixel(x, y + 1);
+ if (w == c) {
+ dir = DOWN;
+ calc += CALCWIDTH;
+ y++;
+ break;
+ }
+ }
+
+ if (x > xstart) {
+ if (!*(calc - 1)) {
+ w = (cpixeldata_t) calculatepixel(x - 1, y, peri);
+ putpixel(x - 1, y, w);
+ *(calc - 1) = (unsigned char) 1;
+ } else
+ w = getpixel(x - 1, y);
+ if (w == c) {
+ dir = LEFT;
+ calc--;
+ x--;
+ break;
+ }
+ }
+
+ dir = UP;
+ calc -= CALCWIDTH;
+ y--;
+ break;
+
+ }
+ if (*calc == (unsigned char) 2) {
+ if (fill) {
+ *calc = (unsigned char) 1;
+ return;
+ }
+ fill = 1;
+ dir = RIGHT;
+ }
+ }
+ while (1);
+}
+
+#ifndef SLOWCACHESYNC
+#ifndef nthreads
+#define ethreads 1
+REGISTERS(3)
+static INLINE void
+tracepoint(int xp, int yp, int dir, unsigned int color, int xstart,
+ int xend, int ystart, int yend)
+{
+ unsigned char *calc;
+ cpixeldata_t mycolor;
+ int i, lookdir;
+ unsigned int c;
+ int x, y;
+ int periodicity = (dir & 8) != 0;
+ dir &= ~8;
+ calc = calculated + xp + yp * CALCWIDTH;
+
+ if (!(*calc & (CALCULATED | CALCULATING))) {
+ *calc |= CALCULATING;
+ mycolor = (cpixeldata_t) calculatepixel(xp, yp, periodicity);
+ putpixel(xp, yp, mycolor);
+ *calc |= CALCULATED;
+ *calc &= ~CALCULATING;
+ } else {
+ if (*calc & CALCULATING) {
+ /*Bad luck..some other procesor is working with out pixel :) try
+ *later.*/
+ addstack(xp, yp, dir, color, periodicity);
+ return;
+ }
+ mycolor = getpixel(xp, yp);
+ }
+
+ while (1) {
+ periodicity = (mycolor == inset || color == inset);
+ lookdir = turnright(dir);
+ for (i = 0; i < 3; i++) {
+ x = xp + dirrections[lookdir][0];
+ y = yp + dirrections[lookdir][1];
+ if (x >= xstart && x <= xend && y >= ystart && y <= yend) {
+ calc = calculated + x + y * CALCWIDTH;
+ if (!(*calc & (CALCULATED | CALCULATING))) {
+ *calc |= CALCULATING;
+ c = calculatepixel(x, y, periodicity);
+ putpixel(x, y, c);
+ *calc |= CALCULATED;
+ *calc &= ~CALCULATING;
+ } else {
+ if (*calc & CALCULATING) {
+ /*Bad luck..some other procesor is working with out pixel :) try
+ *later.*/
+ addstack(xp, yp, dir, color, periodicity);
+ return;
+ }
+ c = getpixel(x, y);
+ }
+ if (c == mycolor)
+ break;
+ if (c != color) {
+ int dir2 = turnright(lookdir);
+ int mask = (1 << dir2) + (1 << turnright(dir2));
+ if (!(*calc & mask)) {
+ addstack(x, y, dir2, mycolor, periodicity);
+ }
+ color = c;
+ }
+ }
+ lookdir = turnleft(lookdir);
+ }
+ x = xp + dirrections[lookdir][0];
+ y = yp + dirrections[lookdir][1];
+ if (x >= xstart && x <= xend && y >= ystart && y <= yend) {
+ calc = calculated + x + y * CALCWIDTH;
+ if (!(*calc & (1 << lookdir))) {
+ *calc |= (1 << lookdir);
+ if (size < 10) {
+ addstack(x, y, lookdir, color, periodicity);
+ return;
+ } else {
+ xp = x;
+ yp = y;
+ dir = lookdir;
+ calc = calculated + xp + yp * CALCWIDTH;
+ }
+ } else
+ return;
+ } else
+ return;
+ }
+}
+
+static void queue(void *data, struct taskinfo *task, int r1, int r2)
+{
+ int x, y, d, c;
+ int pos = 0;
+
+ while (1) {
+ int nstack;
+ xth_lock(0);
+ while (!size) { /*Well stack is empty. */
+ if (exitnow) { /*Possibly everything is done now.. */
+ xth_unlock(0);
+ return;
+ }
+ if (nwaiting == nthreads - 1) { /*We are last working CPU */
+ exitnow = 1; /*So we should exit now */
+ xth_wakeup(0); /*Wake up all waiting tasks */
+ xth_unlock(0);
+ return; /*and exit :) */
+ }
+ nwaiting++; /*We are not latest task. */
+ xth_sleep(0, 0); /*Wait until other task will push some data */
+ nwaiting--;
+ if (exitnow) { /*Evrything is done now? */
+ xth_unlock(0);
+ return;
+ }
+ }
+ nstack = xth_nthread(task);
+ while (!sizes[nstack])
+ if (nstack != nthreads - 1)
+ nstack++;
+ else
+ nstack = 0;
+ sizes[nstack]--;
+ size--;
+ pos++;
+ if (pos >= sizes[nstack])
+ pos = 0;
+ x = starts[nstack][pos >> PAGESHIFT][pos & (PAGESIZE - 1)].x;
+ y = starts[nstack][pos >> PAGESHIFT][pos & (PAGESIZE - 1)].y;
+ d = starts[nstack][pos >> PAGESHIFT][pos & (PAGESIZE - 1)].
+ direction;
+ c = starts[nstack][pos >> PAGESHIFT][pos & (PAGESIZE - 1)].color;
+ /* Well stack currently is queue. Should have better results at
+ * SMP, since has tendency trace all ways at time, so (I believe)
+ * should avoid some cache conflict and situation where queue is
+ * empty. At the other hand, makes queue bigger and needs following
+ * copy:
+ */
+ starts[nstack][pos >> PAGESHIFT][pos & (PAGESIZE - 1)] =
+ starts[nstack][sizes[nstack] >> PAGESHIFT][sizes[nstack] &
+ (PAGESIZE - 1)];
+ xth_unlock(0);
+ tracepoint(x, y, d, c, xstart, xend, ystart, yend);
+ }
+}
+
+static void bfill(void *dat, struct taskinfo *task, int r1, int r2)
+{
+ int y;
+ cpixel_t *pos, *end;
+ unsigned char *data;
+ r1 += ystart + 1;
+ r2 += ystart + 1;
+ for (y = r1; y < r2; y++) {
+ pos = p_add((cpixel_t *) cimage.currlines[y], xstart + 1);
+ end = p_add((cpixel_t *) cimage.currlines[y], xend);
+ data = calculated + xstart + y * CALCWIDTH + 1;
+ for (; pos < end; p_inc(pos, 1), data++) {
+ if (!*data)
+ p_copy(pos, 0, pos, -1);
+ }
+ }
+}
+
+#undef ethreads
+#endif
+#endif
+static void
+dosymetries(int x1, int x2, int y1, int y2, int xsym, int cx1, int cx2)
+{
+ if (cx1 != x1) {
+ register int y;
+ register cpixel_t *xx1, *xx2;
+ for (y = y1; y <= y2; y++) {
+ xx1 = p_add((cpixel_t *) cimage.currlines[y], x1);
+ xx2 = p_add((cpixel_t *) cimage.currlines[y], 2 * xsym - x1);
+ while (xx1 < xx2) {
+ p_copy(xx1, 0, xx2, 0);
+ p_inc(xx1, 1);
+ p_inc(xx2, -1);
+ }
+ }
+ }
+ if (cx2 != x2) {
+ register int y;
+ register cpixel_t *xx1, *xx2;
+ for (y = y1; y <= y2; y++) {
+ xx1 = p_add((cpixel_t *) cimage.currlines[y], x2);
+ xx2 = p_add((cpixel_t *) cimage.currlines[y], 2 * xsym - x2);
+ while (xx1 > xx2) {
+ p_copy(xx1, 0, xx2, 0);
+ p_inc(xx1, -1);
+ p_inc(xx2, 1);
+ }
+ }
+ }
+}
+#endif
+
+#undef dosymetries
+#undef tracepoint
+#undef tracecolor
+#undef queue
+#undef bfill
diff --git a/src/engine/calculate.h b/src/engine/calculate.h
new file mode 100644
index 0000000..ab6ca40
--- /dev/null
+++ b/src/engine/calculate.h
@@ -0,0 +1,37 @@
+
+static pixel32_t INLINE
+calculate(number_t x, number_t y, int periodicity) CONSTF;
+static pixel32_t INLINE calculate(number_t x, number_t y, int periodicity)
+{
+ pixel32_t i;
+
+ rotateback(cfractalc, x, y);
+ if (cfractalc.plane) {
+ recalculate(cfractalc.plane, &x, &y);
+ }
+ STAT(ncalculated2++);
+#ifndef SLOWFUNCPTR
+ if (cfractalc.mandelbrot) {
+ if (cformula.flags & STARTZERO)
+ i = cfractalc.calculate[periodicity] (cfractalc.bre,
+ cfractalc.bim, x, y);
+ else
+ i = cfractalc.calculate[periodicity] (x + cfractalc.bre,
+ y + cfractalc.bim, x, y);
+ } else
+ i = cfractalc.calculate[periodicity] (x, y, cfractalc.pre,
+ cfractalc.pim);
+#else
+ if (cfractalc.mandelbrot) {
+ if (cformula.flags & STARTZERO)
+ i = calculateswitch(cfractalc.bre, cfractalc.bim, x, y,
+ periodicity);
+ else
+ i = calculateswitch(x + cfractalc.bre, y + cfractalc.bim, x, y,
+ periodicity);
+ } else
+ i = calculateswitch(x, y, cfractalc.pre, cfractalc.pim,
+ periodicity);
+#endif
+ return (i);
+}
diff --git a/src/engine/dither.c b/src/engine/dither.c
new file mode 100644
index 0000000..f46de36
--- /dev/null
+++ b/src/engine/dither.c
@@ -0,0 +1,1200 @@
+/*
+ * This file contains code of three conversion filters based at dithering:
+ * truecolor conversion filter - it should convert 8bpp, fixedcolor and
+ * bitmaps to truecolor
+ * fixedcolor conversion - emulates user palette at 8bpp displays with static
+ * palette
+ * bitmap conversion - emulates 8bpp at 1bpp displays.
+ *
+ * Since this filters share quite a lot code, they are implemented in one
+ * file. Internal loops are quire messy, since they are optimized for speed.
+ * Let me know about all ideas to make it faster.
+ *
+ * Note that quite interesting alg. is for preparing dithering table at
+ * fixedcolor displays.
+ */
+#include <config.h>
+#ifndef _plan9_
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#include <stdio.h>
+#include <string.h>
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+#include <stdlib.h>
+#else
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#endif
+#include <fconfig.h>
+#include <filter.h>
+#include <xerror.h>
+#include <fractal.h>
+#include <xthread.h>
+#include <archaccel.h>
+#define MSIZE 8
+static CONST unsigned char matrix[MSIZE][MSIZE] = {
+ {0, 192, 48, 240, 12, 204, 60, 252,},
+ {128, 64, 176, 112, 140, 76, 188, 124,},
+ {32, 224, 16, 208, 44, 236, 28, 220,},
+ {160, 96, 144, 80, 172, 108, 156, 92,},
+ {8, 200, 56, 248, 4, 196, 52, 244,},
+ {136, 72, 184, 120, 132, 68, 180, 116,},
+ {40, 232, 24, 216, 36, 228, 20, 212,},
+ {168, 104, 152, 88, 164, 100, 148, 84},
+};
+
+struct ditherdata {
+ unsigned char table[32][32][32];
+ int rmat[MSIZE][MSIZE];
+ int gmat[MSIZE][MSIZE];
+ int bmat[MSIZE][MSIZE];
+ struct palette *palette;
+ int active;
+};
+struct fixeddata {
+ /*6kKb of table */
+ unsigned char ctable[8][8][256];
+ /*and 32kB */
+ unsigned char table[32][32][32];
+ /*and 768 bytes... */
+ int rmat[MSIZE][MSIZE];
+ int gmat[MSIZE][MSIZE];
+ int bmat[MSIZE][MSIZE];
+ struct palette *palette;
+ int forversion;
+ int active;
+ int fixcolor;
+};
+struct bitmapdata {
+ struct palette *palette;
+ int intensity[256];
+ int forversion;
+ int active;
+ int fixcolor;
+};
+static int requirement(struct filter *f, struct requirements *r)
+{
+ f->req = *r;
+ r->nimages = 1;
+ r->flags &= ~IMAGEDATA;
+ r->supportedmask =
+ FIXEDCOLOR | MASK1BPP | MASK3BPP | MASK2BPP | MASK4BPP | BITMAPS;
+ return (f->next->action->requirement(f->next, r));
+}
+
+#ifdef SFIXEDCOLOR
+/* create_rgb_table:
+ * Fills an lookup table with conversion data for the specified
+ * palette.
+ *
+ * Uses alg. similiar to foodfill - it adds one seed per every color in
+ * palette to its best possition. Then areas around seed are filled by
+ * same color because it is best aproximation for them, and then areas
+ * about them etc...
+ *
+ * It does just about 80000 tests for distances and this is about 100
+ * times better than normal 256*32000 tests so the caluclation time
+ * is now less than one second at all computers I tested.
+ */
+#define UNUSED 65535
+#define LAST 65532
+
+/* macro add adds to single linked list */
+#define add(i) (next[(i)] == UNUSED ? (next[(i)] = LAST, \
+ (first != LAST ? (next[last] = (i)) : (first = (i))), \
+ (last = (i))) : 0)
+
+ /* same but w/o checking for first element */
+#define add1(i) (next[(i)] == UNUSED ? (next[(i)] = LAST, \
+ next[last] = (i), \
+ (last = (i))) : 0)
+
+ /* calculates distance between two colors */
+#define dist(a1, a2, a3, b1, b2, b3) \
+ (col_diff[0][((a2) - (b2)) & 0x1FF] + \
+ col_diff[1][((a1) - (b1)) & 0x1FF] + \
+ col_diff[2][((a3) - (b3)) & 0x1FF])
+
+ /* converts r,g,b to position in array and back */
+#define pos(r, g, b) \
+((((int)(r)) / 8) * 32 * 32 + (((int)(g)) / 8) * 32 + (((int)(b)) / 8))
+
+#define depos(pal, r, g, b) \
+ ((b) = ((unsigned int)(pal) & 31) * 8, \
+ (g) = (((unsigned int)(pal) >> 5) & 31) * 8, \
+ (r) = (((unsigned int)(pal) >> 10) & 31) * 8)
+
+ /* is current color better than pal1? */
+#define better(r1, g1, b1, pal1) \
+ (((int)dist((r1), (g1), (b1), \
+ (int)(pal1)[0], (int)(pal1)[1], (int)(pal1)[2])) > (int)dist2)
+#define better1(r1, g1, b1, pal1) \
+ (((int)dist((r1), (g1), (b1), \
+ (int)(pal1)[0], (int)(pal1)[1], (int)(pal1)[2])))
+
+ /* checking of possition */
+#define dopos(rp, gp, bp, ts) \
+ if ((rp > -1 || r > 0) && (rp < 1 || r < 248) && \
+ (gp > -1 || g > 0) && (gp < 1 || g < 248) && \
+ (bp > -1 || b > 0) && (bp < 1 || b < 248)) { \
+ i = first + rp * 32 * 32 + gp * 32 + bp; \
+ if (ts ? data[i] != val : !data[i]) { \
+ dist2 = (rp ? col_diff[1][(r+8*rp-(int)pal[val][0]) & 0x1FF] : r2) + \
+ (gp ? col_diff[0][(g+8*gp-(int)pal[val][1]) & 0x1FF] : g2) + \
+ (bp ? col_diff[2][(b+8*bp-(int)pal[val][2]) & 0x1FF] : b2); \
+ if (better((r+8*rp), (g+8*gp), (b+8*bp), pal[data[i]])) { \
+ data[i] = val; \
+ add1 (i); \
+ } \
+ } \
+ }
+
+static void
+create_rgb_table(unsigned char table[32][32][32], struct palette *palette)
+{
+ int i, curr, r, g, b, val, r2, g2, b2, dist2;
+ rgb_t *pal = palette->rgb;
+ unsigned short *next;
+ unsigned char *data;
+ int first = LAST;
+ int last = LAST;
+ int count = 0;
+
+ next = (unsigned short *) malloc(sizeof(short) * 32 * 32 * 32);
+ if (col_diff[0][1] == 0)
+ bestfit_init();
+
+ memset_long(next, 255, sizeof(short) * 32 * 32 * 32);
+ memset_long(table, palette->start, sizeof(char) * 32 * 32 * 32);
+ depos(32 * 32 * 32 - 1, r, g, b);
+
+ data = (unsigned char *) table;
+
+ /* add starting seeds for foodfill */
+ for (i = palette->start + 1; i < palette->end; i++) {
+ curr = pos((int) pal[i][0], (int) pal[i][1], (int) pal[i][2]);
+ if (next[curr] == UNUSED) {
+ data[curr] = (unsigned int) i;
+ add(curr);
+ }
+ }
+
+ /* main foodfill: two versions of loop for faster growing in blue axis */
+ while (first != LAST) {
+ depos(first, r, g, b);
+
+ /* calculate distance of current color */
+ val = data[first];
+ r2 = col_diff[1][(((int) pal[val][0]) - (r)) & 0x1FF];
+ g2 = col_diff[0][(((int) pal[val][1]) - (g)) & 0x1FF];
+ b2 = col_diff[2][(((int) pal[val][2]) - (b)) & 0x1FF];
+
+ /* try to grow to all directions */
+ dopos(0, 0, 1, 1);
+ dopos(0, 0, -1, 1);
+ dopos(1, 0, 0, 1);
+ dopos(-1, 0, 0, 1);
+ dopos(0, 1, 0, 1);
+ dopos(0, -1, 0, 1);
+
+ /* faster growing of blue direction */
+ if ((b > 0) && (data[first - 1] == val)) {
+ b -= 8;
+ first--;
+ b2 = col_diff[2][(((int) pal[val][2]) - (b)) & 0x1ff];
+
+ dopos(-1, 0, 0, 0);
+ dopos(1, 0, 0, 0);
+ dopos(0, -1, 0, 0);
+ dopos(0, 1, 0, 0);
+
+ first++;
+ }
+
+ /* get next from list */
+ i = first;
+ first = next[first];
+ next[i] = UNUSED;
+
+ /* second version of loop */
+ if (first != LAST) {
+ depos(first, r, g, b);
+
+ val = data[first];
+ r2 = col_diff[1][(((int) pal[val][0]) - (r)) & 0x1ff];
+ g2 = col_diff[0][(((int) pal[val][1]) - (g)) & 0x1ff];
+ b2 = col_diff[2][(((int) pal[val][2]) - (b)) & 0x1ff];
+
+ dopos(0, 0, 1, 1);
+ dopos(0, 0, -1, 1);
+ dopos(1, 0, 0, 1);
+ dopos(-1, 0, 0, 1);
+ dopos(0, 1, 0, 1);
+ dopos(0, -1, 0, 1);
+
+ if ((b < 248) && (data[first + 1] == val)) {
+ b += 8;
+ first++;
+ b2 = col_diff[2][(((int) pal[val][2]) - (b)) & 0x1ff];
+
+ dopos(-1, 0, 0, 0);
+ dopos(1, 0, 0, 0);
+ dopos(0, -1, 0, 0);
+ dopos(0, 1, 0, 0);
+
+ first--;
+ }
+
+ i = first;
+ first = next[first];
+ next[i] = UNUSED;
+ }
+
+ count++;
+ }
+ free(next);
+}
+
+static void
+checksizes(unsigned char table[32][32][32], int *RESTRICT red,
+ int *RESTRICT green, int *RESTRICT blue)
+{
+ int r, g, b;
+ int color;
+ int n, maxn;
+ maxn = 0;
+ n = 0;
+ for (r = 0; r < 32; r++)
+ for (g = 0; g < 32; g++) {
+ color = 512;
+ for (b = 0; b < 32; b++)
+ if (color != table[r][g][b]) {
+ if (maxn < n)
+ maxn = n;
+ color = table[r][g][b];
+ n = 0;
+ } else
+ n++;
+ }
+ *blue = (maxn) * 8;
+ maxn = 0;
+ n = 0;
+ for (b = 0; b < 32; b++)
+ for (g = 0; g < 32; g++) {
+ color = 512;
+ for (r = 0; r < 32; r++)
+ if (color != table[r][g][b]) {
+ if (maxn < n)
+ maxn = n;
+ color = table[r][g][b];
+ n = 0;
+ } else
+ n++;
+ }
+ *red = (maxn) * 8;
+ maxn = 0;
+ n = 0;
+ for (b = 0; b < 32; b++)
+ for (r = 0; r < 32; r++) {
+ color = 512;
+ for (g = 0; g < 32; g++)
+ if (color != table[r][g][b]) {
+ if (maxn < n)
+ maxn = n;
+ color = table[r][g][b];
+ n = 0;
+ } else
+ n++;
+ }
+ *green = (maxn) * 8;
+}
+#endif /*FIXEDCOLOR */
+static int initialize(struct filter *f, struct initdata *i)
+{
+ struct ditherdata *s = (struct ditherdata *) f->data;
+ struct palette *palette;
+ int r, g, b;
+ inhermisc(f, i);
+ if (i->image->bytesperpixel <= 1) {
+ int red, green, blue;
+ if (!inherimage
+ (f, i, TOUCHIMAGE /*| IMAGEDATA */ , 0, 0, s->palette, 0, 0))
+ return 0;
+ if (!s->active) {
+ palette = clonepalette(f->image->palette);
+ restorepalette(s->palette, palette);
+ destroypalette(palette);
+ }
+ switch (f->image->palette->type) {
+ case C256:
+ blue = mkrgb(f->image->palette);
+ red = blue / 256 / 256;
+ green = (blue / 256) & 255;
+ blue &= 255;
+ for (r = 0; r < 32; r++)
+ for (g = 0; g < 32; g++)
+ for (b = 0; b < 32; b++) {
+ s->table[r][g][b] =
+ f->image->palette->
+ pixels[((r * red + red / 2) / 32) +
+ ((g * green +
+ green / 2) / 32) * blue * red +
+ ((b * blue + blue / 2) / 32) * red];
+ }
+ for (r = 0; r < MSIZE; r++)
+ for (g = 0; g < MSIZE; g++) {
+ s->rmat[r][g] =
+ ((int) matrix[r][g] - 128) * 256 / red / 256;
+ s->gmat[r][g] =
+ ((int) matrix[(r + 3) % MSIZE][(g + 6) % MSIZE] -
+ 128) * 256 / green / 256;
+ s->bmat[r][g] =
+ ((int) matrix[(r + 6) % MSIZE][(g + 3) % MSIZE] -
+ 128) * 256 / blue / 256;
+ }
+ break;
+#ifdef SFIXEDCOLOR
+ case FIXEDCOLOR:
+ create_rgb_table(s->table, f->image->palette);
+ checksizes(s->table, &red, &green, &blue);
+ for (r = 0; r < MSIZE; r++)
+ for (g = 0; g < MSIZE; g++) {
+ s->rmat[r][g] = ((int) matrix[r][g] - 128) * red / 256;
+ s->gmat[r][g] =
+ ((int) matrix[(r + 3) % MSIZE][(g + 6) % MSIZE] -
+ 128) * green / 256;
+ s->bmat[r][g] =
+ ((int) matrix[(r + 6) % MSIZE][(g + 3) % MSIZE] -
+ 128) * blue / 256;
+ }
+ break;
+#endif
+#ifdef BITMAPS
+ case MBITMAP:
+ case LBITMAP:
+ case MIBITMAP:
+ case LIBITMAP:
+ break;
+#endif
+ case GRAYSCALE:
+ break;
+ default:
+ x_fatalerror("Unsupported image type. Recompile XaoS.");
+ }
+ setfractalpalette(f, s->palette);
+ s->active = 1;
+ f->queue->saveimage = f->childimage;
+ return (f->previous->action->initialize(f->previous, i));
+ } else {
+ if (s->active) {
+ f->image = i->image;
+ palette = clonepalette(s->palette);
+ restorepalette(f->image->palette, palette);
+ destroypalette(palette);
+ }
+ s->active = 0;
+ return (f->previous->action->initialize(f->previous, i));
+ }
+}
+
+static struct filter *getinstance(CONST struct filteraction *a)
+{
+ struct filter *f = createfilter(a);
+ struct ditherdata *i = (struct ditherdata *) calloc(1, sizeof(*i));
+ i->palette =
+ createpalette(0, 65536, TRUECOLOR, 0, 65536, NULL, NULL, NULL,
+ NULL, NULL);
+ f->data = i;
+ f->name = "Truecolor to 8bpp convertor";
+ return (f);
+}
+
+static void convert(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *RESTRICT f = (struct filter *) data;
+ struct image *RESTRICT img1 = f->childimage;
+ struct image *RESTRICT img2 = f->image;
+ CONST struct ditherdata *RESTRICT s = (struct ditherdata *) f->data;
+ CONST pixel32_t *RESTRICT src, *srcend;
+ int r, g, b;
+ pixel8_t *RESTRICT dest;
+ int i;
+ int x = 0;
+
+ for (i = r1; i < r2; i++) {
+ src = (pixel32_t *) img1->currlines[i];
+ dest = img2->currlines[i];
+ srcend = src + img1->width;
+ x++;
+ x = x & (MSIZE - 1);
+ for (; src < srcend; src++, dest++) {
+ b = *src;
+ g = (b >> 8) & 0xff;
+ r = (b >> 16);
+ b &= 0xff;
+ r += s->rmat[x][(unsigned long) dest & (MSIZE - 1)];
+ g += s->gmat[x][(unsigned long) dest & (MSIZE - 1)];
+ b += s->bmat[x][(unsigned long) dest & (MSIZE - 1)];
+ if (r & (~255)) {
+ if (r < 0)
+ r = 0;
+ else if (r > 255)
+ r = 255;
+ }
+ if (g & (~255)) {
+ if (g < 0)
+ g = 0;
+ else if (g > 255)
+ g = 255;
+ }
+ if (b & (~255)) {
+ if (b < 0)
+ b = 0;
+ else if (b > 255)
+ b = 255;
+ }
+ *dest = s->table[r >> 3][g >> 3][b >> 3];
+ }
+ }
+}
+
+#define intenzity(x) ((int)(((x)&255) * 76 + (((x)>>8)&255) * 151 + (((x)>>16)&255) * 28)>>8)
+static void convertgray(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ struct image *img1 = f->childimage;
+ struct image *img2 = f->image;
+ pixel32_t *src, *srcend;
+ pixel8_t *dest;
+ int i;
+ int x = 0;
+ unsigned char table[256];
+ for (i = 0; i < 256; i++)
+ table[i] =
+ i * (img2->palette->end - img2->palette->start) / 256 +
+ img2->palette->start;
+
+ for (i = r1; i < r2; i++) {
+ src = (pixel32_t *) img1->currlines[i];
+ dest = img2->currlines[i];
+ srcend = src + img1->width;
+ x++;
+ x = x & (MSIZE - 1);
+ for (; src < srcend; src++, dest++) {
+ *dest = table[intenzity(*src)];
+ }
+ }
+}
+
+#ifdef SBITMAPS
+#define inten(x) ((int)(((x)&255) * 76 + (((x)>>8)&255) * 151 + (((x)>>16)&255) * 28)>>8)-256
+static void
+converttbitmap(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ struct image *img1 = f->childimage;
+ struct image *img2 = f->image;
+ pixel32_t *src, *srcend;
+ pixel8_t *dest = NULL;
+ int i, y;
+ unsigned int mask = 0;
+ int x = 0;
+ unsigned int val = 0;
+ src = (pixel32_t *) img1->currlines[0];
+ for (i = r1; i < r2; i++) {
+ dest = img2->currlines[i];
+ x = i & (MSIZE - 1);
+ src = (pixel32_t *) img1->currlines[i];
+ srcend = src + (img1->width & ~7);
+ switch (img2->palette->type) {
+#ifdef SMBITMAPS
+ case MBITMAP:
+ for (; src < srcend; dest++) {
+ if (inten(src[0]) + (int) matrix[x][0] >= 0)
+ val = 128;
+ else
+ val = 0;
+ if (inten(src[1]) + (int) matrix[x][1] >= 0)
+ val |= 64;
+ if (inten(src[2]) + (int) matrix[x][2] >= 0)
+ val |= 32;
+ if (inten(src[3]) + (int) matrix[x][3] >= 0)
+ val |= 16;
+ if (inten(src[4]) + (int) matrix[x][4] >= 0)
+ val |= 8;
+ if (inten(src[5]) + (int) matrix[x][5] >= 0)
+ val |= 4;
+ if (inten(src[6]) + (int) matrix[x][6] >= 0)
+ val |= 2;
+ if (inten(src[7]) + (int) matrix[x][7] >= 0)
+ val |= 1;
+ src += 8;
+ *dest = val;
+ }
+ srcend = (pixel32_t *) img1->currlines[i] + img1->width;
+ if (src != srcend) {
+ y = 0;
+ for (val = 0, mask = 128; src < srcend;
+ mask >>= 1, src++, y++) {
+ if (inten(*src) + (int) matrix[x][y] >= 0)
+ val |= mask;
+ }
+ if (!mask)
+ *dest = val, dest++;
+ }
+ break;
+ case MIBITMAP:
+ for (; src < srcend; dest++) {
+ if (inten(src[0]) + (int) matrix[x][0] <= 0)
+ val = 128;
+ else
+ val = 0;
+ if (inten(src[1]) + (int) matrix[x][1] <= 0)
+ val |= 64;
+ if (inten(src[2]) + (int) matrix[x][2] <= 0)
+ val |= 32;
+ if (inten(src[3]) + (int) matrix[x][3] <= 0)
+ val |= 16;
+ if (inten(src[4]) + (int) matrix[x][4] <= 0)
+ val |= 8;
+ if (inten(src[5]) + (int) matrix[x][5] <= 0)
+ val |= 4;
+ if (inten(src[6]) + (int) matrix[x][6] <= 0)
+ val |= 2;
+ if (inten(src[7]) + (int) matrix[x][7] <= 0)
+ val |= 1;
+ src += 8;
+ *dest = val;
+ }
+ srcend = (pixel32_t *) img1->currlines[i] + img1->width;
+ if (src != srcend) {
+ y = 0;
+ for (val = 0, mask = 128; src < srcend;
+ mask >>= 1, src++, y++) {
+ if (inten(*src) + (int) matrix[x][y] <= 0)
+ val |= mask;
+ }
+ if (!mask)
+ *dest = val, dest++;
+ }
+ break;
+#endif
+#ifdef SLBITMAPS
+ case LBITMAP:
+ for (; src < srcend; dest++) {
+ if (inten(src[0]) + (int) matrix[x][0] >= 0)
+ val = 1;
+ else
+ val = 0;
+ if (inten(src[1]) + (int) matrix[x][1] >= 0)
+ val |= 2;
+ if (inten(src[2]) + (int) matrix[x][2] >= 0)
+ val |= 4;
+ if (inten(src[3]) + (int) matrix[x][3] >= 0)
+ val |= 8;
+ if (inten(src[4]) + (int) matrix[x][4] >= 0)
+ val |= 16;
+ if (inten(src[5]) + (int) matrix[x][5] >= 0)
+ val |= 32;
+ if (inten(src[6]) + (int) matrix[x][6] >= 0)
+ val |= 64;
+ if (inten(src[7]) + (int) matrix[x][7] >= 0)
+ val |= 128;
+ src += 8;
+ *dest = val;
+ }
+ srcend = (pixel32_t *) img1->currlines[i] + img1->width;
+ if (src != srcend) {
+ y = 0;
+ for (val = 0, mask = 1; src < srcend;
+ mask <<= 1, src++, y++) {
+ if (inten(*src) + (int) matrix[x][y] >= 0)
+ val |= mask;
+ }
+ if (!mask)
+ *dest = val, dest++;
+ }
+ break;
+ case LIBITMAP:
+ for (; src < srcend; dest++) {
+ if (inten(src[0]) + (int) matrix[x][0] <= 0)
+ val = 1;
+ else
+ val = 0;
+ if (inten(src[1]) + (int) matrix[x][1] <= 0)
+ val |= 2;
+ if (inten(src[2]) + (int) matrix[x][2] <= 0)
+ val |= 4;
+ if (inten(src[3]) + (int) matrix[x][3] <= 0)
+ val |= 8;
+ if (inten(src[4]) + (int) matrix[x][4] <= 0)
+ val |= 16;
+ if (inten(src[5]) + (int) matrix[x][5] <= 0)
+ val |= 32;
+ if (inten(src[6]) + (int) matrix[x][6] <= 0)
+ val |= 64;
+ if (inten(src[7]) + (int) matrix[x][7] <= 0)
+ val |= 128;
+ src += 8;
+ *dest = val;
+ }
+ srcend = (pixel32_t *) img1->currlines[i] + img1->width;
+ if (src != srcend) {
+ y = 0;
+ for (val = 0, mask = 1; src < srcend;
+ mask <<= 1, src++, y++) {
+ if (inten(*src) + (int) matrix[x][y] <= 0)
+ val |= mask;
+ }
+ if (!mask)
+ *dest = val, dest++;
+ }
+ break;
+#endif
+ }
+ }
+ *dest = val;
+}
+#endif
+static void destroyinstance(struct filter *f)
+{
+ struct ditherdata *i = (struct ditherdata *) f->data;
+ destroypalette(i->palette);
+ free(f->data);
+ destroyinheredimage(f);
+ free(f);
+}
+
+static int doit(struct filter *f, int flags, int time)
+{
+ int val;
+ struct ditherdata *s = (struct ditherdata *) f->data;
+ if (s->active)
+ updateinheredimage(f);
+ val = f->previous->action->doit(f->previous, flags, time);
+ if (s->active) {
+#ifdef SBITMAPS
+ if (f->image->palette->type & BITMAPS) {
+ xth_function(converttbitmap, f, f->image->height);
+ } else
+#endif
+ {
+ if (f->image->palette->type == GRAYSCALE)
+ xth_function(convertgray, f, f->image->height);
+ else
+ xth_function(convert, f, f->image->height);
+ }
+ xth_sync();
+ }
+ return val;
+}
+
+static void myremovefilter(struct filter *f)
+{
+ struct ditherdata *s = (struct ditherdata *) f->data;
+ struct palette *palette;
+ if (s->active) {
+ palette = clonepalette(s->palette);
+ restorepalette(f->image->palette, palette);
+ destroypalette(palette);
+ }
+}
+
+
+CONST struct filteraction truecolor_filter = {
+ "Truecolor emulator",
+ "truecolor",
+ 0,
+ getinstance,
+ destroyinstance,
+ doit,
+ requirement,
+ initialize,
+ convertupgeneric,
+ convertdowngeneric,
+ myremovefilter,
+};
+
+
+
+#ifdef SCONVERTORS
+static int
+myfixedalloccolor(struct palette *p, int init, int r, int g, int b)
+{
+ struct palette *palette = (struct palette *) p->data;
+ fixedalloccolor(p, init, r, g, b);
+ return (palette->alloccolor(palette, init, r, g, b));
+}
+
+static void myallocfinished(struct palette *p)
+{
+ struct palette *palette = (struct palette *) p->data;
+ palette->allocfinished(palette);
+}
+
+static void mysetcolor(struct palette *p, int start, int end, rgb_t * rgb)
+{
+ p->data = &p;
+}
+#endif
+#ifdef SFIXEDCOLOR
+
+static int initializefixed(struct filter *f, struct initdata *i)
+{
+ struct fixeddata *s = (struct fixeddata *) f->data;
+ struct palette *palette;
+ int r, g;
+ inhermisc(f, i);
+ if (i->image->palette->type == FIXEDCOLOR
+ && !(f->req.supportedmask & FIXEDCOLOR)) {
+ int red, green, blue;
+ i->image->palette->alloccolor = myfixedalloccolor;
+ i->image->palette->allocfinished = myallocfinished;
+ i->image->palette->data = s->palette;
+ if (!inherimage
+ (f, i, TOUCHIMAGE | IMAGEDATA, 0, 0, s->palette, 0, 0))
+ return 0;
+ if (s->active == -1) {
+ palette = clonepalette(f->image->palette);
+ restorepalette(s->palette, palette);
+ destroypalette(palette);
+ }
+ create_rgb_table(s->table, f->image->palette);
+ checksizes(s->table, &red, &green, &blue);
+ for (r = 0; r < MSIZE; r++)
+ for (g = 0; g < MSIZE; g++) {
+ s->rmat[r][g] = ((int) matrix[r][g] - 128) * red / 256;
+ s->gmat[r][g] =
+ ((int) matrix[(r + 3) % MSIZE][(g + 6) % MSIZE] -
+ 128) * green / 256;
+ s->bmat[r][g] =
+ ((int) matrix[(r + 6) % MSIZE][(g + 3) % MSIZE] -
+ 128) * blue / 256;
+ }
+ s->palette->data = &s->palette;
+ setfractalpalette(f, s->palette);
+ s->active = 1;
+ f->queue->saveimage = f->childimage;
+ f->queue->palettechg = f;
+ return (f->previous->action->initialize(f->previous, i));
+ } else {
+ if (s->active == 1) {
+ s->fixcolor = 1;
+ }
+ s->active = 0;
+ return (f->previous->action->initialize(f->previous, i));
+ }
+}
+
+static struct filter *getinstancefixed(CONST struct filteraction *a)
+{
+ struct filter *f = createfilter(a);
+ struct fixeddata *i = (struct fixeddata *) calloc(1, sizeof(*i));
+ i->palette =
+ createpalette(0, 256, C256, 0, 256, NULL, mysetcolor, NULL, NULL,
+ NULL);
+ i->active = -1;
+ f->data = i;
+ f->name = "Palete emulator";
+ return (f);
+}
+
+static void convertfixed(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ struct image *img1 = f->childimage;
+ struct image *img2 = f->image;
+ struct fixeddata *s = (struct fixeddata *) f->data;
+ pixel8_t *src, *srcend;
+ pixel8_t *dest;
+ int i;
+ int x = 0;
+ for (i = r1; i < r2; i++) {
+ src = (pixel8_t *) img1->currlines[i];
+ dest = img2->currlines[i];
+ srcend = src + img1->width;
+ x++;
+ x = x & (MSIZE - 1);
+ for (; src < srcend; src++, dest++) {
+ *dest =
+ s->ctable[x][((unsigned long) dest) & (MSIZE - 1)][*src];
+ }
+ }
+}
+
+static int doitfixed(struct filter *f, int flags, int time)
+{
+ int val;
+ struct fixeddata *s = (struct fixeddata *) f->data;
+ if (s->fixcolor && !s->active) {
+ struct palette *palette;
+ s->fixcolor = 0;
+ palette = clonepalette(s->palette);
+ restorepalette(f->previous->childimage->palette, palette);
+ destroypalette(palette);
+ }
+ if (s->active)
+ updateinheredimage(f);
+ if (!(flags & PALETTEONLY))
+ val = f->previous->action->doit(f->previous, flags, time);
+ else
+ val = 0;
+ if (s->active) {
+ if (s->palette->data != NULL) {
+ int i, x, y;
+ s->palette->data = NULL;
+ val |= CHANGED;
+ for (i = 0; i < 256; i++) {
+ for (x = 0; x < 8; x++)
+ for (y = 0; y < 8; y++) {
+ int r, g, b;
+ r = s->palette->rgb[i][0] + s->rmat[x][y];
+ if (r & (~255)) {
+ if (r < 0)
+ r = 0;
+ else if (r > 255)
+ r = 255;
+ }
+ g = s->palette->rgb[i][1] + s->gmat[x][y];
+ if (g & (~255)) {
+ if (g < 0)
+ g = 0;
+ else if (g > 255)
+ g = 255;
+ }
+ b = s->palette->rgb[i][2] + s->bmat[x][y];
+ if (b & (~255)) {
+ if (b < 0)
+ b = 0;
+ else if (b > 255)
+ b = 255;
+ }
+ s->ctable[x][y][i] =
+ s->table[r >> 3][g >> 3][b >> 3];
+ }
+ }
+ }
+ xth_function(convertfixed, f, f->image->height);
+ xth_sync();
+ }
+ return val;
+}
+
+static void myremovefilterfixed(struct filter *f)
+{
+ struct fixeddata *s = (struct fixeddata *) f->data;
+ struct palette *palette;
+ if (s->active) {
+ palette = clonepalette(s->palette);
+ restorepalette(f->image->palette, palette);
+ destroypalette(palette);
+ }
+}
+
+static void destroyinstancefixed(struct filter *f)
+{
+ struct fixeddata *i = (struct fixeddata *) f->data;
+ destroypalette(i->palette);
+ free(f->data);
+ destroyinheredimage(f);
+ free(f);
+}
+
+CONST struct filteraction fixedcolor_filter = {
+ "Palette emulator",
+ "fixedcolor",
+ 0,
+ getinstancefixed,
+ destroyinstancefixed,
+ doitfixed,
+ requirement,
+ initializefixed,
+ convertupgeneric,
+ convertdowngeneric,
+ myremovefilterfixed,
+};
+#endif
+
+#ifdef SBITMAPS
+static int initializebitmap(struct filter *f, struct initdata *i)
+{
+ struct bitmapdata *s = (struct bitmapdata *) f->data;
+ struct palette *palette;
+ inhermisc(f, i);
+ if ((i->image->palette->type & BITMAPS)
+ && !(f->req.supportedmask & BITMAPS)) {
+ i->image->palette->alloccolor = myfixedalloccolor;
+ i->image->palette->allocfinished = myallocfinished;
+ i->image->palette->data = s->palette;
+ if (!inherimage
+ (f, i, TOUCHIMAGE | IMAGEDATA, 0, 0, s->palette, 0, 0))
+ return 0;
+ if (s->active == -1) {
+ palette = clonepalette(f->image->palette);
+ restorepalette(s->palette, palette);
+ destroypalette(palette);
+ }
+ s->palette->data = &s->palette;
+ setfractalpalette(f, s->palette);
+ s->active = 1;
+ f->queue->saveimage = f->childimage;
+ f->queue->palettechg = f;
+ return (f->previous->action->initialize(f->previous, i));
+ } else {
+ if (s->active == 1) {
+ s->fixcolor = 1;
+ }
+ s->active = 0;
+ return (f->previous->action->initialize(f->previous, i));
+ }
+}
+
+static struct filter *getinstancebitmap(CONST struct filteraction *a)
+{
+ struct filter *f = createfilter(a);
+ struct bitmapdata *i = (struct bitmapdata *) calloc(1, sizeof(*i));
+ i->palette =
+ createpalette(0, 256, C256, 0, 256, NULL, mysetcolor, NULL, NULL,
+ NULL);
+ i->active = -1;
+ f->data = i;
+ f->name = "Palete emulator";
+ return (f);
+}
+
+#define INTENSITY(r,g,b) (r * 30U + g * 59U + b * 11U)/100U-256U
+static void
+convertbitmap(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ struct image *img1 = f->childimage;
+ struct image *img2 = f->image;
+ struct bitmapdata *s = (struct bitmapdata *) f->data;
+ pixel8_t *src, *srcend;
+ pixel8_t *dest = NULL;
+ int *intensity = s->intensity;
+ int i;
+ unsigned int mask = 0;
+ int x = 0, y;
+ unsigned int val = 0;
+ src = (pixel8_t *) img1->currlines[0];
+ for (i = r1; i < r2; i++) {
+ dest = img2->currlines[i];
+ x = i & (MSIZE - 1);
+ src = (pixel8_t *) img1->currlines[i];
+ srcend = src + (img1->width & ~7);
+ switch (img2->palette->type) {
+#ifdef SMBITMAPS
+ case MBITMAP:
+ for (; src < srcend; dest++) {
+ if (intensity[src[0]] + (int) matrix[x][0] >= 0)
+ val = 128;
+ else
+ val = 0;
+ if (intensity[src[1]] + (int) matrix[x][1] >= 0)
+ val |= 64;
+ if (intensity[src[2]] + (int) matrix[x][2] >= 0)
+ val |= 32;
+ if (intensity[src[3]] + (int) matrix[x][3] >= 0)
+ val |= 16;
+ if (intensity[src[4]] + (int) matrix[x][4] >= 0)
+ val |= 8;
+ if (intensity[src[5]] + (int) matrix[x][5] >= 0)
+ val |= 4;
+ if (intensity[src[6]] + (int) matrix[x][6] >= 0)
+ val |= 2;
+ if (intensity[src[7]] + (int) matrix[x][7] >= 0)
+ val |= 1;
+ src += 8;
+ *dest = val;
+ }
+ srcend = (pixel8_t *) img1->currlines[i] + img1->width;
+ if (src != srcend) {
+ y = 0;
+ for (val = 0, mask = 128; src < srcend;
+ mask >>= 1, src++, y++) {
+ if (intensity[*src] + (int) matrix[x][y] >= 0)
+ val |= mask;
+ }
+ *dest = val, dest++;
+ }
+ break;
+ case MIBITMAP:
+ for (; src < srcend; dest++) {
+ if (intensity[src[0]] + (int) matrix[x][0] <= 0)
+ val = 128;
+ else
+ val = 0;
+ if (intensity[src[1]] + (int) matrix[x][1] <= 0)
+ val |= 64;
+ if (intensity[src[2]] + (int) matrix[x][2] <= 0)
+ val |= 32;
+ if (intensity[src[3]] + (int) matrix[x][3] <= 0)
+ val |= 16;
+ if (intensity[src[4]] + (int) matrix[x][4] <= 0)
+ val |= 8;
+ if (intensity[src[5]] + (int) matrix[x][5] <= 0)
+ val |= 4;
+ if (intensity[src[6]] + (int) matrix[x][6] <= 0)
+ val |= 2;
+ if (intensity[src[7]] + (int) matrix[x][7] <= 0)
+ val |= 1;
+ src += 8;
+ *dest = val;
+ }
+ srcend = (pixel8_t *) img1->currlines[i] + img1->width;
+ if (src != srcend) {
+ y = 0;
+ for (val = 0, mask = 128; src < srcend;
+ mask >>= 1, src++, y++) {
+ if (intensity[*src] + (int) matrix[x][y] <= 0)
+ val |= mask;
+ }
+ *dest = val, dest++;
+ }
+ break;
+#endif
+#ifdef SLBITMAPS
+ case LBITMAP:
+ for (; src < srcend; dest++) {
+ if (intensity[src[0]] + (int) matrix[x][0] >= 0)
+ val = 1;
+ else
+ val = 0;
+ if (intensity[src[1]] + (int) matrix[x][1] >= 0)
+ val |= 2;
+ if (intensity[src[2]] + (int) matrix[x][2] >= 0)
+ val |= 4;
+ if (intensity[src[3]] + (int) matrix[x][3] >= 0)
+ val |= 8;
+ if (intensity[src[4]] + (int) matrix[x][4] >= 0)
+ val |= 16;
+ if (intensity[src[5]] + (int) matrix[x][5] >= 0)
+ val |= 32;
+ if (intensity[src[6]] + (int) matrix[x][6] >= 0)
+ val |= 64;
+ if (intensity[src[7]] + (int) matrix[x][7] >= 0)
+ val |= 128;
+ src += 8;
+ *dest = val;
+ }
+ srcend = (pixel8_t *) img1->currlines[i] + img1->width;
+ if (src != srcend) {
+ y = 0;
+ for (val = 0, mask = 1; src < srcend;
+ mask <<= 1, src++, y++) {
+ if (intensity[*src] + (int) matrix[x][y] >= 0)
+ val |= mask;
+ }
+ *dest = val, dest++;
+ }
+ case LIBITMAP:
+ for (; src < srcend; dest++) {
+ if (intensity[src[0]] + (int) matrix[x][0] <= 0)
+ val = 1;
+ else
+ val = 0;
+ if (intensity[src[1]] + (int) matrix[x][1] <= 0)
+ val |= 2;
+ if (intensity[src[2]] + (int) matrix[x][2] <= 0)
+ val |= 4;
+ if (intensity[src[3]] + (int) matrix[x][3] <= 0)
+ val |= 8;
+ if (intensity[src[4]] + (int) matrix[x][4] <= 0)
+ val |= 16;
+ if (intensity[src[5]] + (int) matrix[x][5] <= 0)
+ val |= 32;
+ if (intensity[src[6]] + (int) matrix[x][6] <= 0)
+ val |= 64;
+ if (intensity[src[7]] + (int) matrix[x][7] <= 0)
+ val |= 128;
+ src += 8;
+ *dest = val;
+ }
+ srcend = (pixel8_t *) img1->currlines[i] + img1->width;
+ if (src != srcend) {
+ y = 0;
+ for (val = 0, mask = 1; src < srcend;
+ mask <<= 1, src++, y++) {
+ if (intensity[*src] + (int) matrix[x][y] <= 0)
+ val |= mask;
+ }
+ *dest = val, dest++;
+ }
+ break;
+#endif
+ }
+ }
+}
+
+static int doitbitmap(struct filter *f, int flags, int time)
+{
+ int val;
+ struct bitmapdata *s = (struct bitmapdata *) f->data;
+ if (s->fixcolor && !s->active) {
+ struct palette *palette;
+ s->fixcolor = 0;
+ palette = clonepalette(s->palette);
+ restorepalette(f->previous->childimage->palette, palette);
+ destroypalette(palette);
+ }
+ if (s->active)
+ updateinheredimage(f);
+ if (!(flags & PALETTEONLY))
+ val = f->previous->action->doit(f->previous, flags, time);
+ else
+ val = 0;
+ if (s->active) {
+ if (s->palette->data != NULL) {
+ int i;
+ for (i = 0; i < 256; i++)
+ s->intensity[i] =
+ INTENSITY(f->childimage->palette->rgb[i][0],
+ f->childimage->palette->rgb[i][1],
+ f->childimage->palette->rgb[i][2]);
+ val |= CHANGED;
+ }
+ xth_function(convertbitmap, f, f->image->height);
+ xth_sync();
+ }
+ return val;
+}
+
+static void myremovefilterbitmap(struct filter *f)
+{
+ struct bitmapdata *s = (struct bitmapdata *) f->data;
+ struct palette *palette;
+ if (s->active) {
+ palette = clonepalette(s->palette);
+ restorepalette(f->image->palette, palette);
+ destroypalette(palette);
+ }
+}
+
+static void destroyinstancebitmap(struct filter *f)
+{
+ struct bitmapdata *i = (struct bitmapdata *) f->data;
+ destroypalette(i->palette);
+ free(f->data);
+ destroyinheredimage(f);
+ free(f);
+}
+
+CONST struct filteraction bitmap_filter = {
+ "Palette emulator",
+ "bitmap",
+ 0,
+ getinstancebitmap,
+ destroyinstancebitmap,
+ doitbitmap,
+ requirement,
+ initializebitmap,
+ convertupgeneric,
+ convertdowngeneric,
+ myremovefilterbitmap,
+};
+#endif
diff --git a/src/engine/docalc.c b/src/engine/docalc.c
new file mode 100644
index 0000000..9cacf27
--- /dev/null
+++ b/src/engine/docalc.c
@@ -0,0 +1,790 @@
+
+/* Hello reader!
+
+ * Are you sure you want read this? Its very cryptic and strange code. YOU
+ * HAVE BEEN WARNED! Its purpose is to genereate as fast as possible
+ * calculation loops for various formulas/algorithms. It uses lots of
+ * coprocesor magic. It is included from formulas.c
+ */
+
+#ifndef VARIABLES /*supply defaultd values */
+#define VARIABLES
+#endif
+#ifndef PRETEST
+#define PRETEST 0
+#endif
+#ifndef INIT
+#define INIT
+#endif
+#ifndef POSTCALC
+#define POSTCALC
+#endif
+#ifndef PRESMOOTH
+#define PRESMOOTH zre=rp+ip
+#endif
+#ifndef UFORMULA
+#define UFORMULA FORMULA
+#endif
+#ifndef UEND
+#define UEND
+#endif
+#ifndef SAVE
+#define SAVE
+#endif
+#ifndef SAVEVARIABLES
+#define SAVEVARIABLES
+#endif
+#ifndef RESTORE
+#define RESTORE
+#endif
+#ifndef RANGE
+#define RANGE 2
+#endif
+#ifndef __GNUC__
+#undef USEHACKS
+#endif
+#ifndef __i386__
+#undef USEHACKS
+#endif
+#ifdef NOASSEMBLY
+#undef USEHACKS
+#endif
+
+/* Prepare main loop */
+#ifndef NSFORMULALOOP
+#define NSFORMULALOOP(iter) \
+ do \
+ { /*try first 8 iterations */ \
+ FORMULA; \
+ iter--; \
+ } \
+ while (BTEST && iter)
+#endif
+#ifndef SFORMULALOOP
+#define SFORMULALOOP(iter) \
+ do \
+ { /*try first 8 iterations */ \
+ SAVEZMAG; \
+ FORMULA; \
+ iter--; \
+ } \
+ while (BTEST && iter)
+#endif
+#ifndef FORMULALOOP
+#ifdef SMOOTHMODE
+#define FORMULALOOP SFORMULALOOP
+#else
+#define FORMULALOOP NSFORMULALOOP
+#endif
+#endif
+
+#ifdef USEHACKS
+#ifdef RPIP
+#define I386HACK1 __asm__ ("#HACK1" : \
+ : \
+ "m" (szre), \
+ "m" (szim) \
+ );
+#define I386HACK __asm__ ("#HACK" : \
+ : \
+ "f" (zre), \
+ "f" (zim) \
+ );
+#else
+#define I386HACK __asm__ ("#HACK" : \
+ : \
+ "f" (zre), \
+ "f" (zim) \
+ );
+#endif
+#else
+#define I386HACK
+#define I386HACK1
+#endif
+
+#ifdef SMOOTHMODE
+#ifdef CUSTOMSAVEZMAG
+#define SAVEZMAG CUSTOMSAVEZMAG;
+#else
+#define SAVEZMAG szmag=rp+ip;
+#endif
+#else
+#define SAVEZMAG
+#endif
+
+#ifdef UNCOMPRESS
+/*uncompressed version of loop */
+#ifdef SMOOTHMODE
+static unsigned int FUNCTYPE
+SCALC(register number_t zre, register number_t zim, register number_t pre,
+ register number_t pim)
+CONSTF REGISTERS(3);
+REGISTERS(3)
+static unsigned int FUNCTYPE
+SCALC(register number_t zre, register number_t zim,
+ register number_t pre, register number_t pim)
+#else
+static unsigned int FUNCTYPE
+CALC(register number_t zre, register number_t zim, register number_t pre,
+ register number_t pim)
+CONSTF REGISTERS(3);
+REGISTERS(3)
+static unsigned
+CALC(register number_t zre, register number_t zim,
+ register number_t pre, register number_t pim)
+#endif
+{
+ register unsigned int iter = cfractalc.maxiter;
+ number_t szre = 0, szim = 0;
+#ifdef RPIP
+ register number_t rp = 0, ip;
+#endif
+#ifdef SMOOTHMODE
+ number_t szmag = 0;
+#endif
+ SAVEVARIABLES VARIABLES;
+ INIT;
+ if (PRETEST)
+ iter = 0;
+ else {
+#ifdef RPIP
+ rp = zre * zre;
+ ip = zim * zim;
+#endif
+ if (iter < 16) {
+ I386HACK1;
+ I386HACK;
+
+ /*try first 8 iterations */
+ if (BTEST && iter) {
+ FORMULALOOP(iter);
+ }
+ /*
+ while (BTEST && iter)
+ {
+ SAVEZMAG;
+ FORMULA;
+ iter--;
+ } */
+ } else {
+ iter = 8 + (cfractalc.maxiter & 7);
+ I386HACK1;
+ I386HACK;
+
+ /*try first 8 iterations */
+ if (BTEST && iter) {
+ FORMULALOOP(iter);
+ }
+ /*
+ while (BTEST && iter)
+ {
+ SAVEZMAG;
+ FORMULA;
+ iter--;
+ } */
+ if (BTEST) {
+ iter = (cfractalc.maxiter - 8) & (~7);
+ iter >>= 3;
+ I386HACK1;
+ I386HACK; /*do next 8 iteration w/o out of bounds checking */
+ do {
+ /*hmm..we are probably in some deep area. */
+ szre = zre; /*save current possition */
+ szim = zim;
+ SAVE;
+ UFORMULA;
+ UFORMULA;
+ UFORMULA;
+ UFORMULA;
+ UFORMULA;
+ UFORMULA;
+ UFORMULA;
+ UFORMULA;
+ UEND;
+ iter--;
+ }
+ while (BTEST && iter);
+ if (!(BTEST)) { /*we got out of bounds */
+ iter <<= 3;
+ iter += 8; /*restore saved possition */
+ RESTORE;
+ zre = szre;
+ zim = szim;
+#ifdef RPIP
+ rp = zre * zre;
+ ip = zim * zim;
+#endif
+ I386HACK1;
+ I386HACK;
+ FORMULALOOP(iter);
+ /*
+ do
+ {
+ SAVEZMAG
+ FORMULA;
+ iter--;
+ }
+ while (BTEST && iter); */
+ }
+ } else
+ iter += cfractalc.maxiter - 8 - (cfractalc.maxiter & 7);
+ }
+ }
+#ifdef SMOOTHMODE
+ if (iter)
+ SMOOTHOUTPUT();
+ POSTCALC;
+ iter = cfractalc.maxiter - iter;
+ INOUTPUT();
+#else
+ POSTCALC;
+ iter = cfractalc.maxiter - iter;
+ OUTPUT();
+#endif
+}
+#else
+#ifdef SMOOTHMODE
+static unsigned int FUNCTYPE
+SCALC(register number_t zre, register number_t zim, register number_t pre,
+ register number_t pim)
+CONSTF REGISTERS(3);
+REGISTERS(3)
+static unsigned int FUNCTYPE
+SCALC(register number_t zre, register number_t zim,
+ register number_t pre, register number_t pim)
+#else
+static unsigned int FUNCTYPE
+CALC(register number_t zre, register number_t zim, register number_t pre,
+ register number_t pim)
+CONSTF REGISTERS(3);
+REGISTERS(3)
+static unsigned int FUNCTYPE
+CALC(register number_t zre, register number_t zim,
+ register number_t pre, register number_t pim)
+#endif
+{
+ register unsigned int iter = cfractalc.maxiter /*& (~(int) 3) */ ;
+#ifdef RPIP
+ register number_t rp, ip;
+#endif
+#ifdef SMOOTHMODE
+ number_t szmag = 0;
+#endif
+ VARIABLES;
+ INIT;
+ if (PRETEST)
+ iter = 0;
+ else {
+#ifdef RPIP
+ rp = zre * zre;
+ ip = zim * zim;
+#endif
+ if (BTEST && iter) {
+ FORMULALOOP(iter);
+ }
+ /*
+ while (BTEST && iter)
+ {
+ I386HACK;
+ SAVEZMAG
+ FORMULA;
+ iter--;
+
+ } */
+ }
+#ifdef SMOOTHMODE
+ if (iter)
+ SMOOTHOUTPUT();
+ POSTCALC;
+ iter = cfractalc.maxiter - iter;
+ INOUTPUT();
+#else
+ POSTCALC;
+ iter = cfractalc.maxiter - iter;
+ OUTPUT();
+#endif
+}
+#endif
+
+
+/*F. : Periodicity checking rountines. (16-02-97)
+ All comments preceded by F. are mine (Fabrice Premel premelfa@etu.utc.fr).
+ Tried to make code as efficient as possible.
+ Next to do is convert lim in a variable that would be updated sometimes
+ I'll try to make here a short explanation on periodicity checking :
+ first, we'll define 2 variables : whentosave and whenincsave, which are, respectively,
+ a measure of when we have to update saved values to be checked, and when to increase
+ interval between 2 updates, as if they're too close, we'll miss large periods.
+ We save Z at the beginning, and then we compare each new iteration with this Z, and if naerly
+ equal, we declare the suite to be periodic.
+ When ( iter mod whentosave ) == 0, we store a new value, and we repeat.
+
+ UNCOMPRESSed form is just an extension, with careful that if we only check whentosave
+ all 8 iterations, number of iterations must be well set at the begining.This is
+ done by adding a (iter&7) in the while statement preceeding then uncompressed
+ calculation. */
+
+/*F. : This is from then lim factor that depends all periodicity check spped : the bigger it is, the faster we
+ can detect periodicity, but the bigger it is, the more we can introduce errors.
+ I suggest a value of (maxx-minx)/(double)getmaxx for a classic Mandelbrot Set,
+ and maybe a lesser value for an extra power Mandelbrot.
+ But this should be calculated outter from here (ie each frame, for example), to avoid
+ new calculs */
+#ifdef PERI
+#define PCHECK (abs_less_than(r1 - zre, cfractalc.periodicity_limit) && abs_less_than(s1 - zim, cfractalc.periodicity_limit))
+
+#ifndef UNCOMPRESS
+
+#ifdef SMOOTHMODE
+static unsigned int FUNCTYPE
+SPERI(register number_t zre, register number_t zim, register number_t pre,
+ register number_t pim)
+CONSTF REGISTERS(3);
+REGISTERS(3)
+static unsigned int FUNCTYPE
+SPERI(register number_t zre, register number_t zim,
+ register number_t pre, register number_t pim)
+#else
+static unsigned int FUNCTYPE
+PERI(register number_t zre, register number_t zim, register number_t pre,
+ register number_t pim)
+CONSTF REGISTERS(3);
+REGISTERS(3)
+static unsigned int FUNCTYPE
+PERI(register number_t zre, register number_t zim,
+ register number_t pre, register number_t pim)
+#endif
+{
+ register unsigned int iter =
+ cfractalc.maxiter /*& (~(int) 3) */ , iter1 =
+ 8;
+ register number_t r1, s1;
+ int whensavenew, whenincsave;
+#ifdef RPIP
+ register number_t rp, ip;
+#endif
+#ifdef SMOOTHMODE
+ number_t szmag = 0;
+#endif
+ VARIABLES;
+ INIT;
+ if (PRETEST)
+ iter = 0;
+ else {
+#ifdef RPIP
+ rp = zre * zre;
+ ip = zim * zim;
+#endif
+ I386HACK;
+ if (iter < iter1)
+ iter1 = iter, iter = 8;
+
+ /*H. : do first few iterations w/o checking */
+ if (BTEST && iter1) {
+ FORMULALOOP(iter1);
+ }
+ /*
+ while (BTEST && iter1)
+ {
+ SAVEZMAG;
+ FORMULA;
+ iter1--;
+ } */
+ if (iter1) {
+ if (iter >= 8)
+ iter -= 8 - iter1;
+ goto end;
+ }
+ if (iter <= 8) {
+ iter = iter1;
+ } else {
+ iter -= 8;
+ r1 = zre;
+ s1 = zim;
+ whensavenew = 3; /*You should adapt theese values */
+ /*F. : We should always define whensavenew as 2^N-1, so we could use a AND instead of % */
+
+ whenincsave = 10;
+ /*F. : problem is that after deep zooming, peiodicity is never detected early, cause is is
+ quite slow before going in a periodic loop.
+ So, we should start checking periodicity only after some times */
+ while (BTEST && iter) {
+ SAVEZMAG;
+ FORMULA;
+ if ((iter & whensavenew) == 0) { /*F. : changed % to & */
+ r1 = zre;
+ s1 = zim;
+ whenincsave--;
+ if (!whenincsave) {
+ whensavenew = ((whensavenew + 1) << 1) - 1; /*F. : Changed to define a new AND mask */
+ whenincsave = 10;
+ }
+ } else {
+ if (PCHECK) {
+ PERIINOUTPUT();
+ }
+ }
+ iter--;
+
+ }
+ }
+ }
+ end:
+#ifdef SMOOTHMODE
+ if (iter)
+ SMOOTHOUTPUT();
+ POSTCALC;
+ iter = cfractalc.maxiter - iter;
+ INOUTPUT();
+#else
+ POSTCALC;
+ iter = cfractalc.maxiter - iter;
+ OUTPUT();
+#endif
+}
+
+#else
+
+/*F. : UNCOMPRESSed version. Note that whensavenew+1 should be a multiple of 8, else periodicity won't be able
+ to detect anything. */
+/*F. : this macros definitions are really strange, but after a while, it's good */
+
+#ifdef SMOOTHMODE
+static unsigned int FUNCTYPE
+SPERI(register number_t zre, register number_t zim, register number_t pre,
+ register number_t pim)
+CONSTF REGISTERS(3);
+REGISTERS(3)
+static unsigned int FUNCTYPE
+SPERI(register number_t zre, register number_t zim,
+ register number_t pre, register number_t pim)
+#else
+static unsigned int FUNCTYPE
+PERI(register number_t zre, register number_t zim, register number_t pre,
+ register number_t pim)
+CONSTF REGISTERS(3);
+REGISTERS(3)
+static unsigned int FUNCTYPE
+PERI(register number_t zre, register number_t zim,
+ register number_t pre, register number_t pim)
+#endif
+{
+ register unsigned int iter = cfractalc.maxiter /*& (~(int) 3) */ ;
+ register number_t r1 = zre, s1 = zim;
+ number_t szre = 0, szim = 0; /*F. : Didn't declared register, cause they are few used */
+ unsigned int whensavenew, whenincsave;
+#ifdef RPIP
+ register number_t rp = 0, ip;
+#endif
+#ifdef SMOOTHMODE
+ number_t szmag = 0;
+#endif
+ SAVEVARIABLES VARIABLES;
+ INIT;
+ if (PRETEST)
+ iter = 0;
+ else {
+ if (cfractalc.maxiter <= 16) {
+ I386HACK1;
+ /*I386HACK; */
+#ifdef RPIP
+ rp = zre * zre;
+ ip = zim * zim;
+#endif
+ /*F. : Added iter&7 to be sure we'll be on a 8 multiple */
+ if (BTEST && iter) {
+ FORMULALOOP(iter);
+ }
+ /*
+ while (BTEST && iter)
+ {
+ SAVEZMAG
+ FORMULA;
+ iter--;
+ } */
+ } else {
+ whensavenew = 7; /*You should adapt theese values */
+ /*F. : We should always define whensavenew as 2^N-1, so we could use a AND instead of % */
+
+ whenincsave = 10;
+#ifdef RPIP
+ rp = zre * zre;
+ ip = zim * zim;
+#endif
+ /*F. : problem is that after deep zooming, peiodicity is never detected early, cause is is
+ quite slow before going in a periodic loop.
+ So, we should start checking periodicity only after some times */
+ I386HACK1;
+ /*I386HACK; */
+ iter = 8 + (cfractalc.maxiter & 7);
+ while (BTEST && iter) { /*F. : Added iter&7 to be sure we'll be on a 8 multiple */
+ SAVEZMAG FORMULA;
+ iter--;
+ }
+ if (BTEST) { /*F. : BTEST is calculed two times here, isn't it ? */
+ /*H. : No gcc is clever and adds test to the end :) */
+ iter = (cfractalc.maxiter - 8) & (~7);
+ do {
+ szre = zre, szim = zim;
+ SAVE;
+ SAVEZMAG
+ /*I386HACK; */
+ I386HACK1;
+ FORMULA; /*F. : Calculate one time */
+ if (PCHECK)
+ goto periodicity;
+ FORMULA;
+ if (PCHECK)
+ goto periodicity;
+ FORMULA;
+ if (PCHECK)
+ goto periodicity;
+ FORMULA;
+ if (PCHECK)
+ goto periodicity;
+ FORMULA;
+ if (PCHECK)
+ goto periodicity;
+ FORMULA;
+ if (PCHECK)
+ goto periodicity;
+ FORMULA;
+ if (PCHECK)
+ goto periodicity;
+ FORMULA;
+ if (PCHECK)
+ goto periodicity;
+ iter -= 8;
+ /*F. : We only test this now, as it can't be true before */
+ if ((iter & whensavenew) == 0) { /*F. : changed % to & */
+ r1 = zre, s1 = zim; /*F. : Save new values */
+ whenincsave--;
+ if (!whenincsave) {
+ whensavenew = ((whensavenew + 1) << 1) - 1; /*F. : Changed to define a new AND mask */
+ whenincsave = 10; /*F. : Start back */
+ }
+ }
+ }
+ while (BTEST && iter);
+ if (!BTEST) { /*we got out of bounds */
+ iter += 8; /*restore saved possition */
+ RESTORE;
+ zre = szre;
+ zim = szim;
+#ifdef RPIP
+ rp = zre * zre;
+ ip = zim * zim;
+#endif
+ I386HACK1;
+ /*I386HACK; */
+ FORMULALOOP(iter);
+ /*
+ do
+ {
+ SAVEZMAG
+ FORMULA;
+ iter--;
+ }
+ while (BTEST && iter); */
+ }
+ } else
+ iter += cfractalc.maxiter - 8 - (cfractalc.maxiter & 7);
+ }
+ }
+#ifdef SMOOTHMODE
+ if (iter)
+ SMOOTHOUTPUT();
+ POSTCALC;
+ iter = cfractalc.maxiter - iter;
+ INOUTPUT();
+#else
+ POSTCALC;
+ iter = cfractalc.maxiter - iter;
+ OUTPUT();
+#endif
+ periodicity:
+ PERIINOUTPUT();
+}
+
+/*else uncompress */
+#endif
+
+/*endif PERI */
+#undef PCHECK
+#endif
+
+#ifndef SMOOTHMODE
+#ifdef JULIA
+static void
+JULIA(struct image *image, register number_t pre, register number_t pim)
+{
+ int i, i1, i2, j, x, y;
+ unsigned char iter, itmp2, itmp;
+ number_t rp = 0, ip = 0;
+ register number_t zre, zim, im, xdelta, ydelta, range, rangep;
+ number_t xstep, ystep;
+ unsigned char *queue[QMAX];
+ unsigned char **qptr;
+ unsigned char *addr, **addr1 = image->currlines;
+#ifdef STATISTICS
+ int guessed = 0, unguessed = 0, iters = 0;
+#endif
+ VARIABLES;
+ range = (number_t) RANGE;
+ rangep = range * range;
+
+ xdelta = image->width / (RMAX - RMIN);
+ ydelta = image->height / (IMAX - IMIN);
+ xstep = (RMAX - RMIN) / image->width;
+ ystep = (IMAX - IMIN) / image->height;
+ init_julia(image, rangep, range, xdelta, ystep);
+ for (i2 = 0; i2 < 2; i2++)
+ for (i1 = 0; i1 < image->height; i1++) {
+ if (i1 % 2)
+ i = image->height / 2 - i1 / 2;
+ else
+ i = image->height / 2 + i1 / 2 + 1;
+ if (i >= image->height)
+ continue;
+ im = IMIN + (i + 0.5) * ystep;
+ for (j = (i + i2) & 1; j < image->width; j += 2) {
+ STAT(total2++);
+ addr = addr1[i] + j;
+ if (*addr != NOT_CALCULATED)
+ continue;
+ x = j;
+ y = i;
+ if (y > 0 && y < image->height - 1 && *(addr + 1) &&
+ x > 0 && x < image->width - 1) {
+ if ((iter = *(addr + 1)) != NOT_CALCULATED
+ && iter == *(addr - 1) && iter == addr1[y - 1][x]
+ && iter == addr1[y + 1][x]) {
+ *addr = *(addr + 1);
+ continue;
+ }
+ }
+ zim = im;
+ zre = RMIN + (j + 0.5) * xstep;
+ iter = (unsigned char) 0;
+ qptr = queue;
+ ip = (zim * zim);
+ rp = (zre * zre);
+ INIT;
+ while (1) {
+ if (*addr != NOT_CALCULATED
+#ifdef SAG
+ && (*addr == INPROCESS
+ || (*addr != (unsigned char) 1
+ && (itmp2 = *(addr + 1)) != NOT_CALCULATED
+ && ((itmp2 != (itmp = *(addr - 1))
+ && itmp != NOT_CALCULATED)
+ || (itmp2 !=
+ (itmp = *((addr1[y + 1]) + x))
+ && itmp != NOT_CALCULATED)
+ || (itmp2 !=
+ (itmp = *((addr1[y - 1]) + x))
+ && itmp != NOT_CALCULATED))))
+#endif
+ ) {
+ if (*addr == INPROCESS || *addr == INSET) {
+ *qptr = addr;
+ qptr++;
+ STAT(guessed++);
+ goto inset;
+ }
+ STAT(guessed++);
+ iter = *addr;
+ goto outset;
+ }
+#ifdef STATISTICS
+ if (*addr != NOT_CALCULATED)
+ unguessed++;
+#endif
+ if (*addr != INPROCESS) {
+ *qptr = addr;
+ qptr++;
+ *addr = INPROCESS;
+ if (qptr >= queue + QMAX)
+ goto inset;
+ }
+ STAT(iters++);
+ FORMULA;
+ ip = (zim * zim);
+ rp = (zre * zre);
+ if (greater_than(rp + ip, RANGE) || !(BTEST))
+ goto outset;
+ x = (int) ((zre - RMIN) * xdelta);
+ y = (int) ((zim - IMIN) * ydelta);
+ addr = addr1[y] + x;
+ if ((itmp = *(addr + 1)) != NOT_CALCULATED
+ && itmp == *(addr - 1) && itmp == addr1[y - 1][x]
+ && itmp == addr1[y + 1][x]) {
+ *addr = *(addr + 1);
+ }
+ }
+ inset:
+ while (qptr > queue) {
+ qptr--;
+ **qptr = INSET;
+ }
+ continue;
+ outset:
+ y = image->palette->size;
+ while (qptr > queue) {
+ qptr--;
+ iter++;
+ if ((int) iter >= y)
+ iter = (unsigned char) 1;
+ **qptr = iter;
+ }
+ }
+ }
+#ifdef STATISTICS
+ printf("guessed %i, unguessed %i, iterations %i\n", guessed, unguessed,
+ iters);
+ guessed2 += guessed;
+ unguessed2 += unguessed;
+ iters2 += iters;
+#endif
+}
+#endif
+#endif
+
+#undef FORMULALOOP
+#undef PCHECK
+#undef I386HACK
+#undef I386HACK1
+#undef SAVEZMAG
+#ifndef SMOOTHMODE
+#ifdef SMOOTH
+#define SMOOTHMODE
+#include "docalc.c"
+#endif
+#endif
+
+/*cleanup for next formula */
+#undef NSFORMULALOOP
+#undef SFORMULALOOP
+#undef PRESMOOTH
+#undef SMOOTH
+#undef SMOOTHMODE
+#undef RANGE
+#undef JULIA
+#undef PERI
+#undef SPERI
+#undef INIT
+#undef VARIABLES
+#undef PRETEST
+#undef BTEST
+#undef FORMULA
+#undef CALC
+#undef SCALC
+#undef RPIP
+#undef POSTCALC
+#undef UNCOMPRESS
+#undef SAVE
+#undef SAVEVARIABLES
+#undef RESTORE
+#undef USEHACKS
+#undef UFORMULA
+#undef UEND
diff --git a/src/engine/edge.c b/src/engine/edge.c
new file mode 100644
index 0000000..09d1403
--- /dev/null
+++ b/src/engine/edge.c
@@ -0,0 +1,113 @@
+/* An edge detection filter.
+ * This is very simple filter - it initializes smalliter image and then
+ * does an simple edge detection algo on it.
+ */
+#include <config.h>
+#ifndef _plan9_
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#include <stdio.h> /*for NULL */
+#else
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#endif
+#define SLARGEITER
+#include <xthread.h>
+#include <filter.h>
+
+#define spixel_t pixel8_t
+#include <c256.h>
+#define do_edge do_edge8
+#include "edged.c"
+
+#undef spixel_t
+#define spixel_t pixel16_t
+#include <truecolor.h>
+#define do_edge do_edge32
+#include "edged.c"
+
+#include <true24.h>
+#define do_edge do_edge24
+#include "edged.c"
+
+#include <hicolor.h>
+#define do_edge do_edge16
+#include "edged.c"
+
+static int requirement(struct filter *f, struct requirements *r)
+{
+ f->req = *r;
+ r->nimages = 1;
+ r->flags &= ~IMAGEDATA;
+ r->supportedmask = MASK1BPP | MASK3BPP | MASK2BPP | MASK4BPP;
+ return (f->next->action->requirement(f->next, r));
+}
+
+static int initialize(struct filter *f, struct initdata *i)
+{
+ inhermisc(f, i);
+ /*in/out coloring modes looks better in iter modes. This also saves some
+ memory in truecolor. */
+ if (f->data != NULL)
+ destroypalette((struct palette *) f->data);
+ f->data =
+ createpalette(0, 65536,
+ i->image->bytesperpixel <= 1 ? SMALLITER : LARGEITER,
+ 0, 65536, NULL, NULL, NULL, NULL, NULL);
+ if (!inherimage
+ (f, i, TOUCHIMAGE | NEWIMAGE, 0, 0, (struct palette *) f->data, 0,
+ 0))
+ return 0;
+ return (f->previous->action->initialize(f->previous, i));
+}
+
+static struct filter *getinstance(CONST struct filteraction *a)
+{
+ struct filter *f = createfilter(a);
+ f->name = "Edge detection";
+ return (f);
+}
+
+static void destroyinstance(struct filter *f)
+{
+ if (f->data != NULL)
+ destroypalette((struct palette *) f->data);
+ destroyinheredimage(f);
+ free(f);
+}
+
+static int doit(struct filter *f, int flags, int time)
+{
+ int val;
+ int size = f->childimage->palette->type == SMALLITER ? 240 : 65520;
+ if (f->image->palette->size < size)
+ size = f->image->palette->size;
+ if (((struct palette *) f->data)->size != size)
+ ((struct palette *) f->data)->size =
+ size, ((struct palette *) f->data)->version++;
+ updateinheredimage(f);
+ val = f->previous->action->doit(f->previous, flags, time);
+ drivercall(*f->image,
+ xth_function(do_edge8, f, f->image->height),
+ xth_function(do_edge16, f, f->image->height),
+ xth_function(do_edge24, f, f->image->height),
+ xth_function(do_edge32, f, f->image->height));
+ xth_sync();
+ return val;
+}
+
+CONST struct filteraction edge_filter = {
+ "Edge detection",
+ "edge",
+ 0,
+ getinstance,
+ destroyinstance,
+ doit,
+ requirement,
+ initialize,
+ convertupgeneric,
+ convertdowngeneric,
+ NULL
+};
diff --git a/src/engine/edge2.c b/src/engine/edge2.c
new file mode 100644
index 0000000..fbfeab5
--- /dev/null
+++ b/src/engine/edge2.c
@@ -0,0 +1,113 @@
+/* An edge detection filter.
+ * This is very simple filter - it initializes smalliter image and then
+ * does an simple edge detection algo on it.
+ */
+#include <config.h>
+#ifndef _plan9_
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#include <stdio.h> /*for NULL */
+#else
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#endif
+#define SLARGEITER
+#include <xthread.h>
+#include <filter.h>
+
+#define spixel_t pixel8_t
+#include <c256.h>
+#define do_edge do_edge8
+#include "edge2d.c"
+
+#undef spixel_t
+#define spixel_t pixel16_t
+#include <truecolor.h>
+#define do_edge do_edge32
+#include "edge2d.c"
+
+#include <true24.h>
+#define do_edge do_edge24
+#include "edge2d.c"
+
+#include <hicolor.h>
+#define do_edge do_edge16
+#include "edge2d.c"
+
+static int requirement(struct filter *f, struct requirements *r)
+{
+ f->req = *r;
+ r->nimages = 1;
+ r->flags &= ~IMAGEDATA;
+ r->supportedmask = MASK1BPP | MASK2BPP | MASK3BPP | MASK4BPP;
+ return (f->next->action->requirement(f->next, r));
+}
+
+static int initialize(struct filter *f, struct initdata *i)
+{
+ inhermisc(f, i);
+ /*in/out coloring modes looks better in iter modes. This also saves some
+ memory in truecolor. */
+ if (f->data != NULL)
+ destroypalette((struct palette *) f->data);
+ f->data =
+ createpalette(0, 65536,
+ i->image->bytesperpixel <= 1 ? SMALLITER : LARGEITER,
+ 0, 65536, NULL, NULL, NULL, NULL, NULL);
+ if (!inherimage
+ (f, i, TOUCHIMAGE | NEWIMAGE, 0, 0, (struct palette *) f->data, 0,
+ 0))
+ return 0;
+ return (f->previous->action->initialize(f->previous, i));
+}
+
+static struct filter *getinstance(CONST struct filteraction *a)
+{
+ struct filter *f = createfilter(a);
+ f->name = "Edge detection";
+ return (f);
+}
+
+static void destroyinstance(struct filter *f)
+{
+ if (f->data != NULL)
+ destroypalette((struct palette *) f->data);
+ destroyinheredimage(f);
+ free(f);
+}
+
+static int doit(struct filter *f, int flags, int time)
+{
+ int val;
+ int size = f->childimage->palette->type == SMALLITER ? 253 : 65536;
+ if (f->image->palette->size < size)
+ size = f->image->palette->size;
+ if (((struct palette *) f->data)->size != size)
+ ((struct palette *) f->data)->size =
+ size, ((struct palette *) f->data)->version++;
+ updateinheredimage(f);
+ val = f->previous->action->doit(f->previous, flags, time);
+ drivercall(*f->image,
+ xth_function(do_edge8, f, f->image->height),
+ xth_function(do_edge16, f, f->image->height),
+ xth_function(do_edge24, f, f->image->height),
+ xth_function(do_edge32, f, f->image->height));
+ xth_sync();
+ return val;
+}
+
+CONST struct filteraction edge2_filter = {
+ "Edge detection2",
+ "edge2",
+ 0,
+ getinstance,
+ destroyinstance,
+ doit,
+ requirement,
+ initialize,
+ convertupgeneric,
+ convertdowngeneric,
+ NULL
+};
diff --git a/src/engine/edge2d.c b/src/engine/edge2d.c
new file mode 100644
index 0000000..4402b42
--- /dev/null
+++ b/src/engine/edge2d.c
@@ -0,0 +1,53 @@
+#ifndef UNSUPPORTED
+static void do_edge(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ int y;
+ unsigned int *pixels = f->image->palette->pixels;
+ register unsigned int black = f->image->palette->pixels[0];
+ register cpixel_t *output, *end;
+ register spixel_t *up, *down, *input;
+
+ for (y = r1; y < r2; y++) {
+ output = p_add(((cpixel_t *) f->image->currlines[y]), 1);
+ input = ((spixel_t *) f->childimage->currlines[y]) + 1;
+
+ if (y != 0)
+ up = ((spixel_t *) f->childimage->currlines[y - 1]) + 1;
+ else
+ up = ((spixel_t *) f->childimage->currlines[y]) + 1;
+
+ if (y != f->image->height - 1)
+ down = ((spixel_t *) f->childimage->currlines[y + 1]) + 1;
+ else
+ down = ((spixel_t *) f->childimage->currlines[y]) + 1;
+
+ end =
+ p_add(((cpixel_t *) f->image->currlines[y]),
+ f->image->width - 1);
+ p_setp(output, -1, 0);
+ p_setp(output, f->image->width - 2, 0);
+
+ while (output < end) {
+ if (input[0] > up[0] || input[0] > down[0]) {
+ p_set(output, pixels[input[0]]);
+ } else if (input[0] != input[1]) {
+ if (input[0] < input[1]) {
+ p_set(output, black);
+ p_inc(output, 1);
+ input++;
+ up++;
+ down++;
+ }
+ p_set(output, pixels[input[0]]);
+ } else
+ p_set(output, black);
+ p_inc(output, 1);
+ input++;
+ up++;
+ down++;
+ }
+ }
+}
+#endif
+#undef do_edge
diff --git a/src/engine/edged.c b/src/engine/edged.c
new file mode 100644
index 0000000..918f308
--- /dev/null
+++ b/src/engine/edged.c
@@ -0,0 +1,66 @@
+#ifndef UNSUPPORTED
+static void do_edge(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ int y;
+ unsigned int *pixels = f->image->palette->pixels;
+ register unsigned int black = f->image->palette->pixels[0];
+ register cpixel_t *output, *end;
+ register spixel_t *up, *down, *input;
+ for (y = r1; y < r2; y++) {
+ output = p_add(((cpixel_t *) f->image->currlines[y]), 1);
+ input = ((spixel_t *) f->childimage->currlines[y]) + 1;
+ if (y != 0)
+ up = ((spixel_t *) f->childimage->currlines[y - 1]) + 2;
+ else
+ up = ((spixel_t *) f->childimage->currlines[y]) + 2;
+ if (y != f->image->height - 1)
+ down = ((spixel_t *) f->childimage->currlines[y + 1]) + 2;
+ else
+ down = ((spixel_t *) f->childimage->currlines[y]) + 2;
+ end =
+ p_add(((cpixel_t *) f->image->currlines[y]),
+ f->image->width - 1);
+ p_setp(output, -1, 0);
+ p_setp(output, f->image->width - 2, 0);
+ while (output < end) {
+ if (input[1] != input[0] || input[0] != up[0]
+ || input[0] != down[0]) {
+ if (output < end - 2) {
+ p_set(output, pixels[input[0]]);
+ p_setp(output, 1, pixels[input[1]]);
+ p_setp(output, 2, pixels[input[2]]);
+ p_inc(output, 3);
+ input += 3;
+ up += 3;
+ down += 3;
+ while (output < end - 1
+ && (input[0] != up[-1] || input[0] != down[-1]))
+ {
+ p_set(output, pixels[input[0]]);
+ p_setp(output, 1, pixels[input[1]]);
+ p_inc(output, 2);
+ input += 2;
+ up += 2;
+ down += 2;
+ }
+ if (output < end
+ && (input[-1] != input[0] || up[-2] != input[0]
+ || down[-2] != input[0])) {
+ p_set(output, pixels[input[0]]);
+ p_inc(output, 1);
+ input++;
+ up++;
+ down++;
+ }
+ } else
+ p_set(output, pixels[*input]), p_inc(output, 1),
+ input++, up++, down++;
+ } else
+ p_set(output, black), p_inc(output, 1), input++, up++,
+ down++;
+ }
+ }
+}
+#endif
+#undef do_edge
diff --git a/src/engine/emboss.c b/src/engine/emboss.c
new file mode 100644
index 0000000..f5bef92
--- /dev/null
+++ b/src/engine/emboss.c
@@ -0,0 +1,266 @@
+#include <config.h>
+#ifndef _plan9_
+#ifdef NO_MALLOC_H
+#include <stdlib.h>
+#else
+#include <malloc.h>
+#endif
+#include <stdio.h>
+#else
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#endif
+#include <filter.h>
+#include <fractal.h>
+#include <xthread.h>
+struct embossdata {
+ struct palette *savedpalette, *palette;
+ int xdist, ydist;
+ unsigned int table[512];
+};
+static int requirement(struct filter *f, struct requirements *r)
+{
+ f->req = *r;
+ r->nimages = 1;
+ r->flags &= ~(IMAGEDATA);
+ r->supportedmask =
+ GRAYSCALE | C256 | TRUECOLOR24 | TRUECOLOR | TRUECOLOR16;
+
+ return (f->next->action->requirement(f->next, r));
+}
+
+static int initialize(struct filter *f, struct initdata *i)
+{
+ int x;
+ struct embossdata *s = (struct embossdata *) f->data;
+ inhermisc(f, i);
+ s->palette->size = 256 / 32;
+ for (x = 0; x < 256 / 32; x++)
+ s->palette->pixels[x] = x * 32;
+#define SSTEP (32*8/64)
+#define SSTEP2 (32*8/256)
+ if (datalost(f, i) || i->image->version != f->imageversion) {
+ if (s->savedpalette == NULL)
+ s->savedpalette = clonepalette(i->image->palette);
+ mkgraypalette(i->image->palette);
+ if (i->image->palette->type & (C256 | GRAYSCALE)) {
+ for (x = 0; x < 256; x++) {
+ int dist = (x + SSTEP - 1) / SSTEP;
+ dist += 32;
+ if (dist > 63)
+ dist = 63;
+ s->table[x] = i->image->palette->pixels[dist];
+ }
+ for (x = 256; x < 512; x++) {
+ int dist = -(512 - x + SSTEP - 1) / SSTEP;
+ dist += 32;
+ if (dist < 0)
+ dist = 0;
+ s->table[x] = i->image->palette->pixels[dist];
+ }
+ } else {
+ for (x = 0; x < 256; x++) {
+ int dist = (x + SSTEP2 - 1) / SSTEP2;
+ dist += 128;
+ if (dist > 255)
+ dist = 255;
+ s->table[x] =
+ ((dist >> i->image->palette->info.truec.
+ rprec) << i->image->palette->info.truec.
+ rshift) | ((dist >> i->image->palette->info.
+ truec.gprec) << i->image->palette->
+ info.truec.
+ gshift) | ((dist >>
+ i->image->palette->info.truec.bprec)
+ <<
+ i->image->palette->info.truec.bshift);
+
+ }
+ for (x = 256; x < 512; x++) {
+ int dist = -(512 - x + SSTEP2 - 1) / SSTEP2;
+ dist += 128;
+ if (dist < 0)
+ dist = 0;
+ s->table[x] =
+ ((dist >> i->image->palette->info.truec.
+ rprec) << i->image->palette->info.truec.
+ rshift) | ((dist >> i->image->palette->info.
+ truec.gprec) << i->image->palette->
+ info.truec.
+ gshift) | ((dist >>
+ i->image->palette->info.truec.bprec)
+ <<
+ i->image->palette->info.truec.bshift);
+ }
+ }
+ }
+ s->xdist = (int) (0.1 / i->image->pixelwidth);
+ s->ydist = (int) (0.1 / i->image->pixelwidth);
+ if (s->xdist < 1)
+ s->xdist = 1;
+ if (s->ydist < 1)
+ s->ydist = 1;
+ if (!inherimage
+ (f, i, TOUCHIMAGE, i->image->width + s->xdist,
+ i->image->height + s->ydist, s->palette, 0, 0))
+ return 0;
+ clear_image(f->image);
+ setfractalpalette(f, s->savedpalette);
+ return (f->previous->action->initialize(f->previous, i));
+}
+
+static struct filter *getinstance(CONST struct filteraction *a)
+{
+ struct filter *f = createfilter(a);
+ struct embossdata *i = (struct embossdata *) calloc(1, sizeof(*i));
+ i->savedpalette = NULL;
+ i->palette =
+ createpalette(0, 256, GRAYSCALE, 0, 256, NULL, NULL, NULL, NULL,
+ NULL);
+ f->childimage = NULL;
+ f->data = i;
+ f->name = "Emboss";
+ return (f);
+}
+
+static void emboss8(void *data, struct taskinfo *task, int r1, int r2)
+{
+ pixel8_t *src, *srcend, *src2;
+ pixel8_t *dest;
+ struct filter *f = (struct filter *) data;
+ struct embossdata *s = (struct embossdata *) f->data;
+ int i;
+ unsigned int *table = s->table;
+ for (i = r1; i < r2; i++) {
+ src = f->childimage->currlines[i];
+ src2 = f->childimage->currlines[i + s->ydist] + s->xdist;
+ srcend = src + f->image->width;
+ dest = f->image->currlines[i];
+ while (src < srcend) {
+ *dest = table[((int) *src2 - (int) *src) & 511];
+ src++;
+ src2++;
+ dest++;
+ }
+ }
+}
+
+#ifdef SUPPORT16
+static void emboss16(void *data, struct taskinfo *task, int r1, int r2)
+{
+ pixel8_t *src, *srcend, *src2;
+ pixel16_t *dest;
+ struct filter *f = (struct filter *) data;
+ struct embossdata *s = (struct embossdata *) f->data;
+ int i;
+ unsigned int *table = s->table;
+ for (i = r1; i < r2; i++) {
+ src = f->childimage->currlines[i];
+ src2 = f->childimage->currlines[i + s->ydist] + s->xdist;
+ srcend = src + f->image->width;
+ dest = (pixel16_t *) f->image->currlines[i];
+ while (src < srcend) {
+ *dest = table[((int) *src2 - (int) *src) & 511];
+ src++;
+ src2++;
+ dest++;
+ }
+ }
+}
+#endif
+#ifdef STRUECOLOR24
+static void emboss24(void *data, struct taskinfo *task, int r1, int r2)
+{
+ pixel8_t *src, *srcend, *src2;
+ pixel8_t *dest;
+ struct filter *f = (struct filter *) data;
+ struct embossdata *s = (struct embossdata *) f->data;
+ int i;
+ unsigned int *table = s->table;
+ for (i = r1; i < r2; i++) {
+ src = f->childimage->currlines[i];
+ src2 = f->childimage->currlines[i + s->ydist] + s->xdist;
+ srcend = src + f->image->width;
+ dest = (pixel8_t *) f->image->currlines[i];
+ while (src < srcend) {
+ *dest = *(dest + 1) = *(dest + 2) =
+ table[((int) *src2 - (int) *src) & 511];
+ src++;
+ src2++;
+ dest += 3;
+ }
+ }
+}
+#endif
+static void emboss32(void *data, struct taskinfo *task, int r1, int r2)
+{
+ pixel8_t *src, *srcend, *src2;
+ pixel32_t *dest;
+ struct filter *f = (struct filter *) data;
+ struct embossdata *s = (struct embossdata *) f->data;
+ int i;
+ unsigned int *table = s->table;
+ for (i = r1; i < r2; i++) {
+ src = f->childimage->currlines[i];
+ src2 = f->childimage->currlines[i + s->ydist] + s->xdist;
+ srcend = src + f->image->width;
+ dest = (pixel32_t *) f->image->currlines[i];
+ while (src < srcend) {
+ *dest = table[((int) *src2 - (int) *src) & 511];
+ src++;
+ src2++;
+ dest++;
+ }
+ }
+}
+
+static void destroyinstance(struct filter *f)
+{
+ struct embossdata *i = (struct embossdata *) f->data;
+ if (i->savedpalette != NULL)
+ destroypalette(i->savedpalette);
+ destroypalette(i->palette);
+ destroyinheredimage(f);
+ free(f->data);
+ free(f);
+}
+
+static int doit(struct filter *f, int flags, int time1)
+{
+ int val;
+ int time = time1;
+ updateinheredimage(f);
+ val = f->previous->action->doit(f->previous, flags, time);
+ drivercall(*f->image,
+ xth_function(emboss8, f, f->image->height),
+ xth_function(emboss16, f, f->image->height),
+ xth_function(emboss24, f, f->image->height),
+ xth_function(emboss32, f, f->image->height));
+ xth_sync();
+ return val;
+}
+
+static void myremovefilter(struct filter *f)
+{
+ struct embossdata *s = (struct embossdata *) f->data;
+ if (s->savedpalette != NULL) {
+ restorepalette(f->image->palette, s->savedpalette);
+ destroypalette(s->savedpalette);
+ s->savedpalette = NULL;
+ }
+}
+
+CONST struct filteraction emboss_filter = {
+ "Emboss",
+ "emboss",
+ 0,
+ getinstance,
+ destroyinstance,
+ doit,
+ requirement,
+ initialize,
+ convertupgeneric,
+ convertdowngeneric,
+ myremovefilter
+};
diff --git a/src/engine/engine.pri b/src/engine/engine.pri
new file mode 100644
index 0000000..1be3f0f
--- /dev/null
+++ b/src/engine/engine.pri
@@ -0,0 +1,35 @@
+SOURCES += \
+ $$PWD/formulas.c \
+ $$PWD/fractal.c \
+ $$PWD/btrace.c \
+ $$PWD/palettef.c \
+ $$PWD/emboss.c \
+ $$PWD/star.c \
+ $$PWD/anti.c \
+ $$PWD/dither.c \
+ $$PWD/edge.c \
+ $$PWD/edge2.c \
+ $$PWD/rotate.c \
+ $$PWD/zoom.c \
+ $$PWD/blur.c \
+ $$PWD/interlace.c \
+ $$PWD/itersmall.c \
+ $$PWD/stereogram.c \
+ $$PWD/3d.c \
+ $$PWD/subwindow.c \
+ $$PWD/plane.c \
+ $$PWD/julia.c \
+ $$PWD/i386.c
+
+OTHER_FILES += \
+ $$PWD/3dd.c \
+ $$PWD/btraced.c \
+ $$PWD/docalc.c \
+ $$PWD/edged.c \
+ $$PWD/edge2d.c \
+ $$PWD/docalc.c \
+ $$PWD/paletted.c \
+ $$PWD/rotated.c \
+ $$PWD/stard.c \
+ $$PWD/stereod.c \
+ $$PWD/zoomd.c
diff --git a/src/engine/formulas.c b/src/engine/formulas.c
new file mode 100644
index 0000000..239ff10
--- /dev/null
+++ b/src/engine/formulas.c
@@ -0,0 +1,3038 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifdef _plan9_
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#else
+/* Hello reader!
+ * code you are looking at is dangerous for both you and your hardware! PLEASE
+ * CLOSE THIS FILE UNLESS YOU REALY KNOW WHAT YOU ARE DOING.
+ *
+ * Main purpose of this file is to generate optimal caluclation loops for
+ * various formulas/algorithms. It heavily includes docalc.c - set of
+ * caluclation loops, that then uses macros instad of formulas. This lets me
+ * to change calculation loops easily. At the other hand it looks very ugly.
+ * You have been warned :)
+ */
+
+// Some help can be read below about line 700. :-)
+
+
+#ifndef _MAC
+#include <aconfig.h>
+#endif
+
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#include <string.h>
+#include <stdlib.h>
+#include <math.h>
+#include <float.h>
+#ifdef __EMX__
+#include <sys/cdefs.h>
+#endif
+#include <stdio.h>
+#endif /*plan9 */
+#include <archaccel.h>
+#include <config.h>
+#include <complex.h>
+#include <filter.h>
+#include <fractal.h>
+#include "julia.h"
+#include <ui_helper.h>
+#ifndef M_PI
+#define M_PI 3.1415
+#endif
+
+#ifdef SLOWFUNCPTR
+#define FUNCTYPE INLINE
+#else
+#define FUNCTYPE
+#endif
+
+#ifdef SFFE_USING
+#include "sffe.h"
+
+extern struct uih_context *globaluih; // to be able to use sffe parser
+#endif
+
+CONST char *CONST incolorname[] = {
+ "0",
+ "zmag",
+ "Decomposition-like",
+ "real/imag",
+ "abs(abs(c)-abs(r))",
+ "cos(mag)",
+ "mag*cos(real^2)",
+ "sin(real^2-imag^2)",
+ "atan(real*imag*creal*cimag)",
+ "squares",
+ "True-color",
+ NULL
+};
+
+CONST char *CONST outcolorname[] = {
+ "iter",
+ "iter+real",
+ "iter+imag",
+ "iter+real/imag",
+ "iter+real+imag+real/imag",
+ "binary decomposition",
+ "biomorphs",
+ "potential",
+ "color decomposition",
+ "smooth",
+ "True-color",
+ NULL
+};
+
+CONST char *CONST tcolorname[] = {
+ "black",
+ "re*im sin(re^2) angle",
+ "sin(re) sin(im) sin(square)",
+ "hsv",
+ "hsv2",
+ "cos(re^c) cos(im^2) cos(square)",
+ "abs(re^2) abs(im^2) abs(square)",
+ "re*im re*re im*im",
+ "abs(im*cim) abs(re*cre) abs(re*cim)",
+ "abs(re*im-csqr) abs(re^2-csqr) abs(im^2-csqr)",
+ "angle angle2 angle",
+ "Disable truecolor colouring",
+ "simple red (for education purposes)",
+ "simple blue (for education purposes)",
+ NULL
+};
+
+#define SHIFT 8
+#define SMUL 256
+
+#define __GNUC__EGCS
+/* i386 fp comparsions are incredibly slow. We get much better results when we
+ do it in integer unit. This trick works well for numbers>0*/
+#ifdef __GNUC__EGCS
+#ifdef __i386__121
+
+/* Use union to be alias-analysis correct. */
+typedef union {
+ unsigned int *i;
+ float *f;
+} fpint;
+#define less_than_4(x) ({float tmp=(x); fpint ptr; ptr.f=&tmp;*ptr.i<0x40800000U;})
+#define less_than_0(x) ({float tmp=(x); fpint ptr; ptr.f=&tmp;*ptr.i&0x80000000U;})
+#define greater_then_1Em6(x) ({float tmp=(x); fpint ptr; ptr.f=&tmp;*ptr.i>(unsigned int)0x358637bdU;})
+#define abs_less_than(x,y) ({float tmp=(x), tmp2=(y); fpint ptr, ptr2; ptr.f=&tmp; ptr2.f=&tmp2;(*ptr.i&~0x80000000U)<*ptr2.i;})
+#define greater_than(x,y) ({float tmp=(x), tmp2=(y); fpint ptr, ptr2; ptr.f=&tmp; ; ptr2.f=&tmp2;*ptr.i>*ptr2.i;})
+#endif
+#endif
+#ifndef less_than_4
+#define less_than_0(x) ((x)<0)
+#define less_than_4(x) ((x)<cfractalc.bailout)
+#define greater_then_1Em6(n) ((n)>1E-6)
+#define abs_less_than(x,y) (myabs(x)<y)
+#define greater_than(x,y) ((x)>(y))
+#endif
+
+
+
+#define PERIINOUTPUT() STAT(nperi++;ninside2++);return(cpalette.pixels[0])
+
+#define OUTOUTPUT() STAT(niter2+=iter);return(!cfractalc.coloringmode?cpalette.pixels[(iter%(cpalette.size-1))+1]:color_output(zre,zim,iter))
+#define INOUTPUT() STAT(niter1+=iter;ninside2++);return(cfractalc.incoloringmode?incolor_output(zre,zim,pre,pim,iter):cpalette.pixels[0])
+
+#define OUTPUT() if(iter>=(unsigned int)cfractalc.maxiter)\
+ { \
+ if(cfractalc.incoloringmode==10) return(truecolor_output(zre,zim,pre,pim,cfractalc.intcolor,1)); \
+ INOUTPUT(); \
+ } \
+ else { \
+ if(cfractalc.coloringmode==10) return(truecolor_output(zre,zim,pre,pim,cfractalc.outtcolor,0)); \
+ OUTOUTPUT(); \
+ }
+
+#define SMOOTHOUTPUT() {PRESMOOTH;zre+=0.000001;szmag+=0.000001; \
+ iter=(int)(((cfractalc.maxiter-iter)*256+log((double)(cfractalc.bailout/(szmag)))/log((double)((zre)/(szmag)))*256)); \
+ if (iter < 0) {\
+ iter = (((unsigned int)(cpalette.size - 1)) << 8) - ((-iter) % (((unsigned int)(cpalette.size - 1)) << 8))-1; \
+ if (iter < 0) iter=0; \
+ } \
+ iter %= ((unsigned int)(cpalette.size - 1)) << 8; \
+ \
+ if ((cpalette.type & (C256 | SMALLITER)) || !(iter & 255)) \
+ return (cpalette.pixels[1 + (iter >> 8)]); \
+ { \
+ unsigned int i1, i2; \
+ i1 = cpalette.pixels[1 + (iter >> 8)]; \
+ if ((iter >> 8) == (unsigned int)(cpalette.size - 2)) \
+ i2 = cpalette.pixels[1]; \
+ else \
+ i2 = cpalette.pixels[2 + (iter >> 8)]; \
+ iter &= 255; \
+ return (interpoltype (cpalette, i2, i1, iter)); \
+ } \
+ }
+/* 2009-07-30 JB Langston:
+ * Fixing bug #3: HSV modes are completely black when compiled with GCC 4...
+ * Removed CONSTF qualifier from hsv_to_rgb declaration. CONSTF macro is
+ * defined to __attribute__((__const__)), on which I found some more details
+ * here: http://unixwiz.net/techtips/gnu-c-attributes.html#const. Apparently
+ * this should never be used with a function that takes a pointer or relies on
+ * side-effects, and hsv_to_rgb does both. Therefore, it should never have
+ * been declared this way in the first place.
+ */
+
+static INLINE void
+hsv_to_rgb(int h, int s, int v, int *red, int *green, int *blue) /*CONSTF*/;
+static INLINE void
+hsv_to_rgb(int h, int s, int v, int *red, int *green, int *blue)
+{
+ int hue;
+ int f, p, q, t;
+
+ if (s == 0) {
+ *red = v;
+ *green = v;
+ *blue = v;
+ } else {
+ h %= 256;
+ if (h < 0)
+ h += 256;
+ hue = h * 6;
+
+ f = hue & 255;
+ p = v * (256 - s) / 256;
+ q = v * (256 - (s * f) / 256) >> 8;
+ t = v * (256 * 256 - (s * (256 - f))) >> 16;
+
+ switch ((int) (hue / 256)) {
+ case 0:
+ *red = v;
+ *green = t;
+ *blue = p;
+ break;
+ case 1:
+ *red = q;
+ *green = v;
+ *blue = p;
+ break;
+ case 2:
+ *red = p;
+ *green = v;
+ *blue = t;
+ break;
+ case 3:
+ *red = p;
+ *green = q;
+ *blue = v;
+ break;
+ case 4:
+ *red = t;
+ *green = p;
+ *blue = v;
+ break;
+ case 5:
+ *red = v;
+ *green = p;
+ *blue = q;
+ break;
+ }
+ }
+}
+
+static unsigned int
+truecolor_output(number_t zre, number_t zim, number_t pre, number_t pim,
+ int mode, int inset)
+CONSTF REGISTERS(3);
+REGISTERS(3)
+static unsigned int
+truecolor_output(number_t zre, number_t zim, number_t pre,
+ number_t pim, int mode, int inset)
+{
+ /* WARNING: r and b fields are swapped for HISTORICAL REASONS (BUG :),
+ * in other words: use r for blue and b for red. */
+ int r = 0, g = 0, b = 0, w = 0;
+
+ switch (mode) {
+ case 0:
+ break;
+ case 1:
+ b = (int) ((sin((double) atan2((double) zre, (double) zim) * 20) +
+ 1) * 127);
+ w = (int) ((sin((double) zim / zre)) * 127);
+ r = (int) ((int) (zre * zim));
+ g = (int) ((sin((double) (zre * zre) / 2) + 1) * 127);
+ break;
+ case 2:
+ if (!inset) {
+ r = (int) ((sin((double) zre * 2) + 1) * 127);
+ g = (int) ((sin((double) zim * 2) + 1) * 127);
+ b = (int) ((sin((double) (zim * zim + zre * zre) / 2) +
+ 1) * 127);
+ } else {
+ r = (int) ((sin((double) zre * 50) + 1) * 127);
+ g = (int) ((sin((double) zim * 50) + 1) * 127);
+ b = (int) ((sin((double) (zim * zim + zre * zre) * 50) +
+ 1) * 127);
+ }
+ w = (int) ((sin((double) zim / zre)) * 127);
+ break;
+ case 3:
+ if (inset)
+ hsv_to_rgb((int)
+ (atan2((double) zre, (double) zim) * 256 / M_PI),
+ (int) ((sin((double) (zre * 50)) + 1) * 128),
+ (int) ((sin((double) (zim * 50)) + 1) * 128), &r,
+ &g, &b);
+ else
+ hsv_to_rgb((int)
+ (atan2((double) zre, (double) zim) * 256 / M_PI),
+ (int) ((sin((double) zre) + 1) * 128),
+ (int) ((sin((double) zim) + 1) * 128), &r, &g, &b);
+ break;
+ case 4:
+ if (inset)
+ hsv_to_rgb((int)
+ (sin((double) (zre * zre + zim * zim) * 0.1) * 256),
+ (int) (sin(atan2((double) zre, (double) zim) * 10) *
+ 128 + 128),
+ (int) ((sin((double) (zre + zim) * 10)) * 65 + 128),
+ &r, &g, &b);
+ else
+ hsv_to_rgb((int)
+ (sin((double) (zre * zre + zim * zim) * 0.01) *
+ 256),
+ (int) (sin(atan2((double) zre, (double) zim) * 10) *
+ 128 + 128),
+ (int) ((sin((double) (zre + zim) * 0.3)) * 65 +
+ 128), &r, &g, &b);
+ break;
+ case 5:
+ {
+ if (!inset) {
+ r = (int) (cos((double) myabs(zre * zre)) * 128) + 128;
+ g = (int) (cos((double) myabs(zre * zim)) * 128) + 128;
+ b = (int) (cos((double) myabs(zim * zim + zre * zre)) *
+ 128) + 128;
+ } else {
+ r = (int) (cos((double) myabs(zre * zre) * 10) * 128) +
+ 128;
+ g = (int) (cos((double) myabs(zre * zim) * 10) * 128) +
+ 128;
+ b = (int) (cos((double) myabs(zim * zim + zre * zre) * 10)
+ * 128) + 128;
+ }
+ }
+ break;
+ case 6:
+ {
+ if (!inset) {
+ r = (int) (zre * zim * 64);
+ g = (int) (zre * zre * 64);
+ b = (int) (zim * zim * 64);
+ } else
+ r = (int) (zre * zim * 256);
+ g = (int) (zre * zre * 256);
+ b = (int) (zim * zim * 256);
+ }
+ break;
+ case 7:
+ {
+ if (!inset) {
+ r = (int) ((zre * zre + zim * zim - pre * pre -
+ pim * pim) * 16);
+ g = (int) ((zre * zre * 2 - pre * pre - pim * pim) * 16);
+ b = (int) ((zim * zim * 2 - pre * pre - pim * pim) * 16);
+ } else {
+ r = (int) ((zre * zre + zim * zim - pre * pre -
+ pim * pim) * 256);
+ g = (int) ((zre * zre * 2 - pre * pre - pim * pim) * 256);
+ b = (int) ((zim * zim * 2 - pre * pre - pim * pim) * 256);
+ }
+ }
+ break;
+ case 8:
+ {
+ if (!inset) {
+ r = (int) ((myabs(zim * pim)) * 64);
+ g = (int) ((myabs(zre * pre)) * 64);
+ b = (int) ((myabs(zre * pim)) * 64);
+ } else {
+ r = (int) ((myabs(zim * pim)) * 256);
+ g = (int) ((myabs(zre * pre)) * 256);
+ b = (int) ((myabs(zre * pim)) * 256);
+ }
+ }
+ break;
+ case 9:
+ {
+ if (!inset) {
+ r = (int) ((myabs(zre * zim - pre * pre - pim * pim)) *
+ 64);
+ g = (int) ((myabs(zre * zre - pre * pre - pim * pim)) *
+ 64);
+ b = (int) ((myabs(zim * zim - pre * pre - pim * pim)) *
+ 64);
+ } else {
+ r = (int) ((myabs(zre * zim - pre * pre - pim * pim)) *
+ 256);
+ g = (int) ((myabs(zre * zre - pre * pre - pim * pim)) *
+ 256);
+ b = (int) ((myabs(zim * zim - pre * pre - pim * pim)) *
+ 256);
+ }
+ }
+ break;
+ case 10:
+ {
+ r = (int) (atan2((double) zre, (double) zim) * 128 / M_PI) +
+ 128;
+ g = (int) (atan2((double) zre, (double) zim) * 128 / M_PI) +
+ 128;
+ b = (int) (atan2((double) zim, (double) zre) * 128 / M_PI) +
+ 128;
+ }
+ break;
+ // case 11 is for disabling truecolor mode
+ case 12:
+ {
+ b = 255;
+ g = 0;
+ r = 0;
+ w = 50;
+ }
+ break;
+ case 13:
+ {
+ r = 255;
+ g = 0;
+ b = 0;
+ w = 0;
+ }
+ break;
+ }
+
+ r += w;
+ g += w;
+ b += w;
+ if (r < 0)
+ r = 0;
+ else if (r > 255)
+ r = 255;
+ if (g < 0)
+ g = 0;
+ else if (g > 255)
+ g = 255;
+ if (b < 0)
+ b = 0;
+ else if (b > 255)
+ b = 255;
+
+ switch (cpalette.type) {
+ case GRAYSCALE:
+ return ((unsigned int) (r * 76 + g * 151 + b * 29) *
+ (cpalette.end - cpalette.start) >> 16) + cpalette.start;
+ case TRUECOLOR:
+ case TRUECOLOR24:
+ case TRUECOLOR16:
+ r >>= cpalette.info.truec.bprec;
+ g >>= cpalette.info.truec.gprec;
+ b >>= cpalette.info.truec.rprec;
+ return ((r << cpalette.info.truec.bshift) +
+ (g << cpalette.info.truec.gshift) +
+ (b << cpalette.info.truec.rshift));
+ }
+
+ return cpalette.pixels[inset];
+}
+
+#ifdef __alpha__
+#define __TEST__
+#endif
+static unsigned int
+color_output(number_t zre, number_t zim, unsigned int iter)
+CONSTF REGISTERS(3);
+static unsigned int
+REGISTERS(3) color_output(number_t zre, number_t zim, unsigned int iter)
+{
+ int i;
+ iter <<= SHIFT;
+ i = iter;
+
+ switch (cfractalc.coloringmode) {
+ case 9:
+ break;
+ case 1: /* real */
+ i = (int) (iter + zre * SMUL);
+ break;
+ case 2: /* imag */
+ i = (int) (iter + zim * SMUL);
+ break;
+ case 3: /* real / imag */
+#ifdef __TEST__
+ if (zim != 0)
+#endif
+ i = (int) (iter + (zre / zim) * SMUL);
+ break;
+ case 4: /* all of the above */
+#ifdef __TEST__
+ if (zim != 0)
+#endif
+ i = (int) (iter + (zre + zim + zre / zim) * SMUL);
+ break;
+ case 5:
+ if (zim > 0)
+ i = ((cfractalc.maxiter << SHIFT) - iter);
+ break;
+ case 6:
+ if (myabs(zim) < 2.0 || myabs(zre) < 2.0)
+ i = ((cfractalc.maxiter << SHIFT) - iter);
+ break;
+ case 7:
+ zre = zre * zre + zim * zim;
+#ifdef __TEST__
+ if (zre < 1 || !i)
+ i = 0;
+ else
+#endif
+ i = (int) (sqrt(log((double) zre) / i) * 256 * 256);
+ break;
+ default:
+ case 8:
+ i = (int) ((atan2((double) zre, (double) zim) / (M_PI + M_PI) +
+ 0.75) * 20000);
+ break;
+ }
+
+ if (i < 0) {
+ i = (((unsigned int) (cpalette.size - 1)) << 8) -
+ ((-i) % (((unsigned int) (cpalette.size - 1) << 8))) - 1;
+ if (i < 0)
+ i = 0;
+ }
+ iter = ((unsigned int) i) % ((cpalette.size - 1) << 8);
+ if ((cpalette.type & (C256 | SMALLITER)) || !(iter & 255))
+ return (cpalette.pixels[1 + (iter >> 8)]);
+ {
+ unsigned int i1, i2;
+
+ i1 = cpalette.pixels[1 + (iter >> 8)];
+
+ if ((int) (iter >> 8) == cpalette.size - 2)
+ i2 = cpalette.pixels[1];
+ else
+ i2 = cpalette.pixels[2 + (iter >> 8)];
+
+ iter &= 255;
+ return (interpoltype(cpalette, i2, i1, iter));
+ }
+
+}
+
+static unsigned int
+incolor_output(number_t zre, number_t zim, number_t pre, number_t pim,
+ unsigned int iter)
+CONSTF REGISTERS(3);
+REGISTERS(3)
+static unsigned int
+incolor_output(number_t zre, number_t zim, number_t pre, number_t pim,
+ unsigned int iter)
+{
+ int i = iter;
+ switch (cfractalc.incoloringmode) {
+ case 1: /* zmag */
+ i = (int) (((zre * zre + zim * zim) *
+ (number_t) (cfractalc.maxiter >> 1) * SMUL + SMUL));
+ break;
+ case 2: /* real */
+ i = (int) (((atan2((double) zre, (double) zim) / (M_PI + M_PI) +
+ 0.75) * 20000));
+ break;
+ default:
+ break;
+ case 3: /* real / imag */
+ i = (int) (100 + (zre / zim) * SMUL * 10);
+ break;
+ case 4:
+ zre = myabs(zre);
+ zim = myabs(zim);
+ pre = myabs(pre);
+ pre = myabs(pim);
+ i += (int) (myabs(pre - zre) * 256 * 64);
+ i += (int) (myabs(pim - zim) * 256 * 64);
+ break;
+ case 5:
+ if (((int) ((zre * zre + zim * zim) * 10)) % 2)
+ i = (int) (cos((double) (zre * zim * pre * pim)) * 256 * 256);
+ else
+ i = (int) (sin((double) (zre * zim * pre * pim)) * 256 * 256);
+ break;
+ case 6:
+ i = (int) ((zre * zre +
+ zim * zim) * cos((double) (zre * zre)) * 256 * 256);
+ break;
+ case 7:
+ i = (int) (sin((double) (zre * zre - zim * zim)) * 256 * 256);
+ break;
+ case 8:
+ i = (int) (atan((double) (zre * zim * pre * pim)) * 256 * 64);
+ break;
+ case 9:
+ if ((abs((int) (zre * 40)) % 2) ^ (abs((int) (zim * 40)) % 2))
+ i = (int) (((atan2((double) zre, (double) zim) /
+ (M_PI + M_PI) + 0.75)
+ * 20000));
+ else
+ i = (int) (((atan2((double) zim, (double) zre) /
+ (M_PI + M_PI) + 0.75)
+ * 20000));
+ break;
+ };
+
+ if (i < 0) {
+ i = (((unsigned int) (cpalette.size - 1)) << 8) -
+ ((-i) % (((unsigned int) (cpalette.size - 1) << 8))) - 1;
+ if (i < 0)
+ i = 0;
+ }
+ iter = ((unsigned int) i) % ((cpalette.size - 1) << 8);
+
+ if ((cpalette.type & (C256 | SMALLITER)) || !(iter & 255))
+ return (cpalette.pixels[1 + ((unsigned int) iter >> 8)]);
+ {
+ unsigned int i1, i2;
+ i1 = cpalette.pixels[1 + ((unsigned int) iter >> 8)];
+ if (((unsigned int) iter >> 8) ==
+ (unsigned int) (cpalette.size - 2))
+ i2 = cpalette.pixels[1];
+ else
+ i2 = cpalette.pixels[2 + ((unsigned int) iter >> 8)];
+ iter &= 255;
+ return (interpoltype(cpalette, i2, i1, iter));
+ }
+
+}
+
+#define VARIABLES
+#define INIT
+#define UNCOMPRESS
+#define USEHACKS
+#define PRETEST 0
+#define FORMULA \
+ zim=(zim*zre)*2+pim; \
+ zre = rp - ip + pre; \
+ ip=zim*zim; \
+ rp=zre*zre;
+#ifdef _NEVER_
+#ifdef __GNUC__
+#ifdef __i386__
+#ifndef NOASSEMBLY
+/* The hand optimized internal loops can save extra 9% of CPU speed compared
+ to latest GCC snapshot. */
+
+/* GCC has ugly support for asm statements with fp input/output, so we use
+ * memory. */
+#define NSFORMULALOOP(iter) \
+{ int tmp; \
+asm( \
+"movl %%edx, %1\n\t" \
+"fldt %9\n\t" \
+"fxch %%st(2)\n\t" \
+"fldt %8\n\t" \
+"fxch %%st(2)\n\t" \
+"fld %%st(0)\n\t" \
+".align 16\n\t" \
+"1:\n\t" \
+"fld %%st(0)\n\t" /* zre zre zim pre pim */ \
+"fxch %%st(2)\n\t" /* zim zre zre ... */ \
+"fmul %%st(0),%%st(2)\n\t" /* zim zre zim*zre */ \
+"movl %1,%%eax\n\t" \
+"fmul %%st(0),%%st(0)\n\t" /* zim*zim zre zim*zre */ \
+"fxch %%st(2)\n\t" /* zim*zre zre zim*zim */ \
+"fadd %%st(0),%%st(0)\n\t" /* 2*zre*zim zre zim*zim */ \
+"fxch %%st(1)\n\t" /* zre 2*zre*zim zim*zim */ \
+"fmul %%st(0),%%st(0)\n\t" /* zre*zre 2*zre*zim zim*zim */ \
+"fxch %%st(1)\n\t" /* 2*zre*zim zre*zre zim*zim */ \
+"fld %%st(2)\n\t" /* zim*zim 2*zre*zim zre*zre zim*zim */ \
+"fsub %%st(4),%%st(0)\n\t" /* zim*zim-pre 2*zre*zim zre*zre zim*zim */ \
+"fxch %%st(3)\n\t" /* zim*zim 2*zre*zim zre*zre zim*zim-pre */ \
+"fadd %%st(2),%%st(0)\n\t" /* zim*zim+zre*zre 2*zre*zim zre*zre zim*zim-pre */ \
+"fxch %%st(1)\n\t" /* 2*zre*zim zim*zim+zre*zre zre*zre zim*zim-pre */ \
+"fadd %%st(5),%%st(0)\n\t" /* 2*zre*zim*pim zim*zim+zre*zre zre*zre zim*zim-pre*/ \
+"fxch %%st(3)\n\t" /* zim*zim-pre zim*zim+zre*zre zre*zre 2*zre*zim+pim */ \
+"fsubp %%st(0),%%st(2)\n\t" /* zim*zim+zre*zre zre*zre-zim*zim+pre 2*zre*zim+pim */ \
+"cmpl %%edx,%%eax\n\t" \
+"ja 2f\n\t" /* cond branch */ \
+"fstps %1\n\t" /* aa-bb+r 2ab+i r i */ \
+"decl %%ecx\n\t" /* */ \
+"jnz 1b\n\t" /* */ \
+"fld %%st(0)\n\t" \
+"2:\n\t" \
+"fstp %%st(0)\n\t" \
+"fstp %%st(2)\n\t" \
+"fstp %%st(2)\n\t" \
+:"=c"(iter),"=m"(tmp),"=&t"(zim),"=&u"(zre) \
+:"d"(0x40800000),"0"(iter),"2"(zre),"3"(zim),"m"(pre),"m"(pim) \
+:"eax","st(2)","st(3)","st(4)","st(5)"); \
+}
+
+pacalc(long double zre, long double zim, long double pre, long double pim)
+{
+ int iter = 1000000;
+ NSFORMULALOOP(iter);
+ return iter;
+}
+#endif
+#endif
+#endif
+#endif
+
+/* Some help for the brave ones. :-)
+ *
+ * Mandelbrot's original formula is z=z^2+c which means
+ * z[next]=z[previous]^2+c.
+ * Here c is the pixel coordinates from the screen and z[0] is usually 0
+ * (if not perturbation was added.)
+ * In the following code z[previous] is described by (zre;zim)
+ * and z[next] will also be zre and zim.
+ * c is described by (pre;pim).
+ * Finally rp and ip are helper variables, mostly for checking the bailout
+ * (which usually means abs(z)>=4, see BTEST).
+ *
+ * Both basic operations and some other functions (c_mul, c_pow3, ...) can
+ * be used. For a "detailed" description refer to ../include/complex.h.
+ *
+ * If you add/modify fractals, please note that struct formula_formulas
+ * (at line cca. 1300) should be also edited for proper initialization
+ * and for menu entries. However it is not self-explanatory, just copy-paste
+ * existing tables and give it a try.
+ *
+ * Finally, please also edit the calculateswitch function and
+ * the nmformulas constant (at the end of this file).
+ *
+ * -- Zoltan, 2009-07-30
+ */
+
+
+#define BTEST less_than_4(rp+ip)
+#define SMOOTH
+#define SCALC smand_calc
+#define SPERI smand_peri
+#define CALC mand_calc
+#define PERI mand_peri
+#define JULIA mand_julia
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+#ifdef __i386__
+#define UNCOMPRESS
+#endif
+#define USEHACKS
+#define PRETEST 0
+#define FORMULA \
+ rp = zre * (rp - 3 * ip); \
+ zim = zim * (3 * zre * zre - ip) + pim; \
+ zre = rp + pre; \
+ rp = zre * zre; \
+ ip = zim * zim;
+#define BTEST less_than_4(rp+ip)
+#define SMOOTH
+#define SCALC smand3_calc
+#define SPERI smand3_peri
+#define CALC mand3_calc
+#define PERI mand3_peri
+#define JULIA mand3_julia
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+
+#define UNCOMPRESS
+#define VARIABLES number_t br,tmp;
+#define FORMULA \
+ br = zre + zre + pre - 2; \
+ tmp = zre * zim; \
+ zre = rp - ip + pre - 1; \
+ ip = zim + zim + pim; \
+ zim = tmp + tmp + pim; \
+ tmp = 1 / (br * br + ip * ip); \
+ rp = (zre * br + zim * ip) * tmp; \
+ ip = (zim * br - zre * ip) * tmp; \
+ zre = (rp + ip) * (rp - ip); \
+ zim = rp * ip; \
+ zim += zim; \
+ rp = zre - 1; \
+ ip = zim * zim; \
+ rp = zre * zre;
+#define BTEST (rp+ip<(number_t)100*100&&(rp-2*zre+ip)>0.04/cfractalc.bailout-1)
+#define POSTCALC \
+ if(rp-2*zre+ip>0.04/cfractalc.bailout-1){ \
+ zre *= 0.08/cfractalc.bailout, zim *= 0.08/cfractalc.bailout; \
+ if(iter) \
+ iter = cfractalc.maxiter - iter + 1; \
+ }
+#define CALC magnet_calc
+#define PERI magnet_peri
+#define SCALC smagnet_calc
+#define SPERI smagnet_peri
+#define SMOOTH
+#define PRESMOOTH szmag/=100*100/4;zre=(rp+ip)/(100*100*4);
+#define JULIA magnet_julia
+#define RANGE 4
+#define RPIP
+#include "docalc.c"
+
+#define UNCOMPRESS
+#define VARIABLES number_t inre,inim,tmp1,tmp2,dnre,nmre,dnim;
+#define INIT \
+ inre = pre*pre - pim*pim - pre - pre - pre; \
+ inim = pre*pim; \
+ inim = inim + inim - pim - pim - pim;
+#define FORMULA \
+ tmp1 = rp - ip; \
+ tmp2 = zre*pre - zim*pim - zre; \
+ dnre = tmp1 + tmp1 + tmp1 + tmp2 + tmp2 + tmp2 - zre - zre - zre + inre + 3; \
+ tmp1 = zre*ip;\
+ nmre = zre*rp - tmp1 - tmp1 - tmp1 + tmp2 + tmp2 + tmp2 + inre + 2; \
+ tmp1 = zre*zim; \
+ tmp2 = zre*pim + zim*pre - zim; \
+ dnim = tmp1 + tmp1 + tmp1 + tmp1 + tmp1 + tmp1 + tmp2 + tmp2 + tmp2 - zim - zim - zim + inim; \
+ tmp1 = zim*rp; \
+ zim = tmp1 + tmp1 + tmp1 - zim*ip + tmp2 + tmp2 + tmp2 + inim; \
+ zre = nmre; \
+ ip = dnim; \
+ tmp1 = 1 / (dnre * dnre + ip * ip); \
+ rp = (zre * dnre + zim * ip) * tmp1; \
+ ip = (zim * dnre - zre * ip) * tmp1; \
+ zre = (rp + ip) * (rp - ip); \
+ zim = rp * ip; \
+ zim += zim; \
+ ip = zim * zim; \
+ rp = zre * zre;
+#define BTEST (rp+ip<(number_t)100*100&&(rp-2*zre+ip)>0.04/cfractalc.bailout-1)
+#define POSTCALC \
+ if(rp-2*zre+ip>0.04/cfractalc.bailout-1){ \
+ zre *= 0.08/cfractalc.bailout, zim *= 0.08/cfractalc.bailout; \
+ if(iter) \
+ iter = cfractalc.maxiter - iter + 1; \
+ }
+#define CALC magnet2_calc
+#define PERI magnet2_peri
+#define SCALC smagnet2_calc
+#define SPERI smagnet2_peri
+#define SMOOTH
+#define PRESMOOTH szmag/=100*100/4;zre=(rp+ip)/(100*100*4);
+#define JULIA magnet2_julia
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+#ifdef __i386__
+#define UNCOMPRESS
+#endif
+#define BTEST less_than_4(rp+ip)
+#define FORMULA \
+ rp = rp * rp - 6 * rp * ip + ip * ip + pre; \
+ zim = 4 * zre * zre * zre * zim - 4 * zre * ip * zim + pim; \
+ zre = rp; \
+ rp = zre * zre; \
+ ip = zim * zim;
+#define SMOOTH
+#define SCALC smand4_calc
+#define SPERI smand4_peri
+#define CALC mand4_calc
+#define PERI mand4_peri
+#define JULIA mand4_julia
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+#define VARIABLES register number_t t;
+#define BTEST less_than_4(rp+ip)
+#define FORMULA \
+ c_pow4(zre, zim, rp, ip); \
+ c_mul(zre, zim, rp, ip, t, zim); \
+ zre = t + pre; \
+ zim += pim; \
+ rp = zre * zre; \
+ ip = zim * zim;
+#define SMOOTH
+#define SCALC smand5_calc
+#define SPERI smand5_peri
+#define CALC mand5_calc
+#define PERI mand5_peri
+#define JULIA mand5_julia
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+
+#define VARIABLES register number_t t;
+#define BTEST less_than_4(rp+ip)
+#define FORMULA \
+ c_pow3(zre, zim, rp, ip); \
+ c_mul(rp, ip, rp, ip, t, zim); \
+ zre = t + pre; \
+ zim += pim; \
+ rp = zre * zre; \
+ ip = zim * zim;
+#define SMOOTH
+#define SCALC smand6_calc
+#define SPERI smand6_peri
+#define CALC mand6_calc
+#define PERI mand6_peri
+#define JULIA mand6_julia
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+
+#define VARIABLES register number_t t;
+#define BTEST less_than_4(rp+ip)
+#define FORMULA \
+ c_pow3(zre, zim, rp, ip); \
+ c_pow3(rp, ip, t, zim); \
+ zre = t + pre; \
+ zim += pim; \
+ rp = zre * zre; \
+ ip = zim * zim;
+#define SMOOTH
+#define SCALC smand9_calc
+#define SPERI smand9_peri
+#define CALC mand9_calc
+#define PERI mand9_peri
+#define JULIA mand9_julia
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+/* formulas from here to the next comment are not tested under plan9 compiler */
+
+#define VARIABLES
+#define BTEST less_than_4(rp+ip)
+#define FORMULA \
+ zim=zre*zim+zim/2+pim; \
+ zre=(rp-ip+zre)/2+pre; \
+ rp=zre*zre; \
+ ip=zim*zim;
+#define SMOOTH
+#define SCALC strice_calc
+#define SPERI strice_peri
+#define CALC trice_calc
+#define PERI trice_peri
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+#define VARIABLES register number_t zor,zoi;
+/* 2009-08-01 JB Langston
+ * On Mac OS X, for some reason Cat's Eye renders as an empty circle unless
+ * the bailout is slightly more than 4. This doesn't appear to happen on any
+ * other operating systems, and it's not processor specific. It's probably
+ * a compiler bug, but I haven't been able to figure out exactly what's
+ * happening. I can work around it by subtracting LDBL_MIN from the amount
+ * before performing the bailout test.
+ */
+// #define LDBL_MIN 0.00000001
+#define BTEST less_than_4(rp+ip-LDBL_MIN)
+#define FORMULA \
+ c_div(pre,pim,zre,zim,rp,ip); \
+ c_div(zre,zim,pre,pim,zor,zoi); \
+ zre=zor+rp; \
+ zim=zoi+ip; \
+ rp=zre*zre; \
+ ip=zim*zim;
+#define SMOOTH
+#define SCALC scatseye_calc
+#define SPERI scatseye_peri
+#define CALC catseye_calc
+#define PERI catseye_peri
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+#define VARIABLES
+#define BTEST less_than_4(rp+ip)
+#define FORMULA \
+ zim=(zim*zre)*(-2.0)+pim; \
+ zre=rp-ip+pre; \
+ ip=zim*zim; \
+ rp=zre*zre;
+#define SMOOTH
+#define SCALC smbar_calc
+#define SPERI smbar_peri
+#define CALC mbar_calc
+#define PERI mbar_peri
+#define JULIA mbar_julia
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+#define VARIABLES
+#define INIT \
+ rp=zre;zre=pre;pre=rp; \
+ ip=zim;zim=pim;pim=ip;
+#define BTEST less_than_4(rp+ip)
+#define FORMULA \
+ rp=ip-rp+zre; \
+ ip=zim-2*zre*zim; \
+ c_mul(rp,ip,pre,pim,zre,zim); \
+ rp=zre*zre; \
+ ip=zim*zim;
+#define SMOOTH
+#define SCALC smlambda_calc
+#define SPERI smlambda_peri
+#define CALC mlambda_calc
+#define PERI mlambda_peri
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+#define VARIABLES register number_t zre1,zim1,zre2,zim2;
+#define INIT zre1=zre;zim1=zim;
+#define BTEST less_than_4(rp+ip)
+#define FORMULA \
+ zre2=zre;zim2=zim; \
+ zim=(zim*zre)*2+pim+zim1; \
+ zre=rp-ip+pre+zre1; \
+ zre1=zre2; \
+ zim1=zim2; \
+ ip=zim*zim; \
+ rp=zre*zre;
+#define SMOOTH
+#define SCALC smanowar_calc
+#define CALC manowar_calc
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+#define VARIABLES register number_t zre1,zim1;
+#define INIT zre1=pre;zim1=pim;
+#define BTEST less_than_4(rp+ip)
+#define FORMULA \
+ zim=(zim*zre)*2+zim1; \
+ zre=rp-ip+zre1; \
+ zre1=zre1/2+zre; \
+ zim1=zim1/2+zim; \
+ ip=zim*zim; \
+ rp=zre*zre;
+#define SMOOTH
+#define SCALC sspider_calc
+#define CALC spider_calc
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+#define VARIABLES
+#define INIT \
+ if((zre==pre)&&(zim==pim)){pre=0.5;pim=0.8660254;} \
+ if(pim<0)pim=(-pim); \
+ if(((pim*zre-pre*zim)<0)||(zim<0)){zre=2*pre+2;zim=2*pim;}
+#define BTEST ((pim*zre+(1-pre)*zim)<pim)
+#define FORMULA \
+ zre=2*zre;zim=2*zim; \
+ if((pim*zre-pre*zim)>pim)zre=zre-1; \
+ if(zim>pim){zim=zim-pim;zre=zre-pre;}
+#define CALC sier_calc
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+#define VARIABLES
+#define INIT \
+ if((zre==pre)&&(zim==pim)){pre=0.5;pim=0.8660254;} \
+ if(pim<0)pim=(-pim); \
+ if(((pim*zre-pre*zim)<0)||(zim<0)){zre=2*pre+2;zim=2*pim;}
+#define BTEST ((pim*zre+(1-pre)*zim)<pim)
+#define FORMULA \
+ zre=1.6180339*zre;zim=1.6180339*zim; \
+ if((pim*zre-pre*zim)>pim*0.6180339)zre=zre-0.6180339; \
+ if(zim>pim*0.6180339){zim=zim-pim*0.6180339;zre=zre-pre*0.6180339;}
+#define CALC goldsier_calc
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+#define VARIABLES
+#define INIT
+#define BTEST (zre*zre+zim*zim<1)
+#define FORMULA \
+ zre=3*zre;zim=3*zim; \
+ if((zim-2)*(zim-2)+zre*zre<1)zim=zim-2; \
+ if((zim+2)*(zim+2)+zre*zre<1)zim=zim+2; \
+ if((zim-1)*(zim-1)+(zre-1.7320508)*(zre-1.7320508)<1){zim=zim-1;zre=zre-1.7320508;} \
+ if((zim+1)*(zim+1)+(zre-1.7320508)*(zre-1.7320508)<1){zim=zim+1;zre=zre-1.7320508;} \
+ if((zim-1)*(zim-1)+(zre+1.7320508)*(zre+1.7320508)<1){zim=zim-1;zre=zre+1.7320508;} \
+ if((zim+1)*(zim+1)+(zre+1.7320508)*(zre+1.7320508)<1){zim=zim+1;zre=zre+1.7320508;}
+#define CALC circle7_calc
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+#define VARIABLES
+#define INIT
+#define BTEST less_than_4((rp+ip)/4.0)
+#define FORMULA \
+ if (less_than_0 (zre)) { \
+ rp = zre + 1; \
+ } else { \
+ rp = zre - 1; \
+ } \
+ if (less_than_0 (zim)) { \
+ ip = zim + 1; \
+ } else { \
+ ip = zim - 1; \
+ } \
+ c_mul(rp, ip, pre, pim, zre, zim); \
+ rp = zre * zre; \
+ ip = zim * zim;
+#define SMOOTH
+#define CALC symbarn_calc
+#define JULIA symbarn_julia
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+#define VARIABLES
+#define INIT \
+ if((zre==pre)&&(zim==pim)){pre=1;pim=1;} \
+ if(pre<0)pre=(-pre);if(pim<0)pim=(-pim); \
+ if((zre<0)||(zre>pre)){zre=pre/2;zim=pim/2;} \
+ if((zim<0)||(zim>pim)){zre=pre/2;zim=pim/2;}
+#define BTEST \
+ ((zre<pre/3)||(zre>2*pre/3)|| \
+ (zim<pim/3)||(zim>2*pim/3))
+#define FORMULA \
+ zre=3*zre;zim=3*zim; \
+ if(zre>2*pre)zre=zre-2*pre;else if(zre>pre)zre=zre-pre; \
+ if(zim>2*pim)zim=zim-2*pim;else if(zim>pim)zim=zim-pim;
+#define CALC carpet_calc
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+
+#define VARIABLES
+#define BTEST \
+ ((((1.5*zre+0.8660254038*zim)>0.8660254038)|| \
+ ((0.8660254038*zim-1.5*zre)>0.8660254038)|| \
+ (zim<(-0.5)))&& \
+ (((1.5*zre+0.8660254038*zim)<-0.8660254038)|| \
+ ((0.8660254038*zim-1.5*zre)<-0.8660254038)|| \
+ (zim>0.5)))
+#define FORMULA \
+ zre=3*zre;zim=3*zim; \
+ if((0.2886751346*zim-0.5*zre)>0.0){ \
+ if((0.2886751346*zim+0.5*zre)>0.0){ \
+ zim=zim-2.0;\
+ }else{ \
+ if(zim>0){zre=zre+1.732050808;zim=zim-1.0;} \
+ else{zre=zre+1.732050808;zim=zim+1.0;} \
+ } \
+ }else{ \
+ if((0.2886751346*zim+0.5*zre)<0.0){ \
+ zim=zim+2.0;\
+ }else{ \
+ if(zim>0){zre=zre-1.732050808;zim=zim-1.0;} \
+ else{zre=zre-1.732050808;zim=zim+1.0;} \
+ } \
+ }
+#define CALC koch_calc
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+#define VARIABLES register number_t zre1, zim1;
+#define INIT pim=fabs(pim); zre=pre; zim=pim;
+#define BTEST \
+ (!((zre<0)&&(zim>0)&&(-1.0*zre+1.732050808*zim<1.732050808)))
+#define FORMULA \
+ zre1=1.5*zre-0.866+0.866*zim; \
+ zim1=-1.5+1.5*zim-0.866*zre; \
+ zre=zre1; zim=zim1;
+#define CALC hornflake_calc
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+/* plan9 compiler has problem with rest of formulas files. Hope that will be fixed later */
+
+#define VARIABLES
+#define BTEST less_than_4(rp+ip)
+#define FORMULA \
+ if (less_than_0 (zre)) { \
+ rp = zre + 1; \
+ } else { \
+ rp = zre - 1; \
+ } \
+ c_mul(rp, zim, pre, pim, zre, zim); \
+ rp = zre * zre; \
+ ip = zim * zim;
+#define SMOOTH
+#define SCALC sbarnsley1_calc
+#define CALC barnsley1_calc
+#define JULIA barnsley1_julia
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+
+#define VARIABLES
+#define BTEST less_than_4(rp+ip)
+#define FORMULA \
+ if (less_than_0 (zre*pim + zim*pre)) { \
+ rp = zre + 1; \
+ } else { \
+ rp = zre - 1; \
+ } \
+ c_mul(rp, zim, pre, pim, zre, zim); \
+ rp = zre * zre; \
+ ip = zim * zim;
+#define SMOOTH
+#define SCALC sbarnsley2_calc
+#define CALC barnsley2_calc
+#define JULIA barnsley2_julia
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+#define VARIABLES
+#define BTEST less_than_4(rp+ip)
+#define FORMULA \
+ if (!less_than_0 (-zre)) { \
+ zim = 2*zre*zim + pim*zre; \
+ zre = rp - ip - 1 + pre*zre; \
+ } else { \
+ zim = 2*zre*zim; \
+ zre = rp - ip - 1; \
+ } \
+ rp = zre * zre; \
+ ip = zim * zim;
+#define SMOOTH
+#define SCALC sbarnsley3_calc
+#define CALC barnsley3_calc
+#define JULIA barnsley3_julia
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+
+#define VARIABLES register number_t n,sqrr,sqri,zre1,zim1;
+#define INIT sqri=zim*zim,n=zre,zre=pre,pre=n,n=zim,zim=pim,pim=n,n=(number_t)1;
+#define BTEST greater_then_1Em6(n)
+#define FORMULA \
+ zre1 = zre; \
+ zim1 = zim; \
+ n = zim * zim; \
+ sqri = zre * zre; \
+ sqrr = sqri - n; \
+ sqri = n + sqri; \
+ n = 0.3333333333 / ((sqri * sqri)); \
+ zim = (0.66666666) * zim - (zre + zre) * zim * n + pim; \
+ zre = (0.66666666) * zre + (sqrr) * n + pre; \
+ zre1 -= zre; \
+ zim1 -= zim; \
+ n = zre1 * zre1 + zim1 * zim1;
+#define CALC newton_calc
+#include "docalc.c"
+
+
+#define VARIABLES register number_t n,sqrr,sqri,zre1,zim1;
+#define INIT sqri=zim*zim,n=zre,zre=pre,pre=n,n=zim,zim=pim,pim=n,n=(number_t)1;
+#define BTEST greater_then_1Em6(n)
+#define FORMULA \
+ zre1 = zre; \
+ zim1 = zim; \
+ sqrr = zre * zre; \
+ sqri = zim * zim; \
+ n = sqri + sqrr; \
+ n = 1 / ((n * n * n)); \
+ zim = (0.25) * zim * (3 + (sqri - 3 * sqrr) * n) + pim; \
+ zre = (0.25) * zre * (3 + (sqrr - 3 * sqri) * n) + pre; \
+ zre1 -= zre; \
+ zim1 -= zim; \
+ n = zre1 * zre1 + zim1 * zim1;
+#define CALC newton4_calc
+#include "docalc.c"
+
+
+#define VARIABLES register number_t zpr,zip;
+#define SAVEVARIABLES register number_t szpr,szip;
+#define SAVE szpr=zpr,szip=zip;
+#define RESTORE zpr=szpr,zip=szip;
+#define INIT zpr=zip=(number_t)0;
+#define BTEST less_than_4(rp+ip)
+#define FORMULA \
+ rp = rp - ip + pre + pim * zpr; \
+ ip = 2 * zre * zim + pim * zip; \
+ zpr = zre, zip = zim; \
+ zre = rp; \
+ zim = ip; \
+ rp = zre * zre, ip = zim * zim;
+#define SMOOTH
+#define SCALC sphoenix_calc
+#define SPERI sphoenix_peri
+#define CALC phoenix_calc
+#define PERI phoenix_peri
+#define RPIP
+#include "docalc.c"
+
+
+#define VARIABLES register number_t tr,ti,zpr,zpm,rp1,ip1;
+#define INIT zpr=zpm=0,tr=zre,zre=pre,pre=tr,tr=zim,zim=pim,pim=tr,tr=1;
+#define BTEST less_than_4(zpr*zpr+zpm*zpm)
+#define FORMULA \
+ rp1 = zre; \
+ ip1 = zim; \
+ c_pow3(zre, zim, tr, ti); \
+ c_add(tr, ti, zpr, zpm, zre, zim); \
+ zpr = rp1 + pre; \
+ zpm = ip1 + pim;
+#define CALC octo_calc
+#define SCALC socto_calc
+#define SMOOTH
+#define CUSTOMSAVEZMAG szmag=zpr*zpr+zpm*zpm
+#define PRESMOOTH zre=zpr*zpr+zpm*zpm
+#include "docalc.c"
+
+
+#define VARIABLES register number_t yre, yim, re1tmp, re2tmp, im1tmp;
+#define BTEST (rp+ip<9||(yre*yre+yim*yim)<4*(rp+ip))
+#define INIT yre=pre; yim=pim;
+#define FORMULA \
+ re1tmp=zre; \
+ re2tmp=yre; \
+ im1tmp=zim; \
+ zre=re1tmp+yre; \
+ zim=im1tmp+yim; \
+ yre=(re1tmp*re2tmp-im1tmp*yim ); \
+ yim=(re1tmp*yim +re2tmp*im1tmp); \
+ rp=zre*zre; \
+ ip=zim*zim;
+#define CALC beryl_calc
+#define JULIA beryl_julia
+#define PERI beryl_peri
+#define RANGE 2
+#define RPIP
+#include "docalc.c"
+
+
+
+#ifdef SFFE_USING
+ /* SFFE - malczak */
+ //#define VARIABLES sffe *p = globaluih->parser;
+#define INIT cmplxset(pZ,0,0); cmplxset(C,pre,pim); \
+ if (globaluih->pinit) Z=sffe_eval(globaluih->pinit); else cmplxset(Z,zre,zim);
+ //#define SAVE cmplxset(pZ,real(Z),imag(Z));
+ //#define PRETEST 0
+#define FORMULA \
+ Z = sffe_eval(globaluih->parser);\
+ cmplxset(pZ,zre,zim); \
+ zre = real( Z ); \
+ zim = imag( Z );
+#define BTEST less_than_4(zre*zre+zim*zim)
+ //less_than_4(rp+ip)
+#define CALC sffe_calc
+#define JULIA sffe_julia
+#define SCALC ssffe_calc
+ //#define SMOOTH
+#include "docalc.c"
+#endif
+
+
+static CONST symetrytype sym6[] = {
+ {0, 1.73205080758},
+ {0, -1.73205080758}
+};
+
+static CONST symetrytype sym8[] = {
+ {0, 1},
+ {0, -1}
+};
+
+static CONST symetrytype sym16[] = {
+ {0, 1},
+ {0, -1},
+ {0, 0.414214},
+ {0, -0.414214},
+ {0, 2.414214},
+ {0, -2.414214}
+};
+
+CONST struct formula formulas[] = {
+ { /* 0 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ mand_calc,
+ mand_peri,
+ smand_calc,
+ smand_peri,
+#endif
+ mand_julia,
+ {"Mandelbrot", "Julia"},
+ "mandel",
+ /*{0.5, -2.0, 1.25, -1.25}, */
+ {-0.75, 0.0, 2.5, 2.5},
+ 1, 1, 0.0, 0.0,
+ {
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+ { /* 1 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ mand3_calc,
+ mand3_peri,
+ smand3_calc,
+ smand3_peri,
+#endif
+ mand3_julia,
+ {"Mandelbrot^3", "Julia^3"},
+ "mandel3",
+ /*{1.25, -1.25, 1.25, -1.25}, */
+ {0.0, 0.0, 2.5, 2.5},
+ 1, 1, 0.0, 0.0,
+ {
+ {0, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {0, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {0, INT_MAX, 0, NULL},
+ {0, 0, 0, NULL},
+ {0, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {0, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {0, 0, 0, NULL},
+ {0, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {0, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+ { /* 2 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ mand4_calc,
+ mand4_peri,
+ smand4_calc,
+ smand4_peri,
+#endif
+ mand4_julia,
+ {"Mandelbrot^4", "Julia^4"},
+ "mandel4",
+ /*{1.25, -1.25, 1.25, -1.25}, */
+ {0.0, 0.0, 2.5, 2.5},
+ 1, 1, 0.0, 0.0,
+ {
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+ { /* 3 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ mand5_calc,
+ mand5_peri,
+ smand5_calc,
+ smand5_peri,
+#endif
+ mand5_julia,
+ {"Mandelbrot^5", "Julia^5"},
+ "mandel5",
+ /*{1.25, -1.25, 1.25, -1.25}, */
+ {0.0, 0.0, 2.5, 2.5},
+ 1, 1, 0.0, 0.0,
+ {
+ {0, 0, 2, sym8},
+ {INT_MAX, 0, 0, NULL},
+ {0, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {0, INT_MAX, 0, NULL},
+ {0, 0, 2, sym8},
+ {0, 0, 2, sym8},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {0, 0, 2, sym8},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {0, 0, 2, sym8},
+ {0, 0, 2, sym8},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+ { /* 4 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ mand6_calc,
+ mand6_peri,
+ smand6_calc,
+ smand6_peri,
+#endif
+ mand6_julia,
+ {"Mandelbrot^6", "Julia^6"},
+ "mandel6",
+ /*{1.25, -1.25, 1.25, -1.25}, */
+ {0.0, 0.0, 2.5, 2.5},
+ 1, 1, 0.0, 0.0,
+ {
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+ { /* 5 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ newton_calc,
+ NULL,
+ NULL,
+ NULL,
+#endif
+ NULL,
+ {"Newton", "Newton julia?"},
+ "newton",
+ /*{1.25, -1.25, 1.25, -1.25}, */
+ {0.0, 0.0, 2.5, 2.5},
+ 0, 1, 1.0199502202048319698, 0.0,
+ {
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ STARTZERO,
+ },
+ { /* formula added by Andreas Madritsch *//* 6 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ newton4_calc,
+ NULL,
+ NULL,
+ NULL,
+#endif
+ NULL,
+ {"Newton^4", "Newton^4 julia?"},
+ "newton4",
+ /*{1.25, -1.25, 1.25, -1.25}, */
+ {0.0, 0.0, 2.5, 2.5},
+ 0, 1, 1.0199502202048319698, 0.0,
+ {
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ STARTZERO,
+ },
+ { /* 7 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ barnsley1_calc,
+ NULL,
+ sbarnsley1_calc,
+ NULL,
+#endif
+ barnsley1_julia,
+ {"Barnsley1 Mandelbrot", "Barnsley1"},
+ "barnsley",
+ /*{1.25, -1.25, 1.25, -1.25}, */
+ {0.0, 0.0, 2.5, 2.5},
+ 0, 0, -0.6, 1.1,
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ STARTZERO | MANDEL_BTRACE,
+ },
+ { /* formula added by Andreas Madritsch *//* 8 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ barnsley2_calc,
+ NULL,
+ sbarnsley2_calc,
+ NULL,
+#endif
+ barnsley2_julia,
+ {"Barnsley2 Mandelbrot", "Barnsley2"},
+ "barnsley2",
+ /*{1.25, -1.25, 1.25, -1.25}, */
+ {0.0, 0.0, 2.5, 5.5},
+ 0, 0, -0.6, 1.1,
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ STARTZERO | MANDEL_BTRACE,
+ },
+ { /* formula added by Arpad Fekete *//* 9 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ barnsley3_calc,
+ NULL,
+ sbarnsley3_calc,
+ NULL,
+#endif
+ barnsley3_julia,
+ {"Barnsley3 Mandelbrot", "Barnsley3"},
+ "barnsley3",
+ /*{1.25, -1.25, 1.25, -1.25}, */
+ {0.0, 0.0, 2.5, 3.5},
+ 0, 0, 0.0, 0.4,
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ STARTZERO | MANDEL_BTRACE,
+ },
+ { /* 10 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ octo_calc,
+ /*octo_peri, */ NULL,
+ socto_calc,
+ /*socto_peri, */ NULL,
+#endif
+ NULL,
+ {"Octal", "Octal"},
+ "octal",
+ /*{1.25, -1.25, 1.25, -1.25}, */
+ {0.0, 0.0, 2.5, 2.5},
+ 0, 1, 0.0, 0.0,
+ {
+ {0, 0, 6, sym16},
+ {INT_MAX, 0, 0, NULL},
+ {0, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {0, INT_MAX, 0, NULL},
+ {0, 0, 0, NULL},
+ {0, 0, 6, sym16},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {0, 0, 6, sym16},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {0, 0, 6, sym16},
+ {0, 0, 6, sym16},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE | STARTZERO,
+ },
+ { /* 11 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ phoenix_calc,
+ phoenix_peri,
+ sphoenix_calc,
+ sphoenix_peri,
+#endif
+ NULL,
+ {"MandPhoenix", "Phoenix"},
+ "phoenix",
+ /*{1.25, -1.25, 1.25, -1.25}, */
+ {0.0, 0.0, 2.5, 2.5},
+ 1, 0, 0.56667000000000001, -0.5,
+ {
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+ { /* 12 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ magnet_calc,
+ magnet_peri,
+ smagnet_calc,
+ smagnet_peri,
+#endif
+ magnet_julia,
+ {"Magnet", "Magnet"},
+ "magnet",
+ /*{3, 0, 2.2, -2.2}, */
+ {1.5, 0.0, 3.0, 4.4},
+ 1, 1, 0.0, 0.0,
+ {
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ STARTZERO,
+ },
+ { /* formula added by Andreas Madritsch *//* 13 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ magnet2_calc,
+ magnet2_peri,
+ smagnet2_calc,
+ smagnet2_peri,
+#endif
+ magnet2_julia,
+ {"Magnet2", "Magnet2"},
+ "magnet2",
+ /*{3, 0, 2.2, -2.2}, */
+ {1.0, 0.0, 3.0, 3.2},
+ 1, 1, 0.0, 0.0,
+ {
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ STARTZERO,
+ },
+ { /* formula added by Arpad Fekete *//* 14 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ trice_calc,
+ trice_peri,
+ strice_calc,
+ strice_peri,
+#endif
+ NULL,
+ {"Triceratops", "Triceratops Julia"},
+ "trice",
+ {0.0, 0.0, 2.5, 4.5},
+ 1, 1, 0.0, 0.0,
+ {
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+ { /* formula added by Arpad Fekete *//* 15 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ catseye_calc,
+ catseye_peri,
+ scatseye_calc,
+ scatseye_peri,
+#endif
+ NULL,
+ {"Catseye", "Catseye Julia"},
+ "catseye",
+ {0.0, 0.0, 2.5, 4.5},
+ 1, 1, 0.0, 0.0,
+ {
+ {0, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {0, 0, 0, NULL},
+ {0, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {0, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {0, 0, 0, NULL},
+ {0, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {0, 0, 0, NULL},
+ {0, 0, 0, NULL},
+ {0, 0, 0, NULL},
+ {0, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+ { /*formula added by Arpad Fekete *//* 16 */
+ /*in Gnofract4d from mathworld.wolfram.com */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ mbar_calc,
+ mbar_peri,
+ smbar_calc,
+ smbar_peri,
+#endif
+ mbar_julia,
+ {"Mandelbar", "Mandelbar Julia"},
+ "mbar",
+ {0.0, 0.0, 2.5, 3.5},
+ 1, 1, 0.0, 0.0,
+ {
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, 0, 2, sym6},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+ { /* formula added by Arpad Fekete (from fractint) *//* 17 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ mlambda_calc,
+ mlambda_peri,
+ smlambda_calc,
+ smlambda_peri,
+#endif
+ NULL,
+ {"Lambda Mandelbrot", "Lambda"},
+ "mlambda",
+ {0.5, 0.0, 2.5, 5.5},
+ 0, 0, 0.5, 0.0,
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+ { /* formula added by Arpad Fekete (from fractint) *//* 18 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ manowar_calc,
+ NULL,
+ smanowar_calc,
+ NULL,
+#endif
+ NULL,
+ {"Manowar", "Manowar Julia"},
+ "manowar",
+ {0.0, 0.0, 2.5, 2.5},
+ 1, 1, 0.0, 0.0,
+ {
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+ { /* formula added by Arpad Fekete (from fractint) *//* 19 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ spider_calc,
+ NULL,
+ sspider_calc,
+ NULL,
+#endif
+ NULL,
+ {"Spider", "Spider Julia"},
+ "spider",
+ {0.0, 0.0, 2.5, 4.5},
+ 1, 1, 0.0, 0.0,
+ {
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, 0, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+ { /* formula added by Arpad Fekete, method from fractint *//* 20 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ sier_calc,
+ NULL,
+ NULL,
+ NULL,
+#endif
+ NULL,
+ {"Sierpinski", "Sierpinski"},
+ "sier",
+ {0.5, 0.43, 1.5, 1.0},
+ 0, 0, 0.5, 0.8660254,
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+ { /* formula added by Arpad Fekete, method from fractint *//* 21 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ carpet_calc,
+ NULL,
+ NULL,
+ NULL,
+#endif
+ NULL,
+ {"S.Carpet", "S.Carpet"},
+ "carpet",
+ {0.5, 0.5, 1.5, 1.5},
+ 0, 0, 1, 1,
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+ { /* formula added by Arpad Fekete, method from fractint *//* 22 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ koch_calc,
+ NULL,
+ NULL,
+ NULL,
+#endif
+ NULL,
+ {"Koch Snowflake", "Koch Snowflake"},
+ "koch",
+ {0.0, 0.0, 2.5, 2.5},
+ 0, 1, 0, 0,
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+ { /* formula added by Z. Kovacs *//* 23 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ hornflake_calc,
+ NULL,
+ NULL,
+ NULL,
+#endif
+ NULL,
+ {"Spidron hornflake", "Spidron hornflake"},
+ "hornflake",
+ {-0.75, 0, 3.8756, 3.8756},
+ 0, 1, 0, 0,
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+ { /* formula added by Z. Kovacs, originally mand6 but it was mand9 by accident *//* 24 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ mand9_calc,
+ mand9_peri,
+ smand9_calc,
+ smand9_peri,
+#endif
+ mand9_julia,
+ {"Mandelbrot^9", "Julia^9"},
+ "mandel9",
+ /*{1.25, -1.25, 1.25, -1.25}, */
+ {0.0, 0.0, 2.5, 2.5},
+ 1, 1, 0.0, 0.0,
+ {
+ {0, 0, 6, sym16},
+ {INT_MAX, 0, 0, NULL},
+ {0, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {0, INT_MAX, 0, NULL},
+ {0, 0, 0, NULL},
+ {0, 0, 6, sym16},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {0, 0, 6, sym16},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {0, 0, 6, sym16},
+ {0, 0, 6, sym16},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+
+ { /* formula added by S. Bizien *//* 25 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ beryl_calc,
+ beryl_peri,
+ NULL,
+ NULL,
+#endif
+ NULL,
+ {"Beryl", "Beryl"},
+ "beryl",
+ {-0.6, 0, 2, 2},
+ 0, 0, 1.0, 0.0,
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+ { /* formula added by Arpad Fekete *//* 26 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ goldsier_calc,
+ NULL,
+ NULL,
+ NULL,
+#endif
+ NULL,
+ {"Golden Sierpinski", "Golden Sierpinski"},
+ "goldsier",
+ {0.5, 0.43, 1.5, 1.0},
+ 0, 0, 0.5, 0.8660254,
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+ { /* formula added by Arpad Fekete *//* 27 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ circle7_calc,
+ NULL,
+ NULL,
+ NULL,
+#endif
+ NULL,
+ {"Circle 7", "Circle 7"},
+ "circle7",
+ {0.0, 0.0, 2.5, 2.5},
+ 0, 0, 0.0, 0.0,
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ },
+ { /* formula added by Arpad Fekete *//* 28 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ symbarn_calc,
+ NULL,
+ NULL,
+ NULL,
+#endif
+ symbarn_julia,
+ {"Sym. Barnsley M.", "Sym. Barnsley"},
+ "symbarn",
+ {0.0, 0.0, 8.0, 1.0},
+ 0, 0, 1.3, 1.3,
+ /* Arpad hasn't created the symmetry properties, */
+ /* because he doesn't considered it to be important */
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE,
+ }
+
+#ifdef SFFE_USING
+ , { /* formula added by M. Malczak - SFFE *//* 29 */
+ FORMULAMAGIC,
+#ifndef SLOWFUNCPTR
+ sffe_calc,
+ NULL,
+ NULL,
+ NULL,
+#endif
+ sffe_julia,
+ {"User defined", "User defined"},
+ "user",
+ /*{0.5, -2.0, 1.25, -1.25}, */
+ /*{-0.75, 0.0, 1, 1},*/
+ /* 2009-08-01 JB Langston
+ * Changed default zoom level to match Mandelbrot
+ */
+ {-0.75, 0.0, 2.5, 2.5},
+ 0, 1, 0.0, 0.0,
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ {
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ {INT_MAX, INT_MAX, 0, NULL},
+ },
+ MANDEL_BTRACE | SFFE_FRACTAL,
+ }
+#endif
+
+};
+
+#ifdef SLOWFUNCPTR
+unsigned int
+calculateswitch(register number_t x1, register number_t y1,
+ register number_t x2, register number_t y2,
+ int periodicity)
+{
+ if (periodicity && cfractalc.periodicity)
+ if (cfractalc.coloringmode == 9)
+ switch (cfractalc.currentformula - formulas) { /* periodicity checking and smoothmode SPERI */
+ case 0:
+ return (smand_peri(x1, y1, x2, y2));
+ break;
+ case 1:
+ return (smand3_peri(x1, y1, x2, y2));
+ break;
+ case 2:
+ return (smand4_peri(x1, y1, x2, y2));
+ break;
+ case 3:
+ return (smand5_peri(x1, y1, x2, y2));
+ break;
+ case 4:
+ return (smand6_peri(x1, y1, x2, y2));
+ break;
+ case 5:
+ return (newton_calc(x1, y1, x2, y2));
+ break;
+ case 6:
+ return (newton4_calc(x1, y1, x2, y2));
+ break;
+ case 7:
+ return (sbarnsley1_calc(x1, y1, x2, y2));
+ break;
+ case 8:
+ return (sbarnsley2_calc(x1, y1, x2, y2));
+ break;
+ case 9:
+ return (sbarnsley3_calc(x1, y1, x2, y2));
+ break;
+ case 10:
+ return (octo_calc(x1, y1, x2, y2));
+ break;
+ case 11:
+ return (sphoenix_peri(x1, y1, x2, y2));
+ break;
+ case 12:
+ return (smagnet_peri(x1, y1, x2, y2));
+ break;
+ case 13:
+ return (smagnet2_peri(x1, y1, x2, y2));
+ break;
+ case 14:
+ return (strice_peri(x1, y1, x2, y2));
+ break;
+ case 15:
+ return (scatseye_peri(x1, y1, x2, y2));
+ break;
+ case 16:
+ return (smbar_peri(x1, y1, x2, y2));
+ break;
+ case 17:
+ return (smlambda_peri(x1, y1, x2, y2));
+ break;
+ case 18:
+ return (smanowar_calc(x1, y1, x2, y2));
+ break;
+ case 19:
+ return (sspider_calc(x1, y1, x2, y2));
+ break;
+ case 20:
+ return (sier_calc(x1, y1, x2, y2));
+ break;
+ case 21:
+ return (carpet_calc(x1, y1, x2, y2));
+ break;
+ case 22:
+ return (koch_calc(x1, y1, x2, y2));
+ break;
+ case 23:
+ return (hornflake_calc(x1, y1, x2, y2));
+ break;
+ case 24:
+ return (smand9_peri(x1, y1, x2, y2));
+ break;
+ case 25:
+ return (beryl_calc(x1, y1, x2, y2));
+ break;
+ case 26:
+ return (goldsier_calc(x1, y1, x2, y2));
+ break;
+ case 27:
+ return (circle7_calc(x1, y1, x2, y2));
+ break;
+ case 28:
+ return (symbarn_calc(x1, y1, x2, y2));
+ break;
+
+#ifdef SFFE_USING
+ case 29:
+ return (sffe_calc(x1, y1, x2, y2));
+ break;
+#endif
+ } else
+ switch (cfractalc.currentformula - formulas) { /* periodicity checking and no smoothmode PERI */
+ case 0:
+ return (mand_peri(x1, y1, x2, y2));
+ break;
+ case 1:
+ return (mand3_peri(x1, y1, x2, y2));
+ break;
+ case 2:
+ return (mand4_peri(x1, y1, x2, y2));
+ break;
+ case 3:
+ return (mand5_peri(x1, y1, x2, y2));
+ break;
+ case 4:
+ return (mand6_peri(x1, y1, x2, y2));
+ break;
+ case 5:
+ return (newton_calc(x1, y1, x2, y2));
+ break;
+ case 6:
+ return (newton4_calc(x1, y1, x2, y2));
+ break;
+ case 7:
+ return (barnsley1_calc(x1, y1, x2, y2));
+ break;
+ case 8:
+ return (barnsley2_calc(x1, y1, x2, y2));
+ break;
+ case 9:
+ return (barnsley3_calc(x1, y1, x2, y2));
+ break;
+ case 10:
+ return (octo_calc(x1, y1, x2, y2));
+ break;
+ case 11:
+ return (phoenix_peri(x1, y1, x2, y2));
+ break;
+ case 12:
+ return (magnet_peri(x1, y1, x2, y2));
+ break;
+ case 13:
+ return (magnet2_peri(x1, y1, x2, y2));
+ break;
+ case 14:
+ return (trice_peri(x1, y1, x2, y2));
+ break;
+ case 15:
+ return (catseye_peri(x1, y1, x2, y2));
+ break;
+ case 16:
+ return (mbar_peri(x1, y1, x2, y2));
+ break;
+ case 17:
+ return (mlambda_peri(x1, y1, x2, y2));
+ break;
+ case 18:
+ return (manowar_calc(x1, y1, x2, y2));
+ break;
+ case 19:
+ return (spider_calc(x1, y1, x2, y2));
+ break;
+ case 20:
+ return (sier_calc(x1, y1, x2, y2));
+ break;
+ case 21:
+ return (carpet_calc(x1, y1, x2, y2));
+ break;
+ case 22:
+ return (koch_calc(x1, y1, x2, y2));
+ break;
+ case 23:
+ return (hornflake_calc(x1, y1, x2, y2));
+ break;
+ case 24:
+ return (mand9_peri(x1, y1, x2, y2));
+ break;
+ case 25:
+ return (beryl_peri(x1, y1, x2, y2));
+ break;
+ case 26:
+ return (goldsier_calc(x1, y1, x2, y2));
+ break;
+ case 27:
+ return (circle7_calc(x1, y1, x2, y2));
+ break;
+ case 28:
+ return (symbarn_calc(x1, y1, x2, y2));
+ break;
+
+#ifdef SFFE_USING
+ case 29:
+ return (sffe_calc(x1, y1, x2, y2));
+ break;
+#endif
+ } else if (cfractalc.coloringmode == 9)
+ switch (cfractalc.currentformula - formulas) { /* no periodicity checking and smoothmode SCALC */
+ case 0:
+ return (smand_calc(x1, y1, x2, y2));
+ break;
+ case 1:
+ return (smand3_calc(x1, y1, x2, y2));
+ break;
+ case 2:
+ return (smand4_calc(x1, y1, x2, y2));
+ break;
+ case 3:
+ return (smand5_calc(x1, y1, x2, y2));
+ break;
+ case 4:
+ return (smand6_calc(x1, y1, x2, y2));
+ break;
+ case 5:
+ return (newton_calc(x1, y1, x2, y2));
+ break;
+ case 6:
+ return (newton4_calc(x1, y1, x2, y2));
+ break;
+ case 7:
+ return (sbarnsley1_calc(x1, y1, x2, y2));
+ break;
+ case 8:
+ return (sbarnsley2_calc(x1, y1, x2, y2));
+ break;
+ case 9:
+ return (sbarnsley3_calc(x1, y1, x2, y2));
+ break;
+ case 10:
+ return (socto_calc(x1, y1, x2, y2));
+ break;
+ case 11:
+ return (sphoenix_calc(x1, y1, x2, y2));
+ break;
+ case 12:
+ return (smagnet_calc(x1, y1, x2, y2));
+ break;
+ case 13:
+ return (smagnet2_calc(x1, y1, x2, y2));
+ break;
+ case 14:
+ return (strice_calc(x1, y1, x2, y2));
+ break;
+ case 15:
+ return (scatseye_calc(x1, y1, x2, y2));
+ break;
+ case 16:
+ return (smbar_calc(x1, y1, x2, y2));
+ break;
+ case 17:
+ return (smlambda_calc(x1, y1, x2, y2));
+ break;
+ case 18:
+ return (smanowar_calc(x1, y1, x2, y2));
+ break;
+ case 19:
+ return (sspider_calc(x1, y1, x2, y2));
+ break;
+ case 20:
+ return (sier_calc(x1, y1, x2, y2));
+ break;
+ case 21:
+ return (carpet_calc(x1, y1, x2, y2));
+ break;
+ case 22:
+ return (koch_calc(x1, y1, x2, y2));
+ break;
+ case 23:
+ return (hornflake_calc(x1, y1, x2, y2));
+ break;
+ case 24:
+ return (smand6_calc(x1, y1, x2, y2));
+ break;
+ case 25:
+ return (beryl_calc(x1, y1, x2, y2));
+ break;
+ case 26:
+ return (goldsier_calc(x1, y1, x2, y2));
+ break;
+ case 27:
+ return (circle7_calc(x1, y1, x2, y2));
+ break;
+ case 28:
+ return (symbarn_calc(x1, y1, x2, y2));
+ break;
+
+#ifdef SFFE_USING
+ case 29:
+ return (sffe_calc(x1, y1, x2, y2));
+ break;
+#endif
+ } else
+ switch (cfractalc.currentformula - formulas) { /* no periodicity checking and no smoothmode CALC */
+ case 0:
+ return (mand_calc(x1, y1, x2, y2));
+ break;
+ case 1:
+ return (mand3_calc(x1, y1, x2, y2));
+ break;
+ case 2:
+ return (mand4_calc(x1, y1, x2, y2));
+ break;
+ case 3:
+ return (mand5_calc(x1, y1, x2, y2));
+ break;
+ case 4:
+ return (mand6_calc(x1, y1, x2, y2));
+ break;
+ case 5:
+ return (newton_calc(x1, y1, x2, y2));
+ break;
+ case 6:
+ return (newton4_calc(x1, y1, x2, y2));
+ break;
+ case 7:
+ return (barnsley1_calc(x1, y1, x2, y2));
+ break;
+ case 8:
+ return (barnsley2_calc(x1, y1, x2, y2));
+ break;
+ case 9:
+ return (barnsley3_calc(x1, y1, x2, y2));
+ break;
+ case 10:
+ return (octo_calc(x1, y1, x2, y2));
+ break;
+ case 11:
+ return (phoenix_calc(x1, y1, x2, y2));
+ break;
+ case 12:
+ return (magnet_calc(x1, y1, x2, y2));
+ break;
+ case 13:
+ return (magnet2_calc(x1, y1, x2, y2));
+ break;
+ case 14:
+ return (trice_calc(x1, y1, x2, y2));
+ break;
+ case 15:
+ return (catseye_calc(x1, y1, x2, y2));
+ break;
+ case 16:
+ return (mbar_calc(x1, y1, x2, y2));
+ break;
+ case 17:
+ return (mlambda_calc(x1, y1, x2, y2));
+ break;
+ case 18:
+ return (manowar_calc(x1, y1, x2, y2));
+ break;
+ case 19:
+ return (spider_calc(x1, y1, x2, y2));
+ break;
+ case 20:
+ return (sier_calc(x1, y1, x2, y2));
+ break;
+ case 21:
+ return (carpet_calc(x1, y1, x2, y2));
+ break;
+ case 22:
+ return (koch_calc(x1, y1, x2, y2));
+ break;
+ case 23:
+ return (hornflake_calc(x1, y1, x2, y2));
+ break;
+ case 24:
+ return (mand9_calc(x1, y1, x2, y2));
+ break;
+ case 25:
+ return (beryl_peri(x1, y1, x2, y2));
+ break;
+ case 26:
+ return (goldsier_calc(x1, y1, x2, y2));
+ break;
+ case 27:
+ return (circle7_calc(x1, y1, x2, y2));
+ break;
+ case 28:
+ return (symbarn_calc(x1, y1, x2, y2));
+ break;
+
+#ifdef SFFE_USING
+ case 29:
+ return (sffe_calc(x1, y1, x2, y2));
+ break;
+#endif
+ }
+ return 0;
+}
+#endif
+
+CONST struct formula *currentformula;
+CONST int nformulas = sizeof(formulas) / sizeof(struct formula);
+CONST int nmformulas = 16; // Is this correct here? -- Zoltan, 2009-07-30
diff --git a/src/engine/fractal.c b/src/engine/fractal.c
new file mode 100644
index 0000000..87da2c1
--- /dev/null
+++ b/src/engine/fractal.c
@@ -0,0 +1,471 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+/*#define STATISTICS */
+#include <aconfig.h>
+#include <string.h>
+#include <config.h>
+#include <fconfig.h>
+#ifdef _plan9_
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#else
+#include <stdio.h>
+#ifndef _MAC
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#endif
+#ifndef _plan9_
+#include <limits.h>
+#include <assert.h>
+#include <math.h>
+#endif
+#endif
+#ifdef __EMX__
+#include <float.h>
+#include <sys/cdefs.h>
+#endif
+#include <filter.h>
+#include <complex.h>
+#include <plane.h>
+#include "../include/timers.h"
+#ifdef __GNUC__
+#ifdef __i386__
+#ifndef PC_64
+#include <i386/ctrl87.h>
+#endif
+#endif
+#endif
+#ifdef __alpha__
+#ifdef __linux__
+#include <asm/fpu.h>
+#endif
+#endif
+#ifndef M_PI
+#define M_PI 3.1415
+#endif
+#include <xerror.h>
+
+struct symetryinfo2 cursymetry;
+struct palette cpalette;
+struct image cimage;
+struct fractal_context cfractalc;
+struct formula cformula;
+
+static symetry2 sym_lines[100];
+
+
+static void precalculate_rotation(fractal_context * c)
+{
+ c->sin = sin((c->angle) * M_PI / 180);
+ c->cos = cos((c->angle) * M_PI / 180);
+}
+
+static void recalc_view(fractal_context * c)
+{
+ number_t
+ xs = c->s.rr, ys = c->s.ri * c->windowwidth / c->windowheight,
+ xc = c->s.cr, yc = c->s.ci, size;
+ precalculate_rotation(c);
+ rotate(*c, xc, yc);
+ /*assert(c->s.rr >= 0);
+ assert(c->s.ri >= 0); */
+
+ xs = myabs(xs); /*do not crash in owerflowing cases */
+ ys = myabs(ys);
+ if (xs > ys)
+ size = xs;
+ else
+ size = ys;
+ c->rs.nc = xc - size / 2;
+ c->rs.mc = xc + size / 2;
+ c->rs.ni = yc - size * c->windowheight / c->windowwidth / 2;
+ c->rs.mi = yc + size * c->windowheight / c->windowwidth / 2;
+ if (c->rs.nc > c->rs.mc)
+ xc = c->rs.nc, c->rs.nc = c->rs.mc, c->rs.mc = xc;
+ if (c->rs.ni > c->rs.mi)
+ xc = c->rs.ni, c->rs.ni = c->rs.mi, c->rs.mi = xc;
+}
+
+static void set_view(fractal_context * c, CONST vinfo * s)
+{
+ c->s = *s;
+ recalc_view(c);
+}
+
+/*FIXME most of this code is obsolette */
+static void /*INLINE */ combine_methods(void)
+{
+#ifdef __UNDEFINED__
+ int i, j;
+#endif
+ int angle = (int) cfractalc.angle;
+ CONST struct symetryinfo *s1 =
+ cfractalc.currentformula->out + cfractalc.coloringmode, *s2 =
+ cfractalc.currentformula->in + cfractalc.incoloringmode;
+ if (angle < 0) {
+ angle = 360 - ((-angle) % 360);
+ } else
+ angle %= 360;
+ if (cfractalc.mandelbrot != cfractalc.currentformula->mandelbrot ||
+ cfractalc.bre || cfractalc.bim) {
+ cursymetry.xsym = (number_t) INT_MAX;
+ cursymetry.ysym = (number_t) INT_MAX;
+ cursymetry.nsymetries = 0;
+ return;
+ }
+#ifdef __UNDEFINED__
+ cursymetry.xmul = cimage.width / (cfractalc.rs.mc - cfractalc.rs.nc);
+ cursymetry.ymul = cimage.height / (cfractalc.rs.mi - cfractalc.rs.ni);
+ cursymetry.xdist =
+ (cfractalc.rs.mc - cfractalc.rs.nc) / cimage.width / 6;
+ cursymetry.ydist =
+ (cfractalc.rs.mi - cfractalc.rs.ni) / cimage.height / 6;
+#endif
+ if (s1->xsym == s2->xsym)
+ cursymetry.xsym = s1->xsym;
+ else
+ cursymetry.xsym = (number_t) INT_MAX;
+ if (s1->ysym == s2->ysym)
+ cursymetry.ysym = s1->ysym;
+ else
+ cursymetry.ysym = (number_t) INT_MAX;
+ switch (cfractalc.plane) {
+ case P_PARABOL:
+ cursymetry.xsym = (number_t) INT_MAX;
+ break;
+ case P_LAMBDA:
+ if (cursymetry.xsym == 0 && cursymetry.ysym == 0)
+ cursymetry.xsym = (number_t) 1;
+ else
+ cursymetry.xsym = (number_t) INT_MAX;
+ break;
+ case P_INVLAMBDA:
+ cursymetry.xsym = (number_t) INT_MAX;
+ break;
+ case P_TRANLAMBDA:
+ if (cursymetry.xsym != 0 || cursymetry.ysym != 0)
+ cursymetry.xsym = (number_t) INT_MAX;
+ break;
+ case P_MEREBERG:
+ cursymetry.xsym = (number_t) INT_MAX;
+ break;
+ }
+ cursymetry.symetry = sym_lines;
+ cursymetry.nsymetries = 0;
+ if ((number_t) angle == cfractalc.angle) {
+ switch (angle) {
+ case 0:
+ break;
+ case 180:
+ cursymetry.xsym = -cursymetry.xsym;
+ cursymetry.ysym = -cursymetry.ysym;
+ break;
+ case 90:
+ {
+ number_t tmp = cursymetry.xsym;
+ cursymetry.xsym = -cursymetry.ysym;
+ cursymetry.ysym = tmp;
+ }
+ break;
+ case 210:
+ {
+ number_t tmp = cursymetry.xsym;
+ cursymetry.xsym = cursymetry.ysym;
+ cursymetry.ysym = -tmp;
+ }
+ break;
+ default:
+ cursymetry.xsym = (number_t) INT_MAX;
+ cursymetry.ysym = (number_t) INT_MAX;
+ }
+ } else {
+ cursymetry.xsym = (number_t) INT_MAX;
+ cursymetry.ysym = (number_t) INT_MAX;
+ }
+ if (cursymetry.xsym == -(number_t) INT_MAX)
+ cursymetry.xsym = (number_t) INT_MAX;
+ if (cursymetry.ysym == -(number_t) INT_MAX)
+ cursymetry.ysym = (number_t) INT_MAX;
+}
+
+void update_view(fractal_context * context)
+{
+ set_view(context, &context->s);
+}
+
+void set_fractalc(fractal_context * context, struct image *img)
+{
+ update_view(context);
+ precalculate_rotation(context);
+ cfractalc = *context; /*its better to copy often accesed data into fixed memory locations */
+ cpalette = *img->palette;
+ cimage = *img;
+ cformula = *context->currentformula;
+
+ if (cfractalc.maxiter < 1)
+ cfractalc.maxiter = 1;
+
+ if (cfractalc.bailout < 0)
+ cfractalc.bailout = 0;
+
+ if (cfractalc.periodicity) {
+ if (!cformula.hasperiodicity || cfractalc.incoloringmode
+ || !cfractalc.mandelbrot)
+ cfractalc.periodicity = 0;
+ else if (!cfractalc.plane)
+ cfractalc.periodicity_limit =
+ (context->rs.mc - context->rs.nc) / (double) img->width;
+ else {
+ int x, y;
+ number_t xstep =
+ ((context->rs.mc - context->rs.nc) / (double) img->width);
+ number_t ystep =
+ ((context->rs.mc - context->rs.nc) / (double) img->height);
+ number_t xstep2 = ((context->rs.mc - context->rs.nc) / 5);
+ number_t ystep2 = ((context->rs.mc - context->rs.nc) / 5);
+
+ for (x = 0; x < 5; x++)
+ for (y = 0; y < 5; y++) {
+ number_t x1 = context->rs.mc + xstep2 * x;
+ number_t y1 = context->rs.mi + ystep2 * y;
+ number_t x2 = context->rs.mc + xstep2 * x + xstep;
+ number_t y2 = context->rs.mi + ystep2 * y + ystep;
+
+ recalculate(cfractalc.plane, &x1, &y1);
+ recalculate(cfractalc.plane, &x2, &y2);
+
+ x1 = myabs(x2 - x1);
+ y1 = myabs(y2 - y1);
+
+ if (x == y && x == 0)
+ cfractalc.periodicity_limit = x1;
+ if (cfractalc.periodicity > x1)
+ cfractalc.periodicity_limit = x1;
+ if (cfractalc.periodicity > y1)
+ cfractalc.periodicity_limit = y1;
+ }
+ }
+ }
+
+ combine_methods();
+
+ if (cursymetry.xsym == (number_t) INT_MAX)
+ cursymetry.xsym = cfractalc.rs.mc + INT_MAX;
+
+ if (cursymetry.ysym == (number_t) INT_MAX)
+ cursymetry.ysym = cfractalc.rs.mi + INT_MAX;
+
+#ifndef SLOWFUNCPTR
+ if (cfractalc.coloringmode == 9 && cformula.smooth_calculate != NULL
+ && (cpalette.
+ type & (TRUECOLOR | TRUECOLOR16 | TRUECOLOR24 | GRAYSCALE |
+ LARGEITER))) {
+ cfractalc.calculate[0] = cformula.smooth_calculate;
+ if (cformula.smooth_calculate_periodicity && cfractalc.periodicity)
+ cfractalc.calculate[1] = cformula.smooth_calculate_periodicity;
+ else
+ cfractalc.calculate[1] = cformula.smooth_calculate;
+ } else {
+ cfractalc.calculate[0] = cformula.calculate;
+ if (cformula.calculate_periodicity && cfractalc.periodicity)
+ cfractalc.calculate[1] = cformula.calculate_periodicity;
+ else
+ cfractalc.calculate[1] = cformula.calculate;
+ }
+#endif
+
+}
+
+
+
+
+void set_formula(fractal_context * c, int num)
+{
+ assert(num < nformulas);
+ assert(num >= 0);
+ if (num >= nformulas)
+ num = 0;
+ if (c->currentformula != formulas + num) {
+ c->currentformula = formulas + num;
+ c->version++;
+ }
+ if (c->mandelbrot != c->currentformula->mandelbrot) {
+ c->mandelbrot = c->currentformula->mandelbrot;
+ c->version++;
+ }
+ if (c->currentformula->pre != c->pre) {
+ c->pre = c->currentformula->pre;
+ if (!c->mandelbrot)
+ c->version++;
+ }
+ if (c->currentformula->pim != c->pim) {
+ c->pim = c->currentformula->pim;
+ if (!c->mandelbrot)
+ c->version++;
+ }
+ if (c->angle) {
+ c->angle = 0;
+ c->version++;
+ }
+ if (c->s.cr != c->currentformula->v.cr ||
+ c->s.ci != c->currentformula->v.ci ||
+ c->s.rr != c->currentformula->v.rr ||
+ c->s.ri != c->currentformula->v.ri) {
+ c->s = c->currentformula->v;
+ c->version++;
+ }
+ if (c->bre && c->bim) {
+ c->bre = c->bim = 0;
+ if (c->mandelbrot)
+ c->version++;
+ }
+}
+
+
+void fractalc_resize_to(fractal_context * c, float wi, float he)
+{
+ c->windowwidth = wi;
+ c->windowheight = he;
+ recalc_view(c);
+ return;
+}
+
+
+
+fractal_context *make_fractalc(CONST int formula, float wi, float he)
+{
+ fractal_context *new_ctxt;
+
+#ifndef __BEOS__
+#ifdef __GNUC__
+#ifdef __i386__
+#ifndef NOASSEMBLY
+ _control87(PC_64 | MCW_EM | MCW_RC, MCW_PC | MCW_EM | MCW_RC);
+#endif
+#endif
+#endif
+#endif
+#ifdef __alpha__
+#ifdef __linux__
+ extern void ieee_set_fp_control(unsigned long);
+ /* ieee_set_fp_control(IEEE_TRAP_ENABLE_INV); */
+ ieee_set_fp_control(0UL); /* ignore everything possible */
+#endif
+#endif
+#ifdef _plan9_
+ {
+ unsigned long fcr = 0; /*getfcr(); */
+ fcr |= FPRNR | FPPEXT;
+ /*fcr &= ~(FPINEX | FPOVFL | FPUNFL | FPZDIV); */
+ setfcr(fcr);
+ }
+#endif
+ new_ctxt = (fractal_context *) calloc(1, sizeof(fractal_context));
+ if (new_ctxt == NULL)
+ return 0;
+ new_ctxt->windowwidth = wi;
+ new_ctxt->periodicity = 1;
+ new_ctxt->windowheight = he;
+ new_ctxt->maxiter = DEFAULT_MAX_ITER;
+ new_ctxt->bailout = DEFAULT_BAILOUT;
+ new_ctxt->coloringmode = 0;
+ new_ctxt->intcolor = 0;
+ new_ctxt->outtcolor = 0;
+ new_ctxt->slowmode = 0;
+ new_ctxt->range = 3;
+ new_ctxt->angle = 0;
+ set_formula(new_ctxt, formula);
+ return (new_ctxt);
+}
+
+void free_fractalc(fractal_context * c)
+{
+ free(c);
+}
+
+#ifdef NOASSEMBLY
+#define rdtsc() 0
+#else
+#define rdtsc() ({unsigned long time; asm __volatile__ ("rdtsc":"=a"(time)); time; })
+#endif
+
+void speed_test(fractal_context * c, struct image *img)
+{
+ //unsigned int sum;
+ tl_timer *t;
+ int time;
+ unsigned int i;
+ set_fractalc(c, img);
+ t = tl_create_timer();
+ cfractalc.maxiter = 100;
+#ifdef SLOWFUNCPTR
+ i = calculateswitch(0.0, 0.0, 0.0, 0.0, 0);
+#else
+ cfractalc.currentformula->calculate(0.0, 0.0, 0.0, 0.0);
+ if (cfractalc.currentformula->calculate_periodicity != NULL)
+ cfractalc.currentformula->calculate_periodicity(0.0, 0.0, 0.0,
+ 0.0);
+ if (cfractalc.currentformula->smooth_calculate != NULL)
+ cfractalc.currentformula->smooth_calculate(0.0, 0.0, 0.0, 0.0);
+ if (cfractalc.currentformula->smooth_calculate_periodicity != NULL)
+ cfractalc.currentformula->smooth_calculate_periodicity(0.0, 0.0,
+ 0.0, 0.0);
+#endif
+ cfractalc.maxiter = 20000000;
+
+ tl_update_time();
+ tl_reset_timer(t);
+ /*sum = rdtsc (); */
+#ifdef SLOWFUNCPTR
+ i = calculateswitch(0.0, 0.0, 0.0, 0.0, 0);
+#else
+ i = cfractalc.currentformula->calculate(0.0, 0.0, 0.0, 0.0);
+#endif
+ /*sum -= rdtsc ();
+ printf ("%f\n", (double) (-sum) / cfractalc.maxiter); */
+ tl_update_time();
+ time = tl_lookup_timer(t);
+ x_message("Result:%i Formulaname:%s Time:%i Mloops per sec:%.2f",
+ (int) i,
+ cfractalc.currentformula->name[0], time,
+ cfractalc.maxiter / (double) time);
+
+#ifndef SLOWFUNCPTR
+
+
+ if (cfractalc.currentformula->smooth_calculate != NULL) {
+ tl_update_time();
+ tl_reset_timer(t);
+ i = cfractalc.currentformula->smooth_calculate(0.0, 0.0, 0.0, 0.0);
+ tl_update_time();
+ time = tl_lookup_timer(t);
+ x_message("Result:%i Formulaname:%s Time:%i Mloops per sec:%.2f",
+ (int) i,
+ cfractalc.currentformula->name[0],
+ time, cfractalc.maxiter / (double) time);
+ }
+#endif
+
+ tl_free_timer(t);
+}
diff --git a/src/engine/i386.c b/src/engine/i386.c
new file mode 100644
index 0000000..b7a862d
--- /dev/null
+++ b/src/engine/i386.c
@@ -0,0 +1,187 @@
+
+/*
+ * ctrl87.c
+ */
+
+
+#define __CONTROL87_C__
+
+
+#include "../include/i386/ctrl87.h"
+#include <config.h>
+
+#ifdef __GNUC__
+#ifdef __i386__
+#ifndef NOASSEMBLY
+
+/***** _control87 *****/
+unsigned short _control87(unsigned short newcw, unsigned short mask)
+{
+ unsigned short cw;
+
+ asm volatile (" \n\
+ wait \n\
+ fstcw %0 ": /* outputs */ "=m" (cw)
+ : /* inputs */
+ );
+
+ if (mask) { /* mask is not 0 */
+ asm volatile (" \n\
+ mov %2, %%ax \n\
+ mov %3, %%cx \n\
+ and %%cx, %%ax \n\
+ not %%cx \n\
+ nop \n\
+ wait \n\
+ mov %1, %%dx \n\
+ and %%cx, %%dx \n\
+ or %%ax, %%dx \n\
+ mov %%dx, %0 \n\
+ wait \n\
+ fldcw %1 ":
+ /* outputs */ "=m" (cw)
+ : /* inputs */ "m"(cw), "m"(newcw), "m"(mask)
+ : /* registers */ "ax", "cx", "dx"
+ );
+ }
+ return cw;
+
+} /* _control87 */
+#endif
+#endif
+#endif
+
+#ifdef __GNUC__
+#ifdef __i386__
+#if 0
+
+/*
+ * copy.c -- fast memcpy routines for Pentium using FPU
+ * Copyright (c) 1995, 1996 Robert Krawitz <rlk@tiac.net>
+ * and Gerhard Koerting (G.Koerting@techem.ruhr-uni-bochum.de)
+ * Exception handling in kernel/userspace routines by Gerhard
+ * Koerting.
+ * May be used and redistributed under the terms of the GNU Public License
+ */
+#include <sys/types.h>
+
+#define CACHELINE 32
+#define CACHEMASK (CACHELINE - 1)
+#define BIGMASK (~255)
+#define SMALLMASK (~31)
+
+void *penium___zero_chunk(void *_to, size_t _bytes)
+{
+ unsigned long temp0, temp1;
+ register unsigned long to asm("di") = (unsigned long) _to;
+ register unsigned long bytes asm("dx") = (unsigned long) _bytes;
+ char save[42];
+ unsigned long zbuf[2] = { 0, 0 };
+ temp0 = to & 7;
+ if (temp0) {
+ bytes -= temp0;
+ asm __volatile__("cld\n\t"
+ "rep; stosb\n\t":"=D"(to):"D"(to), "a"(0),
+ "c"(temp0):"cx");
+ }
+ asm __volatile__("shrl $3, %0\n\t"
+ "fstenv %4\n\t"
+ "fstpt 32+%4\n\t"
+ "movl (%1), %2\n\t"
+ "fildq %3\n"
+ "2:\n\t"
+ "fstl (%1)\n\t"
+ "addl $8, %1\n\t"
+ "decl %0\n\t"
+ "jne 2b\n\t"
+ "fstpl %%st\n\t"
+ "fldt 32+%4\n\t"
+ "fldenv %4\n\t":"=&r"(temp0), "=&r"(to),
+ "=&r"(temp1):"m"(*(char *) zbuf), "m"(*(char *) save),
+ "0"(bytes), "1"(to));
+ bytes &= 7;
+ if (bytes) {
+ asm __volatile__("shrl $2, %%ecx\n\t"
+ "cld\n\t"
+ "rep ; stosl\n\t"
+ "testb $2,%%dl\n\t"
+ "je 111f\n\t"
+ "stosw\n"
+ "111:\ttestb $1,%%dl\n\t"
+ "je 112f\n\t"
+ "stosb\n"
+ "112:":"=D"(to):"D"(to), "a"(0), "c"(bytes),
+ "d"(bytes):"cx", "memory");
+ }
+ return _to;
+}
+
+void *pentium__memcpy_g(void *_to, const void *_from, size_t _bytes)
+{
+ register unsigned long from asm("si") = (unsigned long) _from;
+ register unsigned long to asm("di") = (unsigned long) _to;
+ register unsigned long bytes asm("dx") = (unsigned long) _bytes;
+ if (bytes >= 1024) {
+ unsigned long temp0, temp1;
+ char save[108];
+
+ temp0 = to & 7;
+ if (temp0) {
+ bytes -= temp0;
+ asm __volatile__("cld\n\t"
+ "rep; movsb\n\t":"=D"(to), "=S"(from):"D"(to),
+ "S"(from), "c"(temp0):"cx");
+ }
+ asm __volatile__("shrl $8, %0\n\t"
+ "movl (%2), %3\n\t" "movl (%1), %3\n\t"
+ /*"fsave %4\n" */
+ "1:\n\t"
+ "movl $4, %3\n"
+ "2:\n\t"
+ "fildq 0x0(%2)\n\t"
+ "fildq 0x20(%2)\n\t"
+ "fildq 0x40(%2)\n\t"
+ "fildq 0x60(%2)\n\t"
+ "fildq 0x80(%2)\n\t"
+ "fildq 0xa0(%2)\n\t"
+ "fildq 0xc0(%2)\n\t"
+ "fildq 0xe0(%2)\n\t"
+ "fxch\n\t"
+ "fistpq 0xc0(%1)\n\t"
+ "fistpq 0xe0(%1)\n\t"
+ "fistpq 0xa0(%1)\n\t"
+ "fistpq 0x80(%1)\n\t"
+ "fistpq 0x60(%1)\n\t"
+ "fistpq 0x40(%1)\n\t"
+ "fistpq 0x20(%1)\n\t"
+ "fistpq 0x0(%1)\n\t"
+ "addl $8, %2\n\t"
+ "addl $8, %1\n\t"
+ "decl %3\n\t"
+ "jne 2b\n\t"
+ "addl $224, %2\n\t"
+ "addl $224, %1\n\t" "decl %0\n\t" "jne 1b\n\t"
+ /*"frstor %4\n\t" */
+ :"=&r"(temp0), "=&r"(to), "=&r"(from),
+ "=&r"(temp1):"m"(save[0]), "0"(bytes), "1"(to),
+ "2"(from):"memory");
+ bytes &= 255;
+ }
+ if (bytes) {
+ asm __volatile__("shrl $2, %%ecx\n\t"
+ "cld\n\t"
+ "rep ; movsl\n\t"
+ "testb $2,%%dl\n\t"
+ "je 111f\n\t"
+ "movsw\n"
+ "111:\ttestb $1,%%dl\n\t"
+ "je 112f\n\t"
+ "movsb\n"
+ "112:":"=D"(to), "=S"(from):"D"(to), "S"(from),
+ "c"(bytes), "d"(bytes):"cx", "memory");
+ }
+ return _to;
+}
+#endif
+#endif
+#endif
diff --git a/src/engine/interlace.c b/src/engine/interlace.c
new file mode 100644
index 0000000..0971a5a
--- /dev/null
+++ b/src/engine/interlace.c
@@ -0,0 +1,134 @@
+#include <config.h>
+#ifndef _plan9_
+#ifdef NO_MALLOC_H
+#include <stdlib.h>
+#else
+#include <malloc.h>
+#endif
+#include <stdio.h> /*for NULL */
+#include <string.h> /*for memcpy */
+#else
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#endif
+#include <filter.h>
+struct intdata {
+ unsigned char *lastent;
+ int changed;
+ int first;
+};
+static int requirement(struct filter *f, struct requirements *r)
+{
+ r->nimages = 1;
+ r->flags |= IMAGEDATA;
+ return (f->next->action->requirement(f->next, r));
+}
+
+static int initialize(struct filter *f, struct initdata *i)
+{
+ int x;
+ struct intdata *d = (struct intdata *) f->data;
+ pixel_t **lines1 =
+ (pixel_t **) malloc(sizeof(*lines1) * i->image->height / 2),
+ **lines2 =
+ (pixel_t **) malloc(sizeof(*lines2) * i->image->height / 2);
+ if (lines1 == NULL)
+ return 0;
+ inhermisc(f, i);
+ d->first = 1;
+ if (lines2 == NULL) {
+ free(lines1);
+ return 0;
+ }
+ if (f->childimage != NULL)
+ destroy_image(f->childimage);
+ f->image = i->image;
+ f->image->flags |= PROTECTBUFFERS;
+ i->flags |= DATALOST;
+ for (x = 0; x < (i->image->height) / 2; x++) {
+ lines1[x] = i->image->currlines[x * 2];
+ lines2[x] = i->image->currlines[x * 2 + 1];
+ }
+ f->childimage = i->image =
+ create_image_lines(i->image->width, (i->image->height) / 2, 2,
+ lines1, lines2, i->image->palette, NULL,
+ FREELINES | PROTECTBUFFERS,
+ f->image->pixelwidth,
+ f->image->pixelheight * 2);
+ if (i->image == NULL) {
+ free(lines1);
+ free(lines2);
+ return 0;
+ }
+ return (f->previous->action->initialize(f->previous, i));
+}
+
+static struct filter *getinstance(CONST struct filteraction *a)
+{
+ struct filter *f = createfilter(a);
+ struct intdata *i = (struct intdata *) calloc(1, sizeof(*i));
+ f->data = i;
+ f->name = "Interlace filter";
+ return (f);
+}
+
+static void destroyinstance(struct filter *f)
+{
+ free(f->data);
+ if (f->childimage != NULL)
+ destroy_image(f->childimage);
+ free(f);
+}
+
+static int doit(struct filter *f, int flags, int time)
+{
+ struct intdata *i = (struct intdata *) f->data;
+ int val;
+ if (!(f->req.flags & IMAGEDATA)
+ && f->childimage->currlines[0] == i->lastent)
+ f->childimage->flip(f->childimage);
+ i->lastent = f->childimage->currlines[0];
+ val = f->previous->action->doit(f->previous, flags, time);
+ if (i->first) {
+ int y;
+ for (y = 0; y < f->childimage->height; y++)
+ memcpy(f->childimage->oldlines[y], f->childimage->currlines[y],
+ f->childimage->width * f->childimage->bytesperpixel);
+ i->first = 0;
+ }
+ if (val & CHANGED)
+ i->changed = 1, val |= ANIMATION;
+ else {
+ if (i->changed)
+ val |= CHANGED;
+ i->changed = 0;
+ }
+ return (val);
+}
+
+static void convertup(struct filter *f, int *x, int *y)
+{
+ *y *= 2;
+ f->next->action->convertup(f->next, x, y);
+}
+
+static void convertdown(struct filter *f, int *x, int *y)
+{
+ *y /= 2;
+ f->previous->action->convertdown(f->previous, x, y);
+}
+
+CONST struct filteraction interlace_filter = {
+ "Interlace filter",
+ "interlace",
+ 0,
+ getinstance,
+ destroyinstance,
+ doit,
+ requirement,
+ initialize,
+ convertup,
+ convertdown,
+ NULL
+};
diff --git a/src/engine/itersmall.c b/src/engine/itersmall.c
new file mode 100644
index 0000000..29985b4
--- /dev/null
+++ b/src/engine/itersmall.c
@@ -0,0 +1,171 @@
+#include <config.h>
+#ifndef _plan9_
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#include <config.h>
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+#include <stdlib.h>
+#else
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#endif
+#define SLARGEITER
+#include <filter.h>
+#include <xthread.h>
+#define NCOLORS 256
+#define IMAGETYPE SMALLITER
+#define spixel_t pixel8_t
+struct siterdata {
+ struct palette *palette;
+};
+static int requirement(struct filter *f, struct requirements *r)
+{
+ f->req = *r;
+ r->nimages = 1;
+ r->flags &= ~IMAGEDATA;
+ r->supportedmask = MASK1BPP | MASK2BPP | MASK3BPP | MASK4BPP;
+ return (f->next->action->requirement(f->next, r));
+}
+
+static int initialize(struct filter *f, struct initdata *i)
+{
+ struct siterdata *s = (struct siterdata *) f->data;
+ inhermisc(f, i);
+ if (!inherimage(f, i, TOUCHIMAGE, 0, 0, s->palette, 0, 0))
+ return 0;
+ return (f->previous->action->initialize(f->previous, i));
+}
+
+static struct filter *getinstance(CONST struct filteraction *a)
+{
+ struct filter *f = createfilter(a);
+ struct siterdata *i = (struct siterdata *) calloc(1, sizeof(*i));
+ i->palette =
+ createpalette(0, 65536, IMAGETYPE, 0, 65536, NULL, NULL, NULL,
+ NULL, NULL);
+ f->data = i;
+ f->name = "Smalliter image convertor";
+ return (f);
+}
+
+static void convert8(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ struct image *img1 = f->childimage, *img2 = f->image;
+ unsigned char *src, *srcend;
+ unsigned int *pixels = img2->palette->pixels;
+ pixel8_t *dest;
+ int i;
+ for (i = r1; i < r2; i++) {
+ src = img1->currlines[i];
+ dest = img2->currlines[i];
+ srcend = src + img1->width;
+ for (; src < srcend; src++, dest++)
+ *dest = pixels[*src];
+ }
+}
+
+static void convert16(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ struct image *img1 = f->childimage, *img2 = f->image;
+ unsigned char *src, *srcend;
+ unsigned int *pixels = img2->palette->pixels;
+ pixel16_t *dest;
+ int i;
+ for (i = r1; i < r2; i++) {
+ src = img1->currlines[i];
+ dest = (pixel16_t *) img2->currlines[i];
+ srcend = src + img1->width;
+ for (; src < srcend; src++, dest++) {
+ *dest = pixels[*src];
+ }
+ }
+}
+
+#ifdef STRUECOLOR24
+#include <true24.h>
+static void convert24(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ struct image *img1 = f->childimage, *img2 = f->image;
+ unsigned char *src, *srcend;
+ unsigned int *pixels = img2->palette->pixels;
+ cpixel_t *dest;
+ int i;
+ for (i = r1; i < r2; i++) {
+ src = img1->currlines[i];
+ dest = (cpixel_t *) img2->currlines[i];
+ srcend = src + img1->width;
+ for (; src < srcend; src++, dest += 3)
+ p_set(dest, pixels[*src]);
+ }
+}
+#endif
+static void convert32(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ struct image *img1 = f->childimage, *img2 = f->image;
+ unsigned char *src, *srcend;
+ unsigned int *pixels = img2->palette->pixels;
+ pixel32_t *dest;
+ int i;
+ for (i = r1; i < r2; i++) {
+ src = img1->currlines[i];
+ dest = (pixel32_t *) img2->currlines[i];
+ srcend = src + img1->width;
+ for (; src < srcend; src++, dest++)
+ *dest = pixels[*src];
+ }
+}
+
+static void destroyinstance(struct filter *f)
+{
+ struct siterdata *i = (struct siterdata *) f->data;
+ destroypalette(i->palette);
+ free(f->data);
+ destroyinheredimage(f);
+ free(f);
+}
+
+static int doit(struct filter *f, int flags, int time)
+{
+ int val;
+ int size;
+ updateinheredimage(f);
+ if (f->image->palette->size < 256)
+ size = f->image->palette->size;
+ else
+ size = 256;
+ if (size != f->childimage->palette->size)
+ f->childimage->palette->size =
+ size, f->childimage->palette->version++;
+ val = f->previous->action->doit(f->previous, flags, time);
+ if (f->image->palette->type != SMALLITER
+ || f->image->currlines[0] != f->childimage->currlines[0]) {
+ drivercall(*f->image,
+ xth_function(convert8, f, f->image->height),
+ xth_function(convert16, f, f->image->height),
+ xth_function(convert24, f, f->image->height),
+ xth_function(convert32, f, f->image->height))}
+ xth_sync();
+ return val;
+}
+
+CONST struct filteraction smalliter_filter = {
+ "Smalliter image convertor",
+ "smalliter",
+ 0,
+ getinstance,
+ destroyinstance,
+ doit,
+ requirement,
+ initialize,
+ convertupgeneric,
+ convertdowngeneric,
+ NULL
+};
diff --git a/src/engine/julia.c b/src/engine/julia.c
new file mode 100644
index 0000000..d471bc8
--- /dev/null
+++ b/src/engine/julia.c
@@ -0,0 +1,120 @@
+#ifdef _plan9_
+#include <u.h>
+#include <stdio.h>
+#include <libc.h>
+#else
+#include <math.h>
+#include <string.h>
+#include <config.h>
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#endif
+#include <filter.h>
+#include "julia.h"
+#include <config.h>
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+#include <filter.h>
+#include <archaccel.h>
+
+
+/*most of code was moved to docalc.c */
+
+#ifdef STATISTICS
+int iters2, guessed2, unguessed2, total2;
+#endif
+void
+init_julia(struct image *img, number_t rangep, number_t range,
+ number_t xdelta, number_t ystep)
+{
+ int i, j, x, y;
+ register number_t im;
+ unsigned char *addr, **addr1 = img->currlines;
+ for (i = 0; i < img->height; i++) {
+ im = IMIN + (i + 0.5) * ystep;
+ x = (int) (sqrt(rangep - im * im) * xdelta + 0.5);
+ if (!i || i == img->height - 1)
+ x = 0;
+ addr = addr1[i];
+ y = img->width / 2 - x;
+ if (y < 1)
+ y = 1;
+ for (j = 0; j < y; j++) {
+ addr[j] = 1;
+ }
+ y = img->width;
+ j = img->width / 2 + x;
+ if (j >= img->width)
+ j = img->width - 1;
+ for (j = img->width / 2 + x; j < y; j++) {
+ addr[j] = 1;
+ }
+ }
+ for (i = 0; i < img->height; i++) {
+ addr = addr1[i];
+ memset_long((char *) addr, NOT_CALCULATED, img->width);
+ }
+}
+
+
+static int requirement(struct filter *f, struct requirements *r)
+{
+ r->nimages = 1;
+ r->flags = 0;
+ r->supportedmask = SMALLITER;
+ return (f->next->action->requirement(f->next, r));
+}
+
+static int initialize(struct filter *f, struct initdata *i)
+{
+ inhermisc(f, i);
+ f->image = i->image;
+ return (1);
+}
+
+static struct filter *getinstance(CONST struct filteraction *a)
+{
+ struct filter *f = createfilter(a);
+ f->name = "Julia generator";
+ return (f);
+}
+
+static void destroyinstance(struct filter *f)
+{
+ free(f);
+}
+
+static int doit(struct filter *f, int flags, int time)
+{
+ /*if(f->image->nimages==2) f->image->flip(f->image); */
+ if (f->fractalc->currentformula->calculate_julia != NULL) {
+ f->fractalc->currentformula->calculate_julia(f->image,
+ f->fractalc->pre,
+ f->fractalc->pim);
+ return (CHANGED);
+ }
+#ifdef STATISTICS
+ printf("Total guessed %i, unguessed %i, iterations %i\n", guessed2,
+ unguessed2, iters2);
+#endif
+
+ return 0;
+}
+
+CONST struct filteraction julia_filter = {
+ "Julia generator",
+ "julia",
+ 0,
+ getinstance,
+ destroyinstance,
+ doit,
+ requirement,
+ initialize,
+ convertupgeneric,
+ convertdowngeneric,
+ NULL,
+};
diff --git a/src/engine/julia.h b/src/engine/julia.h
new file mode 100644
index 0000000..a9377e7
--- /dev/null
+++ b/src/engine/julia.h
@@ -0,0 +1,18 @@
+#ifndef JULIA_H
+#define JULIA_H
+void init_julia(struct image *img, number_t rangep, number_t range,
+ number_t xdelta, number_t ystep);
+#define SAG /*solid anti-guessing */
+#define NOT_CALCULATED (unsigned char)0
+#define INSET (unsigned char)0
+#define INPROCESS (unsigned char)255
+#define RMIN -range
+#define RMAX range
+#define IMIN -range
+#define IMAX range
+#define QMAX 1000
+#ifdef STATISTICS
+extern int iters2, guessed2, unguessed2, total2, frames2;
+#endif
+
+#endif
diff --git a/src/engine/paletted.c b/src/engine/paletted.c
new file mode 100644
index 0000000..2a1a3f0
--- /dev/null
+++ b/src/engine/paletted.c
@@ -0,0 +1,22 @@
+#ifndef UNSUPPORTED
+static void cpalette(void *data, struct taskinfo *task, int r1, int r2)
+{
+ pixel8_t *src, *srcend;
+ cppixel_t dest;
+ struct filter *f = (struct filter *) data;
+ struct palettedata *s = (struct palettedata *) f->data;
+ int i;
+ unsigned int *table = s->table;
+ for (i = r1; i < r2; i++) {
+ src = f->childimage->currlines[i];
+ srcend = src + f->image->width;
+ dest = (cppixel_t) f->image->currlines[i];
+ while (src < srcend) {
+ p_set(dest, table[*src]);
+ src++;
+ p_inc(dest, 1);
+ }
+ }
+}
+#endif
+#undef cpalette
diff --git a/src/engine/palettef.c b/src/engine/palettef.c
new file mode 100644
index 0000000..3bdcbb0
--- /dev/null
+++ b/src/engine/palettef.c
@@ -0,0 +1,165 @@
+#include <config.h>
+#ifndef _plan9_
+#ifdef NO_MALLOC_H
+#include <stdlib.h>
+#else
+#include <malloc.h>
+#endif
+#include <stdio.h>
+#else
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#endif
+#include <filter.h>
+#include <fractal.h>
+#include <xthread.h>
+struct palettedata {
+ struct palette *palette;
+ int active;
+ unsigned int table[256];
+};
+#include <c256.h>
+#define cpalette palette8
+#include "paletted.c"
+
+#include <truecolor.h>
+#define cpalette palette32
+#include "paletted.c"
+
+#include <true24.h>
+#define cpalette palette24
+#include "paletted.c"
+
+#include <hicolor.h>
+#define cpalette palette16
+#include "paletted.c"
+
+static void mysetcolor(struct palette *p, int start, int end, rgb_t * rgb)
+{
+ p->data = &p;
+}
+
+static int requirement(struct filter *f, struct requirements *r)
+{
+ f->req = *r;
+ r->nimages = 1;
+ r->flags &= ~(IMAGEDATA);
+ r->supportedmask = MASK1BPP | MASK2BPP | MASK3BPP | MASK4BPP;
+
+ return (f->next->action->requirement(f->next, r));
+}
+
+static int initialize(struct filter *f, struct initdata *i)
+{
+ struct palettedata *s = (struct palettedata *) f->data;
+ inhermisc(f, i);
+ if (i->image->palette->type != C256
+ || i->image->palette->setpalette == NULL) {
+ if (datalost(f, i) || i->image->version != f->imageversion
+ || !s->active) {
+ if (!s->active) {
+ struct palette *palette;
+ palette = clonepalette(i->image->palette);
+ restorepalette(s->palette, palette);
+ destroypalette(palette);
+ }
+ s->palette->data = s;
+ if (i->image->palette->maxentries < 256)
+ s->palette->maxentries = i->image->palette->maxentries;
+ else
+ s->palette->maxentries = 256;
+ s->active = 1;
+ }
+ if (!inherimage
+ (f, i, TOUCHIMAGE | IMAGEDATA, 0, 0, s->palette, 0, 0))
+ return 0;
+ setfractalpalette(f, s->palette);
+ f->queue->saveimage = f->childimage;
+ f->queue->palettechg = f;
+ } else {
+ if (s->active) {
+ f->image = i->image;
+ restorepalette(f->image->palette, s->palette);
+ }
+ s->active = 0;
+ }
+ return (f->previous->action->initialize(f->previous, i));
+}
+
+static struct filter *getinstance(CONST struct filteraction *a)
+{
+ struct filter *f = createfilter(a);
+ struct palettedata *i = (struct palettedata *) calloc(1, sizeof(*i));
+ i->active = 0;
+ i->palette =
+ createpalette(0, 256, C256, 0, 256, NULL, mysetcolor, NULL, NULL,
+ NULL);
+ f->childimage = NULL;
+ f->data = i;
+ f->name = "Palette emulator";
+ return (f);
+}
+
+static void destroyinstance(struct filter *f)
+{
+ struct palettedata *i = (struct palettedata *) f->data;
+ destroypalette(i->palette);
+ destroyinheredimage(f);
+ free(f->data);
+ free(f);
+}
+
+static int doit(struct filter *f, int flags, int time1)
+{
+ int val;
+ int time = time1;
+ struct palettedata *s = (struct palettedata *) f->data;
+ if (s->active)
+ updateinheredimage(f);
+ if (flags & PALETTEONLY)
+ val = 0;
+ else
+ val = f->previous->action->doit(f->previous, flags, time);
+ if (s->active) {
+ int i;
+ if (s->palette->data != NULL) {
+ val |= CHANGED;
+ restorepalette(f->image->palette, f->childimage->palette);
+ for (i = 0; i < 256; i++) {
+ s->table[i] =
+ f->image->palette->pixels[i % f->image->palette->size];
+ }
+ s->palette->data = NULL;
+ }
+ drivercall(*f->image,
+ xth_function(palette8, f, f->image->height),
+ xth_function(palette16, f, f->image->height),
+ xth_function(palette24, f, f->image->height),
+ xth_function(palette32, f, f->image->height));
+ xth_sync();
+ }
+ return val;
+}
+
+static void myremovefilter(struct filter *f)
+{
+ struct palettedata *s = (struct palettedata *) f->data;
+ if (s->active) {
+ restorepalette(f->image->palette, s->palette);
+ }
+}
+
+CONST struct filteraction palette_filter = {
+ "Palette emulator",
+ "palette",
+ 0,
+ getinstance,
+ destroyinstance,
+ doit,
+ requirement,
+ initialize,
+ convertupgeneric,
+ convertdowngeneric,
+ myremovefilter
+};
diff --git a/src/engine/plane.c b/src/engine/plane.c
new file mode 100644
index 0000000..20e08e7
--- /dev/null
+++ b/src/engine/plane.c
@@ -0,0 +1,144 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifdef __EMX__
+#include <float.h>
+#include <sys/cdefs.h>
+#endif
+#ifdef _plan9_
+#include <u.h>
+#include <libc.h>
+#ifndef NULL
+#define NULL (void *)0
+#endif
+#else
+#include <stdio.h>
+#include <aconfig.h>
+#include <math.h>
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#include <config.h>
+#endif
+#include <fconfig.h>
+#include <plane.h>
+#include <complex.h>
+CONST char *CONST planename[] = {
+ "mu",
+ "1/mu",
+ "1/(mu+0.25)",
+ "lambda",
+ "1/lambda",
+ "1/(lambda-1)",
+ "1/(mu-1.40115)",
+ NULL
+};
+
+
+REGISTERS(3)
+void recalculate(int plane, number_t * x1, number_t * y1)
+{
+ number_t x = *x1, y = *y1;
+ switch (plane) {
+ case 1:
+ { /* 1/mu */
+ number_t t;
+ if (myabs(x) + myabs(y) < 0.000001)
+ t = INT_MAX, y = INT_MAX;
+ else {
+
+ c_div(1, 0, x, y, t, y);
+ }
+ x = t;
+ }
+ break;
+ case 2:
+ { /* 1/(mu + 0.25) */
+ number_t t;
+ if (myabs(x) + myabs(y) < 0.000001)
+ t = INT_MAX, y = INT_MAX;
+ else {
+
+ c_div(1, 0, x, y, t, y);
+ }
+ x = t;
+ x += 0.25;
+ }
+ break;
+ case 3: /* lambda */
+ {
+ number_t tr, ti, mr, mi;
+
+ mr = x, mi = y;
+ c_pow2(x, y, tr, ti);
+ c_div(tr, ti, 4, 0, x, y);
+ c_div(mr, mi, 2, 0, tr, ti);
+ c_sub(tr, ti, x, y, mr, mi);
+ x = mr, y = mi;
+ }
+ break;
+ case 4: /* 1/lambda */
+ {
+ number_t tr, ti, mr, mi;
+
+ c_div(1, 0, x, y, tr, y);
+ x = tr;
+ mr = x, mi = y;
+ c_pow2(x, y, tr, ti);
+ c_div(tr, ti, 4, 0, x, y);
+ c_div(mr, mi, 2, 0, tr, ti);
+ c_sub(tr, ti, x, y, mr, mi);
+ x = mr, y = mi;
+ }
+ break;
+ case 5: /* 1/(lambda-1) */
+ {
+ number_t tr, ti, mr, mi;
+
+ c_div(1, 0, x, y, tr, y);
+ x = tr + 1;
+ mr = x, mi = y;
+ c_pow2(x, y, tr, ti);
+ c_div(tr, ti, 4, 0, x, y);
+ c_div(mr, mi, 2, 0, tr, ti);
+ c_sub(tr, ti, x, y, mr, mi);
+ x = mr, y = mi;
+ }
+ break;
+ case 6:
+ { /* 1/(mu + 0.25) */
+ number_t t;
+ if (myabs(x) + myabs(y) < 0.000001)
+ t = INT_MAX, y = INT_MAX;
+ else {
+
+ c_div(1, 0, x, y, t, y);
+ }
+ x = t;
+ x -= 1.40115;
+ }
+ break;
+ default:
+ break;
+ }
+ *x1 = x;
+ *y1 = y;
+}
diff --git a/src/engine/rotate.c b/src/engine/rotate.c
new file mode 100644
index 0000000..092501d
--- /dev/null
+++ b/src/engine/rotate.c
@@ -0,0 +1,200 @@
+/* An rotation filter. Uses bressemham algorithm combined with dda to rotate
+ * image around center
+ * This filter is used internally by XaoS and is unvisible to normal user in
+ * 'E' menu.
+ * It is used to implement fast rotation mode
+ */
+#include <config.h>
+#ifndef _plan9_
+#include <string.h>
+#include <limits.h>
+#include <archaccel.h>
+#ifndef __cplusplus
+#include <math.h>
+#endif
+#ifdef NO_MALLOC_H
+#include <stdlib.h>
+#else
+#include <malloc.h>
+#endif
+#else
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#endif
+#define SLARGEITER
+#include <xthread.h>
+#include <filter.h>
+
+struct rotatedata {
+ number_t angle;
+ number_t x1, y1, x2, y2, xx1, yy1, xx2, yy2;
+};
+
+#include <c256.h>
+#define do_rotate do_rotate8
+#include "rotated.c"
+
+#include <truecolor.h>
+#define do_rotate do_rotate32
+#include "rotated.c"
+
+#include <true24.h>
+#define do_rotate do_rotate24
+#include "rotated.c"
+
+#include <hicolor.h>
+#define do_rotate do_rotate16
+#include "rotated.c"
+
+
+static int requirement(struct filter *f, struct requirements *r)
+{
+ f->req = *r;
+ r->nimages = 1;
+ r->flags &= ~IMAGEDATA;
+ r->supportedmask = MASK1BPP | MASK2BPP | MASK3BPP | MASK4BPP;
+ return (f->next->action->requirement(f->next, r));
+}
+
+static int initialize(struct filter *f, struct initdata *i)
+{
+ float size, pixelsize;
+ struct rotatedata *s = (struct rotatedata *) f->data;
+ inhermisc(f, i);
+ s->angle = INT_MAX;
+ /*in/out coloring modes looks better in iter modes. This also saves some
+ memory in truecolor. */
+ if (i->image->pixelwidth < i->image->pixelheight)
+ pixelsize = i->image->pixelwidth;
+ else
+ pixelsize = i->image->pixelheight;
+ size =
+ sqrt(i->image->width * i->image->width * i->image->pixelwidth *
+ i->image->pixelwidth +
+ i->image->height * i->image->height * i->image->pixelheight *
+ i->image->pixelheight);
+ if (!inherimage
+ (f, i, TOUCHIMAGE | NEWIMAGE, (int) (size / pixelsize + 1),
+ (int) (size / pixelsize + 1), NULL, pixelsize, pixelsize))
+ return 0;
+ return (f->previous->action->initialize(f->previous, i));
+}
+
+static struct filter *getinstance(CONST struct filteraction *a)
+{
+ struct filter *f = createfilter(a);
+ struct rotatedata *i = (struct rotatedata *) calloc(1, sizeof(*i));
+ f->name = "Rotation filter";
+ f->data = i;
+ return (f);
+}
+
+static void destroyinstance(struct filter *f)
+{
+ free(f->data);
+ destroyinheredimage(f);
+ free(f);
+}
+
+static int doit(struct filter *f, int flags, int time)
+{
+ int val;
+ struct rotatedata *s = (struct rotatedata *) f->data;
+ number_t angle = f->fractalc->angle;
+ number_t wx = f->fractalc->windowwidth, wy = f->fractalc->windowheight;
+ number_t rr = f->fractalc->s.rr, ir = f->fractalc->s.ri;
+ f->fractalc->windowwidth = f->fractalc->windowheight =
+ f->childimage->width * f->childimage->pixelwidth;
+ f->fractalc->s.rr *= f->fractalc->windowwidth / wx;
+ f->fractalc->s.ri *= f->fractalc->windowheight / wy;
+ f->fractalc->windowwidth = f->fractalc->windowheight = 1;
+ f->fractalc->angle = 0;
+ update_view(f->fractalc); /*update rotation tables */
+ updateinheredimage(f);
+ val = f->previous->action->doit(f->previous, flags, time);
+ f->fractalc->angle = angle;
+ update_view(f->fractalc); /*update rotation tables */
+ f->fractalc->s.rr = rr;
+ f->fractalc->s.ri = ir;
+ f->fractalc->windowwidth = wx;
+ f->fractalc->windowheight = wy;
+ if ((val & CHANGED) || s->angle != angle) {
+ s->xx2 = f->image->width * f->image->pixelwidth / 2;
+ s->yy2 = f->image->height * f->image->pixelheight / 2;
+ s->x1 = -s->xx2;
+ s->y1 = -s->yy2;
+ s->x2 = -s->xx2;
+ s->y2 = s->yy2;
+ s->xx1 = s->xx2;
+ s->yy1 = -s->yy2;
+ rotateback(*f->fractalc, s->x1, s->y1);
+ rotateback(*f->fractalc, s->x2, s->y2);
+ rotateback(*f->fractalc, s->xx1, s->yy1);
+ rotateback(*f->fractalc, s->xx2, s->yy2);
+ s->x1 /= f->childimage->pixelwidth;
+ s->x1 += f->childimage->width / 2;
+ s->y1 /= f->childimage->pixelwidth;
+ s->y1 += f->childimage->width / 2;
+ s->xx1 /= f->childimage->pixelwidth;
+ s->xx1 += f->childimage->width / 2;
+ s->yy1 /= f->childimage->pixelwidth;
+ s->yy1 += f->childimage->width / 2;
+ s->x2 /= f->childimage->pixelwidth;
+ s->x2 += f->childimage->width / 2;
+ s->y2 /= f->childimage->pixelwidth;
+ s->y2 += f->childimage->width / 2;
+ s->xx2 /= f->childimage->pixelwidth;
+ s->xx2 += f->childimage->width / 2;
+ s->yy2 /= f->childimage->pixelwidth;
+ s->yy2 += f->childimage->width / 2;
+
+ drivercall(*f->image,
+ xth_function(do_rotate8, f, f->image->height),
+ xth_function(do_rotate16, f, f->image->height),
+ xth_function(do_rotate24, f, f->image->height),
+ xth_function(do_rotate32, f, f->image->height));
+ xth_sync();
+ val |= CHANGED;
+ }
+ return val;
+}
+
+static void convertup(struct filter *f, int *x, int *y)
+{
+ number_t xd =
+ (*x - f->childimage->width / 2) * f->childimage->pixelwidth;
+ number_t yd =
+ (*y - f->childimage->height / 2) * f->childimage->pixelheight;
+ *x = (int) (f->image->width / 2 + xd / f->image->pixelwidth);
+ *y = (int) (f->image->height / 2 + yd / f->image->pixelheight);
+ if (f->next != NULL)
+ f->next->action->convertup(f->next, x, y);
+}
+
+static void convertdown(struct filter *f, int *x, int *y)
+{
+ number_t xd = (*x - f->image->width / 2) * f->image->pixelwidth;
+ number_t yd = (*y - f->image->height / 2) * f->image->pixelheight;
+ *x = (int) (f->childimage->width / 2 + xd / f->childimage->pixelwidth);
+ *y = (int) (f->childimage->height / 2 +
+ yd / f->childimage->pixelheight);
+ if (f->previous != NULL)
+ f->previous->action->convertdown(f->previous, x, y);
+}
+
+
+
+CONST struct filteraction rotate_filter = {
+ "Image rotation",
+ "rotate",
+ 0,
+ getinstance,
+ destroyinstance,
+ doit,
+ requirement,
+ initialize,
+ convertup,
+ convertdown,
+ NULL
+};
diff --git a/src/engine/rotated.c b/src/engine/rotated.c
new file mode 100644
index 0000000..69e24fd
--- /dev/null
+++ b/src/engine/rotated.c
@@ -0,0 +1,56 @@
+#ifndef UNSUPPORTED
+static void do_rotate(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ struct rotatedata *s = (struct rotatedata *) f->data;
+ double xstep = (s->x2 - s->x1) * 65536 / f->image->height;
+ double ystep = (s->y2 - s->y1) * 65536 / f->image->height;
+ double x = (s->x1) * 65536, y = (s->y1) * 65536;
+
+ int ixstep = (int) ((s->xx1 - s->x1) * 65536);
+ int iystep = (int) ((s->yy1 - s->y1) * 65536);
+ int i;
+
+ if (x < 0)
+ x = 0; /*avoid shifting problems */
+ if (y < 0)
+ y = 0;
+
+ ixstep /= f->image->width;
+ iystep /= f->image->width;
+
+ /* I do floating point dda here since I expect that registers used by dda will
+ * not conflict with registers of integer one used by main loop so it will be
+ * faster than dda from stack :)
+ */
+ x += r1 * xstep;
+ y += r1 * ystep;
+ for (i = r1; i < r2; i++) {
+
+ {
+ register int ix = (int) x;
+ register int iy = (int) y;
+ register cpixel_t **vbuff =
+ (cpixel_t **) f->childimage->currlines;
+ register cpixel_t *end =
+ p_add((cpixel_t *) f->image->currlines[i],
+ f->image->width), *dest =
+ (cpixel_t *) f->image->currlines[i];
+ register int iixstep = ixstep, iiystep = iystep;
+
+ while (dest < end) {
+ p_copy(dest, 0, (cpixel_t *) (vbuff[iy >> 16]),
+ (ix >> 16));
+ p_inc(dest, 1);
+ ix += iixstep;
+ iy += iiystep;
+ }
+ }
+
+ x += xstep;
+ y += ystep;
+
+ }
+}
+#endif
+#undef do_rotate
diff --git a/src/engine/star.c b/src/engine/star.c
new file mode 100644
index 0000000..179894e
--- /dev/null
+++ b/src/engine/star.c
@@ -0,0 +1,135 @@
+#include <config.h>
+#ifndef _plan9_
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#include <config.h>
+#include <limits.h>
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+#include <stdlib.h>
+#else
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#endif
+#include <filter.h>
+#include <xthread.h>
+
+struct starfielddata {
+ struct palette *palette;
+ struct palette *savedpalette;
+};
+
+static unsigned int state;
+static INLINE void mysrandom(unsigned int x)
+{
+ state = x;
+}
+
+#define MYLONG_MAX 0xffffff /*this is enought for me. */
+static INLINE unsigned int myrandom(void)
+{
+ state = ((state * 1103515245) + 12345) & MYLONG_MAX;
+ return state;
+}
+
+#define IMAGETYPE SMALLITER
+#include <c256.h>
+#define do_starfield do_starfield8
+#include "stard.c"
+#include <hicolor.h>
+#define do_starfield do_starfield16
+#include "stard.c"
+#include <true24.h>
+#define do_starfield do_starfield24
+#include "stard.c"
+#include <truecolor.h>
+#define do_starfield do_starfield32
+#include "stard.c"
+static int requirement(struct filter *f, struct requirements *r)
+{
+ f->req = *r;
+ r->nimages = 1;
+ r->flags &= ~IMAGEDATA;
+ r->supportedmask =
+ C256 | TRUECOLOR24 | TRUECOLOR | TRUECOLOR16 | GRAYSCALE;
+ return (f->next->action->requirement(f->next, r));
+}
+
+static int initialize(struct filter *f, struct initdata *i)
+{
+ struct starfielddata *s = (struct starfielddata *) f->data;
+ inhermisc(f, i);
+ if (s->savedpalette == NULL)
+ s->savedpalette = clonepalette(i->image->palette);
+ mkstarfieldpalette(i->image->palette);
+ if (!inherimage(f, i, TOUCHIMAGE, 0, 0, s->palette, 0, 0)) {
+ return 0;
+ }
+ setfractalpalette(f, s->savedpalette);
+ return (f->previous->action->initialize(f->previous, i));
+}
+
+static struct filter *getinstance(CONST struct filteraction *a)
+{
+ struct filter *f = createfilter(a);
+ struct starfielddata *i =
+ (struct starfielddata *) calloc(1, sizeof(*i));
+ i->savedpalette = NULL;
+ i->palette =
+ createpalette(0, 65536, IMAGETYPE, 0, 65536, NULL, NULL, NULL,
+ NULL, NULL);
+ f->data = i;
+ f->name = "Starfield";
+ return (f);
+}
+
+static void destroyinstance(struct filter *f)
+{
+ struct starfielddata *i = (struct starfielddata *) f->data;
+ if (i->savedpalette != NULL)
+ destroypalette(i->savedpalette);
+ destroypalette(i->palette);
+ destroyinheredimage(f);
+ free(f);
+ free(i);
+}
+
+static int doit(struct filter *f, int flags, int time)
+{
+ int val;
+ val = f->previous->action->doit(f->previous, flags, time);
+ drivercall(*f->image,
+ xth_function(do_starfield8, f, f->image->height),
+ xth_function(do_starfield16, f, f->image->height),
+ xth_function(do_starfield24, f, f->image->height),
+ xth_function(do_starfield32, f, f->image->height));
+ xth_sync();
+ return val | CHANGED;
+}
+
+static void myremovefilter(struct filter *f)
+{
+ struct starfielddata *s = (struct starfielddata *) f->data;
+ if (s->savedpalette != NULL) {
+ restorepalette(f->image->palette, s->savedpalette);
+ destroypalette(s->savedpalette);
+ s->savedpalette = NULL;
+ }
+}
+
+CONST struct filteraction starfield_filter = {
+ "Starfield",
+ "starfield",
+ 0,
+ getinstance,
+ destroyinstance,
+ doit,
+ requirement,
+ initialize,
+ convertupgeneric,
+ convertdowngeneric,
+ myremovefilter
+};
diff --git a/src/engine/stard.c b/src/engine/stard.c
new file mode 100644
index 0000000..e6e58bc
--- /dev/null
+++ b/src/engine/stard.c
@@ -0,0 +1,31 @@
+#ifndef UNSUPPORTED
+static void do_starfield(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ cpixel_t *dest;
+ pixel8_t *src, *srcend;
+ unsigned int color;
+ int y;
+ cpixeldata_t black = (cpixeldata_t) f->image->palette->pixels[0];
+ mysrandom((unsigned int) rand());
+ for (y = r1; y < r2; y++) {
+ src = f->childimage->currlines[y];
+ srcend = f->childimage->currlines[y] + f->childimage->width;
+ dest = (cpixel_t *) f->image->currlines[y];
+ while (src < srcend) {
+ color = ((unsigned int) myrandom() >> 7) & 15;
+ if (!*src
+ || (unsigned int) *src * (unsigned int) *src *
+ (unsigned int) *src >
+ (unsigned int) ((unsigned int) myrandom() & (0xffffff))) {
+ p_set(dest,
+ (cpixeldata_t) f->image->palette->pixels[color]);
+ } else
+ p_set(dest, black);
+ p_inc(dest, 1);
+ src++;
+ }
+ }
+}
+#endif
+#undef do_starfield
diff --git a/src/engine/stereod.c b/src/engine/stereod.c
new file mode 100644
index 0000000..26ac857
--- /dev/null
+++ b/src/engine/stereod.c
@@ -0,0 +1,51 @@
+#ifndef UNSUPPORTED
+static void
+do_stereogram(void *data, struct taskinfo *task, int r1, int r2)
+{
+ struct filter *f = (struct filter *) data;
+ int i, y, lc;
+ struct stereogramdata *s = (struct stereogramdata *) f->data;
+ register cpixel_t *cs, *c, *src, *src1, *ce;
+ register spixel_t *c1;
+ unsigned int *pixels = f->image->palette->pixels;
+ s->minc = NCOLORS;
+ for (i = r1; i < r2; i++) {
+ int i1;
+ for (i1 = 0; i1 < 2; i1++) {
+ c1 = (spixel_t *) f->childimage->currlines[i];
+ c = cs = (cpixel_t *) f->image->currlines[2 * i + i1];
+ ce = p_add(cs, f->image->width);
+ src = src1 = c;
+ lc = 1024;
+ while (c < ce) {
+ y = *c1;
+ if (y == lc)
+ p_inc(src, 2);
+ else {
+ lc = y;
+ if (y < s->minc && y != 0)
+ s->minc = y;
+ y = table[y];
+ src = p_add(c, -y);
+ }
+ if (src < src1) {
+ p_set(c, pixels[(rand() & 15)]);
+ p_setp(c, 1, pixels[(rand() & 15)]);
+ } else {
+ if (src <= cs) {
+ p_set(c, pixels[(rand() & 15)]);
+ p_setp(c, 1, pixels[(rand() & 15)]);
+ } else {
+ p_copy(c, 0, src, 0);
+ p_copy(c, 1, src, 1);
+ }
+ src1 = src;
+ }
+ p_inc(c, 2);
+ c1++;
+ }
+ }
+ }
+}
+#endif
+#undef do_stereogram
diff --git a/src/engine/stereogram.c b/src/engine/stereogram.c
new file mode 100644
index 0000000..28f0c01
--- /dev/null
+++ b/src/engine/stereogram.c
@@ -0,0 +1,193 @@
+#ifndef _plan9_
+#include <config.h>
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+#include <stdlib.h>
+#else
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#endif
+#include <xthread.h>
+#include <filter.h>
+
+#define PIXELWIDTH (f->image->pixelwidth) /*all distances in cm */
+#define PIXELHEIGHT (f->image->pixelheight)
+
+#define USER_DIST (60.0)
+#define INDEX_DIST (0.3)
+#define EYE_DIST (8.5)
+#define START1 (60.0)
+#define FNC(x) x
+
+#define NCOLORS 256
+#define IMAGETYPE SMALLITER
+#define spixel_t pixel8_t
+static int *table;
+struct stereogramdata {
+ int minc;
+ struct palette *palette;
+ struct palette *savedpalette;
+};
+
+#include <c256.h>
+#define do_stereogram do_stereogram8
+#include "stereod.c"
+
+#include <hicolor.h>
+#define do_stereogram do_stereogram16
+#include "stereod.c"
+
+#include <true24.h>
+#define do_stereogram do_stereogram24
+#include "stereod.c"
+
+#include <truecolor.h>
+#define do_stereogram do_stereogram32
+#include "stereod.c"
+
+static int requirement(struct filter *f, struct requirements *r)
+{
+ f->req = *r;
+ r->nimages = 1;
+ r->flags &= ~IMAGEDATA;
+ r->supportedmask =
+ C256 | TRUECOLOR | TRUECOLOR24 | TRUECOLOR16 | GRAYSCALE;
+ return (f->next->action->requirement(f->next, r));
+}
+
+static int initialize(struct filter *f, struct initdata *i)
+{
+ struct stereogramdata *s = (struct stereogramdata *) f->data;
+ inhermisc(f, i);
+ if (s->savedpalette == NULL)
+ s->savedpalette = clonepalette(i->image->palette);
+ mkstereogrampalette(i->image->palette);
+ if (!inherimage
+ (f, i, TOUCHIMAGE, i->image->width / 2, (i->image->height) / 2,
+ s->palette, i->image->pixelwidth * 2, i->image->pixelheight * 2))
+ return 0;
+ setfractalpalette(f, s->savedpalette);
+ return (f->previous->action->initialize(f->previous, i));
+}
+
+static struct filter *getinstance(CONST struct filteraction *a)
+{
+ struct filter *f = createfilter(a);
+ struct stereogramdata *i =
+ (struct stereogramdata *) calloc(1, sizeof(*i));
+ i->minc = 0;
+ i->savedpalette = NULL;
+ i->palette =
+ createpalette(0, 65536, IMAGETYPE, 0, 65536, NULL, NULL, NULL,
+ NULL, NULL);
+ f->data = i;
+ f->name = "Random dot stereogram";
+ return (f);
+}
+
+static void destroyinstance(struct filter *f)
+{
+ struct stereogramdata *i = (struct stereogramdata *) f->data;
+ if (i->savedpalette != NULL)
+ destroypalette(i->savedpalette);
+ destroypalette(i->palette);
+ destroyinheredimage(f);
+ free(f);
+ free(i);
+}
+
+static int doit(struct filter *f, int flags, int time)
+{
+ int val;
+ struct stereogramdata *s = (struct stereogramdata *) f->data;
+ int i, y;
+ double start, maxdist, dist;
+ updateinheredimage(f);
+ if (f->fractalc->maxiter < NCOLORS)
+ s->palette->size = f->fractalc->maxiter;
+ else
+ s->palette->size = NCOLORS;
+ val = f->previous->action->doit(f->previous, flags, time);
+#ifdef HAVE_ALLOCA
+ table = (int *) alloca(sizeof(int) * NCOLORS);
+#else
+ table = (int *) malloc(sizeof(int) * NCOLORS);
+#endif
+ dist = (f->fractalc->s.rr) / 2;
+ maxdist = INDEX_DIST * FNC(f->fractalc->maxiter) + START1;
+ do {
+ start = dist * maxdist - INDEX_DIST * FNC(s->minc);
+ maxdist *= 5;
+ }
+ while (start + INDEX_DIST * (FNC(s->minc)) < 25.0);
+ if (f->fractalc->maxiter < NCOLORS)
+ y = f->fractalc->maxiter;
+ else
+ y = NCOLORS;
+ if (y < 256)
+ y = 256;
+ for (i = 0; i < y; i++) {
+ double dist;
+ if (i != 0)
+ dist = i;
+ else
+ dist = y - 1;
+ dist = INDEX_DIST * (FNC(dist)) + start;
+ table[i] =
+ (int) (EYE_DIST * dist / (dist + USER_DIST) / PIXELWIDTH);
+ }
+ drivercall(*f->image,
+ xth_function(do_stereogram8, f, f->childimage->height),
+ xth_function(do_stereogram16, f, f->childimage->height),
+ xth_function(do_stereogram24, f, f->childimage->height),
+ xth_function(do_stereogram32, f, f->childimage->height));
+ xth_sync();
+#ifndef HAVE_ALLOCA
+ free(table);
+#endif
+ return val;
+}
+
+static void convertup(struct filter *f, int *x, int *y)
+{
+ *y *= 2;
+ *x *= 2;
+ f->next->action->convertup(f->next, x, y);
+}
+
+static void convertdown(struct filter *f, int *x, int *y)
+{
+ *y /= 2;
+ *x /= 2;
+ if (f->previous != NULL)
+ f->previous->action->convertdown(f->previous, x, y);
+}
+
+static void myremovefilter(struct filter *f)
+{
+ struct stereogramdata *s = (struct stereogramdata *) f->data;
+ if (s->savedpalette != NULL) {
+ restorepalette(f->image->palette, s->savedpalette);
+ destroypalette(s->savedpalette);
+ s->savedpalette = NULL;
+ }
+}
+
+CONST struct filteraction stereogram_filter = {
+ "Random dot stereogram",
+ "stereogram",
+ 0,
+ getinstance,
+ destroyinstance,
+ doit,
+ requirement,
+ initialize,
+ convertup,
+ convertdown,
+ myremovefilter
+};
diff --git a/src/engine/subwindow.c b/src/engine/subwindow.c
new file mode 100644
index 0000000..19b78bf
--- /dev/null
+++ b/src/engine/subwindow.c
@@ -0,0 +1,236 @@
+#ifndef _plan9_
+#include <config.h>
+#ifdef NO_MALLOC_H
+#include <stdlib.h>
+#else
+#include <malloc.h>
+#endif
+#include <stdio.h> /*for NULL */
+#include <string.h> /*for memcpy */
+#else
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#endif
+#include <filter.h>
+#include <zoom.h>
+struct subdata {
+ struct filter *second;
+ struct image *image;
+ pixel_t **currlines;
+ int recal;
+ int forpversion, forversion;
+ number_t pre, pim;
+};
+void subwindow_setsecond(struct filter *f, struct filter *f1)
+{
+ struct subdata *s = (struct subdata *) f->data;
+ s->second = f1;
+}
+
+static void myflip(struct image *image)
+{
+ struct subdata *s = (struct subdata *) image->data;
+ flipgeneric(image);
+ s->image->flip(s->image);
+ s->currlines = s->image->currlines;
+}
+
+static int requirement(struct filter *f, struct requirements *r)
+{
+ r->nimages = 2;
+ r->flags |= IMAGEDATA;
+ return (f->next->action->requirement(f->next, r));
+}
+
+extern CONST struct filteraction threed_filter;
+
+static int initialize(struct filter *f, struct initdata *i)
+{
+ struct subdata *s = (struct subdata *) f->data;
+ int x;
+ int val = 0;
+ pixel_t **lines1, **lines2 = NULL;
+ double size;
+ int width, height;
+ int threed = 0;
+ struct filter *f1 = f;
+
+ inhermisc(f, i);
+ if (datalost(f, i))
+ s->recal = 1;
+ while (f1) {
+ if (f1->action == &threed_filter)
+ threed = 1;
+ f1 = f1->next;
+ }
+ f->imageversion = i->image->version;
+ if (f->childimage != NULL)
+ destroy_image(f->childimage);
+ s->image = f->image = i->image;
+ s->image->flags |= PROTECTBUFFERS;
+ s->currlines = f->image->currlines;
+ s->forpversion = f->image->palette->version;
+ s->forversion = f->fractalc->version;
+ if (f->image->width * f->image->pixelwidth <
+ f->image->height * f->image->pixelheight)
+ size = f->image->width * f->image->pixelwidth / 2;
+ else
+ size = f->image->height * f->image->pixelheight / 2;
+ width = (int) (size / f->image->pixelwidth);
+ height = (int) (size / f->image->pixelheight);
+ /*fractalc_resize_to(f->fractalc,size,size); */
+ lines1 = (pixel_t **) malloc(sizeof(*lines1) * height);
+ if (f->image->nimages == 2)
+ lines2 = (pixel_t **) malloc(sizeof(*lines2) * height);
+ if (lines1 == NULL)
+ return 0;
+ if (f->image->nimages == 2 && lines2 == NULL) {
+ free(lines1);
+ return 0;
+ }
+ for (x = 0; x < height; x++) {
+ lines1[x] =
+ i->image->currlines[x + (threed ? f->image->height / 3 : 0)];
+ if (f->image->nimages == 2)
+ lines2[x] =
+ i->image->oldlines[x +
+ (threed ? f->image->height / 3 : 0)];
+ }
+ if (f->image->nimages == 2)
+ for (x = 0; x < f->image->height; x++) {
+ memcpy(f->image->oldlines[x], f->image->currlines[x],
+ f->image->width * f->image->bytesperpixel);
+ }
+ f->childimage = i->image =
+ create_image_lines(width, height, f->image->nimages, lines1,
+ lines2, i->image->palette, myflip, FREELINES,
+ f->image->pixelwidth, f->image->pixelheight);
+ if (i->image == NULL) {
+ free(lines1);
+ free(lines2);
+ return 0;
+ }
+ f->childimage->data = s;
+ x = f->previous->action->initialize(f->previous, i);
+ if (!x)
+ return 0;
+ if (s->second != NULL) {
+ i->image = f->image;
+ val = s->second->action->initialize(s->second, i);
+ if (!val)
+ return 0;
+ }
+ return (x | val);
+
+}
+
+static struct filter *getinstance(CONST struct filteraction *a)
+{
+ struct filter *f = createfilter(a);
+ struct subdata *s = (struct subdata *) calloc(1, sizeof(*s));
+ f->name = "Subwindow";
+ f->data = s;
+ s->second = NULL;
+ return (f);
+}
+
+static void destroyinstance(struct filter *f)
+{
+ free(f->data);
+ if (f->childimage != NULL)
+ destroy_image(f->childimage);
+ free(f);
+}
+
+static int doit(struct filter *f, int flags, int time)
+{
+ int val = 0, m, vold;
+ vinfo vs;
+ vrect rs;
+ float wwidth, wheight;
+ struct subdata *s = (struct subdata *) f->data;
+ static int v;
+ if (s->second != NULL
+ && (s->recal || s->forpversion != f->image->palette->version
+ || s->forversion != f->fractalc->version)) {
+ int x;
+ if (s->recal)
+ f->fractalc->version++;
+ s->forpversion = f->image->palette->version;
+ s->forversion = f->fractalc->version;
+ s->recal = 1;
+ val = (s->second->action->doit(s->second, flags, time));
+ if (val & ANIMATION)
+ return val;
+ s->recal = 0;
+ if (f->image->nimages == 2)
+ for (x = 0; x < f->image->height; x++) {
+ memcpy(f->image->oldlines[x], f->image->currlines[x],
+ f->image->width * f->image->bytesperpixel);
+ }
+ }
+ if (s->currlines != f->image->currlines && f->childimage->nimages == 2)
+ flipgeneric(f->childimage), s->currlines = f->image->currlines;
+ /*FIXME: ugly hack for new julia mode */
+ v++;
+ wwidth = f->fractalc->windowwidth;
+ wheight = f->fractalc->windowheight;
+ f->fractalc->windowwidth =
+ f->previous->image->width * f->previous->image->pixelwidth;
+ f->fractalc->windowheight =
+ f->previous->image->height * f->previous->image->pixelheight;
+ vs = f->fractalc->s;
+ rs = f->fractalc->rs;
+ f->fractalc->s = f->fractalc->currentformula->v;
+ if (f->fractalc->currentformula->calculate_julia) {
+ f->fractalc->s.cr = f->fractalc->s.ci = 0;
+ f->fractalc->s.rr = f->fractalc->s.ri = 4; /*FIXME should be set to real formula's bailout */
+ }
+ update_view(f->fractalc);
+ m = f->fractalc->mandelbrot;
+ vold = f->fractalc->version;
+ if (s->pre != f->fractalc->pre || s->pim != f->fractalc->pim) {
+ f->fractalc->version = v;
+ s->pre = f->fractalc->pre;
+ s->pim = f->fractalc->pim;
+ }
+ f->fractalc->mandelbrot = 0;
+ val = f->previous->action->doit(f->previous, flags, time) | val;
+ f->fractalc->mandelbrot = m;
+ f->fractalc->version = vold;
+ f->fractalc->s = vs;
+ f->fractalc->rs = rs;
+ f->fractalc->windowwidth = wwidth;
+ f->fractalc->windowheight = wheight;
+ return val;
+}
+
+static void myremove(struct filter *f)
+{
+ /*fractalc_resize_to(f->fractalc,f->queue->last->image->width*f->queue->last->image->pixelwidth,f->queue->last->image->height*f->queue->last->image->pixelheight); */
+}
+
+static void convertdown(struct filter *f, int *x, int *y)
+{
+ struct subdata *s = (struct subdata *) f->data;
+ if (s->second != NULL)
+ s->second->action->convertdown(s->second, x, y);
+ if (f->previous != NULL)
+ f->previous->action->convertdown(f->previous, x, y);
+}
+
+
+CONST struct filteraction subwindow_filter = {
+ "Subwindow",
+ "Subwindow",
+ 0,
+ getinstance,
+ destroyinstance,
+ doit,
+ requirement,
+ initialize,
+ convertupgeneric,
+ convertdown,
+ myremove
+};
diff --git a/src/engine/zoom.c b/src/engine/zoom.c
new file mode 100644
index 0000000..907da95
--- /dev/null
+++ b/src/engine/zoom.c
@@ -0,0 +1,1762 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+/*#define DRAW */
+#include <config.h>
+#include <fconfig.h>
+#ifdef _plan9_
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#else
+#include <stdlib.h>
+#include <stdio.h>
+#ifndef _MAC
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#endif
+#ifdef __EMX__
+#include <float.h>
+#include <sys/cdefs.h>
+#endif
+#include <aconfig.h>
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#include <math.h>
+#include <string.h>
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+#ifndef _plan9_
+/*#undef NDEBUG */
+#include <assert.h>
+#endif
+#endif
+#define SLARGEITER
+#include <filter.h>
+#include <zoom.h>
+#include <archaccel.h>
+#include <complex.h> /*for myabs */
+#include <plane.h>
+#include <btrace.h>
+#include <xthread.h>
+#include <xerror.h>
+#include "calculate.h" /*an inlined calulate function */
+
+#ifdef HAVE_GETTEXT
+#include <libintl.h>
+#else
+#define gettext(STRING) STRING
+#endif
+
+#define ASIZE 16
+#define ALIGN(x) (((x)+ASIZE-1)&(~(ASIZE-1)))
+static int nsymetrized;
+unsigned char *tmpdata, *tmpdata1;
+struct realloc_s {
+ number_t possition;
+ number_t price;
+ unsigned int plus;
+ int recalculate;
+ int symto;
+ int symref;
+ int dirty;
+}
+#ifdef __GNUC__
+__attribute__ ((aligned(32)))
+#endif
+ ;
+typedef struct realloc_s realloc_t;
+
+
+typedef struct zoom_context {
+ number_t *xpos, *ypos;
+ int newcalc;
+ int forversion;
+ int forpversion;
+ realloc_t *reallocx, *reallocy;
+ int uncomplette;
+ int changed;
+} zoom_context;
+
+struct filltable {
+ int from;
+ int to;
+ int length;
+ int end;
+};
+#define getzcontext(f) ((zoom_context *)((f)->data))
+#define getfcontext(f) ((f)->fractalc)
+
+#define callwait() if(cfilter.wait_function!=NULL) cfilter.wait_function(&cfilter);
+#define tcallwait() if(!xth_nthread(task)&&cfilter.wait_function!=NULL) cfilter.wait_function(&cfilter);
+#define setuncomplette(i) (getzcontext(&cfilter)->uncomplette=i)
+#define incuncomplette() (getzcontext(&cfilter)->uncomplette++)
+#define setchanged(i) (getzcontext(&cfilter)->changed=i)
+
+
+zoom_context czoomc;
+struct filter cfilter;
+#ifdef STATISTICS
+static int tocalculate = 0, avoided = 0;
+static int nadded = 0, nsymetry = 0, nskipped = 0;
+int nperi = 0;
+#endif
+
+#ifdef _NEVER_
+#define rdtsc() ({unsigned long long time; asm __volatile__ ("rdtsc":"=A"(time)); time; })
+#define startagi() ({asm __volatile__ ("rdmsr ; andw 0xfe00,%%ax ; orw 0x1f, %%ax ; wrmsr; "::"c"(22):"ax","dx"); })
+#define countagi() ({unsigned long long count; asm __volatile__ ("rdmsr":"=A"(count):"c"(12)); count;})
+#define cli() ({asm __volatile__ ("cli");})
+#define sti() ({asm __volatile__ ("sti");})
+#else
+#define rdtsc() 0
+#define cli() 0
+#define sti() 0
+#define startagi() 0
+#define countagi() 0
+#endif
+
+#ifndef USE_i386ASM
+static void
+moveoldpoints(void *data1, struct taskinfo *task, int r1, int r2)
+REGISTERS(0);
+static void fillline_8(int line) REGISTERS(0);
+static void fillline_16(int line) REGISTERS(0);
+static void fillline_24(int line) REGISTERS(0);
+static void fillline_32(int line) REGISTERS(0);
+#endif
+
+/*first of all inline driver section */
+/*If you think this way is ugly, I must agree. Please let me know
+ *about better one that allows to generate custom code for 8,16,24,32
+ *bpp modes and use of static variables
+ */
+#include <c256.h>
+#define fillline fillline_8
+#define dosymetry2 dosymetry2_8
+#define calcline calcline_8
+#define calccolumn calccolumn_8
+#include "zoomd.c"
+
+#include <truecolor.h>
+#define fillline fillline_32
+#define dosymetry2 dosymetry2_32
+#define calcline calcline_32
+#define calccolumn calccolumn_32
+#include "zoomd.c"
+
+#include <true24.h>
+#define fillline fillline_24
+#define dosymetry2 dosymetry2_24
+#define calcline calcline_24
+#define calccolumn calccolumn_24
+#include "zoomd.c"
+
+#include <hicolor.h>
+#define fillline fillline_16
+#define dosymetry2 dosymetry2_16
+#define calcline calcline_16
+#define calccolumn calccolumn_16
+#include "zoomd.c"
+
+#define calcline(a) drivercall(cimage,calcline_8(a),calcline_16(a),calcline_24(a),calcline_32(a));
+#define calccolumn(a) drivercall(cimage,calccolumn_8(a),calccolumn_16(a),calccolumn_24(a),calccolumn_32(a));
+
+
+struct dyn_data {
+ int price;
+ struct dyn_data *previous;
+};
+
+#define FPMUL 64 /*Let multable fit into pentium cache */
+#define RANGES 2 /*shift equal to x*RANGE */
+#define RANGE 4
+
+#define DSIZEHMASK (0x7) /*mask equal to x%(DSIZE) */
+#define DSIZE (2*RANGE)
+#define DSIZES (RANGES+1) /*shift equal to x*DSIZE */
+
+
+#define adddata(n,i) (dyndata+(((n)<<DSIZES)+(((i)&(DSIZEHMASK)))))
+#define getbest(i) (dyndata+((size)<<DSIZES)+(i))
+#define nosetadd ((size*2)<<DSIZES)
+#ifndef DEBUG
+#define CHECKPOS(pos)
+#else
+#define CHECKPOS(pos) (assert((pos)>=dyndata),assert((pos)<dyndata+(size)+((size)<<DSIZES)))
+#endif
+
+#ifdef __POWERPC__
+# undef USE_MULTABLE
+#else
+# define USE_MULTABLE 1
+#endif
+
+#ifdef USE_MULTABLE
+#define PRICE(i,i1) mulmid[(i)-(i1)]
+#else
+#define PRICE(i,i1) (((i)-(i1)) * ((i)-(i1)))
+#endif
+#define NEWPRICE (FPMUL*FPMUL*(RANGE)*(RANGE))
+
+#define NOSETMASK ((unsigned int)0x80000000)
+#define END NULL
+#define MAXPRICE INT_MAX
+/*static int dynsize = (int)sizeof (struct dyn_data);*/
+#ifndef INT_MIN
+#define INT_MIN (- INT_MAX - 1)
+#endif
+#define IRANGE FPMUL*RANGE
+
+#ifdef USE_MULTABLE
+static int multable[RANGE * FPMUL * 2];
+static int *mulmid;
+#endif
+
+/*Functions looks trought rows/columns marked for calculation and tries to use
+ *some symetrical one instead
+ */
+
+/*FIXME should be threaded...but thread overhead should take more work than
+ *do it in one, since it is quite simple and executes just in case fractal
+ *on the screen is symetrical and it is quite rare case...who knows
+ */
+static void
+ /*INLINE */ preparesymetries(register realloc_t * realloc, CONST int size,
+ register
+ int symi,
+ number_t
+ sym,
+ number_t
+ step)
+{
+ register int i;
+ register int istart = 0;
+ number_t fy, ftmp;
+ realloc_t *r = realloc, *reallocs;
+
+ sym *= 2;
+ i = 2 * symi - size;
+ if (i < 0)
+ i = 0;
+ realloc += i;
+
+ for (; i <= symi; i++, realloc++) { /*makes symetries */
+ int j, min = 0;
+ number_t dist = NUMBER_BIG, tmp1;
+
+ if (realloc->symto != -1)
+ continue;
+
+ fy = realloc->possition;
+ realloc->symto = 2 * symi - i;
+
+ if (realloc->symto >= size - RANGE)
+ realloc->symto = size - RANGE - 1;
+
+ dist = RANGE * step;
+ min = RANGE;
+#ifndef NDEBUG
+ if (realloc->symto < 0 || realloc->symto >= size) {
+ x_fatalerror("Internal error #22-1 %i", realloc->symto);
+ assert(0);
+ }
+#endif
+ reallocs = &r[realloc->symto];
+ j = (realloc->symto - istart >
+ RANGE) ? -RANGE : (-realloc->symto + istart);
+
+ if (realloc->recalculate) {
+ for (; j < RANGE && realloc->symto + j < size - 1; j++) {
+ ftmp = sym - (reallocs + j)->possition;
+ if ((tmp1 = myabs(ftmp - fy)) < dist) {
+ if ((realloc == r || ftmp > (realloc - 1)->possition)
+ && (ftmp < (realloc + 1)->possition)) {
+ dist = tmp1;
+ min = j;
+ }
+ } else if (ftmp < fy)
+ break;
+ }
+
+ } else {
+ for (; j < RANGE && realloc->symto + j < size - 1; j++) {
+ if (!realloc->recalculate)
+ continue;
+ ftmp = sym - (reallocs + j)->possition;
+ if ((tmp1 = myabs(ftmp - fy)) < dist) {
+ if ((realloc == r || ftmp > (realloc - 1)->possition)
+ && (ftmp < (realloc + 1)->possition)) {
+ dist = tmp1;
+ min = j;
+ }
+ } else if (ftmp < fy)
+ break;
+ }
+ }
+ realloc->symto += min;
+
+ if (min == RANGE || realloc->symto <= symi ||
+ (reallocs = reallocs + min)->symto != -1
+ || reallocs->symref != -1) {
+ realloc->symto = -1;
+ continue;
+ }
+
+ if (!realloc->recalculate) {
+ realloc->symto = -1;
+ if (reallocs->symto != -1 || !reallocs->recalculate)
+ continue;
+ reallocs->plus = realloc->plus;
+ reallocs->symto = i;
+ nsymetrized++;
+ istart = realloc->symto - 1;
+ reallocs->dirty = 1;
+ realloc->symref = (int) (reallocs - r);
+ STAT(nadded -= reallocs->recalculate);
+ reallocs->recalculate = 0;
+ reallocs->possition = sym - realloc->possition;
+ } else {
+ if (reallocs->symto != -1) {
+ realloc->symto = -1;
+ continue;
+ }
+ istart = realloc->symto - 1;
+ STAT(nadded -= realloc->recalculate);
+ nsymetrized++;
+ realloc->dirty = 1;
+ realloc->plus = reallocs->plus;
+ realloc->recalculate = 0;
+ reallocs->symref = i;
+ realloc->possition = sym - reallocs->possition;
+ }
+ STAT(nsymetry++);
+
+#ifndef NDEBUG
+ if (realloc->symto < -1 || realloc->symto >= size) {
+ x_fatalerror("Internal error #22 %i", realloc->symto);
+ assert(0);
+ }
+ if (reallocs->symto < -1 || reallocs->symto >= size) {
+ x_fatalerror("Internal error #22-2 %i", reallocs->symto);
+ assert(0);
+ }
+#endif
+ }
+
+}
+
+static /*INLINE */ void
+newpossitions(realloc_t * realloc, unsigned int size, number_t begin1,
+ number_t end1, CONST number_t * fpos, int yend)
+{
+ realloc_t *rs, *re, *rend;
+ number_t step = size / (end1 - begin1);
+ number_t start;
+ number_t end;
+ rend = realloc + size;
+ rs = realloc - 1;
+ re = realloc;
+ while (rs < rend - 1) {
+ re = rs + 1;
+ if (re->recalculate) {
+ while (re < rend && re->recalculate)
+ re++;
+
+ if (re == rend)
+ end = end1;
+ else
+ end = re->possition;
+
+ if (rs == realloc - 1) {
+ start = begin1;
+ if (start > end)
+ start = end;
+ } else
+ start = rs->possition;
+
+ if (re == rend && start > end)
+ end = start;
+
+ if (re - rs == 2)
+ end = (end - start) * 0.5;
+ else
+ end = ((number_t) (end - start)) / (re - rs);
+
+
+ switch (yend) {
+ case 1:
+ for (rs++; rs < re; rs++) {
+ start += end, rs->possition = start;
+ rs->price =
+ 1 / (1 + myabs(fpos[rs - realloc] - start) * step);
+ }
+ break;
+ case 2:
+ for (rs++; rs < re; rs++) {
+ start += end, rs->possition = start;
+ rs->price = (myabs(fpos[rs - realloc] - start) * step);
+ if (rs == realloc || rs == rend - 1)
+ rs->price *= 500;
+ }
+ break;
+ default:
+ for (rs++; rs < re; rs++) {
+ start += end, rs->possition = start;
+ rs->price = (number_t) 1;
+ }
+ break;
+ }
+ }
+ rs = re;
+ }
+}
+
+/* This is the main reallocation algorithm described in xaos.info
+ * It is quite complex since many loops are unrooled and uses custom
+ * fixedpoint
+ *
+ * Takes approx 30% of time so looking for way to do it threaded.
+ * Let me know :)
+ */
+static /*INLINE */ void
+mkrealloc_table(CONST number_t * RESTRICT fpos,
+ realloc_t * RESTRICT realloc,
+ CONST unsigned int size, CONST number_t begin,
+ CONST number_t end, number_t sym, unsigned char *tmpdata)
+{
+ unsigned int i;
+ int counter;
+ unsigned int ps, ps1 = 0, pe;
+ register unsigned int p;
+ int bestprice = MAXPRICE;
+ realloc_t *r = realloc;
+ struct dyn_data *RESTRICT dyndata;
+ int yend, y;
+ register struct dyn_data **RESTRICT best;
+ struct dyn_data **RESTRICT best1, **tmp;
+ register int *RESTRICT pos;
+ number_t step, tofix;
+ int symi = -1;
+ unsigned int lastplus = 0;
+ struct dyn_data *RESTRICT data;
+ register struct dyn_data *previous = NULL, *bestdata = NULL;
+ register int myprice;
+#ifdef STATISTICS
+ nadded = 0, nsymetry = 0, nskipped = 0;
+#endif
+
+ pos = (int *) tmpdata;
+ best =
+ (struct dyn_data **) (tmpdata + ALIGN((size + 2) * sizeof(int)));
+ best1 =
+ (struct dyn_data **) (tmpdata + ALIGN((size + 2) * sizeof(int)) +
+ ALIGN(size * sizeof(struct dyn_data **)));
+ dyndata =
+ (struct dyn_data *) (tmpdata + ALIGN((size + 2) * sizeof(int)) +
+ 2 * ALIGN(size * sizeof(struct dyn_data **)));
+
+ tofix = size * FPMUL / (end - begin);
+ pos[0] = INT_MIN;
+ pos++;
+ for (counter = (int) size - 1; counter >= 0; counter--) {
+ pos[counter] = (int) ((fpos[counter] - begin) * tofix); /*first convert everything into fixedpoint */
+ if (counter < (int) size - 1 && pos[counter] > pos[counter + 1])
+ /*Avoid processing of missordered rows.
+ They should happend because of limited
+ precisity of FP numbers */
+ pos[counter] = pos[counter + 1];
+ }
+ pos[size] = INT_MAX;
+ step = (end - begin) / (number_t) size;
+ if (begin > sym || sym > end) /*calculate symetry point */
+ symi = -2;
+ else {
+ symi = (int) ((sym - begin) / step);
+
+ }
+
+ ps = 0;
+ pe = 0;
+ y = 0;
+
+ /* This is first pass that fills table dyndata, that holds information
+ * about all ways algorithm thinks about. Correct way is discovered at
+ * end by looking backward and determining witch way algorithm used to
+ * calculate minimal value*/
+
+ for (i = 0; i < size; i++, y += FPMUL) {
+ bestprice = MAXPRICE;
+ p = ps; /*just inicialize parameters */
+
+ tmp = best1;
+ best1 = best;
+ best = tmp;
+
+ yend = y - IRANGE;
+ if (yend < -FPMUL) /*do no allow lines outside screen */
+ yend = -FPMUL;
+
+ while (pos[p] <= yend) /*skip lines out of range */
+ p++;
+#ifdef _UNDEFINED_
+ if (pos[p - 1] > yend) /*warning...maybe this is the bug :) */
+ p--, assert(0);
+#endif
+ ps1 = p;
+ yend = y + IRANGE;
+
+ /*First try case that current line will be newly calculated */
+
+ /*Look for best way how to connect previous lines */
+ if (ps != pe && p > ps) { /*previous point had lines */
+ assert(p >= ps);
+ if (p < pe) {
+ previous = best[p - 1];
+ CHECKPOS(previous);
+ } else
+ previous = best[pe - 1];
+ CHECKPOS(previous);
+ myprice = previous->price; /*find best one */
+ } else {
+ if (i > 0) { /*previous line had no lines */
+ previous = getbest(i - 1);
+ myprice = previous->price;
+ } else
+ previous = END, myprice = 0;
+ }
+
+ data = getbest(i); /*find store possition */
+ myprice += NEWPRICE;
+ bestdata = data;
+ data->previous = previous;
+ bestprice = myprice; /*calculate best available price */
+ data->price = myprice; /*store data */
+ assert(bestprice >= 0); /*FIXME:tenhle assert muze FAILIT! */
+#ifdef _UNDEFINED_
+ if (yend > end + FPMUL) /*check bounds */
+ yend = end + FPMUL;
+#endif
+ data = adddata(p, i); /*calcualte all lines good for this y */
+
+ /* Now try all acceptable connection and calculate best possibility
+ * with this connection
+ */
+ if (ps != pe) { /*in case that previous had also possitions */
+ int price1 = INT_MAX;
+ /*At first line of previous interval we have only one possibility
+ *don't connect previous line at all.
+ */
+ if (p == ps) { /*here we must skip previous point */
+ if (pos[p] != pos[p + 1]) {
+ previous = getbest(i - 1);
+ myprice = previous->price;
+ myprice += PRICE(pos[p], y); /*store data */
+ if (myprice < bestprice) { /*calcualte best */
+ bestprice = myprice, bestdata = data;
+ data->price = myprice;
+ data->previous = previous;
+ }
+ }
+ assert(bestprice >= 0);
+ assert(myprice >= 0);
+ best1[p] = bestdata;
+ data += DSIZE;
+ p++;
+ }
+
+ previous = NULL;
+ price1 = myprice;
+ while (p < pe) { /*this is area where intervals of current point and previous one are crossed */
+ if (pos[p] != pos[p + 1]) {
+ if (previous != best[p - 1]) {
+
+ previous = best[p - 1];
+ CHECKPOS(previous);
+ price1 = myprice = previous->price;
+
+ /*In case we found revolutional point, we should think
+ *about changing our gusesses in last point too - don't
+ *connect it at all, but use this way instead*/
+ if (myprice + NEWPRICE < bestprice) { /*true in approx 2/3 of cases */
+ bestprice = myprice + NEWPRICE, bestdata =
+ data - DSIZE;
+ (bestdata)->price = bestprice;
+ (bestdata)->previous = previous + nosetadd;
+ best1[p - 1] = bestdata;
+ }
+ } else
+ myprice = price1;
+
+ myprice += PRICE(pos[p], y); /*calculate price of new connection */
+
+ if (myprice < bestprice) { /*2/3 of cases *//*if it is better than previous, store it */
+ bestprice = myprice, bestdata = data;
+ data->price = myprice;
+ data->previous = previous;
+ } else if (pos[p] > y) {
+ best1[p] = bestdata;
+ data += DSIZE;
+ p++;
+ break;
+ }
+
+ }
+
+ assert(myprice >= 0);
+ assert(bestprice >= 0); /*FIXME:tenhle assert FAILI! */
+
+ best1[p] = bestdata;
+ data += DSIZE;
+ p++;
+ }
+ while (p < pe) { /*this is area where intervals of current point and previous one are crossed */
+#ifdef DEBUG
+ if (pos[p] != pos[p + 1]) {
+ if (previous != best[p - 1]) {
+ x_fatalerror("Missoptimization found!");
+ }
+ }
+#endif
+#ifdef _UNDEFINED_
+ /* Experimental results show, that probability for better approximation
+ * in this area is extremly low. Maybe it never happends.
+ * I will have to think about it a bit more... It seems to have
+ * to do something with meaning of universe and god... no idea
+ * why it is true.
+ *
+ * Anyway it don't seems to worth include the expensive tests
+ * here.
+ */
+ if (pos[p] != pos[p + 1]) {
+ if (previous != best[p - 1]) {
+
+ previous = best[p - 1];
+ CHECKPOS(previous);
+ myprice = previous->price;
+
+ /*In case we found revolutional point, we should think
+ *about changing our gusesses in last point too - don't
+ *connect it at all, but use this way instead*/
+ if (myprice + NEWPRICE < bestprice) { /*true in approx 2/3 of cases */
+ bestprice = myprice + NEWPRICE, bestdata =
+ data - DSIZE;
+ (bestdata)->price = bestprice;
+ (bestdata)->previous = previous + nosetadd;
+ best1[p - 1] = bestdata;
+ }
+ myprice += PRICE(pos[p], y); /*calculate price of new connection */
+ if (myprice < bestprice) { /*if it is better than previous, store it */
+ bestprice = myprice, bestdata = data;
+ data->price = myprice;
+ data->previous = previous;
+ }
+ }
+ }
+#endif
+ assert(myprice >= 0);
+ assert(bestprice >= 0); /*FIXME:tenhle assert FAILI! */
+
+ best1[p] = bestdata;
+ data += DSIZE;
+ p++;
+ }
+
+ /* OK...we passed crossed area. All next areas have same previous
+ * situation so our job is easier
+ * So find the best solution once for all od them
+ */
+ if (p > ps) {
+ previous = best[p - 1]; /*find best one in previous */
+ CHECKPOS(previous);
+ price1 = previous->price;
+ } else {
+ previous = getbest(i - 1);
+ price1 = previous->price;
+ }
+
+ /* Since guesses for "revolutional point" was allways one
+ * step back, we need to do last one*/
+ if (price1 + NEWPRICE < bestprice && p > ps1) {
+ myprice = price1 + NEWPRICE;
+ bestprice = myprice, bestdata = data - DSIZE;
+ (bestdata)->price = myprice;
+ (bestdata)->previous = previous + nosetadd;
+ best1[p - 1] = bestdata;
+ myprice -= NEWPRICE;
+ }
+
+ while (pos[p] < yend) {
+ if (pos[p] != pos[p + 1]) {
+ myprice = price1;
+ myprice += PRICE(pos[p], y); /*store data */
+ if (myprice < bestprice) { /*calcualte best */
+ bestprice = myprice, bestdata = data;
+ data->price = myprice;
+ data->previous = previous;
+ } else if (pos[p] > y)
+ break;
+ }
+
+ assert(bestprice >= 0);
+ assert(myprice >= 0);
+
+ best1[p] = bestdata;
+ data += DSIZE;
+ p++;
+ }
+ while (pos[p] < yend) {
+ best1[p] = bestdata;
+ p++;
+ }
+ } else {
+ /* This is second case - previous y was not mapped at all.
+ * Situation is simplier now, since we know that behind us is
+ * large hole and our decisions don't affect best solution for
+ * previous problem. Se we have just one answer
+ * Situation is similiar to latest loop in previous case
+ */
+ int myprice1; /*simplified loop for case that previous
+ y had no lines */
+ if (pos[p] < yend) {
+ if (i > 0) {
+ previous = getbest(i - 1);
+ myprice1 = previous->price;
+ } else
+ previous = END, myprice1 = 0;
+ while (pos[p] < yend) {
+ if (pos[p] != pos[p + 1]) {
+ myprice = myprice1 + PRICE(pos[p], y);
+ if (myprice < bestprice) {
+ data->price = myprice;
+ data->previous = previous;
+ bestprice = myprice, bestdata = data;
+ } else if (pos[p] > y)
+ break;
+ }
+ assert(bestprice >= 0);
+ assert(myprice >= 0);
+ best1[p] = bestdata;
+ p++;
+ data += DSIZE;
+ }
+ while (pos[p] < yend) {
+ best1[p] = bestdata;
+ p++;
+ }
+ }
+ }
+ /*previous = ps; *//*store possitions for next loop */
+ ps = ps1;
+ ps1 = pe;
+ pe = p;
+ }
+
+
+ assert(bestprice >= 0);
+
+ realloc = realloc + size;
+ yend = (int) ((begin > fpos[0]) && (end < fpos[size - 1]));
+
+ if (pos[0] > 0 && pos[size - 1] < (int) size * FPMUL)
+ yend = 2;
+
+
+
+ /*This part should be made threaded quite easily...but does it worth
+ *since it is quite simple loop 0...xmax
+ */
+ for (i = size; i > 0;) { /*and finally traces the path */
+ struct dyn_data *bestdata1;
+ realloc--;
+ i--;
+ realloc->symto = -1;
+ realloc->symref = -1;
+ bestdata1 = bestdata->previous;
+
+ if (bestdata1 >= dyndata + nosetadd
+ || bestdata >= dyndata + ((size) << DSIZES)) {
+ if (bestdata1 >= dyndata + nosetadd)
+ bestdata1 -= nosetadd;
+
+ realloc->recalculate = 1;
+ STAT(nadded++);
+ realloc->dirty = 1;
+ lastplus++;
+
+ if (lastplus >= size)
+ lastplus = 0;
+
+ realloc->plus = lastplus;
+
+ } else {
+ p = ((unsigned int) (bestdata - dyndata)) >> DSIZES;
+ assert(p >= 0 && p < size);
+ realloc->possition = fpos[p];
+ realloc->plus = p;
+ realloc->dirty = 0;
+ realloc->recalculate = 0;
+ lastplus = p;
+ }
+ bestdata = bestdata1;
+ }
+
+
+
+ newpossitions(realloc, size, begin, end, fpos, yend);
+ realloc = r;
+ if (symi <= (int) size && symi >= 0) {
+ preparesymetries(r, (int) size, symi, sym, step);
+ }
+
+
+ STAT(printf
+ ("%i added %i skipped %i mirrored\n", nadded, nskipped,
+ nsymetry));
+ STAT(nadded2 += nadded;
+ nskipped2 += nskipped;
+ nsymetry2 += nsymetry);
+}
+
+struct movedata {
+ unsigned int size;
+ unsigned int start;
+ unsigned int plus;
+};
+int avgsize;
+/*
+ * this function prepares fast moving table for moveoldpoints
+ * see xaos.info for details. It is not threaded since it is quite
+ * fast.
+ */
+static /*INLINE */ void preparemoveoldpoints(void)
+{
+ struct movedata *data, *sizend;
+ realloc_t *rx, *rx1, *rend1;
+ int sum = 0, num = 0;
+ int plus1 = 0;
+
+ data = (struct movedata *) tmpdata;
+ for (rx = czoomc.reallocx, rend1 = rx + cimage.width; rx < rend1; rx++)
+ if ((rx->dirty) && plus1 < cimage.width + 1)
+ plus1++;
+ else
+ break;
+ data->start = czoomc.reallocx->plus;
+ data->size = 0;
+ data->plus = plus1;
+ rend1--;
+ while (rend1->dirty) {
+ if (rend1 == czoomc.reallocx)
+ return;
+ rend1--;
+ }
+ rend1++;
+ for (; rx < rend1; rx++) {
+ if ((rx->dirty || rx->plus == data->start + data->size))
+ data->size++;
+ else {
+ if (data->size) {
+ plus1 = 0;
+ rx1 = rx - 1;
+ while (rx1 > czoomc.reallocx && rx1->dirty)
+ plus1++, data->size--, rx1--;
+ if (!
+ (data->start + data->size <
+ (unsigned int) cimage.width)
+&& !rx->dirty) {
+ int i;
+ if (rx == rend1)
+ break;
+ for (i = 0; rx->dirty && rx < rend1; rx++)
+ i++;
+ data++;
+ data->plus = plus1;
+ data->size = (unsigned int) i;
+ data->start = rx->plus - i;
+ } else {
+ sum += data->size;
+ num++;
+ data++;
+ data->plus = plus1;
+ data->start = rx->plus;
+ }
+ } else
+ data->start = rx->plus;
+ assert(rx->plus >= 0
+ && rx->plus < (unsigned int) cimage.width);
+ data->size = 1;
+ }
+
+ }
+ if (data->size) {
+ sizend = data + 1;
+ sum += data->size;
+ rx1 = rx - 1;
+ while (rx1 > czoomc.reallocx && rx1->dirty)
+ data->size--, rx1--;
+ num++;
+ } else
+ sizend = data;
+ sizend->size = 0;
+ if (cimage.bytesperpixel != 1) {
+ sum *= cimage.bytesperpixel;
+ for (data = (struct movedata *) tmpdata; data < sizend; data++) {
+ data->plus *= cimage.bytesperpixel;
+ data->size *= cimage.bytesperpixel;
+ data->start *= cimage.bytesperpixel;
+ }
+ }
+ if (num)
+ avgsize = sum / num;
+}
+
+#ifndef USE_i386ASM
+static /*INLINE */ void
+moveoldpoints(void /*@unused@ */ *data1,
+ struct taskinfo /*@unused@ */ *task,
+ int r1, int r2)
+{
+ struct movedata *data;
+ register unsigned char *vline, *vbuff;
+ realloc_t *ry, *rend;
+ int i = r1;
+
+ for (ry = czoomc.reallocy + r1, rend = czoomc.reallocy + r2; ry < rend;
+ ry++, i++) {
+ if (!ry->dirty) {
+ assert(ry->plus >= 0
+ && ry->plus < (unsigned int) cimage.height);
+ vbuff = cimage.currlines[i];
+ vline = cimage.oldlines[ry->plus];
+ for (data = (struct movedata *) tmpdata; data->size; data++) {
+ vbuff += data->plus;
+ memcpy(vbuff, vline + data->start, (size_t) data->size),
+ vbuff += data->size;
+ }
+ }
+ }
+}
+#endif
+/* This function prepares fast filling tables for fillline */
+static /*INLINE */ int mkfilltable(void)
+{
+ int vsrc;
+ int pos;
+ realloc_t *rx, *r1, *r2, *rend, *rend2;
+ int n = 0;
+ int num = 0;
+ struct filltable *tbl = (struct filltable *) tmpdata;
+
+ pos = 0;
+ vsrc = 0;
+
+ rx = czoomc.reallocx;
+ while (rx > czoomc.reallocx && rx->dirty)
+ rx--;
+ for (rend = czoomc.reallocx + cimage.width, rend2 =
+ czoomc.reallocx + cimage.width; rx < rend; rx++) {
+ if (rx->dirty) {
+ r1 = rx - 1;
+ for (r2 = rx + 1; r2 < rend2 && r2->dirty; r2++);
+ while (rx < rend2 && rx->dirty) {
+ n = (int) (r2 - rx);
+ assert(n > 0);
+ if (r2 < rend2
+ && (r1 < czoomc.reallocx
+ || rx->possition - r1->possition >
+ r2->possition - rx->possition))
+ vsrc = (int) (r2 - czoomc.reallocx), r1 = r2;
+ else {
+ vsrc = (int) (r1 - czoomc.reallocx);
+ if (vsrc < 0)
+ goto end;
+ }
+ pos = (int) (rx - czoomc.reallocx);
+ assert(pos >= 0 && pos < cimage.width);
+ assert(vsrc >= 0 && vsrc < cimage.width);
+
+ tbl[num].length = n;
+ tbl[num].to = pos * cimage.bytesperpixel;
+ tbl[num].from = vsrc * cimage.bytesperpixel;
+ tbl[num].end =
+ tbl[num].length * cimage.bytesperpixel + tbl[num].to;
+ /*printf("%i %i %i %i\n",num,tbl[num].length, tbl[num].to, tbl[num].from); */
+ while (n) {
+ rx->possition = czoomc.reallocx[vsrc].possition;
+ rx->dirty = 0;
+ rx++;
+ n--;
+ }
+ num++;
+ } /*while rx->dirty */
+ } /*if rx->dirty */
+ } /*for czoomc */
+ end:
+ tbl[num].length = 0;
+ tbl[num].to = pos;
+ tbl[num].from = vsrc;
+ return num;
+}
+
+static /*INLINE */ void filly(void /*@unused@ */
+ /*@null@ */ *data,
+ struct taskinfo /*@unused@ */ *task, int rr1,
+ int rr2)
+{
+ register unsigned char **vbuff = cimage.currlines;
+ realloc_t *ry, *r1, *r2, *rend, *rend2, *rs = NULL;
+ int linesize = cimage.width * cimage.bytesperpixel;
+
+ ry = czoomc.reallocy + rr1;
+
+ ry = czoomc.reallocy + rr1;
+ while (ry > czoomc.reallocy && ry->dirty > 0)
+ ry--;
+ for (rend = czoomc.reallocy + rr2, rend2 =
+ czoomc.reallocy + cimage.height; ry < rend; ry++) {
+ if (ry->dirty > 0) {
+ incuncomplette();
+ r1 = ry - 1;
+ for (r2 = ry + 1; r2 < rend2 && r2->dirty > 0; r2++);
+#ifdef _UNDEFINED_
+ if (r2 >= rend && (rr2 != cimage.height || ry == 0))
+#else
+ if (r2 >= rend2 && (rr2 != cimage.height || ry == 0))
+#endif
+ return;
+ while (ry < rend2 && ry->dirty > 0) {
+ if (r1 < czoomc.reallocy) {
+ rs = r2;
+ if (r2 >= rend2)
+ return;
+ } else if (r2 >= rend2)
+ rs = r1;
+ else if (ry->possition - r1->possition <
+ r2->possition - ry->possition)
+ rs = r1;
+ else
+ rs = r2;
+ if (!rs->dirty) {
+ drivercall(cimage,
+ fillline_8(rs - czoomc.reallocy),
+ fillline_16(rs - czoomc.reallocy),
+ fillline_24(rs - czoomc.reallocy),
+ fillline_32(rs - czoomc.reallocy));
+ ry->dirty = -1;
+ }
+ memcpy(vbuff[ry - czoomc.reallocy],
+ vbuff[rs - czoomc.reallocy], (size_t) linesize);
+ ry->possition = rs->possition;
+ ry->dirty = -1;
+ ry++;
+ }
+ }
+ if (ry < rend && !ry->dirty) {
+ drivercall(cimage,
+ fillline_8(ry - czoomc.reallocy),
+ fillline_16(ry - czoomc.reallocy),
+ fillline_24(ry - czoomc.reallocy),
+ fillline_32(ry - czoomc.reallocy));
+ ry->dirty = -1;
+ }
+ }
+}
+
+static void fill(void)
+{
+ if (cfilter.interrupt) {
+ cfilter.pass = "reducing resolution";
+ mkfilltable();
+ xth_function(filly, NULL, cimage.height);
+ }
+ xth_sync();
+}
+
+static /*INLINE */ void
+calculatenew(void /*@unused@ */ *data, struct taskinfo /*@unused@ */ *task,
+ int /*@unused@ */ r1, int /*@unused@ */ r2)
+{
+ int s;
+ int i, y;
+ realloc_t *rx, *ry, *rend;
+ int range = cfractalc.range * 2;
+ int positions[16];
+ int calcpositions[16];
+ /*int s3; */
+ if (range < 1)
+ range = 1;
+ if (range > 16)
+ range = 16;
+ memset(positions, 0, sizeof(positions));
+ calcpositions[0] = 0;
+ positions[0] = 1;
+ for (s = 1; s < range;) {
+ for (i = 0; i < range; i++) {
+ if (!positions[i]) {
+ for (y = i; y < range && !positions[y]; y++);
+ positions[(y + i) / 2] = 1;
+ calcpositions[s++] = (y + i) / 2;
+ }
+ }
+ }
+
+ if (!xth_nthread(task)) {
+ STAT(tocalculate = 0);
+ STAT(avoided = 0);
+ cfilter.pass = gettext("Solid guessing 1");
+ cfilter.max = 0;
+ cfilter.pos = 0;
+ }
+
+ /* We don't need to wory about race conditions here, since only
+ * problem that should happend is incorrectly counted number
+ * of lines to do...
+ *
+ * I will fix that problem later, but I think that this information
+ * should be quite useless at multithreaded systems so it should
+ * be a bit inaccurate. Just need to take care in percentage
+ * displayers that thinks like -100% or 150% should happend
+ */
+ if (!xth_nthread(task)) {
+ for (ry = czoomc.reallocy, rend = ry + cimage.height; ry < rend;
+ ry++) {
+ if (ry->recalculate)
+ cfilter.max++;
+ }
+ for (rx = czoomc.reallocx, rend = rx + cimage.width; rx < rend;
+ rx++) {
+ if (rx->recalculate) {
+ cfilter.max++;
+ }
+ }
+ }
+ tcallwait();
+ for (s = 0; s < range; s++) {
+ for (ry = czoomc.reallocy + calcpositions[s], rend =
+ czoomc.reallocy + cimage.height; ry < rend; ry += range) {
+ xth_lock(0);
+ if (ry->recalculate == 1) {
+ ry->recalculate = 2;
+ xth_unlock(0);
+ setchanged(1);
+ ry->dirty = 0;
+ calcline(ry);
+ cfilter.pos++;
+#ifndef DRAW
+ tcallwait();
+#endif
+ if (cfilter.interrupt) {
+ break;
+ }
+ } else {
+ xth_unlock(0);
+ }
+ } /*for ry */
+ for (rx = czoomc.reallocx + calcpositions[s], rend =
+ czoomc.reallocx + cimage.width; rx < rend; rx += range) {
+ xth_lock(1);
+ if (rx->recalculate == 1) {
+ rx->recalculate = 2;
+ xth_unlock(1);
+ setchanged(1);
+ rx->dirty = 0;
+ calccolumn(rx);
+ cfilter.pos++;
+#ifndef DRAW
+ tcallwait();
+#endif
+ if (cfilter.interrupt) {
+ return;
+ }
+ } else {
+ xth_unlock(1);
+ }
+ }
+ }
+ STAT(printf
+ ("Avoided caluclating of %i points from %i and %2.2f%% %2.2f%%\n",
+ avoided, tocalculate, 100.0 * (avoided) / tocalculate,
+ 100.0 * (tocalculate - avoided) / cimage.width / cimage.height));
+ STAT(avoided2 += avoided;
+ tocalculate2 += tocalculate;
+ frames2 += 1);
+}
+
+static void addprices(realloc_t * r, realloc_t * r2) REGISTERS(3);
+REGISTERS(3)
+static void addprices(realloc_t * r, realloc_t * r2)
+{
+ realloc_t *r3;
+ while (r < r2) {
+ r3 = r + (((unsigned int) (r2 - r)) >> 1);
+ r3->price = (r2->possition - r3->possition) * (r3->price);
+ if (r3->symref != -1)
+ r3->price = r3->price / 2;
+ addprices(r, r3);
+ r = r3 + 1;
+ }
+}
+
+/* We can't do both symetryies (x and y) in one loop at multithreaded
+ * systems,since we need to take care to points at the cross of symetrized
+ * point/column
+ */
+static /*INLINE */ void
+dosymetry(void /*@unused@ */ *data, struct taskinfo /*@unused@ */ *task,
+ int r1, int r2)
+{
+ unsigned char **vbuff = cimage.currlines + r1;
+ realloc_t *ry, *rend;
+ int linesize = cimage.width * cimage.bytesperpixel;
+
+ for (ry = czoomc.reallocy + r1, rend = czoomc.reallocy + r2; ry < rend;
+ ry++) {
+ assert(ry->symto >= 0 || ry->symto == -1);
+ if (ry->symto >= 0) {
+ assert(ry->symto < cimage.height);
+ if (!czoomc.reallocy[ry->symto].dirty) {
+ memcpy(*vbuff, cimage.currlines[ry->symto],
+ (size_t) linesize);
+ ry->dirty = 0;
+ }
+ }
+ vbuff++;
+ }
+}
+
+/*Well, clasical simple quicksort. Should be faster than library one
+ *because of reduced number of function calls :)
+ */
+static INLINE void myqsort(realloc_t ** start, realloc_t ** end)
+{
+ number_t med;
+ realloc_t **left = start, **right = end - 1;
+ while (1) {
+
+ /*Quite strange caluclation of median, but should be
+ *as good as Sedgewick middle of three method and is faster*/
+ med = ((*start)->price + (*(end - 1))->price) * 0.5;
+
+ /*Avoid one comparsion */
+ if (med > (*start)->price) {
+ realloc_t *tmp;
+ tmp = *left;
+ *left = *right;
+ *right = tmp;
+ }
+ right--;
+ left++;
+
+ while (1) {
+ realloc_t *tmp;
+
+ while (left < right && (*left)->price > med)
+ left++;
+ while (left < right && med > (*right)->price)
+ right--;
+
+ if (left < right) {
+ tmp = *left;
+ *left = *right;
+ *right = tmp;
+ left++;
+ right--;
+ } else
+ break;
+ }
+ if (left - start > 1)
+ myqsort(start, left);
+ if (end - right <= 2)
+ return;
+ left = start = right;
+ right = end - 1;
+ }
+}
+
+static int tocalcx, tocalcy;
+static void processqueue(void *data, struct taskinfo /*@unused@ */ *task,
+ int /*@unused@ */ r1, int /*@unused@ */ r2)
+{
+ realloc_t **tptr = (realloc_t **) data, **tptr1 =
+ (realloc_t **) tmpdata;
+ realloc_t *r, *end;
+ end = czoomc.reallocx + cimage.width;
+
+ while (tptr1 < tptr
+ && (!cfilter.interrupt || tocalcx == cimage.width
+ || tocalcy == cimage.height)) {
+ xth_lock(0);
+ r = *tptr1;
+ if (r != NULL) {
+ *tptr1 = NULL;
+ xth_unlock(0);
+ cfilter.pos++;
+ if (tocalcx < cimage.width - 2 && tocalcy < cimage.height - 2)
+ cfilter.readyforinterrupt = 1;
+ tcallwait();
+ if (r >= czoomc.reallocx && r < end) {
+ r->dirty = 0;
+ tocalcx--;
+ calccolumn(r);
+ } else {
+ r->dirty = 0;
+ tocalcy--;
+ calcline(r);
+ }
+ } else {
+ xth_unlock(0);
+ }
+ tptr1++;
+ }
+}
+
+/*
+ * Another long unthreaded code. It seems to be really long and
+ * ugly, but believe or not it takes just about 4% of calculation time,
+ * so why to worry about? :)
+ *
+ * This code looks for columns/lines to calculate, adds them into queue,
+ * sorts it in order of significancy and then calls parrel processqueue,
+ * that does the job.
+ */
+static void calculatenewinterruptible(void)
+{
+ realloc_t *r, *r2, *end, *end1;
+ realloc_t **table, **tptr;
+
+ /*tptr = table = (realloc_t **) malloc (sizeof (*table) * (cimage.width + cimage.height)); */
+ tptr = table = (realloc_t **) tmpdata;
+ end = czoomc.reallocx + cimage.width;
+ tocalcx = 0, tocalcy = 0;
+
+ STAT(tocalculate = 0);
+ STAT(avoided = 0);
+
+ cfilter.pass = gettext("Solid guessing");
+
+ for (r = czoomc.reallocx; r < end; r++)
+ if (r->dirty)
+ tocalcx++, setchanged(1);
+
+ for (r = czoomc.reallocx; r < end; r++) {
+ if (r->recalculate) {
+ for (r2 = r; r2 < end && r2->recalculate; r2++)
+ *(tptr++) = r2;
+ if (r2 == end)
+ /*(r2 - 1)->price = 0, */
+ r2--;
+ addprices(r, r2);
+ r = r2;
+ }
+ }
+
+ end1 = czoomc.reallocy + cimage.height;
+
+ for (r = czoomc.reallocy; r < end1; r++)
+ if (r->dirty)
+ tocalcy++, setchanged(1);
+
+ for (r = czoomc.reallocy; r < end1; r++) {
+ if (r->recalculate) {
+ for (r2 = r; r2 < end1 && r2->recalculate; r2++)
+ *(tptr++) = r2;
+ if (r2 == end1)
+ /*(r2 - 1)->price = 0, */
+ r2--;
+ addprices(r, r2);
+ r = r2;
+ }
+ }
+ if (table != tptr) {
+
+ if (tptr - table > 1)
+ myqsort(table, tptr);
+
+ cfilter.pos = 0;
+ cfilter.max = (int) (tptr - table);
+ cfilter.incalculation = 1;
+ callwait();
+
+ xth_function(processqueue, tptr, 1);
+
+ callwait();
+ }
+
+ cfilter.pos = 0;
+ cfilter.max = 0;
+ cfilter.pass = "Procesing symetries";
+ cfilter.incalculation = 0;
+ callwait();
+
+ xth_sync();
+ if (nsymetrized) {
+ xth_function(dosymetry, NULL, cimage.height);
+ xth_sync();
+ drivercall(cimage,
+ xth_function(dosymetry2_8, NULL, cimage.width),
+ xth_function(dosymetry2_16, NULL, cimage.width),
+ xth_function(dosymetry2_24, NULL, cimage.width),
+ xth_function(dosymetry2_32, NULL, cimage.width));
+ xth_sync();
+ }
+ if (cfilter.interrupt) {
+ cfilter.pass = "reducing resolution";
+ mkfilltable();
+ xth_function(filly, NULL, cimage.height);
+ }
+ xth_sync();
+
+ STAT(printf
+ ("Avoided caluclating of %i points from %i and %2.2f%% %2.2f%%\n",
+ avoided, tocalculate, 100.0 * (avoided) / tocalculate,
+ 100.0 * (tocalculate - avoided) / cimage.width / cimage.height));
+ STAT(avoided2 += avoided;
+ tocalculate2 += tocalculate;
+ frames2 += 1);
+}
+
+static void init_tables(struct filter *f)
+{
+ int i;
+ zoom_context *c = getzcontext(f);
+
+ /*c->dirty = 2; */
+ for (i = 0; i < f->image->width + 1; i++)
+ c->xpos[i] =
+ (-f->fractalc->rs.nc + f->fractalc->rs.mc) +
+ f->fractalc->rs.mc;
+ for (i = 0; i < f->image->height + 1; i++)
+ c->ypos[i] =
+ (-f->fractalc->rs.ni + f->fractalc->rs.mi) +
+ f->fractalc->rs.mi;
+}
+
+
+static int alloc_tables(struct filter *f)
+{
+ zoom_context *c = getzcontext(f);
+ c->xpos =
+ (number_t *) malloc((f->image->width + 8) * sizeof(*c->xpos));
+ if (c->xpos == NULL)
+ return 0;
+ c->ypos =
+ (number_t *) malloc((f->image->height + 8) * sizeof(*c->ypos));
+ if (c->ypos == NULL) {
+ free((void *) c->xpos);
+ return 0;
+ }
+ c->reallocx =
+ (realloc_t *) malloc(sizeof(realloc_t) * (f->image->width + 8));
+ if (c->reallocx == NULL) {
+ free((void *) c->xpos);
+ free((void *) c->ypos);
+ return 0;
+ }
+ c->reallocy =
+ (realloc_t *) malloc(sizeof(realloc_t) * (f->image->height + 8));
+ if (c->reallocy == NULL) {
+ free((void *) c->xpos);
+ free((void *) c->ypos);
+ free((void *) c->reallocx);
+ return 0;
+ }
+ return 1;
+}
+
+static void free_tables(struct filter *f)
+{
+ zoom_context *c = getzcontext(f);
+ if (c->xpos != NULL)
+ free((void *) c->xpos), c->xpos = NULL;
+ if (c->ypos != NULL)
+ free((void *) c->ypos), c->ypos = NULL;
+ if (c->reallocx != NULL)
+ free((void *) c->reallocx), c->reallocx = NULL;
+ if (c->reallocy != NULL)
+ free((void *) c->reallocy), c->reallocy = NULL;
+}
+
+static void free_context(struct filter *f)
+{
+ zoom_context *c;
+ c = getzcontext(f);
+ free_tables(f);
+ free((void *) c);
+ f->data = NULL;
+}
+
+static zoom_context *make_context(void)
+{
+ zoom_context *new_ctxt;
+
+ new_ctxt = (zoom_context *) calloc(1, sizeof(zoom_context));
+ if (new_ctxt == NULL)
+ return NULL;
+ new_ctxt->forversion = -1;
+ new_ctxt->newcalc = 1;
+ new_ctxt->reallocx = NULL;
+ new_ctxt->reallocy = NULL;
+ new_ctxt->xpos = NULL;
+ new_ctxt->ypos = NULL;
+ new_ctxt->uncomplette = 0;
+ return (new_ctxt);
+}
+
+static void startbgmkrealloc(void /*@unused@ */ *data,
+ struct taskinfo /*@unused@ */ *task,
+ int /*@unused@ */ r1,
+ int /*@unused@ */ r2)
+{
+ mkrealloc_table(czoomc.ypos, czoomc.reallocy,
+ (unsigned int) cimage.height, cfractalc.rs.ni,
+ cfractalc.rs.mi, cursymetry.ysym, tmpdata1);
+}
+
+static int do_fractal(struct filter *f, int flags, int /*@unused@ */ time)
+{
+ number_t *posptr;
+ int maxres;
+ int size;
+ int rflags = 0;
+ realloc_t *r, *rend;
+
+ f->image->flip(f->image);
+ cfilter = *f;
+ set_fractalc(f->fractalc, f->image);
+
+ if (getzcontext(f)->forversion != f->fractalc->version ||
+ getzcontext(f)->newcalc ||
+ getzcontext(f)->forpversion != f->image->palette->version) {
+ clear_image(f->image);
+ free_tables(f);
+ if (!alloc_tables(f))
+ return 0;
+ init_tables(f);
+ getzcontext(f)->newcalc = 0;
+ getzcontext(f)->forversion = getfcontext(f)->version;
+ getzcontext(f)->forpversion = f->image->palette->version;
+ czoomc = *getzcontext(f);
+ if (BTRACEOK && !(flags & INTERRUPTIBLE)) {
+ boundarytraceall(czoomc.xpos, czoomc.ypos);
+ f->flags &= ~ZOOMMASK;
+ return CHANGED | (cfilter.interrupt ? UNCOMPLETTE : 0);
+ }
+ } else
+ rflags |= INEXACT;
+
+ czoomc = *getzcontext(f);
+
+ setuncomplette(0);
+ setchanged(0);
+
+ maxres = cimage.width;
+ if (maxres < cimage.height)
+ maxres = cimage.height;
+ size =
+ ALIGN((maxres) * (DSIZE + 1) * (int) sizeof(struct dyn_data)) +
+ 2 * ALIGN(maxres * (int) sizeof(struct dyn_data **)) +
+ ALIGN((maxres + 2) * (int) sizeof(int));
+#ifdef HAVE_ALLOCA
+ tmpdata = (unsigned char *) alloca(size);
+#else
+ tmpdata = (unsigned char *) malloc(size);
+#endif
+ if (tmpdata == NULL) {
+ x_error
+ ("XaoS fatal error:Could not allocate memory for temporary data of size %i. "
+ "I am unable to handle this problem so please resize to smaller window.",
+ size);
+ return 0;
+ }
+ if (nthreads != 1) {
+#ifdef HAVE_ALLOCA
+ tmpdata1 = (unsigned char *) alloca(size);
+#else
+ tmpdata1 = (unsigned char *) malloc(size);
+#endif
+ if (tmpdata1 == NULL) {
+ x_error
+ ("XaoS fatal error:Could not allocate memory for temporary data of size %i. "
+ "I am unable to handle this problem so please resize to smaller window",
+ size);
+ return 0;
+ }
+ } else
+ tmpdata1 = tmpdata;
+
+ cfilter.incalculation = 0;
+ cfilter.readyforinterrupt = 0;
+ cfilter.interrupt = 0;
+
+ nsymetrized = 0;
+ cfilter.max = 0;
+ cfilter.pos = 0;
+ cfilter.pass = "Making y realloc table";
+ xth_bgjob(startbgmkrealloc, NULL);
+
+ cfilter.pass = "Making x realloc table";
+ mkrealloc_table(czoomc.xpos, czoomc.reallocx,
+ (unsigned int) cimage.width, cfractalc.rs.nc,
+ cfractalc.rs.mc, cursymetry.xsym, tmpdata);
+
+ callwait();
+
+ cfilter.pass = "Moving old points";
+ callwait();
+ preparemoveoldpoints();
+ xth_sync();
+#ifdef _NEVER_
+ {
+ static long long sum2, sum;
+ cli();
+ startagi();
+ sum -= rdtsc();
+ sum2 -= countagi();
+ xth_function(moveoldpoints, NULL, cimage.height);
+ sum += rdtsc();
+ sum2 += countagi();
+ sti();
+ printf("%i %i\n", (int) sum, (int) sum2);
+ }
+#else
+ xth_function(moveoldpoints, NULL, cimage.height);
+#endif
+
+ cfilter.pass = "Starting calculation";
+ callwait();
+ xth_sync();
+ if (flags & INTERRUPTIBLE)
+ calculatenewinterruptible();
+ else {
+ xth_function(calculatenew, NULL, 1);
+ if (cfilter.interrupt) {
+ getzcontext(f)->uncomplette = 1;
+ }
+ cfilter.pos = 0;
+ cfilter.max = 0;
+ cfilter.pass = "Procesing symetries";
+ callwait();
+ xth_sync();
+ if (nsymetrized) {
+ xth_function(dosymetry, NULL, cimage.height);
+ xth_sync();
+ drivercall(cimage,
+ xth_function(dosymetry2_8, NULL, cimage.width),
+ xth_function(dosymetry2_16, NULL, cimage.width),
+ xth_function(dosymetry2_24, NULL, cimage.width),
+ xth_function(dosymetry2_32, NULL, cimage.width));
+ xth_sync();
+ }
+ if (getzcontext(f)->uncomplette) {
+ fill();
+ }
+ }
+ for (r = czoomc.reallocx, posptr = czoomc.xpos, rend =
+ czoomc.reallocx + cimage.width; r < rend; r++, posptr++) {
+ *posptr = r->possition;
+ }
+ for (r = czoomc.reallocy, posptr = czoomc.ypos, rend =
+ czoomc.reallocy + cimage.height; r < rend; r++, posptr++) {
+ *posptr = r->possition;
+ }
+#ifdef STATISTICS
+ STAT(printf("Statistics: frames %i\n"
+ "mkrealloctable: added %i, symetry %i\n"
+ "calculate loop: tocalculate %i avoided %i\n"
+ "calculate:calculated %i inside %i\n"
+ "iters inside:%i iters outside:%i periodicty:%i\n",
+ frames2, nadded2, nsymetry2, tocalculate2, avoided2,
+ ncalculated2, ninside2, niter2, niter1, nperi));
+#endif
+ f->flags &= ~ZOOMMASK;
+ if (getzcontext(f)->uncomplette)
+ rflags |= UNCOMPLETTE, f->flags |= UNCOMPLETTE;
+ if (getzcontext(f)->uncomplette > (cimage.width + cimage.height) / 2)
+ f->flags |= LOWQUALITY;
+ if (getzcontext(f)->changed)
+ rflags |= CHANGED;
+#ifndef HAVE_ALLOCA
+ free(tmpdata);
+ if (nthreads != 1)
+ free(tmpdata1);
+#endif
+ return rflags;
+}
+
+
+static struct filter *getinstance(CONST struct filteraction *a)
+{
+ struct filter *f = createfilter(a);
+ f->data = make_context();
+ f->name = "Zooming engine";
+ return (f);
+}
+
+static void destroyinstance(struct filter *f)
+{
+ free_context(f);
+ free(f);
+}
+
+static int requirement(struct filter *f, struct requirements *r)
+{
+ r->nimages = 2;
+ r->supportedmask =
+ C256 | TRUECOLOR | TRUECOLOR24 | TRUECOLOR16 | LARGEITER |
+ SMALLITER | GRAYSCALE;
+ r->flags = IMAGEDATA | TOUCHIMAGE;
+ return (f->next->action->requirement(f->next, r));
+}
+
+static int initialize(struct filter *f, struct initdata *i)
+{
+#ifdef USE_MULTABLE
+ if (!multable[0]) {
+ int i;
+ mulmid = multable + RANGE * FPMUL;
+ for (i = -RANGE * FPMUL; i < RANGE * FPMUL; i++)
+ mulmid[i] = i * i;
+ }
+#endif
+ inhermisc(f, i);
+ if (i->image != f->image || datalost(f, i))
+ getzcontext(f)->forversion = -1, f->image = i->image;
+ f->imageversion = i->image->version;
+ return (1);
+}
+
+CONST struct filteraction zoom_filter = {
+ "XaoS's zooming engine",
+ "zoom",
+ 0,
+ getinstance,
+ destroyinstance,
+ do_fractal,
+ requirement,
+ initialize,
+ convertupgeneric,
+ convertdowngeneric,
+ NULL,
+};
diff --git a/src/engine/zoomd.c b/src/engine/zoomd.c
new file mode 100644
index 0000000..ef3b965
--- /dev/null
+++ b/src/engine/zoomd.c
@@ -0,0 +1,309 @@
+#ifndef UNSUPPORTED
+
+/* this two routines implements solid guessing. They are almost same. One
+ * caluclates lines, second rows.
+ *
+ * The heruistic is as follows:
+ *
+ * ---1------6------5------- (vbuffu)
+ * | | |
+ * ===7======X======8======= (vbuff1)
+ * | | |
+ * ---2------3------4------- (vbuffd)
+ * distdown rx distup
+ *
+ * -- and | means calculated lines. == is current line, names are pointers to
+ * them. Note that naming is quite confusing, because it is same in lines and
+ * rows.
+ *
+ * we do solid guessing as folows:
+ * |distl-vbuff1| < range
+ * |distr-vbuff1| < range
+ * the distance of distup and distdown is not limited, because we already
+ * have exact enought guesses 3 and 6
+ *
+ * points 1 2 3 4 5 6 8 must be the same (point 8 is not yet calculated)
+ *
+ */
+static void calcline(realloc_t * RESTRICT ry) REGISTERS(3);
+REGISTERS(3)
+static void calcline(realloc_t * RESTRICT ry)
+{
+ number_t y;
+ int range = cfractalc.range;
+ realloc_t *RESTRICT rx, *rend, *rend1, *ryl, *ryr;
+ int distl, distr, distup, distdown;
+ cpixel_t *RESTRICT vbuff, *RESTRICT vbuffu, *RESTRICT vbuffd;
+ cpixeldata_t inset = (cpixeldata_t) cpalette.pixels[0];
+ cpixeldata_t c;
+ cppixel_t *vbuff1 =
+ (cpixel_t **) cimage.currlines + (ry - czoomc.reallocy);
+ assert(ry >= czoomc.reallocy);
+ assert(ry < czoomc.reallocy + cimage.height);
+ y = ry->possition;
+ rend = ry - range - 1;
+ if (czoomc.reallocy > rend)
+ rend = czoomc.reallocy;
+ for (ryl = ry - 1; rend <= ryl && ryl->dirty; ryl--);
+ distl = (int) (ryl - ry);
+ rend = ry + range;
+ if (czoomc.reallocy + cimage.height < rend)
+ rend = czoomc.reallocy + cimage.height;
+ for (ryr = ry + 1; rend > ryr && ryr->dirty; ryr++);
+ distr = (int) (ryr - ry);
+ rend = czoomc.reallocy + cimage.height;
+ if (ryr == czoomc.reallocy + cimage.height || ryl < czoomc.reallocy
+ || ryr->dirty || ryl->dirty) {
+ for (rx = czoomc.reallocx, vbuff = *vbuff1,
+ rend1 = czoomc.reallocx + cimage.width; rx < rend1; rx++) {
+ if (!rx->dirty) {
+ STAT(tocalculate++);
+ p_set(vbuff,
+ (cpixeldata_t) calculate(rx->possition, y,
+ cfractalc.periodicity));
+#ifdef DRAW
+ vga_setcolor(0xff0000);
+ vga_drawpixel(rx - czoomc.reallocx, ry - czoomc.reallocy);
+#endif
+ }
+ p_inc(vbuff, 1);
+ }
+ } else {
+ distup = INT_MAX / 2;
+ distdown = 0;
+ for (rx = czoomc.reallocx,
+ vbuff = vbuff1[0], vbuffu = vbuff1[distl], vbuffd =
+ vbuff1[distr], rend1 = czoomc.reallocx + cimage.width;
+ rx < rend1; rx++) {
+ assert(rx < czoomc.reallocx + cimage.width);
+ assert(rx >= czoomc.reallocx);
+ if (!rx->dirty) {
+ STAT(tocalculate++);
+ if (distdown <= 0) {
+ for (ryr = rx + 1; ryr < rend1 && ryr->dirty; ryr++);
+ distdown = (int) (ryr - rx);
+ if (ryr == rend1)
+ distdown = INT_MAX / 2;
+ }
+ if (distdown < INT_MAX / 4 && distup < INT_MAX / 4 &&
+ (p_get(vbuffu) == (c = p_get(vbuffd)) &&
+ c == p_getp(vbuff, -distup) &&
+ c == p_getp(vbuffu, -distup) &&
+ c == p_getp(vbuffu, distdown) &&
+ c == p_getp(vbuffd, distdown) &&
+ c == p_getp(vbuffd, -distup))) {
+ p_set(vbuff, c);
+ STAT(avoided++);
+ } else {
+ if (cfractalc.periodicity &&
+ distdown < INT_MAX / 4 && distup < INT_MAX / 4 &&
+ (p_get(vbuffu) != inset &&
+ p_get(vbuffd) != inset &&
+ p_getp(vbuff, -distup) != inset &&
+ p_getp(vbuffu, -distup) != inset &&
+ p_getp(vbuffu, +distdown) != inset &&
+ p_getp(vbuffd, -distup) != inset &&
+ p_getp(vbuffd, +distdown) != inset))
+ p_set(vbuff,
+ (cpixeldata_t) calculate(rx->possition, y,
+ 0));
+ else
+ p_set(vbuff,
+ (cpixeldata_t) calculate(rx->possition, y,
+ cfractalc.
+ periodicity));
+#ifdef DRAW
+ vga_setcolor(0xffffff);
+ vga_drawpixel(rx - czoomc.reallocx,
+ ry - czoomc.reallocy);
+#endif
+ }
+ distup = 0;
+ }
+ p_inc(vbuff, 1);
+ p_inc(vbuffu, 1);
+ p_inc(vbuffd, 1);
+ distdown--;
+ distup++;
+ }
+ }
+ ry->recalculate = 0;
+ ry->dirty = 0;
+}
+
+static void calccolumn(realloc_t * RESTRICT rx) REGISTERS(3);
+REGISTERS(3)
+static void calccolumn(realloc_t * RESTRICT rx)
+{
+ number_t x;
+ int range = cfractalc.range;
+ realloc_t *RESTRICT ry, *rend, *rend1, *rxl, *rxr;
+ int pos, distl, distr, distup, distdown;
+ cpixeldata_t c;
+ cpixeldata_t inset = (cpixeldata_t) cpalette.pixels[0];
+ cppixel_t *RESTRICT vbuff;
+ pos = (int) (rx - czoomc.reallocx);
+ assert(pos >= 0);
+ assert(pos < cimage.width);
+ rend = rx - range + 1;
+ if (czoomc.reallocx > rend)
+ rend = czoomc.reallocx;
+ for (rxl = rx - 1; rend <= rxl && rxl->dirty; rxl--);
+ distl = (int) (rx - rxl);
+ rend = rx + range;
+ if (czoomc.reallocx + cimage.width < rend)
+ rend = czoomc.reallocx + cimage.width;
+ for (rxr = rx + 1; rxr < rend && rxr->dirty; rxr++);
+ distr = (int) (rxr - rx);
+ x = rx->possition;
+ rend = czoomc.reallocx + cimage.width;
+ if (rxr >= czoomc.reallocx + cimage.width || rxl < czoomc.reallocx
+ || rxr->dirty || rxl->dirty) {
+ for (ry = czoomc.reallocy, vbuff =
+ (cppixel_t *) cimage.currlines, rend1 =
+ czoomc.reallocy + cimage.height; ry < rend1; ry++, vbuff++) {
+ if (!ry->dirty) {
+ STAT(tocalculate++);
+ p_setp((*vbuff), pos,
+ (cpixeldata_t) calculate(x, ry->possition,
+ cfractalc.periodicity));
+#ifdef DRAW
+ vga_setcolor(0xff0000);
+ vga_drawpixel(rx - czoomc.reallocx, ry - czoomc.reallocy);
+#endif
+ }
+ }
+ } else {
+ distl = pos - distl;
+ distr = pos + distr;
+ assert(distl >= 0);
+ assert(distr < cimage.width);
+ distup = INT_MAX / 2;
+ distdown = 0;
+ for (ry = czoomc.reallocy, vbuff =
+ (cppixel_t *) cimage.currlines, rend1 =
+ czoomc.reallocy + cimage.height; ry < rend1; ry++) {
+ /*if (ry->symto == -1) { */
+ assert(ry < czoomc.reallocy + cimage.height);
+ if (!ry->dirty) {
+ STAT(tocalculate++);
+ if (distdown <= 0) {
+ for (rxr = ry + 1; rxr < rend1 && rxr->dirty; rxr++);
+ distdown = (int) (rxr - ry);
+ if (rxr == rend1)
+ distdown = INT_MAX / 2;
+ }
+ if (distdown < INT_MAX / 4 && distup < INT_MAX / 4 &&
+ (p_getp(vbuff[0], distl) ==
+ (c = p_getp(vbuff[0], distr))
+ && p_getp(vbuff[-distup], distl) == c
+ && p_getp(vbuff[-distup], distr) == c
+ && p_getp(vbuff[-distup], pos) == c
+ && p_getp(vbuff[distdown], distr) == c
+ && p_getp(vbuff[distdown], distl) == c)) {
+ STAT(avoided++);
+ p_setp(vbuff[0], pos, c);
+ } else {
+ if (cfractalc.periodicity &&
+ distdown < INT_MAX / 4 && distup < INT_MAX / 4 &&
+ (p_getp(vbuff[0], distl) != inset &&
+ p_getp(vbuff[0], distr) != inset &&
+ p_getp(vbuff[distdown], distr) != inset &&
+ p_getp(vbuff[distdown], distl) != inset &&
+ p_getp(vbuff[-distup], distl) != inset &&
+ p_getp(vbuff[-distup], pos) != inset &&
+ p_getp(vbuff[-distup], distr) != inset))
+ p_setp(vbuff[0], pos,
+ (cpixeldata_t) calculate(x, ry->possition,
+ 0));
+ else
+ p_setp(vbuff[0], pos,
+ (cpixeldata_t) calculate(x, ry->possition,
+ cfractalc.
+ periodicity));
+#ifdef DRAW
+ vga_setcolor(0xffffff);
+ vga_drawpixel(rx - czoomc.reallocx,
+ ry - czoomc.reallocy);
+#endif
+ }
+ distup = 0;
+ }
+ vbuff++;
+ distdown--;
+ distup++;
+ }
+ }
+ rx->recalculate = 0;
+ rx->dirty = 0;
+}
+
+static /*INLINE */ void
+dosymetry2(void /*@unused@ */ *data, struct taskinfo /*@unused@ */ *task,
+ int r1, int r2)
+{
+ cpixel_t **vbuff = (cpixel_t **) cimage.currlines;
+ realloc_t *rx, *rend;
+ cpixel_t **vend = (cpixel_t **) cimage.currlines + cimage.height;
+ for (rx = czoomc.reallocx + r1, rend = czoomc.reallocx + r2; rx < rend;
+ rx++) {
+ assert(rx->symto >= 0 || rx->symto == -1);
+ if (rx->symto >= 0) {
+ assert(rx->symto < cimage.width);
+ if (!czoomc.reallocx[rx->symto].dirty) {
+ int pos = (int) (rx - czoomc.reallocx);
+ int pos1 = rx->symto;
+ vbuff = (cpixel_t **) cimage.currlines;
+ for (; vbuff < vend; vbuff++)
+ p_copy(vbuff[0], pos, vbuff[0], pos1);
+ rx->dirty = 0;
+ }
+ }
+ }
+}
+
+#ifndef USE_i386ASM
+/*
+ * Fill - bitmap depended part.
+ *
+ * This function is called, when calculation was interrupted because of
+ * timeout. It fills uncalculated rows by nearest one
+ *
+ * This function is very time critical in higher resultions I am shooting
+ * for.
+ */
+#ifndef __GNUC__
+#undef bpp1
+#endif
+#ifndef __i386__
+#undef bpp1
+#endif
+#undef bpp1
+
+static INLINE void fillline(int line)
+{
+ register unsigned char *RESTRICT vbuff = cimage.currlines[line];
+ CONST struct filltable *RESTRICT table = (struct filltable *) tmpdata;
+ while (table->length) {
+ register cpixeldata_t s =
+ p_get((cpixel_t *) (vbuff + table->from));
+ register cpixel_t *vcurr = (cpixel_t *) (vbuff + table->to);
+#ifdef bpp1
+ memset(vcurr, s, table->length);
+#else
+ register cpixel_t *vend = (cpixel_t *) (vbuff + table->end);
+ while (vcurr < vend) {
+ p_set(vcurr, s);
+ p_inc(vcurr, 1);
+ }
+#endif
+ table++;
+ }
+}
+#endif
+#endif
+#undef dosymetry2
+#undef calcline
+#undef calccolumn
+#undef fillline
+#undef rend
diff --git a/src/filter/Makefile.in b/src/filter/Makefile.in
new file mode 100644
index 0000000..6786158
--- /dev/null
+++ b/src/filter/Makefile.in
@@ -0,0 +1,45 @@
+CC = @CC@
+CFLAGS = @CFLAGS@
+LIBS = @LIBS@ -lm
+LFLAGS = @LDFLAGS@
+AR = @AR@
+RANLIB = @RANLIB@
+
+SRCS = image.c \
+ palette.c \
+ random.c \
+ grlib.c \
+ font.c \
+ filter.c
+
+OBJS = $(SRCS:.c=.o)
+
+TLIB = ../lib/libfilter.a
+
+grlib.o: grlibd.c
+
+all: $(TLIB)
+
+$(TLIB):$(OBJS)
+ rm -f $@
+ $(AR) rc $@ $(OBJS)
+ $(RANLIB) $@
+
+clean:
+ rm -f $(TLIB)
+ rm -f *.[oas]
+ rm -f *~
+ rm -f core
+
+distclean:clean
+ rm Makefile
+
+#dep:
+# rm -f .depend
+# make .depend
+#
+#.depend:
+# echo '# Program dependencies' >.depend
+# gcc -I svgalib $(DEFINES) -MM $(patsubst %.o,%.c,$(OBJS)) >>.depend
+#
+#include .depend
diff --git a/src/filter/filter.c b/src/filter/filter.c
new file mode 100644
index 0000000..c851571
--- /dev/null
+++ b/src/filter/filter.c
@@ -0,0 +1,297 @@
+#include <config.h>
+#ifndef _plan9_
+#ifdef NO_MALLOC_H
+#include <stdlib.h>
+#else
+#include <malloc.h>
+#endif
+#else
+#include <u.h>
+#include <libc.h>
+#endif
+#include <stdio.h>
+#include <filter.h>
+/*#define DEBUG */
+struct queue *create_queue(struct filter *f)
+{
+ struct queue *q = (struct queue *) calloc(1, sizeof(struct queue));
+ q->first = q->last = f;
+ f->queue = q;
+ f->next = f->previous = NULL;
+ return (q);
+}
+
+void insertfilter(struct filter *f1, struct filter *f2)
+{
+ f1->next = f2;
+ f1->queue = f2->queue;
+ f1->queue->isinitialized = 0;
+ f1->previous = f2->previous;
+ if (f2->previous != NULL)
+ f2->previous->next = f1;
+ else
+ f2->queue->first = f1;
+ f2->previous = f1;
+}
+
+void addfilter(struct filter *f1, struct filter *f2)
+{
+ f1->previous = f2;
+ f1->queue = f2->queue;
+ f1->queue->isinitialized = 0;
+ f1->next = f2->next;
+ if (f2->next != NULL)
+ f2->next->previous = f1;
+ else
+ f2->queue->last = f1;
+ f2->next = f1;
+}
+
+void removefilter(struct filter *f)
+{
+ if (f->action->removefilter != NULL)
+ f->action->removefilter(f);
+ if (f->previous != NULL)
+ f->previous->next = f->next;
+ else
+ f->queue->first = f->next;
+ if (f->next != NULL)
+ f->next->previous = f->previous;
+ else
+ f->queue->last = f->previous;
+ f->queue->isinitialized = 0;
+}
+
+int initqueue(struct queue *q)
+{
+ struct requirements noreq = { 0, ALLMASK, 0 };
+ struct initdata init = { NULL, 0 };
+#ifdef DEBUG
+ printf("\n\nInitializing queue\n");
+#endif
+ q->palettechg = NULL;
+ if (!q->first->action->requirement(q->first, &noreq))
+ return 0;
+ if (!q->last->action->initialize(q->last, &init))
+ return 0;
+ q->isinitialized = 1;
+#ifdef DEBUG
+ printf("Correctly initialized\n");
+#endif
+ return 1;
+}
+
+int
+reqimage(struct filter *f, struct requirements *req, int supportedmask,
+ int flags)
+{
+ f->req = *req;
+ req->supportedmask &= supportedmask;
+ if (!req->supportedmask)
+ return 0;
+ if (flags & TOUCHIMAGE && req->flags & IMAGEDATA) {
+ req->flags = flags;
+ } else
+ req->flags &= flags;
+ return 1;
+}
+
+/* An function helping to filter create new image.
+ * It should be called by filter in inicialization. Filter passes
+ * width,height,pixelwidth, pixelheight
+ * and palette he wants to pass to his child and flags defining how it works
+ * with image(IMAGEDATA if it requires data from previous frames (like blur
+ * filter, TOUCHIMAGE if it changes data in image(like blur or stereogram
+ * filter but unlike interlace and NEWIMAGE if it strictly requires to create
+ * new image)
+ * As palette he should pass NULL to keep parents palette. Same as
+ * (pixel)width/height should be passed 0;
+ *
+ * Function then aplies some heruistic in order to minimize memory
+ * requirements. So it should share image, create image that shares image data
+ * or create new image)
+ *
+ * fills f->image, f->childimage and returns 1 if sucess and 0 if fail(usually
+ * out of memory or it is unable to fit child's requirements)
+ * and prepares data for child call.
+ */
+int
+inherimage(struct filter *f, struct initdata *data, int flags, int width,
+ int height, struct palette *palette, float pixelwidth,
+ float pixelheight)
+{
+ int newimage = 0;
+ int subimage = 1;
+ int sharedimage = 1;
+ struct image *i;
+
+ int ddatalost = 0;
+ if (width == 0)
+ width = data->image->width;
+ if (height == 0)
+ height = data->image->height;
+#ifdef DEBUG
+ printf("Inherimage:%s %i %i imagedata:%i %i\n", f->name, width, height,
+ flags & IMAGEDATA, flags & PROTECTBUFFERS);
+#endif
+ if (pixelwidth == 0)
+ pixelwidth = data->image->pixelwidth;
+ if (pixelheight == 0)
+ pixelheight = data->image->pixelheight;
+ if (palette == NULL)
+ palette = data->image->palette;
+ if (!(palette->type & f->req.supportedmask)) {
+#ifdef DEBUG
+ printf
+ ("Initalization of filter %s failed due to unsupported type by child %s-%i,%i\n",
+ f->name, f->previous->name, f->req.supportedmask,
+ palette->type);
+#endif
+ f->image = data->image;
+ return 0;
+ }
+
+ if (flags & NEWIMAGE)
+ newimage = 1, sharedimage = 0, subimage = 0;
+ if ((flags & IMAGEDATA) /*|| (data->image->flags & PROTECTBUFFERS) */ )
+ subimage = 0, sharedimage = 0, newimage = 1;
+ /*if filter touches data but child requires them, create separated image */
+ if ((flags & TOUCHIMAGE)
+ && ((f->req.flags & IMAGEDATA)
+ || (data->image->flags & PROTECTBUFFERS)))
+ subimage = 0, newimage = 1, sharedimage = 0;
+ /*if required image differs in size or so */
+ if (width != data->image->width || height != data->image->height ||
+ palette != data->image->palette)
+ newimage = 1, sharedimage = 0;
+
+ if (f->childimage != NULL && (f->flags & ALLOCEDIMAGE)) {
+ /*is an old child image still useable for us purposes? if not burn it it! */
+ /*We should share image? Why alloc new?? */
+ if (!newimage && (f->flags & ALLOCEDIMAGE))
+ destroyinheredimage(f), ddatalost = 1;
+ /*We should share data? but child image dont do that! */
+ if (subimage && !(f->flags & SHAREDDATA))
+ destroyinheredimage(f), ddatalost = 1;
+ /*We can't share data but child image does that? */
+ if (!subimage && (f->flags & SHAREDDATA))
+ destroyinheredimage(f), ddatalost = 1;
+ /*When image changed, child image must be recreated too */
+ if (f->flags & SHAREDDATA && ((data->flags & DATALOST)
+ || f->imageversion !=
+ data->image->version))
+ destroyinheredimage(f), ddatalost = 1;
+ /*We should share image with filter? Why keep created new one? */
+ if (sharedimage)
+ destroyinheredimage(f), ddatalost = 1;
+ /*When child image don't fit out needs */
+ if (f->childimage != NULL
+ && (f->childimage->width != width
+ || f->childimage->height != height
+ || f->childimage->palette != palette
+ || f->childimage->bytesperpixel !=
+ bytesperpixel(palette->type)
+ || f->childimage->nimages < f->req.nimages))
+ destroyinheredimage(f), ddatalost = 1;
+ /*Well now child image seems to be heavily probed */
+ }
+ i = f->childimage;
+ if (newimage) { /*Create new image when required */
+ if (!(f->flags & ALLOCEDIMAGE)) {
+ if (subimage) {
+ i = create_subimage(data->image, width, height,
+ f->req.nimages, palette, pixelwidth,
+ pixelheight);
+ f->flags |= ALLOCEDIMAGE | SHAREDDATA;
+ ddatalost = 1;
+ } else {
+ i = create_image_mem(width, height, f->req.nimages,
+ palette, pixelwidth, pixelheight);
+ f->flags |= ALLOCEDIMAGE;
+ ddatalost = 1;
+ }
+ }
+ }
+#ifdef DEBUG
+ printf("Filter:%s newimage:%i subimage:%i sharedimage:%i\n", f->name,
+ newimage, subimage, sharedimage);
+#endif
+ if (i == NULL) {
+ f->image = data->image;
+ return 0;
+ }
+ if (sharedimage)
+ i = data->image, ddatalost = (data->flags & DATALOST)
+ || (f->childimage != data->image);
+ if (sharedimage && datalost(f, data))
+ ddatalost = 1;
+ else if ((f->flags | SHAREDDATA) && datalost(f, data)
+ && !(i->flags & FREEDATA))
+ ddatalost = 1;
+ if (ddatalost)
+ data->flags |= DATALOST;
+ else
+ data->flags &= ~DATALOST;
+ f->image = data->image;
+ f->childimage = i;
+ f->imageversion = data->image->version;
+ data->image = i;
+#ifdef DEBUG
+ printf("OK %i datalost:%i\n", f->flags, ddatalost);
+#endif
+#ifdef DEBUG
+ printf("Inherimage2:%s %i %i\n", f->name, width, height);
+#endif
+ return 1;
+}
+
+void destroyinheredimage(struct filter *f)
+{
+ if (f->flags & ALLOCEDIMAGE)
+ destroy_image(f->childimage), f->flags &=
+ ~(ALLOCEDIMAGE | SHAREDDATA), f->childimage = NULL;
+}
+
+void updateinheredimage(struct filter *f)
+{
+ if ((f->flags & SHAREDDATA) && f->childimage) {
+ if (f->childimage->nimages == 2
+ && f->image->currimage != f->childimage->currimage)
+ f->childimage->flip(f->childimage); /*Hack for interlace filter */
+ }
+}
+
+void inhermisc(struct filter *f, CONST struct initdata *data)
+{
+ f->wait_function = data->wait_function;
+ f->fractalc = data->fractalc;
+}
+
+struct filter *createfilter(CONST struct filteraction *fa)
+{
+ struct filter *f = (struct filter *) calloc(1, sizeof(struct filter));
+ if (f == NULL)
+ return NULL;
+ f->queue = NULL;
+ f->next = NULL;
+ f->childimage = NULL;
+ f->flags = 0;
+ f->previous = NULL;
+ f->action = fa;
+ f->image = NULL;
+ f->req.nimages = 1;
+ f->data = NULL;
+ return (f);
+}
+
+void convertupgeneric(struct filter *f, int *x, int *y)
+{
+ if (f->next != NULL)
+ f->next->action->convertup(f->next, x, y);
+}
+
+void convertdowngeneric(struct filter *f, int *x, int *y)
+{
+ if (f->previous != NULL)
+ f->previous->action->convertdown(f->previous, x, y);
+}
diff --git a/src/filter/filter.pri b/src/filter/filter.pri
new file mode 100644
index 0000000..8746a51
--- /dev/null
+++ b/src/filter/filter.pri
@@ -0,0 +1,10 @@
+SOURCES += \
+ $$PWD/image.c \
+ $$PWD/palette.c \
+ $$PWD/random.c \
+ $$PWD/grlib.c \
+ $$PWD/font.c \
+ $$PWD/filter.c \
+
+OTHER_FILES += \
+ $$PWD/grlibd.c
diff --git a/src/filter/font.c b/src/filter/font.c
new file mode 100644
index 0000000..c478029
--- /dev/null
+++ b/src/filter/font.c
@@ -0,0 +1,1814 @@
+#include <config.h>
+#include "xfont16.c"
+#include "xfont32.c"
+#include "xfont48.c"
+
+CONST unsigned char xfont14[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd, 0x99, 0x81, 0x81, 0x7e,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x7e, 0xff, 0xdb, 0xff, 0xff, 0xc3, 0xe7, 0xff, 0xff, 0x7e,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, 0x18, 0x3c,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00,
+ 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff,
+ 0xff, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00,
+ 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xff,
+ 0xff,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 0x3c, 0x18, 0x7e,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xfe, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x6c, 0xfe, 0x6c, 0x28, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c, 0x38, 0x38, 0x10, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
+ 0x00, 0x00,
+ 0x00, 0xc6, 0xc6, 0xc6, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c,
+ 0x00, 0x00,
+ 0x18, 0x18, 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0xc6, 0x7c,
+ 0x18, 0x18,
+ 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18, 0x30, 0x60, 0xc6, 0x86,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76,
+ 0x00, 0x00,
+ 0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0c,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18,
+ 0x30, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xd6, 0xd6, 0xc6, 0xc6, 0x6c, 0x38,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x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 0x00,
+ 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x1c, 0x36, 0x32, 0x30, 0x78, 0x30, 0x30, 0x30, 0x30, 0x78,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c,
+ 0xcc, 0x78,
+ 0x00, 0x00, 0xe0, 0x60, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x66,
+ 0x66, 0x3c,
+ 0x00, 0x00, 0xe0, 0x60, 0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0xfe, 0xd6, 0xd6, 0xd6, 0xd6, 0xc6,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x7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18, 0x18, 0x18, 0x18, 0x70,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0xfe, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xce,
+ 0x0c, 0x06,
+ 0x00, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x78, 0x30, 0x3c, 0x38, 0x30, 0x70, 0xf0, 0xb2, 0x36, 0x7e,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0x7c, 0xc6,
+ 0x00, 0x00,
+ 0xd8, 0x70, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 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 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
+ 0x30, 0x1c,
+ 0x00, 0x00, 0x38, 0x18, 0x1e, 0x1c, 0x18, 0x38, 0x78, 0xd8, 0x18, 0x3c,
+ 0x00, 0x00,
+ 0x00, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x1e, 0xec, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0xf0,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x0c, 0x18, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c,
+ 0x00, 0x00,
+ 0x00, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
+ 0x18, 0x70,
+ 0x00, 0x00, 0x6c, 0x38, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c,
+ 0x18, 0x78,
+ 0x6c, 0x38, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x36, 0x1c,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x30, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe,
+ 0x00, 0x00,
+ 0x00, 0x36, 0x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x6c, 0x38, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe,
+ 0x00, 0x00,
+ 0x00, 0x00, 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 0xc6, 0xfe, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x18, 0x18, 0x3c, 0x3c, 0x18, 0x00,
+ 0x18, 0x18, 0x7e, 0xc0, 0xc0, 0x7e, 0x18, 0x18,
+ 0x38, 0x6c, 0x64, 0xf0, 0x60, 0x66, 0xfc, 0x00,
+ 0x00, 0xc6, 0x7c, 0xc6, 0xc6, 0x7c, 0xc6, 0x00,
+ 0x66, 0x66, 0x3c, 0x7e, 0x18, 0x7e, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x18,
+ 0x3e, 0x61, 0x3c, 0x66, 0x66, 0x3c, 0x86, 0x7c,
+ 0x00, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x7e, 0x81, 0x9d, 0xa1, 0xa1, 0x9d, 0x81, 0x7e,
+ 0x3c, 0x6c, 0x6c, 0x3e, 0x00, 0x7e, 0x00, 0x00,
+ 0x00, 0x33, 0x66, 0xcc, 0x66, 0x33, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xfe, 0x06, 0x06, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
+ 0x7e, 0x81, 0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xff, 0xff, 0x7e,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, 0x18, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0x00, 0x00, 0x1e, 0x0e, 0x1a, 0x32, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x18,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x30, 0x30, 0x70, 0xf0, 0xe0,
+ 0x00, 0x00, 0x00, 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0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xfe, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x6c, 0xfe, 0x6c, 0x28, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c, 0x38, 0x38, 0x10, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x18, 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0xc6, 0x7c,
+ 0x18, 0x18, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18, 0x30, 0x60, 0xc6, 0x86,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18,
+ 0x30, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x38, 0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0x00, 0x00, 0x00, 0x18, 0x18, 0x30,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x06,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x60,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xde, 0xde, 0xde, 0xdc, 0xc0, 0x7c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xf8, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x60, 0x60, 0xf0,
+ 0x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
+ 0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xff, 0x00, 0x00,
+ 0x00, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xe0, 0x60, 0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x1c, 0x36, 0x32, 0x30, 0x78, 0x30, 0x30, 0x30, 0x30, 0x78,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c,
+ 0x0c, 0xcc, 0x78, 0x00,
+ 0x00, 0x00, 0xe0, 0x60, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x66, 0x66, 0x3c, 0x00,
+ 0x00, 0x00, 0xe0, 0x60, 0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0xfe, 0xd6, 0xd6, 0xd6, 0xd6, 0xc6,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c,
+ 0x60, 0x60, 0xf0, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c,
+ 0x0c, 0x0c, 0x1e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x6c, 0x38,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x6c, 0x38, 0x38, 0x38, 0x6c, 0xc6,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e,
+ 0x06, 0x0c, 0xf8, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0e,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x70, 0x18, 0x18, 0x18, 0x0e, 0x18, 0x18, 0x18, 0x18, 0x70,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0xfe, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x3c, 0x18,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x18, 0x7c, 0xc6, 0xc0, 0xc0, 0xc6, 0x7c, 0x18, 0x18,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xe6, 0xfc,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0xc6,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x7e, 0x18, 0x18,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
+ 0x18, 0x00, 0x00, 0x00,
+ 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0xc6,
+ 0x7c, 0x00, 0x00, 0x00,
+ 0x00, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x7c, 0x82, 0x9a, 0xa2, 0xa2, 0xa2, 0x9a, 0x82, 0x7c, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x3c, 0x6c, 0x6c, 0x3e, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0xd8, 0x6c, 0x36, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0x06, 0x06, 0x06, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x7c, 0x82, 0xb2, 0xaa, 0xb2, 0xaa, 0xaa, 0x82, 0x7c, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x7e,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x3c, 0x66, 0x0c, 0x18, 0x32, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x7c, 0x06, 0x3c, 0x06, 0x06, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c,
+ 0x60, 0x60, 0xc0, 0x00,
+ 0x00, 0x00, 0x7f, 0xdb, 0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
+ 0x0c, 0x78, 0x00, 0x00,
+ 0x00, 0x18, 0x38, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00,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
+ 0x00, 0x00, 0x00, 0x00,
+ 0x38, 0x6c, 0x38, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x3e, 0x6c, 0xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xcc, 0xce,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c,
+ 0x18, 0x70, 0x00, 0x00,
+ 0x30, 0x18, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x0c, 0x18, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x38, 0x6c, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xc6, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x30, 0x18, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x0c, 0x18, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x3c, 0x66, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x66, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 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0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x36, 0x36, 0x7e, 0xd8, 0xd8, 0x6e,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c,
+ 0x18, 0x70, 0x00, 0x00,
+ 0x00, 0x60, 0x30, 0x18, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x0c, 0x18, 0x30, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x0c, 0x18, 0x30, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x18, 0x3c, 0x66, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x66, 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x34, 0x18, 0x2c, 0x06, 0x3e, 0x66, 0x66, 0x66, 0x66, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x76, 0xdc, 0x00, 0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cc, 0xcc, 0xcc, 0xcc, 0x76,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x0c, 0x18, 0x30, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e,
+ 0x06, 0x0c, 0xf8, 0x00,
+ 0x00, 0x00, 0xe0, 0x60, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c,
+ 0x60, 0x60, 0xf0, 0x00,
+ 0x00, 0x00, 0xc6, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e,
+ 0x06, 0x0c, 0x78, 0x00,
+
+};
+
+CONST unsigned char xfont14il1[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd, 0x99, 0x81, 0x7e,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x7e, 0xff, 0xdb, 0xff, 0xff, 0xc3, 0xe7, 0xff, 0x7e,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, 0x18, 0x3c,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00,
+ 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 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, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c,
+ 0xc6, 0x7c,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0xfe,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18,
+ 0x7e, 0x00,
+ 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xfe, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x6c, 0xfe, 0x6c, 0x28, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c, 0x38, 0x38, 0x10, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x00, 0x18, 0x18,
+ 0x00, 0x00,
+ 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c,
+ 0x00, 0x00,
+ 0x00, 0x18, 0x18, 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x86, 0xc6, 0x7c,
+ 0x18, 0x18,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18, 0x30, 0x66, 0xc6,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x76, 0xdc, 0xcc, 0xcc, 0x76,
+ 0x00, 0x00,
+ 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0c,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18,
+ 0x30, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18,
+ 0x00, 0x00,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 0xcc, 0xcc, 0x76,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xe0, 0x60, 0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x7c,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc6, 0x7c,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0x76,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc6, 0x7c,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x1c, 0x36, 0x32, 0x30, 0x7c, 0x30, 0x30, 0x30, 0x78,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c,
+ 0xcc, 0x78,
+ 0x00, 0x00, 0x00, 0xe0, 0x60, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0xe6,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x3c,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x66,
+ 0x66, 0x3c,
+ 0x00, 0x00, 0x00, 0xe0, 0x60, 0x60, 0x66, 0x6c, 0x78, 0x6c, 0x66, 0xe6,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0xfe, 0xd6, 0xd6, 0xd6, 0xd6,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0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, 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x0e,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x70, 0x18, 0x18, 0x18, 0x0e, 0x18, 0x18, 0x18, 0x70,
+ 0x00, 0x00,
+ 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x3c, 0x3c, 0x3c, 0x18,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x18, 0x7c, 0xc6, 0xc0, 0xc0, 0xc6, 0x7c, 0x18, 0x18,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0xe6, 0xfc,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0x7c, 0xc6,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x7e, 0x18, 0x18,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18,
+ 0x18, 0x00,
+ 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c,
+ 0xc6, 0x7c,
+ 0x00, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x38, 0x44, 0x9a, 0xa2, 0xa2, 0xa2, 0x9a, 0x44, 0x38,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x3c, 0x6c, 0x6c, 0x3e, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0xd8, 0x6c, 0x36, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0x06, 0x06, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x38, 0x44, 0xba, 0xaa, 0xb2, 0xaa, 0xaa, 0x44, 0x38,
+ 0x00, 0x00,
+ 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x7e,
+ 0x00, 0x00,
+ 0x00, 0x3c, 0x66, 0x0c, 0x18, 0x32, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x78, 0x0c, 0x38, 0x0c, 0x0c, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c,
+ 0x60, 0xc0,
+ 0x00, 0x00, 0x00, 0x7f, 0xdb, 0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x1b,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
+ 0x0c, 0x78,
+ 0x00, 0x18, 0x38, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36, 0x6c, 0xd8, 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x60, 0xe0, 0x63, 0x66, 0x6c, 0x1a, 0x36, 0x6e, 0xda, 0x3f,
+ 0x06, 0x06,
+ 0x00, 0x00, 0x60, 0xe0, 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+ 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x0c, 0x18, 0x30, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06,
+ 0x0c, 0xf8,
+ 0x00, 0x00, 0x00, 0xe0, 0x60, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x7c,
+ 0x60, 0xf0,
+ 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06,
+ 0x0c, 0x78,
+};
diff --git a/src/filter/font2.c b/src/filter/font2.c
new file mode 100644
index 0000000..ed57f50
--- /dev/null
+++ b/src/filter/font2.c
@@ -0,0 +1,35 @@
+#include "xfont16.c"
+
+// Doubles the xfont16 font for a bigger output of font (xfont32)
+// By Zoltan Kovacs <kovzol@particio.com>, 2006-04-25
+
+// Compile it with "gcc -o font2 font2.c" and then run it with
+// "./font2 > xfont32.c; indent xfont32.c".
+
+main()
+{
+ int a, b, i, j, k;
+ printf("#include <config.h>\nCONST unsigned char xfont32[] = {\n");
+
+ for (i = 0; i < 256; ++i) // 256 characters
+ {
+ for (j = 0; j < 16; ++j) // 16 lines vertically
+ {
+ a = xfont16[i * 16 + j]; // 8 bits of graphics read
+ b = 0; // this will be the output
+ for (k = 0; k < 8; ++k) {
+ b /= 4;
+ if (a % 2 == 1) // if the most right bit is set
+ b += 49152; // the the output will be also set, twice
+ a /= 2;
+ }
+ printf("0x%x, 0x%x, 0x%x, 0x%x", (b / 256), (b % 256),
+ (b / 256), (b % 256));
+ if (!(i == 255 && j == 15))
+ printf(", ");
+ } // end of character
+ printf("\n");
+ }
+ printf("};\n");
+
+}
diff --git a/src/filter/font23.c b/src/filter/font23.c
new file mode 100644
index 0000000..1477b70
--- /dev/null
+++ b/src/filter/font23.c
@@ -0,0 +1,36 @@
+#include "xfont16.c"
+
+// Doubles the xfont16 font for a bigger output of font (xfont48)
+// By Zoltan Kovacs <kovzol@particio.com>, 2006-04-25
+
+// Compile it with "gcc -o font23 font23.c" and then run it with
+// "./font23 > xfont48.c; indent xfont48.c".
+
+main()
+{
+ int a, b, i, j, k;
+ printf("#include <config.h>\nCONST unsigned char xfont48[] = {\n");
+
+ for (i = 0; i < 256; ++i) // 256 characters
+ {
+ for (j = 0; j < 16; ++j) // 16 lines vertically
+ {
+ a = xfont16[i * 16 + j]; // 8 bits of graphics read
+ b = 0; // this will be the output
+ for (k = 0; k < 8; ++k) {
+ b /= 4;
+ if (a % 2 == 1) // if the most right bit is set
+ b += 49152; // the the output will be also set, twice
+ a /= 2;
+ }
+ printf("0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x",
+ (b / 256), (b % 256), (b / 256),
+ (b % 256), (b / 256), (b % 256));
+ if (!(i == 255 && j == 15))
+ printf(", ");
+ } // end of character
+ printf("\n");
+ }
+ printf("};\n");
+
+}
diff --git a/src/filter/font3.c b/src/filter/font3.c
new file mode 100644
index 0000000..c1b6b05
--- /dev/null
+++ b/src/filter/font3.c
@@ -0,0 +1,41 @@
+#include "xfont16.c"
+
+// Doubles the xfont16 font for a bigger output of font (xfont48)
+// By Zoltan Kovacs <kovzol@particio.com>, 2006-04-25
+
+// Compile it with "gcc -o font3 font3.c" and then run it with
+// "./font3 > xfont48.c; indent xfont48.c".
+
+// Currently disabled, because XaoS does not support 24 bit width
+// fonts yet. :-(
+
+main()
+{
+ long a, b, i, j, k;
+ printf("#include <config.h>\nCONST unsigned char xfont48[] = {\n");
+
+ for (i = 0; i < 256; ++i) // 256 characters
+ {
+ for (j = 0; j < 16; ++j) // 16 lines vertically
+ {
+ a = xfont16[i * 16 + j]; // 8 bits of graphics read
+ b = 0; // this will be the output
+ for (k = 0; k < 8; ++k) {
+ b /= 8;
+ if (a % 2 == 1) // if the most right bit is set
+ b += (57344 * 256); // the the output will be also set, twice
+ a /= 2;
+ }
+ printf("0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x",
+ (b / 65536), ((b & 65535) / 256), (b % 256),
+ (b / 65536), ((b & 65535) / 256), (b % 256),
+ (b / 65536), ((b & 65535) / 256), (b % 256));
+
+ if (!(i == 255 && j == 15))
+ printf(", ");
+ } // end of character
+ printf("\n");
+ }
+ printf("};\n");
+
+}
diff --git a/src/filter/grlib.c b/src/filter/grlib.c
new file mode 100644
index 0000000..74692d4
--- /dev/null
+++ b/src/filter/grlib.c
@@ -0,0 +1,995 @@
+#include <config.h>
+#ifdef _plan9_
+#include <u.h>
+#include <libc.h>
+#else
+#include <stdlib.h>
+#include <string.h>
+#endif
+#ifdef HAVE_GETTEXT
+#include <iconv.h>
+#endif
+#include <archaccel.h>
+
+#include <fconfig.h>
+#include <filter.h>
+#include <fractal.h>
+#include <ui_helper.h>
+#include <grlib.h>
+
+#define WIDTH(ch) (currentfont->width)
+#define RWIDTH(ch) (currentfont->realwidth)
+#define HEIGHT (currentfont->height)
+#define DATA currentfont->data
+
+extern CONST unsigned char xfont8[];
+extern CONST unsigned char xfont16[];
+extern CONST unsigned char xfont32[];
+extern CONST unsigned char xfont48[];
+extern CONST unsigned char xfont14[];
+extern CONST unsigned char xfont8il1[];
+extern CONST unsigned char xfont16il1[];
+extern CONST unsigned char xfont14il1[];
+unsigned char *aa_chardata;
+unsigned char *aa_colordata;
+int aa_cursorx, aa_cursory;
+static CONST struct xfont *currentfont;
+CONST struct xfont xaafont = {
+ NULL,
+ 2, 1, 2, 2
+};
+
+CONST struct xfont xsmallfont = {
+ xfont14,
+ 8, 14, 8, 2
+};
+
+CONST struct xfont xbigfont = {
+ xfont16,
+ 9, 16, 8, 2
+};
+
+CONST struct xfont xbigfont2 = {
+ xfont32,
+ 18, 32, 16, 2
+};
+
+CONST struct xfont xbigfont3 = {
+ xfont48,
+ 18, 48, 16, 2
+};
+
+CONST struct xfont xsmallfontil1 = {
+ xfont8il1,
+ 8, 8, 8, 1
+};
+
+CONST struct xfont xmedfontil1 = {
+ xfont14il1,
+ 8, 14, 8, 1
+};
+
+CONST struct xfont xbigfontil1 = {
+ xfont16il1,
+ 9, 16, 8, 1
+};
+
+#include <c256.h>
+#define drawchar drawchar8
+#define hline hline8
+#define vline vline8
+#define rectangle rectangle8
+#define savevline savevline8
+#define restorevline restorevline8
+#define line line8
+#define saveline saveline8
+#define restoreline restoreline8
+#include "grlibd.c"
+#include <hicolor.h>
+#define drawchar drawchar16
+#define hline hline16
+#define vline vline16
+#define rectangle rectangle16
+#define savevline savevline16
+#define restorevline restorevline16
+#define line line16
+#define saveline saveline16
+#define restoreline restoreline16
+#include "grlibd.c"
+#include <true24.h>
+#define drawchar drawchar24
+#define hline hline24
+#define vline vline24
+#define rectangle rectangle24
+#define savevline savevline24
+#define restorevline restorevline24
+#define line line24
+#define saveline saveline24
+#define restoreline restoreline24
+#include "grlibd.c"
+#include <truecolor.h>
+#define drawchar drawchar32
+#define hline hline32
+#define vline vline32
+#define rectangle rectangle32
+#define savevline savevline32
+#define restorevline restorevline32
+#define line line32
+#define saveline saveline32
+#define restoreline restoreline32
+#include "grlibd.c"
+#ifdef SBITMAPS
+static inline void
+drawchar1(struct image *img, int x, int y, int fgcolor,
+ unsigned char letter)
+{
+ int fontwidth = (RWIDTH(letter) + 7) / 8;
+ CONST unsigned char *bitmap = &DATA[letter * HEIGHT * fontwidth];
+ unsigned char *current;
+ int yend = y + HEIGHT;
+ if (y < 0)
+ bitmap -= y, y = 0;
+ if (yend > img->height)
+ yend = img->height;
+ for (; y < yend; y++) {
+ unsigned int b = *(bitmap++);
+ if (fontwidth == 2) {
+ b <<= 8;
+ b |= *bitmap++;
+ }
+ current = img->currlines[y] + x / 8;
+ b = b << (8 - ((x) & 7));
+#ifdef SLBITMAPS
+ if (img->palette->type & (LBITMAP | LIBITMAP)) {
+ /*Reverse order... */
+ b = ((b >> 1) & 0x5555) | ((b << 1) & 0xaaaa);
+ b = ((b >> 2) & 0x3333) | ((b << 2) & 0xcccc);
+ b = ((b >> 4) & 0x0f0f) | ((b << 4) & 0xf0f0);
+ }
+#endif
+ if (fgcolor) {
+ if (x & 7) {
+ current[1] |= b;
+ current[0] |= b >> 8;
+ } else
+ current[0] |= b >> 8;
+ } else {
+ if (x & 7) {
+ current[1] &= ~b;
+ current[0] &= ~(b >> 8);
+ } else
+ *current &= ~(b >> 8);
+ }
+ }
+}
+
+static void hline1(struct image *img, int x, int y, int l, int color)
+{
+ int x2 = x + l;
+ int c1 = 255;
+ int c2 = 255;
+ unsigned char *current = img->currlines[y] + x / 8;
+ unsigned char *currend = img->currlines[y] + x2 / 8;
+ if (img->palette->type & (LBITMAP | LIBITMAP)) {
+ c2 >>= x2 & 7;
+ c1 <<= 8 - (x & 7);
+ } else {
+ c1 >>= x & 7;
+ c2 <<= 8 - (x2 & 7);
+ }
+ if (current == currend) {
+ if (color)
+ *current |= c1 & c2;
+ else
+ *current &= ~(c1 & c2);
+ } else {
+ if (color) {
+ *current |= c1;
+ *currend |= c2;
+ memset(current + 1, (char) 255, currend - current - 1);
+ } else {
+ *current &= ~c1;
+ *currend &= ~c2;
+ memset(current + 1, 0, currend - current - 1);
+ }
+ }
+}
+
+static void vline1(struct image *img, int x, int y, int l, int color)
+{
+ unsigned char c = 128 >> (x & 7);
+ l += y;
+ x /= 8;
+ if (img->palette->type & (LBITMAP | LIBITMAP)) {
+ c = ((c >> 1) & 0x55) | ((c << 1) & 0xaa);
+ c = ((c >> 2) & 0x33) | ((c << 2) & 0xcc);
+ c = ((c >> 4) & 0x0f) | ((c << 4) & 0xf0);
+ }
+ if (color)
+ while (y <= l) {
+ unsigned char *current = img->currlines[y] + x;
+ *current |= c;
+ y++;
+ } else {
+ c = ~c;
+ while (y <= l) {
+ unsigned char *current = img->currlines[y] + x;
+ *current &= c;
+ y++;
+ }
+ }
+}
+
+static inline void
+rectangle1(struct image *img, int x, int y, int width, int height,
+ int fgcolor)
+{
+ height += y;
+ while (y < height)
+ hline1(img, x, y, width - 1, fgcolor), y++;
+}
+
+static inline void
+line1(struct image *img, int x, int y, int x2, int y2, int color)
+{
+ int dx = x2 - x;
+ int dy = y2 - y;
+ int ady = abs(dy);
+#ifdef SLBITMAPS
+ int type = img->palette->type;
+#endif
+ if (dx < ady) {
+ int plus = (dx << 16) / ady;
+ if (dy < 0) {
+ int dy = (x << 16) | (65536 / 2);
+ ady = y;
+#ifdef SLBITMAPS
+ if (type & (LBITMAP | LIBITMAP))
+ if (!color)
+ while (ady >= y2) {
+ unsigned char *current =
+ img->currlines[ady] + (dy >> 19);
+ *current &= ~(1 << ((dy >> 16) & 7));
+ dy += plus;
+ ady--;
+ } else
+ while (ady >= y2) {
+ unsigned char *current =
+ img->currlines[ady] + (dy >> 19);
+ *current |= (1 << ((dy >> 16) & 7));
+ dy += plus;
+ ady--;
+ } else
+#endif
+ if (!color)
+ while (ady >= y2) {
+ unsigned char *current =
+ img->currlines[ady] + (dy >> 19);
+ *current &= ~(128 >> ((dy >> 16) & 7));
+ dy += plus;
+ ady--;
+ } else
+ while (ady >= y2) {
+ unsigned char *current =
+ img->currlines[ady] + (dy >> 19);
+ *current |= (128 >> ((dy >> 16) & 7));
+ dy += plus;
+ ady--;
+ }
+ } else {
+ int dy = (x << 16) | (65536 / 2);
+ ady = y;
+#ifdef SLBITMAPS
+ if (type & (LBITMAP | LIBITMAP))
+ if (!color)
+ while (ady <= y2) {
+ unsigned char *current =
+ img->currlines[ady] + (dy >> 19);
+ *current &= ~(1 << ((dy >> 16) & 7));
+ dy += plus;
+ ady++;
+ } else
+ while (ady <= y2) {
+ unsigned char *current =
+ img->currlines[ady] + (dy >> 19);
+ *current |= (1 << ((dy >> 16) & 7));
+ dy += plus;
+ ady++;
+ } else
+#endif
+ if (!color)
+ while (ady <= y2) {
+ unsigned char *current =
+ img->currlines[ady] + (dy >> 19);
+ *current &= ~(128 >> ((dy >> 16) & 7));
+ dy += plus;
+ ady++;
+ } else
+ while (ady <= y2) {
+ unsigned char *current =
+ img->currlines[ady] + (dy >> 19);
+ *current |= (128 >> ((dy >> 16) & 7));
+ dy += plus;
+ ady++;
+ }
+ }
+ } else {
+ int plus = (dy << 16) / dx;
+ ady = x;
+ dy = (y << 16) | (65536 / 2);
+#ifdef SLBITMAPS
+ if (type & (LBITMAP | LIBITMAP))
+ if (!color)
+ while (ady <= x2) {
+ unsigned char *current =
+ img->currlines[dy >> 16] + (ady >> 3);
+ *current &= ~(1 << (ady & 7));
+ dy += plus;
+ ady++;
+ } else
+ while (ady <= x2) {
+ unsigned char *current =
+ img->currlines[dy >> 16] + (ady >> 3);
+ *current |= (1 << (ady & 7));
+ dy += plus;
+ ady++;
+ } else
+#endif
+ if (!color)
+ while (ady <= x2) {
+ unsigned char *current =
+ img->currlines[dy >> 16] + (ady >> 3);
+ *current &= ~(128 >> (ady & 7));
+ dy += plus;
+ ady++;
+ } else
+ while (ady <= x2) {
+ unsigned char *current =
+ img->currlines[dy >> 16] + (ady >> 3);
+ *current |= (128 >> (ady & 7));
+ dy += plus;
+ ady++;
+ }
+ }
+ return;
+}
+#endif
+
+static int skip(CONST char *text)
+{
+ int i = 0;
+ while (*text && *text != '\n')
+ i++, text++;
+ return (i);
+}
+
+#ifdef HAVE_GETTEXT
+int
+xiconv(int encoding, char *out, int *outlen, const char *in, int *inlen)
+{
+ /*
+ * Since the built-in text system only supports Latin-1 and Lqtin-2
+ * encodings, we must convert strings from the user's native encoding to
+ * either Latin-1 or Latin-2 encoding as appropriate for the selected
+ * language before passing them into the built-in text system. This
+ * function wraps the gnu iconv library for this purpose.
+ */
+
+ iconv_t cd;
+ char tocode[16];
+ size_t icv_inlen = *inlen, icv_outlen = *outlen;
+ const char *icv_in = (const char *) in;
+ char *icv_out = (char *) out;
+ int ret;
+
+ sprintf(tocode, "ISO-8859-%d", encoding);
+ cd = iconv_open(tocode, "UTF-8");
+ if (cd == (iconv_t) (-1))
+ return -1;
+
+ ret = iconv(cd, &icv_in, &icv_inlen, &icv_out, &icv_outlen);
+
+ if (in != NULL) {
+ *inlen -= icv_inlen;
+ *outlen -= icv_outlen;
+ out[*outlen] = '\0';
+ } else {
+ *inlen = 0;
+ *outlen = 0;
+ }
+
+ if (icv_inlen != 0 || ret == (size_t) - 1)
+ return -1;
+
+ ret = iconv_close(cd);
+
+ if (ret == -1)
+ return -1;
+
+ return 0;
+}
+#endif
+
+#ifndef PLATFORM_TEXT_RENDERING
+
+int
+xprint(struct image *image, CONST struct xfont *current, int x, int y,
+ CONST char *text, int fgcolor, int bgcolor, int mode)
+{
+ int i = 0;
+ int aacolor = 0;
+ char intext[BUFSIZ];
+ int inlen = strlen(text);
+ char outtext[BUFSIZ];
+ int outlen = BUFSIZ;
+ strncpy(intext, text, BUFSIZ);
+
+#ifdef HAVE_GETTEXT
+ if (current->encoding
+ && xiconv(current->encoding, outtext, &outlen, intext, &inlen) == 0)
+ text = outtext;
+#endif
+ if (!text[0])
+ return 0;
+ /*Do some clipping */
+ currentfont = current;
+ if (x + WIDTH(*text) > image->width)
+ return skip(text);
+ if (y + HEIGHT <= 0)
+ return skip(text);
+ if (y >= image->height)
+ return skip(text);
+ while (x < 0 && *text && *text != '\n')
+ text++, x += WIDTH(*text), i++;
+ if (x < 0)
+ return (skip(text) + i);
+
+ if (image->flags & AAIMAGE) {
+ aacolor = 0; /*normal */
+ if ((unsigned int) fgcolor == image->palette->index[2])
+ aacolor = 2;
+ if ((unsigned int) fgcolor == image->palette->index[0])
+ aacolor = 5; /*special */
+ }
+ /*Draw text visible letters */
+ while (x + WIDTH(*text) < image->width && *text && *text != '\n') {
+ if (image->flags & AAIMAGE) {
+ aa_colordata[x / 2 + y / 2 * (image->width / 2)] = aacolor;
+ aa_chardata[x / 2 + y / 2 * (image->width / 2)] = *text;
+ } else
+ switch (image->bytesperpixel) {
+#ifdef SBITMAPS
+ case 0:
+ if (mode == TEXT_PRESSED) {
+ drawchar1(image, x + 1, y + 1, fgcolor, *text);
+ } else {
+ drawchar1(image, x + 1, y + 1, bgcolor, *text);
+ drawchar1(image, x, y, fgcolor, *text);
+ }
+ break;
+#endif
+ case 1:
+ if (mode == TEXT_PRESSED) {
+ drawchar8(image, x + 1, y + 1, fgcolor, *text);
+ } else {
+ drawchar8(image, x + 1, y + 1, bgcolor, *text);
+ drawchar8(image, x, y, fgcolor, *text);
+ }
+ break;
+#ifdef SUPPORT16
+ case 2:
+ if (mode == TEXT_PRESSED) {
+ drawchar16(image, x + 1, y + 1, fgcolor, *text);
+ } else {
+ drawchar16(image, x + 1, y + 1, bgcolor, *text);
+ drawchar16(image, x, y, fgcolor, *text);
+ }
+ break;
+#endif
+#ifdef STRUECOLOR24
+ case 3:
+ if (mode == TEXT_PRESSED) {
+ drawchar24(image, x + 1, y + 1, fgcolor, *text);
+ } else {
+ drawchar24(image, x + 1, y + 1, bgcolor, *text);
+ drawchar24(image, x, y, fgcolor, *text);
+ }
+ break;
+#endif
+ case 4:
+ if (mode == TEXT_PRESSED) {
+ drawchar32(image, x + 1, y + 1, fgcolor, *text);
+ } else {
+ drawchar32(image, x + 1, y + 1, bgcolor, *text);
+ drawchar32(image, x, y, fgcolor, *text);
+ }
+ break;
+ }
+ x += WIDTH(*text);
+ text++;
+ i++;
+ }
+ /*
+ * We need to return the number of bytes used from the string that is
+ * passed into the function; not the number of characters displayed. The
+ * number of bytes and the number of characters is not always the same in
+ * UTF-8 encoding. So I changed this to count the number of bytes to
+ * the next newline or nul in the original string that was passed in.
+ */
+ /* return i + skip(text); */
+ return skip(intext);
+}
+
+int xtextwidth(CONST struct xfont *font, CONST char *text)
+{
+ int i;
+#ifdef HAVE_GETTEXT
+ char intext[BUFSIZ];
+ int inlen = strlen(text);
+ char outtext[BUFSIZ];
+ int outlen = BUFSIZ;
+
+ strncpy(intext, text, BUFSIZ);
+ if (font->encoding
+ && xiconv(font->encoding, outtext, &outlen, intext, &inlen) == 0)
+ text = outtext;
+#endif
+ for (i = 0; text[i] && text[i] != '\n'; i++);
+ if (font->width == 2)
+ return (i * font->width);
+ return (i * font->width + 1);
+}
+
+int xtextheight(CONST struct xfont *font)
+{
+ return font->height+1;
+}
+
+int xtextcharw(CONST struct xfont *font, CONST char c)
+{
+ return font->width;
+}
+
+#endif
+
+void xhline(struct image *image, int x, int y, int width, int fgcolor)
+{
+ /*Do some clipping */
+ if (x + width < 0 || y < 0 || y >= image->height || x >= image->width)
+ return;
+ if (x + width >= image->width - 1)
+ width = image->width - x - 2;
+ if (x < 0)
+ width += x, x = 0;
+ if (width < 0)
+ return;
+ switch (image->bytesperpixel) {
+#ifdef SBITMAPS
+ case 0:
+ hline1(image, x, y, width, fgcolor);
+ break;
+#endif
+ case 1:
+ hline8(image, x, y, width, fgcolor);
+ break;
+#ifdef SUPPORT16
+ case 2:
+ hline16(image, x, y, width, fgcolor);
+ break;
+#endif
+#ifdef STRUECOLOR24
+ case 3:
+ hline24(image, x, y, width, fgcolor);
+ break;
+#endif
+ case 4:
+ hline32(image, x, y, width, fgcolor);
+ break;
+ }
+}
+
+void xvline(struct image *image, int x, int y, int height, int fgcolor)
+{
+ /*Do some clipping */
+ if (x < 0 || y + height < 0 || y >= image->height || x >= image->width)
+ return;
+ if (y + height >= image->height - 1)
+ height = image->height - y - 2;
+ if (y < 0)
+ height += y, y = 0;
+ if (height < 0)
+ return;
+ switch (image->bytesperpixel) {
+#ifdef SBITMAPS
+ case 0:
+ vline1(image, x, y, height, fgcolor);
+ break;
+#endif
+ case 1:
+ vline8(image, x, y, height, fgcolor);
+ break;
+#ifdef SUPPORT16
+ case 2:
+ vline16(image, x, y, height, fgcolor);
+ break;
+#endif
+#ifdef STRUECOLOR24
+ case 3:
+ vline24(image, x, y, height, fgcolor);
+ break;
+#endif
+ case 4:
+ vline32(image, x, y, height, fgcolor);
+ break;
+ }
+}
+
+void
+xrectangle(struct image *image, int x, int y, int width, int height,
+ int fgcolor)
+{
+ /*Do some clipping */
+ if (x + width < 0 || y + height < 0 || y >= image->height
+ || x >= image->width)
+ return;
+ if (x + width >= image->width)
+ width = image->width - x;
+ if (x < 0)
+ width += x, x = 0;
+ if (width < 0)
+ return;
+ if (y + height >= image->height)
+ height = image->height - y;
+ if (y < 0)
+ height += y, y = 0;
+ if (height < 0)
+ return;
+ if (image->flags & AAIMAGE) {
+ int x1, y1;
+ for (x1 = x / 2; x1 < (x + width) / 2; x1++)
+ for (y1 = y / 2; y1 < (y + height) / 2; y1++)
+ aa_colordata[x1 + y1 * image->width / 2] = 255;
+ }
+ switch (image->bytesperpixel) {
+#ifdef SBITMAPS
+ case 0:
+ rectangle1(image, x, y, width, height, fgcolor);
+ break;
+#endif
+ case 1:
+ rectangle8(image, x, y, width, height, fgcolor);
+ break;
+#ifdef SUPPORT16
+ case 2:
+ rectangle16(image, x, y, width, height, fgcolor);
+ break;
+#endif
+#ifdef STRUECOLOR24
+ case 3:
+ rectangle24(image, x, y, width, height, fgcolor);
+ break;
+#endif
+ case 4:
+ rectangle32(image, x, y, width, height, fgcolor);
+ break;
+ }
+}
+
+static inline char *savehline(struct image *i, int x1, int y, int x2)
+{
+ int start, end;
+ char *c;
+ if (!i->bytesperpixel)
+ start = (x1) / 8, end = (x2 + 1 + 7) / 8;
+ else
+ start = x1 * i->bytesperpixel, end = (x2 + 1) * i->bytesperpixel;
+ c = (char *) malloc(end - start);
+ if (c == NULL)
+ return NULL;
+ memcpy(c, i->currlines[y] + start, end - start);
+ return c;
+}
+
+static inline void
+restorehline(struct image *i, char *c, int x1, int y, int x2)
+{
+ int start, end;
+ if (!i->bytesperpixel)
+ start = (x1) / 8, end = (x2 + 1 + 7) / 8;
+ else
+ start = x1 * i->bytesperpixel, end = (x2 + 1) * i->bytesperpixel;
+ memcpy(i->currlines[y] + start, c, end - start);
+}
+
+#define __clipx1 0
+#define __clipy1 0
+#define __clipx2 (img->width-2)
+#define __clipy2 (img->height-2)
+static inline int regioncode(struct image *img, const int x, const int y)
+{
+ int dx1, dx2, dy1, dy2;
+ int result;
+ result = 0;
+ dy2 = __clipy2 - y;
+ if (dy2 < 0)
+ result++;
+ result <<= 1;
+ dy1 = y - __clipy1;
+ if (dy1 < 0)
+ result++;
+ result <<= 1;
+ dx2 = __clipx2 - x;
+ if (dx2 < 0)
+ result++;
+ result <<= 1;
+ dx1 = x - __clipx1;
+ if (dx1 < 0)
+ result++;
+ return result;
+}
+
+#define swap(x, y) { int temp = x; x = y; y = temp; }
+#define doclip(ret) \
+ for (;;) \
+ { \
+ int r1 = regioncode (img, x1, y1); \
+ int r2 = regioncode (img, x2, y2); \
+ if (!(r1 | r2)) \
+ break; /* completely inside */ \
+ if (r1 & r2) \
+ ret; /* completely outside */ \
+ if (r1 == 0) \
+ { \
+ swap (x1, x2); /* make sure first */ \
+ swap (y1, y2); /* point is outside */ \
+ r1 = r2; \
+ } \
+ if (r1 & 1) \
+ { /* left */ \
+ y1 += (long) (__clipx1 - x1) * (long) (y2 - y1) / (long) (x2 - x1); \
+ x1 = __clipx1; \
+ } \
+ else if (r1 & 2) \
+ { /* right */ \
+ y1 += (long) (__clipx2 - x1) * (long) (y2 - y1) / (long) (x2 - x1); \
+ x1 = __clipx2; \
+ } \
+ else if (r1 & 4) \
+ { /* top */ \
+ x1 += (long) (__clipy1 - y1) * (long) (x2 - x1) / (long) (y2 - y1); \
+ y1 = __clipy1; \
+ } \
+ else if (r1 & 8) \
+ { /* bottom */ \
+ x1 += (long) (__clipy2 - y1) * (long) (x2 - x1) / (long) (y2 - y1); \
+ y1 = __clipy2; \
+ } \
+ } \
+ if(x2<x1) { \
+ swap(x1,x2); \
+ swap(y1,y2); \
+ }
+
+void xline(struct image *img, int x1, int y1, int x2, int y2, int color)
+{
+ doclip(return);
+ if (x1 == x2) {
+ if (y2 < y1) {
+ swap(y1, y2);
+ }
+ switch (img->bytesperpixel) {
+#ifdef SBITMAPS
+ case 0:
+ vline1(img, x1, y1, y2 - y1, color);
+ break;
+#endif
+ case 1:
+ vline8(img, x1, y1, y2 - y1, color);
+ break;
+#ifdef SUPPORT16
+ case 2:
+ vline16(img, x1, y1, y2 - y1, color);
+ break;
+#endif
+#ifdef STRUECOLOR24
+ case 3:
+ vline24(img, x1, y1, y2 - y1, color);
+ break;
+#endif
+ case 4:
+ vline32(img, x1, y1, y2 - y1, color);
+ break;
+ }
+ } else if (y1 == y2) {
+ switch (img->bytesperpixel) {
+#ifdef SBITMAPS
+ case 0:
+ hline1(img, x1, y1, x2 - x1, color);
+ break;
+#endif
+ case 1:
+ hline8(img, x1, y1, x2 - x1, color);
+ break;
+#ifdef SUPPORT16
+ case 2:
+ hline16(img, x1, y1, x2 - x1, color);
+ break;
+#endif
+#ifdef STRUECOLOR24
+ case 3:
+ hline24(img, x1, y1, x2 - x1, color);
+ break;
+#endif
+ case 4:
+ hline32(img, x1, y1, x2 - x1, color);
+ break;
+ }
+ } else {
+ switch (img->bytesperpixel) {
+#ifdef SBITMAPS
+ case 0:
+ line1(img, x1, y1, x2, y2, color);
+ break;
+#endif
+ case 1:
+ line8(img, x1, y1, x2, y2, color);
+ break;
+#ifdef SUPPORT16
+ case 2:
+ line16(img, x1, y1, x2, y2, color);
+ break;
+#endif
+#ifdef STRUECOLOR24
+ case 3:
+ line24(img, x1, y1, x2, y2, color);
+ break;
+#endif
+ case 4:
+ line32(img, x1, y1, x2, y2, color);
+ break;
+ }
+ }
+}
+
+char *xsaveline(struct image *img, int x1, int y1, int x2, int y2)
+{
+ doclip(return (NULL));
+ if (y1 == y2) {
+ return (savehline(img, x1, y1, x2));
+ } else if (x1 == x2) {
+ if (y2 < y1) {
+ swap(y1, y2);
+ }
+ switch (img->bytesperpixel) {
+#ifdef SBITMAPS
+ case 0:
+ return (savevline8(img, x1 / 8, y1, y2 - y1));
+#endif
+ case 1:
+ return (savevline8(img, x1, y1, y2 - y1));
+#ifdef SUPPORT16
+ case 2:
+ return (savevline16(img, x1, y1, y2 - y1));
+#endif
+#ifdef STRUECOLOR24
+ case 3:
+ return (savevline24(img, x1, y1, y2 - y1));
+#endif
+ case 4:
+ return (savevline32(img, x1, y1, y2 - y1));
+ }
+ } else {
+ switch (img->bytesperpixel) {
+#ifdef SBITMAPS
+ case 0:
+ if (x2 > img->height - 15)
+ x2 = img->height - 15;
+ if (x1 > img->height - 15)
+ x1 = img->height - 15;
+ return (saveline8(img, (x1 / 8), y1, (x2 / 8), y2));
+#endif
+ case 1:
+ return (saveline8(img, x1, y1, x2, y2));
+#ifdef SUPPORT16
+ case 2:
+ return (saveline16(img, x1, y1, x2, y2));
+#endif
+#ifdef STRUECOLOR24
+ case 3:
+ return (saveline24(img, x1, y1, x2, y2));
+#endif
+ case 4:
+ return (saveline32(img, x1, y1, x2, y2));
+ }
+ }
+ return NULL;
+}
+
+void xprepareimage(struct image *img)
+{
+ if (img->flags & AAIMAGE) {
+ memset(aa_colordata, (char) 255, img->width * img->height / 4);
+ }
+ aa_cursorx = -1;
+ aa_cursory = -1;
+}
+
+void xdrawcursor(struct image *img, int x, int y, int color, int height)
+{
+ if (img->flags & AAIMAGE) {
+ aa_cursorx = x / 2;
+ aa_cursory = y / 2;
+ } else {
+ xvline(img, x, y, height, color);
+ xhline(img, x - 1, y - 1, 1, color);
+ xhline(img, x + 1, y - 1, 1, color);
+ xhline(img, x - 1, y + height, 1, color);
+ xhline(img, x + 1, y + height, 1, color);
+ }
+}
+
+void
+xrestoreline(struct image *img, char *data, int x1, int y1, int x2, int y2)
+{
+ doclip(return);
+ if (y1 == y2) {
+ restorehline(img, data, x1, y1, x2);
+ return;
+ } else if (x1 == x2) {
+ if (y2 < y1) {
+ swap(y1, y2);
+ }
+ switch (img->bytesperpixel) {
+#ifdef SBITMAPS
+ case 0:
+ restorevline8(img, data, x1 / 8, y1, y2 - y1);
+ break;
+#endif
+ case 1:
+ restorevline8(img, data, x1, y1, y2 - y1);
+ break;
+#ifdef SUPPORT16
+ case 2:
+ restorevline16(img, data, x1, y1, y2 - y1);
+ break;
+#endif
+#ifdef STRUECOLOR24
+ case 3:
+ restorevline24(img, data, x1, y1, y2 - y1);
+ break;
+#endif
+ case 4:
+ restorevline32(img, data, x1, y1, y2 - y1);
+ break;
+ }
+ } else {
+ switch (img->bytesperpixel) {
+#ifdef SBITMAPS
+ case 0:
+ if (x2 > img->height - 15)
+ x2 = img->height - 15;
+ if (x1 > img->height - 15)
+ x1 = img->height - 15;
+ restoreline8(img, data, x1 / 8, y1, x2 / 8, y2);
+ break;
+#endif
+ case 1:
+ restoreline8(img, data, x1, y1, x2, y2);
+ break;
+#ifdef SUPPORT16
+ case 2:
+ restoreline16(img, data, x1, y1, x2, y2);
+ break;
+#endif
+#ifdef STRUECOLOR24
+ case 3:
+ restoreline24(img, data, x1, y1, x2, y2);
+ break;
+#endif
+ case 4:
+ restoreline32(img, data, x1, y1, x2, y2);
+ break;
+ }
+ }
+ return;
+}
diff --git a/src/filter/grlibd.c b/src/filter/grlibd.c
new file mode 100644
index 0000000..bbdeec5
--- /dev/null
+++ b/src/filter/grlibd.c
@@ -0,0 +1,322 @@
+#ifndef UNSUPPORTED
+static inline void
+drawchar(struct image *img, int x, int y, int fgcolor,
+ unsigned char letter)
+{
+ int fontwidth = (RWIDTH(letter) + 7) / 8;
+ CONST unsigned char *bitmap = &DATA[letter * HEIGHT * fontwidth];
+ cpixel_t *current;
+ int yend = y + HEIGHT;
+ if (y < 0)
+ bitmap -= y, y = 0;
+ if (yend > img->height)
+ yend = img->height;
+ for (; y < yend; y++) {
+ int b = *(bitmap++);
+ int i = (1 << (RWIDTH(letter) - 1));
+ if (fontwidth == 2) {
+ b <<= 8;
+ b |= *bitmap++;
+ }
+ current = (cpixel_t *) img->currlines[y];
+ p_inc(current, x);
+ while (i) {
+ if (i & b) {
+ p_set(current, fgcolor);
+ }
+ i >>= 1;
+ p_inc(current, 1);
+ }
+ }
+}
+
+static inline void
+hline(struct image *img, int x, int y, int length, int fgcolor)
+{
+ cpixel_t *current = (cpixel_t *) img->currlines[y], *end =
+ (cpixel_t *) img->currlines[y];
+ p_inc(current, x);
+ p_inc(end, x + length);
+#ifdef bpp1
+ memset(current, fgcolor, end - current + 1);
+#else
+ while (current <= end) {
+ p_set(current, fgcolor);
+ p_inc(current, 1);
+ }
+#endif
+}
+
+static inline void
+vline(struct image *img, int x, int y, int length, int fgcolor)
+{
+ length += y;
+ while (y <= length) {
+ cpixel_t *current = (cpixel_t *) img->currlines[y];
+ p_inc(current, x);
+ p_set(current, fgcolor);
+ y++;
+ }
+}
+
+static inline void
+rectangle(struct image *img, int x, int y, int width, int height,
+ int fgcolor)
+{
+ height += y;
+ while (y < height)
+ hline(img, x, y, width - 1, fgcolor), y++;
+}
+
+static inline char *savevline(struct image *img, int x, int y, int length)
+{
+ cpixel_t *saved = (cpixel_t *) malloc(length * bpp + bpp), *s = saved;
+ length += y;
+ while (y <= length) {
+ cpixel_t *current = (cpixel_t *) img->currlines[y];
+ p_copy(s, 0, current, x);
+ p_inc(s, 1);
+ y++;
+ }
+ return (char *) saved;
+}
+
+static inline void
+restorevline(struct image *img, char *saved, int x, int y, int length)
+{
+ cpixel_t *s = (cpixel_t *) saved;
+ length += y;
+ while (y <= length) {
+ cpixel_t *current = (cpixel_t *) img->currlines[y];
+ p_copy(current, x, s, 0);
+ p_inc(s, 1);
+ y++;
+ }
+}
+
+static inline char *saveline(struct image *img, int x, int y, int x2,
+ int y2)
+{
+ int dx = x2 - x;
+ int dy = y2 - y;
+ int ady = abs(dy);
+ if (dx < ady) {
+ cpixel_t *saved = (cpixel_t *) malloc((ady + 1) * bpp * 2), *s =
+ saved;
+ int plus = (dx << 16) / ady;
+ if (dy < 0) {
+ int dy = (x << 16) /*| (65536 / 2) */ ;
+ ady = y;
+ while (ady >= y2) {
+ cpixel_t *current = (cpixel_t *) img->currlines[ady];
+ p_inc(current, (dy >> 16));
+ p_copy(s, 0, current, 0);
+ p_copy(s, 1, current, 1);
+ p_inc(s, 2);
+ dy += plus;
+ ady--;
+ }
+ } else {
+ int dy = (x << 16) /*| (65536 / 2) */ ;
+ ady = y;
+ while (ady <= y2) {
+ cpixel_t *current = (cpixel_t *) img->currlines[ady];
+ p_inc(current, (dy >> 16));
+ p_copy(s, 0, current, 0);
+ p_copy(s, 1, current, 1);
+ p_inc(s, 2);
+ dy += plus;
+ ady++;
+ }
+ }
+ return ((char *) saved);
+ } else {
+ cpixel_t *saved = (cpixel_t *) malloc((dx + 1) * bpp * 2), *s =
+ saved;
+ int plus = (dy << 16) / dx;
+ ady = x;
+ dy = (y << 16);
+ while (ady <= x2) {
+ cpixel_t *current = (cpixel_t *) img->currlines[dy >> 16];
+ p_copy(s, 0, current, ady);
+ current = (cpixel_t *) img->currlines[(dy >> 16) + 1];
+ p_copy(s, 1, current, ady);
+ p_inc(s, 2);
+ dy += plus;
+ ady++;
+ }
+ return ((char *) saved);
+ }
+}
+
+static inline void
+restoreline(struct image *img, char *saved, int x, int y, int x2, int y2)
+{
+ int dx = x2 - x;
+ int dy = y2 - y;
+ int ady = abs(dy);
+ if (dx < ady) {
+ cpixel_t *s = (cpixel_t *) saved;
+ int plus = (dx << 16) / ady;
+ if (dy < 0) {
+ int dy = (x << 16) /*| (65536 / 2) */ ;
+ ady = y;
+ while (ady >= y2) {
+ cpixel_t *current = (cpixel_t *) img->currlines[ady];
+ p_inc(current, (dy >> 16));
+ p_copy(current, 0, s, 0);
+ p_copy(current, 1, s, 1);
+ p_inc(s, 2);
+ dy += plus;
+ ady--;
+ }
+ } else {
+ int dy = (x << 16) /*| (65536 / 2) */ ;
+ ady = y;
+ while (ady <= y2) {
+ cpixel_t *current = (cpixel_t *) img->currlines[ady];
+ p_inc(current, (dy >> 16));
+ p_copy(current, 0, s, 0);
+ p_copy(current, 1, s, 1);
+ p_inc(s, 2);
+ dy += plus;
+ ady++;
+ }
+ }
+ } else {
+ cpixel_t *s = (cpixel_t *) saved;
+ int plus = (dy << 16) / dx;
+ ady = x;
+ dy = (y << 16);
+ while (ady <= x2) {
+ cpixel_t *current = (cpixel_t *) img->currlines[dy >> 16];
+ p_copy(current, ady, s, 0);
+ current = (cpixel_t *) img->currlines[(dy >> 16) + 1];
+ p_copy(current, ady, s, 1);
+ p_inc(s, 2);
+ dy += plus;
+ ady++;
+ }
+ }
+}
+
+#ifdef bpp1
+#define myinterpol(a,b,n) intergray(a,b,n)
+#else
+#define myinterpol(a,b,n) interpol(a,b,n,rmask,gmask,bmask)
+#endif
+static inline void
+line(struct image *img, int x, int y, int x2, int y2, int color)
+{
+ int dx = x2 - x;
+ int dy = y2 - y;
+ int ady = abs(dy);
+#ifndef bpp1
+ int rmask = img->palette->info.truec.rmask;
+ int gmask = img->palette->info.truec.gmask;
+ int bmask = img->palette->info.truec.bmask;
+#endif
+#ifdef bpp1
+ if (img->palette->type &= (C256 | FIXEDCOLOR)) {
+ if (dx < ady) {
+ int plus = (dx << 16) / ady;
+ if (dy < 0) {
+ int dy = (x << 16) | (65536 / 2);
+ ady = y;
+ while (ady >= y2) {
+ cpixel_t *current = (cpixel_t *) img->currlines[ady];
+ p_inc(current, (dy >> 16));
+ p_set(current, color);
+ dy += plus;
+ ady--;
+ }
+ } else {
+ int dy = (x << 16) | (65536 / 2);
+ ady = y;
+ while (ady <= y2) {
+ cpixel_t *current = (cpixel_t *) img->currlines[ady];
+ p_inc(current, (dy >> 16));
+ p_set(current, color);
+ dy += plus;
+ ady++;
+ }
+ }
+ } else {
+ int plus = (dy << 16) / dx;
+ ady = x;
+ dy = (y << 16) | (65536 / 2);
+ while (ady <= x2) {
+ cpixel_t *current = (cpixel_t *) img->currlines[dy >> 16];
+ p_setp(current, ady, color);
+ dy += plus;
+ ady++;
+ }
+ }
+ return;
+ }
+#endif
+
+ if (dx < ady) {
+ int plus = (dx << 16) / ady;
+ if (dy < 0) {
+ int dy = (x << 16);
+ ady = y;
+ while (ady >= y2) {
+ cpixel_t *current = (cpixel_t *) img->currlines[ady];
+ p_inc(current, (dy >> 16));
+ p_set(current,
+ myinterpol(p_get(current), color,
+ ((dy & 65535) >> 8)));
+ p_setp(current, 1,
+ myinterpol(color, p_getp(current, 1),
+ ((dy & 65535) >> 8)));
+ dy += plus;
+ ady--;
+ }
+ } else {
+ int dy = (x << 16);
+ ady = y;
+ while (ady <= y2) {
+ cpixel_t *current = (cpixel_t *) img->currlines[ady];
+ p_inc(current, (dy >> 16));
+ p_set(current,
+ myinterpol(p_get(current), color,
+ ((dy & 65535) >> 8)));
+ p_setp(current, 1,
+ myinterpol(color, p_getp(current, 1),
+ ((dy & 65535) >> 8)));
+ dy += plus;
+ ady++;
+ }
+ }
+ } else {
+ int plus = (dy << 16) / dx;
+ ady = x;
+ dy = (y << 16);
+ while (ady <= x2) {
+ cpixel_t *current = (cpixel_t *) img->currlines[dy >> 16];
+ p_setp(current, ady,
+ myinterpol(p_getp(current, ady), color,
+ ((dy & 65535) >> 8)));
+ current = (cpixel_t *) img->currlines[(dy >> 16) + 1];
+ p_setp(current, ady,
+ myinterpol(color, p_getp(current, ady),
+ ((dy & 65535) >> 8)));
+ dy += plus;
+ ady++;
+ }
+ }
+}
+
+#undef myinterpol
+#endif
+
+#undef drawchar
+#undef hline
+#undef vline
+#undef rectangle
+#undef line
+#undef restoreline
+#undef saveline
+#undef savevline
+#undef restorevline
diff --git a/src/filter/image.c b/src/filter/image.c
new file mode 100644
index 0000000..1478419
--- /dev/null
+++ b/src/filter/image.c
@@ -0,0 +1,268 @@
+#ifndef _plan9_
+#include <string.h>
+#include <fconfig.h>
+#include <assert.h>
+#ifdef NO_MALLOC_H
+#include <stdlib.h>
+#else
+#include <malloc.h>
+#endif
+#include <stdio.h>
+#else
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#include <fconfig.h>
+#endif
+#include <filter.h>
+void flipgeneric(struct image *img)
+{
+ pixel_t **line;
+ assert(img->nimages == 2);
+ img->currimage ^= 1;
+ line = img->currlines;
+ img->currlines = img->oldlines;
+ img->oldlines = line;
+}
+
+int bytesperpixel(int type)
+{
+ switch (type) {
+ case MBITMAP:
+ case LBITMAP:
+ case LIBITMAP:
+ case MIBITMAP:
+ return 0;
+ case SMALLITER:
+ case FIXEDCOLOR:
+ case GRAYSCALE:
+ case C256:
+ return 1;
+ case LARGEITER:
+ case TRUECOLOR16:
+ return 2;
+ case TRUECOLOR24:
+ return 3;
+ case TRUECOLOR:
+ return 4;
+ default:
+ assert(0);
+ return 0;
+ }
+}
+
+struct image *create_image_lines(int width, int height,
+ int nimages, pixel_t ** lines1,
+ pixel_t ** lines2,
+ struct palette *palette,
+ void (*flip) (struct image * img),
+ int flags, float pixelwidth,
+ float pixelheight)
+{
+ int i;
+ static int version = 1;
+ struct image *img = (struct image *) calloc(1, sizeof(*img));
+ if (img == NULL)
+ return NULL;
+ if (flip == NULL)
+ flip = flipgeneric;
+ img->width = width;
+ img->height = height;
+ img->nimages = nimages;
+ img->bytesperpixel = bytesperpixel(palette->type);
+ img->palette = palette;
+ img->currimage = 0;
+ img->flip = flip;
+ img->flags = flags;
+ img->version = version;
+ version += 65535;
+ img->currlines = lines1;
+ img->oldlines = lines2;
+ img->pixelwidth = pixelwidth;
+ img->pixelheight = pixelheight;
+ if (lines1 != NULL && (nimages != 2 || lines2 != NULL)) {
+ img->scanline = (int) (lines1[1] - lines1[0]);
+ if (img->scanline < 0)
+ img->scanline = -1;
+ else {
+ for (i = 0; i < height; i++) {
+ if (lines1[0] - lines1[i] != img->scanline * i) {
+ img->scanline = -1;
+ break;
+ }
+ if (nimages == 2
+ && lines2[0] - lines2[i] != img->scanline * i) {
+ img->scanline = -1;
+ break;
+ }
+ }
+ }
+ } else
+ img->scanline = -1;
+ return (img);
+}
+
+struct image *create_image_cont(int width, int height, int scanlinesize,
+ int nimages, pixel_t * buf1,
+ pixel_t * buf2, struct palette *palette,
+ void (*flip) (struct image * img),
+ int flags, float pixelwidth,
+ float pixelheight)
+{
+ struct image *img =
+ create_image_lines(width, height, nimages, NULL, NULL, palette,
+ flip,
+ flags, pixelwidth, pixelheight);
+ int i;
+ if (img == NULL) {
+ return NULL;
+ }
+ if ((img->currlines =
+ (pixel_t **) malloc(sizeof(*img->currlines) * height)) == NULL) {
+ free(img);
+ return NULL;
+ }
+ if (nimages == 2) {
+ if ((img->oldlines =
+ (pixel_t **) malloc(sizeof(*img->oldlines) * height)) == NULL)
+ {
+ free(img->currlines);
+ free(img);
+ return NULL;
+ }
+ }
+ for (i = 0; i < img->height; i++) {
+ img->currlines[i] = buf1;
+ buf1 += scanlinesize;
+ }
+ if (nimages == 2)
+ for (i = 0; i < img->height; i++) {
+ img->oldlines[i] = buf2;
+ buf2 += scanlinesize;
+ }
+ img->flags |= FREELINES;
+ img->scanline = scanlinesize;
+ return (img);
+}
+
+struct image *create_image_mem(int width, int height, int nimages,
+ struct palette *palette, float pixelwidth,
+ float pixelheight)
+{
+ unsigned char *data =
+ (unsigned char *) calloc(((width + 3) & ~3) * height,
+ bytesperpixel(palette->type));
+ unsigned char *data1 =
+ (unsigned char *) (nimages ==
+ 2 ? calloc(((width + 3) & ~3) * height,
+ bytesperpixel(palette->
+ type)) : NULL);
+ struct image *img;
+ if (data == NULL) {
+#ifdef DEBUG
+ printf("Image:out of memory\n");
+#endif
+ return (NULL);
+ }
+ if (nimages == 2 && data1 == NULL) {
+ free(data);
+#ifdef DEBUG
+ printf("Image:out of memory2\n");
+#endif
+ return NULL;
+ }
+ img =
+ create_image_cont(width, height,
+ ((width +
+ 3) & ~3) * bytesperpixel(palette->type),
+ nimages, data, data1, palette, NULL, 0,
+ pixelwidth, pixelheight);
+ if (img == NULL) {
+ free(data);
+ if (data1 != NULL)
+ free(data1);
+ return NULL;
+ }
+ img->flags |= FREEDATA;
+ return (img);
+}
+
+struct image *create_subimage(struct image *simg, int width, int height,
+ int nimages, struct palette *palette,
+ float pixelwidth, float pixelheight)
+{
+ int size = height * bytesperpixel(palette->type);
+ int i;
+ int shift1 = 0, shift2 = 0;
+ struct image *img;
+ if (size > simg->height * simg->bytesperpixel || height > simg->height
+ || (nimages == 2 && simg->nimages == 1))
+ return (create_image_mem
+ (width, height, nimages, palette, pixelwidth,
+ pixelheight));
+ nimages = simg->nimages;
+ img =
+ create_image_lines(width, height, nimages, NULL, NULL, palette,
+ NULL, 0, pixelwidth, pixelheight);
+ if (img == NULL)
+ return NULL;
+ if ((img->currlines =
+ (pixel_t **) malloc(sizeof(*img->currlines) * height)) == NULL) {
+ free(img);
+ return NULL;
+ }
+ if (nimages == 2) {
+ if ((img->oldlines =
+ (pixel_t **) malloc(sizeof(*img->oldlines) * height)) == NULL)
+ {
+ free(img->currlines);
+ free(img);
+ return NULL;
+ }
+ }
+ shift1 = simg->height - img->height;
+ shift2 =
+ simg->width * simg->bytesperpixel -
+ img->width * img->bytesperpixel;
+ for (i = 0; i < img->height; i++) {
+ img->currlines[i] = simg->currlines[i + shift1] + shift2;
+ }
+ if (nimages == 2)
+ for (i = 0; i < img->height; i++) {
+ img->oldlines[i] = simg->oldlines[i + shift1] + shift2;
+ }
+ img->flags |= FREELINES;
+ img->currimage = simg->currimage;
+ return (img);
+}
+
+void destroy_image(struct image *img)
+{
+ if (img->flags & FREEDATA) {
+ free(*img->currlines);
+ if (img->nimages == 2)
+ free(*img->oldlines);
+ }
+ if (img->flags & FREELINES) {
+ free(img->currlines);
+ if (img->nimages == 2)
+ free(img->oldlines);
+ }
+ free(img);
+}
+
+void clear_image(struct image *img)
+{
+ int i;
+ int color = img->palette->pixels[0];
+ int width = img->width * img->bytesperpixel;
+ if (img->palette->npreallocated)
+ color = img->palette->index[0];
+ if (!width) {
+ width = (img->width + 7) / 8;
+ if (color)
+ color = 255;
+ }
+ for (i = 0; i < img->height; i++)
+ memset(img->currlines[i], color, width);
+}
diff --git a/src/filter/palette.c b/src/filter/palette.c
new file mode 100644
index 0000000..6eae282
--- /dev/null
+++ b/src/filter/palette.c
@@ -0,0 +1,1097 @@
+#ifdef _plan9_
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#else
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <fconfig.h>
+#include <config.h>
+#include <assert.h>
+#include <stdio.h>
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#include <limits.h>
+#endif
+#include <fconfig.h>
+#include <filter.h>
+#include <misc-f.h>
+#include <xerror.h>
+
+#define nprecells (context->type & (LARGEITER|SMALLITER|TRUECOLOR|TRUECOLOR16|TRUECOLOR24)?0:(context)->ncells)
+#define PREALLOCATED(palette) ((palette)->type & (LARGEITER|SMALLITER|TRUECOLOR|TRUECOLOR16|TRUECOLOR24)?0:(palette)->npreallocated)
+/*emulate allocation routines using setpalette */
+unsigned col_diff[3][512];
+static struct palette *context;
+static int maxentries;
+static int needupdate;
+static void
+genertruecolorinfo(struct truec *t, unsigned int r, unsigned int g,
+ unsigned int b)
+{
+ int n;
+
+ for (n = 0; !((r >> n) & 1); n++);
+ t->rshift = n;
+ for (; ((r >> n) & 1); n++);
+ t->rprec = 8 - (n - t->rshift);
+ t->rmask = r;
+
+ for (n = 0; !((g >> n) & 1); n++);
+ t->gshift = n;
+ for (; ((g >> n) & 1); n++);
+ t->gprec = 8 - (n - t->gshift);
+ t->gmask = g;
+
+ for (n = 0; !((b >> n) & 1); n++);
+ t->bshift = n;
+ for (; ((b >> n) & 1); n++);
+ t->bprec = 8 - (n - t->bshift);
+ t->bmask = b;
+
+ t->allmask = r | g | b;
+ if ((r & b) || (r & g) || (b & g)) {
+ x_fatalerror("Internal error:Invalid color masks 1 %x %x %x!\n", r,
+ g, b);
+ }
+ if ((r < g && g < b) || (b < g && g < r)) {
+ t->mask1 = r | b;
+ t->mask2 = g;
+ } else if ((g < r && r < b) || (b < r && r < g)) {
+ t->mask1 = g | b;
+ t->mask2 = r;
+ } else if ((g < b && b < r) || (r < b && b < g)) {
+ t->mask1 = g | r;
+ t->mask2 = b;
+ }
+ t->byteexact = 0;
+ t->missingbyte = -1;
+ if (!(t->rshift % 8) &&
+ !(t->gshift % 8) &&
+ !(t->bshift % 8) && !t->rprec && !t->gprec && !t->bprec) {
+ t->byteexact = 1;
+ {
+ unsigned char ch[4];
+ *(unsigned int *) ch = t->allmask;
+ if (!ch[0])
+ t->missingbyte = 0;
+ if (!ch[1])
+ t->missingbyte = 1;
+ if (!ch[2])
+ t->missingbyte = 2;
+ if (!ch[3])
+ t->missingbyte = 3;
+ }
+ }
+#ifdef DEBUG
+ printf("Image:\n");
+ printf("rshift:%i gshift:%i bshift:%i\n", t->rshift, t->gshift,
+ t->bshift);
+ printf("rprec:%i gprec:%i bprec:%i\n", t->rprec, t->gprec, t->bprec);
+ printf("rmask:%x gmask:%x bmask:%x\n", t->rmask, t->gmask, t->bmask);
+ printf("mask1:%x mask2:%x allmask:%x\n", t->mask1, t->mask2,
+ t->allmask);
+ printf("byteexact:%x missingbyte:%i\n", t->byteexact, t->missingbyte);
+#endif
+}
+
+void bestfit_init(void)
+{
+ int i;
+
+ for (i = 1; i < 256; i++) {
+ int k = i * i;
+ col_diff[0][i] = col_diff[0][512 - i] = k * (59 * 59) / 256;
+ col_diff[1][i] = col_diff[1][512 - i] = k * (30 * 30) / 256;
+ col_diff[2][i] = col_diff[2][512 - i] = k * (11 * 11) / 256;
+ }
+}
+
+static int
+allocgenerictruecolor(struct palette *palette, int init, int r, int g,
+ int b)
+{
+ unsigned int n;
+ switch (palette->type) {
+ case LARGEITER:
+ case SMALLITER:
+#ifdef _UNDEFINED_
+ if (init)
+ n = 0;
+ else
+ n = palette->size;
+#endif
+ return 1;
+ case TRUECOLOR:
+ case TRUECOLOR16:
+ case TRUECOLOR24:
+ default:
+ n = ((r >> palette->info.truec.rprec) << palette->info.truec.
+ rshift) | ((g >> palette->info.truec.gprec) << palette->info.
+ truec.gshift) | ((b >> palette->info.truec.
+ bprec) << palette->info.truec.
+ bshift);
+ break;
+ }
+ if (init)
+ palette->size = 0;
+ else if (palette->size >= palette->maxentries)
+ return -1;
+ palette->pixels[palette->size] = n;
+ palette->size++;
+ return palette->size;
+}
+
+static int
+allocgeneric(struct palette *palette, int init, int r, int g, int b)
+{
+ int start = palette->npreallocated + palette->start;
+ if (init)
+ palette->size = 0;
+ else if (palette->size >= palette->end - start)
+ return -1;
+ palette->pixels[palette->size] = palette->size + start;
+ palette->rgb[palette->size + start][0] = r;
+ palette->rgb[palette->size + start][1] = g;
+ palette->rgb[palette->size + start][2] = b;
+ palette->size++;
+ return (palette->size - 1);
+}
+
+int fixedalloccolor(struct palette *palette, int init, int r, int g, int b)
+{
+ int i, coldif, lowest, bestfit;
+ if (init)
+ palette->size = 0;
+ else if (palette->size >= palette->maxentries)
+ return -1;
+ lowest = INT_MAX;
+ bestfit = 1;
+ if (palette->type == FIXEDCOLOR || (palette->type & BITMAPS)) {
+ for (i = palette->start; i < palette->end; i++) {
+ coldif = col_diff[0][(g - palette->rgb[i][1]) & 0x1ff];
+ if (coldif < lowest) {
+ coldif += col_diff[1][(r - palette->rgb[i][0]) & 0x1ff];
+ if (coldif < lowest) {
+ coldif +=
+ col_diff[2][(b - palette->rgb[i][2]) & 0x1ff];
+ if (coldif < lowest) {
+ bestfit = i;
+ if (!coldif)
+ break;
+ lowest = coldif;
+ }
+ }
+ }
+ }
+ } else {
+ bestfit =
+ (r * 30 + g * 59 + b * 11) * (palette->end -
+ palette->start) / 256 / 100 +
+ palette->start;
+ }
+ palette->pixels[palette->size] = bestfit;
+ palette->size++;
+ return (palette->size - 1);
+}
+
+static void
+setcolorgeneric(struct palette *palette, int start, int end, rgb_t * rgb)
+{
+}
+
+static void allocfinishedgeneric(struct palette *palette)
+{
+ palette->setpalette(palette, palette->start,
+ palette->size + palette->start +
+ palette->npreallocated,
+ palette->rgb + palette->start);
+}
+
+static void cycle_entries(struct palette *c, int direction)
+{
+ int i;
+ int i1, i2, i3;
+ rgb_t *co;
+ if (direction > 0)
+ direction %= c->size - 1;
+ else
+ direction = -((-direction) % (c->size - 1));
+ if (!direction)
+ return;
+ co = (rgb_t *) malloc(c->end * sizeof(rgb_t));
+ memcpy(co, c->rgb, sizeof(*co) * c->end);
+ i3 = (c->size - 1 + direction) % (c->size - 1) + 1;
+ for (i = 1; i < c->size; i++) {
+ i1 = c->pixels[i];
+ i2 = c->pixels[i3];
+ c->rgb[i1][0] = co[i2][0];
+ c->rgb[i1][1] = co[i2][1];
+ c->rgb[i1][2] = co[i2][2];
+ i3++;
+ if (i3 >= c->size)
+ i3 = 1;
+ }
+ free(co);
+}
+
+static void cyclecolorsgeneric(struct palette *pal, int direction)
+{
+ cycle_entries(pal, direction);
+ pal->setpalette(pal, pal->pixels[0], pal->size + pal->pixels[0],
+ pal->rgb + pal->pixels[0]);
+}
+
+#define TRUECOLORPALETTE 65536
+struct palette *createpalette(int start, int end, int type, int flags,
+ int maxentries,
+ int (*alloccolor) (struct palette * pal,
+ int init, int r, int g,
+ int b),
+ void (*setcolor) (struct palette * pal,
+ int start, int end,
+ rgb_t * rgb),
+ void (*allocfinished) (struct palette * pal),
+ void (*cyclecolors) (struct palette * pal,
+ int direction),
+ union paletteinfo *info)
+{
+ static int versioncount;
+ struct palette *palette =
+ (struct palette *) calloc(1, sizeof(struct palette));
+
+ if (col_diff[0][1] == 0)
+ bestfit_init();
+ palette->ncells = 0;
+ palette->index = NULL;
+ palette->size = 0;
+ palette->rgb = NULL;
+ if (palette == NULL)
+ return NULL;
+
+ switch (type) {
+ case LBITMAP:
+ case MBITMAP:
+ case LIBITMAP:
+ case MIBITMAP:
+ end = 2;
+ start = 0;
+ maxentries = 256;
+ palette->rgb = (rgb_t *) calloc(end, sizeof(*palette->rgb));
+ if (palette->rgb == NULL) {
+ free(palette);
+ return NULL;
+ }
+ if (type & (LIBITMAP | MIBITMAP)) {
+ palette->rgb[0][0] = 255;
+ palette->rgb[0][1] = 255;
+ palette->rgb[0][2] = 255;
+ palette->rgb[1][0] = 0;
+ palette->rgb[1][1] = 0;
+ palette->rgb[1][2] = 0;
+ } else {
+ palette->rgb[0][0] = 0;
+ palette->rgb[0][1] = 0;
+ palette->rgb[0][2] = 0;
+ palette->rgb[1][0] = 255;
+ palette->rgb[1][1] = 255;
+ palette->rgb[1][2] = 255;
+ }
+ palette->maxentries = maxentries;
+ palette->alloccolor = fixedalloccolor;
+ palette->setpalette = NULL;
+ palette->allocfinished = NULL;
+ palette->cyclecolors = NULL;
+ break;
+ case FIXEDCOLOR:
+ if (!end)
+ end = 256;
+ if (!maxentries)
+ maxentries = 256;
+ palette->rgb = (rgb_t *) calloc(end, sizeof(*palette->rgb));
+ if (palette->rgb == NULL) {
+ free(palette);
+ return NULL;
+ }
+ palette->maxentries = maxentries;
+ palette->alloccolor = fixedalloccolor;
+ palette->setpalette = NULL;
+ palette->allocfinished = NULL;
+ palette->cyclecolors = NULL;
+ break;
+ case GRAYSCALE:
+ if (!end)
+ end = 256;
+ if (!maxentries)
+ maxentries = end - start;
+ palette->maxentries = 65536;
+ palette->alloccolor = fixedalloccolor;
+ palette->setpalette = NULL;
+ palette->allocfinished = NULL;
+ palette->cyclecolors = NULL;
+ palette->size = end - start;
+ break;
+ case C256:
+
+ if (!end)
+ end = 256;
+ if (!maxentries)
+ maxentries = end - start;
+ if (cyclecolors == NULL && setcolor != NULL)
+ cyclecolors = cyclecolorsgeneric;
+
+ if (alloccolor == NULL) {
+ alloccolor = allocgeneric, allocfinished =
+ allocfinishedgeneric;
+ if (setcolor == NULL && type == C256) /*non hardware palette */
+ setcolor = setcolorgeneric, cyclecolors =
+ cyclecolorsgeneric;
+ }
+ palette->rgb = (rgb_t *) calloc(end, sizeof(*palette->rgb));
+
+ if (palette->rgb == NULL) {
+ free(palette);
+ return NULL;
+ }
+
+ palette->maxentries = maxentries;
+ palette->alloccolor = alloccolor;
+ palette->setpalette = setcolor;
+ palette->allocfinished = allocfinished;
+ palette->cyclecolors = cyclecolors;
+
+ break;
+ default:
+ end = TRUECOLORPALETTE;
+ start = 0;
+ if (type == SMALLITER)
+ end = 256;
+ start = 0;
+ palette->maxentries = end;
+ palette->alloccolor = allocgenerictruecolor;
+ palette->cyclecolors = NULL;
+ palette->setpalette = NULL;
+ palette->allocfinished = NULL;
+ }
+ {
+ int ee = palette->maxentries;
+ /*if(end>palette->maxentries) ee=end; */
+ if (ee < 256)
+ palette->pixels =
+ (unsigned int *) calloc(256, sizeof(*palette->pixels));
+ else
+ palette->pixels =
+ (unsigned int *) calloc(ee, sizeof(*palette->pixels));
+ }
+ if (palette->pixels == NULL) {
+ free(palette);
+ return NULL;
+ }
+ if (type & (LARGEITER | SMALLITER)) {
+ int i;
+ palette->size = end;
+ palette->flags |= DONOTCHANGE;
+ for (i = 0; i < end; i++)
+ palette->pixels[i] = i;
+ }
+ palette->start = start;
+ palette->end = end;
+ palette->type = type;
+ palette->flags |= flags;
+ palette->version = (versioncount += 65536);
+ if (type == FIXEDCOLOR) {
+ int i;
+ if (setcolor != NULL)
+ setcolor(palette, start, end, palette->rgb);
+ for (i = 0; i < end - start; i++)
+ palette->pixels[i] = i + start;
+ }
+ if (type == GRAYSCALE) {
+ int i;
+ for (i = palette->start; i < end - start; i++)
+ palette->pixels[i] = i + start;
+ }
+ if (info != NULL
+ && (type == TRUECOLOR || type == TRUECOLOR24
+ || type == TRUECOLOR16)) {
+ genertruecolorinfo(&palette->info.truec, info->truec.rmask,
+ info->truec.gmask, info->truec.bmask);
+ } else {
+ if (type == TRUECOLOR)
+ genertruecolorinfo(&palette->info.truec, 255 << 16, 255 << 8,
+ 255);
+ if (type == TRUECOLOR24)
+ genertruecolorinfo(&palette->info.truec, 255 << 16, 255 << 8,
+ 255);
+ if (type == TRUECOLOR16)
+ genertruecolorinfo(&palette->info.truec, (255 >> 3) << 11,
+ (255 >> 2) << 5, (255 >> 3));
+ }
+ return (palette);
+}
+
+void destroypalette(struct palette *palette)
+{
+ free(palette->pixels);
+ if (palette->rgb != NULL)
+ free(palette->rgb);
+ if (palette->index != NULL)
+ free(palette->index);
+ free(palette);
+}
+
+#define MYMIN(x,y) ((x)<(y)?(x):(y))
+struct palette *clonepalette(struct palette *palette)
+{
+ struct palette *pal =
+ createpalette(palette->start, palette->end, palette->type,
+ palette->flags, palette->maxentries,
+ /*palette->alloccolor, palette->setpalette, palette->allocfinished, palette->cyclecolors */
+ NULL, NULL, NULL, NULL, &palette->info);
+ memcpy(pal->pixels, palette->pixels,
+ sizeof(*pal->pixels) * MYMIN(palette->end, pal->end));
+ if (pal->rgb != NULL) {
+ memcpy(pal->rgb, palette->rgb,
+ sizeof(*pal->rgb) * MYMIN(palette->end, pal->end));
+ }
+ pal->size = palette->size;
+ return (pal);
+}
+
+void preallocpalette(struct palette *pal)
+{
+ int i;
+ int p;
+ if (pal->index != NULL)
+ free(pal->index), pal->index = NULL;
+ pal->npreallocated = 0;
+ if (!pal->ncells)
+ return;
+ pal->index = (unsigned int *) malloc(sizeof(int) * (pal->ncells + 1));
+ for (i = 0; i < pal->ncells; i++) {
+ if (!i)
+ p = pal->pixels[0];
+ else
+ p = pal->pixels[pal->size];
+ pal->alloccolor(pal, i == 0, pal->prergb[i][0], pal->prergb[i][1],
+ pal->prergb[i][2]);
+ if (pal->size) {
+ pal->index[i] = pal->pixels[pal->size - 1];
+ pal->pixels[pal->size - 1] = p;
+ }
+ }
+ pal->npreallocated = pal->size;
+ pal->size = 0;
+ needupdate = 0;
+}
+
+void restorepalette(struct palette *dest, struct palette *src)
+{
+ int i;
+ preallocpalette(dest);
+ for (i = 0; i < src->size; i++) {
+ int r = 0, g = 0, b = 0;
+ switch (src->type) {
+ case SMALLITER:
+ r = g = b = i;
+ break;
+ case LARGEITER:
+ r = g = b = i / 256;
+ break;
+ case GRAYSCALE:
+ r = g = b = src->pixels[i];
+ break;
+ case C256:
+ case FIXEDCOLOR:
+ case MBITMAP:
+ case LBITMAP:
+ case MIBITMAP:
+ case LIBITMAP:
+ r = src->rgb[src->pixels[i]][0];
+ g = src->rgb[src->pixels[i]][1];
+ b = src->rgb[src->pixels[i]][2];
+ break;
+ case TRUECOLOR:
+ case TRUECOLOR16:
+ case TRUECOLOR24:
+ r = (((src->pixels[i] & src->info.truec.rmask) >> src->
+ info.truec.rshift)) << src->info.truec.rprec;
+ g = (((src->pixels[i] & src->info.truec.gmask) >> src->
+ info.truec.gshift)) << src->info.truec.gprec;
+ b = (((src->pixels[i] & src->info.truec.bmask) >> src->
+ info.truec.bshift)) << src->info.truec.bprec;
+ break;
+ }
+ if (dest->size >= dest->maxentries - PREALLOCATED(dest))
+ break;
+ if (dest->
+ alloccolor(dest, (i + dest->npreallocated) == 0, r, g,
+ b) == -1)
+ break;
+ }
+ if (!(dest->flags & FINISHLATER)) {
+ if (dest->allocfinished != NULL)
+ dest->allocfinished(dest);
+ } else
+ dest->flags |= UNFINISHED;
+ dest->version++;
+}
+
+/*Generation code for various palettes */
+
+
+#define DEFNSEGMENTS (255/8)
+#define MAXNSEGMENTS (4096)
+#define NSEGMENTS ((255/segmentsize))
+static int segmentsize;
+
+
+static unsigned char colors[MAXNSEGMENTS][3];
+static CONST unsigned char colors1[DEFNSEGMENTS][3] = {
+ /*{8, 14, 32}, */
+ {0, 0, 0},
+ {120, 119, 238},
+ {24, 7, 25},
+ {197, 66, 28},
+ {29, 18, 11},
+ {135, 46, 71},
+ {24, 27, 13},
+ {241, 230, 128},
+ {17, 31, 24},
+ {240, 162, 139},
+ {11, 4, 30},
+ {106, 87, 189},
+ {29, 21, 14},
+ {12, 140, 118},
+ {10, 6, 29},
+ {50, 144, 77},
+ {22, 0, 24},
+ {148, 188, 243},
+ {4, 32, 7},
+ {231, 146, 14},
+ {10, 13, 20},
+ {184, 147, 68},
+ {13, 28, 3},
+ {169, 248, 152},
+ {4, 0, 34},
+ {62, 83, 48},
+ {7, 21, 22},
+ {152, 97, 184},
+ {8, 3, 12},
+ {247, 92, 235},
+ {31, 32, 16}
+};
+
+REGISTERS(3)
+static int allocate(int r, int g, int b, int init)
+{
+ unsigned int n;
+ if (init)
+ preallocpalette(context);
+ n = context->pixels[(init ? 0 : context->size) /*+ context->start */ ];
+ if (!init && context->size == maxentries)
+ return 0;
+ if ((context->alloccolor(context, init
+ && !context->npreallocated, (int) r, (int) g,
+ (int) b)) == -1) {
+ return 0;
+ }
+ if (context->pixels[context->size - 1 /*+ context->start */ ] != n) {
+ needupdate = 1;
+ }
+ return (1);
+}
+
+static int mksmooth(int nsegments, int setsegments)
+{
+ int i, y;
+ float r, g, b, rs, gs, bs;
+ int segmentsize1 = segmentsize;
+
+ for (i = 0; i < setsegments; i++) {
+ if (i == setsegments - 1 && !(context->flags & UNKNOWNENTRIES)) {
+ segmentsize1 = maxentries - context->size - 2;
+ }
+ r = colors[i % nsegments][0];
+ g = colors[i % nsegments][1];
+ b = colors[i % nsegments][2];
+ rs = ((int) colors[(i + 1) % setsegments % nsegments][0] -
+ r) / (unsigned int) segmentsize1;
+ gs = ((int) colors[(i + 1) % setsegments % nsegments][1] -
+ g) / (unsigned int) segmentsize1;
+ bs = ((int) colors[(i + 1) % setsegments % nsegments][2] -
+ b) / (unsigned int) segmentsize1;
+ for (y = 0; y < segmentsize1; y++) {
+ if (!allocate((int) r, (int) g, (int) b, i == 0 && y == 0)) {
+ if (!i)
+ context->size = 2;
+ context->size = i * segmentsize;
+ return 0;
+ }
+ r += rs;
+ g += gs;
+ b += bs;
+ }
+ }
+ if (context->flags & UNKNOWNENTRIES)
+ context->size = i * segmentsize;
+ return 1;
+}
+
+static INLINE void
+hsv_to_rgb(int h, int s, int v,
+ unsigned char *red, unsigned char *green, unsigned char *blue)
+{
+ int hue;
+ int f, p, q, t;
+ h += 256;
+ h %= 256;
+
+ if (s == 0) {
+ *red = v;
+ *green = v;
+ *blue = v;
+ } else {
+ h %= 256;
+ if (h < 0)
+ h += 256;
+ hue = h * 6;
+
+ f = hue & 255;
+ p = v * (256 - s) / 256;
+ q = v * (256 - (s * f) / 256) >> 8;
+ t = v * (256 * 256 - (s * (256 - f))) >> 16;
+
+ switch ((int) (hue / 256)) {
+ case 0:
+ *red = v;
+ *green = t;
+ *blue = p;
+ break;
+ case 1:
+ *red = q;
+ *green = v;
+ *blue = p;
+ break;
+ case 2:
+ *red = p;
+ *green = v;
+ *blue = t;
+ break;
+ case 3:
+ *red = p;
+ *green = q;
+ *blue = v;
+ break;
+ case 4:
+ *red = t;
+ *green = p;
+ *blue = v;
+ break;
+ case 5:
+ *red = v;
+ *green = p;
+ *blue = q;
+ break;
+ }
+ }
+}
+
+static void randomize_segments3(int whitemode, int nsegments)
+{
+ int i = 0;
+ int h, s, v;
+
+ for (i = 0; i < nsegments; i++) {
+ if (!(i % 3)) {
+ if (i % 6)
+ colors[i][0] = 255, colors[i][1] = 255, colors[i][2] = 255;
+ else
+ colors[i][0] = 0, colors[i][1] = 0, colors[i][2] = 0;
+ } else {
+ s = (int) XaoS_random() % 256;
+ h = (int) XaoS_random() % (128 - 32);
+ v = (int) XaoS_random() % 128;
+ if (((i) % 6 > 3) ^ ((i) % 3 == 1))
+ /*if(((i)%3==1)) */
+ h += 42 + 16;
+ else
+ h += 42 + 128 + 16, v += 128 + 64;
+ hsv_to_rgb(h, s, v, colors[i], colors[i] + 1, colors[i] + 2);
+ }
+ }
+ colors[i - 1][0] = colors[0][0];
+ colors[i - 1][1] = colors[0][1];
+ colors[i - 1][2] = colors[0][2];
+}
+
+static void randomize_segments2(int whitemode, int nsegments)
+{
+ int i = 0;
+
+ for (i = 0; i < nsegments; i++) {
+ if (i % 3 == 2)
+ colors[i][0] = whitemode * 255,
+ colors[i][1] = whitemode * 255, colors[i][2] =
+ whitemode * 255;
+ else if (i % 3 == 0)
+ colors[i][0] = (!whitemode) * 255,
+ colors[i][1] = (!whitemode) * 255,
+ colors[i][2] = (!whitemode) * 255;
+ else
+ colors[i][0] = (int) XaoS_random() % 256,
+ colors[i][1] = (int) XaoS_random() % 256,
+ colors[i][2] = (int) XaoS_random() % 256;
+ }
+ colors[i - 1][0] = colors[0][0];
+ colors[i - 1][1] = colors[0][1];
+ colors[i - 1][2] = colors[0][2];
+}
+
+static void randomize_segments(int whitemode, int nsegments)
+{
+ int i = 0;
+ if (whitemode) {
+ colors[0][0] = 255, colors[0][1] = 255, colors[0][2] = 255;
+ for (i = 0; i < nsegments; i += 2) {
+ if (i != 0) {
+ colors[i][0] = (int) XaoS_random() % 256,
+ colors[i][1] = (int) XaoS_random() % 256,
+ colors[i][2] = (int) XaoS_random() % 256;
+ }
+ if (i + 1 < nsegments)
+ colors[i + 1][0] = (int) XaoS_random() % 35,
+ colors[i + 1][1] = (int) XaoS_random() % 35,
+ colors[i + 1][2] = (int) XaoS_random() % 35;
+ }
+ } else {
+ for (i = 0; i < nsegments; i += 2) {
+ colors[i][0] = (int) XaoS_random() % 35,
+ colors[i][1] = (int) XaoS_random() % 35,
+ colors[i][2] = (int) XaoS_random() % 35;
+ if (i + 1 < nsegments)
+ colors[i + 1][0] = (int) XaoS_random() % 256,
+ colors[i + 1][1] = (int) XaoS_random() % 256,
+ colors[i + 1][2] = (int) XaoS_random() % 256;
+ }
+ }
+ colors[i - 1][0] = colors[0][0];
+ colors[i - 1][1] = colors[0][1];
+ colors[i - 1][2] = colors[0][2];
+}
+
+#define MYLONG_MAX 0xffffff
+#define rrandom(i) ((int)(((int)XaoS_random()/(double)MYLONG_MAX)*(i)))
+/*Do not use modulo type random since it should bring very different results
+ *for slightly different sizes
+ */
+
+int mkpalette(struct palette *c, int seed, int algorithm)
+{
+ int i, ncolors = c->size;
+ int whitemode;
+ int i1;
+
+ context = c;
+ needupdate = 0;
+
+ if (c->flags & DONOTCHANGE)
+ return 0;
+ XaoS_srandom(seed);
+ seed = (int) XaoS_random();
+ whitemode = (int) XaoS_random() % 2;
+
+ if ((c->flags & UNKNOWNENTRIES) || !c->size) {
+ maxentries = context->maxentries - nprecells;
+ segmentsize = (rrandom(maxentries / 2)) & (~3);
+ if (segmentsize < 1)
+ segmentsize = 1;
+ } else {
+ if (maxentries > 8) {
+ int qq = 255;
+
+ maxentries = context->maxentries - nprecells;
+ segmentsize = rrandom(qq / 3 + 4);
+ segmentsize += rrandom(qq / 3 + 4);
+ segmentsize += rrandom(qq / 3 + 4);
+ segmentsize += rrandom(qq / 3 + 4); /*Make smaller segments with higher probability */
+
+ segmentsize = abs(segmentsize / 2 - qq / 3 + 3);
+ if (segmentsize < 8)
+ segmentsize = 8;
+ if (segmentsize > maxentries / 3)
+ segmentsize = maxentries / 3;
+ }
+ }
+
+ if (c->flags & UNKNOWNENTRIES)
+ i = rrandom(maxentries);
+ else
+ i = (maxentries + segmentsize - 5) / segmentsize;
+
+ if (i < 0)
+ i = 1;
+ if (i > MAXNSEGMENTS)
+ i1 = MAXNSEGMENTS;
+ else
+ i1 = i;
+
+ XaoS_srandom(seed);
+
+ switch (algorithm) {
+ case 2:
+ randomize_segments3(whitemode, i1);
+ break;
+ case 1:
+ randomize_segments2(whitemode, i1);
+ break;
+ case 0:
+ randomize_segments(whitemode, i1);
+ }
+ mksmooth(i1, i);
+
+ if (!(c->flags & FINISHLATER)) {
+ if (c->allocfinished != NULL)
+ c->allocfinished(c);
+ } else
+ c->flags |= UNFINISHED;
+ if (context->size != ncolors || needupdate) {
+ context->version++;
+ return 1;
+ }
+
+ return 0;
+}
+
+int mkstereogrampalette(struct palette *c)
+{
+ int i, ncolors = c->size;
+ context = c;
+ needupdate = 0;
+ for (i = 0; i < 16; i++)
+ allocate(i * 4, i * 4, i * 16, i == 0);
+ if (!(c->flags & FINISHLATER)) {
+ if (c->allocfinished != NULL)
+ c->allocfinished(c);
+ } else
+ c->flags |= UNFINISHED;
+ if (context->size != ncolors || needupdate) {
+ context->version++;
+ return 1;
+ }
+ return 0;
+}
+
+int mkstarfieldpalette(struct palette *c)
+{
+ int i, ncolors = c->size;
+ context = c;
+ needupdate = 0;
+ for (i = 0; i < 16; i++)
+ if (i % 2)
+ allocate(i * 4, i * 4, i * 16, i == 0);
+ else
+ allocate(i * 16, i * 16, i * 16, i == 0);
+ if (!(c->flags & FINISHLATER)) {
+ if (c->allocfinished != NULL)
+ c->allocfinished(c);
+ } else
+ c->flags |= UNFINISHED;
+ if (context->size != ncolors || needupdate) {
+ context->version++;
+ return 1;
+ }
+ return 0;
+}
+
+int mkblurpalette(struct palette *c)
+{
+ int i, ncolors = c->size;
+ context = c;
+ needupdate = 0;
+ for (i = 0; i < 63; i++)
+ allocate(i * 2, i * 2, i * 4, i == 0);
+ allocate(i * 2, i * 2, i * 4 - 1, 0);
+ if (!(c->flags & FINISHLATER)) {
+ if (c->allocfinished != NULL)
+ c->allocfinished(c);
+ } else
+ c->flags |= UNFINISHED;
+ if (context->size != ncolors || needupdate) {
+ context->version++;
+ return 1;
+ }
+ return 0;
+}
+
+int mkgraypalette(struct palette *c)
+{
+ int i, ncolors = c->size;
+ context = c;
+ needupdate = 0;
+ for (i = 0; i < 64; i++)
+ allocate(i * 4, i * 4, i * 4, i == 0);
+ for (i = 0; i < 16; i++)
+ allocate(255, 255 - i * 16, 255 - i * 16, 0);
+ for (i = 0; i < 16; i++)
+ allocate(255 - i * 16, 0, 0, 0);
+ if (!(c->flags & FINISHLATER)) {
+ if (c->allocfinished != NULL)
+ c->allocfinished(c);
+ } else
+ c->flags |= UNFINISHED;
+ if (context->size != ncolors || needupdate) {
+ context->version++;
+ return 1;
+ }
+ return 0;
+}
+
+int mkdefaultpalette(struct palette *c)
+{
+ int i, ncolors = c->size;
+ context = c;
+ needupdate = 0;
+ segmentsize = 8;
+
+ if (c->flags & DONOTCHANGE)
+ return 0;
+ memcpy(colors, colors1, sizeof(colors1));
+ maxentries = context->maxentries - nprecells;
+ if (c->flags & UNKNOWNENTRIES)
+ i = 128 / 8;
+ else
+ i = (maxentries + 3) / 8;
+ if (i < 0)
+ i = 1;
+ mksmooth(255 / 8, i);
+ if (!(c->flags & FINISHLATER)) {
+ if (c->allocfinished != NULL)
+ c->allocfinished(c);
+ } else
+ c->flags |= UNFINISHED;
+ if (context->size != ncolors || needupdate) {
+ context->version++;
+ return 1;
+ }
+ return 0;
+}
+
+int shiftpalette(struct palette *c, int shift)
+{
+ if (!c->size)
+ return 0;
+
+ while (shift < 0)
+ shift += c->size - 1;
+ shift = shift % (c->size - 1);
+
+ if (!shift)
+ return 0;
+
+ if (c->cyclecolors != NULL) {
+ if (c->flags & UNFINISHED) {
+ cycle_entries(c, shift);
+ } else {
+ c->cyclecolors(c, shift);
+ }
+ return 0;
+ }
+
+ if (c->type & (TRUECOLOR | TRUECOLOR24 | TRUECOLOR16)) {
+ int i;
+ int i3;
+ int *co;
+
+ if (shift > 0)
+ shift %= c->size - 1;
+ else
+ shift = -((-shift) % (c->size - 1));
+ if (!shift)
+ return 0;
+ co = (int *) malloc(c->size * sizeof(*co));
+ memcpy(co, c->pixels, sizeof(*co) * c->size);
+ i3 = (c->size - 1 + shift) % (c->size - 1) + 1;
+ for (i = 1; i < c->size; i++) {
+ c->pixels[i] = co[i3];
+ i3++;
+ if (i3 >= c->size)
+ i3 = 1;
+ }
+ c->version++;
+ free(co);
+ }
+ return 1;
+}
+
+static int allocrgb(struct palette *c, int r1, int g1, int b1)
+{
+ int r, g, b;
+ int f = 1;
+ for (g = 0; g < g1; g++)
+ for (b = 0; b < b1; b++) {
+ for (r = 0; r < r1; r++) {
+ if (!allocate
+ (r * 255 / (r1 - 1), g * 255 / (g1 - 1),
+ b * 255 / (b1 - 1), f))
+ return 0;
+ f = 0;
+ }
+ }
+ return 1;
+}
+
+int mkrgb(struct palette *c)
+{
+ int ncolors = c->size;
+ int red = 8, green = 8, blue = 4;
+
+ context = c;
+ needupdate = 0;
+
+ if (c->flags & UNKNOWNENTRIES) {
+ while (blue > 0) {
+ if (allocrgb(c, red, green, blue))
+ break;
+ red--;
+ if (allocrgb(c, red, green, blue))
+ break;
+ green--;
+ if (allocrgb(c, red, green, blue))
+ break;
+ red--;
+ if (allocrgb(c, red, green, blue))
+ break;
+ green--;
+ if (allocrgb(c, red, green, blue))
+ break;
+ blue--;
+ }
+ } else {
+ number_t n =
+ pow((c->maxentries - nprecells) / (0.5 * 0.2 * 0.3), 1.0 / 3);
+ green = (int) (n * 0.5);
+ blue = (int) (n * 0.2);
+ red = (int) (n * 0.3);
+ while ((blue + 1) * red * green < (c->maxentries - nprecells))
+ blue++;
+ while ((red + 1) * blue * green < (c->maxentries - nprecells))
+ red++;
+ while ((green + 1) * blue * red < (c->maxentries - nprecells))
+ green++;
+ allocrgb(c, red, green, blue);
+ }
+
+ if (!(c->flags & FINISHLATER)) {
+ if (c->allocfinished != NULL)
+ c->allocfinished(c);
+ } else
+ c->flags |= UNFINISHED;
+ if (context->size != ncolors || needupdate) {
+ context->version++;
+ }
+
+ return red * 256 * 256 + green * 256 + blue;
+}
diff --git a/src/filter/random.c b/src/filter/random.c
new file mode 100644
index 0000000..9c14c3c
--- /dev/null
+++ b/src/filter/random.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley. The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+/* The code is taken from GNU C library. Goal is to provide same
+ * random numbers at all platforms to make possible save random
+ * palette just by saving random seed
+ *
+ * Very simplified because I don't need to have numbers "very random"
+ */
+
+/*
+ * This is derived from the Berkeley source:
+ * @(#)random.c 5.5 (Berkeley) 7/6/88
+ * It was reworked for the GNU C Library by Roland McGrath.
+ */
+
+/* Ugly hack because of unknown problems w/ wa_list in v*print* in plan9 */
+#ifdef _plan9_
+#define va_list char *
+#endif
+
+#include <stdio.h>
+#include <config.h>
+#include <misc-f.h>
+static unsigned int state;
+void XaoS_srandom(unsigned int x)
+{
+ state = x;
+}
+
+#define MYLONG_MAX 0xffffff /* this is enough for me */
+long int XaoS_random(void)
+{
+ state = ((state * 1103515245) + 12345) & MYLONG_MAX;
+ return state;
+}
diff --git a/src/filter/xfont16.c b/src/filter/xfont16.c
new file mode 100644
index 0000000..1b56d1d
--- /dev/null
+++ b/src/filter/xfont16.c
@@ -0,0 +1,517 @@
+#ifndef CONST
+#define CONST const
+#endif
+CONST unsigned char xfont16[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd, 0x99, 0x81, 0x81, 0x7e,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x7e, 0xff, 0xdb, 0xff, 0xff, 0xc3, 0xe7, 0xff, 0xff, 0x7e,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, 0x18, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0x00, 0x00, 0x1e, 0x0e, 0x1a, 0x32, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x18,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x3e, 0x36, 0x3e, 0x30, 0x30, 0x30, 0x30, 0x70, 0xf0, 0xe0,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x7e, 0x66, 0x7e, 0x66, 0x66, 0x66, 0x66, 0x6e, 0xee, 0xec,
+ 0xc0, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x18, 0x18, 0xdb, 0x3c, 0xe7, 0x3c, 0xdb, 0x18, 0x18,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8, 0xf0, 0xe0, 0xc0, 0x80,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x02, 0x06, 0x0e, 0x1e, 0x3e, 0xfe, 0x3e, 0x1e, 0x0e, 0x06, 0x02,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x66, 0x66,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0xc6,
+ 0x7c, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0xfe, 0xfe,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfc, 0x60, 0x30, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xfe, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x6c, 0xfe, 0x6c, 0x28, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c, 0x38, 0x38, 0x10, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xc6, 0xc6, 0xc6, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x18, 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0xc6, 0x7c,
+ 0x18, 0x18, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18, 0x30, 0x60, 0xc6, 0x86,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18,
+ 0x30, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 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,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x0c, 0x78,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x06,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x60,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xde, 0xde, 0xde, 0xdc, 0xc0, 0x7c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00,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c, 0x18, 0x30, 0x60, 0xc2, 0xc6, 0xfe,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x0e, 0x06, 0x02,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xff, 0x00, 0x00,
+ 0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xe0, 0x60, 0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x1c, 0x36, 0x32, 0x30, 0x78, 0x30, 0x30, 0x30, 0x30, 0x78,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c,
+ 0x0c, 0xcc, 0x78, 0x00,
+ 0x00, 0x00, 0xe0, 0x60, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x66, 0x66, 0x3c, 0x00,
+ 0x00, 0x00, 0xe0, 0x60, 0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0xfe, 0xd6, 0xd6, 0xd6, 0xd6, 0xc6,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c,
+ 0x60, 0x60, 0xf0, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c,
+ 0x0c, 0x0c, 0x1e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x30,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x6c, 0x38, 0x38, 0x38, 0x6c, 0xc6,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e,
+ 0x06, 0x0c, 0xf8, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0e,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x70, 0x18, 0x18, 0x18, 0x0e, 0x18, 0x18, 0x18, 0x18, 0x70,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0xfe, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 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, 0x7e, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x30, 0x00, 0xfe, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc2, 0xc6, 0xfe,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x6c, 0x38, 0x00, 0xfe, 0xc6, 0x8c, 0x18, 0x30, 0x60, 0xc2, 0xc6, 0xfe,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x18, 0x00, 0xfe, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc2, 0xc6, 0xfe,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76,
+ 0x18, 0x30, 0x1e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x30, 0x60, 0x3c, 0x00,
+ 0x00, 0x00, 0x38, 0x1a, 0x1e, 0x1c, 0x18, 0x38, 0x78, 0x58, 0x18, 0x3c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x1b, 0xee, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0xf0,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0c, 0x18, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x0c, 0x78, 0x00,
+ 0x00, 0x00, 0x6c, 0x38, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c,
+ 0x18, 0x0c, 0x78, 0x00,
+ 0x6c, 0x38, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x36, 0x1c,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x0c, 0x18, 0x30, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x36, 0x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x6c, 0x38, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x18, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x30, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0x66, 0xf6,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x30, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6,
+ 0x00, 0x00, 0x00, 0x00,
+ 0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, 0xcc, 0xcc, 0xcc, 0x76,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x18, 0x30, 0x60, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x36, 0x6c, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x0c, 0x18, 0x30, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e,
+ 0x06, 0x0c, 0xf8, 0x00,
+ 0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c,
+ 0x18, 0x0c, 0x78, 0x00,
+ 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+};
diff --git a/src/filter/xfont32.c b/src/filter/xfont32.c
new file mode 100644
index 0000000..0edc3bf
--- /dev/null
+++ b/src/filter/xfont32.c
@@ -0,0 +1,1989 @@
+#include <config.h>
+CONST unsigned char xfont32[] = {
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x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, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0
+};
diff --git a/src/i18n/Makefile.in.in b/src/i18n/Makefile.in.in
new file mode 100644
index 0000000..5c444f8
--- /dev/null
+++ b/src/i18n/Makefile.in.in
@@ -0,0 +1,53 @@
+PO-FILES=@POFILES@
+LANGUAGES=$(PO-FILES:.po=)
+
+# Maybe this should be autogenerated by "configure".
+LOCALEDIR=@LOCALEDIR@
+
+# If other files will be translated, they must be also here:
+CSOURCES=../ui/ui.c ../ui-hlp/menu.c \
+../ui-hlp/play.c ../ui-hlp/ui_helper.c \
+../engine/zoom.c ../engine/btrace.c \
+../ui/dialog.c ../ui/filesel.c ../ui-hlp/render.c \
+../ui/ui-drv/win32/ui_win32.c \
+../ui/ui-drv/cocoa/AppController.m \
+../ui/ui-drv/cocoa/CustomDialog.m
+
+
+MO-FILES = $(LANGUAGES:=.mo)
+
+all: $(MO-FILES)
+
+install: $(MO-FILES)
+ @for i in $(LANGUAGES); do \
+ @INSTALL@ -d $(DESTDIR)$(LOCALEDIR)/$$i/LC_MESSAGES; \
+ @INSTALL@ -m 444 $$i.mo $(DESTDIR)$(LOCALEDIR)/$$i/LC_MESSAGES/xaos.mo; \
+ done
+
+install-win: $(MO-FILES)
+ @for i in $(LANGUAGES); do \
+ @INSTALL@ -d $(DESTDIR)/locale/$$i/LC_MESSAGES; \
+ @INSTALL@ -m 444 $$i.mo $(DESTDIR)/locale/$$i/LC_MESSAGES/xaos.mo; \
+ done
+
+clean:
+ rm -f $(MO-FILES)
+
+distclean: clean
+ rm Makefile
+
+messages.pot: $(CSOURCES)
+ @XGETTEXT@ -o messages.pot $(CSOURCES)
+
+$(PO-FILES): messages.pot
+ test -e $@
+ @MSGMERGE@ $@ messages.pot > $@.new
+ mv $@.new $@
+
+$(MO-FILES): $(PO-FILES)
+ @MSGFMT@ -o $@ -c -v --statistics $(@:.mo=.po)
+
+new-languages: Makefile
+ @for i in $(LANGUAGES); do \
+ test -e $$i.po || cp messages.pot $$i.po; \
+ done
diff --git a/src/i18n/README b/src/i18n/README
new file mode 100644
index 0000000..3f81455
--- /dev/null
+++ b/src/i18n/README
@@ -0,0 +1,156 @@
+Internationalization (i18n) in XaoS
+-----------------------------------
+
+Zoltan Kovacs <kovzol@math.u-szeged.hu>
+
+Last modification information:
+$Header: /home/jblang/XaoS-cvsbackup/XaoS/src/i18n/README,v 1.8 2008-04-21 05:48:44 kovzol Exp $
+
+
+
+1. INTRODUCTION
+
+As of version 3.1, i18n support is added to XaoS. This is done
+with the GNU gettext utility. In this first release only the menus
+and most internal strings can be translated, the old method in
+../../catalogs haven't changed yet.
+
+Note that i18n cannot be used if you don't have gettext installed
+on your system. I used gettext-0.10.37 which works greatly for Linux
+and gettext-0.10.40 for DOS version. You do not have to worry
+if you are running Linux: gettext is a standard package of most
+Linux installation.
+
+Bad news for Windows users: i18n does not work fully for Windows yet,
+only in DOS mode. In addition, some Windows support i18n in DOS mode,
+some of them not. (In fact in most Windows version I was not able to
+force i18n. I had to exit Windows and start native DOS mode. This should
+really work under Windows 95.) The main problem is that XaoS works
+with static dialogs and Win32 must be a bit rewritten to make
+it work.
+
+Unfortunately, under DOS some complex messages are not supported
+(press 'l' to check if your gettext version handles all types of
+message strings properly).
+
+
+2. HOW TO INSTALL A NEW LANGUAGE
+
+This will work only on Unix systems.
+
+* Edit ../../configure.in and add your language code into the LINGUAS
+variable. This is a 2 letter long code (e.g. "cs" for Czech, "de" for
+German).
+
+* Run autoconf.
+
+* Type "./configure" in the directory ../.., then come back.
+
+* Type "make new-languages". This will generate a so-called .po-file
+ for you (e.g. "cs.po" or "de.po").
+
+* Edit the generated file manually. The first 15 lines should be filled in
+ properly, otherwise nothing will work in your language. The other
+ lines should be also filled in respectively. Note that you should
+ change the "msgstr" rows only. See the Hungarian language file,
+ "hu.po" for example. Important, that the first "#, fuzzy" line must be
+ removed.
+
+* Type a "make" to generate the so-called .mo-files. These files will be
+ installed later to the directory /usr/share/locale/ under Linux
+ and ../../locale under Windows/DOS systems. You should have
+ superuser rights to install them to their appropriate place with
+ the well known statement "make install".
+
+* That's all, start XaoS and enjoy it. ;-)
+
+* Please share your .po-file with the others! You may inform me that a
+ new language file was created by you. If it works, we will add it to
+ the CVS tree of XaoS as well.
+
+
+3. EXPERT'S GUIDE
+
+I'm not an expert, I just only want to share my little knowledge with you
+if you're interested:
+
+* To set up different languages and try out each one you probably have
+ to set the LC_ALL variable. E.g., I had to change it to de_DE or hu_HU
+ to test different languages. (On DOS I had to set the variable
+ LANG to de or hu, etc.)
+
+* Read the gettext howto ("info gettext"). It's quite long, though.
+
+* To internationalize other texts in XaoS, you should edit first the
+ variable CSOURCES in the makefile. Second, each "not static" string
+ in these C sources may be internationalized with the gettext()
+ function. See the existing tags for example. Again, please share
+ your modified code with us.
+
+* Gettext for autoconf is written using a non-standard (but working) way.
+ If you find an error, please send a bug report to me.
+
+
+4. FUTURE PLANS
+
+XaoS i18n is not yet finished. I'm working on it in my spare time.
+Your help is also welcome.
+
+
+5. CONTRIBUTORS
+
+* Andreas Madritsch made the German translation and tested i18n very
+ intensively. With his help I made lots of fixes in i18n stuff.
+
+* Martin Dozsa translated menus into Czech.
+
+* Ceser Perez contributed the Spanish translations.
+
+Thanks to everyone!
+
+
+6. IMPORTANT NOTES FOR MODERN LINUX SYSTEMS
+
+(Contributed by Ã. Fekete and Z. Kovács.)
+
+! Note: the information provided in this section is not valid anymore,
+! because XaoS 3.4 already support UTF-8 encodings natively. We don't
+! delete this section, however, for historical reasons. ;-)
+
+This section describes how to display Hungarian characters correctly in XaoS
+on Ubuntu 7.10. But this may be help on other systems, too. The section should
+be useful for other non-English users as well.
+
+XaoS displays Hungarian characters wrongly because the locale is not set well.
+
+1.) So check the output of the following command:
+
+$ locale
+
+and if the locale character set is not ISO-8859-2,
+then this should be the problem. In this case,
+
+2.) check if your locale is in /var/lib/locales/supported.d/local
+(and /var/lib/locales/supported.d/*) and if not, write a line describing
+
+your locale to the end of these files. That line should be one line of
+the file /usr/share/i18n/SUPPORTED, for example:
+
+hu_HU ISO-8859-2
+
+3.) Run
+
+$ sudo dpkg-reconfigure locales
+
+entering your administrative password.
+
+4.) Before running xaos, give this locale to the LC_ALL environment
+variable, for example:
+
+$ export LC_ALL=hu_HU
+
+5.) You should be able to run xaos with the menu in readable format,
+but the letters õ and û are still not good in the terminal. If you want
+
+to change that and are using gnome-terminal, set the character encoding
+to Central European (ISO-8859-2) in the Terminal menu.
diff --git a/src/i18n/cs.po b/src/i18n/cs.po
new file mode 100644
index 0000000..b5ff6aa
--- /dev/null
+++ b/src/i18n/cs.po
@@ -0,0 +1,1836 @@
+# XaoS NLS file for Czech language.
+# Copyright (C) 2002 Free Software Foundation, Inc.
+# Zoltan Kovacs <kovzol@math.u-szeged.hu>, 2002.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: XaoS 3.2\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-11-14 10:56+0100\n"
+"PO-Revision-Date: 2002-08-17 21:44+0200\n"
+"Last-Translator: MadSoft <madsoft@centrum.cz>\n"
+"Language-Team: Czech\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-2\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+# ../ui/ui.c:307
+#: ../ui/ui.c:314
+msgid "XaoS is out of memory."
+msgstr "Memórie je zaplnìná."
+
+# ../ui/ui.c:355
+#: ../ui/ui.c:360
+#, fuzzy, c-format
+msgid "%s %.2f times (%.1fE) %2.2f frames/sec %c %i %i %i %i "
+msgstr ""
+"%2$.2f-krát %1$s %3$2.2f obrazù/sec %4$c %5$i %6$i %7$i %8$i "
+
+# ../ui/ui.c:355
+#: ../ui/ui.c:361
+msgid "unzoomed"
+msgstr "zmen¹ení"
+
+# ../ui/ui.c:355
+#: ../ui/ui.c:361
+msgid "zoomed"
+msgstr "zvìt¹ení"
+
+# ../ui/ui.c:358
+#: ../ui/ui.c:369
+#, c-format
+msgid "framerate:%f\n"
+msgstr "obnovení obrazu:%f\n"
+
+# ../ui/ui.c:406
+#: ../ui/ui.c:409
+#, c-format
+msgid "Enabling: %s. "
+msgstr "%s zapnout."
+
+# ../ui/ui.c:408
+#: ../ui/ui.c:411
+#, c-format
+msgid "Disabling: %s. "
+msgstr "%s vypnout."
+
+# ../ui/ui.c:442
+#: ../ui/ui.c:441
+#, c-format
+msgid "Fractal name:%s"
+msgstr "Jméno fraktálu:%s"
+
+# ../ui/ui.c:444
+#: ../ui/ui.c:446
+#, c-format
+msgid "Fractal type:%s"
+msgstr "Tip fraktálu:%s"
+
+# ../ui-hlp/menu.c:1082
+#: ../ui/ui.c:448
+#, fuzzy
+msgid "Mandelbrot"
+msgstr "Souprava mandelbrot"
+
+# ../ui-hlp/menu.c:1083
+#: ../ui/ui.c:449
+#, fuzzy
+msgid "Julia"
+msgstr "Souprava julia"
+
+# ../ui-hlp/menu.c:916
+#: ../ui/ui.c:452
+#, fuzzy, c-format
+msgid "Formula:%s"
+msgstr "Vzorec"
+
+# ../ui/ui.c:446
+#: ../ui/ui.c:457
+#, c-format
+msgid "View:[%1.12f,%1.12f]"
+msgstr "Zobrazení:[%1.12f,%1.12f]"
+
+# ../ui/ui.c:448
+#: ../ui/ui.c:461
+#, c-format
+msgid "size:[%1.12f,%1.12f]"
+msgstr "Velikost:[%1.12fx%1.12f]"
+
+# ../ui/ui.c:450
+#: ../ui/ui.c:465
+#, c-format
+msgid "Rotation:%4.2f Screen size:%i:%i"
+msgstr "Otáèení:%4.2f Velikost obrazovky:%i:%i"
+
+# ../ui/ui.c:452
+#: ../ui/ui.c:470
+#, c-format
+msgid "Iterations:%-4i Palette size:%i"
+msgstr "Poèet iterací:%-4i Velikost palety barev:%i"
+
+# ../ui/ui.c:454
+#: ../ui/ui.c:477
+#, c-format
+msgid "Autopilot:%-4s Plane:%s"
+msgstr "Autopilot:%-4s Plocha:%s"
+
+# ../ui/ui.c:454
+#: ../ui/ui.c:478
+msgid "On"
+msgstr "Zapnout"
+
+# ../ui/ui.c:454
+#: ../ui/ui.c:478
+msgid "Off"
+msgstr "Vypnout"
+
+# ../ui/ui.c:456
+#: ../ui/ui.c:482
+#, c-format
+msgid "incoloring:%s outcoloring:%s"
+msgstr "vnitøní vybarvení:%s vnìj¹í vybarvení:%s"
+
+# ../ui/ui.c:458
+#: ../ui/ui.c:487
+#, c-format
+msgid "zoomspeed:%f"
+msgstr "rychlost zvìt¹ení:%f"
+
+# ../ui/ui.c:461
+#: ../ui/ui.c:491
+msgid "Parameter:none"
+msgstr "Parametr:není"
+
+# ../ui/ui.c:463
+#: ../ui/ui.c:493
+#, c-format
+msgid "Parameter:[%f,%f]"
+msgstr "Parametr:[%f,%f]"
+
+# ../ui/ui.c:550
+#: ../ui/ui.c:585
+#, c-format
+msgid "Please wait while calculating %s"
+msgstr "Prosím èekejte, %s fraktál se pøipravuje..."
+
+# ../ui/ui.c:657
+#: ../ui/ui.c:685
+#, c-format
+msgid "Letters per second %i "
+msgstr "%i písmen za sekundu"
+
+# ../ui/ui.c:669 ../ui/ui.c:677
+#: ../ui/ui.c:698 ../ui/ui.c:709
+#, c-format
+msgid "Rotation speed:%2.2f degrees per second "
+msgstr "Rychlost rotace:%2.2f stupòù za sekundu "
+
+# ../ui/ui.c:687
+#: ../ui/ui.c:719
+#, fuzzy, c-format
+msgid "Iterations: %i "
+msgstr "Poèet iterací: %i "
+
+# ../ui/ui.c:704
+#: ../ui/ui.c:735
+#, c-format
+msgid "Cycling speed: %i "
+msgstr "Rychlost obracení barev: %i "
+
+# ../ui/ui.c:717 ../ui/ui.c:730
+#: ../ui/ui.c:748 ../ui/ui.c:762
+#, c-format
+msgid "speed:%2.2f "
+msgstr "rychlost:%2.2f "
+
+# ../ui/ui.c:968
+#: ../ui/ui.c:854
+#, c-format
+msgid "Thank you for using XaoS\n"
+msgstr "Dìkujeme za pou¾ití programu XaoS\n"
+
+# ../ui/ui.c:1008
+#: ../ui/ui.c:891
+msgid "Skipping, please wait..."
+msgstr "Pøeskakování, prosím èekejte..."
+
+#: ../ui/ui.c:983 ../ui/ui.c:985 ../ui/ui-drv/win32/ui_win32.c:1453
+msgid "Resize"
+msgstr ""
+
+# ../ui/ui.c:1146
+#: ../ui/ui.c:998
+#, fuzzy
+msgid "Quit"
+msgstr "Zavøít"
+
+# ../ui/ui.c:1147
+#: ../ui/ui.c:999
+msgid "Exit now"
+msgstr "Zavøít ihned"
+
+# ../ui/ui.c:1148
+#: ../ui/ui.c:1001
+msgid "Not yet"
+msgstr "Je¹tì rad¹i ne"
+
+# ../ui-hlp/menu.c:935 ../ui-hlp/menu.c:940 ../ui/ui.c:1149
+#: ../ui/ui.c:1004 ../ui-hlp/menu.c:1055 ../ui-hlp/menu.c:1065
+#: ../ui/dialog.c:404 ../ui/dialog.c:1380
+msgid "Help"
+msgstr "Nápovìda"
+
+# ../ui/ui.c:1150
+#: ../ui/ui.c:1006
+msgid "Disable XaoS's builtin GUI"
+msgstr "Vypnutí zabudované GUI"
+
+# ../ui/ui.c:1152 ../ui/ui.c:1156
+#: ../ui/ui.c:1010 ../ui/ui.c:1016
+msgid "Status"
+msgstr "Vlastnosti"
+
+# ../ui/ui.c:1153 ../ui/ui.c:1157
+#: ../ui/ui.c:1012 ../ui/ui.c:1018
+msgid "Ministatus"
+msgstr "Hlavnìj¹í vlastnosti"
+
+# ../ui/ui.c:1159 ../ui/ui.c:1160
+#: ../ui/ui.c:1021 ../ui/ui.c:1022
+msgid "Driver"
+msgstr "Grafický ovladaè"
+
+# ../ui/ui.c:1494
+#: ../ui/ui.c:1413
+#, c-format
+msgid "Welcome to XaoS version %s"
+msgstr "Zdravíme vás ve %s Xaos verzi!"
+
+# ../ui/ui.c:801
+#: ../ui/ui.c:1580
+msgid "Can not allocate buffers"
+msgstr "Není dostatek pufferu"
+
+# ../ui/ui.c:812
+#: ../ui/ui.c:1598
+msgid "Can not create palette"
+msgstr "Paleta barev nelze vytvoøit"
+
+# ../ui/ui.c:820
+#: ../ui/ui.c:1610
+msgid "Can not create image"
+msgstr "Obraz nelze vytvoøit"
+
+# ../ui/ui.c:853 ../ui/ui.c:917
+#: ../ui/ui.c:1641 ../ui/ui.c:1692
+msgid "Can not allocate tables"
+msgstr "Není místo pro tabulky"
+
+# ../ui/ui.c:901
+#: ../ui/ui.c:1678
+msgid "Can not initialize driver"
+msgstr "Grafický ovladaè nelze inicializovat"
+
+# ../ui/ui.c:904
+#: ../ui/ui.c:1681
+msgid "Can not return back to previous driver"
+msgstr "Pøedchzí grafický ovladaè nelze zobrazit"
+
+# ../ui-hlp/menu.c:992 ../ui-hlp/menu.c:993 ../ui-hlp/menu.c:1099
+#: ../ui-hlp/menu.c:129
+#, fuzzy
+msgid "Perturbation:"
+msgstr "Perturbace"
+
+# ../ui-hlp/menu.c:1007
+#: ../ui-hlp/menu.c:133
+#, fuzzy
+msgid "Julia-seed:"
+msgstr "Rychlost julia"
+
+# ../ui-hlp/menu.c:892
+#: ../ui-hlp/menu.c:137
+#, fuzzy
+msgid "Morphing type:"
+msgstr "Pøetvoøící se èára"
+
+# ../ui/ui.c:1152 ../ui/ui.c:1156
+#: ../ui-hlp/menu.c:138
+#, fuzzy
+msgid "Startuptime:"
+msgstr "Vlastnosti"
+
+# ../ui/ui.c:1152 ../ui/ui.c:1156
+#: ../ui-hlp/menu.c:139
+#, fuzzy
+msgid "Stoptime:"
+msgstr "Vlastnosti"
+
+#: ../ui-hlp/menu.c:143
+msgid "File to render:"
+msgstr ""
+
+# ../ui-hlp/menu.c:928 ../ui-hlp/menu.c:938
+#: ../ui-hlp/menu.c:144
+#, fuzzy
+msgid "Basename:"
+msgstr "Soubor"
+
+#: ../ui-hlp/menu.c:145
+msgid "Width:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:146
+#, fuzzy
+msgid "Height:"
+msgstr "Doprava"
+
+#: ../ui-hlp/menu.c:147
+msgid "Real width (cm):"
+msgstr ""
+
+#: ../ui-hlp/menu.c:148
+msgid "Real height (cm):"
+msgstr ""
+
+# ../ui/ui.c:358
+#: ../ui-hlp/menu.c:149
+#, fuzzy
+msgid "Framerate:"
+msgstr "obnovení obrazu:%f\n"
+
+#: ../ui-hlp/menu.c:150
+msgid "Image type:"
+msgstr ""
+
+# ../ui-hlp/menu.c:1023
+#: ../ui-hlp/menu.c:151
+#, fuzzy
+msgid "Antialiasing:"
+msgstr "Iterace"
+
+# ../ui-hlp/menu.c:1045
+#: ../ui-hlp/menu.c:152
+#, fuzzy
+msgid "Always recalculate:"
+msgstr "Poèítání"
+
+#: ../ui-hlp/menu.c:153
+msgid "Calculate MPEG motion vectors:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:154
+msgid "Recommended I frame distance:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:158
+#, fuzzy
+msgid "Center:"
+msgstr "Doprostøed"
+
+#: ../ui-hlp/menu.c:159
+msgid "Radius:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:160 ../ui-hlp/menu.c:225
+msgid "Angle:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:164
+#, fuzzy
+msgid "Mode:"
+msgstr "Do prostøed"
+
+# ../ui/ui.c:1152 ../ui/ui.c:1156
+#: ../ui-hlp/menu.c:165
+#, fuzzy
+msgid "Start:"
+msgstr "Vlastnosti"
+
+#: ../ui-hlp/menu.c:166
+msgid "End:"
+msgstr ""
+
+# ../ui-hlp/menu.c:952
+#: ../ui-hlp/menu.c:170
+#, fuzzy
+msgid "Color:"
+msgstr "Barva"
+
+# ../ui-hlp/menu.c:1033
+#: ../ui-hlp/menu.c:174
+#, fuzzy
+msgid "Rotations per second:"
+msgstr "Rychlost rotace"
+
+# ../ui-hlp/menu.c:924 ../ui-hlp/menu.c:925
+#: ../ui-hlp/menu.c:178
+#, fuzzy
+msgid "Letters per second:"
+msgstr "Písmen za sekund"
+
+# ../ui-hlp/menu.c:1023
+#: ../ui-hlp/menu.c:182
+#, fuzzy
+msgid "Iterations:"
+msgstr "Iterace"
+
+#: ../ui-hlp/menu.c:186
+msgid "Text:"
+msgstr ""
+
+# ../ui-hlp/menu.c:944
+#: ../ui-hlp/menu.c:190
+#, fuzzy
+msgid "Your command:"
+msgstr "Pøíkaz"
+
+# ../ui-hlp/menu.c:928 ../ui-hlp/menu.c:938
+#: ../ui-hlp/menu.c:194 ../ui-hlp/menu.c:198 ../ui-hlp/menu.c:202
+#: ../ui-hlp/menu.c:206 ../ui-hlp/menu.c:258
+#, fuzzy
+msgid "Filename:"
+msgstr "Soubor"
+
+# ../ui-hlp/menu.c:916
+#: ../ui-hlp/menu.c:210 ../ui-hlp/menu.c:298
+#, fuzzy
+msgid "Formula:"
+msgstr "Vzorec"
+
+#: ../ui-hlp/menu.c:214
+#, fuzzy
+msgid "X center:"
+msgstr "Doprostøed"
+
+#: ../ui-hlp/menu.c:215
+#, fuzzy
+msgid "Y center:"
+msgstr "Doprostøed"
+
+#: ../ui-hlp/menu.c:216
+msgid "X Radius:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:217
+msgid "Y Radius:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:221
+msgid "Coordinates:"
+msgstr ""
+
+# ../ui-hlp/menu.c:1031
+#: ../ui-hlp/menu.c:229
+#, fuzzy
+msgid "continuous rotation"
+msgstr "Plynulá rotace"
+
+# ../ui-hlp/menu.c:1035
+#: ../ui-hlp/menu.c:233
+#, fuzzy
+msgid "Fast rotation"
+msgstr "Rychlý re¾im rotace"
+
+# ../ui-hlp/menu.c:919
+#: ../ui-hlp/menu.c:237
+#, fuzzy
+msgid "filter"
+msgstr "Filtr"
+
+#: ../ui-hlp/menu.c:238
+msgid "enable"
+msgstr ""
+
+#: ../ui-hlp/menu.c:242
+msgid "Amount:"
+msgstr ""
+
+# ../ui-hlp/menu.c:1048
+#: ../ui-hlp/menu.c:246
+#, fuzzy
+msgid "Zooming speed:"
+msgstr "Rychlost zvìt¹ení"
+
+#: ../ui-hlp/menu.c:250
+msgid "Name:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:254
+msgid "Bailout:"
+msgstr ""
+
+# ../ui-hlp/menu.c:999
+#: ../ui-hlp/menu.c:262
+#, fuzzy
+msgid "Julia mode:"
+msgstr "Re¾im julia"
+
+# ../ui-hlp/menu.c:953
+#: ../ui-hlp/menu.c:266
+#, fuzzy
+msgid "Horizontal position:"
+msgstr "Vodorovná pozice textu"
+
+# ../ui-hlp/menu.c:954
+#: ../ui-hlp/menu.c:267
+#, fuzzy
+msgid "Vertical position:"
+msgstr "Svislá pozice textu"
+
+# ../ui-hlp/menu.c:1021
+#: ../ui-hlp/menu.c:271
+#, fuzzy
+msgid "Dynamic resolution:"
+msgstr "Dinamické rozlo¾ení"
+
+#: ../ui-hlp/menu.c:275
+msgid "Time:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:279 ../ui-hlp/menu.c:283
+msgid "Number:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:287
+msgid "Algorithm number:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:288
+msgid "Seed:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:289
+msgid "Shift:"
+msgstr ""
+
+# ../ui-hlp/menu.c:924 ../ui-hlp/menu.c:925
+#: ../ui-hlp/menu.c:293
+#, fuzzy
+msgid "Frames per second:"
+msgstr "Písmen za sekund"
+
+# ../ui-hlp/menu.c:1023
+#: ../ui-hlp/menu.c:302
+#, fuzzy
+msgid "Initialization:"
+msgstr "Iterace"
+
+#: ../ui-hlp/menu.c:357
+msgid "renderanim: Must specify a valid absolute path for basename"
+msgstr ""
+
+#: ../ui-hlp/menu.c:364
+msgid ""
+"renderanim: Width parameter must be positive integer in the range 0..4096"
+msgstr ""
+
+#: ../ui-hlp/menu.c:370
+msgid ""
+"renderanim: Height parameter must be positive integer in the range 0..4096"
+msgstr ""
+
+#: ../ui-hlp/menu.c:376
+msgid "renderanim: Invalid real width and height dimensions"
+msgstr ""
+
+#: ../ui-hlp/menu.c:380
+msgid "renderanim: invalid framerate"
+msgstr ""
+
+#: ../ui-hlp/menu.c:386
+msgid "renderanim: antialiasing not supported in 256 color mode"
+msgstr ""
+
+#: ../ui-hlp/menu.c:390
+msgid "renderanim: incorrect I frame distance"
+msgstr ""
+
+#: ../ui-hlp/menu.c:441 ../ui-hlp/menu.c:454
+msgid "animateview: Invalid viewpoint"
+msgstr ""
+
+#: ../ui-hlp/menu.c:467
+msgid "Invalid viewpoint"
+msgstr ""
+
+# ../ui-hlp/menu.c:919
+#: ../ui-hlp/menu.c:696
+#, fuzzy
+msgid "Unknown palette type"
+msgstr "Filtr"
+
+#: ../ui-hlp/menu.c:771 ../ui-hlp/menu.c:785
+msgid "Initialization of color cycling failed."
+msgstr ""
+
+#: ../ui-hlp/menu.c:773 ../ui-hlp/menu.c:787
+msgid "Try to enable palette emulation filter"
+msgstr ""
+
+#: ../ui-hlp/menu.c:896
+#, c-format
+msgid "Algorithm:%i seed:%i size:%i"
+msgstr ""
+
+# ../ui-hlp/menu.c:876
+#: ../ui-hlp/menu.c:947
+msgid "Root menu"
+msgstr "Hlavní menu"
+
+# ../ui-hlp/menu.c:877
+#: ../ui-hlp/menu.c:948
+msgid "Animation root menu"
+msgstr "Hlavní menu animací"
+
+#: ../ui-hlp/menu.c:949
+msgid "Replay only commands"
+msgstr ""
+
+#: ../ui-hlp/menu.c:950
+msgid "Command line options only"
+msgstr ""
+
+#: ../ui-hlp/menu.c:953
+msgid "print menus specifications of all menus"
+msgstr ""
+
+# ../ui-hlp/menu.c:883
+#: ../ui-hlp/menu.c:958
+msgid "print menu specification"
+msgstr ""
+
+#: ../ui-hlp/menu.c:961
+msgid "print menu specification in xshl format"
+msgstr ""
+
+# ../ui-hlp/menu.c:885
+#: ../ui-hlp/menu.c:965
+msgid "print all menu specifications in xshl format"
+msgstr ""
+
+#: ../ui-hlp/menu.c:967
+msgid "print dialog specification"
+msgstr ""
+
+# ../ui-hlp/menu.c:890
+#: ../ui-hlp/menu.c:972
+msgid "Line drawing functions"
+msgstr "Funkce malování èar"
+
+# ../ui-hlp/menu.c:891
+#: ../ui-hlp/menu.c:973
+msgid "Line"
+msgstr "Èára"
+
+# ../ui-hlp/menu.c:892
+#: ../ui-hlp/menu.c:976
+msgid "Morph line"
+msgstr "Pøetvoøící se èára"
+
+# ../ui-hlp/menu.c:893
+#: ../ui-hlp/menu.c:978
+msgid "Morph last line"
+msgstr "Pøemìòující se poslední èára"
+
+# ../ui-hlp/menu.c:894
+#: ../ui-hlp/menu.c:981
+msgid "Set line key"
+msgstr "Nastavení èárového klíèe"
+
+# ../ui-hlp/menu.c:895
+#: ../ui-hlp/menu.c:983
+msgid "Clear line"
+msgstr "Vymazání èáry"
+
+# ../ui-hlp/menu.c:896
+#: ../ui-hlp/menu.c:986
+msgid "Clear all lines"
+msgstr "Vymazání v¹ech èar"
+
+# ../ui-hlp/menu.c:898
+#: ../ui-hlp/menu.c:988
+msgid "Animation functions"
+msgstr "Animace"
+
+# ../ui-hlp/menu.c:899 ../ui-hlp/menu.c:995 ../ui-hlp/menu.c:1000
+#: ../ui-hlp/menu.c:989 ../ui-hlp/menu.c:1181 ../ui-hlp/menu.c:1190
+msgid "View"
+msgstr "Zobrazení"
+
+# ../ui-hlp/menu.c:900
+#: ../ui-hlp/menu.c:993
+msgid "Morph view"
+msgstr ""
+
+# ../ui-hlp/menu.c:892
+#: ../ui-hlp/menu.c:995
+#, fuzzy
+msgid "Morph julia"
+msgstr "Pøetvoøící se èára"
+
+# ../ui-hlp/menu.c:902
+#: ../ui-hlp/menu.c:1000
+msgid "Move view"
+msgstr ""
+
+# ../ui-hlp/menu.c:892
+#: ../ui-hlp/menu.c:1002
+#, fuzzy
+msgid "Morph angle"
+msgstr "Pøetvoøící se èára"
+
+# ../ui-hlp/menu.c:904
+#: ../ui-hlp/menu.c:1004
+msgid "Zoom center"
+msgstr "Centrum zvìt¹ení"
+
+# ../ui-hlp/menu.c:905
+#: ../ui-hlp/menu.c:1006 ../ui/ui-drv/cocoa/AppController.m:343
+msgid "Zoom"
+msgstr "Zvìt¹ení"
+
+# ../ui-hlp/menu.c:906
+#: ../ui-hlp/menu.c:1007
+msgid "Un-zoom"
+msgstr "Zmen¹ení"
+
+# ../ui-hlp/menu.c:907
+#: ../ui-hlp/menu.c:1010
+msgid "Stop zooming"
+msgstr "Zastavení zvìt¹ení"
+
+# ../ui-hlp/menu.c:908
+#: ../ui-hlp/menu.c:1011
+msgid "Smooth morphing parameters"
+msgstr "Parametry zahladìní"
+
+# ../ui-hlp/menu.c:910
+#: ../ui-hlp/menu.c:1014
+msgid "Timing functions"
+msgstr "Èasování"
+
+# ../ui-hlp/menu.c:911
+#: ../ui-hlp/menu.c:1015
+msgid "Usleep"
+msgstr "Èekání"
+
+# ../ui-hlp/menu.c:912
+#: ../ui-hlp/menu.c:1018
+msgid "Wait for text"
+msgstr "Èekání na text"
+
+# ../ui-hlp/menu.c:913
+#: ../ui-hlp/menu.c:1020
+msgid "Wait for complete image"
+msgstr "Èekání na zobrazení obrazu"
+
+# ../ui-hlp/menu.c:914
+#: ../ui-hlp/menu.c:1022
+msgid "Include file"
+msgstr "Navlékání souboru"
+
+# ../ui-hlp/menu.c:915 ../ui-hlp/menu.c:1009
+#: ../ui-hlp/menu.c:1024 ../ui-hlp/menu.c:1222
+msgid "Default palette"
+msgstr "Základní barvy"
+
+# ../ui-hlp/menu.c:916
+#: ../ui-hlp/menu.c:1026
+msgid "Formula"
+msgstr "Vzorec"
+
+# ../ui-hlp/menu.c:917
+#: ../ui-hlp/menu.c:1028
+msgid "Maximal zooming step"
+msgstr "Maximální krok zìt¹ení"
+
+# ../ui-hlp/menu.c:918
+#: ../ui-hlp/menu.c:1030
+msgid "Zooming speedup"
+msgstr "Rychlost zvìt¹ení"
+
+# ../ui-hlp/menu.c:919
+#: ../ui-hlp/menu.c:1032
+msgid "Filter"
+msgstr "Filtr"
+
+# ../ui-hlp/menu.c:924 ../ui-hlp/menu.c:925
+#: ../ui-hlp/menu.c:1036 ../ui-hlp/menu.c:1041
+msgid "Letters per second"
+msgstr "Písmen za sekund"
+
+# ../ui-hlp/menu.c:926 ../ui-hlp/menu.c:1046
+#: ../ui-hlp/menu.c:1043 ../ui-hlp/menu.c:1314
+msgid "Interrupt"
+msgstr "Pøeru¹ení"
+
+# ../ui-hlp/menu.c:928 ../ui-hlp/menu.c:938
+#: ../ui-hlp/menu.c:1045 ../ui-hlp/menu.c:1057
+msgid "File"
+msgstr "Soubor"
+
+# ../ui-hlp/menu.c:929
+#: ../ui-hlp/menu.c:1046
+msgid "Edit"
+msgstr "Upravení"
+
+# ../ui-hlp/menu.c:930
+#: ../ui-hlp/menu.c:1047
+msgid "Fractal"
+msgstr "Fraktál"
+
+# ../ui-hlp/menu.c:931
+#: ../ui-hlp/menu.c:1048
+msgid "Calculation"
+msgstr "Poèítání"
+
+# ../ui-hlp/menu.c:932 ../ui-hlp/menu.c:1096
+#: ../ui-hlp/menu.c:1049 ../ui-hlp/menu.c:1391
+msgid "Filters"
+msgstr "Filtry"
+
+# ../ui-hlp/menu.c:933 ../ui-hlp/menu.c:941
+#: ../ui-hlp/menu.c:1050 ../ui-hlp/menu.c:1064
+msgid "UI"
+msgstr "U¾ivatelské rozhraní"
+
+# ../ui-hlp/menu.c:934
+#: ../ui-hlp/menu.c:1051
+msgid "Misc"
+msgstr "Ostatní"
+
+# ../ui-hlp/menu.c:982
+#: ../ui-hlp/menu.c:1053
+#, fuzzy
+msgid "Window"
+msgstr "Zpìt"
+
+# ../ui-hlp/menu.c:937
+#: ../ui-hlp/menu.c:1056
+msgid "Tutorials"
+msgstr "Výuky"
+
+# ../ui-hlp/menu.c:939
+#: ../ui-hlp/menu.c:1062
+msgid "Stop replay"
+msgstr "Zastavení opakování"
+
+# ../ui-hlp/menu.c:944
+#: ../ui-hlp/menu.c:1066
+msgid "Command"
+msgstr "Pøíkaz"
+
+# ../ui-hlp/menu.c:945
+#: ../ui-hlp/menu.c:1068
+msgid "Play string"
+msgstr "Spustìní øetìzce"
+
+# ../ui-hlp/menu.c:1039
+#: ../ui-hlp/menu.c:1070
+#, fuzzy
+msgid "Render animation"
+msgstr "Jenom bìhem animace"
+
+# ../ui-hlp/menu.c:948
+#: ../ui-hlp/menu.c:1073
+msgid "Clear screen"
+msgstr "Vièi¹tìní obrazovky"
+
+# ../ui-hlp/menu.c:949
+#: ../ui-hlp/menu.c:1075
+msgid "Display fractal"
+msgstr "Zobrazení fraktálu"
+
+# ../ui-hlp/menu.c:951
+#: ../ui-hlp/menu.c:1078
+msgid "Display text"
+msgstr "Zobrazení textu"
+
+# ../ui-hlp/menu.c:952
+#: ../ui-hlp/menu.c:1080
+#, fuzzy
+msgid "Color"
+msgstr "Barva"
+
+# ../ui-hlp/menu.c:953
+#: ../ui-hlp/menu.c:1082
+msgid "Horizontal text position"
+msgstr "Vodorovná pozice textu"
+
+# ../ui-hlp/menu.c:954
+#: ../ui-hlp/menu.c:1084
+msgid "Vertical text position"
+msgstr "Svislá pozice textu"
+
+# ../ui-hlp/menu.c:955
+#: ../ui-hlp/menu.c:1086
+msgid "Text position"
+msgstr "Pozice textu"
+
+# ../ui-hlp/menu.c:956
+#: ../ui-hlp/menu.c:1090
+msgid "Message"
+msgstr "Vzkaz"
+
+# ../ui-hlp/menu.c:968
+#: ../ui-hlp/menu.c:1112
+msgid "Load"
+msgstr "Otevøení"
+
+# ../ui-hlp/menu.c:969
+#: ../ui-hlp/menu.c:1115
+msgid "Save"
+msgstr "Ulo¾ení"
+
+# ../ui-hlp/menu.c:972
+#: ../ui-hlp/menu.c:1117
+msgid "Record"
+msgstr "Nahrávání"
+
+# ../ui-hlp/menu.c:973
+#: ../ui-hlp/menu.c:1121
+msgid "Replay"
+msgstr "Pøehrávání"
+
+# ../ui-hlp/menu.c:975
+#: ../ui-hlp/menu.c:1128
+msgid "Save image"
+msgstr "Ulo¾ení obrazu"
+
+# ../ui-hlp/menu.c:976
+#: ../ui-hlp/menu.c:1130
+msgid "Load random example"
+msgstr "Nahrání náhodného pøíkladu"
+
+# ../ui-hlp/menu.c:977
+#: ../ui-hlp/menu.c:1132
+msgid "Save configuration"
+msgstr "Ulo¾ení konfigurace"
+
+# ../ui-hlp/menu.c:982
+#: ../ui-hlp/menu.c:1137
+msgid "Undo"
+msgstr "Zpìt"
+
+# ../ui-hlp/menu.c:983
+#: ../ui-hlp/menu.c:1141
+msgid "Redo"
+msgstr "Udìlat znovu"
+
+# ../ui-hlp/menu.c:984
+#: ../ui-hlp/menu.c:1145
+msgid "Formulae"
+msgstr "Vzorec"
+
+# ../ui-hlp/menu.c:984
+#: ../ui-hlp/menu.c:1146
+#, fuzzy
+msgid "More formulae"
+msgstr "Vzorec"
+
+# ../ui-hlp/menu.c:984
+#: ../ui-hlp/menu.c:1151
+#, fuzzy
+msgid "User formula"
+msgstr "Vzorec"
+
+# ../ui-hlp/menu.c:890
+#: ../ui-hlp/menu.c:1153
+#, fuzzy
+msgid "User initialization"
+msgstr "Funkce malování èar"
+
+# ../ui-hlp/menu.c:986
+#: ../ui-hlp/menu.c:1158
+msgid "Incoloring mode"
+msgstr "Vnitøní vybarvení"
+
+# ../ui-hlp/menu.c:987
+#: ../ui-hlp/menu.c:1159
+msgid "Outcoloring mode"
+msgstr "Vnìj¹í vybarvení"
+
+# ../ui-hlp/menu.c:988
+#: ../ui-hlp/menu.c:1160
+msgid "Plane"
+msgstr "Plocha"
+
+# ../ui-hlp/menu.c:989
+#: ../ui-hlp/menu.c:1161
+#, fuzzy
+msgid "Palette"
+msgstr "Paleta barev"
+
+# ../ui-hlp/menu.c:991
+#: ../ui-hlp/menu.c:1164
+msgid "Mandelbrot mode"
+msgstr "Re¾im mandelbrot"
+
+# ../ui-hlp/menu.c:992 ../ui-hlp/menu.c:993 ../ui-hlp/menu.c:1099
+#: ../ui-hlp/menu.c:1170 ../ui-hlp/menu.c:1174 ../ui-hlp/menu.c:1395
+msgid "Perturbation"
+msgstr "Perturbace"
+
+# ../ui-hlp/menu.c:997
+#: ../ui-hlp/menu.c:1185
+msgid "Reset to defaults"
+msgstr "Nastavení standartu zpìt"
+
+# ../ui-hlp/menu.c:999
+#: ../ui-hlp/menu.c:1186
+msgid "Julia mode"
+msgstr "Re¾im julia"
+
+# ../ui-hlp/menu.c:1001
+#: ../ui-hlp/menu.c:1193
+msgid "Set angle"
+msgstr "Nastavení úhlu"
+
+# ../ui-hlp/menu.c:1002
+#: ../ui-hlp/menu.c:1197
+msgid "Set plane"
+msgstr "Nastavení plochy"
+
+# ../ui-hlp/menu.c:1003
+#: ../ui-hlp/menu.c:1201
+msgid "Inside coloring mode"
+msgstr "Vnitøní vybarvení"
+
+# ../ui-hlp/menu.c:1004
+#: ../ui-hlp/menu.c:1206
+msgid "Outside coloring mode"
+msgstr "Vnìj¹í vybarvení"
+
+# ../ui-hlp/menu.c:1005
+#: ../ui-hlp/menu.c:1212
+msgid "Inside truecolor coloring mode"
+msgstr "Vnitøní truecolor vybarvení"
+
+# ../ui-hlp/menu.c:1006
+#: ../ui-hlp/menu.c:1216
+msgid "Outside truecolor coloring mode"
+msgstr "Vnìj¹í truecolor vybarvení"
+
+# ../ui-hlp/menu.c:1007
+#: ../ui-hlp/menu.c:1219
+msgid "Julia seed"
+msgstr "Rychlost julia"
+
+# ../ui-hlp/menu.c:1010
+#: ../ui-hlp/menu.c:1224
+msgid "Random palette"
+msgstr "Náhodné barvy"
+
+# ../ui-hlp/menu.c:1011
+#: ../ui-hlp/menu.c:1226
+msgid "Custom palette"
+msgstr "U¾ivatelské barvy"
+
+# ../ui-hlp/menu.c:1013
+#: ../ui-hlp/menu.c:1230
+msgid "Color cycling"
+msgstr "Cirkulace barev"
+
+# ../ui-hlp/menu.c:1014
+#: ../ui-hlp/menu.c:1232
+msgid "Reversed color cycling"
+msgstr "Zpìtná cirkulace barev"
+
+# ../ui-hlp/menu.c:1015
+#: ../ui-hlp/menu.c:1237
+msgid "Color cycling speed"
+msgstr "Rychlost cirkulace barev"
+
+# ../ui-hlp/menu.c:1017
+#: ../ui-hlp/menu.c:1241
+msgid "Shift palette"
+msgstr "Posun barevné palety"
+
+# ../ui-hlp/menu.c:1018
+#: ../ui-hlp/menu.c:1243
+msgid "Shift one forward"
+msgstr "Posun dopøedu o jeden krok"
+
+# ../ui-hlp/menu.c:1019
+#: ../ui-hlp/menu.c:1246
+msgid "Shift one backward"
+msgstr "Posun dozadu o jeden krok"
+
+# ../ui-hlp/menu.c:1020
+#: ../ui-hlp/menu.c:1248 ../engine/zoom.c:1357
+msgid "Solid guessing"
+msgstr "Solidní hádání"
+
+# ../ui-hlp/menu.c:1021
+#: ../ui-hlp/menu.c:1249
+msgid "Dynamic resolution"
+msgstr "Dinamické rozlo¾ení"
+
+# ../ui-hlp/menu.c:1022
+#: ../ui-hlp/menu.c:1251
+msgid "Periodicity checking"
+msgstr "Kontrola pravidelnosti"
+
+# ../ui-hlp/menu.c:1023
+#: ../ui-hlp/menu.c:1254
+msgid "Iterations"
+msgstr "Iterace"
+
+#: ../ui-hlp/menu.c:1256
+msgid "Bailout"
+msgstr ""
+
+# ../ui-hlp/menu.c:1025
+#: ../ui-hlp/menu.c:1260
+msgid "Fast julia mode"
+msgstr "Rychlý re¾im julia"
+
+# ../ui-hlp/menu.c:1026
+#: ../ui-hlp/menu.c:1262
+msgid "Rotation"
+msgstr "Rotace"
+
+# ../ui-hlp/menu.c:1027
+#: ../ui-hlp/menu.c:1263
+msgid "Solid guessing range"
+msgstr "Interval hádání"
+
+# ../ui-hlp/menu.c:1029
+#: ../ui-hlp/menu.c:1266
+msgid "Disable rotation"
+msgstr "Rotace vypnuta"
+
+# ../ui-hlp/menu.c:1031
+#: ../ui-hlp/menu.c:1270
+msgid "Continuous rotation"
+msgstr "Plynulá rotace"
+
+# ../ui-hlp/menu.c:1032
+#: ../ui-hlp/menu.c:1273
+msgid "Rotate by mouse"
+msgstr "Rotace mi¹í"
+
+# ../ui-hlp/menu.c:1033
+#: ../ui-hlp/menu.c:1277
+msgid "Rotation speed"
+msgstr "Rychlost rotace"
+
+# ../ui-hlp/menu.c:1034
+#: ../ui-hlp/menu.c:1280
+msgid "Automatic rotation"
+msgstr "Automatická rotace"
+
+# ../ui-hlp/menu.c:1035
+#: ../ui-hlp/menu.c:1285
+msgid "Fast rotation mode"
+msgstr "Rychlý re¾im rotace"
+
+# ../ui-hlp/menu.c:1037
+#: ../ui-hlp/menu.c:1289
+msgid "Disable dynamic resolution"
+msgstr "Dinamický rozli¹ení vypnuto"
+
+# ../ui-hlp/menu.c:1039
+#: ../ui-hlp/menu.c:1292
+msgid "Use only during animation"
+msgstr "Jenom bìhem animace"
+
+# ../ui-hlp/menu.c:1040
+#: ../ui-hlp/menu.c:1296
+msgid "Use also for new images"
+msgstr "Pou¾ij toto i u nových obrazù"
+
+# ../ui-hlp/menu.c:1041
+#: ../ui-hlp/menu.c:1298
+msgid "Dynamic resolution mode"
+msgstr "Re¾im dinamického rozli¹ení"
+
+# ../ui-hlp/menu.c:1043
+#: ../ui-hlp/menu.c:1302
+msgid "Autopilot"
+msgstr "Autopilot"
+
+# ../ui-hlp/menu.c:999
+#: ../ui-hlp/menu.c:1306
+#, fuzzy
+msgid "VJ mode"
+msgstr "Re¾im julia"
+
+# ../ui-hlp/menu.c:1045
+#: ../ui-hlp/menu.c:1310
+msgid "Recalculate"
+msgstr "Poèítání"
+
+# ../ui-hlp/menu.c:1048
+#: ../ui-hlp/menu.c:1319
+msgid "Zooming speed"
+msgstr "Rychlost zvìt¹ení"
+
+# ../ui-hlp/menu.c:1049
+#: ../ui-hlp/menu.c:1321
+msgid "Fixed step"
+msgstr "Stálý krok"
+
+# ../ui-hlp/menu.c:1050
+#: ../ui-hlp/menu.c:1325
+msgid "Disable solid guessing"
+msgstr "Solidní hádání vypnuto"
+
+# ../ui-hlp/menu.c:1052
+#: ../ui-hlp/menu.c:1329
+msgid "Guess 2x2 rectangles"
+msgstr "2x2 obdélník"
+
+# ../ui-hlp/menu.c:1053
+#: ../ui-hlp/menu.c:1331
+msgid "Guess 3x3 rectangles"
+msgstr "3x3 obdélník"
+
+# ../ui-hlp/menu.c:1054
+#: ../ui-hlp/menu.c:1335
+msgid "Guess 4x4 rectangles"
+msgstr "4x4 obdélník"
+
+# ../ui-hlp/menu.c:1055
+#: ../ui-hlp/menu.c:1337
+msgid "Guess 5x5 rectangles"
+msgstr "5x5 obdélník"
+
+# ../ui-hlp/menu.c:1056
+#: ../ui-hlp/menu.c:1341
+msgid "Guess 6x6 rectangles"
+msgstr "6x6 obdélník"
+
+# ../ui-hlp/menu.c:1057
+#: ../ui-hlp/menu.c:1343
+msgid "Guess 7x7 rectangles"
+msgstr "7x7 obdélník"
+
+# ../ui-hlp/menu.c:1058
+#: ../ui-hlp/menu.c:1347
+msgid "Guess 8x8 rectangles"
+msgstr "8x8 obdélník"
+
+# ../ui-hlp/menu.c:1059
+#: ../ui-hlp/menu.c:1349
+msgid "Guess unlimited rectangles"
+msgstr "Nomezený èíslo obdélníkù"
+
+#: ../ui-hlp/menu.c:1354
+msgid "Language"
+msgstr ""
+
+# ../ui-hlp/menu.c:1065
+#: ../ui-hlp/menu.c:1357
+msgid "An introduction to fractals"
+msgstr "Zavedení do svìta fraktálù"
+
+# ../ui-hlp/menu.c:1066
+#: ../ui-hlp/menu.c:1359
+msgid "XaoS features overview"
+msgstr "Tipy a triky"
+
+# ../ui-hlp/menu.c:1067
+#: ../ui-hlp/menu.c:1361
+msgid "Math behind fractals"
+msgstr "Matematika fraktálù"
+
+#: ../ui-hlp/menu.c:1362 ../ui-hlp/menu.c:1403
+msgid "Other fractal types in XaoS"
+msgstr ""
+
+# ../ui-hlp/menu.c:1068
+#: ../ui-hlp/menu.c:1364
+msgid "What's new?"
+msgstr "Novinky"
+
+# ../ui-hlp/menu.c:1079 ../ui-hlp/menu.c:1103
+#: ../ui-hlp/menu.c:1374 ../ui-hlp/menu.c:1398
+msgid "Whole story"
+msgstr "V¹echny kapitoly"
+
+# ../ui-hlp/menu.c:1081
+#: ../ui-hlp/menu.c:1376
+msgid "Introduction"
+msgstr "Úvod"
+
+# ../ui-hlp/menu.c:1082
+#: ../ui-hlp/menu.c:1377
+msgid "Mandelbrot set"
+msgstr "Souprava mandelbrot"
+
+# ../ui-hlp/menu.c:1083
+#: ../ui-hlp/menu.c:1378
+msgid "Julia set"
+msgstr "Souprava julia"
+
+# ../ui-hlp/menu.c:1084
+#: ../ui-hlp/menu.c:1379
+msgid "Higher power Mandelbrots"
+msgstr "Mandelbroty vy¹¹í tøídy"
+
+# ../ui-hlp/menu.c:1085
+#: ../ui-hlp/menu.c:1380
+msgid "Newton's method"
+msgstr "Newtonova metoda"
+
+# ../ui-hlp/menu.c:1086
+#: ../ui-hlp/menu.c:1381
+msgid "Barnsley's formula"
+msgstr "Barnsleyuv vzorec"
+
+# ../ui-hlp/menu.c:1087
+#: ../ui-hlp/menu.c:1382
+msgid "Phoenix"
+msgstr "Phoenix"
+
+# ../ui-hlp/menu.c:1088
+#: ../ui-hlp/menu.c:1383
+msgid "Octo"
+msgstr "Octo"
+
+# ../ui-hlp/menu.c:1089
+#: ../ui-hlp/menu.c:1384
+msgid "Magnet"
+msgstr "Magnet"
+
+# ../ui-hlp/menu.c:1091
+#: ../ui-hlp/menu.c:1385
+msgid "All features"
+msgstr "V¹echny vlastnosti"
+
+# ../ui-hlp/menu.c:1093
+#: ../ui-hlp/menu.c:1387
+msgid "Outcoloring modes"
+msgstr "Vnìj¹í vybarvení"
+
+# ../ui-hlp/menu.c:1094
+#: ../ui-hlp/menu.c:1388
+msgid "Incoloring modes"
+msgstr "Vnitøní vybarvení"
+
+# ../ui-hlp/menu.c:1095
+#: ../ui-hlp/menu.c:1389
+msgid "True-color coloring modes"
+msgstr "True-color vybarvovací re¾imy"
+
+# ../ui-hlp/menu.c:1097
+#: ../ui-hlp/menu.c:1392
+msgid "Planes"
+msgstr "Plochy"
+
+# ../ui-hlp/menu.c:1098
+#: ../ui-hlp/menu.c:1393
+msgid "Animations and position files"
+msgstr "Animace a soubory pozic"
+
+# ../ui-hlp/menu.c:1100
+#: ../ui-hlp/menu.c:1396
+msgid "Random palettes"
+msgstr "Náhodné barevné palety"
+
+# ../ui-hlp/menu.c:1101
+#: ../ui-hlp/menu.c:1397
+msgid "Other noteworthy features"
+msgstr "Dal¹í malièkosti"
+
+# ../ui-hlp/menu.c:1105
+#: ../ui-hlp/menu.c:1400
+msgid "The definition and fractal dimension"
+msgstr "Definice a fraktaldimenze"
+
+# ../ui-hlp/menu.c:1106
+#: ../ui-hlp/menu.c:1402
+msgid "Escape time fractals"
+msgstr "Fraktaly na základu útìku"
+
+#: ../ui-hlp/menu.c:1406
+msgid "Triceratops and Catseye fractals"
+msgstr ""
+
+#: ../ui-hlp/menu.c:1408
+msgid "Mandelbar, Lambda, Manowar and Spider"
+msgstr ""
+
+#: ../ui-hlp/menu.c:1411
+msgid "Sierpinski Gasket, S.Carpet, Koch Snowflake"
+msgstr ""
+
+# ../ui-hlp/menu.c:1108
+#: ../ui-hlp/menu.c:1413
+msgid "What's new in 3.0?"
+msgstr "Novinky ve verzi 3.0"
+
+# ../ui-hlp/menu.c:1039
+#: ../ui-hlp/play.c:74
+#, fuzzy
+msgid "line available only in animation replay"
+msgstr "Jenom bìhem animace"
+
+# ../ui-hlp/menu.c:893
+#: ../ui-hlp/play.c:99
+#, fuzzy
+msgid "Morphing non existing line!"
+msgstr "Pøemìòující se poslední èára"
+
+#: ../ui-hlp/play.c:121
+msgid "linekey not available in this context!"
+msgstr ""
+
+# ../ui-hlp/menu.c:1039
+#: ../ui-hlp/play.c:291
+#, fuzzy
+msgid "clear_line available only in animation replay"
+msgstr "Jenom bìhem animace"
+
+# ../ui-hlp/menu.c:1039
+#: ../ui-hlp/play.c:300
+#, fuzzy
+msgid "clear_lines available only in animation replay"
+msgstr "Jenom bìhem animace"
+
+#: ../ui-hlp/play.c:359
+msgid "Catalog file not found"
+msgstr ""
+
+#: ../ui-hlp/play.c:405
+msgid "Replay is already active"
+msgstr ""
+
+# ../ui/ui.c:853 ../ui/ui.c:917
+#: ../ui-hlp/play.c:409
+#, fuzzy
+msgid "File open failed"
+msgstr "Není místo pro tabulky"
+
+# ../ui/ui.c:307
+#: ../ui-hlp/play.c:414
+#, fuzzy
+msgid "Out of memory"
+msgstr "Memórie je zaplnìná."
+
+# ../ui-hlp/menu.c:908
+#: ../ui-hlp/play.c:526 ../ui-hlp/play.c:542 ../ui-hlp/play.c:566
+#: ../ui-hlp/play.c:595
+#, fuzzy
+msgid "Missing parameter"
+msgstr "Parametry zahladìní"
+
+#: ../ui-hlp/play.c:528 ../ui-hlp/play.c:544 ../ui-hlp/play.c:568
+#: ../ui-hlp/play.c:597
+msgid "Unexpected end of file"
+msgstr ""
+
+#: ../ui-hlp/play.c:555 ../ui-hlp/play.c:574
+msgid "Token is too long"
+msgstr ""
+
+# ../ui-hlp/menu.c:919
+#: ../ui-hlp/play.c:629
+#, fuzzy
+msgid "Unknown formula type"
+msgstr "Filtr"
+
+# ../ui-hlp/menu.c:1039
+#: ../ui-hlp/play.c:635
+#, fuzzy
+msgid "morph available only in animation replay"
+msgstr "Jenom bìhem animace"
+
+#: ../ui-hlp/play.c:639
+msgid "morphview: Invalid viewpoint"
+msgstr ""
+
+# ../ui-hlp/menu.c:1039
+#: ../ui-hlp/play.c:653
+#, fuzzy
+msgid "move available only in animation replay"
+msgstr "Jenom bìhem animace"
+
+# ../ui-hlp/menu.c:1039
+#: ../ui-hlp/play.c:667
+#, fuzzy
+msgid "morphjulia available only in animation replay"
+msgstr "Jenom bìhem animace"
+
+# ../ui-hlp/menu.c:1039
+#: ../ui-hlp/play.c:680
+#, fuzzy
+msgid "morphangle available only in animation replay"
+msgstr "Jenom bìhem animace"
+
+# ../ui-hlp/menu.c:919
+#: ../ui-hlp/play.c:712
+#, fuzzy
+msgid "Unknown filter"
+msgstr "Filtr"
+
+# ../ui-hlp/menu.c:1039
+#: ../ui-hlp/play.c:753
+#, fuzzy
+msgid "sleep available only in animation replay"
+msgstr "Jenom bìhem animace"
+
+#: ../ui-hlp/play.c:767
+#, c-format
+msgid "Internal program error #12 %i\n"
+msgstr ""
+
+# ../ui-hlp/menu.c:1039
+#: ../ui-hlp/play.c:788
+#, fuzzy
+msgid "wait available only in animation replay"
+msgstr "Jenom bìhem animace"
+
+#: ../ui-hlp/play.c:834
+msgid "No catalog file loaded"
+msgstr ""
+
+#: ../ui-hlp/play.c:839
+msgid "Message not found in catalog file"
+msgstr ""
+
+# ../ui-hlp/menu.c:1039
+#: ../ui-hlp/play.c:850
+#, fuzzy
+msgid "load available only in animation replay"
+msgstr "Jenom bìhem animace"
+
+#: ../ui-hlp/play.c:854
+msgid "Include level overflow"
+msgstr ""
+
+#: ../ui-hlp/play.c:863
+msgid "File not found"
+msgstr ""
+
+# ../ui-hlp/menu.c:908
+#: ../ui-hlp/play.c:881
+#, fuzzy
+msgid "Too many parameters"
+msgstr "Parametry zahladìní"
+
+#: ../ui-hlp/play.c:916
+#, c-format
+msgid "Replay disabled at line %i"
+msgstr ""
+
+#: ../ui-hlp/ui_helper.c:646
+msgid "Tutorial files not found. Reinstall XaoS"
+msgstr ""
+
+#: ../ui-hlp/ui_helper.c:651
+msgid "Preparing first image"
+msgstr ""
+
+# ../ui-hlp/menu.c:976
+#: ../ui-hlp/ui_helper.c:661
+#, fuzzy
+msgid "Could not open examples"
+msgstr "Nahrání náhodného pøíkladu"
+
+#: ../ui-hlp/ui_helper.c:667
+#, c-format
+msgid "File %s loaded."
+msgstr ""
+
+# ../ui-hlp/menu.c:975
+#: ../ui-hlp/ui_helper.c:676
+#, fuzzy
+msgid "Saving image..."
+msgstr "Ulo¾ení obrazu"
+
+# ../ui-hlp/menu.c:926 ../ui-hlp/menu.c:1046
+#: ../ui-hlp/ui_helper.c:684
+#, fuzzy
+msgid "Save interrupted"
+msgstr "Pøeru¹ení"
+
+#: ../ui-hlp/ui_helper.c:693 ../ui-hlp/ui_helper.c:710
+#: ../ui-hlp/ui_helper.c:777
+#, c-format
+msgid "File %s saved."
+msgstr ""
+
+# ../ui/ui.c:853 ../ui/ui.c:917
+#: ../ui-hlp/ui_helper.c:704
+#, fuzzy
+msgid "Can not open file"
+msgstr "Není místo pro tabulky"
+
+#: ../ui-hlp/ui_helper.c:799
+#, c-format
+msgid "Recording to file %s enabled."
+msgstr ""
+
+# ../ui-hlp/menu.c:1020
+#: ../engine/zoom.c:1128
+#, fuzzy
+msgid "Solid guessing 1"
+msgstr "Solidní hádání"
+
+#: ../engine/btrace.c:292 ../engine/btrace.c:373
+msgid "Boundary trace"
+msgstr ""
+
+#: ../ui/dialog.c:312 ../ui/dialog.c:398 ../ui/dialog.c:1377
+#: ../ui/ui-drv/cocoa/CustomDialog.m:302
+msgid "OK"
+msgstr ""
+
+#: ../ui/dialog.c:313 ../ui/dialog.c:401 ../ui/dialog.c:1379
+#: ../ui/filesel.c:184 ../ui/ui-drv/cocoa/CustomDialog.m:312
+msgid "Cancel"
+msgstr ""
+
+#: ../ui-hlp/render.c:46
+#, c-format
+msgid "Error: %s"
+msgstr ""
+
+# ../ui/ui.c:853 ../ui/ui.c:917
+#: ../ui-hlp/render.c:121
+#, fuzzy
+msgid "Cannot open motion vector file!"
+msgstr "Není místo pro tabulky"
+
+#: ../ui-hlp/render.c:270
+#, c-format
+msgid "Vectors: %i"
+msgstr ""
+
+# ../ui-hlp/menu.c:1023
+#: ../ui-hlp/render.c:276
+#, fuzzy
+msgid "Initializing"
+msgstr "Iterace"
+
+# ../ui/ui.c:812
+#: ../ui-hlp/render.c:284
+#, fuzzy
+msgid "Cannot create palette"
+msgstr "Paleta barev nelze vytvoøit"
+
+# ../ui/ui.c:820
+#: ../ui-hlp/render.c:295
+#, fuzzy
+msgid "Cannot create image\n"
+msgstr "Obraz nelze vytvoøit"
+
+# ../ui/ui.c:820
+#: ../ui-hlp/render.c:304
+#, fuzzy
+msgid "Cannot create checking buffer!"
+msgstr "Obraz nelze vytvoøit"
+
+# ../ui/ui.c:812
+#: ../ui-hlp/render.c:313 ../ui-hlp/render.c:596
+#, fuzzy
+msgid "Cannot create context\n"
+msgstr "Paleta barev nelze vytvoøit"
+
+# ../ui/ui.c:853 ../ui/ui.c:917
+#: ../ui-hlp/render.c:325
+#, fuzzy
+msgid "Cannot open animation file\n"
+msgstr "Není místo pro tabulky"
+
+#: ../ui-hlp/render.c:336 ../ui-hlp/render.c:605
+msgid "Loading catalogs"
+msgstr ""
+
+#: ../ui-hlp/render.c:366
+msgid "Processing command line options"
+msgstr ""
+
+# ../ui-hlp/menu.c:1039
+#: ../ui-hlp/render.c:389
+#, fuzzy
+msgid "Enabling animation replay\n"
+msgstr "Jenom bìhem animace"
+
+# ../ui/ui.c:853 ../ui/ui.c:917
+#: ../ui-hlp/render.c:396 ../ui-hlp/render.c:514
+#, fuzzy
+msgid "Cannot open image file"
+msgstr "Není místo pro tabulky"
+
+# ../ui/ui.c:853 ../ui/ui.c:917
+#: ../ui-hlp/render.c:410
+#, fuzzy
+msgid "Cannot open pattern file"
+msgstr "Není místo pro tabulky"
+
+#: ../ui-hlp/render.c:427 ../ui-hlp/render.c:429 ../ui-hlp/render.c:638
+msgid "Entering calculation loop!"
+msgstr ""
+
+#: ../ui-hlp/render.c:455
+#, c-format
+msgid "Frame %i skipped."
+msgstr ""
+
+#: ../ui-hlp/render.c:457
+#, c-format
+msgid "Frames %i - %i skipped."
+msgstr ""
+
+#: ../ui-hlp/render.c:461
+#, c-format
+msgid "Frame %4i: "
+msgstr ""
+
+#: ../ui-hlp/render.c:528
+msgid " done."
+msgstr ""
+
+#: ../ui-hlp/render.c:532
+msgid " skipping..."
+msgstr ""
+
+# ../ui-hlp/menu.c:926 ../ui-hlp/menu.c:1046
+#: ../ui-hlp/render.c:565 ../ui-hlp/render.c:657
+#, fuzzy
+msgid "Calculation interrupted"
+msgstr "Pøeru¹ení"
+
+# ../ui-hlp/menu.c:931
+#: ../ui-hlp/render.c:568 ../ui-hlp/render.c:570 ../ui-hlp/render.c:659
+#, fuzzy
+msgid "Calculation finished"
+msgstr "Poèítání"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1292 ../ui/ui-drv/cocoa/AppController.m:321
+msgid "Copy"
+msgstr ""
+
+# ../ui-hlp/menu.c:989
+#: ../ui/ui-drv/win32/ui_win32.c:1293 ../ui/ui-drv/cocoa/AppController.m:324
+#, fuzzy
+msgid "Paste"
+msgstr "Paleta barev"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1297
+msgid "About"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:197
+msgid "About XaoS"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:200
+msgid "Services"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:203
+msgid "Hide XaoS"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:206
+msgid "Hide Others"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:209
+msgid "Show All"
+msgstr ""
+
+# ../ui/ui.c:1146
+#: ../ui/ui-drv/cocoa/AppController.m:212
+#, fuzzy
+msgid "Quit XaoS"
+msgstr "Zavøít"
+
+#: ../ui/ui-drv/cocoa/AppController.m:318
+msgid "Cut"
+msgstr ""
+
+# ../ui-hlp/menu.c:989
+#: ../ui/ui-drv/cocoa/AppController.m:327
+#, fuzzy
+msgid "Delete"
+msgstr "Paleta barev"
+
+#: ../ui/ui-drv/cocoa/AppController.m:330
+msgid "Select All"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:340
+msgid "Minimize"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:348
+msgid "Bring All to Front"
+msgstr ""
+
+# ../ui-hlp/menu.c:952
+#: ../ui/ui-drv/cocoa/AppController.m:359
+#, fuzzy
+msgid "Close"
+msgstr "Barva"
+
+#: ../ui/ui-drv/cocoa/AppController.m:373
+msgid "Videator Output"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/CustomDialog.m:142
+msgid "Choose"
+msgstr ""
+
+# ../ui-hlp/menu.c:984
+#~ msgid "formulae"
+#~ msgstr "Vzorec"
+
+# ../ui/ui.c:812
+#, fuzzy
+#~ msgid "Can not create context\n"
+#~ msgstr "Paleta barev nelze vytvoøit"
+
+#~ msgid "Up"
+#~ msgstr "Nahoru"
+
+#~ msgid "Bottom"
+#~ msgstr "Dolù"
+
+#~ msgid "Left"
+#~ msgstr "Doleva"
diff --git a/src/i18n/de.po b/src/i18n/de.po
new file mode 100644
index 0000000..1454946
--- /dev/null
+++ b/src/i18n/de.po
@@ -0,0 +1,1481 @@
+# translation of de.po to
+# XaoS NLS file for German language.
+# Copyright (C) 2002, 2008 Free Software Foundation, Inc.
+# Zoltan Kovacs <kovzol@math.u-szeged.hu>, 2002.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: de\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-11-14 10:56+0100\n"
+"PO-Revision-Date: 2008-04-27 21:48+0200\n"
+"Last-Translator: \n"
+"Language-Team: <de@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#: ../ui/ui.c:314
+msgid "XaoS is out of memory."
+msgstr "XaoS hat zu wenig Speicher"
+
+#: ../ui/ui.c:360
+#, c-format
+msgid "%s %.2f times (%.1fE) %2.2f frames/sec %c %i %i %i %i "
+msgstr "%s %.2f Fach (%.1fE) %2.2f Bilder/Sek %c %i %i %i %i "
+
+#: ../ui/ui.c:361
+msgid "unzoomed"
+msgstr "ungezoomt:"
+
+#: ../ui/ui.c:361
+msgid "zoomed"
+msgstr "gezoomt:"
+
+#: ../ui/ui.c:369
+#, c-format
+msgid "framerate:%f\n"
+msgstr "Bildfrequenz: %f\n"
+
+#: ../ui/ui.c:409
+#, c-format
+msgid "Enabling: %s. "
+msgstr "%s wird eingeschaltet."
+
+#: ../ui/ui.c:411
+#, c-format
+msgid "Disabling: %s. "
+msgstr "%s wird ausgeschaltet."
+
+#: ../ui/ui.c:441
+#, c-format
+msgid "Fractal name:%s"
+msgstr "Fraktalname:%s"
+
+#: ../ui/ui.c:446
+#, c-format
+msgid "Fractal type:%s"
+msgstr "Fraktaltyp:%s"
+
+#: ../ui/ui.c:448
+msgid "Mandelbrot"
+msgstr "Mandelbrot"
+
+#: ../ui/ui.c:449
+msgid "Julia"
+msgstr "Julia"
+
+#: ../ui/ui.c:452
+#, c-format
+msgid "Formula:%s"
+msgstr "Formel:%s"
+
+#: ../ui/ui.c:457
+#, c-format
+msgid "View:[%1.12f,%1.12f]"
+msgstr "Ausschnitt:[%1.12f,%1.12f]"
+
+#: ../ui/ui.c:461
+#, c-format
+msgid "size:[%1.12f,%1.12f]"
+msgstr "Grösse:[%1.12f,%1.12f]"
+
+#: ../ui/ui.c:465
+#, c-format
+msgid "Rotation:%4.2f Screen size:%i:%i"
+msgstr "Rotation:%4.2f Bildschirm Grösse:%i:%i"
+
+#: ../ui/ui.c:470
+#, c-format
+msgid "Iterations:%-4i Palette size:%i"
+msgstr "Iterationen:%-4i Grösse der Palette:%i"
+
+#: ../ui/ui.c:477
+#, c-format
+msgid "Autopilot:%-4s Plane:%s"
+msgstr "Autopilot:%-4s Ebene:%s"
+
+#: ../ui/ui.c:478
+msgid "On"
+msgstr "Ein"
+
+#: ../ui/ui.c:478
+msgid "Off"
+msgstr "Aus"
+
+#: ../ui/ui.c:482
+#, c-format
+msgid "incoloring:%s outcoloring:%s"
+msgstr "Innere Färbung:%s Äussere Färbung:%s"
+
+#: ../ui/ui.c:487
+#, c-format
+msgid "zoomspeed:%f"
+msgstr "Zoomgeschwindigkeit:%f"
+
+#: ../ui/ui.c:491
+msgid "Parameter:none"
+msgstr "Parameter:Keine"
+
+#: ../ui/ui.c:493
+#, c-format
+msgid "Parameter:[%f,%f]"
+msgstr "Parameter:[%f,%f]"
+
+#: ../ui/ui.c:585
+#, c-format
+msgid "Please wait while calculating %s"
+msgstr "Bitte warten, %s Fraktal wird berechnet "
+
+#: ../ui/ui.c:685
+#, c-format
+msgid "Letters per second %i "
+msgstr "Buchstaben pro Sekunde: %i "
+
+#: ../ui/ui.c:698 ../ui/ui.c:709
+#, c-format
+msgid "Rotation speed:%2.2f degrees per second "
+msgstr "Rotationsgeschwindigkeit:%2.2f Grad pro Sekunde "
+
+#: ../ui/ui.c:719
+#, c-format
+msgid "Iterations: %i "
+msgstr "Iterationen: %i "
+
+#: ../ui/ui.c:735
+#, c-format
+msgid "Cycling speed: %i "
+msgstr "Zirkulationsgeschwindigkeit: %i "
+
+#: ../ui/ui.c:748 ../ui/ui.c:762
+#, c-format
+msgid "speed:%2.2f "
+msgstr "Geschwindigkeit:%2.2f "
+
+#: ../ui/ui.c:854
+#, c-format
+msgid "Thank you for using XaoS\n"
+msgstr "Danke, dass Sie XaoS benutzt haben\n"
+
+#: ../ui/ui.c:891
+msgid "Skipping, please wait..."
+msgstr "Beim Überspringen, bitte warten..."
+
+#: ../ui/ui.c:983 ../ui/ui.c:985 ../ui/ui-drv/win32/ui_win32.c:1453
+msgid "Resize"
+msgstr "Anzeige"
+
+#: ../ui/ui.c:998
+msgid "Quit"
+msgstr "Beenden"
+
+#: ../ui/ui.c:999
+msgid "Exit now"
+msgstr "Jetzt beenden"
+
+#: ../ui/ui.c:1001
+msgid "Not yet"
+msgstr "Noch nicht beenden"
+
+#: ../ui/ui.c:1004 ../ui-hlp/menu.c:1055 ../ui-hlp/menu.c:1065
+#: ../ui/dialog.c:404 ../ui/dialog.c:1380
+msgid "Help"
+msgstr "Hilfe"
+
+#: ../ui/ui.c:1006
+msgid "Disable XaoS's builtin GUI"
+msgstr "XaoS's eingebautes GUI deaktivieren"
+
+#: ../ui/ui.c:1010 ../ui/ui.c:1016
+msgid "Status"
+msgstr "Status"
+
+#: ../ui/ui.c:1012 ../ui/ui.c:1018
+msgid "Ministatus"
+msgstr "Ministatus"
+
+#: ../ui/ui.c:1021 ../ui/ui.c:1022
+msgid "Driver"
+msgstr "Treiber"
+
+#: ../ui/ui.c:1413
+#, c-format
+msgid "Welcome to XaoS version %s"
+msgstr "Willkommen zu XaoS Version %s"
+
+#: ../ui/ui.c:1580
+msgid "Can not allocate buffers"
+msgstr "Kann Puffer nicht allozieren"
+
+#: ../ui/ui.c:1598
+msgid "Can not create palette"
+msgstr "Kann Palette nicht erzeugen"
+
+#: ../ui/ui.c:1610
+msgid "Can not create image"
+msgstr "Kann Bild nicht erzeugen"
+
+#: ../ui/ui.c:1641 ../ui/ui.c:1692
+msgid "Can not allocate tables"
+msgstr "Kann Tabellen nicht erzeugen"
+
+#: ../ui/ui.c:1678
+msgid "Can not initialize driver"
+msgstr "Kann Treiber nicht initialisieren"
+
+#: ../ui/ui.c:1681
+msgid "Can not return back to previous driver"
+msgstr "Kann nicht zu vorhergehendem Treiber zurückkehren"
+
+#: ../ui-hlp/menu.c:129
+msgid "Perturbation:"
+msgstr "Perturbation:"
+
+#: ../ui-hlp/menu.c:133
+msgid "Julia-seed:"
+msgstr "Julia-Anfangswert:"
+
+#: ../ui-hlp/menu.c:137
+msgid "Morphing type:"
+msgstr "Morphtyp:"
+
+#: ../ui-hlp/menu.c:138
+msgid "Startuptime:"
+msgstr "Startzeit:"
+
+#: ../ui-hlp/menu.c:139
+msgid "Stoptime:"
+msgstr "Stopzeit:"
+
+#: ../ui-hlp/menu.c:143
+msgid "File to render:"
+msgstr "Datei zum berechnen:"
+
+#: ../ui-hlp/menu.c:144
+msgid "Basename:"
+msgstr "Basisname:"
+
+#: ../ui-hlp/menu.c:145
+msgid "Width:"
+msgstr "Breite:"
+
+#: ../ui-hlp/menu.c:146
+msgid "Height:"
+msgstr "Höhe:"
+
+#: ../ui-hlp/menu.c:147
+msgid "Real width (cm):"
+msgstr "Tatsächliche Breite (cm):"
+
+#: ../ui-hlp/menu.c:148
+msgid "Real height (cm):"
+msgstr "Tatsächliche Höhe (cm):"
+
+#: ../ui-hlp/menu.c:149
+msgid "Framerate:"
+msgstr "Bildfrequenz:"
+
+#: ../ui-hlp/menu.c:150
+msgid "Image type:"
+msgstr "Bildtyp:"
+
+#: ../ui-hlp/menu.c:151
+msgid "Antialiasing:"
+msgstr "Antialiasing:"
+
+#: ../ui-hlp/menu.c:152
+msgid "Always recalculate:"
+msgstr "Immer neu berechnen:"
+
+#: ../ui-hlp/menu.c:153
+msgid "Calculate MPEG motion vectors:"
+msgstr "Berechne MPEG Bewegungsvektoren:"
+
+#: ../ui-hlp/menu.c:154
+msgid "Recommended I frame distance:"
+msgstr "Empfohlene I-Frame Distanz:"
+
+#: ../ui-hlp/menu.c:158
+msgid "Center:"
+msgstr "Zentrum:"
+
+#: ../ui-hlp/menu.c:159
+msgid "Radius:"
+msgstr "Radius:"
+
+#: ../ui-hlp/menu.c:160 ../ui-hlp/menu.c:225
+msgid "Angle:"
+msgstr "Winkel:"
+
+#: ../ui-hlp/menu.c:164
+msgid "Mode:"
+msgstr "Modus:"
+
+#: ../ui-hlp/menu.c:165
+msgid "Start:"
+msgstr "Start:"
+
+#: ../ui-hlp/menu.c:166
+msgid "End:"
+msgstr "Ende:"
+
+#: ../ui-hlp/menu.c:170
+msgid "Color:"
+msgstr "Farbe:"
+
+#: ../ui-hlp/menu.c:174
+msgid "Rotations per second:"
+msgstr "Rotationen pro Sekunde:"
+
+#: ../ui-hlp/menu.c:178
+msgid "Letters per second:"
+msgstr "Buchstaben pro Sekunde:"
+
+#: ../ui-hlp/menu.c:182
+msgid "Iterations:"
+msgstr "Iterationen:"
+
+#: ../ui-hlp/menu.c:186
+msgid "Text:"
+msgstr "Text:"
+
+#: ../ui-hlp/menu.c:190
+msgid "Your command:"
+msgstr "Ihr Befehl:"
+
+#: ../ui-hlp/menu.c:194 ../ui-hlp/menu.c:198 ../ui-hlp/menu.c:202
+#: ../ui-hlp/menu.c:206 ../ui-hlp/menu.c:258
+msgid "Filename:"
+msgstr "Dateiname:"
+
+#: ../ui-hlp/menu.c:210 ../ui-hlp/menu.c:298
+msgid "Formula:"
+msgstr "Formel:"
+
+#: ../ui-hlp/menu.c:214
+msgid "X center:"
+msgstr "X-Zentrum:"
+
+#: ../ui-hlp/menu.c:215
+msgid "Y center:"
+msgstr "Y-Zentrum:"
+
+#: ../ui-hlp/menu.c:216
+msgid "X Radius:"
+msgstr "X-Radius:"
+
+#: ../ui-hlp/menu.c:217
+msgid "Y Radius:"
+msgstr "Y-Radius:"
+
+#: ../ui-hlp/menu.c:221
+msgid "Coordinates:"
+msgstr "Koordinaten:"
+
+#: ../ui-hlp/menu.c:229
+msgid "continuous rotation"
+msgstr "Fortlaufende Rotation"
+
+#: ../ui-hlp/menu.c:233
+msgid "Fast rotation"
+msgstr "Schnelle Rotation"
+
+#: ../ui-hlp/menu.c:237
+msgid "filter"
+msgstr "Filter"
+
+#: ../ui-hlp/menu.c:238
+msgid "enable"
+msgstr "einschalten"
+
+#: ../ui-hlp/menu.c:242
+msgid "Amount:"
+msgstr "Schritte:"
+
+#: ../ui-hlp/menu.c:246
+msgid "Zooming speed:"
+msgstr "Zoomgeschwindigkeit:"
+
+#: ../ui-hlp/menu.c:250
+msgid "Name:"
+msgstr "Name:"
+
+#: ../ui-hlp/menu.c:254
+msgid "Bailout:"
+msgstr "Fluchtradius:"
+
+#: ../ui-hlp/menu.c:262
+msgid "Julia mode:"
+msgstr "Juliamodus:"
+
+#: ../ui-hlp/menu.c:266
+msgid "Horizontal position:"
+msgstr "Horizontale Position:"
+
+#: ../ui-hlp/menu.c:267
+msgid "Vertical position:"
+msgstr "Vertikale Position:"
+
+#: ../ui-hlp/menu.c:271
+msgid "Dynamic resolution:"
+msgstr "Dynamische Auflösung:"
+
+#: ../ui-hlp/menu.c:275
+msgid "Time:"
+msgstr "Zeit:"
+
+#: ../ui-hlp/menu.c:279 ../ui-hlp/menu.c:283
+msgid "Number:"
+msgstr "Anzahl:"
+
+#: ../ui-hlp/menu.c:287
+msgid "Algorithm number:"
+msgstr "Algorithmusnummer:"
+
+#: ../ui-hlp/menu.c:288
+msgid "Seed:"
+msgstr "Anfangswert:"
+
+#: ../ui-hlp/menu.c:289
+msgid "Shift:"
+msgstr "Verschiebung:"
+
+#: ../ui-hlp/menu.c:293
+msgid "Frames per second:"
+msgstr "Bilder pro Sekunde:"
+
+#: ../ui-hlp/menu.c:302
+msgid "Initialization:"
+msgstr "Initialisierung:"
+
+#: ../ui-hlp/menu.c:357
+msgid "renderanim: Must specify a valid absolute path for basename"
+msgstr "Animationsberechnung: Gültigen, absoluten Pfad für Basisname angeben"
+
+#: ../ui-hlp/menu.c:364
+msgid ""
+"renderanim: Width parameter must be positive integer in the range 0..4096"
+msgstr ""
+"Animationsberechnung: Breite muss einen positiven, ganzzahligen Wert "
+"zwischen 0 und 4096 haben"
+
+#: ../ui-hlp/menu.c:370
+msgid ""
+"renderanim: Height parameter must be positive integer in the range 0..4096"
+msgstr ""
+"Animationsberechnung: Höhe muss einen positiven, ganzzahligen Wert zwischen "
+"0 und 4096 haben"
+
+#: ../ui-hlp/menu.c:376
+msgid "renderanim: Invalid real width and height dimensions"
+msgstr "Animationsberechnung: Falsche tatsächliche Breite und Höhe"
+
+#: ../ui-hlp/menu.c:380
+msgid "renderanim: invalid framerate"
+msgstr "Animationsberechnung: Falsche Bildfrequenz"
+
+#: ../ui-hlp/menu.c:386
+msgid "renderanim: antialiasing not supported in 256 color mode"
+msgstr ""
+"Animationsberechnung: Antialiasing nicht unterstützt im 256-Farben-Modus"
+
+#: ../ui-hlp/menu.c:390
+msgid "renderanim: incorrect I frame distance"
+msgstr "Animationsberechnung: Falsche I-Frame Distanz"
+
+#: ../ui-hlp/menu.c:441 ../ui-hlp/menu.c:454
+msgid "animateview: Invalid viewpoint"
+msgstr "Animationsberechnung: Falscher Ausschnitt"
+
+#: ../ui-hlp/menu.c:467
+msgid "Invalid viewpoint"
+msgstr "Falscher Ausschnitt"
+
+#: ../ui-hlp/menu.c:696
+msgid "Unknown palette type"
+msgstr "Unbekannter Palettentyp"
+
+#: ../ui-hlp/menu.c:771 ../ui-hlp/menu.c:785
+msgid "Initialization of color cycling failed."
+msgstr "Initialisierung der Farbzirkulation fehlgeschlagen"
+
+#: ../ui-hlp/menu.c:773 ../ui-hlp/menu.c:787
+msgid "Try to enable palette emulation filter"
+msgstr "Versuche Palettenemulation einzuschalten"
+
+#: ../ui-hlp/menu.c:896
+#, c-format
+msgid "Algorithm:%i seed:%i size:%i"
+msgstr "Algorithmus:%i Anfangswert:%i Grösse:%i"
+
+#: ../ui-hlp/menu.c:947
+msgid "Root menu"
+msgstr "Hauptmenü"
+
+#: ../ui-hlp/menu.c:948
+msgid "Animation root menu"
+msgstr "Hauptmenü für Animationen"
+
+#: ../ui-hlp/menu.c:949
+msgid "Replay only commands"
+msgstr "Zeige nur Kommentare"
+
+#: ../ui-hlp/menu.c:950
+msgid "Command line options only"
+msgstr "Nur Kommandozeilenoptionen"
+
+#: ../ui-hlp/menu.c:953
+msgid "print menus specifications of all menus"
+msgstr "Zeige Menüspezifikationen für alle Menüs"
+
+#: ../ui-hlp/menu.c:958
+msgid "print menu specification"
+msgstr "Zeige Menüspezifikationen"
+
+#: ../ui-hlp/menu.c:961
+msgid "print menu specification in xshl format"
+msgstr "Zeige Menüspezifikationen im XSHL-Format"
+
+#: ../ui-hlp/menu.c:965
+msgid "print all menu specifications in xshl format"
+msgstr "Zeige alle Menüspezifikationen im XSHL-Format"
+
+#: ../ui-hlp/menu.c:967
+msgid "print dialog specification"
+msgstr "Zeige Dialogspezifikation"
+
+#: ../ui-hlp/menu.c:972
+msgid "Line drawing functions"
+msgstr "Funktionen zum zeichnen von Linien"
+
+#: ../ui-hlp/menu.c:973
+msgid "Line"
+msgstr "Linie"
+
+#: ../ui-hlp/menu.c:976
+msgid "Morph line"
+msgstr "Morphe Linie"
+
+#: ../ui-hlp/menu.c:978
+msgid "Morph last line"
+msgstr "Morphe letzte Linie"
+
+#: ../ui-hlp/menu.c:981
+msgid "Set line key"
+msgstr "Setze Linienschlüssel"
+
+#: ../ui-hlp/menu.c:983
+msgid "Clear line"
+msgstr "Lösche Linie"
+
+#: ../ui-hlp/menu.c:986
+msgid "Clear all lines"
+msgstr "Lösche alle Linien"
+
+#: ../ui-hlp/menu.c:988
+msgid "Animation functions"
+msgstr "Animationsfunktionen"
+
+#: ../ui-hlp/menu.c:989 ../ui-hlp/menu.c:1181 ../ui-hlp/menu.c:1190
+msgid "View"
+msgstr "Ausschnitt"
+
+#: ../ui-hlp/menu.c:993
+msgid "Morph view"
+msgstr "Morphe Ausschnitt"
+
+#: ../ui-hlp/menu.c:995
+msgid "Morph julia"
+msgstr "Morphe Julia"
+
+#: ../ui-hlp/menu.c:1000
+msgid "Move view"
+msgstr "Verschiebe Ausschnitt"
+
+#: ../ui-hlp/menu.c:1002
+msgid "Morph angle"
+msgstr "Morphe Winkel"
+
+#: ../ui-hlp/menu.c:1004
+msgid "Zoom center"
+msgstr "Zoomzentrum"
+
+#: ../ui-hlp/menu.c:1006 ../ui/ui-drv/cocoa/AppController.m:343
+msgid "Zoom"
+msgstr "Zoom"
+
+#: ../ui-hlp/menu.c:1007
+msgid "Un-zoom"
+msgstr "Unzoom"
+
+#: ../ui-hlp/menu.c:1010
+msgid "Stop zooming"
+msgstr "Zoomen anhalten"
+
+#: ../ui-hlp/menu.c:1011
+msgid "Smooth morphing parameters"
+msgstr "Smooth-Morphing-Parameter"
+
+#: ../ui-hlp/menu.c:1014
+msgid "Timing functions"
+msgstr "Timing-Funktionen"
+
+#: ../ui-hlp/menu.c:1015
+msgid "Usleep"
+msgstr "Usleep"
+
+#: ../ui-hlp/menu.c:1018
+msgid "Wait for text"
+msgstr "Warte auf Text"
+
+#: ../ui-hlp/menu.c:1020
+msgid "Wait for complete image"
+msgstr "Warte auf Bild"
+
+#: ../ui-hlp/menu.c:1022
+msgid "Include file"
+msgstr "Datei einbeziehen"
+
+#: ../ui-hlp/menu.c:1024 ../ui-hlp/menu.c:1222
+msgid "Default palette"
+msgstr "Standardpalette"
+
+#: ../ui-hlp/menu.c:1026
+msgid "Formula"
+msgstr "Formel"
+
+#: ../ui-hlp/menu.c:1028
+msgid "Maximal zooming step"
+msgstr "Maximal Zoomschritt"
+
+#: ../ui-hlp/menu.c:1030
+msgid "Zooming speedup"
+msgstr "Zoom-Speedup"
+
+#: ../ui-hlp/menu.c:1032
+msgid "Filter"
+msgstr "Filter"
+
+#: ../ui-hlp/menu.c:1036 ../ui-hlp/menu.c:1041
+msgid "Letters per second"
+msgstr "Buchstaben pro Sekunde"
+
+#: ../ui-hlp/menu.c:1043 ../ui-hlp/menu.c:1314
+msgid "Interrupt"
+msgstr "Unterbrechen"
+
+#: ../ui-hlp/menu.c:1045 ../ui-hlp/menu.c:1057
+msgid "File"
+msgstr "Datei"
+
+#: ../ui-hlp/menu.c:1046
+msgid "Edit"
+msgstr "Bearbeiten"
+
+#: ../ui-hlp/menu.c:1047
+msgid "Fractal"
+msgstr "Fraktal"
+
+#: ../ui-hlp/menu.c:1048
+msgid "Calculation"
+msgstr "Berechnung"
+
+#: ../ui-hlp/menu.c:1049 ../ui-hlp/menu.c:1391
+msgid "Filters"
+msgstr "Filter"
+
+#: ../ui-hlp/menu.c:1050 ../ui-hlp/menu.c:1064
+msgid "UI"
+msgstr "Interface"
+
+#: ../ui-hlp/menu.c:1051
+msgid "Misc"
+msgstr "Extras"
+
+#: ../ui-hlp/menu.c:1053
+msgid "Window"
+msgstr "Fenster"
+
+#: ../ui-hlp/menu.c:1056
+msgid "Tutorials"
+msgstr "Tutorials"
+
+#: ../ui-hlp/menu.c:1062
+msgid "Stop replay"
+msgstr "Anhalten"
+
+#: ../ui-hlp/menu.c:1066
+msgid "Command"
+msgstr "Kommando"
+
+#: ../ui-hlp/menu.c:1068
+msgid "Play string"
+msgstr "Zeige Satz"
+
+#: ../ui-hlp/menu.c:1070
+msgid "Render animation"
+msgstr "Berechne Animation"
+
+#: ../ui-hlp/menu.c:1073
+msgid "Clear screen"
+msgstr "Lösche Bildschirm"
+
+#: ../ui-hlp/menu.c:1075
+msgid "Display fractal"
+msgstr "Zeige Fraktal"
+
+#: ../ui-hlp/menu.c:1078
+msgid "Display text"
+msgstr "Zeige Text"
+
+#: ../ui-hlp/menu.c:1080
+msgid "Color"
+msgstr "Farbe"
+
+#: ../ui-hlp/menu.c:1082
+msgid "Horizontal text position"
+msgstr "Horizontale Textposition"
+
+#: ../ui-hlp/menu.c:1084
+msgid "Vertical text position"
+msgstr "Vertikale Textposition"
+
+#: ../ui-hlp/menu.c:1086
+msgid "Text position"
+msgstr "Textposition"
+
+#: ../ui-hlp/menu.c:1090
+msgid "Message"
+msgstr "Nachricht"
+
+#: ../ui-hlp/menu.c:1112
+msgid "Load"
+msgstr "Öffnen"
+
+#: ../ui-hlp/menu.c:1115
+msgid "Save"
+msgstr "Speichern"
+
+#: ../ui-hlp/menu.c:1117
+msgid "Record"
+msgstr "Aufzeichnen"
+
+#: ../ui-hlp/menu.c:1121
+msgid "Replay"
+msgstr "Wiedergeben"
+
+#: ../ui-hlp/menu.c:1128
+msgid "Save image"
+msgstr "Bild speichern"
+
+#: ../ui-hlp/menu.c:1130
+msgid "Load random example"
+msgstr "Zufälliges Beispiel öffnen"
+
+#: ../ui-hlp/menu.c:1132
+msgid "Save configuration"
+msgstr "Konfiguration speichern"
+
+#: ../ui-hlp/menu.c:1137
+msgid "Undo"
+msgstr "Rückgängig"
+
+#: ../ui-hlp/menu.c:1141
+msgid "Redo"
+msgstr "Wiederholen"
+
+#: ../ui-hlp/menu.c:1145
+msgid "Formulae"
+msgstr "Formeln"
+
+#: ../ui-hlp/menu.c:1146
+msgid "More formulae"
+msgstr "Mehr Formeln"
+
+#: ../ui-hlp/menu.c:1151
+msgid "User formula"
+msgstr "Benutzerformel"
+
+#: ../ui-hlp/menu.c:1153
+msgid "User initialization"
+msgstr "Benutzerinitialisierung"
+
+#: ../ui-hlp/menu.c:1158
+msgid "Incoloring mode"
+msgstr "Innere Färbung"
+
+#: ../ui-hlp/menu.c:1159
+msgid "Outcoloring mode"
+msgstr "Äussere Färbung"
+
+#: ../ui-hlp/menu.c:1160
+msgid "Plane"
+msgstr "Ebene"
+
+#: ../ui-hlp/menu.c:1161
+msgid "Palette"
+msgstr "Palette"
+
+#: ../ui-hlp/menu.c:1164
+msgid "Mandelbrot mode"
+msgstr "Mandelbrotmodus"
+
+#: ../ui-hlp/menu.c:1170 ../ui-hlp/menu.c:1174 ../ui-hlp/menu.c:1395
+msgid "Perturbation"
+msgstr "Perturbation"
+
+#: ../ui-hlp/menu.c:1185
+msgid "Reset to defaults"
+msgstr "Auf Standardwerte zurücksetzen"
+
+#: ../ui-hlp/menu.c:1186
+msgid "Julia mode"
+msgstr "Juliamodus"
+
+#: ../ui-hlp/menu.c:1193
+msgid "Set angle"
+msgstr "Winkel setzen"
+
+#: ../ui-hlp/menu.c:1197
+msgid "Set plane"
+msgstr "Ebene setzen"
+
+#: ../ui-hlp/menu.c:1201
+msgid "Inside coloring mode"
+msgstr "Innerer Farbmodus"
+
+#: ../ui-hlp/menu.c:1206
+msgid "Outside coloring mode"
+msgstr "Äusserer Farbmodus"
+
+#: ../ui-hlp/menu.c:1212
+msgid "Inside truecolor coloring mode"
+msgstr "Innerer Echt-Farbmodus"
+
+#: ../ui-hlp/menu.c:1216
+msgid "Outside truecolor coloring mode"
+msgstr "Äusserer Echt-Farbmodus"
+
+#: ../ui-hlp/menu.c:1219
+msgid "Julia seed"
+msgstr "Julia-Anfangswert"
+
+#: ../ui-hlp/menu.c:1224
+msgid "Random palette"
+msgstr "Zufallspalette"
+
+#: ../ui-hlp/menu.c:1226
+msgid "Custom palette"
+msgstr "Benutzerpalette"
+
+#: ../ui-hlp/menu.c:1230
+msgid "Color cycling"
+msgstr "Farbzirkulation"
+
+#: ../ui-hlp/menu.c:1232
+msgid "Reversed color cycling"
+msgstr "Rückwärts-Farbzirkulation "
+
+#: ../ui-hlp/menu.c:1237
+msgid "Color cycling speed"
+msgstr "Farbzirkulationsgeschwindigkeit"
+
+#: ../ui-hlp/menu.c:1241
+msgid "Shift palette"
+msgstr "Verschiebe Palette"
+
+#: ../ui-hlp/menu.c:1243
+msgid "Shift one forward"
+msgstr "Verschiebe eins vorwärts"
+
+#: ../ui-hlp/menu.c:1246
+msgid "Shift one backward"
+msgstr "Verschiebe eins rückwärts"
+
+#: ../ui-hlp/menu.c:1248 ../engine/zoom.c:1357
+msgid "Solid guessing"
+msgstr "Solid-Guessing"
+
+#: ../ui-hlp/menu.c:1249
+msgid "Dynamic resolution"
+msgstr "Dynamische Auflösung"
+
+#: ../ui-hlp/menu.c:1251
+msgid "Periodicity checking"
+msgstr "Periodizitätstest"
+
+#: ../ui-hlp/menu.c:1254
+msgid "Iterations"
+msgstr "Iterationen"
+
+#: ../ui-hlp/menu.c:1256
+msgid "Bailout"
+msgstr "Fluchtradius"
+
+#: ../ui-hlp/menu.c:1260
+msgid "Fast julia mode"
+msgstr "Schneller Juliamodus"
+
+#: ../ui-hlp/menu.c:1262
+msgid "Rotation"
+msgstr "Rotation"
+
+#: ../ui-hlp/menu.c:1263
+msgid "Solid guessing range"
+msgstr "Solid-Guessing Bereich"
+
+#: ../ui-hlp/menu.c:1266
+msgid "Disable rotation"
+msgstr "Rotation ausschalten"
+
+#: ../ui-hlp/menu.c:1270
+msgid "Continuous rotation"
+msgstr "Fortlaufende Rotation"
+
+#: ../ui-hlp/menu.c:1273
+msgid "Rotate by mouse"
+msgstr "Rotation mit Maus"
+
+#: ../ui-hlp/menu.c:1277
+msgid "Rotation speed"
+msgstr "Rotationsgeschwindigkeit"
+
+#: ../ui-hlp/menu.c:1280
+msgid "Automatic rotation"
+msgstr "Automatische Rotation"
+
+#: ../ui-hlp/menu.c:1285
+msgid "Fast rotation mode"
+msgstr "Schneller Rotationsmodus"
+
+#: ../ui-hlp/menu.c:1289
+msgid "Disable dynamic resolution"
+msgstr "Dynamische Auflösung ausschalten"
+
+#: ../ui-hlp/menu.c:1292
+msgid "Use only during animation"
+msgstr "Nur während Animation benutzen"
+
+#: ../ui-hlp/menu.c:1296
+msgid "Use also for new images"
+msgstr "Auch für neue Bilder benutzen"
+
+#: ../ui-hlp/menu.c:1298
+msgid "Dynamic resolution mode"
+msgstr "Modus der dynamischen Auflösung"
+
+#: ../ui-hlp/menu.c:1302
+msgid "Autopilot"
+msgstr "Autopilot"
+
+#: ../ui-hlp/menu.c:1306
+msgid "VJ mode"
+msgstr "Juliamodus"
+
+#: ../ui-hlp/menu.c:1310
+msgid "Recalculate"
+msgstr "Neu berechnen"
+
+#: ../ui-hlp/menu.c:1319
+msgid "Zooming speed"
+msgstr "Zoomgeschwindigkeit"
+
+#: ../ui-hlp/menu.c:1321
+msgid "Fixed step"
+msgstr "Gleiche Schritte"
+
+#: ../ui-hlp/menu.c:1325
+msgid "Disable solid guessing"
+msgstr "Solid-Guessing ausschalten"
+
+#: ../ui-hlp/menu.c:1329
+msgid "Guess 2x2 rectangles"
+msgstr "Rate 2x2 Quadrate"
+
+#: ../ui-hlp/menu.c:1331
+msgid "Guess 3x3 rectangles"
+msgstr "Rate 3x3 Quadrate"
+
+#: ../ui-hlp/menu.c:1335
+msgid "Guess 4x4 rectangles"
+msgstr "Rate 4x4 Quadrate"
+
+#: ../ui-hlp/menu.c:1337
+msgid "Guess 5x5 rectangles"
+msgstr "Rate 5x5 Quadrate"
+
+#: ../ui-hlp/menu.c:1341
+msgid "Guess 6x6 rectangles"
+msgstr "Rate 6x6 Quadrate"
+
+#: ../ui-hlp/menu.c:1343
+msgid "Guess 7x7 rectangles"
+msgstr "Rate 7x7 Quadrate"
+
+#: ../ui-hlp/menu.c:1347
+msgid "Guess 8x8 rectangles"
+msgstr "Rate 8x8 Quadrate"
+
+#: ../ui-hlp/menu.c:1349
+msgid "Guess unlimited rectangles"
+msgstr "Rate beliebig grosse Quadrate"
+
+#: ../ui-hlp/menu.c:1354
+msgid "Language"
+msgstr "Sprache"
+
+#: ../ui-hlp/menu.c:1357
+msgid "An introduction to fractals"
+msgstr "Fraktale - Eine Einführung"
+
+#: ../ui-hlp/menu.c:1359
+msgid "XaoS features overview"
+msgstr "XaoS - Eine Übersicht"
+
+#: ../ui-hlp/menu.c:1361
+msgid "Math behind fractals"
+msgstr "Die Mathematik hinter Fraktalen"
+
+#: ../ui-hlp/menu.c:1362 ../ui-hlp/menu.c:1403
+msgid "Other fractal types in XaoS"
+msgstr "Andere Fraktale in XaoS"
+
+#: ../ui-hlp/menu.c:1364
+msgid "What's new?"
+msgstr "Was ist neu?"
+
+#: ../ui-hlp/menu.c:1374 ../ui-hlp/menu.c:1398
+msgid "Whole story"
+msgstr "Die ganze Geschichte"
+
+#: ../ui-hlp/menu.c:1376
+msgid "Introduction"
+msgstr "Einführung"
+
+#: ../ui-hlp/menu.c:1377
+msgid "Mandelbrot set"
+msgstr "Mandelbrot-Menge"
+
+#: ../ui-hlp/menu.c:1378
+msgid "Julia set"
+msgstr "Julia-Menge"
+
+#: ../ui-hlp/menu.c:1379
+msgid "Higher power Mandelbrots"
+msgstr "Mandelbrot-Mengen höherer Ordnung"
+
+#: ../ui-hlp/menu.c:1380
+msgid "Newton's method"
+msgstr "Newtonsches Tangentenverfahren"
+
+#: ../ui-hlp/menu.c:1381
+msgid "Barnsley's formula"
+msgstr "Barnsley's Formel"
+
+#: ../ui-hlp/menu.c:1382
+msgid "Phoenix"
+msgstr "Phoenix"
+
+#: ../ui-hlp/menu.c:1383
+msgid "Octo"
+msgstr "Octo"
+
+#: ../ui-hlp/menu.c:1384
+msgid "Magnet"
+msgstr "Magnet"
+
+#: ../ui-hlp/menu.c:1385
+msgid "All features"
+msgstr "Alle Features"
+
+#: ../ui-hlp/menu.c:1387
+msgid "Outcoloring modes"
+msgstr "Äussere Färbungen"
+
+#: ../ui-hlp/menu.c:1388
+msgid "Incoloring modes"
+msgstr "Innere Färbungen"
+
+#: ../ui-hlp/menu.c:1389
+msgid "True-color coloring modes"
+msgstr "Echt-Farben Färbungsmodis"
+
+#: ../ui-hlp/menu.c:1392
+msgid "Planes"
+msgstr "Ebenen"
+
+#: ../ui-hlp/menu.c:1393
+msgid "Animations and position files"
+msgstr "Animations- und Positionsdateien"
+
+#: ../ui-hlp/menu.c:1396
+msgid "Random palettes"
+msgstr "Zufallspalette"
+
+#: ../ui-hlp/menu.c:1397
+msgid "Other noteworthy features"
+msgstr "Andere beachtenswerte Features"
+
+#: ../ui-hlp/menu.c:1400
+msgid "The definition and fractal dimension"
+msgstr "Definition und fraktale Dimension"
+
+#: ../ui-hlp/menu.c:1402
+msgid "Escape time fractals"
+msgstr "Fliehzeit-Fraktale"
+
+#: ../ui-hlp/menu.c:1406
+msgid "Triceratops and Catseye fractals"
+msgstr "Triceratops und Katzenaugen Fraktale"
+
+#: ../ui-hlp/menu.c:1408
+msgid "Mandelbar, Lambda, Manowar and Spider"
+msgstr "Mandelbar, Lambda, Manowar und Spider"
+
+#: ../ui-hlp/menu.c:1411
+msgid "Sierpinski Gasket, S.Carpet, Koch Snowflake"
+msgstr "Sierpinski Dichtung, S. Teppich, Kochsche Schneeflocke"
+
+#: ../ui-hlp/menu.c:1413
+msgid "What's new in 3.0?"
+msgstr "Was ist neu in 3.0?"
+
+#: ../ui-hlp/play.c:74
+msgid "line available only in animation replay"
+msgstr "Linie nur im Wiedergabemodus verfügbar"
+
+#: ../ui-hlp/play.c:99
+msgid "Morphing non existing line!"
+msgstr "Morphe nicht existente Linie!"
+
+#: ../ui-hlp/play.c:121
+msgid "linekey not available in this context!"
+msgstr "Linienschlüssel nicht verfügbar in diesem Kontext!"
+
+#: ../ui-hlp/play.c:291
+msgid "clear_line available only in animation replay"
+msgstr "Linie löschen nur im Wiedergabemodus verfügbar"
+
+#: ../ui-hlp/play.c:300
+msgid "clear_lines available only in animation replay"
+msgstr "Linien löschen nur im Wiedergabemodus verfügbar"
+
+#: ../ui-hlp/play.c:359
+msgid "Catalog file not found"
+msgstr "Katalogdatei nicht gefunden"
+
+#: ../ui-hlp/play.c:405
+msgid "Replay is already active"
+msgstr "Bereits am Wiedergeben"
+
+#: ../ui-hlp/play.c:409
+msgid "File open failed"
+msgstr "Datei konnte nicht geöffnet werden"
+
+#: ../ui-hlp/play.c:414
+msgid "Out of memory"
+msgstr "Zu wenig Speicher"
+
+#: ../ui-hlp/play.c:526 ../ui-hlp/play.c:542 ../ui-hlp/play.c:566
+#: ../ui-hlp/play.c:595
+msgid "Missing parameter"
+msgstr "Fehlender Parameter"
+
+#: ../ui-hlp/play.c:528 ../ui-hlp/play.c:544 ../ui-hlp/play.c:568
+#: ../ui-hlp/play.c:597
+msgid "Unexpected end of file"
+msgstr "Unerwartetes Dateiende"
+
+#: ../ui-hlp/play.c:555 ../ui-hlp/play.c:574
+msgid "Token is too long"
+msgstr "Token ist zu lang"
+
+#: ../ui-hlp/play.c:629
+msgid "Unknown formula type"
+msgstr "Unbekannter Formeltyp"
+
+#: ../ui-hlp/play.c:635
+msgid "morph available only in animation replay"
+msgstr "Morphen nur im Wiedergabemodus verfügbar"
+
+#: ../ui-hlp/play.c:639
+msgid "morphview: Invalid viewpoint"
+msgstr "Morphansicht: Falscher Ausschnitt"
+
+#: ../ui-hlp/play.c:653
+msgid "move available only in animation replay"
+msgstr "Verschieben nur im Wiedergabemodus verfügbar"
+
+#: ../ui-hlp/play.c:667
+msgid "morphjulia available only in animation replay"
+msgstr "Morphjulia nur im Wiedergabemodus verfügbar"
+
+#: ../ui-hlp/play.c:680
+msgid "morphangle available only in animation replay"
+msgstr "Morphwinkel nur im Wiedergabemodus verfügbar"
+
+#: ../ui-hlp/play.c:712
+msgid "Unknown filter"
+msgstr "Unbekannter Filter"
+
+#: ../ui-hlp/play.c:753
+msgid "sleep available only in animation replay"
+msgstr "Pause nur im Wiedergabemodus verfügbar"
+
+#: ../ui-hlp/play.c:767
+#, c-format
+msgid "Internal program error #12 %i\n"
+msgstr "Interner Programmfehler Nr. 12 %i\n"
+
+#: ../ui-hlp/play.c:788
+msgid "wait available only in animation replay"
+msgstr "Warten nur im Wiedergabemodus verfügbar"
+
+#: ../ui-hlp/play.c:834
+msgid "No catalog file loaded"
+msgstr "Keine Katalogdatei geladen"
+
+#: ../ui-hlp/play.c:839
+msgid "Message not found in catalog file"
+msgstr "Nachricht in der Katalogdatei nicht gefunden"
+
+#: ../ui-hlp/play.c:850
+msgid "load available only in animation replay"
+msgstr "Öffnen nur im Wiedergabemodus verfügbar"
+
+#: ../ui-hlp/play.c:854
+msgid "Include level overflow"
+msgstr "Zu viele Dateien ineinander einbezogen"
+
+#: ../ui-hlp/play.c:863
+msgid "File not found"
+msgstr "Datei nicht gefunden"
+
+#: ../ui-hlp/play.c:881
+msgid "Too many parameters"
+msgstr "Zu viele Parameter"
+
+#: ../ui-hlp/play.c:916
+#, c-format
+msgid "Replay disabled at line %i"
+msgstr "Wiedergabe auf Zeile %i ausgeschaltet"
+
+#: ../ui-hlp/ui_helper.c:646
+msgid "Tutorial files not found. Reinstall XaoS"
+msgstr "Tutorial Dateien nicht gefunden. Installiere XaoS neu"
+
+#: ../ui-hlp/ui_helper.c:651
+msgid "Preparing first image"
+msgstr "Erstes Bild wird vorbereitet"
+
+#: ../ui-hlp/ui_helper.c:661
+msgid "Could not open examples"
+msgstr "Konnte Beispiele nicht öffnen"
+
+#: ../ui-hlp/ui_helper.c:667
+#, c-format
+msgid "File %s loaded."
+msgstr "Datei %s geöffnet."
+
+#: ../ui-hlp/ui_helper.c:676
+msgid "Saving image..."
+msgstr "Speichere Bild..."
+
+#: ../ui-hlp/ui_helper.c:684
+msgid "Save interrupted"
+msgstr "Speicher Vorgang unterbrochen"
+
+#: ../ui-hlp/ui_helper.c:693 ../ui-hlp/ui_helper.c:710
+#: ../ui-hlp/ui_helper.c:777
+#, c-format
+msgid "File %s saved."
+msgstr "Datei %s gespeichert."
+
+#: ../ui-hlp/ui_helper.c:704
+msgid "Can not open file"
+msgstr "Kann Datei nicht öffnen"
+
+#: ../ui-hlp/ui_helper.c:799
+#, c-format
+msgid "Recording to file %s enabled."
+msgstr "Aufzeichnung in Datei %s eingeschaltet"
+
+#: ../engine/zoom.c:1128
+msgid "Solid guessing 1"
+msgstr "Solid-Guessing 1"
+
+#: ../engine/btrace.c:292 ../engine/btrace.c:373
+msgid "Boundary trace"
+msgstr "Boundary-Trace"
+
+#: ../ui/dialog.c:312 ../ui/dialog.c:398 ../ui/dialog.c:1377
+#: ../ui/ui-drv/cocoa/CustomDialog.m:302
+msgid "OK"
+msgstr "OK"
+
+#: ../ui/dialog.c:313 ../ui/dialog.c:401 ../ui/dialog.c:1379
+#: ../ui/filesel.c:184 ../ui/ui-drv/cocoa/CustomDialog.m:312
+msgid "Cancel"
+msgstr "Abbrechen"
+
+#: ../ui-hlp/render.c:46
+#, c-format
+msgid "Error: %s"
+msgstr "Fehler: %s"
+
+#: ../ui-hlp/render.c:121
+msgid "Cannot open motion vector file!"
+msgstr "Kann Bewegungsvektoren-Datei nicht öffnen!"
+
+#: ../ui-hlp/render.c:270
+#, c-format
+msgid "Vectors: %i"
+msgstr "Vektoren: %i"
+
+#: ../ui-hlp/render.c:276
+msgid "Initializing"
+msgstr "Beim initialisieren"
+
+#: ../ui-hlp/render.c:284
+msgid "Cannot create palette"
+msgstr "Kann Palette nicht erstellen"
+
+#: ../ui-hlp/render.c:295
+msgid "Cannot create image\n"
+msgstr "Kann Bild nicht erstellen\n"
+
+#: ../ui-hlp/render.c:304
+msgid "Cannot create checking buffer!"
+msgstr "Kann Kontroll-Puffer nicht erstellen!"
+
+#: ../ui-hlp/render.c:313 ../ui-hlp/render.c:596
+msgid "Cannot create context\n"
+msgstr "Kann Kontext nicht erstellen\n"
+
+#: ../ui-hlp/render.c:325
+msgid "Cannot open animation file\n"
+msgstr "Kann Animationsdatei nicht öffnen\n"
+
+#: ../ui-hlp/render.c:336 ../ui-hlp/render.c:605
+msgid "Loading catalogs"
+msgstr "Öffne Kataloge"
+
+#: ../ui-hlp/render.c:366
+msgid "Processing command line options"
+msgstr "Verarbeite Kommandozeilenoptionen"
+
+#: ../ui-hlp/render.c:389
+msgid "Enabling animation replay\n"
+msgstr "Wiedergabe von Animation wird eingeschaltet\n"
+
+#: ../ui-hlp/render.c:396 ../ui-hlp/render.c:514
+msgid "Cannot open image file"
+msgstr "Kann Bilddatei nicht öffnen"
+
+#: ../ui-hlp/render.c:410
+msgid "Cannot open pattern file"
+msgstr "Kann Palettendatei nicht öffnen"
+
+#: ../ui-hlp/render.c:427 ../ui-hlp/render.c:429 ../ui-hlp/render.c:638
+msgid "Entering calculation loop!"
+msgstr "Trete in Berechnungsschlaufe ein!"
+
+#: ../ui-hlp/render.c:455
+#, c-format
+msgid "Frame %i skipped."
+msgstr "Bild %i übersprungen."
+
+#: ../ui-hlp/render.c:457
+#, c-format
+msgid "Frames %i - %i skipped."
+msgstr "Bilder %i bis %i übersprungen."
+
+#: ../ui-hlp/render.c:461
+#, c-format
+msgid "Frame %4i: "
+msgstr "Bild %4i: "
+
+#: ../ui-hlp/render.c:528
+msgid " done."
+msgstr " fertig."
+
+#: ../ui-hlp/render.c:532
+msgid " skipping..."
+msgstr " beim Überspringen..."
+
+#: ../ui-hlp/render.c:565 ../ui-hlp/render.c:657
+msgid "Calculation interrupted"
+msgstr "Berechnung unterbrochen"
+
+#: ../ui-hlp/render.c:568 ../ui-hlp/render.c:570 ../ui-hlp/render.c:659
+msgid "Calculation finished"
+msgstr "Berechnung beendet"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1292 ../ui/ui-drv/cocoa/AppController.m:321
+msgid "Copy"
+msgstr "Kopieren"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1293 ../ui/ui-drv/cocoa/AppController.m:324
+msgid "Paste"
+msgstr "Einfügen"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1297
+msgid "About"
+msgstr "Info"
+
+#: ../ui/ui-drv/cocoa/AppController.m:197
+msgid "About XaoS"
+msgstr "Über XaoS"
+
+#: ../ui/ui-drv/cocoa/AppController.m:200
+msgid "Services"
+msgstr "Dienste"
+
+#: ../ui/ui-drv/cocoa/AppController.m:203
+msgid "Hide XaoS"
+msgstr "XaoS ausblenden"
+
+#: ../ui/ui-drv/cocoa/AppController.m:206
+msgid "Hide Others"
+msgstr "Andere ausblenden"
+
+#: ../ui/ui-drv/cocoa/AppController.m:209
+msgid "Show All"
+msgstr "Alle einblenden"
+
+#: ../ui/ui-drv/cocoa/AppController.m:212
+msgid "Quit XaoS"
+msgstr "XaoS Beenden"
+
+#: ../ui/ui-drv/cocoa/AppController.m:318
+msgid "Cut"
+msgstr "Ausschneiden"
+
+#: ../ui/ui-drv/cocoa/AppController.m:327
+msgid "Delete"
+msgstr "Löschen"
+
+#: ../ui/ui-drv/cocoa/AppController.m:330
+msgid "Select All"
+msgstr "Alle auswählen"
+
+#: ../ui/ui-drv/cocoa/AppController.m:340
+msgid "Minimize"
+msgstr "Im Dock ablegen"
+
+#: ../ui/ui-drv/cocoa/AppController.m:348
+msgid "Bring All to Front"
+msgstr "Alle nach vorne bringen"
+
+#: ../ui/ui-drv/cocoa/AppController.m:359
+msgid "Close"
+msgstr "Schliessen"
+
+#: ../ui/ui-drv/cocoa/AppController.m:373
+msgid "Videator Output"
+msgstr "Videator Ausgabe"
+
+#: ../ui/ui-drv/cocoa/CustomDialog.m:142
+msgid "Choose"
+msgstr "Wählen"
diff --git a/src/i18n/es.po b/src/i18n/es.po
new file mode 100644
index 0000000..960bd50
--- /dev/null
+++ b/src/i18n/es.po
@@ -0,0 +1,1561 @@
+# XaoS NLS file for Spanish language.
+# Copyright (C) 2002 Free Software Foundation, Inc.
+# Zoltan Kovacs <kovzol@math.u-szeged.hu>, 2002.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: XaoS 3.2\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-11-14 10:56+0100\n"
+"PO-Revision-Date: 2002-10-04 15:22+0200\n"
+"Last-Translator: César Pérez <oroz@users.sourceforge.net>\n"
+"Language-Team: Spanish <es@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: ../ui/ui.c:314
+msgid "XaoS is out of memory."
+msgstr "XaoS se quedó sin memoria"
+
+#: ../ui/ui.c:360
+#, c-format
+msgid "%s %.2f times (%.1fE) %2.2f frames/sec %c %i %i %i %i "
+msgstr "%s %.2f X (%.1fE) %2.2f imágenes/seg %c %i %i %i %i "
+
+#: ../ui/ui.c:361
+msgid "unzoomed"
+msgstr "alejado"
+
+#: ../ui/ui.c:361
+msgid "zoomed"
+msgstr "acercado"
+
+#: ../ui/ui.c:369
+#, c-format
+msgid "framerate:%f\n"
+msgstr "velocidad:%f\n"
+
+#: ../ui/ui.c:409
+#, c-format
+msgid "Enabling: %s. "
+msgstr "Habilitando: %s. "
+
+#: ../ui/ui.c:411
+#, c-format
+msgid "Disabling: %s. "
+msgstr "Deshabilitando: %s"
+
+#: ../ui/ui.c:441
+#, c-format
+msgid "Fractal name:%s"
+msgstr "Nombre del fractal: %s"
+
+#: ../ui/ui.c:446
+#, c-format
+msgid "Fractal type:%s"
+msgstr "Tipo de fractal: %s"
+
+#: ../ui/ui.c:448
+msgid "Mandelbrot"
+msgstr "Mandelbrot"
+
+#: ../ui/ui.c:449
+msgid "Julia"
+msgstr "Julia"
+
+#: ../ui/ui.c:452
+#, fuzzy, c-format
+msgid "Formula:%s"
+msgstr "Fórmula"
+
+#: ../ui/ui.c:457
+#, c-format
+msgid "View:[%1.12f,%1.12f]"
+msgstr "Vista:[%1.12f,%1.12f]"
+
+#: ../ui/ui.c:461
+#, c-format
+msgid "size:[%1.12f,%1.12f]"
+msgstr "Tamaño:[%1.12f,%1.12f]"
+
+#: ../ui/ui.c:465
+#, c-format
+msgid "Rotation:%4.2f Screen size:%i:%i"
+msgstr "Rotación:%4.2f Tamaño de la pantalla:%i:%i"
+
+#: ../ui/ui.c:470
+#, c-format
+msgid "Iterations:%-4i Palette size:%i"
+msgstr "Iteraciones:%-4i Tamaño de la paleta:%i"
+
+#: ../ui/ui.c:477
+#, c-format
+msgid "Autopilot:%-4s Plane:%s"
+msgstr "Piloto automático:%-4s Plano:%s"
+
+#: ../ui/ui.c:478
+msgid "On"
+msgstr "On"
+
+#: ../ui/ui.c:478
+msgid "Off"
+msgstr "Off"
+
+#: ../ui/ui.c:482
+#, c-format
+msgid "incoloring:%s outcoloring:%s"
+msgstr "Color interior:%s Color exterior:%s"
+
+#: ../ui/ui.c:487
+#, c-format
+msgid "zoomspeed:%f"
+msgstr "Velocidad zoom:%f"
+
+#: ../ui/ui.c:491
+msgid "Parameter:none"
+msgstr "Parámetro:ninguno"
+
+#: ../ui/ui.c:493
+#, c-format
+msgid "Parameter:[%f,%f]"
+msgstr "Parámetro:[%f,%f]"
+
+#: ../ui/ui.c:585
+#, c-format
+msgid "Please wait while calculating %s"
+msgstr "Por favor espere mientras se calcula %s"
+
+#: ../ui/ui.c:685
+#, c-format
+msgid "Letters per second %i "
+msgstr "Letras por segundo %i "
+
+#: ../ui/ui.c:698 ../ui/ui.c:709
+#, c-format
+msgid "Rotation speed:%2.2f degrees per second "
+msgstr "Velocidad de rotación:%2.2f grados por segundo "
+
+#: ../ui/ui.c:719
+#, fuzzy, c-format
+msgid "Iterations: %i "
+msgstr "Iteraciones: %i "
+
+#: ../ui/ui.c:735
+#, c-format
+msgid "Cycling speed: %i "
+msgstr "Velocidad de cambio de color: %i "
+
+#: ../ui/ui.c:748 ../ui/ui.c:762
+#, c-format
+msgid "speed:%2.2f "
+msgstr "velocidad: %2.2f "
+
+#: ../ui/ui.c:854
+#, c-format
+msgid "Thank you for using XaoS\n"
+msgstr "Gracias por usar XaoS\n"
+
+#: ../ui/ui.c:891
+msgid "Skipping, please wait..."
+msgstr "Saltando, por favor espere..."
+
+#: ../ui/ui.c:983 ../ui/ui.c:985 ../ui/ui-drv/win32/ui_win32.c:1453
+msgid "Resize"
+msgstr ""
+
+#: ../ui/ui.c:998
+#, fuzzy
+msgid "Quit"
+msgstr "Salir"
+
+#: ../ui/ui.c:999
+msgid "Exit now"
+msgstr "Salir ahora"
+
+#: ../ui/ui.c:1001
+msgid "Not yet"
+msgstr "Todavía no"
+
+#: ../ui/ui.c:1004 ../ui-hlp/menu.c:1055 ../ui-hlp/menu.c:1065
+#: ../ui/dialog.c:404 ../ui/dialog.c:1380
+msgid "Help"
+msgstr "Ayuda"
+
+#: ../ui/ui.c:1006
+msgid "Disable XaoS's builtin GUI"
+msgstr "Deshabilitar GUI incorporado en XaoS"
+
+#: ../ui/ui.c:1010 ../ui/ui.c:1016
+msgid "Status"
+msgstr "Estado"
+
+#: ../ui/ui.c:1012 ../ui/ui.c:1018
+msgid "Ministatus"
+msgstr "Miniestado"
+
+#: ../ui/ui.c:1021 ../ui/ui.c:1022
+msgid "Driver"
+msgstr "Driver"
+
+#: ../ui/ui.c:1413
+#, c-format
+msgid "Welcome to XaoS version %s"
+msgstr "Bienvenido a XaoS versión %s"
+
+#: ../ui/ui.c:1580
+msgid "Can not allocate buffers"
+msgstr "No se puede asignar búfer"
+
+#: ../ui/ui.c:1598
+msgid "Can not create palette"
+msgstr "No se puede crear la paleta"
+
+#: ../ui/ui.c:1610
+msgid "Can not create image"
+msgstr "No se puede crear la imagen"
+
+#: ../ui/ui.c:1641 ../ui/ui.c:1692
+msgid "Can not allocate tables"
+msgstr "No se asignar tablas"
+
+#: ../ui/ui.c:1678
+msgid "Can not initialize driver"
+msgstr "No se puede inicializar el driver"
+
+#: ../ui/ui.c:1681
+msgid "Can not return back to previous driver"
+msgstr "No se puede volver al driver anterior"
+
+#: ../ui-hlp/menu.c:129
+#, fuzzy
+msgid "Perturbation:"
+msgstr "Perturbación"
+
+#: ../ui-hlp/menu.c:133
+#, fuzzy
+msgid "Julia-seed:"
+msgstr "Semilla del Julia"
+
+#: ../ui-hlp/menu.c:137
+msgid "Morphing type:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:138
+#, fuzzy
+msgid "Startuptime:"
+msgstr "Estado"
+
+#: ../ui-hlp/menu.c:139
+#, fuzzy
+msgid "Stoptime:"
+msgstr "Estado"
+
+#: ../ui-hlp/menu.c:143
+msgid "File to render:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:144
+#, fuzzy
+msgid "Basename:"
+msgstr "Fichero"
+
+#: ../ui-hlp/menu.c:145
+msgid "Width:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:146
+msgid "Height:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:147
+msgid "Real width (cm):"
+msgstr ""
+
+#: ../ui-hlp/menu.c:148
+msgid "Real height (cm):"
+msgstr ""
+
+#: ../ui-hlp/menu.c:149
+#, fuzzy
+msgid "Framerate:"
+msgstr "velocidad:%f\n"
+
+#: ../ui-hlp/menu.c:150
+msgid "Image type:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:151
+#, fuzzy
+msgid "Antialiasing:"
+msgstr "Iteraciones"
+
+#: ../ui-hlp/menu.c:152
+#, fuzzy
+msgid "Always recalculate:"
+msgstr "Recalcular"
+
+#: ../ui-hlp/menu.c:153
+msgid "Calculate MPEG motion vectors:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:154
+msgid "Recommended I frame distance:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:158
+#, fuzzy
+msgid "Center:"
+msgstr "Centro del zoom"
+
+#: ../ui-hlp/menu.c:159
+msgid "Radius:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:160 ../ui-hlp/menu.c:225
+msgid "Angle:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:164
+msgid "Mode:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:165
+#, fuzzy
+msgid "Start:"
+msgstr "Estado"
+
+#: ../ui-hlp/menu.c:166
+msgid "End:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:170
+#, fuzzy
+msgid "Color:"
+msgstr "Color"
+
+#: ../ui-hlp/menu.c:174
+#, fuzzy
+msgid "Rotations per second:"
+msgstr "Velocidad de rotación"
+
+#: ../ui-hlp/menu.c:178
+#, fuzzy
+msgid "Letters per second:"
+msgstr "Letras por segundo"
+
+#: ../ui-hlp/menu.c:182
+#, fuzzy
+msgid "Iterations:"
+msgstr "Iteraciones"
+
+#: ../ui-hlp/menu.c:186
+msgid "Text:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:190
+#, fuzzy
+msgid "Your command:"
+msgstr "Instrucción"
+
+#: ../ui-hlp/menu.c:194 ../ui-hlp/menu.c:198 ../ui-hlp/menu.c:202
+#: ../ui-hlp/menu.c:206 ../ui-hlp/menu.c:258
+#, fuzzy
+msgid "Filename:"
+msgstr "Fichero"
+
+#: ../ui-hlp/menu.c:210 ../ui-hlp/menu.c:298
+#, fuzzy
+msgid "Formula:"
+msgstr "Fórmula"
+
+#: ../ui-hlp/menu.c:214
+#, fuzzy
+msgid "X center:"
+msgstr "Centro del zoom"
+
+#: ../ui-hlp/menu.c:215
+#, fuzzy
+msgid "Y center:"
+msgstr "Centro del zoom"
+
+#: ../ui-hlp/menu.c:216
+msgid "X Radius:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:217
+msgid "Y Radius:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:221
+msgid "Coordinates:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:229
+#, fuzzy
+msgid "continuous rotation"
+msgstr "Rotación continua"
+
+#: ../ui-hlp/menu.c:233
+#, fuzzy
+msgid "Fast rotation"
+msgstr "Modo de rotación rápido"
+
+#: ../ui-hlp/menu.c:237
+#, fuzzy
+msgid "filter"
+msgstr "Filtro"
+
+#: ../ui-hlp/menu.c:238
+msgid "enable"
+msgstr ""
+
+#: ../ui-hlp/menu.c:242
+msgid "Amount:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:246
+#, fuzzy
+msgid "Zooming speed:"
+msgstr "Velocidad del zoom"
+
+#: ../ui-hlp/menu.c:250
+msgid "Name:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:254
+msgid "Bailout:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:262
+#, fuzzy
+msgid "Julia mode:"
+msgstr "Modo Julia"
+
+#: ../ui-hlp/menu.c:266
+#, fuzzy
+msgid "Horizontal position:"
+msgstr "Posición horizontal del texto"
+
+#: ../ui-hlp/menu.c:267
+#, fuzzy
+msgid "Vertical position:"
+msgstr "Posición vertical del texto"
+
+#: ../ui-hlp/menu.c:271
+#, fuzzy
+msgid "Dynamic resolution:"
+msgstr "Resolución dinámica"
+
+#: ../ui-hlp/menu.c:275
+msgid "Time:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:279 ../ui-hlp/menu.c:283
+msgid "Number:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:287
+msgid "Algorithm number:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:288
+msgid "Seed:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:289
+msgid "Shift:"
+msgstr ""
+
+#: ../ui-hlp/menu.c:293
+#, fuzzy
+msgid "Frames per second:"
+msgstr "Letras por segundo"
+
+#: ../ui-hlp/menu.c:302
+#, fuzzy
+msgid "Initialization:"
+msgstr "Iteraciones"
+
+#: ../ui-hlp/menu.c:357
+msgid "renderanim: Must specify a valid absolute path for basename"
+msgstr ""
+
+#: ../ui-hlp/menu.c:364
+msgid ""
+"renderanim: Width parameter must be positive integer in the range 0..4096"
+msgstr ""
+
+#: ../ui-hlp/menu.c:370
+msgid ""
+"renderanim: Height parameter must be positive integer in the range 0..4096"
+msgstr ""
+
+#: ../ui-hlp/menu.c:376
+msgid "renderanim: Invalid real width and height dimensions"
+msgstr ""
+
+#: ../ui-hlp/menu.c:380
+msgid "renderanim: invalid framerate"
+msgstr ""
+
+#: ../ui-hlp/menu.c:386
+msgid "renderanim: antialiasing not supported in 256 color mode"
+msgstr ""
+
+#: ../ui-hlp/menu.c:390
+msgid "renderanim: incorrect I frame distance"
+msgstr ""
+
+#: ../ui-hlp/menu.c:441 ../ui-hlp/menu.c:454
+msgid "animateview: Invalid viewpoint"
+msgstr ""
+
+#: ../ui-hlp/menu.c:467
+msgid "Invalid viewpoint"
+msgstr ""
+
+#: ../ui-hlp/menu.c:696
+#, fuzzy
+msgid "Unknown palette type"
+msgstr "Filtro"
+
+#: ../ui-hlp/menu.c:771 ../ui-hlp/menu.c:785
+msgid "Initialization of color cycling failed."
+msgstr ""
+
+#: ../ui-hlp/menu.c:773 ../ui-hlp/menu.c:787
+msgid "Try to enable palette emulation filter"
+msgstr ""
+
+#: ../ui-hlp/menu.c:896
+#, c-format
+msgid "Algorithm:%i seed:%i size:%i"
+msgstr ""
+
+#: ../ui-hlp/menu.c:947
+msgid "Root menu"
+msgstr "Menú principal"
+
+#: ../ui-hlp/menu.c:948
+msgid "Animation root menu"
+msgstr "Animación menú principal"
+
+#: ../ui-hlp/menu.c:949
+msgid "Replay only commands"
+msgstr "Repetir sólo instrucciones"
+
+#: ../ui-hlp/menu.c:950
+msgid "Command line options only"
+msgstr "Sólo pciones de la línea de instrucciones"
+
+#: ../ui-hlp/menu.c:953
+msgid "print menus specifications of all menus"
+msgstr ""
+
+#: ../ui-hlp/menu.c:958
+msgid "print menu specification"
+msgstr ""
+
+#: ../ui-hlp/menu.c:961
+msgid "print menu specification in xshl format"
+msgstr ""
+
+#: ../ui-hlp/menu.c:965
+msgid "print all menu specifications in xshl format"
+msgstr ""
+
+#: ../ui-hlp/menu.c:967
+msgid "print dialog specification"
+msgstr ""
+
+#: ../ui-hlp/menu.c:972
+msgid "Line drawing functions"
+msgstr "Funciones para dibujar líneas"
+
+#: ../ui-hlp/menu.c:973
+msgid "Line"
+msgstr "Línea"
+
+#: ../ui-hlp/menu.c:976
+#, fuzzy
+msgid "Morph line"
+msgstr "Despejar línea"
+
+#: ../ui-hlp/menu.c:978
+msgid "Morph last line"
+msgstr ""
+
+#: ../ui-hlp/menu.c:981
+#, fuzzy
+msgid "Set line key"
+msgstr "Poner plano"
+
+#: ../ui-hlp/menu.c:983
+msgid "Clear line"
+msgstr "Despejar línea"
+
+#: ../ui-hlp/menu.c:986
+msgid "Clear all lines"
+msgstr "Despejar todas las líneas"
+
+#: ../ui-hlp/menu.c:988
+msgid "Animation functions"
+msgstr "Funciones de animación"
+
+#: ../ui-hlp/menu.c:989 ../ui-hlp/menu.c:1181 ../ui-hlp/menu.c:1190
+msgid "View"
+msgstr "Vista"
+
+#: ../ui-hlp/menu.c:993
+msgid "Morph view"
+msgstr ""
+
+#: ../ui-hlp/menu.c:995
+msgid "Morph julia"
+msgstr ""
+
+#: ../ui-hlp/menu.c:1000
+msgid "Move view"
+msgstr "Vista de movimiento"
+
+#: ../ui-hlp/menu.c:1002
+#, fuzzy
+msgid "Morph angle"
+msgstr "Poner ángulo"
+
+#: ../ui-hlp/menu.c:1004
+msgid "Zoom center"
+msgstr "Centro del zoom"
+
+#: ../ui-hlp/menu.c:1006 ../ui/ui-drv/cocoa/AppController.m:343
+msgid "Zoom"
+msgstr "Zoom"
+
+#: ../ui-hlp/menu.c:1007
+msgid "Un-zoom"
+msgstr "Alejar"
+
+#: ../ui-hlp/menu.c:1010
+msgid "Stop zooming"
+msgstr "Parar zoom"
+
+#: ../ui-hlp/menu.c:1011
+msgid "Smooth morphing parameters"
+msgstr ""
+
+#: ../ui-hlp/menu.c:1014
+msgid "Timing functions"
+msgstr "Funciones de tiempo"
+
+#: ../ui-hlp/menu.c:1015
+msgid "Usleep"
+msgstr "Usleep"
+
+#: ../ui-hlp/menu.c:1018
+msgid "Wait for text"
+msgstr "Esperar por el texto"
+
+#: ../ui-hlp/menu.c:1020
+msgid "Wait for complete image"
+msgstr "Esperar para completar la imagen"
+
+#: ../ui-hlp/menu.c:1022
+msgid "Include file"
+msgstr "Fichero incluido"
+
+#: ../ui-hlp/menu.c:1024 ../ui-hlp/menu.c:1222
+msgid "Default palette"
+msgstr "Paleta por defecto"
+
+#: ../ui-hlp/menu.c:1026
+msgid "Formula"
+msgstr "Fórmula"
+
+#: ../ui-hlp/menu.c:1028
+msgid "Maximal zooming step"
+msgstr ""
+
+#: ../ui-hlp/menu.c:1030
+msgid "Zooming speedup"
+msgstr ""
+
+#: ../ui-hlp/menu.c:1032
+msgid "Filter"
+msgstr "Filtro"
+
+#: ../ui-hlp/menu.c:1036 ../ui-hlp/menu.c:1041
+msgid "Letters per second"
+msgstr "Letras por segundo"
+
+#: ../ui-hlp/menu.c:1043 ../ui-hlp/menu.c:1314
+msgid "Interrupt"
+msgstr "Interrumpir"
+
+#: ../ui-hlp/menu.c:1045 ../ui-hlp/menu.c:1057
+msgid "File"
+msgstr "Fichero"
+
+#: ../ui-hlp/menu.c:1046
+msgid "Edit"
+msgstr "Editar"
+
+#: ../ui-hlp/menu.c:1047
+msgid "Fractal"
+msgstr "Fractal"
+
+#: ../ui-hlp/menu.c:1048
+msgid "Calculation"
+msgstr "Cálculo"
+
+#: ../ui-hlp/menu.c:1049 ../ui-hlp/menu.c:1391
+msgid "Filters"
+msgstr "Filtros"
+
+#: ../ui-hlp/menu.c:1050 ../ui-hlp/menu.c:1064
+msgid "UI"
+msgstr "UI"
+
+#: ../ui-hlp/menu.c:1051
+msgid "Misc"
+msgstr "Misc"
+
+#: ../ui-hlp/menu.c:1053
+#, fuzzy
+msgid "Window"
+msgstr "Deshacer"
+
+#: ../ui-hlp/menu.c:1056
+msgid "Tutorials"
+msgstr "Tutoriales"
+
+#: ../ui-hlp/menu.c:1062
+msgid "Stop replay"
+msgstr "Parar repetición"
+
+#: ../ui-hlp/menu.c:1066
+msgid "Command"
+msgstr "Instrucción"
+
+#: ../ui-hlp/menu.c:1068
+msgid "Play string"
+msgstr "Mostrar cadena"
+
+#: ../ui-hlp/menu.c:1070
+msgid "Render animation"
+msgstr "Renderizar animación"
+
+#: ../ui-hlp/menu.c:1073
+msgid "Clear screen"
+msgstr "Limpiar pantalla"
+
+#: ../ui-hlp/menu.c:1075
+msgid "Display fractal"
+msgstr "Mostrar fractal"
+
+#: ../ui-hlp/menu.c:1078
+msgid "Display text"
+msgstr "Mostrar texto"
+
+#: ../ui-hlp/menu.c:1080
+#, fuzzy
+msgid "Color"
+msgstr "Color"
+
+#: ../ui-hlp/menu.c:1082
+msgid "Horizontal text position"
+msgstr "Posición horizontal del texto"
+
+#: ../ui-hlp/menu.c:1084
+msgid "Vertical text position"
+msgstr "Posición vertical del texto"
+
+#: ../ui-hlp/menu.c:1086
+msgid "Text position"
+msgstr "Posición del texto"
+
+#: ../ui-hlp/menu.c:1090
+msgid "Message"
+msgstr "Mensaje"
+
+#: ../ui-hlp/menu.c:1112
+msgid "Load"
+msgstr "Cargar"
+
+#: ../ui-hlp/menu.c:1115
+msgid "Save"
+msgstr "Guardar"
+
+#: ../ui-hlp/menu.c:1117
+msgid "Record"
+msgstr "Grabar"
+
+#: ../ui-hlp/menu.c:1121
+msgid "Replay"
+msgstr "Repetir"
+
+#: ../ui-hlp/menu.c:1128
+msgid "Save image"
+msgstr "Guardar imagen"
+
+#: ../ui-hlp/menu.c:1130
+msgid "Load random example"
+msgstr "Cargar ejemplo aleatorio"
+
+#: ../ui-hlp/menu.c:1132
+msgid "Save configuration"
+msgstr "Guardar configuración"
+
+#: ../ui-hlp/menu.c:1137
+msgid "Undo"
+msgstr "Deshacer"
+
+#: ../ui-hlp/menu.c:1141
+msgid "Redo"
+msgstr "Rehacer"
+
+#: ../ui-hlp/menu.c:1145
+msgid "Formulae"
+msgstr "Formulae"
+
+#: ../ui-hlp/menu.c:1146
+#, fuzzy
+msgid "More formulae"
+msgstr "formulae"
+
+#: ../ui-hlp/menu.c:1151
+#, fuzzy
+msgid "User formula"
+msgstr "formulae"
+
+#: ../ui-hlp/menu.c:1153
+#, fuzzy
+msgid "User initialization"
+msgstr "Funciones para dibujar líneas"
+
+#: ../ui-hlp/menu.c:1158
+msgid "Incoloring mode"
+msgstr "Modo de color interior"
+
+#: ../ui-hlp/menu.c:1159
+msgid "Outcoloring mode"
+msgstr "Modo de color exterior"
+
+#: ../ui-hlp/menu.c:1160
+msgid "Plane"
+msgstr "Plano"
+
+#: ../ui-hlp/menu.c:1161
+#, fuzzy
+msgid "Palette"
+msgstr "Paleta"
+
+#: ../ui-hlp/menu.c:1164
+msgid "Mandelbrot mode"
+msgstr "Modo Mandelbrot"
+
+#: ../ui-hlp/menu.c:1170 ../ui-hlp/menu.c:1174 ../ui-hlp/menu.c:1395
+msgid "Perturbation"
+msgstr "Perturbación"
+
+#: ../ui-hlp/menu.c:1185
+msgid "Reset to defaults"
+msgstr "Valores por defecto"
+
+#: ../ui-hlp/menu.c:1186
+msgid "Julia mode"
+msgstr "Modo Julia"
+
+#: ../ui-hlp/menu.c:1193
+msgid "Set angle"
+msgstr "Poner ángulo"
+
+#: ../ui-hlp/menu.c:1197
+msgid "Set plane"
+msgstr "Poner plano"
+
+#: ../ui-hlp/menu.c:1201
+msgid "Inside coloring mode"
+msgstr "Modo de coloración interior"
+
+#: ../ui-hlp/menu.c:1206
+msgid "Outside coloring mode"
+msgstr "Modo de coloración exterior"
+
+#: ../ui-hlp/menu.c:1212
+msgid "Inside truecolor coloring mode"
+msgstr "Modo de coloración interior color verdadero"
+
+#: ../ui-hlp/menu.c:1216
+msgid "Outside truecolor coloring mode"
+msgstr "Modo de coloración exterior color verdadero"
+
+#: ../ui-hlp/menu.c:1219
+msgid "Julia seed"
+msgstr "Semilla del Julia"
+
+#: ../ui-hlp/menu.c:1224
+msgid "Random palette"
+msgstr "Paleta aleatoria"
+
+#: ../ui-hlp/menu.c:1226
+msgid "Custom palette"
+msgstr "Paleta de usuario"
+
+#: ../ui-hlp/menu.c:1230
+msgid "Color cycling"
+msgstr "Cambio del color:"
+
+#: ../ui-hlp/menu.c:1232
+msgid "Reversed color cycling"
+msgstr "Cambio del color (inverso):"
+
+#: ../ui-hlp/menu.c:1237
+msgid "Color cycling speed"
+msgstr "Velocidad del cambio de color"
+
+#: ../ui-hlp/menu.c:1241
+msgid "Shift palette"
+msgstr "Cambiar paleta"
+
+#: ../ui-hlp/menu.c:1243
+msgid "Shift one forward"
+msgstr "Uno hacia deltante"
+
+#: ../ui-hlp/menu.c:1246
+msgid "Shift one backward"
+msgstr "Uno hacia atrás"
+
+#: ../ui-hlp/menu.c:1248 ../engine/zoom.c:1357
+msgid "Solid guessing"
+msgstr ""
+
+#: ../ui-hlp/menu.c:1249
+msgid "Dynamic resolution"
+msgstr "Resolución dinámica"
+
+#: ../ui-hlp/menu.c:1251
+msgid "Periodicity checking"
+msgstr "Chequeo de periodicidad"
+
+#: ../ui-hlp/menu.c:1254
+msgid "Iterations"
+msgstr "Iteraciones"
+
+#: ../ui-hlp/menu.c:1256
+msgid "Bailout"
+msgstr ""
+
+#: ../ui-hlp/menu.c:1260
+msgid "Fast julia mode"
+msgstr "Modo de Julia rápido"
+
+#: ../ui-hlp/menu.c:1262
+msgid "Rotation"
+msgstr "Rotación"
+
+#: ../ui-hlp/menu.c:1263
+msgid "Solid guessing range"
+msgstr ""
+
+#: ../ui-hlp/menu.c:1266
+msgid "Disable rotation"
+msgstr "Deshabilitar rotación"
+
+#: ../ui-hlp/menu.c:1270
+msgid "Continuous rotation"
+msgstr "Rotación continua"
+
+#: ../ui-hlp/menu.c:1273
+msgid "Rotate by mouse"
+msgstr "Rotación con el ratón"
+
+#: ../ui-hlp/menu.c:1277
+msgid "Rotation speed"
+msgstr "Velocidad de rotación"
+
+#: ../ui-hlp/menu.c:1280
+msgid "Automatic rotation"
+msgstr "Rotación automática"
+
+#: ../ui-hlp/menu.c:1285
+msgid "Fast rotation mode"
+msgstr "Modo de rotación rápido"
+
+#: ../ui-hlp/menu.c:1289
+msgid "Disable dynamic resolution"
+msgstr "Deshabilitar resolución dinámica"
+
+#: ../ui-hlp/menu.c:1292
+msgid "Use only during animation"
+msgstr "Usar sólo durante la animación"
+
+#: ../ui-hlp/menu.c:1296
+msgid "Use also for new images"
+msgstr "Usar también para imágenes nuevas"
+
+#: ../ui-hlp/menu.c:1298
+msgid "Dynamic resolution mode"
+msgstr "Mode de resolución dinámica"
+
+#: ../ui-hlp/menu.c:1302
+msgid "Autopilot"
+msgstr "Piloto automático"
+
+#: ../ui-hlp/menu.c:1306
+#, fuzzy
+msgid "VJ mode"
+msgstr "Modo Julia"
+
+#: ../ui-hlp/menu.c:1310
+msgid "Recalculate"
+msgstr "Recalcular"
+
+#: ../ui-hlp/menu.c:1319
+msgid "Zooming speed"
+msgstr "Velocidad del zoom"
+
+#: ../ui-hlp/menu.c:1321
+msgid "Fixed step"
+msgstr "Paso fijo"
+
+#: ../ui-hlp/menu.c:1325
+msgid "Disable solid guessing"
+msgstr ""
+
+#: ../ui-hlp/menu.c:1329
+msgid "Guess 2x2 rectangles"
+msgstr "Adivinar rectángulos 2x2"
+
+#: ../ui-hlp/menu.c:1331
+msgid "Guess 3x3 rectangles"
+msgstr "Adivinar rectángulos 3x3"
+
+#: ../ui-hlp/menu.c:1335
+msgid "Guess 4x4 rectangles"
+msgstr "Adivinar rectángulos 4x4"
+
+#: ../ui-hlp/menu.c:1337
+msgid "Guess 5x5 rectangles"
+msgstr "Adivinar rectángulos 5x5"
+
+#: ../ui-hlp/menu.c:1341
+msgid "Guess 6x6 rectangles"
+msgstr "Adivinar rectángulos 6x6"
+
+#: ../ui-hlp/menu.c:1343
+msgid "Guess 7x7 rectangles"
+msgstr "Adivinar rectángulos 7x7"
+
+#: ../ui-hlp/menu.c:1347
+msgid "Guess 8x8 rectangles"
+msgstr "Adivinar rectángulos 8x8"
+
+#: ../ui-hlp/menu.c:1349
+msgid "Guess unlimited rectangles"
+msgstr "Adivinar rectángulos ilimitados"
+
+#: ../ui-hlp/menu.c:1354
+msgid "Language"
+msgstr "Idioma"
+
+#: ../ui-hlp/menu.c:1357
+msgid "An introduction to fractals"
+msgstr "Una introducción a los fractales"
+
+#: ../ui-hlp/menu.c:1359
+msgid "XaoS features overview"
+msgstr "Perspectiva general de las características de XaoS"
+
+#: ../ui-hlp/menu.c:1361
+msgid "Math behind fractals"
+msgstr "Matemáticas tras los fractales"
+
+#: ../ui-hlp/menu.c:1362 ../ui-hlp/menu.c:1403
+msgid "Other fractal types in XaoS"
+msgstr ""
+
+#: ../ui-hlp/menu.c:1364
+msgid "What's new?"
+msgstr "¿Qué hay nuevo?"
+
+#: ../ui-hlp/menu.c:1374 ../ui-hlp/menu.c:1398
+msgid "Whole story"
+msgstr "La historia completa"
+
+#: ../ui-hlp/menu.c:1376
+msgid "Introduction"
+msgstr "Introducción"
+
+#: ../ui-hlp/menu.c:1377
+msgid "Mandelbrot set"
+msgstr "Conjunto Mandelbrot"
+
+#: ../ui-hlp/menu.c:1378
+msgid "Julia set"
+msgstr "Conjunto Julia"
+
+#: ../ui-hlp/menu.c:1379
+msgid "Higher power Mandelbrots"
+msgstr "Mandelbrots de potencias superiores"
+
+#: ../ui-hlp/menu.c:1380
+msgid "Newton's method"
+msgstr "Método de Newton"
+
+#: ../ui-hlp/menu.c:1381
+msgid "Barnsley's formula"
+msgstr "Fórmula de Barnsley"
+
+#: ../ui-hlp/menu.c:1382
+msgid "Phoenix"
+msgstr "Fénix"
+
+#: ../ui-hlp/menu.c:1383
+msgid "Octo"
+msgstr "Octo"
+
+#: ../ui-hlp/menu.c:1384
+msgid "Magnet"
+msgstr "Magnet"
+
+#: ../ui-hlp/menu.c:1385
+msgid "All features"
+msgstr "Todas las características"
+
+#: ../ui-hlp/menu.c:1387
+#, fuzzy
+msgid "Outcoloring modes"
+msgstr "Modo de color exterior"
+
+#: ../ui-hlp/menu.c:1388
+#, fuzzy
+msgid "Incoloring modes"
+msgstr "Modo de color interior"
+
+#: ../ui-hlp/menu.c:1389
+#, fuzzy
+msgid "True-color coloring modes"
+msgstr "Modo de coloración interior color verdadero"
+
+#: ../ui-hlp/menu.c:1392
+msgid "Planes"
+msgstr "Planos"
+
+#: ../ui-hlp/menu.c:1393
+msgid "Animations and position files"
+msgstr "Ficheros de animaciones y posición"
+
+#: ../ui-hlp/menu.c:1396
+msgid "Random palettes"
+msgstr "Paletas aleatorias"
+
+#: ../ui-hlp/menu.c:1397
+msgid "Other noteworthy features"
+msgstr "Otras características destacables"
+
+#: ../ui-hlp/menu.c:1400
+msgid "The definition and fractal dimension"
+msgstr "La definición y dimensión fractal"
+
+#: ../ui-hlp/menu.c:1402
+#, fuzzy
+msgid "Escape time fractals"
+msgstr "Matemáticas tras los fractales"
+
+#: ../ui-hlp/menu.c:1406
+msgid "Triceratops and Catseye fractals"
+msgstr ""
+
+#: ../ui-hlp/menu.c:1408
+msgid "Mandelbar, Lambda, Manowar and Spider"
+msgstr ""
+
+#: ../ui-hlp/menu.c:1411
+msgid "Sierpinski Gasket, S.Carpet, Koch Snowflake"
+msgstr ""
+
+#: ../ui-hlp/menu.c:1413
+msgid "What's new in 3.0?"
+msgstr "¿Qué hay nuevo en 3.0?"
+
+#: ../ui-hlp/play.c:74
+#, fuzzy
+msgid "line available only in animation replay"
+msgstr "Usar sólo durante la animación"
+
+#: ../ui-hlp/play.c:99
+msgid "Morphing non existing line!"
+msgstr ""
+
+#: ../ui-hlp/play.c:121
+msgid "linekey not available in this context!"
+msgstr ""
+
+#: ../ui-hlp/play.c:291
+#, fuzzy
+msgid "clear_line available only in animation replay"
+msgstr "Usar sólo durante la animación"
+
+#: ../ui-hlp/play.c:300
+#, fuzzy
+msgid "clear_lines available only in animation replay"
+msgstr "Usar sólo durante la animación"
+
+#: ../ui-hlp/play.c:359
+msgid "Catalog file not found"
+msgstr ""
+
+#: ../ui-hlp/play.c:405
+msgid "Replay is already active"
+msgstr ""
+
+#: ../ui-hlp/play.c:409
+#, fuzzy
+msgid "File open failed"
+msgstr "No se asignar tablas"
+
+#: ../ui-hlp/play.c:414
+#, fuzzy
+msgid "Out of memory"
+msgstr "XaoS se quedó sin memoria"
+
+#: ../ui-hlp/play.c:526 ../ui-hlp/play.c:542 ../ui-hlp/play.c:566
+#: ../ui-hlp/play.c:595
+msgid "Missing parameter"
+msgstr ""
+
+#: ../ui-hlp/play.c:528 ../ui-hlp/play.c:544 ../ui-hlp/play.c:568
+#: ../ui-hlp/play.c:597
+msgid "Unexpected end of file"
+msgstr ""
+
+#: ../ui-hlp/play.c:555 ../ui-hlp/play.c:574
+msgid "Token is too long"
+msgstr ""
+
+#: ../ui-hlp/play.c:629
+#, fuzzy
+msgid "Unknown formula type"
+msgstr "Filtro"
+
+#: ../ui-hlp/play.c:635
+#, fuzzy
+msgid "morph available only in animation replay"
+msgstr "Usar sólo durante la animación"
+
+#: ../ui-hlp/play.c:639
+msgid "morphview: Invalid viewpoint"
+msgstr ""
+
+#: ../ui-hlp/play.c:653
+#, fuzzy
+msgid "move available only in animation replay"
+msgstr "Usar sólo durante la animación"
+
+#: ../ui-hlp/play.c:667
+#, fuzzy
+msgid "morphjulia available only in animation replay"
+msgstr "Usar sólo durante la animación"
+
+#: ../ui-hlp/play.c:680
+#, fuzzy
+msgid "morphangle available only in animation replay"
+msgstr "Usar sólo durante la animación"
+
+#: ../ui-hlp/play.c:712
+#, fuzzy
+msgid "Unknown filter"
+msgstr "Filtro"
+
+#: ../ui-hlp/play.c:753
+#, fuzzy
+msgid "sleep available only in animation replay"
+msgstr "Usar sólo durante la animación"
+
+#: ../ui-hlp/play.c:767
+#, c-format
+msgid "Internal program error #12 %i\n"
+msgstr ""
+
+#: ../ui-hlp/play.c:788
+#, fuzzy
+msgid "wait available only in animation replay"
+msgstr "Usar sólo durante la animación"
+
+#: ../ui-hlp/play.c:834
+msgid "No catalog file loaded"
+msgstr ""
+
+#: ../ui-hlp/play.c:839
+msgid "Message not found in catalog file"
+msgstr ""
+
+#: ../ui-hlp/play.c:850
+#, fuzzy
+msgid "load available only in animation replay"
+msgstr "Usar sólo durante la animación"
+
+#: ../ui-hlp/play.c:854
+msgid "Include level overflow"
+msgstr ""
+
+#: ../ui-hlp/play.c:863
+msgid "File not found"
+msgstr ""
+
+#: ../ui-hlp/play.c:881
+msgid "Too many parameters"
+msgstr ""
+
+#: ../ui-hlp/play.c:916
+#, c-format
+msgid "Replay disabled at line %i"
+msgstr ""
+
+#: ../ui-hlp/ui_helper.c:646
+msgid "Tutorial files not found. Reinstall XaoS"
+msgstr ""
+
+#: ../ui-hlp/ui_helper.c:651
+msgid "Preparing first image"
+msgstr ""
+
+#: ../ui-hlp/ui_helper.c:661
+#, fuzzy
+msgid "Could not open examples"
+msgstr "Cargar ejemplo aleatorio"
+
+#: ../ui-hlp/ui_helper.c:667
+#, c-format
+msgid "File %s loaded."
+msgstr ""
+
+#: ../ui-hlp/ui_helper.c:676
+#, fuzzy
+msgid "Saving image..."
+msgstr "Guardar imagen"
+
+#: ../ui-hlp/ui_helper.c:684
+#, fuzzy
+msgid "Save interrupted"
+msgstr "Interrumpir"
+
+#: ../ui-hlp/ui_helper.c:693 ../ui-hlp/ui_helper.c:710
+#: ../ui-hlp/ui_helper.c:777
+#, c-format
+msgid "File %s saved."
+msgstr ""
+
+#: ../ui-hlp/ui_helper.c:704
+#, fuzzy
+msgid "Can not open file"
+msgstr "No se asignar tablas"
+
+#: ../ui-hlp/ui_helper.c:799
+#, c-format
+msgid "Recording to file %s enabled."
+msgstr ""
+
+#: ../engine/zoom.c:1128
+msgid "Solid guessing 1"
+msgstr ""
+
+#: ../engine/btrace.c:292 ../engine/btrace.c:373
+msgid "Boundary trace"
+msgstr ""
+
+#: ../ui/dialog.c:312 ../ui/dialog.c:398 ../ui/dialog.c:1377
+#: ../ui/ui-drv/cocoa/CustomDialog.m:302
+msgid "OK"
+msgstr ""
+
+#: ../ui/dialog.c:313 ../ui/dialog.c:401 ../ui/dialog.c:1379
+#: ../ui/filesel.c:184 ../ui/ui-drv/cocoa/CustomDialog.m:312
+msgid "Cancel"
+msgstr ""
+
+#: ../ui-hlp/render.c:46
+#, c-format
+msgid "Error: %s"
+msgstr ""
+
+#: ../ui-hlp/render.c:121
+#, fuzzy
+msgid "Cannot open motion vector file!"
+msgstr "No se asignar tablas"
+
+#: ../ui-hlp/render.c:270
+#, c-format
+msgid "Vectors: %i"
+msgstr ""
+
+#: ../ui-hlp/render.c:276
+#, fuzzy
+msgid "Initializing"
+msgstr "Iteraciones"
+
+#: ../ui-hlp/render.c:284
+#, fuzzy
+msgid "Cannot create palette"
+msgstr "No se puede crear la paleta"
+
+#: ../ui-hlp/render.c:295
+#, fuzzy
+msgid "Cannot create image\n"
+msgstr "No se puede crear la imagen"
+
+#: ../ui-hlp/render.c:304
+#, fuzzy
+msgid "Cannot create checking buffer!"
+msgstr "No se puede crear la imagen"
+
+#: ../ui-hlp/render.c:313 ../ui-hlp/render.c:596
+#, fuzzy
+msgid "Cannot create context\n"
+msgstr "No se puede crear la paleta"
+
+#: ../ui-hlp/render.c:325
+#, fuzzy
+msgid "Cannot open animation file\n"
+msgstr "No se asignar tablas"
+
+#: ../ui-hlp/render.c:336 ../ui-hlp/render.c:605
+msgid "Loading catalogs"
+msgstr ""
+
+#: ../ui-hlp/render.c:366
+#, fuzzy
+msgid "Processing command line options"
+msgstr "Sólo pciones de la línea de instrucciones"
+
+#: ../ui-hlp/render.c:389
+#, fuzzy
+msgid "Enabling animation replay\n"
+msgstr "Usar sólo durante la animación"
+
+#: ../ui-hlp/render.c:396 ../ui-hlp/render.c:514
+#, fuzzy
+msgid "Cannot open image file"
+msgstr "No se asignar tablas"
+
+#: ../ui-hlp/render.c:410
+#, fuzzy
+msgid "Cannot open pattern file"
+msgstr "No se asignar tablas"
+
+#: ../ui-hlp/render.c:427 ../ui-hlp/render.c:429 ../ui-hlp/render.c:638
+msgid "Entering calculation loop!"
+msgstr ""
+
+#: ../ui-hlp/render.c:455
+#, c-format
+msgid "Frame %i skipped."
+msgstr ""
+
+#: ../ui-hlp/render.c:457
+#, c-format
+msgid "Frames %i - %i skipped."
+msgstr ""
+
+#: ../ui-hlp/render.c:461
+#, c-format
+msgid "Frame %4i: "
+msgstr ""
+
+#: ../ui-hlp/render.c:528
+msgid " done."
+msgstr ""
+
+#: ../ui-hlp/render.c:532
+msgid " skipping..."
+msgstr ""
+
+#: ../ui-hlp/render.c:565 ../ui-hlp/render.c:657
+#, fuzzy
+msgid "Calculation interrupted"
+msgstr "Interrumpir"
+
+#: ../ui-hlp/render.c:568 ../ui-hlp/render.c:570 ../ui-hlp/render.c:659
+#, fuzzy
+msgid "Calculation finished"
+msgstr "Cálculo"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1292 ../ui/ui-drv/cocoa/AppController.m:321
+msgid "Copy"
+msgstr ""
+
+#: ../ui/ui-drv/win32/ui_win32.c:1293 ../ui/ui-drv/cocoa/AppController.m:324
+#, fuzzy
+msgid "Paste"
+msgstr "Paleta"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1297
+msgid "About"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:197
+msgid "About XaoS"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:200
+msgid "Services"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:203
+msgid "Hide XaoS"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:206
+msgid "Hide Others"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:209
+msgid "Show All"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:212
+#, fuzzy
+msgid "Quit XaoS"
+msgstr "Salir"
+
+#: ../ui/ui-drv/cocoa/AppController.m:318
+msgid "Cut"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:327
+#, fuzzy
+msgid "Delete"
+msgstr "Paleta"
+
+#: ../ui/ui-drv/cocoa/AppController.m:330
+msgid "Select All"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:340
+msgid "Minimize"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:348
+msgid "Bring All to Front"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:359
+#, fuzzy
+msgid "Close"
+msgstr "Color"
+
+#: ../ui/ui-drv/cocoa/AppController.m:373
+msgid "Videator Output"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/CustomDialog.m:142
+msgid "Choose"
+msgstr ""
+
+#~ msgid "formulae"
+#~ msgstr "Formulae"
+
+#, fuzzy
+#~ msgid "Can not create context\n"
+#~ msgstr "No se puede crear la paleta"
diff --git a/src/i18n/fr.po b/src/i18n/fr.po
new file mode 100644
index 0000000..07eb24a
--- /dev/null
+++ b/src/i18n/fr.po
@@ -0,0 +1,1506 @@
+# XaoS NLS file for French language.
+# Copyright (C) 2002 Free Software Foundation, Inc.
+# Zoltan Kovacs <kovzol@math.u-szeged.hu>, 2002.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: XaoS 3.2\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-11-14 10:56+0100\n"
+"PO-Revision-Date: 2006-02-05 17:35+0200\n"
+"Last-Translator: Philippe Wautelet <traduc _at_ fractalzone _dot_ be>\n"
+"Language-Team: French\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: ../ui/ui.c:314
+msgid "XaoS is out of memory."
+msgstr "Pas assez de mémoire."
+
+#: ../ui/ui.c:360
+#, c-format
+msgid "%s %.2f times (%.1fE) %2.2f frames/sec %c %i %i %i %i "
+msgstr "%s %.2f fois (%.1fE) %2.2f images/sec %c %i %i %i %i "
+
+#: ../ui/ui.c:361
+msgid "unzoomed"
+msgstr "Réduit"
+
+#: ../ui/ui.c:361
+msgid "zoomed"
+msgstr "Aggrandi"
+
+#: ../ui/ui.c:369
+#, c-format
+msgid "framerate:%f\n"
+msgstr "taux de rafraîchissement : %f\n"
+
+#: ../ui/ui.c:409
+#, c-format
+msgid "Enabling: %s. "
+msgstr "Activation : %s. "
+
+#: ../ui/ui.c:411
+#, c-format
+msgid "Disabling: %s. "
+msgstr "Désactivation : %s. "
+
+#: ../ui/ui.c:441
+#, c-format
+msgid "Fractal name:%s"
+msgstr "Nom du fractal : %s"
+
+#: ../ui/ui.c:446
+#, c-format
+msgid "Fractal type:%s"
+msgstr "Type de fractal : %s"
+
+#: ../ui/ui.c:448
+msgid "Mandelbrot"
+msgstr "Mandelbrot"
+
+#: ../ui/ui.c:449
+msgid "Julia"
+msgstr "Julia"
+
+#: ../ui/ui.c:452
+#, fuzzy, c-format
+msgid "Formula:%s"
+msgstr "Formule :"
+
+#: ../ui/ui.c:457
+#, c-format
+msgid "View:[%1.12f,%1.12f]"
+msgstr "Vue : [%1.12f,%1.12f]"
+
+#: ../ui/ui.c:461
+#, c-format
+msgid "size:[%1.12f,%1.12f]"
+msgstr "Taille : [%1.12f,%1.12f]"
+
+#: ../ui/ui.c:465
+#, c-format
+msgid "Rotation:%4.2f Screen size:%i:%i"
+msgstr "Rotation : %4.2f Taille d'écran : %i:%i"
+
+#: ../ui/ui.c:470
+#, c-format
+msgid "Iterations:%-4i Palette size:%i"
+msgstr "Itérations : %-4i Taille palette : %i"
+
+#: ../ui/ui.c:477
+#, c-format
+msgid "Autopilot:%-4s Plane:%s"
+msgstr "Pilote automatique : %-4s Plan : %s"
+
+#: ../ui/ui.c:478
+msgid "On"
+msgstr "Oui"
+
+#: ../ui/ui.c:478
+msgid "Off"
+msgstr "Non"
+
+#: ../ui/ui.c:482
+#, c-format
+msgid "incoloring:%s outcoloring:%s"
+msgstr "Coloration intérieure : %s extérieure : %s"
+
+#: ../ui/ui.c:487
+#, c-format
+msgid "zoomspeed:%f"
+msgstr "Vitesse de zoom : %f"
+
+#: ../ui/ui.c:491
+msgid "Parameter:none"
+msgstr "Paramètre : aucun"
+
+#: ../ui/ui.c:493
+#, c-format
+msgid "Parameter:[%f,%f]"
+msgstr "Paramètre : [%f,%f]"
+
+#: ../ui/ui.c:585
+#, c-format
+msgid "Please wait while calculating %s"
+msgstr "Patientez pendant le calcul de %s"
+
+#: ../ui/ui.c:685
+#, c-format
+msgid "Letters per second %i "
+msgstr "Lettres par seconde %i "
+
+#: ../ui/ui.c:698 ../ui/ui.c:709
+#, c-format
+msgid "Rotation speed:%2.2f degrees per second "
+msgstr "Vitesse de rotation : %2.2f degrés par seconde"
+
+#: ../ui/ui.c:719
+#, fuzzy, c-format
+msgid "Iterations: %i "
+msgstr "Itérations: %i "
+
+#: ../ui/ui.c:735
+#, c-format
+msgid "Cycling speed: %i "
+msgstr "Vitesse de circulation : %i "
+
+#: ../ui/ui.c:748 ../ui/ui.c:762
+#, c-format
+msgid "speed:%2.2f "
+msgstr "vitesse : %2.2f"
+
+#: ../ui/ui.c:854
+#, c-format
+msgid "Thank you for using XaoS\n"
+msgstr "Merci d'avoir utilisé XaoS\n"
+
+#: ../ui/ui.c:891
+msgid "Skipping, please wait..."
+msgstr "Saute image, patientez..."
+
+#: ../ui/ui.c:983 ../ui/ui.c:985 ../ui/ui-drv/win32/ui_win32.c:1453
+msgid "Resize"
+msgstr "Redimensionner"
+
+#: ../ui/ui.c:998
+#, fuzzy
+msgid "Quit"
+msgstr "Quitter"
+
+#: ../ui/ui.c:999
+msgid "Exit now"
+msgstr "Sortir maintenant"
+
+#: ../ui/ui.c:1001
+msgid "Not yet"
+msgstr "Pas encore"
+
+#: ../ui/ui.c:1004 ../ui-hlp/menu.c:1055 ../ui-hlp/menu.c:1065
+#: ../ui/dialog.c:404 ../ui/dialog.c:1380
+msgid "Help"
+msgstr "Aide"
+
+#: ../ui/ui.c:1006
+msgid "Disable XaoS's builtin GUI"
+msgstr "Désactiver interface graphique interne de XaoS"
+
+#: ../ui/ui.c:1010 ../ui/ui.c:1016
+msgid "Status"
+msgstr "Affichage état"
+
+#: ../ui/ui.c:1012 ../ui/ui.c:1018
+msgid "Ministatus"
+msgstr "Affichage mini-état"
+
+#: ../ui/ui.c:1021 ../ui/ui.c:1022
+msgid "Driver"
+msgstr "Pilote"
+
+#: ../ui/ui.c:1413
+#, c-format
+msgid "Welcome to XaoS version %s"
+msgstr "Bienvenue sur XaoS version %s"
+
+#: ../ui/ui.c:1580
+msgid "Can not allocate buffers"
+msgstr "Ne peut pas allouer les tampons"
+
+#: ../ui/ui.c:1598
+msgid "Can not create palette"
+msgstr "Ne peut pas créer la palette"
+
+#: ../ui/ui.c:1610
+msgid "Can not create image"
+msgstr "Ne peut pas créer l'image"
+
+#: ../ui/ui.c:1641 ../ui/ui.c:1692
+msgid "Can not allocate tables"
+msgstr "Ne peut pas allouer les tables"
+
+#: ../ui/ui.c:1678
+msgid "Can not initialize driver"
+msgstr "Ne peut pas initialiser le pilote"
+
+#: ../ui/ui.c:1681
+msgid "Can not return back to previous driver"
+msgstr "Ne peut pas retourner au pilote précédent"
+
+#: ../ui-hlp/menu.c:129
+msgid "Perturbation:"
+msgstr "Perturbation :"
+
+#: ../ui-hlp/menu.c:133
+msgid "Julia-seed:"
+msgstr "Initialisation de l'ensemble de Julia :"
+
+#: ../ui-hlp/menu.c:137
+msgid "Morphing type:"
+msgstr "Type de morphing :"
+
+#: ../ui-hlp/menu.c:138
+msgid "Startuptime:"
+msgstr "Instant de démarrage :"
+
+#: ../ui-hlp/menu.c:139
+msgid "Stoptime:"
+msgstr "Instant d'arrêt :"
+
+#: ../ui-hlp/menu.c:143
+msgid "File to render:"
+msgstr "Fichier à traiter :"
+
+#: ../ui-hlp/menu.c:144
+msgid "Basename:"
+msgstr "Nom de base :"
+
+#: ../ui-hlp/menu.c:145
+msgid "Width:"
+msgstr "Largeur :"
+
+#: ../ui-hlp/menu.c:146
+msgid "Height:"
+msgstr "Hauteur :"
+
+#: ../ui-hlp/menu.c:147
+msgid "Real width (cm):"
+msgstr "Largeur réelle (cm) :"
+
+#: ../ui-hlp/menu.c:148
+msgid "Real height (cm):"
+msgstr "Hauteur réelle (cm) :"
+
+#: ../ui-hlp/menu.c:149
+msgid "Framerate:"
+msgstr "Taux de rafraîchissement :"
+
+#: ../ui-hlp/menu.c:150
+msgid "Image type:"
+msgstr "Type d'image :"
+
+#: ../ui-hlp/menu.c:151
+msgid "Antialiasing:"
+msgstr "Anti-crénelage :"
+
+#: ../ui-hlp/menu.c:152
+msgid "Always recalculate:"
+msgstr "Toujours recalculer :"
+
+#: ../ui-hlp/menu.c:153
+msgid "Calculate MPEG motion vectors:"
+msgstr "Calculer les vecteurs de mouvement MPEG :"
+
+#: ../ui-hlp/menu.c:154
+msgid "Recommended I frame distance:"
+msgstr "Distance conseillée entre les I-frames :"
+
+#: ../ui-hlp/menu.c:158
+msgid "Center:"
+msgstr "Centre :"
+
+#: ../ui-hlp/menu.c:159
+msgid "Radius:"
+msgstr "Rayon :"
+
+#: ../ui-hlp/menu.c:160 ../ui-hlp/menu.c:225
+msgid "Angle:"
+msgstr "Angle :"
+
+#: ../ui-hlp/menu.c:164
+msgid "Mode:"
+msgstr "Mode :"
+
+#: ../ui-hlp/menu.c:165
+msgid "Start:"
+msgstr "Début :"
+
+#: ../ui-hlp/menu.c:166
+msgid "End:"
+msgstr "Fin :"
+
+#: ../ui-hlp/menu.c:170
+msgid "Color:"
+msgstr "Couleur :"
+
+#: ../ui-hlp/menu.c:174
+msgid "Rotations per second:"
+msgstr "Rotations par seconde :"
+
+#: ../ui-hlp/menu.c:178
+msgid "Letters per second:"
+msgstr "Lettres par seconde :"
+
+#: ../ui-hlp/menu.c:182
+msgid "Iterations:"
+msgstr "Itérations :"
+
+#: ../ui-hlp/menu.c:186
+msgid "Text:"
+msgstr "Texte :"
+
+#: ../ui-hlp/menu.c:190
+msgid "Your command:"
+msgstr "Votre commande :"
+
+#: ../ui-hlp/menu.c:194 ../ui-hlp/menu.c:198 ../ui-hlp/menu.c:202
+#: ../ui-hlp/menu.c:206 ../ui-hlp/menu.c:258
+msgid "Filename:"
+msgstr "Nom de fichier :"
+
+#: ../ui-hlp/menu.c:210 ../ui-hlp/menu.c:298
+msgid "Formula:"
+msgstr "Formule :"
+
+#: ../ui-hlp/menu.c:214
+msgid "X center:"
+msgstr "Position horizontale centre :"
+
+#: ../ui-hlp/menu.c:215
+msgid "Y center:"
+msgstr "Position verticale centre :"
+
+#: ../ui-hlp/menu.c:216
+msgid "X Radius:"
+msgstr "Rayon horizontal :"
+
+#: ../ui-hlp/menu.c:217
+msgid "Y Radius:"
+msgstr "Rayon vertical :"
+
+#: ../ui-hlp/menu.c:221
+msgid "Coordinates:"
+msgstr "Coordonnées :"
+
+#: ../ui-hlp/menu.c:229
+msgid "continuous rotation"
+msgstr "rotation continue"
+
+#: ../ui-hlp/menu.c:233
+msgid "Fast rotation"
+msgstr "Rotation rapide"
+
+#: ../ui-hlp/menu.c:237
+msgid "filter"
+msgstr "filtre"
+
+#: ../ui-hlp/menu.c:238
+msgid "enable"
+msgstr "activer"
+
+#: ../ui-hlp/menu.c:242
+msgid "Amount:"
+msgstr "Quantité :"
+
+#: ../ui-hlp/menu.c:246
+msgid "Zooming speed:"
+msgstr "Vitesse de zoom :"
+
+#: ../ui-hlp/menu.c:250
+msgid "Name:"
+msgstr "Nom :"
+
+#: ../ui-hlp/menu.c:254
+msgid "Bailout:"
+msgstr "Valeur d'échappement :"
+
+#: ../ui-hlp/menu.c:262
+msgid "Julia mode:"
+msgstr "Mode Julia :"
+
+#: ../ui-hlp/menu.c:266
+msgid "Horizontal position:"
+msgstr "Position horizontale :"
+
+#: ../ui-hlp/menu.c:267
+msgid "Vertical position:"
+msgstr "Position verticale :"
+
+#: ../ui-hlp/menu.c:271
+msgid "Dynamic resolution:"
+msgstr "Résolution dynamique :"
+
+#: ../ui-hlp/menu.c:275
+msgid "Time:"
+msgstr "Heure :"
+
+#: ../ui-hlp/menu.c:279 ../ui-hlp/menu.c:283
+msgid "Number:"
+msgstr "Nombre :"
+
+#: ../ui-hlp/menu.c:287
+msgid "Algorithm number:"
+msgstr "Numéro d'algorithme :"
+
+#: ../ui-hlp/menu.c:288
+msgid "Seed:"
+msgstr "Valeur initiale :"
+
+#: ../ui-hlp/menu.c:289
+msgid "Shift:"
+msgstr "Décalage :"
+
+#: ../ui-hlp/menu.c:293
+msgid "Frames per second:"
+msgstr "Images par seconde"
+
+#: ../ui-hlp/menu.c:302
+#, fuzzy
+msgid "Initialization:"
+msgstr "Initialisation"
+
+#: ../ui-hlp/menu.c:357
+msgid "renderanim: Must specify a valid absolute path for basename"
+msgstr ""
+
+#: ../ui-hlp/menu.c:364
+msgid ""
+"renderanim: Width parameter must be positive integer in the range 0..4096"
+msgstr ""
+"animation : le paramètre de largeur doit être un entier positif allant de 0 "
+"à 4096"
+
+#: ../ui-hlp/menu.c:370
+msgid ""
+"renderanim: Height parameter must be positive integer in the range 0..4096"
+msgstr ""
+"animation : le paramètre de hauteur doit être un entier positif allant de 0 "
+"à 4096"
+
+#: ../ui-hlp/menu.c:376
+msgid "renderanim: Invalid real width and height dimensions"
+msgstr "animation : dimension de hauteur ou de largeur réelle incorrecte"
+
+#: ../ui-hlp/menu.c:380
+msgid "renderanim: invalid framerate"
+msgstr "animation : taux de rafraîchissement incorrect"
+
+#: ../ui-hlp/menu.c:386
+msgid "renderanim: antialiasing not supported in 256 color mode"
+msgstr "animation : anti-crénelage non supporté en mode 256 couleurs"
+
+#: ../ui-hlp/menu.c:390
+msgid "renderanim: incorrect I frame distance"
+msgstr "animation : distance entre I-frames incorrecte"
+
+#: ../ui-hlp/menu.c:441 ../ui-hlp/menu.c:454
+msgid "animateview: Invalid viewpoint"
+msgstr "animation : point de vue incorrect"
+
+#: ../ui-hlp/menu.c:467
+msgid "Invalid viewpoint"
+msgstr "Point de vue incorrect"
+
+#: ../ui-hlp/menu.c:696
+msgid "Unknown palette type"
+msgstr "Type de palette inconnu"
+
+#: ../ui-hlp/menu.c:771 ../ui-hlp/menu.c:785
+msgid "Initialization of color cycling failed."
+msgstr "Echec de l'initialisation de la circulation des couleurs."
+
+#: ../ui-hlp/menu.c:773 ../ui-hlp/menu.c:787
+msgid "Try to enable palette emulation filter"
+msgstr "Essayez d'activer le filtre d'émulation de palette"
+
+#: ../ui-hlp/menu.c:896
+#, c-format
+msgid "Algorithm:%i seed:%i size:%i"
+msgstr "Algorithme : %i valeur initiale : %i taille : %i"
+
+#: ../ui-hlp/menu.c:947
+msgid "Root menu"
+msgstr "Menu principal"
+
+#: ../ui-hlp/menu.c:948
+msgid "Animation root menu"
+msgstr "Menu principal d'animation"
+
+#: ../ui-hlp/menu.c:949
+msgid "Replay only commands"
+msgstr "Commandes de répétition uniquement"
+
+#: ../ui-hlp/menu.c:950
+msgid "Command line options only"
+msgstr "Options en ligne de commande uniquement"
+
+#: ../ui-hlp/menu.c:953
+msgid "print menus specifications of all menus"
+msgstr "imprimer les caractéristiques de menu pour tous les menus"
+
+#: ../ui-hlp/menu.c:958
+msgid "print menu specification"
+msgstr "imprimer les caractéristiques de menu"
+
+#: ../ui-hlp/menu.c:961
+msgid "print menu specification in xshl format"
+msgstr "imprimer les caractéristiques de menu au format xshl"
+
+#: ../ui-hlp/menu.c:965
+msgid "print all menu specifications in xshl format"
+msgstr "imprimer toutes les caractéristiques de menu au format xshl"
+
+#: ../ui-hlp/menu.c:967
+msgid "print dialog specification"
+msgstr "imprimer les caractéristiques de dialogue"
+
+#: ../ui-hlp/menu.c:972
+msgid "Line drawing functions"
+msgstr "Fonctions de traçage de lignes"
+
+#: ../ui-hlp/menu.c:973
+msgid "Line"
+msgstr "Ligne"
+
+#: ../ui-hlp/menu.c:976
+msgid "Morph line"
+msgstr "Ligne de morphing"
+
+#: ../ui-hlp/menu.c:978
+msgid "Morph last line"
+msgstr "Dernière ligne de morphing"
+
+#: ../ui-hlp/menu.c:981
+msgid "Set line key"
+msgstr "Choisir ligne clé"
+
+#: ../ui-hlp/menu.c:983
+msgid "Clear line"
+msgstr "Effacer ligne"
+
+#: ../ui-hlp/menu.c:986
+msgid "Clear all lines"
+msgstr "Effacer toutes les lignes"
+
+#: ../ui-hlp/menu.c:988
+msgid "Animation functions"
+msgstr "Fonctions d'animation"
+
+#: ../ui-hlp/menu.c:989 ../ui-hlp/menu.c:1181 ../ui-hlp/menu.c:1190
+msgid "View"
+msgstr "Vue"
+
+#: ../ui-hlp/menu.c:993
+msgid "Morph view"
+msgstr "Vue de morphing"
+
+#: ../ui-hlp/menu.c:995
+msgid "Morph julia"
+msgstr "Morphing de Julia"
+
+#: ../ui-hlp/menu.c:1000
+msgid "Move view"
+msgstr "Déplacer vue"
+
+#: ../ui-hlp/menu.c:1002
+msgid "Morph angle"
+msgstr "Angle de morphing"
+
+#: ../ui-hlp/menu.c:1004
+msgid "Zoom center"
+msgstr "Centrer le zoom"
+
+#: ../ui-hlp/menu.c:1006 ../ui/ui-drv/cocoa/AppController.m:343
+msgid "Zoom"
+msgstr "Zoomer"
+
+#: ../ui-hlp/menu.c:1007
+msgid "Un-zoom"
+msgstr "Dézoomer"
+
+#: ../ui-hlp/menu.c:1010
+msgid "Stop zooming"
+msgstr "Arrêter de zoomer"
+
+#: ../ui-hlp/menu.c:1011
+msgid "Smooth morphing parameters"
+msgstr "Lisser les paramètres de morphing"
+
+#: ../ui-hlp/menu.c:1014
+msgid "Timing functions"
+msgstr "Fonctions de temps"
+
+#: ../ui-hlp/menu.c:1015
+msgid "Usleep"
+msgstr "Pause"
+
+#: ../ui-hlp/menu.c:1018
+msgid "Wait for text"
+msgstr "Attendre le texte"
+
+#: ../ui-hlp/menu.c:1020
+msgid "Wait for complete image"
+msgstr "Attendre l'image complète"
+
+#: ../ui-hlp/menu.c:1022
+msgid "Include file"
+msgstr "Inclure fichier"
+
+#: ../ui-hlp/menu.c:1024 ../ui-hlp/menu.c:1222
+msgid "Default palette"
+msgstr "Palette par défaut"
+
+#: ../ui-hlp/menu.c:1026
+msgid "Formula"
+msgstr "Formule"
+
+#: ../ui-hlp/menu.c:1028
+msgid "Maximal zooming step"
+msgstr "Pas maximum pour le zoom"
+
+#: ../ui-hlp/menu.c:1030
+msgid "Zooming speedup"
+msgstr "Accélération du zoom"
+
+#: ../ui-hlp/menu.c:1032
+msgid "Filter"
+msgstr "Filtre"
+
+#: ../ui-hlp/menu.c:1036 ../ui-hlp/menu.c:1041
+msgid "Letters per second"
+msgstr "Lettres par seconde"
+
+#: ../ui-hlp/menu.c:1043 ../ui-hlp/menu.c:1314
+msgid "Interrupt"
+msgstr "Interrompt"
+
+#: ../ui-hlp/menu.c:1045 ../ui-hlp/menu.c:1057
+msgid "File"
+msgstr "Fichier"
+
+#: ../ui-hlp/menu.c:1046
+msgid "Edit"
+msgstr "Edition"
+
+#: ../ui-hlp/menu.c:1047
+msgid "Fractal"
+msgstr "Fractal"
+
+#: ../ui-hlp/menu.c:1048
+msgid "Calculation"
+msgstr "Calcul"
+
+#: ../ui-hlp/menu.c:1049 ../ui-hlp/menu.c:1391
+msgid "Filters"
+msgstr "Filtres"
+
+#: ../ui-hlp/menu.c:1050 ../ui-hlp/menu.c:1064
+msgid "UI"
+msgstr "Interface"
+
+#: ../ui-hlp/menu.c:1051
+msgid "Misc"
+msgstr "Divers"
+
+#: ../ui-hlp/menu.c:1053
+#, fuzzy
+msgid "Window"
+msgstr "Annuler"
+
+#: ../ui-hlp/menu.c:1056
+msgid "Tutorials"
+msgstr "Didacticiels"
+
+#: ../ui-hlp/menu.c:1062
+msgid "Stop replay"
+msgstr "Arrêter la répétition"
+
+#: ../ui-hlp/menu.c:1066
+msgid "Command"
+msgstr "Commande"
+
+#: ../ui-hlp/menu.c:1068
+msgid "Play string"
+msgstr "Joue texte"
+
+#: ../ui-hlp/menu.c:1070
+msgid "Render animation"
+msgstr "Traiter l'animation"
+
+#: ../ui-hlp/menu.c:1073
+msgid "Clear screen"
+msgstr "Effacer écran"
+
+#: ../ui-hlp/menu.c:1075
+msgid "Display fractal"
+msgstr "Afficher fractal"
+
+#: ../ui-hlp/menu.c:1078
+msgid "Display text"
+msgstr "Afficher texte"
+
+#: ../ui-hlp/menu.c:1080
+#, fuzzy
+msgid "Color"
+msgstr "Couleur :"
+
+#: ../ui-hlp/menu.c:1082
+msgid "Horizontal text position"
+msgstr "Position horizontale du texte"
+
+#: ../ui-hlp/menu.c:1084
+msgid "Vertical text position"
+msgstr "Position verticale du texte"
+
+#: ../ui-hlp/menu.c:1086
+msgid "Text position"
+msgstr "Position du texte"
+
+#: ../ui-hlp/menu.c:1090
+msgid "Message"
+msgstr "Message"
+
+#: ../ui-hlp/menu.c:1112
+msgid "Load"
+msgstr "Ouvrir"
+
+#: ../ui-hlp/menu.c:1115
+msgid "Save"
+msgstr "Enregistrer"
+
+#: ../ui-hlp/menu.c:1117
+msgid "Record"
+msgstr "Enregistrer animation"
+
+#: ../ui-hlp/menu.c:1121
+msgid "Replay"
+msgstr "Rejouer animation"
+
+#: ../ui-hlp/menu.c:1128
+msgid "Save image"
+msgstr "Entregistrer image"
+
+#: ../ui-hlp/menu.c:1130
+msgid "Load random example"
+msgstr "Ouvrir un exemple aléatoire"
+
+#: ../ui-hlp/menu.c:1132
+msgid "Save configuration"
+msgstr "Enregistrer la configuration"
+
+#: ../ui-hlp/menu.c:1137
+msgid "Undo"
+msgstr "Annuler"
+
+#: ../ui-hlp/menu.c:1141
+msgid "Redo"
+msgstr "Refaire"
+
+#: ../ui-hlp/menu.c:1145
+msgid "Formulae"
+msgstr "Formule"
+
+#: ../ui-hlp/menu.c:1146
+msgid "More formulae"
+msgstr "Autres formules"
+
+#: ../ui-hlp/menu.c:1151
+#, fuzzy
+msgid "User formula"
+msgstr "Autres formules"
+
+#: ../ui-hlp/menu.c:1153
+#, fuzzy
+msgid "User initialization"
+msgstr "Initialisation"
+
+#: ../ui-hlp/menu.c:1158
+msgid "Incoloring mode"
+msgstr "Coloriage intérieur"
+
+#: ../ui-hlp/menu.c:1159
+msgid "Outcoloring mode"
+msgstr "Coloriage extérieur"
+
+#: ../ui-hlp/menu.c:1160
+msgid "Plane"
+msgstr "Plan"
+
+#: ../ui-hlp/menu.c:1161
+#, fuzzy
+msgid "Palette"
+msgstr "Coller"
+
+#: ../ui-hlp/menu.c:1164
+msgid "Mandelbrot mode"
+msgstr "Mode Mandelbrot"
+
+#: ../ui-hlp/menu.c:1170 ../ui-hlp/menu.c:1174 ../ui-hlp/menu.c:1395
+msgid "Perturbation"
+msgstr "Perturbation"
+
+#: ../ui-hlp/menu.c:1185
+msgid "Reset to defaults"
+msgstr "Valeurs par défaut"
+
+#: ../ui-hlp/menu.c:1186
+msgid "Julia mode"
+msgstr "Mode Julia"
+
+#: ../ui-hlp/menu.c:1193
+msgid "Set angle"
+msgstr "Choisir l'angle"
+
+#: ../ui-hlp/menu.c:1197
+msgid "Set plane"
+msgstr "Choisir le plan"
+
+# #: ../ui-hlp/menu.c:1167
+#: ../ui-hlp/menu.c:1201
+msgid "Inside coloring mode"
+msgstr "Coloriage intérieur"
+
+#: ../ui-hlp/menu.c:1206
+msgid "Outside coloring mode"
+msgstr "Coloriage extérieur"
+
+#: ../ui-hlp/menu.c:1212
+msgid "Inside truecolor coloring mode"
+msgstr "Coloriage intérieur en vraies couleurs"
+
+#: ../ui-hlp/menu.c:1216
+msgid "Outside truecolor coloring mode"
+msgstr "Coloriage extérieur en vraies couleurs"
+
+#: ../ui-hlp/menu.c:1219
+msgid "Julia seed"
+msgstr "Initialisation de Julia"
+
+#: ../ui-hlp/menu.c:1224
+msgid "Random palette"
+msgstr "Palette aléatoire"
+
+#: ../ui-hlp/menu.c:1226
+msgid "Custom palette"
+msgstr "Palette personnelle"
+
+#: ../ui-hlp/menu.c:1230
+msgid "Color cycling"
+msgstr "Circulation des couleurs"
+
+#: ../ui-hlp/menu.c:1232
+msgid "Reversed color cycling"
+msgstr "Circulation des couleurs inversée"
+
+#: ../ui-hlp/menu.c:1237
+msgid "Color cycling speed"
+msgstr "Vitesse de circulation des couleurs"
+
+#: ../ui-hlp/menu.c:1241
+msgid "Shift palette"
+msgstr "Décaler palette"
+
+#: ../ui-hlp/menu.c:1243
+msgid "Shift one forward"
+msgstr "Avancer d'une unité"
+
+#: ../ui-hlp/menu.c:1246
+msgid "Shift one backward"
+msgstr "Reculer d'une unité"
+
+#: ../ui-hlp/menu.c:1248 ../engine/zoom.c:1357
+msgid "Solid guessing"
+msgstr "Estimation solide"
+
+#: ../ui-hlp/menu.c:1249
+msgid "Dynamic resolution"
+msgstr "Résolution dynamique"
+
+#: ../ui-hlp/menu.c:1251
+msgid "Periodicity checking"
+msgstr "Vérification périodicité"
+
+#: ../ui-hlp/menu.c:1254
+msgid "Iterations"
+msgstr "Itérations"
+
+#: ../ui-hlp/menu.c:1256
+msgid "Bailout"
+msgstr "Valeur d'échappement"
+
+#: ../ui-hlp/menu.c:1260
+msgid "Fast julia mode"
+msgstr "Mode Julia rapide"
+
+#: ../ui-hlp/menu.c:1262
+msgid "Rotation"
+msgstr "Rotation"
+
+#: ../ui-hlp/menu.c:1263
+msgid "Solid guessing range"
+msgstr "Portée de l'estimation solide"
+
+#: ../ui-hlp/menu.c:1266
+msgid "Disable rotation"
+msgstr "Désactiver rotation"
+
+#: ../ui-hlp/menu.c:1270
+msgid "Continuous rotation"
+msgstr "Rotation continue"
+
+#: ../ui-hlp/menu.c:1273
+msgid "Rotate by mouse"
+msgstr "Rotation à la souris"
+
+#: ../ui-hlp/menu.c:1277
+msgid "Rotation speed"
+msgstr "Vitesse de rotation"
+
+#: ../ui-hlp/menu.c:1280
+msgid "Automatic rotation"
+msgstr "Rotation automatique"
+
+#: ../ui-hlp/menu.c:1285
+msgid "Fast rotation mode"
+msgstr "Mode de rotation rapide"
+
+#: ../ui-hlp/menu.c:1289
+msgid "Disable dynamic resolution"
+msgstr "Désactiver la résolution dynamique"
+
+#: ../ui-hlp/menu.c:1292
+msgid "Use only during animation"
+msgstr "Utiliser seulement pendant l'animation"
+
+#: ../ui-hlp/menu.c:1296
+msgid "Use also for new images"
+msgstr "Utiliser aussi pour les nouvelles images"
+
+#: ../ui-hlp/menu.c:1298
+msgid "Dynamic resolution mode"
+msgstr "Mode de résolution dynamique"
+
+#: ../ui-hlp/menu.c:1302
+msgid "Autopilot"
+msgstr "Pilote automatique"
+
+#: ../ui-hlp/menu.c:1306
+#, fuzzy
+msgid "VJ mode"
+msgstr "Mode Julia"
+
+#: ../ui-hlp/menu.c:1310
+msgid "Recalculate"
+msgstr "Recalculer"
+
+#: ../ui-hlp/menu.c:1319
+msgid "Zooming speed"
+msgstr "Vitesse de zoom"
+
+#: ../ui-hlp/menu.c:1321
+msgid "Fixed step"
+msgstr "Pas fixé"
+
+#: ../ui-hlp/menu.c:1325
+msgid "Disable solid guessing"
+msgstr "Désactiver l'estimation solide"
+
+#: ../ui-hlp/menu.c:1329
+msgid "Guess 2x2 rectangles"
+msgstr "Estimation en rectangles 2x2"
+
+#: ../ui-hlp/menu.c:1331
+msgid "Guess 3x3 rectangles"
+msgstr "Estimation en rectangles 3x3"
+
+#: ../ui-hlp/menu.c:1335
+msgid "Guess 4x4 rectangles"
+msgstr "Estimation en rectangles 4x4"
+
+#: ../ui-hlp/menu.c:1337
+msgid "Guess 5x5 rectangles"
+msgstr "Estimation en rectangles 5x5"
+
+#: ../ui-hlp/menu.c:1341
+msgid "Guess 6x6 rectangles"
+msgstr "Estimation en rectangles 6x6"
+
+#: ../ui-hlp/menu.c:1343
+msgid "Guess 7x7 rectangles"
+msgstr "Estimation en rectangles 7x7"
+
+#: ../ui-hlp/menu.c:1347
+msgid "Guess 8x8 rectangles"
+msgstr "Estimation en rectangles 8x8"
+
+#: ../ui-hlp/menu.c:1349
+msgid "Guess unlimited rectangles"
+msgstr "Estimation en rectangles illimités"
+
+#: ../ui-hlp/menu.c:1354
+msgid "Language"
+msgstr "Langue"
+
+#: ../ui-hlp/menu.c:1357
+msgid "An introduction to fractals"
+msgstr "Une introduction aux fractals"
+
+#: ../ui-hlp/menu.c:1359
+msgid "XaoS features overview"
+msgstr "Revue des caractéristiques de XaoS"
+
+#: ../ui-hlp/menu.c:1361
+msgid "Math behind fractals"
+msgstr "Les maths derrière les fractals"
+
+#: ../ui-hlp/menu.c:1362 ../ui-hlp/menu.c:1403
+msgid "Other fractal types in XaoS"
+msgstr "Autres types de fractals dans XaoS"
+
+#: ../ui-hlp/menu.c:1364
+msgid "What's new?"
+msgstr "Nouveautés"
+
+#: ../ui-hlp/menu.c:1374 ../ui-hlp/menu.c:1398
+msgid "Whole story"
+msgstr "Tous les détails"
+
+#: ../ui-hlp/menu.c:1376
+msgid "Introduction"
+msgstr "Introduction"
+
+#: ../ui-hlp/menu.c:1377
+msgid "Mandelbrot set"
+msgstr "Ensemble de Mandelbrot"
+
+#: ../ui-hlp/menu.c:1378
+msgid "Julia set"
+msgstr "Ensemble de Julia"
+
+#: ../ui-hlp/menu.c:1379
+msgid "Higher power Mandelbrots"
+msgstr "Puissances de Mandlebrot"
+
+#: ../ui-hlp/menu.c:1380
+msgid "Newton's method"
+msgstr "Méthode de Newton"
+
+#: ../ui-hlp/menu.c:1381
+msgid "Barnsley's formula"
+msgstr "Formule de Barnsley"
+
+#: ../ui-hlp/menu.c:1382
+msgid "Phoenix"
+msgstr "Phoenix"
+
+#: ../ui-hlp/menu.c:1383
+msgid "Octo"
+msgstr "Octo"
+
+#: ../ui-hlp/menu.c:1384
+msgid "Magnet"
+msgstr "Magnet"
+
+#: ../ui-hlp/menu.c:1385
+msgid "All features"
+msgstr "Toutes les caractéristiques"
+
+#: ../ui-hlp/menu.c:1387
+msgid "Outcoloring modes"
+msgstr "Coloration extérieure"
+
+#: ../ui-hlp/menu.c:1388
+msgid "Incoloring modes"
+msgstr "Coloration intérieure"
+
+#: ../ui-hlp/menu.c:1389
+msgid "True-color coloring modes"
+msgstr "Coloration en vraies couleurs"
+
+#: ../ui-hlp/menu.c:1392
+msgid "Planes"
+msgstr "Plans"
+
+#: ../ui-hlp/menu.c:1393
+msgid "Animations and position files"
+msgstr "Fichiers d'animation et de position"
+
+#: ../ui-hlp/menu.c:1396
+msgid "Random palettes"
+msgstr "Palettes aléatoires"
+
+#: ../ui-hlp/menu.c:1397
+msgid "Other noteworthy features"
+msgstr "Autres caractéristiques utiles"
+
+#: ../ui-hlp/menu.c:1400
+msgid "The definition and fractal dimension"
+msgstr "Définition et dimension fractale"
+
+#: ../ui-hlp/menu.c:1402
+msgid "Escape time fractals"
+msgstr "Fractals à temps d'échappement"
+
+#: ../ui-hlp/menu.c:1406
+msgid "Triceratops and Catseye fractals"
+msgstr "Fractals Triceratops et Oeil de chat"
+
+#: ../ui-hlp/menu.c:1408
+msgid "Mandelbar, Lambda, Manowar and Spider"
+msgstr "Mandelbar, Lambda, Manowar et Araignée"
+
+#: ../ui-hlp/menu.c:1411
+msgid "Sierpinski Gasket, S.Carpet, Koch Snowflake"
+msgstr "Triangle de Sierpinski , Tapis de S., Flocon de Koch"
+
+#: ../ui-hlp/menu.c:1413
+msgid "What's new in 3.0?"
+msgstr "Nouveautés dans la version 3.0"
+
+#: ../ui-hlp/play.c:74
+msgid "line available only in animation replay"
+msgstr "ligne disponible seulement lors de répétition d'animation"
+
+#: ../ui-hlp/play.c:99
+msgid "Morphing non existing line!"
+msgstr "Ligne de morphing non existante!"
+
+#: ../ui-hlp/play.c:121
+msgid "linekey not available in this context!"
+msgstr "ligne clé non disponible dans ce contexte!"
+
+#: ../ui-hlp/play.c:291
+msgid "clear_line available only in animation replay"
+msgstr "effaçage de ligne disponible seulement lors de répétition d'animation"
+
+#: ../ui-hlp/play.c:300
+msgid "clear_lines available only in animation replay"
+msgstr "effaçage de lignes disponible seulement lors de répétition d'animation"
+
+#: ../ui-hlp/play.c:359
+msgid "Catalog file not found"
+msgstr "Fichier catalogue non trouvé"
+
+#: ../ui-hlp/play.c:405
+msgid "Replay is already active"
+msgstr "Répétition déja active"
+
+#: ../ui-hlp/play.c:409
+msgid "File open failed"
+msgstr "Echec d'ouverture du fichier"
+
+#: ../ui-hlp/play.c:414
+msgid "Out of memory"
+msgstr "Pas assez de mémoire"
+
+#: ../ui-hlp/play.c:526 ../ui-hlp/play.c:542 ../ui-hlp/play.c:566
+#: ../ui-hlp/play.c:595
+msgid "Missing parameter"
+msgstr "Paramètre manquant"
+
+#: ../ui-hlp/play.c:528 ../ui-hlp/play.c:544 ../ui-hlp/play.c:568
+#: ../ui-hlp/play.c:597
+msgid "Unexpected end of file"
+msgstr "Fin inattendue de fichier"
+
+#: ../ui-hlp/play.c:555 ../ui-hlp/play.c:574
+#, fuzzy
+msgid "Token is too long"
+msgstr "Le \"token\" est trop long"
+
+#: ../ui-hlp/play.c:629
+msgid "Unknown formula type"
+msgstr "Type de formule inconnu"
+
+#: ../ui-hlp/play.c:635
+#, fuzzy
+msgid "morph available only in animation replay"
+msgstr "Morphing disponible seulement lors de répétition d'animation"
+
+#: ../ui-hlp/play.c:639
+#, fuzzy
+msgid "morphview: Invalid viewpoint"
+msgstr "Vue morphing : point de vue incorrect"
+
+#: ../ui-hlp/play.c:653
+msgid "move available only in animation replay"
+msgstr "déplacement disponible seulement lors de répétition d'animation"
+
+#: ../ui-hlp/play.c:667
+#, fuzzy
+msgid "morphjulia available only in animation replay"
+msgstr "Morphjulia disponible seulement lors de répétition d'animation"
+
+#: ../ui-hlp/play.c:680
+#, fuzzy
+msgid "morphangle available only in animation replay"
+msgstr "Morphangle disponible seulement lors de répétition d'animation"
+
+#: ../ui-hlp/play.c:712
+msgid "Unknown filter"
+msgstr "Filtre inconnu"
+
+#: ../ui-hlp/play.c:753
+msgid "sleep available only in animation replay"
+msgstr "pause disponible seulement lors de répétition d'animation"
+
+#: ../ui-hlp/play.c:767
+#, c-format
+msgid "Internal program error #12 %i\n"
+msgstr "Erreur interne #12 %i\n"
+
+#: ../ui-hlp/play.c:788
+#, fuzzy
+msgid "wait available only in animation replay"
+msgstr "wait disponible seulement lors de répétition d'animation"
+
+#: ../ui-hlp/play.c:834
+msgid "No catalog file loaded"
+msgstr "Pas de fichier catalogue chargé"
+
+#: ../ui-hlp/play.c:839
+msgid "Message not found in catalog file"
+msgstr "Message non trouvé dans fichier catalogue"
+
+#: ../ui-hlp/play.c:850
+#, fuzzy
+msgid "load available only in animation replay"
+msgstr "Load disponible seulement lors de répétition d'animation"
+
+#: ../ui-hlp/play.c:854
+msgid "Include level overflow"
+msgstr "Dépassement de niveau d'inclusion"
+
+#: ../ui-hlp/play.c:863
+msgid "File not found"
+msgstr "Fichier non trouvé"
+
+#: ../ui-hlp/play.c:881
+msgid "Too many parameters"
+msgstr "Trop de paramètres"
+
+#: ../ui-hlp/play.c:916
+#, c-format
+msgid "Replay disabled at line %i"
+msgstr "Répétition désactivée à la ligne %i"
+
+#: ../ui-hlp/ui_helper.c:646
+msgid "Tutorial files not found. Reinstall XaoS"
+msgstr "Fichiers didacticiels introuvables. Réinstallez XaoS"
+
+#: ../ui-hlp/ui_helper.c:651
+msgid "Preparing first image"
+msgstr "Préparation première image"
+
+#: ../ui-hlp/ui_helper.c:661
+msgid "Could not open examples"
+msgstr "Echec ouverture exemples"
+
+#: ../ui-hlp/ui_helper.c:667
+#, c-format
+msgid "File %s loaded."
+msgstr "Fichier %s chargé."
+
+#: ../ui-hlp/ui_helper.c:676
+msgid "Saving image..."
+msgstr "Enregistrement image..."
+
+#: ../ui-hlp/ui_helper.c:684
+msgid "Save interrupted"
+msgstr "Enregistrement interrompu"
+
+#: ../ui-hlp/ui_helper.c:693 ../ui-hlp/ui_helper.c:710
+#: ../ui-hlp/ui_helper.c:777
+#, c-format
+msgid "File %s saved."
+msgstr "Fichier %s enregistré"
+
+#: ../ui-hlp/ui_helper.c:704
+msgid "Can not open file"
+msgstr "Echec ouverture fichier"
+
+#: ../ui-hlp/ui_helper.c:799
+#, c-format
+msgid "Recording to file %s enabled."
+msgstr "Enregistrement vers le fichier %s activé."
+
+#: ../engine/zoom.c:1128
+msgid "Solid guessing 1"
+msgstr "Estimation solide 1"
+
+#: ../engine/btrace.c:292 ../engine/btrace.c:373
+msgid "Boundary trace"
+msgstr "Détection de frontière"
+
+#: ../ui/dialog.c:312 ../ui/dialog.c:398 ../ui/dialog.c:1377
+#: ../ui/ui-drv/cocoa/CustomDialog.m:302
+msgid "OK"
+msgstr "OK"
+
+#: ../ui/dialog.c:313 ../ui/dialog.c:401 ../ui/dialog.c:1379
+#: ../ui/filesel.c:184 ../ui/ui-drv/cocoa/CustomDialog.m:312
+msgid "Cancel"
+msgstr "Annuler"
+
+#: ../ui-hlp/render.c:46
+#, c-format
+msgid "Error: %s"
+msgstr "Erreur : %s"
+
+#: ../ui-hlp/render.c:121
+msgid "Cannot open motion vector file!"
+msgstr "Echec ouverture fichier vecteurs mouvement"
+
+#: ../ui-hlp/render.c:270
+#, c-format
+msgid "Vectors: %i"
+msgstr "Vecteurs : %i"
+
+#: ../ui-hlp/render.c:276
+msgid "Initializing"
+msgstr "Initialisation"
+
+#: ../ui-hlp/render.c:284
+msgid "Cannot create palette"
+msgstr "Echec création palette"
+
+#: ../ui-hlp/render.c:295
+msgid "Cannot create image\n"
+msgstr "Echec création image\n"
+
+#: ../ui-hlp/render.c:304
+msgid "Cannot create checking buffer!"
+msgstr "Echec création tampon de vérification!"
+
+#: ../ui-hlp/render.c:313 ../ui-hlp/render.c:596
+msgid "Cannot create context\n"
+msgstr "Echec création contexte\n"
+
+#: ../ui-hlp/render.c:325
+msgid "Cannot open animation file\n"
+msgstr "Echec ouverture fichier d'animation\n"
+
+#: ../ui-hlp/render.c:336 ../ui-hlp/render.c:605
+msgid "Loading catalogs"
+msgstr "Chargement catalogues"
+
+#: ../ui-hlp/render.c:366
+msgid "Processing command line options"
+msgstr "Traitement options ligne de commande"
+
+#: ../ui-hlp/render.c:389
+msgid "Enabling animation replay\n"
+msgstr "Activation de la répétition d'animation\n"
+
+#: ../ui-hlp/render.c:396 ../ui-hlp/render.c:514
+msgid "Cannot open image file"
+msgstr "Echec ouverture fichier image"
+
+#: ../ui-hlp/render.c:410
+#, fuzzy
+msgid "Cannot open pattern file"
+msgstr "Echec ouverture fichier de motif"
+
+#: ../ui-hlp/render.c:427 ../ui-hlp/render.c:429 ../ui-hlp/render.c:638
+msgid "Entering calculation loop!"
+msgstr "Commençant boucle de calcul!"
+
+#: ../ui-hlp/render.c:455
+#, c-format
+msgid "Frame %i skipped."
+msgstr "Image %i sautée."
+
+#: ../ui-hlp/render.c:457
+#, c-format
+msgid "Frames %i - %i skipped."
+msgstr "Images %i - %i sautées."
+
+#: ../ui-hlp/render.c:461
+#, c-format
+msgid "Frame %4i: "
+msgstr "Image %4i : "
+
+#: ../ui-hlp/render.c:528
+msgid " done."
+msgstr " terminé."
+
+#: ../ui-hlp/render.c:532
+msgid " skipping..."
+msgstr " saute..."
+
+#: ../ui-hlp/render.c:565 ../ui-hlp/render.c:657
+msgid "Calculation interrupted"
+msgstr "Calcul interrompu"
+
+#: ../ui-hlp/render.c:568 ../ui-hlp/render.c:570 ../ui-hlp/render.c:659
+msgid "Calculation finished"
+msgstr "Calcul terminé"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1292 ../ui/ui-drv/cocoa/AppController.m:321
+msgid "Copy"
+msgstr "Copier"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1293 ../ui/ui-drv/cocoa/AppController.m:324
+msgid "Paste"
+msgstr "Coller"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1297
+msgid "About"
+msgstr "A propos"
+
+#: ../ui/ui-drv/cocoa/AppController.m:197
+#, fuzzy
+msgid "About XaoS"
+msgstr "A propos"
+
+#: ../ui/ui-drv/cocoa/AppController.m:200
+msgid "Services"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:203
+msgid "Hide XaoS"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:206
+msgid "Hide Others"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:209
+msgid "Show All"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:212
+#, fuzzy
+msgid "Quit XaoS"
+msgstr "Quitter"
+
+#: ../ui/ui-drv/cocoa/AppController.m:318
+msgid "Cut"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:327
+#, fuzzy
+msgid "Delete"
+msgstr "Palette"
+
+#: ../ui/ui-drv/cocoa/AppController.m:330
+msgid "Select All"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:340
+msgid "Minimize"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:348
+msgid "Bring All to Front"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:359
+#, fuzzy
+msgid "Close"
+msgstr "Couleur"
+
+#: ../ui/ui-drv/cocoa/AppController.m:373
+msgid "Videator Output"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/CustomDialog.m:142
+msgid "Choose"
+msgstr ""
+
+#, fuzzy
+#~ msgid "User function"
+#~ msgstr "Fonctions de traçage de lignes"
+
+#~ msgid "formulae"
+#~ msgstr "Formule"
diff --git a/src/i18n/hu.po b/src/i18n/hu.po
new file mode 100644
index 0000000..e10f6ad
--- /dev/null
+++ b/src/i18n/hu.po
@@ -0,0 +1,1477 @@
+# XaoS NLS file for Hungarian language.
+# Copyright (C) 2002 Free Software Foundation, Inc.
+# Zoltan Kovacs <kovzol@math.u-szeged.hu>, 2002, 2008.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: XaoS 3.2\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-11-14 10:56+0100\n"
+"PO-Revision-Date: 2002-08-17 21:44+0200\n"
+"Last-Translator: Zoltan Kovacs <kovzol@math.u-szeged.hu>\n"
+"Language-Team: Hungarian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-2\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: ../ui/ui.c:314
+msgid "XaoS is out of memory."
+msgstr "Elfogyott a memória."
+
+#: ../ui/ui.c:360
+#, c-format
+msgid "%s %.2f times (%.1fE) %2.2f frames/sec %c %i %i %i %i "
+msgstr "%s %.2f-szoros (%.1fE) %2.2f kép/mp %c %i %i %i %i "
+
+#: ../ui/ui.c:361
+msgid "unzoomed"
+msgstr "kicsinyítés"
+
+#: ../ui/ui.c:361
+msgid "zoomed"
+msgstr "nagyítás"
+
+#: ../ui/ui.c:369
+#, c-format
+msgid "framerate:%f\n"
+msgstr "képfrissítés:%f\n"
+
+#: ../ui/ui.c:409
+#, c-format
+msgid "Enabling: %s. "
+msgstr "%s bekapcsolva."
+
+#: ../ui/ui.c:411
+#, c-format
+msgid "Disabling: %s. "
+msgstr "%s kikapcsolva."
+
+#: ../ui/ui.c:441
+#, c-format
+msgid "Fractal name:%s"
+msgstr "Fraktál neve:%s"
+
+#: ../ui/ui.c:446
+#, c-format
+msgid "Fractal type:%s"
+msgstr "Fraktál típusa:%s"
+
+#: ../ui/ui.c:448
+msgid "Mandelbrot"
+msgstr "Mandelbrot"
+
+#: ../ui/ui.c:449
+msgid "Julia"
+msgstr "Julia"
+
+#: ../ui/ui.c:452
+#, c-format
+msgid "Formula:%s"
+msgstr "Képlet:%s"
+
+#: ../ui/ui.c:457
+#, c-format
+msgid "View:[%1.12f,%1.12f]"
+msgstr "Nézet:[%1.12f,%1.12f]"
+
+#: ../ui/ui.c:461
+#, c-format
+msgid "size:[%1.12f,%1.12f]"
+msgstr "Méret:[%1.12fx%1.12f]"
+
+#: ../ui/ui.c:465
+#, c-format
+msgid "Rotation:%4.2f Screen size:%i:%i"
+msgstr "Forgatás:%4.2f Képernyõméret:%i:%i"
+
+#: ../ui/ui.c:470
+#, c-format
+msgid "Iterations:%-4i Palette size:%i"
+msgstr "Iterációk száma:%-4i Színpaletta-méret:%i"
+
+#: ../ui/ui.c:477
+#, c-format
+msgid "Autopilot:%-4s Plane:%s"
+msgstr "Robotpilóta:%-4s Sík:%s"
+
+#: ../ui/ui.c:478
+msgid "On"
+msgstr "be"
+
+#: ../ui/ui.c:478
+msgid "Off"
+msgstr "ki"
+
+#: ../ui/ui.c:482
+#, c-format
+msgid "incoloring:%s outcoloring:%s"
+msgstr "belsõ színezés:%s külsõ színezés:%s"
+
+#: ../ui/ui.c:487
+#, c-format
+msgid "zoomspeed:%f"
+msgstr "nagyítási sebesség:%f"
+
+#: ../ui/ui.c:491
+msgid "Parameter:none"
+msgstr "Paraméter:nincs"
+
+#: ../ui/ui.c:493
+#, c-format
+msgid "Parameter:[%f,%f]"
+msgstr "Paraméter:[%f,%f]"
+
+#: ../ui/ui.c:585
+#, c-format
+msgid "Please wait while calculating %s"
+msgstr "Kérem várjon, a %s fraktál elõállítása folyamatban..."
+
+#: ../ui/ui.c:685
+#, c-format
+msgid "Letters per second %i "
+msgstr "Másodpercenként %i betû"
+
+#: ../ui/ui.c:698 ../ui/ui.c:709
+#, c-format
+msgid "Rotation speed:%2.2f degrees per second "
+msgstr "Forgatási sebesség:%2.2f fok másodpercenként "
+
+#: ../ui/ui.c:719
+#, c-format
+msgid "Iterations: %i "
+msgstr "Iterációk száma: %i "
+
+#: ../ui/ui.c:735
+#, c-format
+msgid "Cycling speed: %i "
+msgstr "Színforgatási sebesség: %i "
+
+#: ../ui/ui.c:748 ../ui/ui.c:762
+#, c-format
+msgid "speed:%2.2f "
+msgstr "sebesség:%2.2f "
+
+#: ../ui/ui.c:854
+#, c-format
+msgid "Thank you for using XaoS\n"
+msgstr "Köszönjük, hogy a XaoS programot használta!\n"
+
+#: ../ui/ui.c:891
+msgid "Skipping, please wait..."
+msgstr "Továbblépés, kérem várjon..."
+
+#: ../ui/ui.c:983 ../ui/ui.c:985 ../ui/ui-drv/win32/ui_win32.c:1453
+msgid "Resize"
+msgstr "Átméretez"
+
+#: ../ui/ui.c:998
+msgid "Quit"
+msgstr "Kilépés"
+
+#: ../ui/ui.c:999
+msgid "Exit now"
+msgstr "Azonnali kilépés"
+
+#: ../ui/ui.c:1001
+msgid "Not yet"
+msgstr "Inkább még ne"
+
+#: ../ui/ui.c:1004 ../ui-hlp/menu.c:1055 ../ui-hlp/menu.c:1065
+#: ../ui/dialog.c:404 ../ui/dialog.c:1380
+msgid "Help"
+msgstr "Segítség"
+
+#: ../ui/ui.c:1006
+msgid "Disable XaoS's builtin GUI"
+msgstr "A bépített felület kikapcsolása"
+
+#: ../ui/ui.c:1010 ../ui/ui.c:1016
+msgid "Status"
+msgstr "Jellemzõk"
+
+#: ../ui/ui.c:1012 ../ui/ui.c:1018
+msgid "Ministatus"
+msgstr "Fõbb jellemzõk"
+
+#: ../ui/ui.c:1021 ../ui/ui.c:1022
+msgid "Driver"
+msgstr "Grafikus meghajtó"
+
+#: ../ui/ui.c:1413
+#, c-format
+msgid "Welcome to XaoS version %s"
+msgstr "Köszöntjük a XaoS %s verziójában!"
+
+#: ../ui/ui.c:1580
+msgid "Can not allocate buffers"
+msgstr "Nincs elegendõ puffer"
+
+#: ../ui/ui.c:1598
+msgid "Can not create palette"
+msgstr "A színpaletta nem hozható létre"
+
+#: ../ui/ui.c:1610
+msgid "Can not create image"
+msgstr "A kép nem hozható létre"
+
+#: ../ui/ui.c:1641 ../ui/ui.c:1692
+msgid "Can not allocate tables"
+msgstr "Nincs hely a tábláknak"
+
+#: ../ui/ui.c:1678
+msgid "Can not initialize driver"
+msgstr "A grafikus meghajtó nem inicializálható"
+
+#: ../ui/ui.c:1681
+msgid "Can not return back to previous driver"
+msgstr "Az elõzõ grafikus meghajtó nem tölthetõ be"
+
+#: ../ui-hlp/menu.c:129
+msgid "Perturbation:"
+msgstr "Perturbáció:"
+
+#: ../ui-hlp/menu.c:133
+msgid "Julia-seed:"
+msgstr "Julia-mag:"
+
+#: ../ui-hlp/menu.c:137
+msgid "Morphing type:"
+msgstr "Átalakítás típusa:"
+
+#: ../ui-hlp/menu.c:138
+msgid "Startuptime:"
+msgstr "Indítási idõ:"
+
+#: ../ui-hlp/menu.c:139
+msgid "Stoptime:"
+msgstr "Leállítási idõ:"
+
+#: ../ui-hlp/menu.c:143
+msgid "File to render:"
+msgstr "Feldolgozandó fájl:"
+
+#: ../ui-hlp/menu.c:144
+msgid "Basename:"
+msgstr "Bázisnév:"
+
+#: ../ui-hlp/menu.c:145
+msgid "Width:"
+msgstr "Szélesség:"
+
+#: ../ui-hlp/menu.c:146
+msgid "Height:"
+msgstr "Magasság:"
+
+#: ../ui-hlp/menu.c:147
+msgid "Real width (cm):"
+msgstr "Valódi szélesség (cm):"
+
+#: ../ui-hlp/menu.c:148
+msgid "Real height (cm):"
+msgstr "Valódi magasság (cm):"
+
+#: ../ui-hlp/menu.c:149
+msgid "Framerate:"
+msgstr "Képfrissítés:"
+
+#: ../ui-hlp/menu.c:150
+msgid "Image type:"
+msgstr "Kép típusa:"
+
+#: ../ui-hlp/menu.c:151
+msgid "Antialiasing:"
+msgstr "Élsimítás:"
+
+#: ../ui-hlp/menu.c:152
+msgid "Always recalculate:"
+msgstr "Mindig újraszámolás:"
+
+#: ../ui-hlp/menu.c:153
+msgid "Calculate MPEG motion vectors:"
+msgstr "MPEG mozgásvektorok számítása:"
+
+#: ../ui-hlp/menu.c:154
+msgid "Recommended I frame distance:"
+msgstr "Javasolt I képkocka-távolság:"
+
+#: ../ui-hlp/menu.c:158
+msgid "Center:"
+msgstr "Középpont:"
+
+#: ../ui-hlp/menu.c:159
+msgid "Radius:"
+msgstr "Sugár:"
+
+#: ../ui-hlp/menu.c:160 ../ui-hlp/menu.c:225
+msgid "Angle:"
+msgstr "Szög:"
+
+#: ../ui-hlp/menu.c:164
+msgid "Mode:"
+msgstr "Mód:"
+
+#: ../ui-hlp/menu.c:165
+msgid "Start:"
+msgstr "Kezdet:"
+
+#: ../ui-hlp/menu.c:166
+msgid "End:"
+msgstr "Vég:"
+
+#: ../ui-hlp/menu.c:170
+msgid "Color:"
+msgstr "Szín:"
+
+#: ../ui-hlp/menu.c:174
+msgid "Rotations per second:"
+msgstr "Forgatások száma másodpercenként:"
+
+#: ../ui-hlp/menu.c:178
+msgid "Letters per second:"
+msgstr "Másodpercenkénti betûszám:"
+
+#: ../ui-hlp/menu.c:182
+msgid "Iterations:"
+msgstr "Iterációk:"
+
+#: ../ui-hlp/menu.c:186
+msgid "Text:"
+msgstr "Szöveg:"
+
+#: ../ui-hlp/menu.c:190
+msgid "Your command:"
+msgstr "Parancs:"
+
+#: ../ui-hlp/menu.c:194 ../ui-hlp/menu.c:198 ../ui-hlp/menu.c:202
+#: ../ui-hlp/menu.c:206 ../ui-hlp/menu.c:258
+msgid "Filename:"
+msgstr "Fájlnév:"
+
+#: ../ui-hlp/menu.c:210 ../ui-hlp/menu.c:298
+msgid "Formula:"
+msgstr "Képlet:"
+
+#: ../ui-hlp/menu.c:214
+msgid "X center:"
+msgstr "X középpont:"
+
+#: ../ui-hlp/menu.c:215
+msgid "Y center:"
+msgstr "Y középpont:"
+
+#: ../ui-hlp/menu.c:216
+msgid "X Radius:"
+msgstr "X sugár:"
+
+#: ../ui-hlp/menu.c:217
+msgid "Y Radius:"
+msgstr "Y sugár:"
+
+#: ../ui-hlp/menu.c:221
+msgid "Coordinates:"
+msgstr "Koordináták:"
+
+#: ../ui-hlp/menu.c:229
+msgid "continuous rotation"
+msgstr "folyamatos forgatás"
+
+#: ../ui-hlp/menu.c:233
+msgid "Fast rotation"
+msgstr "Gyors forgatás"
+
+#: ../ui-hlp/menu.c:237
+msgid "filter"
+msgstr "szûrõ"
+
+#: ../ui-hlp/menu.c:238
+msgid "enable"
+msgstr "bekapcsolva"
+
+#: ../ui-hlp/menu.c:242
+msgid "Amount:"
+msgstr "Mennyiség:"
+
+#: ../ui-hlp/menu.c:246
+msgid "Zooming speed:"
+msgstr "Belenagyítás gyorsasága:"
+
+#: ../ui-hlp/menu.c:250
+msgid "Name:"
+msgstr "Név:"
+
+#: ../ui-hlp/menu.c:254
+msgid "Bailout:"
+msgstr "Kilépés:"
+
+#: ../ui-hlp/menu.c:262
+msgid "Julia mode:"
+msgstr "Julia-mód:"
+
+#: ../ui-hlp/menu.c:266
+msgid "Horizontal position:"
+msgstr "Vízszintes pozíció:"
+
+#: ../ui-hlp/menu.c:267
+msgid "Vertical position:"
+msgstr "Függõleges pozíció:"
+
+#: ../ui-hlp/menu.c:271
+msgid "Dynamic resolution:"
+msgstr "Dinamikus felbontás:"
+
+#: ../ui-hlp/menu.c:275
+msgid "Time:"
+msgstr "Idõ:"
+
+#: ../ui-hlp/menu.c:279 ../ui-hlp/menu.c:283
+msgid "Number:"
+msgstr "Szám:"
+
+#: ../ui-hlp/menu.c:287
+msgid "Algorithm number:"
+msgstr "Algoritmus száma:"
+
+#: ../ui-hlp/menu.c:288
+msgid "Seed:"
+msgstr "Mag:"
+
+#: ../ui-hlp/menu.c:289
+msgid "Shift:"
+msgstr "Eltolás:"
+
+#: ../ui-hlp/menu.c:293
+msgid "Frames per second:"
+msgstr "Másodpercenkénti képkockaszám:"
+
+#: ../ui-hlp/menu.c:302
+msgid "Initialization:"
+msgstr "Alapérték:"
+
+#: ../ui-hlp/menu.c:357
+msgid "renderanim: Must specify a valid absolute path for basename"
+msgstr ""
+
+#: ../ui-hlp/menu.c:364
+msgid ""
+"renderanim: Width parameter must be positive integer in the range 0..4096"
+msgstr ""
+
+#: ../ui-hlp/menu.c:370
+msgid ""
+"renderanim: Height parameter must be positive integer in the range 0..4096"
+msgstr ""
+
+#: ../ui-hlp/menu.c:376
+msgid "renderanim: Invalid real width and height dimensions"
+msgstr ""
+
+#: ../ui-hlp/menu.c:380
+msgid "renderanim: invalid framerate"
+msgstr "renderanim: hibás képkocka-ráta"
+
+#: ../ui-hlp/menu.c:386
+msgid "renderanim: antialiasing not supported in 256 color mode"
+msgstr ""
+
+#: ../ui-hlp/menu.c:390
+msgid "renderanim: incorrect I frame distance"
+msgstr "renderanim: hibás I képkocka-távolság:"
+
+#: ../ui-hlp/menu.c:441 ../ui-hlp/menu.c:454
+msgid "animateview: Invalid viewpoint"
+msgstr "animateview: Érvénytelen nézõpont"
+
+#: ../ui-hlp/menu.c:467
+msgid "Invalid viewpoint"
+msgstr "Érvénytelen nézõpont"
+
+#: ../ui-hlp/menu.c:696
+msgid "Unknown palette type"
+msgstr "Ismeretlen paletta típus"
+
+#: ../ui-hlp/menu.c:771 ../ui-hlp/menu.c:785
+msgid "Initialization of color cycling failed."
+msgstr "A színforgatás nem inicializálható."
+
+#: ../ui-hlp/menu.c:773 ../ui-hlp/menu.c:787
+msgid "Try to enable palette emulation filter"
+msgstr "Próbáld bekapcsolni a paletta emulációs szûrõt"
+
+#: ../ui-hlp/menu.c:896
+#, c-format
+msgid "Algorithm:%i seed:%i size:%i"
+msgstr "Algoritmus:%i mag:%i méret:%i"
+
+#: ../ui-hlp/menu.c:947
+msgid "Root menu"
+msgstr "Fõmenü"
+
+#: ../ui-hlp/menu.c:948
+msgid "Animation root menu"
+msgstr "Animáció fõmenü"
+
+#: ../ui-hlp/menu.c:949
+msgid "Replay only commands"
+msgstr "Csak visszajátszó parancsok"
+
+#: ../ui-hlp/menu.c:950
+msgid "Command line options only"
+msgstr "Csak parancssori opciók"
+
+#: ../ui-hlp/menu.c:953
+msgid "print menus specifications of all menus"
+msgstr "minden menü specifikációjának kiírása"
+
+#: ../ui-hlp/menu.c:958
+msgid "print menu specification"
+msgstr "a menü specifikáció kiírása"
+
+#: ../ui-hlp/menu.c:961
+msgid "print menu specification in xshl format"
+msgstr ""
+
+#: ../ui-hlp/menu.c:965
+msgid "print all menu specifications in xshl format"
+msgstr ""
+
+#: ../ui-hlp/menu.c:967
+msgid "print dialog specification"
+msgstr ""
+
+#: ../ui-hlp/menu.c:972
+msgid "Line drawing functions"
+msgstr "Vonalrajzoló függvények"
+
+#: ../ui-hlp/menu.c:973
+msgid "Line"
+msgstr "Vonal"
+
+#: ../ui-hlp/menu.c:976
+msgid "Morph line"
+msgstr "Átalakuló vonal"
+
+#: ../ui-hlp/menu.c:978
+msgid "Morph last line"
+msgstr "Az utolsó vonal átalakítása"
+
+#: ../ui-hlp/menu.c:981
+msgid "Set line key"
+msgstr "Vonalkulcs beállítása"
+
+#: ../ui-hlp/menu.c:983
+msgid "Clear line"
+msgstr "Vonal törlése"
+
+#: ../ui-hlp/menu.c:986
+msgid "Clear all lines"
+msgstr "Minden vonal törlése"
+
+#: ../ui-hlp/menu.c:988
+msgid "Animation functions"
+msgstr "Animáció"
+
+#: ../ui-hlp/menu.c:989 ../ui-hlp/menu.c:1181 ../ui-hlp/menu.c:1190
+msgid "View"
+msgstr "Nézet"
+
+#: ../ui-hlp/menu.c:993
+msgid "Morph view"
+msgstr ""
+
+#: ../ui-hlp/menu.c:995
+msgid "Morph julia"
+msgstr ""
+
+#: ../ui-hlp/menu.c:1000
+msgid "Move view"
+msgstr ""
+
+#: ../ui-hlp/menu.c:1002
+msgid "Morph angle"
+msgstr ""
+
+#: ../ui-hlp/menu.c:1004
+msgid "Zoom center"
+msgstr "Nagyítási centrum"
+
+#: ../ui-hlp/menu.c:1006 ../ui/ui-drv/cocoa/AppController.m:343
+msgid "Zoom"
+msgstr "Nagyítás"
+
+#: ../ui-hlp/menu.c:1007
+msgid "Un-zoom"
+msgstr "Kicsinyítés"
+
+#: ../ui-hlp/menu.c:1010
+msgid "Stop zooming"
+msgstr "Belenagyítás leállítása"
+
+#: ../ui-hlp/menu.c:1011
+msgid "Smooth morphing parameters"
+msgstr "Simítási paraméterek"
+
+#: ../ui-hlp/menu.c:1014
+msgid "Timing functions"
+msgstr "Idõzítés"
+
+#: ../ui-hlp/menu.c:1015
+msgid "Usleep"
+msgstr "Várakozás"
+
+#: ../ui-hlp/menu.c:1018
+msgid "Wait for text"
+msgstr "Szövegre várakozás"
+
+#: ../ui-hlp/menu.c:1020
+msgid "Wait for complete image"
+msgstr "A kép kirajzolása folyamatban"
+
+#: ../ui-hlp/menu.c:1022
+msgid "Include file"
+msgstr "Fájl befûzése"
+
+#: ../ui-hlp/menu.c:1024 ../ui-hlp/menu.c:1222
+msgid "Default palette"
+msgstr "Alapértelmezett színek"
+
+#: ../ui-hlp/menu.c:1026
+msgid "Formula"
+msgstr "Képlet"
+
+#: ../ui-hlp/menu.c:1028
+msgid "Maximal zooming step"
+msgstr "Maximális nagyítási lépték"
+
+#: ../ui-hlp/menu.c:1030
+msgid "Zooming speedup"
+msgstr "Belenagyítás gyorsasága"
+
+#: ../ui-hlp/menu.c:1032
+msgid "Filter"
+msgstr "Szûrõ"
+
+#: ../ui-hlp/menu.c:1036 ../ui-hlp/menu.c:1041
+msgid "Letters per second"
+msgstr "Másodpercenkénti betûszám"
+
+#: ../ui-hlp/menu.c:1043 ../ui-hlp/menu.c:1314
+msgid "Interrupt"
+msgstr "Megszakítás"
+
+#: ../ui-hlp/menu.c:1045 ../ui-hlp/menu.c:1057
+msgid "File"
+msgstr "Fájl"
+
+#: ../ui-hlp/menu.c:1046
+msgid "Edit"
+msgstr "Szerkesztés"
+
+#: ../ui-hlp/menu.c:1047
+msgid "Fractal"
+msgstr "Fraktál"
+
+#: ../ui-hlp/menu.c:1048
+msgid "Calculation"
+msgstr "Számítás"
+
+#: ../ui-hlp/menu.c:1049 ../ui-hlp/menu.c:1391
+msgid "Filters"
+msgstr "Szûrõk"
+
+#: ../ui-hlp/menu.c:1050 ../ui-hlp/menu.c:1064
+msgid "UI"
+msgstr "Kezelõfelület"
+
+#: ../ui-hlp/menu.c:1051
+msgid "Misc"
+msgstr "Egyéb"
+
+#: ../ui-hlp/menu.c:1053
+msgid "Window"
+msgstr "Ablak"
+
+#: ../ui-hlp/menu.c:1056
+msgid "Tutorials"
+msgstr "Útmutatók"
+
+#: ../ui-hlp/menu.c:1062
+msgid "Stop replay"
+msgstr "Visszajátszás leállítása"
+
+#: ../ui-hlp/menu.c:1066
+msgid "Command"
+msgstr "Parancs"
+
+#: ../ui-hlp/menu.c:1068
+msgid "Play string"
+msgstr "Karakterlánc lejátszása"
+
+#: ../ui-hlp/menu.c:1070
+msgid "Render animation"
+msgstr "Film készítése"
+
+#: ../ui-hlp/menu.c:1073
+msgid "Clear screen"
+msgstr "Képernyõtörlés"
+
+#: ../ui-hlp/menu.c:1075
+msgid "Display fractal"
+msgstr "Fraktál megjelenítése"
+
+#: ../ui-hlp/menu.c:1078
+msgid "Display text"
+msgstr "Szöveg megjelenítése"
+
+#: ../ui-hlp/menu.c:1080
+msgid "Color"
+msgstr "Szín"
+
+#: ../ui-hlp/menu.c:1082
+msgid "Horizontal text position"
+msgstr "Szöveg vízszintes pozíciója"
+
+#: ../ui-hlp/menu.c:1084
+msgid "Vertical text position"
+msgstr "Szöveg függõleges pozíciója"
+
+#: ../ui-hlp/menu.c:1086
+msgid "Text position"
+msgstr "Szöveg pozíciója"
+
+#: ../ui-hlp/menu.c:1090
+msgid "Message"
+msgstr "Felirat"
+
+#: ../ui-hlp/menu.c:1112
+msgid "Load"
+msgstr "Megnyitás"
+
+#: ../ui-hlp/menu.c:1115
+msgid "Save"
+msgstr "Mentés"
+
+#: ../ui-hlp/menu.c:1117
+msgid "Record"
+msgstr "Felvétel"
+
+#: ../ui-hlp/menu.c:1121
+msgid "Replay"
+msgstr "Visszajátszás"
+
+#: ../ui-hlp/menu.c:1128
+msgid "Save image"
+msgstr "Kép mentése"
+
+#: ../ui-hlp/menu.c:1130
+msgid "Load random example"
+msgstr "Egy mintapélda betöltése"
+
+#: ../ui-hlp/menu.c:1132
+msgid "Save configuration"
+msgstr "Beállítások mentése"
+
+#: ../ui-hlp/menu.c:1137
+msgid "Undo"
+msgstr "Mégse"
+
+#: ../ui-hlp/menu.c:1141
+msgid "Redo"
+msgstr "Mégis"
+
+#: ../ui-hlp/menu.c:1145
+msgid "Formulae"
+msgstr "Képlet"
+
+#: ../ui-hlp/menu.c:1146
+msgid "More formulae"
+msgstr "További képletek"
+
+#: ../ui-hlp/menu.c:1151
+msgid "User formula"
+msgstr "Egyedi képlet"
+
+#: ../ui-hlp/menu.c:1153
+msgid "User initialization"
+msgstr "Egyedi képlet alapérték"
+
+#: ../ui-hlp/menu.c:1158
+msgid "Incoloring mode"
+msgstr "Belsõ színezési mód"
+
+#: ../ui-hlp/menu.c:1159
+msgid "Outcoloring mode"
+msgstr "Külsõ színezési mód"
+
+#: ../ui-hlp/menu.c:1160
+msgid "Plane"
+msgstr "Sík"
+
+#: ../ui-hlp/menu.c:1161
+msgid "Palette"
+msgstr "Paletta"
+
+#: ../ui-hlp/menu.c:1164
+msgid "Mandelbrot mode"
+msgstr "Mandelbrot-mód"
+
+#: ../ui-hlp/menu.c:1170 ../ui-hlp/menu.c:1174 ../ui-hlp/menu.c:1395
+msgid "Perturbation"
+msgstr "Perturbáció"
+
+#: ../ui-hlp/menu.c:1185
+msgid "Reset to defaults"
+msgstr "Alapértékek visszaállítása"
+
+#: ../ui-hlp/menu.c:1186
+msgid "Julia mode"
+msgstr "Julia-mód"
+
+#: ../ui-hlp/menu.c:1193
+msgid "Set angle"
+msgstr "Szög beállítása"
+
+#: ../ui-hlp/menu.c:1197
+msgid "Set plane"
+msgstr "Sík beállítása"
+
+#: ../ui-hlp/menu.c:1201
+msgid "Inside coloring mode"
+msgstr "Belsõ színezési módok"
+
+#: ../ui-hlp/menu.c:1206
+msgid "Outside coloring mode"
+msgstr "Külsõ színezési módok"
+
+#: ../ui-hlp/menu.c:1212
+msgid "Inside truecolor coloring mode"
+msgstr "Belsõ truecolor színezési mód"
+
+#: ../ui-hlp/menu.c:1216
+msgid "Outside truecolor coloring mode"
+msgstr "Külsõ truecolor színezési mód"
+
+#: ../ui-hlp/menu.c:1219
+msgid "Julia seed"
+msgstr "Julia-sebesség"
+
+#: ../ui-hlp/menu.c:1224
+msgid "Random palette"
+msgstr "Véletlen színek"
+
+#: ../ui-hlp/menu.c:1226
+msgid "Custom palette"
+msgstr "Felhasználói színek"
+
+#: ../ui-hlp/menu.c:1230
+msgid "Color cycling"
+msgstr "Színforgatás"
+
+#: ../ui-hlp/menu.c:1232
+msgid "Reversed color cycling"
+msgstr "Színforgatás visszafelé"
+
+#: ../ui-hlp/menu.c:1237
+msgid "Color cycling speed"
+msgstr "Színforgatási sebesség"
+
+#: ../ui-hlp/menu.c:1241
+msgid "Shift palette"
+msgstr "Színpaletta eltolása"
+
+#: ../ui-hlp/menu.c:1243
+msgid "Shift one forward"
+msgstr "Eggyel elõreléptetés"
+
+#: ../ui-hlp/menu.c:1246
+msgid "Shift one backward"
+msgstr "Eggyel visszaléptetés"
+
+#: ../ui-hlp/menu.c:1248 ../engine/zoom.c:1357
+msgid "Solid guessing"
+msgstr "Egyszerû találgatás"
+
+#: ../ui-hlp/menu.c:1249
+msgid "Dynamic resolution"
+msgstr "Dinamikus felbontás"
+
+#: ../ui-hlp/menu.c:1251
+msgid "Periodicity checking"
+msgstr "Periodicitás vizsgálata"
+
+#: ../ui-hlp/menu.c:1254
+msgid "Iterations"
+msgstr "Iterációk"
+
+#: ../ui-hlp/menu.c:1256
+msgid "Bailout"
+msgstr "Kilépés"
+
+#: ../ui-hlp/menu.c:1260
+msgid "Fast julia mode"
+msgstr "Gyors Julia-mód"
+
+#: ../ui-hlp/menu.c:1262
+msgid "Rotation"
+msgstr "Forgatás"
+
+#: ../ui-hlp/menu.c:1263
+msgid "Solid guessing range"
+msgstr "Találgatási intervallum"
+
+#: ../ui-hlp/menu.c:1266
+msgid "Disable rotation"
+msgstr "Forgatás kikapcsolva"
+
+#: ../ui-hlp/menu.c:1270
+msgid "Continuous rotation"
+msgstr "Folyamatos forgatás"
+
+#: ../ui-hlp/menu.c:1273
+msgid "Rotate by mouse"
+msgstr "Forgatás egérrel"
+
+#: ../ui-hlp/menu.c:1277
+msgid "Rotation speed"
+msgstr "Forgatás gyorsasága"
+
+#: ../ui-hlp/menu.c:1280
+msgid "Automatic rotation"
+msgstr "Automatikus forgatás"
+
+#: ../ui-hlp/menu.c:1285
+msgid "Fast rotation mode"
+msgstr "Gyors forgatási mód"
+
+#: ../ui-hlp/menu.c:1289
+msgid "Disable dynamic resolution"
+msgstr "Dinamikus felbontás kikapcsolva"
+
+#: ../ui-hlp/menu.c:1292
+msgid "Use only during animation"
+msgstr "Csak az animáció alatt"
+
+#: ../ui-hlp/menu.c:1296
+msgid "Use also for new images"
+msgstr "Új képeknél is így legyen"
+
+#: ../ui-hlp/menu.c:1298
+msgid "Dynamic resolution mode"
+msgstr "Dinamikus felbontási mód"
+
+#: ../ui-hlp/menu.c:1302
+msgid "Autopilot"
+msgstr "Robotpilóta"
+
+#: ../ui-hlp/menu.c:1306
+msgid "VJ mode"
+msgstr "VJ mód"
+
+#: ../ui-hlp/menu.c:1310
+msgid "Recalculate"
+msgstr "Számítás"
+
+#: ../ui-hlp/menu.c:1319
+msgid "Zooming speed"
+msgstr "Belenagyítás gyorsasága"
+
+#: ../ui-hlp/menu.c:1321
+msgid "Fixed step"
+msgstr "Rögzített lépték"
+
+#: ../ui-hlp/menu.c:1325
+msgid "Disable solid guessing"
+msgstr "Egyszerû találgatás kikapcsolva"
+
+#: ../ui-hlp/menu.c:1329
+msgid "Guess 2x2 rectangles"
+msgstr "2x2 téglalap"
+
+#: ../ui-hlp/menu.c:1331
+msgid "Guess 3x3 rectangles"
+msgstr "3x3 téglalap"
+
+#: ../ui-hlp/menu.c:1335
+msgid "Guess 4x4 rectangles"
+msgstr "4x4 téglalap"
+
+#: ../ui-hlp/menu.c:1337
+msgid "Guess 5x5 rectangles"
+msgstr "5x5 téglalap"
+
+#: ../ui-hlp/menu.c:1341
+msgid "Guess 6x6 rectangles"
+msgstr "6x6 téglalap"
+
+#: ../ui-hlp/menu.c:1343
+msgid "Guess 7x7 rectangles"
+msgstr "7x7 téglalap"
+
+#: ../ui-hlp/menu.c:1347
+msgid "Guess 8x8 rectangles"
+msgstr "8x8 téglalap"
+
+#: ../ui-hlp/menu.c:1349
+msgid "Guess unlimited rectangles"
+msgstr "Korlátlan téglalapszám"
+
+#: ../ui-hlp/menu.c:1354
+msgid "Language"
+msgstr "Nyelv"
+
+#: ../ui-hlp/menu.c:1357
+msgid "An introduction to fractals"
+msgstr "Bevezetés a fraktálok világába"
+
+#: ../ui-hlp/menu.c:1359
+msgid "XaoS features overview"
+msgstr "Tippek és trükkök"
+
+#: ../ui-hlp/menu.c:1361
+msgid "Math behind fractals"
+msgstr "A fraktálok matematikája"
+
+#: ../ui-hlp/menu.c:1362 ../ui-hlp/menu.c:1403
+msgid "Other fractal types in XaoS"
+msgstr "A XaoS további fraktáltípusai"
+
+#: ../ui-hlp/menu.c:1364
+msgid "What's new?"
+msgstr "Újdonságok"
+
+#: ../ui-hlp/menu.c:1374 ../ui-hlp/menu.c:1398
+msgid "Whole story"
+msgstr "Minden fejezet"
+
+#: ../ui-hlp/menu.c:1376
+msgid "Introduction"
+msgstr "Bevezetés"
+
+#: ../ui-hlp/menu.c:1377
+msgid "Mandelbrot set"
+msgstr "Mandelbrot-halmaz"
+
+#: ../ui-hlp/menu.c:1378
+msgid "Julia set"
+msgstr "Julia-halmaz"
+
+#: ../ui-hlp/menu.c:1379
+msgid "Higher power Mandelbrots"
+msgstr "Magasabb rendû Mandelbrotok"
+
+#: ../ui-hlp/menu.c:1380
+msgid "Newton's method"
+msgstr "Newton eljárása"
+
+#: ../ui-hlp/menu.c:1381
+msgid "Barnsley's formula"
+msgstr "A Barnsley-formula"
+
+#: ../ui-hlp/menu.c:1382
+msgid "Phoenix"
+msgstr "Fõnix"
+
+#: ../ui-hlp/menu.c:1383
+msgid "Octo"
+msgstr "Octo"
+
+#: ../ui-hlp/menu.c:1384
+msgid "Magnet"
+msgstr "Mágnes"
+
+#: ../ui-hlp/menu.c:1385
+msgid "All features"
+msgstr "Az összes jellemzõ"
+
+#: ../ui-hlp/menu.c:1387
+msgid "Outcoloring modes"
+msgstr "Külsõ színezési módok"
+
+#: ../ui-hlp/menu.c:1388
+msgid "Incoloring modes"
+msgstr "Belsõ színezési módok"
+
+#: ../ui-hlp/menu.c:1389
+msgid "True-color coloring modes"
+msgstr "True-color színezési módok"
+
+#: ../ui-hlp/menu.c:1392
+msgid "Planes"
+msgstr "Síkok"
+
+#: ../ui-hlp/menu.c:1393
+msgid "Animations and position files"
+msgstr "Animációk és pozíciófájlok"
+
+#: ../ui-hlp/menu.c:1396
+msgid "Random palettes"
+msgstr "Véletlen színpaletták"
+
+#: ../ui-hlp/menu.c:1397
+msgid "Other noteworthy features"
+msgstr "További apróságok"
+
+#: ../ui-hlp/menu.c:1400
+msgid "The definition and fractal dimension"
+msgstr "Definíció és fraktáldimenzió"
+
+#: ../ui-hlp/menu.c:1402
+msgid "Escape time fractals"
+msgstr "Szökési idõn alapuló fraktálok"
+
+#: ../ui-hlp/menu.c:1406
+msgid "Triceratops and Catseye fractals"
+msgstr "A Triceratops és a Catseye fraktálok"
+
+#: ../ui-hlp/menu.c:1408
+msgid "Mandelbar, Lambda, Manowar and Spider"
+msgstr "Mandelbar, Lambda, Manowar és Spider"
+
+#: ../ui-hlp/menu.c:1411
+msgid "Sierpinski Gasket, S.Carpet, Koch Snowflake"
+msgstr "Sierpinski-háromszög, -szõnyeg, Koch-hópehely"
+
+#: ../ui-hlp/menu.c:1413
+msgid "What's new in 3.0?"
+msgstr "Újdonságok a 3.0-s verzióban"
+
+#: ../ui-hlp/play.c:74
+msgid "line available only in animation replay"
+msgstr "a \"line\" csak animáció visszajátszásakor használható"
+
+#: ../ui-hlp/play.c:99
+msgid "Morphing non existing line!"
+msgstr "Nem létezõ vonal nem alakítható!"
+
+#: ../ui-hlp/play.c:121
+msgid "linekey not available in this context!"
+msgstr ""
+
+#: ../ui-hlp/play.c:291
+msgid "clear_line available only in animation replay"
+msgstr "a \"clear_line\" csak animáció visszajátszásakor használható"
+
+#: ../ui-hlp/play.c:300
+msgid "clear_lines available only in animation replay"
+msgstr "a \"clear_lines\" csak animáció visszajátszásakor használható"
+
+#: ../ui-hlp/play.c:359
+msgid "Catalog file not found"
+msgstr "A katalógus fájl nem található"
+
+#: ../ui-hlp/play.c:405
+msgid "Replay is already active"
+msgstr "A visszajátszás már aktív"
+
+#: ../ui-hlp/play.c:409
+msgid "File open failed"
+msgstr "Sikertelen fájl megnyitás"
+
+#: ../ui-hlp/play.c:414
+msgid "Out of memory"
+msgstr "Elfogyott a memória"
+
+#: ../ui-hlp/play.c:526 ../ui-hlp/play.c:542 ../ui-hlp/play.c:566
+#: ../ui-hlp/play.c:595
+msgid "Missing parameter"
+msgstr "Hiányzó paraméter"
+
+#: ../ui-hlp/play.c:528 ../ui-hlp/play.c:544 ../ui-hlp/play.c:568
+#: ../ui-hlp/play.c:597
+msgid "Unexpected end of file"
+msgstr "A fájl nincs lezárva"
+
+#: ../ui-hlp/play.c:555 ../ui-hlp/play.c:574
+msgid "Token is too long"
+msgstr "Túl hosszú kulcsszó"
+
+#: ../ui-hlp/play.c:629
+msgid "Unknown formula type"
+msgstr "Ismeretlen képlettípus"
+
+#: ../ui-hlp/play.c:635
+msgid "morph available only in animation replay"
+msgstr "a \"morph\" csak animáció visszajátszásakor használható"
+
+#: ../ui-hlp/play.c:639
+msgid "morphview: Invalid viewpoint"
+msgstr "morphview: Érvénytelen nézõpont"
+
+#: ../ui-hlp/play.c:653
+msgid "move available only in animation replay"
+msgstr "a \"move\" csak animáció visszajátszásakor használható"
+
+#: ../ui-hlp/play.c:667
+msgid "morphjulia available only in animation replay"
+msgstr "a \"morphjulia\" csak animáció visszajátszásakor használható"
+
+#: ../ui-hlp/play.c:680
+msgid "morphangle available only in animation replay"
+msgstr "a \"morphangle\" csak animáció visszajátszásakor használható"
+
+#: ../ui-hlp/play.c:712
+msgid "Unknown filter"
+msgstr "Ismeretlen szûrõ"
+
+#: ../ui-hlp/play.c:753
+msgid "sleep available only in animation replay"
+msgstr "a \"sleep\" csak animáció visszajátszásakor használható"
+
+#: ../ui-hlp/play.c:767
+#, c-format
+msgid "Internal program error #12 %i\n"
+msgstr "12-es számú belsõ hiba %i\n"
+
+#: ../ui-hlp/play.c:788
+#, fuzzy
+msgid "wait available only in animation replay"
+msgstr "a \"sleep\" csak animáció visszajátszásakor használható"
+
+#: ../ui-hlp/play.c:834
+msgid "No catalog file loaded"
+msgstr "Nincs betöltött katalógus fájl"
+
+#: ../ui-hlp/play.c:839
+msgid "Message not found in catalog file"
+msgstr "A katalógus fájlban hiányzik a szöveg"
+
+#: ../ui-hlp/play.c:850
+#, fuzzy
+msgid "load available only in animation replay"
+msgstr "a \"sleep\" csak animáció visszajátszásakor használható"
+
+#: ../ui-hlp/play.c:854
+msgid "Include level overflow"
+msgstr ""
+
+#: ../ui-hlp/play.c:863
+msgid "File not found"
+msgstr "Hiányzó fájl"
+
+#: ../ui-hlp/play.c:881
+msgid "Too many parameters"
+msgstr "Túl sok paraméter"
+
+#: ../ui-hlp/play.c:916
+#, c-format
+msgid "Replay disabled at line %i"
+msgstr "A lejátszás a(z) %i sorszámú sornál megszakadt"
+
+#: ../ui-hlp/ui_helper.c:646
+msgid "Tutorial files not found. Reinstall XaoS"
+msgstr ""
+"A tankönyv fájlok nem találhatók. A XaoS programot újra kell telepíteni"
+
+#: ../ui-hlp/ui_helper.c:651
+msgid "Preparing first image"
+msgstr "Az elsõ kép elkészítése"
+
+#: ../ui-hlp/ui_helper.c:661
+msgid "Could not open examples"
+msgstr "A példák nem nyithatók meg"
+
+#: ../ui-hlp/ui_helper.c:667
+#, c-format
+msgid "File %s loaded."
+msgstr "A(z) %s fájl betöltõdött."
+
+#: ../ui-hlp/ui_helper.c:676
+msgid "Saving image..."
+msgstr "Kép mentése..."
+
+#: ../ui-hlp/ui_helper.c:684
+msgid "Save interrupted"
+msgstr "A mentés félbeszakadt"
+
+#: ../ui-hlp/ui_helper.c:693 ../ui-hlp/ui_helper.c:710
+#: ../ui-hlp/ui_helper.c:777
+#, c-format
+msgid "File %s saved."
+msgstr "A(z) %s fájl elmentve."
+
+#: ../ui-hlp/ui_helper.c:704
+msgid "Can not open file"
+msgstr "A fájl nem nyitható meg"
+
+#: ../ui-hlp/ui_helper.c:799
+#, c-format
+msgid "Recording to file %s enabled."
+msgstr "A(z) %s fájlba történõ felvétel elindítva."
+
+#: ../engine/zoom.c:1128
+msgid "Solid guessing 1"
+msgstr "Egyszerû találgatás 1"
+
+#: ../engine/btrace.c:292 ../engine/btrace.c:373
+msgid "Boundary trace"
+msgstr "Határkövetés"
+
+#: ../ui/dialog.c:312 ../ui/dialog.c:398 ../ui/dialog.c:1377
+#: ../ui/ui-drv/cocoa/CustomDialog.m:302
+msgid "OK"
+msgstr ""
+
+#: ../ui/dialog.c:313 ../ui/dialog.c:401 ../ui/dialog.c:1379
+#: ../ui/filesel.c:184 ../ui/ui-drv/cocoa/CustomDialog.m:312
+msgid "Cancel"
+msgstr "Mégsem"
+
+#: ../ui-hlp/render.c:46
+#, c-format
+msgid "Error: %s"
+msgstr "Hiba: %s"
+
+#: ../ui-hlp/render.c:121
+msgid "Cannot open motion vector file!"
+msgstr "A mozgásvektor fájl nem nyitható meg!"
+
+#: ../ui-hlp/render.c:270
+#, c-format
+msgid "Vectors: %i"
+msgstr "Vektorok: %i"
+
+#: ../ui-hlp/render.c:276
+msgid "Initializing"
+msgstr "Inicializálás"
+
+#: ../ui-hlp/render.c:284
+msgid "Cannot create palette"
+msgstr "A színpaletta nem hozható létre"
+
+#: ../ui-hlp/render.c:295
+msgid "Cannot create image\n"
+msgstr "A kép nem hozható létre\n"
+
+#: ../ui-hlp/render.c:304
+msgid "Cannot create checking buffer!"
+msgstr "Az ellenõrzõ puffer nem hozható létre!"
+
+#: ../ui-hlp/render.c:313 ../ui-hlp/render.c:596
+msgid "Cannot create context\n"
+msgstr "A kontextus nem hozható létre\n"
+
+#: ../ui-hlp/render.c:325
+msgid "Cannot open animation file\n"
+msgstr "Az animációs fájl nem nyitható meg\n"
+
+#: ../ui-hlp/render.c:336 ../ui-hlp/render.c:605
+msgid "Loading catalogs"
+msgstr "Filmfájlok szövegeinek betöltése"
+
+#: ../ui-hlp/render.c:366
+msgid "Processing command line options"
+msgstr "Parancssori opciók feldolgozása"
+
+#: ../ui-hlp/render.c:389
+msgid "Enabling animation replay\n"
+msgstr "Animáció-visszajátszás bekapcsolva\n"
+
+#: ../ui-hlp/render.c:396 ../ui-hlp/render.c:514
+msgid "Cannot open image file"
+msgstr "A képfájl nem nyitható meg"
+
+#: ../ui-hlp/render.c:410
+msgid "Cannot open pattern file"
+msgstr "A mintát tartalmazó fájl nem nyitható meg"
+
+#: ../ui-hlp/render.c:427 ../ui-hlp/render.c:429 ../ui-hlp/render.c:638
+msgid "Entering calculation loop!"
+msgstr "A számítási ciklus kezdete!"
+
+#: ../ui-hlp/render.c:455
+#, c-format
+msgid "Frame %i skipped."
+msgstr "A(z) %i. képkocka kihagyva."
+
+#: ../ui-hlp/render.c:457
+#, c-format
+msgid "Frames %i - %i skipped."
+msgstr "A(z) %i-%i. képkockák kihagyva."
+
+#: ../ui-hlp/render.c:461
+#, c-format
+msgid "Frame %4i: "
+msgstr "%4i. képkocka: "
+
+#: ../ui-hlp/render.c:528
+msgid " done."
+msgstr " kész."
+
+#: ../ui-hlp/render.c:532
+msgid " skipping..."
+msgstr " kihagyva..."
+
+#: ../ui-hlp/render.c:565 ../ui-hlp/render.c:657
+msgid "Calculation interrupted"
+msgstr "A számítás félbeszakadt"
+
+#: ../ui-hlp/render.c:568 ../ui-hlp/render.c:570 ../ui-hlp/render.c:659
+msgid "Calculation finished"
+msgstr "A számítás véget ért"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1292 ../ui/ui-drv/cocoa/AppController.m:321
+msgid "Copy"
+msgstr "Másol"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1293 ../ui/ui-drv/cocoa/AppController.m:324
+msgid "Paste"
+msgstr "Beilleszt"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1297
+msgid "About"
+msgstr "Névjegy"
+
+#: ../ui/ui-drv/cocoa/AppController.m:197
+msgid "About XaoS"
+msgstr "A XaoS névjegye"
+
+#: ../ui/ui-drv/cocoa/AppController.m:200
+msgid "Services"
+msgstr "Szolgáltatások"
+
+#: ../ui/ui-drv/cocoa/AppController.m:203
+msgid "Hide XaoS"
+msgstr "A XaoS elrejtése"
+
+#: ../ui/ui-drv/cocoa/AppController.m:206
+msgid "Hide Others"
+msgstr "A többi elrejtése"
+
+#: ../ui/ui-drv/cocoa/AppController.m:209
+msgid "Show All"
+msgstr "Mindent mutat"
+
+#: ../ui/ui-drv/cocoa/AppController.m:212
+msgid "Quit XaoS"
+msgstr "Kilépés a XaoS-ból"
+
+#: ../ui/ui-drv/cocoa/AppController.m:318
+msgid "Cut"
+msgstr "Kivágás"
+
+#: ../ui/ui-drv/cocoa/AppController.m:327
+msgid "Delete"
+msgstr "Törlés"
+
+#: ../ui/ui-drv/cocoa/AppController.m:330
+msgid "Select All"
+msgstr "Mindent kijelöl"
+
+#: ../ui/ui-drv/cocoa/AppController.m:340
+msgid "Minimize"
+msgstr "Minimalizálás"
+
+#: ../ui/ui-drv/cocoa/AppController.m:348
+msgid "Bring All to Front"
+msgstr "Mindent felülre"
+
+#: ../ui/ui-drv/cocoa/AppController.m:359
+msgid "Close"
+msgstr "Bezár"
+
+#: ../ui/ui-drv/cocoa/AppController.m:373
+msgid "Videator Output"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/CustomDialog.m:142
+msgid "Choose"
+msgstr "Kiválaszt"
diff --git a/src/i18n/it.po b/src/i18n/it.po
new file mode 100644
index 0000000..6322334
--- /dev/null
+++ b/src/i18n/it.po
@@ -0,0 +1,1483 @@
+# Italian translation for xaos
+# Copyright (c) 2007 Rosetta Contributors and Canonical Ltd 2007
+# This file is distributed under the same license as the xaos package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2007.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: xaos\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-11-14 10:56+0100\n"
+"PO-Revision-Date: 2008-04-08 10:10+0000\n"
+"Last-Translator: Sergio Zanchetta <Unknown>\n"
+"Language-Team: Italian <it@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2008-04-08 15:44+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#: ../ui/ui.c:314
+msgid "XaoS is out of memory."
+msgstr "XaoS ha esaurito la memoria."
+
+#: ../ui/ui.c:360
+#, c-format
+msgid "%s %.2f times (%.1fE) %2.2f frames/sec %c %i %i %i %i "
+msgstr "%s %.2f volte (%.1fE) %2.2f fotogrammi/sec %c %i %i %i %i "
+
+#: ../ui/ui.c:361
+msgid "unzoomed"
+msgstr "rimpicciolito"
+
+#: ../ui/ui.c:361
+msgid "zoomed"
+msgstr "ingrandito"
+
+#: ../ui/ui.c:369
+#, c-format
+msgid "framerate:%f\n"
+msgstr "frequenza fotogrammi:%f\n"
+
+#: ../ui/ui.c:409
+#, c-format
+msgid "Enabling: %s. "
+msgstr "Abilitazione: %s. "
+
+#: ../ui/ui.c:411
+#, c-format
+msgid "Disabling: %s. "
+msgstr "Disabilitazione: %s "
+
+#: ../ui/ui.c:441
+#, c-format
+msgid "Fractal name:%s"
+msgstr "Nome del frattale:%s"
+
+#: ../ui/ui.c:446
+#, c-format
+msgid "Fractal type:%s"
+msgstr "Tipo di frattale:%s"
+
+#: ../ui/ui.c:448
+msgid "Mandelbrot"
+msgstr "Mandelbrot"
+
+#: ../ui/ui.c:449
+msgid "Julia"
+msgstr "Julia"
+
+#: ../ui/ui.c:452
+#, c-format
+msgid "Formula:%s"
+msgstr "Formula:%s"
+
+#: ../ui/ui.c:457
+#, c-format
+msgid "View:[%1.12f,%1.12f]"
+msgstr "Vista:[%1.12f,%1.12f]"
+
+#: ../ui/ui.c:461
+#, c-format
+msgid "size:[%1.12f,%1.12f]"
+msgstr "dimensione:[%1.12f,%1.12f]"
+
+#: ../ui/ui.c:465
+#, c-format
+msgid "Rotation:%4.2f Screen size:%i:%i"
+msgstr "Rotazione:%4.2f Dimensione schermo:%i:%i"
+
+#: ../ui/ui.c:470
+#, c-format
+msgid "Iterations:%-4i Palette size:%i"
+msgstr "Iterazioni:%-4i Dimensione tavolozza:%i"
+
+#: ../ui/ui.c:477
+#, c-format
+msgid "Autopilot:%-4s Plane:%s"
+msgstr "Pilota automatico:%-4s Piano:%s"
+
+#: ../ui/ui.c:478
+msgid "On"
+msgstr "Attivo"
+
+#: ../ui/ui.c:478
+msgid "Off"
+msgstr "Disattivo"
+
+#: ../ui/ui.c:482
+#, c-format
+msgid "incoloring:%s outcoloring:%s"
+msgstr "colorazione interna:%s colorazione esterna:%s"
+
+#: ../ui/ui.c:487
+#, c-format
+msgid "zoomspeed:%f"
+msgstr "velocità di ingrandimento:%f"
+
+#: ../ui/ui.c:491
+msgid "Parameter:none"
+msgstr "Parametro:nessuno"
+
+#: ../ui/ui.c:493
+#, c-format
+msgid "Parameter:[%f,%f]"
+msgstr "Parametro:[%f,%f]"
+
+#: ../ui/ui.c:585
+#, c-format
+msgid "Please wait while calculating %s"
+msgstr "Attendere, calcolo di %s in corso..."
+
+#: ../ui/ui.c:685
+#, c-format
+msgid "Letters per second %i "
+msgstr "Lettere al secondo %i "
+
+#: ../ui/ui.c:698 ../ui/ui.c:709
+#, c-format
+msgid "Rotation speed:%2.2f degrees per second "
+msgstr "Velocità di rotazione:%2.2f gradi al secondo "
+
+#: ../ui/ui.c:719
+#, c-format
+msgid "Iterations: %i "
+msgstr "Iterazioni: %i "
+
+#: ../ui/ui.c:735
+#, c-format
+msgid "Cycling speed: %i "
+msgstr "Velocità di ciclo: %i "
+
+#: ../ui/ui.c:748 ../ui/ui.c:762
+#, c-format
+msgid "speed:%2.2f "
+msgstr "velocità:%2.2f "
+
+#: ../ui/ui.c:854
+#, c-format
+msgid "Thank you for using XaoS\n"
+msgstr "Grazie di utilizzare XaoS\n"
+
+#: ../ui/ui.c:891
+msgid "Skipping, please wait..."
+msgstr "Passaggio al successivo, attendere..."
+
+#: ../ui/ui.c:983 ../ui/ui.c:985 ../ui/ui-drv/win32/ui_win32.c:1453
+msgid "Resize"
+msgstr "Ridimensiona"
+
+#: ../ui/ui.c:998
+msgid "Quit"
+msgstr "Esci"
+
+#: ../ui/ui.c:999
+msgid "Exit now"
+msgstr "Esci adesso"
+
+#: ../ui/ui.c:1001
+msgid "Not yet"
+msgstr "Non ancora"
+
+#: ../ui/ui.c:1004 ../ui-hlp/menu.c:1055 ../ui-hlp/menu.c:1065
+#: ../ui/dialog.c:404 ../ui/dialog.c:1380
+msgid "Help"
+msgstr "Aiuto"
+
+#: ../ui/ui.c:1006
+msgid "Disable XaoS's builtin GUI"
+msgstr "Disabilita l'interfaccia utente incorporata di XaoS"
+
+#: ../ui/ui.c:1010 ../ui/ui.c:1016
+msgid "Status"
+msgstr "Stato"
+
+#: ../ui/ui.c:1012 ../ui/ui.c:1018
+msgid "Ministatus"
+msgstr "Stato ridotto"
+
+#: ../ui/ui.c:1021 ../ui/ui.c:1022
+msgid "Driver"
+msgstr "Driver"
+
+#: ../ui/ui.c:1413
+#, c-format
+msgid "Welcome to XaoS version %s"
+msgstr "Benvenuto a XaoS versione %s"
+
+#: ../ui/ui.c:1580
+msgid "Can not allocate buffers"
+msgstr "Non è possibile allocare i buffer"
+
+#: ../ui/ui.c:1598
+msgid "Can not create palette"
+msgstr "Non è possibile creare la tavolozza"
+
+#: ../ui/ui.c:1610
+msgid "Can not create image"
+msgstr "Non è possibile creare l'immagine"
+
+#: ../ui/ui.c:1641 ../ui/ui.c:1692
+msgid "Can not allocate tables"
+msgstr "Non è possibile allocare le tabelle"
+
+#: ../ui/ui.c:1678
+msgid "Can not initialize driver"
+msgstr "Non è possibile inizializzare il driver"
+
+#: ../ui/ui.c:1681
+msgid "Can not return back to previous driver"
+msgstr "Non è possibile tornare al driver precedente"
+
+#: ../ui-hlp/menu.c:129
+msgid "Perturbation:"
+msgstr "Perturbazione:"
+
+#: ../ui-hlp/menu.c:133
+msgid "Julia-seed:"
+msgstr "Seme di Julia:"
+
+#: ../ui-hlp/menu.c:137
+msgid "Morphing type:"
+msgstr "Tipo di trasformazione:"
+
+#: ../ui-hlp/menu.c:138
+msgid "Startuptime:"
+msgstr "Tempo di avvio:"
+
+#: ../ui-hlp/menu.c:139
+msgid "Stoptime:"
+msgstr "Tempo di arresto:"
+
+#: ../ui-hlp/menu.c:143
+msgid "File to render:"
+msgstr "File di rendering:"
+
+#: ../ui-hlp/menu.c:144
+msgid "Basename:"
+msgstr "Nome base:"
+
+#: ../ui-hlp/menu.c:145
+msgid "Width:"
+msgstr "Larghezza:"
+
+#: ../ui-hlp/menu.c:146
+msgid "Height:"
+msgstr "Altezza:"
+
+#: ../ui-hlp/menu.c:147
+msgid "Real width (cm):"
+msgstr "Larghezza reale (cm):"
+
+#: ../ui-hlp/menu.c:148
+msgid "Real height (cm):"
+msgstr "Altezza reale (cm):"
+
+#: ../ui-hlp/menu.c:149
+msgid "Framerate:"
+msgstr "Frequenza fotogrammi:"
+
+#: ../ui-hlp/menu.c:150
+msgid "Image type:"
+msgstr "Tipo di immagine:"
+
+#: ../ui-hlp/menu.c:151
+msgid "Antialiasing:"
+msgstr "Antialiasing:"
+
+#: ../ui-hlp/menu.c:152
+msgid "Always recalculate:"
+msgstr "Ricalcola sempre:"
+
+#: ../ui-hlp/menu.c:153
+msgid "Calculate MPEG motion vectors:"
+msgstr "Calcola vettori di movimento MPEG:"
+
+#: ../ui-hlp/menu.c:154
+msgid "Recommended I frame distance:"
+msgstr "Distanza consigliata fotogramma I:"
+
+#: ../ui-hlp/menu.c:158
+msgid "Center:"
+msgstr "Centro:"
+
+#: ../ui-hlp/menu.c:159
+msgid "Radius:"
+msgstr "Raggio:"
+
+#: ../ui-hlp/menu.c:160 ../ui-hlp/menu.c:225
+msgid "Angle:"
+msgstr "Angolo:"
+
+#: ../ui-hlp/menu.c:164
+msgid "Mode:"
+msgstr "Modalità:"
+
+#: ../ui-hlp/menu.c:165
+msgid "Start:"
+msgstr "Inizio:"
+
+#: ../ui-hlp/menu.c:166
+msgid "End:"
+msgstr "Fine:"
+
+#: ../ui-hlp/menu.c:170
+msgid "Color:"
+msgstr "Colore:"
+
+#: ../ui-hlp/menu.c:174
+msgid "Rotations per second:"
+msgstr "Rotazioni al secondo:"
+
+#: ../ui-hlp/menu.c:178
+msgid "Letters per second:"
+msgstr "Lettere al secondo:"
+
+#: ../ui-hlp/menu.c:182
+msgid "Iterations:"
+msgstr "Iterazioni:"
+
+#: ../ui-hlp/menu.c:186
+msgid "Text:"
+msgstr "Testo:"
+
+#: ../ui-hlp/menu.c:190
+msgid "Your command:"
+msgstr "Comando:"
+
+#: ../ui-hlp/menu.c:194 ../ui-hlp/menu.c:198 ../ui-hlp/menu.c:202
+#: ../ui-hlp/menu.c:206 ../ui-hlp/menu.c:258
+msgid "Filename:"
+msgstr "Nome file:"
+
+#: ../ui-hlp/menu.c:210 ../ui-hlp/menu.c:298
+msgid "Formula:"
+msgstr "Formula:"
+
+#: ../ui-hlp/menu.c:214
+msgid "X center:"
+msgstr "Centro X:"
+
+#: ../ui-hlp/menu.c:215
+msgid "Y center:"
+msgstr "Centro Y:"
+
+#: ../ui-hlp/menu.c:216
+msgid "X Radius:"
+msgstr "Raggio X:"
+
+#: ../ui-hlp/menu.c:217
+msgid "Y Radius:"
+msgstr "Raggio Y:"
+
+#: ../ui-hlp/menu.c:221
+msgid "Coordinates:"
+msgstr "Coordinate:"
+
+#: ../ui-hlp/menu.c:229
+msgid "continuous rotation"
+msgstr "rotazione continua"
+
+#: ../ui-hlp/menu.c:233
+msgid "Fast rotation"
+msgstr "Rotazione veloce"
+
+#: ../ui-hlp/menu.c:237
+msgid "filter"
+msgstr "filtra"
+
+#: ../ui-hlp/menu.c:238
+msgid "enable"
+msgstr "abilita"
+
+#: ../ui-hlp/menu.c:242
+msgid "Amount:"
+msgstr "Quantità:"
+
+#: ../ui-hlp/menu.c:246
+msgid "Zooming speed:"
+msgstr "Velocità di ingrandimento:"
+
+#: ../ui-hlp/menu.c:250
+msgid "Name:"
+msgstr "Nome:"
+
+#: ../ui-hlp/menu.c:254
+msgid "Bailout:"
+msgstr "Bailout:"
+
+#: ../ui-hlp/menu.c:262
+msgid "Julia mode:"
+msgstr "Modalità Julia:"
+
+#: ../ui-hlp/menu.c:266
+msgid "Horizontal position:"
+msgstr "Posizione orizzontale:"
+
+#: ../ui-hlp/menu.c:267
+msgid "Vertical position:"
+msgstr "Posizione verticale:"
+
+#: ../ui-hlp/menu.c:271
+msgid "Dynamic resolution:"
+msgstr "Risoluzione dinamica:"
+
+#: ../ui-hlp/menu.c:275
+msgid "Time:"
+msgstr "Tempo:"
+
+#: ../ui-hlp/menu.c:279 ../ui-hlp/menu.c:283
+msgid "Number:"
+msgstr "Numero:"
+
+#: ../ui-hlp/menu.c:287
+msgid "Algorithm number:"
+msgstr "Numero dell'algoritmo:"
+
+#: ../ui-hlp/menu.c:288
+msgid "Seed:"
+msgstr "Seme:"
+
+#: ../ui-hlp/menu.c:289
+msgid "Shift:"
+msgstr "Spostamento:"
+
+#: ../ui-hlp/menu.c:293
+msgid "Frames per second:"
+msgstr "Fotogrammi al secondo:"
+
+#: ../ui-hlp/menu.c:302
+msgid "Initialization:"
+msgstr "Inizializzazione:"
+
+#: ../ui-hlp/menu.c:357
+msgid "renderanim: Must specify a valid absolute path for basename"
+msgstr ""
+"renderanim: deve essere specificato un percorso assoluto valido per il nome "
+"base"
+
+#: ../ui-hlp/menu.c:364
+msgid ""
+"renderanim: Width parameter must be positive integer in the range 0..4096"
+msgstr ""
+"renderanim: il parametro larghezza deve essere un intero positivo "
+"nell'intervallo 0..4096"
+
+#: ../ui-hlp/menu.c:370
+msgid ""
+"renderanim: Height parameter must be positive integer in the range 0..4096"
+msgstr ""
+"renderanim: il parametro altezza deve essere un intero positivo "
+"nell'intervallo 0..4096"
+
+#: ../ui-hlp/menu.c:376
+msgid "renderanim: Invalid real width and height dimensions"
+msgstr "renderanim: dimensioni di larghezza e altezza reali non valide"
+
+#: ../ui-hlp/menu.c:380
+msgid "renderanim: invalid framerate"
+msgstr "renderanim: frequenza di aggiornamento non valida"
+
+#: ../ui-hlp/menu.c:386
+msgid "renderanim: antialiasing not supported in 256 color mode"
+msgstr "renderanim: antialiasing non supportato nella modalità a 256 colori"
+
+#: ../ui-hlp/menu.c:390
+msgid "renderanim: incorrect I frame distance"
+msgstr "renderanim: distanza fotogramma I non corretta"
+
+#: ../ui-hlp/menu.c:441 ../ui-hlp/menu.c:454
+msgid "animateview: Invalid viewpoint"
+msgstr "animateview: punto di osservazione non valido"
+
+#: ../ui-hlp/menu.c:467
+msgid "Invalid viewpoint"
+msgstr "Punto di osservazione non valido"
+
+#: ../ui-hlp/menu.c:696
+msgid "Unknown palette type"
+msgstr "Tipo di tavolozza sconosciuto"
+
+#: ../ui-hlp/menu.c:771 ../ui-hlp/menu.c:785
+msgid "Initialization of color cycling failed."
+msgstr "Inizializzazione del ciclo colori fallita."
+
+#: ../ui-hlp/menu.c:773 ../ui-hlp/menu.c:787
+msgid "Try to enable palette emulation filter"
+msgstr "Provare ad abilitare il filtro di emulazione tavolozza"
+
+#: ../ui-hlp/menu.c:896
+#, c-format
+msgid "Algorithm:%i seed:%i size:%i"
+msgstr "Algoritmo:%i seme: %i dimensione:%i"
+
+#: ../ui-hlp/menu.c:947
+msgid "Root menu"
+msgstr "Menù radice"
+
+#: ../ui-hlp/menu.c:948
+msgid "Animation root menu"
+msgstr "Menù radice dell'animazione"
+
+#: ../ui-hlp/menu.c:949
+msgid "Replay only commands"
+msgstr "Riproduci solo i comandi"
+
+#: ../ui-hlp/menu.c:950
+msgid "Command line options only"
+msgstr "Solo opzioni da linea di comando"
+
+#: ../ui-hlp/menu.c:953
+msgid "print menus specifications of all menus"
+msgstr "stampa le specifiche di tutti i menù"
+
+#: ../ui-hlp/menu.c:958
+msgid "print menu specification"
+msgstr "stampa la specifica del menù"
+
+#: ../ui-hlp/menu.c:961
+msgid "print menu specification in xshl format"
+msgstr "stampa la specifica del menù in formato xshl"
+
+#: ../ui-hlp/menu.c:965
+msgid "print all menu specifications in xshl format"
+msgstr "stampa tutte le specifiche del menù in formato xshl"
+
+#: ../ui-hlp/menu.c:967
+msgid "print dialog specification"
+msgstr "stampa le specifiche di dialogo"
+
+#: ../ui-hlp/menu.c:972
+msgid "Line drawing functions"
+msgstr "Funzioni di disegno linea"
+
+#: ../ui-hlp/menu.c:973
+msgid "Line"
+msgstr "Linea"
+
+#: ../ui-hlp/menu.c:976
+msgid "Morph line"
+msgstr "Trasforma linea"
+
+#: ../ui-hlp/menu.c:978
+msgid "Morph last line"
+msgstr "Trasforma l'ultima linea"
+
+#: ../ui-hlp/menu.c:981
+msgid "Set line key"
+msgstr "Imposta la chiave di linea"
+
+#: ../ui-hlp/menu.c:983
+msgid "Clear line"
+msgstr "Cancella linea"
+
+#: ../ui-hlp/menu.c:986
+msgid "Clear all lines"
+msgstr "Cancella tutte le linee"
+
+#: ../ui-hlp/menu.c:988
+msgid "Animation functions"
+msgstr "Funzioni di animazione"
+
+#: ../ui-hlp/menu.c:989 ../ui-hlp/menu.c:1181 ../ui-hlp/menu.c:1190
+msgid "View"
+msgstr "Vista"
+
+#: ../ui-hlp/menu.c:993
+msgid "Morph view"
+msgstr "Trasforma vista"
+
+#: ../ui-hlp/menu.c:995
+msgid "Morph julia"
+msgstr "Trasforma Julia"
+
+#: ../ui-hlp/menu.c:1000
+msgid "Move view"
+msgstr "Muovi vista"
+
+#: ../ui-hlp/menu.c:1002
+msgid "Morph angle"
+msgstr "Trasforma angolo"
+
+#: ../ui-hlp/menu.c:1004
+msgid "Zoom center"
+msgstr "Ingrandisci al centro"
+
+#: ../ui-hlp/menu.c:1006 ../ui/ui-drv/cocoa/AppController.m:343
+msgid "Zoom"
+msgstr "Ingrandimento"
+
+#: ../ui-hlp/menu.c:1007
+msgid "Un-zoom"
+msgstr "Rimpicciolimento"
+
+#: ../ui-hlp/menu.c:1010
+msgid "Stop zooming"
+msgstr "Ferma l'ingrandimento"
+
+#: ../ui-hlp/menu.c:1011
+msgid "Smooth morphing parameters"
+msgstr "Raffina i parametri di trasformazione"
+
+#: ../ui-hlp/menu.c:1014
+msgid "Timing functions"
+msgstr "Funzioni di temporizzazione"
+
+#: ../ui-hlp/menu.c:1015
+msgid "Usleep"
+msgstr "Usleep"
+
+#: ../ui-hlp/menu.c:1018
+msgid "Wait for text"
+msgstr "Attendere il testo"
+
+#: ../ui-hlp/menu.c:1020
+msgid "Wait for complete image"
+msgstr "Attendere l'immagine completa"
+
+#: ../ui-hlp/menu.c:1022
+msgid "Include file"
+msgstr "Includere il file"
+
+#: ../ui-hlp/menu.c:1024 ../ui-hlp/menu.c:1222
+msgid "Default palette"
+msgstr "Tavolozza predefinita"
+
+#: ../ui-hlp/menu.c:1026
+msgid "Formula"
+msgstr "Formula"
+
+#: ../ui-hlp/menu.c:1028
+msgid "Maximal zooming step"
+msgstr "Passo di ingrandimento massimo"
+
+#: ../ui-hlp/menu.c:1030
+msgid "Zooming speedup"
+msgstr "Accelerazione ingrandimento"
+
+#: ../ui-hlp/menu.c:1032
+msgid "Filter"
+msgstr "Filtro"
+
+#: ../ui-hlp/menu.c:1036 ../ui-hlp/menu.c:1041
+msgid "Letters per second"
+msgstr "Lettere al secondo"
+
+#: ../ui-hlp/menu.c:1043 ../ui-hlp/menu.c:1314
+msgid "Interrupt"
+msgstr "Interrompi"
+
+#: ../ui-hlp/menu.c:1045 ../ui-hlp/menu.c:1057
+msgid "File"
+msgstr "File"
+
+#: ../ui-hlp/menu.c:1046
+msgid "Edit"
+msgstr "Modifica"
+
+#: ../ui-hlp/menu.c:1047
+msgid "Fractal"
+msgstr "Frattale"
+
+#: ../ui-hlp/menu.c:1048
+msgid "Calculation"
+msgstr "Calcolo"
+
+#: ../ui-hlp/menu.c:1049 ../ui-hlp/menu.c:1391
+msgid "Filters"
+msgstr "Filtri"
+
+#: ../ui-hlp/menu.c:1050 ../ui-hlp/menu.c:1064
+msgid "UI"
+msgstr "IU"
+
+#: ../ui-hlp/menu.c:1051
+msgid "Misc"
+msgstr "Varie"
+
+#: ../ui-hlp/menu.c:1053
+msgid "Window"
+msgstr "Finestra"
+
+#: ../ui-hlp/menu.c:1056
+msgid "Tutorials"
+msgstr "Guide"
+
+#: ../ui-hlp/menu.c:1062
+msgid "Stop replay"
+msgstr "Interrompi la riproduzione"
+
+#: ../ui-hlp/menu.c:1066
+msgid "Command"
+msgstr "Comando"
+
+#: ../ui-hlp/menu.c:1068
+msgid "Play string"
+msgstr "Riproduci stringa"
+
+#: ../ui-hlp/menu.c:1070
+msgid "Render animation"
+msgstr "Rendering animazione"
+
+#: ../ui-hlp/menu.c:1073
+msgid "Clear screen"
+msgstr "Pulisci schermo"
+
+#: ../ui-hlp/menu.c:1075
+msgid "Display fractal"
+msgstr "Mostra frattale"
+
+#: ../ui-hlp/menu.c:1078
+msgid "Display text"
+msgstr "Mostra testo"
+
+#: ../ui-hlp/menu.c:1080
+msgid "Color"
+msgstr "Colore"
+
+#: ../ui-hlp/menu.c:1082
+msgid "Horizontal text position"
+msgstr "Posizione orizzontale testo"
+
+#: ../ui-hlp/menu.c:1084
+msgid "Vertical text position"
+msgstr "Posizione verticale testo"
+
+#: ../ui-hlp/menu.c:1086
+msgid "Text position"
+msgstr "Posizione testo"
+
+#: ../ui-hlp/menu.c:1090
+msgid "Message"
+msgstr "Messaggio"
+
+#: ../ui-hlp/menu.c:1112
+msgid "Load"
+msgstr "Carica"
+
+#: ../ui-hlp/menu.c:1115
+msgid "Save"
+msgstr "Salva"
+
+#: ../ui-hlp/menu.c:1117
+msgid "Record"
+msgstr "Registra"
+
+#: ../ui-hlp/menu.c:1121
+msgid "Replay"
+msgstr "Riproduci"
+
+#: ../ui-hlp/menu.c:1128
+msgid "Save image"
+msgstr "Salva immagine"
+
+#: ../ui-hlp/menu.c:1130
+msgid "Load random example"
+msgstr "Carica esempio casuale"
+
+#: ../ui-hlp/menu.c:1132
+msgid "Save configuration"
+msgstr "Salva configurazione"
+
+#: ../ui-hlp/menu.c:1137
+msgid "Undo"
+msgstr "Annulla"
+
+#: ../ui-hlp/menu.c:1141
+msgid "Redo"
+msgstr "Ripeti"
+
+#: ../ui-hlp/menu.c:1145
+msgid "Formulae"
+msgstr "Formule"
+
+#: ../ui-hlp/menu.c:1146
+msgid "More formulae"
+msgstr "Altre formule"
+
+#: ../ui-hlp/menu.c:1151
+msgid "User formula"
+msgstr "Formula utente"
+
+#: ../ui-hlp/menu.c:1153
+msgid "User initialization"
+msgstr "Inizializzazione utente"
+
+#: ../ui-hlp/menu.c:1158
+msgid "Incoloring mode"
+msgstr "Modo colorazione interna"
+
+#: ../ui-hlp/menu.c:1159
+msgid "Outcoloring mode"
+msgstr "Modo colorazione esterna"
+
+#: ../ui-hlp/menu.c:1160
+msgid "Plane"
+msgstr "Piano"
+
+#: ../ui-hlp/menu.c:1161
+msgid "Palette"
+msgstr "Tavolozza"
+
+#: ../ui-hlp/menu.c:1164
+msgid "Mandelbrot mode"
+msgstr "Modalità Mandelbrot"
+
+#: ../ui-hlp/menu.c:1170 ../ui-hlp/menu.c:1174 ../ui-hlp/menu.c:1395
+msgid "Perturbation"
+msgstr "Perturbazione"
+
+#: ../ui-hlp/menu.c:1185
+msgid "Reset to defaults"
+msgstr "Reimposta valori predefiniti"
+
+#: ../ui-hlp/menu.c:1186
+msgid "Julia mode"
+msgstr "Modalità Julia"
+
+#: ../ui-hlp/menu.c:1193
+msgid "Set angle"
+msgstr "Imposta angolo"
+
+#: ../ui-hlp/menu.c:1197
+msgid "Set plane"
+msgstr "Imposta piano"
+
+#: ../ui-hlp/menu.c:1201
+msgid "Inside coloring mode"
+msgstr "Modalità di colorazione interna"
+
+#: ../ui-hlp/menu.c:1206
+msgid "Outside coloring mode"
+msgstr "Modalità di colorazione esterna"
+
+#: ../ui-hlp/menu.c:1212
+msgid "Inside truecolor coloring mode"
+msgstr "Modalità di colorazione interna truecolor"
+
+#: ../ui-hlp/menu.c:1216
+msgid "Outside truecolor coloring mode"
+msgstr "Modalità di colorazione esterna truecolor"
+
+#: ../ui-hlp/menu.c:1219
+msgid "Julia seed"
+msgstr "Seme di Julia"
+
+#: ../ui-hlp/menu.c:1224
+msgid "Random palette"
+msgstr "Tavolozza casuale"
+
+#: ../ui-hlp/menu.c:1226
+msgid "Custom palette"
+msgstr "Tavolozza personalizzata"
+
+#: ../ui-hlp/menu.c:1230
+msgid "Color cycling"
+msgstr "Ciclo dei colori"
+
+#: ../ui-hlp/menu.c:1232
+msgid "Reversed color cycling"
+msgstr "Ciclo dei colori inverso"
+
+#: ../ui-hlp/menu.c:1237
+msgid "Color cycling speed"
+msgstr "Velocità di ciclo dei colori"
+
+#: ../ui-hlp/menu.c:1241
+msgid "Shift palette"
+msgstr "Sposta tavolozza"
+
+#: ../ui-hlp/menu.c:1243
+msgid "Shift one forward"
+msgstr "Sposta avanti di uno"
+
+#: ../ui-hlp/menu.c:1246
+msgid "Shift one backward"
+msgstr "Sposta indietro di uno"
+
+#: ../ui-hlp/menu.c:1248 ../engine/zoom.c:1357
+msgid "Solid guessing"
+msgstr "Stima di uniformità colore"
+
+#: ../ui-hlp/menu.c:1249
+msgid "Dynamic resolution"
+msgstr "Risoluzione dinamica"
+
+#: ../ui-hlp/menu.c:1251
+msgid "Periodicity checking"
+msgstr "Controllo di periodicità"
+
+#: ../ui-hlp/menu.c:1254
+msgid "Iterations"
+msgstr "Iterazioni"
+
+#: ../ui-hlp/menu.c:1256
+msgid "Bailout"
+msgstr "Bailout"
+
+#: ../ui-hlp/menu.c:1260
+msgid "Fast julia mode"
+msgstr "Modalità julia veloce"
+
+#: ../ui-hlp/menu.c:1262
+msgid "Rotation"
+msgstr "Rotazione"
+
+#: ../ui-hlp/menu.c:1263
+msgid "Solid guessing range"
+msgstr "Area di stima di uniformità"
+
+#: ../ui-hlp/menu.c:1266
+msgid "Disable rotation"
+msgstr "Disabilita rotazione"
+
+#: ../ui-hlp/menu.c:1270
+msgid "Continuous rotation"
+msgstr "Rotazione continua"
+
+#: ../ui-hlp/menu.c:1273
+msgid "Rotate by mouse"
+msgstr "Ruota tramite mouse"
+
+#: ../ui-hlp/menu.c:1277
+msgid "Rotation speed"
+msgstr "Velocità di rotazione"
+
+#: ../ui-hlp/menu.c:1280
+msgid "Automatic rotation"
+msgstr "Rotazione automatica"
+
+#: ../ui-hlp/menu.c:1285
+msgid "Fast rotation mode"
+msgstr "Modalità di rotazione rapida"
+
+#: ../ui-hlp/menu.c:1289
+msgid "Disable dynamic resolution"
+msgstr "Disabilita la risoluzione dinamica"
+
+#: ../ui-hlp/menu.c:1292
+msgid "Use only during animation"
+msgstr "Usa solo durante l'animazione"
+
+#: ../ui-hlp/menu.c:1296
+msgid "Use also for new images"
+msgstr "Usa anche per nuove immagini"
+
+#: ../ui-hlp/menu.c:1298
+msgid "Dynamic resolution mode"
+msgstr "Modalità a risoluzione dinamica"
+
+#: ../ui-hlp/menu.c:1302
+msgid "Autopilot"
+msgstr "Pilota automatico"
+
+#: ../ui-hlp/menu.c:1306
+msgid "VJ mode"
+msgstr "Modalità VJ"
+
+#: ../ui-hlp/menu.c:1310
+msgid "Recalculate"
+msgstr "Ricalcola"
+
+#: ../ui-hlp/menu.c:1319
+msgid "Zooming speed"
+msgstr "Velocità di ingrandimento"
+
+#: ../ui-hlp/menu.c:1321
+msgid "Fixed step"
+msgstr "Passo fisso"
+
+#: ../ui-hlp/menu.c:1325
+msgid "Disable solid guessing"
+msgstr "Disabilita la stima di uniformità"
+
+#: ../ui-hlp/menu.c:1329
+msgid "Guess 2x2 rectangles"
+msgstr "Stima rettangoli 2x2"
+
+#: ../ui-hlp/menu.c:1331
+msgid "Guess 3x3 rectangles"
+msgstr "Stima rettangoli 3x3"
+
+#: ../ui-hlp/menu.c:1335
+msgid "Guess 4x4 rectangles"
+msgstr "Stima rettangoli 4x4"
+
+#: ../ui-hlp/menu.c:1337
+msgid "Guess 5x5 rectangles"
+msgstr "Stima rettangoli 5x5"
+
+#: ../ui-hlp/menu.c:1341
+msgid "Guess 6x6 rectangles"
+msgstr "Stima rettangoli 6x6"
+
+#: ../ui-hlp/menu.c:1343
+msgid "Guess 7x7 rectangles"
+msgstr "Stima rettangoli 7x7"
+
+#: ../ui-hlp/menu.c:1347
+msgid "Guess 8x8 rectangles"
+msgstr "Stima rettangoli 8x8"
+
+#: ../ui-hlp/menu.c:1349
+msgid "Guess unlimited rectangles"
+msgstr "Stima rettangoli illimitati"
+
+#: ../ui-hlp/menu.c:1354
+msgid "Language"
+msgstr "Lingua"
+
+#: ../ui-hlp/menu.c:1357
+msgid "An introduction to fractals"
+msgstr "Una introduzione ai frattali"
+
+#: ../ui-hlp/menu.c:1359
+msgid "XaoS features overview"
+msgstr "Panoramica delle caratteristiche di XaoS"
+
+#: ../ui-hlp/menu.c:1361
+msgid "Math behind fractals"
+msgstr "La matematica che sta dietro ai frattali"
+
+#: ../ui-hlp/menu.c:1362 ../ui-hlp/menu.c:1403
+msgid "Other fractal types in XaoS"
+msgstr "Altri tipi di frattali in XaoS"
+
+#: ../ui-hlp/menu.c:1364
+msgid "What's new?"
+msgstr "Novità"
+
+#: ../ui-hlp/menu.c:1374 ../ui-hlp/menu.c:1398
+msgid "Whole story"
+msgstr "Racconto completo"
+
+#: ../ui-hlp/menu.c:1376
+msgid "Introduction"
+msgstr "Introduzione"
+
+#: ../ui-hlp/menu.c:1377
+msgid "Mandelbrot set"
+msgstr "Insieme di Mandelbrot"
+
+#: ../ui-hlp/menu.c:1378
+msgid "Julia set"
+msgstr "Insieme di Julia"
+
+#: ../ui-hlp/menu.c:1379
+msgid "Higher power Mandelbrots"
+msgstr "Mandelbrot a potenze superiori"
+
+#: ../ui-hlp/menu.c:1380
+msgid "Newton's method"
+msgstr "Metodo di Newton"
+
+#: ../ui-hlp/menu.c:1381
+msgid "Barnsley's formula"
+msgstr "Formula di Barnsley"
+
+#: ../ui-hlp/menu.c:1382
+msgid "Phoenix"
+msgstr "Phoenix"
+
+#: ../ui-hlp/menu.c:1383
+msgid "Octo"
+msgstr "Octo"
+
+#: ../ui-hlp/menu.c:1384
+msgid "Magnet"
+msgstr "Magnet"
+
+#: ../ui-hlp/menu.c:1385
+msgid "All features"
+msgstr "Tutte le caratteristiche"
+
+#: ../ui-hlp/menu.c:1387
+msgid "Outcoloring modes"
+msgstr "Modi di colorazione esterna"
+
+#: ../ui-hlp/menu.c:1388
+msgid "Incoloring modes"
+msgstr "Modi di colorazione interna"
+
+#: ../ui-hlp/menu.c:1389
+msgid "True-color coloring modes"
+msgstr "Modi di colorazione truecolor"
+
+#: ../ui-hlp/menu.c:1392
+msgid "Planes"
+msgstr "Piani"
+
+#: ../ui-hlp/menu.c:1393
+msgid "Animations and position files"
+msgstr "Animazioni e file di posizione"
+
+#: ../ui-hlp/menu.c:1396
+msgid "Random palettes"
+msgstr "Tavolozze casuali"
+
+#: ../ui-hlp/menu.c:1397
+msgid "Other noteworthy features"
+msgstr "Altre caratteristiche degne di nota"
+
+#: ../ui-hlp/menu.c:1400
+msgid "The definition and fractal dimension"
+msgstr "La definizione di frattale e la sua dimensione"
+
+#: ../ui-hlp/menu.c:1402
+msgid "Escape time fractals"
+msgstr "Frattali con tempo di fuga"
+
+#: ../ui-hlp/menu.c:1406
+msgid "Triceratops and Catseye fractals"
+msgstr "Frattali Triceratopo e Occhi di gatto"
+
+#: ../ui-hlp/menu.c:1408
+msgid "Mandelbar, Lambda, Manowar and Spider"
+msgstr "Mandelbar, Lambda, Manowar e Spider"
+
+#: ../ui-hlp/menu.c:1411
+msgid "Sierpinski Gasket, S.Carpet, Koch Snowflake"
+msgstr "Triangolo e tappeto-Sierpinski,fiocco di neve-Koch"
+
+#: ../ui-hlp/menu.c:1413
+msgid "What's new in 3.0?"
+msgstr "Novità della versione 3.0"
+
+#: ../ui-hlp/play.c:74
+msgid "line available only in animation replay"
+msgstr "linea disponibile solo nella riproduzione animazione"
+
+#: ../ui-hlp/play.c:99
+msgid "Morphing non existing line!"
+msgstr "Trasformazione di una linea inesistente!"
+
+#: ../ui-hlp/play.c:121
+msgid "linekey not available in this context!"
+msgstr "linekey non disponibile in questo contesto!"
+
+#: ../ui-hlp/play.c:291
+msgid "clear_line available only in animation replay"
+msgstr "clear_line disponibile solo nella riproduzione animazione"
+
+#: ../ui-hlp/play.c:300
+msgid "clear_lines available only in animation replay"
+msgstr "clear_lines disponibile solo nella riproduzione animazione"
+
+#: ../ui-hlp/play.c:359
+msgid "Catalog file not found"
+msgstr "File del catalogo non trovato"
+
+#: ../ui-hlp/play.c:405
+msgid "Replay is already active"
+msgstr "La riproduzione è già attiva"
+
+#: ../ui-hlp/play.c:409
+msgid "File open failed"
+msgstr "Apertura del file fallita"
+
+#: ../ui-hlp/play.c:414
+msgid "Out of memory"
+msgstr "Memoria esaurita"
+
+#: ../ui-hlp/play.c:526 ../ui-hlp/play.c:542 ../ui-hlp/play.c:566
+#: ../ui-hlp/play.c:595
+msgid "Missing parameter"
+msgstr "Parametro mancante"
+
+#: ../ui-hlp/play.c:528 ../ui-hlp/play.c:544 ../ui-hlp/play.c:568
+#: ../ui-hlp/play.c:597
+msgid "Unexpected end of file"
+msgstr "Fine file inattesa"
+
+#: ../ui-hlp/play.c:555 ../ui-hlp/play.c:574
+msgid "Token is too long"
+msgstr "Il token è troppo lungo"
+
+#: ../ui-hlp/play.c:629
+msgid "Unknown formula type"
+msgstr "Tipo di formula sconosciuto"
+
+#: ../ui-hlp/play.c:635
+msgid "morph available only in animation replay"
+msgstr "morph disponibile solo nella riproduzione di animazione"
+
+#: ../ui-hlp/play.c:639
+msgid "morphview: Invalid viewpoint"
+msgstr "morphview: punto di osservazione non valido"
+
+#: ../ui-hlp/play.c:653
+msgid "move available only in animation replay"
+msgstr "move disponibile solo in riproduzione animazione"
+
+#: ../ui-hlp/play.c:667
+msgid "morphjulia available only in animation replay"
+msgstr "morphjulia disponibile solo in riproduzione animazione"
+
+#: ../ui-hlp/play.c:680
+msgid "morphangle available only in animation replay"
+msgstr "morphangle disponibile solo in riproduzione animazione"
+
+#: ../ui-hlp/play.c:712
+msgid "Unknown filter"
+msgstr "Filtro sconosciuto"
+
+#: ../ui-hlp/play.c:753
+msgid "sleep available only in animation replay"
+msgstr "sleep disponibile solo in riproduzione animazione"
+
+#: ../ui-hlp/play.c:767
+#, c-format
+msgid "Internal program error #12 %i\n"
+msgstr "Errore interno del programma #12 %i\n"
+
+#: ../ui-hlp/play.c:788
+msgid "wait available only in animation replay"
+msgstr "wait disponibile solo nella riproduzione di animazione"
+
+#: ../ui-hlp/play.c:834
+msgid "No catalog file loaded"
+msgstr "Nessun file del catalogo caricato"
+
+#: ../ui-hlp/play.c:839
+msgid "Message not found in catalog file"
+msgstr "Messaggio non trovato nel file del catalogo"
+
+#: ../ui-hlp/play.c:850
+msgid "load available only in animation replay"
+msgstr "load disponibile solo nella riproduzione di animazione"
+
+#: ../ui-hlp/play.c:854
+msgid "Include level overflow"
+msgstr "Includi overflow di livello"
+
+#: ../ui-hlp/play.c:863
+msgid "File not found"
+msgstr "File non trovato"
+
+#: ../ui-hlp/play.c:881
+msgid "Too many parameters"
+msgstr "Troppi parametri"
+
+#: ../ui-hlp/play.c:916
+#, c-format
+msgid "Replay disabled at line %i"
+msgstr "Riproduzione disabilitata alla linea %i"
+
+#: ../ui-hlp/ui_helper.c:646
+msgid "Tutorial files not found. Reinstall XaoS"
+msgstr "File della guida non trovati. Reinstallare XaoS"
+
+#: ../ui-hlp/ui_helper.c:651
+msgid "Preparing first image"
+msgstr "Preparazione della prima immagine"
+
+#: ../ui-hlp/ui_helper.c:661
+msgid "Could not open examples"
+msgstr "Impossibile aprire gli esempi"
+
+#: ../ui-hlp/ui_helper.c:667
+#, c-format
+msgid "File %s loaded."
+msgstr "File %s caricato."
+
+#: ../ui-hlp/ui_helper.c:676
+msgid "Saving image..."
+msgstr "Salvataggio dell'immagine..."
+
+#: ../ui-hlp/ui_helper.c:684
+msgid "Save interrupted"
+msgstr "Salvataggio interrotto"
+
+#: ../ui-hlp/ui_helper.c:693 ../ui-hlp/ui_helper.c:710
+#: ../ui-hlp/ui_helper.c:777
+#, c-format
+msgid "File %s saved."
+msgstr "File %s salvato."
+
+#: ../ui-hlp/ui_helper.c:704
+msgid "Can not open file"
+msgstr "Impossibile aprire il file"
+
+#: ../ui-hlp/ui_helper.c:799
+#, c-format
+msgid "Recording to file %s enabled."
+msgstr "Registrazione nel file %s abilitata."
+
+#: ../engine/zoom.c:1128
+msgid "Solid guessing 1"
+msgstr "Stima di uniformità colore 1"
+
+#: ../engine/btrace.c:292 ../engine/btrace.c:373
+msgid "Boundary trace"
+msgstr "Traccia dei contorni"
+
+#: ../ui/dialog.c:312 ../ui/dialog.c:398 ../ui/dialog.c:1377
+#: ../ui/ui-drv/cocoa/CustomDialog.m:302
+msgid "OK"
+msgstr "OK"
+
+#: ../ui/dialog.c:313 ../ui/dialog.c:401 ../ui/dialog.c:1379
+#: ../ui/filesel.c:184 ../ui/ui-drv/cocoa/CustomDialog.m:312
+msgid "Cancel"
+msgstr "Annulla"
+
+#: ../ui-hlp/render.c:46
+#, c-format
+msgid "Error: %s"
+msgstr "Errore: %s"
+
+#: ../ui-hlp/render.c:121
+msgid "Cannot open motion vector file!"
+msgstr "Impossibile aprire il file dei vettori di movimento!"
+
+#: ../ui-hlp/render.c:270
+#, c-format
+msgid "Vectors: %i"
+msgstr "Vettori: %i"
+
+#: ../ui-hlp/render.c:276
+msgid "Initializing"
+msgstr "Inizializzazione"
+
+#: ../ui-hlp/render.c:284
+msgid "Cannot create palette"
+msgstr "Impossibile creare la tavolozza"
+
+#: ../ui-hlp/render.c:295
+msgid "Cannot create image\n"
+msgstr "Impossibile creare l'immagine\n"
+
+#: ../ui-hlp/render.c:304
+msgid "Cannot create checking buffer!"
+msgstr "Impossibile creare il buffer di controllo!"
+
+#: ../ui-hlp/render.c:313 ../ui-hlp/render.c:596
+msgid "Cannot create context\n"
+msgstr "Impossibile creare il contesto\n"
+
+#: ../ui-hlp/render.c:325
+msgid "Cannot open animation file\n"
+msgstr "Impossibile aprire il file di animazione\n"
+
+#: ../ui-hlp/render.c:336 ../ui-hlp/render.c:605
+msgid "Loading catalogs"
+msgstr "Carimento dei cataloghi"
+
+#: ../ui-hlp/render.c:366
+msgid "Processing command line options"
+msgstr "Elaborazione delle opzioni da linea di comando"
+
+#: ../ui-hlp/render.c:389
+msgid "Enabling animation replay\n"
+msgstr "Abilitazione della riproduzione animazione\n"
+
+#: ../ui-hlp/render.c:396 ../ui-hlp/render.c:514
+msgid "Cannot open image file"
+msgstr "Impossibile aprire il file dell'immagine"
+
+#: ../ui-hlp/render.c:410
+msgid "Cannot open pattern file"
+msgstr "Impossibile aprire il file della trama"
+
+#: ../ui-hlp/render.c:427 ../ui-hlp/render.c:429 ../ui-hlp/render.c:638
+msgid "Entering calculation loop!"
+msgstr "Ingresso in un loop di calcolo!"
+
+#: ../ui-hlp/render.c:455
+#, c-format
+msgid "Frame %i skipped."
+msgstr "Fotogramma %i saltato."
+
+#: ../ui-hlp/render.c:457
+#, c-format
+msgid "Frames %i - %i skipped."
+msgstr "Fotogrammi %i - %i saltati."
+
+#: ../ui-hlp/render.c:461
+#, c-format
+msgid "Frame %4i: "
+msgstr "Fotogramma %4i: "
+
+#: ../ui-hlp/render.c:528
+msgid " done."
+msgstr " fatto."
+
+#: ../ui-hlp/render.c:532
+msgid " skipping..."
+msgstr " passaggio al successivo..."
+
+#: ../ui-hlp/render.c:565 ../ui-hlp/render.c:657
+msgid "Calculation interrupted"
+msgstr "Calcolo interrotto"
+
+#: ../ui-hlp/render.c:568 ../ui-hlp/render.c:570 ../ui-hlp/render.c:659
+msgid "Calculation finished"
+msgstr "Calcolo concluso"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1292 ../ui/ui-drv/cocoa/AppController.m:321
+msgid "Copy"
+msgstr "Copia"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1293 ../ui/ui-drv/cocoa/AppController.m:324
+msgid "Paste"
+msgstr "Incolla"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1297
+msgid "About"
+msgstr "Informazioni su..."
+
+#: ../ui/ui-drv/cocoa/AppController.m:197
+msgid "About XaoS"
+msgstr "Informazioni su XaoS"
+
+#: ../ui/ui-drv/cocoa/AppController.m:200
+msgid "Services"
+msgstr "Servizi"
+
+#: ../ui/ui-drv/cocoa/AppController.m:203
+msgid "Hide XaoS"
+msgstr "Nascondi XaoS"
+
+#: ../ui/ui-drv/cocoa/AppController.m:206
+msgid "Hide Others"
+msgstr "Nascondi le altre"
+
+#: ../ui/ui-drv/cocoa/AppController.m:209
+msgid "Show All"
+msgstr "Mostra tutte"
+
+#: ../ui/ui-drv/cocoa/AppController.m:212
+msgid "Quit XaoS"
+msgstr "Esci da XaoS"
+
+#: ../ui/ui-drv/cocoa/AppController.m:318
+msgid "Cut"
+msgstr "Taglia"
+
+#: ../ui/ui-drv/cocoa/AppController.m:327
+msgid "Delete"
+msgstr "Elimina"
+
+#: ../ui/ui-drv/cocoa/AppController.m:330
+msgid "Select All"
+msgstr "Seleziona tutto"
+
+#: ../ui/ui-drv/cocoa/AppController.m:340
+msgid "Minimize"
+msgstr "Minimizza"
+
+#: ../ui/ui-drv/cocoa/AppController.m:348
+msgid "Bring All to Front"
+msgstr "Porta tutto in primo piano"
+
+#: ../ui/ui-drv/cocoa/AppController.m:359
+msgid "Close"
+msgstr "Chiudi"
+
+#: ../ui/ui-drv/cocoa/AppController.m:373
+msgid "Videator Output"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/CustomDialog.m:142
+msgid "Choose"
+msgstr "Scegli"
diff --git a/src/i18n/pt.po b/src/i18n/pt.po
new file mode 100644
index 0000000..d7c33d9
--- /dev/null
+++ b/src/i18n/pt.po
@@ -0,0 +1,1570 @@
+# Copyright (C) 2002 Free Software Foundation, Inc.
+# Zoltan Kovacs <kovzol@math.u-szeged.hu>, 2002.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: XaoS 3.2\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-11-14 10:56+0100\n"
+"PO-Revision-Date: 2009-06-01 14:07-0300\n"
+"Last-Translator: Lucio de Araujo <lucio.matema@gmail.com>\n"
+"Language-Team: Portuguese <zeliagarcia@seed.pr.gov.br>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: Portuguese\n"
+"X-Poedit-Country: BRAZIL\n"
+"X-Poedit-SourceCharset: utf-8\n"
+
+#: ../ui/ui.c:314
+#, fuzzy
+msgid "XaoS is out of memory."
+msgstr "Sem memória"
+
+#: ../ui/ui.c:360
+#, c-format
+msgid "%s %.2f times (%.1fE) %2.2f frames/sec %c %i %i %i %i "
+msgstr "%s %.2f vezes (%.1fE) %2.2f quadros/seg %c %i %i %i %i "
+
+#: ../ui/ui.c:361
+msgid "unzoomed"
+msgstr "reduzido"
+
+#: ../ui/ui.c:361
+msgid "zoomed"
+msgstr "ampliado"
+
+#: ../ui/ui.c:369
+#, c-format
+msgid "framerate:%f\n"
+msgstr "velocidade do quadro:%f\n"
+
+#: ../ui/ui.c:409
+#, c-format
+msgid "Enabling: %s. "
+msgstr "Habilitando: %s. "
+
+#: ../ui/ui.c:411
+#, c-format
+msgid "Disabling: %s. "
+msgstr "Desabilitando: %s"
+
+#: ../ui/ui.c:441
+#, c-format
+msgid "Fractal name:%s"
+msgstr "Nome do fractal: %s"
+
+#: ../ui/ui.c:446
+#, c-format
+msgid "Fractal type:%s"
+msgstr "Tipo do fractal: %s"
+
+#: ../ui/ui.c:448
+msgid "Mandelbrot"
+msgstr "Mandelbrot"
+
+#: ../ui/ui.c:449
+msgid "Julia"
+msgstr "Julia"
+
+#: ../ui/ui.c:452
+#, fuzzy, c-format
+msgid "Formula:%s"
+msgstr "Fórmula"
+
+#: ../ui/ui.c:457
+#, c-format
+msgid "View:[%1.12f,%1.12f]"
+msgstr "Visualização:[%1.12f,%1.12f]"
+
+#: ../ui/ui.c:461
+#, c-format
+msgid "size:[%1.12f,%1.12f]"
+msgstr "Tamanho:[%1.12f,%1.12f]"
+
+#: ../ui/ui.c:465
+#, c-format
+msgid "Rotation:%4.2f Screen size:%i:%i"
+msgstr "Rotação:%4.2f Tamanho da tela:%i:%i"
+
+#: ../ui/ui.c:470
+#, c-format
+msgid "Iterations:%-4i Palette size:%i"
+msgstr "Iteracões:%-4i Tamanho da paleta:%i"
+
+#: ../ui/ui.c:477
+#, c-format
+msgid "Autopilot:%-4s Plane:%s"
+msgstr "Piloto automático:%-4s Plano:%s"
+
+#: ../ui/ui.c:478
+msgid "On"
+msgstr "Ligado"
+
+#: ../ui/ui.c:478
+msgid "Off"
+msgstr "Desligado"
+
+#: ../ui/ui.c:482
+#, c-format
+msgid "incoloring:%s outcoloring:%s"
+msgstr "Cor interna:%s Cor externa:%s"
+
+#: ../ui/ui.c:487
+#, c-format
+msgid "zoomspeed:%f"
+msgstr "Velocidade da ampliação:%f"
+
+#: ../ui/ui.c:491
+msgid "Parameter:none"
+msgstr "Parâmetro:nenhum"
+
+#: ../ui/ui.c:493
+#, c-format
+msgid "Parameter:[%f,%f]"
+msgstr "Parâmetro:[%f,%f]"
+
+#: ../ui/ui.c:585
+#, c-format
+msgid "Please wait while calculating %s"
+msgstr "Por favor, espere o cálculo %s"
+
+#: ../ui/ui.c:685
+#, c-format
+msgid "Letters per second %i "
+msgstr "Letras por segundo %i "
+
+#: ../ui/ui.c:698 ../ui/ui.c:709
+#, c-format
+msgid "Rotation speed:%2.2f degrees per second "
+msgstr "Velocidade de rotação:%2.2f graus por segundo "
+
+#: ../ui/ui.c:719
+#, fuzzy, c-format
+msgid "Iterations: %i "
+msgstr "Iterações: %i "
+
+#: ../ui/ui.c:735
+#, c-format
+msgid "Cycling speed: %i "
+msgstr "Velocidade da troca de cor: %i "
+
+#: ../ui/ui.c:748 ../ui/ui.c:762
+#, c-format
+msgid "speed:%2.2f "
+msgstr "velocidade: %2.2f "
+
+#: ../ui/ui.c:854
+#, c-format
+msgid "Thank you for using XaoS\n"
+msgstr "Obrigado(a) por usar o XaoS\n"
+
+#: ../ui/ui.c:891
+msgid "Skipping, please wait..."
+msgstr "Pulando, por favor espere..."
+
+#: ../ui/ui.c:983 ../ui/ui.c:985 ../ui/ui-drv/win32/ui_win32.c:1453
+msgid "Resize"
+msgstr "Redimensionar"
+
+#: ../ui/ui.c:998
+#, fuzzy
+msgid "Quit"
+msgstr "Sair"
+
+#: ../ui/ui.c:999
+msgid "Exit now"
+msgstr "Sair agora"
+
+#: ../ui/ui.c:1001
+msgid "Not yet"
+msgstr "Ainda não"
+
+#: ../ui/ui.c:1004 ../ui-hlp/menu.c:1055 ../ui-hlp/menu.c:1065
+#: ../ui/dialog.c:404 ../ui/dialog.c:1380
+msgid "Help"
+msgstr "Ajuda"
+
+#: ../ui/ui.c:1006
+msgid "Disable XaoS's builtin GUI"
+msgstr "Desabilitar GUI integrado ao XaoS"
+
+#: ../ui/ui.c:1010 ../ui/ui.c:1016
+msgid "Status"
+msgstr "Estado"
+
+#: ../ui/ui.c:1012 ../ui/ui.c:1018
+msgid "Ministatus"
+msgstr "Miniestado"
+
+#: ../ui/ui.c:1021 ../ui/ui.c:1022
+msgid "Driver"
+msgstr "Navegador"
+
+#: ../ui/ui.c:1413
+#, c-format
+msgid "Welcome to XaoS version %s"
+msgstr "Bem-vindo ao XaoS versão %s"
+
+#: ../ui/ui.c:1580
+msgid "Can not allocate buffers"
+msgstr "Não pode partilhar buffers (memórias temporárias)"
+
+#: ../ui/ui.c:1598
+msgid "Can not create palette"
+msgstr "Não pode criar paleta"
+
+#: ../ui/ui.c:1610
+msgid "Can not create image"
+msgstr "Não pode criar imagem"
+
+#: ../ui/ui.c:1641 ../ui/ui.c:1692
+msgid "Can not allocate tables"
+msgstr "Não pode partilhar tabelas"
+
+#: ../ui/ui.c:1678
+msgid "Can not initialize driver"
+msgstr "Não pode inicializar o navegador"
+
+#: ../ui/ui.c:1681
+msgid "Can not return back to previous driver"
+msgstr "Não pode retornar ao navegador anterior"
+
+#: ../ui-hlp/menu.c:129
+#, fuzzy
+msgid "Perturbation:"
+msgstr "Distorção"
+
+#: ../ui-hlp/menu.c:133
+#, fuzzy
+msgid "Julia-seed:"
+msgstr "Semente de Julia"
+
+#: ../ui-hlp/menu.c:137
+msgid "Morphing type:"
+msgstr "Tipo de alteração na imagem (metamorfose)"
+
+#: ../ui-hlp/menu.c:138
+#, fuzzy
+msgid "Startuptime:"
+msgstr "Período de inicialização"
+
+#: ../ui-hlp/menu.c:139
+#, fuzzy
+msgid "Stoptime:"
+msgstr "Tempo de parada"
+
+#: ../ui-hlp/menu.c:143
+msgid "File to render:"
+msgstr "Arquivo para processar (renderizar)"
+
+#: ../ui-hlp/menu.c:144
+#, fuzzy
+msgid "Basename:"
+msgstr "Nome base"
+
+#: ../ui-hlp/menu.c:145
+msgid "Width:"
+msgstr "Comprimento"
+
+#: ../ui-hlp/menu.c:146
+msgid "Height:"
+msgstr "Altura"
+
+#: ../ui-hlp/menu.c:147
+msgid "Real width (cm):"
+msgstr "Comprimento real (cm)"
+
+#: ../ui-hlp/menu.c:148
+msgid "Real height (cm):"
+msgstr "Altura real (cm)"
+
+#: ../ui-hlp/menu.c:149
+#, fuzzy
+msgid "Framerate:"
+msgstr "velocidade do quadro:%f\n"
+
+#: ../ui-hlp/menu.c:150
+msgid "Image type:"
+msgstr "Tipo de imagem"
+
+#: ../ui-hlp/menu.c:151
+#, fuzzy
+msgid "Antialiasing:"
+msgstr "Suavização das bordas"
+
+#: ../ui-hlp/menu.c:152
+#, fuzzy
+msgid "Always recalculate:"
+msgstr "Recalcular sempre"
+
+#: ../ui-hlp/menu.c:153
+msgid "Calculate MPEG motion vectors:"
+msgstr "Calcular a transição dos vetores do MPEG"
+
+#: ../ui-hlp/menu.c:154
+msgid "Recommended I frame distance:"
+msgstr "Distância recomendada do frame I"
+
+#: ../ui-hlp/menu.c:158
+#, fuzzy
+msgid "Center:"
+msgstr "Centro"
+
+#: ../ui-hlp/menu.c:159
+msgid "Radius:"
+msgstr "Raio"
+
+#: ../ui-hlp/menu.c:160 ../ui-hlp/menu.c:225
+msgid "Angle:"
+msgstr "Ângulo"
+
+#: ../ui-hlp/menu.c:164
+msgid "Mode:"
+msgstr "Modo"
+
+#: ../ui-hlp/menu.c:165
+#, fuzzy
+msgid "Start:"
+msgstr "Iniciar"
+
+#: ../ui-hlp/menu.c:166
+msgid "End:"
+msgstr "Finalizar"
+
+#: ../ui-hlp/menu.c:170
+#, fuzzy
+msgid "Color:"
+msgstr "Cor"
+
+#: ../ui-hlp/menu.c:174
+#, fuzzy
+msgid "Rotations per second:"
+msgstr "Rotações por segundo"
+
+#: ../ui-hlp/menu.c:178
+#, fuzzy
+msgid "Letters per second:"
+msgstr "Letras por segundo"
+
+#: ../ui-hlp/menu.c:182
+#, fuzzy
+msgid "Iterations:"
+msgstr "Iterações"
+
+#: ../ui-hlp/menu.c:186
+msgid "Text:"
+msgstr "Texto"
+
+#: ../ui-hlp/menu.c:190
+#, fuzzy
+msgid "Your command:"
+msgstr "Seu comando"
+
+#: ../ui-hlp/menu.c:194 ../ui-hlp/menu.c:198 ../ui-hlp/menu.c:202
+#: ../ui-hlp/menu.c:206 ../ui-hlp/menu.c:258
+#, fuzzy
+msgid "Filename:"
+msgstr "Nome do arquivo"
+
+#: ../ui-hlp/menu.c:210 ../ui-hlp/menu.c:298
+#, fuzzy
+msgid "Formula:"
+msgstr "Fórmula"
+
+#: ../ui-hlp/menu.c:214
+#, fuzzy
+msgid "X center:"
+msgstr "Centro X"
+
+#: ../ui-hlp/menu.c:215
+#, fuzzy
+msgid "Y center:"
+msgstr "Centro Y"
+
+#: ../ui-hlp/menu.c:216
+msgid "X Radius:"
+msgstr "Raio X"
+
+#: ../ui-hlp/menu.c:217
+msgid "Y Radius:"
+msgstr "Raio Y"
+
+#: ../ui-hlp/menu.c:221
+msgid "Coordinates:"
+msgstr "Coordenadas"
+
+#: ../ui-hlp/menu.c:229
+#, fuzzy
+msgid "continuous rotation"
+msgstr "Rotação continua"
+
+#: ../ui-hlp/menu.c:233
+#, fuzzy
+msgid "Fast rotation"
+msgstr "Rotação rápida"
+
+#: ../ui-hlp/menu.c:237
+#, fuzzy
+msgid "filter"
+msgstr "Filtro"
+
+#: ../ui-hlp/menu.c:238
+msgid "enable"
+msgstr "Habilitar"
+
+#: ../ui-hlp/menu.c:242
+msgid "Amount:"
+msgstr "Quantia"
+
+#: ../ui-hlp/menu.c:246
+#, fuzzy
+msgid "Zooming speed:"
+msgstr "Velocidade da ampliação"
+
+#: ../ui-hlp/menu.c:250
+msgid "Name:"
+msgstr "Nome"
+
+#: ../ui-hlp/menu.c:254
+msgid "Bailout:"
+msgstr "Bailout"
+
+#: ../ui-hlp/menu.c:262
+#, fuzzy
+msgid "Julia mode:"
+msgstr "Modo Julia"
+
+#: ../ui-hlp/menu.c:266
+#, fuzzy
+msgid "Horizontal position:"
+msgstr "Posição horizontal"
+
+#: ../ui-hlp/menu.c:267
+#, fuzzy
+msgid "Vertical position:"
+msgstr "Posição vertical"
+
+#: ../ui-hlp/menu.c:271
+#, fuzzy
+msgid "Dynamic resolution:"
+msgstr "Resolução dinâmica"
+
+#: ../ui-hlp/menu.c:275
+msgid "Time:"
+msgstr "Tempo"
+
+#: ../ui-hlp/menu.c:279 ../ui-hlp/menu.c:283
+msgid "Number:"
+msgstr "Número"
+
+#: ../ui-hlp/menu.c:287
+msgid "Algorithm number:"
+msgstr "Número algoritmo"
+
+#: ../ui-hlp/menu.c:288
+msgid "Seed:"
+msgstr "Semente"
+
+#: ../ui-hlp/menu.c:289
+msgid "Shift:"
+msgstr "Trocar"
+
+#: ../ui-hlp/menu.c:293
+#, fuzzy
+msgid "Frames per second:"
+msgstr "Quadros por segundo"
+
+#: ../ui-hlp/menu.c:302
+#, fuzzy
+msgid "Initialization:"
+msgstr "Inicialização"
+
+#: ../ui-hlp/menu.c:357
+msgid "renderanim: Must specify a valid absolute path for basename"
+msgstr ""
+"Processar animação: especificar um caminho absolutamente válido para o nome "
+"base"
+
+#: ../ui-hlp/menu.c:364
+msgid ""
+"renderanim: Width parameter must be positive integer in the range 0..4096"
+msgstr ""
+"Processar animação: o valor da extensão deve ser um número inteiro positivo "
+"no intervalo 0 .. 4096"
+
+#: ../ui-hlp/menu.c:370
+msgid ""
+"renderanim: Height parameter must be positive integer in the range 0..4096"
+msgstr ""
+"Processar animação: o valor da altura deve ser um número inteiro positivo no "
+"intervalo 0 .. 4096"
+
+#: ../ui-hlp/menu.c:376
+msgid "renderanim: Invalid real width and height dimensions"
+msgstr "processar animação: Extensão e altura reais inválidas"
+
+#: ../ui-hlp/menu.c:380
+msgid "renderanim: invalid framerate"
+msgstr "processar animação: velocidade de quadro inválida"
+
+#: ../ui-hlp/menu.c:386
+msgid "renderanim: antialiasing not supported in 256 color mode"
+msgstr ""
+"processar animação: anti-serrilhamento não suportado no modo de 256 cores"
+
+#: ../ui-hlp/menu.c:390
+msgid "renderanim: incorrect I frame distance"
+msgstr "processar animação: distância incorreta do quadro I"
+
+#: ../ui-hlp/menu.c:441 ../ui-hlp/menu.c:454
+msgid "animateview: Invalid viewpoint"
+msgstr "visualizar animação: paradigma inválido"
+
+#: ../ui-hlp/menu.c:467
+msgid "Invalid viewpoint"
+msgstr "Paradigma inválido"
+
+#: ../ui-hlp/menu.c:696
+#, fuzzy
+msgid "Unknown palette type"
+msgstr "Tipo de paleta desconhecida"
+
+#: ../ui-hlp/menu.c:771 ../ui-hlp/menu.c:785
+msgid "Initialization of color cycling failed."
+msgstr "Falha na inicialização de troca de cor"
+
+#: ../ui-hlp/menu.c:773 ../ui-hlp/menu.c:787
+msgid "Try to enable palette emulation filter"
+msgstr "Tente habilitar a paleta de simulação"
+
+#: ../ui-hlp/menu.c:896
+#, c-format
+msgid "Algorithm:%i seed:%i size:%i"
+msgstr "Algoritmo:%i semente:%i tamanho:%i"
+
+#: ../ui-hlp/menu.c:947
+msgid "Root menu"
+msgstr "Menu da raiz"
+
+#: ../ui-hlp/menu.c:948
+msgid "Animation root menu"
+msgstr "Menu da raiz da animação"
+
+#: ../ui-hlp/menu.c:949
+msgid "Replay only commands"
+msgstr "Repetir somente instruções"
+
+#: ../ui-hlp/menu.c:950
+msgid "Command line options only"
+msgstr "Somente opções da linha de instruções"
+
+#: ../ui-hlp/menu.c:953
+msgid "print menus specifications of all menus"
+msgstr "imprima os menus de especificações de todos os menus"
+
+#: ../ui-hlp/menu.c:958
+msgid "print menu specification"
+msgstr "Imprima a especificação do menu"
+
+#: ../ui-hlp/menu.c:961
+msgid "print menu specification in xshl format"
+msgstr "imprima a especificação do menu em formato xshl"
+
+#: ../ui-hlp/menu.c:965
+msgid "print all menu specifications in xshl format"
+msgstr "imprima todas as especificações do menu em formato xshl"
+
+#: ../ui-hlp/menu.c:967
+msgid "print dialog specification"
+msgstr "imprima a especificação do diálogo"
+
+#: ../ui-hlp/menu.c:972
+msgid "Line drawing functions"
+msgstr "Funções para desenhar linhas"
+
+#: ../ui-hlp/menu.c:973
+msgid "Line"
+msgstr "Linha"
+
+#: ../ui-hlp/menu.c:976
+#, fuzzy
+msgid "Morph line"
+msgstr "Trocar a linha"
+
+#: ../ui-hlp/menu.c:978
+msgid "Morph last line"
+msgstr "Trocar a última linha"
+
+#: ../ui-hlp/menu.c:981
+#, fuzzy
+msgid "Set line key"
+msgstr "Estabelecer a linha chave"
+
+#: ../ui-hlp/menu.c:983
+msgid "Clear line"
+msgstr "Limpar a linha"
+
+#: ../ui-hlp/menu.c:986
+msgid "Clear all lines"
+msgstr "Limpar todas as linhas"
+
+#: ../ui-hlp/menu.c:988
+msgid "Animation functions"
+msgstr "Funções de animação"
+
+#: ../ui-hlp/menu.c:989 ../ui-hlp/menu.c:1181 ../ui-hlp/menu.c:1190
+msgid "View"
+msgstr "Visualizar"
+
+#: ../ui-hlp/menu.c:993
+msgid "Morph view"
+msgstr "Trocar a visualização"
+
+#: ../ui-hlp/menu.c:995
+msgid "Morph julia"
+msgstr "Trocar para o modo Julia"
+
+#: ../ui-hlp/menu.c:1000
+msgid "Move view"
+msgstr "Mover a visualização"
+
+#: ../ui-hlp/menu.c:1002
+#, fuzzy
+msgid "Morph angle"
+msgstr "Trocar o ângulo"
+
+#: ../ui-hlp/menu.c:1004
+msgid "Zoom center"
+msgstr "Centro de ampliação"
+
+#: ../ui-hlp/menu.c:1006 ../ui/ui-drv/cocoa/AppController.m:343
+msgid "Zoom"
+msgstr "Ampliar"
+
+#: ../ui-hlp/menu.c:1007
+msgid "Un-zoom"
+msgstr "Reduzir"
+
+#: ../ui-hlp/menu.c:1010
+msgid "Stop zooming"
+msgstr "Pare a ampliação"
+
+#: ../ui-hlp/menu.c:1011
+msgid "Smooth morphing parameters"
+msgstr "Trocar suavemente os parâmetros"
+
+#: ../ui-hlp/menu.c:1014
+msgid "Timing functions"
+msgstr "Funções de tempo"
+
+#: ../ui-hlp/menu.c:1015
+msgid "Usleep"
+msgstr "Atrasar"
+
+#: ../ui-hlp/menu.c:1018
+msgid "Wait for text"
+msgstr "Espere pelo texto"
+
+#: ../ui-hlp/menu.c:1020
+msgid "Wait for complete image"
+msgstr "Espere pela imagem completa"
+
+#: ../ui-hlp/menu.c:1022
+msgid "Include file"
+msgstr "Incluir arquivo"
+
+#: ../ui-hlp/menu.c:1024 ../ui-hlp/menu.c:1222
+msgid "Default palette"
+msgstr "Paleta padrão"
+
+#: ../ui-hlp/menu.c:1026
+msgid "Formula"
+msgstr "Fórmula"
+
+#: ../ui-hlp/menu.c:1028
+msgid "Maximal zooming step"
+msgstr "Ampliação máxima"
+
+#: ../ui-hlp/menu.c:1030
+msgid "Zooming speedup"
+msgstr "Ampliação acelerada"
+
+#: ../ui-hlp/menu.c:1032
+msgid "Filter"
+msgstr "Filtro"
+
+#: ../ui-hlp/menu.c:1036 ../ui-hlp/menu.c:1041
+msgid "Letters per second"
+msgstr "Letras por segundo"
+
+#: ../ui-hlp/menu.c:1043 ../ui-hlp/menu.c:1314
+msgid "Interrupt"
+msgstr "Interromper"
+
+#: ../ui-hlp/menu.c:1045 ../ui-hlp/menu.c:1057
+msgid "File"
+msgstr "Arquivo"
+
+#: ../ui-hlp/menu.c:1046
+msgid "Edit"
+msgstr "Editar"
+
+#: ../ui-hlp/menu.c:1047
+msgid "Fractal"
+msgstr "Fractal"
+
+#: ../ui-hlp/menu.c:1048
+msgid "Calculation"
+msgstr "Cálculo"
+
+#: ../ui-hlp/menu.c:1049 ../ui-hlp/menu.c:1391
+msgid "Filters"
+msgstr "Filtros"
+
+#: ../ui-hlp/menu.c:1050 ../ui-hlp/menu.c:1064
+msgid "UI"
+msgstr "UI"
+
+#: ../ui-hlp/menu.c:1051
+msgid "Misc"
+msgstr "Misc"
+
+#: ../ui-hlp/menu.c:1053
+#, fuzzy
+msgid "Window"
+msgstr "Janela"
+
+#: ../ui-hlp/menu.c:1056
+msgid "Tutorials"
+msgstr "Tutoriais"
+
+#: ../ui-hlp/menu.c:1062
+msgid "Stop replay"
+msgstr "Parar a repetição"
+
+#: ../ui-hlp/menu.c:1066
+msgid "Command"
+msgstr "Instrução"
+
+#: ../ui-hlp/menu.c:1068
+msgid "Play string"
+msgstr "Mostrar a série"
+
+#: ../ui-hlp/menu.c:1070
+msgid "Render animation"
+msgstr "Processar animação"
+
+#: ../ui-hlp/menu.c:1073
+msgid "Clear screen"
+msgstr "Limpar a tela"
+
+#: ../ui-hlp/menu.c:1075
+msgid "Display fractal"
+msgstr "Exibir o fractal"
+
+#: ../ui-hlp/menu.c:1078
+msgid "Display text"
+msgstr "Exibir o texto"
+
+#: ../ui-hlp/menu.c:1080
+#, fuzzy
+msgid "Color"
+msgstr "Cor"
+
+#: ../ui-hlp/menu.c:1082
+msgid "Horizontal text position"
+msgstr "Posição de texto horizontal"
+
+#: ../ui-hlp/menu.c:1084
+msgid "Vertical text position"
+msgstr "Posição de texto vertical "
+
+#: ../ui-hlp/menu.c:1086
+msgid "Text position"
+msgstr "Posição do texto"
+
+#: ../ui-hlp/menu.c:1090
+msgid "Message"
+msgstr "Mensagem"
+
+#: ../ui-hlp/menu.c:1112
+msgid "Load"
+msgstr "Carregar"
+
+#: ../ui-hlp/menu.c:1115
+msgid "Save"
+msgstr "Salvar"
+
+#: ../ui-hlp/menu.c:1117
+msgid "Record"
+msgstr "Gravar"
+
+#: ../ui-hlp/menu.c:1121
+msgid "Replay"
+msgstr "Repetir"
+
+#: ../ui-hlp/menu.c:1128
+msgid "Save image"
+msgstr "Salvar a imagem"
+
+#: ../ui-hlp/menu.c:1130
+msgid "Load random example"
+msgstr "Carregar exemplo aleatório"
+
+#: ../ui-hlp/menu.c:1132
+msgid "Save configuration"
+msgstr "Salvar configuração"
+
+#: ../ui-hlp/menu.c:1137
+msgid "Undo"
+msgstr "Desfazer"
+
+#: ../ui-hlp/menu.c:1141
+msgid "Redo"
+msgstr "Refazer"
+
+#: ../ui-hlp/menu.c:1145
+msgid "Formulae"
+msgstr "Fórmulas"
+
+#: ../ui-hlp/menu.c:1146
+#, fuzzy
+msgid "More formulae"
+msgstr "Mais fórmulas"
+
+#: ../ui-hlp/menu.c:1151
+#, fuzzy
+msgid "User formula"
+msgstr "Fórmula usuário"
+
+#: ../ui-hlp/menu.c:1153
+#, fuzzy
+msgid "User initialization"
+msgstr "Inicialização usuário"
+
+#: ../ui-hlp/menu.c:1158
+msgid "Incoloring mode"
+msgstr "Modo de cor interna"
+
+#: ../ui-hlp/menu.c:1159
+msgid "Outcoloring mode"
+msgstr "Modo de cor externa"
+
+#: ../ui-hlp/menu.c:1160
+msgid "Plane"
+msgstr "Plano"
+
+#: ../ui-hlp/menu.c:1161
+#, fuzzy
+msgid "Palette"
+msgstr "Paleta"
+
+#: ../ui-hlp/menu.c:1164
+msgid "Mandelbrot mode"
+msgstr "Modo Mandelbrot"
+
+#: ../ui-hlp/menu.c:1170 ../ui-hlp/menu.c:1174 ../ui-hlp/menu.c:1395
+msgid "Perturbation"
+msgstr "Distorção"
+
+#: ../ui-hlp/menu.c:1185
+msgid "Reset to defaults"
+msgstr "Restabelecer valores padrão"
+
+#: ../ui-hlp/menu.c:1186
+msgid "Julia mode"
+msgstr "Modo Julia"
+
+#: ../ui-hlp/menu.c:1193
+msgid "Set angle"
+msgstr "Estabelecer o ângulo"
+
+#: ../ui-hlp/menu.c:1197
+msgid "Set plane"
+msgstr "Estabelecer o plano"
+
+#: ../ui-hlp/menu.c:1201
+msgid "Inside coloring mode"
+msgstr "Modo de cor interna"
+
+#: ../ui-hlp/menu.c:1206
+msgid "Outside coloring mode"
+msgstr "Modo de cor externa"
+
+#: ../ui-hlp/menu.c:1212
+msgid "Inside truecolor coloring mode"
+msgstr "Modo truecolor de cor interna"
+
+#: ../ui-hlp/menu.c:1216
+msgid "Outside truecolor coloring mode"
+msgstr "Modo truecolor de cor externa"
+
+#: ../ui-hlp/menu.c:1219
+msgid "Julia seed"
+msgstr "Semente de Julia"
+
+#: ../ui-hlp/menu.c:1224
+msgid "Random palette"
+msgstr "Paleta aleatória"
+
+#: ../ui-hlp/menu.c:1226
+msgid "Custom palette"
+msgstr "Paleta regular"
+
+#: ../ui-hlp/menu.c:1230
+msgid "Color cycling"
+msgstr "Trocar a cor:"
+
+#: ../ui-hlp/menu.c:1232
+msgid "Reversed color cycling"
+msgstr "Reverter a troca de cor"
+
+#: ../ui-hlp/menu.c:1237
+msgid "Color cycling speed"
+msgstr "Velocidade da troca de cor"
+
+#: ../ui-hlp/menu.c:1241
+msgid "Shift palette"
+msgstr "Trocar paleta"
+
+#: ../ui-hlp/menu.c:1243
+msgid "Shift one forward"
+msgstr "Avançar um"
+
+#: ../ui-hlp/menu.c:1246
+msgid "Shift one backward"
+msgstr "Voltar um"
+
+#: ../ui-hlp/menu.c:1248 ../engine/zoom.c:1357
+msgid "Solid guessing"
+msgstr "Simulação tridimensional"
+
+#: ../ui-hlp/menu.c:1249
+msgid "Dynamic resolution"
+msgstr "Resolução dinâmica"
+
+#: ../ui-hlp/menu.c:1251
+msgid "Periodicity checking"
+msgstr "Periodicidade de verificação"
+
+#: ../ui-hlp/menu.c:1254
+msgid "Iterations"
+msgstr "Iterações"
+
+#: ../ui-hlp/menu.c:1256
+msgid "Bailout"
+msgstr "Bailout"
+
+#: ../ui-hlp/menu.c:1260
+msgid "Fast julia mode"
+msgstr "Modo rápido de Julia"
+
+#: ../ui-hlp/menu.c:1262
+msgid "Rotation"
+msgstr "Rotação"
+
+#: ../ui-hlp/menu.c:1263
+msgid "Solid guessing range"
+msgstr " Cadeia de simulação tridimensional"
+
+#: ../ui-hlp/menu.c:1266
+msgid "Disable rotation"
+msgstr "Desabilitar rotação"
+
+#: ../ui-hlp/menu.c:1270
+msgid "Continuous rotation"
+msgstr "Rotação continua"
+
+#: ../ui-hlp/menu.c:1273
+msgid "Rotate by mouse"
+msgstr "Gire com o mouse"
+
+#: ../ui-hlp/menu.c:1277
+msgid "Rotation speed"
+msgstr "Velocidade de rotação"
+
+#: ../ui-hlp/menu.c:1280
+msgid "Automatic rotation"
+msgstr "Rotação automática"
+
+#: ../ui-hlp/menu.c:1285
+msgid "Fast rotation mode"
+msgstr "Modo rápido de rotação"
+
+#: ../ui-hlp/menu.c:1289
+msgid "Disable dynamic resolution"
+msgstr "Desabilitar resolução dinâmica"
+
+#: ../ui-hlp/menu.c:1292
+msgid "Use only during animation"
+msgstr "Utilizar somente durante a animação"
+
+#: ../ui-hlp/menu.c:1296
+msgid "Use also for new images"
+msgstr "Utilizar também para novas imagens"
+
+#: ../ui-hlp/menu.c:1298
+msgid "Dynamic resolution mode"
+msgstr "Modo de resolução dinâmica"
+
+#: ../ui-hlp/menu.c:1302
+msgid "Autopilot"
+msgstr "Piloto automático"
+
+#: ../ui-hlp/menu.c:1306
+#, fuzzy
+msgid "VJ mode"
+msgstr "Modo VJ"
+
+#: ../ui-hlp/menu.c:1310
+msgid "Recalculate"
+msgstr "Recalcular"
+
+#: ../ui-hlp/menu.c:1319
+msgid "Zooming speed"
+msgstr "Velocidade da ampliação"
+
+#: ../ui-hlp/menu.c:1321
+msgid "Fixed step"
+msgstr "Passo fixo"
+
+#: ../ui-hlp/menu.c:1325
+msgid "Disable solid guessing"
+msgstr "Desabilitar simulação tridimensional"
+
+#: ../ui-hlp/menu.c:1329
+msgid "Guess 2x2 rectangles"
+msgstr "Simular retângulos 2x2"
+
+#: ../ui-hlp/menu.c:1331
+msgid "Guess 3x3 rectangles"
+msgstr "Simular retângulos 3x3"
+
+#: ../ui-hlp/menu.c:1335
+msgid "Guess 4x4 rectangles"
+msgstr "Simular retângulos 4x4"
+
+#: ../ui-hlp/menu.c:1337
+msgid "Guess 5x5 rectangles"
+msgstr "Simular retângulos 5x5"
+
+#: ../ui-hlp/menu.c:1341
+msgid "Guess 6x6 rectangles"
+msgstr "Simular retângulos 6x6"
+
+#: ../ui-hlp/menu.c:1343
+msgid "Guess 7x7 rectangles"
+msgstr "Simular retângulos 7x7"
+
+#: ../ui-hlp/menu.c:1347
+msgid "Guess 8x8 rectangles"
+msgstr "Simular retângulos 8x8"
+
+#: ../ui-hlp/menu.c:1349
+msgid "Guess unlimited rectangles"
+msgstr "Simular retângulos ilimitados"
+
+#: ../ui-hlp/menu.c:1354
+msgid "Language"
+msgstr "Idioma"
+
+#: ../ui-hlp/menu.c:1357
+msgid "An introduction to fractals"
+msgstr "Uma introdução aos fractais"
+
+#: ../ui-hlp/menu.c:1359
+msgid "XaoS features overview"
+msgstr "Resumo das características do XaoS"
+
+#: ../ui-hlp/menu.c:1361
+msgid "Math behind fractals"
+msgstr "Matemática por trás dos fractais"
+
+#: ../ui-hlp/menu.c:1362 ../ui-hlp/menu.c:1403
+msgid "Other fractal types in XaoS"
+msgstr "Outros tipos de fractais do Xaos"
+
+#: ../ui-hlp/menu.c:1364
+msgid "What's new?"
+msgstr "Novidades?"
+
+#: ../ui-hlp/menu.c:1374 ../ui-hlp/menu.c:1398
+msgid "Whole story"
+msgstr "A história completa"
+
+#: ../ui-hlp/menu.c:1376
+msgid "Introduction"
+msgstr "Introdução"
+
+#: ../ui-hlp/menu.c:1377
+msgid "Mandelbrot set"
+msgstr "Conjunto Mandelbrot"
+
+#: ../ui-hlp/menu.c:1378
+msgid "Julia set"
+msgstr "Conjunto Julia"
+
+#: ../ui-hlp/menu.c:1379
+msgid "Higher power Mandelbrots"
+msgstr "Mandelbrots de maiores potências"
+
+#: ../ui-hlp/menu.c:1380
+msgid "Newton's method"
+msgstr "Método de Newton"
+
+#: ../ui-hlp/menu.c:1381
+msgid "Barnsley's formula"
+msgstr "Fórmula de Barnsley"
+
+#: ../ui-hlp/menu.c:1382
+msgid "Phoenix"
+msgstr "Phoenix"
+
+#: ../ui-hlp/menu.c:1383
+msgid "Octo"
+msgstr "Octo"
+
+#: ../ui-hlp/menu.c:1384
+msgid "Magnet"
+msgstr "Magnet"
+
+#: ../ui-hlp/menu.c:1385
+msgid "All features"
+msgstr "Todas as características"
+
+#: ../ui-hlp/menu.c:1387
+#, fuzzy
+msgid "Outcoloring modes"
+msgstr "Modo de cor externa"
+
+#: ../ui-hlp/menu.c:1388
+#, fuzzy
+msgid "Incoloring modes"
+msgstr "Modo de cor interna"
+
+#: ../ui-hlp/menu.c:1389
+#, fuzzy
+msgid "True-color coloring modes"
+msgstr "Modo de cor interna true-color"
+
+#: ../ui-hlp/menu.c:1392
+msgid "Planes"
+msgstr "Planos"
+
+#: ../ui-hlp/menu.c:1393
+msgid "Animations and position files"
+msgstr "Arquivos de animações e posição"
+
+#: ../ui-hlp/menu.c:1396
+msgid "Random palettes"
+msgstr "Paletas aleatórias"
+
+#: ../ui-hlp/menu.c:1397
+msgid "Other noteworthy features"
+msgstr "Outras características relevantes"
+
+#: ../ui-hlp/menu.c:1400
+msgid "The definition and fractal dimension"
+msgstr "A definição e dimensão do fractal"
+
+#: ../ui-hlp/menu.c:1402
+#, fuzzy
+msgid "Escape time fractals"
+msgstr "Fractais escape time"
+
+#: ../ui-hlp/menu.c:1406
+msgid "Triceratops and Catseye fractals"
+msgstr "Fractal Triceratops e Catseye"
+
+#: ../ui-hlp/menu.c:1408
+msgid "Mandelbar, Lambda, Manowar and Spider"
+msgstr "Mandelbar, Lambda, Manowar e Spider"
+
+#: ../ui-hlp/menu.c:1411
+msgid "Sierpinski Gasket, S.Carpet, Koch Snowflake"
+msgstr "Sierpinski Gasket, S. Carpet e Floco de Neve de Koch"
+
+#: ../ui-hlp/menu.c:1413
+msgid "What's new in 3.0?"
+msgstr "Quais são as novidades da versão 3.0?"
+
+#: ../ui-hlp/play.c:74
+#, fuzzy
+msgid "line available only in animation replay"
+msgstr "Linha disponível somente na repetição da animação"
+
+#: ../ui-hlp/play.c:99
+msgid "Morphing non existing line!"
+msgstr "Alterando linha não existente"
+
+#: ../ui-hlp/play.c:121
+msgid "linekey not available in this context!"
+msgstr "Linha chave não disponível neste contexto"
+
+#: ../ui-hlp/play.c:291
+#, fuzzy
+msgid "clear_line available only in animation replay"
+msgstr "Limpar _ linha disponível apenas na repetição da animação"
+
+#: ../ui-hlp/play.c:300
+#, fuzzy
+msgid "clear_lines available only in animation replay"
+msgstr "Limpar _ linhas disponíveis apenas na repetição da animação"
+
+#: ../ui-hlp/play.c:359
+msgid "Catalog file not found"
+msgstr "Arquivo de catálogo não encontrado"
+
+#: ../ui-hlp/play.c:405
+msgid "Replay is already active"
+msgstr "Repetição já está ligada"
+
+#: ../ui-hlp/play.c:409
+#, fuzzy
+msgid "File open failed"
+msgstr "Falha ao abrir arquivo"
+
+#: ../ui-hlp/play.c:414
+#, fuzzy
+msgid "Out of memory"
+msgstr "Sem memória"
+
+#: ../ui-hlp/play.c:526 ../ui-hlp/play.c:542 ../ui-hlp/play.c:566
+#: ../ui-hlp/play.c:595
+msgid "Missing parameter"
+msgstr "Perdendo parâmetro"
+
+#: ../ui-hlp/play.c:528 ../ui-hlp/play.c:544 ../ui-hlp/play.c:568
+#: ../ui-hlp/play.c:597
+msgid "Unexpected end of file"
+msgstr "Finalização de arquivo inesperada"
+
+#: ../ui-hlp/play.c:555 ../ui-hlp/play.c:574
+msgid "Token is too long"
+msgstr "O sinal é muito longo"
+
+#: ../ui-hlp/play.c:629
+#, fuzzy
+msgid "Unknown formula type"
+msgstr "Tipo de fórmula desconhecida"
+
+#: ../ui-hlp/play.c:635
+#, fuzzy
+msgid "morph available only in animation replay"
+msgstr "transformação disponível apenas na repetição da animação"
+
+#: ../ui-hlp/play.c:639
+msgid "morphview: Invalid viewpoint"
+msgstr "visualização da transformação: paradigma inválido"
+
+#: ../ui-hlp/play.c:653
+#, fuzzy
+msgid "move available only in animation replay"
+msgstr "Movimento disponível apenas na repetição da animação"
+
+#: ../ui-hlp/play.c:667
+#, fuzzy
+msgid "morphjulia available only in animation replay"
+msgstr "Transformação para Julia disponível somente na repetição da animação"
+
+#: ../ui-hlp/play.c:680
+#, fuzzy
+msgid "morphangle available only in animation replay"
+msgstr "Mudança de ângulo disponível somente na repetição da animação"
+
+#: ../ui-hlp/play.c:712
+#, fuzzy
+msgid "Unknown filter"
+msgstr "Filtro desconhecido"
+
+#: ../ui-hlp/play.c:753
+#, fuzzy
+msgid "sleep available only in animation replay"
+msgstr "Descanso disponível somente na repetição da animação"
+
+#: ../ui-hlp/play.c:767
+#, c-format
+msgid "Internal program error #12 %i\n"
+msgstr "Erro de programa interno #12 %i\n"
+
+#: ../ui-hlp/play.c:788
+#, fuzzy
+msgid "wait available only in animation replay"
+msgstr "Espera disponível somente na repetição da animação"
+
+#: ../ui-hlp/play.c:834
+msgid "No catalog file loaded"
+msgstr "Nenhum arquivo do catálogo carregado"
+
+#: ../ui-hlp/play.c:839
+msgid "Message not found in catalog file"
+msgstr ""
+
+#: ../ui-hlp/play.c:850
+#, fuzzy
+msgid "load available only in animation replay"
+msgstr "Carregar disponível somente na repetição da animação"
+
+#: ../ui-hlp/play.c:854
+msgid "Include level overflow"
+msgstr "Incluir superávit"
+
+#: ../ui-hlp/play.c:863
+msgid "File not found"
+msgstr "Arquivo não encontrado"
+
+#: ../ui-hlp/play.c:881
+msgid "Too many parameters"
+msgstr "Excesso de parâmetros"
+
+#: ../ui-hlp/play.c:916
+#, c-format
+msgid "Replay disabled at line %i"
+msgstr "Repetição desabilitada na linha %i"
+
+#: ../ui-hlp/ui_helper.c:646
+msgid "Tutorial files not found. Reinstall XaoS"
+msgstr "Arquivos de tutoriais não encontrados. Reinstale o Xaos"
+
+#: ../ui-hlp/ui_helper.c:651
+msgid "Preparing first image"
+msgstr "Preparando a primeira imagem"
+
+#: ../ui-hlp/ui_helper.c:661
+#, fuzzy
+msgid "Could not open examples"
+msgstr "Não pode abrir os exemplos"
+
+#: ../ui-hlp/ui_helper.c:667
+#, c-format
+msgid "File %s loaded."
+msgstr "Arquivo %s carregado"
+
+#: ../ui-hlp/ui_helper.c:676
+#, fuzzy
+msgid "Saving image..."
+msgstr "Salvando imagem"
+
+#: ../ui-hlp/ui_helper.c:684
+#, fuzzy
+msgid "Save interrupted"
+msgstr "Interrupção na ação de salvar"
+
+#: ../ui-hlp/ui_helper.c:693 ../ui-hlp/ui_helper.c:710
+#: ../ui-hlp/ui_helper.c:777
+#, c-format
+msgid "File %s saved."
+msgstr "Arquivo %s salvo"
+
+#: ../ui-hlp/ui_helper.c:704
+#, fuzzy
+msgid "Can not open file"
+msgstr "Não pode abrir o arquivo"
+
+#: ../ui-hlp/ui_helper.c:799
+#, c-format
+msgid "Recording to file %s enabled."
+msgstr "Gravando para arquivar %s habilitada"
+
+#: ../engine/zoom.c:1128
+msgid "Solid guessing 1"
+msgstr "Simulação tridimensional"
+
+#: ../engine/btrace.c:292 ../engine/btrace.c:373
+msgid "Boundary trace"
+msgstr "Sinal do perímetro"
+
+#: ../ui/dialog.c:312 ../ui/dialog.c:398 ../ui/dialog.c:1377
+#: ../ui/ui-drv/cocoa/CustomDialog.m:302
+msgid "OK"
+msgstr "Certo"
+
+#: ../ui/dialog.c:313 ../ui/dialog.c:401 ../ui/dialog.c:1379
+#: ../ui/filesel.c:184 ../ui/ui-drv/cocoa/CustomDialog.m:312
+msgid "Cancel"
+msgstr "Cancelar"
+
+#: ../ui-hlp/render.c:46
+#, c-format
+msgid "Error: %s"
+msgstr "Erro: %s"
+
+#: ../ui-hlp/render.c:121
+#, fuzzy
+msgid "Cannot open motion vector file!"
+msgstr "Não pode abrir o arquivo vetor de movimento"
+
+#: ../ui-hlp/render.c:270
+#, c-format
+msgid "Vectors: %i"
+msgstr "Vetores: %i"
+
+#: ../ui-hlp/render.c:276
+#, fuzzy
+msgid "Initializing"
+msgstr "Inicializando"
+
+#: ../ui-hlp/render.c:284
+#, fuzzy
+msgid "Cannot create palette"
+msgstr "Não pode criar a paleta"
+
+#: ../ui-hlp/render.c:295
+#, fuzzy
+msgid "Cannot create image\n"
+msgstr "Não pode criar a imagem\n"
+
+#: ../ui-hlp/render.c:304
+#, fuzzy
+msgid "Cannot create checking buffer!"
+msgstr "Não pode criar verifcação de buffer"
+
+#: ../ui-hlp/render.c:313 ../ui-hlp/render.c:596
+#, fuzzy
+msgid "Cannot create context\n"
+msgstr "Não pode criar o contexto"
+
+#: ../ui-hlp/render.c:325
+#, fuzzy
+msgid "Cannot open animation file\n"
+msgstr "Não pode abrir o arquivo de animação\n"
+
+#: ../ui-hlp/render.c:336 ../ui-hlp/render.c:605
+msgid "Loading catalogs"
+msgstr "Carregando catálogos"
+
+#: ../ui-hlp/render.c:366
+#, fuzzy
+msgid "Processing command line options"
+msgstr "Processando as opções de linha de instruções"
+
+#: ../ui-hlp/render.c:389
+#, fuzzy
+msgid "Enabling animation replay\n"
+msgstr "Habilitando a repetição da animação"
+
+#: ../ui-hlp/render.c:396 ../ui-hlp/render.c:514
+#, fuzzy
+msgid "Cannot open image file"
+msgstr "Não pode abrir o arquivo de imagem"
+
+#: ../ui-hlp/render.c:410
+#, fuzzy
+msgid "Cannot open pattern file"
+msgstr "Não pode abrir o arquivo padrão "
+
+#: ../ui-hlp/render.c:427 ../ui-hlp/render.c:429 ../ui-hlp/render.c:638
+msgid "Entering calculation loop!"
+msgstr "Entrada de cálculo"
+
+#: ../ui-hlp/render.c:455
+#, c-format
+msgid "Frame %i skipped."
+msgstr "O quadro %i foi pulado"
+
+#: ../ui-hlp/render.c:457
+#, c-format
+msgid "Frames %i - %i skipped."
+msgstr "Os quadros %i - %i foram pulados"
+
+#: ../ui-hlp/render.c:461
+#, c-format
+msgid "Frame %4i: "
+msgstr "Quadro %4i"
+
+#: ../ui-hlp/render.c:528
+msgid " done."
+msgstr "Pronto"
+
+#: ../ui-hlp/render.c:532
+msgid " skipping..."
+msgstr "Pulando..."
+
+#: ../ui-hlp/render.c:565 ../ui-hlp/render.c:657
+#, fuzzy
+msgid "Calculation interrupted"
+msgstr "Cálculo interrompido"
+
+#: ../ui-hlp/render.c:568 ../ui-hlp/render.c:570 ../ui-hlp/render.c:659
+#, fuzzy
+msgid "Calculation finished"
+msgstr "Cálculo finalizado"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1292 ../ui/ui-drv/cocoa/AppController.m:321
+msgid "Copy"
+msgstr "Copiar"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1293 ../ui/ui-drv/cocoa/AppController.m:324
+#, fuzzy
+msgid "Paste"
+msgstr "Colar"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1297
+msgid "About"
+msgstr "Sobre"
+
+#: ../ui/ui-drv/cocoa/AppController.m:197
+msgid "About XaoS"
+msgstr "Sobre o Xaos"
+
+#: ../ui/ui-drv/cocoa/AppController.m:200
+msgid "Services"
+msgstr "Utilidades"
+
+#: ../ui/ui-drv/cocoa/AppController.m:203
+msgid "Hide XaoS"
+msgstr "Ocultar o Xaos"
+
+#: ../ui/ui-drv/cocoa/AppController.m:206
+msgid "Hide Others"
+msgstr "Ocultar outros"
+
+#: ../ui/ui-drv/cocoa/AppController.m:209
+msgid "Show All"
+msgstr "Mostrar tudo"
+
+#: ../ui/ui-drv/cocoa/AppController.m:212
+#, fuzzy
+msgid "Quit XaoS"
+msgstr "Sair do Xaos"
+
+#: ../ui/ui-drv/cocoa/AppController.m:318
+msgid "Cut"
+msgstr "Cortar"
+
+#: ../ui/ui-drv/cocoa/AppController.m:327
+#, fuzzy
+msgid "Delete"
+msgstr "Apagar"
+
+#: ../ui/ui-drv/cocoa/AppController.m:330
+msgid "Select All"
+msgstr "Selecionar tudo"
+
+#: ../ui/ui-drv/cocoa/AppController.m:340
+msgid "Minimize"
+msgstr "Minimizar"
+
+#: ../ui/ui-drv/cocoa/AppController.m:348
+msgid "Bring All to Front"
+msgstr "Traga tudo para a frente"
+
+#: ../ui/ui-drv/cocoa/AppController.m:359
+#, fuzzy
+msgid "Close"
+msgstr "Aproximar"
+
+#: ../ui/ui-drv/cocoa/AppController.m:373
+msgid "Videator Output"
+msgstr "Saída de videator"
+
+#: ../ui/ui-drv/cocoa/CustomDialog.m:142
+msgid "Choose"
+msgstr "Selecionar"
+
+#~ msgid "formulae"
+#~ msgstr "Fórmulas"
+
+#~ msgid "Can not create context\n"
+#~ msgstr "Não pode criar o contexto\n"
diff --git a/src/i18n/ro.po b/src/i18n/ro.po
new file mode 100644
index 0000000..ef45c43
--- /dev/null
+++ b/src/i18n/ro.po
@@ -0,0 +1,1504 @@
+# XaoS NLS file for German language.
+# Copyright (C) 2002 Free Software Foundation, Inc.
+# Zoltan Kovacs <kovzol@math.u-szeged.hu>, 2002.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: XaoS 3.4\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-11-14 10:56+0100\n"
+"PO-Revision-Date: 2008-04-28 11:21+0100\n"
+"Last-Translator: Zoltan Kovacs <kovzol@matek.hu>\n"
+"Language-Team: The XaoS Development Team <xaos-devel@lists.sf.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 0.7\n"
+"X-Poedit-Language: Romanian\n"
+"X-Poedit-Country: ROMANIA\n"
+"X-Poedit-SourceCharset: utf-8\n"
+
+#: ../ui/ui.c:314
+msgid "XaoS is out of memory."
+msgstr "XaoS nu are suficienta memorie"
+
+#: ../ui/ui.c:360
+#, c-format
+msgid "%s %.2f times (%.1fE) %2.2f frames/sec %c %i %i %i %i "
+msgstr "%s %.2f ori (%.1fE) %2.2f cadre/sec %c %i %i %i %i "
+
+#: ../ui/ui.c:361
+msgid "unzoomed"
+msgstr "nemarit (unzoomed):"
+
+#: ../ui/ui.c:361
+msgid "zoomed"
+msgstr "marit (zoomed):"
+
+#: ../ui/ui.c:369
+#, c-format
+msgid "framerate:%f\n"
+msgstr "frecventa cadrelor: %f\n"
+
+#: ../ui/ui.c:409
+#, c-format
+msgid "Enabling: %s. "
+msgstr "%s se activeaza."
+
+#: ../ui/ui.c:411
+#, c-format
+msgid "Disabling: %s. "
+msgstr "%s se dezactiveaza."
+
+#: ../ui/ui.c:441
+#, c-format
+msgid "Fractal name:%s"
+msgstr "Numele fractalului:%s"
+
+#: ../ui/ui.c:446
+#, c-format
+msgid "Fractal type:%s"
+msgstr "Tipul fractalului:%s"
+
+#: ../ui/ui.c:448
+msgid "Mandelbrot"
+msgstr "Mandelbrot"
+
+#: ../ui/ui.c:449
+msgid "Julia"
+msgstr "Julia"
+
+#: ../ui/ui.c:452
+#, fuzzy, c-format
+msgid "Formula:%s"
+msgstr "Formula:"
+
+#: ../ui/ui.c:457
+#, c-format
+msgid "View:[%1.12f,%1.12f]"
+msgstr "Vedere:[%1.12f,%1.12f]"
+
+#: ../ui/ui.c:461
+#, c-format
+msgid "size:[%1.12f,%1.12f]"
+msgstr "Dimensiune:[%1.12f,%1.12f]"
+
+#: ../ui/ui.c:465
+#, c-format
+msgid "Rotation:%4.2f Screen size:%i:%i"
+msgstr "Rotatie:%4.2f Dimensiunea ecranului:%i:%i"
+
+#: ../ui/ui.c:470
+#, c-format
+msgid "Iterations:%-4i Palette size:%i"
+msgstr "Iteratii:%-4i Dimensiunea paletei:%i"
+
+#: ../ui/ui.c:477
+#, c-format
+msgid "Autopilot:%-4s Plane:%s"
+msgstr "Pilot automat:%-4s Plan:%s"
+
+#: ../ui/ui.c:478
+msgid "On"
+msgstr "Pornit"
+
+#: ../ui/ui.c:478
+msgid "Off"
+msgstr "Oprit"
+
+#: ../ui/ui.c:482
+#, c-format
+msgid "incoloring:%s outcoloring:%s"
+msgstr "Culoare interioara:%s Culoare exterioara:%s"
+
+#: ../ui/ui.c:487
+#, c-format
+msgid "zoomspeed:%f"
+msgstr "viteza de marire (zoomspeed):%f"
+
+#: ../ui/ui.c:491
+msgid "Parameter:none"
+msgstr "Parametri:nici unul"
+
+#: ../ui/ui.c:493
+#, c-format
+msgid "Parameter:[%f,%f]"
+msgstr "Parametri:[%f,%f]"
+
+#: ../ui/ui.c:585
+#, c-format
+msgid "Please wait while calculating %s"
+msgstr "Asteptati va rog, fractalul %s se calculeaza "
+
+#: ../ui/ui.c:685
+#, c-format
+msgid "Letters per second %i "
+msgstr "Litere pe secunda: %i "
+
+#: ../ui/ui.c:698 ../ui/ui.c:709
+#, c-format
+msgid "Rotation speed:%2.2f degrees per second "
+msgstr "Viteza de rotatie:%2.2f grade pe secunda "
+
+#: ../ui/ui.c:719
+#, fuzzy, c-format
+msgid "Iterations: %i "
+msgstr "Iteratii: %i "
+
+#: ../ui/ui.c:735
+#, c-format
+msgid "Cycling speed: %i "
+msgstr "Viteaza de ciclare: %i "
+
+#: ../ui/ui.c:748 ../ui/ui.c:762
+#, c-format
+msgid "speed:%2.2f "
+msgstr "Viteza:%2.2f "
+
+#: ../ui/ui.c:854
+#, c-format
+msgid "Thank you for using XaoS\n"
+msgstr "Va multumim ca ati folosit XaoS\n"
+
+#: ../ui/ui.c:891
+msgid "Skipping, please wait..."
+msgstr "Se omite, va rugam asteptati..."
+
+#: ../ui/ui.c:983 ../ui/ui.c:985 ../ui/ui-drv/win32/ui_win32.c:1453
+msgid "Resize"
+msgstr "Redimensionare"
+
+#: ../ui/ui.c:998
+#, fuzzy
+msgid "Quit"
+msgstr "Terminare"
+
+#: ../ui/ui.c:999
+msgid "Exit now"
+msgstr "Iesire acum"
+
+#: ../ui/ui.c:1001
+msgid "Not yet"
+msgstr "Inca nu"
+
+#: ../ui/ui.c:1004 ../ui-hlp/menu.c:1055 ../ui-hlp/menu.c:1065
+#: ../ui/dialog.c:404 ../ui/dialog.c:1380
+msgid "Help"
+msgstr "Ajutor"
+
+#: ../ui/ui.c:1006
+msgid "Disable XaoS's builtin GUI"
+msgstr "Dezactivare GUI implementat in XaoS"
+
+#: ../ui/ui.c:1010 ../ui/ui.c:1016
+msgid "Status"
+msgstr "Status"
+
+#: ../ui/ui.c:1012 ../ui/ui.c:1018
+msgid "Ministatus"
+msgstr "Ministatus"
+
+#: ../ui/ui.c:1021 ../ui/ui.c:1022
+msgid "Driver"
+msgstr "Driver"
+
+#: ../ui/ui.c:1413
+#, c-format
+msgid "Welcome to XaoS version %s"
+msgstr "Bine ati venit la XaoS Versiunea %s"
+
+#: ../ui/ui.c:1580
+msgid "Can not allocate buffers"
+msgstr "Nu se pot aloca bufferele"
+
+#: ../ui/ui.c:1598
+msgid "Can not create palette"
+msgstr "Nu se poate crea paleta"
+
+#: ../ui/ui.c:1610
+msgid "Can not create image"
+msgstr "Nu se poate crea imaginea"
+
+#: ../ui/ui.c:1641 ../ui/ui.c:1692
+msgid "Can not allocate tables"
+msgstr "Nu se pot aloca tabelele"
+
+#: ../ui/ui.c:1678
+msgid "Can not initialize driver"
+msgstr "Nu se poate initializa driverul"
+
+#: ../ui/ui.c:1681
+msgid "Can not return back to previous driver"
+msgstr "Nu se poate intoarce la driverul precedent"
+
+#: ../ui-hlp/menu.c:129
+msgid "Perturbation:"
+msgstr "Perturbare:"
+
+#: ../ui-hlp/menu.c:133
+msgid "Julia-seed:"
+msgstr "Julia-samanta(valoare initiala):"
+
+#: ../ui-hlp/menu.c:137
+msgid "Morphing type:"
+msgstr "Tipul de morphing:"
+
+#: ../ui-hlp/menu.c:138
+msgid "Startuptime:"
+msgstr "Timp de pornire:"
+
+#: ../ui-hlp/menu.c:139
+msgid "Stoptime:"
+msgstr "Timp de oprire:"
+
+#: ../ui-hlp/menu.c:143
+msgid "File to render:"
+msgstr "Fisierul de procesat:"
+
+#: ../ui-hlp/menu.c:144
+msgid "Basename:"
+msgstr "Nume de baza:"
+
+#: ../ui-hlp/menu.c:145
+msgid "Width:"
+msgstr "Latime:"
+
+#: ../ui-hlp/menu.c:146
+msgid "Height:"
+msgstr "Inaltime:"
+
+#: ../ui-hlp/menu.c:147
+msgid "Real width (cm):"
+msgstr "Latime reala (cm):"
+
+#: ../ui-hlp/menu.c:148
+msgid "Real height (cm):"
+msgstr "Inaltime reala (cm):"
+
+#: ../ui-hlp/menu.c:149
+msgid "Framerate:"
+msgstr "Frecventa cadrelor:"
+
+#: ../ui-hlp/menu.c:150
+msgid "Image type:"
+msgstr "Tipul imaginii:"
+
+#: ../ui-hlp/menu.c:151
+msgid "Antialiasing:"
+msgstr "Antialiasing:"
+
+#: ../ui-hlp/menu.c:152
+msgid "Always recalculate:"
+msgstr "Intotdeauna recalculeaza:"
+
+#: ../ui-hlp/menu.c:153
+msgid "Calculate MPEG motion vectors:"
+msgstr "Calculeaza vectorii de miscare MPEG:"
+
+#: ../ui-hlp/menu.c:154
+msgid "Recommended I frame distance:"
+msgstr "Distanta I-Frame recomandata:"
+
+#: ../ui-hlp/menu.c:158
+msgid "Center:"
+msgstr "Centru:"
+
+#: ../ui-hlp/menu.c:159
+msgid "Radius:"
+msgstr "Raza:"
+
+#: ../ui-hlp/menu.c:160 ../ui-hlp/menu.c:225
+msgid "Angle:"
+msgstr "Unghi:"
+
+#: ../ui-hlp/menu.c:164
+msgid "Mode:"
+msgstr "Mod:"
+
+#: ../ui-hlp/menu.c:165
+msgid "Start:"
+msgstr "Start:"
+
+#: ../ui-hlp/menu.c:166
+msgid "End:"
+msgstr "sfarsit:"
+
+#: ../ui-hlp/menu.c:170
+msgid "Color:"
+msgstr "Culoare:"
+
+#: ../ui-hlp/menu.c:174
+msgid "Rotations per second:"
+msgstr "Rotatii pe secunda:"
+
+#: ../ui-hlp/menu.c:178
+msgid "Letters per second:"
+msgstr "Litere pe secunda:"
+
+#: ../ui-hlp/menu.c:182
+msgid "Iterations:"
+msgstr "Iteratii:"
+
+#: ../ui-hlp/menu.c:186
+msgid "Text:"
+msgstr "Text:"
+
+#: ../ui-hlp/menu.c:190
+msgid "Your command:"
+msgstr "Comanda dumneavoastra:"
+
+#: ../ui-hlp/menu.c:194 ../ui-hlp/menu.c:198 ../ui-hlp/menu.c:202
+#: ../ui-hlp/menu.c:206 ../ui-hlp/menu.c:258
+msgid "Filename:"
+msgstr "Numele fisierului:"
+
+#: ../ui-hlp/menu.c:210 ../ui-hlp/menu.c:298
+msgid "Formula:"
+msgstr "Formula:"
+
+#: ../ui-hlp/menu.c:214
+msgid "X center:"
+msgstr "X-centru:"
+
+#: ../ui-hlp/menu.c:215
+msgid "Y center:"
+msgstr "Y-centru:"
+
+#: ../ui-hlp/menu.c:216
+msgid "X Radius:"
+msgstr "X-Raza:"
+
+#: ../ui-hlp/menu.c:217
+msgid "Y Radius:"
+msgstr "Y-Raza:"
+
+#: ../ui-hlp/menu.c:221
+msgid "Coordinates:"
+msgstr "Coordonate:"
+
+#: ../ui-hlp/menu.c:229
+msgid "continuous rotation"
+msgstr "Rotatie continua"
+
+#: ../ui-hlp/menu.c:233
+msgid "Fast rotation"
+msgstr "Rotatie rapida"
+
+#: ../ui-hlp/menu.c:237
+msgid "filter"
+msgstr "Filtru"
+
+#: ../ui-hlp/menu.c:238
+msgid "enable"
+msgstr "activare"
+
+#: ../ui-hlp/menu.c:242
+msgid "Amount:"
+msgstr "Cantitate:"
+
+#: ../ui-hlp/menu.c:246
+msgid "Zooming speed:"
+msgstr "Viteza de marire (zoom):"
+
+#: ../ui-hlp/menu.c:250
+msgid "Name:"
+msgstr "Nume:"
+
+#: ../ui-hlp/menu.c:254
+msgid "Bailout:"
+msgstr "Bailout (valoare de salvare):"
+
+#: ../ui-hlp/menu.c:262
+msgid "Julia mode:"
+msgstr "Mod Julia:"
+
+#: ../ui-hlp/menu.c:266
+msgid "Horizontal position:"
+msgstr "Pozitia orizontala:"
+
+#: ../ui-hlp/menu.c:267
+msgid "Vertical position:"
+msgstr "Pozitia verticala:"
+
+#: ../ui-hlp/menu.c:271
+msgid "Dynamic resolution:"
+msgstr "Rezolutie dinamica :"
+
+#: ../ui-hlp/menu.c:275
+msgid "Time:"
+msgstr "Timp:"
+
+#: ../ui-hlp/menu.c:279 ../ui-hlp/menu.c:283
+msgid "Number:"
+msgstr "Numar:"
+
+#: ../ui-hlp/menu.c:287
+msgid "Algorithm number:"
+msgstr "Numarul algoritmului:"
+
+#: ../ui-hlp/menu.c:288
+msgid "Seed:"
+msgstr "Samanta (valoare initiala):"
+
+#: ../ui-hlp/menu.c:289
+msgid "Shift:"
+msgstr "Deplasare:"
+
+#: ../ui-hlp/menu.c:293
+msgid "Frames per second:"
+msgstr "Cadre pe secunda:"
+
+#: ../ui-hlp/menu.c:302
+#, fuzzy
+msgid "Initialization:"
+msgstr "Initializare"
+
+#: ../ui-hlp/menu.c:357
+msgid "renderanim: Must specify a valid absolute path for basename"
+msgstr ""
+
+#: ../ui-hlp/menu.c:364
+msgid ""
+"renderanim: Width parameter must be positive integer in the range 0..4096"
+msgstr ""
+"procesarea animatiei: Latimea trebuie sa fie o valoare pozitva, intreaga "
+"intre 0 si 4096"
+
+#: ../ui-hlp/menu.c:370
+msgid ""
+"renderanim: Height parameter must be positive integer in the range 0..4096"
+msgstr ""
+"procesarea animatiei: Inaltimea trebuie sa fie o valoare pozitva, intreaga "
+"intre 0 si 4096"
+
+#: ../ui-hlp/menu.c:376
+msgid "renderanim: Invalid real width and height dimensions"
+msgstr "procesarea animatiei: latime si inaltime reala incorecte"
+
+#: ../ui-hlp/menu.c:380
+msgid "renderanim: invalid framerate"
+msgstr "procesarea animatiei: frecventa cadrelor incorecta"
+
+#: ../ui-hlp/menu.c:386
+msgid "renderanim: antialiasing not supported in 256 color mode"
+msgstr ""
+"procesarea animatiei: Antialiasing nicht unterstützt im 256-Farben-Modus"
+
+#: ../ui-hlp/menu.c:390
+msgid "renderanim: incorrect I frame distance"
+msgstr "procesarea animatiei: Distanta I-Frame incorecta"
+
+#: ../ui-hlp/menu.c:441 ../ui-hlp/menu.c:454
+msgid "animateview: Invalid viewpoint"
+msgstr "vederea animatiei: punct de vedere incorect"
+
+#: ../ui-hlp/menu.c:467
+msgid "Invalid viewpoint"
+msgstr "Punct de vedere incorect"
+
+#: ../ui-hlp/menu.c:696
+msgid "Unknown palette type"
+msgstr "Tip de paleta necunoscut"
+
+#: ../ui-hlp/menu.c:771 ../ui-hlp/menu.c:785
+msgid "Initialization of color cycling failed."
+msgstr "Initializare ciclarii culorilor a esuat"
+
+#: ../ui-hlp/menu.c:773 ../ui-hlp/menu.c:787
+msgid "Try to enable palette emulation filter"
+msgstr "Incercare de activare a filtrului de emulare a paletei"
+
+#: ../ui-hlp/menu.c:896
+#, c-format
+msgid "Algorithm:%i seed:%i size:%i"
+msgstr "Algoritm:%i Valoare initiala:%i dimensiune:%i"
+
+#: ../ui-hlp/menu.c:947
+msgid "Root menu"
+msgstr "Meniu principal"
+
+#: ../ui-hlp/menu.c:948
+msgid "Animation root menu"
+msgstr "Meniu principal pentru animatii"
+
+#: ../ui-hlp/menu.c:949
+msgid "Replay only commands"
+msgstr "Comenzi numai pentru redare"
+
+#: ../ui-hlp/menu.c:950
+msgid "Command line options only"
+msgstr "Numai optiuni de la linia de comanda"
+
+#: ../ui-hlp/menu.c:953
+msgid "print menus specifications of all menus"
+msgstr "tipareste specificatiile de meniu pentru toate meniurile"
+
+#: ../ui-hlp/menu.c:958
+msgid "print menu specification"
+msgstr "tipareste specificatiile meniului"
+
+#: ../ui-hlp/menu.c:961
+msgid "print menu specification in xshl format"
+msgstr "tipareste specificatiile meniului in format xshl"
+
+#: ../ui-hlp/menu.c:965
+msgid "print all menu specifications in xshl format"
+msgstr "tipareste toate specificatiile meniului in format xshl"
+
+#: ../ui-hlp/menu.c:967
+msgid "print dialog specification"
+msgstr "tipareste specificatiile dialogului"
+
+#: ../ui-hlp/menu.c:972
+msgid "Line drawing functions"
+msgstr "Functii pentru desenarea liniilor"
+
+#: ../ui-hlp/menu.c:973
+msgid "Line"
+msgstr "Linie"
+
+#: ../ui-hlp/menu.c:976
+msgid "Morph line"
+msgstr "Linie Morph"
+
+#: ../ui-hlp/menu.c:978
+msgid "Morph last line"
+msgstr "Ultima linie Morph"
+
+#: ../ui-hlp/menu.c:981
+msgid "Set line key"
+msgstr "Seteaza cheia liniei"
+
+#: ../ui-hlp/menu.c:983
+msgid "Clear line"
+msgstr "Sterge linia"
+
+#: ../ui-hlp/menu.c:986
+msgid "Clear all lines"
+msgstr "sterge toate liniile"
+
+#: ../ui-hlp/menu.c:988
+msgid "Animation functions"
+msgstr "Functii pentru animatii"
+
+#: ../ui-hlp/menu.c:989 ../ui-hlp/menu.c:1181 ../ui-hlp/menu.c:1190
+msgid "View"
+msgstr "Vedere"
+
+#: ../ui-hlp/menu.c:993
+msgid "Morph view"
+msgstr "vedere Morph"
+
+#: ../ui-hlp/menu.c:995
+msgid "Morph julia"
+msgstr "Morph Julia"
+
+#: ../ui-hlp/menu.c:1000
+msgid "Move view"
+msgstr "Deplaseaza vederea"
+
+#: ../ui-hlp/menu.c:1002
+msgid "Morph angle"
+msgstr "Unghiul de Morph"
+
+#: ../ui-hlp/menu.c:1004
+msgid "Zoom center"
+msgstr "Centrul maririi (zoom) "
+
+#: ../ui-hlp/menu.c:1006 ../ui/ui-drv/cocoa/AppController.m:343
+msgid "Zoom"
+msgstr "Marire (Zoom)"
+
+#: ../ui-hlp/menu.c:1007
+msgid "Un-zoom"
+msgstr "Un-zoom"
+
+#: ../ui-hlp/menu.c:1010
+msgid "Stop zooming"
+msgstr "Opreste marirea(zoom)"
+
+#: ../ui-hlp/menu.c:1011
+msgid "Smooth morphing parameters"
+msgstr "Parametrul de morphing neted"
+
+#: ../ui-hlp/menu.c:1014
+msgid "Timing functions"
+msgstr "Functii de timp"
+
+#: ../ui-hlp/menu.c:1015
+msgid "Usleep"
+msgstr "Usleep"
+
+#: ../ui-hlp/menu.c:1018
+msgid "Wait for text"
+msgstr "Asteapta textul"
+
+#: ../ui-hlp/menu.c:1020
+msgid "Wait for complete image"
+msgstr "Asteapta imaginea completa"
+
+#: ../ui-hlp/menu.c:1022
+msgid "Include file"
+msgstr "Include fisierul"
+
+#: ../ui-hlp/menu.c:1024 ../ui-hlp/menu.c:1222
+msgid "Default palette"
+msgstr "Paleta implicita"
+
+#: ../ui-hlp/menu.c:1026
+msgid "Formula"
+msgstr "Formula"
+
+#: ../ui-hlp/menu.c:1028
+msgid "Maximal zooming step"
+msgstr "Pasul maxim de marire (zoom)"
+
+#: ../ui-hlp/menu.c:1030
+msgid "Zooming speedup"
+msgstr "Cresterea vitezei de marire (zoom)"
+
+#: ../ui-hlp/menu.c:1032
+msgid "Filter"
+msgstr "Filru"
+
+#: ../ui-hlp/menu.c:1036 ../ui-hlp/menu.c:1041
+msgid "Letters per second"
+msgstr "Litere pe secunda"
+
+#: ../ui-hlp/menu.c:1043 ../ui-hlp/menu.c:1314
+msgid "Interrupt"
+msgstr "Intrerupe"
+
+#: ../ui-hlp/menu.c:1045 ../ui-hlp/menu.c:1057
+msgid "File"
+msgstr "Fisier ºfirsãt"
+
+#: ../ui-hlp/menu.c:1046
+msgid "Edit"
+msgstr "Editare"
+
+#: ../ui-hlp/menu.c:1047
+msgid "Fractal"
+msgstr "Fractal"
+
+#: ../ui-hlp/menu.c:1048
+msgid "Calculation"
+msgstr "Calculare"
+
+#: ../ui-hlp/menu.c:1049 ../ui-hlp/menu.c:1391
+msgid "Filters"
+msgstr "Filtre"
+
+#: ../ui-hlp/menu.c:1050 ../ui-hlp/menu.c:1064
+msgid "UI"
+msgstr "Interfata utilizator (UI)"
+
+#: ../ui-hlp/menu.c:1051
+msgid "Misc"
+msgstr "Extra"
+
+#: ../ui-hlp/menu.c:1053
+#, fuzzy
+msgid "Window"
+msgstr "Refa"
+
+#: ../ui-hlp/menu.c:1056
+msgid "Tutorials"
+msgstr "Tutoriale"
+
+#: ../ui-hlp/menu.c:1062
+msgid "Stop replay"
+msgstr "Opreste redarea"
+
+#: ../ui-hlp/menu.c:1066
+msgid "Command"
+msgstr "Comanda"
+
+#: ../ui-hlp/menu.c:1068
+msgid "Play string"
+msgstr "Arata sirul"
+
+#: ../ui-hlp/menu.c:1070
+msgid "Render animation"
+msgstr "Proceseaza animatia"
+
+#: ../ui-hlp/menu.c:1073
+msgid "Clear screen"
+msgstr "Sterge ecranul"
+
+#: ../ui-hlp/menu.c:1075
+msgid "Display fractal"
+msgstr "Arata fractalul"
+
+#: ../ui-hlp/menu.c:1078
+msgid "Display text"
+msgstr "Arata textul"
+
+#: ../ui-hlp/menu.c:1080
+#, fuzzy
+msgid "Color"
+msgstr "Culoare:"
+
+#: ../ui-hlp/menu.c:1082
+msgid "Horizontal text position"
+msgstr "Pozitia textului orizontal"
+
+#: ../ui-hlp/menu.c:1084
+msgid "Vertical text position"
+msgstr "Pozitia textului vertical"
+
+#: ../ui-hlp/menu.c:1086
+msgid "Text position"
+msgstr "Pozitiile textului"
+
+#: ../ui-hlp/menu.c:1090
+msgid "Message"
+msgstr "Mesaj"
+
+#: ../ui-hlp/menu.c:1112
+msgid "Load"
+msgstr "Incarca"
+
+#: ../ui-hlp/menu.c:1115
+msgid "Save"
+msgstr "Salveaza"
+
+#: ../ui-hlp/menu.c:1117
+msgid "Record"
+msgstr "Inregistreaza"
+
+#: ../ui-hlp/menu.c:1121
+msgid "Replay"
+msgstr "Reda"
+
+#: ../ui-hlp/menu.c:1128
+msgid "Save image"
+msgstr "Salveaza imaginea"
+
+#: ../ui-hlp/menu.c:1130
+msgid "Load random example"
+msgstr "Incarca un exemplu aleator"
+
+#: ../ui-hlp/menu.c:1132
+msgid "Save configuration"
+msgstr "Salveaza configuratia"
+
+#: ../ui-hlp/menu.c:1137
+msgid "Undo"
+msgstr "Refa"
+
+#: ../ui-hlp/menu.c:1141
+msgid "Redo"
+msgstr "Fa inapoi"
+
+#: ../ui-hlp/menu.c:1145
+msgid "Formulae"
+msgstr "Formule"
+
+#: ../ui-hlp/menu.c:1146
+#, fuzzy
+msgid "More formulae"
+msgstr "Alte formule"
+
+#: ../ui-hlp/menu.c:1151
+#, fuzzy
+msgid "User formula"
+msgstr "Alte formule"
+
+#: ../ui-hlp/menu.c:1153
+#, fuzzy
+msgid "User initialization"
+msgstr "Initializare"
+
+#: ../ui-hlp/menu.c:1158
+msgid "Incoloring mode"
+msgstr "Mod de colorare interioara"
+
+#: ../ui-hlp/menu.c:1159
+msgid "Outcoloring mode"
+msgstr "Mod de colorare exterioara"
+
+#: ../ui-hlp/menu.c:1160
+msgid "Plane"
+msgstr "Plan"
+
+#: ../ui-hlp/menu.c:1161
+#, fuzzy
+msgid "Palette"
+msgstr "Redare (paste)"
+
+#: ../ui-hlp/menu.c:1164
+msgid "Mandelbrot mode"
+msgstr "Modul Mandelbrot"
+
+#: ../ui-hlp/menu.c:1170 ../ui-hlp/menu.c:1174 ../ui-hlp/menu.c:1395
+msgid "Perturbation"
+msgstr "Perturbare"
+
+#: ../ui-hlp/menu.c:1185
+msgid "Reset to defaults"
+msgstr "Inapoi la setarile implicite"
+
+#: ../ui-hlp/menu.c:1186
+msgid "Julia mode"
+msgstr "Modul Julia"
+
+#: ../ui-hlp/menu.c:1193
+msgid "Set angle"
+msgstr "Seteaza unghiul"
+
+#: ../ui-hlp/menu.c:1197
+msgid "Set plane"
+msgstr "Seteaza planul"
+
+#: ../ui-hlp/menu.c:1201
+msgid "Inside coloring mode"
+msgstr "Modul de colorare interioara"
+
+#: ../ui-hlp/menu.c:1206
+msgid "Outside coloring mode"
+msgstr "Modul de colorare exterioara"
+
+#: ../ui-hlp/menu.c:1212
+msgid "Inside truecolor coloring mode"
+msgstr "Modul de colorare interioara true-color"
+
+#: ../ui-hlp/menu.c:1216
+msgid "Outside truecolor coloring mode"
+msgstr "Modul de colorare exterioara true-color"
+
+#: ../ui-hlp/menu.c:1219
+msgid "Julia seed"
+msgstr "Samanta (valoare initiala) Julia"
+
+#: ../ui-hlp/menu.c:1224
+msgid "Random palette"
+msgstr "Paleta aleatoare"
+
+#: ../ui-hlp/menu.c:1226
+msgid "Custom palette"
+msgstr "Paleta obisnuita"
+
+#: ../ui-hlp/menu.c:1230
+msgid "Color cycling"
+msgstr "Ciclarea culorilor"
+
+#: ../ui-hlp/menu.c:1232
+msgid "Reversed color cycling"
+msgstr "Ciclare inversata a culorilor "
+
+#: ../ui-hlp/menu.c:1237
+msgid "Color cycling speed"
+msgstr "Viteza de ciclare a culorilor"
+
+#: ../ui-hlp/menu.c:1241
+msgid "Shift palette"
+msgstr "Deplaseaza paleta"
+
+#: ../ui-hlp/menu.c:1243
+msgid "Shift one forward"
+msgstr "Deplaseaza cu un pas inainte"
+
+#: ../ui-hlp/menu.c:1246
+msgid "Shift one backward"
+msgstr "Deplaseaza cu un pas inapoi"
+
+#: ../ui-hlp/menu.c:1248 ../engine/zoom.c:1357
+msgid "Solid guessing"
+msgstr "Solid-Guessing"
+
+#: ../ui-hlp/menu.c:1249
+msgid "Dynamic resolution"
+msgstr "Rezolutie dinamica"
+
+#: ../ui-hlp/menu.c:1251
+msgid "Periodicity checking"
+msgstr "Verificarea periodicitatii"
+
+#: ../ui-hlp/menu.c:1254
+msgid "Iterations"
+msgstr "Iteratii"
+
+#: ../ui-hlp/menu.c:1256
+msgid "Bailout"
+msgstr "Valoare de salvare (bailout)"
+
+#: ../ui-hlp/menu.c:1260
+msgid "Fast julia mode"
+msgstr "Modul Julia rapid"
+
+#: ../ui-hlp/menu.c:1262
+msgid "Rotation"
+msgstr "Rotatie"
+
+#: ../ui-hlp/menu.c:1263
+msgid "Solid guessing range"
+msgstr "Intrevalul Solid-Guessing"
+
+#: ../ui-hlp/menu.c:1266
+msgid "Disable rotation"
+msgstr "Dezactiveaza rotatia"
+
+#: ../ui-hlp/menu.c:1270
+msgid "Continuous rotation"
+msgstr "Rotatie continua"
+
+#: ../ui-hlp/menu.c:1273
+msgid "Rotate by mouse"
+msgstr "Roteste cu mouse-ul"
+
+#: ../ui-hlp/menu.c:1277
+msgid "Rotation speed"
+msgstr "Viteza de rotatie"
+
+#: ../ui-hlp/menu.c:1280
+msgid "Automatic rotation"
+msgstr "Rotatie automata"
+
+#: ../ui-hlp/menu.c:1285
+msgid "Fast rotation mode"
+msgstr "Modul rapid de rotatie"
+
+#: ../ui-hlp/menu.c:1289
+msgid "Disable dynamic resolution"
+msgstr "Dezactiveaza rezolutia dinamica"
+
+#: ../ui-hlp/menu.c:1292
+msgid "Use only during animation"
+msgstr "A se folosi numai in timpul animatiilor"
+
+#: ../ui-hlp/menu.c:1296
+msgid "Use also for new images"
+msgstr "A se folosi si pentru imagini noi"
+
+#: ../ui-hlp/menu.c:1298
+msgid "Dynamic resolution mode"
+msgstr "Modul de rezolutie dinamica"
+
+#: ../ui-hlp/menu.c:1302
+msgid "Autopilot"
+msgstr "Pilot automat"
+
+#: ../ui-hlp/menu.c:1306
+#, fuzzy
+msgid "VJ mode"
+msgstr "Modul Julia"
+
+#: ../ui-hlp/menu.c:1310
+msgid "Recalculate"
+msgstr "Recalulare"
+
+#: ../ui-hlp/menu.c:1319
+msgid "Zooming speed"
+msgstr "Viteza de marire (zoom)"
+
+#: ../ui-hlp/menu.c:1321
+msgid "Fixed step"
+msgstr "Pas fixat"
+
+#: ../ui-hlp/menu.c:1325
+msgid "Disable solid guessing"
+msgstr "Dezactiveaza solid-guessing"
+
+#: ../ui-hlp/menu.c:1329
+msgid "Guess 2x2 rectangles"
+msgstr "Guess 2x2 dreptunghiuri"
+
+#: ../ui-hlp/menu.c:1331
+msgid "Guess 3x3 rectangles"
+msgstr "Guess 3x3 dreptunghiuri"
+
+#: ../ui-hlp/menu.c:1335
+msgid "Guess 4x4 rectangles"
+msgstr "Guess 4x4 dreptunghiuri"
+
+#: ../ui-hlp/menu.c:1337
+msgid "Guess 5x5 rectangles"
+msgstr "Guess 5x5 dreptunghiuri"
+
+#: ../ui-hlp/menu.c:1341
+msgid "Guess 6x6 rectangles"
+msgstr "Guess 6x6 dreptunghiuri"
+
+#: ../ui-hlp/menu.c:1343
+msgid "Guess 7x7 rectangles"
+msgstr "Guess 7x7 dreptunghiuri"
+
+#: ../ui-hlp/menu.c:1347
+msgid "Guess 8x8 rectangles"
+msgstr "Guess 8x8 dreptunghiuri"
+
+#: ../ui-hlp/menu.c:1349
+msgid "Guess unlimited rectangles"
+msgstr "Guess un numar nelimitat de dreptunghiuri"
+
+#: ../ui-hlp/menu.c:1354
+msgid "Language"
+msgstr "Limba"
+
+#: ../ui-hlp/menu.c:1357
+msgid "An introduction to fractals"
+msgstr "Fractali - O introducere"
+
+#: ../ui-hlp/menu.c:1359
+msgid "XaoS features overview"
+msgstr "XaoS - Eine Ãœbersicht"
+
+#: ../ui-hlp/menu.c:1361
+msgid "Math behind fractals"
+msgstr "Matematica de la baza fractalilor"
+
+#: ../ui-hlp/menu.c:1362 ../ui-hlp/menu.c:1403
+msgid "Other fractal types in XaoS"
+msgstr "Alte tipuri de fractali in XaoS"
+
+#: ../ui-hlp/menu.c:1364
+msgid "What's new?"
+msgstr "Ce este nou?"
+
+#: ../ui-hlp/menu.c:1374 ../ui-hlp/menu.c:1398
+msgid "Whole story"
+msgstr "Toata povestea"
+
+#: ../ui-hlp/menu.c:1376
+msgid "Introduction"
+msgstr "Introducere"
+
+#: ../ui-hlp/menu.c:1377
+msgid "Mandelbrot set"
+msgstr "Multimea Mandelbrot"
+
+#: ../ui-hlp/menu.c:1378
+msgid "Julia set"
+msgstr "Multimea Julia"
+
+#: ../ui-hlp/menu.c:1379
+msgid "Higher power Mandelbrots"
+msgstr "Multimi Mandelbrot de ordin superior"
+
+#: ../ui-hlp/menu.c:1380
+msgid "Newton's method"
+msgstr "Metoda lui Newton"
+
+#: ../ui-hlp/menu.c:1381
+msgid "Barnsley's formula"
+msgstr "Formula lui Barnsley"
+
+#: ../ui-hlp/menu.c:1382
+msgid "Phoenix"
+msgstr "Phoenix"
+
+#: ../ui-hlp/menu.c:1383
+msgid "Octo"
+msgstr "Octo"
+
+#: ../ui-hlp/menu.c:1384
+msgid "Magnet"
+msgstr "Magnet"
+
+#: ../ui-hlp/menu.c:1385
+msgid "All features"
+msgstr "Toate Features"
+
+#: ../ui-hlp/menu.c:1387
+msgid "Outcoloring modes"
+msgstr "Moduri de colorare exterioara"
+
+#: ../ui-hlp/menu.c:1388
+msgid "Incoloring modes"
+msgstr "Moduri de colorare interioara"
+
+#: ../ui-hlp/menu.c:1389
+msgid "True-color coloring modes"
+msgstr "Moduri de colorare true-color"
+
+#: ../ui-hlp/menu.c:1392
+msgid "Planes"
+msgstr "Planuri"
+
+#: ../ui-hlp/menu.c:1393
+msgid "Animations and position files"
+msgstr "Fisierele de animatii si pozitie"
+
+#: ../ui-hlp/menu.c:1396
+msgid "Random palettes"
+msgstr "Palete aleatoare"
+
+#: ../ui-hlp/menu.c:1397
+msgid "Other noteworthy features"
+msgstr "Alte detalii (features) remarcabile"
+
+#: ../ui-hlp/menu.c:1400
+msgid "The definition and fractal dimension"
+msgstr "Definitia si dimensiunea fractalului"
+
+#: ../ui-hlp/menu.c:1402
+msgid "Escape time fractals"
+msgstr "Fractali escape-time"
+
+#: ../ui-hlp/menu.c:1406
+msgid "Triceratops and Catseye fractals"
+msgstr "Fractalii Triceratops si Catseye (ochi de pisica)"
+
+#: ../ui-hlp/menu.c:1408
+msgid "Mandelbar, Lambda, Manowar and Spider"
+msgstr "Mandelbar, Lambda, Manowar si Spider"
+
+#: ../ui-hlp/menu.c:1411
+msgid "Sierpinski Gasket, S.Carpet, Koch Snowflake"
+msgstr ""
+"Sierpinski Gasket, S.Carpet, Koch Snowflake (fulgul de zapada al lui Koch)"
+
+#: ../ui-hlp/menu.c:1413
+msgid "What's new in 3.0?"
+msgstr "Ce este nou in versiunea 3.0?"
+
+#: ../ui-hlp/play.c:74
+msgid "line available only in animation replay"
+msgstr "Linie disponibila numai in animation replay"
+
+#: ../ui-hlp/play.c:99
+msgid "Morphing non existing line!"
+msgstr "Morphing o linie inexistenta!"
+
+#: ../ui-hlp/play.c:121
+msgid "linekey not available in this context!"
+msgstr "Cheia liniei nu este disponibila in acest context!"
+
+#: ../ui-hlp/play.c:291
+msgid "clear_line available only in animation replay"
+msgstr "Stergerea_liniei (clear_line) disponibila numai in animation replay"
+
+#: ../ui-hlp/play.c:300
+msgid "clear_lines available only in animation replay"
+msgstr "Stergerea_liniilor (clear_lines) disponibila numai in animation replay"
+
+#: ../ui-hlp/play.c:359
+msgid "Catalog file not found"
+msgstr "Nu s-a gasit fisierul catalog"
+
+#: ../ui-hlp/play.c:405
+msgid "Replay is already active"
+msgstr "Replay este deja activ"
+
+#: ../ui-hlp/play.c:409
+msgid "File open failed"
+msgstr "Fiserul nu a putut fi deschis"
+
+#: ../ui-hlp/play.c:414
+msgid "Out of memory"
+msgstr "Memorie insuficienta"
+
+#: ../ui-hlp/play.c:526 ../ui-hlp/play.c:542 ../ui-hlp/play.c:566
+#: ../ui-hlp/play.c:595
+msgid "Missing parameter"
+msgstr "Parametru lipsa"
+
+#: ../ui-hlp/play.c:528 ../ui-hlp/play.c:544 ../ui-hlp/play.c:568
+#: ../ui-hlp/play.c:597
+msgid "Unexpected end of file"
+msgstr "Sfarsit de fisier neasteptat"
+
+#: ../ui-hlp/play.c:555 ../ui-hlp/play.c:574
+msgid "Token is too long"
+msgstr "Token-ul este prea lung"
+
+#: ../ui-hlp/play.c:629
+msgid "Unknown formula type"
+msgstr "Tip de formula necunoscut"
+
+#: ../ui-hlp/play.c:635
+msgid "morph available only in animation replay"
+msgstr "Morph disponibil numai in animation replay"
+
+#: ../ui-hlp/play.c:639
+msgid "morphview: Invalid viewpoint"
+msgstr "vederea Morph (morphview): Punct de vedere eronat"
+
+#: ../ui-hlp/play.c:653
+msgid "move available only in animation replay"
+msgstr "Deplasare dispnibila numai in animation replay"
+
+#: ../ui-hlp/play.c:667
+msgid "morphjulia available only in animation replay"
+msgstr "Morphjulia dispnibila numai in animation replay"
+
+#: ../ui-hlp/play.c:680
+msgid "morphangle available only in animation replay"
+msgstr "Unghiul de Morph dispnibil numai in animation replay"
+
+#: ../ui-hlp/play.c:712
+msgid "Unknown filter"
+msgstr "Filtru necunoscut"
+
+#: ../ui-hlp/play.c:753
+msgid "sleep available only in animation replay"
+msgstr "Pause (sleep) disponibila numai in animation replay"
+
+#: ../ui-hlp/play.c:767
+#, c-format
+msgid "Internal program error #12 %i\n"
+msgstr "Eroare interna #12 %i\n"
+
+#: ../ui-hlp/play.c:788
+msgid "wait available only in animation replay"
+msgstr "Asteptare(wait) disponibil numi in animation replay"
+
+#: ../ui-hlp/play.c:834
+msgid "No catalog file loaded"
+msgstr "Nu s-a incarcat fisierul catalog"
+
+#: ../ui-hlp/play.c:839
+msgid "Message not found in catalog file"
+msgstr "Mesajul nu a fost gasit in fisierul catalog"
+
+#: ../ui-hlp/play.c:850
+msgid "load available only in animation replay"
+msgstr "Incarcare (load) disponibila numai in animation replay"
+
+#: ../ui-hlp/play.c:854
+msgid "Include level overflow"
+msgstr "Zu viele Dateien ineinander einbezogen"
+
+#: ../ui-hlp/play.c:863
+msgid "File not found"
+msgstr "Nu s-a gasit fisierul"
+
+#: ../ui-hlp/play.c:881
+msgid "Too many parameters"
+msgstr "Prea multi parametri"
+
+#: ../ui-hlp/play.c:916
+#, c-format
+msgid "Replay disabled at line %i"
+msgstr "Replay dezactivat pe linia %i"
+
+#: ../ui-hlp/ui_helper.c:646
+msgid "Tutorial files not found. Reinstall XaoS"
+msgstr "Fisierele cu tutoriale nu au fost gasite. Reinstalati XaoS"
+
+#: ../ui-hlp/ui_helper.c:651
+msgid "Preparing first image"
+msgstr "Se pregateste prima imagine"
+
+#: ../ui-hlp/ui_helper.c:661
+msgid "Could not open examples"
+msgstr "Exemplele nu s-au putut deschide"
+
+#: ../ui-hlp/ui_helper.c:667
+#, c-format
+msgid "File %s loaded."
+msgstr "S-a incarcat fisierul %s."
+
+#: ../ui-hlp/ui_helper.c:676
+msgid "Saving image..."
+msgstr "Imginea se salveaza..."
+
+#: ../ui-hlp/ui_helper.c:684
+msgid "Save interrupted"
+msgstr "Salvare intrerupta"
+
+#: ../ui-hlp/ui_helper.c:693 ../ui-hlp/ui_helper.c:710
+#: ../ui-hlp/ui_helper.c:777
+#, c-format
+msgid "File %s saved."
+msgstr "Fisierul %s salvat."
+
+#: ../ui-hlp/ui_helper.c:704
+msgid "Can not open file"
+msgstr "Nu se poate deschide fisierul"
+
+#: ../ui-hlp/ui_helper.c:799
+#, c-format
+msgid "Recording to file %s enabled."
+msgstr "S-a activat inregistrearea in fisierul %s "
+
+#: ../engine/zoom.c:1128
+msgid "Solid guessing 1"
+msgstr "Solid-Guessing 1"
+
+#: ../engine/btrace.c:292 ../engine/btrace.c:373
+msgid "Boundary trace"
+msgstr "Boundary-Trace"
+
+#: ../ui/dialog.c:312 ../ui/dialog.c:398 ../ui/dialog.c:1377
+#: ../ui/ui-drv/cocoa/CustomDialog.m:302
+msgid "OK"
+msgstr "OK"
+
+#: ../ui/dialog.c:313 ../ui/dialog.c:401 ../ui/dialog.c:1379
+#: ../ui/filesel.c:184 ../ui/ui-drv/cocoa/CustomDialog.m:312
+msgid "Cancel"
+msgstr "Anulare"
+
+#: ../ui-hlp/render.c:46
+#, c-format
+msgid "Error: %s"
+msgstr "Eroare: %s"
+
+#: ../ui-hlp/render.c:121
+msgid "Cannot open motion vector file!"
+msgstr "Nu se poate deschide fisierul cu vectorii de miscare!"
+
+#: ../ui-hlp/render.c:270
+#, c-format
+msgid "Vectors: %i"
+msgstr "Vectori: %i"
+
+#: ../ui-hlp/render.c:276
+msgid "Initializing"
+msgstr "Initializare"
+
+#: ../ui-hlp/render.c:284
+msgid "Cannot create palette"
+msgstr "Nu se poate crea paleta"
+
+#: ../ui-hlp/render.c:295
+msgid "Cannot create image\n"
+msgstr "Nu se poate crea imaginea\n"
+
+#: ../ui-hlp/render.c:304
+msgid "Cannot create checking buffer!"
+msgstr "Nu se poate crea bufferul de control!"
+
+#: ../ui-hlp/render.c:313 ../ui-hlp/render.c:596
+msgid "Cannot create context\n"
+msgstr "Nu se poate crea contextul\n"
+
+#: ../ui-hlp/render.c:325
+msgid "Cannot open animation file\n"
+msgstr "Nu se poate deschide fisierul cu animatii\n"
+
+#: ../ui-hlp/render.c:336 ../ui-hlp/render.c:605
+msgid "Loading catalogs"
+msgstr "Cataloagele se incarca"
+
+#: ../ui-hlp/render.c:366
+msgid "Processing command line options"
+msgstr "Se prelucreaza optiunile de la linia de comanda"
+
+#: ../ui-hlp/render.c:389
+msgid "Enabling animation replay\n"
+msgstr "Se activeaza animation replay\n"
+
+#: ../ui-hlp/render.c:396 ../ui-hlp/render.c:514
+msgid "Cannot open image file"
+msgstr "Nu se poate deschide fisierul cu imaginea"
+
+#: ../ui-hlp/render.c:410
+msgid "Cannot open pattern file"
+msgstr "Nu se poate deschide fiserul de sabloane"
+
+#: ../ui-hlp/render.c:427 ../ui-hlp/render.c:429 ../ui-hlp/render.c:638
+msgid "Entering calculation loop!"
+msgstr "Intrare in bucla de calcul!"
+
+#: ../ui-hlp/render.c:455
+#, c-format
+msgid "Frame %i skipped."
+msgstr "cadrul %i a fost omis."
+
+#: ../ui-hlp/render.c:457
+#, c-format
+msgid "Frames %i - %i skipped."
+msgstr "S-au omis cadrele %i - %i."
+
+#: ../ui-hlp/render.c:461
+#, c-format
+msgid "Frame %4i: "
+msgstr "Cadru %4i: "
+
+#: ../ui-hlp/render.c:528
+msgid " done."
+msgstr " terminat."
+
+#: ../ui-hlp/render.c:532
+msgid " skipping..."
+msgstr " se omite..."
+
+#: ../ui-hlp/render.c:565 ../ui-hlp/render.c:657
+msgid "Calculation interrupted"
+msgstr "Calculare intrerupta"
+
+#: ../ui-hlp/render.c:568 ../ui-hlp/render.c:570 ../ui-hlp/render.c:659
+msgid "Calculation finished"
+msgstr "Calculare terminata"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1292 ../ui/ui-drv/cocoa/AppController.m:321
+msgid "Copy"
+msgstr "Copiere"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1293 ../ui/ui-drv/cocoa/AppController.m:324
+msgid "Paste"
+msgstr "Redare (paste)"
+
+#: ../ui/ui-drv/win32/ui_win32.c:1297
+msgid "About"
+msgstr "Despre"
+
+#: ../ui/ui-drv/cocoa/AppController.m:197
+#, fuzzy
+msgid "About XaoS"
+msgstr "Despre"
+
+#: ../ui/ui-drv/cocoa/AppController.m:200
+msgid "Services"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:203
+msgid "Hide XaoS"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:206
+msgid "Hide Others"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:209
+msgid "Show All"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:212
+#, fuzzy
+msgid "Quit XaoS"
+msgstr "Terminare"
+
+#: ../ui/ui-drv/cocoa/AppController.m:318
+msgid "Cut"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:327
+#, fuzzy
+msgid "Delete"
+msgstr "Paleta"
+
+#: ../ui/ui-drv/cocoa/AppController.m:330
+msgid "Select All"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:340
+msgid "Minimize"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:348
+msgid "Bring All to Front"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/AppController.m:359
+#, fuzzy
+msgid "Close"
+msgstr "Culoare"
+
+#: ../ui/ui-drv/cocoa/AppController.m:373
+msgid "Videator Output"
+msgstr ""
+
+#: ../ui/ui-drv/cocoa/CustomDialog.m:142
+msgid "Choose"
+msgstr ""
+
+#, fuzzy
+#~ msgid "User function"
+#~ msgstr "Functii pentru desenarea liniilor"
+
+#~ msgid "formulae"
+#~ msgstr "Formule"
diff --git a/src/include/aconfig.h.in b/src/include/aconfig.h.in
new file mode 100644
index 0000000..40d0f7e
--- /dev/null
+++ b/src/include/aconfig.h.in
@@ -0,0 +1,60 @@
+#ifndef ACONFIG_H
+#define ACONFIG_H
+#undef HAVE_PTHREAD_SIGHANDLER
+#undef DATAPATH
+#undef C_ALLOCA
+#undef const
+#undef USE_PTHREAD
+/*Avoid stack frame explosion on Windoze*/
+#ifndef _WIN32
+/*BeOS crashes badly when large amounts of stack are consumed */
+#ifndef __BEOS__
+#undef HAVE_ALLOCA
+#undef HAVE_ALLOCA_H
+#endif
+#endif
+#undef HAVE_FABSL
+#undef HAVE__FABSL
+#undef HAVE___FABSL
+#undef HAVE_FTIME
+#undef USE_PNG
+#undef HAVE_FINITE
+#undef HAVE_SELECT
+#undef HAVE_LONG_DOUBLE
+#undef HAVE_REDRAWWIN
+#undef HAVE_WREDRAWLN
+#undef USE_NCURSES
+#undef inline
+#undef _POSIX_SOURCE
+#undef STDC_HEADERS
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+#undef HAVE_GETTIMEOFDAY
+#undef HAVE_USLEEP
+#undef HAVE_TERMATTRS
+#undef HAVE_MOUSEMASK
+#undef HAVE_SETITIMER
+/* Define if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+/* Define if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+/* Define if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+#undef MITSHM
+#undef CURSES_DRIVER
+#undef BEOS_DRIVER
+#undef AA_DRIVER
+#undef GTK_DRIVER
+#undef GGI_DRIVER
+#undef X11_DRIVER
+#undef DGA_DRIVER
+#undef SVGA_DRIVER
+#undef WIN32_DRIVER
+#undef DDRAW_DRIVER
+#undef HTML_HELP
+#undef SIZEOF_SHORT
+#undef SIZEOF_INT
+#undef SIZEOF_LONG
+#undef HAVE_GETTEXT
+#undef NO_MALLOC_H
+#endif
diff --git a/src/include/archaccel.h b/src/include/archaccel.h
new file mode 100644
index 0000000..498f028
--- /dev/null
+++ b/src/include/archaccel.h
@@ -0,0 +1,14 @@
+#ifndef ACCEL_H
+#define ACCEL_H
+#ifdef __GNUC__
+#ifdef __i386__
+#ifdef __OPTIMIZE__
+#include <i386/sstring.h>
+#endif
+#endif
+#endif
+#endif
+
+#ifndef memset_long
+#define memset_long(x,y,z) memset(x,y,z)
+#endif
diff --git a/src/include/btrace.h b/src/include/btrace.h
new file mode 100644
index 0000000..a014934
--- /dev/null
+++ b/src/include/btrace.h
@@ -0,0 +1,12 @@
+#ifndef BTRACE_H
+#define BTRACE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+ int boundarytrace(int x1, int y1, int x2, int y2, number_t * xpos,
+ number_t * ypos);
+ int boundarytraceall(number_t * xpos, number_t * ypos);
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/include/c256.h b/src/include/c256.h
new file mode 100644
index 0000000..5854ba1
--- /dev/null
+++ b/src/include/c256.h
@@ -0,0 +1,12 @@
+#ifdef cpixel_t
+#undef cpixel_t
+#undef cpixeldata_t
+#undef cppixel_t
+#undef bpp
+#endif
+#define cpixel_t pixel8_t
+#define cppixel_t ppixel8_t
+#define cpixeldata_t pixel8_t
+#define bpp 1
+#include <generic.h>
+#define bpp1
diff --git a/src/include/catalog.h b/src/include/catalog.h
new file mode 100644
index 0000000..ba33f84
--- /dev/null
+++ b/src/include/catalog.h
@@ -0,0 +1,27 @@
+/* Small library to handle catalog files
+ */
+#ifndef CATALOG_H
+#define CATALOG_H
+#define CHASHMAX 31 /*Just small hash table. Should be OK */
+#include <xio.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+ struct varnames {
+ struct varnames *left, *right;
+ char *name;
+ char *value;
+ };
+ typedef struct catalog {
+ struct varnames *root[CHASHMAX];
+ } catalog_t;
+/*Find text in catalog */
+ extern char *find_text(catalog_t * catalog, CONST char *name);
+/*Load catalog from file */
+ extern catalog_t *load_catalog(xio_file f, CONST char **error);
+/*Free memory used by catalog */
+ extern void free_catalog(catalog_t *);
+#ifdef __cplusplus
+}
+#endif
+#endif /*VARIABLE_H */
diff --git a/src/include/complex.h b/src/include/complex.h
new file mode 100644
index 0000000..75b31e6
--- /dev/null
+++ b/src/include/complex.h
@@ -0,0 +1,63 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Simplified version. See XaoS2.2 for full version of this library.
+ * It caused problems (overflows) at certain preprocesors
+ */
+#ifndef COMPLEX_H
+#define COMPLEX_H
+#include <config.h>
+
+#define c_add(ar,ai,br,bi,or,oi) ((or)=(ar)+(br),(oi)=(ai)+(bi))
+#define c_mul(ar,ai,br,bi,or,oi) ((or)=(ar)*(br)-(ai)*(bi),(oi)=((ar)*(bi))+((ai)*(br)))
+
+#define c_sub(ar,ai,br,bi,or,oi) ((or)=(ar)-(br),(oi)=(ai)-(bi))
+
+#define c_div_rp(ar,ai,br,bi) (((ar) * (br) + (ai) * (bi))/ ((bi) * (bi) + (br) * (br)))
+#define c_div_ip(ar,ai,br,bi) ((-(ar) * (bi) + (ai) * (br)) / ((br) * (br) + (bi) * (bi)))
+#define c_div(ar,ai,br,bi,or,oi) ((or)=c_div_rp(ar,ai,br,bi),(oi)=c_div_ip(ar,ai,br,bi))
+
+#define c_pow2_rp(ar,ai) ((ar)*(ar)-(ai)*(ai))
+#define c_pow2_ip(ar,ai) (2*(ar)*(ai))
+#define c_pow2(ar,ai,or,oi) ((or)=c_pow2_rp(ar,ai),(oi)=c_pow2_ip(ar,ai))
+
+
+#define c_pow3_rp(ar,ai) ((ar)*(ar)*(ar)-3*(ar)*(ai)*(ai))
+#define c_pow3_ip(ar,ai) (3*(ar)*(ar)*(ai)-(ai)*(ai)*(ai))
+#define c_pow3(ar,ai,or,oi) ((or)=c_pow3_rp(ar,ai),(oi)=c_pow3_ip(ar,ai))
+
+#define c_pow4_rp(ar,ai) ((ar)*(ar)*(ar)*(ar)-6*(ar)*(ar)*(ai)*(ai)+(ai)*(ai)*(ai)*(ai))
+#define c_pow4_ip(ar,ai) (4*(ar)*(ar)*(ar)*(ai)-4*(ar)*(ai)*(ai)*(ai))
+#define c_pow4(ar,ai,or,oi) ((or)=c_pow4_rp(ar,ai),(oi)=c_pow4_ip(ar,ai))
+
+
+#ifndef __GNUC__
+#ifdef INLINEFABS
+#define myabs(x) INLINEFABS(x)
+#else
+#define myabs(x) ((x)>0?(x):-(x))
+#endif
+#else
+#include <gccbuild.h>
+#endif
+
+#endif /* COMPLEX_H */
diff --git a/src/include/config/aconfig.std b/src/include/config/aconfig.std
new file mode 100644
index 0000000..9c10eed
--- /dev/null
+++ b/src/include/config/aconfig.std
@@ -0,0 +1,28 @@
+/* aconfig.h. Generated automatically by configure. */
+#ifndef ACONFIG_H
+#define DATAPATH "./"
+#define ACONFIG_H
+#define HAVE_LONG_DOUBLE 1
+#define USE_PNG
+#define SIZEOF_INT 4
+#define HAVE_FINITE
+#define USE_STDIO
+#define SIZEOF_SHORT 2
+#define SIZEOF_LONG 4
+/* #undef inline */
+/* #undef _POSIX_SOURCE */
+#define STDC_HEADERS 1
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_MOUSEMASK 1
+#define HAVE_USLEEP 1
+#define USE_ALLEGRO 1
+#define HAVE_UCLOCK 1
+#define HAVE_TERMATTRS 1
+#define HAVE_SETITIMER 1
+#define HAVE_LIMITS_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_UNISTD_H 1
+#define AA_DRIVER 1
+#endif
diff --git a/src/include/config/config.autoconf b/src/include/config/config.autoconf
new file mode 100644
index 0000000..8553574
--- /dev/null
+++ b/src/include/config/config.autoconf
@@ -0,0 +1,141 @@
+#ifndef CONFIG_H
+#define CONFIG_H
+#define HOMEDIR
+
+#ifdef __BEOS__
+#define MAIN_FUNCTION be_main
+#ifdef __POWERPC__
+# define SLOWCACHESYNC
+# ifdef __MWERKS__
+# define INLINEFABS(x) __fabs(x)
+# endif
+#endif
+#endif
+
+#ifdef _WIN32
+#define CONFIGFILE "XaoS.cfg"
+#else
+#define CONFIGFILE ".XaoSrc"
+#endif
+
+/*For compilers that don't support nameless unions, do a
+#define NONAMELESSUNION
+before #include <ddraw.h>*/
+#ifdef _WIN32
+#define NONAMELESSUNION
+#endif
+
+/*#define I_WAS_HERE */ /*uncoment this to disable changing of parameters by atoconf */
+
+#define FPOINT_TYPE long double
+ /*floating point math type on computers
+ with medium speed floating point math should
+ use float instead */
+#include <aconfig.h>
+#define USE_STDIO
+#if !defined(HAVE_LONG_DOUBLE)&&!defined(I_WAS_HERE)
+#undef FPOINT_TYPE
+#define FPOINT_TYPE double
+#endif
+#define CONST const
+#define INLINE inline
+
+/* BeOS have broken long double IO routines on i386. Use our replacements */
+#ifdef __BEOS__
+#ifdef __i386__
+#define USE_XLDIO
+#endif
+#endif
+
+/* Win32 don't support long double IO. Use our replacements if possible */
+#ifdef _WIN32
+#ifndef __GNUC__
+1
+/* You need to solve long double IO problems to compile XaoS on non-gcc
+ * compiler */
+#endif
+#define USE_XLDIO
+#endif
+
+#include "gccaccel.h"
+#ifdef HAVE_MOUSEMASK
+#define NCURSESMOUSE
+#endif
+#ifndef HAVE_LIMITS_H
+#define INT_MAX 2127423647
+#endif
+#ifdef SVGA_DRIVER
+#define DESTICKY
+#endif
+#ifdef COCOA_DRIVER
+#define SFIXEDCOLOR
+#define STRUECOLOR
+#define STRUECOLOR16
+#define STRUECOLOR24
+#define SMBITMAPS
+#define SLBITMAPS
+#endif
+#ifdef GTK_DRIVER
+#define SFIXEDCOLOR
+#define STRUECOLOR
+#define STRUECOLOR16
+#define STRUECOLOR24
+#define SMBITMAPS
+#define SLBITMAPS
+#endif
+#ifdef X11_DRIVER
+#define SFIXEDCOLOR
+#define STRUECOLOR
+#define STRUECOLOR16
+#define STRUECOLOR24
+#define SMBITMAPS
+#define SLBITMAPS
+#endif
+#ifdef SVGA_DRIVER
+#undef STRUECOLOR16
+#define STRUECOLOR16
+#undef STRUECOLOR24
+#define STRUECOLOR24
+#endif
+#ifdef GGI_DRIVER
+#undef STRUECOLOR16
+#define STRUECOLOR16
+#undef STRUECOLOR24
+#define STRUECOLOR24
+#undef SLBITMAPS
+#define SLBITMAPS
+#endif
+#ifdef BEOS_DRIVER
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __GNUC__
+void be_exit_xaos(int i) __attribute__ ((__noreturn__));
+#else
+void be_exit_xaos(int i);
+#endif
+#ifdef __cplusplus
+}
+#endif
+#define exit_xaos(i) be_exit_xaos(i)
+#undef STRUECOLOR16
+#define STRUECOLOR16
+#undef SFIXEDCOLOR
+#define SFIXEDCOLOR
+#undef SMBITMAPS
+#define SMBITMAPS
+#undef SLBITMAPS
+#define SLBITMAPS
+#endif
+#ifdef WIN32_DRIVER
+#define MAIN_FUNCTION XaoS_main
+#undef STRUECOLOR16
+#define STRUECOLOR16
+#undef STRUECOLOR24
+#define STRUECOLOR24
+#endif
+#ifdef HAVE_SELECT
+#define COMPILE_PIPE
+#endif
+#endif /*CONFIG_H */
+
diff --git a/src/include/config/config.std b/src/include/config/config.std
new file mode 100644
index 0000000..c5313e9
--- /dev/null
+++ b/src/include/config/config.std
@@ -0,0 +1,28 @@
+#ifndef CONFIG_H
+#define CONFIG_H
+#define CONFIGFILE "xaos.cfg"
+#define FPOINT_TYPE long double
+ /*floating point math type on computers
+ with medium speed floating point math should
+ use float instead */
+#define USE_LONG /*for autoconf..undefine if
+ fpoint_type is set to other than
+ long_double */
+/*#define MITSHM */
+ /*undefine this if you system does not
+ support shared memory */
+/* You don't need to change these lines unless you now what you are doing */
+
+#include <aconfig.h>
+#define USE_STDIO
+#include <gccaccel.h>
+#define HAVE_GETTIMEOFDAY
+#define TIME_WITH_SYS_TIME
+#define HAVE_LIMITS_H
+#define HAVE_UNISTH_H
+#define HAVE_SYS_TIME_H
+#define
+#define STRUECOLOR24
+#define STRUECOLOR
+#define STRUECOLOR16
+#endif /*CONFIG_H */
diff --git a/src/include/cursor.h b/src/include/cursor.h
new file mode 100644
index 0000000..45859fc
--- /dev/null
+++ b/src/include/cursor.h
@@ -0,0 +1,56 @@
+CONST static unsigned char wait_pointer_data[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 1, 0,
+ 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1,
+ 0, 0, 0, 1, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1,
+ 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1,
+ 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0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
diff --git a/src/include/fconfig.h b/src/include/fconfig.h
new file mode 100644
index 0000000..bd007b3
--- /dev/null
+++ b/src/include/fconfig.h
@@ -0,0 +1,63 @@
+#ifndef FCONFIG_H
+#define FCONFIG_H
+#include <config.h>
+#define TUTORIALPATH DATAPATH"/tutorial/"
+#define EXAMPLESPATH DATAPATH"/examples/"
+#define CATALOGSPATH DATAPATH"/catalogs/"
+#define HELPPATH DATAPATH"/help/xaos.hlp"
+
+#define DEFAULT_MAX_ITER 170
+ /*default number of iterations should be set
+ lower for slow computers */
+#define DEFAULT_BAILOUT 4
+#define MAXSTEP (0.008*3)
+ /*zooming step. For slow computer should
+ be set lower. Longer steps takes more time
+ and invoke yet longer ones etc.. */
+#define STEP (0.0006*3)
+ /*speedup */
+#define XSIZE 640
+ /*default sizes of window */
+#define YSIZE 480
+#define ROTATIONSPEED 30
+
+
+
+ /*some constatnts used by various parts of XaoS */
+#ifndef DEBUG
+#define NDEBUG
+#endif
+#ifndef FRAMERATE /*plan9 seems to require this */
+#define FRAMERATE 20
+#define LOOKSIZE 2
+ /*size explored by autopilot */
+#define RANGE1 30
+#define NGUESSES (RANGE1*RANGE1/2)
+#define MAXTIME 10
+ /*maximum zooming time to one direction */
+#define NGUESSES1 10
+ /*maximum number of guesses using first
+ method */
+#define NGUESSES2 1000
+ /*maximum number of guesses using second
+ method */
+#define SPEEDUP 1.05
+ /*speedup of speedup */
+#endif
+/*#define SLOWFUNCPTR*/
+
+#ifdef _plan9_
+#undef number_t
+#define number_t double
+#else
+typedef FPOINT_TYPE number_t;
+#endif
+
+#undef STAT
+#ifdef STATISTICS
+#define STAT(x) x
+#else
+#define STAT(x)
+#endif
+#define NUMBER_BIG ((number_t)INT_MAX)
+#endif /*FCONFIG_H */
diff --git a/src/include/filter.h b/src/include/filter.h
new file mode 100644
index 0000000..be27bd5
--- /dev/null
+++ b/src/include/filter.h
@@ -0,0 +1,335 @@
+#ifndef IMAGE_H
+#define IMAGE_H
+#include "fconfig.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ typedef unsigned char pixel_t;
+ typedef unsigned char rgb_t[4]; /*4 is better than 3 - makes multiplying easier */
+ struct truec {
+ int rshift, gshift, bshift; /*the shift ammounts */
+ int rprec, gprec, bprec; /*precisity - 0=8bit, 1=7bit, -1=9bit etc... */
+ unsigned int rmask, gmask, bmask; /*masks */
+ unsigned int mask1, mask2, allmask; /*Mask1 and mask2 are distinc color masks
+ allmask are mask for all colors */
+ int byteexact; /*When every colors is at one byte */
+ int missingbyte; /*for 32bit truecolor and exact byte places one byte is
+ unused... */
+ };
+ union paletteinfo {
+ struct truec truec;
+ };
+ struct palette {
+ int start;
+ int end;
+ int maxentries;
+ int version;
+ int type;
+ unsigned int *pixels;
+ int npreallocated;
+ rgb_t *rgb;
+ int flags;
+ int (*alloccolor) (struct palette * pal, int init, int r, int g,
+ int b);
+ void (*setpalette) (struct palette * pal, int start, int end,
+ rgb_t * rgb);
+ void (*allocfinished) (struct palette * pal);
+ void (*cyclecolors) (struct palette * pal, int direction);
+ int size; /*number of allocated color entries */
+ void *data; /*userdata */
+ /*Preallocated palette cells */
+ int ncells;
+ unsigned int *index;
+ CONST rgb_t *prergb;
+ union paletteinfo info;
+ };
+ struct image {
+ float pixelwidth, pixelheight;
+ pixel_t **oldlines;
+ pixel_t **currlines;
+ void (*flip) (struct image * img);
+ int width, height, nimages;
+ int bytesperpixel;
+ int currimage;
+ int flags;
+ int scanline;
+ int version;
+ struct palette *palette;
+ void *data; /*userdata */
+ };
+#define interpol1(i1,i2,n,mask) ((((i1)&(mask))*(n)+((i2)&(mask))*(256-(n)))&((mask)<<8))
+#define interpol(i1,i2,n,mr,mg,mb) ((interpol1(i1,i2,n,mr)+interpol1(i1,i2,n,mg)+interpol1(i1,i2,n,mb))>>8)
+#define intergray(i1,i2,n) (((i1)*n+(i2)*(256-(n)))>>8)
+ /*
+ * J.B. Langston 3/13/2008
+ *
+ * The Mac OS X driver requires a 32-bit rgb mask where the most significant
+ * byte is on (e.g., 0xffffff00). This exposed a bug in the interpol macro
+ * that resulted in distorted colors for the smooth coloring modes.
+ * If the interpol macro is applied to such a mask, it causes an overflow
+ * of the 32-bit int, and the left-most color byte is lost.
+ *
+ * I added shiftinterpol macro to handle such masks. It shifts everything 1
+ * byte to the right, performs the calculation, and then shifts everything
+ * back 1 byte to the left when it is done.
+ *
+ * I also created the safeinterpol macro which detects if the most
+ * signficant byte in the mask is on, and uses the shiftinterpol macro if
+ * so, or the orignal interpol macro if not.
+ *
+ * I then modified the interpoltype macro to use the safeinterpol macro
+ * instead of the interpol macro directly.
+ */
+#define shiftinterpol(i1,i2,n,mr,mg,mb) (interpol((i1)>>8,(i2)>>8,n,(mr)>>8,(mg)>>8,(mb)>>8)<<8)
+#define safeinterpol(i1,i2,n,mr,mg,mb) ((((mr)|(mg)|(mb))&0xff000000)?shiftinterpol(i1,i2,n,mr,mg,mb):interpol(i1,i2,n,mr,mg,mb))
+#define interpoltype(palette,i1,i2,n) ((palette).type==GRAYSCALE || (palette).type == LARGEITER?intergray(i1,i2,n):safeinterpol(i1,i2,n,(palette).info.truec.rmask,(palette).info.truec.gmask,(palette).info.truec.bmask))
+/*palette flags */
+#define UNKNOWNENTRIES 1
+#define DONOTCHANGE 2
+#define FINISHLATER 4
+#define UNFINISHED 8
+/*image flags */
+#define FREELINES 1
+#define FREEDATA 2
+#define AAIMAGE 4
+#define PROTECTBUFFERS 8
+/*palette types supported by most of engine*/
+#define C256 1
+#define GRAYSCALE 2
+#define TRUECOLOR16 4
+#define TRUECOLOR24 8
+#define TRUECOLOR 16
+/*special mage types used internaly by XaoS */
+#define LARGEITER 32
+#define SMALLITER 64
+
+/*palette types handled by the dithering filter*/
+#define LBITMAP 256
+#define MBITMAP 512
+#define LIBITMAP 1024
+#define MIBITMAP 2048
+#define FIXEDCOLOR 4096
+
+#define ALLMASK (C256|TRUECOLOR16|TRUECOLOR24|LARGEITER|GRAYSCALE)
+#define BITMAPS (LBITMAP|MBITMAP|LIBITMAP|MIBITMAP)
+#define MASK1BPP (SMALLITER|C256|GRAYSCALE)
+#define MASK2BPP (TRUECOLOR16|LARGEITER)
+#define MASK3BPP (TRUECOLOR24)
+#define MASK4BPP (TRUECOLOR)
+
+/*flags for requirements */
+#define IMAGEDATA 1
+#define TOUCHIMAGE 2
+#define NEWIMAGE 4
+/*flags for initdata */
+#define DATALOST 1
+/*flags for doit */
+#define INTERRUPTIBLE 1
+#define PALETTEONLY 2
+/*return flags */
+#define INEXACT 1
+#define CHANGED 2
+#define ANIMATION 4
+#define UNCOMPLETTE (1<<29)
+/*flags for filters */
+#define ALLOCEDIMAGE 1 /*used by inherimage mechanizm */
+#define SHAREDDATA 2
+
+#define PALGORITHMS 3
+#ifdef _plan9_
+#undef pixel32_t
+#undef pixel8_t
+#undef pixel16_t
+#define pixel32_t unsigned int
+#define pixel16_t unsigned short
+#define pixel8_t unsigned char
+#undef ppixel8_t
+#undef ppixel16_t
+#undef ppixel24_t
+#undef ppixel32_t
+#define ppixel8_t pixel8_t *
+#define ppixel16_t pixel16_t *
+#define ppixel24_t unsigned char *
+#define ppixel32_t pixel32_t *
+#else
+#include <pixel_t.h> /*avoid problems with plan9-it ignores #if
+ So code must be separated into another file */
+#endif
+#define imgetpixel(image,x,y) ((image)->bytesperpixel==1?(image)->currlines[y][x]:((image)->bytesperpixel==4?((pixel32_t*)(image)->currlines[y])[x]:(image)->bytesperpixel==3?(((pixel16_t *)(image)->currlines[y])[x]+((image)->currlines[y][3*(x)+2]<<16)):(((pixel16_t*)(image)->currlines[y])[x])))
+ struct requirements {
+ int nimages;
+ int supportedmask;
+ int flags;
+ };
+ struct filter {
+ struct filter *next, *previous;
+ struct queue *queue;
+ CONST struct filteraction *action;
+ struct image *image, *childimage;
+ struct requirements req;
+ struct fractal_context *fractalc;
+ void *data;
+ CONST char *name;
+ int flags;
+ int imageversion; /*For detection whether image changed or not */
+ void (*wait_function) (struct filter * f);
+ /*stuff for wait_function */
+ int pos, max, incalculation, readyforinterrupt, interrupt;
+ CONST char *pass;
+ };
+ struct initdata {
+ void (*wait_function) (struct filter * f);
+ struct image *image;
+ struct fractal_context *fractalc;
+ int flags;
+ };
+ struct filteraction {
+ CONST char *name;
+ CONST char *shortname;
+ int flags;
+ struct filter *(*getinstance) (CONST struct filteraction * a);
+ void (*destroyinstance) (struct filter * f);
+ int (*doit) (struct filter * f, int flags, int time);
+ int (*requirement) (struct filter * f, struct requirements * r);
+ int (*initialize) (struct filter * f, struct initdata * i);
+ void (*convertup) (struct filter * f, int *x, int *y);
+ void (*convertdown) (struct filter * f, int *x, int *y);
+ void (*removefilter) (struct filter * f);
+ };
+ struct queue {
+ struct filter *first, *last;
+ int isinitialized;
+ struct filter *palettechg;
+ struct image *saveimage;
+ };
+
+
+#define datalost(f,i) (((i)->flags&DATALOST)||((f)->imageversion&&(f)->imageversion!=(i)->image->version))
+/*filter actions */
+
+ extern unsigned int col_diff[3][512];
+ struct filter *createfilter(CONST struct filteraction *fa);
+ struct queue *create_queue(struct filter *f);
+ void insertfilter(struct filter *f1, struct filter *f2);
+ void removefilter(struct filter *f);
+ void addfilter(struct filter *f1, struct filter *f2);
+ int initqueue(struct queue *q);
+
+/*Filter utility functions */
+ int reqimage(struct filter *f, struct requirements *req,
+ int supportedmask, int flags);
+ int inherimage(struct filter *f, struct initdata *data, int flags,
+ int width, int height, struct palette *palette,
+ float pixelwidth, float pixelheight);
+ void destroyinheredimage(struct filter *f);
+ void updateinheredimage(struct filter *f);
+
+ void inhermisc(struct filter *f, CONST struct initdata *i);
+
+/*image actions */
+
+ void flipgeneric(struct image *img);
+ struct image *create_image_lines(int width, int height,
+ int nimages, pixel_t ** lines1,
+ pixel_t ** lines2,
+ struct palette *palette,
+ void (*flip) (struct image * img),
+ int flags, float pixelwidth,
+ float pixelheight);
+ struct image *create_image_cont(int width, int height,
+ int scanlinesize, int nimages,
+ pixel_t * buf1, pixel_t * buf2,
+ struct palette *palette,
+ void (*flip) (struct image * img),
+ int flags, float pixelwidth,
+ float pixelheight);
+ struct image *create_image_mem(int width, int height, int nimages,
+ struct palette *palette,
+ float pixelwidth, float pixelheight);
+ struct image *create_subimage(struct image *simg, int width,
+ int height, int nimages,
+ struct palette *palette,
+ float pixelwidth, float pixelheight);
+
+ void destroy_image(struct image *img);
+ void clear_image(struct image *img);
+
+/*palette */
+
+ int bytesperpixel(int type) CONSTF;
+ void bestfit_init(void);
+ struct palette *createpalette(int start, int end, int type, int flags,
+ int maxentries,
+ int (*alloccolor) (struct palette * pal,
+ int init, int r,
+ int g, int b),
+ void (*setcolor) (struct palette * pal,
+ int start, int end,
+ rgb_t * rgb),
+ void (*allocfinished) (struct palette *
+ pal),
+ void (*cyclecolors) (struct palette *
+ pal, int direction),
+ union paletteinfo *info);
+ void destroypalette(struct palette *palette);
+ int mkdefaultpalette(struct palette *palette);
+ int mkstereogrampalette(struct palette *palette);
+ int mkstarfieldpalette(struct palette *palette);
+ int mkblurpalette(struct palette *palette);
+ int mkgraypalette(struct palette *palette);
+ int mkrgb(struct palette *palette);
+ int mkpalette(struct palette *palette, int seed, int algorithm);
+ int shiftpalette(struct palette *palette, int n);
+ void preallocpalette(struct palette *pal);
+ struct palette *clonepalette(struct palette *palette);
+ void restorepalette(struct palette *dest, struct palette *src);
+ void convertupgeneric(struct filter *f, int *x, int *y);
+ void convertdowngeneric(struct filter *f, int *x, int *y);
+ int fixedalloccolor(struct palette *palette, int init, int r, int g,
+ int b) CONSTF;
+
+#define setfractalpalette(f,p) if((f)->fractalc->palette==(f)->image->palette) (f)->fractalc->palette=(p)
+
+#ifdef STRUECOLOR24
+#define TRUECOLOR24CASE(x) case 3:x;break;
+#else
+#define TRUECOLOR24CASE(x)
+#endif
+
+#ifdef STRUECOLOR16
+#define SUPPORT16
+#endif
+#ifdef SUPPORT16
+#define TRUECOLOR16CASE(x) case 2:x;break;
+#else
+#define TRUECOLOR16CASE(x)
+#endif
+
+#define drivercall(i,x1,x2,x3,x4) switch((i).bytesperpixel) { \
+ TRUECOLOR24CASE(x3); \
+ TRUECOLOR16CASE(x2); \
+ case 1:x1;break; \
+ case 4:x4; \
+}
+#ifdef SMBITMAPS
+#define SBITMAPS
+#else
+#ifdef SLBITMAPS
+#define SBITMAPS
+#endif
+#endif
+
+#ifdef SBITMAPS
+#define SCONVERTORS
+#else
+#ifdef SFIXEDCOLOR
+#define SCONVERTORS
+#endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#include "formulas.h"
+#endif
diff --git a/src/include/formulas.h b/src/include/formulas.h
new file mode 100644
index 0000000..4a061cc
--- /dev/null
+++ b/src/include/formulas.h
@@ -0,0 +1,64 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifndef FORMULAS_H
+#define FORMULAS_H
+
+#include <config.h>
+#include <fractal.h>
+
+#ifdef SFFE_USING
+#include "sffe.h"
+#ifdef SFFE_CMPLX_ASM
+#include "sffe_cmplx_asm.h"
+#elif SFFE_CMPLX_GSL
+#include "sffe_cmplx_gsl.h"
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef SFFE_USING
+ /*extern sffe* parser;
+ extern sffe* pinit; */
+ extern cmplx Z;
+ extern cmplx pZ;
+ extern cmplx C;
+#endif
+
+#define MAX_LAMBDA 2
+
+
+#define FORMULAMAGIC 1121
+
+ extern CONST char *CONST incolorname[];
+ extern CONST struct formula formulas[];
+ extern CONST char *CONST outcolorname[];
+ extern CONST char *CONST tcolorname[];
+ extern CONST int nformulas;
+ extern CONST int nmformulas;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* FORMULAS_H */
diff --git a/src/include/fractal.h b/src/include/fractal.h
new file mode 100644
index 0000000..188ac8d
--- /dev/null
+++ b/src/include/fractal.h
@@ -0,0 +1,170 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifndef FRACTAL1_H
+#define FRACTAL1_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "config.h"
+#include "fconfig.h"
+#define INCOLORING 11
+#define OUTCOLORING 11
+#define TCOLOR 15
+
+ typedef struct {
+ number_t y0, k;
+ } symetrytype;
+
+ struct symetryinfo {
+ number_t xsym, ysym;
+ int nsymetries;
+ CONST symetrytype *symetry;
+ };
+ typedef struct {
+ number_t mc, nc;
+ number_t mi, ni;
+ } vrect;
+ typedef struct {
+ number_t cr, ci;
+ number_t rr, ri;
+ } vinfo;
+ typedef unsigned int (*iterationfunc) (number_t, number_t, number_t,
+ number_t) CONSTF REGISTERS(3);
+ struct formula {
+ int magic;
+#ifndef SLOWFUNCPTR
+ iterationfunc calculate, calculate_periodicity, smooth_calculate,
+ smooth_calculate_periodicity;
+#endif
+ void (*calculate_julia) (struct image * img, register number_t pre,
+ register number_t pim);
+ CONST char *name[2];
+ CONST char *shortname;
+ vinfo v;
+ int hasperiodicity;
+ int mandelbrot;
+ number_t pre, pim;
+ struct symetryinfo (out[OUTCOLORING + 1]);
+ struct symetryinfo (in[INCOLORING + 1]);
+ int flags;
+ };
+
+ struct fractal_context {
+ number_t pre, pim;
+ number_t bre, bim;
+ CONST struct formula *currentformula;
+ number_t angle;
+ int periodicity;
+ unsigned int maxiter;
+ number_t bailout;
+ int coloringmode, incoloringmode;
+ int intcolor, outtcolor;
+ int mandelbrot;
+ int plane;
+ int version;
+ int range;
+ float windowwidth, windowheight;
+ vinfo s;
+ vrect rs;
+ number_t sin, cos;
+ int slowmode; /* 1 in case we want to be exact, not fast */
+ /*values temporary filled by set_fractal_context */
+ iterationfunc calculate[2];
+ number_t periodicity_limit;
+ struct palette *palette; /*fractal's palette */
+ };
+ typedef struct fractal_context fractal_context;
+ typedef struct {
+ double y0, k, kk, y0k;
+ } symetry2;
+
+ struct symetryinfo2 {
+ number_t xsym, ysym;
+ int nsymetries;
+ symetry2 *symetry;
+ number_t xmul, ymul, xdist, ydist;
+ };
+#define STARTZERO 1
+#define JULIA_BTRACE 2
+#define MANDEL_BTRACE 4
+
+#ifdef SFFE_USING
+#define SFFE_FRACTAL 8
+#endif
+
+#define BTRACEOK ((cformula.flags&(2<<cfractalc.mandelbrot))&&!cfractalc.incoloringmode&&cfractalc.coloringmode!=7)
+#define rotate(f,x,y) { \
+ number_t tmp; \
+ tmp=(x)*(f).cos-(y)*(f).sin; \
+ y=(x)*(f).sin+(y)*(f).cos; \
+ x=tmp; \
+}
+#define rotateback(f,x,y) { \
+ number_t tmp; \
+ tmp=(x)*(f).cos+(y)*(f).sin; \
+ y=-(x)*(f).sin+(y)*(f).cos; \
+ x=tmp; \
+}
+
+ extern struct symetryinfo2 cursymetry;
+ extern struct fractal_context cfractalc;
+ extern struct formula cformula;
+ extern struct palette cpalette;
+ extern struct image cimage;
+
+#ifdef STATISTICS
+/*This is an statistics variables printed from various parts
+ *of XaoS.
+ */
+ extern int nadded2, nsymetry2, nskipped2;
+ extern int tocalculate2, avoided2, frames2;
+ extern int ncalculated2, ninside2;
+ extern int niter2, niter1;
+ extern int nperi;
+
+
+ extern int iters2, guessed2, unguessed2, total2;
+
+#endif
+
+ void set_formula(fractal_context *, int);
+ void set_fractalc(fractal_context *, struct image *img);
+ void fractalc_resize_to(fractal_context *, float, float);
+ void update_view(fractal_context *);
+ void free_fractalc(fractal_context *);
+ fractal_context *make_fractalc(CONST int, float, float);
+ void speed_test(fractal_context *, struct image *img);
+ unsigned int calculateswitch(register number_t x1,
+ register number_t y1,
+ register number_t x2,
+ register number_t y2,
+ int periodicity) REGISTERS(3);
+
+/* needs struct formula */
+#include <formulas.h>
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* FRACTAL_H */
diff --git a/src/include/gccaccel.h b/src/include/gccaccel.h
new file mode 100644
index 0000000..cd08fb4
--- /dev/null
+++ b/src/include/gccaccel.h
@@ -0,0 +1,40 @@
+/* GNU C accelerators */
+#if defined (__GNUC__)
+#define myfabs(x) fabs(x)
+#if __GNUC__ >= 2 && (__GNUC__ > 2 || __GNUC_MINOR__ >= 95)
+#define __GNUC__EGCS
+#endif
+#if __GNUC__ >= 2 && (__GNUC__ > 2 || __GNUC_MINOR__ > 7)
+#if __GNUC__ >= 2 && (__GNUC__ > 2 || __GNUC_MINOR__ >= 95)
+#define RESTRICT __restrict__
+#endif
+#define CONSTF __attribute__ ((__const__))
+#if __GNUC__ >= 3
+#define PUREF __attribute__ ((__pure__))
+#endif
+#define NORETURN __attribute__ ((__noreturn__))
+#ifdef __i386__
+#ifndef NOREGISTERS
+#define REGISTERS(n) __attribute__ ((__regparm__(n)))
+#endif /*NOREGISTERS*/
+#endif /*__i386__ */
+#endif /*version */
+#endif /*__GNUC__*/
+#ifndef RESTRICT
+#define RESTRICT
+#endif
+#ifndef CONSTF
+#define CONSTF
+#endif
+#ifndef PUREF
+#define PUREF
+#endif
+#ifndef NORETURN
+#define NORETURN
+#endif
+#ifndef REGISTERS
+#define REGISTERS(n)
+#endif
+#ifndef myfabs
+#define myfabs(x) ((x)>0?(x):-(x))
+#endif
diff --git a/src/include/gccbuild.h b/src/include/gccbuild.h
new file mode 100644
index 0000000..11601c9
--- /dev/null
+++ b/src/include/gccbuild.h
@@ -0,0 +1,65 @@
+/* BUGS:
+ * bellow gcc 2.7.2 builtins are not supported
+ * gcc 2.7.2.x don't inline long doubles
+ * egcc 1.0.1 crash in constant propagation when certain builtins are enabled
+ */
+
+
+#ifndef __GCCBUILD
+#define __GCCBUILD
+#if defined(__GLIBC__)
+#include "math.h"
+#else
+#if defined(__GNUC__) && defined(__i386__) && defined(__OPTIMIZE__)
+#if 0
+#include "i386/__math.h"
+#endif
+#endif
+#endif
+
+/* We really want to use builtins. Avoid any defines */
+#if defined __GNUC__ && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7))
+#define __HAVE_FABSL
+#define __fabsl(x) __builtin_fabsl(x)
+#define __fabs(x) __builtin_fabsl(x)
+#define __fabsf(x) __builtin_fabsf(x)
+#define sin(x) __builtin_sin(x)
+#define cos(x) __builtin_cos(x)
+#endif
+
+
+#include "aconfig.h"
+
+#ifndef __HAVE_FABSL
+#ifdef HAVE_FABSL
+#define __fabsl fabsl
+#define __HAVE_FABSL
+#else
+#ifdef HAVE__FABSL
+#define __fabsl _fabsl
+#define __HAVE_FABSL
+#else
+#ifdef HAVE___FABSL
+#define __HAVE___FABSL
+#endif
+#endif
+#endif
+#endif
+
+/* GCC 2.7.x have problems with long double inlines. Disable them! */
+#if defined __GNUC__ && (__GNUC__ == 2 && __GNUC_MINOR__ <= 7)
+#undef __HAVE_FABSL
+#endif
+
+#ifdef HAVE_LONG_DOUBLE
+#ifndef __HAVE_FABSL
+#define myabs(x) ((x)>0?(x):-(x))
+#else
+#define myabs(x) __fabsl((number_t)(x))
+#endif
+#else
+#define myabs(x) fabs((number_t)(x))
+#endif
+
+
+#endif /*gccbuild */
diff --git a/src/include/generic.h b/src/include/generic.h
new file mode 100644
index 0000000..b4f1cee
--- /dev/null
+++ b/src/include/generic.h
@@ -0,0 +1,15 @@
+#undef p_set
+#undef p_get
+#undef p_setp
+#undef bpp1
+#undef p_getp
+#undef p_add
+#undef p_inc
+#undef p_copy
+#define p_set(ptr,val) (*(ptr)=(val))
+#define p_get(ptr) (*(ptr))
+#define p_setp(ptr,pos,val) ((ptr)[(pos)]=(val))
+#define p_getp(ptr,pos) ((ptr)[(pos)])
+#define p_add(ptr,val) ((ptr)+(val))
+#define p_inc(ptr,val) ((ptr)+=(val))
+#define p_copy(ptr1,val1,ptr2,val2) ((ptr1)[val1]=(ptr2)[val2])
diff --git a/src/include/grlib.h b/src/include/grlib.h
new file mode 100644
index 0000000..288b0dd
--- /dev/null
+++ b/src/include/grlib.h
@@ -0,0 +1,40 @@
+#ifndef _TEXT_H
+#define _TEXT_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+ extern CONST struct xfont {
+ CONST unsigned char *data;
+ int width, height, realwidth, encoding;
+ } xsmallfont, xbigfont, xbigfont2, xaafont, xsmallfontil1, xbigfontil1,
+ xmedfontil1, xbigfont3;
+ int xiconv(int encoding, char *out, int *outlen, const char *in,
+ int *inlen);
+ int xprint(struct image *image, CONST struct xfont *current, int x,
+ int y, CONST char *text, int fgcolor,
+ int bgcolor, int mode);
+#define TEXT_PRESSED 1
+/*
+#define xtextheight(font) ((font)->height+1)
+#define xtextcharw(font,c) ((font)->width)
+ */
+ int xtextwidth(CONST struct xfont *font, CONST char *text);
+ int xtextheight(CONST struct xfont *font);
+ int xtextcharw(CONST struct xfont *font, CONST char c);
+ void xrectangle(struct image *image, int x, int y, int width,
+ int height, int fgcolor);
+ void xvline(struct image *image, int x, int y, int height,
+ int fgcolor);
+ void xhline(struct image *image, int x, int y, int width, int fgcolor);
+ char *xsaveline(struct image *img, int x1, int y1, int x2, int y2);
+ void xrestoreline(struct image *img, char *data, int x1, int y1,
+ int x2, int y2);
+ void xline(struct image *img, int x1, int y1, int x2, int y2,
+ int color);
+ void xprepareimage(struct image *img);
+ void xdrawcursor(struct image *img, int x, int y, int color,
+ int height);
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/include/hicolor.h b/src/include/hicolor.h
new file mode 100644
index 0000000..4807190
--- /dev/null
+++ b/src/include/hicolor.h
@@ -0,0 +1,16 @@
+#ifdef cpixel_t
+#undef cpixel_t
+#undef cpixeldata_t
+#undef cppixel_t
+#undef bpp
+#undef UNSUPPORTED
+#undef bpp1
+#endif
+#ifndef SUPPORT16
+#define UNSUPPORTED
+#endif
+#define cpixel_t pixel16_t
+#define cpixeldata_t pixel16_t
+#define cppixel_t ppixel16_t
+#define bpp 4
+#include <generic.h>
diff --git a/src/include/i386/__math.h b/src/include/i386/__math.h
new file mode 100644
index 0000000..0274d52
--- /dev/null
+++ b/src/include/i386/__math.h
@@ -0,0 +1,586 @@
+/* Inline math functions for i387.
+ Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by John C. Bowman <bowman@math.ualberta.ca>, 1995.
+
+ The GNU C 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.
+
+ The GNU C 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 the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+
+#ifndef __GLIBC__
+#ifdef __cplusplus
+# define __MATH_INLINE __inline
+#else
+# define __MATH_INLINE extern __inline
+#endif
+
+#ifndef ____MATH_H
+#define ____MATH_H
+
+
+#if defined __USE_ISOC9X && defined __GNUC__ && __GNUC__ >= 2
+/* ISO C 9X defines some macros to perform unordered comparisons. The
+ ix87 FPU supports this with special opcodes and we should use them.
+ These must not be inline functions since we have to be able to handle
+ all floating-point types. */
+# ifdef __i686__
+/* For the PentiumPro and more recent processors we can provide
+ better code. */
+# define isgreater(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucomip %%st(1), %%st; seta %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
+ __result; })
+# define isgreaterequal(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucomip %%st(1), %%st; setae %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
+ __result; })
+
+# define isless(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucomip %%st(1), %%st; seta %%al" \
+ : "=a" (__result) : "u" (x), "t" (y) : "cc", "st"); \
+ __result; })
+
+# define islessequal(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucomip %%st(1), %%st; setae %%al" \
+ : "=a" (__result) : "u" (x), "t" (y) : "cc", "st"); \
+ __result; })
+
+# define islessgreater(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucomip %%st(1), %%st; setne %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
+ __result; })
+
+# define isunordered(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucomip %%st(1), %%st; setp %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
+ __result; })
+# else
+/* This is the dumb, portable code for i386 and above. */
+# define isgreater(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
+ __result; })
+
+# define isgreaterequal(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
+ __result; })
+
+# define isless(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al" \
+ : "=a" (__result) : "u" (x), "t" (y) : "cc", "st", "st(1)"); \
+ __result; })
+
+# define islessequal(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al" \
+ : "=a" (__result) : "u" (x), "t" (y) : "cc", "st", "st(1)"); \
+ __result; })
+
+# define islessgreater(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucompp; fnstsw; testb $0x44, %%ah; setz %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
+ __result; })
+
+# define isunordered(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucompp; fnstsw; sahf; setp %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
+ __result; })
+# endif /* __i686__ */
+
+/* Test for negative number. Used in the signbit() macro. */
+__MATH_INLINE int __signbitf(float __x)
+{
+ union {
+ float __f;
+ int __i;
+ } __u = {
+ __f:__x};
+ return __u.__i < 0;
+}
+
+__MATH_INLINE int __signbit(double __x)
+{
+ union {
+ double __d;
+ int __i[2];
+ } __u = {
+ __d:__x};
+ return __u.__i[1] < 0;
+}
+
+__MATH_INLINE int __signbitl(long double __x)
+{
+ union {
+ long double __l;
+ int __i[3];
+ } __u = {
+ __l:__x};
+ return (__u.__i[2] & 0x8000) != 0;
+}
+#endif
+
+
+/* The gcc, version 2.7 or below, has problems with all this inlining
+ code. So disable it for this version of the compiler. */
+#if defined __GNUC__ && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 7))
+
+#if ((!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
+ && defined __OPTIMIZE__)
+
+/* A macro to define float, double, and long double versions of various
+ math functions for the ix87 FPU. FUNC is the function name (which will
+ be suffixed with f and l for the float and long double version,
+ respectively). OP is the name of the FPU operation. */
+
+#if defined __USE_MISC || defined __USE_ISOC9X
+# define __inline_mathop(func, op) \
+ __inline_mathop_ (double, func, op) \
+ __inline_mathop_ (float, __CONCAT(func,f), op) \
+ __inline_mathop_ (long double, __CONCAT(func,l), op)
+#else
+# define __inline_mathop(func, op) \
+ __inline_mathop_ (double, func, op)
+#endif
+
+#define __inline_mathop_(float_type, func, op) \
+ __inline_mathop_decl_ (float_type, func, op, "0" (__x))
+
+
+#if defined __USE_MISC || defined __USE_ISOC9X
+# define __inline_mathop_decl(func, op, params...) \
+ __inline_mathop_decl_ (double, func, op, params) \
+ __inline_mathop_decl_ (float, __CONCAT(func,f), op, params) \
+ __inline_mathop_decl_ (long double, __CONCAT(func,l), op, params)
+#else
+# define __inline_mathop_decl(func, op, params...) \
+ __inline_mathop_decl_ (double, func, op, params)
+#endif
+
+#define __inline_mathop_decl_(float_type, func, op, params...) \
+ __MATH_INLINE float_type func (float_type); \
+ __MATH_INLINE float_type func (float_type __x) \
+ { \
+ register float_type __result; \
+ __asm __volatile__ (op : "=t" (__result) : params); \
+ return __result; \
+ }
+
+
+#if defined __USE_MISC || defined __USE_ISOC9X
+# define __inline_mathcode(func, arg, code) \
+ __inline_mathcode_ (double, func, arg, code) \
+ __inline_mathcode_ (float, __CONCAT(func,f), arg, code) \
+ __inline_mathcode_ (long double, __CONCAT(func,l), arg, code)
+# define __inline_mathcode2(func, arg1, arg2, code) \
+ __inline_mathcode2_ (double, func, arg1, arg2, code) \
+ __inline_mathcode2_ (float, __CONCAT(func,f), arg1, arg2, code) \
+ __inline_mathcode2_ (long double, __CONCAT(func,l), arg1, arg2, code)
+# define __inline_mathcode3(func, arg1, arg2, arg3, code) \
+ __inline_mathcode3_ (double, func, arg1, arg2, arg3, code) \
+ __inline_mathcode3_ (float, __CONCAT(func,f), arg1, arg2, arg3, code) \
+ __inline_mathcode3_ (long double, __CONCAT(func,l), arg1, arg2, arg3, code)
+#else
+# define __inline_mathcode(func, arg, code) \
+ __inline_mathcode_ (double, func, (arg), code)
+# define __inline_mathcode2(func, arg1, arg2, code) \
+ __inline_mathcode2_ (double, func, arg1, arg2, code)
+# define __inline_mathcode3(func, arg1, arg2, arg3, code) \
+ __inline_mathcode3_ (double, func, arg1, arg2, arg3, code)
+#endif
+
+#define __inline_mathcode_(float_type, func, arg, code) \
+ __MATH_INLINE float_type func (float_type); \
+ __MATH_INLINE float_type func (float_type arg) \
+ { \
+ code; \
+ }
+
+#define __inline_mathcode2_(float_type, func, arg1, arg2, code) \
+ __MATH_INLINE float_type func (float_type, float_type); \
+ __MATH_INLINE float_type func (float_type arg1, float_type arg2) \
+ { \
+ code; \
+ }
+
+#define __inline_mathcode3_(float_type, func, arg1, arg2, arg3, code) \
+ __MATH_INLINE float_type func (float_type, float_type, float_type); \
+ __MATH_INLINE float_type func (float_type arg1, float_type arg2, \
+ float_type arg3) \
+ { \
+ code; \
+ }
+#endif
+
+
+#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
+/* Miscellaneous functions */
+
+__inline_mathcode(__sgn, __x,
+ return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0))
+ __inline_mathcode(__pow2, __x,
+ register long double __value;
+ register long double __exponent;
+ __extension__ long long int __p = (long long int)__x;
+ if (__x == (long double) __p)
+ {
+__asm __volatile__("fscale": "=t"(__value):"0"(1.0), "u"(__x));
+ return
+ __value;}
+__asm __volatile__("fld %%st(0)\n\t" "frndint # int(x)\n\t" "fxch\n\t" "fsub %%st(1) # fract(x)\n\t" "f2xm1 # 2^(fract(x)) - 1\n\t": "=t"(__value), "=u"(__exponent): "0"(__x)); __value += 1.0; __asm __volatile__("fscale": "=t"(__value):"0"(__value), "u"(__exponent));
+ return
+ __value)
+#define __sincos_code \
+ register long double __cosr; \
+ register long double __sinr; \
+ __asm __volatile__ \
+ ("fsincos\n\t" \
+ "fnstsw %%ax\n\t" \
+ "testl $0x400, %%eax\n\t" \
+ "jz 1f\n\t" \
+ "fldpi\n\t" \
+ "fadd %%st(0)\n\t" \
+ "fxch %%st(1)\n\t" \
+ "2: fprem1\n\t" \
+ "fnstsw %%ax\n\t" \
+ "testl $0x400, %%eax\n\t" \
+ "jnz 2b\n\t" \
+ "fstp %%st(1)\n\t" \
+ "fsincos\n\t" \
+ "1:" \
+ : "=t" (__cosr), "=u" (__sinr) : "0" (__x)); \
+ *__sinx = __sinr; \
+ *__cosx = __cosr
+
+ __MATH_INLINE void __sincos(double __x, double *__sinx,
+ double *__cosx);
+__MATH_INLINE void __sincos(double __x, double *__sinx, double *__cosx)
+{
+ __sincos_code;
+}
+
+__MATH_INLINE void __sincosf(float __x, float *__sinx, float *__cosx);
+__MATH_INLINE void __sincosf(float __x, float *__sinx, float *__cosx)
+{
+ __sincos_code;
+}
+
+__MATH_INLINE void __sincosl(long double __x, long double *__sinx,
+ long double *__cosx);
+__MATH_INLINE void
+__sincosl(long double __x, long double *__sinx, long double *__cosx)
+{
+ __sincos_code;
+}
+
+
+/* Optimized inline implementation, sometimes with reduced precision
+ and/or argument range. */
+
+#define __expm1_code \
+ register long double __value; \
+ register long double __exponent; \
+ register long double __temp; \
+ __asm __volatile__ \
+ ("fldl2e # e^x - 1 = 2^(x * log2(e)) - 1\n\t" \
+ "fmul %%st(1) # x * log2(e)\n\t" \
+ "fst %%st(1)\n\t" \
+ "frndint # int(x * log2(e))\n\t" \
+ "fxch\n\t" \
+ "fsub %%st(1) # fract(x * log2(e))\n\t" \
+ "f2xm1 # 2^(fract(x * log2(e))) - 1\n\t" \
+ "fscale # 2^(x * log2(e)) - 2^(int(x * log2(e)))\n\t" \
+ : "=t" (__value), "=u" (__exponent) : "0" (__x)); \
+ __asm __volatile__ \
+ ("fscale # 2^int(x * log2(e))\n\t" \
+ : "=t" (__temp) : "0" (1.0), "u" (__exponent)); \
+ __temp -= 1.0; \
+ return __temp + __value
+__inline_mathcode_(long double, __expm1l, __x, __expm1_code)
+#define __exp_code \
+ register long double __value; \
+ register long double __exponent; \
+ __asm __volatile__ \
+ ("fldl2e # e^x = 2^(x * log2(e))\n\t" \
+ "fmul %%st(1) # x * log2(e)\n\t" \
+ "fst %%st(1)\n\t" \
+ "frndint # int(x * log2(e))\n\t" \
+ "fxch\n\t" \
+ "fsub %%st(1) # fract(x * log2(e))\n\t" \
+ "f2xm1 # 2^(fract(x * log2(e))) - 1\n\t" \
+ : "=t" (__value), "=u" (__exponent) : "0" (__x)); \
+ __value += 1.0; \
+ __asm __volatile__ \
+ ("fscale" \
+ : "=t" (__value) : "0" (__value), "u" (__exponent)); \
+ return __value
+__inline_mathcode(exp, __x, __exp_code) __inline_mathcode_(long double, __expl, __x, __exp_code) __inline_mathcode(tan, __x, register long double __value; register long double __value2 __attribute__ ((__unused__)); __asm __volatile__("fptan": "=t"(__value2), "=u"(__value):"0"(__x)); return __value)
+#define __atan2_code \
+ register long double __value; \
+ __asm __volatile__ \
+ ("fpatan\n\t" \
+ : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)"); \
+ return __value
+ __inline_mathcode2(atan2, __y, __x,
+ __atan2_code) __inline_mathcode2_(long double, __atan2l,
+ __y, __x,
+ __atan2_code)
+__inline_mathcode2(fmod, __x, __y, register long double __value; __asm __volatile__("1: fprem\n\t" "fnstsw %%ax\n\t" "sahf\n\t" "jp 1b": "=t"(__value): "0"(__x), "u"(__y):"ax", "cc"); return __value)
+ __inline_mathcode2(pow, __x, __y,
+ register long double __value;
+ register long double __exponent;
+ __extension__ long long int __p =
+ (long long int)__y; if (__x == 0.0 && __y > 0.0)
+ return 0.0; if (__y == (double) __p)
+ {
+ long double __r = 1.0;
+ if (__p == 0) return 1.0; if (__p < 0) {
+ __p = -__p; __x = 1.0 / __x;}
+ while (1) {
+ if (__p & 1)
+ __r *= __x;
+ __p >>= 1; if (__p == 0) return __r; __x *= __x;}
+ /* NOTREACHED */
+ }
+
+__asm __volatile__("fyl2x": "=t"(__value): "0"(__x), "u"(1.0): "st(1)"); __asm __volatile__("fmul %%st(1) # y * log2(x)\n\t" "fst %%st(1)\n\t" "frndint # int(y * log2(x))\n\t" "fxch\n\t" "fsub %%st(1) # fract(y * log2(x))\n\t" "f2xm1 # 2^(fract(y * log2(x))) - 1\n\t": "=t"(__value), "=u"(__exponent): "0"(__y), "1"(__value)); __value += 1.0; __asm __volatile__("fscale": "=t"(__value):"0"(__value), "u"(__exponent));
+ return
+ __value)
+
+
+ __inline_mathop(sqrt, "fsqrt")
+ __inline_mathop_(long double, __sqrtl, "fsqrt")
+#if defined __GNUC__ && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 8)
+ __inline_mathcode_(double, fabs, __x, return __builtin_fabs(__x))
+ __inline_mathcode_(float, fabsf, __x, return __builtin_fabsf(__x))
+ __inline_mathcode_(long double, fabsl, __x,
+ return __builtin_fabsl(__x))
+ __inline_mathcode_(long double, __fabsl, __x,
+ return __builtin_fabsl(__x))
+#else
+ __inline_mathop(fabs, "fabs")
+ __inline_mathop_(long double, __fabsl, "fabs")
+#endif
+/* The argument range of this inline version is reduced. */
+ __inline_mathop(sin, "fsin")
+/* The argument range of this inline version is reduced. */
+ __inline_mathop(cos, "fcos")
+ __inline_mathop(atan, "fld1; fpatan")
+ __inline_mathop(log, "fldln2; fxch; fyl2x")
+ __inline_mathop(log10, "fldlg2; fxch; fyl2x")
+ __inline_mathcode(asin, __x,
+ return __atan2l(__x,
+ __sqrtl(1.0 -
+ __x *
+ __x)))
+ __inline_mathcode(acos, __x,
+ return __atan2l(__sqrtl(1.0 - __x * __x),
+ __x)) __inline_mathcode_(long
+ double,
+ __sgn1l,
+ __x,
+ return
+ __x >=
+ 0.0 ?
+ 1.0 :
+ -1.0)
+/* The argument range of the inline version of sinhl is slightly reduced. */
+ __inline_mathcode(sinh, __x, register long double __exm1 =
+ __expm1l(__fabsl(__x));
+ return 0.5 * (__exm1 / (__exm1 + 1.0) +
+ __exm1) *
+ __sgn1l(__x)) __inline_mathcode(cosh, __x,
+ register long double
+ __ex = __expl(__x);
+ return 0.5 * (__ex +
+ 1.0 /
+ __ex))
+__inline_mathcode(tanh, __x, register long double __exm1 = __expm1l(-__fabsl(__x + __x)); return __exm1 / (__exm1 + 2.0) * __sgn1l(-__x)) __inline_mathcode(floor, __x, register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile("fnstcw %0":"=m"(__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0400;
+ /* rounding down */
+__asm __volatile("fldcw %0": : "m"(__cwtmp)); __asm __volatile("frndint": "=t"(__value): "0"(__x)); __asm __volatile("fldcw %0": : "m"(__cw)); return __value)
+__inline_mathcode(ceil, __x, register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile("fnstcw %0":"=m"(__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0800;
+ /* rounding up */
+__asm __volatile("fldcw %0": : "m"(__cwtmp)); __asm __volatile("frndint": "=t"(__value): "0"(__x)); __asm __volatile("fldcw %0": :"m"(__cw));
+ return
+ __value)
+#define __ldexp_code \
+ register long double __value; \
+ __asm __volatile__ \
+ ("fscale" \
+ : "=t" (__value) : "0" (__x), "u" ((long double) __y)); \
+ return __value
+__MATH_INLINE double ldexp(double __x, int __y);
+__MATH_INLINE double ldexp(double __x, int __y)
+{
+ __ldexp_code;
+}
+
+
+/* Optimized versions for some non-standardized functions. */
+#if defined __USE_ISOC9X || defined __USE_MISC
+
+__inline_mathcode(expm1, __x, __expm1_code)
+/* We cannot rely on M_SQRT being defined. So we do it for ourself
+ here. */
+# define __M_SQRT2 1.41421356237309504880L /* sqrt(2) */
+ __inline_mathcode(log1p, __x,
+ register long double __value;
+ if (__fabsl(__x) >= 1.0 - 0.5 * __M_SQRT2)
+ __value = logl(1.0 + __x);
+ else
+__asm __volatile__("fldln2\n\t" "fxch\n\t" "fyl2xp1": "=t"(__value):"0"(__x));
+ return
+ __value)
+
+
+/* The argument range of the inline version of asinhl is slightly reduced. */
+ __inline_mathcode(asinh, __x,
+ register long double __y = __fabsl(__x);
+ return (log1pl
+ (__y * __y /
+ (__sqrtl(__y * __y + 1.0) + 1.0) +
+ __y) *
+ __sgn1l(__x))) __inline_mathcode(acosh, __x,
+ return
+ logl(__x +
+ __sqrtl
+ (__x -
+ 1.0)
+ *
+ __sqrtl
+ (__x +
+ 1.0)))
+ __inline_mathcode(atanh, __x, register long double __y = __fabsl(__x);
+ return -0.5 * log1pl(-(__y + __y) / (1.0 + __y)) *
+ __sgn1l(__x))
+/* The argument range of the inline version of hypotl is slightly reduced. */
+__inline_mathcode2(hypot, __x, __y, return __sqrtl(__x * __x + __y * __y)) __inline_mathcode(logb, __x, register long double __value; register long double __junk; __asm __volatile__("fxtract\n\t": "=t"(__junk), "=u"(__value):"0"(__x)); return __value)
+#endif
+#ifdef __USE_ISOC9X
+ __inline_mathop(log2, "fld1; fxch; fyl2x")
+__MATH_INLINE float ldexpf(float __x, int __y);
+__MATH_INLINE float ldexpf(float __x, int __y)
+{
+ __ldexp_code;
+}
+
+__MATH_INLINE long double ldexpl(long double __x, int __y);
+__MATH_INLINE long double ldexpl(long double __x, int __y)
+{
+ __ldexp_code;
+}
+
+__inline_mathcode3(fma, __x, __y, __z, return (__x * __y) + __z)
+ __inline_mathop(rint, "frndint")
+#define __lrint_code \
+ long int __lrintres; \
+ __asm__ __volatile__ \
+ ("fistpl %0" \
+ : "=m" (__lrintres) : "t" (__x) : "st"); \
+ return __lrintres
+__MATH_INLINE long int lrintf(float __x)
+{
+ __lrint_code;
+}
+
+__MATH_INLINE long int lrint(double __x)
+{
+ __lrint_code;
+}
+
+__MATH_INLINE long int lrintl(long double __x)
+{
+ __lrint_code;
+}
+
+#undef __lrint_code
+
+#define __llrint_code \
+ long long int __llrintres; \
+ __asm__ __volatile__ \
+ ("fistpll %0" \
+ : "=m" (__llrintres) : "t" (__x) : "st"); \
+ return __llrintres
+__MATH_INLINE long long int llrintf(float __x)
+{
+ __llrint_code;
+}
+
+__MATH_INLINE long long int llrint(double __x)
+{
+ __llrint_code;
+}
+
+__MATH_INLINE long long int llrintl(long double __x)
+{
+ __llrint_code;
+}
+
+#undef __llrint_code
+
+#endif
+
+
+#ifdef __USE_MISC
+
+__inline_mathcode2(drem, __x, __y, register double __value; register int __clobbered; __asm __volatile__("1: fprem1\n\t" "fstsw %%ax\n\t" "sahf\n\t" "jp 1b": "=t"(__value), "=&a"(__clobbered): "0"(__x), "u"(__y):"cc"); return __value)
+/* This function is used in the `isfinite' macro. */
+#if 0
+__MATH_INLINE int __finite(double __x) __attribute__ ((__const__));
+__MATH_INLINE int __finite(double __x)
+{
+ return (__extension__(((((union {
+ double __d;
+ int __i[2];
+ }
+ ) {
+ __d: __x}
+ ).__i[1] | 0x800fffff) + 1) >> 31));
+}
+#endif
+
+/* Miscellaneous functions */
+
+__inline_mathcode(__coshm1, __x,
+ register long double __exm1 = __expm1l(__fabsl(__x));
+ return 0.5 * (__exm1 / (__exm1 + 1.0)) * __exm1)
+ __inline_mathcode(__acosh1p, __x,
+ return log1pl(__x + __sqrtl(__x) * __sqrtl(__x + 2.0)))
+#endif /* __USE_MISC */
+/* Undefine some of the large macros which are not used anymore. */
+#undef __expm1_code
+#undef __exp_code
+#undef __atan2_code
+#undef __sincos_code
+#endif /* __NO_MATH_INLINES */
+/* This code is used internally in the GNU libc. */
+#ifdef __LIBC_INTERNAL_MATH_INLINES
+__inline_mathop(__ieee754_sqrt, "fsqrt") __inline_mathcode2(__ieee754_atan2, __y, __x, register long double __value; __asm __volatile__("fpatan\n\t": "=t"(__value): "0"(__x), "u"(__y):"st(1)"); return __value;
+ )
+#endif
+#endif /* __GNUC__ */
+#endif
+#endif
diff --git a/src/include/i386/ctrl87.h b/src/include/i386/ctrl87.h
new file mode 100644
index 0000000..02b4490
--- /dev/null
+++ b/src/include/i386/ctrl87.h
@@ -0,0 +1,120 @@
+/*
+ * This file is part of ms-dos port for XaoS
+ * ctrl87.h
+ *
+ */
+
+
+#ifndef __CONTROL87_H__
+
+
+#define __CONTROL87_H__
+
+
+#ifdef __CONTROL87_C__
+#define EXTERN
+#else
+#define EXTERN extern
+#endif
+
+
+/* 8087/80287 Status Word format */
+
+#define SW_INVALID 0x0001 /* Invalid operation */
+#define SW_DENORMAL 0x0002 /* Denormalized operand */
+#define SW_ZERODIVIDE 0x0004 /* Zero divide */
+#define SW_OVERFLOW 0x0008 /* Overflow */
+#define SW_UNDERFLOW 0x0010 /* Underflow */
+#define SW_INEXACT 0x0020 /* Precision (Inexact result) */
+
+/* 8087/80287 Control Word format */
+
+#define MCW_EM 0x003f /* interrupt Exception Masks */
+#define EM_INVALID 0x0001 /* invalid */
+#define EM_DENORMAL 0x0002 /* denormal */
+#define EM_ZERODIVIDE 0x0004 /* zero divide */
+#define EM_OVERFLOW 0x0008 /* overflow */
+#define EM_UNDERFLOW 0x0010 /* underflow */
+#define EM_INEXACT 0x0020 /* inexact (precision) */
+
+#define MCW_IC 0x1000 /* Infinity Control */
+#define IC_AFFINE 0x1000 /* affine */
+#define IC_PROJECTIVE 0x0000 /* projective */
+
+#define MCW_RC 0x0c00 /* Rounding Control */
+#define RC_CHOP 0x0c00 /* chop */
+#define RC_UP 0x0800 /* up */
+#define RC_DOWN 0x0400 /* down */
+#define RC_NEAR 0x0000 /* near */
+
+#define MCW_PC 0x0300 /* Precision Control */
+#define PC_24 0x0000 /* 24 bits */
+#define PC_53 0x0200 /* 53 bits */
+#define PC_64 0x0300 /* 64 bits */
+
+/**************************************************************************/
+/************************* Type declarations **************************/
+/**************************************************************************/
+
+/**************************************************************************/
+/************************ Function declarations ***********************/
+/**************************************************************************/
+
+/*
+ _control87 changes floating-point control word.
+
+ Declaration:
+ ------------
+ unsigned short _control87(unsigned short newcw, unsigned short mask);
+
+ Remarks:
+ --------
+ _control87 retrieves or changes the floating-point control word.
+
+ The floating-point control word is an unsigned short that specifies the
+ following modes in the 80x87 FPU:
+ o allowed exceptions
+ o infinity mode
+ o rounding mode
+ o precision mode
+
+ Changing these modes allows you to mask or unmask floating-point exceptions.
+
+ _control87 matches the bits in mask to the bits in newcw.
+
+ If any mask bit = 1, the corresponding bit in newcw contains the new value
+ for the same bit in the floating-point control word.
+
+ If mask = 0000, _control87 returns the floating-point control word without
+ altering it.
+
+ Examples:
+ ---------
+ Switching to projective infinity mode:
+ _control87(IC_PROJECTIVE, MCW_IC);
+
+ Disabling all exceptions:
+ _control87(MCW_EM, MCW_EM);
+
+ Return Value:
+ -------------
+ The bits in the value returned reflect the new floating-point control word.
+*/
+EXTERN unsigned short _control87(unsigned short, unsigned short);
+
+
+/**************************************************************************/
+/************************** Global variables **************************/
+/**************************************************************************/
+
+
+
+#ifdef __CONTROL87_C__
+#else
+#endif
+
+
+#undef EXTERN
+
+
+#endif
diff --git a/src/include/i386/sstring.h b/src/include/i386/sstring.h
new file mode 100644
index 0000000..bd2dd2d
--- /dev/null
+++ b/src/include/i386/sstring.h
@@ -0,0 +1,414 @@
+#if 0
+#ifndef _I386_STRING_I486_H_
+#define _I386_STRING_I486_H_
+#if defined(__OPTIMIZE__) && defined(__GNUC__) && defined(__i386__)
+/*
+ * This string-include defines all string functions as inline
+ * functions. Use gcc. It also assumes ds=es=data space, this should be
+ * normal. Most of the string-functions are rather heavily hand-optimized,
+ * see especially strtok,strstr,str[c]spn. They should work, but are not
+ * very easy to understand. Everything is done entirely within the register
+ * set, making the functions fast and clean.
+ *
+ * Copyright (C) 1991, 1992 Linus Torvalds
+ * Revised and optimized for i486/pentium
+ * 1994/03/15 by Alberto Vignani/Davide Parodi @crf.it
+ *
+ * Split into 2 CPU specific files by Alan Cox to keep #ifdef noise down.
+ *
+ * Revised and optimized again by Jan Hubicka (1997/11/16)
+ * (please report bugs to hubicka@paru.cas.cz)
+ *
+ * memset and memcpy routines seems to be always faster at 486 and
+ * pentium but at pentium MMX they are sometimes bit slower (5-10%)..
+ * because of less strict register allocation they produces better code.
+ */
+
+
+#define __HAVE_ARCH_MEMCPY
+#define memcpy(d,s,count) \
+(__builtin_constant_p(count) ? \
+ __memcpy_c((d),(s),(count)) : \
+ __memcpy_g((d),(s),(count)))
+
+/*
+ * These ought to get tweaked to do some cache priming.
+ */
+
+
+/* This implementation of the memcpy is designed for moveoldpoints from
+ * mkrealloctables. It is expected to work well for both small and large
+ * sizes.
+ *
+ * Small (1-10) and meduim (300) sizes seems to be important for XaoS.
+ * So implementation is not super fast for large sizes, but my experiemnts
+ * don't show large improvements in speed anyway.
+ *
+ * We use rep movsX operations (they works well on PPro and don't seems to be
+ * so bad on Pentium) and expect cld operation to be set. Hope that it will
+ * not make problems.
+ *
+ * My attempt was to use c code where possible to let GCC do the
+ */
+extern inline void *__memcpy_g(void *to, const register void *from,
+ register size_t n);
+extern inline void *__memcpy_g(void *to, const register void *from,
+ register size_t n)
+{
+ register void *tmp = (void *) to;
+ if (n >= 7) {
+ register int c = (-(int) to) & 3;
+ n -= c;
+ __asm__ __volatile__( /*Align the destination */
+ "rep\n\tmovsb":"=c"(c), "=D"(tmp),
+ "=S"(from):"c"(c), "D"((long) tmp),
+ "S"((long) from):"memory");
+ c = n >> 2;
+ __asm__ __volatile__( /*Copy the main body */
+ "rep\n\tmovsl":"=c"(c), "=D"(tmp),
+ "=S"(from):"c"(c), "D"((long) tmp),
+ "S"((long) from):"memory");
+ n &= 3;
+ }
+ __asm__ __volatile__("rep\n\tmovsb":"=c"(n), "=D"(tmp),
+ "=S"(from):"c"(n), "D"((long) tmp),
+ "S"((long) from):"memory");
+ return (to);
+}
+
+/*
+ * This looks horribly ugly, but the compiler can optimize it totally,
+ * as the count is constant.
+ */
+
+#define COMMON(x) \
+__asm__ __volatile__ ( \
+ "\n.align 4\n" \
+ "1:\tmovl (%2),%0\n\t" \
+ "addl $4,%2\n\t" \
+ "movl %0,(%1)\n\t" \
+ "addl $4,%1\n\t" \
+ "decl %3\n\t" \
+ "jnz 1b\n" \
+ x \
+ :"=r" (dummy1), "=r" (tmp), "=r" (from), "=r" (dummy2) \
+ :"1" (tmp), "2" (from), "3" (n/4) \
+ :"memory"); \
+return (to); \
+
+extern inline void *__memcpy_c(void *to, const void *from, size_t n);
+extern inline void *__memcpy_c(void *to, const void *from, size_t n)
+{
+ if (n < 24) {
+ if (n >= 4)
+ ((unsigned long *) to)[0] = ((const unsigned long *) from)[0];
+ if (n >= 8)
+ ((unsigned long *) to)[1] = ((const unsigned long *) from)[1];
+ if (n >= 12)
+ ((unsigned long *) to)[2] = ((const unsigned long *) from)[2];
+ if (n >= 16)
+ ((unsigned long *) to)[3] = ((const unsigned long *) from)[3];
+ if (n >= 20)
+ ((unsigned long *) to)[4] = ((const unsigned long *) from)[4];
+ switch ((unsigned int) (n % 4)) {
+ case 3:
+ ((unsigned short *) to)[n / 2 - 1] =
+ ((const unsigned short *) from)[n / 2 - 1];
+ ((unsigned char *) to)[n - 1] =
+ ((const unsigned char *) from)[n - 1];
+ return to;
+ case 2:
+ ((unsigned short *) to)[n / 2 - 1] =
+ ((const unsigned short *) from)[n / 2 - 1];
+ return to;
+ case 1:
+ ((unsigned char *) to)[n - 1] =
+ ((const unsigned char *) from)[n - 1];
+ case 0:
+ return to;
+ }
+ }
+ {
+ register void *tmp = (void *) to;
+ register int dummy1, dummy2;
+ switch ((unsigned int) (n % 4)) {
+ case 0:
+ COMMON("");
+ case 1:
+ COMMON("movb (%2),%b0 ; movb %b0,(%1)");
+ case 2:
+ COMMON("movw (%2),%w0 ; movw %w0,(%1)");
+ case 3:
+ COMMON("movw (%2),%w0 ; movw %w0,(%1)\n\t"
+ "movb 2(%2),%b0 ; movb %b0,2(%1)");
+ }
+ }
+ return to;
+}
+
+#undef COMMON
+
+
+#define __HAVE_ARCH_MEMMOVE
+extern inline void *memmove(void *dest, const void *src, size_t n);
+extern inline void *memmove(void *dest, const void *src, size_t n)
+{
+ register void *tmp = (void *) dest;
+ if (dest < src)
+ __asm__ __volatile__("cld\n\t" "rep\n\t" "movsb": /* no output */
+ :"c"(n), "S"(src), "D"(tmp):"cx", "si", "di",
+ "memory");
+ else
+ __asm__ __volatile__("std\n\t" "rep\n\t" "movsb\n\t" "cld": /* no output */
+ : "c"(n), "S"(n - 1 + (const char *) src), "D"(n - 1 + (char *) tmp):"cx", "si", "di", "memory");
+ return dest;
+}
+
+#define memcmp __builtin_memcmp
+
+#define __HAVE_ARCH_MEMCHR
+extern inline void *memchr(const void *cs, int c, size_t count);
+extern inline void *memchr(const void *cs, int c, size_t count)
+{
+ register void *__res;
+ if (!count)
+ return NULL;
+ __asm__ __volatile__("cld\n\t"
+ "repne\n\t"
+ "scasb\n\t"
+ "je 1f\n\t"
+ "movl $1,%0\n"
+ "1:\tdecl %0":"=D"(__res):"a"(c), "D"(cs),
+ "c"(count):"cx");
+ return __res;
+}
+
+
+
+#define __HAVE_ARCH_MEMSET
+#define memset(s,c,count) \
+(__builtin_constant_p(c) ? \
+ (__builtin_constant_p(count) ? \
+ __memset_cc((s),(c),(count)) : \
+ __memset_cg((s),(c),(count))) : \
+ (__builtin_constant_p(count) ? \
+ __memset_gc((s),(c),(count)) : \
+ __memset_gg((s),(c),(count))))
+
+
+
+
+extern inline void *__memset_cg(void *s, char c, size_t count);
+extern inline void *__memset_cg(void *s, char c, size_t count)
+{
+ int tmp2;
+ register void *tmp = (void *) s;
+ __asm__ __volatile__("shrl $1,%%ecx\n\t"
+ "rep\n\t"
+ "stosw\n\t"
+ "jnc 1f\n\t"
+ "movb %%al,(%%edi)\n"
+ "1:":"=c"(tmp2), "=D"(tmp):"c"(count), "D"(tmp),
+ "a"(0x0101U * (unsigned char) c):"memory");
+ return s;
+}
+
+extern inline void *__memset_gg(void *s, char c, size_t count);
+extern inline void *__memset_gg(void *s, char c, size_t count)
+{
+ register void *tmp = (void *) s;
+ int tmp2;
+ __asm__ __volatile__("movb %%al,%%ah\n\t"
+ "shrl $1,%%ecx\n\t"
+ "rep\n\t"
+ "stosw\n\t"
+ "jnc 1f\n\t"
+ "movb %%al,(%%edi)\n"
+ "1:":"=c"(tmp2), "=D"(tmp):"c"(count), "D"(tmp),
+ "a"(c):"memory");
+ return s;
+}
+
+/*
+ * This non-rep routines are not much faster (slower for small strings)
+ * but they allows better register allocation
+ */
+#define COMMON(x) \
+__asm__ __volatile__ ( \
+ "\n.align 4\n" \
+ "1:\tmovl %k2,(%k0)\n\t" \
+ "addl $4,%k0\n\t" \
+ "decl %k1\n\t" \
+ "jnz 1b\n" \
+ x \
+ :"=r" (tmp), "=r" (dummy) \
+ :"q" ((unsigned) pattern), "0" (tmp), "1" (count/4) \
+ :"memory"); \
+return s;
+
+extern inline void *__memset_cc(void *s, unsigned long pattern,
+ size_t count);
+extern inline void *__memset_cc(void *s, unsigned long pattern,
+ size_t count)
+{
+ pattern = ((unsigned char) pattern) * 0x01010101UL;
+ if (count < 24) {
+ /*Handle small values manualy since they are incredibly slow */
+
+ if (count >= 4)
+ *(unsigned long *) s = pattern;
+ if (count >= 8)
+ ((unsigned long *) s)[1] = pattern;
+ if (count >= 12)
+ ((unsigned long *) s)[2] = pattern;
+ if (count >= 16)
+ ((unsigned long *) s)[3] = pattern;
+ if (count >= 20)
+ ((unsigned long *) s)[4] = pattern;
+ switch ((unsigned int) (count % 4)) {
+ case 3:
+ ((unsigned short *) s)[count / 2 - 1] = pattern;
+ ((unsigned char *) s)[count - 1] = pattern;
+ return s;
+ case 2:
+ ((unsigned short *) s)[count / 2 - 1] = pattern;
+ return s;
+ case 1:
+ ((unsigned char *) s)[count - 1] = pattern;
+ case 0:
+ return s;
+ }
+ } else {
+ register void *tmp = (void *) s;
+ register int dummy;
+ switch ((unsigned int) (count % 4)) {
+ case 0:
+ COMMON("");
+ case 1:
+ COMMON("movb %b2,(%0)");
+ case 2:
+ COMMON("movw %w2,(%0)");
+ case 3:
+ COMMON("movw %w2,(%0)\n\tmovb %b2,2(%0)");
+ }
+ }
+ return s;
+}
+
+extern inline void *__memset_gc(void *s, unsigned long pattern,
+ size_t count);
+extern inline void *__memset_gc(void *s, unsigned long pattern,
+ size_t count)
+{
+ if (count < 4) {
+ if (count > 1)
+ __asm__("movb %b0,%h0\n\t": "=q"(pattern):"0"((unsigned)
+ pattern));
+ switch ((unsigned int) (count)) {
+ case 3:
+ ((unsigned short *) s)[0] = pattern;
+ ((unsigned char *) s)[2] = pattern;
+ return s;
+ case 2:
+ *((unsigned short *) s) = pattern;
+ return s;
+ case 1:
+ *(unsigned char *) s = pattern;
+ case 0:
+ return s;
+ }
+ }
+
+ __asm__("movb %b0,%h0\n\t" "pushw %w0\n\t" "shll $16,%k0\n\t" "popw %w0\n": "=q"(pattern):"0"((unsigned)
+ pattern));
+
+ if (count < 24) {
+ /*Handle small values manualy since they are incredibly slow */
+
+ *(unsigned long *) s = pattern;
+ if (count >= 8)
+ ((unsigned long *) s)[1] = pattern;
+ if (count >= 12)
+ ((unsigned long *) s)[2] = pattern;
+ if (count >= 16)
+ ((unsigned long *) s)[3] = pattern;
+ if (count >= 20)
+ ((unsigned long *) s)[4] = pattern;
+ switch ((unsigned int) (count % 4)) {
+ case 3:
+ ((unsigned short *) s)[count / 2 - 1] = pattern;
+ ((unsigned char *) s)[count - 1] = pattern;
+ return s;
+ case 2:
+ ((unsigned short *) s)[count / 2 - 1] = pattern;
+ return s;
+ case 1:
+ ((unsigned char *) s)[count - 1] = pattern;
+ case 0:
+ return s;
+ }
+ } else {
+ register void *tmp = (void *) s;
+ register int dummy;
+ switch ((unsigned int) (count % 4)) {
+ case 0:
+ COMMON("");
+ case 1:
+ COMMON("movb %b2,(%0)");
+ case 2:
+ COMMON("movw %w2,(%0)");
+ case 3:
+ COMMON("movw %w2,(%0)\n\tmovb %b2,2(%0)");
+ }
+ }
+ return s;
+}
+
+#undef COMMON
+
+
+/*
+ * find the first occurrence of byte 'c', or 1 past the area if none
+ */
+#define __HAVE_ARCH_MEMSCAN
+extern inline void *memscan(void *addr, int c, size_t size);
+extern inline void *memscan(void *addr, int c, size_t size)
+{
+ if (!size)
+ return addr;
+ __asm__ __volatile__("cld\n\t"
+ "repnz; scasb\n\t"
+ "jnz 1f\n\t"
+ "dec %%edi\n\t"
+ "1:":"=D"(addr), "=c"(size):"0"(addr), "1"(size),
+ "a"(c));
+ return addr;
+}
+
+#define memset_long(x,y,z) __memset_long(x,y,z)
+
+extern inline void *__memset_long(void *s, char c, size_t count);
+extern inline void *__memset_long(void *s, char c, size_t count)
+{
+ register unsigned int fill = c;
+ register void *tmp = (void *) s;
+ if (count >= 7) {
+ register int c = (-(int) s) & 3;
+/*__asm__ __volatile__ ("movb %b0,%h0":"=r"(fill):"r"(fill));*/
+ fill |= fill << 8;
+ count -= c;
+ fill |= fill << 16;
+ __asm__ __volatile__("rep\n\tstosb":"=c"(c), "=D"(tmp):"c"(c),
+ "D"(tmp), "a"(fill):"memory");
+ c = count >> 2;
+ __asm__ __volatile__("rep\n\tstosl":"=c"(c), "=D"(tmp):"c"(c),
+ "D"(tmp), "a"(fill):"memory");
+ count &= 3;
+ }
+ __asm__ __volatile__("rep\n\tstosb":"=c"(count), "=D"(tmp):"c"(count),
+ "D"(tmp), "a"((char) fill):"memory");
+ return s;
+}
+#endif
+#endif
+#endif
diff --git a/src/include/include.pri b/src/include/include.pri
new file mode 100644
index 0000000..22a4996
--- /dev/null
+++ b/src/include/include.pri
@@ -0,0 +1,38 @@
+HEADERS += \
+ $$PWD/archaccel.h \
+ $$PWD/btrace.h \
+ $$PWD/c256.h \
+ $$PWD/catalog.h \
+ $$PWD/complex.h \
+ $$PWD/cursor.h \
+ $$PWD/fconfig.h \
+ $$PWD/filter.h \
+ $$PWD/formulas.h \
+ $$PWD/fractal.h \
+ $$PWD/gccaccel.h \
+ $$PWD/gccbuild.h \
+ $$PWD/generic.h \
+ $$PWD/grlib.h \
+ $$PWD/hicolor.h \
+ $$PWD/misc-f.h \
+ $$PWD/param.h \
+ $$PWD/pixel_t.h \
+ $$PWD/plane.h \
+ $$PWD/sffe.h \
+ $$PWD/sffe_cmplx_asm.h \
+ $$PWD/sffe_cmplx_gsl.h \
+ $$PWD/timers.h \
+ $$PWD/true24.h \
+ $$PWD/truecolor.h \
+ $$PWD/ui.h \
+ $$PWD/ui_helper.h \
+ $$PWD/xerror.h \
+ $$PWD/xio.h \
+ $$PWD/xldio.h \
+ $$PWD/xmenu.h \
+ $$PWD/xshl.h \
+ $$PWD/xthread.h \
+ $$PWD/zoom.h \
+ $$PWD/i386/ctrl87.h \
+ $$PWD/i386/sstring.h \
+ $$PWD/i386/__math.h
diff --git a/src/include/misc-f.h b/src/include/misc-f.h
new file mode 100644
index 0000000..64ed054
--- /dev/null
+++ b/src/include/misc-f.h
@@ -0,0 +1,17 @@
+#ifndef IUTIL_H
+#define IUTIL_H
+#include <xio.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+ struct image;
+
+ CONST char *writepng(xio_constpath filename, CONST struct image *image);
+ void XaoS_srandom(unsigned int x);
+ long int XaoS_random(void);
+ char *mystrdup(CONST char *);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/include/param.h b/src/include/param.h
new file mode 100644
index 0000000..c9ac6f1
--- /dev/null
+++ b/src/include/param.h
@@ -0,0 +1,48 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifndef PARAMS_H
+#define PARAMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ struct params {
+ CONST char *name;
+ int type;
+ void *value;
+ CONST char *help;
+ };
+
+#define P_SWITCH 0
+#define P_NUMBER 1
+#define P_STRING 2
+#define P_FLOAT 3
+#define P_HELP 4
+
+ int params_parser(int, char **);
+ void params_register(CONST struct params *par);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/include/pixel_t.h b/src/include/pixel_t.h
new file mode 100644
index 0000000..9b9555c
--- /dev/null
+++ b/src/include/pixel_t.h
@@ -0,0 +1,21 @@
+#if SIZEOF_INT==4
+typedef unsigned int pixel32_t;
+#elif SIZEOF_LONG==4
+typedef unsigned long pixel32_t;
+#else
+/*#error define size for pixel32 please */
+00
+#endif
+#if SIZEOF_SHORT==2
+typedef unsigned short pixel16_t;
+#elif SIZEOF_INT==2
+typedef unsigned int pixel16_t;
+#else
+/*#error define size for pixel16 please */
+ 00
+#endif
+typedef unsigned char pixel8_t;
+typedef unsigned char ppixel24_t[3];
+typedef pixel8_t *ppixel8_t;
+typedef pixel16_t *ppixel16_t;
+typedef pixel32_t *ppixel32_t;
diff --git a/src/include/plane.h b/src/include/plane.h
new file mode 100644
index 0000000..a37b16a
--- /dev/null
+++ b/src/include/plane.h
@@ -0,0 +1,58 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifndef PLANE_H
+#define PLANE_H
+
+#include <config.h>
+#include <zoom.h>
+
+#ifdef SFFE_USING
+#include "sffe.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/*#define PLANES 7*/
+#define P_MU 0
+#define P_INVERSE 1
+#define P_PARABOL 2
+#define P_LAMBDA 3
+#define P_INVLAMBDA 4
+#define P_TRANLAMBDA 5
+#define P_MEREBERG 6
+#define P_USER 7
+ extern void recalculate(int plane, number_t *,
+ number_t *) REGISTERS(3);
+
+ extern CONST char *CONST planename[];
+
+#ifdef SFFE_USING
+ extern CONST sffe *planec;
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* PLANE_H */
diff --git a/src/include/sffe.h b/src/include/sffe.h
new file mode 100644
index 0000000..3f21869
--- /dev/null
+++ b/src/include/sffe.h
@@ -0,0 +1,139 @@
+/*/////////////////////////////////////////////////////////////////////////////////////
+// project : sFFe ( SegFault (or Segmentation Fault :) ) formula evalutaor )
+// author : Mateusz Malczak ( mateusz@malczak.info )
+// wpage : www.segfaultlabs.com/projects/sffe
+///////////////////////////////////////////////////////////////////////////////////////
+// possible config definitions
+// general
+// SFFE_DEVEL - print extra info to stdout
+// SFFE_DLL - Windows DLL
+// complex numbers
+// SFFE_CMPLX_GSL - uses GSL complex number routines
+// SFFE_CMPLX_ASM - uses my asm complex unit (compile it with NASM)
+///////////////////////////////////////////////////////////////////////////////////////
+// special build for XaoS, for more info visit
+// http://www.segfaultlabs.com/projects/sfXaos
+/////////////////////////////////////////////////////////////////////////////////////*/
+
+#ifndef SFFE_H
+#define SFFE_H
+#include <config.h>
+#include <stdlib.h>
+
+/* dont udef next line. removing this definitions can lead to compile and/or runtime errors */
+#define SFFE_COMPLEX 1
+
+/* --- */
+/*TODO long double needed*/
+#ifdef SFFE_CMPLX_ASM
+typedef struct cmpx__ {
+ double r, i;
+} cmplx;
+#define sfNumber cmplx
+#elif SFFE_CMPLX_GSL
+#include <gsl/gsl_complex.h>
+typedef gsl_complex cmplx;
+#define sfNumber gsl_complex
+#endif
+
+/* basic sffe argument 'stack' */
+typedef struct sfargument__ {
+ struct sfargument__ *parg;
+ sfNumber *value;
+} sfarg;
+
+/* sffe function prototype, parameters order is right-to-left (cdecl) */
+typedef sfarg *(*sffptr) (sfarg * const a);
+
+/* constats eval functions */
+typedef void (*cfptr) (sfNumber * cnst);
+
+/* function type structure */
+typedef struct sffunction__ {
+ sffptr fptr;
+ unsigned char parcnt;
+ /*FIXME changed from char* to char[20] to get rid of warnings during compilation */
+ char name[20];
+} sffunction;
+
+/* basic sffe 'stack' operation ( function + result slot ) */
+typedef struct sfoperation__ {
+ sfarg *arg;
+ sffptr f;
+} sfopr;
+
+/* SFFE main structure */
+typedef struct sffe__ {
+/*public*/
+ char *expression; /* parsed expression (read-only) */
+ char *errormsg; /* parser errors (read-only) */
+ sfNumber *result; /* evaluation result (read-only) */
+/* protected/private */
+ unsigned int argCount; /* number of argument in use */
+ sfarg *args;
+ unsigned int oprCount; /* number of operations in use */
+ sfopr *oprs;
+ unsigned int varCount; /* number of used variables */
+ char *varChars;
+ sfNumber **varPtrs;
+ unsigned int userfCount; /* number of user functions */
+ sffunction *userf;
+/* not used
+ unsigned int stCount;
+ sfNumber* statics;
+*/
+} sffe;
+
+#define SFFE sffe
+#define sffeparser sffe
+#define sfparser sffe
+#define SFFEPARSER sffe
+
+/* 'stack' slot value */
+#define sfvalue(p) (*((p)->value))
+
+/* function parameters */
+#define sfaram1(p) ((p)->parg)
+#define sfaram2(p) ((p)->parg->parg)
+#define sfaram3(p) ((p)->parg->parg->parg)
+#define sfaram4(p) ((p)->parg->parg->parg->parg)
+#define sfaram5(p) ((p)->parg->parg->parg->parg->parg)
+/* and so on */
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* create formula evaluator structure */
+ sffe *sffe_alloc(void);
+/* free fe structure */
+ void sffe_free(sffe ** parser);
+/* parse expression 'expression' and strore result in 'parser' struct, error (if any) returned */
+ int sffe_parse(sffe ** parser, char *expression);
+/* evaulate function and return evaluation result */
+ sfNumber sffe_eval(sffe * const parser);
+/* evaluate without returnig result */
+//void sffe_eval2(sffe *const parser);
+/* register user function with name 'vname', with 'parcnt' parameters and defined with function pointed by 'funptr'*/
+ void *sffe_regfunc(sffe ** parser, char *vname, unsigned int parcnt,
+ sffptr funptr);
+/* register single variable 'vptrs' identified by name 'vchars' */
+ void *sffe_regvar(sffe ** parser, sfNumber * vptrs, char vchars);
+/* register multiple variables */
+ void *sffe_regvars(sffe ** parser, unsigned int cN, sfNumber ** vptrs,
+ char *vchars);
+/* get variable 'vchar' pointer */
+ sfNumber *sffe_varptr(sffe * const parser, char vchar);
+/* set 'vptrs' as 'vchars' variable */
+ sfNumber *sffe_setvar(sffe ** parser, sfNumber * vptrs, char vchars);
+
+#ifdef __cplusplus
+}
+#endif
+#ifdef SFFE_CMPLX_ASM
+#include "sffe_cmplx_asm.h"
+#elif SFFE_CMPLX_GSL
+#include "sffe_cmplx_gsl.h"
+#endif
+#endif
diff --git a/src/include/sffe_cmplx_asm.h b/src/include/sffe_cmplx_asm.h
new file mode 100644
index 0000000..f14aae8
--- /dev/null
+++ b/src/include/sffe_cmplx_asm.h
@@ -0,0 +1,140 @@
+/*/////////////////////////////////////////////////////////////////////////////////////
+// project : sFFe ( SegFault (or Segmentation Fault :) ) formula evalutaor )
+// author : Mateusz Malczak ( mateusz@malczak.info )
+// wpage : www.segfaultlabs.com/projects/sffe
+///////////////////////////////////////////////////////////////////////////////////////
+// special build for XaoS, for more info visit
+// http://www.segfaultlabs.com/projects/sfXaos
+/////////////////////////////////////////////////////////////////////////////////////*/
+#ifndef SFFE_CMPLX_ASM_H
+#define SFFE_CMPLX_ASM_H
+
+#include <config.h>
+#ifdef SFFE_CMPLX_ASM
+
+#include "sffe.h"
+
+#define sffnctscount 43
+#define sfvarscount 6
+#define cmplxset(c,r,i) ( c = cset(r,i) )
+#define real(c) (c).r
+#define imag(c) (c).i
+
+#ifdef __ELF__
+#define sffecabs _sffecabs
+#define sffecarg _sffecarg
+#define sffecargs _sffecargs
+#define sffecargc _sffecargc
+#define sffecinv _sffecinv
+#define sffecexp _sffecexp
+#define sffecln _sffecln
+#define sffeclog2 _sffeclog2
+#define sffeclog _sffeclog
+#define sffecsin _sffecsin
+#define sffeccos _sffeccos
+#define sffectan _sffectan
+#define sffeccot _sffeccot
+#define sffecsinh _sffecsinh
+#define sffeccosh _sffeccosh
+#define sffectanh _sffectanh
+#define sffeccoth _sffeccoth
+#define sffeccpow _sffeccpow
+#define sffecpowd _sffecpowd
+#define sffecpowi _sffecpowi
+#define sffecpowc _sffecpowc
+#define sffecsqrt _sffecsqrt
+#define sffecrtni _sffecrtni
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* written with asm in file cmplx.asm, compile with NASM */
+ extern double sffecabs(const cmplx c);
+ extern double sffecarg(const cmplx c);
+ extern double sffecargs(const cmplx c);
+ extern double sffecargc(const cmplx c);
+ extern cmplx sffecinv(const cmplx c);
+ extern cmplx sffecexp(const cmplx c);
+ extern cmplx sffecln(const cmplx c);
+ extern cmplx sffeclog2(const cmplx c);
+ extern cmplx sffeclog(const cmplx c, unsigned int base);
+ extern cmplx sffecsin(const cmplx c);
+ extern cmplx sffeccos(const cmplx c);
+ extern cmplx sffectan(const cmplx c);
+ extern cmplx sffeccot(const cmplx c);
+ extern cmplx sffecsinh(const cmplx c);
+ extern cmplx sffeccosh(const cmplx c);
+ extern cmplx sffectanh(const cmplx c);
+ extern cmplx sffeccoth(const cmplx c);
+ /* power functions */
+ extern cmplx sffeccpow(const cmplx b, const cmplx exp);
+ extern cmplx sffecpowd(const cmplx b, double exp);
+ extern cmplx sffecpowi(const cmplx b, int exp);
+ extern cmplx sffecpowc(double b, const cmplx exp);
+ extern cmplx sffecsqrt(const cmplx b); /* square root */
+ extern cmplx sffecrtni(const cmplx b, int n, int i); /* i-th solution of N-th order root of a CN */
+/*complex numbers for mparser*/
+ cmplx cset(double r, double i);
+ cmplx cadd(const cmplx c1, const cmplx c2);
+ cmplx csub(const cmplx c1, const cmplx c2);
+ cmplx cmul(const cmplx c1, const cmplx c2);
+ cmplx cdiv(const cmplx c1, const cmplx c2);
+ sfarg *sfadd(sfarg * const p); /* + */
+ sfarg *sfsub(sfarg * const p); /* - */
+ sfarg *sfmul(sfarg * const p); /* * */
+ sfarg *sfdiv(sfarg * const p); /* / */
+ sfarg *sfsin(sfarg * const p); /* sin */
+ sfarg *sfcos(sfarg * const p); /* cos */
+ sfarg *sftan(sfarg * const p); /* tan */
+ sfarg *sfcot(sfarg * const p); /* ctan */
+ sfarg *sfasin(sfarg * const p); /* asin */
+ sfarg *sfacos(sfarg * const p); /* acos */
+ sfarg *sfatan(sfarg * const p); /* atan */
+ sfarg *sfacot(sfarg * const p); /* actan */
+ sfarg *sfatan2(sfarg * const p); /* atan2 */
+ sfarg *sfsinh(sfarg * const p); /* sinh */
+ sfarg *sfcosh(sfarg * const p); /* cosh */
+ sfarg *sftanh(sfarg * const p); /* tanh */
+ sfarg *sfcoth(sfarg * const p); /* ctanh */
+ sfarg *sfexp(sfarg * const p); /* exp */
+ sfarg *sflog(sfarg * const p); /* log */
+ sfarg *sflog2(sfarg * const p); /* log2 */
+ sfarg *sflog10(sfarg * const p); /* log2 */
+ sfarg *sflogN(sfarg * const p); /* logN */
+ sfarg *sflogCN(sfarg * const p); /* logCN */
+ sfarg *sfpow(sfarg * const p); /* csflx pow */
+ sfarg *sfpowi(sfarg * const p); /* int pow */
+ sfarg *sfpowd(sfarg * const p); /* double pow */
+ sfarg *sfpowdc(sfarg * const p); /* double to csflx pow */
+ sfarg *sfsqr(sfarg * const p); /* sqr */
+ sfarg *sfsqrt(sfarg * const p); /* sqrt */
+ sfarg *sfrtni(sfarg * const p); /* rtni *//*cos tu nie tak jak powinno byc ;( */
+ sfarg *sfinv(sfarg * const p); /* cinv */
+ sfarg *sfceil(sfarg * const p); /* ceil */
+ sfarg *sffloor(sfarg * const p); /* floor */
+ sfarg *sfabs(sfarg * const p); /* abs - |z| */
+ sfarg *sfre(sfarg * const p); /* RE */
+ sfarg *sfim(sfarg * const p); /* IM */
+ sfarg *sfrabs(sfarg * const p); /* abs - real numbers */
+ sfarg *sfrand(sfarg * const p); /* rand */
+/*const eval*/
+ void sfcPI(sfNumber * cnst);
+ void sfcPI2(sfNumber * cnst);
+ void sfc2PI(sfNumber * cnst);
+ void sfcE(sfNumber * cnst);
+ void sfcI(sfNumber * cnst);
+ void sfcRND(sfNumber * cnst);
+#ifdef __cplusplus
+}
+#endif
+/* all available function (function pointer, number of parameters, name )*/
+ extern const sffunction sfcmplxfunc[sffnctscount];
+/* all available buildin variables */
+extern const char sfcnames[sfvarscount][5];
+/* available variables function pointers */
+extern const cfptr sfcvals[sfvarscount];
+
+#endif
+#endif
diff --git a/src/include/sffe_cmplx_gsl.h b/src/include/sffe_cmplx_gsl.h
new file mode 100644
index 0000000..7bc5b66
--- /dev/null
+++ b/src/include/sffe_cmplx_gsl.h
@@ -0,0 +1,82 @@
+/*/////////////////////////////////////////////////////////////////////////////////////
+// project : sFFe ( SegFault (or Segmentation Fault :) ) formula evalutaor )
+// author : Mateusz Malczak ( mateusz@malczak.info )
+// wpage : www.segfaultlabs.com/projects/sffe
+///////////////////////////////////////////////////////////////////////////////////////
+// special build for XaoS, for more info visit
+// http://www.segfaultlabs.com/projects/sfXaos
+/////////////////////////////////////////////////////////////////////////////////////*/
+#ifndef SFFE_CMPLX_GSL_H
+#define SFFE_CMPLX_GSL_H
+
+#include <config.h>
+#ifdef SFFE_CMPLX_GSL
+
+#include "sffe.h"
+
+#include <gsl/gsl_complex.h>
+#include <gsl/gsl_complex_math.h>
+
+#define sffnctscount 43
+#define sfvarscount 6
+#define cmplxset(c,r,i) GSL_SET_COMPLEX(&c,r,i)
+#define real(c) GSL_REAL((c))
+#define imag(c) GSL_IMAG((c))
+
+sfarg *sfadd(sfarg * const p); /* + */
+sfarg *sfsub(sfarg * const p); /* - */
+sfarg *sfmul(sfarg * const p); /* * */
+sfarg *sfdiv(sfarg * const p); /* / */
+sfarg *sfsin(sfarg * const p); /* sin */
+sfarg *sfcos(sfarg * const p); /* cos */
+sfarg *sftan(sfarg * const p); /* tan */
+sfarg *sfcot(sfarg * const p); /* ctan */
+sfarg *sfasin(sfarg * const p); /* asin */
+sfarg *sfacos(sfarg * const p); /* acos */
+sfarg *sfatan(sfarg * const p); /* atan */
+sfarg *sfacot(sfarg * const p); /* actan */
+sfarg *sfatan2(sfarg * const p); /* atan2 */
+sfarg *sfsinh(sfarg * const p); /* sinh */
+sfarg *sfcosh(sfarg * const p); /* cosh */
+sfarg *sftanh(sfarg * const p); /* tanh */
+sfarg *sfcoth(sfarg * const p); /* ctanh */
+sfarg *sfexp(sfarg * const p); /* exp */
+sfarg *sflog(sfarg * const p); /* log */
+sfarg *sflog10(sfarg * const p); /* log10 */
+sfarg *sflog2(sfarg * const p); /* log2 */
+sfarg *sflogN(sfarg * const p); /* logN */
+sfarg *sfpow(sfarg * const p); /* csflx pow */
+sfarg *sfpowd(sfarg * const p); /* double pow */
+sfarg *sfpowi(sfarg * const p); /* double pow */
+sfarg *sfpowdc(sfarg * const p); /* double to csflx pow */
+sfarg *sfsqr(sfarg * const p); /* sqr */
+sfarg *sfsqrt(sfarg * const p); /* sqrt */
+sfarg *sfrtni(sfarg * const p); /* rtni */
+sfarg *sfinv(sfarg * const p); /* cinv */
+sfarg *sfceil(sfarg * const p); /* ceil */
+sfarg *sffloor(sfarg * const p); /* floor */
+sfarg *sfabs(sfarg * const p); /* abs - |z| */
+sfarg *sfre(sfarg * const p); /* RE */
+sfarg *sfim(sfarg * const p); /* IM */
+sfarg *sfrabs(sfarg * const p); /* abs - real numbers */
+sfarg *sfrand(sfarg * const p); /* rand */
+/*const eval*/
+void sfcPI(sfNumber * cnst);
+void sfcPI2(sfNumber * cnst);
+void sfc2PI(sfNumber * cnst);
+void sfcE(sfNumber * cnst);
+void sfcI(sfNumber * cnst);
+void sfcRND(sfNumber * cnst);
+#ifdef __cplusplus
+}
+#endif
+
+/* all available function (function pointer, number of parameters, name )*/
+extern const sffunction sfcmplxfunc[sffnctscount];
+/* all available buildin variables */
+extern const char sfcnames[sfvarscount][5];
+/* available variables function pointers */
+extern const cfptr sfcvals[sfvarscount];
+
+#endif
+#endif
diff --git a/src/include/timers.h b/src/include/timers.h
new file mode 100644
index 0000000..140151f
--- /dev/null
+++ b/src/include/timers.h
@@ -0,0 +1,67 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef TIMERS_H
+#define TIMERS_H
+#include "config.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ struct timer;
+ struct timeemulator;
+ typedef struct timer tl_timer;
+ typedef struct timer tl_group;
+
+ void tl_update_time(void);
+ tl_timer *tl_create_timer(void);
+ tl_group *tl_create_group(void);
+ void tl_set_interval(tl_timer * timer, int interval);
+ void tl_set_handler(tl_timer * timer, void (*handler) (void *),
+ void *userdata);
+ void tl_set_multihandler(tl_timer * timer,
+ void (*handler) (void *, int),
+ void *userdata);
+ void tl_add_timer(tl_group * group, tl_timer * timer);
+ void tl_remove_timer(tl_timer * timer);
+ void tl_free_timer(tl_timer * timer);
+ void tl_free_group(tl_group * timer);
+ void tl_stop_timer(tl_timer * t);
+ void tl_resume_timer(tl_timer * t);
+ void tl_slowdown_timer(tl_timer * t, int time);
+ int tl_process_group(tl_group * group, int *activated);
+ extern tl_group *syncgroup, *asyncgroup;
+ void tl_sleep(int);
+ void tl_allegromode(int mode); /*Just for djgpp */
+ int tl_lookup_timer(tl_timer * t) REGISTERS(3);
+ void tl_reset_timer(tl_timer * t) REGISTERS(3);
+
+ struct timeemulator *tl_create_emulator(void);
+ void tl_free_emulator(struct timeemulator *t);
+ void tl_elpased(struct timeemulator *t, int elpased);
+ void tl_emulate_timer(struct timer *t, struct timeemulator *e);
+ void tl_unemulate_timer(struct timer *t);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* TIMER_H */
diff --git a/src/include/true24.h b/src/include/true24.h
new file mode 100644
index 0000000..de626a3
--- /dev/null
+++ b/src/include/true24.h
@@ -0,0 +1,31 @@
+#ifdef cpixel_t
+#undef cpixel_t
+#undef cpixeldata_t
+#undef cppixel_t
+#undef cpixeldata_t
+#undef bpp
+#undef bpp1
+#undef p_add
+#undef p_inc
+#undef p_set
+#undef p_get
+#undef p_setp
+#undef UNSUPPORTED
+#undef p_getp
+#undef p_copy
+#endif
+#ifndef STRUECOLOR24
+#define UNSUPPORTED
+#endif
+#define cpixel_t pixel8_t
+#define cppixel_t ppixel8_t
+#define cpixeldata_t pixel32_t
+#define bpp 3
+/*FIXME this should make problems at small edian machines? */
+#define p_set(ptr,val) ((*(pixel16_t *)(ptr))=(pixel16_t)(val),((ptr)[2])=(pixel8_t)((val)>>16))
+#define p_get(ptr) (((pixel32_t)*(pixel16_t *)(ptr)+(pixel32_t)(*((ptr)+2)<<16)))
+#define p_copy(ptr1,pos1,ptr2,pos2) (*((pixel16_t *)((ptr1)+(pos1)*3))=*(pixel16_t *)((ptr2)+(pos2)*3),(ptr1)[(pos1)*3+2]=(ptr2)[(pos2)*3+2])
+#define p_setp(ptr,pos,val) p_set((ptr)+(pos)*3,val)
+#define p_getp(ptr,pos) p_get((ptr)+(pos)*3)
+#define p_add(ptr,pos) ((ptr)+(pos)*3)
+#define p_inc(ptr,pos) ((ptr)+=(pos)*3)
diff --git a/src/include/truecolor.h b/src/include/truecolor.h
new file mode 100644
index 0000000..9025318
--- /dev/null
+++ b/src/include/truecolor.h
@@ -0,0 +1,13 @@
+#ifdef cpixel_t
+#undef UNSUPPORTED
+#undef cpixel_t
+#undef cpixeldata_t
+#undef cppixel_t
+#undef bpp
+#undef bpp1
+#endif
+#define cpixel_t pixel32_t
+#define cpixeldata_t pixel32_t
+#define cppixel_t ppixel32_t
+#define bpp 4
+#include <generic.h>
diff --git a/src/include/ui.h b/src/include/ui.h
new file mode 100644
index 0000000..8bdf783
--- /dev/null
+++ b/src/include/ui.h
@@ -0,0 +1,160 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifndef UI_H
+#define UI_H
+/*
+#include "xio.h"
+#include "zoom.h"
+*/
+#include "config.h"
+#include "param.h"
+#include "xmenu.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#undef BUTTON1
+#undef BUTTON2
+#undef BUTTON3
+#define BUTTON1 256
+#define BUTTON2 512
+#define BUTTON3 1024
+#define UI_C256 1
+#define UI_GRAYSCALE 2
+#define UI_TRUECOLOR16 4
+#define UI_TRUECOLOR24 8
+#define UI_TRUECOLOR 16
+#define UI_PROTECTIMAGES 32
+#define UI_LBITMAP 256
+#define UI_MBITMAP 512
+#define UI_LIBITMAP 1024
+#define UI_MIBITMAP 2048
+#define UI_FIXEDCOLOR 4096
+
+
+#define NORMALMOUSE 0
+#define WAITMOUSE 1
+#define REPLAYMOUSE 2
+#define VJMOUSE 3
+
+#define UIKEY_UP 257
+#define UIKEY_DOWN 258
+#define UIKEY_LEFT 259
+#define UIKEY_RIGHT 260
+#define UIKEY_ESC 261
+#define UIKEY_BACKSPACE 8
+#define UIKEY_TAB '\t'
+#define UIKEY_HOME 262
+#define UIKEY_END 263
+#define UIKEY_PGUP 264
+#define UIKEY_PGDOWN 265
+
+ typedef unsigned char ui_rgb[4];
+ typedef ui_rgb *ui_palette;
+ struct uih_context;
+ struct gui_driver {
+ void (*setrootmenu) (struct uih_context * c, CONST char *name);
+ void (*enabledisable) (struct uih_context * c, CONST char *name);
+ void (*menu) (struct uih_context * c, CONST char *name);
+ void (*dialog) (struct uih_context * c, CONST char *name);
+ void (*help) (struct uih_context * c, CONST char *name);
+ };
+ struct ui_driver {
+ CONST char *name;
+ int (*init) (void); /*initializing function. recturns 0 if fail */
+ void (*getsize) (int *, int *); /*get current size..in fullscreen versions
+ i.e svga and dos asks user for it */
+ void (*processevents) (int, int *, int *, int *, int *);
+ /*processevents..calls ui_resize,ui_key
+ laso returns possitions of mouse..
+ waits for event if first parameter is
+ 1 */
+ void (*getmouse) (int *, int *, int *);
+ /*returns current mouse possitions */
+ void (*uninit) (void);
+ /*called before exit */
+ int (*set_color) (int, int, int, int);
+ void (*set_range) (ui_palette palette, int, int);
+ /*sets palette color and returns number */
+ void (*print) (int, int, CONST char *); /*prints text */
+ void (*display) (void); /*displays bitmap */
+ int (*alloc_buffers) (char **buffer1, char **buffer2); /*makes buffers */
+ void (*free_buffers) (char *buffer1, char *buffer2); /*frees buffers */
+ void (*flip_buffers) (void); /*prints text */
+ void (*mousetype) (int type);
+ void (*flush) (void);
+ int textwidth;
+ int textheight; /*width of text */
+ /*int helpsize; */
+ CONST struct params *params;
+ int flags;
+ float width, height;
+ int maxwidth, maxheight;
+ int imagetype;
+ int palettestart, paletteend, maxentries;
+ int rmask, gmask, bmask;
+ CONST struct gui_driver *gui_driver;
+ };
+
+ extern struct uih_context *globaluih;
+
+#ifdef USE_LOCALEPATH
+ extern char *localepath;
+#endif
+
+ number_t ui_getfloat(CONST char *text);
+ void ui_resize(void);
+ void ui_call_resize(void);
+ void ui_quit(void) NORETURN;
+ void ui_menu(CONST char *text);
+ void ui_menuactivate(CONST menuitem * item, dialogparam * d);
+ int ui_key(int);
+ void ui_loadstr(CONST char *data);
+ xio_path ui_getfile(CONST char *basename, CONST char *extension);
+ void ui_help(CONST char *name);
+ char *ui_getpos(void);
+ int MAIN_FUNCTION(int argc, char **argv);
+
+
+
+#ifndef RANDOM_PALETTE_SIZE
+#define RANDOM_PALETTE_SIZE 1 /*FIXME currently ignored */
+#define FULLSCREEN 2
+#define UPDATE_AFTER_PALETTE 4
+#define UPDATE_AFTER_RESIZE 8
+#define PALETTE_ROTATION 16
+#define ASYNC_PALETTE 32
+#define ROTATE_INSIDE_CALCULATION 64
+#define PALETTE_REDISPLAYS 128
+#define SCREENSIZE 256
+#define PIXELSIZE 512
+#define RESOLUTION 1024
+#endif
+#define NOFLUSHDISPLAY 2048
+#define AALIB (4096*2)
+#define RESIZE_COMMAND (4096*4)
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* UI_H */
diff --git a/src/include/ui_helper.h b/src/include/ui_helper.h
new file mode 100644
index 0000000..73ead16
--- /dev/null
+++ b/src/include/ui_helper.h
@@ -0,0 +1,550 @@
+#ifndef UI_HELPER_H
+#define UI_HELPER_H
+#include "timers.h"
+#include "xio.h"
+
+#ifdef SFFE_USING
+#include "sffe.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define MAXFILTERS 20
+#define AVRGSIZE 50
+#define NMESSAGES 5
+#define BGCOLOR(uih) uih->palette->index[0]
+#define FGCOLOR(uih) uih->palette->index[1]
+#define SELCOLOR(uih) uih->palette->index[2]
+#define DARKGRAYCOLOR(uih) uih->palette->index[3]
+#define LIGHTGRAYCOLOR(uih) uih->palette->index[4]
+#define LIGHTGRAYCOLOR2(uih) uih->palette->index[5]
+#define NONTRANSPARENTW 1
+#define DRAWBORDER 2
+#define BORDER_PRESSED 4
+#define BORDER_TRANSPARENT 8
+#define BORDER_LIGHT 16
+
+ struct uih_message {
+ char *message[NMESSAGES];
+ tl_timer *messagetimer[NMESSAGES];
+ int messagetype[NMESSAGES];
+ struct uih_window *w[NMESSAGES];
+ int pid[NMESSAGES];
+ int messagestart;
+ };
+ struct uih_line {
+ int key;
+ int morph;
+ int color;
+ int posmode;
+ number_t x1, y1, x2, y2;
+ int mposmode;
+ number_t mx1, my1, mx2, my2;
+ struct uih_line *next, *prev;
+ struct uih_window *w;
+ };
+ struct uih_lines {
+ struct uih_line *first;
+ int morphing;
+ int currkey;
+ };
+
+ struct uih_savedcontext {
+ xio_file file;
+ int mode;
+ number_t speedup, maxstep;
+ number_t xcenter, ycenter;
+ tl_timer *timer;
+ tl_timer *synctimer;
+ struct fractal_context *fcontext;
+ int clearscreen;
+ int fastmode, juliamode, fastrotate, autorotate;
+ number_t rotationspeed;
+ int firsttime;
+ int filter[MAXFILTERS];
+ int pressed;
+ int rotatepressed;
+ int cycling;
+ int shifted;
+ int manualpaletteshift;
+ int direction;
+ int cyclingspeed;
+ int zoomactive;
+ int xtextpos, ytextpos;
+ int writefailed;
+ int nonfractalscreen;
+ int color;
+ };
+#define MAXLEVEL 10 /*Maximal include level */
+ struct uih_playcontext {
+ xio_file file;
+ xio_file prevfiles[MAXLEVEL + 1];
+ int level;
+ xio_path directory;
+ tl_timer *timer;
+ int waittime;
+ int playframe;
+ int timerin;
+ int frametime, starttime;
+ int morph;
+ int morphtimes[2];
+ int morphjulia;
+ int morphjuliatimes[2];
+ int morphangle;
+ int morphangletimes[2];
+ vinfo destination;
+ vinfo source;
+ number_t srcangle, destangle;
+ number_t sr, si, dr, di;
+ int readfailed;
+ int line;
+ struct uih_lines lines;
+ int morphlinetimes[2];
+ };
+#define SQR(val) (((double)(val))*(val))
+#define MORPHVALUE(time,len,starttime,endtime) \
+ (time)<0?0.0 \
+ :(time)>=(len)?1.0 \
+ :(time)<(starttime) && (starttime)?(SQR((time)/(double)(starttime))/2*(starttime)/((len)-(starttime)/2-(endtime)/2))\
+ :((len)-(time)<(endtime)) && (endtime)?1-(SQR(((len)-(time))/(double)(endtime))/2*(endtime)/((len)-(starttime)/2-(endtime)/2)) \
+ :((time)-(starttime)/2)/((double)(len)-(starttime)/2-(endtime)/2)
+#ifdef _NEVER_
+#define MORPHVALUE(time,len,starttime,endtime) \
+ (((time))/((double)(len)))
+#endif
+#define DOMORPH(time,len,starttime,endtime,startval,endval) \
+ ((startval)+((endval)-(startval))*MORPHVALUE(time,len, starttime,endtime))
+
+#define UNDOLEVEL 256
+ struct uih_undocontext {
+ int last;
+ char *undos[256];
+ };
+ struct uih_context {
+ void (*updatemenus) (struct uih_context *, CONST char *);
+ /*stuff that should be visible from outside */
+ number_t speedup, maxstep; /*zooming speed */
+
+ /* Informations provided to the user interface: */
+ CONST char *menuroot;
+ int display; /*1 when ui wants to display something */
+ int save; /*1 if save animation is enabled */
+ int play; /*1 if animation replay is active */
+ int cycling; /*1 if cycling is enabled */
+ int incalculation; /*1 if calulcation is currently in process */
+ int flags;
+ int interrupt; /*set to interrupt current calculation */
+
+ /*server's callbacks */
+ int (*passfunc) (struct uih_context *, int, CONST char *, float);
+ void (*longwait) (struct uih_context *);
+
+ struct uih_undocontext undo;
+ /*Filter system state */
+ struct image *image;
+ struct palette *palette;
+ struct fractal_context *fcontext; /*fractal informations */
+ struct queue *queue;
+ struct filter *uifilter; /*user interface layer */
+ struct filter *rotatef; /* Special filters handler by ui_helper: */
+ struct filter *zengine;
+ struct filter *fixedcolor;
+ /*Julia/filter mechanizm */
+ struct filter *subwindow, *julia, *smalliter;
+ struct filter *filter[MAXFILTERS];
+
+ /*General status variables */
+ double mul; /*speed of last iteration */
+ int rotatemode; /*ROTATE_NONE, ROTATE_CONTINUOUS or ROTATE_NONE */
+ number_t rotationspeed; /*speed of continuous rotation */
+ int fastmode; /*when draw in fast mode */
+ int juliamode;
+ int fastrotate;
+ int uncomplette; /*1 if image is not complettly caluclated or in animation */
+ int dirty; /*1 if image is inexact */
+ int inanimation; /*1 if uih_update wants to be called soon */
+ int fastanimation; /*1 if animation needs to be fast */
+ int palettetype, paletteseed; /*0 for default palette,1,2 for random */
+ int clearscreen; /*1 when ui want to clear screen */
+ int indofractal; /*1 when caluclation is in the process */
+ int xtextpos, ytextpos; /*possitioning of text */
+ int color; /*Color of text */
+ int recalculatemode; /*informations for user interface */
+ int stoppedtimers; /*1 when timers are stopped */
+ int nletters; /*Number of letters displayed at screen */
+ int letterspersec; /*Number of letters per second user should read */
+ char *text[3]; /*Currently displayed text informations: */
+ struct uih_window *textwindow[3], *cscreenwindow;
+ int textpos[3], textcolor[3];
+ CONST char *errstring; /*String of last unprocessed error */
+
+ CONST struct xfont *font; /*Font used by UI */
+ struct uih_window *wtop;
+ int wflipped;
+ int wdisplayed;
+
+ /*Save variables */
+ int todisplayletters;
+ struct uih_savedcontext *savec;
+ int viewchanged; /*When to generate setview commands */
+ int palettechanged; /*When to generate setpalette commands */
+ int displaytext; /*When text was displayed in this frame */
+ int nonfractalscreen;
+ /*waiting variables */
+ void (*complettehandler) (void *); /*Handler to be activated when calculation is complette */
+ void *handlerdata;
+ /*replay variables */
+ struct uih_playcontext *playc;
+ int playpos;
+ CONST char *playstring;
+
+ /*For constant framerate */
+ struct timeemulator *emulator;
+ int emulatedframetime;
+ int aliasnum;
+ int fixedstep;
+
+ /*zoom/unzoom */
+ number_t speed, step;
+ number_t xcenter, ycenter;
+ int xcenterm, ycenterm;
+ int zoomactive;
+
+ /*drag&drop move */
+ int pressed;
+ number_t oldx, oldy;
+ int moved;
+
+ /*drag&drop rotate */
+ int rotatepressed;
+ number_t oldangle;
+
+ int ddatalost;
+ int tbreak;
+
+ int autopilot; /*for uih side of autopilot */
+ int autopilotx, autopiloty, autopilotbuttons;
+
+ /*calculation time variables */
+ int interruptiblemode;
+ int starttime, endtime;
+ int maxtime;
+
+ /*dynamical timeout measuring */
+ int times[2][AVRGSIZE]; /*for statistics */
+ int timespos, count[2];
+ double lastspeed, lasttime;
+
+ /*number_t xsize, ysize; */
+ tl_timer *maintimer, *cyclingtimer, *autopilottimer,
+ *calculatetimer, *doittimer;
+ tl_group *autopilotgroup;
+
+ /*color cycling values */
+ int direction;
+ int cyclingdirection;
+ int stopped;
+ int cyclingspeed;
+
+ /*autopilot internal values */
+ int x1, y1, c1;
+ number_t minsize;
+ number_t maxsize;
+ int autopilotversion;
+ int autime;
+ int minlong;
+ int interlevel;
+
+ /*saved palettes */
+ struct palette *palette2;
+
+ int paletteshift;
+ int manualpaletteshift;
+
+ struct uih_message messg;
+
+ /*Used by uih_update to figure out when save undo */
+ int lastbuttons;
+
+ int encoding;
+
+ /* performers really don't want text echoed to the screen */
+ int inhibittextoutput;
+
+ /* user data */
+ void *data;
+
+#ifdef SFFE_USING
+ /*User formulas (used in sffe parser) */
+ /*sffe *cparser; user define c evaluation formula, not used now, not used yet */
+ sffe *parser; /* fractal formula */
+ sffe *pinit;
+#endif
+
+ };
+ typedef void (*uih_getposfunc) (struct uih_context * c, int *x, int *y,
+ int *width, int *height, void *data);
+ typedef void (*uih_drawfunc) (struct uih_context * c, void *data);
+ struct uih_window {
+ int x, y, width, height;
+ uih_getposfunc getpos;
+ uih_drawfunc draw;
+ struct uih_window *next;
+ struct uih_window *previous;
+ int savedline, savedpos;
+ char *saveddata;
+ void *data;
+ int flags;
+ };
+ typedef struct uih_context uih_context;
+
+#define UIH_SAVEALL 2
+#define UIH_SAVEANIMATION 1
+#define UIH_SAVEPOS 0
+
+#define UIH_PALETTEDRAW -2
+#define UIH_FILTERANIMATION -1
+#define UIH_INTERRUPTIBLE 0
+#define UIH_ANIMATION 1
+#define UIH_NEW_IMAGE 2
+#define UIH_UNINTERRUPTIBLE 3
+#define FRAMETIME (1000000/FRAMERATE)
+
+#define UIH_TEXTTOP 0
+#define UIH_TEXTMIDDLE 1
+#define UIH_TEXTBOTTOM 2
+
+#define UIH_TEXTLEFT 0
+#define UIH_TEXTCENTER 1
+#define UIH_TEXTRIGHT 2
+
+#define RANDOM_PALETTE_SIZE 1
+#define FULLSCREEN 2
+#define UPDATE_AFTER_PALETTE 4
+#define UPDATE_AFTER_RESIZE 8
+#define PALETTE_ROTATION 16
+#define ASYNC_PALETTE 32
+#define ROTATE_INSIDE_CALCULATION 64
+#define PALETTE_REDISPLAYS 128
+#define SCREENSIZE 256
+#define PIXELSIZE 512
+#define RESOLUTION 1024
+
+#define BUTTON1 256
+#define BUTTON2 512
+#define BUTTON3 1024
+
+#define ROTATE_NONE 0
+#define ROTATE_MOUSE 1
+#define ROTATE_CONTINUOUS 2
+
+#define uih_needrecalculate(context) ((context)->recalculatemode)
+#define uih_needdisplay(context) ((context)->display)
+#define GETMAX(a,b) ((a)>(b)?(a):(b))
+#define uih_newimage(c) ((c)->display=1,((c)->recalculatemode=GETMAX((c)->recalculatemode,UIH_NEW_IMAGE)))
+#define uih_animate_image(c) ((c)->display=1,(c)->recalculatemode=GETMAX((c)->recalculatemode,UIH_ANIMATION))
+
+#define uih_updatemenus(uih,c) if(uih->updatemenus!=NULL) uih->updatemenus(uih,c);
+
+ extern CONST struct filteraction *CONST uih_filters[MAXFILTERS];
+ extern CONST int uih_nfilters;
+
+ struct uih_context *uih_mkcontext(int flags, struct image *image,
+ int (*passfunc) (struct uih_context
+ *, int,
+ CONST char *,
+ float),
+ void (*longwait) (struct uih_context
+ *),
+ void (*updatemenus) (struct
+ uih_context * c,
+ CONST char *));
+ int uih_updateimage(uih_context * c, struct image *img);
+ void uih_freecontext(uih_context * c);
+
+
+ void uih_callcomplette(uih_context * c);
+/*palette functions */
+ void uih_mkdefaultpalette(uih_context * c);
+ void uih_mkpalette(uih_context * c);
+ void uih_savepalette(uih_context * c);
+ void uih_restorepalette(uih_context * c);
+ void uih_loadpalette(uih_context * c, struct palette *palette);
+
+/*autopilot handling */
+ void uih_autopilot_on(uih_context * c);
+ void uih_autopilot_off(uih_context * c);
+
+/*misc functions */
+ int uih_update(uih_context * c, int mousex, int mousey,
+ int mousebuttons);
+ CONST char *uih_save(struct uih_context *c, xio_constpath filename);
+ void uih_tbreak(uih_context * c);
+ double uih_displayed(uih_context * c);
+ void uih_do_fractal(uih_context * c);
+ void uih_prepare_image(uih_context * c);
+ void uih_interrupt(uih_context * c);
+ void uih_stopzooming(uih_context * c);
+ void uih_setspeedup(uih_context * c, number_t speed);
+ void uih_setmaxstep(uih_context * c, number_t speed);
+ void uih_setcomplettehandler(uih_context * c, void (h) (void *),
+ void *d);
+ void uih_recalculate(struct uih_context *c);
+ void uih_initstate(struct uih_context *uih);
+ void uih_screentofractalcoord(uih_context * c, int mousex, int mousey,
+ number_t * re, number_t * im);
+
+
+/*cycling functions */
+ void uih_cycling_off(struct uih_context *c);
+ void uih_cycling_stop(struct uih_context *c);
+ void uih_cycling_continue(struct uih_context *c);
+ void uih_setcycling(struct uih_context *c, int speed);
+ int uih_cycling_on(struct uih_context *c);
+ int uih_cycling(struct uih_context *c, int mode);
+
+/*fractal context manipulation routines */
+ void uih_setformula(uih_context * c, int formula);
+ void uih_setperbutation(uih_context * c, number_t re, number_t im);
+ void uih_perbutation(uih_context * c, int mousex, int mousey);
+ void uih_setmaxiter(uih_context * c, int maxiter);
+ void uih_setbailout(uih_context * c, number_t bailout);
+ void uih_setincoloringmode(uih_context * c, int mode);
+ void uih_setoutcoloringmode(uih_context * c, int mode);
+ void uih_setintcolor(uih_context * c, int mode);
+ void uih_setouttcolor(uih_context * c, int mode);
+ void uih_setplane(uih_context * c, int mode);
+ void uih_setmandelbrot(uih_context * c, int mode, int mousex,
+ int mousey);
+ void uih_setfastmode(uih_context * c, int mode);
+ void uih_setguessing(uih_context * c, int range);
+ void uih_setperiodicity(uih_context * c, int periodicity);
+ void uih_display(uih_context * c);
+ void uih_disablejulia(uih_context * c);
+ int uih_enablejulia(uih_context * c);
+ int uih_setjuliamode(uih_context * c, int mode);
+ void uih_setjuliaseed(uih_context * c, number_t zre, number_t zim);
+
+/*filter manipulation */
+ int uih_enablefilter(uih_context * c, int n);
+ void uih_disablefilter(uih_context * c, int n);
+
+/*Animation save routines */
+ int uih_save_enable(struct uih_context *uih, xio_file f, int mode);
+ void uih_save_disable(struct uih_context *uih);
+ void uih_saveframe(struct uih_context *uih);
+ void uih_save_possition(struct uih_context *uih, xio_file f, int mode);
+
+ void uih_load(struct uih_context *uih, xio_file f, xio_constpath name);
+ void uih_loadstr(struct uih_context *uih, CONST char *data);
+ void uih_playstr(struct uih_context *uih, CONST char *data);
+ void uih_playupdate(struct uih_context *uih);
+ void uih_replaydisable(struct uih_context *uih);
+ void uih_skipframe(struct uih_context *uih);
+ int uih_replayenable(struct uih_context *uih, xio_file f,
+ xio_constpath filename, int animroot);
+ void uih_command(struct uih_context *uih, CONST char *command);
+ void uih_playtutorial(struct uih_context *c, CONST char *name);
+
+/* Easy to use functions for handling save/load*/
+ void uih_loadfile(struct uih_context *uih, xio_constpath d);
+ void uih_playfile(struct uih_context *c, xio_constpath d);
+ void uih_loadexample(struct uih_context *c);
+ void uih_savepngfile(struct uih_context *c, xio_constpath d);
+ void uih_saveposfile(struct uih_context *c, xio_constpath d);
+ char *uih_savepostostr(struct uih_context *c);
+ void uih_savecfg(struct uih_context *c);
+ void uih_saveanimfile(struct uih_context *c, xio_constpath d);
+ void uih_update_lines(uih_context * c);
+
+
+/*timer functions */
+ void uih_stoptimers(uih_context * c);
+ void uih_resumetimers(uih_context * c);
+ void uih_slowdowntimers(uih_context * c, int time);
+
+/*text output functions */
+ void uih_clearscreen(uih_context * c);
+ void uih_settextpos(uih_context * c, int x, int y);
+ void uih_text(uih_context * c, CONST char *text);
+ void uih_letterspersec(uih_context * c, int n);
+
+/*image rotation functions */
+ int uih_fastrotate(uih_context * c, int mode);
+ int uih_fastrotateenable(uih_context * c);
+ void uih_fastrotatedisable(uih_context * c);
+ void uih_angle(uih_context * c, number_t angle);
+ void uih_rotatemode(uih_context * c, int mode);
+ void uih_rotate(uih_context * c, int mode);
+ void uih_rotationspeed(uih_context * c, number_t speed);
+
+/*Catalog functions */
+ int uih_loadcatalog(uih_context * c, CONST char *name);
+ void uih_freecatalog(uih_context * c);
+
+ void uih_registermenus(void);
+ void uih_registermenus_i18n(void);
+ void uih_registermenudialogs_i18n(void);
+ void uih_unregistermenus(void);
+
+/*Windows :)*/
+ struct uih_window *uih_registerw(struct uih_context *uih,
+ uih_getposfunc getpos,
+ uih_drawfunc draw, void *data,
+ int flags);
+ void uih_removew(struct uih_context *uih, struct uih_window *w);
+ void uih_clearwindows(struct uih_context *uih);
+ void uih_drawwindows(struct uih_context *uih);
+ void uih_drawborder(struct uih_context *uih, int x, int y, int width,
+ int height, int flags);
+ void uih_setline(struct uih_context *uih, struct uih_window *w,
+ int color, int x1, int y1, int x2, int y2);
+ struct uih_window *uih_registerline(struct uih_context *uih, int color,
+ int x1, int y1, int x2, int y2);
+
+
+/*Messages*/
+ void uih_scrollup(uih_context * c);
+ void uih_clearmessages(uih_context * c);
+ int uih_message(uih_context * c, CONST char *message);
+ int uih_error(uih_context * c, CONST char *error);
+ void uih_rmmessage(uih_context * c, int pid);
+ void uih_printmessages(uih_context * c);
+
+/*Constant framerate functions*/
+ void uih_emulatetimers(uih_context * c);
+ void uih_constantframetime(uih_context * c, int time);
+ void uih_noconstantframetime(uih_context * c);
+
+/*undo and redo*/
+ void uih_saveundo(uih_context * c);
+ void uih_undo(uih_context * c);
+ void uih_redo(uih_context * c);
+
+ void uih_setfont(uih_context * c);
+
+/*animation rendering*/
+ int uih_renderanimation(struct uih_context *gc, CONST char *basename,
+ CONST xio_constpath animation, int width,
+ int height, float pixelwidth,
+ float pixelheight, int frametime, int type,
+ int antialiasing, int slowmode,
+ int letterspersec, CONST char *catalog,
+ int motionvectors, int iframedist2);
+ int uih_renderimage(struct uih_context *gc1, xio_file af,
+ xio_constpath path, struct image *img,
+ int antialias, CONST char *catalog, int noise);
+
+ void uih_initmessages(uih_context * c);
+ void uih_destroymessages(uih_context * c);
+ void uih_inittext(uih_context * c);
+ void uih_destroytext(uih_context * c);
+
+ void uih_inhibittextsw(uih_context * c);
+ int uih_inhibittextselected(uih_context * c);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/include/version.h.in b/src/include/version.h.in
new file mode 100644
index 0000000..8b80450
--- /dev/null
+++ b/src/include/version.h.in
@@ -0,0 +1,23 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#undef PACKAGE_VERSION
+#define XaoS_VERSION PACKAGE_VERSION
diff --git a/src/include/xerror.h b/src/include/xerror.h
new file mode 100644
index 0000000..2ae5638
--- /dev/null
+++ b/src/include/xerror.h
@@ -0,0 +1,12 @@
+#ifndef XERROR_H
+#define XERROR_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+ void x_message(CONST char *text, ...);
+ void x_error(CONST char *text, ...);
+ void x_fatalerror(CONST char *text, ...) NORETURN;
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/include/xio.h b/src/include/xio.h
new file mode 100644
index 0000000..2395302
--- /dev/null
+++ b/src/include/xio.h
@@ -0,0 +1,107 @@
+/* This is implementation of input/output routines similar to stdio.
+ purpose of this library is to hide differences between OSes (Mac OS don't
+ have stdio!) and allow general streams to strings etc. */
+#ifndef XIO1_H
+#define XIO1_H 1
+#include <config.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define XIO_FAILED NULL
+ struct xio_filestruct {
+ void *data;
+ int (*fputc) (int c, struct xio_filestruct * f);
+ int (*fputs) (const char *s, struct xio_filestruct * f);
+ int (*fgetc) (struct xio_filestruct * f);
+ int (*fungetc) (int c, struct xio_filestruct * f);
+ int (*xeof) (struct xio_filestruct * f);
+ int (*fclose) (struct xio_filestruct * f);
+ int (*flush) (struct xio_filestruct * f);
+ };
+
+ typedef struct xio_filestruct *xio_file;
+
+#define xio_puts(s,f) (f)->fputs((s),(f))
+#define xio_putc(s,f) (f)->fputc((s),(f))
+#define xio_getc(f) (f)->fgetc((f))
+#define xio_ungetc(s,f) (f)->fungetc((s),(f))
+#define xio_feof(f) (f)->xeof((f))
+#define xio_close(f) (f)->fclose((f))
+#define xio_flush(f) if ((f)->flush!=NULL) (f)->flush((f))
+
+/* Standard stdio maps. These defines says, that filenames are strings and
+ path is separated by slash or backslash (windoze, dog)
+ the main I/O routines are in the xstdio file
+*/
+
+#ifdef USE_STDIO
+/* Ugly hack because of unknown problems w/ va_list in v*print* in plan9 */
+#ifdef _plan9_
+#define va_list char *
+#endif
+#include <stdio.h>
+
+ typedef char *xio_path;
+ typedef CONST char *xio_constpath;
+ typedef char xio_pathdata[4096];
+ extern char *xio_appdir; /*Where application binary is */
+ extern char *xio_homedir;
+
+
+#ifdef _WIN32
+#define XIO_PATHSEP '\\'
+#define XIO_PATHSEPSTR "\\"
+#define XIO_EMPTYPATH ".\\" /*Should be also call to currentdir function */
+#else
+#ifdef DJGPP
+#define XIO_PATHSEP '\\'
+#define XIO_PATHSEPSTR "\\"
+#define XIO_EMPTYPATH ".\\" /*Should be also call to currentdir function */
+#else
+#define XIO_PATHSEP '/'
+#define XIO_PATHSEPSTR "/"
+#define XIO_EMPTYPATH "./" /*Should be also call to currentdir function */
+#endif
+#endif
+#define XIO_EOF EOF
+
+#define xio_addfname(destination, dirrectory, filename) \
+{strcpy(destination,dirrectory);if (strlen(dirrectory)&&destination[strlen(destination)-1]!=XIO_PATHSEP) strcat(destination,XIO_PATHSEPSTR);strcat(destination,filename);}
+#define xio_addextension(destination,extension) strcat(destination,extension)
+
+#ifdef _plan9_
+#define xio_errorstring() errstr
+#else
+#define xio_errorstring() strerror(errno)
+#endif /*plan9 */
+
+ char *xio_fixpath(CONST char *name);
+#endif /*USE_STDIO */
+
+ xio_file xio_ropen(xio_constpath name);
+ xio_file xio_wopen(xio_constpath name);
+ xio_file xio_strropen(CONST char *c);
+ xio_file xio_strwopen(void);
+ char *xio_getstring(xio_file f);
+ xio_path xio_getdirectory(xio_constpath name);
+ xio_path xio_getfilename(CONST char *base, CONST char *extension);
+ xio_file xio_getrandomexample(xio_path name);
+ xio_file xio_getcatalog(CONST char *name);
+ xio_file xio_gethelp(void);
+ xio_file xio_gettutorial(CONST char *name, xio_path result);
+
+ /*look trought directory with examples, choose one file, open it (and return
+ *descriptor+put name into name parameter*/
+ int xio_exist(xio_constpath name);
+ int xio_getfiles(xio_constpath path, char ***names, char ***dirs,
+ int *nnames, int *ndirs);
+ void xio_init(CONST char *c);
+ void xio_uninit(void);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/include/xldio.h b/src/include/xldio.h
new file mode 100644
index 0000000..b17a993
--- /dev/null
+++ b/src/include/xldio.h
@@ -0,0 +1,14 @@
+#ifndef X_LDIO_H
+#define X_LDIO_H
+#ifdef USE_XLDIO
+#include "xio.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+ void x_ldout(long double param, int prec, xio_file stream);
+ long double x_strtold(CONST char *s, CONST char **sret);
+#ifdef __cplusplus
+}
+#endif
+#endif /*USE_XLDIO */
+#endif /*X_LDIO_H */
diff --git a/src/include/xmenu.h b/src/include/xmenu.h
new file mode 100644
index 0000000..70d3ccc
--- /dev/null
+++ b/src/include/xmenu.h
@@ -0,0 +1,377 @@
+#ifndef XMENU_H
+#define XMENU_H
+#include <xio.h>
+#include <fconfig.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ struct uih_context;
+ typedef union {
+ char *dstring;
+ int dint;
+ number_t number;
+ number_t dcoord[2];
+ xio_path dpath;
+ void *dummy;
+ } dialogparam;
+ typedef struct dialog {
+ CONST char *question;
+ int type;
+ int defint;
+ CONST char *defstr;
+ number_t deffloat;
+ number_t deffloat2;
+ } menudialog;
+
+ typedef char *(*tokenfunc) (struct uih_context * c);
+#define DIALOG_INT 1
+#define DIALOG_FLOAT 2
+#define DIALOG_STRING 3
+#define DIALOG_KEYSTRING 4
+#define DIALOG_IFILE 5
+#define DIALOG_OFILE 6
+#define DIALOG_CHOICE 7
+#define DIALOG_ONOFF 8
+#define DIALOG_COORD 9
+
+#define DIALOGIFILE(question,filename) {question, DIALOG_IFILE, 0,filename}
+#define DIALOGOFILE(question,filename) {question, DIALOG_OFILE, 0,filename}
+#define DIALOGSTR(question,default) {question, DIALOG_STRING, 0, default}
+#define DIALOGKEYSTR(question,default) {question, DIALOG_KEYSTRING, 0, default}
+#define DIALOGINT(question,default) {question, DIALOG_INT, default}
+#define DIALOGONOFF(question,default) {question, DIALOG_ONOFF, default}
+#define DIALOGFLOAT(question,default) {question, DIALOG_FLOAT, 0, NULL, default}
+#define DIALOGCHOICE(question,table,default) {question, DIALOG_CHOICE, default,(CONST char *)table}
+#define DIALOGCOORD(question,default1,default2) {question, DIALOG_COORD,0, NULL, default1,default2}
+
+#define DIALOGIFILE_I(_question,_filename) \
+ menudialogs_i18n[no_menudialogs_i18n].question=_question; \
+ menudialogs_i18n[no_menudialogs_i18n].type=DIALOG_IFILE; \
+ menudialogs_i18n[no_menudialogs_i18n].defint=0; \
+ menudialogs_i18n[no_menudialogs_i18n].defstr=_filename; \
+ menudialogs_i18n[no_menudialogs_i18n].deffloat=0; \
+ menudialogs_i18n[no_menudialogs_i18n].deffloat2=0; \
+ ++no_menudialogs_i18n;
+#define DIALOGOFILE_I(_question,_filename) \
+ menudialogs_i18n[no_menudialogs_i18n].question=_question; \
+ menudialogs_i18n[no_menudialogs_i18n].type=DIALOG_OFILE; \
+ menudialogs_i18n[no_menudialogs_i18n].defint=0; \
+ menudialogs_i18n[no_menudialogs_i18n].defstr=_filename; \
+ ++no_menudialogs_i18n;
+#define DIALOGKEYSTR_I(_question,_default) \
+ menudialogs_i18n[no_menudialogs_i18n].question=_question; \
+ menudialogs_i18n[no_menudialogs_i18n].type=DIALOG_KEYSTRING; \
+ menudialogs_i18n[no_menudialogs_i18n].defint=0; \
+ menudialogs_i18n[no_menudialogs_i18n].defstr=_default; \
+ ++no_menudialogs_i18n;
+#define DIALOGSTR_I(_question,_default) \
+ menudialogs_i18n[no_menudialogs_i18n].question=_question; \
+ menudialogs_i18n[no_menudialogs_i18n].type=DIALOG_STRING; \
+ menudialogs_i18n[no_menudialogs_i18n].defint=0; \
+ menudialogs_i18n[no_menudialogs_i18n].defstr=_default; \
+ ++no_menudialogs_i18n;
+#define DIALOGINT_I(_question,_default) \
+ menudialogs_i18n[no_menudialogs_i18n].question=_question; \
+ menudialogs_i18n[no_menudialogs_i18n].type=DIALOG_INT; \
+ menudialogs_i18n[no_menudialogs_i18n].defint=_default; \
+ ++no_menudialogs_i18n;
+#define DIALOGONOFF_I(_question,_default) \
+ menudialogs_i18n[no_menudialogs_i18n].question=_question; \
+ menudialogs_i18n[no_menudialogs_i18n].type=DIALOG_ONOFF; \
+ menudialogs_i18n[no_menudialogs_i18n].defint=_default; \
+ ++no_menudialogs_i18n;
+#define DIALOGFLOAT_I(_question,_default) \
+ menudialogs_i18n[no_menudialogs_i18n].question=_question; \
+ menudialogs_i18n[no_menudialogs_i18n].type=DIALOG_FLOAT; \
+ menudialogs_i18n[no_menudialogs_i18n].defint=0; \
+ menudialogs_i18n[no_menudialogs_i18n].defstr=NULL; \
+ menudialogs_i18n[no_menudialogs_i18n].deffloat=_default; \
+ ++no_menudialogs_i18n;
+#define DIALOGCHOICE_I(_question,_table,_default) \
+ menudialogs_i18n[no_menudialogs_i18n].question=_question; \
+ menudialogs_i18n[no_menudialogs_i18n].type=DIALOG_CHOICE; \
+ menudialogs_i18n[no_menudialogs_i18n].defint=_default; \
+ menudialogs_i18n[no_menudialogs_i18n].defstr=(CONST char *)_table; \
+ ++no_menudialogs_i18n;
+#define DIALOGCOORD_I(_question,_default1,_default2) \
+ menudialogs_i18n[no_menudialogs_i18n].question=_question; \
+ menudialogs_i18n[no_menudialogs_i18n].type=DIALOG_COORD; \
+ menudialogs_i18n[no_menudialogs_i18n].defint=0; \
+ menudialogs_i18n[no_menudialogs_i18n].defstr=NULL; \
+ menudialogs_i18n[no_menudialogs_i18n].deffloat=_default1; \
+ menudialogs_i18n[no_menudialogs_i18n].deffloat2=_default2; \
+ ++no_menudialogs_i18n;
+
+#define NULL_I() \
+ menudialogs_i18n[no_menudialogs_i18n].question=NULL; \
+ menudialogs_i18n[no_menudialogs_i18n].type=0; \
+ menudialogs_i18n[no_menudialogs_i18n].defint=0; \
+ menudialogs_i18n[no_menudialogs_i18n].defstr=NULL; \
+ menudialogs_i18n[no_menudialogs_i18n].deffloat=0; \
+ menudialogs_i18n[no_menudialogs_i18n].deffloat2=0; \
+ ++no_menudialogs_i18n;
+
+ typedef struct menuitem {
+ CONST char *menuname;
+ CONST char *key;
+ CONST char *name;
+ CONST char *shortname;
+ int type;
+ int flags;
+ void (*function) (void);
+ int iparam;
+ CONST void *pparam;
+ int (*control) (void);
+ CONST menudialog *(*dialog) (struct uih_context *);
+ } menuitem;
+
+#define MENU_NOPARAM 1
+#define MENU_SUBMENU 2
+#define MENU_INT 3
+#define MENU_STRING 4
+#define MENU_DIALOG 6
+#define MENU_CUSTOMDIALOG 7
+#define MENU_SEPARATOR 8
+
+/* Definitions for static menuitems. These items cannot be internationalized.
+ All of these definitions will become obsolete soon: */
+
+#define MENUNOP(menuname,key,name,shortname,flags,function) {menuname, key,name,shortname, MENU_NOPARAM, flags, (void (*)(void))function}
+#define MENUNOPCB(menuname,key,name,shortname,flags,function,checkbutton) {menuname, key, name,shortname, MENU_NOPARAM, (flags)|MENUFLAG_CHECKBOX, (void (*)(void))function,0,NULL,(int (*)(void))checkbutton}
+#define MENUCOORDCB(menuname,key,name,shortname,flags,function,checkbutton) {menuname, key, name,shortname, MENU_COORD, (flags)|MENUFLAG_CHECKBOX, (void (*)(void))function,0,NULL,(int (*)(void))checkbutton}
+#define MENUCOORD(menuname,key,name,shortname,flags,function) {menuname, key, name,shortname, MENU_COORD, flags, (void (*)(void))function}
+
+#define MENUINT(menuname,key,name,shortname,flags,function,param) {menuname, key, name,shortname, MENU_INT, flags, (void (*)(void))function,param}
+#define MENUINTRB(menuname,key,name,shortname,flags,function,param,checkbutton) {menuname, key, name,shortname, MENU_INT, (flags)|MENUFLAG_RADIO, (void (*)(void))function,param,NULL,(int (*)(void))checkbutton}
+#define SUBMENU(menuname,key,name,param) {menuname, key, name,param, MENU_SUBMENU, 0, NULL,0,NULL}
+
+#define MENUSEPARATOR(menuname) {menuname, 0, "", NULL, MENU_SEPARATOR, 0, NULL,0,NULL}
+#define SUBMENUNOOPT(menuname,key,name,param) {menuname, key, name,param, MENU_SUBMENU, MENUFLAG_NOOPTION, NULL,0,NULL}
+#define MENUDIALOG(menuname,key,name,shortname,flags,function,param) {menuname, key, name,shortname, MENU_DIALOG, flags, (void (*)(void))function,0,param}
+#define MENUDIALOGCB(menuname,key,name,shortname,flags,function,param,check) {menuname, key, name,shortname, MENU_DIALOG, flags|MENUFLAG_CHECKBOX, (void (*)(void))function,0,param,(int (*)(void))check}
+#define MENUCDIALOG(menuname,key,name,shortname,flags,function,param) {menuname, key, name,shortname, MENU_CUSTOMDIALOG, flags, (void (*)(void))function,0,NULL,NULL,(CONST menudialog *(*)(struct uih_context *))param}
+#define MENUCDIALOGCB(menuname,key,name,shortname,flags,function,param,check) {menuname, key, name,shortname, MENU_CUSTOMDIALOG, flags|MENUFLAG_CHECKBOX,(void (*)(void))function,0,NULL,(int (*)(void))check,(CONST menudialog *(*)(struct uih_context *))param}
+#define MENUSTRING(menuname,key,name,shortname,flags,function,param) {menuname, key, name,shortname, MENU_STRING, flags, (void (*)(void))function,0,param}
+
+
+/* Definitions for internationalized menus. All of them must be defined
+ dynamically because gettext() cannot be used within a static
+ variable. Usage (example):
+
+ SUBMENU_I("file", "q", "Quit", "quitmenu")
+
+ See ui/ui.c, ui_registermenus_i18n() for further details. */
+
+#define MENUNOP_I(_menuname,_key,_name,_shortname,_flags,_function)\
+ menuitems_i18n[no_menuitems_i18n].menuname = _menuname; \
+ menuitems_i18n[no_menuitems_i18n].shortname = _shortname; \
+ menuitems_i18n[no_menuitems_i18n].key = _key; \
+ menuitems_i18n[no_menuitems_i18n].type = MENU_NOPARAM; \
+ menuitems_i18n[no_menuitems_i18n].flags = _flags; \
+ menuitems_i18n[no_menuitems_i18n].iparam = 0; \
+ menuitems_i18n[no_menuitems_i18n].name = _name; \
+ menuitems_i18n[no_menuitems_i18n].pparam = NULL; \
+ menuitems_i18n[no_menuitems_i18n].function = (void (*)(void))_function; \
+ ++no_menuitems_i18n;
+
+#define MENUNOPCB_I(_menuname,_key,_name,_shortname,_flags,_function,_checkbutton) \
+ menuitems_i18n[no_menuitems_i18n].menuname = _menuname; \
+ menuitems_i18n[no_menuitems_i18n].shortname = _shortname; \
+ menuitems_i18n[no_menuitems_i18n].key = _key; \
+ menuitems_i18n[no_menuitems_i18n].type = MENU_NOPARAM; \
+ menuitems_i18n[no_menuitems_i18n].flags = (_flags)|MENUFLAG_CHECKBOX; \
+ menuitems_i18n[no_menuitems_i18n].iparam = 0; \
+ menuitems_i18n[no_menuitems_i18n].name = _name; \
+ menuitems_i18n[no_menuitems_i18n].pparam = NULL; \
+ menuitems_i18n[no_menuitems_i18n].function = (void (*)(void))_function; \
+ menuitems_i18n[no_menuitems_i18n].control = (int (*)(void))_checkbutton; \
+ ++no_menuitems_i18n;
+
+#define MENUINT_I(_menuname,_key,_name,_shortname,_flags,_function,_param) \
+ menuitems_i18n[no_menuitems_i18n].menuname = _menuname; \
+ menuitems_i18n[no_menuitems_i18n].shortname = _shortname; \
+ menuitems_i18n[no_menuitems_i18n].key = _key; \
+ menuitems_i18n[no_menuitems_i18n].type = MENU_INT; \
+ menuitems_i18n[no_menuitems_i18n].flags = _flags; \
+ menuitems_i18n[no_menuitems_i18n].iparam = _param; \
+ menuitems_i18n[no_menuitems_i18n].name = _name; \
+ menuitems_i18n[no_menuitems_i18n].function = (void (*)(void))_function; \
+ ++no_menuitems_i18n;
+
+#define MENUINTRB_I(_menuname,_key,_name,_shortname,_flags,_function,_param,_checkbutton) \
+ menuitems_i18n[no_menuitems_i18n].menuname = _menuname; \
+ menuitems_i18n[no_menuitems_i18n].shortname = _shortname; \
+ menuitems_i18n[no_menuitems_i18n].key = _key; \
+ menuitems_i18n[no_menuitems_i18n].type = MENU_INT; \
+ menuitems_i18n[no_menuitems_i18n].flags = (_flags)|MENUFLAG_RADIO; \
+ menuitems_i18n[no_menuitems_i18n].iparam = _param; \
+ menuitems_i18n[no_menuitems_i18n].pparam = NULL; \
+ menuitems_i18n[no_menuitems_i18n].name = _name; \
+ menuitems_i18n[no_menuitems_i18n].function = (void (*)(void))_function; \
+ menuitems_i18n[no_menuitems_i18n].control = (int (*)(void))_checkbutton; \
+ ++no_menuitems_i18n;
+
+#define SUBMENU_I(_menuname,_key,_name,_param) \
+ menuitems_i18n[no_menuitems_i18n].menuname = _menuname; \
+ menuitems_i18n[no_menuitems_i18n].shortname = _param; \
+ menuitems_i18n[no_menuitems_i18n].key = _key; \
+ menuitems_i18n[no_menuitems_i18n].type = MENU_SUBMENU; \
+ menuitems_i18n[no_menuitems_i18n].flags = 0; \
+ menuitems_i18n[no_menuitems_i18n].iparam = 0; \
+ menuitems_i18n[no_menuitems_i18n].name = _name; \
+ menuitems_i18n[no_menuitems_i18n].pparam = NULL; \
+ menuitems_i18n[no_menuitems_i18n].function = NULL; \
+ ++no_menuitems_i18n;
+
+#define MENUDIALOG_I(_menuname,_key,_name,_shortname,_flags,_function,_param) \
+ menuitems_i18n[no_menuitems_i18n].menuname = _menuname; \
+ menuitems_i18n[no_menuitems_i18n].shortname = _shortname; \
+ menuitems_i18n[no_menuitems_i18n].key = _key; \
+ menuitems_i18n[no_menuitems_i18n].type = MENU_DIALOG; \
+ menuitems_i18n[no_menuitems_i18n].flags = _flags; \
+ menuitems_i18n[no_menuitems_i18n].iparam = 0; \
+ menuitems_i18n[no_menuitems_i18n].name = _name; \
+ menuitems_i18n[no_menuitems_i18n].pparam = _param; \
+ menuitems_i18n[no_menuitems_i18n].function = (void (*)(void))_function; \
+ ++no_menuitems_i18n;
+
+#define MENUDIALOGCB_I(_menuname,_key,_name,_shortname,_flags,_function,_param,_check) \
+ menuitems_i18n[no_menuitems_i18n].menuname = _menuname; \
+ menuitems_i18n[no_menuitems_i18n].shortname = _shortname; \
+ menuitems_i18n[no_menuitems_i18n].key = _key; \
+ menuitems_i18n[no_menuitems_i18n].type = MENU_DIALOG; \
+ menuitems_i18n[no_menuitems_i18n].flags = (_flags)|MENUFLAG_CHECKBOX; \
+ menuitems_i18n[no_menuitems_i18n].iparam = 0; \
+ menuitems_i18n[no_menuitems_i18n].name = _name; \
+ menuitems_i18n[no_menuitems_i18n].pparam = _param; \
+ menuitems_i18n[no_menuitems_i18n].function = (void (*)(void))_function; \
+ menuitems_i18n[no_menuitems_i18n].control = (int (*)(void))_check; \
+ ++no_menuitems_i18n;
+
+#define MENUCDIALOG_I(_menuname,_key,_name,_shortname,_flags,_function,_param) \
+ menuitems_i18n[no_menuitems_i18n].menuname = _menuname; \
+ menuitems_i18n[no_menuitems_i18n].shortname = _shortname; \
+ menuitems_i18n[no_menuitems_i18n].key = _key; \
+ menuitems_i18n[no_menuitems_i18n].type = MENU_CUSTOMDIALOG; \
+ menuitems_i18n[no_menuitems_i18n].flags = _flags; \
+ menuitems_i18n[no_menuitems_i18n].iparam = 0; \
+ menuitems_i18n[no_menuitems_i18n].name = _name; \
+ menuitems_i18n[no_menuitems_i18n].pparam = NULL; \
+ menuitems_i18n[no_menuitems_i18n].control = NULL; \
+ menuitems_i18n[no_menuitems_i18n].function = (void (*)(void))_function; \
+ menuitems_i18n[no_menuitems_i18n].dialog = (CONST menudialog *(*)(struct uih_context *))_param; \
+ ++no_menuitems_i18n;
+
+#define MENUCDIALOGCB_I(_menuname,_key,_name,_shortname,_flags,_function,_param,_check)\
+ menuitems_i18n[no_menuitems_i18n].menuname = _menuname; \
+ menuitems_i18n[no_menuitems_i18n].shortname = _shortname; \
+ menuitems_i18n[no_menuitems_i18n].key = _key; \
+ menuitems_i18n[no_menuitems_i18n].type = MENU_CUSTOMDIALOG; \
+ menuitems_i18n[no_menuitems_i18n].flags = (_flags)|MENUFLAG_CHECKBOX; \
+ menuitems_i18n[no_menuitems_i18n].iparam = 0; \
+ menuitems_i18n[no_menuitems_i18n].name = _name; \
+ menuitems_i18n[no_menuitems_i18n].pparam = _param; \
+ menuitems_i18n[no_menuitems_i18n].function = (void (*)(void))_function; \
+ menuitems_i18n[no_menuitems_i18n].control = (int (*)(void))_check; \
+ menuitems_i18n[no_menuitems_i18n].dialog = (CONST menudialog *(*)(struct uih_context *))_param; \
+ ++no_menuitems_i18n;
+
+#define MENUSEPARATOR_I(_menuname) \
+ menuitems_i18n[no_menuitems_i18n].menuname = _menuname; \
+ menuitems_i18n[no_menuitems_i18n].shortname = NULL; \
+ menuitems_i18n[no_menuitems_i18n].key = 0; \
+ menuitems_i18n[no_menuitems_i18n].type = MENU_SEPARATOR; \
+ menuitems_i18n[no_menuitems_i18n].flags = 0; \
+ menuitems_i18n[no_menuitems_i18n].iparam = 0; \
+ menuitems_i18n[no_menuitems_i18n].name = ""; \
+ menuitems_i18n[no_menuitems_i18n].pparam = NULL; \
+ menuitems_i18n[no_menuitems_i18n].function = NULL; \
+ ++no_menuitems_i18n;
+
+#define SUBMENUNOOPT_I(_menuname,_key,_name,_param) \
+ menuitems_i18n[no_menuitems_i18n].menuname = _menuname; \
+ menuitems_i18n[no_menuitems_i18n].shortname = _param; \
+ menuitems_i18n[no_menuitems_i18n].key = _key; \
+ menuitems_i18n[no_menuitems_i18n].type = MENU_SUBMENU; \
+ menuitems_i18n[no_menuitems_i18n].flags = MENUFLAG_NOOPTION; \
+ menuitems_i18n[no_menuitems_i18n].iparam = 0; \
+ menuitems_i18n[no_menuitems_i18n].name = _name; \
+ menuitems_i18n[no_menuitems_i18n].pparam = NULL; \
+ menuitems_i18n[no_menuitems_i18n].function = NULL; \
+ ++no_menuitems_i18n;
+
+#define MENUSTRING_I(_menuname,_key,_name,_shortname,_flags,_function,_param) \
+ menuitems_i18n[no_menuitems_i18n].menuname = _menuname; \
+ menuitems_i18n[no_menuitems_i18n].shortname = _shortname; \
+ menuitems_i18n[no_menuitems_i18n].key = _key; \
+ menuitems_i18n[no_menuitems_i18n].type = MENU_STRING; \
+ menuitems_i18n[no_menuitems_i18n].flags = _flags; \
+ menuitems_i18n[no_menuitems_i18n].iparam = 0; \
+ menuitems_i18n[no_menuitems_i18n].name = _name; \
+ menuitems_i18n[no_menuitems_i18n].pparam = _param; \
+ menuitems_i18n[no_menuitems_i18n].function = (void (*)(void))_function; \
+ ++no_menuitems_i18n;
+
+/* End of i18n definitions. */
+
+
+#define MENUFLAG_CHECKBOX 1
+#define MENUFLAG_RADIO 2
+#define MENUFLAG_INTERRUPT 4
+#define MENUFLAG_INCALC 8
+#define MENUFLAG_NOMENU 16
+#define MENUFLAG_NOOPTION 32
+#define MENUFLAG_NOPLAY 64
+#define MENUFLAG_ATSTARTUP 128
+#define MENUFLAG_DIALOGATDISABLE 256
+
+#define NITEMS(n) (sizeof(n)/sizeof(menuitem))
+#define menu_getdialog(context, m) \
+ ((m)->type==MENU_DIALOG?(CONST menudialog *)(m)->pparam:(m)->dialog(context))
+
+ void menu_add(CONST menuitem * item, int n);
+ void menu_insert(CONST menuitem * item, CONST char *before, int n);
+ CONST menuitem *menu_findkey(CONST char *key, CONST char *root);
+ CONST menuitem *menu_findcommand(CONST char *name);
+ CONST char *menu_fullname(CONST char *menu);
+ CONST menuitem *menu_item(CONST char *menu, int n);
+ void menu_delete(CONST menuitem * items, int n);
+ int menu_enabled(CONST menuitem * item, struct uih_context *c);
+ void menu_activate(CONST menuitem * item, struct uih_context *c,
+ dialogparam * d);
+ CONST menuitem *menu_genernumbered(int n, CONST char *menuname,
+ CONST char *CONST * CONST names,
+ CONST char *keys, int type,
+ int flags,
+ void (*fint) (struct uih_context *
+ context, int),
+ int (*cint) (struct uih_context *
+ context, int),
+ CONST char *prefix);
+ void menu_delnumbered(int n, CONST char *name);
+ void menu_addqueue(CONST menuitem * item, dialogparam * d);
+ CONST menuitem *menu_delqueue(dialogparam ** d);
+ void menu_destroydialog(CONST menuitem * item, dialogparam * d,
+ struct uih_context *uih);
+ int menu_havedialog(CONST menuitem * item, struct uih_context *c);
+ int menu_available(CONST menuitem * item, CONST char *root);
+ CONST char *menu_processcommand(struct uih_context *uih, tokenfunc f,
+ int scheme, int mask,
+ CONST char *root);
+ void menu_printhelp(void);
+
+ number_t menu_getfloat(CONST char *s, CONST char **error);
+ CONST char *menu_fillparam(struct uih_context *uih, tokenfunc f,
+ CONST menudialog * d, dialogparam * p);
+ int menu_processargs(int n, int argc, char **argv);
+ void uih_xshlprintmenu(struct uih_context *c, CONST char *name);
+ void uih_xshlprintmenus(struct uih_context *c);
+ void menu_forall(struct uih_context *c,
+ void (*callback) (struct uih_context * c,
+ CONST menuitem * item));
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/include/xshl.h b/src/include/xshl.h
new file mode 100644
index 0000000..05631f8
--- /dev/null
+++ b/src/include/xshl.h
@@ -0,0 +1,50 @@
+#ifndef XSHL_H
+#define XSHL_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define XSHL_BIG 1
+#define XSHL_EMPH 2
+#define XSHL_WHITE 4
+#define XSHL_RED 8
+#define XSHL_BLACK 16
+#define XSHL_COLORMASK (XSHL_BLACK|XSHL_RED|XSHL_WHITE)
+#define XSHL_RIGHTALIGN 32
+#define XSHL_CENTERALIGN 64
+#define XSHL_MONOSPACE 128
+#define XSHL_LINK 256
+ struct xshl_context {
+ int flags;
+ char *linktext;
+ };
+ struct xshl_item {
+ struct xshl_context c;
+ char *text;
+ int x;
+ int width;
+ struct xshl_item *next;
+ };
+ struct xshl_line {
+ int y;
+ struct xshl_item *first;
+ };
+ extern char *xshl_error;
+ struct xshl_line *xshl_interpret(void *userdata, int (*get) (void *),
+ int width, int getwidth(void *,
+ int flags,
+ CONST char
+ *text),
+ int startflags, int smallheight,
+ int bigheight);
+ void xshl_free(struct xshl_line *);
+ int xshl_textlen(void *data, int flags, CONST char *text);
+ void xshl_print(int startskip, struct xshl_line *lines);
+ struct xshl_line *help_make(CONST char *command,
+ int getwidth(void *, int flags,
+ CONST char *text), int width,
+ int smallheight, int bigheight);
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/include/xthread.h b/src/include/xthread.h
new file mode 100644
index 0000000..01f210c
--- /dev/null
+++ b/src/include/xthread.h
@@ -0,0 +1,208 @@
+/*
+ * An XaoS thread API implementation
+ * Many functions are implemented as macros that maps simple
+ * XaoS thread API into architecture depended API.
+ * I tried avoid functions because of speed issues
+ * So this header will be quite messy soon :)
+ *
+ * Supported API for now:
+ * pthread (POSIX) enabled using USE_PTHREAD
+ * nothread (my own) enabled by default
+ */
+#ifndef THREAD_H
+#define THREAD_H 1
+#include <fconfig.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define MAXTHREADS 32
+ /*You might increase this constant if needed
+ (xaos on connection machine? :) */
+
+#define NSEMAPHORS 2
+#define MAXSEMAPHORS 2
+#define NSLEEPS 2
+#define MAXCONDS 2
+
+#ifdef USE_PTHREAD
+#include <pthread.h>
+#endif
+#ifdef __BEOS__
+#include <OS.h>
+#endif
+
+ struct taskinfo {
+ int n;
+#ifdef USE_PTHREAD
+ pthread_t id;
+#endif
+#ifdef _plan9_
+ int id;
+#endif
+#ifdef __BEOS__
+ thread_id id;
+#endif
+ };
+
+ extern struct taskinfo definfo;
+ extern int ethreads; /*Is threading enabled? */
+ extern int nthreads; /*Number of threads */
+ typedef void (*xfunction) (void *, struct taskinfo *, int, int);
+
+/*No-thread API implementation version */
+#define nothread { }
+#define nothread_init(nthreads) nothread
+#define nothread_uninit() nothread
+#define nothread_function(f,data,range) f(data,&definfo,0,range)
+#define nothread_bgjob(f,d) f(d,&definfo,0,0)
+#define nothread_lock(n) nothread
+#define nothread_unlock(n) nothread
+#define nothread_sync() nothread
+#define nothread_sleep(n,l) nothread
+#define nothread_wakeup(n) nothread
+#define nothread_wakefirst(n) nothread
+
+#define xth_wrap(f1,f2) if(nthreads!=1) f1(); else f2();
+
+#ifdef USE_PTHREAD
+/* A posix thread API maps */
+ void pth_init(int nthreads);
+ void pth_uninit(void);
+ void pth_function(xfunction f, void *d, int r);
+ void pth_synchronize(void);
+ void pth_bgjob(xfunction f, void *d);
+ extern pthread_mutex_t semaphors[MAXSEMAPHORS];
+ extern pthread_cond_t conds[MAXCONDS];
+
+/*Map pthread API to XaoS thread API */
+
+#define xth_init(nthreads) pth_init(nthreads)
+#define xth_uninit() pth_uninit()
+#define xth_lock(n) if(ethreads) pthread_mutex_lock(semaphors+(n))
+#define xth_unlock(n) if(ethreads) pthread_mutex_unlock(semaphors+(n))
+#define xth_function(f,d,r) if(ethreads) pth_function(f,d,r); else nothread_function(f,d,r)
+#define xth_nthread(ts) (ethreads?ts->n:0)
+#define xth_sync() if(ethreads) pth_synchronize();
+#define xth_bgjob(f,d) if(ethreads) pth_bgjob(f,d); else f(d,&definfo,0,0);
+#define xth_sleep(n,l) if(ethreads) pthread_cond_wait(conds+(n),semaphors+(l))
+#define xth_wakeup(n) if(ethreads) pthread_cond_broadcast(conds+(n))
+#define xth_wakefirst(n) if(ethreads) pthread_cond_signal(conds+(n))
+#define API_MAPPED
+#endif /*USE_PTHREAD */
+
+#ifdef _plan9_
+
+ struct Stack {
+ int nwaiting;
+ int tags[MAXTHREADS];
+ };
+#ifdef _plan9v2_
+#include <lock.h> /* in plan9v3 part of libc */
+#endif
+/* A plan9 thread API maps */
+ void p9wait(struct Stack *s, Lock * l);
+ void p9wakeup(struct Stack *s);
+ void p9wakeall(struct Stack *s);
+ void p9init(int nthreads);
+ void p9uninit(void);
+ void p9function(xfunction f, void *d, int r);
+ void p9synchronize(void);
+ void p9bgjob(xfunction f, void *d);
+ extern Lock semaphors[MAXSEMAPHORS];
+ extern struct Stack conds[MAXCONDS];
+
+/*Map pthread API to XaoS thread API */
+
+#define xth_init(nthreads) p9init(nthreads)
+#define xth_uninit() p9uninit()
+#define xth_lock(n) if(ethreads) lock(semaphors+(n))
+#define xth_unlock(n) if(ethreads) unlock(semaphors+(n))
+#define xth_function(f,d,r) if(ethreads) p9function(f,d,r); else nothread_function(f,d,r)
+#define xth_nthread(ts) (ethreads?ts->n:0)
+#define xth_sync() if(ethreads) p9synchronize();
+#define xth_bgjob(f,d) if(ethreads) p9bgjob(f,d); else f(d,&definfo,0,0);
+#define xth_sleep(n,l) if(ethreads) p9wait(conds+(n), semaphors+(l))
+#define xth_wakeup(n) if(ethreads) p9wakeall(conds+(n))
+#define xth_wakefirst(n) if(ethreads) p9wakeup(conds+(n))
+#define API_MAPPED
+#endif /*USE_PTHREAD */
+
+#ifdef __BEOS__
+ typedef struct {
+ int32 cnt;
+ sem_id sem;
+ } benaphore;
+
+ void acquire_benaphore(benaphore * p);
+ void release_benaphore(benaphore * p);
+#ifdef __GNUC__
+ extern
+#endif
+ inline void acquire_benaphore(benaphore * p) {
+ if (atomic_add(&(p->cnt), 1) >= 1) {
+ /* Someone was faster. */
+ while (acquire_sem(p->sem) == B_INTERRUPTED);
+ }
+ }
+#ifdef __GNUC__
+ extern
+#endif
+ inline void release_benaphore(benaphore * p) {
+ if (atomic_add(&(p->cnt), -1) > 1) {
+ /* Someone was slower. */
+ release_sem(p->sem);
+ }
+ }
+
+ extern benaphore mutexes[MAXSEMAPHORS];
+ extern benaphore condvars[MAXCONDS];
+
+ void be_thread_init(int num_threads);
+ void be_thread_uninit(void);
+ void be_thread_function(xfunction f, void *d, int r);
+ void be_thread_synchronize(void);
+ void be_thread_bgjob(xfunction f, void *d);
+ void be_thread_sleep(benaphore * pCondition, benaphore * pMutex);
+ void be_thread_wakeup(benaphore * pCondition);
+ void be_thread_wakefirst(benaphore * pCondition);
+
+/* Map BeOS API to XaoS thread API. */
+
+#define xth_init(nthreads) be_thread_init(nthreads)
+#define xth_uninit() be_thread_uninit()
+#define xth_function(f,d,r) if(ethreads) be_thread_function(f,d,r); else nothread_function(f,d,r)
+#define xth_nthread(ts) (ethreads?ts->n:0)
+#define xth_sync() if(ethreads) be_thread_synchronize();
+#define xth_bgjob(f,d) if(ethreads) be_thread_bgjob(f,d); else f(d,&definfo,0,0);
+#define xth_lock(n) if(ethreads) acquire_benaphore(mutexes+(n))
+#define xth_unlock(n) if(ethreads) release_benaphore(mutexes+(n))
+#define xth_sleep(n,l) if(ethreads) be_thread_sleep(condvars+(n),mutexes+(l))
+#define xth_wakeup(n) if(ethreads) be_thread_wakeup(condvars+(n))
+#define xth_wakefirst(n) if(ethreads) be_thread_wakefirst(condvars+(n))
+#define API_MAPPED
+#endif /* __BEOS__ */
+
+#ifndef API_MAPPED
+/*
+ * No thread support is compiled - do just wrappers
+ * to nothread implementation
+ */
+#define nthreads 1
+#define ethreads 0
+#define xth_init(n) nothread_init(n)
+#define xth_uninit() nothread_uninit()
+#define xth_function(f,d,r) nothread_function(f,d,r)
+#define xth_lock(n) nothread_lock(n)
+#define xth_unlock(n) nothread_unlock(n)
+#define xth_sync() nothread_sync()
+#define xth_bgjob(f,d) nothread_bgjob(f,d)
+#define xth_nthread(ts) 0
+#define xth_wakeup(n) nothreads_wakeup(n)
+#define xth_wakefirst(n) nothreads_wakefirst(n)
+#define xth_sleep(n,l) nothreads_sleep(n,l)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/include/zoom.h b/src/include/zoom.h
new file mode 100644
index 0000000..f42eecd
--- /dev/null
+++ b/src/include/zoom.h
@@ -0,0 +1,40 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifndef ZOOM_H
+#define ZOOM_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define LOWQUALITY (1<<30)
+#define ZOOMMASK (LOWQUALITY|UNCOMPLETTE)
+
+ extern CONST struct filteraction zoom_filter;
+ extern struct filter cfilter;
+ extern CONST struct filteraction subwindow_filter;
+ void subwindow_setsecond(struct filter *f, struct filter *f1);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ZOOM_H */
diff --git a/src/sffe/About b/src/sffe/About
new file mode 100644
index 0000000..bea0456
--- /dev/null
+++ b/src/sffe/About
@@ -0,0 +1,4 @@
+SFFE ( Segfautlabs Formula Evaluator )
+sffe is very fast complex math formula evaluator written in C.
+you can read more about sffe lib at
+ http://www.segfaultlabs.com/projects/sffe
diff --git a/src/sffe/Makefile.in b/src/sffe/Makefile.in
new file mode 100644
index 0000000..6d1f565
--- /dev/null
+++ b/src/sffe/Makefile.in
@@ -0,0 +1,36 @@
+CC = @CC@
+CFLAGS = @CFLAGS@
+LIBS = @LIBS@
+LFLAGS = @LDFLAGS@
+AR = @AR@
+RANLIB = @RANLIB@
+
+SRCS = sffe.c \
+ sffe_cmplx_asm.c \
+ sffe_cmplx_gsl.c
+
+OBJS = $(SRCS:.c=.o) @ASM_CMPLX_O@
+
+TLIB = ../lib/libsffe.a
+
+all: $(TLIB)
+
+asm/cmplx.o: asm/cmplx.asm
+ nasm -f @CMPLX_O_TARGET@ asm/cmplx.asm -oasm/cmplx.o
+
+$(TLIB):$(OBJS)
+ rm -f $@
+ $(AR) rc $@ $(OBJS) @ASM_CMPLX_O@
+ $(RANLIB) $@
+
+keywords.c: keywords.gperf
+ gperf -t -p -D -C -a keywords.gperf > keywords.c
+
+clean:
+ rm -f $(TLIB)
+ rm -f *.[oas] asm/*.o
+ rm -f *~
+ rm -f core
+
+distclean:clean
+ rm Makefile
diff --git a/src/sffe/asm/build.sh b/src/sffe/asm/build.sh
new file mode 100644
index 0000000..9c0f362
--- /dev/null
+++ b/src/sffe/asm/build.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+nasm -f elf cmplx.asm -ocmplx.o
+# Not used anymore because ../Makefile already contains this compilation.
diff --git a/src/sffe/asm/build_win.sh b/src/sffe/asm/build_win.sh
new file mode 100644
index 0000000..8f1214b
--- /dev/null
+++ b/src/sffe/asm/build_win.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+nasm -f coff cmplx.asm -ocmplx.o
+# Not used anymore because ../Makefile already contains this compilation.
diff --git a/src/sffe/asm/cmplx.asm b/src/sffe/asm/cmplx.asm
new file mode 100644
index 0000000..ea3826b
--- /dev/null
+++ b/src/sffe/asm/cmplx.asm
@@ -0,0 +1,901 @@
+ ; COMPLEX NUMBER ARITHMETICS
+ ; Mateusz Malczak
+ ; NASM version
+ ; http://www.malczak.info
+ ; SFFE libs
+ ; http://segfaultlabs.com/projects/sffe
+ global _sffecabs,_sffecarg,_sffecargs,_sffecargc
+ global _sffecinv
+ global _sffecexp,_sffecln,_sffeclog2,_sffeclog
+ global _sffecsin,_sffeccos,_sffecsincos,_sffectan,_sffeccot
+ global _sffecsinh,_sffeccosh,_sffectanh,_sffeccoth
+ global _sffeccpow, _sffecpowd, _sffecpowi, _sffecpowc
+ global _sffecsqrt, _sffecrtni
+
+ %ifndef DELPHI
+ ; section .text use32 class=CODE ;class=CODE - needed for Borlands Compiler
+
+ ; section CODE use32
+ ; ".text" is more portable than "CODE use32":
+ section .text
+ %endif
+
+ ;; internal use
+%ifdef DELPHI
+[section expfunc_text use32]
+%endif
+_sffecexpfnc: ; exponent of real argument
+ fldl2e
+ fmulp st1
+ fld st0
+ frndint
+ fsub to st1
+ fld1
+ fscale
+ fstp st1
+ fxch st1
+ f2xm1
+ fld1
+ faddp st1
+ fmulp st1
+ ret
+
+ ;; globals
+%ifdef DELPHI
+[section cabs_text use32]
+%endif
+_sffecabs:
+ push ebp
+ mov ebp, esp
+ fld qword [ebp+08h]
+ fmul qword [ebp+08h]
+ fld qword [ebp+10h]
+ fmul qword [ebp+10h]
+ faddp st1
+ fsqrt
+ leave
+ ret
+
+%ifdef DELPHI
+[section carg_text use32]
+%endif
+_sffecarg:
+ push ebp
+ mov ebp, esp
+ fld qword [ebp+08h]
+ fld qword [ebp+10h]
+ fpatan
+ wait
+ leave
+ ret
+
+%ifdef DELPHI
+[section cargs_text use32]
+%endif
+_sffecargs:
+ push ebp
+ mov ebp, esp
+ fld qword [ebp+10h]
+ fld qword [ebp+08h]
+ fmul qword [ebp+08h]
+ fld qword [ebp+10h]
+ fmul qword [ebp+10h]
+ faddp st1
+ fsqrt
+ fdivp st1
+ wait
+ leave
+ ret
+
+%ifdef DELPHI
+[section cargc_text use32]
+%endif
+_sffecargc:
+ push ebp
+ mov ebp, esp
+ fld qword [ebp+08h]
+ fld qword [ebp+08h]
+ fmul qword [ebp+08h]
+ fld qword [ebp+10h]
+ fmul qword [ebp+10h]
+ faddp st1
+ fsqrt
+ fdivp st1
+ wait
+ leave
+ ret
+
+%ifdef DELPHI
+[section cinv_text use32]
+%endif
+_sffecinv:
+ push ebp
+ mov ebp, esp
+ mov edx, [ebp+08h]
+ fld qword [ebp+0ch]
+ fld qword [ebp+14h]
+ fld st0
+ fmul to st0
+ fld st2
+ fmul to st0
+ faddp st1
+ fdiv to st1
+ fdiv to st2
+ fstp st0
+ fchs
+ fstp qword [edx+08h]
+ fstp qword [edx]
+ wait
+ leave
+ ret
+
+%ifdef DELPHI
+[section cexp_text use32]
+%endif
+_sffecexp:
+ push ebp
+ mov ebp,esp
+ mov eax, [ebp+08h]
+ fld qword [ebp+0ch]
+ call _sffecexpfnc
+ fld qword [ebp+14h]
+ fsincos
+ fld st2
+ fmulp st1
+ fstp qword [eax]
+ fmulp st1
+ fstp qword [eax+08h]
+ wait
+ leave
+ ret
+
+%ifdef DELPHI
+[section cln_text use32]
+%endif
+_sffecln:
+ push ebp
+ mov ebp,esp
+ mov eax, [ebp+08h]
+ ;theta
+ fld qword [ebp+14h]
+ fld qword [ebp+0ch]
+ fpatan
+ ;z module
+ fld qword [ebp+0ch]
+ fmul qword [ebp+0ch]
+ fld qword [ebp+14h]
+ fmul qword [ebp+14h]
+ faddp st1
+ fsqrt
+ ;ln||z||
+ fld1
+ fxch st1
+ fyl2x
+ fldl2e
+ fdivp st1
+ fstp qword [eax]
+ fstp qword [eax+08h]
+ wait
+ leave
+ ret
+
+%ifdef DELPHI
+[section clog2_text use32]
+%endif
+_sffeclog2:
+ push ebp
+ mov ebp,esp
+ mov eax, [ebp+08h]
+ fld1
+ ;z module
+ fld qword [ebp+0ch]
+ fmul qword [ebp+0ch]
+ fld qword [ebp+14h]
+ fmul qword [ebp+14h]
+ faddp st1
+ fsqrt
+ fyl2x
+ ;theta
+ fld qword [ebp+14h]
+ fld qword [ebp+0ch]
+ fpatan
+ fldln2
+ fdivp st1
+ fstp qword [eax+08h]
+ fstp qword [eax]
+ wait
+ leave
+ ret
+
+%ifdef DELPHI
+[section clog_text use32]
+%endif
+_sffeclog:
+ push ebp
+ mov ebp,esp
+ mov eax, [ebp+08h]
+ ;ln(base)
+ fld1
+ fild word [ebp+1ch]
+ fyl2x
+ fldl2e
+ fdivp st1
+ ;z module
+ fld qword [ebp+0ch]
+ fmul qword [ebp+0ch]
+ fld qword [ebp+14h]
+ fmul qword [ebp+14h]
+ faddp st1
+ fsqrt
+ ;ln||z||
+ fld1
+ fxch st1
+ fyl2x
+ fldl2e
+ fdivp st1
+ fdiv st1
+ ;theta
+ fld qword [ebp+14h]
+ fld qword [ebp+0ch]
+ fpatan
+ fdiv st2
+ fstp qword [eax+08h]
+ fstp qword [eax]
+ fstp st0
+ wait
+ leave
+ ret
+
+%ifdef DELPHI
+[section csin_text use32]
+%endif
+_sffecsin:
+ push ebp
+ mov ebp, esp
+ mov eax, [ebp+08h]
+ fld1
+ fld1
+ faddp st1
+ fld qword [ebp+14h]
+ call _sffecexpfnc
+ fld1
+ fdiv st1
+ fld st1;-
+ fld st1;- optimize
+ faddp st1;-
+ fdiv st3
+ fxch st2
+ fxch st1
+ fsubp st1
+ fdiv st2
+ fld qword [ebp+0ch]
+ fsincos
+ fxch st3
+ fmulp st1
+ fstp qword [eax]
+ fmulp st1
+ fstp qword [eax+08h]
+ fstp st0
+ fwait
+ leave
+ ret
+
+%ifdef DELPHI
+[section ccos_text use32]
+%endif
+_sffeccos:
+ push ebp
+ mov ebp,esp
+ mov eax, [ebp+08h]
+ fld1
+ fld1
+ faddp st1
+ fld qword [ebp+14h]
+ call _sffecexpfnc
+ fld1
+ fdiv st1
+ fld st1
+ fld st1
+ faddp st1
+ fdiv st3
+ fxch st2
+ fxch st1
+ fsubp st1
+ fdiv st2
+ fld qword [ebp+0ch]
+ fsincos
+ fxch st2
+ fmulp st1
+ fchs
+ fstp qword [eax+08h]
+ fmulp st1
+ fstp qword [eax]
+ fstp st0
+ fwait
+ leave
+ ret
+
+%ifdef DELPHI
+[section ctan_text use32]
+%endif
+_sffectan:
+ push ebp
+ mov ebp,esp
+ mov eax, [ebp+08h]
+ ;sinh(2b) cosh(2b)
+ fld1
+ fld1
+ faddp st1
+ fld qword [ebp+14h]
+ fadd qword [ebp+14h]
+ call _sffecexpfnc
+ fld1
+ fdiv st1
+ fld st1
+ fld st1
+ faddp st1
+ fdiv st3
+ fxch st2
+ fxch st1
+ fsubp st1
+ fdivrp st2 ;fdivrp st(2),st(0)
+ ;sin(2b) cos(2b)
+ fld qword [ebp+0ch]
+ fadd qword [ebp+0ch]
+ fsincos
+ faddp st2
+ ;check if zero
+ fdiv st1
+ fstp qword [eax]
+ fdivp st1
+ fstp qword [eax+08h]
+ fwait
+ leave
+ ret
+
+%ifdef DELPHI
+[section ccot_text use32]
+%endif
+_sffeccot:
+ push ebp
+ mov ebp,esp
+ mov eax, [ebp+08h]
+ ;sinh(2b) cosh(2b)
+ fld1
+ fld1
+ faddp st1
+ fld qword [ebp+14h]
+ fadd qword [ebp+14h]
+ call _sffecexpfnc
+ fld1
+ fdiv st1
+ fld st1
+ fld st1
+ fsubp st1
+ fdiv st3
+ fxch st2
+ fxch st1
+ faddp st1
+ fdivrp st2 ;fdivrp st(2),st(0)
+ ;sin(2b) cos(2b)
+ fld qword [ebp+0ch]
+ fld st0
+ faddp st1
+ fsincos
+ fsubp st3
+ ;check if zero
+ fdiv st2
+ fstp qword [eax]
+ fdiv st1
+ fchs
+ fstp qword [eax+08h]
+ fstp st0
+ fwait
+ leave
+ ret
+
+%ifdef DELPHI
+[section csinh_text use32]
+%endif
+_sffecsinh:
+ push ebp
+ mov ebp,esp
+ mov eax, [ebp+08h]
+ fld1
+ fld1
+ faddp st1
+ fld qword [ebp+0Ch]
+ call _sffecexpfnc
+ fld1
+ fdiv st1
+ fld st1
+ fld st1
+ faddp st1
+ fdiv st3
+ fxch st2
+ fxch st1
+ fsubp st1
+ fdivrp st2 ;jak w tan i cot
+ fld qword [ebp+14h]
+ fsincos
+ fxch st2
+ fmulp st1
+ fstp qword [eax+08h]
+ fmulp st1
+ fstp qword [eax]
+ fwait
+ leave
+ ret
+
+%ifdef DELPHI
+[section ccosh_text use32]
+%endif
+_sffeccosh:
+ push ebp
+ mov ebp,esp
+ mov eax, [ebp+08h]
+ fld qword [ebp+0ch]
+ call _sffecexpfnc
+ fld st0
+ fld1
+ fxch st1
+ fdivp st1
+ fld st1
+ fld st1
+ faddp st1
+ fld1
+ fld1
+ faddp st1
+ fdivp st1
+ fxch st2
+ fxch st1
+ fsubp st1
+ fld1
+ fld1
+ faddp st1
+ fdivp st1
+ fld qword [ebp+14h]
+ fsincos
+ fxch st2
+ fmulp st1
+ fstp qword [eax+08h]
+ fmulp st1
+ fstp qword [eax]
+ fwait
+ leave
+ ret
+
+%ifdef DELPHI
+[section ctanh_text use32]
+%endif
+_sffectanh:
+ push ebp
+ mov ebp,esp
+ mov eax, [ebp+08h]
+ ;sinh(2a) cosh(2a)
+ fld1
+ fld1
+ faddp st1
+ fld qword [ebp+0ch]
+ fadd qword [ebp+0ch]
+ call _sffecexpfnc
+ fld1
+ fdiv st1
+ fld st1
+ fld st1
+ fsubp st1
+ fdiv st3
+ fxch st2
+ fxch st1
+ faddp st1
+ fdivrp st2 ;jak wczesniej
+ ;sin(2b) cos(2b)
+ fld qword [ebp+14h]
+ fadd qword [ebp+14h]
+ fsincos
+ faddp st3
+ ;check if zero
+ fdiv st2
+ fstp qword [eax+08h]
+ fxch st1
+ fdivp st1
+ fstp qword [eax]
+ fwait
+ leave
+ ret
+
+%ifdef DELPHI
+[section ccoth_text use32]
+%endif
+_sffeccoth:
+ push ebp
+ mov ebp,esp
+ mov eax, [ebp+08h]
+ ;sinh(2b) cosh(2b)
+ fld1
+ fld1
+ faddp st1
+ fld qword [ebp+0ch]
+ fadd qword [ebp+0ch]
+ call _sffecexpfnc
+ fld1
+ fdiv st1
+ fld st1
+ fld st1
+ fsubp st1
+ fdiv st3
+ fxch st2
+ fxch st1
+ faddp st1
+ fdivrp st2 ;jak wczesniej
+ ;sin(2b) cos(2b)
+ fld qword [ebp+14h]
+ fadd qword [ebp+14h]
+ fsincos
+ fsubp st3
+ ;check if zero
+ fdiv st2
+ fchs
+ fstp qword [eax+08h]
+ fxch st1
+ fdivp st1
+ fstp qword [eax]
+ fwait
+ leave
+ ret
+
+;***************** COMPLEX TO COMPLEX POWER
+%ifdef DELPHI
+[section ccpow_text use32]
+%endif
+_sffeccpow:
+;TODO: wyeliminowac xch po wystepujace po obliczeniu theta
+ push ebp
+ mov ebp,esp
+ fld1
+ ;z module
+ fld qword [ebp+0ch]
+ fmul qword [ebp+0ch]
+ fld qword [ebp+14h]
+ fmul qword [ebp+14h]
+ faddp st1
+ fsqrt
+ ftst
+ fstsw ax
+ test ah, 1000000b
+ jnz MZ
+ mov eax, [ebp+08h]
+ ;ln||z||*/
+ fyl2x
+ fldl2e
+ fdivp st1
+ ;theta*/
+ fld qword [ebp+14h]
+ fld qword [ebp+0ch]
+ fpatan
+
+ fld st1 ;ln||z||
+ fmul qword [ebp+1ch]
+ fld st1 ;theta
+ fmul qword [ebp+24h]
+ fsubp st1 ; st0-st1
+ fxch st2 ; w st2 mam teraz a = z2.re * lnz - z2.im * theta w st0 jest ln||z||
+ fmul qword [ebp+24h]
+ fxch st1
+ fmul qword [ebp+1ch]
+ faddp st1
+ fxch st1
+
+ call _sffecexpfnc
+ fxch st1
+ fsincos
+ fld st2
+ fmulp st1
+ fstp qword [eax]
+ fmulp st1
+ fstp qword [eax+08h]
+ jmp END
+MZ:
+ mov eax, [ebp+08h]
+ fstp qword [eax+08h]
+ fldz
+ fstp qword [eax]
+ fstp st0
+END:
+s fwait
+ leave
+ ret
+
+;***************** COMPLEX TO REAL POWER
+%ifdef DELPHI
+[section cpowd_text use32]
+%endif
+_sffecpowd:
+ push ebp
+ mov ebp,esp
+; fld1
+ ;z module
+ fld qword [ebp+0ch]
+ fmul qword [ebp+0ch]
+ fld qword [ebp+14h]
+ fmul qword [ebp+14h]
+ faddp st1
+ fsqrt
+ ftst
+ fstsw ax
+ test ah, 1000000b
+ jnz MZ2
+ mov eax, [ebp+08h]
+ fld1
+ ;theta
+ fld qword [ebp+14h]
+ fld qword [ebp+0ch]
+ fpatan
+ fmul qword [ebp+1ch]
+ fxch st2
+ ;ln||z||
+ fyl2x
+ fldl2e
+ fdivp st1
+ fmul qword [ebp+1ch]
+
+ call _sffecexpfnc
+ fxch st1
+ fsincos
+ fld st2
+ fmulp st1
+ fstp qword [eax]
+ fmulp st1
+ fstp qword [eax+08h]
+ jmp END2
+MZ2:
+ mov eax, [ebp+08h]
+ fstp qword [eax+08h]
+ fldz
+ fstp qword [eax]
+END2:
+ fwait
+ leave
+ ret
+
+;***************** COMPLEX TO INT POWER
+%ifdef DELPHI
+[section cpowi_text use32]
+%endif
+_sffecpowi:
+ push ebp
+ mov ebp,esp
+ ;z module
+ fild dword [ebp+1ch] ;st(0)=n
+ fld qword [ebp+0ch]
+ fmul qword [ebp+0ch]
+ fld qword [ebp+14h]
+ fmul qword [ebp+14h]
+ faddp st1
+ fsqrt
+ ftst
+ fstsw ax
+ test ah, 1000000b
+ jnz MZ5
+ mov eax, [ebp+08h]
+ ;||z||^n
+ fld1
+ fxch st1
+ fyl2x
+ fmulp st1
+ fld st0
+ frndint
+ fsub to st1
+ fld1
+ fscale
+ fstp st1
+ fxch st1
+ f2xm1
+ fld1
+ faddp st1
+ fmulp st1
+ ;theta
+ fld qword [ebp+14h]
+ fld qword [ebp+0ch]
+ fpatan
+ fild dword [ebp+1ch]
+ fmulp st1
+ fsincos
+ fld st2
+ fmulp st1
+ fstp qword [eax]
+ fmulp st1
+ fstp qword [eax+08h]
+ jmp END53
+MZ5:
+ mov eax, [ebp+08h]
+ fstp qword [eax+08h]
+ fldz
+ fstp qword [eax]
+ fstp st0
+END53:
+ fwait
+ leave
+ ret
+
+;***************** INT/DOUBLE TO COMPLEX POWER
+%ifdef DELPHI
+[section cpowc_text use32]
+%endif
+_sffecpowc:
+ push ebp
+ mov ebp,esp
+ fld qword [ebp+0ch]
+ ftst
+ fstsw ax
+ test ah, 1000000b
+ jnz MZ3
+ mov eax, [ebp+08h]
+ ;n^a
+ fld qword [ebp+14h]
+ fxch st1
+ fabs
+ fld1
+ fxch st1
+ fyl2x
+ fmulp st1
+ fld st0
+ frndint
+ fsub to st1
+ fld1
+ fscale
+ fstp st1
+ fxch st1
+ f2xm1
+ fld1
+ faddp st1
+ fmulp st1
+ ;ln||n||
+ fld qword [ebp+0ch]
+ fabs
+ fld1
+ fxch st1
+ fyl2x
+ fldl2e
+ fdivp st1
+ fld qword [ebp+1ch]
+ fmulp st1
+ fsincos
+ fld st2
+ fmulp st1
+ fstp qword [eax]
+ fmulp st1
+ fstp qword [eax+08h]
+ jmp END3
+MZ3:
+ mov eax, [ebp+08h]
+ fstp qword [eax+08h]
+ fldz
+ fstp qword [eax]
+END3:
+ fwait
+ leave
+ ret
+
+;***************** SQRT
+%ifdef DELPHI
+[section csqrt_text use32]
+%endif
+_sffecsqrt:
+ push ebp
+ mov ebp,esp
+ push ebx
+ mov ebx, [ebp+08h]
+ ;z module
+ fld qword [ebp+0ch]
+ fmul qword [ebp+0ch]
+ fld qword [ebp+14h]
+ fmul qword [ebp+14h]
+ faddp st1
+ fsqrt
+ fld st0 ;duplicate |z|
+ ;real
+ fadd qword [ebp+0ch]
+ fld1
+ fld1
+ faddp st1
+ fdivp st1
+ fsqrt
+ fstp qword [ebx]
+ fwait
+ ;imag
+ fsub qword [ebp+0ch]
+ fld1
+ fld1
+ faddp st1
+ fdivp st1
+ fsqrt
+ ;imag sign check
+ push eax
+ fld qword [ebp+14h]
+ ftst
+ fstp st0
+ fstsw ax
+ test ah, 1b
+ jz IMAGPOS
+ fchs
+IMAGPOS:
+ pop eax
+ fwait
+ fstp qword [ebx+08h]
+ pop ebx
+ leave
+ ret
+
+;***************** Nth ORDER ROOT
+%ifdef DELPHI
+[section crtni_text use32]
+%endif
+_sffecrtni:
+ push ebp
+ mov ebp,esp
+ ;z module
+ fld qword [ebp+0ch]
+ fmul qword [ebp+0ch]
+ fld qword [ebp+14h]
+ fmul qword [ebp+14h]
+ faddp st1
+ fsqrt
+ ftst
+ fstsw ax
+ test ah, 1000000b
+ jnz MZ4
+ mov eax, [ebp+08h]
+ ;n-th root if ||z||
+ fld1
+ fild word [ebp+1ch]
+ fdivp st1 ;st0=1/n
+ fxch st1 ;st0=||z|| st1=1/n
+ fyl2x ;log2(||z||/n)
+ fld st0 ;duplikuj st0
+ frndint
+ fsub to st1 ;st0=int( log2(||z||/n) ) st1=frac( log2(||z||/n) )
+ fld1 ;st0=1
+ fscale ;st0=2^int( log2(||z||/n) ) st1=frac( log2(||z||/n) )
+ fstp st1
+ fxch st1
+ f2xm1 ;st1=2^frac( log2(||z||/n) )-1
+ fld1
+ faddp st1
+ fmulp st1 ;sqrt(||z||)
+ ;theta
+ fld qword [ebp+14h]
+ fld qword [ebp+0ch]
+ fpatan ;st0=theta st1=sqrN(||z||)
+ ;theta_i
+ fldpi
+ fldpi
+ faddp st1 ;st0=2Pi st1=theta st2=sqrN(||z||)
+ fimul word [ebp+20h]
+ faddp st1 ;st1=theta+i2Pi
+ fidiv word [ebp+1ch] ;st0=theta_i
+ ;re/im
+ fsincos
+
+ fld st2
+ fmulp st1
+ fstp qword [eax]
+ fmulp st1
+ fstp qword [eax+08h]
+ jmp END4
+MZ4:
+ fldz
+ fstp qword [eax]
+ fstp qword [eax+08h]
+END4:
+ leave
+ ret
+
+%ifndef DELPHI
+_sffecfunc:
+ push ebp
+ mov ebp,esp
+ mov eax, [ebp+08h]
+ leave
+ ret
+%endif
diff --git a/src/sffe/sffe.c b/src/sffe/sffe.c
new file mode 100644
index 0000000..668893e
--- /dev/null
+++ b/src/sffe/sffe.c
@@ -0,0 +1,1013 @@
+/*/////////////////////////////////////////////////////////////////////////////////////
+// project : sFFe ( SegFault (or Segmentation Fault :) ) formula evalutaor )
+// author : Mateusz Malczak ( mateusz@malczak.info )
+// wpage : www.segfaultlabs.com/projects/sffe
+///////////////////////////////////////////////////////////////////////////////////////
+// special build for XaoS, for more info visit
+// http://www.segfaultlabs.com/projects/sfXaos
+/////////////////////////////////////////////////////////////////////////////////////*/
+
+#include <config.h>
+#ifdef SFFE_USING
+
+#include <stdlib.h>
+#include <stdio.h>
+#ifdef linux
+#include <ctype.h>
+#endif
+#include <string.h>
+
+#include "sffe.h"
+#ifdef SFFE_CMPLX_ASM
+#include "sffe_cmplx_asm.h"
+#elif SFFE_CMPLX_GSL
+#include "sffe_cmplx_gsl.h"
+#endif
+
+#define sfset(arg,val) {\
+ (arg)->value = (sfNumber*)malloc(sizeof(sfNumber));\
+ if ( (arg)->value ) cmplxset( *((arg)->value), (val),0 ); }
+
+#define sfvar(p,parser,idx) (p)->value = (sfNumber*)((parser)->vars+idx)
+
+/************************* custom function */
+/* all used in this section variables are defined depanding on complex number realization */
+sffunction *sffe_function(char *fn, size_t len)
+{
+ unsigned char idx;
+ for (idx = 5; idx < sffnctscount; idx += 1) /* sffnctscount - defined in sffe_cmplx_* file */
+ if (!strncmp(fn, sfcmplxfunc[idx].name, len))
+ return (sffunction *) (sfcmplxfunc + idx);
+ return NULL;
+};
+
+sffunction *sffe_operator(char op)
+{
+ switch (op) {
+ case '^':
+ return (sffunction *) sfcmplxfunc;
+ break;
+ case '+':
+ return (sffunction *) sfcmplxfunc + 1;
+ break;
+ case '-':
+ return (sffunction *) sfcmplxfunc + 2;
+ break;
+ case '*':
+ return (sffunction *) sfcmplxfunc + 3;
+ break;
+ case '/':
+ return (sffunction *) sfcmplxfunc + 4;
+ break;
+ };
+ return NULL;
+};
+
+void *sffe_const(char *fn, size_t len, void *ptr)
+{
+ unsigned char idx = 3;
+ for (idx = 0; idx < sfvarscount; idx += 1)
+ if (!strncmp(fn, sfcnames[idx], len)) {
+ sfcvals[idx] ((sfNumber *) ptr);
+ return ptr;
+ };
+ return NULL;
+};
+
+/************************* custom function */
+
+
+sffe *sffe_alloc(void)
+{
+ sffe *rp = (sffe *) malloc(sizeof(sffe));
+ if (!rp)
+ return NULL;
+ memset(rp, 0, sizeof(sffe));
+ return rp;
+};
+
+static void sffe_clear(sffe ** parser)
+{
+ sffe *p = *parser;
+ unsigned int i = 0, j;
+ for (; i < p->argCount; i++) {
+ for (j = 0; j < p->varCount; j++)
+ if (p->args[i].value == p->varPtrs[j])
+ j = p->varCount;
+ if (j == p->varCount)
+ if (p->args[i].value)
+ free(p->args[i].value);
+ };
+ if (p->expression)
+ free(p->expression);
+ if (p->args)
+ free(p->args);
+ if (p->oprs)
+ free(p->oprs);
+ p->expression = NULL;
+ p->args = NULL;
+ p->oprs = NULL;
+};
+
+void sffe_free(sffe ** parser)
+{
+ sffe_clear(parser);
+ if ((*parser)->userf)
+ free((*parser)->userf);
+ if ((*parser)->varChars)
+ free((*parser)->varChars);
+ if ((*parser)->varPtrs)
+ free((*parser)->varPtrs);
+ free(*parser);
+ parser = NULL;
+};
+
+/* not really used, marked to remove
+void sffe_eval2(sffe *const parser)
+{
+ register sfopr* optro;
+ register sfopr* optr = parser->oprs;
+ register sfopr* optrl = parser->oprs+parser->oprCount;
+ optro = optr;
+ for ( optr=optr; optr!=optrl; optr+=1, optro+=1 )
+ {
+ optro->arg->parg = optro->arg-1;
+ optr->arg->parg = optr->f( optr->arg )->parg;
+ };
+};*/
+
+sfNumber sffe_eval(sffe * const parser)
+{
+ register sfopr *optro;
+ register sfopr *optr = parser->oprs;
+ register sfopr *optrl = parser->oprs + parser->oprCount;
+ optro = optr;
+ for (optr = optr; optr != optrl; optr += 1, optro += 1) {
+ optro->arg->parg = optro->arg - 1;
+ optr->arg->parg = optr->f(optr->arg)->parg;
+ };
+ return *(parser->result);
+};
+
+void *sffe_regvar(sffe ** parser, sfNumber * vptrs, char vchars)
+{
+ unsigned int i = (*parser)->varCount;
+ (*parser)->varCount += 1;
+ (*parser)->varPtrs =
+ (sfNumber **) realloc((*parser)->varPtrs,
+ (*parser)->varCount * sizeof(sfNumber *));
+ if (!(*parser)->varPtrs)
+ return NULL;
+ (*parser)->varChars =
+ (char *) realloc((*parser)->varChars, (*parser)->varCount);
+ if (!(*parser)->varChars)
+ return NULL;
+ (*parser)->varPtrs[i] = vptrs;
+ (*parser)->varChars[i] = toupper(vchars);
+ return (void *) ((*parser)->varPtrs + i);
+};
+
+void *sffe_regvars(sffe ** parser, unsigned int cN, sfNumber ** vptrs,
+ char *vchars)
+{
+ unsigned int i = (*parser)->varCount;
+ (*parser)->varCount += cN;
+ (*parser)->varPtrs =
+ (sfNumber **) realloc((*parser)->varPtrs,
+ (*parser)->varCount * sizeof(sfNumber *));
+ if (!(*parser)->varPtrs)
+ return NULL;
+ (*parser)->varChars =
+ (char *) realloc((*parser)->varChars, (*parser)->varCount);
+ if (!(*parser)->varChars)
+ return NULL;
+ for (cN = 0; i < (*parser)->varCount; i += 1, cN += 1) {
+ (*parser)->varPtrs[i] = vptrs[cN];
+ (*parser)->varChars[i] = toupper(vchars[cN]);
+ };
+ return (void *) ((*parser)->varPtrs + i);
+};
+
+sfNumber *sffe_varptr(sffe * const parser, char vchar)
+{
+ unsigned int i = 0;
+ while (i < parser->varCount) {
+ if (parser->varChars[i] == vchar)
+ return parser->varPtrs[i];
+ i += 1;
+ };
+ return NULL;
+};
+
+sfNumber *sffe_setvar(sffe ** parser, sfNumber * vptrs, char vchars)
+{
+ unsigned int i = 0;
+ while (i < (*parser)->varCount) {
+ if ((*parser)->varChars[i] == vchars) {
+ sfNumber *ret = (*parser)->varPtrs[i];
+ (*parser)->varPtrs[i] = vptrs;
+ return ret;
+ };
+ i += 1;
+ };
+ return NULL;
+};
+
+void *sffe_regfunc(sffe ** parser, char *vname, unsigned int parcnt,
+ sffptr funptr)
+{
+ sffunction *sff;
+ unsigned short i;
+ (*parser)->userf =
+ (sffunction *) realloc((*parser)->userf,
+ ((*parser)->userfCount +
+ 1) * sizeof(sffunction));
+ if (!(*parser)->userf)
+ return NULL;
+ sff = (*parser)->userf + (*parser)->userfCount;
+ /* 2.XI.2007 changed to get rid of warinings */
+ strcpy(sff->name, vname);
+ /* sff->name = (char*)malloc( strlen(vname) ); */
+ for (i = 0; i < strlen(vname); i += 1)
+ sff->name[i] = (char) toupper((int) vname[i]);
+ sff->parcnt = parcnt;
+ sff->fptr = funptr;
+ (*parser)->userfCount += 1;
+ return (void *) sff;
+};
+
+void *sffe_variable(sffe * const p, char *fname, size_t len)
+{
+ unsigned int idx = 0;
+ if (len == 1) /*FIXME vars names with length > 1 should be allowed */
+ for (; idx < p->varCount; idx += 1)
+ /* if ( !strncmp(fname,p->varChars[idx],len) ) */
+ if (p->varChars[idx] == *fname)
+ return (void *) p->varPtrs[idx];
+ return NULL;
+};
+
+sffunction *userfunction(const sffe * const p, char *fname, size_t len)
+{
+ unsigned char idx;
+ for (idx = 0; idx < p->userfCount; idx += 1)
+ if (!strncmp(fname, p->userf[idx].name, len))
+ return (sffunction *) (p->userf + idx);
+ return NULL;
+};
+
+char sffe_donum(char **str)
+{ /* parse number in format [-+]ddd[.dddd[e[+-]ddd]] */
+ unsigned char flag = 0; /*bit 1 - dot, bit 2 - dec, bits 3,4 - stan, bits 5..8 - error */
+ if (**str == '-') {
+ flag = 0x80;
+ *str += 1;
+ };
+ if (**str == '+')
+ *str += 1;
+ while (!((flag >> 4) & 0x07)) {
+ switch ((flag & 0x0f) >> 2) {
+ case 0: /*0..9 */
+ while (isdigit(**str))
+ *str += 1;
+ switch (**str) { /*only '.' or 'E' allowed */
+ case '.':
+ flag = (flag & 0xf3) | 4;
+ break;
+ case 'E':
+ flag = (flag & 0xf3) | 8;
+ break;
+ default:
+ flag = 0x10;
+ };
+ break;
+ case 1: /*. */
+ if (flag & 0x03)
+ flag = 0x20;
+ else
+ *str += 1; /*no 2nd dot, no dot after E */
+ flag = (flag & 0xf2) | 0x01;
+ break;
+ case 2: /*e */
+ if (flag & 0x02)
+ flag = 0x30;
+ else
+ *str += 1; /*no 2nd E */
+ if (!isdigit(**str)) { /*after E noly [+-] allowed */
+ if (**str != '-' && **str != '+')
+ flag = 0x40;
+ else
+ *str += 1;
+ };
+ flag = (flag & 0xf1) | 0x02;
+ break;
+ };
+ };
+ if (flag & 0x80)
+ flag ^= 0x80;
+ return flag >> 4;
+};
+
+char sffe_docmplx(char **str, sfarg ** arg)
+{ /* parse complex number in format { [-+]ddd[.dddd[e[+-]ddd]] ; [-+]ddd[.dddd[e[+-]ddd]] } */
+ char *chr, *chi;
+ chr = *str;
+ if (sffe_donum(str) > 1)
+ return 1;
+ if (*(*str)++ != ';')
+ return 2;
+ chi = *str;
+ if (sffe_donum(str) > 1)
+ return 1;
+ if (*(*str)++ != '}')
+ return 2;
+
+ cmplxset(*(*arg)->value, atof(chr), atof(chi));
+ return 0;
+};
+
+char sffe_doname(char **str)
+{
+ do {
+ *str += 1;
+ } while (isalnum(**str) || **str == '_');
+ if (strchr("+-*/^~!@#$%&<>?\\:\"|", (int) **str))
+ return 1; /*punctator */
+ if (**str == '(')
+ return 2; /* ( - funkcja */
+ if (**str == '.')
+ return 3; /*error :( this means something like X. COS. PI. */
+ return 1;
+};
+
+int sffe_parse(sffe ** parser, char *expression)
+{
+/**************var area */
+ struct opstack__ {
+#ifdef SFFE_DEVEL
+ char c; /* used in debug build to store operator character */
+#endif
+ unsigned char t; /* store priority of the operator 'f' */
+ sffptr f;
+ };
+ struct stack__ {
+ struct opstack__ *stck;
+ unsigned int size; //number of items on stack
+ struct stack__ *prev;
+ } *stmp, *stack;
+ sffunction **fnctbl;
+ sffunction **f;
+ sfarg *arg, *argcnt;
+ char *ech;
+ char *ch1, *ch2;
+ char *expcode; /*tokenized form : (f(n)+f(n))*f(n)-n (f-func, n-num,const) */
+ unsigned int ui1, ui2;
+ unsigned char opr;
+ char err;
+ sffe *p;
+/**************used defines */
+#define MEMERROR 1
+#define UNBALANCEDBRACKES 2
+#define INVALIDFUNCTION 3
+#define INAVLIDNUMBER 4
+#define UNKNOWNCONST 5
+#define OPERATOR 6
+#define STACKERROR 7
+#define PARCNTERROR 8
+#define NO_FUNCTIONS 9
+#define code(chr) \
+ expcode = (char*)realloc(expcode,ui1+2);\
+ expcode[ui1++] = chr;\
+ ch2 = expcode+ui1-1;\
+ opr = chr;\
+ expcode[ui1] = '\0';
+#define errset(errno) {\
+ err = errno;\
+ break;}
+#define insertfnc(fnc) \
+ for ( argcnt=p->args+p->argCount-1; argcnt>arg; argcnt-=1 )\
+ argcnt->value = (argcnt-1)->value;\
+ sfset(argcnt,-1.0);
+#ifdef SFFE_DEVEL
+#define sfpopstack(a)\
+ {\
+ stack->size-=1;\
+ insertfnc(NULL);\
+ printf("%c",stack->stck[stack->size].c);\
+ p->oprs[ui1].arg = (sfarg*)arg;\
+ p->oprs[ui1].f = stack->stck[stack->size].f;\
+ ui1 += 1;\
+ arg += 1;\
+ };
+#else
+#define sfpopstack(a)\
+ {\
+ stack->size-=1;\
+ insertfnc(NULL);\
+ p->oprs[ui1].arg = (sfarg*)arg;\
+ p->oprs[ui1].f = stack->stck[stack->size].f;\
+ ui1 += 1;\
+ arg += 1;\
+ };
+#endif
+
+#define priority(chr)\
+ (*chr=='f')?0x60:(\
+ (*chr=='^')?0x40:(\
+ ((*chr=='/')||(*chr=='*'))?0x20:(\
+ ((*chr=='+')||(*chr=='-'))?0x00:0x80\
+ )\
+ )\
+ )
+
+#ifdef SFFE_DEVEL
+ printf("parse - BEGIN\n");
+#endif
+/**************** CODE */
+ fnctbl = NULL;
+ ech = expression;
+ expcode = (char *) malloc(1);
+ err = 0;
+ //parser
+ p = *parser;
+ /* clear all internal structures */
+ if (p->expression)
+ sffe_clear(parser);
+
+ p->oprCount = 0;
+ p->argCount = 0;
+ p->expression = (char *) malloc(strlen(expression) + 1);
+ strcpy(p->expression, expression);
+ ech = p->expression;
+
+#ifdef SFFE_DEVEL
+ printf
+ ("\n|-----------------------------------------\n+ > %s[%d] - parsing\n|-----------------------------------------\n",
+ __FILE__, __LINE__);
+ printf("| input (dl.=%d) :|%s|\n", strlen(p->expression),
+ p->expression);
+#endif
+
+/*! PHASE 1 !!!!!!!!! remove spaces, count brackets, change decimal separators ',' to '.', remove multiple operators eg. ++--++1 -> 1, -+++2 -> -2 */
+ ch1 = NULL;
+ ui1 = 0; /*brackets */
+ ch2 = ech;
+ while (isspace(*ech))
+ ech += 1; /* skip leading spaces */
+ while (*ech) {
+ /*handle brackets and chaange ','->'.' */
+ switch (*ech) {
+ case '[':
+ *ech = '(';
+ case '(':
+ ui1 += 1;
+ break;
+ case ']':
+ *ech = ')';
+ case ')':
+ ui1 -= 1;
+ break;
+ case ',':
+ *ech = '.';
+ break;
+ };
+ *ch2 = (char) toupper((int) *ech);
+ /*fix multiple arithm operators */
+ if (ch1 && strchr("+-/*^", (int) *ech)
+ && strchr("+-/*^", (int) *ch1)) {
+ if (*ch1 == '-' && *ech == '-')
+ *ch1 = '+';
+ else if (*ch1 == '-' && *ech == '+')
+ *ch1 = '-';
+ else if (*ch1 == '+' && *ech == '-')
+ *ch1 = '-';
+ else if (*ch1 == *ech)
+ *ch1 = *ech;
+ else if (*ech == '-')
+ ch1 = ++ch2;
+ else if (*ch1 != *ech) {
+ err = OPERATOR;
+ break;
+ };
+ } else {
+ ch1 = ch2;
+ ch2 += 1;
+ };
+ do {
+ ech += 1;
+ } while (isspace(*ech)); /*skip spaces */
+ };
+ *ch2 = '\0';
+ p->expression =
+ (char *) realloc(p->expression, strlen(p->expression) + 1);
+ if (ui1 && !err)
+ err = UNBALANCEDBRACKES;
+
+#ifdef SFFE_DEVEL
+ printf("| check (dl.=%d) :|%s|\n", strlen(p->expression),
+ p->expression);
+#endif
+
+/*! PHASE 2 !!!!!!!! tokenize expression, lexical analysis (need optimizations) */
+ *expcode = '\0';
+ ch2 = NULL;
+ ui1 = 0;
+ ch1 = NULL; /*string starting position */
+ ech = p->expression;
+ opr = '('; /* in case of leading '-' */
+ while (*ech && !err) {
+ ch1 = ech;
+
+ if (isalpha(*ech)) {
+ switch (sffe_doname(&ech)) {
+ case 1: /* const or variable */
+ p->args =
+ (sfarg *) realloc(p->args,
+ (++p->argCount) * sizeof(sfarg));
+ if (!p->args)
+ errset(MEMERROR);
+ arg = p->args + p->argCount - 1;
+ arg->value =
+ (sfNumber *) sffe_variable(p, ch1,
+ (size_t) (ech - ch1));
+ if (!arg->value) {
+ sfset(arg, 10.0);
+ if (arg->value) {
+ if (!sffe_const
+ (ch1, (size_t) (ech - ch1), arg->value))
+ errset(UNKNOWNCONST);
+ } else
+ errset(MEMERROR);
+ };
+ opr = 'n';
+ break;
+ case 2: /* function */
+ fnctbl =
+ (sffunction **) realloc(fnctbl,
+ (p->oprCount +
+ 1) * sizeof(sffunction *));
+ if (!fnctbl)
+ errset(MEMERROR);
+ f = fnctbl + (p->oprCount++);
+ *f = NULL;
+ if (p->userfCount)
+ /*is it user defined function */
+ *f = (sffunction *) (void *) userfunction(p, ch1,
+ (size_t) (ech
+ -
+ ch1));
+ if (!*f)
+ /*if not, is it build in function */
+ *f = (sffunction *) (void *) sffe_function(ch1,
+ (size_t)
+ (ech -
+ ch1));
+ /* if not -> ERROR */
+ if (!*f)
+ errset(INVALIDFUNCTION);
+ opr = 'f';
+ break;
+ case 3: /* what ? */
+ errset(OPERATOR);
+ break;
+ };
+ } else /* numbers (this part can be optimized) */
+ /* is it a real number */ if (isdigit(*ech)
+ || (strchr("/*^(", (int) opr)
+ && strchr("+-", *ech))) {
+ ch1 = ech; /* st = 1; */
+ if (sffe_donum(&ech) > 1)
+ errset(INAVLIDNUMBER);
+ /*epx */
+ p->args =
+ (sfarg *) realloc(p->args,
+ (++p->argCount) * sizeof(sfarg));
+ if (!p->args)
+ errset(MEMERROR);
+ arg = p->args + p->argCount - 1;
+ /* 22.I.2009 fix for '-n'/'+n', which was parsed as 0*n */
+ if ((ech - ch1) == 1 && (*ch1 == '-'))
+ sfset(arg, -1)
+ else
+ sfset(arg, atof(ch1));
+ /*epx */
+ opr = 'n';
+ } else
+ /* if not, it can be complex number */
+#ifdef SFFE_COMPLEX
+ if (*ech == '{') {
+ ech += 1;
+ p->args =
+ (sfarg *) realloc(p->args,
+ (++p->argCount) * sizeof(sfarg));
+ if (!p->args)
+ errset(MEMERROR);
+ arg = p->args + p->argCount - 1;
+ sfset(arg, 0);
+ if (sffe_docmplx(&ech, &arg))
+ errset(INAVLIDNUMBER);
+ opr = 'n';
+ } else
+#endif
+ /* if not, we have operator */
+ {
+ ch1 = (char *) sffe_operator(*ech);
+
+ if (ch1) {
+ fnctbl =
+ (sffunction **) realloc(fnctbl,
+ (++p->oprCount) *
+ sizeof(sffunction *));
+ if (!fnctbl)
+ errset(MEMERROR);
+ fnctbl[p->oprCount - 1] = (sffunction *) ch1;
+ };
+ ch1 = ech;
+ opr = *ech;
+ ech += 1;
+ };
+
+
+ /* check if multiply sign skipped, nf, n(, )( */
+ if (!err && ui1 > 0)
+ if (opr == 'f' || opr == 'n' || opr == '(')
+ if (*ch2 == 'n' || *ch2 == ')') {
+ ch1 = (char *) sffe_operator('*');
+ fnctbl =
+ (sffunction **) realloc(fnctbl,
+ (++p->oprCount) *
+ sizeof(sffunction *));
+ if (!fnctbl)
+ errset(MEMERROR);
+ if (opr == 'f') {
+ fnctbl[p->oprCount - 1] = fnctbl[p->oprCount - 2];
+ fnctbl[p->oprCount - 2] = (sffunction *) ch1;
+ } else
+ fnctbl[p->oprCount - 1] = (sffunction *) ch1;
+ ch1 = (char *) (int) opr; /* ]:-> */
+ code('*');
+ opr = (char) (int) ch1;
+ ch1 = NULL;
+ };
+
+ code(opr);
+ };
+
+ ech = expcode;
+
+#ifdef SFFE_DEVEL
+ printf
+ ("| compiled expr. :|%s|\n| operacje: %d\n| stale,zmienne: %d\n| stack not.: ",
+ expcode, p->oprCount, p->argCount);
+#endif
+
+/*! PRE PHASE 3 !!!!! no operations in expression = single numeric value */
+ if (!p->oprCount && p->argCount == 1) {
+ p->oprs = (sfopr *) malloc(p->argCount * sizeof(sfopr));
+ p->oprs[0].arg = (sfarg *) p->args;
+ p->oprs[0].f = NULL;
+ p->result = (sfNumber *) p->args->value;
+ } else
+/*! PHASE 3 !!!!! create sffe 'stack' notation ]:-> */
+/* lots of memory operations are done here but no memory leaks should occur */
+ if (!err) {
+ ui1 = p->argCount + p->oprCount;
+ p->args = (sfarg *) realloc(p->args, ui1 * sizeof(sfarg));
+ memset(p->args + p->argCount, 0, p->oprCount * sizeof(sfarg));
+ p->argCount = ui1;
+ arg = p->args;
+ p->oprs = (sfopr *) malloc(p->oprCount * sizeof(sfopr));
+ ch1 = NULL; /* number */
+ /* stacks ( stores operations and controls parameters count inside of brackts blocks ) */
+ stack = (struct stack__ *) malloc(sizeof(struct stack__));
+ stack->size = 0; /* 0-stack is empty, but ready to write (one slot allocated), >0-number of element on stack */
+ stack->stck =
+ (struct opstack__ *) malloc(sizeof(struct opstack__));
+ stack->prev = NULL;
+ memset(stack->stck, 0, sizeof(struct opstack__));
+ ui1 = 0; /* used in defines */
+ f = fnctbl;
+
+ while (*ech && !err) {
+ switch (*ech) {
+ /* O */
+ case '+':
+ case '-':
+ case '*':
+ case '/':
+ case '^':
+ if (ch1) {
+#ifdef SFFE_DEVEL
+ printf("%c", *ch1);
+#endif
+ arg += 1;
+ };
+
+ ch1 = (char *) (int) (priority(ech));
+ /* there is an operator on stack */
+ if (stack->size) {
+ /* double casting to get rid of 'cast from pointer to integer of different size' warning
+ * remove all operators with higher, or equal priority
+ **/
+ while ((unsigned char) (int) ch1 <=
+ stack->stck[stack->size - 1].t) {
+ sfpopstack(NULL);
+ stack->stck = (struct opstack__ *) realloc(stack->stck, sizeof(struct opstack__)); /* is this reallocation really needed ?!? */
+ if (stack->size == 0)
+ break;
+ };
+ stack->stck =
+ (struct opstack__ *) realloc(stack->stck,
+ (stack->size +
+ 1) *
+ sizeof(struct
+ opstack__));
+ };
+
+#ifdef SFFE_DEVEL
+ stack->stck[stack->size].c = *ech;
+#endif
+
+ stack->stck[stack->size].t = (unsigned char) (int) ch1; /* store operator prority */
+ stack->stck[stack->size].f = ((sffunction *) (*f))->fptr; /* get function pointer */
+ stack->size += 1;
+ f += 1;
+ ch1 = NULL;
+ break;
+ /* F */
+ case 'f':
+ stack->stck =
+ (struct opstack__ *) realloc(stack->stck,
+ (stack->size +
+ 1) *
+ sizeof(struct opstack__));
+#ifdef SFFE_DEVEL
+ stack->stck[stack->size].c = 'f';
+#endif
+
+ /* mark operator as a function, and store number of parameters (0 - unlimited) */
+ stack->stck[stack->size].t =
+ 0x60 | (((sffunction *) (*f))->parcnt & 0x1F);
+ stack->stck[stack->size].f = ((sffunction *) (*f))->fptr; /* get function pointer */
+
+ stack->size += 1;
+ f += 1;
+ ch1 = NULL;
+ break;
+ /* ( */
+ case '(':
+ /* store current stack */
+ stmp = (struct stack__ *) malloc(sizeof(struct stack__));
+ stmp->prev = stack;
+ stack = stmp;
+ stack->size = 0;
+ stack->stck =
+ (struct opstack__ *) malloc(sizeof(struct opstack__));
+#ifdef SFFE_DEVEL
+ stack->stck[0].c = '_';
+#endif
+ opr = 0;
+ break;
+ /* ; */
+ case ';':
+ /* check if anything whas been read !!! */
+ if (ch1) {
+#ifdef SFFE_DEVEL
+ printf("%c", *ch1);
+#endif
+ arg += 1;
+ ch1 = NULL;
+ };
+ /* if there is something on stack, flush it we need to read next parameter */
+ while (stack->size)
+ sfpopstack(NULL);
+
+ /* wrong number of parameters */
+ ch2 = (char *) (stack->prev->stck + stack->prev->size - 1);
+ if ((((struct opstack__ *) ch2)->t & 0x1f) == 1)
+ errset(PARCNTERROR);
+ ((struct opstack__ *) ch2)->t =
+ 0x60 | ((((struct opstack__ *) ch2)->t & 0x1f) - 1);
+ break;
+ /* ) */
+ case ')':
+ if (ch1) {
+#ifdef SFFE_DEVEL
+ printf("%c", *ch1);
+#endif
+ arg += 1;
+ }
+ ch1 = NULL;
+
+ /* if there is something on stack, flush it we need to read next parameter */
+ while (stack->size)
+ sfpopstack(NULL);
+
+ if (!stack->prev)
+ errset(STACKERROR);
+ stmp = stack;
+ free(stmp->stck);
+ stack = stmp->prev;
+ free(stmp);
+
+ /* i was reading function, if so at the top of current
+ * stack is a function. identified by '*.t==3'
+ **/
+ ch2 = (char *) (stack->stck + stack->size - 1);
+ if ((((struct opstack__ *) ch2)->t & 0xE0) == 0x60) {
+ /* wrong number of parameters */
+ if ((((struct opstack__ *) ch2)->t & 0x1f) > 1)
+ errset(PARCNTERROR);
+ if (!err) {
+ sfpopstack(NULL);
+ if (stack->size)
+ stack->stck =
+ (struct opstack__ *) realloc(stack->stck,
+ (stack->
+ size) *
+ sizeof(struct
+ opstack__));
+ };
+ };
+ break;
+ /* n */
+ case 'n':
+ ch1 = ech;
+ break;
+ };
+ ech += 1;
+ };
+
+ if (!err) {
+ if (ch1) {
+#ifdef SFFE_DEVEL
+ printf("%c", *ch1);
+#endif
+ arg += 1;
+ }
+
+ while (stack) { /*clean up stack */
+ while (stack->size) {
+ stack->size -= 1;
+#ifdef SFFE_DEVEL
+ printf("%c", stack->stck[stack->size].c);
+#endif
+ insertfnc(NULL);
+ p->oprs[ui1].arg = (sfarg *) arg;
+ p->oprs[ui1].f = stack->stck[stack->size].f;
+ ui1 += 1;
+ arg += 1;
+ };
+ free(stack->stck);
+ stmp = stack->prev;
+ free(stack);
+ stack = stmp;
+ };
+
+ /* set up formula call stack */
+ (p->args)->parg = NULL;
+ for (ui1 = 1; ui1 < p->argCount; ui1 += 1)
+ (p->args + ui1)->parg = (p->args + ui1 - 1);
+
+#ifdef SFFE_DEVEL
+ printf("\n| numbers :");
+ for (ui1 = 0; ui1 < p->argCount; ui1 += 1) {
+ if ((p->args + ui1)->value)
+ printf(" %g%+gI", real((*(p->args + ui1)->value)),
+ imag((*(p->args + ui1)->value)));
+ else
+ printf(" [_]");
+ };
+
+ printf("\n| functions fnctbl:");
+ for (ui1 = 0; ui1 < p->oprCount; ui1 += 1)
+ printf(" 0x%.6X [%s]", (int) fnctbl[ui1]->fptr,
+ fnctbl[ui1]->name);
+
+ printf("\n| functions used ptrs:");
+ for (ui1 = 0; ui1 < p->oprCount; ui1 += 1)
+ printf(" 0x%.6X", (int) p->oprs[ui1].f);
+#endif
+ } else { /* prevent memory leaks */
+
+ while (stack) { /* clean up stack */
+ free(stack->stck);
+ stmp = stack->prev;
+ free(stack);
+ stack = stmp;
+ };
+ };
+ /* set up evaluation result pointer (result is stored in last operation return) */
+ p->result = (sfNumber *) (p->oprs + p->oprCount - 1)->arg->value;
+ if (!p->result)
+ err = MEMERROR;
+ };
+
+ if (err) {
+#ifdef SFFE_DEVEL
+ /* in debug mode report errors on stdout */
+ printf("Parser error : ");
+ switch (err) {
+ case MEMERROR:
+ printf(" MEMORY ERROR!!");
+ break;
+ case UNBALANCEDBRACKES:
+ printf(" UNBALANCED BRACKETS!! : %s\n", ch1);
+ break;
+ case INVALIDFUNCTION:
+ printf(" UNKNOWN FUNCTION!! : %s\n", ch1);
+ break;
+ case INAVLIDNUMBER:
+ printf(" NUMBER FORMAT!! : %s\n", ch1);
+ break;
+ case UNKNOWNCONST:
+ printf(" UNKOWN CONST or VAR NAME!! : %s\n", ch1);
+ break;
+ case OPERATOR:
+ printf(" UNKNOWN OPERATOR!! : %s\n", ch1);
+ break;
+ case STACKERROR:
+ printf(" INTERNAL STACK CORRUPTED!! : %s\n", ch1);
+ break;
+ case PARCNTERROR:
+ printf(" FUNCTION PARAMETERS ERROR!! : %s\n", ch1);
+ break;
+ case NO_FUNCTIONS:
+ printf("Formula error ! ARE YOU KIDDING ME ?!? : %s", ch1);
+ break;
+ };
+#endif
+ /* try to store error message */
+ if (p->errormsg)
+ switch (err) {
+ case MEMERROR:
+ sprintf(p->errormsg, "Formula error ! MEMORY ERROR!!");
+ break;
+ case UNBALANCEDBRACKES:
+ sprintf(p->errormsg,
+ "Formula error ! UNBALANCED BRACKETS!! : %s", ch1);
+ break;
+ case INVALIDFUNCTION:
+ sprintf(p->errormsg,
+ "Formula error ! UNKNOWN FUNCTION!! : %s", ch1);
+ break;
+ case INAVLIDNUMBER:
+ sprintf(p->errormsg,
+ "Formula error ! NUMBER FORMAT!! : %s", ch1);
+ break;
+ case UNKNOWNCONST:
+ sprintf(p->errormsg,
+ "Formula error ! UNKOWN CONST or VAR NAME!! : %s",
+ ch1);
+ break;
+ case OPERATOR:
+ sprintf(p->errormsg,
+ "Formula error ! UNKNOWN OPERATOR!! : %s", ch1);
+ break;
+ case STACKERROR:
+ sprintf(p->errormsg,
+ "Formula error ! INTERNAL STACK CORRUPTED!! : %s",
+ ch1);
+ break;
+ case PARCNTERROR:
+ sprintf(p->errormsg,
+ "Formula error ! FUNCTION PARAMETERS ERROR!! : %s",
+ ch1);
+ break;
+ case NO_FUNCTIONS:
+ sprintf(p->errormsg,
+ "Formula error ! ARE YOU KIDDING ME ?!? : %s",
+ ch1);
+ break;
+ };
+ /* if error -> clean up */
+ sffe_clear(&p);
+ };
+
+ /*undefine defines */
+#undef priority
+#undef sfpopstack
+#undef insertfnc
+#undef code
+#undef errset
+#undef MEMERROR
+#undef UNBALANCEDBRACKES
+#undef INVALIDFUNCTION
+#undef INAVLIDNUMBER
+#undef UNKNOWNCONST
+#undef OPERATOR
+#undef STACKERROR
+#undef PARCNTERROR
+ free(expcode);
+ free(fnctbl);
+
+#ifdef SFFE_DEVEL
+ printf("\nparse - END\n");
+#endif
+ return err;
+};
+
+#undef sfset
+#undef sfvar
+
+#endif
diff --git a/src/sffe/sffe.pri b/src/sffe/sffe.pri
new file mode 100644
index 0000000..2935585
--- /dev/null
+++ b/src/sffe/sffe.pri
@@ -0,0 +1,23 @@
+DEFINES += SFFE_USING SFFE_CMPLX_ASM
+
+SOURCES += \
+ $$PWD/sffe.c \
+ $$PWD/sffe_cmplx_asm.c \
+ $$PWD/sffe_cmplx_gsl.c
+
+ASM_SOURCES += \
+ $$PWD/asm/cmplx.asm
+
+nasm.input = ASM_SOURCES
+nasm.output = $$PWD/${QMAKE_FILE_BASE}.o
+
+win32 {
+ nasm.commands = nasm -f coff -o $$PWD/${QMAKE_FILE_BASE}.o ${QMAKE_FILE_NAME}
+} else:macx {
+ nasm.commands = nasm -f macho -o $$PWD/${QMAKE_FILE_BASE}.o ${QMAKE_FILE_NAME}
+} else {
+ nasm.commands = nasm -f elf -o $$PWD/${QMAKE_FILE_BASE}.o ${QMAKE_FILE_NAME}
+}
+
+
+QMAKE_EXTRA_COMPILERS += nasm
diff --git a/src/sffe/sffe_cmplx_asm.c b/src/sffe/sffe_cmplx_asm.c
new file mode 100644
index 0000000..88a008d
--- /dev/null
+++ b/src/sffe/sffe_cmplx_asm.c
@@ -0,0 +1,331 @@
+/*/////////////////////////////////////////////////////////////////////////////////////
+// project : sFFe ( SegFault (or Segmentation Fault :) ) formula evalutaor )
+// author : Mateusz Malczak ( mateusz@malczak.info )
+// wpage : www.segfaultlabs.com/projects/sffe
+///////////////////////////////////////////////////////////////////////////////////////
+// special build for XaoS, for more info visit
+// http://www.segfaultlabs.com/projects/sfXaos
+/////////////////////////////////////////////////////////////////////////////////////*/
+
+#include <config.h>
+#ifdef SFFE_CMPLX_ASM
+
+#include <math.h>
+#include "sffe.h"
+#include "sffe_cmplx_asm.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ const sffunction sfcmplxfunc[sffnctscount] = {
+ /* nie uwzgledniaj w wyszukaniu funkcji */
+ {sfpow, 2, "^\0"}, {sfadd, 2, "+\0"}, {sfsub, 2, "-\0"}, {sfmul, 2,
+ "*\0"},
+ {sfdiv, 2, "/\0"},
+ /* ponizej uwzgledniaj w wyszukaniu funkcji */
+ {sfsin, 1, "SIN\0"}, {sfcos, 1, "COS\0"}, {sftan, 1, "TAN\0"},
+ {sfcot, 1, "COT\0"},
+ {sfasin, 1, "ASIN\0"}, {sfacos, 1, "ACOS\0"}, {sfatan, 1,
+ "ATAN\0"}, {sfacot,
+ 1,
+ "ACOT\0"},
+ {sfatan2, 2, "ATAN2\0"},
+ {sfsinh, 1, "SINH\0"}, {sfcosh, 1, "COSH\0"}, {sftanh, 1,
+ "TANH\0"}, {sfcoth,
+ 1,
+ "COTH\0"},
+ {sfexp, 1, "EXP\0"}, {sflog, 1, "LOG\0"}, {sflog10, 1, "LOG10\0"},
+ {sflog2, 1, "LOG2\0"},
+ {sflogN, 2, "LOGN\0"}, {sflogCN, 2, "LOGCN\0"},
+ /*power functions */
+ {sfpow, 2, "POW\0"}, {sfpowi, 2, "POWI\0"}, {sfpowd, 2, "POWD\0"},
+ {sfpowdc, 2, "POWDC\0"},
+ {sfsqr, 1, "SQR\0"}, {sfsqrt, 1, "SQRT\0"}, {sfrtni, 3, "RTNI"},
+ {sfinv, 1, "INV\n"},
+ {sfceil, 1, "CEIL\0"}, {sffloor, 1, "FLOOR\0"}, {sfabs, 1,
+ "ABS\0"}, {sfrabs,
+ 1,
+ "RABS\0"},
+ {sfre, 1, "RE\0"}, {sfim, 1, "IM\0"},
+ {NULL, 1, "RAD\0"}, {NULL, 1, "DEG\0"},
+ {NULL, 1, "SIGN\0"}, {NULL, 1, "TRUNC\0"}, {sfrand, 1, "RAND\0"}
+ };
+
+ const char sfcnames[sfvarscount][5] =
+ { "PI\0", "PI_2\0", "PI2\0", "E\0", "I\0", "RND\0" };
+
+ const cfptr sfcvals[sfvarscount] =
+ { sfcPI, sfcPI2, sfc2PI, sfcE, sfcI, sfcRND };
+
+
+ cmplx cset(double r, double i) {
+ cmplx c;
+ c.r = r;
+ c.i = i;
+ return c;
+ };
+
+ cmplx cadd(const cmplx c1, const cmplx c2) {
+ cmplx r;
+ r.r = c1.r + c2.r;
+ r.i = c1.i + c2.i;
+ return r;
+ };
+
+ cmplx csub(const cmplx c1, const cmplx c2) {
+ cmplx r;
+ r.r = c1.r - c2.r;
+ r.i = c1.i - c2.i;
+ return r;
+ };
+
+ cmplx cmul(const cmplx c1, const cmplx c2) {
+ cmplx r;
+ r.r = c1.r * c2.r - c1.i * c2.i;
+ r.i = c1.r * c2.i + c1.i * c2.r;
+ return r;
+ };
+
+ cmplx cdiv(const cmplx c1, const cmplx c2) {
+ double d = (c2.r * c2.r + c2.i * c2.i);
+ cmplx r;
+ r.r = (c1.r * c2.r + c1.i * c2.i) / d;
+ r.i = (-c1.i * c2.r + c1.r * c2.i) / d;
+ return r;
+ };
+
+ sfarg *sfadd(sfarg * const p) { /* + */
+ sfvalue(p) = cadd(sfvalue(sfaram2(p)), sfvalue(sfaram1(p)));
+ return sfaram2(p);
+ };
+
+ sfarg *sfsub(sfarg * const p) { /* - */
+ sfvalue(p) = csub(sfvalue(sfaram2(p)), sfvalue(sfaram1(p)));
+ return sfaram2(p);
+ };
+
+ sfarg *sfmul(sfarg * const p) { /* * */
+ sfvalue(p) = cmul(sfvalue(sfaram2(p)), sfvalue(sfaram1(p)));
+ return sfaram2(p);
+ };
+
+ sfarg *sfdiv(sfarg * const p) { /* / */
+ sfvalue(p) = cdiv(sfvalue(sfaram2(p)), sfvalue(sfaram1(p)));
+ return sfaram2(p);
+ };
+
+
+ sfarg *sfsin(sfarg * const p) { /* sin */
+ sfvalue(p) = sffecsin(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sfcos(sfarg * const p) { /* cos */
+ sfvalue(p) = sffeccos(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sftan(sfarg * const p) { /* tan */
+ sfvalue(p) = sffectan(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sfcot(sfarg * const p) { /* ctan */
+ sfvalue(p) = sffeccot(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+
+ sfarg *sfasin(sfarg * const p) { /* asin */
+ //sfvalue(p) = asin( sfvalue( sfaram1(p) ) );
+ return sfaram1(p);
+ };
+
+ sfarg *sfacos(sfarg * const p) { /* acos */
+ //sfvalue(p) = acos( sfvalue( sfaram1(p) ) );
+ return sfaram1(p);
+ };
+
+ sfarg *sfatan(sfarg * const p) { /* atan */
+// sfvalue(p) = atan( sfvalue( sfaram1(p) ) );
+ return sfaram1(p);
+ };
+
+ sfarg *sfacot(sfarg * const p) { /* actan */
+// sfvalue(p) = 1.0/atan( sfvalue( sfaram1(p) ) );
+ return sfaram1(p);
+ };
+
+ sfarg *sfatan2(sfarg * const p) { /* atan2 */
+ //sfvalue(p) = atan2( sfvalue( sfaram2(p) ), sfvalue( sfaram1(p) ) );
+ return sfaram2(p);
+ };
+
+
+ sfarg *sfsinh(sfarg * const p) { /* sinh */
+ sfvalue(p) = sffecsinh(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sfcosh(sfarg * const p) { /* cosh */
+ sfvalue(p) = sffeccosh(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sftanh(sfarg * const p) { /* tanh */
+ sfvalue(p) = sffectanh(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sfcoth(sfarg * const p) { /* ctanh */
+ sfvalue(p) = sffeccoth(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+
+ sfarg *sfexp(sfarg * const p) { /* exp */
+ sfvalue(p) = sffecexp(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sflog(sfarg * const p) { /* log */
+ sfvalue(p) = sffecln(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sflog2(sfarg * const p) { /* log2 */
+ sfvalue(p) = sffeclog2(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sflog10(sfarg * const p) { /* log2 */
+ sfvalue(p) = sffeclog(sfvalue(sfaram1(p)), 10);
+ return sfaram1(p);
+ };
+
+ sfarg *sflogN(sfarg * const p) { /* logN */
+ sfvalue(p) = sffeclog(sfvalue(sfaram1(p)), sfvalue(sfaram2(p)).r);
+ return sfaram2(p);
+ };
+
+ sfarg *sflogCN(sfarg * const p) { /* logCN */
+ sfvalue(p) =
+ cdiv(sffecln(sfvalue(sfaram2(p))),
+ sffecln(sfvalue(sfaram1(p))));
+ return sfaram2(p);
+ };
+
+ sfarg *sfpow(sfarg * const p) { /* csflx pow */
+ sfvalue(p) = sffeccpow(sfvalue(sfaram2(p)), sfvalue(sfaram1(p)));
+ return sfaram2(p);
+ };
+
+ sfarg *sfpowi(sfarg * const p) { /* int pow */
+ sfvalue(p) =
+ sffecpowi(sfvalue(sfaram2(p)), (int) (sfvalue(sfaram1(p)).r));
+ return sfaram2(p);
+ };
+
+ sfarg *sfpowd(sfarg * const p) { /* double pow */
+ sfvalue(p) = sffecpowd(sfvalue(sfaram2(p)), sfvalue(sfaram1(p)).r);
+ return sfaram2(p);
+ };
+
+ sfarg *sfpowdc(sfarg * const p) { /* double to csflx pow */
+ sfvalue(p) = sffecpowc(sfvalue(sfaram2(p)).r, sfvalue(sfaram1(p)));
+ return sfaram2(p);
+ };
+
+ sfarg *sfsqr(sfarg * const p) { /* sqr */
+ sfvalue(p) = cmul(sfvalue(sfaram1(p)), sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sfsqrt(sfarg * const p) { /* sqrt */
+ sfvalue(p) = sffecsqrt(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sfrtni(sfarg * const p) /* rtni *///cos tu nie tak jak powinno byc ;(
+ {
+ sfvalue(p) =
+ sffecrtni(sfvalue(sfaram3(p)), (int) (sfvalue(sfaram2(p)).r),
+ (int) (sfvalue(sfaram1(p)).r));
+ return sfaram3(p);
+ };
+
+ sfarg *sfinv(sfarg * const p) { /* cinv */
+ sfvalue(p) = sffecinv(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sfceil(sfarg * const p) { /* ceil */
+ //sfvalue(p) = ceil( sfvalue( sfaram1(p) ) );
+ return sfaram1(p);
+ };
+
+ sfarg *sffloor(sfarg * const p) { /* floor */
+ //sfvalue(p) = floor( sfvalue( sfaram1(p) ) );
+ return sfaram1(p);
+ };
+
+ sfarg *sfabs(sfarg * const p) { /* abs - |z| */
+ sfvalue(p).r = sffecabs(sfvalue(sfaram1(p)));
+ sfvalue(p).i = 0;
+ return sfaram1(p);
+ };
+
+ sfarg *sfrabs(sfarg * const p) { /* abs - real numbers */
+ sfvalue(p).r = sfvalue(sfaram1(p)).r;
+ if (sfvalue(p).r < 0)
+ sfvalue(p).r = -sfvalue(p).r;
+ sfvalue(p).i = 0;
+ return sfaram1(p);
+ };
+
+ sfarg *sfre(sfarg * const p) { /* RE */
+ sfvalue(p).r = sfvalue(sfaram1(p)).r;
+ sfvalue(p).i = 0;
+ return sfaram1(p);
+ };
+
+ sfarg *sfim(sfarg * const p) { /* IM */
+ sfvalue(p).r = sfvalue(sfaram1(p)).i;
+ sfvalue(p).i = 0;
+ return sfaram1(p);
+ };
+
+ sfarg *sfrand(sfarg * const p) { /* rand */
+ sfvalue(p).r =
+ sfvalue(sfaram1(p)).r * (double) rand() / (double) RAND_MAX;
+ sfvalue(p).i = 0;
+ return sfaram1(p);
+ };
+
+//const eval
+ void sfcPI(sfNumber * cnst) {
+ *cnst = cset(4 * atan(1), 0);
+ };
+ void sfcPI2(sfNumber * cnst) {
+ *cnst = cset(2 * atan(1), 0);
+ };
+ void sfc2PI(sfNumber * cnst) {
+ *cnst = cset(8 * atan(1), 0);
+ };
+ void sfcE(sfNumber * cnst) {
+ *cnst = cset(exp(1), 0);
+ };
+ void sfcI(sfNumber * cnst) {
+ *cnst = cset(0, 1);
+ };
+ void sfcRND(sfNumber * cnst) {
+ *cnst = cset((double) rand() / (double) RAND_MAX, 0);
+ };
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/sffe/sffe_cmplx_gsl.c b/src/sffe/sffe_cmplx_gsl.c
new file mode 100644
index 0000000..6006663
--- /dev/null
+++ b/src/sffe/sffe_cmplx_gsl.c
@@ -0,0 +1,294 @@
+/*/////////////////////////////////////////////////////////////////////////////////////
+// project : sFFe ( SegFault (or Segmentation Fault :) ) formula evalutaor )
+// author : Mateusz Malczak ( mateusz@malczak.info )
+// wpage : www.segfaultlabs.com/projects/sffe
+///////////////////////////////////////////////////////////////////////////////////////
+// special build for XaoS, for more info visit
+// http://www.segfaultlabs.com/projects/sfXaos
+/////////////////////////////////////////////////////////////////////////////////////*/
+
+#include <config.h>
+#ifdef SFFE_CMPLX_GSL
+
+#include "sffe.h"
+#include "sffe_cmplx_gsl.h"
+#include <gsl/gsl_complex.h>
+#include <gsl/gsl_complex_math.h>
+#include <math.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ const sffunction sfcmplxfunc[sffnctscount] = {
+ /* nie uwzgledniaj w wyszukaniu funkcji */
+ {sfpow, 2, "^\0"}, {sfadd, 2, "+\0"}, {sfsub, 2, "-\0"}, {sfmul, 2,
+ "*\0"},
+ {sfdiv, 2, "/\0"},
+ /* ponizej uwzgledniaj w wyszukaniu funkcji */
+ {sfsin, 1, "SIN\0"}, {sfcos, 1, "COS\0"}, {sftan, 1, "TAN\0"},
+ {sfcot, 1, "COT\0"},
+ {sfasin, 1, "ASIN\0"}, {sfacos, 1, "ACOS\0"}, {sfatan, 1,
+ "ATAN\0"}, {sfacot,
+ 1,
+ "ACOT\0"},
+ {sfatan2, 2, "ATAN2\0"},
+ {sfsinh, 1, "SINH\0"}, {sfcosh, 1, "COSH\0"}, {sftanh, 1,
+ "TANH\0"}, {sfcoth,
+ 1,
+ "COTH\0"},
+ {sfexp, 1, "EXP\0"}, {sflog, 1, "LOG\0"}, {sflog10, 1, "LOG10\0"},
+ {sflog2, 1, "LOG2\0"},
+ {sflogN, 2, "LOGN\0"}, {sflogN, 2, "LOGCN\0"},
+ /*power functions */
+ {sfpow, 2, "POW\0"}, {sfpowd, 2, "POWD\0"}, {sfpow, 2, "POWI\0"},
+ {sfpow, 2, "POWDC\0"},
+ {sfsqr, 1, "SQR\0"}, {sfsqrt, 1, "SQRT\0"}, {sfrtni, 3, "RTNI"},
+ {sfinv, 1, "INV\n"},
+ {sfceil, 1, "CEIL\0"}, {sffloor, 1, "FLOOR\0"}, {sfabs, 1,
+ "ABS\0"}, {sfrabs,
+ 1,
+ "RABS\0"},
+ {sfre, 1, "RE\0"}, {sfim, 1, "IM\0"},
+ {NULL, 1, "RAD\0"}, {NULL, 1, "DEG\0"},
+ {NULL, 1, "SIGN\0"}, {NULL, 1, "TRUNC\0"}, {sfrand, 1, "RAND\0"}
+ };
+
+ const char sfcnames[sfvarscount][5] =
+ { "PI\0", "PI_2\0", "PI2\0", "E\0", "I\0", "RND\0" };
+
+ const cfptr sfcvals[sfvarscount] =
+ { sfcPI, sfcPI2, sfc2PI, sfcE, sfcI, sfcRND };
+
+ sfarg *sfadd(sfarg * const p) { /* + */
+ sfvalue(p) =
+ gsl_complex_add(sfvalue(sfaram2(p)), sfvalue(sfaram1(p)));
+ return sfaram2(p);
+ };
+
+ sfarg *sfsub(sfarg * const p) { /* - */
+ sfvalue(p) =
+ gsl_complex_sub(sfvalue(sfaram2(p)), sfvalue(sfaram1(p)));
+ return sfaram2(p);
+ };
+
+ sfarg *sfmul(sfarg * const p) { /* * */
+ sfvalue(p) =
+ gsl_complex_mul(sfvalue(sfaram2(p)), sfvalue(sfaram1(p)));
+ return sfaram2(p);
+ };
+
+ sfarg *sfdiv(sfarg * const p) { /* / */
+ sfvalue(p) =
+ gsl_complex_div(sfvalue(sfaram2(p)), sfvalue(sfaram1(p)));
+ return sfaram2(p);
+ };
+
+
+ sfarg *sfsin(sfarg * const p) { /* sin */
+ sfvalue(p) = gsl_complex_sin(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sfcos(sfarg * const p) { /* cos */
+ sfvalue(p) = gsl_complex_cos(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sftan(sfarg * const p) { /* tan */
+ sfvalue(p) = gsl_complex_tan(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sfcot(sfarg * const p) { /* ctan */
+ sfvalue(p) = gsl_complex_cot(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+
+ sfarg *sfasin(sfarg * const p) { /* asin */
+ sfvalue(p) = gsl_complex_arcsin(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sfacos(sfarg * const p) { /* acos */
+ sfvalue(p) = gsl_complex_arccos(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sfatan(sfarg * const p) { /* atan */
+ sfvalue(p) = gsl_complex_arctan(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sfacot(sfarg * const p) { /* actan */
+ sfvalue(p) = gsl_complex_arccot(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sfatan2(sfarg * const p) { /* atan2 */
+ return sfaram2(p);
+ };
+
+ sfarg *sfsinh(sfarg * const p) { /* sinh */
+ sfvalue(p) = gsl_complex_sinh(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sfcosh(sfarg * const p) { /* cosh */
+ sfvalue(p) = gsl_complex_cosh(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sftanh(sfarg * const p) { /* tanh */
+ sfvalue(p) = gsl_complex_tanh(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sfcoth(sfarg * const p) { /* ctanh */
+ sfvalue(p) = gsl_complex_coth(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+
+ sfarg *sfexp(sfarg * const p) { /* exp */
+ sfvalue(p) = gsl_complex_exp(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sflog(sfarg * const p) { /* log */
+ sfvalue(p) = gsl_complex_log(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sflog10(sfarg * const p) { /* log10 */
+ sfvalue(p) = gsl_complex_log10(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sflog2(sfarg * const p) { /* log2 */
+ sfNumber base;
+ real(base) = 2;
+ imag(base) = 0;
+ sfvalue(p) = gsl_complex_log_b(sfvalue(sfaram1(p)), base);
+ return sfaram1(p);
+ };
+
+ sfarg *sflogN(sfarg * const p) { /* logN */
+ sfvalue(p) =
+ gsl_complex_log_b(sfvalue(sfaram1(p)), sfvalue(sfaram2(p)));
+ return sfaram2(p);
+ };
+
+
+ sfarg *sfpow(sfarg * const p) { /* cmplx pow */
+ sfvalue(p) =
+ gsl_complex_pow(sfvalue(sfaram2(p)), sfvalue(sfaram1(p)));
+ return sfaram2(p);
+ };
+
+ sfarg *sfpowd(sfarg * const p) { /* int pow */
+ sfvalue(p) =
+ gsl_complex_pow_real(sfvalue(sfaram2(p)),
+ GSL_REAL(sfvalue(sfaram1(p))));
+ return sfaram2(p);
+ };
+
+ sfarg *sfsqr(sfarg * const p) { /* sqr */
+ sfvalue(p) =
+ gsl_complex_pow(sfvalue(sfaram1(p)), sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sfsqrt(sfarg * const p) { /* sqrt */
+ sfvalue(p) = gsl_complex_sqrt(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sfrtni(sfarg * const p) { /* rtni */
+ double nrz =
+ pow(gsl_complex_abs(sfvalue(sfaram3(p))),
+ 1.0 / (double) (int) real(sfvalue(sfaram2(p))));
+ double alfi =
+ (gsl_complex_arg(sfvalue(sfaram3(p))) +
+ 8 * atan(1.0) * (double) (int) real(sfvalue(sfaram1(p)))) /
+ (double) (int) real(sfvalue(sfaram2(p)));
+
+ cmplxset(sfvalue(sfaram3(p)), nrz * cos(alfi), nrz * sin(alfi));
+ return sfaram3(p);
+ };
+
+ sfarg *sfinv(sfarg * const p) { /* cinv */
+ sfvalue(p) = gsl_complex_inverse(sfvalue(sfaram1(p)));
+ return sfaram1(p);
+ };
+
+ sfarg *sfceil(sfarg * const p) { /* ceil */
+ //sfvalue(p) = ceil( sfvalue( sfaram1(p) ) );
+ return sfaram1(p);
+ };
+
+ sfarg *sffloor(sfarg * const p) { /* floor */
+ //sfvalue(p) = floor( sfvalue( sfaram1(p) ) );
+ return sfaram1(p);
+ };
+
+ sfarg *sfabs(sfarg * const p) { /* abs - |z| */
+ GSL_REAL(sfvalue(p)) = gsl_complex_abs(sfvalue(sfaram1(p)));
+ GSL_IMAG(sfvalue(p)) = 0.0;
+ return sfaram1(p);
+ };
+
+ sfarg *sfrabs(sfarg * const p) { /* abs - real numbers */
+ GSL_REAL(sfvalue(p)) = GSL_REAL(sfvalue(sfaram1(p)));
+ if (GSL_REAL(sfvalue(p)) < 0)
+ GSL_REAL(sfvalue(p)) = -GSL_REAL(sfvalue(p));
+ GSL_IMAG(sfvalue(p)) = 0;
+ return sfaram1(p);
+ };
+
+ sfarg *sfre(sfarg * const p) { /* RE */
+ GSL_REAL(sfvalue(p)) = GSL_REAL(sfvalue(sfaram1(p)));
+ GSL_IMAG(sfvalue(p)) = 0.0;
+ return sfaram1(p);
+ };
+
+ sfarg *sfim(sfarg * const p) { /* IM */
+ GSL_REAL(sfvalue(p)) = GSL_IMAG(sfvalue(sfaram1(p)));
+ GSL_IMAG(sfvalue(p)) = 0.0;
+ return sfaram1(p);
+ };
+
+ sfarg *sfrand(sfarg * const p) { /* rand */
+ GSL_REAL(sfvalue(p)) =
+ GSL_REAL(sfvalue(sfaram1(p))) * (double) rand() /
+ (double) RAND_MAX;
+ GSL_IMAG(sfvalue(p)) = 0;
+ return sfaram1(p);
+ };
+
+//const eval
+ void sfcPI(sfNumber * cnst) {
+ GSL_SET_COMPLEX(cnst, 4 * atan(1), 0);
+ };
+ void sfcPI2(sfNumber * cnst) {
+ GSL_SET_COMPLEX(cnst, 2 * atan(1), 0);
+ };
+ void sfc2PI(sfNumber * cnst) {
+ GSL_SET_COMPLEX(cnst, 8 * atan(1), 0);
+ };
+ void sfcE(sfNumber * cnst) {
+ GSL_SET_COMPLEX(cnst, exp(1), 0);
+ };
+ void sfcI(sfNumber * cnst) {
+ GSL_SET_COMPLEX(cnst, 0, 1);
+ };
+ void sfcRND(sfNumber * cnst) {
+ GSL_SET_COMPLEX(cnst, rand(), 0);
+ };
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/ui-hlp/Makefile.in b/src/ui-hlp/Makefile.in
new file mode 100644
index 0000000..6e8c830
--- /dev/null
+++ b/src/ui-hlp/Makefile.in
@@ -0,0 +1,47 @@
+CC = @CC@
+CFLAGS = @CFLAGS@
+LIBS = @LIBS@ -lm
+LFLAGS = @LDFLAGS@
+AR = @AR@
+RANLIB = @RANLIB@
+
+SRCS = autopilot.c \
+ ui_helper.c \
+ menu.c \
+ play.c \
+ messg.c \
+ render.c \
+ playtext.c \
+ save.c \
+ wstack.c
+
+OBJS = $(SRCS:.c=.o)
+
+TLIB = ../lib/libui-hlp.a
+
+
+all: $(TLIB)
+
+$(TLIB):$(OBJS)
+ rm -f $@
+ $(AR) rc $@ $(OBJS)
+ $(RANLIB) $@
+
+clean:
+ rm -f $(TLIB)
+ rm -f *.[oas]
+ rm -f *~
+ rm -f core
+
+distclean:clean
+ rm Makefile
+
+#dep:
+# rm -f .depend
+# make .depend
+#
+#.depend:
+# echo '# Program dependencies' >.depend
+# gcc -I svgalib $(DEFINES) -MM $(patsubst %.o,%.c,$(OBJS)) >>.depend
+#
+#include .depend
diff --git a/src/ui-hlp/autod.c b/src/ui-hlp/autod.c
new file mode 100644
index 0000000..2d66816
--- /dev/null
+++ b/src/ui-hlp/autod.c
@@ -0,0 +1,112 @@
+#ifndef UNSUPPORTED
+static INLINE int
+look1(uih_context * context, int x, int y, int range, int max)
+{
+ register cpixel_t *vbuff;
+ register int i, j, c = 0;
+ if (range < context->zengine->image->width / 2)
+ if (x < 0 || x > context->zengine->image->width ||
+ y < 0 || y > context->zengine->image->height)
+ return 0;
+ do {
+ max--;
+ c = 0;
+ if (range > context->zengine->image->width / 2)
+ context->x1 =
+ rand() % (context->zengine->image->width - 2 * LOOKSIZE -
+ 1) + LOOKSIZE, context->y1 =
+ rand() % (context->zengine->image->height - 2 * LOOKSIZE -
+ 1) + LOOKSIZE;
+ else {
+ context->x1 = rand() % range - (range >> 1) + x;
+ context->y1 = rand() % range - (range >> 1) + y;
+ if (context->x1 < LOOKSIZE)
+ context->x1 = LOOKSIZE;
+ if (context->y1 < LOOKSIZE)
+ context->y1 = LOOKSIZE;
+ if (context->x1 >
+ context->zengine->image->width - 2 - LOOKSIZE)
+ context->x1 =
+ context->zengine->image->width - 2 - LOOKSIZE;
+ if (context->y1 >
+ context->zengine->image->height - 2 - LOOKSIZE)
+ context->y1 =
+ context->zengine->image->height - 2 - LOOKSIZE;
+ }
+ for (j = context->y1 - LOOKSIZE; j <= context->y1 + LOOKSIZE; j++) {
+ vbuff = (cpixel_t *) context->zengine->image->currlines[j];
+ for (i = context->x1 - LOOKSIZE; i <= context->x1 + LOOKSIZE;
+ i++)
+ if (InSet(p_getp(vbuff, i)))
+ c++;
+ }
+ }
+ while ((c == 0 || c > LOOKSIZE * LOOKSIZE) && max > 0);
+ if (max > 0) {
+ context->c1 = BUTTON1, context->interlevel = 1;
+ return 1;
+ }
+ return (0);
+}
+
+static INLINE int
+look2(uih_context * context, int x, int y, int range, int max)
+{
+ register cpixel_t *vbuff, *vbuff2;
+ register int i, j, i1, j1, c = 0;
+ if (range < context->zengine->image->width / 2)
+ if (x < 0 || x > context->zengine->image->width ||
+ y < 0 || y > context->zengine->image->height)
+ return 0;
+ do {
+ max--;
+ c = 0;
+
+ if (range > context->zengine->image->width / 2)
+ context->x1 =
+ rand() % (context->zengine->image->width - 2 * LOOKSIZE -
+ 1) + LOOKSIZE, context->y1 =
+ rand() % (context->zengine->image->height - 2 * LOOKSIZE -
+ 1) + LOOKSIZE;
+ else {
+ context->x1 = rand() % range - (range >> 1) + x;
+ context->y1 = rand() % range - (range >> 1) + y;
+ if (context->x1 < LOOKSIZE)
+ context->x1 = LOOKSIZE;
+ if (context->y1 < LOOKSIZE)
+ context->y1 = LOOKSIZE;
+ if (context->x1 >
+ context->zengine->image->width - 2 - LOOKSIZE)
+ context->x1 =
+ context->zengine->image->width - 2 - LOOKSIZE;
+ if (context->y1 >
+ context->zengine->image->height - 2 - LOOKSIZE)
+ context->y1 =
+ context->zengine->image->height - 2 - LOOKSIZE;
+ }
+
+ for (j = context->y1 - LOOKSIZE; j < context->y1 + LOOKSIZE; j++) {
+ vbuff = (cpixel_t *) context->zengine->image->currlines[j];
+ for (i = context->x1 - LOOKSIZE; i <= context->x1 + LOOKSIZE;
+ i++)
+ for (j1 = j + 1; j1 < context->y1 + LOOKSIZE; j1++) {
+ vbuff2 =
+ (cpixel_t *) context->zengine->image->
+ currlines[j1];
+ for (i1 = i + 1; i1 < context->x1 + LOOKSIZE; i1++)
+ if (p_getp(vbuff, i) == p_getp(vbuff2, i1))
+ c++;
+ }
+ }
+
+ }
+ while ((c > LOOKSIZE * LOOKSIZE / 2) && max > 0);
+ if (max > 0) {
+ context->c1 = BUTTON1, context->interlevel = 2;
+ return 1;
+ }
+ return 0;
+}
+#endif
+#undef look1
+#undef look2
diff --git a/src/ui-hlp/autopilot.c b/src/ui-hlp/autopilot.c
new file mode 100644
index 0000000..5f28879
--- /dev/null
+++ b/src/ui-hlp/autopilot.c
@@ -0,0 +1,214 @@
+
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifdef _plan9_
+#include <u.h>
+#include <libc.h>
+#else
+#ifdef __MINGW32__
+#include <float.h>
+#define isnan _isnan
+#endif /* __MINGW32__ */
+#include <stdlib.h>
+#include <math.h>
+#include <config.h>
+#include <assert.h>
+#include <limits.h>
+#endif
+#include <fconfig.h>
+#define SLARGEITER
+#include <filter.h>
+#include <zoom.h>
+#include "autopilot.h"
+#include <ui_helper.h>
+#define MINCOUNT 5
+#define InSet(i) (i==context->image->palette->pixels[0])
+/*Include bitmap depended part first */
+
+#include <c256.h>
+#define look1 look18
+#define look2 look28
+#include "autod.c"
+
+#include <hicolor.h>
+#define look1 look116
+#define look2 look216
+#include "autod.c"
+
+#include <true24.h>
+#define look1 look124
+#define look2 look224
+#include "autod.c"
+
+#include <truecolor.h>
+#define look1 look132
+#define look2 look232
+#include "autod.c"
+
+void clean_autopilot(uih_context * context)
+{
+ context->minsize = 1000;
+ context->maxsize = 0;
+ context->autime = 0;
+ context->minlong = 0;
+ context->x1 = INT_MAX;
+ context->y1 = INT_MAX;
+ context->autopilotversion = context->fcontext->version;
+}
+
+static void again(uih_context * context)
+{
+ context->fcontext->s = context->fcontext->currentformula->v;
+ context->fcontext->version++;
+ clean_autopilot(context);
+}
+
+void
+do_autopilot(uih_context * context, int *x, int *y, int *controls,
+ void (*changed) (void), int times)
+{
+ int c = 0;
+ volatile number_t step =
+ (context->fcontext->rs.mc -
+ context->fcontext->rs.nc) / context->zengine->image->width / 10;
+ volatile number_t pos = context->fcontext->rs.mc;
+ volatile number_t pos1 = context->fcontext->rs.mc;
+ volatile number_t ystep =
+ (context->fcontext->rs.mi -
+ context->fcontext->rs.ni) / context->zengine->image->height / 10;
+ volatile number_t ypos = context->fcontext->rs.mi;
+ volatile number_t ypos1 = context->fcontext->rs.mi;
+ pos += step; /*out of precisity check */
+ ypos += ystep;
+ pos1 -= step; /*out of precisity check */
+ ypos1 -= ystep;
+ *x = context->x1;
+ *y = context->y1;
+ uih_clearwindows(context);
+ context->zengine->action->convertup(context->zengine, x, y);
+ if ((context->minlong > MINCOUNT && context->c1 == BUTTON3) ||
+ !(pos > context->fcontext->rs.mc) ||
+ !(ypos > context->fcontext->rs.mi) ||
+ (pos1 >= context->fcontext->rs.mc) ||
+ (ypos1 >= context->fcontext->rs.mi) ||
+ context->fcontext->rs.mc - context->fcontext->rs.nc > 100.0 ||
+ isnan(pos) || isnan(ypos) || isnan(context->fcontext->s.cr) ||
+ isnan(context->fcontext->s.ci) ||
+ isnan(context->fcontext->s.rr - context->fcontext->s.ri) ||
+ context->fcontext->s.rr == 0 ||
+ context->fcontext->s.ri == 0 ||
+ isnan(context->fcontext->rs.mc - context->fcontext->rs.mi) ||
+ isnan(context->fcontext->rs.nc - context->fcontext->rs.ni)) {
+ again(context);
+ changed();
+ }
+ /*Are we waiting for better qualitty? */
+ if (!context->c1 && context->zengine->flags & UNCOMPLETTE) {
+ return;
+ }
+ assert(changed != NULL);
+ if (context->fcontext->version != context->autopilotversion)
+ clean_autopilot(context);
+ if (context->fcontext->rs.mc - context->fcontext->rs.nc <
+ context->minsize) {
+ context->minsize =
+ context->fcontext->rs.mc - context->fcontext->rs.nc;
+ context->minlong = 0;
+ } /*Oscilating prevention */
+ if (context->fcontext->rs.mc - context->fcontext->rs.nc >
+ context->maxsize) {
+ context->minsize =
+ context->fcontext->rs.mc - context->fcontext->rs.nc;
+ context->maxsize =
+ context->fcontext->rs.mc - context->fcontext->rs.nc;
+ context->minlong = 0;
+ }
+ if (context->autime <= 0) {
+ context->minlong++;
+ context->autime = rand() % MAXTIME;
+ if (context->zengine->flags & LOWQUALITY) {
+ context->c1 = 0;
+ } else {
+ switch (context->zengine->image->bytesperpixel) {
+ case 1:
+ c = look18(context, *x, *y, RANGE1, NGUESSES);
+ if (!c)
+ c = look28(context, *x, *y, RANGE1, NGUESSES);
+ if (!(rand() % 30))
+ c = 0;
+ if (!c)
+ c = look18(context, *x, *y, 10000, NGUESSES1);
+ if (!c)
+ c = look18(context, *x, *y, 10000, NGUESSES2);
+ break;
+#ifdef SUPPORT16
+ case 2:
+ c = look116(context, *x, *y, RANGE1, NGUESSES);
+ if (!c)
+ c = look216(context, *x, *y, RANGE1, NGUESSES);
+ if (!(rand() % 30))
+ c = 0;
+ if (!c)
+ c = look116(context, *x, *y, 10000, NGUESSES1);
+ if (!c)
+ c = look216(context, *x, *y, 10000, NGUESSES1);
+ break;
+#endif
+#ifdef STRUECOLOR24
+ case 3:
+ c = look124(context, *x, *y, RANGE1, NGUESSES);
+ if (!c)
+ c = look224(context, *x, *y, RANGE1, NGUESSES);
+ if (!(rand() % 30))
+ c = 0;
+ if (!c)
+ c = look124(context, *x, *y, 10000, NGUESSES1);
+ if (!c)
+ c = look224(context, *x, *y, 10000, NGUESSES1);
+ break;
+#endif
+ case 4:
+ c = look132(context, *x, *y, RANGE1, NGUESSES);
+ if (!c)
+ c = look232(context, *x, *y, RANGE1, NGUESSES);
+ if (!(rand() % 30))
+ c = 0;
+ if (!c)
+ c = look132(context, *x, *y, 10000, NGUESSES1);
+ if (!c)
+ c = look232(context, *x, *y, 10000, NGUESSES1);
+ }
+ if (!c) {
+ if ((context->zengine->flags & UNCOMPLETTE)) {
+ context->c1 = 0;
+ } else
+ context->c1 = BUTTON3, context->autime >>= 1;
+ }
+ }
+ }
+ context->autime -= times;
+ *x = context->x1;
+ *y = context->y1;
+ context->zengine->action->convertup(context->zengine, x, y);
+/* printf("%i %i\n",*x,*y); */
+ *controls = context->c1;
+}
diff --git a/src/ui-hlp/autopilot.h b/src/ui-hlp/autopilot.h
new file mode 100644
index 0000000..98a3794
--- /dev/null
+++ b/src/ui-hlp/autopilot.h
@@ -0,0 +1,33 @@
+
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifndef AUTOPILOT_H
+#define AUTOPILOT_H
+
+#include <config.h>
+#include <ui_helper.h>
+
+void do_autopilot(uih_context *, int *, int *, int *, void (*)(void),
+ int times);
+void clean_autopilot(uih_context *);
+
+#endif
diff --git a/src/ui-hlp/menu.c b/src/ui-hlp/menu.c
new file mode 100644
index 0000000..4980efc
--- /dev/null
+++ b/src/ui-hlp/menu.c
@@ -0,0 +1,1678 @@
+#ifndef _plan9_
+#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+#else
+#include <u.h>
+#include <libc.h>
+#endif
+
+#include <aconfig.h>
+#include <filter.h>
+#include <fconfig.h>
+#include <formulas.h>
+#include <ui_helper.h>
+#include <plane.h>
+#include <xmenu.h>
+#include "play.h"
+#ifdef HAVE_GETTEXT
+#include <libintl.h>
+#else
+#define gettext(STRING) STRING
+#endif
+
+#define LANG(name,name2) MENUSTRING("lang", NULL, name,name2,0, (void (*) (struct uih_context *c, char *))uih_loadcatalog, name2)
+#define TUTOR(name1,name2,name3) MENUSTRING(name1, NULL, name2,name3,MENUFLAG_INTERRUPT|UI,uih_playtutorial,name3)
+#define LANG_I(name,name2) MENUSTRING_I("lang", NULL, name,name2,0, (void (*) (struct uih_context *c, char *))uih_loadcatalog, name2)
+#define TUTOR_I(name1,name2,name3) MENUSTRING_I(name1, NULL, name2,name3,MENUFLAG_INTERRUPT|UI,uih_playtutorial,name3)
+
+CONST static char *CONST morphstypes[] = {
+ "view",
+ "julia",
+ "angle",
+ "line"
+};
+
+static CONST char *CONST imgtypes[] = {
+ "Truecolor",
+ "256 colors",
+ NULL
+};
+
+static CONST char *CONST yesno[] = {
+ "No",
+ "Yes",
+ NULL
+};
+
+CONST static char *CONST lineposs[] = {
+ "screen",
+ "scaled",
+ "fractal",
+ NULL
+};
+
+CONST char *CONST uih_colornames[] = {
+ "white",
+ "black",
+ "red",
+ NULL
+};
+
+/* Registering internationalized dialogs.
+ *
+ * The method we are internationalizing dialogs is similar to
+ * menu i18n. The original version of XaoS (without i18n)
+ * contained lots of static variables. Each row of a variable
+ * (which is a structure) contains a widget of a dialog.
+ * The last row contains NULL and 0 values to show
+ * that the dialog does not contain any other widgets.
+ *
+ * Here we are using a huge static variable which contains
+ * all widget from all dialogs. We copy each dialog after
+ * each other into this huge array. The original static
+ * variables will now be pointers pointing to the first
+ * row of the widget data from the appropriate line
+ * of the huge array.
+ *
+ * Note that in the first version there are only 2
+ * internationalized text, the rest will be "converted"
+ * continously (as I have enough time :-).
+ *
+ * Zoltan Kovacs <kovzol@math.u-szeged.hu>, 2003-01-05
+ */
+
+#define MAX_MENUDIALOGS_I18N 100
+#define Register(variable) variable = & menudialogs_i18n[no_menudialogs_i18n]
+static menudialog menudialogs_i18n[MAX_MENUDIALOGS_I18N];
+//static int no_menudialogs_i18n;
+
+static menudialog *uih_perturbationdialog, *uih_juliadialog,
+ *uih_smoothmorphdialog, *uih_renderdialog, *uih_viewdialog,
+ *uih_linedialog, *uih_colordialog, *uih_rotationdialog,
+ *uih_lettersdialog, *uih_iterdialog, *dtextparam, *dcommand,
+ *loaddialog, *playdialog, *saveimgdialog, *saveposdialog,
+ *uih_formuladialog, *uih_plviewdialog, *uih_coorddialog,
+ *uih_angledialog, *uih_autorotatedialog, *uih_fastrotatedialog,
+ *uih_filterdialog, *uih_shiftdialog, *uih_speeddialog, *printdialog,
+ *uih_bailoutdialog, *saveanimdialog, *uih_juliamodedialog,
+ *uih_textposdialog, *uih_fastmodedialog, *uih_timedialog,
+ *uih_numdialog, *uih_fpdialog, *palettedialog, *uih_cyclingdialog
+#ifdef SFFE_USING
+, *uih_sffedialog, *uih_sffeinitdialog
+#endif
+;
+
+extern char *xtextposnames[];
+extern char *ytextposnames[];
+
+
+void uih_registermenudialogs_i18n(void)
+{
+ int no_menudialogs_i18n = 0;
+
+/*
+ * The original code was:
+
+static menudialog uih_perturbationdialog[] = {
+ DIALOGCOORD ("Perturbation:", 0, 0),
+ {NULL}
+
+};
+
+ * Now first the static variable have to be registered (1),
+ * the widget must be inserted into the huge array (2),
+ * and the last row shows that no more widget comes (3).
+ */
+
+ Register(uih_perturbationdialog); // (1)
+ DIALOGCOORD_I(gettext("Perturbation:"), 0, 0); // (2)
+ NULL_I(); // (3)
+
+ Register(uih_juliadialog);
+ DIALOGCOORD_I(gettext("Julia-seed:"), 0, 0);
+ NULL_I();
+
+ Register(uih_smoothmorphdialog);
+ DIALOGCHOICE_I(gettext("Morphing type:"), morphstypes, 0);
+ DIALOGINT_I(gettext("Startuptime:"), 0);
+ DIALOGINT_I(gettext("Stoptime:"), 0);
+ NULL_I();
+
+ Register(uih_renderdialog);
+ DIALOGIFILE_I(gettext("File to render:"), "fract*.xaf");
+ DIALOGOFILE_I(gettext("Basename:"), "anim");
+ DIALOGINT_I(gettext("Width:"), 640);
+ DIALOGINT_I(gettext("Height:"), 480);
+ DIALOGFLOAT_I(gettext("Real width (cm):"), 29.0);
+ DIALOGFLOAT_I(gettext("Real height (cm):"), 21.0);
+ DIALOGFLOAT_I(gettext("Framerate:"), 30);
+ DIALOGCHOICE_I(gettext("Image type:"), imgtypes, 0);
+ DIALOGCHOICE_I(gettext("Antialiasing:"), yesno, 0);
+ DIALOGCHOICE_I(gettext("Always recalculate:"), yesno, 0);
+ DIALOGCHOICE_I(gettext("Calculate MPEG motion vectors:"), yesno, 0);
+ DIALOGINT_I(gettext("Recommended I frame distance:"), 27);
+ NULL_I();
+
+ Register(uih_viewdialog);
+ DIALOGCOORD_I(gettext("Center:"), 0, 0);
+ DIALOGFLOAT_I(gettext("Radius:"), 1);
+ DIALOGFLOAT_I(gettext("Angle:"), 0);
+ NULL_I();
+
+ Register(uih_linedialog);
+ DIALOGCHOICE_I(gettext("Mode:"), lineposs, 0);
+ DIALOGCOORD_I(gettext("Start:"), 0, 0);
+ DIALOGCOORD_I(gettext("End:"), 0, 0);
+ NULL_I();
+
+ Register(uih_colordialog);
+ DIALOGCHOICE_I(gettext("Color:"), uih_colornames, 0);
+ NULL_I();
+
+ Register(uih_rotationdialog);
+ DIALOGFLOAT_I(gettext("Rotations per second:"), 0);
+ NULL_I();
+
+ Register(uih_lettersdialog);
+ DIALOGINT_I(gettext("Letters per second:"), 0);
+ NULL_I();
+
+ Register(uih_iterdialog);
+ DIALOGINT_I(gettext("Iterations:"), 0);
+ NULL_I();
+
+ Register(dtextparam);
+ DIALOGSTR_I(gettext("Text:"), "");
+ NULL_I();
+
+ Register(dcommand);
+ DIALOGSTR_I(gettext("Your command:"), "");
+ NULL_I();
+
+ Register(loaddialog);
+ DIALOGIFILE_I(gettext("Filename:"), "fract*.xpf");
+ NULL_I();
+
+ Register(playdialog);
+ DIALOGIFILE_I(gettext("Filename:"), "anim*.xaf");
+ NULL_I();
+
+ Register(saveimgdialog);
+ DIALOGOFILE_I(gettext("Filename:"), "fract*.png");
+ NULL_I();
+
+ Register(saveposdialog);
+ DIALOGOFILE_I(gettext("Filename:"), "fract*.xpf");
+ NULL_I();
+
+ Register(uih_formuladialog);
+ DIALOGKEYSTR_I(gettext("Formula:"), "mandel");
+ NULL_I();
+
+ Register(uih_plviewdialog);
+ DIALOGFLOAT_I(gettext("X center:"), 0);
+ DIALOGFLOAT_I(gettext("Y center:"), 0);
+ DIALOGFLOAT_I(gettext("X Radius:"), 1);
+ DIALOGFLOAT_I(gettext("Y Radius:"), 1);
+ NULL_I();
+
+ Register(uih_coorddialog);
+ DIALOGCOORD_I(gettext("Coordinates:"), 0, 0);
+ NULL_I();
+
+ Register(uih_angledialog);
+ DIALOGFLOAT_I(gettext("Angle:"), 1);
+ NULL_I();
+
+ Register(uih_autorotatedialog);
+ DIALOGONOFF_I(gettext("continuous rotation"), 0);
+ NULL_I();
+
+ Register(uih_fastrotatedialog);
+ DIALOGONOFF_I(gettext("Fast rotation"), 0);
+ NULL_I();
+
+ Register(uih_filterdialog);
+ DIALOGKEYSTR_I(gettext("filter"), "");
+ DIALOGONOFF_I(gettext("enable"), 0);
+ NULL_I();
+
+ Register(uih_shiftdialog);
+ DIALOGINT_I(gettext("Amount:"), 0);
+ NULL_I();
+
+ Register(uih_speeddialog);
+ DIALOGFLOAT_I(gettext("Zooming speed:"), 0);
+ NULL_I();
+
+ Register(printdialog);
+ DIALOGSTR_I(gettext("Name:"), "");
+ NULL_I();
+
+ Register(uih_bailoutdialog);
+ DIALOGFLOAT_I(gettext("Bailout:"), 0);
+ NULL_I();
+
+ Register(saveanimdialog);
+ DIALOGOFILE_I(gettext("Filename:"), "anim*.xaf");
+ NULL_I();
+
+ Register(uih_juliamodedialog);
+ DIALOGONOFF_I(gettext("Julia mode:"), 0);
+ NULL_I();
+
+ Register(uih_textposdialog);
+ DIALOGCHOICE_I(gettext("Horizontal position:"), xtextposnames, 0);
+ DIALOGCHOICE_I(gettext("Vertical position:"), ytextposnames, 0);
+ NULL_I();
+
+ Register(uih_fastmodedialog);
+ DIALOGCHOICE_I(gettext("Dynamic resolution:"), save_fastmode, 0);
+ NULL_I();
+
+ Register(uih_timedialog);
+ DIALOGINT_I(gettext("Time:"), 0);
+ NULL_I();
+
+ Register(uih_numdialog);
+ DIALOGINT_I(gettext("Number:"), 0);
+ NULL_I();
+
+ Register(uih_fpdialog);
+ DIALOGFLOAT_I(gettext("Number:"), 0);
+ NULL_I();
+
+ Register(palettedialog);
+ DIALOGINT_I(gettext("Algorithm number:"), 0);
+ DIALOGINT_I(gettext("Seed:"), 0);
+ DIALOGINT_I(gettext("Shift:"), 0);
+ NULL_I();
+
+ Register(uih_cyclingdialog);
+ DIALOGINT_I(gettext("Frames per second:"), 0);
+ NULL_I();
+
+#ifdef SFFE_USING
+ Register(uih_sffedialog);
+ DIALOGSTR_I(gettext("Formula:"), "z^2+c");
+ NULL_I();
+
+ Register(uih_sffeinitdialog);
+ DIALOGSTR_I(gettext("Initialization:"), "");
+ NULL_I();
+#endif
+
+#ifdef DEBUG
+ printf("Filled %d widgets out of %d.\n",
+ no_menudialogs_i18n, MAX_MENUDIALOGS_I18N);
+#endif
+}
+
+#undef Register
+
+/*
+ * End of registering internationalized dialogs.
+ */
+
+#ifdef SFFE_USING
+void uih_sffein(uih_context * c, CONST char *text);
+void uih_sffeinitin(uih_context * c, CONST char *text);
+#endif
+
+static void uih_smoothmorph(struct uih_context *c, dialogparam * p)
+{
+ if (!c->playc)
+ return;
+ switch (p[0].dint) {
+ case 0:
+ c->playc->morphtimes[0] = p[1].dint;
+ c->playc->morphtimes[1] = p[2].dint;
+ break;
+ case 1:
+ c->playc->morphjuliatimes[0] = p[1].dint;
+ c->playc->morphjuliatimes[1] = p[2].dint;
+ break;
+ case 2:
+ c->playc->morphangletimes[0] = p[1].dint;
+ c->playc->morphangletimes[1] = p[2].dint;
+ break;
+ case 3:
+ c->playc->morphlinetimes[0] = p[1].dint;
+ c->playc->morphlinetimes[1] = p[2].dint;
+ break;
+ }
+}
+
+static void uih_render(struct uih_context *c, dialogparam * d)
+{
+#ifdef MACOSX
+ /*
+ * On Mac OS X, we must ensure basename specifies an absolute path in order
+ * to prevent png files from being rendered to the root directory.
+ */
+ if (d[1].dstring[0] != '/') {
+ uih_error(c,
+ gettext
+ ("renderanim: Must specify a valid absolute path for basename"));
+ return;
+ }
+#endif
+ if (d[2].dint <= 0 || d[2].dint > 4096) {
+ uih_error(c,
+ gettext
+ ("renderanim: Width parameter must be positive integer in the range 0..4096"));
+ return;
+ }
+ if (d[3].dint <= 0 || d[3].dint > 4096) {
+ uih_error(c,
+ gettext
+ ("renderanim: Height parameter must be positive integer in the range 0..4096"));
+ return;
+ }
+ if (d[4].number <= 0 || d[5].number <= 0) {
+ uih_error(c,
+ gettext
+ ("renderanim: Invalid real width and height dimensions"));
+ return;
+ }
+ if (d[6].number <= 0 || d[6].number >= 1000000) {
+ uih_error(c, gettext("renderanim: invalid framerate"));
+ return;
+ }
+ if (d[7].dint && d[8].dint) {
+ uih_error(c,
+ gettext
+ ("renderanim: antialiasing not supported in 256 color mode"));
+ return;
+ }
+ if (d[11].dint <= 0 || d[11].dint >= 1000000) {
+ uih_error(c, gettext("renderanim: incorrect I frame distance"));
+ return;
+ }
+ uih_renderanimation(c, d[1].dstring, (xio_path) d[0].dstring,
+ d[2].dint, d[3].dint, d[4].number / d[2].dint,
+ d[5].number / d[3].dint,
+ (int) (1000000 / d[6].number),
+#ifdef STRUECOLOR24
+ d[7].dint ? C256 : TRUECOLOR24,
+#else
+ d[7].dint ? C256 : TRUECOLOR,
+#endif
+ d[8].dint, d[9].dint, c->letterspersec, NULL,
+ d[10].dint, d[11].dint);
+}
+
+static menudialog *uih_getcolordialog(struct uih_context *c)
+{
+ if (c != NULL) {
+ uih_colordialog[0].defint = c->color;
+ }
+ return (uih_colordialog);
+}
+
+static void uih_setcolor(struct uih_context *c, int color)
+{
+ c->color = color;
+}
+
+
+static menudialog *uih_getperturbationdialog(struct uih_context *c)
+{
+ if (c != NULL) {
+ uih_perturbationdialog[0].deffloat = c->fcontext->bre;
+ uih_perturbationdialog[0].deffloat2 = c->fcontext->bim;
+ }
+ return (uih_perturbationdialog);
+}
+
+static menudialog *uih_getjuliadialog(struct uih_context *c)
+{
+ if (c != NULL) {
+ uih_juliadialog[0].deffloat = c->fcontext->pre;
+ uih_juliadialog[0].deffloat2 = c->fcontext->pim;
+ }
+ return (uih_juliadialog);
+}
+
+static void uih_plview(struct uih_context *c, dialogparam * d)
+{
+ if (d[2].number <= 0 || d[3].number <= 0) {
+ uih_error(c, gettext("animateview: Invalid viewpoint"));
+ return;
+ }
+ c->fcontext->s.cr = d[0].number;
+ c->fcontext->s.ci = d[1].number;
+ c->fcontext->s.rr = d[2].number;
+ c->fcontext->s.ri = d[3].number;
+ uih_newimage(c);
+}
+
+static void uih_plview2(struct uih_context *c, dialogparam * d)
+{
+ if (d[2].number <= 0 || d[3].number <= 0) {
+ uih_error(c, gettext("animateview: Invalid viewpoint"));
+ return;
+ }
+ c->fcontext->s.cr = d[0].number;
+ c->fcontext->s.ci = d[1].number;
+ c->fcontext->s.rr = d[2].number;
+ c->fcontext->s.ri = d[3].number;
+ uih_animate_image(c);
+}
+
+static void uih_dview(struct uih_context *c, dialogparam * d)
+{
+ if (d[1].number <= 0) {
+ uih_error(c, gettext("Invalid viewpoint"));
+ return;
+ }
+ c->fcontext->s.cr = d[0].dcoord[0];
+ c->fcontext->s.ci = d[0].dcoord[1];
+ c->fcontext->s.rr = d[1].number;
+ c->fcontext->s.ri = d[1].number;
+ uih_angle(c, d[2].number);
+ uih_newimage(c);
+}
+
+static menudialog *uih_getviewdialog(struct uih_context *c)
+{
+ number_t xs, ys;
+ if (c != NULL) {
+ xs = c->fcontext->s.rr;
+ ys = c->fcontext->s.ri * c->fcontext->windowwidth /
+ c->fcontext->windowheight;
+ uih_viewdialog[0].deffloat = c->fcontext->s.cr;
+ uih_viewdialog[0].deffloat2 = c->fcontext->s.ci;
+ uih_viewdialog[2].deffloat = c->fcontext->angle;
+ if (xs > ys)
+ uih_viewdialog[1].deffloat = c->fcontext->s.rr;
+ else
+ uih_viewdialog[1].deffloat = c->fcontext->s.ri;
+ }
+ return (uih_viewdialog);
+}
+
+static void uih_printdialog(struct uih_context *c, CONST char *name)
+{
+ CONST menuitem *item = menu_findcommand(name);
+ int y;
+ CONST menudialog *di;
+ if (item == NULL) {
+ fprintf(stderr, "print_dialog:unknown function %s\n", name);
+ return;
+ }
+ if (item->type != MENU_DIALOG && item->type != MENU_CUSTOMDIALOG) {
+ fprintf(stderr, "print_dialog:%s don't have any dialog. Sorry.\n",
+ name);
+ return;
+ }
+ di = menu_getdialog(c, item);
+ if (item->type == MENU_CUSTOMDIALOG)
+ printf("customdialog \"%s\"\n", item->shortname);
+ else
+ printf("dialog \"%s\"\n", item->shortname);
+ for (y = 0; di[y].question != NULL; y++) {
+ printf("dialogentry \"%s\" ", di[y].question);
+ switch (di[y].type) {
+ case DIALOG_INT:
+ printf("integer %i", di->defint);
+ break;
+ case DIALOG_FLOAT:
+ printf("float %f", (double) di->deffloat);
+ break;
+ case DIALOG_STRING:
+ printf("string \"%s\"", di->defstr);
+ case DIALOG_KEYSTRING:
+ printf("keyword \"%s\"", di->defstr);
+ break;
+ case DIALOG_IFILE:
+ printf("inputfile \"%s\"", di->defstr);
+ break;
+ case DIALOG_OFILE:
+ printf("outputfile \"%s\"", di->defstr);
+ break;
+ case DIALOG_ONOFF:
+ printf("onoff %s", di->defint ? "#t" : "#f");
+ break;
+ case DIALOG_COORD:
+ printf("complex %f %f", (double) di->deffloat,
+ (double) di->deffloat2);
+ break;
+ case DIALOG_CHOICE:
+ printf("choice {");
+ {
+ int y;
+ CONST char **str = (CONST char **) di->defstr;
+ for (y = 0; str[y] != NULL; y++)
+ printf("%s ", str[y]);
+ printf("}");
+ printf("%s ", str[di->defint]);
+ }
+ break;
+ }
+ printf("\n");
+ }
+ printf("enddialog\n");
+}
+
+static void
+uih_printmenu(struct uih_context *c, CONST char *name, int recursive)
+{
+ CONST char *fullname;
+ int i = 0;
+ CONST menuitem *item;
+ if ((fullname = menu_fullname(name)) == NULL) {
+ printf("Menu not found\n");
+ return;
+ }
+ printf("\n\nmenu \"%s\" \"%s\"\n", fullname, name);
+ for (i = 0; (item = menu_item(name, i)) != NULL; i++) {
+ if (item->type == MENU_SUBMENU) {
+ printf("submenu \"%s\" \"%s\"\n", item->name, item->shortname);
+ continue;
+ }
+ if (item->type == MENU_SUBMENU) {
+ printf("separator");
+ continue;
+ }
+ printf("menuentry \"%s\" \"%s\" ", item->name, item->shortname);
+ if (item->flags & MENUFLAG_RADIO)
+ printf("radio %s", menu_enabled(item, c) ? "on" : "off");
+ else if (item->flags & MENUFLAG_CHECKBOX)
+ printf("checkbox %s", menu_enabled(item, c) ? "on" : "off");
+ else
+ printf("normal");
+ if (item->flags & MENUFLAG_DIALOGATDISABLE)
+ printf(" dialogatdisable");
+ if (item->type == MENU_DIALOG || item->type == MENU_CUSTOMDIALOG)
+ printf(" dialog");
+ printf("\n");
+ }
+ printf("endmenu\n");
+ if (recursive)
+ for (i = 0; (item = menu_item(name, i)) != NULL; i++) {
+ if (item->type == MENU_SUBMENU) {
+ uih_printmenu(c, item->shortname, 1);
+ }
+ }
+}
+
+static void uih_printmenuwr(struct uih_context *c, CONST char *name)
+{
+ uih_printmenu(c, name, 0);
+}
+
+static void uih_printallmenus(struct uih_context *c)
+{
+ uih_printmenu(c, "root", 1);
+ uih_printmenu(c, "animroot", 1);
+ printf("endmenu\n");
+}
+
+static menudialog *uih_getlettersdialog(struct uih_context *c)
+{
+ if (c != NULL)
+ uih_lettersdialog[0].defint = c->letterspersec;
+ return (uih_lettersdialog);
+}
+
+static menudialog *uih_getiterdialog(struct uih_context *c)
+{
+ if (c != NULL)
+ uih_iterdialog[0].defint = c->fcontext->maxiter;
+ return (uih_iterdialog);
+}
+
+static menudialog *uih_getbailoutdialog(struct uih_context *c)
+{
+ if (c != NULL)
+ uih_bailoutdialog[0].deffloat = c->fcontext->bailout;
+ return (uih_bailoutdialog);
+}
+
+static int uih_saveanimenabled(struct uih_context *c)
+{
+ if (c == NULL)
+ return 0;
+ return (c->save);
+}
+
+
+
+static menudialog *uih_getrotationdialog(struct uih_context *c)
+{
+ if (c != NULL)
+ uih_rotationdialog[0].deffloat = c->rotationspeed;
+ return (uih_rotationdialog);
+}
+
+static menudialog *uih_getpalettedialog(struct uih_context *uih)
+{
+ if (uih != NULL) {
+ palettedialog[0].defint = uih->palettetype;
+ palettedialog[1].defint = uih->paletteseed;
+ palettedialog[2].defint =
+ uih->paletteshift + uih->manualpaletteshift;
+ }
+ return (palettedialog);
+}
+
+static menudialog *uih_getcyclingdialog(struct uih_context *uih)
+{
+ if (uih != NULL)
+ uih_cyclingdialog[0].defint = uih->cyclingspeed * uih->direction;
+ return (uih_cyclingdialog);
+}
+
+static menudialog *uih_getspeeddialog(struct uih_context *uih)
+{
+ if (uih != NULL)
+ uih_speeddialog[0].deffloat = uih->speedup / STEP;
+ return (uih_speeddialog);
+}
+
+static void uih_setspeed(uih_context * c, number_t p)
+{
+ if (p >= 100)
+ p = 1.0;
+ if (p < 0)
+ p = 0;
+ c->speedup = STEP * p;
+ c->maxstep = MAXSTEP * p;
+
+}
+
+static void uih_palette(struct uih_context *uih, dialogparam * p)
+{
+ int n1 = p[0].dint;
+ int n2 = p[1].dint;
+ int shift = p[2].dint;
+ if (!n1) {
+ uih_playdefpalette(uih, shift);
+ return;
+ }
+ if (n1 < 1 || n1 > PALGORITHMS) {
+ uih_error(uih, gettext("Unknown palette type"));
+ }
+ if (uih->zengine->fractalc->palette == NULL)
+ return;
+ if (mkpalette(uih->zengine->fractalc->palette, n2, n1 - 1) != 0) {
+ uih_newimage(uih);
+ }
+ uih->manualpaletteshift = 0;
+ uih->palettetype = n1;
+ uih->palettechanged = 1;
+ uih->paletteseed = n2;
+ if (shiftpalette(uih->zengine->fractalc->palette, shift)) {
+ uih_newimage(uih);
+ }
+ uih->paletteshift = shift;
+}
+
+static int uih_rotateselected(struct uih_context *c, int n)
+{
+ if (c == NULL)
+ return 0;
+ if (!c->fastrotate)
+ return !n;
+ return (c->rotatemode == n);
+}
+
+static int uih_guessingselected(struct uih_context *c, int n)
+{
+ if (c == NULL)
+ return 0;
+ return (c->fcontext->range == n);
+}
+
+static int uih_fastmode(struct uih_context *c, int n)
+{
+ if (c == NULL)
+ return 0;
+ return (c->fastmode == n);
+}
+
+static int uih_periodicityselected(struct uih_context *c)
+{
+ if (c == NULL)
+ return 0;
+ return (c->fcontext->periodicity);
+}
+
+static void uih_periodicitysw(struct uih_context *c)
+{
+ uih_setperiodicity(c, c->fcontext->periodicity ^ 1);
+}
+
+static int uih_cyclingselected(struct uih_context *c)
+{
+ if (c == NULL)
+ return 0;
+ return (c->cycling && c->cyclingdirection == 1);
+}
+
+static int uih_rcyclingselected(struct uih_context *c)
+{
+ if (c == NULL)
+ return 0;
+ return (c->cycling && c->cyclingdirection == -1);
+}
+
+static void uih_cyclingsw(struct uih_context *c)
+{
+ // Andrew Stone: this fixes what I consider a bug - switching from Y to y should keep cycling:
+ if (c->cycling && c->cyclingdirection == -1)
+ uih_cycling_off(c);
+ c->cyclingdirection = 1;
+ if (c->cycling)
+ uih_cycling_off(c);
+ else if (!uih_cycling_on(c))
+ uih_error(c, gettext("Initialization of color cycling failed.")),
+ uih_message(c,
+ gettext("Try to enable palette emulation filter"));
+}
+
+static void uih_rcyclingsw(struct uih_context *c)
+{
+ // Andrew Stone: this fixes what I consider a bug - switching from y to Y should keep cycling:
+ if (c->cycling && c->cyclingdirection == 1)
+ uih_cycling_off(c);
+ c->cyclingdirection = -1;
+ if (c->cycling)
+ uih_cycling_off(c);
+ else if (!uih_cycling_on(c))
+ uih_error(c, gettext("Initialization of color cycling failed.")),
+ uih_message(c,
+ gettext("Try to enable palette emulation filter"));
+}
+
+static void uih_juliasw(struct uih_context *c)
+{
+ if (!c->juliamode)
+ uih_enablejulia(c);
+ else
+ uih_disablejulia(c);
+}
+
+static int uih_juliaselected(struct uih_context *c)
+{
+ if (c == NULL)
+ return 0;
+ return (c->juliamode);
+}
+
+static int uih_mandelbrotselected(struct uih_context *c)
+{
+ if (c == NULL)
+ return 0;
+ return (c->fcontext->mandelbrot);
+}
+
+static void uih_mandelbrotsw(struct uih_context *c, number_t x, number_t y)
+{
+ c->fcontext->mandelbrot ^= 1;
+ if (c->fcontext->mandelbrot == 0 && !c->juliamode) {
+ c->fcontext->pre = x;
+ c->fcontext->pim = y;
+ } else
+ uih_disablejulia(c);
+ c->fcontext->version++;
+ uih_newimage(c);
+ uih_updatemenus(c, "uimandelbrot");
+}
+
+static int uih_autopilotselected(struct uih_context *c)
+{
+ if (c == NULL)
+ return 0;
+ return (c->autopilot);
+}
+
+static int uih_fixedstepselected(struct uih_context *c)
+{
+ if (c == NULL)
+ return 0;
+ return (c->fixedstep);
+}
+
+static void uih_persw(struct uih_context *c, number_t x, number_t y)
+{
+ if (c->fcontext->bre || c->fcontext->bim)
+ uih_setperbutation(c, 0.0, 0.0);
+ else
+ uih_setperbutation(c, x, y);
+ // printf(""); // fixme: some newer versions of gcc crashes without this
+}
+
+static int uih_perselected(struct uih_context *c)
+{
+ if (c == NULL)
+ return 0;
+ return (c->fcontext->bre || c->fcontext->bim);
+}
+
+static void uih_autopilotsw(struct uih_context *c)
+{
+ if (c->autopilot)
+ uih_autopilot_off(c);
+ else
+ uih_autopilot_on(c);
+}
+
+static void uih_fixedstepsw(struct uih_context *c)
+{
+ c->fixedstep ^= 1;
+}
+
+static void uih_setxtextpos(uih_context * c, int p)
+{
+ uih_settextpos(c, p, c->ytextpos);
+}
+
+static int uih_xtextselected(uih_context * c, int p)
+{
+ if (c == NULL)
+ return 0;
+ return (c->xtextpos == p);
+}
+
+static void uih_setytextpos(uih_context * c, int p)
+{
+ uih_settextpos(c, c->xtextpos, p);
+}
+
+static int uih_ytextselected(uih_context * c, int p)
+{
+ if (c == NULL)
+ return 0;
+ return (c->ytextpos == p);
+}
+
+static void uih_menumkpalette(uih_context * c)
+{
+ char s[256];
+ uih_mkpalette(c);
+ sprintf(s, gettext("Algorithm:%i seed:%i size:%i"), c->palettetype,
+ c->paletteseed, c->zengine->fractalc->palette->size);
+ uih_message(c, s);
+}
+
+static void uih_shiftpalette(uih_context * c, int shift)
+{
+ if (shiftpalette(c->zengine->fractalc->palette, shift)) {
+ uih_newimage(c);
+ }
+ c->manualpaletteshift += shift;
+}
+
+static void uih_fshift(uih_context * c)
+{
+ uih_shiftpalette(c, 1);
+}
+
+static void uih_bshift(uih_context * c)
+{
+ uih_shiftpalette(c, -1);
+}
+
+static CONST menuitem *menuitems; /*XaoS menu specifications */
+/* This structure is now empty. All static definitions have been moved
+ to uih_registermenus_i18n() which fills up its own static array. */
+
+
+/* Registering internationalized menus. See also include/xmenu.h
+ for details. Note that MAX_MENUITEMS_I18N should be increased
+ if more items will be added in future.
+
+ On 2006-07-12 J.B. Langston wrote:
+
+ The menu.c.diff file changes the MAX_MENUITEMS_I18N macro from
+ 200 to 250. As of 3.2.1, the number of allocated menu items had
+ been exceeded (there are 201 menu items now). This was causing
+ the memory within the application to be clobbered, resulting
+ in subtle bugs on the PowerPC platform (both X11 and OSX drivers).
+ For example, rendering animations generated a segmentation fault.
+ It's quite possible it could have been causing other subtle bugs
+ elsewhere in the program. */
+
+#define MAX_MENUITEMS_I18N 250
+static menuitem menuitems_i18n[MAX_MENUITEMS_I18N];
+int uih_no_menuitems_i18n;
+
+void uih_registermenus_i18n(void)
+{
+ // Special version (currently it's OK):
+ int no_menuitems_i18n = 0;
+ SUBMENU_I("", NULL, gettext("Root menu"), "root");
+ SUBMENU_I("", NULL, gettext("Animation root menu"), "animroot");
+ SUBMENU_I("", NULL, gettext("Replay only commands"), "plc");
+ SUBMENU_I("", NULL, gettext("Command line options only"), "comm");
+#define MP (MENUFLAG_NOMENU|MENUFLAG_NOPLAY|MENUFLAG_ATSTARTUP)
+ MENUNOP_I("comm", NULL,
+ gettext("print menus specifications of all menus"),
+ "print_menus", MP, uih_printallmenus);
+ MENUDIALOG_I("comm",
+ NULL,
+ gettext
+ ("print menu specification"),
+ "print_menu", MP, uih_printmenuwr, printdialog);
+ MENUDIALOG_I("comm", NULL,
+ gettext("print menu specification in xshl format"),
+ "xshl_print_menu", MP, uih_xshlprintmenu, printdialog);
+ MENUNOP_I("comm", NULL,
+ gettext
+ ("print all menu specifications in xshl format"),
+ "xshl_print_menus", MP, uih_xshlprintmenus);
+ MENUDIALOG_I("comm", NULL, gettext("print dialog specification"),
+ "print_dialog", MP, uih_printdialog, printdialog);
+#undef MP
+#define MP (MENUFLAG_NOMENU|MENUFLAG_NOOPTION)
+ /* Commands suitable only for animation replay */
+ SUBMENU_I("plc", NULL, gettext("Line drawing functions"), "linemenu");
+ MENUDIALOG_I("linemenu", NULL, gettext("Line"), "line", MP, uih_line,
+ uih_linedialog);
+ MENUDIALOG_I("linemenu", NULL,
+ gettext("Morph line"),
+ "morphline", MP, uih_morphline, uih_linedialog);
+ MENUDIALOG_I("linemenu", NULL, gettext("Morph last line"),
+ "morphlastline", MP, uih_morphlastline, uih_linedialog);
+ MENUDIALOG_I("linemenu", NULL,
+ gettext("Set line key"),
+ "linekey", MP, uih_setkey, uih_numdialog);
+ MENUNOP_I("linemenu", NULL, gettext("Clear line"), "clearline", MP,
+ uih_clear_line);
+ MENUNOP_I("linemenu", NULL,
+ gettext("Clear all lines"), "clearlines", MP,
+ uih_clear_lines);
+ SUBMENU_I("plc", NULL, gettext("Animation functions"), "animf");
+ MENUDIALOG_I("animf", NULL, gettext("View"), "animateview", MP,
+ uih_plview2, uih_plviewdialog);
+ MENUDIALOG_I("animf", NULL,
+ gettext
+ ("Morph view"),
+ "morphview", MP, uih_playmorph, uih_plviewdialog);
+ MENUDIALOG_I("animf", NULL, gettext("Morph julia"), "morphjulia", MP,
+ uih_playmorphjulia, uih_coorddialog);
+ MENUDIALOG_I("animf",
+ NULL,
+ gettext
+ ("Move view"), "moveview", MP, uih_playmove,
+ uih_coorddialog);
+ MENUDIALOG_I("animf", NULL, gettext("Morph angle"), "morphangle", MP,
+ uih_playmorphangle, uih_angledialog);
+ MENUDIALOG_I("animf", NULL, gettext("Zoom center"), "zoomcenter", MP,
+ uih_zoomcenter, uih_coorddialog);
+ MENUNOP_I("animf", NULL, gettext("Zoom"), "zoom", MP, uih_playzoom);
+ MENUNOP_I("animf", NULL, gettext("Un-zoom"),
+ "unzoom", MP, uih_playunzoom);
+ MENUNOP_I("animf",
+ NULL, gettext("Stop zooming"), "stop", MP, uih_playstop);
+ MENUDIALOG_I("animf", NULL, gettext("Smooth morphing parameters"),
+ "smoothmorph", MP, uih_smoothmorph,
+ uih_smoothmorphdialog);
+ SUBMENU_I("plc", NULL, gettext("Timing functions"), "time");
+ MENUDIALOG_I("time", NULL, gettext("Usleep"), "usleep", MP,
+ uih_playusleep, uih_timedialog);
+ MENUNOP_I("time", NULL,
+ gettext("Wait for text"), "textsleep", MP,
+ uih_playtextsleep);
+ MENUNOP_I("time", NULL, gettext("Wait for complete image"), "wait", MP,
+ uih_playwait);
+ MENUDIALOG_I("plc", NULL, gettext("Include file"), "load", MP,
+ uih_playload, loaddialog);
+ MENUDIALOG_I("palette", NULL, gettext("Default palette"),
+ "defaultpalette", MP, uih_playdefpalette, uih_numdialog);
+ MENUDIALOG_I("fractal", NULL, gettext("Formula"), "formula", MP,
+ uih_play_formula, uih_formuladialog);
+ MENUDIALOG_I("ui", NULL, gettext("Maximal zooming step"), "maxstep",
+ MP, uih_setmaxstep, uih_fpdialog);
+ MENUDIALOG_I("ui", NULL, gettext("Zooming speedup"), "speedup", MP,
+ uih_setspeedup, uih_fpdialog);
+ MENUDIALOG_I("mfilter", NULL, gettext("Filter"), "filter", MP,
+ uih_playfilter, uih_filterdialog);
+#undef MP
+#define UI (MENUFLAG_NOPLAY|MENUFLAG_NOOPTION)
+ MENUCDIALOG_I("ui", NULL, gettext("Letters per second"),
+ "letterspersec", MENUFLAG_NOMENU, uih_letterspersec,
+ uih_getlettersdialog);
+ MENUCDIALOG_I("uia", NULL,
+ gettext
+ ("Letters per second"),
+ "letters", UI, uih_letterspersec, uih_getlettersdialog);
+ MENUNOP_I("uia", "z", gettext("Interrupt"), "animinterrupt",
+ MENUFLAG_INTERRUPT | MENUFLAG_INCALC, uih_interrupt);
+ SUBMENU_I("root", "s", gettext("File"), "file");
+ SUBMENU_I("root", NULL, gettext("Edit"), "edit");
+ SUBMENU_I("root", NULL, gettext("Fractal"), "fractal");
+ SUBMENU_I("root", NULL, gettext("Calculation"), "calc");
+ SUBMENU_I("root", "e", gettext("Filters"), "mfilter");
+ SUBMENU_I("root", NULL, gettext("UI"), "ui");
+ SUBMENU_I("root", NULL, gettext("Misc"), "misc");
+#ifdef MACOSX
+ SUBMENU_I("root", NULL, gettext("Window"), "window");
+#endif
+ SUBMENU_I("root", NULL, gettext("Help"), "helpmenu");
+ SUBMENU_I("helpmenu", NULL, gettext("Tutorials"),
+ "tutor") SUBMENUNOOPT_I("animroot", "f", gettext("File"),
+ "file");
+ // You cannot have menu items directly on the root menu in some OS
+ // So we put the "Stop Replay" item in the UI menu instead
+ MENUSEPARATOR_I("uia");
+ MENUNOP_I("uia", "s", gettext("Stop replay"), "stopreplay",
+ UI | MENUFLAG_INTERRUPT, uih_replaydisable);
+ SUBMENUNOOPT_I("animroot", NULL, gettext("UI"), "uia");
+ SUBMENUNOOPT_I("animroot", NULL, gettext("Help"), "helpmenu");
+ MENUDIALOG_I("misc", "!", gettext("Command"), "command", UI,
+ uih_command, dcommand);
+ MENUDIALOG_I("misc", NULL, gettext("Play string"), "playstr",
+ MENUFLAG_NOMENU, uih_playstr, dcommand);
+ MENUDIALOG_I("misc", NULL, gettext("Render animation"), "renderanim",
+ UI, uih_render, uih_renderdialog);
+ MENUSEPARATOR_I("misc");
+ MENUNOP_I("misc", NULL, gettext("Clear screen"), "clearscreen",
+ MENUFLAG_NOOPTION, uih_clearscreen);
+ MENUNOP_I("misc", NULL, gettext("Display fractal"), "display",
+ MENUFLAG_NOOPTION, uih_display);
+ MENUSEPARATOR_I("misc");
+ MENUDIALOG_I("misc", NULL, gettext("Display text"), "text", 0, uih_text, dtextparam); /*FIXME: Should allow multiline */
+
+ MENUCDIALOG_I("misc", NULL, gettext("Color"), "color", 0, uih_setcolor,
+ uih_getcolordialog);
+ SUBMENU_I("misc", NULL, gettext("Horizontal text position"),
+ "xtextpos");
+ SUBMENU_I("misc", NULL, gettext("Vertical text position"), "ytextpos");
+ MENUDIALOG_I("misc", NULL,
+ gettext("Text position"),
+ "textposition",
+ MENUFLAG_NOMENU | MENUFLAG_INCALC,
+ uih_playtextpos, uih_textposdialog);
+ MENUDIALOG_I("misc", NULL, gettext("Message"), "message",
+ MENUFLAG_NOMENU, uih_playmessage, dtextparam);
+ /* The following 6 menu options should not be translated. The example
+ files heavily use these constants and lots of examples will not work
+ anymore... :-( Anyway, this should be fixed somehow. */
+
+ MENUINTRB_I("ytextpos", NULL, "Up", "ytextup", UI, uih_setytextpos,
+ UIH_TEXTTOP, uih_ytextselected);
+ MENUINTRB_I("ytextpos",
+ NULL, "Middle",
+ "ytextmiddle",
+ UI, uih_setytextpos, UIH_TEXTMIDDLE, uih_ytextselected);
+ MENUINTRB_I("ytextpos", NULL, "Bottom", "ytextbottom", UI,
+ uih_setytextpos, UIH_TEXTBOTTOM, uih_ytextselected);
+ MENUINTRB_I("xtextpos", NULL, "Left",
+ "xtextleft", UI,
+ uih_setxtextpos, UIH_TEXTLEFT, uih_xtextselected);
+ MENUINTRB_I("xtextpos", NULL, "Center", "xtextcenter", UI,
+ uih_setxtextpos, UIH_TEXTCENTER, uih_xtextselected);
+ MENUINTRB_I("xtextpos", NULL, "Right",
+ "xtexteight", UI,
+ uih_setxtextpos, UIH_TEXTRIGHT, uih_xtextselected);
+ MENUDIALOG_I("file", NULL, gettext("Load"), "loadpos",
+ MENUFLAG_INTERRUPT | MENUFLAG_NOPLAY, uih_loadfile,
+ loaddialog);
+ MENUDIALOG_I("file", NULL, gettext("Save"),
+ "savepos", 0, uih_saveposfile, saveposdialog);
+ MENUSEPARATOR_I("file") MENUDIALOGCB_I("file", NULL, gettext("Record"),
+ "record", 0, uih_saveanimfile,
+ saveanimdialog,
+ uih_saveanimenabled);
+ MENUDIALOG_I("file", NULL, gettext("Replay"), "play",
+ MENUFLAG_INTERRUPT | MENUFLAG_NOPLAY, uih_playfile,
+ playdialog);
+ MENUSEPARATOR_I("file");
+ MENUDIALOG_I("file",
+ NULL,
+ gettext
+ ("Save image"), "saveimg", 0, uih_savepngfile,
+ saveimgdialog);
+ MENUNOP_I("file", NULL, gettext("Load random example"), "loadexample",
+ MENUFLAG_INTERRUPT, uih_loadexample);
+ MENUNOP_I("file", NULL, gettext("Save configuration"), "savecfg", 0,
+ uih_savecfg);
+#ifndef MACOSX
+ MENUSEPARATOR_I("file");
+#endif
+ MENUNOP_I("edit", "u", gettext("Undo"), "undo",
+ MENUFLAG_INTERRUPT | MENUFLAG_NOPLAY |
+ MENUFLAG_NOOPTION, uih_undo);
+ MENUNOP_I("edit", NULL,
+ gettext("Redo"),
+ "redo",
+ MENUFLAG_INTERRUPT
+ | MENUFLAG_NOPLAY | MENUFLAG_NOOPTION, uih_redo);
+ SUBMENU_I("fractal", NULL, gettext("Formulae"), "mformula");
+ SUBMENU_I("fractal", NULL, gettext("More formulae"), "oformula");
+
+#ifdef SFFE_USING
+ /*FIXME: Should allow multiline */
+ MENUSEPARATOR_I("fractal");
+ MENUDIALOG_I("fractal", NULL, gettext("User formula"), "usrform", 0,
+ uih_sffein, uih_sffedialog);
+ MENUDIALOG_I("fractal", NULL, gettext("User initialization"),
+ "usrformInit", 0, uih_sffeinitin, uih_sffeinitdialog);
+#endif
+
+ MENUSEPARATOR_I("fractal");
+ SUBMENU_I("fractal", "f", gettext("Incoloring mode"), "mincoloring");
+ SUBMENU_I("fractal", "c", gettext("Outcoloring mode"), "moutcoloring");
+ SUBMENU_I("fractal", "i", gettext("Plane"), "mplane");
+ SUBMENU_I("fractal", NULL, gettext("Palette"), "palettemenu");
+ MENUSEPARATOR_I("fractal");
+ MENUCDIALOGCB_I("fractal", "m",
+ gettext("Mandelbrot mode"),
+ "uimandelbrot",
+ MENUFLAG_DIALOGATDISABLE |
+ MENUFLAG_INTERRUPT | UI,
+ uih_mandelbrotsw,
+ uih_getjuliadialog, uih_mandelbrotselected);
+ MENUCDIALOGCB_I("fractal", "b", gettext("Perturbation"),
+ "uiperturbation", MENUFLAG_INTERRUPT | UI, uih_persw,
+ uih_getperturbationdialog, uih_perselected);
+ MENUCDIALOG_I("fractal", NULL,
+ gettext("Perturbation"),
+ "perturbation",
+ MENUFLAG_NOMENU |
+ MENUFLAG_INTERRUPT,
+ uih_setperbutation, uih_getperturbationdialog);
+ MENUSEPARATOR_I("fractal");
+ MENUCDIALOG_I("fractal", NULL,
+ gettext("View"), "uiview",
+ MENUFLAG_INTERRUPT | UI, uih_dview, uih_getviewdialog);
+ MENUSEPARATOR_I("fractal");
+ MENUNOP_I("fractal", NULL,
+ gettext("Reset to defaults"), "initstate", 0, uih_initstate);
+ MENUDIALOG_I("fractal", NULL, gettext("Julia mode"), "julia",
+ MENUFLAG_NOMENU | MENUFLAG_INTERRUPT, uih_playjulia,
+ uih_juliamodedialog);
+ MENUDIALOG_I("fractal", NULL,
+ gettext("View"), "view",
+ MENUFLAG_NOMENU |
+ MENUFLAG_INTERRUPT, uih_plview, uih_plviewdialog);
+ MENUDIALOG_I("fractal", NULL, gettext("Set angle"), "angle",
+ MENUFLAG_NOMENU | MENUFLAG_INTERRUPT, uih_angle,
+ uih_angledialog);
+ MENUDIALOG_I("fractal", NULL,
+ gettext("Set plane"),
+ "plane",
+ MENUFLAG_NOMENU |
+ MENUFLAG_INTERRUPT, uih_setplane, uih_numdialog);
+ MENUDIALOG_I("fractal", NULL, gettext("Inside coloring mode"),
+ "incoloring", MENUFLAG_NOMENU | MENUFLAG_INTERRUPT,
+ uih_setincoloringmode, uih_numdialog);
+ MENUDIALOG_I("fractal", NULL,
+ gettext
+ ("Outside coloring mode"),
+ "outcoloring",
+ MENUFLAG_NOMENU |
+ MENUFLAG_INTERRUPT, uih_setoutcoloringmode,
+ uih_numdialog);
+ MENUDIALOG_I("fractal", NULL,
+ gettext("Inside truecolor coloring mode"), "intcoloring",
+ MENUFLAG_NOMENU | MENUFLAG_INTERRUPT, uih_setintcolor,
+ uih_numdialog);
+ MENUDIALOG_I("fractal", NULL,
+ gettext("Outside truecolor coloring mode"),
+ "outtcoloring", MENUFLAG_NOMENU | MENUFLAG_INTERRUPT,
+ uih_setouttcolor, uih_numdialog);
+ MENUDIALOG_I("fractal", NULL, gettext("Julia seed"), "juliaseed",
+ MENUFLAG_NOMENU | MENUFLAG_INTERRUPT, uih_setjuliaseed,
+ uih_coorddialog);
+ MENUNOP_I("palettemenu", "d", gettext("Default palette"), "defpalette",
+ 0, uih_mkdefaultpalette);
+ MENUNOP_I("palettemenu", "p", gettext("Random palette"),
+ "randompalette", 0, uih_menumkpalette);
+ MENUCDIALOG_I("palettemenu", NULL, gettext("Custom palette"),
+ "palette", 0, uih_palette, uih_getpalettedialog);
+ MENUSEPARATOR_I("palettemenu");
+ MENUNOPCB_I("palettemenu", "y",
+ gettext("Color cycling"),
+ "cycling", 0, uih_cyclingsw, uih_cyclingselected);
+ MENUNOPCB_I("palettemenu", "Y", gettext("Reversed color cycling"),
+ "rcycling", MENUFLAG_NOOPTION | MENUFLAG_NOPLAY,
+ uih_rcyclingsw, uih_rcyclingselected);
+ MENUCDIALOG_I("palettemenu", NULL,
+ gettext
+ ("Color cycling speed"),
+ "cyclingspeed", 0, uih_setcycling, uih_getcyclingdialog);
+ MENUSEPARATOR_I("palettemenu");
+ MENUDIALOG_I("palettemenu", NULL,
+ gettext("Shift palette"),
+ "shiftpalette", 0, uih_shiftpalette, uih_shiftdialog);
+ MENUNOP_I("palettemenu", "+", gettext("Shift one forward"), "fshift",
+ MENUFLAG_NOOPTION | MENUFLAG_NOPLAY, uih_fshift);
+ MENUNOP_I("palettemenu", "-",
+ gettext("Shift one backward"),
+ "bshift", MENUFLAG_NOOPTION | MENUFLAG_NOPLAY, uih_bshift);
+ SUBMENU_I("calc", NULL, gettext("Solid guessing"), "mguess");
+ SUBMENU_I("calc", NULL, gettext("Dynamic resolution"), "dynamic");
+ MENUNOPCB_I("calc", "k",
+ gettext("Periodicity checking"),
+ "periodicity", 0, uih_periodicitysw,
+ uih_periodicityselected);
+ MENUCDIALOG_I("calc", NULL, gettext("Iterations"), "maxiter",
+ MENUFLAG_INTERRUPT, uih_setmaxiter, uih_getiterdialog);
+ MENUCDIALOG_I("calc", NULL, gettext("Bailout"), "bailout",
+ MENUFLAG_INTERRUPT, uih_setbailout,
+ uih_getbailoutdialog);
+ MENUSEPARATOR_I("calc");
+ MENUNOPCB_I("calc", "j", gettext("Fast julia mode"), "fastjulia", 0,
+ uih_juliasw, uih_juliaselected);
+ SUBMENU_I("calc", "o", gettext("Rotation"), "rotate");
+ MENUDIALOG_I("calc", NULL, gettext("Solid guessing range"), "range",
+ MENUFLAG_NOMENU, uih_setguessing, uih_numdialog);
+ MENUINTRB_I("rotate", NULL,
+ gettext("Disable rotation"),
+ "norotate", UI, uih_rotate, 0, uih_rotateselected);
+ MENUSEPARATOR_I("rotate");
+ MENUINTRB_I("rotate", NULL,
+ gettext("Continuous rotation"),
+ "controtate", UI, uih_rotate,
+ ROTATE_CONTINUOUS, uih_rotateselected);
+ MENUINTRB_I("rotate", NULL, gettext("Rotate by mouse"), "mouserotate",
+ UI, uih_rotate, ROTATE_MOUSE, uih_rotateselected);
+ MENUCDIALOG_I("rotate", NULL,
+ gettext
+ ("Rotation speed"),
+ "rotationspeed", 0,
+ uih_rotationspeed, uih_getrotationdialog);
+ MENUDIALOG_I("rotate", NULL, gettext("Automatic rotation"),
+ "autorotate", MENUFLAG_NOMENU, uih_playautorotate,
+ uih_autorotatedialog);
+ MENUDIALOG_I("rotate", NULL,
+ gettext
+ ("Fast rotation mode"),
+ "fastrotate",
+ MENUFLAG_NOMENU,
+ (funcptr) uih_fastrotate, uih_fastrotatedialog);
+ MENUINTRB_I("dynamic", NULL, gettext("Disable dynamic resolution"),
+ "nodynamic", UI, uih_setfastmode, 1, uih_fastmode);
+ MENUSEPARATOR_I("dynamic");
+ MENUINTRB_I("dynamic", NULL, gettext("Use only during animation"),
+ "dynamicanimation", UI, uih_setfastmode, 2, uih_fastmode);
+ MENUINTRB_I("dynamic", NULL,
+ gettext
+ ("Use also for new images"),
+ "dynamicnew", UI, uih_setfastmode, 3, uih_fastmode);
+ MENUDIALOG_I("dynamic", NULL, gettext("Dynamic resolution mode"),
+ "fastmode", MENUFLAG_NOMENU, uih_setfastmode,
+ uih_fastmodedialog);
+ MENUNOPCB_I("ui", "a",
+ gettext("Autopilot"),
+ "autopilot", 0, uih_autopilotsw, uih_autopilotselected);
+ MENUSEPARATOR_I("ui");
+ MENUNOPCB_I("ui", "v",
+ gettext("VJ mode"),
+ "inhibittextoutput", 0, uih_inhibittextsw,
+ uih_inhibittextselected);
+ MENUSEPARATOR_I("ui");
+ MENUNOP_I("ui", "r", gettext("Recalculate"),
+ "recalculate", 0, uih_recalculate);
+ MENUNOP_I("ui", "z",
+ gettext
+ ("Interrupt"),
+ "interrupt",
+ MENUFLAG_INTERRUPT | MENUFLAG_INCALC, uih_interrupt);
+ MENUSEPARATOR_I("ui");
+ MENUCDIALOG_I("ui", NULL,
+ gettext("Zooming speed"), "speed",
+ 0, uih_setspeed, uih_getspeeddialog);
+ MENUNOPCB_I("ui", NULL, gettext("Fixed step"), "fixedstep", 0,
+ uih_fixedstepsw, uih_fixedstepselected);
+ MENUINTRB_I("mguess", NULL,
+ gettext
+ ("Disable solid guessing"),
+ "noguess", UI, uih_setguessing, 1, uih_guessingselected);
+ MENUSEPARATOR_I("mguess");
+ MENUINTRB_I("mguess", NULL,
+ gettext("Guess 2x2 rectangles"),
+ "guess2", UI, uih_setguessing, 2, uih_guessingselected);
+ MENUINTRB_I("mguess", NULL, gettext("Guess 3x3 rectangles"), "guess3",
+ UI, uih_setguessing, 3, uih_guessingselected);
+ MENUINTRB_I("mguess", NULL,
+ gettext
+ ("Guess 4x4 rectangles"),
+ "guess4", UI, uih_setguessing, 4, uih_guessingselected);
+ MENUINTRB_I("mguess", NULL, gettext("Guess 5x5 rectangles"), "guess5",
+ UI, uih_setguessing, 5, uih_guessingselected);
+ MENUINTRB_I("mguess", NULL,
+ gettext
+ ("Guess 6x6 rectangles"),
+ "guess6", UI, uih_setguessing, 6, uih_guessingselected);
+ MENUINTRB_I("mguess", NULL, gettext("Guess 7x7 rectangles"), "guess7",
+ UI, uih_setguessing, 7, uih_guessingselected);
+ MENUINTRB_I("mguess", NULL,
+ gettext
+ ("Guess 8x8 rectangles"),
+ "guess8", UI, uih_setguessing, 8, uih_guessingselected);
+ MENUINTRB_I("mguess", NULL, gettext("Guess unlimited rectangles"),
+ "guessall", UI, uih_setguessing, 2048,
+ uih_guessingselected);
+ /* Language selection is not sensible anymore if i18n is used: */
+#ifndef HAVE_GETTEXT
+ SUBMENU_I("tutor", NULL, gettext("Language"), "lang");
+ MENUSEPARATOR_I("tutor");
+#endif
+ SUBMENU_I("tutor", NULL, gettext("An introduction to fractals"),
+ "intro");
+ SUBMENU_I("tutor", NULL, gettext("XaoS features overview"),
+ "features");
+ SUBMENU_I("tutor", NULL, gettext("Math behind fractals"), "fmath");
+ SUBMENU_I("tutor", NULL, gettext("Other fractal types in XaoS"),
+ "otherf");
+ SUBMENU_I("tutor", NULL, gettext("What's new?"), "new");
+ /* Language selection is not sensible anymore if i18n is used: */
+#ifndef HAVE_GETTEXT
+ LANG_I("Cesky", "cesky");
+ LANG_I("Deutsch", "deutsch");
+ LANG_I("English", "english");
+ LANG_I("Espanhol", "espanhol");
+ LANG_I("Francais", "francais");
+ LANG_I("Magyar", "magyar");
+#endif
+ TUTOR_I("intro", gettext("Whole story"), "fractal.xaf");
+ MENUSEPARATOR_I("intro");
+ TUTOR_I("intro", gettext("Introduction"), "intro.xaf");
+ TUTOR_I("intro", gettext("Mandelbrot set"), "mset.xaf");
+ TUTOR_I("intro", gettext("Julia set"), "julia.xaf");
+ TUTOR_I("intro", gettext("Higher power Mandelbrots"), "power.xaf");
+ TUTOR_I("intro", gettext("Newton's method"), "newton.xaf");
+ TUTOR_I("intro", gettext("Barnsley's formula"), "barnsley.xaf");
+ TUTOR_I("intro", gettext("Phoenix"), "phoenix.xaf");
+ TUTOR_I("intro", gettext("Octo"), "octo.xaf");
+ TUTOR_I("intro", gettext("Magnet"), "magnet.xaf");
+ TUTOR_I("features", gettext("All features"), "features.xaf");
+ MENUSEPARATOR_I("features");
+ TUTOR_I("features", gettext("Outcoloring modes"), "outcolor.xaf");
+ TUTOR_I("features", gettext("Incoloring modes"), "incolor.xaf");
+ TUTOR_I("features", gettext("True-color coloring modes"),
+ "truecol.xaf");
+ TUTOR_I("features", gettext("Filters"), "filter.xaf");
+ TUTOR_I("features", gettext("Planes"), "plane.xaf");
+ TUTOR_I("features", gettext("Animations and position files"),
+ "anim.xaf");
+ TUTOR_I("features", gettext("Perturbation"), "pert.xaf");
+ TUTOR_I("features", gettext("Random palettes"), "palette.xaf");
+ TUTOR_I("features", gettext("Other noteworthy features"), "other.xaf");
+ TUTOR_I("fmath", gettext("Whole story"), "fmath.xaf");
+ MENUSEPARATOR_I("fmath");
+ TUTOR_I("fmath", gettext("The definition and fractal dimension"),
+ "dimension.xaf");
+ TUTOR_I("fmath", gettext("Escape time fractals"), "escape.xaf");
+ TUTOR_I("otherf", gettext("Other fractal types in XaoS"),
+ "otherfr.xaf");
+ MENUSEPARATOR_I("otherf");
+ TUTOR_I("otherf", gettext("Triceratops and Catseye fractals"),
+ "trice.xaf");
+ TUTOR_I("otherf", gettext("Mandelbar, Lambda, Manowar and Spider"),
+ "fourfr.xaf");
+ TUTOR_I("otherf",
+ gettext("Sierpinski Gasket, S.Carpet, Koch Snowflake"),
+ "classic.xaf");
+ TUTOR_I("new", gettext("What's new in 3.0?"), "new30.xaf");
+#ifdef DEBUG
+ printf("Filled %d menu items out of %d.\n", no_menuitems_i18n,
+ MAX_MENUITEMS_I18N);
+#endif
+ menu_add(menuitems_i18n, no_menuitems_i18n);
+ uih_no_menuitems_i18n = no_menuitems_i18n;
+}
+
+
+static CONST menuitem menuitems2[] = {
+ SUBMENU("mincoloring", NULL, "True-color incoloring mode",
+ "tincoloring"),
+ SUBMENU("moutcoloring", NULL, "True-color outcoloring mode",
+ "toutcoloring")
+};
+
+static int uih_selectedformula(struct uih_context *c, int n)
+{
+ if (c == NULL)
+ return 0;
+ return (c->fcontext->currentformula == formulas + n);
+}
+
+static int uih_selectedincoloring(struct uih_context *c, int n)
+{
+ if (c == NULL)
+ return 0;
+ return (c->fcontext->incoloringmode == n);
+}
+
+static void uih_setintruecolor(struct uih_context *c, int n)
+{
+ uih_setincoloringmode(c, 10);
+ uih_setintcolor(c, n);
+}
+
+static int uih_selectedintcoloring(struct uih_context *c, int n)
+{
+ if (c == NULL)
+ return 0;
+ return (c->fcontext->intcolor == n);
+}
+
+static int uih_selectedoutcoloring(struct uih_context *c, int n)
+{
+ if (c == NULL)
+ return 0;
+ return (c->fcontext->coloringmode == n);
+}
+
+static int uih_selectedplane(struct uih_context *c, int n)
+{
+ if (c == NULL)
+ return 0;
+ return (c->fcontext->plane == n);
+}
+
+static void uih_setouttruecolor(struct uih_context *c, int n)
+{
+ uih_setoutcoloringmode(c, 10);
+ uih_setouttcolor(c, n);
+}
+
+static int uih_selectedouttcoloring(struct uih_context *c, int n)
+{
+ if (c == NULL)
+ return 0;
+ return (c->fcontext->outtcolor == n);
+}
+
+static int uih_filterenabled(struct uih_context *c, int n)
+{
+ if (c == NULL)
+ return 0;
+ return (c->filter[n] != NULL);
+}
+
+static void uih_filtersw(struct uih_context *c, int n)
+{
+ if (c->filter[n] != NULL)
+ uih_disablefilter(c, n);
+ else
+ uih_enablefilter(c, n);
+}
+
+static menuitem *formulaitems;
+static menuitem *filteritems;
+static char (*keys)[2];
+void uih_registermenus(void)
+{
+ menuitem *item;
+ int i;
+ menu_add(menuitems, NITEMS(menuitems));
+ formulaitems = item =
+ (menuitem *) malloc(sizeof(menuitem) * nformulas);
+
+ /* This code automatically generates code for fractal, incoloring and other
+ * menus*/
+ keys = malloc(sizeof(*keys) * nformulas);
+ for (i = 0; i < nformulas; i++) {
+ if (i < nmformulas) {
+ item[i].menuname = "mformula";
+ } else {
+ item[i].menuname = "oformula";
+ }
+ item[i].key = keys[i];
+ if (i < 9)
+ keys[i][0] = '1' + i;
+ else if (i == 9)
+ keys[i][0] = '0';
+#ifndef _MAC
+ else
+ keys[i][0] = '7' + i;
+#endif
+ keys[i][1] = 0;
+ item[i].type = MENU_INT;
+ item[i].flags =
+ MENUFLAG_RADIO | MENUFLAG_INTERRUPT | MENUFLAG_NOPLAY;
+ item[i].iparam = i;
+ item[i].name = formulas[i].name[!formulas[i].mandelbrot];
+ item[i].shortname = formulas[i].shortname;
+ item[i].function = (void (*)(void)) uih_setformula;
+ item[i].control = (int (*)(void)) uih_selectedformula;
+ }
+ menu_add(item, nformulas);
+
+ menu_genernumbered(INCOLORING - 1, "mincoloring", incolorname, NULL,
+ MENU_INT, UI | MENUFLAG_RADIO | MENUFLAG_INTERRUPT,
+ uih_setincoloringmode, uih_selectedincoloring,
+ "in");
+
+ menu_genernumbered(TCOLOR - 1, "tincoloring", tcolorname, NULL,
+ MENU_INT, UI | MENUFLAG_RADIO | MENUFLAG_INTERRUPT,
+ uih_setintruecolor, uih_selectedintcoloring, "int");
+
+ menu_genernumbered(OUTCOLORING - 1, "moutcoloring", outcolorname, NULL,
+ MENU_INT, UI | MENUFLAG_RADIO | MENUFLAG_INTERRUPT,
+ uih_setoutcoloringmode, uih_selectedoutcoloring,
+ "out");
+
+ menu_genernumbered(TCOLOR - 1, "toutcoloring", tcolorname, NULL,
+ MENU_INT, UI | MENUFLAG_RADIO | MENUFLAG_INTERRUPT,
+ uih_setouttruecolor, uih_selectedouttcoloring,
+ "outt");
+
+ {
+ int i;
+ for (i = 0; planename[i] != NULL; i++);
+ menu_genernumbered(i, "mplane", planename, NULL, MENU_INT,
+ UI | MENUFLAG_RADIO | MENUFLAG_INTERRUPT,
+ uih_setplane, uih_selectedplane, "plane");
+ }
+ filteritems = item =
+ (menuitem *) malloc(sizeof(menuitem) * uih_nfilters);
+
+ /* This code automatically generates code for fractal, incoloring and other
+ * menus*/
+ for (i = 0; i < uih_nfilters; i++) {
+ item[i].menuname = "mfilter";
+ item[i].key = NULL;
+ item[i].type = MENU_INT;
+ item[i].flags =
+ MENUFLAG_CHECKBOX | MENUFLAG_INTERRUPT | MENUFLAG_NOPLAY;
+ item[i].iparam = i;
+ item[i].name = uih_filters[i]->name;
+ item[i].shortname = uih_filters[i]->shortname;
+ if (!strcmp(item[i].shortname, "palette"))
+ item[i].shortname = "palettef";
+ /*this is one name collision because of ugly historical reasons */
+ item[i].function = (void (*)(void)) uih_filtersw;
+ item[i].control = (int (*)(void)) uih_filterenabled;
+ }
+ menu_add(item, uih_nfilters);
+
+ menu_add(menuitems2, NITEMS(menuitems2));
+}
+
+void uih_unregistermenus(void)
+{
+ menu_delete(menuitems, NITEMS(menuitems));
+ menu_delete(menuitems_i18n, uih_no_menuitems_i18n);
+
+ free(keys);
+ menu_delete(formulaitems, nformulas);
+ free(formulaitems);
+
+ menu_delnumbered(INCOLORING - 1, "in");
+
+ menu_delnumbered(TCOLOR - 1, "int");
+
+ menu_delnumbered(OUTCOLORING - 1, "out");
+
+ menu_delnumbered(TCOLOR - 1, "outt");
+ {
+ int i;
+ for (i = 0; planename[i] != NULL; i++);
+ menu_delnumbered(i, "plane");
+ }
+
+ menu_delete(filteritems, uih_nfilters);
+ free(filteritems);
+
+ menu_delete(menuitems2, NITEMS(menuitems2));
+}
+
+#ifdef SFFE_USING
+void uih_sffein(uih_context * c, CONST char *text)
+{
+ char str[200];
+ int err;
+ if (strlen(text)) {
+ c->parser->errormsg = (char *) str;
+ if ((err = sffe_parse(&c->parser, (char *) text)) > 0) {
+ uih_message(c, str);
+ sffe_parse(&c->parser, "z^2+c");
+ uih_sffedialog->defstr = c->parser->expression;
+ } else {
+ uih_sffedialog->defstr = c->parser->expression;
+ uih_message(c, c->parser->expression);
+ if (!(c->fcontext->currentformula->flags & SFFE_FRACTAL)) {
+ uih_play_formula(c, "user");
+ } else
+ uih_recalculate(c);
+ };
+
+ c->parser->errormsg = NULL;
+ };
+};
+
+void uih_sffeinitin(uih_context * c, CONST char *text)
+{
+ extern cmplx pZ;
+ extern cmplx C;
+ char str[200];
+ int err;
+ uih_sffeinitdialog->defstr = "";
+ if (strlen(text)) {
+ if (!c->pinit) {
+ c->pinit = sffe_alloc();
+ sffe_regvar(&c->pinit, &pZ, 'p');
+ sffe_regvar(&c->pinit, &C, 'c');
+ };
+
+ c->pinit->errormsg = (char *) str;
+ if ((err = sffe_parse(&c->pinit, (char *) text)) > 0) {
+ uih_message(c, str);
+ sffe_free(&c->pinit);
+ c->pinit = NULL;
+ } else {
+ uih_sffeinitdialog->defstr = c->pinit->expression; /*FIXME shouldnt this be done by str copy */
+ uih_message(c, c->pinit->expression);
+ if (!(c->fcontext->currentformula->flags & SFFE_FRACTAL)) {
+ uih_play_formula(c, "user");
+ } else
+ uih_recalculate(c);
+ c->pinit->errormsg = NULL;
+ };
+
+ } else if (c->pinit) {
+ sffe_free(&c->pinit);
+ c->pinit = NULL;
+ uih_recalculate(c);
+ };
+};
+#endif
diff --git a/src/ui-hlp/messg.c b/src/ui-hlp/messg.c
new file mode 100644
index 0000000..2a66fe2
--- /dev/null
+++ b/src/ui-hlp/messg.c
@@ -0,0 +1,145 @@
+#ifdef _plan9_
+#include <u.h>
+#include <libc.h>
+#else
+#include <stdlib.h>
+#include <string.h>
+#endif
+#include <filter.h>
+#include <fractal.h>
+#include <timers.h>
+#include <ui_helper.h>
+#include <xerror.h>
+#include <misc-f.h>
+#include "grlib.h"
+#define EXPIRETIME 4000000
+static void
+getpos(uih_context * c, int *x, int *y, int *w, int *h, void *data)
+{
+ int n = (int) data;
+ if (c->messg.message[n] != NULL) {
+ int he = xtextheight(c->font);
+ *y = c->messg.messagestart + he * n;
+ *h = he;
+ *w = xtextwidth(c->font, c->messg.message[n]);
+ *x = (c->image->width - *w) / 2;
+ } else {
+ *w = *h = *x = *y = 0;
+ }
+}
+
+static void draw(uih_context * c, void *data)
+{
+ int x, y, w;
+ int n = (int) data;
+ if (c->messg.message[n] != NULL) {
+ int h = xtextheight(c->font);
+ y = c->messg.messagestart + h * n;
+ w = xtextwidth(c->font, c->messg.message[n]);
+ x = (c->image->width - w) / 2;
+ if (c->messg.messagetype[n])
+ xprint(c->image, c->font, x, y, c->messg.message[n],
+ (c->image->flags & AAIMAGE) ? BGCOLOR(c) : SELCOLOR(c),
+ BGCOLOR(c), 0);
+ else
+ xprint(c->image, c->font, x, y, c->messg.message[n],
+ (c->image->flags & AAIMAGE) ? BGCOLOR(c) : FGCOLOR(c),
+ BGCOLOR(c), 0);
+ }
+}
+
+void uih_rmmessage(uih_context * c, int pid)
+{
+ int i;
+ for (i = 0; i < NMESSAGES && c->messg.pid[i] != pid; i++);
+ if (i == NMESSAGES)
+ return;
+ if (c->messg.message[i] == NULL)
+ return;
+ free(c->messg.message[i]);
+ tl_remove_timer(c->messg.messagetimer[i]);
+ tl_free_timer(c->messg.messagetimer[i]);
+ c->messg.message[i] = NULL;
+ for (; i < NMESSAGES - 1; i++) {
+ c->messg.message[i] = c->messg.message[i + 1];
+ c->messg.messagetimer[i] = c->messg.messagetimer[i + 1];
+ c->messg.messagetype[i] = c->messg.messagetype[i + 1];
+ c->messg.pid[i] = c->messg.pid[i + 1];
+ }
+ c->messg.message[NMESSAGES - 1] = NULL;
+ c->display = 1;
+}
+
+void uih_scrollup(uih_context * c)
+{
+ uih_rmmessage(c, c->messg.pid[0]);
+}
+
+void uih_clearmessages(uih_context * c)
+{
+ while (c->messg.message[0] != NULL)
+ uih_scrollup(c);
+}
+
+void uih_initmessages(uih_context * c)
+{
+ int i;
+ for (i = 0; i < NMESSAGES; i++) {
+ c->messg.message[i] = NULL;
+ c->messg.w[i] = uih_registerw(c, getpos, draw, (void *) i, 0);
+ }
+ c->messg.messagestart = 0;
+}
+
+void uih_destroymessages(uih_context * c)
+{
+ int i;
+ uih_clearmessages(c);
+ for (i = 0; i < NMESSAGES; i++)
+ uih_removew(c, c->messg.w[i]);
+}
+
+static int uih_message1(uih_context * c, CONST char *message, int type)
+{
+ static int pid;
+ int i;
+ for (i = 0; i < NMESSAGES && c->messg.message[i] != NULL; i++);
+ if (i == NMESSAGES)
+ uih_scrollup(c), i--;
+ c->messg.message[i] = mystrdup(message);
+ c->messg.messagetype[i] = type;
+ c->messg.messagetimer[i] = tl_create_timer();
+ tl_reset_timer(c->messg.messagetimer[i]);
+ tl_set_interval(c->messg.messagetimer[i], 1);;
+ tl_slowdown_timer(c->messg.messagetimer[i], EXPIRETIME);;
+ tl_set_handler(c->messg.messagetimer[i],
+ (void (*)(void *)) uih_scrollup, c);
+ tl_add_timer(syncgroup, c->messg.messagetimer[i]);
+ /*tl_remove_timer (c->messg.messagetimer[i]); */
+ c->messg.pid[i] = ++pid;
+ c->display = 1;
+ return (pid);
+}
+
+int uih_message(uih_context * c, CONST char *message)
+{
+ if (c->inhibittextoutput)
+ return 0;
+
+ return (uih_message1(c, message, 0));
+}
+
+int uih_error(uih_context * c, CONST char *error)
+{
+ char str[256];
+ sprintf(str, "Error: %s", error);
+ c->errstring = error;
+ return (uih_message1(c, str, 1));
+}
+
+void uih_printmessages(uih_context * c)
+{
+ int i;
+ for (i = 0; i < NMESSAGES && c->messg.message[i] != NULL; i++)
+ x_message(c->messg.message[i], stderr);
+}
diff --git a/src/ui-hlp/play.c b/src/ui-hlp/play.c
new file mode 100644
index 0000000..17430d6
--- /dev/null
+++ b/src/ui-hlp/play.c
@@ -0,0 +1,946 @@
+#include <config.h>
+#ifndef _plan9_
+#include <limits.h>
+#ifdef NO_MALLOC_H
+#include <stdlib.h>
+#else
+#include <malloc.h>
+#endif
+#include <string.h>
+#else
+#include <u.h>
+#include <libc.h>
+#endif
+#include <fconfig.h>
+#include <filter.h>
+#include <fractal.h>
+#include <ui_helper.h>
+#include <catalog.h>
+#include <xmenu.h>
+#include <grlib.h>
+#include "play.h"
+
+#ifdef HAVE_GETTEXT
+#include <libintl.h>
+#else
+#define gettext(STRING) STRING
+#endif
+
+#define nextchar() (uih->playstring==NULL?xio_getc(FD):uih->playstring[uih->playpos++])
+#define ungetchar(c) (uih->playstring==NULL?xio_ungetc(c,FD):uih->playpos--)
+#define endoffile() (uih->playstring==NULL?xio_feof(FD):uih->playstring[uih->playpos]==0)
+static int nonblockmode;
+static catalog_t *catalog; /*The message catalog should be "session wide" */
+CONST static char *errstring;
+#define seterr(str) {if(errstring==NULL) errstring=str;}
+#define FD uih->playc->file
+static char token[1024];
+static int first;
+static int last;
+static int parsenext;
+
+static CONST char *CONST animroot = "animroot";
+
+static inline struct uih_line *uih_findkey(uih_context * c, int key)
+{
+ struct uih_line *l = c->playc->lines.first;
+ while (l != NULL) {
+ if (l->key == key)
+ return l;
+ l = l->next;
+ }
+ return NULL;
+}
+
+static inline void uih_removeline(uih_context * c, struct uih_line *l)
+{
+ if (l == NULL)
+ return;
+ uih_removew(c, l->w);
+ if (l->prev)
+ l->prev->next = l->next;
+ else
+ c->playc->lines.first = l->next;
+ if (l->next)
+ l->next->prev = l->prev;
+ free(l);
+}
+
+void uih_line(uih_context * c, dialogparam * d)
+{
+ struct uih_window *w;
+ struct uih_line *l;
+ if (c->playstring != NULL) {
+ seterr(gettext("line available only in animation replay"));
+ return;
+ }
+ w = uih_registerline(c, 0, -1, -1, -1, -1);
+ uih_removeline(c, uih_findkey(c, c->playc->lines.currkey));
+ l = (struct uih_line *) calloc(1, sizeof(*l));
+ l->posmode = d[0].dint;
+ l->w = w;
+ l->x1 = d[1].dcoord[0];
+ l->y1 = d[1].dcoord[1];
+ l->x2 = d[2].dcoord[0];
+ l->y2 = d[2].dcoord[1];
+ l->color = c->color;
+ l->morph = 0;
+ l->key = c->playc->lines.currkey++;
+ l->prev = NULL;
+ l->next = c->playc->lines.first;
+ c->playc->lines.first = l;
+}
+
+void uih_morphline(uih_context * c, dialogparam * d)
+{
+ struct uih_line *l;
+ l = uih_findkey(c, c->playc->lines.currkey);
+ if (l == NULL) {
+ seterr(gettext("Morphing non existing line!"));
+ return;
+ }
+ c->playc->lines.currkey++;
+ l->mposmode = d[0].dint;
+ l->mx1 = d[1].dcoord[0];
+ l->my1 = d[1].dcoord[1];
+ l->mx2 = d[2].dcoord[0];
+ l->my2 = d[2].dcoord[1];
+ l->morph = 1;
+ c->playc->lines.morphing = 1;
+}
+
+void uih_morphlastline(uih_context * c, dialogparam * d)
+{
+ c->playc->lines.currkey--;
+ uih_morphline(c, d);
+}
+
+void uih_setkey(uih_context * c, int line)
+{
+ if (!c->play) {
+ seterr(gettext("linekey not available in this context!"));
+ return;
+ }
+ c->playc->lines.currkey = line;
+}
+
+static void uih_stopmorphing(uih_context * c)
+{
+ struct uih_line *l = c->playc->lines.first;
+ while (l) {
+ if (l->morph) {
+ l->x1 = l->mx1;
+ l->y1 = l->my1;
+ l->x2 = l->mx2;
+ l->y2 = l->my2;
+ l->posmode = l->mposmode;
+ l->morph = 0;
+ c->playc->lines.morphing = 1;
+ }
+ l = l->next;
+ }
+}
+
+void uih_update_lines(uih_context * c)
+{
+ int m = 0;
+ int co;
+ struct uih_line *l = c->playc->lines.first;
+ int x1, y1, x2, y2;
+ number_t x, y;
+ int timer = tl_lookup_timer(c->playc->timer) - c->playc->starttime;
+ number_t mmul = /*(tl_lookup_timer (c->playc->timer) - c->playc->starttime) / (number_t) (c->playc->frametime - c->playc->starttime); */
+ MORPHVALUE(timer, c->playc->frametime - c->playc->starttime,
+ c->playc->morphlinetimes[0],
+ c->playc->morphlinetimes[1]);
+
+
+ while (l) {
+ switch (l->posmode) {
+ case 0:
+ x1 = (int) (c->image->width * l->x1);
+ y1 = (int) (c->image->height * l->y1);
+ x2 = (int) (c->image->width * l->x2);
+ y2 = (int) (c->image->height * l->y2);
+ break;
+ case 1:
+ x = c->image->width * c->image->pixelwidth;
+ y = c->image->height * c->image->pixelheight;
+ if (x > y)
+ x = y;
+ x1 = (int) (c->image->width / 2 +
+ (l->x1 - 0.5) * x / c->image->pixelwidth);
+ y1 = (int) (c->image->height / 2 +
+ (l->y1 - 0.5) * x / c->image->pixelheight);
+ x2 = (int) (c->image->width / 2 +
+ (l->x2 - 0.5) * x / c->image->pixelwidth);
+ y2 = (int) (c->image->height / 2 +
+ (l->y2 - 0.5) * x / c->image->pixelheight);
+ break;
+ case 2:
+ x = l->x1;
+ y = l->y1;
+ rotate(*(c->fcontext), x, y);
+ x = (x - c->fcontext->rs.nc) / (c->fcontext->rs.mc -
+ c->fcontext->rs.nc) *
+ c->zengine->image->width;
+ y = (y - c->fcontext->rs.ni) / (c->fcontext->rs.mi -
+ c->fcontext->rs.ni) *
+ c->zengine->image->height;
+ x1 = (int) x;
+ y1 = (int) y;
+ c->zengine->action->convertup(c->zengine, &x1, &y1);
+ x = l->x2;
+ y = l->y2;
+ rotate(*(c->fcontext), x, y);
+ x = (x - c->fcontext->rs.nc) / (c->fcontext->rs.mc -
+ c->fcontext->rs.nc) *
+ c->zengine->image->width;
+ y = (y - c->fcontext->rs.ni) / (c->fcontext->rs.mi -
+ c->fcontext->rs.ni) *
+ c->zengine->image->height;
+ x2 = (int) x;
+ y2 = (int) y;
+ c->zengine->action->convertup(c->zengine, &x2, &y2);
+ break;
+ }
+ if (l->morph) {
+ int mx1, mx2, my1, my2;
+ m = 1;
+ switch (l->mposmode) {
+ case 0:
+ mx1 = (int) (c->image->width * l->mx1);
+ my1 = (int) (c->image->height * l->my1);
+ mx2 = (int) (c->image->width * l->mx2);
+ my2 = (int) (c->image->height * l->my2);
+ break;
+ case 1:
+ x = c->image->width * c->image->pixelwidth;
+ y = c->image->height * c->image->pixelheight;
+ if (x > y)
+ x = y;
+ mx1 =
+ (int) (c->image->width / 2 +
+ (l->mx1 - 0.5) * x / c->image->pixelwidth);
+ my1 =
+ (int) (c->image->height / 2 +
+ (l->my1 - 0.5) * x / c->image->pixelheight);
+ mx2 =
+ (int) (c->image->width / 2 +
+ (l->mx2 - 0.5) * x / c->image->pixelwidth);
+ my2 =
+ (int) (c->image->height / 2 +
+ (l->my2 - 0.5) * x / c->image->pixelheight);
+ break;
+ default:
+ x = l->mx1;
+ y = l->my1;
+ rotate(*(c->fcontext), x, y);
+ x = (x - c->fcontext->rs.nc) / (c->fcontext->rs.mc -
+ c->fcontext->rs.nc) *
+ c->zengine->image->width;
+ y = (y - c->fcontext->rs.ni) / (c->fcontext->rs.mi -
+ c->fcontext->rs.ni) *
+ c->zengine->image->height;
+ mx1 = (int) x;
+ my1 = (int) y;
+ c->zengine->action->convertup(c->zengine, &mx1, &my1);
+ x = l->mx2;
+ y = l->my2;
+ rotate(*(c->fcontext), x, y);
+ x = (x - c->fcontext->rs.nc) / (c->fcontext->rs.mc -
+ c->fcontext->rs.nc) *
+ c->zengine->image->width;
+ y = (y - c->fcontext->rs.ni) / (c->fcontext->rs.mi -
+ c->fcontext->rs.ni) *
+ c->zengine->image->height;
+ mx2 = (int) x;
+ my2 = (int) y;
+ c->zengine->action->convertup(c->zengine, &mx2, &my2);
+ break;
+ }
+ x1 = (int) (x1 + (mx1 - x1) * mmul);
+ y1 = (int) (y1 + (my1 - y1) * mmul);
+ x2 = (int) (x2 + (mx2 - x2) * mmul);
+ y2 = (int) (y2 + (my2 - y2) * mmul);
+ }
+ switch (l->color) {
+ case 1:
+ co = BGCOLOR(c);
+ break;
+ case 0:
+ co = FGCOLOR(c);
+ break;
+ default:
+ co = SELCOLOR(c);
+ break;
+ }
+ uih_setline(c, l->w, co, x1, y1, x2, y2);
+
+ l = l->next;
+ }
+ c->playc->lines.morphing = m;
+ if (m)
+ c->display = 1;
+
+}
+
+void uih_clear_line(uih_context * c)
+{
+ if (c->playstring != NULL) {
+ seterr(gettext("clear_line available only in animation replay"));
+ return;
+ }
+ uih_removeline(c, uih_findkey(c, c->playc->lines.currkey++));
+}
+
+void uih_clear_lines(uih_context * c)
+{
+ if (c->playstring != NULL) {
+ seterr(gettext("clear_lines available only in animation replay"));
+ return;
+ }
+ while (c->playc->lines.first != NULL)
+ uih_removeline(c, c->playc->lines.first);
+ c->playc->lines.currkey = 0;
+}
+
+void uih_freecatalog(uih_context * c)
+{
+ if (catalog != NULL)
+ free_catalog(catalog), catalog = NULL;
+}
+
+void uih_setfont(struct uih_context *uih)
+{
+ if (catalog != NULL && find_text(catalog, "encoding")
+ && find_text(catalog, "encoding")[0] == '2')
+ uih->encoding = 2;
+ else
+ uih->encoding = 1;
+ if (uih->image->flags & AAIMAGE)
+ uih->font = &xaafont;
+ else {
+ if (uih->encoding == 2) {
+ // A better heuristics would be used later.
+ if (uih->image->width > 1000 && uih->image->height > 720)
+ uih->font = &xbigfont3;
+ else {
+ if (uih->image->width > 800 && uih->image->height > 600)
+ uih->font = &xbigfont2;
+ else {
+ if (uih->image->pixelheight < 0.07)
+ uih->font = &xbigfont;
+ else
+ uih->font = &xsmallfont;
+ }
+ }
+ } else {
+ if (uih->image->pixelheight < 0.04)
+ uih->font = &xbigfontil1;
+ else if (uih->image->pixelheight < 0.07)
+ uih->font = &xmedfontil1;
+ else
+ uih->font = &xsmallfontil1;
+ }
+ }
+}
+
+int uih_loadcatalog(uih_context * c, CONST char *name)
+{
+ static int firsttime = 1;
+ static CONST char *str;
+ xio_file f = xio_getcatalog(name);
+ if (f == XIO_FAILED) {
+ if (firsttime) {
+ firsttime = 0;
+ return 0;
+ } /*Let XaoS work as stand alone executable */
+ uih_error(c, gettext("Catalog file not found"));
+ return 0;
+ }
+ firsttime = 0;
+ if (catalog != NULL)
+ free_catalog(catalog);
+ catalog = load_catalog(f, &str);
+ if (str != NULL)
+ uih_error(c, str);
+ uih_setfont(c);
+ return (catalog != NULL);
+}
+
+static void handler(void *userdata)
+{
+ struct uih_context *uih = (struct uih_context *) userdata;
+ uih->playc->playframe++;
+ uih->inanimation = 2;
+ if (uih->playc->timerin)
+ tl_remove_timer(uih->playc->timer);
+ uih->playc->timerin = 0;
+}
+
+static void handler1(void *userdata)
+{
+ struct uih_context *uih = (struct uih_context *) userdata;
+ uih->playc->playframe++;
+ uih->inanimation = 2;
+ tl_update_time();
+ tl_reset_timer(uih->playc->timer);
+ uih_setcomplettehandler(uih, NULL, NULL);
+}
+
+void uih_skipframe(struct uih_context *uih)
+{
+ if (uih->play && uih->playc->timerin)
+ handler(uih), tl_reset_timer(uih->playc->timer);
+}
+
+int
+uih_replayenable(struct uih_context *uih, xio_file f,
+ xio_constpath filename, int animr)
+{
+ struct uih_playcontext *p;
+ CONST char *s;
+ if (uih->play) {
+ uih_error(uih, gettext("Replay is already active"));
+ return 0;
+ }
+ if (f == XIO_FAILED) {
+ uih_error(uih, gettext("File open failed"));
+ return 0;
+ }
+ p = (struct uih_playcontext *) calloc(1, sizeof(*p));
+ if (p == NULL) {
+ uih_error(uih, gettext("Out of memory"));
+ return 0;
+ }
+ if (animr) {
+ uih->menuroot = animroot;
+ uih_updatemenus(uih, NULL);
+ }
+ p->file = f;
+ p->playframe = 1;
+ p->timer = tl_create_timer();
+ p->frametime = 0;
+ p->morph = 0;
+ p->morphjulia = 0;
+ p->lines.first = NULL;
+ p->lines.morphing = 0;
+ p->lines.currkey = 0;
+ tl_update_time();
+ tl_set_handler(p->timer, handler, uih);
+ uih_stoptimers(uih);
+ if (uih->stoppedtimers)
+ tl_stop_timer(p->timer);
+ uih->playc = p;
+ uih->play = 1;
+ uih_emulatetimers(uih);
+ tl_reset_timer(p->timer);
+ uih->playc->line = 1;
+ if (filename != NULL) {
+ uih->playc->directory = xio_getdirectory(filename);
+ } else {
+ uih->playc->directory = xio_getdirectory(XIO_EMPTYPATH);
+ }
+ uih->playc->level = 0;
+ s = uih->playstring;
+ uih->playstring = NULL;
+ uih_playupdate(uih);
+ uih->playstring = s;
+ return 1;
+}
+
+void uih_replaydisable(struct uih_context *uih)
+{
+ if (uih->play) {
+ int i;
+ uih->play = 0;
+ tl_free_timer(uih->playc->timer);
+ if (uih->menuroot == animroot) {
+ uih->menuroot = "root";
+ uih_updatemenus(uih, NULL);
+ }
+ xio_close(uih->playc->file);
+ for (i = 0; i < uih->playc->level; i++)
+ xio_close(uih->playc->prevfiles[i]);
+ uih->display = 1;
+ uih->nonfractalscreen = 0;
+ uih_setcomplettehandler(uih, NULL, NULL);
+ uih_clear_lines(uih);
+ free(uih->playc->directory);
+ free(uih->playc);
+ uih_display(uih);
+ }
+}
+
+static void skipblank(struct uih_context *uih)
+{
+ int c;
+ if (uih->playstring != NULL) {
+ while ((uih->playstring[uih->playpos] == ' ' ||
+ uih->playstring[uih->playpos] == '\t' ||
+ uih->playstring[uih->playpos] == '\r' ||
+ uih->playstring[uih->playpos] == '\n'))
+ uih->playpos++;
+ return;
+ }
+ do {
+ c = xio_getc(FD);
+ if (c == '\n')
+ uih->playc->line++;
+ if (c == ';')
+ while (c != '\n' && !xio_feof(FD)) {
+ c = xio_getc(FD);
+ if (c == '\n')
+ uih->playc->line++;
+ }
+ while (xio_feof(FD) && uih->playc->level) {
+ c = XIO_EOF + 1;
+ xio_close(FD);
+ uih->playc->file = uih->playc->prevfiles[--uih->playc->level];
+ uih->playc->line = 1;
+ }
+ }
+ while (c == ' ' || c == '\t' || c == '\n' || c == '\r'
+ || c == XIO_EOF + 1);
+ if (c != XIO_EOF)
+ xio_ungetc(c, FD);
+}
+
+static int gettoken(struct uih_context *uih)
+{
+ int c;
+ int i = 0;
+ skipblank(uih);
+ if (first && ((c = nextchar()) != '(')) {
+ if (c && !endoffile()) {
+ seterr("'(' expected");
+ }
+ last = 1;
+ return -1;
+ }
+ if (first)
+ skipblank(uih), first = 0;
+ if (endoffile()) {
+ if (uih->playstring) {
+ seterr(gettext("Missing parameter"));
+ } else
+ seterr(gettext("Unexpected end of file"));
+ return 0;
+ }
+ if ((c = nextchar()) == '"') {
+ while (c == '\r')
+ c = nextchar();
+ token[i] = '"';
+ i++;
+ do {
+ c = nextchar();
+ while (c == '\r')
+ c = nextchar();
+ if (c == XIO_EOF || c == 0) {
+ if (uih->playstring) {
+ seterr(gettext("Missing parameter"));
+ } else
+ seterr(gettext("Unexpected end of file"));
+ return 0;
+ }
+ if (c == '\n' && uih->playstring == NULL)
+ uih->playc->line++;
+ if (c == '\\')
+ token[i] = nextchar();
+ else
+ token[i] = c;
+ i++;
+ if (i >= 1024) {
+ seterr(gettext("Token is too long"));
+ i = 0;
+ }
+ }
+ while (c != '"');
+ } else
+ ungetchar(c);
+ do {
+ c = nextchar();
+ if (c == XIO_EOF || c == 0) {
+ if (uih->playstring) {
+ seterr(gettext("Missing parameter"));
+ } else
+ seterr(gettext("Unexpected end of file"));
+ return 0;
+ }
+ token[i] = c;
+ i++;
+ if (i >= 1024) {
+ seterr(gettext("Token is too long"));
+ i = 0;
+ }
+ }
+ while (c != ' ' && c != '\t' && c != ')' && c != '\n' && c != '\r');
+ i--;
+ token[i] = 0;
+ skipblank(uih);
+ if (c == ')') {
+ last = 1;
+ return i;
+ }
+ c = nextchar();
+ if (uih->playstring == NULL) {
+ while (xio_feof(FD) && uih->playc->level)
+ uih->playc->file =
+ uih->playc->prevfiles[--uih->playc->level],
+ uih->playc->line = 1;
+ }
+ if (c == XIO_EOF || c == 0) {
+ if (uih->playstring) {
+ seterr(gettext("Missing parameter"));
+ } else
+ seterr(gettext("Unexpected end of file"));
+ return 0;
+ }
+ if (c == ')') {
+ last = 1;
+ return i;
+ }
+ ungetchar(c);
+ return i;
+}
+
+static char *gettokenwr(struct uih_context *c)
+{
+ if (last)
+ return NULL;
+ if (gettoken(c) < 0)
+ return NULL;
+ if (errstring)
+ return NULL;
+ return (token);
+}
+
+void uih_play_formula(struct uih_context *uih, char *fname)
+{
+ int i;
+ for (i = 0; i < nformulas; i++) {
+ if (!strcmp(formulas[i].shortname, fname)) {
+ set_formula(uih->fcontext, i);
+ uih_newimage(uih);
+ return;
+ }
+ }
+ seterr(gettext("Unknown formula type"));
+}
+
+void uih_playmorph(struct uih_context *uih, dialogparam * d)
+{
+ if (uih->playstring != NULL) {
+ seterr(gettext("morph available only in animation replay"));
+ return;
+ }
+ if (d[2].number <= 0 || d[3].number <= 0) {
+ seterr(gettext("morphview: Invalid viewpoint"));
+ uih->playc->destination = uih->fcontext->currentformula->v;
+ }
+ uih->playc->source = uih->fcontext->s;
+ uih->playc->destination.cr = d[0].number;
+ uih->playc->destination.ci = d[1].number;
+ uih->playc->destination.rr = d[2].number;
+ uih->playc->destination.ri = d[3].number;
+ uih->playc->morph = 1;
+}
+
+void uih_playmove(struct uih_context *uih, number_t x, number_t y)
+{
+ if (uih->playstring != NULL) {
+ seterr(gettext("move available only in animation replay"));
+ return;
+ }
+ uih->playc->source = uih->fcontext->s;
+ uih->playc->destination.cr = x;
+ uih->playc->destination.ci = y;
+ uih->playc->destination.rr = uih->fcontext->s.rr;
+ uih->playc->destination.ri = uih->fcontext->s.ri;
+ uih->playc->morph = 1;
+}
+
+void uih_playmorphjulia(struct uih_context *uih, number_t x, number_t y)
+{
+ if (uih->playstring != NULL) {
+ seterr(gettext("morphjulia available only in animation replay"));
+ return;
+ }
+ uih->playc->sr = uih->fcontext->pre;
+ uih->playc->si = uih->fcontext->pim;
+ uih->playc->dr = x;
+ uih->playc->di = y;
+ uih->playc->morphjulia = 1;
+}
+
+void uih_playmorphangle(struct uih_context *uih, number_t angle)
+{
+ if (uih->playstring != NULL) {
+ seterr(gettext("morphangle available only in animation replay"));
+ return;
+ }
+ uih->playc->morphangle = 1;
+ uih->playc->srcangle = uih->fcontext->angle;
+ uih->playc->destangle = angle;
+}
+
+void uih_playautorotate(struct uih_context *uih, int mode)
+{
+ if (mode) {
+ uih_fastrotateenable(uih);
+ uih_rotatemode(uih, ROTATE_CONTINUOUS);
+ } else
+ uih_rotatemode(uih, ROTATE_NONE);
+}
+
+void uih_playfilter(struct uih_context *uih, dialogparam * p)
+{
+ CONST char *fname = p[0].dstring;
+ int mode;
+ int i;
+ for (i = 0; i < uih_nfilters; i++) {
+ if (!strcmp(uih_filters[i]->shortname, fname)) {
+ mode = p[1].dint;
+ if (mode)
+ uih_enablefilter(uih, i);
+ else
+ uih_disablefilter(uih, i);
+ return;
+ }
+ }
+ seterr(gettext("Unknown filter"));
+}
+
+void uih_playdefpalette(struct uih_context *uih, int shift)
+{
+ if (uih->zengine->fractalc->palette == NULL)
+ return;
+ if (mkdefaultpalette(uih->zengine->fractalc->palette) != 0) {
+ uih_newimage(uih);
+ }
+ uih->palettetype = 0;
+ uih->palettechanged = 1;
+ if (shiftpalette(uih->zengine->fractalc->palette, shift)) {
+ uih_newimage(uih);
+ }
+ uih->manualpaletteshift = 0;
+ uih->paletteshift = shift;
+}
+
+void uih_zoomcenter(struct uih_context *uih, number_t x, number_t y)
+{
+ uih->xcenter = x;
+ uih->ycenter = y;
+ uih->xcenterm = INT_MAX;
+ uih->ycenterm = INT_MAX;
+}
+
+extern char *xtextposnames[];
+extern char *ytextposnames[];
+void uih_playtextpos(struct uih_context *uih, dialogparam * p)
+{
+ int x, y;
+ x = p[0].dint;
+ y = p[1].dint;
+ uih_settextpos(uih, x, y);
+}
+
+void uih_playusleep(struct uih_context *uih, int time)
+{
+ parsenext = 0;
+ if (uih->playstring != NULL) {
+ seterr(gettext("sleep available only in animation replay"));
+ return;
+ }
+ uih->playc->frametime = time;
+ if (time < tl_lookup_timer(uih->playc->timer) /*&&((!uih->step)||(!uih->zoomactive)) */
+ ) {
+ tl_slowdown_timer(uih->playc->timer, time);
+ uih->playc->playframe++;
+ } else {
+ tl_set_interval(uih->playc->timer, time);
+ if (!uih->playc->timerin) {
+ uih->playc->timerin = 1;
+ tl_add_timer(syncgroup, uih->playc->timer);
+ } else
+ printf(gettext("Internal program error #12 %i\n"),
+ uih->playc->playframe);
+ }
+ uih->playc->starttime = tl_lookup_timer(uih->playc->timer);
+}
+
+void uih_playtextsleep(struct uih_context *uih)
+{
+ uih_playusleep(uih,
+ 500000 + 1000000 * (uih->nletters +
+ uih->todisplayletters) /
+ uih->letterspersec);
+ uih->nletters = 0;
+ uih->todisplayletters = 0;
+}
+
+
+void uih_playwait(struct uih_context *uih)
+{
+ parsenext = 0;
+ if (uih->playstring != NULL) {
+ seterr(gettext("wait available only in animation replay"));
+ return;
+ }
+ if (!uih->uncomplette && !uih->display && !uih->recalculatemode
+ && !uih->displaytext && !uih->clearscreen) {
+ uih->playc->playframe++;
+ } else {
+ uih_setcomplettehandler(uih, handler1, uih);
+ }
+}
+
+void uih_playjulia(struct uih_context *uih, int julia)
+{
+ julia = !julia;
+ if (julia != uih->fcontext->mandelbrot) {
+ uih->fcontext->mandelbrot = julia;
+ uih->fcontext->version++;
+ uih_updatemenus(uih, "uimandelbrot");
+ uih_newimage(uih);
+ }
+}
+
+void uih_playcalculate(struct uih_context *uih)
+{
+ uih_newimage(uih);
+}
+
+void uih_playzoom(struct uih_context *uih)
+{
+ uih->zoomactive = 1;
+}
+
+void uih_playunzoom(struct uih_context *uih)
+{
+ uih->zoomactive = -1;
+}
+
+void uih_playstop(struct uih_context *uih)
+{
+ uih->zoomactive = 0;
+}
+
+void uih_playmessage(struct uih_context *uih, char *name)
+{
+ char *message;
+ if (catalog == NULL) {
+ uih_text(uih, gettext("No catalog file loaded"));
+ return;
+ }
+ message = find_text(catalog, name);
+ if (message == NULL) {
+ uih_text(uih, gettext("Message not found in catalog file"));
+ return;
+ }
+ uih_text(uih, message);
+}
+
+void uih_playload(struct uih_context *uih, xio_path file)
+{
+ xio_file f;
+ xio_pathdata tmp;
+ if (uih->playstring != NULL) {
+ seterr(gettext("load available only in animation replay"));
+ return;
+ }
+ if (uih->playc->level == MAXLEVEL) {
+ seterr(gettext("Include level overflow"));
+ return;
+ }
+
+
+ xio_addfname(tmp, uih->playc->directory, file);
+ f = xio_ropen(tmp);
+
+ if (f == XIO_FAILED) {
+ seterr(gettext("File not found"));
+ return;
+ }
+ uih->playc->prevfiles[uih->playc->level] = uih->playc->file;
+ uih->playc->level++;
+ uih->playc->file = f;
+ uih->playc->line = 1;
+}
+
+static void uih_processcommand(struct uih_context *uih, int flags)
+{
+ CONST char *error;
+ first = 1;
+ last = 0;
+ error = menu_processcommand(uih, gettokenwr, 1, flags, uih->menuroot);
+ if (error != NULL)
+ seterr(error);
+ if (!last) {
+ seterr(gettext("Too many parameters"));
+ }
+}
+
+void uih_playupdate(struct uih_context *uih)
+{
+ static char errtext[1024];
+ errstring = NULL;
+ while (uih->play && uih->playc->playframe && errstring == NULL) {
+ parsenext = 1;
+ uih->playc->playframe--;
+ if (uih->playc->lines.morphing) {
+ uih_stopmorphing(uih);
+ uih->display = 1;
+ }
+ if (uih->playc->morph) {
+ uih->fcontext->s = uih->playc->destination;
+ uih_animate_image(uih);
+ uih->playc->morph = 0;
+ }
+ if (uih->playc->morphangle) {
+ uih_angle(uih, uih->playc->destangle);
+ uih->playc->morphangle = 0;
+ }
+ if (uih->playc->morphjulia) {
+ uih_setjuliaseed(uih, uih->playc->dr, uih->playc->di);
+ uih->playc->morphjulia = 0;
+ }
+ while (!xio_feof(FD) && parsenext && errstring == NULL) {
+ uih_processcommand(uih, MENUFLAG_NOPLAY);
+ } /*while parsenext */
+ uih_update_lines(uih);
+ if (errstring != NULL) {
+ uih_error(uih, errstring);
+ if (uih->play) {
+ sprintf(errtext, gettext("Replay disabled at line %i"),
+ uih->playc->line);
+ uih_message(uih, errtext);
+ }
+ /*errstring[255]=0; */
+ }
+ if ((xio_feof(FD) && parsenext) || errstring) {
+ uih_replaydisable(uih);
+ }
+ } /*while play&&playframe */
+}
+
+void uih_load(struct uih_context *uih, xio_file f, xio_constpath filename)
+{
+ nonblockmode = 1;
+ uih_replayenable(uih, f, filename, 0);
+ uih_replaydisable(uih);
+ nonblockmode = 0;
+}
+
+void uih_command(struct uih_context *uih, CONST char *command)
+{
+ errstring = NULL;
+ uih->playpos = 0;
+ uih->playstring = command;
+ uih_processcommand(uih, (uih->play ? MENUFLAG_NOMENU : 0));
+ uih->playstring = NULL;
+ if (errstring != NULL) {
+ uih_error(uih, errstring);
+ }
+}
diff --git a/src/ui-hlp/play.h b/src/ui-hlp/play.h
new file mode 100644
index 0000000..62b7657
--- /dev/null
+++ b/src/ui-hlp/play.h
@@ -0,0 +1,50 @@
+#ifndef PLAY_H
+#define PLAY_H
+struct keyword {
+ char *name;
+ int type;
+ void (*callback) (void);
+ void *userdata;
+};
+typedef void (*funcptr) (void);
+#define GENERIC 0
+#define PARAM_INTEGER 1
+#define PARAM_BOOL 2
+#define PARAM_NSTRING 3
+#define PARAM_FLOAT 4
+#define PARAM_KEYSTRING 5
+#define PARAM_COORD 6
+#define PARAM_STRING 7
+extern CONST char *CONST save_fastmode[];
+extern CONST char *CONST uih_colornames[];
+void uih_play_formula(struct uih_context *uih, char *name);
+void uih_playfilter(struct uih_context *uih, dialogparam * p);
+void uih_zoomcenter(struct uih_context *uih, number_t x, number_t y);
+void uih_playpalette(struct uih_context *uih);
+void uih_playdefpalette(struct uih_context *uih, int shift);
+void uih_playusleep(struct uih_context *uih, int time);
+void uih_playtextsleep(struct uih_context *uih);
+void uih_playwait(struct uih_context *uih);
+void uih_playjulia(struct uih_context *uih, int julia);
+void uih_playzoom(struct uih_context *uih);
+void uih_playunzoom(struct uih_context *uih);
+void uih_playstop(struct uih_context *uih);
+void uih_playmorph(struct uih_context *uih, dialogparam * p);
+void uih_playmove(struct uih_context *uih, number_t x, number_t y);
+void uih_playtextpos(struct uih_context *uih, dialogparam * p);
+void uih_playcalculate(struct uih_context *uih);
+void uih_playmorphjulia(struct uih_context *uih, number_t x, number_t y);
+void uih_playmorphangle(struct uih_context *uih, number_t angle);
+void uih_playautorotate(struct uih_context *uih, int mode);
+void uih_playmessage(struct uih_context *uih, char *message);
+void uih_playload(struct uih_context *uih, char *message);
+void uih_playinit(struct uih_context *uih);
+
+void uih_line(uih_context * c, dialogparam * d);
+void uih_morphline(uih_context * c, dialogparam * d);
+void uih_morphlastline(uih_context * c, dialogparam * d);
+void uih_setkey(uih_context * c, int line);
+void uih_clear_line(uih_context * c);
+void uih_clear_lines(uih_context * c);
+
+#endif
diff --git a/src/ui-hlp/playtext.c b/src/ui-hlp/playtext.c
new file mode 100644
index 0000000..270134e
--- /dev/null
+++ b/src/ui-hlp/playtext.c
@@ -0,0 +1,174 @@
+#ifndef _plan9_
+#include <stdlib.h>
+#else
+#include <u.h>
+#include <libc.h>
+#endif
+#include <fconfig.h>
+#include <filter.h>
+#include <fractal.h>
+#include <ui_helper.h>
+#include <xerror.h>
+#include <grlib.h>
+
+static inline void
+prepare(struct uih_context *c, char *string, int *xmax, int *nr)
+{
+ int xm = 0;
+ int n = 1;
+ int pos = 0;
+ int tmp;
+ while (1) {
+ tmp = 0;
+ while (*string != '\n') {
+ if (*string == 0) {
+ tmp++;
+ if (tmp > xm)
+ xm = tmp;
+ *xmax = xm;
+ *nr = n;
+ return;
+ } else
+ tmp += xtextcharw(c->font, *string);
+ if (pos > 255)
+ break;
+ string++;
+ pos++;
+ }
+ tmp++;
+ if (tmp > xm)
+ xm = tmp;
+ n++;
+ if (n > 30) {
+ n = 30;
+ *xmax = tmp;
+ *nr = n;
+ return;
+ }
+ pos = 0;
+ string++;
+ }
+}
+
+static void
+getpos(uih_context * c, int *x, int *y, int *w, int *h, void *data)
+{
+ int num = (int) data;
+ int xmax, nr;
+ if (c->text[num] == NULL) {
+ *x = *y = *h = *w;
+ return;
+ }
+ prepare(c, c->text[num], &xmax, &nr);
+ nr *= xtextheight(c->font);
+ switch (num) {
+ case 0:
+ *y = 0;
+ break;
+ case 1:
+ *y = (c->image->height - nr) / 2;
+ break;
+ case 2:
+ *y = c->image->height - nr;
+ break;
+ }
+ *h = nr;
+ switch (c->textpos[num]) {
+ case 0:
+ *x = 0;
+ break;
+ case 1:
+ *x = (c->image->width - xmax) / 2;
+ break;
+ case 2:
+ *x = c->image->width - xmax;
+ break;
+ }
+ *w = xmax;
+}
+
+static void draw(uih_context * c, void *data)
+{
+ int num = (int) data;
+ int flags = 0;
+ int xmax, n, nr, i;
+ int x = 0, y = 0;
+ char *string;
+ int fgcolor = 0, bgcolor = 0;
+ if (c->text[num] == NULL)
+ return;
+ prepare(c, c->text[num], &xmax, &n);
+ nr = n * xtextheight(c->font);
+ switch (c->textcolor[num]) {
+ case 0:
+ fgcolor = FGCOLOR(c);
+ bgcolor = BGCOLOR(c);
+ break;
+ case 1:
+ fgcolor = BGCOLOR(c);
+ bgcolor = BGCOLOR(c);
+ flags = TEXT_PRESSED;
+ break;
+ case 2:
+ fgcolor = SELCOLOR(c);
+ bgcolor = BGCOLOR(c);
+ break;
+ default:
+ x_fatalerror("playtext:unknown color\n");
+ }
+ if (c->image->flags & AAIMAGE)
+ fgcolor = BGCOLOR(c);
+ switch (num) {
+ case 0:
+ y = 0;
+ break;
+ case 1:
+ y = (c->image->height - nr) / 2;
+ break;
+ case 2:
+ y = c->image->height - nr;
+ break;
+ }
+ string = c->text[num];
+ for (i = 0; i < n; i++) {
+ xmax = xtextwidth(c->font, string);
+ switch (c->textpos[num]) {
+ case 0:
+ x = 0;
+ break;
+ case 1:
+ x = (c->image->width - xmax) / 2;
+ break;
+ case 2:
+ x = c->image->width - xmax;
+ break;
+ }
+ string +=
+ xprint(c->image, c->font, x, y, string,
+ fgcolor, bgcolor,
+ flags) + 1;
+ y += xtextheight(c->font);
+ }
+}
+
+void uih_inittext(uih_context * c)
+{
+ c->text[0] = c->text[1] = c->text[2] = NULL;
+ c->textpos[0] = c->textpos[1] = c->textpos[2] = 0;
+ c->textwindow[0] = uih_registerw(c, getpos, draw, (void *) 0, 0);
+ c->textwindow[1] = uih_registerw(c, getpos, draw, (void *) 1, 0);
+ c->textwindow[2] = uih_registerw(c, getpos, draw, (void *) 2, 0);
+}
+
+void uih_destroytext(uih_context * c)
+{
+ if (c->text[0] != NULL)
+ free(c->text[0]), c->text[0] = NULL;
+ if (c->text[1] != NULL)
+ free(c->text[1]), c->text[1] = NULL;
+ if (c->text[2] != NULL)
+ free(c->text[2]), c->text[2] = NULL;
+ uih_removew(c, c->textwindow[0]);
+ uih_removew(c, c->textwindow[1]);
+ uih_removew(c, c->textwindow[2]);
+}
diff --git a/src/ui-hlp/render.c b/src/ui-hlp/render.c
new file mode 100644
index 0000000..f105e92
--- /dev/null
+++ b/src/ui-hlp/render.c
@@ -0,0 +1,664 @@
+
+#ifdef _plan9_
+#include <u.h>
+#include <libc.h>
+#ifdef _plan9v2_
+#include <stdarg.h> /* not needed in plan9v3 */
+#endif
+#else
+#include <string.h>
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#endif
+
+#include <ui.h>
+#include <fconfig.h>
+#include <filter.h>
+#include <fractal.h>
+#include <ui_helper.h>
+#include <misc-f.h>
+#include <xmenu.h>
+#include <xerror.h>
+
+#ifdef HAVE_GETTEXT
+#include <libintl.h>
+#else
+#define gettext(STRING) STRING
+#endif
+
+#define SILENT 0
+#define ERRORS 1
+#define MESSAGES 2
+#define ALL 3
+static int noiselevel;
+/*static struct uih_context *uih, *gc;*/
+static struct uih_context *gc;
+static struct uih_context *uih;
+static int newline = 1;
+static int interrupt = 0;
+static void error(CONST char *str)
+{
+ if (noiselevel < ERRORS)
+ return;
+ if (!gc)
+ x_error(gettext("Error: %s"), str);
+ uih_error(gc, str);
+}
+
+static void uiherror(struct uih_context *c)
+{
+ if (noiselevel < ERRORS)
+ return;
+ if (!gc) {
+ uih_printmessages(c);
+ } else
+ uih_error(gc, uih->errstring);
+}
+
+static void printmsg(const char *text, ...)
+{
+ va_list ap;
+ if (noiselevel < MESSAGES)
+ return;
+ va_start(ap, text);
+ if (!gc) {
+ vprintf(text, ap);
+ printf("\n");
+ } else {
+ char s[256];
+ vsprintf(s, text, ap);
+ uih_message(gc, s);
+ interrupt |= gc->interrupt |= gc->passfunc(gc, 1, s, 100);
+ uih_clearwindows(gc);
+ }
+}
+
+static int
+passfunc(struct uih_context *c, int display, CONST char *text,
+ float percent)
+{
+ if (noiselevel < ALL)
+ return 0;
+ if (gc) {
+ if (gc->passfunc != NULL)
+ interrupt |= gc->interrupt |=
+ gc->passfunc(gc, display, text, percent);
+ uih_clearwindows(gc);
+ return interrupt;
+ } else if (display) {
+ {
+ if (newline)
+ printf("\n"), newline = 0;
+ printf("\r %s %3.2f%% ", text, (double) percent);
+ fflush(stdout);
+ }
+ }
+ return 0;
+}
+
+
+struct frame_info {
+ vrect rect;
+ number_t angle;
+ char *name;
+ int newimage;
+};
+static void
+save_frame_dist(uih_context * c, int backward, struct frame_info *f1,
+ struct frame_info *f2)
+{
+ xio_file f;
+ int x1, y1;
+ char str[256];
+ if (!(f2->rect.mc - f2->rect.nc) || !(f2->rect.mi - f2->rect.ni))
+ return;
+ /*printf ("Frame\n"); */
+ sprintf(str, "%s.%c", f1->name, backward ? 'b' : 'p');
+ f = xio_wopen(str);
+ if (f == NULL) {
+ x_error(gettext("Cannot open motion vector file!"));
+ return;
+ }
+ for (y1 = 0; y1 < (c->image->height + 7) / 8; y1++) {
+ for (x1 = 0; x1 < (c->image->width + 7) / 8; x1++) {
+ number_t x, y;
+ number_t x2, y2;
+ number_t tmp;
+ x = f1->rect.nc + (x1 * 8 + 4) * (f1->rect.mc -
+ f1->rect.nc) /
+ c->image->width;
+ y = f1->rect.ni + (y1 * 8 + 4) * (f1->rect.mi -
+ f1->rect.ni) /
+ c->image->height;
+
+ if (f2->angle != f1->angle) {
+ tmp =
+ x * cos(f2->angle - f1->angle) - y * sin(f2->angle -
+ f1->angle);
+ y = x * sin(f2->angle - f1->angle) + y * cos(f2->angle -
+ f1->angle);
+ x = tmp;
+ }
+ x2 = (x - f2->rect.nc) * c->image->width / (f2->rect.mc -
+ f2->rect.nc);
+ y2 = (y - f2->rect.ni) * c->image->height / (f2->rect.mi -
+ f2->rect.ni);
+ sprintf(str, "%3.2g %3.2g ",
+ ((int) ((x2 - (x1 * 8 + 4)) * 10)) / 10.0,
+ ((int) ((y2 - (y1 * 8 + 4)) * 10)) / 10.0);
+ xio_puts(str, f);
+ }
+ xio_putc('\n', f);
+ }
+ xio_close(f);
+ /*printf ("Frameend\n"); */
+}
+
+#define MAXBFRAMES 5
+#define IFRAMEDIST (27)
+static int iframedist;
+static int mvectors;
+static xio_file patf;
+static void
+uih_encodeframe(int startpos, int endpos, struct frame_info *curframe)
+{
+ static int lastiframe = -200;
+ static struct frame_info lastp;
+ static struct frame_info bframes[MAXBFRAMES];
+ static int nbframes = 0;
+ int i;
+ char type;
+ if (!gc)
+ printf(" motion");
+ fflush(stdout);
+ if (endpos > startpos + 4) {
+ if (endpos - lastiframe > iframedist)
+ type = 'I';
+ else
+ type = 'P';
+ } else {
+ if (endpos - lastiframe > iframedist)
+ type = 'I';
+ else
+ type = (startpos - lastiframe) % 3 ? 'B' : 'P';
+ if (startpos != endpos)
+ type = 'P';
+ }
+ if (curframe->newimage)
+ type = 'I';
+ if (mvectors) {
+ switch (type) {
+ case 'I':
+ if (startpos)
+ save_frame_dist(uih, 0, curframe, &lastp);
+ lastp = *curframe;
+ break;
+ case 'P':
+ save_frame_dist(uih, 0, curframe, &lastp);
+ lastp = *curframe;
+ break;
+ case 'B':
+ save_frame_dist(uih, 0, curframe, &lastp);
+ if (nbframes < MAXBFRAMES) {
+ bframes[nbframes] = *curframe;
+ bframes[nbframes].name = mystrdup(curframe->name);
+ nbframes++;
+ }
+ break;
+ }
+ }
+ xio_putc(type, patf);
+ if (type == 'I')
+ lastiframe = startpos;
+ if (startpos != endpos) {
+ while (startpos != endpos)
+ xio_putc('p', patf), startpos++;
+ }
+ if (!gc)
+ printf(" %c", type);
+ fflush(stdout);
+ if (mvectors) {
+ if (type != 'B' && nbframes) {
+ if (!gc)
+ printf(" backframes");
+ fflush(stdout);
+ for (i = 0; i < nbframes; i++) {
+ save_frame_dist(uih, 1, bframes + i, curframe);
+ fflush(stdout);
+ free(bframes[i].name);
+ }
+ nbframes = 0;
+ }
+ }
+ xio_flush(patf);
+}
+
+extern struct filteraction antialias_filter;
+int
+uih_renderanimation(struct uih_context *gc1, CONST char *basename,
+ CONST xio_constpath animation, int width, int height,
+ float pixelwidth, float pixelheight, int frametime,
+ int type, int antialias, int slowmode,
+ int letterspersec, CONST char *catalog,
+ int motionvectors, int iframedist2)
+{
+ struct palette *pal =
+ createpalette(0, 0, type, 0, 0, NULL, NULL, NULL, NULL, NULL);
+ struct image *img;
+ xio_file of;
+ FILE *f;
+ xio_file af;
+ char s[200];
+ int lastframenum = -1;
+ int aliasnum = 0;
+ static char *saveddata;
+ int newimage;
+ int y;
+
+ struct frame_info curframe;
+ int framenum = 0;
+
+
+ noiselevel = ALL;
+ gc = gc1;
+ if (gc)
+ gc->incalculation = 1;
+
+ mvectors = motionvectors;
+ printmsg(gettext("Vectors: %i"), motionvectors);
+ if (iframedist2)
+ iframedist = iframedist2;
+ else
+ iframedist = 27;
+
+ printmsg(gettext("Initializing"));
+ if (!(type & (TRUECOLOR24 | TRUECOLOR | TRUECOLOR16 | GRAYSCALE)))
+ antialias = 0;
+
+ while (uih_filters[aliasnum] != &antialias_filter)
+ aliasnum++;
+
+ if (!pal) {
+ error(gettext("Cannot create palette"));
+ if (gc)
+ gc->incalculation = 0;
+ return 0;
+ }
+ if (!pixelwidth)
+ pixelwidth = 29.0 / width;
+ if (!pixelheight)
+ pixelheight = 21.5 / height;
+ img = create_image_mem(width, height, 2, pal, pixelwidth, pixelheight);
+ if (!img) {
+ error(gettext("Cannot create image\n"));
+ if (gc)
+ gc->incalculation = 0;
+ destroypalette(pal);
+ return 0;
+ }
+ saveddata =
+ (char *) malloc(img->width * img->height * img->bytesperpixel);
+ if (saveddata == NULL) {
+ error(gettext("Cannot create checking buffer!"));
+ if (gc)
+ gc->incalculation = 0;
+ destroy_image(img);
+ destroypalette(pal);
+ return 0;
+ }
+ uih = uih_mkcontext(0, img, passfunc, NULL, NULL);
+ if (!uih) {
+ error(gettext("Cannot create context\n"));
+ if (gc)
+ gc->incalculation = 0;
+ destroy_image(img);
+ destroypalette(pal);
+ free(saveddata);
+ return 0;
+ }
+ uih->fcontext->slowmode = 1;
+ uih_constantframetime(uih, frametime);
+ af = xio_ropen(animation);
+ if (af == NULL) {
+ error(gettext("Cannot open animation file\n"));
+ if (gc)
+ gc->incalculation = 0;
+ uih_freecontext(uih);
+ destroy_image(img);
+ destroypalette(pal);
+ free(saveddata);
+ return 0;
+ }
+
+ if (!gc) {
+ printmsg(gettext("Loading catalogs"));
+ if (!gc) {
+ uih_loadcatalog(uih, "english");
+ if (uih->errstring) {
+ uiherror(uih);
+ if (gc)
+ gc->incalculation = 0;
+ uih_freecontext(uih);
+ destroy_image(img);
+ destroypalette(pal);
+ free(saveddata);
+ xio_close(af);
+ return 0;
+ }
+ }
+ if (catalog != NULL)
+ uih_loadcatalog(uih, catalog);
+ if (uih->errstring) {
+ uiherror(uih);
+ if (gc)
+ gc->incalculation = 0;
+ uih_freecontext(uih);
+ destroy_image(img);
+ destroypalette(pal);
+ free(saveddata);
+ if (!gc)
+ uih_freecatalog(uih);
+ xio_close(af);
+ return 0;
+ }
+ printmsg(gettext("Processing command line options"));
+ {
+ CONST menuitem *item;
+ dialogparam *d;
+ while ((item = menu_delqueue(&d)) != NULL) {
+ menu_activate(item, uih, d);
+ }
+ }
+ if (uih->errstring) {
+ uiherror(uih);
+ if (gc)
+ gc->incalculation = 0;
+ uih_freecontext(uih);
+ destroy_image(img);
+ destroypalette(pal);
+ free(saveddata);
+ if (!gc)
+ uih_freecatalog(uih);
+ xio_close(af);
+ return 0;
+ }
+ }
+
+ printmsg(gettext("Enabling animation replay\n"));
+
+ uih_replayenable(uih, af, animation, 1);
+
+ sprintf(s, "%s.par", basename);
+ of = xio_wopen(s);
+ if (of == NULL) {
+ error(gettext("Cannot open image file"));
+ if (gc)
+ gc->incalculation = 0;
+ uih_freecontext(uih);
+ destroy_image(img);
+ destroypalette(pal);
+ free(saveddata);
+ if (!gc)
+ uih_freecatalog(uih);
+ return 0;
+ }
+ sprintf(s, "%s.pat", basename);
+ patf = xio_wopen(s);
+ if (patf == NULL) {
+ error(gettext("Cannot open pattern file"));
+ if (gc)
+ gc->incalculation = 0;
+ uih_freecontext(uih);
+ destroy_image(img);
+ destroypalette(pal);
+ free(saveddata);
+ if (!gc)
+ uih_freecatalog(uih);
+ xio_close(of);
+ return 0;
+ }
+ uih_letterspersec(uih, letterspersec);
+
+
+
+ if (!gc)
+ x_message(gettext("Entering calculation loop!"));
+ else
+ printmsg(gettext("Entering calculation loop!"));
+
+ while ((uih->play || uih->display) && !interrupt) {
+ if (uih->errstring) {
+ uiherror(uih);
+ if (gc)
+ gc->incalculation = 0;
+ uih_freecontext(uih);
+ destroy_image(img);
+ destroypalette(pal);
+ free(saveddata);
+ if (!gc)
+ uih_freecatalog(uih);
+ xio_close(of);
+ xio_close(patf);
+ return 0;
+ }
+ fflush(stdout);
+ tl_process_group(syncgroup, NULL);
+ uih_update(uih, 0, 0, 0);
+
+
+ if (uih->display) {
+
+ if (lastframenum < framenum - 1) {
+ if (lastframenum == framenum - 1)
+ printmsg(gettext("Frame %i skipped."), framenum - 1);
+ else
+ printmsg(gettext("Frames %i - %i skipped."),
+ lastframenum, framenum - 1);
+ }
+
+ printmsg(gettext("Frame %4i: "), framenum);
+
+ newline = 1;
+ newimage = 0;
+ if (uih->recalculatemode > 0) {
+ if (!gc)
+ printf("calculating"), fflush(stdout);
+ if (slowmode)
+ uih_newimage(uih), uih->fcontext->version++;
+ }
+ if (antialias && !uih->filter[aliasnum]) {
+ if (!gc)
+ printf("antialias ");
+ uih->aliasnum = aliasnum;
+ uih_enablefilter(uih, aliasnum);
+ }
+ uih_prepare_image(uih);
+
+ if (!gc)
+ printf(" rendering");
+ fflush(stdout);
+ uih_drawwindows(uih);
+
+ y = 0;
+ if (lastframenum >= 0) {
+ for (; y < img->height; y++)
+ if (memcmp
+ (saveddata + img->width * img->bytesperpixel * y,
+ uih->image->currlines[y],
+ img->width * img->bytesperpixel))
+ break;
+ }
+
+
+ if (y != img->height) {
+ for (; y < img->height; y++)
+ memcpy(saveddata + img->width * img->bytesperpixel * y,
+ uih->image->currlines[y],
+ img->width * img->bytesperpixel);
+ if (framenum)
+ uih_encodeframe(lastframenum, framenum - 1, &curframe);
+ if (!gc)
+ printf(" saving");
+ fflush(stdout);
+ sprintf(s, "%s%04i.png", basename, framenum);
+ curframe.rect = uih->fcontext->rs;
+ curframe.angle = uih->fcontext->angle;
+ curframe.name = s;
+ curframe.newimage = newimage;
+
+
+ f = fopen(s, "wb");
+ if (f == NULL) {
+ error(gettext("Cannot open image file"));
+ if (gc)
+ gc->incalculation = 0;
+ uih_freecontext(uih);
+ destroy_image(img);
+ destroypalette(pal);
+ free(saveddata);
+ if (!gc)
+ uih_freecatalog(uih);
+ xio_close(of);
+ xio_close(patf);
+ return 0;
+ }
+ writepng(f, uih->image);
+ printmsg(gettext(" done."));
+ uih_displayed(uih);
+ lastframenum = framenum;
+ } else {
+ printmsg(gettext(" skipping..."));
+ uih_displayed(uih);
+ }
+ }
+ xio_puts(s, of);
+ xio_puts("\n", of);
+ xio_flush(of);
+ framenum++;
+ }
+ curframe.newimage = 1;
+ if (framenum)
+ uih_encodeframe(lastframenum, framenum - 1, &curframe);
+ if (uih->errstring) {
+ uiherror(uih);
+ if (gc)
+ gc->incalculation = 0;
+ uih_freecontext(uih);
+ destroy_image(img);
+ destroypalette(pal);
+ free(saveddata);
+ if (!gc)
+ uih_freecatalog(uih);
+ xio_close(of);
+ xio_close(patf);
+ return 0;
+ }
+ xio_close(of);
+ free(saveddata);
+ xio_close(patf);
+ uih_freecontext(uih);
+ destroy_image(img);
+ destroypalette(pal);
+ if (interrupt)
+ error(gettext("Calculation interrupted"));
+ else {
+ if (!gc)
+ x_message(gettext("Calculation finished"));
+ else
+ printmsg(gettext("Calculation finished"));
+ }
+ if (gc)
+ gc->incalculation = 0;
+ if (!gc)
+ uih_freecatalog(uih);
+ return 1;
+}
+
+int
+uih_renderimage(struct uih_context *gc1, xio_file af,
+ CONST xio_constpath path, struct image *img, int antialias,
+ CONST char *catalog, int noise)
+{
+ int aliasnum = 0;
+ int ok = 1;
+ noiselevel = noise;
+ gc = gc1;
+ if (gc)
+ gc->incalculation = 1;
+
+ while (uih_filters[aliasnum] != &antialias_filter)
+ aliasnum++;
+
+ uih = uih_mkcontext(0, img, passfunc, NULL, NULL);
+ if (!uih) {
+ error(gettext("Cannot create context\n"));
+ if (gc)
+ gc->incalculation = 0;
+ return 0;
+ }
+ uih->fcontext->slowmode = 1;
+ uih_constantframetime(uih, 1000000 / 10);
+
+ if (!gc) {
+ printmsg(gettext("Loading catalogs"));
+ uih_loadcatalog(uih, "english");
+ if (uih->errstring) {
+ fprintf(stderr, uih->errstring);
+ uih_clearmessages(uih);
+ uih->errstring = NULL;
+ }
+ if (catalog != NULL)
+ uih_loadcatalog(uih, catalog);
+ if (uih->errstring) {
+ fprintf(stderr, uih->errstring);
+ uih_clearmessages(uih);
+ uih->errstring = NULL;
+ }
+ if (uih->errstring) {
+ uih_freecatalog(uih);
+ uih_freecontext(uih);
+ uiherror(uih);
+ if (gc)
+ gc->incalculation = 0;
+ return 0;
+ }
+ }
+
+ uih_load(uih, af, path);
+ if (uih->errstring) {
+ uiherror(uih);
+ uih_freecatalog(uih);
+ uih_freecontext(uih);
+ if (gc)
+ gc->incalculation = 0;
+ return 0;
+ }
+ printmsg(gettext("Entering calculation loop!"));
+
+ tl_process_group(syncgroup, NULL);
+ uih_update(uih, 0, 0, 0);
+
+ uih_newimage(uih), uih->fcontext->version++;
+ if (antialias && !uih->filter[aliasnum]) {
+ uih->aliasnum = aliasnum;
+ uih_enablefilter(uih, aliasnum);
+ }
+ uih_prepare_image(uih);
+ if (uih->errstring)
+ ok = 0;
+ uih_drawwindows(uih);
+ if (uih->errstring)
+ ok = 0;
+ uih_freecontext(uih);
+ uih_freecatalog(uih);
+ if (interrupt)
+ error(gettext("Calculation interrupted"));
+ else {
+ printmsg(gettext("Calculation finished"));
+ }
+ if (gc)
+ gc->incalculation = 0;
+ return 1;
+}
diff --git a/src/ui-hlp/save.c b/src/ui-hlp/save.c
new file mode 100644
index 0000000..853b61b
--- /dev/null
+++ b/src/ui-hlp/save.c
@@ -0,0 +1,704 @@
+#include <config.h>
+#ifndef _plan9_
+#include <limits.h>
+#include <string.h>
+#include <errno.h>
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#else
+#include <u.h>
+#include <libc.h>
+#endif
+#include <filter.h>
+#include <fractal.h>
+#include <ui_helper.h>
+#include <config.h>
+#include <version.h>
+#include <xmenu.h>
+#include <xldio.h>
+#include "play.h"
+#define myputs(s) ((xio_puts(s,uih->savec->file)==XIO_EOF)?outputerror(uih),1:0)
+#define myputc(s) ((xio_putc(s,uih->savec->file)==XIO_EOF)?outputerror(uih),1:0)
+static int first;
+static int changed;
+static int last;
+CONST char *CONST save_fastmode[] =
+ { "zero", "never", "animation", "new", "allways", NULL };
+CONST char *CONST xtextposnames[] = { "left", "center", "right", NULL };
+CONST char *CONST ytextposnames[] = { "top", "middle", "bottom", NULL };
+
+REGISTERS(3)
+static void outputerror(struct uih_context *uih)
+{
+ static char error[245];
+ if (uih->savec->writefailed)
+ return;
+ sprintf(error, "Write failed:%s", xio_errorstring());
+ uih_error(uih, error);
+ uih->savec->writefailed = 1;
+}
+
+REGISTERS(3)
+static void start_save(struct uih_context *uih, CONST char *name)
+{
+ if (!changed && !uih->savec->firsttime) {
+ char s[256];
+ sprintf(s, "\n(usleep %i)\n", tl_lookup_timer(uih->savec->timer));
+ myputs(s);
+ tl_reset_timer(uih->savec->timer);
+ }
+ changed = 1;
+ myputc('(');
+ myputs(name);
+ first = 0;
+}
+
+REGISTERS(3)
+static void stop_save(struct uih_context *uih)
+{
+ myputc(')');
+ myputc('\n');
+}
+
+#ifdef SAVEKEYWORDUSED
+REGISTERS(3)
+static void save_keyword(struct uih_context *uih, CONST char *name)
+{
+ if (!first)
+ myputc(' ');
+ else
+ first = 0;
+ myputs(name);
+}
+#endif
+REGISTERS(3)
+static void save_keystring(struct uih_context *uih, CONST char *name)
+{
+ if (!first)
+ myputc(' ');
+ else
+ first = 0;
+ myputc('\'');
+ myputs(name);
+}
+
+REGISTERS(3)
+static void save_float(struct uih_context *uih, number_t number)
+{
+ if (!first)
+ myputc(' ');
+ else
+ first = 0;
+#ifdef HAVE_LONG_DOUBLE
+ /*20 should be enought to specify 64digit number :) */
+#ifdef USE_XLDIO
+ x_ldout((long double) number, 20, uih->savec->file);
+#else
+ {
+ char s[256];
+ sprintf(s, "%.20LG", (long double) number);
+ myputs(s);
+ }
+#endif
+#else
+ {
+ char s[256];
+ sprintf(s, "%.20G", (double) number);
+ myputs(s);
+ }
+#endif
+}
+
+REGISTERS(3)
+static void
+save_float2(struct uih_context *uih, number_t number, int places)
+{
+ char fs[10];
+ if (!first)
+ myputc(' ');
+ else
+ first = 0;
+ if (places < 0)
+ places = 0;
+ if (places > 20)
+ places = 20;
+#ifdef HAVE_LONG_DOUBLE
+#ifdef USE_XLDIO
+ fs[0] = 0; /* Avoid warning */
+ x_ldout((long double) number, places, uih->savec->file);
+#else
+ {
+ char s[256];
+ sprintf(fs, "%%.%iLG", places);
+ sprintf(s, fs, (long double) number);
+ myputs(s);
+ }
+#endif
+#else
+ {
+ char s[256];
+ sprintf(fs, "%%.%iG", places);
+ sprintf(s, fs, (double) number);
+ myputs(s);
+ }
+#endif
+}
+
+REGISTERS(3)
+static void save_int(struct uih_context *uih, int number)
+{
+ char s[256];
+ if (!first)
+ myputc(' ');
+ else
+ first = 0;
+ sprintf(s, "%i", number);
+ myputs(s);
+}
+
+REGISTERS(3)
+static void save_onoff(struct uih_context *uih, int number)
+{
+ if (!first)
+ myputc(' ');
+ else
+ first = 0;
+ myputs(number ? "#t" : "#f");
+}
+
+REGISTERS(3)
+static void save_string(struct uih_context *uih, CONST char *text)
+{
+ int i = 0;
+ if (!first)
+ myputc(' ');
+ else
+ first = 0;
+ myputc('"');
+ while (text[i] != 0) {
+ if (text[i] == '"')
+ myputc('\\');
+ myputc(text[i]);
+ i++;
+ }
+ myputc('"');
+}
+
+REGISTERS(3)
+static void
+save_intc(struct uih_context *uih, CONST char *name, int number)
+{
+ start_save(uih, name);
+ save_int(uih, number);
+ stop_save(uih);
+}
+
+REGISTERS(3)
+static void
+save_onoffc(struct uih_context *uih, CONST char *name, int number)
+{
+ start_save(uih, name);
+ save_onoff(uih, number);
+ stop_save(uih);
+}
+
+REGISTERS(3)
+static void
+save_floatc(struct uih_context *uih, CONST char *name, number_t number)
+{
+ start_save(uih, name);
+ save_float(uih, number);
+ stop_save(uih);
+}
+
+REGISTERS(3)
+static void
+save_float2c(struct uih_context *uih, CONST char *name,
+ number_t number, int places)
+{
+ start_save(uih, name);
+ save_float2(uih, number, places);
+ stop_save(uih);
+}
+
+REGISTERS(3)
+static void
+save_coordc(struct uih_context *uih, CONST char *name,
+ number_t number, number_t number2)
+{
+ start_save(uih, name);
+ save_float(uih, number);
+ save_float(uih, number2);
+ stop_save(uih);
+}
+
+REGISTERS(3)
+static void
+save_keystringc(struct uih_context *uih, CONST char *name,
+ CONST char *param)
+{
+ start_save(uih, name);
+ save_keystring(uih, param);
+ stop_save(uih);
+}
+
+REGISTERS(3)
+static void
+save_stringc(struct uih_context *uih, CONST char *name, CONST char *param)
+{
+ start_save(uih, name);
+ save_string(uih, param);
+ stop_save(uih);
+}
+
+REGISTERS(3)
+static void save_noparam(struct uih_context *uih, CONST char *name)
+{
+ start_save(uih, name);
+ stop_save(uih);
+}
+
+REGISTERS(3)
+static void
+save_nstring(struct uih_context *uih, int number,
+ CONST char *CONST * CONST texts)
+{
+ save_keystring(uih, texts[number]);
+}
+
+REGISTERS(3)
+static void
+save_nstringc(struct uih_context *uih, CONST char *name, int number,
+ CONST char *CONST * CONST texts)
+{
+ save_keystringc(uih, name, texts[number]);
+}
+
+static int ndecimals(struct uih_context *uih)
+{
+ number_t n = 10000;
+ number_t m = uih->fcontext->s.rr;
+ int i;
+ if (uih->fcontext->s.ri < m)
+ m = uih->fcontext->s.ri;
+ if (uih->fcontext->s.ri > 100 || uih->fcontext->s.rr > 100)
+ return (20);
+ for (i = 0; i < 20 && m < n; i++, n /= 10);
+ return (i);
+}
+
+static void savepos(struct uih_context *uih) REGISTERS(3);
+REGISTERS(3)
+static void savepos(struct uih_context *uih)
+{
+ int n = ndecimals(uih);
+ start_save(uih, "view");
+ save_float2(uih, uih->fcontext->s.cr, n);
+ save_float2(uih, uih->fcontext->s.ci, n);
+ save_float2(uih, uih->fcontext->s.rr, n);
+ save_float2(uih, uih->fcontext->s.ri, n);
+ stop_save(uih);
+ uih->savec->fcontext->s = uih->fcontext->s;
+}
+
+static void savepos2(struct uih_context *uih) REGISTERS(3);
+REGISTERS(3)
+static void savepos2(struct uih_context *uih)
+{
+ int n = ndecimals(uih);
+ start_save(uih, "animateview");
+ save_float2(uih, uih->fcontext->s.cr, n);
+ save_float2(uih, uih->fcontext->s.ci, n);
+ save_float2(uih, uih->fcontext->s.rr, n);
+ save_float2(uih, uih->fcontext->s.ri, n);
+ stop_save(uih);
+ uih->savec->fcontext->s = uih->fcontext->s;
+}
+
+static void savepos3(struct uih_context *uih) REGISTERS(3);
+REGISTERS(3)
+static void savepos3(struct uih_context *uih)
+{
+ int n = ndecimals(uih);
+ start_save(uih, "morphview");
+ save_float2(uih, uih->fcontext->s.cr, n);
+ save_float2(uih, uih->fcontext->s.ci, n);
+ save_float2(uih, uih->fcontext->s.rr, n);
+ save_float2(uih, uih->fcontext->s.ri, n);
+ stop_save(uih);
+ uih->savec->fcontext->s = uih->fcontext->s;
+}
+
+void uih_saveframe(struct uih_context *uih)
+{
+ struct uih_savedcontext *s = uih->savec;
+ int i;
+ int resetsync = 0;
+ if (uih->save) {
+ changed = 0;
+ if (s->firsttime)
+ save_noparam(uih, "initstate");
+ if (s->nonfractalscreen && !uih->nonfractalscreen)
+ save_noparam(uih, "display"), s->nonfractalscreen = 0;
+ for (i = uih_nfilters; i >= 0; i--) {
+ if (uih->filter[i] != NULL) {
+ if (s->filter[i] != 1) {
+ start_save(uih, "filter");
+ save_keystring(uih, uih->filter[i]->action->shortname);
+ save_onoff(uih, 1);
+ s->filter[i] = 1;
+ stop_save(uih);
+ }
+ } else if (s->filter[i] != 0) {
+ s->filter[i] = 0;
+ start_save(uih, "filter");
+ save_keystring(uih, uih_filters[i]->shortname);
+ save_onoff(uih, 0);
+ stop_save(uih);
+ }
+ }
+ if (uih->palettechanged) {
+ switch (uih->palettetype) {
+ case 0:
+ save_intc(uih, "defaultpalette", uih->paletteshift);
+ break;
+ default:
+ start_save(uih, "palette");
+ save_int(uih, uih->palettetype);
+ save_int(uih, uih->paletteseed);
+ save_int(uih, uih->paletteshift);
+ stop_save(uih);
+ break;
+ }
+ uih->palettechanged = 0;
+ s->manualpaletteshift = 0;
+ }
+ if (s->manualpaletteshift != uih->manualpaletteshift)
+ save_intc(uih, "shiftpalette",
+ uih->manualpaletteshift - s->manualpaletteshift),
+ s->manualpaletteshift = uih->manualpaletteshift;
+ if (s->fcontext->currentformula != uih->fcontext->currentformula) {
+ save_keystringc(uih, "formula",
+ uih->fcontext->currentformula->shortname),
+ s->fcontext->currentformula =
+ uih->fcontext->currentformula;
+#ifdef SFFE_USING
+/*SFFE : malczak */
+ if ((int) (uih->fcontext->currentformula - formulas) == 24) //user formula
+ {
+ save_stringc(uih, "usrform", uih->parser->expression);
+ if (uih->pinit)
+ save_stringc(uih, "usrformInit",
+ uih->pinit->expression);
+ else
+ save_stringc(uih, "usrformInit", "");
+ };
+/*SFFE : malczak */
+#endif
+ set_formula(s->fcontext,
+ (int) (uih->fcontext->currentformula - formulas));
+ }
+ if (s->mode >= UIH_SAVEALL)
+ save_intc(uih, "letterspersec", uih->letterspersec);
+ if (s->mode > UIH_SAVEPOS) {
+ if (s->speedup != uih->speedup)
+ save_floatc(uih, "speedup", uih->speedup), s->speedup =
+ uih->speedup;
+ if (s->maxstep != uih->maxstep)
+ save_floatc(uih, "maxstep", uih->maxstep), s->maxstep =
+ uih->maxstep;
+ if (s->fastmode != uih->fastmode)
+ save_nstringc(uih, "fastmode", uih->fastmode,
+ save_fastmode), s->fastmode = uih->fastmode;
+ }
+ if (s->juliamode != uih->juliamode)
+ save_onoffc(uih, "fastjulia", uih->juliamode), s->juliamode =
+ uih->juliamode;
+ if (s->cycling != uih->cycling)
+ save_onoffc(uih, "cycling", uih->cycling), s->cycling =
+ uih->cycling;
+ if (s->mode >= UIH_SAVEPOS
+ && s->fcontext->periodicity != uih->fcontext->periodicity)
+ save_onoffc(uih, "periodicity", uih->fcontext->periodicity),
+ s->fcontext->periodicity = uih->fcontext->periodicity;
+ if ((uih->cycling || s->mode >= UIH_SAVEALL)
+ && (s->cyclingspeed != uih->cyclingspeed
+ || s->direction != uih->direction * uih->cyclingdirection))
+ save_intc(uih, "cyclingspeed",
+ uih->cyclingspeed * uih->direction *
+ uih->cyclingdirection), s->cyclingspeed =
+ uih->cyclingspeed, s->direction =
+ uih->direction * uih->cyclingdirection;
+ if ((s->mode > UIH_SAVEPOS && (uih->step || uih->zoomactive))
+ && (s->xcenter != uih->xcenter || s->ycenter != uih->ycenter))
+ save_coordc(uih, "zoomcenter", uih->xcenter, uih->ycenter),
+ s->xcenter = uih->xcenter, s->ycenter = uih->ycenter;
+ if ((!uih->fcontext->mandelbrot || uih->juliamode)
+ && (s->fcontext->pre != uih->fcontext->pre
+ || s->fcontext->pim != uih->fcontext->pim)) {
+ if (uih->juliamode && uih->pressed)
+ save_coordc(uih, "morphjulia", uih->fcontext->pre,
+ uih->fcontext->pim), s->fcontext->pre =
+ uih->fcontext->pre, s->fcontext->pim =
+ uih->fcontext->pim;
+ else
+ save_coordc(uih, "juliaseed", uih->fcontext->pre,
+ uih->fcontext->pim), s->fcontext->pre =
+ uih->fcontext->pre, s->fcontext->pim =
+ uih->fcontext->pim;
+ }
+ if (uih->fcontext->bre != s->fcontext->bre
+ || uih->fcontext->bim != s->fcontext->bim) {
+ save_coordc(uih, "perturbation", uih->fcontext->bre,
+ uih->fcontext->bim), s->fcontext->bre =
+ uih->fcontext->bre, s->fcontext->bim = uih->fcontext->bim;
+ }
+ if (uih->fastrotate != s->fastrotate && s->mode > UIH_SAVEPOS) {
+ save_onoffc(uih, "fastrotate", uih->fastrotate);
+ s->fastrotate = uih->fastrotate;
+ }
+ if (uih->fcontext->angle != s->fcontext->angle
+ && s->autorotate != 1) {
+ if (s->rotatepressed && s->mode == UIH_SAVEANIMATION)
+ save_float2c(uih, "morphangle", uih->fcontext->angle, 5);
+ else
+ save_float2c(uih, "angle", uih->fcontext->angle, 5);
+ s->rotatepressed = uih->rotatepressed;
+ s->fcontext->angle = uih->fcontext->angle;
+ }
+ if (uih->rotationspeed != s->rotationspeed
+ &&
+ ((s->mode > UIH_SAVEPOS
+ && uih->rotatemode == ROTATE_CONTINUOUS)
+ || s->mode >= UIH_SAVEALL)) {
+ save_float2c(uih, "rotationspeed", uih->rotationspeed, 6);
+ s->rotationspeed = uih->rotationspeed;
+ }
+ if (s->autorotate != (uih->rotatemode == ROTATE_CONTINUOUS)) {
+ s->autorotate = (uih->rotatemode == ROTATE_CONTINUOUS);
+ save_onoffc(uih, "autorotate", s->autorotate);
+ }
+ if (s->fcontext->maxiter != uih->fcontext->maxiter)
+ save_intc(uih, "maxiter", uih->fcontext->maxiter),
+ s->fcontext->maxiter = uih->fcontext->maxiter;
+ if (s->fcontext->bailout != uih->fcontext->bailout)
+ save_floatc(uih, "bailout", uih->fcontext->bailout),
+ s->fcontext->bailout = uih->fcontext->bailout;
+ if (s->fcontext->coloringmode != uih->fcontext->coloringmode)
+ save_intc(uih, "outcoloring", uih->fcontext->coloringmode),
+ s->fcontext->coloringmode = uih->fcontext->coloringmode;
+ if (s->fcontext->incoloringmode != uih->fcontext->incoloringmode)
+ save_intc(uih, "incoloring", uih->fcontext->incoloringmode),
+ s->fcontext->incoloringmode =
+ uih->fcontext->incoloringmode;
+ if (s->fcontext->incoloringmode != uih->fcontext->incoloringmode)
+ save_intc(uih, "incoloring", uih->fcontext->incoloringmode),
+ s->fcontext->incoloringmode =
+ uih->fcontext->incoloringmode;
+ if ((s->fcontext->incoloringmode == 10 || s->mode >= UIH_SAVEALL)
+ && s->fcontext->intcolor != uih->fcontext->intcolor)
+ save_intc(uih, "intcoloring", uih->fcontext->intcolor),
+ s->fcontext->intcolor = uih->fcontext->intcolor;
+ if ((s->fcontext->coloringmode == 10 || s->mode >= UIH_SAVEALL)
+ && s->fcontext->outtcolor != uih->fcontext->outtcolor)
+ save_intc(uih, "outtcoloring", uih->fcontext->outtcolor),
+ s->fcontext->outtcolor = uih->fcontext->outtcolor;
+ if (s->fcontext->mandelbrot != uih->fcontext->mandelbrot)
+ save_onoffc(uih, "julia", !uih->fcontext->mandelbrot),
+ s->fcontext->mandelbrot = uih->fcontext->mandelbrot;
+ if (s->mode > UIH_SAVEPOS
+ && s->fcontext->range != uih->fcontext->range)
+ save_intc(uih, "range", uih->fcontext->range),
+ s->fcontext->range = uih->fcontext->range;
+ if (s->fcontext->plane != uih->fcontext->plane)
+ save_intc(uih, "plane", uih->fcontext->plane),
+ s->fcontext->plane = uih->fcontext->plane;
+ if (s->zoomactive != uih->zoomactive && s->mode > UIH_SAVEPOS) {
+ switch (uih->zoomactive) {
+ case -1:
+ save_noparam(uih, "unzoom");
+ break;
+ case 1:
+ save_noparam(uih, "zoom");
+ break;
+ default:
+ save_noparam(uih, "stop");
+ break;
+ }
+ s->zoomactive = uih->zoomactive;
+ }
+ if ((s->mode >= UIH_SAVEPOS || uih->displaytext)
+ && s->color != uih->color) {
+ start_save(uih, "color");
+ save_nstring(uih, uih->color, uih_colornames);
+ stop_save(uih);
+ s->color = uih->color;
+ }
+ if (s->clearscreen) {
+ save_noparam(uih, "clearscreen");
+ s->clearscreen = 0;
+ s->nonfractalscreen = 1;
+ }
+ if (uih->displaytext) {
+ for (i = 0; i < 3; i++) {
+ if (uih->displaytext & (1 << i)) {
+ if (s->ytextpos != i || s->xtextpos != uih->textpos[i]) {
+ start_save(uih, "textpossition");
+ save_nstring(uih, uih->xtextpos, xtextposnames);
+ save_nstring(uih, uih->ytextpos, ytextposnames);
+ stop_save(uih);
+ s->xtextpos = uih->xtextpos;
+ s->ytextpos = uih->ytextpos;
+ }
+ save_stringc(uih, "text", uih->text[i]);
+ s->nonfractalscreen = 1;
+ }
+ }
+ save_noparam(uih, "textsleep");
+ uih->displaytext = 0;
+ }
+ if (s->autorotate && changed
+ && tl_lookup_timer(uih->savec->synctimer) > 500000)
+ save_float2c(uih, "angle", uih->fcontext->angle, 5),
+ resetsync = 1;
+ if (s->mode == UIH_SAVEPOS)
+ savepos(uih);
+ else {
+ if (uih->viewchanged)
+ savepos(uih), uih->viewchanged = 0;
+ else if (uih->moved)
+ savepos3(uih), uih->moved = 0;
+ else if (((changed && uih->step) || last)
+ && tl_lookup_timer(uih->savec->synctimer) > 500000)
+ resetsync = 1, savepos2(uih);
+ }
+ if (uih->savec->firsttime)
+ uih->savec->firsttime = 0;
+ if (s->writefailed)
+ uih_save_disable(uih);
+ if (resetsync)
+ tl_reset_timer(uih->savec->synctimer);
+ } /*if uih->save */
+}
+
+int uih_save_enable(struct uih_context *uih, xio_file f, int mode)
+{
+ struct uih_savedcontext *s;
+ int i;
+ last = 0;
+ if (uih->save) {
+ uih_error(uih, "Recording is already enabled");
+ return 0;
+ }
+ s = (struct uih_savedcontext *) calloc(1, sizeof(*s));
+ if (f == NULL || s == NULL) {
+ uih_error(uih, "File could not be opended or out of memory");
+ return 0;
+ }
+ uih->savec = s;
+ s->fcontext =
+ make_fractalc(1, uih->image->pixelwidth * uih->image->width,
+ uih->image->pixelheight * uih->image->height);
+ if (s->fcontext == NULL) {
+ uih_error(uih, "File could not be opended or out of memory");
+ return 0;
+ }
+ s->mode = mode;
+ /*Invalidate context to force save everything first */
+ s->speedup = STEP;
+ s->maxstep = MAXSTEP;
+ s->xcenter = INT_MAX;
+ s->fastmode = 2;
+ s->juliamode = 0;
+ s->cycling = 0;
+ for (i = 0; i < uih_nfilters; i++)
+ s->filter[i] = 0;
+ s->pressed = 0;
+ s->firsttime = 1;
+ uih->palettechanged = 1;
+ s->cyclingspeed = 30;
+ s->fcontext->pre = s->fcontext->pim = 0;
+ s->fcontext->bre = s->fcontext->bim = 0;
+ s->fcontext->currentformula = NULL;
+ s->fcontext->periodicity = 1;
+ s->fcontext->maxiter = 170;
+ s->fcontext->bailout = 4;
+ s->fcontext->coloringmode = 0;
+ s->fcontext->incoloringmode = 0;
+ s->fcontext->outtcolor = 0;
+ s->fcontext->intcolor = 0;
+ s->fcontext->mandelbrot = 1;
+ s->fcontext->plane = 0;
+ s->fcontext->range = 3;
+ s->fcontext->angle = 0;
+ s->rotatepressed = 0;
+ s->autorotate = 0;
+ s->fastrotate = 0;
+ s->rotationspeed = 10;
+ s->clearscreen = 0;
+ s->color = 0;
+ s->xtextpos = 1;
+ s->ytextpos = 1;
+ s->file = f;
+ s->timer = tl_create_timer();
+ s->synctimer = tl_create_timer();
+ uih->viewchanged = 1;
+ uih->palettechanged = 1;
+ uih->save = 1;
+ uih_emulatetimers(uih);
+ tl_reset_timer(s->timer);
+ uih->moved = 0;
+#ifndef _plan9_
+ if (mode == UIH_SAVEANIMATION)
+ myputs(";Animation file automatically generated by XaoS "
+ XaoS_VERSION "\n"
+ "; - a realtime interactive fractal zoomer\n"
+ ";Use xaos -play <filename> to replay it\n");
+ else if (mode == UIH_SAVEPOS)
+ myputs(";Position file automatically generated by XaoS "
+ XaoS_VERSION "\n"
+ "; - a realtime interactive fractal zoomer\n"
+ ";Use xaos -load <filename> to display it\n");
+#endif
+ uih_saveframe(uih);
+ uih_updatemenus(uih, "save");
+ xio_putc('\n', f);
+ return 1;
+}
+
+void uih_save_disable(struct uih_context *uih)
+{
+ if (uih->save) {
+ last = 1;
+ if (uih->savec->mode >= UIH_SAVEANIMATION)
+ uih_saveframe(uih);
+ if (xio_close(uih->savec->file))
+ outputerror(uih);
+ uih->save = 0;
+ free(uih->savec->fcontext);
+ tl_free_timer(uih->savec->timer);
+ tl_free_timer(uih->savec->synctimer);
+ free(uih->savec);
+ uih_updatemenus(uih, "save");
+ }
+}
+
+void uih_save_possition(struct uih_context *uih, xio_file f, int mode)
+{
+ struct uih_savedcontext *c = uih->savec;
+ int save = uih->save;
+ int vc = uih->viewchanged;
+ int pc = uih->palettechanged;
+ int mov = uih->moved = 0;
+ uih->moved = 0;
+ uih->save = 0;
+ uih->savec = NULL;
+ uih_save_enable(uih, f, mode);
+ uih_save_disable(uih);
+ uih->savec = c;
+ uih->save = save;
+ uih->viewchanged = vc;
+ uih->palettechanged = pc;
+ mov = uih->moved;
+}
diff --git a/src/ui-hlp/ui-hlp.pri b/src/ui-hlp/ui-hlp.pri
new file mode 100644
index 0000000..22c401a
--- /dev/null
+++ b/src/ui-hlp/ui-hlp.pri
@@ -0,0 +1,12 @@
+SOURCES += $$PWD/autopilot.c \
+ $$PWD/ui_helper.c \
+ $$PWD/menu.c \
+ $$PWD/play.c \
+ $$PWD/render.c \
+ $$PWD/playtext.c \
+ $$PWD/save.c \
+ $$PWD/messg.c \
+ $$PWD/wstack.c
+
+OTHER_FILES += \
+ $$PWD/autod.c
diff --git a/src/ui-hlp/ui_helper.c b/src/ui-hlp/ui_helper.c
new file mode 100644
index 0000000..04cd903
--- /dev/null
+++ b/src/ui-hlp/ui_helper.c
@@ -0,0 +1,2303 @@
+#include <config.h>
+#ifndef _plan9_
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#include <ctype.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <math.h>
+#include <string.h>
+#include <errno.h>
+#ifdef __EMX__
+#include <float.h>
+/*
+ #ifndef M_PI
+ #define M_PI 3.14159265358979323846
+ #endif
+ */
+#endif
+#else
+#include <u.h>
+#include <libc.h>
+#include <ctype.h>
+#endif
+#include <fconfig.h>
+#include <filter.h>
+#include <ui_helper.h>
+#include <plane.h>
+#include "../include/timers.h"
+#include <zoom.h>
+#include <xmenu.h>
+#include <xerror.h>
+#include "autopilot.h"
+#include "grlib.h"
+#include "play.h"
+#include <archaccel.h>
+#include <libgen.h>
+
+#ifdef SFFE_USING
+#include "sffe.h"
+#endif
+
+#ifdef HAVE_GETTEXT
+#include <libintl.h>
+#else
+#define gettext(STRING) STRING
+#endif
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+#define WAITTIME 50000
+#define WAITTIME1 200000
+#define WAITTIME2 2000000
+#define uih_palettechg(uih) if(!uih->recalculatemode&&uih->queue->palettechg!=NULL) uih->recalculatemode=UIH_PALETTEDRAW, uih->display=1
+#include <misc-f.h>
+
+static struct filter *uih_getinstance(CONST struct filteraction *a);
+static void uih_destroyinstance(struct filter *f);
+static int uih_require(struct filter *f, struct requirements *r);
+static int uih_initialize(struct filter *f, struct initdata *i);
+static CONST rgb_t uicolors[] = {
+ {0, 0, 0},
+ {255, 255, 255},
+ {255, 65, 0},
+ {64, 64, 64},
+ {128, 128, 128},
+ {128 + 64, 128 + 64, 128 + 64}
+};
+
+static CONST rgb_t uibwcolors[] = {
+ {0, 0, 0},
+ {255, 255, 255},
+ {255, 255, 255},
+ {255, 255, 255},
+ {255, 255, 255},
+ {255, 255, 255}
+};
+
+static CONST struct filteraction uih_filter = {
+ "XaoS's user interface layer",
+ "ui",
+ 0,
+ uih_getinstance,
+ uih_destroyinstance,
+ NULL,
+ uih_require,
+ uih_initialize,
+ convertupgeneric,
+ convertdowngeneric,
+ NULL
+};
+
+static uih_context *uih;
+static int waitcount, waitcount1, waitcount2;
+
+extern CONST struct filteraction interlace_filter, stereogram_filter,
+ subwindow_filter, smalliter_filter, julia_filter, blur_filter,
+ edge_filter, edge2_filter, rotate_filter, starfield_filter,
+ truecolor_filter, fixedcolor_filter, bitmap_filter, emboss_filter,
+ palette_filter, antialias_filter, threed_filter;
+
+CONST struct filteraction *CONST uih_filters[MAXFILTERS] = {
+ &edge_filter,
+ &edge2_filter,
+ &threed_filter,
+ &starfield_filter,
+ &stereogram_filter,
+ &interlace_filter,
+ &blur_filter,
+ &emboss_filter,
+ &palette_filter,
+ &antialias_filter,
+ &truecolor_filter,
+ NULL
+};
+
+CONST int uih_nfilters = 11;
+
+static void uih_invalidatepos(uih_context * uih)
+{
+ uih->xcenterm = INT_MAX;
+ uih->xcenterm = INT_MAX;
+}
+
+static void uih_finishpalette(struct uih_context *uih)
+{
+ if (uih->image->palette->flags & UNFINISHED) {
+ if (uih->image->palette->allocfinished != NULL)
+ uih->image->palette->allocfinished(uih->image->palette);
+ uih->image->palette->flags &= ~UNFINISHED;
+ }
+}
+
+static void
+uih_getcoord(uih_context * uih, int x, int y, number_t * xr, number_t * yr)
+{
+ uih->uifilter->action->convertdown(uih->uifilter, &x, &y);
+ *xr = (((number_t)
+ (uih->fcontext->rs.nc +
+ (x) * ((uih->fcontext->rs.mc - uih->fcontext->rs.nc) /
+ (number_t) uih->zengine->image->width))));
+ *yr = (((number_t)
+ (uih->fcontext->rs.ni +
+ (y) * ((uih->fcontext->rs.mi - uih->fcontext->rs.ni) /
+ (number_t) uih->zengine->image->height))));
+ rotateback(*(uih->fcontext), *xr, *yr);
+}
+
+int uih_enablefilter(uih_context * c, int n)
+{
+ if (c->filter[n] == NULL) {
+ struct filter *f, *f1;
+ int i, wascycling = 0;
+ if (c->cycling)
+ uih_cycling_off(c), wascycling = 1;
+ f = uih_filters[n]->getinstance(uih_filters[n]);
+ f1 = c->uifilter;
+ if (c->fixedcolor != NULL)
+ f1 = c->fixedcolor;
+ for (i = MAXFILTERS - 1; i > n; i--) {
+ if (c->filter[i])
+ f1 = c->filter[i];
+ }
+ uih_newimage(c);
+ insertfilter(f, f1);
+ if (!initqueue(c->queue)) {
+ c->ddatalost = 1;
+ removefilter(f);
+ f->action->destroyinstance(f);
+ if (!initqueue(c->queue)) {
+ x_fatalerror
+ ("Fatal error. Can not continue - initialization of queue can not be performed eigher with or without filter");
+ }
+ if (wascycling)
+ uih_cycling_on(c);
+ if (!strcmp("palette", uih_filters[n]->shortname)) {
+ uih_updatemenus(c, "palettef");
+ } else {
+ uih_updatemenus(c, uih_filters[n]->shortname);
+ }
+ return 0;
+ } else
+ c->filter[n] = f;
+ if (wascycling)
+ uih_cycling_on(c);
+ if (!strcmp("palette", uih_filters[n]->shortname)) {
+ uih_updatemenus(c, "palettef");
+ } else {
+ uih_updatemenus(c, uih_filters[n]->shortname);
+ }
+ return 1;
+ }
+ return 0;
+}
+
+void uih_disablefilter(uih_context * c, int n)
+{
+ if (n == c->aliasnum)
+ return;
+ if (c->filter[n] != NULL) {
+ int wascycling = 0;
+ struct filter *f = c->filter[n];
+ if (c->cycling)
+ uih_cycling_off(c), wascycling = 1;
+ uih_newimage(c);
+ removefilter(f);
+ if (!initqueue(c->queue)) {
+ struct filter *f1;
+ int i;
+ c->ddatalost = 1;
+ f1 = c->uifilter;
+ if (c->fixedcolor != NULL)
+ f1 = c->fixedcolor;
+ for (i = MAXFILTERS - 1; i > n; i--) {
+ if (c->filter[i])
+ f1 = c->filter[i];
+ }
+ insertfilter(f, f1);
+ if (!initqueue(c->queue)) {
+ x_fatalerror("Fatal error. Can not continue");
+ }
+ } else
+ f->action->destroyinstance(f), c->filter[n] = NULL;
+ if (wascycling)
+ uih_cycling_on(c);
+ if (!strcmp("palette", uih_filters[n]->shortname)) {
+ uih_updatemenus(c, "palettef");
+ } else {
+ uih_updatemenus(c, uih_filters[n]->shortname);
+ }
+ }
+}
+
+int uih_fastrotateenable(uih_context * c)
+{
+ int wascycling = 0;
+ if (c->juliamode)
+ uih_disablejulia(c);
+ if (!c->fastrotate && !c->juliamode) {
+ if (c->cycling)
+ uih_cycling_off(c), wascycling = 1;
+ c->rotatef = rotate_filter.getinstance(&rotate_filter);
+ if (c->rotatef == NULL)
+ goto end;
+ uih_newimage(c);
+ addfilter(c->rotatef, c->zengine);
+ if (!initqueue(c->queue))
+ goto end2;
+ if (wascycling)
+ uih_cycling_on(c);
+ c->fastrotate = 1;
+ return 1;
+ }
+ return 0;
+ end2:
+ removefilter(c->rotatef);
+ initqueue(c->queue);
+ c->rotatef->action->destroyinstance(c->rotatef);
+ end:
+ if (wascycling)
+ uih_cycling_on(c);
+ return 0;
+}
+
+void uih_fastrotatedisable(uih_context * c)
+{
+ if (c->fastrotate) {
+ int wascycling = 0;
+ uih_rotatemode(c, ROTATE_NONE);
+ if (c->cycling)
+ uih_cycling_off(c), wascycling = 1;
+ c->fastrotate = 0;
+ removefilter(c->rotatef);
+ initqueue(c->queue);
+ c->rotatef->action->destroyinstance(c->rotatef);
+ uih_newimage(c);
+ if (wascycling)
+ uih_cycling_on(c);
+ }
+}
+
+void uih_rotate(struct uih_context *c, int n)
+{
+ if (!n)
+ uih_fastrotate(c, 0);
+ else {
+ uih_fastrotate(c, 1);
+ uih_rotatemode(c, n);
+ }
+}
+
+static void uih_fixedcolordisable(uih_context * c)
+{
+#ifdef SCONVERTORS
+ if (c->fixedcolor != NULL) {
+ int wascycling = 0;
+ if (c->cycling)
+ uih_cycling_off(c), wascycling = 1;
+ initqueue(c->queue);
+ removefilter(c->fixedcolor);
+ initqueue(c->queue);
+ c->fixedcolor->action->destroyinstance(c->fixedcolor);
+ c->fixedcolor = NULL;
+ uih_newimage(c);
+ if (wascycling)
+ uih_cycling_on(c);
+ }
+#endif
+}
+
+static int uih_fixedcolorenable(uih_context * c)
+{
+#ifdef SCONVERTORS
+ CONST struct filteraction *fa = NULL;
+ int wascycling = 0;
+ preallocpalette(c->palette);
+ switch (c->image->palette->type) {
+#ifdef SFIXEDCOLOR
+ case FIXEDCOLOR:
+ fa = &fixedcolor_filter;
+ break;
+#endif
+#ifdef SBITMAPS
+ case LBITMAP:
+ case MBITMAP:
+ case LIBITMAP:
+ case MIBITMAP:
+ fa = &bitmap_filter;
+ break;
+#endif
+ default:
+ x_fatalerror("Unsupported image type. Recompile XaoS");
+ }
+ if (c->fixedcolor != NULL && c->fixedcolor->action != fa)
+ uih_fixedcolordisable(c);
+ if (c->fixedcolor == NULL) {
+ if (c->cycling)
+ uih_cycling_off(c), wascycling = 1;
+ c->fixedcolor = fa->getinstance(fa);
+ if (c->fixedcolor == NULL)
+ goto end;
+ uih_newimage(c);
+ addfilter(c->fixedcolor, c->uifilter->previous);
+ if (!initqueue(c->queue))
+ goto end2;
+ if (wascycling)
+ uih_cycling_on(c);
+ return 1;
+ }
+ return 0;
+ end2:
+ removefilter(c->fixedcolor);
+ c->fixedcolor->action->destroyinstance(c->fixedcolor);
+ c->fixedcolor = NULL;
+ initqueue(c->queue);
+ end:
+ if (wascycling)
+ uih_cycling_on(c);
+ return 0;
+#else
+ x_fatalerror("Fixed color not supported, please recompile XaoS");
+ return 0;
+#endif
+}
+
+int uih_fastrotate(uih_context * c, int mode)
+{
+ if (mode)
+ return (uih_fastrotateenable(c));
+ uih_fastrotatedisable(c);
+ return 1;
+}
+
+void uih_angle(uih_context * c, number_t angle)
+{
+ if (angle != c->fcontext->angle) {
+ if (!c->fastrotate) {
+ c->fcontext->version++;
+ uih_newimage(c);
+ }
+ c->fcontext->angle = angle;
+ uih_animate_image(c);
+ }
+}
+
+void uih_rotatemode(uih_context * c, int mode)
+{
+ CONST char *names[] = {
+ "norotate",
+ "mouserotate",
+ "controtate"
+ };
+ if (c->fastrotate) {
+ if (c->rotatemode != mode) {
+ c->rotatemode = mode;
+ if (mode == ROTATE_CONTINUOUS)
+ tl_reset_timer(c->doittimer);
+ uih_updatemenus(c, names[mode]);
+ }
+ }
+}
+
+int uih_enablejulia(uih_context * c)
+{
+ int wascycling = 0;
+ if (!c->juliamode && c->fcontext->mandelbrot
+ /*&&c->fcontext->currentformula->calculate_julia != NULL */ ) {
+ struct filter *addf = c->zengine;
+ uih_newimage(c);
+ if (c->fastrotate)
+ uih_fastrotatedisable(c);
+ if (c->cycling)
+ uih_cycling_off(c), wascycling = 1;
+ if (c->fcontext->currentformula->calculate_julia == NULL
+ || c->fcontext->slowmode)
+ c->julia = zoom_filter.getinstance(&zoom_filter);
+ else
+ c->julia = julia_filter.getinstance(&julia_filter);
+ if (c->julia == NULL)
+ goto end;
+
+ c->subwindow = subwindow_filter.getinstance(&subwindow_filter);
+ if (c->subwindow == NULL)
+ goto end2;
+ if (c->fcontext->currentformula->calculate_julia != NULL
+ && !c->fcontext->slowmode) {
+ c->smalliter = smalliter_filter.getinstance(&smalliter_filter);
+ if (c->smalliter == NULL)
+ goto end3;
+ } else
+ c->smalliter = NULL;
+ addfilter(c->subwindow, addf);
+ if (c->fcontext->currentformula->calculate_julia != NULL
+ && !c->fcontext->slowmode) {
+ addfilter(c->smalliter, addf);
+ }
+ addfilter(c->julia, addf);
+ subwindow_setsecond(c->subwindow, addf);
+ if (!initqueue(c->queue))
+ goto end4;
+ if (c->fcontext->currentformula->calculate_julia == NULL
+ || c->fcontext->slowmode)
+ c->juliamode = 2;
+ else
+ c->juliamode = 1;
+ uih_updatemenus(c, "fastjulia");
+ return 1;
+ }
+ uih_updatemenus(c, "fastjulia");
+ return 0;
+ end4:;
+ removefilter(c->subwindow);
+ removefilter(c->julia);
+ if (c->smalliter != NULL)
+ removefilter(c->smalliter);
+ initqueue(c->queue);
+ end3:;
+ c->smalliter->action->destroyinstance(c->smalliter);
+ end2:;
+ c->subwindow->action->destroyinstance(c->subwindow);
+ end:;
+ c->julia->action->destroyinstance(c->julia);
+ if (wascycling)
+ uih_cycling_on(c);
+ uih_updatemenus(c, "fastjulia");
+ return 0;
+}
+
+void uih_disablejulia(uih_context * c)
+{
+ int wascycling = 0;
+ if (c->juliamode) {
+ uih_newimage(c);
+ c->fcontext->version++;
+ if (c->cycling)
+ uih_cycling_off(c), wascycling = 1;
+ removefilter(c->subwindow);
+ removefilter(c->julia);
+ if (c->smalliter != NULL)
+ removefilter(c->smalliter);
+ initqueue(c->queue);
+ if (c->smalliter != NULL)
+ c->smalliter->action->destroyinstance(c->smalliter);
+ c->subwindow->action->destroyinstance(c->subwindow);
+ c->julia->action->destroyinstance(c->julia);
+ if (wascycling)
+ uih_cycling_on(c);
+ c->juliamode = 0;
+ uih_updatemenus(c, "fastjulia");
+ }
+}
+
+int uih_setjuliamode(uih_context * c, int mode)
+{
+ if (mode)
+ return uih_enablejulia(c);
+ uih_disablejulia(c);
+ return 1;
+}
+
+void uih_rotationspeed(uih_context * c, number_t speed)
+{
+ c->rotationspeed = speed;
+}
+
+static void uih_cyclinghandler(void *userdata, int n)
+{
+ struct uih_context *uih = (struct uih_context *) userdata;
+ int direct;
+ if (uih->zengine->fractalc->palette != NULL &&
+ uih->zengine->fractalc->palette->cyclecolors == NULL)
+ return;
+ direct = uih->direction * uih->cyclingdirection * n;
+ if (direct > 0)
+ direct %= uih->zengine->fractalc->palette->size - 1;
+ else
+ direct =
+ -((-direct) % (uih->zengine->fractalc->palette->size - 1));
+ if (direct) {
+ uih->paletteshift += direct;
+ while (uih->paletteshift < 0)
+ uih->paletteshift += uih->zengine->fractalc->palette->size - 1;
+ uih->paletteshift =
+ uih->paletteshift % (uih->zengine->fractalc->palette->size -
+ 1);
+ uih->zengine->fractalc->palette->cyclecolors(uih->
+ zengine->fractalc->
+ palette, direct);
+ if (uih->flags & UPDATE_AFTER_PALETTE
+ && (!uih->play || !uih->nonfractalscreen))
+ uih->display = 1;
+ uih_palettechg(uih);
+ }
+}
+
+void uih_cycling_off(struct uih_context *c)
+{
+ if (c->cycling) {
+ tl_free_timer(c->cyclingtimer);
+ c->cycling = 0;
+ uih_updatemenus(c, "cycling");
+ uih_updatemenus(c, "rcycling");
+ }
+}
+
+void uih_display(struct uih_context *c)
+{
+ c->display = 1;
+ c->nonfractalscreen = 0;
+ if (c->clearscreen)
+ c->clearscreen = 0;
+ c->displaytext = 0;
+ c->nletters = 0;
+ c->display = 1;
+ if (c->text[0] != NULL)
+ free(c->text[0]), c->text[0] = NULL;
+ if (c->text[1] != NULL)
+ free(c->text[1]), c->text[1] = NULL;
+ if (c->text[2] != NULL)
+ free(c->text[2]), c->text[2] = NULL;
+ if (c->play)
+ uih_clear_lines(c);
+}
+
+void uih_cycling_stop(struct uih_context *c)
+{
+ if (c->cycling && !c->stopped) {
+ tl_remove_timer(c->cyclingtimer);
+ c->stopped = 1;
+ }
+}
+
+void uih_cycling_continue(struct uih_context *c)
+{
+ if (c->cycling && c->stopped) {
+ c->stopped = 0;
+ tl_add_timer(syncgroup, c->cyclingtimer);
+ }
+}
+
+void uih_loadfile(struct uih_context *c, xio_constpath d)
+{
+ xio_file f;
+ f = xio_ropen(d);
+ if (f == NULL) {
+#ifdef _plan9_
+ uih_error(c, (char *) errstr);
+#else
+ uih_error(c, strerror(errno));
+#endif
+ return;
+ }
+ uih_load(c, f, d);
+ return;
+}
+
+void uih_loadstr(struct uih_context *c, CONST char *data)
+{
+ xio_file f;
+ f = xio_strropen(data);
+ uih_load(c, f, "");
+ return;
+}
+
+void uih_playstr(struct uih_context *c, CONST char *data)
+{
+ xio_file f;
+ f = xio_strropen(mystrdup(data));
+ uih_replayenable(c, f, "", 1);
+ return;
+}
+
+void uih_recalculate(struct uih_context *c)
+{
+ c->fcontext->version++;
+ uih_newimage(c);
+}
+
+void uih_playfile(struct uih_context *c, xio_constpath d)
+{
+ xio_file f;
+ if (c->play)
+ uih_replaydisable(c);
+ f = xio_ropen(d);
+ if (f == NULL) {
+#ifdef _plan9_
+ uih_error(c, (char *) errstr);
+#else
+ uih_error(c, strerror(errno));
+#endif
+ return;
+ }
+ uih_replayenable(c, f, d, 1);
+ return;
+}
+
+void uih_playtutorial(struct uih_context *c, CONST char *name)
+{
+ xio_pathdata tmp;
+ xio_file f = XIO_FAILED;
+
+ f = xio_gettutorial(name, tmp);
+ if (f == NULL) {
+ uih_error(c, gettext("Tutorial files not found. Reinstall XaoS"));
+ return;
+ }
+ uih_replayenable(c, f, tmp, 1);
+ if (c->passfunc != NULL) {
+ c->passfunc(c, 1, gettext("Preparing first image"), 0);
+ }
+}
+
+void uih_loadexample(struct uih_context *c)
+{
+ xio_pathdata name;
+ xio_file f = xio_getrandomexample(name);
+ c->errstring = NULL;
+ if (f == NULL) {
+ uih_error(c, gettext("Could not open examples"));
+ return;
+ }
+ uih_load(c, f, name);
+ if (c->errstring == NULL) {
+ char s[256];
+ sprintf(s, gettext("File %s loaded."), basename(name));
+ uih_message(c, s);
+ }
+}
+
+void uih_savepngfile(struct uih_context *c, xio_constpath d)
+{
+ CONST char *s;
+ if (c->passfunc != NULL) {
+ c->passfunc(c, 1, gettext("Saving image..."), 0);
+ }
+ if (c->recalculatemode) {
+ uih_newimage(c);
+ uih_clearwindows(c);
+ uih_do_fractal(c);
+ }
+ if (c->interrupt) {
+ uih_message(c, gettext("Save interrupted"));
+ return;
+ }
+ c->errstring = NULL;
+ s = uih_save(c, d);
+ if (s != NULL)
+ uih_error(c, s);
+ if (c->errstring == NULL) {
+ char s[256];
+ sprintf(s, gettext("File %s saved."), d);
+ uih_message(c, s);
+ }
+}
+
+void uih_saveposfile(struct uih_context *c, xio_constpath d)
+{
+ xio_file f;
+ c->errstring = NULL;
+ f = xio_wopen(d);
+ if (f == XIO_FAILED) {
+ uih_error(c, gettext("Can not open file"));
+ return;
+ }
+ uih_save_possition(c, f, UIH_SAVEPOS);
+ if (c->errstring == NULL) {
+ char s[256];
+ sprintf(s, gettext("File %s saved."), d);
+ uih_message(c, s);
+ }
+}
+
+char *uih_savepostostr(struct uih_context *c)
+{
+ xio_file f;
+ c->errstring = NULL;
+ f = xio_strwopen();
+ uih_save_possition(c, f, UIH_SAVEPOS);
+ return (xio_getstring(f));
+}
+
+void uih_saveundo(struct uih_context *c)
+{
+ xio_file f;
+ if (c->play)
+ return;
+ c->errstring = NULL;
+ if (c->undo.undos[c->undo.last])
+ free(c->undo.undos[c->undo.last]);
+ f = xio_strwopen();
+ uih_save_possition(c, f, UIH_SAVEPOS);
+ c->undo.undos[c->undo.last] = xio_getstring(f);
+ c->undo.last = (c->undo.last + 1) % UNDOLEVEL;
+}
+
+void uih_undo(struct uih_context *c)
+{
+ xio_file f;
+ int pos = c->undo.last - 2;
+ if (pos < 0)
+ pos = UNDOLEVEL + pos;
+ if (c->undo.undos[pos]) {
+ f = xio_strropen(c->undo.undos[pos]);
+ c->undo.undos[pos] = NULL;
+ c->undo.last = pos;
+ uih_load(c, f, "");
+ }
+}
+
+void uih_redo(struct uih_context *c)
+{
+ xio_file f;
+ int pos = c->undo.last;
+ if (c->undo.undos[pos]) {
+ f = xio_strropen(c->undo.undos[pos]);
+ c->undo.undos[pos] = NULL;
+ c->undo.last = pos;
+ uih_load(c, f, "");
+ }
+}
+
+extern xio_pathdata configfile;
+void uih_savecfg(struct uih_context *c)
+{
+ xio_file f;
+ c->errstring = NULL;
+ f = xio_wopen(configfile);
+ if (f == XIO_FAILED) {
+ uih_message(c, (char *) xio_errorstring());
+ return;
+ }
+ uih_save_possition(c, f, UIH_SAVEALL);
+ if (c->errstring == NULL) {
+ char s[256];
+ sprintf(s, gettext("File %s saved."), configfile);
+ uih_message(c, s);
+ }
+}
+
+void uih_saveanimfile(struct uih_context *c, xio_constpath d)
+{
+ xio_file f;
+ c->errstring = NULL;
+ if (c->save) {
+ uih_save_disable(c);
+ uih_updatemenus(c, "record");
+ return;
+ }
+ f = xio_wopen(d);
+ if (f == XIO_FAILED) {
+ uih_message(c, (char *) xio_errorstring());
+ return;
+ }
+ uih_save_enable(c, f, UIH_SAVEANIMATION);
+ if (c->errstring == NULL) {
+ char s[256];
+ sprintf(s, gettext("Recording to file %s enabled."), d);
+ uih_message(c, s);
+ }
+ uih_updatemenus(c, "record");
+}
+
+
+
+
+
+
+
+CONST char *uih_save(struct uih_context *c, xio_constpath filename)
+{
+ CONST char *r;
+ uih_cycling_stop(c);
+ uih_stoptimers(c);
+ uih_clearwindows(c);
+ r = writepng(filename, c->queue->saveimage);
+ uih_cycling_continue(c);
+ uih_resumetimers(c);
+ return (r);
+}
+
+void uih_setcycling(struct uih_context *c, int speed)
+{
+ c->cyclingspeed = speed;
+ if (c->cyclingspeed < 0)
+ c->direction = -1;
+ else
+ c->direction = 1;
+ if (c->cycling) {
+ if (c->cyclingspeed)
+ tl_set_interval(c->cyclingtimer,
+ 1000000 / c->cyclingspeed * c->direction);
+ else
+ tl_set_interval(c->cyclingtimer, 1000000 * 100);
+ }
+}
+
+int uih_cycling_on(struct uih_context *c)
+{
+ if (c->zengine->fractalc->palette != NULL &&
+ c->zengine->fractalc->palette->cyclecolors != NULL) {
+ c->cycling = 1;
+ tl_update_time();
+ c->cyclingtimer = tl_create_timer();
+ uih_emulatetimers(c);
+ uih_setcycling(c, c->cyclingspeed);
+ tl_set_multihandler(c->cyclingtimer, uih_cyclinghandler, c);
+ tl_add_timer(syncgroup, c->cyclingtimer);
+ } else {
+ uih_updatemenus(c, "cycling");
+ uih_updatemenus(c, "rcycling");
+ return 0;
+ }
+ uih_updatemenus(c, "cycling");
+ uih_updatemenus(c, "rcycling");
+ return 1;
+}
+
+int uih_cycling(struct uih_context *uih, int mode)
+{
+ if (mode)
+ return (uih_cycling_on(uih));
+ uih_cycling_off(uih);
+ return 1;
+}
+
+
+
+static void uih_waitfunc(struct filter *f)
+{
+ int l;
+ tl_process_group(syncgroup, NULL);
+ l = tl_lookup_timer(uih->calculatetimer);
+ if (uih->interrupt)
+ f->interrupt = 1, uih->endtime = l;
+ if (uih->interruptiblemode) {
+ if (f->incalculation && !uih->starttime)
+ uih->starttime = l;
+ else if (uih->starttime && !f->incalculation && !uih->endtime)
+ uih->endtime = l;
+ if ((uih->maxtime && l > uih->maxtime && f->readyforinterrupt)
+ || uih->interrupt)
+ f->interrupt = 1, uih->endtime = l;
+ }
+ if ((l) > (waitcount + 1) * WAITTIME) {
+ int display = 0;
+ if (!uih->interruptiblemode && l > (waitcount1 + 1) * WAITTIME1) {
+ display = 1;
+ waitcount1 = l / WAITTIME1;
+ }
+ if (f->image == uih->image && !uih->interruptiblemode
+ && l > (waitcount2 + 1) * WAITTIME2) {
+ if (!uih->play)
+ uih->display = 1, uih_finishpalette(uih), display = 1;
+ waitcount2 = l / WAITTIME2;
+ }
+ if (uih->passfunc != NULL) {
+ f->interrupt |=
+ uih->passfunc(uih, display, f->pass,
+ (float) (f->max ? f->pos * 100.0 /
+ f->max : 100.0));
+ uih->display = 0;
+ }
+ waitcount = l / WAITTIME;
+ }
+ uih_clearwindows(uih);
+}
+
+void uih_do_fractal(uih_context * c)
+{
+ int flags;
+ int time;
+
+ c->interrupt = 0;
+ c->display = 0;
+ uih = c;
+ if (c->juliamode && !c->fcontext->mandelbrot) {
+ uih_disablejulia(c);
+ }
+ if ((c->juliamode == 1
+ && (c->fcontext->currentformula->calculate_julia == NULL
+ || c->fcontext->slowmode)) || (c->juliamode == 2
+ && c->
+ fcontext->currentformula->
+ calculate_julia != NULL
+ && !c->fcontext->slowmode)) {
+ uih_disablejulia(c);
+ uih_enablejulia(c);
+ c->fcontext->version++;
+ }
+
+ tl_update_time();
+ if (c->recalculatemode < c->fastmode && c->emulator == NULL
+ && !c->fixedstep)
+ c->interruptiblemode = 1;
+ else
+ c->interruptiblemode = 0;
+ if (!c->interruptiblemode && c->recalculatemode > UIH_ANIMATION) {
+ if (c->longwait != NULL)
+ c->longwait(c);
+ uih_stoptimers(c);
+ }
+
+ tl_update_time();
+ tl_reset_timer(c->calculatetimer);
+ c->starttime = 0;
+ c->endtime = 0;
+ waitcount = tl_lookup_timer(c->calculatetimer) / WAITTIME + 2;
+ waitcount1 = tl_lookup_timer(c->calculatetimer) / WAITTIME1 + 1;
+ waitcount2 = tl_lookup_timer(c->calculatetimer) / WAITTIME2 + 1;
+#ifdef _UNDEFINED_
+ waitcount = 2;
+ waitcount1 = 1;
+ waitcount2 = 1;
+#endif
+ c->incalculation = 1;
+
+ if (!(c->flags & ROTATE_INSIDE_CALCULATION))
+ uih_cycling_stop(c);
+
+ time = tl_lookup_timer(c->doittimer);
+ if (c->rotatemode == ROTATE_CONTINUOUS) {
+ c->fcontext->angle += c->rotationspeed * time / 1000000.0;
+ }
+
+ tl_reset_timer(c->doittimer);
+ c->indofractal = 1;
+ if (c->recalculatemode < UIH_PALETTEDRAW) {
+ if (c->queue->palettechg != NULL)
+ flags =
+ c->queue->palettechg->action->doit(c->queue->palettechg,
+ PALETTEONLY, 0);
+ else
+ flags = CHANGED;
+ } else
+ flags =
+ c->uifilter->previous->action->doit(c->uifilter->previous,
+ c->interruptiblemode ?
+ INTERRUPTIBLE : 0, time);
+ c->indofractal = 0;
+
+ if (!(c->flags & ROTATE_INSIDE_CALCULATION))
+ uih_cycling_continue(c);
+
+ c->dirty = 0;
+ if (c->inanimation)
+ c->inanimation--;
+ c->ddatalost = 0;
+ c->recalculatemode = 0;
+
+ if (flags & ANIMATION)
+ c->fastanimation = 1;
+ else
+ c->fastanimation = 0;
+ if (c->emulator)
+ c->inanimation = 1;
+ if (flags & (ANIMATION | UNCOMPLETTE)
+ || (c->rotatemode == ROTATE_CONTINUOUS)) {
+ tl_resume_timer(c->doittimer);
+ c->uncomplette = 1;
+ c->inanimation = 2;
+ if (flags & UNCOMPLETTE)
+ c->recalculatemode = UIH_ANIMATION;
+ else
+ c->recalculatemode = UIH_FILTERANIMATION;
+ c->display = 1;
+ } else {
+ tl_stop_timer(c->doittimer);
+ c->uncomplette = 0;
+ }
+ if ((flags & CHANGED) && (!c->play || !c->nonfractalscreen)) {
+ c->display = 1;
+ if (flags & INEXACT)
+ c->dirty = 1;
+ } else
+ c->incalculation = 0;
+ uih_callcomplette(c);
+ if (c->autopilot)
+ c->inanimation = 1;
+}
+
+void uih_prepare_image(uih_context * c)
+{
+ if (c->play)
+ uih_update_lines(c);
+ if (c->display) {
+ uih_clearwindows(c);
+ xprepareimage(c->image);
+ if (uih_needrecalculate(c))
+ uih_do_fractal(c);
+ }
+}
+
+void uih_callcomplette(uih_context * c)
+{
+ if (!c->uncomplette && !c->display && !c->recalculatemode
+ && !c->inanimation && c->complettehandler != NULL) {
+ c->complettehandler(c->handlerdata);
+ }
+}
+
+void uih_setcomplettehandler(uih_context * c, void (h) (void *), void *d)
+{
+ c->complettehandler = h;
+ c->handlerdata = d;
+}
+
+void uih_letterspersec(uih_context * c, int n)
+{
+ if (n < 1)
+ n = 1;
+ c->letterspersec = n;
+}
+
+double uih_displayed(uih_context * c)
+{
+ int drawingtime;
+ uih_finishpalette(c);
+ if (c->indofractal)
+ return 0; /*image is currently calculating */
+ if (c->recalculatemode)
+ c->display = 1;
+ else
+ c->display = 0;
+ tl_update_time();
+ uih_resumetimers(c);
+ c->nonfractalscreen = 0;
+ c->nletters = 0;
+ if (c->incalculation) {
+ c->incalculation = 0;
+ drawingtime = tl_lookup_timer(c->calculatetimer);
+ if (c->emulator)
+ drawingtime = 0;
+ if (c->lasttime == -1
+ || (drawingtime && c->lasttime
+ && (drawingtime / c->lasttime < 0.2
+ || drawingtime / c->lasttime > 4)))
+ c->lasttime = drawingtime;
+ c->lasttime = (c->lasttime * 30 + drawingtime) / 31;
+ c->lastspeed = c->lasttime ? 1000000.0 / c->lasttime : 100.0;
+ if (c->interruptiblemode) {
+ int i;
+ int time1, time;
+ time1 = drawingtime;
+ time1 -= c->endtime;
+ time = (drawingtime - c->endtime) + c->starttime;
+ if (c->times[0][0] == -1) {
+ for (i = 0; i < AVRGSIZE; i++)
+ c->times[0][i] = time, c->times[1][i] = time1;
+ c->count[0] = time * AVRGSIZE, c->count[1] =
+ time1 * AVRGSIZE;
+ }
+ c->timespos = (c->timespos + 1) % AVRGSIZE;
+ c->count[0] += time - c->times[0][c->timespos];
+ c->count[1] += time1 - c->times[1][c->timespos];
+ c->times[0][c->timespos] = time;
+ c->times[1][c->timespos] = time1;
+ c->maxtime = (c->count[0] * 5) / AVRGSIZE;
+ if (c->step || c->pressed
+ || (c->play
+ && (c->playc->morph || c->playc->morphangle
+ || c->playc->morphjulia
+ || c->playc->lines.morphing))
+ || (c->rotatemode == ROTATE_CONTINUOUS)
+ || c->fastanimation) {
+ if (c->maxtime > 1000000 / 25)
+ c->maxtime = c->count[0] * 3 / AVRGSIZE;
+ if (c->maxtime > 1000000 / 15)
+ c->maxtime = 1000000 / 15;
+ } else {
+ c->maxtime = 1000000 / 3;
+ }
+ if (c->maxtime < 1000000 / 30)
+ c->maxtime = 1000000 / 30;
+ c->maxtime -= c->count[1] / AVRGSIZE;
+ if (c->maxtime < c->starttime + 10000)
+ c->maxtime = c->starttime + 10000;
+ }
+ }
+ uih_callcomplette(c);
+ return (c->lastspeed);
+}
+
+void uih_text(uih_context * c, CONST char *text)
+{
+ int i, l;
+ c->display = 1;
+ if (c->text[c->ytextpos])
+ free(c->text[c->ytextpos]);
+ c->textpos[c->ytextpos] = c->xtextpos;
+ c->textcolor[c->ytextpos] = c->color;
+ c->displaytext |= 1 << c->ytextpos;
+ c->text[c->ytextpos] = mystrdup(text);
+ l = (int) strlen(text);
+ c->todisplayletters = 0;
+ for (i = 0; i < l; i++) {
+ if (isalnum(text[i]))
+ c->todisplayletters++;
+ if (text[i] == '-')
+ c->todisplayletters += 3;
+ if (text[i] == '.')
+ c->todisplayletters += 2;
+ }
+ c->step = 0;
+}
+
+void uih_clearscreen(uih_context * c)
+{
+ c->clearscreen = 1;
+ if (c->save)
+ c->savec->clearscreen = 1;
+ if (c->displaytext)
+ c->displaytext = 0;
+ if (c->text[0] != NULL)
+ free(c->text[0]), c->text[0] = NULL;
+ if (c->text[1] != NULL)
+ free(c->text[1]), c->text[1] = NULL;
+ if (c->text[2] != NULL)
+ free(c->text[2]), c->text[2] = NULL;
+ c->nletters = 0;
+ c->display = 1;
+ if (c->play)
+ uih_clear_lines(c);
+}
+
+void uih_settextpos(uih_context * c, int x, int y)
+{
+ CONST char *names1[] = {
+ "ytextposup",
+ "ytextposmiddle",
+ "ytextposbottom",
+ };
+ CONST char *names2[] = {
+ "xtextposleft",
+ "xtextposcenter",
+ "xtextposright",
+ };
+ c->xtextpos = x;
+ c->ytextpos = y;
+ uih_updatemenus(c, names1[y]);
+ uih_updatemenus(c, names2[x]);
+}
+
+
+/*timming routines */
+
+void uih_tbreak(uih_context * c)
+{
+ c->tbreak = 1;
+}
+
+void uih_emulatetimers(uih_context * c)
+{
+ if (c->emulator == NULL)
+ return;
+ tl_emulate_timer(c->maintimer, c->emulator);
+ tl_emulate_timer(c->doittimer, c->emulator);
+ if (c->autopilot)
+ tl_emulate_timer(c->autopilottimer, c->emulator);
+ if (c->cycling) {
+ tl_emulate_timer(c->cyclingtimer, c->emulator);
+ }
+ if (c->play) {
+ tl_emulate_timer(c->playc->timer, c->emulator);
+ }
+ if (c->save) {
+ tl_emulate_timer(c->savec->timer, c->emulator);
+ tl_emulate_timer(c->savec->synctimer, c->emulator);
+ }
+}
+
+static void uih_unemulatetimers(uih_context * c)
+{
+ tl_unemulate_timer(c->maintimer);
+ tl_unemulate_timer(c->doittimer);
+ if (c->autopilot)
+ tl_unemulate_timer(c->autopilottimer);
+ if (c->cycling)
+ tl_unemulate_timer(c->cyclingtimer);
+ if (c->play) {
+ tl_unemulate_timer(c->playc->timer);
+ }
+ if (c->save) {
+ tl_unemulate_timer(c->savec->timer);
+ tl_unemulate_timer(c->savec->synctimer);
+ }
+}
+
+void uih_constantframetime(uih_context * c, int time)
+{
+ if (c->emulator == NULL)
+ c->emulator = tl_create_emulator();
+ c->emulatedframetime = time;
+ uih_emulatetimers(c);
+}
+
+void uih_noconstantframetime(uih_context * c)
+{
+ if (c->emulator == NULL)
+ return;
+ uih_unemulatetimers(c);
+ tl_free_emulator(c->emulator);
+ c->emulator = NULL;
+}
+
+void uih_stoptimers(uih_context * c)
+{
+ if (!c->stoppedtimers) {
+ c->stoppedtimers = 1;
+ c->display = 1;
+ tl_stop_timer(c->maintimer);
+ tl_stop_timer(c->doittimer);
+ if (c->autopilot)
+ tl_stop_timer(c->autopilottimer);
+ if (c->play) {
+ tl_stop_timer(c->playc->timer);
+ if (c->cycling)
+ tl_stop_timer(c->cyclingtimer);
+ }
+ if (c->save) {
+ tl_stop_timer(c->savec->timer);
+ tl_stop_timer(c->savec->synctimer);
+ if (c->cycling)
+ tl_stop_timer(c->cyclingtimer);
+ }
+ }
+}
+
+void uih_slowdowntimers(uih_context * c, int time)
+{
+ tl_slowdown_timer(c->maintimer, time);
+ if (c->autopilot)
+ tl_slowdown_timer(c->autopilottimer, time);
+ if (c->play) {
+ tl_slowdown_timer(c->playc->timer, time);
+ if (c->cycling)
+ tl_slowdown_timer(c->cyclingtimer, time);
+ }
+ if (c->save) {
+ tl_slowdown_timer(c->savec->timer, time);
+ tl_slowdown_timer(c->savec->synctimer, time);
+ if (c->cycling)
+ tl_slowdown_timer(c->cyclingtimer, time);
+ }
+}
+
+void uih_resumetimers(uih_context * c)
+{
+ if (c->stoppedtimers) {
+ c->stoppedtimers = 0;
+ tl_resume_timer(c->maintimer);
+ if (c->cycling)
+ tl_resume_timer(c->cyclingtimer);
+ if (c->autopilot)
+ tl_resume_timer(c->autopilottimer);
+ if (c->play) {
+ tl_resume_timer(c->playc->timer);
+ }
+ if (c->save) {
+ tl_resume_timer(c->savec->timer);
+ tl_resume_timer(c->savec->synctimer);
+ }
+ }
+}
+
+/*autopilot implementation */
+
+static void uih_changed(void)
+{
+ uih_newimage(uih);
+}
+
+static void uih_autopilothandler(void *uih1, int n)
+{
+ uih = (uih_context *) uih1;
+ do_autopilot(uih, &uih->autopilotx, &uih->autopiloty,
+ &uih->autopilotbuttons, uih_changed, n);
+}
+
+static INLINE void uih_zoom(uih_context * uih)
+{
+ uih->step += uih->speedup * 2 * uih->mul;
+ if (uih->step > uih->maxstep)
+ uih->step = uih->maxstep;
+ else if (uih->step < -uih->maxstep)
+ uih->step = -uih->maxstep;
+}
+
+static INLINE void uih_unzoom(uih_context * uih)
+{
+ uih->step -= uih->speedup * 2 * uih->mul;
+ if (uih->step > uih->maxstep)
+ uih->step = uih->maxstep;
+ else if (uih->step < -uih->maxstep)
+ uih->step = -uih->maxstep;
+}
+
+static INLINE void uih_slowdown(uih_context * uih)
+{
+ if (uih->step > 0) {
+ if (uih->step < uih->speedup * uih->mul)
+ uih->step = 0;
+ else
+ uih->step -= uih->speedup * uih->mul;
+ } else if (uih->step < 0) {
+ if (uih->step > -uih->speedup * uih->mul)
+ uih->step = 0;
+ else
+ uih->step += uih->speedup * uih->mul;
+ }
+}
+
+static INLINE void uih_zoomupdate(uih_context * uih)
+{
+ number_t x;
+ number_t y;
+ number_t mmul = pow((double) (1 - uih->step), (double) uih->mul);
+ number_t mc = uih->fcontext->s.cr - uih->fcontext->s.rr / 2;
+ number_t nc = uih->fcontext->s.cr + uih->fcontext->s.rr / 2;
+ number_t mi = uih->fcontext->s.ci - uih->fcontext->s.ri / 2;
+ number_t ni = uih->fcontext->s.ci + uih->fcontext->s.ri / 2;
+ x = uih->xcenter, y = uih->ycenter;
+ mc = x + (mc - x) * (mmul);
+ nc = x + (nc - x) * (mmul);
+ mi = y + (mi - y) * (mmul);
+ ni = y + (ni - y) * (mmul);
+ uih->fcontext->s.rr = nc - mc;
+ uih->fcontext->s.ri = ni - mi;
+ uih->fcontext->s.cr = (nc + mc) / 2;
+ uih->fcontext->s.ci = (ni + mi) / 2;
+ uih_animate_image(uih);
+}
+
+
+/*main uih loop */
+
+int uih_update(uih_context * c, int mousex, int mousey, int mousebuttons)
+{
+ int inmovement = 0;
+ int slowdown = 1;
+ int time;
+ uih = c;
+
+ if (!mousebuttons && uih->lastbuttons)
+ uih_saveundo(c);
+ uih->lastbuttons = mousebuttons;
+ if (c->incalculation)
+ return 0;
+ if (c->emulator != NULL)
+ tl_elpased(c->emulator, c->emulatedframetime);
+
+ if (mousebuttons == (BUTTON1 | BUTTON3))
+ mousebuttons = BUTTON2;
+ tl_process_group(syncgroup, NULL); /*First we need to update timming */
+ tl_update_time();
+ time = tl_lookup_timer(c->maintimer);
+ if (c->autopilot) { /*now handle autopilot */
+ tl_process_group(c->autopilotgroup, NULL);
+ }
+ if (!c->inanimation)
+ time = 0;
+ if (time > 2000000) {
+ uih_slowdowntimers(uih, time - 2000000);
+ time = 2000000;
+ }
+ if (c->inanimation)
+ c->inanimation--;
+ tl_reset_timer(c->maintimer);
+ c->mul = (double) time / FRAMETIME;
+ if (c->fixedstep)
+ c->mul = 0.3;
+ if (c->tbreak)
+ c->mul = 1, c->tbreak--;
+ if (c->mul == 0)
+ c->mul = 0.00000001;
+ if (c->play) {
+ uih_playupdate(c);
+ if (!c->play) {
+ c->inanimation = 2;
+ return 1;
+ }
+ if (c->playc->lines.morphing) /*inmovement=1, c->display=1; */
+ uih_update_lines(c);
+ if (c->step)
+ uih_zoomupdate(c), inmovement = 1;
+ switch (c->zoomactive) {
+ case 1:
+ uih_zoom(c), inmovement = 1;
+ break;
+ case -1:
+ uih_unzoom(c), inmovement = 1;
+ break;
+ default:
+ uih_slowdown(c);
+ }
+ if (c->playc->morph) {
+ int timer =
+ tl_lookup_timer(c->playc->timer) - c->playc->starttime;
+ number_t mmul = /*(tl_lookup_timer (c->playc->timer) - c->playc->starttime) / (number_t) (c->playc->frametime - c->playc->starttime); */
+ MORPHVALUE(timer,
+ c->playc->frametime - c->playc->starttime,
+ c->playc->morphtimes[0],
+ c->playc->morphtimes[1]);
+ number_t srr, drr;
+ number_t mmul1;
+ if (c->playc->source.rr * c->fcontext->windowwidth >
+ c->playc->source.ri * c->fcontext->windowheight)
+ srr = c->playc->source.rr;
+ else
+ srr = c->playc->source.ri;
+ if (c->playc->destination.rr * c->fcontext->windowwidth >
+ c->playc->destination.ri * c->fcontext->windowheight)
+ drr = c->playc->destination.rr;
+ else
+ drr = c->playc->destination.ri;
+ if (srr == drr)
+ mmul1 = mmul;
+ else
+ mmul1 =
+ (exp(log(srr) + ((log(drr) - log(srr)) * mmul)) -
+ srr) / (drr - srr);
+ if (mmul1 > 1)
+ mmul1 = 1;
+ if (mmul1 < 0)
+ mmul1 = 0;
+ inmovement = 1;
+ c->fcontext->s.rr =
+ c->playc->source.rr + (c->playc->destination.rr -
+ c->playc->source.rr) * mmul1;
+ c->fcontext->s.ri =
+ c->playc->source.ri + (c->playc->destination.ri -
+ c->playc->source.ri) * mmul1;
+ c->fcontext->s.cr =
+ c->playc->source.cr + (c->playc->destination.cr -
+ c->playc->source.cr) * mmul1;
+ c->fcontext->s.ci =
+ c->playc->source.ci + (c->playc->destination.ci -
+ c->playc->source.ci) * mmul1;
+ uih_animate_image(c);
+ }
+ if (c->playc->morphjulia) {
+ int timer =
+ tl_lookup_timer(c->playc->timer) - c->playc->starttime;
+ number_t mmul = /*(tl_lookup_timer (c->playc->timer) - c->playc->starttime) / (number_t) (c->playc->frametime - c->playc->starttime); */
+ MORPHVALUE(timer,
+ c->playc->frametime - c->playc->starttime,
+ c->playc->morphjuliatimes[0],
+ c->playc->morphjuliatimes[1]);
+ uih_setjuliaseed(uih,
+ c->playc->sr + (c->playc->dr -
+ c->playc->sr) * mmul,
+ c->fcontext->pim =
+ c->playc->si + (c->playc->di -
+ c->playc->si) * mmul);
+ inmovement = 1;
+ }
+ if (c->playc->morphangle) {
+ int timer =
+ tl_lookup_timer(c->playc->timer) - c->playc->starttime;
+ number_t mmul = /*(tl_lookup_timer (c->playc->timer) - c->playc->starttime) / (number_t) (c->playc->frametime - c->playc->starttime); */
+ MORPHVALUE(timer,
+ c->playc->frametime - c->playc->starttime,
+ c->playc->morphangletimes[0],
+ c->playc->morphangletimes[1]);
+ uih_angle(uih,
+ c->playc->srcangle + (c->playc->destangle -
+ c->playc->srcangle) * mmul);
+ inmovement = 1;
+ }
+ } else {
+ if (!c->juliamode) {
+ if (c->autopilot) { /*now handle autopilot */
+ mousex = c->autopilotx;
+ mousey = c->autopiloty;
+ mousebuttons = c->autopilotbuttons;
+ inmovement = 1;
+ }
+ if (c->step) {
+ number_t x;
+ number_t y;
+ if (mousex != c->xcenterm || mousey != c->ycenterm) {
+ c->xcenterm = mousex;
+ c->ycenterm = mousey;
+ uih_getcoord(uih, mousex, mousey, &x, &y);
+ c->xcenter = x;
+ c->ycenter = y;
+ }
+ uih_zoomupdate(c), inmovement = 1;
+ }
+ c->zoomactive = 0;
+ if (c->rotatemode != ROTATE_MOUSE)
+ switch (mousebuttons) { /*process buttons */
+ case BUTTON1:
+ c->zoomactive = 1;
+ inmovement = 1;
+ break;
+ case BUTTON3:
+ c->zoomactive = -1;
+ inmovement = 1;
+ break;
+ }
+ uih_saveframe(c);
+ if (c->rotatemode != ROTATE_MOUSE) {
+ c->rotatepressed = 0;
+ switch (mousebuttons) { /*process buttons */
+ case BUTTON1:
+ uih_zoom(c), slowdown = 0;
+ break;
+ case BUTTON3:
+ uih_unzoom(c), slowdown = 0;
+ break;
+ case BUTTON2:
+ {
+ number_t x, y;
+ uih_getcoord(uih, mousex, mousey, &x, &y);
+ if (c->pressed && (c->oldx != x || c->oldy != y)) {
+ c->fcontext->s.cr -= x - c->oldx;
+ c->fcontext->s.ci -= y - c->oldy;
+ uih_animate_image(c);
+ c->moved = 1;
+ }
+ c->pressed = 1;
+ c->speed = 0;
+ update_view(c->fcontext);
+ uih_getcoord(uih, mousex, mousey, &c->oldx,
+ &c->oldy);
+ }
+ break;
+ }
+ } else {
+ if (mousebuttons & BUTTON1) {
+ number_t x, y;
+ number_t angle;
+
+ x = (mousex -
+ c->image->width / 2) * c->image->pixelwidth;
+ y = (mousey -
+ c->image->height / 2) * c->image->pixelheight;
+ angle = -atan2(x, y) * 180 / M_PI;
+ if (c->rotatepressed) {
+ uih_angle(uih,
+ c->fcontext->angle + angle -
+ c->oldangle);
+ }
+ c->rotatepressed = 1;
+ c->oldangle = angle;
+ } else
+ c->rotatepressed = 0;
+ }
+ if (!(mousebuttons & BUTTON2))
+ c->pressed = 0;
+ if (slowdown)
+ uih_slowdown(c);
+ } else {
+ if (mousebuttons & BUTTON1) {
+ number_t x, x1 = c->fcontext->pre;
+ number_t y, y1 = c->fcontext->pim;
+ c->zoomactive = 0;
+ uih_getcoord(uih, mousex, mousey, &x, &y);
+ c->fcontext->pre = x;
+ c->fcontext->pim = y;
+ uih_saveframe(c);
+ c->pressed = 1;
+ recalculate(c->fcontext->plane, &c->fcontext->pre,
+ &c->fcontext->pim);
+ if (c->fcontext->pre != x1 || c->fcontext->pim != y1) {
+ uih_animate_image(c);
+ }
+ } else
+ c->pressed = 0;
+ }
+ }
+ if (!inmovement)
+ uih_tbreak(c);
+ if (c->uncomplette)
+ inmovement = 1;
+ if (!c->recalculatemode && !c->display)
+ uih_finishpalette(c);
+ if (!inmovement)
+ uih_callcomplette(c);
+ if (c->inanimation < inmovement * 2)
+ c->inanimation = inmovement * 2;
+ return (inmovement * 2);
+}
+
+/*actions that can be used be user interface */
+
+void uih_autopilot_on(uih_context * c)
+{
+ if (!c->autopilot) {
+ clean_autopilot(c);
+ uih_autopilothandler(c, 1);
+ tl_update_time();
+ uih_resumetimers(c);
+ c->autopilottimer = tl_create_timer();
+ c->autopilotgroup = tl_create_group();
+ tl_set_multihandler(c->autopilottimer, uih_autopilothandler, c);
+ tl_set_interval(c->autopilottimer, 1000000 / 25);
+ tl_reset_timer(c->autopilottimer);
+ tl_add_timer(c->autopilotgroup, c->autopilottimer);
+ tl_update_time();
+ c->autopilot = 1;
+ uih_emulatetimers(c);
+ uih_updatemenus(c, "autopilot");
+ }
+}
+
+void uih_autopilot_off(uih_context * c)
+{
+ if (c->autopilot) {
+ tl_remove_timer(c->autopilottimer);
+ tl_free_timer(c->autopilottimer);
+ tl_free_group(c->autopilotgroup);
+ c->autopilot = 0;
+ uih_updatemenus(c, "autopilot");
+ }
+}
+
+void uih_mkdefaultpalette(uih_context * c)
+{
+ if (c->zengine->fractalc->palette == NULL)
+ return;
+ uih_cycling_stop(c);
+ if (mkdefaultpalette(c->zengine->fractalc->palette) != 0) {
+ uih_newimage(c);
+ }
+ uih_palettechg(c);
+ c->paletteshift = 0;
+ c->manualpaletteshift = 0;
+ c->palettechanged = 1;
+ c->palettetype = 0;
+ uih_finishpalette(c);
+ uih_cycling_continue(c);
+}
+
+void uih_mkpalette(uih_context * c)
+{
+ int seed;
+ int alg = rand() % PALGORITHMS;
+ if (c->zengine->fractalc->palette == NULL)
+ return;
+ uih_cycling_stop(c);
+ if (mkpalette(c->zengine->fractalc->palette, seed = rand(), alg) != 0) {
+ uih_newimage(c);
+ }
+ uih_palettechg(c);
+ c->paletteshift = 0;
+ c->manualpaletteshift = 0;
+ c->paletteseed = seed;
+ uih_finishpalette(c);
+ c->palettechanged = 1;
+ c->palettetype = alg + 1;
+ uih_cycling_continue(c);
+}
+
+/*Basic inicialization routines */
+
+static void uih_alloctables(uih_context * c)
+{
+ c->zengine = zoom_filter.getinstance(&zoom_filter);
+ if (c->zengine == NULL)
+ return;
+ c->fcontext =
+ make_fractalc(0, c->image->pixelwidth * c->image->width,
+ c->image->pixelheight * c->image->height);
+ uih_updatemenus(c, "periodicity") uih_updatemenus(c, "in0")
+ uih_updatemenus(c, "int0") uih_updatemenus(c,
+ "out0")
+ uih_updatemenus(c, "outt0")
+ uih_updatemenus(c, "plane0") uih_updatemenus(c, "guess3") uih = c;
+ c->uifilter = uih_filter.getinstance(&uih_filter);
+ c->queue = create_queue(c->uifilter);
+ insertfilter(c->zengine, c->uifilter);
+}
+
+static int uih_initqueue(uih_context * c)
+{
+ return (initqueue(c->queue));
+}
+
+void uih_setmaxstep(uih_context * c, number_t p)
+{
+ c->maxstep = p;
+}
+
+void uih_setspeedup(uih_context * c, number_t p)
+{
+ c->speedup = p;
+}
+
+void uih_setmaxiter(uih_context * c, int maxiter)
+{
+ if (maxiter < 1)
+ maxiter = 1;
+ if (maxiter > 2000000)
+ maxiter = 2000000;
+ if (c->fcontext->maxiter != (unsigned int) maxiter) {
+ c->fcontext->maxiter = maxiter;
+ c->fcontext->version++;
+ uih_newimage(c);
+ }
+}
+
+void uih_setbailout(uih_context * c, number_t bailout)
+{
+ if (bailout < 0)
+ bailout = 0;
+ if (c->fcontext->bailout != (number_t) bailout) {
+ c->fcontext->bailout = bailout;
+ c->fcontext->version++;
+ uih_newimage(c);
+ }
+}
+
+void uih_setincoloringmode(uih_context * c, int mode)
+{
+ if (mode < 0)
+ mode = rand() % INCOLORING;
+ if (mode > INCOLORING)
+ mode = INCOLORING;
+ if (c->fcontext->incoloringmode != mode) {
+ char str[10];
+ c->fcontext->incoloringmode = mode;
+ c->fcontext->version++;
+ uih_newimage(c);
+ sprintf(str, "in%i", mode);
+ uih_updatemenus(c, str);
+ }
+}
+
+void uih_setintcolor(uih_context * c, int mode)
+{
+ if (mode < 0)
+ mode = rand() % TCOLOR;
+ if (mode > TCOLOR)
+ mode = TCOLOR;
+ if (c->fcontext->intcolor != mode) {
+ char str[10];
+ c->fcontext->intcolor = mode;
+ if (c->fcontext->incoloringmode == 10) {
+ c->fcontext->version++;
+ uih_newimage(c);
+ }
+ sprintf(str, "int%i", mode);
+ uih_updatemenus(c, str);
+ }
+}
+
+void uih_setouttcolor(uih_context * c, int mode)
+{
+ if (mode < 0)
+ mode = rand() % TCOLOR;
+ if (mode > TCOLOR)
+ mode = TCOLOR;
+ if (c->fcontext->outtcolor != mode) {
+ char str[10];
+ c->fcontext->outtcolor = mode;
+ if (c->fcontext->coloringmode == 10) {
+ c->fcontext->version++;
+ uih_newimage(c);
+ }
+ sprintf(str, "outt%i", mode);
+ uih_updatemenus(c, str);
+ }
+}
+
+void uih_setperbutation(uih_context * c, number_t zre, number_t zim)
+{
+ if (c->fcontext->bre != zre || c->fcontext->bim != zim) {
+ c->fcontext->bre = zre;
+ c->fcontext->bim = zim;
+ if (c->fcontext->mandelbrot) {
+ c->fcontext->version++;
+ uih_newimage(c);
+ }
+ uih_updatemenus(c, "uiperturbation");
+ }
+}
+
+void uih_perbutation(uih_context * c, int mousex, int mousey)
+{
+ number_t r, i;
+ uih_getcoord(c, mousex, mousey, &r, &i);
+ uih_setperbutation(c, r, i);
+}
+
+void uih_setjuliaseed(uih_context * c, number_t zre, number_t zim)
+{
+ if (c->fcontext->pre != zre || c->fcontext->pim != zim) {
+ c->fcontext->pre = zre;
+ c->fcontext->pim = zim;
+ if (c->juliamode) {
+ uih_animate_image(c);
+ } else {
+ if (!c->fcontext->mandelbrot) {
+ c->fcontext->version++;
+ if (c->playc && c->playc->morphjulia)
+ uih_animate_image(c);
+ else
+ uih_newimage(c);
+ }
+ }
+ }
+}
+
+void uih_setfastmode(uih_context * c, int mode)
+{
+ CONST char *names[] = {
+ "nodynamic",
+ "nodynamic",
+ "dynamicanimation",
+ "dynamicnew",
+ "dynamicnew"
+ };
+ if (mode < 0)
+ mode = 0;
+ c->fastmode = mode;
+ uih_updatemenus(c, names[mode]);
+}
+
+void uih_setoutcoloringmode(uih_context * c, int mode)
+{
+ if (mode < 0)
+ mode = rand() % OUTCOLORING;
+ if (mode > OUTCOLORING)
+ mode = OUTCOLORING - 1;
+ if (c->fcontext->coloringmode != mode) {
+ char str[10];
+ c->fcontext->coloringmode = mode;
+ c->fcontext->version++;
+ uih_newimage(c);
+ sprintf(str, "out%i", mode);
+ uih_updatemenus(c, str);
+ }
+}
+
+void uih_setplane(uih_context * c, int mode)
+{
+ int i;
+
+ if (mode < 0)
+ mode = 0;
+ for (i = 0; planename[i] != NULL; i++);
+ if (mode >= i)
+ mode = i - 1;
+ if (mode < 0)
+ mode = rand() % i;
+ uih_invalidatepos(c);
+ if (c->fcontext->plane != mode) {
+ char str[10];
+ c->fcontext->plane = mode;
+ //if ( c->fcontext->plane == P_USER )
+ //printf("USER NOT IMPLEMENTED");
+ //uih_sffein( c, "z^3-c" )
+ c->fcontext->version++;
+ uih_newimage(c);
+ sprintf(str, "plane%i", mode);
+ uih_updatemenus(c, str);
+ }
+}
+
+void
+uih_screentofractalcoord(uih_context * c, int mousex, int mousey,
+ number_t * re, number_t * im)
+{
+ uih_getcoord(c, mousex, mousey, re, im);
+ recalculate(c->fcontext->plane, re, im);
+}
+
+void uih_setmandelbrot(uih_context * c, int mode, int mousex, int mousey)
+{
+ if (mode < 0)
+ mode = 0;
+ if (mode > 1)
+ mode = 1;
+ if (c->fcontext->mandelbrot != mode) {
+ c->fcontext->mandelbrot = mode;
+ if (c->fcontext->mandelbrot == 0 && !c->juliamode) {
+ uih_getcoord(c, mousex, mousey, &c->fcontext->pre,
+ &c->fcontext->pim);
+ recalculate(c->fcontext->plane, &c->fcontext->pre,
+ &c->fcontext->pim);
+ } else
+ uih_disablejulia(c);
+ c->fcontext->version++;
+ uih_newimage(c);
+ uih_updatemenus(c, "uimandelbrot");
+ }
+}
+
+void uih_setguessing(uih_context * c, int range)
+{
+ char str[10];
+ c->fcontext->range = range;
+ if (range <= 1) {
+ uih_updatemenus(c, "noguess");
+ } else if (range > 8) {
+ uih_updatemenus(c, "guessall");
+ } else {
+ sprintf(str, "guess%i", range);
+ uih_updatemenus(c, str);
+ }
+}
+
+void uih_setperiodicity(uih_context * c, int periodicity)
+{
+ c->fcontext->periodicity = periodicity;
+ uih_updatemenus(c, "periodicity");
+}
+
+void uih_interrupt(uih_context * c)
+{
+ if (c->incalculation)
+ c->interrupt = 1;
+}
+
+void uih_stopzooming(uih_context * c)
+{
+ c->speed = 0;
+}
+
+int uih_updateimage(uih_context * c, struct image *image)
+{
+ /*exit(); */
+ c->image = image;
+ c->palette = image->palette;
+ c->queue->isinitialized = 0;
+ c->ddatalost = 1;
+ fractalc_resize_to(c->fcontext, c->image->pixelwidth * c->image->width,
+ c->image->pixelheight * c->image->height);
+ c->display = 1;
+ c->palette->ncells = sizeof(uicolors) / sizeof(rgb_t);
+ c->palette->prergb = uicolors;
+ if (c->palette->type & BITMAPS)
+ c->palette->prergb = uibwcolors;
+ c->inanimation = 2;
+ uih_newimage(c);
+ if (image->palette->type & (FIXEDCOLOR | BITMAPS))
+ uih_fixedcolorenable(c);
+ else
+ uih_fixedcolordisable(c);
+ return (uih_initqueue(c));
+}
+
+static void
+uih_getcscreensizes(struct uih_context *uih, int *x, int *y, int *w,
+ int *h, void *data)
+{
+ *x = 0;
+ *y = 0;
+ if (uih->clearscreen)
+ *w = uih->image->width, *h = uih->image->height;
+ else
+ *w = *h = 0;
+}
+
+static void uih_drawcscreen(struct uih_context *uih, void *data)
+{
+ if (uih->clearscreen)
+ clear_image(uih->image);
+}
+
+#ifdef SFFE_USING
+extern cmplx C, Z, pZ;
+#endif
+struct uih_context *globaluih;
+
+struct uih_context *uih_mkcontext(int flags, struct image *image,
+ int (*passfunc) (struct uih_context *,
+ int, CONST char *,
+ float),
+ void (*longwait) (struct uih_context *),
+ void (*upd) (struct uih_context *,
+ CONST char *))
+{
+ uih_context *uih;
+ uih = (uih_context *) calloc(sizeof(*uih), 1); /*setup parameters */
+ uih->updatemenus = upd;
+ uih->autopilot = 0;
+ uih->flags = flags;
+ uih->image = image;
+ uih->playstring = NULL;
+ uih->palette = image->palette;
+ uih->menuroot = "root";
+ uih->palette->ncells = sizeof(uicolors) / sizeof(rgb_t);
+ uih->palette->prergb = uicolors;
+ if (uih->palette->type & BITMAPS) {
+ uih->palette->prergb = uibwcolors;
+ }
+ uih->speed = 0;
+ uih->step = 0;
+ uih->color = 0;
+ uih->speedup = STEP;
+ uih->maxstep = MAXSTEP;
+ uih->lasttime = -1;
+ uih->recalculatemode = UIH_NEW_IMAGE;
+ uih->display = 1;
+ uih->fastmode = 2;
+ uih_updatemenus(uih, "dynamicanimation");
+ uih->aliasnum = -1;
+ uih->direction = 1;
+ uih->cyclingdirection = 1;
+ uih->cyclingspeed = ROTATIONSPEED;
+ uih->ddatalost = 1;
+ uih->xtextpos = 1;
+ uih_updatemenus(uih, "xtextleft");
+ uih->complettehandler = 0;
+ uih->ytextpos = 1;
+ uih_updatemenus(uih, "ytextup");
+ uih->display = 0;
+ uih->errstring = NULL;
+ uih->rotatemode = 0;
+ uih_updatemenus(uih, "norotate");
+ uih->rotationspeed = 10;
+ uih->longwait = longwait;
+ uih->passfunc = passfunc;
+ uih->nletters = 0;
+ uih->letterspersec = 15;
+ uih->maintimer = tl_create_timer();
+ uih->calculatetimer = tl_create_timer();
+ uih->doittimer = tl_create_timer();
+#ifdef SFFE_USING
+ uih->pinit = NULL;
+ uih->parser = sffe_alloc();
+ /* uih->cparser = sffe_alloc(); */
+ sffe_regvar(&uih->parser, &pZ, 'p');
+ sffe_regvar(&uih->parser, &Z, 'z');
+ sffe_regvar(&uih->parser, &C, 'c');
+ /* sffe_regvar( &uih->cparser, &C, */
+#endif
+ /* 25.I.2009, Bugfix #2507911, malczak
+ * initilize globaluih here, not in 'ui.c'
+ */
+ globaluih = uih;
+
+ tl_update_time();
+ tl_reset_timer(uih->maintimer);
+ tl_reset_timer(uih->calculatetimer);
+ tl_stop_timer(uih->doittimer);
+ tl_reset_timer(uih->doittimer);
+ uih_alloctables(uih);
+ uih_initqueue(uih); /*FIXME return value should not be ignored */
+ if (image->palette->type & (FIXEDCOLOR | BITMAPS))
+ uih_fixedcolorenable(uih);
+ uih_mkdefaultpalette(uih);
+ uih_stoptimers(uih);
+ clean_autopilot(uih);
+ uih_newimage(uih);
+ uih->cscreenwindow =
+ uih_registerw(uih, uih_getcscreensizes, uih_drawcscreen, 0,
+ NONTRANSPARENTW);
+ uih_initmessages(uih);
+ uih_inittext(uih);
+ uih_emulatetimers(uih);
+ uih_setformula(uih, 0);
+ uih_saveundo(uih);
+ return (uih);
+}
+
+void uih_savepalette(uih_context * c)
+{
+ if (c->palette2 != NULL)
+ destroypalette(c->palette2);
+ if (c->zengine->fractalc->palette != NULL)
+ c->palette2 = clonepalette(c->zengine->fractalc->palette);
+}
+
+void uih_restorepalette(uih_context * uih)
+{
+ if (uih->palette2 != NULL) {
+ if (uih->zengine->fractalc->palette != NULL)
+ restorepalette(uih->zengine->fractalc->palette, uih->palette2);
+ destroypalette(uih->palette2);
+ }
+ uih->palette2 = NULL;
+ uih_finishpalette(uih);
+}
+
+void uih_loadpalette(uih_context * c, struct palette *palette)
+{
+ if (c->palette2)
+ destroypalette(c->palette2);
+ c->palette2 = clonepalette(palette);
+ uih_restorepalette(c);
+ uih_palettechg(c);
+}
+
+struct palette *uih_clonepalette(uih_context * c)
+{
+ if (c->zengine->fractalc->palette != NULL)
+ return clonepalette(c->zengine->fractalc->palette);
+ // I hope this is OK:
+ return NULL;
+}
+
+void uih_setformula(uih_context * c, int num)
+{
+ set_formula(c->fcontext, num);
+ uih_newimage(c);
+ uih_updatemenus(c, "uimandelbrot");
+ uih_updatemenus(c, "uiperturbation");
+ uih_updatemenus(c, c->fcontext->currentformula->shortname);
+}
+
+void uih_initstate(struct uih_context *uih)
+{
+ int i;
+ int ver = uih->fcontext->version;
+ uih->step = 0;
+ uih->speedup = STEP;
+ uih->maxstep = MAXSTEP;
+ uih_fastrotatedisable(uih);
+ uih_disablejulia(uih);
+ uih->color = 0;
+ uih_cycling_off(uih);
+ for (i = 0; i < uih_nfilters; i++)
+ uih_disablefilter(uih, i);
+ uih_setperbutation(uih, 0, 0);
+ set_formula(uih->fcontext, 0);
+ uih_setperiodicity(uih, 1);
+ uih_setmaxiter(uih, 170);
+ uih_setbailout(uih, 4);
+ uih_setincoloringmode(uih, 0);
+ uih_setoutcoloringmode(uih, 0);
+ uih_setcycling(uih, 30);
+ uih_display(uih);
+ uih_setfastmode(uih, 2);
+ uih_setintcolor(uih, 0);
+ uih_setouttcolor(uih, 0);
+ uih_setplane(uih, 0);
+ uih_setguessing(uih, 3);
+ uih_angle(uih, 0);
+ uih_rotatemode(uih, 0);
+ uih_rotationspeed(uih, 10);
+ uih->xtextpos = 1;
+ uih->ytextpos = 1;
+ if (uih->playc) {
+ uih->playc->morphtimes[0] = 0;
+ uih->playc->morphtimes[1] = 0;
+ uih->playc->morphjuliatimes[0] = 0;
+ uih->playc->morphjuliatimes[1] = 0;
+ uih->playc->morphangletimes[0] = 0;
+ uih->playc->morphangletimes[1] = 0;
+ uih->playc->morphlinetimes[0] = 0;
+ uih->playc->morphlinetimes[1] = 0;
+ }
+ if (mkdefaultpalette(uih->zengine->fractalc->palette) != 0
+ || uih->recalculatemode || uih->fcontext->version != ver) {
+ uih_newimage(uih);
+ }
+}
+
+
+void uih_freecontext(uih_context * c)
+{
+ struct filter *f;
+ int i;
+#ifdef SFFE_USING
+ /* sffe_free(&c->cparser); */
+ sffe_free(&c->parser);
+ if (c->pinit)
+ sffe_free(&c->pinit);
+#endif
+ if (c->emulator != NULL)
+ uih_noconstantframetime(c);
+ for (i = 0; i < UNDOLEVEL; i++)
+ if (c->undo.undos[i])
+ free(c->undo.undos[i]), c->undo.undos[i] = 0;
+ while (c->queue->first) {
+ f = c->queue->first;
+ removefilter(c->queue->first);
+ f->action->destroyinstance(f);
+ }
+ uih_destroymessages(c);
+ uih_destroytext(c);
+ uih_removew(c, c->cscreenwindow);
+ free(c->queue);
+ free_fractalc(c->fcontext);
+ free(c);
+}
+
+static struct filter *uih_getinstance(CONST struct filteraction *a)
+{
+ struct filter *f = createfilter(a);
+ f->data = uih;
+ f->name = "XaoS's user interface layer";
+ return (f);
+}
+
+static void uih_destroyinstance(struct filter *f)
+{
+ struct uih_context *c = (struct uih_context *) f->data;
+ if (c->autopilot)
+ uih_autopilot_off(c);
+ if (c->cycling)
+ uih_cycling_off(c);
+ tl_free_timer(c->maintimer);
+ tl_free_timer(c->calculatetimer);
+ tl_free_timer(c->doittimer);
+ if (c->save)
+ uih_save_disable(c);
+ if (c->play)
+ uih_replaydisable(c);
+ free(f);
+}
+
+static int wascycling;
+static int uih_require(struct filter *f, struct requirements *r)
+{
+ struct uih_context *uih;
+ uih = (struct uih_context *) f->data;
+ f->req = *r;
+ uih_clearwindows(uih);
+ if (uih->cycling)
+ uih_cycling_off(uih), wascycling = 1;
+ if (!(r->supportedmask & uih->image->palette->type))
+ return 0;
+ /*FIXME something should be done here :) */
+ return (1);
+}
+
+static int uih_initialize(struct filter *f, struct initdata *i)
+{
+ struct uih_context *uih;
+ int returnval;
+ uih = (struct uih_context *) f->data;
+ f->queue->saveimage = uih->image;
+ i->fractalc = uih->fcontext;
+ uih_setfont(uih);
+ tl_update_time();
+ f->image = uih->image;
+ f->wait_function = uih_waitfunc;
+ uih->times[0][0] = -1;
+ i->image = uih->image;
+ f->fractalc = i->fractalc;
+ f->image->palette->flags |= FINISHLATER;
+ i->fractalc->palette = uih->image->palette;
+ i->wait_function = uih_waitfunc;
+ /*FIXME datalost should be handled in better way */
+ if (uih->ddatalost)
+ i->flags |= DATALOST;
+ uih->tbreak = 2;
+ uih_invalidatepos(uih);
+ clean_autopilot(uih);
+ returnval = f->previous->action->initialize(f->previous, i);
+ if (wascycling)
+ uih_cycling_on(uih), wascycling = 0;
+ return returnval;
+}
+
+void uih_inhibittextsw(uih_context * c)
+{
+ c->inhibittextoutput ^= 1;
+ uih_updatemenus(c, "inhibittextoutput");
+}
+
+int uih_inhibittextselected(uih_context * c)
+{
+ if (c == NULL)
+ return 0;
+ return c->inhibittextoutput;
+}
diff --git a/src/ui-hlp/wstack.c b/src/ui-hlp/wstack.c
new file mode 100644
index 0000000..cfabab1
--- /dev/null
+++ b/src/ui-hlp/wstack.c
@@ -0,0 +1,528 @@
+#ifdef _plan9_
+#include <u.h>
+#include <libc.h>
+#else
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#endif
+#include <fconfig.h>
+#include <filter.h>
+#include <ui_helper.h>
+#include <archaccel.h>
+#include "grlib.h"
+
+/* This is quite simple and ugly implementation of windows.
+ * it redraws all windows every frame and removes them before calculation
+ * it should be OK for small windows (like texts) used by ui_helper
+ * I plan to abuse it in ugly interface too, in case it will be fast enought
+ */
+
+static void
+uih_darkrectangle(struct image *image, int x, int y, int width, int height)
+{
+
+ int mask = 0;
+ unsigned int *current, *end;
+ if (x + width < 0 || y + height < 0 || y >= image->height
+ || x >= image->width)
+ return;
+ if (x + width >= image->width)
+ width = image->width - x;
+ if (x < 0)
+ width += x, x = 0;
+ if (width <= 0)
+ return;
+ if (y + height >= image->height)
+ height = image->height - y;
+ if (y < 0)
+ height += y, y = 0;
+ if (height <= 0)
+ return;
+ assert(x >= 0 && y >= 00 && width > 0 && height > 0
+ && x + width <= image->width && y + height <= image->height);
+ if (image->bytesperpixel == 2) {
+ int x1 = x / 2;
+ width = (x + width + 1) / 2 - x1;
+ x = x1;
+ }
+ if (image->bytesperpixel == 3) {
+ int x1 = x * 3 / 4;
+ width = (x + width + 2) * 3 / 4 - x1;
+ x = x1;
+ }
+ switch (image->palette->type) {
+ case TRUECOLOR:
+ case TRUECOLOR24:
+ mask =
+ ~((1 <<
+ (image->palette->info.truec.rshift + 7 -
+ image->palette->info.truec.rprec)) | (1 << (image->
+ palette->info.
+ truec.gshift +
+ 7 -
+ image->
+ palette->info.
+ truec.
+ gprec)) | (1 <<
+ (image->
+ palette->
+ info.
+ truec.
+ bshift
+ +
+ 7 -
+ image->
+ palette->
+ info.
+ truec.
+ bprec)));
+ break;
+ case TRUECOLOR16:
+ mask =
+ ((1 <<
+ (image->palette->info.truec.rshift + 7 -
+ image->palette->info.truec.rprec)) | (1 << (image->
+ palette->info.
+ truec.gshift +
+ 7 -
+ image->
+ palette->info.
+ truec.
+ gprec)) | (1 <<
+ (image->palette->info.truec.bshift
+ +
+ 7 -
+ image->palette->info.truec.bprec)));
+ mask = ~(mask | (mask << 16));
+ break;
+ }
+ height += y;
+ while (y < height) {
+ current = ((unsigned int *) image->currlines[y]) + x;
+ end = current + width;
+ while (current < end)
+ *current = (*current >> 1) & mask, current++;
+ y++;
+ }
+
+}
+
+void
+uih_drawborder(struct uih_context *uih, int x, int y, int width,
+ int height, int flags)
+{
+ int leftcolor;
+ int rightcolor;
+ int bgcolor;
+ if (uih->palette->type & BITMAPS) {
+ if (flags & BORDER_PRESSED) {
+ bgcolor = FGCOLOR(uih);
+ rightcolor = BGCOLOR(uih);
+ leftcolor = BGCOLOR(uih);
+ } else {
+ bgcolor = BGCOLOR(uih);
+ rightcolor = FGCOLOR(uih);
+ leftcolor = FGCOLOR(uih);
+ }
+ } else {
+ if (flags & BORDER_LIGHT) {
+ bgcolor = LIGHTGRAYCOLOR(uih);
+ rightcolor = BGCOLOR(uih);
+ leftcolor = LIGHTGRAYCOLOR2(uih);
+ } else {
+ bgcolor = DARKGRAYCOLOR(uih);
+ rightcolor = BGCOLOR(uih);
+ leftcolor = LIGHTGRAYCOLOR(uih);
+ }
+ if (flags & BORDER_PRESSED) {
+ int i = leftcolor;
+ leftcolor = rightcolor;
+ rightcolor = i;
+ }
+ if (uih->image->flags & AAIMAGE)
+ bgcolor = BGCOLOR(uih);
+ }
+ if (uih->image->bytesperpixel > 1 && (flags & BORDER_TRANSPARENT))
+ uih_darkrectangle(uih->image, x + 1, y + 1, width - 2,
+ height - 2) /*, leftcolor = GRAYCOLOR (uih) */ ;
+ else {
+ xrectangle(uih->image, x + 1, y + 1, width - 2, height - 2,
+ bgcolor);
+ }
+ xhline(uih->image, x, y, width - 1, leftcolor);
+ xhline(uih->image, x, y + height - 1, width - 1, rightcolor);
+ xvline(uih->image, x, y, height - 1, leftcolor);
+ xvline(uih->image, x + width - 1, y, height - 1, rightcolor);
+}
+
+struct uih_window *uih_registerw(struct uih_context *uih, uih_getposfunc
+ getpos, uih_drawfunc draw, void *data,
+ int flags)
+{
+ struct uih_window *w =
+ (struct uih_window *) calloc(1, sizeof(struct uih_window));
+ struct uih_window *w1;
+ assert(uih != NULL && getpos != NULL && draw != NULL && flags >= 0);
+ if (w == NULL)
+ return NULL;
+ uih_clearwindows(uih);
+ w1 = uih->wtop;
+ w->getpos = getpos;
+ w->draw = draw;
+ w->data = data;
+ w->flags = flags;
+ w->savedline = -1;
+ w->saveddata = NULL;
+ w->flags |= BORDER_TRANSPARENT | BORDER_PRESSED | BORDER_LIGHT;
+ w->next = NULL;
+ if (w1 == NULL) {
+ uih->wtop = w;
+ } else {
+ while (w1->next != NULL)
+ w1 = w1->next;
+ w1->next = w;
+ }
+ w->previous = w1;
+ w->x = -65536;
+ return w;
+}
+
+void
+uih_setline(struct uih_context *uih, struct uih_window *w, int color,
+ int x1, int y1, int x2, int y2)
+{
+ if (w->savedline != color || w->x != x1 || w->y != y1
+ || w->width != x2 - x1 || w->height != y2 - y1) {
+ uih_clearwindows(uih);
+ uih->display = 1;
+ w->savedline = color;
+ w->x = x1;
+ w->y = y1;
+ w->width = x2 - x1;
+ w->height = y2 - y1;
+ }
+}
+
+struct uih_window *uih_registerline(struct uih_context *uih, int color,
+ int x1, int y1, int x2, int y2)
+{
+ struct uih_window *w =
+ (struct uih_window *) calloc(1, sizeof(struct uih_window));
+ struct uih_window *w1;
+ if (w == NULL)
+ return NULL;
+ uih_clearwindows(uih);
+ w1 = uih->wtop;
+ uih->display = 1;
+ w->getpos = NULL;
+ w->savedline = color;
+ w->flags = 0;
+ w->x = x1;
+ w->y = y1;
+ w->width = x2 - x1;
+ w->height = y2 - y1;
+ w->saveddata = NULL;
+ w->next = NULL;
+ if (w1 == NULL) {
+ uih->wtop = w;
+ } else {
+ while (w1->next != NULL)
+ w1 = w1->next;
+ w1->next = w;
+ }
+ w->previous = w1;
+ return w;
+}
+
+void uih_removew(struct uih_context *uih, struct uih_window *w)
+{
+ uih_clearwindows(uih);
+ assert(uih->wtop != NULL);
+ assert(w != NULL);
+ uih->display = 1;
+
+ if (w->previous == NULL) {
+ assert(uih->wtop == w);
+ uih->wtop = w->next;
+ } else {
+ w->previous->next = w->next;
+ }
+ if (w->next != NULL) {
+ w->next->previous = w->previous;
+ }
+ free(w);
+}
+
+/*Remove all drawed windows from screen */
+void uih_clearwindows(struct uih_context *uih)
+{
+ struct uih_window *w = uih->wtop;
+ int savedline = 0;
+ int savedpos = 0;
+ int destwidth = uih->image->width * uih->image->bytesperpixel;
+ if (!uih->wdisplayed)
+ return;
+ if (!uih->image->bytesperpixel) {
+ destwidth = (w->x + uih->image->width + 7) / 8;
+ }
+ uih->wdisplayed = 0;
+ if (uih->wflipped)
+ uih->image->flip(uih->image), uih->wflipped = 0;
+ while (w) {
+ if (w->getpos == NULL) {
+ if (w->saveddata != NULL) {
+ xrestoreline(uih->image, w->saveddata, w->x, w->y,
+ w->width + w->x, w->height + w->y);
+ free(w->saveddata);
+ w->saveddata = NULL;
+ }
+ } else {
+ if (w->savedline != -1 || w->saveddata != NULL) {
+ int i;
+ int xskip = w->x * uih->image->bytesperpixel;
+ int width = w->width * uih->image->bytesperpixel;
+ if (!uih->image->bytesperpixel) {
+ xskip = w->x / 8;
+ width = (w->x + w->width + 7) / 8 - xskip;
+ }
+ assert(w->width);
+ assert(w->height);
+ assert(w->x >= 0);
+ assert(w->y >= 0);
+ assert(w->x + w->width <= uih->image->width);
+ assert(w->y + w->height <= uih->image->height);
+ if (w->savedline != -1) {
+ savedline = w->savedline;
+ savedpos = w->savedpos;
+ for (i = w->y; i < w->y + w->height; i++) {
+ unsigned char *data =
+ uih->image->currlines[i] + xskip;
+ assert(savedline < uih->image->height);
+ assert(savedline >= 0);
+ assert(savedpos >= 0 && savedpos <= destwidth);
+ if (width + savedpos > destwidth) {
+ int width1;
+ memcpy(data,
+ uih->image->oldlines[savedline] +
+ savedpos, destwidth - savedpos);
+ savedline++;
+ width1 = width - destwidth + savedpos;
+ memcpy(data + (destwidth - savedpos),
+ uih->image->oldlines[savedline],
+ width1);
+ savedpos = width1;
+ } else
+ memcpy(data,
+ uih->image->oldlines[savedline] +
+ savedpos, width), savedpos += width;
+ }
+ w->savedline = -1;
+ } else {
+ assert(w->saveddata);
+ for (i = w->y; i < w->y + w->height; i++) {
+ unsigned char *data =
+ uih->image->currlines[i] + xskip;
+ memcpy(data, w->saveddata + (i - w->y) * width,
+ width);
+ }
+ free(w->saveddata);
+ w->saveddata = NULL;
+ }
+ }
+ }
+ w = w->next;
+ }
+}
+
+void uih_drawwindows(struct uih_context *uih)
+{
+ struct uih_window *w = uih->wtop;
+ struct image *img = uih->image;
+ int size = 0;
+ int nocopy = 0;
+ int savedline = 0;
+ int savedpos = 0;
+ int destwidth = uih->image->width * uih->image->bytesperpixel;
+ if (!uih->image->bytesperpixel) {
+ destwidth = (w->x + uih->image->width + 7) / 8;
+ }
+ if (uih->wdisplayed)
+ return;
+ uih->wdisplayed = 1;
+ while (w) {
+ if (w->getpos != NULL) {
+ int test = w->x == -65536;
+ w->getpos(uih, &w->x, &w->y, &w->width, &w->height, w->data);
+ if (w->x < 0)
+ w->width -= w->x, w->x = 0;
+ if (w->y < 0)
+ w->height -= w->y, w->y = 0;
+ if (w->x > img->width)
+ w->width = 0, w->height = 0, w->x = 0;
+ if (w->y > img->height)
+ w->width = 0, w->height = 0, w->y = 0;
+ if (w->x + w->width > img->width)
+ w->width = img->width - w->x;
+ if (w->y + w->height > img->height)
+ w->height = img->height - w->y;
+ if (w->width < 0)
+ w->width = 0;
+ if (w->height < 0)
+ w->height = 0;
+ if (test) {
+ struct uih_window *w1 = uih->wtop;
+ while (w1) {
+ if (w != w1 && (w1->flags & DRAWBORDER) &&
+ ((((w1->x > w->x + 5
+ && w1->x + 5 < w->x + w->width)
+ || (w->x > w1->x + 5
+ && w->x + 5 < w1->x + w1->width))
+ &&
+ ((w1->y > w->y + 5
+ && w1->y + 5 < w->y + w->height)
+ || (w->y > w1->y + 5
+ && w->y + 5 < w1->y + w1->height)))
+ ||
+ (((w1->x + w1->width > w->x + 5
+ && w1->x + w1->width + 5 < w->x + w->width)
+ || (w->x + w->width > w1->x + 5
+ && w->x + w->width + 5 < w1->x + w1->width))
+ &&
+ ((w1->y + w1->height > w->y + 5
+ && w1->y + w1->height + 5 < w->y + w->height)
+ || (w->y + w->height > w1->y + 5
+ && w->y + w->height + 5 <
+ w1->y + w1->height))))) {
+ w->flags &= ~BORDER_TRANSPARENT;
+ break;
+ }
+ w1 = w1->next;
+ }
+ }
+ size += w->width * w->height;
+ if (w->x == 0 && w->y == 0 && w->width == img->width
+ && w->height == img->height)
+ nocopy = 1;
+ assert(w->width >= 0);
+ assert(w->height >= 0);
+ assert(w->x >= 0);
+ assert(w->y >= 0);
+ assert(w->x + w->width <= uih->image->width);
+ assert(w->y + w->height <= uih->image->height);
+ }
+ w = w->next;
+ }
+ if (size > img->width * img->height / 2) {
+ int i;
+ int width = img->width * img->bytesperpixel;
+ if (!width)
+ width = (img->width + 7) / 8;
+ uih->wflipped = 1;
+ if (!nocopy)
+ for (i = 0; i < img->height; i++)
+ memcpy(img->oldlines[i], img->currlines[i], width);
+ uih->image->flip(uih->image);
+ } else {
+ int savedminx = -1;
+ int savedmaxx = -1;
+ int savedminy = -1;
+ int savedmaxy = -1;
+ uih->wflipped = 0;
+ w = uih->wtop;
+ while (w) {
+ int i;
+ assert(w->saveddata == NULL);
+ if (w->getpos == NULL) {
+ if ((w->x < savedminx || w->y < savedminy
+ || w->x + w->width > savedmaxx
+ || w->x + w->height > savedmaxy
+ || w->x + w->width < savedminx
+ || w->y + w->height < savedminy || w->x > savedmaxx
+ || w->y > savedmaxy)) {
+ w->saveddata =
+ xsaveline(uih->image, w->x, w->y, w->width + w->x,
+ w->height + w->y);
+ }
+ } else {
+ assert(w->savedline == -1);
+ if (w->width && w->height
+ && (w->x < savedminx || w->y < savedminy
+ || w->x + w->width > savedmaxx
+ || w->y + w->height > savedmaxy)) {
+ int xskip = w->x * uih->image->bytesperpixel;
+ int width = w->width * uih->image->bytesperpixel;
+ savedminx = w->x;
+ savedminy = w->y;
+ savedmaxx = w->x + w->width;
+ savedmaxy = w->y + w->height;
+ if (!uih->image->bytesperpixel) {
+ xskip = w->x / 8;
+ width = (w->x + w->width + 7) / 8 - xskip;
+ }
+ if (uih->image->flags & PROTECTBUFFERS || 1) {
+ w->saveddata =
+ (char *) malloc(width * w->height + 1);
+ if (w->saveddata != NULL)
+ for (i = w->y; i < w->y + w->height; i++) {
+ unsigned char *data =
+ img->currlines[i] + xskip;
+ memcpy(w->saveddata + (i - w->y) * width,
+ data, width);
+ }
+
+ } else {
+ w->savedline = savedline;
+ w->savedpos = savedpos;
+ for (i = w->y; i < w->y + w->height; i++) {
+ unsigned char *data =
+ img->currlines[i] + xskip;
+ if (width + savedpos > destwidth) {
+ int width1;
+ memcpy(uih->image->oldlines[savedline] +
+ savedpos, data,
+ destwidth - savedpos);
+ savedline++;
+ width1 = width - destwidth + savedpos;
+ memcpy(uih->image->oldlines[savedline],
+ data + (destwidth - savedpos),
+ width1);
+ savedpos = width1;
+ } else
+ memcpy(uih->image->oldlines[savedline] +
+ savedpos, data, width), savedpos +=
+ width;
+ }
+ }
+ }
+ }
+ w = w->next;
+ }
+ }
+ w = uih->wtop;
+ while (w) {
+ if (w->getpos == NULL) {
+// This code unfortunately won't work for the Julia show, so
+// deactivated:
+#if 0
+ int lw = 0, lwi = 0, lwj = 0;
+ if (uih->image->width > 800 && uih->image->height > 600)
+ lw = 3;
+
+ for (; lwi <= lw; ++lwi)
+ for (; lwj <= lw; ++lwj)
+#endif
+#define lwi 0
+#define lwj 0
+ xline(uih->image, w->x + lwi, w->y + lwj,
+ w->width + w->x + lwi, w->height + w->y + lwj,
+ w->savedline);
+ } else if (w->width && w->height) {
+ if (w->flags & DRAWBORDER)
+ uih_drawborder(uih, w->x, w->y, w->width, w->height,
+ (BORDER_TRANSPARENT) & w->flags);
+ w->draw(uih, w->data);
+ }
+ w = w->next;
+ }
+}
diff --git a/src/ui/Makefile.in b/src/ui/Makefile.in
new file mode 100644
index 0000000..0db3230
--- /dev/null
+++ b/src/ui/Makefile.in
@@ -0,0 +1,51 @@
+CC = @CC@
+CFLAGS = @CFLAGS@
+LIBS = @LIBS@ -lm
+LFLAGS = @LDFLAGS@
+AR = @AR@
+RANLIB = @RANLIB@
+
+SRCS = \
+ drivers.c \
+ ui.c \
+ uihelp.c \
+ param.c \
+ fparams.c \
+ filesel.c \
+ uimenu.c \
+ pipecmd.c \
+ dialog.c
+
+OBJS = $(SRCS:.c=.o)
+
+TLIB = ../lib/libui.a
+
+
+all: $(TLIB)
+
+$(TLIB):$(OBJS)
+ rm -f $@
+ $(AR) rc $@ $(OBJS)
+ $(RANLIB) $@
+
+keywords.c: keywords.gperf
+ gperf -t -p -D -C -a keywords.gperf > keywords.c
+
+clean:
+ rm -f $(TLIB)
+ rm -f *.[oas]
+ rm -f *~
+ rm -f core
+
+distclean:clean
+ rm Makefile
+
+#dep:
+# rm -f .depend
+# make .depend
+#
+#.depend:
+# echo '# Program dependencies' >.depend
+# gcc -I svgalib $(DEFINES) -MM $(patsubst %.o,%.c,$(OBJS)) >>.depend
+#
+#include .depend
diff --git a/src/ui/dialog.c b/src/ui/dialog.c
new file mode 100644
index 0000000..d5c6aae
--- /dev/null
+++ b/src/ui/dialog.c
@@ -0,0 +1,1521 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#undef _EFENCE_
+#include <config.h>
+#ifdef _plan9_
+#include <u.h>
+#include <libc.h>
+#include <ctype.h>
+#else
+#include <aconfig.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+#ifndef _MAC
+#include <sys/stat.h>
+#endif
+#endif
+#include <fconfig.h>
+#ifndef _plan9_
+#include <assert.h>
+#endif
+#include <filter.h>
+#include <fractal.h>
+#include <ui_helper.h>
+#include <ui.h>
+#include <xmenu.h>
+#include <grlib.h>
+#include "uiint.h"
+#include <xldio.h>
+#include <misc-f.h>
+
+#ifdef HAVE_GETTEXT
+#include <libintl.h>
+#else
+#define gettext(STRING) STRING
+#endif
+
+struct dialogitem;
+struct dialogtype {
+ void (*build) (struct dialogitem * item, CONST menudialog * entry);
+ int (*key) (struct dialogitem * item, int key);
+ void (*mouse) (struct dialogitem * item, int x, int y, int buttons,
+ int flags);
+ void (*destroy) (struct dialogitem * item, dialogparam * param);
+ void (*draw) (struct dialogitem * item);
+ void (*unselect) (struct dialogitem * item);
+};
+struct dialogitem {
+ int y;
+ int width, width1, height;
+ CONST menudialog *dialog;
+ void *data;
+ CONST struct dialogtype *type;
+};
+static struct opendialog {
+ int x, y, width, height;
+ int half;
+ int nitems;
+ CONST menudialog *dialog;
+ int mousereleased;
+ int mousegrab;
+ CONST menuitem *item;
+ int current;
+ struct dialogitem *items;
+ struct uih_window *window;
+} dialog;
+
+static dialogparam *qparam;
+static CONST menuitem *qitem;
+
+int dialogvisible;
+
+int yesnodialogvisible;
+static struct yesnodialog {
+ int width;
+ int questionwidth;
+ int mousereleased;
+ char *question;
+ void (*handler) (int yes);
+ int selected;
+ int pressed;
+ struct uih_window *window;
+} yesnodialog;
+
+// These 3 definitions are no longer used:
+static CONST char *CONST oktext = "OK";
+static CONST char *CONST canceltext = "Cancel";
+static CONST char *CONST helptext = "Help";
+
+static int okwidth;
+static int cancelwidth;
+#define SELECTED(item) ((item-dialog.items)==dialog.current)
+static void NEXT(void)
+{
+ dialog.items[dialog.current].type->unselect(dialog.items +
+ dialog.current);
+ dialog.current = (dialog.current + 1) % dialog.nitems;
+ uih->display = 1;
+}
+
+static void PREV(void)
+{
+ dialog.items[dialog.current].type->unselect(dialog.items +
+ dialog.current);
+ dialog.current =
+ dialog.current ? (dialog.current - 1) : dialog.nitems - 1;
+ uih->display = 1;
+}
+
+struct okdata {
+ int pressed;
+ int selected;
+};
+
+CONST char *CONST yestext = "Yes";
+CONST char *CONST notext = "No";
+#define YESNOX ((uih->image->width-yesnodialog.width)/2)
+#define YESNOHEIGHT (2*BUTTONHEIGHT+2*BORDERHEIGHT)
+#define YESNOY ((uih->image->height-YESNOHEIGHT)/2)
+void
+ui_drawbutton(CONST char *text, int pressed, int selected, int x1, int x2,
+ int y)
+{
+ int width = xtextwidth(uih->font, text);
+ /*printf("%s %i %i\n",text,pressed,selected); */
+ if (uih->palette->type & BITMAPS) {
+ uih_drawborder(uih, x1, y, x2 - x1, BUTTONHEIGHT,
+ (pressed != 0
+ || selected != 0) * BORDER_PRESSED | BORDER_LIGHT);
+ xprint(uih->image, uih->font, (x1 + x2 - width) / 2 + pressed,
+ y + BORDERHEIGHT + pressed, text, selected
+ || pressed ? BGCOLOR(uih) : FGCOLOR(uih), BGCOLOR(uih),
+ TEXT_PRESSED);
+ } else {
+ uih_drawborder(uih, x1, y, x2 - x1, BUTTONHEIGHT,
+ (pressed != 0) * BORDER_PRESSED | BORDER_LIGHT);
+ xprint(uih->image, uih->font, (x1 + x2 - width) / 2 + pressed,
+ y + BORDERHEIGHT + pressed, text,
+ selected ? SELCOLOR(uih) : FGCOLOR(uih), BGCOLOR(uih),
+ /*TEXT_PRESSED */ 0);
+ }
+}
+
+static void
+ui_yesnopos(struct uih_context *c, int *x, int *y, int *w, int *h,
+ void *data)
+{
+#ifdef _plan9_
+#define filevisible 0
+#endif
+ if (filevisible || helpvisible) {
+ *x = *y = *w = *h = 0;
+ return;
+ }
+ *w = yesnodialog.width;
+ *h = YESNOHEIGHT;
+ *x = YESNOX;
+ *y = YESNOY;
+}
+
+static void ui_drawyesno(struct uih_context *c, void *data)
+{
+ xprint(uih->image, uih->font,
+ YESNOX + (yesnodialog.width - yesnodialog.questionwidth) / 2,
+ YESNOY + BORDERHEIGHT, yesnodialog.question,
+ FGCOLOR(uih), BGCOLOR(uih), 0);
+ ui_drawbutton(yestext, yesnodialog.pressed == 0,
+ yesnodialog.selected == 0, YESNOX + BORDERWIDTH + 1,
+ YESNOX + (yesnodialog.width) / 2 - 1,
+ YESNOY + BUTTONHEIGHT + BORDERHEIGHT);
+ ui_drawbutton(notext, yesnodialog.pressed == 1,
+ yesnodialog.selected == 1,
+ YESNOX + (yesnodialog.width) / 2 + 1,
+ YESNOX + yesnodialog.width - BORDERWIDTH - 1,
+ YESNOY + BUTTONHEIGHT + BORDERHEIGHT);
+}
+
+static void ui_closeyesno(int success)
+{
+ if (!yesnodialogvisible)
+ return;
+ free(yesnodialog.question);
+ yesnodialog.handler(success);
+ yesnodialogvisible = 0;
+ uih_removew(uih, yesnodialog.window);
+ uih->display = 1;
+}
+
+void ui_buildyesno(CONST char *question, void (*handler) (int yes))
+{
+ if (yesnodialogvisible)
+ ui_closeyesno(0);
+ yesnodialogvisible = 1;
+ yesnodialog.questionwidth = xtextwidth(uih->font, question);
+ yesnodialog.question = mystrdup(question);
+ yesnodialog.mousereleased = 0;
+ yesnodialog.width =
+ xtextwidth(uih->font, yestext) + xtextwidth(uih->font,
+ notext) +
+ 8 * BORDERWIDTH + 2;
+ if (yesnodialog.width < yesnodialog.questionwidth)
+ yesnodialog.width = yesnodialog.questionwidth;
+ yesnodialog.width += 2 * BORDERWIDTH;
+ yesnodialog.handler = handler;
+ yesnodialog.selected = 0;
+ yesnodialog.pressed = -1;
+ yesnodialog.window =
+ uih_registerw(uih, ui_yesnopos, ui_drawyesno, NULL, DRAWBORDER);
+ uih->display = 1;
+}
+
+static int ui_keyyesno(int key)
+{
+ if (!yesnodialogvisible)
+ return 0;
+ switch (key) {
+ case UIKEY_LEFT:
+ yesnodialog.selected ^= 1;
+ uih->display = 1;
+ return 1;
+ case UIKEY_UP:
+ return 1;
+ case UIKEY_RIGHT:
+ case UIKEY_TAB:
+ yesnodialog.selected ^= 1;
+ uih->display = 1;
+ return 1;
+ case UIKEY_DOWN:
+ return 1;
+ case 13:
+ case '\n':
+ ui_closeyesno(!yesnodialog.selected);
+ return 1;
+ case UIKEY_ESC:
+ ui_closeyesno(0);
+ return 1;
+ }
+ return 1;
+}
+
+static int ui_mouseyesno(int x, int y, int buttons, int flags)
+{
+ int mouseat = 0;
+ if (!yesnodialogvisible)
+ return 0;
+ if (!yesnodialog.mousereleased && (flags & MOUSE_RELEASE)) {
+ yesnodialog.mousereleased = 1;
+ return 1;
+ }
+ if (!yesnodialog.mousereleased && (flags & MOUSE_DRAG)) {
+ return 1;
+ }
+ yesnodialog.mousereleased = 1;
+ if (x < YESNOX || y < YESNOY || x > YESNOX + yesnodialog.width
+ || y > YESNOY + YESNOHEIGHT) {
+ if (flags & MOUSE_PRESS) {
+ ui_closeyesno(0);
+ } else {
+ if (yesnodialog.pressed != -1)
+ uih->display = 1;
+ yesnodialog.pressed = -1;
+ }
+ return 1;
+ }
+ if (x > YESNOX + yesnodialog.width / 2)
+ mouseat = 1;
+ if (flags & MOUSE_DRAG) {
+ if (yesnodialog.pressed != mouseat)
+ uih->display = 1;
+ if (yesnodialog.selected != mouseat)
+ uih->display = 1;
+ yesnodialog.selected = mouseat;
+ yesnodialog.pressed = mouseat;
+ } else {
+ if ((flags & MOUSE_MOVE) && yesnodialog.selected != mouseat)
+ uih->display = 1, yesnodialog.selected = mouseat;
+ if (yesnodialog.pressed != -1)
+ uih->display = 1;
+ yesnodialog.pressed = -1;
+ }
+ if (flags & MOUSE_RELEASE) {
+ ui_closeyesno(!mouseat);
+ }
+ return 1;
+}
+
+static void ui_buildok(struct dialogitem *item, CONST menudialog * entry)
+{
+ struct okdata *ok;
+ item->height = BUTTONHEIGHT;
+ okwidth = xtextwidth(uih->font, gettext("OK"));
+ cancelwidth = xtextwidth(uih->font, gettext("Cancel"));
+ item->width = okwidth + 2 * BORDERWIDTH + 2;
+ item->width1 = cancelwidth + 2 * BORDERWIDTH + 2;
+ if (item->width < item->width1)
+ item->width = item->width1;
+ if (item->width > item->width1)
+ item->width1 = item->width;
+ item->data = ok = (struct okdata *) malloc(sizeof(struct okdata));
+ ok->pressed = -1;
+ ok->selected = 0;
+}
+
+static void ui_destroyok(struct dialogitem *item, dialogparam * param)
+{
+ free(item->data);
+}
+
+static int ui_keyok(struct dialogitem *item, int key)
+{
+ struct okdata *ok = (struct okdata *) item->data;
+ switch (key) {
+ case UIKEY_LEFT:
+ if (ok->selected >= 1) {
+ ok->selected--;
+ uih->display = 1;
+ return 1;
+ }
+ case UIKEY_UP:
+ PREV();
+ return 1;
+ case UIKEY_RIGHT:
+ case UIKEY_TAB:
+ if (ok->selected < 2) {
+ ok->selected++;
+ uih->display = 1;
+ return 1;
+ }
+ case UIKEY_DOWN:
+ NEXT();
+ return 1;
+ case 13:
+ case '\n':
+ if (ok->selected <= 1)
+ ui_closedialog(!ok->selected);
+ else
+ ui_help(dialog.item->shortname);
+ return 1;
+ }
+ return 0;
+}
+
+static void
+ui_mouseok(struct dialogitem *item, int x, int y, int buttons, int flags)
+{
+ struct okdata *ok = (struct okdata *) item->data;
+ int mouseat = 0;
+ if (x > dialog.x + dialog.width / 3)
+ mouseat = 1;
+ if (x > dialog.x + 2 * dialog.width / 3)
+ mouseat = 2;
+ if (flags & MOUSE_DRAG) {
+ if (ok->pressed != mouseat)
+ uih->display = 1;
+ if (ok->selected != mouseat)
+ uih->display = 1;
+ ok->selected = mouseat;
+ ok->pressed = mouseat;
+ } else {
+ if ((flags & MOUSE_MOVE) && ok->selected != mouseat)
+ uih->display = 1, ok->selected = mouseat;
+ if (ok->pressed != -1)
+ uih->display = 1;
+ ok->pressed = -1;
+ }
+ if (flags & MOUSE_RELEASE) {
+ if (mouseat < 2)
+ ui_closedialog(!mouseat);
+ else
+ ui_help(dialog.item->shortname);
+ }
+}
+
+static void ui_drawok(struct dialogitem *item)
+{
+ struct okdata *ok = (struct okdata *) item->data;
+ ui_drawbutton(gettext("OK"), ok->pressed == 0, SELECTED(item)
+ && ok->selected == 0, dialog.x + BORDERWIDTH + 1,
+ dialog.x + (dialog.width) / 3 - 1, item->y);
+ ui_drawbutton(gettext("Cancel"), ok->pressed == 1, SELECTED(item)
+ && ok->selected == 1, dialog.x + (dialog.width) / 3 + 1,
+ dialog.x + 2 * dialog.width / 3 - BORDERWIDTH, item->y);
+ ui_drawbutton(gettext("Help"), ok->pressed == 2, SELECTED(item)
+ && ok->selected == 2, dialog.x + 2 * (dialog.width) / 3,
+ dialog.x + dialog.width - BORDERWIDTH - 1, item->y);
+}
+
+static void ui_unselectok(struct dialogitem *item)
+{
+ struct okdata *ok = (struct okdata *) item->data;
+ ok->pressed = -1;
+ ok->selected = 0;
+ uih->display = 1;
+}
+
+CONST static struct dialogtype okdialog = {
+ ui_buildok,
+ ui_keyok,
+ ui_mouseok,
+ ui_destroyok,
+ ui_drawok,
+ ui_unselectok
+};
+
+void ui_updatetext(struct ui_textdata *d)
+{
+ int again = 1;
+ int i;
+ int wi;
+ int len = (int) strlen(d->text);
+ if (d->start >= len)
+ d->start = 0;
+ if (d->cursor > len)
+ d->cursor = len;
+ if (d->cursor < d->start)
+ d->start = d->cursor;
+ do {
+ wi = 0;
+ for (i = 0; d->text[d->start + i]; i++) {
+ if (d->start + i == d->cursor)
+ d->cursorpos = wi;
+ wi += xtextcharw(uih->font, d->text[d->start + i]);
+ if (wi >= d->width) {
+ break;
+ }
+ }
+ if (d->start + i == d->cursor && wi < d->width)
+ d->cursorpos = wi;
+ if (d->start + i < d->cursor)
+ d->start++;
+ else
+ again = 0;
+ }
+ while (again);
+ d->ndisplayed = i;
+ while (again);
+}
+
+struct ui_textdata *ui_opentext(int x, int y, int width, CONST char *def)
+{
+ struct ui_textdata *d = (struct ui_textdata *) malloc(sizeof(*d));
+ char *text;
+ int size = 100;
+ if ((int) strlen(def) > size)
+ size = (int) strlen(def) * 2;
+ d->x = x;
+ d->y = y;
+ d->width = width;
+ text = (char *) malloc(size);
+ strcpy(text, def);
+ d->text = text;
+ d->cursor = 0;
+ d->cursorpos = 0;
+ d->start = 0;
+ d->ndisplayed = 0;
+ d->clear = 1;
+ d->size = size;
+ ui_updatetext(d);
+ return (d);
+}
+
+void ui_drawtext(struct ui_textdata *d, int active)
+{
+ char *c = (char *) malloc(d->ndisplayed + 2);
+ strncpy(c, d->text + d->start, d->ndisplayed);
+ c[d->ndisplayed] = 0;
+ xprint(uih->image, uih->font, d->x, d->y, c,
+ (uih->palette->type & BITMAPS) ? BGCOLOR(uih) : ((active
+ && d->clear) ?
+ SELCOLOR(uih) :
+ FGCOLOR(uih)),
+ BGCOLOR(uih),
+ (uih->palette->type & BITMAPS) ? TEXT_PRESSED : 0);
+ if (active) {
+ xdrawcursor(uih->image, d->x + d->cursorpos, d->y,
+ (uih->palette->
+ type & BITMAPS) ? BGCOLOR(uih) : SELCOLOR(uih),
+ xtextheight(uih->font));
+ }
+ free(c);
+}
+
+void ui_textmouse(struct ui_textdata *d, int x, int y)
+{
+ if (y > d->y && y < d->y + xtextheight(uih->font) && x > d->x) {
+ int w = 0;
+ int i;
+ int xp = d->x;
+ for (i = 0; i < d->ndisplayed + 1 && xp - w / 2 < x; i++) {
+ w = xtextcharw(uih->font, d->text[i + d->start]);
+ xp += w;
+ }
+ d->cursor = i + d->start - 1;
+ if (d->cursor < 0)
+ d->cursor = 0;
+ d->clear = 0;
+ ui_updatetext(d);
+ uih->display = 1;
+ }
+}
+
+void ui_closetext(struct ui_textdata *d)
+{
+ free(d->text);
+ free(d);
+}
+
+int ui_textkey(struct ui_textdata *d, int key)
+{
+ switch (key) {
+ case UIKEY_LEFT:
+ if (d->clear)
+ d->clear = 0;
+ if (d->cursor)
+ d->cursor--;
+ else
+ return 0;
+ ui_updatetext(d);
+ uih->display = 1;
+ return 1;
+ case UIKEY_RIGHT:
+ if (d->clear)
+ d->clear = 0;
+ if (d->cursor < (int) strlen(d->text))
+ d->cursor++;
+ else
+ return 0;
+ ui_updatetext(d);
+ uih->display = 1;
+ return 1;
+ case UIKEY_HOME:
+ if (d->clear)
+ d->clear = 0;
+ d->cursor = 0;
+ ui_updatetext(d);
+ uih->display = 1;
+ return 1;
+ case UIKEY_END:
+ if (d->clear)
+ d->clear = 0;
+ d->cursor = (int) strlen(d->text);
+ ui_updatetext(d);
+ uih->display = 1;
+ return 1;
+ case UIKEY_BACKSPACE:
+ if (d->clear)
+ d->text[0] = 0, d->clear = 0;
+ else if (d->cursor) {
+ int len, i;
+ len = (int) strlen(d->text);
+ for (i = d->cursor; i <= len; i++) {
+ d->text[i - 1] = d->text[i];
+ }
+ d->cursor--;
+ }
+ ui_updatetext(d);
+ uih->display = 1;
+ return 1;
+ }
+ if (isprint(key)) {
+ int i;
+ int len;
+ if (d->clear)
+ d->text[0] = 0, d->clear = 0;
+ if ((len = (int) strlen(d->text)) > d->size - 2) {
+ d->text = (char *) realloc(d->text, d->size * 2);
+ }
+ for (i = len; i >= d->cursor; i--) {
+ d->text[i + 1] = d->text[i];
+ }
+ d->text[d->cursor] = key;
+ d->cursor++;
+ ui_updatetext(d);
+ uih->display = 1;
+ return 1;
+ }
+ return 0;
+}
+
+static void
+ui_buildstring(struct dialogitem *item, CONST menudialog * entry)
+{
+ item->height = BUTTONHEIGHT;
+ item->width = xtextwidth(uih->font, item->dialog->question);
+ item->width1 = xtextcharw(uih->font, 'w') * 20;
+ item->data = ui_opentext(0, 0, 2043, item->dialog->defstr);
+}
+
+static void ui_destroystring(struct dialogitem *item, dialogparam * param)
+{
+ struct ui_textdata *text = (struct ui_textdata *) item->data;
+ param->dstring = mystrdup(text->text);
+ ui_closetext(text);
+}
+
+static void ui_drawquestion(struct dialogitem *item)
+{
+ if (uih->palette->type & BITMAPS) {
+ if (SELECTED(item))
+ xrectangle(uih->image, dialog.x + BORDERWIDTH, item->y,
+ dialog.half - dialog.x - 2 * BORDERWIDTH,
+ BUTTONHEIGHT, FGCOLOR(uih));
+ xprint(uih->image, uih->font, dialog.half - item->width,
+ item->y + BORDERHEIGHT, item->dialog->question,
+ SELECTED(item) ? BGCOLOR(uih) : FGCOLOR(uih),
+ BGCOLOR(uih), TEXT_PRESSED);
+ } else {
+ xprint(uih->image, uih->font, dialog.half - item->width,
+ item->y + BORDERHEIGHT, item->dialog->question,
+ SELECTED(item) ? SELCOLOR(uih) : FGCOLOR(uih), BGCOLOR(uih),
+ 0);
+ }
+}
+
+static void ui_drawstring(struct dialogitem *item)
+{
+ struct ui_textdata *text = (struct ui_textdata *) item->data;
+ if (text->width == 2043)
+ text->x = dialog.half + BORDERWIDTH, text->width =
+ dialog.width + dialog.x - dialog.half - 2 * BORDERWIDTH,
+ text->y = item->y + BORDERHEIGHT, ui_updatetext(text);
+ uih_drawborder(uih, dialog.half, item->y,
+ dialog.width - dialog.half + dialog.x - BORDERWIDTH,
+ BUTTONHEIGHT, BORDER_PRESSED | BORDER_LIGHT);
+ ui_drawtext(text, SELECTED(item));
+ ui_drawquestion(item);
+}
+
+static int ui_keystring(struct dialogitem *item, int key)
+{
+ struct ui_textdata *text = (struct ui_textdata *) item->data;
+ return (ui_textkey(text, key));
+}
+
+static void
+ui_mousestring(struct dialogitem *item, int x, int y, int buttons,
+ int flags)
+{
+ struct ui_textdata *text = (struct ui_textdata *) item->data;
+ if (flags & MOUSE_DRAG) {
+ ui_textmouse(text, x, y);
+ }
+}
+
+static void ui_unselectstring(struct dialogitem *item)
+{
+}
+
+CONST static struct dialogtype stringdialog = {
+ ui_buildstring,
+ ui_keystring,
+ ui_mousestring,
+ ui_destroystring,
+ ui_drawstring,
+ ui_unselectstring
+};
+
+static void ui_buildint(struct dialogitem *item, CONST menudialog * entry)
+{
+ char s[50];
+ item->height = BUTTONHEIGHT;
+ item->width = xtextwidth(uih->font, item->dialog->question);
+ item->width1 = xtextcharw(uih->font, 'w') * 5;
+ sprintf(s, "%i", item->dialog->defint);
+ item->data = ui_opentext(0, 0, 2043, s);
+}
+
+static void ui_destroyint(struct dialogitem *item, dialogparam * param)
+{
+ struct ui_textdata *text = (struct ui_textdata *) item->data;
+ param->dint = (int) atol(text->text);
+ ui_closetext(text);
+}
+
+CONST static struct dialogtype intdialog = {
+ ui_buildint,
+ ui_keystring,
+ ui_mousestring,
+ ui_destroyint,
+ ui_drawstring,
+ ui_unselectstring
+};
+
+static CONST char *ui_getextension(CONST char *ch)
+{
+ int i = 0;
+ while (ch[i]) {
+ if (ch[i] == '*')
+ return (ch + i + 1);
+ i++;
+ }
+ return ch + i;
+}
+
+number_t ui_getfloat(CONST char *c)
+{
+#ifdef HAVE_LONG_DOUBLE
+ long double param;
+#else
+ double param;
+#endif
+#ifdef HAVE_LONG_DOUBLE
+#ifndef USE_ATOLD
+#ifdef USE_XLDIO
+ param = x_strtold(c, NULL);
+ if (0)
+#else
+ if (sscanf(c, "%LG", &param) == 0)
+#endif
+#else
+ param = _atold(c);
+ if (0)
+#endif
+ {
+#else
+ if (sscanf(c, "%lG", &param) == 0) {
+#endif
+ return 0;
+ }
+ return (param);
+}
+
+#define BROWSEWIDTH /*(2*BORDERWIDTH+xtextcharw(uih->font,'B'))*/BUTTONHEIGHT
+struct ui_filedata {
+ struct ui_textdata *text;
+ int active;
+ int pressed;
+};
+
+static struct dialogitem *curritem;
+static void filecallback(CONST char *name, int succ)
+{
+ struct ui_filedata *text = (struct ui_filedata *) curritem->data;
+ if (succ) {
+ ui_closetext(text->text);
+ uih->display = 1;
+ text->text = ui_opentext(0, 0, 2043, name);
+ dialog.mousereleased = 0;
+ }
+ if (dialog.nitems == 2)
+ ui_closedialog(succ);
+}
+
+static void ui_buildfile(struct dialogitem *item, CONST menudialog * entry)
+{
+ char str[256];
+ struct ui_filedata *data =
+ (struct ui_filedata *) malloc(sizeof(*data));
+ int i = 0;
+ item->height = BUTTONHEIGHT;
+ item->width = xtextwidth(uih->font, item->dialog->question);
+ item->width1 = xtextcharw(uih->font, 'w') * 20;
+ while (item->dialog->defstr[i] != '*' && item->dialog->defstr[i] != 0)
+ str[i] = item->dialog->defstr[i], i++;
+ str[i] = 0;
+ item->data = data;
+ if (entry->type == DIALOG_OFILE)
+ data->text =
+ ui_opentext(0, 0, 2043,
+ ui_getfile(str,
+ ui_getextension(item->dialog->defstr)));
+ else
+ data->text = ui_opentext(0, 0, 2043, item->dialog->defstr);
+ data->active = 0;
+ data->pressed = 0;
+#ifndef _plan9_
+ if (dialog.nitems == 2) {
+ curritem = item;
+ ui_buildfilesel(data->text->text, "", filecallback);
+ }
+#endif
+}
+
+static void ui_destroyfile(struct dialogitem *item, dialogparam * param)
+{
+ struct ui_filedata *text = (struct ui_filedata *) item->data;
+#ifndef _plan9_
+ if (filevisible)
+ ui_closefilesel(0);
+#endif
+ param->dpath = mystrdup(text->text->text);
+ ui_closetext(text->text);
+ free(text);
+}
+
+static void ui_drawfile(struct dialogitem *item)
+{
+ struct ui_filedata *data = (struct ui_filedata *) item->data;
+ int wholesize =
+ dialog.width + dialog.x - dialog.half - 2 * BORDERWIDTH;
+ if (data->text->width == 2043) {
+ data->text->x = dialog.half + BORDERWIDTH,
+ data->text->width = wholesize - BROWSEWIDTH - 2 * BORDERWIDTH,
+ data->text->y = item->y + BORDERHEIGHT;
+ ui_updatetext(data->text);
+ }
+ uih_drawborder(uih, dialog.half, item->y, wholesize - BROWSEWIDTH,
+ BUTTONHEIGHT, BORDER_PRESSED | BORDER_LIGHT);
+ ui_drawtext(data->text, SELECTED(item) && !data->active);
+ xprint(uih->image, uih->font, dialog.half - item->width,
+ item->y + BORDERHEIGHT, item->dialog->question,
+ SELECTED(item) ? SELCOLOR(uih) : FGCOLOR(uih), BGCOLOR(uih), 0);
+ ui_drawquestion(item);
+ ui_drawbutton("B", data->pressed && SELECTED(item), SELECTED(item)
+ && data->active,
+ dialog.x + dialog.width - BROWSEWIDTH - BORDERWIDTH,
+ dialog.x + dialog.width - BORDERWIDTH, item->y);
+}
+
+static int ui_keyfile(struct dialogitem *item, int key)
+{
+ struct ui_filedata *text = (struct ui_filedata *) item->data;
+ int i = 0;
+ if (!text->active)
+ i = ui_textkey(text->text, key);
+ if (!i) {
+ if (key == '\t' || key == UIKEY_RIGHT) {
+ text->active++;
+ if (text->active > 1) {
+ text->active = 0;
+ return 0;
+ }
+ uih->display = 1;
+ return 1;
+ }
+ if (key == UIKEY_LEFT) {
+ text->active--;
+ if (text->active < 0) {
+ text->active = 1;
+ return 0;
+ }
+ return 1;
+ }
+#ifndef _plan9_
+ if ((key == 13 || key == '\n') && text->active) {
+ curritem = item;
+ ui_buildfilesel(text->text->text, "", filecallback);
+ return 1;
+ }
+#endif
+ }
+ return (i);
+}
+
+static void
+ui_mousefile(struct dialogitem *item, int x, int y, int buttons, int flags)
+{
+ struct ui_filedata *text = (struct ui_filedata *) item->data;
+ int i;
+ if (flags & MOUSE_MOVE) {
+ if (x < dialog.x + dialog.width - BORDERWIDTH - BROWSEWIDTH)
+ i = 0;
+ else
+ i = 1;
+ if (text->active != i)
+ text->active = i, uih->display = 1;
+ }
+#ifndef _plan9_
+ if ((flags & MOUSE_RELEASE) && text->pressed) {
+ text->pressed = 0;
+ uih->display = 1;
+ curritem = item;
+ ui_buildfilesel(text->text->text, "", filecallback);
+ return;
+ }
+#endif
+ if (flags & MOUSE_DRAG) {
+ if (x < dialog.x + dialog.width - BORDERWIDTH - BROWSEWIDTH) {
+ text->active = 0, ui_textmouse(text->text, x, y);
+ if (text->pressed)
+ text->pressed = 0, uih->display = 1;
+ } else if (!text->pressed) {
+ text->pressed = 1;
+ uih->display = 1;
+ }
+ }
+}
+
+static void ui_unselectfile(struct dialogitem *item)
+{
+ struct ui_filedata *text = (struct ui_filedata *) item->data;
+ if (text->active)
+ text->active = 0, uih->display = 1;
+ if (text->pressed)
+ text->pressed = 0, uih->display = 1;
+}
+
+CONST static struct dialogtype filedialog = {
+ ui_buildfile,
+ ui_keyfile,
+ ui_mousefile,
+ ui_destroyfile,
+ ui_drawfile,
+ ui_unselectfile
+};
+
+static void
+ui_buildfloat(struct dialogitem *item, CONST menudialog * entry)
+{
+ char s[50];
+ item->height = BUTTONHEIGHT;
+ item->width = xtextwidth(uih->font, item->dialog->question);
+ item->width1 = xtextcharw(uih->font, 'w') * 10;
+ sprintf(s, "%g", (double) item->dialog->deffloat);
+ item->data = ui_opentext(0, 0, 2043, s);
+}
+
+static void ui_destroyfloat(struct dialogitem *item, dialogparam * param)
+{
+ struct ui_textdata *text = (struct ui_textdata *) item->data;
+ param->number = ui_getfloat(text->text);
+ ui_closetext(text);
+}
+
+CONST static struct dialogtype floatdialog = {
+ ui_buildfloat,
+ ui_keystring,
+ ui_mousestring,
+ ui_destroyfloat,
+ ui_drawstring,
+ ui_unselectstring
+};
+
+struct ui_coorddata {
+ struct ui_textdata *text[2];
+ int active;
+};
+static void
+ui_buildcoord(struct dialogitem *item, CONST menudialog * entry)
+{
+ char s[50];
+ struct ui_coorddata *data =
+ (struct ui_coorddata *) malloc(sizeof(*data));
+ item->height = BUTTONHEIGHT;
+ item->width = xtextwidth(uih->font, item->dialog->question);
+ item->width1 = xtextcharw(uih->font, 'w') * 20;
+ item->data = data;
+ data->active = 0;
+ sprintf(s, "%g", (double) item->dialog->deffloat);
+ data->text[0] = ui_opentext(0, 0, 2043, s);
+ sprintf(s, "%g", (double) item->dialog->deffloat2);
+ data->text[1] = ui_opentext(0, 0, 2043, s);
+}
+
+static void ui_destroycoord(struct dialogitem *item, dialogparam * param)
+{
+ struct ui_coorddata *data = (struct ui_coorddata *) item->data;
+ param->dcoord[0] = ui_getfloat(data->text[0]->text);
+ param->dcoord[1] = ui_getfloat(data->text[1]->text);
+ ui_closetext(data->text[0]);
+ ui_closetext(data->text[1]);
+ free(data);
+}
+
+#define SPACESIZE xtextwidth(uih->font,"+")
+#define ENDSIZE xtextwidth(uih->font,"i")
+static void ui_drawcoord(struct dialogitem *item)
+{
+ struct ui_coorddata *data = (struct ui_coorddata *) item->data;
+ int wholesize =
+ dialog.width + dialog.x - dialog.half - 2 * BORDERWIDTH - ENDSIZE;
+ int half = (wholesize - SPACESIZE) / 2;
+ if (data->text[0]->width == 2043) {
+ data->text[0]->x = dialog.half + BORDERWIDTH,
+ data->text[0]->width = half - BORDERWIDTH,
+ data->text[0]->y = item->y + BORDERHEIGHT;
+ data->text[1]->x = dialog.half + half + SPACESIZE + BORDERWIDTH,
+ data->text[1]->width = half - BORDERWIDTH,
+ data->text[1]->y = item->y + BORDERHEIGHT;
+ ui_updatetext(data->text[0]);
+ ui_updatetext(data->text[1]);
+ }
+ uih_drawborder(uih, dialog.half, item->y, half, BUTTONHEIGHT,
+ BORDER_PRESSED | BORDER_LIGHT);
+ uih_drawborder(uih, dialog.half + half + SPACESIZE, item->y, half,
+ BUTTONHEIGHT, BORDER_PRESSED | BORDER_LIGHT);
+ ui_drawtext(data->text[0], SELECTED(item) && !data->active);
+ ui_drawtext(data->text[1], SELECTED(item) && data->active);
+ xprint(uih->image, uih->font, dialog.half + half,
+ item->y + BORDERHEIGHT, "+", FGCOLOR(uih),
+ BGCOLOR(uih), 0);
+ xprint(uih->image, uih->font,
+ dialog.x + dialog.width - BORDERWIDTH - ENDSIZE,
+ item->y + BORDERHEIGHT, "i", FGCOLOR(uih),
+ BGCOLOR(uih), 0);
+ ui_drawquestion(item);
+}
+
+static int ui_keycoord(struct dialogitem *item, int key)
+{
+ struct ui_coorddata *text = (struct ui_coorddata *) item->data;
+ int i = ui_textkey(text->text[text->active], key);
+ if (!i) {
+ if (key == '\t' || key == UIKEY_RIGHT) {
+ text->active++;
+ if (text->active > 1) {
+ text->active = 0;
+ return 0;
+ }
+ uih->display = 1;
+ if (key == UIKEY_RIGHT) {
+ text->text[1]->cursor = 0;
+ ui_updatetext(text->text[1]);
+ uih->display = 1;
+ }
+ return 1;
+ }
+ if (key == UIKEY_LEFT) {
+ text->active--;
+ if (text->active < 0) {
+ text->active = 1;
+ return 0;
+ }
+ text->text[0]->cursor = (int) strlen(text->text[0]->text);
+ ui_updatetext(text->text[0]);
+ uih->display = 1;
+ return 1;
+ }
+ }
+ return (i);
+}
+
+static void
+ui_mousecoord(struct dialogitem *item, int x, int y, int buttons,
+ int flags)
+{
+ struct ui_coorddata *text = (struct ui_coorddata *) item->data;
+ int i;
+ if (flags & MOUSE_MOVE) {
+ if (x < text->text[1]->x)
+ i = 0;
+ else
+ i = 1;
+ if (text->active != i)
+ text->active = i, uih->display = 1;
+ }
+ if (flags & MOUSE_DRAG) {
+ if (x < text->text[1]->x)
+ text->active = 0, ui_textmouse(text->text[0], x, y);
+ else
+ text->active = 1, ui_textmouse(text->text[1], x, y);
+ }
+}
+
+static void ui_unselectcoord(struct dialogitem *item)
+{
+ struct ui_coorddata *text = (struct ui_coorddata *) item->data;
+ text->active = 0;
+}
+
+CONST static struct dialogtype coorddialog = {
+ ui_buildcoord,
+ ui_keycoord,
+ ui_mousecoord,
+ ui_destroycoord,
+ ui_drawcoord,
+ ui_unselectcoord
+};
+
+struct ui_choicedata {
+ CONST char **texts;
+ int selected;
+ int n;
+
+ struct uih_window *menu;
+ int x, y, width, height;
+ int active;
+};
+static void
+ui_choicemenupos(struct uih_context *uih, int *x, int *y, int *width,
+ int *height, void *data)
+{
+ struct ui_choicedata *choice = (struct ui_choicedata *) data;
+ if (filevisible || helpvisible) {
+ *x = *y = *width = *height = 0;
+ return;
+ }
+ *x = choice->x;
+ *y = choice->y;
+ *width = choice->width;
+ *height = choice->height;
+}
+
+static void ui_drawchoicemenu(uih_context * uih, void *data)
+{
+ struct ui_choicedata *choice = (struct ui_choicedata *) data;
+ int i;
+ for (i = 0; i < choice->n; i++) {
+ xprint(uih->image, uih->font, choice->x + BORDERWIDTH,
+ choice->y + BORDERHEIGHT + i * xtextheight(uih->font),
+ choice->texts[i],
+ i == choice->active ? SELCOLOR(uih) : FGCOLOR(uih),
+ BGCOLOR(uih), 0);
+ }
+}
+
+static void
+ui_buildchoicemenu(struct uih_context *uih, struct ui_choicedata *choice,
+ int x, int y, int width)
+{
+ if (choice->menu != NULL)
+ return;
+ choice->width = width + 2 * BORDERWIDTH;
+ choice->x = x;
+ choice->height = xtextheight(uih->font) * choice->n + 2 * BORDERHEIGHT;
+ choice->active = choice->selected;
+ choice->y = y - choice->active * xtextheight(uih->font);
+ dialog.mousegrab = 1;
+ if (choice->x + choice->width > uih->image->width)
+ choice->x = uih->image->width - choice->width;
+ if (choice->y + choice->height > uih->image->height)
+ choice->y = uih->image->height - choice->height;
+ if (choice->x < 0)
+ choice->x = 0;
+ if (choice->y < 0)
+ choice->y = 0;
+ choice->menu =
+ uih_registerw(uih, ui_choicemenupos, ui_drawchoicemenu, choice,
+ DRAWBORDER);
+ uih->display = 1;
+}
+
+static void
+ui_closechoicemenu(struct uih_context *uih, struct ui_choicedata *choice)
+{
+ if (choice->menu == NULL)
+ return;
+ uih_removew(uih, choice->menu);
+ choice->menu = NULL;
+ uih->display = 1;
+ dialog.mousegrab = 0;
+ dialog.mousereleased = 0;
+}
+
+static void
+ui_buildchoice(struct dialogitem *item, CONST menudialog * entry)
+{
+ int i;
+ struct ui_choicedata *data =
+ (struct ui_choicedata *) malloc(sizeof(*data));
+ item->height = BUTTONHEIGHT;
+ item->width = xtextwidth(uih->font, item->dialog->question);
+ item->width1 = 0;
+ data->menu = NULL;
+
+ data->texts = (CONST char **) entry->defstr;
+ for (i = 0; data->texts[i] != NULL; i++) {
+ int w = xtextwidth(uih->font, data->texts[i]);
+ if (w > item->width1)
+ item->width1 = w;
+ }
+ item->width1 += 2 * BORDERWIDTH;
+ data->n = i;
+ data->selected = entry->defint;
+ item->data = data;
+}
+
+static void ui_destroychoice(struct dialogitem *item, dialogparam * param)
+{
+ struct ui_choicedata *data = (struct ui_choicedata *) item->data;
+ param->dint = data->selected;
+ ui_closechoicemenu(uih, data);
+ free(data);
+}
+
+static void ui_drawchoice(struct dialogitem *item)
+{
+ struct ui_choicedata *data = (struct ui_choicedata *) item->data;
+ uih_drawborder(uih, dialog.half, item->y, item->width1,
+ BUTTONHEIGHT | BORDER_LIGHT, 0);
+ xprint(uih->image, uih->font, dialog.half + BORDERWIDTH,
+ item->y + BORDERHEIGHT, data->texts[data->selected],
+ SELECTED(item) ? SELCOLOR(uih) : FGCOLOR(uih),
+ BGCOLOR(uih), 0);
+ ui_drawquestion(item);
+}
+
+static int ui_keychoice(struct dialogitem *item, int key)
+{
+ struct ui_choicedata *data = (struct ui_choicedata *) item->data;
+ if (!data->menu) {
+ switch (key) {
+ case ' ':
+ case '\n':
+ case 13:
+ case UIKEY_UP:
+ case UIKEY_DOWN:
+ case UIKEY_RIGHT:
+ ui_buildchoicemenu(uih, data, dialog.half, item->y,
+ item->width1);
+ return (1);
+ }
+ } else {
+ switch (key) {
+ case ' ':
+ case 13:
+ case '\n':
+ data->selected = data->active;
+ ui_closechoicemenu(uih, data);
+ return (1);
+ case UIKEY_DOWN:
+ data->active++;
+ data->active %= data->n;
+ uih->display = 1;
+ return (1);
+ case UIKEY_UP:
+ data->active--;
+ if (data->active < 0)
+ data->active = data->n - 1;
+ uih->display = 1;
+ return (1);
+ case UIKEY_ESC:
+ ui_closechoicemenu(uih, data);
+ return (1);
+ }
+ }
+ return 0;
+}
+
+static void
+ui_mousechoice(struct dialogitem *item, int x, int y, int buttons,
+ int flags)
+{
+ struct ui_choicedata *data = (struct ui_choicedata *) item->data;
+ int in;
+ if (data->menu != NULL) {
+ in = 0;
+ if (x > data->x && y > data->y && x < data->x + data->width
+ && y < data->y + data->height)
+ in = 1;
+ if ((flags & MOUSE_PRESS) && !in) {
+ ui_closechoicemenu(uih, data);
+ return;
+ }
+ if ((flags & MOUSE_MOVE) && in) {
+ in = (y - data->y) / xtextheight(uih->font);
+ if (in < 0)
+ in = 0;
+ if (in >= data->n)
+ in = data->n - 1;
+ if (data->active != in)
+ data->active = in, uih->display = 1;
+ }
+ if (flags & MOUSE_RELEASE) {
+ data->selected = data->active;
+ ui_closechoicemenu(uih, data);
+ return;
+ }
+ } else {
+ if (flags & MOUSE_PRESS && x > dialog.half)
+ ui_buildchoicemenu(uih, data, dialog.half, item->y,
+ item->width1);
+ }
+}
+
+static void ui_unselectchoice(struct dialogitem *item)
+{
+ struct ui_choicedata *data = (struct ui_choicedata *) item->data;
+ ui_closechoicemenu(uih, data);
+}
+
+CONST static struct dialogtype choicedialog = {
+ ui_buildchoice,
+ ui_keychoice,
+ ui_mousechoice,
+ ui_destroychoice,
+ ui_drawchoice,
+ ui_unselectchoice
+};
+
+static void
+ui_dialogpos(struct uih_context *c, int *x, int *y, int *width,
+ int *height, void *data)
+{
+ *x = dialog.x;
+ *y = dialog.y;
+ if (filevisible || helpvisible) {
+ *x = *y = *width = *height = 0;
+ return;
+ }
+ *width = dialog.width;
+ *height = dialog.height;
+}
+
+static void ui_dialogdraw(struct uih_context *c, void *data)
+{
+ int n;
+ for (n = 0; n < dialog.nitems; n++)
+ dialog.items[n].type->draw(dialog.items + n);
+}
+
+#define YSKIP 2
+void ui_builddialog(CONST menuitem * item)
+{
+ int n = 2;
+ int ypos;
+ int width1 = 0;
+ if (ui_nogui) {
+ printf("dialog \"%s\"\n", item->shortname);
+ return;
+ }
+ if (driver->gui_driver && driver->gui_driver->dialog) {
+ driver->gui_driver->dialog(uih, item->shortname);
+ return;
+ }
+ dialogvisible = 1;
+ dialog.width = 0;
+ dialog.height = 0;
+ dialog.dialog = menu_getdialog(uih, item);
+ dialog.item = item;
+ for (n = 0; dialog.dialog[n].question != NULL; n++);
+ n++;
+ dialog.nitems = n;
+ dialog.items =
+ (struct dialogitem *) malloc(sizeof(struct dialogitem) *
+ dialog.nitems);
+ dialog.mousereleased = 0;
+ dialog.items[dialog.nitems - 1].type = &okdialog;
+ for (n = 0; n < dialog.nitems; n++) {
+ if (n < dialog.nitems - 1) {
+ switch (dialog.dialog[n].type) {
+ case DIALOG_STRING:
+ case DIALOG_KEYSTRING:
+ dialog.items[n].type = &stringdialog;
+ break;
+ case DIALOG_INT:
+ dialog.items[n].type = &intdialog;
+ break;
+ case DIALOG_IFILE:
+ case DIALOG_OFILE:
+ dialog.items[n].type = &filedialog;
+ break;
+ case DIALOG_FLOAT:
+ dialog.items[n].type = &floatdialog;
+ break;
+ case DIALOG_COORD:
+ dialog.items[n].type = &coorddialog;
+ break;
+ case DIALOG_CHOICE:
+ dialog.items[n].type = &choicedialog;
+ break;
+ default:
+ printf("uidialog:unknown type!\n");
+ exit(1);
+ }
+ }
+ dialog.items[n].dialog = dialog.dialog + n;
+ dialog.items[n].type->build(dialog.items + n, dialog.dialog + n);
+ dialog.height += dialog.items[n].height;
+ if (width1 < dialog.items[n].width1)
+ width1 = dialog.items[n].width1;
+ if (dialog.width < dialog.items[n].width)
+ dialog.width = dialog.items[n].width;
+ }
+ dialog.height += YSKIP * (n - 1);
+ n = xtextwidth(uih->font, gettext("OK")) + xtextwidth(uih->font,
+ gettext
+ ("Cancel")) +
+ xtextwidth(uih->font, gettext("Help")) + 10;
+ if (dialog.width < n)
+ dialog.width = n;
+ dialog.half = dialog.width + 2 * BORDERWIDTH;
+ dialog.width += 2 * BORDERWIDTH + width1;
+ dialog.height += 2 * BORDERHEIGHT;
+ dialog.current = 0;
+ dialog.x = (uih->image->width - dialog.width) / 2;
+ dialog.half += dialog.x;
+ dialog.y = (uih->image->height - dialog.height) / 2;
+ ypos = dialog.y + BORDERHEIGHT;
+ for (n = 0; n < dialog.nitems; n++) {
+ dialog.items[n].y = ypos;
+ ypos += dialog.items[n].height + YSKIP;
+ }
+ dialog.window =
+ uih_registerw(uih, ui_dialogpos, ui_dialogdraw, NULL, DRAWBORDER);
+ uih->display = 1;
+}
+
+static void ui_dialogquestion(int succesfull)
+{
+ if (succesfull)
+ ui_menuactivate(qitem, qparam);
+ else
+ menu_destroydialog(qitem, qparam, uih);
+}
+
+void ui_closedialog(int succesfull)
+{
+ int n = 2;
+ if (dialogvisible) {
+ dialogparam *param =
+ (dialogparam *) malloc(sizeof(dialogparam) * (dialog.nitems));
+ dialogvisible = 0;
+ uih_removew(uih, dialog.window);
+ uih->display = 1;
+ for (n = 0; n < dialog.nitems; n++) {
+ dialog.items[n].type->destroy(dialog.items + n, param + n);
+ }
+ free(dialog.items);
+ if (succesfull) {
+ for (n = 0; n < dialog.nitems - 1; n++)
+ if (dialog.dialog[n].type == DIALOG_OFILE
+ && xio_exist(param[n].dpath)) {
+ qparam = param;
+ qitem = dialog.item;
+ ui_buildyesno("File exist. Overwrite?",
+ ui_dialogquestion);
+ return;
+ }
+ ui_menuactivate(dialog.item, param);
+ } else
+ menu_destroydialog(dialog.item, param, uih);
+ }
+}
+
+int ui_dialogmouse(int x, int y, int mousebuttons, int flags)
+{
+ int i;
+ if (ui_mouseyesno(x, y, mousebuttons, flags))
+ return 1;
+ if (!dialogvisible)
+ return 0;
+ if (!dialog.mousereleased && (flags & MOUSE_RELEASE)) {
+ dialog.mousereleased = 1;
+ return 1;
+ }
+ if (!dialog.mousereleased && (flags & MOUSE_DRAG)) {
+ return 1;
+ }
+ dialog.mousereleased = 1;
+ if (dialog.mousegrab) {
+ dialog.items[dialog.current].type->mouse(dialog.items +
+ dialog.current, x, y,
+ mousebuttons, flags);
+ return 1;
+ }
+ if (dialog.x > x || dialog.y > y || dialog.x + dialog.width < x
+ || dialog.y + dialog.height < y) {
+ if (flags & MOUSE_PRESS) {
+ ui_closedialog(0);
+ return 1;
+ }
+ dialog.items[dialog.current].type->mouse(dialog.items +
+ dialog.current, x, y, 0,
+ 0);
+ return 1;
+ }
+ for (i = dialog.nitems - 1; i >= 0; i--)
+ if (dialog.items[i].y < y)
+ break;
+ if (i == -1) {
+ dialog.items[dialog.current].type->mouse(dialog.items +
+ dialog.current, x, y, 0,
+ 0);
+ return 1;
+ }
+ if (((flags & MOUSE_PRESS) || (flags & MOUSE_MOVE))
+ && dialog.current != i) {
+ dialog.items[dialog.current].type->unselect(dialog.items +
+ dialog.current);
+ dialog.current = i;
+ uih->display = 1;
+ }
+ dialog.items[i].type->mouse(dialog.items + i, x, y, mousebuttons,
+ flags);
+ return 1;
+}
+
+int ui_dialogkeys(int key)
+{
+ if (ui_keyyesno(key))
+ return 1;
+ if (!dialogvisible)
+ return 0;
+ if (key == UIKEY_ESC) {
+ ui_closedialog(0);
+ return 1;
+ }
+ if (!dialog.items[dialog.current].type->
+ key(dialog.items + dialog.current, key)) {
+ switch (key) {
+ case 'h':
+ ui_help(dialog.item->shortname);
+ return 1;
+ case UIKEY_TAB:
+ case UIKEY_DOWN:
+ case UIKEY_RIGHT:
+ NEXT();
+ break;
+ case UIKEY_UP:
+ case UIKEY_LEFT:
+ PREV();
+ break;
+ case 13:
+ case '\n':
+ ui_closedialog(1);
+ }
+ }
+ return 1;
+}
diff --git a/src/ui/drivers.c b/src/ui/drivers.c
new file mode 100644
index 0000000..f4954c6
--- /dev/null
+++ b/src/ui/drivers.c
@@ -0,0 +1,89 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+/*drivers registry */
+#include <config.h>
+#include <ui.h>
+extern CONST struct ui_driver svga_driver, x11_driver, dog_driver,
+ plan9_driver, plan9_driver, mac_driver, mac_full_driver, osx_driver,
+ osx_fullscreen_driver, os2vio_driver, cocoa_driver, qt_driver,
+ cocoa_fullscreen_driver, be_driver, be_direct_driver, be_screen_driver,
+ aalib_driver, gtk_driver, ggi_driver, win32_driver, dxw_driver,
+ dxf_driver, DGA_driver;
+CONST struct ui_driver *CONST drivers[] = {
+#ifdef WIN32_DRIVER
+ &win32_driver,
+#endif
+#ifdef DDRAW_DRIVER
+ &dxw_driver,
+ &dxf_driver,
+#endif
+#ifdef SVGA_DRIVER
+ &svga_driver,
+#endif
+#ifdef X11_DRIVER
+ &x11_driver,
+#endif
+#ifdef DGA_DRIVER
+ &DGA_driver,
+#endif
+#ifdef GTK_DRIVER
+ &gtk_driver,
+#endif
+#ifdef GGI_DRIVER
+ &ggi_driver,
+#endif
+#ifdef OS2VIO_DRIVER
+ &os2vio_driver,
+#endif
+#ifdef DOG_DRIVER
+ &dog_driver,
+#endif
+#ifdef PLAN9_DRIVER
+ &plan9_driver,
+#endif
+#ifdef AA_DRIVER
+ &aalib_driver,
+#endif
+#ifdef _MAC
+ &mac_driver,
+ &mac_full_driver,
+#endif
+#ifdef OSX_DRIVER
+ &osx_driver,
+ &osx_fullscreen_driver,
+#endif
+#ifdef COCOA_DRIVER
+ &cocoa_driver,
+ &cocoa_fullscreen_driver,
+#endif
+#ifdef QT_DRIVER
+ &qt_driver,
+#endif
+#ifdef BEOS_DRIVER
+ &be_driver,
+ &be_direct_driver,
+ &be_screen_driver,
+#endif
+ NULL
+};
+
+CONST int ndrivers = (sizeof(drivers) / sizeof(*drivers) - 1);
diff --git a/src/ui/filesel.c b/src/ui/filesel.c
new file mode 100644
index 0000000..24c1c83
--- /dev/null
+++ b/src/ui/filesel.c
@@ -0,0 +1,677 @@
+#ifndef _plan9_
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+
+#include <config.h>
+#include <filter.h>
+#include <fractal.h>
+#include <ui_helper.h>
+#include <xmenu.h>
+#include <grlib.h>
+#include <ui.h>
+#include <xerror.h>
+#include <misc-f.h>
+#include "uiint.h"
+
+#ifdef HAVE_GETTEXT
+#include <libintl.h>
+#else
+#define gettext(STRING) STRING
+#endif
+
+static char **dirs;
+static char **sdirs;
+static int ndirs;
+static char **names;
+static char **snames;
+static int nnames;
+
+struct ui_textdata *dir, *filename;
+static char lastdir[256];
+static char *currdir;
+
+static struct uih_window *filew;
+static CONST char *mask;
+static void (*callback) (CONST char *name, int succ);
+int filevisible;
+static int filex, filey, filewidth, fileheight;
+
+#define ADIR 0
+#define AFILELIST 1
+#define ADIRLIST 2
+#define AFILE 3
+#define AOK 4
+
+#define DIRSTART (filey+BORDERHEIGHT)
+#define LISTSTART (DIRSTART+BUTTONHEIGHT+BORDERHEIGHT)
+#define LISTEND (FILESTART-BORDERHEIGHT)
+#define FILESTART (OKSTART-BORDERHEIGHT-BUTTONHEIGHT)
+#define OKSTART (filey+fileheight-BORDERHEIGHT-BUTTONHEIGHT)
+#define SCROLLWIDTH 10
+
+#define LISTWIDTH ((filewidth-10*BORDERWIDTH-2*SCROLLWIDTH)/2)
+
+#define NVISIBLE ((LISTEND-LISTSTART-2*BORDERHEIGHT)/xtextheight(uih->font))
+
+static int selectedname;
+static int selecteddir;
+static int namestart;
+static int dirstart;
+
+static int pressedbutton;
+static int activebutton;
+static int active;
+
+static void ui_freenames(void)
+{
+ int i;
+ selectedname = 0;
+ selecteddir = 0;
+ if (nnames) {
+ for (i = 0; i < nnames; i++)
+ free(names[i]), free(snames[i]);
+ free(names);
+ nnames = 0;
+ }
+ if (ndirs) {
+ for (i = 0; i < ndirs; i++)
+ free(dirs[i]), free(sdirs[i]);
+ free(dirs);
+ ndirs = 0;
+ }
+ if (snames)
+ free(snames), snames = NULL;
+ if (sdirs)
+ free(sdirs), sdirs = NULL;
+}
+
+static int compar(CONST void *a, CONST void *b)
+{
+ return (strcmp(*(CONST char **) a, *(CONST char **) b));
+}
+
+static char **ui_mksnames(int nnames, char **names, int width)
+{
+ char **snames = NULL;
+ int i;
+ if (nnames) {
+ qsort(names, nnames, sizeof(*names), /*(int (*)(CONST void *, CONST
+ void *))strcmp */ compar);
+ snames = (char **) malloc(sizeof(*snames) * nnames);
+ for (i = 0; i < nnames; i++) {
+ if (xtextwidth(uih->font, names[i]) <= width)
+ snames[i] = mystrdup(names[i]);
+ else {
+ int y;
+ int swidth = 0;
+ int len = (int) strlen(names[i]);
+ snames[i] = (char *) malloc(strlen(names[i]) + 2);
+ for (y = len - 4; y < len; y++)
+ swidth += xtextcharw(uih->font, names[i][y]);
+ swidth += xtextcharw(uih->font, '|');
+ y = 0;
+ while (swidth < width) {
+ snames[i][y] = names[i][y];
+ swidth += xtextcharw(uih->font, names[i][y]);
+ y++;
+ }
+ snames[i][y - 1] = '|';
+ snames[i][y] = 0;
+ strcat(snames[i], names[i] + len - 4);
+ }
+ }
+ }
+ return (snames);
+}
+
+static void ui_buildnames(int width)
+{
+ ui_freenames();
+ xio_getfiles(currdir, &names, &dirs, &nnames, &ndirs);
+ if (snames)
+ free(snames), snames = NULL;
+ if (sdirs)
+ free(sdirs), sdirs = NULL;
+ snames = ui_mksnames(nnames, names, width);
+ sdirs = ui_mksnames(ndirs, dirs, width);
+}
+
+void ui_closefilesel(int success)
+{
+ char *text =
+ (char *) malloc((int) strlen(filename->text) +
+ (int) strlen(currdir) + 3);
+ filevisible = 0;
+ uih_removew(uih, filew);
+ ui_freenames();
+ sprintf(text, "%s" XIO_PATHSEPSTR "%s", currdir, filename->text);
+ ui_closetext(dir);
+ ui_closetext(filename);
+ strcpy(lastdir, currdir);
+ free(currdir);
+ callback(text, success);
+ free(text);
+ uih->display = 1;
+ ui_freenames();
+}
+
+static void
+filepos(uih_context * c, int *x, int *y, int *w, int *h, void *data)
+{
+ *x = filex;
+ *y = filey;
+ *w = filewidth;
+ *h = fileheight;
+}
+
+static void drawfile(uih_context * c, void *data)
+{
+ int i;
+ int ypos;
+ int h = xtextheight(uih->font);
+ uih_drawborder(uih, filex + BORDERWIDTH, DIRSTART,
+ filewidth - 2 * BORDERWIDTH, BUTTONHEIGHT,
+ BORDER_PRESSED | BORDER_LIGHT);
+ uih_drawborder(uih, filex + BORDERWIDTH, FILESTART,
+ filewidth - 2 * BORDERWIDTH, BUTTONHEIGHT,
+ BORDER_PRESSED | BORDER_LIGHT);
+
+ ui_drawbutton("OK", (pressedbutton == 0), active == AOK
+ && activebutton == 0, filex + BORDERWIDTH,
+ filex + filewidth / 2 - BORDERWIDTH, OKSTART);
+ ui_drawbutton(gettext("Cancel"), (pressedbutton == 1), active == AOK
+ && activebutton == 1,
+ filex + filewidth / 2 + BORDERWIDTH,
+ filex + filewidth - BORDERWIDTH, OKSTART);
+
+ uih_drawborder(uih, filex + BORDERWIDTH, LISTSTART,
+ LISTWIDTH + 3 * BORDERWIDTH + SCROLLWIDTH,
+ LISTEND - LISTSTART, BORDER_PRESSED);
+ uih_drawborder(uih, filex + filewidth / 2 + BORDERWIDTH, LISTSTART,
+ LISTWIDTH + 3 * BORDERWIDTH + SCROLLWIDTH,
+ LISTEND - LISTSTART, BORDER_PRESSED);
+ ypos = LISTSTART + BORDERHEIGHT;
+ for (i = 0; ypos + h < LISTEND && i + namestart < nnames; i++) {
+ if (i + namestart == selectedname) {
+ xrectangle(uih->image, filex + 2 * BORDERWIDTH, ypos,
+ LISTWIDTH, h,
+ (uih->palette->
+ type & BITMAPS) ? BGCOLOR(uih) :
+ LIGHTGRAYCOLOR(uih));
+ }
+ if (uih->palette->type & BITMAPS)
+ xprint(uih->image, uih->font, filex + 2 * BORDERWIDTH, ypos,
+ snames[i + namestart],
+ i + namestart ==
+ selectedname ? FGCOLOR(uih) : BGCOLOR(uih),
+ BGCOLOR(uih), TEXT_PRESSED);
+ else
+ xprint(uih->image, uih->font, filex + 2 * BORDERWIDTH, ypos,
+ snames[i + namestart],
+ (i + namestart) == selectedname
+ && active == AFILELIST ? SELCOLOR(uih) : FGCOLOR(uih),
+ BGCOLOR(uih), 0);
+ ypos += h;
+ }
+ if (nnames) {
+ int xstart = (namestart) * (LISTEND - LISTSTART) / nnames;
+ int xend = (namestart + NVISIBLE) * (LISTEND - LISTSTART) / nnames;
+ if (xstart > (LISTEND - LISTSTART - 2 * BORDERHEIGHT))
+ xstart = LISTEND - LISTSTART - 2 * BORDERHEIGHT;
+ if (xend > (LISTEND - LISTSTART - 2 * BORDERHEIGHT))
+ xend = LISTEND - LISTSTART - 2 * BORDERHEIGHT;
+ uih_drawborder(uih, filex + LISTWIDTH + 3 * BORDERWIDTH, LISTSTART + xstart + BORDERHEIGHT, SCROLLWIDTH, xend - xstart, /*1|BORDER_LIGHT */
+ 0);
+ }
+
+ ypos = LISTSTART + BORDERHEIGHT;
+ for (i = 0; ypos + h < LISTEND && i + dirstart < ndirs; i++) {
+ if (i + dirstart == selecteddir) {
+ xrectangle(uih->image, filex + filewidth / 2 + 2 * BORDERWIDTH,
+ ypos, LISTWIDTH, h,
+ (uih->palette->type & BITMAPS) ? BGCOLOR(uih) :
+ LIGHTGRAYCOLOR(uih));
+ }
+ if (uih->palette->type & BITMAPS)
+ xprint(uih->image, uih->font,
+ filex + filewidth / 2 + 2 * BORDERWIDTH, ypos,
+ sdirs[i + dirstart],
+ i + dirstart ==
+ selecteddir ? FGCOLOR(uih) : BGCOLOR(uih), BGCOLOR(uih),
+ TEXT_PRESSED);
+ else
+ xprint(uih->image, uih->font,
+ filex + filewidth / 2 + 2 * BORDERWIDTH, ypos,
+ sdirs[i + dirstart],
+ (i + dirstart) == selecteddir
+ && active == ADIRLIST ? SELCOLOR(uih) : FGCOLOR(uih),
+ BGCOLOR(uih), 0);
+ ypos += h;
+ }
+ if (ndirs) {
+ int xstart = (dirstart) * (LISTEND - LISTSTART) / ndirs;
+ int xend = (dirstart + NVISIBLE) * (LISTEND - LISTSTART) / ndirs;
+ if (xstart > (LISTEND - LISTSTART - 2 * BORDERHEIGHT))
+ xstart = LISTEND - LISTSTART - 2 * BORDERHEIGHT;
+ if (xend > (LISTEND - LISTSTART - 2 * BORDERHEIGHT))
+ xend = LISTEND - LISTSTART - 2 * BORDERHEIGHT;
+ uih_drawborder(uih, filex + filewidth / 2 + LISTWIDTH + 3 * BORDERWIDTH, LISTSTART + xstart + BORDERHEIGHT, SCROLLWIDTH, xend - xstart, /*1|BORDER_LIGHT */
+ 0);
+ }
+ ui_drawtext(filename, active == AFILE);
+ ui_drawtext(dir, active == ADIR);
+}
+
+static void setname(int name)
+{
+ ui_closetext(filename);
+ filename =
+ ui_opentext(filex + 2 * BORDERWIDTH, FILESTART + BORDERHEIGHT,
+ filewidth - 4 * BORDERWIDTH, names[name]);
+}
+
+#ifdef _WIN32
+#define DRIVES
+#endif
+#ifdef DJGPP
+#define DRIVES
+#endif
+static void setdir(int name)
+{
+ char *dirstring = dirs[name];
+ char *s = NULL;
+ if (dirstring[0] == '.' && !dirstring[1]) {
+ /*do nothing */
+ s = mystrdup(currdir);
+ } else if (dirstring[0] && dirstring[1] && dirstring[0] == '.'
+ && dirstring[1] == '.' && !dirstring[2]) {
+ int i = (int) strlen(currdir);
+ s = (char *) malloc((int) strlen(dirstring) +
+ (int) strlen(currdir) + 2);
+ strcpy(s, currdir);
+ for (;
+ i >= 0 && s[i] != '/' && s[i] != '\\' && s[i] != XIO_PATHSEP;
+ i--);
+ if (i < 0)
+ free(s), s = NULL;
+ else
+ s[i] = 0;
+ }
+ if (s == NULL) {
+ int i = (int) strlen(currdir);
+ s = (char *) malloc((int) strlen(dirstring) +
+ (int) strlen(currdir) + 2);
+ strcpy(s, currdir);
+ if (currdir[i - 1] != '/' && currdir[i - 1] != '\\'
+ && currdir[i - 1] != XIO_PATHSEP)
+ strcat(s, XIO_PATHSEPSTR);
+ strcat(s, dirstring);
+ if (!s[0])
+ s[0] = XIO_PATHSEP, s[1] = 0;
+ }
+ free(currdir);
+#ifdef DRIVES
+ if (strlen(s) == 2
+ && ((s[0] >= 'a' && s[0] <= 'z') || (s[0] >= 'A' && s[0] <= 'Z'))
+ && s[1] == ':')
+ s[2] = XIO_PATHSEP, s[3] = 0;
+#endif
+ currdir = s;
+ ui_closetext(dir);
+ dir =
+ ui_opentext(filex + 2 * BORDERWIDTH, DIRSTART + BORDERHEIGHT,
+ filewidth - 4 * BORDERWIDTH, currdir);
+ ui_freenames();
+ ui_buildnames(LISTWIDTH);
+ dirstart = 0;
+ selecteddir = 0;
+ namestart = 0;
+ selectedname = 0;
+ uih->display = 1;
+}
+
+static void setexactdir(CONST char *dirstring)
+{
+ free(currdir);
+ currdir = mystrdup(dirstring);
+ ui_closetext(dir);
+ dir =
+ ui_opentext(filex + 2 * BORDERWIDTH, DIRSTART + BORDERHEIGHT,
+ filewidth - 4 * BORDERWIDTH, currdir);
+ ui_freenames();
+ ui_buildnames(LISTWIDTH);
+ dirstart = 0;
+ selecteddir = 0;
+ namestart = 0;
+ selectedname = 0;
+ uih->display = 1;
+}
+
+int ui_keyfilesel(int k)
+{
+ if (!filevisible)
+ return 0;
+ if (k == UIKEY_ESC)
+ ui_closefilesel(0);
+ else
+ switch (active) {
+ default:
+ active = AFILE;
+ uih->display = 1;
+ break;
+ case ADIR:
+ if (ui_textkey(dir, k))
+ break;
+ if (k == '\n' || k == 13) {
+ active = AFILE;
+ setexactdir(dir->text);
+ uih->display = 1;
+ }
+ if (k == UIKEY_UP) {
+ active = AOK;
+ uih->display = 1;
+ activebutton = 1;
+ }
+ if (k == '\t' || k == UIKEY_DOWN) {
+ active++;
+ uih->display = 1;
+ }
+ break;
+ case AFILELIST:
+ switch (k) {
+ case '\t':
+ case UIKEY_RIGHT:
+ uih->display = 1;
+ active = ADIRLIST;
+ break;
+ case UIKEY_LEFT:
+ uih->display = 1;
+ active = ADIR;
+ break;
+ case UIKEY_UP:
+ if (selectedname) {
+ uih->display = 1;
+ selectedname--;
+ if (selectedname < namestart)
+ namestart = selectedname;
+ }
+ break;
+ case UIKEY_DOWN:
+ if (selectedname < nnames - 1) {
+ uih->display = 1;
+ selectedname++;
+ if (selectedname >= namestart + NVISIBLE)
+ namestart = selectedname - NVISIBLE + 1;
+ }
+ break;
+ case UIKEY_HOME:
+ if (selectedname) {
+ uih->display = 1;
+ selectedname = namestart = 0;
+ }
+ break;
+ case UIKEY_END:
+ if (selectedname < nnames - 1) {
+ uih->display = 1;
+ selectedname = nnames - 1;;
+ if (selectedname >= namestart + NVISIBLE)
+ namestart = selectedname - NVISIBLE + 1;
+ }
+ break;
+ case '\n':
+ case 13:
+ setname(selectedname);
+ uih->display = 1;
+ active = AFILE;
+ break;
+ }
+ break;
+ case ADIRLIST:
+ switch (k) {
+ case '\t':
+ case UIKEY_RIGHT:
+ uih->display = 1;
+ active = AFILE;
+ break;
+ case UIKEY_LEFT:
+ uih->display = 1;
+ active = AFILELIST;
+ break;
+ case UIKEY_UP:
+ if (selecteddir) {
+ uih->display = 1;
+ selecteddir--;
+ if (selecteddir < dirstart)
+ dirstart = selecteddir;
+ }
+ break;
+ case UIKEY_DOWN:
+ if (selecteddir < ndirs - 1) {
+ uih->display = 1;
+ selecteddir++;
+ if (selecteddir >= dirstart + NVISIBLE)
+ dirstart = selecteddir - NVISIBLE + 1;
+ }
+ break;
+ case UIKEY_HOME:
+ if (selecteddir) {
+ uih->display = 1;
+ selecteddir = dirstart = 0;
+ }
+ break;
+ case UIKEY_END:
+ if (selecteddir < ndirs - 1) {
+ uih->display = 1;
+ selecteddir = ndirs - 1;;
+ if (selecteddir >= dirstart + NVISIBLE)
+ dirstart = selecteddir - NVISIBLE + 1;
+ }
+ break;
+ case '\n':
+ case 13:
+ setdir(selecteddir);
+ uih->display = 1;
+ break;
+ }
+ break;
+ case AFILE:
+ if (ui_textkey(filename, k))
+ break;
+ if (k == '\t' || k == UIKEY_DOWN) {
+ active++;
+ uih->display = 1;
+ activebutton = 0;
+ }
+ if (k == UIKEY_UP) {
+ active--;
+ uih->display = 1;
+ }
+
+ if (k == '\n' || k == 13) {
+ ui_closefilesel(1);
+ }
+ break;
+ case AOK:
+ if (k == '\n' || k == 13)
+ ui_closefilesel(!activebutton);
+ if (k == '\t' || k == UIKEY_RIGHT || k == UIKEY_DOWN) {
+ uih->display = 1;
+ activebutton++;
+ if (activebutton > 2) {
+ activebutton = 0;
+ active = ADIR;
+ }
+ }
+ if (k == UIKEY_LEFT || k == UIKEY_UP) {
+ uih->display = 1;
+ activebutton--;
+ if (activebutton < 0) {
+ activebutton = 0;
+ active = AFILE;
+ }
+ }
+ }
+ return 1;
+}
+
+int ui_mousefilesel(int x, int y, int buttons, int flags)
+{
+ static int grabbed = -1;
+ if (!filevisible)
+ return 0;
+ if (grabbed >= 0 && (flags & MOUSE_DRAG)) {
+ if (!grabbed) {
+ int pos;
+ pos =
+ (y - LISTSTART) * nnames / (LISTEND - LISTSTART -
+ 2 * BORDERHEIGHT);
+ if (pos >= nnames - NVISIBLE)
+ pos = nnames - NVISIBLE;
+ if (pos < 0)
+ pos = 0;
+ if (pos != namestart) {
+ namestart = pos;
+ uih->display = 1;
+ if (selectedname < pos)
+ selectedname = pos;
+ if (selectedname >= pos + NVISIBLE)
+ selectedname = pos + NVISIBLE - 1;
+ }
+ } else {
+ int pos;
+ pos =
+ (y - LISTSTART) * ndirs / (LISTEND - LISTSTART -
+ 2 * BORDERHEIGHT);
+ if (pos >= ndirs - NVISIBLE)
+ pos = ndirs - NVISIBLE;
+ if (pos < 0)
+ pos = 0;
+ if (pos != dirstart) {
+ dirstart = pos;
+ uih->display = 1;
+ if (selecteddir < pos)
+ selecteddir = pos;
+ if (selecteddir >= pos + NVISIBLE)
+ selecteddir = pos + NVISIBLE - 1;
+ }
+ }
+ } else
+ grabbed = -1;
+ if (x < filex || y < filey || x > filex + filewidth
+ || y > filex + fileheight) {
+ if (flags & MOUSE_PRESS)
+ ui_closefilesel(0);
+ return 1;
+ }
+ if (y < LISTSTART) {
+ if (pressedbutton != -1)
+ pressedbutton = -1, uih->display = 1;
+ if ((flags & MOUSE_MOVE) && active != ADIR)
+ active = ADIR, uih->display = 1;
+ if (flags & MOUSE_PRESS)
+ ui_textmouse(dir, x, y);
+ } else if (y < LISTEND) {
+ int mouseat = 0;
+ if (pressedbutton != -1)
+ pressedbutton = -1, uih->display = 1;
+ if (x > filex + filewidth / 2)
+ mouseat = 1, x -= filewidth / 2;
+ x -= filex;
+ if (flags & MOUSE_MOVE) {
+ if (!mouseat && active != AFILELIST)
+ active = AFILELIST, uih->display = 1;
+ if (mouseat && active != ADIRLIST)
+ active = ADIRLIST, uih->display = 1;
+ }
+ if (x > LISTWIDTH && (flags & MOUSE_PRESS))
+ grabbed = mouseat;
+ else {
+ if (flags & MOUSE_PRESS) {
+ int atitem =
+ (y - LISTSTART -
+ BORDERHEIGHT) / xtextheight(uih->font);
+ if (atitem < 0)
+ atitem = 0;
+ if (!mouseat) {
+ atitem += namestart;
+ if (atitem < nnames) {
+ if (atitem == selectedname
+ && !strcmp(names[selectedname],
+ filename->text)) {
+ ui_closefilesel(1);
+ } else {
+ selectedname = atitem;
+ uih->display = 1;
+ setname(selectedname);
+ }
+ }
+ } else {
+ atitem += dirstart;
+ if (atitem < ndirs) {
+ selecteddir = atitem;
+ uih->display = 1;
+ setdir(selecteddir);
+ }
+ }
+ }
+ }
+ } else if (y < OKSTART) {
+ if (pressedbutton != -1)
+ pressedbutton = -1, uih->display = 1;
+ /*exit(1); */
+ if ((flags & MOUSE_MOVE) && active != AFILE)
+ active = AFILE, uih->display = 1;
+ if (flags & MOUSE_PRESS)
+ ui_textmouse(filename, x, y);
+ } else {
+ int mouseat = 0;
+ if (x > filex + filewidth / 2)
+ mouseat = 1;
+ if (flags & MOUSE_PRESS) {
+ if (active != AOK)
+ active = AOK, uih->display = 1;
+ if (activebutton != mouseat || pressedbutton != mouseat)
+ activebutton = pressedbutton = mouseat, uih->display = 1;
+ }
+ if ((flags & MOUSE_MOVE) && pressedbutton != mouseat)
+ uih->display = 1, pressedbutton = -1, active =
+ AOK, activebutton = mouseat;
+ if ((flags & MOUSE_RELEASE) && pressedbutton == mouseat)
+ ui_closefilesel(!mouseat);
+ }
+ return 1;
+}
+
+void
+ui_buildfilesel(CONST char *f, CONST char *m,
+ void (*c) (CONST char *, int))
+{
+ if (filevisible) {
+ x_fatalerror("Internal error!");
+ }
+ pressedbutton = activebutton = active = -1;
+ if (lastdir[0] == 0)
+ getcwd(lastdir, 256);
+ lastdir[255] = 0;
+ currdir = mystrdup(lastdir);
+ callback = c;
+ active = AFILE;
+ filex = 0;
+ filey = 0;
+ filewidth = uih->image->width;
+ fileheight = uih->image->height;
+ namestart = dirstart = 0;
+ mask = m;
+ dir =
+ ui_opentext(filex + 2 * BORDERWIDTH, DIRSTART + BORDERHEIGHT,
+ filewidth - 4 * BORDERWIDTH, lastdir);
+ filename =
+ ui_opentext(filex + 2 * BORDERWIDTH, FILESTART + BORDERHEIGHT,
+ filewidth - 4 * BORDERWIDTH, f);
+ filevisible = 1;
+ ui_buildnames(LISTWIDTH);
+ filew = uih_registerw(uih, filepos, drawfile, 0, DRAWBORDER);
+}
+#endif
diff --git a/src/ui/fparams.c b/src/ui/fparams.c
new file mode 100644
index 0000000..0befa7a
--- /dev/null
+++ b/src/ui/fparams.c
@@ -0,0 +1,112 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <config.h>
+#ifndef _plan9_
+#include <fconfig.h>
+#include <string.h>
+#include <stdlib.h>
+#ifdef DESTICKY
+#include <unistd.h>
+#endif
+#else
+#include <u.h>
+#include <libc.h>
+#endif
+#include <filter.h>
+#include <ui_helper.h>
+#include <ui.h>
+#include <param.h>
+#include <xmenu.h>
+#include <plane.h>
+#include <xerror.h>
+#include "uiint.h"
+
+
+static char *defrender = NULL;
+static CONST char *rbasename = "anim";
+static int alias = 0;
+static int slowmode = 0;
+static char *imgtype;
+static char *defsize;
+static float framerate;
+static int letterspersec = 20;
+static int defvectors;
+static int iframedist;
+CONST struct params ui_fractal_params[] = {
+
+ {"", P_HELP, NULL, "Animation rendering:"},
+ {"-render", P_STRING, &defrender,
+ "Render animation into seqence of .png files"},
+ {"-basename", P_STRING, &rbasename,
+ "Name for .png files (XaoS will add 4 digit number and extension"},
+ {"-size", P_STRING, &defsize, "widthxheight"},
+ {"-renderimage", P_STRING, &imgtype, "256 or truecolor"},
+ {"-renderframerate", P_FLOAT, &framerate, "framerate"},
+ {"-antialiasing", P_SWITCH, &alias,
+ "Perform antialiasing (slow, requires quite lot of memory)"},
+ {"-alwaysrecalc", P_SWITCH, &slowmode,
+ "Always recalculate whole image (slowes down rendering, increases quality)"},
+ {"-rendervectors", P_SWITCH, &defvectors,
+ "Render motion vectors (should be used for MPEG encoding)"},
+ {"-iframedist", P_NUMBER, &iframedist,
+ "Recommended distance between I frames in pat file (should be used for MPEG encoding)"},
+ {NULL, 0, NULL, NULL}
+};
+
+int ui_dorender_params(void)
+{
+ if (defrender != NULL) {
+ int imagetype = TRUECOLOR24;
+ int width = 640, height = 480;
+#ifdef DESTICKY
+ seteuid(getuid()); /* Don't need supervisor rights anymore. */
+ setegid(getgid());
+#endif
+#ifndef STRUECOLOR24
+ if (imagetype == TRUECOLOR24)
+ imagetype = TRUECOLOR;
+#endif
+ if (imgtype != NULL) {
+ if (!strcmp("256", imgtype))
+ imagetype = C256;
+ else if (!strcmp("truecolor", imgtype)) {
+ x_fatalerror("Unknown image type:%s", imgtype);
+ }
+ }
+ if (defsize != NULL &&
+ !sscanf(defsize, "%ix%i", &width, &height) &&
+ (width <= 0 || height <= 0)) {
+ x_fatalerror("Invalid size (use for example 320x200");
+ }
+ if (framerate <= 0)
+ framerate = 30;
+ uih_renderanimation(NULL, rbasename, defrender, width, height,
+ ui_get_windowwidth(width) / width,
+ ui_get_windowheight(height) / height,
+ (int) (1000000 / framerate), imagetype, alias,
+ slowmode, letterspersec, NULL, defvectors,
+ iframedist);
+ return 1;
+ }
+ return 0;
+}
diff --git a/src/ui/param.c b/src/ui/param.c
new file mode 100644
index 0000000..eb10a9d
--- /dev/null
+++ b/src/ui/param.c
@@ -0,0 +1,172 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifdef _plan9_
+#include <u.h>
+#include <libc.h>
+#else
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#endif
+#include <config.h>
+#include <param.h>
+#include <xmenu.h>
+#include <version.h>
+#include <xerror.h>
+#define MAXPARAMS 40
+static CONST struct params *params[40];
+int nparams;
+
+int params_parser(int argc, char **argv)
+{
+ int i, p = 0, d;
+ int ie = 0;
+ int is;
+ CONST struct params *par = NULL;
+ int error = 0;
+ int found;
+ for (i = 1; i < argc && !error; i++) {
+ found = 0;
+#ifdef MACOSX
+ if (strncmp("-psn", argv[i], 4) == 0)
+ continue;
+#endif
+ if (!strcmp("-help", argv[i])) {
+ error = 1;
+ break;
+ }
+ for (d = 0; d < nparams; d++) {
+ par = params[d];
+ for (p = 0; par[p].name != NULL && !error; p++) {
+ if (!strcmp(par[p].name, argv[i])) {
+ found = 1;
+ is = i;
+ switch (par[p].type) {
+ case P_SWITCH:
+ *((int *) par[p].value) = 1;
+ break;
+ case P_NUMBER:
+ {
+ int n;
+ if (i == argc - 1) {
+ x_error
+ ("parameter %s requires numeric value.",
+ argv[i]);
+ error = 1;
+ break;
+ }
+ if (sscanf(argv[i + 1], "%i", &n) != 1) {
+ x_error("parameter for %s is not number.",
+ argv[i]);
+ error = 1;
+ break;
+ }
+ *((int *) par[p].value) = n;
+ i++;
+ }
+ break;
+ case P_FLOAT:
+ {
+ float n;
+ if (i == argc - 1) {
+ x_error
+ ("parameter %s requires floating point numeric value.",
+ argv[i]);
+ error = 1;
+ break;
+ }
+ if (sscanf(argv[i + 1], "%f", &n) != 1) {
+ x_error
+ ("parameter for %s is not floating point number.",
+ argv[i]);
+ error = 1;
+ break;
+ }
+ *((float *) par[p].value) = n;
+ i++;
+ }
+ break;
+ case P_STRING:
+ {
+ if (i == argc - 1) {
+ x_error
+ ("parameter %s requires string value.",
+ argv[i]);
+ error = 1;
+ break;
+ }
+ i++;
+ *((char **) par[p].value) = *(argv + i);
+ }
+ }
+ ie = i;
+ i = is;
+ }
+ }
+ }
+ if (d == nparams && !found) {
+ i = menu_processargs(i, argc, argv);
+ if (i < 0) {
+ error = 1;
+ break;
+ } else
+ i++;
+ } else
+ i = ie;
+ }
+ if (error) {
+ const char *name[] = {
+ "",
+ "number",
+ "string",
+ "f.point"
+ };
+#ifndef _plan9_
+ printf(" XaoS" XaoS_VERSION " help text\n");
+ printf
+ (" (This help is genereated automagically. I am sorry for all inconvencies)\n\n");
+#endif
+ printf("option string param description\n\n");
+ for (d = 0; d < nparams; d++) {
+ par = params[d];
+ for (p = 0; par[p].name != NULL; p++) {
+ if (par[p].type == P_HELP)
+ printf("\n%s\n\n", par[p].help);
+ else if (!par[p].type)
+ printf(" %-14s %s\n", par[p].name, par[p].help);
+ else
+ printf(" %-14s %s\n%14s %s\n", par[p].name,
+ name[par[p].type], "", par[p].help);
+ }
+ if (p == 0)
+ printf(" No options avaiable for now\n");
+ }
+ menu_printhelp();
+ return 0;
+ }
+ return (1);
+}
+
+void params_register(CONST struct params *par)
+{
+ params[nparams++] = par;
+}
diff --git a/src/ui/pipecmd.c b/src/ui/pipecmd.c
new file mode 100644
index 0000000..f0f4c66
--- /dev/null
+++ b/src/ui/pipecmd.c
@@ -0,0 +1,113 @@
+#include <config.h>
+#ifndef _plan9
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#ifndef _MAC
+#include <sys/types.h>
+#endif
+#include <fconfig.h>
+#include <filter.h>
+#include <fractal.h>
+#include <string.h>
+#include <ui_helper.h>
+#include <ui.h>
+#include <timers.h>
+#include <xmenu.h>
+#include "uiint.h"
+#ifdef COMPILE_PIPE
+static int pipefd = -1;
+tl_timer *pipetimer;
+static char pipecommand[256];
+static int commandpos;
+static int textmode = 0;
+static int backslash = 0;
+static int nest = -1;
+#define add(cmd) (pipecommand[commandpos++]=cmd)
+static void ui_pipe_handler(void *data, int q)
+{
+#ifdef O_NONBLOCK
+ char buf[100];
+ int n = (int) read(pipefd, buf, 100);
+ int i;
+ if (n > 0) {
+ buf[n] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ if (backslash) {
+ add(buf[i]);
+ continue;
+ }
+ if (textmode) {
+ if (buf[i] == '\\') {
+ add(buf[i]);
+ backslash = 1;
+ continue;
+ }
+ if (buf[i] == '"') {
+ add(buf[i]);
+ textmode = 0;
+ continue;
+ }
+ add(buf[i]);
+ } else {
+ add(buf[i]);
+ if (buf[i] == '"')
+ textmode = 1;
+ if (buf[i] == ')')
+ nest--;
+ if (buf[i] == '(') {
+ if (nest == -1)
+ nest = 1;
+ else
+ nest++;
+ }
+ if (!nest) {
+ add(0);
+ uih_command(uih, pipecommand);
+ nest = -1;
+ commandpos = 0;
+ }
+ }
+ }
+#endif
+}
+
+void ui_pipe_init(CONST char *name)
+{
+#ifdef O_NONBLOCK
+ if ((int) strlen(name) == 1 && name[0] == '-') {
+ pipefd = 0;
+ fcntl(pipefd, F_SETFL, O_NONBLOCK);
+ } else {
+ pipefd = open(name, O_NONBLOCK);
+ if (pipefd == -1) {
+ perror(name);
+ exit(1);
+ }
+ }
+ pipetimer = tl_create_timer();
+ tl_set_multihandler(pipetimer, ui_pipe_handler, NULL);
+ tl_reset_timer(pipetimer);
+ tl_set_interval(pipetimer, 100000);
+ tl_add_timer(syncgroup, pipetimer);
+#else
+ printf
+ ("Fatal error - constant O_NONBLOCK used for non-blocking IO in the pipe handling"
+ "is unknown at the moment of compilation. The non-blocking IO will not work. "
+ "Please ask authors...\n");
+ exit(0);
+#endif
+}
+
+static void ui_pipe_close(void)
+{
+#ifdef O_NONBLOCK
+ if (pipefd == -1)
+ return;
+ close(pipefd);
+ tl_remove_timer(pipetimer);
+#endif
+}
+#endif
+#endif
diff --git a/src/ui/ui-drv/aa/Makefile.in b/src/ui/ui-drv/aa/Makefile.in
new file mode 100644
index 0000000..c49da4a
--- /dev/null
+++ b/src/ui/ui-drv/aa/Makefile.in
@@ -0,0 +1,39 @@
+CC = @CC@
+CFLAGS = @CFLAGS@
+LIBS = @LIBS@ -lm
+LFLAGS = @LDFLAGS@
+AR = @AR@
+RANLIB = @RANLIB@
+
+SRCS = ui_aa.c
+
+OBJS = $(SRCS:.c=.o)
+
+TLIB = @LIBPATH@/libuiaa.a
+
+
+all: $(TLIB)
+
+$(TLIB):$(OBJS)
+ rm -f $@
+ $(AR) rc $@ $(OBJS)
+ $(RANLIB) $@
+
+clean:
+ rm -f $(TLIB)
+ rm -f *.[oas]
+ rm -f *~
+ rm -f core
+
+distclean:clean
+ rm Makefile
+
+#dep:
+# rm -f .depend
+# make .depend
+#
+#.depend:
+# echo '# Program dependencies' >.depend
+# gcc -I svgalib $(DEFINES) -MM $(patsubst %.o,%.c,$(OBJS)) >>.depend
+#
+#include .depend
diff --git a/src/ui/ui-drv/aa/ui_aa.c b/src/ui/ui-drv/aa/ui_aa.c
new file mode 100644
index 0000000..22aa0fc
--- /dev/null
+++ b/src/ui/ui-drv/aa/ui_aa.c
@@ -0,0 +1,724 @@
+#include "aconfig.h"
+#ifdef AA_DRIVER
+#include <string.h>
+#include <malloc.h>
+#include <aalib.h>
+#include <ui.h>
+#include <unistd.h>
+#include <xmenu.h>
+#include <archaccel.h>
+struct ui_driver aalib_driver;
+static aa_palette palette;
+static aa_palette aapalette;
+static int useaapalette;
+#define c context
+static aa_context *c;
+static unsigned char *secondary;
+static int mouse;
+static int nomouse;
+static void aa_build_menus (void);
+static void aa_remove_menus (void);
+extern unsigned char *aa_chardata;
+extern unsigned char *aa_colordata;
+extern int aa_cursorx, aa_cursory;
+
+
+
+static void
+aa_print (int x, int y, CONST char *text)
+{
+ aa_puts (c, x / 2, y / 2, AA_SPECIAL, text);
+}
+
+static void
+aa_display (void)
+{
+ int i;
+ aa_renderpalette (c, useaapalette ? aapalette : palette,
+ &aa_defrenderparams, 0, 0, aa_scrwidth (c),
+ aa_scrheight (c));
+ for (i = 0; i < aa_scrwidth (c) * aa_scrheight (c); i++)
+ {
+ if (aa_colordata[i] != 255)
+ aa_text (c)[i] = aa_chardata[i], aa_attrs (c)[i] = aa_colordata[i];
+ }
+}
+static void
+aa_set_palette (ui_palette pal, int start, int end)
+{
+ int i;
+ for (i = start; i <= end; i++)
+ aa_setpalette (palette, i, pal[i - start][0], pal[i - start][1],
+ pal[i - start][2]);
+ aa_display ();
+ aa_flush (c);
+}
+
+static void
+aa_flip_buffers (void)
+{
+ unsigned char *tmp;
+ tmp = secondary;
+ secondary = c->imagebuffer;
+ c->imagebuffer = tmp;
+}
+
+static void
+aa_free_buffers (char *b1, char *b2)
+{
+ free (aa_chardata);
+ free (aa_colordata);
+ free (secondary);
+}
+
+static int
+aa_alloc_buffers (char **b1, char **b2)
+{
+ secondary = malloc (aa_imgwidth (c) * aa_imgheight (c));
+ *(unsigned char **) b2 = secondary;
+ *(unsigned char **) b1 = c->imagebuffer;
+ aa_chardata = malloc (aa_scrwidth (c) * aa_scrheight (c));
+ aa_colordata = malloc (aa_scrwidth (c) * aa_scrheight (c));
+ return aa_imgwidth (c); /* bytes per scanline */
+}
+
+static void
+aa_getsize (int *w, int *h)
+{
+ aa_resize (c);
+ *w = aa_imgwidth (c);
+ *h = aa_imgheight (c);
+}
+
+static int mousex, mousey, mouseb;
+static void
+aa_processevents (int wait, int *mx, int *my, int *mb, int *k)
+{
+ int ch;
+ static int keys;
+ do
+ {
+ if ((ch = aa_getevent (c, wait)) != AA_NONE && ch != AA_MOUSE
+ && ch != AA_RESIZE && ch < 256)
+ ui_key (ch);
+ switch (ch)
+ {
+ case AA_BACKSPACE:
+ ui_key (UIKEY_BACKSPACE);
+ break;
+ case AA_ESC:
+ ui_key (UIKEY_ESC);
+ break;
+ case AA_RESIZE:
+ ui_resize ();
+ break;
+ case AA_MOUSE:
+ aa_getmouse (c, &mousex, &mousey, &mouseb);
+ break;
+ case AA_LEFT:
+ ui_key (UIKEY_LEFT);
+ if (c->kbddriver->flags & AA_SENDRELEASE)
+ keys |= 1;
+ break;
+ case AA_LEFT | AA_RELEASE:
+ keys &= ~1;
+ break;
+ case AA_RIGHT:
+ ui_key (UIKEY_RIGHT);
+ if (c->kbddriver->flags & AA_SENDRELEASE)
+ keys |= 2;
+ break;
+ case AA_RIGHT | AA_RELEASE:
+ keys &= ~2;
+ break;
+ case AA_UP:
+ ui_key (UIKEY_UP);
+ if (c->kbddriver->flags & AA_SENDRELEASE)
+ keys |= 4;
+ break;
+ case AA_UP | AA_RELEASE:
+ keys &= ~4;
+ break;
+ case AA_DOWN:
+ ui_key (UIKEY_DOWN);
+ if (c->kbddriver->flags & AA_SENDRELEASE)
+ keys |= 8;
+ break;
+ case AA_DOWN | AA_RELEASE:
+ keys &= ~8;
+ break;
+ }
+ wait = 0;
+ }
+ while (ch != AA_NONE);
+ *mx = mousex * 2;
+ *my = mousey * 2;
+ *k = keys;
+ *mb = 0;
+ if (mouseb & AA_BUTTON1)
+ *mb |= BUTTON1;
+ if (mouseb & AA_BUTTON2)
+ *mb |= BUTTON2;
+ if (mouseb & AA_BUTTON3)
+ *mb |= BUTTON3;
+ return;
+}
+
+#define NATTRS 7
+static char *aadriver = NULL;
+static char *kbddriver = NULL;
+static char *mousedriver = NULL;
+static char *deffont = NULL;
+static int width, height, minwidth, minheight, maxwidth, maxheight, recwidth,
+ recheight;
+static int enable[NATTRS + 2], disable[NATTRS + 2];
+static int extended, inverse, bright = 0, contrast = 0;
+static float aa_gamma, dimmul, boldmul;
+static int dithering[3];
+static int randomval = 0;
+static int masks[] =
+ { AA_NORMAL_MASK, AA_DIM_MASK, AA_BOLD_MASK, AA_BOLDFONT_MASK,
+ AA_REVERSE_MASK, AA_ALL, AA_EIGHT
+};
+
+#ifdef DESTICKY
+extern int euid, egid;
+#endif
+static int
+aa_initialize (void)
+{
+ int i, y;
+ aa_parseoptions (NULL, NULL, NULL, NULL); /*parse environment first */
+
+ if (deffont != NULL)
+ {
+ for (y = 0; aa_fonts[y] != NULL; y++)
+ {
+ if (!strcmp (deffont, aa_fonts[y]->name)
+ || !strcmp (deffont, aa_fonts[y]->shortname))
+ {
+ aa_defparams.font = aa_fonts[y];
+ break;
+ }
+ }
+ }
+
+ if (extended)
+ aa_defparams.supported |= AA_EXTENDED;
+
+ for (i = 0; i < NATTRS; i++)
+ {
+ if (enable[i])
+ aa_defparams.supported |= masks[i];
+ if (disable[i])
+ aa_defparams.supported &= ~masks[i];
+ }
+
+ for (i = 0; i < 3; i++)
+ if (dithering[i])
+ aa_defrenderparams.dither = i;
+ if (randomval)
+ aa_defrenderparams.randomval = randomval;
+ if (bright)
+ aa_defrenderparams.bright = bright;
+ if (contrast)
+ aa_defrenderparams.contrast = contrast;
+ if (aa_gamma)
+ aa_defrenderparams.gamma = aa_gamma;
+
+ if (width)
+ aa_defparams.width = width;
+ if (height)
+ aa_defparams.height = height;
+ if (minwidth)
+ aa_defparams.minwidth = minwidth;
+ if (minheight)
+ aa_defparams.minheight = minheight;
+ if (maxwidth)
+ aa_defparams.maxwidth = maxwidth;
+ if (maxheight)
+ aa_defparams.maxheight = maxheight;
+ if (recwidth)
+ aa_defparams.recwidth = recwidth;
+ if (recheight)
+ aa_defparams.recheight = recheight;
+
+ if (aadriver != NULL)
+ aa_recommendhidisplay (aadriver);
+ if (kbddriver != NULL)
+ aa_recommendhikbd (kbddriver);
+ if (mousedriver != NULL)
+ aa_recommendhimouse (mousedriver);
+ if (dimmul)
+ aa_defparams.dimmul = dimmul;
+ if (boldmul)
+ aa_defparams.boldmul = boldmul;
+ if (inverse)
+ aa_defrenderparams.inversion = 1;
+
+#ifdef DESTICKY
+ seteuid (euid); /* We need supervisor rights to open mouse. */
+ setegid (egid);
+#endif
+ c = aa_autoinit (&aa_defparams);
+#ifdef DESTICKY
+ seteuid (getuid ()); /* Don't need supervisor rights anymore. */
+ setegid (getgid ());
+#endif
+
+ if (c == NULL)
+ return 0;
+ aa_autoinitkbd (c, AA_SENDRELEASE);
+ if (!nomouse)
+ mouse = aa_autoinitmouse (c, AA_MOUSEALLMASK);
+
+ aalib_driver.width = aa_mmwidth (c) / 10.0;
+ aalib_driver.height = aa_mmheight (c) / 10.0;
+ aa_build_menus ();
+ return (1);
+}
+
+static void
+aa_uninitialise (void)
+{
+ aa_close (c);
+ aa_remove_menus ();
+}
+
+static void
+aa_get_mouse (int *x, int *y, int *b)
+{
+ if (mouse)
+ aa_getmouse (c, &mousex, &mousey, &mouseb);
+ *x = mousex * 2;
+ *y = mousey * 2;
+ *b = 0;
+ if (mouseb & AA_BUTTON1)
+ *b |= BUTTON1;
+ if (mouseb & AA_BUTTON2)
+ *b |= BUTTON2;
+ if (mouseb & AA_BUTTON3)
+ *b |= BUTTON3;
+}
+
+static void
+aa_mousetype (int type)
+{
+#if (AA_LIB_VERSION>1||AA_LIB_MINNOR>0)
+ if (type == REPLAYMOUSE)
+ aa_hidemouse (c);
+ else
+ aa_showmouse (c);
+#endif
+}
+
+
+#if AA_LIB_VERSION==1 && AA_LIB_MINNOR==0
+#define SUPPORTED c->driver->params.supported
+#else
+#define SUPPORTED c->driverparams.supported
+#endif
+
+
+static int driver;
+static int font;
+static int mask;
+
+static void
+aa_save5 (void)
+{
+ struct aa_hardware_params p = aa_defparams;
+ struct aa_context *sc;
+ struct aa_savedata data;
+ int i;
+ char *name;
+ char extension[100];
+ if (aa_formats[driver]->flags & AA_USE_PAGES)
+ strcpy (extension, "_0_0");
+ else
+ extension[0] = 0;
+ strcat (extension, aa_formats[driver]->extension);
+
+#ifdef DJGPP
+ name = ui_getfile ("fr", extension);
+ /*fit into ugly 8char. limit */
+#else
+ name = ui_getfile ("fract", extension);
+#endif
+
+ if (name == NULL)
+ {
+ aa_print (0, 0, "Save driver initialization failed");
+ aa_flush (c);
+ sleep (3);
+ return;
+ }
+ for (i = 0; name[i] != '.' && name[i] != '_'; i++);
+ name[i] = 0;
+ strcat (name, "%c%e");
+
+ p.minwidth = p.maxwidth = 0;
+ p.minheight = p.maxheight = 0;
+ p.width = aa_scrwidth (c);
+ p.height = aa_scrheight (c);
+ p.supported = mask;
+ if (aa_formats[driver]->font == NULL)
+ p.font = aa_fonts[font];
+
+ data.format = aa_formats[driver];
+ data.name = name;
+ sc = aa_init (&save_d, &p, &data);
+ if (sc == NULL)
+ {
+ aa_print (0, 0, "Save driver initialization failed");
+ aa_flush (c);
+ sleep (3);
+ return;
+ }
+ memcpy (sc->imagebuffer, c->imagebuffer,
+ (aa_imgwidth (c) - 1) * aa_imgheight (c));
+ aa_renderpalette (sc, useaapalette ? aapalette : palette,
+ &aa_defrenderparams, 0, 0, aa_scrwidth (c),
+ aa_scrheight (c));
+ aa_flush (sc);
+ aa_close (sc);
+}
+
+static void
+aa_swinversion (struct uih_context *c)
+{
+ aa_defrenderparams.inversion ^= 1;
+}
+static int
+aa_inversion (struct uih_context *c)
+{
+ return (aa_defrenderparams.inversion);
+}
+static int aacurpalette = 0;
+static void
+aa_setXpalette (struct uih_context *c, int m)
+{
+ int i, s;
+ if (!m)
+ {
+ useaapalette = 0;
+ aa_display ();
+ return;
+ }
+ useaapalette = 1;
+ aacurpalette = m;
+ s = 1 << m;
+ s--;
+ for (i = 0; i < 255; i++)
+ {
+ aapalette[i] = (i & (s)) * 255 / s;
+ }
+}
+static int
+aa_getpalette (struct uih_context *c, int m)
+{
+ if (!useaapalette)
+ return (!m);
+ return (m == aacurpalette);
+}
+static void
+aa_dither (struct uih_context *c, int m)
+{
+ aa_defrenderparams.dither = m;
+}
+static int
+aa_getdither (struct uih_context *c, int mode)
+{
+ return ((int) aa_defrenderparams.dither == (int) mode);
+}
+
+
+static void
+aa_sfont (struct uih_context *co, int i)
+{
+ aa_setfont (c, aa_fonts[i]);
+}
+CONST static char *CONST name[] = {
+ "normal characters ",
+ "half bright(dim) ",
+ "double bright(bold) ",
+ "bold font ",
+ "reversed ",
+ "reserved characters ",
+ "non ascii characters ",
+ "leave menu",
+};
+CONST static char *CONST ttext[] = {
+ "Use XaoS palette",
+ "Black and white stripes",
+ "4 gray palette",
+ "16 gray palette",
+ "32 gray palette",
+ "64 gray palette",
+ "128 gray palette",
+ "256 gray palette"
+};
+static CONST int attribs[] = {
+ AA_NORMAL_MASK,
+ AA_DIM_MASK,
+ AA_BOLD_MASK,
+ AA_BOLDFONT_MASK,
+ AA_REVERSE_MASK,
+ AA_ALL,
+ AA_EIGHT,
+ 0
+};
+
+#define MYNATTRS (sizeof(name)/sizeof(char *))
+static void
+aa_swattr (struct uih_context *co, int m)
+{
+ int mask;
+ if (m < (int) MYNATTRS - 1)
+ {
+ mask = c->params.supported;
+ mask ^= attribs[m];
+ aa_setsupported (c, mask);
+ ui_menu ("aa_attr");
+ }
+}
+static int
+aa_getattr (struct uih_context *co, int m)
+{
+ return (c->params.supported & attribs[m]);
+}
+static int
+aa_getsave3 (struct uih_context *c, int m)
+{
+ return (mask & attribs[m]);
+}
+static void
+aa_save3 (struct uih_context *co, int m)
+{
+ if (m < (int) MYNATTRS - 1)
+ {
+ mask ^= attribs[m];
+ mask &= aa_formats[driver]->supported;
+ ui_menu ("aa_save3");
+ }
+ else
+ aa_save5 ();
+}
+static void
+aa_save2 (struct uih_context *cc, int m)
+{
+ aa_display ();
+ font = m;
+ mask = aa_formats[driver]->supported & c->params.supported;
+ if (!mask)
+ mask = aa_formats[driver]->supported;
+ ui_menu ("aa_save3");
+}
+static void
+aa_save (struct uih_context *c, int m)
+{
+ driver = m;
+ if (aa_formats[m]->font != NULL)
+ aa_save3 (NULL, 0);
+ else
+ ui_menu ("aa_save2");
+}
+
+#define UI (MENUFLAG_NOOPTION|MENUFLAG_NOPLAY)
+static CONST menuitem menuitems[] = {
+ SUBMENU ("file", NULL, "Save as text file", "aa_format"),
+ SUBMENU ("ui", NULL, "Attributes", "aa_attr"),
+ SUBMENU ("ui", NULL, "Font", "aa_font"),
+ MENUNOPCB ("ui", NULL, "Inversion", "aainversion", UI, aa_swinversion,
+ aa_inversion),
+ SUBMENU ("ui", NULL, "Dithering mode", "aa_dithering"),
+ SUBMENU ("", NULL, "Font for saved file", "aa_save2"),
+ SUBMENU ("", NULL, "Save attributes", "aa_save3"),
+ SUBMENU ("palettemenu", NULL, "Text palette", "aa_palette"),
+};
+
+static menuitem *fontmenus;
+static menuitem *fontmenus2;
+static menuitem *formatmenus;
+static int nfonts, nformats;
+static void
+aa_build_menus ()
+{
+ int i;
+ menu_add (menuitems, NITEMS (menuitems));
+ menu_genernumbered (sizeof (ttext) / sizeof (char *), "aa_palette", ttext,
+ NULL, MENU_INT, MENUFLAG_RADIO, aa_setXpalette,
+ aa_getpalette, "palettemenu");
+ menu_genernumbered (AA_DITHERTYPES, "aa_dithering",
+ (CONST char *CONST * CONST) aa_dithernames, NULL,
+ MENU_INT, MENUFLAG_RADIO, aa_dither, aa_getdither,
+ "dither");
+ menu_genernumbered (MYNATTRS, "aa_attr", name, NULL, MENU_INT,
+ MENUFLAG_RADIO, aa_swattr, aa_getattr, "attribute");
+ menu_genernumbered (MYNATTRS, "aa_save3", name, NULL, MENU_INT,
+ MENUFLAG_RADIO, aa_save3, aa_getsave3, "save");
+ for (i = 0; aa_fonts[i] != NULL; i++);
+ nfonts = i;
+ fontmenus = malloc (sizeof (menuitem) * i);
+ fontmenus2 = malloc (sizeof (menuitem) * i);
+ for (i = 0; aa_fonts[i] != NULL; i++)
+ {
+ char s[256];
+ sprintf (s, "font%i%s", i, aa_fonts[i]->shortname);
+ fontmenus[i].name = aa_fonts[i]->name;
+ fontmenus[i].shortname = strdup (s);
+ fontmenus[i].menuname = "aa_font";
+ fontmenus[i].key = NULL;
+ fontmenus[i].type = MENU_INT;
+ fontmenus[i].flags = UI;
+ fontmenus[i].iparam = i;
+ fontmenus[i].function = (void (*)(void)) aa_sfont;
+ fontmenus2[i].name = aa_fonts[i]->name;
+ fontmenus2[i].shortname = fontmenus[i].shortname;
+ fontmenus2[i].menuname = "aa_save2";
+ fontmenus2[i].key = NULL;
+ fontmenus2[i].type = MENU_INT;
+ fontmenus2[i].flags = UI;
+ fontmenus2[i].iparam = i;
+ fontmenus2[i].function = (void (*)(void)) aa_save2;
+ }
+ menu_add (fontmenus, nfonts);
+ menu_add (fontmenus2, nfonts);
+ for (i = 0; aa_formats[i] != NULL; i++);
+ nformats = i;
+ formatmenus = malloc (sizeof (menuitem) * i);
+ for (i = 0; aa_formats[i] != NULL; i++)
+ {
+ formatmenus[i].name = aa_formats[i]->formatname;
+ formatmenus[i].shortname = aa_formats[i]->formatname;
+ formatmenus[i].menuname = "aa_format";
+ formatmenus[i].key = NULL;
+ formatmenus[i].type = MENU_INT;
+ formatmenus[i].flags = UI;
+ formatmenus[i].iparam = i;
+ formatmenus[i].function = (void (*)(void)) aa_save;
+ }
+ menu_add (formatmenus, nformats);
+}
+static void
+aa_remove_menus ()
+{
+ int i;
+ menu_delnumbered (sizeof (ttext) / sizeof (char *), "palettemenu");
+ menu_delnumbered (AA_DITHERTYPES, "dither");
+ menu_delnumbered (MYNATTRS, "attribute");
+ menu_delnumbered (MYNATTRS, "save");
+ menu_delete (menuitems, NITEMS (menuitems));
+ menu_delete (fontmenus, nfonts);
+ menu_delete (fontmenus2, nfonts);
+ free (fontmenus2);
+ menu_delete (formatmenus, nformats);
+ free (formatmenus);
+ for (i = 0; aa_fonts[i] != NULL; i++)
+ {
+ free ((char *) fontmenus[i].shortname);
+ }
+ free (fontmenus);
+}
+static int cursorvisible = 1;
+static void
+aa_fflush (void)
+{
+ if (aa_cursorx < 0)
+ {
+ if (cursorvisible)
+ {
+ aa_gotoxy (c, 0, 0);
+ aa_hidecursor (c);
+ cursorvisible = 0;
+ }
+ }
+ else
+ {
+ aa_gotoxy (c, aa_cursorx, aa_cursory);
+ if (!cursorvisible)
+ aa_showcursor (c), cursorvisible = 1;
+ }
+ aa_flush (c);
+}
+
+static CONST struct params params[] = {
+ {"", P_HELP, NULL, "AA driver options:"},
+ {"-aadriver", P_STRING, &aadriver, "Select display driver used by aa-lib"},
+ {"-kbddriver", P_STRING, &kbddriver,
+ "Select keyboard driver used by aa-lib"},
+ {"-mousedriver", P_STRING, &mousedriver,
+ "Select keyboard driver used by aa-lib"},
+ {"-font", P_STRING, &deffont, "Select font"},
+ {"-width", P_NUMBER, &width, "Set width"},
+ {"-height", P_NUMBER, &height, "Set height"},
+ {"-minwidth", P_NUMBER, &minwidth, "Set minimal allowed width"},
+ {"-minheight", P_NUMBER, &minheight, "Set minimal allowed height"},
+ {"-maxwidth", P_NUMBER, &maxwidth, "Set maximal allowed width"},
+ {"-maxheight", P_NUMBER, &maxheight, "Set maximal allowed height"},
+ {"-recwidth", P_NUMBER, &recwidth, "Set recommended width"},
+ {"-recheight", P_NUMBER, &recheight, "Set recommended height"},
+ {"-normal", P_SWITCH, enable, "enable usage of narmal characters"},
+ {"-nonormal", P_SWITCH, disable, "disable usage of narmal characters"},
+ {"-dim", P_SWITCH, enable + 1,
+ "enable usage of dim(half bright) characters"},
+ {"-nodim", P_SWITCH, disable + 1,
+ "disable usage of dim(half bright) characters"},
+ {"-bold", P_SWITCH, enable + 2,
+ "enable usage of bold(double bright) characters"},
+ {"-nobold", P_SWITCH, disable + 2,
+ "disable usage of bold(double bright) characters"},
+ {"-boldfont", P_SWITCH, enable + 3, "enable usage of boldfont characters"},
+ {"-noboldfont", P_SWITCH, disable + 3,
+ "disable usage of boldfont characters"},
+ {"-reverse", P_SWITCH, enable + 4, "enable usage of reversed characters"},
+ {"-noreverse", P_SWITCH, disable + 4,
+ "disable usage of reversed characters"},
+ {"-all", P_SWITCH, enable + 5, "enable usage of reserved characters"},
+ {"-eight", P_SWITCH, enable + 6, "enable usage of non ansii characters"},
+ {"-extended", P_SWITCH, &extended,
+ "enable usage of extended character set"},
+ {"-inverse", P_SWITCH, &inverse, "enable inverse"},
+ {"-bright", P_NUMBER, &bright, "set bright (0-255)"},
+ {"-contrast", P_NUMBER, &contrast, "set contrast (0-255)"},
+ {"-gamma", P_FLOAT, &aa_gamma, "set famma (0-1)"},
+ {"-nodither", P_SWITCH, dithering, "Disable dithering"},
+ {"-floyd_steinberg", P_SWITCH, dithering + 2,
+ "Enable floyd steinberg dithering"},
+ {"-error_distribution", P_SWITCH, dithering + 1,
+ "Enable error distribution dithering"},
+ {"-random", P_NUMBER, &randomval, "Set random dithering value"},
+ {"-dimmul", P_FLOAT, &dimmul, "Multiply factor for dim color (5.3)"},
+ {"-boldmul", P_FLOAT, &boldmul, "Multiply factor for bold color (5.3)"},
+ {"-nomouse", P_SWITCH, &nomouse, "Disable mouse"},
+ {NULL, 0, NULL, NULL}
+};
+
+struct ui_driver aalib_driver = {
+ "aa",
+ aa_initialize,
+ aa_getsize,
+ aa_processevents,
+ aa_get_mouse,
+ aa_uninitialise,
+ NULL, /*You should implement just one */
+ aa_set_palette, /*of these and add NULL as second */
+ aa_print,
+ aa_display,
+ aa_alloc_buffers,
+ aa_free_buffers,
+ aa_flip_buffers,
+ aa_mousetype,
+ aa_fflush,
+ 2, /*text width */
+ 2, /*text height */
+ params,
+ PALETTE_REDISPLAYS | SCREENSIZE | UPDATE_AFTER_RESIZE | AALIB, /*flags...see ui.h */
+ 0.0, 0.0, /*width/height of screen in centimeters */
+ 0, 0, /*resolution of screen for windowed systems */
+ UI_C256, /*Image type */
+ 0, 255, 255 /*start, end of palette and maximum allocatable */
+ /*entries */
+};
+
+#endif
diff --git a/src/ui/ui-drv/cocoa/AppController.h b/src/ui/ui-drv/cocoa/AppController.h
new file mode 100644
index 0000000..324eaff
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/AppController.h
@@ -0,0 +1,59 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * Cocoa Driver by J.B. Langston III (jb-langston@austin.rr.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#import <Cocoa/Cocoa.h>
+#import <Carbon/Carbon.h>
+
+#import "FractalView.h"
+#include "ui.h"
+@ class VideatorProxy;
+
+@interface AppController:NSObject {
+ FractalView *view;
+ NSWindow *window;
+ BOOL applicationIsLaunched;
+}
+
+#pragma mark Accessors
+-(FractalView *) view;
+
+#pragma mark Driver Initialization
+-(void) initLocale;
+-(int) initDriver:(struct ui_driver *)driver fullscreen:(BOOL) fullscreen;
+-(void) uninitDriver;
+
+#pragma mark Menus
+-(void) localizeApplicationMenu;
+-(void) performMenuAction:(NSMenuItem *) sender;
+-(NSString *) keyEquivalentForName:(NSString *) name;
+-(void) buildMenuWithContext:(struct uih_context *)context name:(CONST char *) name;
+-(void) buildMenuWithContext:(struct uih_context *)context name:(CONST char *)menuName parent:(NSMenu *) parentMenu;
+-(void) buildMenuWithContext:(struct uih_context *)context name:(CONST char *)menuName parent:(NSMenu *)parentMenu isNumbered:(BOOL) isNumbered;
+-(void) showPopUpMenuWithContext:(struct uih_context *)context name:(CONST char *) name;
+
+#pragma mark Dialogs
+-(void) showDialogWithContext:(struct uih_context *)context name:(CONST char *) name;
+
+#pragma mark Help
+-(void) showHelpWithContext:(struct uih_context *)context name:(CONST char *) name;
+@end extern AppController *controller;
diff --git a/src/ui/ui-drv/cocoa/AppController.m b/src/ui/ui-drv/cocoa/AppController.m
new file mode 100644
index 0000000..6f03b97
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/AppController.m
@@ -0,0 +1,542 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * Cocoa Driver by J.B. Langston III (jb-langston@austin.rr.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#import "AppController.h"
+#import "CustomDialog.h"
+#import "VideatorProxy.h"
+#import "ui.h"
+
+#ifdef HAVE_GETTEXT
+#include <libintl.h>
+#include <locale.h>
+#define _(string) gettext(string)
+#else
+#define _(string) (string)
+#endif
+
+/*
+ * This category overrides standard NSWindow behavior which prevents a window
+ * from receiving keyboard events unless it has a titlebar. Without this, the
+ * keyboard doesn't work in full screen mode.
+ */
+@implementation NSWindow (CanBecomeKeyWindowOverride)
+- (BOOL)canBecomeKeyWindow {
+ return YES;
+}
+@end
+
+
+AppController *controller;
+
+@implementation AppController
+
+
+#pragma mark Initialization
+- (id)init {
+ self = [super init];
+ if (self) {
+ applicationIsLaunched = NO;
+ [self initLocale];
+ }
+ return self;
+}
+
+#pragma mark Accessors
+
+- (FractalView *)view {
+ return view;
+}
+
+#pragma mark Driver Initialization
+
+- (void)initLocale {
+ /*
+ * The LANG environment variables used by gettext to determine the locale
+ * are not normally set on Mac OS X, so we use the Cocoa API to retrieve
+ * the list of preferred languages and set the LANG variable accordingly.
+ */
+
+ NSString *myLocalePath = [[[NSBundle mainBundle] resourcePath]
+ stringByAppendingPathComponent:@"locale"];
+
+#ifdef USE_LOCALEPATH
+ /*
+ * This is a global variable defined in ui.h, which the main function uses
+ * to locate the locale files when USE_LOCALEPATH is defined. If it is
+ * undefined, the main function will use the hard coded locale path instead.
+ */
+ localepath = (char *)[myLocalePath UTF8String];
+#endif
+
+ /*
+ * Each of the locales we support is stored in its own subdirectory in the
+ * Resources/locale directory. The name of the directory corresponds to the
+ * ISO code for the locale. Therefore, a list of the files in this
+ * directory conveniently serves as a list of supported locales.
+ */
+ NSMutableArray *supportedLanguages = [[[NSFileManager defaultManager]
+ directoryContentsAtPath:myLocalePath]
+ mutableCopy];
+
+ /* English is supported by default, so there isn't a locale directory for
+ * it. But in order to match it with the user's preferred languages, it
+ * still has to be in the array of supported languages.
+ */
+ [supportedLanguages addObject:@"en"];
+
+ /*
+ * The AppleLanguages user default returns an array of languages sorted
+ * according to the User's settings in the International Preference Panel.
+ * We find the best match between the supported and preferred locales
+ * and set the LANG variable to that.
+ */
+ NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
+ NSArray *preferredLanguages = [defaults objectForKey:@"AppleLanguages"];
+ NSString *lang = [preferredLanguages firstObjectCommonWithArray:supportedLanguages];
+ if (lang) setenv("LANG", [lang UTF8String], /*overwrite? */ 0);
+
+ [supportedLanguages release];
+}
+
+- (int)initDriver:(struct ui_driver *)driver
+ fullscreen:(BOOL)fullscreen {
+ /*
+ * Calculate the pixel size in cm. userSpaceScaleFactor returns:
+ * pixels per per point
+ * pixels per inch = pixels per point * 72.0
+ * inches per pixel = 1 / pixels per inch
+ * cm per pixel = inches per pixel * 2.54
+ */
+ CGDirectDisplayID displayID = (CGDirectDisplayID)[[[[NSScreen mainScreen] deviceDescription] objectForKey:@"NSScreenNumber"] intValue];
+ CGSize displaySize = CGDisplayScreenSize(displayID);
+ NSSize displayResolution = [[NSScreen mainScreen] frame].size;
+ driver->width = (displaySize.width/displayResolution.width)/10;
+ driver->height = (displaySize.height/displayResolution.height)/10;
+
+ if (fullscreen) {
+ /*
+ * SetSystemUIMode is the easiest way to make a full screen application.
+ * It's Carbon, but it should be 64-bit safe. kUIModeAllHidden hides
+ * the dock and menuBar and kUIOptionAutoShowMenuBar causes the menubar
+ * to automatically slide in when the user moves the mouse to the top
+ * edge of the screen.
+ */
+ SetSystemUIMode(kUIModeAllHidden, kUIOptionAutoShowMenuBar);
+ window = [[NSWindow alloc] initWithContentRect:[[NSScreen mainScreen] frame]
+ styleMask:NSBorderlessWindowMask
+ backing:NSBackingStoreBuffered
+ defer:YES];
+ } else {
+ window = [[NSWindow alloc] initWithContentRect:NSMakeRect(50, 50, 640, 480)
+ styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask)
+ backing:NSBackingStoreBuffered
+ defer:YES];
+ [window setFrameAutosaveName:@"XaoSWindow"];
+ }
+
+ view = [[FractalView alloc] initWithFrame:[[window contentView] frame]];
+ [view setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
+ [[window contentView] addSubview:view];
+ [window makeFirstResponder:view];
+ [window setDelegate:self];
+ [window setTitle:@"XaoS"];
+ [window makeKeyAndOrderFront:self];
+ [NSApp setDelegate:self];
+
+ /*
+ * These tasks should only be done once, when the application first launches
+ * but for various reasons, they can't be done until after the main run
+ * loop has started. That's why we put them in the driver init code.
+ */
+ if (!applicationIsLaunched) {
+ [self localizeApplicationMenu];
+ [NSApp finishLaunching];
+ applicationIsLaunched = YES;
+ }
+
+ return 1; // 1 for success; 0 for failure
+}
+
+- (void)uninitDriver {
+ SetSystemUIMode(kUIModeNormal, 0);
+ [view release];
+ [window release];
+}
+
+#pragma mark Menus
+
+- (void)localizeApplicationMenu {
+ /*
+ * Internationalize XaoS application menu. We do this via code instead
+ * of within the nib because this allows all i18n to be cross-platform and
+ * self-contained within the po file instead of spread across many places.
+ */
+ NSMenu *appMenu = [[[NSApp mainMenu] itemAtIndex:0] submenu];
+
+ [[appMenu itemWithTitle:@"About XaoS"]
+ setTitle:[NSString stringWithUTF8String:_("About XaoS")]];
+
+ [[appMenu itemWithTitle:@"Services"]
+ setTitle:[NSString stringWithUTF8String:_("Services")]];
+
+ [[appMenu itemWithTitle:@"Hide XaoS"]
+ setTitle:[NSString stringWithUTF8String:_("Hide XaoS")]];
+
+ [[appMenu itemWithTitle:@"Hide Others"]
+ setTitle:[NSString stringWithUTF8String:_("Hide Others")]];
+
+ [[appMenu itemWithTitle:@"Show All"]
+ setTitle:[NSString stringWithUTF8String:_("Show All")]];
+
+ [[appMenu itemWithTitle:@"Quit XaoS"]
+ setTitle:[NSString stringWithUTF8String:_("Quit XaoS")]];
+}
+
+- (void)performMenuAction:(NSMenuItem *)sender {
+ /*
+ * Find the XaoS menu item associated with the sending Cocoa menu item
+ * then invoke the callback to perform that action.
+ */
+ NSString *name = [sender representedObject];
+ CONST menuitem *item = menu_findcommand([name UTF8String]);
+
+ ui_menuactivate(item, NULL);
+}
+
+- (NSString *)keyEquivalentForName:(NSString *)name {
+ // If you want more command-keys, just add them here based on their name:
+ if ([name isEqualToString:@"undo"]) return @"z";
+ if ([name isEqualToString:@"redo"]) return @"Z";
+ if ([name isEqualToString:@"loadpos"]) return @"o";
+ if ([name isEqualToString:@"savepos"]) return @"s";
+ return @"";
+}
+
+- (void)buildMenuWithContext:(struct uih_context *)context
+ name:(CONST char *)name {
+ NSMenu *menu = [NSApp mainMenu];
+ while ([menu numberOfItems] > 1)
+ [menu removeItemAtIndex:1];
+ [self buildMenuWithContext:context name:name parent:menu];
+}
+
+- (void)buildMenuWithContext:(struct uih_context *)context
+ name:(CONST char *)menuName
+ parent:(NSMenu *)parentMenu {
+ [self buildMenuWithContext:context
+ name:menuName
+ parent:parentMenu
+ isNumbered:NO];
+}
+
+- (void)buildMenuWithContext:(struct uih_context *)context
+ name:(CONST char *)menuName
+ parent:(NSMenu *)parentMenu
+ isNumbered:(BOOL)isNumbered {
+ int i, n;
+ CONST menuitem *item;
+ for (i=0,n=1; (item = menu_item(menuName, i)) != NULL; i++) {
+ if (item->type == MENU_SEPARATOR) {
+ [parentMenu addItem:[NSMenuItem separatorItem]];
+ } else {
+ NSString *menuTitle = [NSString stringWithUTF8String:item->name];
+
+ /*
+ * Add elipses to menu items that open dialogs in order to conform
+ * with the Apple Human Interface Guidelines.
+ */
+ if (item->type == MENU_CUSTOMDIALOG || item->type == MENU_DIALOG)
+ menuTitle = [menuTitle stringByAppendingString:@"..."];
+
+ NSString *menuShortName = [NSString stringWithUTF8String:item->shortname];
+ NSString *keyEquiv = [self keyEquivalentForName:menuShortName];
+
+ /*
+ * Add classic XaoS key accelerator to name in parenthesis, unless
+ * this is the main menu. This allows both Mac-style and Xaos-style
+ * key equivalents to co-exist.
+ */
+ if (item->key && parentMenu != [NSApp mainMenu])
+ menuTitle = [NSString stringWithFormat:@"%@ (%s)", menuTitle, item->key];
+
+ NSMenuItem *newItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:menuTitle action:nil keyEquivalent:keyEquiv];
+
+ /*
+ * If this is a numbered pop-up menu, override the default key
+ * accelerator with a number or letter based on the position in
+ * the menu.
+ */
+ if (isNumbered && item->type != MENU_SUBMENU) {
+ if (n < 10)
+ keyEquiv = [NSString stringWithFormat:@"%d", n];
+ else if (n == 10)
+ keyEquiv = @"0";
+ else if (n < 36)
+ keyEquiv = [NSString stringWithFormat:@"%c", 'a' + n - 11];
+
+ [newItem setKeyEquivalent:keyEquiv];
+ [newItem setKeyEquivalentModifierMask:0];
+ n++;
+ }
+
+ if (item->type == MENU_SUBMENU) {
+ /* Recursively build submenus */
+ NSMenu *newMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:menuTitle];
+ [newMenu setDelegate:self];
+ [newItem setSubmenu:newMenu];
+ [self buildMenuWithContext:context name:item->shortname parent:newMenu];
+
+ /* Conditionally add special items to certain menus */
+
+ /*
+ * These items are necessary to provide the expected keyboard
+ * equivalents for cut & paste operations in custom dialogs
+ * and to conform to the human interface guidelines
+ */
+ if ([menuShortName isEqualToString:@"edit"]) {
+ [newMenu addItem:[NSMenuItem separatorItem]];
+ [newMenu addItemWithTitle:[NSString stringWithUTF8String:_("Cut")]
+ action:@selector(cut:) keyEquivalent:@"x"];
+
+ [newMenu addItemWithTitle:[NSString stringWithUTF8String:_("Copy")]
+ action:@selector(copy:) keyEquivalent:@"c"];
+
+ [newMenu addItemWithTitle:[NSString stringWithUTF8String:_("Paste")]
+ action:@selector(paste:) keyEquivalent:@"v"];
+
+ [newMenu addItemWithTitle:[NSString stringWithUTF8String:_("Delete")]
+ action:@selector(delete:) keyEquivalent:@""];
+
+ [newMenu addItemWithTitle:[NSString stringWithUTF8String:_("Select All")]
+ action:@selector(selectAll:) keyEquivalent:@"a"];
+ }
+
+ /*
+ * These items in the window menu are necessary to provide expected
+ * keyboard equivalents for menu operations such as minimizing and
+ * to conform with the human interface guidelnes.
+ */
+ if ([menuShortName isEqualToString:@"window"]) {
+ [newMenu addItemWithTitle:[NSString stringWithUTF8String:_("Minimize")]
+ action:@selector(performMiniaturize:) keyEquivalent:@"m"];
+
+ [newMenu addItemWithTitle:[NSString stringWithUTF8String:_("Zoom")]
+ action:@selector(performZoom:) keyEquivalent:@""];
+
+ [newMenu addItem:[NSMenuItem separatorItem]];
+
+ [newMenu addItemWithTitle:[NSString stringWithUTF8String:_("Bring All to Front")]
+ action:@selector(arrangeInFront:) keyEquivalent:@""];
+ }
+
+ /*
+ * The close menu item in the File menu is necessary to provide
+ * the expected Command-W close window keyboard equivalent and
+ * to conform with the human interface guidelines.
+ */
+ if ([menuShortName isEqualToString:@"file"]) {
+ int i = [newMenu indexOfItemWithRepresentedObject:@"savepos"];
+ [newMenu insertItemWithTitle:[NSString stringWithUTF8String:_("Close")]
+ action:@selector(performClose:)
+ keyEquivalent:@"w"
+ atIndex:i];
+ [newMenu insertItem:[NSMenuItem separatorItem] atIndex:i];
+ }
+
+ /*
+ * Add Videator Output menu item in the UI menu just below
+ * VJ Mode. This will toggle sending video feed to Videator.
+ */
+#ifdef VIDEATOR_SUPPORT
+ if ([menuShortName isEqualToString:@"ui"]) {
+ int i = [newMenu indexOfItemWithRepresentedObject:@"inhibittextoutput"]+1;
+ NSMenuItem *item = [newMenu insertItemWithTitle:[NSString stringWithUTF8String:_("Videator Output")]
+ action:@selector(toggleVideator:)
+ keyEquivalent:@""
+ atIndex:i];
+ [item setTarget:[view videatorProxy]];
+ [item setRepresentedObject:@"videator"];
+ }
+#endif
+
+ [newMenu release];
+ } else {
+ /*
+ * Set action for leaf menu items to generic callback function
+ * and save the short name as the item's represented object. When
+ * the callback is activated, it will find the XaoS menu item
+ * to activate based on the represented object.
+ */
+ [newItem setTarget:self];
+ [newItem setAction:@selector(performMenuAction:)];
+ [newItem setRepresentedObject:menuShortName];
+ if (item->flags & (MENUFLAG_RADIO | MENUFLAG_CHECKBOX) && menu_enabled (item, context))
+ [newItem setState:NSOnState];
+ }
+
+ [parentMenu addItem:newItem];
+ [newItem release];
+ }
+ }
+}
+
+- (void)menuNeedsUpdate:(NSMenu *)menu {
+ CONST struct menuitem *xaosItem;
+ NSMenuItem *menuItem;
+ NSEnumerator *itemEnumerator = [[menu itemArray] objectEnumerator];
+ while (menuItem = [itemEnumerator nextObject]) {
+ if ([menuItem representedObject]) {
+ xaosItem = menu_findcommand([[menuItem representedObject] UTF8String]);
+ if (xaosItem)
+ [menuItem setState:(menu_enabled(xaosItem, globaluih) ? NSOnState : NSOffState)];
+#ifdef VIDEATOR_SUPPORT
+ else if ([[menuItem representedObject] isEqualToString:@"videator"])
+ [menuItem setState:([[view videatorProxy] videatorEnabled] ? NSOnState : NSOffState)];
+#endif
+ }
+ }
+}
+
+- (void)showPopUpMenuWithContext:(struct uih_context *)context
+ name:(CONST char *)name {
+ NSMenu *popUpMenu = [[NSMenu alloc] initWithTitle:@"Popup Menu"];
+ NSPopUpButtonCell *popUpButtonCell = [[NSPopUpButtonCell alloc] initTextCell:@"" pullsDown:NO];
+ NSRect frame = {{0.0, 0.0}, {0.0, 0.0}};
+ frame.origin = [window mouseLocationOutsideOfEventStream];
+ [self buildMenuWithContext:context name:name parent:popUpMenu isNumbered:YES];
+ int state = [[popUpMenu itemAtIndex:0] state];
+ [popUpButtonCell setMenu:popUpMenu];
+ [[popUpMenu itemAtIndex:0] setState:state];
+ [popUpButtonCell performClickWithFrame:frame inView:view];
+ [popUpButtonCell release];
+ [popUpMenu release];
+}
+
+#pragma mark Dialogs
+
+- (void)showDialogWithContext:(struct uih_context *)context
+ name:(CONST char *)name {
+ CONST menuitem *item = menu_findcommand (name);
+ if (!item) return;
+
+ CONST menudialog *dialog = menu_getdialog (context, item);
+ if (!dialog) return;
+
+ int nitems;
+ for (nitems = 0; dialog[nitems].question; nitems++);
+
+ if (nitems == 1 && (dialog[0].type == DIALOG_IFILE || dialog[0].type == DIALOG_OFILE)) {
+ NSString *extension = [[NSString stringWithUTF8String:dialog[0].defstr] pathExtension];
+
+ NSString *fileName = nil;
+ switch(dialog[0].type) {
+ case DIALOG_IFILE:
+ {
+ NSOpenPanel *oPanel = [NSOpenPanel openPanel];
+
+ int result = [oPanel runModalForDirectory:nil
+ file:nil
+ types:[NSArray arrayWithObject:extension]];
+
+ if (result == NSOKButton)
+ fileName = [oPanel filename];
+ break;
+ }
+ case DIALOG_OFILE:
+ {
+ NSSavePanel *sPanel = [NSSavePanel savePanel];
+ [sPanel setRequiredFileType:extension];
+
+ int result = [sPanel runModalForDirectory:nil file:@"untitled"];
+
+ if (result == NSOKButton)
+ fileName = [sPanel filename];
+ break;
+ }
+ }
+
+ [window makeKeyAndOrderFront:self];
+
+ if (fileName) {
+ dialogparam *param = malloc (sizeof (dialogparam));
+ param->dstring = strdup([fileName UTF8String]);
+ ui_menuactivate (item, param);
+ }
+
+ } else {
+ CustomDialog *customDialog = [[CustomDialog alloc] initWithContext:context
+ menuItem:item
+ dialog:dialog];
+ [NSApp beginSheet:customDialog
+ modalForWindow:window
+ modalDelegate:nil
+ didEndSelector:nil
+ contextInfo:nil];
+ [NSApp runModalForWindow:customDialog];
+ [NSApp endSheet:customDialog];
+ [customDialog orderOut:self];
+ [window makeKeyAndOrderFront:self];
+
+ if ([customDialog params])
+ ui_menuactivate(item, [customDialog params]);
+
+ [customDialog release];
+ }
+}
+
+#pragma mark Help
+
+- (void)showHelpWithContext:(struct uih_context *)context
+ name:(CONST char *)name {
+ NSString *anchor = [NSString stringWithUTF8String:name];
+ [[NSHelpManager sharedHelpManager] openHelpAnchor:anchor inBook:@"XaoS Help"];
+}
+
+#pragma mark Window Delegates
+
+- (void)windowWillClose:(NSNotification *)notification {
+ [NSApp terminate:self];
+}
+
+- (void)windowDidResize:(NSNotification *)notification {
+ // Handle maximize/zoom, but ignore live resizing
+ if (![view inLiveResize])
+ ui_resize();
+}
+
+#pragma mark Application Delegates
+
+- (BOOL)application:(NSApplication *)theApplication
+ openFile:(NSString *)filename {
+ if ([[filename pathExtension] isEqualToString:@"xpf"]) {
+ uih_loadfile(globaluih, [filename UTF8String]);
+ return YES;
+ } else if ([[filename pathExtension] isEqualToString:@"xaf"]) {
+ uih_playfile(globaluih, [filename UTF8String]);
+ return YES;
+ } else {
+ return NO;
+ }
+}
+
+@end \ No newline at end of file
diff --git a/src/ui/ui-drv/cocoa/CustomDialog.h b/src/ui/ui-drv/cocoa/CustomDialog.h
new file mode 100644
index 0000000..2821022
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/CustomDialog.h
@@ -0,0 +1,38 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * Cocoa Driver by J.B. Langston III (jb-langston@austin.rr.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#import <Cocoa/Cocoa.h>
+#include "ui.h"
+
+@ interface CustomDialog:NSWindow {
+ struct uih_context *context;
+ CONST menuitem *item;
+ CONST menudialog *dialog;
+ dialogparam *params;
+ NSMutableDictionary *controls;
+}
+
+-(id) initWithContext:(struct uih_context *)context menuItem:(CONST menuitem *)item dialog:(CONST menudialog *) dialog;
+-(dialogparam *) params;
+
+@end
diff --git a/src/ui/ui-drv/cocoa/CustomDialog.m b/src/ui/ui-drv/cocoa/CustomDialog.m
new file mode 100644
index 0000000..5cac7df
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/CustomDialog.m
@@ -0,0 +1,433 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * Cocoa Driver by J.B. Langston III (jb-langston@austin.rr.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#import "CustomDialog.h"
+
+#ifdef HAVE_GETTEXT
+#include <libintl.h>
+#include <locale.h>
+#define _(string) gettext(string)
+#else
+#define _(string) (string)
+#endif
+
+#define MARGIN 20
+#define SPACING 8
+
+@implementation CustomDialog
+
+#pragma mark Initialization
+
+- (id)initWithContext:(struct uih_context *)myContext
+ menuItem:(CONST menuitem *)myItem
+ dialog:(CONST menudialog *)myDialog {
+
+ NSRect windowRect = NSMakeRect(200, 200, 300, 107);
+ NSRect helpButtonRect = NSMakeRect(20, 20, 25, 25);
+ NSRect cancelButtonRect = NSMakeRect(128, 20, 75, 25);
+ NSRect okButtonRect = NSMakeRect(210, 20, 75, 25);
+ NSRect labelRect = NSMakeRect(20, 67, 62, 17);
+ NSRect controlRect = NSMakeRect(90, 65, 190, 22);
+ NSRect coordRect = NSMakeRect(90, 65, 85, 22);
+
+ self = [super initWithContentRect:windowRect
+ styleMask:NSTitledWindowMask
+ backing:NSBackingStoreBuffered
+ defer:YES];
+
+ if (self) {
+ context = myContext;
+ item = myItem;
+ dialog = myDialog;
+
+ [self setTitle:[NSString stringWithUTF8String:item->name]];
+
+ controls = [[NSMutableDictionary alloc] initWithCapacity:10];
+
+ NSMutableArray *labels = [[NSMutableArray alloc] initWithCapacity:10];
+
+ int maxLabelWidth = 0, maxControlWidth = 0, nitems = 0, i = 0;
+
+ for (nitems = 0; dialog[nitems].question; nitems++);
+
+ for (i = 0; i < nitems; i++) {
+ NSTextField *label = [[NSTextField alloc] initWithFrame:labelRect];
+ NSString *question = [NSString stringWithUTF8String:dialog[i].question];
+ [label setEditable:NO];
+ [label setBezeled:NO];
+ [label setDrawsBackground:NO];
+ [label setStringValue:question];
+
+ [label sizeToFit];
+ if ([label frame].size.width > maxLabelWidth)
+ maxLabelWidth = [label frame].size.width;
+
+ [[self contentView] addSubview:label];
+ [labels addObject:label];
+ [label release];
+
+ switch (dialog[i].type) {
+ case DIALOG_INT:
+ case DIALOG_FLOAT:
+ case DIALOG_STRING:
+ case DIALOG_KEYSTRING:
+ {
+ NSTextField *textField = [[NSTextField alloc] initWithFrame:controlRect];
+ [textField setEditable:YES];
+ [textField setBezeled:YES];
+ [textField setBezelStyle:NSTextFieldSquareBezel];
+ [[textField cell] setScrollable:YES];
+ switch (dialog[i].type) {
+ case DIALOG_INT:
+ [textField setIntValue:dialog[i].defint];
+ break;
+ case DIALOG_FLOAT:
+ [textField setDoubleValue:dialog[i].deffloat];
+ break;
+ case DIALOG_STRING:
+ [textField setStringValue:[NSString stringWithUTF8String:dialog[i].defstr]];
+ break;
+ case DIALOG_KEYSTRING:
+ [textField setStringValue:[NSString stringWithUTF8String:dialog[i].defstr]];
+ break;
+ }
+
+ if ([textField frame].size.width > maxControlWidth)
+ maxControlWidth = [textField frame].size.width;
+
+ [[self contentView] addSubview:textField];
+ [controls setValue:textField forKey:question];
+ [textField release];
+
+ break;
+ }
+ case DIALOG_IFILE:
+ case DIALOG_OFILE:
+ {
+ NSTextField *textField = [[NSTextField alloc] initWithFrame:controlRect];
+ [textField setEditable:NO];
+ [textField setBezeled:YES];
+ [textField setBezelStyle:NSTextFieldSquareBezel];
+ [[textField cell] setScrollable:YES];
+ [textField setStringValue:[NSString stringWithUTF8String:dialog[i].defstr]];
+ [[textField cell] setRepresentedObject:[NSString stringWithUTF8String:dialog[i].defstr]];
+
+ if ([textField frame].size.width > maxControlWidth)
+ maxControlWidth = [textField frame].size.width;
+
+ [[self contentView] addSubview:textField];
+ [controls setValue:textField forKey:question];
+
+ NSButton *chooseButton = [[NSButton alloc] initWithFrame:okButtonRect];
+ [chooseButton setTitle:[NSString stringWithUTF8String:_("Choose")]];
+ [chooseButton setButtonType:NSMomentaryPushInButton];
+ [chooseButton setBezelStyle:NSRoundedBezelStyle];
+ [chooseButton setTarget:self];
+ if (dialog[i].type == DIALOG_IFILE)
+ [chooseButton setAction:@selector(chooseInput:)];
+ else
+ [chooseButton setAction:@selector(chooseOutput:)];
+ [[chooseButton cell] setRepresentedObject:textField];
+
+ [[self contentView] addSubview:chooseButton];
+ [controls setValue:chooseButton forKey:[question stringByAppendingString:@"choose"]];
+
+ if ([textField frame].size.width + SPACING + [chooseButton frame].size.width > maxControlWidth)
+ maxControlWidth = [textField frame].size.width + SPACING + [chooseButton frame].size.width;
+
+ [chooseButton release];
+ [textField release];
+ break;
+ }
+ case DIALOG_CHOICE:
+ {
+
+ NSPopUpButton *popupButton = [[NSPopUpButton alloc] initWithFrame:controlRect];
+
+ NSMenu *menu = [[NSMenu alloc] initWithTitle:@""];
+ CONST char **str = (CONST char **) dialog[i].defstr;
+ int y;
+ for (y = 0; str[y] != NULL; y++)
+ {
+ NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithUTF8String:str[y]] action:nil keyEquivalent:@""];
+ [menu addItem:menuItem];
+ [menuItem release];
+ }
+ [popupButton setMenu:menu];
+ [menu release];
+ [popupButton selectItemAtIndex:dialog[i].defint];
+
+ [popupButton sizeToFit];
+ if ([popupButton frame].size.width > maxControlWidth)
+ maxControlWidth = [popupButton frame].size.width;
+
+ [[self contentView] addSubview:popupButton];
+ [controls setValue:popupButton forKey:question];
+ [popupButton release];
+
+ break;
+ }
+ case DIALOG_ONOFF:
+ {
+ break;
+ }
+ case DIALOG_COORD:
+ {
+ int coordWidth = 0;
+ NSTextField *textField = [[NSTextField alloc] initWithFrame:coordRect];
+ [textField setEditable:YES];
+ [textField setBezeled:YES];
+ [textField setBezelStyle:NSTextFieldSquareBezel];
+ [[textField cell] setScrollable:YES];
+ [textField setDoubleValue:dialog[i].deffloat];
+
+ coordWidth += [textField frame].size.width;
+
+ [[self contentView] addSubview:textField];
+ [controls setValue:textField forKey:question];
+ [textField release];
+
+ textField = [[NSTextField alloc] initWithFrame:labelRect];
+ [textField setEditable:NO];
+ [textField setBezeled:NO];
+ [textField setDrawsBackground:NO];
+ [textField setStringValue:@"+"];
+
+ [textField sizeToFit];
+ coordWidth += [textField frame].size.width;
+
+ [[self contentView] addSubview:textField];
+ [controls setValue:textField forKey:[question stringByAppendingString:@"+"]];
+ [textField release];
+
+ textField = [[NSTextField alloc] initWithFrame:coordRect];
+ [textField setEditable:YES];
+ [textField setBezeled:YES];
+ [textField setBezelStyle:NSTextFieldSquareBezel];
+ [[textField cell] setScrollable:YES];
+ [textField setDoubleValue:dialog[i].deffloat2];
+
+ coordWidth += [textField frame].size.width;
+
+ [[self contentView] addSubview:textField];
+ [controls setValue:textField forKey:[question stringByAppendingString:@"2"]];
+ [textField release];
+
+ textField = [[NSTextField alloc] initWithFrame:labelRect];
+ [textField setEditable:NO];
+ [textField setBezeled:NO];
+ [textField setDrawsBackground:NO];
+ [textField setStringValue:@"i"];
+
+ [textField sizeToFit];
+ coordWidth += [textField frame].size.width;
+
+ [[self contentView] addSubview:textField];
+ [controls setValue:textField forKey:[question stringByAppendingString:@"i"]];
+ [textField release];
+
+ if (coordWidth > maxControlWidth)
+ maxControlWidth = coordWidth;
+ }
+ }
+ if (MARGIN + maxLabelWidth + SPACING + maxControlWidth + MARGIN > windowRect.size.width)
+ windowRect.size.width = MARGIN + maxLabelWidth + SPACING + maxControlWidth + MARGIN;
+ }
+
+ controlRect.origin.x = labelRect.origin.x + maxLabelWidth + SPACING;
+
+ for (i = nitems-1; i >= 0; i--) {
+ NSTextField *label = [labels objectAtIndex:i];
+ NSControl *control = [controls objectForKey:[label stringValue]];
+ [label setFrameOrigin:labelRect.origin];
+
+ [control setFrameOrigin:controlRect.origin];
+
+ switch (dialog[i].type) {
+ case DIALOG_IFILE:
+ case DIALOG_OFILE:
+ {
+ NSButton *chooseButton = [controls objectForKey:[[label stringValue] stringByAppendingString:@"choose"]];
+ [chooseButton setFrameOrigin:NSMakePoint([control frame].origin.x + [control frame].size.width + SPACING, [control frame].origin.y - 2)];
+ break;
+ }
+ case DIALOG_COORD:
+ {
+ NSRect controlRect2 = controlRect;
+ controlRect2.origin.x += [control frame].size.width;
+ control = [controls objectForKey:[[label stringValue] stringByAppendingString:@"+"]];
+ [control setFrameOrigin:controlRect2.origin];
+ controlRect2.origin.x += [control frame].size.width;
+ control = [controls objectForKey:[[label stringValue] stringByAppendingString:@"2"]];
+ [control setFrameOrigin:controlRect2.origin];
+ controlRect2.origin.x += [control frame].size.width;
+ control = [controls objectForKey:[[label stringValue] stringByAppendingString:@"i"]];
+ [control setFrameOrigin:controlRect2.origin];
+ control = [controls objectForKey:[label stringValue]];
+ }
+ }
+
+ labelRect.origin.y += SPACING + [control frame].size.height;
+ controlRect.origin.y += SPACING + [control frame].size.height;
+ }
+
+ controlRect.origin.y += MARGIN;
+
+ windowRect.size.height = controlRect.origin.y;
+
+ okButtonRect.origin.x += windowRect.size.width - [self frame].size.width;
+ cancelButtonRect.origin.x += windowRect.size.width - [self frame].size.width;
+
+ NSButton *okButton = [[NSButton alloc] initWithFrame:okButtonRect];
+ [okButton setTitle:[NSString stringWithUTF8String:_("OK")]];
+ [okButton setButtonType:NSMomentaryPushInButton];
+ [okButton setBezelStyle:NSRoundedBezelStyle];
+ [okButton setKeyEquivalent:@"\r"];
+ [okButton setTarget:self];
+ [okButton setAction:@selector(execute:)];
+ [okButton sizeToFit];
+ [[self contentView] addSubview:okButton];
+
+ NSButton *cancelButton = [[NSButton alloc] initWithFrame:cancelButtonRect];
+ [cancelButton setTitle:[NSString stringWithUTF8String:_("Cancel")]];
+ [cancelButton setButtonType:NSMomentaryPushInButton];
+ [cancelButton setBezelStyle:NSRoundedBezelStyle];
+ [cancelButton setTarget:self];
+ [cancelButton setAction:@selector(cancel:)];
+ [cancelButton sizeToFit];
+ [[self contentView] addSubview:cancelButton];
+
+ NSButton *helpButton = [[NSButton alloc] initWithFrame:helpButtonRect];
+ [helpButton setTitle:@""];
+ [helpButton setButtonType:NSMomentaryPushInButton];
+ [helpButton setBezelStyle:NSHelpButtonBezelStyle];
+ [helpButton setTarget:self];
+ [helpButton setAction:@selector(help:)];
+ [[self contentView] addSubview:helpButton];
+ [helpButton release];
+
+ okButtonRect.size.width = MAX([okButton frame].size.width + 2, [cancelButton frame].size.width) + 2 * SPACING;
+ cancelButtonRect.size.width = okButtonRect.size.width;
+
+ okButtonRect.origin.x = windowRect.size.width - MARGIN - okButtonRect.size.width;
+ cancelButtonRect.origin.x = okButtonRect.origin.x - SPACING - cancelButtonRect.size.width;
+
+ [okButton setFrame:okButtonRect];
+ [cancelButton setFrame:cancelButtonRect];
+
+ [cancelButton release];
+ [okButton release];
+
+ [self setContentSize:windowRect.size];
+ }
+ return self;
+}
+
+# pragma mark Targets
+
+- (IBAction)execute:(id)sender {
+ int nitems;
+ for (nitems = 0; dialog[nitems].question; nitems++);
+ params = malloc (sizeof (*params) * nitems);
+
+ int i;
+ for (i = 0; i < nitems; i++) {
+ NSString *question = [NSString stringWithUTF8String:dialog[i].question];
+ NSControl *control;
+ switch (dialog[i].type) {
+ case DIALOG_IFILE:
+ case DIALOG_OFILE:
+ case DIALOG_STRING:
+ case DIALOG_KEYSTRING:
+ control = [controls objectForKey:question];
+ params[i].dstring = strdup ([[control stringValue] UTF8String]);
+ break;
+ case DIALOG_INT:
+ control = [controls objectForKey:question];
+ params[i].dint = [control intValue];
+ break;
+ case DIALOG_FLOAT:
+ control = [controls objectForKey:question];
+ params[i].number = [control floatValue];
+ break;
+ case DIALOG_COORD:
+ control = [controls objectForKey:question];
+ params[i].dcoord[0] = [control floatValue];
+ control = [controls objectForKey:[question stringByAppendingString:@"2"]];
+ params[i].dcoord[1] = [control floatValue];
+ break;
+ case DIALOG_CHOICE:
+ control = [controls objectForKey:question];
+ params[i].dint = [(NSPopUpButtonCell *)control indexOfSelectedItem];
+ break;
+ }
+ }
+ [NSApp stopModal];
+}
+
+- (IBAction)cancel:(id)sender {
+ params = NULL;
+ [NSApp stopModal];
+}
+
+- (IBAction)help:(id)sender {
+ ui_help(item->shortname);
+}
+
+- (IBAction)chooseInput:(id)sender {
+ NSTextField *target = [[sender cell] representedObject];
+ NSString *extension = [[[target cell] representedObject] pathExtension];
+ NSOpenPanel *oPanel = [NSOpenPanel openPanel];
+
+ int result = [oPanel runModalForDirectory:nil
+ file:nil
+ types:[NSArray arrayWithObject:extension]];
+
+ if (result == NSOKButton)
+ [target setStringValue:[oPanel filename]];
+}
+
+- (IBAction)chooseOutput:(id)sender {
+ NSTextField *target = [[sender cell] representedObject];
+ NSString *extension = [[[target cell] representedObject] pathExtension];
+ NSSavePanel *sPanel = [NSSavePanel savePanel];
+ [sPanel setRequiredFileType:extension];
+
+ int result = [sPanel runModalForDirectory:nil file:[target stringValue]];
+ if (result == NSOKButton)
+ [target setStringValue:[sPanel filename]];
+}
+
+#pragma mark Accessors
+
+- (dialogparam *)params {
+ return params;
+}
+
+#pragma mark Deallocation
+
+- (void)dealloc {
+ [controls release];
+ [super dealloc];
+}
+@end
diff --git a/src/ui/ui-drv/cocoa/English.lproj/Credits.html b/src/ui/ui-drv/cocoa/English.lproj/Credits.html
new file mode 100644
index 0000000..d38d9cd
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/English.lproj/Credits.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <title></title>
+ <meta name="Generator" content="Cocoa HTML Writer">
+ <meta name="CocoaVersion" content="824.41">
+ <style type="text/css">
+ body {
+ font-family: "Lucida Grande", Arial, sans-serif;
+ font-size: 8pt;
+ text-align: center;
+ }
+ </style>
+</head>
+<body>
+<p>XaoS is free software; you can redistribute it and/or modify it under the
+terms of the<br>
+<a href="help:anchor=gpl%20bookID=XaoS%20Help">GNU General Public License</a>.
+</p>
+<p><a href="help:anchor=about%20bookID=XaoS%20Help">Credits</a></p>
+<p><a href="help:anchor=devel%20bookID=XaoS%20Help">How to Help</a></p>
+<p><a href="http://xaos.sourceforge.net/">XaoS Website</a></p>
+</body>
+</html>
diff --git a/src/ui/ui-drv/cocoa/English.lproj/InfoPlist.strings b/src/ui/ui-drv/cocoa/English.lproj/InfoPlist.strings
new file mode 100644
index 0000000..42b5784
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/English.lproj/InfoPlist.strings
Binary files differ
diff --git a/src/ui/ui-drv/cocoa/English.lproj/MainMenu.nib/designable.nib b/src/ui/ui-drv/cocoa/English.lproj/MainMenu.nib/designable.nib
new file mode 100644
index 0000000..5d0aa75
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/English.lproj/MainMenu.nib/designable.nib
@@ -0,0 +1,498 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.01">
+ <data>
+ <int key="IBDocument.SystemTarget">0</int>
+ <string key="IBDocument.SystemVersion">9C7010</string>
+ <string key="IBDocument.InterfaceBuilderVersion">629</string>
+ <string key="IBDocument.AppKitVersion">949.26</string>
+ <string key="IBDocument.HIToolboxVersion">352.00</string>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="29"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string id="617114957">com.apple.InterfaceBuilderKit</string>
+ <string id="578961457">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSCustomObject" id="1021">
+ <string key="NSClassName" id="1039455869">NSApplication</string>
+ </object>
+ <object class="NSCustomObject" id="1014">
+ <string key="NSClassName">FirstResponder</string>
+ </object>
+ <object class="NSCustomObject" id="1050">
+ <reference key="NSClassName" ref="1039455869"/>
+ </object>
+ <object class="NSMenu" id="649796088">
+ <string key="NSTitle">AMainMenu</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="694149608">
+ <reference key="NSMenu" ref="649796088"/>
+ <string key="NSTitle" id="163516152">XaoS</string>
+ <string key="NSKeyEquiv" id="1003"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <object class="NSCustomResource" key="NSOnImage" id="621373611">
+ <string key="NSClassName" id="963292957">NSImage</string>
+ <string key="NSResourceName">NSMenuCheckmark</string>
+ </object>
+ <object class="NSCustomResource" key="NSMixedImage" id="481733502">
+ <reference key="NSClassName" ref="963292957"/>
+ <string key="NSResourceName">NSMenuMixedState</string>
+ </object>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="110575045">
+ <reference key="NSTitle" ref="163516152"/>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="238522557">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle">About XaoS</string>
+ <reference key="NSKeyEquiv" ref="1003"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="621373611"/>
+ <reference key="NSMixedImage" ref="481733502"/>
+ </object>
+ <object class="NSMenuItem" id="304266470">
+ <reference key="NSMenu" ref="110575045"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <reference key="NSTitle" ref="1003"/>
+ <reference key="NSKeyEquiv" ref="1003"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="621373611"/>
+ <reference key="NSMixedImage" ref="481733502"/>
+ </object>
+ <object class="NSMenuItem" id="1046388886">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle" id="487627014">Services</string>
+ <reference key="NSKeyEquiv" ref="1003"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="621373611"/>
+ <reference key="NSMixedImage" ref="481733502"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="752062318">
+ <reference key="NSTitle" ref="487627014"/>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <string key="NSName">_NSServicesMenu</string>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="646227648">
+ <reference key="NSMenu" ref="110575045"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <reference key="NSTitle" ref="1003"/>
+ <reference key="NSKeyEquiv" ref="1003"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="621373611"/>
+ <reference key="NSMixedImage" ref="481733502"/>
+ </object>
+ <object class="NSMenuItem" id="755159360">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle">Hide XaoS</string>
+ <string key="NSKeyEquiv" id="712247123">h</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="621373611"/>
+ <reference key="NSMixedImage" ref="481733502"/>
+ </object>
+ <object class="NSMenuItem" id="342932134">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle">Hide Others</string>
+ <reference key="NSKeyEquiv" ref="712247123"/>
+ <int key="NSKeyEquivModMask">1572864</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="621373611"/>
+ <reference key="NSMixedImage" ref="481733502"/>
+ </object>
+ <object class="NSMenuItem" id="908899353">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle">Show All</string>
+ <reference key="NSKeyEquiv" ref="1003"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="621373611"/>
+ <reference key="NSMixedImage" ref="481733502"/>
+ </object>
+ <object class="NSMenuItem" id="1056857174">
+ <reference key="NSMenu" ref="110575045"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <reference key="NSTitle" ref="1003"/>
+ <reference key="NSKeyEquiv" ref="1003"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="621373611"/>
+ <reference key="NSMixedImage" ref="481733502"/>
+ </object>
+ <object class="NSMenuItem" id="632727374">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle">Quit XaoS</string>
+ <string key="NSKeyEquiv">q</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="621373611"/>
+ <reference key="NSMixedImage" ref="481733502"/>
+ </object>
+ </object>
+ <string key="NSName">_NSAppleMenu</string>
+ </object>
+ </object>
+ </object>
+ <string key="NSName">_NSMainMenu</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">orderFrontStandardAboutPanel:</string>
+ <reference key="source" ref="1021"/>
+ <reference key="destination" ref="238522557"/>
+ </object>
+ <int key="connectionID">142</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">hide:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="755159360"/>
+ </object>
+ <int key="connectionID">367</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">hideOtherApplications:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="342932134"/>
+ </object>
+ <int key="connectionID">368</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">terminate:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="632727374"/>
+ </object>
+ <int key="connectionID">369</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">unhideAllApplications:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="908899353"/>
+ </object>
+ <int key="connectionID">370</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <object class="NSArray" key="object" id="1049">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <reference key="children" ref="1048"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="1021"/>
+ <reference key="parent" ref="1049"/>
+ <string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="1014"/>
+ <reference key="parent" ref="1049"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="1050"/>
+ <reference key="parent" ref="1049"/>
+ <string key="objectName">Application</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">29</int>
+ <reference key="object" ref="649796088"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="694149608"/>
+ </object>
+ <reference key="parent" ref="1049"/>
+ <string key="objectName">MainMenu</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">56</int>
+ <reference key="object" ref="694149608"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="110575045"/>
+ </object>
+ <reference key="parent" ref="649796088"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">57</int>
+ <reference key="object" ref="110575045"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="238522557"/>
+ <reference ref="755159360"/>
+ <reference ref="908899353"/>
+ <reference ref="632727374"/>
+ <reference ref="646227648"/>
+ <reference ref="304266470"/>
+ <reference ref="1046388886"/>
+ <reference ref="1056857174"/>
+ <reference ref="342932134"/>
+ </object>
+ <reference key="parent" ref="694149608"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">58</int>
+ <reference key="object" ref="238522557"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">134</int>
+ <reference key="object" ref="755159360"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">150</int>
+ <reference key="object" ref="908899353"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">136</int>
+ <reference key="object" ref="632727374"/>
+ <reference key="parent" ref="110575045"/>
+ <string key="objectName">1111</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">144</int>
+ <reference key="object" ref="646227648"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">236</int>
+ <reference key="object" ref="304266470"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">131</int>
+ <reference key="object" ref="1046388886"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="752062318"/>
+ </object>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">149</int>
+ <reference key="object" ref="1056857174"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">145</int>
+ <reference key="object" ref="342932134"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">130</int>
+ <reference key="object" ref="752062318"/>
+ <reference key="parent" ref="1046388886"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.IBPluginDependency</string>
+ <string>-2.IBPluginDependency</string>
+ <string>-3.IBPluginDependency</string>
+ <string>130.IBPluginDependency</string>
+ <string>130.ImportedFromIB2</string>
+ <string>130.editorWindowContentRectSynchronizationRect</string>
+ <string>131.IBPluginDependency</string>
+ <string>131.ImportedFromIB2</string>
+ <string>134.IBPluginDependency</string>
+ <string>134.ImportedFromIB2</string>
+ <string>136.IBPluginDependency</string>
+ <string>136.ImportedFromIB2</string>
+ <string>144.IBPluginDependency</string>
+ <string>144.ImportedFromIB2</string>
+ <string>145.IBPluginDependency</string>
+ <string>145.ImportedFromIB2</string>
+ <string>149.IBPluginDependency</string>
+ <string>149.ImportedFromIB2</string>
+ <string>150.IBPluginDependency</string>
+ <string>150.ImportedFromIB2</string>
+ <string>236.IBPluginDependency</string>
+ <string>236.ImportedFromIB2</string>
+ <string>29.IBPluginDependency</string>
+ <string>29.ImportedFromIB2</string>
+ <string>29.WindowOrigin</string>
+ <string>29.editorWindowContentRectSynchronizationRect</string>
+ <string>56.IBPluginDependency</string>
+ <string>56.ImportedFromIB2</string>
+ <string>57.IBPluginDependency</string>
+ <string>57.ImportedFromIB2</string>
+ <string>57.editorWindowContentRectSynchronizationRect</string>
+ <string>58.IBPluginDependency</string>
+ <string>58.ImportedFromIB2</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="578961457"/>
+ <reference ref="617114957"/>
+ <reference ref="617114957"/>
+ <reference ref="578961457"/>
+ <integer value="1" id="9"/>
+ <string>{{436, 809}, {64, 6}}</string>
+ <reference ref="578961457"/>
+ <reference ref="9"/>
+ <reference ref="578961457"/>
+ <reference ref="9"/>
+ <reference ref="578961457"/>
+ <reference ref="9"/>
+ <reference ref="578961457"/>
+ <reference ref="9"/>
+ <reference ref="578961457"/>
+ <reference ref="9"/>
+ <reference ref="578961457"/>
+ <reference ref="9"/>
+ <reference ref="578961457"/>
+ <reference ref="9"/>
+ <reference ref="578961457"/>
+ <reference ref="9"/>
+ <reference ref="578961457"/>
+ <reference ref="9"/>
+ <string>{74, 862}</string>
+ <string>{{6, 836}, {77, 20}}</string>
+ <reference ref="578961457"/>
+ <reference ref="9"/>
+ <reference ref="578961457"/>
+ <reference ref="9"/>
+ <string>{{18, 683}, {174, 153}}</string>
+ <reference ref="578961457"/>
+ <reference ref="9"/>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">374</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.LastKnownRelativeProjectPath">../../XaoS.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <object class="NSMutableData" key="IBDocument.RunnableNib">
+ <bytes key="NS.bytes">YnBsaXN0MDDUAAEAAgADAAQABQAGAAkAClgkdmVyc2lvblQkdG9wWSRhcmNoaXZlclgkb2JqZWN0cxIA
+AYag0QAHAAhdSUIub2JqZWN0ZGF0YYABXxAPTlNLZXllZEFyY2hpdmVyrxBuAAsADAAxADUANgA8AD0A
+QQBFAE0AUwBjAGoAawBsAHEAcgBzAHYAegB7AH4AfwCDAIkAkACRAJIAkwCXAJ4AnwCgAKQArACtAK4A
+rwCzALoAuwC8AMAA0QDWANcA2wDmAOcA6AD0AP8BCADnAQkBDgERARIBFAEdASYBJwEoASsBLQE+AVAB
+YgFjAWQBZQFmAWcBaAFpAWoBawFsAW0BbgFvAXABcQF0AXcBjgGlAaYBpwGoAakBqgGrAawBrQGuAa8B
+sAGxAbIBswG0Ab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drv/cocoa/English.lproj/MainMenu.nib/keyedobjects.nib b/src/ui/ui-drv/cocoa/English.lproj/MainMenu.nib/keyedobjects.nib
new file mode 100644
index 0000000..8659a00
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/English.lproj/MainMenu.nib/keyedobjects.nib
Binary files differ
diff --git a/src/ui/ui-drv/cocoa/FractalView.h b/src/ui/ui-drv/cocoa/FractalView.h
new file mode 100644
index 0000000..34957ab
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/FractalView.h
@@ -0,0 +1,70 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * Cocoa Driver by J.B. Langston III (jb-langston@austin.rr.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#import <Cocoa/Cocoa.h>
+
+#include "ui.h"
+
+#ifdef VIDEATOR_SUPPORT
+@ class VideatorProxy;
+#endif
+
+@interface FractalView:NSView {
+ int mouseX, mouseY;
+ int mouseButton, rightMouseButton, otherMouseButton, mouseScrollWheel;
+ int keysDown;
+ int cursorType;
+
+ int currentBuffer;
+ NSBitmapImageRep *imageRep[2];
+
+ NSString *messageText;
+ NSPoint messageLocation;
+
+#ifdef VIDEATOR_SUPPORT
+ VideatorProxy *videatorProxy;
+#endif
+}
+
+#pragma mark Buffers
+-(int) allocBuffer1:(char **)b1 buffer2:(char **) b2;
+-(void) freeBuffers;
+-(void) flipBuffers;
+
+#pragma mark Accessors
+
+#ifdef VIDEATOR_SUPPORT
+-(VideatorProxy *) videatorProxy;
+#endif
+-(void) getWidth:(int *)w height:(int *) h;
+-(void) getMouseX:(int *)mx mouseY:(int *)my mouseButton:(int *) mb;
+-(void) getMouseX:(int *)mx mouseY:(int *)my mouseButton:(int *)mb keys:(int *) k;
+
+#pragma mark Cursor
+-(void) setCursorType:(int) type;
+
+#pragma mark Text
+-(void) printText:(CONST char *)text atX:(int)x y:(int) y;
+- (NSDictionary *) textAttributes;
+
+@end
diff --git a/src/ui/ui-drv/cocoa/FractalView.m b/src/ui/ui-drv/cocoa/FractalView.m
new file mode 100644
index 0000000..6a3b458
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/FractalView.m
@@ -0,0 +1,347 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * Cocoa Driver by J.B. Langston III (jb-langston@austin.rr.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#import "FractalView.h"
+#ifdef VIDEATOR_SUPPORT
+#import "VideatorProxy.h"
+#endif
+
+@interface NSObject(AppDelegateStuff)
+
+- (void)keyPressed:(NSString *)key;
+
+@end
+
+@implementation FractalView
+
+#pragma mark Initialization
+
+- (id)initWithFrame:(NSRect)frame {
+ self = [super initWithFrame:frame];
+ if (self) {
+#ifdef VIDEATOR_SUPPORT
+ videatorProxy = [[VideatorProxy alloc] init];
+#endif
+ }
+ return self;
+}
+
+- (void)dealloc {
+#ifdef VIDEATOR_SUPPORT
+ [videatorProxy release];
+#endif
+ [super dealloc];
+}
+
+#pragma mark Drawing
+
+- (BOOL)isOpaque {
+ return YES;
+}
+
+- (void)drawRect:(NSRect)rect {
+ if (imageRep[currentBuffer]) {
+ [imageRep[currentBuffer] drawInRect:[self bounds]];
+ }
+
+ if (messageText) {
+ [messageText drawAtPoint:messageLocation withAttributes:[self textAttributes]];
+ [messageText release];
+ messageText = nil;
+ }
+
+#ifdef VIDEATOR_SUPPORT
+ [videatorProxy sendImageRep:imageRep[currentBuffer]];
+#endif
+}
+
+#pragma mark Resize Handling
+
+- (void)viewDidEndLiveResize {
+ ui_resize();
+}
+
+#pragma mark Mouse Event Handling
+
+- (void)calculateMouseLocationFromEvent:(NSEvent *)theEvent {
+ NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
+ mouseX = mouseLoc.x;
+ mouseY = [self bounds].size.height - mouseLoc.y;
+}
+
+- (void)mouseDown:(NSEvent *)theEvent {
+ [self calculateMouseLocationFromEvent:theEvent];
+
+ // Emulate 3 buttons based on modifier keys
+ mouseScrollWheel = 0;
+ if ([theEvent modifierFlags] & NSControlKeyMask) {
+ mouseButton = BUTTON3;
+ } else if ([theEvent modifierFlags] & NSShiftKeyMask) {
+ mouseButton = BUTTON2;
+ } else {
+ mouseButton = BUTTON1;
+ }
+}
+
+- (void)mouseUp:(NSEvent *)theEvent {
+ mouseButton = 0;
+}
+
+- (void)mouseDragged:(NSEvent *)theEvent {
+ [self calculateMouseLocationFromEvent:theEvent];
+}
+
+- (void)rightMouseDown:(NSEvent *)theEvent {
+ [self calculateMouseLocationFromEvent:theEvent];
+ mouseScrollWheel = 0;
+ rightMouseButton = BUTTON3;
+}
+
+- (void)rightMouseUp:(NSEvent *)theEvent {
+ rightMouseButton = 0;
+}
+
+- (void)rightMouseDragged:(NSEvent *)theEvent {
+ [self calculateMouseLocationFromEvent:theEvent];
+}
+
+- (void)otherMouseDown:(NSEvent *)theEvent {
+ [self calculateMouseLocationFromEvent:theEvent];
+ mouseScrollWheel = 0;
+ otherMouseButton = BUTTON2;
+}
+
+- (void)otherMouseUp:(NSEvent *)theEvent {
+ otherMouseButton = 0;
+}
+
+- (void)otherMouseDragged:(NSEvent *)theEvent {
+ [self calculateMouseLocationFromEvent:theEvent];
+}
+
+- (void)scrollWheel:(NSEvent *)theEvent {
+ // Only scroll if no mouse buttons are held
+ if ((mouseButton | rightMouseButton | otherMouseButton) == 0) {
+ mouseScrollWheel = BUTTON2;
+ mouseX += [theEvent deltaX];
+ mouseY += [theEvent deltaY];
+ }
+}
+
+#pragma mark Keyboard Event Handling
+
+- (void)flagsChanged:(NSEvent *)theEvent {
+ // Emulate 3 buttons based on modifier keys
+ if (mouseButton) {
+ if ([theEvent modifierFlags] & NSControlKeyMask) {
+ mouseButton = BUTTON3;
+ } else if ([theEvent modifierFlags] & NSShiftKeyMask) {
+ mouseButton = BUTTON2;
+ } else {
+ mouseButton = BUTTON1;
+ }
+ }
+}
+
+- (void)keyDown:(NSEvent *)e {
+ NSString *characters = [e characters];
+ if ([characters length] == 0) return;
+
+ unichar keyChar = [characters characterAtIndex:0];
+ switch(keyChar) {
+ case NSLeftArrowFunctionKey:
+ keysDown |= 1;
+ ui_key(UIKEY_LEFT);
+ break;
+ case NSRightArrowFunctionKey:
+ keysDown |= 2;
+ ui_key(UIKEY_RIGHT);
+ break;
+ case NSUpArrowFunctionKey:
+ keysDown |= 4;
+ ui_key(UIKEY_UP);
+ break;
+ case NSDownArrowFunctionKey:
+ keysDown |= 8;
+ ui_key(UIKEY_DOWN);
+ break;
+ case NSBackspaceCharacter:
+ ui_key(UIKEY_BACKSPACE);
+ break;
+ case NSEndFunctionKey:
+ ui_key(UIKEY_END);
+ break;
+ case '\033': // Escape
+ ui_key(UIKEY_ESC);
+ break;
+ case NSHomeFunctionKey:
+ ui_key(UIKEY_HOME);
+ break;
+ case NSPageDownFunctionKey:
+ ui_key(UIKEY_PGDOWN);
+ break;
+ case NSPageUpFunctionKey:
+ ui_key(UIKEY_PGUP);
+ break;
+ case NSTabCharacter:
+ ui_key(UIKEY_TAB);
+ break;
+ default:
+ ui_key(keyChar);
+ }
+}
+
+- (void)keyUp:(NSEvent *)e {
+ NSString *characters = [e characters];
+ if ([characters length] == 0) return;
+
+ unichar keyChar = [characters characterAtIndex:0];
+ switch(keyChar) {
+ case NSLeftArrowFunctionKey:
+ keysDown &= ~1;
+ break;
+ case NSRightArrowFunctionKey:
+ keysDown &= ~2;
+ break;
+ case NSUpArrowFunctionKey:
+ keysDown &= ~4;
+ break;
+ case NSDownArrowFunctionKey:
+ keysDown &= ~8;
+ break;
+ }
+}
+
+#pragma mark Accessors
+
+#ifdef VIDEATOR_SUPPORT
+- (VideatorProxy *)videatorProxy {
+ return videatorProxy;
+}
+#endif
+
+- (void)getWidth:(int *)w height:(int *)h {
+ NSRect bounds = [self bounds];
+ *w = bounds.size.width;
+ *h = bounds.size.height;
+}
+
+- (void)getMouseX:(int *)mx mouseY:(int *)my mouseButton:(int *)mb {
+ *mx = mouseX;
+ *my = mouseY;
+ *mb = mouseButton | rightMouseButton | otherMouseButton | mouseScrollWheel;
+}
+
+- (void)getMouseX:(int *)mx mouseY:(int *)my mouseButton:(int *)mb keys:(int *)k
+{
+ [self getMouseX:mx mouseY:my mouseButton:mb];
+ *k = keysDown;
+}
+
+#pragma mark Cursor
+
+- (void)setCursorType:(int)type {
+ cursorType = type;
+ [[self window] invalidateCursorRectsForView:self];
+}
+
+- (void)resetCursorRects {
+ /* BUG - cursor changes back to arrow when mouse is clicked
+ if (cursorType == VJMOUSE) {
+ NSCursor *cursor = [[NSCursor alloc] initWithImage:[NSImage imageNamed:@"performanceCursor"] hotSpot:NSMakePoint(1.0,1.0)];
+ [cursor setOnMouseEntered:YES];
+ [self addCursorRect:[self bounds] cursor:cursor];
+ [cursor release];
+ } */
+}
+
+
+#pragma mark Text
+
+- (NSDictionary *)textAttributes {
+
+ NSMutableDictionary *attrsDictionary = [NSMutableDictionary dictionaryWithObject:[NSColor whiteColor]
+ forKey:NSForegroundColorAttributeName];
+
+ NSShadow *dockStyleTextShadow = [[NSShadow alloc] init];
+ [dockStyleTextShadow setShadowOffset:NSMakeSize(2, -2)];
+ [dockStyleTextShadow setShadowBlurRadius:1];
+ [dockStyleTextShadow setShadowColor:[NSColor blackColor]];
+ [attrsDictionary setValue:[NSFont boldSystemFontOfSize:12.0] forKey:NSFontAttributeName];
+ [attrsDictionary setValue:dockStyleTextShadow forKey:NSShadowAttributeName];
+ [dockStyleTextShadow autorelease];
+
+ return attrsDictionary;
+}
+
+
+- (void)printText:(CONST char *)text atX:(int)x y:(int)y {
+ messageText = [[NSString stringWithUTF8String:text] retain];
+ messageLocation = NSMakePoint(x + 15, [self bounds].size.height - y);
+ [self setNeedsDisplay:YES];
+}
+
+#pragma mark Buffers
+
+- (int)allocBuffer1:(char **)b1 buffer2:(char **)b2 {
+ currentBuffer = 0;
+ NSRect bounds = [self bounds];
+ imageRep[0] = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
+ pixelsWide:bounds.size.width
+ pixelsHigh:bounds.size.height
+ bitsPerSample:8
+ samplesPerPixel:3
+ hasAlpha:NO
+ isPlanar:NO
+ colorSpaceName:NSDeviceRGBColorSpace
+ bytesPerRow:0
+ bitsPerPixel:32];
+
+ *b1 = (char *)[imageRep[0] bitmapData];
+
+ imageRep[1] = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
+ pixelsWide:bounds.size.width
+ pixelsHigh:bounds.size.height
+ bitsPerSample:8
+ samplesPerPixel:3
+ hasAlpha:NO
+ isPlanar:NO
+ colorSpaceName:NSDeviceRGBColorSpace
+ bytesPerRow:0
+ bitsPerPixel:32];
+
+ *b2 = (char *)[imageRep[1] bitmapData];
+ NSLog(@"bytesPerRow = %d", [imageRep[0] bytesPerRow]);
+ return [imageRep[0] bytesPerRow];
+}
+
+- (void)freeBuffers {
+ [imageRep[0] release];
+ [imageRep[1] release];
+}
+
+- (void)flipBuffers {
+ currentBuffer ^= 1;
+}
+
+@end
diff --git a/src/ui/ui-drv/cocoa/HowToBuild.txt b/src/ui/ui-drv/cocoa/HowToBuild.txt
new file mode 100644
index 0000000..90209f1
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/HowToBuild.txt
@@ -0,0 +1,47 @@
+XaoS for Mac OS X (Cocoa)
+Build Instructions
+
+By J.B. Langston III
+
+Here are instructions for getting the XaoS Xcode project to build successfully
+assuming you have downloaded a released source tarball or gotten the source
+from CVS:
+
+A) Build dependencies
+
+ 1) Download the latest libpng from
+
+ ftp://ftp.simplesystems.org/pub/libpng/png/src/
+
+ 2) Configure libpng for universal binaries with the following command:
+
+ env CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -mmacosx-version-min=10.4" \
+ LDFLAGS="-arch i386 -arch ppc" \
+ ./configure --prefix=$XAOS_ROOT/src/ui/ui-drv/cocoa/thirdparty --disable-dependency-tracking
+
+ Be sure to replace $XAOS_ROOT with the root of your XaoS source folder.
+
+ For more information about building open source libraries as universal binaries:
+ http://developer.apple.com/technotes/tn2005/tn2137.html
+
+ 3) Make and install libpng:
+
+ make && make install
+
+ 4) Download the latest gsl from
+
+ ftp://ftp.gnu.org/gnu/gsl/
+
+ 5) Repeat steps 2 and 3 for gsl
+
+ 6) Download the latest gettext from
+
+ ftp://ftp.gnu.org/gnu/gettext/
+
+ 7) Repeat steps 2 and 3 for gettext
+
+B) Build XaoS
+
+ You should now be able to build XaoS from the Xcode project.
+
+Have fun! If you have questions, feel free to e-mail me: jb-langston at austin dot rr dot com \ No newline at end of file
diff --git a/src/ui/ui-drv/cocoa/Info.plist b/src/ui/ui-drv/cocoa/Info.plist
new file mode 100644
index 0000000..7dc86fd
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/Info.plist
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>xaf</string>
+ </array>
+ <key>CFBundleTypeIconFile</key>
+ <string>XaoSDocument</string>
+ <key>CFBundleTypeName</key>
+ <string>XaoS Animation File</string>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ <key>LSTypeIsPackage</key>
+ <false/>
+ <key>NSPersistentStoreTypeKey</key>
+ <string>XML</string>
+ </dict>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>xpf</string>
+ </array>
+ <key>CFBundleTypeIconFile</key>
+ <string>XaoSDocument</string>
+ <key>CFBundleTypeName</key>
+ <string>XaoS Position File</string>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ <key>LSTypeIsPackage</key>
+ <false/>
+ <key>NSPersistentStoreTypeKey</key>
+ <string>XML</string>
+ </dict>
+ </array>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleHelpBookFolder</key>
+ <string>XaoSHelp</string>
+ <key>CFBundleHelpBookName</key>
+ <string>XaoSHelp</string>
+ <key>CFBundleIconFile</key>
+ <string>XaoS</string>
+ <key>CFBundleIdentifier</key>
+ <string>net.sourceforge.xaos.XaoS</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>3.5</string>
+ <key>NSAppleScriptEnabled</key>
+ <string>YES</string>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/src/ui/ui-drv/cocoa/Japanese.lproj/InfoPlist.strings b/src/ui/ui-drv/cocoa/Japanese.lproj/InfoPlist.strings
new file mode 100644
index 0000000..8a78ff4
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/Japanese.lproj/InfoPlist.strings
Binary files differ
diff --git a/src/ui/ui-drv/cocoa/Japanese.lproj/MainMenu.nib/classes.nib b/src/ui/ui-drv/cocoa/Japanese.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 0000000..b9b4b09
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/Japanese.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,4 @@
+{
+ IBClasses = ({CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; });
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/src/ui/ui-drv/cocoa/Japanese.lproj/MainMenu.nib/info.nib b/src/ui/ui-drv/cocoa/Japanese.lproj/MainMenu.nib/info.nib
new file mode 100644
index 0000000..4c74210
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/Japanese.lproj/MainMenu.nib/info.nib
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>IBDocumentLocation</key>
+ <string>94 103 356 240 0 0 1280 1002 </string>
+ <key>IBEditorPositions</key>
+ <dict>
+ <key>29</key>
+ <string>93 343 318 44 0 0 1280 1002 </string>
+ </dict>
+ <key>IBFramework Version</key>
+ <string>403.0</string>
+ <key>IBSystem Version</key>
+ <string>8A278</string>
+</dict>
+</plist>
diff --git a/src/ui/ui-drv/cocoa/Japanese.lproj/MainMenu.nib/keyedobjects.nib b/src/ui/ui-drv/cocoa/Japanese.lproj/MainMenu.nib/keyedobjects.nib
new file mode 100644
index 0000000..ee1187e
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/Japanese.lproj/MainMenu.nib/keyedobjects.nib
Binary files differ
diff --git a/src/ui/ui-drv/cocoa/Read Me.rtf b/src/ui/ui-drv/cocoa/Read Me.rtf
new file mode 100644
index 0000000..b005745
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/Read Me.rtf
@@ -0,0 +1,193 @@
+{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf270
+{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
+{\colortbl;\red255\green255\blue255;}
+{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid1}
+{\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid2}
+{\list\listtemplateid3\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid3}
+{\list\listtemplateid4\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid4}
+{\list\listtemplateid5\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid5}
+{\list\listtemplateid6\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid6}
+{\list\listtemplateid7\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid7}
+{\list\listtemplateid8\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{hyphen\}}{\leveltext\leveltemplateid1\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid8}
+{\list\listtemplateid9\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid9}
+{\list\listtemplateid10\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid10}}
+{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}{\listoverride\listid6\listoverridecount0\ls6}{\listoverride\listid7\listoverridecount0\ls7}{\listoverride\listid8\listoverridecount0\ls8}{\listoverride\listid9\listoverridecount0\ls9}{\listoverride\listid10\listoverridecount0\ls10}}
+\vieww9000\viewh8400\viewkind0
+\deftab720
+\pard\pardeftab720\sa80\ql\qnatural
+
+\f0\b\fs24 \cf0 XaoS Real-Time Fractal Zoomer for Mac OS X, Version 3.4\
+\pard\pardeftab720\ql\qnatural
+
+\b0 \cf0 \
+Originally written by Jan Hubicka and Thomas Marsh\
+Currently maintained by Zoltan Kovacs (kovzol@math.u-szeged.hu)\
+Ported to Mac OS X By J.B. Langston III (jb-langston@austin.rr.com)\
+\'a0\
+Current version: \
+XaoS Homepage: {\field{\*\fldinst{HYPERLINK "http://xaos.sf.net/"}}{\fldrslt http://xaos.sf.net/}}\
+\'a0\
+\pard\pardeftab720\sa80\ql\qnatural
+
+\b \cf0 About\
+\pard\pardeftab720\sa80\ql\qnatural
+
+\b0 \cf0 XaoS is an incredible program that lets you explore fractals by zooming in and out in real time.\'a0 If you\'92ve only used static fractal viewers like Fractint or UltraFractal before, zooming into a fractal as a real time animation is incredible.\'a0 XaoS was originally written by Jan Hubicka and Thomas Marsh, and is currently maintained by Zoltan Kovacs. I contributed the Mac OS X user interface and made binaries available for ease of use. XaoS is free software available under the terms of the GNU General Public License.\
+\pard\pardeftab720\ql\qnatural
+\cf0 \
+\pard\pardeftab720\sa80\ql\qnatural
+
+\b \cf0 Installation and Usage\
+\pard\pardeftab720\ql\qnatural
+
+\b0 \cf0 After downloading the XaoS binary, just copy it to your applications folder and run the program. Basic usage is really pretty simple.\'a0\
+\pard\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
+\ls1\ilvl0\cf0 {\listtext \'95 }Point your mouse at the part of the image you want to zoom in on, and hold down the mouse button.\'a0 Away you go!\'a0\
+{\listtext \'95 }To zoom back out, hold down the control key and click.\'a0 Or, right click with a two-button mouse.\'a0\
+{\listtext \'95 }To pan, hold down the shift key and drag. On a three-button mouse, drag with the center button.\'a0 If you have a mouse with a scroll wheel, pressing down on the scroll wheel usually works like the center button.\
+{\listtext \'95 }To go full-screen, select UI->Drivers->Mac OS X Fullscreen Driver from the menu. In full screen mode, the menu is only displayed when you move the mouse near the top of the screen. After going full screen, you can quit by pressing \uc0\u8984 Q, or you can go back to windowed mode by selecting UI->Drivers->Mac OS X Windowed Driver.\
+\pard\pardeftab720\ql\qnatural
+\cf0 \'a0\
+To learn more, check out the tutorials from the Help menu.\'a0 They are really informative and a lot of fun to watch.\'a0 For more in-depth information, use the online help.\
+\'a0\
+\pard\pardeftab720\ql\qnatural
+
+\b \cf0 Known Issues\
+\pard\pardeftab720\ql\qnatural
+
+\b0 \cf0 The following are known issues with the current version of XaoS for Mac OS X.\
+\pard\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
+\ls2\ilvl0\cf0 {\listtext \'95 }Catseye fractal does not render properly.\'a0 \uc0\u8232 Workaround: Set the bailout to just over 4 (e.g., 4.000000001). After changing this setting, the fractal renders as expected.\
+\pard\pardeftab720\ql\qnatural
+\cf0 \
+\pard\pardeftab720\sa80\ql\qnatural
+
+\b \cf0 Revision History\
+\pard\pardeftab720\sa80\ql\qnatural
+
+\b0 \cf0 3.4\
+Release Date: 6/1/2008\
+\pard\tx560\pardeftab720\ql\qnatural
+\cf0 \
+This is a huge release for Mac users. The Mac user interface has been completely rewritten in Cocoa and improved in a number of ways:\
+\
+\pard\tx220\tx720\pardeftab720\li720\fi-720\sa80\ql\qnatural
+\ls3\ilvl0\cf0 {\listtext \'95 }Standard Aqua dialog boxes instead of the strange-looking Unixy things in previous versions. Fields in dialog boxes now support cut and paste as you would expect.\
+{\listtext \'95 }Pop-up menus are now displayed using standard Aqua menus\
+{\listtext \'95 }Menu bar in full-screen mode is now the standard Mac OS X menu bar. It automatically slides into view when you move your mouse to the top of the screen and slides out when you move away from it.\
+{\listtext \'95 }XaoS now has a standard Aqua about dialog box, which displays links to license and credits in help file.\
+{\listtext \'95 }Help is now displayed via Mac OS X's standard help viewer. Tutorials can still be launched via links in the help viewer.\
+{\listtext \'95 }Support for opening xpf (Saved Position) and xaf (Saved Animation) files directly from Finder via drag and drop and by double-clicking. XaoS now includes its own document icon for these files as well.\
+{\listtext \'95 }Support for basic AppleScriptability via the standard script dictionary. Includes things like opening files and manipulating the window, but no XaoS-specific functionality.\
+{\listtext \'95 }Support for panning the fractal with the mouse scroll wheel or trackpad two-finger gestures.\
+\pard\tx560\pardeftab720\ql\qnatural
+\cf0 \
+In addition to the user interface improvements, XaoS for Mac has the following improvements:\
+\
+\pard\tx220\tx720\pardeftab720\li720\fi-720\sa80\ql\qnatural
+\ls4\ilvl0\cf0 {\listtext \'95 }Now uses greater precision (long double) for calculations to enable much deeper zooms.\
+{\listtext \'95 }In addition to English, XaoS for Mac OS X now supports the following languages: Czech, French, German, Hungarian, Italian, Romanian, and Spanish.\
+{\listtext \'95 }Integration with Stone Design's Videator (http://stone.com/Videator/). XaoS can now send live a live video stream to Videator, which can then do post-processing using Mac OS X's core video technology. This is great for VJing (live video performance art). See http://stone.com/Videator/VJ.html for more details.\
+{\listtext \'95 }New Italian translation courtesy of Sergio Zanchetta\
+{\listtext \'95 }Updated German translation by Andreas Madritsch\
+{\listtext \'95 }Bug fix to prevent Edge Detection and Pseudo 3D filter from rendering the image completely black.\
+{\listtext \'95 }Bug fix to prevent garbled characters when using non-English languages on modern systems using UTF-8\
+{\listtext \'95 }Bug fix to prevent XaoS from crashing after using the Render Animation functionality\
+{\listtext \'95 }Bug fix to prevent incorrect colors on smooth coloring modes with certain video modes\
+\pard\pardeftab720\sa80\ql\qnatural
+\cf0 \
+3.3\
+Release Date: 3/13/2008\
+\
+Changes since 3.2.2:\
+\pard\tx220\tx720\pardeftab720\li720\fi-720\sa80\ql\qnatural
+\ls5\ilvl0\cf0 {\listtext \'95 }Added user formula support using SFFE/GSL library.\
+{\listtext \'95 }Fixed bug where colors display incorrectly on Intel Macs after switching from full screen back to windowed driver.\
+{\listtext \'95 }Upgraded libpng to 1.2.25.\
+{\listtext \'95 }Included libgsl 1.10.\
+{\listtext \'95 }Updated build instructions with easier third party library build process.\
+{\listtext \'95 }Added performance mode, which inhibits text display (useful for VJing).\
+{\listtext \'95 }Fixed bug where color cycling would stop when moving from forward cycling to reverse.\
+\pard\pardeftab720\sa80\ql\qnatural
+\cf0 \
+3.2.2 \
+Release Date: 9/26/2006\
+\
+Changes since Beta 4:\
+\pard\tx220\tx720\pardeftab720\li720\fi-720\sa80\ql\qnatural
+\ls6\ilvl0\cf0 {\listtext \'95 }Fixed bug which was preventing XaoS from rendering images over 2500x2500\
+{\listtext \'95 }Added fullscreen driver\
+{\listtext \'95 }Upgraded libpng to 1.2.12\
+\pard\pardeftab720\sa80\ql\qnatural
+\cf0 \
+3.2.1 Beta 4\
+\pard\pardeftab720\ql\qnatural
+\cf0 Release Date: 7/8/2006\
+\pard\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
+\ls7\ilvl0\cf0 \
+\pard\pardeftab720\ql\qnatural
+\cf0 Changes since Beta 3:\
+\pard\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
+\ls8\ilvl0\cf0 {\listtext \'95 }Fixed bug with colors on Intel Macs (default colors previously showed yellow instead of blue)\
+{\listtext \'95 }Fixed bug that prevented render animation option from working correctly\
+{\listtext \'95 }Added -windowsize and -autoscreensize command line arguments\
+\pard\tx940\tx1440\pardeftab720\li1440\fi-1440\ql\qnatural
+\ls8\ilvl1\cf0 -windowsize allows you to specify the window size on the command line\
+ -autoscreensize causes XaoS to attempt to automatically detect the pysical screen size\
+\pard\pardeftab720\sa80\ql\qnatural
+\cf0 \
+3.2.1 Beta 3\
+\pard\pardeftab720\ql\qnatural
+\cf0 Release Date: 6/27/2006\
+\
+Changes since Beta 2:\
+\pard\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
+\ls9\ilvl0\cf0 {\listtext \'95 }Support saving to png. libpng is included as a private framework.\
+{\listtext \'95 }Changed icon to match XaoS default image\
+{\listtext \'95 }Provide standard Mac OS keyboard shortcuts for applicable functions -- redo, undo, save, load\
+{\listtext \'95 }Repackaged as a disk image with Readme fil\
+\
+\pard\pardeftab720\sa80\ql\qnatural
+\cf0 3.2.1 Beta 2\
+\pard\pardeftab720\ql\qnatural
+\cf0 Release Date: 6/20/2006\
+\
+Changes since Beta 1:\
+\pard\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
+\ls10\ilvl0\cf0 {\listtext \'95 }Keyboard input has been implemented for all keys supported by XaoS.\
+{\listtext \'95 }Fixed bug where window events were not handled if driver was reinitialized.\
+{\listtext \'95 }Tutorials now play back.\
+{\listtext \'95 }Random examples now load.\
+{\listtext \'95 }Since Mac OS X doesn't allow single menu items directly in the menubar, I put "Stop Replay" for animation mode in the UI menu\
+{\listtext \'95 }Mac OS X applications have their own quit command in the Application menu.\'a0 So I removed the quit menu and preceeding separator from the file menu.\
+{\listtext \'95 }Swapped order of UI and Help menus in animation mode to comply with Human Interface Guidelines.\
+\pard\pardeftab720\ql\qnatural
+\cf0 \'a0\
+\pard\pardeftab720\sa80\ql\qnatural
+\cf0 3.2.1 Beta 1\
+\pard\pardeftab720\ql\qnatural
+\cf0 Release Date: 6/15/2006\
+\'a0\
+This was the original public release of XaoS for Mac OS X.\
+\
+\pard\pardeftab720\ql\qnatural
+
+\b \cf0 Included Software
+\b0 \
+\
+libpng 1.2.25\
+http://libpng.org/pub/png/libpng.html\
+\
+GNU Scientific Library 1.10 \
+http://www.gnu.org/software/gsl/\
+\
+
+\b About Free Software\
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardeftab720\ql\qnatural\pardirnatural
+
+\b0 \cf0 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; it is displayable from the program's online help feature. If not, you can find it on the Internet at http://www.gnu.org or you can write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.} \ No newline at end of file
diff --git a/src/ui/ui-drv/cocoa/Readme Cocoa b/src/ui/ui-drv/cocoa/Readme Cocoa
new file mode 100644
index 0000000..3e92f34
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/Readme Cocoa
@@ -0,0 +1,390 @@
+2006-10-23 - Andrew Stone (andrew@stone.com)
+ - to build for Videator: -DVIDEATOR_SUPPORT
+ - added this file
+ - added Credits.html
+ - modified InfoPlist.strings
+ - MainMenu.nib
+ - changed NewApplication to XaoS
+ - changed window title to indicate this version of XaoS talks to Videator
+
+ - AppController.m: added distributed notification with imageRep
+ - FractalView.m: added method to return current imageRep
+2006-10-25
+ - ui_cocoa.m now byte swaps color masks
+
+2006-10-26
+ - hot keys working
+ - tutorial and help working ala carbon
+
+2006-11-29 - J.B. Langston
+
+Committing additional changes submitted 10/30 by Andrew Stone:
+
+ - support for arrow keys
+ up/down change zoom speed
+ right/left: if cycling - change
+ if auto-rotation - change speed of rotation
+
+ - UI -> Performance Mode
+ This will turn off the echoing of messages to the screen
+
+ - going from cycle forward and backward no longer toggles cycling off
+
+ - BUG FIX: window now regains key status after after dialog
+
+2008-03-14 - J.B. Langston
+
+ - Fixed bug with smooth color modes on PowerPC Macs (filter.h)
+
+2008-03-17 - J.B. Langston
+
+ - Added user formula support using SFFE/libgsl
+
+ - Added support for libpng to Cocoa
+
+ - Added build instructions to Cocoa project
+
+2008-03-18 - J.B. Langston
+
+ - Moved Videator support into separate VideatorProxy class and updated with
+ Andrew's latest changes - UNTESTED
+
+ - Replaced funky bit-swapping code; now use #if __BIG_ENDIAN__ to set color
+ masks correctly
+
+ - Removed unnecessary xstdio_osx.c and made executable-relative paths work
+ with standard xstdio.c
+
+ - Added Enter key equivalent for OK button on custom dialogs
+
+ - Added call to resize image when maximizing window
+
+ - Added call to terminate app on window close
+
+ - Enabled long double support for deeper zooms
+
+ - Added event handling for middle and right mouse buttons
+
+ - Added event handling for scroll wheel panning
+
+ - Added copyright headers to all files
+
+ - Changed [view setNeedsDisplay:YES] to [view display] to draw immediately
+ in order to eliminate jerky zooming motion
+
+ - Added support to print status text
+
+ - Made save and open panels use last selected directory instead of always
+ going back to home directory
+
+ - Made window regains key status after open/save dialog
+
+ - Removed "-Videator Enabled" from titlebar
+
+ - Fixes to custom dialogs to correctly display long doubles and allow
+ horizontal scrolling instead of wrapping values
+
+2008-03-20
+
+ REFACTORING/CLEANUP
+
+ - Added autorelease pools to all driver functions, wrapping all controller calls
+
+ - removed autorelease pools from inside controller methods
+
+ - Removed Preferences nib, controller, menu item, and associated icons
+ (Videator support will be toggled via menu item in UI menu)
+
+ - changed driver and function name to cocoa_* instead of osx_*
+
+ - Added MACOSX define that can trigger shared functionality for Cocoa/Carbon drivers
+
+ - Removed separate fullscreen driver
+
+ - Removed wrapper functions from controller; now call view functions directly
+
+ - Added functions for driver init and uninit to controller
+
+ - Added pragma marks to categorize functions in controller and view
+
+ - Moved videator hook to view's drawRect:
+
+ - Added wait date to event handling to prevent busy waiting
+
+ HELP SUPPORT
+
+ - Created Apple Help conversion script
+
+ - Added help settings to Info.plist
+
+ - Updated showHelpWithContext:name: method to show main help page
+
+ - Added help conversion script to pre-compile script build phase
+
+2008-03-31
+
+ DIALOGS
+
+ - Add copy/paste functionality for custom dialogs
+
+ HELP
+
+ - Update help conversion script to automatically generate index
+
+ - Update help to use stylesheets
+
+2008-04-04
+
+ I18N
+
+ - Add reference to gettext library, and script command to copy it
+
+ - Add code to detect default locale and set LANG variable accordingly
+
+
+2008-04-05
+
+ MENUS
+
+ - Added Window menu and associated menu items
+
+ I18N
+
+ - Fixed bug where key equivalents were not found when foreign languages
+ were selected
+
+ - I18nized cut/copy/paste/etc. menu items, and OK/Cancel dialog buttons
+
+2008-04-06
+
+ I18N
+
+ - Add code to convert user's native text encoding (usually UTF-8) to
+ Latin1/2 to prevent garbled text through built-in text handling system
+
+ - Automate po/mo file build and packaging
+
+ - Add code to set locale directory correctly relative to executable path
+
+ MENUS
+
+ - Implement popup menus
+
+ - I18nize menu items in application menu
+
+ HELP
+
+ - fix bug in help conversion that results in missing headers for some files
+
+ - Add help applescript to automatically launch tutorials
+
+2008-04-07
+
+ MENUS
+
+ - Implement menu delegate to check/uncheck menu items when displayed
+
+ DIALOGS
+
+ - Hook up choose file button on custom dialogs
+
+2008-04-09
+
+ FULL SCREEN
+
+ - Implement fullscreen code
+
+ - Add menu item to UI menu to toggle fullscreen mode
+
+ - Change render basename type from to DIALOG_STRING to DIALOG_OFILE
+
+ DRIVER
+
+ - Add driver initialization code
+
+ - Add driver uninitialization code
+
+ MISC
+
+ - Conditionalize custom script build phases so they do not do unnecessary work
+
+2008-04-10
+
+ I18N
+
+ - Added italian translation
+
+ MISC
+
+ - Rebuilt Xcode project to fix issues with debugger and interface builder
+
+ - Incremented Cocoa version number from 3.3 to 3.4
+
+ HELP
+
+ - Got rid of space in help file name
+
+2008-04-14
+
+ I18N
+
+ - Make OK/Cancel buttons on custom dialogs autosize to fit i18n labels
+
+ MISC
+
+ - Change Performance Mode to VJ mode (changed shortcut from P to v)
+ (performance mode might be confused with performance enhancement)
+
+ - Added document icon
+
+ - Added Close menu item to file menu
+
+ - Fixed regression where window did not retain key status after dialog
+
+ - Add cursor changing code in cocoa driver
+
+ - Add hook to change cursor during performance mode
+
+2008-04-16
+
+ HELP
+
+ - Add css element to make dt elements bold
+
+ - Add anchors for usrform and usrformInit to help file
+
+ I18N
+
+ - Updated italian po and catalog
+
+ - Added Italian to configure.in ALL_LINGUAS
+
+ MISC
+
+ - Refine about dialog box
+
+ - Add comments and cleanup
+
+ - Changed version to 3.4pre1 in configure.in
+
+2008-04-17
+
+ BUGS
+
+ - Fix crash after animation rendering
+
+ Analysis: changes introduced for sffe made the uih variable from ui.c
+ global in ui.h so that the sffe parser can be accessed from custom
+ formula code in formulas.c. Uih was previously declared static in render.c
+ because the animation renderer maintains its own context. SFFE changed
+ this from static to extern so the uih in render.c was pointing to the same
+ uih in ui.c, instead of to a different structure. When animations were
+ rendered, the uih in ui.h got clobbered, and the next function that tried
+ to use it caused a segfault.
+
+ Fix:
+ 1. Change name of global uih pointer defined in ui.h from uih to globaluih.
+ 2. Change sffe code to access globaluih pointer instead of uih
+ 3. Add code to main function to set both uih and globaluih to point at the same structure
+ 4. Change code in cocoa driver to use globaluih as well
+
+ - Fix bug that causes XaoS to crash when using non-native (ugly) dialog
+ code for Render Animation dialog with open file dialog for basename
+
+ Analysis: There was a loop in ui_buildfile in dialog.c, that tried to
+ find a "*" in the default filename, and if it didn't find one, it would
+ run right off the end of the buffer and continue until a seg fault occurred.
+
+ Fix: the loop now checks for both "*" or a nul terminator as the exit
+ condition. If it doesn't find an asterisk, it still stops at the end
+ of the string.
+
+ - Make custom dialog boxes slide out of view before executing menu function
+
+ This prevents the dialog from hanging around after clicking OK during long
+ running operations such as rendering animations
+
+ - Add code to prevent rendering animation if absolute path is not specified
+ for Basename. This prevents files from being accidentally written to the
+ hard drive's root directory
+
+2008-04-23
+
+ I18N
+
+ - Changes to -initLocale: do not overwrite LANG if it is already set
+
+ - Added AppController.m and CustomDialog.m in i18n/Makefile.in.in
+
+ - Regenerated po and pot files with new strings from cocoa driver
+
+ MISC
+
+ - Conditionalize window menu with #ifdef MACOSX
+
+2008-04-24
+
+ - Add enable/disable menu item for Videator
+
+ - Move Close menu item to proper place in File menu
+
+ - Reindent code
+
+ - Cleanups to eliminate warnings
+
+ - Conditionalize videator code
+
+2008-04-26
+
+ - Update video encoding section to recommend ffmpeg, mencoder
+
+ - Move Berkeley MPEG encoder information to historical section
+
+ - Create help section to explain how to get support
+
+ - Add library copyright information to credits help section
+
+ - Update Development help section with recent contribution instructions
+
+ - Add Mac OS X help section
+
+ - Add links to Videator in Mac OS X help section
+
+2008-05-15
+
+ - Fix diacritical mark rendering on Mac OS X Tiger
+
+ - Update Italian translation
+
+ - Fix problem with localized application menu
+
+ - Add link to XaoS Website in About dialog
+
+2008-05-20
+
+ - Fix black screen with edge detection filters
+
+ - Fix black screen with pseudo-3d filter
+
+ - Fix black screen with hsv coloring modes
+
+ - Automatically save window position and size
+
+ - Update help file to remove workarounds for fixed issues
+
+2008-05-22
+
+ - Increment version numbers
+
+
+TODO:
+
+* bugs
+
+ - Fix catseye rendering (shows empty circle without increasing bailout)
+ - Cursor changing code only works until the user clicks a button
+
+* acs features
+ - Implement fast palette save/recall
+ - Implement autokeys on startup
+
diff --git a/src/ui/ui-drv/cocoa/VideatorProxy.h b/src/ui/ui-drv/cocoa/VideatorProxy.h
new file mode 100644
index 0000000..f4187ee
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/VideatorProxy.h
@@ -0,0 +1,42 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * Cocoa Driver by J.B. Langston III (jb-langston@austin.rr.com)
+ * Videator Support by Andrew Stone (Stone Design)
+ * For information about Videator, visit http://www.stone.com/Videator
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifdef VIDEATOR_SUPPORT
+#import <Cocoa/Cocoa.h>
+
+@ interface VideatorProxy:NSObject {
+ BOOL _wantsThrottle;
+ NSDate *_lastFrameCreatedDate;
+ id _videatorProxy;
+ NSCalendarDate *_killDate;
+ BOOL _videatorEnabled;
+}
+
+-(void) sendImageRep:(NSBitmapImageRep *) imageRep;
+-(void) toggleVideator:(id) sender;
+-(BOOL) videatorEnabled;
+
+@end
+#endif
diff --git a/src/ui/ui-drv/cocoa/VideatorProxy.m b/src/ui/ui-drv/cocoa/VideatorProxy.m
new file mode 100644
index 0000000..506ac48
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/VideatorProxy.m
@@ -0,0 +1,157 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * Cocoa Driver by J.B. Langston III (jb-langston@austin.rr.com)
+ * Videator Support by Andrew Stone (Stone Design)
+ * For information about Videator, visit http://www.stone.com/Videator
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include <aconfig.h>
+#ifdef VIDEATOR_SUPPORT
+#import "VideatorProxy.h"
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <libc.h>
+
+NSString *cheapHostName() {
+ NSString *host = @"localhost";
+ char s[_POSIX_HOST_NAME_MAX+1];
+ s[0] = '\0';
+ if (gethostname(s, _POSIX_HOST_NAME_MAX) == 0) {
+ if (strlen(s) > 0)
+ host = [[[NSString alloc] initWithUTF8String:s]autorelease];
+ }
+ return host;
+}
+
+#define VideatorServer ([NSString stringWithFormat:@"VideatorServer-%@",cheapHostName()])
+#define FRAME_REFRESH_THRESHOLD 0.04
+
+@protocol VideatorVendedProtocol
+// to notify in main thread
+- (void)runUpdateAlert:(NSString *)latestVersionNumber;
+// XaoS
+- (BOOL)wantsXaoSImage;
+- (void)setXaosImageData:(NSData *)bmData;
+// automator mode to check its not hung
+- (BOOL)heartBeat;
+@end
+
+
+@implementation VideatorProxy
+
++ (void)setupDefaults
+{
+ NSString *userDefaultsValuesPath;
+ NSDictionary *userDefaultsValuesDict;
+ NSDictionary *initialValuesDict;
+ NSArray *resettableUserDefaultsKeys;
+
+ userDefaultsValuesPath=[[NSBundle mainBundle] pathForResource:@"UserDefaults"
+ ofType:@"plist"];
+ userDefaultsValuesDict=[NSDictionary dictionaryWithContentsOfFile:userDefaultsValuesPath];
+
+ [[NSUserDefaults standardUserDefaults] registerDefaults:userDefaultsValuesDict];
+
+ resettableUserDefaultsKeys=[NSArray arrayWithObjects:@"EnableVideator",nil];
+ initialValuesDict=[userDefaultsValuesDict dictionaryWithValuesForKeys:resettableUserDefaultsKeys];
+
+ [[NSUserDefaultsController sharedUserDefaultsController] setInitialValues:initialValuesDict];
+}
+
++ (void)initialize {
+ [self setupDefaults];
+}
+
+- (id)init {
+ self = [super init];
+ if (self) {
+ _videatorEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"EnableVideator"];
+ }
+ return self;
+}
+
+- (void)toggleVideator:(id)sender {
+ _videatorEnabled ^= 1;
+ [[NSUserDefaults standardUserDefaults] setBool:_videatorEnabled forKey:@"EnableVideator"];
+}
+
+- (BOOL)videatorEnabled {
+ return _videatorEnabled;
+}
+
+- (void)connectionDidDie:(NSNotification *)n {
+ _videatorProxy = nil;
+ _killDate = [[NSCalendarDate date] retain];
+ NSLog(@"Videator is dead... ...Long Live Videator!");
+}
+
+- (void)getProxy {
+
+ // do not try and reconnect to an application that is terminating:
+ if (_killDate && [_killDate timeIntervalSinceNow] > -10.0) return;
+ else _killDate = nil;
+
+ _videatorProxy = [[NSConnection rootProxyForConnectionWithRegisteredName:VideatorServer host:nil] retain];
+ // if we can't find it, no big deal:
+ if (_videatorProxy != nil) {
+ [_videatorProxy setProtocolForProxy:@protocol(VideatorVendedProtocol)];
+ [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(connectionDidDie:) name:@"VideatorWillTerminate" object:nil];
+ }
+}
+
+- (void)sendImageRep:(NSBitmapImageRep *)imageRep {
+ // simply return if user does not want this
+ if (!_videatorEnabled) return;
+
+ // Andrew's Videator hook - costs almost nothing since the view maintains the bitmapImageRep in hand -
+ // We call it here because other mechanisms might cause a redraw in the view but we don't want that overhead
+ // unless we've been notified that there really was a change:
+ // HOWEVER we can only shove so much stuff down the pipe - let's try 30 frames per second threshold
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ NSDate *now = [NSDate date];
+
+
+ if (_wantsThrottle) {
+ static float _FRAME_REFRESH_THRESHOLD = 0.0;
+ if (_FRAME_REFRESH_THRESHOLD == 0.0) {
+ _FRAME_REFRESH_THRESHOLD = [[NSUserDefaults standardUserDefaults] floatForKey:@"RefreshThreshold"];
+ if (_FRAME_REFRESH_THRESHOLD == 0.0) _FRAME_REFRESH_THRESHOLD = FRAME_REFRESH_THRESHOLD;
+ }
+ if (_lastFrameCreatedDate && [now timeIntervalSinceDate:_lastFrameCreatedDate] < _FRAME_REFRESH_THRESHOLD) return;
+ [_lastFrameCreatedDate release];
+ _lastFrameCreatedDate = [now retain];
+ }
+
+ if (!_videatorProxy) [self getProxy];
+ NS_DURING
+ if (_videatorProxy!=nil /* DO NOT WAIT FOR THE ROUNDTRIP && [_videatorProxy wantsXaoSImage] */)
+ [_videatorProxy setXaosImageData:[imageRep TIFFRepresentationUsingCompression:NSTIFFCompressionLZW factor:0]];
+ NS_HANDLER
+
+ NS_ENDHANDLER
+
+ [pool release];
+}
+
+@end
+#endif \ No newline at end of file
diff --git a/src/ui/ui-drv/cocoa/XaoS.icns b/src/ui/ui-drv/cocoa/XaoS.icns
new file mode 100644
index 0000000..e03d0cb
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/XaoS.icns
Binary files differ
diff --git a/src/ui/ui-drv/cocoa/XaoS.xcodeproj/project.pbxproj b/src/ui/ui-drv/cocoa/XaoS.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..fd7e096
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/XaoS.xcodeproj/project.pbxproj
@@ -0,0 +1,831 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 44;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
+ D90A09560DB42FD900B7AAFD /* performanceCursor.tiff in Resources */ = {isa = PBXBuildFile; fileRef = D90A09550DB42FD900B7AAFD /* performanceCursor.tiff */; };
+ D90A096A0DB4465100B7AAFD /* XaoSDocument.icns in Resources */ = {isa = PBXBuildFile; fileRef = D90A09690DB4465100B7AAFD /* XaoSDocument.icns */; };
+ D962B0AD101CA598003C66CE /* grlib_cocoa.m in Sources */ = {isa = PBXBuildFile; fileRef = D962B0AC101CA598003C66CE /* grlib_cocoa.m */; };
+ D962B20C101E9149003C66CE /* grlib.c in Sources */ = {isa = PBXBuildFile; fileRef = D962B20B101E9149003C66CE /* grlib.c */; };
+ D99B5B740DAEE9D100489809 /* ui_cocoa.m in Sources */ = {isa = PBXBuildFile; fileRef = D99B5B730DAEE9D100489809 /* ui_cocoa.m */; };
+ D99B5B7E0DAEE9E700489809 /* AppController.m in Sources */ = {isa = PBXBuildFile; fileRef = D99B5B770DAEE9E700489809 /* AppController.m */; };
+ D99B5B7F0DAEE9E700489809 /* FractalView.m in Sources */ = {isa = PBXBuildFile; fileRef = D99B5B790DAEE9E700489809 /* FractalView.m */; };
+ D99B5B800DAEE9E700489809 /* CustomDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = D99B5B7B0DAEE9E700489809 /* CustomDialog.m */; };
+ D99B5B810DAEE9E700489809 /* VideatorProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = D99B5B7D0DAEE9E700489809 /* VideatorProxy.m */; };
+ D99B5C040DAEEA2700489809 /* cmplx.asm in Sources */ = {isa = PBXBuildFile; fileRef = D99B5B890DAEEA2700489809 /* cmplx.asm */; };
+ D99B5C050DAEEA2700489809 /* sffe.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5B8A0DAEEA2700489809 /* sffe.c */; };
+ D99B5C060DAEEA2700489809 /* sffe_cmplx_asm.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5B8B0DAEEA2700489809 /* sffe_cmplx_asm.c */; };
+ D99B5C070DAEEA2700489809 /* sffe_cmplx_gsl.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5B8C0DAEEA2700489809 /* sffe_cmplx_gsl.c */; };
+ D99B5C160DAEEA2700489809 /* subwindow.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BC70DAEEA2700489809 /* subwindow.c */; };
+ D99B5C170DAEEA2700489809 /* palettef.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BC80DAEEA2700489809 /* palettef.c */; };
+ D99B5C180DAEEA2700489809 /* interlace.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BC90DAEEA2700489809 /* interlace.c */; };
+ D99B5C190DAEEA2700489809 /* edge2.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BCA0DAEEA2700489809 /* edge2.c */; };
+ D99B5C1A0DAEEA2700489809 /* fractal.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BCB0DAEEA2700489809 /* fractal.c */; };
+ D99B5C1B0DAEEA2700489809 /* rotate.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BCC0DAEEA2700489809 /* rotate.c */; };
+ D99B5C1C0DAEEA2700489809 /* itersmall.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BCD0DAEEA2700489809 /* itersmall.c */; };
+ D99B5C1D0DAEEA2700489809 /* blur.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BCE0DAEEA2700489809 /* blur.c */; };
+ D99B5C1E0DAEEA2700489809 /* anti.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BCF0DAEEA2700489809 /* anti.c */; };
+ D99B5C1F0DAEEA2700489809 /* stereogram.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BD00DAEEA2700489809 /* stereogram.c */; };
+ D99B5C200DAEEA2700489809 /* edge.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BD10DAEEA2700489809 /* edge.c */; };
+ D99B5C210DAEEA2700489809 /* zoom.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BD20DAEEA2700489809 /* zoom.c */; };
+ D99B5C220DAEEA2700489809 /* star.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BD30DAEEA2700489809 /* star.c */; };
+ D99B5C230DAEEA2700489809 /* formulas.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BD40DAEEA2700489809 /* formulas.c */; };
+ D99B5C240DAEEA2700489809 /* emboss.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BD50DAEEA2700489809 /* emboss.c */; };
+ D99B5C250DAEEA2700489809 /* julia.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BD60DAEEA2700489809 /* julia.c */; };
+ D99B5C260DAEEA2700489809 /* btrace.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BD70DAEEA2700489809 /* btrace.c */; };
+ D99B5C270DAEEA2700489809 /* i386.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BD80DAEEA2700489809 /* i386.c */; };
+ D99B5C280DAEEA2700489809 /* dither.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BD90DAEEA2700489809 /* dither.c */; };
+ D99B5C290DAEEA2700489809 /* 3d.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BDA0DAEEA2700489809 /* 3d.c */; };
+ D99B5C2A0DAEEA2700489809 /* plane.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BDB0DAEEA2700489809 /* plane.c */; };
+ D99B5C2B0DAEEA2700489809 /* filter.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BDD0DAEEA2700489809 /* filter.c */; };
+ D99B5C2C0DAEEA2700489809 /* palette.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BDE0DAEEA2700489809 /* palette.c */; };
+ D99B5C2D0DAEEA2700489809 /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BDF0DAEEA2700489809 /* random.c */; };
+ D99B5C2F0DAEEA2700489809 /* font.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BE10DAEEA2700489809 /* font.c */; };
+ D99B5C300DAEEA2700489809 /* image.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BE20DAEEA2700489809 /* image.c */; };
+ D99B5C310DAEEA2700489809 /* drivers.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BE40DAEEA2700489809 /* drivers.c */; };
+ D99B5C320DAEEA2700489809 /* dialog.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BE50DAEEA2700489809 /* dialog.c */; };
+ D99B5C330DAEEA2700489809 /* uihelp.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BE60DAEEA2700489809 /* uihelp.c */; };
+ D99B5C340DAEEA2700489809 /* uimenu.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BE70DAEEA2700489809 /* uimenu.c */; };
+ D99B5C350DAEEA2700489809 /* fparams.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BE80DAEEA2700489809 /* fparams.c */; };
+ D99B5C360DAEEA2700489809 /* ui.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BE90DAEEA2700489809 /* ui.c */; };
+ D99B5C370DAEEA2700489809 /* param.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BEA0DAEEA2700489809 /* param.c */; };
+ D99B5C380DAEEA2700489809 /* filesel.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BEB0DAEEA2700489809 /* filesel.c */; };
+ D99B5C390DAEEA2700489809 /* pipecmd.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BEC0DAEEA2700489809 /* pipecmd.c */; };
+ D99B5C3A0DAEEA2700489809 /* save.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BEE0DAEEA2700489809 /* save.c */; };
+ D99B5C3B0DAEEA2700489809 /* menu.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BEF0DAEEA2700489809 /* menu.c */; };
+ D99B5C3C0DAEEA2700489809 /* wstack.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BF00DAEEA2700489809 /* wstack.c */; };
+ D99B5C3D0DAEEA2700489809 /* playtext.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BF10DAEEA2700489809 /* playtext.c */; };
+ D99B5C3E0DAEEA2700489809 /* render.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BF20DAEEA2700489809 /* render.c */; };
+ D99B5C3F0DAEEA2700489809 /* play.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BF30DAEEA2700489809 /* play.c */; };
+ D99B5C400DAEEA2700489809 /* messg.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BF40DAEEA2700489809 /* messg.c */; };
+ D99B5C410DAEEA2700489809 /* ui_helper.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BF50DAEEA2700489809 /* ui_helper.c */; };
+ D99B5C420DAEEA2700489809 /* autopilot.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BF60DAEEA2700489809 /* autopilot.c */; };
+ D99B5C430DAEEA2700489809 /* xmenu.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BF80DAEEA2700489809 /* xmenu.c */; };
+ D99B5C440DAEEA2700489809 /* png.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BF90DAEEA2700489809 /* png.c */; };
+ D99B5C450DAEEA2700489809 /* xstring.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BFA0DAEEA2700489809 /* xstring.c */; };
+ D99B5C460DAEEA2700489809 /* xshl.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BFB0DAEEA2700489809 /* xshl.c */; };
+ D99B5C470DAEEA2700489809 /* xldio.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BFC0DAEEA2700489809 /* xldio.c */; };
+ D99B5C480DAEEA2700489809 /* help.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BFD0DAEEA2700489809 /* help.c */; };
+ D99B5C490DAEEA2700489809 /* xerror.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BFE0DAEEA2700489809 /* xerror.c */; };
+ D99B5C4A0DAEEA2700489809 /* thread.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5BFF0DAEEA2700489809 /* thread.c */; };
+ D99B5C4B0DAEEA2700489809 /* timers.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5C000DAEEA2700489809 /* timers.c */; };
+ D99B5C4D0DAEEA2700489809 /* xstdio.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5C020DAEEA2700489809 /* xstdio.c */; };
+ D99B5C4E0DAEEA2700489809 /* catalog.c in Sources */ = {isa = PBXBuildFile; fileRef = D99B5C030DAEEA2700489809 /* catalog.c */; };
+ D99B5C500DAEEA6900489809 /* XaoS.icns in Resources */ = {isa = PBXBuildFile; fileRef = D99B5C4F0DAEEA6900489809 /* XaoS.icns */; };
+ D99B5E070DAEEB1200489809 /* XaoSHelp in Resources */ = {isa = PBXBuildFile; fileRef = D99B5D700DAEEB1200489809 /* XaoSHelp */; };
+ D99B5E0C0DAEEB4C00489809 /* libintl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D99B5E090DAEEB4C00489809 /* libintl.dylib */; };
+ D99B5E0D0DAEEB4C00489809 /* libgsl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D99B5E0A0DAEEB4C00489809 /* libgsl.dylib */; };
+ D99B5E0E0DAEEB4C00489809 /* libpng.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D99B5E0B0DAEEB4C00489809 /* libpng.dylib */; };
+ D99B5E1D0DAEEBD400489809 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D99B5E1C0DAEEBD400489809 /* Carbon.framework */; };
+ D99B5E200DAEEC0E00489809 /* libintl.dylib in Copy Embedded Frameworks and Libraries */ = {isa = PBXBuildFile; fileRef = D99B5E090DAEEB4C00489809 /* libintl.dylib */; };
+ D99B5E210DAEEC0E00489809 /* libgsl.dylib in Copy Embedded Frameworks and Libraries */ = {isa = PBXBuildFile; fileRef = D99B5E0A0DAEEB4C00489809 /* libgsl.dylib */; };
+ D99B5E220DAEEC0E00489809 /* libpng.dylib in Copy Embedded Frameworks and Libraries */ = {isa = PBXBuildFile; fileRef = D99B5E0B0DAEEB4C00489809 /* libpng.dylib */; };
+ D99B5E690DAEF3A400489809 /* Credits.html in Resources */ = {isa = PBXBuildFile; fileRef = D99B5E670DAEF3A400489809 /* Credits.html */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ D99B5E1F0DAEEC0D00489809 /* Copy Embedded Frameworks and Libraries */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ D99B5E200DAEEC0E00489809 /* libintl.dylib in Copy Embedded Frameworks and Libraries */,
+ D99B5E210DAEEC0E00489809 /* libgsl.dylib in Copy Embedded Frameworks and Libraries */,
+ D99B5E220DAEEC0E00489809 /* libpng.dylib in Copy Embedded Frameworks and Libraries */,
+ );
+ name = "Copy Embedded Frameworks and Libraries";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
+ 29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ 32CA4F630368D1EE00C91783 /* XaoS_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XaoS_Prefix.pch; sourceTree = "<group>"; };
+ 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 8D1107320486CEB800E47090 /* XaoS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = XaoS.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ D90A09550DB42FD900B7AAFD /* performanceCursor.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = performanceCursor.tiff; sourceTree = "<group>"; };
+ D90A09690DB4465100B7AAFD /* XaoSDocument.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = XaoSDocument.icns; sourceTree = "<group>"; };
+ D95DA721101FE23800826B31 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
+ D962B0AC101CA598003C66CE /* grlib_cocoa.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = grlib_cocoa.m; sourceTree = "<group>"; };
+ D962B20B101E9149003C66CE /* grlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = grlib.c; path = ../../../filter/grlib.c; sourceTree = SOURCE_ROOT; };
+ D99B5B710DAEE9D100489809 /* aconfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aconfig.h; sourceTree = "<group>"; };
+ D99B5B720DAEE9D100489809 /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = version.h; sourceTree = "<group>"; };
+ D99B5B730DAEE9D100489809 /* ui_cocoa.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ui_cocoa.m; sourceTree = "<group>"; };
+ D99B5B760DAEE9E700489809 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = "<group>"; };
+ D99B5B770DAEE9E700489809 /* AppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppController.m; sourceTree = "<group>"; };
+ D99B5B780DAEE9E700489809 /* FractalView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FractalView.h; sourceTree = "<group>"; };
+ D99B5B790DAEE9E700489809 /* FractalView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FractalView.m; sourceTree = "<group>"; };
+ D99B5B7A0DAEE9E700489809 /* CustomDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomDialog.h; sourceTree = "<group>"; };
+ D99B5B7B0DAEE9E700489809 /* CustomDialog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomDialog.m; sourceTree = "<group>"; };
+ D99B5B7C0DAEE9E700489809 /* VideatorProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideatorProxy.h; sourceTree = "<group>"; };
+ D99B5B7D0DAEE9E700489809 /* VideatorProxy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VideatorProxy.m; sourceTree = "<group>"; };
+ D99B5B820DAEEA0800489809 /* Readme Cocoa */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Readme Cocoa"; sourceTree = "<group>"; };
+ D99B5B830DAEEA0800489809 /* HowToBuild.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HowToBuild.txt; sourceTree = "<group>"; };
+ D99B5B890DAEEA2700489809 /* cmplx.asm */ = {isa = PBXFileReference; explicitFileType = sourcecode.nasm; fileEncoding = 4; path = cmplx.asm; sourceTree = "<group>"; };
+ D99B5B8A0DAEEA2700489809 /* sffe.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sffe.c; sourceTree = "<group>"; };
+ D99B5B8B0DAEEA2700489809 /* sffe_cmplx_asm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sffe_cmplx_asm.c; sourceTree = "<group>"; };
+ D99B5B8C0DAEEA2700489809 /* sffe_cmplx_gsl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sffe_cmplx_gsl.c; sourceTree = "<group>"; };
+ D99B5B8F0DAEEA2700489809 /* archaccel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = archaccel.h; sourceTree = "<group>"; };
+ D99B5B900DAEEA2700489809 /* btrace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = btrace.h; sourceTree = "<group>"; };
+ D99B5B910DAEEA2700489809 /* c256.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = c256.h; sourceTree = "<group>"; };
+ D99B5B920DAEEA2700489809 /* catalog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catalog.h; sourceTree = "<group>"; };
+ D99B5B930DAEEA2700489809 /* complex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = complex.h; sourceTree = "<group>"; };
+ D99B5BA10DAEEA2700489809 /* cursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cursor.h; sourceTree = "<group>"; };
+ D99B5BA20DAEEA2700489809 /* fconfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fconfig.h; sourceTree = "<group>"; };
+ D99B5BA30DAEEA2700489809 /* filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = filter.h; sourceTree = "<group>"; };
+ D99B5BA40DAEEA2700489809 /* formulas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = formulas.h; sourceTree = "<group>"; };
+ D99B5BA50DAEEA2700489809 /* fractal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fractal.h; sourceTree = "<group>"; };
+ D99B5BA60DAEEA2700489809 /* gccaccel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gccaccel.h; sourceTree = "<group>"; };
+ D99B5BA70DAEEA2700489809 /* gccbuild.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gccbuild.h; sourceTree = "<group>"; };
+ D99B5BA80DAEEA2700489809 /* generic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = generic.h; sourceTree = "<group>"; };
+ D99B5BA90DAEEA2700489809 /* grlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = grlib.h; sourceTree = "<group>"; };
+ D99B5BAA0DAEEA2700489809 /* hicolor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hicolor.h; sourceTree = "<group>"; };
+ D99B5BAC0DAEEA2700489809 /* __math.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = __math.h; sourceTree = "<group>"; };
+ D99B5BAD0DAEEA2700489809 /* ctrl87.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ctrl87.h; sourceTree = "<group>"; };
+ D99B5BAE0DAEEA2700489809 /* sstring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sstring.h; sourceTree = "<group>"; };
+ D99B5BB30DAEEA2700489809 /* misc-f.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "misc-f.h"; sourceTree = "<group>"; };
+ D99B5BB40DAEEA2700489809 /* param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = param.h; sourceTree = "<group>"; };
+ D99B5BB50DAEEA2700489809 /* pixel_t.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pixel_t.h; sourceTree = "<group>"; };
+ D99B5BB60DAEEA2700489809 /* plane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = plane.h; sourceTree = "<group>"; };
+ D99B5BB80DAEEA2700489809 /* timers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = timers.h; sourceTree = "<group>"; };
+ D99B5BB90DAEEA2700489809 /* true24.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = true24.h; sourceTree = "<group>"; };
+ D99B5BBA0DAEEA2700489809 /* truecolor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = truecolor.h; sourceTree = "<group>"; };
+ D99B5BBB0DAEEA2700489809 /* ui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ui.h; sourceTree = "<group>"; };
+ D99B5BBC0DAEEA2700489809 /* ui_helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ui_helper.h; sourceTree = "<group>"; };
+ D99B5BBE0DAEEA2700489809 /* version.h.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = version.h.in; sourceTree = "<group>"; };
+ D99B5BBF0DAEEA2700489809 /* xerror.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xerror.h; sourceTree = "<group>"; };
+ D99B5BC00DAEEA2700489809 /* xio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xio.h; sourceTree = "<group>"; };
+ D99B5BC10DAEEA2700489809 /* xldio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xldio.h; sourceTree = "<group>"; };
+ D99B5BC20DAEEA2700489809 /* xmenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xmenu.h; sourceTree = "<group>"; };
+ D99B5BC30DAEEA2700489809 /* xshl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xshl.h; sourceTree = "<group>"; };
+ D99B5BC40DAEEA2700489809 /* xthread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xthread.h; sourceTree = "<group>"; };
+ D99B5BC50DAEEA2700489809 /* zoom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zoom.h; sourceTree = "<group>"; };
+ D99B5BC70DAEEA2700489809 /* subwindow.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = subwindow.c; path = ../../../engine/subwindow.c; sourceTree = SOURCE_ROOT; };
+ D99B5BC80DAEEA2700489809 /* palettef.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = palettef.c; path = ../../../engine/palettef.c; sourceTree = SOURCE_ROOT; };
+ D99B5BC90DAEEA2700489809 /* interlace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = interlace.c; path = ../../../engine/interlace.c; sourceTree = SOURCE_ROOT; };
+ D99B5BCA0DAEEA2700489809 /* edge2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = edge2.c; path = ../../../engine/edge2.c; sourceTree = SOURCE_ROOT; };
+ D99B5BCB0DAEEA2700489809 /* fractal.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = fractal.c; path = ../../../engine/fractal.c; sourceTree = SOURCE_ROOT; };
+ D99B5BCC0DAEEA2700489809 /* rotate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = rotate.c; path = ../../../engine/rotate.c; sourceTree = SOURCE_ROOT; };
+ D99B5BCD0DAEEA2700489809 /* itersmall.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = itersmall.c; path = ../../../engine/itersmall.c; sourceTree = SOURCE_ROOT; };
+ D99B5BCE0DAEEA2700489809 /* blur.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = blur.c; path = ../../../engine/blur.c; sourceTree = SOURCE_ROOT; };
+ D99B5BCF0DAEEA2700489809 /* anti.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = anti.c; path = ../../../engine/anti.c; sourceTree = SOURCE_ROOT; };
+ D99B5BD00DAEEA2700489809 /* stereogram.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = stereogram.c; path = ../../../engine/stereogram.c; sourceTree = SOURCE_ROOT; };
+ D99B5BD10DAEEA2700489809 /* edge.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = edge.c; path = ../../../engine/edge.c; sourceTree = SOURCE_ROOT; };
+ D99B5BD20DAEEA2700489809 /* zoom.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zoom.c; path = ../../../engine/zoom.c; sourceTree = SOURCE_ROOT; };
+ D99B5BD30DAEEA2700489809 /* star.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = star.c; path = ../../../engine/star.c; sourceTree = SOURCE_ROOT; };
+ D99B5BD40DAEEA2700489809 /* formulas.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = formulas.c; path = ../../../engine/formulas.c; sourceTree = SOURCE_ROOT; };
+ D99B5BD50DAEEA2700489809 /* emboss.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = emboss.c; path = ../../../engine/emboss.c; sourceTree = SOURCE_ROOT; };
+ D99B5BD60DAEEA2700489809 /* julia.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = julia.c; path = ../../../engine/julia.c; sourceTree = SOURCE_ROOT; };
+ D99B5BD70DAEEA2700489809 /* btrace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = btrace.c; path = ../../../engine/btrace.c; sourceTree = SOURCE_ROOT; };
+ D99B5BD80DAEEA2700489809 /* i386.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = i386.c; path = ../../../engine/i386.c; sourceTree = SOURCE_ROOT; };
+ D99B5BD90DAEEA2700489809 /* dither.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = dither.c; path = ../../../engine/dither.c; sourceTree = SOURCE_ROOT; };
+ D99B5BDA0DAEEA2700489809 /* 3d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = 3d.c; path = ../../../engine/3d.c; sourceTree = SOURCE_ROOT; };
+ D99B5BDB0DAEEA2700489809 /* plane.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = plane.c; path = ../../../engine/plane.c; sourceTree = SOURCE_ROOT; };
+ D99B5BDD0DAEEA2700489809 /* filter.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = filter.c; path = ../../../filter/filter.c; sourceTree = SOURCE_ROOT; };
+ D99B5BDE0DAEEA2700489809 /* palette.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = palette.c; path = ../../../filter/palette.c; sourceTree = SOURCE_ROOT; };
+ D99B5BDF0DAEEA2700489809 /* random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = random.c; path = ../../../filter/random.c; sourceTree = SOURCE_ROOT; };
+ D99B5BE10DAEEA2700489809 /* font.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = font.c; path = ../../../filter/font.c; sourceTree = SOURCE_ROOT; };
+ D99B5BE20DAEEA2700489809 /* image.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = image.c; path = ../../../filter/image.c; sourceTree = SOURCE_ROOT; };
+ D99B5BE40DAEEA2700489809 /* drivers.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = drivers.c; path = ../../drivers.c; sourceTree = SOURCE_ROOT; };
+ D99B5BE50DAEEA2700489809 /* dialog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = dialog.c; path = ../../dialog.c; sourceTree = SOURCE_ROOT; };
+ D99B5BE60DAEEA2700489809 /* uihelp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = uihelp.c; path = ../../uihelp.c; sourceTree = SOURCE_ROOT; };
+ D99B5BE70DAEEA2700489809 /* uimenu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = uimenu.c; path = ../../uimenu.c; sourceTree = SOURCE_ROOT; };
+ D99B5BE80DAEEA2700489809 /* fparams.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = fparams.c; path = ../../fparams.c; sourceTree = SOURCE_ROOT; };
+ D99B5BE90DAEEA2700489809 /* ui.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ui.c; path = ../../ui.c; sourceTree = SOURCE_ROOT; };
+ D99B5BEA0DAEEA2700489809 /* param.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = param.c; path = ../../param.c; sourceTree = SOURCE_ROOT; };
+ D99B5BEB0DAEEA2700489809 /* filesel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = filesel.c; path = ../../filesel.c; sourceTree = SOURCE_ROOT; };
+ D99B5BEC0DAEEA2700489809 /* pipecmd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pipecmd.c; path = ../../pipecmd.c; sourceTree = SOURCE_ROOT; };
+ D99B5BEE0DAEEA2700489809 /* save.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = save.c; path = "../../../ui-hlp/save.c"; sourceTree = SOURCE_ROOT; };
+ D99B5BEF0DAEEA2700489809 /* menu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = menu.c; path = "../../../ui-hlp/menu.c"; sourceTree = SOURCE_ROOT; };
+ D99B5BF00DAEEA2700489809 /* wstack.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = wstack.c; path = "../../../ui-hlp/wstack.c"; sourceTree = SOURCE_ROOT; };
+ D99B5BF10DAEEA2700489809 /* playtext.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = playtext.c; path = "../../../ui-hlp/playtext.c"; sourceTree = SOURCE_ROOT; };
+ D99B5BF20DAEEA2700489809 /* render.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = render.c; path = "../../../ui-hlp/render.c"; sourceTree = SOURCE_ROOT; };
+ D99B5BF30DAEEA2700489809 /* play.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = play.c; path = "../../../ui-hlp/play.c"; sourceTree = SOURCE_ROOT; };
+ D99B5BF40DAEEA2700489809 /* messg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = messg.c; path = "../../../ui-hlp/messg.c"; sourceTree = SOURCE_ROOT; };
+ D99B5BF50DAEEA2700489809 /* ui_helper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ui_helper.c; path = "../../../ui-hlp/ui_helper.c"; sourceTree = SOURCE_ROOT; };
+ D99B5BF60DAEEA2700489809 /* autopilot.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = autopilot.c; path = "../../../ui-hlp/autopilot.c"; sourceTree = SOURCE_ROOT; };
+ D99B5BF80DAEEA2700489809 /* xmenu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = xmenu.c; path = ../../../util/xmenu.c; sourceTree = SOURCE_ROOT; };
+ D99B5BF90DAEEA2700489809 /* png.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = png.c; path = ../../../util/png.c; sourceTree = SOURCE_ROOT; };
+ D99B5BFA0DAEEA2700489809 /* xstring.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = xstring.c; path = ../../../util/xstring.c; sourceTree = SOURCE_ROOT; };
+ D99B5BFB0DAEEA2700489809 /* xshl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = xshl.c; path = ../../../util/xshl.c; sourceTree = SOURCE_ROOT; };
+ D99B5BFC0DAEEA2700489809 /* xldio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = xldio.c; path = ../../../util/xldio.c; sourceTree = SOURCE_ROOT; };
+ D99B5BFD0DAEEA2700489809 /* help.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = help.c; path = ../../../util/help.c; sourceTree = SOURCE_ROOT; };
+ D99B5BFE0DAEEA2700489809 /* xerror.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = xerror.c; path = ../../../util/xerror.c; sourceTree = SOURCE_ROOT; };
+ D99B5BFF0DAEEA2700489809 /* thread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = thread.c; path = ../../../util/thread.c; sourceTree = SOURCE_ROOT; };
+ D99B5C000DAEEA2700489809 /* timers.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = timers.c; path = ../../../util/timers.c; sourceTree = SOURCE_ROOT; };
+ D99B5C020DAEEA2700489809 /* xstdio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = xstdio.c; path = ../../../util/xstdio.c; sourceTree = SOURCE_ROOT; };
+ D99B5C030DAEEA2700489809 /* catalog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = catalog.c; path = ../../../util/catalog.c; sourceTree = SOURCE_ROOT; };
+ D99B5C4F0DAEEA6900489809 /* XaoS.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = XaoS.icns; sourceTree = "<group>"; };
+ D99B5D700DAEEB1200489809 /* XaoSHelp */ = {isa = PBXFileReference; lastKnownFileType = folder; name = XaoSHelp; path = ../../../../help/XaoSHelp; sourceTree = SOURCE_ROOT; };
+ D99B5E090DAEEB4C00489809 /* libintl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libintl.dylib; sourceTree = "<group>"; };
+ D99B5E0A0DAEEB4C00489809 /* libgsl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libgsl.dylib; sourceTree = "<group>"; };
+ D99B5E0B0DAEEB4C00489809 /* libpng.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libpng.dylib; sourceTree = "<group>"; };
+ D99B5E1C0DAEEBD400489809 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
+ D99B5E680DAEF3A400489809 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = English; path = English.lproj/Credits.html; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8D11072E0486CEB800E47090 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
+ D99B5E1D0DAEEBD400489809 /* Carbon.framework in Frameworks */,
+ D99B5E0C0DAEEB4C00489809 /* libintl.dylib in Frameworks */,
+ D99B5E0D0DAEEB4C00489809 /* libgsl.dylib in Frameworks */,
+ D99B5E0E0DAEEB4C00489809 /* libpng.dylib in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 080E96DDFE201D6D7F000001 /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ D99B5B760DAEE9E700489809 /* AppController.h */,
+ D99B5B770DAEE9E700489809 /* AppController.m */,
+ D99B5B780DAEE9E700489809 /* FractalView.h */,
+ D99B5B790DAEE9E700489809 /* FractalView.m */,
+ D99B5B7A0DAEE9E700489809 /* CustomDialog.h */,
+ D99B5B7B0DAEE9E700489809 /* CustomDialog.m */,
+ D99B5B7C0DAEE9E700489809 /* VideatorProxy.h */,
+ D99B5B7D0DAEE9E700489809 /* VideatorProxy.m */,
+ );
+ name = Classes;
+ sourceTree = "<group>";
+ };
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ D99B5E1C0DAEEBD400489809 /* Carbon.framework */,
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
+ );
+ name = "Linked Frameworks";
+ sourceTree = "<group>";
+ };
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */,
+ 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 19C28FACFE9D520D11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107320486CEB800E47090 /* XaoS.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* XaoS */ = {
+ isa = PBXGroup;
+ children = (
+ D99B5B820DAEEA0800489809 /* Readme Cocoa */,
+ D99B5B830DAEEA0800489809 /* HowToBuild.txt */,
+ 080E96DDFE201D6D7F000001 /* Classes */,
+ 29B97315FDCFA39411CA2CEA /* Other Sources */,
+ D99B5B860DAEEA2700489809 /* Shared Sources */,
+ 29B97317FDCFA39411CA2CEA /* Resources */,
+ D99B5E080DAEEB2B00489809 /* Embedded Frameworks and Libraries */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = XaoS;
+ sourceTree = "<group>";
+ };
+ 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 32CA4F630368D1EE00C91783 /* XaoS_Prefix.pch */,
+ D99B5B710DAEE9D100489809 /* aconfig.h */,
+ D99B5B720DAEE9D100489809 /* version.h */,
+ D99B5B730DAEE9D100489809 /* ui_cocoa.m */,
+ D962B0AC101CA598003C66CE /* grlib_cocoa.m */,
+ );
+ name = "Other Sources";
+ sourceTree = "<group>";
+ };
+ 29B97317FDCFA39411CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ D99B5E670DAEF3A400489809 /* Credits.html */,
+ 8D1107310486CEB800E47090 /* Info.plist */,
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
+ 29B97318FDCFA39411CA2CEA /* MainMenu.nib */,
+ D99B5C4F0DAEEA6900489809 /* XaoS.icns */,
+ D90A09690DB4465100B7AAFD /* XaoSDocument.icns */,
+ D90A09550DB42FD900B7AAFD /* performanceCursor.tiff */,
+ D99B5D700DAEEB1200489809 /* XaoSHelp */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ D99B5B860DAEEA2700489809 /* Shared Sources */ = {
+ isa = PBXGroup;
+ children = (
+ D99B5BF70DAEEA2700489809 /* util */,
+ D99B5BED0DAEEA2700489809 /* ui-hlp */,
+ D99B5BE30DAEEA2700489809 /* ui */,
+ D99B5BDC0DAEEA2700489809 /* filter */,
+ D99B5BC60DAEEA2700489809 /* engine */,
+ D99B5B870DAEEA2700489809 /* sffe */,
+ D99B5B8D0DAEEA2700489809 /* include */,
+ );
+ name = "Shared Sources";
+ sourceTree = "<group>";
+ };
+ D99B5B870DAEEA2700489809 /* sffe */ = {
+ isa = PBXGroup;
+ children = (
+ D99B5B880DAEEA2700489809 /* asm */,
+ D99B5B8A0DAEEA2700489809 /* sffe.c */,
+ D99B5B8B0DAEEA2700489809 /* sffe_cmplx_asm.c */,
+ D99B5B8C0DAEEA2700489809 /* sffe_cmplx_gsl.c */,
+ );
+ name = sffe;
+ path = ../../../sffe;
+ sourceTree = SOURCE_ROOT;
+ };
+ D99B5B880DAEEA2700489809 /* asm */ = {
+ isa = PBXGroup;
+ children = (
+ D99B5B890DAEEA2700489809 /* cmplx.asm */,
+ );
+ path = asm;
+ sourceTree = "<group>";
+ };
+ D99B5B8D0DAEEA2700489809 /* include */ = {
+ isa = PBXGroup;
+ children = (
+ D95DA721101FE23800826B31 /* config.h */,
+ D99B5B8F0DAEEA2700489809 /* archaccel.h */,
+ D99B5B900DAEEA2700489809 /* btrace.h */,
+ D99B5B910DAEEA2700489809 /* c256.h */,
+ D99B5B920DAEEA2700489809 /* catalog.h */,
+ D99B5B930DAEEA2700489809 /* complex.h */,
+ D99B5BA10DAEEA2700489809 /* cursor.h */,
+ D99B5BA20DAEEA2700489809 /* fconfig.h */,
+ D99B5BA30DAEEA2700489809 /* filter.h */,
+ D99B5BA40DAEEA2700489809 /* formulas.h */,
+ D99B5BA50DAEEA2700489809 /* fractal.h */,
+ D99B5BA60DAEEA2700489809 /* gccaccel.h */,
+ D99B5BA70DAEEA2700489809 /* gccbuild.h */,
+ D99B5BA80DAEEA2700489809 /* generic.h */,
+ D99B5BA90DAEEA2700489809 /* grlib.h */,
+ D99B5BAA0DAEEA2700489809 /* hicolor.h */,
+ D99B5BAB0DAEEA2700489809 /* i386 */,
+ D99B5BB30DAEEA2700489809 /* misc-f.h */,
+ D99B5BB40DAEEA2700489809 /* param.h */,
+ D99B5BB50DAEEA2700489809 /* pixel_t.h */,
+ D99B5BB60DAEEA2700489809 /* plane.h */,
+ D99B5BB80DAEEA2700489809 /* timers.h */,
+ D99B5BB90DAEEA2700489809 /* true24.h */,
+ D99B5BBA0DAEEA2700489809 /* truecolor.h */,
+ D99B5BBB0DAEEA2700489809 /* ui.h */,
+ D99B5BBC0DAEEA2700489809 /* ui_helper.h */,
+ D99B5BBE0DAEEA2700489809 /* version.h.in */,
+ D99B5BBF0DAEEA2700489809 /* xerror.h */,
+ D99B5BC00DAEEA2700489809 /* xio.h */,
+ D99B5BC10DAEEA2700489809 /* xldio.h */,
+ D99B5BC20DAEEA2700489809 /* xmenu.h */,
+ D99B5BC30DAEEA2700489809 /* xshl.h */,
+ D99B5BC40DAEEA2700489809 /* xthread.h */,
+ D99B5BC50DAEEA2700489809 /* zoom.h */,
+ );
+ name = include;
+ path = ../../../include;
+ sourceTree = SOURCE_ROOT;
+ };
+ D99B5BAB0DAEEA2700489809 /* i386 */ = {
+ isa = PBXGroup;
+ children = (
+ D99B5BAC0DAEEA2700489809 /* __math.h */,
+ D99B5BAD0DAEEA2700489809 /* ctrl87.h */,
+ D99B5BAE0DAEEA2700489809 /* sstring.h */,
+ );
+ path = i386;
+ sourceTree = "<group>";
+ };
+ D99B5BC60DAEEA2700489809 /* engine */ = {
+ isa = PBXGroup;
+ children = (
+ D99B5BC70DAEEA2700489809 /* subwindow.c */,
+ D99B5BC80DAEEA2700489809 /* palettef.c */,
+ D99B5BC90DAEEA2700489809 /* interlace.c */,
+ D99B5BCA0DAEEA2700489809 /* edge2.c */,
+ D99B5BCB0DAEEA2700489809 /* fractal.c */,
+ D99B5BCC0DAEEA2700489809 /* rotate.c */,
+ D99B5BCD0DAEEA2700489809 /* itersmall.c */,
+ D99B5BCE0DAEEA2700489809 /* blur.c */,
+ D99B5BCF0DAEEA2700489809 /* anti.c */,
+ D99B5BD00DAEEA2700489809 /* stereogram.c */,
+ D99B5BD10DAEEA2700489809 /* edge.c */,
+ D99B5BD20DAEEA2700489809 /* zoom.c */,
+ D99B5BD30DAEEA2700489809 /* star.c */,
+ D99B5BD40DAEEA2700489809 /* formulas.c */,
+ D99B5BD50DAEEA2700489809 /* emboss.c */,
+ D99B5BD60DAEEA2700489809 /* julia.c */,
+ D99B5BD70DAEEA2700489809 /* btrace.c */,
+ D99B5BD80DAEEA2700489809 /* i386.c */,
+ D99B5BD90DAEEA2700489809 /* dither.c */,
+ D99B5BDA0DAEEA2700489809 /* 3d.c */,
+ D99B5BDB0DAEEA2700489809 /* plane.c */,
+ );
+ name = engine;
+ sourceTree = "<group>";
+ };
+ D99B5BDC0DAEEA2700489809 /* filter */ = {
+ isa = PBXGroup;
+ children = (
+ D962B20B101E9149003C66CE /* grlib.c */,
+ D99B5BDD0DAEEA2700489809 /* filter.c */,
+ D99B5BDE0DAEEA2700489809 /* palette.c */,
+ D99B5BDF0DAEEA2700489809 /* random.c */,
+ D99B5BE10DAEEA2700489809 /* font.c */,
+ D99B5BE20DAEEA2700489809 /* image.c */,
+ );
+ name = filter;
+ sourceTree = "<group>";
+ };
+ D99B5BE30DAEEA2700489809 /* ui */ = {
+ isa = PBXGroup;
+ children = (
+ D99B5BE40DAEEA2700489809 /* drivers.c */,
+ D99B5BE50DAEEA2700489809 /* dialog.c */,
+ D99B5BE60DAEEA2700489809 /* uihelp.c */,
+ D99B5BE70DAEEA2700489809 /* uimenu.c */,
+ D99B5BE80DAEEA2700489809 /* fparams.c */,
+ D99B5BE90DAEEA2700489809 /* ui.c */,
+ D99B5BEA0DAEEA2700489809 /* param.c */,
+ D99B5BEB0DAEEA2700489809 /* filesel.c */,
+ D99B5BEC0DAEEA2700489809 /* pipecmd.c */,
+ );
+ name = ui;
+ sourceTree = "<group>";
+ };
+ D99B5BED0DAEEA2700489809 /* ui-hlp */ = {
+ isa = PBXGroup;
+ children = (
+ D99B5BEE0DAEEA2700489809 /* save.c */,
+ D99B5BEF0DAEEA2700489809 /* menu.c */,
+ D99B5BF00DAEEA2700489809 /* wstack.c */,
+ D99B5BF10DAEEA2700489809 /* playtext.c */,
+ D99B5BF20DAEEA2700489809 /* render.c */,
+ D99B5BF30DAEEA2700489809 /* play.c */,
+ D99B5BF40DAEEA2700489809 /* messg.c */,
+ D99B5BF50DAEEA2700489809 /* ui_helper.c */,
+ D99B5BF60DAEEA2700489809 /* autopilot.c */,
+ );
+ name = "ui-hlp";
+ sourceTree = "<group>";
+ };
+ D99B5BF70DAEEA2700489809 /* util */ = {
+ isa = PBXGroup;
+ children = (
+ D99B5BF80DAEEA2700489809 /* xmenu.c */,
+ D99B5BF90DAEEA2700489809 /* png.c */,
+ D99B5BFA0DAEEA2700489809 /* xstring.c */,
+ D99B5BFB0DAEEA2700489809 /* xshl.c */,
+ D99B5BFC0DAEEA2700489809 /* xldio.c */,
+ D99B5BFD0DAEEA2700489809 /* help.c */,
+ D99B5BFE0DAEEA2700489809 /* xerror.c */,
+ D99B5BFF0DAEEA2700489809 /* thread.c */,
+ D99B5C000DAEEA2700489809 /* timers.c */,
+ D99B5C020DAEEA2700489809 /* xstdio.c */,
+ D99B5C030DAEEA2700489809 /* catalog.c */,
+ );
+ name = util;
+ sourceTree = "<group>";
+ };
+ D99B5E080DAEEB2B00489809 /* Embedded Frameworks and Libraries */ = {
+ isa = PBXGroup;
+ children = (
+ D99B5E090DAEEB4C00489809 /* libintl.dylib */,
+ D99B5E0A0DAEEB4C00489809 /* libgsl.dylib */,
+ D99B5E0B0DAEEB4C00489809 /* libpng.dylib */,
+ );
+ name = "Embedded Frameworks and Libraries";
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8D1107260486CEB800E47090 /* XaoS */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "XaoS" */;
+ buildPhases = (
+ D99B5E110DAEEB6800489809 /* Pre-Compile Script */,
+ 8D1107290486CEB800E47090 /* Resources */,
+ 8D11072C0486CEB800E47090 /* Sources */,
+ 8D11072E0486CEB800E47090 /* Frameworks */,
+ D99B5E1F0DAEEC0D00489809 /* Copy Embedded Frameworks and Libraries */,
+ D99B5E240DAEEC2200489809 /* Post-Compile Script */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = XaoS;
+ productInstallPath = "$(HOME)/Applications";
+ productName = XaoS;
+ productReference = 8D1107320486CEB800E47090 /* XaoS.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 29B97313FDCFA39411CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "XaoS" */;
+ compatibilityVersion = "Xcode 3.0";
+ hasScannedForEncodings = 1;
+ mainGroup = 29B97314FDCFA39411CA2CEA /* XaoS */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8D1107260486CEB800E47090 /* XaoS */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8D1107290486CEB800E47090 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */,
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
+ D99B5C500DAEEA6900489809 /* XaoS.icns in Resources */,
+ D99B5E070DAEEB1200489809 /* XaoSHelp in Resources */,
+ D99B5E690DAEF3A400489809 /* Credits.html in Resources */,
+ D90A09560DB42FD900B7AAFD /* performanceCursor.tiff in Resources */,
+ D90A096A0DB4465100B7AAFD /* XaoSDocument.icns in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ D99B5E110DAEEB6800489809 /* Pre-Compile Script */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Pre-Compile Script";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "# create config.h from config.autoconf (normally done by makefile)\nif [ $PROJECT_DIR/../../../include/config/config.autoconf -nt $PROJECT_DIR/../../../include/config.h ]; then\n\tln -sf $PROJECT_DIR/../../../include/config/config.autoconf $PROJECT_DIR/../../../include/config.h\nfi\n\n# change libraries to use executable-relative paths\nif [ $PROJECT_DIR/thirdparty/lib/libpng.dylib -nt $PROJECT_DIR/libpng.dylib ]; then\n\tcp $PROJECT_DIR/thirdparty/lib/libpng.dylib $PROJECT_DIR/libpng.dylib\n\tinstall_name_tool -id @executable_path/../Frameworks/libpng.dylib $PROJECT_DIR/libpng.dylib\nfi\n\nif [ $PROJECT_DIR/thirdparty/lib/libgsl.dylib -nt $PROJECT_DIR/libgsl.dylib ]; then\n\tcp $PROJECT_DIR/thirdparty/lib/libgsl.dylib $PROJECT_DIR/libgsl.dylib\n\tinstall_name_tool -id @executable_path/../Frameworks/libgsl.dylib $PROJECT_DIR/libgsl.dylib\nfi\n\nif [ $PROJECT_DIR/thirdparty/lib/libintl.dylib -nt $PROJECT_DIR/libintl.dylib ]; then\n\tcp $PROJECT_DIR/thirdparty/lib/libintl.dylib $PROJECT_DIR/libintl.dylib\n\tinstall_name_tool -id @executable_path/../Frameworks/libintl.dylib $PROJECT_DIR/libintl.dylib\nfi\n\n# build apple help\nif [ $PROJECT_DIR/../../../../help/xaos.hlp -nt $PROJECT_DIR/../../../../help/XaoSHelp ]; then\n\tcd $PROJECT_DIR/../../../../help\n\t./applehelpconv\n\tcd $PROJECT_DIR\nfi\n\n";
+ };
+ D99B5E240DAEEC2200489809 /* Post-Compile Script */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Post-Compile Script";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "# Make resource subdirectories\nmkdir $BUILT_PRODUCTS_DIR/XaoS.app/Contents/Resources/tutorial\nmkdir $BUILT_PRODUCTS_DIR/XaoS.app/Contents/Resources/examples\nmkdir $BUILT_PRODUCTS_DIR/XaoS.app/Contents/Resources/catalogs\nmkdir $BUILT_PRODUCTS_DIR/XaoS.app/Contents/Resources/help\nmkdir $BUILT_PRODUCTS_DIR/XaoS.app/Contents/Resources/locale\n\n# Copy resources from project source directories\ncp $PROJECT_DIR/../../../../tutorial/*.x[ah]f $BUILT_PRODUCTS_DIR/XaoS.app/Contents/Resources/tutorial\ncp $PROJECT_DIR/../../../../examples/*/*.x[ap]f $BUILT_PRODUCTS_DIR/XaoS.app/Contents/Resources/examples\ncp $PROJECT_DIR/../../../../catalogs/*.cat $BUILT_PRODUCTS_DIR/XaoS.app/Contents/Resources/catalogs\ncp $PROJECT_DIR/../../../../help/xaos.hlp $BUILT_PRODUCTS_DIR/XaoS.app/Contents/Resources/help\n\n# Build message catalogs and copy to app bundle\ncd $PROJECT_DIR/../../../i18n\nlocaledir=$BUILT_PRODUCTS_DIR/XaoS.app/Contents/Resources/locale\npofiles=`ls *.po`\nmsgfmt=$PROJECT_DIR/thirdparty/bin/msgfmt\nfor pofile in $pofiles; do\n\tlang=`basename $pofile .po`\n\tmofile=${lang}.mo\n\tif [ $pofile -nt $mofile ]; then\n\t\t$msgfmt -o $mofile -c -v --statistics $pofile\n\tfi\n\tmkdir -p $localedir/$lang/LC_MESSAGES\n\tcp $mofile $localedir/$lang/LC_MESSAGES/xaos.mo\ndone\ncd $PROJECT_DIR";
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8D11072C0486CEB800E47090 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D99B5B740DAEE9D100489809 /* ui_cocoa.m in Sources */,
+ D99B5B7E0DAEE9E700489809 /* AppController.m in Sources */,
+ D99B5B7F0DAEE9E700489809 /* FractalView.m in Sources */,
+ D99B5B800DAEE9E700489809 /* CustomDialog.m in Sources */,
+ D99B5B810DAEE9E700489809 /* VideatorProxy.m in Sources */,
+ D99B5C040DAEEA2700489809 /* cmplx.asm in Sources */,
+ D99B5C050DAEEA2700489809 /* sffe.c in Sources */,
+ D99B5C060DAEEA2700489809 /* sffe_cmplx_asm.c in Sources */,
+ D99B5C070DAEEA2700489809 /* sffe_cmplx_gsl.c in Sources */,
+ D99B5C160DAEEA2700489809 /* subwindow.c in Sources */,
+ D99B5C170DAEEA2700489809 /* palettef.c in Sources */,
+ D99B5C180DAEEA2700489809 /* interlace.c in Sources */,
+ D99B5C190DAEEA2700489809 /* edge2.c in Sources */,
+ D99B5C1A0DAEEA2700489809 /* fractal.c in Sources */,
+ D99B5C1B0DAEEA2700489809 /* rotate.c in Sources */,
+ D99B5C1C0DAEEA2700489809 /* itersmall.c in Sources */,
+ D99B5C1D0DAEEA2700489809 /* blur.c in Sources */,
+ D99B5C1E0DAEEA2700489809 /* anti.c in Sources */,
+ D99B5C1F0DAEEA2700489809 /* stereogram.c in Sources */,
+ D99B5C200DAEEA2700489809 /* edge.c in Sources */,
+ D99B5C210DAEEA2700489809 /* zoom.c in Sources */,
+ D99B5C220DAEEA2700489809 /* star.c in Sources */,
+ D99B5C230DAEEA2700489809 /* formulas.c in Sources */,
+ D99B5C240DAEEA2700489809 /* emboss.c in Sources */,
+ D99B5C250DAEEA2700489809 /* julia.c in Sources */,
+ D99B5C260DAEEA2700489809 /* btrace.c in Sources */,
+ D99B5C270DAEEA2700489809 /* i386.c in Sources */,
+ D99B5C280DAEEA2700489809 /* dither.c in Sources */,
+ D99B5C290DAEEA2700489809 /* 3d.c in Sources */,
+ D99B5C2A0DAEEA2700489809 /* plane.c in Sources */,
+ D99B5C2B0DAEEA2700489809 /* filter.c in Sources */,
+ D99B5C2C0DAEEA2700489809 /* palette.c in Sources */,
+ D99B5C2D0DAEEA2700489809 /* random.c in Sources */,
+ D99B5C2F0DAEEA2700489809 /* font.c in Sources */,
+ D99B5C300DAEEA2700489809 /* image.c in Sources */,
+ D99B5C310DAEEA2700489809 /* drivers.c in Sources */,
+ D99B5C320DAEEA2700489809 /* dialog.c in Sources */,
+ D99B5C330DAEEA2700489809 /* uihelp.c in Sources */,
+ D99B5C340DAEEA2700489809 /* uimenu.c in Sources */,
+ D99B5C350DAEEA2700489809 /* fparams.c in Sources */,
+ D99B5C360DAEEA2700489809 /* ui.c in Sources */,
+ D99B5C370DAEEA2700489809 /* param.c in Sources */,
+ D99B5C380DAEEA2700489809 /* filesel.c in Sources */,
+ D99B5C390DAEEA2700489809 /* pipecmd.c in Sources */,
+ D99B5C3A0DAEEA2700489809 /* save.c in Sources */,
+ D99B5C3B0DAEEA2700489809 /* menu.c in Sources */,
+ D99B5C3C0DAEEA2700489809 /* wstack.c in Sources */,
+ D99B5C3D0DAEEA2700489809 /* playtext.c in Sources */,
+ D99B5C3E0DAEEA2700489809 /* render.c in Sources */,
+ D99B5C3F0DAEEA2700489809 /* play.c in Sources */,
+ D99B5C400DAEEA2700489809 /* messg.c in Sources */,
+ D99B5C410DAEEA2700489809 /* ui_helper.c in Sources */,
+ D99B5C420DAEEA2700489809 /* autopilot.c in Sources */,
+ D99B5C430DAEEA2700489809 /* xmenu.c in Sources */,
+ D99B5C440DAEEA2700489809 /* png.c in Sources */,
+ D99B5C450DAEEA2700489809 /* xstring.c in Sources */,
+ D99B5C460DAEEA2700489809 /* xshl.c in Sources */,
+ D99B5C470DAEEA2700489809 /* xldio.c in Sources */,
+ D99B5C480DAEEA2700489809 /* help.c in Sources */,
+ D99B5C490DAEEA2700489809 /* xerror.c in Sources */,
+ D99B5C4A0DAEEA2700489809 /* thread.c in Sources */,
+ D99B5C4B0DAEEA2700489809 /* timers.c in Sources */,
+ D99B5C4D0DAEEA2700489809 /* xstdio.c in Sources */,
+ D99B5C4E0DAEEA2700489809 /* catalog.c in Sources */,
+ D962B0AD101CA598003C66CE /* grlib_cocoa.m in Sources */,
+ D962B20C101E9149003C66CE /* grlib.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 089C165DFE840E0CC02AAC07 /* English */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+ 29B97318FDCFA39411CA2CEA /* MainMenu.nib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 29B97319FDCFA39411CA2CEA /* English */,
+ );
+ name = MainMenu.nib;
+ sourceTree = "<group>";
+ };
+ D99B5E670DAEF3A400489809 /* Credits.html */ = {
+ isa = PBXVariantGroup;
+ children = (
+ D99B5E680DAEF3A400489809 /* English */,
+ );
+ name = Credits.html;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ C01FCF4B08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = XaoS_Prefix.pch;
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(HOME)/Applications";
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)\"",
+ "\"$(SRCROOT)/thirdparty/lib\"",
+ );
+ PRODUCT_NAME = XaoS;
+ WRAPPER_EXTENSION = app;
+ ZERO_LINK = YES;
+ };
+ name = Debug;
+ };
+ C01FCF4C08A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_MODEL_TUNING = G5;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = XaoS_Prefix.pch;
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(HOME)/Applications";
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)\"",
+ "\"$(SRCROOT)/thirdparty/lib\"",
+ );
+ PRODUCT_NAME = XaoS;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+ C01FCF4F08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = ./thirdparty/include;
+ OTHER_LDFLAGS = "-liconv";
+ PREBINDING = NO;
+ SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
+ USER_HEADER_SEARCH_PATHS = ../../../include;
+ };
+ name = Debug;
+ };
+ C01FCF5008A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = (
+ ppc,
+ i386,
+ );
+ GCC_FAST_MATH = YES;
+ GCC_OPTIMIZATION_LEVEL = 3;
+ GCC_UNROLL_LOOPS = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = ./thirdparty/include;
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "-liconv";
+ PREBINDING = NO;
+ SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
+ USER_HEADER_SEARCH_PATHS = ../../../include;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "XaoS" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4B08A954540054247B /* Debug */,
+ C01FCF4C08A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C01FCF4E08A954540054247B /* Build configuration list for PBXProject "XaoS" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4F08A954540054247B /* Debug */,
+ C01FCF5008A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
+}
diff --git a/src/ui/ui-drv/cocoa/XaoSDocument.icns b/src/ui/ui-drv/cocoa/XaoSDocument.icns
new file mode 100644
index 0000000..a827ad7
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/XaoSDocument.icns
Binary files differ
diff --git a/src/ui/ui-drv/cocoa/XaoS_Prefix.pch b/src/ui/ui-drv/cocoa/XaoS_Prefix.pch
new file mode 100644
index 0000000..b52a674
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/XaoS_Prefix.pch
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'XaoS' target in the 'XaoS' project
+//
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
diff --git a/src/ui/ui-drv/cocoa/aconfig.h b/src/ui/ui-drv/cocoa/aconfig.h
new file mode 100644
index 0000000..d6127b6
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/aconfig.h
@@ -0,0 +1,123 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * Cocoa Driver by J.B. Langston III (jb-langston@austin.rr.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifndef ACONFIG_H
+#define ACONFIG_H
+/* #undef HAVE_PTHREAD_SIGHANDLER */
+
+
+//#define DEBUG
+#define VIDEATOR_SUPPORT
+
+/* Triggers Mac OS X-specific behavior in common sources */
+#define MACOSX
+
+/* Cocoa driver needs to do some pre-initialization in its own main function */
+#define MAIN_FUNCTION XaoS_main
+
+/* XaoS xio library uses \01 to indicate paths relative to the executable */
+#define DATAPATH "\01/../Resources"
+#define USE_LOCALEPATH 1
+
+/* Using alloca causes stack overflows on large images */
+/* #undef C_ALLOCA */
+/* #define HAVE_ALLOCA 1 */
+/* #define HAVE_ALLOCA_H 1 */
+
+/* #undef const */
+#define USE_PTHREAD 1
+
+#define HAVE_FABSL 1
+/* #undef HAVE__FABSL */
+/* #undef HAVE___FABSL */
+#define HAVE_FTIME 1
+#define USE_PNG 1
+#define HAVE_FINITE 1
+#define HAVE_SELECT 1
+
+/* Long double is too slow on PowerPC; only enable for i386 build */
+#ifdef __i386__
+#define HAVE_LONG_DOUBLE 1
+#endif
+
+/* #undef HAVE_REDRAWWIN */
+/* #undef HAVE_WREDRAWLN */
+#define USE_NCURSES 1
+/* #undef inline */
+/* #undef _POSIX_SOURCE */
+#define STDC_HEADERS 1
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+#define HAVE_GETTIMEOFDAY 1
+/* #undef HAVE_USLEEP */
+/* #undef HAVE_TERMATTRS */
+/* #undef HAVE_MOUSEMASK */
+#define HAVE_SETITIMER 1
+/* Define if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+/* Define if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+/* Define if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+/* #define MITSHM 1 */
+/* #undef CURSES_DRIVER */
+/* #undef BEOS_DRIVER */
+/* #undef AA_DRIVER */
+/* #undef GGI_DRIVER */
+/* #undef X11_DRIVER */
+/* #undef DGA_DRIVER */
+/* #undef SVGA_DRIVER */
+/* #undef WIN32_DRIVER */
+/* #undef DDRAW_DRIVER */
+/* #undef OSX_DRIVER */
+#define COCOA_DRIVER 1
+#define SIZEOF_SHORT 2
+#define SIZEOF_INT 4
+#define SIZEOF_LONG 4
+#define HAVE_GETTEXT 1
+#define NO_MALLOC_H 1
+
+/* Enable SFFE; use ASM for i386 and GSL for PowerPC */
+#define SFFE_USING 1
+#ifdef __i386__
+#define SFFE_CMPLX_ASM 1
+#else
+#define SFFE_CMPLX_GSL 1
+#endif
+
+/* Define colors based on hardware endianness */
+#if __BIG_ENDIAN__
+#define RMASK 0xff000000
+#define GMASK 0x00ff0000
+#define BMASK 0x0000ff00
+#else
+#define RMASK 0x000000ff
+#define GMASK 0x0000ff00
+#define BMASK 0x00ff0000
+#endif
+
+/* Use platform-provided text rendering instead of built-in */
+#define PLATFORM_TEXT_RENDERING 1
+
+
+#endif
diff --git a/src/ui/ui-drv/cocoa/grlib_cocoa.m b/src/ui/ui-drv/cocoa/grlib_cocoa.m
new file mode 100644
index 0000000..3fedb0c
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/grlib_cocoa.m
@@ -0,0 +1,142 @@
+#include <config.h>
+#ifdef PLATFORM_TEXT_RENDERING
+
+#import <Cocoa/Cocoa.h>
+
+#include <fconfig.h>
+#include <filter.h>
+#include <fractal.h>
+#include <ui_helper.h>
+#include <grlib.h>
+
+NSMutableDictionary *textAttributes(int fgcolor, int bgcolor) {
+
+ float red, green, blue;
+
+ NSMutableDictionary *attrsDictionary = [NSMutableDictionary
+ dictionaryWithCapacity:5];
+
+ [attrsDictionary setValue:[NSColor whiteColor]
+ forKey:NSForegroundColorAttributeName];
+
+ [attrsDictionary setValue:[NSFont
+ boldSystemFontOfSize:[NSFont systemFontSize]]
+ forKey:NSFontAttributeName];
+
+ //NSLog(@"%x", fgcolor);
+ red = (fgcolor & RMASK) / 255.0;
+ green = (fgcolor & GMASK) / 255.0;
+ blue = (fgcolor & BMASK) / 255.0;
+ [attrsDictionary setValue:[NSColor colorWithDeviceRed:red
+ green:green
+ blue:blue
+ alpha:1.0]
+ forKey:NSForegroundColorAttributeName];
+
+ red = (bgcolor & RMASK) / 255.0;
+ green = (bgcolor & GMASK) / 255.0;
+ blue = (bgcolor & BMASK) / 255.0;
+ NSShadow *textShadow = [[NSShadow alloc] init];
+ [textShadow setShadowColor:[NSColor colorWithDeviceRed:red
+ green:green
+ blue:blue
+ alpha:1.0]];
+ [textShadow setShadowOffset:NSMakeSize(2, -2)];
+ [textShadow setShadowBlurRadius:1];
+
+ [attrsDictionary setValue:textShadow forKey:NSShadowAttributeName];
+ [textShadow autorelease];
+
+ return attrsDictionary;
+}
+
+
+int
+xprint(struct image *image, CONST struct xfont *current, int x, int y,
+ CONST char *text, int fgcolor, int bgcolor, int mode)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc]
+ initWithBitmapDataPlanes:image->currlines
+ pixelsWide:image->width
+ pixelsHigh:image->height
+ bitsPerSample:8
+ samplesPerPixel:3
+ hasAlpha:NO
+ isPlanar:NO
+ colorSpaceName:NSDeviceRGBColorSpace
+ bytesPerRow:0
+ bitsPerPixel:32];
+
+ [NSGraphicsContext saveGraphicsState];
+ NSGraphicsContext *context = [NSGraphicsContext
+ graphicsContextWithBitmapImageRep:imageRep];
+ [NSGraphicsContext setCurrentContext:context];
+
+ NSString *messageText = [[[NSString stringWithUTF8String:text]
+ componentsSeparatedByString:@"\n"]
+ objectAtIndex:0];
+ //NSLog(messageText);
+
+ NSMutableDictionary *attrsDictionary = textAttributes(fgcolor, bgcolor);
+
+ NSSize textSize = [messageText sizeWithAttributes:attrsDictionary];
+ [messageText drawAtPoint:NSMakePoint(x, image->height - y - textSize.height)
+ withAttributes:attrsDictionary];
+
+ [NSGraphicsContext restoreGraphicsState];
+
+ /*
+ * The calling functions expect the return value to be the number of
+ * bytes in the string, not the number of characters (this is not always
+ * equal for UTF-8 strings). Therefore, we don't use [messageText length].
+ */
+ int bytesUsed = [messageText
+ lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
+
+ [imageRep release];
+ [pool release];
+
+ return bytesUsed;
+}
+
+int xtextwidth(CONST struct xfont *font, CONST char *text)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ NSString *messageText = [[[NSString stringWithUTF8String:text]
+ componentsSeparatedByString:@"\n"]
+ objectAtIndex:0];
+
+ NSMutableDictionary *attrsDictionary = textAttributes(0, 0);
+
+ NSSize textSize = [messageText sizeWithAttributes:attrsDictionary];
+
+ [pool release];
+ return ceil(textSize.width) + 2;
+}
+
+int xtextheight(CONST struct xfont *font) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ NSString *messageText = @"Test String";
+
+ NSMutableDictionary *attrsDictionary = textAttributes(0, 0);
+ NSSize textSize = [messageText sizeWithAttributes:attrsDictionary];
+ [pool release];
+ return ceil(textSize.height) + 2;
+}
+
+int xtextcharw(CONST struct xfont *font, CONST char c)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ NSString *messageText = [NSString stringWithFormat:@"%c", c];
+
+ NSMutableDictionary *attrsDictionary = textAttributes(0, 0);
+ NSSize textSize = [messageText sizeWithAttributes:attrsDictionary];
+ [pool release];
+ return ceil(textSize.width) + 2;
+}
+#endif \ No newline at end of file
diff --git a/src/ui/ui-drv/cocoa/performanceCursor.tiff b/src/ui/ui-drv/cocoa/performanceCursor.tiff
new file mode 100644
index 0000000..fe7faf4
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/performanceCursor.tiff
Binary files differ
diff --git a/src/ui/ui-drv/cocoa/ui_cocoa.m b/src/ui/ui-drv/cocoa/ui_cocoa.m
new file mode 100644
index 0000000..0e107dc
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/ui_cocoa.m
@@ -0,0 +1,267 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * Cocoa Driver by J.B. Langston III (jb-langston@austin.rr.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#import "AppController.h"
+
+#include "ui.h"
+
+struct ui_driver cocoa_driver, cocoa_fullscreen_driver;
+
+#ifdef USE_LOCALEPATH
+char *localepath;
+#endif
+
+static void
+cocoa_printText(int x, int y, CONST char *text)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ [[controller view] printText:text atX:x y:y];
+ [pool release];
+}
+
+static void
+cocoa_refreshDisplay()
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ [[controller view] display];
+ [pool release];
+}
+
+static void
+cocoa_flipBuffers ()
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ [[controller view] flipBuffers];
+ [pool release];
+}
+
+static void
+cocoa_freeBuffers (char *b1, char *b2)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ [[controller view] freeBuffers];
+ [pool release];
+}
+
+static int
+cocoa_allocBuffers (char **b1, char **b2)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ int rowLength = [[controller view] allocBuffer1:b1 buffer2:b2];
+ [pool release];
+ return rowLength;
+}
+
+static void
+cocoa_getImageSize (int *w, int *h)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ [[controller view] getWidth:w height:h];
+ [pool release];
+}
+
+static void
+cocoa_processEvents (int wait, int *mx, int *my, int *mb, int *k)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ //NSDate *eventDate = wait ? [NSDate distantFuture] : [NSDate distantPast];
+ NSEvent *event = [NSApp nextEventMatchingMask: NSAnyEventMask
+ untilDate: nil //eventDate
+ inMode: NSDefaultRunLoopMode
+ dequeue: YES];
+ if (event != nil) {
+ [NSApp sendEvent: event];
+ }
+ [[controller view] getMouseX:mx mouseY:my mouseButton:mb keys:k];
+ [pool release];
+}
+
+
+static int
+cocoa_initDriver ()
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ int status = [controller initDriver:&cocoa_driver fullscreen:NO];
+ [pool release];
+ return status;
+}
+
+static int
+cocoa_initFullScreenDriver ()
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ int status = [controller initDriver:&cocoa_fullscreen_driver fullscreen:YES];
+ [pool release];
+ return status;
+}
+
+static void
+cocoa_uninitDriver ()
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ [controller uninitDriver];
+ [pool release];
+}
+
+static void
+cocoa_getMouse (int *x, int *y, int *b)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ [[controller view] getMouseX:x mouseY:y mouseButton:b];
+ [pool release];
+}
+
+
+static void
+cocoa_setCursorType (int type)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ [[controller view] setCursorType:type];
+ [pool release];
+}
+
+static void
+cocoa_buildMenu (struct uih_context *uih, CONST char *name)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ [controller buildMenuWithContext:uih name:name];
+ [pool release];
+}
+
+static void
+cocoa_showPopUpMenu (struct uih_context *c, CONST char *name)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ [controller showPopUpMenuWithContext:c name:name];
+ [pool release];
+}
+
+
+static void
+cocoa_showDialog (struct uih_context *c, CONST char *name)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ [controller showDialogWithContext:c name:name];
+ [pool release];
+}
+
+static void
+cocoa_showHelp (struct uih_context *c, CONST char *name)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ [controller showHelpWithContext:c name:name];
+ [pool release];
+}
+
+int
+main(int argc, char* argv[])
+{
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+ [NSApplication sharedApplication];
+ [NSBundle loadNibNamed:@"MainMenu" owner:NSApp];
+ controller = [[AppController alloc] init];
+ [pool release];
+ return MAIN_FUNCTION(argc, argv);
+}
+
+struct gui_driver cocoa_gui_driver = {
+/* setrootmenu */ cocoa_buildMenu,
+/* enabledisable */ NULL,
+/* menu */ cocoa_showPopUpMenu,
+/* dialog */ cocoa_showDialog,
+/* help */ cocoa_showHelp
+};
+
+
+static struct params cocoa_params[] = {
+{NULL, 0, NULL, NULL}
+};
+
+struct ui_driver cocoa_driver = {
+/* name */ "Mac OS X Windowed Driver",
+/* init */ cocoa_initDriver,
+/* getsize */ cocoa_getImageSize,
+/* processevents */ cocoa_processEvents,
+/* getmouse */ cocoa_getMouse,
+/* uninit */ cocoa_uninitDriver,
+/* set_color */ NULL,
+/* set_range */ NULL,
+/* print */ cocoa_printText,
+/* display */ cocoa_refreshDisplay,
+/* alloc_buffers */ cocoa_allocBuffers,
+/* free_buffers */ cocoa_freeBuffers,
+/* filp_buffers */ cocoa_flipBuffers,
+/* mousetype */ cocoa_setCursorType,
+/* flush */ NULL,
+/* textwidth */ 12,
+/* textheight */ 12,
+/* params */ cocoa_params,
+/* flags */ PIXELSIZE,
+/* width */ 0.0,
+/* height */ 0.0,
+/* maxwidth */ 0,
+/* maxheight */ 0,
+/* imagetype */ UI_TRUECOLOR,
+/* palettestart */ 0,
+/* paletteend */ 256,
+/* maxentries */ 255,
+/* rmask */ RMASK,
+/* gmask */ GMASK,
+/* bmask */ BMASK,
+/* gui_driver */ &cocoa_gui_driver
+};
+
+struct ui_driver cocoa_fullscreen_driver = {
+/* name */ "Mac OS X Full Screen Driver",
+/* init */ cocoa_initFullScreenDriver,
+/* getsize */ cocoa_getImageSize,
+/* processevents */ cocoa_processEvents,
+/* getmouse */ cocoa_getMouse,
+/* uninit */ cocoa_uninitDriver,
+/* set_color */ NULL,
+/* set_range */ NULL,
+/* print */ cocoa_printText,
+/* display */ cocoa_refreshDisplay,
+/* alloc_buffers */ cocoa_allocBuffers,
+/* free_buffers */ cocoa_freeBuffers,
+/* filp_buffers */ cocoa_flipBuffers,
+/* mousetype */ cocoa_setCursorType,
+/* flush */ NULL,
+/* textwidth */ 12,
+/* textheight */ 12,
+/* params */ cocoa_params,
+/* flags */ PIXELSIZE | FULLSCREEN,
+/* width */ 0.0,
+/* height */ 0.0,
+/* maxwidth */ 0,
+/* maxheight */ 0,
+/* imagetype */ UI_TRUECOLOR,
+/* palettestart */ 0,
+/* paletteend */ 256,
+/* maxentries */ 255,
+/* rmask */ RMASK,
+/* gmask */ GMASK,
+/* bmask */ BMASK,
+/* gui_driver */ &cocoa_gui_driver
+};
+/* DONT FORGET TO ADD DOCUMENTATION ABOUT YOUR DRIVER INTO xaos.hlp FILE!*/
diff --git a/src/ui/ui-drv/cocoa/version.h b/src/ui/ui-drv/cocoa/version.h
new file mode 100644
index 0000000..719d117
--- /dev/null
+++ b/src/ui/ui-drv/cocoa/version.h
@@ -0,0 +1,22 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#define XaoS_VERSION "3.5"
diff --git a/src/ui/ui-drv/gtk/Makefile.in b/src/ui/ui-drv/gtk/Makefile.in
new file mode 100644
index 0000000..e5ca90f
--- /dev/null
+++ b/src/ui/ui-drv/gtk/Makefile.in
@@ -0,0 +1,39 @@
+CC = @CC@
+CFLAGS = @CFLAGS@
+LIBS = @LIBS@ -lm
+LFLAGS = @LDFLAGS@
+#AR = @AR@
+RANLIB = @RANLIB@
+
+SRCS = ui_gtk.c
+
+OBJS = $(SRCS:.c=.o)
+
+TLIB = @LIBPATH@/libuigtk.a
+
+
+all: $(TLIB)
+
+$(TLIB):$(OBJS)
+ rm -f $@
+ $(AR) rc $@ $^
+ $(RANLIB) $@
+
+clean:
+ rm -f $(TLIB)
+ rm -f *.[oas]
+ rm -f *~
+ rm -f core
+
+distclean:clean
+ rm Makefile
+
+#dep:
+# rm -f .depend
+# make .depend
+#
+#.depend:
+# echo '# Program dependencies' >.depend
+# gcc -I svgalib $(DEFINES) -MM $(patsubst %.o,%.c,$(OBJS)) >>.depend
+#
+#include .depend
diff --git a/src/ui/ui-drv/gtk/ui_gtk.c b/src/ui/ui-drv/gtk/ui_gtk.c
new file mode 100644
index 0000000..294b9e0
--- /dev/null
+++ b/src/ui/ui-drv/gtk/ui_gtk.c
@@ -0,0 +1,764 @@
+#include "aconfig.h"
+#ifdef GTK_DRIVER
+/*includes */
+#include <cairo.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#include <filter.h>
+#include <grlib.h>
+#include <ui.h>
+
+int width = 640;
+int height = 480;
+
+int mouse_x = 0;
+int mouse_y = 0;
+int mouse_buttons = 0;
+int keys = 0;
+
+GtkWidget *drawing_area;
+GtkWidget *menu_bar;
+GtkWidget *window;
+GHashTable *menuitem_table = NULL;
+
+int current_surface;
+cairo_surface_t *surface[2];
+
+static void window_destroyed(GtkWidget * widget, gpointer data) {
+ ui_quit();
+}
+
+static gboolean mouse_moved(GtkWidget * widget, GdkEventMotion * event,
+ gpointer data) {
+ mouse_x = event->x;
+ mouse_y = event->y;
+ return TRUE;
+}
+
+static gboolean key_pressed(GtkWidget * widget, GdkEventKey * event,
+ gpointer data) {
+ guint32 key;
+
+ switch (event->keyval) {
+ case GDK_Left:
+ keys |= 1;
+ ui_key(UIKEY_LEFT);
+ break;
+ case GDK_Right:
+ keys |= 2;
+ ui_key(UIKEY_RIGHT);
+ break;
+ case GDK_Up:
+ keys |= 4;
+ ui_key(UIKEY_UP);
+ break;
+ case GDK_Down:
+ keys |= 8;
+ ui_key(UIKEY_DOWN);
+ break;
+ case GDK_Page_Up:
+ keys |= 4;
+ ui_key(UIKEY_PGUP);
+ break;
+ case GDK_Page_Down:
+ keys |= 8;
+ ui_key(UIKEY_PGDOWN);
+ break;
+ case GDK_BackSpace:
+ ui_key(UIKEY_BACKSPACE);
+ break;
+ case GDK_Escape:
+ ui_key(UIKEY_ESC);
+ break;
+ case GDK_Home:
+ ui_key(UIKEY_HOME);
+ break;
+ case GDK_End:
+ ui_key(UIKEY_END);
+ break;
+ case GDK_Tab:
+ ui_key(UIKEY_TAB);
+ break;
+ default:
+ key = gdk_keyval_to_unicode(event->keyval);
+ ui_key(key);
+ }
+ return TRUE;
+}
+
+static gboolean key_released(GtkWidget * widget, GdkEventKey * event,
+ gpointer data) {
+ switch (event->keyval) {
+ case GDK_Left:
+ keys &= ~1;
+ break;
+ case GDK_Right:
+ keys &= ~2;
+ break;
+ case GDK_Up:
+ keys &= ~4;
+ break;
+ case GDK_Down:
+ keys &= ~8;
+ break;
+ case GDK_Page_Up:
+ keys &= ~4;
+ break;
+ case GDK_Page_Down:
+ keys &= ~8;
+ break;
+ }
+ return TRUE;
+}
+
+static gboolean button_pressed(GtkWidget * widget, GdkEventButton * event,
+ gpointer data) {
+ switch (event->button) {
+ case 1:
+ mouse_buttons |= BUTTON1;
+ break;
+ case 2:
+ mouse_buttons |= BUTTON2;
+ break;
+ case 3:
+ mouse_buttons |= BUTTON3;
+ break;
+ }
+ return TRUE;
+}
+
+static gboolean button_released(GtkWidget * widget, GdkEventButton * event,
+ gpointer data) {
+ switch (event->button) {
+ case 1:
+ mouse_buttons &= ~BUTTON1;
+ break;
+ case 2:
+ mouse_buttons &= ~BUTTON2;
+ break;
+ case 3:
+ mouse_buttons &= ~BUTTON3;
+ break;
+ }
+ return TRUE;
+}
+
+static gboolean drawing_area_resized(GtkWidget * widget,
+ GdkEventConfigure * event) {
+ if (surface[0] && surface[1]) {
+ width = event->width;
+ height = event->height;
+ ui_resize();
+ }
+
+ return FALSE;
+}
+
+static gboolean drawing_area_exposed(GtkWidget * widget,
+ GdkEventExpose * event, gpointer data) {
+ cairo_t *cr;
+
+ cr = gdk_cairo_create(widget->window);
+
+ cairo_set_source_surface(cr, surface[current_surface], 0, 0);
+ cairo_paint(cr);
+
+ cairo_destroy(cr);
+
+ return FALSE;
+}
+
+void menuitem_activated(GtkMenuItem * item, gpointer data) {
+ /*
+ * gtk emits activate signal when radio buttons are deactivated as well.
+ * we want to ignore these signals.
+ */
+
+ if (!GTK_IS_RADIO_MENU_ITEM(item) || gtk_check_menu_item_get_active(
+ GTK_CHECK_MENU_ITEM(item)))
+ ui_menuactivate((CONST menuitem *) data, NULL);
+}
+
+static void build_menu(struct uih_context *uih, CONST char *name,
+ GtkWidget * parent) {
+ CONST menuitem *item;
+ gchar *menulabel;
+ GtkWidget *menuitem;
+ GtkWidget *submenu;
+ GSList *group = NULL;
+
+ int i;
+
+ for (i = 0; (item = menu_item(name, i)) != NULL; i++) {
+ if (item->type == MENU_SEPARATOR)
+ menuitem = gtk_separator_menu_item_new();
+ else {
+ if (item->type == MENU_CUSTOMDIALOG || item->type == MENU_DIALOG)
+ menulabel = g_strconcat(item->name, "...", NULL);
+ else
+ menulabel = g_strdup(item->name);
+
+ if (item->flags & MENUFLAG_CHECKBOX)
+ menuitem = gtk_check_menu_item_new_with_label(menulabel);
+ else if (item->flags & MENUFLAG_RADIO) {
+ menuitem = gtk_radio_menu_item_new_with_label(group, menulabel);
+ group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM
+ (menuitem));
+ } else
+ menuitem = gtk_menu_item_new_with_label(menulabel);
+
+ if (menu_enabled(item, uih))
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
+ (menuitem), TRUE);
+
+ g_free(menulabel);
+
+ g_hash_table_insert(menuitem_table, (gpointer) item->shortname,
+ menuitem);
+ }
+
+ gtk_menu_shell_append(GTK_MENU_SHELL(parent), menuitem);
+ gtk_widget_show(menuitem);
+
+ if (item->type == MENU_SUBMENU) {
+ submenu = gtk_menu_new();
+ build_menu(uih, item->shortname, submenu);
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu);
+ } else {
+ g_signal_connect(G_OBJECT(menuitem), "activate",
+ G_CALLBACK(menuitem_activated),
+ (gpointer) item);
+ }
+ }
+}
+
+static void dorootmenu(struct uih_context *uih, CONST char *name) {
+ if (menuitem_table)
+ g_hash_table_destroy(menuitem_table);
+
+ gtk_container_foreach(GTK_CONTAINER(menu_bar),
+ (GtkCallback) gtk_widget_destroy, NULL);
+
+ menuitem_table = g_hash_table_new(g_str_hash, g_str_equal);
+ build_menu(uih, name, menu_bar);
+}
+
+static void dialog(struct uih_context *uih, CONST char *name) {
+ CONST menuitem *item = menu_findcommand(name);
+ if (!item)
+ return; CONST
+ menudialog *dialog = menu_getdialog(uih, item);
+ if (!dialog)
+ return;
+
+ int nitems;
+ for (nitems = 0; dialog[nitems].question; nitems++)
+ ;
+
+ if (nitems == 1 && (dialog[0].type == DIALOG_IFILE || dialog[0].type
+ == DIALOG_OFILE)) {
+
+ GtkFileChooserAction action;
+ gchar *title;
+ switch (dialog[0].type) {
+ case DIALOG_IFILE:
+ action = GTK_FILE_CHOOSER_ACTION_OPEN;
+ title = "Open File";
+ break;
+ case DIALOG_OFILE:
+ action = GTK_FILE_CHOOSER_ACTION_SAVE;
+ title = "Save as...";
+ break;
+ }
+
+ GtkWidget *chooser = gtk_file_chooser_dialog_new(title, GTK_WINDOW
+ (window), action, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
+
+ GtkFileFilter *filter = gtk_file_filter_new();
+ // TODO: Set default extension for save dialog
+ gtk_file_filter_add_pattern(filter, g_strrstr(dialog[0].defstr, "*"));
+ gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(chooser), filter);
+
+ gint result = gtk_dialog_run(GTK_DIALOG(chooser));
+
+ if (result == GTK_RESPONSE_OK) {
+ gchar *filename = gtk_file_chooser_get_filename(
+ GTK_FILE_CHOOSER(chooser));
+ dialogparam *param = malloc(sizeof(dialogparam));
+ param->dstring = strdup(filename);
+ ui_menuactivate(item, param);
+ }
+ gtk_widget_destroy(chooser);
+
+ } else {
+ GtkWidget *window, *table;
+ GHashTable *widget_hash = g_hash_table_new(g_str_hash, g_str_equal);
+
+ window = gtk_dialog_new_with_buttons("XaoS", NULL, GTK_DIALOG_MODAL,
+ GTK_STOCK_OK, GTK_RESPONSE_OK, GTK_STOCK_CANCEL,
+ GTK_RESPONSE_CANCEL, GTK_STOCK_HELP, GTK_RESPONSE_HELP, NULL);
+
+ gtk_dialog_set_default_response(GTK_DIALOG(window), GTK_RESPONSE_OK);
+
+ table = gtk_table_new(nitems, 5, FALSE);
+ gtk_container_set_border_width(GTK_CONTAINER(table), 5);
+ gtk_table_set_row_spacings(GTK_TABLE(table), 5);
+ gtk_table_set_col_spacings(GTK_TABLE(table), 5);
+
+ int i;
+ for (i = 0; i < nitems; i++) {
+ GtkWidget *label = gtk_label_new(dialog[i].question);
+ GtkWidget *align = gtk_alignment_new(0, 0.5, 0, 0);
+ gtk_container_add(GTK_CONTAINER(align), GTK_WIDGET(label));
+ gtk_table_attach_defaults(GTK_TABLE(table), align, 0, 1, i, i + 1);
+
+ switch (dialog[i].type) {
+ case DIALOG_COORD: {
+ GtkWidget *widget;
+ gchar *value;
+ widget = gtk_entry_new();
+ value = g_strdup_printf("%f", dialog[i].deffloat);
+ gtk_entry_set_text(GTK_ENTRY(widget), value);
+ g_free(value);
+ gtk_table_attach_defaults(GTK_TABLE(table), widget, 1, 2, i, i
+ + 1);
+
+ g_hash_table_insert(widget_hash, dialog[i].question, widget);
+
+ widget = gtk_label_new("+");
+ gtk_table_attach_defaults(GTK_TABLE(table), widget, 2, 3, i, i
+ + 1);
+
+ widget = gtk_entry_new();
+ value = g_strdup_printf("%f", dialog[i].deffloat2);
+ gtk_entry_set_text(GTK_ENTRY(widget), value);
+ gtk_table_attach_defaults(GTK_TABLE(table), widget, 3, 4, i, i
+ + 1);
+ g_free(value);
+
+ gchar *key = g_strconcat(dialog[i].question, "2", NULL);
+ g_hash_table_insert(widget_hash, key, widget);
+ //g_free(key);
+
+ widget = gtk_label_new("i");
+ gtk_table_attach_defaults(GTK_TABLE(table), widget, 4, 5, i, i
+ + 1);
+
+ break;
+ }
+ case DIALOG_IFILE:
+ case DIALOG_OFILE: {
+ GtkFileChooserAction action;
+ gchar *title;
+ switch (dialog[i].type) {
+ case DIALOG_IFILE:
+ action = GTK_FILE_CHOOSER_ACTION_OPEN;
+ title = "Open File";
+ break;
+ case DIALOG_OFILE:
+ action = GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER;
+ title = "Save as...";
+ break;
+ }
+
+ // TODO: Set default chooser value
+ GtkWidget *chooser = gtk_file_chooser_button_new(title, action);
+ gtk_table_attach_defaults(GTK_TABLE(table), chooser, 1, 4, i, i
+ + 1);
+
+ g_hash_table_insert(widget_hash, dialog[i].question, chooser);
+ break;
+ }
+ case DIALOG_CHOICE: {
+ GtkWidget *combo = gtk_combo_box_new_text();
+ CONST
+ char **str = (CONST char **) dialog[i].defstr;
+ int y;
+ for (y = 0; str[y] != NULL; y++)
+ gtk_combo_box_append_text(GTK_COMBO_BOX(combo), str[y]);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(combo), dialog[i].defint);
+ gtk_table_attach_defaults(GTK_TABLE(table), combo, 1, 4, i, i
+ + 1);
+
+ g_hash_table_insert(widget_hash, dialog[i].question, combo);
+ break;
+
+ }
+ default: {
+ GtkWidget *entry = gtk_entry_new();
+ gchar *value;
+ switch (dialog[i].type) {
+ case DIALOG_INT:
+ value = g_strdup_printf("%d", dialog[i].defint);
+ break;
+ case DIALOG_FLOAT:
+ value = g_strdup_printf("%f", dialog[i].deffloat);
+ break;
+ case DIALOG_STRING:
+ case DIALOG_KEYSTRING:
+ value = g_strdup(dialog[i].defstr);
+ break;
+ }
+ gtk_entry_set_text(GTK_ENTRY(entry), value);
+ g_free(value);
+ gtk_table_attach_defaults(GTK_TABLE(table), entry, 1, 4, i, i
+ + 1);
+
+ g_hash_table_insert(widget_hash, dialog[i].question, entry);
+ break;
+ }
+ }
+
+ }
+
+ gtk_box_pack_start_defaults(GTK_BOX(GTK_DIALOG(window)->vbox), table);
+ gtk_widget_show_all(window);
+
+ gint result = gtk_dialog_run(GTK_DIALOG(window));
+
+ if (result == GTK_RESPONSE_OK) {
+ dialogparam *params = malloc(sizeof(dialogparam) * nitems);
+
+ for (i = 0; i < nitems; i++) {
+ GtkWidget *widget = g_hash_table_lookup(widget_hash,
+ dialog[i]. question);
+ switch (dialog[i].type) {
+ case DIALOG_IFILE:
+ case DIALOG_OFILE: {
+ gchar *filename = gtk_file_chooser_get_filename(
+ GTK_FILE_CHOOSER(widget));
+ if (filename == NULL)
+ filename = "";
+ params[i].dstring = strdup(filename);
+ break;
+ }
+ case DIALOG_STRING:
+ case DIALOG_KEYSTRING:
+ params[i].dstring = strdup(gtk_entry_get_text(
+ GTK_ENTRY(widget)));
+ break;
+ case DIALOG_INT:
+ params[i].dint
+ = atoi(gtk_entry_get_text(GTK_ENTRY(widget)));
+ break;
+ case DIALOG_FLOAT:
+ // TODO: Should use long double conversion instead of atof
+ params[i].number = atof(gtk_entry_get_text(
+ GTK_ENTRY(widget)));
+ break;
+ case DIALOG_COORD:
+ params[i].dcoord[0] = atof(gtk_entry_get_text(
+ GTK_ENTRY(widget)));
+ gchar *key = g_strconcat(dialog[i].question, "2", NULL);
+ widget = g_hash_table_lookup(widget_hash, key);
+ g_free(key);
+ params[i].dcoord[1] = atof(gtk_entry_get_text(
+ GTK_ENTRY(widget)));
+ break;
+ case DIALOG_CHOICE:
+ params[i].dint = gtk_combo_box_get_active(
+ GTK_COMBO_BOX(widget));
+ break;
+ }
+ }
+
+ g_hash_table_destroy(widget_hash);
+ gtk_widget_destroy(window);
+ ui_menuactivate(item, params);
+
+ } else {
+ g_hash_table_destroy(widget_hash);
+ gtk_widget_destroy(window);
+ }
+ }
+
+}
+
+static void enabledisable(struct uih_context *uih, CONST char *name) {
+ if (menuitem_table) {
+ CONST struct menuitem *item = menu_findcommand(name);
+ GtkCheckMenuItem *menuitem = g_hash_table_lookup(menuitem_table, name);
+ g_signal_handlers_block_matched(menuitem, G_SIGNAL_MATCH_FUNC, 0, 0, 0,
+ menuitem_activated, 0);
+ gtk_check_menu_item_set_active(menuitem, menu_enabled(item, uih));
+ g_signal_handlers_unblock_matched(menuitem, G_SIGNAL_MATCH_FUNC, 0, 0,
+ 0, menuitem_activated, 0);
+ }
+}
+
+static void print(int x, int y, CONST char *text) {
+}
+
+static void display() {
+ gtk_widget_queue_draw(drawing_area);
+}
+
+static void flip_buffers() {
+ current_surface ^= 1;
+}
+
+void free_buffers(char *b1, char *b2) {
+ cairo_surface_destroy(surface[0]);
+ cairo_surface_destroy(surface[1]);
+ surface[0] = NULL;
+ surface[1] = NULL;
+}
+
+int alloc_buffers(char **b1, char **b2) {
+ surface[0] = cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height);
+ surface[1] = cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height);
+
+ *b1 = (char *) cairo_image_surface_get_data(surface[0]);
+ *b2 = (char *) cairo_image_surface_get_data(surface[1]);
+
+ current_surface = 0;
+
+ return cairo_image_surface_get_stride(surface[0]);
+}
+
+static void getsize(int *w, int *h) {
+ *w = width;
+ *h = height;
+}
+
+static void processevents(int wait, int *mx, int *my, int *mb, int *k) {
+ while (gtk_events_pending())
+ gtk_main_iteration_do(wait ? TRUE : FALSE);
+
+ *mx = mouse_x;
+ *my = mouse_y;
+ *mb = mouse_buttons;
+ *k = keys;
+}
+
+static int init() {
+ GtkWidget *vbox;
+
+ int argc = 0;
+ char **argv = NULL;
+
+ gtk_init(&argc, &argv);
+
+ window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
+ gtk_window_set_default_size(GTK_WINDOW(window), 640, 480);
+ gtk_window_set_title(GTK_WINDOW(window), "XaoS");
+
+ g_signal_connect(G_OBJECT(window), "destroy",
+ G_CALLBACK(window_destroyed), NULL);
+
+ vbox = gtk_vbox_new(FALSE, 0);
+ gtk_container_add(GTK_CONTAINER(window), vbox);
+ gtk_widget_show(vbox);
+
+ menu_bar = gtk_menu_bar_new();
+ gtk_box_pack_start(GTK_BOX(vbox), menu_bar, FALSE, FALSE, 0);
+ gtk_widget_show(menu_bar);
+
+ drawing_area = gtk_drawing_area_new();
+ gtk_box_pack_end(GTK_BOX(vbox), drawing_area, TRUE, TRUE, 0);
+ gtk_widget_show(drawing_area);
+
+ GTK_WIDGET_SET_FLAGS(drawing_area, GTK_CAN_FOCUS);
+ gtk_widget_grab_focus(drawing_area);
+
+ gtk_widget_add_events(drawing_area, GDK_POINTER_MOTION_MASK
+ | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+ | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK);
+
+ g_signal_connect(G_OBJECT(drawing_area), "motion-notify-event",
+ G_CALLBACK(mouse_moved), NULL);
+
+ g_signal_connect(G_OBJECT(drawing_area), "button-press-event",
+ G_CALLBACK(button_pressed), NULL);
+
+ g_signal_connect(G_OBJECT(drawing_area), "button-release-event",
+ G_CALLBACK(button_released), NULL);
+
+ g_signal_connect(G_OBJECT(drawing_area), "key-press-event",
+ G_CALLBACK(key_pressed), NULL);
+
+ g_signal_connect(G_OBJECT(drawing_area), "key-release-event",
+ G_CALLBACK(key_released), NULL);
+
+ g_signal_connect(G_OBJECT(drawing_area), "expose-event",
+ G_CALLBACK(drawing_area_exposed), NULL);
+
+ g_signal_connect(G_OBJECT(drawing_area), "configure-event",
+ G_CALLBACK(drawing_area_resized), NULL);
+
+ gtk_widget_show_all(window);
+
+ return ( /*1 for sucess 0 for fail */1);
+}
+
+static void uninit() {
+ /*
+ * Disconnect window destroy event to prevent XaoS from
+ * quitting when switching drivers
+ */
+ g_signal_handlers_disconnect_matched(window, G_SIGNAL_MATCH_FUNC, 0, 0, 0,
+ window_destroyed, 0);
+
+ gtk_widget_destroy(window);
+}
+
+static void getmouse(int *x, int *y, int *b) {
+ *x = mouse_x;
+ *y = mouse_y;
+ *b = mouse_buttons;
+}
+
+static void mousetype(int type) {
+}
+
+static int skip(CONST char *text)
+{
+ int i = 0;
+ while (*text && *text != '\n')
+ i++, text++;
+ return (i);
+}
+
+#ifdef PLATFORM_TEXT_RENDERING
+
+int
+xprint(struct image *image, CONST struct xfont *current, int x, int y,
+ CONST char *text, int fgcolor, int bgcolor, int mode)
+{
+ cairo_t *cr = cairo_create(surface[image->currimage]);
+
+ cairo_select_font_face (cr, "Sans", CAIRO_FONT_SLANT_NORMAL,
+ CAIRO_FONT_WEIGHT_BOLD);
+ cairo_set_font_size (cr, 18.0);
+
+ char line[BUFSIZ];
+ int pos = strcspn(text, "\n");
+ strncpy(line, text, pos);
+ line[pos] = '\0';
+
+ cairo_text_extents_t extents;
+ cairo_text_extents (cr, line, &extents);
+
+ cairo_set_source_rgb (cr, 0, 0, 0);
+ cairo_move_to (cr, x + 1, y + extents.height + 1);
+ cairo_show_text (cr, line);
+
+ cairo_set_source_rgb (cr, 1, 1, 1);
+ cairo_move_to (cr, x, y + extents.height);
+ cairo_show_text (cr, line);
+
+ cairo_destroy(cr);
+
+ return strlen(line);
+}
+
+int xtextwidth(CONST struct xfont *font, CONST char *text)
+{
+ cairo_t *cr = cairo_create(surface[current_surface]);
+
+ cairo_select_font_face (cr, "Sans", CAIRO_FONT_SLANT_NORMAL,
+ CAIRO_FONT_WEIGHT_BOLD);
+ cairo_set_font_size (cr, 18.0);
+
+ char line[BUFSIZ];
+ int pos = strcspn(text, "\n");
+ strncpy(line, text, pos);
+ line[pos] = '\0';
+
+ cairo_text_extents_t extents;
+ cairo_text_extents (cr, line, &extents);
+
+ cairo_destroy(cr);
+
+ return ceil(extents.width) + 1;
+}
+
+int xtextheight(CONST struct xfont *font) {
+ cairo_t *cr = cairo_create(surface[current_surface]);
+
+ cairo_select_font_face (cr, "Sans", CAIRO_FONT_SLANT_NORMAL,
+ CAIRO_FONT_WEIGHT_BOLD);
+ cairo_set_font_size (cr, 18.0);
+
+ cairo_text_extents_t extents;
+ cairo_text_extents (cr, "Wg'", &extents);
+
+ cairo_destroy(cr);
+
+ return ceil(extents.height) + 5;
+}
+
+int xtextcharw(CONST struct xfont *font, CONST char c)
+{
+ cairo_t *cr = cairo_create(surface[current_surface]);
+
+ cairo_select_font_face (cr, "Sans", CAIRO_FONT_SLANT_NORMAL,
+ CAIRO_FONT_WEIGHT_BOLD);
+ cairo_set_font_size (cr, 18.0);
+
+ char text[2];
+ sprintf(text, "%c", c);
+
+ cairo_text_extents_t extents;
+ cairo_text_extents (cr, text, &extents);
+
+ cairo_destroy(cr);
+
+ return ceil(extents.width) + 1;
+}
+
+#endif
+
+static struct params params[] = { { "", P_HELP, NULL, "GTK+ driver options:" },
+ { NULL, 0, NULL, NULL } };
+
+struct gui_driver gtk_gui_driver = {
+/* dorootmenu */dorootmenu,
+/* enabledisable */enabledisable,
+/* popup */NULL,
+/* dialog */dialog,
+/* help */NULL };
+
+struct ui_driver gtk_driver = {
+/* name */"GTK+ Driver",
+/* init */init,
+/* getsize */getsize,
+/* processevents */processevents,
+/* getmouse */getmouse,
+/* uninit */uninit,
+/* set_color */NULL,
+/* set_range */NULL,
+/* print */print,
+/* display */display,
+/* alloc_buffers */alloc_buffers,
+/* free_buffers */free_buffers,
+/* filp_buffers */flip_buffers,
+/* mousetype */mousetype,
+/* flush */NULL,
+/* textwidth */12,
+/* textheight */12,
+/* params */params,
+
+/* flags */RESOLUTION | PIXELSIZE | NOFLUSHDISPLAY | FULLSCREEN
+ | PALETTE_ROTATION | ROTATE_INSIDE_CALCULATION,
+
+/* width */0.01,
+/* height */0.01,
+/* maxwidth */0,
+/* maxheight */0,
+/* imagetype */UI_TRUECOLOR,
+/* palettestart */0,
+/* paletteend */0,
+/* maxentries */0,
+/* rmask */0x00ff0000,
+/* gmask */0x0000ff00,
+/* bmask */0x000000ff,
+/* gui_driver */&gtk_gui_driver };
+
+#endif
diff --git a/src/ui/ui-drv/qt/XaoS.icns b/src/ui/ui-drv/qt/XaoS.icns
new file mode 100644
index 0000000..e03d0cb
--- /dev/null
+++ b/src/ui/ui-drv/qt/XaoS.icns
Binary files differ
diff --git a/src/ui/ui-drv/qt/XaoS.pro b/src/ui/ui-drv/qt/XaoS.pro
new file mode 100644
index 0000000..1fddca6
--- /dev/null
+++ b/src/ui/ui-drv/qt/XaoS.pro
@@ -0,0 +1,29 @@
+# -------------------------------------------------
+# Project created by QtCreator 2009-10-29T19:21:55
+# -------------------------------------------------
+macx {
+ TARGET = XaoS
+ ICON = XaoS.icns
+}
+else:TARGET = xaos
+win32:RC_FILE = xaos.rc
+DESTDIR = $PWD/../../../../../bin
+TEMPLATE = app
+INCLUDEPATH += $$PWD \
+ $$PWD/../../../include
+SOURCES += main.cpp \
+ mainwindow.cpp \
+ fractalwidget.cpp \
+ customdialog.cpp
+HEADERS += mainwindow.h \
+ fractalwidget.h \
+ customdialog.h
+include($$PWD/../../../engine/engine.pri)
+include($$PWD/../../../filter/filter.pri)
+include($$PWD/../../../ui/ui.pri)
+include($$PWD/../../../ui/ui-drv/qt/qt.pri)
+include($$PWD/../../../ui-hlp/ui-hlp.pri)
+include($$PWD/../../../util/util.pri)
+include($$PWD/config.pri)
+include($$PWD/../../../sffe/sffe.pri)
+include($$PWD/../../../include/include.pri)
diff --git a/src/ui/ui-drv/qt/XaoS.qrc b/src/ui/ui-drv/qt/XaoS.qrc
new file mode 100644
index 0000000..1940908
--- /dev/null
+++ b/src/ui/ui-drv/qt/XaoS.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/" >
+ <file>images/xaosbig.png</file>
+ </qresource>
+</RCC>
diff --git a/src/ui/ui-drv/qt/aconfig.h b/src/ui/ui-drv/qt/aconfig.h
new file mode 100644
index 0000000..cb61b1d
--- /dev/null
+++ b/src/ui/ui-drv/qt/aconfig.h
@@ -0,0 +1,63 @@
+/* src/include/aconfig.h. Generated from aconfig.h.in by configure. */
+#ifndef ACONFIG_H
+#define ACONFIG_H
+/* #undef HAVE_PTHREAD_SIGHANDLER */
+#define DATAPATH "/usr/local/share/XaoS"
+/* #undef C_ALLOCA */
+/* #undef const */
+/* #undef USE_PTHREAD */
+/*Avoid stack frame explosion on Windoze*/
+#ifndef _WIN32
+/*BeOS crashes badly when large amounts of stack are consumed */
+#ifndef __BEOS__
+#define HAVE_ALLOCA 1
+/* #undef HAVE_ALLOCA_H */
+#endif
+#endif
+#define HAVE_FABSL 1
+/* #undef HAVE__FABSL */
+/* #undef HAVE___FABSL */
+#define HAVE_FTIME 1
+#define USE_PNG 1
+#define HAVE_FINITE 1
+/* #undef HAVE_SELECT */
+#define HAVE_LONG_DOUBLE 1
+/* #undef HAVE_REDRAWWIN */
+/* #undef HAVE_WREDRAWLN */
+/* #undef USE_NCURSES */
+/* #undef inline */
+/* #undef _POSIX_SOURCE */
+#define STDC_HEADERS 1
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+#define HAVE_GETTIMEOFDAY 1
+/* #undef HAVE_USLEEP */
+/* #undef HAVE_TERMATTRS */
+/* #undef HAVE_MOUSEMASK */
+/* #undef HAVE_SETITIMER */
+/* Define if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+/* Define if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+/* Define if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+/* #undef MITSHM */
+/* #undef CURSES_DRIVER */
+/* #undef BEOS_DRIVER */
+/* #undef AA_DRIVER */
+/* #undef GTK_DRIVER */
+#define QT_DRIVER 1
+/* #undef GGI_DRIVER */
+/* #undef X11_DRIVER */
+/* #undef DGA_DRIVER */
+/* #undef SVGA_DRIVER */
+/* #undef WIN32_DRIVER */
+/* #undef DDRAW_DRIVER */
+/* #undef HTML_HELP */
+#define SIZEOF_SHORT 2
+#define SIZEOF_INT 4
+#define SIZEOF_LONG 4
+/* #undef HAVE_GETTEXT */
+#define NO_MALLOC_H 1
+#define MAIN_FUNCTION ui_main
+#endif
diff --git a/src/ui/ui-drv/qt/config.h b/src/ui/ui-drv/qt/config.h
new file mode 100644
index 0000000..b358144
--- /dev/null
+++ b/src/ui/ui-drv/qt/config.h
@@ -0,0 +1,149 @@
+#ifndef CONFIG_H
+#define CONFIG_H
+#define HOMEDIR
+
+#ifdef __BEOS__
+#define MAIN_FUNCTION be_main
+#ifdef __POWERPC__
+# define SLOWCACHESYNC
+# ifdef __MWERKS__
+# define INLINEFABS(x) __fabs(x)
+# endif
+#endif
+#endif
+
+#ifdef _WIN32
+#define CONFIGFILE "XaoS.cfg"
+#else
+#define CONFIGFILE ".XaoSrc"
+#endif
+
+/*For compilers that don't support nameless unions, do a
+#define NONAMELESSUNION
+before #include <ddraw.h>*/
+#ifdef _WIN32
+#define NONAMELESSUNION
+#endif
+
+/*#define I_WAS_HERE */ /*uncoment this to disable changing of parameters by atoconf */
+
+#define FPOINT_TYPE long double
+ /*floating point math type on computers
+ with medium speed floating point math should
+ use float instead */
+#include <aconfig.h>
+#define USE_STDIO
+#if !defined(HAVE_LONG_DOUBLE)&&!defined(I_WAS_HERE)
+#undef FPOINT_TYPE
+#define FPOINT_TYPE double
+#endif
+#define CONST const
+#define INLINE inline
+
+/* BeOS have broken long double IO routines on i386. Use our replacements */
+#ifdef __BEOS__
+#ifdef __i386__
+#define USE_XLDIO
+#endif
+#endif
+
+/* Win32 don't support long double IO. Use our replacements if possible */
+#ifdef _WIN32
+#ifndef __GNUC__
+1
+/* You need to solve long double IO problems to compile XaoS on non-gcc
+ * compiler */
+#endif
+#define USE_XLDIO
+#endif
+
+#include "gccaccel.h"
+#ifdef HAVE_MOUSEMASK
+#define NCURSESMOUSE
+#endif
+#ifndef HAVE_LIMITS_H
+#define INT_MAX 2127423647
+#endif
+#ifdef SVGA_DRIVER
+#define DESTICKY
+#endif
+#ifdef COCOA_DRIVER
+#define SFIXEDCOLOR
+#define STRUECOLOR
+#define STRUECOLOR16
+#define STRUECOLOR24
+#define SMBITMAPS
+#define SLBITMAPS
+#endif
+#ifdef QT_DRIVER
+#define SFIXEDCOLOR
+#define STRUECOLOR
+#define STRUECOLOR16
+#define STRUECOLOR24
+#define SMBITMAPS
+#define SLBITMAPS
+#endif
+#ifdef GTK_DRIVER
+#define SFIXEDCOLOR
+#define STRUECOLOR
+#define STRUECOLOR16
+#define STRUECOLOR24
+#define SMBITMAPS
+#define SLBITMAPS
+#endif
+#ifdef X11_DRIVER
+#define SFIXEDCOLOR
+#define STRUECOLOR
+#define STRUECOLOR16
+#define STRUECOLOR24
+#define SMBITMAPS
+#define SLBITMAPS
+#endif
+#ifdef SVGA_DRIVER
+#undef STRUECOLOR16
+#define STRUECOLOR16
+#undef STRUECOLOR24
+#define STRUECOLOR24
+#endif
+#ifdef GGI_DRIVER
+#undef STRUECOLOR16
+#define STRUECOLOR16
+#undef STRUECOLOR24
+#define STRUECOLOR24
+#undef SLBITMAPS
+#define SLBITMAPS
+#endif
+#ifdef BEOS_DRIVER
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __GNUC__
+void be_exit_xaos(int i) __attribute__ ((__noreturn__));
+#else
+void be_exit_xaos(int i);
+#endif
+#ifdef __cplusplus
+}
+#endif
+#define exit_xaos(i) be_exit_xaos(i)
+#undef STRUECOLOR16
+#define STRUECOLOR16
+#undef SFIXEDCOLOR
+#define SFIXEDCOLOR
+#undef SMBITMAPS
+#define SMBITMAPS
+#undef SLBITMAPS
+#define SLBITMAPS
+#endif
+#ifdef WIN32_DRIVER
+#define MAIN_FUNCTION XaoS_main
+#undef STRUECOLOR16
+#define STRUECOLOR16
+#undef STRUECOLOR24
+#define STRUECOLOR24
+#endif
+#ifdef HAVE_SELECT
+#define COMPILE_PIPE
+#endif
+#endif /*CONFIG_H */
+
diff --git a/src/ui/ui-drv/qt/config.pri b/src/ui/ui-drv/qt/config.pri
new file mode 100644
index 0000000..f666345
--- /dev/null
+++ b/src/ui/ui-drv/qt/config.pri
@@ -0,0 +1,4 @@
+HEADERS += \
+ $$PWD/config.h \
+ $$PWD/aconfig.h \
+ $$PWD/version.h
diff --git a/src/ui/ui-drv/qt/customdialog.cpp b/src/ui/ui-drv/qt/customdialog.cpp
new file mode 100644
index 0000000..d25a7d4
--- /dev/null
+++ b/src/ui/ui-drv/qt/customdialog.cpp
@@ -0,0 +1,179 @@
+#include <QtGui>
+
+
+#include "customdialog.h"
+
+#include "ui.h"
+
+CustomDialog::CustomDialog(struct uih_context *uih, const menuitem *item, const menudialog *dialog, QWidget *parent)
+ : QDialog(parent)
+{
+ m_menuitem = item;
+ m_dialog = dialog;
+ m_parameters = 0;
+
+ setWindowTitle(item->name);
+
+ QBoxLayout *dialogLayout = new QBoxLayout(QBoxLayout::TopToBottom, this);
+ QFormLayout *formLayout = new QFormLayout();
+
+ for (int i = 0; dialog[i].question; i++) {
+
+ QString label(dialog[i].question);
+ if (dialog[i].type == DIALOG_COORD) {
+
+ QLineEdit *real = new QLineEdit(QString::number(dialog[i].deffloat, 'g'), this);
+ real->setObjectName(label + "real");
+ real->setValidator(new QDoubleValidator(real));
+
+ QLineEdit *imag = new QLineEdit(QString::number(dialog[i].deffloat2, 'g'), this);
+ imag->setObjectName(label + "imag");
+ imag->setValidator(new QDoubleValidator(imag));
+
+ QBoxLayout *layout = new QBoxLayout(QBoxLayout::LeftToRight);
+ layout->setContentsMargins(0, 0, 0, 0);
+ layout->addWidget(real);
+ layout->addWidget(new QLabel("+", this));
+ layout->addWidget(imag);
+ layout->addWidget(new QLabel("i", this));
+
+ formLayout->addRow(label, layout);
+
+ } else if (dialog[i].type == DIALOG_IFILE || dialog[i].type == DIALOG_OFILE) {
+
+ QLineEdit *filename = new QLineEdit(dialog[i].defstr, this);
+ filename->setObjectName(label);
+
+ QToolButton *chooser = new QToolButton(this);
+ chooser->setObjectName(label);
+ chooser->setText("...");
+
+ if (dialog[i].type == DIALOG_IFILE)
+ connect(chooser, SIGNAL(clicked()), this, SLOT(chooseInputFile()));
+ else
+ connect(chooser, SIGNAL(clicked()), this, SLOT(chooseOutputFile()));
+
+ QBoxLayout *layout = new QBoxLayout(QBoxLayout::LeftToRight);
+ layout->setContentsMargins(0, 0, 0, 0);
+ layout->addWidget(filename);
+ layout->addWidget(chooser);
+
+ formLayout->addRow(label, layout);
+
+ } else if (dialog[i].type == DIALOG_CHOICE) {
+
+ QComboBox *combo = new QComboBox(this);
+ combo->setObjectName(label);
+
+ const char **str = (const char **)dialog[i].defstr;
+ for (int j = 0; str[j] != NULL; j++)
+ combo->addItem(str[j]);
+ combo->setCurrentIndex(dialog[i].defint);
+
+ formLayout->addRow(label, combo);
+
+ } else {
+
+ QLineEdit *field = new QLineEdit(this);
+ field->setObjectName(label);
+
+ if (dialog[i].type == DIALOG_INT) {
+ field->setText(QString::number(dialog[i].defint));
+ field->setValidator(new QIntValidator(field));
+ }
+ else if (dialog[i].type == DIALOG_FLOAT) {
+ field->setText(QString::number(dialog[i].deffloat, 'g'));
+ field->setValidator(new QDoubleValidator(field));
+ } else {
+ field->setText(dialog[i].defstr);
+ }
+
+ formLayout->addRow(label, field);
+
+ }
+ }
+
+ dialogLayout->addLayout(formLayout);
+
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(
+ (QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help),
+ Qt::Horizontal, this);
+ connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ connect(buttonBox, SIGNAL(helpRequested()), this, SLOT(showHelp()));
+ dialogLayout->addWidget(buttonBox);
+
+ setLayout(dialogLayout);
+}
+
+void CustomDialog::accept()
+{
+ int nitems;
+ for (nitems = 0; m_dialog[nitems].question; nitems++);
+ m_parameters = (dialogparam *)malloc(sizeof (*m_parameters) * nitems);
+
+ for (int i = 0; i < nitems; i++) {
+ QString label(m_dialog[i].question);
+
+ if (m_dialog[i].type == DIALOG_COORD) {
+
+ QLineEdit *real = findChild<QLineEdit *>(label + "real");
+ QLineEdit *imag = findChild<QLineEdit *>(label + "imag");
+
+ m_parameters[i].dcoord[0] = real->text().toFloat();
+ m_parameters[i].dcoord[1] = imag->text().toFloat();
+
+ } else if (m_dialog[i].type == DIALOG_CHOICE) {
+
+ QComboBox *field = findChild<QComboBox *>(label);
+ m_parameters[i].dint = field->currentIndex();
+
+ } else {
+
+ QLineEdit *field = findChild<QLineEdit *>(label);
+
+ if (m_dialog[i].type == DIALOG_INT)
+ m_parameters[i].dint = field->text().toInt();
+ else if (m_dialog[i].type == DIALOG_FLOAT)
+ m_parameters[i].number = field->text().toFloat();
+ else
+ m_parameters[i].dstring = strdup(field->text().toUtf8());
+ }
+ }
+
+ QDialog::accept();
+}
+
+dialogparam *CustomDialog::parameters()
+{
+ return m_parameters;
+}
+
+void CustomDialog::chooseInputFile()
+{
+ QLineEdit *field = findChild<QLineEdit *>(sender()->objectName());
+
+ QString filter = "XaoS Files (*.xpf *.xaf)";
+ QString directory = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
+
+ QString fileName = QFileDialog::getOpenFileName(this, sender()->objectName(), directory, filter);
+ if (!fileName.isNull())
+ {
+ field->setText(fileName);
+ }
+}
+
+void CustomDialog::chooseOutputFile()
+{
+ QLineEdit *field = findChild<QLineEdit *>(sender()->objectName());
+ QString directory = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
+
+ QString fileName = QFileDialog::getSaveFileName(this, sender()->objectName(), directory);
+ if (!fileName.isNull())
+ field->setText(fileName);
+}
+
+void CustomDialog::showHelp()
+{
+ ui_help(m_menuitem->shortname);
+}
diff --git a/src/ui/ui-drv/qt/customdialog.h b/src/ui/ui-drv/qt/customdialog.h
new file mode 100644
index 0000000..168e24f
--- /dev/null
+++ b/src/ui/ui-drv/qt/customdialog.h
@@ -0,0 +1,29 @@
+#ifndef CUSTOMDIALOG_H
+#define CUSTOMDIALOG_H
+
+#include <QDialog>
+
+#include "ui.h"
+
+class CustomDialog : public QDialog
+{
+ Q_OBJECT
+
+private:
+ const menuitem *m_menuitem;
+ const menudialog *m_dialog;
+ dialogparam *m_parameters;
+
+private slots:
+ void chooseInputFile();
+ void chooseOutputFile();
+ void showHelp();
+
+public:
+ CustomDialog(struct uih_context *uih, const menuitem *item, const menudialog *dialog, QWidget *parent = 0);
+
+ void accept();
+ dialogparam *parameters();
+};
+
+#endif // CUSTOMDIALOG_H
diff --git a/src/ui/ui-drv/qt/fractalwidget.cpp b/src/ui/ui-drv/qt/fractalwidget.cpp
new file mode 100644
index 0000000..0fa1141
--- /dev/null
+++ b/src/ui/ui-drv/qt/fractalwidget.cpp
@@ -0,0 +1,228 @@
+#include "fractalwidget.h"
+
+#include "ui.h"
+
+#include <QtGui>
+
+FractalWidget::FractalWidget()
+{
+ m_mouseButtons = 0;
+ m_mousePosition = QPoint(0, 0);
+ m_keyCombination = 0;
+ m_activeImage = 0;
+ m_image[0] = m_image[1] = 0;
+
+ setFocusPolicy(Qt::WheelFocus);
+ setMouseTracking(true);
+}
+
+void FractalWidget::updateMouse(QMouseEvent *event)
+{
+ m_mousePosition = event->pos();
+ m_mouseButtons = event->buttons();
+ m_keyboardModifiers = event->modifiers();
+}
+
+void FractalWidget::mousePressEvent(QMouseEvent *event)
+{
+ updateMouse(event);
+}
+
+void FractalWidget::mouseReleaseEvent(QMouseEvent *event)
+{
+ updateMouse(event);
+}
+
+void FractalWidget::mouseMoveEvent(QMouseEvent *event)
+{
+ updateMouse(event);
+}
+
+void FractalWidget::wheelEvent(QWheelEvent *event)
+{
+}
+
+void FractalWidget::keyPressEvent(QKeyEvent *event)
+{
+ m_keyboardModifiers = event->modifiers();
+
+ switch (event->key()) {
+ case Qt::Key_Left:
+ m_keyCombination |= 1;
+ ui_key(UIKEY_LEFT);
+ break;
+ case Qt::Key_Right:
+ m_keyCombination |= 2;
+ ui_key(UIKEY_RIGHT);
+ break;
+ case Qt::Key_Up:
+ m_keyCombination |= 4;
+ ui_key(UIKEY_UP);
+ break;
+ case Qt::Key_Down:
+ m_keyCombination |= 8;
+ ui_key(UIKEY_DOWN);
+ break;
+ case Qt::Key_PageUp:
+ ui_key(UIKEY_PGUP);
+ break;
+ case Qt::Key_PageDown:
+ ui_key(UIKEY_PGDOWN);
+ break;
+ case Qt::Key_Backspace:
+ ui_key(UIKEY_BACKSPACE);
+ break;
+ case Qt::Key_Escape:
+ ui_key(UIKEY_ESC);
+ break;
+ case Qt::Key_Home:
+ ui_key(UIKEY_HOME);
+ break;
+ case Qt::Key_End:
+ ui_key(UIKEY_END);
+ break;
+ case Qt::Key_Tab:
+ ui_key(UIKEY_TAB);
+ break;
+ default:
+ if (!event->text().isEmpty())
+ ui_key(event->text().toAscii()[0]);
+ else
+ event->ignore();
+ }
+}
+
+void FractalWidget::keyReleaseEvent(QKeyEvent *event)
+{
+ m_keyboardModifiers = event->modifiers();
+
+ switch (event->key()) {
+ case Qt::Key_Left:
+ m_keyCombination &= ~1;
+ break;
+ case Qt::Key_Right:
+ m_keyCombination &= ~2;
+ break;
+ case Qt::Key_Up:
+ m_keyCombination &= ~4;
+ break;
+ case Qt::Key_Down:
+ m_keyCombination &= ~8;
+ break;
+ default:
+ event->ignore();
+ }
+}
+
+void FractalWidget::resizeEvent(QResizeEvent *event)
+{
+ if (m_image[0] && m_image[1])
+ ui_call_resize();
+}
+
+void FractalWidget::paintEvent (QPaintEvent *event)
+{
+ if (m_image[m_activeImage]) {
+ QPainter painter(this);
+ painter.drawImage(0, 0, *m_image[m_activeImage]);
+ }
+}
+
+void FractalWidget::createImages()
+{
+ m_image[0] = new QImage(width(), height(), QImage::Format_RGB32);
+ m_image[1] = new QImage(width(), height(), QImage::Format_RGB32);
+ m_activeImage = 0;
+}
+
+void FractalWidget::destroyImages()
+{
+ delete m_image[0];
+ delete m_image[1];
+}
+
+char *FractalWidget::imageBuffer1()
+{
+ return (char *)m_image[0]->bits();
+}
+
+char *FractalWidget::imageBuffer2()
+{
+ return (char *)m_image[1]->bits();
+}
+
+int FractalWidget::imageBytesPerLine()
+{
+ return m_image[0]->bytesPerLine();
+}
+
+void FractalWidget::switchActiveImage()
+{
+ m_activeImage ^= 1;
+}
+
+QPoint FractalWidget::mousePosition()
+{
+ return m_mousePosition;
+}
+
+int FractalWidget::mouseButtons()
+{
+
+ // Qt::MetaModifier maps to control key on Macs
+ Qt::KeyboardModifier controlModifier =
+#ifdef Q_WS_MAC
+ Qt::MetaModifier;
+#else
+ Qt::ControlModifier;
+#endif
+
+ int mouseButtons = 0;
+
+ // Modifier keys change behavior of left and right mouse buttons
+ if (m_keyboardModifiers & controlModifier) {
+ // Control key swaps left and right buttons
+ if (m_mouseButtons & Qt::LeftButton)
+ mouseButtons |= BUTTON3;
+ if (m_mouseButtons & Qt::RightButton)
+ mouseButtons |= BUTTON1;
+ } else if (m_keyboardModifiers & Qt::ShiftModifier) {
+ // Shift key makes left and right buttons emulate middle button
+ mouseButtons |= BUTTON2;
+ } else {
+ // Otherwise, mouse buttons map normally
+ if (m_mouseButtons & Qt::LeftButton)
+ mouseButtons |= BUTTON1;
+ if (m_mouseButtons & Qt::RightButton)
+ mouseButtons |= BUTTON3;
+ }
+
+ // Middle button is unaffected by modifier keys
+ if (m_mouseButtons & Qt::MidButton)
+ mouseButtons |= BUTTON2;
+
+ return mouseButtons;
+}
+
+int FractalWidget::keyCombination()
+{
+ return m_keyCombination;
+}
+
+void FractalWidget::setCursorType(int type)
+{
+ if (type == WAITMOUSE || type == REPLAYMOUSE)
+ setCursor(Qt::WaitCursor);
+ else
+ setCursor(Qt::ArrowCursor);
+}
+
+QSize FractalWidget::sizeHint() const
+{
+ return m_sizeHint;
+}
+
+void FractalWidget::setSizeHint(const QSize &size)
+{
+ m_sizeHint = size;
+}
diff --git a/src/ui/ui-drv/qt/fractalwidget.h b/src/ui/ui-drv/qt/fractalwidget.h
new file mode 100644
index 0000000..8fcdd8f
--- /dev/null
+++ b/src/ui/ui-drv/qt/fractalwidget.h
@@ -0,0 +1,57 @@
+#ifndef FRACTALWIDGET_H
+#define FRACTALWIDGET_H
+
+#include <QWidget>
+
+class QImage;
+class QPoint;
+
+class FractalWidget : public QWidget
+{
+ Q_OBJECT
+
+private:
+ QImage *m_image[2];
+ int m_activeImage;
+ QPoint m_mousePosition;
+ Qt::MouseButtons m_mouseButtons;
+ Qt::KeyboardModifiers m_keyboardModifiers;
+ int m_keyCombination;
+ QSize m_sizeHint;
+
+ void updateMouse(QMouseEvent *event);
+
+protected:
+ void mousePressEvent(QMouseEvent *event);
+ void mouseReleaseEvent(QMouseEvent *event);
+ void mouseMoveEvent(QMouseEvent *event);
+ void wheelEvent(QWheelEvent *event);
+ void keyPressEvent(QKeyEvent *event);
+ void keyReleaseEvent(QKeyEvent *event);
+ void paintEvent (QPaintEvent *event);
+ void resizeEvent(QResizeEvent *event);
+
+public:
+ FractalWidget();
+
+ void createImages();
+ void destroyImages();
+
+ char *imageBuffer1();
+ char *imageBuffer2();
+ int imageBytesPerLine();
+ QSize imageSize();
+
+ void switchActiveImage();
+
+ QPoint mousePosition();
+ int mouseButtons();
+ int keyCombination();
+
+ void setCursorType(int type);
+
+ QSize sizeHint() const;
+ void setSizeHint(const QSize &size);
+};
+
+#endif // FRACTALWIDGET_H
diff --git a/src/ui/ui-drv/qt/images/xaosbig.png b/src/ui/ui-drv/qt/images/xaosbig.png
new file mode 100644
index 0000000..ce38dc3
--- /dev/null
+++ b/src/ui/ui-drv/qt/images/xaosbig.png
Binary files differ
diff --git a/src/ui/ui-drv/qt/main.cpp b/src/ui/ui-drv/qt/main.cpp
new file mode 100644
index 0000000..5100312
--- /dev/null
+++ b/src/ui/ui-drv/qt/main.cpp
@@ -0,0 +1,180 @@
+#include <QtGui/QApplication>
+
+#include "mainwindow.h"
+#include "fractalwidget.h"
+
+#include "ui.h"
+#include "filter.h"
+#include "ui_helper.h"
+#include "version.h"
+
+
+MainWindow *window;
+FractalWidget *widget;
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setApplicationName("XaoS");
+ QCoreApplication::setApplicationVersion(XaoS_VERSION);
+ QCoreApplication::setOrganizationName("XaoS Project");
+ QCoreApplication::setOrganizationDomain("xaos.sourceforge.net");
+
+ QApplication a(argc, argv);
+ MAIN_FUNCTION(argc, argv);
+ //return a.exec();
+}
+
+static int
+qt_initDriver ()
+{
+ window = new MainWindow();
+ widget = window->fractalWidget();
+ window->show();
+ return 1;
+}
+
+static void
+qt_uninitDriver ()
+{
+ delete window;
+}
+
+static int
+qt_allocBuffers (char **b1, char **b2)
+{
+ widget->createImages();
+ *b1 = widget->imageBuffer1();
+ *b2 = widget->imageBuffer2();
+ return widget->imageBytesPerLine();
+}
+
+static void
+qt_freeBuffers (char *b1, char *b2)
+{
+ widget->destroyImages();
+}
+
+static void
+qt_getImageSize (int *w, int *h)
+{
+ *w = widget->size().width();
+ *h = widget->size().height();
+}
+
+static void
+qt_flipBuffers ()
+{
+ widget->switchActiveImage();
+}
+
+static void
+qt_redrawImage()
+{
+ widget->update();
+}
+
+static void
+qt_processEvents (int wait, int *mx, int *my, int *mb, int *k)
+{
+ QCoreApplication::processEvents(wait ? QEventLoop::WaitForMoreEvents : QEventLoop::AllEvents);
+
+ *mx = widget->mousePosition().x();
+ *my = widget->mousePosition().y();
+ *mb = widget->mouseButtons();
+ *k = widget->keyCombination();
+}
+
+static void
+qt_getMouse (int *x, int *y, int *b)
+{
+ *x = widget->mousePosition().x();
+ *y = widget->mousePosition().y();
+ *b = widget->mouseButtons();
+}
+
+static void
+qt_printText(int x, int y, CONST char *text)
+{
+ window->showMessage(text);
+}
+
+static void
+qt_setCursorType (int type)
+{
+ widget->setCursorType(type);
+}
+
+static void
+qt_buildMenu (struct uih_context *uih, CONST char *name)
+{
+ window->buildMenu(uih, name);
+}
+
+static void
+qt_popupMenu (struct uih_context *uih, CONST char *name)
+{
+ window->popupMenu(uih, name);
+}
+
+static void
+qt_toggleMenu (struct uih_context *uih, CONST char *name)
+{
+ window->toggleMenu(uih, name);
+}
+
+static void
+qt_showDialog (struct uih_context *c, CONST char *name)
+{
+ window->showDialog(c, name);
+}
+
+static void
+qt_showHelp (struct uih_context *c, CONST char *name)
+{
+}
+
+struct gui_driver qt_gui_driver = {
+/* setrootmenu */ qt_buildMenu,
+/* enabledisable */ qt_toggleMenu,
+/* menu */ qt_popupMenu,
+/* dialog */ qt_showDialog,
+/* help */ NULL
+};
+
+static struct params qt_params[] = {
+{NULL, 0, NULL, NULL}
+};
+
+struct ui_driver qt_driver = {
+/* name */ "Qt Driver",
+/* init */ qt_initDriver,
+/* getsize */ qt_getImageSize,
+/* processevents */ qt_processEvents,
+/* getmouse */ qt_getMouse,
+/* uninit */ qt_uninitDriver,
+/* set_color */ NULL,
+/* set_range */ NULL,
+/* print */ qt_printText,
+/* display */ qt_redrawImage,
+/* alloc_buffers */ qt_allocBuffers,
+/* free_buffers */ qt_freeBuffers,
+/* filp_buffers */ qt_flipBuffers,
+/* mousetype */ qt_setCursorType,
+/* flush */ NULL,
+/* textwidth */ 12,
+/* textheight */ 12,
+/* params */ qt_params,
+/* flags */ PIXELSIZE,
+/* width */ 0.01,
+/* height */ 0.01,
+/* maxwidth */ 0,
+/* maxheight */ 0,
+/* imagetype */ UI_TRUECOLOR,
+/* palettestart */ 0,
+/* paletteend */ 256,
+/* maxentries */ 255,
+/* rmask */ 0xff0000,
+/* gmask */ 0x00ff00,
+/* bmask */ 0x0000ff,
+/* gui_driver */ &qt_gui_driver
+};
diff --git a/src/ui/ui-drv/qt/mainwindow.cpp b/src/ui/ui-drv/qt/mainwindow.cpp
new file mode 100644
index 0000000..aa03e66
--- /dev/null
+++ b/src/ui/ui-drv/qt/mainwindow.cpp
@@ -0,0 +1,172 @@
+#include "mainwindow.h"
+#include "fractalwidget.h"
+#include "customdialog.h"
+
+#include "ui.h"
+
+#include <QtGui>
+
+
+MainWindow::MainWindow(QWidget *parent)
+ : QMainWindow(parent)
+{
+ setWindowTitle(QCoreApplication::applicationName());
+
+ statusBar()->show();
+
+ m_fractalWidget = new FractalWidget();
+ setCentralWidget(m_fractalWidget);
+
+ readSettings();
+}
+
+MainWindow::~MainWindow()
+{
+}
+
+FractalWidget *MainWindow::fractalWidget()
+{
+ return m_fractalWidget;
+}
+
+void MainWindow::readSettings()
+{
+ QSettings settings;
+ QPoint pos = settings.value("windowPosition", QPoint(200, 200)).toPoint();
+ QSize size = settings.value("imageSize", QSize(640, 480)).toSize();
+ m_fractalWidget->setSizeHint(size);
+ move(pos);
+}
+
+void MainWindow::writeSettings()
+{
+ QSettings settings;
+ settings.setValue("windowPosition", pos());
+ settings.setValue("imageSize", size());
+}
+
+void MainWindow::closeEvent(QCloseEvent *event)
+{
+ writeSettings();
+ ui_quit();
+}
+
+void MainWindow::showMessage(const QString &message)
+{
+ statusBar()->showMessage(message, 5000);
+}
+
+QKeySequence::StandardKey MainWindow::keyForItem(const QString &name)
+{
+ if (name =="initstate") return QKeySequence::New;
+ if (name =="loadpos") return QKeySequence::Open;
+ if (name =="savepos") return QKeySequence::Save;
+ if (name =="undo") return QKeySequence::Undo;
+ if (name =="redo") return QKeySequence::Redo;
+ if (name =="recalculate") return QKeySequence::Refresh;
+ if (name =="help") return QKeySequence::HelpContents;
+
+ return QKeySequence::UnknownKey;
+}
+
+void MainWindow::buildMenu(struct uih_context *uih, const char *name)
+{
+ menuBar()->clear();
+
+ const menuitem *item;
+ for (int i = 0; (item = menu_item(name, i)) != NULL; i++) {
+ if (item->type == MENU_SUBMENU) {
+ QMenu *menu = menuBar()->addMenu(QString(item->name));
+ buildMenu(uih, item->shortname, menu);
+ }
+ }
+}
+
+void MainWindow::buildMenu(struct uih_context *uih, const char *name, QMenu *parent)
+{
+ QActionGroup *group = new QActionGroup(parent);
+
+ const menuitem *item;
+ for (int i = 0; (item = menu_item(name, i)) != NULL; i++) {
+
+ QString itemName(item->name);
+ if (item->type == MENU_DIALOG || item->type == MENU_CUSTOMDIALOG)
+ itemName += "...";
+
+ if (item->type == MENU_SEPARATOR) {
+ parent->addSeparator();
+ } else if (item->type == MENU_SUBMENU) {
+ QMenu *menu = parent->addMenu(item->name);
+ buildMenu(uih, item->shortname, menu);
+ } else {
+ QAction *action = new QAction(itemName, parent);
+ action->setShortcuts(keyForItem(item->shortname));
+ action->setObjectName(item->shortname);
+ if (item->flags & (MENUFLAG_RADIO | MENUFLAG_CHECKBOX)) {
+ action->setCheckable(true);
+ action->setChecked(menu_enabled(item, uih));
+ if (item->flags & MENUFLAG_RADIO)
+ action->setActionGroup(group);
+ }
+ connect(action, SIGNAL(triggered()), this, SLOT(activateMenuItem()));
+ parent->addAction(action);
+ }
+ }
+}
+
+void MainWindow::popupMenu(struct uih_context *uih, const char *name)
+{
+ QMenu *menu = new QMenu(this);
+ buildMenu(uih, name, menu);
+ menu->exec(QCursor::pos());
+ delete menu;
+}
+
+void MainWindow::toggleMenu(struct uih_context *uih, const char *name)
+{
+ const menuitem *item = menu_findcommand(name);
+ QAction *action = menuBar()->findChild<QAction *>(name);
+ if (action)
+ action->setChecked(menu_enabled(item, uih));
+}
+
+void MainWindow::activateMenuItem()
+{
+ QAction *action = qobject_cast<QAction *>(sender());
+ const menuitem *item = menu_findcommand(action->objectName().toAscii());
+ ui_menuactivate(item, NULL);
+}
+
+void MainWindow::showDialog(struct uih_context *uih, const char *name)
+{
+ const menuitem *item = menu_findcommand(name);
+ if (!item) return;
+
+ const menudialog *dialog = menu_getdialog(uih, item);
+ if (!dialog) return;
+
+ int nitems;
+ for (nitems = 0; dialog[nitems].question; nitems++);
+
+ if (nitems == 1 && (dialog[0].type == DIALOG_IFILE || dialog[0].type == DIALOG_OFILE)) {
+ QString filter = QString("*.%1").arg(QFileInfo(dialog[0].defstr).completeSuffix());
+ QString directory;// = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
+
+ QString fileName;
+ if (dialog[0].type == DIALOG_IFILE)
+ fileName = QFileDialog::getOpenFileName(this, item->name, directory, filter);
+ else if (dialog[0].type == DIALOG_OFILE)
+ fileName = QFileDialog::getSaveFileName(this, item->name, directory, filter);
+
+
+ if (!fileName.isNull()) {
+ dialogparam *param = (dialogparam *)malloc(sizeof(dialogparam));
+ param->dstring = strdup(fileName.toUtf8());
+ ui_menuactivate(item, param);
+ }
+ } else {
+ CustomDialog customDialog(uih, item, dialog, this);
+ if (customDialog.exec() == QDialog::Accepted)
+ ui_menuactivate(item, customDialog.parameters());
+ }
+}
diff --git a/src/ui/ui-drv/qt/mainwindow.h b/src/ui/ui-drv/qt/mainwindow.h
new file mode 100644
index 0000000..ffead6d
--- /dev/null
+++ b/src/ui/ui-drv/qt/mainwindow.h
@@ -0,0 +1,43 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QtGui/QMainWindow>
+
+class QImage;
+class FractalWidget;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+private:
+ FractalWidget *m_fractalWidget;
+
+ void readSettings();
+ void writeSettings();
+
+ static QKeySequence::StandardKey keyForItem(const QString &name);
+
+protected:
+ void closeEvent(QCloseEvent *event);
+
+private slots:
+ void activateMenuItem();
+
+ public:
+ MainWindow(QWidget *parent = 0);
+ ~MainWindow();
+
+ FractalWidget *fractalWidget();
+
+ void showMessage(const QString &message);
+
+ void buildMenu(struct uih_context *uih, const char *name);
+ void buildMenu(struct uih_context *uih, const char *name, QMenu *parent);
+ void popupMenu(struct uih_context *uih, const char *name);
+ void toggleMenu(struct uih_context *uih, const char *name);
+
+ void showDialog(struct uih_context *uih, const char *name);
+};
+
+#endif // MAINWINDOW_H
diff --git a/src/ui/ui-drv/qt/ui_qt.c b/src/ui/ui-drv/qt/ui_qt.c
new file mode 100644
index 0000000..1ac3b0a
--- /dev/null
+++ b/src/ui/ui-drv/qt/ui_qt.c
@@ -0,0 +1,99 @@
+#include "aconfig.h"
+#ifdef TEMPLATE_DRIVER
+/*includes */
+#include <ui.h>
+
+static int template_set_color(int r, int g, int b, int init)
+{
+ return ( /*pixel value or -1 for full palette */ -1);
+}
+
+static void template_setpalette(ui_palette pal, int start, int end)
+{
+}
+
+static void template_print(int x, int y, CONST char *text)
+{
+}
+
+static void template_display()
+{
+}
+
+static void template_flip_buffers()
+{
+}
+
+void template_free_buffers(char *b1, char *b2)
+{
+}
+
+int template_alloc_buffers(char **b1, char **b2)
+{
+ return 1; /* bytes per scanline */
+}
+
+static void template_getsize(int *w, int *h)
+{
+}
+
+static void
+template_processevents(int wait, int *mx, int *my, int *mb, int *k)
+{
+}
+
+static int template_init()
+{
+ return ( /*1 for sucess 0 for fail */ 1);
+}
+
+static void template_uninitialise()
+{
+}
+
+static void template_getmouse(int *x, int *y, int *b)
+{
+}
+
+
+static void template_mousetype(int type)
+{
+}
+
+static struct params params[] = {
+ {"", P_HELP, NULL, "Template driver options:"},
+ {"-flag", P_SWITCH, &variable, "Example flag..."},
+ {NULL, 0, NULL, NULL}
+};
+
+struct ui_driver template_driver = {
+ "Template",
+ template_init,
+ template_getsize,
+ template_processevents,
+ template_getmouse,
+ template_uninitialise,
+ template_set_color, /*You should implement just one */
+ template_set_palette, /*of these and add NULL as second */
+ template_print,
+ template_display,
+ template_alloc_buffers,
+ template_free_buffers,
+ template_flip_buffers,
+ template_mousetype, /*This should be NULL */
+ NULL, /*flush */
+ 8, /*text width */
+ 8, /*text height */
+ UGLYTEXTSIZE,
+ params,
+ 0, /*flags...see ui.h */
+ 0.0, 0.0, /*width/height of screen in centimeters */
+ 0, 0, /*resolution of screen for windowed systems */
+ UI_C256, /*Image type */
+ 0, 255, 255 /*start, end of palette and maximum allocatable */
+ /*entries */
+};
+
+/* DONT FORGET TO ADD DOCUMENTATION ABOUT YOUR DRIVER INTO xaos.hlp FILE!*/
+
+#endif
diff --git a/src/ui/ui-drv/qt/version.h b/src/ui/ui-drv/qt/version.h
new file mode 100644
index 0000000..94cd83e
--- /dev/null
+++ b/src/ui/ui-drv/qt/version.h
@@ -0,0 +1,23 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#define XaoS_VERSION "4.0"
diff --git a/src/ui/ui-drv/qt/xaos.ico b/src/ui/ui-drv/qt/xaos.ico
new file mode 100644
index 0000000..12347f5
--- /dev/null
+++ b/src/ui/ui-drv/qt/xaos.ico
Binary files differ
diff --git a/src/ui/ui-drv/qt/xaos.rc b/src/ui/ui-drv/qt/xaos.rc
new file mode 100644
index 0000000..6235fef
--- /dev/null
+++ b/src/ui/ui-drv/qt/xaos.rc
@@ -0,0 +1 @@
+IDI_ICON1 ICON DISCARDABLE "xaos.ico"
diff --git a/src/ui/ui-drv/template/Makefile.in b/src/ui/ui-drv/template/Makefile.in
new file mode 100644
index 0000000..185abd4
--- /dev/null
+++ b/src/ui/ui-drv/template/Makefile.in
@@ -0,0 +1,39 @@
+CC = @CC@
+CFLAGS = @CFLAGS@
+LIBS = @LIBS@ -lm
+LFLAGS = @LDFLAGS@
+#AR = @AR@
+RANLIB = @RANLIB@
+
+SRCS = ui_template.c
+
+OBJS = $(SRCS:.c=.o)
+
+TLIB = @LIBPATH@/libuitemplate.a
+
+
+all: $(TLIB)
+
+$(TLIB):$(OBJS)
+ rm -f $@
+ $(AR) rc $@ $^
+ $(RANLIB) $@
+
+clean:
+ rm -f $(TLIB)
+ rm -f *.[oas]
+ rm -f *~
+ rm -f core
+
+distclean:clean
+ rm Makefile
+
+#dep:
+# rm -f .depend
+# make .depend
+#
+#.depend:
+# echo '# Program dependencies' >.depend
+# gcc -I svgalib $(DEFINES) -MM $(patsubst %.o,%.c,$(OBJS)) >>.depend
+#
+#include .depend
diff --git a/src/ui/ui-drv/template/ui_template.c b/src/ui/ui-drv/template/ui_template.c
new file mode 100644
index 0000000..1ac3b0a
--- /dev/null
+++ b/src/ui/ui-drv/template/ui_template.c
@@ -0,0 +1,99 @@
+#include "aconfig.h"
+#ifdef TEMPLATE_DRIVER
+/*includes */
+#include <ui.h>
+
+static int template_set_color(int r, int g, int b, int init)
+{
+ return ( /*pixel value or -1 for full palette */ -1);
+}
+
+static void template_setpalette(ui_palette pal, int start, int end)
+{
+}
+
+static void template_print(int x, int y, CONST char *text)
+{
+}
+
+static void template_display()
+{
+}
+
+static void template_flip_buffers()
+{
+}
+
+void template_free_buffers(char *b1, char *b2)
+{
+}
+
+int template_alloc_buffers(char **b1, char **b2)
+{
+ return 1; /* bytes per scanline */
+}
+
+static void template_getsize(int *w, int *h)
+{
+}
+
+static void
+template_processevents(int wait, int *mx, int *my, int *mb, int *k)
+{
+}
+
+static int template_init()
+{
+ return ( /*1 for sucess 0 for fail */ 1);
+}
+
+static void template_uninitialise()
+{
+}
+
+static void template_getmouse(int *x, int *y, int *b)
+{
+}
+
+
+static void template_mousetype(int type)
+{
+}
+
+static struct params params[] = {
+ {"", P_HELP, NULL, "Template driver options:"},
+ {"-flag", P_SWITCH, &variable, "Example flag..."},
+ {NULL, 0, NULL, NULL}
+};
+
+struct ui_driver template_driver = {
+ "Template",
+ template_init,
+ template_getsize,
+ template_processevents,
+ template_getmouse,
+ template_uninitialise,
+ template_set_color, /*You should implement just one */
+ template_set_palette, /*of these and add NULL as second */
+ template_print,
+ template_display,
+ template_alloc_buffers,
+ template_free_buffers,
+ template_flip_buffers,
+ template_mousetype, /*This should be NULL */
+ NULL, /*flush */
+ 8, /*text width */
+ 8, /*text height */
+ UGLYTEXTSIZE,
+ params,
+ 0, /*flags...see ui.h */
+ 0.0, 0.0, /*width/height of screen in centimeters */
+ 0, 0, /*resolution of screen for windowed systems */
+ UI_C256, /*Image type */
+ 0, 255, 255 /*start, end of palette and maximum allocatable */
+ /*entries */
+};
+
+/* DONT FORGET TO ADD DOCUMENTATION ABOUT YOUR DRIVER INTO xaos.hlp FILE!*/
+
+#endif
diff --git a/src/ui/ui-drv/win32/Makefile.in b/src/ui/ui-drv/win32/Makefile.in
new file mode 100644
index 0000000..f2cd8a0
--- /dev/null
+++ b/src/ui/ui-drv/win32/Makefile.in
@@ -0,0 +1,43 @@
+CC = @CC@
+CFLAGS = @CFLAGS@
+LIBS = @LIBS@ -lm
+LFLAGS = @LDFLAGS@
+AR = @AR@
+RANLIB = @RANLIB@
+
+SRCS = ui_win32.c dxguid.c winmenu.c windialo.c about.c
+
+OBJS = $(SRCS:.c=.o) #xaos.res
+
+TLIB = @LIBPATH@/libuiwin32.a
+
+
+all: ui_win32.o xaos.res $(TLIB)
+
+$(TLIB):$(OBJS)
+ rm -f $@
+ $(AR) rc $@ $(OBJS)
+ $(RANLIB) $@
+
+clean:
+ rm -f $(TLIB)
+ rm -f *.[oas]
+ rm -f *~
+ rm -f core
+ rm -f xaos.res
+
+xaos.res: xaos.rc resource.h xaos.dlg
+ windres xaos.rc -O coff -o $@
+
+distclean:clean
+ rm Makefile
+
+#dep:
+# rm -f .depend
+# make .depend
+#
+#.depend:
+# echo '# Program dependencies' >.depend
+# gcc -I svgalib $(DEFINES) -MM $(patsubst %.o,%.c,$(OBJS)) >>.depend
+#
+#include .depend
diff --git a/src/ui/ui-drv/win32/about.c b/src/ui/ui-drv/win32/about.c
new file mode 100644
index 0000000..22b040d
--- /dev/null
+++ b/src/ui/ui-drv/win32/about.c
@@ -0,0 +1,239 @@
+#include <windows.h>
+#include "fconfig.h"
+#include "xerror.h"
+#include "ui_win32.h"
+#include "about.h"
+void CenterWindow(HWND hwndChild, HWND hwndParent)
+{
+ RECT rChild, rParent, rWorkArea;
+ int wChild, hChild, wParent, hParent;
+ int xNew, yNew;
+ BOOL bResult;
+
+ GetWindowRect(hwndChild, &rChild);
+ wChild = rChild.right - rChild.left;
+ hChild = rChild.bottom - rChild.top;
+
+ GetWindowRect(hwndParent, &rParent);
+ wParent = rParent.right - rParent.left;
+ hParent = rParent.bottom - rParent.top;
+
+ bResult = SystemParametersInfo(SPI_GETWORKAREA, // system parameter to query or set
+ sizeof(RECT), &rWorkArea, 0);
+ if (!bResult) {
+ rWorkArea.left = rWorkArea.top = 0;
+ rWorkArea.right = GetSystemMetrics(SM_CXSCREEN);
+ rWorkArea.bottom = GetSystemMetrics(SM_CYSCREEN);
+ }
+
+ xNew = rParent.left + ((wParent - wChild) / 2);
+ if (xNew < rWorkArea.left) {
+ xNew = rWorkArea.left;
+ } else if ((xNew + wChild) > rWorkArea.right) {
+ xNew = rWorkArea.right - wChild;
+ }
+
+ yNew = rParent.top + ((hParent - hChild) / 2);
+ if (yNew < rWorkArea.top) {
+ yNew = rWorkArea.top;
+ } else if ((yNew + hChild) > rWorkArea.bottom) {
+ yNew = rWorkArea.bottom - hChild;
+ }
+
+ SetWindowPos(hwndChild, NULL, xNew, yNew, 0, 0,
+ SWP_NOSIZE | SWP_NOZORDER);
+ return;
+}
+
+
+static LPTSTR GetStringRes(int id)
+{
+ static TCHAR buffer[MAX_PATH];
+
+ buffer[0] = 0;
+ LoadString(GetModuleHandle(NULL), id, buffer, MAX_PATH);
+ return buffer;
+}
+
+static LRESULT CALLBACK
+About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ static HFONT hfontDlg; // Font for dialog text
+ static HFONT hFinePrint; // Font for 'fine print' in dialog
+ DWORD dwVerInfoSize; // Size of version information block
+ LPSTR lpVersion; // String pointer to 'version' text
+ DWORD dwVerHnd = 0; // An 'ignored' parameter, always '0'
+ UINT uVersionLen;
+ WORD wRootLen;
+ BOOL bRetCode;
+ int i;
+ char szFullPath[256];
+ char szResult[256];
+ char szGetName[256];
+ DWORD dwVersion;
+ char szVersion[40];
+ DWORD dwResult;
+
+ switch (message) {
+ case WM_INITDIALOG:
+ ShowWindow(hDlg, SW_HIDE);
+
+ if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_JAPANESE) {
+ hfontDlg =
+ CreateFont(14, 0, 0, 0, 0, 0, 0, 0, SHIFTJIS_CHARSET, 0, 0,
+ 0, VARIABLE_PITCH | FF_DONTCARE, "");
+ hFinePrint =
+ CreateFont(11, 0, 0, 0, 0, 0, 0, 0, SHIFTJIS_CHARSET, 0, 0,
+ 0, VARIABLE_PITCH | FF_DONTCARE, "");
+ } else {
+ hfontDlg = CreateFont(14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ VARIABLE_PITCH | FF_SWISS, "");
+ hFinePrint = CreateFont(11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ VARIABLE_PITCH | FF_SWISS, "");
+ }
+
+ CenterWindow(hDlg, GetWindow(hDlg, GW_OWNER));
+ GetModuleFileName(hInstance, szFullPath, sizeof(szFullPath));
+#if 0
+ // Now lets dive in and pull out the version information:
+ dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd);
+ if (dwVerInfoSize) {
+ LPSTR lpstrVffInfo;
+ HANDLE hMem;
+ hMem = GlobalAlloc(GMEM_MOVEABLE, dwVerInfoSize);
+ lpstrVffInfo = GlobalLock(hMem);
+ GetFileVersionInfo(szFullPath, dwVerHnd, dwVerInfoSize,
+ lpstrVffInfo);
+ // The below 'hex' value looks a little confusing, but
+ // essentially what it is, is the hexidecimal representation
+ // of a couple different values that represent the language
+ // and character set that we are wanting string values for.
+ // 040904E4 is a very common one, because it means:
+ // US English, Windows MultiLingual characterset
+ // Or to pull it all apart:
+ // 04------ = SUBLANG_ENGLISH_USA
+ // --09---- = LANG_ENGLISH
+ // --11---- = LANG_JAPANESE
+ // ----04E4 = 1252 = Codepage for Windows:Multilingual
+
+ lstrcpy(szGetName, GetStringRes(IDS_VER_INFO_LANG));
+
+ wRootLen = (WORD) lstrlen(szGetName); // Save this position
+
+ // Set the title of the dialog:
+ lstrcat(szGetName, "ProductName");
+ bRetCode = VerQueryValue((LPVOID) lpstrVffInfo,
+ (LPSTR) szGetName,
+ (LPVOID) & lpVersion,
+ (UINT *) & uVersionLen);
+
+ // Notice order of version and string...
+ if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_JAPANESE) {
+ lstrcpy(szResult, lpVersion);
+ lstrcat(szResult, " ‚̃o[ƒWƒ‡ƒ“î•ñ");
+ } else {
+ lstrcpy(szResult, "About ");
+ lstrcat(szResult, lpVersion);
+ }
+
+ // -----------------------------------------------------
+
+ SetWindowText(hDlg, szResult);
+
+ // Walk through the dialog items that we want to replace:
+ for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++) {
+ GetDlgItemText(hDlg, i, szResult, sizeof(szResult));
+ szGetName[wRootLen] = (char) 0;
+ lstrcat(szGetName, szResult);
+ uVersionLen = 0;
+ lpVersion = NULL;
+ x_message("lpstrVffInfo %s", lpstrVffInfo);
+ bRetCode = VerQueryValue((LPVOID) lpstrVffInfo,
+ (LPSTR) szGetName,
+ (LPVOID) & lpVersion,
+ (UINT *) & uVersionLen);
+
+ if (bRetCode && uVersionLen && lpVersion) {
+ // Replace dialog item text with version info
+ lstrcpy(szResult, lpVersion);
+ SetDlgItemText(hDlg, i, szResult);
+ } else {
+ dwResult = GetLastError();
+
+ wsprintf(szResult, GetStringRes(IDS_VERSION_ERROR),
+ dwResult);
+ SetDlgItemText(hDlg, i, szResult);
+ }
+ SendMessage(GetDlgItem(hDlg, i), WM_SETFONT,
+ /* (ULONG_PTR) */
+ (unsigned long *) ((i == DLG_VERLAST) ?
+ hFinePrint : hfontDlg),
+ TRUE);
+ } // for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++)
+
+
+ GlobalUnlock(hMem);
+ GlobalFree(hMem);
+ } else {
+ // No version information available.
+ } // if (dwVerInfoSize)
+#endif
+ for (i = DLG_VERFIRST; i <= IDC_LICENSE; i++) {
+ SendMessage(GetDlgItem(hDlg, i), WM_SETFONT,
+ /* (ULONG_PTR) */
+ (unsigned long *) ((i == DLG_VERLAST) ? hFinePrint
+ : hfontDlg), TRUE);
+ } // for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++)
+
+ SendMessage(GetDlgItem(hDlg, IDC_LABEL), WM_SETFONT,
+ (WPARAM) hfontDlg, (LPARAM) TRUE);
+
+ // We are using GetVersion rather then GetVersionEx
+ // because earlier versions of Windows NT and Win32s
+ // didn't include GetVersionEx:
+ dwVersion = GetVersion();
+
+ if (dwVersion < 0x80000000) {
+ // Windows NT
+ wsprintf(szVersion, "Microsoft Windows NT %u.%u (Build: %u)",
+ (DWORD) (LOBYTE(LOWORD(dwVersion))),
+ (DWORD) (HIBYTE(LOWORD(dwVersion))),
+ (DWORD) (HIWORD(dwVersion)));
+ } else if (LOBYTE(LOWORD(dwVersion)) < 4) {
+ // Win32s
+ wsprintf(szVersion, "Microsoft Win32s %u.%u (Build: %u)",
+ (DWORD) (LOBYTE(LOWORD(dwVersion))),
+ (DWORD) (HIBYTE(LOWORD(dwVersion))),
+ (DWORD) (HIWORD(dwVersion) & ~0x8000));
+ } else {
+ // Windows 95
+ wsprintf(szVersion, "Microsoft Windows 95 %u.%u",
+ (DWORD) (LOBYTE(LOWORD(dwVersion))),
+ (DWORD) (HIBYTE(LOWORD(dwVersion))));
+ }
+
+ SetWindowText(GetDlgItem(hDlg, IDC_OSVERSION), szVersion);
+ ShowWindow(hDlg, SW_SHOW);
+ return (TRUE);
+
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) {
+ EndDialog(hDlg, TRUE);
+ DeleteObject(hfontDlg);
+ DeleteObject(hFinePrint);
+ return (TRUE);
+ }
+ break;
+ }
+
+ return FALSE;
+}
+
+void AboutBox(void)
+{
+#ifdef DDRAW_DRIVER
+ if (directX == 1)
+ return;
+#endif
+ DialogBox(hInstance, "AboutBox", hWnd, (DLGPROC) About);
+}
diff --git a/src/ui/ui-drv/win32/about.h b/src/ui/ui-drv/win32/about.h
new file mode 100644
index 0000000..f42c873
--- /dev/null
+++ b/src/ui/ui-drv/win32/about.h
@@ -0,0 +1,20 @@
+#define IDC_STATIC -1
+
+#define DLG_VERFIRST 400
+#define IDC_COMPANY DLG_VERFIRST
+#define IDC_FILEDESC DLG_VERFIRST+1
+#define IDC_PRODVER DLG_VERFIRST+2
+#define IDC_COPYRIGHT DLG_VERFIRST+3
+#define IDC_OSVERSION DLG_VERFIRST+4
+#define IDC_TRADEMARK DLG_VERFIRST+5
+#define DLG_VERLAST DLG_VERFIRST+5
+#define IDC_LICENSE DLG_VERFIRST+6
+
+#define IDC_LABEL IDC_LICENSE+1
+
+
+#define IDS_APP_TITLE 500
+#define IDS_DISPLAYCHANGED 501
+#define IDS_VER_INFO_LANG 502
+#define IDS_VERSION_ERROR 503
+#define IDS_NO_HELP 504
diff --git a/src/ui/ui-drv/win32/about.rc b/src/ui/ui-drv/win32/about.rc
new file mode 100644
index 0000000..cb5d3a4
--- /dev/null
+++ b/src/ui/ui-drv/win32/about.rc
@@ -0,0 +1,19 @@
+ABOUTBOX DIALOG DISCARDABLE 22, 17, 197, 74+4*18
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "About"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,162,2,32,14,WS_GROUP
+ ICON "BIG",IDC_STATIC,3,2,18,20
+ LTEXT "Free Sofware Foundation",IDC_COMPANY,30,2,130,8
+ LTEXT "XaoS - a realtime fractal zoomer",IDC_FILEDESC,30,10,121,8
+ RTEXT "3.5",IDC_PRODVER,136,10,17,8
+ LTEXT "Copyright 1996-2008 Jan Hubicka, Thomas Marsh and others",IDC_COPYRIGHT,30,18,167,8
+ LTEXT "OSVERSION",IDC_OSVERSION,46,34,138,8
+ LTEXT "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. \n\nThis 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. \n\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.",IDC_LICENSE,3,49,192,5*18
+ LTEXT "Crashing on:",IDC_LABEL,4,34,40,8
+ CONTROL "",IDC_STATIC,"Static",SS_BLACKRECT,2,31,194,1
+ CONTROL "",IDC_STATIC,"Static",SS_BLACKRECT,2,44,194,1
+END
+
+
diff --git a/src/ui/ui-drv/win32/dxguid.c b/src/ui/ui-drv/win32/dxguid.c
new file mode 100644
index 0000000..5c6a2ae
--- /dev/null
+++ b/src/ui/ui-drv/win32/dxguid.c
@@ -0,0 +1,1102 @@
+#include <aconfig.h>
+#ifdef DDRAW_DRIVER
+#include <ddraw.h>
+#include <dinput.h>
+
+/* This is a replacement for microsofts dxguid.lib and parts of dinput.lib. */
+
+#undef DEFINE_GUID
+#define DEFINE_GUID(n,a,b,c,d,e,f,g,h,i,j,k) const GUID n = {a,b,c,{d,e,f,g,h,i,j,k}}
+
+/* DirectDraw */
+DEFINE_GUID(CLSID_DirectDraw, 0xD7B70EE0, 0x4340, 0x11CF, 0xB0, 0x63, 0x00,
+ 0x20, 0xAF, 0xC2, 0xCD, 0x35);
+DEFINE_GUID(CLSID_DirectDrawClipper, 0x593817A0, 0x7DB3, 0x11CF, 0xA2,
+ 0xDE, 0x00, 0xAA, 0x00, 0xb9, 0x33, 0x56);
+DEFINE_GUID(IID_IDirectDraw, 0x6C14DB80, 0xA733, 0x11CE, 0xA5, 0x21, 0x00,
+ 0x20, 0xAF, 0x0B, 0xE5, 0x60);
+DEFINE_GUID(IID_IDirectDraw2, 0xB3A6F3E0, 0x2B43, 0x11CF, 0xA2, 0xDE, 0x00,
+ 0xAA, 0x00, 0xB9, 0x33, 0x56);
+DEFINE_GUID(IID_IDirectDrawSurface, 0x6C14DB81, 0xA733, 0x11CE, 0xA5, 0x21,
+ 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
+DEFINE_GUID(IID_IDirectDrawSurface2, 0x57805885, 0x6eec, 0x11cf, 0x94,
+ 0x41, 0xa8, 0x23, 0x03, 0xc1, 0x0e, 0x27);
+DEFINE_GUID(IID_IDirectDrawSurface3, 0xDA044E00, 0x69B2, 0x11D0, 0xA1,
+ 0xD5, 0x00, 0xAA, 0x00, 0xB8, 0xDF, 0xBB);
+
+DEFINE_GUID(IID_IDirectDrawPalette, 0x6C14DB84, 0xA733, 0x11CE, 0xA5, 0x21,
+ 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
+DEFINE_GUID(IID_IDirectDrawClipper, 0x6C14DB85, 0xA733, 0x11CE, 0xA5, 0x21,
+ 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
+DEFINE_GUID(IID_IDirectDrawColorControl, 0x4B9F0EE0, 0x0D7E, 0x11D0, 0x9B,
+ 0x06, 0x00, 0xA0, 0xC9, 0x03, 0xA3, 0xB8);
+
+DEFINE_GUID(IID_IDirectInputA, 0x89521360, 0xAA8A, 0x11CF, 0xBF, 0xC7,
+ 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(IID_IDirectInputW, 0x89521361, 0xAA8A, 0x11CF, 0xBF, 0xC7,
+ 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(IID_IDirectInput2A, 0x5944E662, 0xAA8A, 0x11CF, 0xBF, 0xC7,
+ 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(IID_IDirectInput2W, 0x5944E663, 0xAA8A, 0x11CF, 0xBF, 0xC7,
+ 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
+
+DEFINE_GUID(IID_IDirectInputDeviceA, 0x5944E680, 0xC92E, 0x11CF, 0xBF,
+ 0xC7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(IID_IDirectInputDeviceW, 0x5944E681, 0xC92E, 0x11CF, 0xBF,
+ 0xC7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(IID_IDirectInputDevice2A, 0x5944E682, 0xC92E, 0x11CF, 0xBF,
+ 0xC7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(IID_IDirectInputDevice2W, 0x5944E683, 0xC92E, 0x11CF, 0xBF,
+ 0xC7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(IID_IDirectInputEffect, 0xE7E1F7C0, 0x88D2, 0x11D0, 0x9A, 0xD0,
+ 0x00, 0xA0, 0xC9, 0xA0, 0x6E, 0x35);
+DEFINE_GUID(GUID_XAxis, 0xA36D02E0, 0xC9F3, 0x11CF, 0xBF, 0xC7, 0x44, 0x45,
+ 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(GUID_YAxis, 0xA36D02E1, 0xC9F3, 0x11CF, 0xBF, 0xC7, 0x44, 0x45,
+ 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(GUID_ZAxis, 0xA36D02E2, 0xC9F3, 0x11CF, 0xBF, 0xC7, 0x44, 0x45,
+ 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(GUID_RxAxis, 0xA36D02F4, 0xC9F3, 0x11CF, 0xBF, 0xC7, 0x44,
+ 0x45, 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(GUID_RyAxis, 0xA36D02F5, 0xC9F3, 0x11CF, 0xBF, 0xC7, 0x44,
+ 0x45, 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(GUID_RzAxis, 0xA36D02E3, 0xC9F3, 0x11CF, 0xBF, 0xC7, 0x44,
+ 0x45, 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(GUID_Slider, 0xA36D02E4, 0xC9F3, 0x11CF, 0xBF, 0xC7, 0x44,
+ 0x45, 0x53, 0x54, 0x00, 0x00);
+
+DEFINE_GUID(GUID_Button, 0xA36D02F0, 0xC9F3, 0x11CF, 0xBF, 0xC7, 0x44,
+ 0x45, 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(GUID_Key, 0x55728220, 0xD33C, 0x11CF, 0xBF, 0xC7, 0x44, 0x45,
+ 0x53, 0x54, 0x00, 0x00);
+
+DEFINE_GUID(GUID_POV, 0xA36D02F2, 0xC9F3, 0x11CF, 0xBF, 0xC7, 0x44, 0x45,
+ 0x53, 0x54, 0x00, 0x00);
+
+DEFINE_GUID(GUID_Unknown, 0xA36D02F3, 0xC9F3, 0x11CF, 0xBF, 0xC7, 0x44,
+ 0x45, 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(GUID_SysMouse, 0x6F1D2B60, 0xD5A0, 0x11CF, 0xBF, 0xC7, 0x44,
+ 0x45, 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(GUID_SysKeyboard, 0x6F1D2B61, 0xD5A0, 0x11CF, 0xBF, 0xC7, 0x44,
+ 0x45, 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(GUID_Joystick, 0x6F1D2B70, 0xD5A0, 0x11CF, 0xBF, 0xC7, 0x44,
+ 0x45, 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(GUID_ConstantForce, 0x13541C20, 0x8E33, 0x11D0, 0x9A, 0xD0,
+ 0x00, 0xA0, 0xC9, 0xA0, 0x6E, 0x35);
+DEFINE_GUID(GUID_RampForce, 0x13541C21, 0x8E33, 0x11D0, 0x9A, 0xD0, 0x00,
+ 0xA0, 0xC9, 0xA0, 0x6E, 0x35);
+DEFINE_GUID(GUID_Square, 0x13541C22, 0x8E33, 0x11D0, 0x9A, 0xD0, 0x00,
+ 0xA0, 0xC9, 0xA0, 0x6E, 0x35);
+DEFINE_GUID(GUID_Sine, 0x13541C23, 0x8E33, 0x11D0, 0x9A, 0xD0, 0x00, 0xA0,
+ 0xC9, 0xA0, 0x6E, 0x35);
+DEFINE_GUID(GUID_Triangle, 0x13541C24, 0x8E33, 0x11D0, 0x9A, 0xD0, 0x00,
+ 0xA0, 0xC9, 0xA0, 0x6E, 0x35);
+DEFINE_GUID(GUID_SawtoothUp, 0x13541C25, 0x8E33, 0x11D0, 0x9A, 0xD0, 0x00,
+ 0xA0, 0xC9, 0xA0, 0x6E, 0x35);
+DEFINE_GUID(GUID_SawtoothDown, 0x13541C26, 0x8E33, 0x11D0, 0x9A, 0xD0,
+ 0x00, 0xA0, 0xC9, 0xA0, 0x6E, 0x35);
+DEFINE_GUID(GUID_Spring, 0x13541C27, 0x8E33, 0x11D0, 0x9A, 0xD0, 0x00,
+ 0xA0, 0xC9, 0xA0, 0x6E, 0x35);
+DEFINE_GUID(GUID_Damper, 0x13541C28, 0x8E33, 0x11D0, 0x9A, 0xD0, 0x00,
+ 0xA0, 0xC9, 0xA0, 0x6E, 0x35);
+DEFINE_GUID(GUID_Inertia, 0x13541C29, 0x8E33, 0x11D0, 0x9A, 0xD0, 0x00,
+ 0xA0, 0xC9, 0xA0, 0x6E, 0x35);
+DEFINE_GUID(GUID_Friction, 0x13541C2A, 0x8E33, 0x11D0, 0x9A, 0xD0, 0x00,
+ 0xA0, 0xC9, 0xA0, 0x6E, 0x35);
+DEFINE_GUID(GUID_CustomForce, 0x13541C2B, 0x8E33, 0x11D0, 0x9A, 0xD0, 0x00,
+ 0xA0, 0xC9, 0xA0, 0x6E, 0x35);
+
+
+DIOBJECTDATAFORMAT rgodf_c_dfDIKeyboard[] = {
+ {&GUID_Key, 0, -2147483636, 0}
+ ,
+ {&GUID_Key, 1, -2147483380, 0}
+ ,
+ {&GUID_Key, 2, -2147483124, 0}
+ ,
+ {&GUID_Key, 3, -2147482868, 0}
+ ,
+ {&GUID_Key, 4, -2147482612, 0}
+ ,
+ {&GUID_Key, 5, -2147482356, 0}
+ ,
+ {&GUID_Key, 6, -2147482100, 0}
+ ,
+ {&GUID_Key, 7, -2147481844, 0}
+ ,
+ {&GUID_Key, 8, -2147481588, 0}
+ ,
+ {&GUID_Key, 9, -2147481332, 0}
+ ,
+ {&GUID_Key, 10, -2147481076, 0}
+ ,
+ {&GUID_Key, 11, -2147480820, 0}
+ ,
+ {&GUID_Key, 12, -2147480564, 0}
+ ,
+ {&GUID_Key, 13, -2147480308, 0}
+ ,
+ {&GUID_Key, 14, -2147480052, 0}
+ ,
+ {&GUID_Key, 15, -2147479796, 0}
+ ,
+ {&GUID_Key, 16, -2147479540, 0}
+ ,
+ {&GUID_Key, 17, -2147479284, 0}
+ ,
+ {&GUID_Key, 18, -2147479028, 0}
+ ,
+ {&GUID_Key, 19, -2147478772, 0}
+ ,
+ {&GUID_Key, 20, -2147478516, 0}
+ ,
+ {&GUID_Key, 21, -2147478260, 0}
+ ,
+ {&GUID_Key, 22, -2147478004, 0}
+ ,
+ {&GUID_Key, 23, -2147477748, 0}
+ ,
+ {&GUID_Key, 24, -2147477492, 0}
+ ,
+ {&GUID_Key, 25, -2147477236, 0}
+ ,
+ {&GUID_Key, 26, -2147476980, 0}
+ ,
+ {&GUID_Key, 27, -2147476724, 0}
+ ,
+ {&GUID_Key, 28, -2147476468, 0}
+ ,
+ {&GUID_Key, 29, -2147476212, 0}
+ ,
+ {&GUID_Key, 30, -2147475956, 0}
+ ,
+ {&GUID_Key, 31, -2147475700, 0}
+ ,
+ {&GUID_Key, 32, -2147475444, 0}
+ ,
+ {&GUID_Key, 33, -2147475188, 0}
+ ,
+ {&GUID_Key, 34, -2147474932, 0}
+ ,
+ {&GUID_Key, 35, -2147474676, 0}
+ ,
+ {&GUID_Key, 36, -2147474420, 0}
+ ,
+ {&GUID_Key, 37, -2147474164, 0}
+ ,
+ {&GUID_Key, 38, -2147473908, 0}
+ ,
+ {&GUID_Key, 39, -2147473652, 0}
+ ,
+ {&GUID_Key, 40, -2147473396, 0}
+ ,
+ {&GUID_Key, 41, -2147473140, 0}
+ ,
+ {&GUID_Key, 42, -2147472884, 0}
+ ,
+ {&GUID_Key, 43, -2147472628, 0}
+ ,
+ {&GUID_Key, 44, -2147472372, 0}
+ ,
+ {&GUID_Key, 45, -2147472116, 0}
+ ,
+ {&GUID_Key, 46, -2147471860, 0}
+ ,
+ {&GUID_Key, 47, -2147471604, 0}
+ ,
+ {&GUID_Key, 48, -2147471348, 0}
+ ,
+ {&GUID_Key, 49, -2147471092, 0}
+ ,
+ {&GUID_Key, 50, -2147470836, 0}
+ ,
+ {&GUID_Key, 51, -2147470580, 0}
+ ,
+ {&GUID_Key, 52, -2147470324, 0}
+ ,
+ {&GUID_Key, 53, -2147470068, 0}
+ ,
+ {&GUID_Key, 54, -2147469812, 0}
+ ,
+ {&GUID_Key, 55, -2147469556, 0}
+ ,
+ {&GUID_Key, 56, -2147469300, 0}
+ ,
+ {&GUID_Key, 57, -2147469044, 0}
+ ,
+ {&GUID_Key, 58, -2147468788, 0}
+ ,
+ {&GUID_Key, 59, -2147468532, 0}
+ ,
+ {&GUID_Key, 60, -2147468276, 0}
+ ,
+ {&GUID_Key, 61, -2147468020, 0}
+ ,
+ {&GUID_Key, 62, -2147467764, 0}
+ ,
+ {&GUID_Key, 63, -2147467508, 0}
+ ,
+ {&GUID_Key, 64, -2147467252, 0}
+ ,
+ {&GUID_Key, 65, -2147466996, 0}
+ ,
+ {&GUID_Key, 66, -2147466740, 0}
+ ,
+ {&GUID_Key, 67, -2147466484, 0}
+ ,
+ {&GUID_Key, 68, -2147466228, 0}
+ ,
+ {&GUID_Key, 69, -2147465972, 0}
+ ,
+ {&GUID_Key, 70, -2147465716, 0}
+ ,
+ {&GUID_Key, 71, -2147465460, 0}
+ ,
+ {&GUID_Key, 72, -2147465204, 0}
+ ,
+ {&GUID_Key, 73, -2147464948, 0}
+ ,
+ {&GUID_Key, 74, -2147464692, 0}
+ ,
+ {&GUID_Key, 75, -2147464436, 0}
+ ,
+ {&GUID_Key, 76, -2147464180, 0}
+ ,
+ {&GUID_Key, 77, -2147463924, 0}
+ ,
+ {&GUID_Key, 78, -2147463668, 0}
+ ,
+ {&GUID_Key, 79, -2147463412, 0}
+ ,
+ {&GUID_Key, 80, -2147463156, 0}
+ ,
+ {&GUID_Key, 81, -2147462900, 0}
+ ,
+ {&GUID_Key, 82, -2147462644, 0}
+ ,
+ {&GUID_Key, 83, -2147462388, 0}
+ ,
+ {&GUID_Key, 84, -2147462132, 0}
+ ,
+ {&GUID_Key, 85, -2147461876, 0}
+ ,
+ {&GUID_Key, 86, -2147461620, 0}
+ ,
+ {&GUID_Key, 87, -2147461364, 0}
+ ,
+ {&GUID_Key, 88, -2147461108, 0}
+ ,
+ {&GUID_Key, 89, -2147460852, 0}
+ ,
+ {&GUID_Key, 90, -2147460596, 0}
+ ,
+ {&GUID_Key, 91, -2147460340, 0}
+ ,
+ {&GUID_Key, 92, -2147460084, 0}
+ ,
+ {&GUID_Key, 93, -2147459828, 0}
+ ,
+ {&GUID_Key, 94, -2147459572, 0}
+ ,
+ {&GUID_Key, 95, -2147459316, 0}
+ ,
+ {&GUID_Key, 96, -2147459060, 0}
+ ,
+ {&GUID_Key, 97, -2147458804, 0}
+ ,
+ {&GUID_Key, 98, -2147458548, 0}
+ ,
+ {&GUID_Key, 99, -2147458292, 0}
+ ,
+ {&GUID_Key, 100, -2147458036, 0}
+ ,
+ {&GUID_Key, 101, -2147457780, 0}
+ ,
+ {&GUID_Key, 102, -2147457524, 0}
+ ,
+ {&GUID_Key, 103, -2147457268, 0}
+ ,
+ {&GUID_Key, 104, -2147457012, 0}
+ ,
+ {&GUID_Key, 105, -2147456756, 0}
+ ,
+ {&GUID_Key, 106, -2147456500, 0}
+ ,
+ {&GUID_Key, 107, -2147456244, 0}
+ ,
+ {&GUID_Key, 108, -2147455988, 0}
+ ,
+ {&GUID_Key, 109, -2147455732, 0}
+ ,
+ {&GUID_Key, 110, -2147455476, 0}
+ ,
+ {&GUID_Key, 111, -2147455220, 0}
+ ,
+ {&GUID_Key, 112, -2147454964, 0}
+ ,
+ {&GUID_Key, 113, -2147454708, 0}
+ ,
+ {&GUID_Key, 114, -2147454452, 0}
+ ,
+ {&GUID_Key, 115, -2147454196, 0}
+ ,
+ {&GUID_Key, 116, -2147453940, 0}
+ ,
+ {&GUID_Key, 117, -2147453684, 0}
+ ,
+ {&GUID_Key, 118, -2147453428, 0}
+ ,
+ {&GUID_Key, 119, -2147453172, 0}
+ ,
+ {&GUID_Key, 120, -2147452916, 0}
+ ,
+ {&GUID_Key, 121, -2147452660, 0}
+ ,
+ {&GUID_Key, 122, -2147452404, 0}
+ ,
+ {&GUID_Key, 123, -2147452148, 0}
+ ,
+ {&GUID_Key, 124, -2147451892, 0}
+ ,
+ {&GUID_Key, 125, -2147451636, 0}
+ ,
+ {&GUID_Key, 126, -2147451380, 0}
+ ,
+ {&GUID_Key, 127, -2147451124, 0}
+ ,
+ {&GUID_Key, 128, -2147450868, 0}
+ ,
+ {&GUID_Key, 129, -2147450612, 0}
+ ,
+ {&GUID_Key, 130, -2147450356, 0}
+ ,
+ {&GUID_Key, 131, -2147450100, 0}
+ ,
+ {&GUID_Key, 132, -2147449844, 0}
+ ,
+ {&GUID_Key, 133, -2147449588, 0}
+ ,
+ {&GUID_Key, 134, -2147449332, 0}
+ ,
+ {&GUID_Key, 135, -2147449076, 0}
+ ,
+ {&GUID_Key, 136, -2147448820, 0}
+ ,
+ {&GUID_Key, 137, -2147448564, 0}
+ ,
+ {&GUID_Key, 138, -2147448308, 0}
+ ,
+ {&GUID_Key, 139, -2147448052, 0}
+ ,
+ {&GUID_Key, 140, -2147447796, 0}
+ ,
+ {&GUID_Key, 141, -2147447540, 0}
+ ,
+ {&GUID_Key, 142, -2147447284, 0}
+ ,
+ {&GUID_Key, 143, -2147447028, 0}
+ ,
+ {&GUID_Key, 144, -2147446772, 0}
+ ,
+ {&GUID_Key, 145, -2147446516, 0}
+ ,
+ {&GUID_Key, 146, -2147446260, 0}
+ ,
+ {&GUID_Key, 147, -2147446004, 0}
+ ,
+ {&GUID_Key, 148, -2147445748, 0}
+ ,
+ {&GUID_Key, 149, -2147445492, 0}
+ ,
+ {&GUID_Key, 150, -2147445236, 0}
+ ,
+ {&GUID_Key, 151, -2147444980, 0}
+ ,
+ {&GUID_Key, 152, -2147444724, 0}
+ ,
+ {&GUID_Key, 153, -2147444468, 0}
+ ,
+ {&GUID_Key, 154, -2147444212, 0}
+ ,
+ {&GUID_Key, 155, -2147443956, 0}
+ ,
+ {&GUID_Key, 156, -2147443700, 0}
+ ,
+ {&GUID_Key, 157, -2147443444, 0}
+ ,
+ {&GUID_Key, 158, -2147443188, 0}
+ ,
+ {&GUID_Key, 159, -2147442932, 0}
+ ,
+ {&GUID_Key, 160, -2147442676, 0}
+ ,
+ {&GUID_Key, 161, -2147442420, 0}
+ ,
+ {&GUID_Key, 162, -2147442164, 0}
+ ,
+ {&GUID_Key, 163, -2147441908, 0}
+ ,
+ {&GUID_Key, 164, -2147441652, 0}
+ ,
+ {&GUID_Key, 165, -2147441396, 0}
+ ,
+ {&GUID_Key, 166, -2147441140, 0}
+ ,
+ {&GUID_Key, 167, -2147440884, 0}
+ ,
+ {&GUID_Key, 168, -2147440628, 0}
+ ,
+ {&GUID_Key, 169, -2147440372, 0}
+ ,
+ {&GUID_Key, 170, -2147440116, 0}
+ ,
+ {&GUID_Key, 171, -2147439860, 0}
+ ,
+ {&GUID_Key, 172, -2147439604, 0}
+ ,
+ {&GUID_Key, 173, -2147439348, 0}
+ ,
+ {&GUID_Key, 174, -2147439092, 0}
+ ,
+ {&GUID_Key, 175, -2147438836, 0}
+ ,
+ {&GUID_Key, 176, -2147438580, 0}
+ ,
+ {&GUID_Key, 177, -2147438324, 0}
+ ,
+ {&GUID_Key, 178, -2147438068, 0}
+ ,
+ {&GUID_Key, 179, -2147437812, 0}
+ ,
+ {&GUID_Key, 180, -2147437556, 0}
+ ,
+ {&GUID_Key, 181, -2147437300, 0}
+ ,
+ {&GUID_Key, 182, -2147437044, 0}
+ ,
+ {&GUID_Key, 183, -2147436788, 0}
+ ,
+ {&GUID_Key, 184, -2147436532, 0}
+ ,
+ {&GUID_Key, 185, -2147436276, 0}
+ ,
+ {&GUID_Key, 186, -2147436020, 0}
+ ,
+ {&GUID_Key, 187, -2147435764, 0}
+ ,
+ {&GUID_Key, 188, -2147435508, 0}
+ ,
+ {&GUID_Key, 189, -2147435252, 0}
+ ,
+ {&GUID_Key, 190, -2147434996, 0}
+ ,
+ {&GUID_Key, 191, -2147434740, 0}
+ ,
+ {&GUID_Key, 192, -2147434484, 0}
+ ,
+ {&GUID_Key, 193, -2147434228, 0}
+ ,
+ {&GUID_Key, 194, -2147433972, 0}
+ ,
+ {&GUID_Key, 195, -2147433716, 0}
+ ,
+ {&GUID_Key, 196, -2147433460, 0}
+ ,
+ {&GUID_Key, 197, -2147433204, 0}
+ ,
+ {&GUID_Key, 198, -2147432948, 0}
+ ,
+ {&GUID_Key, 199, -2147432692, 0}
+ ,
+ {&GUID_Key, 200, -2147432436, 0}
+ ,
+ {&GUID_Key, 201, -2147432180, 0}
+ ,
+ {&GUID_Key, 202, -2147431924, 0}
+ ,
+ {&GUID_Key, 203, -2147431668, 0}
+ ,
+ {&GUID_Key, 204, -2147431412, 0}
+ ,
+ {&GUID_Key, 205, -2147431156, 0}
+ ,
+ {&GUID_Key, 206, -2147430900, 0}
+ ,
+ {&GUID_Key, 207, -2147430644, 0}
+ ,
+ {&GUID_Key, 208, -2147430388, 0}
+ ,
+ {&GUID_Key, 209, -2147430132, 0}
+ ,
+ {&GUID_Key, 210, -2147429876, 0}
+ ,
+ {&GUID_Key, 211, -2147429620, 0}
+ ,
+ {&GUID_Key, 212, -2147429364, 0}
+ ,
+ {&GUID_Key, 213, -2147429108, 0}
+ ,
+ {&GUID_Key, 214, -2147428852, 0}
+ ,
+ {&GUID_Key, 215, -2147428596, 0}
+ ,
+ {&GUID_Key, 216, -2147428340, 0}
+ ,
+ {&GUID_Key, 217, -2147428084, 0}
+ ,
+ {&GUID_Key, 218, -2147427828, 0}
+ ,
+ {&GUID_Key, 219, -2147427572, 0}
+ ,
+ {&GUID_Key, 220, -2147427316, 0}
+ ,
+ {&GUID_Key, 221, -2147427060, 0}
+ ,
+ {&GUID_Key, 222, -2147426804, 0}
+ ,
+ {&GUID_Key, 223, -2147426548, 0}
+ ,
+ {&GUID_Key, 224, -2147426292, 0}
+ ,
+ {&GUID_Key, 225, -2147426036, 0}
+ ,
+ {&GUID_Key, 226, -2147425780, 0}
+ ,
+ {&GUID_Key, 227, -2147425524, 0}
+ ,
+ {&GUID_Key, 228, -2147425268, 0}
+ ,
+ {&GUID_Key, 229, -2147425012, 0}
+ ,
+ {&GUID_Key, 230, -2147424756, 0}
+ ,
+ {&GUID_Key, 231, -2147424500, 0}
+ ,
+ {&GUID_Key, 232, -2147424244, 0}
+ ,
+ {&GUID_Key, 233, -2147423988, 0}
+ ,
+ {&GUID_Key, 234, -2147423732, 0}
+ ,
+ {&GUID_Key, 235, -2147423476, 0}
+ ,
+ {&GUID_Key, 236, -2147423220, 0}
+ ,
+ {&GUID_Key, 237, -2147422964, 0}
+ ,
+ {&GUID_Key, 238, -2147422708, 0}
+ ,
+ {&GUID_Key, 239, -2147422452, 0}
+ ,
+ {&GUID_Key, 240, -2147422196, 0}
+ ,
+ {&GUID_Key, 241, -2147421940, 0}
+ ,
+ {&GUID_Key, 242, -2147421684, 0}
+ ,
+ {&GUID_Key, 243, -2147421428, 0}
+ ,
+ {&GUID_Key, 244, -2147421172, 0}
+ ,
+ {&GUID_Key, 245, -2147420916, 0}
+ ,
+ {&GUID_Key, 246, -2147420660, 0}
+ ,
+ {&GUID_Key, 247, -2147420404, 0}
+ ,
+ {&GUID_Key, 248, -2147420148, 0}
+ ,
+ {&GUID_Key, 249, -2147419892, 0}
+ ,
+ {&GUID_Key, 250, -2147419636, 0}
+ ,
+ {&GUID_Key, 251, -2147419380, 0}
+ ,
+ {&GUID_Key, 252, -2147419124, 0}
+ ,
+ {&GUID_Key, 253, -2147418868, 0}
+ ,
+ {&GUID_Key, 254, -2147418612, 0}
+ ,
+ {&GUID_Key, 255, -2147418356, 0}
+};
+
+const DIDATAFORMAT c_dfDIKeyboard = { 24,
+ 16,
+ 2,
+ 256,
+ 256,
+ rgodf_c_dfDIKeyboard
+};
+
+DIOBJECTDATAFORMAT rgodf_c_dfDIMouse[] = {
+ {&GUID_XAxis, 0, 16776963, 0}
+ ,
+ {&GUID_YAxis, 4, 16776963, 0}
+ ,
+ {&GUID_ZAxis, 8, -2130706685, 0}
+ ,
+ {0, 12, 16776972, 0}
+ ,
+ {0, 13, 16776972, 0}
+ ,
+ {0, 14, -2130706676, 0}
+ ,
+ {0, 15, -2130706676, 0}
+};
+
+const DIDATAFORMAT c_dfDIMouse = { 24,
+ 16,
+ 2,
+ 16,
+ 7,
+ rgodf_c_dfDIMouse
+};
+
+DIOBJECTDATAFORMAT rgodf_c_dfDIJoystick[] = {
+ {&GUID_XAxis, 0, -2130706685, 256}
+ ,
+ {&GUID_YAxis, 4, -2130706685, 256}
+ ,
+ {&GUID_ZAxis, 8, -2130706685, 256}
+ ,
+ {&GUID_RxAxis, 12, -2130706685, 256}
+ ,
+ {&GUID_RyAxis, 16, -2130706685, 256}
+ ,
+ {&GUID_RzAxis, 20, -2130706685, 256}
+ ,
+ {&GUID_Slider, 24, -2130706685, 256}
+ ,
+ {&GUID_Slider, 28, -2130706685, 256}
+ ,
+ {&GUID_POV, 32, -2130706672, 0}
+ ,
+ {&GUID_POV, 36, -2130706672, 0}
+ ,
+ {&GUID_POV, 40, -2130706672, 0}
+ ,
+ {&GUID_POV, 44, -2130706672, 0}
+ ,
+ {0, 48, -2130706676, 0}
+ ,
+ {0, 49, -2130706676, 0}
+ ,
+ {0, 50, -2130706676, 0}
+ ,
+ {0, 51, -2130706676, 0}
+ ,
+ {0, 52, -2130706676, 0}
+ ,
+ {0, 53, -2130706676, 0}
+ ,
+ {0, 54, -2130706676, 0}
+ ,
+ {0, 55, -2130706676, 0}
+ ,
+ {0, 56, -2130706676, 0}
+ ,
+ {0, 57, -2130706676, 0}
+ ,
+ {0, 58, -2130706676, 0}
+ ,
+ {0, 59, -2130706676, 0}
+ ,
+ {0, 60, -2130706676, 0}
+ ,
+ {0, 61, -2130706676, 0}
+ ,
+ {0, 62, -2130706676, 0}
+ ,
+ {0, 63, -2130706676, 0}
+ ,
+ {0, 64, -2130706676, 0}
+ ,
+ {0, 65, -2130706676, 0}
+ ,
+ {0, 66, -2130706676, 0}
+ ,
+ {0, 67, -2130706676, 0}
+ ,
+ {0, 68, -2130706676, 0}
+ ,
+ {0, 69, -2130706676, 0}
+ ,
+ {0, 70, -2130706676, 0}
+ ,
+ {0, 71, -2130706676, 0}
+ ,
+ {0, 72, -2130706676, 0}
+ ,
+ {0, 73, -2130706676, 0}
+ ,
+ {0, 74, -2130706676, 0}
+ ,
+ {0, 75, -2130706676, 0}
+ ,
+ {0, 76, -2130706676, 0}
+ ,
+ {0, 77, -2130706676, 0}
+ ,
+ {0, 78, -2130706676, 0}
+ ,
+ {0, 79, -2130706676, 0}
+};
+
+const DIDATAFORMAT c_dfDIJoystick = { 24,
+ 16,
+ 1,
+ 80,
+ 44,
+ rgodf_c_dfDIJoystick
+};
+
+DIOBJECTDATAFORMAT rgodf_c_dfDIJoystick2[] = {
+ {&GUID_XAxis, 0, -2130706685, 256}
+ ,
+ {&GUID_YAxis, 4, -2130706685, 256}
+ ,
+ {&GUID_ZAxis, 8, -2130706685, 256}
+ ,
+ {&GUID_RxAxis, 12, -2130706685, 256}
+ ,
+ {&GUID_RyAxis, 16, -2130706685, 256}
+ ,
+ {&GUID_RzAxis, 20, -2130706685, 256}
+ ,
+ {&GUID_Slider, 24, -2130706685, 256}
+ ,
+ {&GUID_Slider, 28, -2130706685, 256}
+ ,
+ {&GUID_POV, 32, -2130706672, 0}
+ ,
+ {&GUID_POV, 36, -2130706672, 0}
+ ,
+ {&GUID_POV, 40, -2130706672, 0}
+ ,
+ {&GUID_POV, 44, -2130706672, 0}
+ ,
+ {0, 48, -2130706676, 0}
+ ,
+ {0, 49, -2130706676, 0}
+ ,
+ {0, 50, -2130706676, 0}
+ ,
+ {0, 51, -2130706676, 0}
+ ,
+ {0, 52, -2130706676, 0}
+ ,
+ {0, 53, -2130706676, 0}
+ ,
+ {0, 54, -2130706676, 0}
+ ,
+ {0, 55, -2130706676, 0}
+ ,
+ {0, 56, -2130706676, 0}
+ ,
+ {0, 57, -2130706676, 0}
+ ,
+ {0, 58, -2130706676, 0}
+ ,
+ {0, 59, -2130706676, 0}
+ ,
+ {0, 60, -2130706676, 0}
+ ,
+ {0, 61, -2130706676, 0}
+ ,
+ {0, 62, -2130706676, 0}
+ ,
+ {0, 63, -2130706676, 0}
+ ,
+ {0, 64, -2130706676, 0}
+ ,
+ {0, 65, -2130706676, 0}
+ ,
+ {0, 66, -2130706676, 0}
+ ,
+ {0, 67, -2130706676, 0}
+ ,
+ {0, 68, -2130706676, 0}
+ ,
+ {0, 69, -2130706676, 0}
+ ,
+ {0, 70, -2130706676, 0}
+ ,
+ {0, 71, -2130706676, 0}
+ ,
+ {0, 72, -2130706676, 0}
+ ,
+ {0, 73, -2130706676, 0}
+ ,
+ {0, 74, -2130706676, 0}
+ ,
+ {0, 75, -2130706676, 0}
+ ,
+ {0, 76, -2130706676, 0}
+ ,
+ {0, 77, -2130706676, 0}
+ ,
+ {0, 78, -2130706676, 0}
+ ,
+ {0, 79, -2130706676, 0}
+ ,
+ {0, 80, -2130706676, 0}
+ ,
+ {0, 81, -2130706676, 0}
+ ,
+ {0, 82, -2130706676, 0}
+ ,
+ {0, 83, -2130706676, 0}
+ ,
+ {0, 84, -2130706676, 0}
+ ,
+ {0, 85, -2130706676, 0}
+ ,
+ {0, 86, -2130706676, 0}
+ ,
+ {0, 87, -2130706676, 0}
+ ,
+ {0, 88, -2130706676, 0}
+ ,
+ {0, 89, -2130706676, 0}
+ ,
+ {0, 90, -2130706676, 0}
+ ,
+ {0, 91, -2130706676, 0}
+ ,
+ {0, 92, -2130706676, 0}
+ ,
+ {0, 93, -2130706676, 0}
+ ,
+ {0, 94, -2130706676, 0}
+ ,
+ {0, 95, -2130706676, 0}
+ ,
+ {0, 96, -2130706676, 0}
+ ,
+ {0, 97, -2130706676, 0}
+ ,
+ {0, 98, -2130706676, 0}
+ ,
+ {0, 99, -2130706676, 0}
+ ,
+ {0, 100, -2130706676, 0}
+ ,
+ {0, 101, -2130706676, 0}
+ ,
+ {0, 102, -2130706676, 0}
+ ,
+ {0, 103, -2130706676, 0}
+ ,
+ {0, 104, -2130706676, 0}
+ ,
+ {0, 105, -2130706676, 0}
+ ,
+ {0, 106, -2130706676, 0}
+ ,
+ {0, 107, -2130706676, 0}
+ ,
+ {0, 108, -2130706676, 0}
+ ,
+ {0, 109, -2130706676, 0}
+ ,
+ {0, 110, -2130706676, 0}
+ ,
+ {0, 111, -2130706676, 0}
+ ,
+ {0, 112, -2130706676, 0}
+ ,
+ {0, 113, -2130706676, 0}
+ ,
+ {0, 114, -2130706676, 0}
+ ,
+ {0, 115, -2130706676, 0}
+ ,
+ {0, 116, -2130706676, 0}
+ ,
+ {0, 117, -2130706676, 0}
+ ,
+ {0, 118, -2130706676, 0}
+ ,
+ {0, 119, -2130706676, 0}
+ ,
+ {0, 120, -2130706676, 0}
+ ,
+ {0, 121, -2130706676, 0}
+ ,
+ {0, 122, -2130706676, 0}
+ ,
+ {0, 123, -2130706676, 0}
+ ,
+ {0, 124, -2130706676, 0}
+ ,
+ {0, 125, -2130706676, 0}
+ ,
+ {0, 126, -2130706676, 0}
+ ,
+ {0, 127, -2130706676, 0}
+ ,
+ {0, 128, -2130706676, 0}
+ ,
+ {0, 129, -2130706676, 0}
+ ,
+ {0, 130, -2130706676, 0}
+ ,
+ {0, 131, -2130706676, 0}
+ ,
+ {0, 132, -2130706676, 0}
+ ,
+ {0, 133, -2130706676, 0}
+ ,
+ {0, 134, -2130706676, 0}
+ ,
+ {0, 135, -2130706676, 0}
+ ,
+ {0, 136, -2130706676, 0}
+ ,
+ {0, 137, -2130706676, 0}
+ ,
+ {0, 138, -2130706676, 0}
+ ,
+ {0, 139, -2130706676, 0}
+ ,
+ {0, 140, -2130706676, 0}
+ ,
+ {0, 141, -2130706676, 0}
+ ,
+ {0, 142, -2130706676, 0}
+ ,
+ {0, 143, -2130706676, 0}
+ ,
+ {0, 144, -2130706676, 0}
+ ,
+ {0, 145, -2130706676, 0}
+ ,
+ {0, 146, -2130706676, 0}
+ ,
+ {0, 147, -2130706676, 0}
+ ,
+ {0, 148, -2130706676, 0}
+ ,
+ {0, 149, -2130706676, 0}
+ ,
+ {0, 150, -2130706676, 0}
+ ,
+ {0, 151, -2130706676, 0}
+ ,
+ {0, 152, -2130706676, 0}
+ ,
+ {0, 153, -2130706676, 0}
+ ,
+ {0, 154, -2130706676, 0}
+ ,
+ {0, 155, -2130706676, 0}
+ ,
+ {0, 156, -2130706676, 0}
+ ,
+ {0, 157, -2130706676, 0}
+ ,
+ {0, 158, -2130706676, 0}
+ ,
+ {0, 159, -2130706676, 0}
+ ,
+ {0, 160, -2130706676, 0}
+ ,
+ {0, 161, -2130706676, 0}
+ ,
+ {0, 162, -2130706676, 0}
+ ,
+ {0, 163, -2130706676, 0}
+ ,
+ {0, 164, -2130706676, 0}
+ ,
+ {0, 165, -2130706676, 0}
+ ,
+ {0, 166, -2130706676, 0}
+ ,
+ {0, 167, -2130706676, 0}
+ ,
+ {0, 168, -2130706676, 0}
+ ,
+ {0, 169, -2130706676, 0}
+ ,
+ {0, 170, -2130706676, 0}
+ ,
+ {0, 171, -2130706676, 0}
+ ,
+ {0, 172, -2130706676, 0}
+ ,
+ {0, 173, -2130706676, 0}
+ ,
+ {0, 174, -2130706676, 0}
+ ,
+ {0, 175, -2130706676, 0}
+ ,
+ {&GUID_XAxis, 176, -2130706685, 512}
+ ,
+ {&GUID_YAxis, 180, -2130706685, 512}
+ ,
+ {&GUID_ZAxis, 184, -2130706685, 512}
+ ,
+ {&GUID_RxAxis, 188, -2130706685, 512}
+ ,
+ {&GUID_RyAxis, 192, -2130706685, 512}
+ ,
+ {&GUID_RzAxis, 196, -2130706685, 512}
+ ,
+ {&GUID_Slider, 24, -2130706685, 512}
+ ,
+ {&GUID_Slider, 28, -2130706685, 512}
+ ,
+ {&GUID_XAxis, 208, -2130706685, 768}
+ ,
+ {&GUID_YAxis, 212, -2130706685, 768}
+ ,
+ {&GUID_ZAxis, 216, -2130706685, 768}
+ ,
+ {&GUID_RxAxis, 220, -2130706685, 768}
+ ,
+ {&GUID_RyAxis, 224, -2130706685, 768}
+ ,
+ {&GUID_RzAxis, 228, -2130706685, 768}
+ ,
+ {&GUID_Slider, 24, -2130706685, 768}
+ ,
+ {&GUID_Slider, 28, -2130706685, 768}
+ ,
+ {&GUID_XAxis, 240, -2130706685, 1024}
+ ,
+ {&GUID_YAxis, 244, -2130706685, 1024}
+ ,
+ {&GUID_ZAxis, 248, -2130706685, 1024}
+ ,
+ {&GUID_RxAxis, 252, -2130706685, 1024}
+ ,
+ {&GUID_RyAxis, 256, -2130706685, 1024}
+ ,
+ {&GUID_RzAxis, 260, -2130706685, 1024}
+ ,
+ {&GUID_Slider, 24, -2130706685, 1024}
+ ,
+ {&GUID_Slider, 28, -2130706685, 1024}
+};
+
+const DIDATAFORMAT c_dfDIJoystick2 = { 24,
+ 16,
+ 1,
+ 272,
+ 164,
+ rgodf_c_dfDIJoystick2
+};
+
+
+/* DirectSound */
+
+// Direct Sound Component GUID {47D4D946-62E8-11cf-93BC-444553540000}
+DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc,
+ 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
+
+// DirectSound Capture Component GUID {B0210780-89CD-11d0-AF08-00A0C925CD16}
+DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf,
+ 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
+#endif
diff --git a/src/ui/ui-drv/win32/installer/XaoS Installer.nsi b/src/ui/ui-drv/win32/installer/XaoS Installer.nsi
new file mode 100644
index 0000000..cfd49ba
--- /dev/null
+++ b/src/ui/ui-drv/win32/installer/XaoS Installer.nsi
@@ -0,0 +1,138 @@
+;--------------------------------
+;Include Modern UI
+
+ !include "MUI2.nsh"
+
+;--------------------------------
+;General
+
+ ;Name and file
+ Name "XaoS"
+ OutFile "XaoS Installer.exe"
+
+ ;Default installation folder
+ InstallDir "$PROGRAMFILES\XaoS"
+
+ ;Get installation folder from registry if available
+ InstallDirRegKey HKLM "Software\XaoS" ""
+
+ ;Request application privileges for Windows Vista
+ RequestExecutionLevel admin
+
+;--------------------------------
+;Variables
+
+ Var StartMenuFolder
+
+;--------------------------------
+;Interface Settings
+
+ !define MUI_HEADERIMAGE
+ !define MUI_HEADERIMAGE_BITMAP "XaoS.bmp"
+ !define MUI_ABORTWARNING
+
+;--------------------------------
+;Language Selection Dialog Settings
+
+ ;Remember the installer language
+ !define MUI_LANGDLL_REGISTRY_ROOT "HKLM"
+ !define MUI_LANGDLL_REGISTRY_KEY "Software\XaoS"
+ !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
+
+;--------------------------------
+;Pages
+
+ !insertmacro MUI_PAGE_WELCOME
+ !insertmacro MUI_PAGE_LICENSE "..\..\..\..\..\copying"
+ !insertmacro MUI_PAGE_DIRECTORY
+
+ ;Start Menu Folder Page Configuration
+ !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
+ !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\XaoS"
+ !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
+
+ !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
+
+ !insertmacro MUI_PAGE_INSTFILES
+ !insertmacro MUI_PAGE_FINISH
+
+ !insertmacro MUI_UNPAGE_WELCOME
+ !insertmacro MUI_UNPAGE_CONFIRM
+ !insertmacro MUI_UNPAGE_INSTFILES
+ !insertmacro MUI_UNPAGE_FINISH
+
+;--------------------------------
+;Languages
+
+ !insertmacro MUI_LANGUAGE "English"
+ !insertmacro MUI_LANGUAGE "French"
+ !insertmacro MUI_LANGUAGE "German"
+ !insertmacro MUI_LANGUAGE "Spanish"
+ !insertmacro MUI_LANGUAGE "Italian"
+ !insertmacro MUI_LANGUAGE "Czech"
+ !insertmacro MUI_LANGUAGE "Hungarian"
+ !insertmacro MUI_LANGUAGE "Romanian"
+
+;--------------------------------
+;Reserve Files
+
+ ;If you are using solid compression, files that are required before
+ ;the actual installation should be stored first in the data block,
+ ;because this will make your installer start faster.
+
+ !insertmacro MUI_RESERVEFILE_LANGDLL
+
+;--------------------------------
+;Installer Sections
+
+Section "XaoS" XaoS
+
+ SetOutPath "$INSTDIR"
+
+ File /r "XaoS\*"
+
+ ;Store installation folder
+ WriteRegStr HKLM "Software\XaoS" "" $INSTDIR
+
+ ;Create uninstaller
+ WriteUninstaller "$INSTDIR\Uninstall.exe"
+
+ !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
+
+ ;Create shortcuts
+ CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
+ CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
+
+ SetOutPath "$INSTDIR\bin"
+
+ CreateShortCut "$SMPROGRAMS\$StartMenuFolder\XaoS.lnk" "$INSTDIR\bin\xaos.exe"
+
+ !insertmacro MUI_STARTMENU_WRITE_END
+
+SectionEnd
+
+;--------------------------------
+;Uninstaller Section
+
+Section "Uninstall"
+
+ RMDir /r /REBOOTOK "$INSTDIR"
+
+ !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
+
+ Delete "$SMPROGRAMS\$StartMenuFolder\XaoS.lnk"
+ Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk"
+ RMDir "$SMPROGRAMS\$StartMenuFolder"
+
+ DeleteRegKey /ifempty HKLM "Software\XaoS"
+
+SectionEnd
+
+;--------------------------------
+;Uninstaller Functions
+
+Function un.onInit
+
+ !insertmacro MUI_UNGETLANGUAGE
+
+FunctionEnd \ No newline at end of file
diff --git a/src/ui/ui-drv/win32/installer/XaoS.bmp b/src/ui/ui-drv/win32/installer/XaoS.bmp
new file mode 100644
index 0000000..47b4b82
--- /dev/null
+++ b/src/ui/ui-drv/win32/installer/XaoS.bmp
Binary files differ
diff --git a/src/ui/ui-drv/win32/resource.h b/src/ui/ui-drv/win32/resource.h
new file mode 100644
index 0000000..596a030
--- /dev/null
+++ b/src/ui/ui-drv/win32/resource.h
@@ -0,0 +1,3 @@
+/*#define IDI_XAOS_ICON 128
+ #define IDI_SMALL_ICON 129 */
+/*#define IDOK 0 */
diff --git a/src/ui/ui-drv/win32/small.ico b/src/ui/ui-drv/win32/small.ico
new file mode 100644
index 0000000..8481328
--- /dev/null
+++ b/src/ui/ui-drv/win32/small.ico
Binary files differ
diff --git a/src/ui/ui-drv/win32/ui_win32.c b/src/ui/ui-drv/win32/ui_win32.c
new file mode 100644
index 0000000..fff810c
--- /dev/null
+++ b/src/ui/ui-drv/win32/ui_win32.c
@@ -0,0 +1,1886 @@
+/* This file actually implements three drivers (win32 and DirectX
+ windowed/fullscreen) drivers, because they have a lot of common stuff. */
+#include <config.h>
+#ifdef WIN32_DRIVER
+#define _WIN32_WINNT 0x0501 /* Enable access to Windows XP APIs */
+#include <windows.h>
+#ifdef HTML_HELP
+#include <htmlhelp.h>
+#endif
+#ifdef DDRAW_DRIVER
+#include <ddraw.h>
+#endif
+#include <malloc.h>
+#include <string.h>
+#include <stdio.h>
+#include <xmenu.h>
+#include <xerror.h>
+#include "ui.h"
+#include "ui_win32.h"
+#include "resource.h"
+#include "xio.h"
+#include <cursor.h>
+
+#define MAXRESOLUTIONS 256
+#define DXWIDTH 320
+#define DXHEIGHT 200
+#define DXBPP 8
+#define WWIDTH (480+4*48)
+#define WHEIGHT (360+4*36)
+
+#define DXFULLSCREEN 1
+#define DXWINDOWED 2
+
+#define MOUSEWIDTH 16
+#define MOUSEHEIGHT 16
+
+#ifdef HAVE_GETTEXT
+
+#include <libintl.h>
+
+#include <locale.h>
+
+#else
+
+#define gettext(STRING) STRING
+
+#endif
+
+
+
+HINSTANCE hInstance;
+HWND hWnd;
+CONST char *helptopic = "main";
+
+struct ui_driver win32_driver;
+struct ui_driver dxw_driver, dxf_driver;
+
+static int initialized = 0, needredraw = 0;
+
+static char *helpname = NULL;
+
+/* This variables are used by drivers in initializetion */
+static int windowpos;
+static CONST char *size = "520x430";
+static CONST char *dxsize = "320x200x8";
+
+
+/* Display information */
+static int displayX, displayY, bitDepth;
+static int lineSize;
+static int fontWidth, fontHeight;
+static HPALETTE hPalette = NULL;
+static char *buffer1;
+static char *buffer2;
+static int currentbuff = 0;
+static BITMAPINFO *bmp = NULL;
+
+/* Mouse */
+static int mouseX, mouseY, mouseButtons = 0;
+static int captured = 0, tmpcaptured = 0;
+
+/* Keyboard state */
+static int altPressed;
+static int arrowsPressed;
+
+/* WindowProc comunication variables */
+static BOOL closeFlag;
+static int resized = 0;
+static int active = 1;
+
+/* Curent class information */
+static HICON hIcon;
+static HICON hIconSm;
+static HFONT hFont = NULL;
+
+/* DirectX stuff */
+#ifdef DDRAW_DRIVER
+int directX = 0;
+static LPDIRECTDRAWPALETTE dxPalette = NULL;
+static LPDIRECTDRAW lpDD = NULL;
+static LPDIRECTDRAW2 lpDD2 = NULL;
+static LPDIRECTDRAWSURFACE lpSurfaces[2], BackSurface[2];
+static DDSURFACEDESC surface[2];
+static CONST char *mousepointer = mouse_pointer_data;
+static char *storeddata = NULL;
+static HMODULE hModule = NULL;
+static int oldmouseX, oldmouseY;
+#else
+#define directX 0
+#endif
+static PUCHAR backpalette[256][4];
+static HMODULE hModule2;
+static RECT rcWindow;
+static RECT rcViewport;
+static RECT rcScreen;
+static int MyHelpMsg;
+/*clipboard*/
+static WORD clipboard_format;
+
+/* forward declarations */
+#ifdef DDRAW_DRIVER
+static void DeInitDD(void);
+static void PaintDD(void);
+static void UpdateMouseDD(void);
+#endif
+static void Paint(HDC hDC);
+static void CalculateBITMAPINFO(void);
+static void win32_display(void);
+static void DeInitWindow(void);
+
+#ifdef DDRAW_DRIVER
+ /* FIXME: In windowed mode we don't support 8bpp yet! */
+#define DXSUPPORTEDDEPTH(fullscreen,depth) \
+ (!(depth < 8 || (!fullscreen && depth != 16 && depth !=24 && depth != 32)))
+
+static char *store(char *data, int depth, int lpitch, int width,
+ int height, int xpos, int ypos)
+{
+ int d = depth / 8;
+ char *store = malloc(d * MOUSEWIDTH * MOUSEHEIGHT);
+ int y;
+ if (xpos + MOUSEWIDTH > width)
+ xpos = width - MOUSEWIDTH;
+ if (ypos + MOUSEHEIGHT > height)
+ ypos = height - MOUSEHEIGHT;
+ if (xpos < 0)
+ xpos = 0;
+ if (ypos < 0)
+ ypos = 0;
+ for (y = 0; y < MOUSEHEIGHT; y++)
+ memcpy(store + d * MOUSEWIDTH * y,
+ data + xpos * d + (ypos + y) * lpitch, MOUSEWIDTH * d);
+ return store;
+}
+
+static void
+restore(char *data, CONST char *store, int depth, int lpitch, int width,
+ int height, int xpos, int ypos)
+{
+ int y;
+ int d = depth / 8;
+ if (xpos + MOUSEWIDTH > width)
+ xpos = width - MOUSEWIDTH;
+ if (ypos + MOUSEHEIGHT > height)
+ ypos = height - MOUSEHEIGHT;
+ if (xpos < 0)
+ xpos = 0;
+ if (ypos < 0)
+ ypos = 0;
+ for (y = 0; y < MOUSEHEIGHT; y++)
+ memcpy(data + xpos * d + (ypos + y) * lpitch,
+ store + d * MOUSEWIDTH * y, MOUSEWIDTH * d);
+}
+
+static void
+drawmouse(char *data, CONST char *mouse, int depth, int lpitch, int width,
+ int height, int xpos, int ypos)
+{
+ int x, y, z, c;
+ int d = depth / 8;
+ for (y = 0; y < MOUSEWIDTH; y++)
+ for (x = 0; x < MOUSEWIDTH; x++)
+ if (mouse[x + MOUSEWIDTH * y] && x + xpos > 0
+ && (x + xpos) < width && y + ypos > 0
+ && y + ypos < height) {
+ c = mouse[x + MOUSEWIDTH * y] == 2 ? (d ==
+ 1 ? 1 : 255) : 0;
+ for (z = 0; z < d; z++)
+ data[z + d * (x + xpos) + (y + ypos) * lpitch] = c;
+ }
+}
+#endif
+static void getdimens(float *width, float *height)
+{
+ HDC hDC = GetDC(hWnd);
+ *width = GetDeviceCaps(hDC, HORZSIZE) / 10.0;
+ *height = GetDeviceCaps(hDC, VERTSIZE) / 10.0;
+ if (*width > 100 || *width < 1)
+ *width = 29.0;
+ if (*height > 100 || *height < 1)
+ *height = 21.0;
+ ReleaseDC(hWnd, hDC);
+}
+
+static void getres(float *width, float *height)
+{
+ HDC hDC = GetDC(hWnd);
+ *width = 2.54 / GetDeviceCaps(hDC, LOGPIXELSX);
+ *height = 2.54 / GetDeviceCaps(hDC, LOGPIXELSY);
+ ReleaseDC(hWnd, hDC);
+}
+
+/******************************************************************************
+ Win32 driver helper routines
+ */
+
+static LRESULT CALLBACK WindowProc(HWND hWnd, // handle to window
+ UINT uMsg, // message identifier
+ WPARAM wParam, // first message parameter
+ LPARAM lParam // second message parameter
+ )
+{
+ PAINTSTRUCT paintStruct;
+ HDC hDC;
+ if (uMsg == (unsigned int) MyHelpMsg) {
+ win32_help(NULL, helptopic);
+ return 0;
+ }
+ switch (uMsg) {
+ case WM_COMMAND:
+ win32_pressed(wParam);
+ break;
+ case WM_SIZE:
+ // resize window
+ if (directX == DXFULLSCREEN)
+ return 0;
+ if (LOWORD(lParam) == 0 && HIWORD(lParam) == 0) {
+ active = 0;
+ break;
+ } /*Minimized window */
+ active = 1;
+ if (displayX != LOWORD(lParam) || displayY != HIWORD(lParam))
+ resized = 1;
+ displayX = LOWORD(lParam);
+ displayY = HIWORD(lParam);
+ break;
+ case WM_DISPLAYCHANGE:
+ if (directX == DXFULLSCREEN)
+ return 0;
+ mouseButtons = 0;
+ resized = 1;
+ hDC = GetDC(hWnd);
+ bitDepth = GetDeviceCaps(hDC, BITSPIXEL);
+ ReleaseDC(hWnd, hDC);
+ break;
+ case WM_CLOSE:
+ // close window
+ closeFlag = TRUE;
+ return 0;
+ case WM_MOUSEMOVE:
+ case WM_LBUTTONUP:
+ case WM_LBUTTONDOWN:
+ case WM_RBUTTONUP:
+ case WM_RBUTTONDOWN:
+ case WM_MBUTTONUP:
+ case WM_MBUTTONDOWN:
+ // handle mouse move and mouse buttons
+ mouseButtons = wParam;
+ if (!captured) {
+ if (mouseButtons && !tmpcaptured)
+ SetCapture(hWnd), tmpcaptured = 1;
+ if (!mouseButtons && tmpcaptured)
+ ReleaseCapture(), tmpcaptured = 0;
+ }
+ mouseX = (short) LOWORD(lParam);
+ mouseY = (short) HIWORD(lParam);
+#ifdef DDRAW_DRIVER
+ if (directX == DXFULLSCREEN) {
+ POINT p;
+ GetCursorPos(&p);
+ mouseX = p.x;
+ mouseY = p.y;
+ UpdateMouseDD();
+ }
+#endif
+ break;
+ case WM_PAINT:
+ // redraw screen
+ if (directX == DXFULLSCREEN)
+ return 0;
+ needredraw = 1;
+ if (GetUpdateRect(hWnd, NULL, FALSE)) {
+ HDC hDC = BeginPaint(hWnd, &paintStruct);
+ if (hDC) {
+#ifdef DDRAW_DRIVER
+ if (directX)
+ PaintDD();
+ else
+#endif
+ Paint(hDC);
+ EndPaint(hWnd, &paintStruct);
+ }
+ }
+ return 0;
+ case WM_QUERYNEWPALETTE:
+ // windows calls this when window is reactivated.
+ if (directX == DXFULLSCREEN)
+ return 0;
+ hDC = GetDC(hWnd);
+#ifdef DDRAW_DRIVER
+ if (directX == DXWINDOWED) {
+ if (dxPalette) {
+ IDirectDrawSurface_SetPalette(lpSurfaces[0], dxPalette);
+ IDirectDrawPalette_SetEntries(dxPalette, 0, 0, 255,
+ (PALETTEENTRY *)
+ backpalette);
+ }
+ } else
+#endif
+ {
+ SelectPalette(hDC, hPalette, FALSE);
+ RealizePalette(hDC);
+ }
+ ReleaseDC(hWnd, hDC);
+ return TRUE;
+ case WM_MOVE:
+ if (directX != DXFULLSCREEN) {
+ GetWindowRect(hWnd, &rcWindow);
+ GetClientRect(hWnd, &rcViewport);
+ GetClientRect(hWnd, &rcScreen);
+ ClientToScreen(hWnd, (POINT *) & rcScreen.left);
+ ClientToScreen(hWnd, (POINT *) & rcScreen.right);
+ }
+ break;
+ case WM_SETCURSOR:
+ if (directX == DXFULLSCREEN) {
+ SetCursor(NULL);
+ return TRUE;
+ }
+ break;
+#ifdef DDRAW_DRIVER
+ case WM_ACTIVATEAPP:
+ {
+ int oldactive = active;
+ mouseButtons = 0;
+ if (directX == DXFULLSCREEN) {
+ needredraw = 1;
+ active = (wParam == WA_ACTIVE)
+ || (wParam == WA_CLICKACTIVE) /*(BOOL) wParam */ ;
+ PaintDD();
+ if (!oldactive && active && captured)
+ SetCursor(NULL), SetCapture(hWnd);
+ if (oldactive && !active && captured)
+ ReleaseCapture();
+ return 0L;
+ }
+ }
+#endif
+ break;
+ }
+ return DefWindowProc(hWnd, uMsg, wParam, lParam);
+}
+
+/*Create Xaos Window. It is either used for normal window mode or
+ as basis for DirectX */
+static int InitWindow(void)
+{
+ int width = CW_USEDEFAULT, height = CW_USEDEFAULT;
+ int xpos = CW_USEDEFAULT, ypos = CW_USEDEFAULT;
+ LOGPALETTE *logPalette;
+ WNDCLASS wndClass;
+ LOGFONT logFont;
+ ATOM a;
+ HDC hDC;
+ TEXTMETRIC textMetric;
+ HGLOBAL oldFont;
+ RECT r;
+ closeFlag = FALSE;
+
+ altPressed = arrowsPressed = 0;
+ if (hIcon == NULL)
+ hIcon = LoadIcon(hInstance, "BIG");
+ mouseButtons = 0;
+ mouseX = 0;
+ mouseY = 0;
+ {
+ static FARPROC proc;
+ if (hModule2 == NULL) {
+ hModule2 = LoadLibrary("user32");
+ proc = GetProcAddress(hModule2, "RegisterClassExA");
+ }
+ if (proc != NULL) {
+ WNDCLASSEX ExWndClass;
+ memset(&ExWndClass, 0, sizeof(WNDCLASSEX));
+ if (hIconSm == NULL)
+ hIconSm = LoadIcon(hInstance, "SMALL");
+ ExWndClass.hIconSm = hIconSm;
+ memset(&ExWndClass, 0, sizeof(WNDCLASSEX));
+ ExWndClass.style = CS_OWNDC;
+ ExWndClass.cbSize = sizeof(WNDCLASSEX);
+ ExWndClass.lpfnWndProc = WindowProc;
+ ExWndClass.hInstance = hInstance;
+ ExWndClass.hIcon = hIcon;
+ ExWndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
+ ExWndClass.lpszClassName = "XaosWindow";
+ ExWndClass.hbrBackground =
+ (HBRUSH) GetStockObject(BLACK_BRUSH);
+ a = (ATOM) proc(&ExWndClass);
+ } else {
+ memset(&wndClass, 0, sizeof(WNDCLASS));
+ wndClass.style = CS_OWNDC;
+ wndClass.lpfnWndProc = WindowProc;
+ wndClass.hInstance = hInstance;
+ wndClass.hIcon = hIcon;
+ wndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wndClass.lpszClassName = "XaosWindow";
+ wndClass.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
+ a = RegisterClass(&wndClass);
+ }
+ }
+ if (!a) {
+ x_error("Unable to create windows class");
+ return 0;
+ }
+
+ /* First time use defaut size, otherwise use saved sizes */
+ if (sscanf(size, "%ix%ix", &width, &height) != 2) {
+ width = WWIDTH;
+ height = WHEIGHT;
+ }
+ if (windowpos) {
+ xpos = rcWindow.left;
+ ypos = rcWindow.top;
+ width = rcWindow.right - rcWindow.left;
+ height = rcWindow.bottom - rcWindow.top;
+ }
+
+ /* create main window */
+ if (directX == DXFULLSCREEN)
+ hWnd =
+ CreateWindowEx(WS_EX_TOPMOST, "XaoSWindow", "XaoS", WS_POPUP,
+ 0, 0, GetSystemMetrics(SM_CXSCREEN),
+ GetSystemMetrics(SM_CYSCREEN), NULL, NULL,
+ hInstance, NULL);
+ else
+
+ hWnd = CreateWindowEx(WS_EX_CLIENTEDGE, "XaoSWindow", "XaoS",
+ WS_OVERLAPPEDWINDOW | WS_EX_LEFTSCROLLBAR,
+ xpos, ypos, width, height, NULL, NULL,
+ hInstance, NULL);
+
+ if (!hWnd) {
+ x_error("Unable to create app window");
+ return 0;
+ }
+
+ clipboard_format = RegisterClipboardFormat("image/x-xaos.position");
+
+
+ /* create font */
+ memset(&logFont, 0, sizeof(LOGFONT));
+ hDC = CreateDC("DISPLAY", NULL, NULL, NULL);
+ logFont.lfHeight = -MulDiv(12, GetDeviceCaps(hDC, LOGPIXELSY), 72);
+ logFont.lfWeight = FW_NORMAL;
+ logFont.lfPitchAndFamily = FIXED_PITCH;
+ strcpy(logFont.lfFaceName, "Courier");
+
+ hFont = CreateFontIndirect(&logFont);
+ oldFont = SelectObject(hDC, hFont);
+ GetTextMetrics(hDC, &textMetric);
+ SelectObject(hDC, oldFont);
+ DeleteDC(hDC);
+
+ fontHeight = textMetric.tmHeight;
+ fontWidth = textMetric.tmAveCharWidth;
+
+ ShowWindow(hWnd, SW_NORMAL);
+
+ GetClientRect(hWnd, &r);
+ displayX = r.right;
+ displayY = r.bottom;
+
+ /* create palette */
+ CalculateBITMAPINFO(); /* calculate BITMAPINFO structure */
+ logPalette = malloc(sizeof(LOGPALETTE) + 4 * 256);
+ logPalette->palVersion = 0x300;
+ logPalette->palNumEntries = 256;
+ memcpy(logPalette->palPalEntry, bmp->bmiColors, 4 * 256);
+ hPalette = CreatePalette(logPalette);
+ free(logPalette);
+
+ /* select and realize palette */
+ hDC = GetDC(hWnd);
+ SelectPalette(hDC, hPalette, FALSE);
+ RealizePalette(hDC);
+ ReleaseDC(hWnd, hDC);
+
+ // increase priority of XaoS
+ SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
+
+ MyHelpMsg = RegisterWindowMessage(HELPMSGSTRING);
+
+ return 1;
+}
+
+static void DeInitWindow()
+{
+ if (tmpcaptured)
+ ReleaseCapture();
+ if (directX != DXFULLSCREEN)
+ windowpos = 1, GetWindowRect(hWnd, &rcWindow);
+ /* normalize priority */
+ SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL);
+ if (helpname)
+ WinHelp(hWnd, helpname, HELP_QUIT, 0), free(helpname), helpname =
+ NULL;
+
+ /* destroy windows and other objects */
+ DeleteObject(hFont);
+ DestroyWindow(hWnd);
+ UnregisterClass("XaosWindow", hInstance);
+ if (bmp) {
+ free(bmp);
+ bmp = NULL;
+ }
+ if (hModule2 != NULL)
+ FreeLibrary(hModule2);
+ hModule2 = NULL;
+ win32_uninitializewindows();
+}
+
+/* Display buffer to screen */
+static void Paint(HDC hDC)
+{
+ if (!initialized || !buffer1)
+ return;
+ StretchDIBits(hDC, 0, 0, displayX, displayY,
+ 0, 0, displayX, displayY,
+ (currentbuff == 0) ? buffer1 : buffer2,
+ bmp, DIB_RGB_COLORS, SRCCOPY);
+ needredraw = 0;
+}
+
+
+
+static int Init(void)
+{
+ HDC hDC;
+ buffer1 = buffer2 = NULL;
+
+ // get bit depth
+ hDC = CreateDC("DISPLAY", NULL, NULL, NULL);
+ bitDepth = GetDeviceCaps(hDC, BITSPIXEL);
+ if (bitDepth < 8)
+ bitDepth = 16;
+ if (bitDepth < 10)
+ bitDepth = 8;
+ if (bitDepth >= 10 && bitDepth < 20)
+ bitDepth = 16;
+ if (bitDepth >= 20 && bitDepth < 28)
+ bitDepth = 24;
+ if (bitDepth >= 32 && bitDepth < 32)
+ bitDepth = 32;
+ DeleteDC(hDC);
+
+ // create windows and other objects
+ if (!InitWindow())
+ return 0;
+
+ CalculateBITMAPINFO(); /* calculate BITMAPINFO structure */
+
+
+ return 1;
+}
+
+static void getmouse(int *mx, int *my, int *mb)
+{
+ *mb = 0;
+ if (mouseButtons & MK_LBUTTON)
+ *mb |= 256;
+ if (mouseButtons & MK_MBUTTON)
+ *mb |= 512;
+ if (mouseButtons & MK_RBUTTON)
+ *mb |= 1024;
+ *mx = mouseX;
+ *my = mouseY;
+}
+
+static void
+Processevents(int wait, int *mx, int *my, int *mb, int *k, int *c)
+{
+ MSG msg;
+ int r;
+ if (wait) {
+ // wait for message if in wait mode
+ r = GetMessage(&msg, hWnd, 0, 0);
+ wait = 0;
+ } else {
+ // don't wait for message
+ r = PeekMessage(&msg, hWnd, 0, 0, PM_REMOVE);
+ }
+#if 0
+ if (needredraw) {
+ if (directX)
+ PaintDD();
+ else
+ win32_display();
+ }
+#endif
+ if (r > 0) {
+ if (msg.message == WM_CHAR) {
+ // ascii char
+ *c = msg.wParam;
+ }
+ if (msg.message == WM_KEYUP)
+ switch (msg.wParam) {
+ case VK_MENU:
+ altPressed = 0;
+ break;
+ case VK_UP:
+ arrowsPressed &= ~4;
+ break;
+ case VK_DOWN:
+ arrowsPressed &= ~8;
+ break;
+ case VK_LEFT:
+ arrowsPressed &= ~1;
+ break;
+ case VK_RIGHT:
+ arrowsPressed &= ~2;
+ break;
+ }
+ if (msg.message == WM_KEYDOWN) {
+ // any key
+ switch (msg.wParam) {
+ case VK_MENU:
+ /*x_message("Alt"); */
+ altPressed = 1;
+ break;
+ case VK_UP:
+ *c = UIKEY_UP;
+ arrowsPressed |= 4;
+ break;
+ case VK_DOWN:
+ *c = UIKEY_DOWN;
+ arrowsPressed |= 8;
+ break;
+ case VK_LEFT:
+ *c = UIKEY_LEFT;
+ arrowsPressed |= 1;
+ break;
+ case VK_RIGHT:
+ *c = UIKEY_RIGHT;
+ arrowsPressed |= 2;
+ break;
+ case VK_ESCAPE:
+ *c = UIKEY_ESC;
+ break;
+ case VK_BACK:
+ *c = UIKEY_BACKSPACE;
+ break;
+ case VK_TAB:
+ *c = UIKEY_TAB;
+ break;
+ case VK_HOME:
+ *c = UIKEY_HOME;
+ break;
+ case VK_END:
+ *c = UIKEY_END;
+ break;
+ case VK_PRIOR:
+ *c = UIKEY_PGUP;
+ break;
+ case VK_NEXT:
+ *c = UIKEY_PGDOWN;
+ break;
+#ifdef DDRAW_DRIVER
+ case VK_RETURN:
+ /*x_message("Enter %i",altPressed); */
+ if (altPressed) {
+ HDC hDC;
+ CONST char *cmd;
+ CONST menuitem *item;
+ if (directX == DXFULLSCREEN) {
+ int depth;
+ cmd = "dX-windowed";
+ hDC = CreateDC("DISPLAY", NULL, NULL, NULL);
+ depth = GetDeviceCaps(hDC, BITSPIXEL);
+ DeleteDC(hDC);
+ if (!DXSUPPORTEDDEPTH(0, depth))
+ cmd = "win32";
+ } else {
+ cmd = "dX-fullscreen";
+ }
+ item = menu_findcommand(cmd);
+ ui_menuactivate(item, NULL);
+ }
+ break;
+#endif
+ }
+ }
+ // forward messages to window
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ getmouse(mx, my, mb); // get mouse position
+
+ *k = arrowsPressed;
+
+ if (closeFlag)
+ *c = -2; // force quit if so requested
+
+}
+
+// calculate BITMAPINFO structure. It is used to copy bitmaps
+static void CalculateBITMAPINFO()
+{
+ int i;
+ if (!bmp)
+ bmp = (BITMAPINFO *) malloc(sizeof(BITMAPINFOHEADER) + 4 * 256);
+
+ memset(bmp, 0, sizeof(BITMAPINFOHEADER));
+ bmp->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ bmp->bmiHeader.biWidth = displayX;
+ bmp->bmiHeader.biHeight = -displayY;
+ bmp->bmiHeader.biPlanes = 1;
+ bmp->bmiHeader.biBitCount = bitDepth;
+
+ // create default palette
+ for (i = 0; i < 256; i++) {
+ bmp->bmiColors[i].rgbRed = i;
+ bmp->bmiColors[i].rgbGreen = i;
+ bmp->bmiColors[i].rgbBlue = i;
+ }
+}
+
+#ifdef DDRAW_DRIVER
+
+/**************************************************************************************
+ DirectDraw driver helper routines
+ */
+static char *resstr[MAXRESOLUTIONS];
+static struct resolutions {
+ int width, height;
+} ressize[MAXRESOLUTIONS];
+static int nresolutions;
+/* callback for DirectX resolutions */
+static HRESULT WINAPI
+EnumModesCallback(LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext)
+{
+ if (nresolutions < MAXRESOLUTIONS)
+ if (lpDDSurfaceDesc->ddpfPixelFormat.u1.dwRGBBitCount == 8 ||
+ lpDDSurfaceDesc->ddpfPixelFormat.u1.dwRGBBitCount == 16 ||
+ lpDDSurfaceDesc->ddpfPixelFormat.u1.dwRGBBitCount == 24 ||
+ lpDDSurfaceDesc->ddpfPixelFormat.u1.dwRGBBitCount == 32) {
+ int i;
+ char s[20];
+ for (i = 0; i < nresolutions; i++)
+ if ((int) ressize[i].width ==
+ (int) lpDDSurfaceDesc->dwWidth
+ && (int) ressize[i].height ==
+ (int) lpDDSurfaceDesc->dwHeight)
+ return DDENUMRET_OK;
+ ressize[nresolutions].width = lpDDSurfaceDesc->dwWidth;
+ ressize[nresolutions].height = lpDDSurfaceDesc->dwHeight;
+ sprintf(s, "%ix%i", lpDDSurfaceDesc->dwWidth,
+ lpDDSurfaceDesc->dwHeight);
+ resstr[nresolutions] = strdup(s);
+ nresolutions++;
+ }
+ return DDENUMRET_OK;
+}
+
+typedef HRESULT WINAPI(*ddrawcreateptr) (GUID FAR * lpGUID,
+ LPDIRECTDRAW FAR * lplpDD,
+ IUnknown FAR * pUnkOuter);
+static ddrawcreateptr DirectDrawCreatePtr;
+
+static int ResizeDD(int fullscreen)
+{
+ HRESULT ddrval;
+ DDSURFACEDESC ddsd;
+ /*DDCAPS2 ddscaps; */
+ LPDIRECTDRAWCLIPPER pClipper;
+ int dxwidth;
+ int dxheight;
+ int dxbpp;
+
+ // free DirectX objects
+ if (lpSurfaces[0])
+ IDirectDrawSurface_Release(lpSurfaces[0]);
+ lpSurfaces[0] = NULL;
+ if (dxPalette)
+ IDirectDrawPalette_Release(dxPalette);
+ dxPalette = NULL;
+ /* Set cooperative level */
+ ddrval = IDirectDraw2_SetCooperativeLevel(lpDD2, hWnd,
+ fullscreen
+ ? (DDSCL_FULLSCREEN |
+ DDSCL_EXCLUSIVE |
+ DDSCL_ALLOWREBOOT)
+ : DDSCL_NORMAL);
+ if (ddrval != DD_OK) {
+ DeInitDD();
+ x_error("Failed to set cooperative level");
+ return 0;
+ }
+
+ if (fullscreen) {
+ if (sscanf(dxsize, "%ix%ix%i", &dxwidth, &dxheight, &dxbpp) != 3) {
+ dxwidth = DXWIDTH;
+ dxheight = DXHEIGHT;
+ dxbpp = DXBPP;
+ }
+ displayX = dxwidth;
+ displayY = dxheight;
+ bitDepth = dxbpp;
+ if (bitDepth < 10)
+ bitDepth = 8;
+ if (bitDepth >= 10 && bitDepth < 20)
+ bitDepth = 16;
+ if (bitDepth >= 20 && bitDepth < 28)
+ bitDepth = 24;
+ if (bitDepth >= 32 && bitDepth < 32)
+ bitDepth = 32;
+
+ /* set resolution and bit depth */
+ ddrval =
+ IDirectDraw2_SetDisplayMode(lpDD2, displayX, displayY,
+ bitDepth, 0, 0);
+ if (ddrval != DD_OK) {
+ /* The display mode cannot be changed.
+ The mode is either not supported or
+ another application has exclusive mode.
+
+ Try 320x200x256 and 640x480x256 modes before giving up */
+ displayX = 320;
+ displayY = 200;
+ bitDepth = 8;
+ ddrval =
+ IDirectDraw2_SetDisplayMode(lpDD2, displayX, displayY,
+ bitDepth, 0, 0);
+ if (ddrval != DD_OK) {
+ displayY = 240;
+ if (ddrval != DD_OK) {
+ displayX = 640;
+ displayY = 480;
+ ddrval =
+ IDirectDraw2_SetDisplayMode(lpDD2, displayX,
+ displayY, bitDepth, 0,
+ 0);
+ if (ddrval != DD_OK) {
+ /* Bad luck... give up. */
+ DeInitDD();
+ return 0;
+ }
+ }
+ }
+ }
+ SetRect(&rcViewport, 0, 0, displayX, displayY);
+ rcScreen = rcViewport;
+ } else {
+ /* Get the dimensions of the viewport and screen bounds */
+ GetClientRect(hWnd, &rcViewport);
+ GetClientRect(hWnd, &rcScreen);
+ ClientToScreen(hWnd, (POINT *) & rcScreen.left);
+ ClientToScreen(hWnd, (POINT *) & rcScreen.right);
+ /*bitDepth = GetDeviceCaps (hDC, BITSPIXEL); */
+
+ /* Create clipper object for window */
+ ddrval = IDirectDraw_CreateClipper(lpDD, 0, &pClipper, NULL);
+ if (ddrval != DD_OK) {
+ DeInitDD();
+ x_error("Failed to create clipper object");
+ return 0;
+ }
+ /* Asociate it */
+ IDirectDrawClipper_SetHWnd(pClipper, 0, hWnd);
+ }
+ /* Create the primary surface with one back buffer */
+ CalculateBITMAPINFO(); // calculate BITMAPINFO structure
+
+ memset(&ddsd, 0, sizeof(ddsd));
+ ddsd.dwSize = sizeof(ddsd);
+ ddsd.dwFlags = DDSD_CAPS;
+ ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
+
+ ddrval = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpSurfaces[0], NULL);
+ if (ddrval != DD_OK) {
+ DeInitDD();
+ x_error("Failed to create flipping surface");
+ return 0;
+ }
+
+ if (!fullscreen) {
+ IDirectDrawSurface_SetClipper(lpSurfaces[0], pClipper);
+ IDirectDrawClipper_Release(pClipper);
+ if (IDirectDrawSurface_GetSurfaceDesc(lpSurfaces[0], &ddsd) !=
+ DD_OK) {
+ DeInitDD();
+ x_error("Failed to get pixel format");
+ return 0;
+ }
+ bitDepth = ddsd.ddpfPixelFormat.u1.dwRGBBitCount;
+ }
+
+ if (bitDepth == 8) {
+ /* create palette */
+ ddrval =
+ IDirectDraw_CreatePalette(lpDD, DDPCAPS_8BIT,
+ (LPPALETTEENTRY) bmp->bmiColors,
+ &dxPalette, NULL);
+ if (ddrval != DD_OK) {
+ DeInitDD();
+ x_error("Failed to create palette");
+ return 0;
+ }
+
+ /* set palette */
+ IDirectDrawSurface_SetPalette(lpSurfaces[0], dxPalette);
+ }
+ if (fullscreen)
+ SetCursor(NULL);
+ needredraw = 1;
+ return 1;
+
+}
+
+/* init DirectX */
+static int InitDD(int fullscreen)
+{
+ HRESULT ddrval;
+ HDC hDC;
+ directX = fullscreen ? DXFULLSCREEN : DXWINDOWED;
+
+ if (!hModule)
+ hModule = LoadLibrary("ddraw");
+ if (!hModule) {
+ /*x_error ("Unable to load DirectX (ddraw.dll)"); */
+ return 0;
+ }
+ /* DirectDraw don't support 16 color modes. Don't even try to initialize
+ it then. Also avoid unsupported bit depths in the windowed driver */
+ hDC = CreateDC("DISPLAY", NULL, NULL, NULL);
+ bitDepth = GetDeviceCaps(hDC, BITSPIXEL);
+ DeleteDC(hDC);
+
+ if (!DXSUPPORTEDDEPTH(fullscreen, bitDepth))
+ return 0;
+
+
+ DirectDrawCreatePtr =
+ (ddrawcreateptr) GetProcAddress(hModule, "DirectDrawCreate");
+ if (!DirectDrawCreatePtr) {
+ x_error
+ ("Unable to get hook DirectDrawCreate in ddraw.dll. Check your DirectX installation");
+ return 0;
+ }
+
+ lpDD = NULL;
+ lpDD2 = NULL;
+ lpSurfaces[0] = NULL;
+ lpSurfaces[1] = NULL;
+ buffer1 = buffer2 = NULL;
+
+ bitDepth = 8;
+
+ InitWindow();
+ UpdateWindow(hWnd);
+ SetFocus(hWnd);
+
+
+ /* contact DirectX */
+ ddrval = DirectDrawCreatePtr(NULL, &lpDD, NULL);
+ if (ddrval != DD_OK) {
+ DeInitDD();
+ x_error("Failed to create DirectDraw object");
+ return 0;
+ }
+
+ /* get IDirectDraw2 interface */
+ ddrval =
+ IDirectDraw_QueryInterface(lpDD, &IID_IDirectDraw2,
+ (LPVOID *) & lpDD2);
+ if (ddrval != DD_OK) {
+ DeInitDD();
+ x_error("Failed to get DirectDraw2 object");
+ return 0;
+ }
+ /* enumerate modes */
+#ifdef DDRAW_DRIVER
+ if (!nresolutions && directX == DXFULLSCREEN)
+ IDirectDraw2_EnumDisplayModes(lpDD2, 0, NULL, NULL,
+ EnumModesCallback);
+#endif
+
+
+ if (!ResizeDD(fullscreen))
+ return 0;
+ if (fullscreen) {
+ SetCapture(hWnd); // make sure no other windows get mouse messages
+
+ captured = 1;
+ }
+
+ return 1;
+}
+
+/* uninitialize DirectX */
+static void DeInitDD(void)
+{
+ if (captured)
+ ReleaseCapture(), captured = 0; // free mouse
+
+ // free DirectX objects
+ if (lpSurfaces[0])
+ IDirectDrawSurface_Release(lpSurfaces[0]);
+ lpSurfaces[0] = NULL;
+ if (BackSurface[0])
+ IDirectDrawSurface_Release(BackSurface[0]);
+ BackSurface[0] = NULL;
+ if (BackSurface[1])
+ IDirectDrawSurface_Release(BackSurface[1]);
+ BackSurface[1] = NULL;
+ if (dxPalette)
+ IDirectDrawPalette_Release(dxPalette);
+ dxPalette = NULL;
+ if (lpDD2)
+ IDirectDraw2_Release(lpDD2);
+ lpDD2 = NULL;
+ if (lpDD)
+ IDirectDraw_Release(lpDD);
+ lpDD = NULL;
+ DeInitWindow();
+ if (hModule != NULL)
+ FreeLibrary(hModule), hModule = NULL;
+ hWnd = NULL;
+ directX = 0;
+}
+
+static LRESULT CALLBACK WindowProc(HWND hwnd, // handle to window
+ UINT uMsg, // message identifier
+ WPARAM wParam, // first message parameter
+ LPARAM lParam // second message parameter
+ );
+static void UpdateMouseDD()
+{
+ DDSURFACEDESC m_surface;
+ PUCHAR dst;
+ DWORD ddrval;
+ memset(&m_surface, 0, sizeof(DDSURFACEDESC));
+ m_surface.dwSize = sizeof(DDSURFACEDESC);
+ ddrval = IDirectDrawSurface_Lock(lpSurfaces[0], NULL, &m_surface,
+ DDLOCK_WAIT, NULL);
+ if (ddrval != DD_OK) {
+ return;
+ }
+
+ dst = (PUCHAR) m_surface.lpSurface;
+ if (storeddata) {
+ restore(dst, storeddata, bitDepth, m_surface.u1.lPitch, displayX,
+ displayY, oldmouseX, oldmouseY);
+ free(storeddata);
+ }
+ storeddata =
+ store(dst, bitDepth, m_surface.u1.lPitch, displayX, displayY,
+ mouseX, mouseY);
+ drawmouse(dst, mousepointer, bitDepth, m_surface.u1.lPitch, displayX,
+ displayY, mouseX, mouseY);
+ oldmouseX = mouseX;
+ oldmouseY = mouseY;
+ IDirectDrawSurface_Unlock(lpSurfaces[0], m_surface.lpSurface);
+}
+
+/* Display buffer */
+static void PaintDD()
+{
+ DWORD ddrval;
+ if (!IsWindowVisible(hWnd) || !active || !initialized
+ || !BackSurface[0])
+ return;
+ IDirectDrawSurface_Unlock(BackSurface[0], surface[0].lpSurface);
+ IDirectDrawSurface_Unlock(BackSurface[1], surface[1].lpSurface);
+ if (directX == DXFULLSCREEN) {
+ if (storeddata)
+ free(storeddata), storeddata = NULL;
+ storeddata =
+ store(currentbuff ? buffer2 : buffer1, bitDepth, lineSize,
+ displayX, displayY, mouseX, mouseY);
+ drawmouse(currentbuff ? buffer2 : buffer1, mousepointer, bitDepth,
+ lineSize, displayX, displayY, mouseX, mouseY);
+ ddrval =
+ IDirectDrawSurface_BltFast(lpSurfaces[0], 0, 0,
+ BackSurface[currentbuff], &rcScreen,
+ FALSE);
+ restore(currentbuff ? buffer2 : buffer1, storeddata, bitDepth,
+ lineSize, displayX, displayY, mouseX, mouseY);
+ oldmouseX = mouseX;
+ oldmouseY = mouseY;
+ } else {
+ ddrval = IDirectDrawSurface_Blt(lpSurfaces[0], &rcScreen,
+ BackSurface[currentbuff],
+ &rcViewport, DDBLT_WAIT, NULL);
+ }
+ if (ddrval != DD_OK) {
+ if ((int) ddrval == (int) DDERR_SURFACELOST) {
+ IDirectDrawSurface_Restore(lpSurfaces[0]);
+ IDirectDrawSurface_Restore(BackSurface[0]);
+ IDirectDrawSurface_Restore(BackSurface[1]);
+ ddrval = IDirectDrawSurface_Blt(lpSurfaces[0], &rcScreen,
+ BackSurface[currentbuff],
+ &rcViewport, DDBLT_WAIT, NULL);
+ //if (ddrval == DDERR_SURFACELOST) resized=1; /*We've lost our fractal*/
+ }
+ }
+ ddrval = IDirectDrawSurface_Lock(BackSurface[0], NULL, &surface[0],
+ DDLOCK_WAIT, NULL);
+ ddrval = IDirectDrawSurface_Lock(BackSurface[1], NULL, &surface[1],
+ DDLOCK_WAIT, NULL);
+ if (buffer1 != (char *) surface[0].lpSurface ||
+ buffer2 != (char *) surface[1].lpSurface) {
+ DeInitDD();
+ x_fatalerror
+ ("Unexpected event - buffers moved! Please contact authors!");
+ }
+ needredraw = 0;
+
+}
+#endif
+
+/**************************************************************************************
+ Drivers implementation
+ */
+
+
+
+static void flip_buffers(void)
+{
+ currentbuff ^= 1;
+}
+
+
+static void processevents(int wait, int *mx, int *my, int *mb, int *k)
+{
+ int c = -1;
+ *mb = 0;
+ *k = 0;
+ Processevents(wait, mx, my, mb, k, &c);
+ if (c > -1) {
+ ui_key(c);
+ }
+
+ if (c == -2)
+ ui_quit(); // -2 signals program exit
+
+ if (resized) {
+ ui_resize(); // tell Xaos to resize
+
+ }
+}
+
+static void print(int x, int y, CONST char *text)
+{
+ HDC hDC;
+ static char current[256];
+ char s[256];
+#ifdef DDRAW_DRIVER
+ if (directX == DXFULLSCREEN) {
+ HGLOBAL oldFont;
+ if (IDirectDrawSurface_GetDC(lpSurfaces[0], &hDC) != DD_OK)
+ return;
+ SetTextColor(hDC, 0xffffff);
+ SetBkColor(hDC, 0x000000);
+ oldFont = SelectObject(hDC, hFont);
+ ExtTextOut(hDC, x, y, 0, NULL, text, strlen(text), NULL);
+ SelectObject(hDC, oldFont);
+ IDirectDrawSurface_ReleaseDC(lpSurfaces[0], hDC);
+ return;
+ }
+#endif
+ if (!text[0])
+ strcpy(s, "XaoS");
+ else
+ sprintf(s, "XaoS - %s", text);
+ if (strcmp(current, s))
+ strcpy(current, s), SetWindowText(hWnd, s);
+}
+
+static void mousetype(int type)
+{
+ char *cursor;
+ switch (type) {
+ default:
+ case 0:
+ cursor = IDC_ARROW;
+ break;
+ case 1:
+ cursor = IDC_WAIT;
+ break;
+ case 2:
+ cursor = IDC_NO;
+ break;
+ }
+ SetCursor(LoadCursor(NULL, cursor));
+}
+
+static void set_palette(ui_palette pal1, int start, int end)
+{
+ PUCHAR pal = (PUCHAR) pal1;
+ HDC hDC;
+ int i;
+ // store new palette entries locally
+ memcpy(backpalette + 4 * start, pal, (end - start) * 4);
+ for (i = start; i <= end; i++) {
+ bmp->bmiColors[i].rgbRed = *(pal + 4 * (i - start) + 0);
+ bmp->bmiColors[i].rgbGreen = *(pal + 4 * (i - start) + 1);
+ bmp->bmiColors[i].rgbBlue = *(pal + 4 * (i - start) + 2);
+ bmp->bmiColors[i].rgbReserved = 0;
+ }
+ // update window/screen
+#ifdef DDRAW_DRIVER
+ if (directX) {
+ IDirectDrawPalette_SetEntries(dxPalette, 0, start, end - start + 1,
+ (PALETTEENTRY *) pal);
+ } else
+#endif
+ {
+ SetPaletteEntries(hPalette, start, end - start + 1,
+ (PALETTEENTRY *) pal);
+ hDC = GetDC(hWnd);
+ UnrealizeObject(hPalette);
+ RealizePalette(hDC);
+ ReleaseDC(hWnd, hDC);
+ win32_display();
+ }
+}
+
+static void win32_copy(struct uih_context *uih)
+{
+ char *c = ui_getpos();
+ HANDLE hData = GlobalAlloc(GMEM_DDESHARE, strlen(c) + 1);
+ char *data;
+ if (!hData) {
+ x_error("Out of memory");
+ free(c);
+ return;
+ }
+ if (!(data = GlobalLock(hData))) {
+ x_error("Out of memory");
+ free(c);
+ return;
+ }
+ memcpy(hData, c, strlen(c) + 1);
+ GlobalUnlock(hData);
+ if (OpenClipboard(hWnd)) {
+ EmptyClipboard();
+ SetClipboardData(clipboard_format, hData);
+ }
+ free(c);
+}
+
+static void win32_paste(void)
+{
+ if (OpenClipboard(hWnd)) {
+ HANDLE hClipData;
+ char *text;
+ if (!(hClipData = GetClipboardData(clipboard_format))) {
+ CloseClipboard();
+ return;
+ }
+ if (!(text = GlobalLock(hClipData))) {
+ x_error("Out of memory");
+ CloseClipboard();
+ }
+ ui_loadstr(strdup(text));
+ GlobalUnlock(hClipData);
+ CloseClipboard();
+ }
+}
+
+#define MAX_MENUITEMS_I18N 7
+static menuitem menuitems_i18n[MAX_MENUITEMS_I18N];
+
+int uiw_no_menuitems_i18n, uiw_no_cutpasteitems_i18n;
+
+static menuitem *cutpasteitems;
+static void add_cutpasteitems()
+{
+ // General method (not needed currently):
+ int no_menuitems_i18n = uiw_no_menuitems_i18n; /* This variable must be local. */
+ MENUSEPARATOR_I("edit");
+ MENUNOP_I("edit", NULL, gettext("Copy"), "copy", 0, win32_copy);
+ MENUNOP_I("edit", NULL, gettext("Paste"), "paste", 0, win32_paste);
+ MENUNOP_I("misc", NULL, "Generate .dlg files", "genresources", 0,
+ win32_genresources);
+ MENUSEPARATOR_I("helpmenu");
+ MENUNOP_I("helpmenu", NULL, gettext("About"), "about", 0, AboutBox);
+ no_menuitems_i18n -= uiw_no_menuitems_i18n;
+ cutpasteitems = &(menuitems_i18n[uiw_no_menuitems_i18n]);
+ uiw_no_cutpasteitems_i18n = no_menuitems_i18n;
+ menu_add(cutpasteitems, uiw_no_cutpasteitems_i18n);
+ uiw_no_menuitems_i18n += no_menuitems_i18n;
+
+}
+
+
+static int win32_init(void)
+{
+ int r;
+
+#ifdef DDRAW_DRIVER
+ directX = 0;
+#endif
+ r = Init();
+ if (!r)
+ return r;
+ win32_driver.textwidth = fontWidth;
+ win32_driver.textheight = fontHeight;
+ getres(&win32_driver.width, &win32_driver.height);
+ win32_createrootmenu();
+ uiw_no_menuitems_i18n = 0;
+ add_cutpasteitems();
+ return r;
+}
+
+static void win32_uninitialize(void)
+{
+ DeInitWindow();
+ menu_delete(cutpasteitems, uiw_no_cutpasteitems_i18n);
+}
+
+static void win32_getsize(int *width, int *height)
+{
+ resized = 0;
+ *width = displayX;
+ *height = displayY;
+ switch (bitDepth) {
+ case 8:
+ win32_driver.imagetype = UI_C256;
+ break;
+ case 16:
+ /* Windows seems to always use 15bpp mode */
+ win32_driver.imagetype = UI_TRUECOLOR16;
+ win32_driver.rmask = 31 * 32 * 32;
+ win32_driver.gmask = 31 * 32;
+ win32_driver.bmask = 31;
+ break;
+ case 24:
+ win32_driver.imagetype = UI_TRUECOLOR24;
+ win32_driver.rmask = 0xff0000;
+ win32_driver.gmask = 0x00ff00;
+ win32_driver.bmask = 0x0000ff;
+ break;
+ case 32:
+ win32_driver.imagetype = UI_TRUECOLOR;
+ win32_driver.rmask = 0xff0000;
+ win32_driver.gmask = 0x00ff00;
+ win32_driver.bmask = 0x0000ff;
+ break;
+ }
+ CalculateBITMAPINFO();
+}
+
+
+
+static void win32_display()
+{
+ HDC hDC = GetDC(hWnd);
+ if (IsWindowVisible(hWnd))
+ Paint(hDC);
+ ReleaseDC(hWnd, hDC);
+}
+
+static int win32_alloc_buffers(char **b1, char **b2)
+{
+ currentbuff = 0;
+ // calculate DWORD aligned line length
+ lineSize = displayX * ((bitDepth + 7) / 8);
+ lineSize += 3 - ((lineSize - 1) & 3);
+
+ buffer1 = (char *) malloc(displayY * lineSize);
+ buffer2 = (char *) malloc(displayY * lineSize);
+ *b1 = buffer1;
+ *b2 = buffer2;
+ initialized = 1;
+ return lineSize;
+}
+
+static void win32_free_buffers(char *b1, char *b2)
+{
+ initialized = 0;
+ free(buffer1);
+ free(buffer2);
+ buffer1 = buffer2 = NULL;
+}
+
+static CONST char *CONST dx_depth[] = { "8bpp (256 colors)",
+ "16bpp (65536 colors)",
+ "24bpp (16777216 colors)",
+ "32bpp (16777216 colors)",
+ NULL
+};
+
+#ifdef DDRAW_DRIVER
+static menudialog dx_resdialog[] = {
+ DIALOGCHOICE("Resolution", resstr, 0),
+ DIALOGCHOICE("Depth", dx_depth, 0),
+ {NULL}
+};
+
+static menudialog *dx_resizedialog(struct uih_context *c)
+{
+ int i;
+ switch (bitDepth) {
+ case 8:
+ dx_resdialog[1].defint = 0;
+ break;
+ case 16:
+ dx_resdialog[1].defint = 1;
+ break;
+ case 24:
+ dx_resdialog[1].defint = 2;
+ break;
+ case 32:
+ dx_resdialog[1].defint = 3;
+ }
+ for (i = 0; i < MAXRESOLUTIONS; i++)
+ if (displayX == ressize[i].width && displayY == ressize[i].height) {
+ dx_resdialog[0].defint = i;
+ break;
+ }
+ return dx_resdialog;
+}
+
+static void dx_resize(struct uih_context *c, dialogparam * p)
+{
+ static char s[10];
+ CONST static char *CONST st[] = { "8", "16", "24", "32" };
+ sprintf(s, "%sx%s", resstr[p[0].dint], st[p[1].dint]);
+ dxsize = s;
+ resized = 1;
+ ui_call_resize();
+}
+
+int uiw_no_resizeitems_i18n;
+
+static menuitem *resizeitems;
+
+static void add_resizeitems()
+{
+ // General method, it's needed:
+ int no_menuitems_i18n = uiw_no_menuitems_i18n; /* This variable must be local. */
+ MENUCDIALOG_I("ui", "=", gettext("Resize"), "resize", 0, dx_resize,
+ dx_resizedialog);
+ no_menuitems_i18n -= uiw_no_menuitems_i18n;
+ resizeitems = &(menuitems_i18n[uiw_no_menuitems_i18n]);
+ uiw_no_resizeitems_i18n = no_menuitems_i18n;
+ menu_add(resizeitems, uiw_no_resizeitems_i18n);
+ uiw_no_menuitems_i18n += no_menuitems_i18n;
+
+}
+
+
+static int dx_alloc_buffers(char **b1, char **b2)
+{
+ DWORD ddrval;
+ DDSURFACEDESC ddsd;
+ int i;
+ currentbuff = 0;
+ memset(surface, 0, sizeof(DDSURFACEDESC) * 2);
+ memset(&ddsd, 0, sizeof(DDSURFACEDESC));
+ ddsd.dwSize = sizeof(ddsd);
+ if (IDirectDrawSurface_GetSurfaceDesc(lpSurfaces[0], &ddsd) != DD_OK) {
+ DeInitDD();
+ x_error("Failed to get pixel format");
+ return 0;
+ }
+ for (i = 0; i < 2; i++) {
+ ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS;
+ ddsd.dwWidth = displayX;
+ ddsd.dwHeight = displayY;
+ ddsd.ddsCaps.dwCaps =
+ DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
+
+ ddrval =
+ IDirectDraw_CreateSurface(lpDD, &ddsd, &BackSurface[i], NULL);
+ if (ddrval != DD_OK) {
+ DeInitDD();
+ x_error("Failed to create back surface");
+ return 0;
+ }
+ }
+ for (i = 0; i < 2; i++) {
+ surface[i].dwSize = sizeof(DDSURFACEDESC);
+ ddrval = IDirectDrawSurface_Lock(BackSurface[i], NULL, surface + i,
+ DDLOCK_WAIT, NULL);
+ if (ddrval != DD_OK) {
+ DeInitDD();
+ x_fatalerror("Failed to lock offscreen surfaces");
+ }
+ }
+ buffer1 = *b1 = (char *) surface[0].lpSurface;
+ buffer2 = *b2 = (char *) surface[1].lpSurface;
+ lineSize = surface[0].u1.lPitch;
+ initialized = 1;
+ return lineSize;
+}
+
+static void dx_free_buffers(char *b1, char *b2)
+{
+ IDirectDrawSurface_Unlock(BackSurface[0], surface[0].lpSurface);
+ IDirectDrawSurface_Unlock(BackSurface[1], surface[1].lpSurface);
+ if (BackSurface[0])
+ IDirectDrawSurface_Release(BackSurface[0]);
+ if (BackSurface[1])
+ IDirectDrawSurface_Release(BackSurface[1]);
+ BackSurface[0] = NULL;
+ BackSurface[1] = NULL;
+ initialized = 0;
+ buffer1 = buffer2 = NULL;
+}
+
+static int dx_imgparams(void)
+{
+ DDSURFACEDESC s;
+ memset(&s, 0, sizeof(s));
+ s.dwSize = sizeof(s);
+ if (IDirectDrawSurface_GetSurfaceDesc(lpSurfaces[0], &s) != DD_OK) {
+ DeInitDD();
+ x_error("Failed to get pixel format");
+ return 0;
+ }
+ switch (s.ddpfPixelFormat.u1.dwRGBBitCount) {
+ case 8:
+ dxw_driver.imagetype = UI_C256;
+ dxf_driver.imagetype = UI_C256;
+ break;
+ case 16:
+ case 15:
+ dxw_driver.imagetype = UI_TRUECOLOR16;
+ dxf_driver.imagetype = UI_TRUECOLOR16;
+ break;
+ case 24:
+ dxw_driver.imagetype = UI_TRUECOLOR24;
+ dxf_driver.imagetype = UI_TRUECOLOR24;
+ break;
+ case 32:
+ dxw_driver.imagetype = UI_TRUECOLOR;
+ dxf_driver.imagetype = UI_TRUECOLOR;
+ break;
+ default:
+ x_fatalerror
+ ("Unsupported bit depth! Only 8bpp, 16bpp, 24bpp and 32bpp modes supported\n");
+ return 0;
+ }
+ dxw_driver.rmask = s.ddpfPixelFormat.u2.dwRBitMask;
+ dxw_driver.gmask = s.ddpfPixelFormat.u3.dwGBitMask;
+ dxw_driver.bmask = s.ddpfPixelFormat.u4.dwBBitMask;
+ dxf_driver.rmask = s.ddpfPixelFormat.u2.dwRBitMask;
+ dxf_driver.gmask = s.ddpfPixelFormat.u3.dwGBitMask;
+ dxf_driver.bmask = s.ddpfPixelFormat.u4.dwBBitMask;
+ dxf_driver.textwidth = fontWidth;
+ dxf_driver.textheight = fontHeight;
+ dxw_driver.textwidth = fontWidth;
+ dxw_driver.textheight = fontHeight;
+ return 1;
+}
+
+static int dxw_init(void)
+{
+ int r;
+
+ r = InitDD(0);
+ if (!r)
+ return r;
+
+ if (!dx_imgparams())
+ return 0;
+ win32_createrootmenu();
+ getres(&dxw_driver.width, &dxw_driver.height);
+ uiw_no_menuitems_i18n = 0;
+ add_cutpasteitems();
+ return r;
+}
+
+static int dxf_init(void)
+{
+ int r;
+
+ getdimens(&dxf_driver.width, &dxf_driver.height);
+ r = InitDD(1);
+ if (!r)
+ return r;
+
+ if (!dx_imgparams())
+ return 0;
+ uiw_no_menuitems_i18n = 0;
+ add_resizeitems();
+ add_cutpasteitems();
+ return r;
+}
+
+
+
+static void dx_uninitialize(void)
+{
+ if (directX == DXFULLSCREEN)
+ menu_delete(resizeitems, uiw_no_resizeitems_i18n);
+ menu_delete(cutpasteitems, uiw_no_cutpasteitems_i18n);
+ DeInitDD();
+}
+
+
+
+
+static void dx_getsize(int *width, int *height)
+{
+ if (resized) {
+ resized = 0;
+ if (!ResizeDD(directX == DXFULLSCREEN)) {
+ DeInitDD();
+ x_fatalerror("Failed to resize");
+ }
+ if (!dx_imgparams()) {
+ DeInitDD();
+ x_fatalerror("Internal program error #34234");
+ }
+ }
+ *width = displayX;
+ *height = displayY;
+ CalculateBITMAPINFO();
+}
+
+static void dx_mousetype(int type)
+{
+ switch (type) {
+ default:
+ case 0:
+ mousepointer = mouse_pointer_data;
+ break;
+ case 1:
+ mousepointer = wait_pointer_data;
+ break;
+ case 2:
+ mousepointer = replay_pointer_data;
+ break;
+ }
+ UpdateMouseDD();
+}
+#endif
+
+void win32_help(struct uih_context *c, CONST char *name)
+{
+#ifdef HTML_HELP
+ FILE *f;
+ char *n;
+ if (helpname == NULL) {
+ if (directX == DXFULLSCREEN)
+ ShowWindow(hWnd, SW_MINIMIZE);
+ n = xio_fixpath("\01\\help\\xaoshelp.chm");
+ if ((f = fopen(n, "r"))) {
+ fclose(f);
+ } else {
+ free(n);
+ n = xio_fixpath("\01\\..\\help\\xaoshelp.chm");
+ if ((f = fopen(n, "r"))) {
+ fclose(f);
+ } else
+ n = strdup("..\\help\\xaoshelp.chm");
+ }
+ helpname = n;
+ }
+ HH_AKLINK link;
+ link.cbStruct = sizeof(HH_AKLINK) ;
+ link.fReserved = FALSE ;
+ link.pszKeywords = name ;
+ link.pszUrl = NULL ;
+ link.pszMsgText = NULL ;
+ link.pszMsgTitle = NULL ;
+ link.pszWindow = NULL ;
+ link.fIndexOnFail = TRUE ;
+
+ if (!HtmlHelp(hWnd, helpname, HH_ALINK_LOOKUP, (DWORD) &link)) {
+ x_error("Could not display help for topic %s from file %s", name, helpname);
+ }
+#else
+ x_error("Help support not included in this executable.");
+#endif
+}
+
+
+static struct params params[] = {
+ {"", P_HELP, NULL, "Win32 driver options:"},
+ {"-size", P_STRING, &size,
+ "Window size in format WIDTHxHEIGHT (320x200)"},
+ {NULL, 0, NULL, NULL}
+};
+
+static struct params dxfparams[] = {
+ {"", P_HELP, NULL, "DirectX fullscreen driver options:"},
+ {"-mode", P_STRING, &dxsize,
+ "Select preffered graphics mode in format WIDTHxHEIGHTxDEPTH (320x200x8)"},
+ {NULL, 0, NULL, NULL}
+};
+
+static struct params dxwparams[] = {
+ {"", P_HELP, NULL, "DirectX windowed driver options:"},
+ {"-size", P_STRING, &size,
+ "Window size in format WIDTHxHEIGHT (320x200)"},
+ {NULL, 0, NULL, NULL}
+};
+
+extern int XaoS_main(int argc, char **argv);
+int STDCALL
+WinMain(HINSTANCE hInstance1,
+ HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
+{
+ static char name0[256];
+ static char *argv[256];
+ int argc = 1;
+ int i;
+
+ GetModuleFileName(hInstance1, name0, 256);
+ /* Allocate everything virtually - be on the safe side */
+ argv[0] = strdup(name0);
+ lpCmdLine = strdup(lpCmdLine);
+
+ for (i = 0; lpCmdLine[i]; i++) {
+ if (lpCmdLine[i] == ' ' || lpCmdLine[i] == '\t')
+ lpCmdLine[i] = 0;
+ else if (!i || !lpCmdLine[i - 1])
+ argv[argc] = lpCmdLine + i, argc++;
+ }
+
+ /* Attach to parent console if available so output will be visible */
+ if (AttachConsole(ATTACH_PARENT_PROCESS)) {
+ /* make sure stdout is not already redirected before redefining */
+ if (_fileno(stdout) == -1 || _get_osfhandle(fileno(stdout)) == -1)
+ freopen("CON", "w", stdout);
+ }
+
+ hInstance = hInstance1;
+ return XaoS_main(argc, argv);
+}
+
+static CONST struct gui_driver win32_gui_driver = {
+ win32_dorootmenu,
+ win32_enabledisable,
+ win32_menu,
+ win32_dialog,
+ win32_help
+};
+
+static CONST struct gui_driver win32_fullscreen_gui_driver = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ win32_help
+};
+
+struct ui_driver win32_driver = {
+ "win32",
+ win32_init,
+ win32_getsize,
+ processevents,
+ getmouse,
+ win32_uninitialize,
+ NULL, // win32_set_color,
+ set_palette,
+ print,
+ win32_display,
+ win32_alloc_buffers,
+ win32_free_buffers,
+ flip_buffers,
+ mousetype,
+ NULL,
+ 16 + 16,
+ 12,
+ params,
+ PIXELSIZE | UPDATE_AFTER_PALETTE,
+ 0.0, 0.0,
+ 0, 0,
+ UI_C256,
+ 0, 256, 255,
+ 0, 0, 0,
+ &win32_gui_driver
+};
+
+#ifdef DDRAW_DRIVER
+struct ui_driver dxw_driver = {
+ "dX-window",
+ dxw_init,
+ dx_getsize,
+ processevents,
+ getmouse,
+ dx_uninitialize,
+ NULL, // dx_set_color,
+ set_palette,
+ print,
+ PaintDD,
+ dx_alloc_buffers,
+ dx_free_buffers,
+ flip_buffers,
+ mousetype,
+ NULL,
+ 16 + 16,
+ 12,
+ dxwparams,
+ PIXELSIZE,
+ 0.0, 0.0,
+ 0, 0,
+ UI_C256,
+ 0, 256, 255,
+ 0, 0, 0,
+ &win32_gui_driver
+};
+
+struct ui_driver dxf_driver = {
+ "dX-fullscreen",
+ dxf_init,
+ dx_getsize,
+ processevents,
+ getmouse,
+ dx_uninitialize,
+ NULL, // dx_set_color,
+ set_palette,
+ print,
+ PaintDD,
+ dx_alloc_buffers,
+ dx_free_buffers,
+ flip_buffers,
+ dx_mousetype,
+ NULL,
+ 16 + 16,
+ 12,
+ dxfparams,
+ FULLSCREEN | SCREENSIZE,
+ 0.0, 0.0,
+ 0, 0,
+ UI_C256,
+ 0, 256, 255,
+ 0, 0, 0,
+ &win32_fullscreen_gui_driver
+};
+#endif
+
+void x_message(const char *text, ...)
+{
+ va_list ap;
+ char buf[4096];
+ va_start(ap, text);
+ vsprintf(buf, text, ap);
+ if (directX == DXFULLSCREEN)
+ ShowWindow(hWnd, SW_MINIMIZE);
+ MessageBox(NULL, buf, "XaoS", MB_OK | MB_ICONINFORMATION);
+ va_end(ap);
+}
+
+void x_error(const char *text, ...)
+{
+ va_list ap;
+ char buf[4096];
+ va_start(ap, text);
+ vsprintf(buf, text, ap);
+ if (directX == DXFULLSCREEN)
+ ShowWindow(hWnd, SW_MINIMIZE);
+ MessageBox(NULL, buf, "XaoS have problem", MB_OK | MB_ICONEXCLAMATION);
+ va_end(ap);
+}
+
+void x_fatalerror(const char *text, ...)
+{
+ va_list ap;
+ char buf[4096];
+ va_start(ap, text);
+ vsprintf(buf, text, ap);
+ if (directX == DXFULLSCREEN)
+ ShowWindow(hWnd, SW_MINIMIZE);
+ MessageBox(NULL, buf, "Unrecovable XaoS error", MB_OK | MB_ICONSTOP);
+ va_end(ap);
+ exit(1);
+}
+
+
+#endif /* WIN32_DRIVER */
diff --git a/src/ui/ui-drv/win32/ui_win32.h b/src/ui/ui-drv/win32/ui_win32.h
new file mode 100644
index 0000000..cd64526
--- /dev/null
+++ b/src/ui/ui-drv/win32/ui_win32.h
@@ -0,0 +1,20 @@
+
+#ifndef UI_WIN32_H
+#include <windows.h>
+#include <ui.h>
+extern int directX;
+extern CONST char *helptopic;
+extern HWND hWnd;
+extern HINSTANCE hInstance;
+HMENU win32_createrootmenu(void);
+void win32_pressed(int id);
+void win32_dorootmenu(struct uih_context *uih, CONST char *name);
+void win32_enabledisable(struct uih_context *uih, CONST char *name);
+void win32_menu(struct uih_context *c, CONST char *name);
+void win32_uninitializewindows(void);
+void win32_dialog(struct uih_context *uih, CONST char *name);
+void win32_genresources(struct uih_context *uih);
+void win32_help(struct uih_context *uih, CONST char *name);
+void CenterWindow(HWND hwndChild, HWND hwndParent);
+void AboutBox(void);
+#endif
diff --git a/src/ui/ui-drv/win32/version.rc b/src/ui/ui-drv/win32/version.rc
new file mode 100644
index 0000000..2606338
--- /dev/null
+++ b/src/ui/ui-drv/win32/version.rc
@@ -0,0 +1,39 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+1 VERSIONINFO
+ FILEVERSION 3,5,0,0
+ PRODUCTVERSION 3,5,0,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "Brought to you by Jan Hubicka, Thomas Marsh and many others\0"
+ VALUE "CompanyName", "Free Software Foundation\0"
+ VALUE "FileDescription", "XaoS - a realtime fractal zoomer\0"
+ VALUE "FileVersion", "0.0\0"
+ VALUE "InternalName", "XaoS\0"
+ VALUE "LegalCopyright", "Copyright 1996-2008 Jan Hubicka, Thomas Marsh and many others. Many parts are copyrighted by their authors. See the source distribution\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "\0"
+ VALUE "ProductName", "XaoS\0"
+ VALUE "ProductVersion", "3.5\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 0x04E4, 0x411, 0x04E4
+ END
+END
diff --git a/src/ui/ui-drv/win32/windialo.c b/src/ui/ui-drv/win32/windialo.c
new file mode 100644
index 0000000..dd0a9e6
--- /dev/null
+++ b/src/ui/ui-drv/win32/windialo.c
@@ -0,0 +1,471 @@
+#include <windows.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include <stdio.h>
+#include <config.h>
+/*#include <filter.h>
+ #include <ui_helper.h> */
+#include <xerror.h>
+#include <xldio.h>
+#include <ui.h>
+#include <xmenu.h>
+#include "ui_win32.h"
+
+#ifdef HAVE_GETTEXT
+#include <libintl.h>
+#else
+#define gettext(STRING) STRING
+#endif
+
+TCHAR text[100];
+
+#define QUESTIONSTART 100
+#define ITEMSTART 10
+#define PERITEM 5
+
+#define OK 1
+#define CANCEL 2
+#define HELP 3
+
+static struct dialogrecord {
+ CONST menuitem *item;
+ CONST menudialog *dialog;
+ int nitems;
+ HWND windialog;
+ struct uih_context *c;
+ struct dialogrecord *next, *prev;
+} *firstdialog = NULL;
+static CONST char *win32_getextension(CONST char *ch)
+{
+ int i = 0;
+ while (ch[i]) {
+ if (ch[i] == '*')
+ return (ch + i + 1);
+ i++;
+ }
+ return ch + i;
+}
+
+static char *win32_dofiledialog(struct uih_context *uih,
+ CONST menuitem * item,
+ CONST menudialog * dialog)
+{
+ OPENFILENAME ofn;
+ char szDirName[256];
+ char szFile[256], szFileTitle[256];
+ UINT i, p;
+ char szFilter[256];
+
+ helptopic = item->shortname;
+ szDirName[0] = 0;
+ /*GetSystemDirectory(szDirName, sizeof(szDirName)); */
+ szFile[0] = 0;
+ if (dialog[0].type == DIALOG_OFILE) {
+ strcpy(szFile, dialog[0].defstr);
+ for (i = 0; dialog[0].defstr[i] && dialog[0].defstr[i] != '*';
+ i++);
+ szFile[i] = 0;
+ strcpy(szFile,
+ ui_getfile(szFile, win32_getextension(dialog[0].defstr)));
+ }
+
+ for (i = 0; dialog[0].defstr[i] && dialog[0].defstr[i] != '*'; i++)
+ if (!dialog[0].defstr[i])
+ i = 0;
+ strcpy(szFilter, dialog[0].defstr + i);
+ p = strlen(szFilter);
+ strcpy(szFilter + p + 1, dialog[0].defstr + i);
+ p += strlen(szFilter + p + 1) + 1;
+ strcpy(szFilter + p + 1, "All files");
+ p += strlen(szFilter + p + 1) + 1;
+ strcpy(szFilter + p + 1, "*.*");
+ p += strlen(szFilter + p + 1) + 1;
+ szFilter[p + 1] = 0;
+
+ memset(&ofn, 0, sizeof(OPENFILENAME));
+ ofn.lStructSize = sizeof(OPENFILENAME);
+ ofn.hwndOwner = hWnd;
+ ofn.lpstrFilter = szFilter;
+ ofn.nFilterIndex = 1;
+ ofn.lpstrFile = szFile;
+ ofn.nMaxFile = sizeof(szFile);
+ ofn.lpstrFileTitle = szFileTitle;
+ ofn.nMaxFileTitle = sizeof(szFileTitle);
+ ofn.lpstrInitialDir = szDirName;
+ ofn.Flags =
+ OFN_SHOWHELP | OFN_PATHMUSTEXIST | (dialog[0].type ==
+ DIALOG_IFILE ?
+ OFN_FILEMUSTEXIST :
+ OFN_OVERWRITEPROMPT);
+ if (dialog[0].type == DIALOG_IFILE)
+ i = GetOpenFileName(&ofn);
+ else
+ i = GetSaveFileName(&ofn);
+ helptopic = "main";
+ if (i) {
+ return (strdup(ofn.lpstrFile));
+ }
+ return NULL;
+}
+
+
+static void
+win32_filedialog(struct uih_context *uih, CONST menuitem * item,
+ CONST menudialog * dialog)
+{
+ char *name = win32_dofiledialog(uih, item, dialog);
+ if (name) {
+ dialogparam *param = malloc(sizeof(dialogparam));
+ param->dstring = name;
+ ui_menuactivate(item, param);
+ }
+}
+
+static void win32_freedialog(struct dialogrecord *r)
+{
+ if (r->next)
+ r->next->prev = r->prev;
+ if (r->prev)
+ r->prev->next = r->next;
+ else
+ firstdialog = r->next;
+ free(r);
+}
+
+static int win32_dodialog(struct dialogrecord *r, HWND hDLG)
+{
+ dialogparam *p = calloc(sizeof(*p), r->nitems);
+ int i;
+ char s[256];
+ for (i = 0; i < r->nitems; i++) {
+ switch (r->dialog[i].type) {
+ case DIALOG_IFILE:
+ case DIALOG_OFILE:
+ case DIALOG_STRING:
+ case DIALOG_KEYSTRING:
+ GetDlgItemText(hDLG, i * PERITEM + ITEMSTART, s, sizeof(s));
+ p[i].dstring = strdup(s);
+ break;
+ case DIALOG_INT:
+ GetDlgItemText(hDLG, i * PERITEM + ITEMSTART, s, sizeof(s));
+ p[i].dint = r->dialog[i].defint;
+ sscanf(s, "%i", &p[i].dint);
+ break;
+ case DIALOG_FLOAT:
+ GetDlgItemText(hDLG, i * PERITEM + ITEMSTART, s, sizeof(s));
+ p[i].number = r->dialog[i].deffloat;
+ p[i].number = x_strtold(s, NULL);
+ break;
+ case DIALOG_COORD:
+ GetDlgItemText(hDLG, i * PERITEM + ITEMSTART, s, sizeof(s));
+ p[i].dcoord[0] = r->dialog[i].deffloat;
+ p[i].dcoord[0] = x_strtold(s, NULL);
+ GetDlgItemText(hDLG, i * PERITEM + ITEMSTART + 1, s,
+ sizeof(s));
+ p[i].dcoord[1] = r->dialog[i].deffloat2;
+ p[i].dcoord[1] = x_strtold(s, NULL);
+ break;
+ case DIALOG_CHOICE:
+ /*x_message("Choice is not implemented yet"); */
+ {
+ int y;
+ y = LOWORD(SendDlgItemMessage
+ (hDLG, i * PERITEM + ITEMSTART, CB_GETCURSEL, 0,
+ 0L));
+ p[i].dint =
+ LOWORD(SendDlgItemMessage
+ (hDLG, i * PERITEM + ITEMSTART, CB_GETITEMDATA,
+ (WPARAM) y, 0L));
+ }
+ }
+ }
+ ui_menuactivate(r->item, p);
+ return 1;
+}
+
+static BOOL APIENTRY
+DialogHandler(HWND hDLG, UINT message, UINT wParam, LONG lParam)
+{
+ struct dialogrecord *rec = firstdialog;
+ int i;
+/* while(rec->windialog!=hDLG) rec=rec->next; */
+ if (!rec->windialog)
+ rec->windialog = hDLG;
+ switch (message) {
+ case WM_INITDIALOG:
+ /*x_message("Creating dialog"); */
+ ShowWindow(hDLG, SW_HIDE);
+ /*CenterWindow (hDLG, GetWindow (hDLG, GW_OWNER)); */
+ if (GetWindowText(hDLG, text, GetWindowTextLength(hDLG) + 1) > 0);
+ SetWindowText(hDLG, gettext(text));
+ SetDlgItemText(hDLG, OK, gettext("OK"));
+ SetDlgItemText(hDLG, CANCEL, gettext("Cancel"));
+ SetDlgItemText(hDLG, HELP, gettext("Help"));
+ for (i = 0; rec->dialog[i].question; i++) {
+ if (GetDlgItemText
+ (hDLG, i * PERITEM + QUESTIONSTART, text, 100) > 0)
+ SetDlgItemText(hDLG, i * PERITEM + QUESTIONSTART,
+ gettext(text));
+ switch (rec->dialog[i].type) {
+ char s[256];
+ case DIALOG_STRING:
+ case DIALOG_IFILE:
+ case DIALOG_OFILE:
+ SetDlgItemText(hDLG, i * PERITEM + ITEMSTART,
+ rec->dialog[i].defstr);
+ break;
+ case DIALOG_INT:
+ sprintf(s, "%i", rec->dialog[i].defint);
+ SetDlgItemText(hDLG, i * PERITEM + ITEMSTART, s);
+ break;
+ case DIALOG_COORD:
+ sprintf(s, "%g", (double) rec->dialog[i].deffloat2);
+ SetDlgItemText(hDLG, i * PERITEM + ITEMSTART + 1, s);
+ /*Fall trought */
+ case DIALOG_FLOAT:
+ sprintf(s, "%g", (double) rec->dialog[i].deffloat);
+ SetDlgItemText(hDLG, i * PERITEM + ITEMSTART, s);
+ break;
+ case DIALOG_CHOICE:
+ {
+ CONST char **strings =
+ (CONST char **) rec->dialog[i].defstr;
+ int y;
+ int pos;
+ for (y = 0; strings[y]; y++) {
+ pos =
+ LOWORD(SendDlgItemMessage
+ (hDLG, i * PERITEM + ITEMSTART,
+ CB_ADDSTRING, (WPARAM) 0,
+ (LPARAM) (LPSTR) strings[y]));
+ /*x_message("%s %i",strings[y],pos); */
+ SendMessage(GetDlgItem
+ (hDLG, i * PERITEM + ITEMSTART),
+ CB_SETITEMDATA, (WPARAM) pos, y);
+ if (y == rec->dialog[i].defint) {
+ pos =
+ SendMessage(GetDlgItem
+ (hDLG,
+ i * PERITEM + ITEMSTART),
+ CB_SETCURSEL, (WPARAM) pos,
+ 0L);
+ /*x_message("Default %i",pos); */
+ }
+ }
+ pos =
+ LOWORD(SendDlgItemMessage
+ (hDLG, i * PERITEM + ITEMSTART, CB_GETCOUNT,
+ (WPARAM) 0, 0));
+ /*x_message("Count %i",pos); */
+ }
+ break;
+ }
+ }
+ CenterWindow(hDLG, GetWindow(hDLG, GW_OWNER));
+ ShowWindow(hDLG, SW_SHOW);
+ return (TRUE);
+ case WM_SYSCOMMAND:
+ if (wParam == SC_CLOSE) {
+ EndDialog(hDLG, 0);
+ return (TRUE);
+ }
+ break;
+ case WM_COMMAND:
+ if (wParam == OK) {
+ if (win32_dodialog(rec, hDLG)) {
+ EndDialog(hDLG, 0);
+ return (TRUE);
+ }
+ }
+ if (wParam == CANCEL) {
+ EndDialog(hDLG, 0);
+ return (TRUE);
+ }
+ if (wParam == HELP) {
+ win32_help(rec->c, rec->item->shortname);
+ return (TRUE);
+ }
+ {
+ int i = (wParam - ITEMSTART) / PERITEM;
+ int pos = (wParam - ITEMSTART) % PERITEM;
+ if (i >= 0 && i < rec->nitems) {
+ if (pos == 1
+ && (rec->dialog[i].type == DIALOG_IFILE
+ || rec->dialog[i].type == DIALOG_OFILE)) {
+ /*x_message("File dialog\n"); */
+ char *file =
+ win32_dofiledialog(rec->c, rec->item,
+ rec->dialog + i);
+ if (file) {
+ SetDlgItemText(hDLG, wParam - 1, file);
+ free(file);
+ }
+ }
+ }
+ }
+ break;
+ }
+ return FALSE;
+}
+
+#define INPUTSIZE 20
+#define XBORDER 0
+#define YBORDER 5
+#define XSEP 4
+
+#define CHARWIDTH 4
+#define MINWIDTH ((7*3)*CHARWIDTH)
+#define LINEHEIGHT 14
+#define TEXTHEIGHT 11
+
+static FILE *file;
+static void
+win32_outputdialog(struct uih_context *uih, CONST struct menuitem *item)
+{
+ CONST menudialog *dialog;
+ int leftsize = 0;
+ int rightsize = 0;
+ int width, height;
+ int i;
+ rightsize = INPUTSIZE;
+ if (item->type != MENU_DIALOG && item->type != MENU_CUSTOMDIALOG)
+ return;
+ if (item->flags & MENUFLAG_NOMENU)
+ return;
+ dialog = menu_getdialog(uih, item);
+ for (i = 0; dialog[i].question; i++) {
+ if (leftsize < (int) strlen(dialog[i].question))
+ leftsize = strlen(dialog[i].question);
+ }
+ if (i == 1
+ && (dialog[0].type == DIALOG_IFILE
+ || dialog[0].type == DIALOG_OFILE))
+ return;
+ leftsize = XBORDER + leftsize * CHARWIDTH + XSEP;
+ rightsize = XBORDER + rightsize * CHARWIDTH;
+ width = leftsize + rightsize;
+ if (width < MINWIDTH)
+ width = MINWIDTH;
+ height = 2 * YBORDER + (i + 1) * LINEHEIGHT;
+ fprintf(file, "%sBox DIALOG %i, %i, %i, %i\n", item->shortname, 52,
+ 57, width, height);
+ fprintf(file, "STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU\n");
+ fprintf(file, "CAPTION \"%s\"\n", item->name);
+ fprintf(file, "FONT 8, \"MS Shell Dlg\"\n");
+ fprintf(file, "BEGIN\n");
+ for (i = 0; dialog[i].question; i++) {
+ fprintf(file, " RTEXT \"%s\", %i, %i, %i, %i, %i, WS_GROUP\n",
+ dialog[i].question,
+ i * PERITEM + QUESTIONSTART,
+ 0, YBORDER + i * LINEHEIGHT, leftsize - XSEP, TEXTHEIGHT);
+ switch (dialog[i].type) {
+ case DIALOG_INT:
+ case DIALOG_FLOAT:
+ case DIALOG_STRING:
+ case DIALOG_KEYSTRING:
+ fprintf(file,
+ " EDITTEXT %i, %i, %i, %i, %i, ES_AUTOHSCROLL | WS_TABSTOP\n",
+ i * PERITEM + ITEMSTART, leftsize,
+ i * LINEHEIGHT + YBORDER, rightsize - XSEP,
+ TEXTHEIGHT);
+ break;
+ case DIALOG_COORD:
+ fprintf(file,
+ " EDITTEXT %i, %i, %i, %i, %i, ES_AUTOHSCROLL | WS_TABSTOP\n",
+ i * PERITEM + ITEMSTART, leftsize,
+ i * LINEHEIGHT + YBORDER,
+ (rightsize - XSEP - 4 * CHARWIDTH) / 2, TEXTHEIGHT);
+ fprintf(file,
+ " EDITTEXT %i, %i, %i, %i, %i, ES_AUTOHSCROLL | WS_TABSTOP\n",
+ i * PERITEM + ITEMSTART + 1,
+ leftsize + (rightsize - XSEP + CHARWIDTH) / 2,
+ i * LINEHEIGHT + YBORDER,
+ (rightsize - XSEP - 4 * CHARWIDTH) / 2, TEXTHEIGHT);
+ fprintf(file, " RTEXT \"+\", -1, %i, %i, %i, %i\n",
+ leftsize + (rightsize - XSEP - 2 * CHARWIDTH) / 2,
+ YBORDER + i * LINEHEIGHT, CHARWIDTH, TEXTHEIGHT);
+ fprintf(file, " RTEXT \"i\", -1, %i, %i, %i, %i\n",
+ leftsize + rightsize - XSEP - CHARWIDTH,
+ YBORDER + i * LINEHEIGHT, CHARWIDTH, TEXTHEIGHT);
+ break;
+ case DIALOG_CHOICE:
+ fprintf(file,
+ " COMBOBOX %i, %i, %i, %i, %i, CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\n",
+ i * PERITEM + ITEMSTART, leftsize,
+ i * LINEHEIGHT + YBORDER, rightsize - XSEP,
+ TEXTHEIGHT * 10);
+ break;
+ case DIALOG_IFILE:
+ case DIALOG_OFILE:
+#define BROWSEWIDTH ((strlen("Browse")+1)*CHARWIDTH)
+ fprintf(file,
+ " EDITTEXT %i, %i, %i, %i, %i, ES_AUTOHSCROLL | WS_TABSTOP\n",
+ i * PERITEM + ITEMSTART, leftsize,
+ i * LINEHEIGHT + YBORDER,
+ rightsize - 2 * XSEP - BROWSEWIDTH, TEXTHEIGHT);
+ fprintf(file,
+ " PUSHBUTTON \"Browse\", %i, %i, %i, %i, %i, WS_GROUP\n",
+ i * PERITEM + ITEMSTART + 1,
+ leftsize + rightsize - XSEP - BROWSEWIDTH,
+ i * LINEHEIGHT + YBORDER, BROWSEWIDTH, TEXTHEIGHT);
+ break;
+ }
+ }
+ fprintf(file,
+ " DEFPUSHBUTTON \"&OK\", %i, %i, %i, %i, %i, WS_GROUP\n", OK,
+ XSEP / 2, i * LINEHEIGHT + YBORDER, width / 3 - XSEP, 14);
+ fprintf(file, " PUSHBUTTON \"&Cancel\", %i, %i, %i, %i, %i\n", CANCEL,
+ width / 3 + XSEP / 2, i * LINEHEIGHT + YBORDER,
+ width / 3 - XSEP, 14);
+ fprintf(file, " PUSHBUTTON \"&Help\", %i, %i, %i, %i, %i\n", HELP,
+ 2 * width / 3 + XSEP / 2, i * LINEHEIGHT + YBORDER,
+ width / 3 - XSEP, 14);
+ fprintf(file, "END\n");
+}
+
+void win32_genresources(struct uih_context *uih)
+{
+ file = fopen("xaos.dlg", "w");
+ menu_forall(uih, win32_outputdialog);
+ fclose(file);
+
+}
+
+void win32_dialog(struct uih_context *uih, CONST char *name)
+{
+ CONST menuitem *item = menu_findcommand(name);
+ CONST menudialog *dialog;
+ int nitems;
+ char s[256];
+
+ if (!item)
+ return;
+ dialog = menu_getdialog(uih, item);
+ if (!dialog)
+ return;
+ for (nitems = 0; dialog[nitems].question; nitems++);
+ if (nitems == 1
+ && (dialog[0].type == DIALOG_IFILE
+ || dialog[0].type == DIALOG_OFILE))
+ win32_filedialog(uih, item, dialog);
+ else {
+ struct dialogrecord *r = calloc(sizeof(*r), 1);
+ r->next = firstdialog;
+ firstdialog = r;
+ r->prev = NULL;
+ r->item = item;
+ r->nitems = nitems;
+ r->dialog = dialog;
+ r->c = uih;
+ sprintf(s, "%sBox", item->shortname);
+ if (DialogBox(hInstance, s, hWnd, DialogHandler) == -1) {
+ /*r->windialog=CreateDialog (hInstance, s, hWnd, DialogHandler);
+ if(r->windialog==NULL) { */
+ x_message("Failed to create dialog %s", item->shortname);
+ win32_freedialog(r);
+ }
+ win32_freedialog(r);
+ /*x_message("Dialog (%s %i %s) not implemented", name, nitems, dialog[0].question); */
+ }
+}
diff --git a/src/ui/ui-drv/win32/winmenu.c b/src/ui/ui-drv/win32/winmenu.c
new file mode 100644
index 0000000..d04f941
--- /dev/null
+++ b/src/ui/ui-drv/win32/winmenu.c
@@ -0,0 +1,243 @@
+#include <windows.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include <config.h>
+/*#include <filter.h>
+ #include <ui_helper.h> */
+#include <xerror.h>
+#include <ui.h>
+#include <xmenu.h>
+#include "ui_win32.h"
+#define IDMUL 64
+#define MAIN 0
+#define POPUP 1
+#define WSUBMENU 2
+struct menurecord {
+ int type;
+ int id;
+ struct uih_context *c;
+ CONST menuitem *item;
+ struct menurecord *nextrecord;
+ struct menurecord *prevrecord;
+ HMENU menu;
+ struct menurecord *submenu;
+ struct menurecord *nextsubmenu;
+} *firstrecord;
+struct menurecord rootmenu;
+
+static void win32_appendmenu(struct uih_context *c,
+ struct menurecord *menu);
+HMENU win32_createrootmenu()
+{
+ /*printf("Createrootmenu\n"); */
+ rootmenu.id = 0;
+ rootmenu.menu = CreateMenu();
+ rootmenu.nextrecord = firstrecord;
+ rootmenu.prevrecord = NULL;
+ firstrecord = &rootmenu;
+ rootmenu.nextsubmenu = NULL;
+ rootmenu.submenu = NULL;
+ /*printf("Createrootmenu OK\n"); */
+ return rootmenu.menu;
+};
+
+static struct menurecord *win32_createmenu(struct uih_context *c,
+ CONST char *name, int type)
+{
+ struct menurecord *m = calloc(sizeof(*m), 1);
+ static int id = 1;
+ /*printf("Createmenu %s\n",name); */
+ m->id = id++;
+ m->type = type;
+ if (type != POPUP)
+ m->menu = CreateMenu();
+ else
+ m->menu = CreatePopupMenu();
+ m->c = c;
+ m->item = menu_findcommand(name);
+ m->nextrecord = firstrecord;
+ m->prevrecord = NULL;
+ firstrecord = m;
+ m->nextsubmenu = NULL;
+ m->submenu = NULL;
+ win32_appendmenu(c, m);
+ /*printf("Createmenu OK\n"); */
+ return m;
+};
+
+static void
+win32_appendmenu(struct uih_context *c, struct menurecord *menu)
+{
+ int i, y, hotkeyed;
+ CONST menuitem *item;
+ char out[256];
+ char used[256];
+ memset(used, 0, 256);
+ /*printf("Appendmenu %s\n",menu->item->shortname); */
+ for (i = 0; (item = menu_item(menu->item->shortname, i)) != NULL; i++) {
+ struct menurecord *submenu = NULL;
+ int flags = MF_ENABLED | MF_STRING;
+ if (item->type == MENU_SEPARATOR)
+ flags |= MF_SEPARATOR;
+ if (item->type == MENU_SUBMENU) {
+ submenu = win32_createmenu(c, item->shortname, WSUBMENU);
+ flags |= MF_POPUP;
+ submenu->nextsubmenu = menu->submenu;
+ menu->submenu = submenu;
+ }
+ if (item->flags & (MENUFLAG_RADIO | MENUFLAG_CHECKBOX) &&
+ menu_enabled(item, c))
+ flags |= MF_CHECKED;
+ /*printf(" %s\n",item->name); */
+
+ hotkeyed = 0;
+ for (y = 0; item->name[y]; y++) {
+ if (!hotkeyed) {
+ unsigned char c = tolower(item->name[y]);
+ if (((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z'))
+ && !used[c])
+ used[c] = 1, hotkeyed = 1, out[y] = '&';
+ }
+ out[y + hotkeyed] = item->name[y];
+ }
+ out[y + hotkeyed] = 0;
+ if (item->type == MENU_CUSTOMDIALOG || item->type == MENU_DIALOG)
+ strcat(out, "...");
+ if (menu->type != MAIN && item->key) {
+ strcat(out, "\t");
+ strcat(out, item->key);
+ }
+ AppendMenu(menu->menu, flags,
+ (submenu !=
+ NULL ? (UINT) submenu->menu : (UINT) (menu->id *
+ IDMUL + i)),
+ out);
+
+ }
+ /*printf("Appendmenu OK\n"); */
+}
+
+static void win32_freestructures(struct menurecord *menu)
+{
+ struct menurecord *sub, *nextsub;
+ /*printf("Freestructures\n"); */
+ sub = menu->submenu;
+ while (sub != NULL) {
+ nextsub = sub->nextsubmenu;
+ win32_freestructures(sub);
+ sub = nextsub;
+ }
+ if (menu->nextrecord)
+ menu->nextrecord->prevrecord = menu->prevrecord;
+ if (menu->prevrecord)
+ menu->prevrecord->nextrecord = menu->nextrecord;
+ else
+ firstrecord = menu->nextrecord;
+ free(menu);
+}
+
+void win32_pressed(int id)
+{
+ struct menurecord *menu = firstrecord;
+ /*printf("Pressed\n"); */
+ while (menu) {
+ if (id / IDMUL == menu->id) {
+ ui_menuactivate(menu_item(menu->item->shortname, id % IDMUL),
+ NULL);
+ return;
+ }
+ menu = menu->nextrecord;
+ }
+ x_error("Unknown menu");
+}
+
+/* first destroy the old contents */
+void win32_dorootmenu(struct uih_context *uih, CONST char *name)
+{
+ struct menurecord *sub, *nextsub;
+ /*printf("dorootmenu %s\n",name); */
+ /* Delete the old entries */
+ while (DeleteMenu(rootmenu.menu, 0, MF_BYPOSITION));
+ sub = rootmenu.submenu;
+ rootmenu.c = uih;
+ while (sub != NULL) {
+ nextsub = sub->nextsubmenu;
+ win32_freestructures(sub);
+ sub = nextsub;
+ }
+ rootmenu.item = menu_findcommand(name);
+ rootmenu.submenu = NULL;
+ win32_appendmenu(uih, &rootmenu);
+ SetMenu(hWnd, rootmenu.menu);
+ /*printf("OK\n"); */
+}
+
+/* Check all created menus to see if there is the changed item and do changes
+ as neccesary.
+
+ This implementation is rather ugly and slow. Try if it is fast enought
+ and change it otherwise */
+void win32_enabledisable(struct uih_context *uih, CONST char *name)
+{
+ CONST struct menuitem *chgitem = menu_findcommand(name);
+ CONST struct menuitem *item;
+ struct menurecord *menu = firstrecord;
+ int i;
+ int checked = menu_enabled(chgitem, uih);
+ while (menu) {
+ if (menu->item != NULL)
+ for (i = 0;
+ (item = menu_item(menu->item->shortname, i)) != NULL;
+ i++) {
+ if (item == chgitem) {
+ if (chgitem->flags & MENUFLAG_RADIO && checked) {
+ int y;
+ for (y = 0;
+ (item =
+ menu_item(menu->item->shortname, y)) != NULL;
+ y++)
+ if (item->flags & MENUFLAG_RADIO)
+ CheckMenuItem(menu->menu,
+ menu->id * IDMUL + y,
+ MF_BYCOMMAND | MF_UNCHECKED);
+ }
+ CheckMenuItem(menu->menu, menu->id * IDMUL + i,
+ MF_BYCOMMAND | (checked ? MF_CHECKED :
+ MF_UNCHECKED));
+ }
+ }
+ menu = menu->nextrecord;
+ }
+}
+
+void win32_menu(struct uih_context *c, CONST char *name)
+{
+
+ POINT p;
+ struct menurecord *m = firstrecord;
+
+ /*Delete records about all popups, since they are closed now */
+ while (m) {
+ if (m->type == POPUP) {
+ DestroyMenu(m->menu), win32_freestructures(m);
+ break;
+ }
+ m = m->nextrecord;
+ }
+ m = win32_createmenu(c, name, POPUP);
+ GetCursorPos(&p);
+ /*printf("menu %s %i %i\n",name,p.x,p.y); */
+ TrackPopupMenu(m->menu, 0, p.x, p.y, 0, hWnd, 0);
+}
+
+void win32_uninitializewindows()
+{
+ while (firstrecord) {
+ struct menurecord *r = firstrecord;
+ while (r->type == WSUBMENU)
+ r = r->nextrecord;
+ DestroyMenu(r->menu);
+ win32_freestructures(r);
+ }
+}
diff --git a/src/ui/ui-drv/win32/xaos.dlg b/src/ui/ui-drv/win32/xaos.dlg
new file mode 100644
index 0000000..132a122
--- /dev/null
+++ b/src/ui/ui-drv/win32/xaos.dlg
@@ -0,0 +1,228 @@
+lettersBox DIALOG 52, 57, 160, 38
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "Letters per second"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ RTEXT "Letters per second:", 100, 0, 5, 76, 11, WS_GROUP
+ EDITTEXT 10, 80, 5, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "&OK", 1, 2, 19, 49, 14, WS_GROUP
+ PUSHBUTTON "&Cancel", 2, 55, 19, 49, 14
+ PUSHBUTTON "&Help", 3, 108, 19, 49, 14
+END
+commandBox DIALOG 52, 57, 136, 38
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "Command"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ RTEXT "Your command:", 100, 0, 5, 52, 11, WS_GROUP
+ EDITTEXT 10, 56, 5, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "&OK", 1, 2, 19, 41, 14, WS_GROUP
+ PUSHBUTTON "&Cancel", 2, 47, 19, 41, 14
+ PUSHBUTTON "&Help", 3, 92, 19, 41, 14
+END
+renderanimBox DIALOG 52, 57, 204, 192
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "Render animation"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ RTEXT "File to render:", 100, 0, 5, 120, 11, WS_GROUP
+ EDITTEXT 10, 124, 5, 44, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ PUSHBUTTON "Browse", 11, 172, 5, 28, 11, WS_GROUP
+ RTEXT "Basename:", 105, 0, 19, 120, 11, WS_GROUP
+ EDITTEXT 15, 124, 19, 44, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ PUSHBUTTON "Browse", 16, 172, 19, 28, 11, WS_GROUP
+ RTEXT "Width:", 110, 0, 33, 120, 11, WS_GROUP
+ EDITTEXT 20, 124, 33, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ RTEXT "Height:", 115, 0, 47, 120, 11, WS_GROUP
+ EDITTEXT 25, 124, 47, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ RTEXT "Real width (cm):", 120, 0, 61, 120, 11, WS_GROUP
+ EDITTEXT 30, 124, 61, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ RTEXT "Real height (cm):", 125, 0, 75, 120, 11, WS_GROUP
+ EDITTEXT 35, 124, 75, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ RTEXT "Framerate:", 130, 0, 89, 120, 11, WS_GROUP
+ EDITTEXT 40, 124, 89, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ RTEXT "Image type:", 135, 0, 103, 120, 11, WS_GROUP
+ COMBOBOX 45, 124, 103, 76, 110, CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ RTEXT "Antialiasing:", 140, 0, 117, 120, 11, WS_GROUP
+ COMBOBOX 50, 124, 117, 76, 110, CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ RTEXT "Always recalculate:", 145, 0, 131, 120, 11, WS_GROUP
+ COMBOBOX 55, 124, 131, 76, 110, CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ RTEXT "Calculate MPEG motion vectors:", 150, 0, 145, 120, 11, WS_GROUP
+ COMBOBOX 60, 124, 145, 76, 110, CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ RTEXT "Recommended I frame distance:", 155, 0, 159, 120, 11, WS_GROUP
+ EDITTEXT 65, 124, 159, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "&OK", 1, 2, 173, 64, 14, WS_GROUP
+ PUSHBUTTON "&Cancel", 2, 70, 173, 64, 14
+ PUSHBUTTON "&Help", 3, 138, 173, 64, 14
+END
+textBox DIALOG 52, 57, 104, 38
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "Display text"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ RTEXT "Text:", 100, 0, 5, 20, 11, WS_GROUP
+ EDITTEXT 10, 24, 5, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "&OK", 1, 2, 19, 30, 14, WS_GROUP
+ PUSHBUTTON "&Cancel", 2, 36, 19, 30, 14
+ PUSHBUTTON "&Help", 3, 71, 19, 30, 14
+END
+colorBox DIALOG 52, 57, 108, 38
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "Color"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ RTEXT "Color:", 100, 0, 5, 24, 11, WS_GROUP
+ COMBOBOX 10, 28, 5, 76, 110, CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "&OK", 1, 2, 19, 32, 14, WS_GROUP
+ PUSHBUTTON "&Cancel", 2, 38, 19, 32, 14
+ PUSHBUTTON "&Help", 3, 74, 19, 32, 14
+END
+usrformBox DIALOG 52, 57, 116, 38
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "User formula"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ RTEXT "Formula:", 100, 0, 5, 32, 11, WS_GROUP
+ EDITTEXT 10, 36, 5, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "&OK", 1, 2, 19, 34, 14, WS_GROUP
+ PUSHBUTTON "&Cancel", 2, 40, 19, 34, 14
+ PUSHBUTTON "&Help", 3, 79, 19, 34, 14
+END
+usrformInitBox DIALOG 52, 57, 144, 38
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "User initialization"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ RTEXT "Initialization:", 100, 0, 5, 60, 11, WS_GROUP
+ EDITTEXT 10, 64, 5, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "&OK", 1, 2, 19, 44, 14, WS_GROUP
+ PUSHBUTTON "&Cancel", 2, 50, 19, 44, 14
+ PUSHBUTTON "&Help", 3, 98, 19, 44, 14
+END
+uimandelbrotBox DIALOG 52, 57, 128, 38
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "Mandelbrot mode"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ RTEXT "Julia-seed:", 100, 0, 5, 44, 11, WS_GROUP
+ EDITTEXT 10, 48, 5, 30, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ EDITTEXT 11, 88, 5, 30, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ RTEXT "+", -1, 82, 5, 4, 11
+ RTEXT "i", -1, 120, 5, 4, 11
+ DEFPUSHBUTTON "&OK", 1, 2, 19, 38, 14, WS_GROUP
+ PUSHBUTTON "&Cancel", 2, 44, 19, 38, 14
+ PUSHBUTTON "&Help", 3, 87, 19, 38, 14
+END
+uiperturbationBox DIALOG 52, 57, 136, 38
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "Perturbation"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ RTEXT "Perturbation:", 100, 0, 5, 52, 11, WS_GROUP
+ EDITTEXT 10, 56, 5, 30, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ EDITTEXT 11, 96, 5, 30, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ RTEXT "+", -1, 90, 5, 4, 11
+ RTEXT "i", -1, 128, 5, 4, 11
+ DEFPUSHBUTTON "&OK", 1, 2, 19, 41, 14, WS_GROUP
+ PUSHBUTTON "&Cancel", 2, 47, 19, 41, 14
+ PUSHBUTTON "&Help", 3, 92, 19, 41, 14
+END
+uiviewBox DIALOG 52, 57, 112, 66
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "View"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ RTEXT "Center:", 100, 0, 5, 28, 11, WS_GROUP
+ EDITTEXT 10, 32, 5, 30, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ EDITTEXT 11, 72, 5, 30, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ RTEXT "+", -1, 66, 5, 4, 11
+ RTEXT "i", -1, 104, 5, 4, 11
+ RTEXT "Radius:", 105, 0, 19, 28, 11, WS_GROUP
+ EDITTEXT 15, 32, 19, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ RTEXT "Angle:", 110, 0, 33, 28, 11, WS_GROUP
+ EDITTEXT 20, 32, 33, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "&OK", 1, 2, 47, 33, 14, WS_GROUP
+ PUSHBUTTON "&Cancel", 2, 39, 47, 33, 14
+ PUSHBUTTON "&Help", 3, 76, 47, 33, 14
+END
+paletteBox DIALOG 52, 57, 152, 66
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "Custom palette"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ RTEXT "Algorithm number:", 100, 0, 5, 68, 11, WS_GROUP
+ EDITTEXT 10, 72, 5, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ RTEXT "Seed:", 105, 0, 19, 68, 11, WS_GROUP
+ EDITTEXT 15, 72, 19, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ RTEXT "Shift:", 110, 0, 33, 68, 11, WS_GROUP
+ EDITTEXT 20, 72, 33, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "&OK", 1, 2, 47, 46, 14, WS_GROUP
+ PUSHBUTTON "&Cancel", 2, 52, 47, 46, 14
+ PUSHBUTTON "&Help", 3, 103, 47, 46, 14
+END
+cyclingspeedBox DIALOG 52, 57, 156, 38
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "Color cycling speed"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ RTEXT "Frames per second:", 100, 0, 5, 72, 11, WS_GROUP
+ EDITTEXT 10, 76, 5, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "&OK", 1, 2, 19, 48, 14, WS_GROUP
+ PUSHBUTTON "&Cancel", 2, 54, 19, 48, 14
+ PUSHBUTTON "&Help", 3, 106, 19, 48, 14
+END
+shiftpaletteBox DIALOG 52, 57, 112, 38
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "Shift palette"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ RTEXT "Amount:", 100, 0, 5, 28, 11, WS_GROUP
+ EDITTEXT 10, 32, 5, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "&OK", 1, 2, 19, 33, 14, WS_GROUP
+ PUSHBUTTON "&Cancel", 2, 39, 19, 33, 14
+ PUSHBUTTON "&Help", 3, 76, 19, 33, 14
+END
+maxiterBox DIALOG 52, 57, 128, 38
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "Iterations"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ RTEXT "Iterations:", 100, 0, 5, 44, 11, WS_GROUP
+ EDITTEXT 10, 48, 5, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "&OK", 1, 2, 19, 38, 14, WS_GROUP
+ PUSHBUTTON "&Cancel", 2, 44, 19, 38, 14
+ PUSHBUTTON "&Help", 3, 87, 19, 38, 14
+END
+bailoutBox DIALOG 52, 57, 116, 38
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "Bailout"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ RTEXT "Bailout:", 100, 0, 5, 32, 11, WS_GROUP
+ EDITTEXT 10, 36, 5, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "&OK", 1, 2, 19, 34, 14, WS_GROUP
+ PUSHBUTTON "&Cancel", 2, 40, 19, 34, 14
+ PUSHBUTTON "&Help", 3, 79, 19, 34, 14
+END
+rotationspeedBox DIALOG 52, 57, 168, 38
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "Rotation speed"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ RTEXT "Rotations per second:", 100, 0, 5, 84, 11, WS_GROUP
+ EDITTEXT 10, 88, 5, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "&OK", 1, 2, 19, 52, 14, WS_GROUP
+ PUSHBUTTON "&Cancel", 2, 58, 19, 52, 14
+ PUSHBUTTON "&Help", 3, 114, 19, 52, 14
+END
+speedBox DIALOG 52, 57, 140, 38
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "Zooming speed"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ RTEXT "Zooming speed:", 100, 0, 5, 56, 11, WS_GROUP
+ EDITTEXT 10, 60, 5, 76, 11, ES_AUTOHSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "&OK", 1, 2, 19, 42, 14, WS_GROUP
+ PUSHBUTTON "&Cancel", 2, 48, 19, 42, 14
+ PUSHBUTTON "&Help", 3, 95, 19, 42, 14
+END
diff --git a/src/ui/ui-drv/win32/xaos.exe.manifest b/src/ui/ui-drv/win32/xaos.exe.manifest
new file mode 100644
index 0000000..9a3a947
--- /dev/null
+++ b/src/ui/ui-drv/win32/xaos.exe.manifest
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity version="3.5.0.0" processorArchitecture="X86" name="net.sourceforge.XaoS" type="win32" />
+<description>Your application description here.</description>
+<dependency>
+<dependentAssembly>
+<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" />
+</dependentAssembly>
+</dependency>
+</assembly>
diff --git a/src/ui/ui-drv/win32/xaos.ico b/src/ui/ui-drv/win32/xaos.ico
new file mode 100644
index 0000000..54a99cf
--- /dev/null
+++ b/src/ui/ui-drv/win32/xaos.ico
Binary files differ
diff --git a/src/ui/ui-drv/win32/xaos.rc b/src/ui/ui-drv/win32/xaos.rc
new file mode 100644
index 0000000..5564505
--- /dev/null
+++ b/src/ui/ui-drv/win32/xaos.rc
@@ -0,0 +1,16 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+#include <windows.h>
+#include "resource.h"
+#include "about.h"
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "xaos.exe.manifest"
+BIG ICON DISCARDABLE "xaos.ico"
+SMALL ICON DISCARDABLE "small.ico"
+
+#include "xaos.dlg"
+#include "version.rc"
+#include "about.rc"
diff --git a/src/ui/ui-drv/x11/Makefile.in b/src/ui/ui-drv/x11/Makefile.in
new file mode 100644
index 0000000..c4ac33c
--- /dev/null
+++ b/src/ui/ui-drv/x11/Makefile.in
@@ -0,0 +1,40 @@
+CC = @CC@
+CFLAGS = @CFLAGS@
+LIBS = @LIBS@ -lm
+LFLAGS = @LDFLAGS@
+AR = @AR@
+RANLIB = @RANLIB@
+
+SRCS = xlib.c \
+ ui_x11.c
+
+OBJS = $(SRCS:.c=.o)
+
+TLIB = @LIBPATH@/libuix11.a
+
+
+all: $(TLIB)
+
+$(TLIB):$(OBJS)
+ rm -f $@
+ $(AR) rc $@ $(OBJS)
+ $(RANLIB) $@
+
+clean:
+ rm -f $(TLIB)
+ rm -f *.[oas]
+ rm -f *~
+ rm -f core
+
+distclean:clean
+ rm Makefile
+
+#dep:
+# rm -f .depend
+# make .depend
+#
+#.depend:
+# echo '# Program dependencies' >.depend
+# gcc -I svgalib $(DEFINES) -MM $(patsubst %.o,%.c,$(OBJS)) >>.depend
+#
+#include .depend
diff --git a/src/ui/ui-drv/x11/ui_x11.c b/src/ui/ui-drv/x11/ui_x11.c
new file mode 100644
index 0000000..9b5daa3
--- /dev/null
+++ b/src/ui/ui-drv/x11/ui_x11.c
@@ -0,0 +1,597 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include "aconfig.h"
+#ifdef X11_DRIVER
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+#include <string.h>
+#include <X11/Xlib.h>
+#include <X11/cursorfont.h>
+#include "xlib.h"
+#ifdef MITSHM
+#include <sys/ipc.h>
+#include <sys/shm.h>
+#include <X11/extensions/XShm.h>
+#endif
+#include <fconfig.h>
+#include <ui.h>
+xlibparam xparams = { 0, 0, 0, 0, NULL, -1 };
+
+static int allocated;
+Cursor normal, xwait, replay;
+
+struct ui_driver x11_driver;
+static xdisplay *d;
+static char *size;
+static int Xsync;
+static int busy;
+static int sharedcolormap;
+#if 0
+static char *selection;
+#endif
+#ifdef MITSHM
+static int Completion;
+#endif
+#ifdef AMIGA
+#define XFlush(x) while(0)
+#endif
+
+static void x11_setpaletterange(ui_palette p, int s, int e)
+{
+ xsetpaletterange(d, p, s, e);
+}
+
+static int x11_set_color(int r, int g, int b, int init)
+{
+ if (init)
+ xfree_colors(d);
+ return (xalloc_color(d, r * 256, g * 256, b * 256, init));
+}
+
+static void x11_print(int x, int y, CONST char *text)
+{
+ xmoveto(d, x, y + x11_driver.textheight - 2);
+ xouttext(d, text);
+
+}
+
+static void x11_flush(void)
+{
+ XFlush(d->display);
+}
+
+static int display;
+static int flipped = 0;
+static void x11_display(void)
+{
+ XFlush(d->display);
+#ifdef MITSHM
+ if (d->SharedMemFlag) {
+ if (busy) {
+ display = 1;
+ return;
+ }
+ busy++;
+ display = 0;
+ }
+#endif
+ if (Xsync)
+ XSync(d->display, 0);
+ if (flipped)
+ xflip_buffers(d), flipped = 0;
+ draw_screen(d);
+#ifdef MITSHM
+ if (d->SharedMemFlag) {
+ XSync(d->display, 0);
+ }
+#endif
+}
+
+static void x11_flip_buffers(void)
+{
+ flipped ^= 1;
+}
+
+static void x11_free_buffers(char *b1, char *b2)
+{
+ if (allocated) {
+ XSync(d->display, 0);
+ allocated = 0;
+ free_image(d);
+ }
+}
+
+static int x11_alloc_buffers(char **b1, char **b2)
+{
+ if (!allocated) {
+ XSync(d->display, 0);
+ allocated = 1;
+ if (!alloc_image(d)) {
+ return (0);
+ }
+ xflip_buffers(d);
+ }
+ *b1 = d->vbuff;
+ *b2 = d->back;
+ flipped = 0;
+#if 0
+ if (d->SharedMemFlag) {
+ x11_driver.flags |= UI_KEEP_BUFFER;
+ }
+#endif
+ return (d->linewidth);
+}
+
+static void x11_getsize(int *w, int *h)
+{
+ XSync(d->display, 0);
+ xupdate_size(d);
+ *w = d->width;
+ *h = d->height;
+}
+
+static void x11_processevents(int wait, int *mx, int *my, int *mb, int *k)
+{
+ static int mousex = 100, mousey = 0;
+ static int iflag = 0;
+ static unsigned int mousebuttons = 0;
+ static int resized;
+ XEvent ev;
+
+
+ if (XPending(d->display) || busy >= 2 || wait) {
+ do {
+ XNextEvent(d->display, &ev);
+ switch (ev.type) {
+ case ClientMessage:
+ if ((int) ev.xclient.format == 32
+ && ev.xclient.data.l[0] == wmDeleteWindow)
+ ui_quit();
+ break;
+ case ButtonRelease:
+ mousex = ev.xbutton.x;
+ mousey = ev.xbutton.y;
+ switch (ev.xbutton.button) {
+ case 1:
+ mousebuttons &= ~BUTTON1;
+ break;
+ case 2:
+ mousebuttons &= ~BUTTON2;
+ break;
+ case 3:
+ mousebuttons &= ~BUTTON3;
+ break;
+ }
+ break;
+ case ButtonPress:
+ mousex = ev.xbutton.x;
+ mousey = ev.xbutton.y;
+ if (!
+ (mousex < 0 || mousey < 0 || mousex > (int) d->width
+ || mousey > (int) d->height)) {
+ switch (ev.xbutton.button) {
+ case 1:
+ mousebuttons |= BUTTON1;
+ break;
+ case 2:
+ mousebuttons |= BUTTON2;
+ break;
+ case 3:
+ mousebuttons |= BUTTON3;
+ break;
+ }
+ }
+ break;
+ case MotionNotify:
+ mousex = ev.xmotion.x;
+ mousey = ev.xmotion.y;
+ mousebuttons =
+ ev.xmotion.state & (BUTTON1 | BUTTON2 | BUTTON3);
+ break;
+ case Expose:
+ if (resized)
+ break;
+ x11_display();
+ break;
+ case ResizeRequest:
+ XResizeWindow(d->display, d->window,
+ ev.xresizerequest.width,
+ ev.xresizerequest.height);
+ XResizeWindow(d->display, d->parent_window,
+ ev.xresizerequest.width,
+ ev.xresizerequest.height);
+ XSync(d->display, 0);
+ resized = 2;
+ ui_resize();
+ resized = 0;
+ break;
+
+ case ConfigureNotify:
+ {
+ int oldw = d->width, oldh = d->height;
+ XSync(d->display, 0);
+ xupdate_size(d);
+ if ((int) d->width != oldw || (int) d->height != oldh) {
+ resized = 2;
+ ui_resize();
+ resized = 0;
+ }
+ }
+ break;
+ case KeyRelease:
+ {
+ switch (XLookupKeysym(&ev.xkey, 0)) {
+ case XK_Left:
+ iflag &= ~1;
+ break;
+ case XK_Right:
+ iflag &= ~2;
+ break;
+ case XK_Up:
+ iflag &= ~4;
+ break;
+ case XK_Down:
+ iflag &= ~8;
+ break;
+ }
+ }
+ break;
+ case KeyPress:
+ {
+ KeySym ksym;
+ switch (ksym = XLookupKeysym(&ev.xkey, 0)) {
+ case XK_Left:
+ iflag |= 1;
+ ui_key(UIKEY_LEFT);
+ break;
+ case XK_Right:
+ iflag |= 2;
+ ui_key(UIKEY_RIGHT);
+ break;
+ case XK_Up:
+ iflag |= 4;
+ ui_key(UIKEY_UP);
+ break;
+ case XK_Down:
+ iflag |= 8;
+ ui_key(UIKEY_DOWN);
+ break;
+#ifdef XK_Page_Up
+ case XK_Page_Up:
+ iflag |= 4;
+ ui_key(UIKEY_PGUP);
+ break;
+ case XK_Page_Down:
+ iflag |= 8;
+ ui_key(UIKEY_PGDOWN);
+ break;
+#endif
+ case XK_Escape:
+ ui_key(UIKEY_ESC);
+ case XK_BackSpace:
+ ui_key(UIKEY_BACKSPACE);
+ break; /* This statement was missing.
+ I'm not sure if this is needed
+ because new X drivers handle
+ UIKEY_BACKSPACE better or
+ double backspaces were problems
+ in earlier versions of XaoS, too.
+ -- Zoltan, 2004-10-30 */
+ default:
+ {
+ CONST char *name;
+ char buff[256];
+ if (ksym == XK_F1)
+ name = "h";
+ else {
+ name = buff;
+ buff[XLookupString
+ (&ev.xkey, buff, 256, &ksym, NULL)] =
+ 0;
+ }
+ if (strlen(name) == 1) {
+ if (ui_key(*name) == 2) {
+ return;
+ }
+ }
+ }
+ }
+ }
+ break;
+ default:
+#ifdef MITSHM
+ if (ev.xany.type == Completion) {
+ busy--;
+ if (display)
+ x11_display();
+ }
+#endif
+ break;
+ }
+ }
+ while (busy >= 2 || /*XEventsQueued (d->display, QueuedAlready) */
+ XPending(d->display));
+ }
+ *mx = mousex;
+ *my = mousey;
+ *mb = mousebuttons;
+ *k = iflag;
+}
+
+/*static int defined; */
+static void x11_cursor(int mode)
+{
+ /*if(defined)
+ XUndefineCursor(d->display,d->window),defined=0; */
+ switch (mode) {
+ case NORMALMOUSE:
+ XDefineCursor(d->display, d->window, normal);
+ /*defined=1; */
+ break;
+ case WAITMOUSE:
+ XDefineCursor(d->display, d->window, xwait);
+ /*defined=1; */
+ break;
+ case REPLAYMOUSE:
+ XDefineCursor(d->display, d->window, replay);
+ /*defined=1; */
+ break;
+ }
+ XFlush(d->display);
+}
+
+#if 0
+static Atom atom;
+void x11_copy()
+{
+ if (slection)
+ free(selection), selection = NULL;
+ selection = ui_getpos();
+ atom = XInternAtom(d->display, "image/x-xaos.position", False);
+ printf("%i\n", atom);
+ XSetSelectionOwner(d->display, atom, d->window, CurrentTime);
+}
+#endif
+static int x11_init(void)
+{
+ if (xparams.windowid != -1)
+ xparams.rootwindow = xparams.fullscreen = 0;
+ if (xparams.fullscreen || xparams.rootwindow)
+ sharedcolormap = 1; /*private colormap is broken in fullscreen
+ mode (at least at my X) */
+ xparams.privatecolormap = !sharedcolormap;
+ if (xparams.display == NULL) { /*solaris stuff */
+ xparams.display = getenv("DISPLAY");
+ }
+ if (size != NULL) {
+ int x, y;
+ sscanf(size, "%ix%i", &x, &y);
+ if (x < 0)
+ x = XSIZE;
+ if (y < 0)
+ y = YSIZE;
+ d = xalloc_display("XaoS", x, y, &xparams);
+ } else
+ d = xalloc_display("XaoS", XSIZE, YSIZE, &xparams);
+ if (d == NULL)
+ return 0;
+ /*normal=XCreateFontCursor(d->display,XC_arrow); */
+ normal = XCreateFontCursor(d->display, XC_left_ptr);
+ xwait = XCreateFontCursor(d->display, XC_watch);
+ replay = XCreateFontCursor(d->display, XC_dot);
+ if (d->truecolor || d->privatecolormap)
+ x11_driver.flags &= ~RANDOM_PALETTE_SIZE;
+ if (!alloc_image(d)) {
+ xfree_display(d);
+ return (0);
+ }
+ allocated = 1;
+ switch (d->visual->class) {
+ case StaticGray:
+ if (d->depth == 1) {
+ if (BitmapBitOrder(d->display) == LSBFirst)
+ if (WhitePixel(d->display, d->screen))
+ x11_driver.imagetype = UI_LBITMAP;
+ else
+ x11_driver.imagetype = UI_LIBITMAP;
+ else if (WhitePixel(d->display, d->screen))
+ x11_driver.imagetype = UI_MBITMAP;
+ else
+ x11_driver.imagetype = UI_MIBITMAP;
+ } else {
+ /*Warning! this is untested. I believe it works */
+ /*x11_driver.set_color = x11_set_color; */
+ x11_driver.palettestart = 0;
+ x11_driver.paletteend = 256;
+ x11_driver.maxentries = 256;
+ x11_driver.imagetype = UI_GRAYSCALE;
+ }
+ break;
+ case StaticColor:
+ smallcolor:
+ {
+ int end = 256;
+ int start = 0;
+ int entries = d->visual->map_entries;
+ if (d->visual->class == TrueColor) {
+ entries = (int) (d->image[0]->red_mask |
+ d->image[0]->green_mask |
+ d->image[0]->blue_mask);
+ }
+ x11_driver.imagetype = UI_FIXEDCOLOR;
+ if (end > entries)
+ end = entries;
+ if (end < 64)
+ start = 0;
+ x11_driver.set_range = x11_setpaletterange;
+ x11_driver.palettestart = start;
+ x11_driver.paletteend = end;
+ x11_driver.maxentries = end - start;
+ }
+ break;
+ case PseudoColor:
+ case GrayScale:
+ if (d->privatecolormap) {
+ int end = 256;
+ int start = 16;
+ if (end > d->visual->map_entries)
+ end = d->visual->map_entries;
+ if (end < 64)
+ start = 0;
+ x11_driver.set_range = x11_setpaletterange;
+ x11_driver.palettestart = start;
+ x11_driver.paletteend = end;
+ x11_driver.maxentries = end - start;
+ } else {
+ int end = 256;
+ if (end > d->visual->map_entries)
+ end = d->visual->map_entries;
+ x11_driver.set_color = x11_set_color, x11_driver.flags |=
+ RANDOM_PALETTE_SIZE;
+ x11_driver.palettestart = 0;
+ x11_driver.paletteend = end;
+ x11_driver.maxentries = end;
+ }
+ break;
+ case TrueColor:
+ x11_driver.rmask = d->image[0]->red_mask;
+ x11_driver.gmask = d->image[0]->green_mask;
+ x11_driver.bmask = d->image[0]->blue_mask;
+ {
+ unsigned char c[4];
+ int order = MSBFirst;
+ *(unsigned short *) c = 0xff;
+ if (c[0] == (unsigned char) 0xff)
+ order = LSBFirst;
+ if (order != d->image[0]->byte_order) {
+ int shift = 32 - d->image[0]->bits_per_pixel;
+#define SWAPE(c) (((c&0xffU)<<24)|((c&0xff00U)<<8)|((c&0xff0000U)>>8)|((c&0xff000000U)>>24))
+ x11_driver.rmask = SWAPE(x11_driver.rmask) >> shift;
+ x11_driver.gmask = SWAPE(x11_driver.gmask) >> shift;
+ x11_driver.bmask = SWAPE(x11_driver.bmask) >> shift;
+ }
+ }
+ switch (d->image[0]->bits_per_pixel) {
+ case 8:
+ goto smallcolor;
+ case 16:
+ x11_driver.imagetype = UI_TRUECOLOR16;
+ break;
+ case 24:
+ x11_driver.imagetype = UI_TRUECOLOR24;
+ break;
+ case 32:
+ x11_driver.imagetype = UI_TRUECOLOR;
+ break;
+ default:
+ printf("Fatal error:unsupported bits per pixel!\n");
+ }
+ }
+ x11_driver.maxwidth = XDisplayWidth(d->display, d->screen);
+ x11_driver.maxheight = XDisplayHeight(d->display, d->screen);
+ x11_driver.width =
+ ((double) ((unsigned int) XDisplayWidthMM(d->display, d->screen)))
+ / x11_driver.maxwidth / 10.0;
+ x11_driver.height =
+ ((double) ((unsigned int) XDisplayHeightMM(d->display, d->screen)))
+ / x11_driver.maxheight / 10.0;
+ x11_driver.textheight = xsetfont(d, "fixed");
+ x11_driver.textwidth =
+ d->font_struct->max_bounds.rbearing -
+ d->font_struct->min_bounds.lbearing;
+#ifdef MITSHM
+ Completion = XShmGetEventBase(d->display) + ShmCompletion;
+#endif
+ if (d->privatecolormap) {
+ x11_driver.flags |= PALETTE_ROTATION | ROTATE_INSIDE_CALCULATION;
+ }
+ return (1);
+}
+
+static void x11_uninitialise(void)
+{
+#if 0
+ if (selection)
+ free(selection), selection = NULL;
+#endif
+ xfree_colors(d);
+ xfree_display(d);
+}
+
+static void x11_getmouse(int *x, int *y, int *b)
+{
+ int rootx, rooty;
+ Window rootreturn, childreturn;
+ XQueryPointer(d->display, d->window,
+ &rootreturn, &childreturn,
+ &rootx, &rooty, x, y, (unsigned int *) b);
+}
+
+static CONST struct params params[] = {
+ {"", P_HELP, NULL, "X11 driver options:"},
+ {"-display", P_STRING, &xparams.display, "Select display"},
+ {"-size", P_STRING, &size, "Select size of window (WIDTHxHEIGHT)."},
+ {"-sync", P_SWITCH, &Xsync,
+ "Generate sync signals before looking for events. This\n\t\t\thelps on old and buggy HP-UX X servers."},
+ {"-shared", P_SWITCH, &sharedcolormap,
+ "Use shared colormap on pseudocolor display."},
+ {"-usedefault", P_SWITCH, &xparams.usedefault,
+ "Use default visual if autodetection causes troubles."},
+ {"-nomitshm", P_SWITCH, &xparams.nomitshm,
+ "Disable MITSHM extension."},
+ {"-fullscreen", P_SWITCH, &xparams.fullscreen,
+ "Enable fullscreen mode."},
+ {"-windowid", P_NUMBER, &xparams.windowid, "Use selected window."},
+ {"-window-id", P_NUMBER, &xparams.windowid, "Use selected window."},
+ {"-root", P_SWITCH, &xparams.rootwindow, "Use root window."},
+ {NULL, 0, NULL, NULL}
+};
+
+struct ui_driver x11_driver = {
+ "X11",
+ x11_init,
+ x11_getsize,
+ x11_processevents,
+ x11_getmouse,
+ x11_uninitialise,
+ NULL,
+ NULL,
+ x11_print,
+ x11_display,
+ x11_alloc_buffers,
+ x11_free_buffers,
+ x11_flip_buffers,
+ x11_cursor,
+ x11_flush,
+ 8,
+ 8,
+ params,
+ RESOLUTION | PIXELSIZE | NOFLUSHDISPLAY /*| UPDATE_AFTER_RESIZE */ ,
+ 0.0, 0.0,
+ 0, 0,
+ UI_C256,
+ 16, 254, 254 - 16
+};
+
+#endif
diff --git a/src/ui/ui-drv/x11/xlib.c b/src/ui/ui-drv/x11/xlib.c
new file mode 100644
index 0000000..87308b8
--- /dev/null
+++ b/src/ui/ui-drv/x11/xlib.c
@@ -0,0 +1,663 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include "aconfig.h"
+#ifdef X11_DRIVER
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <config.h>
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#include "xlib.h"
+#ifdef AMIGA
+#define XFlush(x) while(0)
+#endif
+
+#define chkalloc(n) if (!n) fprintf(stderr, "out of memory\n"), exit(-1)
+
+extern int prog_argc;
+extern char **prog_argv;
+Atom wmDeleteWindow;
+
+int xupdate_size(xdisplay * d)
+{
+ int tmp;
+ Window wtmp;
+ unsigned int width = d->width, height = d->height;
+ XSync(d->display, False);
+ XGetGeometry(d->display, d->window, &wtmp, &tmp, &tmp, &d->width,
+ &d->height, (unsigned int *) &tmp, (unsigned int *) &tmp);
+ if (d->width != width || d->height != height)
+ return 1;
+ return 0;
+}
+
+void xflip_buffers(xdisplay * d)
+{
+ d->back = d->vbuffs[d->current];
+ d->current ^= 1;
+ d->vbuff = d->vbuffs[d->current];
+}
+
+
+void draw_screen(xdisplay * d)
+{
+#ifdef MITSHM
+ if (d->SharedMemFlag) {
+ XShmPutImage(d->display, d->window, d->gc, d->image[d->current], 0,
+ 0, 0, 0, d->bwidth, d->bheight, True);
+ } else
+#endif
+ XPutImage(d->display, d->window, d->gc, d->image[d->current], 0, 0,
+ 0, 0, d->bwidth, d->bheight);
+ /*XFlush(d->display); *//*gives small rest to X but degrades perofrmance
+ too much */
+ d->screen_changed = 0;
+}
+
+#ifdef MITSHM
+int alloc_shm_image(xdisplay * new)
+{
+ register char *ptr;
+ int temp, size = 0, i;
+ ptr = DisplayString(new->display);
+ if (!ptr || (*ptr == ':') || !strncmp(ptr, "localhost:", 10) ||
+ !strncmp(ptr, "unix:", 5) || !strncmp(ptr, "local:", 6)) {
+ new->SharedMemOption =
+ XQueryExtension(new->display, "MIT-SHM", &temp, &temp, &temp);
+ } else {
+ new->SharedMemOption = False;
+ return 0;
+ }
+ new->SharedMemFlag = False;
+
+ if (new->SharedMemFlag) {
+ XShmDetach(new->display, &new->xshminfo[0]);
+ XShmDetach(new->display, &new->xshminfo[1]);
+ new->image[0]->data = (char *) NULL;
+ new->image[1]->data = (char *) NULL;
+ shmdt(new->xshminfo[0].shmaddr);
+ shmdt(new->xshminfo[1].shmaddr);
+ }
+ for (i = 0; i < 2; i++) {
+ if (new->SharedMemOption) {
+ new->SharedMemFlag = False;
+ new->image[i] =
+ XShmCreateImage(new->display, new->visual, new->depth,
+ new->depth == 1 ? XYBitmap : ZPixmap, NULL,
+ &new->xshminfo[i], new->width,
+ new->height);
+ if (new->image[i]) {
+ temp =
+ new->image[i]->bytes_per_line *
+ (new->image[i]->height + 150);
+ new->linewidth = new->image[i]->bytes_per_line;
+ if (temp > size)
+ size = temp;
+ new->xshminfo[i].shmid =
+ shmget(IPC_PRIVATE, size, IPC_CREAT | 0777);
+ if (new->xshminfo[i].shmid != -1) {
+ errno = 0;
+ new->xshminfo[i].shmaddr =
+ (char *) shmat(new->xshminfo[i].shmid, 0, 0);
+ if (!errno) {
+ new->image[i]->data = new->xshminfo[i].shmaddr;
+ new->data[i] = new->vbuffs[i] =
+ (char *) new->image[i]->data;
+ new->xshminfo[i].readOnly = True;
+
+ new->SharedMemFlag =
+ XShmAttach(new->display, &new->xshminfo[i]);
+ XSync(new->display, False);
+ if (!new->SharedMemFlag) {
+ XDestroyImage(new->image[i]);
+ new->image[i] = (XImage *) NULL;
+ new->SharedMemFlag = 0;
+ return 0;
+ }
+ }
+ /* Always Destroy Shared Memory Ident */
+ shmctl(new->xshminfo[i].shmid, IPC_RMID, 0);
+ }
+ if (!new->SharedMemFlag) {
+ XDestroyImage(new->image[i]);
+ new->image[i] = (XImage *) NULL;
+ new->SharedMemFlag = 0;
+ return 0;
+ }
+ } else {
+ new->SharedMemFlag = 0;
+ return 0;
+ }
+ } else {
+ new->SharedMemFlag = 0;
+ return 0;
+ }
+ }
+ new->current = 0;
+ xflip_buffers(new);
+ return 1;
+}
+
+void free_shm_image(xdisplay * d)
+{
+ if (d->SharedMemFlag) {
+ XDestroyImage(d->image[0]);
+ XDestroyImage(d->image[1]);
+ XShmDetach(d->display, &d->xshminfo[0]);
+ XShmDetach(d->display, &d->xshminfo[1]);
+ shmdt(d->xshminfo[0].shmaddr);
+ shmdt(d->xshminfo[1].shmaddr);
+ }
+}
+
+#endif
+
+int alloc_image(xdisplay * d)
+{
+ int i;
+ d->bwidth = d->width;
+ d->bheight = d->height;
+#ifdef MITSHM
+ if (!d->params->nomitshm && d->depth != 1 && alloc_shm_image(d)) {
+ return 1;
+ }
+#endif
+ for (i = 0; i < 2; i++) {
+
+ d->image[i] =
+ XCreateImage(d->display, d->visual, d->depth,
+ d->depth == 1 ? XYBitmap : ZPixmap, 0, NULL,
+ d->width, d->height, 32, 0);
+ if (d->image[i] == NULL) {
+ printf("Out of memory for image..exiting\n");
+ exit(-1);
+ }
+ d->image[i]->data =
+ malloc(d->image[i]->bytes_per_line * d->height);
+ if (d->image[i]->data == NULL) {
+ printf("Out of memory for image buffers..exiting\n");
+ exit(-1);
+ }
+ {
+ unsigned char c[4];
+ int byteexact = 0;
+ *(unsigned short *) c = 0xff;
+ if ((!(d->image[i]->red_mask & ~0xffU)
+ || !(d->image[i]->red_mask & ~0xff00U)
+ || !(d->image[i]->red_mask & ~0xff0000U)
+ || !(d->image[i]->red_mask & ~0xff000000U))
+ && (!(d->image[i]->green_mask & ~0xffU)
+ || !(d->image[i]->green_mask & ~0xff00U)
+ || !(d->image[i]->green_mask & ~0xff0000U)
+ || !(d->image[i]->green_mask & ~0xff000000U))
+ && (!(d->image[i]->blue_mask & ~0xffU)
+ || !(d->image[i]->blue_mask & ~0xff00U)
+ || !(d->image[i]->blue_mask & ~0xff0000U)
+ || !(d->image[i]->blue_mask & ~0xff000000U)))
+ byteexact = 1;
+ if (!byteexact) {
+ /*Make endianity correct */
+ if (c[0] == (unsigned char) 0xff) {
+ if (d->image[i]->byte_order != LSBFirst) {
+ d->image[i]->byte_order = LSBFirst;
+ /*XInitImage(d->image[i]); */
+ }
+ } else {
+ if (d->image[i]->byte_order != MSBFirst) {
+ d->image[i]->byte_order = MSBFirst;
+ /*XInitImage(d->image[i]); */
+ }
+ }
+ }
+ }
+ d->data[i] = d->vbuffs[i] = (char *) d->image[i]->data;
+ d->linewidth = d->image[i]->bytes_per_line;
+ }
+ xflip_buffers(d);
+ return 1;
+}
+
+void free_image(xdisplay * d)
+{
+#ifdef MITSHM
+ if (d->SharedMemFlag) {
+ free_shm_image(d);
+ return;
+ }
+#endif
+ XDestroyImage(d->image[0]);
+ XDestroyImage(d->image[1]);
+}
+
+#define MAX(x,y) ((x)>(y)?(x):(y))
+
+
+xdisplay *xalloc_display(CONST char *s, int x, int y, xlibparam * params)
+{
+ xdisplay *new;
+ Visual *defaultvisual;
+ XVisualInfo vis;
+ int found;
+ int i;
+
+ XClassHint classHint;
+ XWMHints *hints;
+ char **faked_argv;
+
+ new = (xdisplay *) calloc(sizeof(xdisplay), 1);
+ chkalloc(new);
+ new->display = XOpenDisplay(params->display);
+ if (!new->display) {
+ free((void *) new);
+ return NULL;
+ }
+ new->screen = DefaultScreen(new->display);
+
+ new->attributes =
+ (XSetWindowAttributes *) malloc(sizeof(XSetWindowAttributes));
+ chkalloc(new->attributes);
+ new->attributes->background_pixel =
+ BlackPixel(new->display, new->screen);
+ new->attributes->border_pixel = BlackPixel(new->display, new->screen);
+ new->attributes->event_mask = ButtonPressMask | StructureNotifyMask |
+ ButtonReleaseMask | PointerMotionMask | KeyPressMask |
+ ExposureMask | KeyReleaseMask;
+
+
+ new->attr_mask = CWBackPixel | CWEventMask;
+ if (params->fullscreen || params->rootwindow) {
+ new->attributes->override_redirect = True;
+ new->attr_mask |= CWOverrideRedirect;
+ } else
+ new->attr_mask |= CWBorderPixel;
+ new->class = InputOutput;
+ new->xcolor.n = 0;
+ new->parent_window = RootWindow(new->display, new->screen);
+ defaultvisual = DefaultVisual(new->display, new->screen);
+ new->params = params;
+
+ found = 0;
+ for (i = 31; i > 13 && !found; i--)
+ if (XMatchVisualInfo
+ (new->display, new->screen, i, TrueColor, &vis)) {
+ found = 1;
+ }
+ if (defaultvisual->class != StaticGray
+ && defaultvisual->class != GrayScale) {
+ for (i = 8; i && !found; i--)
+ if (XMatchVisualInfo
+ (new->display, new->screen, i, PseudoColor, &vis)) {
+ found = 1;
+ }
+ for (i = 8; i && !found; i--)
+ if (XMatchVisualInfo
+ (new->display, new->screen, i, StaticColor, &vis)) {
+ found = 1;
+ }
+ for (i = 8; i && !found; i--)
+ if (XMatchVisualInfo
+ (new->display, new->screen, i, TrueColor, &vis)) {
+ found = 1;
+ }
+ }
+ if (!found
+ && XMatchVisualInfo(new->display, new->screen, 8, StaticGray,
+ &vis)) {
+ found = 1;
+ }
+ for (i = 8; i && !found; i--)
+ if (XMatchVisualInfo
+ (new->display, new->screen, i, GrayScale, &vis)) {
+ found = 1;
+ }
+ if (!found
+ && XMatchVisualInfo(new->display, new->screen, 1, StaticGray,
+ &vis)) {
+ found = 8;
+ }
+ if (!found || params->fullscreen || params->rootwindow) {
+ new->visual = defaultvisual;
+ new->depth = DefaultDepth(new->display, new->screen);
+ } else {
+ new->visual = vis.visual;
+ new->depth = vis.depth;
+ }
+
+ switch (new->visual->class) {
+ case StaticColor:
+ case StaticGray:
+ smallcolor:
+ new->truecolor = 0;
+ new->fixedcolormap = 1;
+ break;
+ case PseudoColor:
+ case GrayScale:
+ if (new->depth <= 8) {
+ new->truecolor = 0;
+ new->fixedcolormap = 0;
+ } else {
+ goto visuals;
+ }
+ break;
+ case TrueColor:
+ new->truecolor = 1;
+ new->fixedcolormap = 1;
+ if (new->depth <= 8)
+ goto smallcolor;
+ if (new->depth > 32) {
+ goto visuals;
+ }
+ break;
+ default:
+ visuals:
+ printf
+ ("Unusuported visual. Please contact authors. Maybe it will be supported in next release:)\n");
+ return (NULL);
+ }
+ new->privatecolormap = params->privatecolormap;
+ new->attributes->colormap = new->defaultcolormap =
+ DefaultColormap(new->display, new->screen);
+ if (new->visual->visualid != defaultvisual->visualid) {
+ new->privatecolormap = 1;
+ }
+ if ( /*!new->fixedcolormap && */ new->privatecolormap) {
+ unsigned long pixels[256];
+ int i;
+ new->attributes->colormap =
+ XCreateColormap(new->display,
+ RootWindow(new->display, new->screen),
+ new->visual, AllocNone);
+ if (new->visual->visualid == defaultvisual->visualid
+ && new->visual->class == PseudoColor) {
+ XAllocColorCells(new->display, new->attributes->colormap, 1, 0,
+ 0, pixels, MAX(new->visual->map_entries,
+ 256));
+ for (i = 0; i < 16; i++) {
+ new->xcolor.c[i].pixel = pixels[i];
+ }
+ XQueryColors(new->display, new->defaultcolormap, new->xcolor.c,
+ 16);
+ XStoreColors(new->display, new->attributes->colormap,
+ new->xcolor.c, 16);
+ }
+ }
+ new->colormap = new->attributes->colormap;
+ new->attr_mask |= CWColormap;
+
+ new->window_name = (char *) s;
+ new->height = y;
+ new->width = x;
+ new->border_width = 2;
+ new->lastx = 0;
+ new->lasty = 0;
+ new->font_struct = (XFontStruct *) NULL;
+
+ if (params->fullscreen || params->rootwindow) {
+ Window wtmp;
+ int tmp;
+ /* Get size of the root window */
+ XGetGeometry(new->display, RootWindow(new->display, new->screen), &wtmp, &tmp, &tmp, &new->width, &new->height, (unsigned int *) &tmp, /* border width */
+ (unsigned int *) &tmp); /* depth */
+ new->border_width = 0;
+ }
+
+ if (params->windowid != -1) {
+ Window wtmp;
+ int tmp;
+
+ new->parent_window = params->windowid;
+ XGetGeometry(new->display, new->parent_window, &wtmp, &tmp, &tmp, &new->width, &new->height, (unsigned int *) &tmp, /* border width */
+ (unsigned int *) &tmp); /* depth */
+ XSelectInput(new->display, new->parent_window, ResizeRedirectMask);
+ }
+ if (params->rootwindow)
+ new->window = RootWindow(new->display, new->screen);
+ else
+ new->window = XCreateWindow(new->display, new->parent_window, 0, 0,
+ new->width, new->height,
+ new->border_width, new->depth,
+ new->class, new->visual,
+ new->attr_mask, new->attributes);
+
+ classHint.res_name = (char *) "xaos";
+ classHint.res_class = (char *) "XaoS";
+ hints = XAllocWMHints();
+ hints->initial_state = NormalState;
+ hints->window_group = new->window;
+ hints->flags = (WindowGroupHint | StateHint);
+
+ {
+ int fake = 0;
+
+ if (prog_argc < 2)
+ fake = 1;
+
+ if (fake == 0)
+ if (strcmp(prog_argv[prog_argc - 2], "-driver") &&
+ strcmp(prog_argv[prog_argc - 1], "x11"))
+ fake = 1;
+
+ if (fake) {
+ int i;
+ faked_argv =
+ (char **) malloc((prog_argc + 2) * sizeof(char *));
+ for (i = 0; i < prog_argc; i++)
+ faked_argv[i] = prog_argv[i];
+ faked_argv[prog_argc] = (char *) "-driver";
+ faked_argv[prog_argc + 1] = (char *) "x11";
+
+ XSetWMProperties(new->display, new->window, NULL, NULL,
+ faked_argv, prog_argc + 2, NULL, hints,
+ &classHint);
+
+ free(faked_argv);
+ } else
+ XSetWMProperties(new->display, new->window, NULL, NULL,
+ prog_argv, prog_argc, NULL, hints,
+ &classHint);
+ }
+ XSetIconName(new->display, new->window, "xaos");
+
+ wmDeleteWindow = XInternAtom(new->display, "WM_DELETE_WINDOW", False);
+ XSetWMProtocols(new->display, new->window, &wmDeleteWindow, 1);
+
+ new->gc = XCreateGC(new->display, new->window, 0L, &(new->xgcvalues));
+ XSetBackground(new->display, new->gc,
+ BlackPixel(new->display, new->screen));
+ XSetForeground(new->display, new->gc,
+ WhitePixel(new->display, new->screen));
+ XStoreName(new->display, new->window, new->window_name);
+ XMapWindow(new->display, new->window);
+ if (params->fullscreen || params->rootwindow)
+ XSetInputFocus(new->display, new->window, RevertToNone,
+ CurrentTime);
+
+ return (new);
+}
+
+void xsetcolor(xdisplay * d, int col)
+{
+ switch (col) {
+ case 0:
+ XSetForeground(d->display, d->gc,
+ BlackPixel(d->display, d->screen));
+ break;
+ case 1:
+ XSetForeground(d->display, d->gc,
+ WhitePixel(d->display, d->screen));
+ break;
+ default:
+ if ((col - 2) > d->xcolor.n) {
+ fprintf(stderr, "color error\n");
+ exit(-1);
+ }
+ XSetForeground(d->display, d->gc, d->xcolor.c[col - 2].pixel);
+ break;
+ }
+}
+
+void xsetpaletterange(xdisplay * d, ui_palette c, int start, int end)
+{
+ int i;
+ if (d->visual->class == StaticColor || d->visual->class == TrueColor) {
+ for (i = start; i < end; i++)
+ d->xcolor.c[i].pixel = i;
+ XQueryColors(d->display, d->colormap, d->xcolor.c + start,
+ end - start);
+ for (i = start; i < end; i++) {
+ c[i - start][0] = d->xcolor.c[i].red / 256;
+ c[i - start][1] = d->xcolor.c[i].green / 256;
+ c[i - start][2] = d->xcolor.c[i].blue / 256;
+ }
+
+ } else {
+ for (i = start; i < end; i++) {
+ d->xcolor.c[i].pixel = i;
+ d->xcolor.c[i].flags = DoRed | DoGreen | DoBlue;
+ d->xcolor.c[i].red = c[i - start][0] * 256;
+ d->xcolor.c[i].green = c[i - start][1] * 256;
+ d->xcolor.c[i].blue = c[i - start][2] * 256;
+ }
+ XStoreColors(d->display, d->colormap, d->xcolor.c + start,
+ end - start);
+ }
+}
+
+int xalloc_color(xdisplay * d, int r, int g, int b, int readwrite)
+{
+ d->xcolor.n++;
+ d->xcolor.c[d->xcolor.n - 1].flags = DoRed | DoGreen | DoBlue;
+ d->xcolor.c[d->xcolor.n - 1].red = r;
+ d->xcolor.c[d->xcolor.n - 1].green = g;
+ d->xcolor.c[d->xcolor.n - 1].blue = b;
+ d->xcolor.c[d->xcolor.n - 1].pixel = d->xcolor.n - 1;
+ if ((readwrite && !d->fixedcolormap) || d->privatecolormap) {
+ unsigned long cell;
+ if (d->privatecolormap) {
+ cell = d->xcolor.c[d->xcolor.n - 1].pixel += 16;
+ if ((int) d->xcolor.c[d->xcolor.n - 1].pixel >=
+ d->visual->map_entries) {
+ d->xcolor.n--;
+ return (-1);
+ }
+ } else {
+ if (!XAllocColorCells
+ (d->display, d->colormap, 0, 0, 0, &cell, 1)) {
+ d->xcolor.n--;
+ if (d->xcolor.n <= 32)
+ printf
+ ("Colormap is too full! close some colorfull applications or use -private\n");
+ return (-1);
+ }
+ d->xcolor.c[d->xcolor.n - 1].pixel = cell;
+ }
+ XStoreColor(d->display, d->colormap,
+ &(d->xcolor.c[d->xcolor.n - 1]));
+ return ((int) cell);
+ }
+ if (!XAllocColor
+ (d->display, d->colormap, &(d->xcolor.c[d->xcolor.n - 1]))) {
+ d->xcolor.n--;
+ if (d->xcolor.n <= 32)
+ printf
+ ("Colormap is too full! close some colorfull aplications or use -private\n");
+ return (-1);
+ }
+ d->pixels[d->xcolor.n - 1] = d->xcolor.c[d->xcolor.n - 1].pixel;
+ return (d->depth !=
+ 8 ? d->xcolor.n - 1 : (int) d->xcolor.c[d->xcolor.n -
+ 1].pixel);
+}
+
+void xfree_colors(xdisplay * d)
+{
+ unsigned long pixels[256];
+ int i;
+ for (i = 0; i < d->xcolor.n; i++)
+ pixels[i] = d->xcolor.c[i].pixel;
+ if (!d->privatecolormap)
+ XFreeColors(d->display, d->colormap, pixels, d->xcolor.n, 0);
+ d->xcolor.n = 0;
+}
+
+void xfree_display(xdisplay * d)
+{
+ XSync(d->display, 0);
+ if (d->font_struct != (XFontStruct *) NULL) {
+ XFreeFont(d->display, d->font_struct);
+ }
+ XUnmapWindow(d->display, d->window);
+ XDestroyWindow(d->display, d->window);
+ XCloseDisplay(d->display);
+ free((void *) d->attributes);
+ free((void *) d);
+}
+
+void xclear_screen(xdisplay * d)
+{
+ XClearWindow(d->display, d->window);
+ d->screen_changed = 1;
+}
+
+void xmoveto(xdisplay * d, int x, int y)
+{
+ d->lastx = x, d->lasty = y;
+}
+
+int xsetfont(xdisplay * d, CONST char *font_name)
+{
+
+ if (d->font_struct != (XFontStruct *) NULL) {
+ XFreeFont(d->display, d->font_struct);
+ }
+ d->font_struct = XLoadQueryFont(d->display, font_name);
+ XSetFont(d->display, d->gc, d->font_struct->fid);
+ if (!d->font_struct) {
+ fprintf(stderr, "could not load font: %s\n", font_name);
+ exit(-1);
+ }
+ return (d->font_struct->max_bounds.ascent +
+ d->font_struct->max_bounds.descent);
+}
+
+void xouttext(xdisplay * d, CONST char *string)
+{
+ int sz;
+
+ sz = (int) strlen(string);
+ XDrawImageString(d->display, d->window, d->gc, d->lastx, d->lasty,
+ string, sz);
+}
+
+void xresize(xdisplay * d, XEvent * ev)
+{
+ XSync(d->display, False);
+ d->width = ev->xconfigure.width;
+ d->height = ev->xconfigure.height;
+}
+
+#endif
diff --git a/src/ui/ui-drv/x11/xlib.h b/src/ui/ui-drv/x11/xlib.h
new file mode 100644
index 0000000..485a032
--- /dev/null
+++ b/src/ui/ui-drv/x11/xlib.h
@@ -0,0 +1,139 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifndef XAOS_X11_H
+#define XAOS_X11_H
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/keysym.h>
+#include <X11/keysymdef.h>
+#include "config.h"
+#include "ui.h"
+#ifdef MITSHM
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
+#include <X11/extensions/XShm.h>
+#endif /* MITSHM */
+
+typedef struct {
+ int n;
+ XColor c[256];
+} xcol_t;
+
+typedef struct {
+ int privatecolormap;
+ int usedefault;
+ int nomitshm;
+ int fullscreen;
+ char *display;
+ int windowid;
+ int rootwindow;
+} xlibparam;
+
+typedef struct {
+ Colormap colormap;
+ Colormap defaultcolormap;
+ int fixedcolormap;
+ int privatecolormap;
+ xlibparam *params;
+ Display *display;
+ Window parent_window;
+ Window window;
+ unsigned int width, height;
+ unsigned int bwidth, bheight;
+ unsigned int border_width;
+ unsigned long background;
+ int depth;
+ unsigned int class;
+ Visual *visual;
+ unsigned long valuemask;
+ XSetWindowAttributes *attributes;
+ unsigned long attr_mask;
+ XSizeHints sizehints;
+ int screen;
+ char *window_name;
+ int status;
+ GC gc;
+ XGCValues xgcvalues;
+ xcol_t xcolor;
+ Pixmap pixmap;
+ XFontStruct *font_struct;
+ int screen_changed;
+ int lastx, lasty;
+ int mouse_x, mouse_y;
+ unsigned int mouse_buttons;
+ int current;
+ XImage *image[2];
+#ifdef MITSHM
+ XShmSegmentInfo xshminfo[2];
+ int SharedMemOption;
+ int SharedMemFlag;
+#endif /* MITSHM */
+ unsigned long pixels[256];
+ char *vbuffs[2];
+ char *data[2];
+ char *vbuff;
+ char *back;
+ int truecolor;
+ int linewidth;
+} xdisplay;
+
+void xsetpaletterange(xdisplay * d, ui_palette c, int start, int end);
+extern int alloc_shm_image(xdisplay * d);
+extern void free_shm_image(xdisplay * d);
+extern int alloc_image(xdisplay * d);
+extern void free_image(xdisplay * d);
+extern int xupdate_size(xdisplay * d);
+extern void xflip_buffers(xdisplay * d);
+extern xdisplay *xalloc_display(CONST char *n, int x, int y,
+ xlibparam * p);
+extern void xfree_display(xdisplay * d);
+extern void xsetcolor(xdisplay * d, int col);
+extern int xsetfont(xdisplay * d, CONST char *font_name);
+extern int xalloc_color(xdisplay * d, int r, int g, int b, int readwrite);
+extern void xfree_colors(xdisplay * d);
+extern void xline(xdisplay * d, int x1, int y1, int x2, int y2);
+extern void xmoveto(xdisplay * d, int x, int y);
+extern void xlineto(xdisplay * d, int x, int y);
+extern void xrect(xdisplay * d, int x1, int y1, int x2, int y2);
+extern void xfillrect(xdisplay * d, int x1, int y1, int x2, int y2);
+extern void xarc(xdisplay * d, int x, int y, unsigned int w,
+ unsigned int h, int a1, int a2);
+extern void xfillarc(xdisplay * d, int x, int y, unsigned int w,
+ unsigned int h, int a1, int a2);
+extern void xpoint(xdisplay * d, int x, int y);
+extern void xflush(xdisplay * d);
+extern void xclear_screen(xdisplay * d);
+extern void xrotate_palette(xdisplay * d, int direction,
+ unsigned char c[3][256], int ncolors);
+extern void draw_screen(xdisplay * d);
+extern void xouttext(xdisplay * d, CONST char *string);
+extern void xresize(xdisplay * d, XEvent * ev);
+extern int xmouse_x(xdisplay * d);
+extern int xmouse_y(xdisplay * d);
+extern void xmouse_update(xdisplay * d);
+extern unsigned int xmouse_buttons(xdisplay * d);
+
+extern Atom wmDeleteWindow;
+
+#endif /* XAOS_X11_H */
diff --git a/src/ui/ui.c b/src/ui/ui.c
new file mode 100644
index 0000000..413d357
--- /dev/null
+++ b/src/ui/ui.c
@@ -0,0 +1,1761 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include <config.h>
+#undef _EFENCE_
+#ifdef _plan9_
+#include <u.h>
+#include <libc.h>
+#include <ctype.h>
+#else
+#include <limits.h>
+#include <aconfig.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+#ifdef __EMX__
+#include <float.h>
+#endif
+#ifdef __EMX__
+#include <sys/types.h>
+#endif
+#ifndef _MAC
+#include <sys/stat.h>
+#endif
+#include <time.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <signal.h>
+#endif
+#include <fconfig.h>
+#ifndef _plan9_
+#include <assert.h>
+#endif
+#include <filter.h>
+#include <ui_helper.h>
+#include <ui.h>
+#include <param.h>
+#include <version.h>
+#include <timers.h>
+#include <plane.h>
+#include <xthread.h>
+#include <xerror.h>
+#include <xmenu.h>
+#include <grlib.h>
+#include <archaccel.h>
+#include "uiint.h"
+#ifdef HAVE_GETTEXT
+#include <libintl.h>
+#include <locale.h>
+#else
+#define gettext(STRING) STRING
+#endif
+
+#ifdef SFFE_USING
+#include "sffe.h"
+#endif
+
+#ifdef DESTICKY
+int euid, egid;
+#endif
+#ifdef DEBUG
+#ifdef __linux__
+#include <malloc.h>
+#define MEMCHECK
+#endif
+#endif
+#define textheight1 (driver->textheight)
+#define textwidth1 (driver->textwidth)
+#define ui_flush() (driver->flush?driver->flush(),1:0)
+#ifdef MEMCHECK
+#define STATUSLINES 13
+#else
+#define STATUSLINES 11
+#endif
+static void ui_mouse(int mousex, int mousey, int mousebuttons,
+ int iterchange);
+#ifndef exit_xaos
+#define exit_xaos(i) exit(i)
+#endif
+
+xio_pathdata configfile;
+static void ui_unregistermenus(void);
+static void ui_mkimages(int, int);
+static void ui_mainloop(int loop);
+
+int prog_argc;
+int err;
+char **prog_argv;
+/*UI state */
+uih_context *uih;
+CONST struct ui_driver *driver;
+char statustext[256];
+int ui_nogui;
+static struct image *image;
+static int statusstart;
+static struct uih_window *statuswindow = NULL;
+static int ministatusstart;
+static struct uih_window *ministatuswindow = NULL;
+static int mouse;
+/* Used by ui_mouse */
+static int dirty = 0;
+static int lastiter;
+static int maxiter;
+static int lastbuttons, lastx, lasty;
+static int callresize = 0;
+static tl_timer *maintimer;
+static tl_timer *arrowtimer;
+static tl_timer *loopt;
+static int todriver = 0;
+
+/* Command line variables */
+static char *defpipe;
+static char *defdriver = NULL;
+static int deflist;
+static int printconfig;
+static int printspeed;
+static int delaytime = 0;
+static int defthreads = 0;
+static int maxframerate = 80;
+static float defscreenwidth = 0.0, defscreenheight = 0.0, defpixelwidth =
+ 0.0, defpixelheight = 0.0;
+
+#ifdef SFFE_USING
+char *sffeform = NULL;
+char *sffeinit = NULL;
+#endif
+
+CONST struct params global_params[] = {
+ {"-delay", P_NUMBER, &delaytime,
+ "Delay screen updates (milliseconds)"},
+ {"-driver", P_STRING, &defdriver, "Select driver"},
+ {"-list", P_SWITCH, &deflist, "List available drivers. Then exit"},
+ {"-config", P_SWITCH, &printconfig, "Print configuration. Then exit"},
+ {"-speedtest", P_SWITCH, &printspeed,
+ "Test speed of calculation loop. Then exit"},
+#ifndef nthreads
+ {"-threads", P_NUMBER, &defthreads,
+ "Set number of threads (CPUs) to use"},
+#else
+ {"-threads", P_NUMBER, &defthreads,
+ "Multiple CPUs unsupported - please recompile XaoS with threads enabled"},
+#endif
+#ifdef COMPILE_PIPE
+ {"-pipe", P_STRING, &defpipe,
+ "Accept commands from pipe (use \"-\" for stdin)"},
+#else
+ {"-pipe", P_STRING, &defpipe,
+ "Pipe input unavailable (recompile XaoS)"},
+#endif
+ {"-maxframerate", P_NUMBER, &maxframerate,
+ "Maximal framerate (0 for unlimited - default)"},
+ {"", P_HELP, NULL,
+ "Screen size options: \n\n Knowledge of exact screen size makes random dot stereogram look better. \n Also is used for choosing correct view area"},
+ {"-screenwidth", P_FLOAT, &defscreenwidth,
+ "exact size of screen in centimeters"},
+ {"-screenheight", P_FLOAT, &defscreenheight,
+ "exact size of screen in centimeters"},
+ {"", P_HELP, NULL,
+ " Use this option in case you use some kind of virtual screen\n or something similiar that confuses previous options"},
+ {"-pixelwidth", P_FLOAT, &defpixelwidth,
+ "exact size of one pixel in centimeters"},
+ {"-pixelheight", P_FLOAT, &defpixelheight,
+ "exact size of one pixel in centimeters"},
+#ifdef SFFE_USING
+ {"-formula", P_STRING, &sffeform,
+ "user formula"},
+ {"-forminit", P_STRING, &sffeinit,
+ "z0 for user formula"},
+#endif
+ {NULL, 0, NULL, NULL}
+};
+
+static int resizeregistered = 0;
+static void ui_updatemenus(uih_context * c, CONST char *name)
+{
+ CONST struct menuitem *item;
+ if (ui_nogui) {
+ if (name == NULL) {
+ printf("Root \"%s\"", uih->menuroot);
+ }
+ item = menu_findcommand(name);
+ if (item == NULL) {
+ /*x_fatalerror ("Internall error:unknown command %s", name); */
+ return;
+ }
+ if (item->flags & MENUFLAG_CHECKBOX) {
+ if (menu_enabled(item, c))
+ printf("checkbox \"%s\" on\n", name);
+ else
+ printf("checkbox \"%s\" off\n", name);
+ }
+ if (item->flags & MENUFLAG_RADIO) {
+ if (menu_enabled(item, c))
+ printf("radio \"%s\"\n", name);
+ }
+ }
+ if (driver != NULL && driver->gui_driver) {
+ if (name == NULL) {
+ if (driver->gui_driver->setrootmenu)
+ driver->gui_driver->setrootmenu(c, uih->menuroot);
+ return;
+ }
+ item = menu_findcommand(name);
+ if (item == NULL) {
+ /*fprintf (stderr, "Internall error:unknown command %s\n", name); */
+ return;
+ }
+ if (item->flags & (MENUFLAG_CHECKBOX | MENUFLAG_RADIO)) {
+ if (driver->gui_driver->enabledisable)
+ driver->gui_driver->enabledisable(uih, name);
+ }
+ }
+}
+
+static void mousetype(int m)
+{
+#ifdef _plan9_
+#define filevisible 0
+#endif
+ if (ui_nmenus || helpvisible || filevisible || dialogvisible
+ || yesnodialogvisible)
+ m = NORMALMOUSE;
+ if (mouse != m) {
+ mouse = m;
+ if (driver->mousetype != NULL)
+ driver->mousetype(m);
+ }
+}
+
+static void ui_display(void)
+{
+ if (nthreads == 1)
+ uih_drawwindows(uih);
+ driver->display();
+ uih_cycling_continue(uih);
+ if (!(driver->flags & NOFLUSHDISPLAY))
+ ui_flush();
+}
+
+float ui_get_windowwidth(int width)
+{
+ if (defscreenwidth > 0.0 && driver->flags & RESOLUTION)
+ return (defscreenwidth * width / driver->maxwidth);
+ if (defscreenwidth > 0.0)
+ return (defscreenwidth);
+ if (defpixelwidth > 0.0)
+ return (defpixelwidth * width);
+ return (0);
+}
+
+static float get_windowwidth(int width)
+{
+ float w = ui_get_windowwidth(width);
+ if (w)
+ return w;
+ if (driver->flags & PIXELSIZE)
+ return (driver->width * width);
+ if (driver->flags & SCREENSIZE)
+ return (driver->width);
+ if (driver->flags & RESOLUTION)
+ return (29.0 / driver->maxwidth * width);
+ return (29.0);
+}
+
+float ui_get_windowheight(int height)
+{
+ if (defscreenheight > 0.0 && driver->flags & RESOLUTION)
+ return (defscreenheight * height / driver->maxheight);
+ if (defscreenheight > 0.0)
+ return (defscreenheight);
+ if (defpixelheight > 0.0)
+ return (defpixelheight * height);
+ return 0;
+}
+
+static float get_windowheight(int height)
+{
+ float h = ui_get_windowheight(height);
+ if (h)
+ return h;
+ if (driver->flags & PIXELSIZE)
+ return (driver->height * height);
+ if (driver->flags & SCREENSIZE)
+ return (driver->height);
+ if (driver->flags & RESOLUTION)
+ return (21.0 / driver->maxheight * height);
+ return (21.5);
+}
+
+extern int dynsize;
+static void ui_outofmem(void)
+{
+ x_error(gettext("XaoS is out of memory."));
+}
+
+#define CHECKPROCESSEVENTS(b,k) assert(!((k)&~15)&&!((b)&~(BUTTON1|BUTTON2|BUTTON3)))
+static int
+ui_passfunc(struct uih_context *c, int display, CONST char *text,
+ float percent)
+{
+ char str[80];
+ int x = 0, y = 0, b = 0, k = 0;
+ driver->processevents(0, &x, &y, &b, &k);
+ ui_mouse(x, y, b, k);
+ CHECKPROCESSEVENTS(b, k);
+ if (!uih->play) {
+ if (uih->display)
+ ui_display(), display = 1;
+ if (!c->interruptiblemode && !uih->play) {
+ if (display) {
+ if (percent)
+ sprintf(str, "%s %3.2f%% ", text,
+ (double) percent);
+ else
+ sprintf(str, "%s ", text);
+ driver->print(0, uih->image->height - textheight1, str);
+ ui_flush();
+ }
+ } else {
+ if (!(driver->flags & NOFLUSHDISPLAY))
+ ui_flush();
+ }
+ }
+ return (0);
+}
+
+static void ui_updatestatus(void)
+{
+ double times =
+ (uih->fcontext->currentformula->v.rr) / (uih->fcontext->s.rr);
+ double timesnop = log(times) / log(10.0);
+ double speed;
+ uih_drawwindows(uih);
+ driver->display();
+ uih_cycling_continue(uih);
+ speed = uih_displayed(uih);
+ sprintf(statustext,
+ gettext
+ ("%s %.2f times (%.1fE) %2.2f frames/sec %c %i %i %i %i "),
+ times < 1 ? gettext("unzoomed") : gettext("zoomed"),
+ times < 1 ? 1.0 / times : times, timesnop, speed,
+ uih->autopilot ? 'A' : ' ', uih->fcontext->coloringmode + 1,
+ uih->fcontext->incoloringmode + 1, uih->fcontext->plane + 1,
+ uih->fcontext->maxiter);
+
+ if (!(driver->flags & NOFLUSHDISPLAY))
+ ui_flush();
+ STAT(printf(gettext("framerate:%f\n"), speed));
+ driver->print(0, 0, "");
+}
+
+void ui_updatestarts(void)
+{
+ int y = 0;
+ y += ui_menuwidth();
+ ministatusstart = y;
+ if (ministatuswindow != NULL)
+ y += xtextheight(uih->font);
+ statusstart = y;
+ if (statuswindow != NULL)
+ y += xtextheight(uih->font) * STATUSLINES;
+ uih->messg.messagestart = y;
+}
+
+void ui_menuactivate(CONST menuitem * item, dialogparam * d)
+{
+ if (item == NULL)
+ return;
+ ui_closemenus();
+ if (item->type == MENU_SUBMENU) {
+ ui_menu(item->shortname);
+ return;
+ } else {
+ if (menu_havedialog(item, uih) && d == NULL) {
+ ui_builddialog(item);
+ return;
+ }
+ if (uih->incalculation && !(item->flags & MENUFLAG_INCALC)) {
+ menu_addqueue(item, d);
+ if (item->flags & MENUFLAG_INTERRUPT)
+ uih_interrupt(uih);
+ return;
+ }
+ if (item->flags & MENUFLAG_CHECKBOX) {
+ char s[256];
+ ui_updatestatus();
+ if (!menu_enabled(item, uih))
+ sprintf(s, gettext("Enabling: %s. "), item->name);
+ else
+ sprintf(s, gettext("Disabling: %s. "), item->name);
+ uih_message(uih, s);
+ ui_flush();
+ } else
+ uih_message(uih, item->name);
+ uih_saveundo(uih);
+ menu_activate(item, uih, d);
+ if (d != NULL)
+ menu_destroydialog(item, d, uih);
+ }
+}
+
+xio_path ui_getfile(CONST char *basename, CONST char *extension)
+{
+ return (xio_getfilename(basename, extension));
+}
+
+static void
+ui_statuspos(uih_context * uih, int *x, int *y, int *w, int *h, void *data)
+{
+ *x = 0;
+ *y = statusstart;
+ *w = uih->image->width;
+ *h = xtextheight(uih->font) * STATUSLINES;
+}
+
+static void ui_drawstatus(uih_context * uih, void *data)
+{
+ char str[6000];
+ int h = xtextheight(uih->font);
+ sprintf(str, gettext("Fractal name:%s"),
+ uih->fcontext->currentformula->name[!uih->fcontext->
+ mandelbrot]);
+ xprint(uih->image, uih->font, 0, statusstart, str,
+ FGCOLOR(uih), BGCOLOR(uih), 0);
+ sprintf(str, gettext("Fractal type:%s"),
+ uih->
+ fcontext->mandelbrot ? gettext("Mandelbrot") :
+ gettext("Julia"));
+#ifdef SFFE_USING
+ if (uih->fcontext->currentformula->flags & SFFE_FRACTAL) {
+ sprintf(str, gettext("Formula:%s"), uih->parser->expression);
+ };
+#endif
+ xprint(uih->image, uih->font, 0, statusstart + h, str,
+ FGCOLOR(uih), BGCOLOR(uih), 0);
+ sprintf(str, gettext("View:[%1.12f,%1.12f]"),
+ (double) uih->fcontext->s.cr, (double) uih->fcontext->s.ci);
+ xprint(uih->image, uih->font, 0, statusstart + 2 * h, str,
+ FGCOLOR(uih), BGCOLOR(uih), 0);
+ sprintf(str, gettext("size:[%1.12f,%1.12f]"),
+ (double) uih->fcontext->s.rr, (double) uih->fcontext->s.ri);
+ xprint(uih->image, uih->font, 0, statusstart + 3 * h, str,
+ FGCOLOR(uih), BGCOLOR(uih), 0);
+ sprintf(str, gettext("Rotation:%4.2f Screen size:%i:%i"),
+ (double) uih->fcontext->angle, uih->image->width,
+ uih->image->height);
+ xprint(uih->image, uih->font, 0, statusstart + 4 * h, str,
+ FGCOLOR(uih), BGCOLOR(uih), 0);
+ sprintf(str, gettext("Iterations:%-4i Palette size:%i"),
+ uih->fcontext->maxiter, uih->image->palette->size);
+ xprint(uih->image, uih->font, 0, statusstart + 5 * h, str,
+ FGCOLOR(uih), BGCOLOR(uih), 0);
+ sprintf(str, "Bailout:%4.2f", (double) uih->fcontext->bailout);
+ xprint(uih->image, uih->font, 0, statusstart + 6 * h, str,
+ FGCOLOR(uih), BGCOLOR(uih), 0);
+ sprintf(str, gettext("Autopilot:%-4s Plane:%s"),
+ uih->autopilot ? gettext("On") : gettext("Off"),
+ planename[uih->fcontext->plane]);
+ xprint(uih->image, uih->font, 0, statusstart + 7 * h, str,
+ FGCOLOR(uih), BGCOLOR(uih), 0);
+ sprintf(str, gettext("incoloring:%s outcoloring:%s"),
+ incolorname[uih->fcontext->incoloringmode],
+ outcolorname[uih->fcontext->coloringmode]);
+ xprint(uih->image, uih->font, 0, statusstart + 8 * h, str,
+ FGCOLOR(uih), BGCOLOR(uih), 0);
+ sprintf(str, gettext("zoomspeed:%f"), (float) uih->maxstep * 1000);
+ xprint(uih->image, uih->font, 0, statusstart + 9 * h, str,
+ FGCOLOR(uih), BGCOLOR(uih), 0);
+ if (uih->fcontext->mandelbrot)
+ strcpy(str, gettext("Parameter:none"));
+ else
+ sprintf(str, gettext("Parameter:[%f,%f]"),
+ (float) uih->fcontext->pre, (float) uih->fcontext->pim);
+ xprint(uih->image, uih->font, 0, statusstart + 10 * h, str,
+ FGCOLOR(uih), BGCOLOR(uih), 0);
+#ifdef MEMCHECK
+ {
+ struct mallinfo i = mallinfo();
+ sprintf(str, "Allocated arena:%i Wasted:%i %i", i.arena, i.ordblks,
+ i.fordblks);
+ xprint(uih->image, uih->font, 0, statusstart + 11 * h, str,
+ FGCOLOR(uih), BGCOLOR(uih), 0);
+ sprintf(str, "Mmaped blocks%i Mmaped area:%i keep:%i", i.hblks,
+ i.hblkhd, i.keepcost);
+ xprint(uih->image, uih->font, 0, statusstart + 12 * h, str,
+ FGCOLOR(uih), BGCOLOR(uih), 0);
+ }
+#endif
+ ui_flush();
+}
+
+static void ui_status(uih_context * uih)
+{
+ if (statuswindow == NULL) {
+ statuswindow =
+ uih_registerw(uih, ui_statuspos, ui_drawstatus, NULL, 0);
+ } else {
+ uih_removew(uih, statuswindow);
+ statuswindow = NULL;
+ }
+ ui_updatemenus(uih, "status");
+ ui_updatemenus(uih, "animministatus");
+ ui_updatestarts();
+}
+
+static int ui_statusenabled(uih_context * uih)
+{
+ return (statuswindow != NULL);
+}
+
+static void
+ui_ministatuspos(uih_context * uih, int *x, int *y, int *w, int *h,
+ void *data)
+{
+ *x = 0;
+ *y = ministatusstart;
+ *w = uih->image->width;
+ *h = xtextheight(uih->font);
+}
+
+static void ui_drawministatus(uih_context * uih, void *data)
+{
+ xprint(uih->image, uih->font, 0, ministatusstart, statustext,
+ FGCOLOR(uih), BGCOLOR(uih), 0);
+}
+
+static void ui_noguisw(uih_context * uih)
+{
+ ui_nogui ^= 1;
+ ui_updatemenus(uih, "nogui");
+}
+
+static int ui_noguienabled(uih_context * uih)
+{
+ return (ui_nogui);
+}
+
+static void ui_ministatus(uih_context * uih)
+{
+ if (ministatuswindow == NULL) {
+ ministatuswindow =
+ uih_registerw(uih, ui_ministatuspos, ui_drawministatus, NULL,
+ 0);
+ } else {
+ uih_removew(uih, ministatuswindow);
+ ministatuswindow = NULL;
+ }
+ ui_updatestarts();
+ ui_updatemenus(uih, "ministatus");
+ ui_updatemenus(uih, "animministatus");
+}
+
+static int ui_ministatusenabled(uih_context * uih)
+{
+ return (ministatuswindow != NULL);
+}
+
+static void ui_message(struct uih_context *u)
+{
+ char s[80];
+ if (uih->play)
+ return;
+ mousetype(WAITMOUSE);
+ sprintf(s, gettext("Please wait while calculating %s"),
+ uih->fcontext->currentformula->name[!uih->fcontext->
+ mandelbrot]);
+ driver->print(0, 0, s);
+}
+
+#define ROTATESPEEDUP 30
+static int
+procescounter(int *counter, CONST char *text, int speed, int keys,
+ int lastkeys, int down, int up, int tenskip, int min,
+ int max)
+{
+ static int pid = -1;
+ int changed = 0;
+ char str[80];
+ if (tl_lookup_timer(arrowtimer) > 1000000)
+ tl_reset_timer(arrowtimer);
+ if ((keys & up) && !(lastkeys & up)) {
+ (*counter)++;
+ tenskip = 0;
+ changed = 1;
+ tl_reset_timer(arrowtimer);
+ }
+ if ((keys & down) && !(lastkeys & down)) {
+ (*counter)--;
+ tenskip = 0;
+ changed = 1;
+ tl_reset_timer(arrowtimer);
+ }
+ while (tl_lookup_timer(arrowtimer) > speed * FRAMETIME) {
+ tl_slowdown_timer(arrowtimer, speed * FRAMETIME);
+ if (keys & up) {
+ if (tenskip && !(*counter % 10))
+ (*counter) += 10;
+ else
+ (*counter)++;
+ changed = 1;
+ }
+ if (keys & down) {
+ if (tenskip && !(*counter % 10))
+ (*counter) -= 10;
+ else
+ (*counter)--;
+ changed = 1;
+ }
+ }
+ if (changed) {
+ if (*counter > max)
+ *counter = max;
+ if (*counter < min)
+ *counter = min;
+ sprintf(str, text, *counter);
+ uih_rmmessage(uih, pid);
+ pid = uih_message(uih, str);
+ ui_flush();
+ }
+ return changed;
+}
+
+static void
+ui_mouse(int mousex, int mousey, int mousebuttons, int iterchange)
+{
+ int flags;
+ char str[80];
+ static int spid;
+ flags = 0;
+ if (mousex != lastx || mousey != lasty)
+ flags |= MOUSE_MOVE;
+ if ((mousebuttons & BUTTON1) && !(lastbuttons & BUTTON1))
+ flags |= MOUSE_PRESS;
+ if (!(mousebuttons & BUTTON1) && (lastbuttons & BUTTON1))
+ flags |= MOUSE_RELEASE;
+ if (mousebuttons & BUTTON1)
+ flags |= MOUSE_DRAG;
+ lastx = mousex;
+ lasty = mousey;
+ lastbuttons = mousebuttons;
+ tl_update_time();
+ CHECKPROCESSEVENTS(mousebuttons, iterchange);
+ if (ui_helpmouse(mousex, mousey, mousebuttons, flags)) {
+ uih_update(uih, mousex, mousey, 0);
+ return;
+ }
+#ifndef _plan9_
+ if (ui_mousefilesel(mousex, mousey, mousebuttons, flags)) {
+ uih_update(uih, mousex, mousey, 0);
+ return;
+ }
+#endif
+ if (ui_dialogmouse(mousex, mousey, mousebuttons, flags)) {
+ uih_update(uih, mousex, mousey, 0);
+ return;
+ }
+ if (ui_menumouse(mousex, mousey, mousebuttons, flags)) {
+ uih_update(uih, mousex, mousey, 0);
+ return;
+ }
+ uih_update(uih, mousex, mousey, mousebuttons);
+ if (uih->play) {
+ procescounter(&uih->letterspersec,
+ gettext("Letters per second %i "), 2, iterchange,
+ lastiter, 1, 2, 0, 1, INT_MAX);
+ return;
+ }
+ if (!uih->cycling) {
+ if (uih->rotatemode == ROTATE_CONTINUOUS) {
+ static int rpid;
+ if (iterchange == 2) {
+ uih->rotationspeed +=
+ ROTATESPEEDUP * tl_lookup_timer(maintimer) / 1000000.0;
+ uih_rmmessage(uih, rpid);
+ sprintf(str,
+ gettext
+ ("Rotation speed:%2.2f degrees per second "),
+ (float) uih->rotationspeed);
+ rpid = uih_message(uih, str);
+ ui_flush();
+ }
+ if (iterchange == 1) {
+ uih->rotationspeed -=
+ ROTATESPEEDUP * tl_lookup_timer(maintimer) / 1000000.0;
+ uih_rmmessage(uih, rpid);
+ sprintf(str,
+ gettext
+ ("Rotation speed:%2.2f degrees per second "),
+ (float) uih->rotationspeed);
+ rpid = uih_message(uih, str);
+ ui_flush();
+ }
+ tl_reset_timer(maintimer);
+ } else {
+ if (!dirty)
+ maxiter = uih->fcontext->maxiter;
+ if (procescounter
+ (&maxiter, gettext("Iterations: %i "), 1, iterchange,
+ lastiter, 1, 2, 1, 1, INT_MAX) || (iterchange & 3)) {
+ dirty = 1;
+ lastiter = iterchange;
+ return;
+ }
+ }
+ }
+ if (dirty) {
+ if (uih->incalculation)
+ uih_interrupt(uih);
+ else
+ uih_setmaxiter(uih, maxiter), dirty = 0;
+ }
+ if (uih->cycling) {
+ if (procescounter
+ (&uih->cyclingspeed, gettext("Cycling speed: %i "), 1,
+ iterchange, lastiter, 1, 2, 0, -1000000, INT_MAX)) {
+ uih_setcycling(uih, uih->cyclingspeed);
+ }
+ }
+ if (iterchange & 4
+ && (tl_lookup_timer(maintimer) > FRAMETIME || mousebuttons)) {
+ double mul1 = tl_lookup_timer(maintimer) / FRAMETIME;
+ double su = 1 + (SPEEDUP - 1) * mul1;
+ if (su > 2 * SPEEDUP)
+ su = SPEEDUP;
+ tl_reset_timer(maintimer);
+ uih->speedup *= su, uih->maxstep *= su;
+ sprintf(str, gettext("speed:%2.2f "),
+ (double) uih->speedup * (1.0 / STEP));
+ uih_rmmessage(uih, spid);
+ spid = uih_message(uih, str);
+ ui_flush();
+ }
+ if (iterchange & 8
+ && (tl_lookup_timer(maintimer) > FRAMETIME || mousebuttons)) {
+ double mul1 = tl_lookup_timer(maintimer) / FRAMETIME;
+ double su = 1 + (SPEEDUP - 1) * mul1;
+ if (su > 2 * SPEEDUP)
+ su = SPEEDUP;
+ tl_reset_timer(maintimer);
+ uih->speedup /= su, uih->maxstep /= su;
+ sprintf(str, gettext("speed:%2.2f "),
+ (double) uih->speedup * (1 / STEP));
+ uih_rmmessage(uih, spid);
+ spid = uih_message(uih, str);
+ ui_flush();
+ }
+ lastiter = iterchange;
+ return;
+}
+
+void ui_call_resize(void)
+{
+ callresize = 1;
+ uih_interrupt(uih);
+}
+
+static int
+ui_alloccolor(struct palette *pal, int init, int r, int g, int b)
+{
+ int i;
+ i = driver->set_color(r, g, b, init);
+ if (i == -1)
+ return (-1);
+ if (init)
+ pal->size = 0;
+ pal->pixels[pal->size] = i;
+ pal->rgb[i][0] = r;
+ pal->rgb[i][1] = g;
+ pal->rgb[i][2] = b;
+ pal->size++;
+ if (driver->flags & UPDATE_AFTER_PALETTE) {
+ uih->display = 1;
+ }
+ return (i);
+}
+
+static void
+ui_setpalette(struct palette *pal, int start, int end, rgb_t * rgb1)
+{
+ driver->set_range((ui_palette) rgb1, start, end);
+}
+
+static void ui_flip(struct image *image)
+{
+ flipgeneric(image);
+ driver->flip_buffers();
+}
+
+static int ui_driverselected(uih_context * c, int d)
+{
+ return (driver == drivers[d]);
+}
+
+static void ui_setdriver(uih_context * c, int d)
+{
+ todriver = d + 1;
+}
+
+static void processbuffer(void)
+{
+ CONST menuitem *item;
+ dialogparam *d;
+ if (uih->incalculation)
+ return;
+ while ((item = menu_delqueue(&d)) != NULL) {
+ ui_menuactivate(item, d);
+ }
+}
+
+static void ui_doquit(int i) NORETURN;
+static void ui_doquit(int i)
+{
+ uih_cycling_off(uih);
+ uih_freecatalog(uih);
+ uih_freecontext(uih);
+ tl_free_timer(maintimer);
+ tl_free_timer(arrowtimer);
+ tl_free_timer(loopt);
+ driver->free_buffers(NULL, NULL);
+ driver->uninit();
+ destroypalette(image->palette);
+ destroy_image(image);
+ xth_uninit();
+ xio_uninit();
+ ui_unregistermenus();
+ uih_unregistermenus();
+ exit_xaos(i);
+}
+
+void ui_quit(void)
+{
+#ifndef _MAC
+ printf(gettext("Thank you for using XaoS\n"));
+#endif
+ ui_doquit(0);
+}
+
+static void ui_quitwr(uih_context * c, int quit)
+{
+ if (c == NULL) {
+ ui_unregistermenus();
+ uih_unregistermenus();
+ xio_uninit();
+ exit_xaos(0);
+ }
+ if (quit)
+ ui_quit();
+}
+
+int ui_key(int key)
+{
+ int sym;
+ char mkey[2];
+ CONST menuitem *item;
+#ifdef _plan9_
+#define ui_keyfilesel(k) 0
+#endif
+ if (!ui_helpkeys(key) && !ui_keyfilesel(key) && !ui_dialogkeys(key)
+ && !ui_menukey(key))
+ switch (sym = tolower(key)) {
+ case ' ':
+ ui_closemenus();
+ uih->display = 1;
+ if (uih->play) {
+ if (uih->incalculation)
+ ui_updatestatus();
+ else {
+ uih_skipframe(uih);
+ driver->print(0, 0,
+ gettext("Skipping, please wait..."));
+ }
+ }
+ break;
+ default:
+ {
+ int number;
+ if (sym >= '0' && sym <= '9') {
+ number = sym - '1';
+ if (number < 0)
+ number = 9;
+ if (number == -1)
+ break;
+ }
+ }
+ mkey[0] = key;
+ mkey[1] = 0;
+ item = menu_findkey(mkey, uih->menuroot);
+ if (item == NULL) {
+ mkey[0] = sym;
+ item = menu_findkey(mkey, uih->menuroot);
+ }
+ if (item != NULL) {
+ dialogparam *p = NULL;
+ if (menu_havedialog(item, uih)) {
+ CONST menudialog *d = menu_getdialog(uih, item);
+ int mousex, mousey, buttons;
+ driver->getmouse(&mousex, &mousey, &buttons);
+ if (d[0].question != NULL && d[1].question == NULL
+ && d[0].type == DIALOG_COORD) {
+ p = (dialogparam *) malloc(sizeof(dialogparam));
+ uih_screentofractalcoord(uih, mousex, mousey,
+ p->dcoord, p->dcoord + 1);
+ }
+ }
+ ui_menuactivate(item, p);
+ }
+ break;
+ }
+ processbuffer();
+ return 0;
+}
+
+#ifdef _EFENCE_
+int EF_ALIGNMENT = 1;
+int EF_PROTECT_BELOW = 0;
+int EF_PROTECT_FREE = 1;
+#endif
+static void ui_helpwr(struct uih_context *c)
+{
+ ui_help("main");
+}
+
+char *ui_getpos(void)
+{
+ return (uih_savepostostr(uih));
+}
+
+void ui_loadstr(CONST char *n)
+{
+ uih_loadstr(uih, n);
+}
+
+static menuitem *menuitems;
+/* This structure is now empty. All static definitions have been moved
+ to ui_registermenus_i18n() which fills up its own static array. */
+
+/* Registering internationalized menus. See also include/xmenu.h
+ for details. Note that MAX_MENUITEMS_I18N may be increased
+ if more items will be added in future. */
+
+/* Details of implementation:
+ *
+ * There are static menuitems_i18n[] arrays for several *.c files.
+ * In these files this array is common for all functions.
+ * Here, e.g. add_resizeitems() and ui_registermenus_i18n()
+ * use the same array and ui_no_menuitems_i18n is the counter
+ * that counts the number of items. The local variables
+ * count the local items.
+ */
+
+#define MAX_MENUITEMS_I18N 20
+/* These variables must be global: */
+static menuitem menuitems_i18n[MAX_MENUITEMS_I18N];
+int ui_no_menuitems_i18n = 0, ui_no_resizeitems;
+static menuitem *resizeitems;
+
+#define UI (MENUFLAG_NOPLAY|MENUFLAG_NOOPTION)
+static void add_resizeitems()
+{
+ // General version, it's needed now:
+ int no_menuitems_i18n = ui_no_menuitems_i18n; /* This variable must be local. */
+ MENUNOP_I("ui", "=", gettext("Resize"), "resize",
+ UI | MENUFLAG_INTERRUPT, ui_call_resize);
+ MENUNOP_I("uia", "=", gettext("Resize"), "animresize",
+ UI | MENUFLAG_INTERRUPT, ui_call_resize);
+ no_menuitems_i18n -= ui_no_menuitems_i18n;
+ resizeitems = &menuitems_i18n[ui_no_menuitems_i18n];
+ menu_add(resizeitems, no_menuitems_i18n);
+ ui_no_resizeitems = no_menuitems_i18n;
+ ui_no_menuitems_i18n += no_menuitems_i18n;
+}
+
+static void ui_registermenus_i18n(void)
+{
+ int no_menuitems_i18n = ui_no_menuitems_i18n; /* This variable must be local. */
+#ifndef MACOSX
+ SUBMENU_I("file", "q", gettext("Quit"), "quitmenu");
+ MENUINT_I("quitmenu", NULL, gettext("Exit now"), "quit",
+ MENUFLAG_INTERRUPT | MENUFLAG_ATSTARTUP, ui_quitwr, 1);
+ MENUINT_I("quitmenu", NULL, gettext("Not yet"), "noquit", UI,
+ ui_quitwr, 0);
+#endif
+ MENUNOP_I("helpmenu", "h", gettext("Help"), "help", MENUFLAG_INCALC,
+ ui_helpwr);
+ MENUNOPCB_I("ui", NULL, gettext("Disable XaoS's builtin GUI"), "nogui",
+ MENUFLAG_INCALC | MENUFLAG_ATSTARTUP | MENUFLAG_NOMENU,
+ ui_noguisw, ui_noguienabled);
+ MENUSEPARATOR_I("ui");
+ MENUNOPCB_I("ui", "/", gettext("Status"), "status", MENUFLAG_INCALC, ui_status, ui_statusenabled); /*FIXME: add also ? as key */
+
+ MENUNOPCB_I("ui", "l", gettext("Ministatus"), "ministatus",
+ MENUFLAG_INCALC, ui_ministatus, ui_ministatusenabled);
+ MENUSEPARATOR_I("ui");
+ MENUSEPARATOR_I("uia");
+ MENUNOPCB_I("uia", "/", gettext("Status"), "animstatus", UI | MENUFLAG_INCALC, ui_status, ui_statusenabled); /*FIXME: add also ? as key */
+
+ MENUNOPCB_I("uia", "l", gettext("Ministatus"), "animministatus",
+ UI | MENUFLAG_INCALC, ui_ministatus, ui_ministatusenabled);
+ MENUSEPARATOR_I("uia");
+ SUBMENU_I("ui", NULL, gettext("Driver"), "drivers");
+ SUBMENU_I("uia", NULL, gettext("Driver"), "drivers");
+ no_menuitems_i18n -= ui_no_menuitems_i18n;
+ menu_add(&(menuitems_i18n[ui_no_menuitems_i18n]), no_menuitems_i18n);
+ ui_no_menuitems_i18n += no_menuitems_i18n;
+}
+
+/* Registering driver items: */
+static menuitem *driveritems;
+static void ui_registermenus(void)
+{
+ int i;
+ menuitem *item;
+ menu_add(menuitems, NITEMS(menuitems));
+ driveritems = item = (menuitem *) malloc(sizeof(menuitem) * ndrivers);
+ for (i = 0; i < ndrivers; i++) {
+ item[i].menuname = "drivers";
+ item[i].shortname = drivers[i]->name;
+ item[i].key = NULL;
+ item[i].type = MENU_INT;
+ item[i].flags = MENUFLAG_RADIO | UI;
+ item[i].iparam = i;
+ item[i].name = drivers[i]->name;
+ item[i].function = (void (*)(void)) ui_setdriver;
+ item[i].control = (int (*)(void)) ui_driverselected;
+ }
+ menu_add(item, ndrivers);
+}
+
+static void ui_unregistermenus(void)
+{
+ menu_delete(menuitems, NITEMS(menuitems));
+ menu_delete(driveritems, ndrivers);
+ menu_delete(menuitems_i18n, ui_no_menuitems_i18n);
+ free(driveritems);
+}
+
+int number_six = 6;
+
+#ifdef SFFE_USING
+ /* parser variables vars */
+cmplx Z, C, pZ;
+#endif
+
+#define MAX_WELCOME 50
+
+void ui_init(int argc, char **argv)
+{
+ int i;
+ int width, height;
+ char welcome[MAX_WELCOME], language[11];
+#ifdef HAVE_GETTEXT
+ char *locale;
+#endif
+#ifdef DESTICKY
+ euid = geteuid();
+ egid = getegid();
+#endif
+#ifdef DESTICKY
+ seteuid(getuid()); /* Don't need supervisor rights anymore. */
+ setegid(getgid());
+#endif
+
+ strcpy(language, "english");
+#ifdef HAVE_GETTEXT
+ /* Setting all locales for XaoS: */
+ locale = setlocale(LC_ALL, "");
+ if (locale == NULL) {
+ printf
+ ("An error occured in your setlocale/gettext installation.\n");
+ printf("I18n menus will not be available.\n");
+ }
+#ifdef _WIN32
+ // x_message("%s",locale);
+ if (locale != NULL) {
+ if (strncmp(locale, "Hungarian", 9) == 0)
+ strcpy(language, "magyar");
+ if (strncmp(locale, "Czech", 5) == 0)
+ strcpy(language, "cesky");
+ if (strncmp(locale, "German", 6) == 0)
+ strcpy(language, "deutsch");
+ if (strncmp(locale, "Spanish", 7) == 0)
+ strcpy(language, "espanhol");
+ if (strncmp(locale, "French", 6) == 0)
+ strcpy(language, "francais");
+ if (strncmp(locale, "Romanian", 8) == 0)
+ strcpy(language, "romanian");
+ if (strncmp(locale, "Italian", 7) == 0)
+ strcpy(language, "italiano");
+ if (strncmp(locale, "Portuguese", 10) == 0)
+ strcpy(language, "portuguese");
+ }
+ // x_message("%s",language);
+#else
+ if ((locale == NULL) || (strcmp(locale, "C") == 0))
+ locale = getenv("LANG");
+ else
+ locale = setlocale(LC_MESSAGES, "");
+
+
+#ifdef DEBUG
+ printf("Trying to use locale settings for %s.\n", locale);
+#endif
+
+ if (locale != NULL) {
+ if (strlen(locale) > 2)
+ locale[2] = '\0';
+ if (strcmp(locale, "hu") == 0)
+ strcpy(language, "magyar");
+ if (strcmp(locale, "cs") == 0)
+ strcpy(language, "cesky");
+ if (strcmp(locale, "de") == 0)
+ strcpy(language, "deutsch");
+ if (strcmp(locale, "es") == 0)
+ strcpy(language, "espanhol");
+ if (strcmp(locale, "fr") == 0)
+ strcpy(language, "francais");
+ if (strcmp(locale, "ro") == 0)
+ strcpy(language, "romanian");
+ if (strcmp(locale, "it") == 0)
+ strcpy(language, "italiano");
+ if (strcmp(locale, "pt") == 0)
+ strcpy(language, "portuguese");
+ }
+#endif
+#ifdef DEBUG
+ printf("Using catalog file for %s language.\n", language);
+#endif
+ /* Without this some locales (e.g. the Hungarian) replaces "." to ","
+ in numerical format and this will cause an automatic truncation
+ at each parameter at certain places, e.g. drawing a new fractal. */
+ setlocale(LC_NUMERIC, "C");
+#ifdef DEBUG
+ printf("Text domain will be bound to directory %s.\n",
+#endif
+ bindtextdomain("xaos",
+#ifdef DOG_DRIVER
+ "..\\locale")
+#ifdef DEBUG
+ )
+#endif
+#else
+#ifdef _WIN32
+ "..\\locale")
+#ifdef DEBUG
+ )
+#endif
+#else
+#ifdef USE_LOCALEPATH
+ localepath)
+#else
+ "/usr/share/locale")
+#endif
+#ifdef DEBUG
+ )
+#endif
+#endif
+#endif
+ ;
+#ifndef _WIN32
+ bind_textdomain_codeset("xaos", "UTF-8");
+#endif
+ textdomain("xaos");
+ /* Done setting locales. */
+#endif
+ xio_init(argv[0]);
+ params_register(global_params);
+ params_register(ui_fractal_params);
+ uih_registermenudialogs_i18n(); /* Internationalized dialogs. */
+ /* Dialogs must be generated before menus because menu items
+ link to dialog pointers. */
+ uih_registermenus_i18n(); /* Internationalized menus. */
+ uih_registermenus();
+ ui_registermenus();
+ ui_registermenus_i18n(); /* Internationalized menus. */
+ for (i = 0; i < ndrivers; i++)
+ params_register(drivers[i]->params);
+#ifdef __alpha__
+#ifdef __linux__
+ extern void ieee_set_fp_control(unsigned long);
+ ieee_set_fp_control(1UL);
+#endif
+#endif
+ prog_argc = argc;
+ prog_argv = argv;
+ if (!params_parser(argc, argv)) {
+ ui_unregistermenus();
+ uih_unregistermenus();
+ xio_uninit();
+ exit_xaos(-1);
+ }
+#ifdef MEM_DEBUG
+ D_NORMAL;
+#endif
+#ifdef DEBUG
+ printf("Initializing driver\n");
+#endif
+#ifndef __BEOS__
+#ifndef _plan9_
+ signal(SIGFPE, SIG_IGN);
+#endif
+#endif
+ if (printconfig) {
+#define tostring(s) #s
+ x_message("XaoS configuration\n"
+ "Version: %s\n"
+ "Type size: %i\n" "integer size: %i\n" "configfile: %s\n"
+#ifndef _plan9_
+#ifdef HAVE_ALLOCA
+ "using alloca\n"
+#endif
+#ifdef HAVE_LONG_DOUBLE
+ "using long double\n"
+#endif
+#ifdef const
+ "const disabled\n"
+#endif
+#ifdef inline
+ "inline disabled\n"
+#endif
+#ifdef HAVE_GETTIMEOFDAY
+ "using gettimeofday\n"
+#endif
+#ifdef HAVE_FTIME
+ "using ftime\n"
+#endif
+#ifdef MITSHM
+ "using mitshm\n"
+#endif
+#ifdef HAVE_MOUSEMASK
+ "using ncurses mouse\n"
+#endif
+#ifdef DEBUG
+ "debug enabled\n"
+#endif
+#ifdef NDEBUG
+ "assertions disabled\n"
+#endif
+#ifdef STATISTICS
+ "statistics enabled\n"
+#endif
+#ifdef SFFE_USING
+ "user formula evaluation\n"
+#endif
+#endif
+ , XaoS_VERSION, (int) sizeof(FPOINT_TYPE),
+ (int) sizeof(int), CONFIGFILE);
+ }
+ if (deflist || printconfig) {
+ char s[256];
+ strcpy(s, "Available drivers: ");
+ for (i = 0; i < ndrivers; i++) {
+ strcat(s, drivers[i]->name);
+ if (i < ndrivers - 1)
+ strcat(s, ", ");
+ }
+ x_message(s);
+ ui_unregistermenus();
+ uih_unregistermenus();
+ xio_uninit();
+ exit_xaos(0);
+ }
+#ifndef _plan9_
+ xth_init(defthreads);
+#endif
+ {
+ int i = ui_dorender_params();
+ if (i) {
+ ui_unregistermenus();
+ uih_unregistermenus();
+ xio_uninit();
+ exit_xaos(i - 1);
+ }
+ }
+ if (defdriver != NULL) {
+ for (i = 0; i < ndrivers; i++) {
+ int y;
+ for (y = 0;
+ tolower(drivers[i]->name[y]) == tolower(defdriver[y])
+ && drivers[i]->name[y] != 0; y++);
+ if (drivers[i]->name[y] == 0) {
+ driver = drivers[i];
+ if (driver->init())
+ break;
+ else {
+ x_fatalerror("Can not initialize %s driver",
+ defdriver);
+ }
+ }
+ }
+ if (i == ndrivers) {
+ x_fatalerror("Unknown driver %s", defdriver);
+ }
+ } else {
+ for (i = 0; i < ndrivers; i++) {
+ driver = drivers[i];
+ if (driver->init())
+ break;
+ }
+ if (i == ndrivers) {
+ x_fatalerror("Can not initialize driver");
+ }
+ }
+#ifdef DEBUG
+ printf("Getting size\n");
+#endif
+ driver->getsize(&width, &height);
+#ifdef _plan9_
+ xth_init(defthreads); /*plan0 requires to initialize tasks after graphics */
+#endif
+ mousetype(WAITMOUSE);
+ driver->print(0, 0, "Initializing. Please wait");
+ driver->print(0, textheight1, "Creating framebuffer");
+ ui_flush();
+ ui_mkimages(width, height);
+
+ driver->print(0, textheight1 * 2, "Initializing fractal engine");
+ ui_flush();
+
+ /* gloabuih initialization moved into uih_mkcontext function : malczak */
+ uih =
+ uih_mkcontext(driver->flags, image, ui_passfunc, ui_message,
+ ui_updatemenus);
+
+ if (driver->gui_driver && driver->gui_driver->setrootmenu)
+ driver->gui_driver->setrootmenu(uih, uih->menuroot);
+ ui_flush();
+#ifdef HOMEDIR
+ if (getenv("HOME") != NULL) {
+ char home[256], *env = getenv("HOME");
+ int maxsize = 255 - (int) strlen(CONFIGFILE) - 1; /*Avoid buffer owerflow */
+ int i;
+ for (i = 0; i < maxsize && env[i]; i++)
+ home[i] = env[i];
+ home[i] = 0;
+ xio_addfname(configfile, home, CONFIGFILE);
+ } else
+#endif
+ xio_addfname(configfile, XIO_EMPTYPATH, CONFIGFILE);
+ ui_flush();
+ srand(time(NULL));
+ uih->fcontext->version++;
+ maintimer = tl_create_timer();
+ arrowtimer = tl_create_timer();
+ loopt = tl_create_timer();
+ driver->print(0, textheight1 * 3, "Loading message catalog");
+ ui_flush();
+ uih_loadcatalog(uih, language);
+ driver->print(0, textheight1 * 4, "Initializing timming system");
+ ui_flush();
+ uih_newimage(uih);
+ tl_update_time();
+ /*tl_process_group (syncgroup, NULL); */
+ tl_reset_timer(maintimer);
+ tl_reset_timer(arrowtimer);
+#ifdef COMPILE_PIPE
+ if (defpipe != NULL) {
+ driver->print(0, textheight1 * 5, "Initializing pipe");
+ ui_flush();
+ ui_pipe_init(defpipe);
+ }
+#else
+ if (defpipe != NULL) {
+ x_fatalerror("Pipe input not supported!");
+ }
+#endif
+ /*uih_constantframetime(uih,1000000/20); */
+ driver->print(0, textheight1 * 6, "Reading configuration file");
+ {
+ xio_file f = xio_ropen(configfile); /*load the configuration file */
+ if (f != XIO_FAILED) {
+ uih_load(uih, f, configfile);
+ if (uih->errstring) {
+ x_error("Configuration file %s load failed", configfile);
+ uih_printmessages(uih);
+ x_error("Hint:try to remove it :)");
+ ui_doquit(1);
+ }
+ }
+ }
+ driver->print(0, textheight1 * 7,
+ "Processing command line parameters");
+ ui_flush();
+ {
+ CONST menuitem *item;
+ dialogparam *d;
+ while ((item = menu_delqueue(&d)) != NULL) {
+ uih_saveundo(uih);
+ menu_activate(item, uih, d);
+ }
+ }
+#ifndef _plan9_
+ sprintf(welcome, gettext("Welcome to XaoS version %s"), XaoS_VERSION);
+ /*TYPE*/ uih_message(uih, welcome);
+#endif
+ uih_updatemenus(uih, driver->name);
+ if (printspeed) {
+ int c = 0;
+ int x, y, b, k;
+ int linesize = uih->image->bytesperpixel * uih->image->height;
+ int size = linesize * uih->image->height;
+ driver->print(0, textheight1 * 8, "Preparing for speedtest");
+ ui_flush();
+ uih->passfunc = NULL;
+ tl_sleep(1000000);
+ for (c = 0; c < 5; c++)
+ driver->display(), ui_flush();
+ driver->processevents(0, &x, &y, &b, &k);
+ driver->print(0, textheight1 * 9, "Measuring dislay speed");
+ ui_flush();
+ tl_sleep(1000000);
+ tl_update_time();
+ tl_reset_timer(maintimer);
+ c = 0;
+ while (tl_lookup_timer(maintimer) < 5000000)
+ driver->display(), ui_flush(), driver->processevents(0, &x, &y,
+ &b, &k),
+ tl_update_time(), c++;
+ x_message("Driver speed: %g FPS (%.4f MBPS)", c / 5.0,
+ c * (double) size / 5.0 / 1024 / 1024);
+
+ driver->print(0, textheight1 * 10, "Measuring memcpy speed");
+ ui_flush();
+ for (c = 0; c < 5; c++) {
+ for (x = 0; x < uih->image->height; x++)
+ memcpy(uih->image->currlines[y], uih->image->oldlines[y],
+ linesize);
+ }
+ tl_update_time();
+ tl_reset_timer(maintimer);
+ c = 0;
+ while (tl_lookup_timer(maintimer) < 5000000) {
+ for (x = 0; x < uih->image->height; x++)
+ memcpy(uih->image->currlines[y], uih->image->oldlines[y],
+ linesize);
+ tl_update_time(), c++;
+ }
+ x_message("Memcpy speed: %g FPS (%.4f MBPS)", c / 5.0,
+ c * (double) size / 5.0 / 1024 / 1024);
+
+ driver->print(0, textheight1 * 10,
+ "Measuring missaligned memcpy speed");
+ tl_update_time();
+ tl_reset_timer(maintimer);
+ c = 0;
+ while (tl_lookup_timer(maintimer) < 5000000) {
+ for (x = 0; x < uih->image->height; x++)
+ memcpy(uih->image->currlines[y] + 1,
+ uih->image->oldlines[y] + 2, linesize - 2);
+ tl_update_time(), c++;
+ }
+ x_message("Missaligned memcpy speed: %g FPS (%.4f MBPS)", c / 5.0,
+ c * (double) size / 5.0 / 1024 / 1024);
+
+ driver->print(0, textheight1 * 10, "Measuring size6 memcpy speed");
+ tl_update_time();
+ tl_reset_timer(maintimer);
+ c = 0;
+ while (tl_lookup_timer(maintimer) < 5000000) {
+ int x, y;
+ for (y = 0; y < uih->image->height; y++)
+ for (x = 0; x < linesize - 6; x += 6) {
+ memcpy(uih->image->currlines[y] + x,
+ uih->image->oldlines[y] + x, number_six);
+ }
+ tl_update_time(), c++;
+ }
+ x_message("Size 6 memcpy speed: %g FPS (%.4f MBPS)", c / 5.0,
+ c * (double) size / 5.0 / 1024 / 1024);
+
+ driver->display();
+ driver->print(0, textheight1 * 11, "Measuring calculation speed");
+ ui_flush();
+ speed_test(uih->fcontext, image);
+ driver->print(0, textheight1 * 12,
+ "Measuring new image calculation loop");
+ ui_flush();
+ uih_prepare_image(uih);
+ tl_update_time();
+ tl_reset_timer(maintimer);
+ for (c = 0; c < 5; c++)
+ uih_newimage(uih), uih->fcontext->version++,
+ uih_prepare_image(uih);
+ driver->display();
+ ui_flush();
+ x_message("New image caluclation took %g seconds (%.2g fps)",
+ tl_lookup_timer(maintimer) / 5.0 / 1000000.0,
+ 5000000.0 / tl_lookup_timer(maintimer));
+ tl_update_time();
+ for (c = 0; c < 5; c++)
+ uih_animate_image(uih), uih_prepare_image(uih), c++;
+ c = 0;
+ tl_update_time();
+ tl_reset_timer(maintimer);
+ driver->print(0, textheight1 * 13,
+ "Measuring zooming algorithm loop");
+ ui_flush();
+ while (tl_lookup_timer(maintimer) < 5000000)
+ uih_animate_image(uih), uih_prepare_image(uih),
+ tl_update_time(), c++;
+ x_message("Approximation loop speed: %g FPS", c / 5.0);
+ ui_doquit(0);
+ }
+#ifdef SFFE_USING
+ /*SFFE : malczak */
+ if (uih->parser->expression == NULL)
+ if (sffeform)
+ err = sffe_parse(&uih->parser, (char *) sffeform);
+ else
+ sffe_parse(&uih->parser, "z^2+c");
+
+ if (sffeinit) {
+ uih->pinit = sffe_alloc();
+ sffe_regvar(&uih->pinit, &pZ, 'p');
+ sffe_regvar(&uih->pinit, &C, 'c');
+ if (sffe_parse(&uih->pinit, (char *) sffeinit) > 0)
+ sffe_free(&uih->pinit);
+ };
+
+ if (err > 0)
+ sffe_parse(&uih->parser, "z^2+c");
+ /*SFFE*/
+#endif
+ driver->print(0, textheight1 * 8, "Entering main loop");
+ ui_flush();
+}
+
+#ifndef MAIN_FUNCTION
+#define MAIN_FUNCTION main
+#endif
+int MAIN_FUNCTION(int argc, char **argv)
+{
+ ui_init(argc, argv);
+ ui_mainloop(1);
+ ui_quit();
+
+ return (0);
+}
+
+static void ui_mkimages(int w, int h)
+{
+ struct palette *palette;
+ int scanline;
+ int width, height;
+ union paletteinfo info;
+ char *b1, *b2;
+ width = w;
+ height = h;
+ if (resizeregistered && !(driver->flags & RESIZE_COMMAND)) {
+ menu_delete(resizeitems, ui_no_resizeitems);
+ resizeregistered = 0;
+ } else {
+ if (!resizeregistered && (driver->flags & RESIZE_COMMAND)) {
+ add_resizeitems();
+ resizeregistered = 1;
+ }
+ }
+ if (!(scanline = driver->alloc_buffers(&b1, &b2))) {
+ driver->uninit();
+ x_error(gettext("Can not allocate buffers"));
+ ui_outofmem();
+ exit_xaos(-1);
+ }
+ info.truec.rmask = driver->rmask;
+ info.truec.gmask = driver->gmask;
+ info.truec.bmask = driver->bmask;
+ palette =
+ createpalette(driver->palettestart, driver->paletteend,
+ driver->imagetype,
+ (driver->
+ flags & RANDOM_PALETTE_SIZE) ? UNKNOWNENTRIES : 0,
+ driver->maxentries,
+ driver->set_color != NULL ? ui_alloccolor : NULL,
+ driver->set_range != NULL ? ui_setpalette : NULL,
+ NULL, NULL, &info);
+ if (!palette) {
+ driver->uninit();
+ x_error(gettext("Can not create palette"));
+ ui_outofmem();
+ exit_xaos(-1);
+ }
+ image =
+ create_image_cont(width, height, scanline, 2, (unsigned char *) b1,
+ (unsigned char *) b2, palette, ui_flip,
+ (driver->flags & AALIB) ? AAIMAGE : 0,
+ get_windowwidth(width) / width,
+ get_windowheight(height) / height);
+ if (!image) {
+ driver->uninit();
+ x_error(gettext("Can not create image"));
+ ui_outofmem();
+ exit_xaos(-1);
+ }
+}
+
+void ui_resize(void)
+{
+ int w, h;
+
+ /* Prevent crash on startup for Mac OS X */
+ if (!uih)
+ return;
+
+ if (uih->incalculation) {
+ uih_interrupt(uih);
+ return;
+ }
+ ui_closemenus();
+ ui_closedialog(0);
+ ui_close_help();
+ uih_clearwindows(uih);
+ uih_stoptimers(uih);
+ uih_cycling_stop(uih);
+ uih_savepalette(uih);
+ driver->getsize(&w, &h);
+ assert(w > 0 && w < 65000 && h > 0 && h < 65000);
+ if (w != uih->image->width || h != uih->image->height
+ || (driver->flags & UPDATE_AFTER_RESIZE)
+ || uih->palette->type != driver->imagetype) {
+ driver->free_buffers(NULL, NULL);
+ destroy_image(uih->image);
+ destroypalette(uih->palette);
+ ui_mkimages(w, h);
+ if (!uih_updateimage(uih, image)) {
+ driver->uninit();
+ x_error(gettext("Can not allocate tables"));
+ ui_outofmem();
+ exit_xaos(-1);
+ }
+ tl_process_group(syncgroup, NULL);
+ tl_reset_timer(maintimer);
+ tl_reset_timer(arrowtimer);
+ uih_newimage(uih);
+ }
+ uih_newimage(uih);
+ uih_restorepalette(uih);
+ /*uih_mkdefaultpalette(uih); */
+ uih->display = 1;;
+ uih_cycling_continue(uih);
+}
+
+static void ui_driver(int d)
+{
+ CONST struct ui_driver *driver1;
+ int width, height;
+ ui_closemenus();
+ ui_closedialog(0);
+ ui_close_help();
+ if (d < 0)
+ d = 0;
+ if (d >= ndrivers)
+ d = ndrivers - 1;
+ uih_stoptimers(uih);
+ driver1 = driver;
+ uih_clearwindows(uih);
+ uih_cycling_off(uih);
+ uih_savepalette(uih);
+ driver->free_buffers(NULL, NULL);
+ driver->uninit();
+ driver = drivers[d];
+ if (!driver->init()) {
+ driver = driver1;
+ uih_error(uih, gettext("Can not initialize driver"));
+ if (!driver1->init()) {
+ x_fatalerror(gettext
+ ("Can not return back to previous driver"));
+ } else
+ driver = driver1;
+ }
+ driver->getsize(&width, &height);
+ destroy_image(uih->image);
+ destroypalette(uih->palette);
+ uih->flags = driver->flags;
+ ui_mkimages(width, height);
+ if (!uih_updateimage(uih, image)) {
+ driver->uninit();
+ x_error(gettext("Can not allocate tables"));
+ ui_outofmem();
+ exit_xaos(-1);
+ }
+ if (driver->gui_driver && driver->gui_driver->setrootmenu)
+ driver->gui_driver->setrootmenu(uih, uih->menuroot);
+ tl_process_group(syncgroup, NULL);
+ tl_reset_timer(maintimer);
+ tl_reset_timer(arrowtimer);
+ uih->display = 1;
+ uih_newimage(uih);
+ uih_restorepalette(uih);
+ ui_updatestatus();
+ uih_updatemenus(uih, driver->name);
+}
+
+static void ui_mainloop(int loop)
+{
+ int inmovement = 1;
+ int x, y, b, k;
+ int time;
+ driver->processevents((!inmovement && !uih->inanimation), &x, &y, &b,
+ &k);
+ do {
+ mousetype(uih->play ? REPLAYMOUSE : uih->
+ inhibittextoutput ? VJMOUSE : NORMALMOUSE);
+ if (uih->display) {
+ uih_prepare_image(uih);
+ ui_updatestatus();
+ }
+ if ((time = tl_process_group(syncgroup, NULL)) != -1) {
+ if (!inmovement && !uih->inanimation) {
+ if (time > 1000000 / 50)
+ time = 1000000 / 50;
+ if (time > delaytime) {
+ tl_sleep(time - delaytime);
+ tl_update_time();
+ }
+ }
+ inmovement = 1;
+ }
+ if (delaytime || maxframerate) {
+ tl_update_time();
+ time = tl_lookup_timer(loopt);
+ tl_reset_timer(loopt);
+ time = 1000000 / maxframerate - time;
+ if (time < delaytime)
+ time = delaytime;
+ if (time) {
+ tl_sleep(time);
+ tl_update_time();
+ }
+ }
+ processbuffer();
+ driver->processevents((!inmovement && !uih->inanimation), &x, &y,
+ &b, &k);
+
+ inmovement = 0;
+ ui_mouse(x, y, b, k);
+ if (todriver)
+ ui_driver(todriver - 1), todriver = 0;
+ if (callresize)
+ ui_resize(), callresize = 0;
+ } while (loop);
+}
diff --git a/src/ui/ui.pri b/src/ui/ui.pri
new file mode 100644
index 0000000..75e2dff
--- /dev/null
+++ b/src/ui/ui.pri
@@ -0,0 +1,10 @@
+SOURCES += \
+ $$PWD/drivers.c \
+ $$PWD/ui.c \
+ $$PWD/uihelp.c \
+ $$PWD/param.c \
+ $$PWD/fparams.c \
+ $$PWD/filesel.c \
+ $$PWD/uimenu.c \
+ $$PWD/pipecmd.c \
+ $$PWD/dialog.c
diff --git a/src/ui/uihelp.c b/src/ui/uihelp.c
new file mode 100644
index 0000000..d597e25
--- /dev/null
+++ b/src/ui/uihelp.c
@@ -0,0 +1,486 @@
+#include <config.h>
+#ifdef _plan9_
+#include <u.h>
+#include <libc.h>
+#else
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#include <string.h>
+#endif
+
+#include <fconfig.h>
+#include <filter.h>
+#include <fractal.h>
+#include <ui_helper.h>
+#include <ui.h>
+#include <xshl.h>
+#include <xmenu.h>
+#include <grlib.h>
+#include <misc-f.h>
+#include "uiint.h"
+#define HISTORYSIZE 10
+static int historypos;
+static struct xshl_line *lines;
+static int helpwidth, helpheight, helpx, helpy;
+static struct uih_window *helpw;
+static int textheight;
+static char *ui_helppage[HISTORYSIZE];
+static int ui_helppos[HISTORYSIZE];
+int helpvisible;
+
+static struct xshl_item *presseditem;
+static struct xshl_item *selecteditem;
+static int pressedline;
+static int selectedline;
+#define SCROOLSIZE 10
+#define XPOS(xp) (2 * BORDERWIDTH + (xp))
+#define YPOS(yp) (2*BORDERWIDTH+ (yp)-ui_helppos[historypos]+10)
+#define SCROOLSTART (helpx+helpwidth-WBORDERS)
+#define WBORDERS (4*BORDERWIDTH+SCROOLSIZE)
+#define HBORDERS (xtextheight(uih->font)+8*BORDERHEIGHT)
+#define WIDTH (uih->image->width-WBORDERS)
+#define HEIGHT (uih->image->height-HBORDERS)
+
+static int pressedbutton = -1;
+static int selectedbutton = -1;
+
+#define NBUTTONS 3
+CONST char *CONST names[] = { "OK", "Back", "Main" };
+
+#define BUTTONSTART(i) (helpx+BORDERWIDTH+(helpwidth-2*BORDERWIDTH)/NBUTTONS*(i))
+static void ui_build_help(char *name);
+static void ui_backhelp(void)
+{
+ historypos--;
+ if (historypos < 0)
+ historypos = HISTORYSIZE - 1;
+ ui_build_help(ui_helppage[historypos]);
+}
+
+static void do_button(int i)
+{
+ switch (i) {
+ case 0:
+ ui_close_help();
+ break;
+ case 1:
+ ui_backhelp();
+ break;
+ case 2:
+ ui_help("main");
+ break;
+ }
+}
+
+void ui_close_help(void)
+{
+ if (helpw != NULL) {
+ xshl_free(lines);
+ helpvisible = 0;
+ uih_removew(uih, helpw);
+ uih->display = 1;
+ helpw = NULL;
+ }
+}
+
+static int getwidth(void *data, int flags, CONST char *text)
+{
+ if (uih->image->flags & AAIMAGE)
+ return (xtextwidth(uih->font, text));
+ return (xtextwidth(uih->font, text) - 1);
+}
+
+static void
+helpsize(struct uih_context *c, int *x, int *y, int *width, int *height,
+ void
+ *data)
+{
+ *x = helpx;
+ *y = helpy;
+ *width = helpwidth;
+ *height = helpheight;
+}
+
+static void drawhelp(struct uih_context *c, void *data)
+{
+ int i = 0;
+ int y;
+ int percentx, percenty;
+ struct xshl_item *curritem;
+ uih_drawborder(uih, helpx + BORDERWIDTH, helpy + BORDERHEIGHT,
+ helpwidth - WBORDERS + SCROOLSIZE,
+ helpheight - HBORDERS, BORDER_PRESSED);
+
+ if (ui_helppos[historypos] > textheight - helpheight / 2 + HBORDERS)
+ ui_helppos[historypos] = textheight - helpheight / 2 + HBORDERS;
+ if (ui_helppos[historypos] < 0)
+ ui_helppos[historypos] = 0;
+
+ /*draw scroolbar */
+ percentx =
+ (helpheight - HBORDERS) * ui_helppos[historypos] / textheight;
+ percenty =
+ (helpheight - HBORDERS) * (ui_helppos[historypos] + helpheight -
+ HBORDERS) / textheight;
+ if (percentx < BORDERHEIGHT)
+ percentx = BORDERHEIGHT;
+ if (percenty < BORDERHEIGHT)
+ percenty = BORDERHEIGHT;
+ if (percentx > helpheight - HBORDERS - BORDERHEIGHT)
+ percentx = helpheight - HBORDERS - BORDERHEIGHT;
+ if (percenty > helpheight - HBORDERS - BORDERHEIGHT)
+ percenty = helpheight - HBORDERS - BORDERHEIGHT;
+ uih_drawborder(uih, SCROOLSTART, helpy + BORDERHEIGHT + percentx,
+ SCROOLSIZE - 1, percenty - percentx, 0);
+ for (i = 0; i < NBUTTONS; i++) {
+ ui_drawbutton(names[i], pressedbutton == i, selectedbutton == i,
+ BUTTONSTART(i) + BORDERWIDTH,
+ BUTTONSTART(i + 1) - BORDERWIDTH,
+ helpy + helpheight - BUTTONHEIGHT - BORDERHEIGHT);
+ }
+
+
+ i = 0;
+ while (YPOS(lines[i].y) < 2 * BORDERWIDTH) {
+ i++;
+ if (lines[i].y < 0)
+ return;
+ }
+ while ((y =
+ YPOS(lines[i].y)) <
+ helpheight - HBORDERS - xtextheight(uih->font)
+ && lines[i].y >= 0) {
+ curritem = lines[i].first;
+ while (curritem != NULL) {
+ unsigned int bgcolor = BGCOLOR(uih);
+ unsigned int fgcolor = /*FGCOLOR (uih) */ LIGHTGRAYCOLOR2(uih);
+ int flags = 0;
+ int x = XPOS(curritem->x);
+
+ if (curritem->c.flags & (XSHL_BIG | XSHL_RED))
+ fgcolor = SELCOLOR(uih);
+ else if (curritem->c.flags & (XSHL_EMPH | XSHL_MONOSPACE))
+ fgcolor =
+ uih->image->
+ flags & AAIMAGE ? SELCOLOR(uih) : FGCOLOR(uih);
+ else if (curritem->c.flags & (XSHL_BLACK))
+ bgcolor = fgcolor = BGCOLOR(uih), flags = TEXT_PRESSED;
+ else
+ bgcolor = fgcolor, flags |= TEXT_PRESSED;
+ if (uih->palette->type & BITMAPS) {
+ flags = TEXT_PRESSED;
+ fgcolor = BGCOLOR(uih);
+ }
+ if (curritem->c.linktext != NULL) {
+ if (uih->palette->type & BITMAPS) {
+ if (curritem == presseditem
+ || curritem == selecteditem)
+ fgcolor =
+ FGCOLOR(uih), xrectangle(uih->image, x + helpx,
+ y + helpy,
+ curritem->width,
+ xtextheight(uih->
+ font),
+ BGCOLOR(uih));
+ else
+ xhline(uih->image, x + helpx,
+ y + helpy + xtextheight(uih->font) - 1,
+ curritem->width, BGCOLOR(uih));
+ } else {
+ if (uih->image->flags & AAIMAGE)
+ fgcolor = curritem == presseditem
+ || curritem ==
+ selecteditem ? SELCOLOR(uih) : BGCOLOR(uih);
+ else {
+ int i;
+ i = strlen(curritem->c.linktext);
+ if (i > 3
+ && !strcmp(".xaf",
+ curritem->c.linktext + i - 4))
+ xhline(uih->image, x + helpx,
+ y + helpy + xtextheight(uih->font) - 1,
+ curritem->width, curritem == presseditem
+ || curritem ==
+ selecteditem ? SELCOLOR(uih) :
+ SELCOLOR(uih));
+ else
+ xhline(uih->image, x + helpx,
+ y + helpy + xtextheight(uih->font) - 1,
+ curritem->width, curritem == presseditem
+ || curritem ==
+ selecteditem ? SELCOLOR(uih) :
+ LIGHTGRAYCOLOR2(uih));
+ xhline(uih->image, x + helpx + 1,
+ y + helpy + xtextheight(uih->font) - 0,
+ curritem->width, BGCOLOR(uih));
+ }
+ flags = 0;
+ bgcolor = BGCOLOR(uih);
+ if (fgcolor == LIGHTGRAYCOLOR2(uih))
+ fgcolor = FGCOLOR(uih);
+ if (curritem == presseditem
+ || curritem == selecteditem)
+ fgcolor = SELCOLOR(uih);
+ }
+ }
+ xprint(uih->image, uih->font, x + helpx, y + helpy,
+ curritem->text, fgcolor, bgcolor, flags);
+ curritem = curritem->next;
+ }
+ i++;
+ }
+}
+
+int ui_helpkeys(int key)
+{
+ int i;
+ if (helpw == NULL)
+ return 0;
+ switch (key) {
+ case 'h':
+ ui_close_help();
+ ui_menu("tutor");
+ return 1;
+ case 'm':
+ ui_help("main");
+ return 1;
+ case UIKEY_DOWN:
+ case 'j':
+ ui_helppos[historypos] += 8, uih->display = 1;
+ presseditem = NULL;
+ selecteditem = NULL;
+ break;
+ case UIKEY_UP:
+ case 'k':
+ ui_helppos[historypos] -= 8, uih->display = 1;
+ presseditem = NULL;
+ selecteditem = NULL;
+ break;
+ case UIKEY_PGDOWN:
+ case '+':
+ case 'f':
+ case ' ':
+ ui_helppos[historypos] +=
+ helpheight - HBORDERS - 32, uih->display = 1;
+ presseditem = NULL;
+ selecteditem = NULL;
+ break;
+ case UIKEY_PGUP:
+ case '-':
+ ui_helppos[historypos] -=
+ helpheight - HBORDERS - 32, uih->display = 1;
+ presseditem = NULL;
+ selecteditem = NULL;
+ break;
+ case 'b':
+ case 1:
+ ui_backhelp();
+ break;
+ case UIKEY_ESC:
+ case 'q':
+ case 'c':
+ case 'o':
+ ui_close_help();
+ break;
+ case UIKEY_TAB:
+ case UIKEY_RIGHT:
+ uih->display = 1;
+ if (selectedbutton < 0 || selectedbutton == NBUTTONS - 1) {
+ if (selecteditem == NULL) {
+ i = 0;
+ while (YPOS(lines[i].y) < 2 * BORDERWIDTH) {
+ i++;
+ if (lines[i].y < 0)
+ break;
+ }
+ selecteditem = lines[i].first;
+ } else
+ i = selectedline, selecteditem = selecteditem->next;
+ for (;
+ lines[i].y >= 0
+ && YPOS(lines[i].y) < helpheight - HBORDERS; i++) {
+ selectedline = i;
+ while (selecteditem != NULL) {
+ if (selecteditem->c.linktext != NULL) {
+ selectedbutton = -1;
+ return 0;
+ }
+ selecteditem = selecteditem->next;
+ }
+ selecteditem = lines[i + 1].first;
+ }
+ selecteditem = NULL;
+ selectedbutton = 0;
+ } else
+ selectedbutton++;
+ break;
+ case 13:
+ case '\n':
+ if (selecteditem != NULL) {
+ ui_help(selecteditem->c.linktext);
+ return 1;
+ }
+ if (selectedbutton >= 0)
+ do_button(selectedbutton);
+ }
+ return 1;
+}
+
+int ui_helpmouse(int x, int y, int buttons, int flags)
+{
+ static int grabbed = 0;
+ int atpressed = 0;
+ if (helpw == NULL)
+ return 0;
+ if (x < helpx || y < helpy || x > helpx + helpwidth
+ || y > helpy + helpheight) {
+ if (flags & MOUSE_PRESS)
+ ui_close_help();
+ pressedbutton = -1;
+ if (pressedbutton != -1)
+ pressedbutton = -1, uih->display = 1;
+ return 1;
+ } else {
+ if (y > helpy + helpheight - BUTTONHEIGHT - 2 * BORDERHEIGHT) {
+ int button;
+ int i;
+ for (i = 0; i <= NBUTTONS; i++)
+ if (x < BUTTONSTART(i))
+ break;
+ button = i - 1;
+ if (flags & MOUSE_DRAG) {
+ if (pressedbutton != selectedbutton
+ || pressedbutton != button)
+ pressedbutton = selectedbutton = button, uih->display =
+ 1;
+ } else {
+ if (pressedbutton != -1)
+ pressedbutton = -1, uih->display = 1;
+ if (flags & MOUSE_RELEASE)
+ do_button(button);
+ }
+ return 1;
+ }
+ if (pressedbutton != -1)
+ pressedbutton = -1, uih->display = 1;
+ if (buttons
+ && ((x > SCROOLSTART && y < helpy + helpheight - HBORDERS)
+ || grabbed)) {
+ /*we are in scroolbar */
+ int pos = (y - helpy) * textheight / (helpheight - HBORDERS);
+ if (pos != ui_helppos[historypos])
+ ui_helppos[historypos] = pos, uih->display = 1;
+ grabbed = 1;
+ return 1;
+ } else
+ grabbed = 0;
+ y -= helpy + xtextheight(uih->font);
+ x -= 2 * BORDERWIDTH + helpx;
+ pressedbutton = -1;
+ if (presseditem != NULL) {
+ if (YPOS(lines[pressedline].y) + 1 >= y
+ && YPOS(lines[pressedline].y) <= y + xtextheight(uih->font)
+ && presseditem->x <= x
+ && presseditem->x + presseditem->width >= x)
+ atpressed = 1;
+ }
+ if (flags & MOUSE_PRESS || ((flags & MOUSE_DRAG) && !atpressed)) {
+ int i = 0;
+ for (i = 0;
+ lines[i].y >= 0 && (YPOS(lines[i].y) + 1 <= y
+ || YPOS(lines[i].y) >=
+ y + xtextheight(uih->font)); i++);
+ if (lines[i].y >= 0) {
+ struct xshl_item *item = lines[i].first;
+ while (item != NULL) {
+ if (item->c.linktext != NULL && item->x <= x
+ && item->x + item->width >= x)
+ break;
+ item = item->next;
+ }
+ if (item != NULL) {
+ uih->display = 1;
+ presseditem = item;
+ pressedline = i;
+ }
+ }
+ } else if (flags & MOUSE_MOVE) {
+ if (!atpressed && presseditem != NULL)
+ uih->display = 1, presseditem = 0;
+ } else if ((flags & MOUSE_RELEASE)) {
+ if (atpressed) {
+ ui_help(presseditem->c.linktext);
+ return 1;
+ }
+ if (presseditem != NULL)
+ presseditem = NULL, uih->display = 1;
+ /*odfajruj to! */
+ }
+ }
+ return 1;
+}
+
+static void ui_build_help(char *name)
+{
+ int i;
+ int width;
+ if (ui_nogui) {
+ printf("help \"%s\"\n", name);
+ return;
+ }
+ if (driver->gui_driver && driver->gui_driver->help) {
+ driver->gui_driver->help(uih, name);
+ return;
+ }
+ if (helpw != NULL)
+ ui_close_help();
+ pressedbutton = -1;
+ helpvisible = 1;
+ width = 80 * xtextwidth(uih->font, "w");
+ if (width > WIDTH)
+ width = WIDTH;
+ lines =
+ help_make(name ? name : "main", getwidth, width - 2,
+ xtextheight(uih->font), xtextheight(uih->font));
+ if (lines == NULL) {
+ lines =
+ help_make("main", getwidth, width - 2, xtextheight(uih->font),
+ xtextheight(uih->font));
+ if (lines == NULL) {
+ helpvisible = 0;
+ uih_message(uih, "Help file not found");
+ return;
+ }
+ }
+ width += WBORDERS;
+ uih->display = 1;
+ presseditem = selecteditem = NULL;
+ helpwidth = width;
+ helpx = (uih->image->width - width) / 2;
+ for (i = 0; lines[i].y >= 0; i++);
+ textheight = lines[i - 1].y + 4 * xtextheight(uih->font);
+ if (textheight < HEIGHT)
+ helpheight = textheight;
+ else
+ helpheight = HEIGHT;
+ helpheight += HBORDERS;
+ helpy = (uih->image->height - helpheight) / 2;
+ helpw = uih_registerw(uih, helpsize, drawhelp, 0, DRAWBORDER);
+}
+
+void ui_help(CONST char *name)
+{
+ if (strlen(name) > 4 && !strcmp(name + strlen(name) - 4, ".xaf")) {
+ uih_playtutorial(uih, name);
+ if (helpw != NULL)
+ ui_close_help();
+ /*FIXME!!!!!!! This needs to be queued! */
+ return;
+ }
+ historypos++;
+ historypos %= HISTORYSIZE;
+ ui_helppage[historypos] = mystrdup(name); /* NOTE we are not freeing this memory. I believe it is not problem. */
+ ui_helppos[historypos] = 0;
+ ui_build_help(ui_helppage[historypos]);
+}
diff --git a/src/ui/uiint.h b/src/ui/uiint.h
new file mode 100644
index 0000000..16223f1
--- /dev/null
+++ b/src/ui/uiint.h
@@ -0,0 +1,75 @@
+#ifndef UI_INT_H
+#define UI_INT_H
+
+#define MOUSE_PRESS 1
+#define MOUSE_RELEASE 2
+#define MOUSE_DRAG 4
+#define MOUSE_MOVE 8
+
+#define BORDERWIDTH 2
+#define BORDERHEIGHT 2
+
+#define BUTTONHEIGHT (xtextheight(uih->font)+2*BORDERWIDTH)
+
+struct ui_textdata {
+ int x, y, width;
+ char *text;
+ int size;
+ int cursor;
+ int cursorpos;
+ int start;
+ int ndisplayed;
+ int clear;
+};
+extern uih_context *uih;
+extern CONST struct ui_driver *driver;
+extern CONST int ndrivers;
+extern CONST struct ui_driver *CONST drivers[];
+extern int ui_nmenus;
+extern char *ui_helptext[];
+extern int ui_helpsize;
+extern CONST struct params ui_fractal_params[];
+extern int filevisible, helpvisible, dialogvisible, yesnodialogvisible;
+extern int ui_nogui;
+
+float ui_get_windowwidth(int width);
+float ui_get_windowheight(int height);
+
+void ui_updatetext(struct ui_textdata *d);
+struct ui_textdata *ui_opentext(int x, int y, int width, CONST char *def);
+void ui_drawtext(struct ui_textdata *d, int active);
+void ui_textmouse(struct ui_textdata *d, int x, int y);
+void ui_closetext(struct ui_textdata *d);
+int ui_textkey(struct ui_textdata *d, int key);
+
+int ui_menumouse(int x, int y, int mousebuttons, int flags);
+int ui_menukey(int key);
+int ui_menuwidth(void);
+void ui_closemenus(void);
+
+int ui_dorender_params(void);
+
+void ui_updatestarts(void);
+
+void ui_builddialog(CONST menuitem * d);
+void ui_close_help(void);
+void ui_closedialog(int call);
+int ui_dialogmouse(int x, int y, int mousebuttons, int flags);
+int ui_dialogkeys(int key);
+void ui_buildyesno(CONST char *question, void (*handler) (int yes));
+void ui_drawbutton(CONST char *text, int pressed, int selected, int x1,
+ int x2, int y);
+
+
+void ui_buildfilesel(CONST char *f, CONST char *m,
+ void (*c) (CONST char *, int));
+int ui_keyfilesel(int k);
+int ui_mousefilesel(int x, int y, int buttons, int flags);
+void ui_closefilesel(int succ);
+
+
+void ui_pipe_init(CONST char *name);
+int ui_helpkeys(int key);
+int ui_helpmouse(int x, int y, int buttons, int flags);
+
+#endif
diff --git a/src/ui/uimenu.c b/src/ui/uimenu.c
new file mode 100644
index 0000000..b920c48
--- /dev/null
+++ b/src/ui/uimenu.c
@@ -0,0 +1,572 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#undef _EFENCE_
+#ifdef _plan9_
+#include <u.h>
+#include <libc.h>
+#include <ctype.h>
+#else
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#endif
+#include <config.h>
+#include <fconfig.h>
+#ifndef _plan9_
+#include <assert.h>
+#endif
+#include <filter.h>
+#include <ui_helper.h>
+#include <ui.h>
+#include <timers.h>
+#include <xmenu.h>
+#include <grlib.h>
+#include "uiint.h"
+
+
+#define NMENUS 20
+struct ui_menuitems {
+ int x, y, width, height;
+ CONST menuitem *item;
+ int separator;
+};
+static struct ui_menu {
+ int x, y, width, height;
+ CONST char *name;
+ CONST char *fullname;
+ int namewidth;
+ int selected;
+ int n;
+ int flags;
+ struct ui_menuitems *items;
+ struct uih_window *window;
+ tl_timer *timer;
+} *ui_menus[NMENUS];
+int ui_nmenus;
+
+#define MENU_HORIZONTAL 1
+#define MENU_PRESSED 2
+#define MENU_AUTOHIDE 4
+
+#define SUBMENUWIDTH xtextwidth(uih->font, ">")
+#define MENUPAUSE xtextwidth(uih->font, "X")
+#define MENUWIDTH(a) (xtextwidth(uih->font, "w")+MENUPAUSE+xtextwidth(uih->font, a)+SUBMENUWIDTH)
+#define HMENUWIDTH(a) (xtextwidth(uih->font, a)+xtextwidth(uih->font, " "))
+
+#define SEPARATORSIZE 6
+static struct ui_menuitems *ui_getmenuitems(CONST char *name, int *width1,
+ int *height1, int *n1,
+ int horizontal)
+{
+ CONST menuitem *item;
+ int nseparators = 0;
+ int i;
+ int width = 0;
+ int n;
+ struct ui_menuitems *items;
+ for (n = 0; (item = menu_item(name, n)) != NULL; n++)
+ if (item->type == MENU_SEPARATOR)
+ nseparators++;
+ n -= nseparators;
+ *n1 = n;
+ *height1 = n * xtextheight(uih->font) + nseparators * SEPARATORSIZE;
+ items =
+ (struct ui_menuitems *) malloc(n * sizeof(struct ui_menuitems));
+ nseparators = 0;
+ for (i = 0; i < n; i++) {
+ int w;
+ int sbehind = -1;
+ nseparators--;
+ do {
+ nseparators++;
+ sbehind++;
+ item = menu_item(name, i + nseparators);
+ }
+ while (item->type == MENU_SEPARATOR);
+ items[i].item = item;
+ items[i].separator = sbehind;
+ if (horizontal) {
+ w = HMENUWIDTH(items[i].item->name);
+ if (items[i].item->key) {
+ char c[10];
+ sprintf(c, "(%s)", items[i].item->key);
+ w += xtextwidth(uih->font, c);
+ }
+ } else {
+ w = MENUWIDTH(items[i].item->name);
+ if (items[i].item->key) {
+ char c[10];
+ sprintf(c, " %s ", items[i].item->key);
+ w += xtextwidth(uih->font, c);
+ }
+ }
+ items[i].width = w;
+ items[i].height = xtextheight(uih->font) + 1;
+ if (w > width)
+ width = w;
+ }
+ *width1 = width;
+ return (items);
+}
+
+static void
+ui_menusize(uih_context * c, int *x, int *y, int *w, int *h, void *data)
+{
+ struct ui_menu *m = (struct ui_menu *) data;
+ *x = m->x;
+ *y = m->y;
+ *w = m->width;
+ *h = m->height;
+}
+
+static void ui_drawmenu(uih_context * c, void *data)
+{
+ struct ui_menu *m = (struct ui_menu *) data;
+ int i;
+ int width1 = xtextwidth(c->font, "w");
+ char s[2];
+ s[1] = 0;
+ if (!(m->flags & MENU_HORIZONTAL))
+ xprint(c->image, c->font, m->x + (m->width - m->namewidth) / 2,
+ m->y + BORDERWIDTH, m->fullname, SELCOLOR(c),
+ BGCOLOR(c), 0);
+ for (i = 0; i < m->n; i++) {
+ int color = (i == m->selected ? SELCOLOR(c) : FGCOLOR(c));
+ int pressed = 0;
+ if ((uih->palette->type & BITMAPS) && i == m->selected) {
+ pressed = TEXT_PRESSED;
+ color = BGCOLOR(c);
+ xrectangle(uih->image, m->items[i].x, m->items[i].y,
+ m->items[i].width, m->items[i].height, FGCOLOR(c));
+ }
+ if (!(m->flags & MENU_HORIZONTAL)) {
+ if (m->items[i].separator) {
+ xhline(c->image, m->x + 5,
+ m->items[i].y - 2 - SEPARATORSIZE / 2,
+ m->width - 10, BGCOLOR(c));
+ xhline(c->image, m->x + 5,
+ m->items[i].y - 1 - SEPARATORSIZE / 2,
+ m->width - 10, LIGHTGRAYCOLOR(c));
+ }
+ if (i < 10)
+ s[0] = '0' + (i == 9 ? 0 : i + 1);
+ else
+ s[0] = 'A' + (i - 10);
+ xprint(c->image, c->font, m->items[i].x, m->items[i].y, s,
+ color, BGCOLOR(c), pressed);
+ if (menu_enabled(m->items[i].item, uih)) {
+ xprint(c->image, c->font, m->items[i].x + width1,
+ m->items[i].y, "X", color, BGCOLOR(c),
+ pressed);
+ }
+ xprint(c->image, c->font, m->items[i].x + width1 + MENUPAUSE,
+ m->items[i].y, m->items[i].item->name,
+ color, BGCOLOR(c), pressed);
+ if (m->items[i].item->key) {
+ char ch[20];
+ sprintf(ch, " %s ", m->items[i].item->key);
+ xprint(c->image, c->font,
+ m->items[i].x + m->items[i].width - SUBMENUWIDTH -
+ xtextwidth(uih->font, ch), m->items[i].y, ch,
+ LIGHTGRAYCOLOR(c), BGCOLOR(c),
+ pressed);
+ }
+ if (m->items[i].item->type == MENU_SUBMENU)
+ xprint(c->image, c->font,
+ m->items[i].x + m->items[i].width - SUBMENUWIDTH,
+ m->items[i].y, ">", color, BGCOLOR(c),
+ pressed);
+ } else {
+ xprint(c->image, c->font, m->items[i].x, m->items[i].y,
+ m->items[i].item->name, color, BGCOLOR(c),
+ pressed);
+ if (m->items[i].item->key) {
+ char ch[20];
+ sprintf(ch, "%s", m->items[i].item->key);
+ xprint(c->image, c->font,
+ m->items[i].x + xtextwidth(uih->font,
+ m->items[i].item->name) +
+ 2, m->items[i].y, ch,
+ LIGHTGRAYCOLOR(c), BGCOLOR(c), pressed);
+ }
+ }
+ }
+}
+
+static struct ui_menu *ui_buildmenu(CONST char *name, int x, int y,
+ int flags)
+{
+ int shift = 0;
+ int width, height;
+ int textheight = xtextheight(uih->font);
+ struct ui_menu *menu;
+ int i;
+ menu = (struct ui_menu *) malloc(sizeof(*menu));
+ menu->timer = tl_create_timer();
+ tl_reset_timer(menu->timer);
+ menu->flags = flags;
+ menu->items =
+ ui_getmenuitems(name, &width, &height, &menu->n,
+ flags & MENU_HORIZONTAL);
+ menu->selected = -1;
+ menu->fullname = menu_fullname(name);
+ menu->name = name;
+ menu->namewidth = xtextwidth(uih->font, menu->fullname);
+ if (!(menu->flags & MENU_HORIZONTAL)) {
+ if (menu->namewidth > width)
+ width = menu->namewidth;
+ width += 2 * BORDERWIDTH;
+ height += 2 * BORDERHEIGHT + xtextheight(uih->font);
+ if (x + width > uih->image->width)
+ x = uih->image->width - width;
+ if (y + height > uih->image->height)
+ y = uih->image->height - height;
+ if (x < 0)
+ x = 0;
+ if (y < 0)
+ y = 0;
+ shift = 0;
+ for (i = 0; i < menu->n; i++) {
+ shift += menu->items[i].separator * SEPARATORSIZE;
+ menu->items[i].x = x + BORDERWIDTH;
+ menu->items[i].y =
+ y + BORDERWIDTH + textheight * (i + 1) + shift;
+ menu->items[i].width = width - 2 * BORDERWIDTH;
+ menu->items[i].height = textheight;
+ }
+ } else {
+ int line = 0;
+ int xpos = BORDERWIDTH;
+ x = 0, width = uih->image->width;
+ for (i = 0; i < menu->n; i++) {
+ if (xpos + 2 * BORDERWIDTH + menu->items[i].width >
+ uih->image->width)
+ xpos = BORDERWIDTH, line++;
+ menu->items[i].x = xpos;
+ menu->items[i].y = y + BORDERWIDTH + line * textheight;
+ xpos += menu->items[i].width;
+ menu->items[i].height = textheight;
+ }
+ height = (line + 1) * textheight + 2 * BORDERWIDTH;
+ }
+ menu->selected = -1;
+ menu->window =
+ uih_registerw(uih, ui_menusize, ui_drawmenu, menu, DRAWBORDER);
+ uih->display = 1;
+ menu->x = x;
+ menu->y = y;
+ menu->width = width;
+ menu->height = height;
+ return (menu);
+}
+
+static void ui_closemenu(struct ui_menu *menu)
+{
+ free(menu->items);
+ tl_free_timer(menu->timer);
+ uih_removew(uih, menu->window);
+ uih->display = 1;
+ free(menu);
+}
+
+static void ui_openmenu(CONST char *name, int x, int y, int flags)
+{
+ if (ui_nogui) {
+ printf("menu \"%s\"\n", name);
+ return;
+ }
+ if (driver->gui_driver && driver->gui_driver->menu) {
+ driver->gui_driver->menu(uih, name);
+ return;
+ }
+ if (ui_nmenus > NMENUS)
+ return;
+ ui_menus[ui_nmenus] = ui_buildmenu(name, x, y, flags);
+ ui_nmenus++;
+ ui_updatestarts();
+}
+
+static void ui_closetopmenu(void)
+{
+ if (!ui_nmenus)
+ return;
+ ui_nmenus--;
+ ui_closemenu(ui_menus[ui_nmenus]);
+ ui_updatestarts();
+}
+
+void ui_closemenus(void)
+{
+ while (ui_nmenus)
+ ui_closetopmenu();
+}
+
+void ui_menu(CONST char *m)
+{
+ int mousex, mousey, buttons;
+ driver->getmouse(&mousex, &mousey, &buttons);
+ ui_openmenu(m, mousex, mousey, 0);
+}
+
+static void ui_menupress(int number)
+{
+ CONST menuitem *item;
+ if (number >= ui_menus[ui_nmenus - 1]->n)
+ return;
+ ui_menus[ui_nmenus - 1]->selected = number;
+ item = ui_menus[ui_nmenus - 1]->items[number].item;
+ if (item != NULL) {
+ uih->display = 1;
+ if (item->type == MENU_SUBMENU) {
+ int flags = 0;
+ int mousex, mousey, buttons;
+ driver->getmouse(&mousex, &mousey, &buttons);
+ if (buttons & BUTTON1)
+ flags |= MENU_PRESSED;
+ if ((ui_menus[ui_nmenus - 1]->flags & MENU_HORIZONTAL))
+ ui_openmenu(item->shortname,
+ ui_menus[ui_nmenus - 1]->items[number].x,
+ ui_menus[ui_nmenus - 1]->items[number].y +
+ ui_menus[ui_nmenus - 1]->items[number].height,
+ flags);
+ else
+ ui_openmenu(item->shortname,
+ ui_menus[ui_nmenus - 1]->items[number].x +
+ ui_menus[ui_nmenus - 1]->items[number].width,
+ ui_menus[ui_nmenus - 1]->items[number].y,
+ flags);
+ } else
+ ui_menuactivate(item, NULL);
+ }
+}
+
+int ui_menumouse(int x, int y, int mousebuttons, int flags)
+{
+ if (ui_nmenus) {
+ struct ui_menu *m = ui_menus[ui_nmenus - 1];
+ int place = -1;
+ int inmenu = 0;
+ if (x >= m->x && y >= m->y && x <= m->x + m->width
+ && y <= m->y + m->height) {
+ int i;
+ for (i = 0; i < m->n; i++) {
+ if (x >= m->items[i].x && y >= m->items[i].y
+ && x <= m->items[i].x + m->items[i].width
+ && y <= m->items[i].y + m->items[i].height) {
+ place = i;
+ break;
+ }
+ }
+ inmenu = 1;
+ } else {
+ if (ui_nmenus > 1) {
+ struct ui_menu *m2 = ui_menus[ui_nmenus - 2];
+ int i;
+ i = m2->selected;
+ if (x >= m2->items[i].x && y >= m2->items[i].y
+ && x <= m2->items[i].x + m2->items[i].width
+ && y <= m2->items[i].y + m2->items[i].height)
+ inmenu = 1;
+ }
+ }
+ if ((m->flags & MENU_AUTOHIDE) && !inmenu) {
+ ui_closetopmenu();
+ return (ui_menumouse(x, y, mousebuttons, flags));
+ }
+ if (flags & MOUSE_MOVE && m->selected != place)
+ m->selected = place, uih->display = 1;
+ if (m->flags & MENU_PRESSED) {
+ if (inmenu && place >= 0 && (m->flags & MENU_HORIZONTAL)
+ && (flags & MOUSE_DRAG)
+ && m->items[place].item->type == MENU_SUBMENU) {
+ ui_menupress(place);
+ return 1;
+ } else if (inmenu && place >= 0 && (flags & MOUSE_DRAG)
+ && m->items[place].item->type == MENU_SUBMENU
+ && x >
+ m->items[place].x + m->items[place].width -
+ 2 * SUBMENUWIDTH) {
+ ui_menupress(place);
+ return 1;
+ }
+ if (flags & MOUSE_RELEASE || !(flags & MOUSE_DRAG)) {
+ if (tl_lookup_timer(m->timer) < 300000) {
+ m->flags &= ~MENU_PRESSED;
+ return 1;
+ }
+ if (!inmenu || place < 0) {
+ ui_closetopmenu();
+ return (ui_menumouse(x, y, mousebuttons, flags));
+ }
+ ui_menupress(place);
+ return 1;
+ }
+ if (!inmenu) { /*Trace all menus back and look, if user selected some */
+ int nmenu;
+ for (nmenu = ui_nmenus - 2; nmenu > -1; nmenu--) {
+ struct ui_menu *m2 = ui_menus[nmenu];
+ if (x > m2->x && y > m2->y && x < m2->x + m2->width
+ && y < m2->y + m2->height) {
+ ui_closetopmenu();
+ m2->flags |= MENU_PRESSED;
+ return (ui_menumouse(x, y, mousebuttons, flags));
+ }
+ }
+ }
+ } else if (flags & MOUSE_PRESS) {
+ if (!inmenu || place < 0) {
+ ui_closetopmenu();
+ return (ui_menumouse(x, y, mousebuttons, flags));
+ }
+ ui_menupress(place);
+ }
+ return (1);
+ } else {
+ if (!ui_nogui &&
+ (!driver->gui_driver || !driver->gui_driver->setrootmenu) &&
+ (flags & MOUSE_MOVE) && y < xtextheight(uih->font) + 1
+ && !(mousebuttons))
+ ui_openmenu(uih->menuroot, 0, 0,
+ MENU_HORIZONTAL | MENU_AUTOHIDE);
+ }
+ return (0);
+}
+
+int ui_menukey(int key)
+{
+ int k;
+ if (!ui_nmenus) {
+ if (key == '\n' || key == 13) {
+ ui_closemenus();
+ ui_openmenu(uih->menuroot, 0, 0, MENU_HORIZONTAL);
+ return 1;
+ }
+ return 0;
+ } else {
+ struct ui_menu *menu = ui_menus[ui_nmenus - 1];
+ switch (key) {
+ case '\n':
+ case 13:
+ if (menu->selected >= 0)
+ ui_menupress(menu->selected);
+ return 1;
+ case 'h':
+ {
+ CONST menuitem *item = menu->items[menu->selected].item;
+ ui_closemenus();
+ if (menu->selected >= 0) {
+ ui_help(item->shortname);
+ } else
+ ui_help(menu->name);
+ return 1;
+ }
+ case UIKEY_LEFT:
+ if (menu->flags & MENU_HORIZONTAL) {
+ if (menu->selected == -1)
+ menu->selected = 0;
+ else
+ menu->selected--;
+ if (menu->selected < 0)
+ menu->selected = menu->n - 1;
+ uih->display = 1;
+ } else if (ui_nmenus == 2
+ && ui_menus[0]->flags & MENU_HORIZONTAL) {
+ ui_closetopmenu();
+ ui_menus[0]->selected--;
+ if (ui_menus[0]->selected < 0)
+ ui_menus[0]->selected = ui_menus[0]->n - 1;
+ ui_menupress(ui_menus[0]->selected);
+ } else
+ ui_closetopmenu();
+ return 1;
+ case UIKEY_RIGHT:
+ if (menu->flags & MENU_HORIZONTAL) {
+ if (menu->selected == -1)
+ menu->selected = 0;
+ else
+ menu->selected++;
+ menu->selected %= menu->n;
+ uih->display = 1;
+ } else if (menu->selected >= 0
+ && menu->items[menu->selected].item->type ==
+ MENU_SUBMENU) {
+ ui_menupress(menu->selected);
+ } else if (ui_nmenus == 2
+ && ui_menus[0]->flags & MENU_HORIZONTAL) {
+ ui_closetopmenu();
+ ui_menus[0]->selected++;
+ ui_menus[0]->selected %= ui_menus[0]->n;
+ ui_menupress(ui_menus[0]->selected);
+ }
+ return 1;
+ case UIKEY_DOWN:
+ if (menu->flags & MENU_HORIZONTAL) {
+ if (menu->selected >= 0)
+ ui_menupress(ui_menus[0]->selected);
+ } else {
+ if (menu->selected == -1)
+ menu->selected = 0;
+ else
+ menu->selected++;
+ menu->selected %= menu->n;
+ uih->display = 1;
+ }
+ return 1;
+ case UIKEY_ESC:
+ ui_closetopmenu();
+ return 1;
+ case UIKEY_UP:
+ if (menu->flags & MENU_HORIZONTAL) {
+ ui_closetopmenu();
+ } else {
+ if (menu->selected == -1)
+ menu->selected = 0;
+ else
+ menu->selected--;
+ if (menu->selected < 0)
+ menu->selected = menu->n - 1;
+ uih->display = 1;
+ }
+ return 1;
+ }
+ if (tolower(key) >= 'a'
+ && tolower(key) - 'a' < ui_menus[ui_nmenus - 1]->n - 10) {
+ ui_menupress(tolower(key) - 'a' + 10);
+ return 1;
+ }
+ if (key >= '0' && key <= '9') {
+ k = key - '1';
+ if (k == -1)
+ k = 9;
+ ui_menupress(k);
+ return 1;
+ }
+ return 0;
+ }
+}
+
+int ui_menuwidth(void)
+{
+ if (ui_nmenus && (ui_menus[0]->flags & MENU_HORIZONTAL))
+ return (ui_menus[0]->height);
+ return (0);
+}
diff --git a/src/util/Makefile.in b/src/util/Makefile.in
new file mode 100644
index 0000000..36aad5c
--- /dev/null
+++ b/src/util/Makefile.in
@@ -0,0 +1,50 @@
+CC = @CC@
+CFLAGS = @CFLAGS@
+LIBS = @LIBS@ -lm
+LFLAGS = @LDFLAGS@
+AR = @AR@
+RANLIB = @RANLIB@
+
+SRCS = \
+ png.c \
+ catalog.c \
+ thread.c \
+ xstring.c \
+ help.c \
+ xerror.c \
+ xshl.c \
+ xldio.c \
+ xstdio.c \
+ xmenu.c \
+ timers.c
+
+OBJS = $(SRCS:.c=.o)
+
+TLIB = ../lib/libutil.a
+
+
+all: $(TLIB)
+
+$(TLIB):$(OBJS)
+ rm -f $@
+ $(AR) rc $@ $(OBJS)
+ $(RANLIB) $@
+
+clean:
+ rm -f $(TLIB)
+ rm -f *.[oas]
+ rm -f *~
+ rm -f core
+
+distclean:clean
+ rm Makefile
+
+#dep:
+# rm -f .depend
+# make .depend
+#
+#.depend:
+# echo '# Program dependencies' >.depend
+# gcc -I svgalib $(DEFINES) -MM $(patsubst %.o,%.c,$(OBJS)) >>.depend
+#
+#include .depend
diff --git a/src/util/catalog.c b/src/util/catalog.c
new file mode 100644
index 0000000..76cfa69
--- /dev/null
+++ b/src/util/catalog.c
@@ -0,0 +1,253 @@
+#include <config.h>
+#ifndef _plan9_
+#include <string.h>
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#include <string.h>
+#else
+#include <u.h>
+#include <libc.h>
+#endif
+#include <catalog.h>
+#include <misc-f.h>
+/* Well, just simple implementation of unbalanced trees in combination
+ * of small hash table. I am lazy :) but should be OK for my purposes
+ *
+ * This function is used for both-lookups and adds into table (since most of
+ * code is the same, depends whether newvalue is NULL. If newvalue is nonNULL,
+ * new variable is added into table, if name is not present here or value is
+ * changed othewise.
+ */
+static char *find_variable(catalog_t * context, CONST char *name,
+ CONST char *newvalue)
+{
+ int r = 0;
+ int hash = (int) strlen(name);
+ struct varnames *current, *last, *newp;
+ hash =
+ ((unsigned char) (name[0]) + (unsigned char) (name[hash - 1]) +
+ hash) % (unsigned int) CHASHMAX;
+ current = last = context->root[hash];
+ while (current != NULL) {
+ last = current;
+ r = strcmp(current->name, name);
+ if (!r) {
+ if (newvalue != NULL) { /*overwrite value */
+ free(current->value);
+ current->value = mystrdup(newvalue);
+ }
+ return (current->value);
+ }
+ if (r > 0)
+ current = current->left;
+ else
+ current = current->right;
+ }
+ /*Entry is new */
+ if (newvalue == NULL)
+ return (NULL);
+ newp = (struct varnames *) calloc(1, sizeof(struct varnames));
+ newp->name = mystrdup(name);
+ newp->value = mystrdup(newvalue);
+ /*FIXME. Should take a care to full memory */
+ newp->left = NULL;
+ newp->right = NULL;
+ if (last == NULL) {
+ context->root[hash] = newp;
+ } else {
+ if (r > 0)
+ last->left = newp;
+ else
+ last->right = newp;
+ }
+ return (newp->value);
+}
+
+/*
+ * free memory used by node and its sons
+ */
+static void free_node(struct varnames *node)
+{
+ while (node != NULL) {
+ struct varnames *nextnode;
+ free_node(node->left);
+ nextnode = node->right;
+ free(node->name);
+ free(node->value);
+ free(node);
+ node = nextnode;
+ }
+}
+
+/*
+ * free catalog
+ */
+void free_catalog(catalog_t * context)
+{
+ int i;
+ for (i = 0; i < CHASHMAX; i++) {
+ free_node(context->root[i]);
+ context->root[i] = NULL;
+ }
+ free(context);
+}
+
+static catalog_t *alloc_catalog(void)
+{
+ int i;
+ catalog_t *c;
+ c = (catalog_t *) calloc(1, sizeof(catalog_t));
+ if (c == NULL)
+ return NULL;
+ for (i = 0; i < CHASHMAX; i++)
+ c->root[i] = NULL;
+ return c;
+}
+
+/*
+ * Parse an catalog file and save values into memory
+ */
+// FIXME: this macro gives a segfault if \" is used in text. kovzol, 2009-06-29
+#define seterror(text) sprintf(errort,"line %i:%s",line,text),*error=errort
+catalog_t *load_catalog(xio_file f, CONST char **error)
+{
+ int i;
+ int line = 1;
+ int size;
+ int c;
+ catalog_t *catalog = alloc_catalog();
+ static char errort[40];
+ char name[1024];
+ char value[1024];
+ if (catalog == NULL) {
+ *error = "Out of memory";
+ }
+ if (f == NULL) {
+ *error = "File could not be opened";
+ free_catalog(catalog);
+ return NULL;
+ }
+ /* Just very simple parsing loop of format
+ * [blanks]name[blanks]"value"[blanks]
+ * Blanks should be comments using # or space, newline, \r and tabulator
+ * Value shoud contain and \ seqences where \\ means \ and
+ * \[something] means something. Should be used for character "
+ */
+ while (!xio_feof(f)) {
+
+ do {
+ c = xio_getc(f);
+ if (c == '\n')
+ line++;
+ if (c == '#') {
+ while ((c = xio_getc(f)) != '\n' && c != XIO_EOF);
+ line++;
+ }
+ }
+ while (c == ' ' || c == '\n' || c == '\r' || c == '\t');
+
+ /*Skip blanks */
+ if (c == XIO_EOF) {
+ if (xio_feof(f))
+ break;
+ free_catalog(catalog);
+ seterror("read error");
+ xio_close(f);
+ return NULL;
+ }
+ i = 0;
+
+ /*read name */
+ do {
+ name[i] = c;
+ i++;
+ c = xio_getc(f);
+ if (c == '\n')
+ line++;
+ if (i == 1024) {
+ seterror("Name is too long (>=1024 characters)");
+ free_catalog(catalog);
+ xio_close(f);
+ return NULL;
+ }
+ }
+
+ while (c != '\n' && c != ' ' && c != '\t' && c != XIO_EOF);
+
+ /*Skip blanks */
+ while (c == ' ' || c == '\n' || c == '\r' || c == '\t') {
+ c = xio_getc(f);
+ if (c == '\n')
+ line++;
+ if (c == '#') {
+ while ((c = xio_getc(f)) != '\n' && c != XIO_EOF);
+ line++;
+ }
+ }
+
+ /*Skip blanks */
+ if (c == XIO_EOF) {
+ if (xio_feof(f))
+ seterror("Unexpected end of file after name field");
+ else
+ seterror("read error");
+ free_catalog(catalog);
+ xio_close(f);
+ return NULL;
+ }
+
+ name[i] = 0;
+ if (c != '"') {
+ seterror("Begin of value field expected"); // Text modified due to segfault problem, see above (kovzol)
+ free_catalog(catalog);
+ xio_close(f);
+ return NULL;
+ }
+ c = xio_getc(f);
+ if (c == '\n')
+ line++;
+ i = 0;
+
+ size = 0;
+ do {
+ if (c == '\\')
+ value[i] = xio_getc(f);
+ else
+ value[i] = c;
+ i++;
+ c = xio_getc(f);
+ if (c == '\n')
+ line++, size = 0;
+ if (size == 40 && c != '"') {
+ fprintf(stderr, "Warning - too long text at line %i\n",
+ line);
+ }
+ size++;
+ if (i == 1024) {
+ seterror("Value is too long (>=1024 characters)");
+ free_catalog(catalog);
+ xio_close(f);
+ return NULL;
+ }
+ }
+ while (c != '"' && c != XIO_EOF);
+
+ if (c == XIO_EOF) {
+ seterror("Unexpected EOF in value field");
+ free_catalog(catalog);
+ xio_close(f);
+ return NULL;
+ }
+
+ value[i] = 0;
+ find_variable(catalog, name, value);
+ } /*while */
+ xio_close(f);
+ return (catalog);
+} /*load_catalog */
+
+char *find_text(catalog_t * catalog, CONST char *name)
+{
+ return (find_variable(catalog, name, NULL));
+}
diff --git a/src/util/help.c b/src/util/help.c
new file mode 100644
index 0000000..adaabb7
--- /dev/null
+++ b/src/util/help.c
@@ -0,0 +1,95 @@
+#ifdef _plan9_
+#include <u.h>
+#include <libc.h>
+#else
+#include <stdlib.h>
+#endif
+#include <ctype.h>
+#include <config.h>
+#include <xio.h>
+#include <xshl.h>
+struct helpstatus {
+ int eol;
+ xio_file file;
+};
+static int gethelp(void *userdata)
+{
+ struct helpstatus *s = (struct helpstatus *) userdata;
+ int c = xio_getc(s->file);
+ if (c == '\r')
+ return (gethelp(userdata));
+ if (c < 0 || c > 255)
+ return 0;
+ if (c == '%' && s->eol)
+ return 0;
+ s->eol = (c == '\n');
+ return c;
+}
+
+struct xshl_line *help_make(CONST char *command,
+ int getwidth(void *, int flags,
+ CONST char *text), int width,
+ int smallheight, int bigheight)
+{
+ struct helpstatus *s = (struct helpstatus *) malloc(sizeof(*s));
+ struct xshl_line *line;
+ s->file = xio_gethelp();
+ if (s->file == XIO_FAILED) {
+ free(s);
+ return 0;
+ }
+ s->eol = 1;
+ while (1) {
+ int c;
+ c = xio_getc(s->file);
+ if (c == '%' && s->eol) {
+ c = xio_getc(s->file);
+ do {
+ int i = 0;
+ i = 0;
+ while (command[i] && c == command[i]) {
+ c = xio_getc(s->file);
+ i++;
+ }
+ if (!command[i]) {
+ if (isspace(c)) {
+ while (c != '\n' && !xio_feof(s->file))
+ c = xio_getc(s->file);
+ line =
+ xshl_interpret(s, gethelp, width, getwidth, 0,
+ smallheight, bigheight);
+ xio_close(s->file);
+ free(s);
+ return (line);
+ }
+ } else {
+ while (c != '\n' && c != ' ' && !xio_feof(s->file))
+ c = xio_getc(s->file);
+ if (c == ' ')
+ while (c == ' ')
+ c = xio_getc(s->file);
+ }
+ }
+ while (c != '\n' && !xio_feof(s->file));
+ } /*c==% */
+ s->eol = (c == '\n');
+ if (xio_feof(s->file)) {
+ xio_close(s->file);
+ return NULL;
+ }
+ } /*while 1 */
+}
+
+#if _NEVER_
+void help_print(char *name, int skip, int width)
+{
+ struct xshl_line *l;
+ l = help_make(name, xshl_textlen, width, 1, 1);
+ if (l == NULL) {
+ printf("Help not available!\n");
+ return;
+ }
+ xshl_print(skip, l);
+ xshl_free(l);
+}
+#endif
diff --git a/src/util/png.c b/src/util/png.c
new file mode 100644
index 0000000..4fb01bc
--- /dev/null
+++ b/src/util/png.c
@@ -0,0 +1,201 @@
+#include <config.h>
+#ifndef _plan9_
+#include <aconfig.h>
+#ifdef USE_PNG
+#include <png.h>
+#endif
+#include <stdlib.h>
+#include <stdio.h>
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#include <errno.h>
+#else
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#endif
+#include <filter.h>
+#include <version.h>
+#include <misc-f.h>
+#include <xio.h>
+#ifndef USE_PNG
+CONST char *writepng(xio_constpath filename, CONST struct image *img)
+{
+ return
+ "XaoS can not save images because it was incorrectly compiled. Please compile it with zlib and libpng";
+}
+#else
+
+CONST char *writepng(xio_constpath filename, CONST struct image *image)
+{
+ png_structp png_ptr;
+ png_infop info_ptr;
+ png_color palette[256];
+ volatile unsigned short a = 255;
+ volatile unsigned char *b = (volatile unsigned char *) &a;
+#ifdef _undefined_
+ static char text[] =
+ "XaoS" XaoS_VERSION " - a realtime interactive fractal zoomer";
+ static png_text comments[] = {
+ {
+ -1,
+ "Software",
+ text,
+ sizeof(text)}
+ };
+#endif
+ FILE *file = fopen(filename, "wb");
+ errno = -1;
+ if (file == NULL) {
+ return strerror(errno);
+ }
+ png_ptr =
+ png_create_write_struct(PNG_LIBPNG_VER_STRING, (void *) NULL,
+ (png_error_ptr) NULL,
+ (png_error_ptr) NULL);
+ if (!png_ptr)
+ return "Unable to initialize pnglib";
+ info_ptr = png_create_info_struct(png_ptr);
+ if (!info_ptr) {
+ png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
+ return "No memory to create png info structure";
+ }
+ if (setjmp(png_ptr->jmpbuf)) {
+ png_destroy_write_struct(&png_ptr, &info_ptr);
+ fclose(file);
+ return strerror(errno);
+ }
+ png_init_io(png_ptr, file);
+ png_set_filter(png_ptr, 0,
+ PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_PAETH |
+ PNG_FILTER_UP | PNG_FILTER_AVG);
+ /* set the zlib compression level */
+ /*png_set_compression_level(png_ptr, Z_BEST_COMPRESSION); */
+ png_set_compression_level(png_ptr, Z_DEFAULT_COMPRESSION);
+
+ /* set other zlib parameters */
+ png_set_compression_mem_level(png_ptr, 8);
+ png_set_compression_strategy(png_ptr, Z_DEFAULT_STRATEGY);
+ png_set_compression_window_bits(png_ptr, 15);
+ png_set_compression_method(png_ptr, 8);
+
+ info_ptr->width = image->width;
+ info_ptr->height = image->height;
+ /*info_ptr->gamma=1.0; */
+ info_ptr->gamma = 0.5;
+ info_ptr->valid |= PNG_INFO_gAMA | PNG_INFO_pHYs;
+ info_ptr->x_pixels_per_unit = (png_uint_32) (100 / image->pixelwidth);
+ info_ptr->y_pixels_per_unit = (png_uint_32) (100 / image->pixelheight);
+
+
+ switch (image->palette->type) {
+ case C256:
+ {
+ int i;
+ info_ptr->color_type = PNG_COLOR_TYPE_PALETTE;
+ info_ptr->bit_depth = image->bytesperpixel * 8;
+ info_ptr->palette = palette;
+ info_ptr->valid |= PNG_INFO_PLTE;
+ for (i = 0; i < image->palette->end; i++)
+ info_ptr->palette[i].red = image->palette->rgb[i][0],
+ info_ptr->palette[i].green = image->palette->rgb[i][1],
+ info_ptr->palette[i].blue = image->palette->rgb[i][2],
+ info_ptr->num_palette = image->palette->end;
+ }
+ break;
+ case SMALLITER:
+ case LARGEITER:
+ case GRAYSCALE:
+ info_ptr->color_type = PNG_COLOR_TYPE_GRAY;
+ info_ptr->bit_depth = image->bytesperpixel * 8;
+ break;
+ case TRUECOLOR:
+ case TRUECOLOR24:
+ case TRUECOLOR16:
+ info_ptr->color_type = PNG_COLOR_TYPE_RGB;
+ info_ptr->bit_depth = 8;
+ info_ptr->sig_bit.red = 8 - image->palette->info.truec.rprec;
+ info_ptr->sig_bit.green = 8 - image->palette->info.truec.gprec;
+ info_ptr->sig_bit.blue = 8 - image->palette->info.truec.bprec;
+ break;
+ }
+ info_ptr->interlace_type = 0;
+#ifdef _undefined_
+ png_set_text(png_ptr, info_ptr, comments,
+ sizeof(comments) / sizeof(png_text));
+#endif
+
+ png_write_info(png_ptr, info_ptr);
+ /*png_set_filler(png_ptr,0,PNG_FILLER_AFTER); */
+ png_set_packing(png_ptr);
+ if (image->palette->type & (TRUECOLOR | TRUECOLOR24 | TRUECOLOR16))
+ png_set_shift(png_ptr, &(info_ptr->sig_bit));
+ if (*b == 255)
+ png_set_swap(png_ptr);
+ png_set_bgr(png_ptr);
+ switch (image->palette->type) {
+ case C256:
+ case GRAYSCALE:
+ case SMALLITER:
+ case LARGEITER:
+#ifdef STRUECOLOR24
+ case TRUECOLOR24:
+ png_write_image(png_ptr, (png_bytepp) image->currlines);
+ break;
+#endif
+ case TRUECOLOR:
+ {
+ int i, y;
+ unsigned char *r = (unsigned char *) malloc(image->width * 3);
+ for (i = 0; i < image->height; i++) {
+ for (y = 0; y < image->width; y++)
+ r[y * 3 + 2] =
+ (((pixel32_t **) (image->
+ currlines))[i][y] &
+ image->palette->info.truec.rmask) >> image->
+ palette->info.truec.rshift, r[y * 3 + 1] =
+ (((pixel32_t **) (image->
+ currlines))[i][y] &
+ image->palette->info.truec.gmask) >> image->
+ palette->info.truec.gshift, r[y * 3] =
+ (((pixel32_t **) (image->
+ currlines))[i][y] &
+ image->palette->info.truec.bmask) >> image->
+ palette->info.truec.bshift;
+ png_write_rows(png_ptr, (png_bytepp) & r, 1);
+ }
+ }
+ break;
+#ifdef SUPPORT16
+ case TRUECOLOR16:
+ {
+ int i, y;
+ unsigned char *r = (unsigned char *) malloc(image->width * 3);
+ for (i = 0; i < image->height; i++) {
+ for (y = 0; y < image->width; y++)
+ r[y * 3 + 2] =
+ (((pixel16_t **) (image->
+ currlines))[i][y] &
+ image->palette->info.truec.rmask) >> image->
+ palette->info.truec.rshift, r[y * 3 + 1] =
+ (((pixel16_t **) (image->
+ currlines))[i][y] &
+ image->palette->info.truec.gmask) >> image->
+ palette->info.truec.gshift, r[y * 3] =
+ (((pixel16_t **) (image->
+ currlines))[i][y] &
+ image->palette->info.truec.bmask) >> image->
+ palette->info.truec.bshift;
+ png_write_rows(png_ptr, (png_bytepp) & r, 1);
+ }
+ }
+ break;
+#endif
+ }
+ png_write_end(png_ptr, info_ptr);
+ png_destroy_write_struct(&png_ptr, &info_ptr);
+ fclose(file);
+ return NULL;
+}
+#endif
diff --git a/src/util/thread.c b/src/util/thread.c
new file mode 100644
index 0000000..f3ef4a7
--- /dev/null
+++ b/src/util/thread.c
@@ -0,0 +1,221 @@
+#ifndef _plan9_
+#include <signal.h>
+#include <stdio.h>
+#endif
+#include <xthread.h>
+#ifndef __BEOS__
+struct taskinfo definfo = {
+ 0,
+};
+
+#ifndef nthreads
+
+#define getrange1(range,ncpu) ((range)*(ncpu))/nthreads
+#define getrange2(range,ncpu) getrange1(range,(ncpu)+1)
+
+int ethreads = 0;
+int nthreads = 1;
+
+#ifdef USE_PTHREAD
+
+/* Well conde follows is probably very ugly, since this is
+ * my absolutely first application for threads. Please let
+ * me know how to improvie it
+ */
+
+static pthread_cond_t synccond, startcond;
+static struct taskinfo infos[MAXTHREADS];
+static pthread_mutex_t synccondmutex, startcondmutex;
+pthread_mutex_t semaphors[MAXSEMAPHORS];
+pthread_cond_t conds[MAXCONDS];
+
+/*This loop is executed whole time in slave threads.
+ Its function is following:
+ 1) wait for message
+ 2) call function from message
+ 3) syncronize
+ 4) again
+
+ To invoke this mechanizm main thread(#1) should call
+ xth_function
+ xth_synchronize forces forces thread to wait for others
+ */
+
+static int nfinished;
+static int npending;
+static int counter;
+static int bcounter;
+static int bcounter1;
+static int range;
+static void *data;
+static xfunction function;
+static void *control_routine(void *i)
+{
+ struct taskinfo *info = i;
+ int mycounter = 0;
+ int r;
+ void *d;
+ xfunction f;
+ while (1) {
+ /* quite a lot pthread calls. Please if you are
+ * reading this code and crying "OH NO!" so ugly
+ * handling! Why so much calls? Stop crying, I am
+ * newbie in threads. Please rewrite my code and
+ * send me better and faster version.
+ *
+ * This function comunicates with pth_function from main loop
+ * as follows: it uses startcond to wait for order start function!
+ * Counter is used to ensure that main function did not give
+ * order whie control_routine was busy
+ *
+ * after order is received, function adress is readed from global
+ * variables and started. Pth_function then executes its
+ * own part of calculation. After that it waits counter
+ * nfinished to reach number of thasks-1. This is done
+ * using cond synccond and synccondmutex. Quite complex
+ * but it seems to work. Looking forward for someone, who
+ * should reduce number of _lock/_unlock
+ */
+ pthread_mutex_lock(&synccondmutex);
+ nfinished++;
+ pthread_cond_signal(&synccond);
+ pthread_mutex_unlock(&synccondmutex);
+
+ pthread_mutex_lock(&startcondmutex);
+ while (mycounter >= counter) {
+ if (bcounter > bcounter1) {
+ /*Well we are already locked using start lock..should be OK */
+ mycounter--;
+ bcounter1++;
+ break;
+ }
+ pthread_cond_wait(&startcond, &startcondmutex);
+ }
+ r = range;
+ d = data;
+ f = function;
+ npending--;
+ pthread_mutex_unlock(&startcondmutex);
+ mycounter++;
+ f(d, info, getrange1(r, info->n), getrange2(r, info->n));
+ }
+ return NULL;
+}
+
+void pth_init(int nthreads1)
+{
+ int i;
+ pthread_attr_t attr;
+ if (ethreads)
+ return;
+
+ if (nthreads1 == 1 || nthreads1 == 0)
+ return; /*use nothreads_* calls */
+ if (nthreads1 > MAXTHREADS)
+ nthreads1 = MAXTHREADS;
+ nthreads = nthreads1;
+
+ pthread_attr_init(&attr);
+ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+
+ if (pthread_cond_init(&synccond, NULL))
+ exit(1);
+ if (pthread_cond_init(&startcond, NULL))
+ exit(1);
+ if (pthread_mutex_init(&synccondmutex, NULL))
+ exit(1);
+ if (pthread_mutex_init(&startcondmutex, NULL))
+ exit(1);
+
+ infos[0].n = 0;
+ /*infos[0].id = pthread_self(); */
+
+ for (i = 0; i < MAXSEMAPHORS; i++) {
+ pthread_mutex_init(semaphors + i, NULL);
+ }
+ for (i = 0; i < MAXCONDS; i++) {
+ pthread_cond_init(conds + i, NULL);
+ }
+
+ nfinished = 0;
+ for (i = 0; i < nthreads - 1; i++) {
+ if (pthread_create
+ (&infos[i + 1].id, &attr, control_routine, infos + i + 1)) {
+ nthreads = i + 1;
+ break;
+ }
+ infos[i + 1].n = i + 1;
+ }
+ if (nthreads != 1)
+ ethreads = 1;
+}
+
+void pth_synchronize()
+{
+ /*Our job is done, synchronize now */
+ if (nfinished < nthreads - 1) {
+ pthread_mutex_lock(&synccondmutex);
+ while (nfinished < nthreads - 1) {
+ pthread_cond_wait(&synccond, &synccondmutex);
+ }
+ pthread_mutex_unlock(&synccondmutex);
+ }
+ /*Ok job is done, lets continue :) */
+}
+
+void pth_bgjob(xfunction f, void *d)
+{
+ pthread_mutex_lock(&startcondmutex);
+ if (npending) {
+ printf("Collision!\n"); /*FIXME:remove this..I just want to know how often this happends */
+ pthread_mutex_unlock(&startcondmutex);
+ f(d, infos, 0, 0);
+ }
+ if (bcounter < bcounter1) {
+ printf("Internal error\a\n");
+ }
+ if (!nfinished) {
+ pthread_mutex_unlock(&startcondmutex);
+ /*no more CPU available :( */
+ f(d, infos, 0, 0);
+ }
+ data = d;
+ range = 0;
+ function = f;
+ bcounter++;
+ nfinished--;
+ npending++;
+ pthread_cond_signal(&startcond);
+ pthread_mutex_unlock(&startcondmutex);
+}
+
+void pth_function(xfunction f, void *d, int r)
+{
+ pth_synchronize();
+ pthread_mutex_lock(&startcondmutex);
+ data = d;
+ range = r;
+ function = f;
+ /*And lets start it:) */
+ nfinished = 0;
+ npending = nthreads - 1;
+ counter++;
+ if (nthreads == 2)
+ pthread_cond_signal(&startcond);
+ else
+ pthread_cond_broadcast(&startcond);
+ pthread_mutex_unlock(&startcondmutex);
+
+ function(data, infos, getrange1(range, 0), getrange2(range, 0));
+}
+
+void pth_uninit()
+{
+ /*Should be empty for now since all threads will be killed after exit call */
+ /*FIXME should be added something if necessary :) */
+ nthreads = 1;
+ ethreads = 0;
+}
+#endif /*POSIX threads */
+#endif /*nthreads */
+#endif /*__BEOS__*/
diff --git a/src/util/timers.c b/src/util/timers.c
new file mode 100644
index 0000000..13e9abe
--- /dev/null
+++ b/src/util/timers.c
@@ -0,0 +1,670 @@
+/*
+ * XaoS, a fast portable realtime fractal zoomer
+ * Copyright (C) 1996,1997 by
+ *
+ * Jan Hubicka (hubicka@paru.cas.cz)
+ * Thomas Marsh (tmarsh@austin.ibm.com)
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * All ugly architecture depended timing code is separated into this file..
+ */
+#ifdef _plan9_
+#include <u.h>
+#include <stdio.h>
+#include <libc.h>
+#else
+#include <config.h>
+#ifdef HAVE_GETTIMEOFDAY
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+ /*HAVE_UNISTD */
+#else
+#ifdef HAVE_FTIME
+#include <sys/timeb.h>
+#endif
+ /*HAVE_FTIME */
+#endif
+ /*HAVE_GETTIMEOFDAY */
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+ /*HAVE_TIME_H */
+#include <aconfig.h>
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#include <stdio.h>
+#include <unistd.h>
+#ifndef _MAC
+#ifndef NO_MALLOC_H
+#include <malloc.h>
+#endif
+#endif
+#ifdef __BEOS__
+#include <OS.h>
+#endif
+#ifdef USE_ALLEGRO
+#include <allegro.h>
+#endif
+#ifdef HAVE_SETITIMER
+#include <signal.h>
+#endif
+#include <limits.h>
+#endif
+#ifndef _plan9_
+#include <assert.h>
+#endif
+#include "../include/timers.h"
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
+#ifdef _WIN32
+#define QuadPart(x) x.QuadPart
+#endif
+
+#ifndef SIGALRM
+#undef HAVE_SETITIMER
+#endif
+
+#define EMULDIV 1024
+struct timeemulator {
+ unsigned long int time;
+ unsigned long exact;
+};
+
+ /* Definition of structure timer. There is lots of various formats for time
+ * at variious platforms. So there is quite lots of ifdefs... same is for
+ * saving current time and function comparing them. Rest of timer lib
+ * is platform independent
+ */
+
+
+struct timer {
+#ifdef __BEOS__
+ bigtime_t lastactivated;
+#else
+#ifdef _WIN32
+ LARGE_INTEGER lastactivated;
+#else
+#ifdef USE_ALLEGRO
+ uclock_t lastactivated;
+#else
+#ifdef HAVE_UCLOCK
+ uclock_t lastactivated;
+#else
+#ifdef USE_CLOCK
+ int lastactivated;
+#else
+#ifdef HAVE_GETTIMEOFDAY
+ struct timeval lastactivated;
+#else
+#ifdef _plan9_
+ int lastactivated;
+#else
+#ifdef HAVE_FTIME
+ struct timeb lastactivated;
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+ unsigned long lastemulated;
+ struct timeemulator *emulator;
+ void (*handler) (void *);
+ void (*multihandler) (void *, int);
+ void *userdata;
+ struct timer *next, *previous, *group;
+ int interval;
+ int stopped;
+ int stoppedtime;
+ int slowdown;
+};
+
+ /*Variable for saving current time */
+#ifdef __BEOS__
+bigtime_t currenttime;
+#else
+#ifdef _WIN32
+LARGE_INTEGER currenttime, frequency;
+#else
+#ifdef USE_ALLEGRO
+int allegromode;
+#define TICKSPERSEC 100 /*must be divisor of 1000000 */
+volatile static int counter = -1;
+static int ainstalled;
+#endif
+#ifdef HAVE_UCLOCK
+static uclock_t currenttime;
+#else
+#ifdef USE_CLOCK
+static int currenttime;
+#else
+#ifdef HAVE_GETTIMEOFDAY
+static struct timeval currenttime;
+#ifdef AMIGA
+extern long __timezone;
+#define tzp __timezone
+#else
+static struct timezone tzp;
+#endif
+#else
+#ifdef HAVE_FTIME
+static struct timeb currenttime;
+#endif
+#endif
+#endif
+#endif
+#ifdef _plan9_
+static int currenttime;
+#endif
+#endif
+#endif
+
+#ifdef HAVE_SETITIMER
+static int registered = 0, reghandler = 0;
+static tl_group group2;
+#endif
+static tl_group group1;
+tl_group *syncgroup = &group1,
+#ifdef HAVE_SETITIMER
+ *asyncgroup = &group2;
+#else
+ *asyncgroup = &group1;
+#endif
+#ifdef _plan9_
+#ifdef _plan9v2_
+static int plan9_msec(void)
+{ /*this function was sent by Nigel Roles */
+ static int fd = -1;
+ char buf[20]; /* ish */
+ if (fd < 0)
+ fd = open("/dev/msec", OREAD);
+ else
+ seek(fd, 0, 0);
+ read(fd, buf, sizeof(buf));
+ return atoi(buf);
+}
+#else
+static int plan9_msec(void)
+{
+ return (int) (nsec() / 1000000);
+}
+#endif
+#endif
+
+#ifndef __BEOS__
+#ifndef _WIN32
+#ifndef HAVE_GETTIMEOFDAY
+#ifndef HAVE_FTIME
+#ifndef _plan9_
+#ifndef _MAC
+#error I am unable to get time in milisecond. Please edit timers.c and make tl_update_time and tl_lookup_timer to work for your architecture and send me then back(to hubicka@paru.cas.cz). You will need also define timers.h and change type of lasttime.
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+
+
+#ifdef USE_ALLEGRO
+static void timer(void)
+{
+ counter++;
+}
+
+END_OF_FUNCTION(timer);
+#endif
+/*following functions are architecture dependent */
+void tl_update_time(void)
+{
+#ifdef __BEOS__
+ currenttime = system_time();
+#else
+#ifdef _WIN32
+ QueryPerformanceCounter(&currenttime);
+#else
+#ifdef USE_ALLEGRO
+ if (allegromode) {
+ if (counter == -1) {
+ LOCK_VARIABLE(counter);
+ LOCK_FUNCTION(timer);
+ install_int(timer, 1000 / TICKSPERSEC);
+ ainstalled = 1;
+ counter = 0;
+ }
+ currenttime = counter;
+ return;
+ }
+#endif
+#ifdef HAVE_UCLOCK
+ currenttime = uclock();
+#else
+#ifdef USE_CLOCK
+ currenttime = clock();
+#else
+#ifdef HAVE_GETTIMEOFDAY
+ do {
+ gettimeofday(&currenttime, &tzp);
+ }
+ while (currenttime.tv_usec > 999999);
+#else
+#ifdef HAVE_FTIME
+ ftime(&currenttime);
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#ifdef _plan9_
+ currenttime = plan9_msec();
+#endif
+}
+
+static INLINE int __lookup_timer(tl_timer * t)
+{
+#ifdef __BEOS__
+ return (currenttime - t->lastactivated);
+#else
+#ifdef _WIN32
+ return ((QuadPart(currenttime) -
+ QuadPart(t->lastactivated)) * 1000000LL) /
+ QuadPart(frequency);
+#else
+#ifdef USE_ALLEGRO
+ if (allegromode)
+ return (((currenttime -
+ t->lastactivated) * (1000000LL / TICKSPERSEC)));
+#endif
+#ifdef HAVE_UCLOCK
+ return (((currenttime -
+ t->lastactivated) * 1000000LL) / UCLOCKS_PER_SEC);
+#else
+#ifdef USE_CLOCK
+ return ((currenttime -
+ t->lastactivated) * (1000000.0 / CLOCKS_PER_SEC));
+#else
+#ifdef HAVE_GETTIMEOFDAY
+ return ((1000000 *
+ (-(int) t->lastactivated.tv_sec + (int) currenttime.tv_sec) +
+ (-(int) t->lastactivated.tv_usec +
+ (int) currenttime.tv_usec)));
+#else
+#ifdef HAVE_FTIME
+ return ((1000000 * (-t->lastactivated.time + currenttime.time) +
+ 1000 * (-t->lastactivated.millitm + currenttime.millitm)));
+#else
+#ifdef _plan9_
+ return ((currenttime - t->lastactivated) * 1000);
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+}
+
+REGISTERS(3)
+int tl_lookup_timer(tl_timer * t)
+{
+ if (t->stopped) {
+ return (t->stoppedtime);
+ }
+ if (t->emulator != NULL) {
+ return ((int) (t->emulator->time - t->lastemulated) * EMULDIV);
+ }
+ return (__lookup_timer(t) - t->slowdown);
+}
+
+void tl_stop_timer(tl_timer * t)
+{
+ if (!t->stopped) {
+ t->stoppedtime = tl_lookup_timer(t);
+ t->stopped = 1;
+ }
+}
+
+void tl_slowdown_timer(tl_timer * t, int time)
+{
+ if (!t->stopped) {
+ t->slowdown += time;
+ } else
+ t->stoppedtime -= time;
+}
+
+void tl_resume_timer(tl_timer * t)
+{
+ if (t->stopped) {
+ t->stopped = 0;
+ t->slowdown = tl_lookup_timer(t) - t->stoppedtime;
+ }
+}
+
+void tl_sleep(int time)
+{
+#ifdef _WIN32
+ Sleep(time / 1000);
+#else
+#ifdef HAVE_USLEEP
+ usleep(time);
+#else
+#ifdef __BEOS__
+ snooze(time);
+#else
+#ifdef HAVE_SELECT
+ {
+ struct timeval tv;
+ tv.tv_sec = time / 1000000L;
+ tv.tv_usec = time % 1000000L;
+ (void) select(0, (void *) 0, (void *) 0, (void *) 0, &tv);
+ }
+#else
+#ifdef _plan9_
+ sleep(time / 1000);
+#else
+/*
+ #warning tl_sleep function not implemented. You may ignore this warning.
+ #warning xaos will work correctly. But on miltitasked enviroments it is
+ #warning HIGHLY recomended to implement this.
+ */
+#endif
+#endif
+#endif
+#endif
+#endif
+}
+
+REGISTERS(3)
+void tl_reset_timer(tl_timer * t)
+{
+ if (t->stopped)
+ t->stoppedtime = 0;
+ else {
+ if (t->emulator != NULL) {
+ t->lastemulated = t->emulator->time;
+ } else
+ t->lastactivated = currenttime, t->slowdown = 0;
+ }
+}
+
+tl_timer *tl_create_timer(void)
+{
+ tl_timer *timer;
+ timer = (tl_timer *) calloc(1, sizeof(tl_timer));
+ if (timer == NULL)
+ return NULL;
+ timer->interval = -1;
+ timer->handler = NULL;
+ timer->multihandler = NULL;
+ timer->userdata = NULL;
+ timer->next = NULL;
+ timer->previous = NULL;
+ timer->group = NULL;
+ timer->stopped = 0;
+ timer->stoppedtime = 0;
+ timer->slowdown = 0;
+ timer->emulator = NULL;
+ tl_reset_timer(timer);
+#ifdef _WIN32
+ QueryPerformanceFrequency(&frequency);
+#endif
+ return (timer);
+}
+
+tl_group *tl_create_group(void)
+{
+ tl_group *timer;
+ timer = (tl_group *) calloc(1, sizeof(tl_group));
+ if (timer == NULL)
+ return NULL;
+ timer->interval = -1;
+ timer->handler = NULL;
+ timer->multihandler = NULL;
+ timer->userdata = NULL;
+ timer->next = NULL;
+ timer->previous = NULL;
+ timer->group = timer;
+ tl_reset_timer(timer);
+ return (timer);
+}
+
+
+void tl_free_timer(tl_timer * timer)
+{
+ if (timer->group)
+ tl_remove_timer(timer);
+ free((void *) timer);
+}
+
+void tl_free_group(tl_group * timer)
+{
+ tl_timer *next;
+ do {
+ next = timer->next;
+ free((void *) timer);
+ }
+ while (next != NULL);
+}
+
+int tl_process_group(tl_group * group, int *activated)
+{
+ int again = 1;
+ tl_timer *timer, *timer1;
+ int minwait = INT_MAX;
+ tl_update_time();
+ if (activated != NULL)
+ *activated = 0;
+ while (again) {
+ group->slowdown = 0;
+ again = 0;
+ minwait = INT_MAX;
+ timer = group->next;
+ while (timer != NULL) {
+ timer1 = timer->next;
+ if (timer->handler && timer->interval >= 0) {
+ int time = timer->interval - tl_lookup_timer(timer);
+ if (time < 500) {
+ if (activated != NULL)
+ (*activated)++;
+ again = 1;
+ tl_reset_timer(timer);
+ if (time < -200 * 1000000)
+ time = 0; /*underflow? */
+ tl_slowdown_timer(timer, time);
+ time = timer->interval + time;
+ timer->handler(timer->userdata);
+ tl_update_time();
+ }
+ if (time < minwait)
+ minwait = time;
+ } else if (timer->multihandler && timer->interval > 0) {
+ int time = timer->interval - tl_lookup_timer(timer);
+ if (time < 500) {
+ int n;
+ if (activated != NULL)
+ (*activated)++;
+ tl_reset_timer(timer);
+ if (time < -200 * 1000000)
+ time = 0; /*underflow? */
+ n = -(time + 500) / timer->interval + 1;
+ time = timer->interval * n + time;
+ tl_slowdown_timer(timer,
+ time - timer->interval +
+ n * timer->interval);
+ timer->multihandler(timer->userdata, n);
+ tl_update_time();
+ }
+ if (time < minwait)
+ minwait = time;
+ }
+ if (group->slowdown) {
+ again = 1;
+ break;
+ }
+ timer = timer1;
+ }
+ }
+ if (minwait != INT_MAX) {
+ if (minwait < 0)
+ return (0);
+ return (minwait);
+ }
+ return (-1);
+}
+
+#ifdef HAVE_SETITIMER
+static void update_async(void);
+static void alarmhandler(int a)
+{
+ update_async();
+ signal(SIGALRM, alarmhandler);
+}
+
+static void update_async(void)
+{
+ int time = tl_process_group(asyncgroup, NULL);
+ if (time != -1) {
+ struct itimerval t;
+ t.it_interval.tv_sec = 0;
+ t.it_interval.tv_usec = 0;
+ t.it_value.tv_sec = time / 1000000;
+ t.it_value.tv_usec = time % 1000000;
+ if (!reghandler) {
+ signal(SIGALRM, alarmhandler), reghandler = 1;
+ }
+ setitimer(ITIMER_REAL, &t, &t);
+ registered = 1;
+ } else if (registered) {
+ struct itimerval t;
+ t.it_interval.tv_sec = 0;
+ t.it_interval.tv_usec = 0;
+ t.it_value.tv_sec = 0;
+ t.it_value.tv_usec = 0;
+ setitimer(ITIMER_REAL, &t, &t);
+ registered = 0;
+ }
+}
+
+#else
+#define update_async()
+#endif
+void tl_add_timer(tl_group * group, tl_timer * timer)
+{
+ if (timer->group)
+ tl_remove_timer(timer);
+ timer->previous = group;
+ timer->next = group->next;
+ timer->group = group;
+ group->next = timer;
+ if (timer->next != NULL)
+ timer->next->previous = timer;
+ if (timer->group == asyncgroup)
+ update_async();
+}
+
+void tl_set_interval(tl_timer * timer, int interval)
+{
+ if (timer->interval <= 0) {
+ tl_reset_timer(timer);
+ }
+ timer->interval = interval;
+ if (timer->group == asyncgroup)
+ update_async();
+}
+
+void tl_set_handler(tl_timer * timer, void (*handler) (void *), void *ud)
+{
+ timer->handler = handler;
+ timer->userdata = ud;
+ if (timer->group == asyncgroup)
+ update_async();
+}
+
+void
+tl_set_multihandler(tl_timer * timer, void (*handler) (void *, int),
+ void *ud)
+{
+ timer->multihandler = handler;
+ timer->userdata = ud;
+ if (timer->group == asyncgroup)
+ update_async();
+}
+
+void tl_remove_timer(tl_timer * timer)
+{
+ tl_group *g = timer->group;
+ timer->group->slowdown = 1;
+ timer->previous->next = timer->next;
+ if (timer->next != NULL)
+ timer->next->previous = timer->previous;
+ timer->group = NULL;
+ if (g == asyncgroup)
+ update_async();
+}
+
+struct timeemulator *tl_create_emulator(void)
+{
+ return ((struct timeemulator *)
+ calloc(1, sizeof(struct timeemulator)));
+}
+
+void tl_free_emulator(struct timeemulator *t)
+{
+ free(t);
+}
+
+void tl_elpased(struct timeemulator *t, int elpased)
+{
+ t->exact += elpased;
+ t->time += t->exact / EMULDIV;
+ t->exact &= (EMULDIV - 1);
+}
+
+void tl_emulate_timer(struct timer *t, struct timeemulator *e)
+{
+ int time = tl_lookup_timer(t);
+ t->emulator = e;
+ t->lastemulated = e->time;
+ tl_slowdown_timer(t, -time);
+}
+
+void tl_unemulate_timer(struct timer *t)
+{
+ int time = tl_lookup_timer(t);
+ t->emulator = NULL;
+ tl_slowdown_timer(t, tl_lookup_timer(t) - time);
+}
+
+#ifdef USE_ALLEGRO
+void tl_allegromode(int mode)
+{
+ allegromode = mode;
+ if (!allegromode && ainstalled) {
+ remove_int(timer);
+ ainstalled = 0;
+ counter = -1;
+ }
+}
+#endif
diff --git a/src/util/util.pri b/src/util/util.pri
new file mode 100644
index 0000000..7db9d98
--- /dev/null
+++ b/src/util/util.pri
@@ -0,0 +1,12 @@
+SOURCES += \
+ $$PWD/png.c \
+ $$PWD/catalog.c \
+ $$PWD/thread.c \
+ $$PWD/xstring.c \
+ $$PWD/help.c \
+ $$PWD/xerror.c \
+ $$PWD/xshl.c \
+ $$PWD/xldio.c \
+ $$PWD/xstdio.c \
+ $$PWD/xmenu.c \
+ $$PWD/timers.c
diff --git a/src/util/xerror.c b/src/util/xerror.c
new file mode 100644
index 0000000..f7a904f
--- /dev/null
+++ b/src/util/xerror.c
@@ -0,0 +1,43 @@
+#ifdef _plan9_
+#include <u.h>
+#include <libc.h>
+#endif
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+#include "xerror.h"
+#include "aconfig.h"
+/*BeOS driver have its own routines in the C++ code */
+#ifndef BEOS_DRIVER
+/*On windows we use message boxes done in the ui_win32.c code*/
+#ifndef WIN32_DRIVER
+void x_message(CONST char *text, ...)
+{
+ va_list ap;
+ va_start(ap, text);
+ vfprintf(stdout, text, ap);
+ fprintf(stdout, "\n");
+ va_end(ap);
+}
+
+void x_error(CONST char *text, ...)
+{
+ va_list ap;
+ va_start(ap, text);
+ vfprintf(stderr, text, ap);
+ fprintf(stderr, "\n");
+ va_end(ap);
+}
+
+void x_fatalerror(CONST char *text, ...)
+{
+ va_list ap;
+ va_start(ap, text);
+ vfprintf(stderr, text, ap);
+ fprintf(stderr, "\n");
+ va_end(ap);
+ exit(1);
+}
+#endif
+#endif
diff --git a/src/util/xldio.c b/src/util/xldio.c
new file mode 100644
index 0000000..ab40058
--- /dev/null
+++ b/src/util/xldio.c
@@ -0,0 +1,603 @@
+/* This file contain long double I/O routines for Windows (because Windows API
+ don't support long double at all.
+
+ They don't work on other architectures. So be curefull. */
+
+
+/* This source comes from the DJGPP runtime library. It has been hacked
+ to work with XaoS */
+/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
+/* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
+/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
+/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
+#include <config.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <xio.h>
+/*#include <libc/unconst.h>*/
+#include <sys/types.h>
+#include <ctype.h>
+#include <string.h>
+#include <stdio.h>
+#include <math.h>
+#include <xldio.h>
+#ifdef USE_XLDIO
+
+static long double powten[] = {
+ 1e1L, 1e2L, 1e4L, 1e8L, 1e16L, 1e32L, 1e64L, 1e128L, 1e256L,
+ 1e512L, 1e1024L, 1e2048L, 1e4096L
+};
+
+long double x_strtold(CONST char *s, CONST char **sret)
+{
+ long double r; /* result */
+ int e, ne; /* exponent */
+ int sign; /* +- 1.0 */
+ int esign;
+ int flags = 0;
+ int l2powm1;
+
+ r = 0.0L;
+ sign = 1;
+ e = ne = 0;
+ esign = 1;
+
+ while (*s && isspace(*s))
+ s++;
+
+ if (*s == '+')
+ s++;
+ else if (*s == '-') {
+ sign = -1;
+ s++;
+ }
+
+ while ((*s >= '0') && (*s <= '9')) {
+ flags |= 1;
+ r *= 10.0L;
+ r += *s - '0';
+ s++;
+ }
+
+ if (*s == '.') {
+ s++;
+ while ((*s >= '0') && (*s <= '9')) {
+ flags |= 2;
+ r *= 10.0L;
+ r += *s - '0';
+ s++;
+ ne++;
+ }
+ }
+ if (flags == 0) {
+ if (sret)
+ *sret = /*unconst(s, char *) */ s;
+ return 0.0L;
+ }
+
+ if ((*s == 'e') || (*s == 'E')) {
+ s++;
+ if (*s == '+')
+ s++;
+ else if (*s == '-') {
+ s++;
+ esign = -1;
+ }
+ while ((*s >= '0') && (*s <= '9')) {
+ e *= 10;
+ e += *s - '0';
+ s++;
+ }
+ }
+ if (esign < 0) {
+ esign = -esign;
+ e = -e;
+ }
+ e = e - ne;
+ if (e < -4096) {
+ /* possibly subnormal number, 10^e would overflow */
+ r *= 1.0e-2048L;
+ e += 2048;
+ }
+ if (e < 0) {
+ e = -e;
+ esign = -esign;
+ }
+ if (e >= 8192)
+ e = 8191;
+ if (e) {
+ long double d = 1.0L;
+ l2powm1 = 0;
+ while (e) {
+ if (e & 1)
+ d *= powten[l2powm1];
+ e >>= 1;
+ l2powm1++;
+ }
+ if (esign > 0)
+ r *= d;
+ else
+ r /= d;
+ }
+ if (sret)
+ *sret = /*unconst(s, char *) */ s;
+ return r * sign;
+}
+
+#if 0
+main()
+{
+ printf("%E", (float) x_strtold("1.4E15", NULL));
+}
+#endif
+
+
+#define MAXEXPLD 4952 /* this includes subnormal numbers */
+static int is_nan = 0;
+static char decimal = '.';
+static long double pten[] = {
+ 1e1L, 1e2L, 1e4L, 1e8L, 1e16L, 1e32L, 1e64L, 1e128L, 1e256L,
+ 1e512L, 1e1024L, 1e2048L, 1e4096L
+};
+
+static long double ptenneg[] = {
+ 1e-1L, 1e-2L, 1e-4L, 1e-8L, 1e-16L, 1e-32L, 1e-64L, 1e-128L, 1e-256L,
+ 1e-512L, 1e-1024L, 1e-2048L, 1e-4096L
+};
+
+static inline char tochar(int n)
+{
+ if (n >= 9)
+ return '9';
+ if (n <= 0)
+ return '0';
+ return n + '0';
+}
+
+static inline int todigit(char c)
+{
+ if (c <= '0')
+ return 0;
+ if (c >= '9')
+ return 9;
+ return c - '0';
+}
+
+#define LONGINT 0x01 /* long integer */
+#define LONGDBL 0x02 /* long double */
+#define SHORTINT 0x04 /* short integer */
+#define ALT 0x08 /* alternate form */
+#define LADJUST 0x10 /* left adjustment */
+#define ZEROPAD 0x20 /* zero (as opposed to blank) pad */
+#define HEXPREFIX 0x40 /* add 0x or 0X prefix */
+
+#define MAXP 4096
+#define NP 12
+#define P (4294967296.0L * 4294967296.0L * 2.0L) /* 2^65 */
+static long double INVPREC = P;
+static long double PREC = 1.0L / P;
+#undef P
+/*
+ * Defining FAST_LDOUBLE_CONVERSION results in a little bit faster
+ * version, which might be less accurate (about 1 bit) for long
+ * double. For 'normal' double it doesn't matter.
+ */
+/* #define FAST_LDOUBLE_CONVERSION */
+#if 1
+#define modfl mymodfl
+inline long double m_floor(long double x)
+{
+ register long double __value;
+ volatile unsigned short int __cw, __cwtmp;
+
+ asm volatile ("fnstcw %0":"=m" (__cw));
+ __cwtmp = (__cw & 0xf3ff) | 0x0400; /* rounding down */
+ asm volatile ("fldcw %0"::"m" (__cwtmp));
+ asm volatile ("frndint":"=t" (__value):"0"(x));
+ asm volatile ("fldcw %0"::"m" (__cw));
+
+ return __value;
+
+}
+
+static inline long double mymodfl(long double x, long double *pint)
+{
+ /*int p=(int) x; */
+ long double p = m_floor(x);
+ long double frac = x - p;
+ if (x < 0)
+ p = p + 1, frac = frac - 1;
+ *pint = p;
+ return frac;
+}
+#endif
+static char *exponentl(char *p, int expv, unsigned char fmtch)
+{
+ char *t;
+ char expbuf[MAXEXPLD];
+
+ *p++ = fmtch;
+ if (expv < 0) {
+ expv = -expv;
+ *p++ = '-';
+ } else
+ *p++ = '+';
+ t = expbuf + MAXEXPLD;
+ if (expv > 9) {
+ do {
+ *--t = tochar(expv % 10);
+ }
+ while ((expv /= 10) > 9);
+ *--t = tochar(expv);
+ for (; t < expbuf + MAXEXPLD; *p++ = *t++);
+ } else {
+ *p++ = '0';
+ *p++ = tochar(expv);
+ }
+ return p;
+}
+
+static int isspeciall(long double d, char *bufp)
+{
+ struct IEEExp {
+ unsigned manl:32;
+ unsigned manh:32;
+ unsigned exp:15;
+ unsigned sign:1;
+ } *ip = (struct IEEExp *) &d;
+
+ is_nan = 0; /* don't assume the static is 0 (emacs) */
+ if (ip->exp != 0x7fff)
+ return (0);
+ if ((ip->manh & 0x7fffffff) || ip->manl) {
+ strcpy(bufp, "NaN");
+ is_nan = ip->sign ? -1 : 1; /* kludge: we don't need the sign, it's not nice
+ but it should work */
+ } else
+ (void) strcpy(bufp, "Inf");
+ return (3);
+}
+
+static char *my_roundl(long double fract, int *expv, char *start,
+ char *end, char ch, char *signp)
+{
+ long double tmp;
+
+ if (fract) {
+ if (fract == 0.5L) {
+ char *e = end;
+ if (*e == '.')
+ e--;
+ if (*e == '0' || *e == '2' || *e == '4' || *e == '6'
+ || *e == '8') {
+ tmp = 3.0;
+ goto start;
+ }
+ }
+ (void) modfl(fract * 10.0L, &tmp);
+ } else
+ tmp = todigit(ch);
+ start:
+ if (tmp > 4)
+ for (;; --end) {
+ if (*end == decimal)
+ --end;
+ if (++*end <= '9')
+ break;
+ *end = '0';
+ if (end == start) {
+ if (expv) { /* e/E; increment exponent */
+ *end = '1';
+ ++*expv;
+ } else { /* f; add extra digit */
+ *--end = '1';
+ --start;
+ }
+ break;
+ }
+ }
+ /* ``"%.3f", (double)-0.0004'' gives you a negative 0. */
+ else if (*signp == '-')
+ for (;; --end) {
+ if (*end == decimal)
+ --end;
+ if (*end != '0')
+ break;
+ if (end == start)
+ *signp = 0;
+ }
+ return start;
+}
+
+
+static int
+cvtl(long double number, int prec, int flags, char *signp,
+ unsigned char fmtch, char *startp, char *endp)
+{
+ char *p, *t;
+ long double fract = 0;
+ int dotrim, expcnt, gformat;
+ int doextradps = 0; /* Do extra decimal places if the precision needs it */
+ int doingzero = 0; /* We're displaying 0.0 */
+ long double integer, tmp;
+
+ if ((expcnt = isspeciall(number, startp)))
+ return (expcnt);
+
+ dotrim = expcnt = gformat = 0;
+ /* fract = modfl(number, &integer); */
+ integer = number;
+
+ /* get an extra slot for rounding. */
+ t = ++startp;
+
+ p = endp - 1;
+ if (integer) {
+ int i, lp = NP, pt = MAXP;
+#ifndef FAST_LDOUBLE_CONVERSION
+ long double oint = integer, dd = 1.0L;
+#endif
+ if (integer > INVPREC) {
+ integer *= PREC;
+ while (lp >= 0) {
+ if (integer >= pten[lp]) {
+ expcnt += pt;
+ integer *= ptenneg[lp];
+#ifndef FAST_LDOUBLE_CONVERSION
+ dd *= pten[lp];
+#endif
+ }
+ pt >>= 1;
+ lp--;
+ }
+#ifndef FAST_LDOUBLE_CONVERSION
+ integer = oint / dd;
+#else
+ integer *= INVPREC;
+#endif
+ }
+ /*
+ * Do we really need this ?
+ */
+ for (i = 0; i < expcnt; i++)
+ *p-- = '0';
+ }
+ number = integer;
+ fract = modfl(number, &integer);
+ /* If integer is zero then we need to look at where the sig figs are */
+ if (integer < 1) {
+ /* If fract is zero the zero before the decimal point is a sig fig */
+ if (fract == 0.0)
+ doingzero = 1;
+ /* If fract is non-zero all sig figs are in fractional part */
+ else
+ doextradps = 1;
+ }
+ /*
+ * get integer portion of number; put into the end of the buffer; the
+ * .01 is added for modf(356.0 / 10, &integer) returning .59999999...
+ */
+ for (; integer; ++expcnt) {
+ tmp = modfl(integer * 0.1L, &integer);
+ *p-- = tochar((int) ((tmp + .01L) * 10));
+ }
+ switch (fmtch) {
+ case 'f':
+ /* reverse integer into beginning of buffer */
+ if (expcnt)
+ for (; ++p < endp; *t++ = *p);
+ else
+ *t++ = '0';
+ /*
+ * if precision required or alternate flag set, add in a
+ * decimal point.
+ */
+ if (prec || flags & ALT)
+ *t++ = decimal;
+ /* if requires more precision and some fraction left */
+ if (fract) {
+ if (prec)
+ do {
+ fract = modfl(fract * 10.0L, &tmp);
+ *t++ = tochar((int) tmp);
+ }
+ while (--prec && fract);
+ if (fract)
+ startp = my_roundl(fract, (int *) NULL, startp,
+ t - 1, (char) 0, signp);
+ }
+ for (; prec--; *t++ = '0');
+ break;
+ case 'e':
+ case 'E':
+ eformat:
+ if (expcnt) {
+ *t++ = *++p;
+ if (prec || flags & ALT)
+ *t++ = decimal;
+ /* if requires more precision and some integer left */
+ for (; prec && ++p < endp; --prec)
+ *t++ = *p;
+ /*
+ * if done precision and more of the integer component,
+ * round using it; adjust fract so we don't re-round
+ * later.
+ */
+ if (!prec && ++p < endp) {
+ fract = 0;
+ startp = my_roundl((long double) 0.0L, &expcnt,
+ startp, t - 1, *p, signp);
+ }
+ /* adjust expcnt for digit in front of decimal */
+ --expcnt;
+ }
+ /* until first fractional digit, decrement exponent */
+ else if (fract) {
+ int lp = NP, pt = MAXP;
+#ifndef FAST_LDOUBLE_CONVERSION
+ long double ofract = fract, dd = 1.0L;
+#endif
+ expcnt = -1;
+ if (fract < PREC) {
+ fract *= INVPREC;
+ while (lp >= 0) {
+ if (fract <= ptenneg[lp]) {
+ expcnt -= pt;
+ fract *= pten[lp];
+#ifndef FAST_LDOUBLE_CONVERSION
+ dd *= pten[lp];
+#endif
+ }
+ pt >>= 1;
+ lp--;
+ }
+#ifndef FAST_LDOUBLE_CONVERSION
+ fract = ofract * dd;
+#else
+ fract *= PREC;
+#endif
+ }
+ /* adjust expcnt for digit in front of decimal */
+ for ( /* expcnt = -1 */ ;; --expcnt) {
+ fract = modfl(fract * 10.0L, &tmp);
+ if (tmp)
+ break;
+ }
+ *t++ = tochar((int) tmp);
+ if (prec || flags & ALT)
+ *t++ = decimal;
+ } else {
+ *t++ = '0';
+ if (prec || flags & ALT)
+ *t++ = decimal;
+ }
+ /* if requires more precision and some fraction left */
+ if (fract) {
+ if (prec)
+ do {
+ fract = modfl(fract * 10.0L, &tmp);
+ *t++ = tochar((int) tmp);
+ }
+ while (--prec && fract);
+ if (fract)
+ startp =
+ my_roundl(fract, &expcnt, startp, t - 1, (char) 0,
+ signp);
+ }
+ /* if requires more precision */
+ for (; prec--; *t++ = '0');
+
+ /* unless alternate flag, trim any g/G format trailing 0's */
+ if (gformat && !(flags & ALT)) {
+ while (t > startp && *--t == '0');
+ if (*t == decimal)
+ --t;
+ ++t;
+ }
+ t = exponentl(t, expcnt, fmtch);
+ break;
+ case 'g':
+ case 'G':
+ if (prec) {
+ /* If doing zero and precision is greater than 0 count the
+ * 0 before the decimal place */
+ if (doingzero)
+ --prec;
+ } else {
+ /* a precision of 0 is treated as precision of 1 unless doing zero */
+ if (!doingzero)
+ ++prec;
+ }
+ /*
+ * ``The style used depends on the value converted; style e
+ * will be used only if the exponent resulting from the
+ * conversion is less than -4 or greater than the precision.''
+ * -- ANSI X3J11
+ */
+ if (expcnt > prec || (!expcnt && fract && fract < .0001)) {
+ /*
+ * g/G format counts "significant digits, not digits of
+ * precision; for the e/E format, this just causes an
+ * off-by-one problem, i.e. g/G considers the digit
+ * before the decimal point significant and e/E doesn't
+ * count it as precision.
+ */
+ --prec;
+ fmtch -= 2; /* G->E, g->e */
+ gformat = 1;
+ goto eformat;
+ }
+ /*
+ * reverse integer into beginning of buffer,
+ * note, decrement precision
+ */
+ if (expcnt)
+ for (; ++p < endp; *t++ = *p, --prec);
+ else
+ *t++ = '0';
+ /*
+ * if precision required or alternate flag set, add in a
+ * decimal point. If no digits yet, add in leading 0.
+ */
+ if (prec || flags & ALT) {
+ dotrim = 1;
+ *t++ = decimal;
+ } else
+ dotrim = 0;
+ /* if requires more precision and some fraction left */
+ while (prec && fract) {
+ fract = modfl(fract * 10.0L, &tmp);
+ *t++ = tochar((int) tmp);
+ /* If we're not adding 0s
+ * or we are but they're sig figs:
+ * decrement the precision */
+ if ((doextradps != 1) || ((int) tmp != 0)) {
+ doextradps = 0;
+ prec--;
+ }
+ }
+ if (fract)
+ startp =
+ my_roundl(fract, (int *) NULL, startp, t - 1, (char) 0,
+ signp);
+ /* alternate format, adds 0's for precision, else trim 0's */
+ if (flags & ALT)
+ for (; prec--; *t++ = '0');
+ else if (dotrim) {
+ while (t > startp && *--t == '0');
+ if (*t != decimal)
+ ++t;
+ }
+ }
+ return t - startp;
+}
+
+#if 0
+main()
+{
+ static char buf[4096];
+ int i;
+ cvtl(0.00000000000000000005, 4, 0, &softsign, 'G', buf,
+ buf + sizeof(buf) - 1);
+ printf("%s\n", buf + 1);
+ printf("%.30LG\n", (long double) 234236723234234231235324.47239L);
+}
+
+#endif
+void x_ldout(long double param, int prec, xio_file stream)
+{
+ static char buf[4095];
+ char softsign = 0;
+ int l;
+ if (param < 0)
+ xio_putc('-', stream), param = -param;
+ l = cvtl(param, prec, 0, &softsign, 'G', buf, buf + sizeof(buf));
+ /*printf("a:%s %i\n",buf+1, prec); */
+ buf[l + 2] = 0;
+ l = strlen(buf + 1);
+ if (buf[l] == '.')
+ buf[l] = 0;
+ /*printf("b:%s %i\n",buf+1, prec); */
+ xio_puts(buf + 1, stream);
+}
+#endif
diff --git a/src/util/xmenu.c b/src/util/xmenu.c
new file mode 100644
index 0000000..8a70b5d
--- /dev/null
+++ b/src/util/xmenu.c
@@ -0,0 +1,998 @@
+#ifdef _plan9_
+#include <u.h>
+#include <libc.h>
+#else
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#endif
+#include <config.h>
+#include <filter.h>
+#include <fractal.h>
+#include <ui_helper.h>
+#include <xerror.h>
+#include <xldio.h>
+#include <misc-f.h>
+#include "config.h"
+#include "xmenu.h"
+
+#define HASHBITS 8
+#define HASHSIZE (1<<HASHBITS)
+#define HASHMASK (HASHSIZE-1)
+#define HASH(c,len) (((len)*32+(c)[0]+(c)[(len)-1])&HASHMASK)
+
+static struct queuelist {
+ struct queuelist *next;
+ struct queuelist *previous;
+ CONST menuitem *item;
+ dialogparam *d;
+} *firstqueue = NULL, *lastqueue = NULL;
+static struct entry {
+ struct entry *next;
+ struct entry *previous;
+ struct entry *nextname;
+ CONST menuitem *item;
+} *firstitem = NULL, *lastitem = NULL;
+
+struct entry *namehash[HASHSIZE];
+
+static void
+x_menu_insert(CONST menuitem * item, struct entry *iitem, int n)
+{
+ int i;
+ int len;
+ int hashpos;
+ struct entry *list;
+ for (i = 0; i < n; i++) {
+ list = (struct entry *) calloc(1, sizeof(struct queuelist));
+ if (list == NULL) {
+ x_error("Warning:out of memory!");
+ return;
+ }
+ if (item->type != MENU_SEPARATOR) {
+ len = strlen(item->shortname);
+ hashpos = HASH(item->shortname, len);
+ list->nextname = namehash[hashpos];
+#ifdef DEBUG
+ {
+ struct entry *e = list->nextname;
+ while (e != NULL) {
+ if (e->item->type != MENU_SUBMENU
+ && e->item->type != MENU_SEPARATOR
+ && item->type != MENU_SEPARATOR);
+ if (!strcmp(e->item->shortname, item->shortname)
+ /*&& e->item->type != MENU_SUBMENU && item->type != MENU_SUBMENU */
+ ) {
+ x_error
+ ("Menu error:Name collision %s:'%s'(%s) and '%s'(%s)",
+ item->shortname, item->name, item->menuname,
+ e->item->name, e->item->menuname);
+ }
+ e = e->nextname;
+ }
+ }
+#endif
+ namehash[hashpos] = list;
+ }
+ list->item = item;
+ if (iitem == NULL) {
+ /*printf("ahoj\n"); */
+ list->previous = lastitem;
+ list->next = NULL;
+ if (lastitem != NULL)
+ lastitem->next = list;
+ else
+ firstitem = list;
+ lastitem = list;
+ } else {
+ list->next = iitem;
+ list->previous = iitem->previous;
+ if (iitem->previous)
+ iitem->previous->next = list;
+ else
+ firstitem = list;
+ iitem->previous = list;
+ }
+ item++;
+ }
+}
+
+void menu_add(CONST menuitem * item, int n)
+{
+ x_menu_insert(item, NULL, n);
+}
+
+void menu_insert(CONST menuitem * item, CONST char *before, int n)
+{
+ struct entry *e = firstitem;
+ while (e != NULL) {
+ if (!strcmp(e->item->shortname, before))
+ break;
+ e = e->next;
+ }
+ x_menu_insert(item, e, n);
+}
+
+void menu_delete(CONST menuitem * items, int n)
+{
+ int d = 0, i;
+ struct entry *item = firstitem;
+ struct entry *pe;
+ int hashpos;
+ for (i = 0; i < n; i++) {
+ if (items[i].type == MENU_SEPARATOR) {
+ struct entry *item = firstitem;
+ while (item && item->item != items + i)
+ item = item->next;
+ if (!item)
+ abort();
+ if (item->previous != NULL)
+ item->previous->next = item->next;
+ else
+ firstitem = item->next;
+ if (item->next != NULL)
+ item->next->previous = item->previous;
+ else
+ lastitem = item->previous;
+ free(item);
+ } else {
+ int len = strlen(items[i].shortname);
+ hashpos = HASH(items[i].shortname, len);
+ pe = NULL;
+ item = namehash[hashpos];
+ while (item != NULL) {
+ if (items + i == item->item) {
+ d++;
+ if (pe == NULL)
+ namehash[hashpos] = item->nextname;
+ else
+ pe->nextname = item->nextname;
+ if (item->previous != NULL)
+ item->previous->next = item->next;
+ else
+ firstitem = item->next;
+ if (item->next != NULL)
+ item->next->previous = item->previous;
+ else
+ lastitem = item->previous;
+ free(item);
+ break;
+ } /*if */
+ pe = item;
+ item = item->nextname;
+ } /*while */
+ }
+#ifdef DEBUG
+ if (item == NULL)
+ x_error("Item %s not found!", items[i].shortname);
+#endif
+ } /*for */
+}
+
+void menu_addqueue(CONST menuitem * item, dialogparam * d)
+{
+ struct queuelist *list;
+ list = (struct queuelist *) calloc(1, sizeof(struct queuelist));
+ if (list == NULL) {
+ x_error("Warning:out of memory!");
+ return;
+ }
+ list->previous = lastqueue;
+ list->next = NULL;
+ list->item = item;
+ list->d = d;
+ if (lastqueue != NULL)
+ lastqueue->next = list;
+ else
+ firstqueue = list;
+ lastqueue = list;
+}
+
+CONST menuitem *menu_delqueue(dialogparam ** d)
+{
+ CONST struct menuitem *item;
+ struct queuelist *list = firstqueue;
+ if (firstqueue == NULL)
+ return NULL;
+ item = firstqueue->item;
+ *d = firstqueue->d;
+ firstqueue = list->next;
+ if (list->next != NULL)
+ list->next->previous = NULL;
+ else
+ lastqueue = NULL;
+ free(list);
+ return (item);
+}
+
+CONST static void *menu_rfind(CONST void
+ *(*function) (struct entry * item),
+ CONST char *root)
+{
+ struct entry *item = firstitem;
+ CONST void *r;
+ while (item != NULL) {
+ if (!strcmp(root, item->item->menuname)) {
+ if ((r = function(item)) != NULL)
+ return r;
+ if (item->item->type == MENU_SUBMENU
+ && (r =
+ menu_rfind(function, item->item->shortname)) != NULL)
+ return r;
+ }
+ item = item->next;
+ }
+ return NULL;
+}
+
+CONST static char *findkey;
+CONST static void *cmpfunction(struct entry *item)
+{
+ if (item->item->key == NULL)
+ return NULL;
+ if (!strcmp(findkey, item->item->key))
+ return item->item;
+ return NULL;
+}
+
+CONST menuitem *menu_findkey(CONST char *key, CONST char *root)
+{
+ findkey = key;
+ return ((CONST menuitem *) menu_rfind(cmpfunction, root));
+}
+
+static CONST menuitem *finditem;
+CONST static void *cmpfunction2(struct entry *item)
+{
+ if (item->item == finditem)
+ return item;
+ return NULL;
+}
+
+int menu_available(CONST menuitem * item, CONST char *root)
+{
+ finditem = item;
+ return (menu_rfind(cmpfunction2, root) != NULL);
+}
+
+CONST char *menu_fullname(CONST char *menu)
+{
+ struct entry *item = firstitem;
+ while (item != NULL) {
+ if (item->item->type == MENU_SUBMENU
+ && !strcmp(menu, item->item->shortname)) {
+ return (item->item->name);
+ }
+ item = item->next;
+ }
+ return NULL;
+}
+
+CONST menuitem *menu_item(CONST char *menu, int n)
+{
+ struct entry *item = firstitem;
+ while (item != NULL) {
+ if (!strcmp(menu, item->item->menuname)) {
+ if (!(item->item->flags & MENUFLAG_NOMENU))
+ n--;
+ if (n < 0)
+ return (item->item);
+ }
+ item = item->next;
+ }
+ return NULL;
+}
+
+static CONST menuitem *menu_item2(CONST char *menu, int n)
+{
+ struct entry *item = firstitem;
+ while (item != NULL) {
+ if (!strcmp(menu, item->item->menuname)) {
+ n--;
+ if (n < 0)
+ return (item->item);
+ }
+ item = item->next;
+ }
+ return NULL;
+}
+
+int menu_havedialog(CONST menuitem * item, struct uih_context *c)
+{
+ if (item->type != MENU_DIALOG && item->type != MENU_CUSTOMDIALOG)
+ return 0;
+ if (!(item->type & MENUFLAG_RADIO) || c == NULL)
+ return 1;
+ if (item->flags & MENUFLAG_DIALOGATDISABLE)
+ return (menu_enabled(item, c));
+ return (!menu_enabled(item, c));
+}
+
+static void menu_freeparam(dialogparam * d, CONST struct dialog *di)
+{
+ switch (di->type) {
+ case DIALOG_STRING:
+ case DIALOG_KEYSTRING:
+ case DIALOG_IFILE:
+ case DIALOG_OFILE:
+ free(d->dstring);
+ }
+}
+
+void
+menu_destroydialog(CONST menuitem * item, dialogparam * d,
+ struct uih_context *uih)
+{
+ int i;
+ CONST struct dialog *di = menu_getdialog(uih, item);
+ for (i = 0; di[i].question; i++) {
+ menu_freeparam(d + i, di + i);
+ }
+ free(d);
+
+}
+
+void
+menu_activate(CONST menuitem * item, struct uih_context *c,
+ dialogparam * d)
+{
+ if (c == NULL
+ && (!(item->flags & MENUFLAG_ATSTARTUP) || firstqueue != NULL)) {
+ menu_addqueue(item, d);
+ return;
+ } else {
+ if (c != NULL && c->incalculation
+ && !(item->flags & MENUFLAG_INCALC)) {
+ if (c->flags & MENUFLAG_INTERRUPT)
+ c->interrupt = 1;
+ menu_addqueue(item, d);
+ return;
+ }
+ }
+ switch (item->type) {
+ case MENU_SEPARATOR:
+ x_error("separator activated!");
+ break;
+ case MENU_SUBMENU:
+ x_error("submenu activated!");
+ break;
+ case MENU_NOPARAM:
+ ((void (*)(struct uih_context *)) item->function) (c);
+ break;
+ case MENU_INT:
+ ((void (*)(struct uih_context *, int)) item->function) (c,
+ item->
+ iparam);
+ break;
+ case MENU_STRING:
+ ((void (*)(struct uih_context *, CONST char *)) item->function) (c,
+ (CONST
+ char
+ *)
+ item->pparam);
+ break;
+ case MENU_DIALOG:
+ case MENU_CUSTOMDIALOG:
+ if (!menu_havedialog(item, c)) {
+ ((void (*)(struct uih_context * c, dialogparam *)) item->
+ function)
+ (c, (dialogparam *) NULL);
+ } else {
+ CONST menudialog *di = menu_getdialog(c, item);
+ if (di[0].question == NULL) {
+ ((void (*)(struct uih_context * c, dialogparam *))
+ item->function) (c, (dialogparam *) NULL);
+ break;
+ } else if (di[1].question == NULL) {
+ /*call function with right
+ *parameter. This avoids need to write wrappers*/
+ switch (di[0].type) {
+ case DIALOG_INT:
+ case DIALOG_CHOICE:
+ case DIALOG_ONOFF:
+ ((void (*)(struct uih_context * c, int)) item->
+ function) (c, d[0].dint);
+ break;
+ case DIALOG_FLOAT:
+ ((void (*)(struct uih_context * c, number_t))
+ item->function) (c, d[0].number);
+ break;
+ case DIALOG_COORD:
+ ((void (*)(struct uih_context * c, number_t, number_t))
+ item->function) (c, d[0].dcoord[0], d[0].dcoord[1]);
+ break;
+ case DIALOG_STRING:
+ case DIALOG_KEYSTRING:
+ ((void (*)(struct uih_context * c, char *)) item->
+ function)
+ (c, d[0].dstring);
+ break;
+ case DIALOG_IFILE:
+ case DIALOG_OFILE:
+ ((void (*)(struct uih_context * c, xio_path))
+ item->function) (c, d[0].dpath);
+ break;
+ default:
+ x_error("dialog:unknown type!");
+ break;
+ }
+
+ } else
+ ((void (*)(struct uih_context * c, dialogparam *)) item->
+ function)
+ (c, d);
+ }
+ break;
+ default:
+ x_error("Menu_activate: unknown type %i!", item->type);
+ break;
+ }
+}
+
+int menu_enabled(CONST menuitem * item, struct uih_context *c)
+{
+ if (item->flags & (MENUFLAG_RADIO | MENUFLAG_CHECKBOX))
+ switch (item->type) {
+ case MENU_SEPARATOR:
+ return 0;
+ case MENU_SUBMENU:
+ case MENU_DIALOG:
+ case MENU_NOPARAM:
+ case MENU_CUSTOMDIALOG:
+ return (((int (*)(struct uih_context *)) item->control) (c));
+ case MENU_INT:
+ return (((int (*)(struct uih_context *, int)) item->
+ control) (c, item->iparam));
+ case MENU_STRING:
+ return (((int (*)(struct uih_context *, CONST char *)) item->
+ control)
+ (c, (CONST char *) item->pparam));
+ default:
+ x_error("Menu_enabled: unknown type!");
+ break;
+ }
+ return 0;
+}
+
+void menu_delnumbered(int n, CONST char *name)
+{
+ menuitem *items;
+ int i;
+ char s[256];
+ sprintf(s, "%s%i", name, 0);
+ items = (menuitem *) menu_findcommand(s);
+ menu_delete(items, n);
+ for (i = 0; i < n; i++) {
+ if (items[i].key)
+ free((char *) items[i].key);
+ free((char *) items[i].shortname);
+ }
+ free(items);
+}
+
+CONST menuitem *menu_genernumbered(int n, CONST char *menuname,
+ CONST char *CONST * CONST names,
+ CONST char *keys, int type, int flags,
+ void (*function) (struct uih_context *
+ context, int),
+ int (*control) (struct uih_context *
+ context, int),
+ CONST char *prefix)
+{
+ int l = keys != NULL ? (int) strlen(keys) : -1;
+ int i;
+ menuitem *item = (menuitem *) malloc(sizeof(menuitem) * n);
+ if (item == NULL)
+ return NULL;
+ for (i = 0; i < n; i++) {
+ item[i].menuname = menuname;
+ if (i < l) {
+ char *key = malloc(2);
+ item[i].key = key;
+ key[0] = keys[i];
+ key[1] = 0;
+ } else
+ item[i].key = 0;
+ item[i].type = type;
+ item[i].flags = flags;
+ item[i].iparam = i;
+ item[i].name = names[i];
+ item[i].shortname = names[i];
+ if (prefix != NULL) {
+ char *shortname = (char *) malloc(strlen(prefix) + 4);
+ item[i].shortname = shortname;
+ sprintf(shortname, "%s%i", prefix, i);
+ }
+ item[i].function = (void (*)(void)) function;
+ item[i].control = (int (*)(void)) control;
+ }
+ menu_add(item, n);
+ return (item);
+}
+
+number_t menu_getfloat(CONST char *s, CONST char **error)
+{
+#ifdef HAVE_LONG_DOUBLE
+ long double param = 0;
+#else
+ double param = 0;
+#endif
+#ifdef HAVE_LONG_DOUBLE
+#ifndef USE_ATOLD
+#ifdef USE_XLDIO
+ param = x_strtold(s, NULL);
+ if (0)
+#else
+ if (sscanf(s, "%LG", &param) == 0)
+#endif
+#else
+ param = _atold(s);
+ if (0)
+#endif
+ {
+#else
+ if (sscanf(s, "%lG", &param) == 0) {
+#endif
+ *error = "Floating point number expected";
+ return 0;
+ }
+ return (param);
+}
+
+int menuparse_scheme = 0;
+CONST char *menu_fillparam(struct uih_context *uih, tokenfunc f,
+ CONST menudialog * d, dialogparam * p)
+{
+ char *c = f(uih);
+ CONST char *error = NULL;
+ if (c == NULL)
+ return "Parameter expected";
+ switch (d->type) {
+ case DIALOG_INT:
+ if (sscanf(c, "%i", &p->dint) != 1) {
+ return "Integer parameter expected";
+ }
+ break;
+ case DIALOG_FLOAT:
+ p->number = menu_getfloat(c, &error);
+ if (error != NULL)
+ return (error);
+ break;
+ case DIALOG_COORD:
+ p->dcoord[0] = menu_getfloat(c, &error);
+ if (error != NULL)
+ return (error);
+ c = f(uih);
+ if (c == NULL)
+ return "Imaginary part expected";
+ p->dcoord[1] = menu_getfloat(c, &error);
+ if (error != NULL)
+ return (error);
+ break;
+ case DIALOG_KEYSTRING:
+ if (menuparse_scheme) {
+ if (c[0] != '\'')
+ return "Key string parameter expected";
+ p->dstring = mystrdup(c + 1);
+ } else
+ p->dstring = mystrdup(c);
+ break;
+ case DIALOG_STRING:
+ if (menuparse_scheme) {
+ int l = strlen(c);
+ if (l < 2 || c[0] != '"' || c[l - 1] != '"')
+ return "String parameter expected";
+ p->dstring = mystrdup(c + 1);
+ p->dstring[l - 2] = 0;
+ } else
+ p->dstring = mystrdup(c);
+ break;
+ case DIALOG_IFILE:
+ case DIALOG_OFILE:
+ if (menuparse_scheme) {
+ int l = strlen(c);
+ if (l < 2 || c[0] != '"' || c[l - 1] != '"')
+ return "String parameter expected";
+ p->dstring = mystrdup(c + 1);
+ p->dstring[l - 2] = 0;
+ } else
+ p->dstring = mystrdup(c);
+ break;
+ case DIALOG_CHOICE:
+ if (menuparse_scheme) {
+ if (c[0] != '\'')
+ return "Key string parameter expected";
+ c++;
+ }
+ {
+ int i;
+ CONST char **keys = (CONST char **) d->defstr;
+ for (i = 0;; i++) {
+ if (keys[i] == NULL)
+ return "Unknown parameter";
+ if (!strcmp(c, keys[i])) {
+ p->dint = i;
+ return NULL;
+ }
+ }
+ }
+ case DIALOG_ONOFF:
+ if (menuparse_scheme) {
+ if (!strcmp("#t", c)) {
+ p->dint = 1;
+ return NULL;
+ }
+ if (!strcmp("#f", c)) {
+ p->dint = 0;
+ return NULL;
+ }
+ } else {
+ if (!strcmp("on", c)) {
+ p->dint = 1;
+ return NULL;
+ }
+ if (!strcmp("off", c)) {
+ p->dint = 0;
+ return NULL;
+ }
+ }
+ default:
+ x_error("Unknown dialog parameter type!");
+ } /*switch */
+ return NULL;
+}
+
+static char errorstr[256];
+CONST menuitem *menu_findcommand(CONST char *name)
+{
+ struct entry *entry;
+ CONST menuitem *item;
+ int len;
+ len = strlen(name);
+ if (len > 100)
+ return NULL;
+ entry = namehash[HASH(name, len)];
+ while (entry != NULL) {
+ if (!strcmp(entry->item->shortname, name))
+ break;
+ entry = entry->nextname;
+ }
+ if (entry == NULL) {
+ return NULL;
+ }
+ item = entry->item;
+ return (item);
+}
+
+CONST char *menu_processcommand(struct uih_context *uih, tokenfunc f,
+ int scheme, int mask, CONST char *root)
+{
+ char *c = f(uih);
+ CONST menuitem *item;
+ menuparse_scheme = scheme;
+ if (c == NULL) {
+ if (!menuparse_scheme)
+ return "Command name expected";
+ return NULL;
+ }
+ item = menu_findcommand(c);
+ if (item == NULL) {
+ sprintf(errorstr, "%s:unknown function", c);
+ return errorstr;
+ }
+ if (item->flags & mask) {
+ sprintf(errorstr,
+ "function '%s' not available in this context (%i, %i)", c,
+ mask, item->flags);
+ return errorstr;
+ }
+ if ((item->flags & MENUFLAG_NOPLAY) && uih != NULL) {
+ if (root != NULL && !menu_available(item, root)) {
+ sprintf(errorstr, "function '%s' is disabled", c);
+ return errorstr;
+ }
+ }
+
+ if ((item->flags & MENUFLAG_CHECKBOX) && scheme) {
+ int w;
+ c = f(uih);
+ if (c == NULL) {
+ return ("Boolean parameter expected");
+ }
+
+ if (!strcmp("#t", c)) {
+ w = 1;
+ } else if (!strcmp("#f", c)) {
+ w = 0;
+ } else
+ return "Boolean parameter expected";
+ if (w == menu_enabled(item, uih)) {
+ if (((w != 0) ^ ((item->flags & MENUFLAG_DIALOGATDISABLE) !=
+ 0))
+ || (item->type != MENU_DIALOG
+ && item->type != MENU_CUSTOMDIALOG)) {
+ return NULL;
+ } else
+ menu_activate(item, uih, NULL); /*disable it... */
+ }
+ }
+ if (item->type != MENU_DIALOG && item->type != MENU_CUSTOMDIALOG) {
+ menu_activate(item, uih, NULL);
+ return NULL;
+ }
+ /*So we have some parameters */
+
+ {
+ dialogparam *param;
+ CONST menudialog *d = menu_getdialog(uih, item);
+ int i, n;
+ for (n = 0; d[n].question != NULL; n++);
+ param = (dialogparam *) malloc(n * sizeof(dialogparam));
+ for (i = 0; i < n; i++) {
+ CONST char *error;
+ error = menu_fillparam(uih, f, d + i, param + i);
+ if (error != NULL) {
+ sprintf(errorstr, "Function '%s' parameter %i:%s",
+ item->shortname, i, error);
+ for (n = 0; n < i; n++) {
+ menu_freeparam(param + i, d + i);
+ }
+ free(param);
+ return errorstr;
+ }
+ }
+ menu_activate(item, uih, param);
+ if (uih != NULL)
+ menu_destroydialog(item, param, uih);
+ }
+ return NULL;
+}
+
+static int argpos, margc;
+static char **margv;
+static int argposs;
+static char *gettoken(struct uih_context *c)
+{
+ if (argpos == margc)
+ return NULL;
+ if (argpos == argposs) {
+ if (!margv[argpos])
+ return NULL;
+ return (margv[argpos++] + 1);
+ } else
+ return (margv[argpos++]);
+}
+
+int menu_processargs(int n, int argc, char **argv)
+{
+ CONST char *error;
+ argpos = n;
+ argposs = n;
+ margc = argc;
+ margv = argv;
+ error =
+ menu_processcommand(NULL, gettoken, 0, MENUFLAG_NOOPTION, "root");
+ if (error) {
+ x_error("%s", error);
+ return -1;
+ }
+ return (argpos - 2);
+
+}
+
+void menu_printhelp(void)
+{
+ struct entry *e = firstitem;
+ while (e) {
+ if (e->item->type == MENU_SEPARATOR) {
+ e = e->next;
+ continue;
+ }
+ if (e->item->type == MENU_SUBMENU
+ && !(e->item->flags & MENUFLAG_NOOPTION)) {
+ struct entry *e1 = firstitem;
+ int n = 1;
+ while (e1) {
+ /*if (e->item->type == MENU_SEPARATOR) {printf ("\n"); e1=e1->next;continue;} */
+ if (e1->item->type != MENU_SUBMENU
+ && e1->item->type != MENU_SEPARATOR
+ && !(e1->item->flags & MENUFLAG_NOOPTION)
+ && !strcmp(e1->item->menuname, e->item->shortname)) {
+ if (n) {
+ printf("\n%s\n\n", e->item->name);
+ n = 0;
+ }
+ printf(" -%-15s", e1->item->shortname);
+ if (menu_havedialog(e1->item, NULL)) {
+ CONST menudialog *d =
+ menu_getdialog(NULL, e1->item);
+ while (d->question != NULL) {
+ switch (d->type) {
+ case DIALOG_INT:
+ printf("integer ");
+ break;
+ case DIALOG_FLOAT:
+ printf("real_number ");
+ break;
+ case DIALOG_COORD:
+ printf("real_number real_number ");
+ break;
+ case DIALOG_KEYSTRING:
+ case DIALOG_STRING:
+ printf("string ");
+ break;
+ case DIALOG_IFILE:
+ printf("input_file ");
+ break;
+ case DIALOG_OFILE:
+ printf("output_file ");
+ break;
+ case DIALOG_CHOICE:
+ {
+ int i;
+ CONST char **keys =
+ (CONST char **) d->defstr;
+ for (i = 0;; i++) {
+ if (keys[i] == NULL)
+ break;
+ if (i != 0)
+ putc('|', stdout);
+ printf("%s", keys[i]);
+ }
+ putc(' ', stdout);
+ }
+ break;
+ case DIALOG_ONOFF:
+ printf("on|off ");
+ }
+ d++;
+ }
+ printf("\n%14s ", "");
+ }
+ printf(" %s\n", e1->item->name);
+ }
+ e1 = e1->next;
+ }
+ }
+ e = e->next;
+ }
+}
+
+void uih_xshlprintmenu(struct uih_context *c, CONST char *name)
+{
+ int i = 0;
+ int nexti;
+ CONST menuitem *item, *nextitem, *lastitem;
+ int comma;
+ printf("%%%s\n\n", name);
+ printf("<menuhead><head>%s</head></menuhead>\n", menu_fullname(name));
+ printf("<menuitems><center>\n");
+ for (i = 0; (item = menu_item2(name, i)) != NULL; i++) {
+ if (item->type == MENU_SEPARATOR)
+ printf("<p>\n");
+ else if (item->type == MENU_SUBMENU)
+ printf("<p><submenu><a %s>%s</a>\n", item->shortname,
+ item->name);
+ else
+ printf("<p><a %s>%s</a>\n", item->shortname, item->name);
+ }
+ printf("</center></menuitems>\n");
+ lastitem = NULL;
+ for (i = 0; (item = menu_item2(name, i)) != NULL; i++) {
+ if (item->type == MENU_SEPARATOR)
+ continue;
+ if (item->type != MENU_SUBMENU) {
+ for (nexti = i + 1;
+ (nextitem = menu_item2(name, nexti)) != NULL
+ && nextitem->type == MENU_SUBMENU; nexti++);
+ printf("<node %s, %s, %s, %s>\n", item->shortname,
+ (lastitem != NULL ? lastitem->shortname : ""),
+ nextitem != NULL ? nextitem->shortname : "", name);
+ printf("%%%s\n", item->shortname);
+ printf("<head>%s</head>\n", item->name);
+ if (!(item->flags & MENUFLAG_NOPLAY)) {
+ printf("<p><emph>Syntax</emph>:(%s", item->shortname);
+ if (item->flags & MENUFLAG_CHECKBOX)
+ printf(" bool");
+ if (item->type == MENU_DIALOG
+ || item->type == MENU_CUSTOMDIALOG) {
+ int y;
+ CONST menudialog *di;
+ di = menu_getdialog(c, item);
+ if (item->flags & MENUFLAG_CHECKBOX)
+ printf(" [");
+ for (y = 0; di[y].question != NULL; y++) {
+ switch (di[y].type) {
+ case DIALOG_INT:
+ printf(" integer");
+ break;
+ case DIALOG_FLOAT:
+ printf(" float");
+ break;
+ case DIALOG_STRING:
+ printf(" string");
+ case DIALOG_KEYSTRING:
+ printf(" keyword");
+ break;
+ case DIALOG_IFILE:
+ printf(" file");
+ break;
+ case DIALOG_OFILE:
+ printf(" file");
+ break;
+ case DIALOG_ONOFF:
+ printf(" bool");
+ break;
+ case DIALOG_COORD:
+ printf(" complex");
+ break;
+ case DIALOG_CHOICE:
+ printf(" keyword");
+ break;
+ }
+ }
+ if (item->flags & MENUFLAG_CHECKBOX)
+ printf(" ]");
+ }
+ printf(")\n");
+ }
+ printf("<p>\n<emph>Available as</emph>: ");
+ comma = 0;
+ if (!(item->flags & MENUFLAG_NOMENU))
+ printf("menu item"), comma = 1;
+ if (!(item->flags & MENUFLAG_NOOPTION))
+ printf("%scommand line option", comma ? ", " : ""), comma =
+ 1;
+ if (!(item->flags & MENUFLAG_NOPLAY))
+ printf("%scommand", comma ? ", " : ""), comma = 1;
+ printf("\n");
+ printf("\n");
+ lastitem = item;
+ }
+ }
+}
+
+void uih_xshlprintmenus(struct uih_context *c)
+{
+ struct entry *e = firstitem;
+ struct entry *nexte;
+ struct entry *laste;
+ printf("%%menus\n");
+ printf("<main><head>Menus</head></main>\n");
+ printf("<menuitems><center>\n");
+ while (e != NULL) {
+ if (e->item->type == MENU_SUBMENU)
+ printf("<p><submenu><a %s>%s</a>\n", e->item->shortname,
+ e->item->name);
+ e = e->next;
+ }
+ printf("</center></menuitems>\n");
+ e = firstitem;
+ laste = NULL;
+ while (e != NULL) {
+ if (e->item->type == MENU_SUBMENU) {
+ nexte = e->next;
+ while (nexte != NULL && nexte->item->type != MENU_SUBMENU)
+ nexte = nexte->next;
+ printf("<node %s, %s, %s, %s>\n", e->item->shortname,
+ (laste != NULL ? laste->item->shortname : ""),
+ nexte != NULL ? nexte->item->shortname : "", "menus");
+ uih_xshlprintmenu(c, e->item->shortname);
+ laste = e;
+ }
+ e = e->next;
+ }
+ printf("%%endmenus");
+}
+
+void
+menu_forall(struct uih_context *c,
+ void (*callback) (struct uih_context * c,
+ CONST menuitem * item))
+{
+ struct entry *e = firstitem;
+ while (e != NULL) {
+ callback(c, e->item);
+ e = e->next;
+ }
+}
diff --git a/src/util/xshl.c b/src/util/xshl.c
new file mode 100644
index 0000000..27ab8d5
--- /dev/null
+++ b/src/util/xshl.c
@@ -0,0 +1,470 @@
+#ifndef _plan9_
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+#else
+#include <u.h>
+#include <libc.h>
+#include <stdio.h>
+#endif
+#include <config.h>
+#include <misc-f.h>
+#include "xshl.h"
+
+#define XSHL_ENDLINE (65536)
+#define XSHL_ENDPARAGRAPH (65536*2)
+#define XSHL_NEWSTART (65536*4)
+#define XSHL_SMALL (65536*8)
+#define XSHL_SKIPBLANK (65536*16)
+#define XSHL_COMMAND (65536*32)
+#define XSHL_BLANK (65536*64)
+#define XSHL_CLEARATLINE (65536*128)
+
+#define XSHL_AUTOCLEAN (XSHL_ENDLINE|XSHL_ENDPARAGRAPH|XSHL_NEWSTART|XSHL_SKIPBLANK|XSHL_COMMAND|XSHL_BLANK)
+
+
+#define ALL (~0)
+CONST static struct tag {
+ CONST char *name;
+ int andflagenable;
+ int orflagenable;
+ int andflagdisable;
+ int orflagdisable;
+} tags[] = {
+ {
+ "p", ALL, XSHL_SKIPBLANK | XSHL_ENDPARAGRAPH, ALL,
+ XSHL_SKIPBLANK | XSHL_ENDPARAGRAPH}
+ , {
+ "head", ALL,
+ XSHL_SKIPBLANK | XSHL_BIG | XSHL_CENTERALIGN |
+ XSHL_ENDPARAGRAPH, ~(XSHL_BIG | XSHL_CENTERALIGN),
+ XSHL_SKIPBLANK | XSHL_ENDPARAGRAPH | XSHL_ENDLINE}
+ , {
+ "emph", ALL, XSHL_EMPH, ~XSHL_EMPH, 0}
+ , {
+ "br", ALL, XSHL_SKIPBLANK | XSHL_ENDLINE, ALL, 0}
+ , {
+ "white", ~XSHL_COLORMASK, XSHL_WHITE, ~XSHL_WHITE, 0}
+ , {
+ "red", ~XSHL_COLORMASK, XSHL_RED, ~XSHL_RED, 0}
+ , {
+ "black", ~XSHL_COLORMASK, XSHL_BLACK, ~XSHL_BLACK, 0}
+ , {
+ "right", ALL, XSHL_SKIPBLANK | XSHL_RIGHTALIGN | XSHL_ENDLINE,
+ ~XSHL_RIGHTALIGN, XSHL_SKIPBLANK | XSHL_ENDLINE}
+ , {
+ "center", ALL, XSHL_SKIPBLANK | XSHL_CENTERALIGN | XSHL_ENDLINE,
+ ~XSHL_CENTERALIGN, XSHL_SKIPBLANK | XSHL_ENDLINE}
+ , {
+ "tt", ALL, XSHL_MONOSPACE, ~XSHL_MONOSPACE, 0}
+ , {
+ "dl", ALL, XSHL_SKIPBLANK | XSHL_ENDLINE,
+ ~(XSHL_SMALL | XSHL_EMPH), XSHL_SKIPBLANK | XSHL_ENDLINE}
+ , {
+ "dt", ~XSHL_SMALL, XSHL_SKIPBLANK | XSHL_ENDLINE | XSHL_EMPH, ALL,
+ 0}
+ , {
+ "dd", ~XSHL_EMPH, XSHL_SKIPBLANK | XSHL_NEWSTART | XSHL_SMALL, ALL,
+ 0}
+ , {
+ NULL}
+};
+
+#define MAXINPUT 256
+
+#define SMALLSKIP (4*spacewidth)
+
+struct boxitem {
+ char *text;
+ struct xshl_context c;
+ int xpos;
+ int width;
+ int height;
+ struct boxitem *next;
+};
+static void freebox(struct boxitem *box)
+{
+ if (box->c.linktext != NULL)
+ free(box->c.linktext);
+ free(box->text);
+ free(box);
+}
+
+static struct xshl_item *pack(struct boxitem *first, struct boxitem *last,
+ int *collectedflags, int width)
+{
+ struct xshl_item *f = NULL;
+ struct xshl_item *l = NULL;
+ struct xshl_item *item;
+ struct boxitem *curr = first, *ncurr;
+ int end = 0;
+ char text[256];
+ int collected = 0;
+ while (curr != last) {
+ if (curr->text[0] == 0) {
+ ncurr = curr->next;
+ freebox(curr);
+ curr = ncurr;
+ continue;
+ }
+ strcpy(text, curr->text);
+ item = (struct xshl_item *) malloc(sizeof(struct xshl_item));
+ if (item == NULL)
+ return NULL;
+ item->x = curr->xpos;
+ item->width = curr->width;
+ item->c = curr->c;
+ if (curr->c.linktext != NULL)
+ curr->c.linktext = mystrdup(curr->c.linktext);
+ collected |= item->c.flags;
+ ncurr = curr->next;
+ freebox(curr);
+ curr = ncurr;
+ while (curr != last &&
+ curr->xpos == item->x + item->width &&
+ (curr->c.flags & 0xffff) == (item->c.flags & 0xffff)
+ &&
+ ((curr->c.linktext == NULL && item->c.linktext == NULL) ||
+ (curr->c.linktext != NULL && item->c.linktext != NULL &&
+ !strcmp(curr->c.linktext, item->c.linktext))))
+ {
+ strcat(text, curr->text);
+ item->width += curr->width;
+ collected |= item->c.flags;
+ ncurr = curr->next;
+ freebox(curr);
+ curr = ncurr;
+ }
+ item->text = mystrdup(text);
+ item->next = NULL;
+ if (l != NULL)
+ l->next = item;
+ else
+ f = item;
+ l = item;
+ end = item->x + item->width;
+ }
+ *collectedflags = collected;
+ if (collected & (XSHL_CENTERALIGN | XSHL_RIGHTALIGN)) {
+ if (collected & XSHL_RIGHTALIGN)
+ end = width - end;
+ else
+ end = (width - end) / 2;
+ item = f;
+ while (item != NULL) {
+ item->x += end;
+ item = item->next;
+ }
+ }
+ return (f);
+}
+
+#ifndef isspace
+#define isspace(c) ((c)==' '||(c)=='\t'||(c)=='\n')
+#endif
+static char xshllink[32];
+static int flags;
+static struct boxitem *xshl_readbox(void *data, int (*get) (void *))
+{
+ char inputbuf[256];
+ int c;
+ int i;
+ char command[16];
+ char parameter[32];
+ if (flags & XSHL_BLANK) {
+ struct boxitem *box = (struct boxitem *) malloc(sizeof(*box));
+ box->width = 0;
+ box->next = NULL;
+ box->height = flags & XSHL_BIG ? 0 : 1;
+ box->text = mystrdup(" ");
+ box->c.flags = flags | XSHL_CLEARATLINE;
+ box->c.linktext = NULL;
+ if (xshllink[0] != 0)
+ box->c.linktext = mystrdup(xshllink);
+ flags &= ~XSHL_AUTOCLEAN;
+ flags |= XSHL_SKIPBLANK;
+ return (box);
+ }
+ if (flags & XSHL_COMMAND) {
+ int i = 0;
+ flags &= ~XSHL_COMMAND;
+ parameter[0] = 0;
+ do {
+ c = command[i] = get(data);
+ if (i < 15)
+ i++;
+ }
+ while (c && c != '>' && !isspace(c));
+ command[i - 1] = 0;
+ if (c != '>' && c) {
+ do {
+ c = get(data);
+ }
+ while (c && c != '>' && isspace(c));
+ if (c && c != '>') {
+ i = 1;
+ parameter[0] = c;
+ do {
+ c = parameter[i] = get(data);
+ if (i < 31)
+ i++;
+ }
+ while (c && c != '>' && !isspace(c));
+ parameter[i - 1] = 0;
+ if (isspace(c)) {
+ do {
+ c = get(data);
+ }
+ while (c && c != '>' && isspace(c));
+ }
+ }
+ }
+ {
+ int i;
+ int disabled = 0;
+ if (command[0] == '/')
+ disabled = 1;
+ for (i = 0;
+ tags[i].name != NULL
+ && strcmp(tags[i].name, command + disabled); i++);
+ if (tags[i].name != NULL) {
+ if (disabled) {
+ flags &= tags[i].andflagdisable;
+ flags |= tags[i].orflagdisable;
+ } else {
+ flags &= tags[i].andflagenable;
+ flags |= tags[i].orflagenable;
+ }
+ } else {
+ if (!strcmp(command + disabled, "a")
+ || !strcmp(command + disabled, "tutor")) {
+ if (disabled)
+ xshllink[0] = 0;
+ else
+ strcpy(xshllink, parameter);
+ } else
+ while (c != '>')
+ c = get(data);
+ }
+ }
+ if (c == '>')
+ c = get(data);
+ } else
+ c = get(data);
+ if (!c) {
+ return NULL;
+ }
+ if (flags & XSHL_SKIPBLANK) {
+ while (isspace(c)) {
+ c = get(data);
+ if (!c) {
+ return NULL;
+ }
+ }
+ flags &= ~XSHL_SKIPBLANK;
+ }
+ i = 0;
+ inputbuf[i++] = c;
+ while (c && c != '<' && !isspace(c)) {
+ c = get(data);
+ inputbuf[i++] = c;
+ if (i > 255)
+ i = 255;
+ }
+ inputbuf[i - 1] = 0;
+ if (i == 1 && !c) {
+ return NULL;
+ }
+ if (i == 1 && isspace(c)) {
+ flags |= XSHL_BLANK;
+ return xshl_readbox(data, get);
+ }
+ if (i == 1 && c == '<') {
+ flags |= XSHL_COMMAND;
+ return xshl_readbox(data, get);
+ }
+ {
+ struct boxitem *box = (struct boxitem *) malloc(sizeof(*box));
+ box->width = 0;
+ box->next = NULL;
+ box->height = flags & XSHL_BIG ? 0 : 1;
+ box->text = mystrdup(inputbuf);
+ box->c.flags = flags | XSHL_CLEARATLINE;
+ box->c.linktext = NULL;
+ if (xshllink[0] != 0)
+ box->c.linktext = mystrdup(xshllink);
+ flags &= ~XSHL_AUTOCLEAN;
+ if (isspace(c))
+ flags |= XSHL_BLANK;
+ if (c == '<')
+ flags |= XSHL_COMMAND;
+ return (box);
+ }
+ /*We are at the first word */
+}
+
+struct xshl_line *xshl_interpret(void *data, int (*get) (void *),
+ int width, int getwidth(void *, int flags,
+ CONST char *text),
+ int startflags, int smallheight,
+ int bigheight)
+{
+ int spacewidth = getwidth(data, 0, " ");
+ int cflags;
+ struct boxitem *first = NULL;
+ struct boxitem *last = NULL;
+ struct boxitem *item;
+ struct boxitem *lastword = NULL;
+ int maxlines = 200;
+ struct xshl_line *lines =
+ (struct xshl_line *) malloc(maxlines * sizeof(*lines));
+ int nlines = 0;
+ int ypos = 0;
+ flags = startflags | XSHL_SKIPBLANK;
+ xshllink[0] = 0;
+ while ((item = xshl_readbox(data, get)) != NULL) {
+ if (last == NULL) {
+ if (item->text[0] == ' ' && !item->text[1]) {
+ freebox(item);
+ continue;
+ }
+ lastword = NULL;
+ first = item, item->xpos =
+ item->c.flags & XSHL_SMALL ? SMALLSKIP : 0;
+ } else {
+ if (item->text[0] == ' ' && !item->text[1]) {
+ lastword = item;
+ }
+ last->next = item, item->xpos = last->xpos + last->width;
+ }
+ last = item;
+ item->width = getwidth(data, item->c.flags, item->text);
+ if (item->c.flags & (XSHL_ENDLINE | XSHL_ENDPARAGRAPH)
+ || ((item->c.flags & XSHL_NEWSTART)
+ && item->xpos + spacewidth > SMALLSKIP)) {
+ if (nlines > maxlines - 1)
+ maxlines *= 2, lines =
+ (struct xshl_line *) realloc(lines,
+ (maxlines) *
+ sizeof(*lines));
+ if (first != NULL) {
+ lines[nlines].first = pack(first, last, &cflags, width);
+ lines[nlines].y = ypos;
+ nlines++;
+ if (ypos & XSHL_BIG)
+ ypos += bigheight;
+ else
+ ypos += smallheight;
+ }
+ if (item->c.flags & (XSHL_ENDPARAGRAPH))
+ ypos += smallheight;
+ first = last;
+ item->xpos =
+ item->c.flags & item->c.flags & XSHL_SMALL ? SMALLSKIP : 0;
+ lastword = NULL;
+ } else if (item->c.flags & XSHL_NEWSTART)
+ item->xpos = SMALLSKIP;
+ if (item->xpos + item->width > width) {
+ if (lastword == NULL) {
+ item = first;
+ while (item != NULL) {
+ struct boxitem *c = item->next;
+ freebox(item);
+ item = c;
+ }
+ first = last = NULL;
+ } else {
+ int xpos;
+ if (nlines > maxlines - 1)
+ maxlines *= 2, lines =
+ (struct xshl_line *) realloc(lines,
+ (maxlines) *
+ sizeof(*lines));
+ lines[nlines].first =
+ pack(first, lastword, &cflags, width);
+ lines[nlines].y = ypos;
+ nlines++;
+ if (ypos & XSHL_BIG)
+ ypos += bigheight;
+ else
+ ypos += smallheight;
+ if (lastword != NULL)
+ first = lastword->next;
+ else
+ first = NULL;
+ item = first;
+ if (item != NULL) {
+ xpos =
+ item->c.flags & item->c.
+ flags & XSHL_SMALL ? SMALLSKIP : 0;
+ while (item != NULL) {
+ item->xpos = xpos;
+ xpos += item->width;
+ item = item->next;
+ }
+ }
+ freebox(lastword);
+ lastword = NULL;
+ if (first == NULL)
+ last = NULL;
+ }
+ }
+ }
+ if (last != NULL) {
+ lines[nlines].y = ypos;
+ lines[nlines].first = pack(first, last->next, &cflags, width);
+ }
+ nlines++;
+ lines[nlines].y = -1;
+ lines =
+ (struct xshl_line *) realloc(lines, (nlines + 2) * sizeof(*lines));
+ return (lines);
+}
+
+
+int xshl_textlen(void *data, int flags, CONST char *text)
+{
+ return ((int) strlen(text));
+}
+
+void xshl_print(int startskip, struct xshl_line *lines)
+{
+ int i = 0;
+ int y = 0;
+ while (lines[i].y >= 0) {
+ int xpos = -startskip;
+ struct xshl_item *item;
+ while (y < lines[i].y) {
+ putc('\n', stdout), y++;
+ }
+ item = lines[i].first;
+ while (item) {
+ while (xpos < item->x) {
+ putc(' ', stdout), xpos++;
+ }
+ xpos += item->width;
+ item = item->next;
+ }
+ i++;
+ }
+}
+
+void xshl_free(struct xshl_line *lines)
+{
+ int i = 0;
+ while (lines[i].y >= 0) {
+ struct xshl_item *item, *nextitem;
+ item = lines[i].first;
+ while (item) {
+ nextitem = item->next;
+ if (item->c.linktext != NULL)
+ free(item->c.linktext);
+ free(item->text);
+ free(item);
+ item = nextitem;
+ }
+ i++;
+ }
+ free(lines);
+}
diff --git a/src/util/xstdio.c b/src/util/xstdio.c
new file mode 100644
index 0000000..fc7eb42
--- /dev/null
+++ b/src/util/xstdio.c
@@ -0,0 +1,488 @@
+#ifndef _plan9_
+#include <string.h>
+#if defined(__EMX__) || defined(__APPLE__)
+#include <sys/types.h>
+#endif
+#include <dirent.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <unistd.h>
+#else
+#include <u.h>
+#include <libc.h>
+#endif
+#include <config.h>
+#include <filter.h>
+#include <fractal.h>
+#include <ui_helper.h>
+#include <misc-f.h>
+#ifdef _WIN32
+#define strcmp stricmp
+#endif
+#ifdef DJGPP
+#define strcmp stricmp
+#endif
+
+/* We reserve character 01 to application directory so we can easily refer to data files */
+char *xio_appdir;
+char *xio_homedir;
+
+char *xio_fixpath(CONST char *c)
+{
+ if (c[0] == '~') {
+ char *c1 = (char *) malloc(strlen(c) + strlen(xio_homedir) + 5);
+ sprintf(c1, "%s%s", xio_homedir, c + 1);
+ return c1;
+ }
+ if (c[0] == '\01') {
+ char *c1 = (char *) malloc(strlen(c) + strlen(xio_appdir) + 5);
+ sprintf(c1, "%s%s", xio_appdir, c + 1);
+ return c1;
+ }
+ return mystrdup(c);
+}
+
+int
+xio_getfiles(xio_constpath path1, char ***names, char ***dirs,
+ int *nnames2, int *ndirs2)
+{
+#ifdef _plan9_
+ *nnames2 = *ndirs2 = 0;
+#else
+ char *path = xio_fixpath(path1);
+ int maxnames = 200, maxdirs = 200;
+ int nnames = 0, ndirs = 0;
+ DIR *dir = opendir(path);
+ struct stat buf;
+ char buff[4096];
+ int pathlen;
+ struct dirent *e;
+ if (dir == NULL)
+ return 0;
+ *nnames2 = 0;
+ *ndirs2 = 0;
+ e = readdir(dir);
+ strcpy(buff, path);
+ pathlen = (int) strlen(path);
+ if (buff[pathlen - 1] != XIO_PATHSEP)
+ buff[pathlen] = XIO_PATHSEP;
+ else
+ pathlen--;
+ *names = (char **) malloc(maxnames * sizeof(**names));
+ *dirs = (char **) malloc(maxdirs * sizeof(**dirs));
+ free(path);
+ while (e != NULL) {
+ char *n = mystrdup(e->d_name);
+ strcpy(buff + pathlen + 1, e->d_name);
+ stat(buff, &buf);
+ if (S_ISDIR(buf.st_mode)) {
+ if (ndirs == maxdirs)
+ maxdirs *= 2, *dirs =
+ (char **) realloc(*dirs, maxdirs * sizeof(**dirs));
+ (*dirs)[ndirs] = n;
+ ndirs++;
+ } else {
+ if (nnames == maxnames)
+ maxnames *= 2, *names =
+ (char **) realloc(*names, maxnames * sizeof(**names));
+ (*names)[nnames] = n;
+ nnames++;
+ }
+ e = readdir(dir);
+ }
+ if (nnames)
+ *names = (char **) realloc(*names, nnames * sizeof(**names));
+ else
+ free(*names), *names = NULL;
+ if (ndirs)
+ *dirs = (char **) realloc(*dirs, ndirs * sizeof(**dirs));
+ else
+ free(*dirs), *dirs = NULL;
+ *nnames2 = nnames;
+ *ndirs2 = ndirs;
+ closedir(dir);
+ return 1;
+#endif
+}
+
+xio_path xio_getdirectory(xio_constpath filename)
+{
+ int i;
+ xio_pathdata directory;
+ for (i = (int) strlen(filename); i && filename[i] != '/' &&
+ filename[i] != '\\' && filename[i] != XIO_PATHSEP; i--);
+ if (filename[i] == '/' || filename[i] == '\\'
+ || filename[i] == XIO_PATHSEP)
+ i++;
+ directory[i] = 0;
+ i--;
+ for (; i >= 0; i--)
+ directory[i] = filename[i];
+ return (mystrdup(directory));
+}
+
+xio_path xio_getfilename(CONST char *basename, CONST char *extension)
+{
+ static char name[40];
+ int nimage = 0;
+#ifdef _plan9_
+#ifdef _plan9v4_
+#define DIRLEN 116
+ uchar edir[DIRLEN];
+#else
+ char edir[DIRLEN];
+#endif
+#else
+ struct stat sb;
+#endif
+ char *base = xio_fixpath(basename);
+ do {
+ sprintf(name, "%s%i%s", base, nimage++, extension);
+ }
+#ifndef _plan9_
+ while (stat(name, &sb) != -1);
+#else
+#ifdef _plan9v4_
+ while (stat(name, edir, DIRLEN) != -1);
+#else
+ while (stat(name, edir) != -1);
+#endif
+#endif
+ free(base);
+ return (name);
+}
+
+xio_file xio_getrandomexample(xio_path name)
+{
+#ifndef _plan9_
+ static CONST char *CONST paths[] = { /*Where examples should be located? */
+ EXAMPLESPATH, /*Data path when XaoS is propertly installed */
+ "\01" XIO_PATHSEPSTR "examples",
+ /*XaoS was started from root of source tree */
+ "\01" XIO_PATHSEPSTR ".." XIO_PATHSEPSTR "examples",
+ "." XIO_PATHSEPSTR "examples",
+ /*XaoS was started from root of source tree */
+ ".." XIO_PATHSEPSTR "examples",
+ /*XaoS was started from bin directory in source tree */
+ XIO_EMPTYPATH, /*Oops...it's not. Try curent directory */
+ };
+ int i = -1, p;
+ DIR *d = NULL;
+ xio_file f;
+ struct dirent *dir;
+ int n;
+ int max = 0;
+ char *realpath = NULL;
+
+ for (p = 0; p < (int) (sizeof(paths) / sizeof(char *)) && d == NULL;
+ p++) {
+ char *pp = xio_fixpath(paths[p]);
+ d = opendir(pp);
+ free(pp);
+ if (d != NULL) {
+ realpath = xio_fixpath(paths[p]);
+ max = 800 - (int) strlen(realpath);
+ for (i = 0; (dir = readdir(d)) != NULL; i++) {
+ int s = (int) strlen(dir->d_name);
+ if (s > max || s < 4
+ || strcmp(".xpf", dir->d_name + s - 4))
+ i--;
+ /*free(dir); */
+ }
+ if (!i) {
+ /*uih->errstring = "No *.xpf files found"; */
+ closedir(d);
+ free(realpath);
+ d = NULL;
+ continue;
+ }
+ break;
+ }
+ }
+ if (d == NULL) {
+ /*uih->errstring = "Can not open examples directory"; */
+ return NULL;
+ }
+
+
+
+ rewinddir(d);
+ dir = NULL;
+ n = (int) ((number_t) i * rand() / (RAND_MAX + 1.0));
+
+ for (i = 0; i <= n; i++) {
+ int s;
+ do {
+ /*if(dir!=NULL) free(dir); */
+ dir = readdir(d);
+ if (dir == NULL) {
+ /*uih->errstring = "Reading of examples directory failed"; */
+ closedir(d);
+ free(realpath);
+ return NULL;
+ }
+ s = (int) strlen(dir->d_name);
+ }
+ while (s > max || s < 4 || strcmp(".xpf", dir->d_name + s - 4));
+ }
+ if (dir == NULL) {
+ /*uih->errstring = "Reading of examples directory failed"; */
+ closedir(d);
+ free(realpath);
+ return NULL;
+ }
+ strcpy(name, realpath);
+ if (name[strlen(name) - 1] != XIO_PATHSEP)
+ strcat(name, XIO_PATHSEPSTR);
+ strcat(name, dir->d_name);
+ closedir(d);
+ /*free(dir); */
+
+ f = xio_ropen(name);
+ free(realpath);
+ return (f);
+#endif
+}
+
+xio_file xio_getcatalog(CONST char *name)
+{
+ static CONST xio_constpath paths[] = { /*Where catalogs should be located? */
+ CATALOGSPATH, /*Data path when XaoS is propertly installed */
+#ifndef _plan9_
+ "\01" XIO_PATHSEPSTR "catalogs" XIO_PATHSEPSTR,
+ "\01" XIO_PATHSEPSTR ".." XIO_PATHSEPSTR "catalogs" XIO_PATHSEPSTR,
+ "." XIO_PATHSEPSTR "catalogs" XIO_PATHSEPSTR,
+ /*XaoS was started from root of source tree */
+ ".." XIO_PATHSEPSTR "catalogs" XIO_PATHSEPSTR,
+ /*XaoS was started from bin directory in source tree */
+#else
+ "./catalogs/",
+ /*XaoS was started from root of source tree */
+ "../catalogs/",
+ /*XaoS was started from bin directory in source tree */
+#endif
+ XIO_EMPTYPATH, /*Oops...it's not. Try curent directory */
+ };
+ int i;
+ xio_file f = XIO_FAILED;
+ xio_pathdata tmp;
+ for (i = 0;
+ i < (int) (sizeof(paths) / sizeof(char *)) && f == XIO_FAILED;
+ i++) {
+ char *p = xio_fixpath(paths[i]);
+ xio_addfname(tmp, p, name);
+ free(p);
+ f = xio_ropen(tmp);
+ if (f == XIO_FAILED) {
+ xio_addextension(tmp, ".cat");
+ f = xio_ropen(tmp);
+ }
+ }
+ return (f);
+}
+
+xio_file xio_gethelp(void)
+{
+ static CONST xio_constpath paths[] = { /*Where help should be located? */
+ HELPPATH, /*Data path when XaoS is propertly installed */
+#ifndef _plan9_
+ "\01" XIO_PATHSEPSTR "help" XIO_PATHSEPSTR "xaos.hlp",
+ "\01" XIO_PATHSEPSTR ".." XIO_PATHSEPSTR "help" XIO_PATHSEPSTR
+ "xaos.hlp",
+ "." XIO_PATHSEPSTR "help" XIO_PATHSEPSTR "xaos.hlp",
+ /*XaoS was started from root of source tree */
+ ".." XIO_PATHSEPSTR "help" XIO_PATHSEPSTR "xaos.hlp",
+ /*XaoS was started from bin directory in source tree */
+ "." XIO_PATHSEPSTR "xaos.hlp",
+#else
+ "./help/xaos.hlp",
+ /*XaoS was started from root of source tree */
+ "../help/xaos.hlp",
+ /*XaoS was started from bin directory in source tree */
+ "./xaos.hlp",
+#endif
+ /*Oops...it's not. Try curent directory */
+ };
+ int i;
+ xio_file f = XIO_FAILED;
+ for (i = 0;
+ i < (int) (sizeof(paths) / sizeof(char *)) && f == XIO_FAILED;
+ i++) {
+ char *p = xio_fixpath(paths[i]);
+ f = xio_ropen(p);
+ free(p);
+ }
+ return (f);
+}
+
+xio_file xio_gettutorial(CONST char *name, xio_path tmp)
+{
+ int i;
+ xio_file f = XIO_FAILED;
+ static CONST xio_constpath paths[] = { /*Where tutorials should be located? */
+ TUTORIALPATH, /*Data path when XaoS is propertly installed */
+#ifndef _plan9_
+ "\01" XIO_PATHSEPSTR "tutorial" XIO_PATHSEPSTR,
+ "\01" XIO_PATHSEPSTR ".." XIO_PATHSEPSTR "tutorial" XIO_PATHSEPSTR,
+ "." XIO_PATHSEPSTR "tutorial" XIO_PATHSEPSTR, /*XaoS was started from root of source tree */
+ ".." XIO_PATHSEPSTR "tutorial" XIO_PATHSEPSTR, /*XaoS was started from bin directory in source tree */
+#else
+ "./tutorial/", /*XaoS was started from root of source tree */
+ "../tutorial/", /*XaoS was started from bin directory in source tree */
+#endif
+ XIO_EMPTYPATH, /*Oops...it's not. Try curent directory */
+ };
+
+ for (i = 0;
+ i < (int) (sizeof(paths) / sizeof(char *)) && f == XIO_FAILED;
+ i++) {
+ char *p = xio_fixpath(paths[i]);
+ xio_addfname(tmp, p, name);
+ f = xio_ropen(tmp);
+ free(p);
+ }
+ return (f);
+}
+
+int xio_exist(xio_constpath name)
+{
+#ifdef _plan9_
+ return (0);
+#else
+ struct stat buf;
+ return (!stat(name, &buf));
+#endif
+}
+
+static int sputc(int c, xio_file f)
+{
+ return putc(c, (FILE *) f->data);
+}
+
+static int sputs(CONST char *c, xio_file f)
+{
+ return fputs(c, (FILE *) f->data);
+}
+
+static int sungetc(int c, xio_file f)
+{
+ return ungetc(c, (FILE *) f->data);
+}
+
+static int sgetc(xio_file f)
+{
+ return getc((FILE *) f->data);
+}
+
+static int sfeof(xio_file f)
+{
+ return feof((FILE *) f->data);
+}
+
+static int sflush(xio_file f)
+{
+ return fflush((FILE *) f->data);
+}
+
+static int ssclose(xio_file f)
+{
+ int r = fclose((FILE *) f->data);
+ free(f);
+ return r;
+}
+
+xio_file xio_ropen(CONST char *name)
+{
+ xio_file f = (xio_file) calloc(1, sizeof(*f));
+ name = xio_fixpath(name);
+ f->data = (void *) fopen(name, "rt");
+ /*free (name); */
+ if (!f->data) {
+ free(f);
+ return 0;
+ }
+ f->fclose = ssclose;
+ f->xeof = sfeof;
+ f->fgetc = sgetc;
+ f->fungetc = sungetc;
+ return f;
+}
+
+xio_file xio_wopen(CONST char *name)
+{
+ xio_file f = (xio_file) calloc(1, sizeof(*f));
+ name = xio_fixpath(name);
+ f->data = (void *) fopen(name, "wt");
+ /*free (name); */
+ if (!f->data) {
+ free(f);
+ return 0;
+ }
+ f->fputc = sputc;
+ f->fputs = sputs;
+ f->fclose = ssclose;
+ f->flush = sflush;
+ return f;
+}
+
+#ifdef DJGPP
+#define DRIVES
+#endif
+#ifdef _WIN32
+#define DRIVES
+#endif
+void xio_init(CONST char *name)
+{
+ if (getenv("HOME"))
+ xio_homedir = mystrdup(getenv("HOME"));
+ else
+ xio_homedir = mystrdup("./");
+ if (
+#ifdef DRIVES
+ (((name[0] >= 'a' && name[0] <= 'z')
+ || (name[0] >= 'A' && name[0] <= 'Z')) && name[1] == ':'
+ && (name[2] == '\\' || name[2] == '/')) ||
+#endif
+ name[0] == '/' || name[0] == '\\' || name[0] == XIO_PATHSEP
+ || name[0] == '~') {
+ char *c = mystrdup(name);
+ int i;
+ int pos = 0;
+ for (i = 0; i < (int) strlen(c); i++)
+ if (name[i] == '/' || name[i] == '\\'
+ || name[i] == XIO_PATHSEP)
+ pos = i;
+ c[pos] = 0;
+ xio_appdir = xio_fixpath(c);
+ free(c);
+ } else {
+ char buf[4096];
+ buf[0] = '.';
+ buf[1] = 0;
+#ifndef _plan9_
+ getcwd(buf, sizeof(buf));
+#endif
+ xio_appdir = mystrdup(buf);
+ {
+ char *c = mystrdup(name), *c1;
+ int i;
+ int pos = 0;
+ for (i = 0; i < (int) strlen(c); i++)
+ if (name[i] == '/' || name[i] == '\\'
+ || name[i] == XIO_PATHSEP)
+ pos = i;
+ c[pos] = 0;
+ c1 = (char *) malloc(strlen(c) + strlen(xio_appdir) + 2);
+ sprintf(c1, "%s%s%s", xio_appdir, XIO_PATHSEPSTR, c);
+ free(c);
+ free(xio_appdir);
+ xio_appdir = c1;
+ }
+ }
+}
+
+void xio_uninit()
+{
+ free(xio_appdir);
+ free(xio_homedir);
+}
diff --git a/src/util/xstring.c b/src/util/xstring.c
new file mode 100644
index 0000000..02959f6
--- /dev/null
+++ b/src/util/xstring.c
@@ -0,0 +1,141 @@
+#ifndef _plan9_
+#include <string.h>
+#include <stdlib.h>
+#else
+#include <u.h>
+#include <libc.h>
+#endif
+
+#include <xio.h>
+#include <misc-f.h>
+struct fr {
+ char *string;
+ int pos;
+ int allocedsize;
+ int stringsize;
+};
+
+char *mystrdup(const char *c)
+{
+ int l = strlen(c);
+ char *d = malloc(l + 1);
+ if (!d)
+ return NULL;
+ memcpy(d, c, l + 1);
+ return d;
+}
+
+static int sputc(int c, xio_file s)
+{
+ struct fr *f = (struct fr *) s->data;
+ if (f->pos >= f->allocedsize - 1) {
+ char *c = (char *) realloc(f->string, f->allocedsize * 2);
+ if (!c)
+ return XIO_EOF;
+ f->string = c;
+ f->allocedsize *= 2;
+ }
+ f->string[f->pos++] = c;
+ if (f->pos >= f->stringsize)
+ f->string[f->pos] = 0, f->stringsize = f->pos;
+ return 0;
+}
+
+static int sputs(CONST char *c, xio_file s)
+{
+ int l = strlen(c);
+ struct fr *f = (struct fr *) s->data;
+ while (f->pos + l >= f->allocedsize - 1) {
+ char *c = (char *) realloc(f->string, f->allocedsize * 2);
+ if (!c)
+ return XIO_EOF;
+ f->string = c;
+ f->allocedsize *= 2;
+ }
+ memcpy(f->string + f->pos, c, l);
+ f->pos += l;
+ if (f->pos >= f->stringsize)
+ f->string[f->pos] = 0, f->stringsize = f->pos;
+ return 0;
+}
+
+static int sungetc(int c, xio_file s)
+{
+ struct fr *f = (struct fr *) s->data;
+ f->pos--;
+ /*f->string[f->pos]=c; */
+ return 0;
+}
+
+static int sgetc(xio_file s)
+{
+ struct fr *f = (struct fr *) s->data;
+ if (f->pos == f->stringsize)
+ return XIO_EOF;
+ return f->string[f->pos++];
+}
+
+static int sfeof(xio_file s)
+{
+ struct fr *f = (struct fr *) s->data;
+ return (f->pos == f->stringsize);
+}
+
+static int srclose(xio_file s)
+{
+ struct fr *f = (struct fr *) s->data;
+ free(f->string);
+ free(f);
+ free(s);
+ return 0;
+}
+
+static int swclose(xio_file s)
+{
+ struct fr *f = (struct fr *) s->data;
+ f->string = (char *) realloc(f->string, f->stringsize + 1);
+ /*free(s);
+ free(f); */
+ return 0;
+}
+
+char *xio_getstring(xio_file s)
+{
+ struct fr *f = (struct fr *) s->data;
+ char *c = f->string;
+ free(f);
+ free(s);
+ return c;
+}
+
+xio_file xio_strropen(CONST char *string)
+{
+ xio_file s = (xio_file) calloc(1, sizeof(*s));
+ struct fr *f = (struct fr *) calloc(1, sizeof(*f));
+ s->data = f;
+ f->pos = 0;
+ f->string = (char *) string;
+ f->stringsize = strlen(string);
+ s->fclose = srclose;
+ s->xeof = sfeof;
+ s->fgetc = sgetc;
+ s->fungetc = sungetc;
+ return s;
+}
+
+#define PAGE 4096
+xio_file xio_strwopen(void)
+{
+ xio_file s = (xio_file) calloc(1, sizeof(*s));
+ struct fr *f = (struct fr *) calloc(1, sizeof(*f));
+ s->data = f;
+ f->pos = 0;
+ f->string = (char *) malloc(PAGE);
+ f->allocedsize = PAGE;
+ f->stringsize = 0;
+ s->fputc = sputc;
+ s->fputs = sputs;
+ s->fclose = swclose;
+ s->flush = NULL;
+ return s;
+}