[DEV] update ctags
This commit is contained in:
parent
0c6151283b
commit
7acd5127eb
@ -22,16 +22,23 @@ appl::TagFileList::TagFileList(void) {
|
||||
addEventId(applEventCtagsListSelect);
|
||||
addEventId(applEventCtagsListValidate);
|
||||
setMouseLimit(1);
|
||||
// Load color properties: (use file list to be generic ...)
|
||||
m_colorProperty = ewol::resource::ColorFile::keep("THEME:COLOR:ListFileSystem.json");
|
||||
if (m_colorProperty != NULL) {
|
||||
m_colorIdText = m_colorProperty->request("text");
|
||||
m_colorIdBackground1 = m_colorProperty->request("background1");
|
||||
m_colorIdBackground2 = m_colorProperty->request("background2");
|
||||
m_colorIdBackgroundSelected = m_colorProperty->request("selected");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
appl::TagFileList::~TagFileList(void) {
|
||||
for (int32_t iii=0; iii<m_list.size(); iii++) {
|
||||
if (NULL != m_list[iii]) {
|
||||
delete(m_list[iii]);
|
||||
m_list[iii] = NULL;
|
||||
}
|
||||
delete(m_list[iii]);
|
||||
m_list[iii] = NULL;
|
||||
}
|
||||
ewol::resource::ColorFile::release(m_colorProperty);
|
||||
}
|
||||
|
||||
etk::Color<> appl::TagFileList::getBasicBG(void) {
|
||||
@ -61,26 +68,14 @@ bool appl::TagFileList::getElement(int32_t _colomn, int32_t _raw, std::string& _
|
||||
} else {
|
||||
_myTextToWrite = "ERROR";
|
||||
}
|
||||
_fg = etk::color::black;
|
||||
_fg = m_colorProperty->get(m_colorIdText);
|
||||
if (_raw % 2) {
|
||||
if (_colomn%2 == 0) {
|
||||
_bg = 0xFFFFFF00;
|
||||
} else {
|
||||
_bg = 0xFFFFFF10;
|
||||
}
|
||||
_bg = m_colorProperty->get(m_colorIdBackground1);
|
||||
} else {
|
||||
if (_colomn%2 == 0) {
|
||||
_bg = 0xBFBFBFFF;
|
||||
} else {
|
||||
_bg = 0xCFCFCFFF;
|
||||
}
|
||||
_bg = m_colorProperty->get(m_colorIdBackground2);
|
||||
}
|
||||
if (m_selectedLine == _raw) {
|
||||
if (_colomn%2 == 0) {
|
||||
_bg = 0x8F8FFFFF;
|
||||
} else {
|
||||
_bg = 0x7F7FFFFF;
|
||||
}
|
||||
_bg = m_colorProperty->get(m_colorIdBackgroundSelected);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#include <appl/debug.h>
|
||||
#include <ewol/widget/List.h>
|
||||
#include <ewol/resource/ColorFile.h>
|
||||
|
||||
|
||||
extern const char * const applEventCtagsListSelect;
|
||||
@ -35,6 +36,12 @@ namespace appl {
|
||||
private:
|
||||
int32_t m_selectedLine;
|
||||
std::vector<appl::TagListElement*> m_list;
|
||||
protected:
|
||||
ewol::resource::ColorFile* m_colorProperty; //!< theme color property.
|
||||
int32_t m_colorIdText; //!< Color of the text.
|
||||
int32_t m_colorIdBackground1; //!< Color of the Background.
|
||||
int32_t m_colorIdBackground2; //!< Color of the Background 2.
|
||||
int32_t m_colorIdBackgroundSelected; //!< Color of line selected.
|
||||
public:
|
||||
TagFileList(void);
|
||||
~TagFileList(void);
|
||||
|
@ -70,6 +70,18 @@ appl::TextViewer::~TextViewer(void) {
|
||||
appl::ViewerManager::release(m_viewerManager);
|
||||
}
|
||||
|
||||
std::string appl::TextViewer::getBufferPath(void) {
|
||||
if (m_buffer == NULL) {
|
||||
return "";
|
||||
}
|
||||
std::string filename = m_buffer->getFileName();
|
||||
size_t pos = filename.rfind('/');
|
||||
if (pos == std::string::npos) {
|
||||
return "";
|
||||
}
|
||||
return std::string(filename, 0, pos);
|
||||
}
|
||||
|
||||
void appl::TextViewer::changeZoom(float _range) {
|
||||
m_displayText.setFontSize(m_displayText.getSize() + _range);
|
||||
markToRedraw();
|
||||
|
@ -198,6 +198,11 @@ namespace appl {
|
||||
*/
|
||||
bool isSelectedLast(void);
|
||||
public:
|
||||
/**
|
||||
* @brief get the path of the current buffer
|
||||
* @return Path of the buffer (remove the ended name)
|
||||
*/
|
||||
virtual std::string getBufferPath(void);
|
||||
/**
|
||||
* @brief Check if the buffer is availlable
|
||||
* @return true if a display buffer is present, false otherwise.
|
||||
|
@ -177,12 +177,18 @@ bool appl::TextPluginCtags::onReceiveMessage(appl::TextViewer& _textDrawer,
|
||||
ewol::widget::FileChooser* tmpWidget = new ewol::widget::FileChooser();
|
||||
if (NULL == tmpWidget) {
|
||||
APPL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
tmpWidget->setTitle("Open Exuberant Ctags file");
|
||||
tmpWidget->setValidateLabel("Open");
|
||||
ewol::getContext().getWindows()->popUpWidgetPush(tmpWidget);
|
||||
tmpWidget->registerOnEvent(this, "validate", eventOpenCtagsOpenFileReturn);
|
||||
return true;
|
||||
}
|
||||
tmpWidget->setTitle("Open Exuberant Ctags file");
|
||||
tmpWidget->setValidateLabel("Open");
|
||||
// try to get the current folder :
|
||||
std::string path = _textDrawer.getBufferPath();
|
||||
APPL_ERROR("get path : '" << path << "'");
|
||||
if (path != "") {
|
||||
tmpWidget->setFolder(path);
|
||||
}
|
||||
ewol::getContext().getWindows()->popUpWidgetPush(tmpWidget);
|
||||
tmpWidget->registerOnEvent(this, "validate", eventOpenCtagsOpenFileReturn);
|
||||
return true;
|
||||
} else if (_msg.getMessage() == eventJumpDestination) {
|
||||
if (_textDrawer.hasBuffer() == false) {
|
||||
|
@ -16,6 +16,9 @@
|
||||
#include <appl/TextPlugin.h>
|
||||
#include <appl/ctags/readtags.h>
|
||||
|
||||
// create ctags file : "ctags-exuberant --fields=n -R"
|
||||
// --fields=n add the line number needed for this software version ..
|
||||
|
||||
namespace appl {
|
||||
class TextPluginCtags : public appl::TextViewerPlugin {
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user