windowpp 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/framework/src/FileSystem/Windows/filesearch.cpp +4 -0
- package/framework/src/FileSystem/Windows/readfile.cpp +4 -0
- package/framework/src/FileSystem/Windows/savefile.cpp +4 -0
- package/framework/src/filedrop/filedrop.cpp +2 -0
- package/framework/src/platform/win32/app_win32.cpp +4 -0
- package/framework/src/platform/win32/tray_win32.cpp +4 -0
- package/framework/src/platform/win32/window_win32.cpp +9 -5
- package/framework/src/platform/win32/window_win32.h +4 -0
- package/framework/src/renderer/webview/webview_win32.cpp +1 -1
- package/package.json +1 -1
- package/templates/example/frontend/vite.config.ts +5 -2
- package/templates/solid/frontend/vite.config.ts +5 -2
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
// Handles: fs:exists, fs:stat, fs:readDir, fs:searchFiles
|
|
4
4
|
// ============================================================================
|
|
5
5
|
|
|
6
|
+
#ifndef WIN32_LEAN_AND_MEAN
|
|
6
7
|
#define WIN32_LEAN_AND_MEAN
|
|
8
|
+
#endif
|
|
9
|
+
#ifndef NOMINMAX
|
|
7
10
|
#define NOMINMAX
|
|
11
|
+
#endif
|
|
8
12
|
#include <windows.h>
|
|
9
13
|
|
|
10
14
|
#include <filesystem>
|
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
// Handles: fs:readFile, fs:readBinaryFile
|
|
4
4
|
// ============================================================================
|
|
5
5
|
|
|
6
|
+
#ifndef WIN32_LEAN_AND_MEAN
|
|
6
7
|
#define WIN32_LEAN_AND_MEAN
|
|
8
|
+
#endif
|
|
9
|
+
#ifndef NOMINMAX
|
|
7
10
|
#define NOMINMAX
|
|
11
|
+
#endif
|
|
8
12
|
#include <windows.h>
|
|
9
13
|
|
|
10
14
|
#include <fstream>
|
|
@@ -5,8 +5,12 @@
|
|
|
5
5
|
// fs:createDir, fs:removeDir
|
|
6
6
|
// ============================================================================
|
|
7
7
|
|
|
8
|
+
#ifndef WIN32_LEAN_AND_MEAN
|
|
8
9
|
#define WIN32_LEAN_AND_MEAN
|
|
10
|
+
#endif
|
|
11
|
+
#ifndef NOMINMAX
|
|
9
12
|
#define NOMINMAX
|
|
13
|
+
#endif
|
|
10
14
|
#include <windows.h>
|
|
11
15
|
#include <shellapi.h>
|
|
12
16
|
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
// app_win32.cpp — Win32 Application implementation
|
|
3
3
|
// ============================================================================
|
|
4
4
|
|
|
5
|
+
#ifndef WIN32_LEAN_AND_MEAN
|
|
5
6
|
#define WIN32_LEAN_AND_MEAN
|
|
7
|
+
#endif
|
|
8
|
+
#ifndef NOMINMAX
|
|
6
9
|
#define NOMINMAX
|
|
10
|
+
#endif
|
|
7
11
|
#include "app_win32.h"
|
|
8
12
|
#include "window_win32.h"
|
|
9
13
|
#include "win32_helpers.h"
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
// tray_win32.cpp — Win32 System Tray implementation
|
|
3
3
|
// ============================================================================
|
|
4
4
|
|
|
5
|
+
#ifndef WIN32_LEAN_AND_MEAN
|
|
5
6
|
#define WIN32_LEAN_AND_MEAN
|
|
7
|
+
#endif
|
|
8
|
+
#ifndef NOMINMAX
|
|
6
9
|
#define NOMINMAX
|
|
10
|
+
#endif
|
|
7
11
|
#include "tray_win32.h"
|
|
8
12
|
#include "win32_helpers.h"
|
|
9
13
|
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
// window_win32.cpp — Win32 Window implementation
|
|
3
3
|
// ============================================================================
|
|
4
4
|
|
|
5
|
+
#ifndef WIN32_LEAN_AND_MEAN
|
|
5
6
|
#define WIN32_LEAN_AND_MEAN
|
|
7
|
+
#endif
|
|
8
|
+
#ifndef NOMINMAX
|
|
6
9
|
#define NOMINMAX
|
|
10
|
+
#endif
|
|
7
11
|
#include "window_win32.h"
|
|
8
12
|
#include "win32_helpers.h"
|
|
9
13
|
#include <algorithm>
|
|
@@ -80,11 +84,11 @@ void Win32Window::set_title(const std::string& title) {
|
|
|
80
84
|
}
|
|
81
85
|
|
|
82
86
|
void Win32Window::set_size(int w, int h) {
|
|
83
|
-
SetWindowPos(hwnd_, nullptr, 0, 0, w, h,
|
|
87
|
+
SetWindowPos(hwnd_, nullptr, 0, 0, w, h, SWP_NOZORDER | SWP_NOMOVE);
|
|
84
88
|
}
|
|
85
89
|
|
|
86
90
|
void Win32Window::set_position(int x, int y) {
|
|
87
|
-
SetWindowPos(hwnd_, nullptr, x, y, 0, 0,
|
|
91
|
+
SetWindowPos(hwnd_, nullptr, x, y, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
|
|
88
92
|
}
|
|
89
93
|
|
|
90
94
|
void Win32Window::set_min_size(int w, int h) {
|
|
@@ -110,7 +114,7 @@ void Win32Window::set_resizable(bool v) {
|
|
|
110
114
|
|
|
111
115
|
void Win32Window::set_always_on_top(bool v) {
|
|
112
116
|
SetWindowPos(hwnd_, v ? HWND_TOPMOST : HWND_NOTOPMOST,
|
|
113
|
-
0, 0, 0, 0,
|
|
117
|
+
0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
|
114
118
|
}
|
|
115
119
|
|
|
116
120
|
void Win32Window::set_opacity(float v) {
|
|
@@ -181,7 +185,7 @@ void Win32Window::fullscreen() {
|
|
|
181
185
|
GetMonitorInfoW(MonitorFromWindow(hwnd_, MONITOR_DEFAULTTONEAREST), &mi);
|
|
182
186
|
r = mi.rcMonitor;
|
|
183
187
|
SetWindowPos(hwnd_, HWND_TOP, r.left, r.top,
|
|
184
|
-
r.right - r.left, r.bottom - r.top,
|
|
188
|
+
r.right - r.left, r.bottom - r.top, SWP_NOZORDER);
|
|
185
189
|
}
|
|
186
190
|
}
|
|
187
191
|
|
|
@@ -194,7 +198,7 @@ void Win32Window::center() {
|
|
|
194
198
|
GetMonitorInfoW(MonitorFromWindow(hwnd_, MONITOR_DEFAULTTONEAREST), &mi);
|
|
195
199
|
int x = mi.rcWork.left + (mi.rcWork.right - mi.rcWork.left - w) / 2;
|
|
196
200
|
int y = mi.rcWork.top + (mi.rcWork.bottom - mi.rcWork.top - h) / 2;
|
|
197
|
-
SetWindowPos(hwnd_, nullptr, x, y, 0, 0,
|
|
201
|
+
SetWindowPos(hwnd_, nullptr, x, y, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
|
|
198
202
|
}
|
|
199
203
|
|
|
200
204
|
void Win32Window::request_repaint() {
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { resolve } from 'node:path';
|
|
1
|
+
import { dirname, resolve } from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
2
3
|
import tailwindcss from '@tailwindcss/vite';
|
|
3
4
|
import { defineConfig } from 'vite';
|
|
4
5
|
import solidPlugin from 'vite-plugin-solid';
|
|
5
6
|
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
|
|
6
9
|
const REPO_ROOT = '{{REPO_ROOT}}';
|
|
7
10
|
|
|
8
11
|
export default defineConfig({
|
|
@@ -18,7 +21,7 @@ export default defineConfig({
|
|
|
18
21
|
server: {
|
|
19
22
|
port: 3000,
|
|
20
23
|
fs: {
|
|
21
|
-
allow: [REPO_ROOT],
|
|
24
|
+
allow: [REPO_ROOT, __dirname],
|
|
22
25
|
},
|
|
23
26
|
},
|
|
24
27
|
build: {
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { resolve } from 'node:path';
|
|
1
|
+
import { dirname, resolve } from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
2
3
|
import tailwindcss from '@tailwindcss/vite';
|
|
3
4
|
import { defineConfig } from 'vite';
|
|
4
5
|
import solidPlugin from 'vite-plugin-solid';
|
|
5
6
|
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
|
|
6
9
|
const REPO_ROOT = '{{REPO_ROOT}}';
|
|
7
10
|
|
|
8
11
|
export default defineConfig({
|
|
@@ -18,7 +21,7 @@ export default defineConfig({
|
|
|
18
21
|
server: {
|
|
19
22
|
port: 3000,
|
|
20
23
|
fs: {
|
|
21
|
-
allow: [REPO_ROOT],
|
|
24
|
+
allow: [REPO_ROOT, __dirname],
|
|
22
25
|
},
|
|
23
26
|
},
|
|
24
27
|
build: {
|