# HG changeset patch
# User insilmaril
# Date 1267820206 0
# Node ID 5c5b4464b24fe43c2198375afb7908126325756b
# Parent  32f499cbe874c27cb5447abcb3fbff6b92ad02a0
Some changes by Tagg for Win version

diff -r 32f499cbe874 -r 5c5b4464b24f mkdtemp.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mkdtemp.cpp	Fri Mar 05 20:16:46 2010 +0000
@@ -0,0 +1,63 @@
+#include "mkdtemp.h"
+#include <stdint.h>
+#include <string.h>
+#include <errno.h>
+#include <io.h>
+
+char *
+mkdtemp(char *tmpl)
+{
+    // Implementation based on GLIBC implementation.
+
+    static const char letters[] =
+        "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+
+    static uint64_t value;
+
+    const unsigned int ATTEMPTS_MIN = (62 * 62 * 62);
+
+    int save_errno = errno;
+
+    size_t len = strlen(tmpl);
+    if (len < 6 || strcmp(&tmpl[len - 6], "XXXXXX"))
+    {
+        errno = EINVAL;
+        return NULL;
+    }
+
+    char *XXXXXX = &tmpl[len - 6];
+
+    uint64_t random_time_bits = time(NULL);
+
+    value += (random_time_bits ^ getpid());
+
+    unsigned int count;
+    for (count = 0; count < ATTEMPTS_MIN; value += 7777, ++count)
+    {
+        uint64_t v = value;
+
+        XXXXXX[0] = letters[v % 62];
+        v /= 62;
+        XXXXXX[1] = letters[v % 62];
+        v /= 62;
+        XXXXXX[2] = letters[v % 62];
+        v /= 62;
+        XXXXXX[3] = letters[v % 62];
+        v /= 62;
+        XXXXXX[4] = letters[v % 62];
+        v /= 62;
+        XXXXXX[5] = letters[v % 62];
+
+		if (mkdir(tmpl) == 0)
+        {
+            errno = save_errno;
+			return tmpl;
+        }
+
+		if (errno != EEXIST)
+			return NULL;
+    }
+
+    errno = EEXIST;
+    return NULL;
+}
diff -r 32f499cbe874 -r 5c5b4464b24f mkdtemp.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mkdtemp.h	Fri Mar 05 20:16:46 2010 +0000
@@ -0,0 +1,18 @@
+#ifndef MKDTEMP_H
+#define MKDTEMP_H
+
+extern char *mkdtemp(char *_template);
+
+#ifndef WIN32
+#include <sys/time.h>
+#else
+#include <time.h>
+#include <direct.h>
+typedef int pid_t;
+#endif
+
+extern "C" {
+pid_t getpid (void);
+}
+
+#endif
\ No newline at end of file
diff -r 32f499cbe874 -r 5c5b4464b24f tex/vym.changelog
--- a/tex/vym.changelog	Fri Mar 05 19:15:08 2010 +0000
+++ b/tex/vym.changelog	Fri Mar 05 20:16:46 2010 +0000
@@ -1,3 +1,9 @@
+-------------------------------------------------------------------
+Fri Mar 05 19:34:51 CET 2010 - taggm@diminutia.us
+
+- Version: 1.12.7
+- Feature: Changes for windows version
+
 -------------------------------------------------------------------
 Mon Nov 30 19:34:51 CET 2009 - uwedr@suse.de
 
diff -r 32f499cbe874 -r 5c5b4464b24f version.h
--- a/version.h	Fri Mar 05 19:15:08 2010 +0000
+++ b/version.h	Fri Mar 05 20:16:46 2010 +0000
@@ -4,10 +4,10 @@
 #include <QString>
 
 #define __VYM_NAME "VYM"
-#define __VYM_VERSION "1.12.6"
-#define __VYM_CODENAME "Maintenance Update "
+#define __VYM_VERSION "1.12.7"
+#define __VYM_CODENAME "Windows version"
 //#define __VYM_CODENAME "Codename: development version"
-#define __VYM_BUILD_DATE "2009-11-30"
+#define __VYM_BUILD_DATE "2010-03-05"
 
 
 bool checkVersion(const QString &);
diff -r 32f499cbe874 -r 5c5b4464b24f vym.pro
--- a/vym.pro	Fri Mar 05 19:15:08 2010 +0000
+++ b/vym.pro	Fri Mar 05 20:16:46 2010 +0000
@@ -1,9 +1,10 @@
-TEMPLATE	= app
-LANGUAGE	= C++
-
-CONFIG	+= qt warn_on debug_and_release
-CONFIG += x86 ppc
-
+TEMPLATE = app
+LANGUAGE = C++
+CONFIG += qt \
+    warn_on \
+    debug_and_release
+CONFIG += x86 \
+    ppc
 TRANSLATIONS += lang/vym_de.ts
 TRANSLATIONS += lang/vym_en.ts
 TRANSLATIONS += lang/vym_es.ts
@@ -16,176 +17,160 @@
 TRANSLATIONS += lang/vym_zh_TW.ts
 
 # Manifest embedding was suggested by Qt docs somewhere...
-win32: CONFIG += embed_manifest_exe
+win32:CONFIG += embed_manifest_exe
 
 # Without this, M_PI, and M_PI_2 won`t be defined.
 win32:DEFINES *= _USE_MATH_DEFINES
-
-ICON =icons/vym.icns
-
+ICON = icons/vym.icns
 QT += qt3support
 QT += network
-
-HEADERS	+= \
-	aboutdialog.h \
-	animpoint.h \
-	attribute.h \
-	attributedelegate.h\
-	attributedialog.h \
-	attributewidget.h \
-	branchobj.h \
-	branchpropwindow.h\
-	editxlinkdialog.h \
-	exportoofiledialog.h \
-	exportxhtmldialog.h\
-	exports.h \
-	extrainfodialog.h \
-	file.h \
-	findwindow.h \
-	flagobj.h \
-	flagrowobj.h \
-	floatimageobj.h \
-	floatobj.h \
-	frameobj.h \
-	geometry.h \
-	headingobj.h \
-	highlighter.h \
-	historywindow.h \
-	imageobj.h \
-	imports.h \
-	linkablemapobj.h \
-	mainwindow.h \
-	mapcenterobj.h \
-	mapeditor.h \
-	mapobj.h \
-	misc.h \
-	noteobj.h \
-	options.h \
-	ornamentedobj.h \
-	parser.h \
-	process.h \
-	selection.h \
-	showtextdialog.h\
-	simplescripteditor.h\
-	texteditor.h \
-	version.h \
-	vymmodel.h \
-	xlinkobj.h \
-	xml-base.h \
-	xml-vym.h \
-	xml-freemind.h \
-	xmlobj.h\
-	xsltproc.h \
-	settings.h \
-	warningdialog.h
-
-SOURCES	+= \
-	aboutdialog.cpp \
-	animpoint.cpp \
-	attribute.cpp \
-	attributedelegate.cpp \
-	attributedialog.cpp \
-	attributewidget.cpp \
-	branchobj.cpp \
-	branchpropwindow.cpp \
-	editxlinkdialog.cpp \
-	exportoofiledialog.cpp \
-	exports.cpp \
-	exportxhtmldialog.cpp \
-	extrainfodialog.cpp \
-	file.cpp \
-	findwindow.cpp \
-	flagobj.cpp \
-	flagrowobj.cpp \
-	floatimageobj.cpp \
-	floatobj.cpp \
-	frameobj.cpp \
-	geometry.cpp \
-	headingobj.cpp \
-	highlighter.cpp \
-	historywindow.cpp \
-	imageobj.cpp \
-	imports.cpp \
-	linkablemapobj.cpp \
-	main.cpp \
-	mainwindow.cpp \
-	mapcenterobj.cpp \
-	mapeditor.cpp \
-	mapobj.cpp \
-	misc.cpp \
-	noteobj.cpp \
-	options.cpp \
-	ornamentedobj.cpp \
-	parser.cpp \
-	process.cpp \
-	selection.cpp \
-	showtextdialog.cpp \
-	simplescripteditor.cpp \
-	texteditor.cpp \
-	version.cpp \
-	vymmodel.cpp \
-	xlinkobj.cpp \
-	xml-base.cpp \
-	xml-vym.cpp \
-	xml-freemind.cpp \
-	xmlobj.cpp \
-	xsltproc.cpp \
-	settings.cpp \
-	warningdialog.cpp
-
-FORMS = \
-	attributewidget.ui \
-	branchpropwindow.ui \
-	exportxhtmldialog.ui \
-	extrainfodialog.ui \
-	editxlinkdialog.ui \
-	historywindow.ui \
-	simplescripteditor.ui \
-	showtextdialog.ui \
-	warningdialog.ui
-
-win32 {
-	HEADERS += mkdtemp.h
-	SOURCES += mkdtemp.cpp
-	RC_FILE = vym.rc
+HEADERS += aboutdialog.h \
+    animpoint.h \
+    attribute.h \
+    attributedelegate.h \
+    attributedialog.h \
+    attributewidget.h \
+    branchobj.h \
+    branchpropwindow.h \
+    editxlinkdialog.h \
+    exportoofiledialog.h \
+    exportxhtmldialog.h \
+    exports.h \
+    extrainfodialog.h \
+    file.h \
+    findwindow.h \
+    flagobj.h \
+    flagrowobj.h \
+    floatimageobj.h \
+    floatobj.h \
+    frameobj.h \
+    geometry.h \
+    headingobj.h \
+    highlighter.h \
+    historywindow.h \
+    imageobj.h \
+    imports.h \
+    linkablemapobj.h \
+    mainwindow.h \
+    mapcenterobj.h \
+    mapeditor.h \
+    mapobj.h \
+    misc.h \
+    noteobj.h \
+    options.h \
+    ornamentedobj.h \
+    parser.h \
+    process.h \
+    selection.h \
+    showtextdialog.h \
+    simplescripteditor.h \
+    texteditor.h \
+    version.h \
+    vymmodel.h \
+    xlinkobj.h \
+    xml-base.h \
+    xml-vym.h \
+    xml-freemind.h \
+    xmlobj.h \
+    xsltproc.h \
+    settings.h \
+    warningdialog.h \
+    win32/stdint.h
+SOURCES += aboutdialog.cpp \
+    animpoint.cpp \
+    attribute.cpp \
+    attributedelegate.cpp \
+    attributedialog.cpp \
+    attributewidget.cpp \
+    branchobj.cpp \
+    branchpropwindow.cpp \
+    editxlinkdialog.cpp \
+    exportoofiledialog.cpp \
+    exports.cpp \
+    exportxhtmldialog.cpp \
+    extrainfodialog.cpp \
+    file.cpp \
+    findwindow.cpp \
+    flagobj.cpp \
+    flagrowobj.cpp \
+    floatimageobj.cpp \
+    floatobj.cpp \
+    frameobj.cpp \
+    geometry.cpp \
+    headingobj.cpp \
+    highlighter.cpp \
+    historywindow.cpp \
+    imageobj.cpp \
+    imports.cpp \
+    linkablemapobj.cpp \
+    main.cpp \
+    mainwindow.cpp \
+    mapcenterobj.cpp \
+    mapeditor.cpp \
+    mapobj.cpp \
+    misc.cpp \
+    noteobj.cpp \
+    options.cpp \
+    ornamentedobj.cpp \
+    parser.cpp \
+    process.cpp \
+    selection.cpp \
+    showtextdialog.cpp \
+    simplescripteditor.cpp \
+    texteditor.cpp \
+    version.cpp \
+    vymmodel.cpp \
+    xlinkobj.cpp \
+    xml-base.cpp \
+    xml-vym.cpp \
+    xml-freemind.cpp \
+    xmlobj.cpp \
+    xsltproc.cpp \
+    settings.cpp \
+    warningdialog.cpp
+FORMS = attributewidget.ui \
+    branchpropwindow.ui \
+    exportxhtmldialog.ui \
+    extrainfodialog.ui \
+    editxlinkdialog.ui \
+    historywindow.ui \
+    simplescripteditor.ui \
+    showtextdialog.ui \
+    warningdialog.ui
+win32 { 
+    HEADERS += mkdtemp.h
+    SOURCES += mkdtemp.cpp
+    RC_FILE = vym.rc
 }
 
-#The following lines were inserted by qt3to4
+# The following lines were inserted by qt3to4
 QT += xml
-
-TARGET  = vym
-
-
-isEmpty( PREFIX ) {
-	PREFIX = /usr/local
-	count( INSTALLDIR, 1 ) {
-		PREFIX = $${INSTALLDIR}
-		message( "Please use PREFIX instead of INSTALLDIR" )
-	}
+TARGET = vym
+isEmpty( PREFIX ) { 
+    PREFIX = /usr/local
+    count( INSTALLDIR, 1 ) { 
+        PREFIX = $${INSTALLDIR}
+        message( "Please use PREFIX instead of INSTALLDIR" )
+    }
 }
-isEmpty( BINDIR ) {
-	BINDIR = $${PREFIX}/bin
-}
-isEmpty( DATADIR ) {
-	DATADIR = $${PREFIX}/share
-}
-isEmpty( DOCDIR ) {
-	DOCDIR = $${DATADIR}/doc/packages/vym
-}
-
+isEmpty( BINDIR ):BINDIR = $${PREFIX}/bin
+isEmpty( DATADIR ):DATADIR = $${PREFIX}/share
+isEmpty( DOCDIR ):DOCDIR = $${DATADIR}/doc/packages/vym
 message( "Installation directory" )
 message( $$PREFIX )
-
-
 target.path = $${BINDIR}
 INSTALLS += target
-
-support.files = styles/ scripts/ icons/ flags/ lang/ macros/ exports/ demos/
+support.files = styles/ \
+    scripts/ \
+    icons/ \
+    flags/ \
+    lang/ \
+    macros/ \
+    exports/ \
+    demos/
 support.path = $${DATADIR}/vym
-INSTALLS += support 
-
+INSTALLS += support
 doc.files = doc/vym.pdf
 doc.path = $${DOCDIR}
 INSTALLS += doc
 DEFINES += VYM_DOCDIR=\\\"$${DOCDIR}\\\"
-