aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/Channel.hpp6
-rw-r--r--include/ChannelSidePanel.hpp6
-rw-r--r--include/Chatbar.hpp2
-rw-r--r--include/MessageBoard.hpp2
4 files changed, 12 insertions, 4 deletions
diff --git a/include/Channel.hpp b/include/Channel.hpp
index b70803c..4d1f528 100644
--- a/include/Channel.hpp
+++ b/include/Channel.hpp
@@ -10,17 +10,19 @@ namespace dchat
class Channel
{
public:
- Channel();
+ Channel(const std::string &name);
~Channel();
User* getLocalUser();
MessageBoard& getMessageBoard();
+ const std::string& getName() const;
void processEvent(const sf::Event &event);
- void draw(sf::RenderWindow &window, Cache &cache);
+ void draw(sf::RenderWindow &window, const sf::Vector2f &position, Cache &cache);
private:
MessageBoard messageBoard;
Chatbar chatbar;
OfflineUser localOfflineUser;
+ std::string name;
};
}
diff --git a/include/ChannelSidePanel.hpp b/include/ChannelSidePanel.hpp
index 604dfcf..8331787 100644
--- a/include/ChannelSidePanel.hpp
+++ b/include/ChannelSidePanel.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <vector>
+#include <SFML/Graphics/RenderWindow.hpp>
namespace dchat
{
@@ -9,7 +10,12 @@ namespace dchat
class ChannelSidePanel
{
public:
+ ChannelSidePanel(float width);
void addChannel(Channel *channel);
+
+ void draw(sf::RenderWindow &window);
+
+ float width;
private:
std::vector<Channel*> channels;
};
diff --git a/include/Chatbar.hpp b/include/Chatbar.hpp
index d24b2af..c98db48 100644
--- a/include/Chatbar.hpp
+++ b/include/Chatbar.hpp
@@ -27,7 +27,7 @@ namespace dchat
bool isFocused() const;
void processEvent(const sf::Event &event, Channel *channel);
- void draw(sf::RenderWindow &window);
+ void draw(sf::RenderWindow &window, const sf::Vector2f &position);
private:
sf::Text text;
sf::RectangleShape background;
diff --git a/include/MessageBoard.hpp b/include/MessageBoard.hpp
index ca1405f..523fb16 100644
--- a/include/MessageBoard.hpp
+++ b/include/MessageBoard.hpp
@@ -20,7 +20,7 @@ namespace dchat
void addMessage(Message *message);
void processEvent(const sf::Event &event);
- void draw(sf::RenderWindow &window, Cache &cache);
+ void draw(sf::RenderWindow &window, const sf::Vector2f &position, Cache &cache);
private:
sf::RenderTexture staticContentTexture;
bool dirty;