kakoune/src/client_manager.hh

44 lines
1009 B
C++
Raw Normal View History

#ifndef client_manager_hh_INCLUDED
#define client_manager_hh_INCLUDED
2013-09-12 23:47:23 +02:00
#include "client.hh"
namespace Kakoune
{
struct client_removed{};
class ClientManager : public Singleton<ClientManager>
{
public:
ClientManager();
~ClientManager();
2013-09-12 23:47:23 +02:00
Client* create_client(std::unique_ptr<UserInterface>&& ui,
const String& init_cmd);
bool empty() const { return m_clients.empty(); }
size_t count() const { return m_clients.size(); }
2012-10-31 14:23:44 +01:00
Window& get_unused_window_for_buffer(Buffer& buffer);
void ensure_no_client_uses_buffer(Buffer& buffer);
void redraw_clients() const;
Client* get_client_ifp(const String& name);
2013-09-12 23:47:23 +02:00
Client& get_client(const String& name);
2013-09-13 00:01:47 +02:00
bool validate_client_name(const String& name) const;
2013-09-12 23:47:23 +02:00
void remove_client(Client& client);
private:
String generate_name() const;
2013-09-12 23:47:23 +02:00
std::vector<std::unique_ptr<Client>> m_clients;
std::vector<std::unique_ptr<Window>> m_windows;
};
}
#endif // client_manager_hh_INCLUDED