rodecomp/Source/Client/Browser/BrowserWindowSizing.cpp
ragnarok-clanker d842cee831 Maintenance: [forced, user-approved] Collapse the Browser port's adapter structs into the original code (follow-up to 30cdd441). Evid
Batch #10110 by ragnarok-clanker: forced by an admin (0 lower score(s), 40 changed function(s)); checked with 495 compiled unit(s), including every includer of Source/Client/Application/ApplicationActivation.h, Source/Client/Application/Launcher.h, Source/Client/Browser/BrowserClientSite.h, Source/Client/Browser/BrowserPopupDispatch.h, Source/Client/Browser/WebBrowser.h, Source/Client/Browser/WebEventReceiver.h, Source/Client/Mode/CLoginMode.h, Source/Client/Mode/CMode.h, Source/Client/Mode/ModeTooltip.h, Source/UI/Window/UIWindowMgr.h, Source/Client/Browser/BrowserAddressBar.h, Source/Client/Browser/BrowserAddressEdit.h, Source/Client/Browser/BrowserClose.h, Source/Client/Browser/BrowserCreation.h, Source/Client/Browser/BrowserCursor.h, Source/Client/Browser/BrowserFactory.h, Source/Client/Browser/BrowserFrame.h, Source/Client/Browser/BrowserHostWindow.h, Source/Client/Browser/BrowserInputHandoff.h, Source/Client/Browser/BrowserInterface.h, Source/Client/Browser/BrowserMessages.h, Source/Client/Browser/BrowserRegistry.h, Source/Client/Browser/BrowserSiteAttachment.h, Source/Client/Browser/BrowserWindowSizing.h, Source/UI/Window/WindowFrameUpdate.h.
Deletes: Source/Client/Browser/BrowserAddressBar.h, Source/Client/Browser/BrowserAddressEdit.h, Source/Client/Browser/BrowserClose.h, Source/Client/Browser/BrowserCreation.h, Source/Client/Browser/BrowserCursor.h, Source/Client/Browser/BrowserFactory.h, Source/Client/Browser/BrowserFrame.h, Source/Client/Browser/BrowserHostWindow.h, Source/Client/Browser/BrowserInputHandoff.h, Source/Client/Browser/BrowserInterface.h, Source/Client/Browser/BrowserMessages.h, Source/Client/Browser/BrowserRegistry.h, Source/Client/Browser/BrowserSiteAttachment.h, Source/Client/Browser/BrowserWindowSizing.h, Source/UI/Window/WindowFrameUpdate.h
2026-11-02 16:41:37 +00:00

77 lines
2 KiB
C++

#include "Client/Browser/WebBrowser.h"
// OFFSET: 0x00AB3060
// FUNCTION: fn_17421
void CWebBrowser::Resize(int requestedWidth, int requestedHeight) {
if (!this->browser) {
return;
}
this->width = requestedWidth == this->screenWidth ? requestedWidth - 1 : requestedWidth;
int height = requestedHeight == this->screenHeight ? requestedHeight - 1 : requestedHeight;
if (this->rebar && this->auxiliaryVisible != 0) {
RECT rectangle;
GetClientRect(this->rebar, &rectangle);
height -= (rectangle.bottom - rectangle.top + 4);
}
this->height = height;
this->browser->put_Width(this->width);
this->browser->put_Height(this->height);
if (this->rebar) {
SetWindowPos(this->rebar, nullptr, 0, 0, requestedWidth, requestedHeight, SWP_NOMOVE);
}
}
// OFFSET: 0x00AB2260
// FUNCTION: fn_45430
void CWebBrowser::RefreshSize() {
long width = 0;
long height = 0;
this->browser->get_Width(&width);
this->browser->get_Height(&height);
if (width != this->width || height != this->height) {
this->Resize(this->width, this->height);
}
}
// OFFSET: 0x00AB3120
// FUNCTION: fn_17422
void CWebBrowser::ShowAuxiliary(unsigned char value) {
if (!this->browser) {
return;
}
this->auxiliaryVisible = value;
if (!this->rebar) {
return;
}
this->browser->put_Visible(VARIANT_FALSE);
ShowWindow(this->rebar, this->auxiliaryVisible != 0 ? SW_SHOW : SW_HIDE);
if (this->externalEvents) {
RECT rectangle;
GetWindowRect(this->host, &rectangle);
POINT origin{};
ClientToScreen(this->host, &origin);
this->browser->put_Left(-origin.x);
}
long top = 0;
if (this->rebar && this->auxiliaryVisible != 0) {
RECT rectangle;
GetClientRect(this->rebar, &rectangle);
top = rectangle.bottom - rectangle.top + 4;
}
this->browser->put_Top(top);
RECT rectangle;
GetClientRect(this->host, &rectangle);
this->Resize(rectangle.right - rectangle.left, rectangle.bottom - rectangle.top);
this->browser->put_Visible(VARIANT_TRUE);
}