Refactor: Foundational Major InfiniFrame.Native c++ rework#322
Merged
Conversation
…I calls, improving diagnostics, and ensuring resource cleanup.
…orts.Events.cpp`, improving maintainability and organization. Removed unused and redundant code.
…nux (GTK/WebKit) and Windows (Win32/WebView2).
…Windows (Win32/WebView2) window initialization logic to a dedicated file.
InfiniFrame.Native c++ rework
15 tasks
…t) and macOS (Cocoa/WebKit); replace with modularized, cross-platform WebView bridge components.
…indows, macOS, Linux), preparing for a unified, modularized bridge.
…ies to a dedicated folder. Update CMake and include paths accordingly.
…Exports.h`. Update include paths and CMake references accordingly.
…ort logic into shared core. Update references and CMake configurations accordingly.
…afer lock age calculations and improving error handling.
…s for flexible export configuration.
…rules and apply formatting script
…t section header formatting.
…t methods for safer string handling
…update `InteropStatus` handling. Renamed `InfiniFrameNativeStatus` to `InfiniFrameNativeInteropStatus` for clarity.
… unnecessary line breaks.
…e dependencies and packages directories.
…zation for build directory and error fixing, and enhance Visual Studio environment setup with robust error handling.
…clang-format` settings with improved parameter alignment. Remove redundant option from `.clang-tidy`.
… single-line conditional statements and aligning parameter formatting across methods.
…rol over auto-fix behavior.
…namespace indentation, access modifier alignment, and naming conventions.
…ional `--extra-arg` options, improving compatibility.
…dded.h` for consistent naming conventions.
…nd parameter formatting for consistency throughout.
…ption of `#pragma once`.
…ic, consolidate input handling, and improve artifact copy and verification processes." This reverts commit 2939101.
…th `if-elif` for artifact type handling, update step names for clarity, and simplify artifact copy logic." This reverts commit 01fc842.
…t handling, streamline `current-runner-only` logic, and improve verification process." This reverts commit f98aa66.
…fact copy/verification logic and improve `current-runner-only` handling." This reverts commit f210f8e.
…tion by replacing `copy_artifact` with `copy_flat`." This reverts commit 611dc81.
… and improved `current-runner-only` support" This reverts commit 25f1fb7.
…` action and update workflows" This reverts commit a07e97e.
… native binary handling - Refine `NativeArch` conditions for better platform distinction (e.g., separate `x64` and `arm64` handling). - Standardize `<Content>` item attributes for clarity and consistency. - Ensure alignment of native binaries with their respective runtime paths.
…eArch` conditions in project file - Pass `NativeArch` as a matrix variable in Windows, macOS, and Linux workflows. - Update `InfiniFrame.NativeBridge.csproj` to conditionally use `NativeArch` when specified, improving platform-specific handling.
- Eliminated unnecessary `/p:CMakePlatform` usage across Windows, macOS, and Linux workflows. - Ensured `NativeArch` parameter is used consistently for platform-specific configurations.
…niframeJsSize` to `GInfiniframeJsData` and `GInfiniframeJsSize
…s `InfiniFrameJsUtf16` and `InfiniFrameJsUtf8` functions. Add section comments for clarity.
… directory structure
…ents for `Imports` and `Code`. Use `auto` for clarity and simplify mutex locks.
- Increase `dotnet build` timeout to 45 minutes and simplify build command formatting. - Add timeout mechanism for native build lock to prevent indefinite waits.
- Simplified `CleanNative` target condition in `InfiniFrame.NativeBridge.csproj`. - Expanded `native-clean.ps1` script to include additional directories for cleanup.
… adjust includes, and update alignment logic.
…ts with section comments for `Imports` and `Code`, adjust include paths for consistency.
InfiniFrame.Native c++ reworkInfiniFrame.Native c++ rework
2 tasks
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A comprehensive rework of the
InfiniFrame.NativeBridgenative C++ layer. The previously monolithicWindow.cppandExports.cpphave been decomposed into focused, single-responsibility files grouped by platform and concern. New shared utility headers, aPublic/API surface,.clang-format/.clang-tidyconfigs, and anative-tidy.ps1script bring the C++ codebase up to a consistent, maintainable standard. CI workflows have been updated to match the new folder structure and to validate that test exports do not leak into production builds.Type of Change
Affected Modules / Scope
Changes Introduced
Native C++ modularisation
Window.cppandExports.cpp; replaced with a modular file tree grouped by platform and responsibility.Platform/Windows/Core/):WindowLifecycle,WindowState,WindowEvents,WindowProc,WindowStorage,WindowTracing,WindowEncoding,WindowOwnership+ header context filesWindow.Win32.Context.h/Window.Win32.Internal.h.Platform/Windows/WebView/):WebView2Attach,WebView2Controller,WebView2Host,WebView2Runtime.Platform/Linux/Core/):UiDispatcher.Gtk,WindowCore.Gtk,WindowEvents.Gtk,WindowInitialization.Gtk,WindowLifecycle.Gtk,WindowSignals.Gtk.Public/Exports/):Exports.Dialog,Exports.Events,Exports.Lifecycle,Exports.Memory,Exports.Platform,Exports.WindowCommands,Exports.WindowState,Exports.Tests.Public API surface
InfiniFrame.h,InfiniFrameWindow.h,InfiniFrameWindowImpl.h,InfiniFrameInitParams.h,InfiniFrameDialog.htoNative/Public/to clearly separate the stable API from internal implementation files.New shared utilities
Utils/ExportGuards.h— guards that prevent test exports from appearing in release builds (validated by CI).Utils/ErrorCode.h— standardised error-code helpers.Utils/StringCopy.h— safe cross-platform string-copy utilities.Utils/WindowsHandles.h— RAII wrappers for Win32 handles.Utils/Dimensions.h— geometry helpers.Utils/Result.h— lightweight result type.Interop safety & naming
InfiniFrameNativeStatus→InfiniFrameNativeInteropStatusfor clarity.InteropStatuscodes.NullToEmptyutility for safe nullable-string handling in exports.Code-style tooling
.clang-format(column width, access-modifier alignment, parameter formatting) and.clang-tidy(naming conventions, modern-C++ checks) configs.native-tidy.ps1with parameterised build-dir andApplyFixesflag.native-format.ps1to excludebuild/,dependencies/, andpackages/directories.CI / workflow updates
pathsandCMakeLists.txtreferences to reflect the new folder structure (.gitattributes,codeql-config.yml,bump_version.py).NativeArchparameter support to release and testing workflows.NativeBridgetest exports in production artifacts.Related Issues
Closes #323
Checklist
InfiniFrameNativeParameterTests.cs)📖 Additional Context
The primary motivation was maintainability: the old single-file approach made it impossible to navigate, review, or inc