mitiru::cef

CEF (Chromium Embedded Framework) host: process management, render-handler, V8 bindings, and asset routing.

CEF (Chromium Embedded Framework) host: process management, render-handler, V8 bindings, and asset routing.

NameKindItems
AudioBridgeStateclass9
MitiruCefAppclass9
MitiruCefBridgeclass7
MitiruCefBrowserclass15
MitiruCefClientclass18
MitiruCefContextclass37
MitiruCefContextMenuHandlerclass2
MitiruCefDisplayHandlerclass2
MitiruCefInputclass2
MitiruCefLifeSpanHandlerclass6
MitiruCefLoadHandlerclass8
MitiruCefRenderHandlerclass13
MitiruCefTextureclass19
BodyEntrystruct2
WorldSlotstruct7
PhysicsBridgeStateclass10
PhysicsBridgeStateclass8
SaveStoreclass10
Transitionenum5
CefTransitionDepsstruct3
SceneTransitionStateclass9
StateStoreclass16

Free functions and typedefs

`using RegisterHandlerFn = std::function<void( std::string , std::function<std::string(std::string_view )> )>;`
inline std::pair<std::string_view, std::string_view> splitPipe(std::string_view s)
inline float parseFloatOr(std::string_view s, float defaultValue)
inline audio::SoundCategory parseCategory(std::string_view s)
inline std::shared_ptr<AudioBridgeState> bindAudioBridge( RegisterHandlerFn registerHandler, audio::AudioMixer& mixer)
class AudioBridgeState 9
AudioBridgeState(audio::AudioMixer& mixer) noexcept
void playBgm(std::string_view key)
void stopBgm()
void crossFadeBgm(std::string_view key, float durationSec)
void playSe(std::string_view key)
void setCategoryVolume(audio::SoundCategory cat, float volume)
void setMasterVolume(float volume)
[[nodiscard]] std::string currentBgmKey() const
[[nodiscard]] audio::AudioMixer& mixer() noexcept
class MitiruCefApp : public CefApp 9
CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() override
CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() override
void OnRegisterCustomSchemes(CefRawPtr<CefSchemeRegistrar> registrar) override
void OnBeforeCommandLineProcessing( const CefString& process_type, CefRefPtr<CefCommandLine> command_line) override
void OnContextInitialized() override
void OnWebKitInitialized() override
void OnContextCreated( CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefV8Context> context) override
void OnContextReleased( CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefV8Context> context) override
bool OnProcessMessageReceived( CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefProcessId source_process, CefRefPtr<CefProcessMessage> message) override
class MitiruCefBridge : public CefMessageRouterBrowserSide::Handler 7
using HandlerFn = std::function<std::string(std::string_view payload)>;
void registerHandler(const std::string& name, HandlerFn fn)
void unregisterHandler(const std::string& name)
void unregisterAll()
static void executeJavaScript( CefRefPtr<CefBrowser> browser, const std::string& code)
bool OnQuery( CefRefPtr<CefBrowser> , CefRefPtr<CefFrame> , int64_t , const CefString& request, bool , CefRefPtr<Callback> callback) override
void OnQueryCanceled( CefRefPtr<CefBrowser> , CefRefPtr<CefFrame> , int64_t ) override
class MitiruCefBrowser 15
MitiruCefBrowser() = default
bool create( CefRefPtr<MitiruCefClient> client, int width, int height, const std::string& startUrl = "about:blank")
void loadUrl(const std::string& url)
void loadHtml(const std::string& html, const std::string& baseUrl = "about:blank")
void executeJavaScript(const std::string& code)
void resize(int width, int height)
void close()
void setFocus(bool focused)
void claimKeyboardFocus()
[[nodiscard]] CefRefPtr<CefBrowser> browser() const
[[nodiscard]] CefBrowserHost* host() const
[[nodiscard]] bool isValid() const
[[nodiscard]] int width() const
[[nodiscard]] int height() const
void onClosed()
class MitiruCefClient : public CefClient 18
MitiruCefClient()
~MitiruCefClient()
[[nodiscard]] MitiruCefRenderHandler* renderHandler() const
[[nodiscard]] MitiruCefLoadHandler* loadHandler() const
[[nodiscard]] MitiruCefLifeSpanHandler* lifespanHandler() const
[[nodiscard]] std::shared_ptr<MitiruCefBridge> bridge() const
CefRefPtr<CefRenderHandler> GetRenderHandler() override
CefRefPtr<CefLoadHandler> GetLoadHandler() override
CefRefPtr<CefLifeSpanHandler> GetLifeSpanHandler() override
CefRefPtr<CefDisplayHandler> GetDisplayHandler() override
CefRefPtr<CefContextMenuHandler> GetContextMenuHandler() override
CefRefPtr<CefRequestHandler> GetRequestHandler() override
bool OnProcessMessageReceived( CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefProcessId , CefRefPtr<CefProcessMessage> message) override
void onBrowserCreated(CefRefPtr<CefBrowser> )
bool OnBeforeBrowse( CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefRequest> , bool , bool ) override
inline CefSettings buildCefSettings( const std::filesystem::path& exeDir, const std::string& helperExeName = "MitiruCefHelper.exe", const std::string& logPath = "", int remoteDebuggingPort = 0)
inline void buildWindowInfo(CefWindowInfo& wi, int , int )
inline CefBrowserSettings buildBrowserSettings(bool bgTransparent = true)
class MitiruCefContext 37
using HandlerFn = MitiruCefBridge::HandlerFn;
MitiruCefContext() = default
~MitiruCefContext() = default
MitiruCefContext(const MitiruCefContext&) = delete
MitiruCefContext& operator=(const MitiruCefContext&) = delete
MitiruCefContext(MitiruCefContext&&) = delete
MitiruCefContext& operator=(MitiruCefContext&&) = delete
bool initialize( mitiru::gfx::Dx12Device& device, const std::string& exeDir, const std::string& logPath, int width, int height, const std::string& startUrl = "about:blank", int remoteDebuggingPort = 0)
void shutdown()
void doMessageLoopWork()
[[nodiscard]] bool hasDirtyFrame() const
void upload()
void composite( mitiru::gfx::Dx12Device& device, int width, int height)
void setWindowlessFrameRate(int fps)
[[nodiscard]] int windowlessFrameRate() const noexcept
[[nodiscard]] PaintStats paintStats() const noexcept
void setVisible(bool visible) noexcept
[[nodiscard]] bool isVisible() const noexcept
void handleInput(const InputState& input)
void setInputEnabled(bool enabled)
[[nodiscard]] bool isInputEnabled() const noexcept
void setAutoFocusOnFirstPaint(bool enable) noexcept
[[nodiscard]] bool autoFocusOnFirstPaint() const noexcept
[[nodiscard]] MitiruCefBrowser& browser() noexcept
[[nodiscard]] const MitiruCefBrowser& browser() const noexcept
void loadUrl(const std::string& url)
void loadHtml(const std::string& html, const std::string& baseUrl = "about:blank")
void executeJavaScript(const std::string& code)
void registerHandler(const std::string& name, HandlerFn fn)
void unregisterHandler(const std::string& name)
void setLoadEndCallback(std::function<void(std::string_view )> cb)
void unregisterAll()
void resize( mitiru::gfx::Dx12Device& device, int width, int height)
[[nodiscard]] bool isInitialized() const
[[nodiscard]] bool isLoading() const
[[nodiscard]] bool hasError() const
[[nodiscard]] CefRefPtr<CefBrowser> rawBrowser() const
class MitiruCefContextMenuHandler : public CefContextMenuHandler 2
MitiruCefContextMenuHandler() = default
void OnBeforeContextMenu( CefRefPtr<CefBrowser> , CefRefPtr<CefFrame> , CefRefPtr<CefContextMenuParams> , CefRefPtr<CefMenuModel> model) override
class MitiruCefDisplayHandler : public CefDisplayHandler 2
MitiruCefDisplayHandler() = default
bool OnConsoleMessage( CefRefPtr<CefBrowser> , cef_log_severity_t level, const CefString& message, const CefString& source, int line) override
class MitiruCefInput 2
MitiruCefInput() = default
void update(CefBrowserHost* host, const InputState& input)
class MitiruCefLifeSpanHandler : public CefLifeSpanHandler 6
MitiruCefLifeSpanHandler() = default
[[nodiscard]] CefRefPtr<CefBrowser> browser() const
[[nodiscard]] bool isCreated() const noexcept
void OnAfterCreated(CefRefPtr<CefBrowser> browser) override
bool DoClose(CefRefPtr<CefBrowser> ) override
void OnBeforeClose(CefRefPtr<CefBrowser> ) override
class MitiruCefLoadHandler : public CefLoadHandler 8
MitiruCefLoadHandler() = default
[[nodiscard]] bool isLoading() const noexcept
[[nodiscard]] bool hasError() const noexcept
[[nodiscard]] int errorCode() const noexcept
void setOnLoadEndCallback(std::function<void(std::string_view )> cb)
void OnLoadStart( CefRefPtr<CefBrowser> , CefRefPtr<CefFrame> , TransitionType ) override
void OnLoadEnd( CefRefPtr<CefBrowser> , CefRefPtr<CefFrame> frame, int ) override
void OnLoadError( CefRefPtr<CefBrowser> , CefRefPtr<CefFrame> , ErrorCode errorCode, const CefString& , const CefString& ) override
class MitiruCefRenderHandler : public CefRenderHandler 13
void setSize(int width, int height)
int width() const noexcept
int height() const noexcept
[[nodiscard]] bool isDirty() const noexcept
[[nodiscard]] bool hasEverPainted() const noexcept
Frame takePixels()
void GetViewRect(CefRefPtr<CefBrowser> , CefRect& rect) override
void OnPaint( CefRefPtr<CefBrowser> , PaintElementType type, const RectList& dirtyRects, const void* buffer, int width, int height) override
bool GetScreenInfo(CefRefPtr<CefBrowser> , CefScreenInfo& info) override
[[nodiscard]] uint64_t paintCount() const noexcept
[[nodiscard]] uint64_t totalPaintNanos() const noexcept
[[nodiscard]] uint64_t lastPaintBytes() const noexcept
[[nodiscard]] uint64_t lastDirtyArea() const noexcept
class MitiruCefTexture 19
MitiruCefTexture() = default
~MitiruCefTexture()
MitiruCefTexture(const MitiruCefTexture&) = delete
MitiruCefTexture& operator=(const MitiruCefTexture&) = delete
bool initialize(gfx::Dx12Device& device, int width, int height)
[[nodiscard]] bool isInitialized() const noexcept
void resize(gfx::Dx12Device& , int width, int height)
void upload(const uint8_t* data, int width, int height)
void uploadPartial( const uint8_t* data, int width, int height, std::span<const CefRect> dirtyRects)
void composite(D3D12_CPU_DESCRIPTOR_HANDLE rtvHandle, int w, int h)
using json = ::nlohmann::json;
`using RegisterHandlerFn = std::function<void( std::string , std::function<std::string(std::string_view )> )>;`
inline float getFloat(const json& j, const char* key, float defaultVal)
inline uint64_t getU64(const json& j, const char* key)
inline std::string getString(const json& j, const char* key)
inline json parsePayload(std::string_view payload)
inline std::string errInvalidPayload()
inline std::string errUnknownWorld()
inline std::shared_ptr<PhysicsBridgeState> bindPhysicsBridge( RegisterHandlerFn registerHandler)
struct BodyEntry 2
b2BodyId nativeId
std::string userData
struct WorldSlot 7
physics::Box2DWorld world
std::unordered_map<uint64_t, BodyEntry> bodies
explicit WorldSlot(float gx, float gy)
WorldSlot(const WorldSlot&) = delete
WorldSlot& operator=(const WorldSlot&) = delete
WorldSlot(WorldSlot&&) = default
WorldSlot& operator=(WorldSlot&&) = default
class PhysicsBridgeState 10
PhysicsBridgeState() = default
PhysicsBridgeState(const PhysicsBridgeState&) = delete
PhysicsBridgeState& operator=(const PhysicsBridgeState&) = delete
std::string handleCreateWorld(std::string_view payload)
std::string handleDestroyWorld(std::string_view payload)
std::string handleCreateCircle(std::string_view payload)
std::string handleCreateStaticEdge(std::string_view payload)
std::string handleDestroyBody(std::string_view payload)
std::string handleSetLinearVelocity(std::string_view payload)
std::string handlePoll(std::string_view payload)
class PhysicsBridgeState 8
PhysicsBridgeState() = default
std::string handleCreateWorld (std::string_view) const
std::string handleDestroyWorld (std::string_view) const
std::string handleCreateCircle (std::string_view) const
std::string handleCreateStaticEdge (std::string_view) const
std::string handleDestroyBody (std::string_view) const
std::string handleSetLinearVelocity(std::string_view) const
std::string handlePoll (std::string_view) const
class SaveStore 10
using json = ::nlohmann::json;
SaveStore(StateStore& store, Config cfg)
SaveStore(const SaveStore&) = delete
SaveStore& operator=(const SaveStore&) = delete
SaveStore(SaveStore&&) = delete
SaveStore& operator=(SaveStore&&) = delete
~SaveStore()
[[nodiscard]] const std::filesystem::path& dir() const noexcept
[[nodiscard]] std::size_t maxSlots() const noexcept
[[nodiscard]] std::size_t maxFileBytes() const noexcept
enum Transition 5
None
Fade
Dissolve
[[nodiscard]] inline std::shared_ptr<SceneTransitionState> bindSceneTransition(const CefTransitionDeps& deps)
inline void transitionTo( const CefTransitionDeps& deps, const std::shared_ptr<SceneTransitionState>& state, const std::string& url, Transition kind = Transition::Fade, int durationMs = 500)
struct CefTransitionDeps 3
std::function<void(std::string_view js)> executeJs
std::function<void(std::string_view url)> loadUrl
std::function<void( std::string_view name, std::function<std::string(std::string_view payload)> fn)> registerHandler
class SceneTransitionState 9
SceneTransitionState() = default
SceneTransitionState(const SceneTransitionState&) = delete
SceneTransitionState& operator=(const SceneTransitionState&) = delete
void beginTransition( const CefTransitionDeps& deps, std::string url, Transition kind, int durationMs)
std::string handleSceneNext(const CefTransitionDeps& deps, std::string_view )
void onLoadEnd(const CefTransitionDeps& deps, std::string_view url)
void cancelPending()
[[nodiscard]] std::string pendingUrl() const
using json = ::nlohmann::json;
class StateStore 16
using ActionFn = std::function<json(const json& payload)>;
using ExecuteJsFn = std::function<void(const std::string& code)>;
using HandlerFn = std::function<std::string(std::string_view payload)>;
using RegisterHandlerFn = std::function<void(const std::string& name, HandlerFn fn)>;
StateStore(ExecuteJsFn executeJs, RegisterHandlerFn registerHandler)
StateStore(const StateStore&) = delete
StateStore& operator=(const StateStore&) = delete
template <typename T> void set(std::string_view key, const T& value)
template <typename T> [[nodiscard]] std::optional<T> get(std::string_view key) const
[[nodiscard]] std::optional<json> getJson(std::string_view key) const
[[nodiscard]] bool has(std::string_view key) const
void clearState()
void emit(std::string_view eventName, const json& payload = json::object())
void onAction(std::string_view action, ActionFn fn)
void offAction(std::string_view action)
std::string dispatchFromJson(std::string_view payloadJson) const

Sourced from docs/API_CATALOG.md, auto-generated by tools/generate_api_catalog.py.