Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
src/InfiniFrame.NativeBridge/Native/Dependencies/* linguist-vendored
src/InfiniFrame.NativeBridge/Native/Dependencies/**/* linguist-vendored
src/InfiniFrame.NativeBridge/Native/src/Dependencies/* linguist-vendored
src/InfiniFrame.NativeBridge/Native/src/Dependencies/**/* linguist-vendored

*.sh text eol=lf
.devcontainer/devcontainer.json text working-tree-encoding=UTF-8 eol=lf
12 changes: 11 additions & 1 deletion .github/actions/setup-dependencies-native/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Setup Native Dependencies
description: Install and cache Native related dependencies for Linux/macOS runners.
description: Install and cache Native related dependencies and optional NativeBridge NuGet restore.

inputs:
brew-cache-key:
Expand All @@ -10,6 +10,10 @@ inputs:
description: Homebrew cache restore key prefix for macOS runners
required: false
default: ""
restore-nativebridge-packages:
description: Restore InfiniFrame.NativeBridge NuGet packages on Windows
required: false
default: "false"

runs:
using: composite
Expand Down Expand Up @@ -96,3 +100,9 @@ runs:
if ! command -v pwsh >/dev/null 2>&1; then
brew list --cask powershell >/dev/null 2>&1 || brew install --cask powershell
fi

- name: Restore NativeBridge NuGet packages (Windows)
if: runner.os == 'Windows' && inputs['restore-nativebridge-packages'] == 'true'
shell: pwsh
run: |
dotnet restore ./src/InfiniFrame.NativeBridge/InfiniFrame.NativeBridge.csproj
2 changes: 2 additions & 0 deletions .github/workflows/ci-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ jobs:
with:
brew-cache-key: ${{ runner.os }}-brew-codeql-${{ hashFiles('.github/actions/setup-dependencies-native/action.yml', '.github/workflows/shared-testing-macos.yml') }}
brew-restore-key: ${{ runner.os }}-brew-codeql-
restore-nativebridge-packages: 'true'

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
Expand Down Expand Up @@ -269,6 +270,7 @@ jobs:
with:
brew-cache-key: ${{ matrix.os }}-${{ matrix.arch }}-brew-codeql-${{ hashFiles('.github/actions/setup-dependencies-native/action.yml', '.github/workflows/ci-codeql.yml') }}
brew-restore-key: ${{ matrix.os }}-${{ matrix.arch }}-brew-codeql-
restore-nativebridge-packages: 'true'

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/shared-release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
with:
brew-cache-key: ${{ matrix.os }}-${{ matrix.arch }}-brew-native-${{ hashFiles('.github/actions/setup-dependencies-native/action.yml', '.github/workflows/shared-release-build.yml') }}
brew-restore-key: ${{ matrix.os }}-${{ matrix.arch }}-brew-native-
restore-nativebridge-packages: 'true'

- name: Build Native
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/shared-testing-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
with:
brew-cache-key: ${{ matrix.os }}-${{ matrix.arch }}-brew-native-${{ hashFiles('.github/actions/setup-dependencies-native/action.yml', '.github/workflows/shared-testing-build.yml') }}
brew-restore-key: ${{ matrix.os }}-${{ matrix.arch }}-brew-native-
restore-nativebridge-packages: 'true'

- name: Build Native
shell: pwsh
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ healthchecksdb
/src/InfiniFrame.NativeBridge/Native/cmake-build-release-linux/
/src/InfiniFrame.NativeBridge/Native/cmake-build-release-linux-wsl/
/src/InfiniFrame.NativeBridge/Native/cmake-build-release-windows/
/src/InfiniFrame.NativeBridge/Native/Embedded/InfiniFrameJs/InfiniFrameJs.cpp
/src/InfiniFrame.NativeBridge/Native/Embedded/InfiniFrameJs/InfiniFrameJs.h
/src/InfiniFrame.NativeBridge/Native/src/Embedded/InfiniFrameJs/InfiniFrameJs.cpp
/src/InfiniFrame.NativeBridge/Native/src/Embedded/InfiniFrameJs/InfiniFrameJs.h

# wwwroot folders from js web based projects
/examples/InfiniFrameExample.WebApp.React/wwwroot/
Expand Down
4 changes: 3 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.8" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="10.0.8" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="10.0.8" />
<PackageVersion Include="Microsoft.Web.WebView2" Version="1.0.3967.48" />
<PackageVersion Include="Microsoft.Windows.ImplementationLibrary" Version="1.0.260126.7" />
<PackageVersion Include="Microsoft.Playwright" Version="1.60.0" />
<PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="MudBlazor" Version="9.5.0" />
Expand All @@ -38,4 +40,4 @@
<PackageVersion Include="TUnit.Core" Version="1.48.6" />
<PackageVersion Include="TUnit.Playwright" Version="1.48.6" />
</ItemGroup>
</Project>
</Project>
16 changes: 8 additions & 8 deletions docs/docs/migration/photino-breaking-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ This document walks through what changed to help you migrate.
| Native DLL | `Photino.Native` | `InfiniFrame.Native` (internal) |
| C++ class | `Photino` | `InfiniFrameWindow` |
| C++ init params | `PhotinoInitParams` | `InfiniFrameInitParams` |
| Exported function prefix | `Photino_` | `InfiniFrame_` |
| Exported function prefix | `Photino_` | `InfiniFrameNative_` |
| Default window title | `"Photino"` | `"InfiniFrame"` |
| Default user agent | `"Photino WebView"` | `"InfiniFrame WebView"` |
| Default temp path | `%LocalAppData%\Photino` (Windows only) | `%TEMP%\infiniframe` (all platforms) |

Every type that was prefixed `Photino` is now prefixed `InfiniFrame`. If you're calling the native DLL directly via P/Invoke, all exported symbol names need to change from `Photino_*` to `InfiniFrame_*`.
Every type that was prefixed `Photino` is now prefixed `InfiniFrame`. If you're calling the native DLL directly via P/Invoke, all exported symbol names need to change from `Photino_*` to `InfiniFrameNative_*`.

## Entry Point and Builder API

Expand Down Expand Up @@ -288,7 +288,7 @@ static extern void Photino_SetTitle(IntPtr instance, string title);

// InfiniFrame
[LibraryImport("InfiniFrame.Native", ...)]
static partial void InfiniFrame_SetTitle(IntPtr instance, ...);
static partial void InfiniFrameNative_SetTitle(IntPtr instance, ...);
```

### String ownership
Expand All @@ -298,8 +298,8 @@ Photino has no explicit API for freeing native-allocated strings, which causes m
InfiniFrame exports explicit free functions that must be called on any string returned from the native layer:

```csharp
InfiniFrame_FreeString(ptr);
InfiniFrame_FreeStringArray(ptr, count);
InfiniFrameNative_FreeString(ptr);
InfiniFrameNative_FreeStringArray(ptr, count);
```

The managed wrapper calls these automatically. If you're calling native exports directly, you're responsible for invoking them yourself.
Expand All @@ -313,16 +313,16 @@ The native `SaveFileDialog` export gained a `defaultFileName` parameter:
Photino_ShowSaveFile(title, defaultPath, filters, count)

// InfiniFrame
InfiniFrame_ShowSaveFile(title, defaultPath, filters, count, defaultFileName)
InfiniFrameNative_ShowSaveFile(title, defaultPath, filters, count, defaultFileName)
```

## Known Photino Issues Addressed

| Photino Issue | Description | How InfiniFrame addresses it |
|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|
| [photino.native #173/174](https://github.com/tryphotino/photino.native/issues/173) | Custom scheme handlers completely broken on Windows (`WebResourceRequested` never fires) | Rewritten registration path; scheme handlers tested end-to-end in examples |
| [photino.native #165](https://github.com/tryphotino/photino.native/issues/165) | Memory leak in `SendWebMessage` on Windows | Explicit `InfiniFrame_FreeString` ownership model; Pimpl isolates per-window native allocations |
| [photino.native #158](https://github.com/tryphotino/photino.native/issues/158) | No way to programmatically focus a window | `InfiniFrame_SetFocused` / `InfiniFrame_GetFocused` exported and exposed via `IInfiniFrameWindow.Focused` |
| [photino.native #165](https://github.com/tryphotino/photino.native/issues/165) | Memory leak in `SendWebMessage` on Windows | Explicit `InfiniFrameNative_FreeString` ownership model; Pimpl isolates per-window native allocations |
| [photino.native #158](https://github.com/tryphotino/photino.native/issues/158) | No way to programmatically focus a window | `InfiniFrameNative_SetFocused` / `InfiniFrameNative_GetFocused` exported and exposed via `IInfiniFrameWindow.Focused` |
| [photino.native #163](https://github.com/tryphotino/photino.native/issues/163) | UTF encoding bug in `SetWebView2RuntimePath` silently corrupts non-ASCII paths | `simdutf` used for all UTF-8/UTF-16 conversions on Windows |
| [photino.native #141](https://github.com/tryphotino/photino.native/issues/141) | Stack overflow in `WaitForExit` on Linux | Per-window independent message loops; no shared global `MessageLoopState` lock |
| [photino.NET #75](https://github.com/tryphotino/photino.NET/issues/75) | `RegisterWindowClosingHandler` does not fire on Linux | Closing handler rewritten using the GTK `delete-event` signal correctly |
Expand Down
22 changes: 11 additions & 11 deletions native-vendor-deps.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
"assets": [
{
"asset": "simdjson.h",
"destination": "src/InfiniFrame.NativeBridge/Native/Dependencies/simdjson/simdjson.h"
"destination": "src/InfiniFrame.NativeBridge/Native/src/Dependencies/simdjson/simdjson.h"
},
{
"asset": "simdjson.cpp",
"destination": "src/InfiniFrame.NativeBridge/Native/Dependencies/simdjson/simdjson.cpp"
"destination": "src/InfiniFrame.NativeBridge/Native/src/Dependencies/simdjson/simdjson.cpp"
}
],
"source_files": [],
"license_files": [
{
"source": "https://raw.githubusercontent.com/simdjson/simdjson/{tag}/LICENSE",
"destination": "src/InfiniFrame.NativeBridge/Native/Dependencies/simdjson/LICENSE"
"destination": "src/InfiniFrame.NativeBridge/Native/src/Dependencies/simdjson/LICENSE"
}
]
},
Expand All @@ -29,26 +29,26 @@
"assets": [
{
"asset": "simdutf.h",
"destination": "src/InfiniFrame.NativeBridge/Native/Dependencies/simdutf/simdutf.h"
"destination": "src/InfiniFrame.NativeBridge/Native/src/Dependencies/simdutf/simdutf.h"
},
{
"asset": "simdutf.cpp",
"destination": "src/InfiniFrame.NativeBridge/Native/Dependencies/simdutf/simdutf.cpp"
"destination": "src/InfiniFrame.NativeBridge/Native/src/Dependencies/simdutf/simdutf.cpp"
},
{
"asset": "simdutf_c.h",
"destination": "src/InfiniFrame.NativeBridge/Native/Dependencies/simdutf/simdutf_c.h"
"destination": "src/InfiniFrame.NativeBridge/Native/src/Dependencies/simdutf/simdutf_c.h"
}
],
"source_files": [],
"license_files": [
{
"source": "https://raw.githubusercontent.com/simdutf/simdutf/{tag}/LICENSE-MIT",
"destination": "src/InfiniFrame.NativeBridge/Native/Dependencies/simdutf/LICENSE-MIT"
"destination": "src/InfiniFrame.NativeBridge/Native/src/Dependencies/simdutf/LICENSE-MIT"
},
{
"source": "https://raw.githubusercontent.com/simdutf/simdutf/{tag}/LICENSE-APACHE",
"destination": "src/InfiniFrame.NativeBridge/Native/Dependencies/simdutf/LICENSE-APACHE"
"destination": "src/InfiniFrame.NativeBridge/Native/src/Dependencies/simdutf/LICENSE-APACHE"
}
]
},
Expand All @@ -60,17 +60,17 @@
"source_files": [
{
"source": "https://raw.githubusercontent.com/mohabouje/WinToast/{tag}/include/wintoastlib.h",
"destination": "src/InfiniFrame.NativeBridge/Native/Dependencies/wintoastlib/wintoastlib.h"
"destination": "src/InfiniFrame.NativeBridge/Native/src/Dependencies/wintoastlib/wintoastlib.h"
},
{
"source": "https://raw.githubusercontent.com/mohabouje/WinToast/{tag}/src/wintoastlib.cpp",
"destination": "src/InfiniFrame.NativeBridge/Native/Dependencies/wintoastlib/wintoastlib.cpp"
"destination": "src/InfiniFrame.NativeBridge/Native/src/Dependencies/wintoastlib/wintoastlib.cpp"
}
],
"license_files": [
{
"source": "https://raw.githubusercontent.com/mohabouje/WinToast/{tag}/LICENSE.txt",
"destination": "src/InfiniFrame.NativeBridge/Native/Dependencies/wintoastlib/LICENSE.txt"
"destination": "src/InfiniFrame.NativeBridge/Native/src/Dependencies/wintoastlib/LICENSE.txt"
}
]
}
Expand Down
8 changes: 8 additions & 0 deletions src/InfiniFrame.NativeBridge/InfiniFrame.NativeBridge.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="Microsoft.Web.WebView2"
Condition="$([MSBuild]::IsOSPlatform('Windows'))"
PrivateAssets="all"
ExcludeAssets="all" />
<PackageReference Include="Microsoft.Windows.ImplementationLibrary"
Condition="$([MSBuild]::IsOSPlatform('Windows'))"
PrivateAssets="all"
ExcludeAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=managed/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=managed_005Clibraryimports/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=managed_005Clibraryimports/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=managed_005Cnativeapi/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=managed_005Cnativeapi_005Cexports/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=managed_005Cnativeapi_005Ctesting/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
Loading
Loading