2011-11-29 23:37:20 +01:00
|
|
|
#ifndef highlighter_registry_h_INCLUDED
|
|
|
|
#define highlighter_registry_h_INCLUDED
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <unordered_map>
|
|
|
|
|
|
|
|
#include "highlighter.hh"
|
|
|
|
#include "utils.hh"
|
|
|
|
#include "completion.hh"
|
2011-12-02 15:22:51 +01:00
|
|
|
#include "idvaluemap.hh"
|
2011-11-29 23:37:20 +01:00
|
|
|
|
|
|
|
namespace Kakoune
|
|
|
|
{
|
|
|
|
|
|
|
|
class Window;
|
2012-01-15 14:46:45 +01:00
|
|
|
class HighlighterGroup;
|
2011-11-29 23:37:20 +01:00
|
|
|
|
|
|
|
typedef std::function<HighlighterAndId (Window& window,
|
|
|
|
const HighlighterParameters& params)> HighlighterFactory;
|
|
|
|
|
|
|
|
class HighlighterRegistry : public Singleton<HighlighterRegistry>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void register_factory(const std::string& name,
|
|
|
|
const HighlighterFactory& factory);
|
|
|
|
|
|
|
|
void add_highlighter_to_window(Window& window,
|
|
|
|
const std::string& factory_name,
|
|
|
|
const HighlighterParameters& parameters);
|
|
|
|
|
2012-01-15 14:46:45 +01:00
|
|
|
void add_highlighter_to_group(Window& window,
|
|
|
|
HighlighterGroup& group,
|
|
|
|
const std::string& factory_name,
|
|
|
|
const HighlighterParameters& parameters);
|
|
|
|
|
2011-11-29 23:37:20 +01:00
|
|
|
CandidateList complete_highlighter(const std::string& prefix,
|
|
|
|
size_t cursor_pos);
|
|
|
|
|
|
|
|
private:
|
2011-12-02 15:22:51 +01:00
|
|
|
idvaluemap<std::string, HighlighterFactory> m_factories;
|
2011-11-29 23:37:20 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // highlighter_registry_h_INCLUDED
|