Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
45b4dca615 | |||
322120a3f3 | |||
f5993b3f8b | |||
82af3768b0 | |||
4c5f3a0424 | |||
7b303d2aad | |||
ff055b88d4 | |||
55681d1dac | |||
ab74a7c516 | |||
1fa86b3b03 | |||
dbade0e4e6 | |||
356d7621ae | |||
896beaa4fd | |||
7b476ebc49 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -27,6 +27,7 @@ doxygen/ALL/
|
|||||||
*.so
|
*.so
|
||||||
*.pyc
|
*.pyc
|
||||||
edn
|
edn
|
||||||
|
out
|
||||||
edn_debug
|
edn_debug
|
||||||
edn_release
|
edn_release
|
||||||
|
|
||||||
|
47
Makefile
47
Makefile
@@ -34,8 +34,11 @@ export CADRE_COTERS='
$(F_INVERSER) $(F_NORMALE) $(F_INVERSER) $(F_N
|
|||||||
|
|
||||||
VERSION_TAG=$(shell git describe --tags)
|
VERSION_TAG=$(shell git describe --tags)
|
||||||
#$(info $(VERSION_TAG))
|
#$(info $(VERSION_TAG))
|
||||||
|
|
||||||
|
VERSION_TAG_SHORT=$(shell git describe --tags --abbrev=0)
|
||||||
|
#$(info $(VERSION_TAG_SHORT))
|
||||||
|
|
||||||
VERSION_BUILD_TIME=$(shell date)
|
VERSION_BUILD_TIME=$(shell date)
|
||||||
#$(info $(VERSION_BUILD_TIME))
|
#$(info $(VERSION_BUILD_TIME))
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@@ -290,11 +293,43 @@ install: .encadrer .versionFile $(OUTPUT_NAME_RELEASE)
|
|||||||
@echo Remove temporary files *.bck
|
@echo Remove temporary files *.bck
|
||||||
@rm -f `find . -name "*.bck"`
|
@rm -f `find . -name "*.bck"`
|
||||||
|
|
||||||
count:
|
count:
|
||||||
wc -l Makefile `find $(FILE_DIRECTORY)/ -name "*.cpp"` `find $(FILE_DIRECTORY)/ -name "*.h"`
|
wc -l Makefile `find $(FILE_DIRECTORY)/ -name "*.cpp"` `find $(FILE_DIRECTORY)/ -name "*.h"`
|
||||||
|
|
||||||
install: .encadrer .versionFile $(OUTPUT_NAME_RELEASE)
|
install: .encadrer .versionFile $(OUTPUT_NAME_RELEASE)
|
||||||
@echo $(CADRE_HAUT_BAS)
|
@echo $(CADRE_HAUT_BAS)
|
||||||
@echo ' INSTALL : $(F_VIOLET)$(OUTPUT_NAME_RELEASE)=>$(PROG_NAME)$(F_NORMALE)'$(CADRE_COTERS)
|
@echo ' INSTALL : $(F_VIOLET)$(OUTPUT_NAME_RELEASE)=>$(PROG_NAME)$(F_NORMALE)'$(CADRE_COTERS)
|
||||||
@echo $(CADRE_HAUT_BAS)
|
@echo $(CADRE_HAUT_BAS)
|
||||||
|
@echo $(F_ROUGE)"
|
||||||
|
(stripped) $(OUTPUT_NAME_RELEASE) => $(PROG_NAME) "$(F_NORMALE)
|
||||||
|
@cp $(OUTPUT_NAME_RELEASE) $(PROG_NAME)
|
||||||
|
@strip -s $(PROG_NAME)
|
||||||
|
@echo $(F_VERT)"
|
||||||
|
(copy) $(PROG_NAME) /usr/bin/ "$(F_NORMALE)
|
||||||
|
@cp -vf $(PROG_NAME) /usr/bin/
|
||||||
|
@echo $(F_VERT)"
|
||||||
|
(data) data/* ==> /usr/share/edn/ "$(F_NORMALE)
|
||||||
|
@mkdir -p /usr/share/edn/
|
||||||
|
@cp -vf data/*.xml /usr/share/edn/
|
||||||
|
|
||||||
|
|
||||||
|
# http://alp.developpez.com/tutoriels/debian/creer-paquet/
|
||||||
|
package: .encadrer
|
||||||
|
@echo 'Create Folders ...'
|
||||||
|
@mkdir -p package/$(PROG_NAME)/DEBIAN/
|
||||||
|
@mkdir -p package/$(PROG_NAME)/usr/bin/
|
||||||
|
@mkdir -p package/$(PROG_NAME)/usr/share/doc/
|
||||||
|
@mkdir -p package/$(PROG_NAME)/usr/share/edn/
|
||||||
|
# Create the control file
|
||||||
|
@echo "Package: "$(PROG_NAME) > package/$(PROG_NAME)/DEBIAN/control
|
||||||
|
@echo "Version: "$(VERSION_TAG_SHORT) >> package/$(PROG_NAME)/DEBIAN/control
|
||||||
|
@echo "Section: Development,Editors" >> package/$(PROG_NAME)/DEBIAN/control
|
||||||
|
@echo "Priority: optional" >>package/$(PROG_NAME)/DEBIAN/control
|
||||||
|
@echo "Architecture: all" >> package/$(PROG_NAME)/DEBIAN/control
|
||||||
|
@echo "Depends: bash" >> package/$(PROG_NAME)/DEBIAN/control
|
||||||
|
@echo "Maintainer: Mr DUPIN Edouard <yui.heero@gmail.com>" >> package/$(PROG_NAME)/DEBIAN/control
|
||||||
|
@echo "Description: Text editor for sources code with ctags management" >> package/$(PROG_NAME)/DEBIAN/control
|
||||||
|
@echo "" >> package/$(PROG_NAME)/DEBIAN/control
|
||||||
|
# Create the PostRm
|
||||||
|
@echo "#!/bin/bash" > package/$(PROG_NAME)/DEBIAN/postrm
|
||||||
@echo "rm ~/."$(PROG_NAME) >> package/$(PROG_NAME)/DEBIAN/postrm
|
@echo "rm ~/."$(PROG_NAME) >> package/$(PROG_NAME)/DEBIAN/postrm
|
||||||
|
@@ -41,10 +41,12 @@
|
|||||||
*/
|
*/
|
||||||
Buffer::Buffer()
|
Buffer::Buffer()
|
||||||
{
|
{
|
||||||
|
static int32_t fileBasicID = 0;
|
||||||
m_fileModify = true;
|
m_fileModify = true;
|
||||||
m_haveName = false;
|
m_haveName = false;
|
||||||
Edn::String mString = "No-Name";
|
Edn::String mString = "Untitle - ";
|
||||||
m_fileName.SetCompleateName(mString);
|
mString += fileBasicID++;
|
||||||
|
SetFileName(mString);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,11 +57,10 @@ Buffer::Buffer()
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Buffer::Buffer(Edn::String &newFileName)
|
Buffer::Buffer(Edn::File &newName)
|
||||||
{
|
{
|
||||||
m_fileModify = false;
|
m_fileModify = false;
|
||||||
m_haveName = true;
|
SetFileName(newName);
|
||||||
m_fileName.SetCompleateName(newFileName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -95,85 +96,6 @@ void Buffer::SetModify(bool status)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Edn::File Buffer::GetFileName(void)
|
|
||||||
{
|
|
||||||
return m_fileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief
|
|
||||||
*
|
|
||||||
* @param[in,out] ---
|
|
||||||
*
|
|
||||||
* @return ---
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
Edn::String Buffer::GetName(void)
|
|
||||||
{
|
|
||||||
// nothing to do
|
|
||||||
return m_fileName.GetCompleateName();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief
|
|
||||||
*
|
|
||||||
* @param[in,out] ---
|
|
||||||
*
|
|
||||||
* @return ---
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
Edn::String Buffer::GetShortName(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
// nothing to do
|
|
||||||
return m_fileName.GetShortFilename();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief
|
|
||||||
*
|
|
||||||
* @param[in,out] ---
|
|
||||||
*
|
|
||||||
* @return ---
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
Edn::String Buffer::GetFolder(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
// nothing to do
|
|
||||||
return m_fileName.GetFolder();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief
|
|
||||||
*
|
|
||||||
* @param[in,out] ---
|
|
||||||
*
|
|
||||||
* @return ---
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
bool Buffer::HaveName(void)
|
|
||||||
{
|
|
||||||
// nothing to do
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief
|
|
||||||
*
|
|
||||||
* @param[in,out] ---
|
|
||||||
*
|
|
||||||
* @return ---
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void Buffer::SetName(Edn::String &newName)
|
|
||||||
{
|
|
||||||
// nothing to do
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
*
|
*
|
||||||
|
@@ -45,18 +45,38 @@ typedef struct{
|
|||||||
class Buffer {
|
class Buffer {
|
||||||
public:
|
public:
|
||||||
Buffer(void);
|
Buffer(void);
|
||||||
Buffer(Edn::String &filename);
|
Buffer(Edn::File &newName);
|
||||||
virtual ~Buffer(void);
|
virtual ~Buffer(void);
|
||||||
Edn::File GetFileName(void);
|
|
||||||
virtual Edn::String GetName(void);
|
Edn::File GetFileName(void)
|
||||||
virtual Edn::String GetShortName(void);
|
{
|
||||||
virtual Edn::String GetFolder(void);
|
return m_fileName;
|
||||||
virtual void SetName(Edn::String &newName);
|
};
|
||||||
|
|
||||||
|
void SetFileName(Edn::File &newName)
|
||||||
|
{
|
||||||
|
m_fileName = newName;
|
||||||
|
m_haveName = true;
|
||||||
|
NameChange();
|
||||||
|
};
|
||||||
|
|
||||||
|
void SetFileName(Edn::String &newName)
|
||||||
|
{
|
||||||
|
m_fileName.SetCompleateName(newName);
|
||||||
|
m_haveName = true;
|
||||||
|
NameChange();
|
||||||
|
};
|
||||||
|
|
||||||
|
bool HaveName(void)
|
||||||
|
{
|
||||||
|
return m_haveName;
|
||||||
|
}
|
||||||
|
|
||||||
virtual void Save(void);
|
virtual void Save(void);
|
||||||
virtual bool HaveName(void);
|
|
||||||
bool IsModify(void);
|
bool IsModify(void);
|
||||||
protected:
|
protected:
|
||||||
void SetModify(bool status);
|
void SetModify(bool status);
|
||||||
|
virtual void NameChange(void) { /*EDN_DEBUG("check name change ==> no HL change possible");*/};
|
||||||
public:
|
public:
|
||||||
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate);
|
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate);
|
||||||
virtual void SetLineDisplay(uint32_t lineNumber);
|
virtual void SetLineDisplay(uint32_t lineNumber);
|
||||||
@@ -88,8 +108,9 @@ class Buffer {
|
|||||||
virtual void JumpAtLine(int32_t newLine);
|
virtual void JumpAtLine(int32_t newLine);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool m_fileModify;
|
bool m_fileModify; //!<
|
||||||
Edn::File m_fileName;
|
// naming
|
||||||
|
Edn::File m_fileName; //!< filename of the curent buffer
|
||||||
bool m_haveName; //!< to know if the file have a name or NOT
|
bool m_haveName; //!< to know if the file have a name or NOT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -62,8 +62,8 @@ BufferManager::~BufferManager(void)
|
|||||||
EDN_INFO("~BufferManager::RemoveAll();");
|
EDN_INFO("~BufferManager::RemoveAll();");
|
||||||
RemoveAll();
|
RemoveAll();
|
||||||
// clear The list of Buffer
|
// clear The list of Buffer
|
||||||
EDN_INFO("~BufferManager::listBuffer.clear();");
|
EDN_INFO("~BufferManager::listBuffer.Clear();");
|
||||||
listBuffer.clear();
|
listBuffer.Clear();
|
||||||
EDN_INFO("~BufferManager::delete(BufferNotExiste);");
|
EDN_INFO("~BufferManager::delete(BufferNotExiste);");
|
||||||
delete(BufferNotExiste);
|
delete(BufferNotExiste);
|
||||||
}
|
}
|
||||||
@@ -73,6 +73,9 @@ void BufferManager::OnMessage(int32_t id, int32_t dataID)
|
|||||||
{
|
{
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
|
case EDN_MSG__BUFFER_CHANGE_CURRENT:
|
||||||
|
m_idSelected = dataID;
|
||||||
|
break;
|
||||||
case EDN_MSG__NEW:
|
case EDN_MSG__NEW:
|
||||||
{
|
{
|
||||||
int32_t newOne = Create();
|
int32_t newOne = Create();
|
||||||
@@ -81,6 +84,49 @@ void BufferManager::OnMessage(int32_t id, int32_t dataID)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case EDN_MSG__BUFF_ID_CLOSE:
|
||||||
|
// Check buffer existence
|
||||||
|
if(true == Exist(dataID)) {
|
||||||
|
// Get the new display buffer
|
||||||
|
if (m_idSelected == dataID) {
|
||||||
|
// Try previous buffer
|
||||||
|
int32_t destBuffer = -1;
|
||||||
|
for(int32_t ii=dataID-1; ii >= 0; ii--) {
|
||||||
|
if (true == Exist(ii) ) {
|
||||||
|
destBuffer = ii;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//EDN_DEBUG("new buffer selected : ?? " << destBuffer);
|
||||||
|
// try next buffer
|
||||||
|
if (-1 == destBuffer) {
|
||||||
|
for(int32_t ii=dataID+1; ii < listBuffer.Size(); ii++) {
|
||||||
|
if (true == Exist(ii) ) {
|
||||||
|
destBuffer = ii;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//EDN_DEBUG("new buffer selected : ?? " << destBuffer);
|
||||||
|
// set it to the currect display
|
||||||
|
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, destBuffer);
|
||||||
|
}
|
||||||
|
//EDN_DEBUG("Remove : " << dataID);
|
||||||
|
// Remove requested buffer
|
||||||
|
Remove(dataID);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EDN_MSG__BUFF_ID_SAVE:
|
||||||
|
// Check buffer existence
|
||||||
|
if(true == Exist(dataID)) {
|
||||||
|
// If no name ==> request a Gui display ...
|
||||||
|
if (Get(dataID)->HaveName() == false) {
|
||||||
|
SendMessage(EDN_MSG__GUI_SHOW_SAVE_AS, dataID);
|
||||||
|
} else {
|
||||||
|
Get(dataID)->Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,7 +147,7 @@ void BufferManager::OnMessage(int32_t id, int32_t dataID)
|
|||||||
void BufferManager::RemoveAll(void)
|
void BufferManager::RemoveAll(void)
|
||||||
{
|
{
|
||||||
int32_t i;
|
int32_t i;
|
||||||
for (i=0; i<(int32_t)listBuffer.size(); i++) {
|
for (i=0; i<listBuffer.Size(); i++) {
|
||||||
Remove(i);
|
Remove(i);
|
||||||
}
|
}
|
||||||
SendMessage(EDN_MSG__BUFFER_REMOVE_ALL);
|
SendMessage(EDN_MSG__BUFFER_REMOVE_ALL);
|
||||||
@@ -122,8 +168,8 @@ int32_t BufferManager::Create(void)
|
|||||||
// allocate a new Buffer
|
// allocate a new Buffer
|
||||||
Buffer *myBuffer = new BufferText();
|
Buffer *myBuffer = new BufferText();
|
||||||
// Add at the list of element
|
// Add at the list of element
|
||||||
listBuffer.push_back(myBuffer);
|
listBuffer.PushBack(myBuffer);
|
||||||
int32_t basicID = (int32_t)listBuffer.size() - 1;
|
int32_t basicID = listBuffer.Size() - 1;
|
||||||
SendMessage(EDN_MSG__BUFFER_ADD, basicID);
|
SendMessage(EDN_MSG__BUFFER_ADD, basicID);
|
||||||
return basicID;
|
return basicID;
|
||||||
}
|
}
|
||||||
@@ -139,13 +185,14 @@ int32_t BufferManager::Create(void)
|
|||||||
* @todo : check if this file is not curently open and return the old ID
|
* @todo : check if this file is not curently open and return the old ID
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int32_t BufferManager::Open(Edn::String &filename)
|
int32_t BufferManager::Open(Edn::File &myFile)
|
||||||
{
|
{
|
||||||
|
// TODO : Check here if the file is already open ==> and display it if needed
|
||||||
// allocate a new Buffer
|
// allocate a new Buffer
|
||||||
Buffer *myBuffer = new BufferText(filename);
|
Buffer *myBuffer = new BufferText(myFile);
|
||||||
// Add at the list of element
|
// Add at the list of element
|
||||||
listBuffer.push_back(myBuffer);
|
listBuffer.PushBack(myBuffer);
|
||||||
int32_t basicID = (int32_t)listBuffer.size() - 1;
|
int32_t basicID = listBuffer.Size() - 1;
|
||||||
SendMessage(EDN_MSG__BUFFER_ADD, basicID);
|
SendMessage(EDN_MSG__BUFFER_ADD, basicID);
|
||||||
return basicID;
|
return basicID;
|
||||||
}
|
}
|
||||||
@@ -159,7 +206,7 @@ Buffer * BufferManager::Get(int32_t BufferID)
|
|||||||
return BufferNotExiste;
|
return BufferNotExiste;
|
||||||
}
|
}
|
||||||
// check if the Buffer existed
|
// check if the Buffer existed
|
||||||
if (BufferID < (int32_t)listBuffer.size()) {
|
if (BufferID < listBuffer.Size()) {
|
||||||
// check if the buffer already existed
|
// check if the buffer already existed
|
||||||
if (NULL != listBuffer[BufferID]) {
|
if (NULL != listBuffer[BufferID]) {
|
||||||
return listBuffer[BufferID];
|
return listBuffer[BufferID];
|
||||||
@@ -167,7 +214,7 @@ Buffer * BufferManager::Get(int32_t BufferID)
|
|||||||
EDN_ERROR("non existing Buffer " << BufferID);
|
EDN_ERROR("non existing Buffer " << BufferID);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
EDN_ERROR("call an non existing Buffer number too hight : " << BufferID << " > " << listBuffer.size());
|
EDN_ERROR("call an non existing Buffer number too hight : " << BufferID << " > " << listBuffer.Size());
|
||||||
}
|
}
|
||||||
return BufferNotExiste;
|
return BufferNotExiste;
|
||||||
}
|
}
|
||||||
@@ -179,7 +226,7 @@ bool BufferManager::Exist(int32_t BufferID)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// check if the Buffer existed
|
// check if the Buffer existed
|
||||||
if (BufferID < (int32_t)listBuffer.size()) {
|
if (BufferID < listBuffer.Size()) {
|
||||||
// check if the buffer already existed
|
// check if the buffer already existed
|
||||||
if (NULL != listBuffer[BufferID]) {
|
if (NULL != listBuffer[BufferID]) {
|
||||||
return true;
|
return true;
|
||||||
@@ -189,14 +236,23 @@ bool BufferManager::Exist(int32_t BufferID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int32_t BufferManager::GetId(Edn::String &filename)
|
bool BufferManager::Exist(Edn::File &myFile )
|
||||||
|
{
|
||||||
|
if (-1 == GetId(myFile)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int32_t BufferManager::GetId(Edn::File &myFile)
|
||||||
{
|
{
|
||||||
int32_t iii;
|
int32_t iii;
|
||||||
// check if the Buffer existed
|
// check if the Buffer existed
|
||||||
for (iii=0; iii < (int32_t)listBuffer.size(); iii++) {
|
for (iii=0; iii < listBuffer.Size(); iii++) {
|
||||||
// check if the buffer already existed
|
// check if the buffer already existed
|
||||||
if (NULL != listBuffer[iii]) {
|
if (NULL != listBuffer[iii]) {
|
||||||
if ( listBuffer[iii]->GetName() == filename) {
|
if ( listBuffer[iii]->GetFileName() == myFile) {
|
||||||
return iii;
|
return iii;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -204,19 +260,11 @@ int32_t BufferManager::GetId(Edn::String &filename)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BufferManager::Exist(Edn::String &filename)
|
|
||||||
{
|
|
||||||
if (-1 == GetId(filename)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5
|
// return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5
|
||||||
uint32_t BufferManager::Size(void)
|
uint32_t BufferManager::Size(void)
|
||||||
{
|
{
|
||||||
return listBuffer.size();
|
return listBuffer.Size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -234,7 +282,7 @@ bool BufferManager::Remove(int32_t BufferID)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// check if the Buffer existed
|
// check if the Buffer existed
|
||||||
if (BufferID < (int32_t)listBuffer.size()) {
|
if (BufferID < listBuffer.Size()) {
|
||||||
// check if the buffer already existed
|
// check if the buffer already existed
|
||||||
if (NULL != listBuffer[BufferID]) {
|
if (NULL != listBuffer[BufferID]) {
|
||||||
// TODO : Check if it saved...
|
// TODO : Check if it saved...
|
||||||
@@ -253,7 +301,7 @@ bool BufferManager::Remove(int32_t BufferID)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
EDN_INFO("call an non existing Buffer number too hight : " << BufferID << " > " << listBuffer.size());
|
EDN_INFO("call an non existing Buffer number too hight : " << BufferID << " > " << listBuffer.Size());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -269,7 +317,7 @@ bool BufferManager::Remove(int32_t BufferID)
|
|||||||
int32_t BufferManager::WitchBuffer(int32_t iEmeElement)
|
int32_t BufferManager::WitchBuffer(int32_t iEmeElement)
|
||||||
{
|
{
|
||||||
int32_t i;
|
int32_t i;
|
||||||
for (i=0; i<(int32_t)listBuffer.size(); i++) {
|
for (i=0; i<listBuffer.Size(); i++) {
|
||||||
if (NULL != listBuffer[i]) {
|
if (NULL != listBuffer[i]) {
|
||||||
iEmeElement--;
|
iEmeElement--;
|
||||||
// find the element :
|
// find the element :
|
||||||
|
@@ -31,8 +31,6 @@
|
|||||||
#include "BufferEmpty.h"
|
#include "BufferEmpty.h"
|
||||||
#include "Singleton.h"
|
#include "Singleton.h"
|
||||||
#include "MsgBroadcast.h"
|
#include "MsgBroadcast.h"
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
class BufferManager: public Singleton<BufferManager>, public MsgBroadcast
|
class BufferManager: public Singleton<BufferManager>, public MsgBroadcast
|
||||||
{
|
{
|
||||||
@@ -50,13 +48,13 @@ class BufferManager: public Singleton<BufferManager>, public MsgBroadcast
|
|||||||
// create a buffer with no element
|
// create a buffer with no element
|
||||||
int32_t Create(void);
|
int32_t Create(void);
|
||||||
// open curent filename
|
// open curent filename
|
||||||
int32_t Open(Edn::String &filename);
|
int32_t Open(Edn::File &myFile);
|
||||||
int32_t GetSelected(void) { return m_idSelected;};
|
int32_t GetSelected(void) { return m_idSelected;};
|
||||||
void SetSelected(int32_t id) {m_idSelected = id;};
|
void SetSelected(int32_t id) {m_idSelected = id;};
|
||||||
Buffer * Get(int32_t BufferID);
|
Buffer * Get(int32_t BufferID);
|
||||||
bool Exist(int32_t BufferID);
|
bool Exist(int32_t BufferID);
|
||||||
bool Exist(Edn::String &filename);
|
bool Exist(Edn::File &myFile);
|
||||||
int32_t GetId(Edn::String &filename);
|
int32_t GetId(Edn::File &myFile);
|
||||||
// return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5
|
// return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5
|
||||||
uint32_t Size(void);
|
uint32_t Size(void);
|
||||||
int32_t WitchBuffer(int32_t iEmeElement);
|
int32_t WitchBuffer(int32_t iEmeElement);
|
||||||
@@ -65,7 +63,7 @@ class BufferManager: public Singleton<BufferManager>, public MsgBroadcast
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
std::vector<Buffer*> listBuffer; //!< element List of the char Elements
|
Edn::VectorType<Buffer*> listBuffer; //!< element List of the char Elements
|
||||||
|
|
||||||
void RemoveAll(void); //!< remove all buffer
|
void RemoveAll(void); //!< remove all buffer
|
||||||
int32_t m_idSelected;
|
int32_t m_idSelected;
|
||||||
|
@@ -50,16 +50,10 @@ const uint32_t nbLineAllocatedInBase = 300;
|
|||||||
*/
|
*/
|
||||||
void BufferText::BasicInit(void)
|
void BufferText::BasicInit(void)
|
||||||
{
|
{
|
||||||
static int32_t fileBasicID = 0;
|
|
||||||
NeedToCleanEndPage = true;
|
NeedToCleanEndPage = true;
|
||||||
// set the first element that is displayed
|
// set the first element that is displayed
|
||||||
m_displayStartBufferPos = 0;
|
m_displayStartBufferPos = 0;
|
||||||
// set basic filename :
|
|
||||||
filename = "Untitled ";
|
|
||||||
filename += fileBasicID;
|
|
||||||
// no name ...
|
|
||||||
haveName = false;
|
|
||||||
fileBasicID++;
|
|
||||||
// set the number of the lineNumber;
|
// set the number of the lineNumber;
|
||||||
nbColoneForLineNumber = 1;
|
nbColoneForLineNumber = 1;
|
||||||
// init the link with the buffer manager
|
// init the link with the buffer manager
|
||||||
@@ -80,6 +74,29 @@ void BufferText::BasicInit(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* @param[in,out] ---
|
||||||
|
*
|
||||||
|
* @return ---
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void BufferText::NameChange(void)
|
||||||
|
{
|
||||||
|
// Find HL system
|
||||||
|
//EDN_DEBUG("check name change");
|
||||||
|
if (true == HighlightManager::getInstance()->Exist(m_fileName)) {
|
||||||
|
Highlight * myHL = HighlightManager::getInstance()->Get(m_fileName);
|
||||||
|
// Set the new HL
|
||||||
|
if (NULL != myHL) {
|
||||||
|
m_EdnBuf.SetHLSystem(myHL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
*
|
*
|
||||||
@@ -104,16 +121,15 @@ BufferText::BufferText()
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
BufferText::BufferText(Edn::String &newFileName)
|
BufferText::BufferText(Edn::File &fileName) : Buffer(fileName)
|
||||||
{
|
{
|
||||||
BasicInit();
|
BasicInit();
|
||||||
EDN_INFO("Add Data from file(" << newFileName.c_str() << ")");
|
NameChange();
|
||||||
|
EDN_INFO("Add Data from file(" << GetFileName() << ")");
|
||||||
FILE * myFile = NULL;
|
FILE * myFile = NULL;
|
||||||
// set the filename :
|
|
||||||
SetName(newFileName);
|
|
||||||
// try to open the file. if not existed, new file
|
// try to open the file. if not existed, new file
|
||||||
|
|
||||||
myFile = fopen(newFileName.c_str(), "r");
|
myFile = fopen(fileName.GetCompleateName().c_str(), "r");
|
||||||
if (NULL != myFile) {
|
if (NULL != myFile) {
|
||||||
m_EdnBuf.DumpFrom(myFile);
|
m_EdnBuf.DumpFrom(myFile);
|
||||||
// close the input file
|
// close the input file
|
||||||
@@ -121,7 +137,7 @@ BufferText::BufferText(Edn::String &newFileName)
|
|||||||
SetModify(false);
|
SetModify(false);
|
||||||
} else {
|
} else {
|
||||||
// fichier inexistant... creation d'un nouveaux
|
// fichier inexistant... creation d'un nouveaux
|
||||||
EDN_WARNING("No File ==> created a new one(" << newFileName.c_str() << ")");
|
EDN_WARNING("No File ==> created a new one(" << GetFileName() << ")");
|
||||||
SetModify(true);
|
SetModify(true);
|
||||||
}
|
}
|
||||||
UpdateWindowsPosition();
|
UpdateWindowsPosition();
|
||||||
@@ -139,9 +155,9 @@ BufferText::BufferText(Edn::String &newFileName)
|
|||||||
*/
|
*/
|
||||||
void BufferText::Save(void)
|
void BufferText::Save(void)
|
||||||
{
|
{
|
||||||
EDN_INFO("Save File : \"" << filename.c_str() << "\"" );
|
EDN_INFO("Save File : \"" << GetFileName() << "\"" );
|
||||||
FILE * myFile = NULL;
|
FILE * myFile = NULL;
|
||||||
myFile = fopen(filename.c_str(), "w");
|
myFile = fopen(GetFileName().GetCompleateName().c_str(), "w");
|
||||||
if (NULL != myFile) {
|
if (NULL != myFile) {
|
||||||
m_EdnBuf.DumpIn(myFile);
|
m_EdnBuf.DumpIn(myFile);
|
||||||
fclose(myFile);
|
fclose(myFile);
|
||||||
@@ -187,104 +203,6 @@ void BufferText::SelectionCheckMode(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief
|
|
||||||
*
|
|
||||||
* @param[in,out] ---
|
|
||||||
*
|
|
||||||
* @return ---
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
Edn::String BufferText::GetName(void)
|
|
||||||
{
|
|
||||||
return filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief
|
|
||||||
*
|
|
||||||
* @param[in,out] ---
|
|
||||||
*
|
|
||||||
* @return ---
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
Edn::String BufferText::GetShortName(void)
|
|
||||||
{
|
|
||||||
char *ptr = strrchr(filename.c_str(), '/');
|
|
||||||
if (NULL == ptr) {
|
|
||||||
ptr = strrchr(filename.c_str(), '\\');
|
|
||||||
}
|
|
||||||
Edn::String out = filename;
|
|
||||||
if (NULL != ptr) {
|
|
||||||
out = ptr+1;
|
|
||||||
}
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief
|
|
||||||
*
|
|
||||||
* @param[in,out] ---
|
|
||||||
*
|
|
||||||
* @return ---
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
Edn::String BufferText::GetFolder(void)
|
|
||||||
{
|
|
||||||
char tmpVal[4096];
|
|
||||||
strncpy(tmpVal, filename.c_str(), 4096);
|
|
||||||
tmpVal[4096-1] = '\0';
|
|
||||||
char *ptr = strrchr(tmpVal, '/');
|
|
||||||
if (NULL == ptr) {
|
|
||||||
ptr = strrchr(tmpVal, '\\');
|
|
||||||
}
|
|
||||||
Edn::String out = "./";
|
|
||||||
if (NULL != ptr) {
|
|
||||||
*ptr = '\0';
|
|
||||||
out = tmpVal;
|
|
||||||
}
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief
|
|
||||||
*
|
|
||||||
* @param[in,out] ---
|
|
||||||
*
|
|
||||||
* @return ---
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
bool BufferText::HaveName(void)
|
|
||||||
{
|
|
||||||
return haveName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief
|
|
||||||
*
|
|
||||||
* @param[in,out] ---
|
|
||||||
*
|
|
||||||
* @return ---
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void BufferText::SetName(Edn::String &newName)
|
|
||||||
{
|
|
||||||
filename = newName;
|
|
||||||
haveName = true;
|
|
||||||
// Find HL system
|
|
||||||
if (true == HighlightManager::getInstance()->Exist(newName)) {
|
|
||||||
Highlight * myHL = HighlightManager::getInstance()->Get(newName);
|
|
||||||
// Set the new HL
|
|
||||||
if (NULL != myHL) {
|
|
||||||
m_EdnBuf.SetHLSystem(myHL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
*
|
*
|
||||||
@@ -1153,7 +1071,7 @@ int32_t BufferText::FindLine(Edn::String &data)
|
|||||||
EDN_WARNING("no search data");
|
EDN_WARNING("no search data");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EDN_INFO("Search data line : \"" << data.c_str() << "\"");
|
EDN_INFO("Search data line : \"" << data << "\"");
|
||||||
Edn::VectorType<int8_t> mVectSearch;
|
Edn::VectorType<int8_t> mVectSearch;
|
||||||
mVectSearch = data.GetVector();
|
mVectSearch = data.GetVector();
|
||||||
//EDN_INFO("search data Forward : startSearchPos=" << startSearchPos );
|
//EDN_INFO("search data Forward : startSearchPos=" << startSearchPos );
|
||||||
@@ -1178,7 +1096,7 @@ void BufferText::JumpAtLine(int32_t newLine)
|
|||||||
|
|
||||||
void BufferText::Search(Edn::String &data, bool back, bool caseSensitive, bool wrap, bool regExp)
|
void BufferText::Search(Edn::String &data, bool back, bool caseSensitive, bool wrap, bool regExp)
|
||||||
{
|
{
|
||||||
EDN_INFO("Search data : \"" << data.c_str() << "\"");
|
EDN_INFO("Search data : \"" << data << "\"");
|
||||||
|
|
||||||
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
|
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
|
||||||
bool SelectionIsRect;
|
bool SelectionIsRect;
|
||||||
|
@@ -41,14 +41,9 @@ typedef enum {
|
|||||||
class BufferText : public Buffer {
|
class BufferText : public Buffer {
|
||||||
public:
|
public:
|
||||||
BufferText(void);
|
BufferText(void);
|
||||||
BufferText(Edn::String &filename);
|
BufferText(Edn::File &fileName);
|
||||||
virtual ~BufferText(void);
|
virtual ~BufferText(void);
|
||||||
Edn::String GetName(void);
|
|
||||||
Edn::String GetShortName(void);
|
|
||||||
Edn::String GetFolder(void);
|
|
||||||
void SetName(Edn::String &newName);
|
|
||||||
void Save(void);
|
void Save(void);
|
||||||
bool HaveName(void);
|
|
||||||
|
|
||||||
void GetInfo(infoStatBuffer_ts &infoToUpdate);
|
void GetInfo(infoStatBuffer_ts &infoToUpdate);
|
||||||
void SetLineDisplay(uint32_t lineNumber);
|
void SetLineDisplay(uint32_t lineNumber);
|
||||||
@@ -78,11 +73,10 @@ class BufferText : public Buffer {
|
|||||||
void Undo(void);
|
void Undo(void);
|
||||||
void Redo(void);
|
void Redo(void);
|
||||||
void SetCharset(charset_te newCharset);
|
void SetCharset(charset_te newCharset);
|
||||||
|
protected:
|
||||||
|
void NameChange(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// naming
|
|
||||||
Edn::String filename; //!< filename of the curent buffer
|
|
||||||
bool haveName; //!< to know if the file have a name or NOT
|
|
||||||
// Display
|
// Display
|
||||||
bool NeedToCleanEndPage; //!< if true, the end of the page need to be clean (arrive after a remove line)
|
bool NeedToCleanEndPage; //!< if true, the end of the page need to be clean (arrive after a remove line)
|
||||||
uint32_t nbColoneForLineNumber; //!< number of colome used to display the line Number
|
uint32_t nbColoneForLineNumber; //!< number of colome used to display the line Number
|
||||||
|
@@ -147,17 +147,17 @@ gboolean BufferView::CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, g
|
|||||||
basicColor_te selectFG = COLOR_LIST_TEXT_NORMAL;
|
basicColor_te selectFG = COLOR_LIST_TEXT_NORMAL;
|
||||||
basicColor_te selectBG = COLOR_LIST_BG_1;
|
basicColor_te selectBG = COLOR_LIST_BG_1;
|
||||||
for (i=0; i < nbBufferOpen; i++) {
|
for (i=0; i < nbBufferOpen; i++) {
|
||||||
Edn::String name;
|
Edn::File name;
|
||||||
bool isModify;
|
bool isModify;
|
||||||
if (self->m_bufferManager->Exist(i)) {
|
if (self->m_bufferManager->Exist(i)) {
|
||||||
isModify = self->m_bufferManager->Get(i)->IsModify();
|
isModify = self->m_bufferManager->Get(i)->IsModify();
|
||||||
name = self->m_bufferManager->Get(i)->GetShortName();
|
name = self->m_bufferManager->Get(i)->GetFileName();
|
||||||
char *tmpModify = (char*)" ";
|
char *tmpModify = (char*)" ";
|
||||||
if (true == isModify) {
|
if (true == isModify) {
|
||||||
tmpModify = (char*)"M";
|
tmpModify = (char*)"M";
|
||||||
}
|
}
|
||||||
char name2[1024] = "";
|
char name2[1024] = "";
|
||||||
sprintf(name2, "[%2d](%s) %s", i, tmpModify, name.c_str() );
|
sprintf(name2, "[%2d](%s) %s", i, tmpModify, name.GetShortFilename().c_str() );
|
||||||
|
|
||||||
if (true == isModify) {
|
if (true == isModify) {
|
||||||
selectFG = COLOR_LIST_TEXT_MODIFY;
|
selectFG = COLOR_LIST_TEXT_MODIFY;
|
||||||
@@ -188,7 +188,7 @@ gboolean BufferView::CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, g
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// sur : émis lors du premier affichage de la GtkDrawingArea
|
// sur : <EFBFBD>mis lors du premier affichage de la GtkDrawingArea
|
||||||
gboolean BufferView::CB_displayInit( GtkWidget *widget, gpointer data)
|
gboolean BufferView::CB_displayInit( GtkWidget *widget, gpointer data)
|
||||||
{
|
{
|
||||||
BufferView * self = reinterpret_cast<BufferView*>(data);
|
BufferView * self = reinterpret_cast<BufferView*>(data);
|
||||||
@@ -251,6 +251,74 @@ gint BufferView::CB_keyboardEvent( GtkWidget *widget, GdkEventKey *event, gpoint
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void BufferView::OnPopupEventShow(GtkWidget *menuitem, gpointer data)
|
||||||
|
{
|
||||||
|
BufferView * self = reinterpret_cast<BufferView*>(data);
|
||||||
|
self->SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, self->m_contectMenuSelectID);
|
||||||
|
self->m_contectMenuSelectID = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BufferView::OnPopupEventClose(GtkWidget *menuitem, gpointer data)
|
||||||
|
{
|
||||||
|
BufferView * self = reinterpret_cast<BufferView*>(data);
|
||||||
|
self->SendMessage(EDN_MSG__BUFF_ID_CLOSE, self->m_contectMenuSelectID);
|
||||||
|
self->m_contectMenuSelectID = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BufferView::OnPopupEventSave(GtkWidget *menuitem, gpointer data)
|
||||||
|
{
|
||||||
|
BufferView * self = reinterpret_cast<BufferView*>(data);
|
||||||
|
self->SendMessage(EDN_MSG__BUFF_ID_SAVE, self->m_contectMenuSelectID);
|
||||||
|
self->m_contectMenuSelectID = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BufferView::OnPopupEventSaveAs(GtkWidget *menuitem, gpointer data)
|
||||||
|
{
|
||||||
|
BufferView * self = reinterpret_cast<BufferView*>(data);
|
||||||
|
self->SendMessage(EDN_MSG__GUI_SHOW_SAVE_AS, self->m_contectMenuSelectID);
|
||||||
|
self->m_contectMenuSelectID = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void BufferView::ViewPopupMenu(GtkWidget *parrent, GdkEventButton *event, int32_t BufferID)
|
||||||
|
{
|
||||||
|
// Save the slected buffer
|
||||||
|
m_contectMenuSelectID = BufferID;
|
||||||
|
if (m_bufferManager->Exist(m_contectMenuSelectID)) {
|
||||||
|
GtkWidget *menu, *menuitem;
|
||||||
|
menu = gtk_menu_new();
|
||||||
|
menuitem = gtk_menu_item_new_with_label("Show");
|
||||||
|
g_signal_connect( G_OBJECT(menuitem), "activate", G_CALLBACK(OnPopupEventShow), this);
|
||||||
|
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
|
||||||
|
if (true == m_bufferManager->Get(m_contectMenuSelectID)->HaveName()) {
|
||||||
|
if (true == m_bufferManager->Get(m_contectMenuSelectID)->IsModify()) {
|
||||||
|
menuitem = gtk_menu_item_new_with_label("Save");
|
||||||
|
} else {
|
||||||
|
menuitem = gtk_menu_item_new_with_label("Force Save");
|
||||||
|
}
|
||||||
|
g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(OnPopupEventSave), this);
|
||||||
|
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
|
||||||
|
}
|
||||||
|
menuitem = gtk_menu_item_new_with_label("Save As ...");
|
||||||
|
g_signal_connect( G_OBJECT(menuitem), "activate", G_CALLBACK(OnPopupEventSaveAs), this);
|
||||||
|
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
|
||||||
|
menuitem = gtk_menu_item_new_with_label("Close");
|
||||||
|
g_signal_connect( G_OBJECT(menuitem), "activate", G_CALLBACK(OnPopupEventClose), this);
|
||||||
|
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
|
||||||
|
gtk_widget_show_all(menu);
|
||||||
|
// Note: event can be NULL here when called from view_onPopupMenu;
|
||||||
|
// gdk_event_get_time() accepts a NULL argument
|
||||||
|
gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,
|
||||||
|
(event != NULL) ? event->button : 0,
|
||||||
|
gdk_event_get_time((GdkEvent*)event));
|
||||||
|
} else {
|
||||||
|
EDN_ERROR("Buffer does not Exist !!! " << m_contectMenuSelectID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gint BufferView::CB_mouseButtonEvent(GtkWidget *widget, GdkEventButton *event, gpointer data)
|
gint BufferView::CB_mouseButtonEvent(GtkWidget *widget, GdkEventButton *event, gpointer data)
|
||||||
{
|
{
|
||||||
BufferView * self = reinterpret_cast<BufferView*>(data);
|
BufferView * self = reinterpret_cast<BufferView*>(data);
|
||||||
@@ -294,16 +362,7 @@ gint BufferView::CB_mouseButtonEvent(GtkWidget *widget, GdkEventButton *event, g
|
|||||||
uint32_t fontHeight = Display::GetFontHeight();
|
uint32_t fontHeight = Display::GetFontHeight();
|
||||||
int32_t selectBuf = self->m_bufferManager->WitchBuffer((event->y / fontHeight) + 1);
|
int32_t selectBuf = self->m_bufferManager->WitchBuffer((event->y / fontHeight) + 1);
|
||||||
if ( 0 <= selectBuf) {
|
if ( 0 <= selectBuf) {
|
||||||
// TODO : Find a simple methode
|
self->ViewPopupMenu(widget, event, selectBuf);
|
||||||
int32_t windowsPosX, windowsPosY;
|
|
||||||
gtk_window_get_position(GTK_WINDOW(gtk_widget_get_toplevel(widget)), &windowsPosX, &windowsPosY);
|
|
||||||
//EDN_INFO("windowsPosX=" << windowsPosX << " windowsPosY=" << windowsPosY);
|
|
||||||
int32_t widgetPosX, widgetPosY;
|
|
||||||
gtk_widget_translate_coordinates(widget, gtk_widget_get_toplevel(widget), 0, 0, &widgetPosX, &widgetPosY);
|
|
||||||
//EDN_INFO("widgetPosX=" << widgetPosX << " widgetPosY=" << widgetPosY);
|
|
||||||
self->m_menuContext->Show(self->m_shawableAreaX+2+widgetPosX+windowsPosX, ((int32_t)(event->y / fontHeight)*fontHeight)+(fontHeight/2)+widgetPosY+windowsPosY, false);
|
|
||||||
} else {
|
|
||||||
self->m_menuContext->Hide();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@@ -55,9 +55,14 @@ class BufferView : public MsgBroadcast
|
|||||||
static gint CB_mouseMotionEvent( GtkWidget *widget, GdkEventMotion *event, gpointer data);
|
static gint CB_mouseMotionEvent( GtkWidget *widget, GdkEventMotion *event, gpointer data);
|
||||||
static void CB_EventOnBufferManager(gpointer data);
|
static void CB_EventOnBufferManager(gpointer data);
|
||||||
|
|
||||||
|
static void OnPopupEventShow(GtkWidget *menuitem, gpointer data);
|
||||||
|
static void OnPopupEventClose(GtkWidget *menuitem, gpointer data);
|
||||||
|
static void OnPopupEventSave(GtkWidget *menuitem, gpointer data);
|
||||||
|
static void OnPopupEventSaveAs(GtkWidget *menuitem, gpointer data);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void ViewPopupMenu(GtkWidget *parrent, GdkEventButton *event, int32_t BufferID);
|
||||||
// main windows widget :
|
// main windows widget :
|
||||||
GtkWidget * m_widget;
|
GtkWidget * m_widget;
|
||||||
// r<>cup<75>ration des proprieter g<>n<EFBFBD>ral...
|
// r<>cup<75>ration des proprieter g<>n<EFBFBD>ral...
|
||||||
@@ -67,6 +72,7 @@ class BufferView : public MsgBroadcast
|
|||||||
int32_t m_shawableAreaX;
|
int32_t m_shawableAreaX;
|
||||||
int32_t m_shawableAreaY;
|
int32_t m_shawableAreaY;
|
||||||
int32_t m_selectedID;
|
int32_t m_selectedID;
|
||||||
|
int32_t m_contectMenuSelectID;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -105,11 +105,7 @@ void CodeView::OnMessage(int32_t id, int32_t dataID)
|
|||||||
SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, m_bufferID);
|
SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, m_bufferID);
|
||||||
break;
|
break;
|
||||||
case EDN_MSG__CURRENT_SAVE:
|
case EDN_MSG__CURRENT_SAVE:
|
||||||
if (m_bufferManager->Get(m_bufferID)->HaveName() == false) {
|
SendMessage(EDN_MSG__BUFF_ID_SAVE, m_bufferID);
|
||||||
SendMessage(EDN_MSG__GUI_SHOW_SAVE_AS, m_bufferID);
|
|
||||||
} else {
|
|
||||||
m_bufferManager->Get(m_bufferID)->Save();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case EDN_MSG__CURRENT_SAVE_AS:
|
case EDN_MSG__CURRENT_SAVE_AS:
|
||||||
SendMessage(EDN_MSG__GUI_SHOW_SAVE_AS, m_bufferID);
|
SendMessage(EDN_MSG__GUI_SHOW_SAVE_AS, m_bufferID);
|
||||||
@@ -165,9 +161,7 @@ void CodeView::OnMessage(int32_t id, int32_t dataID)
|
|||||||
case EDN_MSG__CURRENT_REPLACE_ALL:
|
case EDN_MSG__CURRENT_REPLACE_ALL:
|
||||||
break;
|
break;
|
||||||
case EDN_MSG__CURRENT_CLOSE:
|
case EDN_MSG__CURRENT_CLOSE:
|
||||||
m_bufferManager->Remove(m_bufferID);
|
SendMessage(EDN_MSG__BUFF_ID_CLOSE, m_bufferID);
|
||||||
m_bufferID = -1;
|
|
||||||
SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, m_bufferID);
|
|
||||||
break;
|
break;
|
||||||
case EDN_MSG__CURRENT_UNDO:
|
case EDN_MSG__CURRENT_UNDO:
|
||||||
m_bufferManager->Get(m_bufferID)->Undo();
|
m_bufferManager->Get(m_bufferID)->Undo();
|
||||||
|
@@ -93,17 +93,25 @@ MainWindows::~MainWindows(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWindows::SetTitle(Edn::String &fileName, bool isModify)
|
void MainWindows::SetTitle(Edn::File &fileName, bool isModify)
|
||||||
{
|
{
|
||||||
Edn::String tmp = "";
|
Edn::String tmp = "";
|
||||||
if (fileName != "") {
|
if (fileName.GetShortFilename() != "") {
|
||||||
tmp += fileName;
|
tmp += fileName.GetShortFilename();
|
||||||
|
tmp += " - ";
|
||||||
|
tmp += fileName.GetFolder();
|
||||||
tmp += " - ";
|
tmp += " - ";
|
||||||
}
|
}
|
||||||
tmp += "Edn";
|
tmp += "Edn";
|
||||||
gtk_window_set_title(GTK_WINDOW(m_mainWindow), tmp.c_str());
|
gtk_window_set_title(GTK_WINDOW(m_mainWindow), tmp.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindows::SetNoTitle(void)
|
||||||
|
{
|
||||||
|
Edn::String tmp = "Edn";
|
||||||
|
gtk_window_set_title(GTK_WINDOW(m_mainWindow), tmp.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindows::OnMessage(int32_t id, int32_t dataID)
|
void MainWindows::OnMessage(int32_t id, int32_t dataID)
|
||||||
{
|
{
|
||||||
switch (id)
|
switch (id)
|
||||||
@@ -112,12 +120,11 @@ void MainWindows::OnMessage(int32_t id, int32_t dataID)
|
|||||||
// change Title :
|
// change Title :
|
||||||
// TODO : String error when remove the error with -1;
|
// TODO : String error when remove the error with -1;
|
||||||
if (-1 == dataID) {
|
if (-1 == dataID) {
|
||||||
Edn::String plop = "";
|
SetNoTitle();
|
||||||
SetTitle(plop, false );
|
|
||||||
} else {
|
} else {
|
||||||
Buffer *mybuf = BufferManager::getInstance()->Get(dataID);
|
Buffer *mybuf = BufferManager::getInstance()->Get(dataID);
|
||||||
if (NULL != mybuf) {
|
if (NULL != mybuf) {
|
||||||
Edn::String plop = mybuf->GetName();
|
Edn::File plop = mybuf->GetFileName();
|
||||||
SetTitle(plop, mybuf->IsModify() );
|
SetTitle(plop, mybuf->IsModify() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -53,7 +53,8 @@ class MainWindows: public Singleton<MainWindows>, public MsgBroadcast
|
|||||||
static bool OnQuit(GtkWidget *widget, gpointer data);
|
static bool OnQuit(GtkWidget *widget, gpointer data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetTitle(Edn::String &fileName, bool isModify);
|
void SetTitle(Edn::File &fileName, bool isModify);
|
||||||
|
void SetNoTitle(void);
|
||||||
// main windows widget :
|
// main windows widget :
|
||||||
GtkWidget * m_mainWindow;
|
GtkWidget * m_mainWindow;
|
||||||
BufferView m_BufferView;
|
BufferView m_BufferView;
|
||||||
|
@@ -224,6 +224,8 @@ MenuBar::MenuBar(void) : MsgBroadcast("Menu bar", EDN_CAT_GUI)
|
|||||||
tmp->AddSeparator();
|
tmp->AddSeparator();
|
||||||
tmp->AddGen(GTK_STOCK_SELECT_ALL, "ctrl+a", EDN_MSG__CURRENT_SELECT_ALL, true);
|
tmp->AddGen(GTK_STOCK_SELECT_ALL, "ctrl+a", EDN_MSG__CURRENT_SELECT_ALL, true);
|
||||||
tmp->AddGen("Unselect", "ctrl+shift+a", EDN_MSG__CURRENT_UN_SELECT, true);
|
tmp->AddGen("Unselect", "ctrl+shift+a", EDN_MSG__CURRENT_UN_SELECT, true);
|
||||||
|
tmp->AddSeparator();
|
||||||
|
tmp->AddGen("Goto Line number ...", "ctrl+l", EDN_MSG__GUI_SHOW_GOTO_LINE, true);
|
||||||
// tmp->AddSeparator();
|
// tmp->AddSeparator();
|
||||||
// tmp->AddGen(GTK_STOCK_PREFERENCES, NULL, EDN_MSG__GUI_SHOW_PREFERENCE, true);
|
// tmp->AddGen(GTK_STOCK_PREFERENCES, NULL, EDN_MSG__GUI_SHOW_PREFERENCE, true);
|
||||||
m_listMenu.PushBack(tmp);
|
m_listMenu.PushBack(tmp);
|
||||||
|
@@ -68,7 +68,10 @@ void Search::Display(GtkWindow *parent)
|
|||||||
gtk_window_set_transient_for(GTK_WINDOW(m_localDialog), parent);
|
gtk_window_set_transient_for(GTK_WINDOW(m_localDialog), parent);
|
||||||
// set the dialog on the top right
|
// set the dialog on the top right
|
||||||
gtk_window_set_gravity(GTK_WINDOW(m_localDialog), GDK_GRAVITY_NORTH_EAST);
|
gtk_window_set_gravity(GTK_WINDOW(m_localDialog), GDK_GRAVITY_NORTH_EAST);
|
||||||
|
// Remove the dialogue from the task bar
|
||||||
|
gtk_window_set_skip_taskbar_hint(GTK_WINDOW(m_localDialog), TRUE);
|
||||||
|
// this element did not apear in the miniature of the windows
|
||||||
|
gtk_window_set_skip_pager_hint(GTK_WINDOW(m_localDialog), TRUE);
|
||||||
// select the program icone
|
// select the program icone
|
||||||
//gtk_window_set_default_icon_name("Replace");
|
//gtk_window_set_default_icon_name("Replace");
|
||||||
|
|
||||||
|
@@ -98,16 +98,18 @@ void WindowsManager::OnMessage(int32_t id, int32_t dataID)
|
|||||||
GTK_STOCK_OPEN, // button text
|
GTK_STOCK_OPEN, // button text
|
||||||
GTK_RESPONSE_ACCEPT, // response id
|
GTK_RESPONSE_ACCEPT, // response id
|
||||||
NULL); // end button/response list
|
NULL); // end button/response list
|
||||||
|
// this element did not apear in the miniature of the windows
|
||||||
|
gtk_window_set_skip_pager_hint(GTK_WINDOW(dialog), TRUE);
|
||||||
if( -1 != m_currentBufferID
|
if( -1 != m_currentBufferID
|
||||||
&& true == myBufferManager->Exist(m_currentBufferID) )
|
&& true == myBufferManager->Exist(m_currentBufferID) )
|
||||||
{
|
{
|
||||||
Edn::String fileFolder = myBufferManager->Get(m_currentBufferID)->GetFolder();
|
Edn::File fileName = myBufferManager->Get(m_currentBufferID)->GetFileName();
|
||||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER(dialog), fileFolder.c_str());
|
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), fileName.GetFolder().c_str());
|
||||||
//gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER(dialog), "Untitled document");
|
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), fileName.GetShortFilename().c_str());
|
||||||
}
|
}
|
||||||
if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
|
if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
|
||||||
{
|
{
|
||||||
Edn::String myfilename;
|
Edn::File myfilename;
|
||||||
myfilename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (dialog));
|
myfilename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (dialog));
|
||||||
|
|
||||||
if (false == myBufferManager->Exist(myfilename) ) {
|
if (false == myBufferManager->Exist(myfilename) ) {
|
||||||
@@ -132,7 +134,7 @@ void WindowsManager::OnMessage(int32_t id, int32_t dataID)
|
|||||||
}
|
}
|
||||||
Buffer *myBuffer = BufferManager::getInstance()->Get(idSelected);
|
Buffer *myBuffer = BufferManager::getInstance()->Get(idSelected);
|
||||||
Edn::String tmpString = "Save as file : ";
|
Edn::String tmpString = "Save as file : ";
|
||||||
tmpString += myBuffer->GetShortName().c_str();
|
tmpString += myBuffer->GetFileName().GetShortFilename().c_str();
|
||||||
GtkWidget *dialog = gtk_file_chooser_dialog_new( tmpString.c_str(), NULL,
|
GtkWidget *dialog = gtk_file_chooser_dialog_new( tmpString.c_str(), NULL,
|
||||||
GTK_FILE_CHOOSER_ACTION_SAVE,
|
GTK_FILE_CHOOSER_ACTION_SAVE,
|
||||||
GTK_STOCK_CANCEL, // button text
|
GTK_STOCK_CANCEL, // button text
|
||||||
@@ -140,12 +142,14 @@ void WindowsManager::OnMessage(int32_t id, int32_t dataID)
|
|||||||
GTK_STOCK_SAVE, // button text
|
GTK_STOCK_SAVE, // button text
|
||||||
GTK_RESPONSE_ACCEPT, // response id
|
GTK_RESPONSE_ACCEPT, // response id
|
||||||
NULL); // end button/response list
|
NULL); // end button/response list
|
||||||
|
// this element did not apear in the miniature of the windows
|
||||||
|
gtk_window_set_skip_pager_hint(GTK_WINDOW(dialog), TRUE);
|
||||||
if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
|
if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
|
||||||
{
|
{
|
||||||
Edn::String myfilename;
|
Edn::String myfilename;
|
||||||
myfilename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (dialog));
|
myfilename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (dialog));
|
||||||
|
|
||||||
myBuffer->SetName(myfilename);
|
myBuffer->SetFileName(myfilename);
|
||||||
myBuffer->Save();
|
myBuffer->Save();
|
||||||
|
|
||||||
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, idSelected);
|
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, idSelected);
|
||||||
@@ -161,6 +165,8 @@ void WindowsManager::OnMessage(int32_t id, int32_t dataID)
|
|||||||
GTK_DIALOG_MODAL,
|
GTK_DIALOG_MODAL,
|
||||||
GTK_STOCK_QUIT, GTK_RESPONSE_NO,
|
GTK_STOCK_QUIT, GTK_RESPONSE_NO,
|
||||||
NULL);
|
NULL);
|
||||||
|
// this element did not apear in the miniature of the windows
|
||||||
|
gtk_window_set_skip_pager_hint(GTK_WINDOW(myDialog), TRUE);
|
||||||
GtkWidget *myContentArea = gtk_dialog_get_content_area( GTK_DIALOG(myDialog));
|
GtkWidget *myContentArea = gtk_dialog_get_content_area( GTK_DIALOG(myDialog));
|
||||||
GtkWidget *myLabel = gtk_label_new("");
|
GtkWidget *myLabel = gtk_label_new("");
|
||||||
gtk_label_set_markup (GTK_LABEL (myLabel),
|
gtk_label_set_markup (GTK_LABEL (myLabel),
|
||||||
@@ -203,6 +209,46 @@ void WindowsManager::OnMessage(int32_t id, int32_t dataID)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case EDN_MSG__GUI_SHOW_GOTO_LINE:
|
||||||
|
{
|
||||||
|
// dlg to confirm the quit event :
|
||||||
|
GtkWidget *myDialog = gtk_dialog_new_with_buttons("Goto Line",
|
||||||
|
GTK_WINDOW(m_mainWindow->GetWidget()),
|
||||||
|
GTK_DIALOG_MODAL,
|
||||||
|
"Jump", GTK_RESPONSE_YES,
|
||||||
|
GTK_STOCK_QUIT, GTK_RESPONSE_NO,
|
||||||
|
NULL);
|
||||||
|
// this element did not apear in the miniature of the windows
|
||||||
|
gtk_window_set_skip_pager_hint(GTK_WINDOW(myDialog), TRUE);
|
||||||
|
// Set over main windows
|
||||||
|
gtk_window_set_transient_for(GTK_WINDOW(myDialog), GTK_WINDOW(m_mainWindow->GetWidget()));
|
||||||
|
// add writting area
|
||||||
|
GtkWidget *myContentArea = gtk_dialog_get_content_area( GTK_DIALOG(myDialog));
|
||||||
|
GtkWidget *myEntry = gtk_entry_new();
|
||||||
|
gtk_box_pack_start(GTK_BOX(myContentArea), myEntry, TRUE, TRUE, 0);
|
||||||
|
// Display it
|
||||||
|
gtk_widget_show_all(myContentArea);
|
||||||
|
int32_t result = gtk_dialog_run (GTK_DIALOG (myDialog));
|
||||||
|
// Get data from the gtk entry
|
||||||
|
const char *myData = gtk_entry_get_text(GTK_ENTRY(myEntry));
|
||||||
|
if (NULL != myData) {
|
||||||
|
int32_t lineID=0;
|
||||||
|
if (1==sscanf(myData, "%d",&lineID)) {
|
||||||
|
EDN_DEBUG("find in : \"" << myData << "\" = " << lineID);
|
||||||
|
if(GTK_RESPONSE_YES == result) {
|
||||||
|
SendMessage(EDN_MSG__CURRENT_GOTO_LINE, lineID-1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (GTK_RESPONSE_YES == result) {
|
||||||
|
EDN_WARNING("find in : \"" << myData << "\" line Number is not correct ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
EDN_DEBUG("no line Writen ...");
|
||||||
|
}
|
||||||
|
// Remove dialogue
|
||||||
|
gtk_widget_destroy(myDialog);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -52,7 +52,7 @@ Highlight::Highlight(Edn::String &xmlFilename)
|
|||||||
// open the curent File
|
// open the curent File
|
||||||
bool loadError = XmlDocument.LoadFile(xmlFilename.c_str());
|
bool loadError = XmlDocument.LoadFile(xmlFilename.c_str());
|
||||||
if (false == loadError) {
|
if (false == loadError) {
|
||||||
EDN_ERROR( "can not load Hightlight XML: PARSING error: \"" << xmlFilename.c_str() << "\"");
|
EDN_ERROR( "can not load Hightlight XML: PARSING error: \"" << xmlFilename << "\"");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TiXmlElement* root = XmlDocument.FirstChildElement( "EdnLang" );
|
TiXmlElement* root = XmlDocument.FirstChildElement( "EdnLang" );
|
||||||
@@ -134,24 +134,17 @@ bool Highlight::HasExtention(Edn::String &ext)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Highlight::FileNameCompatible(Edn::String &fileName)
|
bool Highlight::FileNameCompatible(Edn::File &fileName)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
int32_t posCopy = fileName.FindBack('/');
|
|
||||||
Edn::String shortFilename;
|
|
||||||
if (-1 != posCopy) {
|
|
||||||
shortFilename = fileName.Extract(posCopy+1);
|
|
||||||
} else {
|
|
||||||
shortFilename = fileName;
|
|
||||||
}
|
|
||||||
posCopy = shortFilename.FindBack('.');
|
|
||||||
Edn::String extention;
|
Edn::String extention;
|
||||||
if (-1 != posCopy) {
|
if (true == fileName.HasExtention() ) {
|
||||||
extention = shortFilename.Extract(posCopy);
|
extention = "*.";
|
||||||
|
extention += fileName.GetExtention();
|
||||||
} else {
|
} else {
|
||||||
extention = shortFilename;
|
extention = fileName.GetShortFilename();
|
||||||
}
|
}
|
||||||
EDN_DEBUG(" try to find : in \"" << fileName.c_str() << "\" shortfilename\"" << shortFilename.c_str() << "\" extention:\"" << extention.c_str() << "\" ");
|
EDN_DEBUG(" try to find : in \"" << fileName << "\" extention:\"" << extention << "\" ");
|
||||||
|
|
||||||
for (i=0; i<m_listExtentions.size(); i++) {
|
for (i=0; i<m_listExtentions.size(); i++) {
|
||||||
if (extention == m_listExtentions[i] ) {
|
if (extention == m_listExtentions[i] ) {
|
||||||
@@ -167,16 +160,16 @@ void Highlight::Display(void)
|
|||||||
uint32_t i;
|
uint32_t i;
|
||||||
EDN_INFO("List of ALL Highlight : ");
|
EDN_INFO("List of ALL Highlight : ");
|
||||||
for (i=0; i< m_listExtentions.size(); i++) {
|
for (i=0; i< m_listExtentions.size(); i++) {
|
||||||
EDN_INFO(" Extention : " << i << " : " << m_listExtentions[i].c_str() );
|
EDN_INFO(" Extention : " << i << " : " << m_listExtentions[i] );
|
||||||
}
|
}
|
||||||
// Display all elements
|
// Display all elements
|
||||||
for (i=0; i< m_listHighlightPass1.size(); i++) {
|
for (i=0; i< m_listHighlightPass1.size(); i++) {
|
||||||
EDN_INFO(" " << i << " Pass 1 : " << m_listHighlightPass1[i]->GetName().c_str() );
|
EDN_INFO(" " << i << " Pass 1 : " << m_listHighlightPass1[i]->GetName() );
|
||||||
//m_listHighlightPass1[i]->Display();
|
//m_listHighlightPass1[i]->Display();
|
||||||
}
|
}
|
||||||
// Display all elements
|
// Display all elements
|
||||||
for (i=0; i< m_listHighlightPass2.size(); i++) {
|
for (i=0; i< m_listHighlightPass2.size(); i++) {
|
||||||
EDN_INFO(" " << i << " Pass 2 : " << m_listHighlightPass2[i]->GetName().c_str() );
|
EDN_INFO(" " << i << " Pass 2 : " << m_listHighlightPass2[i]->GetName() );
|
||||||
//m_listHighlightPass2[i]->Display();
|
//m_listHighlightPass2[i]->Display();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -55,7 +55,7 @@ class Highlight {
|
|||||||
Highlight(Edn::String &xmlFilename);
|
Highlight(Edn::String &xmlFilename);
|
||||||
~Highlight(void);
|
~Highlight(void);
|
||||||
bool HasExtention(Edn::String &ext);
|
bool HasExtention(Edn::String &ext);
|
||||||
bool FileNameCompatible(Edn::String &fileName);
|
bool FileNameCompatible(Edn::File &fileName);
|
||||||
void Display(void);
|
void Display(void);
|
||||||
void Parse( int32_t start, int32_t stop, std::vector<colorInformation_ts> &metaData, int32_t &addingPos, EdnVectorBuf &buffer, int32_t elementID=0);
|
void Parse( int32_t start, int32_t stop, std::vector<colorInformation_ts> &metaData, int32_t &addingPos, EdnVectorBuf &buffer, int32_t elementID=0);
|
||||||
void Parse2(int32_t start, int32_t stop, std::vector<colorInformation_ts> &metaData, EdnVectorBuf &buffer, int32_t elementID=0);
|
void Parse2(int32_t start, int32_t stop, std::vector<colorInformation_ts> &metaData, EdnVectorBuf &buffer, int32_t elementID=0);
|
||||||
|
@@ -41,7 +41,7 @@ HighlightManager::~HighlightManager(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Highlight *HighlightManager::Get(Edn::String &fileName)
|
Highlight *HighlightManager::Get(Edn::File &fileName)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
for (i=0; i<listHighlight.size(); i++) {
|
for (i=0; i<listHighlight.size(); i++) {
|
||||||
@@ -52,14 +52,11 @@ Highlight *HighlightManager::Get(Edn::String &fileName)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HighlightManager::Exist(Edn::String &fileName)
|
bool HighlightManager::Exist(Edn::File &fileName)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
if (NULL != Get(fileName) ) {
|
||||||
for (i=0; i<listHighlight.size(); i++) {
|
|
||||||
if (true == listHighlight[i]->FileNameCompatible(fileName) ) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,39 +65,38 @@ void HighlightManager::loadLanguages(void)
|
|||||||
{
|
{
|
||||||
Edn::String homedir;
|
Edn::String homedir;
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
homedir = getenv("HOME");
|
homedir = "/usr/share/edn/";
|
||||||
homedir += "/.edn/";
|
|
||||||
#else
|
#else
|
||||||
homedir = "./";
|
homedir = "./data/";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Edn::String xmlFilename = homedir;
|
Edn::String xmlFilename = homedir;
|
||||||
xmlFilename += "data/lang_c.xml";
|
xmlFilename += "lang_c.xml";
|
||||||
Highlight *myHightline = new Highlight(xmlFilename);
|
Highlight *myHightline = new Highlight(xmlFilename);
|
||||||
listHighlight.push_back(myHightline);
|
listHighlight.push_back(myHightline);
|
||||||
|
|
||||||
xmlFilename = homedir;
|
xmlFilename = homedir;
|
||||||
xmlFilename += "data/lang_boo.xml";
|
xmlFilename += "lang_boo.xml";
|
||||||
myHightline = new Highlight(xmlFilename);
|
myHightline = new Highlight(xmlFilename);
|
||||||
listHighlight.push_back(myHightline);
|
listHighlight.push_back(myHightline);
|
||||||
|
|
||||||
xmlFilename = homedir;
|
xmlFilename = homedir;
|
||||||
xmlFilename += "data/lang_Makefile.xml";
|
xmlFilename += "lang_Makefile.xml";
|
||||||
myHightline = new Highlight(xmlFilename);
|
myHightline = new Highlight(xmlFilename);
|
||||||
listHighlight.push_back(myHightline);
|
listHighlight.push_back(myHightline);
|
||||||
|
|
||||||
xmlFilename = homedir;
|
xmlFilename = homedir;
|
||||||
xmlFilename += "data/lang_asm.xml";
|
xmlFilename += "lang_asm.xml";
|
||||||
myHightline = new Highlight(xmlFilename);
|
myHightline = new Highlight(xmlFilename);
|
||||||
listHighlight.push_back(myHightline);
|
listHighlight.push_back(myHightline);
|
||||||
|
|
||||||
xmlFilename = homedir;
|
xmlFilename = homedir;
|
||||||
xmlFilename += "data/lang_xml.xml";
|
xmlFilename += "lang_xml.xml";
|
||||||
myHightline = new Highlight(xmlFilename);
|
myHightline = new Highlight(xmlFilename);
|
||||||
listHighlight.push_back(myHightline);
|
listHighlight.push_back(myHightline);
|
||||||
|
|
||||||
xmlFilename = homedir;
|
xmlFilename = homedir;
|
||||||
xmlFilename += "data/lang_php.xml";
|
xmlFilename += "lang_php.xml";
|
||||||
myHightline = new Highlight(xmlFilename);
|
myHightline = new Highlight(xmlFilename);
|
||||||
listHighlight.push_back(myHightline);
|
listHighlight.push_back(myHightline);
|
||||||
|
|
||||||
|
@@ -45,8 +45,8 @@ class HighlightManager: public Singleton<HighlightManager>
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
void loadLanguages(void);
|
void loadLanguages(void);
|
||||||
Highlight * Get(Edn::String &fileName);
|
Highlight * Get(Edn::File &fileName);
|
||||||
bool Exist(Edn::String &fileName);
|
bool Exist(Edn::File &fileName);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<Highlight*> listHighlight; //!< List of ALL hightlight modules
|
std::vector<Highlight*> listHighlight; //!< List of ALL hightlight modules
|
||||||
|
@@ -98,10 +98,10 @@ bool HighlightPattern::IsEnable(void)
|
|||||||
void HighlightPattern::Display(void)
|
void HighlightPattern::Display(void)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
EDN_INFO("patern : \"" << m_paternName.c_str() << "\" level=" << m_level );
|
EDN_INFO("patern : \"" << m_paternName << "\" level=" << m_level );
|
||||||
EDN_INFO(" ==> colorName \"" << m_colorName.c_str() << "\"");
|
EDN_INFO(" ==> colorName \"" << m_colorName << "\"");
|
||||||
EDN_INFO(" ==> regExpStart \"" << m_regExpStart->GetRegExp().c_str() << "\"");
|
EDN_INFO(" ==> regExpStart \"" << m_regExpStart->GetRegExp() << "\"");
|
||||||
EDN_INFO(" ==> regExpStop \"" << m_regExpStop->GetRegExp().c_str() << "\"");
|
EDN_INFO(" ==> regExpStop \"" << m_regExpStop->GetRegExp() << "\"");
|
||||||
if (true == m_haveStopPatern) {
|
if (true == m_haveStopPatern) {
|
||||||
EDN_INFO(" ==> stop pattern: YES");
|
EDN_INFO(" ==> stop pattern: YES");
|
||||||
} else {
|
} else {
|
||||||
@@ -115,7 +115,7 @@ void HighlightPattern::Display(void)
|
|||||||
*/
|
*/
|
||||||
// Display all elements
|
// Display all elements
|
||||||
for (int32_t i=0; i< m_subPatern.Size(); i++) {
|
for (int32_t i=0; i< m_subPatern.Size(); i++) {
|
||||||
EDN_INFO(" " << i << " SubPattern : " << m_subPatern[i]->GetName().c_str() );
|
EDN_INFO(" " << i << " SubPattern : " << m_subPatern[i]->GetName() );
|
||||||
m_subPatern[i]->Display();
|
m_subPatern[i]->Display();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -99,10 +99,8 @@ void CTagsManager::OnMessage(int32_t id, int32_t dataID)
|
|||||||
{
|
{
|
||||||
GtkWidget *dialog = gtk_file_chooser_dialog_new( "Open Exuberant Ctags File", NULL,
|
GtkWidget *dialog = gtk_file_chooser_dialog_new( "Open Exuberant Ctags File", NULL,
|
||||||
GTK_FILE_CHOOSER_ACTION_OPEN,
|
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||||
GTK_STOCK_CANCEL, // button text
|
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||||
GTK_RESPONSE_CANCEL, // response id
|
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
|
||||||
GTK_STOCK_OPEN, // button text
|
|
||||||
GTK_RESPONSE_ACCEPT, // response id
|
|
||||||
NULL); // end button/response list
|
NULL); // end button/response list
|
||||||
if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
|
if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
|
||||||
{
|
{
|
||||||
@@ -141,7 +139,7 @@ void CTagsManager::LoadTagFile(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// load (open) the tag file :
|
// load (open) the tag file :
|
||||||
EDN_INFO("try to open tag file : " << m_tagFilename.c_str());
|
EDN_INFO("try to open tag file : " << m_tagFilename);
|
||||||
m_ctagFile = tagsOpen(m_tagFilename.c_str(), &info);
|
m_ctagFile = tagsOpen(m_tagFilename.c_str(), &info);
|
||||||
if (NULL != m_ctagFile) {
|
if (NULL != m_ctagFile) {
|
||||||
EDN_INFO("open exuberant Ctags file is OK ...");
|
EDN_INFO("open exuberant Ctags file is OK ...");
|
||||||
@@ -161,15 +159,112 @@ void CTagsManager::AddToHistory(int32_t bufferID)
|
|||||||
}
|
}
|
||||||
// add the current element
|
// add the current element
|
||||||
BufferManager *myBufferManager = BufferManager::getInstance();
|
BufferManager *myBufferManager = BufferManager::getInstance();
|
||||||
Edn::String currentFilename = myBufferManager->Get(bufferID)->GetName();
|
Edn::File currentFilename = myBufferManager->Get(bufferID)->GetFileName();
|
||||||
int32_t currentLineId = 0;
|
|
||||||
Edn::File * currentFile = new Edn::File(currentFilename);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CTAGS_COL_FILE = 0,
|
||||||
|
CTAGS_COL_REGEXP,
|
||||||
|
CTAGS_NUM_COLS
|
||||||
|
};
|
||||||
|
|
||||||
|
static GtkTreeModel * create_and_fill_model(void)
|
||||||
|
{
|
||||||
|
GtkListStore * store;
|
||||||
|
GtkTreeIter iter;
|
||||||
|
|
||||||
|
store = gtk_list_store_new(CTAGS_NUM_COLS, G_TYPE_STRING, G_TYPE_STRING);
|
||||||
|
|
||||||
|
// Append a row and fill in some data
|
||||||
|
gtk_list_store_append(store, &iter);
|
||||||
|
gtk_list_store_set(store, &iter,
|
||||||
|
CTAGS_COL_FILE, "file1.c",
|
||||||
|
CTAGS_COL_REGEXP, "void function1(void);",
|
||||||
|
-1);
|
||||||
|
|
||||||
|
gtk_list_store_append(store, &iter);
|
||||||
|
gtk_list_store_set(store, &iter,
|
||||||
|
CTAGS_COL_FILE, "file2.c",
|
||||||
|
CTAGS_COL_REGEXP, "void function2(void);",
|
||||||
|
-1);
|
||||||
|
|
||||||
|
gtk_list_store_append(store, &iter);
|
||||||
|
gtk_list_store_set(store, &iter,
|
||||||
|
CTAGS_COL_FILE, "file3.c",
|
||||||
|
CTAGS_COL_REGEXP, "void function3(void);",
|
||||||
|
-1);
|
||||||
|
|
||||||
|
return GTK_TREE_MODEL(store);
|
||||||
|
}
|
||||||
|
|
||||||
|
static GtkWidget * create_view_and_model(void)
|
||||||
|
{
|
||||||
|
GtkCellRenderer * renderer;
|
||||||
|
GtkTreeModel * model;
|
||||||
|
GtkWidget * view;
|
||||||
|
|
||||||
|
view = gtk_tree_view_new();
|
||||||
|
|
||||||
|
// Column 1
|
||||||
|
renderer = gtk_cell_renderer_text_new();
|
||||||
|
gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW (view),
|
||||||
|
-1,
|
||||||
|
"File",
|
||||||
|
renderer,
|
||||||
|
"text", CTAGS_COL_FILE,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
// Column 2
|
||||||
|
renderer = gtk_cell_renderer_text_new();
|
||||||
|
gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW (view),
|
||||||
|
-1,
|
||||||
|
"Regular Expression",
|
||||||
|
renderer,
|
||||||
|
"text", CTAGS_COL_REGEXP,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
model = create_and_fill_model();
|
||||||
|
|
||||||
|
gtk_tree_view_set_model(GTK_TREE_VIEW (view), model);
|
||||||
|
|
||||||
|
g_object_unref(model);
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void CTagsManager::MultipleJump(void)
|
||||||
|
{
|
||||||
|
// dlg to confirm the quit event :
|
||||||
|
GtkWidget *myDialog = gtk_dialog_new_with_buttons("C-Tags jump...",
|
||||||
|
NULL,
|
||||||
|
GTK_DIALOG_MODAL,
|
||||||
|
"Jump", GTK_RESPONSE_YES,
|
||||||
|
GTK_STOCK_QUIT, GTK_RESPONSE_NO,
|
||||||
|
NULL);
|
||||||
|
// Set over main windows
|
||||||
|
//gtk_window_set_transient_for(GTK_WINDOW(myDialog), GTK_WINDOW(m_mainWindow->GetWidget()));
|
||||||
|
// add writting area
|
||||||
|
GtkWidget *myContentArea = gtk_dialog_get_content_area( GTK_DIALOG(myDialog));
|
||||||
|
GtkWidget *listView = create_view_and_model ();
|
||||||
|
gtk_box_pack_start(GTK_BOX(myContentArea), listView, TRUE, TRUE, 0);
|
||||||
|
// Display it
|
||||||
|
gtk_widget_show_all(myContentArea);
|
||||||
|
int32_t result = gtk_dialog_run (GTK_DIALOG (myDialog));
|
||||||
|
// Get data from the gtk entry
|
||||||
|
|
||||||
|
// Remove dialogue
|
||||||
|
gtk_widget_destroy(myDialog);
|
||||||
|
}
|
||||||
|
|
||||||
void CTagsManager::JumpTo(void)
|
void CTagsManager::JumpTo(void)
|
||||||
{
|
{
|
||||||
|
MultipleJump();
|
||||||
if (NULL != m_ctagFile) {
|
if (NULL != m_ctagFile) {
|
||||||
Edn::VectorType<int8_t> data;
|
Edn::VectorType<int8_t> data;
|
||||||
// get the middle button of the clipboard ==> represent the current selection ...
|
// get the middle button of the clipboard ==> represent the current selection ...
|
||||||
@@ -185,23 +280,24 @@ void CTagsManager::JumpTo(void)
|
|||||||
BufferManager *myBufferManager = BufferManager::getInstance();
|
BufferManager *myBufferManager = BufferManager::getInstance();
|
||||||
Edn::String destinationFilename = m_tagFolderBase;
|
Edn::String destinationFilename = m_tagFolderBase;
|
||||||
destinationFilename += entry.file;
|
destinationFilename += entry.file;
|
||||||
EDN_INFO(" OPEN the TAG file Destination : " << destinationFilename.c_str() );
|
Edn::File myfile = destinationFilename;
|
||||||
if (false == myBufferManager->Exist(destinationFilename) ) {
|
EDN_INFO(" OPEN the TAG file Destination : " << myfile );
|
||||||
|
if (false == myBufferManager->Exist(myfile) ) {
|
||||||
// need to open the file :
|
// need to open the file :
|
||||||
int32_t openID = myBufferManager->Open(destinationFilename);
|
int32_t openID = myBufferManager->Open(myfile);
|
||||||
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, openID);
|
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, openID);
|
||||||
} else {
|
} else {
|
||||||
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, myBufferManager->GetId(destinationFilename));
|
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, myBufferManager->GetId(myfile));
|
||||||
}
|
}
|
||||||
int32_t localId = myBufferManager->GetId(destinationFilename);
|
int32_t localId = myBufferManager->GetId(myfile);
|
||||||
Edn::String pattern = entry.address.pattern;
|
Edn::String pattern = entry.address.pattern;
|
||||||
EDN_DEBUG("try to find line with : \"" << pattern.c_str() << "\"" );
|
EDN_DEBUG("try to find line with : \"" << pattern << "\"" );
|
||||||
if (pattern.Size() > 4) {
|
if (pattern.Size() > 4) {
|
||||||
pattern.Remove(0,2);
|
pattern.Remove(0,2);
|
||||||
pattern.Remove(pattern.Size()-1,2);
|
pattern.Remove(pattern.Size()-1,2);
|
||||||
}
|
}
|
||||||
// TODO : remove '\' char when needed ...
|
// TODO : remove '\' char when needed ...
|
||||||
EDN_DEBUG("try to find line with : \"" << pattern.c_str() << "\"" );
|
EDN_DEBUG("try to find line with : \"" << pattern << "\"" );
|
||||||
int32_t destLine = myBufferManager->Get(localId)->FindLine(pattern);
|
int32_t destLine = myBufferManager->Get(localId)->FindLine(pattern);
|
||||||
SendMessage(EDN_MSG__CURRENT_GOTO_LINE, destLine);
|
SendMessage(EDN_MSG__CURRENT_GOTO_LINE, destLine);
|
||||||
/*
|
/*
|
||||||
|
@@ -47,6 +47,7 @@ class CTagsManager: public Singleton<CTagsManager>, public MsgBroadcast
|
|||||||
private:
|
private:
|
||||||
int32_t m_currentSelectedID;
|
int32_t m_currentSelectedID;
|
||||||
void LoadTagFile(void);
|
void LoadTagFile(void);
|
||||||
|
void MultipleJump(void);
|
||||||
void JumpTo(void);
|
void JumpTo(void);
|
||||||
void PrintTag(const tagEntry *entry);
|
void PrintTag(const tagEntry *entry);
|
||||||
Edn::String GetFolder(Edn::String &inputString);
|
Edn::String GetFolder(Edn::String &inputString);
|
||||||
|
@@ -80,13 +80,13 @@ int main (int argc, char *argv[])
|
|||||||
ColorizeManager *myColorManager = NULL;
|
ColorizeManager *myColorManager = NULL;
|
||||||
myColorManager = ColorizeManager::getInstance();
|
myColorManager = ColorizeManager::getInstance();
|
||||||
Edn::String homedir;
|
Edn::String homedir;
|
||||||
|
//homedir = getenv("HOME");
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
homedir = getenv("HOME");
|
homedir = "/usr/share/edn/";
|
||||||
homedir += "/.edn/";
|
|
||||||
#else
|
#else
|
||||||
homedir = "./";
|
homedir = "./data/";
|
||||||
#endif
|
#endif
|
||||||
homedir += "data/color_black.xml";
|
homedir += "color_black.xml";
|
||||||
myColorManager->LoadFile( homedir.c_str() );
|
myColorManager->LoadFile( homedir.c_str() );
|
||||||
myColorManager->DisplayListOfColor();
|
myColorManager->DisplayListOfColor();
|
||||||
|
|
||||||
@@ -110,13 +110,8 @@ int main (int argc, char *argv[])
|
|||||||
EDN_INFO("show list of files : ");
|
EDN_INFO("show list of files : ");
|
||||||
for( int32_t i=1 ; i<argc; i++) {
|
for( int32_t i=1 ; i<argc; i++) {
|
||||||
EDN_INFO("need load file : \"" << argv[i] << "\"" );
|
EDN_INFO("need load file : \"" << argv[i] << "\"" );
|
||||||
Edn::String myfile = "";
|
Edn::File myfile = (char *)argv[i];
|
||||||
// Special case for the root file origin
|
|
||||||
if ('/' != argv[i][0]) {
|
|
||||||
myfile+=cCurrentPath;
|
|
||||||
myfile+="/";
|
|
||||||
}
|
|
||||||
myfile+=(char *)argv[i];
|
|
||||||
if (false == myBufferManager->Exist(myfile) ) {
|
if (false == myBufferManager->Exist(myfile) ) {
|
||||||
int32_t idBuffOpened = myBufferManager->Open(myfile);
|
int32_t idBuffOpened = myBufferManager->Open(myfile);
|
||||||
if (1==i) {
|
if (1==i) {
|
||||||
|
@@ -28,12 +28,35 @@
|
|||||||
#include "tools_globals.h"
|
#include "tools_globals.h"
|
||||||
#include "Edn.h"
|
#include "Edn.h"
|
||||||
|
|
||||||
|
#define MAX_FILE_NAME (10240)
|
||||||
|
|
||||||
|
#undef __class__
|
||||||
|
#define __class__ "Edn::File"
|
||||||
|
|
||||||
|
|
||||||
|
std::ostream& Edn::operator <<(std::ostream &os, const Edn::File &obj)
|
||||||
|
{
|
||||||
|
os << obj.m_folder;
|
||||||
|
os << "/";
|
||||||
|
os << obj.m_shortFilename;
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
Edn::File::File(Edn::String &filename, int32_t LineNumber)
|
Edn::File::File(Edn::String &filename, int32_t LineNumber)
|
||||||
{
|
{
|
||||||
m_lineNumberOpen = 0;
|
m_lineNumberOpen = LineNumber;
|
||||||
SetCompleateName(filename);
|
SetCompleateName(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Edn::File::File(const char *filename, int32_t LineNumber)
|
||||||
|
{
|
||||||
|
Edn::String tmpString = filename;
|
||||||
|
m_lineNumberOpen = LineNumber;
|
||||||
|
SetCompleateName(tmpString);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Edn::File::File(Edn::String &filename, Edn::String &folder, int32_t lineNumber)
|
Edn::File::File(Edn::String &filename, Edn::String &folder, int32_t lineNumber)
|
||||||
{
|
{
|
||||||
Edn::String tmpString = folder;
|
Edn::String tmpString = folder;
|
||||||
@@ -43,72 +66,178 @@ Edn::File::File(Edn::String &filename, Edn::String &folder, int32_t lineNumber)
|
|||||||
m_lineNumberOpen = lineNumber;
|
m_lineNumberOpen = lineNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Edn::File::~File(void)
|
Edn::File::~File(void)
|
||||||
{
|
{
|
||||||
// nothing to do ...
|
// nothing to do ...
|
||||||
}
|
}
|
||||||
|
|
||||||
void Edn::File::ExtranctAndName(Edn::String &inputString)
|
|
||||||
{
|
|
||||||
m_folder = "";
|
|
||||||
m_shortFilename = "";
|
|
||||||
|
|
||||||
for (int32_t iii=inputString.Size()-1; iii >= 0 ; iii--) {
|
Edn::String Edn::File::GetFolder(void) const
|
||||||
/*
|
|
||||||
if (inputString[iii] != '/') {
|
|
||||||
m_shortFilename.Insert(0, inputString[iii]);
|
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
char tmpVal[4096];
|
|
||||||
strncpy(tmpVal, inputString.c_str(), 4096);
|
|
||||||
tmpVal[4096-1] = '\0';
|
|
||||||
char *ptr = strrchr(tmpVal, '/');
|
|
||||||
if (NULL == ptr) {
|
|
||||||
ptr = strrchr(tmpVal, '\\');
|
|
||||||
}
|
|
||||||
Edn::String out = "./";
|
|
||||||
if (NULL != ptr) {
|
|
||||||
*ptr = '\0';
|
|
||||||
out = tmpVal;
|
|
||||||
out+= '/';
|
|
||||||
}
|
|
||||||
return out;
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Edn::String Edn::File::GetFolder(void)
|
|
||||||
{
|
{
|
||||||
return m_folder;
|
return m_folder;
|
||||||
}
|
}
|
||||||
|
|
||||||
Edn::String Edn::File::GetShortFilename(void)
|
Edn::String Edn::File::GetShortFilename(void) const
|
||||||
{
|
{
|
||||||
return m_shortFilename;
|
return m_shortFilename;
|
||||||
}
|
}
|
||||||
|
|
||||||
Edn::String Edn::File::GetCompleateName(void)
|
Edn::String Edn::File::GetCompleateName(void) const
|
||||||
{
|
{
|
||||||
Edn::String out;
|
Edn::String out;
|
||||||
out = m_folder;
|
out = m_folder;
|
||||||
out += '/';
|
out += '/';
|
||||||
out += m_shortFilename;
|
out += m_shortFilename;
|
||||||
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Edn::File& Edn::File::operator= (const Edn::File &ednF )
|
||||||
|
{
|
||||||
|
if( this != &ednF ) // avoid copy to itself
|
||||||
|
{
|
||||||
|
m_folder = ednF.m_folder;
|
||||||
|
m_shortFilename = ednF.m_shortFilename;
|
||||||
|
m_lineNumberOpen = ednF.m_lineNumberOpen;
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* @param[in,out]
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
bool Edn::File::operator== (const Edn::File &ednF) const
|
||||||
|
{
|
||||||
|
if( this != &ednF ) {
|
||||||
|
if (ednF.GetCompleateName() == GetCompleateName() ) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* @param[in,out]
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
bool Edn::File::operator!= (const Edn::File &ednF) const
|
||||||
|
{
|
||||||
|
return !(*this == ednF);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Edn::File::SetCompleateName(Edn::String &newFilename)
|
void Edn::File::SetCompleateName(Edn::String &newFilename)
|
||||||
{
|
{
|
||||||
|
char buf[MAX_FILE_NAME];
|
||||||
|
memset(buf, 0, MAX_FILE_NAME);
|
||||||
|
char * ok;
|
||||||
|
// Reset ALL DATA :
|
||||||
|
m_folder = "";
|
||||||
|
m_shortFilename = "";
|
||||||
|
m_lineNumberOpen = 0;
|
||||||
|
EDN_DEBUG("1 :Set Name : " << newFilename );
|
||||||
|
Edn::String destFilename;
|
||||||
|
if (newFilename.Size() == 0) {
|
||||||
|
destFilename = "no-name";
|
||||||
|
} else {
|
||||||
|
destFilename = newFilename;
|
||||||
|
}
|
||||||
|
//EDN_DEBUG("2 : Get file Name : " << destFilename );
|
||||||
|
if ('/' != *destFilename.c_str()) {
|
||||||
|
// Get the command came from the running of the program :
|
||||||
|
char cCurrentPath[FILENAME_MAX];
|
||||||
|
if (!getcwd(cCurrentPath, FILENAME_MAX)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cCurrentPath[FILENAME_MAX - 1] = '\0';
|
||||||
|
Edn::String tmpFilename = destFilename;
|
||||||
|
destFilename = cCurrentPath;
|
||||||
|
destFilename += '/';
|
||||||
|
destFilename += tmpFilename;
|
||||||
|
}
|
||||||
|
//EDN_DEBUG("3 : Get file Name : " << destFilename );
|
||||||
|
|
||||||
|
// Get the real Path of the current File
|
||||||
|
ok = realpath(destFilename.c_str(), buf);
|
||||||
|
if (!ok) {
|
||||||
|
int32_t lastPos = destFilename.FindBack('/');
|
||||||
|
if (-1 != lastPos) {
|
||||||
|
// Get the FileName
|
||||||
|
Edn::String tmpFilename = destFilename.Extract(lastPos+1);
|
||||||
|
destFilename.Remove(lastPos, destFilename.Size() - lastPos);
|
||||||
|
//EDN_DEBUG("try to find :\"" << destFilename << "\" / \"" << tmpFilename << "\" ");
|
||||||
|
ok = realpath(destFilename.c_str(), buf);
|
||||||
|
if (!ok) {
|
||||||
|
EDN_ERROR("Can not find real Path name of \"" << destFilename << "\"");
|
||||||
|
m_shortFilename = tmpFilename;
|
||||||
|
m_folder = destFilename;
|
||||||
|
} else {
|
||||||
|
// ALL is OK ...
|
||||||
|
m_shortFilename = tmpFilename;
|
||||||
|
m_folder = destFilename;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
EDN_WARNING("file : \"" << destFilename << "\" ==> No data???");
|
||||||
|
// Basic ERROR ...
|
||||||
|
m_shortFilename = destFilename;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
destFilename = buf;
|
||||||
|
int32_t lastPos = destFilename.FindBack('/');
|
||||||
|
if (-1 != lastPos) {
|
||||||
|
m_shortFilename = destFilename.Extract(lastPos+1);
|
||||||
|
m_folder = destFilename.Extract(0, lastPos);
|
||||||
|
} else {
|
||||||
|
// Basic ERROR ...
|
||||||
|
EDN_WARNING("file : \"" << destFilename << "\" ==> No data???");
|
||||||
|
m_shortFilename = destFilename;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EDN_DEBUG("Set FileName :\"" << m_folder << "\" / \"" << m_shortFilename << "\" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Edn::File::GetLineNumber(void)
|
int32_t Edn::File::GetLineNumber(void)
|
||||||
{
|
{
|
||||||
return m_lineNumberOpen;
|
return m_lineNumberOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Edn::File::HasExtention(void)
|
||||||
|
{
|
||||||
|
int32_t lastPos = m_shortFilename.FindBack('.');
|
||||||
|
if( -1 != lastPos // not find the .
|
||||||
|
&& 0 != lastPos // Find a . at the fist position .jdlskjdfklj ==> hiden file
|
||||||
|
&& m_shortFilename.Size() != lastPos ) // Remove file ended with .
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Edn::String Edn::File::GetExtention(void)
|
||||||
|
{
|
||||||
|
Edn::String tmpExt = "";
|
||||||
|
int32_t lastPos = m_shortFilename.FindBack('.');
|
||||||
|
if( -1 != lastPos // not find the .
|
||||||
|
&& 0 != lastPos // Find a . at the fist position .jdlskjdfklj ==> hiden file
|
||||||
|
&& m_shortFilename.Size() != lastPos ) // Remove file ended with .
|
||||||
|
{
|
||||||
|
// Get the FileName
|
||||||
|
tmpExt = m_shortFilename.Extract(lastPos+1);
|
||||||
|
}
|
||||||
|
return tmpExt;
|
||||||
|
}
|
||||||
|
@@ -33,21 +33,30 @@ namespace Edn
|
|||||||
public:
|
public:
|
||||||
File(void) { m_lineNumberOpen=0; }
|
File(void) { m_lineNumberOpen=0; }
|
||||||
File(Edn::String &filename, int32_t LineNumber = 0);
|
File(Edn::String &filename, int32_t LineNumber = 0);
|
||||||
|
File(const char *filename, int32_t LineNumber = 0);
|
||||||
File(Edn::String &filename, Edn::String &folder, int32_t lineNumber = 0);
|
File(Edn::String &filename, Edn::String &folder, int32_t lineNumber = 0);
|
||||||
~File(void);
|
~File(void);
|
||||||
Edn::String GetFolder(void);
|
Edn::String GetFolder(void) const;
|
||||||
Edn::String GetShortFilename(void);
|
Edn::String GetShortFilename(void) const;
|
||||||
Edn::String GetCompleateName(void);
|
Edn::String GetCompleateName(void) const;
|
||||||
|
bool HasExtention(void);
|
||||||
|
Edn::String GetExtention(void);
|
||||||
int32_t GetLineNumber(void);
|
int32_t GetLineNumber(void);
|
||||||
|
|
||||||
void SetCompleateName(Edn::String &newFilename);
|
void SetCompleateName(Edn::String &newFilename);
|
||||||
|
|
||||||
|
const Edn::File& operator= (const Edn::File &ednF );
|
||||||
|
bool operator== (const Edn::File &ednF ) const;
|
||||||
|
bool operator!= (const Edn::File &ednF ) const;
|
||||||
|
friend std::ostream& operator <<( std::ostream &os,const Edn::File &obj);
|
||||||
|
|
||||||
private :
|
private :
|
||||||
void ExtranctAndName(Edn::String &inputString);
|
|
||||||
Edn::String m_folder;
|
Edn::String m_folder;
|
||||||
Edn::String m_shortFilename;
|
Edn::String m_shortFilename;
|
||||||
int32_t m_lineNumberOpen;
|
int32_t m_lineNumberOpen;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
std::ostream& operator <<(std::ostream &os, const Edn::File &obj);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -28,8 +28,13 @@
|
|||||||
|
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "EdnString"
|
#define __class__ "Edn::String"
|
||||||
|
|
||||||
|
std::ostream& Edn::operator <<(std::ostream &os, const Edn::String &obj)
|
||||||
|
{
|
||||||
|
os << (char*)&obj.m_data[0];
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
@@ -385,6 +390,9 @@ Edn::String Edn::String::operator+ (const char * inputData)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
*
|
*
|
||||||
@@ -592,57 +600,57 @@ void Edn::TestUntaire_String(void)
|
|||||||
|
|
||||||
int32_t iddd = 0;
|
int32_t iddd = 0;
|
||||||
Edn::String * monString = new Edn::String();
|
Edn::String * monString = new Edn::String();
|
||||||
EDN_INFO("phase : " << iddd++ << " : \"" << monString->c_str() << "\"");
|
EDN_INFO("phase : " << iddd++ << " : \"" << monString << "\"");
|
||||||
delete(monString);
|
delete(monString);
|
||||||
|
|
||||||
monString = new Edn::String("test de direct data");
|
monString = new Edn::String("test de direct data");
|
||||||
EDN_INFO("phase : " << iddd++ << " : \"" << monString->c_str() << "\"");
|
EDN_INFO("phase : " << iddd++ << " : \"" << monString << "\"");
|
||||||
delete(monString);
|
delete(monString);
|
||||||
|
|
||||||
monString = new Edn::String("test de direct data", 7);
|
monString = new Edn::String("test de direct data", 7);
|
||||||
EDN_INFO("phase : " << iddd++ << " : \"" << monString->c_str() << "\"");
|
EDN_INFO("phase : " << iddd++ << " : \"" << monString << "\"");
|
||||||
delete(monString);
|
delete(monString);
|
||||||
|
|
||||||
int32_t testId = -6789;
|
int32_t testId = -6789;
|
||||||
monString = new Edn::String(testId);
|
monString = new Edn::String(testId);
|
||||||
EDN_INFO("phase : " << iddd++ << " : \"" << monString->c_str() << "\"");
|
EDN_INFO("phase : " << iddd++ << " : \"" << monString << "\"");
|
||||||
delete(monString);
|
delete(monString);
|
||||||
|
|
||||||
uint32_t testId2 = 12345;
|
uint32_t testId2 = 12345;
|
||||||
monString = new Edn::String((unsigned int)testId2);
|
monString = new Edn::String((unsigned int)testId2);
|
||||||
EDN_INFO("phase : " << iddd++ << " : \"" << monString->c_str() << "\"");
|
EDN_INFO("phase : " << iddd++ << " : \"" << monString << "\"");
|
||||||
delete(monString);
|
delete(monString);
|
||||||
|
|
||||||
Edn::String plop = "otherString";
|
Edn::String plop = "otherString";
|
||||||
monString = new Edn::String(plop);
|
monString = new Edn::String(plop);
|
||||||
EDN_INFO("phase : " << iddd++ << " : \"" << monString->c_str() << "\"");
|
EDN_INFO("phase : " << iddd++ << " : \"" << monString << "\"");
|
||||||
delete(monString);
|
delete(monString);
|
||||||
|
|
||||||
|
|
||||||
Edn::String s1 = "test de base ...";
|
Edn::String s1 = "test de base ...";
|
||||||
s1 += s1;
|
s1 += s1;
|
||||||
EDN_INFO("phase : " << iddd++ << " : \"" << s1.c_str() << "\"");
|
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
|
||||||
s1 += " plop 2 ";
|
s1 += " plop 2 ";
|
||||||
EDN_INFO("phase : " << iddd++ << " : \"" << s1.c_str() << "\"");
|
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
|
||||||
s1 += plop;
|
s1 += plop;
|
||||||
EDN_INFO("phase : " << iddd++ << " : \"" << s1.c_str() << "\"");
|
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
|
||||||
s1 = plop;
|
s1 = plop;
|
||||||
EDN_INFO("phase : " << iddd++ << " : \"" << s1.c_str() << "\"");
|
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
|
||||||
s1 = "test direct 44";
|
s1 = "test direct 44";
|
||||||
EDN_INFO("phase : " << iddd++ << " : \"" << s1.c_str() << "\"");
|
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
|
||||||
Edn::VectorType<int8_t> vb1;
|
Edn::VectorType<int8_t> vb1;
|
||||||
vb1.PushBack('v');
|
vb1.PushBack('v');
|
||||||
vb1.PushBack('b');
|
vb1.PushBack('b');
|
||||||
vb1.PushBack('1');
|
vb1.PushBack('1');
|
||||||
s1 = vb1;
|
s1 = vb1;
|
||||||
EDN_INFO("phase : " << iddd++ << " : \"" << s1.c_str() << "\"");
|
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
|
||||||
vb1.Clear();
|
vb1.Clear();
|
||||||
vb1.PushBack('v');
|
vb1.PushBack('v');
|
||||||
vb1.PushBack('b');
|
vb1.PushBack('b');
|
||||||
vb1.PushBack('2');
|
vb1.PushBack('2');
|
||||||
vb1.PushBack('\0');
|
vb1.PushBack('\0');
|
||||||
s1 = vb1;
|
s1 = vb1;
|
||||||
EDN_INFO("phase : " << iddd++ << " : \"" << s1.c_str() << "\"");
|
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
|
||||||
|
|
||||||
if (s1 == "vb2") {
|
if (s1 == "vb2") {
|
||||||
EDN_INFO("phase : " << iddd++ << " : == OK");
|
EDN_INFO("phase : " << iddd++ << " : == OK");
|
||||||
|
@@ -25,6 +25,8 @@
|
|||||||
#ifndef __END__STRING_H__
|
#ifndef __END__STRING_H__
|
||||||
#define __END__STRING_H__
|
#define __END__STRING_H__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
namespace Edn
|
namespace Edn
|
||||||
{
|
{
|
||||||
class String
|
class String
|
||||||
@@ -55,6 +57,7 @@ namespace Edn
|
|||||||
Edn::String operator+ (const Edn::String &ednS); // + operator
|
Edn::String operator+ (const Edn::String &ednS); // + operator
|
||||||
Edn::String operator+ (const char * inputData);
|
Edn::String operator+ (const char * inputData);
|
||||||
//operator const char *()
|
//operator const char *()
|
||||||
|
friend std::ostream& operator <<( std::ostream &os,const Edn::String &obj);
|
||||||
|
|
||||||
bool IsEmpty(void) const;
|
bool IsEmpty(void) const;
|
||||||
int32_t Size(void) const;
|
int32_t Size(void) const;
|
||||||
@@ -76,7 +79,14 @@ namespace Edn
|
|||||||
};
|
};
|
||||||
|
|
||||||
void TestUntaire_String(void);
|
void TestUntaire_String(void);
|
||||||
|
|
||||||
|
std::ostream& operator <<(std::ostream &os, const Edn::String &obj);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -17,8 +17,7 @@
|
|||||||
- Project manager phase 1
|
- Project manager phase 1
|
||||||
|
|
||||||
# action a faire (ordonner) :
|
# action a faire (ordonner) :
|
||||||
- sys : la methode de close est mauvaise...
|
- HL : Parsing caracter/caract<63>re et plus section par section ...
|
||||||
- gui : Goto line (need only the gui)
|
|
||||||
- ctags : Back simple et multiple
|
- ctags : Back simple et multiple
|
||||||
- ctags : Multiple files
|
- ctags : Multiple files
|
||||||
- sys : search complet, replace complet
|
- sys : search complet, replace complet
|
||||||
@@ -31,14 +30,12 @@
|
|||||||
* matlab
|
* matlab
|
||||||
* java script
|
* java script
|
||||||
* SQL
|
* SQL
|
||||||
* Assembleur
|
|
||||||
- project : list of current files open
|
- project : list of current files open
|
||||||
- gui : demander l'enregistrement avant de fermer (quand c'est n<>cessaire)
|
- gui : demander l'enregistrement avant de fermer (quand c'est n<>cessaire)
|
||||||
- gui : demande de cr<63>ation de nouveaux fichier ou quiter l'editeur ...
|
- gui : demande de cr<63>ation de nouveaux fichier ou quiter l'editeur ...
|
||||||
- gui : ascenceur quand n<>cessaire
|
- gui : ascenceur quand n<>cessaire
|
||||||
- gui : Demander la cr<63>ation de nouveaux fichier quand il n'existe pas (a l'ouverture en ligne de commande)
|
- gui : Demander la cr<63>ation de nouveaux fichier quand il n'existe pas (a l'ouverture en ligne de commande)
|
||||||
- Catch Shift+TAB
|
- Catch Shift+TAB
|
||||||
- Correction du bug de display quand on vas vers la fin, et mise en place d'un display qui met toujours le meme temps
|
|
||||||
- Correction du bug des entr<74> bizard tel que les chapot et les guillemets
|
- Correction du bug des entr<74> bizard tel que les chapot et les guillemets
|
||||||
- gui : Parameters : et en autre la taille de la police ... et voir pour la r<>cup<75>rer sur le system... et ce serait cool...
|
- gui : Parameters : et en autre la taille de la police ... et voir pour la r<>cup<75>rer sur le system... et ce serait cool...
|
||||||
- PB de copier coller sur les <20><> ...
|
- PB de copier coller sur les <20><> ...
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<EdnLang version="0.1" lang="c">
|
<EdnLang version="0.1" lang="c">
|
||||||
<ext>Makefile</ext>
|
<ext>Makefile</ext>
|
||||||
<ext>.mk</ext>
|
<ext>*.mk</ext>
|
||||||
|
<ext>*.global</ext>
|
||||||
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
||||||
<rule name="my preprocesseur">
|
<rule name="my preprocesseur">
|
||||||
<color>preprocesseur</color>
|
<color>preprocesseur</color>
|
||||||
@@ -9,9 +10,23 @@
|
|||||||
<end>\n</end>
|
<end>\n</end>
|
||||||
<EscapeChar>\</EscapeChar>
|
<EscapeChar>\</EscapeChar>
|
||||||
</rule>
|
</rule>
|
||||||
|
<rule name="doubleQuteText">
|
||||||
|
<color>doubleQuoteText</color>
|
||||||
|
<start>"</start>
|
||||||
|
<end>"</end>
|
||||||
|
<EscapeChar>\</EscapeChar>
|
||||||
|
</rule>
|
||||||
|
<rule name="simpleQuteText">
|
||||||
|
<color>doubleQuoteText</color>
|
||||||
|
<start>'</start>
|
||||||
|
<end>'</end>
|
||||||
|
</rule>
|
||||||
</pass1>
|
</pass1>
|
||||||
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
|
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
|
||||||
|
<rule name="my keyword">
|
||||||
|
<color>keyword</color>
|
||||||
|
<start>\$\([a-zA-Z_][a-zA-Z0-9_]*\)</start>
|
||||||
|
</rule>
|
||||||
</pass2>
|
</pass2>
|
||||||
</EdnLang>
|
</EdnLang>
|
||||||
|
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<EdnLang version="0.1" lang="Assembleur">
|
<EdnLang version="0.1" lang="Assembleur">
|
||||||
<ext>.s</ext>
|
<ext>*.s</ext>
|
||||||
<ext>.S</ext>
|
<ext>*.S</ext>
|
||||||
<ext>.asm</ext>
|
<ext>*.asm</ext>
|
||||||
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
||||||
<rule name="my comment multiline doxygen">
|
<rule name="my comment multiline doxygen">
|
||||||
<color>commentDoxygen</color>
|
<color>commentDoxygen</color>
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<EdnLang version="0.1" lang="c">
|
<EdnLang version="0.1" lang="c">
|
||||||
<ext>.boo</ext>
|
<ext>*.boo</ext>
|
||||||
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
||||||
</pass1>
|
</pass1>
|
||||||
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
|
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<EdnLang version="0.1" lang="c">
|
<EdnLang version="0.1" lang="c">
|
||||||
<ext>.c</ext>
|
<ext>*.c</ext>
|
||||||
<ext>.cpp</ext>
|
<ext>*.cpp</ext>
|
||||||
<ext>.h</ext>
|
<ext>*.h</ext>
|
||||||
<ext>.hpp</ext>
|
<ext>*.hpp</ext>
|
||||||
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
||||||
<rule name="my comment multiline doxygen">
|
<rule name="my comment multiline doxygen">
|
||||||
<color>commentDoxygen</color>
|
<color>commentDoxygen</color>
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<EdnLang version="0.1" lang="c">
|
<EdnLang version="0.1" lang="c">
|
||||||
<ext>.php</ext>
|
<ext>*.php</ext>
|
||||||
<ext>.php3</ext>
|
<ext>*.php3</ext>
|
||||||
<ext>.php4</ext>
|
<ext>*.php4</ext>
|
||||||
<ext>.phtml</ext>
|
<ext>*.phtml</ext>
|
||||||
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
||||||
<rule name="my comment multiline">
|
<rule name="my comment multiline">
|
||||||
<color>comment</color>
|
<color>comment</color>
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<EdnLang version="0.1" lang="Assembleur">
|
<EdnLang version="0.1" lang="Assembleur">
|
||||||
<ext>.xml</ext>
|
<ext>*.xml</ext>
|
||||||
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
||||||
<rule name="Comment">
|
<rule name="Comment">
|
||||||
<color>comment</color>
|
<color>comment</color>
|
||||||
|
@@ -21,7 +21,6 @@ You can NOT:
|
|||||||
- Add malware in the Sources.
|
- Add malware in the Sources.
|
||||||
- Do something bad with the sources.
|
- Do something bad with the sources.
|
||||||
- Use it to travel in the space with a toaster.
|
- Use it to travel in the space with a toaster.
|
||||||
- Write Java sources code with this software.
|
|
||||||
|
|
||||||
I reserve the right to change this licence. If it change the version of the copy you have keep its own license
|
I reserve the right to change this license. If it change the version of the copy you have keep its own license
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user