sys : back to normal compilation and working ok (slow but ok)
This commit is contained in:
parent
03484cc85d
commit
89394d5770
@ -41,6 +41,8 @@
|
|||||||
*/
|
*/
|
||||||
Buffer::Buffer()
|
Buffer::Buffer()
|
||||||
{
|
{
|
||||||
|
static int32_t bufID = 0;
|
||||||
|
m_uniqueID = bufID++;
|
||||||
static int32_t fileBasicID = 0;
|
static int32_t fileBasicID = 0;
|
||||||
m_fileModify = true;
|
m_fileModify = true;
|
||||||
m_haveName = false;
|
m_haveName = false;
|
||||||
@ -50,6 +52,10 @@ Buffer::Buffer()
|
|||||||
m_haveName = false;
|
m_haveName = false;
|
||||||
// Set basic anchor
|
// Set basic anchor
|
||||||
bufferAnchorReference_ts tmpAnchor;
|
bufferAnchorReference_ts tmpAnchor;
|
||||||
|
tmpAnchor.m_displaySize.x = 0;
|
||||||
|
tmpAnchor.m_displaySize.y = 0;
|
||||||
|
tmpAnchor.m_displayStart.x = 0;
|
||||||
|
tmpAnchor.m_curent = true;
|
||||||
tmpAnchor.m_idAnchor = -1;
|
tmpAnchor.m_idAnchor = -1;
|
||||||
tmpAnchor.m_lineId = 0;
|
tmpAnchor.m_lineId = 0;
|
||||||
tmpAnchor.m_bufferPos = 0;
|
tmpAnchor.m_bufferPos = 0;
|
||||||
@ -73,6 +79,10 @@ Buffer::Buffer(Edn::File &newName)
|
|||||||
SetFileName(newName);
|
SetFileName(newName);
|
||||||
// Set basic anchor
|
// Set basic anchor
|
||||||
bufferAnchorReference_ts tmpAnchor;
|
bufferAnchorReference_ts tmpAnchor;
|
||||||
|
tmpAnchor.m_displaySize.x = 0;
|
||||||
|
tmpAnchor.m_displaySize.y = 0;
|
||||||
|
tmpAnchor.m_displayStart.x = 0;
|
||||||
|
tmpAnchor.m_curent = true;
|
||||||
tmpAnchor.m_idAnchor = -1;
|
tmpAnchor.m_idAnchor = -1;
|
||||||
tmpAnchor.m_lineId = 0;
|
tmpAnchor.m_lineId = 0;
|
||||||
tmpAnchor.m_bufferPos = 0;
|
tmpAnchor.m_bufferPos = 0;
|
||||||
@ -384,12 +394,13 @@ void Buffer::AnchorAdd(int32_t anchorID)
|
|||||||
{
|
{
|
||||||
int32_t localID = AnchorRealId(anchorID);
|
int32_t localID = AnchorRealId(anchorID);
|
||||||
if (localID >=0) {
|
if (localID >=0) {
|
||||||
EDN_ERROR("AnchorID="<< anchorID << " already exist !!!");
|
EDN_ERROR("[" << m_uniqueID << "] AnchorID="<< anchorID << " already exist !!!");
|
||||||
} else {
|
} else {
|
||||||
bufferAnchorReference_ts tmpAnchor = m_AnchorList[0];
|
bufferAnchorReference_ts tmpAnchor = m_AnchorList[0];
|
||||||
|
m_AnchorList[0].m_curent = false;
|
||||||
tmpAnchor.m_idAnchor = anchorID;
|
tmpAnchor.m_idAnchor = anchorID;
|
||||||
m_AnchorList.PushBack(tmpAnchor);
|
m_AnchorList.PushBack(tmpAnchor);
|
||||||
EDN_DEBUG("AnchorID="<< anchorID << " ==> Added");
|
EDN_DEBUG("[" << m_uniqueID << "] AnchorID="<< anchorID << " ==> Added");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -397,7 +408,7 @@ void Buffer::AnchorAdd(int32_t anchorID)
|
|||||||
void Buffer::AnchorRm(int32_t anchorID)
|
void Buffer::AnchorRm(int32_t anchorID)
|
||||||
{
|
{
|
||||||
if (anchorID == -1) {
|
if (anchorID == -1) {
|
||||||
EDN_ERROR("AnchorID="<< anchorID << " Can not remove this one !!!");
|
EDN_ERROR("[" << m_uniqueID << "] AnchorID="<< anchorID << " Can not remove this one !!!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int32_t localID = AnchorRealId(anchorID);
|
int32_t localID = AnchorRealId(anchorID);
|
||||||
@ -406,23 +417,23 @@ void Buffer::AnchorRm(int32_t anchorID)
|
|||||||
m_AnchorList[0] = m_AnchorList[1];
|
m_AnchorList[0] = m_AnchorList[1];
|
||||||
}
|
}
|
||||||
m_AnchorList.Erase(localID);
|
m_AnchorList.Erase(localID);
|
||||||
EDN_DEBUG("AnchorID="<< anchorID << " ==> Remove");
|
EDN_DEBUG("[" << m_uniqueID << "] AnchorID="<< anchorID << " ==> Remove");
|
||||||
} else {
|
} else {
|
||||||
EDN_ERROR("AnchorID="<< anchorID << " does not exist !!!");
|
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("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)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Buffer::AnchorNext(bufferAnchor_ts & anchor)
|
bool Buffer::AnchorNext(bufferAnchor_ts & anchor)
|
||||||
{
|
{
|
||||||
EDN_ERROR("AnchorID=?? Main buffer ==> can not manage Anchor (type buffer specific)");
|
EDN_ERROR("[" << m_uniqueID << "] AnchorID=?? Main buffer ==> can not manage Anchor (type buffer specific)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
#include "Display.h"
|
#include "Display.h"
|
||||||
#include "charset.h"
|
#include "charset.h"
|
||||||
#include "Edn.h"
|
#include "Edn.h"
|
||||||
//#include "BufferAnchor.h"
|
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
@ -104,33 +103,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 void DrawLine(DrawerManager &drawer, bufferAnchor_ts &anchor);
|
virtual void DrawLine(DrawerManager &drawer, bufferAnchor_ts &anchor);
|
||||||
// return the new cursor position ...
|
// return the new cursor position ...
|
||||||
virtual void AddChar(char * UTF8data);
|
virtual void AddChar(char * UTF8data);
|
||||||
virtual void cursorMove(int32_t gtkKey);
|
virtual void cursorMove(int32_t gtkKey);
|
||||||
virtual void MouseSelectFromCursorTo(int32_t width, int32_t height);
|
virtual void MouseSelectFromCursorTo(int32_t width, int32_t height);
|
||||||
virtual void MouseEvent(int32_t width, int32_t height);
|
virtual void MouseEvent(int32_t width, int32_t height);
|
||||||
virtual void MouseEventDouble(void);
|
virtual void MouseEventDouble(void);
|
||||||
virtual void MouseEventTriple(void);
|
virtual void MouseEventTriple(void);
|
||||||
virtual void RemoveLine(void);
|
virtual void RemoveLine(void);
|
||||||
virtual void SelectAll(void);
|
virtual void SelectAll(void);
|
||||||
virtual void SelectNone(void);
|
virtual void SelectNone(void);
|
||||||
virtual void Undo(void);
|
virtual void Undo(void);
|
||||||
virtual void 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 ScrollDown(void); // must be deprecated
|
||||||
virtual void ScrollUp(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 void Cut(int8_t clipboardID);
|
||||||
virtual void Paste(int8_t clipboardID);
|
virtual void Paste(int8_t clipboardID);
|
||||||
virtual void Search(Edn::String &data, bool back, bool caseSensitive, bool wrap, bool regExp);
|
virtual void Search(Edn::String &data, bool back, bool caseSensitive, bool wrap, bool regExp);
|
||||||
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);
|
virtual int32_t GetCurrentLine(void);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -153,6 +152,7 @@ class Buffer {
|
|||||||
int32_t m_lineHeight;
|
int32_t m_lineHeight;
|
||||||
int32_t AnchorRealId(int32_t anchorID);
|
int32_t AnchorRealId(int32_t anchorID);
|
||||||
Edn::VectorType<bufferAnchorReference_ts> m_AnchorList; //!< list of all line anchor in the current buffer
|
Edn::VectorType<bufferAnchorReference_ts> m_AnchorList; //!< list of all line anchor in the current buffer
|
||||||
|
int32_t m_uniqueID;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -263,13 +263,10 @@ void BufferText::UpdatePointerNumber(void)
|
|||||||
|
|
||||||
void BufferText::DrawLine(DrawerManager &drawer, bufferAnchor_ts &anchor)
|
void BufferText::DrawLine(DrawerManager &drawer, bufferAnchor_ts &anchor)
|
||||||
{
|
{
|
||||||
// TODO : Avec ca ca ne peux pas marcher...
|
|
||||||
position_ts displayStart;
|
|
||||||
position_ts displaySize;
|
|
||||||
|
|
||||||
int32_t letterHeight = Display::GetFontHeight();
|
int32_t letterHeight = Display::GetFontHeight();
|
||||||
int32_t letterWidth = Display::GetFontWidth();
|
int32_t letterWidth = Display::GetFontWidth();
|
||||||
int32_t positionY = letterHeight * (anchor.m_lineNumber - displayStart.y - 1);
|
int32_t positionY = letterHeight * (anchor.m_lineNumber - anchor.m_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;
|
||||||
@ -301,13 +298,13 @@ void BufferText::DrawLine(DrawerManager &drawer, bufferAnchor_ts &anchor)
|
|||||||
int32_t widthToDisplay;
|
int32_t widthToDisplay;
|
||||||
char * tmpDisplayOfset;
|
char * tmpDisplayOfset;
|
||||||
bool inTheScreen = true;
|
bool inTheScreen = true;
|
||||||
if (displayStart.x <= idX) {
|
if (anchor.m_displayStart.x <= idX) {
|
||||||
// Normal display
|
// Normal display
|
||||||
tmpDisplayOfset = displayChar;
|
tmpDisplayOfset = displayChar;
|
||||||
widthToDisplay = displaywidth;
|
widthToDisplay = displaywidth;
|
||||||
} else if (displayStart.x < idX + displaywidth) {
|
} else if (anchor.m_displayStart.x < idX + displaywidth) {
|
||||||
// special case of partial display :
|
// special case of partial display :
|
||||||
widthToDisplay = idX + displaywidth - displayStart.x;
|
widthToDisplay = idX + displaywidth - anchor.m_displayStart.x;
|
||||||
tmpDisplayOfset = displayChar + (displaywidth-widthToDisplay);
|
tmpDisplayOfset = displayChar + (displaywidth-widthToDisplay);
|
||||||
} else {
|
} else {
|
||||||
// Out of range ...
|
// Out of range ...
|
||||||
@ -581,27 +578,31 @@ void BufferText::ScrollUp(void)
|
|||||||
*/
|
*/
|
||||||
void BufferText::MoveUpDown(int32_t ofset)
|
void BufferText::MoveUpDown(int32_t ofset)
|
||||||
{
|
{
|
||||||
// TODO : REWORK
|
for (int32_t iii=0; iii < m_AnchorList.Size() ; iii++) {
|
||||||
/*
|
if (true == m_AnchorList[iii].m_curent) {
|
||||||
if (ofset >= 0) {
|
if (ofset >= 0) {
|
||||||
int32_t nbLine = m_EdnBuf.NumberOfLines();
|
int32_t nbLine = m_EdnBuf.NumberOfLines();
|
||||||
if (m_displayStart.y+ofset+3 > nbLine) {
|
if (m_AnchorList[iii].m_displayStart.y+ofset+3 > nbLine) {
|
||||||
m_displayStart.y = nbLine-3;
|
m_AnchorList[iii].m_displayStart.y = nbLine-3;
|
||||||
} else {
|
} else {
|
||||||
m_displayStart.y += ofset;
|
m_AnchorList[iii].m_displayStart.y += ofset;
|
||||||
}
|
}
|
||||||
m_displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, m_displayStart.y);
|
m_AnchorList[iii].m_bufferPos = m_EdnBuf.CountForwardNLines(0, m_AnchorList[iii].m_displayStart.y);
|
||||||
} else {
|
m_AnchorList[iii].m_lineId = m_AnchorList[iii].m_displayStart.y;
|
||||||
ofset *= -1;
|
} else {
|
||||||
if (m_displayStart.y < ofset) {
|
ofset *= -1;
|
||||||
m_displayStart.y = 0;
|
if (m_AnchorList[iii].m_displayStart.y < ofset) {
|
||||||
m_displayStartBufferPos = 0;
|
m_AnchorList[iii].m_displayStart.y = 0;
|
||||||
} else {
|
m_AnchorList[iii].m_bufferPos = 0;
|
||||||
m_displayStart.y -= ofset;
|
m_AnchorList[iii].m_lineId = 0;
|
||||||
m_displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, m_displayStart.y);
|
} else {
|
||||||
|
m_AnchorList[iii].m_displayStart.y -= ofset;
|
||||||
|
m_AnchorList[iii].m_bufferPos = m_EdnBuf.CountForwardNLines(0, m_AnchorList[iii].m_displayStart.y);
|
||||||
|
m_AnchorList[iii].m_lineId = m_AnchorList[iii].m_displayStart.y;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -788,7 +789,7 @@ void BufferText::cursorMove(int32_t gtkKey)
|
|||||||
# endif
|
# endif
|
||||||
//EDN_INFO("keyEvent : <PAGE-UP>");
|
//EDN_INFO("keyEvent : <PAGE-UP>");
|
||||||
// TODO : REWORK
|
// TODO : REWORK
|
||||||
//TextDMoveUp(m_displaySize.x);
|
TextDMoveUp(m_AnchorList[1].m_displaySize.x);
|
||||||
break;
|
break;
|
||||||
# ifdef USE_GTK_VERSION_3_0
|
# ifdef USE_GTK_VERSION_3_0
|
||||||
case GDK_KEY_Page_Down:
|
case GDK_KEY_Page_Down:
|
||||||
@ -797,7 +798,7 @@ void BufferText::cursorMove(int32_t gtkKey)
|
|||||||
# endif
|
# endif
|
||||||
//EDN_INFO("keyEvent : <PAGE-DOWN>");
|
//EDN_INFO("keyEvent : <PAGE-DOWN>");
|
||||||
// TODO : REWORK
|
// TODO : REWORK
|
||||||
//TextDMoveDown(m_displaySize.x);
|
TextDMoveDown(m_AnchorList[1].m_displaySize.x);
|
||||||
break;
|
break;
|
||||||
# ifdef USE_GTK_VERSION_3_0
|
# ifdef USE_GTK_VERSION_3_0
|
||||||
case GDK_KEY_Begin:
|
case GDK_KEY_Begin:
|
||||||
@ -836,55 +837,56 @@ void BufferText::cursorMove(int32_t gtkKey)
|
|||||||
*/
|
*/
|
||||||
void BufferText::UpdateWindowsPosition(bool centerPage)
|
void BufferText::UpdateWindowsPosition(bool centerPage)
|
||||||
{
|
{
|
||||||
// TODO : REWORK
|
for (int32_t iii=0; iii < m_AnchorList.Size() ; iii++) {
|
||||||
/*
|
if (centerPage == false) {
|
||||||
if (centerPage == false) {
|
// Display position (Y mode):
|
||||||
// Display position (Y mode):
|
//EDN_INFO(" m_displayStart(" << m_displayStart.x << "," << m_displayStart.y << ") m_displaySize(" << m_displaySize.x << "," <<m_displaySize.y << ")");
|
||||||
//EDN_INFO("BufferText::UpdateWindowsPosition() m_displayStart(" << m_displayStart.x << "," << m_displayStart.y << ") m_displaySize(" << m_displaySize.x << "," <<m_displaySize.y << ")");
|
position_ts cursorPosition;
|
||||||
position_ts cursorPosition;
|
cursorPosition.y = m_EdnBuf.CountLines(0, m_cursorPos);
|
||||||
cursorPosition.y = m_EdnBuf.CountLines(0, m_cursorPos);
|
int32_t lineStartPos = m_EdnBuf.StartOfLine(m_cursorPos);
|
||||||
int32_t lineStartPos = m_EdnBuf.StartOfLine(m_cursorPos);
|
cursorPosition.x = m_EdnBuf.CountDispChars(lineStartPos, m_cursorPos);
|
||||||
cursorPosition.x = m_EdnBuf.CountDispChars(lineStartPos, m_cursorPos);
|
//EDN_INFO(" curent cursor position : (" << cursorPosition.x << "," << cursorPosition.y << ")");
|
||||||
//EDN_INFO("BufferText::UpdateWindowsPosition() curent cursor position : (" << cursorPosition.x << "," << cursorPosition.y << ")");
|
|
||||||
|
if (m_AnchorList[iii].m_displayStart.y > (int32_t)cursorPosition.y - globals::getNbLineBorder() ) {
|
||||||
if (m_displayStart.y > (int32_t)cursorPosition.y - globals::getNbLineBorder() ) {
|
m_AnchorList[iii].m_displayStart.y = cursorPosition.y - globals::getNbLineBorder();
|
||||||
m_displayStart.y = cursorPosition.y - globals::getNbLineBorder();
|
if (m_AnchorList[iii].m_displayStart.y < 0) {
|
||||||
if (m_displayStart.y < 0) {
|
m_AnchorList[iii].m_displayStart.y = 0;
|
||||||
m_displayStart.y = 0;
|
}
|
||||||
|
} else if (m_AnchorList[iii].m_displayStart.y + m_AnchorList[iii].m_displaySize.y <= (int32_t)cursorPosition.y + globals::getNbLineBorder() ) {
|
||||||
|
m_AnchorList[iii].m_displayStart.y = cursorPosition.y - m_AnchorList[iii].m_displaySize.y + globals::getNbLineBorder() + 1;
|
||||||
}
|
}
|
||||||
} else if (m_displayStart.y + m_displaySize.y <= (int32_t)cursorPosition.y + globals::getNbLineBorder() ) {
|
// Display position (X mode):
|
||||||
m_displayStart.y = cursorPosition.y - m_displaySize.y + globals::getNbLineBorder() + 1;
|
//EDN_INFO("cursorPosition X : " << cursorPosition.y << " windows " << m_displayStart.y << "=>" << m_displayStart.x + m_displaySize.x);
|
||||||
}
|
if (m_AnchorList[iii].m_displayStart.x > cursorPosition.x - globals::getNbColoneBorder() ) {
|
||||||
// Display position (X mode):
|
m_AnchorList[iii].m_displayStart.x = cursorPosition.x - globals::getNbColoneBorder();
|
||||||
//EDN_INFO("cursorPosition X : " << cursorPosition.y << " windows " << m_displayStart.y << "=>" << m_displayStart.x + m_displaySize.x);
|
if (m_AnchorList[iii].m_displayStart.x < 0) {
|
||||||
if (m_displayStart.x > cursorPosition.x - globals::getNbColoneBorder() ) {
|
m_AnchorList[iii].m_displayStart.x = 0;
|
||||||
m_displayStart.x = cursorPosition.x - globals::getNbColoneBorder();
|
}
|
||||||
if (m_displayStart.x < 0) {
|
} else if (m_AnchorList[iii].m_displayStart.x + m_AnchorList[iii].m_displaySize.x <= cursorPosition.x + globals::getNbColoneBorder() ) {
|
||||||
m_displayStart.x = 0;
|
m_AnchorList[iii].m_displayStart.x = cursorPosition.x - m_AnchorList[iii].m_displaySize.x + globals::getNbColoneBorder() + 1;
|
||||||
}
|
}
|
||||||
} else if (m_displayStart.x + m_displaySize.x <= cursorPosition.x + globals::getNbColoneBorder() ) {
|
|
||||||
m_displayStart.x = cursorPosition.x - m_displaySize.x + globals::getNbColoneBorder() + 1;
|
//update the buffer position ID :
|
||||||
|
m_AnchorList[iii].m_bufferPos = m_EdnBuf.CountForwardNLines(0, m_AnchorList[iii].m_displayStart.y);
|
||||||
|
m_AnchorList[iii].m_lineId = m_AnchorList[iii].m_displayStart.y;
|
||||||
|
} else {
|
||||||
|
// center the line at the middle of the screen :
|
||||||
|
position_ts cursorPosition;
|
||||||
|
//EDN_DEBUG(" -------------------------------------------------");
|
||||||
|
cursorPosition.y = m_EdnBuf.CountLines(0, m_cursorPos);
|
||||||
|
//EDN_DEBUG(" cursor position : " << m_cursorPos << " ==> ligne=" << cursorPosition.y);
|
||||||
|
cursorPosition.x = 0;
|
||||||
|
|
||||||
|
m_AnchorList[iii].m_displayStart.x = 0;
|
||||||
|
//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 = edn_max(m_AnchorList[iii].m_displayStart.y, 0);
|
||||||
|
m_AnchorList[iii].m_bufferPos = m_EdnBuf.CountForwardNLines(0, m_AnchorList[iii].m_displayStart.y);
|
||||||
|
m_AnchorList[iii].m_lineId = m_AnchorList[iii].m_displayStart.y;
|
||||||
|
//EDN_DEBUG(" display start : " << m_displayStart.x << "x" << m_displayStart.y);
|
||||||
|
//EDN_DEBUG(" -------------------------------------------------");
|
||||||
}
|
}
|
||||||
|
|
||||||
//update the buffer position ID :
|
|
||||||
m_displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, m_displayStart.y);
|
|
||||||
} else {
|
|
||||||
// center the line at the middle of the screen :
|
|
||||||
position_ts cursorPosition;
|
|
||||||
//EDN_DEBUG(" -------------------------------------------------");
|
|
||||||
cursorPosition.y = m_EdnBuf.CountLines(0, m_cursorPos);
|
|
||||||
//EDN_DEBUG(" cursor position : " << m_cursorPos << " ==> ligne=" << cursorPosition.y);
|
|
||||||
cursorPosition.x = 0;
|
|
||||||
|
|
||||||
m_displayStart.x = 0;
|
|
||||||
//EDN_DEBUG(" display size : " << m_displaySize.y);
|
|
||||||
m_displayStart.y = cursorPosition.y - m_displaySize.y/2;
|
|
||||||
m_displayStart.y = edn_max(m_displayStart.y, 0);
|
|
||||||
m_displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, m_displayStart.y);
|
|
||||||
//EDN_DEBUG(" display start : " << m_displayStart.x << "x" << m_displayStart.y);
|
|
||||||
//EDN_DEBUG(" -------------------------------------------------");
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1286,10 +1288,9 @@ bool BufferText::AnchorGet(int32_t anchorID, bufferAnchor_ts & anchor)
|
|||||||
anchor.m_displaySize.y = m_AnchorList[localID].m_displaySize.y;
|
anchor.m_displaySize.y = m_AnchorList[localID].m_displaySize.y;
|
||||||
anchor.m_displayStart.x = m_AnchorList[localID].m_displayStart.x;
|
anchor.m_displayStart.x = m_AnchorList[localID].m_displayStart.x;
|
||||||
anchor.m_displayStart.y = m_AnchorList[localID].m_displayStart.y;
|
anchor.m_displayStart.y = m_AnchorList[localID].m_displayStart.y;
|
||||||
// TODO : Test de display non complet...
|
anchor.m_nbIterationMax = anchor.m_displaySize.y;
|
||||||
anchor.m_nbIterationMax = anchor.m_displaySize.y - 4;
|
|
||||||
// update to buffer position
|
// update to buffer position
|
||||||
anchor.m_lineNumber = m_AnchorList[localID].m_lineId;
|
anchor.m_lineNumber = m_AnchorList[localID].m_lineId +1;
|
||||||
anchor.m_posStart = m_AnchorList[localID].m_bufferPos;
|
anchor.m_posStart = m_AnchorList[localID].m_bufferPos;
|
||||||
if (anchor.m_posStart >= m_EdnBuf.Size()+1) {
|
if (anchor.m_posStart >= m_EdnBuf.Size()+1) {
|
||||||
return false;
|
return false;
|
||||||
@ -1306,6 +1307,7 @@ bool BufferText::AnchorGet(int32_t anchorID, bufferAnchor_ts & anchor)
|
|||||||
anchor.m_selectionPosStart = selStart;
|
anchor.m_selectionPosStart = selStart;
|
||||||
anchor.m_selectionPosStop = selEnd;
|
anchor.m_selectionPosStop = selEnd;
|
||||||
}
|
}
|
||||||
|
EDN_DEBUG("Request display : line=" << anchor.m_lineNumber << " (" << anchor.m_posStart << "," << anchor.m_posStop << ")");
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@ -1321,5 +1323,9 @@ bool BufferText::AnchorNext(bufferAnchor_ts & anchor)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
anchor.m_posStop = m_EdnBuf.EndOfLine(anchor.m_posStart);
|
anchor.m_posStop = m_EdnBuf.EndOfLine(anchor.m_posStart);
|
||||||
|
anchor.m_nbIterationMax--;
|
||||||
|
if (anchor.m_nbIterationMax<0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -193,7 +193,7 @@ void CodeView::OnMessage(int32_t id, int32_t dataID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//#define COUNT_TIME plop
|
#define COUNT_TIME plop
|
||||||
|
|
||||||
gboolean CodeView::CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data)
|
gboolean CodeView::CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user