SYS : next step of the new display methode ...
This commit is contained in:
parent
2712d4f67d
commit
745ca76a74
1
Makefile
1
Makefile
@ -178,7 +178,6 @@ CXXFILES+= CustumWidget/BufferView/BufferView.cpp \
|
|||||||
|
|
||||||
# Basic Interface :
|
# Basic Interface :
|
||||||
CXXFILES+= Buffer/Buffer.cpp \
|
CXXFILES+= Buffer/Buffer.cpp \
|
||||||
Buffer/BufferAnchor.cpp \
|
|
||||||
Buffer/BufferText.cpp \
|
Buffer/BufferText.cpp \
|
||||||
Buffer/BufferEmpty.cpp \
|
Buffer/BufferEmpty.cpp \
|
||||||
Buffer/BufferManager.cpp \
|
Buffer/BufferManager.cpp \
|
||||||
|
@ -48,6 +48,12 @@ Buffer::Buffer()
|
|||||||
mString += fileBasicID++;
|
mString += fileBasicID++;
|
||||||
SetFileName(mString);
|
SetFileName(mString);
|
||||||
m_haveName = false;
|
m_haveName = false;
|
||||||
|
// Set basic anchor
|
||||||
|
bufferAnchorReference_ts tmpAnchor;
|
||||||
|
tmpAnchor.m_idAnchor = -1;
|
||||||
|
tmpAnchor.m_lineId = 0;
|
||||||
|
tmpAnchor.m_bufferPos = 0;
|
||||||
|
m_AnchorList .PushBack(tmpAnchor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,6 +68,12 @@ Buffer::Buffer(Edn::File &newName)
|
|||||||
{
|
{
|
||||||
m_fileModify = false;
|
m_fileModify = false;
|
||||||
SetFileName(newName);
|
SetFileName(newName);
|
||||||
|
// Set basic anchor
|
||||||
|
bufferAnchorReference_ts tmpAnchor;
|
||||||
|
tmpAnchor.m_idAnchor = -1;
|
||||||
|
tmpAnchor.m_lineId = 0;
|
||||||
|
tmpAnchor.m_bufferPos = 0;
|
||||||
|
m_AnchorList .PushBack(tmpAnchor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -146,11 +158,12 @@ void Buffer::SetLineDisplay(uint32_t lineNumber)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int32_t Buffer::Display(DrawerManager &drawer)
|
void Buffer::DrawLine(DrawerManager &drawer, bufferAnchor_ts &anchor, position_ts &displayStart, position_ts &displaySize)
|
||||||
{
|
{
|
||||||
return ERR_NONE;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
*
|
*
|
||||||
@ -161,9 +174,10 @@ int32_t Buffer::Display(DrawerManager &drawer)
|
|||||||
* @todo : Set the move up and DOWN...
|
* @todo : Set the move up and DOWN...
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void Buffer::MouseSelectFromCursorTo(int32_t width, int32_t height)
|
position_ts Buffer::MouseSelectFromCursorTo(int32_t width, int32_t height)
|
||||||
{
|
{
|
||||||
// nothing to do
|
position_ts tmp = {0,0};
|
||||||
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -176,9 +190,10 @@ void Buffer::MouseSelectFromCursorTo(int32_t width, int32_t height)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void Buffer::MouseEvent(int32_t width, int32_t height)
|
position_ts Buffer::MouseEvent(int32_t width, int32_t height)
|
||||||
{
|
{
|
||||||
// nothing to do
|
position_ts tmp = {0,0};
|
||||||
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -189,9 +204,10 @@ void Buffer::MouseEvent(int32_t width, int32_t height)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void Buffer::MouseEventDouble(void)
|
position_ts Buffer::MouseEventDouble(void)
|
||||||
{
|
{
|
||||||
// nothing to do
|
position_ts tmp = {0,0};
|
||||||
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -202,9 +218,10 @@ void Buffer::MouseEventDouble(void)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void Buffer::MouseEventTriple(void)
|
position_ts Buffer::MouseEventTriple(void)
|
||||||
{
|
{
|
||||||
// nothing to do
|
position_ts tmp = {0,0};
|
||||||
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -243,9 +260,10 @@ void Buffer::ScrollUp(void)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void Buffer::cursorMove(int32_t gtkKey)
|
position_ts Buffer::cursorMove(int32_t gtkKey)
|
||||||
{
|
{
|
||||||
// nothing to do
|
position_ts tmp = {0,0};
|
||||||
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -256,19 +274,22 @@ void Buffer::cursorMove(int32_t gtkKey)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void Buffer::AddChar(char * UTF8data)
|
position_ts Buffer::AddChar(char * UTF8data)
|
||||||
{
|
{
|
||||||
// nothing to do
|
position_ts tmp = {0,0};
|
||||||
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Buffer::Search(Edn::String &data, bool back, bool caseSensitive, bool wrap, bool regExp)
|
position_ts Buffer::Search(Edn::String &data, bool back, bool caseSensitive, bool wrap, bool regExp)
|
||||||
{
|
{
|
||||||
// nothing to do
|
position_ts tmp = {0,0};
|
||||||
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Buffer::Replace(Edn::String &data)
|
position_ts Buffer::Replace(Edn::String &data)
|
||||||
{
|
{
|
||||||
// nothing to do
|
position_ts tmp = {0,0};
|
||||||
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Buffer::FindLine(Edn::String &data)
|
int32_t Buffer::FindLine(Edn::String &data)
|
||||||
@ -277,9 +298,10 @@ int32_t Buffer::FindLine(Edn::String &data)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Buffer::JumpAtLine(int32_t newLine)
|
position_ts Buffer::JumpAtLine(int32_t newLine)
|
||||||
{
|
{
|
||||||
// nothing to do
|
position_ts tmp = {0,0};
|
||||||
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -319,9 +341,10 @@ void Buffer::Copy(int8_t clipboardID)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void Buffer::Cut(int8_t clipboardID)
|
position_ts Buffer::Cut(int8_t clipboardID)
|
||||||
{
|
{
|
||||||
// nothing to do
|
position_ts tmp = {0,0};
|
||||||
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -333,33 +356,98 @@ void Buffer::Cut(int8_t clipboardID)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void Buffer::Paste(int8_t clipboardID)
|
position_ts Buffer::Paste(int8_t clipboardID)
|
||||||
{
|
{
|
||||||
// nothing to do
|
position_ts tmp = {0,0};
|
||||||
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Buffer::RemoveLine(void)
|
position_ts Buffer::RemoveLine(void)
|
||||||
{
|
{
|
||||||
// nothing to do
|
position_ts tmp = {0,0};
|
||||||
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Buffer::SelectAll(void)
|
position_ts Buffer::SelectAll(void)
|
||||||
{
|
{
|
||||||
// nothing to do
|
position_ts tmp = {0,0};
|
||||||
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Buffer::SelectNone(void)
|
position_ts Buffer::SelectNone(void)
|
||||||
{
|
{
|
||||||
// nothing to do
|
position_ts tmp = {0,0};
|
||||||
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Buffer::Undo(void)
|
position_ts Buffer::Undo(void)
|
||||||
{
|
{
|
||||||
// nothing to do
|
position_ts tmp = {0,0};
|
||||||
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Buffer::Redo(void)
|
position_ts Buffer::Redo(void)
|
||||||
{
|
{
|
||||||
// nothing to do
|
position_ts tmp = {0,0};
|
||||||
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Buffer::AnchorAdd(int32_t anchorID)
|
||||||
|
{
|
||||||
|
int32_t localID = AnchorRealId(anchorID);
|
||||||
|
if (localID >=0) {
|
||||||
|
EDN_ERROR("AnchorID="<< anchorID << " already exist !!!");
|
||||||
|
} else {
|
||||||
|
bufferAnchorReference_ts tmpAnchor = m_AnchorList[0];
|
||||||
|
tmpAnchor.m_idAnchor = anchorID;
|
||||||
|
m_AnchorList.PushBack(tmpAnchor);
|
||||||
|
EDN_DEBUG("AnchorID="<< anchorID << " ==> Added");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Buffer::AnchorRm(int32_t anchorID)
|
||||||
|
{
|
||||||
|
if (anchorID == -1) {
|
||||||
|
EDN_ERROR("AnchorID="<< anchorID << " Can not remove this one !!!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int32_t localID = AnchorRealId(anchorID);
|
||||||
|
if (localID >=0) {
|
||||||
|
if (m_AnchorList.Size() == 2) {
|
||||||
|
m_AnchorList[0] = m_AnchorList[1];
|
||||||
|
}
|
||||||
|
m_AnchorList.Erase(localID);
|
||||||
|
EDN_DEBUG("AnchorID="<< anchorID << " ==> Remove");
|
||||||
|
} else {
|
||||||
|
EDN_ERROR("AnchorID="<< anchorID << " does not exist !!!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Buffer::AnchorGet(int32_t anchorID, bufferAnchor_ts & anchor, position_ts &size, int32_t sizePixelX, int32_t sizePixelY)
|
||||||
|
{
|
||||||
|
EDN_ERROR("AnchorID="<< anchorID << " Main buffer ==> can not manage Anchor (type buffer specific)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Buffer::AnchorNext(bufferAnchor_ts & anchor)
|
||||||
|
{
|
||||||
|
EDN_ERROR("AnchorID=?? Main buffer ==> can not manage Anchor (type buffer specific)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int32_t Buffer::AnchorRealId(int32_t anchorID)
|
||||||
|
{
|
||||||
|
//EDN_DEBUG("Get real ID : " << anchorID << " in the anchor list size()=" << m_AnchorList.Size());
|
||||||
|
for(int32_t iii=0; iii < m_AnchorList.Size(); iii++) {
|
||||||
|
//EDN_DEBUG("check if equal : " << m_AnchorList[iii].m_idAnchor << " id=" << iii);
|
||||||
|
if (m_AnchorList[iii].m_idAnchor == anchorID) {
|
||||||
|
return iii;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
@ -30,16 +30,34 @@
|
|||||||
#include "Display.h"
|
#include "Display.h"
|
||||||
#include "charset.h"
|
#include "charset.h"
|
||||||
#include "Edn.h"
|
#include "Edn.h"
|
||||||
#include "BufferAnchor.h"
|
//#include "BufferAnchor.h"
|
||||||
|
|
||||||
typedef struct{
|
extern "C"
|
||||||
uint32_t nbTotalLine; //!< Number of line in the buffer
|
{
|
||||||
uint32_t nbTotalColomn; //!< Number of line in the buffer
|
typedef struct{
|
||||||
uint32_t startLineDisplay; //!< First line display.
|
uint32_t nbTotalLine; //!< Number of line in the buffer
|
||||||
uint32_t startColomnDisplay; //!< First Colomn displayed
|
uint32_t nbTotalColomn; //!< Number of line in the buffer
|
||||||
uint32_t diplayableColomn; //!< NB colomn that can be displayed
|
uint32_t startLineDisplay; //!< First line display.
|
||||||
uint32_t diplayableLine; //!< NB Line that can be displayed
|
uint32_t startColomnDisplay; //!< First Colomn displayed
|
||||||
}infoStatBuffer_ts;
|
uint32_t diplayableColomn; //!< NB colomn that can be displayed
|
||||||
|
uint32_t diplayableLine; //!< NB Line that can be displayed
|
||||||
|
}infoStatBuffer_ts;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int32_t m_idAnchor;
|
||||||
|
int32_t m_lineId;
|
||||||
|
int32_t m_bufferPos;
|
||||||
|
} bufferAnchorReference_ts;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int32_t m_lineNumber;
|
||||||
|
int32_t m_nbIterationMax;
|
||||||
|
int32_t m_posStart;
|
||||||
|
int32_t m_posStop;
|
||||||
|
int32_t m_selectionPosStart;
|
||||||
|
int32_t m_selectionPosStop;
|
||||||
|
} bufferAnchor_ts;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class Buffer {
|
class Buffer {
|
||||||
@ -81,30 +99,33 @@ class Buffer {
|
|||||||
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate);
|
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate);
|
||||||
virtual void SetLineDisplay(uint32_t lineNumber);
|
virtual void SetLineDisplay(uint32_t lineNumber);
|
||||||
|
|
||||||
virtual int32_t Display(DrawerManager &drawer);
|
virtual void DrawLine(DrawerManager &drawer, bufferAnchor_ts &anchor, position_ts &displayStart, position_ts &displaySize);
|
||||||
virtual void AddChar(char * UTF8data);
|
// return the new cursor position ...
|
||||||
virtual void cursorMove(int32_t gtkKey);
|
virtual position_ts AddChar(char * UTF8data);
|
||||||
virtual void MouseSelectFromCursorTo(int32_t width, int32_t height);
|
virtual position_ts cursorMove(int32_t gtkKey);
|
||||||
virtual void MouseEvent(int32_t width, int32_t height);
|
virtual position_ts MouseSelectFromCursorTo(int32_t width, int32_t height);
|
||||||
virtual void MouseEventDouble(void);
|
virtual position_ts MouseEvent(int32_t width, int32_t height);
|
||||||
virtual void MouseEventTriple(void);
|
virtual position_ts MouseEventDouble(void);
|
||||||
virtual void ScrollDown(void);
|
virtual position_ts MouseEventTriple(void);
|
||||||
virtual void ScrollUp(void);
|
virtual position_ts RemoveLine(void);
|
||||||
virtual void RemoveLine(void);
|
virtual position_ts SelectAll(void);
|
||||||
virtual void SelectAll(void);
|
virtual position_ts SelectNone(void);
|
||||||
virtual void SelectNone(void);
|
virtual position_ts Undo(void);
|
||||||
virtual void Undo(void);
|
virtual position_ts Redo(void);
|
||||||
virtual void Redo(void);
|
|
||||||
virtual void SetCharset(charset_te newCharset) {};
|
virtual void SetCharset(charset_te newCharset) {};
|
||||||
|
|
||||||
|
virtual void ScrollDown(void); // must be deprecated
|
||||||
|
virtual void ScrollUp(void); // must be deprecated
|
||||||
|
|
||||||
//virtual void SelectAll(void);
|
//virtual void SelectAll(void);
|
||||||
virtual void Copy(int8_t clipboardID);
|
virtual void Copy(int8_t clipboardID);
|
||||||
virtual void Cut(int8_t clipboardID);
|
virtual position_ts Cut(int8_t clipboardID);
|
||||||
virtual void Paste(int8_t clipboardID);
|
virtual position_ts Paste(int8_t clipboardID);
|
||||||
virtual void Search(Edn::String &data, bool back, bool caseSensitive, bool wrap, bool regExp);
|
virtual position_ts Search(Edn::String &data, bool back, bool caseSensitive, bool wrap, bool regExp);
|
||||||
virtual void Replace(Edn::String &data);
|
virtual position_ts 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 position_ts JumpAtLine(int32_t newLine);
|
||||||
virtual int32_t GetCurrentLine(void);
|
virtual int32_t GetCurrentLine(void);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -112,6 +133,18 @@ class Buffer {
|
|||||||
// naming
|
// naming
|
||||||
Edn::File m_fileName; //!< filename of the curent buffer
|
Edn::File m_fileName; //!< filename of the curent buffer
|
||||||
bool m_haveName; //!< to know if the file have a name or NOT
|
bool m_haveName; //!< to know if the file have a name or NOT
|
||||||
|
|
||||||
|
// anchor section
|
||||||
|
public:
|
||||||
|
void AnchorAdd(int32_t anchorID);
|
||||||
|
void AnchorRm(int32_t anchorID);
|
||||||
|
virtual bool AnchorGet(int32_t anchorID, bufferAnchor_ts & anchor, position_ts &size, int32_t sizePixelX, int32_t sizePixelY);
|
||||||
|
virtual bool AnchorNext(bufferAnchor_ts & anchor);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int32_t AnchorRealId(int32_t anchorID);
|
||||||
|
Edn::VectorType<bufferAnchorReference_ts> m_AnchorList; //!< list of all line anchor in the current buffer
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,8 +38,8 @@ class BufferAnchor
|
|||||||
~BufferAnchor(void);
|
~BufferAnchor(void);
|
||||||
MoveAnchor(int32_t offsetLine);
|
MoveAnchor(int32_t offsetLine);
|
||||||
//BufModification(...);
|
//BufModification(...);
|
||||||
DisplayUpdateFirstLine(void);
|
bool DisplayUpdateFirstLine(void);
|
||||||
DisplayUpdateNextLine(void);
|
bool DisplayUpdateNextLine(void);
|
||||||
private :
|
private :
|
||||||
int32_t m_lineId;
|
int32_t m_lineId;
|
||||||
int32_t m_bufferPos;
|
int32_t m_bufferPos;
|
||||||
|
@ -67,32 +67,56 @@ BufferEmpty::~BufferEmpty(void)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int32_t BufferEmpty::Display(DrawerManager &drawer)
|
void BufferEmpty::DrawLine(DrawerManager &drawer, bufferAnchor_ts &anchor, position_ts &displayStart, position_ts &displaySize)
|
||||||
{
|
{
|
||||||
|
EDN_DEBUG("Request draw : " << anchor.m_lineNumber);
|
||||||
ColorizeManager * myColorManager = ColorizeManager::getInstance();
|
ColorizeManager * myColorManager = ColorizeManager::getInstance();
|
||||||
// Get color :
|
// Get color :
|
||||||
Colorize *myColor = NULL;
|
Colorize *myColor = NULL;
|
||||||
// Clean Buffer
|
if (anchor.m_lineNumber == 0) {
|
||||||
drawer.Clean(myColorManager->Get(COLOR_CODE_BASIC_BG) );
|
// Clean Buffer
|
||||||
|
drawer.Clean(myColorManager->Get(COLOR_CODE_BASIC_BG) );
|
||||||
myColor = myColorManager->Get("normal");
|
myColor = myColorManager->Get("normal");
|
||||||
// Draw the 2 comments Lines :
|
drawer.Text(myColor, 20,20, "edn - Editeur De N'ours, l'Editeur Desoxyribo-Nucleique");
|
||||||
drawer.Text(myColor, 20,20, "edn - Editeur De N'ours, l'Editeur Desoxyribo-Nucleique");
|
}
|
||||||
//drawer.Flush();
|
if (anchor.m_lineNumber == 1) {
|
||||||
myColor = myColorManager->Get("commentDoxygen");
|
myColor = myColorManager->Get("commentDoxygen");
|
||||||
drawer.Text(myColor, 20,25 + Display::GetFontHeight(), "No Buffer Availlable to display");
|
drawer.Text(myColor, 20,25 + Display::GetFontHeight(), "No Buffer Availlable to display");
|
||||||
drawer.Flush();
|
}
|
||||||
/*
|
return;
|
||||||
myColor = myColorManager->Get(("SelectedText"));
|
|
||||||
drawer.Cursor(20, 50);
|
|
||||||
drawer.EndOfLine(20, 70);
|
|
||||||
drawer.Tabulation(myColor, 20, 90, 5);
|
|
||||||
drawer.UTF8UnknownElement(myColor, 20, 120, 3, false);
|
|
||||||
drawer.Flush();
|
|
||||||
*/
|
|
||||||
return ERR_NONE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool BufferEmpty::AnchorGet(int32_t anchorID, bufferAnchor_ts & anchor, position_ts &size, int32_t sizePixelX, int32_t sizePixelY)
|
||||||
|
{
|
||||||
|
int32_t localID = AnchorRealId(anchorID);
|
||||||
|
if (localID >=0) {
|
||||||
|
EDN_DEBUG("Request anchor");
|
||||||
|
size.x = sizePixelX / Display::GetFontWidth();
|
||||||
|
size.y = sizePixelY / Display::GetFontHeight();
|
||||||
|
anchor.m_nbIterationMax = 2;
|
||||||
|
anchor.m_lineNumber = m_AnchorList[localID].m_lineId;
|
||||||
|
anchor.m_posStart = -1;
|
||||||
|
anchor.m_posStop = -1;
|
||||||
|
anchor.m_selectionPosStart = -1;
|
||||||
|
anchor.m_selectionPosStop = -1;
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool BufferEmpty::AnchorNext(bufferAnchor_ts & anchor)
|
||||||
|
{
|
||||||
|
anchor.m_lineNumber++;
|
||||||
|
EDN_DEBUG("Anchor Next : " << anchor.m_lineNumber);
|
||||||
|
anchor.m_nbIterationMax--;
|
||||||
|
if (anchor.m_nbIterationMax<=0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,9 @@ class BufferEmpty : public Buffer {
|
|||||||
public:
|
public:
|
||||||
BufferEmpty(void);
|
BufferEmpty(void);
|
||||||
virtual ~BufferEmpty(void);
|
virtual ~BufferEmpty(void);
|
||||||
virtual int32_t Display(DrawerManager &drawer);
|
void DrawLine(DrawerManager &drawer, bufferAnchor_ts &anchor, position_ts &displayStart, position_ts &displaySize);
|
||||||
|
bool AnchorGet(int32_t anchorID, bufferAnchor_ts & anchor, position_ts &size, int32_t sizePixelX, int32_t sizePixelY);
|
||||||
|
bool AnchorNext(bufferAnchor_ts & anchor);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -141,7 +141,6 @@ BufferText::BufferText(Edn::File &fileName) : Buffer(fileName)
|
|||||||
SetModify(true);
|
SetModify(true);
|
||||||
}
|
}
|
||||||
UpdateWindowsPosition();
|
UpdateWindowsPosition();
|
||||||
ForceReDraw(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -268,19 +267,11 @@ void BufferText::UpdatePointerNumber(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
void BufferText::DrawLine(DrawerManager &drawer, bufferAnchor_ts &anchor, position_ts &displayStart, position_ts &displaySize)
|
||||||
* @brief Display a single line
|
|
||||||
*
|
|
||||||
* @param[in,out] ---
|
|
||||||
*
|
|
||||||
* @return ---
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void BufferText::DrawLine(DrawerManager &drawer, int32_t lineNumber, int32_t startPos, int32_t endPos, int32_t selStartPos, int32_t selEndPos)
|
|
||||||
{
|
{
|
||||||
int32_t letterHeight = Display::GetFontHeight();
|
int32_t letterHeight = Display::GetFontHeight();
|
||||||
int32_t letterWidth = Display::GetFontWidth();
|
int32_t letterWidth = Display::GetFontWidth();
|
||||||
int32_t positionY = letterHeight * (lineNumber - m_displayStart.y - 1);
|
int32_t positionY = letterHeight * (anchor.m_lineNumber - displayStart.y - 1);
|
||||||
|
|
||||||
int32_t idX = 0;
|
int32_t idX = 0;
|
||||||
int32_t pixelX = m_nbColoneForLineNumber*letterWidth + 3;
|
int32_t pixelX = m_nbColoneForLineNumber*letterWidth + 3;
|
||||||
@ -292,18 +283,18 @@ void BufferText::DrawLine(DrawerManager &drawer, int32_t lineNumber, int32_t sta
|
|||||||
|
|
||||||
// Regenerate the colorizing if necessary ...
|
// Regenerate the colorizing if necessary ...
|
||||||
displayHLData_ts myDisplayLocalSyntax;
|
displayHLData_ts myDisplayLocalSyntax;
|
||||||
m_EdnBuf.HightlightGenerateLines(myDisplayLocalSyntax, startPos, 1);
|
m_EdnBuf.HightlightOneLine(myDisplayLocalSyntax, anchor.m_posStart, anchor.m_posStop);
|
||||||
|
|
||||||
// clean the current Line
|
// clean the current Line
|
||||||
drawer.Rectangle(myColorManager->Get(COLOR_CODE_BASIC_BG), 0, positionY, drawer.GetWidth(), letterHeight);
|
drawer.Rectangle(myColorManager->Get(COLOR_CODE_BASIC_BG), 0, positionY, drawer.GetWidth(), letterHeight);
|
||||||
|
|
||||||
DrawLineNumber(drawer, lineNumber);
|
DrawLineNumber(drawer, anchor.m_lineNumber);
|
||||||
|
|
||||||
bool selHave = selStartPos == -1 ? false : true;
|
bool selHave = anchor.m_selectionPosStart == -1 ? false : true;
|
||||||
char displayChar[MAX_EXP_CHAR_LEN];
|
char displayChar[MAX_EXP_CHAR_LEN];
|
||||||
memset(displayChar, 0, sizeof(char)*MAX_EXP_CHAR_LEN);
|
memset(displayChar, 0, sizeof(char)*MAX_EXP_CHAR_LEN);
|
||||||
int32_t iii;
|
int32_t iii;
|
||||||
for (iii=startPos; iii<endPos; ) {
|
for (iii=anchor.m_posStart; iii<anchor.m_posStop; ) {
|
||||||
uint32_t currentChar;
|
uint32_t currentChar;
|
||||||
int32_t savePositionForCursor = iii;
|
int32_t savePositionForCursor = iii;
|
||||||
int32_t displaywidth = m_EdnBuf.GetExpandedChar(iii, idX, displayChar, currentChar);
|
int32_t displaywidth = m_EdnBuf.GetExpandedChar(iii, idX, displayChar, currentChar);
|
||||||
@ -312,13 +303,13 @@ void BufferText::DrawLine(DrawerManager &drawer, int32_t lineNumber, int32_t sta
|
|||||||
int32_t widthToDisplay;
|
int32_t widthToDisplay;
|
||||||
char * tmpDisplayOfset;
|
char * tmpDisplayOfset;
|
||||||
bool inTheScreen = true;
|
bool inTheScreen = true;
|
||||||
if (m_displayStart.x <= idX) {
|
if (displayStart.x <= idX) {
|
||||||
// Normal display
|
// Normal display
|
||||||
tmpDisplayOfset = displayChar;
|
tmpDisplayOfset = displayChar;
|
||||||
widthToDisplay = displaywidth;
|
widthToDisplay = displaywidth;
|
||||||
} else if (m_displayStart.x < idX + displaywidth) {
|
} else if (displayStart.x < idX + displaywidth) {
|
||||||
// special case of partial display :
|
// special case of partial display :
|
||||||
widthToDisplay = idX + displaywidth - m_displayStart.x;
|
widthToDisplay = idX + displaywidth - displayStart.x;
|
||||||
tmpDisplayOfset = displayChar + (displaywidth-widthToDisplay);
|
tmpDisplayOfset = displayChar + (displaywidth-widthToDisplay);
|
||||||
} else {
|
} else {
|
||||||
// Out of range ...
|
// Out of range ...
|
||||||
@ -340,8 +331,8 @@ void BufferText::DrawLine(DrawerManager &drawer, int32_t lineNumber, int32_t sta
|
|||||||
//selectColor = myColorSelected;
|
//selectColor = myColorSelected;
|
||||||
//SpaceText(color_ts & SelectColor, int32_t x, int32_t y,int32_t nbChar)
|
//SpaceText(color_ts & SelectColor, int32_t x, int32_t y,int32_t nbChar)
|
||||||
if( true == selHave
|
if( true == selHave
|
||||||
&& selStartPos <= iii
|
&& anchor.m_selectionPosStart <= iii
|
||||||
&& selEndPos > iii)
|
&& anchor.m_selectionPosStop > iii)
|
||||||
{
|
{
|
||||||
drawer.SpaceText(myColorSelected->GetBG(), pixelX ,positionY , 1);
|
drawer.SpaceText(myColorSelected->GetBG(), pixelX ,positionY , 1);
|
||||||
} else if (true == selectColor->HaveBg()) {
|
} else if (true == selectColor->HaveBg()) {
|
||||||
@ -353,8 +344,8 @@ void BufferText::DrawLine(DrawerManager &drawer, int32_t lineNumber, int32_t sta
|
|||||||
&& true == globals::IsSetDisplaySpaceChar() )
|
&& true == globals::IsSetDisplaySpaceChar() )
|
||||||
{
|
{
|
||||||
if( true == selHave
|
if( true == selHave
|
||||||
&& selStartPos <= iii
|
&& anchor.m_selectionPosStart <= iii
|
||||||
&& selEndPos > iii)
|
&& anchor.m_selectionPosStop > iii)
|
||||||
{
|
{
|
||||||
drawer.SpaceText(myColorSelected->GetBG(), pixelX ,positionY , strlen(tmpDisplayOfset));
|
drawer.SpaceText(myColorSelected->GetBG(), pixelX ,positionY , strlen(tmpDisplayOfset));
|
||||||
} else if (true == selectColor->HaveBg()) {
|
} else if (true == selectColor->HaveBg()) {
|
||||||
@ -364,8 +355,8 @@ void BufferText::DrawLine(DrawerManager &drawer, int32_t lineNumber, int32_t sta
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if( true == selHave
|
if( true == selHave
|
||||||
&& selStartPos <= iii
|
&& anchor.m_selectionPosStart <= iii
|
||||||
&& selEndPos > iii)
|
&& anchor.m_selectionPosStop > iii)
|
||||||
{
|
{
|
||||||
selectColor = myColorSelected;
|
selectColor = myColorSelected;
|
||||||
}
|
}
|
||||||
@ -404,67 +395,6 @@ void BufferText::DrawLine(DrawerManager &drawer, int32_t lineNumber, int32_t sta
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Display the curent buffer with all the probematic imposed by the xharset and the user contraint.
|
|
||||||
*
|
|
||||||
* @param[in,out] drawer the basic user drawer of EDN.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
int32_t BufferText::Display(DrawerManager &drawer)
|
|
||||||
{
|
|
||||||
int32_t letterHeight = Display::GetFontHeight();
|
|
||||||
int32_t letterWidth = Display::GetFontWidth();
|
|
||||||
// Update the total of line to display in the buffer
|
|
||||||
UpdatePointerNumber();
|
|
||||||
// update the number of element that can be displayed
|
|
||||||
m_displaySize.x = (drawer.GetWidth()/letterWidth) + 1 - m_nbColoneForLineNumber;
|
|
||||||
m_displaySize.y = (drawer.GetHeight()/letterHeight) + 1;
|
|
||||||
EDN_INFO("main DIPLAY " << m_displaySize.x << " char * " << m_displaySize.y << " char");
|
|
||||||
|
|
||||||
int32_t selStart, selEnd, selRectStart, selRectEnd;
|
|
||||||
bool selIsRect;
|
|
||||||
bool selHave = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, selStart, selEnd, selIsRect, selRectStart, selRectEnd);
|
|
||||||
if (false == selHave){
|
|
||||||
selStart = -1;
|
|
||||||
selEnd = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
//drawer.Clean(myColorManager->Get(COLOR_CODE_BASIC_BG));
|
|
||||||
GTimeVal timeStart;
|
|
||||||
g_get_current_time(&timeStart);
|
|
||||||
|
|
||||||
int32_t lineStartPos=m_displayStartBufferPos;
|
|
||||||
int32_t lineEndPos=-1;
|
|
||||||
int32_t lineIdStart = m_displayStart.y + 1;
|
|
||||||
int32_t lineIdEnd = m_displayStart.y + m_displaySize.y;
|
|
||||||
EDN_DEBUG("lineIdStart=" << lineIdStart << " lineIdEnd=" << lineIdEnd );
|
|
||||||
int32_t iii;
|
|
||||||
for (iii=lineIdStart; iii<lineIdEnd+1 ; iii++) {
|
|
||||||
lineEndPos = m_EdnBuf.EndOfLine(lineStartPos);
|
|
||||||
DrawLine(drawer, iii, lineStartPos, lineEndPos, selStart+1, selEnd+1);
|
|
||||||
lineStartPos = lineEndPos+1;
|
|
||||||
if (lineStartPos >= m_EdnBuf.Size()+1) {
|
|
||||||
iii++;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
drawer.Flush();
|
|
||||||
// Need to clean the end of windows (sometimes)...
|
|
||||||
if (iii<lineIdEnd+1) {
|
|
||||||
int32_t positionY = letterHeight * (iii - m_displayStart.y - 1);
|
|
||||||
drawer.Rectangle(myColorManager->Get(COLOR_CODE_BASIC_BG), 0, positionY, drawer.GetWidth(), letterHeight*(lineIdEnd+1-iii) );
|
|
||||||
}
|
|
||||||
GTimeVal timeStop;
|
|
||||||
g_get_current_time(&timeStop);
|
|
||||||
EDN_DEBUG("Display Generation = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s ==> " << (timeStop.tv_usec - timeStart.tv_usec)/1000. << "ms");
|
|
||||||
|
|
||||||
return ERR_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void BufferText::GetMousePosition(int32_t width, int32_t height, int32_t &x, int32_t &y)
|
void BufferText::GetMousePosition(int32_t width, int32_t height, int32_t &x, int32_t &y)
|
||||||
{
|
{
|
||||||
x = (width - 3) / Display::GetFontWidth() - m_nbColoneForLineNumber;
|
x = (width - 3) / Display::GetFontWidth() - m_nbColoneForLineNumber;
|
||||||
@ -508,7 +438,6 @@ void BufferText::MouseEvent(int32_t width, int32_t height)
|
|||||||
}
|
}
|
||||||
m_EdnBuf.Unselect(SELECTION_PRIMARY);
|
m_EdnBuf.Unselect(SELECTION_PRIMARY);
|
||||||
|
|
||||||
ForceReDraw(true);
|
|
||||||
UpdateWindowsPosition();
|
UpdateWindowsPosition();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -558,7 +487,6 @@ void BufferText::MouseSelectFromCursorTo(int32_t width, int32_t height)
|
|||||||
m_EdnBuf.Select(SELECTION_PRIMARY, selStart, m_cursorPos);
|
m_EdnBuf.Select(SELECTION_PRIMARY, selStart, m_cursorPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ForceReDraw(true);
|
|
||||||
UpdateWindowsPosition();
|
UpdateWindowsPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -578,7 +506,6 @@ void BufferText::MouseEventDouble(void)
|
|||||||
if (true == m_EdnBuf.SelectAround(m_cursorPos, beginPos, endPos)) {
|
if (true == m_EdnBuf.SelectAround(m_cursorPos, beginPos, endPos)) {
|
||||||
m_EdnBuf.Select(SELECTION_PRIMARY, beginPos, endPos);
|
m_EdnBuf.Select(SELECTION_PRIMARY, beginPos, endPos);
|
||||||
m_cursorPos = endPos;
|
m_cursorPos = endPos;
|
||||||
ForceReDraw(true);
|
|
||||||
}
|
}
|
||||||
// no else
|
// no else
|
||||||
}
|
}
|
||||||
@ -595,7 +522,6 @@ void BufferText::MouseEventTriple(void)
|
|||||||
{
|
{
|
||||||
m_EdnBuf.Select(SELECTION_PRIMARY, m_EdnBuf.StartOfLine(m_cursorPos), m_EdnBuf.EndOfLine(m_cursorPos));
|
m_EdnBuf.Select(SELECTION_PRIMARY, m_EdnBuf.StartOfLine(m_cursorPos), m_EdnBuf.EndOfLine(m_cursorPos));
|
||||||
m_cursorPos = m_EdnBuf.EndOfLine(m_cursorPos);
|
m_cursorPos = m_EdnBuf.EndOfLine(m_cursorPos);
|
||||||
ForceReDraw(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BufferText::RemoveLine(void)
|
void BufferText::RemoveLine(void)
|
||||||
@ -611,13 +537,11 @@ void BufferText::SelectAll(void)
|
|||||||
{
|
{
|
||||||
m_EdnBuf.Select(SELECTION_PRIMARY, 0, m_EdnBuf.Size());
|
m_EdnBuf.Select(SELECTION_PRIMARY, 0, m_EdnBuf.Size());
|
||||||
m_cursorPos = m_EdnBuf.Size();
|
m_cursorPos = m_EdnBuf.Size();
|
||||||
ForceReDraw(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BufferText::SelectNone(void)
|
void BufferText::SelectNone(void)
|
||||||
{
|
{
|
||||||
m_EdnBuf.Unselect(SELECTION_PRIMARY);
|
m_EdnBuf.Unselect(SELECTION_PRIMARY);
|
||||||
ForceReDraw(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -922,11 +846,9 @@ void BufferText::UpdateWindowsPosition(bool centerPage)
|
|||||||
m_displayStart.y = cursorPosition.y - globals::getNbLineBorder();
|
m_displayStart.y = cursorPosition.y - globals::getNbLineBorder();
|
||||||
if (m_displayStart.y < 0) {
|
if (m_displayStart.y < 0) {
|
||||||
m_displayStart.y = 0;
|
m_displayStart.y = 0;
|
||||||
ForceReDraw(true);
|
|
||||||
}
|
}
|
||||||
} else if (m_displayStart.y + m_displaySize.y <= (int32_t)cursorPosition.y + globals::getNbLineBorder() ) {
|
} else if (m_displayStart.y + m_displaySize.y <= (int32_t)cursorPosition.y + globals::getNbLineBorder() ) {
|
||||||
m_displayStart.y = cursorPosition.y - m_displaySize.y + globals::getNbLineBorder() + 1;
|
m_displayStart.y = cursorPosition.y - m_displaySize.y + globals::getNbLineBorder() + 1;
|
||||||
ForceReDraw(true);
|
|
||||||
}
|
}
|
||||||
// Display position (X mode):
|
// Display position (X mode):
|
||||||
//EDN_INFO("cursorPosition X : " << cursorPosition.y << " windows " << m_displayStart.y << "=>" << m_displayStart.x + m_displaySize.x);
|
//EDN_INFO("cursorPosition X : " << cursorPosition.y << " windows " << m_displayStart.y << "=>" << m_displayStart.x + m_displaySize.x);
|
||||||
@ -934,11 +856,9 @@ void BufferText::UpdateWindowsPosition(bool centerPage)
|
|||||||
m_displayStart.x = cursorPosition.x - globals::getNbColoneBorder();
|
m_displayStart.x = cursorPosition.x - globals::getNbColoneBorder();
|
||||||
if (m_displayStart.x < 0) {
|
if (m_displayStart.x < 0) {
|
||||||
m_displayStart.x = 0;
|
m_displayStart.x = 0;
|
||||||
ForceReDraw(true);
|
|
||||||
}
|
}
|
||||||
} else if (m_displayStart.x + m_displaySize.x <= cursorPosition.x + globals::getNbColoneBorder() ) {
|
} else if (m_displayStart.x + m_displaySize.x <= cursorPosition.x + globals::getNbColoneBorder() ) {
|
||||||
m_displayStart.x = cursorPosition.x - m_displaySize.x + globals::getNbColoneBorder() + 1;
|
m_displayStart.x = cursorPosition.x - m_displaySize.x + globals::getNbColoneBorder() + 1;
|
||||||
ForceReDraw(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//update the buffer position ID :
|
//update the buffer position ID :
|
||||||
@ -957,7 +877,6 @@ void BufferText::UpdateWindowsPosition(bool centerPage)
|
|||||||
m_displayStart.y = edn_max(m_displayStart.y, 0);
|
m_displayStart.y = edn_max(m_displayStart.y, 0);
|
||||||
|
|
||||||
m_displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, m_displayStart.y);
|
m_displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, m_displayStart.y);
|
||||||
ForceReDraw(true);
|
|
||||||
//EDN_DEBUG(" display start : " << m_displayStart.x << "x" << m_displayStart.y);
|
//EDN_DEBUG(" display start : " << m_displayStart.x << "x" << m_displayStart.y);
|
||||||
//EDN_DEBUG(" -------------------------------------------------");
|
//EDN_DEBUG(" -------------------------------------------------");
|
||||||
}
|
}
|
||||||
@ -972,8 +891,9 @@ void BufferText::UpdateWindowsPosition(bool centerPage)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void BufferText::AddChar(char * UTF8data)
|
position_ts BufferText::AddChar(char * UTF8data)
|
||||||
{
|
{
|
||||||
|
position_ts tmp = {0,0};
|
||||||
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
|
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
|
||||||
bool SelectionIsRect;
|
bool SelectionIsRect;
|
||||||
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
|
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
|
||||||
@ -1117,8 +1037,9 @@ int32_t BufferText::FindLine(Edn::String &data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BufferText::JumpAtLine(int32_t newLine)
|
position_ts BufferText::JumpAtLine(int32_t newLine)
|
||||||
{
|
{
|
||||||
|
position_ts tmp = {0,0};
|
||||||
int32_t positionLine = m_EdnBuf.CountForwardNLines(0, newLine);
|
int32_t positionLine = m_EdnBuf.CountForwardNLines(0, newLine);
|
||||||
m_EdnBuf.Unselect(SELECTION_PRIMARY);
|
m_EdnBuf.Unselect(SELECTION_PRIMARY);
|
||||||
EDN_DEBUG("jump at the line : " << newLine );
|
EDN_DEBUG("jump at the line : " << newLine );
|
||||||
@ -1141,8 +1062,9 @@ int32_t BufferText::GetCurrentLine(void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void BufferText::Search(Edn::String &data, bool back, bool caseSensitive, bool wrap, bool regExp)
|
position_ts BufferText::Search(Edn::String &data, bool back, bool caseSensitive, bool wrap, bool regExp)
|
||||||
{
|
{
|
||||||
|
position_ts tmp = {0,0};
|
||||||
EDN_INFO("Search data : \"" << data << "\"");
|
EDN_INFO("Search data : \"" << data << "\"");
|
||||||
|
|
||||||
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
|
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
|
||||||
@ -1229,8 +1151,9 @@ void BufferText::Search(Edn::String &data, bool back, bool caseSensitive, bool w
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BufferText::Replace(Edn::String &data)
|
position_ts BufferText::Replace(Edn::String &data)
|
||||||
{
|
{
|
||||||
|
position_ts tmp = {0,0};
|
||||||
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
|
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
|
||||||
bool SelectionIsRect;
|
bool SelectionIsRect;
|
||||||
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
|
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
|
||||||
@ -1272,8 +1195,9 @@ void BufferText::Copy(int8_t clipboardID)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void BufferText::Cut(int8_t clipboardID)
|
position_ts BufferText::Cut(int8_t clipboardID)
|
||||||
{
|
{
|
||||||
|
position_ts tmp = {0,0};
|
||||||
|
|
||||||
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
|
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
|
||||||
bool SelectionIsRect;
|
bool SelectionIsRect;
|
||||||
@ -1288,7 +1212,6 @@ void BufferText::Cut(int8_t clipboardID)
|
|||||||
m_cursorPos = SelectionStart;
|
m_cursorPos = SelectionStart;
|
||||||
}
|
}
|
||||||
UpdateWindowsPosition();
|
UpdateWindowsPosition();
|
||||||
ForceReDraw(true);
|
|
||||||
SetModify(true);
|
SetModify(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1301,8 +1224,9 @@ void BufferText::Cut(int8_t clipboardID)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void BufferText::Paste(int8_t clipboardID)
|
position_ts BufferText::Paste(int8_t clipboardID)
|
||||||
{
|
{
|
||||||
|
position_ts tmp = {0,0};
|
||||||
Edn::VectorType<int8_t> mVect;
|
Edn::VectorType<int8_t> mVect;
|
||||||
// copy data from the click board :
|
// copy data from the click board :
|
||||||
ClipBoard::Get(clipboardID, mVect);
|
ClipBoard::Get(clipboardID, mVect);
|
||||||
@ -1322,29 +1246,28 @@ void BufferText::Paste(int8_t clipboardID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateWindowsPosition();
|
UpdateWindowsPosition();
|
||||||
ForceReDraw(true);
|
|
||||||
SetModify(true);
|
SetModify(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BufferText::Undo(void)
|
position_ts BufferText::Undo(void)
|
||||||
{
|
{
|
||||||
|
position_ts tmp = {0,0};
|
||||||
int32_t newPos = m_EdnBuf.Undo();
|
int32_t newPos = m_EdnBuf.Undo();
|
||||||
if (newPos >= 0) {
|
if (newPos >= 0) {
|
||||||
SetInsertPosition(newPos, true);
|
SetInsertPosition(newPos, true);
|
||||||
UpdateWindowsPosition();
|
UpdateWindowsPosition();
|
||||||
ForceReDraw(true);
|
|
||||||
SetModify(true);
|
SetModify(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BufferText::Redo(void)
|
position_ts BufferText::Redo(void)
|
||||||
{
|
{
|
||||||
|
position_ts tmp = {0,0};
|
||||||
int32_t newPos = m_EdnBuf.Redo();
|
int32_t newPos = m_EdnBuf.Redo();
|
||||||
if (newPos >= 0) {
|
if (newPos >= 0) {
|
||||||
SetInsertPosition(newPos, true);
|
SetInsertPosition(newPos, true);
|
||||||
UpdateWindowsPosition();
|
UpdateWindowsPosition();
|
||||||
ForceReDraw(true);
|
|
||||||
SetModify(true);
|
SetModify(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1353,6 +1276,51 @@ void BufferText::Redo(void)
|
|||||||
void BufferText::SetCharset(charset_te newCharset)
|
void BufferText::SetCharset(charset_te newCharset)
|
||||||
{
|
{
|
||||||
m_EdnBuf.SetCharsetType(newCharset);
|
m_EdnBuf.SetCharsetType(newCharset);
|
||||||
ForceReDraw(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool BufferText::AnchorGet(int32_t anchorID, bufferAnchor_ts & anchor, position_ts &size, int32_t sizePixelX, int32_t sizePixelY)
|
||||||
|
{
|
||||||
|
int32_t localID = AnchorRealId(anchorID);
|
||||||
|
if (localID >=0) {
|
||||||
|
// update internal sise of the width of lineID
|
||||||
|
UpdatePointerNumber();
|
||||||
|
// Updata uper size of display
|
||||||
|
size.x = sizePixelX / Display::GetFontWidth();
|
||||||
|
size.y = sizePixelY / Display::GetFontHeight();
|
||||||
|
anchor.m_nbIterationMax = size.y;
|
||||||
|
// update to buffer position
|
||||||
|
anchor.m_lineNumber = m_AnchorList[localID].m_lineId;
|
||||||
|
anchor.m_posStart = m_AnchorList[localID].m_bufferPos;
|
||||||
|
if (anchor.m_posStart >= m_EdnBuf.Size()+1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
anchor.m_posStop = m_EdnBuf.EndOfLine(anchor.m_posStart);
|
||||||
|
// Update selection current
|
||||||
|
int32_t selStart, selEnd, selRectStart, selRectEnd;
|
||||||
|
bool selIsRect;
|
||||||
|
bool selHave = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, selStart, selEnd, selIsRect, selRectStart, selRectEnd);
|
||||||
|
if (false == selHave){
|
||||||
|
anchor.m_selectionPosStart = -1;
|
||||||
|
anchor.m_selectionPosStop = -1;
|
||||||
|
} else {
|
||||||
|
anchor.m_selectionPosStart = selStart;
|
||||||
|
anchor.m_selectionPosStop = selEnd;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool BufferText::AnchorNext(bufferAnchor_ts & anchor)
|
||||||
|
{
|
||||||
|
anchor.m_lineNumber++;
|
||||||
|
anchor.m_posStart = anchor.m_posStop+1;
|
||||||
|
if (anchor.m_posStart >= m_EdnBuf.Size()+1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
anchor.m_posStop = m_EdnBuf.EndOfLine(anchor.m_posStart);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
@ -39,50 +39,45 @@ typedef enum {
|
|||||||
|
|
||||||
class BufferText : public Buffer {
|
class BufferText : public Buffer {
|
||||||
public:
|
public:
|
||||||
BufferText(void);
|
BufferText(void);
|
||||||
BufferText(Edn::File &fileName);
|
BufferText(Edn::File &fileName);
|
||||||
virtual ~BufferText(void);
|
virtual ~BufferText(void);
|
||||||
void Save(void);
|
void Save(void);
|
||||||
|
|
||||||
void GetInfo(infoStatBuffer_ts &infoToUpdate);
|
void GetInfo(infoStatBuffer_ts &infoToUpdate);
|
||||||
void SetLineDisplay(uint32_t lineNumber);
|
void SetLineDisplay(uint32_t lineNumber);
|
||||||
|
|
||||||
int32_t Display(DrawerManager &drawer);
|
void DrawLine(DrawerManager &drawer, bufferAnchor_ts &anchor, position_ts &displayStart, position_ts &displaySize);
|
||||||
void AddChar(char * UTF8data);
|
position_ts AddChar(char * UTF8data);
|
||||||
void cursorMove(int32_t gtkKey);
|
position_ts cursorMove(int32_t gtkKey);
|
||||||
void MouseSelectFromCursorTo(int32_t width, int32_t height);
|
position_ts MouseSelectFromCursorTo(int32_t width, int32_t height);
|
||||||
void MouseEvent(int32_t width, int32_t height);
|
position_ts MouseEvent(int32_t width, int32_t height);
|
||||||
void MouseEventDouble(void);
|
position_ts MouseEventDouble(void);
|
||||||
void MouseEventTriple(void);
|
position_ts MouseEventTriple(void);
|
||||||
void ScrollDown(void);
|
void ScrollDown(void);
|
||||||
void ScrollUp(void);
|
void ScrollUp(void);
|
||||||
|
|
||||||
void Copy(int8_t clipboardID);
|
void Copy(int8_t clipboardID);
|
||||||
void Cut(int8_t clipboardID);
|
position_ts Cut(int8_t clipboardID);
|
||||||
void Paste(int8_t clipboardID);
|
position_ts Paste(int8_t clipboardID);
|
||||||
|
|
||||||
void Search(Edn::String &data, bool back, bool caseSensitive, bool wrap, bool regExp);
|
position_ts Search(Edn::String &data, bool back, bool caseSensitive, bool wrap, bool regExp);
|
||||||
void Replace(Edn::String &data);
|
position_ts Replace(Edn::String &data);
|
||||||
int32_t FindLine(Edn::String &data);
|
int32_t FindLine(Edn::String &data);
|
||||||
void JumpAtLine(int32_t newLine);
|
position_ts JumpAtLine(int32_t newLine);
|
||||||
int32_t GetCurrentLine(void);
|
int32_t GetCurrentLine(void);
|
||||||
|
|
||||||
void RemoveLine(void);
|
position_ts RemoveLine(void);
|
||||||
void SelectAll(void);
|
position_ts SelectAll(void);
|
||||||
void SelectNone(void);
|
position_ts SelectNone(void);
|
||||||
void Undo(void);
|
position_ts Undo(void);
|
||||||
void Redo(void);
|
position_ts Redo(void);
|
||||||
void SetCharset(charset_te newCharset);
|
void SetCharset(charset_te newCharset);
|
||||||
|
|
||||||
|
bool AnchorGet(int32_t anchorID, bufferAnchor_ts & anchor, position_ts &size, int32_t sizePixelX, int32_t sizePixelY);
|
||||||
|
bool AnchorNext(bufferAnchor_ts & anchor);
|
||||||
protected:
|
protected:
|
||||||
void NameChange(void);
|
void NameChange(void);
|
||||||
|
|
||||||
// anchor section
|
|
||||||
public:
|
|
||||||
void AnchorAdd(int32_t anchorID);
|
|
||||||
void AnchorRm(int32_t anchorID);
|
|
||||||
|
|
||||||
private:
|
|
||||||
Edn::VectorType<BufferAnchor *> m_AnchorList; //!< list of all line anchor in the current buffer
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Display
|
// Display
|
||||||
@ -92,9 +87,9 @@ class BufferText : public Buffer {
|
|||||||
// Direct buffer IO
|
// Direct buffer IO
|
||||||
EdnBuf m_EdnBuf; //!< buffer associated on this displayer
|
EdnBuf m_EdnBuf; //!< buffer associated on this displayer
|
||||||
|
|
||||||
position_ts m_displayStart; //!< position where the display is starting
|
//position_ts m_displayStart; //!< position where the display is starting
|
||||||
position_ts m_displaySize; //!< number of char displayable in the screan
|
//position_ts m_displaySize; //!< number of char displayable in the screan
|
||||||
int32_t m_displayStartBufferPos; //!< position where the buffer start
|
//int32_t m_displayStartBufferPos; //!< position where the buffer start
|
||||||
|
|
||||||
// Cursor :
|
// Cursor :
|
||||||
int32_t m_cursorPos; //!< position in the buffer of the cursor
|
int32_t m_cursorPos; //!< position in the buffer of the cursor
|
||||||
@ -122,8 +117,7 @@ class BufferText : public Buffer {
|
|||||||
void MoveUpDown(int32_t ofset);
|
void MoveUpDown(int32_t ofset);
|
||||||
void DrawLineNumber(DrawerManager &drawer, int32_t lineNumber);
|
void DrawLineNumber(DrawerManager &drawer, int32_t lineNumber);
|
||||||
void UpdatePointerNumber(void);
|
void UpdatePointerNumber(void);
|
||||||
void DrawLine(DrawerManager &drawer, int32_t lineNumber, int32_t startPos, int32_t endPos, int32_t selStartPos, int32_t selEndPos);
|
|
||||||
//void DrawLine(DrawerManager &drawer, int32_t lineNumber, int32_t startPos, int32_t endPos, int32_t selStartPos, int32_t selEndPos);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -38,15 +38,19 @@
|
|||||||
|
|
||||||
CodeView::CodeView(void) : MsgBroadcast("Code View", EDN_CAT_WORK_AREA)
|
CodeView::CodeView(void) : MsgBroadcast("Code View", EDN_CAT_WORK_AREA)
|
||||||
{
|
{
|
||||||
m_bufferID = -1;
|
|
||||||
m_buttunOneSelected = false;
|
|
||||||
m_shawableAreaX = 0;
|
|
||||||
m_shawableAreaY = 0;
|
|
||||||
|
|
||||||
// Init link with the buffer Manager
|
// Init link with the buffer Manager
|
||||||
m_bufferManager = BufferManager::getInstance();
|
m_bufferManager = BufferManager::getInstance();
|
||||||
m_colorManager = ColorizeManager::getInstance();
|
m_colorManager = ColorizeManager::getInstance();
|
||||||
|
|
||||||
|
static int32_t staticIntLocal = 100;
|
||||||
|
m_displayUniqueId = staticIntLocal++;
|
||||||
|
|
||||||
|
m_bufferID = -1;
|
||||||
|
m_bufferManager->Get(m_bufferID)->AnchorAdd(m_displayUniqueId);
|
||||||
|
m_buttunOneSelected = false;
|
||||||
|
m_shawableAreaX = 0;
|
||||||
|
m_shawableAreaY = 0;
|
||||||
|
|
||||||
m_widget = gtk_drawing_area_new();
|
m_widget = gtk_drawing_area_new();
|
||||||
gtk_widget_set_size_request( m_widget, 200, 100);
|
gtk_widget_set_size_request( m_widget, 200, 100);
|
||||||
|
|
||||||
@ -98,7 +102,9 @@ void CodeView::OnMessage(int32_t id, int32_t dataID)
|
|||||||
{
|
{
|
||||||
case EDN_MSG__CURRENT_CHANGE_BUFFER_ID:
|
case EDN_MSG__CURRENT_CHANGE_BUFFER_ID:
|
||||||
//EDN_INFO("Select a new Buffer ... " << dataID);
|
//EDN_INFO("Select a new Buffer ... " << dataID);
|
||||||
|
m_bufferManager->Get(m_bufferID)->AnchorRm(m_displayUniqueId);
|
||||||
m_bufferID = dataID;
|
m_bufferID = dataID;
|
||||||
|
m_bufferManager->Get(m_bufferID)->AnchorAdd(m_displayUniqueId);
|
||||||
// request the dispplay of the curent Editor
|
// request the dispplay of the curent Editor
|
||||||
SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, m_bufferID);
|
SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, m_bufferID);
|
||||||
break;
|
break;
|
||||||
@ -187,6 +193,7 @@ void CodeView::OnMessage(int32_t id, int32_t dataID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//#define COUNT_TIME plop
|
||||||
|
|
||||||
gboolean CodeView::CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data)
|
gboolean CodeView::CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data)
|
||||||
{
|
{
|
||||||
@ -225,14 +232,36 @@ gboolean CodeView::CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpo
|
|||||||
myColorManager = ColorizeManager::getInstance();
|
myColorManager = ColorizeManager::getInstance();
|
||||||
|
|
||||||
DrawerManager monDrawer(widget, self->m_shawableAreaX, self->m_shawableAreaY);
|
DrawerManager monDrawer(widget, self->m_shawableAreaX, self->m_shawableAreaY);
|
||||||
//EDN_INFO("Display buffer ID = " << m_bufferID);
|
Buffer * tmpBuf = self->m_bufferManager->Get(self->m_bufferID);
|
||||||
(void)self->m_bufferManager->Get(self->m_bufferID)->Display(monDrawer);
|
|
||||||
|
#ifdef COUNT_TIME
|
||||||
|
GTimeVal timeStart;
|
||||||
|
g_get_current_time(&timeStart);
|
||||||
|
#endif
|
||||||
|
bufferAnchor_ts anchor;
|
||||||
|
|
||||||
|
bool enableToWrite = tmpBuf->AnchorGet(self->m_displayUniqueId, anchor, self->m_displaySize, self->m_shawableAreaX, self->m_shawableAreaY);
|
||||||
|
while (true == enableToWrite) {
|
||||||
|
tmpBuf->DrawLine(monDrawer, anchor, self->m_displayStart, self->m_displaySize);
|
||||||
|
enableToWrite = tmpBuf->AnchorNext(anchor);
|
||||||
|
}
|
||||||
|
monDrawer.Flush();
|
||||||
|
|
||||||
|
// Need to clean the end of windows (sometimes)...
|
||||||
|
/*
|
||||||
|
if (iii<lineIdEnd+1) {
|
||||||
|
int32_t positionY = letterHeight * (iii - m_displayStart.y - 1);
|
||||||
|
drawer.Rectangle(myColorManager->Get(COLOR_CODE_BASIC_BG), 0, positionY, drawer.GetWidth(), letterHeight*(lineIdEnd+1-iii) );
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
#ifdef COUNT_TIME
|
||||||
|
GTimeVal timeStop;
|
||||||
|
g_get_current_time(&timeStop);
|
||||||
|
EDN_DEBUG("Display Generation = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s ==> " << (timeStop.tv_usec - timeStart.tv_usec)/1000. << "ms");
|
||||||
|
#endif
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// sur : émis lors du premier affichage de la GtkDrawingArea
|
// sur : émis lors du premier affichage de la GtkDrawingArea
|
||||||
gboolean CodeView::CB_displayInit( GtkWidget *widget, gpointer data)
|
gboolean CodeView::CB_displayInit( GtkWidget *widget, gpointer data)
|
||||||
{
|
{
|
||||||
|
@ -54,6 +54,9 @@ class CodeView : public MsgBroadcast
|
|||||||
private:
|
private:
|
||||||
// main windows widget :
|
// main windows widget :
|
||||||
GtkWidget * m_widget;
|
GtkWidget * m_widget;
|
||||||
|
int32_t m_displayUniqueId;
|
||||||
|
position_ts m_displayStart; //!< position where the display is starting
|
||||||
|
position_ts m_displaySize; //!< number of char displayable in the screan
|
||||||
// récupération des proprieter général...
|
// récupération des proprieter général...
|
||||||
BufferManager * m_bufferManager;
|
BufferManager * m_bufferManager;
|
||||||
ColorizeManager * m_colorManager;
|
ColorizeManager * m_colorManager;
|
||||||
|
@ -164,7 +164,8 @@ class EdnBuf {
|
|||||||
void FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t &startId, int32_t &stopId, bool backPreviousNotEnded);
|
void FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t &startId, int32_t &stopId, bool backPreviousNotEnded);
|
||||||
public:
|
public:
|
||||||
void SetHLSystem( Highlight * newHLSystem);
|
void SetHLSystem( Highlight * newHLSystem);
|
||||||
void HightlightGenerateLines(displayHLData_ts & MData, int32_t startPos, int32_t nbLines);
|
void HightlightOneLine(displayHLData_ts & MData, int32_t HLStart, int32_t HLStop);
|
||||||
|
void HightlightGenerateLines(displayHLData_ts & MData, int32_t startPos, int32_t nbLines); // TODO : deprecated ...
|
||||||
colorInformation_ts * GetElementColorAtPosition(displayHLData_ts & MData, int32_t pos);
|
colorInformation_ts * GetElementColorAtPosition(displayHLData_ts & MData, int32_t pos);
|
||||||
private:
|
private:
|
||||||
colorInformation_ts * GetElementColorAtPosition(int32_t pos, int32_t &starPos);
|
colorInformation_ts * GetElementColorAtPosition(int32_t pos, int32_t &starPos);
|
||||||
|
@ -286,6 +286,71 @@ colorInformation_ts *EdnBuf::GetElementColorAtPosition(int32_t pos, int32_t &sta
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//#define COUNT_TIME plop
|
||||||
|
|
||||||
|
void EdnBuf::HightlightOneLine(displayHLData_ts & MData, int32_t HLStart, int32_t HLStop)
|
||||||
|
{
|
||||||
|
MData.posHLPass1 = 0;
|
||||||
|
MData.posHLPass2 = 0;
|
||||||
|
if (NULL == m_Highlight) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#ifdef COUNT_TIME
|
||||||
|
GTimeVal timeStart;
|
||||||
|
g_get_current_time(&timeStart);
|
||||||
|
#endif
|
||||||
|
int32_t startId, stopId;
|
||||||
|
// find element previous
|
||||||
|
FindMainHighLightPosition(HLStart, HLStop, startId, stopId, true);
|
||||||
|
|
||||||
|
int32_t k;
|
||||||
|
//EDN_DEBUG("List of section between : "<< startId << " & " << stopId);
|
||||||
|
int32_t endSearch = stopId+1;
|
||||||
|
if (-1 == stopId) {
|
||||||
|
endSearch = m_HLDataPass1.Size();
|
||||||
|
}
|
||||||
|
for (k=edn_max(startId, 0); k<endSearch; k++) {
|
||||||
|
// empty section :
|
||||||
|
if (0==k) {
|
||||||
|
if (HLStart < m_HLDataPass1[k].beginStart) {
|
||||||
|
//EDN_DEBUG(" ==> (empty section 1 ) k="<<k<<" start="<<HLStart<<" stop="<<m_HLDataPass1[k].beginStart );
|
||||||
|
m_Highlight->Parse2(HLStart,
|
||||||
|
m_HLDataPass1[k].beginStart,
|
||||||
|
MData.HLData,
|
||||||
|
m_data);
|
||||||
|
} // else : nothing to do ...
|
||||||
|
} else {
|
||||||
|
//EDN_DEBUG(" ==> (empty section 2 ) k="<<k<<" start="<<m_HLDataPass1[k-1].endStop<<" stop="<<m_HLDataPass1[k].beginStart );
|
||||||
|
m_Highlight->Parse2(m_HLDataPass1[k-1].endStop,
|
||||||
|
m_HLDataPass1[k].beginStart,
|
||||||
|
MData.HLData,
|
||||||
|
m_data);
|
||||||
|
}
|
||||||
|
// under section :
|
||||||
|
//EDN_DEBUG(" ==> (under section ) k="<<k<<" start="<<m_HLDataPass1[k].beginStart<<" stop="<<m_HLDataPass1[k].endStop << " subSectionOfID=" << 99999999);
|
||||||
|
// TODO : ...
|
||||||
|
}
|
||||||
|
if (endSearch == (int32_t)m_HLDataPass1.Size() ){
|
||||||
|
if (m_HLDataPass1.Size() != 0) {
|
||||||
|
//EDN_DEBUG(" ==> (empty section 3 ) k="<<k<<" start="<<m_HLDataPass1[k-1].endStop<<" stop="<<HLStop );
|
||||||
|
m_Highlight->Parse2(m_HLDataPass1[k-1].endStop,
|
||||||
|
HLStop,
|
||||||
|
MData.HLData,
|
||||||
|
m_data);
|
||||||
|
} else {
|
||||||
|
//EDN_DEBUG(" ==> (empty section 4 ) k="<<k<<" start=0 stop="<<HLStop );
|
||||||
|
m_Highlight->Parse2(0,
|
||||||
|
HLStop,
|
||||||
|
MData.HLData,
|
||||||
|
m_data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#ifdef COUNT_TIME
|
||||||
|
GTimeVal timeStop;
|
||||||
|
g_get_current_time(&timeStop);
|
||||||
|
EDN_DEBUG("Display reAnnalyse = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart, int32_t nbLines)
|
void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart, int32_t nbLines)
|
||||||
@ -296,8 +361,8 @@ void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (MData.idSequence != m_HLDataSequence) {
|
if (MData.idSequence != m_HLDataSequence) {
|
||||||
//GTimeVal timeStart;
|
GTimeVal timeStart;
|
||||||
//g_get_current_time(&timeStart);
|
g_get_current_time(&timeStart);
|
||||||
MData.idSequence = m_HLDataSequence;
|
MData.idSequence = m_HLDataSequence;
|
||||||
HLStart = StartOfLine(HLStart);
|
HLStart = StartOfLine(HLStart);
|
||||||
MData.HLData.Clear();
|
MData.HLData.Clear();
|
||||||
@ -350,11 +415,10 @@ void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//GTimeVal timeStop;
|
GTimeVal timeStop;
|
||||||
//g_get_current_time(&timeStop);
|
g_get_current_time(&timeStop);
|
||||||
//EDN_DEBUG("Display reAnnalyse = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s");
|
EDN_DEBUG("Display reAnnalyse = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user