mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 22:02:49 -06:00
- Assist/Autocomplete refactored to use libclang Other minor changes: - Removed CoWork Pipe - .dli runtime loading of dynamic libraries now supports path to library in access function - EditField::SetBackground - RichTextView::GotoLabel variant with Gate for matching - RichEdit::GotoLabel variant with Gate for matching
48 lines
1.2 KiB
C++
48 lines
1.2 KiB
C++
#include <ide/ide.h>
|
|
|
|
bool IsTopicFile(const char *path)
|
|
{
|
|
return ToLower(GetFileExt(path)) == ".tpp" && FileExists(path);
|
|
}
|
|
|
|
bool IsTopicGroup(const char *path)
|
|
{
|
|
return ToLower(GetFileExt(path)) == ".tpp" && (!IsFullPath(path) || !FileExists(path));
|
|
}
|
|
|
|
struct TopicModule : public IdeModule {
|
|
virtual String GetID() { return "TopicModule"; }
|
|
|
|
virtual Image FileIcon(const char *path) {
|
|
return IsTopicFile(path) ? TopicImg::Topic() : IsTopicGroup(path) ? TopicImg::Group() : Null;
|
|
}
|
|
virtual IdeDesigner *CreateDesigner(const char *path, byte cs) {
|
|
if(IsTopicGroup(path)) {
|
|
TopicEditor *d = new TopicEditor;
|
|
d->PersistentFindReplace(TheIde()->IsPersistentFindReplace());
|
|
d->Open(path);
|
|
return d;
|
|
}
|
|
if(IsTopicFile(path)) {
|
|
TopicEditor *d = new TopicEditor;
|
|
d->PersistentFindReplace(TheIde()->IsPersistentFindReplace());
|
|
d->OpenFile(path);
|
|
return d;
|
|
}
|
|
return NULL;
|
|
}
|
|
virtual void Serialize(Stream& s) {
|
|
TopicEditor::SerializeEditPos(s);
|
|
}
|
|
};
|
|
|
|
void InitializeTopicModule()
|
|
{
|
|
RegisterIdeModule(Single<TopicModule>());
|
|
}
|
|
|
|
INITIALIZER(CodeBase)
|
|
{
|
|
void InitializeTopicModule();
|
|
InitializeTopicModule();
|
|
}
|