Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
dx8webbrowser.h
Go to the documentation of this file.
1/*
2** Command & Conquer Generals Zero Hour(tm)
3** Copyright 2025 Electronic Arts Inc.
4**
5** This program is free software: you can redistribute it and/or modify
6** it under the terms of the GNU General Public License as published by
7** the Free Software Foundation, either version 3 of the License, or
8** (at your option) any later version.
9**
10** This program is distributed in the hope that it will be useful,
11** but WITHOUT ANY WARRANTY; without even the implied warranty of
12** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13** GNU General Public License for more details.
14**
15** You should have received a copy of the GNU General Public License
16** along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19//******************************************************************************************
20//
21// Earth And Beyond
22// Copyright (c) 2002 Electronic Arts , Inc. - Westwood Studios
23//
24// File Name : dx8webbrowser.h
25// Description : Implementation of D3D Embedded Browser Wrapper
26// Author : Darren Schueller
27// Date of Creation : 6/4/2002
28//
29//******************************************************************************************
30// $Header: $
31//******************************************************************************************
32
33#ifndef DX8_WEBBROWSER_H
34#define DX8_WEBBROWSER_H
35
36#include <windows.h>
37#include "d3d8.h"
38
39// ***********************************
40// Set this to 0 to remove all embedded browser code.
41//
42#define ENABLE_EMBEDDED_BROWSER 1
43//
44// ***********************************
45
46#if ENABLE_EMBEDDED_BROWSER
47
48// These options must match the browser option bits defined in the BrowserEngine code.
49// Look in febrowserengine.h
50#define BROWSEROPTION_SCROLLBARS 0x0001
51#define BROWSEROPTION_3DBORDER 0x0002
52
53struct IDirect3DDevice8;
54
61{
62public:
63
64 static bool Initialize( const char* badpageurl = 0,
65 const char* loadingpageurl = 0,
66 const char* mousefilename = 0,
67 const char* mousebusyfilename = 0); //Initialize the Embedded Browser
68
69 static void Shutdown(void); // Shutdown the embedded browser. Will close any open browsers.
70
71 static void Update(void); // Copies all browser contexts to D3D Image surfaces.
72 static void Render(int backbufferindex); //Draws all browsers to the backbuffer.
73
74 // Creates a browser with the specified name
75 static void CreateBrowser(const char* browsername, const char* url, int x, int y, int w, int h, int updateticks = 0, LONG options = BROWSEROPTION_SCROLLBARS | BROWSEROPTION_3DBORDER, LPDISPATCH gamedispatch = 0);
76
77 // Destroys the browser with the specified name
78 static void DestroyBrowser(const char* browsername);
79
80 // Returns true if a browser with the specified name is open.
81 static bool Is_Browser_Open(const char* browsername);
82
83 // Navigates the specified browser to the specified page.
84 static void Navigate(const char* browsername, const char* url);
85
86private:
87 // The window handle of the application. This is initialized by Initialize().
88 static HWND hWnd;
89};
90
91#endif
92
93#endif
static void DestroyBrowser(const char *browsername)
static void CreateBrowser(const char *browsername, const char *url, int x, int y, int w, int h, int updateticks=0, LONG options=BROWSEROPTION_SCROLLBARS|BROWSEROPTION_3DBORDER, LPDISPATCH gamedispatch=0)
static void Render(int backbufferindex)
static void Update(void)
static bool Is_Browser_Open(const char *browsername)
static bool Initialize(const char *badpageurl=0, const char *loadingpageurl=0, const char *mousefilename=0, const char *mousebusyfilename=0)
static void Navigate(const char *browsername, const char *url)
static void Shutdown(void)
#define BROWSEROPTION_3DBORDER
#define BROWSEROPTION_SCROLLBARS