-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui/webview): expose load_url method (#29)
Signed-off-by: Tony Gorez <[email protected]>
- Loading branch information
Showing
3 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
#ifndef SOURCEMETA_NATIVE_UI_WINDOW_WIN32_H | ||
#define SOURCEMETA_NATIVE_UI_WINDOW_WIN32_H | ||
|
||
#include "window.h" | ||
|
||
#include <type_traits> | ||
|
||
namespace sourcemeta::native { | ||
|
||
// Platform-specific implementation of add_impl for Windows | ||
template <typename T> void add_impl(Window &window, T &child) { | ||
if constexpr (requires { child.attachToWindow(window); }) { | ||
child.attachToWindow(window); | ||
} | ||
} | ||
|
||
// Define the template add function here in the platform-specific header | ||
template <typename T> void Window::add(T &child) { | ||
add_impl(*this, child); // Forward to platform-specific implementation | ||
} | ||
|
||
} // namespace sourcemeta::native | ||
|
||
#endif |