Compare commits

...

297 Commits

Author SHA1 Message Date
f10f23219b Update README.md 2016-09-01 08:25:36 +02:00
6a937ebb8c [RELEASE] create release 1.3.0 2016-08-31 23:55:01 +02:00
da184c6767 [DEV] update esignal removing ISignal 2016-08-04 22:23:19 +02:00
4667e78aa6 [DEBUG] correct some un-understanding not parse file type like hxx 2016-07-24 14:42:50 +02:00
c7de44171d [DEBUG] remove a error warning (bad patch but it work) 2016-07-24 14:29:27 +02:00
8d22c48dc3 [DEBUG] correct all xml config language 2016-07-21 15:57:06 +02:00
8094d7c5ab [DEBUG] correct the regex error in the super size regex pattern (.|\n|\r)*? ==> bad patern 2016-07-21 15:29:56 +02:00
64b9f31a53 [DEV] update new ememory::SharedPtr 2016-07-19 22:03:39 +02:00
c284ad0b3a [DEV] clean header file 2016-05-02 22:01:55 +02:00
8eb7fe9839 [DEV] remove __class__ 2016-05-02 21:29:34 +02:00
0b84458985 [DEV] update the change on 'enum' to 'enum class' 2016-04-29 23:16:07 +02:00
c0de59ac9a [DEV] update las t ejson 2016-04-29 21:47:54 +02:00
dbc6b3439d [DEV] update new ejson interface 2016-04-20 21:19:11 +02:00
c7efaf95ab [DEV] corrrect internal bug link with exml portage 2016-04-19 22:05:42 +02:00
ac0ab974f6 [DEV] Update with the new exml API 2016-04-18 21:01:17 +02:00
1a2f0b6d91 [DEV] update etk::FSNode 2016-04-08 22:10:37 +02:00
235847a1c6 [DEV] not-in-doc ==> not_in_doc and add parsing in c++ 2016-04-01 21:30:23 +02:00
948e672eb1 [DEV] try to find reg-ex bug 2016-03-20 22:46:45 +01:00
bc7ed8f729 [DEV] remove dependency of date 2016-03-17 22:52:51 +01:00
0d47ff22e2 [DEV] update new ewol 2016-03-16 23:09:36 +01:00
c251a419ad [DEBUG] correct the bug of close file and open again ar seg-fault when write 2016-03-15 22:33:06 +01:00
a265735cd1 [DEBUG] correct many bugs 2016-03-10 23:48:07 +01:00
1821f2927b [DEBUG] correct some super integration bug 2016-03-10 22:37:37 +01:00
badb11d80d [DEV] update new property interface 2016-03-02 09:32:23 +01:00
499dfcffe6 [DEV] update new e-property 2016-02-24 22:31:46 +01:00
3f5d2abc41 [DEV] update new esignal (not build) 2016-02-19 23:33:00 +01:00
3e3c47cfa9 [DEV] update new ewol interface 2016-02-15 22:04:10 +01:00
c0705be42c [DEV] add personnal parameter 2016-02-12 23:50:20 +01:00
9f96beced2 [DEV] update to the hide implementation of esignal implementation 2016-02-11 22:39:40 +01:00
aed62ff58b [DEV] update externalisation of signal and property 2016-02-11 21:45:21 +01:00
2d4aac44fb [DEV] change build position 2016-01-15 21:18:24 +01:00
d3d4650d62 [DEV] correct the regex parsing error in the second highlight pass 2016-01-15 00:01:58 +01:00
c9b86afea0 [DEBUG] set correct name of buffer 2015-10-21 22:12:01 +02:00
d1f0caf386 [DEBUG] set back the close buffer 2015-10-21 22:12:01 +02:00
6980c78684 [DEV] update Doc 2015-10-15 08:36:21 +02:00
b5ef639438 [DEV] update new lutin 0.8.0 2015-10-14 21:21:03 +02:00
590e84e486 [DEV] change package in library ==> change idea of a package 2015-09-11 22:26:32 +02:00
cca05c01c0 [DEV] update new lutin 2015-09-10 21:32:50 +02:00
dbac89199f [DEV] correct application interface (update) 2015-09-07 22:15:33 +02:00
52ee889ee5 [DEV] update error of parsing c++ 2015-08-28 22:39:32 +02:00
893213c6c9 Update README.md 2015-08-26 14:04:42 +02:00
b5ff73e030 [DEV] add gcov parsing 2015-08-25 21:21:41 +02:00
82836ac045 [CI] update travis with new interface (no sudo) 2015-08-24 23:55:27 +02:00
0db5f0c528 [DEV] better parsing python, php and cpp 2015-08-24 22:03:07 +02:00
f6c4f4f9b3 [DEV] better parsing python, php and cpp 2015-08-24 22:03:07 +02:00
2028030df6 [DEV] better parsing python, php and cpp 2015-08-24 22:03:07 +02:00
c6269cbfd6 [DEV] update language xml and php 2015-08-22 10:15:58 +02:00
d2a7464341 [DEV] typo error 2015-08-21 23:56:17 +02:00
1fcf8b8a74 [DEV] update at the new low level gale interface 2015-08-11 23:21:41 +02:00
ad32734537 [DEV] update the parsing of java an python 2015-07-01 21:40:47 +02:00
89afc13dce [CI] pip for lutin error binary name 2015-05-21 22:30:58 +02:00
32b0b76fb9 [DEV] update search access and unaccess 2015-05-21 21:21:01 +02:00
4e527931c7 [CI] travis update for lutin pip & ewol repo interface 2015-05-20 21:13:48 +02:00
e0bf7c77c2 [DEV] help command line 2015-05-12 21:16:32 +02:00
2a467a7a5d [BUILD] update new lutin 0.5.3 2015-05-08 22:47:23 +02:00
386f5ed011 [CI] update travis build 2015-04-22 21:29:53 +02:00
1359193a63 [DEV] update to etk buffer remove 2015-04-06 21:06:01 +02:00
192bd045fa [DEV] update new exml interface 2015-01-14 21:10:23 +01:00
0f64bad930 [DEV] update new ejson interface 2015-01-12 23:20:23 +01:00
d2e9ab8b1a [DEV] add split of view ==> integration not ended, but it work 2014-11-14 23:57:29 +01:00
e17c9f9cf7 [API] update new Parameter API 2014-10-29 22:54:43 +01:00
7340844d12 [API] update new signal interface 2014-10-29 21:16:56 +01:00
bd9e5f03f4 [DEV] feature hide buffer list when number of buffer <= 1 2014-10-27 21:24:48 +01:00
2330788ace [VALGRING] error in some system access 2014-10-23 23:52:19 +02:00
e3dc686ec9 [DEBUG] C syntax error display in c++ 2014-10-21 23:19:02 +02:00
3f4a71065d [DEV] separate c++ & C and add filename in title 2014-10-21 21:18:50 +02:00
cefe0aacdb [INTEGRATION] update travis compilation 2014-10-17 22:12:43 +02:00
3c79dec2c8 [INTEGRATION] add color in travis build 2014-10-17 09:02:57 +02:00
7f7b3283e3 [DEV] add update of clang to set it work with timer 2014-10-17 09:00:46 +02:00
7c37d8e549 [DEV] add sub parsing of pass1 2014-10-13 22:39:49 +02:00
a201439665 [DEV] Update the parsing of many languages (pyton, cmake) is now good 2014-10-09 21:23:19 +02:00
67a08dd775 [DEBUG] correction of end of file regexp change 2014-10-08 21:32:41 +02:00
7952872980 [DEV] better regex ==> need to update alge to recognise data 2014-10-07 21:42:07 +02:00
78887e64ed [DEV] correction of the regex and add some basic test example 2014-10-07 00:45:01 +02:00
d93844d6da [DEV] first std::regex really work in c++ 2014-10-06 23:22:14 +02:00
243d7e7494 [DEV] change in etk::RegExp in std::regex 2014-10-05 23:46:57 +02:00
154351e629 [ERROR] Abandonned version in std::u32string ==> unexistant regexp 2014-10-03 21:44:13 +02:00
febbaffdf4 [DEV] {remove etk regexp dependency} big rework in progress to simplify code and use real std::regex templates 2014-10-03 00:49:26 +02:00
b890f931ca [DEV] remove problematic function parsing 2014-10-02 22:40:40 +02:00
2c3a64933d [DEV] transform plugin manager in unique resource 2014-09-18 22:27:54 +02:00
b8962cc3b9 [DEV] set travis depend on dev branch of ewol 2014-09-18 21:32:25 +02:00
f9ff0b8899 [DEBUG] remove lutinBase.py that is deprecated 2014-09-18 21:07:32 +02:00
f971c4fdfe [DEBUG]travis file error 2014-09-18 21:05:48 +02:00
6076698201 Create .travis.yml 2014-09-18 21:01:41 +02:00
c12ed9e7fa [DEBUG #9] freez correction ==> plugin data missing iterator 2014-09-18 21:01:41 +02:00
e29aa94cc5 [DEBUG #8] CLose the file after saving it when request close 2014-09-15 07:27:51 +02:00
05ac6a9210 [DEBUG #2 #7] close file and save it whan needed 2014-09-15 07:21:22 +02:00
0a054c209f [DEV] add parenting between bufferManager and Buffer 2014-09-12 22:10:32 +02:00
996fd58370 [DEBUG #1] Save file done 2014-09-12 21:52:03 +02:00
3574fd917c [DEBUG #5] correct file selection 2014-09-12 21:36:20 +02:00
b889b4aa5a [DEV] update plugin 2014-08-29 22:52:21 +02:00
668570cdc7 [DEV] start correct plugin interface 2014-08-28 22:31:00 +02:00
7e6f56a1cd [DEV] this plugin to the new ewol interface 2014-08-27 22:58:21 +02:00
a371c09e22 [DEV] update new signal system ==> run but not have many capabilities 2014-08-25 22:44:42 +02:00
cd3c5ff2d4 [DEV] update new object interface & rework global message (start) 2014-08-25 05:55:06 +02:00
686ec6d8bd [DEV] remove caller in signal emit 2014-08-22 05:21:10 +02:00
d31137e1a3 [DEBUG] gcc compilation warning 2014-08-21 21:00:13 +02:00
03fa46bbcd [DEV] rework signal interface (step 1 normalisation) 2014-08-20 22:34:31 +02:00
7da1beb12d [CLEAN] remove unneeded code 2014-08-19 21:47:33 +02:00
ddd21072b5 [DEV] plop 2014-08-17 23:30:37 +02:00
bf7899e045 [DEV] remove function onObjectRemove 2014-08-15 23:28:04 +02:00
3f0febce28 [DEV] change default Instance 2014-08-13 22:30:47 +02:00
5a924f7c9d [DEV] remove cyclic dependence on shared_ptr 2014-08-08 23:25:43 +02:00
39801fd265 [DEV] start dev with generic std::shared_ptr ==> basic work 2014-08-07 23:41:48 +02:00
ebdfd8be4c [DEV] update regexp of the languages 2014-08-01 23:44:34 +02:00
1d60917575 [DEBUG] correct C regExp 2014-07-30 23:24:26 +02:00
86d54590c0 [DEV] update new regexp system (not work correctly and only for C++) 2014-07-29 15:36:12 +02:00
b9a1c026fa [DEV] remove etk_min and etk_max & etk::Color<> interface 2014-07-03 21:03:26 +02:00
4942765ccf [DEV] add file chooser in shared mode 2014-06-30 22:36:36 +02:00
a425bdc17b [DEV] change manager interface in application 2014-06-30 22:36:36 +02:00
7d7d66d121 [DEV] change NULL ==> nullptr 2014-06-30 22:36:36 +02:00
55e05d24a3 [DEV] update new interface EWOL ewol::constext::Application 2014-06-30 22:36:36 +02:00
173e57342d [TAG] create 1.2-dev tag 2014-06-30 22:36:36 +02:00
09425067dc [DEV] remove to many request of focus 2014-06-03 22:19:00 +02:00
780234de13 [DEBUG] remove error in the HL update 2014-06-02 21:40:02 +02:00
c421bd5f90 [DEV] remove compilation warning 2014-06-02 21:04:35 +02:00
3ec3fa00d9 [DEV] work corectly with refcounting object (and remove some memory leek at close) 2014-05-27 21:43:02 +02:00
9b21e5c769 [DEV] correction some internal memory leek 2014-05-26 21:42:51 +02:00
2157099f0a [DEV] new staep to owner 2014-05-25 21:17:06 +02:00
d18b202e75 [DEV] init remove remove windows 2014-05-23 12:37:38 +02:00
63834fe960 [DEBUG] plugin are object ==> set it in shared pointer 2014-05-22 22:06:13 +02:00
cab0e6009d [DEV] update to the new API, system start but not compleately work 2014-05-20 23:26:14 +02:00
08261def10 [DEV] start rework on shared pointer 2014-05-20 21:35:41 +02:00
304ac2ba45 [DEV] start rework for dev interface of ewol 2014-05-19 22:30:39 +02:00
2d8c5d588d [STYLE] remove (void) in () to be c++ coherent 2014-05-15 21:37:39 +02:00
f1543f6199 [DEV] correction of the filename display and management 2014-05-13 21:48:20 +02:00
7acd5127eb [DEV] update ctags 2014-05-12 21:10:45 +02:00
0c6151283b [DEV] change log system 2014-04-30 22:18:00 +02:00
8854a5a34b [DEV] update readme for ios 2014-04-24 21:01:08 +02:00
958138ecbb [DEV] update to the single finger move 2014-04-18 22:22:02 +02:00
44bc1dd277 [DEV] remove df text test 2014-04-17 21:31:02 +02:00
0821335de6 [DEBUG] error writing 2014-04-16 22:21:20 +02:00
8d0fc9023f update ewol main 2014-04-07 07:59:00 +02:00
4f0839221d [DEV] remove deprecated config 2014-03-13 21:50:14 +01:00
17101a38b0 [DEV] cmake file update 2014-03-04 21:18:41 +01:00
def986ab82 [DEV] add cmake missing file 2014-02-24 22:01:10 +01:00
7ebc20e936 [DEV] add CMake instance 2014-02-24 21:50:50 +01:00
f807faf55a [DEBUG ewol#2] set button in toggle mode 2014-02-13 21:27:21 +01:00
bca2019789 Update version tag : 1.1.1 2014-02-12 21:05:58 +01:00
108afd2d30 [DEV] change scrool in scroll 2014-01-22 21:38:06 +01:00
a7907cd9b5 [DEV] unset distance field for textViewer 2014-01-20 21:16:41 +01:00
8830d47b51 [DEV] add some edf (distance field file) 2014-01-19 19:18:13 +01:00
599e49bcfd [DEV] add change of the GUi form 2014-01-18 14:34:33 +01:00
78c6baa02f [DEV] set a better theme manaement on ewol 2014-01-17 23:02:15 +01:00
46b95656bd [DEV] update at the new distance field 2014-01-15 01:15:27 +01:00
e2b365cffb [DEV] add MacOs icon 2014-01-05 23:07:23 +01:00
bcf318dbec [DEV] update the text viewer on the new scroll event 2014-01-04 20:21:54 +01:00
55e45c1b6b [DOC] add monk website 2013-12-28 16:10:22 +01:00
eef2bf64b9 [DEV] update new message API 2013-12-28 15:25:53 +01:00
db8f379e30 [DEV] update to the etk normalisation 2013-12-28 14:23:25 +01:00
2fc47723f0 [DEV] add monk doc generator 2013-12-23 22:52:33 +01:00
29f0656dfa [DEV] update lutin naming 2013-12-23 22:38:46 +01:00
3a95113f82 [DEBUG] Correction of some android errors 2013-12-20 00:43:31 +01:00
450732a27b [DOC] add doc generation site 2013-12-14 09:32:23 +01:00
90b766d2c7 [DEV] update on EWOL 0.8.1 2013-12-13 21:50:40 +01:00
edb2ab58f2 [DEBUG] correction of some highlight error 2013-12-05 22:16:04 +01:00
9ce727e481 [DEV] add documentation generation 2013-12-04 23:48:05 +01:00
803e2dbc82 Update version tag : 1.1.0 2013-11-28 22:41:47 +01:00
c86a5d89a3 [DEBUG] tag creation error correction 2013-11-28 22:23:42 +01:00
bb0003170b [DEV] add a real stable tag 2013-11-28 21:56:35 +01:00
02c6e75822 [DEV] Update position on undo/redo & write char 2013-11-27 21:45:56 +01:00
14419a521b [DEV] correction of the insert cursor mode 2013-11-27 21:33:42 +01:00
b78455c8fd [DEBUG] Remove some unused element of c++11 in MacOs 2013-11-28 00:52:51 +01:00
357a8baa9a [DEV] add extra compilation flags & correct warning 2013-11-27 21:33:34 +01:00
cb20c0af2d [DEBUG] correction of the first char selection 2013-11-26 21:33:45 +01:00
48260131d3 [DEV] Add ctags jumping 2013-11-26 21:22:06 +01:00
cc5afe2d55 [DEV] debug history manager 2013-11-26 21:06:01 +01:00
4d999bbb67 [DEV] add ctags and select all plugin and correct the undo/redo plugin 2013-11-25 22:18:06 +01:00
b79578b7e1 [DEBUG] remove open folder 2013-11-25 21:20:13 +01:00
9c4d936d76 [DEBUG] Change the title name when rename and status change of a buffer 2013-11-25 21:09:23 +01:00
771a8826c4 [DEV] Reorder BufferView 2013-11-25 21:03:21 +01:00
b3ffe8c212 [DEBUG] Indentation error 2013-11-25 21:03:02 +01:00
aa05234752 [DEV] add std hl of c++ 2013-11-25 21:02:24 +01:00
d3440c153b [DEV] remove dependency of frend in the text viewer 2013-11-24 16:07:43 +01:00
157bd7bcd2 [DEV] add ctrl+w in plgin list (with no frend dependency 2013-11-24 15:27:57 +01:00
16bf6e7648 [DEBUG] correction of the mouse position adter TAB 2013-11-24 15:26:47 +01:00
60903845c1 [DEV] review all the search bar 2013-11-23 18:30:52 +01:00
a95a1e8033 [DEBUG] correction of the end cursor position 2013-11-23 12:25:42 +01:00
26d206caae [DEV] some display update 2013-11-22 21:48:05 +01:00
e15cb8e4b6 [DEV] many small correction 2013-11-21 21:56:22 +01:00
069c457407 [DEBUG] correction of the scrolling wrong position 2013-11-21 21:22:38 +01:00
4efed97130 [DEV] remember multiple last lene in a buffer when change it 2013-11-21 21:18:30 +01:00
0bef90462b [DEBUG] correction of the tabulation error 2013-11-21 21:13:54 +01:00
50579a93a0 [DEBUG] assertion correction 2013-11-20 21:57:00 +01:00
4ea4d0dc55 [DEV] first good vertion from many time... 2013-11-20 21:57:00 +01:00
872fde6bc2 [DEV] sava and close multiple file done 2013-11-19 21:43:43 +01:00
9ca83d1718 [DEV] multiple save and close start to work 2013-11-17 20:37:06 +01:00
e32253cd98 [DEV] start creating worker for display multiple saving 2013-11-15 23:42:00 +01:00
dc652a6237 [DEV] add control before closing buffer not saved... (not ended) 2013-11-14 23:44:55 +01:00
101f77dc3d [DEV] work with std::string 2013-11-14 21:57:10 +01:00
a5b44ae974 [DEV] integarate std x11 2013-11-11 20:20:25 +01:00
4731dae6e4 [DEV] add store 2013-11-07 21:08:57 +01:00
4693119e7d [DEV] test multiple display of one buffer 2013-10-30 21:16:38 +01:00
50c1830696 [DEV] buffer manager better work 2013-10-29 21:13:45 +01:00
7ddaa68bb0 [DEV] start rework buffer manager in resource 2013-10-28 21:47:51 +01:00
01692bdd13 [DEV] correct display with highlight ==> maybe rework the highlight 2013-10-27 20:36:54 +01:00
4d35830559 [DEV] add highlight parsing file 2013-10-27 11:34:45 +01:00
49649329eb [DEV] Add buffer iterator out of bounds control 2013-10-26 13:16:30 +02:00
925fed77f1 [DEV] update Debug in debug 2013-10-25 20:49:26 +02:00
8eb4aff266 [DEV] work on highlight 2013-10-25 22:12:34 +02:00
6f4a67b47b [DEV] glyph pattern might be ended 2013-10-24 21:09:58 +02:00
79b8f594d6 [DEV] think paintin glyph api 2013-10-24 07:46:24 +02:00
8c57b28d73 [DEV] start rework color and highlight 2013-10-23 21:19:30 +02:00
c8fd4183cd [DEV] add missing history plugin 2013-10-22 22:01:31 +02:00
c76f396526 [DEV] add indent one space by one space 2013-10-22 21:44:33 +02:00
29815eb46d [DEV] undo & redo implemented 2013-10-22 21:34:13 +02:00
4c9fb8a74e [DEV] start dev of smart indent 2013-10-21 22:11:16 +02:00
e6480b8cac [DEV] add scrolling and multiline indent module 2013-10-21 21:47:28 +02:00
4704eca027 [DEV] add plugin and rewrite to support the plugin 2013-10-20 18:14:22 +02:00
408a22015c [DEV] simplyfy accec of element with adding iterator 2013-10-18 22:23:52 +02:00
cf8a720924 [DEV] UniChar ==> UChar & Hach ==> Hash 2013-10-18 21:15:02 +02:00
16f78eaef2 [DEV] add copy/cut/paste in std clipboard 2013-10-18 21:01:11 +02:00
0b022d62fc [DEV] add replace of element when selection availlable 2013-10-17 22:23:11 +02:00
8e6d0cc379 [DEV] corect up and down line moving and selection double and triple 2013-10-17 21:57:31 +02:00
171014c86a [DEV] add mouse event 2013-10-16 21:55:45 +02:00
730f637695 [DEV] coding style review 2013-10-09 22:00:24 +02:00
d677075e16 [DEV] code style step 1 2013-10-07 22:04:21 +02:00
211c253116 [DEV] Add the replace mode 2013-09-30 22:32:36 +02:00
7643f5a736 [DEV] display element utf8 and up-down cursor 2013-09-30 00:08:52 +02:00
bd066da738 [DEV] move in the text view widget 2013-09-27 23:02:30 +02:00
1a56f4c49c [DEV] add element availlable ==> bug when adding special char 2013-09-26 22:16:40 +02:00
19d3750f01 [DEV] first display of the cursor 2013-09-26 22:15:39 +02:00
40bf24a095 [DEV] start rework buffer display 2013-09-19 22:23:31 +02:00
b98ee05d2a [DEV] add line at 80 char limitation and set tab at 8 char (not configurable for now) 2013-09-19 09:21:58 +02:00
c1ab16ec1f [DEV] add color at the /* TODO : */ 2013-09-17 17:48:04 +02:00
4d7f4d8531 [DEV] remove the end error 2013-09-02 21:06:50 +02:00
ad12b68ead [DEV] update to the new ewol system 2013-09-02 06:45:12 +02:00
b5371c4d13 [DEV] add json parsing 2013-08-01 23:22:58 +02:00
0240bced14 [DEV] update at the new color class 2013-07-09 15:18:53 +02:00
3747bffa2f [DEV] update last exml 2013-06-30 17:01:02 +02:00
1864f9aa75 [DEV] a little change in the exml lib 2013-06-28 22:13:21 +02:00
0a12bd17ed [DEV] add multiple font request 2013-06-27 21:40:48 +02:00
757a9a49ee [DEV] update for debian 2013-06-27 07:26:31 +02:00
6422d91883 [DEV] aupdate at exml api ==> tested and validate 2013-06-26 23:48:23 +02:00
24bb4f515c [DEV] start move to exml 2013-06-24 21:17:45 +02:00
86552172d7 [DEV] do not open folder like file (not open at all) 2013-06-12 22:58:11 +02:00
dcdfbe3647 [DEV] Save configuration of the user 2013-05-28 22:09:53 +02:00
421dc0c404 [DEV] revove dependency of the build date (use external lib) 2013-05-25 10:59:50 +02:00
9678d46cb1 [DISPLAY] english correction 2013-05-23 21:24:44 +02:00
1724955f67 [DEV] display code correction 2013-05-22 21:28:26 +02:00
543cd8ddf1 [DEV] editork work again like as previous 2013-05-21 09:50:19 +02:00
7b456f1cdb [DEV] change color of member 2013-05-21 09:11:50 +02:00
cd8b5772e9 Revert "[DEV] BROKEN-gitcc start dev of a naw mode of display for the Internal system"
This reverts commit 0633355169f59630eb5364564f82bf4f98226d8c.
2013-05-21 09:11:14 +02:00
0633355169 [DEV] BROKEN-gitcc start dev of a naw mode of display for the Internal system 2013-05-14 23:20:17 +02:00
52ac167872 [DEV] update the system interface 2013-05-12 21:08:31 +02:00
b55be0aeca [DEV] change the input and entry event function 2013-05-08 12:13:49 +02:00
e325bffc5e [RM] remove some deprecated files 2013-04-26 22:49:49 +02:00
b47d6f359d [DEV] remove old maker ==> replace by lutin 2013-04-24 21:33:38 +02:00
7d3e8d4d26 [DEBUG] date correction in maker 2013-04-24 21:33:38 +02:00
e85a34c988 [DEV] change date and time in only date to prevent multiple rebuild in one day 2013-04-24 12:48:28 +02:00
9f7af89567 [DEV] add the package property ok 2013-04-23 21:44:49 +02:00
8c241ef106 [DEV] add the package properties of the edn package 2013-04-22 21:57:24 +02:00
73c2e6a547 [DEV] change build to lutin mode 2013-04-21 22:15:45 +02:00
c5b6519dc6 [DEV] build the soft with the new builder 2013-04-18 18:02:27 +02:00
df24216dac [DEV] First file compiled with new python maker 2013-04-18 01:56:40 +02:00
b8c819936e [DEV] add python parser and start work on the python makefile 2013-04-17 21:40:05 +02:00
91c1201f69 [DEV] mac : missing font 2013-04-16 22:41:03 +02:00
3aac9ab9a7 [DEV] seems to work not so bak with the new ewol rework 2013-04-15 21:12:13 +02:00
e6d078e0c9 [DEV] add capacity od C highlight 2013-04-15 09:11:18 +02:00
af417b44f0 [DEV] work better than previously but this is the start of rework 2013-04-14 13:58:59 +02:00
aabc92f309 [DEV] base rework 2013-04-10 22:04:54 +02:00
46969e15b1 [DEV] mac dev ... 2013-04-07 23:40:49 +02:00
e1d2c2a3c7 [DEV] adapte to the EWOL modification of Sizer and const string callback 2013-03-25 21:30:16 +01:00
4139e88a6c [DEV] update config 2013-03-11 21:10:19 +01:00
dd6f05540f (DEV) add MacOs config and makefile 2013-03-09 17:33:28 +01:00
d2f2afd129 update android config 2013-03-03 20:58:59 +01:00
e97f6a77d4 [DEV] find the init bug 2013-03-03 20:43:00 +01:00
e56ade0856 [dev] add element on the glsl highlight 2013-03-02 12:03:26 +01:00
ed462a3b36 [DEV] better init of vec 2/3 2013-03-01 09:14:53 +01:00
c767266dfe [DEV] update to the new vector 3d 2013-01-28 22:46:48 +01:00
4f09da0f0f [DEV] update configs 2013-01-18 22:13:44 +01:00
50addbecbb [DEV] add the icon on X11 system 2013-01-11 23:14:15 +01:00
bc83eb599d [DEV] display icon on X11 2013-01-01 21:58:39 +01:00
bb9ce4f57f [DEV] some basic remove that might be done from long time 2012-12-27 21:17:53 +01:00
636f01e7aa [DEV] change the readme 2012-12-27 21:17:53 +01:00
7981763e4d [DEBUG] Correct some remove data in buffer error 2012-12-04 21:13:18 +01:00
fcb060c416 [DEV] adapte vector 2D, 3D and 4D wrapper with statdard glsl vec[2-4] ivec[2-4] and std mat4 2012-11-30 22:45:55 +01:00
33a9050df2 [DEV] Some updates 2012-12-02 20:34:00 +01:00
b403727f98 [DEV] Compilation is back on all platform 2012-11-26 23:07:40 +01:00
986abb85a0 [DEV] add GPLv3 license 2012-11-25 21:46:59 +01:00
42e042943c [DEV] update to the rework of ewol 2012-11-25 11:55:06 +01:00
247045c204 [DEV] Change the main position 2012-11-22 21:39:15 +01:00
90d01e42fe [DEV] update the configuration file 2012-11-21 22:21:33 +01:00
cc9fe3ac3f [DEV] Try to simplify the text editor with the buffer system ==> step 1 : remove the multiple type of buffer (text & empty) 2012-11-20 22:16:30 +01:00
37bbf8fccb [DEV] colorize text is back ==> missing cursor (unstable) 2012-11-20 07:35:46 +01:00
311c009fff [DEV] update to the etk::Buffer system 2012-11-19 21:33:44 +01:00
af38aaf01a [DEV] try to think about a simplest way to display the colored text 2012-11-19 22:38:36 +01:00
395c7e4893 [TEST] better test for the text 2012-11-19 10:00:12 +01:00
600bbd2a94 [TEST] the compositing system 2012-11-19 08:00:52 +01:00
f63828b3d6 [DEV] set a test display of the font display new system 2012-11-16 23:37:21 +01:00
89ab7e3eaf [DEV] select the embended font or the system font 2012-11-15 07:39:26 +01:00
c3838996f3 [DEV] change the internal system of register font ==> use system font 2012-11-13 22:50:35 +01:00
cab24c59ac [DEV] modify the makefiles 2012-11-12 17:19:18 +01:00
65d8dbe974 [DEV] Update to the new tree of the the sub lib 2012-11-10 16:28:29 +01:00
9cdd8e620b [DEV] update to the new tree of data 2012-11-09 09:59:31 +01:00
c6210d8c7e [dev] change the tag getting policy 2012-11-09 01:50:36 +01:00
96e2c91597 [TEST] reorder the dataBase 2012-11-09 00:47:42 +01:00
289 changed files with 14037 additions and 12516 deletions

70
.travis.yml Normal file
View File

@ -0,0 +1,70 @@
language:
- cpp
sudo: false
compiler:
- clang
- gcc
os:
- linux
- osx
branches:
only:
- master
- dev
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
install:
- echo "BUILDER = $BUILDER"
- echo "BOARD = $BOARD"
- echo "CONF = $CONF"
- pip install --user lutin
env:
matrix:
- CONF=debug BOARD=Linux
#- CONF=debug BOARD=Windows
#- CONF=debug BOARD=Android
- CONF=release BOARD=Linux
#- CONF=release BOARD=Windows
#- CONF=release BOARD=Android
exclude:
- compiler: clang
env: BOARD=Windows
- compiler: clang
env: BOARD=Android
before_script:
- cd ..
- mkdir bin
- curl https://storage.googleapis.com/git-repo-downloads/repo > bin/repo
- chmod a+x bin/repo
- git config --global user.email "travis@travis.com"
- git config --global user.name "Travis"
- git config --global color.ui "auto"
- git config --global core.editor "vi"
- mkdir framework
- cd framework
- ../bin/repo init -u https://github.com/HeeroYui/manifest.git
- ../bin/repo sync -j8
- cd ..
- pwd
- ls -l
- if [ "$CXX" == "clang++" ]; then BUILDER=clang; else BUILDER=gcc; fi
- if [ "$CXX" == "g++" ]; then COMPILATOR_OPTION="--compilator-version=4.9"; else COMPILATOR_OPTION=""; fi
script:
- lutin -C -P -t $BOARD -c $BUILDER $COMPILATOR_OPTION -m $CONF -p edn
notifications:
email:
- yui.heero@gmail.com

4
CMakeLists.txt Normal file
View File

@ -0,0 +1,4 @@
cmake_minimum_required(VERSION 2.8)
SUBDIRS(${CMAKE_CURRENT_SOURCE_DIR}/../ewol)
SUBDIRS(sources)

226
GPLv3.txt Normal file
View File

@ -0,0 +1,226 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for software and other kinds of works.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
0. Definitions.
“This License” refers to version 3 of the GNU General Public License.
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
A “covered work” means either the unmodified Program or a work based on the Program.
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -1,59 +0,0 @@
#############################################################################"
# main makefile for a basic application
# this is minimal application main makefile
#############################################################################"
# Project name ==> generate the application name [a-z] <== make attention at the case this generate error on Android compilation
PROJECT_NAME=edn
#Can be manny things, but limit whith no space no special char and no Maj ... [a-z]
# com : Commercial
# net : Network??
# org : Organisation
# gov : Governement
# mil : Military
# edu : Education
# pri : Private
# museum : ...
PROJECT_COMPAGNY_TYPE=org
# Compagny name of the project [a-zA-Z0-9 \-]
PROJECT_COMPAGNY_NAME=Edouard DUPIN
# List of mainainer that might be contact in problem case : "Mr NAME Surname<mail@host.com>" "second ..."
PROJECT_MAINTAINER="Mr DUPIN Edouard <yui.heero@gmail.com>"
# the icon of the project is all time needed ... if it is not present the ewol icon might be set (must be a .png file) (and no space in the fileName and filePath)
PROJECT_ICON=$(shell pwd)/data/icon.png
# project section : (must be separate by coma
# refer to : http://packages.debian.org/sid/
# admin cli-mono comm database debian-installer
# debug doc editors electronics devel embedded
# fonts games gnome gnu-r gnustep graphics
# hamradio haskell httpd interpreters java
# kde kernel libdevel libs lisp localization
# mail math misc net news ocaml oldlibs otherosfs
# perl php python ruby science shells sound tex
# text utils vcs video virtual web x11 xfce zope ...
PROJECT_SECTION=Development,Editors
# project prority
# required : Packages which are necessary for the proper functioning of the system (usually, this means that dpkg functionality depends on these packages). Removing a required package may cause your system to become totally broken and you may not even be able to use dpkg to put things back, so only do so if you know what you are doing. Systems with only the required packages are probably unusable, but they do have enough functionality to allow the sysadmin to boot and install more software.
# important : Important programs, including those which one would expect to find on any Unix-like system. If the expectation is that an experienced Unix person who found it missing would say "What on earth is going on, where is foo?", it must be an important package.[6] Other packages without which the system will not run well or be usable must also have priority important. This does not include Emacs, the X Window System, TeX or any other large applications. The important packages are just a bare minimum of commonly-expected and necessary tools.
# standard : These packages provide a reasonably small but not too limited character-mode system. This is what will be installed by default if the user doesn't select anything else. It doesn't include many large applications.
# optional : (In a sense everything that isn't required is optional, but that's not what is meant here.) This is all the software that you might reasonably want to install if you didn't know what it was and don't have specialized requirements. This is a much larger system and includes the X Window System, a full TeX distribution, and many applications. Note that optional packages should not conflict with each other.
# extra : This contains all packages that conflict with others with required, important, standard or optional priorities, or are only likely to be useful if you already know what they are or have specialized requirements (such as packages containing only detached debugging symbols).
PROJECT_PRIORITY=optional
# description of the current project inside quote and no \n
PROJECT_DESCRIPTION="Text editor for sources code with ctags management"
# Add package needed :
# current user packages
USER_PACKAGES =$(shell pwd)/Sources/
# Add ewol packages
USER_PACKAGES+=$(shell realpath $(shell pwd)/../ewol/Sources/)
# include basic makefile for ewol generic toolchain
include $(shell pwd)/../ewol/Build/Makefile.mk

155
README.md
View File

@ -5,64 +5,141 @@ Edn
This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
[![Build Status](https://travis-ci.org/HeeroYui/edn.svg?branch=dev)](https://travis-ci.org/HeeroYui/edn)
Instructions
============
download the software :
need google repo:
-----------------
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
see: http://source.android.com/source/downloading.html#installing-repo
mkdir ~/.bin
PATH=~/.bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
chmod a+x ~/.bin/repo
download Build system:
----------------------
sudo pip install lutin
sudo pip install pillow
download the Framework:
----------------------
mkdir -p WORKING_DIRECTORY/framework
cd WORKING_DIRECTORY/framework
repo init -u git://github.com/atria-soft/manifest.git
repo sync -j8
cd ../..
download the software:
----------------------
mkdir -p WORKING_DIRECTORY/application
cd WORKING_DIRECTORY/application
git clone https://github.com/HeeroYui/edn.git
cd ../..
Compile software:
-----------------
cd WORKING_DIRECTORY
lutin -C -P edn
(debug) Compile software & Run debug version:
make DEBUG=1
or
make CLANG=1 DEBUG=1
cp -r ../ewol/share/* share/
./out_LINUX/debug/obj/usr/bin/edn -l6 yourFile.txt
Note : -l6 corespond at the LOG level to display
lutin -C -P -m debug edn
# or
lutin -C -P -c clang -m debug edn
# full compile and run:
lutin -C -P -m debug edn?build?run:--elog-level=5
(release) Compile software & install & run:
make
./install.sh
edn exemple.txt
(release) Compile software & install:
# generate binary, tree, package and install it ...
lutin -C -P edn?install
(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
cd ..
# Generate package and install on Android device (in debug mode a generic key is set)
lutin -C -P -t Android -m debug edn?install
# to show the log :
lutin -C -P -t Android edn?log
License (like GPL)
(Windows) Compile software
lutin -C -P -t Windows -m debug edn
(MAC) All needed and some useful packages
- Git access (client you want or : http://code.google.com/p/git-osx-installer/ ==>need a ctrl+click to remove the normal installation control)
- Xcode ==> for all developement packages
- in Xcode : XCode->Setting->Download and install component: "Command Line Tools"
lutin -C -P -m debug edn
(IOs) All needed and some useful packages
- Git access (client you want or : http://code.google.com/p/git-osx-installer/ ==>need a ctrl+click to remove the normal installation control)
- Xcode ==> for all developement packages
- in Xcode : XCode->Setting->Download and install component: "Command Line Tools"
for porting on IOs you need a developper account
# compile and install on simulator (no developper account needed)
lutin -C -P -t IOs -m debug --simulation edn?install
# launch IOs simulator in xcode, and your application will appear on the second page (32 bit mode only)
# compile and install on board
lutin -C -P -t IOs -m debug edn?install
# compile and install on board and debug mode :
lutin -C -P -t IOs -m debug --simulation edn?log
Dependency packages
===================
sudo apt-get install g++ libgl1-mesa-dev zlib1g-dev libasound2-dev
# if you want to compile with clang :
sudo apt-get install clang
# if you want to compile for windows :
sudo apt-get install mingw32
License (GPLv3)
==================
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.
Edn (Editeur De N'ours) : Source code editor
Copyright (C) Copyright 2010 Edouard DUPIN
I reserve the right to change this licence. If it change the version of the copy you have keep its own license
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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

@ -1,44 +0,0 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# load the common sources file of the platform
include $(LOCAL_PATH)/file.mk
LOCAL_CONFIG_FILES := Config.in
# name of the librairy
ifeq ($(CONFIG___EWOL_APPL_NAME__),$(empty))
LOCAL_MODULE := edn
else
LOCAL_MODULE := $(call convert-special-char,$(CONFIG___EWOL_APPL_NAME__))
endif
# get the tag of the current project :
LOCAL_VERSION_TAG=$(shell cd $(LOCAL_PATH) ; git describe --tags)
LOCAL_VERSION_TAG_SHORT=$(shell cd $(LOCAL_PATH) ; git describe --tags --abbrev=0)
$(info $(LOCAL_MODULE) version TAG : $(LOCAL_VERSION_TAG))
# name of the dependency
LOCAL_LIBRARIES := ewol freetype libpng parsersvg tinyxml lua etk libzip
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(addprefix $(LOCAL_PATH)/, $(sort $(dir $(FILE_LIST))))
LOCAL_SRC_FILES := $(FILE_LIST)
LOCAL_LDLIBS := -llog -landroid
ifeq ($(DEBUG),1)
LOCAL_CFLAGS := -D__MODE__Touch \
-DPROJECT_NAME="\"$(LOCAL_MODULE)\"" \
-DAPPL_VERSION_TAG_NAME="\"$(LOCAL_VERSION_TAG_SHORT)-$(BUILD_DIRECTORY_MODE)\""
else
LOCAL_CFLAGS := -D__MODE__Touch \
-DMODE_RELEASE \
-DPROJECT_NAME="\"$(LOCAL_MODULE)\"" \
-DAPPL_VERSION_TAG_NAME="\"$(LOCAL_VERSION_TAG_SHORT)-$(BUILD_DIRECTORY_MODE)\""
endif
include $(BUILD_SHARED_LIBRARY)

View File

@ -1,23 +0,0 @@
menu "General"
if __VIDEO__OPENGL_ES_2
choice
prompt "Buffer text configuration"
default APPL_BUFFER_FONT_NORMAL
help
Buffer display mode :
0 : Basic Sprite font mode.
==> Old standard mode fast but need to reaload distint font for every size
1 : Distance Field.
==> New theoric mode for the display of the font ==> really slow but insteresting ...
config APPL_BUFFER_FONT_NORMAL
bool "0: Basic Sprite font mode"
config APPL_BUFFER_FONT_DISTANCE_FIELD
bool "1: Distance Field"
endchoice
endif
if __VIDEO__OPENGL_ES_1
config APPL_BUFFER_FONT_NORMAL
bool
default y
endif
endmenu

View File

@ -1,42 +0,0 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# load the common sources file of the platform
include $(LOCAL_PATH)/file.mk
LOCAL_CONFIG_FILES := Config.in
# name of the librairy
ifeq ($(CONFIG___EWOL_APPL_NAME__),$(empty))
LOCAL_MODULE := edn
else
LOCAL_MODULE := $(call convert-special-char,$(CONFIG___EWOL_APPL_NAME__))
endif
# get the tag of the current project :
LOCAL_VERSION_TAG=$(shell cd $(LOCAL_PATH) ; git describe --tags)
LOCAL_VERSION_TAG_SHORT=$(shell cd $(LOCAL_PATH) ; git describe --tags --abbrev=0)
$(info $(LOCAL_MODULE) version TAG : $(LOCAL_VERSION_TAG))
# name of the dependency
LOCAL_STATIC_LIBRARIES := ewol
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(addprefix $(LOCAL_PATH)/, $(sort $(dir $(FILE_LIST))))
LOCAL_SRC_FILES := $(FILE_LIST)
LOCAL_LDLIBS :=
ifeq ($(DEBUG),1)
LOCAL_CFLAGS := -DPROJECT_NAME="\"$(LOCAL_MODULE)\"" \
-DAPPL_VERSION_TAG_NAME="\"$(LOCAL_VERSION_TAG_SHORT)-$(BUILD_DIRECTORY_MODE)\""
else
LOCAL_CFLAGS := -DMODE_RELEASE \
-DPROJECT_NAME="\"$(LOCAL_MODULE)\"" \
-DAPPL_VERSION_TAG_NAME="\"$(LOCAL_VERSION_TAG_SHORT)-$(BUILD_DIRECTORY_MODE)\""
endif
include $(BUILD_EXECUTABLE)

View File

@ -1,41 +0,0 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# load the common sources file of the platform
include $(LOCAL_PATH)/file.mk
LOCAL_CONFIG_FILES := Config.in
# name of the librairy
ifeq ($(CONFIG___EWOL_APPL_NAME__),$(empty))
LOCAL_MODULE := edn
else
LOCAL_MODULE := $(call convert-special-char,$(CONFIG___EWOL_APPL_NAME__))
endif
# get the tag of the current project :
LOCAL_VERSION_TAG=$(shell cd $(LOCAL_PATH) ; git describe --tags)
LOCAL_VERSION_TAG_SHORT=$(shell cd $(LOCAL_PATH) ; git describe --tags --abbrev=0)
$(info $(LOCAL_MODULE) version TAG : $(LOCAL_VERSION_TAG))
# name of the dependency
LOCAL_STATIC_LIBRARIES := ewol
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(addprefix $(LOCAL_PATH)/, $(sort $(dir $(FILE_LIST))))
LOCAL_SRC_FILES := $(FILE_LIST)
LOCAL_LDLIBS :=
ifeq ($(DEBUG),1)
LOCAL_CFLAGS := -DPROJECT_NAME="\"$(LOCAL_MODULE)\"" \
-DAPPL_VERSION_TAG_NAME="\"$(LOCAL_VERSION_TAG_SHORT)-$(BUILD_DIRECTORY_MODE)\""
else
LOCAL_CFLAGS := -DMODE_RELEASE \
-DPROJECT_NAME="\"$(LOCAL_MODULE)\"" \
-DAPPL_VERSION_TAG_NAME="\"$(LOCAL_VERSION_TAG_SHORT)-$(BUILD_DIRECTORY_MODE)\""
endif
include $(BUILD_EXECUTABLE)

View File

@ -1,140 +0,0 @@
/**
*******************************************************************************
* @file Buffer.c
* @brief Editeur De N'ours : Text Buffer
* @author Edouard DUPIN
* @date 08/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <appl/Debug.h>
#include <appl/global.h>
#include <Buffer.h>
#include <BufferManager.h>
#include <ewol/eObject/EObject.h>
#undef __class__
#define __class__ "Buffer"
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
Buffer::Buffer()
{
static int32_t fileBasicID = 0;
m_updatePositionRequested = false;
m_fileModify = true;
m_haveName = false;
etk::UString mString = "Untitle - ";
mString += fileBasicID++;
EWOL_DEBUG("Create buffer try name : \"" << mString << "\"");
SetFileName(mString);
m_haveName = false;
EWOL_DEBUG("Create buffer with name : " << m_fileName );
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
Buffer::Buffer(etk::FSNode &newName)
{
m_fileModify = false;
EWOL_DEBUG("Create buffer try name : \"" << newName << "\"");
SetFileName(newName);
EWOL_DEBUG("Create buffer with name : " << m_fileName );
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
Buffer::~Buffer(void)
{
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
bool Buffer::IsModify(void)
{
return m_fileModify;
}
void Buffer::SetModify(bool status)
{
if (status != m_fileModify) {
m_fileModify = status;
// TODO : Remove from here
etk::UString data = "Modify";
ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgBufferState, data);
}
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
bool Buffer::NeedToUpdateDisplayPosition(void)
{
bool tmpVal = m_updatePositionRequested;
m_updatePositionRequested = false;
return tmpVal;
}
etk::Vector2D<float> Buffer::GetBorderSize(void)
{
etk::Vector2D<float> tmpVal;
tmpVal.x = 30;
tmpVal.y = 30;
return tmpVal;
}
etk::Vector2D<float> Buffer::GetPosition(int32_t fontId,bool& centerRequested)
{
centerRequested = false;
etk::Vector2D<float> tmpVal;
tmpVal.x = 0;
tmpVal.y = 0;
return tmpVal;
}

View File

@ -1,149 +0,0 @@
/**
*******************************************************************************
* @file Buffer.h
* @brief Editeur De N'ours : Text Buffer (header)
* @author Edouard DUPIN
* @date 08/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __BUFFER_H__
#define __BUFFER_H__
#include <etk/UString.h>
#include <etk/os/FSNode.h>
#include <etk/unicode.h>
#include <ewol/ewol.h>
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;
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
#define TEXT_DISPLAY_TYPE OObject2DTextShader
#else
#define TEXT_DISPLAY_TYPE OObject2DTextColored
#endif
class Buffer {
public:
Buffer(void);
Buffer(etk::FSNode &newName);
virtual ~Buffer(void);
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;
}
virtual void Save(void) {};
bool IsModify(void);
protected:
void SetModify(bool status);
virtual void NameChange(void) { /*APPL_DEBUG("check name change ==> no HL change possible");*/};
public:
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate) {};
virtual void SetLineDisplay(uint32_t lineNumber) {};
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
virtual int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOText,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
#else
virtual int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
ewol::TEXT_DISPLAY_TYPE& OOTextBold,
ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
#endif
{
return ERR_NONE;
}
virtual void AddChar(uniChar_t unicodeData) {};
virtual void cursorMove(ewol::eventKbMoveType_te moveTypeEvent) {};
virtual void MouseSelectFromCursorTo(etk::Vector2D<float> pos) {};
virtual void MouseEvent(etk::Vector2D<float> pos) {};
virtual void MouseEventDouble(void) {};
virtual void MouseEventTriple(void) {};
virtual void RemoveLine(void) {};
virtual void SelectAll(void) {};
virtual void SelectNone(void) {};
virtual void Undo(void) {};
virtual void Redo(void) {};
virtual void SetCharset(unicode::charset_te newCharset) {};
//virtual void SelectAll(void);
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; };
virtual void JumpAtLine(int32_t newLine) {};
virtual int32_t GetCurrentLine(void) { return 0; };
virtual int32_t GetNumberOfLine(void) { return 1; };
// moving with cursor change position:
private:
bool m_updatePositionRequested; //!< if a position xhange in the windows ...
etk::Vector2D<float> m_maximumSize; //!< current maxSize of the buffer
protected:
void RequestUpdateOfThePosition(void) { m_updatePositionRequested = true; };
void SetMaximumSize(etk::Vector2D<float> maxSize) { m_maximumSize = maxSize; };
public:
bool NeedToUpdateDisplayPosition(void);
virtual etk::Vector2D<float> GetBorderSize(void); // this is to requested the minimum size for the buffer that is not consider as visible ...
virtual etk::Vector2D<float> GetPosition(int32_t fontId, bool& centerRequested);
etk::Vector2D<float> GetMaxSize(void) { return m_maximumSize; };
protected:
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
};
#endif

View File

@ -1,127 +0,0 @@
/**
*******************************************************************************
* @file BufferEmpty.cpp
* @brief Editeur De N'ours : Text Buffer (edit For No buffer Display)
* @author Edouard DUPIN
* @date 19/01/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <appl/Debug.h>
#include <appl/global.h>
#include <BufferEmpty.h>
#include <ColorizeManager.h>
#include <MainWindows.h>
#undef __class__
#define __class__ "BufferEmpty"
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
BufferEmpty::BufferEmpty()
{
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
BufferEmpty::~BufferEmpty(void)
{
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
int32_t BufferEmpty::Display(ewol::TEXT_DISPLAY_TYPE& OOText,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
#else
int32_t BufferEmpty::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
ewol::TEXT_DISPLAY_TYPE& OOTextBold,
ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
#endif
{
// Get color :
Colorize *myColor = NULL;
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
int32_t letterHeight = OOText.GetHeight();
#else
int32_t letterHeight = OOTextNormal.GetHeight();
#endif
etk::Vector2D<float> textPos;
textPos.x = 20;
textPos.y = sizeY - 20 - letterHeight;
etk::UString tmpDisplay ;
myColor = ColorizeManager::Get("normal");
tmpDisplay = "edn - Editeur De N'ours";
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
OOText.SetColor(myColor->GetFG());
OOText.SetBold(true);
OOText.SetItalic(false);
OOText.Text(textPos, tmpDisplay);
#else
OOTextBold.SetColor(myColor->GetFG());
OOTextBold.Text(textPos, tmpDisplay);
#endif
myColor = ColorizeManager::Get("commentDoxygen");
textPos.y = (int32_t)(textPos.y - letterHeight*1.30);
tmpDisplay = "No Buffer Availlable to display";
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
OOText.SetBold(false);
OOText.SetItalic(false);
OOText.SetColor(myColor->GetFG());
OOText.Text(textPos, tmpDisplay);
#else
OOTextNormal.SetColor(myColor->GetFG());
OOTextNormal.Text(textPos, tmpDisplay);
#endif
OOColored.SetColor(draw::color::white);
OOColored.Rectangle( 0, 0, sizeX, sizeY);
return ERR_NONE;
}

View File

@ -1,52 +0,0 @@
/**
*******************************************************************************
* @file BufferEmpty.h
* @brief Editeur De N'ours : Text Buffer (edit For No buffer Display) (header)
* @author Edouard DUPIN
* @date 19/01/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __BUFFER_EMPTY_H__
#define __BUFFER_EMPTY_H__
#include <Buffer.h>
class BufferEmpty : public Buffer {
public:
BufferEmpty(void);
virtual ~BufferEmpty(void);
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOText,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY);
#else
int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
ewol::TEXT_DISPLAY_TYPE& OOTextBold,
ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY);
#endif
};
#endif

View File

@ -1,609 +0,0 @@
/**
*******************************************************************************
* @file BufferManager.cpp
* @brief Editeur De N'ours : Text Buffer manager (sources)
* @author Edouard DUPIN
* @date 08/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <appl/Debug.h>
#include <appl/global.h>
#include <BufferManager.h>
#include <ewol/eObject/EObject.h>
#include <ewol/eObject/EObjectManager.h>
#undef __class__
#define __class__ "classBufferManager"
class classBufferManager: public ewol::EObject
{
public:
// Constructeur
classBufferManager(void);
~classBufferManager(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void)
{
return "ApplBufferManager";
}
public:
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
private:
// return the ID of the buffer allocated
// create a buffer with no element
int32_t Create(void);
// open curent filename
int32_t Open(etk::FSNode &myFile);
bool Remove(int32_t BufferID);
public:
int32_t GetSelected(void) { return m_idSelected;};
//void SetSelected(int32_t id) {m_idSelected = id;};
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);
private:
etk::Vector<Buffer*> listBuffer; //!< element List of the char Elements
void RemoveAll(void); //!< remove all buffer
int32_t m_idSelected;
Buffer * BufferNotExiste; //!< When an error arrive in get buffer we return the Error buffer (not writable)
};
// Constructeur
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
classBufferManager::classBufferManager(void)
{
// nothing to do ...
BufferNotExiste = new BufferEmpty();
m_idSelected = -1;
RegisterMultiCast(ednMsgGuiNew);
RegisterMultiCast(ednMsgOpenFile);
RegisterMultiCast(ednMsgGuiClose);
RegisterMultiCast(ednMsgGuiSave);
RegisterMultiCast(ednMsgCodeViewSelectedId);
RegisterMultiCast(ednMsgBufferId);
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
classBufferManager::~classBufferManager(void)
{
//clean All Buffer
APPL_INFO("~classBufferManager::RemoveAll();");
RemoveAll();
// clear The list of Buffer
APPL_INFO("~classBufferManager::listBuffer.Clear();");
listBuffer.Clear();
APPL_INFO("~classBufferManager::delete(BufferNotExiste);");
delete(BufferNotExiste);
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
{
ewol::EObject::OnReceiveMessage(CallerObject, eventId, data);
if (eventId == ednMsgBufferId) {
// select a new buffer ID :
if (data == "") {
APPL_ERROR("Request select buffer ID = \"\" ");
} else {
int32_t newID = -1;
sscanf(data.c_str(), "%d", &newID);
if(true == Exist(newID)) {
m_idSelected = newID;
} else {
m_idSelected = -1;
APPL_ERROR("Request a non existant ID : " << newID << " reset to -1...");
}
}
} else if (eventId == ednMsgGuiNew) {
int32_t newOne = Create();
if (-1 != newOne) {
m_idSelected = newOne;
SendMultiCast(ednMsgBufferId, m_idSelected);
SendMultiCast(ednMsgBufferListChange);
}
} else if (eventId == ednMsgOpenFile) {
if (data != "" ) {
etk::FSNode myFile(data);
APPL_DEBUG("request open file = \"" <<data << "\" ?= \"" << myFile << "\"");
int32_t newOne = Open(myFile);
if (-1 != newOne) {
m_idSelected = newOne;
SendMultiCast(ednMsgBufferId, m_idSelected);
SendMultiCast(ednMsgBufferListChange);
} else {
// TODO : notify user that we can not open the request file...
APPL_ERROR("Can not open the file : \"" << myFile << "\"");
}
}
} else if (eventId == ednMsgGuiSave) {
if (data == "") {
APPL_ERROR("Null data for close file ... ");
} else {
if (data == "current") {
// Check buffer existence
if(true == Exist(m_idSelected)) {
// If no name ==> request a Gui display ...
if (Get(m_idSelected)->HaveName() == false) {
SendMultiCast(ednMsgGuiSaveAs, "current");
} else {
Get(m_idSelected)->Save();
}
}
} else {
int32_t newId;
sscanf(data.c_str(), "%d", &newId);
if (false == Exist(newId)) {
APPL_ERROR("Request a save As with a non existant ID=" << newId);
} else {
// If no name ==> request a Gui display ...
if (Get(newId)->HaveName() == false) {
SendMultiCast(ednMsgGuiSaveAs, newId);
} else {
Get(m_idSelected)->Save();
}
}
SendMultiCast(ednMsgBufferState, "saved");
}
}
} else if (eventId == ednMsgGuiClose) {
if (data == "") {
APPL_ERROR("Null data for close file ... ");
} else {
if (data == "All") {
} else {
int32_t closeID = -1;
if (data == "current") {
closeID = m_idSelected;
APPL_DEBUG("Close specific buffer ID" << closeID);
} else {
// close specific buffer ...
sscanf(data.c_str(), "%d", &closeID);
APPL_DEBUG("Close specific buffer ID="<< closeID);
}
if(true == Exist(closeID)) {
// Get the new display buffer
if (m_idSelected == closeID) {
// Try previous buffer
int32_t destBuffer = -1;
for(int32_t ii=closeID-1; ii >= 0; ii--) {
if (true == Exist(ii) ) {
destBuffer = ii;
break;
}
}
// try next buffer
if (-1 == destBuffer) {
for(int32_t ii=closeID+1; ii < listBuffer.Size(); ii++) {
if (true == Exist(ii) ) {
destBuffer = ii;
break;
}
}
}
// set it to the currect display
m_idSelected = destBuffer;
SendMultiCast(ednMsgBufferId, destBuffer);
}
// Remove requested buffer
Remove(closeID);
SendMultiCast(ednMsgBufferListChange);
} else {
APPL_ERROR("Request Close of a non existant ID : " << closeID);
}
}
}
} else if (eventId == ednMsgCodeViewSelectedId) {
//Change the selected buffer
if (data == "") {
APPL_ERROR("Null data for changing buffer ID file ... ");
} else {
int32_t newId;
sscanf(data.c_str(), "%d", &newId);
if (true == Exist(newId)) {
m_idSelected = newId;
} else {
APPL_ERROR("code biew request the selection of an non -existant buffer ==> reset to -1");
m_idSelected = -1;
}
SendMultiCast(ednMsgBufferId, m_idSelected);
SendMultiCast(ednMsgBufferListChange);
}
}
/*
switch (id)
{
// Check buffer existence
if(true == Exist(dataID)) {
// If no name ==> request a Gui display ...
if (Get(dataID)->HaveName() == false) {
SendMessage(APPL_MSG__GUI_SHOW_SAVE_AS, dataID);
} else {
Get(dataID)->Save();
}
}
break;
}
*/
}
/**
* @brief Remove all buffer opened
*
* @param[in,out] ---
*
* @return ---
*
*/
void classBufferManager::RemoveAll(void)
{
int32_t i;
for (i=0; i<listBuffer.Size(); i++) {
Remove(i);
}
SendMultiCast(ednMsgGuiClose, "All");
}
/**
* @brief Create a new buffer with no name and empty
*
* @param[in,out] ---
*
* @return The ID of the curent buffer where the file is loaded
*
*/
int32_t classBufferManager::Create(void)
{
// allocate a new Buffer
Buffer *myBuffer = new BufferText();
// Add at the list of element
listBuffer.PushBack(myBuffer);
int32_t basicID = listBuffer.Size() - 1;
return basicID;
}
/**
* @brief open a file with the name set in parameters
*
* @param[in] filename curent filename
*
* @return The ID of the curent buffer where the file is loaded
*
* @todo : check if this file is not curently open and return the old ID
*
*/
int32_t classBufferManager::Open(etk::FSNode &myFile)
{
if (false == Exist(myFile)) {
// allocate a new Buffer
Buffer *myBuffer = new BufferText(myFile);
// Add at the list of element
listBuffer.PushBack(myBuffer);
return listBuffer.Size() - 1;
} else {
// the buffer already existed ==> we open it ...
return GetId(myFile);
}
}
Buffer * classBufferManager::Get(int32_t BufferID)
{
// possible special case : -1;
if (-1 >= BufferID) {
return BufferNotExiste;
}
// check if the Buffer existed
if (BufferID < listBuffer.Size()) {
// check if the buffer already existed
if (NULL != listBuffer[BufferID]) {
return listBuffer[BufferID];
} else {
APPL_ERROR("non existing Buffer " << BufferID);
}
} else {
APPL_ERROR("call an non existing Buffer number too hight : " << BufferID << " > " << listBuffer.Size());
}
return BufferNotExiste;
}
bool classBufferManager::Exist(int32_t BufferID)
{
if (-1 >= BufferID) {
return false;
}
// check if the Buffer existed
if (BufferID < listBuffer.Size()) {
// check if the buffer already existed
if (NULL != listBuffer[BufferID]) {
return true;
}
}
return false;
}
bool classBufferManager::Exist(etk::FSNode &myFile )
{
if (-1 == GetId(myFile)) {
return false;
}
return true;
}
int32_t classBufferManager::GetId(etk::FSNode &myFile)
{
int32_t iii;
// check if the Buffer existed
for (iii=0; iii < listBuffer.Size(); iii++) {
// check if the buffer already existed
if (NULL != listBuffer[iii]) {
if ( listBuffer[iii]->GetFileName() == myFile) {
return iii;
}
}
}
return -1;
}
// return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5
uint32_t classBufferManager::Size(void)
{
return listBuffer.Size();
}
// nb of opens file Now ...
uint32_t classBufferManager::SizeOpen(void)
{
uint32_t jjj = 0;
// check if the Buffer existed
for (int32_t iii=0; iii<listBuffer.Size(); iii++) {
// check if the buffer already existed
if (NULL != listBuffer[iii]) {
jjj++;
}
}
return jjj;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
bool classBufferManager::Remove(int32_t BufferID)
{
if (-1 >= BufferID) {
return false;
}
// check if the Buffer existed
if (BufferID < listBuffer.Size()) {
// check if the buffer already existed
if (NULL != listBuffer[BufferID]) {
// TODO : Check if it saved...
/*
if (false == IsSaved(BufferID) ) {
APPL_INFO("Buffer " << BufferID << " : Not Saved", BufferID);
}
*/
// Delete the Buffer
delete( listBuffer[BufferID] );
listBuffer[BufferID] = NULL;
/*
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferListChange);
*/
return true;
} else {
APPL_INFO("non existing Buffer " << BufferID);
return false;
}
} else {
APPL_INFO("call an non existing Buffer number too hight : " << BufferID << " > " << listBuffer.Size());
return false;
}
}
/**
* @brief to get the element 14 in the buffer
*
* @param[in,out] ---
*
* @return ---
*
*/
int32_t classBufferManager::WitchBuffer(int32_t iEmeElement)
{
int32_t i;
for (i=0; i<listBuffer.Size(); i++) {
if (NULL != listBuffer[i]) {
iEmeElement--;
// find the element :
if (0 == iEmeElement) {
return i;
}
}
}
return -1;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace part :
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static classBufferManager * localManager = NULL;
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;
}
return localManager->GetSelected();
}
Buffer * BufferManager::Get(int32_t BufferID)
{
if (NULL == localManager) {
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
return NULL;
}
return localManager->Get(BufferID);
}
bool BufferManager::Exist(int32_t BufferID)
{
if (NULL == localManager) {
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
return false;
}
return localManager->Exist(BufferID);
}
bool BufferManager::Exist(etk::FSNode &myFile)
{
if (NULL == localManager) {
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
return false;
}
return localManager->Exist(myFile);
}
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);
}
uint32_t BufferManager::Size(void)
{
if (NULL == localManager) {
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
return 0;
}
return localManager->Size();
}
uint32_t BufferManager::SizeOpen(void)
{
if (NULL == localManager) {
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
return 0;
}
return localManager->SizeOpen();
}
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);
}

View File

@ -1,51 +0,0 @@
/**
*******************************************************************************
* @file BufferManager.h
* @brief Editeur De N'ours : Text Buffer (header)
* @author Edouard DUPIN
* @date 08/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __BUFFER_MANAGER_H__
#define __BUFFER_MANAGER_H__
#include <Buffer.h>
#include <BufferText.h>
#include <BufferEmpty.h>
#include <appl/globalMsg.h>
#include <ewol/widget/Widget.h>
namespace BufferManager
{
void Init(void);
void UnInit(void);
int32_t GetSelected(void);
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,130 +0,0 @@
/**
*******************************************************************************
* @file BufferText.h
* @brief Editeur De N'ours : Text Buffer (edit only ASCII text File) (header)
* @author Edouard DUPIN
* @date 19/01/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __BUFFER_TEXT_H__
#define __BUFFER_TEXT_H__
#include "ColorizeManager.h"
#include "Buffer.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:
int16_t m_yOffset;
int16_t m_xOffset;
int16_t m_ySize;
int32_t m_bufferPos;
};
class BufferText : public Buffer {
public:
BufferText(void);
BufferText(etk::FSNode &fileName);
virtual ~BufferText(void);
void Save(void);
void GetInfo(infoStatBuffer_ts &infoToUpdate);
void SetLineDisplay(uint32_t lineNumber);
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOText,
ewol::OObject2DColored& OOColored,
int32_t offsetX, int32_t offsetY,
int32_t sizeX, int32_t sizeY);
#else
int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
ewol::TEXT_DISPLAY_TYPE& OOTextBold,
ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
ewol::OObject2DColored& OOColored,
int32_t offsetX, int32_t offsetY,
int32_t sizeX, int32_t sizeY);
#endif
void AddChar(uniChar_t unicodeData);
void cursorMove(ewol::eventKbMoveType_te moveTypeEvent);
void MouseSelectFromCursorTo(etk::Vector2D<float> pos);
void MouseEvent(etk::Vector2D<float> 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
etk::Vector2D<float> 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 etk::Vector2D<float> 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(etk::Vector2D<float> pos);
void DrawLineNumber(ewol::TEXT_DISPLAY_TYPE* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY, int32_t nbColomn, int32_t lineNumber, int32_t positionY);
void DrawCursor(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth, clipping_ts &clip);
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,209 +0,0 @@
/**
*******************************************************************************
* @file EdnBuf.h
* @brief Editeur De N'ours : Buffer for internal Data (header)
* @author Edouard DUPIN
* @date 23/03/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#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 <EdnVectorBuf.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<colorInformation_ts> HLData;
int32_t posHLPass1;
int32_t posHLPass2;
}displayHLData_ts;
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);
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, uniChar_t 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<colorInformation_ts> 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(displayHLData_ts & MData, int32_t startPos, int32_t nbLines);
colorInformation_ts * GetElementColorAtPosition(displayHLData_ts & MData, int32_t pos);
private:
colorInformation_ts * GetElementColorAtPosition(int32_t pos, int32_t &starPos);
private:
EdnVectorBuf 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,82 +0,0 @@
/**
*******************************************************************************
* @file EdnBufHistory.cpp
* @brief Editeur De N'ours : history of buffer modification (sources)
* @author Edouard DUPIN
* @date 24/03/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#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,49 +0,0 @@
/**
*******************************************************************************
* @file EdnBufHistory.h
* @brief Editeur De N'ours : history of buffer modification (header)
* @author Edouard DUPIN
* @date 24/03/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#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,370 +0,0 @@
/**
*******************************************************************************
* @file EdnBuf_HighLight.cpp
* @brief Editeur De N'ours : Buffer for internal Data - section highlight (Sources)
* @author Edouard DUPIN
* @date 23/03/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#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();
}
colorInformation_ts *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");
}
colorInformation_ts * 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,133 +0,0 @@
/**
*******************************************************************************
* @file EdnBuf_History.cpp
* @brief Editeur De N'ours : Buffer for internal Data - section history (Sources)
* @author Edouard DUPIN
* @date 23/03/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#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,310 +0,0 @@
/**
*******************************************************************************
* @file EdnBuf_Selection.cpp
* @brief Editeur De N'ours : Buffer for internal Data - section selection (Sources)
* @author Edouard DUPIN
* @date 23/03/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#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

@ -1,704 +0,0 @@
/**
*******************************************************************************
* @file EdnEdnVectorBuf.cpp
* @brief Editeur De N'ours : Basic EdnVectorBuf Basic binary vector for all type of storage
* @author Edouard DUPIN
* @date 07/04/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <appl/Debug.h>
#include <appl/global.h>
#include <EdnVectorBuf.h>
#undef __class__
#define __class__ "EdnEdnVectorBuf"
/**
* @brief Create an empty vector
*
* @param[in] count Minimum request size of the Buffer
*
* @return ---
*
*/
EdnVectorBuf::EdnVectorBuf(int32_t count)
{
m_data = NULL;
m_allocated = 0;
m_gapStart = 0;
m_gapEnd = GAP_SIZE_MIN;
ChangeAllocation(count+GAP_SIZE_MIN);
}
/**
* @brief Re-copy constructor (copy all needed data)
*
* @param[in] Evb Vector that might be copy
*
* @return ---
*
*/
EdnVectorBuf::EdnVectorBuf(const EdnVectorBuf & Evb)
{
m_allocated = Evb.m_allocated;
m_data = NULL;
m_gapStart = Evb.m_gapStart;
m_gapEnd = Evb.m_gapEnd;
// allocate all same data
m_data = (int8_t *)malloc( m_allocated * sizeof(int8_t) );
APPL_ASSERT(NULL!=m_data, "Error in data allocation");
// Copy all data ...
memcpy(m_data, Evb.m_data, m_allocated * sizeof(int8_t) );
}
/**
* @brief Destructor of the current Class
*
* @param ---
*
* @return ---
*
*/
EdnVectorBuf::~EdnVectorBuf()
{
if (NULL!=m_data) {
free(m_data);
m_data = NULL;
m_allocated = 0;
m_gapStart = 0;
m_gapEnd = 0;
}
}
static int32_t getFileSize(FILE *myFile)
{
if (NULL == myFile) {
return 0;
}
int32_t size = 0;
fseek(myFile, 0, SEEK_END);
size = ftell(myFile);
fseek(myFile, 0, SEEK_SET);
return size;
}
/**
* @brief Save in the current file open
*
* @param[in,out] myFile pointer on the file where data might be writed
*
* @return true if OK / false if an error occured
*
*/
bool EdnVectorBuf::DumpIn(etk::FSNode &file)
{
bool ret = true;
// write Data
(void)file.FileWrite(m_data, sizeof(int8_t), m_gapStart);
(void)file.FileWrite(&m_data[m_gapEnd], sizeof(int8_t), m_allocated - m_gapEnd);
return ret;
}
/**
* @brief Load in the current file open
*
* @param[in,out] myFile pointer on the file where data might be read
*
* @return true if OK / false if an error occured
*
*/
bool EdnVectorBuf::DumpFrom(etk::FSNode &file)
{
bool ret = true;
uint32_t length = file.FileSize();
// error case ...
if (length > 2000000000) {
return false;
}
// allocate the current buffer :
ChangeAllocation(length + GAP_SIZE_MIN);
// insert Data
int32_t nbReadData = file.FileRead(&m_data[GAP_SIZE_MIN], sizeof(int8_t), length);
APPL_INFO("load data : filesize=" << length << ", readData=" << nbReadData);
// check ERROR
if (nbReadData != length) {
APPL_ERROR("load data pb : filesize=" << length << ", readData=" << nbReadData);
ret = false;
}
// set the gapsize at the end ...
m_gapStart = 0;
m_gapEnd = GAP_SIZE_MIN;
return ret;
}
/**
* @brief Re-copy operator
*
* @param[in] Evb Vector that might be copy
*
* @return reference on the curent re-copy vector
*
*/
EdnVectorBuf& EdnVectorBuf::operator=(const EdnVectorBuf & Evb)
{
if( this != &Evb ) // avoid copy to itself
{
if (NULL!=m_data) {
free(m_data);
m_data = NULL;
}
// Set the new value
m_allocated = Evb.m_allocated;
m_gapStart = Evb.m_gapStart;
m_gapEnd = Evb.m_gapEnd;
// allocate all same data
m_data = (int8_t *)malloc( m_allocated * sizeof(int8_t) );
APPL_ASSERT(NULL!=m_data, "Error in data allocation");
// Copy all data ...
memcpy(m_data, Evb.m_data, m_allocated * sizeof(int8_t) );
}
// Return the curent pointer
return *this;
}
int8_t EdnVectorBuf::operator[] (int32_t pos)
{
APPL_ASSERT(0 <= pos || pos < Size(), "try to read an element non existing");
if (pos < m_gapStart) {
return m_data[pos];
}
return m_data[pos + m_gapEnd-m_gapStart];
}
/**
* @brief Get a current element in the vector
*
* @param[in] pos Desired position read
*
* @return Reference on the Element
*
*/
int8_t& EdnVectorBuf::Get(int32_t pos)
{
APPL_ASSERT(0 <= pos || pos < Size(), "try to read an element non existing");
if (pos < m_gapStart) {
return m_data[pos];
}
return m_data[pos + m_gapEnd-m_gapStart];
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnVectorBuf::Get(int32_t pos, int32_t nbElement, etk::Vector<int8_t> &tmpBuffer)
{
tmpBuffer.Clear();
if (pos < m_gapStart) {
if (pos + nbElement < m_gapStart) {
tmpBuffer.PushBack(&m_data[pos], nbElement);
} else {
tmpBuffer.PushBack(&m_data[pos], m_gapStart - pos);
tmpBuffer.PushBack(&m_data[m_gapEnd], nbElement - (m_gapStart - pos) );
}
} else {
tmpBuffer.PushBack(&m_data[pos+(m_gapEnd-m_gapStart)], nbElement);
}
}
/**
* @brief Add at the Last position of the Vector
*
* @param[in] item Element to add at the end of vector
*
* @return ---
*
*/
void EdnVectorBuf::PushBack(const int8_t& item)
{
Insert( Size(), item);
}
/**
* @brief Remove the last element of the vector
*
* @param ---
*
* @return ---
*
*/
void EdnVectorBuf::PopBack(void)
{
if (Size()>0) {
Remove( Size() );
}
}
/**
* @brief Remove data in the buffer
*
* @param[in]
*
* @return ---
*
*/
void EdnVectorBuf::Remove(int32_t pos, int32_t nbRemoveElement)
{
if( pos > Size()
|| pos < 0 ) {
APPL_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return;
}
if( pos+nbRemoveElement > Size() ) {
APPL_ERROR("Request remove more element than expected in the buffer pos+nbRemoveElement="<<pos+nbRemoveElement<< " bufferSize="<<Size());
return;
}
if (false == GapMove(pos) ) {
return;
}
// Remove elements :
if (m_allocated==m_gapEnd) {
m_gapStart -= nbRemoveElement;
} else {
m_gapEnd += nbRemoveElement;
}
// Resize buffer if needed...
GapCheckMaxSize();
}
/**
* @brief Change the current allocation to the corect one (depend on the current size)
*
* @param[in] newSize Minimum number of element needed
*
* @return ---
*
*/
void EdnVectorBuf::Clear(void)
{
// Remove all element in the buffer
Remove(0, Size() );
}
/**
* @brief Change the current allocation to the corect one (depend on the current size)
*
* @param[in] newSize Minimum number of element needed
*
* @return ---
*
*/
void EdnVectorBuf::ChangeAllocation(int32_t newSize)
{
// set the minimal size to 1
if(newSize <= 0) {
newSize = 1;
}
// set the size with the corect chose type :
if (newSize == m_allocated) {
return;
}
APPL_DEBUG("Change Allocation : " << m_allocated << " ==> " << newSize);
// check if something is allocated :
if (NULL == m_data) {
// no data allocated ==> request an allocation (might be the first)
m_data = (int8_t *)malloc( newSize * sizeof(int8_t) );
} else {
// move datas
m_data = (int8_t *)realloc( m_data, newSize* sizeof(int8_t) );
}
// Check result with assert :
APPL_ASSERT(NULL!=m_data, "Error in data allocation");
// set the new allocation size
m_allocated = newSize;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnVectorBuf::Insert(int32_t pos, const int8_t& item)
{
if( pos > Size()
|| pos < 0 ) {
APPL_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return;
}
if( 0 == GapSize() ) {
if (false == GapResize(pos, GAP_SIZE_MIN + 1) ) {
return;
}
} else if( pos == m_gapStart
&& pos == m_gapEnd-1 )
{
// mothing to do ...
} else {
if (false == GapMove(pos)) {
return;
}
}
if(pos == m_gapStart) {
m_data[m_gapStart] = item;
m_gapStart++;
} else {
m_data[m_gapEnd-1] = item;
m_gapEnd--;
}
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnVectorBuf::Insert(int32_t pos, etk::Vector<int8_t>& items)
{
if( pos > Size()
|| pos < 0 ) {
APPL_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return;
}
if( items.Size() > GapSize() ) {
if (false == GapResize(pos, GAP_SIZE_MIN + items.Size()) ) {
return;
}
} else {
if (false == GapMove(pos) ) {
return;
}
}
int32_t i;
for(i=0; i<items.Size(); i++) {
m_data[m_gapStart+i] = items[i];
}
m_gapStart += items.Size();
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnVectorBuf::Replace(int32_t pos, const int8_t& item)
{
if( pos > Size()
|| pos < 0 ) {
APPL_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return;
}
// just replace the element, not update Gap position
if (pos < m_gapStart) {
m_data[pos] = item;
} else {
m_data[pos+GapSize()] = item;
}
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnVectorBuf::Replace(int32_t pos, int32_t nbRemoveElement, etk::Vector<int8_t>& items)
{
if( pos > Size()
|| pos < 0 ) {
APPL_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return;
}
if( pos+nbRemoveElement > Size() ) {
APPL_ERROR("Request remove more element than expected in the buffer pos+nbRemoveElement="<<pos+nbRemoveElement<< " bufferSize="<<Size());
return;
}
if (false == GapMove(pos)) {
return;
}
// Remove elements :
m_gapEnd += nbRemoveElement;
//Display();
// insert elements
Insert(pos, items);
// Resize buffer if needed...
GapCheckMaxSize();
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
bool EdnVectorBuf::GapMove(int32_t pos)
{
if( pos > Size()
|| pos < 0 ) {
APPL_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return false;
}
int32_t gapLen = m_gapEnd - m_gapStart;
if (pos > m_gapStart) {
memmove(&m_data[m_gapStart], &m_data[m_gapEnd], pos - m_gapStart);
} else {
memmove(&m_data[pos + gapLen], &m_data[pos], m_gapStart - pos);
}
m_gapEnd += pos - m_gapStart;
m_gapStart += pos - m_gapStart;
return true;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
bool EdnVectorBuf::GapResize(int32_t pos, int32_t newGapLen)
{
if( pos > Size()
|| pos < 0 ) {
APPL_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return false;
}
int32_t previousSize = Size();
if (newGapLen == GapSize() ) {
// nothing to do ...
return true;
} else {
if (newGapLen > GapSize() ) {
// reallocation
ChangeAllocation( previousSize + newGapLen);
}
// move Data
if (pos <= m_gapStart) {
// just move the end of the gap
memmove(&m_data[m_gapStart + newGapLen], &m_data[m_gapEnd], previousSize - m_gapStart);
// update gap end position
m_gapEnd = m_gapStart + newGapLen;
if (pos < m_gapStart) {
if (false == GapMove(pos)) {
return false;
}
}
// no else
} else {
if (false == GapMove(pos) ) {
return false;
}
memmove(&m_data[m_gapStart + newGapLen], &m_data[m_gapEnd], previousSize - m_gapStart);
}
if (newGapLen < GapSize() ) {
// rellocation
ChangeAllocation(previousSize + newGapLen);
}
}
// update gap position
m_gapStart = pos;
m_gapEnd = pos + newGapLen;
return true;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnVectorBuf::GapCheckMaxSize(void)
{
if(GapSize() > GAP_SIZE_MAX) {
int32_t currentSize = Size();
// Change the gap Size
if (false == GapResize(m_gapStart, GAP_SIZE_MAX) ) {
return;
}
// remove deprecated elements at the end of the buffer ...
ChangeAllocation(currentSize + GAP_SIZE_MAX);
}
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnVectorBuf::Display(void)
{
APPL_INFO(" Display Buffer : Size="<<Size()<<" m_allocated="<<m_allocated<<" m_gapStart="<<m_gapStart<<" m_gapEnd="<<m_gapEnd);
for(int32_t i=0; i<m_allocated; i++) {
if (i>= m_gapStart && i< m_gapEnd) {
APPL_INFO( "Element " << i << " : GAP");
} else {
APPL_INFO( "Element " << i << " : " << m_data[i]);
}
}
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void TestEdnVectorBuf(void)
{
EdnVectorBuf myBufferTmp;
int32_t i;
//invert data
for (i=0; i<50; i++) {
myBufferTmp.Insert(0, 'a' + i%26);
}
myBufferTmp.Display();
myBufferTmp.Clear();
myBufferTmp.Display();
myBufferTmp.Remove(2, 300);
/*
char plop='a';
myBufferTmp.Insert(0, plop);
myBufferTmp.Display();
plop='b';
myBufferTmp.Insert(0, plop);
myBufferTmp.Display();
plop='c';
myBufferTmp.Insert(0, plop);
myBufferTmp.Display();
plop='d';
myBufferTmp.Insert(0, plop);
myBufferTmp.Display();
plop='e';
myBufferTmp.Insert(0, plop);
myBufferTmp.Display();
plop='f';
myBufferTmp.Insert(0, plop);
myBufferTmp.Display();
plop='g';
myBufferTmp.Insert(0, plop);
myBufferTmp.Display();
plop='h';
myBufferTmp.Insert(0, plop);
myBufferTmp.Display();
plop='m';
etk::Vector<int8_t> items;
items.PushBack('i');
items.PushBack('j');
items.PushBack('k');
items.PushBack('l');
items.PushBack('m');
items.PushBack('n');
items.PushBack('o');
items.PushBack('p');
myBufferTmp.Insert(3, items);
myBufferTmp.Display();
plop='7';
myBufferTmp.Insert(7, plop);
myBufferTmp.Display();
myBufferTmp.Replace(8, 'z');
myBufferTmp.Display();
items.Clear();
items.PushBack('1');
items.PushBack('2');
items.PushBack('3');
myBufferTmp.Replace(10, 4, items);
myBufferTmp.Display();
myBufferTmp.PushBack('a');
myBufferTmp.PushBack('a');
myBufferTmp.PushBack('a');
myBufferTmp.PushBack('a');
myBufferTmp.Display();
myBufferTmp.PopBack();
myBufferTmp.PopBack();
myBufferTmp.PopBack();
myBufferTmp.PopBack();
myBufferTmp.Display();
myBufferTmp.Remove(2, 3);
myBufferTmp.Display();
*/
}

View File

@ -1,342 +0,0 @@
/**
*******************************************************************************
* @file EdnEdnVectorBuf.h
* @brief Editeur De N'ours : Basic EdnVectorBuf for direct data insertion (template)
* @author Edouard DUPIN
* @date 07/04/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __EDN_VECTOR_BUF_H__
#define __EDN_VECTOR_BUF_H__
#include <etk/Vector.h>
#include <etk/os/FSNode.h>
#undef __class__
#define __class__ "EdnVectorBuf"
// minimum gapSize when allocated
#define GAP_SIZE_MIN (80)
// maximum gap that is automaticly resize
#define GAP_SIZE_MAX (GAP_SIZE_MIN*4)
/*
______________________________________________________________________________________
| |
| |
| <GapStart |
| *******************************************************************|
|****************************************** |
| Gap Stop > |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|____________________________________________________________________________________|
*/
/**
* @brief EdnVectorBuf classes ...
*/
class EdnVectorBuf
{
public:
class Iterator
{
// Private data :
private:
int32_t m_current; // curent Id on the vector
EdnVectorBuf * m_EdnVectorBuf; // Pointer on the curent element of the vectorBin
public:
/**
* @brief Basic itarator constructor with no link with an EdnVector
*/
Iterator(void):
m_current(-1),
m_EdnVectorBuf(NULL)
{
// nothing to do ...
}
/**
* @brief Recopy constructor on a specific EdnVector.
* @param[in] otherIterator The Iterator that might be copy
*/
Iterator(const Iterator & otherIterator):
m_current(otherIterator.m_current),
m_EdnVectorBuf(otherIterator.m_EdnVectorBuf)
{
// nothing to do ...
}
/**
* @brief Asignation operator.
* @param[in] otherIterator The Iterator that might be copy
* @return reference on the curent Iterator
*/
Iterator& operator=(const Iterator & otherIterator)
{
m_current = otherIterator.m_current;
m_EdnVectorBuf = otherIterator.m_EdnVectorBuf;
return *this;
}
/**
* @brief Basic destructor
*/
~Iterator(void)
{
m_current = -1;
m_EdnVectorBuf = NULL;
}
/**
* @brief gaet element position in the system
*/
int32_t Position(void)
{
if(0 > m_current) {
return 0;
} else if (m_EdnVectorBuf->Size() <= m_current) {
return m_EdnVectorBuf->Size();
} else {
return m_current;
}
}
/**
* @brief basic boolean cast
* @return true if the element is present in the EdnVector size
*/
operator bool ()
{
if( 0 <= m_current
&& m_current < m_EdnVectorBuf->Size() )
{
return true;
} else {
return false;
}
}
/**
* @brief Incremental operator
* @return Reference on the current iterator incremented
*/
Iterator& operator++ ()
{
if( NULL != m_EdnVectorBuf
&& m_current < m_EdnVectorBuf->Size() )
{
m_current++;
}
return *this;
}
/**
* @brief Decremental operator
* @return Reference on the current iterator decremented
*/
Iterator& operator-- ()
{
if (m_current >= 0) {
m_current--;
}
return *this;
}
/**
* @brief Incremental operator
* @return Reference on a new iterator and increment the other one
*/
Iterator operator++ (int32_t)
{
Iterator it(*this);
++(*this);
return it;
}
/**
* @brief Decremental operator
* @return Reference on a new iterator and decrement the other one
*/
Iterator operator-- (int32_t)
{
Iterator it(*this);
--(*this);
return it;
}
/**
* @brief Get reference on the current Element
* @return the reference on the current Element
*/
int8_t & operator-> () const
{
APPL_CHECK_INOUT(m_current >= 0 && m_current < m_EdnVectorBuf->Size());
return m_EdnVectorBuf->Get(m_current);
}
/**
* @brief Get reference on the current Element
* @return the reference on the current Element
*/
int8_t & operator* () const
{
APPL_CHECK_INOUT(m_current >= 0 && m_current < m_EdnVectorBuf->Size());
return m_EdnVectorBuf->Get(m_current);
}
private:
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
Iterator(EdnVectorBuf * Evb, int32_t pos):
m_current(pos),
m_EdnVectorBuf(Evb)
{
// nothing to do ...
}
friend class EdnVectorBuf;
};
private:
int8_t * m_data; //!< pointer on the curetn table of Data
int32_t m_allocated; //!< Current allocated size
// empty part of the buffer data
int32_t m_gapStart; //!< points to the first character of the gap
int32_t m_gapEnd; //!< points to the first char after the gap
public:
EdnVectorBuf(int32_t count = 0);
EdnVectorBuf(const EdnVectorBuf & Evb);
~EdnVectorBuf();
bool DumpIn( etk::FSNode &file);
bool DumpFrom( etk::FSNode &file);
EdnVectorBuf & operator=( const EdnVectorBuf & Evb);
int8_t operator[] (int32_t pos);
int8_t & Get( int32_t pos);
void Get( int32_t pos, int32_t nbElement, etk::Vector<int8_t> &tmpBuffer);
// insert functions
void PushBack( const int8_t& item);
void Insert( int32_t pos, const int8_t& item);
void Insert( int32_t pos, etk::Vector<int8_t>& items);
// Remove and insert functions
void Replace( int32_t pos, const int8_t& item);
void Replace( int32_t pos, int32_t nbRemoveElement, etk::Vector<int8_t>& items);
// Revove fonctions
void Remove( int32_t pos, int32_t nbRemoveElement = 1);
void PopBack( void);
void Clear( void);
void Fit(void);
void Display(void);
/**
* @brief Get a current element in the vector (iterator system)
* @param[in] RealElementPosition Real position in the buffer (only use in the ITERATOR)
* @return Reference on the Element
*/
int8_t & GetDirect(int32_t RealElementPosition){ return m_data[RealElementPosition]; };
/**
* @brief Get the number of element in the vector
* @return The number requested
*/
int32_t Size(void) { return m_allocated - GapSize(); };
Iterator Position(int32_t pos)
{
return Iterator(this, pos);
}
/**
* @brief Get an Iterator on the start position of the Vector
* @return The Iterator
*/
Iterator Begin()
{
return Position(0);
}
/**
* @brief Get an Iterator on the end position of the Vector
* @return The Iterator
*/
Iterator End()
{
return Position( Size()-1 );
}
private:
// TODO : Set a boolean at the return value to prevent internal error ...
void ChangeAllocation( int32_t newSize);
bool GapMove( int32_t pos);
bool GapResize( int32_t pos, int32_t newGapLen);
// get current gap Size
int32_t GapSize( void) { return m_gapEnd - m_gapStart; };
void GapCheckMaxSize( void);
};
#undef __class__
#define __class__ NULL
void TestEdnVectorBuf(void);
#endif

View File

@ -1,145 +0,0 @@
/**
*******************************************************************************
* @file Colorise.cpp
* @brief Editeur De N'ours : Colirising system
* @author Edouard DUPIN
* @date 14/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <appl/Debug.h>
#include <appl/global.h>
#include <Colorize.h>
#undef __class__
#define __class__ "Colorize"
Colorize::Colorize( etk::UString &newColorName)
{
m_colorFG = draw::color::black;
m_colorBG = draw::color::black;
italic = false;
bold = false;
haveFG = false;
haveBG = false;
SetName(newColorName);
APPL_VERBOSE("New(Colorise)");
}
Colorize::Colorize(void)
{
ColorName = "no_name";
m_colorFG = draw::color::black;
m_colorBG = draw::color::black;
italic = false;
bold = false;
haveFG = false;
haveBG = false;
APPL_VERBOSE("New(Colorise)");
}
Colorize::~Colorize(void)
{
// nothing to do ...
}
void Colorize::SetName(const char *newColorName)
{
APPL_VERBOSE("color change name : \"" << ColorName << "\" ==> \"" << newColorName << "\"");
ColorName = newColorName;
}
void Colorize::SetName(etk::UString &newColorName)
{
APPL_VERBOSE("color change name : \"" << ColorName << "\" ==> \"" << newColorName << "\"");
ColorName = newColorName;
}
etk::UString Colorize::GetName(void)
{
return ColorName;
}
void Colorize::SetFgColor(const char *myColor)
{
haveFG = true;
m_colorFG = myColor;
APPL_VERBOSE(myColor << " ==> "<< m_colorFG );
}
void Colorize::SetBgColor(const char *myColor)
{
haveBG = true;
m_colorBG = myColor;
APPL_VERBOSE(myColor << " ==> "<< m_colorBG );
}
bool Colorize::HaveBg(void)
{
return haveBG;
}
void Colorize::SetItalic(bool enable)
{
italic = enable;
if (true == enable) {
APPL_VERBOSE("color : \"" << ColorName << "\" enable italic");
} else {
APPL_VERBOSE("color : \"" << ColorName << "\" disable italic");
}
}
bool Colorize::GetItalic(void)
{
return italic;
}
void Colorize::SetBold(bool enable)
{
bold = enable;
if (true == enable) {
APPL_VERBOSE("color : \"" << ColorName << "\" enable bold");
} else {
APPL_VERBOSE("color : \"" << ColorName << "\" disable bold");
}
}
bool Colorize::GetBold(void)
{
return bold;
}

View File

@ -1,69 +0,0 @@
/**
*******************************************************************************
* @file Colorize.h
* @brief Editeur De N'ours : Colirizing system (header)
* @author Edouard DUPIN
* @date 14/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __COLORIZE_H__
#define __COLORIZE_H__
#include <etk/UString.h>
class Colorize {
public:
// Constructeur
Colorize(void);
Colorize(etk::UString &newColorName);
~Colorize(void);
void SetName(etk::UString &newColorName);
void SetName(const char *newColorName);
etk::UString GetName(void);
void SetFgColor(const char *myColor);
void SetBgColor(const char *myColor);
draw::Color & GetFG(void) { return m_colorFG; };
draw::Color & GetBG(void) { return m_colorBG; };
bool HaveBg(void);
void SetItalic(bool enable);
void SetBold(bool enable);
bool GetItalic(void);
bool GetBold(void);
void Display(int32_t i) { APPL_INFO(" " << i << " : \"" << ColorName << "\"" << " fg="<< m_colorFG); };
private:
etk::UString ColorName; //!< curent color Name
draw::Color m_colorFG;
draw::Color m_colorBG;
bool italic;
bool bold;
bool haveFG;
bool haveBG;
};
#endif

View File

@ -1,455 +0,0 @@
/**
*******************************************************************************
* @file ColorizeManager.cpp
* @brief Editeur De N'ours : Colorising Manager
* @author Edouard DUPIN
* @date 14/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <appl/Debug.h>
#include <appl/global.h>
#include <ColorizeManager.h>
#include <tinyXML/tinyxml.h>
#include <ewol/eObject/EObject.h>
#include <ewol/eObject/EObjectManager.h>
#include <etk/os/FSNode.h>
#define PFX "ColorizeManager "
class classColorManager: public ewol::EObject
{
public:
// Constructeur
classColorManager(void);
~classColorManager(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void)
{
return "ApplColorManager";
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
public:
void LoadFile(etk::UString &xmlFilename);
void LoadFile(const char * xmlFilename);
Colorize * Get(const char *colorName);
Colorize * Get(etk::UString &colorName);
draw::Color& Get(basicColor_te myColor);
bool Exist(etk::UString &colorName);
bool Exist(const char *colorName);
void DisplayListOfColor(void);
private:
etk::UString m_fileColor;
etk::Vector<Colorize*> listMyColor; //!< List of ALL Color
Colorize * errorColor;
draw::Color basicColors[COLOR_NUMBER_MAX];
};
classColorManager::classColorManager(void)
{
//ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiChangeColor);
}
classColorManager::~classColorManager(void)
{
delete(errorColor);
int32_t i;
// clean all Element
for (i=0; i< listMyColor.Size(); i++) {
if (NULL != listMyColor[i]) {
delete(listMyColor[i]);
listMyColor[i] = NULL;
}
}
// clear the compleate list
listMyColor.Clear();
}
void classColorManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
{
/*
switch (id)
{
case APPL_MSG__RELOAD_COLOR_FILE:
{
// Reaload File
// TODO : Check this : Pb in the recopy etk::UString element
etk::UString plop = m_fileColor;
LoadFile(plop);
}
break;
}
*/
}
void classColorManager::LoadFile(etk::UString &xmlFilename)
{
// TODO : Remove this
LoadFile(xmlFilename.c_str());
}
// TODO : Remove this ...
void classColorManager::LoadFile(const char * xmlFilename)
{
// Remove all old color :
int32_t i;
// clean all Element
for (i=0; i< listMyColor.Size(); i++) {
if (NULL != listMyColor[i]) {
delete(listMyColor[i]);
listMyColor[i] = NULL;
}
}
// clear the compleate list
listMyColor.Clear();
m_fileColor = xmlFilename;
APPL_DEBUG("open file (COLOR) \"" << xmlFilename << "\" ? = \"" << m_fileColor << "\"");
errorColor = new Colorize();
errorColor->SetBgColor("#00FF00FF");
errorColor->SetFgColor("#FF00FFFF");
// allocate the document in the stack
TiXmlDocument XmlDocument;
// open the curent File
etk::FSNode fileName(etk::UString("DATA:") + xmlFilename);
if (false == fileName.Exist()) {
APPL_ERROR("File Does not exist : " << fileName);
return;
}
int32_t fileSize = fileName.FileSize();
if (0==fileSize) {
APPL_ERROR("This file is empty : " << fileName);
return;
}
if (false == fileName.FileOpenRead()) {
APPL_ERROR("Can not open the file : " << fileName);
return;
}
// allocate data
char * fileBuffer = new char[fileSize+5];
if (NULL == fileBuffer) {
APPL_ERROR("Error Memory allocation size=" << fileSize);
return;
}
memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
// load data from the file :
fileName.FileRead(fileBuffer, 1, fileSize);
// close the file:
fileName.FileClose();
// load the XML from the memory
XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8);
TiXmlElement* root = XmlDocument.FirstChildElement( "EdnColor" );
if (NULL == root ) {
APPL_ERROR(PFX"(l ?) main node not find: \"EdnColor\" in \"" << xmlFilename << "\"");
return;
} else {
TiXmlNode * pNode = root->FirstChild();
while(NULL != pNode) {
if (pNode->Type()==TiXmlNode::TINYXML_COMMENT) {
// nothing to do, just proceed to next step
} else if (!strcmp(pNode->Value(), "gui")) {
TiXmlNode * pGuiNode = pNode->FirstChild();
while(NULL != pGuiNode) {
if (pGuiNode->Type()==TiXmlNode::TINYXML_COMMENT) {
// nothing to do, just proceed to next step
} else if (!strcmp(pGuiNode->Value(), "color")) {
//--------------------------------------------------------------------------------------------
//<color name="basicBackground" val="#000000"/>
//--------------------------------------------------------------------------------------------
const char *colorName = pGuiNode->ToElement()->Attribute("name");
int32_t id = 0;
if (NULL == colorName) {
APPL_ERROR("(l "<< pGuiNode->Row() <<") node with no name");
// get next node element
pGuiNode = pGuiNode->NextSibling();
continue;
}
if (!strcmp(colorName, "CODE_space")) {
id = COLOR_CODE_SPACE;
} else if (!strcmp(colorName, "CODE_tabulation")) {
id = COLOR_CODE_TAB;
} else if (!strcmp(colorName, "CODE_basicBackgroung")) {
id = COLOR_CODE_BASIC_BG;
} else if (!strcmp(colorName, "CODE_cursor")) {
id = COLOR_CODE_CURSOR;
} else if (!strcmp(colorName, "CODE_lineNumber")) {
id = COLOR_CODE_LINE_NUMBER;
} else if (!strcmp(colorName, "LIST_backgroung1")) {
id = COLOR_LIST_BG_1;
} else if (!strcmp(colorName, "LIST_backgroung2")) {
id = COLOR_LIST_BG_2;
} else if (!strcmp(colorName, "LIST_backgroungSelected")) {
id = COLOR_LIST_BG_SELECTED;
} else if (!strcmp(colorName, "LIST_textNormal")) {
id = COLOR_LIST_TEXT_NORMAL;
} else if (!strcmp(colorName, "LIST_textModify")) {
id = COLOR_LIST_TEXT_MODIFY;
} else {
APPL_ERROR("(l "<<pGuiNode->Row()<<") Unknown basic gui color : \"" << colorName << "\"" );
// get next node element
pGuiNode = pGuiNode->NextSibling();
continue;
}
const char *color = pGuiNode->ToElement()->Attribute("val");
if (NULL != color) {
basicColors[id] = color;
}
} else {
APPL_ERROR("(l "<<pGuiNode->Row()<<") node not suported : \""<<pGuiNode->Value()<<"\" must be [color]");
}
// get next node element
pGuiNode = pGuiNode->NextSibling();
}
} else if (!strcmp(pNode->Value(), "syntax")) {
TiXmlNode * pGuiNode = pNode->FirstChild();
while(NULL != pGuiNode)
{
if (pGuiNode->Type()==TiXmlNode::TINYXML_COMMENT) {
// nothing to do, just proceed to next step
} else if (!strcmp(pGuiNode->Value(), "color")) {
Colorize *myNewColor = new Colorize();
//--------------------------------------------------------------------------------------------
//<color name="basicBackground" FG="#000000" BG="#000000" bold="no" italic="no"/>
//--------------------------------------------------------------------------------------------
// get the name of the Chaine
const char *colorName = pGuiNode->ToElement()->Attribute("name");
if (NULL == colorName) {
APPL_ERROR(PFX"(l "<< pGuiNode->Row() <<") node with no name");
// get next node element
pGuiNode = pGuiNode->NextSibling();
continue;
} else {
myNewColor->SetName(colorName);
//APPL_INFO(PFX"Add a new color in the panel : \"%s\"", colorName);
}
const char *colorBG = pGuiNode->ToElement()->Attribute("BG");
if (NULL != colorBG) {
myNewColor->SetBgColor(colorBG);
}
const char *colorFG = pGuiNode->ToElement()->Attribute("FG");
if (NULL != colorFG) {
myNewColor->SetFgColor(colorFG);
}
const char *bold = pGuiNode->ToElement()->Attribute("bold");
if (NULL != bold) {
if(0 == strcmp(bold, "yes") ) {
myNewColor->SetBold(true);
}
}
const char *italic = pGuiNode->ToElement()->Attribute("italic");
if (NULL != italic) {
if(0 == strcmp(italic, "yes") ) {
myNewColor->SetItalic(true);
}
}
listMyColor.PushBack(myNewColor);
} else {
APPL_ERROR(PFX"(l "<<pNode->Row()<<") node not suported : \""<<pNode->Value()<<"\" must be [color]");
}
pGuiNode = pGuiNode->NextSibling();
}
} else {
APPL_ERROR(PFX"(l "<<pNode->Row()<<") node not suported : \""<<pNode->Value()<<"\" must be [gui,syntax]");
}
// get next node element
pNode = pNode->NextSibling();
}
}
if (NULL != fileBuffer) {
delete[] fileBuffer;
}
//SendMessage(APPL_MSG__COLOR_HAS_CHANGE);
//SendMessage(APPL_MSG__USER_DISPLAY_CHANGE);
}
// TODO : Remove this ...
Colorize *classColorManager::Get(const char *colorName)
{
int32_t i;
for (i=0; i<listMyColor.Size(); i++) {
etk::UString elementName = listMyColor[i]->GetName();
if (elementName == colorName) {
return listMyColor[i];
}
}
APPL_ERROR(PFX"Color does not Existed ["<< colorName<<"]" );
// an error
return errorColor;
}
Colorize *classColorManager::Get(etk::UString &colorName)
{
// TODO : Remove this
return Get(colorName.c_str());
}
draw::Color & classColorManager::Get(basicColor_te myColor)
{
if (myColor < COLOR_NUMBER_MAX) {
return basicColors[myColor];
} else {
return basicColors[0];
}
}
// TODO : Remove this ...
bool classColorManager::Exist(const char *colorName)
{
int32_t i;
for (i=0; i<listMyColor.Size(); i++) {
etk::UString elementName = listMyColor[i]->GetName();
if (elementName == colorName) {
return true;
}
}
return false;
}
bool classColorManager::Exist(etk::UString &colorName)
{
// TODO : Remove this
return Exist(colorName.c_str());
}
void classColorManager::DisplayListOfColor(void)
{
int32_t i;
APPL_INFO(PFX"List of ALL COLOR : ");
for (i=0; i<listMyColor.Size(); i++) {
//etk::UString elementName = listMyColor[i]->GetName();
//APPL_INFO(i << " : \"" << elementName.c_str() << "\"" );
listMyColor[i]->Display(i);
}
}
static classColorManager * localManager = NULL;
void ColorizeManager::Init(void)
{
if (NULL != localManager) {
EWOL_ERROR("ColorizeManager ==> already exist, just unlink the previous ...");
localManager = NULL;
}
localManager = new classColorManager();
if (NULL == localManager) {
EWOL_CRITICAL("Allocation of HighlightManager not done ...");
}
}
void ColorizeManager::UnInit(void)
{
if (NULL == localManager) {
EWOL_ERROR("ColorizeManager ==> request UnInit, but does not exist ...");
return;
}
delete(localManager);
localManager = NULL;
}
void ColorizeManager::LoadFile(etk::UString &xmlFilename)
{
if (NULL == localManager) {
return;
}
localManager->LoadFile(xmlFilename);
}
void ColorizeManager::LoadFile(const char * xmlFilename)
{
if (NULL == localManager) {
return;
}
localManager->LoadFile(xmlFilename);
}
Colorize* ColorizeManager::Get(const char *colorName)
{
if (NULL == localManager) {
return NULL;
}
return localManager->Get(colorName);
}
Colorize* ColorizeManager::Get(etk::UString &colorName)
{
if (NULL == localManager) {
return NULL;
}
return localManager->Get(colorName);
}
draw::Color errorColor;
draw::Color& ColorizeManager::Get(basicColor_te myColor)
{
if (NULL == localManager) {
return errorColor;
}
return localManager->Get(myColor);
}
bool ColorizeManager::Exist(etk::UString &colorName)
{
if (NULL == localManager) {
return false;
}
return localManager->Exist(colorName);
}
bool ColorizeManager::Exist(const char *colorName)
{
if (NULL == localManager) {
return false;
}
return localManager->Exist(colorName);
}
void ColorizeManager::DisplayListOfColor(void)
{
if (NULL == localManager) {
return;
}
localManager->DisplayListOfColor();
}

View File

@ -1,67 +0,0 @@
/**
*******************************************************************************
* @file ColorizeManager.h
* @brief Editeur De N'ours : Colorising Manager (header)
* @author Edouard DUPIN
* @date 14/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __COLORIZE_MANAGER_H__
#define __COLORIZE_MANAGER_H__
#include <Colorize.h>
#include <appl/globalMsg.h>
#include <ewol/widget/Widget.h>
typedef enum {
// BASIC color for codeViewer
COLOR_CODE_SPACE,
COLOR_CODE_TAB,
COLOR_CODE_BASIC_BG,
COLOR_CODE_CURSOR,
COLOR_CODE_LINE_NUMBER,
// Basic color for list viewer
COLOR_LIST_BG_1,
COLOR_LIST_BG_2,
COLOR_LIST_BG_SELECTED,
COLOR_LIST_TEXT_NORMAL,
COLOR_LIST_TEXT_MODIFY,
// KNOW the number of BASIC color
COLOR_NUMBER_MAX,
}basicColor_te;
namespace ColorizeManager
{
void Init(void);
void UnInit(void);
void LoadFile(etk::UString &xmlFilename);
void LoadFile(const char * xmlFilename);
Colorize * Get(const char *colorName);
Colorize * Get(etk::UString &colorName);
draw::Color& Get(basicColor_te myColor);
bool Exist(etk::UString &colorName);
bool Exist(const char *colorName);
void DisplayListOfColor(void);
};
#endif

View File

@ -1,27 +0,0 @@
/**
*******************************************************************************
* @file Debug.h
* @brief Editeur De N'ours : log implementation
* @author Edouard DUPIN
* @date 08/06/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
const char * applLog = "edn ";

View File

@ -1,44 +0,0 @@
/**
*******************************************************************************
* @file Debug.h
* @brief Application log implementation
* @author Edouard DUPIN
* @date 10/04/2012
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __DEBUG_H__
#define __DEBUG_H__
#include <etk/Types.h>
#include <etk/Debug.h>
extern const char * applLog;
#define APPL_CRITICAL(data) ETK_CRITICAL(applLog, data)
#define APPL_WARNING(data) ETK_WARNING(applLog, data)
#define APPL_ERROR(data) ETK_ERROR(applLog, data)
#define APPL_INFO(data) ETK_INFO(applLog, data)
#define APPL_DEBUG(data) ETK_DEBUG(applLog, data)
#define APPL_VERBOSE(data) ETK_VERBOSE(applLog, data)
#define APPL_ASSERT(cond, data) ETK_ASSERT(applLog, cond, data)
#define APPL_CHECK_INOUT(cond) ETK_CHECK_INOUT(applLog, cond)
#define APPL_TODO(cond) ETK_TODO(applLog, cond)
#endif

View File

@ -1,211 +0,0 @@
/**
*******************************************************************************
* @file BufferViewer.cpp
* @brief Editeur De N'ours : main textViewer diplayer
* @author Edouard DUPIN
* @date 04/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <appl/Debug.h>
#include <appl/global.h>
#include <BufferView.h>
#include <BufferManager.h>
#include <ColorizeManager.h>
#include <MainWindows.h>
#include <ewol/eObject/EObject.h>
#undef __class__
#define __class__ "BufferView"
static void SortElementList(etk::Vector<appl::dataBufferStruct *> &list)
{
etk::Vector<appl::dataBufferStruct *> tmpList = list;
list.Clear();
for(int32_t iii=0; iii<tmpList.Size(); iii++) {
if (NULL != tmpList[iii]) {
int32_t findPos = 0;
for(int32_t jjj=0; jjj<list.Size(); jjj++) {
//EWOL_DEBUG("compare : \""<<*tmpList[iii] << "\" and \"" << *m_listDirectory[jjj] << "\"");
if (list[jjj]!=NULL) {
if (tmpList[iii]->m_bufferName.GetNameFile() > list[jjj]->m_bufferName.GetNameFile()) {
findPos = jjj+1;
}
}
}
//EWOL_DEBUG("position="<<findPos);
list.Insert(findPos, tmpList[iii]);
}
}
}
BufferView::BufferView(void)
{
SetCanHaveFocus(true);
RegisterMultiCast(ednMsgBufferListChange);
RegisterMultiCast(ednMsgBufferState);
RegisterMultiCast(ednMsgBufferId);
m_selectedID = -1;
m_selectedIdRequested = -1;
}
BufferView::~BufferView(void)
{
RemoveAllElement();
}
void BufferView::RemoveAllElement(void)
{
for(int32_t iii=0; iii<m_list.Size(); iii++) {
if (NULL!=m_list[iii]) {
delete(m_list[iii]);
m_list[iii] = NULL;
}
}
m_list.Clear();
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void BufferView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
{
ewol::List::OnReceiveMessage(CallerObject, eventId, data);
if (eventId == ednMsgBufferListChange) {
// clean The list
RemoveAllElement();
// Get all the buffer name and properties:
int32_t nbBufferOpen = BufferManager::Size();
for (int32_t iii=0; iii<nbBufferOpen; iii++) {
if (BufferManager::Exist(iii)) {
bool isModify = BufferManager::Get(iii)->IsModify();
etk::FSNode name = BufferManager::Get(iii)->GetFileName();
appl::dataBufferStruct* tmpElement = new appl::dataBufferStruct(name, iii, isModify);
if (NULL != tmpElement) {
m_list.PushBack(tmpElement);
} else {
APPL_ERROR("Allocation error of the tmp buffer list element");
}
}
}
if (true == globals::OrderTheBufferList() ) {
SortElementList(m_list);
}
MarkToRedraw();
}else if (eventId == ednMsgBufferId) {
m_selectedIdRequested = BufferManager::GetSelected();
MarkToRedraw();
}else if (eventId == ednMsgBufferState) {
// Update list of modify section ...
for (int32_t iii=0; iii<m_list.Size(); iii++) {
if (NULL!=m_list[iii]) {
m_list[iii]->m_isModify = BufferManager::Get(m_list[iii]->m_bufferID)->IsModify();
}
}
MarkToRedraw();
}
}
draw::Color BufferView::GetBasicBG(void)
{
return ColorizeManager::Get(COLOR_LIST_BG_1);
}
uint32_t BufferView::GetNuberOfColomn(void)
{
return 1;
}
bool BufferView::GetTitle(int32_t colomn, etk::UString &myTitle, draw::Color &fg, draw::Color &bg)
{
myTitle = "Buffers : ";
return true;
}
uint32_t BufferView::GetNuberOfRaw(void)
{
return m_list.Size();
}
bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg)
{
bool isModify;
basicColor_te selectFG = COLOR_LIST_TEXT_NORMAL;
basicColor_te selectBG = COLOR_LIST_BG_1;
// when requested a new display selection ==> reset the previous one ...
if (m_selectedIdRequested != -1) {
m_selectedID = -1;
}
if( raw>=0
&& raw<m_list.Size()
&& NULL != m_list[raw]) {
myTextToWrite = m_list[raw]->m_bufferName.GetNameFile();
if (true == m_list[raw]->m_isModify) {
selectFG = COLOR_LIST_TEXT_MODIFY;
} else {
selectFG = COLOR_LIST_TEXT_NORMAL;
}
if (raw%2==0) {
selectBG = COLOR_LIST_BG_1;
} else {
selectBG = COLOR_LIST_BG_2;
}
// the buffer change of selection ...
if (m_selectedIdRequested == m_list[raw]->m_bufferID) {
m_selectedID = raw;
// stop searching
m_selectedIdRequested = -1;
}
if (m_selectedID == raw) {
selectBG = COLOR_LIST_BG_SELECTED;
}
} else {
myTextToWrite = "ERROR";
}
fg = ColorizeManager::Get(selectFG);
bg = ColorizeManager::Get(selectBG);
return true;
}
bool BufferView::OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, float x, float y)
{
if (1 == IdInput && typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) {
APPL_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw );
if( raw>=0
&& raw<m_list.Size()
&& NULL != m_list[raw]) {
m_selectedID = raw;
SendMultiCast(ednMsgBufferId, m_list[raw]->m_bufferID);
}
}
MarkToRedraw();
return false;
}

View File

@ -1,92 +0,0 @@
/**
*******************************************************************************
* @file BufferView.h
* @brief Editeur De N'ours : main List Buffer Viewer (header)
* @author Edouard DUPIN
* @date 09/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __BUFFER_VIEW_H__
#define __BUFFER_VIEW_H__
#include <appl/Debug.h>
#include <CodeView.h>
#include <BufferManager.h>
#include <appl/globalMsg.h>
#include <ewol/widget/List.h>
namespace appl
{
class dataBufferStruct
{
public:
etk::FSNode m_bufferName;
uint32_t m_bufferID;
bool m_isModify;
dataBufferStruct(etk::FSNode& bufferName, int32_t bufferID, bool isModify) :
m_bufferName(bufferName),
m_bufferID(bufferID),
m_isModify(isModify)
{
};
~dataBufferStruct(void) { };
};
};
class BufferView : public ewol::List
{
private:
int32_t m_selectedIdRequested;
int32_t m_selectedID;
etk::Vector<appl::dataBufferStruct*> m_list;
public:
// Constructeur
BufferView(void);
~BufferView(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void) { return "ApplBufferView"; };
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
protected:
// function call to display the list :
virtual draw::Color GetBasicBG(void);
virtual uint32_t GetNuberOfColomn(void);
virtual bool GetTitle(int32_t colomn, etk::UString &myTitle, draw::Color &fg, draw::Color &bg);
virtual uint32_t GetNuberOfRaw(void);
virtual bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg);
virtual bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, float x, float y);
void RemoveAllElement(void);
};
#endif

View File

@ -1,475 +0,0 @@
/**
*******************************************************************************
* @file CodeView.cpp
* @brief Editeur De N'ours : Code Viewer Widget
* This is an abstraction
* @author Edouard DUPIN
* @date 05/01/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#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/eObject/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 = draw::color::black;
m_textColorBg = draw::color::black;
m_textColorBg.a = 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");
}
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
CodeView::CodeView(etk::UString fontName, int32_t fontSize) :
m_OObjectText(fontName, fontSize)
{
Init();
}
#endif
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
* @return ---
*/
void CodeView::UpdateNumberOfLineReference(int32_t bufferID)
{
etk::Vector2D<float> tmpCoord;
tmpCoord.x = 0;
tmpCoord.y = 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.x = 50;
m_minSize.y = 50;
return true;
}
void CodeView::CalculateMaxSize(void)
{
m_maxSize.x = 2048;
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
int32_t letterHeight = m_OObjectText.GetHeight();
#else
int32_t letterHeight = m_OObjectTextNormal.GetHeight();
#endif
m_maxSize.y = BufferManager::Get(m_bufferID)->GetNumberOfLine() * letterHeight;
}
void CodeView::OnDraw(ewol::DrawProperty& displayProp)
{
m_OObjectsColored.Draw();
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
m_OObjectText.Draw();
#else
m_OObjectTextNormal.Draw();
m_OObjectTextBold.Draw();
m_OObjectTextItalic.Draw();
m_OObjectTextBoldItalic.Draw();
#endif
WidgetScrooled::OnDraw(displayProp);
}
void CodeView::OnRegenerateDisplay(void)
{
if (true == NeedRedraw()) {
int64_t startTime = ewol::GetTime();
// For the scrooling windows
CalculateMaxSize();
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
m_OObjectText.Clear();
#else
m_OObjectTextNormal.Clear();
m_OObjectTextBold.Clear();
m_OObjectTextItalic.Clear();
m_OObjectTextBoldItalic.Clear();
#endif
m_OObjectsColored.Clear();
if(true == BufferManager::Get(m_bufferID)->NeedToUpdateDisplayPosition() ) {
etk::Vector2D<float> borderWidth = BufferManager::Get(m_bufferID)->GetBorderSize();
bool centerRequested = false;
// TODO : set it back ...
etk::Vector2D<float> currentPosition = BufferManager::Get(m_bufferID)->GetPosition(999/*m_OObjectTextNormal.GetFontID()*/, centerRequested);
SetScrollingPositionDynamic(borderWidth, currentPosition, centerRequested);
} // else : nothing to do ...
// generate the objects :
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
BufferManager::Get(m_bufferID)->Display(m_OObjectText,
m_OObjectsColored,
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
#else
BufferManager::Get(m_bufferID)->Display(m_OObjectTextNormal,
m_OObjectTextBold,
m_OObjectTextItalic,
m_OObjectTextBoldItalic,
m_OObjectsColored,
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
#endif
// 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::OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData)
{
//APPL_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent);
if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) {
BufferManager::Get(m_bufferID)->AddChar(unicodeData);
MarkToRedraw();
}
return true;
}
bool CodeView::OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveType_te moveTypeEvent)
{
if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) {
BufferManager::Get(m_bufferID)->cursorMove(moveTypeEvent);
MarkToRedraw();
}
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
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
bool CodeView::OnEventInput(ewol::inputType_te type, int32_t IdInput, ewol::eventInputType_te typeEvent, etk::Vector2D<float> pos)
{
etk::Vector2D<float> relativePos = RelativePosition(pos);
// corection for the openGl abstraction
//relativePos.y = m_size.y - relativePos.y;
etk::Vector2D<float> limitedPos = relativePos;
limitedPos.x = etk_avg(1, limitedPos.x, m_size.x-1);
limitedPos.y = etk_avg(1, limitedPos.y, m_size.y-1);
if (m_bufferID < 0) {
return false;
}
if (true == WidgetScrooled::OnEventInput(type, IdInput, typeEvent, pos)) {
ewol::widgetManager::FocusKeep(this);
// nothing to do ... done on upper widget ...
return true;
}
if (1 == IdInput) {
#ifndef __MODE__Touch
if (ewol::EVENT_INPUT_TYPE_DOWN == typeEvent) {
m_buttunOneSelected = true;
ewol::widgetManager::FocusKeep(this);
// TODO : Set something good
BufferManager::Get(m_bufferID)->MouseEvent(limitedPos);
MarkToRedraw();
} else if (ewol::EVENT_INPUT_TYPE_UP == typeEvent) {
m_buttunOneSelected = false;
BufferManager::Get(m_bufferID)->Copy(ewol::clipBoard::CLIPBOARD_SELECTION);
MarkToRedraw();
} else
#endif
if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) {
#ifdef __MODE__Touch
ewol::widgetManager::FocusKeep(this);
BufferManager::Get(m_bufferID)->MouseEvent(limitedPos);
MarkToRedraw();
#else
// nothing to do ...
#endif
} else if (ewol::EVENT_INPUT_TYPE_DOUBLE == typeEvent) {
BufferManager::Get(m_bufferID)->MouseEventDouble();
MarkToRedraw();
} else if (ewol::EVENT_INPUT_TYPE_TRIPLE == typeEvent) {
BufferManager::Get(m_bufferID)->MouseEventTriple();
MarkToRedraw();
} else if (ewol::EVENT_INPUT_TYPE_MOVE == typeEvent) {
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
BufferManager::Get(m_bufferID)->MouseSelectFromCursorTo(limitedPos);
MarkToRedraw();
}
}
} else if (2 == IdInput) {
if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) {
// TODO : Set something good
BufferManager::Get(m_bufferID)->MouseEvent(limitedPos);
ewol::clipBoard::Request(ewol::clipBoard::CLIPBOARD_SELECTION);
ewol::widgetManager::FocusKeep(this);
}
}
return true;
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
{
ewol::WidgetScrooled::OnReceiveMessage(CallerObject, eventId, data);
APPL_DEBUG("Extern Event : " << CallerObject << " type : " << eventId << " data=\"" << data << "\"");
if(eventId == 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(data.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 (eventId == ednMsgGuiCopy) {
BufferManager::Get(m_bufferID)->Copy(ewol::clipBoard::CLIPBOARD_STD);
} else if (eventId == ednMsgGuiCut) {
BufferManager::Get(m_bufferID)->Cut(ewol::clipBoard::CLIPBOARD_STD);
} else if (eventId == ednMsgGuiPaste) {
ewol::clipBoard::Request(ewol::clipBoard::CLIPBOARD_STD);
} else if (eventId == ednMsgGuiUndo) {
BufferManager::Get(m_bufferID)->Undo();
} else if (eventId == ednMsgGuiRedo) {
BufferManager::Get(m_bufferID)->Redo();
} else if (eventId == ednMsgGuiRm) {
// data : "Word" "Line" "Paragraph"
if (data == "Word") {
APPL_WARNING(" on event " << eventId << " data=\"" << data << "\" ==> not coded" );
} else if (data == "Line") {
BufferManager::Get(m_bufferID)->RemoveLine();
} else if (data == "Paragraph") {
APPL_WARNING(" on event " << eventId << " data=\"" << data << "\" ==> not coded" );
} else {
APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
}
} else if (eventId == ednMsgGuiSelect) {
// data : "ALL" "NONE"
if (data == "ALL") {
BufferManager::Get(m_bufferID)->SelectAll();
} else if (data == "NONE") {
BufferManager::Get(m_bufferID)->SelectNone();
} else {
APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
}
} else if (eventId == ednMsgGuiChangeCharset) {
// data : "UTF-8" "ISO-8859-1" "ISO-8859-15"
if (data == "UTF-8") {
BufferManager::Get(m_bufferID)->SetCharset(unicode::EDN_CHARSET_UTF8);
} else if (data == "ISO-8859-1") {
BufferManager::Get(m_bufferID)->SetCharset(unicode::EDN_CHARSET_ISO_8859_1);
} else if (data == "ISO-8859-15") {
BufferManager::Get(m_bufferID)->SetCharset(unicode::EDN_CHARSET_ISO_8859_15);
} else {
APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
}
} else if (eventId == ednMsgGuiFind) {
etk::UString myDataString;
SearchData::GetSearch(myDataString);
if (data == "Next") {
BufferManager::Get(m_bufferID)->Search(myDataString, false, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
} else if (data == "Previous") {
BufferManager::Get(m_bufferID)->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
}
} else if (eventId == ednMsgGuiReplace) {
etk::UString myDataString;
SearchData::GetReplace(myDataString);
if (data == "Normal") {
BufferManager::Get(m_bufferID)->Replace(myDataString);
} else if (data == "All") {
}
} else if (eventId == ednMsgGuiGotoLine) {
int32_t lineID = 0;
sscanf(data.c_str(), "%d", &lineID);
APPL_INFO("Goto line : " << lineID);
BufferManager::Get(m_bufferID)->JumpAtLine(lineID);
}
// Force redraw of the widget
MarkToRedraw();
}
void CodeView::OnGetFocus(void)
{
/*
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_bufferID);
*/
ewol::KeyboardShow();
APPL_INFO("Focus - In");
}
void CodeView::OnLostFocus(void)
{
ewol::KeyboardHide();
APPL_INFO("Focus - out");
}
void CodeView::SetFontSize(int32_t size)
{
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
m_OObjectText.SetSize(size);
#else
m_OObjectTextNormal.SetSize(size);
m_OObjectTextBold.SetSize(size);
m_OObjectTextItalic.SetSize(size);
m_OObjectTextBoldItalic.SetSize(size);
#endif
SetScrollingSize(size*3.0*1.46); // 1.46 is a magic nmber ...
}
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
void CodeView::SetFontName(etk::UString fontName)
{
m_OObjectText.SetFont(fontName);
}
#else
void CodeView::SetFontNameNormal(etk::UString fontName)
{
m_OObjectTextNormal.SetFont(fontName);
}
void CodeView::SetFontNameBold(etk::UString fontName)
{
m_OObjectTextBold.SetFont(fontName);
}
void CodeView::SetFontNameItalic(etk::UString fontName)
{
m_OObjectTextItalic.SetFont(fontName);
}
void CodeView::SetFontNameBoldItalic(etk::UString fontName)
{
m_OObjectTextBoldItalic.SetFont(fontName);
}
#endif

View File

@ -1,124 +0,0 @@
/**
*******************************************************************************
* @file CodeView.h
* @brief Editeur De N'ours : Code Viewer Widget (header)
* @author Edouard DUPIN
* @date 05/01/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __CODE_VIEW_H__
#define __CODE_VIEW_H__
#include <appl/Debug.h>
#include <CodeView.h>
#include <BufferManager.h>
#include <appl/globalMsg.h>
#include <etk/Types.h>
#include <ewol/widget/WidgetScrolled.h>
#include <ewol/ResourceManager.h>
class CodeView :public ewol::WidgetScrooled
{
public:
void Init(void);
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
CodeView(etk::UString fontName, int32_t fontSize);
#endif
CodeView(void);
virtual ~CodeView(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void) { return "ApplCodeView"; };
virtual bool CalculateMinSize(void);
private:
etk::UString m_label;
draw::Color m_textColorFg; //!< Text color
draw::Color m_textColorBg; //!< Background color
int32_t m_bufferID;
bool m_buttunOneSelected;
etk::Vector<etk::Vector2D<float> > m_lineNumberList;
void UpdateNumberOfLineReference(int32_t bufferID);
// drawing elements :
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
ewol::TEXT_DISPLAY_TYPE m_OObjectText;
#else
ewol::TEXT_DISPLAY_TYPE m_OObjectTextNormal;
ewol::TEXT_DISPLAY_TYPE m_OObjectTextBold;
ewol::TEXT_DISPLAY_TYPE m_OObjectTextItalic;
ewol::TEXT_DISPLAY_TYPE m_OObjectTextBoldItalic;
#endif
ewol::OObject2DColored m_OObjectsColored;
public:
virtual void OnRegenerateDisplay(void);
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
public:
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, ewol::eventInputType_te typeEvent, etk::Vector2D<float> 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);
public:
void SetFontSize(int32_t size);
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
void SetFontName(etk::UString fontName);
#else
void SetFontNameNormal(etk::UString fontName);
void SetFontNameBold(etk::UString fontName);
void SetFontNameItalic(etk::UString fontName);
void SetFontNameBoldItalic(etk::UString fontName);
#endif
private:
void CalculateMaxSize(void);
protected:
virtual void OnDraw(ewol::DrawProperty& displayProp);
};
#endif

View File

@ -1,442 +0,0 @@
/**
*******************************************************************************
* @file MainWindows.cpp
* @brief Editeur De N'ours : main Windows diplayer (Sources)
* @author Edouard DUPIN
* @date 04/01/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <appl/Debug.h>
#include <appl/global.h>
#include <MainWindows.h>
#include <CodeView.h>
#include <BufferView.h>
#include <Search.h>
#include <ewol/widget/Button.h>
#include <ewol/widget/CheckBox.h>
#include <ewol/widget/SizerHori.h>
#include <ewol/widget/SizerVert.h>
#include <ewol/widget/Label.h>
#include <ewol/widget/Entry.h>
#include <ewol/widget/List.h>
#include <ewol/widget/ContextMenu.h>
#include <ewol/widget/PopUp.h>
#include <ewol/widget/Spacer.h>
#include <ewol/widget/Slider.h>
#include <ewol/widget/Menu.h>
#include <ewol/widget/meta/FileChooser.h>
#include <ewol/widget/meta/Parameter.h>
#include <ewol/widget/WidgetManager.h>
#include <ewol/ResourceManager.h>
#include <ewol/eObject/EObject.h>
#undef __class__
#define __class__ "AboutGui"
#include <ewol/widget/Label.h>
#include <ewol/widget/Spacer.h>
class ParameterAboutGui : public ewol::SizerVert
{
public :
ParameterAboutGui(void)
{
ewol::Spacer* mySpacer = NULL;
mySpacer = new ewol::Spacer();
if (NULL == mySpacer) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
mySpacer->SetExpendX(true);
mySpacer->SetExpendY(true);
SubWidgetAdd(mySpacer);
}
AddElement(" libPng");
AddElement(" ogg-tremor");
AddElement(" portaudio");
AddElement(" libZip");
AddElement(" tinyXml");
AddElement(" freetype");
AddElement(" agg2.4");
AddElement(" etk (BSD)");
AddElement(" ewol is based on");
AddElement(" Website : https://github.com/HeeroYui/ewol");
AddElement(" Licence : BSD like");
AddElement(" Copyright 2010 Edouard DUPIN, all right reserved");
AddElement(" Supported OS : Linux, Windows, Android" );
AddElement(etk::UString(" OpenGl librairy : v") + ewol::GetVersion() );
AddElement("Ewol", true);
AddElement("");
AddElement(" Website : https://github.com/HeeroYui/edn");
AddElement(" Licence : GPL");
AddElement(" Copyright 2010 Edouard DUPIN, all right reserved");
AddElement(etk::UString(" Build Time : ") + etk::UString(BUILD_TIME));
AddElement(" Source Code Editor");
AddElement(etk::UString(" Editeur De N'ours : v") + etk::UString(APPL_VERSION_TAG_NAME));
AddElement("Edn", true);
};
~ParameterAboutGui(void) { };
void AddElement(etk::UString label, bool bold=false, bool italic=false)
{
ewol::Label* myLabel = new ewol::Label(label);
if (NULL == myLabel) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
myLabel->SetExpendX(true);
SubWidgetAdd(myLabel);
}
};
};
const char * l_smoothChick = "tmpEvent_smooth";
const char * l_smoothMin = "tmpEvent_minChange";
const char * l_smoothMax = "tmpEvent_maxChange";
extern float DF_SoftEdge_min;
extern float DF_SoftEdge_max;
extern int32_t DF_SoftEdge;
ewol::Slider* tmpSliderMin = NULL;
ewol::Slider* tmpSliderMax = NULL;
#undef __class__
#define __class__ "MainWindows"
MainWindows::MainWindows(void)
{
APPL_DEBUG("CREATE WINDOWS ... ");
ewol::SizerVert * mySizerVert = NULL;
ewol::SizerVert * mySizerVert2 = NULL;
ewol::SizerHori * mySizerHori = NULL;
//ewol::Button * myButton = NULL;
CodeView * myCodeView = NULL;
BufferView * myBufferView = NULL;
ewol::Menu * myMenu = NULL;
mySizerVert = new ewol::SizerVert();
SetSubWidget(mySizerVert);
mySizerHori = new ewol::SizerHori();
mySizerVert->SubWidgetAdd(mySizerHori);
myBufferView = new BufferView();
myBufferView->SetExpendX(false);
myBufferView->SetExpendY(true);
myBufferView->SetFillX(true);
myBufferView->SetFillY(true);
mySizerHori->SubWidgetAdd(myBufferView);
mySizerVert2 = new ewol::SizerVert();
mySizerHori->SubWidgetAdd(mySizerVert2);
// main buffer Area :
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
myCodeView = new CodeView("Font/freefont/FreeMono.ttf", 24);
#else
myCodeView = new CodeView();
#endif
myCodeView->SetExpendX(true);
myCodeView->SetExpendY(true);
myCodeView->SetFillX(true);
myCodeView->SetFillY(true);
#ifndef APPL_BUFFER_FONT_DISTANCE_FIELD
myCodeView->SetFontSize(11);
myCodeView->SetFontNameNormal( "Font/freefont/FreeMono.ttf");
myCodeView->SetFontNameBold( "Font/freefont/FreeMonoBold.ttf");
myCodeView->SetFontNameItalic( "Font/freefont/FreeMonoOblique.ttf");
myCodeView->SetFontNameBoldItalic("Font/freefont/FreeMonoBoldOblique.ttf");
#endif
mySizerVert2->SubWidgetAdd(myCodeView);
// search area :
Search * mySearch = new Search();
mySizerVert2->SubWidgetAdd(mySearch);
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
{
ewol::SizerHori * mySizerHori2 = new ewol::SizerHori();
mySizerVert2->SubWidgetAdd(mySizerHori2);
ewol::CheckBox* tmpCheck = new ewol::CheckBox("smooth");
mySizerHori2->SubWidgetAdd(tmpCheck);
tmpCheck->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_smoothChick);
ewol::Slider* tmpSlider = new ewol::Slider();
mySizerHori2->SubWidgetAdd(tmpSlider);
tmpSlider->RegisterOnEvent(this, ewolEventSliderChange, l_smoothMin);
tmpSlider->SetExpendX(true);
tmpSlider->SetMin(0);
tmpSlider->SetMax(1000);
tmpSlider->SetValue(0450);
tmpSliderMin = tmpSlider;
tmpSlider = new ewol::Slider();
mySizerHori2->SubWidgetAdd(tmpSlider);
tmpSlider->RegisterOnEvent(this, ewolEventSliderChange, l_smoothMax);
tmpSlider->SetExpendX(true);
tmpSlider->SetMin(0);
tmpSlider->SetMax(1000);
tmpSlider->SetValue(0550);
tmpSliderMax = tmpSlider;
}
#endif
mySizerHori = new ewol::SizerHori();
mySizerVert->SubWidgetAdd(mySizerHori);
myMenu = new ewol::Menu();
mySizerHori->SubWidgetAdd(myMenu);
int32_t idMenuFile = myMenu->AddTitle("File");
(void)myMenu->Add(idMenuFile, "New", "", ednMsgGuiNew);
(void)myMenu->AddSpacer();
(void)myMenu->Add(idMenuFile, "Open", "icon/Load.svg", ednMsgGuiOpen);
(void)myMenu->Add(idMenuFile, "Close", "icon/Close.svg", ednMsgGuiClose, "current");
(void)myMenu->Add(idMenuFile, "Close (all)", "", ednMsgGuiClose, "All");
(void)myMenu->Add(idMenuFile, "Save", "icon/Save.svg", ednMsgGuiSave, "current");
(void)myMenu->Add(idMenuFile, "Save As ...", "", ednMsgGuiSaveAs);
(void)myMenu->AddSpacer();
//(void)myMenu->Add(idMenuFile, "Exit", "", ednMsgGuiExit);
(void)myMenu->AddSpacer();
(void)myMenu->Add(idMenuFile, "Properties", "icon/Parameter.svg", ednMsgProperties);
int32_t idMenuEdit = myMenu->AddTitle("Edit");
(void)myMenu->Add(idMenuEdit, "Undo", "icon/Undo.svg", ednMsgGuiUndo);
(void)myMenu->Add(idMenuEdit, "Redo", "icon/Redo.svg", ednMsgGuiRedo);
(void)myMenu->AddSpacer();
(void)myMenu->Add(idMenuEdit, "Copy", "", ednMsgGuiCopy, "STD");
(void)myMenu->Add(idMenuEdit, "Cut", "", ednMsgGuiCut, "STD");
(void)myMenu->Add(idMenuEdit, "Paste", "", ednMsgGuiPaste, "STD");
(void)myMenu->Add(idMenuEdit, "Remove", "", ednMsgGuiRm);
(void)myMenu->AddSpacer();
(void)myMenu->Add(idMenuEdit, "Select All","", ednMsgGuiSelect, "ALL");
(void)myMenu->Add(idMenuEdit, "Un-Select","", ednMsgGuiSelect, "NONE");
(void)myMenu->Add(idMenuEdit, "Goto line ...","", ednMsgGuiGotoLine, "???");
int32_t idMenuSearch = myMenu->AddTitle("Search");
(void)myMenu->Add(idMenuSearch, "Search", "icon/Search.svg", ednMsgGuiSearch);
(void)myMenu->Add(idMenuSearch, "Replace", "icon/Replace.svg", ednMsgGuiReplace);
(void)myMenu->AddSpacer();
(void)myMenu->Add(idMenuSearch, "Find (previous)","", ednMsgGuiFind, "Previous");
(void)myMenu->Add(idMenuSearch, "Find (next)", "", ednMsgGuiFind, "Next");
(void)myMenu->Add(idMenuSearch, "Find (all)", "", ednMsgGuiFind, "All");
(void)myMenu->Add(idMenuSearch, "Un-Select", "", ednMsgGuiFind, "None");
int32_t idMenuCTags = myMenu->AddTitle("C-tags");
(void)myMenu->Add(idMenuCTags, "Load", "", ednMsgGuiCtags, "Load");
(void)myMenu->Add(idMenuCTags, "ReLoad", "", ednMsgGuiCtags, "ReLoad");
(void)myMenu->Add(idMenuCTags, "Jump", "", ednMsgGuiCtags, "Jump");
(void)myMenu->Add(idMenuCTags, "Back", "", ednMsgGuiCtags, "Back");
int32_t idMenugDisplay = myMenu->AddTitle("Display");
(void)myMenu->Add(idMenugDisplay, "Charset UTF-8", "", ednMsgGuiChangeCharset, "UTF-8");
(void)myMenu->Add(idMenugDisplay, "Charset ISO-8859-1", "", ednMsgGuiChangeCharset, "ISO-8859-1");
(void)myMenu->Add(idMenugDisplay, "Charset ISO-8859-15", "", ednMsgGuiChangeCharset, "ISO-8859-15");
(void)myMenu->AddSpacer();
(void)myMenu->Add(idMenugDisplay, "Color Black", "", ednMsgGuiChangeColor, "Black");
(void)myMenu->Add(idMenugDisplay, "Color White", "", ednMsgGuiChangeColor, "White");
(void)myMenu->AddSpacer();
(void)myMenu->Add(idMenugDisplay, "Reload OpenGl Shader", "", ednMsgGuiReloadShader);
m_widgetLabelFileName = new ewol::Label("FileName");
m_widgetLabelFileName->SetExpendX(true);
m_widgetLabelFileName->SetFillY(true);
mySizerHori->SubWidgetAdd(m_widgetLabelFileName);
// Generic event ...
RegisterMultiCast(ednMsgGuiSaveAs);
RegisterMultiCast(ednMsgProperties);
RegisterMultiCast(ednMsgGuiOpen);
// to update the title ...
RegisterMultiCast(ednMsgBufferState);
RegisterMultiCast(ednMsgBufferId);
RegisterMultiCast(ednMsgGuiReloadShader);
}
MainWindows::~MainWindows(void)
{
}
const char *const ednEventPopUpFileSelected = "edn-mainWindows-openSelected";
const char *const ednEventPopUpFileSaveAs = "edn-mainWindows-saveAsSelected";
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
{
ewol::Windows::OnReceiveMessage(CallerObject, eventId, data);
//APPL_INFO("Receive Event from the main windows ... : \"" << eventId << "\" ==> data=\"" << data << "\"" );
// Open file Section ...
if (eventId == ednMsgGuiOpen) {
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
tmpWidget->SetTitle("Open Files ...");
tmpWidget->SetValidateLabel("Open");
if (BufferManager::GetSelected()!=-1) {
Buffer * myBuffer = BufferManager::Get(BufferManager::GetSelected());
if (NULL!=myBuffer) {
etk::FSNode tmpFile = myBuffer->GetFileName();
tmpWidget->SetFolder(tmpFile.GetNameFolder());
}
}
PopUpWidgetPush(tmpWidget);
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected);
} else if (eventId == ednEventPopUpFileSelected) {
APPL_DEBUG("Request opening the file : " << data);
SendMultiCast(ednMsgOpenFile, data);
} else if (eventId == ednMsgGuiSaveAs) {
if (data == "") {
APPL_ERROR("Null data for Save As file ... ");
} else {
m_currentSavingAsIdBuffer = -1;
if (data == "current") {
m_currentSavingAsIdBuffer = BufferManager::GetSelected();
} else {
sscanf(data.c_str(), "%d", &m_currentSavingAsIdBuffer);
}
if (false == BufferManager::Exist(m_currentSavingAsIdBuffer)) {
APPL_ERROR("Request saveAs on non existant Buffer ID=" << m_currentSavingAsIdBuffer);
} else {
Buffer * myBuffer = BufferManager::Get(m_currentSavingAsIdBuffer);
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
if (NULL == tmpWidget) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
tmpWidget->SetTitle("Save Files As...");
tmpWidget->SetValidateLabel("Save");
etk::UString folder = "/home/";
etk::UString fileName = "";
if (true == myBuffer->HaveName()) {
etk::FSNode tmpName = myBuffer->GetFileName();
folder = tmpName.GetNameFolder();
fileName = tmpName.GetNameFile();
}
tmpWidget->SetFolder(folder);
tmpWidget->SetFileName(fileName);
PopUpWidgetPush(tmpWidget);
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSaveAs);
}
}
}
} else if (eventId == ednEventPopUpFileSaveAs) {
// get the filename :
etk::UString tmpData = data;
APPL_DEBUG("Request Saving As file : " << tmpData);
BufferManager::Get(m_currentSavingAsIdBuffer)->SetFileName(tmpData);
SendMultiCast(ednMsgGuiSave, m_currentSavingAsIdBuffer);
} else if( eventId == ednMsgBufferState
|| eventId == ednMsgBufferId) {
// the buffer change we need to update the widget string
Buffer* tmpBuffer = BufferManager::Get(BufferManager::GetSelected());
if (NULL != tmpBuffer) {
etk::FSNode compleateName = tmpBuffer->GetFileName();
bool isModify = tmpBuffer->IsModify();
etk::UString directName = compleateName.GetName();
if (true == isModify) {
directName += " *";
}
if (NULL == m_widgetLabelFileName) {
return;
}
m_widgetLabelFileName->SetLabel(directName);
etk::UString windowsTitle = "edn - ";
windowsTitle += directName;
ewol::SetTitle(windowsTitle);
return;
} else {
m_widgetLabelFileName->SetLabel("");
ewol::SetTitle("edn");
}
return;
// TODO : Set the Title ....
} else if (eventId == ednMsgProperties) {
// Request the parameter GUI
ewol::Parameter* tmpWidget = new ewol::Parameter();
if (NULL == tmpWidget) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
tmpWidget->SetTitle("Properties");
PopUpWidgetPush(tmpWidget);
tmpWidget->MenuAddGroup("Editor");
ewol::Widget* tmpSubWidget = new globals::ParameterGlobalsGui();
tmpWidget->MenuAdd("Editor", "", tmpSubWidget);
tmpWidget->MenuAdd("Polices & Color", "", NULL);
tmpWidget->MenuAdd("Highlight", "", NULL);
tmpWidget->MenuAddGroup("Genral");
tmpWidget->MenuAdd("Affichage", "", NULL);
tmpSubWidget = new ParameterAboutGui();
tmpWidget->MenuAdd("About", "", tmpSubWidget);
}
} else if (eventId == l_smoothChick) {
if (data == "true") {
DF_SoftEdge = 1;
} else {
DF_SoftEdge = 0;
}
} else if (eventId == l_smoothMin) {
int32_t newVal = 0;
sscanf(data.c_str(), "%d", &newVal);
DF_SoftEdge_min = (float)newVal / 1000.0;
if (DF_SoftEdge_min>DF_SoftEdge_max) {
DF_SoftEdge_max = DF_SoftEdge_min;
tmpSliderMax->SetValue(DF_SoftEdge_max*1000.0);
}
} else if (eventId == l_smoothMax) {
int32_t newVal = 0;
sscanf(data.c_str(), "%d", &newVal);
DF_SoftEdge_max = (float)newVal / 1000.0;
if (DF_SoftEdge_min>DF_SoftEdge_max) {
DF_SoftEdge_min = DF_SoftEdge_max;
tmpSliderMin->SetValue(DF_SoftEdge_min*1000.0);
}
} else if (eventId == ednMsgGuiReloadShader) {
ewol::resource::ReLoadResources();
ewol::ForceRedrawAll();
}
return;
}
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
void MainWindows::OnObjectRemove(ewol::EObject * removeObject)
{
ewol::Windows::OnObjectRemove(removeObject);
if (m_widgetLabelFileName == removeObject) {
m_widgetLabelFileName = NULL;
}
}

View File

@ -1,73 +0,0 @@
/**
*******************************************************************************
* @file MainWindows.h
* @brief Editeur De N'ours : main Windows diplayer (header)
* @author Edouard DUPIN
* @date 04/01/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __MAIN_WINDOWS_H__
#define __MAIN_WINDOWS_H__
#include <appl/Debug.h>
#include <appl/globalMsg.h>
#include <CodeView.h>
#include <BufferView.h>
#include <BufferManager.h>
#include <ewol/widget/Label.h>
class MainWindows : public ewol::Windows
{
private:
int32_t m_currentSavingAsIdBuffer;
ewol::Label* m_widgetLabelFileName;
public:
// Constructeur
MainWindows(void);
~MainWindows(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void) { return "MainWindows"; };
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
virtual void OnObjectRemove(ewol::EObject * removeObject);
};
#define EDN_CAST_MAIN_WINDOWS(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_MAIN_WINDOWS,MainWindows,curentPointer)
#endif

View File

@ -1,253 +0,0 @@
/**
*******************************************************************************
* @file Search.cpp
* @brief Editeur De N'ours : Search system
* @author Edouard DUPIN
* @date 03/01/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include "appl/global.h"
#include "Search.h"
#include "SearchData.h"
#include "BufferManager.h"
#include "MainWindows.h"
#include "appl/globalMsg.h"
#include <ewol/widget/ButtonImage.h>
#undef __class__
#define __class__ "Search"
const char* const l_eventSearchEntry = "appl-search-entry";
const char* const l_eventSearchEntryEnter = "appl-search-entry-enter";
const char* const l_eventReplaceEntry = "appl-replace-entry";
const char* const l_eventReplaceEntryEnter = "appl-replace-entry-enter";
const char* const l_eventSearchBt = "appl-search-button";
const char* const l_eventReplaceBt = "appl-replace-button";
const char* const l_eventCaseCb = "appl-case-sensitive-CheckBox";
const char* const l_eventWrapCb = "appl-wrap-CheckBox";
const char* const l_eventForwardCb = "appl-forward-CheckBox";
const char* const l_eventHideBt = "appl-hide-button";
Search::Search(void) :
m_searchEntry(NULL),
m_replaceEntry(NULL)
{
m_forward = false;
ewol::ButtonImage * myButtonImage = NULL;
myButtonImage = new ewol::ButtonImage("icon/Remove.svg");
if (NULL == myButtonImage) {
APPL_ERROR("Widget allocation error ==> it will missing in the display");
} else {
myButtonImage->SetMinSize(32,32);
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventHideBt);
SubWidgetAdd(myButtonImage);
}
m_searchEntry = new ewol::Entry();
if (NULL == m_searchEntry) {
APPL_ERROR("Widget allocation error ==> it will missing in the display");
} else {
m_searchEntry->RegisterOnEvent(this, ewolEventEntryModify, l_eventSearchEntry);
m_searchEntry->RegisterOnEvent(this, ewolEventEntryEnter, l_eventSearchEntryEnter);
m_searchEntry->SetExpendX(true);
m_searchEntry->SetFillX(true);
SubWidgetAdd(m_searchEntry);
}
myButtonImage = new ewol::ButtonImage("icon/Search.svg");
if (NULL == myButtonImage) {
APPL_ERROR("Widget allocation error ==> it will missing in the display");
} else {
myButtonImage->SetMinSize(32,32);
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventSearchBt);
SubWidgetAdd(myButtonImage);
}
m_replaceEntry = new ewol::Entry();
if (NULL == m_replaceEntry) {
APPL_ERROR("Widget allocation error ==> it will missing in the display");
} else {
m_replaceEntry->RegisterOnEvent(this, ewolEventEntryModify, l_eventReplaceEntry);
m_replaceEntry->RegisterOnEvent(this, ewolEventEntryEnter, l_eventReplaceEntryEnter);
m_replaceEntry->SetExpendX(true);
m_replaceEntry->SetFillX(true);
SubWidgetAdd(m_replaceEntry);
}
myButtonImage = new ewol::ButtonImage("icon/Replace.svg");
if (NULL == myButtonImage) {
APPL_ERROR("Widget allocation error ==> it will missing in the display");
} else {
myButtonImage->SetMinSize(32,32);
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventReplaceBt);
SubWidgetAdd(myButtonImage);
}
myButtonImage = new ewol::ButtonImage("icon/CaseSensitive.svg");
if (NULL == myButtonImage) {
APPL_ERROR("Widget allocation error ==> it will missing in the display");
} else {
myButtonImage->SetImageSelected("icon/CaseSensitive.svg", 0xFFFFFF5F);
myButtonImage->SetMinSize(32,32);
myButtonImage->SetToggleMode(true);
myButtonImage->SetValue(SearchData::GetCase());
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventCaseCb);
SubWidgetAdd(myButtonImage);
}
myButtonImage = new ewol::ButtonImage("icon/WrapAround.svg");
if (NULL == myButtonImage) {
APPL_ERROR("Widget allocation error ==> it will missing in the display");
} else {
myButtonImage->SetImageSelected("icon/WrapAround.svg", 0xFFFFFF5F);
myButtonImage->SetMinSize(32,32);
myButtonImage->SetToggleMode(true);
myButtonImage->SetValue(SearchData::GetWrap());
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventWrapCb);
SubWidgetAdd(myButtonImage);
}
myButtonImage = new ewol::ButtonImage("icon/Up.svg");
if (NULL == myButtonImage) {
APPL_ERROR("Widget allocation error ==> it will missing in the display");
} else {
myButtonImage->SetImageSelected("icon/Down.svg");
myButtonImage->SetMinSize(32,32);
myButtonImage->SetToggleMode(true);
myButtonImage->SetValue(m_forward);
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventForwardCb);
SubWidgetAdd(myButtonImage);
}
RegisterMultiCast(ednMsgGuiSearch);
// basicly hiden ...
Hide();
}
Search::~Search(void)
{
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void Search::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
{
ewol::SizerHori::OnReceiveMessage(CallerObject, eventId, data);
//APPL_INFO("Search receive message : \"" << eventId << "\" data=\"" << data << "\"");
if ( eventId == l_eventSearchEntry) {
SearchData::SetSearch(data);
} else if ( eventId == l_eventSearchEntryEnter) {
SearchData::SetSearch(data);
if (true==m_forward) {
SendMultiCast(ednMsgGuiFind, "Previous");
} else {
SendMultiCast(ednMsgGuiFind, "Next");
}
} else if ( eventId == l_eventReplaceEntry) {
SearchData::SetReplace(data);
} else if ( eventId == l_eventReplaceEntryEnter) {
SearchData::SetReplace(data);
SendMultiCast(ednMsgGuiReplace, "Normal");
if (true==m_forward) {
SendMultiCast(ednMsgGuiFind, "Previous");
} else {
SendMultiCast(ednMsgGuiFind, "Next");
}
} else if ( eventId == l_eventSearchBt) {
if (true==m_forward) {
SendMultiCast(ednMsgGuiFind, "Previous");
} else {
SendMultiCast(ednMsgGuiFind, "Next");
}
} else if ( eventId == l_eventReplaceBt) {
SendMultiCast(ednMsgGuiReplace, "Normal");
if (true==m_forward) {
SendMultiCast(ednMsgGuiFind, "Previous");
} else {
SendMultiCast(ednMsgGuiFind, "Next");
}
} else if ( eventId == l_eventCaseCb) {
if (data == "true") {
SearchData::SetCase(true);
} else {
SearchData::SetCase(false);
}
} else if ( eventId == l_eventWrapCb) {
if (data == "true") {
SearchData::SetWrap(true);
} else {
SearchData::SetWrap(false);
}
} else if ( eventId == l_eventForwardCb) {
if (data == "true") {
m_forward = true;
} else {
m_forward = false;
}
} else if ( eventId == l_eventHideBt) {
Hide();
} else if ( eventId == ednMsgGuiSearch) {
if (true == IsHide()) {
Show();
if (m_searchEntry!= NULL) {
m_searchEntry->KeepFocus();
}
} else {
if( (m_searchEntry!=NULL && true==m_searchEntry->GetFocus())
|| (m_replaceEntry!=NULL && true==m_replaceEntry->GetFocus()) ) {
Hide();
} else if (m_searchEntry!= NULL) {
m_searchEntry->KeepFocus();
} else {
Hide();
}
}
}
}
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
void Search::OnObjectRemove(ewol::EObject * removeObject)
{
ewol::SizerHori::OnObjectRemove(removeObject);
if (removeObject == m_searchEntry) {
m_searchEntry = NULL;
}
if (removeObject == m_replaceEntry) {
m_replaceEntry = NULL;
}
}

View File

@ -1,69 +0,0 @@
/**
*******************************************************************************
* @file Search.h
* @brief Editeur De N'ours : Search system (header)
* @author Edouard DUPIN
* @date 03/01/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __SEARCH_H__
#define __SEARCH_H__
#include <appl/Debug.h>
#include <ewol/widget/SizerHori.h>
#include <ewol/widget/Entry.h>
class Search : public ewol::SizerHori
{
public:
// Constructeur
Search(void);
~Search(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void) { return "ApplSearch"; };
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
virtual void OnObjectRemove(ewol::EObject * removeObject);
private:
bool m_forward;
ewol::Entry * m_searchEntry;
ewol::Entry * m_replaceEntry;
};
#endif

View File

@ -1,102 +0,0 @@
/**
*******************************************************************************
* @file SearchData.cpp
* @brief Editeur De N'ours : Search Data element (Sources)
* @author Edouard DUPIN
* @date 02/02/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <appl/global.h>
#include <SearchData.h>
#undef __class__
#define __class__ "SearchData"
static etk::UString m_findRequest = "";
void SearchData::SetSearch(etk::UString &myData)
{
m_findRequest = myData;
}
void SearchData::GetSearch(etk::UString &myData)
{
myData = m_findRequest;
}
bool SearchData::IsSearchEmpty(void)
{
if(m_findRequest.Size() > 0) {
return false;
}
return true;
}
static etk::UString m_replaceRequest = "";
void SearchData::SetReplace(etk::UString &myData)
{
m_replaceRequest = myData;
}
void SearchData::GetReplace(etk::UString &myData)
{
myData = m_replaceRequest;
}
bool SearchData::IsReplaceEmpty(void)
{
if(m_replaceRequest.Size() > 0) {
return false;
}
return true;
}
static bool m_case = false;
void SearchData::SetCase(bool value)
{
m_case = value;
}
bool SearchData::GetCase(void)
{
return m_case;
}
static bool m_wrap = true;
void SearchData::SetWrap(bool value)
{
m_wrap = value;
}
bool SearchData::GetWrap(void)
{
return m_wrap;
}
static bool m_RegExp = false;
void SearchData::SetRegExp(bool value)
{
m_RegExp = value;
}
bool SearchData::GetRegExp(void)
{
return m_RegExp;
}

View File

@ -1,49 +0,0 @@
/**
*******************************************************************************
* @file SearchData.h
* @brief Editeur De N'ours : Search Data element (header)
* @author Edouard DUPIN
* @date 02/02/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __SEARCH_DATA_H__
#define __SEARCH_DATA_H__
#include <etk/UString.h>
#include <appl/Debug.h>
namespace SearchData
{
void SetSearch(etk::UString &myData);
void GetSearch(etk::UString &myData);
bool IsSearchEmpty(void);
void SetReplace(etk::UString &myData);
void GetReplace(etk::UString &myData);
bool IsReplaceEmpty(void);
void SetCase(bool value);
bool GetCase(void);
void SetWrap(bool value);
bool GetWrap(void);
void SetRegExp(bool value);
bool GetRegExp(void);
}
#endif

View File

@ -1,155 +0,0 @@
/**
*******************************************************************************
* @file TagFileList.cpp
* @brief Editeur De N'ours : Tags list display to jump (sources)
* @author Edouard DUPIN
* @date 16/10/2012
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <etk/tool.h>
#include <appl/Gui/TagFileList.h>
#undef __class__
#define __class__ "TagFileList"
extern const char * const applEventCtagsListSelect = "appl-event-ctags-list-select";
extern const char * const applEventCtagsListUnSelect = "appl-event-ctags-list-un-select";
extern const char * const applEventCtagsListValidate = "appl-event-ctags-list-validate";
appl::TagFileList::TagFileList(void)
{
m_selectedLine = -1;
AddEventId(applEventCtagsListSelect);
AddEventId(applEventCtagsListValidate);
SetMouseLimit(1);
}
appl::TagFileList::~TagFileList(void)
{
for (int32_t iii=0; iii<m_list.Size(); iii++) {
if (NULL != m_list[iii]) {
delete(m_list[iii]);
m_list[iii] = NULL;
}
}
}
draw::Color appl::TagFileList::GetBasicBG(void) {
draw::Color bg(0x00000010);
return bg;
}
uint32_t appl::TagFileList::GetNuberOfColomn(void) {
return 2;
}
bool appl::TagFileList::GetTitle(int32_t colomn, etk::UString &myTitle, draw::Color &fg, draw::Color &bg) {
myTitle = "title";
return true;
}
uint32_t appl::TagFileList::GetNuberOfRaw(void) {
return m_list.Size();
}
bool appl::TagFileList::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg) {
if (raw >= 0 && raw < m_list.Size() && NULL != m_list[raw]) {
if (0==colomn) {
myTextToWrite = etk::UString(m_list[raw]->fileLine);
} else {
myTextToWrite = m_list[raw]->filename;
}
} else {
myTextToWrite = "ERROR";
}
fg = draw::color::black;
if (raw % 2) {
if (colomn%2==0) {
bg = 0xFFFFFF00;
} else {
bg = 0xFFFFFF10;
}
} else {
if (colomn%2==0) {
bg = 0xBFBFBFFF;
} else {
bg = 0xCFCFCFFF;
}
}
if (m_selectedLine == raw) {
if (colomn%2==0) {
bg = 0x8F8FFFFF;
} else {
bg = 0x7F7FFFFF;
}
}
return true;
};
bool appl::TagFileList::OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, float x, float y)
{
if (typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) {
EWOL_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw );
if (1 == IdInput) {
int32_t previousRaw = m_selectedLine;
if (raw > m_list.Size() ) {
m_selectedLine = -1;
} else {
m_selectedLine = raw;
}
const char * event = applEventCtagsListValidate;
if (previousRaw != m_selectedLine) {
event = applEventCtagsListSelect;
}
if( m_selectedLine >=0
&& m_selectedLine < m_list.Size()
&& NULL != m_list[m_selectedLine] ) {
GenerateEventId(event, etk::UString(m_list[raw]->fileLine)+":"+m_list[m_selectedLine]->filename);
} else {
GenerateEventId(applEventCtagsListUnSelect);
}
// need to regenerate the display of the list :
MarkToRedraw();
return true;
}
}
return false;
}
/**
* @brief Add a Ctags item on the curent list
* @param[in] file Compleate file name
* @param[in] jump line id
* @return ---
*/
void appl::TagFileList::Add(etk::UString& file, int32_t line)
{
appl::TagListElement *tmpFile = new appl::TagListElement(file, line);
if (NULL != tmpFile) {
m_list.PushBack(tmpFile);
}
MarkToRedraw();
}

View File

@ -1,84 +0,0 @@
/**
*******************************************************************************
* @file TagFileList.h
* @brief Editeur De N'ours : Tags list display to jump (header)
* @author Edouard DUPIN
* @date 16/10/2012
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __APPL_CTAGS_LIST_H__
#define __APPL_CTAGS_LIST_H__
#include <etk/Types.h>
#include <appl/Debug.h>
#include <ewol/widget/List.h>
extern const char * const applEventCtagsListSelect;
extern const char * const applEventCtagsListValidate;
extern const char * const applEventCtagsListUnSelect;
namespace appl {
class TagListElement {
public:
etk::UString filename;
int32_t fileLine;
TagListElement(etk::UString& file, int32_t line) : filename(file), fileLine(line) {};
~TagListElement(void) {};
};
class TagFileList : public ewol::List
{
private:
int32_t m_selectedLine;
etk::Vector<appl::TagListElement*> m_list;
public:
TagFileList(void);
~TagFileList(void);
// display API :
virtual draw::Color GetBasicBG(void);
uint32_t GetNuberOfColomn(void);
bool GetTitle(int32_t colomn, etk::UString &myTitle, draw::Color &fg, draw::Color &bg);
uint32_t GetNuberOfRaw(void);
bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg);
bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, float x, float y);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void) { return "TagFileList"; };
public:
/**
* @brief Add a Ctags item on the curent list
* @param[in] file Compleate file name
* @param[in] jump line id
* @return ---
*/
void Add(etk::UString& file, int32_t line);
};
};
#endif

View File

@ -1,229 +0,0 @@
/**
*******************************************************************************
* @file TagFileSelection.cpp
* @brief Editeur De N'ours : Tags list selection to jump (sources)
* @author Edouard DUPIN
* @date 16/10/2012
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
/**
*******************************************************************************
* @file ewol/widget/meta/FileChooser.cpp
* @brief ewol File chooser meta widget system (Sources)
* @author Edouard DUPIN
* @date 29/12/2011
* @par Project
* ewol
*
* @par Copyright
* Copyright 2011 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
*
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <appl/Gui/TagFileSelection.h>
#include <ewol/widget/SizerHori.h>
#include <ewol/widget/SizerVert.h>
#include <ewol/widget/List.h>
#include <ewol/widget/Spacer.h>
#include <ewol/widget/Image.h>
#include <ewol/widget/WidgetManager.h>
#include <etk/Vector.h>
#include <etk/tool.h>
#include <ewol/widget/Button.h>
#include <ewol/widget/Label.h>
#include <ewol/ewol.h>
#undef __class__
#define __class__ "TagFileSelection"
extern const char * const applEventctagsSelection = "appl-event-ctags-validate";
extern const char * const applEventctagsCancel = "appl-event-ctags-cancel";
appl::TagFileSelection::TagFileSelection(void)
{
AddEventId(applEventctagsSelection);
AddEventId(applEventctagsCancel);
ewol::Label* myWidgetTitle = NULL;
ewol::Button* myWidgetValidate = NULL;
ewol::Button* myWidgetCancel = NULL;
ewol::SizerVert * mySizerVert = NULL;
ewol::SizerHori * mySizerHori = NULL;
ewol::Spacer * mySpacer = NULL;
#if defined(__TARGET_OS__Android)
SetDisplayRatio(0.90);
#elif defined(__TARGET_OS__Windows)
SetDisplayRatio(0.80);
#else
SetDisplayRatio(0.80);
#endif
mySizerVert = new ewol::SizerVert();
if (NULL == mySizerVert) {
EWOL_ERROR("Can not allocate widget ==> display might be in error");
} else {
mySizerVert->LockExpendContamination(true);
// set it in the pop-up-system :
SubWidgetSet(mySizerVert);
mySizerHori = new ewol::SizerHori();
if (NULL == mySizerHori) {
EWOL_ERROR("Can not allocate widget ==> display might be in error");
} else {
mySizerVert->SubWidgetAdd(mySizerHori);
mySpacer = new ewol::Spacer();
if (NULL == mySpacer) {
EWOL_ERROR("Can not allocate widget ==> display might be in error");
} else {
mySpacer->SetExpendX(true);
mySizerHori->SubWidgetAdd(mySpacer);
}
myWidgetValidate = new ewol::Button("Jump");
if (NULL == myWidgetValidate) {
EWOL_ERROR("Can not allocate widget ==> display might be in error");
} else {
myWidgetValidate->SetImage("icon/Load.svg");
myWidgetValidate->RegisterOnEvent(this, ewolEventButtonPressed, applEventctagsSelection);
mySizerHori->SubWidgetAdd(myWidgetValidate);
}
myWidgetCancel = new ewol::Button("Cancel");
if (NULL == myWidgetCancel) {
EWOL_ERROR("Can not allocate widget ==> display might be in error");
} else {
myWidgetCancel->SetImage("icon/Remove.svg");
myWidgetCancel->RegisterOnEvent(this, ewolEventButtonPressed, applEventctagsCancel);
mySizerHori->SubWidgetAdd(myWidgetCancel);
}
}
m_listTag = new appl::TagFileList();
if (NULL == m_listTag) {
EWOL_ERROR("Can not allocate widget ==> display might be in error");
} else {
m_listTag->RegisterOnEvent(this, applEventCtagsListValidate);
m_listTag->RegisterOnEvent(this, applEventCtagsListSelect);
m_listTag->RegisterOnEvent(this, applEventCtagsListUnSelect);
m_listTag->SetExpendX(true);
m_listTag->SetExpendY(true);
m_listTag->SetFillX(true);
m_listTag->SetFillY(true);
mySizerVert->SubWidgetAdd(m_listTag);
}
myWidgetTitle = new ewol::Label("Ctags Jump Selection ...");
if (NULL == myWidgetTitle) {
EWOL_ERROR("Can not allocate widget ==> display might be in error");
} else {
mySizerVert->SubWidgetAdd(myWidgetTitle);
}
}
}
appl::TagFileSelection::~TagFileSelection(void)
{
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void appl::TagFileSelection::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
{
EWOL_INFO("ctags LIST ... : \"" << eventId << "\" ==> data=\"" << data << "\"" );
if (eventId == applEventctagsSelection) {
if (m_eventNamed!="") {
GenerateEventId(applEventctagsSelection, m_eventNamed);
//==> Auto remove ...
AutoDestroy();
}
} else if (eventId == applEventCtagsListSelect) {
m_eventNamed = data;
} else if (eventId == applEventCtagsListUnSelect) {
m_eventNamed = "";
} else if (eventId == applEventCtagsListValidate) {
GenerateEventId(applEventctagsSelection, data);
//==> Auto remove ...
AutoDestroy();
} else if (eventId == applEventctagsCancel) {
GenerateEventId(applEventctagsCancel, "");
//==> Auto remove ...
AutoDestroy();
}
return;
};
/**
* @brief Add a Ctags item on the curent list
* @param[in] file Compleate file name
* @param[in] jump line id
* @return ---
*/
void appl::TagFileSelection::AddCtagsNewItem(etk::UString file, int32_t line)
{
if (NULL != m_listTag) {
m_listTag->Add(file, line);
}
}
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
void appl::TagFileSelection::OnObjectRemove(ewol::EObject * removeObject)
{
// First step call parrent :
ewol::PopUp::OnObjectRemove(m_listTag);
// second step find if in all the elements ...
if(removeObject == m_listTag) {
m_listTag = NULL;
}
}

View File

@ -1,81 +0,0 @@
/**
*******************************************************************************
* @file TagFileSelection.h
* @brief Editeur De N'ours : Tags list selection to jump (header)
* @author Edouard DUPIN
* @date 16/10/2012
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __APPL_CTAGS_SELECTION_H__
#define __APPL_CTAGS_SELECTION_H__
#include <etk/Types.h>
#include <appl/Debug.h>
#include <ewol/widget/PopUp.h>
#include <appl/Gui/TagFileList.h>
extern const char * const applEventctagsSelection;
extern const char * const applEventctagsCancel;
namespace appl {
class TagFileSelection : public ewol::PopUp
{
private:
appl::TagFileList* m_listTag;
etk::UString m_eventNamed;
public:
TagFileSelection(void);
virtual ~TagFileSelection(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void) { return "EwolFileChooser"; };
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
void OnObjectRemove(ewol::EObject * removeObject);
/**
* @brief Add a Ctags item on the curent list
* @param[in] file Compleate file name
* @param[in] jump line id
* @return ---
*/
void AddCtagsNewItem(etk::UString file, int32_t line);
};
};
#endif

View File

@ -1,332 +0,0 @@
/**
*******************************************************************************
* @file Highlight.c
* @brief Editeur De N'ours : Hightlightning Specific
* @author Edouard DUPIN
* @date 14/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <appl/Debug.h>
#include <appl/global.h>
#include <Highlight.h>
#include <tinyXML/tinyxml.h>
#undef __class__
#define __class__ "Highlight"
void Highlight::ParseRules(TiXmlNode *child, etk::Vector<HighlightPattern*> &mListPatern, int32_t level)
{
// Create the patern ...
HighlightPattern *myPattern = new HighlightPattern();
// parse under Element
myPattern->ParseRules(child, level);
// add element in the list
mListPatern.PushBack(myPattern);
}
Highlight::Highlight(etk::UString &xmlFilename)
{
TiXmlDocument XmlDocument;
etk::FSNode fileName(etk::UString("DATA:") + xmlFilename);
if (false == fileName.Exist()) {
APPL_ERROR("File Does not exist : " << fileName);
return;
}
int32_t fileSize = fileName.FileSize();
if (0==fileSize) {
APPL_ERROR("This file is empty : " << fileName);
return;
}
if (false == fileName.FileOpenRead()) {
APPL_ERROR("Can not open the file : " << fileName);
return;
}
// allocate data
char * fileBuffer = new char[fileSize+5];
if (NULL == fileBuffer) {
APPL_ERROR("Error Memory allocation size=" << fileSize);
return;
}
memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
// load data from the file :
fileName.FileRead(fileBuffer, 1, fileSize);
// close the file:
fileName.FileClose();
// load the XML from the memory
bool loadError = XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8);
if (false == loadError) {
APPL_ERROR( "can not load Hightlight XML: PARSING error: \"" << xmlFilename << "\"");
return;
}
TiXmlElement* root = XmlDocument.FirstChildElement( "EdnLang" );
if (NULL == root) {
APPL_ERROR( "can not load Hightlight XML: main node not find: \"EdnLang\"");
return;
}
int32_t level1 = 0;
int32_t level2 = 0;
TiXmlNode * child = root->FirstChild();
while(NULL != child)
{
if (child->Type()==TiXmlNode::TINYXML_COMMENT) {
// nothing to do ...
} else if (!strcmp(child->Value(), "ext")) {
const char *myData = child->ToElement()->GetText();
if (NULL != myData) {
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", child->Row(), child->Value() , myData);
etk::UString * myEdnData = new etk::UString(myData);
m_listExtentions.PushBack(myEdnData);
}
} else if (!strcmp(child->Value(), "pass1")) {
// Get sub Nodes ...
TiXmlNode *passChild = child->FirstChild();
while (NULL != passChild) {
if (passChild->Type()==TiXmlNode::TINYXML_COMMENT) {
// nothing to do ...
} else if (!strcmp(passChild->Value(), "rule")) {
ParseRules(passChild, m_listHighlightPass1, level1++);
} else {
APPL_ERROR("(l "<< passChild->Row() << ") node not suported : \""<< passChild->Value() << "\" must be [rule]" );
}
// get the next node element :
passChild = passChild->NextSibling();
}
} else if (!strcmp(child->Value(), "pass2")) {
// Get sub Nodes ...
TiXmlNode *passChild = child->FirstChild();
while (NULL != passChild) {
if (passChild->Type()==TiXmlNode::TINYXML_COMMENT) {
// nothing to do ...
} else if (!strcmp(passChild->Value(), "rule")) {
ParseRules(passChild, m_listHighlightPass2, level2++);
} else {
APPL_ERROR("(l "<< passChild->Row() << ") node not suported : \""<< passChild->Value() << "\" must be [rule]" );
}
// get the next node element :
passChild = passChild->NextSibling();
}
} else {
APPL_ERROR("(l "<< child->Row() << ") node not suported : \""<< child->Value() << "\" must be [ext,pass1,pass2]" );
}
// get the next node element :
child = child->NextSibling();
}
if (NULL != fileBuffer) {
delete[] fileBuffer;
}
}
Highlight::~Highlight(void)
{
int32_t i;
// clean all Element
for (i=0; i< m_listHighlightPass1.Size(); i++) {
if (NULL != m_listHighlightPass1[i]) {
delete(m_listHighlightPass1[i]);
m_listHighlightPass1[i] = NULL;
}
}
// clear the compleate list
m_listHighlightPass1.Clear();
// clean all Element
for (i=0; i< m_listExtentions.Size(); i++) {
if (NULL != m_listExtentions[i]) {
delete(m_listExtentions[i]);
m_listExtentions[i] = NULL;
}
}
// clear the compleate list
m_listExtentions.Clear();
}
void Highlight::ReloadColor(void)
{
int32_t i;
for (i=0; i< m_listHighlightPass1.Size(); i++) {
if (NULL != m_listHighlightPass1[i]) {
m_listHighlightPass1[i]->ReloadColor();
}
}
for (i=0; i< m_listHighlightPass2.Size(); i++) {
if (NULL != m_listHighlightPass2[i]) {
m_listHighlightPass2[i]->ReloadColor();
}
}
}
bool Highlight::HasExtention(etk::UString &ext)
{
int32_t i;
for (i=0; i<m_listExtentions.Size(); i++) {
if (ext == *m_listExtentions[i] ) {
return true;
}
}
return false;
}
bool Highlight::FileNameCompatible(etk::FSNode &fileName)
{
int32_t i;
etk::UString extention;
if (true == fileName.FileHasExtention() ) {
extention = "*.";
extention += fileName.FileGetExtention();
} else {
extention = fileName.GetNameFile();
}
APPL_DEBUG(" try to find : in \"" << fileName << "\" extention:\"" << extention << "\" ");
for (i=0; i<m_listExtentions.Size(); i++) {
if (extention == *m_listExtentions[i] ) {
return true;
}
}
return false;
}
void Highlight::Display(void)
{
int32_t i;
APPL_INFO("List of ALL Highlight : ");
for (i=0; i< m_listExtentions.Size(); i++) {
APPL_INFO(" Extention : " << i << " : " << *m_listExtentions[i] );
}
// Display all elements
for (i=0; i< m_listHighlightPass1.Size(); i++) {
APPL_INFO(" " << i << " Pass 1 : " << m_listHighlightPass1[i]->GetName() );
//m_listHighlightPass1[i]->Display();
}
// Display all elements
for (i=0; i< m_listHighlightPass2.Size(); i++) {
APPL_INFO(" " << i << " Pass 2 : " << m_listHighlightPass2[i]->GetName() );
//m_listHighlightPass2[i]->Display();
}
}
// 13h 46min 22s | (l= 214) Highlight::Parse | [II] Find Pattern in the Buffer : (2457,2479)
// TODO : Celui qui appelle suprime des element pour rien ... Enfin c'est pas trègrave... Il suffirait juste de suprimer celuis d'avant si il n'est pas terminer...
void Highlight::Parse(int32_t start,
int32_t stop,
etk::Vector<colorInformation_ts> &metaData,
int32_t addingPos,
EdnVectorBuf &buffer)
{
if (0 > addingPos) {
addingPos = 0;
}
//APPL_DEBUG("Parse element 0 => " << m_listHighlightPass1.Size() << " ==> position search: (" << start << "," << stop << ")" );
int32_t elementStart = start;
int32_t elementStop = stop;
colorInformation_ts resultat;
while (elementStart<elementStop) {
//APPL_DEBUG("Parse element in the buffer id=" << elementStart);
//try to fond the HL in ALL of we have
for (int32_t jjj=0; jjj<m_listHighlightPass1.Size(); jjj++){
resultFind_te ret = HLP_FIND_OK;
//APPL_DEBUG("Parse HL id=" << jjj << " position search: (" << start << "," << buffer.Size() << ")" );
// Stop the search to the end (to get the end of the pattern)
ret = m_listHighlightPass1[jjj]->Find(elementStart, buffer.Size(), resultat, buffer);
if (HLP_FIND_ERROR != ret) {
//APPL_INFO("Find Pattern in the Buffer : (" << resultat.beginStart << "," << resultat.endStop << ")" );
// Remove element in the current List where the current Element have a end inside the next...
int32_t kkk=addingPos;
while(kkk < metaData.Size() ) {
if (metaData[kkk].beginStart <= resultat.endStop) {
// Remove element
//APPL_INFO("Erase element=" << kkk);
metaData.EraseLen(kkk, kkk+1);
// Increase the end of search
if (kkk < metaData.Size()) {
// just befor the end of the next element
elementStop = metaData[kkk].beginStart-1;
} else {
// end of the buffer
elementStop = buffer.Size();
}
} else {
// Not find ==> exit the cycle :
break;
}
}
// Add curent element in the list ...
metaData.Insert(addingPos, resultat);
//APPL_DEBUG("INSERT at "<< addingPos << " S=" << resultat.beginStart << " E=" << resultat.endStop );
// Update the current research starting element: (Set position at the end of the current element
elementStart = resultat.endStop-1;
// increment the position of insertion:
addingPos++;
// We find a pattern ==> Stop search for the current element
break;
}
}
// Go to the next element (and search again ...).
elementStart++;
}
}
/**
* @brief second pass of the hightlight
*
*/
void Highlight::Parse2(int32_t start,
int32_t stop,
etk::Vector<colorInformation_ts> &metaData,
EdnVectorBuf &buffer)
{
//APPL_DEBUG("Parse element 0 => " << m_listHighlightPass2.size() << " ==> position search: (" << start << "," << stop << ")" );
int32_t elementStart = start;
int32_t elementStop = stop;
colorInformation_ts resultat;
while (elementStart<elementStop) {
//APPL_DEBUG("Parse element in the buffer id=" << elementStart);
//try to fond the HL in ALL of we have
int32_t jjj;
for (jjj=0; jjj<m_listHighlightPass2.Size(); jjj++){
resultFind_te ret = HLP_FIND_OK;
//APPL_DEBUG("Parse HL id=" << jjj << " position search: (" << start << "," << buffer.Size() << ")" );
// Stop the search to the end (to get the end of the pattern)
ret = m_listHighlightPass2[jjj]->Find(elementStart, elementStop, resultat, buffer);
if (HLP_FIND_ERROR != ret) {
//APPL_INFO("Find Pattern in the Buffer : (" << resultat.beginStart << "," << resultat.endStop << ")" );
// Add curent element in the list ...
metaData.PushBack(resultat);
elementStart = resultat.endStop-1;
// Exit current cycle
break;
}
}
// Go to the next element (and search again ...).
elementStart++;
}
}

View File

@ -1,83 +0,0 @@
/**
*******************************************************************************
* @file Highlight.h
* @brief Editeur De N'ours : Hightlightning Specific (header)
* @author Edouard DUPIN
* @date 14/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __HIGHLIGHT_H__
#define __HIGHLIGHT_H__
class Highlight;
class HighlightPattern;
extern "C" {
typedef struct
{
int32_t beginStart;
int32_t beginStop;
int32_t endStart;
int32_t endStop;
bool notEnded;
HighlightPattern * patern; // pointer on class :
} colorInformation_ts;
}
#include <etk/os/FSNode.h>
#include <HighlightPattern.h>
#include <Colorize.h>
#include <EdnVectorBuf.h>
#include <tinyXML/tinyxml.h>
class Highlight {
public:
// Constructeur
Highlight(etk::UString &xmlFilename);
~Highlight(void);
bool HasExtention(etk::UString &ext);
bool FileNameCompatible(etk::FSNode &fileName);
void Display(void);
void ReloadColor(void);
void Parse(int32_t start,
int32_t stop,
etk::Vector<colorInformation_ts> &metaData,
int32_t addingPos,
EdnVectorBuf &buffer);
void Parse2(int32_t start,
int32_t stop,
etk::Vector<colorInformation_ts> &metaData,
EdnVectorBuf &buffer);
private:
void ParseRules(TiXmlNode *child, etk::Vector<HighlightPattern*> &mListPatern, int32_t level);
etk::UString m_styleName; //!< curent style name (like "c++" or "c" or "script Bash")
etk::Vector<etk::UString*> m_listExtentions; //!< List of possible extention for this high-light, like : ".c", ".cpp", ".h"
etk::Vector<HighlightPattern*> m_listHighlightPass1; //!< List of ALL hightlight modules (pass 1 ==> when we load and wride data on the buffer)
etk::Vector<HighlightPattern*> m_listHighlightPass2; //!< List of ALL hightlight modules (pass 2 ==> When we display the buffer( only the display area (100 lines)) )
};
#endif

View File

@ -1,221 +0,0 @@
/**
*******************************************************************************
* @file HighlightManager.cpp
* @brief Editeur De N'ours : Hightlining Manager
* @author Edouard DUPIN
* @date 16/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <appl/Debug.h>
#include <appl/global.h>
#include <HighlightManager.h>
#include <ewol/eObject/EObject.h>
#include <ewol/eObject/EObjectManager.h>
#undef __class__
#define __class__ "HighlightManager"
class localClassHighlightManager: public ewol::EObject
{
private:
etk::Vector<Highlight*> listHighlight; //!< List of ALL hightlight modules
public:
// Constructeur
localClassHighlightManager(void) {
//ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferColor);
};
~localClassHighlightManager(void) {
int32_t i;
// clean all Element
for (i=0; i< listHighlight.Size(); i++) {
if (NULL != listHighlight[i]) {
delete(listHighlight[i]);
listHighlight[i] = NULL;
}
}
// clear the compleate list
listHighlight.Clear();
};
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void)
{
return "ApplHighlightManager";
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
{
/*
switch (id)
{
case APPL_MSG__COLOR_HAS_CHANGE:
APPL_INFO("UPDATE the color pointer on the HL");
for (int32_t i=0; i<listHighlight.Size(); i++) {
if (NULL != listHighlight[i]) {
listHighlight[i]->ReloadColor();
}
}
break;
}
*/
}
Highlight* Get(etk::FSNode &fileName)
{
int32_t i;
for (i=0; i<listHighlight.Size(); i++) {
if (true == listHighlight[i]->FileNameCompatible(fileName) ) {
return listHighlight[i];
}
}
return NULL;
}
bool Exist(etk::FSNode &fileName)
{
if (NULL != Get(fileName) ) {
return true;
}
return false;
}
void loadLanguages(void)
{
etk::UString xmlFilename = "lang_c.xml";
Highlight *myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = "lang_boo.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = "lang_Makefile.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = "lang_asm.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = "lang_xml.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = "lang_php.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = "lang_bash.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = "lang_matlab.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = "lang_java.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = "lang_lua.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = "lang_in.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = "lang_glsl.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
//myHightline->Display();
}
};
#define EDN_CAST_HIGHLIGHT_MANAGER(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_HIGHLIGHT_MANAGER,localClassHighlightManager,curentPointer)
static localClassHighlightManager * localManager = NULL;
void HighlightManager::Init(void)
{
if (NULL != localManager) {
APPL_ERROR("HighlightManager ==> already exist, just unlink the previous ...");
localManager = NULL;
}
localManager = new localClassHighlightManager();
if (NULL == localManager) {
APPL_CRITICAL("Allocation of HighlightManager not done ...");
}
}
void HighlightManager::UnInit(void)
{
if (NULL == localManager) {
APPL_ERROR("HighlightManager ==> request UnInit, but does not exist ...");
return;
}
delete(localManager);
localManager = NULL;
}
void HighlightManager::loadLanguages(void)
{
if (NULL == localManager) {
return;
}
localManager->loadLanguages();
}
Highlight* HighlightManager::Get(etk::FSNode &fileName)
{
if (NULL == localManager) {
return NULL;
}
return localManager->Get(fileName);
}
bool HighlightManager::Exist(etk::FSNode &fileName)
{
if (NULL == localManager) {
return false;
}
return localManager->Exist(fileName);
}

View File

@ -1,45 +0,0 @@
/**
*******************************************************************************
* @file HighlightManager.h
* @brief Editeur De N'ours : Hightlining Manager (header)
* @author Edouard DUPIN
* @date 14/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __HIGHLIGHT_MANAGER_H__
#define __HIGHLIGHT_MANAGER_H__
#include <etk/UString.h>
#include <appl/globalMsg.h>
#include <Highlight.h>
#include <ewol/widget/Widget.h>
namespace HighlightManager{
void Init(void);
void UnInit(void);
void loadLanguages(void);
Highlight* Get(etk::FSNode &fileName);
bool Exist(etk::FSNode &fileName);
};
#endif

View File

@ -1,249 +0,0 @@
/**
*******************************************************************************
* @file HighlightPattern.cpp
* @brief Editeur De N'ours : Hightlight Patern (header)
* @author Edouard DUPIN
* @date 14/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <appl/Debug.h>
#include <appl/global.h>
#include <HighlightPattern.h>
#include <ColorizeManager.h>
#undef __class__
#define __class__ "HighlightPattern"
HighlightPattern::HighlightPattern(void)
{
m_haveStopPatern = false;
m_multiline = false;
m_color = ColorizeManager::Get("normal");
m_regExpStart = new etk::RegExp<EdnVectorBuf>();
m_regExpStop = new etk::RegExp<EdnVectorBuf>();
m_escapeChar = 0;
}
HighlightPattern::~HighlightPattern(void)
{
delete(m_regExpStart);
delete(m_regExpStop);
}
void HighlightPattern::SetPaternStart(etk::UString &regExp)
{
m_regExpStart->SetRegExp(regExp);
}
void HighlightPattern::SetPaternStop(etk::UString &regExp)
{
if (regExp.Size() != 0) {
m_regExpStop->SetRegExp(regExp);
m_haveStopPatern = true;
} else {
m_haveStopPatern = false;
}
}
void HighlightPattern::SetEscapeChar(etk::UString &EscapeChar)
{
if (EscapeChar.Size()>0) {
m_escapeChar = EscapeChar[0];
} else {
m_escapeChar = 0;
}
}
void HighlightPattern::SetColor(etk::UString &colorName)
{
m_colorName = colorName;
m_color = ColorizeManager::Get(m_colorName);
}
bool HighlightPattern::IsEnable(void)
{
return true;
}
void HighlightPattern::ReloadColor(void)
{
m_color = ColorizeManager::Get(m_colorName);
}
/**
* @brief
*
* @param[in,out]
*
* @eturn
*
*/
void HighlightPattern::Display(void)
{
/*
APPL_INFO("patern : \"" << m_paternName << "\" level=" << m_level );
APPL_INFO(" ==> colorName \"" << m_colorName << "\"");
APPL_INFO(" ==> regExpStart \"" << m_regExpStart->GetRegExp() << "\"");
APPL_INFO(" ==> regExpStop \"" << m_regExpStop->GetRegExp() << "\"");
if (true == m_haveStopPatern) {
APPL_INFO(" ==> stop pattern: YES");
} else {
APPL_INFO(" ==> stop pattern: NO");
}
if (true == m_multiline) {
APPL_INFO(" ==> multiline pattern: YES");
} else {
APPL_INFO(" ==> multiline pattern: NO");
}
*/
// Display all elements
for (int32_t i=0; i< m_subPatern.Size(); i++) {
APPL_INFO(" " << i << " SubPattern : " << m_subPatern[i]->GetName() );
m_subPatern[i]->Display();
}
}
void HighlightPattern::ParseRules(TiXmlNode *child, int32_t level)
{
//--------------------------------------------------------------------------------------------
/*
<rule name="my preprocesseur">
<color>preprocesseur</color>
<start>#</start>
<end>$</end>
<multiline>yes</multiline>
</rule>
*/
//--------------------------------------------------------------------------------------------
// process attribute
const char *highLightName = child->ToElement()->Attribute("name");
etk::UString myEdnDataTmp = "???";
if (NULL != highLightName) {
myEdnDataTmp = highLightName;
}
SetName(myEdnDataTmp);
SetLevel(level);
TiXmlElement *xChild = child->FirstChildElement("color");
if (NULL != xChild) {
const char *myData = xChild->GetText();
if (myData) {
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
etk::UString myEdnData = myData;
SetColor(myEdnData);
}
}
xChild = child->FirstChildElement("start");
if (NULL != xChild) {
const char *myData = xChild->GetText();
if (myData) {
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
etk::UString myEdnData = myData;
SetPaternStart(myEdnData);
}
}
xChild = child->FirstChildElement("end");
if (NULL != xChild) {
const char *myData = xChild->GetText();
if (myData) {
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
etk::UString myEdnData = myData;
SetPaternStop(myEdnData);
}
}
xChild = child->FirstChildElement("EscapeChar");
if (NULL != xChild) {
const char *myData = xChild->GetText();
if (myData) {
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
etk::UString myEdnData = myData;
SetEscapeChar(myEdnData);
}
}
xChild = child->FirstChildElement("rule");
if (NULL != xChild) {
/*
// Create the patern ...
HighlightPattern *myPattern = new HighlightPattern();
// parse under Element
myPattern->ParseRules(ruleChild, level+1);
// add element in the list
m_subPatern.PushBack(myPattern);
//ParseRules(passChild, m_listHighlightPass1, level1++);
*/
}
}
/**
* @brief Find Element only in the specify start characters and find the end with the range done
*
* @param[in] start First character to search data (if recognise it start here)
* @param[in] stop End of the possibility whe search can continue
* @param[out] resultat Position where find data
* @param[in] buffer : Where to search data
*
* @return HLP_FIND_OK We find a compleate pattern
* @return HLP_FIND_OK_NO_END Xe find a partial pattern (missing end)
* @return HLP_FIND_ERROR Not find the pattern
*/
resultFind_te HighlightPattern::Find(int32_t start, int32_t stop, colorInformation_ts &resultat, EdnVectorBuf &buffer)
{
//APPL_DEBUG(" try to find the element");
resultat.beginStart = -1;
resultat.beginStop = -1;
resultat.endStart = -1;
resultat.endStop = -1;
resultat.notEnded = false;
resultat.patern = this;
// when we have only one element :
if (false == m_haveStopPatern) {
if (true == m_regExpStart->ProcessOneElement(buffer, start, stop)) {
resultat.beginStart = m_regExpStart->Start();
resultat.beginStop = m_regExpStart->Stop();
resultat.endStart = m_regExpStart->Start();
resultat.endStop = m_regExpStart->Stop();
return HLP_FIND_OK;
}
//APPL_DEBUG("NOT find hightlightpatern ...");
} else {
// try while we find the first element
if (true == m_regExpStart->ProcessOneElement(buffer, start, stop, m_escapeChar)) {
resultat.beginStart = m_regExpStart->Start();
resultat.beginStop = m_regExpStart->Stop();
if (true == m_regExpStop->Process(buffer, resultat.beginStop, stop, m_escapeChar)) {
resultat.endStart = m_regExpStop->Start();
resultat.endStop = m_regExpStop->Stop();
return HLP_FIND_OK;
} else {
resultat.endStart = stop+1;
resultat.endStop = stop+1;
resultat.notEnded = true;
return HLP_FIND_OK_NO_END;
}
}
//APPL_DEBUG("NOT find start hightlightpatern ...");
}
return HLP_FIND_ERROR;
}

View File

@ -1,90 +0,0 @@
/**
*******************************************************************************
* @file HighlightPattern.h
* @brief Editeur De N'ours : Hightlight Patern (header)
* @author Edouard DUPIN
* @date 14/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <Highlight.h>
#ifndef __HIGHLIGHT_PATTERN_H__
#define __HIGHLIGHT_PATTERN_H__
class HighlightPattern;
#include <etk/RegExp.h>
#include <Colorize.h>
#include <etk/Vector.h>
#include <tinyXML/tinyxml.h>
#include <EdnVectorBuf.h>
typedef enum {
HLP_FIND_ERROR,
HLP_FIND_OK,
HLP_FIND_OK_NO_END,
}resultFind_te;
class HighlightPattern;
class HighlightPattern {
public:
// Constructeur
HighlightPattern(void);
~HighlightPattern(void);
void SetName(etk::UString &name) { m_paternName = name;};
etk::UString GetName(void) { return m_paternName;};
void SetPaternStart(etk::UString &regExp);
void SetPaternStop(etk::UString &regExp);
void SetColor(etk::UString &colorName);
void SetEscapeChar(etk::UString &EscapeChar);
void SetMultiline(bool enable) { m_multiline = enable; };
void SetLevel(int32_t newLevel) { m_level = newLevel; };
int32_t GetLevel(void) { return m_level; };
bool IsEnable(void);
void Display(void);
resultFind_te Find(int32_t start, int32_t stop, colorInformation_ts &resultat, EdnVectorBuf &buffer);
Colorize * GetColor(void) { return m_color; };
void ParseRules(TiXmlNode *child, int32_t level);
void ReloadColor(void);
private:
int32_t m_level; //!< Level of the pattern ==> this is to overwrite next pattern when we create an higher ....
etk::UString m_paternName; //!< Current style name (like "c++" or "c" or "script Bash")
etk::UString m_colorName; //!< Current color name
Colorize * m_color; //!< Link to the color manager
etk::RegExp<EdnVectorBuf> * m_regExpStart; //!< Start of Regular expression
etk::RegExp<EdnVectorBuf> * m_regExpStop; //!< Stop of Regular Expression
bool m_haveStopPatern; //!< Stop patern presence
bool m_multiline; //!< The patern is multiline
uniChar_t m_escapeChar; //!< Escape char to prevent exeit of patern ....
etk::Vector<HighlightPattern *> m_subPatern; //!< Under patern of this one
// etk::Vector<HighlightPattern *> m_subColor; //!< Under Color in the start RegExp ...
};
#endif

View File

@ -1,313 +0,0 @@
/**
*******************************************************************************
* @file CTagsManager.cpp
* @brief Editeur De N'ours : Ctags manager : acces to the ctags file (Sources)
* @author Edouard DUPIN
* @date 15/07/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <appl/Debug.h>
#include <appl/global.h>
#include <CTagsManager.h>
#include <BufferManager.h>
#include <ewol/eObject/EObject.h>
#include <ewol/widget/meta/FileChooser.h>
#include <appl/Gui/TagFileSelection.h>
// TODO : The line ID is no more stored in the file system (FSNode) ...
#undef __class__
#define __class__ "CTagsManager"
class CTagsManager: public ewol::EObject
{
public:
// Constructeur
CTagsManager(void);
~CTagsManager(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void)
{
return "CTagsManager";
};
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
int32_t m_currentSelectedID;
void LoadTagFile(void);
int32_t MultipleJump(void);
void JumpTo(void);
void PrintTag(const tagEntry *entry);
etk::UString GetFolder(etk::UString &inputString);
etk::UString m_tagFolderBase;
etk::UString m_tagFilename;
tagFile * m_ctagFile;
// history system
int32_t m_historyPos;
etk::Vector<etk::FSNode*> m_historyList;
void RegisterHistory(void);
};
static CTagsManager* s_elementPointer = NULL;
void cTagsManager::Init(void)
{
if (NULL != s_elementPointer) {
s_elementPointer = NULL;
EWOL_WARNING("Ctags manager already instanciate ... ==> restart IT (can have memory leek ...)");
}
s_elementPointer = new CTagsManager();
if (NULL == s_elementPointer) {
EWOL_ERROR("Ctags manager error to instanciate ...");
}
}
void cTagsManager::UnInit(void)
{
if (NULL != s_elementPointer) {
delete(s_elementPointer);
s_elementPointer = NULL;
} else {
EWOL_ERROR("Ctags manager not instanciate ... ==> can not remove it ...");
}
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
CTagsManager::CTagsManager(void)
{
m_tagFilename = "";
m_tagFolderBase = "";
m_ctagFile = NULL;
m_historyPos = 0;
RegisterMultiCast(ednMsgGuiCtags);
RegisterMultiCast(ednMsgBufferId);
RegisterMultiCast(ednMsgCtagsLoadFile);
EWOL_INFO("Ctags manager (INIT)");
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
CTagsManager::~CTagsManager(void)
{
EWOL_INFO("Ctags manager (Un-INIT)");
if(0 != m_historyList.Size()) {
for (int32_t iii=0; iii< m_historyList.Size(); iii++) {
delete(m_historyList[iii]);
}
m_historyList.Clear();
}
}
const char * ednEventPopUpCtagsLoadFile = "edn-event-load-ctags";
void CTagsManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
{
//EWOL_INFO("ctags manager event ... : \"" << eventId << "\" ==> data=\"" << data << "\"" );
if (eventId == ednMsgBufferId) {
//m_currentSelectedID = dataID;
} else if( eventId == ednEventPopUpCtagsLoadFile
|| eventId == ednMsgCtagsLoadFile) {
// open the new one :
etk::FSNode tmpFilename = data;
m_tagFilename = tmpFilename.GetNameFile();
m_tagFolderBase = tmpFilename.GetNameFolder();
APPL_DEBUG("Receive load Ctags file : " << m_tagFolderBase << "/" << m_tagFilename << " ");
LoadTagFile();
} else if (eventId == ednMsgGuiCtags) {
if (data == "Load") {
APPL_INFO("Request opening ctag file");
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
if (NULL == tmpWidget) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
tmpWidget->SetTitle("Open Exuberant Ctags File");
tmpWidget->SetValidateLabel("Open");
PopUpWidgetPush(tmpWidget);
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpCtagsLoadFile);
}
} else if (data == "ReLoad") {
APPL_INFO("Request re-load ctag file");
LoadTagFile();
} else if (data == "Jump") {
JumpTo();
} else if (data == "Back") {
if (m_historyList.Size() > 0) {
int32_t id = m_historyList.Size()-1;
SendMultiCast(ednMsgOpenFile, m_historyList[id]->GetName() );
SendMultiCast(ednMsgGuiGotoLine, 0);// TODO : m_historyList[id]->GetLineNumber());
// Remove element ....
delete(m_historyList[id]);
m_historyList[id]=NULL;
m_historyList.PopBack();
}
} else {
}
} else if (eventId == applEventctagsSelection) {
// save the current file in the history
RegisterHistory();
// parse the input data
char tmp[4096];
int32_t lineID;
sscanf(data.c_str(), "%d:%s", &lineID, tmp);
// generate envents
SendMultiCast(ednMsgOpenFile, tmp);
SendMultiCast(ednMsgGuiGotoLine, lineID - 1);
}
}
void CTagsManager::LoadTagFile(void)
{
tagFileInfo info;
// close previous tag file
if (NULL != m_ctagFile) {
tagsClose(m_ctagFile);
m_ctagFile = NULL;
}
if (m_tagFilename == "") {
return;
}
// load (open) the tag file :
APPL_INFO("try to open tag file : " << m_tagFilename);
m_ctagFile = tagsOpen(m_tagFilename.c_str(), &info);
if (NULL != m_ctagFile) {
APPL_INFO("open exuberant Ctags file is OK ...");
} else {
APPL_INFO("Error to open ctags file ...");
}
}
void CTagsManager::RegisterHistory(void)
{
APPL_INFO("save curent filename and position : ");
int32_t currentSelected = BufferManager::GetSelected();
Buffer* tmpBuf = BufferManager::Get(currentSelected);
if (NULL != tmpBuf) {
etk::FSNode * bufferFilename = new etk::FSNode();
*bufferFilename = tmpBuf->GetFileName();
// TODO : bufferFilename->SetLineNumber(tmpBuf->GetCurrentLine());
m_historyList.PushBack(bufferFilename);
}
}
void CTagsManager::JumpTo(void)
{
if (NULL != m_ctagFile) {
// get the middle button of the clipboard ==> represent the current selection ...
etk::UString data = ewol::clipBoard::Get(ewol::clipBoard::CLIPBOARD_SELECTION);
APPL_DEBUG("clipboard data : \"" << data << "\"");
if (data.Size() == 0) {
APPL_INFO("No current selection");
}
tagEntry entry;
APPL_INFO("try to find the tag : " << data);
if (tagsFind (m_ctagFile, &entry, data.c_str(), 0) == TagSuccess) {
tagEntry entrySave = entry;
int32_t numberOfTags = 0;
// For all tags : Save in an internal Structure :
etk::UString tmpFile(m_tagFolderBase + "/" + entry.file);
etk::FSNode myfile(tmpFile);
int32_t lineID = entry.address.lineNumber;
PrintTag(&entry);
if (tagsFindNext (m_ctagFile, &entry) == TagSuccess) {
APPL_INFO("Multiple file destination ...");
appl::TagFileSelection* tmpWidget = new appl::TagFileSelection();
if (NULL == tmpWidget) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
tmpWidget->AddCtagsNewItem(myfile.GetName(), lineID);
do {
tmpFile = m_tagFolderBase + "/" + entry.file;
myfile = tmpFile;
lineID = entry.address.lineNumber;
PrintTag(&entry);
tmpWidget->AddCtagsNewItem(myfile.GetName(), lineID);
} while (tagsFindNext (m_ctagFile, &entry) == TagSuccess);
PopUpWidgetPush(tmpWidget);
tmpWidget->RegisterOnEvent(this, applEventctagsSelection);
}
} else {
RegisterHistory();
APPL_INFO(" OPEN the TAG file Destination : " << tmpFile );
SendMultiCast(ednMsgOpenFile, myfile.GetName());
SendMultiCast(ednMsgGuiGotoLine, lineID - 1);
}
} else {
APPL_INFO("no tag find ...");
}
}
}
void CTagsManager::PrintTag(const tagEntry *entry)
{
#if 1
APPL_INFO("find Tag file : name=\"" << entry->name << "\" in file=\"" << entry->file
<< "\" at line="<< (int32_t)entry->address.lineNumber);
#else
int i;
APPL_INFO("find Tag file : name=\"" << entry->name << "\" in file=\"" << entry->file
<< "\" pattern=\"" << entry->address.pattern
<< "\" at line="<< (int32_t)entry->address.lineNumber);
APPL_INFO("Extention field : ");
if (entry->kind != NULL && entry->kind [0] != '\0') {
APPL_INFO(" kind : " << entry->kind);
}
if (entry->fileScope) {
APPL_INFO(" file : ");
}
for (i = 0 ; i < entry->fields.count ; ++i) {
APPL_INFO(" " << entry->fields.list[i].key << ":" << entry->fields.list[i].value );
}
#endif
}

View File

@ -1,43 +0,0 @@
/**
*******************************************************************************
* @file CTagsManager.h
* @brief Editeur De N'ours : Ctags manager : acces to the ctags file (header)
* @author Edouard DUPIN
* @date 15/07/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __C_TAGS_MANAGER_H__
#define __C_TAGS_MANAGER_H__
#include <ewol/widget/Widget.h>
#include "appl/globalMsg.h"
#include "readtags.h"
#define MAX_REG_EXP_SEARCH (1024)
namespace cTagsManager
{
void Init(void);
void UnInit(void);
};
#endif

View File

@ -1,245 +0,0 @@
/**
*******************************************************************************
* @file tools_Globals.cpp
* @brief Editeur De N'ours : Globals Values
* @author Edouard DUPIN
* @date 05/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <appl/global.h>
#include <ColorizeManager.h>
#include <appl/globalMsg.h>
#include <ewol/eObject/EObject.h>
#include <ewol/ResourceManager.h>
#include <etk/os/FSNode.h>
#undef __class__
#define __class__ "globals"
erreurCode_te globals::init(void)
{
erreurCode_te ret = ERR_NONE;
return ret;
}
// -----------------------------------------------------------
static bool displayEOL = false;
bool globals::IsSetDisplayEndOfLine(void)
{
return displayEOL;
}
void globals::SetDisplayEndOfLine(bool newVal)
{
APPL_INFO("Set EndOfLine " << newVal);
displayEOL = newVal;
//ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
}
// -----------------------------------------------------------
static bool displaySpaceChar = true;
bool globals::IsSetDisplaySpaceChar(void)
{
return displaySpaceChar;
}
void globals::SetDisplaySpaceChar(bool newVal)
{
APPL_INFO("Set SpaceChar " << newVal);
displaySpaceChar = newVal;
//ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
}
// -----------------------------------------------------------
static bool displayTabChar = true;
bool globals::IsSetDisplayTabChar(void)
{
return displayTabChar;
}
void globals::SetDisplayTabChar(bool newVal)
{
APPL_INFO("Set SpaceChar " << newVal);
displayTabChar = newVal;
//ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
}
// -----------------------------------------------------------
static bool AutoIndent = true;
bool globals::IsSetAutoIndent(void)
{
return AutoIndent;
}
void globals::SetAutoIndent(bool newVal)
{
APPL_INFO("Set AutoIndent " << newVal);
AutoIndent = newVal;
}
// -----------------------------------------------------------
bool globals::OrderTheBufferList(void)
{
return true;
}
// -----------------------------------------------------------
int32_t globals::getNbColoneBorder(void)
{
return 6;
}
int32_t globals::getNbLineBorder(void)
{
return 3;
}
#include <ewol/widget/CheckBox.h>
#include <ewol/widget/Spacer.h>
static const char * const l_changeIndentation = "edn-event-change-indentation";
static const char * const l_changeSpace = "edn-event-change-spaces";
static const char * const l_changeTabulation = "edn-event-change-tabulation";
static const char * const l_changeEndOfLine = "edn-event-change-endOfLine";
static const char * const l_changeRounded = "edn-event-change-rounded";
globals::ParameterGlobalsGui::ParameterGlobalsGui(void)
{
ewol::CheckBox* myCheckbox = NULL;
ewol::Spacer* mySpacer = NULL;
mySpacer = new ewol::Spacer();
if (NULL == mySpacer) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
mySpacer->SetExpendX(true);
mySpacer->SetExpendY(true);
SubWidgetAdd(mySpacer);
}
myCheckbox = new ewol::CheckBox("Automatic Indentation");
if (NULL == myCheckbox) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
myCheckbox->SetExpendX(true);
myCheckbox->SetValue(IsSetAutoIndent());
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeIndentation);
SubWidgetAdd(myCheckbox);
}
myCheckbox = new ewol::CheckBox("Display space char (' ')");
if (NULL == myCheckbox) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
myCheckbox->SetExpendX(true);
myCheckbox->SetValue(IsSetDisplaySpaceChar());
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeSpace);
SubWidgetAdd(myCheckbox);
}
myCheckbox = new ewol::CheckBox("Display tabulation char ('\\t')");
if (NULL == myCheckbox) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
myCheckbox->SetExpendX(true);
myCheckbox->SetValue(IsSetDisplayTabChar());
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeTabulation);
SubWidgetAdd(myCheckbox);
}
myCheckbox = new ewol::CheckBox("Display end of line ('\\n')");
if (NULL == myCheckbox) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
myCheckbox->SetExpendX(true);
myCheckbox->SetValue(IsSetDisplayEndOfLine());
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeEndOfLine);
SubWidgetAdd(myCheckbox);
}
myCheckbox = new ewol::CheckBox("switch Rounded/default");
if (NULL == myCheckbox) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
myCheckbox->SetExpendX(true);
myCheckbox->SetValue(IsSetDisplayEndOfLine());
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeRounded);
SubWidgetAdd(myCheckbox);
}
}
globals::ParameterGlobalsGui::~ParameterGlobalsGui(void)
{
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void globals::ParameterGlobalsGui::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
{
ewol::SizerVert::OnReceiveMessage(CallerObject, eventId, data);
if (eventId == l_changeEndOfLine) {
if (data == "true") {
SetDisplayEndOfLine(true);
} else {
SetDisplayEndOfLine(false);
}
} else if (eventId == l_changeIndentation) {
if (data == "true") {
SetAutoIndent(true);
} else {
SetAutoIndent(false);
}
} else if (eventId == l_changeSpace) {
if (data == "true") {
SetDisplaySpaceChar(true);
} else {
SetDisplaySpaceChar(false);
}
} else if (eventId == l_changeTabulation) {
if (data == "true") {
SetDisplayTabChar(true);
} else {
SetDisplayTabChar(false);
}
} else if (eventId == l_changeRounded) {
if (data == "true") {
etk::theme::SetName("GUI", "rounded");;
} else {
etk::theme::SetName("GUI", "default");;
}
// Reload shaders and graphic system ...
ewol::resource::ReLoadResources();
}
}

View File

@ -1,75 +0,0 @@
/**
*******************************************************************************
* @file appl/global.h
* @brief Editeur De N'ours : Globals Values (header)
* @author Edouard DUPIN
* @date 05/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __TOOLS_GLOBALS_H__
#define __TOOLS_GLOBALS_H__
#include <appl/Debug.h>
#include <etk/Types.h>
#include <ewol/widget/SizerVert.h>
namespace globals
{
erreurCode_te init(void);
int32_t getNbColoneBorder(void);
int32_t getNbLineBorder(void);
bool IsSetDisplayEndOfLine(void);
void SetDisplayEndOfLine(bool newVal);
bool IsSetDisplaySpaceChar(void);
void SetDisplaySpaceChar(bool newVal);
bool IsSetDisplayTabChar(void);
void SetDisplayTabChar(bool newVal);
bool IsSetAutoIndent(void);
void SetAutoIndent(bool newVal);
void init2(void);
bool OrderTheBufferList(void);
class ParameterGlobalsGui : public ewol::SizerVert
{
public :
ParameterGlobalsGui(void);
~ParameterGlobalsGui(void);
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
};
}
#endif

View File

@ -1,76 +0,0 @@
/**
*******************************************************************************
* @file MsgBroadcast.cpp
* @brief Editeur De N'ours : message beetween thread and GUI elements ... (Souces)
* @author Edouard DUPIN
* @date 04/02/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <appl/globalMsg.h>
////////////////////////////////////////////////////////////////////////
// Event of the gui request something :
////////////////////////////////////////////////////////////////////////
extern const char* const ednMsgGuiNew = "edn-Msg-Gui-New";
extern const char* const ednMsgGuiOpen = "edn-Msg-Gui-Open";
extern const char* const ednMsgGuiClose = "edn-Msg-Gui-Close";
extern const char* const ednMsgGuiSave = "edn-Msg-Gui-Save";
extern const char* const ednMsgGuiSaveAs = "edn-Msg-Gui-SaveAs";
extern const char* const ednMsgProperties = "edn-Msg-Gui-Properties";
extern const char* const ednMsgGuiUndo = "edn-Msg-Gui-Undo";
extern const char* const ednMsgGuiRedo = "edn-Msg-Gui-Redo";
extern const char* const ednMsgGuiCopy = "edn-Msg-Gui-Copy";
extern const char* const ednMsgGuiCut = "edn-Msg-Gui-Cut";
extern const char* const ednMsgGuiPaste = "edn-Msg-Gui-Paste";
extern const char* const ednMsgGuiRm = "edn-Msg-Gui-Rm";
extern const char* const ednMsgGuiSelect = "edn-Msg-Gui-Select";
extern const char* const ednMsgGuiGotoLine = "edn-Msg-Gui-GotoLine";
extern const char* const ednMsgGuiSearch = "edn-Msg-Gui-Search";
extern const char* const ednMsgGuiReplace = "edn-Msg-Gui-Replace";
extern const char* const ednMsgGuiFind = "edn-Msg-Gui-Find";
extern const char* const ednMsgGuiChangeColor = "edn-Msg-Gui-ChangeColor";
extern const char* const ednMsgGuiChangeCharset = "edn-Msg-Gui-ChangeCharset";
extern const char* const ednMsgGuiShowSpaces = "edn-Msg-Gui-ShowSpaces";
extern const char* const ednMsgGuiShowEndOfLine = "edn-Msg-Gui-ShowEndOfLine";
extern const char* const ednMsgGuiCtags = "edn-Msg-Gui-CTags";
extern const char* const ednMsgCtagsLoadFile = "edn-Msg-CTags-direct-load";
extern const char* const ednMsgGuiReloadShader = "edn-Msg-Gui-ReloadOpenGlShader";
////////////////////////////////////////////////////////////////////////
// Event internal :
////////////////////////////////////////////////////////////////////////
extern const char* const ednMsgBufferState = "edn-Msg-Buffer-State";
extern const char* const ednMsgBufferName = "edn-Msg-Buffer-Name";
extern const char* const ednMsgBufferId = "edn-Msg-Buffer-Id";
extern const char* const ednMsgCodeViewSelectedId = "edn-Msg-CodeView-Select-Id";
extern const char* const ednMsgOpenFile = "edn-Msg-OpenFile";
extern const char* const ednMsgBufferListChange = "edn-Msg-BufferListChange";
extern const char* const ednMsgBufferColor = "edn-Msg-Buffer-Color";

View File

@ -1,78 +0,0 @@
/**
*******************************************************************************
* @file appl/globalMsg.h
* @brief Editeur De N'ours : message beetween thread and GUI elements ... (header)
* @author Edouard DUPIN
* @date 04/02/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __MSG_BROADCAST_H__
#define __MSG_BROADCAST_H__
////////////////////////////////////////////////////////////////////////
// Event of the gui request something :
////////////////////////////////////////////////////////////////////////
extern const char* const ednMsgGuiNew; // data : ""
extern const char* const ednMsgGuiOpen; // data : ""
extern const char* const ednMsgGuiClose; // data : "current" "All"
extern const char* const ednMsgGuiSave; // data : ""
extern const char* const ednMsgGuiSaveAs; // data : ""
extern const char* const ednMsgProperties; // data : ""
extern const char* const ednMsgGuiUndo; // data : ""
extern const char* const ednMsgGuiRedo; // data : ""
extern const char* const ednMsgGuiCopy; // data : "STD" "Middle" "1" ... "9"
extern const char* const ednMsgGuiCut; // data : "STD" "Middle" "1" ... "9"
extern const char* const ednMsgGuiPaste; // data : "STD" "Middle" "1" ... "9"
extern const char* const ednMsgGuiRm; // data : "Word" "Line" "Paragraph"
extern const char* const ednMsgGuiSelect; // data : "ALL" "NONE"
extern const char* const ednMsgGuiGotoLine; // data : "???" / "1" ... "999999999999"
extern const char* const ednMsgGuiSearch; // data : ""
extern const char* const ednMsgGuiReplace; // data : "Normal" "All"
extern const char* const ednMsgGuiFind; // data : "Next" "Previous" "All" "None"
extern const char* const ednMsgGuiChangeColor; // data : "Black" "White"
extern const char* const ednMsgGuiChangeCharset; // data : "UTF-8" "ISO-8859-1" "ISO-8859-15"
extern const char* const ednMsgGuiShowSpaces; // data : "enable" "disable"
extern const char* const ednMsgGuiShowEndOfLine; // data : "enable" "disable"
extern const char* const ednMsgGuiCtags; // data : "Load" "ReLoad" "Jump" "Back"
extern const char* const ednMsgCtagsLoadFile; // data : "filename of the ctags file"
extern const char* const ednMsgGuiReloadShader; // data : ""
////////////////////////////////////////////////////////////////////////
// Event internal :
////////////////////////////////////////////////////////////////////////
extern const char* const ednMsgBufferState; // data : "Saved" "Modify" "HasHistory" "HasNotHistory" "HasFutureHistory" "HasNotFutureHistory"
extern const char* const ednMsgBufferName; // data : "filename"
extern const char* const ednMsgBufferId; // data : "0" ... "99999999999"
extern const char* const ednMsgCodeViewSelectedId; // data : "0" ... "99999999999"
extern const char* const ednMsgOpenFile; // data : "/Compleate/file/name.xx"
extern const char* const ednMsgBufferListChange; // data : ""
extern const char* const ednMsgBufferColor; // data : "new"
#endif

View File

@ -1,192 +0,0 @@
/**
*******************************************************************************
* @file init.cpp
* @brief Editeur De N'ours : main fonction
* @author Edouard DUPIN
* @date 26/01/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <etk/Types.h>
#include <etk/UString.h>
#include <ewol/ewol.h>
#include <ewol/eObject/EObject.h>
#include <ewol/widget/WidgetManager.h>
#include <appl/Debug.h>
#include <appl/global.h>
#include <etk/os/FSNode.h>
#include <etk/tool.h>
#include <Gui/MainWindows.h>
#include <BufferManager.h>
#include <ColorizeManager.h>
#include <HighlightManager.h>
#include <Gui/Search.h>
#include <unistd.h>
#include <readtags.h>
#include <CTagsManager.h>
#include <globalMsg.h>
#include <ewol/font/FontManager.h>
MainWindows * basicWindows = NULL;
/**
* @brief main application function Initialisation
*/
void APP_Init(void)
{
#ifdef __TARGET_OS__Linux
#ifdef MODE_RELEASE
APPL_INFO("==> Init "PROJECT_NAME" (START) (Linux) (Release)");
#else
APPL_INFO("==> Init "PROJECT_NAME" (START) (Linux) (Debug)");
#endif
#else
#ifdef MODE_RELEASE
APPL_INFO("==> Init "PROJECT_NAME" (START) (Android) (Release)");
#else
APPL_INFO("==> Init "PROJECT_NAME" (START) (Android) (Debug)");
#endif
#endif
ewol::ChangeSize(etk::Vector2D<int32_t>(800, 600));
etk::InitDefaultFolder(PROJECT_NAME);
ewol::font::SetDefaultFont("Font/freefont/FreeSerif.ttf");
//ewol::font::SetDefaultFont("Font/ACharmingFont.ttf");
#ifdef __TARGET_OS__Android
ewol::font::SetDefaultSize(19);
#else
ewol::font::SetDefaultSize(14);
#endif
// init internal global value
globals::init();
// init ALL Singleton :
//(void)CTagsManager::getInstance();
BufferManager::Init();
// set color and other trucs...
ColorizeManager::Init();
etk::UString corlorFile = "color_white.xml";
ColorizeManager::LoadFile( corlorFile.c_str() );
ColorizeManager::DisplayListOfColor();
HighlightManager::Init();
HighlightManager::loadLanguages();
cTagsManager::Init();
char cCurrentPath[FILENAME_MAX];
// get the curent program folder
if (!getcwd(cCurrentPath, FILENAME_MAX)) {
return ;
}
cCurrentPath[FILENAME_MAX - 1] = '\0';
//APPL_INFO("The current working directory is " << cCurrentPath);
basicWindows = new MainWindows();
if (NULL == basicWindows) {
APPL_ERROR("Can not allocate the basic windows");
ewol::Stop();
return;
}
// create the specific windows
ewol::DisplayWindows(basicWindows);
// add generic shortcut ...
// (shift, control, alt, meta, uniChar_t unicodeValue, const char * generateEventId, etk::UString& data)
ewol::shortCut::Add("ctrl+o", ednMsgGuiOpen, "");
ewol::shortCut::Add("ctrl+n", ednMsgGuiNew, "");
ewol::shortCut::Add("ctrl+s", ednMsgGuiSave, "current");
ewol::shortCut::Add("ctrl+shift+s", ednMsgGuiSave, "All");
ewol::shortCut::Add("ctrl+q", ednMsgGuiClose, "current");
ewol::shortCut::Add("ctrl+shift+q", ednMsgGuiClose, "All");
ewol::shortCut::Add("ctrl+z", ednMsgGuiUndo, "");
ewol::shortCut::Add("ctrl+shift+z", ednMsgGuiRedo, "");
ewol::shortCut::Add("ctrl+l", ednMsgGuiGotoLine, "???");
ewol::shortCut::Add("ctrl+f", ednMsgGuiSearch, "");
ewol::shortCut::Add("F12", ednMsgGuiReloadShader, "");
ewol::shortCut::Add("ctrl+d", ednMsgGuiCtags, "Jump");
// add files
APPL_INFO("show list of files : ");
bool ctagDetected = false;
for( int32_t iii=0 ; iii<ewol::CmdLine::Nb(); iii++) {
etk::UString tmpppp = ewol::CmdLine::Get(iii);
if (tmpppp == "-t") {
ctagDetected = true;
} else if (true == ctagDetected) {
APPL_INFO("Load ctag file : \"" << tmpppp << "\"" );
ctagDetected = false;
ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgCtagsLoadFile, tmpppp);
} else {
APPL_INFO("need load file : \"" << tmpppp << "\"" );
ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgOpenFile, tmpppp);
}
}
APPL_INFO("==> Init Edn (END)");
}
etk::FSNode APP_Icon(void)
{
etk::FSNode bitmapFile("DATA:iconEdn.bmp");
return bitmapFile;
}
/**
* @brief main application function Un-Initialisation
*/
void APP_UnInit(void)
{
APPL_INFO("==> Un-Init Edn (START)");
// Remove windows :
ewol::DisplayWindows(NULL);
cTagsManager::UnInit();
APPL_INFO("Stop Hightlight");
HighlightManager::UnInit();
//Kill all singleton
APPL_INFO("Stop BufferManager");
BufferManager::UnInit();
APPL_INFO("Stop ColorizeManager");
ColorizeManager::UnInit();
APPL_INFO("Stop Search");
//Search::Kill();
//APPL_INFO("Stop Accel key");
//AccelKey::Kill();
if (NULL != basicWindows) {
delete(basicWindows);
basicWindows = NULL;
}
APPL_INFO("==> Un-Init Edn (END)");
}

View File

@ -1,58 +0,0 @@
###############################################################################
### Files Listes ###
###############################################################################
# ExuberantCtags reading file tools (extern OPEN Sources) :
FILE_LIST+= appl/ctags/readtags.cpp \
appl/ctags/CTagsManager.cpp
# Globals debug tool:
FILE_LIST+= appl/Debug.cpp \
appl/global.cpp \
appl/globalMsg.cpp
# Gui:
FILE_LIST+= appl/Gui/BufferView.cpp \
appl/Gui/CodeView.cpp \
appl/Gui/MainWindows.cpp \
appl/Gui/Search.cpp \
appl/Gui/SearchData.cpp \
appl/Gui/TagFileSelection.cpp \
appl/Gui/TagFileList.cpp
# All needed for the buffer management :
FILE_LIST+= appl/Buffer/EdnVectorBuf.cpp \
appl/Buffer/EdnBuf/EdnBuf.cpp \
appl/Buffer/EdnBuf/EdnBuf_HighLight.cpp \
appl/Buffer/EdnBuf/EdnBuf_History.cpp \
appl/Buffer/EdnBuf/EdnBuf_Selection.cpp \
appl/Buffer/EdnBuf/EdnBufHistory.cpp \
appl/Buffer/Buffer.cpp \
appl/Buffer/BufferText.cpp \
appl/Buffer/BufferEmpty.cpp \
appl/Buffer/BufferManager.cpp
# Generic color management for the text editor :
FILE_LIST+= appl/Colorize/Colorize.cpp \
appl/Colorize/ColorizeManager.cpp
# syntax coloration for the text editor
FILE_LIST+= appl/Highlight/HighlightPattern.cpp \
appl/Highlight/Highlight.cpp \
appl/Highlight/HighlightManager.cpp
# Main entry file :
FILE_LIST+= appl/init.cpp
LOCAL_COPY_FILES := \
../share/Font/freefont/FreeSerif.ttf:Font/freefont/FreeSerif.ttf
LOCAL_COPY_FOLDERS := \
../share/*.xml: \
../share/icon/*.svg:icon \
../share/Font/freefont/FreeMon*.ttf:Font/freefont

View File

@ -6,66 +6,62 @@ dans la liste des truc important a refaire
mettre en place le repositionnement automatique quand on change de buffer
Curseur au bon endroit
TODO List :
- sys : Remove the Open GL ES 1 support of all the system ==> can not be compatible ...
- normalisation des dossier et des themes
- recherche automatique des laguages accessibles
- Recherche automatique des Couleurs
- Mise en place d'une interface jolie pour les paramètre
- rendre dynamique le système des menus
- Demander la création des nouveaux fichier ( create a la place de open dans le le menu d'ouverture des fichiers)
- Undo par section de mot et non par lettre taper ...
- ne pas ouvrir les donner en text...
- Tree view
- mettre un système de pluggin claire pour cree des nouvelles entréé tel que le lecteur hexa, images ... et aussi pour des pluggin de visualisation ...
- insert mode correct
- command line ...
* 0.3.6 ...
==> les widget sont intégralement a revoir ... ca prendra du temps ...
==> changer le system de tag ==> mettre dans un fichier tag.txt au lieux de prendre celuis de git ==> trop long dans beaucoup de cas
==> revoir le system de find ==> il est long et pose donc des problèmes surtout sous windows
* 0.2.X :
- gui : Demander la création de nouveaux fichier quand il n'existe pas (a l'ouverture en ligne de commande)
- sys : Mise en place des colorisation de base pour le
* java script
* SQL
- sys : Catch F[1-12] ==> for user personal event
- BUG : Correction du bug des entré bizard tel que les chapot et les guillemets
- BUG : de sélection quand la ligne est pleine et la première ligne séctionnée. ==> regarder après avoir fait le display ligne par ligne...
- BUG : de copier coller sur les éàè è ...
- BUG : les caractère multiples type chapot ...
* 0.3.X :
- sys : personal property file in the ~/.edn ou ~/.gnome/edn
- gui : Ordonner les fichier ouvert par nom ...
- enregistrement des propriaté de config utilisateur
- gui : parameter gui : et en autre la taille de la police ... et voir pour la récupérer sur le system... et ce serait cool...
- gui : Color list selection
- gui : Hightlight gui management
* 0.4.X :
- sys : Charset UTF-8 et iso 8859-15 correcte
- sys : Transformation de charset a la volée
- sys : Charset par defaut
- Sys : Détection de charset (à mettre dans les todo de charset)
==> regarder les librairies open sources
* 0.5.X :
- prj : list of current files open
- prj : open ctags file
- sys : replace ALL
- sys : Undo / Redo ajout de caractères autre que " ", "\t" et "\n"
* 0.6.X :
- sys : right management ...
- HL : Normalyse all the system of regular expression with <> chapot ...
- HL : sub parsing of the reg exp
- sys : update all language
* 0.7.X :
- sys : Select in colones
- sys : Select in colones
- sys : Select all the same search in the current buffer ... ( HL en vert ou jaune ...)
- sys : Multi-file search ==> display it in a result buffer (clickable only)
* 0.9.X :
- int : Redo all the doxygen ...
* 1.0.X :
- gui : open file in binary
- sys : compare binary files
- sys : compare normal files
* 1.1.X :
- gui : Display content of a folder
- gui : add a treeview display
- sys : evenement losqu'un fichier est modifier a l'exterieur...
- sys : image du type de fichier dans le buffer list view
* 1.2.X :
- PRJ : treeview des dossier a ouvrir
- PRJ : GUI de management
- PRJ : Save all in project
- SYS : Save all modify files
* 1.3.X :
- sys : version system management (git, cvs, ...)
* 1.4.X :
- SYS : Macro generation and acquisition
* 1.5.X :
- GDB : Acces interne pour un debuggeur ==> comme cgdb ... avec l'acces assembleur en plus
# note utiles :

View File

@ -1,64 +0,0 @@
#
# Automatically generated make config: don't edit
# Linux kernel version:
#
#
# Modules
#
CONFIG_BUILD_EDN=y
# CONFIG_BUILD_AGG is not set
# CONFIG_BUILD_ETK is not set
# CONFIG_BUILD_EWOL is not set
# CONFIG_BUILD_FREETYPE is not set
# CONFIG_BUILD_LUA is not set
# CONFIG_BUILD_OGG is not set
# CONFIG_BUILD_PARSERSVG is not set
# CONFIG_BUILD_LIBPNG is not set
# CONFIG_BUILD_PORTAUDIO is not set
# CONFIG_BUILD_TINYXML is not set
# CONFIG_BUILD_ZLIB is not set
# CONFIG_BUILD_LIBZIP is not set
#
# edn
#
#
# General
#
CONFIG_APPL_BUFFER_FONT_NORMAL=y
# CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set
#
# Android
#
CONFIG___EWOL_ANDROID_MINIMUM_SDK_VERSION__=9
# CONFIG___EWOL_ANDROID_SHOW_TITLE__ is not set
CONFIG___EWOL_ANDROID_ORIENTATION_AUTO__=y
# CONFIG___EWOL_ANDROID_ORIENTATION_LANDSCAPE__ is not set
# CONFIG___EWOL_ANDROID_ORIENTATION_PORTRAIT__ is not set
#
# Permissions
#
CONFIG___ANDROID_PERMISSION__WRITE_EXTERNAL_STORAGE__=y
# CONFIG___ANDROID_PERMISSION__CAMERA__ is not set
# CONFIG___ANDROID_PERMISSION__INTERNET__ is not set
# CONFIG___ANDROID_PERMISSION__MODIFY_AUDIO_SETTINGS__ is not set
# CONFIG___ANDROID_PERMISSION__READ_CALENDAR__ is not set
# CONFIG___ANDROID_PERMISSION__READ_CONTACTS__ is not set
# CONFIG___ANDROID_PERMISSION__READ_FRAME_BUFFER__ is not set
# CONFIG___ANDROID_PERMISSION__READ_PROFILE__ is not set
# CONFIG___ANDROID_PERMISSION__RECORD_AUDIO__ is not set
# CONFIG___ANDROID_PERMISSION__SET_ORIENTATION__ is not set
# CONFIG___ANDROID_PERMISSION__VIBRATE__ is not set
# CONFIG___ANDROID_PERMISSION__ACCESS_COARSE_LOCATION__ is not set
# CONFIG___ANDROID_PERMISSION__ACCESS_FINE_LOCATION__ is not set
# CONFIG___VIDEO__OPENGL_ES_1 is not set
CONFIG___VIDEO__OPENGL_ES_2=y
CONFIG___EWOL_APPL_BASIC_TITLE__="Edn : Sources Code Editor"

View File

@ -1,42 +0,0 @@
#
# Automatically generated make config: don't edit
# Linux kernel version:
#
#
# Modules
#
CONFIG_BUILD_EDN=y
# CONFIG_BUILD_AGG is not set
# CONFIG_BUILD_ETK is not set
# CONFIG_BUILD_EWOL is not set
# CONFIG_BUILD_FREETYPE is not set
# CONFIG_BUILD_LUA is not set
# CONFIG_BUILD_OGG is not set
# CONFIG_BUILD_PARSERSVG is not set
# CONFIG_BUILD_LIBPNG is not set
# CONFIG_BUILD_PORTAUDIO is not set
# CONFIG_BUILD_TINYXML is not set
# CONFIG_BUILD_ZLIB is not set
# CONFIG_BUILD_LIBZIP is not set
#
# edn
#
#
# General
#
CONFIG_APPL_BUFFER_FONT_NORMAL=y
# CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set
#
# ewol
#
#
# General
#
# CONFIG___VIDEO__OPENGL_ES_1 is not set
CONFIG___VIDEO__OPENGL_ES_2=y
CONFIG___EWOL_APPL_BASIC_TITLE__="Edn : Sources Code Editor"

View File

@ -1,42 +0,0 @@
#
# Automatically generated make config: don't edit
# Linux kernel version:
#
#
# Modules
#
CONFIG_BUILD_EDN=y
# CONFIG_BUILD_AGG is not set
# CONFIG_BUILD_ETK is not set
# CONFIG_BUILD_EWOL is not set
# CONFIG_BUILD_FREETYPE is not set
# CONFIG_BUILD_LUA is not set
# CONFIG_BUILD_OGG is not set
# CONFIG_BUILD_PARSERSVG is not set
# CONFIG_BUILD_LIBPNG is not set
# CONFIG_BUILD_PORTAUDIO is not set
# CONFIG_BUILD_TINYXML is not set
# CONFIG_BUILD_ZLIB is not set
# CONFIG_BUILD_LIBZIP is not set
#
# edn
#
#
# General
#
CONFIG_APPL_BUFFER_FONT_NORMAL=y
# CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set
#
# ewol
#
#
# General
#
# CONFIG___VIDEO__OPENGL_ES_1 is not set
CONFIG___VIDEO__OPENGL_ES_2=y
CONFIG___EWOL_APPL_BASIC_TITLE__="Edn : Sources Code Editor"

28
data/GUI-Search.xml Normal file
View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<composer expand="true,false" fill="true,false">
<sizer mode="hori" expand="true,false" fill="true" lock="true">
<button name="SEARCH:close">
<image src="THEME:GUI:Remove.edf" fill="true" size="7,7mm" distance-field="true"/>
</button>
<entry name="SEARCH:search-entry" expand="true" fill="true"/>
<button name="SEARCH:search">
<image src="THEME:GUI:Search.edf" fill="true" size="7,7mm" distance-field="true"/>
</button>
<entry name="SEARCH:replace-entry" expand="true" fill="true"/>
<button name="SEARCH:replace">
<image src="THEME:GUI:Replace.edf" fill="true" size="7,7mm" distance-field="true"/>
</button>
<button name="SEARCH:case" toggle="true">
<image src="THEME:GUI:CaseSensitive.edf" fill="true" size="7,7mm" hover="_T(Close search bar)" distance-field="true"/>
<image src="THEME:GUI:CaseSensitive.edf" fill="true" size="7,7mm" hover="_T(Close search bar)" distance-field="true"/>
</button>
<button name="SEARCH:wrap" toggle="true">
<image src="THEME:GUI:WrapAround.edf" fill="true" size="7,7mm" hover="_T(Close search bar)" distance-field="true"/>
<image src="THEME:GUI:WrapAround.edf" fill="true" size="7,7mm" hover="_T(Close search bar)" distance-field="true"/>
</button>
<button name="SEARCH:up-down" toggle="true">
<image src="THEME:GUI:Up.edf" fill="true" size="7,7mm" hover="_T(Close search bar)" distance-field="true"/>
<image src="THEME:GUI:Down.edf" fill="true" size="7,7mm" hover="_T(Close search bar)" distance-field="true"/>
</button>
</sizer>
</composer>

27
data/edn.desktop Normal file
View File

@ -0,0 +1,27 @@
[Desktop Entry]
Name=Edn : Editeur de N'ours
Exec=edn %U
Icon=/usr/share/edn/icon.png
Terminal=false
Type=Application
Categories=Development;
GenericName=Text editor
GenericName[en]=Text editor
GenericName[nl]=Tekst verwerker
GenericName[fr]=Éditeur de text
Comment=Code editor for c, c++, php, bash, xml ...
Comment[fr]=éditeur de text pour les language c, c++, php, bash, xml ...
OnlyShowIn=GNOME;Unity;
MimeType=text/html;text/xml;application/xhtml_xml;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=true
Actions=New;
[Desktop Action New]
Name=Open a New Window
Name[fr]=Ouvrir une nouvelle fenêtre
Name[nl]=Nieuw venster openen
Name[en]=Open a New Window
Exec=edn
#desktop-file-validate edn.desktop
#sudo cp xxx /usr/share/applications/

BIN
data/icon.icns Normal file

Binary file not shown.

0
data/lang/EN.json Normal file
View File

0
data/lang/FR.json Normal file
View File

View File

@ -1,57 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<EdnLang version="0.1" lang="Assembleur">
<ext>*.s</ext>
<ext>*.S</ext>
<ext>*.asm</ext>
<ext>.*\.(s|S|asm|ASM)</ext>
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="my comment multiline doxygen">
<color>commentDoxygen</color>
<start>/\*\*</start>
<end>\*/</end>
<regex>
<start>/\*(\*|!)</start>
<stop>\*/</stop>
</regex>
</rule>
<rule name="my comment multiline">
<color>comment</color>
<regex>
<start>/\*</start>
<end>\*/</end>
<stop>\*/</stop>
</regex>
</rule>
<rule name="my if 0">
<color>preprocesseur</color>
<regex>
<start>#[ \t]*if 0</start>
<end>#endif|#else</end>
<EscapeChar>\</EscapeChar>
<stop>#(endif|else)</stop>
</regex>
</rule>
<rule name="my preprocesseur">
<color>preprocesseur</color>
<start>#</start>
<end>\n</end>
<EscapeChar>\</EscapeChar>
<regex>#.*?$</regex>
</rule>
<rule name="my comment doxygen">
<color>commentDoxygen</color>
<start>//!</start>
<end>\n</end>
<regex>//!.*?$</regex>
</rule>
<rule name="my todo comment">
<color>SYNTAX_ERROR</color>
<start>//[ \t]*TODO[ \t]*:</start>
<end>\n</end>
<EscapeChar>\</EscapeChar>
<regex>//[ \t]*TODO[ \t]*:.*?$</regex>
</rule>
<rule name="my comment">
<color>comment</color>
<start>(//|@)</start>
<end>\n</end>
<EscapeChar>\</EscapeChar>
<regex>//.*?$</regex>
</rule>
</pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword">
<color>keyword</color>
<start>\@smull|ldrsh|smlal|stmdb|mul|mla|umull|ldr|add|str|mov|subs|bgt|ldmia|stmia|ldmfd|cmp|sub|strd|stmfd|bne|bhi|ldrd|mvn\@</start>
<regex>\b(smull|ldrsh|smlal|stmdb|mul|mla|umull|ldr|add|str|mov|subs|bgt|ldmia|stmia|ldmfd|cmp|sub|strd|stmfd|bne|bhi|ldrd|mvn)\b</regex>
</rule>
<rule name="register list">
<color>type</color>
<start>\@r(10|11|12|[0-9]?)|sp|lp|lr|pc\@</start>
<regex>\b(r(10|11|12|[0-9]?)|sp|lp|lr|pc)\b</regex>
</rule>
</pass2>
</EdnLang>

View File

@ -1,48 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<EdnLang version="0.1" lang="Bash script">
<ext>*.sh</ext>
<ext>.*\.sh</ext>
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="first line">
<color>commentDoxygen</color>
<start>#!</start>
<end>\n</end>
<EscapeChar>\</EscapeChar>
<regex>#!(.|\\[\\\n])*?$</regex>
</rule>
<rule name="comment line">
<color>comment</color>
<start>#</start>
<end>\n</end>
<EscapeChar>\</EscapeChar>
<regex>#(.|\\[\\\n])*?$</regex>
</rule>
<rule name="doubleQuteText">
<color>doubleQuoteText</color>
<start>"</start>
<end>"</end>
<EscapeChar>\</EscapeChar>
<regex>&quot;(.|\\[\\&quot;])*?&quot;</regex>
</rule>
<rule name="simpleQuteText">
<color>doubleQuoteText</color>
<start>'</start>
<end>'</end>
<!--<EscapeChar>\</EscapeChar>-->
<regex>&apos;(.|\\[\\&apos;])*?&apos;</regex>
</rule>
</pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword">
<color>keyword</color>
<start>\@for|done|do|while|in|if|elif|then|else|fi\@</start>
<regex>\b(for|done|do|while|in|if|elif|then|else|fi)\b</regex>
</rule>
<rule name="my Variable">
<color>keyword</color>
<start>[\$]+[a-zA-Z_][a-zA-Z0-9_]*</start>
<regex>[\$]+[a-zA-Z_][a-zA-Z0-9_]*</regex>
</rule>
<rule name="Function name">
<color>functionName</color>
<start>function (\w|_)+[ \t]*\(</start>
<regex>function (\w|_)+[ \t]*\(</regex>
</rule>
<rule name="condition">
<color>boolean</color>
<start>==|&lt;=|&gt;=|!=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}|</start>
<regex>==|&lt;=|&gt;=|!=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}</regex>
</rule>
</pass2>
</EdnLang>

View File

@ -1,60 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<EdnLang version="0.1" lang="boulou log">
<ext>*.boo</ext>
<EdnLang version="0.1" lang="Boulou log">
<ext>.*\.(boo|BOO)</ext>
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="comment ##">
<color>SYNTAX_ERROR</color>
<start>##</start>
<end>\n</end>
<regex>##.*?$</regex>
</rule>
<rule name="comment #">
<color>comment</color>
<start>#</start>
<end>\n</end>
<regex>#.*?$</regex>
</rule>
<rule name="notes ... ">
<color>preprocesseur</color>
<start>(NOTE|TODO) : </start>
<end>\n</end>
<regex>(NOTE|TODO) : .*?$</regex>
</rule>
<rule name="doubleQuteText">
<color>doubleQuoteText</color>
<start>"</start>
<end>"</end>
<EscapeChar>\</EscapeChar>
<regex>&quot;(.|\\[\\&quot;])*?$</regex>
</rule>
<rule name="simpleQuteText">
<color>doubleQuoteText</color>
<start>\@'</start>
<end>'</end>
<!--<EscapeChar>\</EscapeChar>-->
<regex>\b&apos;(.|\\[\\&apos;])*?$</regex>
</rule>
</pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="pourcentage OK">
<color>TestResultOK</color>
<start>100%</start>
<regex>100%</regex>
</rule>
<rule name="pourcentage">
<color>number</color>
<start>[0-9]*%</start>
<regex>[0-9]*%</regex>
</rule>
<rule name="Résultat OK">
<rule name="Résultat OK">
<color>TestResultOK</color>
<start>\[( )*(OK|Ok|ok)( )*\]</start>
<regex>\[( )*(OK|Ok|ok)( )*\]</regex>
</rule>
<rule name="resultat en erreur">
<color>TestResultERROR</color>
<start>\[(ERREUR|Erreur|erreur)\]</start>
<regex>\[(ERREUR|Erreur|erreur)\]</regex>
</rule>
<rule name="resultat vide">
<color>number</color>
<start>\[( )*\]</start>
<regex>\[( )*\]</regex>
</rule>
<rule name="notes ... ">
<color>macro</color>
<start>==&gt;</start>
<regex>==&gt;</regex>
</rule>
</pass2>
</EdnLang>

View File

@ -0,0 +1,134 @@
<?xml version="1.0" encoding="UTF-8"?>
<EdnLang version="0.1" lang="C">
<ext>.*\.(c|C|m|M)</ext>
<!--might be : <ext>.*\.(c|h|m)</ext>-->
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="doxygen multiline">
<color>commentDoxygen</color>
<regex>
<start>/\*(\*|!)</start>
<stop>\*/</stop>
</regex>
<sub>doxyparse</sub>
</rule>
<rule name="comment multiline">
<color>comment</color>
<regex>
<start>/\*</start>
<stop>\*/</stop>
</regex>
<sub>TODO</sub>
</rule>
<rule name="comment multiline ERROR">
<color>SYNTAX_ERROR</color>
<regex>
<start>/\*</start>
</regex>
</rule>
<rule name="#if 0">
<color>preprocesseur</color>
<regex>
<start>#[ \t]*if 0</start>
<stop>#(endif|else)</stop>
</regex>
</rule>
<rule name="#if 0 ERROR">
<color>SYNTAX_ERROR</color>
<regex>
<start>#[ \t]*if 0</start>
</regex>
</rule>
<rule name="#preproc">
<color>preprocesseur</color>
<regex>#(.|\\[\\\n])*</regex>
</rule>
<rule name="inline doxygen">
<color>commentDoxygen</color>
<regex>//!.*</regex>
<sub>doxyparse</sub>
</rule>
<rule name="inline comment">
<color>comment</color>
<regex>//.*</regex>
<sub>TODO</sub>
</rule>
<rule name="double quote text">
<color>doubleQuoteText</color>
<regex>&quot;(.|\\[\\&quot;])*?&quot;</regex> <!-- " -->
</rule>
<rule name="simple quote text">
<color>doubleQuoteText</color>
<regex>&apos;\\?.&apos;</regex>
</rule>
</pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword">
<color>keyword</color>
<regex>\b(return|goto|if|else|case|default|switch|break|continue|while|do|for|sizeof)\b</regex>
</rule>
<rule name="my function keyword">
<color>systemFunction</color>
<regex>\b(memset|fopen|fread|fwrite|fgets|fclose|printf|(f|s|diag_)printf|calloc|malloc|realloc)\b</regex>
</rule>
<rule name="my type">
<color>type</color>
<regex>\b(bool|char(16_t|32_t)?|double|float|u?int(8|16|32|64|128)?(_t)?|long|short|signed|size_t|unsigned|void|(I|U)(8|16|32|64|128))\b</regex>
</rule>
<rule name="my storage keyword">
<color>storageKeyword</color>
<regex>\b(inline|const|const|extern|register|static|unsigned|signed|volatile|char|double|float|int|long|short|void|typedef|struct|union|enum)\b</regex>
</rule>
<rule name="my common Define">
<color>commonDefine</color>
<regex>\b(NULL|MAX|MIN|__(LINE|DATA|FILE|func|TIME|STDC|PRETTY_FUNCTION|FUNCTION)__)\b</regex>
</rule>
<rule name="numeric constant">
<color>number</color>
<regex>\b(((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?)\b</regex>
</rule>
<rule name="my boolean">
<color>boolean</color>
<regex>\b(TRUE|FALSE)\b</regex>
</rule>
<rule name="BIG LETTER">
<color>macro</color>
<regex>\b([A-Z_][A-Z_0-9]{3,500})\b</regex>
</rule>
<rule name="function input">
<color>inputFunction</color>
<regex>\b_\w+\b</regex>
</rule>
<rule name="Function name">
<color>functionName</color>
<regex>\b((\w|_)+[ \t]*\()</regex>
</rule>
<rule name="condition">
<color>boolean</color>
<regex>==|&lt;=|&gt;=|!=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}</regex>
</rule>
<rule name="simpleQuteTextError">
<color>SYNTAX_ERROR</color>
<regex>&apos;|&quot;</regex>
</rule>
</pass2>
<pass name="doxyparse">
<rule name="key">
<color>doxygen-key</color>
<regex>(@|\\)[\t ]*\w+</regex>
</rule>
<rule name="in-out">
<color>doxygen-in-out</color>
<regex>\[(in|in,out|out)\]</regex>
</rule>
<rule name="function input">
<color>inputFunction</color>
<regex>\b_\w+\b</regex>
</rule>
</pass>
<pass name="TODO">
<rule name="function input">
<color>SYNTAX_ERROR</color>
<regex>TODO[ \t]*:.*</regex>
</rule>
</pass>
</EdnLang>

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<EdnLang version="0.1" lang="cmake">
<ext>CMakeLists.txt</ext>
<ext>CMakeCache.txt</ext>
<pass1>
<rule name="my comment doxygen">
<color>commentDoxygen</color>
<regex>##.*</regex>
</rule>
<rule name="my todo comment">
<color>SYNTAX_ERROR</color>
<regex>#[ \t]TODO[ \t]*:(.|\\[\\\n])*</regex>
</rule>
<rule name="my comment">
<color>comment</color>
<regex>#(.|\\[\\\n])*</regex>
</rule>
<rule name="doubleQuteText">
<color>doubleQuoteText</color>
<regex>&quot;(.|\\[\\&quot;])*?&quot;</regex>
</rule>
</pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword">
<color>keyword</color>
<regex>\b(foreach|message|endforeach|if|else|endif|list|file|string)\b</regex>
</rule>
<rule name="my function keyword">
<color>systemFunction</color>
<regex>\b(set|include_directories|add_definitions|add_library|include_directories|target_link_libraries|project|include|check_include_file|enable_testing|option|cmake_minimum_required|add_definitions|check_include_file|configure_file|include_directories|add_custom_command|add_executable|add_test|find_package|pkg_check_modules|set_target_properties|source_group)\b</regex>
</rule>
<rule name="Variable">
<color>inputFunction</color>
<regex>\$\{.*\}</regex>
</rule>
<rule name="numeric constant">
<color>number</color>
<regex>\b(((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?)\b</regex>
</rule>
<rule name="BIG LETTER">
<color>macro</color>
<regex>\b([A-Z_][A-Z_0-9]{3,500})\b</regex>
</rule>
<rule name="Function name">
<color>functionName</color>
<regex>\b(\w|_)+[ \t]*\(</regex>
</rule>
<rule name="files path">
<color>memberClass</color>
<regex>[\w-]*(\.|/)\w*</regex>
</rule>
</pass2>
</EdnLang>

View File

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8"?>
<EdnLang version="0.1" lang="C++">
<ext>.*\.(cpp|CPP|cxx|CXX|cc|CC|hpp|HPP|hxx|HXX|h|H|mm|MM|c++|C++|m++|M++|mpp|MPP)</ext>
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="doxygen multiline">
<color>commentDoxygen</color>
<regex>
<start>/\*(\*|!)</start>
<stop>\*/</stop>
</regex>
<sub>doxyparse</sub>
</rule>
<rule name="comment multiline">
<color>comment</color>
<regex>
<start>/\*</start>
<stop>\*/</stop>
</regex>
<sub>TODO</sub>
</rule>
<rule name="comment multiline ERROR">
<color>SYNTAX_ERROR</color>
<regex>
<start>/\*</start>
</regex>
</rule>
<rule name="#if 0">
<color>preprocesseur</color>
<regex>
<start>#[ \t]*if 0</start>
<stop>#e(ndif|lse)</stop>
</regex>
</rule>
<rule name="#if 0 ERROR">
<color>SYNTAX_ERROR</color>
<regex>
<start>#[ \t]*if 0</start>
</regex>
</rule>
<rule name="#preproc">
<color>preprocesseur</color>
<regex>#(.|\\[\\\n])*</regex>
</rule>
<rule name="inline doxygen">
<color>commentDoxygen</color>
<regex>//!.*</regex>
<sub>doxyparse</sub>
</rule>
<rule name="inline comment">
<color>comment</color>
<regex>//.*</regex>
<sub>TODO</sub>
</rule>
<rule name="double quote text">
<color>doubleQuoteText</color>
<regex>(U|u|u8)?&quot;(.|\\[\\&quot;])*?&quot;</regex> <!-- " -->
</rule>
<rule name="simple quote text">
<color>doubleQuoteText</color>
<regex>&apos;\\?.&apos;</regex>
</rule>
</pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="old school elements">
<color>SYNTAX_ERROR</color>
<regex>&apos;|&quot;|NULL|MAX|MIN|TRUE|FALSE|calloc|malloc|realloc|free|BOOL</regex>
</rule>
<rule name="my keyword">
<color>keyword</color>
<regex>\b(return|goto|if|else|case|default|switch|break|continue|while|do|for|sizeof)\b</regex>
</rule>
<rule name="my function keyword">
<color>systemFunction</color>
<regex>\b(new|delete|try|catch|memset|fopen|fread|fwrite|fgets|fclose|printf|(f|s|diag_)printf|(reinterpret|static|dynamic|const)_cast)\b</regex>
</rule>
<rule name="my type">
<color>type</color>
<regex>\b(bool|char(16_t|32_t)?|double|float|u?int(8|16|32|64|128)?(_t)?|long|short|signed|size_t|unsigned|void|(I|U)(8|16|32|64|128))\b</regex>
</rule>
<rule name="std type">
<color>type</color>
<regex>\b(std(11)?|boost)::[\w:]*</regex>
</rule>
<rule name="my storage keyword">
<color>storageKeyword</color>
<regex>\b(inline|const|class|namespace|virtual|private|public|protected|friend|const|extern|mutable|auto|register|static|unsigned|signed|volatile|char|double|float|int|long|short|void|typedef|struct|union|enum|override|final)\b</regex>
</rule>
<rule name="my common Define">
<color>commonDefine</color>
<regex>\b(nullptr|__(LINE|DATA|FILE|func|TIME|STDC|PRETTY_FUNCTION|FUNCTION)__)\b</regex>
</rule>
<rule name="numeric constant">
<color>number</color>
<regex>\b(((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(LL|L|l|UL|ul|u|U|F|f)?)\b</regex>
</rule>
<rule name="my boolean">
<color>boolean</color>
<regex>\b(true|false)\b</regex>
</rule>
<rule name="BIG LETTER">
<color>macro</color>
<regex>\b([A-Z_][A-Z_0-9]{3,500})\b</regex>
</rule>
<rule name="CPP member">
<color>memberClass</color>
<regex>\b((m|s|p|s|g)_|property|signal)\w+\b</regex>
</rule>
<rule name="function input">
<color>inputFunction</color>
<regex>\b_\w+\b</regex>
</rule>
<rule name="Function name">
<color>functionName</color>
<regex>\b((\w|_)+[ \t]*\()</regex>
</rule>
<rule name="condition">
<color>boolean</color>
<regex>==|&lt;=|&gt;=|!=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}</regex>
</rule>
<rule name="simpleQuteTextError">
<color>SYNTAX_ERROR</color>
<regex>&apos;|&quot;</regex>
</rule>
</pass2>
<pass name="doxyparse">
<rule name="knownkey">
<color>doxygen-key-known</color>
<regex>(@|\\)[\t ]*(addindex|addtogroup|anchor|arg|attention|author|authors|a|brief|bug|b|callgraph|category|cite|class|code|cond|copybrief|copydetails|copydoc|copyright|date|def|defgroup|deprecated|details|diafile|dir|docbookonly|dontinclude|dot|dotfile|else|elseif|em|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endif|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|endverbatim|enduml|endxmlonly|enum|example|exception|extends|e|file|fn|headerfile|hidecallergraph|hidecallgraph|hideinitializer|htmlinclude|htmlonly|idlexcept|ifnot|if|image|implements|includelineno|include|ingroup|internal|invariant|interface|latexinclude|latexonly|line|link|license|li|mainpage|manonly|memberof|msc|mscfile|name|namespace|nosubgrouping|note|n|overload|package|page|paragraph|param|parblock|par|post|pre|private|privatesection|property|protected|protectedsection|protocol|public|publicsection|pure|p|refitem|ref|related|relates|relatedalso|relatesalso|remark|remarks|result|return|returns|retval|rtfonly|sa|secreflist|section|see|short|showinitializer|since|skip|skipline|snippet|startuml|struct|subpage|subsection|subsubsection|tableofcontents|test|throw|throws|todo|tparam|typedef|union|until|var|verbatim|verbinclude|version|vhdlflow|warning|weakgroup|xmlonly|xrefitem)</regex>
</rule>
<rule name="key">
<color>doxygen-key</color>
<regex>(@|\\)[\t ]*\w+</regex>
</rule>
<rule name="in-out">
<color>doxygen-in-out</color>
<regex>\[(in|in,out|out)\]</regex>
</rule>
<rule name="function input">
<color>inputFunction</color>
<regex>\b_\w+\b</regex>
</rule>
</pass>
<pass name="TODO">
<rule name="function input">
<color>SYNTAX_ERROR</color>
<regex>TODO[ \t]*:.*</regex>
</rule>
</pass>
</EdnLang>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<EdnLang version="0.1" lang="gcov">
<ext>.*\.(gcov)</ext>
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="Not parsed">
<color>normal</color>
<regex>( )+-\:.*</regex>
</rule>
<rule name="Not executed">
<color>SYNTAX_ERROR</color>
<regex>( )+(#)+\:.*</regex>
</rule>
<rule name="Not parsed">
<color>number</color>
<regex>( )+[0-9]+\:.*</regex>
</rule>
</pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
</pass2>
</EdnLang>

View File

@ -1,82 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<EdnLang version="0.1" lang="glsl">
<ext>*.glsl</ext>
<ext>*.vert</ext>
<ext>*.frag</ext>
<ext>*.prog</ext>
<EdnLang version="0.1" lang="Glsl">
<ext>.*\.(glsl|vert|frag|prog)</ext>
<pass1>
<rule name="my comment multiline doxygen">
<color>commentDoxygen</color>
<start>/\*\*</start>
<end>\*/</end>
<regex>
<start>/\*(\*|!)</start>
<stop>\*/</stop>
</regex>
</rule>
<rule name="my comment multiline">
<color>comment</color>
<regex>
<start>/\*</start>
<end>\*/</end>
<stop>\*/</stop>
</regex>
</rule>
<rule name="my if 0">
<color>preprocesseur</color>
<regex>
<start>#[ \t]*if 0</start>
<end>#endif|#else</end>
<EscapeChar>\</EscapeChar>
<stop>#(endif|else)</stop>
</regex>
</rule>
<rule name="my preprocesseur">
<color>preprocesseur</color>
<start>#</start>
<end>\n</end>
<EscapeChar>\</EscapeChar>
<regex>#(.|\\[\\\n])*$</regex>
</rule>
<rule name="my comment doxygen">
<color>commentDoxygen</color>
<start>//!</start>
<end>\n</end>
<regex>//!(.|\\[\\\n])*$</regex>
</rule>
<rule name="my todo comment">
<color>SYNTAX_ERROR</color>
<start>//[ \t]*TODO[ \t]*:</start>
<end>\n</end>
<EscapeChar>\</EscapeChar>
<regex>//[ \t]*TODO[ \t]*:(.|\\[\\\n])*$</regex>
</rule>
<rule name="my comment">
<color>comment</color>
<start>//</start>
<end>\n</end>
<EscapeChar>\</EscapeChar>
<regex>//(.|\\[\\\n])*$</regex>
</rule>
</pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword">
<color>keyword</color>
<start>\@return|goto|if|else|case|default|switch|break|continue|while|do|for|sizeof\@</start>
<regex>\b(return|goto|if|else|case|default|switch|break|continue|while|do|for|sizeof)\b</regex>
</rule>
<rule name="my type">
<color>type</color>
<start>\@bool|float|int|(vec|mat|ivect|bvect)[2-4]\@</start>
<regex>\b(void|bool|float|int|(vec|mat|ivec|bvec)[2-4])\b</regex>
</rule>
<rule name="my storage keyword">
<color>storageKeyword</color>
<start>\@varying|uniform|attribute\@</start>
<regex>\b(varying|uniform|attribute|precision|mediump)\b</regex>
</rule>
<rule name="numeric constant">
<color>number</color>
<start>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</start>
<regex>\b(((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?)\b</regex>
</rule>
<rule name="my boolean">
<color>boolean</color>
<start>\@true|false\@</start>
<regex>\b(true|false)\b</regex>
</rule>
<rule name="BIG LETTER">
<color>macro</color>
<start>\@[A-Z_][A-Z_0-9]{3,500}\@</start>
<regex>\b([A-Z_][A-Z_0-9]{3,500})\b</regex>
</rule>
<rule name="Function name">
<color>functionName</color>
<start>\@(\w|_)+[ \t]*\(</start>
<regex>\b(\w|_)+[ \t]*\(</regex>
</rule>
<rule name="condition">
<color>boolean</color>
<start>==|&lt;=|&gt;=|!=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}|</start>
<regex>==|&lt;=|&gt;=|!=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}</regex>
</rule>
</pass2>
</EdnLang>

View File

@ -1,46 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<EdnLang version="0.1" lang="qconf configuration file">
<ext>*.in</ext>
<EdnLang version="0.1" lang="Kernel conf file">
<ext>.*\.in</ext>
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="my preprocesseur">
<color>preprocesseur</color>
<start>#</start>
<end>\n</end>
<EscapeChar>\</EscapeChar>
<regex>#(.|\\[\\\n])*?$</regex>
</rule>
<rule name="doubleQuteText">
<color>doubleQuoteText</color>
<start>"</start>
<end>"</end>
<EscapeChar>\</EscapeChar>
<regex>&quot;(.|\\[\\&quot;])*?$</regex>
</rule>
<rule name="simpleQuteText">
<color>doubleQuoteText</color>
<start>'</start>
<end>'</end>
<!--<EscapeChar>\</EscapeChar>-->
<regex>&apos;(.|\\[\\&apos;])*?$</regex>
</rule>
</pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword">
<color>keyword</color>
<start>\@menu|endmenu|comment|if|endif|help|default|choice|endchoice|prompt|depends on|config\@</start>
<regex>\b(menu|endmenu|comment|if|endif|help|default|choice|endchoice|prompt|depends on|config)\b</regex>
</rule>
<rule name="my type">
<color>type</color>
<start>\@int|hex|bool|string\@</start>
<regex>\b(int|hex|bool|string)\b</regex>
</rule>
<rule name="numeric constant">
<color>number</color>
<start>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</start>
<regex>\b(((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?)\b</regex>
</rule>
<rule name="BIG LETTER">
<color>macro</color>
<start>\@[A-Z_][A-Z_0-9]{3,500}\@</start>
<regex>\b([A-Z_][A-Z_0-9]{3,500})\b</regex>
</rule>
<rule name="condition">
<color>boolean</color>
<start>==|&lt;=|&gt;=|!=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}|</start>
<regex>==|&lt;=|&gt;=|!=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}</regex>
</rule>
</pass2>
</EdnLang>

View File

@ -0,0 +1,116 @@
<?xml version="1.0" encoding="UTF-8"?>
<EdnLang version="0.1" lang="Java">
<ext>.*\.(java|JAVA)</ext>
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="doxygen multiline">
<color>commentDoxygen</color>
<regex>
<start>/\*(\*|!)</start>
<stop>\*/</stop>
</regex>
<sub>doxyparse</sub>
</rule>
<rule name="comment multiline">
<color>comment</color>
<regex>
<start>/\*</start>
<stop>\*/</stop>
</regex>
<sub>TODO</sub>
</rule>
<rule name="comment multiline ERROR">
<color>SYNTAX_ERROR</color>
<regex>
<start>/\*(\*|!)</start>
</regex>
</rule>
<rule name="inline doxygen">
<color>commentDoxygen</color>
<regex>//!.*$</regex>
<sub>doxyparse</sub>
</rule>
<rule name="inline comment">
<color>comment</color>
<regex>//.*$</regex>
<sub>TODO</sub>
</rule>
<rule name="double quote text">
<color>doubleQuoteText</color>
<regex>(U|u|u8)?&quot;(.|\\[\\&quot;])*?&quot;</regex> <!-- " -->
</rule>
<rule name="simple quote text">
<color>doubleQuoteText</color>
<regex>&apos;\\?.&apos;</regex>
</rule>
</pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword">
<color>keyword</color>
<regex>\b(return|goto|if|else|case|default|switch|break|continue|while|do|for)\b</regex>
</rule>
<rule name="my function keyword">
<color>systemFunction</color>
<regex>\b(new|try|catch|print)\b</regex>
</rule>
<rule name="my type">
<color>type</color>
<regex>\b(boolean|byte|char|double|float|int|long|short|String|Object|Thread|void|enum)\b</regex>
</rule>
<rule name="my storage keyword">
<color>storageKeyword</color>
<regex>\b(import|package|extends|Override|implements|const|class|abstract|private|public|protected|final|const|static|transiant|volatile|interface)\b</regex>
</rule>
<rule name="my common Define">
<color>commonDefine</color>
<regex>\bnull\b</regex>
</rule>
<rule name="numeric constant">
<color>number</color>
<regex>\b(((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?)\b</regex>
</rule>
<rule name="my boolean">
<color>boolean</color>
<regex>\b(true|false)\b</regex>
</rule>
<rule name="BIG LETTER">
<color>macro</color>
<regex>\b[A-Z_][A-Z_0-9]{3,500}\b</regex>
</rule>
<rule name="java member">
<color>memberClass</color>
<regex>\bm_\w+\b</regex>
</rule>
<rule name="function input">
<color>inputFunction</color>
<regex>\b_\w+\b</regex>
</rule>
<rule name="Function name">
<color>functionName</color>
<regex>\b((\w|_)+[ \t]*\()</regex>
</rule>
<rule name="condition">
<color>boolean</color>
<regex>==|&lt;=|&gt;=|!=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}</regex>
</rule>
</pass2>
<pass name="doxyparse">
<rule name="key">
<color>doxygen-key</color>
<regex>(@|\\)[\t ]*\w+</regex>
</rule>
<rule name="in-out">
<color>doxygen-in-out</color>
<regex>\[(in|in,out|out)\]</regex>
</rule>
<rule name="function input">
<color>inputFunction</color>
<regex>\b_\w+\b</regex>
</rule>
</pass>
<pass name="TODO">
<rule name="function input">
<color>SYNTAX_ERROR</color>
<regex>TODO[ \t]*:.*</regex>
</rule>
</pass>
</EdnLang>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<EdnLang version="0.1" lang="Json">
<ext>.*\.(json|JSON)</ext>
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="doubleQuteText">
<color>doubleQuoteText</color>
<regex>&quot;(.|\\[\\&quot;])*?&quot;</regex>
</rule>
<rule name="my comment">
<color>comment</color>
<regex>#.*</regex>
</rule>
</pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword">
<color>keyword</color>
<regex>\{|\}|\[|\]</regex>
</rule>
<rule name="separator">
<color>error</color>
<regex>:|,</regex>
</rule>
<rule name="names">
<color>functionName</color>
<regex>([a-zA-Z0-9]|-|_)+</regex>
</rule>
<rule name="numeric constant">
<color>number</color>
<regex>\b(((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?)\b</regex>
</rule>
<rule name="my boolean">
<color>boolean</color>
<regex>\b(true|false)\b</regex>
</rule>
</pass2>
</EdnLang>

View File

@ -1,60 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<EdnLang version="0.1" lang="c">
<ext>*.lua</ext>
<EdnLang version="0.1" lang="Lua">
<ext>.*\.lua</ext>
<pass1>
<rule name="Comment multiline">
<color>comment</color>
<regex>
<start>\-\-\[\[</start>
<end>\-\-\]\]</end>
<stop>\-\-\]\]</stop>
</regex>
</rule>
<rule name="my todo comment">
<color>SYNTAX_ERROR</color>
<start>\-\-[ \t]*TODO[ \t]*:</start>
<end>\n</end>
<EscapeChar>\</EscapeChar>
<regex>\-\-[ \t]*TODO[ \t]*:(.|\\[\\\n])*?$</regex>
</rule>
<rule name="my comment">
<color>comment</color>
<start>\-\-</start>
<end>\n</end>
<EscapeChar>\</EscapeChar>
<regex>\-\-(.|\\[\\\n])*?$</regex>
</rule>
<rule name="doubleQuteText">
<color>doubleQuoteText</color>
<start>"</start>
<end>"</end>
<EscapeChar>\</EscapeChar>
<regex>&quot;(.|\\[\\&quot;])*?&quot;</regex>
</rule>
<rule name="simpleQuteText">
<color>doubleQuoteText</color>
<start>'</start>
<end>'</end>
<regex>&apos;(.|\\[\\&apos;])*?&apos;</regex>
</rule>
</pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword">
<color>keyword</color>
<start>\@and|break|do|else|elseif|end|for|function|if|in|local|nil|not|or|repeat|return|then|until|while\@</start>
<regex>\b(and|break|do|else|elseif|end|for|function|if|in|local|nil|not|or|repeat|return|then|until|while)\b</regex>
</rule>
<rule name="numeric constant">
<color>number</color>
<start>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</start>
<regex>\b(((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?)\b</regex>
</rule>
<rule name="my boolean">
<color>boolean</color>
<start>\@true|false\@</start>
<regex>\b(true|false)\b</regex>
</rule>
<rule name="BIG LETTER">
<color>macro</color>
<start>\@[A-Z_][A-Z_0-9]{3,500}\@</start>
<regex>\b([A-Z_][A-Z_0-9]{3,500})\b</regex>
</rule>
<rule name="Function name">
<color>functionName</color>
<start>\@(\w|_)+[ \t]*\(</start>
<regex>\b(\w|_)+[ \t]*\(</regex>
</rule>
<rule name="condition">
<color>boolean</color>
<start>==|&lt;=|&gt;=|~=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}|</start>
<regex>==|&lt;=|&gt;=|~=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}</regex>
</rule>
</pass2>
</EdnLang>

View File

@ -1,31 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<EdnLang version="0.1" lang="Makefiles">
<ext>Makefile</ext>
<ext>*.mk</ext>
<ext>*.global</ext>
<ext>.*\.(mk|global)</ext>
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="my preprocesseur">
<color>preprocesseur</color>
<start>#</start>
<end>\n</end>
<EscapeChar>\</EscapeChar>
<regex>#(.|\\[\\\n])*?$</regex>
</rule>
<rule name="doubleQuteText">
<color>doubleQuoteText</color>
<start>"</start>
<end>"</end>
<EscapeChar>\</EscapeChar>
<regex>&quot;(.|\\[\\&quot;])*?&quot;</regex>
</rule>
<rule name="simpleQuteText">
<color>doubleQuoteText</color>
<start>'</start>
<end>'</end>
<regex>&apos;(.|\\[\\&apos;])*?&apos;</regex>
</rule>
</pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="confition">
<color>type</color>
<regex>\b(if|ifeq|ifneq|else|endif|define|endef)\b</regex>
</rule>
<rule name="my keyword">
<color>keyword</color>
<start>\$\([a-zA-Z_][a-zA-Z0-9_]*\)</start>
<regex>\b\([a-zA-Z_][a-zA-Z0-9_]*\)</regex>
</rule>
<rule name="function call">
<color>functionName</color>
<regex>\$\((call|info|error|warning|shell|patsubst|lastword|wildcard|addprefix|foreach|subst|word|eval)</regex>
</rule>
<rule name="condition">
<color>boolean</color>
<regex>:=|\?=|!=|=</regex>
</rule>
</pass2>
</EdnLang>

View File

@ -1,62 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<EdnLang version="0.1" lang="matlab">
<ext>*.m</ext>
<ext>*.M</ext>
<EdnLang version="0.1" lang="Matlab">
<ext>.*\.(m|M)</ext>
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="my comment doxygen">
<color>commentDoxygen</color>
<start>%%</start>
<end>\n</end>
<regex>%%(.|\\[\\\n])*?$</regex>
</rule>
<rule name="my comment">
<color>comment</color>
<start>%</start>
<end>\n</end>
<EscapeChar>\</EscapeChar>
<regex>%(.|\\[\\\n])*?$</regex>
</rule>
<rule name="doubleQuteText">
<color>doubleQuoteText</color>
<start> "</start>
<end>("|\n)</end>
<EscapeChar>\</EscapeChar>
<regex> &quot;.*?($|&quot;)</regex>
</rule>
<rule name="simpleQuteText">
<color>doubleQuoteText</color>
<start> '</start>
<end>('|\n)</end>
<!--<EscapeChar>\</EscapeChar>-->
<regex> &apos;.*?($|&apos;)</regex>
</rule>
<rule name="global inclusion">
<color>preprocesseur</color>
<start>global( |\t)+</start>
<end>\n</end>
<EscapeChar>\</EscapeChar>
<regex>global( |\t)+(.|\\[\\\n])*?$</regex>
</rule>
</pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword">
<color>keyword</color>
<start>\@return|goto|if|else|case|default|switch|break|continue|while|do|for|otherwise|end\@</start>
<regex>\b(return|goto|if|else|case|default|switch|break|continue|while|do|for|otherwise|end)\b</regex>
</rule>
<rule name="my boolean">
<color>boolean</color>
<start>\@true|false\@</start>
<regex>\b(true|false)\b</regex>
</rule>
<rule name="Function name">
<color>functionName</color>
<start>\@(\w|_)+[ \t]*\(</start>
<regex>\b(\w|_)+[ \t]*\(</regex>
</rule>
<rule name="condition">
<color>boolean</color>
<start>==|&lt;=|&gt;=|!=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}|</start>
<regex>==|&lt;=|&gt;=|!=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}</regex>
</rule>
<rule name="numeric constant">
<color>number</color>
<start>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</start>
<regex>\b(((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?)\b</regex>
</rule>
<rule name="BIG LETTER">
<color>macro</color>
<start>\@[A-Z_][A-Z_0-9]{3,500}\@</start>
<regex>\b([A-Z_][A-Z_0-9]{3,500})\b</regex>
</rule>
</pass2>
</EdnLang>

Some files were not shown because too many files have changed in this diff Show More