[DEV] integarate std x11

This commit is contained in:
Edouard DUPIN 2013-11-11 20:20:25 +01:00
parent 4731dae6e4
commit a5b44ae974
12 changed files with 56 additions and 27 deletions

View File

@ -226,7 +226,7 @@ bool BufferView::getElement(int32_t _colomn, int32_t _raw, etk::UString& _myText
return true; return true;
} }
bool BufferView::onItemEvent(int32_t _IdInput, ewol::keyEvent::status_te _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y) bool BufferView::onItemEvent(int32_t _IdInput, enum ewol::keyEvent::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y)
{ {
if (1 == _IdInput && _typeEvent == ewol::keyEvent::statusSingle) { if (1 == _IdInput && _typeEvent == ewol::keyEvent::statusSingle) {
APPL_INFO("Event on List : IdInput=" << _IdInput << " colomn=" << _colomn << " raw=" << _raw ); APPL_INFO("Event on List : IdInput=" << _IdInput << " colomn=" << _colomn << " raw=" << _raw );

View File

@ -64,7 +64,7 @@ class BufferView : public widget::List
virtual bool getTitle(int32_t _colomn, etk::UString& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg); virtual bool getTitle(int32_t _colomn, etk::UString& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg);
virtual uint32_t getNuberOfRaw(void); virtual uint32_t getNuberOfRaw(void);
virtual bool getElement(int32_t _colomn, int32_t _raw, etk::UString& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg); virtual bool getElement(int32_t _colomn, int32_t _raw, etk::UString& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg);
virtual bool onItemEvent(int32_t _IdInput, ewol::keyEvent::status_te _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y); virtual bool onItemEvent(int32_t _IdInput, enum ewol::keyEvent::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y);
}; };

View File

@ -308,7 +308,7 @@ void MainWindows::onReceiveMessage(const ewol::EMessage& _msg) {
} }
// apply widget pop-up ... // apply widget pop-up ...
popUpWidgetPush(tmpWidget); popUpWidgetPush(tmpWidget);
tmpWidget->registerOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected); tmpWidget->registerOnEvent(this, widget::FileChooser::eventValidate, ednEventPopUpFileSelected);
} else if (_msg.getMessage() == ednEventPopUpFileSelected) { } else if (_msg.getMessage() == ednEventPopUpFileSelected) {
APPL_DEBUG("Request opening the file : " << _msg.getData()); APPL_DEBUG("Request opening the file : " << _msg.getData());
if (m_bufferManager == NULL) { if (m_bufferManager == NULL) {
@ -326,7 +326,7 @@ void MainWindows::onReceiveMessage(const ewol::EMessage& _msg) {
appl::Buffer* tmpBuffer = m_bufferManager->getBufferSelected(); appl::Buffer* tmpBuffer = m_bufferManager->getBufferSelected();
if (tmpBuffer == NULL) { if (tmpBuffer == NULL) {
APPL_WARNING("No buffer selected !!! "); APPL_WARNING("No buffer selected !!! ");
createPopUpMessage(widget::Windows::messageTypeError, "No buffer selected !!!"); createPopUpMessage(ewol::Windows::messageTypeError, "No buffer selected !!!");
return; return;
} }
// Note : for direct saving, we do not chack the saving status ==> all time saving ... // Note : for direct saving, we do not chack the saving status ==> all time saving ...

View File

@ -85,7 +85,7 @@ bool appl::TagFileList::getElement(int32_t _colomn, int32_t _raw, etk::UString&
}; };
bool appl::TagFileList::onItemEvent(int32_t _IdInput, ewol::keyEvent::status_te _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y) { bool appl::TagFileList::onItemEvent(int32_t _IdInput, enum ewol::keyEvent::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y) {
if (_typeEvent == ewol::keyEvent::statusSingle) { if (_typeEvent == ewol::keyEvent::statusSingle) {
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) {

View File

@ -44,7 +44,7 @@ namespace appl {
bool getTitle(int32_t _colomn, etk::UString& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg); bool getTitle(int32_t _colomn, etk::UString& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg);
uint32_t getNuberOfRaw(void); uint32_t getNuberOfRaw(void);
bool getElement(int32_t _colomn, int32_t _raw, etk::UString& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg); bool getElement(int32_t _colomn, int32_t _raw, etk::UString& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg);
bool onItemEvent(int32_t _IdInput, ewol::keyEvent::status_te _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y); bool onItemEvent(int32_t _IdInput, enum ewol::keyEvent::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y);
// derived function // derived function
const char * const getObjectType(void) { const char * const getObjectType(void) {
return "appl::TagFileList"; return "appl::TagFileList";

View File

@ -530,7 +530,7 @@ appl::Buffer::Iterator appl::TextViewer::getMousePosition(const vec2& _relativeP
return m_buffer->end(); return m_buffer->end();
} }
void appl::TextViewer::onEventClipboard(ewol::clipBoard::clipboardListe_te _clipboardID) { void appl::TextViewer::onEventClipboard(enum ewol::clipBoard::clipboardListe _clipboardID) {
if (m_buffer != NULL) { if (m_buffer != NULL) {
etk::UString data = ewol::clipBoard::get(_clipboardID); etk::UString data = ewol::clipBoard::get(_clipboardID);
write(data); write(data);

View File

@ -61,7 +61,7 @@ namespace appl {
virtual void onObjectRemove(ewol::EObject* _removeObject); virtual void onObjectRemove(ewol::EObject* _removeObject);
virtual bool onEventInput(const ewol::EventInput& _event); virtual bool onEventInput(const ewol::EventInput& _event);
virtual bool onEventEntry(const ewol::EventEntry& _event); virtual bool onEventEntry(const ewol::EventEntry& _event);
virtual void onEventClipboard(ewol::clipBoard::clipboardListe_te clipboardID); virtual void onEventClipboard(enum ewol::clipBoard::clipboardListe _clipboardID);
virtual void onGetFocus(void); virtual void onGetFocus(void);
virtual void onLostFocus(void); virtual void onLostFocus(void);
private: private:

View File

@ -172,7 +172,7 @@ void appl::Highlight::parse(int32_t start,
//APPL_DEBUG("Parse element in the buffer id=" << elementStart); //APPL_DEBUG("Parse element in the buffer id=" << elementStart);
//try to fond the HL in ALL of we have //try to fond the HL in ALL of we have
for (int32_t jjj=0; jjj<m_listHighlightPass1.size(); jjj++){ for (int32_t jjj=0; jjj<m_listHighlightPass1.size(); jjj++){
resultFind_te ret = HLP_FIND_OK; enum resultFind ret = HLP_FIND_OK;
//APPL_DEBUG("Parse HL id=" << jjj << " position search: (" << start << "," << buffer.size() << ")" ); //APPL_DEBUG("Parse HL id=" << jjj << " position search: (" << start << "," << buffer.size() << ")" );
// Stop the search to the end (to get the end of the pattern) // Stop the search to the end (to get the end of the pattern)
ret = m_listHighlightPass1[jjj]->find(elementStart, buffer.size(), resultat, buffer); ret = m_listHighlightPass1[jjj]->find(elementStart, buffer.size(), resultat, buffer);
@ -232,7 +232,7 @@ void appl::Highlight::parse2(int32_t start,
//try to fond the HL in ALL of we have //try to fond the HL in ALL of we have
int32_t jjj; int32_t jjj;
for (jjj=0; jjj<m_listHighlightPass2.size(); jjj++){ for (jjj=0; jjj<m_listHighlightPass2.size(); jjj++){
resultFind_te ret = HLP_FIND_OK; enum resultFind ret = HLP_FIND_OK;
//APPL_DEBUG("Parse HL id=" << jjj << " position search: (" << start << "," << buffer.size() << ")" ); //APPL_DEBUG("Parse HL id=" << jjj << " position search: (" << start << "," << buffer.size() << ")" );
// Stop the search to the end (to get the end of the pattern) // Stop the search to the end (to get the end of the pattern)
ret = m_listHighlightPass2[jjj]->find(elementStart, elementStop, resultat, buffer); ret = m_listHighlightPass2[jjj]->find(elementStart, elementStop, resultat, buffer);

View File

@ -140,7 +140,7 @@ void appl::HighlightPattern::parseRules(exml::Element* _child, int32_t _level) {
} }
resultFind_te appl::HighlightPattern::find(int32_t _start, enum resultFind appl::HighlightPattern::find(int32_t _start,
int32_t _stop, int32_t _stop,
appl::HighlightInfo& _resultat, appl::HighlightInfo& _resultat,
etk::Buffer& _buffer) { etk::Buffer& _buffer) {

View File

@ -20,11 +20,11 @@ class HighlightPattern;
#include <exml/exml.h> #include <exml/exml.h>
#include <etk/Buffer.h> #include <etk/Buffer.h>
typedef enum { enum resultFind {
HLP_FIND_ERROR, HLP_FIND_ERROR,
HLP_FIND_OK, HLP_FIND_OK,
HLP_FIND_OK_NO_END, HLP_FIND_OK_NO_END,
}resultFind_te; };
namespace appl { namespace appl {
class HighlightPattern { class HighlightPattern {
@ -92,7 +92,7 @@ namespace appl {
* @return HLP_FIND_OK_NO_END Xe find a partial pattern (missing end) * @return HLP_FIND_OK_NO_END Xe find a partial pattern (missing end)
* @return HLP_FIND_ERROR Not find the pattern * @return HLP_FIND_ERROR Not find the pattern
*/ */
resultFind_te find(int32_t _start, enum resultFind find(int32_t _start,
int32_t _stop, int32_t _stop,
appl::HighlightInfo& _resultat, appl::HighlightInfo& _resultat,
etk::Buffer& _buffer); etk::Buffer& _buffer);

View File

@ -111,7 +111,7 @@ void CTagsManager::onReceiveMessage(const ewol::EMessage& _msg) {
tmpWidget->setTitle("Open Exuberant Ctags file"); tmpWidget->setTitle("Open Exuberant Ctags file");
tmpWidget->setValidateLabel("Open"); tmpWidget->setValidateLabel("Open");
ewol::getContext().getWindows()->popUpWidgetPush(tmpWidget); ewol::getContext().getWindows()->popUpWidgetPush(tmpWidget);
tmpWidget->registerOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpCtagsLoadFile); tmpWidget->registerOnEvent(this, widget::FileChooser::eventValidate, ednEventPopUpCtagsLoadFile);
} }
} else if (_msg.getData() == "ReLoad") { } else if (_msg.getData() == "ReLoad") {
APPL_INFO("Request re-load ctag file"); APPL_INFO("Request re-load ctag file");

View File

@ -29,26 +29,56 @@
#include <appl/ctags/readtags.h> #include <appl/ctags/readtags.h>
#include <appl/ctags/CTagsManager.h> #include <appl/ctags/CTagsManager.h>
#include <appl/globalMsg.h> #include <appl/globalMsg.h>
#include <vector>
#include <string>
#include <etk/unicode.h>
char32_t mychar32;
/** /**
* @brief Main of the program (This can be set in every case, but it is not used in Andoid...). * @brief Main of the program (This can be set in every case, but it is not used in Andoid...).
* @param std IO * @param std IO
* @return std IO * @return std IO
*/ */
int main(int _argc, const char *_argv[]) int main(int _argc, const char *_argv[]) {
{
// only one things to do: // only one things to do:
return ewol::run(_argc, _argv); return ewol::run(_argc, _argv);
} }
appl::BufferManager* bufferManager = NULL; appl::BufferManager* bufferManager = NULL;
etk::CCout& operator <<(etk::CCout& _os, const std::u32string& _obj) {
etk::Vector<etk::UChar> tmpp;
for (size_t iii=0; iii<_obj.size(); ++iii) {
tmpp.pushBack(_obj[iii]);
}
etk::Vector<char> output_UTF8;
unicode::convertUnicodeToUtf8(tmpp, output_UTF8);
output_UTF8.pushBack('\0');
_os << &output_UTF8[0];
return _os;
}
/** /**
* @brief main application function initialisation * @brief main application function initialisation
*/ */
bool APP_Init(ewol::eContext& _context) bool APP_Init(ewol::eContext& _context) {
{
APPL_INFO(" == > init APPL (START) [" << ewol::getBoardType() << "] (" << ewol::getCompilationMode() << ")"); APPL_INFO(" == > init APPL (START) [" << ewol::getBoardType() << "] (" << ewol::getCompilationMode() << ")");
std::vector<int32_t> valueExample;
valueExample.push_back(23);
valueExample.push_back(23);
valueExample.push_back(23);
valueExample.push_back(23);
APPL_INFO("test de vector : " << valueExample[0]);
std::cout << "test de debug direct ..." << std::endl;
std::cerr << "test de debug direct .2." << std::endl;
std::u32string ploppppp;
ploppppp = U"exemple de texte sans accent : ";
APPL_INFO( "retert : " << ploppppp);
APPL_CRITICAL("kjkjhkjh");
// TODO : remove this : Move if in the windows properties // TODO : remove this : Move if in the windows properties
_context.setSize(vec2(800, 600)); _context.setSize(vec2(800, 600));
@ -117,7 +147,7 @@ bool APP_Init(ewol::eContext& _context)
} }
} }
APPL_INFO(" == > init "PROJECT_NAME" (END)"); APPL_INFO(" == > init " PROJECT_NAME " (END)");
return true; return true;
} }
@ -125,9 +155,8 @@ bool APP_Init(ewol::eContext& _context)
/** /**
* @brief main application function Un-Initialisation * @brief main application function Un-Initialisation
*/ */
void APP_UnInit(ewol::eContext& _context) void APP_UnInit(ewol::eContext& _context) {
{ APPL_INFO(" == > Un-Init " PROJECT_NAME " (START)");
APPL_INFO(" == > Un-Init "PROJECT_NAME" (START)");
ewol::Windows* tmpWindows = _context.getWindows(); ewol::Windows* tmpWindows = _context.getWindows();
_context.setWindows(NULL); _context.setWindows(NULL);
@ -147,6 +176,6 @@ void APP_UnInit(ewol::eContext& _context)
appl::BufferManager::release(bufferManager); appl::BufferManager::release(bufferManager);
bufferManager = NULL; bufferManager = NULL;
} }
APPL_INFO(" == > Un-Init "PROJECT_NAME" (END)"); APPL_INFO(" == > Un-Init " PROJECT_NAME " (END)");
} }