mirror of
https://github.com/taigrr/wails.git
synced 2026-04-02 13:19:00 -07:00
Compare commits
13 Commits
v0.18.9-pr
...
261-korean
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff666379fd | ||
|
|
69000a0afb | ||
|
|
dd43737b82 | ||
|
|
52e6091f0f | ||
|
|
2db1624faf | ||
|
|
f5d3fb0848 | ||
|
|
85a64914aa | ||
|
|
061c3a6cca | ||
|
|
226b02646b | ||
|
|
2e9e6a398a | ||
|
|
cd3865038b | ||
|
|
9e6d6763ec | ||
|
|
e0856b8bfc |
@@ -20,3 +20,4 @@ Wails is what it is because of the time and effort given by these great people.
|
||||
* [Toyam Cox](https://github.com/Vaelatern)
|
||||
* [Robin Eklind](https://github.com/mewmew)
|
||||
* [Kris Raney](https://github.com/kraney)
|
||||
* [soon cheol shin](https://github.com/scshin0572)
|
||||
|
||||
@@ -191,8 +191,15 @@ func (b *PackageHelper) PackageWindows(po *ProjectOptions, cleanUp bool) error {
|
||||
|
||||
// Build syso
|
||||
sysofile := filepath.Join(b.fs.Cwd(), basename+"-res.syso")
|
||||
windresCommand := []string{"windres", "-o", sysofile, tgtRCFile}
|
||||
err := NewProgramHelper().RunCommandArray(windresCommand)
|
||||
|
||||
batfile, err := fs.LocalDir(".")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
windresBatFile := filepath.Join(batfile.fullPath, "windres.bat")
|
||||
windresCommand := []string{windresBatFile, sysofile, tgtRCFile}
|
||||
err = NewProgramHelper().RunCommandArray(windresCommand)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@ func (p *ProgramHelper) RunCommandArray(args []string, dir ...string) error {
|
||||
fmt.Printf("ERROR: Looks like '%s' isn't installed. Please install and try again.", program)
|
||||
return err
|
||||
}
|
||||
|
||||
args = args[1:]
|
||||
var stderr string
|
||||
var stdout string
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package cmd
|
||||
|
||||
// Version - Wails version
|
||||
const Version = "v0.18.9-pre"
|
||||
const Version = "v0.18.11-pre"
|
||||
|
||||
1
cmd/windres.bat
Normal file
1
cmd/windres.bat
Normal file
@@ -0,0 +1 @@
|
||||
windres.exe -o %1 %2
|
||||
2
go.mod
2
go.mod
@@ -30,4 +30,4 @@ require (
|
||||
golang.org/x/text v0.3.0
|
||||
gopkg.in/AlecAivazis/survey.v1 v1.8.4
|
||||
gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22
|
||||
)
|
||||
)
|
||||
|
||||
@@ -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
|
||||
#cgo windows CFLAGS: -DWEBVIEW_WINAPI=1 -std=c99 -DUNICODE=1
|
||||
#cgo windows LDFLAGS: -lole32 -lcomctl32 -loleaut32 -luuid -lgdi32
|
||||
|
||||
#cgo darwin CFLAGS: -DWEBVIEW_COCOA=1 -x objective-c
|
||||
|
||||
@@ -217,6 +217,21 @@ struct webview_priv
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
WEBVIEW_API void webview_set_title(struct webview *w, const char *title)
|
||||
{
|
||||
#ifdef UNICODE
|
||||
wchar_t *u16title = webview_to_utf16(title);
|
||||
if (u16title == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
SetWindowText(w->priv.hwnd, u16title);
|
||||
GlobalFree(u16title);
|
||||
#else
|
||||
SetWindowText(w->priv.hwnd, title);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int webview_js_encode(const char *s, char *esc, size_t n)
|
||||
{
|
||||
int r = 1; /* At least one byte for trailing zero */
|
||||
@@ -1038,7 +1053,7 @@ struct webview_priv
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
static const TCHAR *classname = "WebView";
|
||||
static const TCHAR *classname = TEXT("WebView");
|
||||
static const SAFEARRAYBOUND ArrayBound = {1, 0};
|
||||
|
||||
static IOleClientSiteVtbl MyIOleClientSiteTable = {
|
||||
@@ -1227,7 +1242,7 @@ struct webview_priv
|
||||
}
|
||||
VariantInit(&myURL);
|
||||
myURL.vt = VT_BSTR;
|
||||
#ifndef UNICODE
|
||||
// #ifndef UNICODE
|
||||
{
|
||||
wchar_t *buffer = webview_to_utf16(webPageName);
|
||||
if (buffer == NULL)
|
||||
@@ -1237,9 +1252,9 @@ struct webview_priv
|
||||
myURL.bstrVal = SysAllocString(buffer);
|
||||
GlobalFree(buffer);
|
||||
}
|
||||
#else
|
||||
myURL.bstrVal = SysAllocString(webPageName);
|
||||
#endif
|
||||
// #else
|
||||
// myURL.bstrVal = SysAllocString(webPageName);
|
||||
// #endif
|
||||
if (!myURL.bstrVal)
|
||||
{
|
||||
badalloc:
|
||||
@@ -1277,7 +1292,7 @@ struct webview_priv
|
||||
if (!SafeArrayAccessData(sfArray, (void **)&pVar))
|
||||
{
|
||||
pVar->vt = VT_BSTR;
|
||||
#ifndef UNICODE
|
||||
// #ifndef UNICODE
|
||||
{
|
||||
wchar_t *buffer = webview_to_utf16(url);
|
||||
if (buffer == NULL)
|
||||
@@ -1287,9 +1302,9 @@ struct webview_priv
|
||||
bstr = SysAllocString(buffer);
|
||||
GlobalFree(buffer);
|
||||
}
|
||||
#else
|
||||
bstr = SysAllocString(string);
|
||||
#endif
|
||||
// #else
|
||||
// bstr = SysAllocString(url);
|
||||
// #endif
|
||||
if ((pVar->bstrVal = bstr))
|
||||
{
|
||||
htmlDoc2->lpVtbl->write(htmlDoc2, sfArray);
|
||||
@@ -1404,6 +1419,7 @@ struct webview_priv
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
ZeroMemory(&wc, sizeof(WNDCLASSEX));
|
||||
wc.cbSize = sizeof(WNDCLASSEX);
|
||||
wc.hInstance = hInstance;
|
||||
@@ -1431,10 +1447,24 @@ struct webview_priv
|
||||
rect.bottom = rect.bottom - rect.top + top;
|
||||
rect.top = top;
|
||||
|
||||
#ifdef UNICODE
|
||||
wchar_t *u16title = webview_to_utf16(w->title);
|
||||
if (u16title == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
w->priv.hwnd =
|
||||
CreateWindowEx(0, classname, u16title, style, rect.left, rect.top,
|
||||
rect.right - rect.left, rect.bottom - rect.top,
|
||||
HWND_DESKTOP, NULL, hInstance, (void *)w);
|
||||
#else
|
||||
w->priv.hwnd =
|
||||
CreateWindowEx(0, classname, w->title, style, rect.left, rect.top,
|
||||
rect.right - rect.left, rect.bottom - rect.top,
|
||||
HWND_DESKTOP, NULL, hInstance, (void *)w);
|
||||
#endif
|
||||
|
||||
if (w->priv.hwnd == 0)
|
||||
{
|
||||
OleUninitialize();
|
||||
@@ -1445,7 +1475,14 @@ struct webview_priv
|
||||
|
||||
DisplayHTMLPage(w);
|
||||
|
||||
#ifdef UNICODE
|
||||
SetWindowText(w->priv.hwnd, u16title);
|
||||
GlobalFree(u16title);
|
||||
#else
|
||||
SetWindowText(w->priv.hwnd, w->title);
|
||||
#endif
|
||||
|
||||
|
||||
ShowWindow(w->priv.hwnd, SW_SHOWDEFAULT);
|
||||
UpdateWindow(w->priv.hwnd);
|
||||
SetFocus(w->priv.hwnd);
|
||||
|
||||
Reference in New Issue
Block a user