63 lines
1.4 KiB
C++
63 lines
1.4 KiB
C++
#ifndef SPARROWSHELL_H
|
|
#define SPARROWSHELL_H
|
|
|
|
#include <list>
|
|
|
|
#include "system.h"
|
|
#include "scene/scenetree.h"
|
|
#include "glm/vec2.hpp"
|
|
#include "sparrowshell/shellbuffer.h"
|
|
#include "sparrowshell/shellscrollbar.h"
|
|
#include "scene/graphicalcontainernode.h"
|
|
|
|
class Input;
|
|
class MeshNode;
|
|
class TextNode;
|
|
class ShellBuffer;
|
|
|
|
namespace sf {
|
|
class Window;
|
|
}
|
|
|
|
class SparrowShell : public GraphicalContainerNode
|
|
{
|
|
private:
|
|
glm::ivec2 m_position;
|
|
glm::ivec2 m_dimension;
|
|
bool m_shellEnabled = false;
|
|
bool m_resizeBuffer = false;
|
|
bool m_indexMoved = false;
|
|
|
|
MeshNode* m_background;
|
|
ShellBuffer* m_buffer;
|
|
ShellScrollBar* m_scrollbar;
|
|
|
|
public:
|
|
static const unsigned int BUFFER_MAX_LENGTH;
|
|
static const unsigned int BUFFER_DISPLAYED_LINES;
|
|
static const unsigned int SCROLLBAR_PIXEL_WIDTH;
|
|
static const float SHELL_DEPTH;
|
|
static const float DEFAULT_FONT_SIZE;
|
|
|
|
SparrowShell(sf::Window*);
|
|
|
|
void update();
|
|
|
|
void scrollUp();
|
|
void scrollDown();
|
|
|
|
void toggleShell();
|
|
void out(std::string);
|
|
|
|
glm::ivec2 getPosition(){return m_position;}
|
|
glm::ivec2 getDimension(){return m_dimension;}
|
|
|
|
unsigned int getIndex(){return m_buffer->getIndex();}
|
|
ShellBuffer* getBuffer(){return m_buffer;}
|
|
|
|
bool isEnabled(){return m_shellEnabled;}
|
|
bool isBufferResized(){return m_resizeBuffer;}
|
|
bool indexMoved(){return m_indexMoved;}
|
|
};
|
|
#endif // SPARROWSHELL_H
|