rodecomp/Source/Client/Browser/BrowserSiteAttachment.cpp
ragnarok-clanker e168b4e4a6 Restore translation-unit ownership and publish verified source corrections
Owner-authorized source migration: 31 helper-only translation units were merged into their callers or existing inline headers; both build manifests updated. Includes the preserved source payload, Lua configuration matching wowdecomp, and exact malloca expansion without diagnostic pragmas.

449 native units compiled locally and 449 staged units compiled by the pinned server toolchain. No previously byte-matched function regressed. Compiler mapping diagnostics remain recorded as needs_cleanup, not accepted or peer-confirmed. Existing independent review records are preserved. README.md is intentionally unchanged.
2026-10-25 15:42:21 +00:00

47 lines
1.5 KiB
C++

#include "Client/Browser/BrowserInterface.h"
#include "Client/Browser/BrowserSiteAttachment.h"
#include <new>
// OFFSET: 0x00AB2AB0
// FUNCTION: fn_17417
bool BrowserSiteAttachment::Attach() {
this->site = new (std::nothrow) BrowserClientSite(this->host, *this->sizing.browser, this->factory, this->renderWidth, this->renderHeight);
IOleObject* object;
HRESULT result = this->sizing.browser->QueryInterface(IID_IOleObject, reinterpret_cast<void**>(&object));
if (FAILED(result)) {
return false;
}
result = object->SetClientSite(this->site);
if (SUCCEEDED(result)) {
OleSetContainedObject(object, TRUE);
RECT rectangle;
GetClientRect(this->host, &rectangle);
result = object->DoVerb(OLEIVERB_INPLACEACTIVATE, nullptr, this->site, 0, this->host, &rectangle);
if (SUCCEEDED(result)) {
const int width = rectangle.right - rectangle.left;
const int height = rectangle.bottom - rectangle.top;
this->sizing.Resize(width, height);
result = AdviseBrowserEvents(object, this->site, DIID_DWebBrowserEvents2, &this->cookie);
}
}
object->Release();
return SUCCEEDED(result);
}
// OFFSET: 0x00AB2430
// FUNCTION: fn_45431
void BrowserSiteAttachment::Detach() {
IOleObject* object;
if (SUCCEEDED(this->sizing.browser->QueryInterface(IID_IOleObject, reinterpret_cast<void**>(&object)))) {
UnadviseBrowserEvents(object, DIID_DWebBrowserEvents2, this->cookie);
object->Release();
}
delete this->site;
this->site = nullptr;
}