Batch #12358 by cremane: 0 byte-identical, 1 confirmed by peer review. - fn_17422 CWebBrowser::ShowAuxiliary: logic confirmed by peer review Peer-reviewed-by: Yommy, dori Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
79 lines
2.4 KiB
C++
79 lines
2.4 KiB
C++
#ifndef RAGNAROK_SOURCE_CLIENT_BROWSER_WEBBROWSER_H
|
|
#define RAGNAROK_SOURCE_CLIENT_BROWSER_WEBBROWSER_H
|
|
|
|
#include <windows.h>
|
|
#include <ole2.h>
|
|
#include <exdisp.h>
|
|
#include <string>
|
|
#include <cstddef>
|
|
|
|
class BrowserClientSite;
|
|
|
|
class CWebBrowser {
|
|
public:
|
|
CWebBrowser();
|
|
~CWebBrowser();
|
|
CWebBrowser(const CWebBrowser&) = delete;
|
|
CWebBrowser& operator=(const CWebBrowser&) = delete;
|
|
|
|
bool Create(HWND parent, HINSTANCE instance, int width, int height);
|
|
bool Close();
|
|
bool CreateInterface();
|
|
bool CreateExternalInterface();
|
|
bool AttachExternalEvents();
|
|
bool CreateHostWindow(HWND parent, HINSTANCE instance, int width, int height);
|
|
bool AttachSite();
|
|
void DetachSite();
|
|
bool CreateAddressBar(int width, int height);
|
|
void Resize(int width, int height);
|
|
void RefreshSize();
|
|
int AuxiliaryHeight();
|
|
void Normalize();
|
|
void Poll();
|
|
void SetCursorState(int value);
|
|
void PollCursor();
|
|
void EnterInput();
|
|
void RestoreInput();
|
|
bool Navigate(std::string address);
|
|
void ShowAuxiliary(unsigned char value);
|
|
bool MatchesWindow(HWND window) const;
|
|
int AddressBarHeight();
|
|
|
|
/* 0000 */ IWebBrowser2* browser;
|
|
/* 0004 */ IUnknown* externalEvents;
|
|
/* 0008 */ BrowserClientSite* site;
|
|
/* 000C */ HWND host;
|
|
/* 0010 */ HWND browserWindow;
|
|
/* 0014 */ int cursorState;
|
|
/* 0018 */ unsigned char auxiliaryVisible;
|
|
/* 0019 */ unsigned char unknown_0019[3];
|
|
/* 001C */ int screenWidth;
|
|
/* 0020 */ int screenHeight;
|
|
/* 0024 */ DWORD cookie;
|
|
/* 0028 */ HWND rebar;
|
|
/* 002C */ HWND combo;
|
|
/* 0030 */ int barHeight;
|
|
/* 0034 */ int width;
|
|
/* 0038 */ int height;
|
|
/* 003C */ unsigned char restoreOption;
|
|
/* 003D */ unsigned char unknown_003D[3];
|
|
};
|
|
|
|
extern WNDPROC lpPrevWndFunc;
|
|
|
|
LRESULT CALLBACK BrowserHostProc(HWND window, UINT message, WPARAM value, LPARAM flags);
|
|
LRESULT CALLBACK BrowserAddressEditProc(HWND window, UINT message, WPARAM value, LPARAM flags);
|
|
HRESULT AdviseBrowserEvents(IUnknown* source, IUnknown* sink, REFIID events, DWORD* cookie);
|
|
HRESULT UnadviseBrowserEvents(IUnknown* source, REFIID events, DWORD cookie);
|
|
|
|
enum class BrowserCommand : WORD { Navigate = 1000 };
|
|
|
|
#if defined(_WIN32) && !defined(_WIN64)
|
|
static_assert(offsetof(CWebBrowser, host) == 0xC);
|
|
static_assert(offsetof(CWebBrowser, unknown_0019) == 0x19);
|
|
static_assert(offsetof(CWebBrowser, cookie) == 0x24);
|
|
static_assert(offsetof(CWebBrowser, restoreOption) == 0x3C);
|
|
static_assert(sizeof(CWebBrowser) == 0x40);
|
|
#endif
|
|
|
|
#endif
|