Compare commits

...

489 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
450fc0532d [DEBUG] correction of the read write access in the buffer system 2012-11-08 08:43:18 +01:00
841f23a2db [DEV] permit to change the display 2012-11-06 18:08:44 +01:00
858fd3a428 [DEV] cghange the basic Idea of the basic env variable 2012-11-04 15:46:13 +01:00
4514239076 [DEV] Change error display in the manager 2012-11-02 18:06:14 +01:00
8fdeb39b5a [DEV] update to etk::FSNode 2012-11-01 10:48:27 +01:00
eac1f8f594 [DEV] update the config file and the project management 2012-10-27 17:43:10 +02:00
0ba1c33525 [DEV] change the compilation Basic flag in the basic makefile 2012-10-27 01:25:51 +02:00
e88bfb0f0b [DEV] start the copy of files 2012-10-26 18:02:27 +02:00
2031631b77 [DEV] Change the ETK vector and matrix 2012-10-26 16:56:53 +02:00
708e8794a0 [DEBUG] set back an other font to display for test 2012-10-25 18:12:23 +02:00
64edc96eb0 [DEV] add glsl file parsing 2012-10-25 12:05:36 +02:00
79d95a8554 [DEBUG] lower the level debug of the Undo Redo when empty 2012-10-25 11:55:01 +02:00
377662c3a0 [DEBUG] missing copy of the share 2012-10-24 09:23:42 +02:00
8afe7a16f8 [DEV] change the environement of the short-cut ==> only on the code-viewer 2012-10-23 17:47:31 +02:00
2266ba7040 [DEV] Do not display more text than needed 2012-10-19 15:18:20 +02:00
2e96e5bfb1 Reorder the buffer list system 2012-10-18 11:09:19 +02:00
667fe86dc7 [DEV] display line of the CTAGS 2012-10-17 13:31:09 +02:00
e383600df6 [DEV] the Ctags is now availlable inmultiple files 2012-10-17 10:24:23 +02:00
33a36fa0f7 [DEV][CTAGS] integration of the first ewol display version 2012-10-16 18:32:21 +02:00
7aa4f9ae4d [DEV] set the reload of the shader 2012-10-11 18:05:56 +02:00
ecced51f81 small modif in the debug log 2012-10-09 18:00:44 +02:00
6e2df2dc77 Set the distance field test in compilation flags 2012-10-09 09:40:11 +02:00
fc129e2745 update config 2012-09-14 17:24:31 +02:00
5696539e2d cange android system generation 2012-09-12 18:24:26 +02:00
dbcde77a61 change config files* 2012-09-11 18:22:05 +02:00
e5e2ccc56f change android compialtion 2012-09-09 23:39:08 +02:00
dab060c4fe display of the special font work.... 2012-09-07 16:31:49 +02:00
3bdc96097c display big distance field 2012-09-06 18:42:57 +02:00
6ed410d936 First test of the distance field methode for the font 2012-09-06 02:48:41 +02:00
9587e21498 the android specific file is compile internly at ewol 2012-09-04 10:14:32 +02:00
244b83ed16 Change makefile principe and rework the mouse position event 2012-08-31 16:46:57 +02:00
27db00a6f6 some Windows correction 2012-08-31 01:30:34 +02:00
d4f313a54d Request of openGl 2 done corectly 2012-08-30 13:36:27 +02:00
29a5f34a3a update manifest to force request of openGL ES 2 2012-08-30 01:27:04 +02:00
4a916418d7 some change on ewol 2012-08-28 18:11:17 +02:00
f51ea408fa change the resources manager system 2012-08-26 22:44:33 +02:00
cd3968dd20 codeView error in touche mode specific system 2012-08-23 14:12:22 +02:00
76cd7bef21 Ewol change the idea of how the Font are managed 2012-08-22 18:18:59 +02:00
e27720372b remove management of color from etk to agg lib 2012-08-21 18:17:09 +02:00
6f10243046 update to ewol 0.3.4 ==> change the arbo 2012-08-20 18:12:14 +02:00
ae9c0f8eeb adapt at the new OS abstraction 2012-08-19 16:56:59 +02:00
699564e17f change the clipboard system (normalisation and standardisation 2012-08-18 21:06:21 +02:00
0fc8934d93 ewol change his time API 2012-08-16 18:22:10 +02:00
04c86769d6 Reorganise the internal data of this repository 2012-08-15 23:11:44 +02:00
d3e963749b change install on PC basic folder 2012-08-15 11:48:23 +02:00
9640f3c527 change the color_ts in a better class anc rename VectorType in Vector 2012-08-14 16:11:09 +02:00
c992d4a830 orthograph correction of redraw 2012-08-14 08:58:56 +02:00
761fabbac8 direct remove of the widget to simplify the system 2012-08-13 18:00:30 +02:00
2a7a0d0d9b remove the double buffering 2012-08-10 17:27:32 +02:00
c36a9d21f3 Simplify makefiles 2012-08-10 12:11:28 +02:00
96047c36e8 Compilation on Android availlable 2012-08-09 18:33:35 +02:00
a20f3e4063 Revert "STANDARD ==> remove vector type and replace with std::vector (done but sone assertion)" ==> bad idea
This reverts commit 4012d75279df3f5226373a9d33a1df1372db71d5.
2012-08-09 14:26:30 +02:00
7ee4747cc2 DEV : try to compile Android directly 2012-08-08 18:22:01 +02:00
4012d75279 STANDARD ==> remove vector type and replace with std::vector (done but sone assertion) 2012-08-07 18:05:02 +02:00
d58bda6896 back compile android 2012-07-25 21:55:34 +02:00
64be551b35 simplify the EObject class 2012-07-24 17:48:18 +02:00
53c34d0894 add About at the parametyer display 2012-07-24 13:01:40 +02:00
9de7bafcb5 First parameter display 2012-07-23 17:21:44 +02:00
1d3ed3f200 update the readme documentation 2012-07-23 14:59:19 +02:00
694e73a29c installer no more availlable due to the new buld system 2012-07-23 09:02:51 +02:00
0dbef0d349 start update avancement.boo 2012-07-22 22:19:57 +02:00
4e7eac1399 Gui is back to normal 2012-07-20 14:37:46 +02:00
12cd1db0e1 first step to update to the OpenGl real orientation 2012-07-19 18:13:21 +02:00
ae2bea1918 Update to the new drawing mode 2012-07-19 16:54:44 +02:00
d1708610c7 Start of the dev of the Parameter section 2012-07-18 18:21:21 +02:00
628c10ff3a Change the close position of the search windows 2012-07-17 13:27:16 +02:00
e10e633949 update the focus metode to the search windows 2012-07-17 13:25:33 +02:00
750e663eca update to the new compilation system for Linux 2012-07-16 17:59:56 +02:00
33c6de5450 small bug 2012-07-13 18:12:14 +02:00
0d4b7188c0 add highlight of the .in files 2012-07-10 12:28:28 +02:00
10d0fb5674 Better search bar 2012-07-03 16:59:22 +02:00
fee00e79c7 set search element in basic image ... 2012-07-02 17:40:49 +02:00
7146a00371 try to simplify 'buffer' manager 2012-07-01 21:43:57 +02:00
2e974251fa Search is back 2012-07-01 17:54:50 +02:00
0d79b55112 remove etkFloat_t element and coord2D_ts with float and Vector2D<float> 2012-07-01 10:13:24 +02:00
df8d2772da add lua parser 2012-05-30 14:16:45 +02:00
aea60950ff Change the image needed in edn 2012-05-29 12:57:07 +02:00
a210af5627 [BREAK compatibility] Update to the new input call function 2012-05-22 09:49:11 +02:00
c594be7a5f scrolling bar in codeView 2012-05-15 13:03:45 +02:00
d19586c4d8 nomenclature of space corection 2012-05-13 21:28:59 +02:00
e5a06889b6 Missing File.svg 2012-05-13 09:46:33 +02:00
4676ea0a63 Remove unnedded code in the application interface 2012-05-13 09:44:18 +02:00
8e4e0a52b6 Correction of the buffer remove ==> no more selectable buffer 2012-05-12 08:58:05 +02:00
65b0fc5b19 select the good buffer when opening a new file 2012-05-10 17:48:23 +02:00
f390a594a3 Not open a file previously opened 2012-05-10 17:47:52 +02:00
bbb1ea0a93 Save the Display position for every buffer opened to restore the position the next time 2012-05-10 16:01:03 +02:00
277045cde4 Corection of the basic install script 2012-05-10 12:00:22 +02:00
11e10e6db8 Add the search element needed 2012-05-10 11:57:24 +02:00
c2729b4c67 Remove the Buffer ID and the modification state ==> earn space 2012-05-10 11:51:51 +02:00
6340cc409e Compilation error on Linux and Android correction 2012-05-10 11:50:58 +02:00
4821093048 Rework search icone to work corectly 2012-05-10 11:50:11 +02:00
a904f30b34 add a simple install script and corection of the release folder selection 2012-05-02 18:22:32 +02:00
21b786f920 better buffer display and select the good folder in the open file 2012-04-29 15:19:36 +02:00
a0f3beba5c add debug mode in the compilation of the application 2012-04-25 18:47:34 +02:00
a3c58a6c33 Add the maximum size of the current text edition 2012-04-24 13:36:25 +02:00
845232656b Moving the scrolling windows is ok when moving cursor 2012-04-24 13:17:04 +02:00
cd2b72d369 change some file position 2012-04-24 09:42:14 +02:00
5cc4a1a779 Change the color management use uint32_t instead of 4 float 2012-04-23 17:05:56 +02:00
586cd62f44 Some change in the organisation files 2012-04-23 13:03:55 +02:00
5d1837eb69 Normalisation with etk application 2012-04-23 10:15:43 +02:00
247aac0684 missing flag 2012-04-18 18:13:37 +02:00
13e2af9125 Charset management is back 2012-04-17 11:01:26 +02:00
dde852cbe1 Select all/none, Undo/Redo 2012-04-16 17:38:48 +02:00
a01c87e49b Some change in EWOL 2012-04-11 01:35:55 +02:00
28ddde0c83 Remove local clipboard and better scolling in codeView 2012-04-05 18:28:15 +02:00
5e86641caf Copy/cut/paste is back 2012-04-05 16:16:08 +02:00
c75fb80736 work on the copy/past on ewol 2012-04-04 18:18:27 +02:00
f2bcd9052b Update the basic Makefile 2012-03-29 17:48:48 +02:00
de9d630fee work fine is back on android 2012-03-29 10:01:00 +02:00
a99eba9a1f Add some svg files and display it in the menu 2012-03-28 18:11:43 +02:00
2997133eee Update to the new system of internal patch for -RTTI in debug mode 2012-03-14 09:26:14 +01:00
495cab7d27 adapte the EObject type management 2012-03-13 14:37:05 +01:00
e6ee6e0cd1 Log name error 2012-03-12 17:59:56 +01:00
3372645356 simple comment 2012-03-11 20:49:35 +01:00
188bd69f06 ewol normalisation 2012-03-09 18:08:08 +01:00
0ab5588a93 Remove deprecated type 2012-03-08 18:01:50 +01:00
df3c97b17e minor modif 2012-03-05 00:09:47 +01:00
03cb9d7cbd clean the buffer text 2012-03-02 16:42:44 +01:00
c8b9b37c8e corection of the pointer mouse event 2012-03-02 09:47:33 +01:00
75f56d52d4 Strat simplify of the buffer access 2012-03-01 18:23:45 +01:00
f6f8679b76 Rework of EWOL (Step 3) 2012-02-29 18:06:08 +01:00
ae113a8a2f Rework of EWOL (Step 2) 2012-02-28 18:22:49 +01:00
45f37a0c4b Rework of EWOL (Step 1) 2012-02-27 18:15:56 +01:00
02e7de2397 Display the frst line number 2012-02-24 17:24:53 +01:00
ea344225e3 add the really basic shortcut ... 2012-02-24 12:45:39 +01:00
40d6de087b change text display 2012-02-23 22:34:12 +01:00
7bf7668686 change the filename in the title 2012-02-23 18:05:57 +01:00
e2e0fc25d3 change the clipping with the viewport 2012-02-23 13:43:57 +01:00
9f2718f97a remove the last singleton to create the basic namespace 2012-02-20 20:30:26 +01:00
a943ddd4f7 start remove of singleton 2012-02-19 22:33:43 +01:00
fced6df123 error android compilation for the reintrepreted cast 2012-02-19 18:52:17 +01:00
a4d314723d Better display 2012-02-19 15:48:08 +01:00
f716055c40 Remove all the capabilities at the Widget main classes 2012-02-18 22:20:53 +01:00
0a11251ccc Optimise the display of the CodeViewer ==> usable on Android 2012-02-18 15:56:00 +01:00
0d0afec709 Display the processing time of the text buffer 2012-02-18 11:50:29 +01:00
1894f56217 Change tree ==> simplify 2012-02-18 00:35:15 +01:00
4e7491e5fc display of menu correct 2012-02-17 18:25:38 +01:00
dc73285cb7 update to the new menu 2012-02-16 23:29:48 +01:00
5d7870248d Some update 2012-02-16 18:18:04 +01:00
4b16540744 Remove old test 2012-02-15 23:07:55 +01:00
f0cda0de78 Change the Sting un Unicode management 2012-02-15 16:23:20 +01:00
e21e7e7c21 add save as and start of Unicode string adaptation 2012-02-14 19:29:53 +01:00
cd84475aea Uniformisation of the UNICODE in the soft 2012-02-13 18:03:09 +01:00
71fa38d61e remove dead code 2012-02-12 22:36:59 +01:00
fdd4ddf978 manage the tablette scrolling 2012-02-11 11:18:27 +01:00
f610c23638 Remove deprecated code 2012-02-10 18:20:03 +01:00
610afddc9d Update the message list and open/Save(as) files 2012-02-09 17:20:52 +01:00
4038dd74af Add basic close and save event generation 2012-02-08 18:05:19 +01:00
8ba3e2e3d4 Change the redraw methode of the code viewer ==> reparse every time needed the line in the buffer for the second pass of highlight 2012-02-07 18:04:15 +01:00
7734a8ce36 start Abstraction of the scrooling windows 2012-02-06 17:59:48 +01:00
d088866891 change the system to open file message 2012-02-05 22:03:36 +01:00
0341795cbb Add the display of the buffer list and change some generic event of the edn system.
Add the text display with a different font ==> must rework all the event X/Y position of the mouse
2012-02-03 18:14:45 +01:00
9e0720b476 Add the cmdline argument in the init 2012-02-02 18:19:31 +01:00
8bce8893e8 Change the basic font 2012-02-01 18:24:23 +01:00
d2cb4a47b7 Change message system and threaded the system 2012-01-31 18:26:04 +01:00
65b288813e corrction of the missing log in android and remove the pb with the rotation remove context of open GL 2012-01-27 02:04:02 +01:00
7bad5d42f2 Start to add the thread between the interface and the system 2012-01-26 18:13:43 +01:00
fda95289bd try error 2012-01-25 23:32:14 +01:00
102e11b74a First port of edn on the android platform ==> can do nothing but not crach every 10 second 2012-01-25 18:30:33 +01:00
ee80871434 Add the display of the space and tabulation 2012-01-24 23:50:23 +01:00
43c3092fe3 update the methode of calculation of the mouse event 2012-01-24 23:35:17 +01:00
d05d82ba7b Display is now ready to manage the Unicode and the multiple size font 2012-01-24 17:54:16 +01:00
6052df85dc bad day 2012-01-23 12:41:40 +01:00
a9eb976b48 Remove Keybord special key to the abstraction layer 2012-01-19 18:14:57 +01:00
411bf03e74 Correction of the CR comming from X11 2012-01-18 22:56:14 +01:00
a53903d628 Start the change of the display methode 2012-01-18 18:54:55 +01:00
f3bf0b557c Display none Mono-space Text 2012-01-18 14:31:33 +01:00
6f6b0a6f7f Add shortcut and management of move event in codeViewer 2012-01-17 15:35:34 +01:00
43d8aaef48 Display a correct cursor 2012-01-17 09:52:50 +01:00
9c9eac7d37 Text background correction done 2012-01-17 09:39:38 +01:00
c61876b919 Some correction of the Display color is now availlable 2012-01-16 14:37:28 +01:00
10ceb14268 Add and remove char in the buffer 2012-01-15 16:09:32 +01:00
8c014312c6 Scrool up and down and click availlable ==> no display 2012-01-15 15:42:01 +01:00
01868a2114 First display in open GL 2012-01-15 14:15:24 +01:00
bd7aa98324 Starting integration of the main display in EWOL system 2012-01-13 13:06:15 +01:00
70837bd769 First compilation of edn with ewol ==> did not work at all 2012-01-11 15:27:18 +01:00
2d355d05c6 First move for ewol adaptation 2012-01-11 12:51:26 +01:00
a6e583f8c9 Remove deprecated files before the ewol adaptation 2012-01-11 12:08:00 +01:00
870e127932 Add java language parsing based on C language.
Yes I did not like JAVA, but I needed it for the Android application
2011-12-01 09:59:46 +01:00
a351fe72bd Add Edn at the list of the gnome software 2011-11-24 16:50:04 +01:00
9b7707cf9a Display: change the internal title display 2011-11-02 09:09:20 +01:00
heero
a03fb96dc9 Display: corection of the first line selection error 2011-10-16 15:17:45 +02:00
863fab113b add patch correction done in branch display line by line
stop the developpement of the display line by line because it did not work corectly and was a little cpu leacher, the display has maany error and the comphehention is hard.
2011-10-11 14:06:36 +02:00
83dd23b8a9 try to find the error of italic, it seam that cairo does not support monospace italic 2011-09-06 17:05:06 +02:00
2714560c38 SYS : Indent with TAB only when multiple line selected 2011-09-06 09:11:51 +02:00
e48c75df72 gui : Add the current folder in the title area 2011-09-05 10:02:17 +02:00
1de1f787e7 sys : corection of the keypad enter and add the shift+enter replacement with \r 2011-09-05 09:50:15 +02:00
1b3dd3ce98 SYS : catch the shift+tab event 2011-09-04 12:08:48 +02:00
0e6c34d2a0 change the avancement list ==> set it to mabage future version developement 2011-09-04 11:23:01 +02:00
325034bbc0 HL : add bash elif 2011-09-02 17:22:07 +02:00
fc9b98f09e TEST : color changing of menu 2011-09-01 17:58:04 +02:00
a497b028ca GUI : update the display of the about windows to use gtk:about 2011-09-01 16:04:12 +02:00
375 changed files with 25140 additions and 28656 deletions

12
.gitignore vendored
View File

@ -2,11 +2,9 @@
###################################
# folders
###################################
CVS
.svn
Object/
doxygen/API/
doxygen/ALL/
.gitk-tmp.*
out/
Sources/ewolAndroidAbstraction.cpp
###################################
# backup files
@ -27,10 +25,6 @@ doxygen/ALL/
*.so
*.pyc
tags
edn
out
edn_debug
edn_release
###################################
# Packages #

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>.

336
Makefile
View File

@ -1,336 +0,0 @@
##################################################################################################################
# #
# Fichier : Makefile #
# #
# Type : Makefile d'un programme complet #
# #
# Auteur : Heero Yui #
# #
# Evolutions : Date Auteur Raison #
# 2010-01-29 Heero Yui Mise en place d'un makefile ultra simple #
# 2011-07-14 Heero Yui Rework the current dorder includion (simplification) #
# #
# Notes : This makefile might be edited with an editor compatible with escape char and carrer return #
# char #
# #
# Concu Pour le projet edn #
# #
##################################################################################################################
export F_GRAS=
export F_INVERSER=
export F_SOUSLIGNER=
export F_NORMALE=
export F_NOIR=
export F_ROUGE=
export F_VERT=
export F_MARRON=
export F_BLUE=
export F_VIOLET=
export F_CYAN=
export F_GRIS=
export CADRE_HAUT_BAS=' $(F_INVERSER) $(F_NORMALE)'
export CADRE_COTERS=' $(F_INVERSER) $(F_NORMALE) $(F_INVERSER) $(F_NORMALE)'
VERSION_TAG=$(shell git describe --tags)
#$(info $(VERSION_TAG))
VERSION_TAG_SHORT=$(shell git describe --tags --abbrev=0)
#$(info $(VERSION_TAG_SHORT))
VERSION_BUILD_TIME=$(shell date)
#$(info $(VERSION_BUILD_TIME))
###############################################################################
### Compilateur base system ###
###############################################################################
CXX=g++
CC=gcc
AR=ar
DEBUG:=1
###############################################################################
### Compilation Define ###
###############################################################################
ifeq ("$(DEBUG)", "0")
DEFINE= -DEDN_DEBUG_LEVEL=1 -DNDEBUG -DVERSION_TAG_NAME="\"$(VERSION_TAG)-debug\""
else
DEFINE= -DEDN_DEBUG_LEVEL=3 -DVERSION_TAG_NAME="\"$(VERSION_TAG)-release\""
endif
DEFINE+= -DVERSION_BUILD_TIME="\"$(VERSION_BUILD_TIME)\""
GTKFLAGS=
ifeq ($(shell if `pkg-config --exists gtk+-3.0` ; then echo "yes"; else echo "no"; fi), yes)
GTKFLAGS= `pkg-config --cflags --libs gtk+-3.0` -DUSE_GTK_VERSION_3_0
else
ifeq ($(shell if `pkg-config --exists gtk+-2.0` ; then echo "yes"; else echo "no"; fi), yes)
GTKFLAGS= `pkg-config --cflags --libs gtk+-2.0` -DUSE_GTK_VERSION_2_0
else
$(error No GTK 3.0 or 2.0 librairies ...)
endif
endif
###############################################################################
### Basic Cfags ###
###############################################################################
# basic GTK librairy
CXXFLAGS= $(GTKFLAGS)
# Linux thread system
CXXFLAGS+= -lpthread
# Enable debug (cgdb edn)
CXXFLAGS+= -g -O0
#CXXFLAGS+= -O2
# display all flags
CXXFLAGS+= -Wall
# ...
CXXFLAGS+= -D_REENTRANT
# internal defines
CXXFLAGS+= $(DEFINE)
CFLAGS= $(CXXFLAGS) -std=c99
# basic GTK librairy
LDFLAGS= $(GTKFLAGS)
# Linux thread system
LDFLAGS+= -lpthread
# Dynamic connection of the CALLBACK of the GUI
LDFLAGS+= -Wl,--export-dynamic
###############################################################################
### Project Name ###
###############################################################################
PROG_NAME=edn
###############################################################################
### Basic Project description Files ###
###############################################################################
FILE_DIRECTORY=Sources
OUTPUT_NAME_RELEASE=$(PROG_NAME)_release
OUTPUT_NAME_DEBUG=$(PROG_NAME)_debug
OBJECT_DIR=Object
ifeq ("$(DEBUG)", "0")
OBJECT_DIRECTORY=$(OBJECT_DIR)/release
OUTPUT_NAME = $(OUTPUT_NAME_RELEASE)
else
OBJECT_DIRECTORY=$(OBJECT_DIR)/debug
OUTPUT_NAME = $(OUTPUT_NAME_DEBUG)
endif
###############################################################################
### Generique dependency ###
###############################################################################
MAKE_DEPENDENCE=Makefile
###############################################################################
### Files Listes ###
###############################################################################
# tiny XML (extern OPEN Sources) :
CXXFILES = tools/tinyXML/tinyxml.cpp \
tools/tinyXML/tinyxmlparser.cpp \
tools/tinyXML/tinyxmlerror.cpp \
tools/tinyXML/tinystr.cpp
# ExuberantCtags reading file tools (extern OPEN Sources) :
CXXFILES+= ctags/readtags.cpp \
ctags/CTagsManager.cpp
# Globals debug tool:
CXXFILES+= tools/debug/tools_debug.cpp \
tools/globals/tools_globals.cpp \
tools/memory/toolsMemory.cpp
# Buffers internal:
CXXFILES+= tools/EdnTemplate/EdnVectorBuf.cpp \
tools/EdnBuf/EdnBuf.cpp \
tools/EdnBuf/EdnBuf_HighLight.cpp \
tools/EdnBuf/EdnBuf_History.cpp \
tools/EdnBuf/EdnBuf_Selection.cpp \
tools/EdnBuf/EdnBufHistory.cpp
# Tools internal:
CXXFILES+= tools/Display/Display.cpp \
tools/ClipBoard/ClipBoard.cpp \
tools/MsgBroadcast/MsgBroadcast.cpp \
tools/MsgBroadcast/AccelKey.cpp \
tools/charset/charsetTable.cpp \
tools/charset/charset.cpp \
tools/NameSpaceEdn/File.cpp \
tools/NameSpaceEdn/String.cpp \
tools/NameSpaceEdn/RegExp.cpp
# Gui:
CXXFILES+= CustumWidget/BufferView/BufferView.cpp \
CustumWidget/CodeView/CodeView.cpp \
GuiTools/WindowsManager/WindowsManager.cpp \
GuiTools/MainWindows/MainWindows.cpp \
GuiTools/MainWindows/StatusBar.cpp \
GuiTools/MainWindows/MenuBar.cpp \
GuiTools/MainWindows/ToolBar.cpp \
GuiTools/Search/Search.cpp \
GuiTools/Search/SearchData.cpp
# Basic Interface :
CXXFILES+= Buffer/Buffer.cpp \
Buffer/BufferText.cpp \
Buffer/BufferEmpty.cpp \
Buffer/BufferManager.cpp \
Colorize/Colorize.cpp \
Colorize/ColorizeManager.cpp \
Highlight/HighlightPattern.cpp \
Highlight/Highlight.cpp \
Highlight/HighlightManager.cpp
# Main entry file :
CXXFILES+= init.cpp
###############################################################################
### Liste of folder where .h can be ###
###############################################################################
LISTE_MODULES = $(dir $(CXXFILES))
INCLUDE_DIRECTORY = $(addprefix -I$(FILE_DIRECTORY)/, $(LISTE_MODULES))
###############################################################################
### Build Object Files List ###
###############################################################################
OBJ = $(addprefix $(OBJECT_DIRECTORY)/, $(CXXFILES:.cpp=.o))
###############################################################################
### Main Part of Makefile ###
###############################################################################
all: build
-include $(OBJ:.o=.d)
build: .encadrer .versionFile $(OUTPUT_NAME)
.encadrer:
@echo $(CADRE_HAUT_BAS)
@echo $(CADRE_COTERS)
@echo ' DEBUT DE COMPILATION DU PROGRAMME :'$(CADRE_COTERS)
@echo ' Repertoire Sources : $(FILE_DIRECTORY)/'$(CADRE_COTERS)
@echo ' Repertoire object : $(OBJECT_DIRECTORY)/'$(CADRE_COTERS)
@echo ' Binaire de sortie : $(F_VIOLET)$(OUTPUT_NAME) $(F_NORMALE)'$(CADRE_COTERS)
@echo $(CADRE_COTERS)
@echo $(CADRE_HAUT_BAS)
@mkdir -p $(addprefix $(OBJECT_DIRECTORY)/, $(LISTE_MODULES))
FILE_IMAGES= data/imagesSources/*.png
.versionFile :
@rm -f $(OBJECT_DIRECTORY)/GuiTools/WindowsManager/WindowsManager.o
# Tool used to create a binary version of every element png or other needed by the application
pngToCpp: tools/pngToCpp/pngToCpp.c
@echo $(F_ROUGE)" (bin) $@"$(F_NORMALE)
@$(CXX) $< -o $@
@strip -s $@
# Generate basic
$(FILE_DIRECTORY)/GuiTools/myImage.cpp: $(FILE_IMAGES) $(MAKE_DEPENDENCE) pngToCpp
@echo $(F_BLUE)" (.cpp) *.png ==> $@"$(F_NORMALE)
@./pngToCpp $@ $(FILE_IMAGES)
# build C++
$(OBJECT_DIRECTORY)/%.o: $(FILE_DIRECTORY)/%.cpp $(MAKE_DEPENDENCE)
@echo $(F_VERT)" (.o) $<"$(F_NORMALE)
@$(CXX) $< -c -o $@ $(INCLUDE_DIRECTORY) $(CXXFLAGS) -MMD
# build binary Release Mode
$(OUTPUT_NAME_RELEASE): $(OBJ) $(MAKE_DEPENDENCE)
@echo $(F_ROUGE)" (bin) $@ "$(F_NORMALE)
@$(CXX) $(OBJ) $(LDFLAGS) -o $@
@cp $@ $(PROG_NAME)
# build binary Debug Mode
$(OUTPUT_NAME_DEBUG): $(OBJ) $(MAKE_DEPENDENCE)
@echo $(F_ROUGE)" (bin) $@ "$(F_NORMALE)
@$(CXX) $(OBJ) $(LDFLAGS) -o $@
@cp $@ $(PROG_NAME)
clean:
@echo $(CADRE_HAUT_BAS)
@echo ' CLEANING : $(F_VIOLET)$(OUTPUT_NAME)$(F_NORMALE)'$(CADRE_COTERS)
@echo $(CADRE_HAUT_BAS)
@echo Remove Folder : $(OBJECT_DIR)
@rm -rf $(OBJECT_DIR)
@echo Remove File : $(PROG_NAME) $(OUTPUT_NAME_DEBUG) $(OUTPUT_NAME_RELEASE)
@rm -f $(PROG_NAME) $(OUTPUT_NAME_DEBUG) $(OUTPUT_NAME_RELEASE)
@echo Remove File : pngToCpp
@rm -f pngToCpp
@echo Remove File : $(FILE_DIRECTORY)/GuiTools/myImage.*
@rm -f $(FILE_DIRECTORY)/GuiTools/myImage.*
@echo Remove doxygen files : doxygen/*
@rm -rf doxygen
@rm -f doxygen.log
@echo Remove temporary files *.bck
@rm -f `find . -name "*.bck"`
count:
wc -l Makefile `find $(FILE_DIRECTORY)/ -name "*.cpp"` `find $(FILE_DIRECTORY)/ -name "*.h"`
install: .encadrer .versionFile $(OUTPUT_NAME_RELEASE)
@echo $(CADRE_HAUT_BAS)
@echo ' INSTALL : $(F_VIOLET)$(OUTPUT_NAME_RELEASE)=>$(PROG_NAME)$(F_NORMALE)'$(CADRE_COTERS)
@echo $(CADRE_HAUT_BAS)
@echo $(F_ROUGE)" (stripped) $(OUTPUT_NAME_RELEASE) => $(PROG_NAME) "$(F_NORMALE)
@cp $(OUTPUT_NAME_RELEASE) $(PROG_NAME)
@strip -s $(PROG_NAME)
@echo $(F_VERT)" (copy) $(PROG_NAME) /usr/bin/ "$(F_NORMALE)
@cp -vf $(PROG_NAME) /usr/bin/
@echo $(F_VERT)" (data) data/* ==> /usr/share/edn/ "$(F_NORMALE)
@mkdir -p /usr/share/edn/
@rm -rf /usr/share/edn/*
@cp -vf data/*.xml /usr/share/edn/
@mkdir -p /usr/share/edn/images/
@cp -vf data/imagesSources/icone.png /usr/share/edn/images/
@cp -vf data/imagesSources/delete-24px.png /usr/share/edn/images/
# http://alp.developpez.com/tutoriels/debian/creer-paquet/
package: .encadrer
@echo 'Create Folders ...'
@mkdir -p package/$(PROG_NAME)/DEBIAN/
@mkdir -p package/$(PROG_NAME)/usr/bin/
@mkdir -p package/$(PROG_NAME)/usr/share/doc/
@mkdir -p package/$(PROG_NAME)/usr/share/edn/
# Create the control file
@echo "Package: "$(PROG_NAME) > package/$(PROG_NAME)/DEBIAN/control
@echo "Version: "$(VERSION_TAG_SHORT) >> package/$(PROG_NAME)/DEBIAN/control
@echo "Section: Development,Editors" >> package/$(PROG_NAME)/DEBIAN/control
@echo "Priority: optional" >>package/$(PROG_NAME)/DEBIAN/control
@echo "Architecture: all" >> package/$(PROG_NAME)/DEBIAN/control
@echo "Depends: bash" >> package/$(PROG_NAME)/DEBIAN/control
@echo "Maintainer: Mr DUPIN Edouard <yui.heero@gmail.com>" >> package/$(PROG_NAME)/DEBIAN/control
@echo "Description: Text editor for sources code with ctags management" >> package/$(PROG_NAME)/DEBIAN/control
@echo "" >> package/$(PROG_NAME)/DEBIAN/control
# Create the PostRm
@echo "#!/bin/bash" > package/$(PROG_NAME)/DEBIAN/postrm
@echo "rm ~/."$(PROG_NAME) >> package/$(PROG_NAME)/DEBIAN/postrm
@echo "" >> package/$(PROG_NAME)/DEBIAN/postrm
# Enable Execution in script
@chmod 755 package/$(PROG_NAME)/DEBIAN/post*
@#chmod 755 package/$(PROG_NAME)/DEBIAN/pre*
# copy licence and information :
@cp README package/$(PROG_NAME)/usr/share/doc/README
@cp licence.txt package/$(PROG_NAME)/usr/share/doc/copyright
@echo "First generation in progress" >> package/$(PROG_NAME)/usr/share/doc/changelog
@cp -vf $(PROG_NAME) package/$(PROG_NAME)/usr/bin/
@cp -vf data/*.xml package/$(PROG_NAME)/usr/share/edn/
@cd package; dpkg-deb --build $(PROG_NAME)

150
README.md
View File

@ -5,37 +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:
-----------------
git clone git://github.com/HeeroYui/edn.git
cd edn
see: http://source.android.com/source/downloading.html#installing-repo
Compile software and install :
mkdir ~/.bin
PATH=~/.bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
chmod a+x ~/.bin/repo
sudo make DEBUG=0 install
download Build system:
----------------------
Run Software :
sudo pip install lutin
sudo pip install pillow
edn exemple.txt
License
=======
download the Framework:
----------------------
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.
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:
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:
# generate binary, tree, package and install it ...
lutin -C -P edn?install
(Android) Compile software & install
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 ..
# 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
(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"
I reserve the right to change this licence. If it change the version of the copy you have keep its own license
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)
==================
Edn (Editeur De N'ours) : Source code editor
Copyright (C) Copyright 2010 Edouard DUPIN
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,373 +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 "tools_debug.h"
#include "tools_globals.h"
#include "Buffer.h"
#include "BufferManager.h"
#undef __class__
#define __class__ "Buffer"
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
Buffer::Buffer()
{
static int32_t fileBasicID = 0;
m_fileModify = true;
m_haveName = false;
Edn::String mString = "Untitle - ";
mString += fileBasicID++;
SetFileName(mString);
m_haveName = false;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
Buffer::Buffer(Edn::File &newName)
{
m_fileModify = false;
SetFileName(newName);
}
/**
* @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;
GeneralSendMessage(EDN_MSG__BUFFER_CHANGE_MODIFY);
}
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
// TODO : ne marche plus ...
void Buffer::Save(void)
{
// nothing to do
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void Buffer::GetInfo(infoStatBuffer_ts &infoToUpdate)
{
// nothing to do
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void Buffer::SetLineDisplay(uint32_t lineNumber)
{
// nothing to do
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
int32_t Buffer::Display(DrawerManager &drawer)
{
return ERR_NONE;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
* @todo : Set the move up and DOWN...
*
*/
void Buffer::MouseSelectFromCursorTo(int32_t width, int32_t height)
{
// nothing to do
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void Buffer::MouseEvent(int32_t width, int32_t height)
{
// nothing to do
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void Buffer::MouseEventDouble(void)
{
// nothing to do
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void Buffer::MouseEventTriple(void)
{
// nothing to do
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void Buffer::ScrollDown(void)
{
// nothing to do
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void Buffer::ScrollUp(void)
{
// nothing to do
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void Buffer::ForceReDraw(bool allElement)
{
// nothing to do
}
void Buffer::cursorMove(int32_t gtkKey)
{
// nothing to do
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void Buffer::AddChar(char * UTF8data)
{
// nothing to do
}
void Buffer::Search(Edn::String &data, bool back, bool caseSensitive, bool wrap, bool regExp)
{
// nothing to do
}
void Buffer::Replace(Edn::String &data)
{
// nothing to do
}
int32_t Buffer::FindLine(Edn::String &data)
{
// nothing to do
return 0;
}
void Buffer::JumpAtLine(int32_t newLine)
{
// nothing to do
}
/**
* @brief Get the current line (to know where to jump)
*
* @param ---
*
* @return Return the current line number
*
*/
int32_t Buffer::GetCurrentLine(void)
{
return 0;
}
/**
* @brief request a copy of the selection in the named clipBoard ID
*
* @param[in] clipboardID Id of the buffer we want to get data [0..10] (0 copy normal / 10 middle button)
*
* @return ---
*
*/
void Buffer::Copy(int8_t clipboardID)
{
// nothing to do
}
/**
* @brief Request a copy and a remove of the curent selection in the named clipBoard ID
*
* @param[in] clipboardID Id of the buffer we want to get data [0..10] (0 copy normal / 10 middle button)
*
* @return ---
*
*/
void Buffer::Cut(int8_t clipboardID)
{
// nothing to do
}
/**
* @brief request the past of a specific clipboard on the curent position or selection
*
* @param[in] clipboardID Id of the buffer we want to get data [0..10] (0 copy normal / 10 middle button)
*
* @return ---
*
*/
void Buffer::Paste(int8_t clipboardID)
{
// nothing to do
}
void Buffer::RemoveLine(void)
{
// nothing to do
}
void Buffer::SelectAll(void)
{
// nothing to do
}
void Buffer::SelectNone(void)
{
// nothing to do
}
void Buffer::Undo(void)
{
// nothing to do
}
void Buffer::Redo(void)
{
// nothing to do
}

View File

@ -1,121 +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 <string>
#include "Display.h"
#include "charset.h"
#include "Edn.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;
class Buffer {
public:
Buffer(void);
Buffer(Edn::File &newName);
virtual ~Buffer(void);
Edn::File GetFileName(void)
{
return m_fileName;
};
void SetFileName(Edn::File &newName)
{
m_fileName = newName;
m_haveName = true;
NameChange();
};
void SetFileName(Edn::String &newName)
{
m_fileName.SetCompleateName(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) { /*EDN_DEBUG("check name change ==> no HL change possible");*/};
public:
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate);
virtual void SetLineDisplay(uint32_t lineNumber);
virtual int32_t Display(DrawerManager &drawer);
virtual void ForceReDraw(bool allElement);
virtual void AddChar(char * UTF8data);
virtual void cursorMove(int32_t gtkKey);
virtual void MouseSelectFromCursorTo(int32_t width, int32_t height);
virtual void MouseEvent(int32_t width, int32_t height);
virtual void MouseEventDouble(void);
virtual void MouseEventTriple(void);
virtual void ScrollDown(void);
virtual void ScrollUp(void);
virtual void RemoveLine(void);
virtual void SelectAll(void);
virtual void SelectNone(void);
virtual void Undo(void);
virtual void Redo(void);
virtual void SetCharset(charset_te newCharset) {};
//virtual void SelectAll(void);
virtual void Copy(int8_t clipboardID);
virtual void Cut(int8_t clipboardID);
virtual void Paste(int8_t clipboardID);
virtual void Search(Edn::String &data, bool back, bool caseSensitive, bool wrap, bool regExp);
virtual void Replace(Edn::String &data);
virtual int32_t FindLine(Edn::String &data);
virtual void JumpAtLine(int32_t newLine);
virtual int32_t GetCurrentLine(void);
protected:
bool m_fileModify; //!<
// naming
Edn::File m_fileName; //!< filename of the curent buffer
bool m_haveName; //!< to know if the file have a name or NOT
};
#endif

View File

@ -1,98 +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 "tools_debug.h"
#include "tools_globals.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 ---
*
*/
int32_t BufferEmpty::Display(DrawerManager &drawer)
{
ColorizeManager * myColorManager = ColorizeManager::getInstance();
// Get color :
Colorize *myColor = NULL;
// Clean Buffer
drawer.Clean(myColorManager->Get(COLOR_CODE_BASIC_BG) );
myColor = myColorManager->Get("normal");
// Draw the 2 comments Lines :
drawer.Text(myColor, 20,20, "edn - Editeur De N'ours, l'Editeur Desoxyribo-Nucleique");
//drawer.Flush();
myColor = myColorManager->Get("commentDoxygen");
drawer.Text(myColor, 20,25 + Display::GetFontHeight(), "No Buffer Availlable to display");
drawer.Flush();
/*
myColor = myColorManager->Get(("SelectedText"));
drawer.Cursor(20, 50);
drawer.EndOfLine(20, 70);
drawer.Tabulation(myColor, 20, 90, 5);
drawer.UTF8UnknownElement(myColor, 20, 120, 3, false);
drawer.Flush();
*/
return ERR_NONE;
}

View File

@ -1,42 +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);
virtual int32_t Display(DrawerManager &drawer);
};
#endif

View File

@ -1,336 +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 "tools_debug.h"
#include "tools_globals.h"
#include "BufferManager.h"
//#include "MsgBroadcast.h"
#undef __class__
#define __class__ "BufferManager"
// Constructeur
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
BufferManager::BufferManager(void) : MsgBroadcast("Buffer Manager", EDN_CAT_BUFFER_MANAGER)
{
// nothing to do ...
BufferNotExiste = new BufferEmpty();
m_idSelected = -1;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
BufferManager::~BufferManager(void)
{
//clean All Buffer
EDN_INFO("~BufferManager::RemoveAll();");
RemoveAll();
// clear The list of Buffer
EDN_INFO("~BufferManager::listBuffer.Clear();");
listBuffer.Clear();
EDN_INFO("~BufferManager::delete(BufferNotExiste);");
delete(BufferNotExiste);
}
void BufferManager::OnMessage(int32_t id, int32_t dataID)
{
switch (id)
{
case EDN_MSG__BUFFER_CHANGE_CURRENT:
m_idSelected = dataID;
break;
case EDN_MSG__NEW:
{
int32_t newOne = Create();
if (-1 != newOne) {
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, newOne);
}
}
break;
case EDN_MSG__BUFF_ID_CLOSE:
// Check buffer existence
if(true == Exist(dataID)) {
// Get the new display buffer
if (m_idSelected == dataID) {
// Try previous buffer
int32_t destBuffer = -1;
for(int32_t ii=dataID-1; ii >= 0; ii--) {
if (true == Exist(ii) ) {
destBuffer = ii;
break;
}
}
//EDN_DEBUG("new buffer selected : ?? " << destBuffer);
// try next buffer
if (-1 == destBuffer) {
for(int32_t ii=dataID+1; ii < listBuffer.Size(); ii++) {
if (true == Exist(ii) ) {
destBuffer = ii;
break;
}
}
}
//EDN_DEBUG("new buffer selected : ?? " << destBuffer);
// set it to the currect display
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, destBuffer);
}
//EDN_DEBUG("Remove : " << dataID);
// Remove requested buffer
Remove(dataID);
}
break;
case EDN_MSG__BUFF_ID_SAVE:
// Check buffer existence
if(true == Exist(dataID)) {
// If no name ==> request a Gui display ...
if (Get(dataID)->HaveName() == false) {
SendMessage(EDN_MSG__GUI_SHOW_SAVE_AS, dataID);
} else {
Get(dataID)->Save();
}
}
break;
}
}
/**
* @brief Remove all buffer opened
*
* @param[in,out] ---
*
* @return ---
*
*/
void BufferManager::RemoveAll(void)
{
int32_t i;
for (i=0; i<listBuffer.Size(); i++) {
Remove(i);
}
SendMessage(EDN_MSG__BUFFER_REMOVE_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 BufferManager::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;
SendMessage(EDN_MSG__BUFFER_ADD, basicID);
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 BufferManager::Open(Edn::File &myFile)
{
// TODO : Check here if the file is already open ==> and display it if needed
// allocate a new Buffer
Buffer *myBuffer = new BufferText(myFile);
// Add at the list of element
listBuffer.PushBack(myBuffer);
int32_t basicID = listBuffer.Size() - 1;
SendMessage(EDN_MSG__BUFFER_ADD, basicID);
return basicID;
}
Buffer * BufferManager::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 {
EDN_ERROR("non existing Buffer " << BufferID);
}
} else {
EDN_ERROR("call an non existing Buffer number too hight : " << BufferID << " > " << listBuffer.Size());
}
return BufferNotExiste;
}
bool BufferManager::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 BufferManager::Exist(Edn::File &myFile )
{
if (-1 == GetId(myFile)) {
return false;
}
return true;
}
int32_t BufferManager::GetId(Edn::File &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 BufferManager::Size(void)
{
return listBuffer.Size();
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
bool BufferManager::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) ) {
EDN_INFO("Buffer " << BufferID << " : Not Saved", BufferID);
}
*/
// Delete the Buffer
delete( listBuffer[BufferID] );
listBuffer[BufferID] = NULL;
SendMessage(EDN_MSG__BUFFER_REMOVE, BufferID);
return true;
} else {
EDN_INFO("non existing Buffer " << BufferID);
return false;
}
} else {
EDN_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 BufferManager::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;
}

View File

@ -1,74 +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 "Singleton.h"
#include "MsgBroadcast.h"
class BufferManager: public Singleton<BufferManager>, public MsgBroadcast
{
friend class Singleton<BufferManager>;
// specific for sigleton system...
private:
// Constructeur
BufferManager(void);
~BufferManager(void);
public:
void OnMessage(int32_t id, int32_t dataID);
// return the ID of the buffer allocated
// create a buffer with no element
int32_t Create(void);
// open curent filename
int32_t Open(Edn::File &myFile);
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(Edn::File &myFile);
int32_t GetId(Edn::File &myFile);
// return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5
uint32_t Size(void);
int32_t WitchBuffer(int32_t iEmeElement);
bool Remove(int32_t BufferID);
private:
Edn::VectorType<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)
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,123 +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 BufferText : public Buffer {
public:
BufferText(void);
BufferText(Edn::File &fileName);
virtual ~BufferText(void);
void Save(void);
void GetInfo(infoStatBuffer_ts &infoToUpdate);
void SetLineDisplay(uint32_t lineNumber);
int32_t Display(DrawerManager &drawer);
void ForceReDraw(bool allElement);
void AddChar(char * UTF8data);
void cursorMove(int32_t gtkKey);
void MouseSelectFromCursorTo(int32_t width, int32_t height);
void MouseEvent(int32_t width, int32_t height);
void MouseEventDouble(void);
void MouseEventTriple(void);
void ScrollDown(void);
void ScrollUp(void);
void Copy(int8_t clipboardID);
void Cut(int8_t clipboardID);
void Paste(int8_t clipboardID);
void Search(Edn::String &data, bool back, bool caseSensitive, bool wrap, bool regExp);
void Replace(Edn::String &data);
int32_t FindLine(Edn::String &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(charset_te newCharset);
protected:
void NameChange(void);
private:
// Display
bool NeedToCleanEndPage; //!< if true, the end of the page need to be clean (arrive after a remove line)
uint32_t nbColoneForLineNumber; //!< number of colome used to display the line Number
ColorizeManager * myColorManager; //!< for the background color :
// Direct buffer IO
EdnBuf m_EdnBuf; //!< buffer associated on this displayer
position_ts m_displayStart; //!< position where the display is starting
position_ts m_displaySize; //!< number of char displayable in the screan
int32_t m_displayStartBufferPos; //!< position where the buffer start
// Cursor :
int32_t m_cursorPos; //!< position in the buffer of the cursor
int32_t m_cursorPreferredCol; //!< colomn of the last up and down ...
bool m_cursorOn; //!< the blink of the cursor ...
cursorDisplayMode_te m_cursorMode; //!< type of cursor Selected
displayHLData_ts m_displayLocalSyntax; //!< for the display of the local elements (display HL mode)
// internal function
void BasicInit(void);
void UpdateWindowsPosition(bool centerPage = false);
void displayLineNumber(DrawerManager &drawer);
void CleanSelectLine(void);
void SelectionStart(void);
void SelectionEnd(void);
void SelectionCheckMode(void);
void CheckAndUpdateLineForModification(uint32_t lineID);
bool TextDMoveUp(int32_t offset);
bool TextDMoveDown(int32_t offset);
void SetInsertPosition(int32_t newPosition, bool insertChar = false);
void GetMousePosition(int32_t width, int32_t height, int32_t &x, int32_t &y);
void MoveUpDown(int32_t ofset);
void DrawLineNumber(DrawerManager &drawer,char *myPrint, int32_t lineNumber, int32_t positionY);
};
#endif

View File

@ -1,167 +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 "tools_debug.h"
#include "tools_globals.h"
#include "Colorize.h"
#include "Edn.h"
#undef __class__
#define __class__ "Colorize"
Colorize::Colorize( Edn::String &newColorName)
{
m_colorFG.red=0;
m_colorFG.green=0;
m_colorFG.blue=0;
m_colorBG.red=0;
m_colorBG.green=0;
m_colorBG.blue=0;
italic = false;
bold = false;
haveFG = false;
haveBG = false;
SetName(newColorName);
//EDN_INFO("New(Colorise)");
}
Colorize::Colorize(void)
{
ColorName = "no_name";
m_colorFG.red=0;
m_colorFG.green=0;
m_colorFG.blue=0;
m_colorBG.red=0;
m_colorBG.green=0;
m_colorBG.blue=0;
italic = false;
bold = false;
haveFG = false;
haveBG = false;
//EDN_INFO("New(Colorise)");
}
Colorize::~Colorize(void)
{
// nothing to do ...
}
void Colorize::SetName(const char *newColorName)
{
//EDN_INFO("color change name : \"%s\" ==> \"%s\"",ColorName.c_str(), newColorName);
ColorName = newColorName;
}
void Colorize::SetName(Edn::String &newColorName)
{
//EDN_INFO("color change name : \"%s\" ==> \"%s\"",ColorName.c_str(), newColorName.c_str());
ColorName = newColorName;
}
Edn::String Colorize::GetName(void)
{
return ColorName;
}
void Colorize::SetFgColor(const char *myColor)
{
haveFG = true;
unsigned int r=0;
unsigned int v=0;
unsigned int b=0;
sscanf(myColor, "#%02x%02x%02x", &r,&v,&b);
m_colorFG.red = (float)r/255.0;
m_colorFG.green = (float)v/255.0;
m_colorFG.blue = (float)b/255.0;
//EDN_INFO(myColor << " ==> r="<< r <<" v="<< v <<" b="<< b );
}
void Colorize::SetBgColor(const char *myColor)
{
haveBG = true;
unsigned int r,v,b;
sscanf(myColor, "#%02x%02x%02x", &r,&v,&b);
m_colorBG.red = (float)r/255.0;
m_colorBG.green = (float)v/255.0;
m_colorBG.blue = (float)b/255.0;
}
bool Colorize::HaveBg(void)
{
return haveBG;
}
void Colorize::SetItalic(bool enable)
{
italic = enable;
/*
if (true == enable) {
EDN_INFO("color : \"%s\" enable italic", ColorName.c_str());
} else {
EDN_INFO("color : \"%s\" disable italic", ColorName.c_str());
}
*/
}
bool Colorize::GetItalic(void)
{
return italic;
}
void Colorize::SetBold(bool enable)
{
bold = enable;
/*
if (true == enable) {
EDN_INFO("color : \"%s\" enable bold", ColorName.c_str());
} else {
EDN_INFO("color : \"%s\" disable bold", ColorName.c_str());
}
*/
}
bool Colorize::GetBold(void)
{
return bold;
}

View File

@ -1,81 +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 "Edn.h"
extern "C" {
typedef struct {
float red;
float green;
float blue;
} color_ts;
}
class Colorize {
public:
// Constructeur
Colorize(void);
Colorize(Edn::String &newColorName);
~Colorize(void);
void SetName(Edn::String &newColorName);
void SetName(const char *newColorName);
Edn::String GetName(void);
void SetFgColor(const char *myColor);
void SetBgColor(const char *myColor);
void ApplyFG(cairo_t * cr) { cairo_set_source_rgba(cr, m_colorFG.red, m_colorFG.green, m_colorFG.blue, 1); };
void ApplyBG(cairo_t * cr) { cairo_set_source_rgba(cr, m_colorBG.red, m_colorBG.green, m_colorBG.blue, 1); };
color_ts & GetFG(void) { return m_colorFG; };
color_ts & 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) { EDN_INFO(" " << i << " : \"" << ColorName.c_str() << "\"" /*<< " fg="<< m_colorFG.red <<","<< m_colorFG.green <<","<< m_colorFG.blue <<" bg="<< m_colorBG.red <<","<< m_colorBG.green <<","<< m_colorBG.blue*/ ); };
private:
Edn::String ColorName; //!< curent color Name
color_ts m_colorFG;
color_ts m_colorBG;
bool italic;
bool bold;
bool haveFG;
bool haveBG;
};
#endif

View File

@ -1,292 +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 "tools_debug.h"
#include "tools_globals.h"
#include "ColorizeManager.h"
#include "tinyxml.h"
#define PFX "ColorizeManager "
ColorizeManager::ColorizeManager(void) : MsgBroadcast("Colorize Manager", EDN_CAT_COLOR)
{
}
ColorizeManager::~ColorizeManager(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 ColorizeManager::OnMessage(int32_t id, int32_t dataID)
{
switch (id)
{
case EDN_MSG__RELOAD_COLOR_FILE:
{
// Reaload File
// TODO : Check this : Pb in the recopy Edn::String element
Edn::String plop = m_fileColor;
LoadFile(plop.c_str());
}
break;
}
}
void ColorizeManager::LoadFile(Edn::String &xmlFilename)
{
LoadFile(xmlFilename.c_str());
}
void ColorizeManager::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;
EDN_DEBUG("open file (COLOR) \"" << xmlFilename << "\" ? = \"" << m_fileColor << "\"");
errorColor = new Colorize();
errorColor->SetBgColor("#000000");
errorColor->SetFgColor("#FFFFFF");
// allocate the document in the stack
TiXmlDocument XmlDocument;
// open the curent File
XmlDocument.LoadFile(xmlFilename);
TiXmlElement* root = XmlDocument.FirstChildElement( "EdnColor" );
if (NULL == root ) {
EDN_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) {
EDN_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 {
EDN_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) {
unsigned int r=0;
unsigned int v=0;
unsigned int b=0;
sscanf(color, "#%02x%02x%02x", &r,&v,&b);
basicColors[id].red = (float)r/255.0;
basicColors[id].green = (float)v/255.0;
basicColors[id].blue = (float)b/255.0;
/*
EDN_INFO(" Specify color for system ID="<< id );
EDN_INFO(" " << color << " ==> r="<< r <<" v="<< v <<" b="<< b );
EDN_INFO(" " << color << " ==> r="<< basicColors[id].red <<" v="<< basicColors[id].green <<" b="<< basicColors[id].blue );
*/
}
} else {
EDN_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) {
EDN_ERROR(PFX"(l "<< pGuiNode->Row() <<") node with no name");
// get next node element
pGuiNode = pGuiNode->NextSibling();
continue;
} else {
myNewColor->SetName(colorName);
//EDN_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 {
EDN_ERROR(PFX"(l "<<pNode->Row()<<") node not suported : \""<<pNode->Value()<<"\" must be [color]");
}
pGuiNode = pGuiNode->NextSibling();
}
} else {
EDN_ERROR(PFX"(l "<<pNode->Row()<<") node not suported : \""<<pNode->Value()<<"\" must be [gui,syntax]");
}
// get next node element
pNode = pNode->NextSibling();
}
}
SendMessage(EDN_MSG__COLOR_HAS_CHANGE);
SendMessage(EDN_MSG__USER_DISPLAY_CHANGE);
}
Colorize *ColorizeManager::Get(const char *colorName)
{
int32_t i;
for (i=0; i<listMyColor.Size(); i++) {
Edn::String elementName = listMyColor[i]->GetName();
if (elementName == colorName) {
return listMyColor[i];
}
}
EDN_ERROR(PFX"Color does not Existed ["<< colorName<<"]" );
// an error
return errorColor;
}
Colorize *ColorizeManager::Get(Edn::String &colorName)
{
return Get(colorName.c_str());
}
color_ts & ColorizeManager::Get(basicColor_te myColor)
{
if (myColor < COLOR_NUMBER_MAX) {
return basicColors[myColor];
} else {
return basicColors[0];
}
}
bool ColorizeManager::Exist(const char *colorName)
{
int32_t i;
for (i=0; i<listMyColor.Size(); i++) {
Edn::String elementName = listMyColor[i]->GetName();
if (elementName == colorName) {
return true;
}
}
return false;
}
bool ColorizeManager::Exist(Edn::String &colorName)
{
return Exist(colorName.c_str());
}
void ColorizeManager::DisplayListOfColor(void)
{
int32_t i;
EDN_INFO(PFX"List of ALL COLOR : ");
for (i=0; i<listMyColor.Size(); i++) {
//Edn::String elementName = listMyColor[i]->GetName();
//EDN_INFO(i << " : \"" << elementName.c_str() << "\"" );
listMyColor[i]->Display(i);
}
}

View File

@ -1,81 +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 "Singleton.h"
#include "Colorize.h"
#include "MsgBroadcast.h"
#include "Edn.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;
class ColorizeManager: public Singleton<ColorizeManager>, public MsgBroadcast
{
friend class Singleton<ColorizeManager>;
// specific for sigleton system...
private:
// Constructeur
ColorizeManager(void);
~ColorizeManager(void);
public:
void OnMessage(int32_t id, int32_t dataID);
public:
void LoadFile(Edn::String &xmlFilename);
void LoadFile(const char * xmlFilename);
Colorize * Get(const char *colorName);
Colorize * Get(Edn::String &colorName);
color_ts & Get(basicColor_te myColor);
bool Exist(Edn::String &colorName);
bool Exist(const char *colorName);
void DisplayListOfColor(void);
private:
Edn::String m_fileColor;
Edn::VectorType<Colorize*> listMyColor; //!< List of ALL Color
Colorize * errorColor;
color_ts basicColors[COLOR_NUMBER_MAX];
};
#endif

View File

@ -1,401 +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 "tools_debug.h"
#include "tools_globals.h"
#include "Display.h"
#include "BufferView.h"
#include "BufferManager.h"
#include "ColorizeManager.h"
#include "MainWindows.h"
#undef __class__
#define __class__ "BufferView"
BufferView::BufferView(void) : MsgBroadcast("Buffer View", EDN_CAT_GUI)
{
m_shawableAreaX = 0;
m_shawableAreaY = 0;
// Init link with the buffer Manager
m_bufferManager = BufferManager::getInstance();
m_colorManager = ColorizeManager::getInstance();
m_widget = gtk_drawing_area_new();
gtk_widget_set_size_request( m_widget, 250, 100);
gtk_widget_add_events( m_widget,
GDK_KEY_PRESS_MASK
| GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK
| GDK_POINTER_MOTION_MASK
| GDK_POINTER_MOTION_HINT_MASK);
# ifdef USE_GTK_VERSION_3_0
g_object_set(m_widget,"can-focus", TRUE, NULL);
# elif defined( USE_GTK_VERSION_2_0 )
GTK_WIDGET_SET_FLAGS(m_widget, GTK_CAN_FOCUS);
# endif
// Focus Event
g_signal_connect( G_OBJECT(m_widget), "focus_in_event", G_CALLBACK(CB_focusGet), this);
g_signal_connect( G_OBJECT(m_widget), "focus_out_event", G_CALLBACK(CB_focusLost), this);
// Keyboard Event
g_signal_connect_after( G_OBJECT(m_widget), "key_press_event", G_CALLBACK(CB_keyboardEvent), this);
g_signal_connect_after( G_OBJECT(m_widget), "key_release_event", G_CALLBACK(CB_keyboardEvent), this);
// Mouse Event
g_signal_connect( G_OBJECT(m_widget), "button_press_event", G_CALLBACK(CB_mouseButtonEvent), this);
g_signal_connect( G_OBJECT(m_widget), "button_release_event", G_CALLBACK(CB_mouseButtonEvent), this);
g_signal_connect( G_OBJECT(m_widget), "motion_notify_event", G_CALLBACK(CB_mouseMotionEvent), this);
// Display Event
g_signal_connect( G_OBJECT(m_widget), "realize", G_CALLBACK(CB_displayInit), this);
# ifdef USE_GTK_VERSION_3_0
g_signal_connect( G_OBJECT(m_widget), "draw", G_CALLBACK(CB_displayDraw), this);
# elif defined( USE_GTK_VERSION_2_0 )
g_signal_connect( G_OBJECT(m_widget), "expose_event", G_CALLBACK(CB_displayDraw), this);
# endif
m_selectedID = -1;
}
BufferView::~BufferView(void)
{
}
GtkWidget * BufferView::GetMainWidget(void)
{
return m_widget;
}
void BufferView::OnMessage(int32_t id, int32_t dataID)
{
switch (id)
{
case EDN_MSG__BUFFER_CHANGE_CURRENT:
m_selectedID = dataID;
case EDN_MSG__BUFFER_CHANGE_STATE:
case EDN_MSG__BUFFER_CHANGE_NAME:
case EDN_MSG__BUFFER_CHANGE_MODIFY:
// change Title :
gtk_widget_queue_draw(m_widget);
break;
case EDN_MSG__USER_DISPLAY_CHANGE:
// Redraw all the display ...
gtk_widget_queue_draw(m_widget);
break;
}
}
gboolean BufferView::CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data)
{
BufferView * self = reinterpret_cast<BufferView*>(data);
# ifdef USE_GTK_VERSION_3_0
GtkAllocation allocation;
gtk_widget_get_allocation(widget, &allocation);
bool needRedrawAll = false;
if (self->m_shawableAreaX != allocation.width) {
needRedrawAll = true;
self->m_shawableAreaX = allocation.width;
}
if (self->m_shawableAreaY != allocation.height) {
needRedrawAll = true;
self->m_shawableAreaY = allocation.height;
}
# elif defined( USE_GTK_VERSION_2_0)
bool needRedrawAll = false;
if (self->m_shawableAreaX != widget->allocation.width) {
needRedrawAll = true;
self->m_shawableAreaX = widget->allocation.width;
}
if (self->m_shawableAreaY != widget->allocation.height) {
needRedrawAll = true;
self->m_shawableAreaY = widget->allocation.height;
}
#endif
if (true == needRedrawAll) {
//myBuffer->ForceReDraw(true);
}
EDN_INFO("==========================================================================");
EDN_INFO("Request a display of : " << self->m_shawableAreaX << "px * "<< self->m_shawableAreaY<<"px");
DrawerManager monDrawer(widget, self->m_shawableAreaX, self->m_shawableAreaY);
// clean buffer
monDrawer.Clean(self->m_colorManager->Get(COLOR_LIST_BG_1));
// get the number of buffer open
int32_t nbBufferOpen = self->m_bufferManager->Size();
int32_t i;
uint32_t lineID = 0;
uint32_t fontHeight = Display::GetFontHeight();
basicColor_te selectFG = COLOR_LIST_TEXT_NORMAL;
basicColor_te selectBG = COLOR_LIST_BG_1;
for (i=0; i < nbBufferOpen; i++) {
Edn::File name;
bool isModify;
if (self->m_bufferManager->Exist(i)) {
isModify = self->m_bufferManager->Get(i)->IsModify();
name = self->m_bufferManager->Get(i)->GetFileName();
char *tmpModify = (char*)" ";
if (true == isModify) {
tmpModify = (char*)"M";
}
char name2[1024] = "";
sprintf(name2, "[%2d](%s) %s", i, tmpModify, name.GetShortFilename().c_str() );
if (true == isModify) {
selectFG = COLOR_LIST_TEXT_MODIFY;
} else {
selectFG = COLOR_LIST_TEXT_NORMAL;
}
if (lineID%2==0) {
selectBG = COLOR_LIST_BG_1;
} else {
selectBG = COLOR_LIST_BG_2;
}
if (self->m_selectedID == i) {
selectBG = COLOR_LIST_BG_SELECTED;
}
EDN_INFO("color fg=" << selectFG << " bg="<< selectBG);
monDrawer.Rectangle(self->m_colorManager->Get(selectBG), 0, lineID*fontHeight, self->m_shawableAreaX, Display::GetFontHeight());
monDrawer.Text(self->m_colorManager->Get(selectFG), 2, lineID*fontHeight, name2);
monDrawer.Flush();
lineID ++;
}
}
return TRUE;
}
// sur : émis lors du premier affichage de la GtkDrawingArea
gboolean BufferView::CB_displayInit( GtkWidget *widget, gpointer data)
{
BufferView * self = reinterpret_cast<BufferView*>(data);
# ifdef USE_GTK_VERSION_3_0
GtkAllocation allocation;
gtk_widget_get_allocation(widget, &allocation);
int32_t size_x = allocation.width;
int32_t size_y = allocation.height;
self->m_shawableAreaX = allocation.width;
self->m_shawableAreaY = allocation.height;
# elif defined( USE_GTK_VERSION_2_0)
int32_t size_x = widget->allocation.width;
int32_t size_y = widget->allocation.height;
self->m_shawableAreaX = widget->allocation.width;
self->m_shawableAreaY = widget->allocation.height;
# endif
EDN_INFO("Request a diplay of : " << size_x << "px * " << size_y << "px");
//Display::InitDisplayParam(self->m_displayParameters, widget, 700, 1200);
gtk_widget_queue_draw( widget );
return TRUE;
}
gint BufferView::CB_focusGet( GtkWidget *widget, GdkEventFocus *event, gpointer data)
{
//BufferView * self = reinterpret_cast<BufferView*>(data);
# ifdef USE_GTK_VERSION_2_0
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
# endif
EDN_INFO("Focus - In");
gtk_widget_queue_draw( widget );
return FALSE;
}
gint BufferView::CB_focusLost( GtkWidget *widget, GdkEventFocus *event, gpointer data)
{
//BufferView * self = reinterpret_cast<BufferView*>(data);
# ifdef USE_GTK_VERSION_2_0
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
# endif
EDN_INFO("Focus - out");
return FALSE;
}
gint BufferView::CB_keyboardEvent( GtkWidget *widget, GdkEventKey *event, gpointer data)
{
//BufferView * self = reinterpret_cast<BufferView*>(data);
if(event->type == GDK_KEY_PRESS) {
gtk_widget_queue_draw( widget );
}
return true;
}
void BufferView::OnPopupEventShow(GtkWidget *menuitem, gpointer data)
{
BufferView * self = reinterpret_cast<BufferView*>(data);
self->SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, self->m_contectMenuSelectID);
self->m_contectMenuSelectID = -1;
}
void BufferView::OnPopupEventClose(GtkWidget *menuitem, gpointer data)
{
BufferView * self = reinterpret_cast<BufferView*>(data);
self->SendMessage(EDN_MSG__BUFF_ID_CLOSE, self->m_contectMenuSelectID);
self->m_contectMenuSelectID = -1;
}
void BufferView::OnPopupEventSave(GtkWidget *menuitem, gpointer data)
{
BufferView * self = reinterpret_cast<BufferView*>(data);
self->SendMessage(EDN_MSG__BUFF_ID_SAVE, self->m_contectMenuSelectID);
self->m_contectMenuSelectID = -1;
}
void BufferView::OnPopupEventSaveAs(GtkWidget *menuitem, gpointer data)
{
BufferView * self = reinterpret_cast<BufferView*>(data);
self->SendMessage(EDN_MSG__GUI_SHOW_SAVE_AS, self->m_contectMenuSelectID);
self->m_contectMenuSelectID = -1;
}
void BufferView::ViewPopupMenu(GtkWidget *parrent, GdkEventButton *event, int32_t BufferID)
{
// Save the slected buffer
m_contectMenuSelectID = BufferID;
if (m_bufferManager->Exist(m_contectMenuSelectID)) {
GtkWidget *menu, *menuitem;
menu = gtk_menu_new();
menuitem = gtk_menu_item_new_with_label("Show");
g_signal_connect( G_OBJECT(menuitem), "activate", G_CALLBACK(OnPopupEventShow), this);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
if (true == m_bufferManager->Get(m_contectMenuSelectID)->HaveName()) {
if (true == m_bufferManager->Get(m_contectMenuSelectID)->IsModify()) {
menuitem = gtk_menu_item_new_with_label("Save");
} else {
menuitem = gtk_menu_item_new_with_label("Force Save");
}
g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(OnPopupEventSave), this);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
}
menuitem = gtk_menu_item_new_with_label("Save As ...");
g_signal_connect( G_OBJECT(menuitem), "activate", G_CALLBACK(OnPopupEventSaveAs), this);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
menuitem = gtk_menu_item_new_with_label("Close");
g_signal_connect( G_OBJECT(menuitem), "activate", G_CALLBACK(OnPopupEventClose), this);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
gtk_widget_show_all(menu);
// Note: event can be NULL here when called from view_onPopupMenu;
// gdk_event_get_time() accepts a NULL argument
gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,
(event != NULL) ? event->button : 0,
gdk_event_get_time((GdkEvent*)event));
} else {
EDN_ERROR("Buffer does not Exist !!! " << m_contectMenuSelectID);
}
}
gint BufferView::CB_mouseButtonEvent(GtkWidget *widget, GdkEventButton *event, gpointer data)
{
BufferView * self = reinterpret_cast<BufferView*>(data);
// get focus on the widget
gtk_widget_grab_focus(widget);
if (event->button == 1) {
if (event->type == GDK_BUTTON_PRESS) {
EDN_INFO("mouse-event BT1 ==> One Clicked");
}else if (event->type == GDK_2BUTTON_PRESS) {
//EDN_INFO("mouse-event BT1 ==> Double Clicked %d, %d", (uint32_t)event->x, (uint32_t)event->y);
uint32_t fontHeight = Display::GetFontHeight();
int32_t selectBuf = self->m_bufferManager->WitchBuffer((event->y / fontHeight) + 1);
//EDN_INFO(" plop %d / %d = %d ==> %d", (uint32_t)event->y, fontHeight, ((uint32_t)event->y / fontHeight), selectBuf);
if ( 0 <= selectBuf) {
self->SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, selectBuf);
/*
MainWindows *window = MainWindows::getInstance();
EDN_INFO(" Event on Buffer " << selectBuf);
// set the new seected Buffer
window->SetSelected(selectBuf);
*/
}
}/* else if (event->type == GDK_3BUTTON_PRESS) {
EDN_INFO("mouse-event BT1 ==> Triple Clicked");
}else if (event->type == GDK_BUTTON_RELEASE) {
EDN_INFO("mouse-event BT1 ==> Realease");
}*/
} else if (event->button == 2) {
/*
if (event->type == GDK_BUTTON_PRESS) {
EDN_INFO("mouse-event BT2 PRESS");
self->m_menuContext->Show(event->x, event->y, false);
}
*/
} else if (event->button == 3) {
if (event->type == GDK_BUTTON_PRESS) {
EDN_INFO("mouse-event BT3 PRESS");
uint32_t fontHeight = Display::GetFontHeight();
int32_t selectBuf = self->m_bufferManager->WitchBuffer((event->y / fontHeight) + 1);
if ( 0 <= selectBuf) {
self->ViewPopupMenu(widget, event, selectBuf);
}
}
} else {
EDN_INFO("mouse-event BT? PRESS");
}
gtk_widget_queue_draw( widget );
return true;
}
gint BufferView::CB_mouseMotionEvent( GtkWidget *widget, GdkEventMotion *event, gpointer data)
{
//BufferView * self = reinterpret_cast<BufferView*>(data);
/*
if (true == ButtunOneSelected) {
int x, y;
GdkModifierType state;
if (event->is_hint) {
gdk_window_get_pointer(event->window, &x, &y, &state);
} else {
x = event->x;
y = event->y;
state = (GdkModifierType)event->state;
}
EDN_INFO("mouse-motion BT1 %d, %d", x, y);
}
*/
return true;
}

View File

@ -1,77 +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 "tools_debug.h"
#include "Singleton.h"
#include "CodeView.h"
#include "BufferManager.h"
#include "Display.h"
#include "MsgBroadcast.h"
class BufferView : public MsgBroadcast
{
public:
// Constructeur
BufferView(void);
~BufferView(void);
GtkWidget *GetMainWidget(void);
void OnMessage(int32_t id, int32_t dataID);
// sur : GTK+ callback :
static gboolean CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data);
static gboolean CB_displayInit( GtkWidget *widget, gpointer data);
static gint CB_focusGet( GtkWidget *widget, GdkEventFocus *event, gpointer data);
static gint CB_focusLost( GtkWidget *widget, GdkEventFocus *event, gpointer data);
static gint CB_keyboardEvent( GtkWidget *widget, GdkEventKey *event, gpointer data);
static gint CB_mouseButtonEvent(GtkWidget *widget, GdkEventButton *event, gpointer data);
static gint CB_mouseMotionEvent( GtkWidget *widget, GdkEventMotion *event, gpointer data);
static void CB_EventOnBufferManager(gpointer data);
static void OnPopupEventShow(GtkWidget *menuitem, gpointer data);
static void OnPopupEventClose(GtkWidget *menuitem, gpointer data);
static void OnPopupEventSave(GtkWidget *menuitem, gpointer data);
static void OnPopupEventSaveAs(GtkWidget *menuitem, gpointer data);
private:
void ViewPopupMenu(GtkWidget *parrent, GdkEventButton *event, int32_t BufferID);
// main windows widget :
GtkWidget * m_widget;
// récupération des proprieter général...
BufferManager * m_bufferManager;
ColorizeManager * m_colorManager;
int32_t m_shawableAreaX;
int32_t m_shawableAreaY;
int32_t m_selectedID;
int32_t m_contectMenuSelectID;
};
#endif

View File

@ -1,421 +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 "tools_debug.h"
#include "tools_globals.h"
#include "Display.h"
#include "CodeView.h"
#include "BufferManager.h"
#include "ColorizeManager.h"
#include "ClipBoard.h"
#include "SearchData.h"
CodeView::CodeView(void) : MsgBroadcast("Code View", EDN_CAT_WORK_AREA)
{
m_bufferID = -1;
m_buttunOneSelected = false;
m_shawableAreaX = 0;
m_shawableAreaY = 0;
// Init link with the buffer Manager
m_bufferManager = BufferManager::getInstance();
m_colorManager = ColorizeManager::getInstance();
m_widget = gtk_drawing_area_new();
gtk_widget_set_size_request( m_widget, 200, 100);
gtk_widget_add_events( m_widget,
GDK_KEY_PRESS_MASK
| GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK
| GDK_POINTER_MOTION_MASK
| GDK_POINTER_MOTION_HINT_MASK);
# ifdef USE_GTK_VERSION_3_0
g_object_set(m_widget,"can-focus", TRUE, NULL);
# elif defined( USE_GTK_VERSION_2_0 )
GTK_WIDGET_SET_FLAGS(m_widget, GTK_CAN_FOCUS);
# endif
// Focus Event
g_signal_connect( G_OBJECT(m_widget), "focus_in_event", G_CALLBACK(CB_focusGet), this);
g_signal_connect( G_OBJECT(m_widget), "focus_out_event", G_CALLBACK(CB_focusLost), this);
// Keyboard Event
g_signal_connect_after( G_OBJECT(m_widget), "key_press_event", G_CALLBACK(CB_keyboardEvent), this);
g_signal_connect_after( G_OBJECT(m_widget), "key_release_event", G_CALLBACK(CB_keyboardEvent), this);
// Mouse Event
g_signal_connect( G_OBJECT(m_widget), "button_press_event", G_CALLBACK(CB_mouseButtonEvent), this);
g_signal_connect( G_OBJECT(m_widget), "button_release_event", G_CALLBACK(CB_mouseButtonEvent), this);
g_signal_connect( G_OBJECT(m_widget), "motion_notify_event", G_CALLBACK(CB_mouseMotionEvent), this);
g_signal_connect( G_OBJECT(m_widget), "scroll-event", G_CALLBACK(CB_mouseScrollEvent), this);
// Display Event
g_signal_connect( G_OBJECT(m_widget), "realize", G_CALLBACK(CB_displayInit), this);
# ifdef USE_GTK_VERSION_3_0
g_signal_connect( G_OBJECT(m_widget), "draw", G_CALLBACK(CB_displayDraw), this);
# elif defined( USE_GTK_VERSION_2_0 )
g_signal_connect( G_OBJECT(m_widget), "expose_event", G_CALLBACK(CB_displayDraw), this);
# endif
}
CodeView::~CodeView(void)
{
}
GtkWidget * CodeView::GetMainWidget(void)
{
return m_widget;
}
void CodeView::OnMessage(int32_t id, int32_t dataID)
{
switch (id)
{
case EDN_MSG__CURRENT_CHANGE_BUFFER_ID:
//EDN_INFO("Select a new Buffer ... " << dataID);
m_bufferID = dataID;
m_bufferManager->Get(m_bufferID)->ForceReDraw(true);
// request the dispplay of the curent Editor
SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, m_bufferID);
break;
case EDN_MSG__CURRENT_SAVE:
SendMessage(EDN_MSG__BUFF_ID_SAVE, m_bufferID);
break;
case EDN_MSG__CURRENT_SAVE_AS:
SendMessage(EDN_MSG__GUI_SHOW_SAVE_AS, m_bufferID);
break;
case EDN_MSG__CURRENT_REMOVE_LINE:
m_bufferManager->Get(m_bufferID)->RemoveLine();
break;
case EDN_MSG__CURRENT_SELECT_ALL:
m_bufferManager->Get(m_bufferID)->SelectAll();
break;
case EDN_MSG__CURRENT_UN_SELECT:
m_bufferManager->Get(m_bufferID)->SelectNone();
break;
case EDN_MSG__CURRENT_COPY:
if (dataID == -1) {
dataID = COPY_STD;
}
m_bufferManager->Get(m_bufferID)->Copy(dataID);
break;
case EDN_MSG__CURRENT_CUT:
if (dataID == -1) {
dataID = COPY_STD;
}
m_bufferManager->Get(m_bufferID)->Cut(dataID);
break;
case EDN_MSG__CURRENT_PASTE:
if (dataID == -1) {
dataID = COPY_STD;
}
m_bufferManager->Get(m_bufferID)->Paste(dataID);
break;
case EDN_MSG__CURRENT_FIND_PREVIOUS:
{
Edn::String myDataString;
SearchData::GetSearch(myDataString);
m_bufferManager->Get(m_bufferID)->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
}
break;
case EDN_MSG__CURRENT_FIND_NEXT:
{
Edn::String myDataString;
SearchData::GetSearch(myDataString);
m_bufferManager->Get(m_bufferID)->Search(myDataString, false, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
}
break;
case EDN_MSG__CURRENT_REPLACE:
{
Edn::String myDataString;
SearchData::GetReplace(myDataString);
m_bufferManager->Get(m_bufferID)->Replace(myDataString);
}
break;
case EDN_MSG__CURRENT_REPLACE_ALL:
break;
case EDN_MSG__CURRENT_CLOSE:
SendMessage(EDN_MSG__BUFF_ID_CLOSE, m_bufferID);
break;
case EDN_MSG__CURRENT_UNDO:
m_bufferManager->Get(m_bufferID)->Undo();
break;
case EDN_MSG__CURRENT_REDO:
m_bufferManager->Get(m_bufferID)->Redo();
break;
case EDN_MSG__CURRENT_GOTO_LINE:
if (dataID<0) {
dataID = 0;
}
m_bufferManager->Get(m_bufferID)->JumpAtLine(dataID);
break;
case EDN_MSG__REFRESH_DISPLAY:
break;
case EDN_MSG__CURRENT_SET_CHARSET:
m_bufferManager->Get(m_bufferID)->SetCharset((charset_te)dataID);
break;
case EDN_MSG__USER_DISPLAY_CHANGE:
// Redraw all the display ... Done under ...
break;
}
// Force redraw of the widget
gtk_widget_queue_draw(m_widget);
}
gboolean CodeView::CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data)
{
CodeView * self = reinterpret_cast<CodeView*>(data);
//EDN_INFO("displayDraw_cb");
# ifdef USE_GTK_VERSION_3_0
GtkAllocation allocation;
gtk_widget_get_allocation(widget, &allocation);
bool needRedrawAll = false;
if (self->m_shawableAreaX != allocation.width) {
needRedrawAll = true;
self->m_shawableAreaX = allocation.width;
}
if (self->m_shawableAreaY != allocation.height) {
needRedrawAll = true;
self->m_shawableAreaY = allocation.height;
}
# elif defined( USE_GTK_VERSION_2_0)
bool needRedrawAll = false;
if (self->m_shawableAreaX != widget->allocation.width) {
needRedrawAll = true;
self->m_shawableAreaX = widget->allocation.width;
}
if (self->m_shawableAreaY != widget->allocation.height) {
needRedrawAll = true;
self->m_shawableAreaY = widget->allocation.height;
}
# endif
if (true == needRedrawAll) {
//updateScrollElement();
self->m_bufferManager->Get(self->m_bufferID)->ForceReDraw(true);
}
EDN_INFO("Request a display of : " << self->m_shawableAreaX << "px * "<< self->m_shawableAreaY<<"px");
/*
EDN_INFO("widget width=%d", widget->allocation.width);
EDN_INFO("widget height=%d", widget->allocation.height);
*/
//EDN_INFO("BufferView Display");
// Get the color Manager :
ColorizeManager *myColorManager = NULL;
myColorManager = ColorizeManager::getInstance();
//(void)m_bufferManager->Get(m_bufferID)->Display(m_displayParameters, m_shawableAreaX, m_shawableAreaY);
DrawerManager monDrawer(widget, self->m_shawableAreaX, self->m_shawableAreaY);
//EDN_INFO("Display buffer ID = " << m_bufferID);
(void)self->m_bufferManager->Get(self->m_bufferID)->Display(monDrawer);
// EDN_WARNING("Must display here ... ");
return TRUE;
}
// sur : émis lors du premier affichage de la GtkDrawingArea
gboolean CodeView::CB_displayInit( GtkWidget *widget, gpointer data)
{
CodeView * self = reinterpret_cast<CodeView*>(data);
# ifdef USE_GTK_VERSION_3_0
GtkAllocation allocation;
gtk_widget_get_allocation(widget, &allocation);
int32_t size_x = allocation.width;
int32_t size_y = allocation.height;
self->m_shawableAreaX = allocation.width;
self->m_shawableAreaY = allocation.height;
# elif defined( USE_GTK_VERSION_2_0)
int32_t size_x = widget->allocation.width;
int32_t size_y = widget->allocation.height;
self->m_shawableAreaX = widget->allocation.width;
self->m_shawableAreaY = widget->allocation.height;
# endif
EDN_INFO("Request a diplay of : "<< size_x <<"px * "<< size_y <<"px");
gtk_widget_queue_draw( widget );
return TRUE;
}
gint CodeView::CB_focusGet( GtkWidget *widget, GdkEventFocus *event, gpointer data)
{
CodeView * self = reinterpret_cast<CodeView*>(data);
# ifdef USE_GTK_VERSION_2_0
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
# endif
self->SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, self->m_bufferID);
EDN_INFO("Focus - In");
return FALSE;
}
gint CodeView::CB_focusLost( GtkWidget *widget, GdkEventFocus *event, gpointer data)
{
//CodeView * self = reinterpret_cast<CodeView*>(data);
# ifdef USE_GTK_VERSION_2_0
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
# endif
EDN_INFO("Focus - out");
return FALSE;
}
gint CodeView::CB_keyboardEvent(GtkWidget *widget, GdkEventKey *event, gpointer data)
{
CodeView * self = reinterpret_cast<CodeView*>(data);
char Utf8Out[10];
bool controlKey;
bool moveKey;
int32_t key;
// Convert input key :
ConvertInput(event, Utf8Out, controlKey, moveKey, key);
if(event->type == GDK_KEY_PRESS) {
if(false==controlKey) {
self->m_bufferManager->Get(self->m_bufferID)->AddChar(Utf8Out);
gtk_widget_queue_draw( widget );
} else if (true == moveKey) {
self->m_bufferManager->Get(self->m_bufferID)->cursorMove(key);
gtk_widget_queue_draw( widget );
}
}
return true;
}
gint CodeView::CB_mouseButtonEvent(GtkWidget *widget, GdkEventButton *event, gpointer data)
{
CodeView * self = reinterpret_cast<CodeView*>(data);
// get focus on the widget
gtk_widget_grab_focus(widget);
if (event->button == 1) {
if (event->type == GDK_BUTTON_PRESS) {
//EDN_INFO("mouse-event BT1 ==> One Clicked %d, %d", (uint32_t)event->x, (uint32_t)event->y);
self->m_bufferManager->Get(self->m_bufferID)->MouseEvent(event->x, event->y);
gtk_widget_queue_draw( widget );
self->m_buttunOneSelected = true;
}else if (event->type == GDK_2BUTTON_PRESS) {
//EDN_INFO("mouse-event BT1 ==> Double Clicked %d, %d", (uint32_t)event->x, (uint32_t)event->y);
self->m_bufferManager->Get(self->m_bufferID)->MouseEventDouble();
gtk_widget_queue_draw( widget );
self->m_buttunOneSelected = true;
}else if (event->type == GDK_3BUTTON_PRESS) {
//EDN_INFO("mouse-event BT1 ==> Triple Clicked");
self->m_bufferManager->Get(self->m_bufferID)->MouseEventTriple();
gtk_widget_queue_draw( widget );
self->m_buttunOneSelected = true;
}else if (event->type == GDK_BUTTON_RELEASE) {
//EDN_INFO("mouse-event BT1 ==> Realease");
self->m_buttunOneSelected = false;
self->m_bufferManager->Get(self->m_bufferID)->Copy(COPY_MIDDLE_BUTTON);
}
} else if (event->button == 2) {
if (event->type == GDK_BUTTON_PRESS) {
EDN_INFO("mouse-event BT2 PRESS");
self->m_bufferManager->Get(self->m_bufferID)->MouseEvent(event->x, event->y);
self->m_bufferManager->Get(self->m_bufferID)->Paste(COPY_MIDDLE_BUTTON);
gtk_widget_queue_draw(widget);
}
} else if (event->button == 3) {
if (event->type == GDK_BUTTON_PRESS) {
EDN_INFO("mouse-event BT3 PRESS");
}
} else {
EDN_INFO("mouse-event BT" << event->type <<" PRESS");
}
return true;
}
gint CodeView::CB_mouseMotionEvent( GtkWidget *widget, GdkEventMotion *event, gpointer data)
{
CodeView * self = reinterpret_cast<CodeView*>(data);
if (true == self->m_buttunOneSelected) {
int x, y;
GdkModifierType state;
if (event->is_hint) {
gdk_window_get_pointer(event->window, &x, &y, &state);
} else {
x = event->x;
y = event->y;
state = (GdkModifierType)event->state;
}
if (x<0) {
x = 0;
}
if (y<0) {
y = 0;
}
//EDN_INFO("mouse-motion BT1 %d, %d", x, y);
self->m_bufferManager->Get(self->m_bufferID)->MouseSelectFromCursorTo(x, y);
gtk_widget_queue_draw( widget );
}
return true;
}
gint CodeView::CB_mouseScrollEvent( GtkWidget *widget, GdkEventScroll *event, gpointer data)
{
CodeView * self = reinterpret_cast<CodeView*>(data);
if (event->direction == GDK_SCROLL_UP)
{
// up code
//EDN_INFO("mouse-event GDK_SCROLL_UP");
self->m_bufferManager->Get(self->m_bufferID)->ScrollUp();
gtk_widget_queue_draw( widget );
}
else if (event->direction == GDK_SCROLL_DOWN)
{
// down code
//EDN_INFO("mouse-event GDK_SCROLL_DOWN");
self->m_bufferManager->Get(self->m_bufferID)->ScrollDown();
gtk_widget_queue_draw( widget );
} else {
EDN_INFO("mouse-event SCROLL");
}
return true;
}

View File

@ -1,67 +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 "tools_debug.h"
#include "Singleton.h"
#include "CodeView.h"
#include "BufferManager.h"
#include "Display.h"
#include "MsgBroadcast.h"
class CodeView : public MsgBroadcast
{
public:
// Constructeur
CodeView(void);
~CodeView(void);
void OnMessage(int32_t id, int32_t dataID);
GtkWidget *GetMainWidget(void);
// sur : GTK+ callback :
static gboolean CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data);
static gboolean CB_displayInit( GtkWidget *widget, gpointer data);
static gint CB_focusGet( GtkWidget *widget, GdkEventFocus *event, gpointer data);
static gint CB_focusLost( GtkWidget *widget, GdkEventFocus *event, gpointer data);
static gint CB_keyboardEvent( GtkWidget *widget, GdkEventKey *event, gpointer data);
static gint CB_mouseButtonEvent(GtkWidget *widget, GdkEventButton *event, gpointer data);
static gint CB_mouseMotionEvent( GtkWidget *widget, GdkEventMotion *event, gpointer data);
static gint CB_mouseScrollEvent( GtkWidget *widget, GdkEventScroll *event, gpointer data);
private:
// main windows widget :
GtkWidget * m_widget;
// récupération des proprieter général...
BufferManager * m_bufferManager;
ColorizeManager * m_colorManager;
int32_t m_shawableAreaX;
int32_t m_shawableAreaY;
int32_t m_bufferID;
bool m_buttunOneSelected;
};
#endif

View File

@ -1,59 +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 "tools_debug.h"
#include "Singleton.h"
class MainAreaView: public Singleton<MainAreaView>
{
friend class Singleton<MainAreaView>;
// specific for sigleton system...
private:
// Constructeur
MainAreaView(void);
~MainAreaView(void);
public:
GtkWidget * GetWidget(void);
void SplitV(void); // split current window vertically (max 1 by section)
void SplitH(void); // split current window horizontaly (max 3)
void Remove(void); // remove current selected element
//ViewArea * GetCurent(void); // Get a pointer on the current displayed area
private:
GtkWidget * m_localDialog; //!< local dialog element
ViewArea * m_EntrySearch[6];
uint8_t m_CurentSelected
};
#endif

View File

@ -1,211 +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 "tools_debug.h"
#include "tools_globals.h"
#include "MainWindows.h"
#include "CodeView.h"
#include "ClipBoard.h"
#include "BufferView.h"
#include "AccelKey.h"
#undef __class__
#define __class__ "MainWindows"
MainWindows::MainWindows(void) : MsgBroadcast("Main Windows", EDN_CAT_GUI)
{
m_mainWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
// select the program icone
GError *err = NULL;
Edn::String iconeFile;
#ifdef NDEBUG
iconeFile = "/usr/share/edn/images/icone.png";
#else
iconeFile = "./data/imagesSources/icone.png";
#endif
GdkPixbuf * icone = gdk_pixbuf_new_from_file(iconeFile.c_str(), &err);
if (err != NULL) {
gtk_window_set_default_icon_name("text-editor");
} else {
gtk_window_set_icon(GTK_WINDOW(m_mainWindow), icone);
}
// Default size open windows
gtk_window_set_default_size(GTK_WINDOW(m_mainWindow), 800, 600);
// enable the close signal of the windows
g_signal_connect(G_OBJECT(m_mainWindow), "delete-event", G_CALLBACK(OnQuit), this);
g_signal_connect(G_OBJECT(m_mainWindow), "window-state-event", G_CALLBACK(OnStateChange), this);
//g_signal_connect(G_OBJECT(m_mainWindow), "destroy", G_CALLBACK(OnQuit), this);
// remove decoration
//gtk_window_set_decorated(GTK_WINDOW(m_mainWindow), FALSE);
// Create a vertical box for stacking the menu and editor widgets in.
GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add(GTK_CONTAINER(m_mainWindow), vbox);
// Set key Accelerator :
AccelKey::getInstance()->LinkCommonAccel(GTK_WINDOW(m_mainWindow));
// Create the menu bar.
#if 0
gtk_box_pack_start( GTK_BOX (vbox), m_MenuBar.GetWidget(), FALSE, FALSE, 0);
#else
GtkWidget *hboxMenu = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start( GTK_BOX (vbox), hboxMenu, FALSE, FALSE, 0);
// Add Exit boutton
Edn::String ExitIconeFile;
#ifdef NDEBUG
ExitIconeFile = "/usr/share/edn/images/delete-24px.png";
#else
ExitIconeFile = "./data/imagesSources/delete-24px.png";
#endif
// TODO : find a good way to chenge the size of an image
GtkWidget *myImageQuit = gtk_image_new_from_file(ExitIconeFile.c_str());
GtkIconSize mySize = GTK_ICON_SIZE_SMALL_TOOLBAR;
//EDN_DEBUG(" plop : " << mySize);
//gtk_image_get_icon_set( GTK_IMAGE(myImageQuit), NULL, &mySize);
//EDN_DEBUG(" plop : " << mySize);
GtkWidget *event_box = gtk_event_box_new();
gtk_container_add(GTK_CONTAINER(event_box),myImageQuit);
gtk_widget_add_events(event_box,GDK_BUTTON_PRESS_MASK);
g_signal_connect(G_OBJECT(event_box), "button_press_event", G_CALLBACK(OnQuit), this);
gtk_box_pack_start( GTK_BOX(hboxMenu), event_box, FALSE, FALSE, 0);
// add the real menu bar
gtk_box_pack_start( GTK_BOX (hboxMenu), m_MenuBar.GetWidget(), FALSE, FALSE, 0);
// Add title
#endif
// **********************************************************
// * Horizontal ELEMENTS : *
// **********************************************************
// Create a vertical box for stacking the menu and editor widgets in.
GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
gtk_container_add(GTK_CONTAINER (vbox), hbox);
// create the toolbar :
# if USE_GTK_VERSION_2_0
//gtk_box_pack_start(GTK_BOX(hbox), m_ToolBar.GetWidget(), FALSE, FALSE, 0);
# endif
// TreeView :
gtk_box_pack_start(GTK_BOX(hbox), m_BufferView.GetMainWidget(), FALSE, TRUE, 1);
// Text displayer :
gtk_box_pack_start( GTK_BOX (hbox), m_CodeView.GetMainWidget(), TRUE, TRUE, 0);
// Create the status bar
//gtk_box_pack_end(GTK_BOX(vbox), m_StatusBar.GetWidget(), FALSE, FALSE, 0);
// recursive version of gtk_widget_show
gtk_widget_show_all(m_mainWindow);
}
MainWindows::~MainWindows(void)
{
/*
if (NULL != m_DlgSearch) {
delete m_DlgSearch;
}
*/
}
void MainWindows::SetTitle(Edn::File &fileName, bool isModify)
{
Edn::String tmp = "";
if (fileName.GetShortFilename() != "") {
tmp += fileName.GetShortFilename();
tmp += " - ";
tmp += fileName.GetFolder();
tmp += " - ";
}
tmp += "Edn";
gtk_window_set_title(GTK_WINDOW(m_mainWindow), tmp.c_str());
}
void MainWindows::SetNoTitle(void)
{
Edn::String tmp = "Edn";
gtk_window_set_title(GTK_WINDOW(m_mainWindow), tmp.c_str());
}
void MainWindows::OnMessage(int32_t id, int32_t dataID)
{
switch (id)
{
case EDN_MSG__BUFFER_CHANGE_CURRENT:
// change Title :
// TODO : String error when remove the error with -1;
if (-1 == dataID) {
SetNoTitle();
} else {
Buffer *mybuf = BufferManager::getInstance()->Get(dataID);
if (NULL != mybuf) {
Edn::File plop = mybuf->GetFileName();
SetTitle(plop, mybuf->IsModify() );
}
}
break;
}
}
bool MainWindows::OnQuit(GtkWidget *widget, gpointer data)
{
//MainWindows * self = reinterpret_cast<MainWindows*>(data);
GeneralSendMessage(EDN_MSG__GUI_SHOW_EXIT_CONFIRMATION);
// Close is not managed here ...
return true;
}
gboolean MainWindows::OnStateChange(GtkWidget *widget, GdkEvent* event, gpointer data)
{
MainWindows * self = reinterpret_cast<MainWindows*>(data);
EDN_DEBUG("State change");
EDN_INFO(" change state mask : " << event->window_state.changed_mask);
EDN_INFO(" change state new val : " << event->window_state.new_window_state);
if (event->window_state.changed_mask == GDK_WINDOW_STATE_MAXIMIZED) {
EDN_INFO(" ==> Maximisation change...");
if (event->window_state.new_window_state == GDK_WINDOW_STATE_MAXIMIZED) {
EDN_INFO(" ==> ENABLE");
gtk_window_set_decorated(GTK_WINDOW(self->m_mainWindow), FALSE);
} else {
EDN_INFO(" ==> DISABLE");
gtk_window_set_decorated(GTK_WINDOW(self->m_mainWindow), TRUE);
}
}
}

View File

@ -1,70 +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.
*
*******************************************************************************
*/
#include "tools_debug.h"
#include "Singleton.h"
#include "MsgBroadcast.h"
#include "CodeView.h"
#include "BufferView.h"
#include "BufferManager.h"
#include "MenuBar.h"
#include "StatusBar.h"
#include "ToolBar.h"
#ifndef __MAIN_WINDOWS_H__
#define __MAIN_WINDOWS_H__
class MainWindows: public Singleton<MainWindows>, public MsgBroadcast
{
friend class Singleton<MainWindows>;
// specific for sigleton system...
private:
// Constructeur
MainWindows(void);
~MainWindows(void);
public:
GtkWidget * GetWidget(void) { return m_mainWindow;};
void OnMessage(int32_t id, int32_t dataID);
static bool OnQuit(GtkWidget *widget, gpointer data);
static gboolean OnStateChange(GtkWidget *widget, GdkEvent* event, gpointer data);
private:
void SetTitle(Edn::File &fileName, bool isModify);
void SetNoTitle(void);
// main windows widget :
GtkWidget * m_mainWindow;
BufferView m_BufferView;
CodeView m_CodeView;
MenuBar m_MenuBar;
StatusBar m_StatusBar;
ToolBar m_ToolBar;
};
#endif

View File

@ -1,381 +0,0 @@
/**
*******************************************************************************
* @file MenuBar.cpp
* @brief Editeur De N'ours : abstraction of the menu bar (Sources)
* @author Edouard DUPIN
* @date 17/06/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 "tools_debug.h"
#include "MenuBar.h"
#include "ClipBoard.h"
#include "charset.h"
#include "ColorizeManager.h"
#define MENU_MSG
const char * MSG_TogleDisplayChar = "Request a Togle of char displaying";
const char * MSG_TogleDisplayEOL = "Request a Togle of displaying EndOfLine";
const char * MSG_TogleAutoIndent = "Request a Togle of Auto Indent";
const char * MSG_SetCharsetIso559_1 = "Set ISO 5589-1";
const char * MSG_SetCharsetIso559_15 = "Set ISO 5589-15";
const char * MSG_SetCharsetUTF8 = "Set UTF 8";
const char * MSG_LoadColorBlack = "Load Color Black";
const char * MSG_LoadColorWhite = "Load Color White";
#define MSG_LINK(data)
static void CB_menuGenerique(GtkMenuItem *menu_item, gpointer data)
{
//EDN_INFO("basic menue_event");
messageData_ts * msg = (messageData_ts*)data;
GeneralSendMessage(msg->msgId, msg->dataId);
}
static void CB_menuInternal(GtkMenuItem *menu_item, gpointer data)
{
//EDN_INFO("basic menue_event");
const char * myPointer = (const char*)data;
if (myPointer == MSG_TogleDisplayChar) {
if (globals::IsSetDisplaySpaceChar() == true) {
globals::SetDisplaySpaceChar(false);
} else {
globals::SetDisplaySpaceChar(true);
}
} else if (myPointer == MSG_TogleDisplayEOL) {
if (globals::IsSetDisplayEndOfLine() == true) {
globals::SetDisplayEndOfLine(false);
} else {
globals::SetDisplayEndOfLine(true);
}
} else if (myPointer == MSG_TogleAutoIndent) {
if (globals::IsSetAutoIndent() == true) {
globals::SetAutoIndent(false);
} else {
globals::SetAutoIndent(true);
}
} else if (myPointer == MSG_SetCharsetIso559_1) {
GeneralSendMessage(EDN_MSG__CURRENT_SET_CHARSET, EDN_CHARSET_ISO_8859_1);
} else if (myPointer == MSG_SetCharsetIso559_15) {
GeneralSendMessage(EDN_MSG__CURRENT_SET_CHARSET, EDN_CHARSET_ISO_8859_15);
} else if (myPointer == MSG_SetCharsetUTF8) {
GeneralSendMessage(EDN_MSG__CURRENT_SET_CHARSET, EDN_CHARSET_UTF8);
} else if (myPointer == MSG_LoadColorWhite) {
ColorizeManager * myColorSystem = ColorizeManager::getInstance();
Edn::String homedir;
# ifdef NDEBUG
homedir = "/usr/share/edn/";
# else
homedir = "./data/";
# endif
homedir += "color_white.xml";
myColorSystem->LoadFile(homedir);
} else if (myPointer == MSG_LoadColorBlack) {
ColorizeManager * myColorSystem = ColorizeManager::getInstance();
Edn::String homedir;
# ifdef NDEBUG
homedir = "/usr/share/edn/";
# else
homedir = "./data/";
# endif
homedir += "color_black.xml";
myColorSystem->LoadFile(homedir);
}
}
#undef __class__
#define __class__ "MenuBarMain"
class MenuBarMain
{
public:
MenuBarMain(const char * title, GtkWidget * parent) : m_parent(NULL), m_menu(NULL), m_menuListe(NULL)
{
m_parent = parent;
m_menu = gtk_menu_item_new_with_mnemonic(title);
gtk_menu_shell_append( GTK_MENU_SHELL (parent), m_menu);
}
~MenuBarMain(void)
{
}
private:
void CheckSubMenu(void)
{
if (NULL == m_menuListe) {
m_menuListe = gtk_menu_new();
if (NULL != m_menuListe) {
gtk_menu_item_set_submenu( GTK_MENU_ITEM (m_menu), m_menuListe);
} else {
EDN_ERROR("Can not create sub menu");
}
}
}
public:
void AddInternal(const char * title, const char * accelKey, const char * msg, bool enable = false)
{
CheckSubMenu();
if (NULL == m_menuListe) {
return;
}
// create ITEM
GtkWidget *tmpWidget = gtk_menu_item_new_with_mnemonic(title);
// set grisage :
gtk_widget_set_sensitive(tmpWidget, enable);
// add to the menu :
gtk_menu_shell_append(GTK_MENU_SHELL(m_menuListe), tmpWidget);
// accel KEY :
AccelKey::getInstance()->SetAccel(tmpWidget, (char *)accelKey);
// set callback
g_signal_connect(G_OBJECT(tmpWidget), "activate", G_CALLBACK(CB_menuInternal), (void*)msg);
}
void Add(const char * title, const char * accelKey, messageType_te id = EDN_MSG__NONE, bool enable = false, int32_t dataSpecificID = -1)
{
CheckSubMenu();
if (NULL == m_menuListe) {
return;
}
messageData_ts * message = new messageData_ts;
message->msgId = id;
message->dataId = dataSpecificID;
m_message.PushBack(message);
// create ITEM
GtkWidget *tmpWidget = gtk_menu_item_new_with_mnemonic(title);
// set grisage :
gtk_widget_set_sensitive(tmpWidget, enable);
// add to the menu :
gtk_menu_shell_append(GTK_MENU_SHELL(m_menuListe), tmpWidget);
// accel KEY :
AccelKey::getInstance()->SetAccel(tmpWidget, (char *)accelKey);
// set callback
if(EDN_MSG__NONE!=id) {
g_signal_connect(G_OBJECT(tmpWidget), "activate", G_CALLBACK(CB_menuGenerique), message);
}
}
void AddGen(const char * title, const char * accelKey, messageType_te id = EDN_MSG__NONE, bool enable = false, int32_t dataSpecificID = -1)
{
CheckSubMenu();
if (NULL == m_menuListe) {
return;
}
messageData_ts * message = new messageData_ts;
message->msgId = id;
message->dataId = dataSpecificID;
m_message.PushBack(message);
// create ITEM
GtkWidget *tmpWidget = gtk_image_menu_item_new_from_stock( title, AccelKey::getInstance()->GetAccel() );
// set grisage :
gtk_widget_set_sensitive(tmpWidget, enable);
// add to the menu :
gtk_menu_shell_append(GTK_MENU_SHELL(m_menuListe), tmpWidget);
// accel KEY :
AccelKey::getInstance()->SetAccel(tmpWidget, (char *)accelKey);
// set callback
if(EDN_MSG__NONE!=id) {
g_signal_connect(G_OBJECT(tmpWidget), "activate", G_CALLBACK(CB_menuGenerique), message);
}
}
void AddSeparator(void)
{
CheckSubMenu();
if (NULL == m_menuListe) {
return;
}
gtk_menu_shell_append(GTK_MENU_SHELL (m_menuListe), gtk_separator_menu_item_new() );
}
private:
GtkWidget * m_parent;
GtkWidget * m_menu;
GtkWidget * m_menuListe;
Edn::VectorType<messageData_ts*> m_message;
};
#undef __class__
#define __class__ "MenuBar"
MenuBar::MenuBar(void) : MsgBroadcast("Menu bar", EDN_CAT_GUI)
{
m_mainWidget = gtk_menu_bar_new();
MenuBarMain *tmp = NULL;
tmp = new MenuBarMain("_File", m_mainWidget);
tmp->AddGen(GTK_STOCK_NEW, "ctrl+n", EDN_MSG__NEW, true);
tmp->AddGen(GTK_STOCK_OPEN, "ctrl+o", EDN_MSG__GUI_SHOW_OPEN_FILE, true);
tmp->AddSeparator();
tmp->AddGen("Close file", "ctrl+q", EDN_MSG__CURRENT_CLOSE, true);
tmp->AddSeparator();
tmp->AddGen(GTK_STOCK_SAVE, "ctrl+s", EDN_MSG__CURRENT_SAVE, true);
tmp->AddGen(GTK_STOCK_SAVE_AS, "ctrl+shift+s", EDN_MSG__CURRENT_SAVE_AS, true);
tmp->AddSeparator();
tmp->AddGen(GTK_STOCK_QUIT, "ctrl+shift+q", EDN_MSG__GUI_SHOW_EXIT_CONFIRMATION, true);
m_listMenu.PushBack(tmp);
tmp = new MenuBarMain("_Edit", m_mainWidget);
tmp->AddGen(GTK_STOCK_UNDO, "ctrl+z", EDN_MSG__CURRENT_UNDO, true);
tmp->AddGen(GTK_STOCK_REDO, "ctrl+shift+z", EDN_MSG__CURRENT_REDO, true);
tmp->AddSeparator();
tmp->AddGen(GTK_STOCK_CUT, "ctrl+x", EDN_MSG__CURRENT_CUT, true, COPY_STD);
tmp->AddGen(GTK_STOCK_COPY, "ctrl+c", EDN_MSG__CURRENT_COPY, true, COPY_STD);
tmp->AddGen(GTK_STOCK_PASTE, "ctrl+v", EDN_MSG__CURRENT_PASTE, true, COPY_STD);
// tmp->AddGen(GTK_STOCK_DELETE, NULL);
tmp->AddGen("Remove line", "ctrl+w", EDN_MSG__CURRENT_REMOVE_LINE, true);
tmp->AddSeparator();
tmp->AddGen(GTK_STOCK_SELECT_ALL, "ctrl+a", EDN_MSG__CURRENT_SELECT_ALL, true);
tmp->AddGen("Unselect", "ctrl+shift+a", EDN_MSG__CURRENT_UN_SELECT, true);
tmp->AddSeparator();
tmp->AddGen("Goto Line number ...", "ctrl+l", EDN_MSG__GUI_SHOW_GOTO_LINE, true);
// tmp->AddSeparator();
// tmp->AddGen(GTK_STOCK_PREFERENCES, NULL, EDN_MSG__GUI_SHOW_PREFERENCE, true);
m_listMenu.PushBack(tmp);
tmp = new MenuBarMain("_Search", m_mainWidget);
tmp->AddGen(GTK_STOCK_FIND, "ctrl+f", EDN_MSG__GUI_SHOW_SEARCH, true);
tmp->AddGen(GTK_STOCK_FIND_AND_REPLACE, "ctrl+r", EDN_MSG__GUI_SHOW_REPLACE, true);
tmp->AddSeparator();
tmp->AddGen("Find next", "ctrl+h", EDN_MSG__CURRENT_FIND_NEXT, true);
tmp->AddGen("Find previous", "ctrl+shift+h", EDN_MSG__CURRENT_FIND_PREVIOUS, true);
// tmp->AddGen("Find old next", "ctrl+g", EDN_MSG__CURRENT_FIND_OLD_NEXT, true);
// tmp->AddGen("Find old previous", "ctrl+shift+g", EDN_MSG__CURRENT_FIND_OLD_PREVIOUS, true);
// tmp->AddSeparator();
// tmp->AddGen("Suprimer colorisation", NULL);
// tmp->AddSeparator();
// tmp->AddGen("Goto Line", "ctrl+l", EDN_MSG__CURRENT_GOTO_LINE, true);
m_listMenu.PushBack(tmp);
tmp = new MenuBarMain("Display", m_mainWidget);
tmp->AddInternal("Show space & tabs", NULL, MSG_TogleDisplayChar, true);
tmp->AddInternal("Show end of lines", NULL, MSG_TogleDisplayEOL, true);
tmp->AddInternal("Audo Indent", NULL, MSG_TogleAutoIndent, true);
tmp->AddSeparator();
tmp->AddInternal("Set charset Occidental (ISO-8859-1)", NULL, MSG_SetCharsetIso559_1, true);
tmp->AddInternal("Set charset Occidental (ISO-8859-15)", NULL, MSG_SetCharsetIso559_15, true);
tmp->AddInternal("Set charset Internationnal (UTF 8)", NULL, MSG_SetCharsetUTF8, true);
tmp->AddSeparator();
tmp->AddGen( "Reload Color File", NULL, EDN_MSG__RELOAD_COLOR_FILE, true);
tmp->AddSeparator();
tmp->AddInternal("Set Color Black", NULL, MSG_LoadColorBlack, true);
tmp->AddInternal("Set Color White", NULL, MSG_LoadColorWhite, true);
m_listMenu.PushBack(tmp);
/*
tmp = new MenuBarMain("Project", m_mainWidget);
m_listMenu.PushBack(tmp);
*/
tmp = new MenuBarMain("Ctags", m_mainWidget);
tmp->AddGen("load Ctags file", NULL, EDN_MSG__OPEN_CTAGS, true);
tmp->AddGen("re-load Ctags file", NULL, EDN_MSG__RELOAD_CTAGS, true);
tmp->AddSeparator();
tmp->AddGen("Find Definition", "ctrl+d", EDN_MSG__JUMP_TO_CURRENT_SELECTION, true);
tmp->AddGen("Back previous", "ctrl+shift+d", EDN_MSG__JUMP_BACK, true);
/*
tmp->AddGen("Gestion Ctags", NULL);
tmp->AddGen("Add Ctags Folder", NULL);
tmp->AddSeparator();
tmp->AddGen("Trouver la definition", NULL);
tmp->AddGen("Trouver la declaration", NULL);
tmp->AddGen("Retour...", NULL);
tmp->AddSeparator();
tmp->AddGen("Tout desactiver", NULL);
*/
m_listMenu.PushBack(tmp);
/*
tmp = new MenuBarMain("Macros", m_mainWidget);
m_listMenu.PushBack(tmp);
*/
/*
tmp = new MenuBarMain("Tools", m_mainWidget);
tmp->AddGen("Execute Commande", "ctrl+e");
tmp->AddGen("Set Command", NULL);
m_listMenu.PushBack(tmp);
*/
tmp = new MenuBarMain("Internal ClipBoard", m_mainWidget);
// tmp->AddGen("Cut 1", "ctrl+alt+1", EDN_MSG__CURRENT_CUT, true, 1);
tmp->AddGen("Copy 1", "ctrl+1", EDN_MSG__CURRENT_COPY, true, 1);
tmp->AddGen("Paste 1", "alt+1", EDN_MSG__CURRENT_PASTE, true, 1);
tmp->AddSeparator();
// tmp->AddGen("Cut 2", "ctrl+alt+2", EDN_MSG__CURRENT_CUT, true, 2);
tmp->AddGen("Copy 2", "ctrl+2", EDN_MSG__CURRENT_COPY, true, 2);
tmp->AddGen("Paste 2", "alt+2", EDN_MSG__CURRENT_PASTE, true, 2);
tmp->AddSeparator();
// tmp->AddGen("Cut 3", "ctrl+alt+3", EDN_MSG__CURRENT_CUT, true, 3);
tmp->AddGen("Copy 3", "ctrl+3", EDN_MSG__CURRENT_COPY, true, 3);
tmp->AddGen("Paste 3", "alt+3", EDN_MSG__CURRENT_PASTE, true, 3);
tmp->AddSeparator();
// tmp->AddGen("Cut 4", "ctrl+alt+4", EDN_MSG__CURRENT_CUT, true, 4);
tmp->AddGen("Copy 4", "ctrl+4", EDN_MSG__CURRENT_COPY, true, 4);
tmp->AddGen("Paste 4", "alt+4", EDN_MSG__CURRENT_PASTE, true, 4);
tmp->AddSeparator();
// tmp->AddGen("Cut 5", "ctrl+alt+5", EDN_MSG__CURRENT_CUT, true, 5);
tmp->AddGen("Copy 5", "ctrl+5", EDN_MSG__CURRENT_COPY, true, 5);
tmp->AddGen("Paste 5", "alt+5", EDN_MSG__CURRENT_PASTE, true, 5);
tmp->AddSeparator();
// tmp->AddGen("Cut 6", "ctrl+alt+6", EDN_MSG__CURRENT_CUT, true, 6);
tmp->AddGen("Copy 6", "ctrl+6", EDN_MSG__CURRENT_COPY, true, 6);
tmp->AddGen("Paste 6", "alt+6", EDN_MSG__CURRENT_PASTE, true, 6);
tmp->AddSeparator();
// tmp->AddGen("Cut 7", "ctrl+alt+7", EDN_MSG__CURRENT_CUT, true, 7);
tmp->AddGen("Copy 7", "ctrl+7", EDN_MSG__CURRENT_COPY, true, 7);
tmp->AddGen("Paste 7", "alt+7", EDN_MSG__CURRENT_PASTE, true, 7);
tmp->AddSeparator();
// tmp->AddGen("Cut 8", "ctrl+alt+8", EDN_MSG__CURRENT_CUT, true, 8);
tmp->AddGen("Copy 8", "ctrl+8", EDN_MSG__CURRENT_COPY, true, 8);
tmp->AddGen("Paste 8", "alt+8", EDN_MSG__CURRENT_PASTE, true, 8);
tmp->AddSeparator();
// tmp->AddGen("Cut 9", "ctrl+alt+9", EDN_MSG__CURRENT_CUT, true, 9);
tmp->AddGen("Copy 9", "ctrl+9", EDN_MSG__CURRENT_COPY, true, 9);
tmp->AddGen("Paste 9", "alt+9", EDN_MSG__CURRENT_PASTE, true, 9);
m_listMenu.PushBack(tmp);
tmp = new MenuBarMain("Help", m_mainWidget);
tmp->AddGen("help display", NULL, EDN_MSG__OPEN_CTAGS, false);
tmp->AddSeparator();
tmp->AddGen("About ...", NULL, EDN_MSG__GUI_SHOW_ABOUT, true);
/*
tmp->AddGen("Gestion Ctags", NULL);
tmp->AddGen("Add Ctags Folder", NULL);
tmp->AddSeparator();
tmp->AddGen("Trouver la definition", NULL);
tmp->AddGen("Trouver la declaration", NULL);
tmp->AddGen("Retour...", NULL);
tmp->AddSeparator();
tmp->AddGen("Tout desactiver", NULL);
*/
m_listMenu.PushBack(tmp);
}
MenuBar::~MenuBar(void)
{
}
void MenuBar::OnMessage(int32_t id, int32_t dataID)
{
//EDN_INFO("ReceiveMessage");
}

View File

@ -1,53 +0,0 @@
/**
*******************************************************************************
* @file MenuBar.h
* @brief Editeur De N'ours : abstraction of the menu bar (Header)
* @author Edouard DUPIN
* @date 17/06/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 "tools_debug.h"
#include "tools_globals.h"
#include "MsgBroadcast.h"
#include "VectorType.h"
#include "AccelKey.h"
#ifndef __MENU_BAR_H__
#define __MENU_BAR_H__
class MenuBarMain;
class MenuBar: public MsgBroadcast
{
public:
// Constructeur
MenuBar(void);
~MenuBar(void);
GtkWidget * GetWidget(void) { return m_mainWidget; };
void OnMessage(int32_t id, int32_t dataID);
private:
GtkWidget * m_mainWidget;
GtkAccelGroup * m_accelGroup;
Edn::VectorType<MenuBarMain*> m_listMenu;
};
#endif

View File

@ -1,52 +0,0 @@
/**
*******************************************************************************
* @file StatusBar.cpp
* @brief Editeur De N'ours : abstraction of the status bar (Sources)
* @author Edouard DUPIN
* @date 17/06/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 "tools_debug.h"
#include "StatusBar.h"
StatusBar::StatusBar(void) : MsgBroadcast("Status bar", EDN_CAT_GUI)
{
m_mainWidget = gtk_statusbar_new();
// pas très bien compris pourquoi mais ca marche...
m_iContextId = gtk_statusbar_get_context_id(GTK_STATUSBAR(m_mainWidget), "ExitMsg");
// ajout d'un message :
gtk_statusbar_push(GTK_STATUSBAR (m_mainWidget), GPOINTER_TO_INT(m_iContextId), "Edn Editeur de n'ours");
// Supression du précédent message :
//gtk_statusbar_pop(GTK_STATUSBAR(m_mainWidget), GPOINTER_TO_INT(m_iContextId));
}
StatusBar::~StatusBar(void)
{
}
void StatusBar::OnMessage(int32_t id, int32_t dataID)
{
//EDN_INFO("ReceiveMessage");
}

View File

@ -1,46 +0,0 @@
/**
*******************************************************************************
* @file StatusBar.h
* @brief Editeur De N'ours : abstraction of the status bar (Header)
* @author Edouard DUPIN
* @date 17/06/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 "MsgBroadcast.h"
#ifndef __STATUS_BAR_H__
#define __STATUS_BAR_H__
class StatusBar: public MsgBroadcast
{
public:
// Constructeur
StatusBar(void);
~StatusBar(void);
GtkWidget * GetWidget(void) { return m_mainWidget; };
void OnMessage(int32_t id, int32_t dataID);
private:
GtkWidget * m_mainWidget;
guint m_iContextId;
};
#endif

View File

@ -1,93 +0,0 @@
/**
*******************************************************************************
* @file ToolBar.cpp
* @brief Editeur De N'ours : abstraction of the tool bar (Sources)
* @author Edouard DUPIN
* @date 17/06/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 "tools_debug.h"
#include "ToolBar.h"
#include "ClipBoard.h"
static void CB_menuGenerique(GtkMenuItem *menu_item, gpointer data)
{
//EDN_INFO("basic menue_event");
messageData_ts * msg = (messageData_ts*)data;
// broacast message :
GeneralSendMessage(msg->msgId, msg->dataId);
}
ToolBar::ToolBar(void) : MsgBroadcast("Tool bar", EDN_CAT_GUI)
{
m_mainWidget = gtk_toolbar_new();
# ifdef USE_GTK_VERSION_2_0
gtk_toolbar_set_orientation(GTK_TOOLBAR(m_mainWidget), GTK_ORIENTATION_VERTICAL);
# endif
// Modification de la taille des icones
gtk_toolbar_set_icon_size(GTK_TOOLBAR(m_mainWidget), GTK_ICON_SIZE_BUTTON);
// Affichage uniquement des icones
gtk_toolbar_set_style(GTK_TOOLBAR(m_mainWidget), GTK_TOOLBAR_ICONS);
Add(GTK_STOCK_NEW, "Nouveau", EDN_MSG__NEW);
Add(GTK_STOCK_OPEN, "Ouvrir", EDN_MSG__GUI_SHOW_OPEN_FILE);
AddSeparator();
Add(GTK_STOCK_SAVE, "Enregistrer", EDN_MSG__CURRENT_SAVE);
Add(GTK_STOCK_SAVE_AS, "Enregistrer sous", EDN_MSG__CURRENT_SAVE_AS);
AddSeparator();
Add(GTK_STOCK_QUIT, "Quitter");
}
ToolBar::~ToolBar(void)
{
}
void ToolBar::OnMessage(int32_t id, int32_t dataID)
{
//EDN_INFO("ReceiveMessage");
}
void ToolBar::AddSeparator(void)
{
# ifdef USE_GTK_VERSION_3_0
# elif defined( USE_GTK_VERSION_2_0)
gtk_toolbar_append_space(GTK_TOOLBAR(m_mainWidget));
# endif
}
void ToolBar::Add(const char * title, const char * labelHelp, messageType_te id, bool enable)
{
messageData_ts * message = new messageData_ts;
message->msgId = id;
message->dataId = -1;
m_message.PushBack(message);
# ifdef USE_GTK_VERSION_3_0
# elif defined( USE_GTK_VERSION_2_0)
gtk_toolbar_insert_stock(GTK_TOOLBAR(m_mainWidget), title, labelHelp, NULL, G_CALLBACK(CB_menuGenerique), message, -1);
# endif
}

View File

@ -1,49 +0,0 @@
/**
*******************************************************************************
* @file ToolBar.h
* @brief Editeur De N'ours : abstraction of the tool bar (Header)
* @author Edouard DUPIN
* @date 17/06/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 "MsgBroadcast.h"
#ifndef __TOOL_BAR_H__
#define __TOOL_BAR_H__
class ToolBar: public MsgBroadcast
{
public:
// Constructeur
ToolBar(void);
~ToolBar(void);
GtkWidget * GetWidget(void) { return m_mainWidget; };
void OnMessage(int32_t id, int32_t dataID);
private:
void AddSeparator(void);
void Add(const char * title, const char * labelHelp, messageType_te id = EDN_MSG__NONE, bool enable = false);
GtkWidget * m_mainWidget;
Edn::VectorType<messageData_ts*> m_message;
};
#endif

View File

@ -1,359 +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 "tools_globals.h"
#include "Search.h"
#include "SearchData.h"
#include "BufferManager.h"
#include "MainWindows.h"
#include "MsgBroadcast.h"
#undef __class__
#define __class__ "Search"
Search::Search(void)
: m_localDialog(NULL),
m_searchLabel(NULL),
m_searchEntry(NULL),
m_replaceLabel(NULL),
m_replaceEntry(NULL),
m_CkMatchCase(NULL),
m_CkWrapAround(NULL)
{
// nothing to do ...
}
Search::~Search(void)
{
if (NULL!=m_localDialog) {
gtk_widget_hide(m_localDialog);
gtk_widget_destroy(m_localDialog);
m_localDialog = NULL;
}
}
void Search::Display(GtkWindow *parent)
{
if(NULL == m_localDialog) {
m_localDialog = gtk_window_new(GTK_WINDOW_TOPLEVEL);
// set dialog not resisable
gtk_window_set_resizable(GTK_WINDOW(m_localDialog), FALSE);
// set the windows alwais on top of every all system windows
//gtk_window_set_keep_above(GTK_WINDOW(m_localDialog), TRUE);
// Set the dialog on top of the selected windows
gtk_window_set_transient_for(GTK_WINDOW(m_localDialog), parent);
// set the dialog on the top right
gtk_window_set_gravity(GTK_WINDOW(m_localDialog), GDK_GRAVITY_NORTH_EAST);
// Remove the dialogue from the task bar
gtk_window_set_skip_taskbar_hint(GTK_WINDOW(m_localDialog), TRUE);
// this element did not apear in the miniature of the windows
gtk_window_set_skip_pager_hint(GTK_WINDOW(m_localDialog), TRUE);
// select the program icone
//gtk_window_set_default_icon_name("Replace");
// set default title :
gtk_window_set_title(GTK_WINDOW(m_localDialog), "Search / Replace");
// Default size open windows
//gtk_window_set_default_size(GTK_WINDOW(m_localDialog), 300, 400);
// enable the close signal of the windows
g_signal_connect(G_OBJECT(m_localDialog), "destroy", G_CALLBACK(OnButtonQuit), this);
// Create a vertical box for stacking the menu and editor widgets in.
GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add(GTK_CONTAINER(m_localDialog), vbox);
// Set key Accelerator :
//AccelKey::getInstance()->LinkCommonAccel(GTK_WINDOW(m_localDialog));
// **********************************************************
// * Search Entry
// **********************************************************
{
GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
gtk_container_add(GTK_CONTAINER (vbox), hbox);
// search label
m_searchLabel = gtk_label_new("Search ");
gtk_box_pack_start(GTK_BOX(hbox), m_searchLabel, FALSE, TRUE, 0);
// Search entry
m_searchEntry = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(hbox), m_searchEntry, TRUE, TRUE, 0);
// Connect signals :
g_signal_connect(G_OBJECT(m_searchEntry), "activate", G_CALLBACK(OnButtonNext), this);
g_signal_connect(G_OBJECT(m_searchEntry), "changed", G_CALLBACK(OnEntrySearchChange), this);
}
// **********************************************************
// * Replace Entry
// **********************************************************
{
GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
gtk_container_add(GTK_CONTAINER (vbox), hbox);
// search label
m_replaceLabel = gtk_label_new("Replace");
gtk_box_pack_start(GTK_BOX(hbox), m_replaceLabel, FALSE, TRUE, 0);
// Search entry
m_replaceEntry = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(hbox), m_replaceEntry, TRUE, TRUE, 0);
// Connect signals :
g_signal_connect(G_OBJECT(m_replaceEntry), "changed", G_CALLBACK(OnEntryReplaceChange), this);
}
// **********************************************************
// * mode Selection
// **********************************************************
m_CkMatchCase = gtk_check_button_new_with_label("Case Sensitive");
gtk_container_add(GTK_CONTAINER (vbox), m_CkMatchCase);
m_CkWrapAround = gtk_check_button_new_with_label("Wrap arround");
gtk_container_add(GTK_CONTAINER (vbox), m_CkWrapAround);
m_CkRegularExpression = gtk_check_button_new_with_label("Regular Expression");
gtk_container_add(GTK_CONTAINER (vbox), m_CkRegularExpression);
// connect signals :
g_signal_connect(G_OBJECT(m_CkMatchCase), "activate", G_CALLBACK(OnCheckBoxEventCase), this);
g_signal_connect(G_OBJECT(m_CkMatchCase), "clicked", G_CALLBACK(OnCheckBoxEventCase), this);
g_signal_connect(G_OBJECT(m_CkWrapAround), "activate", G_CALLBACK(OnCheckBoxEventWrap), this);
g_signal_connect(G_OBJECT(m_CkWrapAround), "clicked", G_CALLBACK(OnCheckBoxEventWrap), this);
g_signal_connect(G_OBJECT(m_CkRegularExpression), "activate", G_CALLBACK(OnCheckBoxEventRegExp), this);
g_signal_connect(G_OBJECT(m_CkRegularExpression), "clicked", G_CALLBACK(OnCheckBoxEventRegExp), this);
// **********************************************************
// * Search / Replace button
// **********************************************************
{
GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
gtk_container_add(GTK_CONTAINER (vbox), hbox);
// Find previous
m_BtPrevious = gtk_button_new_with_label("Previous");
gtk_container_add(GTK_CONTAINER (hbox), m_BtPrevious);
// Find Next
m_BtNext = gtk_button_new_with_label("Next");
gtk_container_add(GTK_CONTAINER (hbox), m_BtNext);
// Replace
m_BtReplace = gtk_button_new_with_label("Replace");
gtk_container_add(GTK_CONTAINER (hbox), m_BtReplace);
// Replace & next
m_BtReplaceAndNext = gtk_button_new_with_label("Replace & Find");
gtk_container_add(GTK_CONTAINER (hbox), m_BtReplaceAndNext);
// Exit
m_BtQuit = gtk_button_new_with_label("Close");
gtk_container_add(GTK_CONTAINER (hbox), m_BtQuit);
// Connect signals :
g_signal_connect(G_OBJECT(m_BtPrevious), "activate", G_CALLBACK(OnButtonPrevious), this);
g_signal_connect(G_OBJECT(m_BtPrevious), "released", G_CALLBACK(OnButtonPrevious), this);
g_signal_connect(G_OBJECT(m_BtNext), "activate", G_CALLBACK(OnButtonNext), this);
g_signal_connect(G_OBJECT(m_BtNext), "released", G_CALLBACK(OnButtonNext), this);
g_signal_connect(G_OBJECT(m_BtReplace), "activate", G_CALLBACK(OnButtonReplace), this);
g_signal_connect(G_OBJECT(m_BtReplace), "released", G_CALLBACK(OnButtonReplace), this);
g_signal_connect(G_OBJECT(m_BtReplaceAndNext), "activate", G_CALLBACK(OnButtonReplaceAndNext), this);
g_signal_connect(G_OBJECT(m_BtReplaceAndNext), "released", G_CALLBACK(OnButtonReplaceAndNext), this);
g_signal_connect(G_OBJECT(m_BtQuit), "activate", G_CALLBACK(OnButtonQuit), this);
g_signal_connect(G_OBJECT(m_BtQuit), "released", G_CALLBACK(OnButtonQuit), this);
}
// recursive version of gtk_widget_show
gtk_widget_show_all(m_localDialog);
}
if(NULL == m_localDialog) {
EDN_ERROR("No search-dialog instance");
} else {
// update datas :
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_CkWrapAround), SearchData::GetWrap());
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_CkMatchCase), SearchData::GetCase());
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_CkRegularExpression), SearchData::GetRegExp());
if (true == SearchData::GetRegExp()) {
gtk_widget_set_sensitive(m_CkMatchCase, false);
} else {
gtk_widget_set_sensitive(m_CkMatchCase, true);
}
// Remove data form the search
Edn::String myDataString = "";
SearchData::SetSearch(myDataString);
gtk_entry_set_text(GTK_ENTRY(m_searchEntry), myDataString.c_str());
if (0 == strlen(myDataString.c_str())) {
m_haveSearchData = false;
} else {
m_haveSearchData = true;
}
SearchData::GetReplace(myDataString);
gtk_entry_set_text(GTK_ENTRY(m_replaceEntry), myDataString.c_str());
if (0 == strlen(myDataString.c_str())) {
m_haveReplaceData = false;
} else {
m_haveReplaceData = true;
}
gtk_widget_set_sensitive(m_BtPrevious, m_haveSearchData);
gtk_widget_set_sensitive(m_BtNext, m_haveSearchData);
// basic no search data
gtk_widget_set_sensitive(m_BtReplace, false);
gtk_widget_set_sensitive(m_BtReplaceAndNext, false);
// set focus on a specific widget :
//gtk_window_set_focus(parent, m_searchEntry);
gtk_widget_grab_focus(m_searchEntry);
// display the dialogue box
gtk_widget_show_all(m_localDialog);
// hide regular expression
gtk_widget_hide(m_CkRegularExpression);
}
}
void Search::Destroy(void)
{
if (NULL!=m_localDialog) {
gtk_widget_destroy(m_localDialog);
m_localDialog = NULL;
}
}
void Search::Hide(void)
{
gtk_widget_hide(m_localDialog);
}
void Search::OnButtonPrevious(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
GeneralSendMessage(EDN_MSG__CURRENT_FIND_PREVIOUS);
}
void Search::OnButtonNext(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
GeneralSendMessage(EDN_MSG__CURRENT_FIND_NEXT);
}
void Search::OnButtonReplace(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
GeneralSendMessage(EDN_MSG__CURRENT_REPLACE);
}
void Search::OnButtonReplaceAndNext(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
GeneralSendMessage(EDN_MSG__CURRENT_REPLACE);
GeneralSendMessage(EDN_MSG__CURRENT_FIND_NEXT);
}
void Search::OnButtonQuit(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
Search * self = reinterpret_cast<Search*>(data);
self->Destroy();
}
void Search::OnCheckBoxEventWrap(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
SearchData::SetWrap(true);
} else {
SearchData::SetWrap(false);
}
}
void Search::OnCheckBoxEventCase(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
SearchData::SetCase(true);
} else {
SearchData::SetCase(false);
}
}
void Search::OnCheckBoxEventRegExp(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
Search * self = reinterpret_cast<Search*>(data);
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
SearchData::SetRegExp(true);
gtk_widget_set_sensitive(self->m_CkMatchCase, false);
} else {
SearchData::SetRegExp(false);
gtk_widget_set_sensitive(self->m_CkMatchCase, true);
}
}
void Search::OnEntrySearchChange(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
Search * self = reinterpret_cast<Search*>(data);
// update research data
const char *testData = gtk_entry_get_text(GTK_ENTRY(widget));
if (NULL != testData) {
Edn::String myDataString = testData;
SearchData::SetSearch(myDataString);
if (0 == strlen(testData)) {
self->m_haveSearchData = false;
} else {
self->m_haveSearchData = true;
}
gtk_widget_set_sensitive(self->m_BtPrevious, self->m_haveSearchData);
gtk_widget_set_sensitive(self->m_BtNext, self->m_haveSearchData);
if (false == self->m_haveSearchData) {
gtk_widget_set_sensitive(self->m_BtReplace, false);
gtk_widget_set_sensitive(self->m_BtReplaceAndNext, false);
} else {
gtk_widget_set_sensitive(self->m_BtReplace, true);
gtk_widget_set_sensitive(self->m_BtReplaceAndNext, true);
}
}
}
void Search::OnEntryReplaceChange(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
Search * self = reinterpret_cast<Search*>(data);
// update replace data
const char *testData = gtk_entry_get_text(GTK_ENTRY(widget));
if (NULL != testData) {
Edn::String myDataString = testData;
SearchData::SetReplace(myDataString);
if (0 == strlen(testData)) {
self->m_haveReplaceData = false;
} else {
self->m_haveReplaceData = true;
}
if (false == self->m_haveSearchData) {
gtk_widget_set_sensitive(self->m_BtReplace, false);
gtk_widget_set_sensitive(self->m_BtReplaceAndNext, false);
} else {
gtk_widget_set_sensitive(self->m_BtReplace, true);
gtk_widget_set_sensitive(self->m_BtReplaceAndNext, true);
}
}
}

View File

@ -1,84 +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 "tools_debug.h"
#include "Singleton.h"
class Search: public Singleton<Search>
{
friend class Singleton<Search>;
// specific for sigleton system...
private:
// Constructeur
Search(void);
~Search(void);
public:
void Destroy(void);
void Display(GtkWindow *parent);
void Hide(void);
private:
GtkWidget * m_localDialog; //!< local dialog element
// entry
GtkWidget * m_searchLabel; //!< gtk label of the search section
GtkWidget * m_searchEntry; //!< gtk entry of the search section
GtkWidget * m_replaceLabel; //!< gtk label of the replace section
GtkWidget * m_replaceEntry; //!< gtk entry of the replace section
// checkbox
GtkWidget * m_CkMatchCase; //!< tick of the case matching
GtkWidget * m_CkWrapAround; //!< tick of the wrap the file
GtkWidget * m_CkRegularExpression; //!< the test is a regular expression
// button
GtkWidget * m_BtPrevious; //!< Button Previous
GtkWidget * m_BtNext; //!< Button Next
GtkWidget * m_BtReplace; //!< Button Replace
GtkWidget * m_BtReplaceAndNext; //!< Button Replace and find next
GtkWidget * m_BtQuit; //!< Button Quit
bool m_haveSearchData;
bool m_haveReplaceData;
// CallBack for GTK+ gui
private :
static void OnButtonPrevious(GtkWidget *widget, gpointer user_data);
static void OnButtonNext(GtkWidget *widget, gpointer user_data);
static void OnButtonReplace(GtkWidget *widget, gpointer user_data);
static void OnButtonReplaceAndNext(GtkWidget *widget, gpointer user_data);
static void OnButtonQuit(GtkWidget *widget, gpointer user_data);
static void OnCheckBoxEventCase(GtkWidget *widget, gpointer user_data);
static void OnCheckBoxEventWrap(GtkWidget *widget, gpointer user_data);
static void OnCheckBoxEventRegExp(GtkWidget *widget, gpointer user_data);
static void OnEntrySearchChange(GtkWidget *widget, gpointer user_data);
static void OnEntryReplaceChange(GtkWidget *widget, gpointer user_data);
};
#endif

View File

@ -1,103 +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 "tools_globals.h"
#include "SearchData.h"
#include "Edn.h"
#undef __class__
#define __class__ "SearchData"
static Edn::String m_findRequest = "";
void SearchData::SetSearch(Edn::String &myData)
{
m_findRequest = myData;
}
void SearchData::GetSearch(Edn::String &myData)
{
myData = m_findRequest;
}
bool SearchData::IsSearchEmpty(void)
{
if(m_findRequest.Size() > 0) {
return false;
}
return true;
}
static Edn::String m_replaceRequest = "";
void SearchData::SetReplace(Edn::String &myData)
{
m_replaceRequest = myData;
}
void SearchData::GetReplace(Edn::String &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 "tools_debug.h"
#include "Edn.h"
namespace SearchData
{
void SetSearch(Edn::String &myData);
void GetSearch(Edn::String &myData);
bool IsSearchEmpty(void);
void SetReplace(Edn::String &myData);
void GetReplace(Edn::String &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,334 +0,0 @@
/**
*******************************************************************************
* @file WindowsManager.cpp
* @brief Editeur De N'ours : Windows creation, pop up, destruction ... (Sources)
* @author Edouard DUPIN
* @date 20/06/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 "tools_debug.h"
#include "tools_globals.h"
#include "WindowsManager.h"
#include "MainWindows.h"
#include "Edn.h"
#include "Search.h"
#undef __class__
#define __class__ "WindowsManager"
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
WindowsManager::WindowsManager(void) : MsgBroadcast("Windows Manager", EDN_CAT_GUI_MANAGER)
{
m_currentBufferID = -1;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
WindowsManager::~WindowsManager(void)
{
}
void WindowsManager::OnMessage(int32_t id, int32_t dataID)
{
switch (id)
{
case EDN_MSG__BUFFER_CHANGE_CURRENT:
m_currentBufferID = dataID;
break;
case EDN_MSG__GUI_SHOW_MAIN_WINDOWS:
EDN_INFO("Request opening MAIN_WINDOWS");
m_mainWindow = MainWindows::getInstance();
break;
case EDN_MSG__GUI_SHOW_SEARCH:
EDN_INFO("Request opening SEARCH");
{
Search *myInstance = Search::getInstance();
myInstance->Display(GTK_WINDOW(m_mainWindow->GetWidget()));
}
break;
case EDN_MSG__GUI_SHOW_PREFERENCE:
EDN_INFO("Request opening PREFERENCE");
break;
case EDN_MSG__GUI_SHOW_REPLACE:
EDN_INFO("Request opening REPLACE");
break;
case EDN_MSG__GUI_SHOW_OPEN_FILE:
EDN_INFO("Request opening OPEN_FILE");
{
BufferManager *myBufferManager = NULL;
myBufferManager = BufferManager::getInstance();
GtkWidget *dialog = gtk_file_chooser_dialog_new( "Open File", NULL,
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
NULL); // end button/response list
// this element did not apear in the miniature of the windows
gtk_window_set_skip_pager_hint(GTK_WINDOW(dialog), TRUE);
if( -1 != m_currentBufferID
&& true == myBufferManager->Exist(m_currentBufferID) )
{
Edn::File fileName = myBufferManager->Get(m_currentBufferID)->GetFileName();
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), fileName.GetFolder().c_str());
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), fileName.GetShortFilename().c_str());
}
if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
{
Edn::File myfilename;
myfilename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (dialog));
if (false == myBufferManager->Exist(myfilename) ) {
int32_t openID = myBufferManager->Open(myfilename);
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, openID);
} else {
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, myBufferManager->GetId(myfilename));
}
}
gtk_widget_destroy(dialog);
}
break;
case EDN_MSG__GUI_SHOW_SAVE_AS:
EDN_INFO("Request opening SAVE_AS");
// save only if one element is selected
if (BufferManager::getInstance()->Size() > 0) {
int32_t idSelected;
if(-1 == dataID) {
idSelected = BufferManager::getInstance()->GetSelected();
} else {
idSelected = dataID;
}
Buffer *myBuffer = BufferManager::getInstance()->Get(idSelected);
Edn::String tmpString = "Save as file : ";
tmpString += myBuffer->GetFileName().GetShortFilename().c_str();
GtkWidget *dialog = gtk_file_chooser_dialog_new( tmpString.c_str(), NULL,
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
NULL); // end button/response list
// this element did not apear in the miniature of the windows
gtk_window_set_skip_pager_hint(GTK_WINDOW(dialog), TRUE);
if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
{
Edn::String myfilename;
myfilename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (dialog));
myBuffer->SetFileName(myfilename);
myBuffer->Save();
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, idSelected);
}
gtk_widget_destroy(dialog); // implicitly hides dialog
}
break;
case EDN_MSG__GUI_SHOW_ABOUT:
{
// dlg to confirm the quit event :
GtkWidget *myDialog = gtk_dialog_new_with_buttons("About",
NULL,
GTK_DIALOG_MODAL,
GTK_STOCK_QUIT, GTK_RESPONSE_NO,
NULL);
// this element did not apear in the miniature of the windows
gtk_window_set_skip_pager_hint(GTK_WINDOW(myDialog), TRUE);
GtkWidget *myContentArea = gtk_dialog_get_content_area( GTK_DIALOG(myDialog));
GtkWidget *myLabel = gtk_label_new("");
gtk_label_set_markup (GTK_LABEL (myLabel),
"<b>Name :</b> Edn\n"
"<b>Version :</b> " VERSION_TAG_NAME "\n"
"<b>Build Time :</b> " VERSION_BUILD_TIME "\n\n"
"<b>Description :</b> Editeur De N'ours, l'Editeur Desoxyribo-Nucleique\n"
" Source Code Editor\n\n"
"<b>Copyright 2010 Edouard DUPIN, all right reserved</b>\n\n"
"<b>Terms of license : </b>\n"
"This software is distributed in the hope that it will be useful, but \n"
"WITHOUT ANY WARRANTY\n"
" <b>You can:</b>\n"
" * Redistribute the sources code and binaries.\n"
" * Modify the Sources code.\n"
" * Use a part of the sources (less than 50%) in an other software,\n"
" just write somewhere \"Edn is great\" visible by the user (on \n"
" your product or on your website with a link to my page).\n"
" * Redistribute the modification only if you want.\n"
" * Send me the bug-fix (it could be great).\n"
" * Pay me a beer or some other things.\n"
" Print the source code on WC paper ...\n"
" <b>You can NOT:</b>\n"
" * Earn money with this Software (But I can).\n"
" * Add malware in the Sources.\n"
" * Do something bad with the sources.\n"
" * Use it to travel in the space with a toaster.\n"
"I reserve the right to change this licence. If it change the version of \n"
"the copy you have keep its own license.\n\n"
"<b>Sources : </b> git://github.com/HeeroYui/edn.git ");
gtk_box_pack_start(GTK_BOX(myContentArea), myLabel, TRUE, TRUE, 0);
gtk_widget_show_all(myContentArea);
int32_t result = gtk_dialog_run (GTK_DIALOG (myDialog));
gtk_widget_destroy(myDialog);
switch (result)
{
case GTK_RESPONSE_NO:
break;
}
}
break;
case EDN_MSG__GUI_SHOW_GOTO_LINE:
{
// dlg to confirm the quit event :
GtkWidget *myDialog = gtk_dialog_new_with_buttons("Goto Line",
GTK_WINDOW(m_mainWindow->GetWidget()),
GTK_DIALOG_MODAL,
"Jump", GTK_RESPONSE_YES,
GTK_STOCK_QUIT, GTK_RESPONSE_NO,
NULL);
// this element did not apear in the miniature of the windows
gtk_window_set_skip_pager_hint(GTK_WINDOW(myDialog), TRUE);
// Set over main windows
gtk_window_set_transient_for(GTK_WINDOW(myDialog), GTK_WINDOW(m_mainWindow->GetWidget()));
// add writting area
GtkWidget *myContentArea = gtk_dialog_get_content_area( GTK_DIALOG(myDialog));
GtkWidget *myEntry = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(myContentArea), myEntry, TRUE, TRUE, 0);
// Display it
gtk_widget_show_all(myContentArea);
int32_t result = gtk_dialog_run (GTK_DIALOG (myDialog));
// Get data from the gtk entry
const char *myData = gtk_entry_get_text(GTK_ENTRY(myEntry));
if (NULL != myData) {
int32_t lineID=0;
if (1==sscanf(myData, "%d",&lineID)) {
EDN_DEBUG("find in : \"" << myData << "\" = " << lineID);
if(GTK_RESPONSE_YES == result) {
SendMessage(EDN_MSG__CURRENT_GOTO_LINE, lineID-1);
}
} else {
if (GTK_RESPONSE_YES == result) {
EDN_WARNING("find in : \"" << myData << "\" line Number is not correct ");
}
}
} else {
EDN_DEBUG("no line Writen ...");
}
// Remove dialogue
gtk_widget_destroy(myDialog);
}
break;
case EDN_MSG__GUI_SHOW_EXIT_CONFIRMATION:
{
EDN_INFO("quit requested");
// dlg to confirm the quit event :
GtkWidget *p_dialog = gtk_dialog_new_with_buttons("Exit",
GTK_WINDOW(m_mainWindow->GetWidget()),
GTK_DIALOG_MODAL,
GTK_STOCK_YES, GTK_RESPONSE_YES,
GTK_STOCK_NO, GTK_RESPONSE_NO,
NULL);
GtkWidget *p_label = gtk_label_new ("Do you want exit Edn ?");
gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area( GTK_DIALOG(p_dialog) )), p_label, TRUE, TRUE, 0);
gtk_widget_show(p_label);
switch (gtk_dialog_run (GTK_DIALOG (p_dialog)))
{
case GTK_RESPONSE_YES:
gtk_widget_destroy (p_dialog);
p_dialog = NULL;
{
BufferManager * myBufferMng = BufferManager::getInstance();
for (int32_t iii=0 ; iii<myBufferMng->Size() ; iii++) {
if (true==myBufferMng->Exist(iii) ) {
Buffer * myBuffer = myBufferMng->Get(iii);
if (NULL != myBuffer) {
if (true == myBuffer->IsModify()) {
if (true == myBuffer->HaveName()) {
p_dialog = gtk_dialog_new_with_buttons("Save Before Exit",
GTK_WINDOW(m_mainWindow->GetWidget()),
GTK_DIALOG_MODAL,
GTK_STOCK_SAVE, GTK_RESPONSE_YES,
GTK_STOCK_SAVE_AS, GTK_RESPONSE_ACCEPT,
GTK_STOCK_NO, GTK_RESPONSE_NO,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
NULL);
} else {
p_dialog = gtk_dialog_new_with_buttons("Save Before Exit",
GTK_WINDOW(m_mainWindow->GetWidget()),
GTK_DIALOG_MODAL,
GTK_STOCK_SAVE_AS, GTK_RESPONSE_ACCEPT,
GTK_STOCK_NO, GTK_RESPONSE_NO,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
NULL);
}
char tmpName[1024];
sprintf(tmpName, "Save file \"%s\" ?", myBuffer->GetFileName().GetCompleateName().c_str());
p_label = gtk_label_new(tmpName);
gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area( GTK_DIALOG(p_dialog) )), p_label, TRUE, TRUE, 0);
gtk_widget_show(p_label);
switch (gtk_dialog_run (GTK_DIALOG (p_dialog)))
{
case GTK_RESPONSE_YES:
myBuffer->Save();
break;
case GTK_RESPONSE_ACCEPT:
OnMessage(EDN_MSG__GUI_SHOW_SAVE_AS, iii);
break;
case GTK_RESPONSE_NO:
// nothing to do ...
break;
case GTK_RESPONSE_CANCEL:
gtk_widget_destroy (p_dialog);
return;
break;
}
gtk_widget_destroy (p_dialog);
p_dialog = NULL;
}
}
}
}
}
gtk_main_quit();
break;
case GTK_RESPONSE_NO:
gtk_widget_destroy (p_dialog);
break;
}
}
break;
}
}

View File

@ -1,50 +0,0 @@
/**
*******************************************************************************
* @file WindowsManager.h
* @brief Editeur De N'ours : Windows creation, pop up, destruction ... (header)
* @author Edouard DUPIN
* @date 20/06/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 __WINDOWS_MANAGER_H__
#define __WINDOWS_MANAGER_H__
#include "Singleton.h"
#include "MsgBroadcast.h"
#include "MainWindows.h"
class WindowsManager: public Singleton<WindowsManager>, public MsgBroadcast
{
friend class Singleton<WindowsManager>;
// specific for sigleton system...
private:
// Constructeur
WindowsManager(void);
~WindowsManager(void);
public:
void OnMessage(int32_t id, int32_t dataID);
private:
MainWindows * m_mainWindow;
int32_t m_currentBufferID;
};
#endif

View File

@ -1,302 +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 "tools_debug.h"
#include "tools_globals.h"
#include "Highlight.h"
#include "tinyxml.h"
#undef __class__
#define __class__ "Highlight"
void Highlight::ParseRules(TiXmlNode *child, Edn::VectorType<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(Edn::String &xmlFilename)
{
TiXmlDocument XmlDocument;
// open the curent File
bool loadError = XmlDocument.LoadFile(xmlFilename.c_str());
if (false == loadError) {
EDN_ERROR( "can not load Hightlight XML: PARSING error: \"" << xmlFilename << "\"");
return;
}
TiXmlElement* root = XmlDocument.FirstChildElement( "EdnLang" );
if (NULL == root) {
EDN_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) {
//EDN_INFO(PFX"(l %d) node fined : %s=\"%s\"", child->Row(), child->Value() , myData);
Edn::String * myEdnData = new Edn::String(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 {
EDN_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 {
EDN_ERROR("(l "<< passChild->Row() << ") node not suported : \""<< passChild->Value() << "\" must be [rule]" );
}
// get the next node element :
passChild = passChild->NextSibling();
}
} else {
EDN_ERROR("(l "<< child->Row() << ") node not suported : \""<< child->Value() << "\" must be [ext,pass1,pass2]" );
}
// get the next node element :
child = child->NextSibling();
}
}
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(Edn::String &ext)
{
int32_t i;
for (i=0; i<m_listExtentions.Size(); i++) {
if (ext == *m_listExtentions[i] ) {
return true;
}
}
return false;
}
bool Highlight::FileNameCompatible(Edn::File &fileName)
{
int32_t i;
Edn::String extention;
if (true == fileName.HasExtention() ) {
extention = "*.";
extention += fileName.GetExtention();
} else {
extention = fileName.GetShortFilename();
}
EDN_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;
EDN_INFO("List of ALL Highlight : ");
for (i=0; i< m_listExtentions.Size(); i++) {
EDN_INFO(" Extention : " << i << " : " << *m_listExtentions[i] );
}
// Display all elements
for (i=0; i< m_listHighlightPass1.Size(); i++) {
EDN_INFO(" " << i << " Pass 1 : " << m_listHighlightPass1[i]->GetName() );
//m_listHighlightPass1[i]->Display();
}
// Display all elements
for (i=0; i< m_listHighlightPass2.Size(); i++) {
EDN_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,
Edn::VectorType<colorInformation_ts> &metaData,
int32_t addingPos,
EdnVectorBuf &buffer)
{
if (0 > addingPos) {
addingPos = 0;
}
//EDN_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) {
//EDN_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;
//EDN_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) {
//EDN_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
//EDN_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);
//EDN_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,
Edn::VectorType<colorInformation_ts> &metaData,
EdnVectorBuf &buffer)
{
//EDN_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) {
//EDN_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;
//EDN_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) {
//EDN_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.
*
*******************************************************************************
*/
#include "Edn.h"
#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 "HighlightPattern.h"
#include "Colorize.h"
#include "EdnVectorBuf.h"
#include "tinyxml.h"
class Highlight {
public:
// Constructeur
Highlight(Edn::String &xmlFilename);
~Highlight(void);
bool HasExtention(Edn::String &ext);
bool FileNameCompatible(Edn::File &fileName);
void Display(void);
void ReloadColor(void);
void Parse(int32_t start,
int32_t stop,
Edn::VectorType<colorInformation_ts> &metaData,
int32_t addingPos,
EdnVectorBuf &buffer);
void Parse2(int32_t start,
int32_t stop,
Edn::VectorType<colorInformation_ts> &metaData,
EdnVectorBuf &buffer);
private:
void ParseRules(TiXmlNode *child, Edn::VectorType<HighlightPattern*> &mListPatern, int32_t level);
Edn::String m_styleName; //!< curent style name (like "c++" or "c" or "script Bash")
Edn::VectorType<Edn::String*> m_listExtentions; //!< List of possible extention for this high-light, like : ".c", ".cpp", ".h"
Edn::VectorType<HighlightPattern*> m_listHighlightPass1; //!< List of ALL hightlight modules (pass 1 ==> when we load and wride data on the buffer)
Edn::VectorType<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,139 +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 "tools_debug.h"
#include "tools_globals.h"
#include "HighlightManager.h"
#undef __class__
#define __class__ "HighlightManager"
HighlightManager::HighlightManager(void) : MsgBroadcast("Hight-light Manager", EDN_CAT_HL)
{
}
HighlightManager::~HighlightManager(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();
}
void HighlightManager::OnMessage(int32_t id, int32_t dataID)
{
switch (id)
{
case EDN_MSG__COLOR_HAS_CHANGE:
EDN_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 *HighlightManager::Get(Edn::File &fileName)
{
int32_t i;
for (i=0; i<listHighlight.Size(); i++) {
if (true == listHighlight[i]->FileNameCompatible(fileName) ) {
return listHighlight[i];
}
}
return NULL;
}
bool HighlightManager::Exist(Edn::File &fileName)
{
if (NULL != Get(fileName) ) {
return true;
}
return false;
}
void HighlightManager::loadLanguages(void)
{
Edn::String homedir;
#ifdef NDEBUG
homedir = "/usr/share/edn/";
#else
homedir = "./data/";
#endif
Edn::String xmlFilename = homedir;
xmlFilename += "lang_c.xml";
Highlight *myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = homedir;
xmlFilename += "lang_boo.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = homedir;
xmlFilename += "lang_Makefile.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = homedir;
xmlFilename += "lang_asm.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = homedir;
xmlFilename += "lang_xml.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = homedir;
xmlFilename += "lang_php.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = homedir;
xmlFilename += "lang_bash.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = homedir;
xmlFilename += "lang_matlab.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
//myHightline->Display();
}

View File

@ -1,57 +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__
class HighlightManager;
#include "Singleton.h"
#include "MsgBroadcast.h"
#include "Highlight.h"
class HighlightManager: public Singleton<HighlightManager>, public MsgBroadcast
{
friend class Singleton<HighlightManager>;
// specific for sigleton system...
private:
// Constructeur
HighlightManager(void);
~HighlightManager(void);
public:
void OnMessage(int32_t id, int32_t dataID);
public:
void loadLanguages(void);
Highlight * Get(Edn::File &fileName);
bool Exist(Edn::File &fileName);
private:
Edn::VectorType<Highlight*> listHighlight; //!< List of ALL hightlight modules
};
#endif

View File

@ -1,252 +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 "tools_debug.h"
#include "tools_globals.h"
#include "HighlightPattern.h"
#include "ColorizeManager.h"
#undef __class__
#define __class__ "HighlightPattern"
HighlightPattern::HighlightPattern(void)
{
m_haveStopPatern = false;
m_multiline = false;
ColorizeManager *myColorManager = ColorizeManager::getInstance();
m_color = myColorManager->Get("normal");
m_regExpStart = new EdnRegExp<EdnVectorBuf>();
m_regExpStop = new EdnRegExp<EdnVectorBuf>();
m_escapeChar = 0;
}
HighlightPattern::~HighlightPattern(void)
{
delete(m_regExpStart);
delete(m_regExpStop);
}
void HighlightPattern::SetPaternStart(Edn::String &regExp)
{
m_regExpStart->SetRegExp(regExp);
}
void HighlightPattern::SetPaternStop(Edn::String &regExp)
{
if (regExp.Size() != 0) {
m_regExpStop->SetRegExp(regExp);
m_haveStopPatern = true;
} else {
m_haveStopPatern = false;
}
}
void HighlightPattern::SetEscapeChar(Edn::String &EscapeChar)
{
if (EscapeChar.Size()>0) {
m_escapeChar = EscapeChar.c_str()[0];
} else {
m_escapeChar = 0;
}
}
void HighlightPattern::SetColor(Edn::String &colorName)
{
m_colorName = colorName;
ColorizeManager *myColorManager = ColorizeManager::getInstance();
m_color = myColorManager->Get(m_colorName);
}
bool HighlightPattern::IsEnable(void)
{
return true;
}
void HighlightPattern::ReloadColor(void)
{
ColorizeManager *myColorManager = ColorizeManager::getInstance();
m_color = myColorManager->Get(m_colorName);
}
/**
* @brief
*
* @param[in,out]
*
* @eturn
*
*/
void HighlightPattern::Display(void)
{
/*
EDN_INFO("patern : \"" << m_paternName << "\" level=" << m_level );
EDN_INFO(" ==> colorName \"" << m_colorName << "\"");
EDN_INFO(" ==> regExpStart \"" << m_regExpStart->GetRegExp() << "\"");
EDN_INFO(" ==> regExpStop \"" << m_regExpStop->GetRegExp() << "\"");
if (true == m_haveStopPatern) {
EDN_INFO(" ==> stop pattern: YES");
} else {
EDN_INFO(" ==> stop pattern: NO");
}
if (true == m_multiline) {
EDN_INFO(" ==> multiline pattern: YES");
} else {
EDN_INFO(" ==> multiline pattern: NO");
}
*/
// Display all elements
for (int32_t i=0; i< m_subPatern.Size(); i++) {
EDN_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");
Edn::String 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) {
//EDN_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
Edn::String myEdnData = myData;
SetColor(myEdnData);
}
}
xChild = child->FirstChildElement("start");
if (NULL != xChild) {
const char *myData = xChild->GetText();
if (myData) {
//EDN_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
Edn::String myEdnData = myData;
SetPaternStart(myEdnData);
}
}
xChild = child->FirstChildElement("end");
if (NULL != xChild) {
const char *myData = xChild->GetText();
if (myData) {
//EDN_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
Edn::String myEdnData = myData;
SetPaternStop(myEdnData);
}
}
xChild = child->FirstChildElement("EscapeChar");
if (NULL != xChild) {
const char *myData = xChild->GetText();
if (myData) {
//EDN_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
Edn::String 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)
{
//EDN_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;
}
//EDN_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;
}
}
//EDN_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 "Edn.h"
#include "RegExp.h"
#include "Colorize.h"
#include "VectorType.h"
#include "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(Edn::String &name) { m_paternName = name;};
Edn::String GetName(void) { return m_paternName;};
void SetPaternStart(Edn::String &regExp);
void SetPaternStop(Edn::String &regExp);
void SetColor(Edn::String &colorName);
void SetEscapeChar(Edn::String &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 ....
Edn::String m_paternName; //!< Current style name (like "c++" or "c" or "script Bash")
Edn::String m_colorName; //!< Current color name
Colorize * m_color; //!< Link to the color manager
EdnRegExp<EdnVectorBuf> * m_regExpStart; //!< Start of Regular expression
EdnRegExp<EdnVectorBuf> * m_regExpStop; //!< Stop of Regular Expression
bool m_haveStopPatern; //!< Stop patern presence
bool m_multiline; //!< The patern is multiline
char m_escapeChar; //!< Escape char to prevent exeit of patern ....
Edn::VectorType<HighlightPattern *> m_subPatern; //!< Under patern of this one
// Edn::VectorType<HighlightPattern *> m_subColor; //!< Under Color in the start RegExp ...
};
#endif

View File

@ -1,429 +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 "tools_debug.h"
#include "tools_globals.h"
#include "Edn.h"
#include "CTagsManager.h"
#include "ClipBoard.h"
#include "BufferManager.h"
#undef __class__
#define __class__ "CTagsManager"
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
CTagsManager::CTagsManager(void) : MsgBroadcast("C-Tags Manager", EDN_CAT_CTAGS)
{
m_tagFilename = "";
m_tagFolderBase = "";
m_ctagFile = NULL;
m_historyPos = 0;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
CTagsManager::~CTagsManager(void)
{
if(0 != m_historyList.Size()) {
for (int32_t iii=0; iii< m_historyList.Size(); iii++) {
delete(m_historyList[iii]);
}
m_historyList.Clear();
}
}
Edn::String CTagsManager::GetFolder(Edn::String &inputString)
{
char tmpVal[4096];
strncpy(tmpVal, inputString.c_str(), 4096);
tmpVal[4096-1] = '\0';
char *ptr = strrchr(tmpVal, '/');
if (NULL == ptr) {
ptr = strrchr(tmpVal, '\\');
}
Edn::String out = "./";
if (NULL != ptr) {
*ptr = '\0';
out = tmpVal;
out+= '/';
}
return out;
}
void CTagsManager::OnMessage(int32_t id, int32_t dataID)
{
switch (id)
{
case EDN_MSG__BUFFER_CHANGE_CURRENT:
m_currentSelectedID = dataID;
break;
case EDN_MSG__OPEN_CTAGS:
EDN_INFO("Request opening ctag file");
{
GtkWidget *dialog = gtk_file_chooser_dialog_new( "Open Exuberant Ctags File", NULL,
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
NULL); // end button/response list
if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
{
// open the new one :
m_tagFilename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (dialog));
m_tagFolderBase = GetFolder(m_tagFilename);
LoadTagFile();
}
gtk_widget_destroy(dialog);
}
break;
case EDN_MSG__RELOAD_CTAGS:
LoadTagFile();
break;
case EDN_MSG__JUMP_TO_CURRENT_SELECTION:
JumpTo();
break;
case EDN_MSG__JUMP_BACK:
if (m_historyList.Size() > 0) {
BufferManager *myBufferManager = BufferManager::getInstance();
int32_t id = m_historyList.Size()-1;
if (false == myBufferManager->Exist(*m_historyList[id]) ) {
// need to open the file :
int32_t openID = myBufferManager->Open(*m_historyList[id]);
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, openID);
} else {
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, myBufferManager->GetId(*m_historyList[id]));
}
SendMessage(EDN_MSG__CURRENT_GOTO_LINE, m_historyList[id]->GetLineNumber());
// Remove element ....
delete(m_historyList[id]);
m_historyList[id]=NULL;
m_historyList.PopBack();
}
break;
}
}
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 :
EDN_INFO("try to open tag file : " << m_tagFilename);
m_ctagFile = tagsOpen(m_tagFilename.c_str(), &info);
if (NULL != m_ctagFile) {
EDN_INFO("open exuberant Ctags file is OK ...");
} else {
EDN_INFO("Error to open ctags file ...");
}
}
void CTagsManager::AddToHistory(int32_t bufferID)
{
// check tho history position : remove if needed
if (m_historyPos < edn_max(m_historyList.Size()-1, 0) ) {
for(int32_t iii= m_historyPos; iii < m_historyList.Size(); iii++) {
delete(m_historyList[iii]);
}
m_historyList.EraseLen(m_historyPos, m_historyList.Size() - m_historyPos);
}
// add the current element
BufferManager *myBufferManager = BufferManager::getInstance();
Edn::File currentFilename = myBufferManager->Get(bufferID)->GetFileName();
}
enum
{
CTAGS_COL_FILE = 0,
CTAGS_COL_LINE_NUMBER,
CTAGS_NUM_COLS
};
void CTagsManager::cb_row(GtkTreeView *p_treeview,
GtkTreePath * p_path,
GtkTreeViewColumn * p_column,
gpointer data)
{
EDN_DEBUG("event");
CTagsManager * self = reinterpret_cast<CTagsManager*>(data);
gchar * p_file=NULL;
gint lineNumber;
GtkTreeIter iter;
if (gtk_tree_model_get_iter( GTK_TREE_MODEL(self->m_listStore), &iter, p_path))
{
gtk_tree_model_get( GTK_TREE_MODEL(self->m_listStore),
&iter,
CTAGS_COL_FILE, &p_file,
CTAGS_COL_LINE_NUMBER, &lineNumber,
-1 );
EDN_DEBUG("find : " << p_file << ":" << lineNumber);
for (int32_t iii = 0; iii < self->m_currentList.Size() ; iii++) {
if( self->m_currentList[iii].lineID == lineNumber
&& strcmp(self->m_currentList[iii].filename, p_file)==0)
{
g_object_unref( GTK_TREE_MODEL(self->m_listStore));
// Remove dialogue
gtk_widget_destroy(self->m_Dialog);
// Jump ...
self->JumpAtID(iii);
return;
}
}
}
}
GtkWidget * CTagsManager::CreateViewAndModel(void)
{
GtkCellRenderer * renderer;
GtkWidget * view;
view = gtk_tree_view_new();
// Column 1
renderer = gtk_cell_renderer_text_new();
gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view),
-1,
"File",
renderer,
"text", CTAGS_COL_FILE,
NULL);
// Column 2
renderer = gtk_cell_renderer_text_new();
gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view),
-1,
"lineNumber",
renderer,
"text", CTAGS_COL_LINE_NUMBER,
NULL);
// Set data in the list :
GtkTreeIter iter;
m_listStore = gtk_list_store_new(CTAGS_NUM_COLS, G_TYPE_STRING, G_TYPE_UINT);
// Append a row and fill in some data
for (int32_t iii=0; iii<m_currentList.Size() ; iii++) {
gtk_list_store_append(m_listStore, &iter);
gtk_list_store_set(m_listStore, &iter,
CTAGS_COL_FILE, m_currentList[iii].filename,
CTAGS_COL_LINE_NUMBER, m_currentList[iii].lineID,
-1);
}
gtk_tree_view_set_model( GTK_TREE_VIEW(view), GTK_TREE_MODEL(m_listStore) );
g_signal_connect( G_OBJECT(view), "row-activated", G_CALLBACK(cb_row), /*(gpointer)p_model*/ this );
//g_object_unref(GTK_TREE_MODEL(m_listStore));
return view;
}
int32_t CTagsManager::MultipleJump(void)
{
// dlg to confirm the quit event :
m_Dialog = gtk_dialog_new_with_buttons("C-Tags jump...",
NULL,
GTK_DIALOG_MODAL,
//"Jump", GTK_RESPONSE_YES,
GTK_STOCK_QUIT, GTK_RESPONSE_NO,
NULL);
// Set over main windows
//gtk_window_set_transient_for(GTK_WINDOW(myDialog), GTK_WINDOW(m_mainWindow->GetWidget()));
// add writting area
GtkWidget *myContentArea = gtk_dialog_get_content_area( GTK_DIALOG(m_Dialog));
GtkWidget *listView = CreateViewAndModel();
gtk_box_pack_start(GTK_BOX(myContentArea), listView, TRUE, TRUE, 0);
// Display it
gtk_widget_show_all(myContentArea);
int32_t result = gtk_dialog_run(GTK_DIALOG(m_Dialog));
// Get data from the gtk entry
if (result == GTK_RESPONSE_NO) {
g_object_unref(GTK_TREE_MODEL(m_listStore));
// Remove dialogue
gtk_widget_destroy(m_Dialog);
}
//GtkTreeIter *myIter;
//gtk_tree_selection_get_selected(selection, &model, myIter);
// Remove dialogue
//gtk_widget_destroy(myDialog);
return 0;
}
/*
void BufferView::OnCtagsEventList(GtkWidget *menuitem, gpointer data)
{
//BufferView * self = reinterpret_cast<BufferView*>(data);
//self->SendMessage(EDN_MSG__GUI_SHOW_SAVE_AS, self->m_contectMenuSelectID);
//self->m_contectMenuSelectID = -1;
}
*/
void CTagsManager::JumpAtID(int32_t selectID)
{
BufferManager *myBufferManager = BufferManager::getInstance();
Edn::File myFile = m_currentList[selectID].filename;
EDN_INFO("save curent filename and position : ");
int32_t currentSelected = myBufferManager->GetSelected();
Buffer* tmpBuf = myBufferManager->Get(currentSelected);
if (NULL != tmpBuf) {
Edn::File * bufferFilename = new Edn::File();
*bufferFilename = tmpBuf->GetFileName();
bufferFilename->SetLineNumber(tmpBuf->GetCurrentLine());
m_historyList.PushBack(bufferFilename);
}
EDN_INFO(" OPEN the TAG file Destination : " << myFile );
if (false == myBufferManager->Exist(myFile) ) {
// need to open the file :
int32_t openID = myBufferManager->Open(myFile);
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, openID);
} else {
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, myBufferManager->GetId(myFile));
}
/*
int32_t localId = myBufferManager->GetId(myFile);
Edn::String pattern = entry.address.pattern;
EDN_DEBUG("try to find line with : \"" << pattern << "\"" );
if (pattern.Size() > 4) {
pattern.Remove(0,2);
pattern.Remove(pattern.Size()-1,2);
}
// TODO : remove '\' char when needed ...
EDN_DEBUG("try to find line with : \"" << pattern << "\"" );
int32_t destLine = myBufferManager->Get(localId)->FindLine(pattern);
SendMessage(EDN_MSG__CURRENT_GOTO_LINE, destLine);
*/
SendMessage(EDN_MSG__CURRENT_GOTO_LINE, m_currentList[selectID].lineID - 1);
}
void CTagsManager::JumpTo(void)
{
m_currentList.Clear();
if (NULL != m_ctagFile) {
Edn::VectorType<int8_t> data;
// get the middle button of the clipboard ==> represent the current selection ...
ClipBoard::Get(COPY_MIDDLE_BUTTON, data);
if (data.Size() == 0) {
EDN_INFO("No current Sélection");
}
tagEntry entry;
data.PushBack('\0');
EDN_INFO("try to find the tag : " << (const char *)&data[0]);
if (tagsFind (m_ctagFile, &entry, (const char *)&data[0], 0) == TagSuccess) {
tagEntry entrySave = entry;
int32_t numberOfTags = 0;
// For all tags : Save in an internal Structure :
do {
Edn::String destinationFilename = m_tagFolderBase;
destinationFilename += entry.file;
Edn::File myfile = destinationFilename;
TagListFind_ts myStruct;
strncpy(myStruct.filename, myfile.GetCompleateName().c_str(), MAX_FILE_NAME);
myStruct.filename[MAX_FILE_NAME-1] = '\0';
strncpy(myStruct.RegExp, entry.address.pattern, MAX_REG_EXP_SEARCH);
myStruct.RegExp[MAX_REG_EXP_SEARCH-1] = '\0';
myStruct.lineID = entry.address.lineNumber;
// at at the corect position
m_currentList.PushBack(myStruct);
PrintTag(&entry, true);
} while (tagsFindNext (m_ctagFile, &entry) == TagSuccess);
if (1==m_currentList.Size() ) {
JumpAtID(0);
} else {
// Open a choice windows...
int32_t SelectID = MultipleJump();
}
/*
// Display all the element :
do {
PrintTag(&entry, true);
} while (tagsFindNext (m_ctagFile, &entry) == TagSuccess);
*/
} else {
EDN_INFO("no tag find ...");
}
}
}
void CTagsManager::PrintTag (const tagEntry *entry, bool small)
{
if (small==true) {
EDN_INFO("find Tag file : name=\"" << entry->name << "\" in file=\"" << entry->file
<< "\" at line="<< entry->address.lineNumber);
} else {
int i;
EDN_INFO("find Tag file : name=\"" << entry->name << "\" in file=\"" << entry->file
<< "\" pattern=\"" <<entry->address.pattern
<< "\" at line="<<entry->address.lineNumber);
EDN_INFO("Extention field : ");
if (entry->kind != NULL && entry->kind [0] != '\0') {
EDN_INFO(" kind : " << entry->kind);
}
if (entry->fileScope) {
EDN_INFO(" file : ");
}
for (i = 0 ; i < entry->fields.count ; ++i) {
EDN_INFO(" " << entry->fields.list[i].key << ":" << entry->fields.list[i].value );
}
}
}

View File

@ -1,81 +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 "Singleton.h"
#include "MsgBroadcast.h"
#include "readtags.h"
#include "Edn.h"
#define MAX_REG_EXP_SEARCH (1024)
typedef struct{
char filename[MAX_FILE_NAME];
char RegExp[MAX_REG_EXP_SEARCH];
int32_t lineID;
} TagListFind_ts;
class CTagsManager: public Singleton<CTagsManager>, public MsgBroadcast
{
friend class Singleton<CTagsManager>;
// specific for sigleton system...
private:
// Constructeur
CTagsManager(void);
~CTagsManager(void);
public:
void OnMessage(int32_t id, int32_t dataID);
private:
int32_t m_currentSelectedID;
void LoadTagFile(void);
int32_t MultipleJump(void);
void JumpTo(void);
void PrintTag(const tagEntry *entry, bool small);
Edn::String GetFolder(Edn::String &inputString);
Edn::String m_tagFolderBase;
Edn::String m_tagFilename;
tagFile * m_ctagFile;
// history system
void AddToHistory(int32_t bufferID);
int32_t m_historyPos;
Edn::VectorType<Edn::File*> m_historyList;
Edn::VectorType<TagListFind_ts> m_currentList;
void JumpAtID(int32_t selectID);
GtkWidget * CreateViewAndModel(void);
static void cb_row (GtkTreeView *p_treeview,
GtkTreePath * p_path,
GtkTreeViewColumn * p_column,
gpointer p_data);
// save data in the list :
GtkListStore * m_listStore;
GtkWidget * m_Dialog;
};
#endif

View File

@ -1,143 +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 "tools_debug.h"
#include "tools_globals.h"
#include "Display.h"
#include "BufferManager.h"
#include "ColorizeManager.h"
#include "HighlightManager.h"
#include "ClipBoard.h"
#include <string>
#include "WindowsManager.h"
#include "Search.h"
#include <unistd.h>
#include "readtags.h"
#include "CTagsManager.h"
#include "Edn.h"
/**
* @brief Main start function of the system
*
* @param[in] argc number of argument when called
* @param[in] argv sus nomer arguments
*
* @return EXIT_SUCCESS, all time
*
*/
int main (int argc, char *argv[])
{
EDN_INFO("Start Edn");
//Edn::TestUntaire_String();
//return 0;
// Use and remove GTK arguments from the application argument list.
gtk_init (&argc, &argv);
// init internal global value
globals::init();
ClipBoard::Init();
Display::Init();
// init ALL Singleton :
(void)MsgBroadcastCore::getInstance();
(void)AccelKey::getInstance();
(void)WindowsManager::getInstance();
(void)CTagsManager::getInstance();
BufferManager *myBufferManager = BufferManager::getInstance();
// set color and other trucs...
ColorizeManager *myColorManager = NULL;
myColorManager = ColorizeManager::getInstance();
Edn::String homedir;
//homedir = getenv("HOME");
#ifdef NDEBUG
homedir = "/usr/share/edn/";
#else
homedir = "./data/";
#endif
//homedir += "color_black.xml";
homedir += "color_white.xml";
myColorManager->LoadFile( homedir.c_str() );
myColorManager->DisplayListOfColor();
HighlightManager *myHighlightManager = NULL;
myHighlightManager = HighlightManager::getInstance();
myHighlightManager->loadLanguages();
// open display
MsgBroadcastCore::getInstance()->SendMessage(NULL, EDN_MSG__GUI_SHOW_MAIN_WINDOWS);
// get the curent program folder
char cCurrentPath[FILENAME_MAX];
if (!getcwd(cCurrentPath, FILENAME_MAX)) {
return -1;
}
cCurrentPath[FILENAME_MAX - 1] = '\0';
//EDN_INFO("The current working directory is " << cCurrentPath);
// add files
EDN_INFO("show list of files : ");
for( int32_t i=1 ; i<argc; i++) {
EDN_INFO("need load file : \"" << argv[i] << "\"" );
Edn::File myfile = (char *)argv[i];
if (false == myBufferManager->Exist(myfile) ) {
int32_t idBuffOpened = myBufferManager->Open(myfile);
if (1==i) {
MsgBroadcastCore::getInstance()->SendMessage(NULL, EDN_MSG__CURRENT_CHANGE_BUFFER_ID, idBuffOpened);
}
}
}
EDN_INFO("Start gtk main");
gtk_main();
EDN_INFO("Stop gtk main");
//Kill all singleton
EDN_INFO("Stop BufferManager");
BufferManager::kill();
EDN_INFO("Stop ColorizeManager");
ColorizeManager::kill();
EDN_INFO("Stop Search");
Search::kill();
EDN_INFO("Stop Accel key");
AccelKey::kill();
EDN_INFO("Stop Display");
Display::UnInit();
EDN_INFO("Stop Edn");
return EXIT_SUCCESS;
}

View File

@ -1,95 +0,0 @@
/**
*******************************************************************************
* @file ClipBoard.cpp
* @brief Editeur De N'ours : copy / past main system
* @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 "tools_globals.h"
#include "ClipBoard.h"
#undef __class__
#define __class__ "ClipBoard"
/*
note: la copy dans le :
0 : copy standard
[1..9] : copy interne
10 : bouton du milieux
*/
static Edn::VectorType<int8_t> mesCopy[TOTAL_OF_CLICKBOARD];
void ClipBoard::Init(void)
{
EDN_INFO("Initialyse ClipBoards");
for(int32_t i=0; i<TOTAL_OF_CLICKBOARD; i++) {
mesCopy[i].Clear();
}
}
void ClipBoard::Set(uint8_t clipboardID, Edn::VectorType<int8_t> &data)
{
// check if ID is correct
if(clipboardID >= TOTAL_OF_CLICKBOARD) {
EDN_WARNING("request ClickBoard id error");
} else if(0 == data.Size()) {
EDN_INFO("request a copy of nothing");
} else if (COPY_STD == clipboardID) {
GtkClipboard * clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
gtk_clipboard_set_text(clipboard, (const gchar*)&data[0], data.Size() );
} else if (COPY_MIDDLE_BUTTON == clipboardID) {
GtkClipboard * clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY);
gtk_clipboard_set_text(clipboard, (const gchar*)&data[0], data.Size() );
}
// Copy datas ...
mesCopy[clipboardID] = data;
}
void ClipBoard::Get(uint8_t clipboardID, Edn::VectorType<int8_t> &data)
{
if(clipboardID >= TOTAL_OF_CLICKBOARD) {
EDN_WARNING("request ClickBoard id error");
} else if (COPY_STD == clipboardID) {
GtkClipboard * clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD );
gchar *text = gtk_clipboard_wait_for_text(clipboard);
if (text != NULL) {
mesCopy[COPY_STD].Clear();
mesCopy[COPY_STD].PushBack((int8_t*)text, strlen(text) );
}
} else if (COPY_MIDDLE_BUTTON == clipboardID) {
GtkClipboard * clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY );
gchar *text = gtk_clipboard_wait_for_text(clipboard);
if (text != NULL) {
mesCopy[COPY_MIDDLE_BUTTON].Clear();
mesCopy[COPY_MIDDLE_BUTTON].PushBack((int8_t*)text, strlen(text) );
}
}
// Copy datas ...
data = mesCopy[clipboardID];
}

View File

@ -1,45 +0,0 @@
/**
*******************************************************************************
* @file ClipBoard.h
* @brief Editeur De N'ours : copy / past main system (header)
* @author Edouard DUPIN
* @date 30/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 __CLIP_BOARD_H__
#define __CLIP_BOARD_H__
#include "tools_debug.h"
#include "VectorType.h"
#define TOTAL_OF_CLICKBOARD (11)
#define COPY_MIDDLE_BUTTON (10)
#define COPY_STD (0)
namespace ClipBoard
{
void Init(void);
void Set(uint8_t clipboardID, Edn::VectorType<int8_t> &data);
void Get(uint8_t clipboardID, Edn::VectorType<int8_t> &data);
}
#endif

View File

@ -1,633 +0,0 @@
/**
*******************************************************************************
* @file Display.cpp
* @brief Editeur De N'ours : Basic Pixbuf display function
* @author Edouard DUPIN
* @date 21/01/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 "tools_debug.h"
#include "tools_globals.h"
#include "Display.h"
#include "ColorizeManager.h"
#include "charset.h"
#include <string>
#undef __class__
#define __class__ "Display"
#define FONT_BOLD_NO (0)
#define FONT_BOLD_YES (1)
#define FONT_ITALIC_NO (0)
#define FONT_ITALIC_YES (1)
// Variables privé du namespace
#define POLICE_NAME "Monospace"
#ifdef USE_GTK_VERSION_3_0
#define POLICE_SIZE 15
static int32_t m_pangoFontWidth = 9;
static int32_t m_pangoFontHeight = 19;
#elif USE_GTK_VERSION_2_0
#define POLICE_SIZE 12
static int32_t m_pangoFontWidth = 7;
static int32_t m_pangoFontHeight = 15;
#endif
/*
#define POLICE_SIZE 11
static int32_t m_pangoFontWidth = 7;
static int32_t m_pangoFontHeight = 11;
static cairo_font_face_t * m_cairoFont[2][2] = {{NULL, NULL},{ NULL, NULL}};
*/
static cairo_font_face_t * m_cairoFont[2][2] = {{NULL, NULL},{ NULL, NULL}};
void Display::Init(void)
{
/*
charWidth = gdk_char_width(myFont[FONT_ITALIC_YES][FONT_BOLD_NO], 'Z');
EDN_INFO("Font Width = %d", charWidth);
charHeignt = gdk_char_height(myFont[FONT_ITALIC_YES][FONT_BOLD_NO], 'Z');
EDN_INFO("Font Height = %d", charHeignt);
*/
m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_NO] = cairo_toy_font_face_create(POLICE_NAME, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_NO] = cairo_toy_font_face_create(POLICE_NAME, CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_WEIGHT_NORMAL);
m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_YES] = cairo_toy_font_face_create(POLICE_NAME, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_YES] = cairo_toy_font_face_create(POLICE_NAME, CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_WEIGHT_BOLD);
if ( NULL == m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_NO]) {
EDN_ASSERT(FALSE, "basic font ERROR");
}
if ( NULL == m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_NO]) {
EDN_ERROR("Italic font error ... link with basic font");
m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_NO] = m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_NO];
}
if ( NULL == m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_YES]) {
EDN_ERROR("Bold font error ... link with basic font");
m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_YES] = m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_NO];
}
if ( NULL == m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_YES]) {
EDN_ERROR("Italic & Bold font error ... link with basic font");
m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_YES] = m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_NO];
}
}
void Display::UnInit(void)
{
// clean the builder...
free(m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_NO]);
free(m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_NO]);
free(m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_YES]);
free(m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_YES]);
}
int32_t Display::GetFontHeight(void)
{
return m_pangoFontHeight;
}
int32_t Display::GetFontWidth(void)
{
return m_pangoFontWidth;
}
cairo_font_face_t * Display::GetFont(bool bold, bool italic)
{
if( false == bold
&& false == italic) {
return m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_NO];
} else if( true == bold
&& false == italic) {
return m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_YES];
} else if ( false == bold
&& true == italic) {
return m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_NO];
}
return m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_YES];
}
#undef __class__
#define __class__ "DrawerManager"
/**
* @brief DrawerManager constructor : generate a memoryDC where we can draw everything...
*
* @param [in] window Current windows where the memoryDC must be paint
* @param [in] x Current width of the Display
* @param [in] y Current Height of the Display
*
* @note : No exeption
*
* @return ---
*
*/
DrawerManager::DrawerManager(GtkWidget * widget, int32_t x, int32_t y)
{
m_size.x = x;
m_size.y = y;
m_haveWork = false;
// Create the Cairo Element
# if USE_GTK_VERSION_3_0
m_cairo = gdk_cairo_create(gtk_widget_get_window(widget));
# elif USE_GTK_VERSION_2_0
m_cairo = gdk_cairo_create(widget->window);
# endif
//cairo_translate(m_cairo, 0, 7);
cairo_set_source_rgb(m_cairo, 0, 0, 0);
cairo_paint(m_cairo);
cairo_set_font_size(m_cairo, POLICE_SIZE);
m_dataToDisplay[0] = '\0';
cairo_scale(m_cairo, 1.0, 1.0);
// http://cairographics.org/FAQ/#clear_a_surface
// http://gtk.developpez.com/faq/?page=gtkwidget#GTK_WIDGET_transparent
//cairo_set_source_rgba(m_cairo, 1, 1, 1, 0);
//cairo_set_operator(m_cairo, CAIRO_OPERATOR_SOURCE);
//cairo_paint(m_cairo);
//cairo_fill(m_cairo);
//cairo_stroke (m_cairo);
}
/**
* @brief main DrawerManager destructor : Copy data on the curent screen
*
* @param ---
*
* @note : No exeption
*
* @return ---
*
*/
DrawerManager::~DrawerManager()
{
cairo_destroy(m_cairo);
}
/**
* @brief Draw Text with the specify color
*
* This function does not display the text directly, it save it while a flush appare or the y position differ, or the color differ.
* This is for the char by char writing ==> more efficient when we write multiple char.
*
* @param [in] SelectColor Color that is used to display data
* @param [in] x Horizontal position to display data
* @param [in] y Vertical position to display data
* @param [in] myText Text to write in UTF8 ...
* @param [in] displayBG unused
*
* @return ---
*
*/
void DrawerManager::Text(Colorize *SelectColor, int32_t x, int32_t y,const char *myUTF8Text, int32_t len)
{
EDN_CHECK_INOUT(NULL!=SelectColor);
// check if flush is needed :
if (true == m_haveWork) {
if( m_pos.y != y
|| m_selectColor != SelectColor)
{
Flush();
}
}
// check change
if (false == m_haveWork) {
m_pos.x = x;
m_pos.y = y;
m_selectColor = SelectColor;
}
//EDN_WARNING("add data : \"" << myText << "\" x=" << x << " y=" << y );
// process :
m_haveWork = true;
strcat(m_dataToDisplay, myUTF8Text);
if (len != -1 ) {
m_nbElement+=len;
} else {
m_nbElement+=strUtf8Len(myUTF8Text);
}
}
void DrawerManager::Text(color_ts & SelectColorFg, color_ts & SelectColorBg, int32_t x, int32_t y,const char *myText)
{
Flush();
cairo_set_font_face(m_cairo, Display::GetFont(false, false));
int32_t letterHeight = Display::GetFontHeight();
int32_t letterWidth = Display::GetFontWidth();
DirectRectangle(SelectColorBg, x, y, letterWidth*strlen(myText), letterHeight);
cairo_fill(m_cairo);
cairo_move_to(m_cairo, x, y+letterHeight-4);
cairo_set_source_rgb(m_cairo, SelectColorFg.red, SelectColorFg.green, SelectColorFg.blue);
cairo_show_text(m_cairo, myText);
cairo_fill(m_cairo);
}
void DrawerManager::Text(color_ts & SelectColorFg, int32_t x, int32_t y,const char *myText)
{
Flush();
cairo_set_font_face(m_cairo, Display::GetFont(false, false));
int32_t letterHeight = Display::GetFontHeight();
cairo_move_to(m_cairo, x, y+letterHeight-4);
cairo_set_source_rgb(m_cairo, SelectColorFg.red, SelectColorFg.green, SelectColorFg.blue);
cairo_show_text(m_cairo, myText);
cairo_fill(m_cairo);
}
void DrawerManager::SpaceText(color_ts & SelectColor, int32_t x, int32_t y,int32_t nbChar)
{
Flush();
int32_t letterHeight = Display::GetFontHeight();
int32_t letterWidth = Display::GetFontWidth();
DirectRectangle(SelectColor, x, y, letterWidth*nbChar, letterHeight);
cairo_fill(m_cairo);
}
/**
* @brief Force de display of the curent Text
*
* The flush is to be more performent with the Pango display methode...
*
* @param ---
*
* @return ---
*
*/
void DrawerManager::Flush(void)
{
if (true == m_haveWork) {
//EDN_WARNING("flush : \"" << m_dataToDisplay << "\"");
m_haveWork = false;
cairo_set_font_face(m_cairo, Display::GetFont(m_selectColor->GetBold(), m_selectColor->GetItalic()));
int32_t letterHeight = Display::GetFontHeight();
if (true == m_selectColor->HaveBg() ) {
int32_t letterWidth = Display::GetFontWidth();
int32_t stringLen = m_nbElement;
// generate Clean BG:
DirectRectangle(m_selectColor, m_pos.x, m_pos.y, letterWidth*stringLen, letterHeight);
}
cairo_move_to(m_cairo, m_pos.x, m_pos.y+letterHeight-4);
m_selectColor->ApplyFG(m_cairo);
cairo_show_text(m_cairo, m_dataToDisplay);
cairo_fill(m_cairo);
m_dataToDisplay[0] = '\0';
m_nbElement = 0;
}
}
/**
* @brief display a rectangle with the curent bgColor and no border
*
* This function in the open API to drow the rectangle, it flush the curent Text in the buffer
*
* @param [in] SelectColor Color that is used to display rectangle
* @param [in] x Horizontal position to display rectangle
* @param [in] y Vertical position to display rectangle
* @param [in] width Width of the rectangle
* @param [in] height Height of the rectangle
*
* @return ---
*
*/
void DrawerManager::Rectangle(Colorize *SelectColor, int32_t x, int32_t y, int32_t width, int32_t height)
{
Flush();
DirectRectangle(SelectColor, x, y, width, height);
}
/**
* @brief Real function to display the rectangle (no flush done (expectially for the Background display)
*
* @param [in] SelectColor Color that is used to display rectangle
* @param [in] x Horizontal position to display rectangle
* @param [in] y Vertical position to display rectangle
* @param [in] width Width of the rectangle
* @param [in] height Height of the rectangle
*
* @return ---
*
*/
void DrawerManager::DirectRectangle(Colorize *SelectColor, int32_t x, int32_t y, int32_t width, int32_t height)
{
EDN_CHECK_INOUT(NULL!=SelectColor);
//EDN_INFO("x="<< x <<" y="<< y <<" width="<< width <<" height="<< height);
//gdk_draw_rectangle( p_pixmap, SelectColor->GetColorBG(), TRUE, x, y, width, height);
// set color
SelectColor->ApplyBG(m_cairo);
// set postion
cairo_rectangle(m_cairo, x, y, width, height);
//cairo_stroke(m_cairo);
// flush
cairo_fill(m_cairo);
}
void DrawerManager::DirectRectangle(color_ts &SelectColor, int32_t x, int32_t y, int32_t width, int32_t height)
{
cairo_set_source_rgb(m_cairo, SelectColor.red, SelectColor.green, SelectColor.blue);
// set postion
cairo_rectangle(m_cairo, x, y, width, height);
//cairo_stroke(m_cairo);
// flush
cairo_fill(m_cairo);
}
/**
* @brief Clean the curent Windows with the curent color
*
* @param [in] SelectColor Color that is used to display background
*
* @return ---
*
*/
void DrawerManager::Clean(Colorize *SelectColor)
{
m_haveWork = false;
DirectRectangle(SelectColor, 0, 0, m_size.x, m_size.y);
}
/**
* @brief Clean the curent Windows with the curent color
*
* @param [in] SelectColor Color that is used to display background
*
* @return ---
*
*/
void DrawerManager::Clean(color_ts & SelectColor)
{
m_haveWork = false;
DirectRectangle(SelectColor, 0, 0, m_size.x, m_size.y);
}
/**
* @brief Display a cursor with the cortect form.
*
* Automatic selection of the XML color "cursorColor"
*
* @param [in] x Horizontal position to display cursor
* @param [in] y Vertical position to display cursor
*
* @return ---
*
*/
#define CURSOR_WIDTH (4)
void DrawerManager::Cursor(int32_t x, int32_t y)
{
Flush();
// get the cursor Color :
color_ts myColor = ColorizeManager::getInstance()->Get(COLOR_CODE_CURSOR);
cairo_set_source_rgb(m_cairo, myColor.red, myColor.green, myColor.blue);
// draw cursor
int32_t letterHeight = Display::GetFontHeight();
int32_t letterWidth = Display::GetFontWidth();
// depending on the inserting mode
if (false == globals::IsSetInsert()) {
cairo_set_line_width(m_cairo, 2);
cairo_move_to(m_cairo, x-CURSOR_WIDTH, y - letterHeight+1);
cairo_rel_line_to(m_cairo, CURSOR_WIDTH*2, 0);
cairo_rel_move_to(m_cairo, -CURSOR_WIDTH, 0);
cairo_rel_line_to(m_cairo, 0, letterHeight-2);
cairo_rel_move_to(m_cairo, -CURSOR_WIDTH, 0);
cairo_rel_line_to(m_cairo, CURSOR_WIDTH*2, 0);
} else {
cairo_set_line_width(m_cairo, 1);
cairo_move_to(m_cairo, x, y - letterHeight + 1);
cairo_rel_line_to(m_cairo, letterWidth, 0);
cairo_rel_line_to(m_cairo, 0, letterHeight);
cairo_rel_line_to(m_cairo, -letterWidth, 0);
cairo_rel_line_to(m_cairo, 0, -letterHeight);
}
cairo_stroke(m_cairo);
cairo_fill(m_cairo);
}
/**
* @brief Display a end of the curent line ...
*
* Automatic draw the end of line with the curent XML color "cursorColor"
*
* @param [in] x Horizontal position to display cursor
* @param [in] y Vertical position to display cursor
*
* @return ---
*
*/
void DrawerManager::EndOfLine(int32_t x, int32_t y)
{
if (true == globals::IsSetDisplayEndOfLine() ) {
Flush();
// get the cursor Color :
color_ts myColor = ColorizeManager::getInstance()->Get(COLOR_CODE_CURSOR);
cairo_set_source_rgb(m_cairo, myColor.red, myColor.green, myColor.blue);
// draw cursor
int32_t letterHeight = Display::GetFontHeight();
// depending on the inserting mode
/*
x1 x2
y1 | |-----
| |-----
| |
y2 | |
*/
cairo_set_line_width(m_cairo, 2);
cairo_move_to(m_cairo, x, y - letterHeight+1);
cairo_rel_line_to(m_cairo, 0, letterHeight);
cairo_move_to(m_cairo, x+2, y - letterHeight+1);
cairo_rel_line_to(m_cairo, 0, letterHeight);
cairo_arc(m_cairo, x+3, y - letterHeight/4*3, 3.0, -3.149/2, 3.149/2);
cairo_stroke(m_cairo);
cairo_fill(m_cairo);
}
}
/**
* @brief Display a Tabulation with the user form selection.
*
* @param [in] SelectColor Color that is used to display Tabulation
* @param [in] x Horizontal position to display cursor
* @param [in] y Vertical position to display cursor
* @param [in] mbColomn Width of the current Tabulation caracter (in number of Char)
*
* @return ---
*
*/
void DrawerManager::Tabulation(Colorize *SelectColor, int32_t x, int32_t y, int32_t mbColomn)
{
Flush();
int32_t letterWidth = Display::GetFontWidth();
int32_t letterHeight = Display::GetFontHeight();
// generate Clean BG:
DirectRectangle(SelectColor, x, y-letterHeight, letterWidth*mbColomn, letterHeight);
// set the pen for the display
SelectColor->ApplyFG(m_cairo);
uint32_t yCalc = y - (letterHeight+1)/2;
cairo_move_to(m_cairo, x + 3, yCalc);
cairo_line_to(m_cairo, x + letterWidth*mbColomn - 2 , yCalc);
cairo_rel_line_to(m_cairo, -6 , -2);
cairo_move_to(m_cairo, x + letterWidth*mbColomn - 2 , yCalc);
cairo_rel_line_to(m_cairo, -6 , +2);
cairo_stroke(m_cairo);
cairo_fill(m_cairo);
}
/**
* @brief Display an unknow UTF8 character (a special rectangle)
*
* @param [in] SelectColor Color that is used to display Tabulation
* @param [in] x Horizontal position to display cursor
* @param [in] y Vertical position to display cursor
* @param [in] utf8Size number of char used by the UTF8 character
* @param [in] ValidUtf8 true if the character UTF8 is well encoded
*
* @return ---
*
*/
void DrawerManager::UTF8UnknownElement(Colorize *SelectColor, int32_t x, int32_t y, int8_t utf8Size, bool ValidUtf8)
{
Flush();
int32_t letterWidth = Display::GetFontWidth();
int32_t letterHeight = Display::GetFontHeight();
// generate Clean BG:
DirectRectangle(SelectColor, x, y-letterHeight, letterWidth*2, letterHeight);
SelectColor->ApplyFG(m_cairo);
/*
y1 y2
x1 |-------|
| |
| |
x2 |-------|
*/
uint32_t x1 = x + 2;
uint32_t x2 = x + letterWidth*2 - 2;
uint32_t y1 = y - letterHeight + 2;
uint32_t y2 = y - 2;
// Box
cairo_move_to(m_cairo, x1 , y1);
cairo_line_to(m_cairo, x2 , y1);
cairo_line_to(m_cairo, x2 , y2);
cairo_line_to(m_cairo, x1 , y2);
cairo_line_to(m_cairo, x1 , y1);
// croix in the middle
switch(utf8Size)
{
case 1:
break;
case 2:
cairo_line_to(m_cairo, x2 , y2);
break;
case 3:
cairo_move_to(m_cairo, x1 , y2);
cairo_line_to(m_cairo, x2 , y1);
break;
default:
cairo_line_to(m_cairo, x2 , y2);
cairo_move_to(m_cairo, x1 , y2);
cairo_line_to(m_cairo, x2 , y1);
break;
}
if (false == ValidUtf8) {
cairo_move_to(m_cairo, x1 , y2-2);
cairo_line_to(m_cairo, x2 , y2-2);
}
cairo_stroke(m_cairo);
cairo_fill(m_cairo);
}
/* Basic axample with cairo and pango...
cairo_t *cr;
cr = gdk_cairo_create(widget->window);
cairo_translate(cr, 0, 7);
cairo_set_source_rgb(cr, 0, 0, 0);
cairo_paint(cr);
gint pos = 18;//GTK_CPU(widget)->sel;
gint rect = pos / 5;
cairo_set_source_rgb(cr, 0.2, 0.4, 0);
gint i;
for ( i = 1; i <= 20; i++) {
if (i > 20 - rect) {
cairo_set_source_rgb(cr, 0.6, 1.0, 0);
} else {
cairo_set_source_rgb(cr, 0.2, 0.4, 0);
}
cairo_rectangle(cr, 8, i*4, 30, 3);
cairo_rectangle(cr, 42, i*4, 30, 3);
cairo_fill(cr);
}
//----
PangoLayout *layout;
PangoFontDescription *desc;
cairo_translate(cr, 10, 20);
layout = pango_cairo_create_layout(cr);
pango_layout_set_text(layout, "Hello World!", -1);
desc = pango_font_description_from_string("Sans Bold 12");
pango_layout_set_font_description(layout, desc);
pango_font_description_free(desc);
cairo_set_source_rgb(cr, 0.0, 0.0, 1.0);
pango_cairo_update_layout(cr, layout);
pango_cairo_show_layout(cr, layout);
g_object_unref(layout);
//-----
cairo_destroy(cr);
*/

View File

@ -1,93 +0,0 @@
/**
*******************************************************************************
* @file Display.h
* @brief Editeur De N'ours : Basic Pixbuf display function (header)
* @author Edouard DUPIN
* @date 21/01/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_DISPLAY_H__
#define __TOOLS_DISPLAY_H__
#include "tools_debug.h"
#include "Colorize.h"
#include "ColorizeManager.h"
/**
* Basic namespace for the font display system
*/
namespace Display
{
void Init(void);
void UnInit(void);
cairo_font_face_t * GetFont(bool bold, bool italic);
int32_t GetFontHeight(void);
int32_t GetFontWidth(void);
};
#define MAX_CARACTER_CYCLE (512)
/**
* class to abstrate the writing on the curent GUI (INTEFACE to be no dependent of the one chosen)
*/
class DrawerManager;
class DrawerManager {
public:
// Constructeur
DrawerManager(GtkWidget * widget, int32_t x, int32_t y);
~DrawerManager();
void Rectangle(Colorize *SelectColor, int32_t x, int32_t y, int32_t width, int32_t height);
void Rectangle(color_ts & SelectColor, int32_t x, int32_t y, int32_t width, int32_t height) {
DirectRectangle(SelectColor, x, y, width, height);
}
void Clean(Colorize *SelectColor);
void Clean(color_ts & SelectColor);
void Text(Colorize *SelectColor, int32_t x, int32_t y,const char *myUTF8Text, int32_t len = -1);
void Text(color_ts & SelectColorFg, color_ts & SelectColorBg, int32_t x, int32_t y,const char *myText);
void Text(color_ts & SelectColorFg, int32_t x, int32_t y,const char *myText);
void SpaceText(color_ts & SelectColor, int32_t x, int32_t y,int32_t nbChar);
void Cursor(int32_t x, int32_t y);
void EndOfLine(int32_t x, int32_t y);
void Tabulation(Colorize *SelectColor, int32_t x, int32_t y, int32_t mbColomn);
void UTF8UnknownElement(Colorize *SelectColor, int32_t x, int32_t y, int8_t utf8Size, bool ValidUtf8);
void Flush(void);
int32_t GetWidth(void) { return m_size.x; };
int32_t GetHeight(void) { return m_size.y; };
private:
void DirectRectangle(Colorize *SelectColor, int32_t x, int32_t y, int32_t width, int32_t height);
void DirectRectangle(color_ts & SelectColor, int32_t x, int32_t y, int32_t width, int32_t height);
bool m_haveWork; //!< if data might be print (true)
char m_dataToDisplay[MAX_CARACTER_CYCLE]; //!< curent string to display
uint32_t m_nbElement; //!< nb element in the string
position_ts m_pos; //!< position where start the string display (X,Y)
Colorize * m_selectColor; //!< curent color to display
position_ts m_size; //!< Total size
cairo_t * m_cairo; //!< Cairo Layout pointer
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,212 +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 "charset.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 enum{
SELECTION_PRIMARY,
SELECTION_SECONDARY,
SELECTION_HIGHTLIGHT,
SELECTION_SIZE
}selectionType_te;
typedef struct {
Edn::VectorType<colorInformation_ts> HLData;
int32_t idSequence;
int32_t posHLPass1;
int32_t posHLPass2;
}displayHLData_ts;
class EdnBuf {
public:
// constructer
EdnBuf(void);
// destructer
~EdnBuf(void);
// public function :
void GetAll( Edn::VectorType<int8_t> &text);
void SetAll( Edn::VectorType<int8_t> &text);
void GetRange( int32_t start, int32_t end, Edn::VectorType<int8_t> &output);
bool DumpIn( FILE *myFile);
bool DumpFrom( FILE *myFile);
// replace with operator [] ...
int8_t operator[] (int32_t);
void Insert( int32_t pos, Edn::VectorType<int8_t> &insertText);
void Replace( int32_t start, int32_t end, Edn::VectorType<int8_t> &insertText);
void Remove( int32_t start, int32_t end);
int32_t Indent( selectionType_te select);
int32_t UnIndent( selectionType_te select);
void GetLineText( int32_t pos, Edn::VectorType<int8_t> &text);
int32_t StartOfLine( int32_t pos);
int32_t EndOfLine( int32_t pos);
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 : rework this
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( Edn::VectorType<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, Edn::VectorType<int8_t> &searchVect, int32_t *foundPos, bool caseSensitive = true);
bool SearchBackward( int32_t startPos, Edn::VectorType<int8_t> &searchVect, int32_t *foundPos, 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( selectionType_te select);
void Select( selectionType_te select, int32_t start, int32_t end);
void Unselect( selectionType_te select);
void RectSelect( selectionType_te select, int32_t start, int32_t end, int32_t rectStart, int32_t rectEnd);
bool GetSelectionPos( selectionType_te select, int32_t &start, int32_t &end, bool &isRect, int32_t &rectStart, int32_t &rectEnd);
void GetSelectionText( selectionType_te select, Edn::VectorType<int8_t> &text);
void RemoveSelected( selectionType_te select);
void ReplaceSelected( selectionType_te select, Edn::VectorType<int8_t> &text);
private:
// current selection of the buffer
selection m_selectionList[SELECTION_SIZE]; //!< Selection area of the buffer
void UpdateSelection( selectionType_te select, int32_t pos, int32_t nDeleted, int32_t nInserted);
void UpdateSelections( 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;
Edn::VectorType<EdnBufHistory*> m_historyUndo;
Edn::VectorType<EdnBufHistory*> m_historyRedo;
// -----------------------------------------
// hightlight section :
// -----------------------------------------
private:
Highlight * m_Highlight; //!< internal link with the Highlight system
Edn::VectorType<colorInformation_ts> m_HLDataPass1; //!< colorisation position in the current buffer pass 1
int32_t m_HLDataSequence; //!< position of the start of line requested by the screen viewer
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; };
charset_te GetCharsetType(void) { return m_charsetType; };
void SetCharsetType(charset_te newOne) { m_charsetType = newOne; if (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=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)
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, Edn::VectorType<int8_t> &deletedText);
int32_t insert( int32_t pos, Edn::VectorType<int8_t> &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 "tools_debug.h"
#include "tools_globals.h"
#include "EdnBufHistory.h"
#undef __class__
#define __class__ "EdnBufHistory"
EdnBufHistory::EdnBufHistory(void)
{
//EDN_INFO("EdnBufHistory new");
m_pos = 0;
m_nInserted = 0;
}
EdnBufHistory::EdnBufHistory(int32_t pos, int32_t nInserted, Edn::VectorType<int8_t> &deletedText)
{
//EDN_INFO("EdnBufHistory new + data");
m_pos = pos;
m_nInserted = nInserted;
m_deletedText = deletedText;
}
void EdnBufHistory::Set(int32_t pos, int32_t nInserted, Edn::VectorType<int8_t> &deletedText)
{
//EDN_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(Edn::VectorType<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 "VectorType.h"
class EdnBufHistory{
public:
EdnBufHistory(void);
EdnBufHistory(int32_t pos, int32_t nInserted, Edn::VectorType<int8_t> &deletedText);
~EdnBufHistory(void);
void Set(int32_t pos, int32_t nInserted, Edn::VectorType<int8_t> &deletedText);
int32_t getPos(void);
int32_t getnbDeleted(void);
int32_t getnbInserted(void);
void getData(Edn::VectorType<int8_t> &deletedText);
private:
int32_t m_pos;
int32_t m_nInserted;
Edn::VectorType<int8_t> m_deletedText;
};
#endif

View File

@ -1,377 +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 "tools_debug.h"
#include "tools_globals.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);
// remove display HL...
m_HLDataSequence++;
// prevent ERROR...
if (NULL == m_Highlight) {
return;
}
// prevent No data Call
if( 0 == nbDeleted
&& 0 == nbAdded)
{
return;
}
// normal case
//EDN_INFO("(pos="<<pos<<", nbDeleted="<<nbDeleted<<", nbAdded=" << nbAdded << "\");");
int32_t i;
/*
for (i=0; i< (int32_t)m_HLDataPass1.Size(); i++) {
Edn::String ploppp;
if (NULL != m_HLDataPass1[i].patern ) {
ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->GetName();
}
EDN_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);
//EDN_DEBUG("1 * Erase 0");
} else {
m_HLDataPass1.EraseLen(0,stopId);
//EDN_DEBUG("2 * Erase 0->" << stopId);
}
} else if(-1 == stopId) {
//EDN_DEBUG("3 * Erase " << startId+1 << "-> end");
m_HLDataPass1.EraseLen(startId+1, m_HLDataPass1.Size() - startId);
stopId = -1;
} else {
int32_t currentSize = m_HLDataPass1.Size();
//EDN_DEBUG("4 * Erase " << startId+1 << "->" << stopId << " in " << currentSize << " elements" );
m_HLDataPass1.EraseLen(startId+1, stopId - startId);
if (stopId == currentSize-1) {
stopId = -1;
}
}
//EDN_DEBUG("new size=" << (int32_t)m_HLDataPass1.Size()-1);
/*
for (i=0; i< (int32_t)m_HLDataPass1.Size(); i++) {
Edn::String ploppp;
if (NULL != m_HLDataPass1[i].patern ) {
ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->GetName();
}
EDN_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++) {
//EDN_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)
{
//EDN_DEBUG("******* Regenerate ALL");
GenerateHighLightAt(0, m_data.Size());
} else if(-1 == startId) {
//EDN_DEBUG("******* Regenerate START");
GenerateHighLightAt(0, m_HLDataPass1[0].beginStart, 0);
} else if(-1 == stopId) {
//EDN_DEBUG("******* Regenerate STOP");
GenerateHighLightAt(m_HLDataPass1[m_HLDataPass1.Size() -1].endStop, m_data.Size(), m_HLDataPass1.Size());
} else {
//EDN_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++) {
Edn::String ploppp;
if (NULL != m_HLDataPass1[i].patern ) {
ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->GetName();
}
EDN_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);
EDN_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()) {
EDN_DEBUG("==> BEGIN : start="<<m_HLDataPass1[startId].beginStart<<", stop="<<m_HLDataPass1[startId].endStop<<" id=" << startId << "/" << (int32_t)m_HLDataPass1.Size()-1);
} else {
EDN_DEBUG("==> BEGIN : start=???, stop=??? id=" << startId);
}
if (-1 != stopId && stopId < (int32_t)m_HLDataPass1.Size()) {
EDN_DEBUG("==> END : start="<<m_HLDataPass1[stopId].beginStart<<", stop="<<m_HLDataPass1[stopId].endStop<<" id=" << stopId<< "/" << (int32_t)m_HLDataPass1.Size()-1);
} else {
EDN_DEBUG("==> END : start=???, stop=??? id=" << stopId);
}
*/
}
void EdnBuf::GenerateHighLightAt(int32_t pos, int32_t endPos, int32_t addinPos)
{
if (NULL == m_Highlight) {
return;
}
//EDN_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 = edn_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;
}
if (MData.idSequence != m_HLDataSequence) {
GTimeVal timeStart;
g_get_current_time(&timeStart);
MData.idSequence = m_HLDataSequence;
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;
//EDN_DEBUG("List of section between : "<< startId << " & " << stopId);
int32_t endSearch = stopId+1;
if (-1 == stopId) {
endSearch = m_HLDataPass1.Size();
}
for (k=edn_max(startId, 0); k<endSearch; k++) {
// empty section :
if (0==k) {
if (HLStart < m_HLDataPass1[k].beginStart) {
//EDN_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 {
//EDN_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 :
//EDN_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) {
//EDN_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 {
//EDN_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);
EDN_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 = edn_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 "tools_debug.h"
#include "tools_globals.h"
#include "EdnBuf.h"
#undef __class__
#define __class__ "EdnBuf{History}"
int32_t EdnBuf::Undo(void)
{
int32_t nbElement = m_historyUndo.Size();
//EDN_DEBUG("EdnBuf::Undo Request id="<<nbElement);
int32_t posDest = -1;
if (0 == nbElement) {
// nothing to do ...
EDN_ERROR("EdnBuf::Undo No more History");
return -1;
}
nbElement--;
if (m_historyUndo[nbElement] == NULL) {
EDN_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();
Edn::VectorType<int8_t> deletedText;
m_historyUndo[nbElement]->getData(deletedText);
m_isUndoProcessing = true;
if (0 == nbInserted) {
// just add data at position ...
if (0 == nbDeleted) {
EDN_ERROR("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();
//EDN_DEBUG("EdnBuf::Redo Request id="<<nbElement);
int32_t posDest = -1;
if (0 == nbElement) {
// nothing to do ...
EDN_ERROR("EdnBuf::Redo No more History");
return -1;
}
nbElement--;
if (m_historyRedo[nbElement] == NULL) {
EDN_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();
Edn::VectorType<int8_t> deletedText;
m_historyRedo[nbElement]->getData(deletedText);
m_isRedoProcessing = true;
if (0 == nbInserted) {
// just add data at position ...
if (0 == nbDeleted) {
EDN_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,284 +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 "tools_debug.h"
#include "tools_globals.h"
#include "EdnBuf.h"
#undef __class__
#define __class__ "EdnBuf{Selection}"
/**
* @brief
*
* @param[in,out] ---
* @param[in,out] ---
*
* @return ---
*
*/
bool EdnBuf::SelectHasSelection(selectionType_te select)
{
return m_selectionList[select].selected;
}
/**
* @brief
*
* @param[in,out] ---
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::Select(selectionType_te select, int32_t start, int32_t end)
{
selection oldSelection = m_selectionList[select];
m_selectionList[select].selected = start != end;
m_selectionList[select].zeroWidth = (start == end) ? true : false;
m_selectionList[select].rectangular = false;
m_selectionList[select].start = edn_min(start, end);
m_selectionList[select].end = edn_max(start, end);
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::Unselect(selectionType_te select)
{
selection oldSelection = m_selectionList[select];
m_selectionList[select].selected = false;
m_selectionList[select].zeroWidth = false;
}
/**
* @brief
*
* @param[in,out] ---
* @param[in,out] ---
* @param[in,out] ---
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::RectSelect(selectionType_te select, int32_t start, int32_t end, int32_t rectStart, int32_t rectEnd)
{
m_selectionList[select].selected = rectStart < rectEnd;
m_selectionList[select].zeroWidth = (rectStart == rectEnd) ? false : true;
m_selectionList[select].rectangular = true;
m_selectionList[select].start = start;
m_selectionList[select].end = end;
m_selectionList[select].rectStart = rectStart;
m_selectionList[select].rectEnd = rectEnd;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
bool EdnBuf::GetSelectionPos(selectionType_te select, 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[select].rectangular;
start = m_selectionList[select].start;
end = m_selectionList[select].end;
if (m_selectionList[select].rectangular) {
rectStart = m_selectionList[select].rectStart;
rectEnd = m_selectionList[select].rectEnd;
}
return m_selectionList[select].selected;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::GetSelectionText(selectionType_te select, Edn::VectorType<int8_t> &text)
{
int32_t start, end, rectStart, rectEnd;
bool isRect;
// remove output data
text.Clear();
bool isSelected = GetSelectionPos(select, 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(selectionType_te select)
{
int32_t start, end;
int32_t rectStart, rectEnd;
bool isRect;
bool isSelected = GetSelectionPos(select, 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(select);
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::ReplaceSelected(selectionType_te select, Edn::VectorType<int8_t> &text)
{
int32_t start, end, rectStart, rectEnd;
bool isRect;
bool isSelected = GetSelectionPos(select, start, end, isRect, rectStart, rectEnd);
// No data selected ...
if (false == isSelected) {
return;
}
// Rectangular selection
if (true == isRect) {
//ReplaceRect(start, end, rectStart, rectEnd, text);
// TODO : ...
} else {
Replace(start, end, text);
}
// Clean selection
m_selectionList[select].selected = false;
}
/*
** Update all of the selections in "buf" for changes in the buffer's text
*/
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::UpdateSelections(int32_t pos, int32_t nDeleted, int32_t nInserted)
{
UpdateSelection(SELECTION_PRIMARY , pos, nDeleted, nInserted);
UpdateSelection(SELECTION_SECONDARY , pos, nDeleted, nInserted);
UpdateSelection(SELECTION_HIGHTLIGHT, pos, nDeleted, nInserted);
}
/*
** Update an individual selection for changes in the corresponding text
*/
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::UpdateSelection(selectionType_te select, int32_t pos, int32_t nDeleted, int32_t nInserted)
{
if( ( false == m_selectionList[select].selected
&& false == m_selectionList[select].zeroWidth)
|| pos > m_selectionList[select].end )
{
return;
}
if (pos+nDeleted <= m_selectionList[select].start) {
m_selectionList[select].start += nInserted - nDeleted;
m_selectionList[select].end += nInserted - nDeleted;
} else if( pos <= m_selectionList[select].start
&& pos+nDeleted >= m_selectionList[select].end)
{
m_selectionList[select].start = pos;
m_selectionList[select].end = pos;
m_selectionList[select].selected = false;
m_selectionList[select].zeroWidth = false;
} else if( pos <= m_selectionList[select].start
&& pos+nDeleted < m_selectionList[select].end)
{
m_selectionList[select].start = pos;
m_selectionList[select].end = nInserted + m_selectionList[select].end - nDeleted;
} else if(pos < m_selectionList[select].end) {
m_selectionList[select].end += nInserted - nDeleted;
if (m_selectionList[select].end <= m_selectionList[select].start) {
m_selectionList[select].selected = false;
}
}
}

View File

@ -1,706 +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 "tools_debug.h"
#include "tools_globals.h"
#include "toolsMemory.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
EDN_MALLOC(m_data, m_allocated, int8_t);
EDN_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) {
EDN_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(FILE *myFile)
{
bool ret = true;
// write Data
(void)fwrite(m_data, sizeof(int8_t), m_gapStart, myFile);
(void)fwrite(&m_data[m_gapEnd], sizeof(int8_t), m_allocated - m_gapEnd, myFile);
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(FILE *myFile)
{
bool ret = true;
int32_t length = getFileSize(myFile);
// error case ...
if (length < 0) {
length = 0;
}
// allocate the current buffer :
ChangeAllocation(length + GAP_SIZE_MIN);
// insert Data
int32_t nbReadData = fread(&m_data[GAP_SIZE_MIN], sizeof(int8_t), length, myFile);
EDN_INFO("load data : filesize=" << length << ", readData=" << nbReadData);
// check ERROR
if (nbReadData != length) {
EDN_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) {
EDN_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
EDN_MALLOC(m_data, m_allocated, int8_t);
EDN_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)
{
EDN_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)
{
EDN_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, Edn::VectorType<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 ) {
EDN_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return;
}
if( pos+nbRemoveElement > Size() ) {
EDN_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;
}
EDN_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)
EDN_MALLOC(m_data, newSize, int8_t);
} else {
// move datas
EDN_REALLOC(m_data, newSize, int8_t);
}
// Check result with assert :
EDN_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 ) {
EDN_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, Edn::VectorType<int8_t>& items)
{
if( pos > Size()
|| pos < 0 ) {
EDN_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 ) {
EDN_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, Edn::VectorType<int8_t>& items)
{
if( pos > Size()
|| pos < 0 ) {
EDN_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return;
}
if( pos+nbRemoveElement > Size() ) {
EDN_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 ) {
EDN_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 ) {
EDN_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)
{
EDN_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) {
EDN_INFO( "Element " << i << " : GAP");
} else {
EDN_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';
Edn::VectorType<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 "toolsMemory.h"
#include "VectorType.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
{
EDN_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
{
EDN_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( FILE *myFile);
bool DumpFrom( FILE *myFile);
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, Edn::VectorType<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, Edn::VectorType<int8_t>& items);
// Remove and insert functions
void Replace( int32_t pos, const int8_t& item);
void Replace( int32_t pos, int32_t nbRemoveElement, Edn::VectorType<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,85 +0,0 @@
/**
*******************************************************************************
* @file Singleton.h
* @brief Editeur De N'ours : singleton system class
* @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.
*
*******************************************************************************
*/
#ifndef __SINGLETON_H__
#define __SINGLETON_H__
#include <iostream>
using namespace std;
/////////////////////////////////////////////////////////////////////////////
//
// Singleton - modèle Singleton applicable à n'importe quelle classe.
//
/////////////////////////////////////////////////////////////////////////////
template <typename T>
class Singleton
{
protected:
// Constructeur/destructeur
Singleton() { }
~Singleton() { /*std::cout << "destroying singleton." << std::endl;*/ }
public:
// Interface publique
static T *getInstance()
{
if (NULL == _singleton)
{
/*std::cout << "C: Singleton | creating singleton." << std::endl;*/
_singleton = new T;
}
/*
else
{
std::cout << "C: Singleton | singleton already created!" << std::endl;
}
*/
return (static_cast<T*> (_singleton));
}
static void kill()
{
if (NULL != _singleton)
{
delete _singleton;
_singleton = NULL;
}
}
private:
// Unique instance
static T *_singleton;
};
template <typename T>
T *Singleton<T>::_singleton = NULL;
#endif

View File

@ -1,97 +0,0 @@
/**
*******************************************************************************
* @file AccelKey.cpp
* @brief Editeur De N'ours : Basic Gui Accelerator Key (common for ALL) or nearly (Sources)
* @author Edouard DUPIN
* @date 17/06/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 "tools_debug.h"
#include "AccelKey.h"
AccelKey::AccelKey(void)
{
m_accelGroup = gtk_accel_group_new();
}
AccelKey::~AccelKey(void)
{
}
void AccelKey::SetAccel(GtkWidget * widget, char * accelKey)
{
SetAccel(widget, m_accelGroup, accelKey);
}
void AccelKey::SetAccel(GtkWidget * widget, GtkAccelGroup * accel, char * accelKey)
{
guint accel_key = 0;
int32_t accel_mods = 0;
if( NULL==accelKey
|| 0==strlen(accelKey))
{
return;
}
// parsing of the string :
//"ctrl+shift+alt+pomme+s"
//EDN_DEBUG("Parse acxel string : \"" << accelKey << "\"");
char * tmp = strstr(accelKey, "ctrl");
if(NULL != tmp) {
accel_mods |= GDK_CONTROL_MASK;
//EDN_DEBUG(" => find CTRL");
}
tmp = strstr(accelKey, "shift");
if(NULL != tmp) {
accel_mods |= GDK_SHIFT_MASK;
//EDN_DEBUG(" => find SHIFT");
}
tmp = strstr(accelKey, "alt");
if(NULL != tmp) {
accel_mods |= GDK_MOD1_MASK;
//EDN_DEBUG(" => find ALT");
}
tmp = strstr(accelKey, "pomme");
if(NULL != tmp) {
accel_mods |= GDK_MOD2_MASK;
//EDN_DEBUG(" => find POMME");
}
accel_key = accelKey[strlen(accelKey) -1];
//char plop = accel_key;
//EDN_DEBUG(" => find letter : '" << plop << "'");
// Ajout du racourcis clavier :
gtk_widget_add_accelerator( widget, "activate", accel,
accel_key, // key
(GdkModifierType)accel_mods, // modifier keys
GTK_ACCEL_VISIBLE);
}
void AccelKey::LinkCommonAccel(GtkWidget * widget)
{
gtk_window_add_accel_group(GTK_WINDOW(widget), m_accelGroup);
}
void AccelKey::LinkCommonAccel(GtkWindow * widget)
{
gtk_window_add_accel_group(GTK_WINDOW(widget), m_accelGroup);
}

View File

@ -1,56 +0,0 @@
/**
*******************************************************************************
* @file AccelKey.h
* @brief Editeur De N'ours : Basic Gui Accelerator Key (common for ALL) or nearly (header)
* @author Edouard DUPIN
* @date 17/06/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 __ACCEL_KEY_H__
#define __ACCEL_KEY_H__
#include "tools_debug.h"
#include "Singleton.h"
// need to create a syngleton ...
class AccelKey: public Singleton<AccelKey>
{
friend class Singleton<AccelKey>;
// specific for sigleton system...
private:
// Constructeur
AccelKey(void);
~AccelKey(void);
public:
// for internal Parsing
void SetAccel(GtkWidget * widget, char * accelKey);
// For external parsing
void SetAccel(GtkWidget * widget, GtkAccelGroup * accel, char * accelKey);
void LinkCommonAccel(GtkWidget * widget);
void LinkCommonAccel(GtkWindow * widget);
GtkAccelGroup * GetAccel(void) { return m_accelGroup; };
private:
GtkAccelGroup * m_accelGroup;
};
#endif

View File

@ -1,286 +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 "tools_debug.h"
#include "tools_globals.h"
#include "MsgBroadcast.h"
#undef __class__
#define __class__ "MsgBroadcast"
MsgBroadcast::MsgBroadcast(const char * className, messageCat_te cat)
{
m_messageSystem = MsgBroadcastCore::getInstance();
m_className = className;
m_cat = cat;
// add on listner
m_messageSystem->AddReceiver(this);
}
MsgBroadcast::~MsgBroadcast(void)
{
m_messageSystem->RmReceiver(this);
m_messageSystem = NULL;
}
void MsgBroadcast::OnMessage(int32_t id, int32_t dataID)
{
// nothing to do here
}
void MsgBroadcast::SendMessage(messageType_te id, int32_t dataID)
{
m_messageSystem->SendMessage(this, id, dataID);
}
#undef __class__
#define __class__ "MsgBroadcastCore"
// need to create a syngleton ...
MsgBroadcastCore::MsgBroadcastCore(void)
{
EDN_INFO("Init broadcast message System : ");
m_messageID = 0;
}
MsgBroadcastCore::~MsgBroadcastCore(void)
{
EDN_INFO("Un-Init broadcast message System : ");
}
#define MACRO_DISPLAY_MSG(data) case data: return (char*)#data ; break;
static char * GetMessageChar(messageType_te Id)
{
switch(Id)
{
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_CHANGE_CURRENT)
MACRO_DISPLAY_MSG(EDN_MSG__USER_DISPLAY_CHANGE)
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_MAIN_WINDOWS)
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_SEARCH)
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_PREFERENCE)
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_REPLACE)
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_OPEN_FILE)
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_SAVE_AS)
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_GOTO_LINE)
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_ABOUT)
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_EXIT_CONFIRMATION)
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_REMOVE)
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_REMOVE_ALL)
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_ADD)
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_CHANGE_STATE)
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_CHANGE_NAME)
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_CHANGE_MODIFY)
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_CHANGE_HAS_HISTORY)
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_CHANGE_HAS_NOT_HISTORY)
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_CHANGE_HAS_FUTURE_HISTORY)
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_CHANGE_HAS_NOT_FUTURE_HISTORY)
// create a new buffer
MACRO_DISPLAY_MSG(EDN_MSG__NEW)
MACRO_DISPLAY_MSG(EDN_MSG__BUFF_ALL_SAVE)
MACRO_DISPLAY_MSG(EDN_MSG__BUFF_ALL_CLOSE)
MACRO_DISPLAY_MSG(EDN_MSG__BUFF_ID_CLOSE)
MACRO_DISPLAY_MSG(EDN_MSG__BUFF_ID_SAVE)
// GUI event for the selected buffer
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_CHANGE_BUFFER_ID)
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_SAVE)
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_SAVE_AS)
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_REMOVE_LINE)
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_SELECT_ALL)
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_UN_SELECT)
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_COPY)
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_CUT)
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_PASTE)
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_FIND_PREVIOUS)
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_FIND_OLD_PREVIOUS)
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_FIND_NEXT)
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_FIND_OLD_NEXT)
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_REPLACE)
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_REPLACE_ALL)
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_CLOSE)
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_UNDO)
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_REDO)
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_GOTO_LINE)
MACRO_DISPLAY_MSG(EDN_MSG__REFRESH_DISPLAY)
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_SET_CHARSET)
// Ctags MESSAGE :
MACRO_DISPLAY_MSG(EDN_MSG__OPEN_CTAGS)
MACRO_DISPLAY_MSG(EDN_MSG__RELOAD_CTAGS)
MACRO_DISPLAY_MSG(EDN_MSG__JUMP_TO_CURRENT_SELECTION)
MACRO_DISPLAY_MSG(EDN_MSG__JUMP_BACK)
// HL message :
MACRO_DISPLAY_MSG(EDN_MSG__COLOR_HAS_CHANGE)
// Color message :
MACRO_DISPLAY_MSG(EDN_MSG__RELOAD_COLOR_FILE)
default:
return (char*)"??";
}
}
static char * GetMessageTypeChar(messageCat_te Id)
{
switch(Id)
{
case EDN_CAT_NONE:
return (char*)"NONE";
case EDN_CAT_GUI:
return (char*)"GUI";
case EDN_CAT_WORK_AREA:
return (char*)"WORK_AREA";
case EDN_CAT_SYSTEM:
return (char*)"SYSTEM";
case EDN_CAT_BUFFER_MANAGER:
return (char*)"BUFFER_MANAGER";
case EDN_CAT_GUI_MANAGER:
return (char*)"GUI_MANAGER";
case EDN_CAT_CTAGS:
return (char*)"C-TAGS_MANAGER";
case EDN_CAT_MENU_CONTEXT:
return (char*)"MENU CONTEXT";
case EDN_CAT_HL:
return (char*)"HIGHT-LIGHT";
case EDN_CAT_COLOR:
return (char*)"COLOR";
default:
return (char*)"??";
}
}
void MsgBroadcastCore::SendMessage(MsgBroadcast * pointerOnSender, messageType_te id, int32_t dataID)
{
// Add message on the list :
messageElement_ts myStructMessage;
messageCat_te catDest = EDN_CAT_NONE;
// DESTINATION : GUI_MANAGER
if( MSG_TO_GUI_MANAGER__START <= id
&& MSG_TO_GUI_MANAGER__STOP >= id )
{
catDest = EDN_CAT_GUI_MANAGER;
} else if( MSG_TO_GUI__START <= id
&& MSG_TO_GUI__STOP >= id )
{
catDest = EDN_CAT_GUI;
} else if( MSG_TO_BUFFER_MANAGER__START <= id
&& MSG_TO_BUFFER_MANAGER__STOP >= id )
{
catDest = EDN_CAT_BUFFER_MANAGER;
} else if( MSG_TO_WORKING_AREA__START <= id
&& MSG_TO_WORKING_AREA__STOP >= id )
{
catDest = EDN_CAT_WORK_AREA;
} else if( MSG_TO_SYSTEM__START <= id
&& MSG_TO_SYSTEM__STOP >= id )
{
catDest = EDN_CAT_SYSTEM;
} else if( MSG_TO_CTAGS__START <= id
&& MSG_TO_CTAGS__STOP >= id )
{
catDest = EDN_CAT_CTAGS;
} else if( MSG_TO_CONTEXT__START <= id
&& MSG_TO_CONTEXT__STOP >= id )
{
catDest = EDN_CAT_MENU_CONTEXT;
} else if( MSG_TO_HL__START <= id
&& MSG_TO_HL__STOP >= id )
{
catDest = EDN_CAT_HL;
} else if( MSG_TO_COLOR__START <= id
&& MSG_TO_COLOR__STOP >= id )
{
catDest = EDN_CAT_COLOR;
}
myStructMessage.localMessageID = m_messageID++;
if (NULL == pointerOnSender) {
EDN_INFO("#" << myStructMessage.localMessageID << " From \"NULL\" CAT=" << GetMessageTypeChar(catDest) << " id=" << id << "=\"" << GetMessageChar(id) << "\" dataID=" << dataID);
} else {
EDN_INFO("#" << myStructMessage.localMessageID << " From \"" << pointerOnSender->GetName().c_str() << "\" CAT=" << GetMessageTypeChar(catDest) << " id=" << id << "=\"" << GetMessageChar(id) << "\" dataID=" << dataID);
}
myStructMessage.msgCatDest = catDest;
myStructMessage.msgId = id;
myStructMessage.data = dataID;
m_listOfMessage.PushBack(myStructMessage);
if (m_listOfMessage.Size() > 1 ) {
// we are curently in message processing ==> wait end to process this message
return;
}
// send message on system :
while (m_listOfMessage.Size() > 0) {
for (int32_t i=0 ; i<m_listMessage.Size() ; i++) {
if( EDN_CAT_NONE == m_listOfMessage[0].msgCatDest
|| m_listOfMessage[0].msgCatDest == m_listMessage[i]->GetCat())
{
EDN_INFO(" #" << m_listOfMessage[0].localMessageID << " ==> process In :\"" << m_listMessage[i]->GetName().c_str() << "\" ");
m_listMessage[i]->OnMessage(m_listOfMessage[0].msgId, m_listOfMessage[0].data);
}
}
m_listOfMessage.Erase(0);
}
}
void MsgBroadcastCore::AddReceiver(MsgBroadcast * pointerOnReceiver)
{
for (int32_t i=0 ; i<m_listMessage.Size() ; i++) {
if (m_listMessage[i] == pointerOnReceiver) {
// nothing to do ...
return;
}
}
m_listMessage.PushBack(pointerOnReceiver);
EDN_INFO("Add a listner for the broadCast messages : \"" << pointerOnReceiver->GetName().c_str() << "\"");
}
void MsgBroadcastCore::RmReceiver(MsgBroadcast * pointerOnReceiver)
{
for (int32_t i=0 ; i<m_listMessage.Size() ; i++) {
if (m_listMessage[i] == pointerOnReceiver) {
m_listMessage.Erase(i);
return;
}
}
}
void GeneralSendMessage(messageType_te id, int32_t dataID)
{
MsgBroadcastCore::getInstance()->SendMessage(NULL, id, dataID);
}

View File

@ -1,216 +0,0 @@
/**
*******************************************************************************
* @file MsgBroadcast.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__
#include "tools_debug.h"
#include "Edn.h"
#include "Singleton.h"
// broadCast Message
// Message to prevent the curent thread that Buffer has changed
// the ID we'll use to identify our event
typedef enum {
EDN_MSG__NONE = 0,
EDN_MSG__BUFFER_CHANGE_CURRENT, // set the new current BUFFER ...
EDN_MSG__USER_DISPLAY_CHANGE, // User change the display ==> need to reload all the display depending on color internal
// DESTINATION : GUI_MANAGER
MSG_TO_GUI_MANAGER__START,
// GUI windows openning and closing
EDN_MSG__GUI_SHOW_MAIN_WINDOWS,
EDN_MSG__GUI_SHOW_SEARCH,
EDN_MSG__GUI_SHOW_PREFERENCE,
EDN_MSG__GUI_SHOW_REPLACE,
EDN_MSG__GUI_SHOW_OPEN_FILE,
EDN_MSG__GUI_SHOW_SAVE_AS,
EDN_MSG__GUI_SHOW_GOTO_LINE,
EDN_MSG__GUI_SHOW_ABOUT,
EDN_MSG__GUI_SHOW_EXIT_CONFIRMATION,
MSG_TO_GUI_MANAGER__STOP,
// DESTINATION : GUI
// generate by the current buffer to said the buffer has changing
MSG_TO_GUI__START,
EDN_MSG__BUFFER_REMOVE,
EDN_MSG__BUFFER_REMOVE_ALL,
EDN_MSG__BUFFER_ADD,
EDN_MSG__BUFFER_CHANGE_STATE,
EDN_MSG__BUFFER_CHANGE_NAME,
EDN_MSG__BUFFER_CHANGE_MODIFY,
EDN_MSG__BUFFER_CHANGE_HAS_HISTORY,
EDN_MSG__BUFFER_CHANGE_HAS_NOT_HISTORY,
EDN_MSG__BUFFER_CHANGE_HAS_FUTURE_HISTORY,
EDN_MSG__BUFFER_CHANGE_HAS_NOT_FUTURE_HISTORY,
MSG_TO_GUI__STOP,
// DESTINATION : Buffer MANAGER
MSG_TO_BUFFER_MANAGER__START,
// create a new buffer
EDN_MSG__NEW,
// Event For All buffer ==> goto the buffer MANAGER
EDN_MSG__BUFF_ALL_SAVE,
EDN_MSG__BUFF_ALL_CLOSE,
// Event For Specific Buffer ID : ==> GOTO the buffer MANAGER
EDN_MSG__BUFF_ID_CLOSE,
EDN_MSG__BUFF_ID_SAVE,
MSG_TO_BUFFER_MANAGER__STOP,
// DESTINATION : Working AREA
MSG_TO_WORKING_AREA__START,
// GUI event for the selected buffer
EDN_MSG__CURRENT_CHANGE_BUFFER_ID,
EDN_MSG__CURRENT_SAVE,
EDN_MSG__CURRENT_SAVE_AS,
EDN_MSG__CURRENT_SELECT_ALL,
EDN_MSG__CURRENT_REMOVE_LINE,
EDN_MSG__CURRENT_UN_SELECT,
EDN_MSG__CURRENT_COPY,
EDN_MSG__CURRENT_CUT,
EDN_MSG__CURRENT_PASTE,
EDN_MSG__CURRENT_FIND_PREVIOUS,
EDN_MSG__CURRENT_FIND_OLD_PREVIOUS,
EDN_MSG__CURRENT_FIND_NEXT,
EDN_MSG__CURRENT_FIND_OLD_NEXT,
EDN_MSG__CURRENT_REPLACE,
EDN_MSG__CURRENT_REPLACE_ALL,
EDN_MSG__CURRENT_CLOSE,
EDN_MSG__CURRENT_UNDO,
EDN_MSG__CURRENT_REDO,
EDN_MSG__CURRENT_GOTO_LINE,
EDN_MSG__REFRESH_DISPLAY,
EDN_MSG__CURRENT_SET_CHARSET,
MSG_TO_WORKING_AREA__STOP,
// DESTINATION : SYSTEM ...
MSG_TO_SYSTEM__START,
MSG_TO_SYSTEM__STOP,
// DESTINATION : CTAGS ...
MSG_TO_CTAGS__START,
EDN_MSG__OPEN_CTAGS,
EDN_MSG__RELOAD_CTAGS,
EDN_MSG__JUMP_TO_CURRENT_SELECTION,
EDN_MSG__JUMP_BACK,
MSG_TO_CTAGS__STOP,
// DESTINATION : context popup ...
MSG_TO_CONTEXT__START,
MSG_TO_CONTEXT__STOP,
// DESTINATION : highlight system ...
MSG_TO_HL__START,
EDN_MSG__COLOR_HAS_CHANGE,
MSG_TO_HL__STOP,
// DESTINATION : Color System ...
MSG_TO_COLOR__START,
EDN_MSG__RELOAD_COLOR_FILE,
MSG_TO_COLOR__STOP,
}messageType_te;
typedef enum {
EDN_CAT_NONE,
EDN_CAT_GUI,
EDN_CAT_WORK_AREA,
EDN_CAT_SYSTEM,
EDN_CAT_BUFFER_MANAGER,
EDN_CAT_GUI_MANAGER,
EDN_CAT_CTAGS,
EDN_CAT_MENU_CONTEXT,
EDN_CAT_HL,
EDN_CAT_COLOR,
}messageCat_te;
typedef struct {
messageType_te msgId;
int32_t dataId;
}messageData_ts;
class MsgBroadcastCore;
class MsgBroadcast
{
private:
Edn::String m_className;
MsgBroadcastCore * m_messageSystem;
messageCat_te m_cat;
public:
MsgBroadcast(const char * className, messageCat_te cat);
virtual ~MsgBroadcast(void);
// caul when a message is send
virtual void OnMessage(int32_t id, int32_t dataID);
Edn::String& GetName(void) { return m_className; };
messageCat_te GetCat(void) { return m_cat; };
protected :
void SendMessage(messageType_te id, int32_t dataID = -1);
};
typedef struct {
int32_t localMessageID;
messageCat_te msgCatDest;
messageType_te msgId;
int32_t data;
}messageElement_ts;
// need to create a syngleton ...
class MsgBroadcastCore: public Singleton<MsgBroadcastCore>
{
friend class Singleton<MsgBroadcastCore>;
// specific for sigleton system...
private:
// Constructeur
MsgBroadcastCore(void);
~MsgBroadcastCore(void);
public:
void SendMessage(MsgBroadcast * pointerOnSender, messageType_te id, int32_t dataID = -1);
void AddReceiver(MsgBroadcast * pointerOnReceiver);
void RmReceiver(MsgBroadcast * pointerOnReceiver);
private:
Edn::VectorType<MsgBroadcast*> m_listMessage;
uint32_t m_messageID;
Edn::VectorType<messageElement_ts> m_listOfMessage;
};
void GeneralSendMessage(messageType_te id, int32_t dataID = -1);
#endif

View File

@ -1,36 +0,0 @@
/**
*******************************************************************************
* @file Edn.h
* @brief Editeur De N'ours : Basic namespace for Edn (header)
* @author Edouard DUPIN
* @date 16/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 "tools_debug.h"
#include "toolsMemory.h"
//#include "Vector.h" // TODO : Set the vector of edn enable
#include "VectorType.h"
#include "String.h"
#include "File.h"

View File

@ -1,246 +0,0 @@
/**
*******************************************************************************
* @file File.cpp
* @brief Editeur De N'ours : File folder and name abstraction (Sources)
* @author Edouard DUPIN
* @date 16/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 "tools_debug.h"
#include "tools_globals.h"
#include "Edn.h"
#undef __class__
#define __class__ "Edn::File"
std::ostream& Edn::operator <<(std::ostream &os, const Edn::File &obj)
{
os << obj.m_folder;
os << "/";
os << obj.m_shortFilename;
return os;
}
Edn::File::File(Edn::String &filename, int32_t LineNumber)
{
m_lineNumberOpen = LineNumber;
SetCompleateName(filename);
}
Edn::File::File(const char *filename, int32_t LineNumber)
{
Edn::String tmpString = filename;
m_lineNumberOpen = LineNumber;
SetCompleateName(tmpString);
}
Edn::File::File(Edn::String &filename, Edn::String &folder, int32_t lineNumber)
{
Edn::String tmpString = folder;
tmpString += '/';
tmpString += filename;
SetCompleateName(tmpString);
m_lineNumberOpen = lineNumber;
}
Edn::File::~File(void)
{
// nothing to do ...
}
Edn::String Edn::File::GetFolder(void) const
{
return m_folder;
}
Edn::String Edn::File::GetShortFilename(void) const
{
return m_shortFilename;
}
Edn::String Edn::File::GetCompleateName(void) const
{
Edn::String out;
out = m_folder;
out += '/';
out += m_shortFilename;
return out;
}
const Edn::File& Edn::File::operator= (const Edn::File &ednF )
{
if( this != &ednF ) // avoid copy to itself
{
m_folder = ednF.m_folder;
m_shortFilename = ednF.m_shortFilename;
m_lineNumberOpen = ednF.m_lineNumberOpen;
}
return *this;
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
bool Edn::File::operator== (const Edn::File &ednF) const
{
if( this != &ednF ) {
if (ednF.GetCompleateName() == GetCompleateName() ) {
return true;
} else {
return false;
}
return true;
}
return true;
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
bool Edn::File::operator!= (const Edn::File &ednF) const
{
return !(*this == ednF);
}
void Edn::File::SetCompleateName(Edn::String &newFilename)
{
char buf[MAX_FILE_NAME];
memset(buf, 0, MAX_FILE_NAME);
char * ok;
// Reset ALL DATA :
m_folder = "";
m_shortFilename = "";
m_lineNumberOpen = 0;
EDN_DEBUG("1 :Set Name : " << newFilename );
Edn::String destFilename;
if (newFilename.Size() == 0) {
destFilename = "no-name";
} else {
destFilename = newFilename;
}
EDN_DEBUG("2 : Get file Name : " << destFilename );
if ('/' != *destFilename.c_str()) {
// Get the command came from the running of the program :
char cCurrentPath[FILENAME_MAX];
if (!getcwd(cCurrentPath, FILENAME_MAX)) {
return;
}
cCurrentPath[FILENAME_MAX - 1] = '\0';
Edn::String tmpFilename = destFilename;
destFilename = cCurrentPath;
destFilename += '/';
destFilename += tmpFilename;
}
EDN_DEBUG("3 : Get file Name : " << destFilename );
// Get the real Path of the current File
ok = realpath(destFilename.c_str(), buf);
if (!ok) {
int32_t lastPos = destFilename.FindBack('/');
if (-1 != lastPos) {
// Get the FileName
Edn::String tmpFilename = destFilename.Extract(lastPos+1);
destFilename.Remove(lastPos, destFilename.Size() - lastPos);
EDN_DEBUG("try to find :\"" << destFilename << "\" / \"" << tmpFilename << "\" ");
ok = realpath(destFilename.c_str(), buf);
if (!ok) {
EDN_ERROR("Can not find real Path name of \"" << destFilename << "\"");
m_shortFilename = tmpFilename;
m_folder = destFilename;
} else {
// ALL is OK ...
m_shortFilename = tmpFilename;
m_folder = destFilename;
}
} else {
EDN_WARNING("file : \"" << destFilename << "\" ==> No data???");
// Basic ERROR ...
m_shortFilename = destFilename;
}
} else {
destFilename = buf;
int32_t lastPos = destFilename.FindBack('/');
if (-1 != lastPos) {
m_shortFilename = destFilename.Extract(lastPos+1);
m_folder = destFilename.Extract(0, lastPos);
} else {
// Basic ERROR ...
EDN_WARNING("file : \"" << destFilename << "\" ==> No data???");
m_shortFilename = destFilename;
}
}
EDN_DEBUG("Set FileName :\"" << m_folder << "\" / \"" << m_shortFilename << "\" ");
}
int32_t Edn::File::GetLineNumber(void)
{
return m_lineNumberOpen;
}
void Edn::File::SetLineNumber(int32_t newline)
{
m_lineNumberOpen = newline;
}
bool Edn::File::HasExtention(void)
{
int32_t lastPos = m_shortFilename.FindBack('.');
if( -1 != lastPos // not find the .
&& 0 != lastPos // Find a . at the fist position .jdlskjdfklj ==> hiden file
&& m_shortFilename.Size() != lastPos ) // Remove file ended with .
{
return true;
} else {
return false;
}
}
Edn::String Edn::File::GetExtention(void)
{
Edn::String tmpExt = "";
int32_t lastPos = m_shortFilename.FindBack('.');
if( -1 != lastPos // not find the .
&& 0 != lastPos // Find a . at the fist position .jdlskjdfklj ==> hiden file
&& m_shortFilename.Size() != lastPos ) // Remove file ended with .
{
// Get the FileName
tmpExt = m_shortFilename.Extract(lastPos+1);
}
return tmpExt;
}

View File

@ -1,66 +0,0 @@
/**
*******************************************************************************
* @file File.h
* @brief Editeur De N'ours : File folder and name abstraction (header)
* @author Edouard DUPIN
* @date 16/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 __EDN__FILE_H__
#define __EDN__FILE_H__
#define MAX_FILE_NAME (10240)
namespace Edn
{
class File
{
public:
File(void) { m_lineNumberOpen=0; }
File(Edn::String &filename, int32_t LineNumber = 0);
File(const char *filename, int32_t LineNumber = 0);
File(Edn::String &filename, Edn::String &folder, int32_t lineNumber = 0);
~File(void);
Edn::String GetFolder(void) const;
Edn::String GetShortFilename(void) const;
Edn::String GetCompleateName(void) const;
bool HasExtention(void);
Edn::String GetExtention(void);
int32_t GetLineNumber(void);
void SetLineNumber(int32_t newline);
void SetCompleateName(Edn::String &newFilename);
const Edn::File& operator= (const Edn::File &ednF );
bool operator== (const Edn::File &ednF ) const;
bool operator!= (const Edn::File &ednF ) const;
friend std::ostream& operator <<( std::ostream &os,const Edn::File &obj);
private :
Edn::String m_folder;
Edn::String m_shortFilename;
int32_t m_lineNumberOpen;
};
std::ostream& operator <<(std::ostream &os, const Edn::File &obj);
}
#endif

View File

@ -1,488 +0,0 @@
/**
*******************************************************************************
* @file RegExp.cpp
* @brief Editeur De N'ours : Regular expression annalyser (sources)
* @author Edouard DUPIN
* @date 04/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 "tools_debug.h"
#include "tools_globals.h"
#include "toolsMemory.h"
#include "RegExp.h"
const convertionTable_ts constConvertionTable[] = {
// haveBackSlash, inputValue, newValue
{ false , '(' , OPCODE_PTHESE_IN},
{ true , '(' , (int16_t)'('},
{ false , ')' , OPCODE_PTHESE_OUT},
{ true , ')' , (int16_t)')'},
{ false , '[' , OPCODE_BRACKET_IN},
{ true , '[' , (int16_t)'['},
{ false , ']' , OPCODE_BRACKET_OUT},
{ true , ']' , (int16_t)']'},
{ false , '{' , OPCODE_BRACE_IN},
{ true , '{' , (int16_t)'{'},
{ false , '}' , OPCODE_BRACE_OUT},
{ true , '}' , (int16_t)'}'},
{ false , '-' , OPCODE_TO},
{ true , '-' , (int16_t)'-'},
{ false , '*' , OPCODE_STAR},
{ true , '*' , (int16_t)'*'},
{ false , '.' , OPCODE_DOT},
{ true , '.' , (int16_t)'.'},
{ false , '?' , OPCODE_QUESTION},
{ true , '?' , (int16_t)'?'},
{ false , '+' , OPCODE_PLUS},
{ true , '+' , (int16_t)'+'},
{ false , '|' , OPCODE_PIPE},
{ true , '|' , (int16_t)'|'},
{ false , '^' , OPCODE_START_OF_LINE},
{ true , '^' , (int16_t)'^'},
{ false , '$' , OPCODE_END_OF_LINE},
{ true , '$' , (int16_t)'$'},
{ true , 'd' , OPCODE_DIGIT},
{ true , 'D' , OPCODE_DIGIT_NOT},
{ true , 'l' , OPCODE_LETTER},
{ true , 'L' , OPCODE_LETTER_NOT},
{ true , 's' , OPCODE_SPACE},
{ true , 'S' , OPCODE_SPACE_NOT},
{ true , 'w' , OPCODE_WORD},
{ true , 'W' , OPCODE_WORD_NOT},
{ true , 'a' , (int16_t)'\a'},
{ true , 'b' , (int16_t)'\b'},
{ true , 'e' , 0x001B}, // Escape character <Esc>
{ true , 'f' , (int16_t)'\f'},
{ true , 'n' , (int16_t)'\n'},
{ true , 'r' , (int16_t)'\r'},
{ true , 't' , (int16_t)'\t'},
{ true , 'v' , (int16_t)'\v'},
{ true , '\\' , (int16_t)'\\'},
{ true , '&' , (int16_t)'&'},
{ true , '0' , (int16_t)'\0'},
{ true , '@' , OPCODE_NO_CHAR},
};
const int32_t constConvertionTableSize = sizeof(constConvertionTable) / sizeof(convertionTable_ts) ;
/**
* @brief Display the internal data of a node
*
* @param[in] data element do display in the console
*
* @return ---
*
*/
void DisplayData(Edn::VectorType<char> &data)
{
int32_t i;
for (i=0; i<(int32_t)data.Size() ; i++) {
std::cout<< (char)(data[i]&0x00FF );
}
}
/**
* @brief Display of a part of the Regexp element
*
* @param[in] data Vector where data is constain
* @param[in] start Position where the display might start
* @param[in] stop Position where the display might stop
*
* @return ---
*
*/
void DisplayElem(Edn::VectorType<int16_t> &data, int32_t start, int32_t stop)
{
int32_t i;
std::cout<< COLOR_NORMAL;
for (i=start; i<(int32_t)data.Size() && i<stop ; i++) {
switch(data[i])
{
case OPCODE_PTHESE_IN: std::cout<<COLOR_RED << (char*)"(" << COLOR_NORMAL; break;
case OPCODE_PTHESE_OUT: std::cout<<COLOR_RED << (char*)")" << COLOR_NORMAL; break;
case OPCODE_BRACKET_IN: std::cout<<COLOR_YELLOW << (char*)"[" << COLOR_NORMAL; break;
case OPCODE_BRACKET_OUT: std::cout<<COLOR_YELLOW << (char*)"]" << COLOR_NORMAL; break;
case OPCODE_TO: std::cout<<COLOR_YELLOW << (char*)"-" << COLOR_NORMAL; break;
case OPCODE_BRACE_IN: std::cout<<COLOR_GREEN << (char*)"{" << COLOR_NORMAL; break;
case OPCODE_BRACE_OUT: std::cout<<COLOR_GREEN << (char*)"}" << COLOR_NORMAL; break;
case OPCODE_STAR: std::cout<<COLOR_BLUE << (char*)"*" << COLOR_NORMAL; break;
case OPCODE_DOT: std::cout<<COLOR_BLUE << (char*)"." << COLOR_NORMAL; break;
case OPCODE_QUESTION: std::cout<<COLOR_BLUE << (char*)"?" << COLOR_NORMAL; break;
case OPCODE_PLUS: std::cout<<COLOR_BLUE << (char*)"+" << COLOR_NORMAL; break;
case OPCODE_PIPE: std::cout<<COLOR_BLUE << (char*)"|" << COLOR_NORMAL; break;
case OPCODE_NO_CHAR: std::cout<<COLOR_MAGENTA << (char*)"@" << COLOR_NORMAL; break;
case OPCODE_START_OF_LINE: std::cout<<COLOR_MAGENTA << (char*)"^" << COLOR_NORMAL; break;
case OPCODE_END_OF_LINE: std::cout<<COLOR_MAGENTA << (char*)"$" << COLOR_NORMAL; break;
case OPCODE_DIGIT: std::cout<<COLOR_MAGENTA << (char*)"\\d" << COLOR_NORMAL; break;
case OPCODE_DIGIT_NOT: std::cout<<COLOR_MAGENTA << (char*)"\\D" << COLOR_NORMAL; break;
case OPCODE_LETTER: std::cout<<COLOR_MAGENTA << (char*)"\\l" << COLOR_NORMAL; break;
case OPCODE_LETTER_NOT: std::cout<<COLOR_MAGENTA << (char*)"\\L" << COLOR_NORMAL; break;
case OPCODE_SPACE: std::cout<<COLOR_MAGENTA << (char*)"\\s" << COLOR_NORMAL; break;
case OPCODE_SPACE_NOT: std::cout<<COLOR_MAGENTA << (char*)"\\S" << COLOR_NORMAL; break;
case OPCODE_WORD: std::cout<<COLOR_MAGENTA << (char*)"\\w" << COLOR_NORMAL; break;
case OPCODE_WORD_NOT: std::cout<<COLOR_MAGENTA << (char*)"\\W" << COLOR_NORMAL; break;
case '\n': std::cout<<COLOR_MAGENTA << (char*)"\\n" << COLOR_NORMAL; break;
case '\t': std::cout<<COLOR_MAGENTA << (char*)"\\t" << COLOR_NORMAL; break;
default: std::cout<< (char)(data[i]&0x00FF ); break;
}
}
}
char * levelSpace(int32_t level)
{
switch(level)
{
case 0: return (char*)"";
case 1: return (char*)" ";
case 2: return (char*)" ";
case 3: return (char*)" ";
case 4: return (char*)" ";
case 5: return (char*)" ";
case 6: return (char*)" ";
case 7: return (char*)" ";
case 8: return (char*)" ";
case 9: return (char*)" ";
case 10: return (char*)" ";
case 11: return (char*)" ";
case 12: return (char*)" ";
case 13: return (char*)" ";
case 14: return (char*)" ";
case 15: return (char*)" ";
case 16: return (char*)" ";
default: return (char*)" ";
}
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
int32_t GetLenOfPTheseElem(Edn::VectorType<int16_t> &data, int32_t startPos)
{
int32_t pos = startPos;
int32_t nbOpen = 0;
// special case of the (...) or | ==> we search '|' or ')'
if( OPCODE_PTHESE_OUT == data[pos]
|| OPCODE_PIPE == data[pos]) {
return 0;
}
// find size ...
while (pos < (int32_t)data.Size() ) {
if(OPCODE_PTHESE_IN == data[pos]) {
// find a sub section :
nbOpen++;
} else if(0 < nbOpen) {
if (OPCODE_PTHESE_OUT == data[pos])
{
nbOpen--;
if (0 > nbOpen) {
EDN_ERROR("Error in the (...) find element at "<< pos);
return -1;
}
}
} else if( OPCODE_PTHESE_OUT == data[pos]
|| OPCODE_PIPE == data[pos])
{
// Find the end of the (...)
// just return the size inside
int32_t sizeInside = pos - startPos;
if (0 >= sizeInside) {
EDN_ERROR("Error in the (...) no data at "<< pos-1);
return -1;
} else {
return sizeInside;
}
}
pos++;
}
return pos - startPos;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
int32_t GetLenOfPThese(Edn::VectorType<int16_t> &data, int32_t startPos)
{
int32_t pos = startPos;
int32_t nbOpen = 0;
// special case of the (...) or | ==> we search '|' or ')'
if( OPCODE_PTHESE_OUT == data[pos]) {
return 0;
} else if( OPCODE_PTHESE_IN == data[pos])
{
pos++;
// find size ...
while (pos < (int32_t)data.Size() ) {
if(OPCODE_PTHESE_IN == data[pos]) {
// find a sub section :
nbOpen++;
} else if(0 < nbOpen) {
if (OPCODE_PTHESE_OUT == data[pos])
{
nbOpen--;
if (0 > nbOpen) {
EDN_ERROR("Error in the (...) find element at "<< pos);
return -1;
}
}
} else if( OPCODE_PTHESE_OUT == data[pos])
{
// Find the end of the (...)
// just return the size inside
int32_t sizeInside = pos - startPos-1;
if (0 >= sizeInside) {
EDN_ERROR("Error in the (...) no data at "<< pos-1);
return -1;
} else {
return sizeInside;
}
}
pos++;
}
} else {
return -1;
}
return 0;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
int32_t GetLenOfBracket(Edn::VectorType<int16_t> &data, int32_t startPos)
{
int32_t pos = startPos;
// special case of the (...) or | ==> we search '|' or ')'
if( OPCODE_BRACKET_OUT == data[pos]) {
return 0;
} else if( OPCODE_BRACKET_IN == data[pos]) {
pos++;
// find size ...
while (pos < (int32_t)data.Size() ) {
if(OPCODE_BRACKET_OUT == data[pos]) {
// Find the end of the [...]
// just return the size inside
int32_t sizeInside = pos - startPos -1 ;
if (0 >= sizeInside) {
EDN_ERROR("Error in the [...] no data at "<< pos-1);
return sizeInside;
} else {
return sizeInside;
}
} else if( OPCODE_TO != data[pos]
&& ( 0 > data[pos]
|| 0xFF < data[pos]) )
{
EDN_ERROR("Error in the [...] not permited element at "<< pos << " '" << (char)data[pos] << "'");
return false;
}
pos++;
}
} else {
return -1;
}
return 0;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
int32_t GetLenOfBrace(Edn::VectorType<int16_t> &data, int32_t startPos)
{
int32_t pos = startPos;
// special case of the (...) or | ==> we search '|' or ')'
if( OPCODE_BRACE_OUT == data[pos]) {
return 0;
} else if( OPCODE_BRACE_IN == data[pos]) {
pos++;
// find size ...
while (pos < (int32_t)data.Size() ) {
if(OPCODE_BRACE_OUT == data[pos]) {
// Find the end of the [...]
// just return the size inside
int32_t sizeInside = pos - startPos -1 ;
if (0 >= sizeInside) {
EDN_ERROR("Error in the {...} no data at "<< pos-1);
return sizeInside;
} else {
return sizeInside;
}
} else if( ',' != data[pos]
&& ( '0' > data[pos]
|| '9' < data[pos]) )
{
EDN_ERROR("Error in the {...} not permited element at "<< pos << " '" << (char)data[pos] << "'");
return false;
}
pos++;
}
} else {
return -1;
}
return 0;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
int32_t GetLenOfNormal(Edn::VectorType<int16_t> &data, int32_t startPos)
{
int32_t pos = startPos;
// find size ...
while (pos < (int32_t)data.Size() ) {
switch(data[pos])
{
case OPCODE_PTHESE_IN:
case OPCODE_PTHESE_OUT:
case OPCODE_BRACKET_IN:
case OPCODE_BRACKET_OUT:
case OPCODE_BRACE_IN:
case OPCODE_BRACE_OUT:
case OPCODE_TO:
case OPCODE_STAR:
case OPCODE_DOT:
case OPCODE_QUESTION:
case OPCODE_PLUS:
case OPCODE_PIPE:
case OPCODE_START_OF_LINE:
case OPCODE_END_OF_LINE:
case OPCODE_DIGIT:
case OPCODE_DIGIT_NOT:
case OPCODE_LETTER:
case OPCODE_LETTER_NOT:
case OPCODE_SPACE:
case OPCODE_SPACE_NOT:
case OPCODE_WORD:
case OPCODE_WORD_NOT:
{
// just return the size inside
int32_t sizeInside = pos - startPos;
if (0 >= sizeInside) {
EDN_ERROR("Error in the normal data : no data ...");
}
return sizeInside;
}
break;
default :
// nothing to do ...
break;
}
pos++;
}
return pos - startPos ;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
bool ParseBrace(Edn::VectorType<int16_t> &data, int32_t &min, int32_t &max)
{
//EDN_INFO("parse {...} in "; DisplayElem(data); );
int32_t k=0;
int32_t firstElement = 0;
int32_t SecondElement = 0;
while(k<data.Size()) {
if (',' == (char)data[k]) {
k++;
break;
} if ('}' == (char)data[k]) {
SecondElement = firstElement;
goto allIsSet;
} else if ('0' <= (char)data[k] && '9' >= (char)data[k]) {
firstElement *=10;
firstElement += (char)data[k] - '0';
} else {
EDN_ERROR("Can not parse this element " << (char)data[k] << " at pos " << k);
return false;
}
k++;
}
if (k==data.Size()) {
SecondElement = firstElement;
}
while(k<data.Size()) {
if (',' == (char)data[k]) {
EDN_ERROR("Can not find a second , in {} at pos " << k);
return false;
} if ('}' == (char)data[k]) {
goto allIsSet;
} else if ('0' <= (char)data[k] && '9' >= (char)data[k]) {
SecondElement *=10;
SecondElement += (char)data[k] - '0';
} else {
EDN_ERROR("Can not parse this element " << (char)data[k] << " at pos " << k);
return false;
}
k++;
}
allIsSet:
if (SecondElement == 0 && firstElement != 0) {
min = 0;
max = firstElement;
} else {
min = firstElement;
max = SecondElement;
}
if (min > max) {
EDN_ERROR("Minimum=" << min << " can not be < maximum=" << max );
return false;
}
return true;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,718 +0,0 @@
/**
*******************************************************************************
* @file EdnString.cpp
* @brief Editeur De N'ours : normal sting management... (sources)
* @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 "Edn.h"
#include "toolsMemory.h"
#undef __class__
#define __class__ "Edn::String"
std::ostream& Edn::operator <<(std::ostream &os, const Edn::String &obj)
{
os << (char*)&obj.m_data[0];
return os;
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
Edn::String::~String(void)
{
m_data.Clear();
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
Edn::String::String(void)
{
//EDN_INFO("new Edn::String()");
m_data.Clear();
m_data.PushBack('\0');
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
Edn::String::String(const char myInput)
{
m_data.Clear();
m_data.PushBack(myInput);
m_data.PushBack('\0');
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
Edn::String::String(const char* inputData, int32_t len)
{
m_data.Clear();
m_data.PushBack('\0');
Set(inputData, len);
}
void Edn::String::Set(const char * inputData, int32_t len)
{
// overwrite the len if needed :
if ((-1) == len) {
len = strlen(inputData);
}
if (len != 0) {
// remove the last '\0'
m_data.PopBack();
// copy the data ...
m_data.PushBack((int8_t*)inputData, len);
// add the last '\0'
m_data.PushBack('\0');
}
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
Edn::String::String(int inputData)
{
char tmpVal[256];
// generate the string :
sprintf(tmpVal, "%d", inputData);
// set the internal data :
m_data.Clear();
m_data.PushBack('\0');
Set(tmpVal);
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
Edn::String::String(unsigned int inputData)
{
char tmpVal[256];
// generate the string :
sprintf(tmpVal, "%d", inputData);
// set the internal data :
m_data.Clear();
m_data.PushBack('\0');
Set(tmpVal);
}
Edn::String::String(const Edn::String &ednS)
{
//EDN_INFO("Constructeur de recopie");
m_data = ednS.m_data;
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
const Edn::String& Edn::String::operator= (const Edn::String &ednS )
{
//EDN_INFO("OPERATOR de recopie");
if( this != &ednS ) // avoid copy to itself
{
m_data = ednS.m_data;
}
return *this;
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
const Edn::String& Edn::String::operator= (const char * inputData)
{
m_data.Clear();
m_data.PushBack('\0');
// calculate the size :
uint32_t len = strlen(inputData);
// check the new size ...
if (len > 0 ) {
// copy all data :
Set(inputData, len);
}
return *this;
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
const Edn::String& Edn::String::operator= (Edn::VectorType<int8_t> inputData)
{
m_data = inputData;
if (m_data.Size()>0) {
if (m_data[m_data.Size()-1] != '\0') {
m_data.PushBack('\0');
}
}
//EDN_DEBUG("m_dataLen="<<m_dataLen << " m_dataLenUTF8="<<m_dataLenUTF8 << " description=" << m_data);
return *this;
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
bool Edn::String::operator== (const Edn::String& ednS) const
{
if( this != &ednS ) {
if (ednS.m_data.Size() != m_data.Size()) {
//EDN_DEBUG(" not the same size : " << ednS.m_data.Size() << "!=" << m_data.Size());
return false;
}
for (int32_t iii= 0; iii<m_data.Size(); iii++) {
//EDN_DEBUG(" check : " << ednS.m_data[iii] << "!=" << m_data[iii]);
if (ednS.m_data[iii]!= m_data[iii]){
return false;
}
}
return true;
}
return true;
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
bool Edn::String::operator== (const char * inputData) const
{
// calculate the size :
int32_t len = strlen(inputData);
if (len+1 != m_data.Size()) {
return false;
}
for (int32_t iii= 0; iii<m_data.Size(); iii++) {
if (inputData[iii]!= m_data[iii]){
return false;
}
}
return true;
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
bool Edn::String::operator!= (const Edn::String& ednS) const
{
return !(*this == ednS);
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
bool Edn::String::operator!= (const char * inputData) const
{
return !(*this == inputData);
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
const Edn::String& Edn::String::operator+= (const Edn::String &ednS)
{
if (0 < ednS.Size()) {
// remove the last '\0'
m_data.PopBack();
// copy the data ...
m_data += ednS.m_data;
// This previous include the \0 in case of the 2 string are different...
if( this == &ednS ) {
// add the removed end string
m_data.PushBack('\0');
}
}
return *this;
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
const Edn::String& Edn::String::operator+= (const char * inputData)
{
//EDN_INFO(" string(arg) : \"" << inputData << "\"");
//EDN_INFO(" string(direct) : \"" << m_data << "\"");
int32_t len = strlen(inputData);
if (len != 0) {
// remove the last '\0'
m_data.PopBack();
// copy the data ...
m_data.PushBack((int8_t*)inputData, len+1 );
}
return *this;
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
Edn::String Edn::String::operator+ (const Edn::String &ednS)
{
Edn::String temp;
//EDN_INFO(" string(arg) : \"" << ednS.m_data << "\"");
//EDN_INFO(" string(direct) : \"" << m_data << "\"");
temp += *this;
temp += ednS;
return temp;
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
Edn::String Edn::String::operator+ (const char * inputData)
{
Edn::String temp;
//EDN_INFO(" string(arg) : \"" << inputData << "\"");
//EDN_INFO(" string(direct) : \"" << m_data << "\"");
temp += *this;
temp += inputData;
return temp;
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
bool Edn::String::IsEmpty(void) const
{
if(1 >= m_data.Size() ) {
return true;
} else {
return false;
}
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
int32_t Edn::String::Size(void) const
{
if (m_data.Size() == 0) {
return 0;
} else {
return m_data.Size() - 1;
}
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
void Edn::String::Add(int32_t currentID, const char* inputData)
{
// get the input lenght
int32_t len = strlen(inputData);
if (0 == len) {
EDN_WARNING("no data to add on the current string");
return;
} else if (currentID < 0) {
EDN_WARNING("Curent ID(" << currentID << ") < 0 ==> Add at the start");
currentID = 0;
} else if (currentID > Size() ) {
EDN_ERROR("Curent ID(" << currentID << ") > maxSize ... (" << Size() << ") ==> add at the end ...");
m_data.PushBack((int8_t*)inputData, len);
return;
}
m_data.Insert(currentID, (int8_t*)inputData, len);
}
/**
* @brief
*
* @param[in,out]
*
* @return
*
*/
void Edn::String::Remove(int32_t currentID, int32_t len)
{
if (0 >= len) {
EDN_ERROR("no data to remove on the current string");
return;
}
// TODO : check the size of the data
m_data.EraseLen(currentID, len);
}
/**
* @brief Remove all element in the string
*
* @param ---
*
* @return ---
*
*/
void Edn::String::Clear(void)
{
m_data.Clear();
m_data.PushBack('\0');
}
/**
* @brief find the first accurence after the position indicated
*
* @param[in] element Element that might be find in the string
* @param[in] startPos Stert position to begin the search
*
* @return the position of the first occurence or -1 if not find...
*
*/
int32_t Edn::String::FindForward(const char element, int32_t startPos)
{
if (startPos < 0) {
startPos = 0;
} else if (startPos >= Size() ) {
return -1;
}
for (int32_t iii=startPos; iii< Size(); iii++) {
if (m_data[iii] == element) {
return iii;
}
}
return -1;
}
/**
* @brief find the first accurence before the position indicated.
*
* @param[in] element Element that might be find in the string
* @param[in] startPos Stert position to begin the search
*
* @return the position of the first occurence begining by the end or -1 if not find...
*
*/
int32_t Edn::String::FindBack(const char element, int32_t startPos)
{
if (startPos < 0) {
return -1;
} else if (startPos >= Size() ) {
startPos = Size();
}
for (int32_t iii=startPos; iii>=0; iii--) {
if (m_data[iii] == element) {
return iii;
}
}
return -1;
}
/**
* @brief Extract data from the data between two position
*
* @param[in] posStart Start position where to extract data
* @param[in] posEnd End position where to extract data
*
* @return the extracted string
*
*/
Edn::String Edn::String::Extract(int32_t posStart, int32_t posEnd)
{
Edn::String out;
if (posStart < 0) {
posStart = 0;
} else if (posStart >= Size() ) {
return out;
}
if (posEnd < 0) {
return out;
} else if (posEnd >= Size() ) {
posEnd = Size();
}
out.m_data = m_data.Extract(posStart, posEnd);
out.m_data.PushBack('\0');
return out;
}
/**
* @brief Get a basic vector in int8 data with no \0 at the end of the string
*
* @param ---
*
* @return The desired vector with data
*
*/
Edn::VectorType<int8_t> Edn::String::GetVector(void)
{
Edn::VectorType<int8_t> out = m_data;
out.PopBack();
return out;
}
/**
* @brief Unitary test for the string system
*
* @param ---
*
* @return ---
*
*/
void Edn::TestUntaire_String(void)
{
EDN_WARNING("*********************************************************");
EDN_WARNING("** Test Unitaire 'EdnString' (START)");
EDN_WARNING("*********************************************************");
int32_t iddd = 0;
Edn::String * monString = new Edn::String();
EDN_INFO("phase : " << iddd++ << " : \"" << monString << "\"");
delete(monString);
monString = new Edn::String("test de direct data");
EDN_INFO("phase : " << iddd++ << " : \"" << monString << "\"");
delete(monString);
monString = new Edn::String("test de direct data", 7);
EDN_INFO("phase : " << iddd++ << " : \"" << monString << "\"");
delete(monString);
int32_t testId = -6789;
monString = new Edn::String(testId);
EDN_INFO("phase : " << iddd++ << " : \"" << monString << "\"");
delete(monString);
uint32_t testId2 = 12345;
monString = new Edn::String((unsigned int)testId2);
EDN_INFO("phase : " << iddd++ << " : \"" << monString << "\"");
delete(monString);
Edn::String plop = "otherString";
monString = new Edn::String(plop);
EDN_INFO("phase : " << iddd++ << " : \"" << monString << "\"");
delete(monString);
Edn::String s1 = "test de base ...";
s1 += s1;
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
s1 += " plop 2 ";
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
s1 += plop;
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
s1 = plop;
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
s1 = "test direct 44";
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
Edn::VectorType<int8_t> vb1;
vb1.PushBack('v');
vb1.PushBack('b');
vb1.PushBack('1');
s1 = vb1;
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
vb1.Clear();
vb1.PushBack('v');
vb1.PushBack('b');
vb1.PushBack('2');
vb1.PushBack('\0');
s1 = vb1;
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
if (s1 == "vb2") {
EDN_INFO("phase : " << iddd++ << " : == OK");
} else {
EDN_ERROR("phase : " << iddd++ << " : == ERROR");
}
if (s1 == "vb3") {
EDN_ERROR("phase : " << iddd++ << " : == ERROR");
} else {
EDN_INFO("phase : " << iddd++ << " : == OK");
}
if (s1 != "vb3") {
EDN_INFO("phase : " << iddd++ << " : == OK");
} else {
EDN_ERROR("phase : " << iddd++ << " : == ERROR");
}
if (s1 != "vb2") {
EDN_ERROR("phase : " << iddd++ << " : == ERROR");
} else {
EDN_INFO("phase : " << iddd++ << " : == OK");
}
Edn::String s2 = "vb2";
Edn::String s3 = "vb3";
if (s1 == s2) {
EDN_INFO("phase : " << iddd++ << " : == OK");
} else {
EDN_ERROR("phase : " << iddd++ << " : == ERROR");
}
if (s1 == s3) {
EDN_ERROR("phase : " << iddd++ << " : == ERROR");
} else {
EDN_INFO("phase : " << iddd++ << " : == OK");
}
if (s1 != s3) {
EDN_INFO("phase : " << iddd++ << " : == OK");
} else {
EDN_ERROR("phase : " << iddd++ << " : == ERROR");
}
if (s1 != s2) {
EDN_ERROR("phase : " << iddd++ << " : == ERROR");
} else {
EDN_INFO("phase : " << iddd++ << " : == OK");
}
EDN_WARNING("*********************************************************");
EDN_WARNING("** Test Unitaire 'EdnString' (STOP)");
EDN_WARNING("*********************************************************");
}

View File

@ -1,92 +0,0 @@
/**
*******************************************************************************
* @file EdnString.h
* @brief Editeur De N'ours : normal sting management... (header)
* @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.
*
*******************************************************************************
*/
#ifndef __END__STRING_H__
#define __END__STRING_H__
#include <iostream>
namespace Edn
{
class String
{
public:
// Constructeurs
String(void);
String(const char myInput);
String(const char* inputData, int32_t len = -1);//, bool noAllocation=false);
void Set(const char* inputData, int32_t len=-1);
// basic convertion integer en string
String(int inputData);
String(unsigned int inputData);
//String(const wchar_t *inputData);
String(const Edn::String &ednS);
// destructor :
~String(void);
const Edn::String& operator= (const Edn::String &ednS ); // assigment
const Edn::String& operator= (const char * inputData);
const Edn::String& operator= (Edn::VectorType<int8_t> inputData);
bool operator== (const Edn::String& ednS) const; // == operator
bool operator== (const char * inputData) const;
bool operator!= (const Edn::String& ednS) const; // != operator
bool operator!= (const char * inputData) const;
const Edn::String& operator+= (const Edn::String &ednS); // += operator
const Edn::String& operator+= (const char * inputData);
Edn::String operator+ (const Edn::String &ednS); // + operator
Edn::String operator+ (const char * inputData);
//operator const char *()
friend std::ostream& operator <<( std::ostream &os,const Edn::String &obj);
bool IsEmpty(void) const;
int32_t Size(void) const;
void Add(int32_t currentID, const char* inputData);
void Remove(int32_t currentID, int32_t len);
void Clear(void);
Edn::VectorType<int8_t> GetVector(void);
char * c_str(void) { return (char*)&m_data[0]; };
// Sting operation :
int32_t FindForward(const char element, int32_t startPos=0);
int32_t FindBack(const char element, int32_t startPos=0x7FFFFFFF);
Edn::String Extract(int32_t posStart=0, int32_t posEnd=0x7FFFFFFF);
private :
Edn::VectorType<int8_t> m_data;
};
void TestUntaire_String(void);
std::ostream& operator <<(std::ostream &os, const Edn::String &obj);
}
#endif

View File

@ -1,506 +0,0 @@
/**
*******************************************************************************
* @file Vector.h
* @brief Editeur De N'ours : Basic Edn::Vector (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_EdnVector_H__
#define __EDN_EdnVector_H__
#undef __class__
#define __class__ "Edn::Vector"
/**
* @brief EdnVector classes ...
*
* @tparam[in] T The type of objects to store.
* @tparam[in] INC Incrementation mode (0 : Exponential to 200 and increment by stemp of 200)
*
* @todo : Need to add : popBack / Assign / Insert / Erase / Swap / Clear
*
* m_data
* ---------- |-----------------------|
* | 0 |-------->| Class Data |
* |--------| |-----------------------|
* | 1 |----|
* |--------| |
* | 2 |====|==============| |-----------------------|
* |--------| | --->| Class Data |
* m_count | 3 |-| | |-----------------------|
* |--------| | |
* | x | | | |-----------------------|
* |--------| | -------->| Class Data |
* | x | | |-----------------------|
* |--------| |
* | x | |
* |--------| | |-----------------------|
* | x | --------------------->| Class Data |
* |--------| |-----------------------|
* | x |
* |--------|
* | x |
* |--------|
* m_size | x |
* ----------
*
*/
namespace Edn
{
template<class T, int32_t INC=0> class Vector
{
public:
class Iterator
{
// Private data :
private:
int32_t m_current; // curent Id on the vector
Edn::Vector<T> * m_Vector; // Pointer on the curent element of the vector
public:
/**
* @brief Basic itarator constructor with no link with an Vector
*/
Iterator():
m_current(-1),
m_Vector(NULL)
{
// nothing to do ...
}
/**
* @brief Recopy constructor on a specific Vector.
* @param[in] otherIterator The Iterator that might be copy
*/
Iterator(const Iterator & otherIterator):
m_current(otherIterator.m_current),
m_Vector(otherIterator.m_Vector)
{
// 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_Vector = otherIterator.m_Vector;
return *this;
}
/**
* @brief Basic destructor
*/
~Iterator()
{
m_current = -1;
m_Vector = NULL;
}
/**
* @brief basic boolean cast
* @return true if the element is present in the Vector size
*/
operator bool ()
{
if( 0 <= m_current
&& m_current < m_EdnVector->Size() )
{
return true;
} else {
return false;
}
}
/**
* @brief Incremental operator
* @return Reference on the current iterator incremented
*/
Iterator& operator++ ()
{
if( NULL != m_EdnVector
&& m_current < m_EdnVector->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
*
* @param[in,out] ---
*
* @return ---
*
*/
T * operator-> () const
{
EDN_CHECK_INOUT(m_current >= 0 && m_current < m_EdnVector->Size());
return &m_EdnVector->Get(m_current);
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
T & operator* () const
{
EDN_CHECK_INOUT(m_current >= 0 && m_current < m_EdnVector->Size());
return m_EdnVector->Get(m_current);
}
private:
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
Iterator(Edn::Vector<T> * myVector, int pos):
m_current(pos),
m_Vector(myVector)
{
// nothing to do ...
}
friend class Edn::Vector<T>;
};
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
Vector(int count = 0):
m_data(NULL),
m_count(0),
m_size(0)
{
Resize(count);
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
Vector(const Edn::Vector<T> & myVector):
m_size(myVector.m_size),
m_count(myVector.m_count),
m_data(NULL)
{
int32_t i;
EDN_MALLOC_CAST(m_data, m_size, T, reinterpret_cast<T*>);
for(i=0; i<m_count; i++) {
new (&m_data[i]) T(myVector[i]);
}
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
~Vector()
{
Destroy();
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
Vector& operator=(const Edn::Vector<T> & EdnVector)
{
int32_t i;
this->~EdnVector();
m_size = EdnVector.m_size;
m_count = EdnVector.m_count;
EDN_MALLOC_CAST(m_data, m_size, T, reinterpret_cast<T*>);
for(i=0; i<m_count; i++) {
new (&m_data[i]) T(EdnVector[i]);
}
return *this;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
int32_t Size()
{
return m_count;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
T& Get(int32_t pos)
{
return m_data[pos];
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
T& operator[] (int32_t pos)
{
return Get(pos);
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
const T& operator[] (int32_t pos) const
{
return m_data[pos];
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
int IndexOf(const T * item) const
{
int32_t res = item - m_data;
if( 0 > res
|| res >= Size())
{
return -1
} else {
return res;
}
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void PushBack(const T& item)
{
int32_t idx = Size();
Resize(idx+1);
Get(idx) = item;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
Iterator Get(int pos)
{
return Iterator(this, pos);
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
Iterator Begin()
{
return Get(0);
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
Iterator End()
{
return Get( Size()-1 );
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void Resize(int32_t count)
{
int32_t i;
// Reallocate memory
if (count > m_size) {
ChangeAllocation(count);
}
// Remove deprecated element
for(i=count; i<m_count; i++) {
m_data[i].~T();
}
// Create nex item
for(i=m_count;i<count;i++) {
new (&m_data[i]) T();
}
m_count = count;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void ChangeAllocation(int count)
{
if (count > m_size) {
// generate new size
while(count > m_size) {
if (INC) {
m_size = (m_size + INC)
} else if (m_size==0) {
m_size = 1;
} else {
m_size = m_size * 2;
}
}
// Allocate the curent element
T * data = NULL;
EDN_MALLOC_CAST(data, m_size, T, reinterpret_cast<T*>);
for(int i=0; i<m_count; i++) {
new (&data[i]) T(m_data[i]);
}
Destroy();
m_data = data;
}
}
private:
T * m_data; //!< pointer on the current Data
int32_t m_count; //!< number of element
int32_t m_size; //!< current allocated size
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void Destroy()
{
for(int i=0; i<m_count; i++) {
m_data[i].~T();
}
if (m_data) {
EDN_FREE(m_data);
}
}
};
}
#undef __class__
#define __class__ NULL
#endif

View File

@ -1,671 +0,0 @@
/**
*******************************************************************************
* @file VectorType.h
* @brief Editeur De N'ours : Basic VectorType 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_BIN_H__
#define __EDN_VECTOR_BIN_H__
#include "toolsMemory.h"
#undef __class__
#define __class__ "Edn::VectorType"
/**
* @brief VectorType classes ...
*
* @tparam[in] SIZE Size of the current element.
*
* m_data
* <------------ m_dataSize ------------>
* ----------------------------------------
* | 0 |
* |--------------------------------------|
* | 1 |
* |--------------------------------------|
* | 2 |
* |--------------------------------------|
* m_size | 3 |
* |--------------------------------------|
* | x |
* |--------------------------------------|
* | x |
* |--------------------------------------|
* | x |
* |--------------------------------------|
* | x |
* |--------------------------------------|
* | x |
* |--------------------------------------|
* | x |
* |--------------------------------------|
* m_allocated | x |
* ----------------------------------------
*
*/
namespace Edn
{
template<typename MY_TYPE=int32_t> class VectorType
{
public:
class Iterator
{
// Private data :
private:
int32_t m_current; //!< curent Id on the vector
VectorType<MY_TYPE> * m_VectorType; //!< Pointer on the curent element of the vectorBin
public:
/**
* @brief Basic itarator constructor with no link with an EdnVector
*/
Iterator():
m_current(-1),
m_VectorType(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_VectorType(otherIterator.m_VectorType)
{
// 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_VectorType = otherIterator.m_VectorType;
return *this;
}
/**
* @brief Basic destructor
*/
~Iterator()
{
m_current = -1;
m_VectorType = NULL;
}
/**
* @brief basic boolean cast
* @return true if the element is present in the EdnVector size
*/
operator bool ()
{
if( 0 <= m_current
&& m_current < m_VectorType->Size() )
{
return true;
} else {
return false;
}
}
/**
* @brief Incremental operator
* @return Reference on the current iterator incremented
*/
Iterator& operator++ ()
{
if( NULL != m_VectorType
&& m_current < m_VectorType->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
*/
MY_TYPE & operator-> () const
{
EDN_CHECK_INOUT(m_current >= 0 && m_current < m_VectorType->Size());
return &m_VectorType->Get(m_current);
}
/**
* @brief Get reference on the current Element
* @return the reference on the current Element
*/
MY_TYPE & operator* () const
{
EDN_CHECK_INOUT(m_current >= 0 && m_current < m_VectorType->Size());
return m_VectorType->Get(m_current);
}
private:
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
Iterator(VectorType<MY_TYPE> * Evb, int32_t pos):
m_current(pos),
m_VectorType(Evb)
{
// nothing to do ...
}
friend class VectorType;
};
private:
MY_TYPE * m_data; //!< pointer on the curetn table of Data
int32_t m_size; //!< nb Element in the buffer
int32_t m_allocated; //!< Current allocated size
int32_t m_increment; //!< methode of increment
public:
/**
* @brief Create an empty vector
* @param[in] count Minimum request size of the Buffer
*/
VectorType(int32_t count = 0):
m_data(NULL),
m_size(0),
m_allocated(0),
m_increment(1)
{
ChangeAllocation(count);
}
/**
* @brief Re-copy constructor (copy all needed data)
* @param[in] Evb Vector that might be copy
*/
VectorType(const Edn::VectorType<MY_TYPE> & Evb)
{
m_allocated = Evb.m_allocated;
m_size = Evb.m_size;
m_increment = Evb.m_increment;
m_data = NULL;
//EDN_DEBUG("USE Specific vector allocator ... Evb.m_size=" << Evb.m_size << " Evb.m_increment=" << Evb.m_increment);
// allocate all same data
EDN_MALLOC(m_data, m_allocated, MY_TYPE);
EDN_ASSERT(NULL!=m_data, "Error in data allocation");
// Copy all data ...
memcpy(m_data, Evb.m_data, m_allocated * sizeof(MY_TYPE) );
}
/**
* @brief Destructor of the current Class
*/
~VectorType()
{
if (NULL!=m_data) {
EDN_FREE(m_data);
m_data = NULL;
m_allocated = 0;
m_size = 0;
m_increment = 0;
}
}
/**
* @brief Re-copy operator
* @param[in] Evb Vector that might be copy
* @return reference on the curent re-copy vector
*/
VectorType& operator=(const Edn::VectorType<MY_TYPE> & Evb)
{
//EDN_DEBUG("USE RECOPY vector ... Evb.m_size=" << Evb.m_size << " Evb.m_increment=" << Evb.m_increment);
if( this != &Evb ) // avoid copy to itself
{
if (NULL!=m_data) {
EDN_FREE(m_data);
m_data = NULL;
}
// Set the new value
m_allocated = Evb.m_allocated;
m_size = Evb.m_size;
m_increment = Evb.m_increment;
// allocate all same data
EDN_MALLOC(m_data, m_allocated, MY_TYPE);
EDN_ASSERT(NULL!=m_data, "Error in data allocation");
// Copy all data ...
memcpy(m_data, Evb.m_data, m_allocated * sizeof(MY_TYPE) );
}
// Return the curent pointer
return *this;
}
/**
* @brief Add at the Last position of the Vector
* @param[in] item Element to add at the end of vector
*/
VectorType& operator+= (const Edn::VectorType<MY_TYPE> & Evb) // += operator
{
int32_t nbElememt = Evb.Size();
int32_t idx = m_size;
Resize(m_size+nbElememt);
memcpy(&m_data[idx], &Evb.m_data[0], nbElememt*sizeof(MY_TYPE) );
// Return the curent pointer
return *this;
}
/**
* @brief Set increment mode of this vector (default it match corectly with the number of element inside)
* @param[in] newIncrementNumber methode requested
*/
void SetIncrement(int32_t newIncrementNumber)
{
m_increment = newIncrementNumber;
}
/**
* @brief Get the number of element in the vector
* @return The number requested
*/
int32_t Size() const
{
return m_size;
}
/**
* @brief Get the Allocated size in the vector
* @return The size of allocation
*/
int32_t AllocatedSize() const
{
return m_allocated;
}
/**
* @brief Get a current element in the vector
* @param[in] pos Desired position read
* @return Reference on the Element
*/
MY_TYPE& Get(int32_t pos)
{
return m_data[pos];
}
/**
* @brief Get an copy Element an a special position
* @param[in] pos Position in the vector that might be get [0..Size()]
* @return An reference on the copy of selected element
*/
MY_TYPE& operator[] (int32_t pos)
{
return Get(pos);
}
/**
* @brief Get an Element an a special position
* @param[in] pos Position in the vector that might be get [0..Size()]
* @return An reference on the selected element
*/
const MY_TYPE& operator[] (int32_t pos) const
{
return m_data[pos];
}
/**
* @brief Add at the Last position of the Vector
* @param[in] item Element to add at the end of vector
*/
void PushBack(const MY_TYPE& item)
{
int32_t idx = m_size;
Resize(m_size+1);
m_data[idx] = item;
}
/**
* @brief Add at the Last position of the Vector
* @param[in] item Element to add at the end of vector
*/
void PushBack(const MY_TYPE * item, int32_t nbElement)
{
if (NULL == item) {
return;
}
int32_t idx = m_size;
Resize(m_size+nbElement);
memcpy(&m_data[idx], item, nbElement*sizeof(MY_TYPE) );
}
/**
* @brief Remove the last element of the vector
*/
void PopBack(void)
{
if(m_size>0) {
Resize(m_size-1);
}
}
/**
* @brief Remove all alement in the current vector
*/
void Clear(void)
{
if(m_size>0) {
Resize(0);
}
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void Insert(int32_t pos, const MY_TYPE& item)
{
if (pos>m_size) {
EDN_ERROR(" can not insert Element at this position : " << pos << " > " << m_size<< " add it at the end ... ");
PushBack(item);
return;
}
int32_t tmpSize = m_size;
// Request resize of the current buffer
Resize(m_size+1);
// move curent data
memmove((m_data + pos + 1), (m_data + pos), (tmpSize - pos)*sizeof(MY_TYPE) );
// affectation of the current element
m_data[pos] = item;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void Insert(int32_t pos, const MY_TYPE * item, int32_t nbElement)
{
if (pos>m_size) {
EDN_WARNING(" can not insert Element at this position : " << pos << " > " << m_size << " add it at the end ... ");
PushBack(item, nbElement);
return;
}
int32_t tmpSize = m_size;
// Request resize of the current buffer
Resize(m_size+nbElement);
// move curent data (after the position)
memmove((m_data + pos + nbElement), (m_data + pos), (tmpSize - pos)*sizeof(MY_TYPE) );
// affectation of all input element
memcpy(&m_data[pos], item, nbElement*sizeof(MY_TYPE) );
}
/**
* @brief Remove one element
*
* @param[in] pos Position to remove the data
*
* @return ---
*
*/
void Erase(int32_t pos)
{
if (pos>m_size) {
EDN_ERROR(" can not Erase Element at this position : " << pos << " > " << m_size);
return;
}
int32_t tmpSize = m_size;
// move curent data
memmove((m_data + pos), (m_data + pos + 1), (tmpSize - (pos+1))*sizeof(MY_TYPE) );
// Request resize of the current buffer
Resize(m_size-1);
}
/**
* @brief Remove N elements
*
* @param[in] pos Position to remove the data
* @param[in] posEnd Last position number
*
* @return ---
*
*/
void Erase(int32_t pos, int32_t posEnd)
{
if (pos>m_size) {
EDN_ERROR(" can not Erase Element at this position : " << pos << " > " << m_size);
return;
}
if (posEnd>m_size) {
posEnd = m_size;
}
int32_t nbElement = m_size - pos;
int32_t tmpSize = m_size;
// move curent data
memmove((m_data + pos), (m_data + pos + nbElement), (tmpSize - (pos+nbElement))*sizeof(MY_TYPE) );
// Request resize of the current buffer
Resize(m_size-nbElement);
}
/**
* @brief Remove N element
*
* @param[in] pos Position to remove the data
* @param[in] nbElement number of element to remove
*
* @return ---
*
*/
void EraseLen(int32_t pos, int32_t nbElement)
{
if (pos>m_size) {
EDN_ERROR(" can not Erase Len Element at this position : " << pos << " > " << m_size);
return;
}
if (pos+nbElement>m_size) {
nbElement = m_size - pos;
}
int32_t tmpSize = m_size;
// move curent data
memmove((m_data + pos), (m_data + pos + nbElement), (tmpSize - (pos+nbElement))*sizeof(MY_TYPE) );
// Request resize of the current buffer
Resize(m_size-nbElement);
}
/**
* @brief extract data between two point :
* @param[in] posStart start position to extract data
* @param[in] posEnd End position to extract data
* @return the extracted vector
*/
VectorType Extract(int32_t posStart = 0, int32_t posEnd=0x7FFFFFFF)
{
VectorType<MY_TYPE> out;
if (posStart < 0) {
posStart = 0;
} else if (posStart >= Size() ) {
return out;
}
if (posEnd < 0) {
return out;
} else if (posEnd >= Size() ) {
posEnd = Size();
}
out.PushBack(&m_data[posStart], posEnd-posStart);
return out;
}
/**
* @brief Set the minimum allocation in memory for the curent vector ==> reallocate the
* buffer to fit exactly the mumber of element needed
*/
void Fit(void)
{
if (m_size > m_allocated) {
// Reallocate the curent data to the correct size ...
EDN_REALLOC(m_data, m_size, MY_TYPE);
}
// Check result with assert :
EDN_ASSERT(NULL!=m_data, "Error in data Fitting");
m_allocated = m_size;
}
/**
* @brief Get an iterator an an specific position
* @param[in] pos Requested position of the iterator in the vector
* @return The Iterator
*/
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(void)
{
return Position(0);
}
/**
* @brief Get an Iterator on the end position of the Vector
* @return The Iterator
*/
Iterator End(void)
{
return Position( Size()-1 );
}
private:
/**
* @brief Change the current size of the vector
* @param[in] newSize New requested size of element in the vector
*/
void Resize(int32_t newSize)
{
// Reallocate memory
if (newSize > m_allocated) {
ChangeAllocation(newSize);
}
m_size = newSize;
}
/**
* @brief Change the current allocation to the corect one (depend on the current size)
* @param[in] newSize Minimum number of element needed
*/
void ChangeAllocation(int32_t newSize)
{
// set the minimal size to 1
if(newSize <= 0) {
newSize = 1;
}
int32_t requestSize = m_allocated;
// set the size with the corect chose type :
if (newSize == m_allocated) {
return;
} else if (newSize < requestSize) {
// down the size of the vector:
if (0==m_increment) {
// never down size...
} else {
int32_t devide = m_increment;
if (devide == 0) {
devide = 1;
}
int32_t numberOfStep = m_allocated / devide;
if (newSize< ((numberOfStep-2)*devide + devide/2) ) {
//Allow Reallocation of a new size shoerter
requestSize = ((newSize / devide)+1) * devide;
}
}
} else {
while(newSize > requestSize) {
if (0 == requestSize) {
requestSize = 1;
} else if (0==m_increment) {
requestSize = requestSize * 2;
} else {
requestSize = (requestSize + m_increment);
}
}
}
// No reallocation needed :
if (requestSize == m_allocated) {
return;
}
// check if something is allocated :
if (NULL == m_data) {
// no data allocated ==> request an allocation (might be the first)
EDN_MALLOC(m_data, requestSize, MY_TYPE);
} else {
// move datas
EDN_REALLOC(m_data, requestSize, MY_TYPE);
}
// Check result with assert :
EDN_ASSERT(NULL!=m_data, "Error in data allocation");
// set the new allocation size
m_allocated = requestSize;
}
};
}
#undef __class__
#define __class__ NULL
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,87 +0,0 @@
/**
*******************************************************************************
* @file charset.h
* @brief Editeur De N'ours : Abstraction Charset layer (header)
* @author Edouard DUPIN
* @date 06/06/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 __CHARSET_H__
#define __CHARSET_H__
#include "VectorType.h"
typedef enum {
EDN_CHARSET_UTF8,
EDN_CHARSET_ISO_8859_1,
EDN_CHARSET_ISO_8859_2,
EDN_CHARSET_ISO_8859_3,
EDN_CHARSET_ISO_8859_4,
EDN_CHARSET_ISO_8859_5,
EDN_CHARSET_ISO_8859_6,
EDN_CHARSET_ISO_8859_7,
EDN_CHARSET_ISO_8859_8,
EDN_CHARSET_ISO_8859_9,
EDN_CHARSET_ISO_8859_10,
EDN_CHARSET_ISO_8859_11,
EDN_CHARSET_ISO_8859_13,
EDN_CHARSET_ISO_8859_14,
EDN_CHARSET_ISO_8859_15,
} charset_te;
// transform ISO <==> Unicode
void convertIsoToUnicode(charset_te inputCharset, char input_ISO, int32_t & output_Unicode);
void convertUnicodeToIso(charset_te inputCharset, int32_t input_Unicode, char & output_ISO);
int32_t convertIsoToUnicode(charset_te inputCharset, Edn::VectorType<char>& input_ISO, Edn::VectorType<int32_t>& output_Unicode);
int32_t convertUnicodeToIso(charset_te inputCharset, Edn::VectorType<int32_t>& input_Unicode, Edn::VectorType<char>& output_ISO);
// Transform UTF-8 <==> Unicode
void convertUnicodeToUtf8( int32_t input_Unicode, char * output_UTF8);
void convertUtf8ToUnicode( char * input_UTF8, int32_t& output_Unicode);
int32_t convertUnicodeToUtf8( Edn::VectorType<int32_t>& input_Unicode, Edn::VectorType<char>& output_UTF8);
int32_t convertUtf8ToUnicode( Edn::VectorType<char>& input_UTF8, Edn::VectorType<int32_t>& output_Unicode);
// Transform ISO <==> UTF-8
void convertIsoToUtf8( charset_te inputCharset, char input_ISO, char * output_UTF8);
void convertUtf8ToIso( charset_te inputCharset, char * input_UTF8, char & output_ISO);
int32_t convertIsoToUtf8( charset_te inputCharset, Edn::VectorType<char>& input_ISO, Edn::VectorType<char>& output_UTF8);
int32_t convertUtf8ToIso( charset_te inputCharset, Edn::VectorType<char>& input_UTF8, Edn::VectorType<char>& output_ISO);
void Utf8_SizeElement(const char * data, int32_t lenMax , uint8_t &size, bool &baseValid);
int32_t strUtf8Len(const char *input_UTF8);
#ifdef USE_GTK_VERSION_3_0
# define GDK_KEY_Esc (65305)
# define GDK_KEY_Alt_Gr (65027)
# define GDK_KEY_Pomme_L (65515)
# define GDK_KEY_Pomme_R (65516)
#elif USE_GTK_VERSION_2_0
# define GDK_Esc (65305)
# define GDK_Alt_Gr (65027)
# define GDK_Pomme_L (65515)
# define GDK_Pomme_R (65516)
#endif
//# define GDK_Retur (65516)
void ConvertInput(GdkEventKey *event, char* Utf8Out, bool &controlKey, bool &moveKey, int32_t &key);
void testDisplayConvChar(void);
#endif

View File

@ -1,312 +0,0 @@
/**
*******************************************************************************
* @file charsetTable.cpp
* @brief Editeur De N'ours : Table of all charset convertions (Sources)
* @author Edouard DUPIN
* @date 06/06/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 "tools_debug.h"
#include "tools_globals.h"
#include "charsetTable.h"
extern "C" {
const int32_t TableIso8859_1[] = {
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
0x000000A0, 0x000000A1, 0x000000A2, 0x000000A3, 0x000000A4, 0x000000A5, 0x000000A6, 0x000000A7, 0x000000A8, 0x000000A9, 0x000000AA, 0x000000AB, 0x000000AC, 0x000000AD, 0x000000AE, 0x000000AF,
0x000000B0, 0x000000B1, 0x000000B2, 0x000000B3, 0x000000B4, 0x000000B5, 0x000000B6, 0x000000B7, 0x000000B8, 0x000000B9, 0x000000BA, 0x000000BB, 0x000000BC, 0x000000BD, 0x000000BE, 0x000000BF,
0x000000C0, 0x000000C1, 0x000000C2, 0x000000C3, 0x000000C4, 0x000000C5, 0x000000C6, 0x000000C7, 0x000000C8, 0x000000C9, 0x000000CA, 0x000000CB, 0x000000CC, 0x000000CD, 0x000000CE, 0x000000CF,
0x000000D0, 0x000000D1, 0x000000D2, 0x000000D3, 0x000000D4, 0x000000D5, 0x000000D6, 0x000000D7, 0x000000D8, 0x000000D9, 0x000000DA, 0x000000DB, 0x000000DC, 0x000000DD, 0x000000DE, 0x000000DF,
0x000000E0, 0x000000E1, 0x000000E2, 0x000000E3, 0x000000E4, 0x000000E5, 0x000000E6, 0x000000E7, 0x000000E8, 0x000000E9, 0x000000EA, 0x000000EB, 0x000000EC, 0x000000ED, 0x000000EE, 0x000000EF,
0x000000F0, 0x000000F1, 0x000000F2, 0x000000F3, 0x000000F4, 0x000000F5, 0x000000F6, 0x000000F7, 0x000000F8, 0x000000F9, 0x000000FA, 0x000000FB, 0x000000FC, 0x000000FD, 0x000000FE, 0x000000FF
};
const int32_t TableIso8859_2[] = {
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
0x000000A0, 0x00000104, 0x000002D8, 0x00000141, 0x000000A4, 0x0000013D, 0x0000015A, 0x000000A7, 0x000000A8, 0x00000160, 0x0000015E, 0x00000164, 0x00000179, 0x000000AD, 0x0000017D, 0x0000017B,
0x000000B0, 0x00000105, 0x000002DB, 0x00000142, 0x000000B4, 0x0000013E, 0x0000015B, 0x000002C7, 0x000000B8, 0x00000161, 0x0000015F, 0x00000165, 0x0000017A, 0x000002DD, 0x0000017E, 0x0000017C,
0x00000154, 0x000000C1, 0x000000C2, 0x00000102, 0x000000C4, 0x00000139, 0x00000106, 0x000000C7, 0x0000010C, 0x000000C9, 0x00000118, 0x000000CB, 0x0000011A, 0x000000CD, 0x000000CE, 0x0000010E,
0x00000110, 0x00000143, 0x00000147, 0x000000D3, 0x000000D4, 0x00000150, 0x000000D6, 0x000000D7, 0x00000158, 0x0000016E, 0x000000DA, 0x00000170, 0x000000DC, 0x000000DD, 0x00000162, 0x000000DF,
0x00000155, 0x000000E1, 0x000000E2, 0x00000103, 0x000000E4, 0x0000013A, 0x00000107, 0x000000E7, 0x0000010D, 0x000000E9, 0x00000119, 0x000000EB, 0x0000011B, 0x000000ED, 0x000000EE, 0x0000010F,
0x00000111, 0x00000144, 0x00000148, 0x000000F3, 0x000000F4, 0x00000151, 0x000000F6, 0x000000F7, 0x00000159, 0x0000016F, 0x000000FA, 0x00000171, 0x000000FC, 0x000000FD, 0x00000163, 0x000002D9
};
const int32_t TableIso8859_3[] = {
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
0x000000A0, 0x00000126, 0x000002D8, 0x000000A3, 0x000000A4, 0x00000000, 0x00000124, 0x000000A7, 0x000000A8, 0x00000130, 0x0000015E, 0x0000011E, 0x00000134, 0x000000AD, 0x00000000, 0x0000017B,
0x000000B0, 0x00000127, 0x000000B2, 0x000000B3, 0x000000B4, 0x000000B5, 0x00000125, 0x000000B7, 0x000000B8, 0x00000131, 0x0000015F, 0x0000011F, 0x00000135, 0x000000BD, 0x00000000, 0x0000017C,
0x000000C0, 0x000000C1, 0x000000C2, 0x00000000, 0x000000C4, 0x0000010A, 0x00000108, 0x000000C7, 0x000000C8, 0x000000C9, 0x000000CA, 0x000000CB, 0x000000CC, 0x000000CD, 0x000000CE, 0x000000CF,
0x00000000, 0x000000D1, 0x000000D2, 0x000000D3, 0x000000D4, 0x00000120, 0x000000D6, 0x000000D7, 0x0000011C, 0x000000D9, 0x000000DA, 0x000000DB, 0x000000DC, 0x0000016C, 0x0000015C, 0x000000DF,
0x000000E0, 0x000000E1, 0x000000E2, 0x00000000, 0x000000E4, 0x0000010B, 0x00000109, 0x000000E7, 0x000000E8, 0x000000E9, 0x000000EA, 0x000000EB, 0x000000EC, 0x000000ED, 0x000000EE, 0x000000EF,
0x00000000, 0x000000F1, 0x000000F2, 0x000000F3, 0x000000F4, 0x00000121, 0x000000F6, 0x000000F7, 0x0000011D, 0x000000F9, 0x000000FA, 0x000000FB, 0x000000FC, 0x0000016D, 0x0000015D, 0x000002D9
};
const int32_t TableIso8859_4[] = {
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
0x000000A0, 0x00000104, 0x00000138, 0x00000156, 0x000000A4, 0x00000128, 0x0000013B, 0x000000A7, 0x000000A8, 0x00000160, 0x00000112, 0x00000122, 0x00000166, 0x000000AD, 0x0000017D, 0x000000AF,
0x000000B0, 0x00000105, 0x000002DB, 0x00000157, 0x000000B4, 0x00000129, 0x0000013C, 0x000002C7, 0x000000B8, 0x00000161, 0x00000113, 0x00000123, 0x00000167, 0x0000014A, 0x0000017E, 0x0000014B,
0x00000100, 0x000000C1, 0x000000C2, 0x000000C3, 0x000000C4, 0x000000C5, 0x000000C6, 0x0000012E, 0x0000010C, 0x000000C9, 0x00000118, 0x000000CB, 0x00000116, 0x000000CD, 0x000000CE, 0x0000012A,
0x00000110, 0x00000145, 0x0000014C, 0x00000136, 0x000000D4, 0x000000D5, 0x000000D6, 0x000000D7, 0x000000D8, 0x00000172, 0x000000DA, 0x000000DB, 0x000000DC, 0x00000168, 0x0000016A, 0x000000DF,
0x00000101, 0x000000E1, 0x000000E2, 0x000000E3, 0x000000E4, 0x000000E5, 0x000000E6, 0x0000012F, 0x0000010D, 0x000000E9, 0x00000119, 0x000000EB, 0x00000117, 0x000000ED, 0x000000EE, 0x0000012B,
0x00000111, 0x00000146, 0x0000014D, 0x00000137, 0x000000F4, 0x000000F5, 0x000000F6, 0x000000F7, 0x000000F8, 0x00000173, 0x000000FA, 0x000000FB, 0x000000FC, 0x00000169, 0x0000016B, 0x000002D9
};
const int32_t TableIso8859_5[] = {
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
0x000000A0, 0x00000401, 0x00000402, 0x00000403, 0x00000404, 0x00000405, 0x00000406, 0x00000407, 0x00000408, 0x00000409, 0x0000040A, 0x0000040B, 0x0000040C, 0x000000AD, 0x0000040E, 0x0000040F,
0x00000410, 0x00000411, 0x00000412, 0x00000413, 0x00000414, 0x00000415, 0x00000416, 0x00000417, 0x00000418, 0x00000419, 0x0000041A, 0x0000041B, 0x0000041C, 0x0000041D, 0x0000041E, 0x0000041F,
0x00000420, 0x00000421, 0x00000422, 0x00000423, 0x00000424, 0x00000425, 0x00000426, 0x00000427, 0x00000428, 0x00000429, 0x0000042A, 0x0000042B, 0x0000042C, 0x0000042D, 0x0000042E, 0x0000042F,
0x00000430, 0x00000431, 0x00000432, 0x00000433, 0x00000434, 0x00000435, 0x00000436, 0x00000437, 0x00000438, 0x00000439, 0x0000043A, 0x0000043B, 0x0000043C, 0x0000043D, 0x0000043E, 0x0000043F,
0x00000440, 0x00000441, 0x00000442, 0x00000443, 0x00000444, 0x00000445, 0x00000446, 0x00000447, 0x00000448, 0x00000449, 0x0000044A, 0x0000044B, 0x0000044C, 0x0000044D, 0x0000044E, 0x0000044F,
0x00002116, 0x00000451, 0x00000452, 0x00000453, 0x00000454, 0x00000455, 0x00000456, 0x00000457, 0x00000458, 0x00000459, 0x0000045A, 0x0000045B, 0x0000045C, 0x000000A7, 0x0000045E, 0x0000045F
};
const int32_t TableIso8859_6[] = {
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
0x000000A0, 0x00000000, 0x00000000, 0x00000000, 0x000000A4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000060C, 0x000000AD, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000061B, 0x00000000, 0x00000000, 0x00000000, 0x0000061F,
0x00000000, 0x00000621, 0x00000622, 0x00000623, 0x00000624, 0x00000625, 0x00000626, 0x00000627, 0x00000628, 0x00000629, 0x0000062A, 0x0000062B, 0x0000062C, 0x0000062D, 0x0000062E, 0x0000062F,
0x00000630, 0x00000631, 0x00000632, 0x00000633, 0x00000634, 0x00000635, 0x00000636, 0x00000637, 0x00000638, 0x00000639, 0x0000063A, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000640, 0x00000641, 0x00000642, 0x00000643, 0x00000644, 0x00000645, 0x00000646, 0x00000647, 0x00000648, 0x00000649, 0x0000064A, 0x0000064B, 0x0000064C, 0x0000064D, 0x0000064E, 0x0000064F,
0x00000650, 0x00000651, 0x00000652, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
};
const int32_t TableIso8859_7[] = {
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
0x000000A0, 0x00002018, 0x00002019, 0x000000A3, 0x000020AC, 0x000020AF, 0x000000A6, 0x000000A7, 0x000000A8, 0x000000A9, 0x0000037A, 0x000000AB, 0x000000AC, 0x000000AD, 0x00000000, 0x00002015,
0x000000B0, 0x000000B1, 0x000000B2, 0x000000B3, 0x00000384, 0x00000385, 0x00000386, 0x000000B7, 0x00000388, 0x00000389, 0x0000038A, 0x000000BB, 0x0000038C, 0x000000BD, 0x0000038E, 0x0000038F,
0x00000390, 0x00000391, 0x00000392, 0x00000393, 0x00000394, 0x00000395, 0x00000396, 0x00000397, 0x00000398, 0x00000399, 0x0000039A, 0x0000039B, 0x0000039C, 0x0000039D, 0x0000039E, 0x0000039F,
0x000003A0, 0x000003A1, 0x00000000, 0x000003A3, 0x000003A4, 0x000003A5, 0x000003A6, 0x000003A7, 0x000003A8, 0x000003A9, 0x000003AA, 0x000003AB, 0x000003AC, 0x000003AD, 0x000003AE, 0x000003AF,
0x000003B0, 0x000003B1, 0x000003B2, 0x000003B3, 0x000003B4, 0x000003B5, 0x000003B6, 0x000003B7, 0x000003B8, 0x000003B9, 0x000003BA, 0x000003BB, 0x000003BC, 0x000003BD, 0x000003BE, 0x000003BF,
0x000003C0, 0x000003C1, 0x000003C2, 0x000003C3, 0x000003C4, 0x000003C5, 0x000003C6, 0x000003C7, 0x000003C8, 0x000003C9, 0x000003CA, 0x000003CB, 0x000003CC, 0x000003CD, 0x000003CE, 0x00000000
};
const int32_t TableIso8859_8[] = {
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
0x000000A0, 0x00000000, 0x000000A2, 0x000000A3, 0x000000A4, 0x000000A5, 0x000000A6, 0x000000A7, 0x000000A8, 0x000000A9, 0x000000D7, 0x000000AB, 0x000000AC, 0x000000AD, 0x000000AE, 0x000000AF,
0x000000B0, 0x000000B1, 0x000000B2, 0x000000B3, 0x000000B4, 0x000000B5, 0x000000B6, 0x000000B7, 0x000000B8, 0x000000B9, 0x000000F7, 0x000000BB, 0x000000BC, 0x000000BD, 0x000000BE, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00002017,
0x000005D0, 0x000005D1, 0x000005D2, 0x000005D3, 0x000005D4, 0x000005D5, 0x000005D6, 0x000005D7, 0x000005D8, 0x000005D9, 0x000005DA, 0x000005DB, 0x000005DC, 0x000005DD, 0x000005DE, 0x000005DF,
0x000005E0, 0x000005E1, 0x000005E2, 0x000005E3, 0x000005E4, 0x000005E5, 0x000005E6, 0x000005E7, 0x000005E8, 0x000005E9, 0x000005EA, 0x00000000, 0x00000000, 0x0000200E, 0x0000200F, 0x000003C0
};
const int32_t TableIso8859_9[] = {
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
0x000000A0, 0x000000A1, 0x000000A2, 0x000000A3, 0x000000A4, 0x000000A5, 0x000000A6, 0x000000A7, 0x000000A8, 0x000000A9, 0x000000AA, 0x000000AB, 0x000000AC, 0x000000AD, 0x000000AE, 0x000000AF,
0x000000B0, 0x000000B1, 0x000000B2, 0x000000B3, 0x000000B4, 0x000000B5, 0x000000B6, 0x000000B7, 0x000000B8, 0x000000B9, 0x000000BA, 0x000000BB, 0x000000BC, 0x000000BD, 0x000000BE, 0x000000BF,
0x000000C0, 0x000000C1, 0x000000C2, 0x000000C3, 0x000000C4, 0x000000C5, 0x000000C6, 0x000000C7, 0x000000C8, 0x000000C9, 0x000000CA, 0x000000CB, 0x000000CC, 0x000000CD, 0x000000CE, 0x000000CF,
0x0000011E, 0x000000D1, 0x000000D2, 0x000000D3, 0x000000D4, 0x000000D5, 0x000000D6, 0x000000D7, 0x000000D8, 0x000000D9, 0x000000DA, 0x000000DB, 0x000000DC, 0x00000130, 0x0000015E, 0x000000DF,
0x000000E0, 0x000000E1, 0x000000E2, 0x000000E3, 0x000000E4, 0x000000E5, 0x000000E6, 0x000000E7, 0x000000E8, 0x000000E9, 0x000000EA, 0x000000EB, 0x000000EC, 0x000000ED, 0x000000EE, 0x000000EF,
0x0000011F, 0x000000F1, 0x000000F2, 0x000000F3, 0x000000F4, 0x000000F5, 0x000000F6, 0x000000F7, 0x000000F8, 0x000000F9, 0x000000FA, 0x000000FB, 0x000000FC, 0x00000131, 0x0000015F, 0x000000FF
};
const int32_t TableIso8859_10[] = {
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
0x000000A0, 0x00000104, 0x00000112, 0x00000122, 0x0000012A, 0x00000128, 0x00000136, 0x000000A7, 0x0000013B, 0x00000110, 0x00000160, 0x00000166, 0x0000017D, 0x000000AD, 0x0000016A, 0x0000014A,
0x000000B0, 0x00000105, 0x00000113, 0x00000123, 0x0000012B, 0x00000129, 0x00000137, 0x000000B7, 0x0000013C, 0x00000111, 0x00000161, 0x00000167, 0x0000017E, 0x00002015, 0x0000016B, 0x0000014B,
0x00000100, 0x000000C1, 0x000000C2, 0x000000C3, 0x000000C4, 0x000000C5, 0x000000C6, 0x0000012E, 0x0000010C, 0x000000C9, 0x00000118, 0x000000CB, 0x00000116, 0x000000CD, 0x000000CE, 0x000000CF,
0x000000D0, 0x00000145, 0x0000014C, 0x000000D3, 0x000000D4, 0x000000D5, 0x000000D6, 0x00000168, 0x000000D8, 0x00000172, 0x000000DA, 0x000000DB, 0x000000DC, 0x000000DD, 0x000000DE, 0x000000DF,
0x00000101, 0x000000E1, 0x000000E2, 0x000000E3, 0x000000E4, 0x000000E5, 0x000000E6, 0x0000012F, 0x0000010D, 0x000000E9, 0x00000119, 0x000000EB, 0x00000117, 0x000000ED, 0x000000EE, 0x000000EF,
0x000000F0, 0x00000146, 0x0000014D, 0x000000F3, 0x000000F4, 0x000000F5, 0x000000F6, 0x00000169, 0x000000F8, 0x00000173, 0x000000FA, 0x000000FB, 0x000000FC, 0x000000FD, 0x000000FE, 0x00000138
};
const int32_t TableIso8859_11[] = {
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
0x000000A0, 0x00000E01, 0x00000E02, 0x00000E03, 0x00000E04, 0x00000E05, 0x00000E06, 0x00000E07, 0x00000E08, 0x00000E09, 0x00000E0A, 0x00000E0B, 0x00000E0C, 0x00000E0D, 0x00000E0E, 0x00000E0F,
0x00000E10, 0x00000E11, 0x00000E12, 0x00000E13, 0x00000E14, 0x00000E15, 0x00000E16, 0x00000E17, 0x00000E18, 0x00000E19, 0x00000E1A, 0x00000E1B, 0x00000E1C, 0x00000E1D, 0x00000E1E, 0x00000E1F,
0x00000E20, 0x00000E21, 0x00000E22, 0x00000E23, 0x00000E24, 0x00000E25, 0x00000E26, 0x00000E27, 0x00000E28, 0x00000E29, 0x00000E2A, 0x00000E2B, 0x00000E2C, 0x00000E2D, 0x00000E2E, 0x00000E2F,
0x00000E30, 0x00000E31, 0x00000E32, 0x00000E33, 0x00000E34, 0x00000E35, 0x00000E36, 0x00000E37, 0x00000E38, 0x00000E39, 0x00000E3A, 0x00000E80, 0x00000E80, 0x00000E80, 0x00000E80, 0x00000E3F,
0x00000E40, 0x00000E41, 0x00000E42, 0x00000E43, 0x00000E44, 0x00000E45, 0x00000E46, 0x00000E47, 0x00000E48, 0x00000E49, 0x00000E4A, 0x00000E4B, 0x00000E4C, 0x00000E4D, 0x00000E4E, 0x00000E4F,
0x00000E50, 0x00000E51, 0x00000E52, 0x00000E53, 0x00000E54, 0x00000E55, 0x00000E56, 0x00000E57, 0x00000E58, 0x00000E59, 0x00000E5A, 0x00000E5B, 0x000006C0, 0x000006C0, 0x000006C0, 0x000006C0
};
const int32_t TableIso8859_13[] = {
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
0x000000A0, 0x0000201D, 0x000000A2, 0x000000A3, 0x000000A4, 0x0000201E, 0x000000A6, 0x000000A7, 0x000000D8, 0x000000A9, 0x00000156, 0x000000AB, 0x000000AC, 0x000000AD, 0x000000AE, 0x000000C6,
0x000000B0, 0x000000B1, 0x000000B2, 0x000000B3, 0x0000201C, 0x000000B5, 0x000000B6, 0x000000B7, 0x000000F8, 0x000000B9, 0x00000157, 0x000000BB, 0x000000BC, 0x000000BD, 0x000000BE, 0x000000E6,
0x00000104, 0x0000012E, 0x00000100, 0x00000106, 0x000000C4, 0x000000C5, 0x00000118, 0x00000112, 0x0000010C, 0x000000C9, 0x00000179, 0x00000116, 0x00000122, 0x00000136, 0x0000012A, 0x0000013B,
0x00000160, 0x00000143, 0x00000145, 0x000000D3, 0x0000014C, 0x000000D5, 0x000000D6, 0x000000D7, 0x00000172, 0x00000141, 0x0000015A, 0x0000016A, 0x000000DC, 0x0000017B, 0x0000017D, 0x000000DF,
0x00000105, 0x0000012F, 0x00000101, 0x00000107, 0x000000E4, 0x000000E5, 0x00000119, 0x00000113, 0x0000010D, 0x000000E9, 0x0000017A, 0x00000117, 0x00000123, 0x00000137, 0x0000012B, 0x0000013C,
0x00000161, 0x00000144, 0x00000146, 0x000000F3, 0x0000014D, 0x000000F5, 0x000000F6, 0x000000F7, 0x00000173, 0x00000142, 0x0000015B, 0x0000016B, 0x000000FC, 0x0000017C, 0x0000017E, 0x00002019
};
const int32_t TableIso8859_14[] = {
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
0x000000A0, 0x00001E02, 0x00001E03, 0x000000A3, 0x0000010A, 0x0000010B, 0x00001E0A, 0x000000A7, 0x00001E80, 0x000000A9, 0x00001E82, 0x00001E0B, 0x00001EF2, 0x000000AD, 0x000000AE, 0x00000178,
0x00001E1E, 0x00001E1F, 0x00000120, 0x00000121, 0x00001E40, 0x00001E41, 0x000000B6, 0x00001E56, 0x00001E81, 0x00001E57, 0x00001E83, 0x00001E60, 0x00001EF3, 0x00001E84, 0x00001E85, 0x00001E61,
0x000000C0, 0x000000C1, 0x000000C2, 0x000000C3, 0x000000C4, 0x000000C5, 0x000000C6, 0x000000C7, 0x000000C8, 0x000000C9, 0x000000CA, 0x000000CB, 0x000000CC, 0x000000CD, 0x000000CE, 0x000000CF,
0x00000174, 0x000000D1, 0x000000D2, 0x000000D3, 0x000000D4, 0x000000D5, 0x000000D6, 0x00001E6A, 0x000000D8, 0x000000D9, 0x000000DA, 0x000000DB, 0x000000DC, 0x000000DD, 0x00000176, 0x000000DF,
0x000000E0, 0x000000E1, 0x000000E2, 0x000000E3, 0x000000E4, 0x000000E5, 0x000000E6, 0x000000E7, 0x000000E8, 0x000000E9, 0x000000EA, 0x000000EB, 0x000000EC, 0x000000ED, 0x000000EE, 0x000000EF,
0x00000175, 0x000000F1, 0x000000F2, 0x000000F3, 0x000000F4, 0x000000F5, 0x000000F6, 0x00001E6B, 0x000000F8, 0x000000F9, 0x000000FA, 0x000000FB, 0x000000FC, 0x000000FD, 0x00000177, 0x000000FF
};
const int32_t TableIso8859_15[] = {
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
0x000000A0, 0x000000A1, 0x000000A2, 0x000000A3, 0x000020AC, 0x000000A5, 0x00000160, 0x000000A7, 0x00000161, 0x000000A9, 0x000000AA, 0x000000AB, 0x000000AC, 0x000000AD, 0x000000AE, 0x000000AF,
0x000000B0, 0x000000B1, 0x000000B2, 0x000000B3, 0x0000017D, 0x000000B5, 0x000000B6, 0x000000B7, 0x0000017E, 0x000000B9, 0x000000BA, 0x000000BB, 0x00000152, 0x00000153, 0x00000178, 0x000000BF,
0x000000C0, 0x000000C1, 0x000000C2, 0x000000C3, 0x000000C4, 0x000000C5, 0x000000C6, 0x000000C7, 0x000000C8, 0x000000C9, 0x000000CA, 0x000000CB, 0x000000CC, 0x000000CD, 0x000000CE, 0x000000CF,
0x000000D0, 0x000000D1, 0x000000D2, 0x000000D3, 0x000000D4, 0x000000D5, 0x000000D6, 0x000000D7, 0x000000D8, 0x000000D9, 0x000000DA, 0x000000DB, 0x000000DC, 0x000000DD, 0x000000DE, 0x000000DF,
0x000000E0, 0x000000E1, 0x000000E2, 0x000000E3, 0x000000E4, 0x000000E5, 0x000000E6, 0x000000E7, 0x000000E8, 0x000000E9, 0x000000EA, 0x000000EB, 0x000000EC, 0x000000ED, 0x000000EE, 0x000000EF,
0x000000F0, 0x000000F1, 0x000000F2, 0x000000F3, 0x000000F4, 0x000000F5, 0x000000F6, 0x000000F7, 0x000000F8, 0x000000F9, 0x000000FA, 0x000000FB, 0x000000FC, 0x000000FD, 0x000000FE, 0x000000FF
};
}

View File

@ -1,51 +0,0 @@
/**
*******************************************************************************
* @file charsetTable.h
* @brief Editeur De N'ours : Table of all charset convertions (Header)
* @author Edouard DUPIN
* @date 06/06/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 __CHARSET_TABLE_H__
#define __CHARSET_TABLE_H__
extern "C" {
extern const int32_t TableIso8859_1[];
extern const int32_t TableIso8859_2[];
extern const int32_t TableIso8859_3[];
extern const int32_t TableIso8859_4[];
extern const int32_t TableIso8859_5[];
extern const int32_t TableIso8859_6[];
extern const int32_t TableIso8859_7[];
extern const int32_t TableIso8859_8[];
extern const int32_t TableIso8859_9[];
extern const int32_t TableIso8859_10[];
extern const int32_t TableIso8859_11[];
extern const int32_t TableIso8859_13[];
extern const int32_t TableIso8859_14[];
extern const int32_t TableIso8859_15[];
;
}
#endif

View File

@ -1,62 +0,0 @@
/**
*******************************************************************************
* @file tools_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.
*
*******************************************************************************
*/
#include "tools_debug.h"
#include "time.h"
// Max string size : (wide screan console nb caractere)
#define EDN_LOG_MAX_LENGTH 250
#define FUNCTION_NAME_SIZE (50)
void TOOLS_DisplayFuncName(int32_t ligne, const char* className, const char* funcName)
{
char tmpName[FUNCTION_NAME_SIZE] = "";
if (NULL == className) {
snprintf(tmpName, FUNCTION_NAME_SIZE, "(l=%5d) %s ",ligne, funcName);
} else {
snprintf(tmpName, FUNCTION_NAME_SIZE, "(l=%5d) %s::%s ",ligne, className, funcName);
}
tmpName[FUNCTION_NAME_SIZE-4] = ' ';
tmpName[FUNCTION_NAME_SIZE-3] = '|';
tmpName[FUNCTION_NAME_SIZE-2] = ' ';
tmpName[FUNCTION_NAME_SIZE-1] = '\0';
std::cout << tmpName;
}
void TOOLS_DisplayTime(void)
{
time_t rawtime;
struct tm * timeinfo;
char tmpdata[50];
time ( &rawtime );
timeinfo = localtime ( &rawtime );
sprintf(tmpdata, " %2dh %2dmin %2ds | ", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
std::cout << tmpdata ;
}

View File

@ -1,155 +0,0 @@
/**
*******************************************************************************
* @file tools_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.
*
*******************************************************************************
*/
#ifndef __TOOLS_DEBUG_H__
#define __TOOLS_DEBUG_H__
#include <iostream>
#include "types_generique.h"
// Log Message System For EDN
void TOOLS_DisplayFuncName(int32_t ligne, const char* className, const char* funcName);
void TOOLS_DisplayTime(void);
//regular colors
#define COLOR_BLACK "\e[0;30m"
#define COLOR_RED "\e[0;31m"
#define COLOR_GREEN "\e[0;32m"
#define COLOR_YELLOW "\e[0;33m"
#define COLOR_BLUE "\e[0;34m"
#define COLOR_MAGENTA "\e[0;35m"
#define COLOR_CYAN "\e[0;36m"
#define COLOR_WHITE "\e[0;37m"
//emphasized (bolded) colors
#define COLOR_BOLD_BLACK "\e[1;30m"
#define COLOR_BOLD_RED "\e[1;31m"
#define COLOR_BOLD_GREEN "\e[1;32m"
#define COLOR_BOLD_YELLOW "\e[1;33m"
#define COLOR_BOLD_BLUE "\e[1;34m"
#define COLOR_BOLD_MAGENTA "\e[1;35m"
#define COLOR_BOLD_CYAN "\e[1;36m"
#define COLOR_BOLD_WHITE "\e[1;37m"
//background colors
#define COLOR_BG_BLACK "\e[40m"
#define COLOR_BG_RED "\e[41m"
#define COLOR_BG_GREEN "\e[42m"
#define COLOR_BG_YELLOW "\e[43m"
#define COLOR_BG_BLUE "\e[44m"
#define COLOR_BG_MAGENTA "\e[45m"
#define COLOR_BG_CYAN "\e[46m"
#define COLOR_BG_WHITE "\e[47m"
// Return to the normal color setings
#define COLOR_NORMAL "\e[0m"
//go to the Top of bash
#define GO_TOP "\e[0;0f"
#undef __class__
#define __class__ (NULL)
/*
#define DEFINE_CLASS_NAME(name) #undef __class__ \
#define __class__ (#name)
at the start of the class :
#undef __class__
#define __class__ ""
*/
#define EDN_DBG_COMMON(color, info, data) do { \
std::cout << color; \
TOOLS_DisplayTime(); \
TOOLS_DisplayFuncName(__LINE__, __class__, __func__); \
std::cout << "[" << info << "] " << data; \
std::cout << COLOR_NORMAL <<std::endl; \
}while(0)
#define EDN_CRITICAL(data) EDN_DBG_COMMON(COLOR_BOLD_RED, "CC", data)
// General
#if EDN_DEBUG_LEVEL > 0
# define EDN_WARNING(data) EDN_DBG_COMMON(COLOR_MAGENTA, "WW", data)
# define EDN_ERROR(data) EDN_DBG_COMMON(COLOR_BOLD_RED, "EE", data)
#else
# define EDN_WARNING(data) do {}while(0)
# define EDN_ERROR(data) do {}while(0)
#endif
#if EDN_DEBUG_LEVEL > 1
# define EDN_INFO(data) EDN_DBG_COMMON(COLOR_CYAN, "II", data)
#else
# define EDN_INFO(data) do {}while(0)
#endif
#if EDN_DEBUG_LEVEL > 2
# define EDN_DEBUG(data) EDN_DBG_COMMON(COLOR_YELLOW, "DD", data)
#else
# define EDN_DEBUG(data) do {}while(0)
#endif
#if EDN_DEBUG_LEVEL > 0
# define EDN_ASSERT(cond, format, ...) \
do { \
if (!(cond)) { \
EDN_CRITICAL(format, ##__VA_ARGS__); \
assert(!#cond); \
} \
} while (0)
#else
# define EDN_ASSERT(cond, format, ...) \
do { \
assert(cond); \
} while (0)
#endif
#if EDN_DEBUG_LEVEL > 1
# define EDN_CHECK_INOUT(cond) EDN_ASSERT((cond), "Internal input error : "#cond)
#elif EDN_DEBUG_LEVEL > 0
// Critical warning mode
# define EDN_CHECK_INOUT(cond) \
do { \
if (!(cond)) { \
EDN_CRITICAL("Internal input error : "#cond);\
} \
} while (0)
#else
// Default : No check
# define EDN_CHECK_INOUT(cond) do { } while (0)
#endif
// Enable or disable the magic element checking...
#if EDN_DEBUG_LEVEL > 0
#define CHECK_MAGIC(cond) EDN_ASSERT((cond), "MAGIC check error : "#cond)
#define EDN_ENABLE_CHECK_MAGIC (1)
#else
#define CHECK_MAGIC(cond) do {}while(0)
#endif
#endif

View File

@ -1,87 +0,0 @@
/**
*******************************************************************************
* @file types_generique.h
* @brief Editeur De N'ours : generique define type
* @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.
*
*******************************************************************************
*/
#ifndef __TOOLS_TYPES_GENERIQUE_H__
#define __TOOLS_TYPES_GENERIQUE_H__
// includes system, malloc, EXIT_SUCCESS
#include <stdlib.h>
// includes fopen, fwrite, fseek, ftell
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <assert.h>
extern "C" {
// includes GDK_q
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
}
#ifndef __int8_t_defined
# define __int8_t_defined
typedef signed char int8_t;
typedef signed short int int16_t;
typedef int int32_t;
typedef signed long long int int64_t;
#endif
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned long int uint32_t;
typedef unsigned long long int uint64_t;
typedef bool BOOL;
typedef enum {
ERR_NONE = 0, //!< No error, luckily everything went fine
ERR_FAIL, //!< Miscellaneous failure
ERR_INVAL, //!< Invalid entry parameter
ERR_MEM, //!< Dynamic memory allocation failure
ERR_TIMEOUT, //!< Request time out
ERR_BUSY, //!< Element curently Busy
}erreurCode_te;
#define edn_min(elemA, elemB) ((elemA)<(elemB)) ? (elemA) : (elemB)
#define edn_max(elemA, elemB) ((elemA)<(elemB)) ? (elemB) : (elemA)
#define edn_average(minimim, elem, maximum) ((minimim)>(elem)) ? (minimim) : ((maximum)<(elem)) ? (maximum) : (elem)
typedef struct {
int32_t x;
int32_t y;
} position_ts;
#endif

View File

@ -1,200 +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 "tools_globals.h"
#include "ColorizeManager.h"
#include "MsgBroadcast.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)
{
EDN_INFO("Set EndOfLine " << newVal);
displayEOL = newVal;
GeneralSendMessage(EDN_MSG__REFRESH_DISPLAY);
}
// -----------------------------------------------------------
static bool displaySpaceChar = true;
bool globals::IsSetDisplaySpaceChar(void)
{
return displaySpaceChar;
}
void globals::SetDisplaySpaceChar(bool newVal)
{
EDN_INFO("Set SpaceChar " << newVal);
displaySpaceChar = newVal;
GeneralSendMessage(EDN_MSG__REFRESH_DISPLAY);
}
// -----------------------------------------------------------
static bool AutoIndent = true;
bool globals::IsSetAutoIndent(void)
{
return AutoIndent;
}
void globals::SetAutoIndent(bool newVal)
{
EDN_INFO("Set AutoIndent " << newVal);
AutoIndent = newVal;
}
// -----------------------------------------------------------
int32_t globals::getNbColoneBorder(void)
{
return 6;
}
int32_t globals::getNbLineBorder(void)
{
return 3;
}
static bool shiftIsSet = false;
void globals::SetShift(void)
{
shiftIsSet = true;
EDN_INFO(" SHIFT => Set");
}
void globals::UnSetShift(void)
{
shiftIsSet = false;
EDN_INFO(" SHIFT => UnSet");
}
bool globals::IsSetShift(void)
{
return shiftIsSet;
}
static bool altIsSet = false;
void globals::SetAlt(void)
{
altIsSet = true;
}
void globals::UnSetAlt(void)
{
altIsSet = false;
}
bool globals::IsSetAlt(void)
{
return altIsSet;
}
static bool ctrlIsSet = false;
void globals::SetCtrl(void)
{
ctrlIsSet = true;
}
void globals::UnSetCtrl(void)
{
ctrlIsSet = false;
}
bool globals::IsSetCtrl(void)
{
return ctrlIsSet;
}
static bool pommeIsSet = false;
void globals::SetPomme(void)
{
pommeIsSet = true;
}
void globals::UnSetPomme(void)
{
pommeIsSet = false;
}
bool globals::IsSetPomme(void)
{
return pommeIsSet;
}
static bool insertIsSet = false;
void globals::SetInsert(void)
{
insertIsSet = true;
}
void globals::UnSetInsert(void)
{
insertIsSet = false;
}
void globals::ToggleInsert(void)
{
if (true==insertIsSet) {
insertIsSet = false;
} else {
insertIsSet = true;
}
}
bool globals::IsSetInsert(void)
{
return insertIsSet;
}

View File

@ -1,68 +0,0 @@
/**
*******************************************************************************
* @file tools_globals.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 "tools_debug.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 IsSetAutoIndent(void);
void SetAutoIndent(bool newVal);
void init2(void);
void SetShift(void);
void UnSetShift(void);
bool IsSetShift(void);
void SetAlt(void);
void UnSetAlt(void);
bool IsSetAlt(void);
void SetCtrl(void);
void UnSetCtrl(void);
bool IsSetCtrl(void);
void SetPomme(void);
void UnSetPomme(void);
bool IsSetPomme(void);
void SetInsert(void);
void UnSetInsert(void);
void ToggleInsert(void);
bool IsSetInsert(void);
}
#endif

View File

@ -1,93 +0,0 @@
/**
*******************************************************************************
* @file toolsmemory.h
* @brief Editeur De N'ours : Memory implementation (headers)
* @author Edouard DUPIN
* @date 12/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 __TOOLS_MEMORY_H__
#define __TOOLS_MEMORY_H__
// General
#if EDN_MEMORY_CHECKER > 0
void EDN_MemFree( void * pointerData, const char * variableName, const char * functionName, int32_t line, const char * fileName );
void * EDN_MemMalloc( size_t num, size_t size, uint8_t init, const char * variableName, const char * functionName, int32_t line, const char * fileName );
void EDN_MemShowLogs( void );
# define EDN_MALLOC(pointerData, nbElements, dataType) do { \
pointerData = (dataType *)EDN_MemMalloc( (nbElements), sizeof(dataType), 0, #pointerData, __func__, __LINE__, __FILE__); \
}while(0)
# define EDN_MALLOC_CAST(pointerData, nbElements, dataType, cast) do { \
pointerData = (cast)EDN_MemMalloc( (nbElements), sizeof(dataType), 0, #pointerData, __func__, __LINE__, __FILE__); \
}while(0)
# define EDN_CALLOC(pointerData, nbElements, dataType) do { \
pointerData = (dataType *)EDN_MemMalloc( (nbElements), sizeof(dataType), 1, #pointerData, __func__, __LINE__, __FILE__); \
}while(0)
# define EDN_CALLOC_CAST(pointerData, nbElements, dataType, cast) do { \
pointerData = (cast)EDN_MemMalloc( (nbElements), sizeof(dataType), 1, #pointerData, __func__, __LINE__, __FILE__); \
}while(0)
# define EDN_FREE(pointerData) do { \
EDN_MemFree( (pointerData) , #pointerData, __func__, __LINE__, __FILE__); \
(pointerData) = NULL; \
}while(0)
# define EDN_MEM_SHOW_LOG() do { \
EDN_MemShowLogs(); \
}while(0)
#else
# define EDN_MALLOC(pointerData, nbElements, dataType) do { \
(pointerData) = (dataType *)malloc( (nbElements) * sizeof(dataType) ); \
}while(0)
# define EDN_MALLOC_CAST(pointerData, nbElements, dataType, cast) do { \
(pointerData) = (cast)malloc( (nbElements) * sizeof(dataType) ); \
}while(0)
# define EDN_CALLOC(pointerData, nbElements, dataType) do { \
(pointerData) = (dataType *)calloc( (nbElements), sizeof(dataType) ); \
}while(0)
# define EDN_CALLOC_CAST(pointerData, nbElements, dataType, cast) do { \
(pointerData) = (cast)calloc( (nbElements), sizeof(dataType) ); \
}while(0)
# define EDN_REALLOC(pointerData, nbElements, dataType) do { \
(pointerData) = (dataType *)realloc( (pointerData), (nbElements)* sizeof(dataType) ); \
}while(0)
# define EDN_REALLOC_CAST(pointerData, nbElements, dataType, cast) do { \
(pointerData) = (cast)realloc( (pointerData), (nbElements) * sizeof(dataType) ); \
}while(0)
# define EDN_FREE(pointerData) do { \
free( pointerData ); \
(pointerData) = NULL; \
}while(0)
# define EDN_MEM_SHOW_LOG() do { \
sup_system_diag("No Memory check availlable"); \
}while(0)
#endif
#endif

View File

@ -1,116 +0,0 @@
/*
www.sourceforge.net/projects/tinyxml
Original file by Yves Berquin.
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
/*
* THIS FILE WAS ALTERED BY Tyge Løvset, 7. April 2005.
*/
#ifndef TIXML_USE_STL
#include "tinystr.h"
// Error value for find primitive
const TiXmlString::size_type TiXmlString::npos = static_cast< TiXmlString::size_type >(-1);
// Null rep.
TiXmlString::Rep TiXmlString::nullrep_ = { 0, 0, { '\0' } };
void TiXmlString::reserve (size_type cap)
{
if (cap > capacity())
{
TiXmlString tmp;
tmp.init(length(), cap);
memcpy(tmp.start(), data(), length());
swap(tmp);
}
}
TiXmlString& TiXmlString::assign(const char* str, size_type len)
{
size_type cap = capacity();
if (len > cap || cap > 3*(len + 8))
{
TiXmlString tmp;
tmp.init(len);
memcpy(tmp.start(), str, len);
swap(tmp);
}
else
{
memmove(start(), str, len);
set_size(len);
}
return *this;
}
TiXmlString& TiXmlString::append(const char* str, size_type len)
{
size_type newsize = length() + len;
if (newsize > capacity())
{
reserve (newsize + capacity());
}
memmove(finish(), str, len);
set_size(newsize);
return *this;
}
TiXmlString operator + (const TiXmlString & a, const TiXmlString & b)
{
TiXmlString tmp;
tmp.reserve(a.length() + b.length());
tmp += a;
tmp += b;
return tmp;
}
TiXmlString operator + (const TiXmlString & a, const char* b)
{
TiXmlString tmp;
TiXmlString::size_type b_len = static_cast<TiXmlString::size_type>( strlen(b) );
tmp.reserve(a.length() + b_len);
tmp += a;
tmp.append(b, b_len);
return tmp;
}
TiXmlString operator + (const char* a, const TiXmlString & b)
{
TiXmlString tmp;
TiXmlString::size_type a_len = static_cast<TiXmlString::size_type>( strlen(a) );
tmp.reserve(a_len + b.length());
tmp.append(a, a_len);
tmp += b;
return tmp;
}
#endif // TIXML_USE_STL

View File

@ -1,319 +0,0 @@
/*
www.sourceforge.net/projects/tinyxml
Original file by Yves Berquin.
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
/*
* THIS FILE WAS ALTERED BY Tyge Lovset, 7. April 2005.
*
* - completely rewritten. compact, clean, and fast implementation.
* - sizeof(TiXmlString) = pointer size (4 bytes on 32-bit systems)
* - fixed reserve() to work as per specification.
* - fixed buggy compares operator==(), operator<(), and operator>()
* - fixed operator+=() to take a const ref argument, following spec.
* - added "copy" constructor with length, and most compare operators.
* - added swap(), clear(), size(), capacity(), operator+().
*/
#ifndef TIXML_USE_STL
#ifndef TIXML_STRING_INCLUDED
#define TIXML_STRING_INCLUDED
#include <assert.h>
#include <string.h>
/* The support for explicit isn't that universal, and it isn't really
required - it is used to check that the TiXmlString class isn't incorrectly
used. Be nice to old compilers and macro it here:
*/
#if defined(_MSC_VER) && (_MSC_VER >= 1200 )
// Microsoft visual studio, version 6 and higher.
#define TIXML_EXPLICIT explicit
#elif defined(__GNUC__) && (__GNUC__ >= 3 )
// GCC version 3 and higher.s
#define TIXML_EXPLICIT explicit
#else
#define TIXML_EXPLICIT
#endif
/*
TiXmlString is an emulation of a subset of the std::string template.
Its purpose is to allow compiling TinyXML on compilers with no or poor STL support.
Only the member functions relevant to the TinyXML project have been implemented.
The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase
a string and there's no more room, we allocate a buffer twice as big as we need.
*/
class TiXmlString
{
public :
// The size type used
typedef size_t size_type;
// Error value for find primitive
static const size_type npos; // = -1;
// TiXmlString empty constructor
TiXmlString () : rep_(&nullrep_)
{
}
// TiXmlString copy constructor
TiXmlString ( const TiXmlString & copy) : rep_(0)
{
init(copy.length());
memcpy(start(), copy.data(), length());
}
// TiXmlString constructor, based on a string
TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(0)
{
init( static_cast<size_type>( strlen(copy) ));
memcpy(start(), copy, length());
}
// TiXmlString constructor, based on a string
TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(0)
{
init(len);
memcpy(start(), str, len);
}
// TiXmlString destructor
~TiXmlString ()
{
quit();
}
// = operator
TiXmlString& operator = (const char * copy)
{
return assign( copy, (size_type)strlen(copy));
}
// = operator
TiXmlString& operator = (const TiXmlString & copy)
{
return assign(copy.start(), copy.length());
}
// += operator. Maps to append
TiXmlString& operator += (const char * suffix)
{
return append(suffix, static_cast<size_type>( strlen(suffix) ));
}
// += operator. Maps to append
TiXmlString& operator += (char single)
{
return append(&single, 1);
}
// += operator. Maps to append
TiXmlString& operator += (const TiXmlString & suffix)
{
return append(suffix.data(), suffix.length());
}
// Convert a TiXmlString into a null-terminated char *
const char * c_str () const { return rep_->str; }
// Convert a TiXmlString into a char * (need not be null terminated).
const char * data () const { return rep_->str; }
// Return the length of a TiXmlString
size_type length () const { return rep_->size; }
// Alias for length()
size_type size () const { return rep_->size; }
// Checks if a TiXmlString is empty
bool empty () const { return rep_->size == 0; }
// Return capacity of string
size_type capacity () const { return rep_->capacity; }
// single char extraction
const char& at (size_type index) const
{
assert( index < length() );
return rep_->str[ index ];
}
// [] operator
char& operator [] (size_type index) const
{
assert( index < length() );
return rep_->str[ index ];
}
// find a char in a string. Return TiXmlString::npos if not found
size_type find (char lookup) const
{
return find(lookup, 0);
}
// find a char in a string from an offset. Return TiXmlString::npos if not found
size_type find (char tofind, size_type offset) const
{
if (offset >= length()) return npos;
for (const char* p = c_str() + offset; *p != '\0'; ++p)
{
if (*p == tofind) return static_cast< size_type >( p - c_str() );
}
return npos;
}
void clear ()
{
//Lee:
//The original was just too strange, though correct:
// TiXmlString().swap(*this);
//Instead use the quit & re-init:
quit();
init(0,0);
}
/* Function to reserve a big amount of data when we know we'll need it. Be aware that this
function DOES NOT clear the content of the TiXmlString if any exists.
*/
void reserve (size_type cap);
TiXmlString& assign (const char* str, size_type len);
TiXmlString& append (const char* str, size_type len);
void swap (TiXmlString& other)
{
Rep* r = rep_;
rep_ = other.rep_;
other.rep_ = r;
}
private:
void init(size_type sz) { init(sz, sz); }
void set_size(size_type sz) { rep_->str[ rep_->size = sz ] = '\0'; }
char* start() const { return rep_->str; }
char* finish() const { return rep_->str + rep_->size; }
struct Rep
{
size_type size, capacity;
char str[1];
};
void init(size_type sz, size_type cap)
{
if (cap)
{
// Lee: the original form:
// rep_ = static_cast<Rep*>(operator new(sizeof(Rep) + cap));
// doesn't work in some cases of new being overloaded. Switching
// to the normal allocation, although use an 'int' for systems
// that are overly picky about structure alignment.
const size_type bytesNeeded = sizeof(Rep) + cap;
const size_type intsNeeded = ( bytesNeeded + sizeof(int) - 1 ) / sizeof( int );
rep_ = reinterpret_cast<Rep*>( new int[ intsNeeded ] );
rep_->str[ rep_->size = sz ] = '\0';
rep_->capacity = cap;
}
else
{
rep_ = &nullrep_;
}
}
void quit()
{
if (rep_ != &nullrep_)
{
// The rep_ is really an array of ints. (see the allocator, above).
// Cast it back before delete, so the compiler won't incorrectly call destructors.
delete [] ( reinterpret_cast<int*>( rep_ ) );
}
}
Rep * rep_;
static Rep nullrep_;
} ;
inline bool operator == (const TiXmlString & a, const TiXmlString & b)
{
return ( a.length() == b.length() ) // optimization on some platforms
&& ( strcmp(a.c_str(), b.c_str()) == 0 ); // actual compare
}
inline bool operator < (const TiXmlString & a, const TiXmlString & b)
{
return strcmp(a.c_str(), b.c_str()) < 0;
}
inline bool operator != (const TiXmlString & a, const TiXmlString & b) { return !(a == b); }
inline bool operator > (const TiXmlString & a, const TiXmlString & b) { return b < a; }
inline bool operator <= (const TiXmlString & a, const TiXmlString & b) { return !(b < a); }
inline bool operator >= (const TiXmlString & a, const TiXmlString & b) { return !(a < b); }
inline bool operator == (const TiXmlString & a, const char* b) { return strcmp(a.c_str(), b) == 0; }
inline bool operator == (const char* a, const TiXmlString & b) { return b == a; }
inline bool operator != (const TiXmlString & a, const char* b) { return !(a == b); }
inline bool operator != (const char* a, const TiXmlString & b) { return !(b == a); }
TiXmlString operator + (const TiXmlString & a, const TiXmlString & b);
TiXmlString operator + (const TiXmlString & a, const char* b);
TiXmlString operator + (const char* a, const TiXmlString & b);
/*
TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString.
Only the operators that we need for TinyXML have been developped.
*/
class TiXmlOutStream : public TiXmlString
{
public :
// TiXmlOutStream << operator.
TiXmlOutStream & operator << (const TiXmlString & in)
{
*this += in;
return *this;
}
// TiXmlOutStream << operator.
TiXmlOutStream & operator << (const char * in)
{
*this += in;
return *this;
}
} ;
#endif // TIXML_STRING_INCLUDED
#endif // TIXML_USE_STL

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,52 +0,0 @@
/*
www.sourceforge.net/projects/tinyxml
Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#include "tinyxml.h"
// The goal of the seperate error file is to make the first
// step towards localization. tinyxml (currently) only supports
// english error messages, but the could now be translated.
//
// It also cleans up the code a bit.
//
const char* TiXmlBase::errorString[ TIXML_ERROR_STRING_COUNT ] =
{
"No error",
"Error",
"Failed to open file",
"Error parsing Element.",
"Failed to read Element name",
"Error reading Element value.",
"Error reading Attributes.",
"Error: empty tag.",
"Error reading end tag.",
"Error parsing Unknown.",
"Error parsing Comment.",
"Error parsing Declaration.",
"Error document empty.",
"Error null (0) or unexpected EOF found in input stream.",
"Error parsing CDATA.",
"Error when TiXmlDocument added to document, because TiXmlDocument can only be at the root.",
};

File diff suppressed because it is too large Load Diff

View File

@ -1,131 +0,0 @@
# For the first realease 1.0 :
* Systèmes :
- Affichage ligne par ligne
- Correction du bug de hl(sub patern empty)
- Verifier si le hldisplay reaserch marche avec l'id et pas l'id-1
- Gestion correct des charsets
* Gui :
- Confirmer avant de fermer
- Demander de sauver
- Controle des droits
- Hl-gui management
- Event quand un fichier ouvert a changer
- Affichage des fichiers binaires
- Ctags phase 1
- Project manager phase 1
# action a faire (ordonner par révision) :
* 0.2.X :
- gui : Amelioration du full-screen et du display de base (sans l'entete de la fenetre)
- gui : Mise en place d'un display ligne par ligne
- gui : ascenceur quand nécessaire
- 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
- Catch Shift+TAB
- Correction du bug des entré bizard tel que les chapot et les guillemets
- pb de sélection quand la ligne est pleine et la première ligne séctionnée.
- PB de copier coller sur les éàè ...
- PB sur le caplock et les caractère multiples type chapot ...
- PB du entrer sur le kaypad qui fait un <CR> ==> ajouter la fonction shift+enter qui cree un <CR>
- catch F[1-12] ==> for user function
* 0.3.X :
- Charset UTF-8 et iso 8859-15 correcte
- Transformation de charset a la volée
- Charset par defaut
- Détection de charset (à mettre dans les todo de charset)
==> regarder les librairies open sources
* 0.4.X :
- SEARCH : get selected text in the search windows
- SEARCH : Select the search windows when call crtl+F
- gui : ordonner les fichier ouvert par nom ...
* 0.5.X :
- project : list of current files open
- gui : Parameters : et en autre la taille de la police ... et voir pour la récupérer sur le system... et ce serait cool...
- sys : replace ALL
# Text Editor
- 90% Indent group with Tabulation and shift+tabulation
- 100% Basic smart indent : Recopy the start of the previous line when return (copy '\t' and ' ')
- 0% Replace Tab with space when press the key
- 0% Request save user when quit the software
- 0% Hide/Display scroll element when not usefull
- 10% Regular expression search
- 80% Colorisation syntaxique
- 80% Copier / coller ==> probleme sur les caractères spéciaux comme ° é à ...
- 10% Search
- 10% Replace
- 80% Undo / Redo ajout de caractères autre que " ", "\t" et "\n"
- 0% Selectionner en colone
- 0% Supression multiple de ligne par la commande ctrl+D
- 0% Multi-file search ==> display it in a result buffer (clickable only)
- 0% basic UTF8 string management ==> bad with the curent buffer
- 0% Replace in all elements of the project file or a part
- 0% Multiple Text Editor in the same Time
- 0% Support des Macros ==> In python ??? or other ...
# Ctags :
- 100% Parse (use the ctags parser)
- 100% Find
- 50% Jump
- 10% History of move (with display)
# Buffer Viewer :
- 100% Right menu
- 100% Display buffer in color
- 100% Display buffer Saved / not Saved
- 0% Image of the type of buffer (optionnal)
# Configuration :
- 0% Creer une IHM pour les configurations de base
- 0% Creer une IHM pour l'edition du hightliner syntaxique (quand il marchera...)
- 0% Creer une IHM pour les couleurs (voir la lier avec l'IHM pour le hightliner)
- 0% saugegarde automatique de la configuration ou sur demande...
# Project manager :
- 0% Faire un editeur des dossiers du projet a ouvrir ==> automatiquement ajouter dans les Ctags
- 0% Base
- 0% Save All
- 0% TreeView
# Tree View :
- 0% View
- 0% Open File
- 0% Jump to the curent File
- 0% Hide CVS / Git / SVN elements
# Diff :
- 0% generate a Diff between files
- 0% same in binary
# Git :
- 0% Diff with the current wersion commited (local)
- 0% Git branch local display (as gitk --all) ...
- 0% view git chawan history ... (git Log)
# CVS :
- 0% check the version with CVS
- 0% commit
- 0% display the Branch
- 0% Select a new repository ...
# Publication :
- 0% faire une publication du logiciel sur le Web... (need a stable version)
- 0% faire un package
# Repository :
- 0% create my own repository (@home)
- 0% manage right with Git
- 0% create a website fot it (@home)
- 0% reserve edn.org
# plugin : (never i think ...)
- 0% Comprendre comment faire un system avec des plugin (interne et simple)...
- 0% En c++ compiler seulement, pas d'interface pyton ou autre c'est trop moche.
# note utiles :
http://majutsushi.github.com/tagbar/ ==> je devrais regarder ca pour savoir ce que je peux faire avec du ctags
CTags : Set the parsing methode : "ctags -R --fields=+n Sources/"

69
avancement.txt Normal file
View File

@ -0,0 +1,69 @@
# action a faire (ordonner par révision) :
dans la liste des truc important a refaire
finir de netoyer la classe widget
netoyer les classe text ...
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 ...
==> 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
- sys : Mise en place des colorisation de base pour le
* java script
* SQL
- BUG : de copier coller sur les éàè è ...
- BUG : les caractère multiples type chapot ...
- 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
- 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
- sys : replace ALL
- sys : Undo / Redo ajout de caractères autre que " ", "\t" et "\n"
- sys : right management ...
- HL : Normalyse all the system of regular expression with <> chapot ...
- HL : sub parsing of the reg exp
- sys : update all language
- 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)
- int : Redo all the doxygen ...
- gui : open file in binary
- sys : compare binary files
- sys : compare normal files
- 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
- PRJ : treeview des dossier a ouvrir
- PRJ : GUI de management
- PRJ : Save all in project
- SYS : Save all modify files
- sys : version system management (git, cvs, ...)
- SYS : Macro generation and acquisition
- GDB : Acces interne pour un debuggeur ==> comme cgdb ... avec l'acces assembleur en plus
# note utiles :
http://majutsushi.github.com/tagbar/ ==> je devrais regarder ca pour savoir ce que je peux faire avec du ctags
CTags : Set the parsing methode : "ctags -R --fields=+n jni ../ewol/Sources/"

3
ctags.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
ctags -R --fields=+n jni/ ../../../../usr/include/freetype2 ../ewol/

BIN
data/Font/ACharmingFont.ttf Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

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