You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

58 lines
1.6 KiB

#ifndef BROWSER_H
#define BROWSER_H
#include "graphics/opengl/Window.h"
#include "graphics/components/Component.h"
#include "graphics/components/DocumentComponent.h"
#include "graphics/components/ComponentBuilder.h"
#include "html/Node.h"
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <memory>
#include <vector>
#include <algorithm>
#include "networking/HTTPResponse.h"
#include "URL.h"
#include "graphics/opengl/Window.h"
// this is the actually application that
// contains a list of windows
// separate window functions from browser functions
class Browser {
private:
public:
Browser();
void addWindow();
void render();
void loop();
std::shared_ptr<DocumentComponent> getActiveDocumentComponent();
void navTo(std::string url);
// properties
std::vector<std::shared_ptr<Window>> windows;
Window *activeWindow = nullptr;
size_t windowCounter = 0;
std::shared_ptr<Node> domRootNode = nullptr;
bool domDirty = false;
bool renderDirty = true;
//bool uiSetUp = false;
std::shared_ptr<Component> rootComponent = std::make_shared<Component>();
// I hate doing this but we currently require this
std::shared_ptr<Component> tabComponent = nullptr;
std::shared_ptr<Component> addressComponent = nullptr;
// could break these out in some sort of cursor class
// to minimize dependencies
std::shared_ptr<Component> focusedComponent = nullptr;
std::shared_ptr<Component> hoverComponent = nullptr;
URL currentURL;
};
//bool setWindowContent(URL const& url);
//void handleRequest(const HTTPResponse &response);
#endif