sys : rework seem fonctionnal (slow) and a correction start selection error

This commit is contained in:
Edouard Dupin 2011-09-18 20:37:36 +02:00
parent 89394d5770
commit 9bad01fc37
6 changed files with 49 additions and 38 deletions

View File

@ -475,3 +475,13 @@ int32_t Buffer::AnchorRealId(int32_t anchorID)
} }
return -1; return -1;
} }
int32_t Buffer::AnchorCurrentId(void)
{
for(int32_t iii=0; iii < m_AnchorList.Size(); iii++) {
if (m_AnchorList[iii].m_curent == true) {
return iii;
}
}
return 0;
}

View File

@ -151,6 +151,7 @@ class Buffer {
int32_t m_lineWidth; int32_t m_lineWidth;
int32_t m_lineHeight; int32_t m_lineHeight;
int32_t AnchorRealId(int32_t anchorID); int32_t AnchorRealId(int32_t anchorID);
int32_t AnchorCurrentId(void);
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; int32_t m_uniqueID;

View File

@ -397,9 +397,8 @@ void BufferText::GetMousePosition(int32_t width, int32_t height, int32_t &x, int
if (x < 0) { if (x < 0) {
x = 0; x = 0;
} }
// TODO : REWORK x += m_AnchorList[AnchorCurrentId()].m_displayStart.x;
//x += m_displayStart.x; y += m_AnchorList[AnchorCurrentId()].m_displayStart.y;
//y += m_displayStart.y;
//EDN_DEBUG("BufferText::GetMousePosition(" << width << "," << height << "); ==> (" << x << "," << y << ")" ); //EDN_DEBUG("BufferText::GetMousePosition(" << width << "," << height << "); ==> (" << x << "," << y << ")" );
} }
@ -578,8 +577,7 @@ void BufferText::ScrollUp(void)
*/ */
void BufferText::MoveUpDown(int32_t ofset) void BufferText::MoveUpDown(int32_t ofset)
{ {
for (int32_t iii=0; iii < m_AnchorList.Size() ; iii++) { int32_t iii=AnchorCurrentId();
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_AnchorList[iii].m_displayStart.y+ofset+3 > nbLine) { if (m_AnchorList[iii].m_displayStart.y+ofset+3 > nbLine) {
@ -602,8 +600,6 @@ void BufferText::MoveUpDown(int32_t ofset)
} }
} }
} }
}
}
void BufferText::SetInsertPosition(int32_t newPos, bool insertChar) void BufferText::SetInsertPosition(int32_t newPos, bool insertChar)
@ -788,8 +784,7 @@ void BufferText::cursorMove(int32_t gtkKey)
case GDK_Page_Up: case GDK_Page_Up:
# endif # endif
//EDN_INFO("keyEvent : <PAGE-UP>"); //EDN_INFO("keyEvent : <PAGE-UP>");
// TODO : REWORK TextDMoveUp(m_AnchorList[AnchorCurrentId()].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,8 +792,7 @@ void BufferText::cursorMove(int32_t gtkKey)
case GDK_Page_Down: case GDK_Page_Down:
# endif # endif
//EDN_INFO("keyEvent : <PAGE-DOWN>"); //EDN_INFO("keyEvent : <PAGE-DOWN>");
// TODO : REWORK TextDMoveDown(m_AnchorList[AnchorCurrentId()].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:
@ -1304,10 +1298,11 @@ bool BufferText::AnchorGet(int32_t anchorID, bufferAnchor_ts & anchor)
anchor.m_selectionPosStart = -1; anchor.m_selectionPosStart = -1;
anchor.m_selectionPosStop = -1; anchor.m_selectionPosStop = -1;
} else { } else {
anchor.m_selectionPosStart = selStart; anchor.m_selectionPosStart = selStart+1;
anchor.m_selectionPosStop = selEnd; anchor.m_selectionPosStop = selEnd+1;
} }
EDN_DEBUG("Request display : line=" << anchor.m_lineNumber << " (" << anchor.m_posStart << "," << anchor.m_posStop << ")"); EDN_DEBUG("Request display : line=" << anchor.m_lineNumber << " (" << anchor.m_posStart << "," << anchor.m_posStop << ")");
EDN_DEBUG(" ==> select : (" << anchor.m_selectionPosStart << "," << anchor.m_selectionPosStop << ")");
return true; return true;
} else { } else {
return false; return false;

View File

@ -159,6 +159,8 @@ DrawerManager::DrawerManager(GtkWidget * widget, int32_t x, int32_t y)
cairo_scale(m_cairo, 1.0, 1.0); cairo_scale(m_cairo, 1.0, 1.0);
m_nbElement = 0;
// http://cairographics.org/FAQ/#clear_a_surface // http://cairographics.org/FAQ/#clear_a_surface
// http://gtk.developpez.com/faq/?page=gtkwidget#GTK_WIDGET_transparent // http://gtk.developpez.com/faq/?page=gtkwidget#GTK_WIDGET_transparent
//cairo_set_source_rgba(m_cairo, 1, 1, 1, 0); //cairo_set_source_rgba(m_cairo, 1, 1, 1, 0);
@ -289,9 +291,8 @@ void DrawerManager::Flush(void)
int32_t letterHeight = Display::GetFontHeight(); int32_t letterHeight = Display::GetFontHeight();
if (true == m_selectColor->HaveBg() ) { if (true == m_selectColor->HaveBg() ) {
int32_t letterWidth = Display::GetFontWidth(); int32_t letterWidth = Display::GetFontWidth();
int32_t stringLen = m_nbElement;
// generate Clean BG: // generate Clean BG:
DirectRectangle(m_selectColor, m_pos.x, m_pos.y, letterWidth*stringLen, letterHeight); DirectRectangle(m_selectColor, m_pos.x, m_pos.y, letterWidth*m_nbElement, letterHeight);
} }
cairo_move_to(m_cairo, m_pos.x, m_pos.y+letterHeight-4); cairo_move_to(m_cairo, m_pos.x, m_pos.y+letterHeight-4);
m_selectColor->ApplyFG(m_cairo); m_selectColor->ApplyFG(m_cairo);
@ -350,9 +351,10 @@ void DrawerManager::DirectRectangle(Colorize *SelectColor, int32_t x, int32_t y,
// flush // flush
cairo_fill(m_cairo); cairo_fill(m_cairo);
} }
void DrawerManager::DirectRectangle(color_ts &SelectColor, int32_t x, int32_t y, int32_t width, int32_t height) void DrawerManager::DirectRectangle(color_ts &SelectColor, int32_t x, int32_t y, int32_t width, int32_t height)
{ {
cairo_set_source_rgb(m_cairo, SelectColor.red, SelectColor.green, SelectColor.blue); cairo_set_source_rgb(m_cairo, SelectColor.red, SelectColor.green, SelectColor.blue);
// set postion // set postion
cairo_rectangle(m_cairo, x, y, width, height); cairo_rectangle(m_cairo, x, y, width, height);

View File

@ -422,7 +422,11 @@ static uint32_t Utf8_GetValue(UTF8Element_ts &Element)
int32_t strUtf8Len(const char *input_UTF8) int32_t strUtf8Len(const char *input_UTF8)
{ {
int32_t count = 0; int32_t count = 0;
int32_t size = strlen(input_UTF8); int32_t sizeInput = strlen(input_UTF8);
int32_t size = sizeInput;
if (size>20) {
EDN_DEBUG("check SIZE...");
}
uint8_t tmpSize; uint8_t tmpSize;
bool baseValid; bool baseValid;
while (size > 0) { while (size > 0) {

View File

@ -10,7 +10,6 @@
- sys : replace TAB with space when Tab is pressed - sys : replace TAB with space when Tab is pressed
- sys : Catch F[1-12] ==> for user personal event - sys : Catch F[1-12] ==> for user personal event
- BUG : Correction du bug des entré bizard tel que les chapot et les guillemets - BUG : Correction du bug des entré bizard tel que les chapot et les guillemets
- BUG : de sélection quand la ligne est pleine et la première ligne séctionnée. ==> regarder après avoir fait le display ligne par ligne...
- BUG : de copier coller sur les éàè ... - BUG : de copier coller sur les éàè ...
- BUG : les caractère multiples type chapot ... - BUG : les caractère multiples type chapot ...
- BUG : italique non généré - BUG : italique non généré