Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
550d3be
coda-m: Initial macOS app
kendy Oct 14, 2024
edc1516
Initial CODA-Windows commits squashed together
Oct 21, 2024
adf5259
A few CODA-M commits squashed together
kendy Oct 22, 2024
9c7a803
A few CODA-W commits squashed together
Oct 29, 2024
30595ad
Typed access to window.ThisIsThe*App
kendy Jan 6, 2026
f58646c
Various CODA-M commits squashed together
kendy Oct 31, 2024
7602d3c
Various CODA-W commits squashed together
Oct 29, 2024
266dc44
Various CODA-M commits squashed together
kendy Nov 4, 2024
8fd14ee
Various CODA-W commits squashed together
Nov 5, 2024
bc4904d
Various CODA-M commits squashed together
kendy Nov 11, 2024
3baf5da
Lots of changes for CODA-W
Nov 11, 2024
8b79de9
coda-m: Update the project to build after the file splits
kendy Nov 19, 2024
b3ecbb6
coda-m: Update how the core install is copied to lokit/ subdir
kendy Nov 19, 2024
b23fa21
Make FileUtil.cpp compile on Windows
Nov 19, 2024
7138d42
coda-m: Better error message here
kendy Nov 19, 2024
f6149ce
coda-m: Don't add appDocId, it is iOS-specific
kendy Nov 19, 2024
589b3e1
Make a bunch of source files compile for Windows
Nov 25, 2024
e40d22f
Fix compilation errors on Windows
Mar 20, 2025
567e644
Use 'Multi-processor Compilation'
Nov 26, 2024
9b26890
I build Poco statically, so adapt to that
Nov 26, 2024
8489f0d
Misc small changes to make CODA-W build
Mar 20, 2025
ac5cac6
Add getter and setter functions for coolwsd_server_socket_fd for CODA-W
Nov 26, 2024
dd83df4
Don't warn about VLAs in Windows compilation
Nov 26, 2024
bc5daa4
Avoid warnings in CODA-W build: Use Util::getProcessId() instead of g…
Mar 20, 2025
8133ce1
A handful of sequential CODA-M commits squashed together
kendy Nov 26, 2024
2f009cd
Improve Util::time_t_to_localtime() and add Util::time_t_to_gmtime()
Nov 26, 2024
7edb6ba
Drop some now unneeded Windows-specific defines
Nov 27, 2024
2295639
Enable debugging of unmanaged (C++) code in CODA-W
Nov 27, 2024
e297574
Some more baby steps to make CODA-W start up properly
Nov 27, 2024
eabace7
coda-m: Enable possibility to debug WKWebView from Safari
kendy Dec 2, 2024
d0d1a78
coda-m: Get some debug output from send2JS (when enabled)
kendy Dec 2, 2024
bbe1151
coda-m: We perform the same restrictions wrt. \n as on iOS
kendy Dec 2, 2024
2df3ab8
Add experimentation with managed/native code marshalling on Windows
Dec 2, 2024
ef92091
coda-m: Good to have these debugging possibilities around
kendy Dec 2, 2024
8ae74b3
We do need LO_PATH in CODA-W
Dec 2, 2024
ec6ea48
Pass non-null args to lok_init_2() for CODA-W
Dec 2, 2024
92f6212
Try to get CODA-W to proceed further
Dec 2, 2024
55b33dd
Re-indent a bit to better match our style
Dec 3, 2024
c2801f4
Attempt to handle Windows pathnames better
Dec 3, 2024
6964cc0
Work on CODA-W, intermediate commit
Dec 3, 2024
2c37a8d
Four commits to coda-m squashed together
kendy Dec 3, 2024
8ce74f0
Also check window.ThisIsTheWindowsApp
Dec 3, 2024
8df9bb9
Change CODA to use .NET (and not .NET Framework)
Dec 3, 2024
50e051c
coda-m: Read the document that the user has choser in File -> Open...
kendy Dec 9, 2024
701d8de
Three CODA-W commits squashed together
Dec 9, 2024
84b2c0b
Six CODA-M commits squashed together
kendy Dec 9, 2024
5a3fd4a
Tweak SAL_LOG to avoid some verbiage
Dec 10, 2024
6733609
Fix logic in handling the flush option when logging to console
Dec 10, 2024
bed7b20
Try to make logging work better in CODA-W
Dec 10, 2024
b8721df
Modify the message passing from JS to C# in CODA-W
Dec 10, 2024
06d37d2
coda-m: Implement saving from the File -> Save menu in the app
kendy Dec 16, 2024
d7e1695
Check for the existence of memrchr
kendy Dec 17, 2024
900a4c4
coda-m: Fix build of WebSocketHandler on macOS
kendy Dec 17, 2024
00116dc
Also set window.userInterfaceMode for CODA-W
Dec 18, 2024
0a008e8
Execute JavaScript in the main thread
Dec 18, 2024
18bea36
CODA-W debugging hacks
Dec 19, 2024
9afe236
Implement Util::setThreadName() for Windows
Dec 30, 2024
aa5208d
coda-m: Define MACOS via config.h instead of a project setting
kendy Jan 6, 2025
5595da3
Generalize the check for capabilities to avoid the specific check for…
kendy Jan 6, 2025
4e25d64
Move the CPPFLAGS overwriting to the bottom of configure.ac
kendy Jan 12, 2026
43993d6
Implement pipe2() for platforms that don't have it (like macOS)
kendy Jan 6, 2025
7e7f97f
Avoid "error: unused function" on macOS
kendy Jan 6, 2025
821d3c7
Add HAVE_LIBCAP, HAVE_PIPE2, and MACOS here, too
tml1024 Jan 7, 2025
ee68577
Fix build of CODA-W
tml1024 Jan 7, 2025
315b47c
Use the built-in predefined _WIN32 macro instead of an own silly _WIN…
tml1024 Jan 7, 2025
43c68fe
Make the HAVE_* defines more consistent and improve the comments
kendy Jan 7, 2025
212ed93
This prctl() call is Linux-specific
kendy Jan 7, 2025
d93b7e6
Add macOS/iOS implementation of getThreadId()
kendy Jan 7, 2025
326abb7
Define 'environ' on macOS
kendy Jan 7, 2025
323441a
Trivial implementation of mount() and umount2() for macOS
kendy Jan 13, 2025
7069782
coda-m: Update readme
kendy Jan 13, 2025
285c3a2
coda-m: Guard some parts with MOBILEAPP
kendy Jan 13, 2025
9ba4968
Create Syscall.hpp/cpp to wrap various platform-dependent syscalls
kendy Jan 13, 2025
db6a7aa
Use the configured LO_PATH in the Run Script phase, instead of a hard…
kendy Jan 13, 2025
694ba75
Implement socket() with CLOEXEC and NONBLOCK for macOS
kendy Jan 14, 2025
1114d02
iOS: NetUtil.* shouldn't be needed for the app
kendy Jan 6, 2026
801dddf
Adapt to the different Homebrew locations on Intel vs Apple Silicon Mac
Jan 14, 2025
840c5e8
Implement accept() with CLOEXEC and NONBLOCK for macOS
kendy Jan 14, 2025
cb8b8dc
Adapt the getsockopt() calls for macOS
kendy Jan 14, 2025
d26c912
Obtaining the current thread ID for macOS
kendy Jan 14, 2025
95b96ae
Update linker flags for macOS
kendy Jan 14, 2025
7b4c083
Temporarily don't check the disk space in the macOS coolwsd
kendy Jan 14, 2025
6ccf72d
Fix linking on macOS
kendy Jan 14, 2025
836c88e
Syscall.hpp is not for the MOBILEAPP case, and does not compile on Wi…
Mar 24, 2025
5d9a1fd
This is mobileapp-only
kendy Jan 14, 2025
06947d2
Fix build on macOS
kendy Jan 14, 2025
f5daea3
We need libiconv for linking too
kendy Jan 14, 2025
a5dfb43
It turns out pkg-config was explicitly disabled on macOS
kendy Jan 14, 2025
17b71e5
Syscall: Cleaner way to not build unecessary code
hfiguiere Jan 15, 2025
57a8756
Fix build of tests on macOS
kendy Jan 20, 2025
e4d9004
Check for different versionrc location on macOS
kendy Jan 20, 2025
1cd7539
No debug POCO liraries on macOS
timar Jan 20, 2025
3009412
Add Xcode project for coolwsd for easier debugging
kendy Jan 21, 2025
6382888
Fix return values (and document them too)
kendy Jan 21, 2025
0334718
Actually let's experiment with coolwsd-inproc for the moment
kendy Jan 21, 2025
906b225
Set correct paths for macOS
kendy Jan 21, 2025
823302e
iconv behaves a bit weirdly on macOS
kendy Jan 27, 2025
e4aa3bf
Disable SSL in the debug run from Xcode for easier debugging
kendy Jan 27, 2025
7eaea86
coda-m: Fix build
kendy Jan 27, 2025
dc00d2a
Refactor in preparation for platform-dependent implementation
kendy Jan 27, 2025
bd49af9
Move the (Thread|FD)Counter to Util-linux and provide macOS impl
kendy Jan 27, 2025
d1107d5
Separate the coolwsd and coolwsd-inproc schemes
kendy Feb 3, 2025
aaf2789
Disable capabilities for coolwsd in Xcode on macOS
kendy Feb 4, 2025
f357cc9
coda-m: Introduce ENABLE_CHILDROOTS & guard it by --enable-coda
kendy Feb 4, 2025
71c58ad
coda-m: Add more coolwsd source files to the project
kendy Feb 10, 2025
2804a0c
Consolidate the ifdef
kendy Feb 10, 2025
f256292
coda-m: Fix most of the linking issues (but some are still left)
kendy Feb 10, 2025
5656092
coda-m: COOLWS is not supposed to be run twice
kendy Feb 11, 2025
76d6044
coda-m: Read coolwsd.xml from the bundle's Resources
kendy Feb 11, 2025
347c80f
coda-m: Disable the COOLWSD main() not to conflict
kendy Feb 11, 2025
1c3b7d4
coda-m: Pass the options needed for the coolwsd-inside-CODA functiona…
kendy Feb 11, 2025
14b1cc5
coda-m: Update README to match the current developments
kendy Feb 11, 2025
e1ca335
coda-m: Handle discovery.xml
kendy Feb 17, 2025
43e42ac
coda-m: Add Incoming connections (Server) entitlement
kendy Feb 17, 2025
0b353cc
Drop acidental extra slash
tml1024 Feb 12, 2025
6fbcd50
Construct a file: Poco::URI by passing a Poco::Path
tml1024 Feb 18, 2025
6734dbb
Windows-specific pathname fixes
tml1024 Feb 18, 2025
3b71205
Silence one more verbose INFO log tag
tml1024 Feb 18, 2025
bd7e969
coda-m: Fix the build of normal coolwsd on macOS again
kendy Feb 20, 2025
64de503
It's only CODA-M that handles the MODIFIED message for now
tml1024 Feb 20, 2025
c2e0cbd
Handle the abstract vs. regular socket names transparently
kendy Feb 21, 2025
fb58a01
coda-m: More places to disable when we don't use childroots
kendy Feb 21, 2025
2f6056e
coda-m: Update the Xcode project
kendy Feb 21, 2025
db83041
coda-m: No need to guard this by ENABLE_CODA any more
kendy Feb 21, 2025
8fa1939
Filter out more noisy and presumably pointless INFO and WARN log
tml1024 Feb 24, 2025
86148ca
Make CODA depend on CODALib
tml1024 Feb 24, 2025
ef755e2
Drop final backslash from return value of getSysTempDirectoryPath()
tml1024 Feb 24, 2025
4c33dd7
Make the CODA-W config.h.in match the Linux one more closely
tml1024 Feb 24, 2025
943f853
Add CODA-W specific generated files and project directories
tml1024 Feb 24, 2025
fdab4ab
Replace meaningless rubbish with simple code that works
tml1024 Feb 25, 2025
110bae0
coda-m: Introduce project for coolforkit
kendy Mar 10, 2025
aa46f86
coda-m: Revert back to the --enable-macosapp approach
kendy Mar 10, 2025
f902c65
coda-m: Better look via branding.(js,css)
kendy Mar 11, 2025
85413d3
coda-m: Icon for the bundle
kendy Mar 11, 2025
2b3ad29
coda-m: Make the hyperlinks work
kendy Mar 18, 2025
b43220d
Enable JS debugging again in the CODA-W project
Apr 9, 2025
28fdd00
Add branches for the Windows app, too to the clipboard code
Apr 9, 2025
866ed9b
Provide default params for Log::initialize() to simplify callers
kendy Apr 14, 2025
849b04a
coda-m: Make the Xcode project build against 25.04
kendy Apr 14, 2025
7996f93
coda-m: Trivial documentation update
kendy Apr 14, 2025
7c185ba
Tune the launch settings for CODA in Visual Studio a bit
Apr 15, 2025
12cdbeb
Change libpng library name to match that built in LO
Apr 15, 2025
209bd6b
Improve CODA-W build instructions
Apr 15, 2025
b31bd66
coda-m: Proof of concept Bold/Italic/Underline menu items
kendy Apr 16, 2025
fc3bf47
coda-m: Add branding how-to
kendy Apr 22, 2025
4962ce9
We also need zlib, libpng, and cppunit for CODA-M
Apr 22, 2025
714c8f5
Update WebView2 to the current version, as VS suggests
Apr 22, 2025
6f2dcf8
Start adding a native menu to CODA-W
Apr 22, 2025
c973440
coda-m: Show the state of Bold/Italics/Underline in the menu
kendy Apr 22, 2025
f05548c
Don't use a hardcoded document name but make the File>Open menu entry…
Apr 23, 2025
89a6553
Hide also the XAML menu once cool.html is displayed with its own menu
Apr 23, 2025
1e04a55
coda-m: Implement printing from the application's menu
kendy Apr 24, 2025
16e34b6
coda-m: Trigger printing also from the notebookbar
kendy Apr 24, 2025
7fa614d
Add File>Quit
Apr 28, 2025
e350d0a
Send the PRINT message also in the CODA-W case
Apr 28, 2025
20dbff2
Drop unused KitWebSocketHandler::getKitId()
Apr 29, 2025
f351bf4
Fix comment
Apr 29, 2025
c37b0e7
Improve the "app document id" handling in CODA-W
Apr 29, 2025
dc57e68
coda-m: Make the printing work
kendy Apr 28, 2025
d588d4d
coda-m: Avoid executables from core & limit resulting architecture
kendy Apr 28, 2025
1cb32cb
coda-m: Enable Hardened runtime, to be able to build a package
kendy Apr 29, 2025
4b9601f
Implement File > Print in CODA-W
Apr 29, 2025
b1164b8
Fix CODA-W build after rebase
Apr 29, 2025
0f53485
Show a print dialog
May 6, 2025
f201d7d
coda-m: Implement clipboard Copy (no Paste yet)
kendy May 13, 2025
f32937d
coda-m: Implement clipboard Paste
kendy May 20, 2025
9fc035d
coda-m: Enable/disable the Cut/Copy/Paste in the macOS menu
kendy May 20, 2025
4c6a27a
Use Util::getProcessId() instead of getpid()
May 22, 2025
9c77895
Add RegexUtil.cpp
May 22, 2025
1f35117
OutDir should end with a backslash
May 22, 2025
d4f680f
Copy browser/dist to the output directory and use it from there
tml1024 May 22, 2025
2bcd748
Copy also the LO instdir into the app folder and use it from there
tml1024 May 22, 2025
8f56390
Don't use Windows Forms API to get the folder we are running from
May 23, 2025
0af5956
Bin the temporary DllImportTest thing
May 24, 2025
1e8cc6d
coda-m: Remove the 'MODIFIED (true|false)' message again
kendy May 26, 2025
6be7f43
coda-m: Fix crash when auto-saving non-modified document
kendy May 26, 2025
1eb4459
./g review should use --force-with-lease
kendy Jan 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ debian/coolwsd.postinst
common/support-public-key.hpp
compile_commands.json
**/gdb.txt
macos/coolwsd/gmake-wrapper.sh

# Test stuff
systemplate
Expand Down Expand Up @@ -97,14 +98,14 @@ browser/compilets
browser/typescript_js
browser/src/layer/tile/CanvasTileWorker.js

coolforkit
coolforkitns
coolforkit-caps
coolforkit-nocaps
coolforkit-ns
/coolforkit
/coolforkitns
/coolforkit-caps
/coolforkit-nocaps
/coolforkit-ns
connect
lokitclient
coolwsd
/coolwsd
loolwsd
coolmount
coolmap
Expand Down Expand Up @@ -207,3 +208,12 @@ autogen.input

# SBOM
collabora-online-sbom.spdx.json

# Visual Studio projects for CODA-W
windows/coda/.vs
windows/coda/CODA/bin
windows/coda/CODA/obj
windows/coda/CODALib/x64

# CODA-W generated files
windows/coda/config.props
18 changes: 17 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ if !ENABLE_DEBUG
AM_CPPFLAGS += -DNDEBUG
endif

AM_LDFLAGS = -Wl,-E -lpam $(ZLIB_LIBS) $(ZSTD_LIBS) ${PNG_LIBS}
AM_LDFLAGS = -lpam $(ZLIB_LIBS) $(ZSTD_LIBS) ${PNG_LIBS}
if !ENABLE_MACOS
AM_LDFLAGS += -Wl,-E
endif

# Clang's linker doesn't like -pthread.
if !HAVE_CLANG
Expand All @@ -123,6 +126,12 @@ coolwsd_LDADD += ${OPENSSL_LIBS}
coolconfig_LDADD += ${OPENSSL_LIBS}
endif

if ENABLE_MACOS
util_platform_cpp = common/Util-macos.cpp
else
util_platform_cpp = common/Util-linux.cpp
endif

AM_ETAGSFLAGS = --c++-kinds=+p --fields=+iaS --extra=+q -R --totals=yes --exclude=browser/node_modules --exclude=browser/dist *
AM_CTAGSFLAGS = $(AM_ETAGSFLAGS)

Expand All @@ -138,12 +147,14 @@ shared_sources = common/FileUtil.cpp \
common/RegexUtil.cpp \
common/SigUtil-server.cpp \
common/SpookyV2.cpp \
common/Syscall.cpp \
common/TraceEvent.cpp \
common/Unit.cpp \
common/Unit-server.cpp \
common/Uri.cpp \
common/Util.cpp \
common/Util-server.cpp \
$(util_platform_cpp) \
common/Util-unix.cpp \
common/ConfigUtil.cpp \
common/Authorization.cpp \
Expand Down Expand Up @@ -220,6 +231,7 @@ connect_SOURCES = tools/Connect.cpp \
common/StringVector.cpp \
common/Util.cpp \
common/Util-server.cpp \
$(util_platform_cpp) \
common/Util-unix.cpp

connect_LDADD = libglobals.a
Expand All @@ -232,6 +244,7 @@ lokitclient_SOURCES = common/Log.cpp \
common/TraceEvent.cpp \
common/Util.cpp \
common/Util-server.cpp \
$(util_platform_cpp) \
common/Util-unix.cpp

lokitclient_LDADD = libglobals.a
Expand Down Expand Up @@ -338,6 +351,7 @@ clientnb_SOURCES = net/clientnb.cpp \
common/StringVector.cpp \
common/Util.cpp \
common/Util-server.cpp \
$(util_platform_cpp) \
common/Util-unix.cpp

clientnb_LDADD = libsimd.a libglobals.a
Expand All @@ -353,6 +367,7 @@ coolbench_SOURCES = tools/Benchmark.cpp \
common/StringVector.cpp \
common/Util.cpp \
common/Util-server.cpp \
$(util_platform_cpp) \
common/Util-unix.cpp \
common/Simd.cpp

Expand Down Expand Up @@ -447,6 +462,7 @@ shared_headers = common/Anonymizer.hpp \
common/StringVector.hpp \
common/Seccomp.hpp \
common/Session.hpp \
common/Syscall.hpp \
common/Unit.hpp \
common/Uri.hpp \
common/Util.hpp \
Expand Down
4 changes: 2 additions & 2 deletions android/lib/src/main/cpp/androidapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ JNI_OnLoad(JavaVM* vm, void*) {
// Uncomment the following to see the logs from the core too
//setenv("SAL_LOG", "+WARN+INFO", 0);
#if ENABLE_DEBUG
Log::initialize("Mobile", "debug", false, false, {}, false, {});
Log::initialize("Mobile", "debug");
#else
Log::initialize("Mobile", "information", false, false, {}, false, {});
Log::initialize("Mobile", "information");
#endif
return JNI_VERSION_1_6;
}
Expand Down
4 changes: 4 additions & 0 deletions browser/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,9 @@ define bundle_cool
$(if $(IS_SEPARATE),\
@touch $@,
$(QUIET_M4) m4 -PE -DIOSAPP=$(ENABLE_IOSAPP) \
-DMACOSAPP=$(ENABLE_MACOSAPP) \
-DGTKAPP=$(ENABLE_GTKAPP) \
-DWINDOWSAPP=$(ENABLE_WINDOWSAPP) \
-DANDROIDAPP=$(ENABLE_ANDROIDAPP) \
-DMOBILEAPPNAME="$(APP_NAME)" \
-DVERSION=$(COOL_VERSION) \
Expand Down Expand Up @@ -923,8 +925,10 @@ $(DIST_FOLDER)/cool.html: $(srcdir)/html/cool.html.m4 \
$(QUIET_M4) m4 -PE -I $(INTERMEDIATE_DIR) \
-DBUNDLE=$(IS_BUNDLE) \
-DIOSAPP=$(ENABLE_IOSAPP) \
-DMACOSAPP=$(ENABLE_MACOSAPP) \
-DGTKAPP=$(ENABLE_GTKAPP) \
-DDEBUG=$(ENABLE_DEBUG) \
-DWINDOWSAPP=$(ENABLE_WINDOWSAPP) \
-DANDROIDAPP=$(ENABLE_ANDROIDAPP) \
-DEMSCRIPTENAPP=$(ENABLE_EMSCRIPTENAPP) \
-DMOBILEAPPNAME="$(APP_NAME)" \
Expand Down
18 changes: 9 additions & 9 deletions browser/html/cool.html.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ m4_dnl------------------------------------------------------------------------
m4_dnl# Define MOBILEAPP as true if this is either for the iOS/Android app or for the gtk+ "app" testbed
m4_define([MOBILEAPP],[])m4_dnl
m4_ifelse(IOSAPP,[true],[m4_define([MOBILEAPP],[true])])m4_dnl
m4_ifelse(MACOSAPP,[true],[m4_define([MOBILEAPP],[true])])m4_dnl
m4_ifelse(GTKAPP,[true],[m4_define([MOBILEAPP],[true])])m4_dnl
m4_ifelse(WINDOWSAPP,[true],[m4_define([MOBILEAPP],[true])])m4_dnl
m4_ifelse(ANDROIDAPP,[true],[m4_define([MOBILEAPP],[true])])m4_dnl
m4_dnl
m4_dnl# FIXME: This is temporary and not what we actually eventually want.
Expand Down Expand Up @@ -63,7 +65,9 @@ m4_ifelse(MOBILEAPP, [true],

m4_dnl# For use in conditionals in JS:
m4_ifelse(IOSAPP, [true], [<input type="hidden" id="init-mobile-app-os-type" value="IOS" />])
m4_ifelse(MACOSAPP, [true], [<input type="hidden" id="init-mobile-app-os-type" value="MACOS" />])
m4_ifelse(GTKAPP, [true], [<input type="hidden" id="init-mobile-app-os-type" value="GTK" />])
m4_ifelse(WINDOWSAPP, [true], [<input type="hidden" id="init-mobile-app-os-type" value="WINDOWS" />])
m4_ifelse(ANDROIDAPP, [true], [<input type="hidden" id="init-mobile-app-os-type" value="ANDROID" />])
m4_ifelse(EMSCRIPTENAPP, [true], [<input type="hidden" id="init-mobile-app-os-type" value="EMSCRIPTEN" />])

Expand All @@ -74,15 +78,11 @@ m4_ifelse(BUNDLE,[],
m4_foreachq([fileCSS],[COOL_CSS],[<link rel="stylesheet" href="][m4_ifelse(MOBILEAPP,[],[%SERVICE_ROOT%/browser/%VERSION%/])][fileCSS" />
]),
[<link rel="stylesheet" href="][m4_ifelse(MOBILEAPP,[],[%SERVICE_ROOT%/browser/%VERSION%/])][bundle.css" />])

<!--%BRANDING_CSS%--> <!-- add your logo here -->
m4_ifelse(IOSAPP,[true],
[<link rel="stylesheet" href="Branding/branding.css">])
m4_ifelse(ANDROIDAPP,[true],
[<link rel="stylesheet" href="branding.css">])
m4_ifelse(EMSCRIPTENAPP,[true],
[<link rel="stylesheet" href="branding.css">])

m4_dnl
m4_dnl Add branding.css for mobile apps, or the placeholder for server processing
m4_ifelse(MOBILEAPP, [true], [<link rel="stylesheet" href="m4_ifelse(IOSAPP, [true], [Branding/])branding.css" />],
[<!--%BRANDING_CSS%--> <!-- add your logo here -->])
m4_dnl
m4_dnl Handle localization
m4_ifelse(MOBILEAPP,[true],
[
Expand Down
37 changes: 36 additions & 1 deletion browser/js/global.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* -*- js-indent-level: 8 -*- */
/* -*- js-indent-level: 8; fill-column: 100 -*- */

/* global Module ArrayBuffer Uint8Array _ */

Expand Down Expand Up @@ -477,6 +477,19 @@ class IOSAppInitializer extends MobileAppInitializer {
}
}

class MacOSAppInitializer extends MobileAppInitializer {
constructor() {
super();

window.ThisIsTheMacOSApp = true;
window.postMobileMessage = function(msg) { window.webkit.messageHandlers.lok.postMessage(msg); };
window.postMobileError = function(msg) { window.webkit.messageHandlers.error.postMessage(msg); };
window.postMobileDebug = function(msg) { window.webkit.messageHandlers.debug.postMessage(msg); };

window.userInterfaceMode = window.coolParams.get('userinterfacemode');
}
}

class GTKAppInitializer extends MobileAppInitializer {
constructor() {
super();
Expand All @@ -488,6 +501,24 @@ class GTKAppInitializer extends MobileAppInitializer {
}
}

class WindowsAppInitializer extends MobileAppInitializer {
constructor() {
super();

window.ThisIsTheWindowsApp = true;
window.postMobileMessage = function(msg) { window.chrome.webview.postMessage('MSG ' + msg); };

// FIXME: No registration of separate handlers in Windows WebView2, so just log
// errors and debug messages? Maybe instead send a JSON object with separate name
// and body? But then we would have to parse that JSON object from the string in C#
// anyway.
window.postMobileError = function(msg) { window.chrome.webview.postMessage('ERR ' + msg); };
window.postMobileDebug = function(msg) { window.chrome.webview.postMessage('DBG ' + msg); };

window.userInterfaceMode = window.coolParams.get('userinterfacemode');
}
}

class AndroidAppInitializer extends MobileAppInitializer {
constructor() {
super();
Expand Down Expand Up @@ -528,8 +559,12 @@ function getInitializerClass() {

if (osType === "IOS")
return new IOSAppInitializer();
else if (osType === "MACOS")
return new MacOSAppInitializer();
else if (osType === "GTK")
return new GTKAppInitializer();
else if (osType === "WINDOWS")
return new WindowsAppInitializer();
else if (osType === "ANDROID")
return new AndroidAppInitializer();
else if (osType === "EMSCRIPTEN")
Expand Down
5 changes: 4 additions & 1 deletion browser/src/app/Socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,10 @@ class Socket {

private _extractTextImg(e: SlurpMessageEvent): void {
if (
(window.ThisIsTheiOSApp || window.ThisIsTheEmscriptenApp) &&
(window.ThisIsTheiOSApp ||
window.ThisIsTheWindowsApp ||
window.ThisIsTheMacOSApp ||
window.ThisIsTheEmscriptenApp) &&
typeof e.data === 'string'
) {
// Another fix for issue #5843 limit splitting on the first newline
Expand Down
2 changes: 1 addition & 1 deletion browser/src/control/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ window.L.Map.include({
},

print: function (options) {
if (window.ThisIsTheiOSApp || window.ThisIsTheAndroidApp) {
if (window.ThisIsTheiOSApp || window.ThisIsTheAndroidApp || window.ThisIsTheMacOSApp || window.ThisIsTheWindowsApp) {
window.postMobileMessage('PRINT');
} else {
this.showBusy(_('Downloading...'), false);
Expand Down
3 changes: 3 additions & 0 deletions browser/src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,9 @@ interface Window {
ThisIsAMobileApp: boolean;
ThisIsTheEmscriptenApp: boolean;
ThisIsTheGtkApp: boolean;
ThisIsTheiOSApp: boolean;
ThisIsTheMacOSApp: boolean;
ThisIsTheWindowsApp: boolean;
wopiSrc: string;
zoteroEnabled: boolean;
accessToken: string;
Expand Down
9 changes: 8 additions & 1 deletion browser/src/layer/tile/CanvasTileLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2108,6 +2108,9 @@ window.L.CanvasTileLayer = window.L.Layer.extend({
// when json.commandName is '.uno:RowColSelCount'.
if (json.commandName && json.state !== undefined) {
this._map.fire('commandstatechanged', json);
if (window.ThisIsTheMacOSApp) {
window.postMobileMessage('COMMANDSTATECHANGED ' + JSON.stringify(json));
}
}
}
else if (textMsg.startsWith('.uno:Context=') && this._docType === 'presentation') {
Expand All @@ -2117,7 +2120,11 @@ window.L.CanvasTileLayer = window.L.Layer.extend({
var index = textMsg.indexOf('=');
var commandName = index !== -1 ? textMsg.substr(0, index) : '';
var state = index !== -1 ? textMsg.substr(index + 1) : '';
this._map.fire('commandstatechanged', {commandName : commandName, state : state});
const json = {commandName : commandName, state : state};
this._map.fire('commandstatechanged', json);
if (window.ThisIsTheMacOSApp) {
window.postMobileMessage('COMMANDSTATECHANGED ' + JSON.stringify(json));
}
}
},

Expand Down
Loading
Loading