Compare commits

...

2 Commits

Author SHA1 Message Date
Lea Anthony
71dc137194 fiX: unicode fixes for windows 2019-11-01 10:19:06 +11:00
Lea Anthony
13e6bd2178 fix: misc fixes 2019-11-01 10:15:21 +11:00
9 changed files with 46 additions and 32 deletions

View File

@@ -9,4 +9,4 @@
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
IE 9-11 # For IE 9-11 support, remove 'not'.

View File

@@ -13,7 +13,7 @@ package webview
#cgo linux openbsd freebsd CFLAGS: -DWEBVIEW_GTK=1 -Wno-deprecated-declarations
#cgo linux openbsd freebsd pkg-config: gtk+-3.0 webkit2gtk-4.0
#cgo windows CFLAGS: -DWEBVIEW_WINAPI=1 -std=c99 -DUNICODE=1
#cgo windows CFLAGS: -DWEBVIEW_WINAPI=1 -std=c99 -DUNICODE=1 -D_UNICODE=1
#cgo windows LDFLAGS: -lole32 -lcomctl32 -loleaut32 -luuid -lgdi32
#cgo darwin CFLAGS: -DWEBVIEW_COCOA=1 -x objective-c

View File

@@ -58,6 +58,7 @@ extern "C"
#elif defined(WEBVIEW_WINAPI)
#define CINTERFACE
#include <windows.h>
#include <tchar.h>
#include <commctrl.h>
#include <exdisp.h>
@@ -1350,8 +1351,8 @@ struct webview_priv
}
#define WEBVIEW_KEY_FEATURE_BROWSER_EMULATION \
"Software\\Microsoft\\Internet " \
"Explorer\\Main\\FeatureControl\\FEATURE_BROWSER_EMULATION"
_T("Software\\Microsoft\\Internet " \
"Explorer\\Main\\FeatureControl\\FEATURE_BROWSER_EMULATION")
static int webview_fix_ie_compat_mode()
{
@@ -1363,7 +1364,7 @@ struct webview_priv
{
return -1;
}
for (p = &appname[strlen(appname) - 1]; p != appname && *p != '\\'; p--)
for (p = &appname[_tcslen(appname) - 1]; p != appname && *p != _T('\\'); p--)
{
}
p++;
@@ -1872,14 +1873,30 @@ struct webview_priv
type |= MB_ICONERROR;
break;
}
#ifdef UNICODE
WCHAR *wtitle = webview_to_utf16(title);
WCHAR *warg = webview_to_utf16(arg);
MessageBox(w->priv.hwnd, warg, wtitle, type);
GlobalFree(warg);
GlobalFree(wtitle);
#else
MessageBox(w->priv.hwnd, arg, title, type);
#endif
#endif
}
}
WEBVIEW_API void webview_terminate(struct webview *w) { PostQuitMessage(0); }
WEBVIEW_API void webview_exit(struct webview *w) { OleUninitialize(); }
WEBVIEW_API void webview_print_log(const char *s) { OutputDebugString(s); }
WEBVIEW_API void webview_print_log(const char *s) {
#ifdef UNICODE
WCHAR *ws = webview_to_utf16(s);
OutputDebugString(ws);
GlobalFree(ws);
#else
OutputDebugString(s);
#endif
}
#endif /* WEBVIEW_WINAPI */

View File

@@ -15,10 +15,7 @@
"error",
"tab"
],
"linebreak-style": [
"error",
"unix"
],
"linebreak-style": 0,
"quotes": [
"error",
"single"
@@ -28,4 +25,4 @@
"always"
]
}
}
}

View File

@@ -32,6 +32,6 @@ function OpenFile(filename) {
}
module.exports = {
OpenURL,
OpenFile
};
OpenURL: OpenURL,
OpenFile: OpenFile
};

View File

@@ -80,10 +80,10 @@ function Acknowledge(eventName) {
}
module.exports = {
OnMultiple,
On,
Once,
Emit,
Heartbeat,
Acknowledge
};
OnMultiple: OnMultiple,
On: On,
Once: Once,
Emit: Emit,
Heartbeat: Heartbeat,
Acknowledge: Acknowledge
};

View File

@@ -62,9 +62,9 @@ function Fatal(message) {
}
module.exports = {
Debug,
Info,
Warning,
Error,
Fatal
Debug: Debug,
Info: Info,
Warning: Warning,
Error: Error,
Fatal: Fatal
};

View File

@@ -15,8 +15,8 @@ const Events = require('./events');
const Init = require('./init');
module.exports = {
Log,
Browser,
Events,
Init
};
Log: Log,
Browser: Browser,
Events: Events,
Init: Init
};

View File

@@ -1,6 +1,6 @@
{
"name": "@wailsapp/runtime",
"version": "1.0.6",
"version": "1.0.8",
"description": "Wails Javascript runtime library",
"main": "main.js",
"types": "runtime.d.ts",