Files
odfstudio/rust_uno/Library_rust_uno-cpp.mk
T
Mohamed Ali 3d75577640 Rust Bindings: Add extension-based UNO integration with FFI architecture
Implements LibreOffice extension providing Rust language binding for UNO API
using opaque pointer FFI architecture with type-safe handles.

Extension Features:
- User-controlled execution via "Rust UNO → Example" menu
- Optional installation/removal through LibreOffice extension system
- Complete Writer document manipulation example

Technical Implementation:
- Generated Rust wrappers for all UNO types via rustmaker
- C++ extern "C" bridges with proper UNO integration
- Type-safe opaque handles (XTextDocumentHandle, etc.)
- Extension architecture following LibreOffice standards
- Menu integration via Addons.xcu and ProtocolHandler.xcu

Architecture:
- Rust RAII Wrappers ↔ C++ extern "C" Bridges ↔ LibreOffice UNO
- Extension packaging with rust_uno-example.oxt
- Integrated build system with CustomTarget and Library makefiles

Build Commands:
./configure --enable-rust-uno

Extension Structure:
- rust_uno/example/ - Extension source files
- workdir/Extension/rust_uno-example.oxt - Packaged extension
- Automatic installation during LibreOffice build

Runtime Validation:
Successfully demonstrates complete UNO integration:
- Desktop service creation and XComponentLoader interface
- Writer document loading via loadComponentFromURL
- Text manipulation through XTextDocument and XSimpleText
- Proper interface querying and method invocation

GSoC 2025: Rust UNO Language Binding

Change-Id: I5cecb8ebd05aab396f444488c0ee2a9d483a9f62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186425
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-09-11 21:39:08 +02:00

42 lines
1.2 KiB
Makefile

# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_Library_Library,rust_uno-cpp))
$(eval $(call gb_Library_use_libraries,rust_uno-cpp, \
cppu \
cppuhelper \
sal \
))
$(eval $(call gb_Library_use_sdk_api,rust_uno-cpp))
# Add the uno_bootstrap.cxx file for bootstrap functionality
$(eval $(call gb_Library_add_exception_objects,rust_uno-cpp, \
rust_uno/uno_bootstrap \
))
# Combined generated files instead of thousands of individual files
rust_uno_generated_cxx = \
rust_uno_bindings
define rust_uno_add_generated_cxx
$(gb_CustomTarget_workdir)/rust_uno/rustmaker/cpp/$(1).cxx: \
$(call gb_CustomTarget_get_target,rust_uno/rustmaker)
$(eval $(call gb_Library_add_generated_exception_objects,rust_uno-cpp, \
CustomTarget/rust_uno/rustmaker/cpp/$(1) \
))
endef
$(foreach gencxx,$(rust_uno_generated_cxx),$(eval $(call rust_uno_add_generated_cxx,$(gencxx))))
# vim: set noet sw=4 ts=4: