Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
88b76c074d | |||
28b709bfb8 | |||
1c01dbd7cd | |||
948240f05f | |||
990828c69c | |||
72f63a8990 | |||
4d2eced7a0 | |||
6598a22981 | |||
01276b581f | |||
fd13467832 | |||
643f2e38b3 | |||
c30f57b3f7 | |||
514a5cf003 | |||
0c1f6004eb | |||
c02747d8fb | |||
80dae2dab9 | |||
bd8c11a9da | |||
1f08a99ac1 | |||
0eeb214369 |
10
Makefile
10
Makefile
@@ -155,8 +155,7 @@ CXXFILES+= tools/EdnTemplate/EdnVectorBuf.cpp \
|
|||||||
tools/EdnBuf/EdnBufHistory.cpp
|
tools/EdnBuf/EdnBufHistory.cpp
|
||||||
|
|
||||||
|
|
||||||
# Tools internal:
|
# Tools internal:
|
||||||
CXXFILES+= tools/AL/AL_Mutex.cpp \
|
|
||||||
CXXFILES+= tools/Display/Display.cpp \
|
CXXFILES+= tools/Display/Display.cpp \
|
||||||
tools/ClipBoard/ClipBoard.cpp \
|
tools/ClipBoard/ClipBoard.cpp \
|
||||||
tools/MsgBroadcast/MsgBroadcast.cpp \
|
tools/MsgBroadcast/MsgBroadcast.cpp \
|
||||||
@@ -221,11 +220,10 @@ build: .encadrer .versionFile $(OUTPUT_NAME)
|
|||||||
@echo $(CADRE_COTERS)
|
@echo $(CADRE_COTERS)
|
||||||
@echo '
|
@echo '
|
||||||
DEBUT DE COMPILATION DU PROGRAMME :'$(CADRE_COTERS)
|
DEBUT DE COMPILATION DU PROGRAMME :'$(CADRE_COTERS)
|
||||||
@echo '
|
@echo '
|
||||||
Repertoire Sources : $(FILE_DIRECTORY)/'$(CADRE_COTERS)
|
Repertoire Sources : $(FILE_DIRECTORY)/'$(CADRE_COTERS)
|
||||||
@echo '
|
@echo '
|
||||||
Repertoire object : $(OBJECT_DIRECTORY)/'$(CADRE_COTERS)
|
Repertoire object : $(OBJECT_DIRECTORY)/'$(CADRE_COTERS)
|
||||||
@echo '
|
|
||||||
@echo '
|
@echo '
|
||||||
Binaire de sortie : $(F_VIOLET)$(OUTPUT_NAME) $(F_NORMALE)'$(CADRE_COTERS)
|
Binaire de sortie : $(F_VIOLET)$(OUTPUT_NAME) $(F_NORMALE)'$(CADRE_COTERS)
|
||||||
@echo $(CADRE_COTERS)
|
@echo $(CADRE_COTERS)
|
||||||
@@ -296,7 +294,11 @@ install: .encadrer .versionFile $(OUTPUT_NAME_RELEASE)
|
|||||||
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 ' 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 $(F_ROUGE)"
|
||||||
|
(stripped) $(OUTPUT_NAME_RELEASE) => $(PROG_NAME) "$(F_NORMALE)
|
||||||
@cp $(OUTPUT_NAME_RELEASE) $(PROG_NAME)
|
@cp $(OUTPUT_NAME_RELEASE) $(PROG_NAME)
|
||||||
@strip -s $(PROG_NAME)
|
@strip -s $(PROG_NAME)
|
||||||
@echo $(F_VERT)"
|
@echo $(F_VERT)"
|
||||||
|
21
README
21
README
@@ -1,21 +0,0 @@
|
|||||||
Edn (Editeur De N'ours) is a FREE software.
|
|
||||||
|
|
||||||
This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
|
|
||||||
|
|
||||||
Terms of license:
|
|
||||||
|
|
||||||
You can:
|
|
||||||
- Redistribute the sources code and binaries.
|
|
||||||
- Modify the Sources code.
|
|
||||||
- Use a part of the sources (less than 50%) in an other software, just write somewhere "Edn is great" visible by the user (on your product or on your website with a link to my page).
|
|
||||||
- Redistribute the modification only if you want.
|
|
||||||
- Send me the bug-fix (it could be great).
|
|
||||||
- Pay me a beer or some other things.
|
|
||||||
- Print the source code on WC paper ...
|
|
||||||
You can NOT:
|
|
||||||
- Earn money with this Software (But I can).
|
|
||||||
- Add malware in the Sources.
|
|
||||||
- Do something bad with the sources.
|
|
||||||
- Use it to travel in the space with a toaster.
|
|
||||||
|
|
||||||
I reserve the right to change this licence. If it change the version of the copy you have keep its own license
|
|
41
README.md
Normal file
41
README.md
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
Edn
|
||||||
|
====
|
||||||
|
|
||||||
|
`Edn` (Editeur De N'ours) is a FREE software.
|
||||||
|
|
||||||
|
This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
|
||||||
|
|
||||||
|
Instructions
|
||||||
|
============
|
||||||
|
|
||||||
|
download the software :
|
||||||
|
|
||||||
|
git clone git://github.com/HeeroYui/edn.git
|
||||||
|
cd edn
|
||||||
|
|
||||||
|
Compile software and install :
|
||||||
|
|
||||||
|
sudo make DEBUG=0 install
|
||||||
|
|
||||||
|
Run Software :
|
||||||
|
|
||||||
|
edn exemple.txt
|
||||||
|
|
||||||
|
License
|
||||||
|
=======
|
||||||
|
|
||||||
|
You can:
|
||||||
|
- Redistribute the sources code and binaries.
|
||||||
|
- Modify the Sources code.
|
||||||
|
- Use a part of the sources (less than 50%) in an other software, just write somewhere "Edn is great" visible by the user (on your product or on your website with a link to my page).
|
||||||
|
- Redistribute the modification only if you want.
|
||||||
|
- Send me the bug-fix (it could be great).
|
||||||
|
- Pay me a beer or some other things.
|
||||||
|
- Print the source code on WC paper ...
|
||||||
|
You can NOT:
|
||||||
|
- Earn money with this Software (But I can).
|
||||||
|
- Add malware in the Sources.
|
||||||
|
- Do something bad with the sources.
|
||||||
|
- Use it to travel in the space with a toaster.
|
||||||
|
|
||||||
|
I reserve the right to change this licence. If it change the version of the copy you have keep its own license
|
@@ -47,6 +47,7 @@ Buffer::Buffer()
|
|||||||
Edn::String mString = "Untitle - ";
|
Edn::String mString = "Untitle - ";
|
||||||
mString += fileBasicID++;
|
mString += fileBasicID++;
|
||||||
SetFileName(mString);
|
SetFileName(mString);
|
||||||
|
m_haveName = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -137,7 +138,6 @@ void Buffer::SetLineDisplay(uint32_t lineNumber)
|
|||||||
// nothing to do
|
// nothing to do
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
*
|
*
|
||||||
@@ -290,6 +290,21 @@ void Buffer::JumpAtLine(int32_t newLine)
|
|||||||
// nothing to do
|
// nothing to do
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the current line (to know where to jump)
|
||||||
|
*
|
||||||
|
* @param ---
|
||||||
|
*
|
||||||
|
* @return Return the current line number
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
int32_t Buffer::GetCurrentLine(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief request a copy of the selection in the named clipBoard ID
|
* @brief request a copy of the selection in the named clipBoard ID
|
||||||
*
|
*
|
||||||
|
@@ -106,6 +106,7 @@ class Buffer {
|
|||||||
virtual void Replace(Edn::String &data);
|
virtual void Replace(Edn::String &data);
|
||||||
virtual int32_t FindLine(Edn::String &data);
|
virtual int32_t FindLine(Edn::String &data);
|
||||||
virtual void JumpAtLine(int32_t newLine);
|
virtual void JumpAtLine(int32_t newLine);
|
||||||
|
virtual int32_t GetCurrentLine(void);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool m_fileModify; //!<
|
bool m_fileModify; //!<
|
||||||
|
@@ -229,8 +229,6 @@ void BufferText::SetLineDisplay(uint32_t lineNumber)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void BufferText::DrawLineNumber(DrawerManager &drawer,char *myPrint, int32_t lineNumber, int32_t positionY)
|
void BufferText::DrawLineNumber(DrawerManager &drawer,char *myPrint, int32_t lineNumber, int32_t positionY)
|
||||||
{
|
{
|
||||||
char tmpLineNumber[50];
|
char tmpLineNumber[50];
|
||||||
@@ -1094,6 +1092,21 @@ void BufferText::JumpAtLine(int32_t newLine)
|
|||||||
UpdateWindowsPosition(true);
|
UpdateWindowsPosition(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the current line (to know where to jump)
|
||||||
|
*
|
||||||
|
* @param ---
|
||||||
|
*
|
||||||
|
* @return Return the current line number
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
int32_t BufferText::GetCurrentLine(void)
|
||||||
|
{
|
||||||
|
return m_EdnBuf.CountLines(0, m_cursorPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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 << "\"");
|
EDN_INFO("Search data : \"" << data << "\"");
|
||||||
@@ -1189,9 +1202,9 @@ void BufferText::Replace(Edn::String &data)
|
|||||||
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
|
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
|
||||||
if (true == haveSelectionActive) {
|
if (true == haveSelectionActive) {
|
||||||
// Replace Data :
|
// Replace Data :
|
||||||
// TODO : Reset this : ... m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, data.GetDirectPointer());//, strlen(data.GetDirectPointer()));
|
Edn::VectorType<int8_t> myData = data.GetVector();
|
||||||
// TODO : Reset this : ... SetInsertPosition(SelectionStart + strlen(data.GetDirectPointer()));
|
m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, myData);
|
||||||
|
SetInsertPosition(SelectionStart + myData.Size());
|
||||||
}
|
}
|
||||||
SetModify(true);
|
SetModify(true);
|
||||||
}
|
}
|
||||||
|
@@ -65,6 +65,8 @@ class BufferText : public Buffer {
|
|||||||
void Replace(Edn::String &data);
|
void Replace(Edn::String &data);
|
||||||
int32_t FindLine(Edn::String &data);
|
int32_t FindLine(Edn::String &data);
|
||||||
void JumpAtLine(int32_t newLine);
|
void JumpAtLine(int32_t newLine);
|
||||||
|
int32_t GetCurrentLine(void);
|
||||||
|
|
||||||
void RemoveLine(void);
|
void RemoveLine(void);
|
||||||
void SelectAll(void);
|
void SelectAll(void);
|
||||||
void SelectNone(void);
|
void SelectNone(void);
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* @file ColoriseManager.cpp
|
* @file ColorizeManager.cpp
|
||||||
* @brief Editeur De N'ours : Colorising Manager
|
* @brief Editeur De N'ours : Colorising Manager
|
||||||
* @author Edouard DUPIN
|
* @author Edouard DUPIN
|
||||||
* @date 14/12/2010
|
* @date 14/12/2010
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
#define PFX "ColorizeManager "
|
#define PFX "ColorizeManager "
|
||||||
|
|
||||||
|
|
||||||
ColorizeManager::ColorizeManager(void)
|
ColorizeManager::ColorizeManager(void) : MsgBroadcast("Colorize Manager", EDN_CAT_COLOR)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,6 +51,22 @@ ColorizeManager::~ColorizeManager(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ColorizeManager::OnMessage(int32_t id, int32_t dataID)
|
||||||
|
{
|
||||||
|
switch (id)
|
||||||
|
{
|
||||||
|
case EDN_MSG__RELOAD_COLOR_FILE:
|
||||||
|
{
|
||||||
|
// Reaload File
|
||||||
|
// TODO : Check this : Pb in the recopy Edn::String element
|
||||||
|
Edn::String plop = m_fileColor;
|
||||||
|
LoadFile(plop.c_str());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ColorizeManager::LoadFile(Edn::String &xmlFilename)
|
void ColorizeManager::LoadFile(Edn::String &xmlFilename)
|
||||||
{
|
{
|
||||||
LoadFile(xmlFilename.c_str());
|
LoadFile(xmlFilename.c_str());
|
||||||
@@ -58,6 +74,20 @@ void ColorizeManager::LoadFile(Edn::String &xmlFilename)
|
|||||||
|
|
||||||
void ColorizeManager::LoadFile(const char * xmlFilename)
|
void ColorizeManager::LoadFile(const char * xmlFilename)
|
||||||
{
|
{
|
||||||
|
// Remove all old color :
|
||||||
|
int32_t i;
|
||||||
|
// clean all Element
|
||||||
|
for (i=0; i< listMyColor.Size(); i++) {
|
||||||
|
if (NULL != listMyColor[i]) {
|
||||||
|
delete(listMyColor[i]);
|
||||||
|
listMyColor[i] = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// clear the compleate list
|
||||||
|
listMyColor.Clear();
|
||||||
|
|
||||||
|
m_fileColor = xmlFilename;
|
||||||
|
EDN_DEBUG("open file (COLOR) \"" << xmlFilename << "\" ? = \"" << m_fileColor << "\"");
|
||||||
errorColor = new Colorize();
|
errorColor = new Colorize();
|
||||||
errorColor->SetBgColor("#000000");
|
errorColor->SetBgColor("#000000");
|
||||||
errorColor->SetFgColor("#FFFFFF");
|
errorColor->SetFgColor("#FFFFFF");
|
||||||
@@ -67,22 +97,17 @@ void ColorizeManager::LoadFile(const char * xmlFilename)
|
|||||||
// open the curent File
|
// open the curent File
|
||||||
XmlDocument.LoadFile(xmlFilename);
|
XmlDocument.LoadFile(xmlFilename);
|
||||||
TiXmlElement* root = XmlDocument.FirstChildElement( "EdnColor" );
|
TiXmlElement* root = XmlDocument.FirstChildElement( "EdnColor" );
|
||||||
if (NULL == root )
|
if (NULL == root ) {
|
||||||
{
|
|
||||||
EDN_ERROR(PFX"(l ?) main node not find: \"EdnColor\" in \"" << xmlFilename << "\"");
|
EDN_ERROR(PFX"(l ?) main node not find: \"EdnColor\" in \"" << xmlFilename << "\"");
|
||||||
return;
|
return;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
TiXmlNode * pNode = root->FirstChild();
|
TiXmlNode * pNode = root->FirstChild();
|
||||||
while(NULL != pNode)
|
while(NULL != pNode) {
|
||||||
{
|
|
||||||
if (pNode->Type()==TiXmlNode::TINYXML_COMMENT) {
|
if (pNode->Type()==TiXmlNode::TINYXML_COMMENT) {
|
||||||
// nothing to do, just proceed to next step
|
// nothing to do, just proceed to next step
|
||||||
} else if (!strcmp(pNode->Value(), "gui")) {
|
} else if (!strcmp(pNode->Value(), "gui")) {
|
||||||
TiXmlNode * pGuiNode = pNode->FirstChild();
|
TiXmlNode * pGuiNode = pNode->FirstChild();
|
||||||
while(NULL != pGuiNode)
|
while(NULL != pGuiNode) {
|
||||||
{
|
|
||||||
if (pGuiNode->Type()==TiXmlNode::TINYXML_COMMENT) {
|
if (pGuiNode->Type()==TiXmlNode::TINYXML_COMMENT) {
|
||||||
// nothing to do, just proceed to next step
|
// nothing to do, just proceed to next step
|
||||||
} else if (!strcmp(pGuiNode->Value(), "color")) {
|
} else if (!strcmp(pGuiNode->Value(), "color")) {
|
||||||
@@ -203,6 +228,8 @@ void ColorizeManager::LoadFile(const char * xmlFilename)
|
|||||||
pNode = pNode->NextSibling();
|
pNode = pNode->NextSibling();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
SendMessage(EDN_MSG__COLOR_HAS_CHANGE);
|
||||||
|
SendMessage(EDN_MSG__USER_DISPLAY_CHANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
Colorize *ColorizeManager::Get(const char *colorName)
|
Colorize *ColorizeManager::Get(const char *colorName)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* @file ColoriseManager.h
|
* @file ColorizeManager.h
|
||||||
* @brief Editeur De N'ours : Colorising Manager (header)
|
* @brief Editeur De N'ours : Colorising Manager (header)
|
||||||
* @author Edouard DUPIN
|
* @author Edouard DUPIN
|
||||||
* @date 14/12/2010
|
* @date 14/12/2010
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include "Singleton.h"
|
#include "Singleton.h"
|
||||||
#include "Colorize.h"
|
#include "Colorize.h"
|
||||||
|
#include "MsgBroadcast.h"
|
||||||
#include "Edn.h"
|
#include "Edn.h"
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@@ -49,7 +50,7 @@ typedef enum {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ColorizeManager: public Singleton<ColorizeManager>
|
class ColorizeManager: public Singleton<ColorizeManager>, public MsgBroadcast
|
||||||
{
|
{
|
||||||
friend class Singleton<ColorizeManager>;
|
friend class Singleton<ColorizeManager>;
|
||||||
// specific for sigleton system...
|
// specific for sigleton system...
|
||||||
@@ -57,6 +58,8 @@ class ColorizeManager: public Singleton<ColorizeManager>
|
|||||||
// Constructeur
|
// Constructeur
|
||||||
ColorizeManager(void);
|
ColorizeManager(void);
|
||||||
~ColorizeManager(void);
|
~ColorizeManager(void);
|
||||||
|
public:
|
||||||
|
void OnMessage(int32_t id, int32_t dataID);
|
||||||
public:
|
public:
|
||||||
void LoadFile(Edn::String &xmlFilename);
|
void LoadFile(Edn::String &xmlFilename);
|
||||||
void LoadFile(const char * xmlFilename);
|
void LoadFile(const char * xmlFilename);
|
||||||
@@ -68,6 +71,7 @@ class ColorizeManager: public Singleton<ColorizeManager>
|
|||||||
void DisplayListOfColor(void);
|
void DisplayListOfColor(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Edn::String m_fileColor;
|
||||||
Edn::VectorType<Colorize*> listMyColor; //!< List of ALL Color
|
Edn::VectorType<Colorize*> listMyColor; //!< List of ALL Color
|
||||||
Colorize * errorColor;
|
Colorize * errorColor;
|
||||||
color_ts basicColors[COLOR_NUMBER_MAX];
|
color_ts basicColors[COLOR_NUMBER_MAX];
|
||||||
|
@@ -100,6 +100,10 @@ void BufferView::OnMessage(int32_t id, int32_t dataID)
|
|||||||
// change Title :
|
// change Title :
|
||||||
gtk_widget_queue_draw(m_widget);
|
gtk_widget_queue_draw(m_widget);
|
||||||
break;
|
break;
|
||||||
|
case EDN_MSG__USER_DISPLAY_CHANGE:
|
||||||
|
// Redraw all the display ...
|
||||||
|
gtk_widget_queue_draw(m_widget);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,6 +142,9 @@ gboolean BufferView::CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, g
|
|||||||
EDN_INFO("Request a display of : " << self->m_shawableAreaX << "px * "<< self->m_shawableAreaY<<"px");
|
EDN_INFO("Request a display of : " << self->m_shawableAreaX << "px * "<< self->m_shawableAreaY<<"px");
|
||||||
DrawerManager monDrawer(widget, self->m_shawableAreaX, self->m_shawableAreaY);
|
DrawerManager monDrawer(widget, self->m_shawableAreaX, self->m_shawableAreaY);
|
||||||
|
|
||||||
|
// clean buffer
|
||||||
|
monDrawer.Clean(self->m_colorManager->Get(COLOR_LIST_BG_1));
|
||||||
|
|
||||||
// get the number of buffer open
|
// get the number of buffer open
|
||||||
int32_t nbBufferOpen = self->m_bufferManager->Size();
|
int32_t nbBufferOpen = self->m_bufferManager->Size();
|
||||||
int32_t i;
|
int32_t i;
|
||||||
|
@@ -179,6 +179,9 @@ void CodeView::OnMessage(int32_t id, int32_t dataID)
|
|||||||
case EDN_MSG__CURRENT_SET_CHARSET:
|
case EDN_MSG__CURRENT_SET_CHARSET:
|
||||||
m_bufferManager->Get(m_bufferID)->SetCharset((charset_te)dataID);
|
m_bufferManager->Get(m_bufferID)->SetCharset((charset_te)dataID);
|
||||||
break;
|
break;
|
||||||
|
case EDN_MSG__USER_DISPLAY_CHANGE:
|
||||||
|
// Redraw all the display ... Done under ...
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
// Force redraw of the widget
|
// Force redraw of the widget
|
||||||
gtk_widget_queue_draw(m_widget);
|
gtk_widget_queue_draw(m_widget);
|
||||||
|
@@ -40,15 +40,31 @@ MainWindows::MainWindows(void) : MsgBroadcast("Main Windows", EDN_CAT_GUI)
|
|||||||
m_mainWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
m_mainWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||||
|
|
||||||
// select the program icone
|
// select the program icone
|
||||||
gtk_window_set_default_icon_name("text-editor");
|
GError *err = NULL;
|
||||||
|
Edn::String iconeFile;
|
||||||
|
#ifdef NDEBUG
|
||||||
|
iconeFile = "/usr/share/edn/images/icone.png";
|
||||||
|
#else
|
||||||
|
iconeFile = "./data/imagesSources/icone.png";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
GdkPixbuf * icone = gdk_pixbuf_new_from_file(iconeFile.c_str(), &err);
|
||||||
|
if (err != NULL) {
|
||||||
|
gtk_window_set_default_icon_name("text-editor");
|
||||||
|
} else {
|
||||||
|
gtk_window_set_icon(GTK_WINDOW(m_mainWindow), icone);
|
||||||
|
}
|
||||||
// Default size open windows
|
// Default size open windows
|
||||||
gtk_window_set_default_size(GTK_WINDOW(m_mainWindow), 800, 600);
|
gtk_window_set_default_size(GTK_WINDOW(m_mainWindow), 800, 600);
|
||||||
|
|
||||||
// enable the close signal of the windows
|
// enable the close signal of the windows
|
||||||
g_signal_connect(G_OBJECT(m_mainWindow), "delete-event", G_CALLBACK(OnQuit), this);
|
g_signal_connect(G_OBJECT(m_mainWindow), "delete-event", G_CALLBACK(OnQuit), this);
|
||||||
|
g_signal_connect(G_OBJECT(m_mainWindow), "window-state-event", G_CALLBACK(OnStateChange), this);
|
||||||
//g_signal_connect(G_OBJECT(m_mainWindow), "destroy", G_CALLBACK(OnQuit), this);
|
//g_signal_connect(G_OBJECT(m_mainWindow), "destroy", G_CALLBACK(OnQuit), this);
|
||||||
|
|
||||||
|
// remove decoration
|
||||||
|
//gtk_window_set_decorated(GTK_WINDOW(m_mainWindow), FALSE);
|
||||||
|
|
||||||
// Create a vertical box for stacking the menu and editor widgets in.
|
// Create a vertical box for stacking the menu and editor widgets in.
|
||||||
GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
|
GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
|
||||||
gtk_container_add(GTK_CONTAINER(m_mainWindow), vbox);
|
gtk_container_add(GTK_CONTAINER(m_mainWindow), vbox);
|
||||||
@@ -57,8 +73,37 @@ MainWindows::MainWindows(void) : MsgBroadcast("Main Windows", EDN_CAT_GUI)
|
|||||||
AccelKey::getInstance()->LinkCommonAccel(GTK_WINDOW(m_mainWindow));
|
AccelKey::getInstance()->LinkCommonAccel(GTK_WINDOW(m_mainWindow));
|
||||||
|
|
||||||
// Create the menu bar.
|
// Create the menu bar.
|
||||||
|
#if 0
|
||||||
gtk_box_pack_start( GTK_BOX (vbox), m_MenuBar.GetWidget(), FALSE, FALSE, 0);
|
gtk_box_pack_start( GTK_BOX (vbox), m_MenuBar.GetWidget(), FALSE, FALSE, 0);
|
||||||
|
#else
|
||||||
|
GtkWidget *hboxMenu = gtk_hbox_new (FALSE, 0);
|
||||||
|
gtk_box_pack_start( GTK_BOX (vbox), hboxMenu, FALSE, FALSE, 0);
|
||||||
|
// Add Exit boutton
|
||||||
|
Edn::String ExitIconeFile;
|
||||||
|
#ifdef NDEBUG
|
||||||
|
ExitIconeFile = "/usr/share/edn/images/delete-24px.png";
|
||||||
|
#else
|
||||||
|
ExitIconeFile = "./data/imagesSources/delete-24px.png";
|
||||||
|
#endif
|
||||||
|
// TODO : find a good way to chenge the size of an image
|
||||||
|
GtkWidget *myImageQuit = gtk_image_new_from_file(ExitIconeFile.c_str());
|
||||||
|
GtkIconSize mySize = GTK_ICON_SIZE_SMALL_TOOLBAR;
|
||||||
|
//EDN_DEBUG(" plop : " << mySize);
|
||||||
|
//gtk_image_get_icon_set( GTK_IMAGE(myImageQuit), NULL, &mySize);
|
||||||
|
//EDN_DEBUG(" plop : " << mySize);
|
||||||
|
GtkWidget *event_box = gtk_event_box_new();
|
||||||
|
gtk_container_add(GTK_CONTAINER(event_box),myImageQuit);
|
||||||
|
gtk_widget_add_events(event_box,GDK_BUTTON_PRESS_MASK);
|
||||||
|
g_signal_connect(G_OBJECT(event_box), "button_press_event", G_CALLBACK(OnQuit), this);
|
||||||
|
|
||||||
|
gtk_box_pack_start( GTK_BOX(hboxMenu), event_box, FALSE, FALSE, 0);
|
||||||
|
|
||||||
|
// add the real menu bar
|
||||||
|
gtk_box_pack_start( GTK_BOX (hboxMenu), m_MenuBar.GetWidget(), FALSE, FALSE, 0);
|
||||||
|
|
||||||
|
// Add title
|
||||||
|
|
||||||
|
#endif
|
||||||
// **********************************************************
|
// **********************************************************
|
||||||
// * Horizontal ELEMENTS : *
|
// * Horizontal ELEMENTS : *
|
||||||
// **********************************************************
|
// **********************************************************
|
||||||
@@ -67,16 +112,16 @@ MainWindows::MainWindows(void) : MsgBroadcast("Main Windows", EDN_CAT_GUI)
|
|||||||
gtk_container_add(GTK_CONTAINER (vbox), hbox);
|
gtk_container_add(GTK_CONTAINER (vbox), hbox);
|
||||||
// create the toolbar :
|
// create the toolbar :
|
||||||
# if USE_GTK_VERSION_2_0
|
# if USE_GTK_VERSION_2_0
|
||||||
gtk_box_pack_start(GTK_BOX(hbox), m_ToolBar.GetWidget(), FALSE, FALSE, 0);
|
//gtk_box_pack_start(GTK_BOX(hbox), m_ToolBar.GetWidget(), FALSE, FALSE, 0);
|
||||||
# endif
|
# endif
|
||||||
// TreeView :
|
// TreeView :
|
||||||
gtk_box_pack_start(GTK_BOX(hbox), m_BufferView.GetMainWidget(), FALSE, TRUE, 1);
|
gtk_box_pack_start(GTK_BOX(hbox), m_BufferView.GetMainWidget(), FALSE, TRUE, 1);
|
||||||
|
|
||||||
// Tex displayer :
|
// Text displayer :
|
||||||
gtk_box_pack_start( GTK_BOX (hbox), m_CodeView.GetMainWidget(), TRUE, TRUE, 0);
|
gtk_box_pack_start( GTK_BOX (hbox), m_CodeView.GetMainWidget(), TRUE, TRUE, 0);
|
||||||
|
|
||||||
// Create the status bar
|
// Create the status bar
|
||||||
gtk_box_pack_end(GTK_BOX(vbox), m_StatusBar.GetWidget(), FALSE, FALSE, 0);
|
//gtk_box_pack_end(GTK_BOX(vbox), m_StatusBar.GetWidget(), FALSE, FALSE, 0);
|
||||||
|
|
||||||
// recursive version of gtk_widget_show
|
// recursive version of gtk_widget_show
|
||||||
gtk_widget_show_all(m_mainWindow);
|
gtk_widget_show_all(m_mainWindow);
|
||||||
@@ -93,6 +138,7 @@ MainWindows::~MainWindows(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void MainWindows::SetTitle(Edn::File &fileName, bool isModify)
|
void MainWindows::SetTitle(Edn::File &fileName, bool isModify)
|
||||||
{
|
{
|
||||||
Edn::String tmp = "";
|
Edn::String tmp = "";
|
||||||
@@ -129,70 +175,37 @@ void MainWindows::OnMessage(int32_t id, int32_t dataID)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EDN_MSG__QUIT:
|
|
||||||
OnQuit(m_mainWindow, this);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MainWindows::OnQuit(GtkWidget *widget, gpointer data)
|
bool MainWindows::OnQuit(GtkWidget *widget, gpointer data)
|
||||||
{
|
{
|
||||||
EDN_INFO("quit requested");
|
//MainWindows * self = reinterpret_cast<MainWindows*>(data);
|
||||||
// dlg to confirm the quit event :
|
GeneralSendMessage(EDN_MSG__GUI_SHOW_EXIT_CONFIRMATION);
|
||||||
GtkWidget *p_dialog = gtk_dialog_new_with_buttons("Exit",
|
// Close is not managed here ...
|
||||||
GTK_WINDOW(widget),
|
|
||||||
GTK_DIALOG_MODAL,
|
|
||||||
GTK_STOCK_YES, GTK_RESPONSE_YES,
|
|
||||||
GTK_STOCK_NO, GTK_RESPONSE_NO,
|
|
||||||
NULL);
|
|
||||||
GtkWidget *p_label = gtk_label_new ("Do you want exit Edn?");
|
|
||||||
gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area( GTK_DIALOG(p_dialog) )), p_label, TRUE, TRUE, 0);
|
|
||||||
|
|
||||||
gtk_widget_show(p_label);
|
|
||||||
|
|
||||||
switch (gtk_dialog_run (GTK_DIALOG (p_dialog)))
|
|
||||||
{
|
|
||||||
case GTK_RESPONSE_YES:
|
|
||||||
gtk_widget_destroy (p_dialog);
|
|
||||||
|
|
||||||
break;
|
|
||||||
case GTK_RESPONSE_NO:
|
|
||||||
gtk_widget_destroy (p_dialog);
|
|
||||||
// do not close the windows
|
|
||||||
return true;
|
return true;
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
gtk_main_quit();
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
gboolean MainWindows::OnStateChange(GtkWidget *widget, GdkEvent* event, gpointer data)
|
||||||
|
|
||||||
void MainWindows::OnMenuAbout(wxCommandEvent & WXUNUSED(event))
|
|
||||||
{
|
{
|
||||||
//EDN_INFO("MainWindows::OnMenuAbout (event)");
|
MainWindows * self = reinterpret_cast<MainWindows*>(data);
|
||||||
wxAboutDialogInfo info;
|
EDN_DEBUG("State change");
|
||||||
info.SetName(wxT("edn"));
|
EDN_INFO(" change state mask : " << event->window_state.changed_mask);
|
||||||
info.SetVersion(wxT("0.1.0 pre-Beta"));
|
EDN_INFO(" change state new val : " << event->window_state.new_window_state);
|
||||||
info.SetDescription(wxT("Editeur De N'ours, l'Editeur Desoxyribo-Nucleique\n"
|
if (event->window_state.changed_mask == GDK_WINDOW_STATE_MAXIMIZED) {
|
||||||
"Source Code Editor"));
|
EDN_INFO(" ==> Maximisation change...");
|
||||||
info.SetCopyright(wxT( "Copyright 2010 Edouard DUPIN, all right reserved\n"
|
if (event->window_state.new_window_state == GDK_WINDOW_STATE_MAXIMIZED) {
|
||||||
"This software is distributed in the hope that it will be useful, but WITHOUT\n"
|
EDN_INFO(" ==> ENABLE");
|
||||||
"ANY WARRANTY\n\n"
|
gtk_window_set_decorated(GTK_WINDOW(self->m_mainWindow), FALSE);
|
||||||
"Licence summary : \n"
|
} else {
|
||||||
" You can modify and redistribute the sources code and binaries.\n"
|
EDN_INFO(" ==> DISABLE");
|
||||||
" You can send me the bug-fix\n"
|
gtk_window_set_decorated(GTK_WINDOW(self->m_mainWindow), TRUE);
|
||||||
" You can not earn money with this Software (if the source extract from Edn\n"
|
|
||||||
" represent less than 50% of original Sources)\n"
|
|
||||||
"Term of the licence in in the file licence.txt"));
|
|
||||||
wxAboutBox(info);
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -51,6 +51,7 @@ class MainWindows: public Singleton<MainWindows>, public MsgBroadcast
|
|||||||
GtkWidget * GetWidget(void) { return m_mainWindow;};
|
GtkWidget * GetWidget(void) { return m_mainWindow;};
|
||||||
void OnMessage(int32_t id, int32_t dataID);
|
void OnMessage(int32_t id, int32_t dataID);
|
||||||
static bool OnQuit(GtkWidget *widget, gpointer data);
|
static bool OnQuit(GtkWidget *widget, gpointer data);
|
||||||
|
static gboolean OnStateChange(GtkWidget *widget, GdkEvent* event, gpointer data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetTitle(Edn::File &fileName, bool isModify);
|
void SetTitle(Edn::File &fileName, bool isModify);
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
#include "MenuBar.h"
|
#include "MenuBar.h"
|
||||||
#include "ClipBoard.h"
|
#include "ClipBoard.h"
|
||||||
#include "charset.h"
|
#include "charset.h"
|
||||||
|
#include "ColorizeManager.h"
|
||||||
|
|
||||||
#define MENU_MSG
|
#define MENU_MSG
|
||||||
const char * MSG_TogleDisplayChar = "Request a Togle of char displaying";
|
const char * MSG_TogleDisplayChar = "Request a Togle of char displaying";
|
||||||
@@ -36,6 +37,8 @@ const char * MSG_TogleAutoIndent = "Request a Togle of Auto Indent";
|
|||||||
const char * MSG_SetCharsetIso559_1 = "Set ISO 5589-1";
|
const char * MSG_SetCharsetIso559_1 = "Set ISO 5589-1";
|
||||||
const char * MSG_SetCharsetIso559_15 = "Set ISO 5589-15";
|
const char * MSG_SetCharsetIso559_15 = "Set ISO 5589-15";
|
||||||
const char * MSG_SetCharsetUTF8 = "Set UTF 8";
|
const char * MSG_SetCharsetUTF8 = "Set UTF 8";
|
||||||
|
const char * MSG_LoadColorBlack = "Load Color Black";
|
||||||
|
const char * MSG_LoadColorWhite = "Load Color White";
|
||||||
#define MSG_LINK(data)
|
#define MSG_LINK(data)
|
||||||
|
|
||||||
|
|
||||||
@@ -74,6 +77,26 @@ static void CB_menuInternal(GtkMenuItem *menu_item, gpointer data)
|
|||||||
GeneralSendMessage(EDN_MSG__CURRENT_SET_CHARSET, EDN_CHARSET_ISO_8859_15);
|
GeneralSendMessage(EDN_MSG__CURRENT_SET_CHARSET, EDN_CHARSET_ISO_8859_15);
|
||||||
} else if (myPointer == MSG_SetCharsetUTF8) {
|
} else if (myPointer == MSG_SetCharsetUTF8) {
|
||||||
GeneralSendMessage(EDN_MSG__CURRENT_SET_CHARSET, EDN_CHARSET_UTF8);
|
GeneralSendMessage(EDN_MSG__CURRENT_SET_CHARSET, EDN_CHARSET_UTF8);
|
||||||
|
} else if (myPointer == MSG_LoadColorWhite) {
|
||||||
|
ColorizeManager * myColorSystem = ColorizeManager::getInstance();
|
||||||
|
Edn::String homedir;
|
||||||
|
# ifdef NDEBUG
|
||||||
|
homedir = "/usr/share/edn/";
|
||||||
|
# else
|
||||||
|
homedir = "./data/";
|
||||||
|
# endif
|
||||||
|
homedir += "color_white.xml";
|
||||||
|
myColorSystem->LoadFile(homedir);
|
||||||
|
} else if (myPointer == MSG_LoadColorBlack) {
|
||||||
|
ColorizeManager * myColorSystem = ColorizeManager::getInstance();
|
||||||
|
Edn::String homedir;
|
||||||
|
# ifdef NDEBUG
|
||||||
|
homedir = "/usr/share/edn/";
|
||||||
|
# else
|
||||||
|
homedir = "./data/";
|
||||||
|
# endif
|
||||||
|
homedir += "color_black.xml";
|
||||||
|
myColorSystem->LoadFile(homedir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,12 +227,12 @@ MenuBar::MenuBar(void) : MsgBroadcast("Menu bar", EDN_CAT_GUI)
|
|||||||
tmp->AddGen(GTK_STOCK_NEW, "ctrl+n", EDN_MSG__NEW, true);
|
tmp->AddGen(GTK_STOCK_NEW, "ctrl+n", EDN_MSG__NEW, true);
|
||||||
tmp->AddGen(GTK_STOCK_OPEN, "ctrl+o", EDN_MSG__GUI_SHOW_OPEN_FILE, true);
|
tmp->AddGen(GTK_STOCK_OPEN, "ctrl+o", EDN_MSG__GUI_SHOW_OPEN_FILE, true);
|
||||||
tmp->AddSeparator();
|
tmp->AddSeparator();
|
||||||
tmp->AddGen("Close file", NULL, EDN_MSG__CURRENT_CLOSE, true);
|
tmp->AddGen("Close file", "ctrl+q", EDN_MSG__CURRENT_CLOSE, true);
|
||||||
tmp->AddSeparator();
|
tmp->AddSeparator();
|
||||||
tmp->AddGen(GTK_STOCK_SAVE, "ctrl+s", EDN_MSG__CURRENT_SAVE, true);
|
tmp->AddGen(GTK_STOCK_SAVE, "ctrl+s", EDN_MSG__CURRENT_SAVE, true);
|
||||||
tmp->AddGen(GTK_STOCK_SAVE_AS, "ctrl+shift+s", EDN_MSG__CURRENT_SAVE_AS, true);
|
tmp->AddGen(GTK_STOCK_SAVE_AS, "ctrl+shift+s", EDN_MSG__CURRENT_SAVE_AS, true);
|
||||||
tmp->AddSeparator();
|
tmp->AddSeparator();
|
||||||
tmp->AddGen(GTK_STOCK_QUIT, "ctrl+q", EDN_MSG__QUIT, true);
|
tmp->AddGen(GTK_STOCK_QUIT, "ctrl+shift+q", EDN_MSG__GUI_SHOW_EXIT_CONFIRMATION, true);
|
||||||
m_listMenu.PushBack(tmp);
|
m_listMenu.PushBack(tmp);
|
||||||
|
|
||||||
tmp = new MenuBarMain("_Edit", m_mainWidget);
|
tmp = new MenuBarMain("_Edit", m_mainWidget);
|
||||||
@@ -220,7 +243,7 @@ MenuBar::MenuBar(void) : MsgBroadcast("Menu bar", EDN_CAT_GUI)
|
|||||||
tmp->AddGen(GTK_STOCK_COPY, "ctrl+c", EDN_MSG__CURRENT_COPY, true, COPY_STD);
|
tmp->AddGen(GTK_STOCK_COPY, "ctrl+c", EDN_MSG__CURRENT_COPY, true, COPY_STD);
|
||||||
tmp->AddGen(GTK_STOCK_PASTE, "ctrl+v", EDN_MSG__CURRENT_PASTE, true, COPY_STD);
|
tmp->AddGen(GTK_STOCK_PASTE, "ctrl+v", EDN_MSG__CURRENT_PASTE, true, COPY_STD);
|
||||||
// tmp->AddGen(GTK_STOCK_DELETE, NULL);
|
// tmp->AddGen(GTK_STOCK_DELETE, NULL);
|
||||||
tmp->AddGen("Remove line", "ctrl+d", EDN_MSG__CURRENT_REMOVE_LINE, true);
|
tmp->AddGen("Remove line", "ctrl+w", EDN_MSG__CURRENT_REMOVE_LINE, true);
|
||||||
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);
|
||||||
@@ -230,15 +253,6 @@ MenuBar::MenuBar(void) : MsgBroadcast("Menu bar", EDN_CAT_GUI)
|
|||||||
// 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);
|
||||||
|
|
||||||
tmp = new MenuBarMain("Display", m_mainWidget);
|
|
||||||
tmp->AddInternal("Show space & tabs", NULL, MSG_TogleDisplayChar, true);
|
|
||||||
tmp->AddInternal("Show end of lines", NULL, MSG_TogleDisplayEOL, true);
|
|
||||||
tmp->AddInternal("Audo Indent", NULL, MSG_TogleAutoIndent, true);
|
|
||||||
tmp->AddInternal("Set charset Occidental (ISO-8859-1)", NULL, MSG_SetCharsetIso559_1, true);
|
|
||||||
tmp->AddInternal("Set charset Occidental (ISO-8859-15)", NULL, MSG_SetCharsetIso559_15, true);
|
|
||||||
tmp->AddInternal("Set charset Internationnal (UTF 8)", NULL, MSG_SetCharsetUTF8, true);
|
|
||||||
m_listMenu.PushBack(tmp);
|
|
||||||
|
|
||||||
tmp = new MenuBarMain("_Search", m_mainWidget);
|
tmp = new MenuBarMain("_Search", m_mainWidget);
|
||||||
tmp->AddGen(GTK_STOCK_FIND, "ctrl+f", EDN_MSG__GUI_SHOW_SEARCH, true);
|
tmp->AddGen(GTK_STOCK_FIND, "ctrl+f", EDN_MSG__GUI_SHOW_SEARCH, true);
|
||||||
tmp->AddGen(GTK_STOCK_FIND_AND_REPLACE, "ctrl+r", EDN_MSG__GUI_SHOW_REPLACE, true);
|
tmp->AddGen(GTK_STOCK_FIND_AND_REPLACE, "ctrl+r", EDN_MSG__GUI_SHOW_REPLACE, true);
|
||||||
@@ -252,6 +266,21 @@ MenuBar::MenuBar(void) : MsgBroadcast("Menu bar", EDN_CAT_GUI)
|
|||||||
// tmp->AddSeparator();
|
// tmp->AddSeparator();
|
||||||
// tmp->AddGen("Goto Line", "ctrl+l", EDN_MSG__CURRENT_GOTO_LINE, true);
|
// tmp->AddGen("Goto Line", "ctrl+l", EDN_MSG__CURRENT_GOTO_LINE, true);
|
||||||
m_listMenu.PushBack(tmp);
|
m_listMenu.PushBack(tmp);
|
||||||
|
|
||||||
|
tmp = new MenuBarMain("Display", m_mainWidget);
|
||||||
|
tmp->AddInternal("Show space & tabs", NULL, MSG_TogleDisplayChar, true);
|
||||||
|
tmp->AddInternal("Show end of lines", NULL, MSG_TogleDisplayEOL, true);
|
||||||
|
tmp->AddInternal("Audo Indent", NULL, MSG_TogleAutoIndent, true);
|
||||||
|
tmp->AddSeparator();
|
||||||
|
tmp->AddInternal("Set charset Occidental (ISO-8859-1)", NULL, MSG_SetCharsetIso559_1, true);
|
||||||
|
tmp->AddInternal("Set charset Occidental (ISO-8859-15)", NULL, MSG_SetCharsetIso559_15, true);
|
||||||
|
tmp->AddInternal("Set charset Internationnal (UTF 8)", NULL, MSG_SetCharsetUTF8, true);
|
||||||
|
tmp->AddSeparator();
|
||||||
|
tmp->AddGen( "Reload Color File", NULL, EDN_MSG__RELOAD_COLOR_FILE, true);
|
||||||
|
tmp->AddSeparator();
|
||||||
|
tmp->AddInternal("Set Color Black", NULL, MSG_LoadColorBlack, true);
|
||||||
|
tmp->AddInternal("Set Color White", NULL, MSG_LoadColorWhite, true);
|
||||||
|
m_listMenu.PushBack(tmp);
|
||||||
/*
|
/*
|
||||||
tmp = new MenuBarMain("Project", m_mainWidget);
|
tmp = new MenuBarMain("Project", m_mainWidget);
|
||||||
m_listMenu.PushBack(tmp);
|
m_listMenu.PushBack(tmp);
|
||||||
@@ -260,8 +289,8 @@ MenuBar::MenuBar(void) : MsgBroadcast("Menu bar", EDN_CAT_GUI)
|
|||||||
tmp->AddGen("load Ctags file", NULL, EDN_MSG__OPEN_CTAGS, true);
|
tmp->AddGen("load Ctags file", NULL, EDN_MSG__OPEN_CTAGS, true);
|
||||||
tmp->AddGen("re-load Ctags file", NULL, EDN_MSG__RELOAD_CTAGS, true);
|
tmp->AddGen("re-load Ctags file", NULL, EDN_MSG__RELOAD_CTAGS, true);
|
||||||
tmp->AddSeparator();
|
tmp->AddSeparator();
|
||||||
tmp->AddGen("Find Definition", "ctrl+u", EDN_MSG__JUMP_TO_CURRENT_SELECTION, true);
|
tmp->AddGen("Find Definition", "ctrl+d", EDN_MSG__JUMP_TO_CURRENT_SELECTION, true);
|
||||||
tmp->AddGen("Back previous", "ctrl+y", EDN_MSG__JUMP_BACK, true);
|
tmp->AddGen("Back previous", "ctrl+shift+d", EDN_MSG__JUMP_BACK, true);
|
||||||
/*
|
/*
|
||||||
tmp->AddGen("Gestion Ctags", NULL);
|
tmp->AddGen("Gestion Ctags", NULL);
|
||||||
tmp->AddGen("Add Ctags Folder", NULL);
|
tmp->AddGen("Add Ctags Folder", NULL);
|
||||||
|
@@ -192,9 +192,9 @@ void Search::Display(GtkWindow *parent)
|
|||||||
} else {
|
} else {
|
||||||
gtk_widget_set_sensitive(m_CkMatchCase, true);
|
gtk_widget_set_sensitive(m_CkMatchCase, true);
|
||||||
}
|
}
|
||||||
|
// Remove data form the search
|
||||||
Edn::String myDataString;
|
Edn::String myDataString = "";
|
||||||
SearchData::GetSearch(myDataString);
|
SearchData::SetSearch(myDataString);
|
||||||
gtk_entry_set_text(GTK_ENTRY(m_searchEntry), myDataString.c_str());
|
gtk_entry_set_text(GTK_ENTRY(m_searchEntry), myDataString.c_str());
|
||||||
if (0 == strlen(myDataString.c_str())) {
|
if (0 == strlen(myDataString.c_str())) {
|
||||||
m_haveSearchData = false;
|
m_haveSearchData = false;
|
||||||
@@ -212,13 +212,14 @@ void Search::Display(GtkWindow *parent)
|
|||||||
|
|
||||||
gtk_widget_set_sensitive(m_BtPrevious, m_haveSearchData);
|
gtk_widget_set_sensitive(m_BtPrevious, m_haveSearchData);
|
||||||
gtk_widget_set_sensitive(m_BtNext, m_haveSearchData);
|
gtk_widget_set_sensitive(m_BtNext, m_haveSearchData);
|
||||||
if (false == m_haveSearchData) {
|
// basic no search data
|
||||||
gtk_widget_set_sensitive(m_BtReplace, false);
|
gtk_widget_set_sensitive(m_BtReplace, false);
|
||||||
gtk_widget_set_sensitive(m_BtReplaceAndNext, false);
|
gtk_widget_set_sensitive(m_BtReplaceAndNext, false);
|
||||||
} else {
|
|
||||||
gtk_widget_set_sensitive(m_BtReplace, m_haveReplaceData);
|
|
||||||
gtk_widget_set_sensitive(m_BtReplaceAndNext, m_haveReplaceData);
|
// set focus on a specific widget :
|
||||||
}
|
//gtk_window_set_focus(parent, m_searchEntry);
|
||||||
|
gtk_widget_grab_focus(m_searchEntry);
|
||||||
|
|
||||||
// display the dialogue box
|
// display the dialogue box
|
||||||
gtk_widget_show_all(m_localDialog);
|
gtk_widget_show_all(m_localDialog);
|
||||||
@@ -327,8 +328,8 @@ void Search::OnEntrySearchChange(GtkWidget *widget, gpointer data)
|
|||||||
gtk_widget_set_sensitive(self->m_BtReplace, false);
|
gtk_widget_set_sensitive(self->m_BtReplace, false);
|
||||||
gtk_widget_set_sensitive(self->m_BtReplaceAndNext, false);
|
gtk_widget_set_sensitive(self->m_BtReplaceAndNext, false);
|
||||||
} else {
|
} else {
|
||||||
gtk_widget_set_sensitive(self->m_BtReplace, self->m_haveReplaceData);
|
gtk_widget_set_sensitive(self->m_BtReplace, true);
|
||||||
gtk_widget_set_sensitive(self->m_BtReplaceAndNext, self->m_haveReplaceData);
|
gtk_widget_set_sensitive(self->m_BtReplaceAndNext, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -347,7 +348,12 @@ void Search::OnEntryReplaceChange(GtkWidget *widget, gpointer data)
|
|||||||
} else {
|
} else {
|
||||||
self->m_haveReplaceData = true;
|
self->m_haveReplaceData = true;
|
||||||
}
|
}
|
||||||
gtk_widget_set_sensitive(self->m_BtReplace, self->m_haveReplaceData);
|
if (false == self->m_haveSearchData) {
|
||||||
gtk_widget_set_sensitive(self->m_BtReplaceAndNext, self->m_haveReplaceData);
|
gtk_widget_set_sensitive(self->m_BtReplace, false);
|
||||||
|
gtk_widget_set_sensitive(self->m_BtReplaceAndNext, false);
|
||||||
|
} else {
|
||||||
|
gtk_widget_set_sensitive(self->m_BtReplace, true);
|
||||||
|
gtk_widget_set_sensitive(self->m_BtReplaceAndNext, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -93,10 +93,8 @@ void WindowsManager::OnMessage(int32_t id, int32_t dataID)
|
|||||||
|
|
||||||
GtkWidget *dialog = gtk_file_chooser_dialog_new( "Open File", NULL,
|
GtkWidget *dialog = gtk_file_chooser_dialog_new( "Open 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
|
||||||
// this element did not apear in the miniature of the windows
|
// this element did not apear in the miniature of the windows
|
||||||
gtk_window_set_skip_pager_hint(GTK_WINDOW(dialog), TRUE);
|
gtk_window_set_skip_pager_hint(GTK_WINDOW(dialog), TRUE);
|
||||||
@@ -137,10 +135,8 @@ void WindowsManager::OnMessage(int32_t id, int32_t dataID)
|
|||||||
tmpString += myBuffer->GetFileName().GetShortFilename().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, GTK_RESPONSE_CANCEL,
|
||||||
GTK_RESPONSE_CANCEL, // response id
|
GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
|
||||||
GTK_STOCK_SAVE, // button text
|
|
||||||
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
|
// this element did not apear in the miniature of the windows
|
||||||
gtk_window_set_skip_pager_hint(GTK_WINDOW(dialog), TRUE);
|
gtk_window_set_skip_pager_hint(GTK_WINDOW(dialog), TRUE);
|
||||||
@@ -250,5 +246,89 @@ void WindowsManager::OnMessage(int32_t id, int32_t dataID)
|
|||||||
gtk_widget_destroy(myDialog);
|
gtk_widget_destroy(myDialog);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case EDN_MSG__GUI_SHOW_EXIT_CONFIRMATION:
|
||||||
|
{
|
||||||
|
EDN_INFO("quit requested");
|
||||||
|
// dlg to confirm the quit event :
|
||||||
|
GtkWidget *p_dialog = gtk_dialog_new_with_buttons("Exit",
|
||||||
|
GTK_WINDOW(m_mainWindow->GetWidget()),
|
||||||
|
GTK_DIALOG_MODAL,
|
||||||
|
GTK_STOCK_YES, GTK_RESPONSE_YES,
|
||||||
|
GTK_STOCK_NO, GTK_RESPONSE_NO,
|
||||||
|
NULL);
|
||||||
|
GtkWidget *p_label = gtk_label_new ("Do you want exit Edn ?");
|
||||||
|
gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area( GTK_DIALOG(p_dialog) )), p_label, TRUE, TRUE, 0);
|
||||||
|
gtk_widget_show(p_label);
|
||||||
|
|
||||||
|
switch (gtk_dialog_run (GTK_DIALOG (p_dialog)))
|
||||||
|
{
|
||||||
|
case GTK_RESPONSE_YES:
|
||||||
|
gtk_widget_destroy (p_dialog);
|
||||||
|
p_dialog = NULL;
|
||||||
|
{
|
||||||
|
BufferManager * myBufferMng = BufferManager::getInstance();
|
||||||
|
for (int32_t iii=0 ; iii<myBufferMng->Size() ; iii++) {
|
||||||
|
if (true==myBufferMng->Exist(iii) ) {
|
||||||
|
Buffer * myBuffer = myBufferMng->Get(iii);
|
||||||
|
if (NULL != myBuffer) {
|
||||||
|
if (true == myBuffer->IsModify()) {
|
||||||
|
if (true == myBuffer->HaveName()) {
|
||||||
|
p_dialog = gtk_dialog_new_with_buttons("Save Before Exit",
|
||||||
|
GTK_WINDOW(m_mainWindow->GetWidget()),
|
||||||
|
GTK_DIALOG_MODAL,
|
||||||
|
GTK_STOCK_SAVE, GTK_RESPONSE_YES,
|
||||||
|
GTK_STOCK_SAVE_AS, GTK_RESPONSE_ACCEPT,
|
||||||
|
GTK_STOCK_NO, GTK_RESPONSE_NO,
|
||||||
|
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||||
|
NULL);
|
||||||
|
} else {
|
||||||
|
p_dialog = gtk_dialog_new_with_buttons("Save Before Exit",
|
||||||
|
GTK_WINDOW(m_mainWindow->GetWidget()),
|
||||||
|
GTK_DIALOG_MODAL,
|
||||||
|
GTK_STOCK_SAVE_AS, GTK_RESPONSE_ACCEPT,
|
||||||
|
GTK_STOCK_NO, GTK_RESPONSE_NO,
|
||||||
|
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
char tmpName[1024];
|
||||||
|
sprintf(tmpName, "Save file \"%s\" ?", myBuffer->GetFileName().GetCompleateName().c_str());
|
||||||
|
p_label = gtk_label_new(tmpName);
|
||||||
|
gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area( GTK_DIALOG(p_dialog) )), p_label, TRUE, TRUE, 0);
|
||||||
|
gtk_widget_show(p_label);
|
||||||
|
|
||||||
|
switch (gtk_dialog_run (GTK_DIALOG (p_dialog)))
|
||||||
|
{
|
||||||
|
case GTK_RESPONSE_YES:
|
||||||
|
myBuffer->Save();
|
||||||
|
break;
|
||||||
|
case GTK_RESPONSE_ACCEPT:
|
||||||
|
OnMessage(EDN_MSG__GUI_SHOW_SAVE_AS, iii);
|
||||||
|
break;
|
||||||
|
case GTK_RESPONSE_NO:
|
||||||
|
// nothing to do ...
|
||||||
|
break;
|
||||||
|
case GTK_RESPONSE_CANCEL:
|
||||||
|
gtk_widget_destroy (p_dialog);
|
||||||
|
return;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
gtk_widget_destroy (p_dialog);
|
||||||
|
p_dialog = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gtk_main_quit();
|
||||||
|
break;
|
||||||
|
case GTK_RESPONSE_NO:
|
||||||
|
gtk_widget_destroy (p_dialog);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -135,6 +135,20 @@ Highlight::~Highlight(void)
|
|||||||
m_listExtentions.Clear();
|
m_listExtentions.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Highlight::ReloadColor(void)
|
||||||
|
{
|
||||||
|
int32_t i;
|
||||||
|
for (i=0; i< m_listHighlightPass1.Size(); i++) {
|
||||||
|
if (NULL != m_listHighlightPass1[i]) {
|
||||||
|
m_listHighlightPass1[i]->ReloadColor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (i=0; i< m_listHighlightPass2.Size(); i++) {
|
||||||
|
if (NULL != m_listHighlightPass2[i]) {
|
||||||
|
m_listHighlightPass2[i]->ReloadColor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool Highlight::HasExtention(Edn::String &ext)
|
bool Highlight::HasExtention(Edn::String &ext)
|
||||||
{
|
{
|
||||||
@@ -219,7 +233,7 @@ void Highlight::Parse(int32_t start,
|
|||||||
if (metaData[kkk].beginStart <= resultat.endStop) {
|
if (metaData[kkk].beginStart <= resultat.endStop) {
|
||||||
// Remove element
|
// Remove element
|
||||||
//EDN_INFO("Erase element=" << kkk);
|
//EDN_INFO("Erase element=" << kkk);
|
||||||
metaData.Erase(kkk, kkk+1);
|
metaData.EraseLen(kkk, kkk+1);
|
||||||
// Increase the end of search
|
// Increase the end of search
|
||||||
if (kkk < metaData.Size()) {
|
if (kkk < metaData.Size()) {
|
||||||
// just befor the end of the next element
|
// just befor the end of the next element
|
||||||
@@ -276,7 +290,7 @@ void Highlight::Parse2(int32_t start,
|
|||||||
//EDN_INFO("Find Pattern in the Buffer : (" << resultat.beginStart << "," << resultat.endStop << ")" );
|
//EDN_INFO("Find Pattern in the Buffer : (" << resultat.beginStart << "," << resultat.endStop << ")" );
|
||||||
// Add curent element in the list ...
|
// Add curent element in the list ...
|
||||||
metaData.PushBack(resultat);
|
metaData.PushBack(resultat);
|
||||||
elementStart = resultat.endStop;
|
elementStart = resultat.endStop-1;
|
||||||
// Exit current cycle
|
// Exit current cycle
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -56,6 +56,7 @@ class Highlight {
|
|||||||
bool HasExtention(Edn::String &ext);
|
bool HasExtention(Edn::String &ext);
|
||||||
bool FileNameCompatible(Edn::File &fileName);
|
bool FileNameCompatible(Edn::File &fileName);
|
||||||
void Display(void);
|
void Display(void);
|
||||||
|
void ReloadColor(void);
|
||||||
void Parse(int32_t start,
|
void Parse(int32_t start,
|
||||||
int32_t stop,
|
int32_t stop,
|
||||||
Edn::VectorType<colorInformation_ts> &metaData,
|
Edn::VectorType<colorInformation_ts> &metaData,
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "HighlightManager"
|
#define __class__ "HighlightManager"
|
||||||
|
|
||||||
HighlightManager::HighlightManager(void)
|
HighlightManager::HighlightManager(void) : MsgBroadcast("Hight-light Manager", EDN_CAT_HL)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -50,6 +50,21 @@ HighlightManager::~HighlightManager(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void HighlightManager::OnMessage(int32_t id, int32_t dataID)
|
||||||
|
{
|
||||||
|
switch (id)
|
||||||
|
{
|
||||||
|
case EDN_MSG__COLOR_HAS_CHANGE:
|
||||||
|
EDN_INFO("UPDATE the color pointer on the HL");
|
||||||
|
for (int32_t i=0; i<listHighlight.Size(); i++) {
|
||||||
|
if (NULL != listHighlight[i]) {
|
||||||
|
listHighlight[i]->ReloadColor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Highlight *HighlightManager::Get(Edn::File &fileName)
|
Highlight *HighlightManager::Get(Edn::File &fileName)
|
||||||
{
|
{
|
||||||
int32_t i;
|
int32_t i;
|
||||||
@@ -109,6 +124,16 @@ void HighlightManager::loadLanguages(void)
|
|||||||
myHightline = new Highlight(xmlFilename);
|
myHightline = new Highlight(xmlFilename);
|
||||||
listHighlight.PushBack(myHightline);
|
listHighlight.PushBack(myHightline);
|
||||||
|
|
||||||
myHightline->Display();
|
xmlFilename = homedir;
|
||||||
|
xmlFilename += "lang_bash.xml";
|
||||||
|
myHightline = new Highlight(xmlFilename);
|
||||||
|
listHighlight.PushBack(myHightline);
|
||||||
|
|
||||||
|
xmlFilename = homedir;
|
||||||
|
xmlFilename += "lang_matlab.xml";
|
||||||
|
myHightline = new Highlight(xmlFilename);
|
||||||
|
listHighlight.PushBack(myHightline);
|
||||||
|
|
||||||
|
//myHightline->Display();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -29,10 +29,11 @@
|
|||||||
class HighlightManager;
|
class HighlightManager;
|
||||||
|
|
||||||
#include "Singleton.h"
|
#include "Singleton.h"
|
||||||
|
#include "MsgBroadcast.h"
|
||||||
#include "Highlight.h"
|
#include "Highlight.h"
|
||||||
|
|
||||||
|
|
||||||
class HighlightManager: public Singleton<HighlightManager>
|
class HighlightManager: public Singleton<HighlightManager>, public MsgBroadcast
|
||||||
{
|
{
|
||||||
friend class Singleton<HighlightManager>;
|
friend class Singleton<HighlightManager>;
|
||||||
// specific for sigleton system...
|
// specific for sigleton system...
|
||||||
@@ -41,6 +42,8 @@ class HighlightManager: public Singleton<HighlightManager>
|
|||||||
HighlightManager(void);
|
HighlightManager(void);
|
||||||
~HighlightManager(void);
|
~HighlightManager(void);
|
||||||
|
|
||||||
|
public:
|
||||||
|
void OnMessage(int32_t id, int32_t dataID);
|
||||||
public:
|
public:
|
||||||
void loadLanguages(void);
|
void loadLanguages(void);
|
||||||
Highlight * Get(Edn::File &fileName);
|
Highlight * Get(Edn::File &fileName);
|
||||||
|
@@ -87,6 +87,13 @@ bool HighlightPattern::IsEnable(void)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void HighlightPattern::ReloadColor(void)
|
||||||
|
{
|
||||||
|
ColorizeManager *myColorManager = ColorizeManager::getInstance();
|
||||||
|
m_color = myColorManager->Get(m_colorName);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
*
|
*
|
||||||
|
@@ -69,6 +69,8 @@ class HighlightPattern {
|
|||||||
Colorize * GetColor(void) { return m_color; };
|
Colorize * GetColor(void) { return m_color; };
|
||||||
void ParseRules(TiXmlNode *child, int32_t level);
|
void ParseRules(TiXmlNode *child, int32_t level);
|
||||||
|
|
||||||
|
void ReloadColor(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int32_t m_level; //!< Level of the pattern ==> this is to overwrite next pattern when we create an higher ....
|
int32_t m_level; //!< Level of the pattern ==> this is to overwrite next pattern when we create an higher ....
|
||||||
Edn::String m_paternName; //!< Current style name (like "c++" or "c" or "script Bash")
|
Edn::String m_paternName; //!< Current style name (like "c++" or "c" or "script Bash")
|
||||||
|
@@ -119,7 +119,22 @@ void CTagsManager::OnMessage(int32_t id, int32_t dataID)
|
|||||||
JumpTo();
|
JumpTo();
|
||||||
break;
|
break;
|
||||||
case EDN_MSG__JUMP_BACK:
|
case EDN_MSG__JUMP_BACK:
|
||||||
EDN_INFO("TODO .... jump back");
|
if (m_historyList.Size() > 0) {
|
||||||
|
BufferManager *myBufferManager = BufferManager::getInstance();
|
||||||
|
int32_t id = m_historyList.Size()-1;
|
||||||
|
if (false == myBufferManager->Exist(*m_historyList[id]) ) {
|
||||||
|
// need to open the file :
|
||||||
|
int32_t openID = myBufferManager->Open(*m_historyList[id]);
|
||||||
|
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, openID);
|
||||||
|
} else {
|
||||||
|
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, myBufferManager->GetId(*m_historyList[id]));
|
||||||
|
}
|
||||||
|
SendMessage(EDN_MSG__CURRENT_GOTO_LINE, m_historyList[id]->GetLineNumber());
|
||||||
|
// Remove element ....
|
||||||
|
delete(m_historyList[id]);
|
||||||
|
m_historyList[id]=NULL;
|
||||||
|
m_historyList.PopBack();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -155,7 +170,7 @@ void CTagsManager::AddToHistory(int32_t bufferID)
|
|||||||
for(int32_t iii= m_historyPos; iii < m_historyList.Size(); iii++) {
|
for(int32_t iii= m_historyPos; iii < m_historyList.Size(); iii++) {
|
||||||
delete(m_historyList[iii]);
|
delete(m_historyList[iii]);
|
||||||
}
|
}
|
||||||
m_historyList.Erase(m_historyPos, m_historyList.Size() - m_historyPos);
|
m_historyList.EraseLen(m_historyPos, m_historyList.Size() - m_historyPos);
|
||||||
}
|
}
|
||||||
// add the current element
|
// add the current element
|
||||||
BufferManager *myBufferManager = BufferManager::getInstance();
|
BufferManager *myBufferManager = BufferManager::getInstance();
|
||||||
@@ -169,30 +184,48 @@ enum
|
|||||||
CTAGS_NUM_COLS
|
CTAGS_NUM_COLS
|
||||||
};
|
};
|
||||||
|
|
||||||
GtkTreeModel * CTagsManager::CreateAndFillModel(void)
|
void CTagsManager::cb_row(GtkTreeView *p_treeview,
|
||||||
|
GtkTreePath * p_path,
|
||||||
|
GtkTreeViewColumn * p_column,
|
||||||
|
gpointer data)
|
||||||
{
|
{
|
||||||
GtkListStore * store;
|
EDN_DEBUG("event");
|
||||||
|
CTagsManager * self = reinterpret_cast<CTagsManager*>(data);
|
||||||
|
|
||||||
|
gchar * p_file=NULL;
|
||||||
|
gint lineNumber;
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
|
|
||||||
store = gtk_list_store_new(CTAGS_NUM_COLS, G_TYPE_STRING, G_TYPE_UINT);
|
|
||||||
|
|
||||||
// Append a row and fill in some data
|
if (gtk_tree_model_get_iter( GTK_TREE_MODEL(self->m_listStore), &iter, p_path))
|
||||||
for (int32_t iii=0; iii<m_currentList.Size() ; iii++) {
|
{
|
||||||
gtk_list_store_append(store, &iter);
|
gtk_tree_model_get( GTK_TREE_MODEL(self->m_listStore),
|
||||||
gtk_list_store_set(store, &iter,
|
&iter,
|
||||||
CTAGS_COL_FILE, m_currentList[iii].filename,
|
CTAGS_COL_FILE, &p_file,
|
||||||
CTAGS_COL_LINE_NUMBER, m_currentList[iii].lineID,
|
CTAGS_COL_LINE_NUMBER, &lineNumber,
|
||||||
-1);
|
-1 );
|
||||||
|
EDN_DEBUG("find : " << p_file << ":" << lineNumber);
|
||||||
|
for (int32_t iii = 0; iii < self->m_currentList.Size() ; iii++) {
|
||||||
|
if( self->m_currentList[iii].lineID == lineNumber
|
||||||
|
&& strcmp(self->m_currentList[iii].filename, p_file)==0)
|
||||||
|
{
|
||||||
|
g_object_unref( GTK_TREE_MODEL(self->m_listStore));
|
||||||
|
// Remove dialogue
|
||||||
|
gtk_widget_destroy(self->m_Dialog);
|
||||||
|
// Jump ...
|
||||||
|
self->JumpAtID(iii);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return GTK_TREE_MODEL(store);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GtkWidget * CTagsManager::CreateViewAndModel(void)
|
GtkWidget * CTagsManager::CreateViewAndModel(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
GtkCellRenderer * renderer;
|
GtkCellRenderer * renderer;
|
||||||
GtkTreeModel * model;
|
|
||||||
GtkWidget * view;
|
GtkWidget * view;
|
||||||
view = gtk_tree_view_new();
|
view = gtk_tree_view_new();
|
||||||
|
|
||||||
@@ -214,11 +247,21 @@ GtkWidget * CTagsManager::CreateViewAndModel(void)
|
|||||||
"text", CTAGS_COL_LINE_NUMBER,
|
"text", CTAGS_COL_LINE_NUMBER,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
model = CreateAndFillModel();
|
// Set data in the list :
|
||||||
|
GtkTreeIter iter;
|
||||||
|
m_listStore = gtk_list_store_new(CTAGS_NUM_COLS, G_TYPE_STRING, G_TYPE_UINT);
|
||||||
|
// Append a row and fill in some data
|
||||||
|
for (int32_t iii=0; iii<m_currentList.Size() ; iii++) {
|
||||||
|
gtk_list_store_append(m_listStore, &iter);
|
||||||
|
gtk_list_store_set(m_listStore, &iter,
|
||||||
|
CTAGS_COL_FILE, m_currentList[iii].filename,
|
||||||
|
CTAGS_COL_LINE_NUMBER, m_currentList[iii].lineID,
|
||||||
|
-1);
|
||||||
|
}
|
||||||
|
|
||||||
gtk_tree_view_set_model(GTK_TREE_VIEW (view), model);
|
gtk_tree_view_set_model( GTK_TREE_VIEW(view), GTK_TREE_MODEL(m_listStore) );
|
||||||
|
g_signal_connect( G_OBJECT(view), "row-activated", G_CALLBACK(cb_row), /*(gpointer)p_model*/ this );
|
||||||
g_object_unref(model);
|
//g_object_unref(GTK_TREE_MODEL(m_listStore));
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
@@ -230,31 +273,34 @@ GtkWidget * CTagsManager::CreateViewAndModel(void)
|
|||||||
int32_t CTagsManager::MultipleJump(void)
|
int32_t CTagsManager::MultipleJump(void)
|
||||||
{
|
{
|
||||||
// dlg to confirm the quit event :
|
// dlg to confirm the quit event :
|
||||||
GtkWidget *myDialog = gtk_dialog_new_with_buttons("C-Tags jump...",
|
m_Dialog = gtk_dialog_new_with_buttons("C-Tags jump...",
|
||||||
NULL,
|
NULL,
|
||||||
GTK_DIALOG_MODAL,
|
GTK_DIALOG_MODAL,
|
||||||
"Jump", GTK_RESPONSE_YES,
|
//"Jump", GTK_RESPONSE_YES,
|
||||||
GTK_STOCK_QUIT, GTK_RESPONSE_NO,
|
GTK_STOCK_QUIT, GTK_RESPONSE_NO,
|
||||||
NULL);
|
NULL);
|
||||||
// Set over main windows
|
// Set over main windows
|
||||||
//gtk_window_set_transient_for(GTK_WINDOW(myDialog), GTK_WINDOW(m_mainWindow->GetWidget()));
|
//gtk_window_set_transient_for(GTK_WINDOW(myDialog), GTK_WINDOW(m_mainWindow->GetWidget()));
|
||||||
// add writting area
|
// add writting area
|
||||||
GtkWidget *myContentArea = gtk_dialog_get_content_area( GTK_DIALOG(myDialog));
|
GtkWidget *myContentArea = gtk_dialog_get_content_area( GTK_DIALOG(m_Dialog));
|
||||||
GtkWidget *listView = CreateViewAndModel();
|
GtkWidget *listView = CreateViewAndModel();
|
||||||
gtk_box_pack_start(GTK_BOX(myContentArea), listView, TRUE, TRUE, 0);
|
gtk_box_pack_start(GTK_BOX(myContentArea), listView, TRUE, TRUE, 0);
|
||||||
// Display it
|
// Display it
|
||||||
gtk_widget_show_all(myContentArea);
|
gtk_widget_show_all(myContentArea);
|
||||||
int32_t result = gtk_dialog_run(GTK_DIALOG(myDialog));
|
int32_t result = gtk_dialog_run(GTK_DIALOG(m_Dialog));
|
||||||
// Get data from the gtk entry
|
// Get data from the gtk entry
|
||||||
result = 0; // remove warning
|
if (result == GTK_RESPONSE_NO) {
|
||||||
|
g_object_unref(GTK_TREE_MODEL(m_listStore));
|
||||||
|
// Remove dialogue
|
||||||
|
gtk_widget_destroy(m_Dialog);
|
||||||
|
}
|
||||||
//GtkTreeIter *myIter;
|
//GtkTreeIter *myIter;
|
||||||
//gtk_tree_selection_get_selected(selection, &model, myIter);
|
//gtk_tree_selection_get_selected(selection, &model, myIter);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Remove dialogue
|
// Remove dialogue
|
||||||
gtk_widget_destroy(myDialog);
|
//gtk_widget_destroy(myDialog);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -270,7 +316,16 @@ void BufferView::OnCtagsEventList(GtkWidget *menuitem, gpointer data)
|
|||||||
void CTagsManager::JumpAtID(int32_t selectID)
|
void CTagsManager::JumpAtID(int32_t selectID)
|
||||||
{
|
{
|
||||||
BufferManager *myBufferManager = BufferManager::getInstance();
|
BufferManager *myBufferManager = BufferManager::getInstance();
|
||||||
Edn::File myFile = m_currentList[0].filename;
|
Edn::File myFile = m_currentList[selectID].filename;
|
||||||
|
EDN_INFO("save curent filename and position : ");
|
||||||
|
int32_t currentSelected = myBufferManager->GetSelected();
|
||||||
|
Buffer* tmpBuf = myBufferManager->Get(currentSelected);
|
||||||
|
if (NULL != tmpBuf) {
|
||||||
|
Edn::File * bufferFilename = new Edn::File();
|
||||||
|
*bufferFilename = tmpBuf->GetFileName();
|
||||||
|
bufferFilename->SetLineNumber(tmpBuf->GetCurrentLine());
|
||||||
|
m_historyList.PushBack(bufferFilename);
|
||||||
|
}
|
||||||
EDN_INFO(" OPEN the TAG file Destination : " << myFile );
|
EDN_INFO(" OPEN the TAG file Destination : " << myFile );
|
||||||
if (false == myBufferManager->Exist(myFile) ) {
|
if (false == myBufferManager->Exist(myFile) ) {
|
||||||
// need to open the file :
|
// need to open the file :
|
||||||
@@ -292,7 +347,7 @@ void CTagsManager::JumpAtID(int32_t selectID)
|
|||||||
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);
|
||||||
*/
|
*/
|
||||||
SendMessage(EDN_MSG__CURRENT_GOTO_LINE, m_currentList[0].lineID);
|
SendMessage(EDN_MSG__CURRENT_GOTO_LINE, m_currentList[selectID].lineID - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -68,10 +68,14 @@ class CTagsManager: public Singleton<CTagsManager>, public MsgBroadcast
|
|||||||
Edn::VectorType<Edn::File*> m_historyList;
|
Edn::VectorType<Edn::File*> m_historyList;
|
||||||
Edn::VectorType<TagListFind_ts> m_currentList;
|
Edn::VectorType<TagListFind_ts> m_currentList;
|
||||||
void JumpAtID(int32_t selectID);
|
void JumpAtID(int32_t selectID);
|
||||||
GtkTreeModel * CreateAndFillModel(void);
|
|
||||||
GtkWidget * CreateViewAndModel(void);
|
GtkWidget * CreateViewAndModel(void);
|
||||||
|
static void cb_row (GtkTreeView *p_treeview,
|
||||||
// TMP Val :
|
GtkTreePath * p_path,
|
||||||
|
GtkTreeViewColumn * p_column,
|
||||||
|
gpointer p_data);
|
||||||
|
// save data in the list :
|
||||||
|
GtkListStore * m_listStore;
|
||||||
|
GtkWidget * m_Dialog;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -66,8 +66,6 @@ int main (int argc, char *argv[])
|
|||||||
ClipBoard::Init();
|
ClipBoard::Init();
|
||||||
Display::Init();
|
Display::Init();
|
||||||
|
|
||||||
//MainWindows *window = MainWindows::getInstance();
|
|
||||||
|
|
||||||
|
|
||||||
// init ALL Singleton :
|
// init ALL Singleton :
|
||||||
(void)MsgBroadcastCore::getInstance();
|
(void)MsgBroadcastCore::getInstance();
|
||||||
@@ -86,7 +84,8 @@ int main (int argc, char *argv[])
|
|||||||
#else
|
#else
|
||||||
homedir = "./data/";
|
homedir = "./data/";
|
||||||
#endif
|
#endif
|
||||||
homedir += "color_black.xml";
|
//homedir += "color_black.xml";
|
||||||
|
homedir += "color_white.xml";
|
||||||
myColorManager->LoadFile( homedir.c_str() );
|
myColorManager->LoadFile( homedir.c_str() );
|
||||||
myColorManager->DisplayListOfColor();
|
myColorManager->DisplayListOfColor();
|
||||||
|
|
||||||
|
@@ -1,179 +0,0 @@
|
|||||||
/**
|
|
||||||
*******************************************************************************
|
|
||||||
* @file AL_Mutex.c
|
|
||||||
* @brief Editeur De N'ours : Abstraction Layer Mutex
|
|
||||||
* @author Edouard DUPIN
|
|
||||||
* @date 04/12/2010
|
|
||||||
* @par Project
|
|
||||||
* Edn
|
|
||||||
*
|
|
||||||
* @par Copyright
|
|
||||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
|
||||||
*
|
|
||||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY.
|
|
||||||
*
|
|
||||||
* Licence summary :
|
|
||||||
* You can modify and redistribute the sources code and binaries.
|
|
||||||
* You can send me the bug-fix
|
|
||||||
* You can not earn money with this Software (if the source extract from Edn
|
|
||||||
* represent less than 50% of original Sources)
|
|
||||||
* Term of the licence in in the file licence.txt.
|
|
||||||
*
|
|
||||||
*******************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include "tools_debug.h"
|
|
||||||
#include "AL_Mutex.h"
|
|
||||||
// /usr/include/pthread.h
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief initialize the curent Mutex
|
|
||||||
*
|
|
||||||
* @param[in,out] pointerMutex Pointer on the mutex that might be init
|
|
||||||
* @param[in] recursive Enable the possibility that one thread can lock multiple time the same Mutex
|
|
||||||
*
|
|
||||||
* @return an standard Error Code (ERR_NONE / ERR_FAIL)
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
erreurCode_te AL_mutex_init(AL_MUTEX * pointerMutex,bool recursive)
|
|
||||||
{
|
|
||||||
int systemRet;
|
|
||||||
pthread_mutexattr_t mutexattr;
|
|
||||||
erreurCode_te myError= ERR_NONE;
|
|
||||||
EDN_CHECK_INOUT(pointerMutex);
|
|
||||||
// init mutex attributes
|
|
||||||
systemRet = pthread_mutexattr_init(&mutexattr);
|
|
||||||
if (0 == systemRet) {
|
|
||||||
if (true == recursive) {
|
|
||||||
systemRet = pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE_NP);
|
|
||||||
EDN_ASSERT(!systemRet, "pthread_mutexattr_settype Error");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
systemRet = pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_ERRORCHECK_NP);
|
|
||||||
EDN_ASSERT(!systemRet, "pthread_mutexattr_settype Error");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (0 == systemRet) {
|
|
||||||
systemRet = pthread_mutex_init(pointerMutex, &mutexattr);
|
|
||||||
EDN_ASSERT(!systemRet, "pthread_mutex_init Error Mutex Init");
|
|
||||||
if (systemRet) {
|
|
||||||
myError = ERR_FAIL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
systemRet = pthread_mutexattr_destroy(&mutexattr);
|
|
||||||
EDN_ASSERT(0 == systemRet, "pthread_mutexattr_destroy Error");
|
|
||||||
return myError;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Destroy the current Mutex
|
|
||||||
*
|
|
||||||
* @param[in,out] pointerMutex Pointer on the mutex that might be init
|
|
||||||
*
|
|
||||||
* @return an standard Error Code (ERR_NONE / ERR_FAIL)
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
erreurCode_te AL_mutex_destroy(AL_MUTEX * pointerMutex)
|
|
||||||
{
|
|
||||||
int systemRet;
|
|
||||||
EDN_CHECK_INOUT(pointerMutex);
|
|
||||||
systemRet = pthread_mutex_destroy(pointerMutex);
|
|
||||||
EDN_ASSERT(!systemRet, "pthread_mutex_destroy Error Mutex Destroy");
|
|
||||||
if (systemRet) {
|
|
||||||
return ERR_FAIL;
|
|
||||||
}
|
|
||||||
return ERR_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Lock the curent Mutex. Lock call
|
|
||||||
*
|
|
||||||
* @param[in,out] pointerMutex Pointer on the mutex that might be init
|
|
||||||
*
|
|
||||||
* @return ---
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void AL_mutex_lock(AL_MUTEX * pointerMutex)
|
|
||||||
{
|
|
||||||
int systemRet;
|
|
||||||
EDN_CHECK_INOUT(pointerMutex);
|
|
||||||
systemRet = pthread_mutex_lock(pointerMutex);
|
|
||||||
EDN_ASSERT(!systemRet, "pthread_mutex_lock Error Mutex lock");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Unlock the current Mutex
|
|
||||||
*
|
|
||||||
* @param[in,out] pointerMutex Pointer on the mutex that might be init
|
|
||||||
*
|
|
||||||
* @return ---
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void AL_mutex_unlock(AL_MUTEX * pointerMutex)
|
|
||||||
{
|
|
||||||
int systemRet;
|
|
||||||
EDN_CHECK_INOUT(pointerMutex);
|
|
||||||
systemRet = pthread_mutex_unlock(pointerMutex);
|
|
||||||
EDN_ASSERT(!systemRet, "pthread_mutex_unlock Error Mutex unlock");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Try the lock of the curent Mutex
|
|
||||||
*
|
|
||||||
* @param[in,out] pointerMutex Pointer on the mutex that might be init
|
|
||||||
*
|
|
||||||
* @return an standard Error Code (ERR_NONE / ERR_BUSY)
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
erreurCode_te AL_mutex_trylock(AL_MUTEX * pointerMutex)
|
|
||||||
{
|
|
||||||
int systemRet;
|
|
||||||
EDN_CHECK_INOUT(pointerMutex);
|
|
||||||
systemRet = pthread_mutex_trylock(pointerMutex);
|
|
||||||
EDN_ASSERT(0==systemRet || EBUSY==systemRet, "pthread_mutex_trylock Error Mutex unlock");
|
|
||||||
if (EBUSY==systemRet) {
|
|
||||||
return ERR_BUSY;
|
|
||||||
}
|
|
||||||
return ERR_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief try lock in a periode of time
|
|
||||||
*
|
|
||||||
* @param[in,out] pointerMutex Pointer on the mutex that might be init
|
|
||||||
*
|
|
||||||
* @return an standard Error Code (ERR_NONE / ERR_TIMEOUT)
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
erreurCode_te AL_mutex_timedlock(AL_MUTEX * pointerMutex, int32_t delay)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
int systemRet;
|
|
||||||
EDN_CHECK_INOUT(pointerMutex);
|
|
||||||
if (0 == delay) {
|
|
||||||
return ERR_NONE;
|
|
||||||
}
|
|
||||||
// TODO ... check is it OK...
|
|
||||||
systemRet = pthread_mutex_timedlock(pointerMutex, delay);
|
|
||||||
EDN_ASSERT(0 == systemRet || ETIMEDOUT == systemRet, "pthread_mutex_timedlock Error");
|
|
||||||
if (ETIMEDOUT == systemRet) {
|
|
||||||
return ERR_TIMEOUT;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
return ERR_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@@ -1,45 +0,0 @@
|
|||||||
/**
|
|
||||||
*******************************************************************************
|
|
||||||
* @file AL_Mutex.h
|
|
||||||
* @brief Editeur De N'ours : Abstraction Layer Mutex
|
|
||||||
* @author Edouard DUPIN
|
|
||||||
* @date 04/12/2010
|
|
||||||
* @par Project
|
|
||||||
* Edn
|
|
||||||
*
|
|
||||||
* @par Copyright
|
|
||||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
|
||||||
*
|
|
||||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY.
|
|
||||||
*
|
|
||||||
* Licence summary :
|
|
||||||
* You can modify and redistribute the sources code and binaries.
|
|
||||||
* You can send me the bug-fix
|
|
||||||
* You can not earn money with this Software (if the source extract from Edn
|
|
||||||
* represent less than 50% of original Sources)
|
|
||||||
* Term of the licence in in the file licence.txt.
|
|
||||||
*
|
|
||||||
*******************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __AL_MUTEX_H__
|
|
||||||
#define __AL_MUTEX_H__
|
|
||||||
|
|
||||||
//basic mutex with pthread system
|
|
||||||
#include <pthread.h>
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
|
|
||||||
typedef pthread_mutex_t AL_MUTEX;
|
|
||||||
|
|
||||||
erreurCode_te AL_mutex_init(AL_MUTEX * pointerMutex,bool recursive);
|
|
||||||
erreurCode_te AL_mutex_destroy(AL_MUTEX * pointerMutex);
|
|
||||||
void AL_mutex_lock(AL_MUTEX * pointerMutex);
|
|
||||||
void AL_mutex_unlock(AL_MUTEX * pointerMutex);
|
|
||||||
erreurCode_te AL_mutex_trylock(AL_MUTEX * pointerMutex);
|
|
||||||
//erreurCode_te AL_mutex_timedlock(AL_MUTEX * pointerMutex, int32_t delay);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
@@ -90,17 +90,17 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
|
|||||||
m_HLDataPass1.Erase(0);
|
m_HLDataPass1.Erase(0);
|
||||||
//EDN_DEBUG("1 * Erase 0");
|
//EDN_DEBUG("1 * Erase 0");
|
||||||
} else {
|
} else {
|
||||||
m_HLDataPass1.Erase(0,stopId);
|
m_HLDataPass1.EraseLen(0,stopId);
|
||||||
//EDN_DEBUG("2 * Erase 0->" << stopId);
|
//EDN_DEBUG("2 * Erase 0->" << stopId);
|
||||||
}
|
}
|
||||||
} else if(-1 == stopId) {
|
} else if(-1 == stopId) {
|
||||||
//EDN_DEBUG("3 * Erase " << startId+1 << "-> end");
|
//EDN_DEBUG("3 * Erase " << startId+1 << "-> end");
|
||||||
m_HLDataPass1.Erase(startId+1, m_HLDataPass1.Size() - startId);
|
m_HLDataPass1.EraseLen(startId+1, m_HLDataPass1.Size() - startId);
|
||||||
stopId = -1;
|
stopId = -1;
|
||||||
} else {
|
} else {
|
||||||
int32_t currentSize = m_HLDataPass1.Size();
|
int32_t currentSize = m_HLDataPass1.Size();
|
||||||
//EDN_DEBUG("4 * Erase " << startId+1 << "->" << stopId << " in " << currentSize << " elements" );
|
//EDN_DEBUG("4 * Erase " << startId+1 << "->" << stopId << " in " << currentSize << " elements" );
|
||||||
m_HLDataPass1.Erase(startId+1, stopId - startId);
|
m_HLDataPass1.EraseLen(startId+1, stopId - startId);
|
||||||
if (stopId == currentSize-1) {
|
if (stopId == currentSize-1) {
|
||||||
stopId = -1;
|
stopId = -1;
|
||||||
}
|
}
|
||||||
|
@@ -79,8 +79,8 @@ static char * GetMessageChar(messageType_te Id)
|
|||||||
{
|
{
|
||||||
switch(Id)
|
switch(Id)
|
||||||
{
|
{
|
||||||
MACRO_DISPLAY_MSG(EDN_MSG__QUIT)
|
|
||||||
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_CHANGE_CURRENT)
|
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_CHANGE_CURRENT)
|
||||||
|
MACRO_DISPLAY_MSG(EDN_MSG__USER_DISPLAY_CHANGE)
|
||||||
|
|
||||||
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_MAIN_WINDOWS)
|
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_MAIN_WINDOWS)
|
||||||
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_SEARCH)
|
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_SEARCH)
|
||||||
@@ -90,6 +90,7 @@ static char * GetMessageChar(messageType_te Id)
|
|||||||
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_SAVE_AS)
|
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_SAVE_AS)
|
||||||
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_GOTO_LINE)
|
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_GOTO_LINE)
|
||||||
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_ABOUT)
|
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_ABOUT)
|
||||||
|
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_EXIT_CONFIRMATION)
|
||||||
|
|
||||||
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_REMOVE)
|
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_REMOVE)
|
||||||
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_REMOVE_ALL)
|
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_REMOVE_ALL)
|
||||||
@@ -138,6 +139,12 @@ static char * GetMessageChar(messageType_te Id)
|
|||||||
MACRO_DISPLAY_MSG(EDN_MSG__JUMP_TO_CURRENT_SELECTION)
|
MACRO_DISPLAY_MSG(EDN_MSG__JUMP_TO_CURRENT_SELECTION)
|
||||||
MACRO_DISPLAY_MSG(EDN_MSG__JUMP_BACK)
|
MACRO_DISPLAY_MSG(EDN_MSG__JUMP_BACK)
|
||||||
|
|
||||||
|
// HL message :
|
||||||
|
MACRO_DISPLAY_MSG(EDN_MSG__COLOR_HAS_CHANGE)
|
||||||
|
|
||||||
|
// Color message :
|
||||||
|
MACRO_DISPLAY_MSG(EDN_MSG__RELOAD_COLOR_FILE)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return (char*)"??";
|
return (char*)"??";
|
||||||
}
|
}
|
||||||
@@ -163,6 +170,10 @@ static char * GetMessageTypeChar(messageCat_te Id)
|
|||||||
return (char*)"C-TAGS_MANAGER";
|
return (char*)"C-TAGS_MANAGER";
|
||||||
case EDN_CAT_MENU_CONTEXT:
|
case EDN_CAT_MENU_CONTEXT:
|
||||||
return (char*)"MENU CONTEXT";
|
return (char*)"MENU CONTEXT";
|
||||||
|
case EDN_CAT_HL:
|
||||||
|
return (char*)"HIGHT-LIGHT";
|
||||||
|
case EDN_CAT_COLOR:
|
||||||
|
return (char*)"COLOR";
|
||||||
default:
|
default:
|
||||||
return (char*)"??";
|
return (char*)"??";
|
||||||
}
|
}
|
||||||
@@ -204,6 +215,14 @@ void MsgBroadcastCore::SendMessage(MsgBroadcast * pointerOnSender, messageType_t
|
|||||||
&& MSG_TO_CONTEXT__STOP >= id )
|
&& MSG_TO_CONTEXT__STOP >= id )
|
||||||
{
|
{
|
||||||
catDest = EDN_CAT_MENU_CONTEXT;
|
catDest = EDN_CAT_MENU_CONTEXT;
|
||||||
|
} else if( MSG_TO_HL__START <= id
|
||||||
|
&& MSG_TO_HL__STOP >= id )
|
||||||
|
{
|
||||||
|
catDest = EDN_CAT_HL;
|
||||||
|
} else if( MSG_TO_COLOR__START <= id
|
||||||
|
&& MSG_TO_COLOR__STOP >= id )
|
||||||
|
{
|
||||||
|
catDest = EDN_CAT_COLOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
myStructMessage.localMessageID = m_messageID++;
|
myStructMessage.localMessageID = m_messageID++;
|
||||||
|
@@ -38,9 +38,8 @@
|
|||||||
// the ID we'll use to identify our event
|
// the ID we'll use to identify our event
|
||||||
typedef enum {
|
typedef enum {
|
||||||
EDN_MSG__NONE = 0,
|
EDN_MSG__NONE = 0,
|
||||||
// Programm is Quitting... close all if needed ...
|
|
||||||
EDN_MSG__QUIT,
|
|
||||||
EDN_MSG__BUFFER_CHANGE_CURRENT, // set the new current BUFFER ...
|
EDN_MSG__BUFFER_CHANGE_CURRENT, // set the new current BUFFER ...
|
||||||
|
EDN_MSG__USER_DISPLAY_CHANGE, // User change the display ==> need to reload all the display depending on color internal
|
||||||
|
|
||||||
// DESTINATION : GUI_MANAGER
|
// DESTINATION : GUI_MANAGER
|
||||||
MSG_TO_GUI_MANAGER__START,
|
MSG_TO_GUI_MANAGER__START,
|
||||||
@@ -53,6 +52,7 @@ typedef enum {
|
|||||||
EDN_MSG__GUI_SHOW_SAVE_AS,
|
EDN_MSG__GUI_SHOW_SAVE_AS,
|
||||||
EDN_MSG__GUI_SHOW_GOTO_LINE,
|
EDN_MSG__GUI_SHOW_GOTO_LINE,
|
||||||
EDN_MSG__GUI_SHOW_ABOUT,
|
EDN_MSG__GUI_SHOW_ABOUT,
|
||||||
|
EDN_MSG__GUI_SHOW_EXIT_CONFIRMATION,
|
||||||
MSG_TO_GUI_MANAGER__STOP,
|
MSG_TO_GUI_MANAGER__STOP,
|
||||||
|
|
||||||
// DESTINATION : GUI
|
// DESTINATION : GUI
|
||||||
@@ -125,6 +125,16 @@ typedef enum {
|
|||||||
MSG_TO_CONTEXT__START,
|
MSG_TO_CONTEXT__START,
|
||||||
MSG_TO_CONTEXT__STOP,
|
MSG_TO_CONTEXT__STOP,
|
||||||
|
|
||||||
|
// DESTINATION : highlight system ...
|
||||||
|
MSG_TO_HL__START,
|
||||||
|
EDN_MSG__COLOR_HAS_CHANGE,
|
||||||
|
MSG_TO_HL__STOP,
|
||||||
|
|
||||||
|
// DESTINATION : Color System ...
|
||||||
|
MSG_TO_COLOR__START,
|
||||||
|
EDN_MSG__RELOAD_COLOR_FILE,
|
||||||
|
MSG_TO_COLOR__STOP,
|
||||||
|
|
||||||
|
|
||||||
}messageType_te;
|
}messageType_te;
|
||||||
|
|
||||||
@@ -137,6 +147,8 @@ typedef enum {
|
|||||||
EDN_CAT_GUI_MANAGER,
|
EDN_CAT_GUI_MANAGER,
|
||||||
EDN_CAT_CTAGS,
|
EDN_CAT_CTAGS,
|
||||||
EDN_CAT_MENU_CONTEXT,
|
EDN_CAT_MENU_CONTEXT,
|
||||||
|
EDN_CAT_HL,
|
||||||
|
EDN_CAT_COLOR,
|
||||||
}messageCat_te;
|
}messageCat_te;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -212,6 +212,10 @@ int32_t Edn::File::GetLineNumber(void)
|
|||||||
return m_lineNumberOpen;
|
return m_lineNumberOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Edn::File::SetLineNumber(int32_t newline)
|
||||||
|
{
|
||||||
|
m_lineNumberOpen = newline;
|
||||||
|
}
|
||||||
|
|
||||||
bool Edn::File::HasExtention(void)
|
bool Edn::File::HasExtention(void)
|
||||||
{
|
{
|
||||||
|
@@ -44,6 +44,7 @@ namespace Edn
|
|||||||
bool HasExtention(void);
|
bool HasExtention(void);
|
||||||
Edn::String GetExtention(void);
|
Edn::String GetExtention(void);
|
||||||
int32_t GetLineNumber(void);
|
int32_t GetLineNumber(void);
|
||||||
|
void SetLineNumber(int32_t newline);
|
||||||
void SetCompleateName(Edn::String &newFilename);
|
void SetCompleateName(Edn::String &newFilename);
|
||||||
|
|
||||||
const Edn::File& operator= (const Edn::File &ednF );
|
const Edn::File& operator= (const Edn::File &ednF );
|
||||||
|
@@ -471,7 +471,7 @@ void Edn::String::Remove(int32_t currentID, int32_t len)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// TODO : check the size of the data
|
// TODO : check the size of the data
|
||||||
m_data.Erase(currentID, len);
|
m_data.EraseLen(currentID, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -584,6 +584,8 @@ Edn::VectorType<int8_t> Edn::String::GetVector(void)
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Unitary test for the string system
|
* @brief Unitary test for the string system
|
||||||
*
|
*
|
||||||
|
@@ -474,7 +474,33 @@ template<typename MY_TYPE=int32_t> class VectorType
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Remove one element
|
* @brief Remove N elements
|
||||||
|
*
|
||||||
|
* @param[in] pos Position to remove the data
|
||||||
|
* @param[in] posEnd Last position number
|
||||||
|
*
|
||||||
|
* @return ---
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void Erase(int32_t pos, int32_t posEnd)
|
||||||
|
{
|
||||||
|
if (pos>m_size) {
|
||||||
|
EDN_ERROR(" can not Erase Element at this position : " << pos << " > " << m_size);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (posEnd>m_size) {
|
||||||
|
posEnd = m_size;
|
||||||
|
}
|
||||||
|
int32_t nbElement = m_size - pos;
|
||||||
|
int32_t tmpSize = m_size;
|
||||||
|
// move curent data
|
||||||
|
memmove((m_data + pos), (m_data + pos + nbElement), (tmpSize - (pos+nbElement))*sizeof(MY_TYPE) );
|
||||||
|
// Request resize of the current buffer
|
||||||
|
Resize(m_size-nbElement);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Remove N element
|
||||||
*
|
*
|
||||||
* @param[in] pos Position to remove the data
|
* @param[in] pos Position to remove the data
|
||||||
* @param[in] nbElement number of element to remove
|
* @param[in] nbElement number of element to remove
|
||||||
@@ -482,10 +508,10 @@ template<typename MY_TYPE=int32_t> class VectorType
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void Erase(int32_t pos, int32_t nbElement)
|
void EraseLen(int32_t pos, int32_t nbElement)
|
||||||
{
|
{
|
||||||
if (pos>m_size) {
|
if (pos>m_size) {
|
||||||
EDN_ERROR(" can not Erase Element at this position : " << pos << " > " << m_size);
|
EDN_ERROR(" can not Erase Len Element at this position : " << pos << " > " << m_size);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pos+nbElement>m_size) {
|
if (pos+nbElement>m_size) {
|
||||||
|
@@ -15,27 +15,21 @@
|
|||||||
- Project manager phase 1
|
- Project manager phase 1
|
||||||
|
|
||||||
# action a faire (ordonner par r<>vision) :
|
# action a faire (ordonner par r<>vision) :
|
||||||
* 0.1.X :
|
|
||||||
- ctags : Back simple et multiple
|
|
||||||
- ctags : Multiple files
|
|
||||||
- sys : search complet, replace complet and replace ALL ...
|
|
||||||
- gui : demander l'enregistrement avant de fermer (quand c'est n<>cessaire)
|
|
||||||
- Faire les deplacement de EdnXXX dans le nameSpace Edn::XXX
|
|
||||||
- Edn::VectorType : Rewrite the erase fuction to support start => stop and Erase len methode ...
|
|
||||||
* 0.2.X :
|
* 0.2.X :
|
||||||
|
- gui : Amelioration du full-screen et du display de base (sans l'entete de la fenetre)
|
||||||
|
- gui : Mise en place d'un display ligne par ligne
|
||||||
|
- 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)
|
||||||
- sys : Mise en place des colorisation de base pour le
|
- sys : Mise en place des colorisation de base pour le
|
||||||
* makefiles
|
|
||||||
* script bash
|
|
||||||
* python
|
|
||||||
* matlab
|
|
||||||
* java script
|
* java script
|
||||||
* SQL
|
* SQL
|
||||||
- gui : ascenceur quand n<>cessaire
|
|
||||||
- Catch Shift+TAB
|
- Catch Shift+TAB
|
||||||
- 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
|
||||||
- pb de s<>lection quand la ligne est pleine et la premi<6D>re ligne s<>ctionn<6E>e.
|
- pb de s<>lection quand la ligne est pleine et la premi<6D>re ligne s<>ctionn<6E>e.
|
||||||
- PB de copier coller sur les <20><><EFBFBD> ...
|
- PB de copier coller sur les <20><><EFBFBD> ...
|
||||||
|
- PB sur le caplock et les caract<63>re multiples type chapot ...
|
||||||
|
- PB du entrer sur le kaypad qui fait un <CR> ==> ajouter la fonction shift+enter qui cree un <CR>
|
||||||
|
- catch F[1-12] ==> for user function
|
||||||
* 0.3.X :
|
* 0.3.X :
|
||||||
- Charset UTF-8 et iso 8859-15 correcte
|
- Charset UTF-8 et iso 8859-15 correcte
|
||||||
- Transformation de charset a la vol<6F>e
|
- Transformation de charset a la vol<6F>e
|
||||||
@@ -49,6 +43,7 @@
|
|||||||
* 0.5.X :
|
* 0.5.X :
|
||||||
- project : list of current files open
|
- project : list of current files open
|
||||||
- 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...
|
||||||
|
- sys : replace ALL
|
||||||
|
|
||||||
# Text Editor
|
# Text Editor
|
||||||
|
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<EdnColor version="0.1">
|
<EdnColor version="0.1">
|
||||||
<gui> <!-- Doivent tous y <20>tre de prf<72>rence ... global system acces -->
|
<gui> <!-- Doivent tous y <20>tre de prf<72>rence ... global system acces -->
|
||||||
|
<color name="CODE_basicBackgroung" val="#151515"/>
|
||||||
<color name="CODE_space" val="#333333"/>
|
<color name="CODE_space" val="#333333"/>
|
||||||
<color name="CODE_tabulation" val="#444444"/>
|
<color name="CODE_tabulation" val="#444444"/>
|
||||||
<color name="CODE_basicBackgroung" val="#151515"/>
|
|
||||||
<color name="CODE_cursor" val="#eadd05"/>
|
<color name="CODE_cursor" val="#eadd05"/>
|
||||||
<color name="CODE_lineNumber" val="#fff725"/>
|
<color name="CODE_lineNumber" val="#fff725"/>
|
||||||
<!-- Buffer list property -->
|
<!-- Buffer list property -->
|
||||||
@@ -16,7 +16,6 @@
|
|||||||
<syntax>
|
<syntax>
|
||||||
<color name="normal" FG="#EEEEEE"/>
|
<color name="normal" FG="#EEEEEE"/>
|
||||||
<color name="SelectedText" FG="#AAAAAA" BG="#225a09"/>
|
<color name="SelectedText" FG="#AAAAAA" BG="#225a09"/>
|
||||||
<color name="SelectedNoText" BG="#124a00"/>
|
|
||||||
<color name="error" FG="#FF0000"/>
|
<color name="error" FG="#FF0000"/>
|
||||||
<color name="doubleQuoteText" FG="#00fF00"/>
|
<color name="doubleQuoteText" FG="#00fF00"/>
|
||||||
|
|
||||||
|
40
data/color_white.xml
Normal file
40
data/color_white.xml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<EdnColor version="0.1">
|
||||||
|
<gui> <!-- Doivent tous y <20>tre de prf<72>rence ... global system acces -->
|
||||||
|
<color name="CODE_basicBackgroung" val="#d9d7d7"/>
|
||||||
|
<color name="CODE_space" val="#b7b6b6"/>
|
||||||
|
<color name="CODE_tabulation" val="#a7a5a5"/>
|
||||||
|
<color name="CODE_cursor" val="#2a00ff"/>
|
||||||
|
<color name="CODE_lineNumber" val="#1a00a0"/>
|
||||||
|
<!-- Buffer list property -->
|
||||||
|
<color name="LIST_backgroung1" val="#d9d7d7"/>
|
||||||
|
<color name="LIST_backgroung2" val="#b7b6b6"/>
|
||||||
|
<color name="LIST_backgroungSelected" val="#3da3f9"/>
|
||||||
|
<color name="LIST_textNormal" val="#000000"/>
|
||||||
|
<color name="LIST_textModify" val="#FF0000"/>
|
||||||
|
</gui>
|
||||||
|
<syntax>
|
||||||
|
<color name="normal" FG="#000000"/>
|
||||||
|
<color name="SelectedText" FG="#292929" BG="#009ce7"/>
|
||||||
|
<color name="error" FG="#FF0000"/>
|
||||||
|
<color name="doubleQuoteText" FG="#008e00"/>
|
||||||
|
|
||||||
|
<!-- hightline description : -->
|
||||||
|
<color name="type" FG="#376d0a" bold="yes"/>
|
||||||
|
<color name="storageKeyword" FG="#466cb4"/>
|
||||||
|
<color name="number" FG="#007b00"/>
|
||||||
|
<color name="systemFunction" FG="#acaa00"/>
|
||||||
|
<color name="commonDefine" FG="#3c850b"/>
|
||||||
|
<color name="boolean" FG="#1633a3"/>
|
||||||
|
<color name="preprocesseur" FG="#ac0000"/>
|
||||||
|
<color name="comment" FG="#b704b5" italic="yes"/>
|
||||||
|
<color name="commentDoxygen" FG="#bf3e00" bold="yes" italic="yes"/>
|
||||||
|
<color name="keyword" FG="#215eb8" bold="yes"/>
|
||||||
|
<color name="macro" FG="#571793" bold="yes"/>
|
||||||
|
<color name="SYNTAX_ERROR" FG="#000000" BG="#c20000" bold="yes"/>
|
||||||
|
<color name="functionName" FG="#09857e" bold="yes"/>
|
||||||
|
<color name="TestResultOK" FG="#000000" BG="#009c00" bold="yes"/>
|
||||||
|
<color name="TestResultERROR" FG="#000000" BG="#c20000" bold="yes"/>
|
||||||
|
</syntax>
|
||||||
|
</EdnColor>
|
||||||
|
|
BIN
data/imagesSources/delete-24px.png
Normal file
BIN
data/imagesSources/delete-24px.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
data/imagesSources/delete.png
Normal file
BIN
data/imagesSources/delete.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
BIN
data/imagesSources/icone.png
Normal file
BIN
data/imagesSources/icone.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
BIN
data/imagesSources/icone.xcf
Normal file
BIN
data/imagesSources/icone.xcf
Normal file
Binary file not shown.
@@ -1,5 +1,5 @@
|
|||||||
<?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="Makefiles">
|
||||||
<ext>Makefile</ext>
|
<ext>Makefile</ext>
|
||||||
<ext>*.mk</ext>
|
<ext>*.mk</ext>
|
||||||
<ext>*.global</ext>
|
<ext>*.global</ext>
|
||||||
|
48
data/lang_bash.xml
Normal file
48
data/lang_bash.xml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<EdnLang version="0.1" lang="Bash script">
|
||||||
|
<ext>*.sh</ext>
|
||||||
|
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
||||||
|
<rule name="first line">
|
||||||
|
<color>commentDoxygen</color>
|
||||||
|
<start>#!</start>
|
||||||
|
<end>\n</end>
|
||||||
|
<EscapeChar>\</EscapeChar>
|
||||||
|
</rule>
|
||||||
|
<rule name="comment line">
|
||||||
|
<color>comment</color>
|
||||||
|
<start>#</start>
|
||||||
|
<end>\n</end>
|
||||||
|
<EscapeChar>\</EscapeChar>
|
||||||
|
</rule>
|
||||||
|
<rule name="doubleQuteText">
|
||||||
|
<color>doubleQuoteText</color>
|
||||||
|
<start>"</start>
|
||||||
|
<end>"</end>
|
||||||
|
<EscapeChar>\</EscapeChar>
|
||||||
|
</rule>
|
||||||
|
<rule name="simpleQuteText">
|
||||||
|
<color>doubleQuoteText</color>
|
||||||
|
<start>'</start>
|
||||||
|
<end>'</end>
|
||||||
|
<!--<EscapeChar>\</EscapeChar>-->
|
||||||
|
</rule>
|
||||||
|
</pass1>
|
||||||
|
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
|
||||||
|
<rule name="my keyword">
|
||||||
|
<color>keyword</color>
|
||||||
|
<start>\@for|done|do|while|in|if|then|else|fi\@</start>
|
||||||
|
</rule>
|
||||||
|
<rule name="my Variable">
|
||||||
|
<color>keyword</color>
|
||||||
|
<start>[\$]+[a-zA-Z_][a-zA-Z0-9_]*</start>
|
||||||
|
</rule>
|
||||||
|
<rule name="Function name">
|
||||||
|
<color>functionName</color>
|
||||||
|
<start>function (\w|_)+[ \t]*\(</start>
|
||||||
|
</rule>
|
||||||
|
<rule name="condition">
|
||||||
|
<color>boolean</color>
|
||||||
|
<start>==|<=|>=|!=|<{1,2}|>{1,2}|&&|\{|\}|</start>
|
||||||
|
</rule>
|
||||||
|
</pass2>
|
||||||
|
</EdnLang>
|
@@ -1,5 +1,5 @@
|
|||||||
<?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="boulou log">
|
||||||
<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 -->
|
||||||
<rule name="comment ##">
|
<rule name="comment ##">
|
||||||
|
62
data/lang_matlab.xml
Normal file
62
data/lang_matlab.xml
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<EdnLang version="0.1" lang="matlab">
|
||||||
|
<ext>*.m</ext>
|
||||||
|
<ext>*.M</ext>
|
||||||
|
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
||||||
|
<rule name="my comment doxygen">
|
||||||
|
<color>commentDoxygen</color>
|
||||||
|
<start>%%</start>
|
||||||
|
<end>\n</end>
|
||||||
|
</rule>
|
||||||
|
<rule name="my comment">
|
||||||
|
<color>comment</color>
|
||||||
|
<start>%</start>
|
||||||
|
<end>\n</end>
|
||||||
|
<EscapeChar>\</EscapeChar>
|
||||||
|
</rule>
|
||||||
|
<rule name="doubleQuteText">
|
||||||
|
<color>doubleQuoteText</color>
|
||||||
|
<start> "</start>
|
||||||
|
<end>("|\n)</end>
|
||||||
|
<EscapeChar>\</EscapeChar>
|
||||||
|
</rule>
|
||||||
|
<rule name="simpleQuteText">
|
||||||
|
<color>doubleQuoteText</color>
|
||||||
|
<start> '</start>
|
||||||
|
<end>('|\n)</end>
|
||||||
|
<!--<EscapeChar>\</EscapeChar>-->
|
||||||
|
</rule>
|
||||||
|
<rule name="global inclusion">
|
||||||
|
<color>preprocesseur</color>
|
||||||
|
<start>global </start>
|
||||||
|
<end>\n</end>
|
||||||
|
<EscapeChar>\</EscapeChar>
|
||||||
|
</rule>
|
||||||
|
</pass1>
|
||||||
|
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
|
||||||
|
<rule name="my keyword">
|
||||||
|
<color>keyword</color>
|
||||||
|
<start>\@return|goto|if|else|case|default|switch|break|continue|while|do|for|otherwise|end\@</start>
|
||||||
|
</rule>
|
||||||
|
<rule name="my boolean">
|
||||||
|
<color>boolean</color>
|
||||||
|
<start>\@true|false\@</start>
|
||||||
|
</rule>
|
||||||
|
<rule name="Function name">
|
||||||
|
<color>functionName</color>
|
||||||
|
<start>\@(\w|_)+[ \t]*\(</start>
|
||||||
|
</rule>
|
||||||
|
<rule name="condition">
|
||||||
|
<color>boolean</color>
|
||||||
|
<start>==|<=|>=|!=|<{1,2}|>{1,2}|&&|\{|\}|</start>
|
||||||
|
</rule>
|
||||||
|
<rule name="numeric constant">
|
||||||
|
<color>number</color>
|
||||||
|
<start>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</start>
|
||||||
|
</rule>
|
||||||
|
<rule name="BIG LETTER">
|
||||||
|
<color>macro</color>
|
||||||
|
<start>\@[A-Z_][A-Z_0-9]{3,500}\@</start>
|
||||||
|
</rule>
|
||||||
|
</pass2>
|
||||||
|
</EdnLang>
|
@@ -1,5 +1,5 @@
|
|||||||
<?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="php: pretty home page">
|
||||||
<ext>*.php</ext>
|
<ext>*.php</ext>
|
||||||
<ext>*.php3</ext>
|
<ext>*.php3</ext>
|
||||||
<ext>*.php4</ext>
|
<ext>*.php4</ext>
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<?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="XML">
|
||||||
<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">
|
||||||
|
6
test2.c
6
test2.c
@@ -18,15 +18,15 @@
|
|||||||
//#include "tools_debug.h"
|
//#include "tools_debug.h"
|
||||||
#include "tools_globals.h"
|
#include "tools_globals.h"
|
||||||
#include "EdnBuf.h"
|
#include "EdnBuf.h"
|
||||||
|
Edn
|
||||||
m_isUndoProcessing = false;
|
m_isUndoProcessing = false;
|
||||||
m_isRedoProcessing = false;
|
m_isRedoProcessing = false;
|
||||||
|
Edn
|
||||||
// Load highlight system :
|
// Load highlight system :
|
||||||
HighlightManager *myHighlightManager = HighlightManager::getInstance();
|
HighlightManager *myHighlightManager = HighlightManager::getInstance();
|
||||||
EdnString plop = ".c";
|
EdnString plop = ".c";
|
||||||
m_Highlight = myHighlightManager->Get(plop);
|
m_Highlight = myHighlightManager->Get(plop);
|
||||||
//m_Highlight = NULL;
|
//m_Highlight = NULL;
|
||||||
m_nbLine = 1;
|
m_nbLine = 1;Edn
|
||||||
m_HLDataSequence = 0;
|
m_HLDataSequence = 0;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user