Remove Keybord special key to the abstraction layer
This commit is contained in:
parent
411bf03e74
commit
a9eb976b48
@ -205,7 +205,7 @@ void BufferText::SelectionEnd(void)
|
|||||||
void BufferText::SelectionCheckMode(void)
|
void BufferText::SelectionCheckMode(void)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
if (true == globals::IsSetCtrl() ) {
|
if (true == ewol::IsSetCtrl() ) {
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
@ -253,7 +253,7 @@ void BufferText::CursorDisplay(ewol::OObject2DColored* OOColored, int32_t x, int
|
|||||||
{
|
{
|
||||||
color_ts & tmpppppp = ColorizeManager::getInstance()->Get(COLOR_CODE_CURSOR);
|
color_ts & tmpppppp = ColorizeManager::getInstance()->Get(COLOR_CODE_CURSOR);
|
||||||
OOColored->SetColor(tmpppppp);
|
OOColored->SetColor(tmpppppp);
|
||||||
if (true == globals::IsSetInsert()) {
|
if (true == ewol::IsSetInsert()) {
|
||||||
OOColored->Rectangle( x, y, letterWidth, letterHeight);
|
OOColored->Rectangle( x, y, letterWidth, letterHeight);
|
||||||
} else {
|
} 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) , (int32_t)(x+CURSOR_WIDTH), (int32_t)(y) , CURSOR_THICKNESS);
|
||||||
@ -548,7 +548,7 @@ void BufferText::GetMousePosition(int32_t width, int32_t height, int32_t &x, int
|
|||||||
// TODO : Simplify selection ....
|
// TODO : Simplify selection ....
|
||||||
void BufferText::MouseEvent(int32_t width, int32_t height)
|
void BufferText::MouseEvent(int32_t width, int32_t height)
|
||||||
{
|
{
|
||||||
if (true == globals::IsSetShift() ) {
|
if (true == ewol::IsSetShift() ) {
|
||||||
MouseSelectFromCursorTo(width, height);
|
MouseSelectFromCursorTo(width, height);
|
||||||
} else {
|
} else {
|
||||||
int32_t posX, posY;
|
int32_t posX, posY;
|
||||||
@ -786,11 +786,11 @@ void BufferText::SetInsertPosition(int32_t newPos, bool insertChar)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( false == haveSelectionActive
|
if( false == haveSelectionActive
|
||||||
&& true == globals::IsSetShift() )
|
&& true == ewol::IsSetShift() )
|
||||||
{
|
{
|
||||||
// new selection
|
// new selection
|
||||||
m_EdnBuf.Select(SELECTION_PRIMARY, rememberCursorPos, m_cursorPos);
|
m_EdnBuf.Select(SELECTION_PRIMARY, rememberCursorPos, m_cursorPos);
|
||||||
} else if( true == globals::IsSetShift()
|
} else if( true == ewol::IsSetShift()
|
||||||
&& true == haveSelectionActive)
|
&& true == haveSelectionActive)
|
||||||
{
|
{
|
||||||
// update selection
|
// update selection
|
||||||
@ -883,7 +883,7 @@ void BufferText::cursorMove(ewol::eventKbMoveType_te moveTypeEvent)
|
|||||||
bool needUpdatePosition = true;
|
bool needUpdatePosition = true;
|
||||||
// check selection event ...
|
// check selection event ...
|
||||||
/*
|
/*
|
||||||
if (true == globals::IsSetShift() ) {
|
if (true == ewol::IsSetShift() ) {
|
||||||
if ( CURSOR_MODE_NORMAL == cursorMode) {
|
if ( CURSOR_MODE_NORMAL == cursorMode) {
|
||||||
SelectionStart();
|
SelectionStart();
|
||||||
} else {
|
} else {
|
||||||
@ -1040,7 +1040,7 @@ void BufferText::AddChar(char * UTF8data)
|
|||||||
m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, tmpVect);
|
m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, tmpVect);
|
||||||
SetInsertPosition(SelectionStart+tmpVect.Size(), true);
|
SetInsertPosition(SelectionStart+tmpVect.Size(), true);
|
||||||
} else {
|
} else {
|
||||||
if (true == globals::IsSetShift() ) {
|
if (true == ewol::IsSetShift() ) {
|
||||||
m_cursorPos = m_EdnBuf.UnIndent(SELECTION_PRIMARY);
|
m_cursorPos = m_EdnBuf.UnIndent(SELECTION_PRIMARY);
|
||||||
} else {
|
} else {
|
||||||
m_cursorPos = m_EdnBuf.Indent(SELECTION_PRIMARY);
|
m_cursorPos = m_EdnBuf.Indent(SELECTION_PRIMARY);
|
||||||
@ -1050,11 +1050,9 @@ void BufferText::AddChar(char * UTF8data)
|
|||||||
actionDone = true;
|
actionDone = true;
|
||||||
} else if (UTF8data[0] == '\n') {
|
} else if (UTF8data[0] == '\n') {
|
||||||
etk::VectorType<int8_t> tmpVect;
|
etk::VectorType<int8_t> tmpVect;
|
||||||
if (true == globals::IsSetShift()) {
|
if (true == ewol::IsSetShift()) {
|
||||||
EDN_ERROR("kjhkjhkjhkjh");
|
|
||||||
tmpVect.PushBack('\r');
|
tmpVect.PushBack('\r');
|
||||||
} else {
|
} else {
|
||||||
EDN_ERROR("plop");
|
|
||||||
tmpVect.PushBack('\n');
|
tmpVect.PushBack('\n');
|
||||||
// if Auto indent Enable ==> we get the start of the previous line and add it to tne new one
|
// if Auto indent Enable ==> we get the start of the previous line and add it to tne new one
|
||||||
if (true == globals::IsSetAutoIndent() ) {
|
if (true == globals::IsSetAutoIndent() ) {
|
||||||
|
@ -102,99 +102,4 @@ int32_t globals::getNbLineBorder(void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static bool shiftIsSet = false;
|
|
||||||
void globals::SetShift(void)
|
|
||||||
{
|
|
||||||
shiftIsSet = true;
|
|
||||||
EDN_INFO(" SHIFT => Set");
|
|
||||||
}
|
|
||||||
|
|
||||||
void globals::UnSetShift(void)
|
|
||||||
{
|
|
||||||
shiftIsSet = false;
|
|
||||||
EDN_INFO(" SHIFT => UnSet");
|
|
||||||
}
|
|
||||||
|
|
||||||
bool globals::IsSetShift(void)
|
|
||||||
{
|
|
||||||
return shiftIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static bool altIsSet = false;
|
|
||||||
void globals::SetAlt(void)
|
|
||||||
{
|
|
||||||
altIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void globals::UnSetAlt(void)
|
|
||||||
{
|
|
||||||
altIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool globals::IsSetAlt(void)
|
|
||||||
{
|
|
||||||
return altIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static bool ctrlIsSet = false;
|
|
||||||
void globals::SetCtrl(void)
|
|
||||||
{
|
|
||||||
ctrlIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void globals::UnSetCtrl(void)
|
|
||||||
{
|
|
||||||
ctrlIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool globals::IsSetCtrl(void)
|
|
||||||
{
|
|
||||||
return ctrlIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static bool pommeIsSet = false;
|
|
||||||
void globals::SetPomme(void)
|
|
||||||
{
|
|
||||||
pommeIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void globals::UnSetPomme(void)
|
|
||||||
{
|
|
||||||
pommeIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool globals::IsSetPomme(void)
|
|
||||||
{
|
|
||||||
return pommeIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool insertIsSet = false;
|
|
||||||
void globals::SetInsert(void)
|
|
||||||
{
|
|
||||||
insertIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void globals::UnSetInsert(void)
|
|
||||||
{
|
|
||||||
insertIsSet = false;
|
|
||||||
}
|
|
||||||
void globals::ToggleInsert(void)
|
|
||||||
{
|
|
||||||
if (true==insertIsSet) {
|
|
||||||
insertIsSet = false;
|
|
||||||
} else {
|
|
||||||
insertIsSet = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool globals::IsSetInsert(void)
|
|
||||||
{
|
|
||||||
return insertIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,22 +47,6 @@ namespace globals
|
|||||||
|
|
||||||
void init2(void);
|
void init2(void);
|
||||||
|
|
||||||
void SetShift(void);
|
|
||||||
void UnSetShift(void);
|
|
||||||
bool IsSetShift(void);
|
|
||||||
void SetAlt(void);
|
|
||||||
void UnSetAlt(void);
|
|
||||||
bool IsSetAlt(void);
|
|
||||||
void SetCtrl(void);
|
|
||||||
void UnSetCtrl(void);
|
|
||||||
bool IsSetCtrl(void);
|
|
||||||
void SetPomme(void);
|
|
||||||
void UnSetPomme(void);
|
|
||||||
bool IsSetPomme(void);
|
|
||||||
void SetInsert(void);
|
|
||||||
void UnSetInsert(void);
|
|
||||||
void ToggleInsert(void);
|
|
||||||
bool IsSetInsert(void);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user