summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2018-09-30 21:47:39 +0000
committerEduard Braun <eduard.braun2@gmx.de>2018-10-01 22:50:12 +0000
commit172dbd2b94199731c1bbd2f789e55535188ade5c (patch)
tree907ca31a726661673f72eb35c2a8431e0dc57873 /src/ui
parentconfig.h - remove all defines we never use (diff)
downloadinkscape-172dbd2b94199731c1bbd2f789e55535188ade5c.tar.gz
inkscape-172dbd2b94199731c1bbd2f789e55535188ade5c.zip
Use _WIN32 instead of WIN32
The former is guaranteed to be set for any compiler targeting win32, the latter is implementation dependent (but works for gcc) See also http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/clipboard.cpp8
-rw-r--r--src/ui/contextmenu.cpp2
-rw-r--r--src/ui/dialog-events.cpp6
-rw-r--r--src/ui/dialog/dock-behavior.cpp2
-rw-r--r--src/ui/dialog/export.cpp4
-rw-r--r--src/ui/dialog/filedialog.cpp6
-rw-r--r--src/ui/dialog/filedialogimpl-win32.cpp4
-rw-r--r--src/ui/dialog/filedialogimpl-win32.h2
-rw-r--r--src/ui/dialog/floating-behavior.cpp2
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp12
-rw-r--r--src/ui/dialog/spellcheck.cpp10
-rw-r--r--src/ui/dialog/symbols.cpp2
-rw-r--r--src/ui/widget/preferences-widget.cpp6
13 files changed, 33 insertions, 33 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index a56529dea..299c82905 100644
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
@@ -85,7 +85,7 @@
#define CLIPBOARD_TEXT_TARGET "text/plain"
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#endif
@@ -1149,7 +1149,7 @@ SPDocument *ClipboardManagerImpl::_retrieveClipboard(Glib::ustring required_targ
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)) {
@@ -1397,7 +1397,7 @@ Glib::ustring ClipboardManagerImpl::_getBestTarget()
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);
@@ -1463,7 +1463,7 @@ void ClipboardManagerImpl::_setClipboardTargets()
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.. ???
diff --git a/src/ui/contextmenu.cpp b/src/ui/contextmenu.cpp
index 361a68f93..a3e9e9e78 100644
--- a/src/ui/contextmenu.cpp
+++ b/src/ui/contextmenu.cpp
@@ -753,7 +753,7 @@ void ContextMenu::ImageEdit()
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.
diff --git a/src/ui/dialog-events.cpp b/src/ui/dialog-events.cpp
index cf11490f3..cc9c8f0bd 100644
--- a/src/ui/dialog-events.cpp
+++ b/src/ui/dialog-events.cpp
@@ -148,7 +148,7 @@ sp_dialog_event_handler (GtkWindow *win, GdkEvent *event, gpointer data)
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.
@@ -159,7 +159,7 @@ void sp_transientize(GtkWidget *dialog)
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
@@ -185,7 +185,7 @@ sp_transientize_callback ( SPDesktop *desktop, win_data *wd )
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
diff --git a/src/ui/dialog/dock-behavior.cpp b/src/ui/dialog/dock-behavior.cpp
index 7d1131a5f..1f679d5d2 100644
--- a/src/ui/dialog/dock-behavior.cpp
+++ b/src/ui/dialog/dock-behavior.cpp
@@ -224,7 +224,7 @@ DockBehavior::onDesktopActivated(SPDesktop *desktop)
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
diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp
index f484f7e47..e153ed8f0 100644
--- a/src/ui/dialog/export.cpp
+++ b/src/ui/dialog/export.cpp
@@ -61,7 +61,7 @@
#include "extension/output.h"
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#include <commdlg.h>
#include <gdk/gdkwin32.h>
@@ -1313,7 +1313,7 @@ void Export::onBrowse ()
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];
diff --git a/src/ui/dialog/filedialog.cpp b/src/ui/dialog/filedialog.cpp
index df3c4a307..fd192a6fb 100644
--- a/src/ui/dialog/filedialog.cpp
+++ b/src/ui/dialog/filedialog.cpp
@@ -15,7 +15,7 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#ifdef WIN32
+#ifdef _WIN32
# include "filedialogimpl-win32.h"
# include "preferences.h"
#endif
@@ -89,7 +89,7 @@ FileOpenDialog *FileOpenDialog::create(Gtk::Window &parentWindow,
FileDialogType fileTypes,
const char *title)
{
-#ifdef WIN32
+#ifdef _WIN32
FileOpenDialog *dialog = NULL;
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
if (prefs->getBool( "/options/desktopintegration/value")) {
@@ -124,7 +124,7 @@ FileSaveDialog *FileSaveDialog::create(Gtk::Window& parentWindow,
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")) {
diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp
index c57594551..8f4ff0feb 100644
--- a/src/ui/dialog/filedialogimpl-win32.cpp
+++ b/src/ui/dialog/filedialogimpl-win32.cpp
@@ -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>
@@ -1926,7 +1926,7 @@ UINT_PTR CALLBACK FileSaveDialogImplWin32::GetSaveFileName_hookproc(
} } } // namespace Dialog, UI, Inkscape
-#endif // ifdef WIN32
+#endif // ifdef _WIN32
/*
Local Variables:
diff --git a/src/ui/dialog/filedialogimpl-win32.h b/src/ui/dialog/filedialogimpl-win32.h
index 182247703..5c9043a30 100644
--- a/src/ui/dialog/filedialogimpl-win32.h
+++ b/src/ui/dialog/filedialogimpl-win32.h
@@ -12,7 +12,7 @@
#include <glibmm.h>
-#ifdef WIN32
+#ifdef _WIN32
#include "filedialogimpl-gtkmm.h"
diff --git a/src/ui/dialog/floating-behavior.cpp b/src/ui/dialog/floating-behavior.cpp
index dccbd76b7..1581a5020 100644
--- a/src/ui/dialog/floating-behavior.cpp
+++ b/src/ui/dialog/floating-behavior.cpp
@@ -184,7 +184,7 @@ FloatingBehavior::onDesktopActivated (SPDesktop *desktop)
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
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index 84550dbf4..b10948229 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -60,7 +60,7 @@
#ifdef HAVE_ASPELL
# include <aspell.h>
-# ifdef WIN32
+# ifdef _WIN32
# include <windows.h>
# endif
#endif
@@ -610,7 +610,7 @@ void InkscapePreferences::symbolicThemeCheck()
folder.erase(0, last_slash_idx + 1);
}
if (folder == prefs->getString("/theme/iconTheme")) {
-#ifdef WIN32
+#ifdef _WIN32
path += g_win32_locale_filename_from_utf8("/symbolic/actions");
#else
path += "/symbolic/actions";
@@ -953,7 +953,7 @@ void InkscapePreferences::initPageUI()
_("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"));
@@ -961,7 +961,7 @@ void InkscapePreferences::initPageUI()
_("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, "",
@@ -982,7 +982,7 @@ void InkscapePreferences::initPageUI()
_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
@@ -2118,7 +2118,7 @@ void InkscapePreferences::initPageSpellcheck()
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];
diff --git a/src/ui/dialog/spellcheck.cpp b/src/ui/dialog/spellcheck.cpp
index 972f2d1f9..267b52423 100644
--- a/src/ui/dialog/spellcheck.cpp
+++ b/src/ui/dialog/spellcheck.cpp
@@ -39,7 +39,7 @@
#include <glibmm/i18n.h>
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#endif
@@ -312,7 +312,7 @@ SpellCheck::init(SPDesktop *d)
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];
@@ -330,7 +330,7 @@ SpellCheck::init(SPDesktop *d)
#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());
@@ -347,7 +347,7 @@ SpellCheck::init(SPDesktop *d)
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());
@@ -364,7 +364,7 @@ SpellCheck::init(SPDesktop *d)
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());
diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp
index ffeeb2ec9..c6e5cb98e 100644
--- a/src/ui/dialog/symbols.cpp
+++ b/src/ui/dialog/symbols.cpp
@@ -714,7 +714,7 @@ class REVENGE_API RVNGSVGDrawingGenerator_WithTitle : public RVNGSVGDrawingGener
// Read Visio stencil files
SPDocument* read_vss(Glib::ustring filename, Glib::ustring name ) {
gchar *fullname;
- #ifdef WIN32
+ #ifdef _WIN32
// RVNGFileStream uses fopen() internally which unfortunately only uses ANSI encoding on Windows
// therefore attempt to convert uri to the system codepage
// even if this is not possible the alternate short (8.3) file name will be used if available
diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp
index bf5630857..e55bbe2af 100644
--- a/src/ui/widget/preferences-widget.cpp
+++ b/src/ui/widget/preferences-widget.cpp
@@ -41,7 +41,7 @@
#include "ui/widget/preferences-widget.h"
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#endif
@@ -805,7 +805,7 @@ void PrefEntryFileButtonHBox::onRelatedButtonClickedCallback()
(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())
{
@@ -907,7 +907,7 @@ void PrefOpenFolder::onRelatedButtonClickedCallback()
{
g_mkdir_with_parents(relatedEntry->get_text().c_str(), 0700);
// https://stackoverflow.com/questions/42442189/how-to-open-spawn-a-file-with-glib-gtkmm-in-windows
-#ifdef WIN32
+#ifdef _WIN32
ShellExecute(NULL, "open", relatedEntry->get_text().c_str(), NULL, NULL, SW_SHOWDEFAULT);
#elif defined(__APPLE__)
system(("open " + relatedEntry->get_text()).c_str());