Browse Source

Removed, preparing for front-end breakout

master
despair 5 years ago
parent
commit
2f65463ac2
  1. 1000
      src/graphics/opengl/TextWindow.cpp
  2. 80
      src/graphics/opengl/TextWindow.h

1000
src/graphics/opengl/TextWindow.cpp

File diff suppressed because it is too large Load Diff

80
src/graphics/opengl/TextWindow.h

@ -1,80 +0,0 @@ @@ -1,80 +0,0 @@
#ifndef TEXTWINDOW_H
#define TEXTWINDOW_H
#include "../components/ComponentBuilder.h"
#include "../components/Component.h"
#include "ShaderLoader.h"
#include "../../html/Node.h"
#include "Window.h"
#include <memory>
#include <vector>
#include <algorithm>
#include "../../networking/HTTPResponse.h"
#include "../../URL.h"
class TextWindow : public Window {
private:
public:
~TextWindow();
bool init();
void render();
void setDOM(const std::shared_ptr<Node> rootNode);
void createComponentTree(const std::shared_ptr<Node> rootNode, const std::shared_ptr<Component> &parentComponent);
void renderComponentType(std::string str, std::shared_ptr<Component> component);
void onResize(int passedWidth, int passedHeight);
void checkForResize();
void resize();
void resizeComponentTree(const std::shared_ptr<Component> &component, const int windowWidth, const int windowHeight);
std::shared_ptr<Component> searchComponentTree(const std::shared_ptr<Component> &component, const int x, const int y);
void navTo(std::string url);
// properties
int maxTextureSize = 0;
float transformMatrix[16] = {
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1
};
bool transformMatrixDirty = true;
GLFWwindow *window;
int windowWidth;
int windowHeight;
//std::shared_ptr<Node> domRootNode = nullptr;
bool domDirty = false;
bool renderDirty = true;
ComponentBuilder componentBuilder;
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;
double cursorX = 0;
double cursorY = 0;
unsigned int delayResize = 0;
GLFWcursor* cursorHand;
GLFWcursor* cursorArrow;
GLFWcursor* cursorIbeam;
URL currentURL;
ShaderLoader shaderLoader;
// is there only one selection per window? (probably not)
int highlightStartX = 0;
int highlightStartY = 0;
std::vector<std::shared_ptr<Component>> selectionList;
};
bool setWindowContent(URL const& url);
void handleRequest(const HTTPResponse &response);
extern const std::unique_ptr<Window> window;
#endif
Loading…
Cancel
Save