File inkscape-0.91-win32.patch of Package mingw32-inkscape
--- inkscape-0.91/buildtool.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/buildtool.cpp 2016-05-30 09:47:05.193959056 +0200
@@ -5316,7 +5316,7 @@
return true;
}
-#ifdef WIN32
+#ifdef _WIN32
// On Windows 'remove' will only delete files
if (remove(native.c_str())<0)
--- inkscape-0.91/src/color-profile.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/color-profile.cpp 2016-05-30 09:47:05.193959056 +0200
@@ -24,7 +24,7 @@
#include <string>
#include <io/sys.h>
-#ifdef WIN32
+#ifdef _WIN32
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. Required for correctly including icm.h
#define _WIN32_WINDOWS 0x0410
#endif
@@ -49,9 +49,9 @@
#include "uri.h"
-#ifdef WIN32
+#ifdef _WIN32
#include <icm.h>
-#endif // WIN32
+#endif // _WIN32
#include <glibmm/convert.h>
@@ -761,7 +761,7 @@
}
}
-#ifdef WIN32
+#ifdef _WIN32
wchar_t pathBuf[MAX_PATH + 1];
pathBuf[0] = 0;
DWORD pathSize = sizeof(pathBuf);
@@ -775,7 +775,7 @@
}
g_free( utf8Path );
}
-#endif // WIN32
+#endif // _WIN32
return sources;
}
--- inkscape-0.91/src/dialogs/dialog-events.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/dialogs/dialog-events.cpp 2016-05-30 09:47:05.197958973 +0200
@@ -155,7 +155,7 @@
void sp_transientize(GtkWidget *dialog)
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
-#ifndef WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs
+#ifndef _WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs
// _set_skip_taskbar_hint makes transient dialogs NON-transient! When dialogs
// are made transient (_set_transient_for), they are already removed from
// the taskbar in Win32.
@@ -166,7 +166,7 @@
gint transient_policy = prefs->getIntLimited("/options/transientpolicy/value", 1, 0, 2);
-#ifdef WIN32 // Win32 special code to enable transient dialogs
+#ifdef _WIN32 // Win32 special code to enable transient dialogs
transient_policy = 2;
#endif
@@ -193,7 +193,7 @@
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
gint transient_policy = prefs->getIntLimited( "/options/transientpolicy/value", 1, 0, 2);
-#ifdef WIN32 // Win32 special code to enable transient dialogs
+#ifdef _WIN32 // Win32 special code to enable transient dialogs
transient_policy = 1;
#endif
--- inkscape-0.91/src/document.cpp 2015-01-28 04:32:28.162676000 +0100
+++ inkscape-0.91/src/document.cpp 2016-05-30 09:47:49.841034692 +0200
@@ -350,7 +350,7 @@
g_free(document->name);
document->name = 0;
}
-#ifndef WIN32
+#ifndef _WIN32
document->uri = prepend_current_dir_if_relative(uri);
#else
// FIXME: it may be that prepend_current_dir_if_relative works OK on windows too, test!
@@ -773,7 +773,7 @@
gchar *new_uri = NULL;
if (filename) {
-#ifndef WIN32
+#ifndef _WIN32
new_uri = prepend_current_dir_if_relative(filename);
#else
// FIXME: it may be that prepend_current_dir_if_relative works OK on windows too, test!
--- inkscape-0.91/src/extension/extension.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/extension/extension.cpp 2016-05-30 09:47:05.197958973 +0200
@@ -273,7 +273,7 @@
// No need to include Windows only extensions
// See LP bug #1307554 for details - https://bugs.launchpad.net/inkscape/+bug/1307554
-#ifndef WIN32
+#ifndef _WIN32
const char* win_ext[] = {"com.vaxxine.print.win32"};
std::vector<std::string> v (win_ext, win_ext + sizeof(win_ext)/sizeof(win_ext[0]));
std::string ext_id(id);
--- inkscape-0.91/src/extension/implementation/script.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/extension/implementation/script.cpp 2016-05-30 09:47:05.197958973 +0200
@@ -45,7 +45,7 @@
#include "util/glib-list-iterators.h"
#include "path-prefix.h"
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#include <sys/stat.h>
#include "registrytool.h"
@@ -80,7 +80,7 @@
*/
Script::interpreter_t const Script::interpreterTab[] = {
{"perl", "perl-interpreter", "perl" },
-#ifdef WIN32
+#ifdef _WIN32
{"python", "python-interpreter", "pythonw" },
#else
{"python", "python-interpreter", "python" },
--- inkscape-0.91/src/extension/internal/cairo-render-context.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/extension/internal/cairo-render-context.cpp 2016-05-30 09:47:05.197958973 +0200
@@ -46,7 +46,7 @@
#include "sp-mask.h"
#include "sp-clippath.h"
#include "util/units.h"
-#ifdef WIN32
+#ifdef _WIN32
#include "libnrtype/FontFactory.h" // USE_PANGO_WIN32
#endif
@@ -268,7 +268,7 @@
if (*fn == '|') {
fn += 1;
while (isspace(*fn)) fn += 1;
-#ifndef WIN32
+#ifndef _WIN32
osp = popen(fn, "w");
#else
osp = _popen(fn, "w");
@@ -295,7 +295,7 @@
gchar *qn = ( *fn
? g_strdup_printf("lpr -P %s", fn) /* FIXME: quote fn */
: g_strdup("lpr") );
-#ifndef WIN32
+#ifndef _WIN32
osp = popen(qn, "w");
#else
osp = _popen(qn, "w");
@@ -350,7 +350,7 @@
if (*fn == '|') {
fn += 1;
while (isspace(*fn)) fn += 1;
-#ifndef WIN32
+#ifndef _WIN32
osp = popen(fn, "w");
#else
osp = _popen(fn, "w");
@@ -377,7 +377,7 @@
gchar *qn = ( *fn
? g_strdup_printf("lpr -P %s", fn) /* FIXME: quote fn */
: g_strdup("lpr") );
-#ifndef WIN32
+#ifndef _WIN32
osp = popen(qn, "w");
#else
osp = _popen(qn, "w");
--- inkscape-0.91/src/extension/internal/pdfinput/pdf-input.cpp 2014-12-07 20:28:21.000000000 +0100
+++ inkscape-0.91/src/extension/internal/pdfinput/pdf-input.cpp 2016-05-30 09:47:05.197958973 +0200
@@ -674,7 +674,7 @@
#endif // ENABLE_OSX_APP_LOCATIONS
}
// poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from glib gstdio.c
-#ifndef WIN32
+#ifndef _WIN32
GooString *filename_goo = new GooString(uri);
PDFDoc *pdf_doc = new PDFDoc(filename_goo, NULL, NULL, NULL); // TODO: Could ask for password
//delete filename_goo;
--- inkscape-0.91/src/file.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/file.cpp 2016-05-30 09:47:05.197958973 +0200
@@ -86,7 +86,7 @@
#include "extension/dbus/dbus-init.h"
#endif
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#endif
@@ -498,7 +498,7 @@
(GFileTest)(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)))
open_path = "";
-#ifdef WIN32
+#ifdef _WIN32
//# If no open path, default to our win32 documents folder
if (open_path.empty())
{
--- inkscape-0.91/src/inkscape.cpp 2016-05-30 09:46:47.866316517 +0200
+++ inkscape-0.91/src/inkscape.cpp 2016-05-30 09:47:05.197958973 +0200
@@ -28,7 +28,7 @@
#include "debug/simple-event.h"
#include "debug/event-tracker.h"
-#ifndef WIN32
+#ifndef _WIN32
# define HAS_PROC_SELF_EXE //to get path of executable
#else
@@ -166,7 +166,7 @@
static void (* abrt_handler) (int) = SIG_DFL;
static void (* fpe_handler) (int) = SIG_DFL;
static void (* ill_handler) (int) = SIG_DFL;
-#ifndef WIN32
+#ifndef _WIN32
static void (* bus_handler) (int) = SIG_DFL;
#endif
@@ -304,7 +304,7 @@
klass->deactivate_desktop = inkscape_deactivate_desktop_private;
}
-#ifdef WIN32
+#ifdef _WIN32
typedef int uid_t;
#define getuid() 0
#endif
@@ -622,7 +622,7 @@
signal (SIGABRT, abrt_handler );
signal (SIGFPE, fpe_handler );
signal (SIGILL, ill_handler );
-#ifndef WIN32
+#ifndef _WIN32
signal (SIGBUS, bus_handler );
#endif
@@ -842,7 +842,7 @@
abrt_handler = signal (SIGABRT, inkscape_crash_handler);
fpe_handler = signal (SIGFPE, inkscape_crash_handler);
ill_handler = signal (SIGILL, inkscape_crash_handler);
-#ifndef WIN32
+#ifndef _WIN32
bus_handler = signal (SIGBUS, inkscape_crash_handler);
#endif
@@ -877,7 +877,7 @@
/* DebugDialog redirection. On Linux, default to OFF, on Win32, default to ON.
* Use only if use_gui is enabled
*/
-#ifdef WIN32
+#ifdef _WIN32
#define DEFAULT_LOG_REDIRECT true
#else
#define DEFAULT_LOG_REDIRECT false
--- inkscape-0.91/src/inkview.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/inkview.cpp 2016-05-30 09:47:05.201958890 +0200
@@ -72,6 +72,13 @@
#include "ui/icon-names.h"
+#ifdef _WIN32
+#include <io.h>
+#include <conio.h>
+#define _WIN32_WINNT 0x0501
+#include <windows.h>
+#endif
+
extern char *optarg;
extern int optind, opterr;
@@ -170,6 +177,30 @@
int
main (int argc, const char **argv)
{
+#ifdef _WIN32
+ if (fileno (stdout) != -1 &&
+ _get_osfhandle (fileno (stdout)) != -1)
+ {
+ /* stdout is fine, presumably redirected to a file or pipe */
+ }
+ else
+ {
+ typedef BOOL (* WINAPI AttachConsole_t) (DWORD);
+
+ AttachConsole_t p_AttachConsole =
+ (AttachConsole_t) GetProcAddress (GetModuleHandle ("kernel32.dll"), "AttachConsole");
+
+ if (p_AttachConsole != NULL && p_AttachConsole (ATTACH_PARENT_PROCESS))
+ {
+ freopen ("CONOUT$", "w", stdout);
+ dup2 (fileno (stdout), 1);
+ freopen ("CONOUT$", "w", stderr);
+ dup2 (fileno (stderr), 2);
+
+ }
+ }
+#endif
+
if (argc == 1) {
usage();
}
--- inkscape-0.91/src/interface.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/interface.cpp 2016-05-30 09:47:05.201958890 +0200
@@ -2047,7 +2047,7 @@
Glib::ustring name;
Glib::ustring fullname;
-#ifdef WIN32
+#ifdef _WIN32
// g_spawn_command_line_sync parsing is done according to Unix shell rules,
// not Windows command interpreter rules. Thus we need to enclose the
// executable path with single quotes.
--- inkscape-0.91/src/io/sys.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/io/sys.cpp 2016-05-30 09:48:02.680768014 +0200
@@ -102,7 +102,7 @@
DEBUG_MESSAGE( dumpOne, "entering fopen_utf8name( '%s', '%s' )[%d]", utf8name, mode, (counter++) );
-#ifndef WIN32
+#ifndef _WIN32
DEBUG_MESSAGE( dumpOne, " STEP 0 ( '%s', '%s' )[%d]", utf8name, mode, (counter++) );
gchar *filename = g_filename_from_utf8( utf8name, -1, NULL, NULL, NULL );
if ( filename )
@@ -135,7 +135,7 @@
DEBUG_MESSAGE( dumpMk, "entering mkdir_utf8name( '%s' )[%d]", utf8name, (counter++) );
-#ifndef WIN32
+#ifndef _WIN32
DEBUG_MESSAGE( dumpMk, " STEP 0 ( '%s' )[%d]", utf8name, (counter++) );
gchar *filename = g_filename_from_utf8( utf8name, -1, NULL, NULL, NULL );
if ( filename )
--- inkscape-0.91/src/io/uristream.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/io/uristream.cpp 2016-05-30 09:47:05.201958890 +0200
@@ -49,7 +49,7 @@
return NULL;
}
-#ifndef WIN32
+#ifndef _WIN32
gchar *filename = g_filename_from_utf8( utf8name, -1, NULL, NULL, NULL );
if ( filename ) {
if (mode == FILE_READ)
--- inkscape-0.91/src/libgdl/gdl-dock-master.c 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/libgdl/gdl-dock-master.c 2016-05-30 09:47:05.201958890 +0200
@@ -34,7 +34,7 @@
#include "gdl-switcher.h"
#include "libgdlmarshal.h"
#include "libgdltypebuiltins.h"
-#ifdef WIN32
+#ifdef _WIN32
#include "gdl-win32.h"
#endif
@@ -635,7 +635,7 @@
window, &values, GDK_GC_FUNCTION | GDK_GC_SUBWINDOW);
};
-#ifdef WIN32
+#ifdef _WIN32
GdkLineStyle lineStyle = GDK_LINE_ON_OFF_DASH;
if (is_os_vista())
{
--- inkscape-0.91/src/libgdl/gdl-win32.c 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/libgdl/gdl-win32.c 2016-05-30 09:47:05.201958890 +0200
@@ -7,7 +7,7 @@
*
* This code is in public domain
*/
-#ifdef WIN32
+#ifdef _WIN32
#include "gdl-win32.h"
#include <windows.h>
--- inkscape-0.91/src/libgdl/gdl-win32.h 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/libgdl/gdl-win32.h 2016-05-30 09:47:05.201958890 +0200
@@ -8,7 +8,7 @@
*/
#ifndef __INKSCAPE_GDL_WIN32_H__
#define __INKSCAPE_GDL_WIN32_H__
-#ifdef WIN32
+#ifdef _WIN32
#include <gdk/gdk.h>
@@ -17,5 +17,5 @@
/* Platform detection */
gboolean is_os_vista();
-#endif // ifdef WIN32
+#endif // ifdef _WIN32
#endif /* __INKSCAPE_GDL_WIN32_H__ */
--- inkscape-0.91/src/libuemf/uemf.c 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/libuemf/uemf.c 2016-05-30 09:47:05.201958890 +0200
@@ -1253,7 +1253,7 @@
const int mode
){
FILE *fp = NULL;
-#ifdef WIN32
+#ifdef _WIN32
uint16_t *fn16;
uint16_t *md16;
if(mode == U_READ){ md16 = U_Utf8ToUtf16le("rb", 0, NULL); }
--- inkscape-0.91/src/livarot/Path.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/livarot/Path.cpp 2016-05-30 09:47:05.205958807 +0200
@@ -819,7 +819,7 @@
bezier-paths used by True-Type fonts."
*/
-#ifdef WIN32
+#ifdef _WIN32
Geom::Point np = nData->p - nData->end;
if ( np[Geom::X] < l ) {
l = np[Geom::X];
--- inkscape-0.91/src/main.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/main.cpp 2016-05-30 09:47:05.205958807 +0200
@@ -96,10 +96,13 @@
#include <extension/output.h>
#include <extension/input.h>
-#ifdef WIN32
+#ifdef _WIN32
+#include <io.h>
+#include <conio.h>
+#define _WIN32_WINNT 0x0501
#include <windows.h>
#include "registrytool.h"
-#endif // WIN32
+#endif // _WIN32
#include "extension/init.h"
// Not ideal, but there doesn't appear to be a nicer system in place for
@@ -285,7 +288,7 @@
sp_global_printer_utf8 = NULL;
}
-#ifdef WIN32
+#ifdef _WIN32
static bool replaceArgs( int& argc, char**& argv );
#endif
static GSList *sp_process_args(poptContext ctx);
@@ -529,7 +532,7 @@
-#ifdef WIN32
+#ifdef _WIN32
/**
* Set up the PATH, INKSCAPE_LOCALEDIR and PYTHONPATH environment
@@ -615,7 +618,7 @@
gchar *extdir;
gchar *new_pythonpath;
-#ifdef WIN32
+#ifdef _WIN32
extdir = g_win32_locale_filename_from_utf8(INKSCAPE_EXTENSIONDIR);
#else
extdir = g_strdup(INKSCAPE_EXTENSIONDIR);
@@ -653,6 +656,31 @@
int
main(int argc, char **argv)
{
+#ifdef _WIN32
+ if (fileno (stdout) != -1 &&
+ _get_osfhandle (fileno (stdout)) != -1)
+ {
+ /* stdout is fine, presumably redirected to a file or pipe */
+ }
+ else
+ {
+ typedef BOOL (* WINAPI AttachConsole_t) (DWORD);
+
+ AttachConsole_t p_AttachConsole =
+ (AttachConsole_t) GetProcAddress (GetModuleHandle ("kernel32.dll"), "AttachConsole");
+
+ if (p_AttachConsole != NULL && p_AttachConsole (ATTACH_PARENT_PROCESS))
+ {
+ freopen ("CONOUT$", "w", stdout);
+ dup2 (fileno (stdout), 1);
+ freopen ("CONOUT$", "w", stderr);
+ dup2 (fileno (stderr), 2);
+
+ }
+ }
+#endif
+
+
#ifdef HAVE_FPSETMASK
/* This is inherited from Sodipodi code, where it was in #ifdef __FreeBSD__. It's probably
safe to remove: the default mask is already 0 in C99, and in current FreeBSD according to
@@ -660,7 +688,7 @@
fpsetmask(fpgetmask() & ~(FP_X_DZ | FP_X_INV));
#endif
-#ifdef WIN32
+#ifdef _WIN32
gchar *exedir = g_strdup(win32_getExePath().data());
_win32_set_inkscape_env(exedir);
@@ -718,7 +746,7 @@
gboolean use_gui;
-#if !defined(WIN32) && !defined(GDK_WINDOWING_QUARTZ)
+#if !defined(_WIN32) && !defined(GDK_WINDOWING_QUARTZ)
use_gui = (g_getenv("DISPLAY") != NULL);
#else
use_gui = TRUE;
@@ -776,12 +804,12 @@
}
}
-#ifdef WIN32
+#ifdef _WIN32
{
// If the call fails, we'll need to convert charsets
needToRecodeParams = !replaceArgs( argc, argv );
}
-#endif // WIN32
+#endif // _WIN32
int retcode;
@@ -1074,7 +1102,7 @@
Glib::signal_idle().connect(sigc::ptr_fun(&Inkscape::CmdLineAction::idle));
main_instance.run();
-#ifdef WIN32
+#ifdef _WIN32
//We might not need anything here
//sp_win32_finish(); <-- this is a NOP func
#endif
@@ -1886,7 +1914,7 @@
return do_export_win_metafile_common(doc, uri, mime);
}
-#ifdef WIN32
+#ifdef _WIN32
bool replaceArgs( int& argc, char**& argv )
{
bool worked = false;
@@ -2160,7 +2188,7 @@
return worked;
}
-#endif // WIN32
+#endif // _WIN32
static GSList *
sp_process_args(poptContext ctx)
--- inkscape-0.91/src/path-prefix.h 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/path-prefix.h 2016-05-30 09:47:05.205958807 +0200
@@ -44,27 +44,27 @@
# define CREATE_PATTERNSDIR BR_DATADIR( "/create/patterns/vector" )
#else
# ifdef WIN32
-# define INKSCAPE_APPICONDIR WIN32_DATADIR("pixmaps")
-# define INKSCAPE_ATTRRELDIR WIN32_DATADIR("share\\attributes")
-# define INKSCAPE_BINDDIR WIN32_DATADIR("share\\bind")
-# define INKSCAPE_EXAMPLESDIR WIN32_DATADIR("share\\examples")
-# define INKSCAPE_EXTENSIONDIR WIN32_DATADIR("share\\extensions")
-# define INKSCAPE_FILTERDIR WIN32_DATADIR("share\\filters")
-# define INKSCAPE_GRADIENTSDIR WIN32_DATADIR("share\\gradients")
-# define INKSCAPE_KEYSDIR WIN32_DATADIR("share\\keys")
-# define INKSCAPE_PIXMAPDIR WIN32_DATADIR("share\\icons")
-# define INKSCAPE_MARKERSDIR WIN32_DATADIR("share\\markers")
-# define INKSCAPE_PALETTESDIR WIN32_DATADIR("share\\palettes")
-# define INKSCAPE_PATTERNSDIR WIN32_DATADIR("share\\patterns")
-# define INKSCAPE_SCREENSDIR WIN32_DATADIR("share\\screens")
-# define INKSCAPE_SYMBOLSDIR WIN32_DATADIR("share\\symbols")
-# define INKSCAPE_TUTORIALSDIR WIN32_DATADIR("share\\tutorials")
-# define INKSCAPE_TEMPLATESDIR WIN32_DATADIR("share\\templates")
-# define INKSCAPE_UIDIR WIN32_DATADIR("share\\ui")
+# define INKSCAPE_APPICONDIR WIN32_DATADIR("..\\share\\pixmaps")
+# define INKSCAPE_ATTRRELDIR WIN32_DATADIR("..\\share\\inkscape\\attributes")
+# define INKSCAPE_BINDDIR WIN32_DATADIR("..\\share\\inkscape\\bind")
+# define INKSCAPE_EXAMPLESDIR WIN32_DATADIR("..\\share\\inkscape\\examples")
+# define INKSCAPE_EXTENSIONDIR WIN32_DATADIR("..\\share\\inkscape\\extensions")
+# define INKSCAPE_FILTERDIR WIN32_DATADIR("..\\share\\inkscape\\filters")
+# define INKSCAPE_GRADIENTSDIR WIN32_DATADIR("..\\share\\inkscape\\gradients")
+# define INKSCAPE_KEYSDIR WIN32_DATADIR("..\\share\\inkscape\\keys")
+# define INKSCAPE_PIXMAPDIR WIN32_DATADIR("..\\share\\inkscape\\icons")
+# define INKSCAPE_MARKERSDIR WIN32_DATADIR("..\\share\\inkscape\\markers")
+# define INKSCAPE_PALETTESDIR WIN32_DATADIR("..\\share\\inkscape\\palettes")
+# define INKSCAPE_PATTERNSDIR WIN32_DATADIR("..\\share\\inkscape\\patterns")
+# define INKSCAPE_SCREENSDIR WIN32_DATADIR("..\\share\\inkscape\\screens")
+# define INKSCAPE_SYMBOLSDIR WIN32_DATADIR("..\\share\\inkscape\\symbols")
+# define INKSCAPE_TUTORIALSDIR WIN32_DATADIR("..\\share\\inkscape\\tutorials")
+# define INKSCAPE_TEMPLATESDIR WIN32_DATADIR("..\\share\\inkscape\\templates")
+# define INKSCAPE_UIDIR WIN32_DATADIR("..\\share\\inkscape\\ui")
//CREATE V0.1 WIN32 support
-# define CREATE_GRADIENTSDIR WIN32_DATADIR("create\\gradients\\gimp")
-# define CREATE_PALETTESDIR WIN32_DATADIR("create\\swatches")
-# define CREATE_PATTERNSDIR WIN32_DATADIR("create\\patterns\\vector")
+# define CREATE_GRADIENTSDIR WIN32_DATADIR("..\\share\\create\\gradients\\gimp")
+# define CREATE_PALETTESDIR WIN32_DATADIR("..\\share\\create\\swatches")
+# define CREATE_PATTERNSDIR WIN32_DATADIR("..\\share\\create\\patterns\\vector")
# elif defined ENABLE_OSX_APP_LOCATIONS
# define INKSCAPE_APPICONDIR "Contents/Resources/share/pixmaps"
# define INKSCAPE_ATTRRELDIR "Contents/Resources/share/inkscape/attributes"
--- inkscape-0.91/src/preferences-skeleton.h 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/preferences-skeleton.h 2016-05-30 09:47:05.205958807 +0200
@@ -219,7 +219,7 @@
" <group id=\"transparency\"\n"
" on-focus=\"1.0\"\n"
" on-blur=\"0.50\"\n"
-#ifdef WIN32
+#ifdef _WIN32
" animate-time=\"0\"\n" // apparently windows sucks (flickers)
#else
" animate-time=\"100\"\n" // time to change in ms
@@ -282,7 +282,7 @@
" <group id=\"bitmapeditor\" value=\"gimp\"/>\n"
" <group id=\"bitmapautoreload\" value=\"1\"/>\n"
" <group id=\"dialogtype\" value=\"1\"/>\n"
-#ifdef WIN32
+#ifdef _WIN32
" <group id=\"desktopintegration\" value=\"1\"/>\n"
#endif
" <group id=\"dock\" "
@@ -290,7 +290,7 @@
" dockbarstyle=\"2\"" // GDL_DOCK_BAR_BOTH
" switcherstyle=\"2\"/>\n" // GDL_SWITCHER_STYLE_BOTH
" <group id=\"dialogsskiptaskbar\" value=\"1\"/>\n"
-#ifdef WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs
+#ifdef _WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs
" <group id=\"dialogsontopwin32\" value=\"0\"/>\n"
#endif
#if !defined(GDK_WINDOWING_QUARTZ) // No maximise for Quartz, see lp:1302627
--- inkscape-0.91/src/prefix.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/prefix.cpp 2016-05-30 09:47:05.205958807 +0200
@@ -469,7 +469,7 @@
static Glib::ustring win32_getResourcePath(const Glib::ustring &childPath)
{
- Glib::ustring dir = win32_getDataDir();
+ Glib::ustring dir = win32_getExePath();
if (childPath.size() > 0)
{
dir += "\\";
--- inkscape-0.91/src/sp-namedview.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/sp-namedview.cpp 2016-05-30 09:47:05.205958807 +0200
@@ -806,7 +806,7 @@
gint w = MIN(gdk_screen_width(), nv->window_width);
gint h = MIN(gdk_screen_height(), nv->window_height);
if ((w > 0) && (h > 0)) {
-#ifndef WIN32
+#ifndef _WIN32
gint dx= 0;
gint dy = 0;
gint dw = 0;
--- inkscape-0.91/src/ui/clipboard.cpp 2015-01-28 04:32:28.162676000 +0100
+++ inkscape-0.91/src/ui/clipboard.cpp 2016-05-30 09:47:05.205958807 +0200
@@ -91,7 +91,7 @@
#define CLIPBOARD_TEXT_TARGET "text/plain"
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#endif
@@ -991,7 +991,7 @@
bool file_saved = false;
Glib::ustring target = best_target;
-#ifdef WIN32
+#ifdef _WIN32
if (best_target == "CF_ENHMETAFILE" || best_target == "WCF_ENHMETAFILE")
{ // Try to save clipboard data as en emf file (using win32 api)
if (OpenClipboard(NULL)) {
@@ -1241,7 +1241,7 @@
return *i;
}
}
-#ifdef WIN32
+#ifdef _WIN32
if (OpenClipboard(NULL))
{ // If both bitmap and metafile are present, pick the one that was exported first.
UINT format = EnumClipboardFormats(0);
@@ -1312,7 +1312,7 @@
sigc::mem_fun(*this, &ClipboardManagerImpl::_onGet),
sigc::mem_fun(*this, &ClipboardManagerImpl::_onClear));
-#ifdef WIN32
+#ifdef _WIN32
// If the "image/x-emf" target handled by the emf extension would be
// presented as a CF_ENHMETAFILE automatically (just like an "image/bmp"
// is presented as a CF_BITMAP) this code would not be needed.. ???
--- inkscape-0.91/src/ui/dialog/dock-behavior.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/ui/dialog/dock-behavior.cpp 2016-05-30 09:47:05.205958807 +0200
@@ -231,7 +231,7 @@
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
gint transient_policy = prefs->getIntLimited( "/options/transientpolicy/value", 1, 0, 2);
-#ifdef WIN32 // Win32 special code to enable transient dialogs
+#ifdef _WIN32 // Win32 special code to enable transient dialogs
transient_policy = 2;
#endif
--- inkscape-0.91/src/ui/dialog/export.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/ui/dialog/export.cpp 2016-05-30 09:47:05.205958807 +0200
@@ -86,7 +86,7 @@
#include "desktop.h"
#include "message-stack.h"
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#include <commdlg.h>
#include <gdk/gdkwin32.h>
@@ -1322,7 +1322,7 @@
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (fs), filename.c_str());
-#ifdef WIN32
+#ifdef _WIN32
// code in this section is borrowed from ui/dialogs/filedialogimpl-win32.cpp
OPENFILENAMEW opf;
WCHAR filter_string[20];
--- inkscape-0.91/src/ui/dialog/filedialog.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/ui/dialog/filedialog.cpp 2016-05-30 09:47:05.205958807 +0200
@@ -88,7 +88,7 @@
FileDialogType fileTypes,
const char *title)
{
-#ifdef WIN32
+#ifdef _WIN32
FileOpenDialog *dialog = NULL;
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
if (prefs->getBool( "/options/desktopintegration/value")) {
@@ -123,7 +123,7 @@
const gchar *docTitle,
const Inkscape::Extension::FileSaveMethod save_method)
{
-#ifdef WIN32
+#ifdef _WIN32
FileSaveDialog *dialog = NULL;
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
if (prefs->getBool( "/options/desktopintegration/value")) {
--- inkscape-0.91/src/ui/dialog/filedialogimpl-win32.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/ui/dialog/filedialogimpl-win32.cpp 2016-05-30 09:47:05.205958807 +0200
@@ -11,7 +11,7 @@
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#ifdef WIN32
+#ifdef _WIN32
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -1996,7 +1996,7 @@
} } } // namespace Dialog, UI, Inkscape
-#endif // ifdef WIN32
+#endif // ifdef _WIN32
/*
Local Variables:
--- inkscape-0.91/src/ui/dialog/filedialogimpl-win32.h 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/ui/dialog/filedialogimpl-win32.h 2016-05-30 09:47:05.209958725 +0200
@@ -15,7 +15,7 @@
#include <glibmm.h>
-#ifdef WIN32
+#ifdef _WIN32
#if WITH_GLIBMM_2_32
#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
# include <glibmm/threads.h>
--- inkscape-0.91/src/ui/dialog/floating-behavior.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/ui/dialog/floating-behavior.cpp 2016-05-30 09:47:05.209958725 +0200
@@ -199,7 +199,7 @@
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
gint transient_policy = prefs->getIntLimited("/options/transientpolicy/value", 1, 0, 2);
-#ifdef WIN32 // Win32 special code to enable transient dialogs
+#ifdef _WIN32 // Win32 special code to enable transient dialogs
transient_policy = 2;
#endif
--- inkscape-0.91/src/ui/dialog/inkscape-preferences.cpp 2015-01-18 02:43:07.117567000 +0100
+++ inkscape-0.91/src/ui/dialog/inkscape-preferences.cpp 2016-05-30 09:47:05.209958725 +0200
@@ -56,7 +56,7 @@
#ifdef HAVE_ASPELL
# include <aspell.h>
-# ifdef WIN32
+# ifdef _WIN32
# include <windows.h>
# endif
#endif
@@ -675,7 +675,7 @@
_("Dockable"));
_page_windows.add_line( true, "", _win_floating, "",
_("Floating"));
-#ifdef WIN32
+#ifdef _WIN32
_page_windows.add_group_header( _("Desktop integration"));
_page_windows.add_line( true, "", _win_native, "",
_("Use Windows like open and save dialogs"));
@@ -683,7 +683,7 @@
_("Use GTK open and save dialogs "));
#endif
-#ifndef WIN32 // non-Win32 special code to enable transient dialogs
+#ifndef _WIN32 // non-Win32 special code to enable transient dialogs
_page_windows.add_group_header( _("Dialogs on top:"));
_page_windows.add_line( true, "", _win_ontop_none, "",
@@ -704,7 +704,7 @@
_page_windows.add_group_header( _("Miscellaneous"));
-#ifndef WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs
+#ifndef _WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs
_page_windows.add_line( true, "", _win_hide_task, "",
_("Whether dialog windows are to be hidden in the window manager taskbar"));
#endif
@@ -1817,7 +1817,7 @@
AspellConfig *config = new_aspell_config();
-#ifdef WIN32
+#ifdef _WIN32
// on windows, dictionaries are in a lib/aspell-0.60 subdir off inkscape's executable dir;
// this is some black magick to find out the executable path to give it to aspell
char exeName[MAX_PATH+1];
--- inkscape-0.91/src/ui/dialog/ocaldialogs.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/ui/dialog/ocaldialogs.cpp 2016-05-30 09:47:05.209958725 +0200
@@ -1094,7 +1094,7 @@
// Open the RSS feed
Glib::RefPtr<Gio::File> xml_file = Gio::File::create_for_uri(xml_uri);
-#ifdef WIN32
+#ifdef _WIN32
if (!xml_file->query_exists()) {
widget_status->set_error(_("Could not connect to the Open Clip Art Library"));
return;
--- inkscape-0.91/src/ui/dialog/print.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/ui/dialog/print.cpp 2016-05-30 09:47:05.209958725 +0200
@@ -16,7 +16,7 @@
#include <gtkmm.h>
-#ifdef WIN32
+#ifdef _WIN32
#include <io.h>
#include <windows.h>
#endif
@@ -38,7 +38,7 @@
static void draw_page(
-#ifdef WIN32
+#ifdef _WIN32
GtkPrintOperation *operation,
#else
GtkPrintOperation *,
@@ -126,7 +126,7 @@
cairo_surface_t *surface = cairo_get_target(cr);
cairo_matrix_t ctm;
cairo_get_matrix(cr, &ctm);
-#ifdef WIN32
+#ifdef _WIN32
//Gtk+ does not take the non printable area into account
//http://bugzilla.gnome.org/show_bug.cgi?id=381371
//
--- inkscape-0.91/src/ui/dialog/spellcheck.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/ui/dialog/spellcheck.cpp 2016-05-30 09:47:05.209958725 +0200
@@ -42,7 +42,7 @@
#include "verbs.h"
#include <glibmm/i18n.h>
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#endif
@@ -339,7 +339,7 @@
gtk_widget_set_sensitive(dictionary_combo, false);
start_button.set_sensitive(false);
-#ifdef WIN32
+#ifdef _WIN32
// on windows, dictionaries are in a lib/aspell-0.60 subdir off inkscape's executable dir;
// this is some black magick to find out the executable path to give it to aspell
char exeName[MAX_PATH+1];
@@ -357,7 +357,7 @@
#ifdef HAVE_ASPELL
{
AspellConfig *config = new_aspell_config();
-#ifdef WIN32
+#ifdef _WIN32
aspell_config_replace(config, "prefix", exeName);
#endif
aspell_config_replace(config, "lang", _lang.c_str());
@@ -374,7 +374,7 @@
if (_lang2 != "") {
AspellConfig *config = new_aspell_config();
-#ifdef WIN32
+#ifdef _WIN32
aspell_config_replace(config, "prefix", exeName);
#endif
aspell_config_replace(config, "lang", _lang2.c_str());
@@ -391,7 +391,7 @@
if (_lang3 != "") {
AspellConfig *config = new_aspell_config();
-#ifdef WIN32
+#ifdef _WIN32
aspell_config_replace(config, "prefix", exeName);
#endif
aspell_config_replace(config, "lang", _lang3.c_str());
--- inkscape-0.91/src/ui/widget/preferences-widget.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/ui/widget/preferences-widget.cpp 2016-05-30 09:47:05.209958725 +0200
@@ -14,7 +14,7 @@
# include <config.h>
#endif
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#endif
@@ -840,7 +840,7 @@
(GFileTest)(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)))
open_path = "";
-#ifdef WIN32
+#ifdef _WIN32
//# If no open path, default to our win32 documents folder
if (open_path.empty())
{
--- inkscape-0.91/src/winconsole.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/winconsole.cpp 2016-05-30 09:47:05.209958725 +0200
@@ -38,7 +38,7 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#ifdef WIN32
+#ifdef _WIN32
#undef DATADIR
#include <windows.h>
--- inkscape-0.91/src/xml/rebase-hrefs.cpp 2014-11-30 19:45:32.000000000 +0100
+++ inkscape-0.91/src/xml/rebase-hrefs.cpp 2016-05-30 09:47:05.209958725 +0200
@@ -247,7 +247,7 @@
}
// Other bitmaps are either really absolute, or already relative.
-#ifdef WIN32
+#ifdef _WIN32
/* Windows relative path needs their native separators before we
* compare it to native baserefs. */
if ( !Glib::path_is_absolute(href) ) {
@@ -276,7 +276,7 @@
? abs_href.c_str()
: NULL ));
if (!Glib::path_is_absolute(new_href)) {
-#ifdef WIN32
+#ifdef _WIN32
/* Native Windows path separators are replaced with / so that the href
* also works on Gnu/Linux and OSX */
std::replace(href.begin(), href.end(), '\\', '/');