2011-11-29 23:37:20 +01:00
|
|
|
#ifndef highlighter_registry_h_INCLUDED
|
|
|
|
#define highlighter_registry_h_INCLUDED
|
|
|
|
|
2012-04-14 03:17:09 +02:00
|
|
|
#include "string.hh"
|
2011-11-29 23:37:20 +01:00
|
|
|
#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:
|
2012-04-14 03:17:09 +02:00
|
|
|
void register_factory(const String& name,
|
2011-11-29 23:37:20 +01:00
|
|
|
const HighlighterFactory& factory);
|
|
|
|
|
2012-01-15 14:46:45 +01:00
|
|
|
void add_highlighter_to_group(Window& window,
|
|
|
|
HighlighterGroup& group,
|
2012-04-14 03:17:09 +02:00
|
|
|
const String& factory_name,
|
2012-01-15 14:46:45 +01:00
|
|
|
const HighlighterParameters& parameters);
|
|
|
|
|
2012-04-14 03:17:09 +02:00
|
|
|
CandidateList complete_highlighter(const String& prefix,
|
2012-08-23 23:56:35 +02:00
|
|
|
CharCount cursor_pos);
|
2011-11-29 23:37:20 +01:00
|
|
|
|
|
|
|
private:
|
2012-04-14 03:17:09 +02:00
|
|
|
idvaluemap<String, HighlighterFactory> m_factories;
|
2011-11-29 23:37:20 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // highlighter_registry_h_INCLUDED
|