From 699564e17fc08dd2d39fe2bf8f641c18bd81a89b Mon Sep 17 00:00:00 2001 From: Edouard Dupin Date: Sat, 18 Aug 2012 21:06:21 +0200 Subject: [PATCH] change the clipboard system (normalisation and standardisation --- Makefile | 5 +- Sources/appl/Buffer/Buffer.h | 6 +- Sources/appl/Buffer/BufferText.cpp | 8 +-- Sources/appl/Buffer/BufferText.h | 6 +- Sources/appl/Gui/CodeView.cpp | 16 ++++- Sources/appl/Gui/CodeView.h | 7 ++ {Android => os-Android}/AndroidManifest.xml | 0 {Android => os-Android}/Application.mk | 0 {Android => os-Android}/build.xml | 0 {Android => os-Android}/local.properties | 0 {Android => os-Android}/proguard.cfg | 0 {Android => os-Android}/project.properties | 0 .../res/drawable/ic_luncher_edn.png | Bin os-Linux/README | 67 ++++++++++++++++++ 14 files changed, 101 insertions(+), 14 deletions(-) rename {Android => os-Android}/AndroidManifest.xml (100%) rename {Android => os-Android}/Application.mk (100%) rename {Android => os-Android}/build.xml (100%) rename {Android => os-Android}/local.properties (100%) rename {Android => os-Android}/proguard.cfg (100%) rename {Android => os-Android}/project.properties (100%) rename {Android => os-Android}/res/drawable/ic_luncher_edn.png (100%) create mode 100644 os-Linux/README diff --git a/Makefile b/Makefile index c4316f9..470079d 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,10 @@ PROJECT_VENDOR=heeroyui # Binary name ... (no dot, no MAJ no Numerical char) PROJECT_NAME=edn -USER_PACKAGES=$(shell pwd)/Sources/ +# Add package needed +USER_PACKAGES =$(shell pwd)/Sources/ +# Add ewol packages : +USER_PACKAGES+=$(shell realpath $(shell pwd)/../ewol/Sources/) # include basic makefile for EWOL include $(shell pwd)/../ewol/Build/Makefile.mk diff --git a/Sources/appl/Buffer/Buffer.h b/Sources/appl/Buffer/Buffer.h index 48550d8..2679b6a 100644 --- a/Sources/appl/Buffer/Buffer.h +++ b/Sources/appl/Buffer/Buffer.h @@ -103,9 +103,9 @@ class Buffer { virtual void SetCharset(unicode::charset_te newCharset) {}; //virtual void SelectAll(void); - virtual void Copy(int8_t clipboardID) {}; - virtual void Cut(int8_t clipboardID) {}; - virtual void Paste(int8_t clipboardID) {}; + virtual void Copy(ewol::clipBoard::clipboardListe_te clipboardID) {}; + virtual void Cut(ewol::clipBoard::clipboardListe_te clipboardID) {}; + virtual void Paste(ewol::clipBoard::clipboardListe_te clipboardID) {}; virtual void Search(etk::UString &data, bool back, bool caseSensitive, bool wrap, bool regExp) {}; virtual void Replace(etk::UString &data) {}; virtual int32_t FindLine(etk::UString &data) { return 0; }; diff --git a/Sources/appl/Buffer/BufferText.cpp b/Sources/appl/Buffer/BufferText.cpp index 42b3726..860e0b0 100644 --- a/Sources/appl/Buffer/BufferText.cpp +++ b/Sources/appl/Buffer/BufferText.cpp @@ -1155,7 +1155,7 @@ void BufferText::Replace(etk::UString &data) * @return --- * */ -void BufferText::Copy(int8_t clipboardID) +void BufferText::Copy(ewol::clipBoard::clipboardListe_te clipboardID) { etk::UString mVect; // get the curent selected data @@ -1175,7 +1175,7 @@ void BufferText::Copy(int8_t clipboardID) * @return --- * */ -void BufferText::Cut(int8_t clipboardID) +void BufferText::Cut(ewol::clipBoard::clipboardListe_te clipboardID) { int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd; @@ -1203,11 +1203,11 @@ void BufferText::Cut(int8_t clipboardID) * @return --- * */ -void BufferText::Paste(int8_t clipboardID) +void BufferText::Paste(ewol::clipBoard::clipboardListe_te clipboardID) { etk::UString mVect; // copy data from the click board : - ewol::clipBoard::Get(clipboardID, mVect); + mVect = ewol::clipBoard::Get(clipboardID); int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd; bool SelectionIsRect; diff --git a/Sources/appl/Buffer/BufferText.h b/Sources/appl/Buffer/BufferText.h index 180d732..77b7849 100644 --- a/Sources/appl/Buffer/BufferText.h +++ b/Sources/appl/Buffer/BufferText.h @@ -60,9 +60,9 @@ class BufferText : public Buffer { void MouseEventDouble(void); void MouseEventTriple(void); - void Copy(int8_t clipboardID); - void Cut(int8_t clipboardID); - void Paste(int8_t clipboardID); + 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); diff --git a/Sources/appl/Gui/CodeView.cpp b/Sources/appl/Gui/CodeView.cpp index 503a8f2..fc4a66b 100644 --- a/Sources/appl/Gui/CodeView.cpp +++ b/Sources/appl/Gui/CodeView.cpp @@ -193,6 +193,17 @@ bool CodeView::OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveTy return true; } +/** + * @brief Event on a past event ==> this event is asynchronous due to all system does not support direct getting datas + * @note : need to have focus ... + * @param[in] mode Mode of data requested + * @return --- + */ +void CodeView::OnEventClipboard(ewol::clipBoard::clipboardListe_te clipboardID) +{ + BufferManager::Get(m_bufferID)->Paste(clipboardID); + MarkToRedraw(); +} /** * @brief Event on an input of this Widget @@ -263,8 +274,7 @@ bool CodeView::OnEventInput(ewol::inputType_te type, int32_t IdInput, ewol::even } else if (2 == IdInput) { if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) { BufferManager::Get(m_bufferID)->MouseEvent(m_fontNormal, relativePos.x+m_originScrooled.x, relativePos.y+m_originScrooled.y); - BufferManager::Get(m_bufferID)->Paste(ewol::clipBoard::CLIPBOARD_SELECTION); - MarkToRedraw(); + ewol::clipBoard::Request(ewol::clipBoard::CLIPBOARD_SELECTION); ewol::widgetManager::FocusKeep(this); } } @@ -308,7 +318,7 @@ void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * event } else if (eventId == ednMsgGuiCut) { BufferManager::Get(m_bufferID)->Cut(ewol::clipBoard::CLIPBOARD_STD); } else if (eventId == ednMsgGuiPaste) { - BufferManager::Get(m_bufferID)->Paste(ewol::clipBoard::CLIPBOARD_STD); + ewol::clipBoard::Request(ewol::clipBoard::CLIPBOARD_STD); } else if (eventId == ednMsgGuiUndo) { BufferManager::Get(m_bufferID)->Undo(); } else if (eventId == ednMsgGuiRedo) { diff --git a/Sources/appl/Gui/CodeView.h b/Sources/appl/Gui/CodeView.h index 557393b..2b858e1 100644 --- a/Sources/appl/Gui/CodeView.h +++ b/Sources/appl/Gui/CodeView.h @@ -85,6 +85,13 @@ class CodeView :public ewol::WidgetScrooled virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, ewol::eventInputType_te typeEvent, Vector2D pos); virtual bool OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData); virtual bool OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveType_te moveTypeEvent); + /** + * @brief Event on a past event ==> this event is asynchronous due to all system does not support direct getting datas + * @note : need to have focus ... + * @param[in] mode Mode of data requested + * @return --- + */ + virtual void OnEventClipboard(ewol::clipBoard::clipboardListe_te clipboardID); virtual void OnGetFocus(void); virtual void OnLostFocus(void); diff --git a/Android/AndroidManifest.xml b/os-Android/AndroidManifest.xml similarity index 100% rename from Android/AndroidManifest.xml rename to os-Android/AndroidManifest.xml diff --git a/Android/Application.mk b/os-Android/Application.mk similarity index 100% rename from Android/Application.mk rename to os-Android/Application.mk diff --git a/Android/build.xml b/os-Android/build.xml similarity index 100% rename from Android/build.xml rename to os-Android/build.xml diff --git a/Android/local.properties b/os-Android/local.properties similarity index 100% rename from Android/local.properties rename to os-Android/local.properties diff --git a/Android/proguard.cfg b/os-Android/proguard.cfg similarity index 100% rename from Android/proguard.cfg rename to os-Android/proguard.cfg diff --git a/Android/project.properties b/os-Android/project.properties similarity index 100% rename from Android/project.properties rename to os-Android/project.properties diff --git a/Android/res/drawable/ic_luncher_edn.png b/os-Android/res/drawable/ic_luncher_edn.png similarity index 100% rename from Android/res/drawable/ic_luncher_edn.png rename to os-Android/res/drawable/ic_luncher_edn.png diff --git a/os-Linux/README b/os-Linux/README new file mode 100644 index 0000000..6453cae --- /dev/null +++ b/os-Linux/README @@ -0,0 +1,67 @@ +Edn +==== + +`Edn` (Editeur De N'ours) is a FREE software. + +This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. + +Instructions +============ + +download the software : + + mkdir yourDevFolder + cd yourDevFolder + git clone git://github.com/HeeroYui/ewol.git + cd ewol + git submodule init + git submodule update + cd .. + git clone git://github.com/HeeroYui/edn.git + cd edn + +(debug) Compile software & Run debug version: + + make DEBUG=1 + or + make CLANG=1 DEBUG=1 + ./out_LINUX/debug/obj/usr/bin/edn -l6 yourFile.txt + Note : -l6 corespond at the LOG level to display + +(release) Compile software & install & run: + + make + ./install.sh + edn exemple.txt + +(Android) Compile software & install + + cd yourDevFolder + mkdir andoid + cd android + download here in "sdk" and "ndk" the coresponding SDK and NDK of Android: + http://developer.android.com/tools/sdk/ndk/index.html + http://developer.android.com/sdk/index.html + ==> you need to download sub package of the NDK (refer to the NDK doccumentation) but only supported android version >4.0 + cd ../edn + make PLATFORM=Android + make PLATFORM=Android install + +License (like GPL) +================== + + You can: + - Redistribute the sources code and binaries. + - Modify the Sources code. + - Use a part of the sources (less than 50%) in an other software, just write somewhere "Edn is great" visible by the user (on your product or on your website with a link to my page). + - Redistribute the modification only if you want. + - Send me the bug-fix (it could be great). + - Pay me a beer or some other things. + - Print the source code on WC paper ... + You can NOT: + - Earn money with this Software (But I can). + - Add malware in the Sources. + - Do something bad with the sources. + - Use it to travel in the space with a toaster. + + I reserve the right to change this licence. If it change the version of the copy you have keep its own license