[DEV] start rework buffer manager in resource

This commit is contained in:
Edouard DUPIN 2013-10-28 21:47:51 +01:00
parent 01692bdd13
commit 7ddaa68bb0
45 changed files with 138 additions and 4482 deletions

View File

@ -102,3 +102,7 @@ License (GPLv3)
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Annexe
==================
sudo cp data/edn.desktop /usr/share/applications/

View File

@ -7,10 +7,10 @@
*/
#include <appl/Buffer/Buffer.h>
#include <appl/Buffer.h>
#include <appl/debug.h>
#include <ewol/clipBoard.h>
#include <appl/Highlight/HighlightManager.h>
#include <appl/HighlightManager.h>
appl::Buffer::Iterator& appl::Buffer::Iterator::operator++ (void) {
m_value = etk::UChar::Null;
@ -463,9 +463,13 @@ void appl::Buffer::removeSelection(void) {
}
void appl::Buffer::tryFindHighlightType(void) {
// etk::UString appl::highlightManager::getTypeExtention(const etk::UString& _extention);
// TODO :...
setHighlightType("C/C++");
etk::FSNode file(m_name);
etk::UString type = appl::highlightManager::getTypeExtention(file.fileGetExtention());
if (type.size() == 0) {
return;
}
APPL_CRITICAL("Find extention : " << type);
setHighlightType(type);
}
void appl::Buffer::setHighlightType(const etk::UString& _type) {

View File

@ -17,7 +17,7 @@
#include <ewol/renderer/EObject.h>
#include <ewol/widget/Widget.h>
#include <ewol/compositing/Text.h>
#include <appl/Highlight/Highlight.h>
#include <appl/Highlight.h>
namespace appl {

View File

@ -1,32 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license GPL v3 (see license file)
*/
#ifndef __BUFFER_MANAGER_H__
#define __BUFFER_MANAGER_H__
#include <Buffer.h>
#include <appl/globalMsg.h>
#include <ewol/widget/Widget.h>
namespace BufferManager
{
void init(void);
void unInit(void);
int32_t getSelected(void);
appl::Buffer* get(int32_t BufferID);
bool exist(int32_t BufferID);
bool exist(etk::FSNode &myFile);
int32_t getId(etk::FSNode &myFile);
// return the number of buffer (open in the past) if 5 buffer open and 4 close == > return 5
uint32_t size(void);
uint32_t sizeOpen(void);
int32_t witchBuffer(int32_t iEmeElement);
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,156 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license GPL v3 (see license file)
*/
#ifndef __BUFFER_TEXT_H__
#define __BUFFER_TEXT_H__
#include <etk/UString.h>
#include <etk/os/FSNode.h>
#include <etk/unicode.h>
#include <ewol/ewol.h>
#include <ewol/compositing/Drawing.h>
#include <ewol/compositing/Text.h>
#include "ColorizeManager.h"
#include "EdnBuf.h"
typedef enum {
CURSOR_DISPLAY_MODE_NORMAL = 259,
CURSOR_DISPLAY_MODE_INSERT,
CURSOR_DISPLAY_MODE_NOT_FOCUS,
} cursorDisplayMode_te;
class CharElement
{
public:
float m_LineOffset; // TODO : DEPRECATED ...
int16_t m_yOffset;
int16_t m_xOffset;
int16_t m_ySize;
int32_t m_bufferPos;
};
typedef struct{
uint32_t nbTotalLine; //!< Number of line in the buffer
uint32_t nbTotalColomn; //!< Number of line in the buffer
uint32_t startLineDisplay; //!< First line display.
uint32_t startColomnDisplay; //!< First Colomn displayed
uint32_t diplayableColomn; //!< NB colomn that can be displayed
uint32_t diplayableLine; //!< NB line that can be displayed
}infoStatBuffer_ts;
class BufferText
{
private:
bool m_fileModify;
// naming
etk::FSNode m_fileName; //!< filename of the curent buffer
bool m_haveName; //!< to know if the file have a name or NOT
bool m_updatePositionRequested; //!< if a position xhange in the windows ...
vec2 m_maximumSize; //!< current maxSize of the buffer
public:
void setModify(bool status);
virtual vec2 getBorderSize(void);
void RequestUpdateOfThePosition(void) { m_updatePositionRequested = true; };
void setMaximumSize(vec2 maxSize) { m_maximumSize = maxSize; };
bool needToUpdateDisplayPosition(void);
vec2 getMaxSize(void) { return m_maximumSize; };
bool isModify(void);
public:
etk::FSNode getFileName(void) { return m_fileName; };
void setFileName(etk::FSNode &newName)
{
m_fileName = newName;
m_haveName = true;
NameChange();
};
void setFileName(etk::UString &newName)
{
m_fileName.setName(newName);
m_haveName = true;
NameChange();
};
bool haveName(void)
{
return m_haveName;
}
public:
BufferText(void);
BufferText(etk::FSNode &fileName);
virtual ~BufferText(void);
void Save(void);
void getInfo(infoStatBuffer_ts &infoToUpdate);
void setLineDisplay(uint32_t lineNumber);
int32_t display(ewol::Text& OOText,
int32_t offsetX, int32_t offsetY,
int32_t sizeX, int32_t sizeY);
void addChar(etk::UChar unicodeData);
void cursorMove(ewol::keyEvent::keyboard_te moveTypeEvent);
void MouseSelectFromCursorTo(vec2 pos);
void MouseEvent(vec2 pos);
void MouseEventDouble(void);
void MouseEventTriple(void);
void Copy(ewol::clipBoard::clipboardListe_te clipboardID);
void Cut(ewol::clipBoard::clipboardListe_te clipboardID);
void Paste(ewol::clipBoard::clipboardListe_te clipboardID);
void Search(etk::UString &data, bool back, bool caseSensitive, bool wrap, bool regExp);
void Replace(etk::UString &data);
int32_t findLine(etk::UString &data);
void JumpAtLine(int32_t newLine);
int32_t getCurrentLine(void);
void removeLine(void);
void SelectAll(void);
void SelectNone(void);
void Undo(void);
void Redo(void);
void setCharset(unicode::charset_te newCharset);
int32_t getNumberOfLine(void);
protected:
void NameChange(void);
private:
int32_t getLineNumberNumberOfElement(void);
// Direct buffer IO
EdnBuf m_EdnBuf; //!< buffer associated on this displayer
vec2 m_displaySize; //!< number of char displayable in the screan
// Cursor :
int32_t m_cursorPos; //!< position in the buffer of the cursor
int32_t m_cursorPreferredCol; //!< colomn of the last up and down ...
cursorDisplayMode_te m_cursorMode; //!< type of cursor Selected
etk::Vector<CharElement> m_elmentList; //!< Elemnt position for every char displayed
// internal function
void BasicInit(void);
private:
bool m_centerRequested;
public:
virtual vec2 getPosition(int32_t fontId, bool& centerRequested);
private:
bool TextDMoveUp(int32_t offset);
bool TextDMoveDown(int32_t offset);
void setInsertPosition(int32_t newPosition, bool insertChar = false);
int32_t getMousePosition(vec2 pos);
void drawLineNumber(ewol::Text* OOText, int32_t sizeX, int32_t sizeY, int32_t nbColomn, int32_t lineNumber, int32_t positionY);
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,187 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license GPL v3 (see license file)
*/
#ifndef __EDN_BUF_H__
#define __EDN_BUF_H__
/* Maximum length in characters of a tab or control character expansion
of a single buffer character */
#define MAX_EXP_CHAR_LEN 20*4
class EdnBuf;
#include <etk/Buffer.h>
#include <EdnBufHistory.h>
#include <HighlightManager.h>
#include <etk/unicode.h>
/*
rectStart rectStart
start ************* *************
********** * xxxx*xxxxxx *
* ******** xxxx*xxxxxxxxxxx*xxxxx
end *************** *************
rectEnd rectEnd
*/
typedef struct {
bool selected; //!< True if the selection is active
bool rectangular; //!< True if the selection is rectangular
bool zeroWidth; //!< Width 0 selections aren't "real" selections, but they can be useful when creating rectangular selections from the keyboard.
int32_t start; //!< Pos. of start of selection, or if rectangular start of line containing it.
int32_t end; //!< Pos. of end of selection, or if rectangular end of line containing it.
int32_t rectStart; //!< Indent of left edge of rect. selection
int32_t rectEnd; //!< Indent of right edge of rect. selection
} selection;
typedef struct {
etk::Vector<appl::HighlightInfo> HLData;
int32_t posHLPass1;
int32_t posHLPass2;
}appl::DisplayHLData;
class EdnBuf {
// TODO : set an iterator to acces at every data without knowin the system ...
public:
// constructer
EdnBuf(void);
// destructer
~EdnBuf(void);
// public function :
void getAll(etk::Vector<int8_t>& _text);
void setAll(etk::Vector<int8_t>& _text);
void getRange(int32_t _start, int32_t _end, etk::Vector<int8_t>& _output);
void getRange(int32_t _start, int32_t _end, etk::UString& _output);
bool DumpIn(etk::FSNode& _file);
bool DumpFrom(etk::FSNode& _file);
// replace with operator [] ...
int8_t operator[] (int32_t) const;
int32_t insert(int32_t _pos, etk::Vector<int8_t>& _insertText);
int32_t insert(int32_t _pos, etk::UString& _insertText);
int32_t Replace(int32_t _start, int32_t _end, etk::Vector<int8_t>& _insertText);
int32_t Replace(int32_t _start, int32_t _end, etk::UString& _insertText);
void remove(int32_t _start, int32_t _end);
int32_t Indent(void);
int32_t UnIndent(void);
void getLineText(int32_t _pos, etk::Vector<int8_t>& _text);
int32_t StartOfLine(int32_t _pos);
int32_t EndOfLine(int32_t _pos);
int32_t getExpandedChar(int32_t& _pos, int32_t _indent, etk::UChar _outUnicode[MAX_EXP_CHAR_LEN], uint32_t& _currentChar);
int32_t getExpandedChar(int32_t& _pos, int32_t _indent, char _outUTF8[MAX_EXP_CHAR_LEN], uint32_t& _currentChar);
int32_t ExpandCharacter(char _c, int32_t _indent, char _outUTF8[MAX_EXP_CHAR_LEN]); // TODO : remove
int32_t CharWidth(char _c, int32_t _indent); // TODO : rework this
int32_t CountDispChars(int32_t _lineStartPos, int32_t _targetPos);
int32_t CountForwardDispChars(int32_t _lineStartPos, int32_t _nChars);
int32_t CountLines(int32_t _startPos, int32_t _endPos);
int32_t CountLines(void);
int32_t CountLines(etk::Vector<int8_t>& _data);
int32_t CountForwardNLines(int32_t _startPos, int32_t _nLines);
int32_t CountBackwardNLines(int32_t _startPos, int32_t _nLines);
bool SearchForward(int32_t _startPos, etk::UString& _search, int32_t* _foundPos, int32_t* _foundPosEnd, bool _caseSensitive = true);
bool SearchBackward(int32_t _startPos, etk::UString& _search, int32_t* _foundPos, int32_t* _foundPosEnd, bool _caseSensitive = true);
bool SearchForward(int32_t _startPos, char _searchChar, int32_t* _foundPos);
bool SearchBackward(int32_t _startPos, char _searchChar, int32_t* _foundPos);
bool SelectAround(int32_t _startPos, int32_t& _beginPos, int32_t& _endPos);
// Buffer size system :
int32_t size(void) { return m_data.size(); };
int32_t NumberOfLines(void) { return m_nbLine; };
// -----------------------------------------
// selection remember...
// -----------------------------------------
public:
bool SelectHasSelection(void);
void Select(int32_t _start, int32_t _end);
void Unselect(void);
void RectSelect(int32_t _start, int32_t _end, int32_t _rectStart, int32_t _rectEnd);
bool getSelectionPos(int32_t& _start, int32_t& _end, bool& _isRect, int32_t& _rectStart, int32_t& _rectEnd);
void getSelectionText(etk::Vector<int8_t>& _text);
void getSelectionText(etk::UString& _text);
void removeSelected(void);
int32_t ReplaceSelected(etk::Vector<int8_t>& _text);
int32_t ReplaceSelected(etk::UString& _text);
private:
// current selection of the buffer
selection m_selectionList; //!< Selection area of the buffer
void updateSelection(int32_t _pos, int32_t _nDeleted, int32_t _nInserted);
// -----------------------------------------
// History section :
// -----------------------------------------
public:
int32_t Undo(void);
int32_t Redo(void);
private:
bool m_isUndoProcessing;
bool m_isRedoProcessing;
etk::Vector<EdnBufHistory*> m_historyUndo;
etk::Vector<EdnBufHistory*> m_historyRedo;
// -----------------------------------------
// hightlight section :
// -----------------------------------------
private:
Highlight * m_Highlight; //!< internal link with the Highlight system
etk::Vector<appl::HighlightInfo> m_HLDataPass1; //!< colorisation position in the current buffer pass 1
void RegenerateHighLightAt(int32_t _pos, int32_t _nbDeleted, int32_t _nbAdded);
void generateHighLightAt(int32_t _pos, int32_t _endPos, int32_t _addinPos=0);
void CleanHighLight(void);
void findMainHighLightPosition(int32_t _startPos, int32_t _endPos, int32_t &_startId, int32_t &_stopId, bool _backPreviousNotEnded);
public:
void setHLSystem(Highlight* _newHLSystem);
void HightlightGenerateLines(appl::DisplayHLData& _MData, int32_t _startPos, int32_t _nbLines);
appl::HighlightInfo* getElementColorAtPosition(appl::DisplayHLData& _MData, int32_t _pos);
private:
appl::HighlightInfo* getElementColorAtPosition(int32_t _pos, int32_t &_starPos);
private:
etk::Buffer m_data; //!< buffer of the data in the mode int8_t
void CountNumberOfLines(void);
int32_t m_nbLine; //!< Number of line in the biffer
// -----------------------------------------
// display property and charset ...
// -----------------------------------------
public:
int32_t getTabDistance(void) { return m_tabDist; } ;
void setTabDistance(int32_t _tabDist) { m_tabDist = _tabDist; };
unicode::charset_te getCharsetType(void) { return m_charsetType; };
void setCharsetType(unicode::charset_te _newOne) { m_charsetType = _newOne; if (unicode::EDN_CHARSET_UTF8 == _newOne){m_isUtf8=true;} else {m_isUtf8=false;} };
bool getUTF8Mode(void) { return m_isUtf8; };
void setUTF8Mode(bool _newOne) { m_isUtf8 = _newOne; m_charsetType=unicode::EDN_CHARSET_UTF8; };
private:
// Special mode of the buffer :
bool m_isUtf8; //!< true if we are in UTF8 mode == > if true the size of a char is 0, otherwise .. 1->4 ( TODO : not now)
unicode::charset_te m_charsetType; //!< if UTF8 mode is at false : the charset type of the buffer
// Local Tabulation policies
int32_t m_tabDist; //!< equiv. number of characters in a tab
bool m_useTabs; //!< True if buffer routines are allowed to use tabs for padding in rectangular operations
// -----------------------------------------
// Local function :
// -----------------------------------------
private:
void findRectSelBoundariesForCopy(int32_t _lineStartPos, int32_t _rectStart, int32_t _rectEnd, int32_t *_selStart, int32_t *_selEnd);
char* getSelectionText(selection& _sel);
void removeSelected(selection& _sel);
void replaceSelected(selection& _sel, const char* _text);
void eventModification(int32_t _pos, int32_t _nInserted, etk::Vector<int8_t>& _deletedText);
int32_t LocalInsert(int32_t _pos, etk::Vector<int8_t> &_insertText);
int32_t LocalInsert(int32_t _pos, etk::UString &_insertText);
bool charMatch(char _first, char _second, bool _caseSensitive = true);
};
#endif

View File

@ -1,64 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license GPL v3 (see license file)
*/
#include <appl/debug.h>
#include <appl/global.h>
#include <EdnBufHistory.h>
#undef __class__
#define __class__ "EdnBufHistory"
EdnBufHistory::EdnBufHistory(void)
{
//APPL_INFO("EdnBufHistory new");
m_pos = 0;
m_nInserted = 0;
}
EdnBufHistory::EdnBufHistory(int32_t pos, int32_t nInserted, etk::Vector<int8_t> &deletedText)
{
//APPL_INFO("EdnBufHistory new + data");
m_pos = pos;
m_nInserted = nInserted;
m_deletedText = deletedText;
}
void EdnBufHistory::set(int32_t pos, int32_t nInserted, etk::Vector<int8_t> &deletedText)
{
//APPL_INFO("EdnBufHistory new + data");
m_pos = pos;
m_nInserted = nInserted;
m_deletedText = deletedText;
}
EdnBufHistory::~EdnBufHistory(void)
{
// nothing to do ...
}
int32_t EdnBufHistory::getPos(void)
{
return m_pos;
}
int32_t EdnBufHistory::getnbDeleted(void)
{
return m_deletedText.size();
}
int32_t EdnBufHistory::getnbInserted(void)
{
return m_nInserted;
}
void EdnBufHistory::getData(etk::Vector<int8_t> &deletedText)
{
deletedText = m_deletedText;
}

View File

@ -1,32 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license GPL v3 (see license file)
*/
#ifndef __EDN_BUFFER_HISTORY_H__
#define __EDN_BUFFER_HISTORY_H__
#include <etk/Vector.h>
class EdnBufHistory{
public:
EdnBufHistory(void);
EdnBufHistory(int32_t pos, int32_t nInserted, etk::Vector<int8_t> &deletedText);
~EdnBufHistory(void);
void set(int32_t pos, int32_t nInserted, etk::Vector<int8_t> &deletedText);
int32_t getPos(void);
int32_t getnbDeleted(void);
int32_t getnbInserted(void);
void getData(etk::Vector<int8_t> &deletedText);
private:
int32_t m_pos;
int32_t m_nInserted;
etk::Vector<int8_t> m_deletedText;
};
#endif

View File

@ -1,353 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license GPL v3 (see license file)
*/
#include <appl/debug.h>
#include <appl/global.h>
#include <EdnBuf.h>
#undef __class__
#define __class__ "EdnBuf{HighLight}"
void EdnBuf::setHLSystem(Highlight * newHLSystem)
{
if (m_Highlight != newHLSystem) {
m_Highlight = newHLSystem;
m_HLDataPass1.clear();
RegenerateHighLightAt(0, 0, m_data.size());
}
}
// TODO : Check this fuction it have too many conditionnal inside == > can do a better algo
void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdded)
{
//GTimeVal timeStart;
//g_get_current_time(&timeStart);
// prevent ERROR...
if (NULL == m_Highlight) {
return;
}
// prevent No data Call
if( 0 == nbDeleted
&& 0 == nbAdded)
{
return;
}
// normal case
//APPL_INFO("(pos="<<pos<<", nbDeleted="<<nbDeleted<<", nbAdded=" << nbAdded << "\");");
int32_t i;
/*
for (i=0; i< (int32_t)m_HLDataPass1.size(); i++) {
etk::UString ploppp;
if (NULL != m_HLDataPass1[i].patern ) {
ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->getName();
}
APPL_DEBUG("HighLight (previous) element id=" << i << " S=" << m_HLDataPass1[i].beginStart << " E=" << m_HLDataPass1[i].endStop << " patern name=" << ploppp );
}
*/
int32_t posEnd = pos + nbDeleted;
// search position of the old element to reparse IT...
int32_t startId;
int32_t stopId;
// clean data if needed
if (0 != m_HLDataPass1.size()) {
// find element previous
findMainHighLightPosition(pos, posEnd, startId, stopId, true);
// remove deprecated element
if( -1 == startId
&& -1 == stopId)
{
m_HLDataPass1.clear();
} else if(-1 == startId) {
if (0 == stopId){
m_HLDataPass1.Erase(0);
//APPL_DEBUG("1 * Erase 0");
} else {
m_HLDataPass1.EraseLen(0,stopId);
//APPL_DEBUG("2 * Erase 0->" << stopId);
}
} else if(-1 == stopId) {
//APPL_DEBUG("3 * Erase " << startId+1 << "-> end");
m_HLDataPass1.EraseLen(startId+1, m_HLDataPass1.size() - startId);
stopId = -1;
} else {
int32_t currentSize = m_HLDataPass1.size();
//APPL_DEBUG("4 * Erase " << startId+1 << "->" << stopId << " in " << currentSize << " elements" );
m_HLDataPass1.EraseLen(startId+1, stopId - startId);
if (stopId == currentSize-1) {
stopId = -1;
}
}
//APPL_DEBUG("new size=" << (int32_t)m_HLDataPass1.size()-1);
/*
for (i=0; i< (int32_t)m_HLDataPass1.size(); i++) {
etk::UString ploppp;
if (NULL != m_HLDataPass1[i].patern ) {
ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->getName();
}
APPL_DEBUG("HighLight (Middle) element id=" << i << " S=" << m_HLDataPass1[i].beginStart << " E=" << m_HLDataPass1[i].endStop << " patern name=" << ploppp );
}
*/
// update position after the range position :
int32_t elemStart;
if(-1 == startId) {
elemStart = 0;
} else {
elemStart = startId+1;
}
for (i=elemStart; i< (int32_t)m_HLDataPass1.size(); i++) {
//APPL_DEBUG("move element=" << i);
m_HLDataPass1[i].beginStart += nbAdded - nbDeleted;
m_HLDataPass1[i].beginStop += nbAdded - nbDeleted;
m_HLDataPass1[i].endStart += nbAdded - nbDeleted;
m_HLDataPass1[i].endStop += nbAdded - nbDeleted;
}
//Regenerate Element inside range
if( -1 == startId
&& -1 == stopId)
{
//APPL_DEBUG("******* Regenerate ALL");
generateHighLightAt(0, m_data.size());
} else if(-1 == startId) {
//APPL_DEBUG("******* Regenerate START");
generateHighLightAt(0, m_HLDataPass1[0].beginStart, 0);
} else if(-1 == stopId) {
//APPL_DEBUG("******* Regenerate STOP");
generateHighLightAt(m_HLDataPass1[m_HLDataPass1.size() -1].endStop, m_data.Size(), m_HLDataPass1.Size());
} else {
//APPL_DEBUG("******* Regenerate RANGE");
generateHighLightAt(m_HLDataPass1[startId].endStop, m_HLDataPass1[startId+1].beginStart, startId+1);
}
} else {
// Parse the new element ...
generateHighLightAt(0, m_data.size());
}
/*
for (i=0; i< (int32_t)m_HLDataPass1.size(); i++) {
etk::UString ploppp;
if (NULL != m_HLDataPass1[i].patern ) {
ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->getName();
}
APPL_DEBUG("HighLight (end) element id=" << i << " S=" << m_HLDataPass1[i].beginStart << " E=" << m_HLDataPass1[i].endStop << " patern name=" << ploppp );
}
*/
//GTimeVal timeStop;
//g_get_current_time(&timeStop);
//APPL_DEBUG("HL General = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s");
}
void EdnBuf::findMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t &startId, int32_t &stopId, bool backPreviousNotEnded)
{
startId = -1;
stopId = -1;
/* rules to start stop:
HighLight data ----
remove area ****
Start pos S
End pos E
Some Case :
----------- ------------ ------------- ----------
S **** E
----------- ------------ ------------- ----------
S ********** E
----------- ------------ ------------- ----------
S **** E
----------- ------------ ------------- ----------
S ********* E
----------- ------------ ------------- ----------
S ********************* E
----------- ------------ ------------- ----------
S ************************ E
----------- ------------ ------------- ----------
S ***************** E
----------- ------------ ------------- ----------
S *************** E
----------- ------------
S *************** E=-1
------------ ------------- ----------
S=-1 *************** E
*/
int32_t i;
for (i=0; i< (int32_t)m_HLDataPass1.size(); i++) {
if (m_HLDataPass1[i].endStop > startPos) {
break;
}
startId = i;
}
// go back while the previous element is not eneded
if (true == backPreviousNotEnded) {
for (i=startId; i >= 0; i--) {
if (m_HLDataPass1[i].notEnded == false) {
break;
}
startId = i-1;
}
}
int32_t elemStart;
if(-1 == startId) {
elemStart = 0;
} else {
elemStart = startId+1;
}
for (i=elemStart; i< (int32_t)m_HLDataPass1.size(); i++) {
if (m_HLDataPass1[i].beginStart > endPos)
{
stopId = i;
break;
}
}
/*
if (-1 != startId && startId < (int32_t)m_HLDataPass1.size()) {
APPL_DEBUG(" == > BEGIN : start="<<m_HLDataPass1[startId].beginStart<<", stop="<<m_HLDataPass1[startId].endStop<<" id=" << startId << "/" << (int32_t)m_HLDataPass1.size()-1);
} else {
APPL_DEBUG(" == > BEGIN : start=???, stop=??? id=" << startId);
}
if (-1 != stopId && stopId < (int32_t)m_HLDataPass1.size()) {
APPL_DEBUG(" == > END : start="<<m_HLDataPass1[stopId].beginStart<<", stop="<<m_HLDataPass1[stopId].endStop<<" id=" << stopId<< "/" << (int32_t)m_HLDataPass1.size()-1);
} else {
APPL_DEBUG(" == > END : start=???, stop=??? id=" << stopId);
}
*/
}
void EdnBuf::generateHighLightAt(int32_t pos, int32_t endPos, int32_t addinPos)
{
if (NULL == m_Highlight) {
return;
}
//APPL_DEBUG("area : ("<<pos<<","<<endPos<<") insert at : " << addinPos);
m_Highlight->Parse(pos, endPos, m_HLDataPass1, addinPos, m_data);
}
void EdnBuf::CleanHighLight(void)
{
// remove all element in the list...
m_HLDataPass1.clear();
}
appl::ColorInfo *EdnBuf::getElementColorAtPosition(int32_t pos, int32_t &starPos)
{
int32_t i;
int32_t start = etk_max(0, starPos-1);
for (i=start; i<(int32_t)m_HLDataPass1.size(); i++) {
starPos = i;
if( m_HLDataPass1[i].beginStart <= pos
&& m_HLDataPass1[i].endStop > pos)
{
return &m_HLDataPass1[i];
}
if(m_HLDataPass1[i].beginStart > pos) {
return NULL;
}
}
return NULL;
}
void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart, int32_t nbLines)
{
MData.posHLPass1 = 0;
MData.posHLPass2 = 0;
if (NULL == m_Highlight) {
return;
}
//GTimeVal timeStart;
//g_get_current_time(&timeStart);
HLStart = StartOfLine(HLStart);
MData.HLData.clear();
int32_t HLStop = CountForwardNLines(HLStart, nbLines);
int32_t startId, stopId;
// find element previous
findMainHighLightPosition(HLStart, HLStop, startId, stopId, true);
int32_t k;
//APPL_DEBUG("List of section between : "<< startId << " & " << stopId);
int32_t endSearch = stopId+1;
if (-1 == stopId) {
endSearch = m_HLDataPass1.size();
}
for (k=etk_max(startId, 0); k<endSearch; k++) {
// empty section :
if (0 == k) {
if (HLStart < m_HLDataPass1[k].beginStart) {
//APPL_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 {
//APPL_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 :
//APPL_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( k < (int32_t)m_HLDataPass1.size()) {
if (m_HLDataPass1.size() != 0) {
//APPL_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 {
//APPL_DEBUG(" == > (empty section 4 ) k="<<k<<" start=0 stop="<<HLStop );
m_Highlight->Parse2(0,
HLStop,
MData.HLData,
m_data);
}
}
//GTimeVal timeStop;
//g_get_current_time(&timeStop);
//APPL_DEBUG("Display reAnnalyse = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s");
}
appl::ColorInfo * EdnBuf::getElementColorAtPosition(displayHLData_ts & MData, int32_t pos)
{
int32_t i;
int32_t start = etk_max(0, MData.posHLPass2-1);
for (i=start; i<(int32_t)MData.HLData.size(); i++) {
MData.posHLPass2 = i;
if( MData.HLData[i].beginStart <= pos
&& MData.HLData[i].endStop > pos)
{
return &MData.HLData[i];
}
if(MData.HLData[i].beginStart > pos) {
return getElementColorAtPosition(pos, MData.posHLPass1);
}
}
return getElementColorAtPosition(pos, MData.posHLPass1);
}

View File

@ -1,116 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license GPL v3 (see license file)
*/
#include <appl/debug.h>
#include <appl/global.h>
#include <EdnBuf.h>
#undef __class__
#define __class__ "EdnBuf{History}"
int32_t EdnBuf::Undo(void)
{
int32_t nbElement = m_historyUndo.size();
//APPL_DEBUG("EdnBuf::Undo Request id="<<nbElement);
int32_t posDest = -1;
if (0 == nbElement) {
// nothing to do ...
APPL_ERROR("EdnBuf::Undo No more History");
return -1;
}
nbElement--;
if (m_historyUndo[nbElement] == NULL) {
APPL_ERROR("EdnBuf::Undo find empty history == > remove it");
m_historyUndo.popBack();
return -1;
}
int32_t pos = m_historyUndo[nbElement]->getPos();
int32_t nbDeleted = m_historyUndo[nbElement]->getnbDeleted();
int32_t nbInserted = m_historyUndo[nbElement]->getnbInserted();
etk::Vector<int8_t> deletedText;
m_historyUndo[nbElement]->getData(deletedText);
m_isUndoProcessing = true;
if (0 == nbInserted) {
// just add data at position ...
if (0 == nbDeleted) {
APPL_DEBUG("EdnBuf::Undo nothing to do in UNDO");
} else {
insert(pos, deletedText);
posDest = pos + nbDeleted;
}
} else {
if (0 == nbDeleted) {
// only remove data
remove(pos, pos+nbInserted);
posDest = pos;
} else {
// replace data
Replace(pos, pos+nbInserted, deletedText);
posDest = pos + nbDeleted;
}
}
// remove element in the list :
delete(m_historyUndo[nbElement]);
m_historyUndo.popBack();
m_isUndoProcessing = false;
return posDest;
}
int32_t EdnBuf::Redo(void)
{
int32_t nbElement = m_historyRedo.size();
//APPL_DEBUG("EdnBuf::Redo Request id="<<nbElement);
int32_t posDest = -1;
if (0 == nbElement) {
// nothing to do ...
APPL_DEBUG("EdnBuf::Redo No more History");
return -1;
}
nbElement--;
if (m_historyRedo[nbElement] == NULL) {
APPL_ERROR("EdnBuf::Redo find empty history == > remove it");
m_historyRedo.popBack();
return -1;
}
int32_t pos = m_historyRedo[nbElement]->getPos();
int32_t nbDeleted = m_historyRedo[nbElement]->getnbDeleted();
int32_t nbInserted = m_historyRedo[nbElement]->getnbInserted();
etk::Vector<int8_t> deletedText;
m_historyRedo[nbElement]->getData(deletedText);
m_isRedoProcessing = true;
if (0 == nbInserted) {
// just add data at position ...
if (0 == nbDeleted) {
APPL_ERROR("EdnBuf::Redo nothing to do in REDO");
} else {
insert(pos, deletedText);
posDest = pos + nbDeleted;
}
} else {
if (0 == nbDeleted) {
// only remove data
remove(pos, pos+nbInserted);
posDest = pos;
} else {
// replace data
Replace(pos, pos+nbInserted, deletedText);
posDest = pos + nbDeleted;
}
}
// remove element in the list :
delete(m_historyRedo[nbElement]);
m_historyRedo.popBack();
m_isRedoProcessing = false;
return posDest;
}

View File

@ -1,293 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license GPL v3 (see license file)
*/
#include <appl/debug.h>
#include <appl/global.h>
#include <EdnBuf.h>
#undef __class__
#define __class__ "EdnBuf{Selection}"
/**
* @brief
*
* @param[in,out] ---
* @param[in,out] ---
*
* @return ---
*
*/
bool EdnBuf::SelectHasSelection(void)
{
return m_selectionList.selected;
}
/**
* @brief
*
* @param[in,out] ---
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::Select(int32_t start, int32_t end)
{
//selection oldSelection = m_selectionList[select];
m_selectionList.selected = start != end;
m_selectionList.zeroWidth = (start == end) ? true : false;
m_selectionList.rectangular = false;
m_selectionList.start = etk_min(start, end);
m_selectionList.end = etk_max(start, end);
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::Unselect(void)
{
//selection oldSelection = m_selectionList[select];
m_selectionList.selected = false;
m_selectionList.zeroWidth = false;
}
/**
* @brief
*
* @param[in,out] ---
* @param[in,out] ---
* @param[in,out] ---
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::RectSelect(int32_t start, int32_t end, int32_t rectStart, int32_t rectEnd)
{
m_selectionList.selected = rectStart < rectEnd;
m_selectionList.zeroWidth = (rectStart == rectEnd) ? false : true;
m_selectionList.rectangular = true;
m_selectionList.start = start;
m_selectionList.end = end;
m_selectionList.rectStart = rectStart;
m_selectionList.rectEnd = rectEnd;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
bool EdnBuf::getSelectionPos(int32_t &start, int32_t &end, bool &isRect, int32_t &rectStart, int32_t &rectEnd)
{
/* Always fill in the parameters (zero-width can be requested too). */
isRect = m_selectionList.rectangular;
start = m_selectionList.start;
end = m_selectionList.end;
if (m_selectionList.rectangular) {
rectStart = m_selectionList.rectStart;
rectEnd = m_selectionList.rectEnd;
}
return m_selectionList.selected;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::getSelectionText(etk::Vector<int8_t> &text)
{
int32_t start, end, rectStart, rectEnd;
bool isRect;
// remove output data
text.clear();
bool isSelected = getSelectionPos(start, end, isRect, rectStart, rectEnd);
// No data selected ...
if (false == isSelected) {
return;
}
// Rectangular selection
if (true == isRect) {
//GetTextInRect(start, end, rectStart, rectEnd, text);
// TODO : ...
} else {
getRange(start, end, text);
}
}
void EdnBuf::getSelectionText(etk::UString &text)
{
int32_t start, end, rectStart, rectEnd;
bool isRect;
// remove output data
text = "";
bool isSelected = getSelectionPos(start, end, isRect, rectStart, rectEnd);
// No data selected ...
if (false == isSelected) {
return;
}
// Rectangular selection
if (true == isRect) {
//GetTextInRect(start, end, rectStart, rectEnd, text);
// TODO : ...
} else {
getRange(start, end, text);
}
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::removeSelected(void)
{
int32_t start, end;
int32_t rectStart, rectEnd;
bool isRect;
bool isSelected = getSelectionPos(start, end, isRect, rectStart, rectEnd);
// No data selected ...
if (false == isSelected) {
return;
}
// Rectangular selection
if (true == isRect) {
//RemoveRect(start, end, rectStart, rectEnd);
// TODO : ...
} else {
remove(start, end);
}
Unselect();
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
int32_t EdnBuf::ReplaceSelected(etk::Vector<int8_t> &text)
{
int32_t start, end, rectStart, rectEnd;
bool isRect;
bool isSelected = getSelectionPos(start, end, isRect, rectStart, rectEnd);
// No data selected ...
if (false == isSelected) {
return 0;
}
int32_t returnSize = 0;
// Rectangular selection
if (true == isRect) {
//ReplaceRect(start, end, rectStart, rectEnd, text);
// TODO : ...
} else {
returnSize = Replace(start, end, text);
}
// Clean selection
m_selectionList.selected = false;
return returnSize;
}
int32_t EdnBuf::ReplaceSelected(etk::UString &text)
{
int32_t start, end, rectStart, rectEnd;
bool isRect;
bool isSelected = getSelectionPos(start, end, isRect, rectStart, rectEnd);
// No data selected ...
if (false == isSelected) {
return 0;
}
int32_t returnSize = 0;
// Rectangular selection
if (true == isRect) {
//ReplaceRect(start, end, rectStart, rectEnd, text);
// TODO : ...
} else {
returnSize = Replace(start, end, text);
}
// Clean selection
m_selectionList.selected = false;
return returnSize;
}
/*
** update an individual selection for changes in the corresponding text
*/
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::updateSelection(int32_t pos, int32_t nDeleted, int32_t nInserted)
{
if( ( false == m_selectionList.selected
&& false == m_selectionList.zeroWidth)
|| pos > m_selectionList.end )
{
return;
}
if (pos+nDeleted <= m_selectionList.start) {
m_selectionList.start += nInserted - nDeleted;
m_selectionList.end += nInserted - nDeleted;
} else if( pos <= m_selectionList.start
&& pos+nDeleted >= m_selectionList.end)
{
m_selectionList.start = pos;
m_selectionList.end = pos;
m_selectionList.selected = false;
m_selectionList.zeroWidth = false;
} else if( pos <= m_selectionList.start
&& pos+nDeleted < m_selectionList.end)
{
m_selectionList.start = pos;
m_selectionList.end = nInserted + m_selectionList.end - nDeleted;
} else if(pos < m_selectionList.end) {
m_selectionList.end += nInserted - nDeleted;
if (m_selectionList.end <= m_selectionList.start) {
m_selectionList.selected = false;
}
}
}

View File

@ -13,17 +13,13 @@
#include <ewol/renderer/EObjectManager.h>
#undef __class__
#define __class__ "classBufferManager"
#if 0
#define __class__ "BufferManager"
class classBufferManager: public ewol::EObject {
public:
// Constructeur
classBufferManager(void);
~classBufferManager(void);
const char * const getObjectType(void)
{
return "ApplBufferManager";
}
public:
virtual void onReceiveMessage(const ewol::EMessage& _msg);
private:
@ -398,123 +394,35 @@ int32_t classBufferManager::witchBuffer(int32_t iEmeElement) {
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace part :
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
appl::Buffer* get(const etk::UString& _filename);
appl::Buffer* get(esize_t _bufferID);
esize_t size(void):
static classBufferManager * localManager = NULL;
#endif
void BufferManager::init(void) {
/*
if (NULL != localManager) {
EWOL_ERROR("classBufferManager == > already exist, just unlink the previous ...");
localManager = NULL;
}
localManager = new classBufferManager();
if (NULL == localManager) {
EWOL_CRITICAL("Allocation of classBufferManager not done ...");
}
*/
}
void BufferManager::unInit(void) {
/*
if (NULL == localManager) {
EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ...");
return;
}
delete(localManager);
localManager = NULL;
*/
}
int32_t BufferManager::getSelected(void) {
/*
if (NULL == localManager) {
EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ...");
return -1;
appl::BufferManager* appl::BufferManager::keep(void) {
//EWOL_INFO("KEEP : appl::GlyphPainting : file : \"" << _filename << "\"");
appl::GlyphPainting* object = static_cast<appl::GlyphPainting*>(getManager().localKeep("???BufferManager???"));
if (NULL != object) {
return object;
}
return localManager->getSelected();
*/
return -1;
}
appl::Buffer * BufferManager::get(int32_t BufferID) {
/*
if (NULL == localManager) {
EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ...");
// this element create a new one every time ....
EWOL_INFO("CREATE : appl::BufferManager: ???BufferManager???");
object = new appl::BufferManager();
if (NULL == object) {
EWOL_ERROR("allocation error of a resource : ???BufferManager???");
return NULL;
}
return localManager->get(BufferID);
*/
return NULL;
getManager().localAdd(object);
return object;
}
bool BufferManager::exist(int32_t BufferID) {
/*
if (NULL == localManager) {
EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ...");
return false;
void appl::GlyphPainting::release(appl::BufferManager*& _object) {
if (NULL == _object) {
return;
}
return localManager->exist(BufferID);
*/
return false;
ewol::Resource* object2 = static_cast<ewol::Resource*>(_object);
getManager().release(object2);
_object = NULL;
}
bool BufferManager::exist(etk::FSNode &myFile) {
/*
if (NULL == localManager) {
EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ...");
return false;
}
return localManager->exist(myFile);
*/
return false;
}
int32_t BufferManager::getId(etk::FSNode &myFile) {
/*
if (NULL == localManager) {
EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ...");
return -1;
}
return localManager->getId(myFile);
*/
return -1;
}
uint32_t BufferManager::size(void) {
/*
if (NULL == localManager) {
EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ...");
return 0;
}
return localManager->size();
*/
return 0;
}
uint32_t BufferManager::sizeOpen(void) {
/*
if (NULL == localManager) {
EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ...");
return 0;
}
return localManager->sizeOpen();
*/
return 0;
}
int32_t BufferManager::witchBuffer(int32_t iEmeElement) {
/*
if (NULL == localManager) {
EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ...");
return -1;
}
return localManager->witchBuffer(iEmeElement);
*/
return -1;
}

View File

@ -0,0 +1,43 @@
/**
* @author Edouard DUPIN
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license GPL v3 (see license file)
*/
#ifndef __BUFFER_MANAGER_H__
#define __BUFFER_MANAGER_H__
#include <Buffer.h>
#include <appl/globalMsg.h>
#include <ewol/widget/Widget.h>
#include <ewol/resources/Resource.h>
namespace appl {
class BufferManager : public ewol::Resource {
protected:
void BufferManager(void);
void ~BufferManager(void);
public:
appl::Buffer* get(const etk::UString& _filename);
appl::Buffer* get(esize_t _bufferID);
esize_t size(void):
/**
* @brief keep the resource pointer.
* @note Never free this pointer by your own...
* @param[in] _filename Name of the configuration file.
* @return pointer on the resource or NULL if an error occured.
*/
static appl::BufferManager* keep(void);
/**
* @brief release the keeped resources
* @param[in,out] reference on the object pointer
*/
static void release(appl::BufferManager*& _object);
};
};
#endif

View File

@ -8,7 +8,7 @@
#include <appl/debug.h>
#include <appl/global.h>
#include <appl/glyphDecoration/GlyphDecoration.h>
#include <appl/GlyphDecoration.h>
#undef __class__
#define __class__ "GlyphDecoration"

View File

@ -8,7 +8,7 @@
#include <appl/debug.h>
#include <appl/global.h>
#include <appl/glyphDecoration/GlyphPainting.h>
#include <appl/GlyphPainting.h>
#include <ejson/ejson.h>
#include <etk/os/FSNode.h>
#include <ewol/resources/ResourceManager.h>
@ -50,7 +50,7 @@ void appl::GlyphPainting::reload(void) {
etk::UString foreground = tmpObj->getStringValue("foreground", "#000F");
bool italic = tmpObj->getBooleanValue("italic", false);
bool bold = tmpObj->getBooleanValue("bold", false);
APPL_DEBUG("find new color : '" << name << "' fg='" << foreground << "' bg='" << background << "' italic='" << italic << "' bold='" << bold << "'");
APPL_VERBOSE("find new color : '" << name << "' fg='" << foreground << "' bg='" << background << "' italic='" << italic << "' bold='" << bold << "'");
bool findElement = false;
for (esize_t jjj=0; jjj<m_list.size(); ++jjj) {
if (m_list[jjj].getName() != name) {

View File

@ -12,7 +12,7 @@
#include <etk/types.h>
#include <ewol/debug.h>
#include <ewol/resources/Resource.h>
#include <appl/glyphDecoration/GlyphDecoration.h>
#include <appl/GlyphDecoration.h>
namespace appl {
class GlyphPainting : public ewol::Resource {

View File

@ -1,480 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license GPL v3 (see license file)
*/
#include <CodeView.h>
#include <appl/debug.h>
#include <appl/global.h>
#include <CodeView.h>
#include <BufferManager.h>
#include <ColorizeManager.h>
#include <ewol/clipBoard.h>
#include <SearchData.h>
#include <ewol/widget/WidgetManager.h>
#include <ewol/renderer/EObject.h>
#undef __class__
#define __class__ "CodeView"
void CodeView::init(void)
{
m_label = "CodeView is disable ...";
m_bufferID = -1;
m_buttunOneSelected = false;
m_lineNumberList.clear();
m_textColorFg = etk::color::black;
m_textColorBg = etk::color::black;
m_textColorBg.setA(0x40);
setCanHaveFocus(true);
RegisterMultiCast(ednMsgBufferId);
RegisterMultiCast(ednMsgGuiCopy);
RegisterMultiCast(ednMsgGuiPaste);
RegisterMultiCast(ednMsgGuiCut);
RegisterMultiCast(ednMsgGuiRedo);
RegisterMultiCast(ednMsgGuiUndo);
RegisterMultiCast(ednMsgGuiRm);
RegisterMultiCast(ednMsgGuiSelect);
RegisterMultiCast(ednMsgGuiChangeCharset);
RegisterMultiCast(ednMsgGuiFind);
RegisterMultiCast(ednMsgGuiReplace);
RegisterMultiCast(ednMsgGuiGotoLine);
setLimitScrolling(0.2);
ShortCutAdd("ctrl+w", ednMsgGuiRm, "Line");
ShortCutAdd("ctrl+shift+w", ednMsgGuiRm, "Paragraph");
ShortCutAdd("ctrl+x", ednMsgGuiCut, "STD");
ShortCutAdd("ctrl+c", ednMsgGuiCopy, "STD");
ShortCutAdd("ctrl+v", ednMsgGuiPaste, "STD");
ShortCutAdd("ctrl+a", ednMsgGuiSelect, "ALL");
ShortCutAdd("ctrl+shift+a", ednMsgGuiSelect, "NONE");
}
CodeView::CodeView(etk::UString fontName, int32_t fontSize) :
m_displayText(fontName, fontSize)
{
init();
}
CodeView::CodeView(void)
{
init();
}
CodeView::~CodeView(void)
{
}
/**
* @brief Check if the number of reference buffer is good or not ...
* @param[in] bufferID id of the current Buffer that needed to have a reference
*/
void CodeView::updateNumberOfLineReference(int32_t bufferID)
{
vec2 tmpCoord(0,0);
if (m_lineNumberList.size() <= bufferID) {
// update the number of elements :
for (int32_t iii=m_lineNumberList.size(); iii <= bufferID; iii++) {
// add start line at 0 :
m_lineNumberList.pushBack(tmpCoord);
}
}
}
bool CodeView::calculateMinSize(void)
{
m_minSize.setValue(50,50);
return true;
}
void CodeView::calculateMaxSize(void)
{
m_maxSize.setX(2048);
int32_t letterHeight = m_displayText.calculateSize(etk::UChar('A')).y();
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
m_maxSize.setY(tmpBuffer->getNumberOfLine() * letterHeight);
} else {
m_maxSize.setY(50);
}
}
void CodeView::onDraw(void)
{
m_displayDrawing.draw();
m_displayText.draw();
WidgetScrooled::onDraw();
}
void CodeView::onRegenerateDisplay(void)
{
if (true == needRedraw()) {
int64_t startTime = ewol::getTime();
// For the scrooling windows
calculateMaxSize();
m_displayDrawing.clear();
m_displayText.clear();
// reset the background :
m_displayDrawing.setPos(vec3(-2048, -2048, 0));
m_displayDrawing.setColor(ColorizeManager::get(COLOR_CODE_BASIC_BG));
m_displayDrawing.rectangleWidth(vec3(4096, 4096, 0) );
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if( NULL != tmpBuffer
&& true == tmpBuffer->needToUpdateDisplayPosition() ) {
vec2 borderWidth = BufferManager::get(m_bufferID)->getBorderSize();
bool centerRequested = false;
// TODO : set it back ...
vec2 currentPosition = BufferManager::get(m_bufferID)->getPosition(999/*m_OObjectTextNormal.getFontID()*/, centerRequested);
setScrollingPositionDynamic(borderWidth, currentPosition, centerRequested);
} // else : nothing to do ...
// generate the objects :
if (-1 == m_bufferID) {
m_displayText.setTextAlignement(10, m_size.x()-20, ewol::Text::alignLeft);
m_displayDrawing.setColor(0x00000022);
m_displayDrawing.setPos(vec3(10, 0, 0));
m_displayDrawing.rectangle(vec3((int32_t)m_size.x()-20, 1500, 0) );
m_displayText.setRelPos(vec3(10, 0, 0));
// nothing to display :
etk::UString tmpString("<br/>\n"
"<font color=\"red\">\n"
" <b>\n"
" edn - Editeur De N'ours\n"
" </b>\n"
"</font>\n"
"<br/>\n"
"<br/>\n"
"<font color=\"indigo\">\n"
" <i>\n"
" No Buffer Availlable to display\n"
" </i>\n"
"</font>\n");
m_displayText.setPos(vec3(0.0f, m_size.y(), 0.0f) );
m_displayText.forceLineReturn();
m_displayText.printDecorated(tmpString);
} else {
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->display(m_displayText, m_originScrooled.x(), m_originScrooled.y(), m_size.x(), m_size.y());
}
// set the current size of the windows
setMaxSize(BufferManager::get(m_bufferID)->getMaxSize());
}
int64_t stopTime = ewol::getTime();
APPL_DEBUG("Display Code Generation = " << stopTime - startTime << " micro-s");
// call the herited class...
WidgetScrooled::onRegenerateDisplay();
}
}
bool CodeView::onEventEntry(const ewol::EventEntry& _event)
{
if (_event.getType() == ewol::keyEvent::keyboardChar) {
//APPL_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent);
if (_event.getStatus() == ewol::keyEvent::statusDown) {
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->addChar(_event.getChar());
}
markToRedraw();
}
return true;
}
// move events ...
if (_event.getStatus() == ewol::keyEvent::statusDown) {
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->cursorMove(_event.getType());
}
markToRedraw();
}
return true;
}
void CodeView::onEventClipboard(ewol::clipBoard::clipboardListe_te _clipboardID)
{
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->Paste(_clipboardID);
}
markToRedraw();
}
bool CodeView::onEventInput(const ewol::EventInput& _event)
{
vec2 relativePos = relativePosition(_event.getPos());
//APPL_DEBUG("Event at pos : " << _event.getPos() << " == > " << relativePos );
// corection for the openGl abstraction
//relativePos.y = m_size.y - relativePos.y;
vec2 limitedPos = relativePos;
limitedPos.setValue(etk_avg(1, limitedPos.x(), m_size.x()-1),
etk_avg(1, limitedPos.y(), m_size.y()-1));
if (true == WidgetScrooled::onEventInput(_event)) {
keepFocus();
// nothing to do ... done on upper widget ...
return true;
}
if (m_bufferID < 0) {
return false;
}
if (1 == _event.getId()) {
if (ewol::keyEvent::typeMouse == _event.getType()) {
if (ewol::keyEvent::statusDown == _event.getStatus()) {
m_buttunOneSelected = true;
keepFocus();
// TODO : set something good
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->MouseEvent(limitedPos);
}
markToRedraw();
} else if (ewol::keyEvent::statusUp == _event.getStatus()) {
m_buttunOneSelected = false;
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->Copy(ewol::clipBoard::clipboardSelection);
}
markToRedraw();
}
}
if (ewol::keyEvent::statusSingle == _event.getStatus()) {
if (ewol::keyEvent::typeMouse == _event.getType()) {
keepFocus();
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->MouseEvent(limitedPos);
}
markToRedraw();
} else {
// nothing to do ...
}
} else if (ewol::keyEvent::statusDouble == _event.getStatus()) {
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->MouseEventDouble();
}
markToRedraw();
} else if (ewol::keyEvent::statusTriple == _event.getStatus()) {
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->MouseEventTriple();
}
markToRedraw();
} else if (ewol::keyEvent::statusMove == _event.getStatus()) {
if (true == m_buttunOneSelected) {
int xxx, yyy;
xxx = relativePos.x();
yyy = relativePos.y();
if (xxx<0) {
xxx = 0;
}
if (yyy<0) {
yyy = 0;
}
//APPL_INFO("mouse-motion BT1 %d, %d", xxx, yyy);
// TODO : set something good
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->MouseSelectFromCursorTo(limitedPos);
}
markToRedraw();
}
}
} else if (2 == _event.getId()) {
if (ewol::keyEvent::statusSingle == _event.getStatus()) {
// TODO : set something good
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->MouseEvent(limitedPos);
}
ewol::clipBoard::Request(ewol::clipBoard::clipboardSelection);
keepFocus();
}
}
return true;
}
void CodeView::onReceiveMessage(const ewol::EMessage& _msg)
{
widget::WidgetScrooled::onReceiveMessage(_msg);
APPL_DEBUG("Extern Event : " << _msg.getCaller() << " type : " << _msg.GetMessage() << " data=\"" << _msg.GetData() << "\"");
if(_msg.getMessage() == ednMsgBufferId) {
//keep the reference of the display offset :
if( m_bufferID >= 0
&& m_bufferID < m_lineNumberList.size()) {
m_lineNumberList[m_bufferID] = m_originScrooled;
}
int32_t bufferID = 0;
sscanf(_msg.getData().c_str(), "%d", &bufferID);
APPL_INFO("Select a new Buffer ... " << bufferID);
// set the new buffer ID
m_bufferID = bufferID;
// update the start display position...
updateNumberOfLineReference(m_bufferID);
// set back if needed the display position ...
if( m_bufferID >= 0
&& m_bufferID < m_lineNumberList.size()) {
m_originScrooled = m_lineNumberList[m_bufferID];
}
} else if (_msg.getMessage() == ednMsgGuiCopy) {
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->Copy(ewol::clipBoard::clipboardStd);
}
} else if (_msg.getMessage() == ednMsgGuiCut) {
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->Cut(ewol::clipBoard::clipboardStd);
}
} else if (_msg.getMessage() == ednMsgGuiPaste) {
ewol::clipBoard::Request(ewol::clipBoard::clipboardStd);
} else if (_msg.getMessage() == ednMsgGuiUndo) {
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->Undo();
}
} else if (_msg.getMessage() == ednMsgGuiRedo) {
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->Redo();
}
} else if (_msg.getMessage() == ednMsgGuiRm) {
// data : "Word" "Line" "Paragraph"
if (_msg.getData() == "Word") {
APPL_WARNING(" on event " << _msg.getMessage() << " data=\"" << _msg.GetData() << "\" == > not coded" );
} else if (_msg.getData() == "Line") {
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->removeLine();
}
} else if (_msg.getData() == "Paragraph") {
APPL_WARNING(" on event " << _msg.getMessage() << " data=\"" << _msg.GetData() << "\" == > not coded" );
} else {
APPL_ERROR(" on event " << _msg.getMessage() << " unknow data=\"" << _msg.GetData() << "\"" );
}
} else if (_msg.getMessage() == ednMsgGuiSelect) {
// data : "ALL" "NONE"
if (_msg.getData() == "ALL") {
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->SelectAll();
}
} else if (_msg.getData() == "NONE") {
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->SelectNone();
}
} else {
APPL_ERROR(" on event " << _msg.getMessage() << " unknow data=\"" << _msg.GetData() << "\"" );
}
} else if (_msg.getMessage() == ednMsgGuiChangeCharset) {
// data : "UTF-8" "ISO-8859-1" "ISO-8859-15"
if (_msg.getData() == "UTF-8") {
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->setCharset(unicode::EDN_CHARSET_UTF8);
}
} else if (_msg.getData() == "ISO-8859-1") {
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->setCharset(unicode::EDN_CHARSET_ISO_8859_1);
}
} else if (_msg.getData() == "ISO-8859-15") {
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->setCharset(unicode::EDN_CHARSET_ISO_8859_15);
}
} else {
APPL_ERROR(" on event " << _msg.getMessage() << " unknow data=\"" << _msg.GetData() << "\"" );
}
} else if (_msg.getMessage() == ednMsgGuiFind) {
etk::UString myDataString;
SearchData::getSearch(myDataString);
if (_msg.getData() == "Next") {
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->Search(myDataString, false, SearchData::getCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
}
} else if (_msg.getData() == "Previous") {
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->Search(myDataString, true, SearchData::getCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
}
}
} else if (_msg.getMessage() == ednMsgGuiReplace) {
etk::UString myDataString;
SearchData::getReplace(myDataString);
if (_msg.getData() == "Normal") {
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->Replace(myDataString);
}
} else if (_msg.getData() == "All") {
}
} else if (_msg.getMessage() == ednMsgGuiGotoLine) {
int32_t lineID = 0;
sscanf(_msg.getData().c_str(), "%d", &lineID);
APPL_INFO("Goto line : " << lineID);
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->JumpAtLine(lineID);
}
}
// force redraw of the widget
markToRedraw();
}
void CodeView::onGetFocus(void)
{
/*
ewol::widgetMessageMultiCast::Send(getWidgetId(), ednMsgBufferId, m_bufferID);
*/
ShowKeyboard();
APPL_INFO("Focus - In");
}
void CodeView::onLostFocus(void)
{
HideKeyboard();
APPL_INFO("Focus - out");
}
void CodeView::setFontSize(int32_t size)
{
m_displayText.setFontSize(size);
setScrollingSize(size*3.0*1.46); // 1.46 is a magic nmber ...
}
void CodeView::setFontName(etk::UString fontName)
{
m_displayText.setFontName(fontName);
}

View File

@ -1,59 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license GPL v3 (see license file)
*/
#ifndef __CODE_VIEW_H__
#define __CODE_VIEW_H__
#include <appl/debug.h>
#include <CodeView.h>
#include <BufferManager.h>
#include <appl/globalMsg.h>
#include <ewol/widget/WidgetScrolled.h>
#include <ewol/compositing/Text.h>
#include <ewol/compositing/Drawing.h>
class CodeView :public widget::WidgetScrooled
{
public:
void init(void);
CodeView(etk::UString fontName, int32_t fontSize);
CodeView(void);
virtual ~CodeView(void);
private:
etk::UString m_label;
etk::Color<> m_textColorFg; //!< Text color
etk::Color<> m_textColorBg; //!< Background color
int32_t m_bufferID;
bool m_buttunOneSelected;
etk::Vector<vec2 > m_lineNumberList;
void updateNumberOfLineReference(int32_t bufferID);
// drawing elements :
ewol::Text m_displayText;
ewol::drawing m_displayDrawing;
public:
void setFontSize(int32_t size);
void setFontName(etk::UString fontName);
private:
void calculateMaxSize(void);
protected: // derived function
virtual void onDraw(void);
public: // Derived function
const char * const getObjectType(void) { return "ApplCodeView"; };
virtual bool calculateMinSize(void);
virtual void onRegenerateDisplay(void);
virtual void onReceiveMessage(const ewol::EMessage& _msg);
virtual bool onEventInput(const ewol::EventInput& _event);
virtual bool onEventEntry(const ewol::EventEntry& _event);
virtual void onEventClipboard(ewol::clipBoard::clipboardListe_te clipboardID);
virtual void onGetFocus(void);
virtual void onLostFocus(void);
};
#endif

View File

@ -12,8 +12,8 @@
#include <appl/debug.h>
#include <appl/globalMsg.h>
#include <BufferView.h>
#include <BufferManager.h>
#include <appl/Gui/BufferView.h>
#include <appl/BufferManager.h>
#include <ewol/widget/Label.h>
class MainWindows : public ewol::Windows {

View File

@ -9,8 +9,8 @@
#include "appl/global.h"
#include "Search.h"
#include "SearchData.h"
#include "BufferManager.h"
#include "MainWindows.h"
#include "appl/BufferManager.h"
#include "appl/Gui/MainWindows.h"
#include "appl/globalMsg.h"
#include <ewol/widget/Button.h>

View File

@ -16,7 +16,7 @@
#include <ewol/widget/WidgetManager.h>
#include <ewol/renderer/EObject.h>
#include <appl/Buffer/TextPluginManager.h>
#include <appl/TextPluginManager.h>
#undef __class__
#define __class__ "TextViewer"
@ -52,14 +52,14 @@ appl::TextViewer::TextViewer(const etk::UString& _fontName, int32_t _fontSize) :
m_colorNormal = m_paintingProperties->request("normal");
// by default we load an example object:
/*
m_buffer = new appl::Buffer();
if (m_buffer == NULL) {
APPL_ERROR("can not create buffer ... ");
return;
}
m_buffer->loadFile("./example.txt");
*/
appl::textPluginManager::connect(*this);
}
@ -241,7 +241,8 @@ void appl::TextViewer::onRegenerateDisplay(void) {
}
m_buffer->expand(countColomn, *it, stringToDisplay);
if (it >= selectPosStart && it < selectPosStop) {
m_displayText.setColorBg((*m_paintingProperties)[m_colorSelection].getForeground());
m_displayText.setColor((*m_paintingProperties)[m_colorSelection].getForeground());
m_displayText.setColorBg((*m_paintingProperties)[m_colorSelection].getBackground());
}
//APPL_DEBUG("display : '" << currentValue << "' == > '" << stringToDisplay << "'");
m_displayText.print(stringToDisplay);

View File

@ -10,7 +10,7 @@
#define __APPL_TEXT_VIEWER_H__
#include <appl/debug.h>
#include <appl/Buffer/Buffer.h>
#include <appl/Buffer.h>
#include <appl/globalMsg.h>
#include <ewol/widget/WidgetScrolled.h>

View File

@ -26,8 +26,8 @@ namespace appl {
};
#include <etk/os/FSNode.h>
#include <HighlightPattern.h>
#include <appl/glyphDecoration/GlyphPainting.h>
#include <appl/HighlightPattern.h>
#include <appl/GlyphPainting.h>
#include <etk/Buffer.h>
#include <exml/exml.h>

View File

@ -8,7 +8,7 @@
#include <appl/debug.h>
#include <appl/global.h>
#include <appl/Highlight/HighlightManager.h>
#include <appl/HighlightManager.h>
#include <ewol/renderer/EObject.h>
#include <ewol/renderer/EObjectManager.h>
@ -47,12 +47,14 @@ void appl::highlightManager::init(void) {
}
}
// display :
/*
for (esize_t iii = 0; iii < hlList.size(); ++iii) {
if (hlList[iii] == NULL) {
continue;
}
hlList[iii]->display();
}
*/
}
void appl::highlightManager::unInit(void) {

View File

@ -65,7 +65,7 @@ void appl::HighlightPattern::setEscapeChar(const etk::UChar& _EscapeChar) {
void appl::HighlightPattern::setColorGlyph(etk::UString& _colorName) {
m_colorName = _colorName;
m_colorId = m_glyphPainting->request(m_colorName);
APPL_DEBUG("Resuest color name '" << m_colorName << "' => id=" << m_colorId);
APPL_VERBOSE("Resuest color name '" << m_colorName << "' => id=" << m_colorId);
}
void appl::HighlightPattern::display(void) {

View File

@ -15,7 +15,7 @@ class HighlightPattern;
#include <etk/RegExp.h>
#include <glyphDecoration/GlyphPainting.h>
#include <appl/GlyphPainting.h>
#include <etk/Vector.h>
#include <exml/exml.h>
#include <etk/Buffer.h>

View File

@ -7,7 +7,7 @@
*/
#include <appl/Buffer/TextPlugin.h>
#include <appl/TextPlugin.h>
#include <appl/debug.h>
#undef __class__

View File

@ -7,7 +7,7 @@
*/
#include <appl/Buffer/TextPluginAutoIndent.h>
#include <appl/TextPluginAutoIndent.h>
#include <ewol/clipBoard.h>
#include <appl/Gui/TextViewer.h>

View File

@ -13,7 +13,7 @@
#include <ewol/renderer/EObject.h>
#include <appl/Gui/TextViewer.h>
#include <ewol/compositing/Text.h>
#include <appl/Buffer/TextPlugin.h>
#include <appl/TextPlugin.h>
namespace appl {
class TextPluginAutoIndent : public appl::TextViewerPlugin {

View File

@ -7,7 +7,7 @@
*/
#include <appl/Buffer/TextPluginCopy.h>
#include <appl/TextPluginCopy.h>
#include <ewol/clipBoard.h>
#include <appl/Gui/TextViewer.h>

View File

@ -13,7 +13,7 @@
#include <ewol/renderer/EObject.h>
#include <appl/Gui/TextViewer.h>
#include <ewol/compositing/Text.h>
#include <appl/Buffer/TextPlugin.h>
#include <appl/TextPlugin.h>
namespace appl {
class TextPluginCopy : public appl::TextViewerPlugin {

View File

@ -7,10 +7,10 @@
*/
#include <appl/Buffer/TextPluginHistory.h>
#include <appl/TextPluginHistory.h>
#include <ewol/clipBoard.h>
#include <appl/Gui/TextViewer.h>
#include <appl/Buffer/TextPluginManager.h>
#include <appl/TextPluginManager.h>
#undef __class__
#define __class__ "TextPluginHistory"

View File

@ -13,7 +13,7 @@
#include <ewol/renderer/EObject.h>
#include <appl/Gui/TextViewer.h>
#include <ewol/compositing/Text.h>
#include <appl/Buffer/TextPlugin.h>
#include <appl/TextPlugin.h>
namespace appl {
class History {

View File

@ -6,12 +6,12 @@
* @license GPL v3 (see license file)
*/
#include <appl/Buffer/TextPluginManager.h>
#include <appl/TextPluginManager.h>
#include <appl/debug.h>
#include <appl/Buffer/TextPluginCopy.h>
#include <appl/Buffer/TextPluginMultiLineTab.h>
#include <appl/Buffer/TextPluginAutoIndent.h>
#include <appl/Buffer/TextPluginHistory.h>
#include <appl/TextPluginCopy.h>
#include <appl/TextPluginMultiLineTab.h>
#include <appl/TextPluginAutoIndent.h>
#include <appl/TextPluginHistory.h>
#undef __class__
#define __class__ "textPluginManager"

View File

@ -13,7 +13,7 @@
#include <ewol/renderer/EObject.h>
#include <appl/Gui/TextViewer.h>
#include <ewol/compositing/Text.h>
#include <appl/Buffer/TextPlugin.h>
#include <appl/TextPlugin.h>
namespace appl {
namespace textPluginManager {

View File

@ -7,7 +7,7 @@
*/
#include <appl/Buffer/TextPluginMultiLineTab.h>
#include <appl/TextPluginMultiLineTab.h>
#include <ewol/clipBoard.h>
#include <appl/Gui/TextViewer.h>

View File

@ -13,7 +13,7 @@
#include <ewol/renderer/EObject.h>
#include <appl/Gui/TextViewer.h>
#include <ewol/compositing/Text.h>
#include <appl/Buffer/TextPlugin.h>
#include <appl/TextPlugin.h>
namespace appl {
class TextPluginMultiLineTab : public appl::TextViewerPlugin {

View File

@ -16,19 +16,19 @@
#include <appl/global.h>
#include <etk/os/FSNode.h>
#include <etk/tool.h>
#include <Gui/MainWindows.h>
#include <BufferManager.h>
#include <HighlightManager.h>
#include <Gui/Search.h>
#include <unistd.h>
#include <readtags.h>
#include <CTagsManager.h>
#include <globalMsg.h>
//#include <ewol/config.h>
#include <ewol/commandLine.h>
//#include <ewol/UserConfig.h>
#include <ewol/renderer/eContext.h>
#include <appl/Buffer/TextPluginManager.h>
#include <appl/TextPluginManager.h>
#include <appl/BufferManager.h>
#include <appl/HighlightManager.h>
#include <appl/Gui/MainWindows.h>
#include <appl/Gui/Search.h>
#include <appl/ctags/readtags.h>
#include <appl/ctags/CTagsManager.h>
#include <appl/globalMsg.h>
/**
* @brief Main of the program (This can be set in every case, but it is not used in Andoid...).

View File

@ -29,25 +29,25 @@ def Create(target):
# All needed for the buffer management :
myModule.AddSrcFile([
'appl/Buffer/Buffer.cpp',
'appl/Buffer/TextPlugin.cpp',
'appl/Buffer/TextPluginCopy.cpp',
'appl/Buffer/TextPluginMultiLineTab.cpp',
'appl/Buffer/TextPluginAutoIndent.cpp',
'appl/Buffer/TextPluginHistory.cpp',
'appl/Buffer/TextPluginManager.cpp',
'appl/Buffer/BufferManager.cpp'])
'appl/Buffer.cpp',
'appl/BufferManager.cpp',
'appl/TextPlugin.cpp',
'appl/TextPluginCopy.cpp',
'appl/TextPluginMultiLineTab.cpp',
'appl/TextPluginAutoIndent.cpp',
'appl/TextPluginHistory.cpp',
'appl/TextPluginManager.cpp'])
# Generic color management for the text editor :
myModule.AddSrcFile([
'appl/glyphDecoration/GlyphDecoration.cpp',
'appl/glyphDecoration/GlyphPainting.cpp'])
'appl/GlyphDecoration.cpp',
'appl/GlyphPainting.cpp'])
# syntax coloration for the text editor
myModule.AddSrcFile([
'appl/Highlight/HighlightPattern.cpp',
'appl/Highlight/Highlight.cpp',
'appl/Highlight/HighlightManager.cpp'])
'appl/HighlightPattern.cpp',
'appl/Highlight.cpp',
'appl/HighlightManager.cpp'])
myModule.AddModuleDepend('ewol')