Browse Source

new elements, plist to make macbook pros happy

pull/1/head
Odilitime 5 years ago
parent
commit
8d9d3fd92b
  1. 12
      src/graphics/elements/DIVElement.cpp
  2. 15
      src/graphics/elements/DIVElement.h
  3. 16
      src/graphics/elements/STRONGElement.cpp
  4. 15
      src/graphics/elements/STRONGElement.h
  5. 14
      xcode/info.plist

12
src/graphics/elements/DIVElement.cpp

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
#include "DIVElement.h"
std::unique_ptr<Component> DIVElement::renderer(const std::shared_ptr<Node> node, const int x, const int y, const int windowWidth, const int windowHeight) {
TextNode *textNode = dynamic_cast<TextNode*>(node.get());
if (textNode) {
//if (node->parent->children.size() == 1) {
std::unique_ptr<Component> component = std::make_unique<TextComponent>(textNode->text, x, y, 12, false, 0x000000FF, windowWidth, windowHeight);
return component;
//}
}
return nullptr;
}

15
src/graphics/elements/DIVElement.h

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
#ifndef DIVELEMENT_H
#define DIVELEMENT_H
#include "Element.h"
#include "../components/Component.h"
#include "../components/TextComponent.h"
#include "../../html/TextNode.h"
class DIVElement : public Element {
public:
//DIVElement();
virtual std::unique_ptr<Component> renderer(const std::shared_ptr<Node> node, const int x, const int y, const int windowWidth, const int windowHeight);
};
#endif

16
src/graphics/elements/STRONGElement.cpp

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
#include "STRONGElement.h"
STRONGElement::STRONGElement() {
isInline = true;
}
std::unique_ptr<Component> STRONGElement::renderer(const std::shared_ptr<Node> node, const int x, const int y, const int windowWidth, const int windowHeight) {
TextNode *textNode = dynamic_cast<TextNode*>(node.get());
if (textNode) {
//if (node->parent->children.size() == 1) {
std::unique_ptr<Component> component = std::make_unique<TextComponent>(textNode->text, x, y, 12, true, 0x000000FF, windowWidth, windowHeight);
return component;
//}
}
return nullptr;
}

15
src/graphics/elements/STRONGElement.h

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
#ifndef STRONGELEMENT_H
#define STRONGELEMENT_H
#include "Element.h"
#include "../components/Component.h"
#include "../components/TextComponent.h"
#include "../../html/TextNode.h"
class STRONGElement : public Element {
public:
STRONGElement();
virtual std::unique_ptr<Component> renderer(const std::shared_ptr<Node> node, const int x, const int y, const int windowWidth, const int windowHeight);
};
#endif

14
xcode/info.plist

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
info.plist
Saltasaurus
Created by Admin on 7/22/17.
Copyright (c) 2017 RetroTech. All rights reserved.
-->
<plist version="1.0">
<dict>
</dict>
</plist>
Loading…
Cancel
Save