diff --git a/avancement.boo b/avancement.boo index e100355..17b554a 100644 --- a/avancement.boo +++ b/avancement.boo @@ -1,9 +1,11 @@ # action a faire (ordonner par révision) : dans la liste des truc important a refaire - l'annalyseur d'expression regulière pour le display, le faire ligne par ligne - ne pas regénéré l'affichage des widget quand les taille change - mettre en place le positionnement des élément par matrice ... ==> gain de temps en repaint... + retirer tout les singleton ==> passer par des namespace ==> fonctionnera mieux ... + finir de netoyer la classe widget + netoyer les classe text ... + mettre en pla ce le repositionnement automatique quand on change de buffer + Curseur au bon endroit diff --git a/jni/edn/Buffer/BufferText.cpp b/jni/edn/Buffer/BufferText.cpp index c37c232..932a5e5 100644 --- a/jni/edn/Buffer/BufferText.cpp +++ b/jni/edn/Buffer/BufferText.cpp @@ -264,16 +264,19 @@ void BufferText::DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObjec #define CURSOR_WIDTH (5) #define CURSOR_THICKNESS (1.2) -void BufferText::CursorDisplay(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth) +void BufferText::CursorDisplay(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth, clipping_ts &clip) { color_ts & tmpppppp = ColorizeManager::getInstance()->Get(COLOR_CODE_CURSOR); OOColored->SetColor(tmpppppp); if (true == ewol::IsSetInsert()) { - OOColored->Rectangle( x, y, letterWidth, letterHeight); + OOColored->Rectangle( x, y, letterWidth, letterHeight, clip); } else { - OOColored->Line( (int32_t)(x-CURSOR_WIDTH), (int32_t)(y) , (int32_t)(x+CURSOR_WIDTH), (int32_t)(y) , CURSOR_THICKNESS); - OOColored->Line( (int32_t)(x-CURSOR_WIDTH), (int32_t)(y+letterHeight-CURSOR_THICKNESS), (int32_t)(x+CURSOR_WIDTH), (int32_t)(y+letterHeight-CURSOR_THICKNESS), CURSOR_THICKNESS); - OOColored->Line( (int32_t)(x) , (int32_t)(y) , (int32_t)(x) , (int32_t)(y+letterHeight-CURSOR_THICKNESS), CURSOR_THICKNESS); + // TODO : Clipping + if (x >= clip.x) { + OOColored->Line( (int32_t)(x-CURSOR_WIDTH), (int32_t)(y) , (int32_t)(x+CURSOR_WIDTH), (int32_t)(y) , CURSOR_THICKNESS); + OOColored->Line( (int32_t)(x-CURSOR_WIDTH), (int32_t)(y+letterHeight-CURSOR_THICKNESS), (int32_t)(x+CURSOR_WIDTH), (int32_t)(y+letterHeight-CURSOR_THICKNESS), CURSOR_THICKNESS); + OOColored->Line( (int32_t)(x) , (int32_t)(y) , (int32_t)(x) , (int32_t)(y+letterHeight-CURSOR_THICKNESS), CURSOR_THICKNESS); + } } } @@ -495,7 +498,7 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal, // display cursor : if (m_cursorPos == iii) { // display the cursor: - CursorDisplay(&OOColored, pixelX, y, letterHeight, letterWidth); + CursorDisplay(&OOColored, pixelX - offsetX, y, letterHeight, letterWidth, drawClippingTextArea); } pixelX += drawSize; // move to next line ... @@ -510,7 +513,7 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal, } // special case : the cursor is at the end of the buffer... if (m_cursorPos == iii) { - CursorDisplay(&OOColored, pixelX, y, letterHeight, letterWidth); + CursorDisplay(&OOColored, pixelX - offsetX, y, letterHeight, letterWidth, drawClippingTextArea); } int64_t stopTime2 = GetCurrentTime(); @@ -726,6 +729,7 @@ void BufferText::SelectNone(void) * @return --- * */ +// TODO : Deprecated... void BufferText::ScrollDown(void) { MoveUpDown(3); @@ -740,6 +744,7 @@ void BufferText::ScrollDown(void) * @return --- * */ +// TODO : Deprecated... void BufferText::ScrollUp(void) { MoveUpDown(-3); diff --git a/jni/edn/Buffer/BufferText.h b/jni/edn/Buffer/BufferText.h index 89f6aad..13fdb5a 100644 --- a/jni/edn/Buffer/BufferText.h +++ b/jni/edn/Buffer/BufferText.h @@ -120,7 +120,7 @@ class BufferText : public Buffer { void MoveUpDown(int32_t ofset); void DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY,char *myPrint, int32_t lineNumber, int32_t positionY); - void CursorDisplay(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth); + void CursorDisplay(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth, clipping_ts &clip); }; diff --git a/jni/edn/Gui/BufferView.cpp b/jni/edn/Gui/BufferView.cpp index 8155170..977cdf1 100644 --- a/jni/edn/Gui/BufferView.cpp +++ b/jni/edn/Gui/BufferView.cpp @@ -141,7 +141,7 @@ bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToW bool BufferView::OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y) { - if (typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) { + if (1 == IdInput && typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) { EDN_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw ); int32_t selectBuf = m_bufferManager->WitchBuffer(raw+1); if ( 0 <= selectBuf) { diff --git a/jni/edn/Gui/CodeView.cpp b/jni/edn/Gui/CodeView.cpp index 94dc2e7..412b38e 100644 --- a/jni/edn/Gui/CodeView.cpp +++ b/jni/edn/Gui/CodeView.cpp @@ -90,19 +90,15 @@ void CodeView::CalculateMaxSize(void) int32_t letterHeight = ewol::GetHeight(m_fontNormal); m_maxSize.y = m_bufferManager->Get(m_bufferID)->GetNumberOfLine() * letterHeight; } -// TODO : remove this from here ... -#include + bool CodeView::OnDraw(void) { - //glLoadIdentity(); - glTranslatef(m_origin.x,m_origin.y, 0); m_OObjectsColored[ m_currentDrawId].Draw(); m_OObjectTextNormal[ m_currentDrawId].Draw(); m_OObjectTextBold[ m_currentDrawId].Draw(); m_OObjectTextItalic[ m_currentDrawId].Draw(); m_OObjectTextBoldItalic[m_currentDrawId].Draw(); - glTranslatef(-m_origin.x,-m_origin.y, 0); return true; } @@ -174,8 +170,6 @@ bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, // nothing to do ... done on upper widet ... return true; } - x -= m_origin.x; - y -= m_origin.y; if (1 == IdInput) { #ifndef __MODE__Touch if (ewol::EVENT_INPUT_TYPE_DOWN == typeEvent) { diff --git a/jni/edn/Gui/MainWindows.cpp b/jni/edn/Gui/MainWindows.cpp index f003502..c49e58b 100644 --- a/jni/edn/Gui/MainWindows.cpp +++ b/jni/edn/Gui/MainWindows.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -174,7 +173,7 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve } } else if (generateEventId == ednEventPopUpFileSelected) { // get widget: - ewol::FileChooser * tmpWidget = reinterpret_cast(ewol::widgetManager::Get(widgetID)); + ewol::FileChooser * tmpWidget = dynamic_cast(ewol::widgetManager::Get(widgetID)); if (NULL == tmpWidget) { EDN_ERROR("impossible to get pop_upWidget " << widgetID); return false; @@ -219,7 +218,7 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve } } else if (generateEventId == ednEventPopUpFileSaveAs) { // get widget: - ewol::FileChooser * tmpWidget = reinterpret_cast(ewol::widgetManager::Get(widgetID)); + ewol::FileChooser * tmpWidget = dynamic_cast(ewol::widgetManager::Get(widgetID)); if (NULL == tmpWidget) { EDN_ERROR("impossible to get pop_upWidget " << widgetID); return false; diff --git a/jni/edn/Gui/Search.cpp b/jni/edn/Gui/Search.cpp index bc4cf79..6f9d85b 100644 --- a/jni/edn/Gui/Search.cpp +++ b/jni/edn/Gui/Search.cpp @@ -277,7 +277,7 @@ void Search::OnButtonReplaceAndNext(GtkWidget *widget, gpointer data) void Search::OnButtonQuit(GtkWidget *widget, gpointer data) { //EDN_INFO("CALLBACK"); - Search * self = reinterpret_cast(data); + Search * self = dynamic_cast(data); self->Destroy(); } @@ -304,7 +304,7 @@ void Search::OnCheckBoxEventCase(GtkWidget *widget, gpointer data) void Search::OnCheckBoxEventRegExp(GtkWidget *widget, gpointer data) { //EDN_INFO("CALLBACK"); - Search * self = reinterpret_cast(data); + Search * self = dynamic_cast(data); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { SearchData::SetRegExp(true); gtk_widget_set_sensitive(self->m_CkMatchCase, false); @@ -317,7 +317,7 @@ void Search::OnCheckBoxEventRegExp(GtkWidget *widget, gpointer data) void Search::OnEntrySearchChange(GtkWidget *widget, gpointer data) { //EDN_INFO("CALLBACK"); - Search * self = reinterpret_cast(data); + Search * self = dynamic_cast(data); // update research data const char *testData = gtk_entry_get_text(GTK_ENTRY(widget)); if (NULL != testData) { @@ -343,7 +343,7 @@ void Search::OnEntrySearchChange(GtkWidget *widget, gpointer data) void Search::OnEntryReplaceChange(GtkWidget *widget, gpointer data) { //EDN_INFO("CALLBACK"); - Search * self = reinterpret_cast(data); + Search * self = dynamic_cast(data); // update replace data const char *testData = gtk_entry_get_text(GTK_ENTRY(widget)); if (NULL != testData) { diff --git a/jni/edn/ctags/CTagsManager.cpp b/jni/edn/ctags/CTagsManager.cpp index 7c56f39..0a8c128 100644 --- a/jni/edn/ctags/CTagsManager.cpp +++ b/jni/edn/ctags/CTagsManager.cpp @@ -203,7 +203,7 @@ void CTagsManager::cb_row(GtkTreeView *p_treeview, gpointer data) { EDN_DEBUG("event"); - CTagsManager * self = reinterpret_cast(data); + CTagsManager * self = dynamic_cast(data); gchar * p_file=NULL; gint lineNumber;