Compare commits
5 Commits
0.2.2
...
dev-testDi
Author | SHA1 | Date | |
---|---|---|---|
472b85b94b | |||
d21a3892df | |||
eff5e3ae25 | |||
85806b2638 | |||
4477ef0ab5 |
@@ -458,6 +458,21 @@ void Buffer::AnchorRm(int32_t anchorID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Buffer::AnchorRedrawAll(int32_t anchorID)
|
||||||
|
{
|
||||||
|
if (anchorID == -1) {
|
||||||
|
EDN_ERROR("[" << m_uniqueID << "] AnchorID="<< anchorID << " Can not redraw this one !!!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int32_t localID = AnchorRealId(anchorID);
|
||||||
|
if (localID >=0) {
|
||||||
|
AnchorForceRedrawAll(localID);
|
||||||
|
} else {
|
||||||
|
EDN_ERROR("[" << m_uniqueID << "] AnchorID="<< anchorID << " does not exist !!!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Buffer::AnchorGet(int32_t anchorID, bufferAnchor_ts & anchor)
|
bool Buffer::AnchorGet(int32_t anchorID, bufferAnchor_ts & anchor)
|
||||||
{
|
{
|
||||||
EDN_ERROR("[" << m_uniqueID << "] AnchorID="<< anchorID << " Main buffer ==> can not manage Anchor (type buffer specific)");
|
EDN_ERROR("[" << m_uniqueID << "] AnchorID="<< anchorID << " Main buffer ==> can not manage Anchor (type buffer specific)");
|
||||||
@@ -530,6 +545,7 @@ int32_t Buffer::AnchorCurrentId(void)
|
|||||||
|
|
||||||
void Buffer::AnchorForceRedrawAll(int32_t realAnchorId)
|
void Buffer::AnchorForceRedrawAll(int32_t realAnchorId)
|
||||||
{
|
{
|
||||||
|
EDN_DEBUG("AnchorForceRedrawAll(" << realAnchorId << ")");
|
||||||
if (-5000 == realAnchorId) {
|
if (-5000 == realAnchorId) {
|
||||||
int32_t localID = AnchorCurrentId();
|
int32_t localID = AnchorCurrentId();
|
||||||
if (localID >=0) {
|
if (localID >=0) {
|
||||||
@@ -572,51 +588,47 @@ void Buffer::AnchorForceRedrawOffsef(int32_t offset)
|
|||||||
EDN_DEBUG("offset ID=" << localID);
|
EDN_DEBUG("offset ID=" << localID);
|
||||||
m_AnchorList[localID].m_BufferNumberLineOffset += offset;
|
m_AnchorList[localID].m_BufferNumberLineOffset += offset;
|
||||||
|
|
||||||
|
EDN_DEBUG("move redraw request : [" << m_AnchorList[localID].m_displaySize.y << "," << MAX_LINE_DISPLAYABLE_BY_BUFFER << "[=true");
|
||||||
|
for(int32_t iii=m_AnchorList[localID].m_displaySize.y; iii < MAX_LINE_DISPLAYABLE_BY_BUFFER; iii++) {
|
||||||
|
m_AnchorList[localID].m_redrawLine[iii] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t maxSize = edn_min(m_AnchorList[localID].m_displaySize.y, MAX_LINE_DISPLAYABLE_BY_BUFFER);
|
||||||
|
|
||||||
if (offset < 0) {
|
if (offset < 0) {
|
||||||
if (-1 * offset < MAX_LINE_DISPLAYABLE_BY_BUFFER) {
|
if (-1 * offset < maxSize) {
|
||||||
EDN_DEBUG("move redraw request : [" << -1*offset << "," << MAX_LINE_DISPLAYABLE_BY_BUFFER << "[=[" << -1*offset + offset << "," << MAX_LINE_DISPLAYABLE_BY_BUFFER+offset << "[");
|
EDN_DEBUG("move redraw request : ]" << maxSize << "," << -1*offset << "]=]" << maxSize+offset << "," << -1*offset + offset << "]");
|
||||||
//for(int32_t iii=MAX_LINE_DISPLAYABLE_BY_BUFFER; iii >= -1*offset; iii--) {
|
for(int32_t iii=maxSize-1; iii >= -1*offset; iii--) {
|
||||||
for(int32_t iii=-1*offset; iii < MAX_LINE_DISPLAYABLE_BY_BUFFER; iii++) {
|
|
||||||
//EDN_DEBUG("move redraw request : " << iii << " <== " << iii+offset << " val=" << m_AnchorList[localID].m_redrawLine[iii+offset]);
|
|
||||||
m_AnchorList[localID].m_redrawLine[iii] = m_AnchorList[localID].m_redrawLine[iii+offset];
|
m_AnchorList[localID].m_redrawLine[iii] = m_AnchorList[localID].m_redrawLine[iii+offset];
|
||||||
}
|
}
|
||||||
EDN_DEBUG("move redraw request : [" << 0 << "," << -1*offset << "[=true");
|
EDN_DEBUG("move redraw request : [" << 0 << "," << -1*offset << "[=true");
|
||||||
for(int32_t iii=0; iii < -1*offset; iii++) {
|
for(int32_t iii=0; iii < -1*offset; iii++) {
|
||||||
//EDN_DEBUG("move redraw request : " << iii << " <== true");
|
|
||||||
m_AnchorList[localID].m_redrawLine[iii] = true;
|
m_AnchorList[localID].m_redrawLine[iii] = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
EDN_WARNING("FORCE a total redraw... 1");
|
EDN_WARNING("FORCE a total redraw... 1");
|
||||||
for(int32_t iii=0; iii < MAX_LINE_DISPLAYABLE_BY_BUFFER; iii++) {
|
for(int32_t iii=0; iii < maxSize; iii++) {
|
||||||
//EDN_DEBUG("move redraw request : " << iii << " <== true");
|
|
||||||
m_AnchorList[localID].m_redrawLine[iii] = true;
|
m_AnchorList[localID].m_redrawLine[iii] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (offset < MAX_LINE_DISPLAYABLE_BY_BUFFER) {
|
if (offset < maxSize) {
|
||||||
EDN_DEBUG("move redraw request : [" << 0 << "," << MAX_LINE_DISPLAYABLE_BY_BUFFER-offset << "[=[" << offset << "," << MAX_LINE_DISPLAYABLE_BY_BUFFER << "[");
|
EDN_DEBUG("move redraw request : [" << 0 << "," << maxSize-offset << "[=[" << offset << "," << maxSize << "[");
|
||||||
for(int32_t iii=0; iii < MAX_LINE_DISPLAYABLE_BY_BUFFER-offset ; iii++) {
|
for(int32_t iii=0; iii < maxSize-offset ; iii++) {
|
||||||
//EDN_DEBUG("move redraw request : " << iii << " <== " << iii+offset << " val=" << m_AnchorList[localID].m_redrawLine[iii+offset]);
|
|
||||||
m_AnchorList[localID].m_redrawLine[iii] = m_AnchorList[localID].m_redrawLine[iii+offset];
|
m_AnchorList[localID].m_redrawLine[iii] = m_AnchorList[localID].m_redrawLine[iii+offset];
|
||||||
}
|
}
|
||||||
EDN_DEBUG("move redraw request : [" << MAX_LINE_DISPLAYABLE_BY_BUFFER-offset+1 << "," << MAX_LINE_DISPLAYABLE_BY_BUFFER << "[=true");
|
// note the -1 is to force the redisplay of the previous of the last line ==> special case of the gtk 3.0 marker to resize the windows
|
||||||
for(int32_t iii=MAX_LINE_DISPLAYABLE_BY_BUFFER-offset+1; iii < MAX_LINE_DISPLAYABLE_BY_BUFFER; iii++) {
|
EDN_DEBUG("move redraw request : [" << maxSize-offset-1 << "," << maxSize << "[=true");
|
||||||
//EDN_DEBUG("move redraw request : " << iii << " <== true");
|
for(int32_t iii=maxSize-offset-1; iii < maxSize; iii++) {
|
||||||
m_AnchorList[localID].m_redrawLine[iii] = true;
|
m_AnchorList[localID].m_redrawLine[iii] = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
EDN_WARNING("FORCE a total redraw... 2");
|
EDN_WARNING("FORCE a total redraw... 2");
|
||||||
for(int32_t iii=0; iii < MAX_LINE_DISPLAYABLE_BY_BUFFER; iii++) {
|
for(int32_t iii=0; iii < maxSize; iii++) {
|
||||||
//EDN_DEBUG("move redraw request : " << iii << " <== true");
|
|
||||||
m_AnchorList[localID].m_redrawLine[iii] = true;
|
m_AnchorList[localID].m_redrawLine[iii] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EDN_DEBUG("move redraw request : [" << m_AnchorList[localID].m_displaySize.y << "," << MAX_LINE_DISPLAYABLE_BY_BUFFER << "[=true");
|
|
||||||
for(int32_t iii=m_AnchorList[localID].m_displaySize.y; iii < MAX_LINE_DISPLAYABLE_BY_BUFFER; iii++) {
|
|
||||||
//EDN_DEBUG("move redraw request : " << iii << " <== true");
|
|
||||||
m_AnchorList[localID].m_redrawLine[iii] = true;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
EDN_ERROR("can not find the real ID in linste.Size()=" << m_AnchorList.Size());
|
EDN_ERROR("can not find the real ID in linste.Size()=" << m_AnchorList.Size());
|
||||||
}
|
}
|
||||||
|
@@ -149,6 +149,7 @@ class Buffer {
|
|||||||
public:
|
public:
|
||||||
void AnchorAdd(int32_t anchorID);
|
void AnchorAdd(int32_t anchorID);
|
||||||
void AnchorRm(int32_t anchorID);
|
void AnchorRm(int32_t anchorID);
|
||||||
|
void AnchorRedrawAll(int32_t anchorID);
|
||||||
virtual bool AnchorGet(int32_t anchorID, bufferAnchor_ts & anchor);
|
virtual bool AnchorGet(int32_t anchorID, bufferAnchor_ts & anchor);
|
||||||
virtual bool AnchorNext(bufferAnchor_ts & anchor);
|
virtual bool AnchorNext(bufferAnchor_ts & anchor);
|
||||||
void AnchorSetSize(int32_t anchorID, int32_t sizePixelX, int32_t sizePixelY);
|
void AnchorSetSize(int32_t anchorID, int32_t sizePixelX, int32_t sizePixelY);
|
||||||
|
@@ -408,6 +408,10 @@ void BufferText::MouseEvent(int32_t width, int32_t height)
|
|||||||
m_cursorPreferredCol = posX;
|
m_cursorPreferredCol = posX;
|
||||||
}
|
}
|
||||||
m_EdnBuf.Unselect(SELECTION_PRIMARY);
|
m_EdnBuf.Unselect(SELECTION_PRIMARY);
|
||||||
|
/*
|
||||||
|
// for the redraw to permit to remove display error ...
|
||||||
|
AnchorForceRedrawAll();
|
||||||
|
*/
|
||||||
|
|
||||||
UpdateWindowsPosition();
|
UpdateWindowsPosition();
|
||||||
}
|
}
|
||||||
@@ -502,6 +506,8 @@ void BufferText::RemoveLine(void)
|
|||||||
int32_t start = m_EdnBuf.StartOfLine(m_cursorPos);
|
int32_t start = m_EdnBuf.StartOfLine(m_cursorPos);
|
||||||
int32_t stop = m_EdnBuf.EndOfLine(m_cursorPos);
|
int32_t stop = m_EdnBuf.EndOfLine(m_cursorPos);
|
||||||
m_EdnBuf.Remove(start, stop+1);
|
m_EdnBuf.Remove(start, stop+1);
|
||||||
|
// for the redraw to permit to remove display error ...
|
||||||
|
AnchorForceRedrawAll();
|
||||||
SetInsertPosition(start);
|
SetInsertPosition(start);
|
||||||
SetModify(true);
|
SetModify(true);
|
||||||
}
|
}
|
||||||
@@ -517,6 +523,7 @@ void BufferText::SelectAll(void)
|
|||||||
void BufferText::SelectNone(void)
|
void BufferText::SelectNone(void)
|
||||||
{
|
{
|
||||||
m_EdnBuf.Unselect(SELECTION_PRIMARY);
|
m_EdnBuf.Unselect(SELECTION_PRIMARY);
|
||||||
|
// for the redraw to permit to remove display error ...
|
||||||
AnchorForceRedrawAll();
|
AnchorForceRedrawAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -807,24 +814,23 @@ void BufferText::cursorMove(int32_t gtkKey)
|
|||||||
*/
|
*/
|
||||||
void BufferText::UpdateWindowsPosition(bool centerPage)
|
void BufferText::UpdateWindowsPosition(bool centerPage)
|
||||||
{
|
{
|
||||||
int32_t linePreviousID = m_EdnBuf.CountLines(0, m_cursorPosPrevious);
|
int32_t iii = AnchorCurrentId();
|
||||||
AnchorForceRedrawLine(linePreviousID);
|
if (iii >=0) {
|
||||||
|
int32_t linePreviousID = m_EdnBuf.GetLinesIdWithRef(m_cursorPosPrevious, m_AnchorList[iii].m_bufferPos, m_AnchorList[iii].m_lineId);
|
||||||
if (centerPage == false) {
|
AnchorForceRedrawLine(linePreviousID);
|
||||||
// Display position (Y mode):
|
|
||||||
int32_t lineStartPos;
|
|
||||||
// Get current position of cursor :
|
|
||||||
position_ts cursorPosition;
|
|
||||||
cursorPosition.y = m_EdnBuf.CountLines(0, m_cursorPos);
|
|
||||||
AnchorForceRedrawLine(cursorPosition.y);
|
|
||||||
lineStartPos = m_EdnBuf.StartOfLine(m_cursorPos);
|
|
||||||
cursorPosition.x = m_EdnBuf.CountDispChars(lineStartPos, m_cursorPos);
|
|
||||||
//EDN_INFO(" curent cursor position : (" << cursorPosition.x << "," << cursorPosition.y << ")");
|
|
||||||
|
|
||||||
// Done for all Anchor elements ...
|
if (centerPage == false) {
|
||||||
//for (int32_t iii=0; iii < m_AnchorList.Size() ; iii++) {
|
// Display position (Y mode):
|
||||||
int32_t iii = AnchorCurrentId();
|
int32_t lineStartPos;
|
||||||
if (iii >=0) {
|
// Get current position of cursor :
|
||||||
|
position_ts cursorPosition;
|
||||||
|
EDN_WARNING("plop");
|
||||||
|
cursorPosition.y = m_EdnBuf.GetLinesIdWithRef(m_cursorPos, m_AnchorList[iii].m_bufferPos, m_AnchorList[iii].m_lineId);
|
||||||
|
AnchorForceRedrawLine(cursorPosition.y);
|
||||||
|
lineStartPos = m_EdnBuf.StartOfLine(m_cursorPos);
|
||||||
|
cursorPosition.x = m_EdnBuf.CountDispChars(lineStartPos, m_cursorPos);
|
||||||
|
//EDN_INFO(" curent cursor position : (" << cursorPosition.x << "," << cursorPosition.y << ")");
|
||||||
|
|
||||||
position_ts displayPreviousStart = m_AnchorList[iii].m_displayStart;
|
position_ts displayPreviousStart = m_AnchorList[iii].m_displayStart;
|
||||||
//EDN_INFO(" m_displayStart(" << m_AnchorList[iii].m_displayStart.x << "," << m_AnchorList[iii].m_displayStart.y << ") m_displaySize(" << m_AnchorList[iii].m_displaySize.x << "," << m_AnchorList[iii].m_displaySize.y << ")");
|
//EDN_INFO(" m_displayStart(" << m_AnchorList[iii].m_displayStart.x << "," << m_AnchorList[iii].m_displayStart.y << ") m_displaySize(" << m_AnchorList[iii].m_displaySize.x << "," << m_AnchorList[iii].m_displaySize.y << ")");
|
||||||
if (m_AnchorList[iii].m_displayStart.y > (int32_t)cursorPosition.y - globals::getNbLineBorder() ) {
|
if (m_AnchorList[iii].m_displayStart.y > (int32_t)cursorPosition.y - globals::getNbLineBorder() ) {
|
||||||
@@ -853,10 +859,10 @@ void BufferText::UpdateWindowsPosition(bool centerPage)
|
|||||||
AnchorForceRedrawAll(iii);
|
AnchorForceRedrawAll(iii);
|
||||||
} else {
|
} else {
|
||||||
if (m_AnchorList[iii].m_displayStart.y != displayPreviousStart.y) {
|
if (m_AnchorList[iii].m_displayStart.y != displayPreviousStart.y) {
|
||||||
EDN_WARNING("SELECT an ofset : displayPreviousStart.y=" << displayPreviousStart.y << " m_AnchorList[iii].m_displayStart.y=" << m_AnchorList[iii].m_displayStart.y << " ==>" << m_AnchorList[iii].m_displayStart.y - displayPreviousStart.y);
|
//EDN_WARNING("SELECT an ofset : displayPreviousStart.y=" << displayPreviousStart.y << " m_AnchorList[iii].m_displayStart.y=" << m_AnchorList[iii].m_displayStart.y << " ==>" << m_AnchorList[iii].m_displayStart.y - displayPreviousStart.y);
|
||||||
EDN_WARNING("SELECT ... offset = " << m_AnchorList[iii].m_BufferNumberLineOffset);
|
//EDN_WARNING("SELECT ... offset = " << m_AnchorList[iii].m_BufferNumberLineOffset);
|
||||||
AnchorForceRedrawOffsef(m_AnchorList[iii].m_displayStart.y - displayPreviousStart.y);
|
AnchorForceRedrawOffsef(m_AnchorList[iii].m_displayStart.y - displayPreviousStart.y);
|
||||||
EDN_WARNING("SELECT ... offset = " << m_AnchorList[iii].m_BufferNumberLineOffset);
|
//EDN_WARNING("SELECT ... offset = " << m_AnchorList[iii].m_BufferNumberLineOffset);
|
||||||
}
|
}
|
||||||
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
|
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
|
||||||
bool SelectionIsRect;
|
bool SelectionIsRect;
|
||||||
@@ -864,24 +870,20 @@ void BufferText::UpdateWindowsPosition(bool centerPage)
|
|||||||
if (true == haveSelectionActive) {
|
if (true == haveSelectionActive) {
|
||||||
int32_t start = edn_min(linePreviousID, cursorPosition.y);
|
int32_t start = edn_min(linePreviousID, cursorPosition.y);
|
||||||
int32_t stop = edn_max(linePreviousID, cursorPosition.y);
|
int32_t stop = edn_max(linePreviousID, cursorPosition.y);
|
||||||
EDN_WARNING("SELECT force redraw range of lines : (" << start << "," << stop << ")");
|
//EDN_WARNING("SELECT force redraw range of lines : (" << start << "," << stop << ")");
|
||||||
for (int32_t jjj=start; jjj <= stop; jjj++) {
|
for (int32_t jjj=start; jjj <= stop; jjj++) {
|
||||||
AnchorForceRedrawLine(jjj);
|
AnchorForceRedrawLine(jjj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
} else {
|
// center the line at the middle of the screen :
|
||||||
// center the line at the middle of the screen :
|
position_ts cursorPosition;
|
||||||
position_ts cursorPosition;
|
//EDN_DEBUG(" -------------------------------------------------");
|
||||||
//EDN_DEBUG(" -------------------------------------------------");
|
cursorPosition.y = m_EdnBuf.GetLinesIdWithRef(m_cursorPos, m_AnchorList[iii].m_bufferPos, m_AnchorList[iii].m_lineId);
|
||||||
cursorPosition.y = m_EdnBuf.CountLines(0, m_cursorPos);
|
//EDN_DEBUG(" cursor position : " << m_cursorPos << " ==> ligne=" << cursorPosition.y);
|
||||||
//EDN_DEBUG(" cursor position : " << m_cursorPos << " ==> ligne=" << cursorPosition.y);
|
cursorPosition.x = 0;
|
||||||
cursorPosition.x = 0;
|
|
||||||
// Done for all Anchor elements ...
|
|
||||||
//for (int32_t iii=0; iii < m_AnchorList.Size() ; iii++) {
|
|
||||||
int32_t iii = AnchorCurrentId();
|
|
||||||
if (iii >=0) {
|
|
||||||
m_AnchorList[iii].m_displayStart.x = 0;
|
m_AnchorList[iii].m_displayStart.x = 0;
|
||||||
//EDN_DEBUG(" display size : " << m_displaySize.y);
|
//EDN_DEBUG(" display size : " << m_displaySize.y);
|
||||||
m_AnchorList[iii].m_displayStart.y = cursorPosition.y - m_AnchorList[iii].m_displaySize.y/2;
|
m_AnchorList[iii].m_displayStart.y = cursorPosition.y - m_AnchorList[iii].m_displaySize.y/2;
|
||||||
@@ -995,6 +997,7 @@ void BufferText::AddChar(char * UTF8data)
|
|||||||
}
|
}
|
||||||
actionDone = true;
|
actionDone = true;
|
||||||
}
|
}
|
||||||
|
AnchorForceRedrawAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (false == actionDone) {
|
if (false == actionDone) {
|
||||||
@@ -1054,6 +1057,8 @@ void BufferText::JumpAtLine(int32_t newLine)
|
|||||||
{
|
{
|
||||||
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);
|
||||||
|
// for the redraw to permit to remove display error ...
|
||||||
|
AnchorForceRedrawAll();
|
||||||
EDN_DEBUG("jump at the line : " << newLine );
|
EDN_DEBUG("jump at the line : " << newLine );
|
||||||
SetInsertPosition(positionLine);
|
SetInsertPosition(positionLine);
|
||||||
UpdateWindowsPosition(true);
|
UpdateWindowsPosition(true);
|
||||||
@@ -1219,6 +1224,8 @@ void BufferText::Cut(int8_t clipboardID)
|
|||||||
m_EdnBuf.RemoveSelected(SELECTION_PRIMARY);
|
m_EdnBuf.RemoveSelected(SELECTION_PRIMARY);
|
||||||
SetInsertPosition(SelectionStart, true);
|
SetInsertPosition(SelectionStart, true);
|
||||||
}
|
}
|
||||||
|
// for the redraw to permit to remove display error ...
|
||||||
|
AnchorForceRedrawAll();
|
||||||
UpdateWindowsPosition();
|
UpdateWindowsPosition();
|
||||||
SetModify(true);
|
SetModify(true);
|
||||||
}
|
}
|
||||||
@@ -1249,9 +1256,10 @@ void BufferText::Paste(int8_t clipboardID)
|
|||||||
} else {
|
} else {
|
||||||
// insert data
|
// insert data
|
||||||
m_EdnBuf.Insert(m_cursorPos, mVect);
|
m_EdnBuf.Insert(m_cursorPos, mVect);
|
||||||
SetInsertPosition(mVect.Size(), true);
|
SetInsertPosition(m_cursorPos + mVect.Size(), true);
|
||||||
}
|
}
|
||||||
|
// for the redraw to permit to remove display error ...
|
||||||
|
AnchorForceRedrawAll();
|
||||||
UpdateWindowsPosition();
|
UpdateWindowsPosition();
|
||||||
SetModify(true);
|
SetModify(true);
|
||||||
}
|
}
|
||||||
@@ -1265,6 +1273,8 @@ void BufferText::Undo(void)
|
|||||||
UpdateWindowsPosition();
|
UpdateWindowsPosition();
|
||||||
SetModify(true);
|
SetModify(true);
|
||||||
}
|
}
|
||||||
|
// for the redraw to permit to remove display error ...
|
||||||
|
AnchorForceRedrawAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BufferText::Redo(void)
|
void BufferText::Redo(void)
|
||||||
@@ -1275,6 +1285,8 @@ void BufferText::Redo(void)
|
|||||||
UpdateWindowsPosition();
|
UpdateWindowsPosition();
|
||||||
SetModify(true);
|
SetModify(true);
|
||||||
}
|
}
|
||||||
|
// for the redraw to permit to remove display error ...
|
||||||
|
AnchorForceRedrawAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -298,6 +298,12 @@ gint CodeView::CB_focusGet( GtkWidget *widget, GdkEventFocus *event, gpointer da
|
|||||||
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
|
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
|
||||||
# endif
|
# endif
|
||||||
self->SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, self->m_bufferID);
|
self->SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, self->m_bufferID);
|
||||||
|
# ifdef USE_GTK_VERSION_2_0
|
||||||
|
Buffer * tmpBuf = self->m_bufferManager->Get(self->m_bufferID);
|
||||||
|
tmpBuf->AnchorRedrawAll(self->m_displayUniqueId);
|
||||||
|
// Force redraw of the widget
|
||||||
|
gtk_widget_queue_draw_area(self->m_widget, 0, 0, self->m_shawableAreaX, self->m_shawableAreaY);
|
||||||
|
# endif
|
||||||
EDN_INFO("Focus - In");
|
EDN_INFO("Focus - In");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@@ -646,8 +646,22 @@ int32_t EdnBuf::CountLines(int32_t startPos, int32_t endPos)
|
|||||||
EdnVectorBuf::Iterator myPosIt = m_data.Position(startPos);
|
EdnVectorBuf::Iterator myPosIt = m_data.Position(startPos);
|
||||||
int32_t lineCount = 0;
|
int32_t lineCount = 0;
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
GTimeVal timeStart;
|
||||||
|
if (0 == startPos) {
|
||||||
|
g_get_current_time(&timeStart);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
while (myPosIt) {
|
while (myPosIt) {
|
||||||
if (myPosIt.Position() == endPos) {
|
if (myPosIt.Position() == endPos) {
|
||||||
|
#ifndef NDEBUG
|
||||||
|
if (0 == startPos) {
|
||||||
|
GTimeVal timeStop;
|
||||||
|
g_get_current_time(&timeStop);
|
||||||
|
EDN_ERROR("Count line (" << startPos << "," << endPos << ") time = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s ==> " << (timeStop.tv_usec - timeStart.tv_usec)/1000. << "ms");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return lineCount;
|
return lineCount;
|
||||||
}
|
}
|
||||||
if ('\n' == *myPosIt) {
|
if ('\n' == *myPosIt) {
|
||||||
@@ -655,6 +669,76 @@ int32_t EdnBuf::CountLines(int32_t startPos, int32_t endPos)
|
|||||||
}
|
}
|
||||||
myPosIt++;
|
myPosIt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
if (0 == startPos) {
|
||||||
|
GTimeVal timeStop;
|
||||||
|
g_get_current_time(&timeStop);
|
||||||
|
EDN_ERROR("Count line (" << startPos << "," << endPos << ") time = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s ==> " << (timeStop.tv_usec - timeStart.tv_usec)/1000. << "ms");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return lineCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the Id of the line where is positionned the current pos element
|
||||||
|
*
|
||||||
|
* @param[in] pos posithion in the buffer where we need to know the current line
|
||||||
|
* @param[in] refPos reference position
|
||||||
|
* @param[in] refLine reference Line of the position
|
||||||
|
*
|
||||||
|
* @return the current line ID of the pos
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
int32_t EdnBuf::GetLinesIdWithRef(int32_t pos, int32_t refPos, int32_t refLine)
|
||||||
|
{
|
||||||
|
EdnVectorBuf::Iterator myPosIt = m_data.Position(refPos);
|
||||||
|
int32_t lineCount = refLine;
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
GTimeVal timeStart;
|
||||||
|
g_get_current_time(&timeStart);
|
||||||
|
#endif
|
||||||
|
if (pos == refPos) {
|
||||||
|
return refLine;
|
||||||
|
} else if (pos > refPos) {
|
||||||
|
while (myPosIt) {
|
||||||
|
if (myPosIt.Position() == pos) {
|
||||||
|
#ifndef NDEBUG
|
||||||
|
GTimeVal timeStop;
|
||||||
|
g_get_current_time(&timeStop);
|
||||||
|
EDN_DEBUG("Count line " << pos << " with ref(" << refPos << "," << refPos << ") time = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s ==> " << (timeStop.tv_usec - timeStart.tv_usec)/1000. << "ms");
|
||||||
|
#endif
|
||||||
|
return lineCount;
|
||||||
|
}
|
||||||
|
if ('\n' == *myPosIt) {
|
||||||
|
lineCount++;
|
||||||
|
}
|
||||||
|
myPosIt++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
while (myPosIt) {
|
||||||
|
if (myPosIt.Position() == pos) {
|
||||||
|
#ifndef NDEBUG
|
||||||
|
GTimeVal timeStop;
|
||||||
|
g_get_current_time(&timeStop);
|
||||||
|
EDN_DEBUG("Count line " << pos << " with ref(" << refPos << "," << refPos << ") time = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s ==> " << (timeStop.tv_usec - timeStart.tv_usec)/1000. << "ms");
|
||||||
|
#endif
|
||||||
|
return lineCount;
|
||||||
|
}
|
||||||
|
if ('\n' == *myPosIt) {
|
||||||
|
lineCount--;
|
||||||
|
}
|
||||||
|
myPosIt--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#ifndef NDEBUG
|
||||||
|
GTimeVal timeStop;
|
||||||
|
g_get_current_time(&timeStop);
|
||||||
|
EDN_DEBUG("Count line " << pos << " with ref(" << refPos << "," << refPos << ") time = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s ==> " << (timeStop.tv_usec - timeStart.tv_usec)/1000. << "ms");
|
||||||
|
#endif
|
||||||
|
|
||||||
return lineCount;
|
return lineCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -685,12 +769,21 @@ int32_t EdnBuf::CountLines(void)
|
|||||||
EdnVectorBuf::Iterator myPosIt = m_data.Begin();
|
EdnVectorBuf::Iterator myPosIt = m_data.Begin();
|
||||||
int32_t lineCount = 0;
|
int32_t lineCount = 0;
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
GTimeVal timeStart;
|
||||||
|
g_get_current_time(&timeStart);
|
||||||
|
#endif
|
||||||
while(myPosIt) {
|
while(myPosIt) {
|
||||||
if ('\n' == *myPosIt) {
|
if ('\n' == *myPosIt) {
|
||||||
lineCount++;
|
lineCount++;
|
||||||
}
|
}
|
||||||
myPosIt++;
|
myPosIt++;
|
||||||
}
|
}
|
||||||
|
#ifndef NDEBUG
|
||||||
|
GTimeVal timeStop;
|
||||||
|
g_get_current_time(&timeStop);
|
||||||
|
EDN_DEBUG("count total number of line time = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s ==> " << (timeStop.tv_usec - timeStart.tv_usec)/1000. << "ms");
|
||||||
|
#endif
|
||||||
return lineCount;
|
return lineCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -720,6 +813,12 @@ void EdnBuf::CountNumberOfLines(void)
|
|||||||
*/
|
*/
|
||||||
int32_t EdnBuf::CountForwardNLines(int32_t startPos, int32_t nLines)
|
int32_t EdnBuf::CountForwardNLines(int32_t startPos, int32_t nLines)
|
||||||
{
|
{
|
||||||
|
#ifndef NDEBUG
|
||||||
|
GTimeVal timeStart;
|
||||||
|
if (0 == startPos) {
|
||||||
|
g_get_current_time(&timeStart);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (nLines == 0) {
|
if (nLines == 0) {
|
||||||
return startPos;
|
return startPos;
|
||||||
} else if (startPos > m_data.Size() ) {
|
} else if (startPos > m_data.Size() ) {
|
||||||
@@ -739,6 +838,14 @@ int32_t EdnBuf::CountForwardNLines(int32_t startPos, int32_t nLines)
|
|||||||
}
|
}
|
||||||
myPosIt++;
|
myPosIt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
if (0 == startPos) {
|
||||||
|
GTimeVal timeStop;
|
||||||
|
g_get_current_time(&timeStop);
|
||||||
|
EDN_DEBUG("get poiner line (pos=" << startPos << "=>" << nLines << "lines) time = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s ==> " << (timeStop.tv_usec - timeStart.tv_usec)/1000. << "ms");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
//EDN_INFO(" ==> (2) at position=" << myPosIt.Position() );
|
//EDN_INFO(" ==> (2) at position=" << myPosIt.Position() );
|
||||||
return myPosIt.Position();
|
return myPosIt.Position();
|
||||||
}
|
}
|
||||||
|
@@ -105,6 +105,7 @@ class EdnBuf {
|
|||||||
int32_t CharWidth( char c, int32_t indent); // TODO : rework this
|
int32_t CharWidth( char c, int32_t indent); // TODO : rework this
|
||||||
int32_t CountDispChars( int32_t lineStartPos, int32_t targetPos);
|
int32_t CountDispChars( int32_t lineStartPos, int32_t targetPos);
|
||||||
int32_t CountForwardDispChars( int32_t lineStartPos, int32_t nChars);
|
int32_t CountForwardDispChars( int32_t lineStartPos, int32_t nChars);
|
||||||
|
int32_t GetLinesIdWithRef( int32_t pos, int32_t refPos, int32_t refLine);
|
||||||
int32_t CountLines( int32_t startPos, int32_t endPos);
|
int32_t CountLines( int32_t startPos, int32_t endPos);
|
||||||
int32_t CountLines( void);
|
int32_t CountLines( void);
|
||||||
int32_t CountLines( Edn::VectorType<int8_t> &data);
|
int32_t CountLines( Edn::VectorType<int8_t> &data);
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
</rule>
|
</rule>
|
||||||
<rule name="my comment">
|
<rule name="my comment">
|
||||||
<color>comment</color>
|
<color>comment</color>
|
||||||
<start>//</start>
|
<start>(//|@)</start>
|
||||||
<end>\n</end>
|
<end>\n</end>
|
||||||
<EscapeChar>\</EscapeChar>
|
<EscapeChar>\</EscapeChar>
|
||||||
</rule>
|
</rule>
|
||||||
|
Reference in New Issue
Block a user