[DEV] update at the new low level gale interface
This commit is contained in:
parent
ad32734537
commit
1fcf8b8a74
@ -11,7 +11,7 @@
|
|||||||
#include <etk/stdTools.h>
|
#include <etk/stdTools.h>
|
||||||
#include <appl/Buffer.h>
|
#include <appl/Buffer.h>
|
||||||
#include <appl/debug.h>
|
#include <appl/debug.h>
|
||||||
#include <ewol/context/clipBoard.h>
|
#include <gale/context/clipBoard.h>
|
||||||
#include <appl/HighlightManager.h>
|
#include <appl/HighlightManager.h>
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
|
@ -13,7 +13,8 @@
|
|||||||
#include <appl/BufferManager.h>
|
#include <appl/BufferManager.h>
|
||||||
#include <ewol/object/Object.h>
|
#include <ewol/object/Object.h>
|
||||||
#include <ewol/object/Manager.h>
|
#include <ewol/object/Manager.h>
|
||||||
#include <ewol/resource/Manager.h>
|
#include <ewol/signal/Signal.h>
|
||||||
|
#include <gale/resource/Manager.h>
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "BufferManager"
|
#define __class__ "BufferManager"
|
||||||
@ -27,7 +28,7 @@ appl::BufferManager::BufferManager() :
|
|||||||
}
|
}
|
||||||
|
|
||||||
void appl::BufferManager::init(const std::string& _uniqueName) {
|
void appl::BufferManager::init(const std::string& _uniqueName) {
|
||||||
ewol::Resource::init(_uniqueName);
|
ewol::Object::init(_uniqueName);
|
||||||
}
|
}
|
||||||
|
|
||||||
appl::BufferManager::~BufferManager() {
|
appl::BufferManager::~BufferManager() {
|
||||||
@ -41,7 +42,7 @@ std::shared_ptr<appl::Buffer> appl::BufferManager::createNewBuffer() {
|
|||||||
APPL_ERROR("Can not allocate the Buffer (empty).");
|
APPL_ERROR("Can not allocate the Buffer (empty).");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
tmp->setParent(shared_from_this());
|
tmp->setParent(ewol::Object::shared_from_this());
|
||||||
m_list.push_back(tmp);
|
m_list.push_back(tmp);
|
||||||
APPL_INFO("Create a new Buffer");
|
APPL_INFO("Create a new Buffer");
|
||||||
signalNewBuffer.emit(tmp->getFileName());
|
signalNewBuffer.emit(tmp->getFileName());
|
||||||
@ -73,7 +74,7 @@ std::shared_ptr<appl::Buffer> appl::BufferManager::get(const std::string& _fileN
|
|||||||
APPL_ERROR("Can not allocate the Buffer class : " << _fileName);
|
APPL_ERROR("Can not allocate the Buffer class : " << _fileName);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
tmp->setParent(shared_from_this());
|
tmp->setParent(ewol::Object::shared_from_this());
|
||||||
tmp->loadFile(_fileName);
|
tmp->loadFile(_fileName);
|
||||||
m_list.push_back(tmp);
|
m_list.push_back(tmp);
|
||||||
APPL_INFO("Creata a open Buffer");
|
APPL_INFO("Creata a open Buffer");
|
||||||
@ -135,6 +136,7 @@ void appl::BufferManager::open(const std::string& _fileName) {
|
|||||||
parameterSetOnWidgetNamed("appl-widget-display-name", "value", etk::FSNodeGetRealName(_fileName));
|
parameterSetOnWidgetNamed("appl-widget-display-name", "value", etk::FSNodeGetRealName(_fileName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO : ...
|
||||||
|
|
||||||
void appl::BufferManager::requestDestroyFromChild(const std::shared_ptr<Object>& _child) {
|
void appl::BufferManager::requestDestroyFromChild(const std::shared_ptr<Object>& _child) {
|
||||||
APPL_WARNING("Buffer request a close...");
|
APPL_WARNING("Buffer request a close...");
|
||||||
@ -164,3 +166,4 @@ void appl::BufferManager::requestDestroyFromChild(const std::shared_ptr<Object>&
|
|||||||
m_bufferSelected = nullptr;
|
m_bufferSelected = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
@ -13,10 +13,10 @@
|
|||||||
#include <appl/Buffer.h>
|
#include <appl/Buffer.h>
|
||||||
#include <appl/globalMsg.h>
|
#include <appl/globalMsg.h>
|
||||||
#include <ewol/widget/Widget.h>
|
#include <ewol/widget/Widget.h>
|
||||||
#include <ewol/resource/Resource.h>
|
#include <gale/resource/Resource.h>
|
||||||
|
|
||||||
namespace appl {
|
namespace appl {
|
||||||
class BufferManager : public ewol::Resource {
|
class BufferManager : public ewol::Object {
|
||||||
public:
|
public:
|
||||||
ewol::Signal<std::string> signalNewBuffer;
|
ewol::Signal<std::string> signalNewBuffer;
|
||||||
ewol::Signal<std::string> signalSelectFile;
|
ewol::Signal<std::string> signalSelectFile;
|
||||||
@ -26,7 +26,7 @@ namespace appl {
|
|||||||
BufferManager();
|
BufferManager();
|
||||||
void init(const std::string& _uniqueName);
|
void init(const std::string& _uniqueName);
|
||||||
public:
|
public:
|
||||||
DECLARE_RESOURCE_SINGLE_FACTORY(BufferManager, "???Buffer_Manager???");
|
DECLARE_SINGLE_FACTORY(BufferManager, "???Buffer_Manager???");
|
||||||
virtual ~BufferManager();
|
virtual ~BufferManager();
|
||||||
private:
|
private:
|
||||||
std::list<std::shared_ptr<appl::Buffer>> m_list; // list of all buffer curently open
|
std::list<std::shared_ptr<appl::Buffer>> m_list; // list of all buffer curently open
|
||||||
@ -83,7 +83,7 @@ namespace appl {
|
|||||||
return m_bufferSelected;
|
return m_bufferSelected;
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
void requestDestroyFromChild(const std::shared_ptr<Object>& _child);
|
// TODO : void requestDestroyFromChild(const std::shared_ptr<Object>& _child);
|
||||||
public:
|
public:
|
||||||
// generic iterators:
|
// generic iterators:
|
||||||
std::list<std::shared_ptr<appl::Buffer>>::const_iterator begin() const {
|
std::list<std::shared_ptr<appl::Buffer>>::const_iterator begin() const {
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include <appl/GlyphPainting.h>
|
#include <appl/GlyphPainting.h>
|
||||||
#include <ejson/ejson.h>
|
#include <ejson/ejson.h>
|
||||||
#include <etk/os/FSNode.h>
|
#include <etk/os/FSNode.h>
|
||||||
#include <ewol/resource/Manager.h>
|
#include <gale/resource/Manager.h>
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "GlyphPainting"
|
#define __class__ "GlyphPainting"
|
||||||
@ -19,12 +19,12 @@
|
|||||||
|
|
||||||
|
|
||||||
appl::GlyphPainting::GlyphPainting() {
|
appl::GlyphPainting::GlyphPainting() {
|
||||||
addObjectType("appl::GlyphPainting");
|
addResourceType("appl::GlyphPainting");
|
||||||
}
|
}
|
||||||
|
|
||||||
void appl::GlyphPainting::init(const std::string& _filename) {
|
void appl::GlyphPainting::init(const std::string& _filename) {
|
||||||
ewol::Resource::init(_filename);
|
gale::Resource::init(_filename);
|
||||||
EWOL_DEBUG("SFP : load \"" << _filename << "\"");
|
APPL_DEBUG("SFP : load \"" << _filename << "\"");
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,11 +11,11 @@
|
|||||||
|
|
||||||
#include <etk/types.h>
|
#include <etk/types.h>
|
||||||
#include <ewol/debug.h>
|
#include <ewol/debug.h>
|
||||||
#include <ewol/resource/Resource.h>
|
#include <gale/resource/Resource.h>
|
||||||
#include <appl/GlyphDecoration.h>
|
#include <appl/GlyphDecoration.h>
|
||||||
|
|
||||||
namespace appl {
|
namespace appl {
|
||||||
class GlyphPainting : public ewol::Resource {
|
class GlyphPainting : public gale::Resource {
|
||||||
private:
|
private:
|
||||||
std::vector<appl::GlyphDecoration> m_list;
|
std::vector<appl::GlyphDecoration> m_list;
|
||||||
protected:
|
protected:
|
||||||
|
@ -210,8 +210,8 @@ bool BufferView::getElement(int32_t _colomn, int32_t _raw, std::string& _myTextT
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BufferView::onItemEvent(int32_t _IdInput, enum ewol::key::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y) {
|
bool BufferView::onItemEvent(int32_t _IdInput, enum gale::key::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y) {
|
||||||
if (1 == _IdInput && _typeEvent == ewol::key::statusSingle) {
|
if (1 == _IdInput && _typeEvent == gale::key::status_single) {
|
||||||
APPL_INFO("Event on List : IdInput=" << _IdInput << " colomn=" << _colomn << " raw=" << _raw );
|
APPL_INFO("Event on List : IdInput=" << _IdInput << " colomn=" << _colomn << " raw=" << _raw );
|
||||||
if( _raw >= 0
|
if( _raw >= 0
|
||||||
&& _raw<(int64_t)m_list.size()) {
|
&& _raw<(int64_t)m_list.size()) {
|
||||||
|
@ -66,7 +66,7 @@ class BufferView : public ewol::widget::List {
|
|||||||
virtual bool getTitle(int32_t _colomn, std::string& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg);
|
virtual bool getTitle(int32_t _colomn, std::string& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg);
|
||||||
virtual uint32_t getNuberOfRaw();
|
virtual uint32_t getNuberOfRaw();
|
||||||
virtual bool getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg);
|
virtual bool getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg);
|
||||||
virtual bool onItemEvent(int32_t _IdInput, enum ewol::key::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y);
|
virtual bool onItemEvent(int32_t _IdInput, enum gale::key::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y);
|
||||||
private: //callback function:
|
private: //callback function:
|
||||||
void onCallbackChangeName();
|
void onCallbackChangeName();
|
||||||
void onCallbackIsSave();
|
void onCallbackIsSave();
|
||||||
|
@ -79,8 +79,8 @@ bool appl::TagFileList::getElement(int32_t _colomn, int32_t _raw, std::string& _
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
bool appl::TagFileList::onItemEvent(int32_t _IdInput, enum ewol::key::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y) {
|
bool appl::TagFileList::onItemEvent(int32_t _IdInput, enum gale::key::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y) {
|
||||||
if (_typeEvent == ewol::key::statusSingle) {
|
if (_typeEvent == gale::key::status_single) {
|
||||||
EWOL_INFO("Event on List : IdInput=" << _IdInput << " colomn=" << _colomn << " raw=" << _raw );
|
EWOL_INFO("Event on List : IdInput=" << _IdInput << " colomn=" << _colomn << " raw=" << _raw );
|
||||||
if (_IdInput == 1) {
|
if (_IdInput == 1) {
|
||||||
int32_t previousRaw = m_selectedLine;
|
int32_t previousRaw = m_selectedLine;
|
||||||
|
@ -53,7 +53,7 @@ namespace appl {
|
|||||||
bool getTitle(int32_t _colomn, std::string& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg);
|
bool getTitle(int32_t _colomn, std::string& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg);
|
||||||
uint32_t getNuberOfRaw();
|
uint32_t getNuberOfRaw();
|
||||||
bool getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg);
|
bool getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg);
|
||||||
bool onItemEvent(int32_t _IdInput, enum ewol::key::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y);
|
bool onItemEvent(int32_t _IdInput, enum gale::key::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y);
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief add a Ctags item on the curent list
|
* @brief add a Ctags item on the curent list
|
||||||
|
@ -44,11 +44,11 @@ void appl::TagFileSelection::init() {
|
|||||||
ewol::widget::PopUp::init();
|
ewol::widget::PopUp::init();
|
||||||
std::shared_ptr<ewol::widget::Sizer> mySizerVert;
|
std::shared_ptr<ewol::widget::Sizer> mySizerVert;
|
||||||
#if defined(__TARGET_OS__Android)
|
#if defined(__TARGET_OS__Android)
|
||||||
setMinSize(ewol::Dimension(vec2(90,90),ewol::Dimension::Pourcent));
|
setMinSize(gale::Dimension(vec2(90,90), gale::Dimension::Pourcent));
|
||||||
#elif defined(__TARGET_OS__Windows)
|
#elif defined(__TARGET_OS__Windows)
|
||||||
setMinSize(ewol::Dimension(vec2(80,80),ewol::Dimension::Pourcent));
|
setMinSize(gale::Dimension(vec2(80,80), gale::Dimension::Pourcent));
|
||||||
#else
|
#else
|
||||||
setMinSize(ewol::Dimension(vec2(80,80),ewol::Dimension::Pourcent));
|
setMinSize(gale::Dimension(vec2(80,80), gale::Dimension::Pourcent));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mySizerVert = ewol::widget::Sizer::create(ewol::widget::Sizer::modeVert);
|
mySizerVert = ewol::widget::Sizer::create(ewol::widget::Sizer::modeVert);
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include <appl/global.h>
|
#include <appl/global.h>
|
||||||
#include <appl/Gui/TextViewer.h>
|
#include <appl/Gui/TextViewer.h>
|
||||||
#include <appl/BufferManager.h>
|
#include <appl/BufferManager.h>
|
||||||
#include <ewol/context/clipBoard.h>
|
#include <gale/context/clipBoard.h>
|
||||||
|
|
||||||
#include <ewol/widget/Manager.h>
|
#include <ewol/widget/Manager.h>
|
||||||
#include <appl/Gui/ViewerManager.h>
|
#include <appl/Gui/ViewerManager.h>
|
||||||
@ -393,9 +393,9 @@ bool appl::TextViewer::onEventEntry(const ewol::event::Entry& _event) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// just forward event == > manage directly in the buffer
|
// just forward event == > manage directly in the buffer
|
||||||
if (_event.getType() == ewol::key::keyboardChar) {
|
if (_event.getType() == gale::key::keyboard_char) {
|
||||||
//APPL_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent);
|
//APPL_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent);
|
||||||
if (_event.getStatus() != ewol::key::statusDown) {
|
if (_event.getStatus() != gale::key::status_down) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
char32_t localValue = _event.getChar();
|
char32_t localValue = _event.getChar();
|
||||||
@ -445,44 +445,44 @@ bool appl::TextViewer::onEventEntry(const ewol::event::Entry& _event) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// move events ...
|
// move events ...
|
||||||
if (_event.getStatus() == ewol::key::statusDown) {
|
if (_event.getStatus() == gale::key::status_down) {
|
||||||
// selection when shift is set:
|
// selection when shift is set:
|
||||||
m_buffer->setSelectMode(_event.getSpecialKey().getShift());
|
m_buffer->setSelectMode(_event.getSpecialKey().getShift());
|
||||||
// check selection event ...
|
// check selection event ...
|
||||||
switch(_event.getType()) {
|
switch(_event.getType()) {
|
||||||
case ewol::key::keyboardInsert:
|
case gale::key::keyboard_insert:
|
||||||
m_insertMode = m_insertMode==true?false:true;
|
m_insertMode = m_insertMode==true?false:true;
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
break;
|
break;
|
||||||
case ewol::key::keyboardLeft:
|
case gale::key::keyboard_left:
|
||||||
//APPL_INFO("keyEvent : <LEFT>");
|
//APPL_INFO("keyEvent : <LEFT>");
|
||||||
moveCursorLeft();
|
moveCursorLeft();
|
||||||
break;
|
break;
|
||||||
case ewol::key::keyboardRight:
|
case gale::key::keyboard_right:
|
||||||
//APPL_INFO("keyEvent : <RIGHT>");
|
//APPL_INFO("keyEvent : <RIGHT>");
|
||||||
moveCursorRight();
|
moveCursorRight();
|
||||||
break;
|
break;
|
||||||
case ewol::key::keyboardUp:
|
case gale::key::keyboard_up:
|
||||||
//APPL_INFO("keyEvent : <UP>");
|
//APPL_INFO("keyEvent : <UP>");
|
||||||
moveCursorUp(1);
|
moveCursorUp(1);
|
||||||
break;
|
break;
|
||||||
case ewol::key::keyboardDown:
|
case gale::key::keyboard_down:
|
||||||
//APPL_INFO("keyEvent : <DOWN>");
|
//APPL_INFO("keyEvent : <DOWN>");
|
||||||
moveCursorDown(1);
|
moveCursorDown(1);
|
||||||
break;
|
break;
|
||||||
case ewol::key::keyboardPageUp:
|
case gale::key::keyboard_pageUp:
|
||||||
//APPL_INFO("keyEvent : <PAGE-UP>");
|
//APPL_INFO("keyEvent : <PAGE-UP>");
|
||||||
moveCursorUp(15); // TODO : Set the real number of line ...
|
moveCursorUp(15); // TODO : Set the real number of line ...
|
||||||
break;
|
break;
|
||||||
case ewol::key::keyboardPageDown:
|
case gale::key::keyboard_pageDown:
|
||||||
//APPL_INFO("keyEvent : <PAGE-DOWN>");
|
//APPL_INFO("keyEvent : <PAGE-DOWN>");
|
||||||
moveCursorDown(15); // TODO : Set the real number of line ...
|
moveCursorDown(15); // TODO : Set the real number of line ...
|
||||||
break;
|
break;
|
||||||
case ewol::key::keyboardStart:
|
case gale::key::keyboard_start:
|
||||||
//APPL_INFO("keyEvent : <Start of line>");
|
//APPL_INFO("keyEvent : <Start of line>");
|
||||||
moveCursorLeft(moveEnd);
|
moveCursorLeft(moveEnd);
|
||||||
break;
|
break;
|
||||||
case ewol::key::keyboardEnd:
|
case gale::key::keyboard_end:
|
||||||
//APPL_INFO("keyEvent : <End of line>");
|
//APPL_INFO("keyEvent : <End of line>");
|
||||||
moveCursorRight(moveEnd);
|
moveCursorRight(moveEnd);
|
||||||
break;
|
break;
|
||||||
@ -496,7 +496,7 @@ bool appl::TextViewer::onEventEntry(const ewol::event::Entry& _event) {
|
|||||||
|
|
||||||
bool appl::TextViewer::onEventInput(const ewol::event::Input& _event) {
|
bool appl::TextViewer::onEventInput(const ewol::event::Input& _event) {
|
||||||
if ( _event.getId() != 0
|
if ( _event.getId() != 0
|
||||||
&& _event.getStatus() == ewol::key::statusDown) {
|
&& _event.getStatus() == gale::key::status_down) {
|
||||||
keepFocus();
|
keepFocus();
|
||||||
}
|
}
|
||||||
//tic();
|
//tic();
|
||||||
@ -526,7 +526,7 @@ bool appl::TextViewer::onEventInput(const ewol::event::Input& _event) {
|
|||||||
relativePos.setX(0);
|
relativePos.setX(0);
|
||||||
}
|
}
|
||||||
if ( _event.getId() == 12
|
if ( _event.getId() == 12
|
||||||
&& _event.getStatus() == ewol::key::statusSingle) {
|
&& _event.getStatus() == gale::key::status_single) {
|
||||||
APPL_TODO("RAT5 SAVE button ==> TODO implement");
|
APPL_TODO("RAT5 SAVE button ==> TODO implement");
|
||||||
// Rat5 save event
|
// Rat5 save event
|
||||||
//sendMultiCast(ednMsgGuiSave, "current");
|
//sendMultiCast(ednMsgGuiSave, "current");
|
||||||
@ -535,8 +535,8 @@ bool appl::TextViewer::onEventInput(const ewol::event::Input& _event) {
|
|||||||
// just forward event == > manage directly in the buffer
|
// just forward event == > manage directly in the buffer
|
||||||
if (_event.getId() == 1) {
|
if (_event.getId() == 1) {
|
||||||
// mouse selection :
|
// mouse selection :
|
||||||
//if (_event.getType() == ewol::key::typeMouse) {
|
//if (_event.getType() == gale::key::typeMouse) {
|
||||||
if (_event.getStatus() == ewol::key::statusDown) {
|
if (_event.getStatus() == gale::key::status_down) {
|
||||||
//if (_event.getSpecialKey().isSetShift() == false) {
|
//if (_event.getSpecialKey().isSetShift() == false) {
|
||||||
appl::Buffer::Iterator newPos = getMousePosition(relativePos);
|
appl::Buffer::Iterator newPos = getMousePosition(relativePos);
|
||||||
m_buffer->setSelectMode(false);
|
m_buffer->setSelectMode(false);
|
||||||
@ -545,7 +545,7 @@ bool appl::TextViewer::onEventInput(const ewol::event::Input& _event) {
|
|||||||
markToRedraw();
|
markToRedraw();
|
||||||
return true;
|
return true;
|
||||||
//}
|
//}
|
||||||
} else if (_event.getStatus() == ewol::key::statusUp) {
|
} else if (_event.getStatus() == gale::key::status_up) {
|
||||||
appl::Buffer::Iterator newPos = getMousePosition(relativePos);
|
appl::Buffer::Iterator newPos = getMousePosition(relativePos);
|
||||||
moveCursor(newPos);
|
moveCursor(newPos);
|
||||||
m_buffer->setSelectMode(false);
|
m_buffer->setSelectMode(false);
|
||||||
@ -553,41 +553,41 @@ bool appl::TextViewer::onEventInput(const ewol::event::Input& _event) {
|
|||||||
std::string value;
|
std::string value;
|
||||||
m_buffer->copy(value);
|
m_buffer->copy(value);
|
||||||
if (value.size() != 0) {
|
if (value.size() != 0) {
|
||||||
ewol::context::clipBoard::set(ewol::context::clipBoard::clipboardSelection, value);
|
gale::context::clipBoard::set(gale::context::clipBoard::clipboardSelection, value);
|
||||||
}
|
}
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
if (_event.getStatus() == ewol::key::statusSingle) {
|
if (_event.getStatus() == gale::key::status_single) {
|
||||||
if ( _event.getType() == ewol::key::typeMouse
|
if ( _event.getType() == gale::key::type_mouse
|
||||||
|| _event.getType() == ewol::key::typeFinger) {
|
|| _event.getType() == gale::key::type_finger) {
|
||||||
appl::Buffer::Iterator newPos = getMousePosition(relativePos);
|
appl::Buffer::Iterator newPos = getMousePosition(relativePos);
|
||||||
moveCursor(newPos);
|
moveCursor(newPos);
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else if (_event.getStatus() == ewol::key::statusDouble) {
|
} else if (_event.getStatus() == gale::key::status_double) {
|
||||||
mouseEventDouble();
|
mouseEventDouble();
|
||||||
// Copy selection :
|
// Copy selection :
|
||||||
std::string value;
|
std::string value;
|
||||||
m_buffer->copy(value);
|
m_buffer->copy(value);
|
||||||
if (value.size() != 0) {
|
if (value.size() != 0) {
|
||||||
ewol::context::clipBoard::set(ewol::context::clipBoard::clipboardSelection, value);
|
gale::context::clipBoard::set(gale::context::clipBoard::clipboardSelection, value);
|
||||||
}
|
}
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
return true;
|
return true;
|
||||||
} else if (_event.getStatus() == ewol::key::statusTriple) {
|
} else if (_event.getStatus() == gale::key::status_triple) {
|
||||||
mouseEventTriple();
|
mouseEventTriple();
|
||||||
// Copy selection :
|
// Copy selection :
|
||||||
std::string value;
|
std::string value;
|
||||||
m_buffer->copy(value);
|
m_buffer->copy(value);
|
||||||
if (value.size() != 0) {
|
if (value.size() != 0) {
|
||||||
ewol::context::clipBoard::set(ewol::context::clipBoard::clipboardSelection, value);
|
gale::context::clipBoard::set(gale::context::clipBoard::clipboardSelection, value);
|
||||||
}
|
}
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
return true;
|
return true;
|
||||||
} else if (_event.getStatus() == ewol::key::statusMove) {
|
} else if (_event.getStatus() == gale::key::status_move) {
|
||||||
if (m_buffer->getSelectMode() == true) {
|
if (m_buffer->getSelectMode() == true) {
|
||||||
//int64_t timeStart = ewol::getTime();
|
//int64_t timeStart = ewol::getTime();
|
||||||
appl::Buffer::Iterator newPos = getMousePosition(relativePos);
|
appl::Buffer::Iterator newPos = getMousePosition(relativePos);
|
||||||
@ -605,10 +605,10 @@ bool appl::TextViewer::onEventInput(const ewol::event::Input& _event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (2 == _event.getId()) {
|
} else if (2 == _event.getId()) {
|
||||||
if (ewol::key::statusSingle == _event.getStatus()) {
|
if (gale::key::status_single == _event.getStatus()) {
|
||||||
appl::Buffer::Iterator newPos = getMousePosition(relativePos);
|
appl::Buffer::Iterator newPos = getMousePosition(relativePos);
|
||||||
moveCursor(newPos);
|
moveCursor(newPos);
|
||||||
ewol::context::clipBoard::request(ewol::context::clipBoard::clipboardSelection);
|
gale::context::clipBoard::request(gale::context::clipBoard::clipboardSelection);
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -683,9 +683,9 @@ appl::Buffer::Iterator appl::TextViewer::getMousePosition(const vec2& _relativeP
|
|||||||
return m_buffer->end();
|
return m_buffer->end();
|
||||||
}
|
}
|
||||||
|
|
||||||
void appl::TextViewer::onEventClipboard(enum ewol::context::clipBoard::clipboardListe _clipboardID) {
|
void appl::TextViewer::onEventClipboard(enum gale::context::clipBoard::clipboardListe _clipboardID) {
|
||||||
if (m_buffer != nullptr) {
|
if (m_buffer != nullptr) {
|
||||||
std::string data = ewol::context::clipBoard::get(_clipboardID);
|
std::string data = gale::context::clipBoard::get(_clipboardID);
|
||||||
write(data);
|
write(data);
|
||||||
}
|
}
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
|
@ -67,7 +67,7 @@ namespace appl {
|
|||||||
virtual void onRegenerateDisplay();
|
virtual void onRegenerateDisplay();
|
||||||
virtual bool onEventInput(const ewol::event::Input& _event);
|
virtual bool onEventInput(const ewol::event::Input& _event);
|
||||||
virtual bool onEventEntry(const ewol::event::Entry& _event);
|
virtual bool onEventEntry(const ewol::event::Entry& _event);
|
||||||
virtual void onEventClipboard(enum ewol::context::clipBoard::clipboardListe _clipboardID);
|
virtual void onEventClipboard(enum gale::context::clipBoard::clipboardListe _clipboardID);
|
||||||
virtual void onGetFocus();
|
virtual void onGetFocus();
|
||||||
virtual void onLostFocus();
|
virtual void onLostFocus();
|
||||||
virtual void changeZoom(float _range);
|
virtual void changeZoom(float _range);
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include <appl/Gui/TextViewer.h>
|
#include <appl/Gui/TextViewer.h>
|
||||||
#include <ewol/object/Object.h>
|
#include <ewol/object/Object.h>
|
||||||
#include <ewol/object/Manager.h>
|
#include <ewol/object/Manager.h>
|
||||||
#include <ewol/resource/Manager.h>
|
#include <gale/resource/Manager.h>
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "ViewerManager"
|
#define __class__ "ViewerManager"
|
||||||
@ -24,7 +24,7 @@ appl::ViewerManager::ViewerManager() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void appl::ViewerManager::init(const std::string& _uniqueName) {
|
void appl::ViewerManager::init(const std::string& _uniqueName) {
|
||||||
ewol::Resource::init(_uniqueName);
|
ewol::Object::init(_uniqueName);
|
||||||
}
|
}
|
||||||
|
|
||||||
appl::ViewerManager::~ViewerManager() {
|
appl::ViewerManager::~ViewerManager() {
|
||||||
|
@ -12,17 +12,17 @@
|
|||||||
#include <appl/Buffer.h>
|
#include <appl/Buffer.h>
|
||||||
#include <appl/globalMsg.h>
|
#include <appl/globalMsg.h>
|
||||||
#include <ewol/widget/Widget.h>
|
#include <ewol/widget/Widget.h>
|
||||||
#include <ewol/resource/Resource.h>
|
#include <gale/resource/Resource.h>
|
||||||
#include <appl/BufferManager.h>
|
#include <appl/BufferManager.h>
|
||||||
|
|
||||||
namespace appl {
|
namespace appl {
|
||||||
class TextViewer;
|
class TextViewer;
|
||||||
class ViewerManager : public ewol::Resource {
|
class ViewerManager : public ewol::Object {
|
||||||
protected:
|
protected:
|
||||||
ViewerManager();
|
ViewerManager();
|
||||||
void init(const std::string& _uniqueName);
|
void init(const std::string& _uniqueName);
|
||||||
public:
|
public:
|
||||||
DECLARE_RESOURCE_SINGLE_FACTORY(ViewerManager, "???ViewerManager???");
|
DECLARE_SINGLE_FACTORY(ViewerManager, "???ViewerManager???");
|
||||||
virtual ~ViewerManager();
|
virtual ~ViewerManager();
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager
|
std::shared_ptr<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include <appl/Highlight.h>
|
#include <appl/Highlight.h>
|
||||||
#include <exml/exml.h>
|
#include <exml/exml.h>
|
||||||
#include <ewol/ewol.h>
|
#include <ewol/ewol.h>
|
||||||
#include <ewol/resource/Manager.h>
|
#include <gale/resource/Manager.h>
|
||||||
|
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
@ -26,11 +26,11 @@
|
|||||||
#define HL2_DEBUG APPL_VERBOSE
|
#define HL2_DEBUG APPL_VERBOSE
|
||||||
|
|
||||||
appl::Highlight::Highlight() {
|
appl::Highlight::Highlight() {
|
||||||
addObjectType("appl::Highlight");
|
addResourceType("appl::Highlight");
|
||||||
}
|
}
|
||||||
|
|
||||||
void appl::Highlight::init(const std::string& _xmlFilename, const std::string& _colorFile) {
|
void appl::Highlight::init(const std::string& _xmlFilename, const std::string& _colorFile) {
|
||||||
ewol::Resource::init(_xmlFilename);
|
gale::Resource::init(_xmlFilename);
|
||||||
|
|
||||||
// keep color propertiy file :
|
// keep color propertiy file :
|
||||||
m_paintingProperties = appl::GlyphPainting::create(_colorFile);
|
m_paintingProperties = appl::GlyphPainting::create(_colorFile);
|
||||||
|
@ -30,7 +30,7 @@ namespace appl {
|
|||||||
#include <exml/exml.h>
|
#include <exml/exml.h>
|
||||||
|
|
||||||
namespace appl {
|
namespace appl {
|
||||||
class Highlight : public ewol::Resource {
|
class Highlight : public gale::Resource {
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<appl::GlyphPainting> m_paintingProperties;
|
std::shared_ptr<appl::GlyphPainting> m_paintingProperties;
|
||||||
public:
|
public:
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <appl/TextPluginAutoIndent.h>
|
#include <appl/TextPluginAutoIndent.h>
|
||||||
#include <ewol/context/clipBoard.h>
|
#include <gale/context/clipBoard.h>
|
||||||
#include <appl/Gui/TextViewer.h>
|
#include <appl/Gui/TextViewer.h>
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
@ -31,10 +31,10 @@ bool appl::TextPluginAutoIndent::onEventEntry(appl::TextViewer& _textDrawer,
|
|||||||
}
|
}
|
||||||
//APPL_DEBUG("KB EVENT : " << _event);
|
//APPL_DEBUG("KB EVENT : " << _event);
|
||||||
// just forward event == > manage directly in the buffer
|
// just forward event == > manage directly in the buffer
|
||||||
if (_event.getType() != ewol::key::keyboardChar) {
|
if (_event.getType() != gale::key::keyboard_char) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (_event.getStatus() != ewol::key::statusDown) {
|
if (_event.getStatus() != gale::key::status_down) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (_event.getChar() != u32char::Return) {
|
if (_event.getChar() != u32char::Return) {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <appl/TextPluginCopy.h>
|
#include <appl/TextPluginCopy.h>
|
||||||
#include <ewol/context/clipBoard.h>
|
#include <gale/context/clipBoard.h>
|
||||||
#include <appl/Gui/TextViewer.h>
|
#include <appl/Gui/TextViewer.h>
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
@ -76,7 +76,7 @@ bool appl::TextPluginCopy::onReceiveShortCut(appl::TextViewer& _textDrawer,
|
|||||||
std::string value;
|
std::string value;
|
||||||
_textDrawer.copy(value);
|
_textDrawer.copy(value);
|
||||||
if (value.size() != 0) {
|
if (value.size() != 0) {
|
||||||
ewol::context::clipBoard::set(ewol::context::clipBoard::clipboardStd, value);
|
gale::context::clipBoard::set(gale::context::clipBoard::clipboardStd, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_shortCutName == "appl::TextPluginCopy::cut") {
|
if (_shortCutName == "appl::TextPluginCopy::cut") {
|
||||||
@ -85,7 +85,7 @@ bool appl::TextPluginCopy::onReceiveShortCut(appl::TextViewer& _textDrawer,
|
|||||||
return true;
|
return true;
|
||||||
} else if (_shortCutName == "appl::TextPluginCopy::Paste") {
|
} else if (_shortCutName == "appl::TextPluginCopy::Paste") {
|
||||||
if (_textDrawer.hasBuffer() == true) {
|
if (_textDrawer.hasBuffer() == true) {
|
||||||
ewol::context::clipBoard::request(ewol::context::clipBoard::clipboardStd);
|
gale::context::clipBoard::request(gale::context::clipBoard::clipboardStd);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <appl/TextPluginCtags.h>
|
#include <appl/TextPluginCtags.h>
|
||||||
#include <ewol/context/clipBoard.h>
|
#include <gale/context/clipBoard.h>
|
||||||
#include <appl/Gui/TextViewer.h>
|
#include <appl/Gui/TextViewer.h>
|
||||||
#include <ewol/widget/meta/FileChooser.h>
|
#include <ewol/widget/meta/FileChooser.h>
|
||||||
#include <ewol/context/Context.h>
|
#include <ewol/context/Context.h>
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <appl/TextPluginHistory.h>
|
#include <appl/TextPluginHistory.h>
|
||||||
#include <ewol/context/clipBoard.h>
|
|
||||||
#include <appl/Gui/TextViewer.h>
|
#include <appl/Gui/TextViewer.h>
|
||||||
#include <appl/TextPluginManager.h>
|
#include <appl/TextPluginManager.h>
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ appl::textPluginManager::textPluginManager() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
void appl::textPluginManager::init(const std::string& _name) {
|
void appl::textPluginManager::init(const std::string& _name) {
|
||||||
ewol::Resource::init(_name);
|
gale::Resource::init(_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void appl::textPluginManager::addDefaultPlugin() {
|
void appl::textPluginManager::addDefaultPlugin() {
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <appl/TextPlugin.h>
|
#include <appl/TextPlugin.h>
|
||||||
|
|
||||||
namespace appl {
|
namespace appl {
|
||||||
class textPluginManager : public ewol::Resource {
|
class textPluginManager : public gale::Resource {
|
||||||
private:
|
private:
|
||||||
std::weak_ptr<appl::TextViewer> m_currentViewer;
|
std::weak_ptr<appl::TextViewer> m_currentViewer;
|
||||||
std::list<std::shared_ptr<appl::TextViewerPlugin>> m_list;
|
std::list<std::shared_ptr<appl::TextViewerPlugin>> m_list;
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <appl/TextPluginMultiLineTab.h>
|
#include <appl/TextPluginMultiLineTab.h>
|
||||||
#include <ewol/context/clipBoard.h>
|
|
||||||
#include <appl/Gui/TextViewer.h>
|
#include <appl/Gui/TextViewer.h>
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
@ -28,11 +27,11 @@ bool appl::TextPluginMultiLineTab::onEventEntry(appl::TextViewer& _textDrawer,
|
|||||||
if (isEnable() == false) {
|
if (isEnable() == false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (_event.getType() != ewol::key::keyboardChar) {
|
if (_event.getType() != gale::key::keyboard_char) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//APPL_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent);
|
//APPL_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent);
|
||||||
if (_event.getStatus() != ewol::key::statusDown) {
|
if (_event.getStatus() != gale::key::status_down) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
char32_t localValue = _event.getChar();
|
char32_t localValue = _event.getChar();
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <appl/TextPluginRmLine.h>
|
#include <appl/TextPluginRmLine.h>
|
||||||
#include <ewol/context/clipBoard.h>
|
|
||||||
#include <appl/Gui/TextViewer.h>
|
#include <appl/Gui/TextViewer.h>
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <appl/TextPluginSelectAll.h>
|
#include <appl/TextPluginSelectAll.h>
|
||||||
#include <ewol/context/clipBoard.h>
|
|
||||||
#include <appl/Gui/TextViewer.h>
|
#include <appl/Gui/TextViewer.h>
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include <appl/globalMsg.h>
|
#include <appl/globalMsg.h>
|
||||||
#include <ewol/object/Object.h>
|
#include <ewol/object/Object.h>
|
||||||
#include <ewol/context/Context.h>
|
#include <ewol/context/Context.h>
|
||||||
#include <ewol/resource/Manager.h>
|
#include <gale/resource/Manager.h>
|
||||||
#include <etk/os/FSNode.h>
|
#include <etk/os/FSNode.h>
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <etk/tool.h>
|
#include <etk/tool.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
//#include <ewol/config.h>
|
//#include <ewol/config.h>
|
||||||
#include <ewol/context/commandLine.h>
|
#include <gale/context/commandLine.h>
|
||||||
//#include <ewol/UserConfig.h>
|
//#include <ewol/UserConfig.h>
|
||||||
#include <ewol/context/Context.h>
|
#include <ewol/context/Context.h>
|
||||||
#include <appl/TextPluginManager.h>
|
#include <appl/TextPluginManager.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user