80 Commits
0.3.0 ... 0.3.5

Author SHA1 Message Date
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
159 changed files with 6049 additions and 9642 deletions

5
.gitignore vendored
View File

@@ -4,9 +4,14 @@
###################################
CVS
.svn
.gitk-tmp.*
Object/
doxygen/API/
doxygen/ALL/
bin/
gen/
linux/
obj/
###################################
# backup files

22
AndroidManifest.xml Normal file
View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.heeroyui.ednpackage"
android:versionCode="1"
android:versionName="1.0">
<application android:label="Edn"
android:icon="@drawable/ic_luncher_edn">
<!--android:hasCode="false"-->
<!-- classpath-->
<activity android:name=".edn"
android:label="Edn Text-Editor"
android:icon="@drawable/ic_luncher_edn"
android:configChanges="orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="4" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>

2
Application.mk Normal file
View File

@@ -0,0 +1,2 @@
APP_BUILD_SCRIPT=$PROJECT/Sources/Android.mk

View File

@@ -3,57 +3,11 @@
### Some Preject properties : ###
###############################################################################
PROJECT_PATH=$(shell pwd)
ifeq ($(PLATFORM), Linux)
PROJECT_NDK?=$(PROJECT_PATH)/../ewol/
else ifeq ($(PLATFORM), Android)
PROJECT_NDK?=$(PROJECT_PATH)/../android/ndk-r7/
PROJECT_SDK?=$(PROJECT_PATH)/../android/sdk-r15/
endif
PROJECT_MODULE?=$(PROJECT_PATH)/../
EWOL_FOLDER=$(PROJECT_MODULE)ewol
# group name or constructor ... (no dot, no MAJ no Numerical char)
PROJECT_VENDOR=heeroyui
# Binary name ... (no dot, no MAJ no Numerical char)
PROJECT_NAME=edn
#dependence of the librairies :
#PROJECT_LIB_DEPENDENCY= ewol
PROJECT_FILE_DIRECTORY=jni
# get the tag of the current project :
PROJECT_VERSION_TAG=$(shell git describe --tags)
#$(info Project version TAG : $(PROJECT_VERSION_TAG))
PROJECT_VERSION_TAG_SHORT=$(shell git describe --tags --abbrev=0)
#$(info Project version TAG Short: $(PROJECT_VERSION_TAG_SHORT))
# enable or disable debug :
DEBUG:=1
###############################################################################
### Compilation Define ###
###############################################################################
ifeq ("$(DEBUG)", "0")
PROJECT_CXXFLAGS = -DPROJECT_DEBUG_LEVEL=1
PROJECT_CXXFLAGS+= -DPROJECT_NDEBUG
PROJECT_CXXFLAGS+= -DPROJECT_VERSION_TAG_NAME="\"$(VERSION_TAG)-release\""
else
PROJECT_CXXFLAGS = -DPROJECT_DEBUG_LEVEL=3
PROJECT_CXXFLAGS+= -DPROJECT_VERSION_TAG_NAME="\"$(VERSION_TAG)-debug\""
endif
PROJECT_CXXFLAGS+= -DPROJECT_VERSION_BUILD_TIME="\"$(VERSION_BUILD_TIME)\""
PROJECT_CXXFLAGS+= -I$(EWOL_FOLDER)/Sources/
PROJECT_LDFLAGS= -L$(EWOL_FOLDER)
#include the specific platefom makefile
include $(EWOL_FOLDER)/Build/Makefile.$(PLATFORM).mk
# include basic makefile for EWOL
include $(shell pwd)/../ewol/Build/Makefile.mk

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

View File

@@ -1,129 +0,0 @@
name:Monospace
source:Monospace.bmp
#comment line ...
# size 54 largeur 33 space between letter 12
# unknow UTF8 code of the letter and start coordonate and size ==> 0x54 (33,45) (33,54)
0x00 (99,453) (33,54) # Error : Unknow the UTF8 element ...
# hexa UTF8 code of the letter and start coordonate and size ==> 0x54 (33,45) (33,54)
# ABCDEFGHIJKLMN
0x20 (0,7) (33,54) # space ...
0x41 (33,7) (33,54) # A
0x42 (66,7) (33,54) # B
0x43 (99,7) (33,54) # C
0x44 (132,7) (33,54) # D
0x45 (165,7) (33,54) # E
0x46 (198,7) (33,54) # F
0x47 (231,7) (33,54) # G
0x48 (264,7) (33,54) # H
0x49 (297,7) (33,54) # I
0x4A (330,7) (33,54) # J
0x4B (363,7) (33,54) # K
0x4C (396,7) (33,54) # L
0x4D (429,7) (33,54) # M
0x4E (462,7) (33,54) # N
#OPQRSTUVWXYZabc
0x4F (0,71) (33,54) # O
0x50 (33,71) (33,54) # P
0x51 (66,71) (33,54) # Q
0x52 (99,71) (33,54) # R
0x53 (132,71) (33,54) # S
0x54 (165,71) (33,54) # T
0x55 (198,71) (33,54) # U
0x56 (231,71) (33,54) # V
0x57 (264,71) (33,54) # W
0x58 (297,71) (33,54) # X
0x59 (330,71) (33,54) # Y
0x5A (363,71) (33,54) # Z
0x61 (396,71) (33,54) # a
0x62 (429,71) (33,54) # b
0x63 (462,71) (33,54) # c
#defghijklmnopqr
0x64 (0,135) (33,54) # d
0x65 (33,135) (33,54) # e
0x66 (66,135) (33,54) # f
0x67 (99,135) (33,54) # g
0x68 (132,135) (33,54) # h
0x69 (165,135) (33,54) # i
0x6A (198,135) (33,54) # j
0x6B (231,135) (33,54) # k
0x6C (264,135) (33,54) # l
0x6D (297,135) (33,54) # m
0x6E (330,135) (33,54) # n
0x6F (363,135) (33,54) # o
0x70 (396,135) (33,54) # p
0x71 (429,135) (33,54) # q
0x72 (462,135) (33,54) # r
#stuvwxyz1234567
0x73 (0,199) (33,54) # s
0x74 (33,199) (33,54) # t
0x75 (66,199) (33,54) # u
0x76 (99,199) (33,54) # v
0x77 (132,199) (33,54) # w
0x78 (165,199) (33,54) # x
0x79 (198,199) (33,54) # y
0x7A (231,199) (33,54) # z
0x31 (264,199) (33,54) # 1
0x32 (297,199) (33,54) # 2
0x33 (330,199) (33,54) # 3
0x34 (363,199) (33,54) # 4
0x35 (396,199) (33,54) # 5
0x36 (429,199) (33,54) # 6
0x37 (462,199) (33,54) # 7
#890&<26>~"#'{([-|<7C>
0x38 (0,263) (33,54) # 8
0x39 (33,263) (33,54) # 9
0x30 (66,263) (33,54) # 0
0x26 (99,263) (33,54) # &
#0x (132,263) (33,54) # <20>
0x7E (165,263) (33,54) # ~
0x22 (198,263) (33,54) # "
0x23 (231,263) (33,54) # #
0x27 (264,263) (33,54) # '
0x7B (297,263) (33,54) # {
0x28 (330,263) (33,54) # (
0x5B (363,263) (33,54) # [
0x2D (396,263) (33,54) # -
0x7C (429,263) (33,54) # |
#0x (462,263) (33,54) # <20>
#`_\<5C>^<5E>@)]=}
0x60 (0,335) (33,54) # `
0x5F (33,335) (33,54) # _
0x5C (66,335) (33,54) # \
#0x (99,335) (33,54) # <20>
0x5E (132,335) (33,54) # ^
#0x (165,335) (33,54) # <20>
0x40 (198,335) (33,54) # @
0x29 (231,335) (33,54) # )
0x5D (264,335) (33,54) # ]
0x3D (297,335) (33,54) # =
0x7D (330,335) (33,54) # }
#0x (363,335) (33,54) # o chap
#0x (396,335) (33,54) # u chap
#0x (429,335) (33,54) # e chap
#0x (462,335) (33,54) # a chap
#$<24>*<2A>%!<21>:/
#0x (0,391) (33,54) # i chap
#0x (33,391) (33,54) # o trema
#0x (66,391) (33,54) # u trema
#0x (99,391) (33,54) # e trema
#0x (132,391) (33,54) # a trema
0x24 (165,391) (33,54) # $
#0x (198,391) (33,54) # <20>
0x2A (231,391) (33,54) # *
#0x (264,391) (33,54) # <20>
#0x (297,391) (33,54) # <20>
0x25 (330,391) (33,54) # %
0x21 (363,391) (33,54) # !
#0x (396,391) (33,54) # <20>
0x3A (429,391) (33,54) # :
0x2F (462,391) (33,54) # /
#;.,?<><3E>!+
0x3B (0,453) (33,54) # ;
0x2E (33,453) (33,54) # .
0x2C (66,453) (33,54) # ,
0x3F (99,453) (33,54) # ?
0x3C (132,453) (33,54) # <
0x3E (165,453) (33,54) # >
#0x (198,453) (33,54) # <20>
#0x21 (231,453) (33,54) # ! ==> doublon ...
0x2B (264,453) (33,54) # +

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

7
assets/icon/Add.svg Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2,0,0,1.2,-579.7336,-567.9832)">
<path d="m 509.778,477.486 c -12.426,0 -22.5,10.072 -22.5,22.5 0,12.426 10.074,22.5 22.5,22.5 12.428,0 22.5,-10.074 22.5,-22.5 0,-12.427 -10.072,-22.5 -22.5,-22.5 z m 11.5,25 c 0,0.549 -0.451,1 -1,1 h -6 c -0.551,0 -1.001,0.449 -1.001,1 v 6 c 0,0.549 -0.45,1 -1,1 h -5 c -0.55,0 -1,-0.451 -1,-1 v -6 c 0,-0.551 -0.45,-1 -1,-1 h -6 c -0.55,0 -1,-0.451 -1,-1 v -5 c 0,-0.551 0.45,-1 1,-1 h 6 c 0.55,0 1,-0.451 1,-1 v -6 c 0,-0.551 0.45,-1 1,-1 h 5 c 0.55,0 1,0.449 1,1 v 6 c 0,0.549 0.45,1 1.001,1 h 6 c 0.549,0 1,0.449 1,1 v 5 z"
style="fill:#333333;fill-rule:evenodd" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 735 B

11
assets/icon/AtoZ.svg Normal file
View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2,0,0,1.2,-651.9616,-494.5316)">
<path d="m 562.663,451.271 -1.24,-3.193 h -0.188 c -0.463,0.631 -0.926,1.174 -1.389,1.629 -0.463,0.457 -0.967,0.832 -1.514,1.125 -0.547,0.295 -1.16,0.512 -1.838,0.65 -0.682,0.143 -1.469,0.211 -2.365,0.211 -0.953,0 -1.836,-0.148 -2.648,-0.455 -0.813,-0.299 -1.516,-0.756 -2.111,-1.361 -0.596,-0.611 -1.061,-1.381 -1.396,-2.314 -0.336,-0.932 -0.506,-2.035 -0.506,-3.311 0,-2.494 0.799,-4.332 2.396,-5.518 1.598,-1.184 3.986,-1.838 7.168,-1.965 l 3.74,-0.125 v -1.766 c 0,-0.967 -0.279,-1.682 -0.842,-2.145 -0.559,-0.461 -1.344,-0.693 -2.354,-0.693 -1.01,0 -1.994,0.146 -2.953,0.441 -0.959,0.295 -1.924,0.688 -2.891,1.178 l -2.08,-4.246 c 1.178,-0.658 2.48,-1.177 3.908,-1.554 1.43,-0.379 2.93,-0.568 4.498,-0.568 2.93,0 5.174,0.688 6.736,2.06 1.563,1.373 2.344,3.461 2.344,6.264 v 15.658 h -4.477 v -0.002 z m -1.891,-10.887 -2.123,0.084 c -0.854,0.027 -1.578,0.141 -2.164,0.336 -0.59,0.195 -1.063,0.457 -1.42,0.787 -0.357,0.33 -0.615,0.721 -0.777,1.178 -0.16,0.455 -0.24,0.963 -0.24,1.523 0,0.98 0.238,1.678 0.713,2.092 0.477,0.412 1.102,0.619 1.871,0.619 0.59,0 1.135,-0.102 1.641,-0.305 0.504,-0.203 0.941,-0.504 1.313,-0.902 0.373,-0.4 0.662,-0.891 0.873,-1.471 0.211,-0.582 0.314,-1.252 0.314,-2.01 v -1.931 l -10e-4,0 z"
style="fill:#333333" />
<path d="m 568.976,440.552 v -4.244 h 9.549 v 4.244 h -9.549 z"
style="fill:#333333" />
<path d="m 592.468,451.241 h -17.279 v -3.785 l 9.607,-14.816 h -8.953 v -4.896 h 16.225 v 4.159 l -9.289,14.441 h 9.689 v 4.897 z"
style="fill:#333333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

7
assets/icon/Attache.svg Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.199923,0,0,1.199923,-436.75556,-134.85476)">
<path d="m 374.192,161.556 c -1.619,0 -3.152,-0.607 -4.269,-1.707 -1.237,-1.221 -1.877,-2.961 -1.755,-4.776 l 0.501,-7.477 c 0.198,-2.952 1.959,-6.933 4.009,-9.065 l 20.588,-21.415 c 0.854,-0.89 2.268,-0.916 3.154,-0.063 0.886,0.853 0.916,2.266 0.063,3.154 l -20.589,21.416 c -1.347,1.401 -2.644,4.331 -2.772,6.271 l -0.502,7.477 c -0.035,0.526 0.119,0.988 0.436,1.3 0.317,0.312 0.776,0.465 1.306,0.417 l 6.095,-0.496 c 1.936,-0.158 4.842,-1.497 6.219,-2.865 l 21.382,-21.251 c 0.413,-0.411 0.64,-0.957 0.637,-1.537 -0.005,-0.58 -0.236,-1.123 -0.655,-1.529 l -4.043,-3.92 c -0.874,-0.847 -2.334,-0.832 -3.189,0.037 l -16.287,16.555 c -0.512,0.521 -0.809,1.177 -0.794,1.759 0.007,0.303 0.097,0.537 0.268,0.693 0.524,0.485 1.872,0.332 2.826,-0.589 l 12.685,-12.247 c 0.886,-0.856 2.297,-0.831 3.154,0.056 0.855,0.886 0.83,2.298 -0.057,3.153 l -12.684,12.248 c -2.605,2.517 -6.623,2.811 -8.952,0.656 -1.06,-0.979 -1.664,-2.352 -1.7,-3.865 -0.043,-1.788 0.713,-3.608 2.072,-4.992 l 16.289,-16.556 c 2.582,-2.623 6.83,-2.675 9.475,-0.111 l 4.043,3.92 c 1.285,1.246 2,2.917 2.01,4.705 0.012,1.788 -0.682,3.467 -1.952,4.729 l -21.382,21.25 c -2.098,2.086 -6.053,3.907 -9.002,4.148 l -6.094,0.496 c -0.18,0.013 -0.358,0.021 -0.534,0.021 l 0,0 z"
style="fill:#333333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

9
assets/icon/Close.svg Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2,0,0,1.2,-579.7336,-495.3904)">
<path d="m 514.172,439.484 4.041,-4.041 c 0.26,-0.26 0.404,-0.605 0.404,-0.975 0,-0.371 -0.143,-0.717 -0.404,-0.977 l -2.441,-2.443 c -0.521,-0.521 -1.434,-0.52 -1.949,0 l -4.044,4.043 -4.043,-4.043 c -0.52,-0.52 -1.429,-0.52 -1.949,0 l -2.443,2.443 c -0.26,0.26 -0.402,0.605 -0.402,0.975 0,0.37 0.143,0.717 0.402,0.977 l 4.043,4.041 -4.041,4.041 c -0.261,0.26 -0.404,0.605 -0.404,0.975 0,0.371 0.143,0.717 0.402,0.979 l 2.444,2.443 c 0.521,0.52 1.429,0.52 1.95,-0.002 l 4.041,-4.041 4.042,4.041 c 0.26,0.26 0.605,0.404 0.975,0.404 0.37,0 0.715,-0.145 0.975,-0.404 l 2.441,-2.439 c 0.262,-0.262 0.406,-0.609 0.406,-0.98 0,-0.369 -0.145,-0.717 -0.404,-0.973 l -4.042,-4.044 z"
style="fill:#333333" />
<path d="m 509.778,425.027 c 7.976,0 14.464,6.488 14.464,14.465 0,7.975 -6.488,14.463 -14.464,14.463 -7.975,0 -14.464,-6.488 -14.464,-14.463 0,-7.976 6.489,-14.465 14.464,-14.465 m 0,-8.035 c -12.426,0 -22.5,10.073 -22.5,22.5 0,12.426 10.074,22.5 22.5,22.5 12.427,0 22.5,-10.074 22.5,-22.5 -10e-4,-12.428 -10.073,-22.5 -22.5,-22.5 l 0,0 z"
style="fill:#333333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

14
assets/icon/Contact.svg Normal file
View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.1999733,0,0,1.1999733,-436.77498,-206.48907)">
<path d="m 412.51,211.853 c 0.354,0.375 0.645,0.26 0.645,-0.256 v -24.754 c 0,-0.516 -0.321,-0.664 -0.714,-0.329 l -12.536,10.671 c -0.394,0.334 -0.425,0.914 -0.07,1.289 l 12.675,13.379 z"
style="fill:#333333" />
<path d="m 410.761,184.249 c 0.394,-0.334 0.292,-0.607 -0.223,-0.607 h -40.092 c -0.515,0 -0.614,0.271 -0.219,0.602 l 19.701,16.524 c 0.396,0.331 1.041,0.329 1.434,-0.006 l 19.399,-16.513 z"
style="fill:#333333" />
<path d="m 368.154,211.597 c 0,0.516 0.29,0.631 0.645,0.256 l 12.625,-13.326 c 0.354,-0.375 0.321,-0.951 -0.074,-1.283 l -12.477,-10.465 c -0.396,-0.332 -0.719,-0.181 -0.719,0.335 v 24.483 z"
style="fill:#333333" />
<path d="m 392.28,203.674 c -0.393,0.335 -0.979,0.759 -1.302,0.943 0,0 0,0 -0.324,0 -0.321,0 -0.321,0 -0.321,0 -0.32,-0.181 -0.905,-0.6 -1.301,-0.931 l -4.086,-3.428 c -0.396,-0.332 -1.009,-0.297 -1.363,0.078 l -12.847,13.561 c -0.354,0.375 -0.223,0.682 0.293,0.682 h 39.25 c 0.516,0 0.647,-0.307 0.293,-0.682 l -12.883,-13.599 c -0.354,-0.374 -0.966,-0.407 -1.358,-0.073 l -4.051,3.449 z"
style="fill:#333333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2136037,0,0,1.2136037,-732.43441,-64.413778)">
<path d="m 617.617,100.868 c -0.703,0 -1.336,-0.279 -1.781,-0.785 -0.496,-0.56 -0.707,-1.346 -0.6,-2.215 l 1.354,-10.822 c 0.074,-0.585 -0.262,-1.62 -0.666,-2.049 l -7.453,-7.961 c -0.742,-0.792 -1.004,-1.754 -0.717,-2.637 0.287,-0.883 1.063,-1.508 2.129,-1.712 l 10.709,-2.056 c 0.578,-0.111 1.459,-0.752 1.746,-1.27 l 5.08,-9.213 c 0.199,-0.404 0.988,-1.78 2.469,-1.78 1.557,0 2.383,1.58 2.531,1.897 l 5.02,9.097 c 0.285,0.517 1.168,1.157 1.746,1.269 l 10.709,2.056 c 1.066,0.205 1.842,0.829 2.129,1.712 0.287,0.883 0.025,1.844 -0.717,2.637 l -7.453,7.96 c -0.404,0.43 -0.74,1.465 -0.668,2.051 l 1.352,10.822 c 0.109,0.866 -0.102,1.652 -0.596,2.213 -0.723,0.816 -1.939,1.017 -3.1,0.475 l -9.873,-4.633 c -0.197,-0.092 -0.582,-0.189 -1.08,-0.189 -0.498,0 -0.883,0.098 -1.078,0.188 l -9.873,4.633 c -0.444,0.207 -0.887,0.312 -1.319,0.312 l 0,0 z m 12.27,-8.239 c 0.883,0 1.734,0.172 2.398,0.484 l 9.057,4.249 -1.238,-9.932 c -0.186,-1.498 0.451,-3.457 1.482,-4.557 l 6.84,-7.304 -9.828,-1.891 c -1.48,-0.284 -3.148,-1.495 -3.879,-2.817 l -4.832,-8.764 -4.832,8.763 c -0.73,1.323 -2.396,2.534 -3.879,2.818 l -9.824,1.887 6.838,7.309 c 1.031,1.101 1.668,3.06 1.48,4.558 l -1.242,9.928 9.063,-4.247 c 0.663,-0.312 1.515,-0.484 2.396,-0.484 l 0,0 z"
style="fill:#333369" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.1999726,0,0,1.1999726,-723.8473,-206.71515)">
<path d="m 617.479,220.601 c -0.711,0 -1.352,-0.282 -1.803,-0.794 -0.5,-0.566 -0.715,-1.361 -0.605,-2.24 l 1.369,-10.944 c 0.074,-0.592 -0.266,-1.638 -0.674,-2.073 l -7.539,-8.051 c -0.75,-0.801 -1.016,-1.773 -0.725,-2.667 0.291,-0.893 1.074,-1.524 2.152,-1.731 l 10.832,-2.08 c 0.584,-0.112 1.477,-0.76 1.766,-1.284 l 5.137,-9.317 c 0.201,-0.408 1,-1.799 2.498,-1.799 1.574,0 2.408,1.598 2.561,1.918 l 5.074,9.2 c 0.289,0.523 1.182,1.171 1.766,1.283 l 10.832,2.08 c 1.078,0.207 1.861,0.838 2.152,1.731 0.291,0.893 0.027,1.866 -0.725,2.667 l -7.539,8.05 c -0.408,0.436 -0.748,1.482 -0.674,2.075 l 1.367,10.944 c 0.109,0.876 -0.104,1.671 -0.604,2.238 -0.73,0.826 -1.961,1.028 -3.135,0.48 l -9.984,-4.685 c -0.199,-0.093 -0.588,-0.192 -1.092,-0.192 -0.504,0 -0.895,0.099 -1.092,0.191 l -9.982,4.685 c -0.45,0.209 -0.897,0.315 -1.333,0.315 l 0,0 z m 12.409,-8.331 c 0.893,0 1.752,0.174 2.424,0.489 l 9.16,4.297 -1.252,-10.044 c -0.189,-1.515 0.455,-3.496 1.498,-4.609 l 6.918,-7.387 -9.939,-1.913 c -1.498,-0.288 -3.184,-1.512 -3.922,-2.85 l -4.887,-8.863 -4.887,8.862 c -0.738,1.338 -2.426,2.563 -3.924,2.851 l -9.936,1.908 6.916,7.391 c 1.043,1.113 1.688,3.094 1.498,4.61 l -1.256,10.041 9.164,-4.295 c 0.673,-0.315 1.532,-0.488 2.425,-0.488 l 0,0 z"
style="fill:#333369" />
<path d="m 629.28,189.527 c 0,0 0.244,-0.523 0.607,-0.523 0.363,0 0.627,0.56 0.627,0.56 l 2.816,5.108 c 0.285,0.514 0.988,1.026 1.564,1.137 l 5.955,1.144 c 0.578,0.111 0.721,0.553 0.32,0.981 l -4.146,4.427 c -0.402,0.428 -0.67,1.256 -0.598,1.838 l 0.752,6.02 c 0.074,0.581 -0.303,0.855 -0.834,0.606 l -5.49,-2.577 c -0.533,-0.249 -1.402,-0.249 -1.934,0 l -5.49,2.577 c -0.533,0.249 -0.908,-0.024 -0.836,-0.606 l 0.754,-6.02 c 0.072,-0.582 -0.197,-1.41 -0.598,-1.838 l -4.146,-4.427 c -0.402,-0.429 -0.258,-0.871 0.318,-0.981 l 5.957,-1.144 c 0.576,-0.111 1.279,-0.623 1.564,-1.137 l 2.838,-5.145 z"
style="fill:#333369;fill-rule:evenodd" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2135952,0,0,1.2135952,-732.42924,-136.47014)">
<path d="m 617.617,160.243 c -0.701,0 -1.334,-0.279 -1.781,-0.785 -0.494,-0.56 -0.707,-1.346 -0.598,-2.215 l 1.354,-10.822 c 0.072,-0.585 -0.264,-1.62 -0.668,-2.049 l -7.453,-7.961 c -0.742,-0.792 -1.004,-1.753 -0.717,-2.637 0.287,-0.883 1.063,-1.507 2.129,-1.712 l 10.709,-2.056 c 0.578,-0.111 1.461,-0.751 1.746,-1.27 l 5.08,-9.213 c 0.199,-0.404 0.99,-1.779 2.469,-1.779 1.557,0 2.383,1.58 2.531,1.896 l 5.02,9.097 c 0.287,0.517 1.168,1.158 1.746,1.269 l 10.709,2.056 c 1.066,0.205 1.842,0.829 2.129,1.712 0.287,0.883 0.027,1.845 -0.717,2.637 l -7.453,7.96 c -0.404,0.431 -0.74,1.465 -0.668,2.051 l 1.354,10.822 c 0.107,0.866 -0.104,1.652 -0.598,2.213 -0.723,0.817 -1.939,1.017 -3.1,0.475 l -9.873,-4.633 c -0.195,-0.092 -0.582,-0.19 -1.08,-0.19 -0.496,0 -0.883,0.098 -1.078,0.189 l -9.871,4.633 c -0.446,0.207 -0.889,0.312 -1.321,0.312 l 0,0 z m 12.27,-8.238 c 0.883,0 1.734,0.171 2.398,0.484 l 9.057,4.249 -1.238,-9.932 c -0.186,-1.498 0.451,-3.457 1.482,-4.557 l 6.84,-7.304 -9.828,-1.891 c -1.48,-0.285 -3.148,-1.496 -3.879,-2.818 l -4.832,-8.764 -4.832,8.763 c -0.73,1.323 -2.396,2.534 -3.877,2.819 l -9.826,1.886 6.838,7.309 c 1.031,1.101 1.668,3.06 1.48,4.559 l -1.24,9.928 9.061,-4.247 c 0.663,-0.313 1.515,-0.484 2.396,-0.484 l 0,0 z"
style="fill:#333369" />
<path d="m 641.045,137.83 c 0.396,-0.424 0.254,-0.861 -0.316,-0.971 l -5.891,-1.131 c -0.568,-0.109 -1.264,-0.616 -1.547,-1.124 l -2.783,-5.05 c 0,0 -0.262,-0.554 -0.621,-0.554 -0.357,0 -0.6,0.518 -0.6,0.518 l -2.805,5.087 c -0.281,0.508 -0.977,1.015 -1.547,1.124 l -5.889,1.131 c -0.57,0.11 -0.713,0.547 -0.314,0.971 l 4.098,4.377 c 0.398,0.424 0.664,1.242 0.592,1.817 l -0.744,5.952 c -0.072,0.576 0.299,0.846 0.824,0.599 l 5.43,-2.547 c 0.264,-0.123 0.609,-0.185 0.955,-0.185 0.348,0 0.693,0.062 0.957,0.185 l 5.428,2.547 c 0.133,0.062 0.254,0.091 0.363,0.091 0.322,0 0.518,-0.26 0.463,-0.69 l -0.742,-5.952 c -0.074,-0.576 0.191,-1.394 0.59,-1.817 l 4.099,-4.378 z m -9.563,-2.222 c 0.578,1.042 1.797,1.928 2.967,2.153 l 3.242,0.623 -2.256,2.408 c -0.818,0.871 -1.283,2.308 -1.135,3.49 l 0.408,3.275 -2.988,-1.402 c -0.67,-0.314 -1.367,-0.38 -1.834,-0.38 v -13.059 l 1.596,2.892 z"
style="fill:#333369" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

7
assets/icon/Folder.svg Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64px" height="64px">
<g transform="matrix(1.199961,0,0,1.2222222,-436.76926,-579.09522)">
<path d="m 378.923,493.986 c -1.41,0 -2.684,1.188 -2.781,2.594 l -0.932,12.574 c -0.059,0.787 -0.717,1.389 -1.495,1.389 -0.037,0 -0.075,-0.002 -0.112,-0.004 -0.826,-0.063 -1.446,-0.781 -1.385,-1.607 l 0.932,-12.566 c 0.205,-2.963 2.796,-5.379 5.773,-5.379 h 28.369 c 0,-0.465 0,-0.873 0,-1.031 0,-1.635 -1.654,-2.973 -3.309,-2.973 h -17.744 c 0,0 0,-1.193 0,-2.543 0,-1.35 -1.354,-2.453 -3.008,-2.453 h -12.07 c -1.654,0 -3.008,1.35 -3.008,3 v 30 c 0,1.65 1.354,3 3.008,3 h 37.098 c 1.655,0 3.122,-1.346 3.262,-2.99 l 1.623,-19.021 c 0.065,-0.766 -0.177,-1.459 -0.612,-1.988 h -33.609 z"
style="fill:#333333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 793 B

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2,0,0,1.2,-579.7324,-351.106)">
<path d="m 509.777,296.755 c -12.426,0 -22.5,10.073 -22.5,22.5 0,12.427 10.074,22.5 22.5,22.5 12.426,0 22.5,-10.073 22.5,-22.5 0,-12.427 -10.074,-22.5 -22.5,-22.5 z m 14.063,22.5 c 0,2.344 -0.584,4.55 -1.602,6.495 l -18.955,-18.955 c 1.945,-1.019 4.151,-1.603 6.494,-1.603 7.754,10e-4 14.063,6.309 14.063,14.063 z m -28.125,0 c 0,-2.343 0.584,-4.55 1.602,-6.493 l 18.955,18.953 c -1.943,1.019 -4.15,1.603 -6.494,1.603 -7.755,0 -14.063,-6.308 -14.063,-14.063 z"
style="fill:#333333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 648 B

7
assets/icon/Help.svg Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2,0,0,1.2,-579.7336,-711.5908)">
<path d="m 509.778,597.159 c -12.427,0 -22.5,10.074 -22.5,22.5 0,12.428 10.073,22.5 22.5,22.5 12.427,0 22.5,-10.072 22.5,-22.5 -10e-4,-12.426 -10.073,-22.5 -22.5,-22.5 z m -0.559,36.414 c -1.676,0 -3.054,-1.379 -3.054,-3.055 0,-1.676 1.378,-3.053 3.054,-3.053 1.677,0 3.054,1.377 3.054,3.053 0,1.676 -1.377,3.055 -3.054,3.055 z m 2.904,-11.791 c -0.892,1.305 -0.594,3.129 -3.052,3.129 -1.602,0 -2.385,-1.305 -2.385,-2.496 0,-4.432 6.519,-5.436 6.519,-9.086 0,-2.012 -1.34,-3.203 -3.576,-3.203 -4.767,0 -2.905,4.916 -6.518,4.916 -1.304,0 -2.421,-0.783 -2.421,-2.271 0,-3.65 4.172,-6.891 8.714,-6.891 4.769,0 9.46,2.197 9.46,7.449 10e-4,4.842 -5.55,6.703 -6.741,8.453 z"
style="fill:#333333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 857 B

11
assets/icon/Home.svg Normal file
View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.1999968,0,0,1.3606385,-147.9521,-648.3007)">
<path d="m 170.351,504.021 c -0.343,0.365 -0.922,0.385 -1.288,0.043 L 150.392,486.63 c -0.365,-0.342 -0.966,-0.342 -1.332,0 l -18.204,16.97 c -0.367,0.344 -0.945,0.322 -1.287,-0.045 l -1.865,-2 c -0.342,-0.365 -0.321,-0.945 0.045,-1.287 l 21.313,-19.869 c 0.367,-0.342 0.967,-0.342 1.334,0.002 l 21.777,20.334 c 0.365,0.342 0.386,0.922 0.043,1.289 l -1.865,1.997 z"
style="fill:#333333"/>
<path d="m 149.725,489.777 -15.345,14.305 v 14.83 c 0,0.504 0.414,0.918 0.919,0.918 h 10.085 v -12.857 c 0,-0.504 0.414,-0.918 0.919,-0.918 h 7.347 c 0.506,0 0.918,0.414 0.918,0.918 v 12.857 h 10.119 c 0.505,0 0.918,-0.414 0.918,-0.918 v -14.307 l -15.88,-14.828 z"
style="fill:#333333"/>
<path d="m 165.543,482.311 c 0,-0.506 -0.414,-0.92 -0.919,-0.92 h -5.51 c -0.505,0 -0.918,0.414 -0.918,0.92 v 1.604 l 7.347,6.918 v -8.522 z"
style="fill:#333333"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

7
assets/icon/Info.svg Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2,0,0,1.2,-579.7336,-639.148)">
<path d="m 509.778,536.79 c -12.427,0 -22.5,10.074 -22.5,22.5 0,12.428 10.073,22.5 22.5,22.5 12.426,0 22.5,-10.072 22.5,-22.5 0,-12.426 -10.074,-22.5 -22.5,-22.5 z m 3.749,35.66 c 0,0.516 -0.422,0.938 -0.937,0.938 h -5.625 c -0.516,0 -0.938,-0.422 -0.938,-0.938 v -15 c 0,-0.514 0.422,-0.938 0.938,-0.938 h 5.625 c 0.515,0 0.937,0.424 0.937,0.938 v 15 z m 0,-19.758 c 0,0.516 -0.422,0.938 -0.937,0.938 h -5.625 c -0.516,0 -0.938,-0.422 -0.938,-0.938 v -6.563 c 0,-0.516 0.422,-0.938 0.938,-0.938 h 5.625 c 0.515,0 0.937,0.422 0.937,0.938 v 6.563 z"
style="fill:#333333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 736 B

11
assets/icon/List.svg Normal file
View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.1999733,0,0,1.1999733,-364.43055,-494.42419)">
<path d="m 352.572,429.142 c 0,0.494 -0.406,0.9 -0.9,0.9 h -43.201 c -0.494,0 -0.9,-0.406 -0.9,-0.9 v -8.099 c 0,-0.496 0.406,-0.9 0.9,-0.9 h 43.201 c 0.494,0 0.9,0.404 0.9,0.9 v 8.099 z"
style="fill:#333333" />
<path d="m 352.572,443.542 c 0,0.494 -0.406,0.9 -0.9,0.9 h -43.201 c -0.494,0 -0.9,-0.406 -0.9,-0.9 v -8.1 c 0,-0.496 0.406,-0.9 0.9,-0.9 h 43.201 c 0.494,0 0.9,0.404 0.9,0.9 v 8.1 z"
style="fill:#333333" />
<path d="m 352.572,457.942 c 0,0.494 -0.406,0.898 -0.9,0.898 h -43.201 c -0.494,0 -0.9,-0.404 -0.9,-0.898 v -8.102 c 0,-0.494 0.406,-0.898 0.9,-0.898 h 43.201 c 0.494,0 0.9,0.404 0.9,0.898 v 8.102 z"
style="fill:#333333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 842 B

7
assets/icon/Load.svg Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.1818182,0,0,1.2857143,-429.68201,-454.27086)">
<path d="m 406.154,357.213 h -18 l -14,14 v 27 c 0,0.55 0.449,1 1,1 h 11 v -11 h -4 c -1.1,0 -1.418,-0.688 -0.709,-1.526 l 8.416,-9.947 c 0.711,-0.84 1.875,-0.84 2.584,0 l 8.416,9.947 c 0.711,0.839 0.393,1.526 -0.707,1.526 h -4 v 11 h 10 c 0.549,0 1,-0.45 1,-1 v -40 c 0,-0.551 -0.451,-1 -1,-1 z m -18,14 h -12 l 12,-12 v 12 z"
style="fill:#333333"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 529 B

7
assets/icon/Lock.svg Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2,0,0,1.2,-3.2008856,-206.932)">
<path d="m 43.688,193.586 h -1.077 v -8.353 c 0,-4.743 -3.881,-8.623 -8.623,-8.623 h -8.623 c -4.742,0 -8.623,3.88 -8.623,8.623 v 8.353 h -1.078 c -1.778,0 -3.232,1.455 -3.232,3.234 v 21.557 c 0,1.778 1.454,3.233 3.232,3.233 h 28.024 c 1.779,0 3.233,-1.455 3.233,-3.233 V 196.82 c 10e-4,-1.779 -1.453,-3.234 -3.233,-3.234 z m -11.856,14.928 v 6.81 h -4.311 v -6.81 c -1.413,-0.769 -2.383,-2.248 -2.383,-3.969 0,-2.506 2.031,-4.538 4.538,-4.538 2.505,0 4.536,2.032 4.536,4.538 10e-4,1.721 -0.968,3.2 -2.38,3.969 z m 4.516,-14.928 H 23.006 v -7.545 c 0,-2.371 1.938,-4.31 4.311,-4.31 h 4.721 c 2.37,0 4.311,1.939 4.311,4.31 v 7.545 z"
style="fill:#333333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 821 B

7
assets/icon/Next.svg Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2,0,0,1.2,-723.8644,-566.7208)">
<polygon points="629.887,481.039 652.387,499.941 629.887,518.934 629.887,509.459 607.387,509.459 607.387,490.512 629.887,490.512 "
style="fill:#333333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 322 B

9
assets/icon/OpenMenu.svg Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2,0,0,1.2,-579.7336,-421.8556)">
<path d="m 509.778,363.895 c 7.908,0 14.318,6.411 14.318,14.318 0,7.907 -6.41,14.318 -14.318,14.318 -7.908,0 -14.318,-6.411 -14.318,-14.318 0,-7.907 6.41,-14.318 14.318,-14.318 m 0,-8.182 c -12.406,0 -22.5,10.094 -22.5,22.5 0,12.406 10.094,22.5 22.5,22.5 12.406,0 22.5,-10.094 22.5,-22.5 0,-12.406 -10.094,-22.5 -22.5,-22.5 l 0,0 z"
style="fill:#333333" />
<polygon points="498.698,373.228 509.778,387.162 520.857,373.228 "
style="fill:#333333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 625 B

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.1999998,0,0,1.2054398,-147.94597,-642.18985)">
<path d="m 169.92,548.999 c -0.181,-0.441 -0.497,-0.633 -0.703,-0.426 -0.206,0.205 -0.575,0.451 -0.819,0.543 -0.244,0.094 -1.056,-0.443 -1.392,-0.779 h -0.001 c -0.336,-0.338 -0.688,-0.813 -0.78,-1.057 -0.092,-0.244 0.444,-1.055 0.78,-1.393 l 0.011,-0.01 c 0.337,-0.338 0.348,-0.898 0.023,-1.248 l -3.978,-3.666 c -0.374,-0.295 -0.851,-0.248 -1.059,0.104 -0.209,0.35 -0.555,0.76 -0.769,0.91 -0.214,0.148 -1.133,-0.17 -1.541,-0.414 -0.409,-0.242 -0.866,-0.617 -1.017,-0.83 -0.149,-0.215 0.132,-1.066 0.326,-1.393 0.194,-0.328 -0.013,-0.729 -0.461,-0.889 l -5.998,-1.547 c -0.47,-0.078 -0.854,0.205 -0.854,0.631 0,0.426 -0.088,0.969 -0.194,1.207 -0.107,0.238 -1.061,0.434 -1.536,0.434 -0.475,0 -1.06,-0.088 -1.298,-0.195 -0.238,-0.107 -0.433,-1.02 -0.433,-1.445 0,-0.425 -0.384,-0.709 -0.854,-0.631 l -5.998,1.547 c -0.448,0.16 -0.655,0.561 -0.461,0.889 0.195,0.326 0.379,0.807 0.408,1.066 0.03,0.258 -0.689,0.914 -1.099,1.156 -0.408,0.244 -0.955,0.467 -1.215,0.496 -0.26,0.029 -0.885,-0.643 -1.095,-0.992 -0.208,-0.352 -0.686,-0.398 -1.06,-0.104 l -3.978,3.666 c -0.324,0.35 -0.313,0.91 0.024,1.248 l 0.011,0.01 c 0.336,0.338 0.688,0.813 0.78,1.057 0.092,0.244 -0.444,1.055 -0.781,1.393 -0.336,0.336 -0.812,0.688 -1.056,0.779 -0.244,0.091 -0.949,-0.338 -1.155,-0.543 -0.206,-0.207 -0.522,-0.016 -0.703,0.426 0,0 -2.54,6.197 -2.54,10.189 0,12.428 10.073,22.5 22.5,22.5 12.427,0 22.5,-10.072 22.5,-22.5 0.005,-3.992 -2.535,-10.189 -2.535,-10.189 z m -19.96,21.541 c -6.213,0 -11.25,-5.037 -11.25,-11.25 0,-5.076 3.363,-9.363 7.981,-10.764 l 2.882,-5.764 c 0.213,-0.426 0.561,-0.426 0.773,0 l 2.882,5.764 c 4.619,1.4 7.981,5.688 7.981,10.764 0.001,6.213 -5.036,11.25 -11.249,11.25 z"
style="fill:#333333"/>
<path d="m 149.96,551.501 c -4.295,0 -7.788,3.494 -7.788,7.789 0,4.295 3.493,7.787 7.788,7.787 4.295,0 7.788,-3.492 7.788,-7.787 0,-4.295 -3.493,-7.789 -7.788,-7.789 z"
style="fill:#333333"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

7
assets/icon/Previous.svg Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(-1.2,0,0,1.2,787.8644,-566.7208)">
<polygon points="652.387,499.941 629.887,518.934 629.887,509.459 607.387,509.459 607.387,490.512 629.887,490.512 629.887,481.039 "
style="fill:#333333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 322 B

9
assets/icon/Quit.svg Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2000267,0,0,1.2000267,-3.5226163,-279.15673)">
<path d="m 36.314,239.696 v 8.396 c 4.282,2.353 7.191,6.905 7.191,12.126 0,7.626 -6.203,13.829 -13.829,13.829 -7.626,0 -13.829,-6.203 -13.829,-13.829 0,-5.221 2.91,-9.773 7.191,-12.126 v -8.396 c -8.664,2.802 -14.936,10.925 -14.936,20.522 0,11.915 9.658,21.573 21.573,21.573 11.915,0 21.573,-9.658 21.573,-21.573 0.002,-9.596 -6.269,-17.72 -14.934,-20.522 z"
style="fill:#333333"/>
<path d="m 32.998,256.706 c 0,1.218 -0.995,2.213 -2.213,2.213 h -2.217 c -1.218,0 -2.213,-0.995 -2.213,-2.213 v -17.701 c 0,-1.218 0.995,-2.213 2.213,-2.213 h 2.217 c 1.218,0 2.213,0.995 2.213,2.213 v 17.701 z"
style="fill:#333333"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 804 B

12
assets/icon/Redo.svg Normal file
View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.3012048,0,0,1.255814,-631.32431,-293.62251)">
<circle d="m 514.52701,259.29199 c 0,2.20914 -1.79086,4 -4,4 -2.20914,0 -4,-1.79086 -4,-4 0,-2.20914 1.79086,-4 4,-4 2.20914,0 4,1.79086 4,4 z"
style="fill:#333333"
cx="510.52701"
cy="259.29199"
r="4"/>
<path d="m 530.527,254.292 v -13 l -4.098,3.514 c -4.137,-4.393 -10.08,-7.014 -15.902,-7.014 -11.855,0 -21.5,9.646 -21.5,21.5 0,11.854 9.645,21.5 21.5,21.5 8.551,0 16.287,-5.064 19.711,-12.902 l -6.416,-2.801 c -2.309,5.287 -7.527,8.703 -13.295,8.703 -7.996,0 -14.5,-6.504 -14.5,-14.5 0,-7.994 6.504,-14.5 14.5,-14.5 3.824,0 7.744,1.715 10.568,4.584 l -4.568,3.916 14,1 z"
style="fill:#333333"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 818 B

7
assets/icon/Remove.svg Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2000267,0,0,1.2000267,-651.9777,-351.11481)">
<path d="m 579.088,319.255 12.91,-12.908 c 0.627,-0.627 0.627,-1.654 0,-2.281 l -6.84,-6.842 c -0.627,-0.625 -1.652,-0.625 -2.279,0 l -12.91,12.91 -12.91,-12.91 c -0.627,-0.625 -1.654,-0.625 -2.281,0 l -6.84,6.842 c -0.625,0.627 -0.625,1.654 0,2.281 l 12.91,12.908 -12.908,12.908 c -0.627,0.627 -0.627,1.654 0,2.281 l 6.84,6.842 c 0.627,0.625 1.654,0.625 2.281,0 l 12.908,-12.91 12.908,12.91 c 0.627,0.625 1.652,0.625 2.279,0 l 6.84,-6.842 c 0.627,-0.627 0.627,-1.654 0,-2.281 l -12.908,-12.908 z"
style="fill:#333333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 699 B

15
assets/icon/Replace.svg Normal file
View File

@@ -0,0 +1,15 @@
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="64" width="64" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata>
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<path d="M56.308,30.297c-0.34-11.332-7.1-21.282-17.44-25.505-10.575-4.3193-22.883-1.4808-30.624,7.062l6.7808,6.444c5.1608-5.6978,13.367-7.5874,20.417-4.7076,6.802,2.7782,11.249,9.2808,11.584,16.709l-6.7794,0.0046,11.511,14.941,10.893-14.949-6.3435-0.000321z" fill="#333"/>
<g transform="matrix(0.71188026,0,0,0.77215001,-386.35967,-207.86869)">
<path fill="#333" d="m579.09,319.26,12.91-12.908c0.627-0.627,0.627-1.654,0-2.281l-6.84-6.842c-0.627-0.625-1.652-0.625-2.279,0l-12.91,12.91-12.91-12.91c-0.627-0.625-1.654-0.625-2.281,0l-6.84,6.842c-0.625,0.627-0.625,1.654,0,2.281l12.91,12.908-12.908,12.908c-0.627,0.627-0.627,1.654,0,2.281l6.84,6.842c0.627,0.625,1.654,0.625,2.281,0l12.908-12.91,12.908,12.91c0.627,0.625,1.652,0.625,2.279,0l6.84-6.842c0.627-0.627,0.627-1.654,0-2.281l-12.908-12.908z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

7
assets/icon/SDCard.svg Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.1999941,0,0,1.2,-75.451168,-351.106)">
<path d="m 104.793,296.755 h -24.75 c -1.237,0 -2.25,1.013 -2.25,2.25 v 9 c 0,1.237 -0.562,3.093 -1.248,4.122 l -2.004,3.005 c -0.687,1.029 -1.248,2.885 -1.248,4.123 0,1.236 0.905,1.797 2.013,1.244 l 0.475,-0.238 c 1.107,-0.554 2.013,0.006 2.013,1.244 v 2.25 c 0,1.236 -0.717,2.967 -1.591,3.84 l -1.318,1.318 c -0.874,0.875 -1.591,2.604 -1.591,3.842 v 6.75 c 0,1.236 1.013,2.25 2.25,2.25 h 24.75 c 4.359,0 6.75,-2.25 6.75,-6.75 v -36 c -10e-4,-1.237 -1.014,-2.25 -2.251,-2.25 z m -20.25,13 c 0,0.275 -0.225,0.5 -0.5,0.5 h -1.25 c -0.275,0 -0.5,-0.225 -0.5,-0.5 v -8 c 0,-0.275 0.225,-0.5 0.5,-0.5 h 1.25 c 0.275,0 0.5,0.225 0.5,0.5 v 8 z m 4.5,0 c 0,0.275 -0.225,0.5 -0.5,0.5 h -1.25 c -0.275,0 -0.5,-0.225 -0.5,-0.5 v -8 c 0,-0.275 0.225,-0.5 0.5,-0.5 h 1.25 c 0.275,0 0.5,0.225 0.5,0.5 v 8 z m 4.5,0 c 0,0.275 -0.225,0.5 -0.5,0.5 h -1.25 c -0.275,0 -0.5,-0.225 -0.5,-0.5 v -8 c 0,-0.275 0.225,-0.5 0.5,-0.5 h 1.25 c 0.275,0 0.5,0.225 0.5,0.5 v 8 z m 4.5,0 c 0,0.275 -0.225,0.5 -0.5,0.5 h -1.25 c -0.275,0 -0.5,-0.225 -0.5,-0.5 v -8 c 0,-0.275 0.225,-0.5 0.5,-0.5 h 1.25 c 0.275,0 0.5,0.225 0.5,0.5 v 8 z m 4.5,0 c 0,0.275 -0.225,0.5 -0.5,0.5 h -1.25 c -0.275,0 -0.5,-0.225 -0.5,-0.5 v -8 c 0,-0.275 0.225,-0.5 0.5,-0.5 h 1.25 c 0.275,0 0.5,0.225 0.5,0.5 v 8 z"
style="fill:#333333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

16
assets/icon/Save.svg Normal file
View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64px" height="64px">
<g transform="matrix(1.2,0,0,1.2000267,-436.7836,-495.40152)">
<rect style="fill:#333333"
x="386.36899"
y="419.13501"
width="8.5719995"
height="10.714"
/>
<path style="fill:#333333"
d="m 403.435,416.992 h -3.139 v 16.071 h -25.713 v -16.071 h -5.893 c -0.295,0 -0.537,0.241 -0.537,0.535 v 43.929 c 0,0.295 0.242,0.535 0.537,0.535 h 43.928 c 0.295,0 0.535,-0.24 0.535,-0.535 V 426.71 l -9.718,-9.718 z m 3.291,41.784 h -32.143 v -21.428 h 32.143 v 21.428 z"
/>
<polygon style="fill:#333333" points="403.511,445.921 403.511,445.921 377.798,445.921 377.798,442.706 403.511,442.706 " />
<polygon style="fill:#333333" points="403.511,453.421 403.511,453.421 377.798,453.421 377.798,450.206 403.511,450.206 " />
</g>
</svg>

After

Width:  |  Height:  |  Size: 859 B

13
assets/icon/Search.svg Normal file
View File

@@ -0,0 +1,13 @@
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="64" width="64" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata>
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<path d="M58.168,50.56,46.013,38.407c-0.91442-0.91442-2.3016-1.0644-3.3865-0.47161l-2.592-2.592c2.208-3.1357,3.5185-6.9493,3.5185-11.068,0-10.629-8.6485-19.276-19.277-19.276-10.629,0-19.276,8.6461-19.276,19.276s8.6461,19.277,19.276,19.277c4.1017,0,7.8985-1.296,11.026-3.4873l2.6088,2.6112c-0.56041,1.0752-0.40321,2.4348,0.49681,3.3373l12.155,12.153c1.1088,1.1112,2.9268,1.1112,4.0357,0l3.5725-3.5701c1.1064-1.1088,1.1064-2.9256-0.0024-4.0369z" fill="#333"/>
<path d="m1.4382,21.622a11.793,12.272,0,1,1,-23.586,0,11.793,12.272,0,1,1,23.586,0z" transform="matrix(1.0284553,0,0,1,35.146627,2.6846088)" fill="#FFF"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

9
assets/icon/Trash.svg Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2,0,0,1.2,-436.9344,-711.5908)">
<path d="m 408.302,604.218 h -7.95 c 0.002,-0.055 0.009,-0.109 0.009,-0.166 v -1.6 c 0,-2.91 -2.384,-5.293 -5.294,-5.293 h -8.824 c -2.912,0 -5.294,2.383 -5.294,5.293 v 1.6 c 0,0.057 0.007,0.111 0.009,0.166 h -7.95 c -1.456,0 -2.646,1.191 -2.646,2.646 v 2.646 c 0,1.457 1.19,2.648 2.646,2.648 h 0.883 v -1.766 h 33.529 v 1.766 h 0.883 c 1.455,0 2.646,-1.191 2.646,-2.648 v -2.646 c -0.001,-1.455 -1.192,-2.646 -2.647,-2.646 z m -22.969,-2.647 h 10.588 v 2.646 h -10.588 v -2.646 z"
style="fill:#333333"/>
<path d="m 375.654,613.042 v 26.469 c 0,1.457 1.19,2.648 2.647,2.648 h 24.705 c 1.456,0 2.647,-1.191 2.647,-2.648 v -26.469 h -29.999 z m 8.824,23.381 c 0,0.486 -0.397,0.883 -0.882,0.883 h -1.765 c -0.486,0 -0.883,-0.396 -0.883,-0.883 v -17.646 c 0,-0.484 0.396,-0.883 0.883,-0.883 h 1.765 c 0.484,0 0.882,0.398 0.882,0.883 v 17.646 z m 7.941,0 c 0,0.486 -0.398,0.883 -0.882,0.883 h -1.766 c -0.485,0 -0.882,-0.396 -0.882,-0.883 v -17.646 c 0,-0.484 0.396,-0.883 0.882,-0.883 h 1.766 c 0.483,0 0.882,0.398 0.882,0.883 v 17.646 z m 7.941,0 c 0,0.486 -0.398,0.883 -0.883,0.883 h -1.765 c -0.485,0 -0.882,-0.396 -0.882,-0.883 v -17.646 c 0,-0.484 0.396,-0.883 0.882,-0.883 h 1.765 c 0.484,0 0.883,0.398 0.883,0.883 v 17.646 z"
style="fill:#333333"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

12
assets/icon/Undo.svg Normal file
View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(-1.3012048,0,0,1.255814,695.32425,-293.62251)">
<circle d="m 514.52701,259.29199 c 0,2.20914 -1.79086,4 -4,4 -2.20914,0 -4,-1.79086 -4,-4 0,-2.20914 1.79086,-4 4,-4 2.20914,0 4,1.79086 4,4 z"
style="fill:#333333"
cx="510.52701"
cy="259.29199"
r="4"/>
<path d="m 530.527,254.292 v -13 l -4.098,3.514 c -4.137,-4.393 -10.08,-7.014 -15.902,-7.014 -11.855,0 -21.5,9.646 -21.5,21.5 0,11.854 9.645,21.5 21.5,21.5 8.551,0 16.287,-5.064 19.711,-12.902 l -6.416,-2.801 c -2.309,5.287 -7.527,8.703 -13.295,8.703 -7.996,0 -14.5,-6.504 -14.5,-14.5 0,-7.994 6.504,-14.5 14.5,-14.5 3.824,0 7.744,1.715 10.568,4.584 l -4.568,3.916 14,1 z"
style="fill:#333333"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 818 B

9
assets/icon/Update.svg Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.1999733,0,0,1.1999733,-579.72065,-63.509343)">
<path d="m 528.054,71.68 c -3.166,-7.28 -10.25,-11.956 -18.232,-11.956 -8.164,0 -15.625,5.116 -18.564,12.729 l 6.188,2.39 c 1.959,-5.077 6.934,-8.486 12.377,-8.486 5.251,0 9.9,3.048 12.05,7.791 l -4.514,1.804 11.543,6.66 3.377,-12.617 -4.225,1.685 z"
style="fill:#333333"/>
<path d="m 509.822,92.88 c -5.205,0 -9.952,-3.14 -12.074,-7.853 l 4.45,-1.721 -11.423,-6.515 -3.497,12.281 4.26,-1.646 c 3.106,7.252 10.357,12.084 18.284,12.084 8.193,0 15.449,-4.917 18.484,-12.524 l -6.158,-2.457 c -2.026,5.073 -6.862,8.351 -12.326,8.351 z"
style="fill:#333333"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 744 B

7
assets/icon/Validate.svg Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2,0,0,1.2,-651.9628,-63.5416)">
<path d="m 569.969,57.117 c -12.428,0 -22.5,10.073 -22.5,22.501 0,12.426 10.072,22.5 22.5,22.5 12.426,0 22.5,-10.074 22.5,-22.5 0,-12.428 -10.074,-22.501 -22.5,-22.501 z m 11.324,21.029 -10.391,10.391 c -0.514,0.514 -1.357,0.514 -1.871,0 L 558.642,78.148 c -0.514,-0.514 -0.514,-1.355 0,-1.869 l 2.279,-2.281 c 0.867,-0.867 2.174,-0.752 2.943,0.02 l 5.166,5.164 c 0.514,0.516 1.357,0.516 1.871,0 l 5.182,-5.18 c 0.867,-0.869 2.121,-0.816 2.934,-0.002 l 2.275,2.275 c 0.515,0.513 0.515,1.357 10e-4,1.871 z"
style="fill:#333333;fill-rule:evenodd" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 711 B

13
assets/icon/VolumeMax.svg Normal file
View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.300523,0,0,1.300523,-4.3338536,-458.79144)">
<polygon points="16.142,372.236 26.103,362.274 26.103,394.151 16.142,384.189 7.177,384.189 7.177,372.236 "
style="fill:#333333" />
<path d="m 34.567,369.749 -2.816,2.816 c 1.447,1.446 2.344,3.444 2.344,5.647 0,2.203 -0.896,4.201 -2.344,5.646 l 2.816,2.816 c 2.168,-2.168 3.512,-5.161 3.512,-8.463 0,-3.302 -1.344,-6.293 -3.512,-8.462 z"
style="fill:#333333" />
<path d="m 39.704,365.025 -2.816,2.816 c 2.645,2.645 4.283,6.297 4.283,10.324 0,4.027 -1.639,7.68 -4.283,10.324 l 2.816,2.816 c 3.365,-3.367 5.451,-8.015 5.451,-13.141 0,-5.123 -2.086,-9.771 -5.451,-13.139 z"
style="fill:#333333" />
<path d="m 44.56,359.854 -2.816,2.816 c 3.982,3.982 6.449,9.48 6.449,15.543 0,6.063 -2.467,11.561 -6.447,15.543 l 2.814,2.816 c 4.705,-4.704 7.617,-11.197 7.617,-18.359 0,-7.162 -2.914,-13.655 -7.617,-18.359 z"
style="fill:#333333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2249898,0,0,1.2249898,-3.7905268,-358.08412)">
<polygon points="16.82,325.684 7.176,325.684 7.176,312.827 16.82,312.827 27.534,302.112 27.534,336.398 "
style="fill:#333333" />
<path d="m 47.081,319.255 4.918,-4.917 c 0.238,-0.24 0.238,-0.631 0,-0.87 l -2.607,-2.606 c -0.237,-0.238 -0.629,-0.238 -0.866,0 l -4.919,4.918 -4.92,-4.918 c -0.236,-0.238 -0.629,-0.238 -0.867,0 l -2.605,2.606 c -0.239,0.239 -0.239,0.63 0,0.87 l 4.917,4.917 -4.917,4.917 c -0.239,0.24 -0.239,0.632 0,0.87 l 2.607,2.607 c 0.236,0.236 0.629,0.236 0.867,0 l 4.918,-4.919 4.916,4.919 c 0.24,0.236 0.632,0.236 0.869,0 l 2.607,-2.607 c 0.236,-0.237 0.236,-0.63 0,-0.87 l -4.918,-4.917 z"
style="fill:#333333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 820 B

7
assets/icon/Warning.svg Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2000035,0,0,1.2000035,-76.201658,-63.592236)">
<path d="M 111.858,93.287 93.524,62.64 C 91.67,59.542 88.639,59.543 86.789,62.641 L 68.476,93.286 c -1.851,3.098 -0.413,5.633 3.197,5.633 h 36.993 c 3.608,-10e-4 5.045,-2.535 3.192,-5.632 z M 88.2,73.367 c 0,-1.084 0.887,-1.969 1.969,-1.969 1.083,0 1.969,0.885 1.969,1.969 v 9.192 c 0,1.085 -0.886,1.969 -1.969,1.969 -1.082,0 -1.969,-0.884 -1.969,-1.969 v -9.192 z m 1.969,19.596 c -1.449,0 -2.625,-1.177 -2.625,-2.625 0,-1.451 1.176,-2.624 2.625,-2.624 1.45,0 2.625,1.173 2.625,2.624 0,1.449 -1.175,2.625 -2.625,2.625 z"
style="fill:#333333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 724 B

17
assets/icon/WhereAmI.svg Normal file
View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2000267,0,0,1.2000267,-220.089,-63.543123)">
<path d="m 232.569,79.617 -16.755,-3.49 2.864,-5.115 -5.023,3.029 -3.585,-16.924 -3.585,16.924 -5.023,-3.029 2.864,5.115 -16.755,3.49 h -0.001 l 0.001,0 0,0 16.755,3.49 -2.864,5.114 5.023,-3.029 3.585,16.925 3.585,-16.925 5.023,3.029 -2.864,-5.114 16.755,-3.49 0,0 0,0 0,0 z m -22.499,4.302 c -2.376,0 -4.302,-1.925 -4.302,-4.301 0,-2.375 1.926,-4.301 4.302,-4.301 2.376,0 4.302,1.926 4.302,4.301 0,2.376 -1.926,4.301 -4.302,4.301 z"
style="fill:#451c54" />
<g>
<path d="m 199.03,75.203 c 1.204,-2.997 3.589,-5.393 6.58,-6.609 l 1.242,-5.866 c -6.921,1.314 -12.371,6.771 -13.676,13.694 l 5.854,-1.219 z"
style="fill:#451c54" />
<path d="m 221.139,84.026 c -1.204,3.017 -3.604,5.428 -6.615,6.644 l -1.24,5.861 c 6.939,-1.307 12.404,-6.779 13.703,-13.723 l -5.848,1.218 z"
style="fill:#451c54" />
<path d="m 214.529,68.586 c 3.002,1.214 5.396,3.615 6.603,6.622 l 5.852,1.219 C 225.679,69.495 220.22,64.032 213.289,62.725 l 1.24,5.861 z"
style="fill:#451c54" />
<path d="m 205.614,90.663 c -3,-1.219 -5.391,-3.624 -6.592,-6.632 l -5.85,-1.218 c 1.299,6.935 6.754,12.402 13.684,13.715 l -1.242,-5.865 z"
style="fill:#451c54" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,13 @@
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="64" width="64" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata>
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<path d="m36.594,31.471,9.9047,12.555,9.3732-12.561-9.4514,0.0011z" fill="#333"/>
<path style="baseline-shift:baseline;block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" fill="#353535" d="m31.724,51.573c-6.6423,0-11.845-9.0656-11.845-20.048s5.203-20.048,11.845-20.048c7.389,0,12.257,7.595,11.625,20.494,3.1648,0.01798,3.0508-0.01346,7.1142-0.17954,0.674-20.911-8.501-28.985-18.739-28.985-9.0867,0-18.935,12.636-18.935,28.584s9.849,29.002,18.935,28.855"/>
</svg>

After

Width:  |  Height:  |  Size: 980 B

9
assets/icon/ZoomIn.svg Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.20002,0,0,1.20002,-651.97375,-639.15903)">
<path d="m 591.775,574.756 -10.129,-10.127 c -0.762,-0.762 -1.918,-0.887 -2.822,-0.393 l -2.16,-2.16 c 1.84,-2.613 2.932,-5.791 2.932,-9.223 0,-8.857 -7.207,-16.063 -16.064,-16.063 -8.857,0 -16.063,7.205 -16.063,16.063 0,8.858 7.205,16.064 16.063,16.064 3.418,0 6.582,-1.08 9.188,-2.906 l 2.174,2.176 c -0.467,0.896 -0.336,2.029 0.414,2.781 l 10.129,10.127 c 0.924,0.926 2.439,0.926 3.363,0 l 2.977,-2.975 c 0.922,-0.925 0.922,-2.438 -0.002,-3.364 z m -28.244,-11.787 c -5.584,0 -10.113,-4.529 -10.113,-10.115 0,-5.584 4.529,-10.113 10.113,-10.113 5.586,0 10.115,4.529 10.115,10.113 0,5.585 -4.529,10.115 -10.115,10.115 z"
style="fill:#333333" />
<path d="m 568.498,550.863 h -3 v -3 c 0,-1.104 -0.895,-2 -2,-2 -1.104,0 -2,0.896 -2,2 v 3 h -3 c -1.104,0 -2,0.896 -2,2 0,1.105 0.896,2 2,2 h 3 v 3 c 0,1.105 0.896,2 2,2 1.105,0 2,-0.895 2,-2 v -3 h 3 c 1.105,0 2,-0.895 2,-2 0,-1.103 -0.894,-2 -2,-2 z"
style="fill:#333333" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -2,6 +2,7 @@
<EdnLang version="0.1" lang="c">
<ext>*.c</ext>
<ext>*.cpp</ext>
<ext>*.cc</ext>
<ext>*.h</ext>
<ext>*.hpp</ext>
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<EdnLang version="0.2" lang="XML">
<ext>*.xml</ext>
<ext>*.eol</ext>
<ext>*.svg</ext>
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="Comment">
<color>comment</color>

View File

@@ -1,4 +1,14 @@
# action a faire (ordonner par r<>vision) :
dans la liste des truc important a refaire
retirer tout les singleton ==> passer par des namespace ==> fonctionnera mieux ...
finir de netoyer la classe widget
netoyer les classe text ...
mettre en pla ce le repositionnement automatique quand on change de buffer
Curseur au bon endroit
* 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

85
build.xml Normal file
View File

@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="edn" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<loadproperties srcFile="local.properties" />
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
<property file="ant.properties" />
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
unless="sdk.dir"
/>
<!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets -->
<!--
<target name="-pre-build">
</target>
<target name="-pre-compile">
</target>
/* This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir} */
<target name="-post-compile">
</target>
-->
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>

8
install.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
#really simple to install
sudo cp linux/bin/release/edn /usr/bin/edn
sudo chmod 777 /usr/bin/edn
sudo mkdir -p /usr/share/edn
sudo rm -r /usr/share/edn/*
sudo cp -r assets/* /usr/share/edn/

View File

@@ -2,19 +2,45 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := ednpackage
LOCAL_STATIC_LIBRARIES := ewol
LOCAL_C_INCLUDES := $(LOCAL_PATH)
# load the common sources file of the platform
include $(LOCAL_PATH)/file.mk
# name of the librairy
LOCAL_MODULE := ednpackage
# get the tag of the current project :
LOCAL_VERSION_TAG=$(shell cd $(LOCAL_PATH) ; git describe --tags)
LOCAL_VERSION_TAG_SHORT=$(shell cd $(LOCAL_PATH) ; git describe --tags --abbrev=0)
$(info $(LOCAL_MODULE) version TAG : $(LOCAL_VERSION_TAG))
# name of the dependency
LOCAL_STATIC_LIBRARIES := ewol etk tinyxml libzip libpng libfreetype libparsersvg libagg
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(addprefix $(LOCAL_PATH)/, $(sort $(dir $(FILE_LIST))))
LOCAL_SRC_FILES := ewolAndroidAbstraction.cpp \
$(FILE_LIST)
LOCAL_LDLIBS := -llog -landroid
# -frtti
ifeq ($(DEBUG),1)
LOCAL_CFLAGS := -D__PLATFORM__Android \
-D__MODE__Touch \
-DETK_DEBUG_LEVEL=3 \
-DAPPL_DEBUG_LEVEL=3 \
-DPROJECT_NAME="\"$(LOCAL_MODULE)\""
else
LOCAL_CFLAGS := -D__PLATFORM__Android \
-D__MODE__Touch \
-DETK_DEBUG_LEVEL=1 \
-DAPPL_DEBUG_LEVEL=1 \
-DMODE_RELEASE \
-DPROJECT_NAME="\"$(LOCAL_MODULE)\""
endif
include $(BUILD_SHARED_LIBRARY)
NDK_MODULE_PATH := $(LOCAL_PATH)/../../

View File

@@ -5,16 +5,36 @@ include $(CLEAR_VARS)
# load the common sources file of the platform
include $(LOCAL_PATH)/file.mk
LOCAL_MODULE := ednn
LOCAL_STATIC_LIBRARIES := ewol etk tinyxml libzip libpng
# name of the librairy
LOCAL_MODULE := edn
# get the tag of the current project :
LOCAL_VERSION_TAG=$(shell cd $(LOCAL_PATH) ; git describe --tags)
LOCAL_VERSION_TAG_SHORT=$(shell cd $(LOCAL_PATH) ; git describe --tags --abbrev=0)
$(info $(LOCAL_MODULE) version TAG : $(LOCAL_VERSION_TAG))
# name of the dependency
LOCAL_STATIC_LIBRARIES := etk ewol tinyxml libzip libpng libfreetype parsersvg agg
LOCAL_C_INCLUDES := -I$(LOCAL_PATH) $(addprefix -I$(LOCAL_PATH)/, $(sort $(dir $(FILE_LIST))))
LOCAL_SRC_FILES := $(FILE_LIST)
LOCAL_LDLIBS :=
LOCAL_CFLAGS := -DEWOL_USE_FREE_TYPE \
-DEDN_DEBUG_LEVEL=3
ifeq ($(DEBUG),1)
LOCAL_CFLAGS := -D__PLATFORM__Linux \
-DETK_DEBUG_LEVEL=3 \
-DAPPL_DEBUG_LEVEL=3 \
-DPROJECT_NAME="\"$(LOCAL_MODULE)\""
else
LOCAL_CFLAGS := -D__PLATFORM__Linux \
-DETK_DEBUG_LEVEL=3 \
-DAPPL_DEBUG_LEVEL=1 \
-DMODE_RELEASE \
-DPROJECT_NAME="\"$(LOCAL_MODULE)\""
endif
include $(BUILD_EXECUTABLE)

136
jni/appl/Buffer/Buffer.cpp Normal file
View File

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

139
jni/appl/Buffer/Buffer.h Normal file
View File

@@ -0,0 +1,139 @@
/**
*******************************************************************************
* @file Buffer.h
* @brief Editeur De N'ours : Text Buffer (header)
* @author Edouard DUPIN
* @date 08/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __BUFFER_H__
#define __BUFFER_H__
#include <etk/UString.h>
#include <etk/File.h>
#include <etk/unicode.h>
#include <ewol/ewol.h>
typedef struct{
uint32_t nbTotalLine; //!< Number of line in the buffer
uint32_t nbTotalColomn; //!< Number of line in the buffer
uint32_t startLineDisplay; //!< First line display.
uint32_t startColomnDisplay; //!< First Colomn displayed
uint32_t diplayableColomn; //!< NB colomn that can be displayed
uint32_t diplayableLine; //!< NB Line that can be displayed
}infoStatBuffer_ts;
class Buffer {
public:
Buffer(void);
Buffer(etk::File &newName);
virtual ~Buffer(void);
etk::File GetFileName(void)
{
return m_fileName;
};
void SetFileName(etk::File &newName)
{
m_fileName = newName;
m_haveName = true;
NameChange();
};
void SetFileName(etk::UString &newName)
{
m_fileName.SetCompleateName(newName, etk::FILE_TYPE_DIRECT);
m_haveName = true;
NameChange();
};
bool HaveName(void)
{
return m_haveName;
}
virtual void Save(void) {};
bool IsModify(void);
protected:
void SetModify(bool status);
virtual void NameChange(void) { /*APPL_DEBUG("check name change ==> no HL change possible");*/};
public:
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate) {};
virtual void SetLineDisplay(uint32_t lineNumber) {};
virtual int32_t Display(ewol::OObject2DTextColored& OOTextNormal,
ewol::OObject2DTextColored& OOTextBold,
ewol::OObject2DTextColored& OOTextItalic,
ewol::OObject2DTextColored& OOTextBoldItalic,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
{
return ERR_NONE;
}
virtual void AddChar(uniChar_t unicodeData) {};
virtual void cursorMove(ewol::eventKbMoveType_te moveTypeEvent) {};
virtual void MouseSelectFromCursorTo(int32_t fontId, int32_t width, int32_t height) {};
virtual void MouseEvent(int32_t fontId, int32_t width, int32_t height) {};
virtual void MouseEventDouble(void) {};
virtual void MouseEventTriple(void) {};
virtual void RemoveLine(void) {};
virtual void SelectAll(void) {};
virtual void SelectNone(void) {};
virtual void Undo(void) {};
virtual void Redo(void) {};
virtual void SetCharset(unicode::charset_te newCharset) {};
//virtual void SelectAll(void);
virtual void Copy(int8_t clipboardID) {};
virtual void Cut(int8_t clipboardID) {};
virtual void Paste(int8_t clipboardID) {};
virtual void Search(etk::UString &data, bool back, bool caseSensitive, bool wrap, bool regExp) {};
virtual void Replace(etk::UString &data) {};
virtual int32_t FindLine(etk::UString &data) { return 0; };
virtual void JumpAtLine(int32_t newLine) {};
virtual int32_t GetCurrentLine(void) { return 0; };
virtual int32_t GetNumberOfLine(void) { return 1; };
// moving with cursor change position:
private:
bool m_updatePositionRequested; //!< if a position xhange in the windows ...
coord2D_ts m_maximumSize; //!< current maxSize of the buffer
protected:
void RequestUpdateOfThePosition(void) { m_updatePositionRequested = true; };
void SetMaximumSize(coord2D_ts maxSize) { m_maximumSize = maxSize; };
public:
bool NeedToUpdateDisplayPosition(void);
virtual coord2D_ts GetBorderSize(void); // this is to requested the minimum size for the buffer that is not consider as visible ...
virtual coord2D_ts GetPosition(int32_t fontId, bool& centerRequested);
coord2D_ts GetMaxSize(void) { return m_maximumSize; };
protected:
bool m_fileModify; //!<
// naming
etk::File m_fileName; //!< filename of the curent buffer
bool m_haveName; //!< to know if the file have a name or NOT
};
#endif

View File

@@ -23,8 +23,8 @@
*******************************************************************************
*/
#include <tools_debug.h>
#include <tools_globals.h>
#include <appl/Debug.h>
#include <appl/global.h>
#include <BufferEmpty.h>
#include <ColorizeManager.h>
#include <MainWindows.h>
@@ -67,39 +67,35 @@ BufferEmpty::~BufferEmpty(void)
* @return ---
*
*/
int32_t BufferEmpty::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY)
int32_t BufferEmpty::Display(ewol::OObject2DTextColored& OOTextNormal,
ewol::OObject2DTextColored& OOTextBold,
ewol::OObject2DTextColored& OOTextItalic,
ewol::OObject2DTextColored& OOTextBoldItalic,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
{
ColorizeManager * myColorManager = ColorizeManager::getInstance();
// Get color :
Colorize *myColor = NULL;
//drawer.Flush();
int32_t fontId = OOTextNormal.GetFontID();
int32_t letterHeight = ewol::GetHeight(fontId);
if (NULL == OOText) {
EDN_ERROR("Input VALUE is NULL");
return ERR_FAIL;
}
if (NULL == OOColored) {
EDN_ERROR("Input VALUE is NULL");
return ERR_FAIL;
}
coord2D_ts textPos;
textPos.x = 20;
textPos.y = 20;
myColor = myColorManager->Get("normal");
OOText->SetColor(myColor->GetFG());
OOText->TextAdd(20, 20, "edn - Editeur De N'ours, l'Editeur Desoxyribo-Nucleique", sizeX);
myColor = ColorizeManager::Get("normal");
OOTextBold.SetColor(myColor->GetFG());
etk::UString tmpDisplay = "edn - Editeur De N'ours";
OOTextBold.Text(textPos, tmpDisplay);
myColor = myColorManager->Get("commentDoxygen");
OOText->SetColor(myColor->GetFG());
OOText->TextAdd(20, 50, "No Buffer Availlable to display", sizeX);
myColor = ColorizeManager::Get("commentDoxygen");
OOTextNormal.SetColor(myColor->GetFG());
textPos.y = (int32_t)(textPos.y + letterHeight*1.30);
tmpDisplay = "No Buffer Availlable to display";
OOTextNormal.Text(textPos, tmpDisplay);
color_ts bgColor; //!< Text color
bgColor.red = 1.0;
bgColor.green = 1.0;
bgColor.blue = 1.0;
bgColor.alpha = 1.0;
OOColored->SetColor(bgColor);
OOColored->Rectangle( 0, 0, sizeX, sizeY);
OOColored.SetColor(etk::color::color_White);
OOColored.Rectangle( 0, 0, sizeX, sizeY);
return ERR_NONE;
}

View File

@@ -32,7 +32,11 @@ class BufferEmpty : public Buffer {
public:
BufferEmpty(void);
virtual ~BufferEmpty(void);
int32_t Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY);
int32_t Display(ewol::OObject2DTextColored& OOTextNormal,
ewol::OObject2DTextColored& OOTextBold,
ewol::OObject2DTextColored& OOTextItalic,
ewol::OObject2DTextColored& OOTextBoldItalic,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY);
};

View File

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

View File

@@ -0,0 +1,51 @@
/**
*******************************************************************************
* @file BufferManager.h
* @brief Editeur De N'ours : Text Buffer (header)
* @author Edouard DUPIN
* @date 08/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __BUFFER_MANAGER_H__
#define __BUFFER_MANAGER_H__
#include <Buffer.h>
#include <BufferText.h>
#include <BufferEmpty.h>
#include <appl/globalMsg.h>
#include <ewol/Widget.h>
namespace BufferManager
{
void Init(void);
void UnInit(void);
int32_t GetSelected(void);
Buffer * Get(int32_t BufferID);
bool Exist(int32_t BufferID);
bool Exist(etk::File &myFile);
int32_t GetId(etk::File &myFile);
// return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5
uint32_t Size(void);
uint32_t SizeOpen(void);
int32_t WitchBuffer(int32_t iEmeElement);
};
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -46,24 +46,27 @@ class BufferText : public Buffer {
void GetInfo(infoStatBuffer_ts &infoToUpdate);
void SetLineDisplay(uint32_t lineNumber);
int32_t Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY);
void ForceReDraw(bool allElement);
void AddChar(char * UTF8data);
int32_t Display(ewol::OObject2DTextColored& OOTextNormal,
ewol::OObject2DTextColored& OOTextBold,
ewol::OObject2DTextColored& OOTextItalic,
ewol::OObject2DTextColored& OOTextBoldItalic,
ewol::OObject2DColored& OOColored,
int32_t offsetX, int32_t offsetY,
int32_t sizeX, int32_t sizeY);
void AddChar(uniChar_t unicodeData);
void cursorMove(ewol::eventKbMoveType_te moveTypeEvent);
void MouseSelectFromCursorTo(int32_t width, int32_t height);
void MouseEvent(int32_t width, int32_t height);
void MouseSelectFromCursorTo(int32_t fontId, int32_t width, int32_t height);
void MouseEvent(int32_t fontId, 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(etk::String &data, bool back, bool caseSensitive, bool wrap, bool regExp);
void Replace(etk::String &data);
int32_t FindLine(etk::String &data);
void Search(etk::UString &data, bool back, bool caseSensitive, bool wrap, bool regExp);
void Replace(etk::UString &data);
int32_t FindLine(etk::UString &data);
void JumpAtLine(int32_t newLine);
int32_t GetCurrentLine(void);
@@ -72,51 +75,37 @@ class BufferText : public Buffer {
void SelectNone(void);
void Undo(void);
void Redo(void);
void SetCharset(charset_te newCharset);
void SetCharset(unicode::charset_te newCharset);
int32_t GetNumberOfLine(void);
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 :
int32_t GetLineNumberNumberOfElement(void);
// 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
coord2D_ts m_displaySize; //!< number of char displayable in the screan
// Cursor :
int32_t m_cursorPos; //!< position in the buffer of the cursor
int32_t m_cursorPreferredCol; //!< colomn of the last up and down ...
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);
void BasicInit(void);
private:
bool m_centerRequested;
public:
virtual coord2D_ts GetPosition(int32_t fontId, bool& centerRequested);
private:
bool TextDMoveUp(int32_t offset);
bool TextDMoveDown(int32_t offset);
void SetInsertPosition(int32_t newPosition, bool insertChar = false);
void GetMousePosition(int32_t width, int32_t height, int32_t &x, int32_t &y);
void MoveUpDown(int32_t ofset);
void DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY,char *myPrint, int32_t lineNumber, int32_t positionY);
int32_t GetMousePosition(int32_t fontId, int32_t width, int32_t height);
void CursorDisplay(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth);
void DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY, int32_t nbColomn, int32_t lineNumber, int32_t positionY);
void DrawCursor(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth, clipping_ts &clip);
};

View File

@@ -23,8 +23,10 @@
*******************************************************************************
*/
#include <tools_debug.h>
#include <tools_globals.h>
#include <etk/Types.h>
#include <etk/unicode.h>
#include <appl/Debug.h>
#include <appl/global.h>
#include <EdnBuf.h>
@@ -69,7 +71,7 @@ EdnBuf::EdnBuf(void)
// charset :
m_isUtf8 = false;
m_charsetType = EDN_CHARSET_ISO_8859_15;
m_charsetType = unicode::EDN_CHARSET_ISO_8859_15;
m_isUndoProcessing = false;
m_isRedoProcessing = false;
@@ -77,7 +79,6 @@ EdnBuf::EdnBuf(void)
// basicly no HL system ...
m_Highlight = NULL;
m_nbLine = 1;
m_HLDataSequence = 0;
}
/**
@@ -161,7 +162,27 @@ void EdnBuf::GetRange(int32_t start, int32_t end, etk::VectorType<int8_t> &outpu
output.Clear();
// import data :
m_data.Get(start, end-start, output);
//EDN_DEBUG("request start=" << start << " end="<< end << " size="<< end-start << " result size=" << output.Size() );
//APPL_DEBUG("request start=" << start << " end="<< end << " size="<< end-start << " result size=" << output.Size() );
}
void EdnBuf::GetRange(int32_t start, int32_t end, etk::UString &output)
{
// Remove all data ...
output = "";
// import data :
etk::VectorType<int8_t> localOutput;
m_data.Get(start, end-start, localOutput);
// transcript in UNICODE ...
if (true == m_isUtf8) {
localOutput.PushBack('\0');
output = (char*)&localOutput[0];
} else {
etk::VectorType<uniChar_t> tmpUnicodeData;
// transform in unicode :
convertIsoToUnicode(m_charsetType, localOutput, tmpUnicodeData);
output = tmpUnicodeData;
}
//APPL_DEBUG("request start=" << start << " end="<< end << " size="<< end-start << " result size=" << output.Size() );
}
@@ -189,18 +210,30 @@ int8_t EdnBuf::operator[] (int32_t pos)
* @return ---
*
*/
void EdnBuf::Insert(int32_t pos, etk::VectorType<int8_t> &insertText)
int32_t EdnBuf::Insert(int32_t pos, etk::VectorType<int8_t> &insertText)
{
// if pos is not contiguous to existing text, make it
pos = edn_average(0, pos, m_data.Size() );
pos = etk_avg(0, pos, m_data.Size() );
// insert Data
insert(pos, insertText);
int32_t sizeInsert=LocalInsert(pos, insertText);
// Call the redisplay ...
etk::VectorType<int8_t> deletedText;
eventModification(pos, insertText.Size(), deletedText);
return sizeInsert;
}
int32_t EdnBuf::Insert(int32_t pos, etk::UString &insertText)
{
// if pos is not contiguous to existing text, make it
pos = etk_avg(0, pos, m_data.Size() );
// insert Data
int32_t sizeInsert=LocalInsert(pos, insertText);
// Call the redisplay ...
etk::VectorType<int8_t> deletedText;
eventModification(pos, insertText.Size(), deletedText);
return sizeInsert;
}
/**
* @brief Replace data in the buffer
@@ -209,16 +242,46 @@ void EdnBuf::Insert(int32_t pos, etk::VectorType<int8_t> &insertText)
* @param[in] end Position ended in the buffer
* @param[in] insertText Test to set in the range [start..end]
*
* @return ---
* @return nb Octet inserted
*
*/
void EdnBuf::Replace(int32_t start, int32_t end, etk::VectorType<int8_t> &insertText)
int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::VectorType<int8_t> &insertText)
{
etk::VectorType<int8_t> deletedText;
GetRange(start, end, deletedText);
m_data.Replace(start, end-start, insertText);
// update internal elements
eventModification(start, insertText.Size(), deletedText);
return insertText.Size();
}
int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::UString &insertText)
{
etk::VectorType<int8_t> deletedText;
GetRange(start, end, deletedText);
etk::VectorType<int8_t> tmpInsertText;
if (true == m_isUtf8) {
char * tmpPointer = insertText.Utf8Data();
while (*tmpPointer != '\0') {
tmpInsertText.PushBack(*tmpPointer++);
}
} else {
etk::VectorType<unsigned int> tmppp = insertText.GetVector();
convertUnicodeToIso(m_charsetType, tmppp, tmpInsertText);
}
if (tmpInsertText.Size()>0) {
if (tmpInsertText[tmpInsertText.Size()-1] == '\0') {
tmpInsertText.PopBack();
}
}
if (tmpInsertText.Size()>0) {
if (tmpInsertText[tmpInsertText.Size()-1] == '\0') {
tmpInsertText.PopBack();
}
}
m_data.Replace(start, end-start, tmpInsertText);
// update internal elements
eventModification(start, tmpInsertText.Size(), deletedText);
return tmpInsertText.Size();
}
@@ -241,8 +304,8 @@ void EdnBuf::Remove(int32_t start, int32_t end)
start = end;
end = temp;
}
start = edn_average(0 , start, m_data.Size());
end = edn_average(0 , end, m_data.Size());
start = etk_avg(0 , start, m_data.Size());
end = etk_avg(0 , end, m_data.Size());
// Remove and redisplay
GetRange(start, end, deletedText);
@@ -468,7 +531,7 @@ int32_t EdnBuf::GetExpandedChar(int32_t &pos, int32_t indent, char outUTF8[MAX_E
tmpString[6] = '\0';
uint8_t size;
bool baseValid;
Utf8_SizeElement(tmpString, 6 , size, baseValid);
unicode::Utf8_SizeElement(tmpString, 6 , size, baseValid);
currentChar = 0; // TODO : Set UNICODE char ...
if (true == baseValid) {
char *tmp = outUTF8;
@@ -480,7 +543,7 @@ int32_t EdnBuf::GetExpandedChar(int32_t &pos, int32_t indent, char outUTF8[MAX_E
sprintf(outUTF8, "<? ? ? ?>");
}
if (0 == size) {
EDN_ERROR("plop");
APPL_ERROR("plop");
}
pos+=size;
return strlen(outUTF8);
@@ -488,6 +551,119 @@ int32_t EdnBuf::GetExpandedChar(int32_t &pos, int32_t indent, char outUTF8[MAX_E
return 1;
}
/**
* @brief Transform the current caracter in the buffer in a displayable vector of char
*
* @param[in,out] pos position of the char that might be converted (incremented to the next char (in case of UTF8)
* @param[in] indent Curent indentation befor the curent char
* @param[out] outUTF8 string of the displayed element
* @param[out] currentChar curent unicode output char
*
* @return number of displayable char (display char width)
*
*/
int32_t EdnBuf::GetExpandedChar(int32_t &pos, int32_t indent, uniChar_t outUnicode[MAX_EXP_CHAR_LEN], uint32_t &currentChar)
{
int32_t i, nSpaces;
char c = m_data.Get(pos);
currentChar = (uint32_t)c & 0xFF;
/* Convert tabs to spaces */
if (c == '\t') {
nSpaces = m_tabDist - (indent % m_tabDist);
for (i=0; i<nSpaces; i++) {
outUnicode[i] = ' ';
}
outUnicode[i] = '\0';
pos++;
return nSpaces;
}
// Convert ASCII control codes to readable character sequences
if (c == '\0') {
outUnicode[0] = '<';
outUnicode[1] = 'n';
outUnicode[2] = 'u';
outUnicode[3] = 'l';
outUnicode[4] = '>';
outUnicode[5] = '\0';
pos++;
return 5;
}
if (((unsigned char)c) == '\n') {
outUnicode[0] = (unsigned char)c;
outUnicode[1] = '\0';
pos++;
return 1;
}
if (((unsigned char)c) <= 31) {
const char * tmp = ControlCodeTable[(unsigned char)c];
int32_t nbElem = 2;
*outUnicode++ = '<';
while (*tmp!='\0') {
*outUnicode++ = *tmp;
tmp++;
nbElem++;
}
*outUnicode++ = '>';
*outUnicode++ = '\0';
pos++;
return nbElem;
} else if (c == 127) {
outUnicode[0] = '<';
outUnicode[1] = 'd';
outUnicode[2] = 'e';
outUnicode[3] = 'l';
outUnicode[4] = '>';
outUnicode[5] = '\0';
pos++;
return 5;
}
// clear all the data ...
memset(outUnicode, 0, sizeof(uniChar_t)*MAX_EXP_CHAR_LEN);
// Otherwise, just return the character
if (false ==m_isUtf8) {
unicode::convertIsoToUnicode(m_charsetType, c, outUnicode[0]);
pos++;
} else {
char tmpString[8];
for (int32_t k=0; k<6 && k< m_data.Size() - pos; k++) {
tmpString[k] = m_data.Get(pos+k);
}
tmpString[6] = '\0';
uint8_t size;
bool baseValid;
unicode::Utf8_SizeElement(tmpString, 6 , size, baseValid);
currentChar = 0;
if (true == baseValid) {
char tmp[20];
for (int32_t kkk=0; kkk<size; kkk++) {
tmp[kkk] = tmpString[kkk];
tmp[kkk+1] = '\0';
}
unicode::convertUtf8ToUnicode(tmp, outUnicode[0]);
outUnicode[1] = 0;
} else {
outUnicode[0] = '<';
outUnicode[1] = '?';
outUnicode[2] = '?';
outUnicode[3] = '?';
outUnicode[4] = '>';
outUnicode[5] = 0;
}
if (0 == size) {
APPL_ERROR("plop");
}
pos+=size;
int32_t outSize = 0;
while (outUnicode[outSize]!=0) {
outSize++;
}
return outSize;
}
return 1;
}
/**
* @brief generate the real display of character of the output (ex : \t ==> 4 spaces or less ...)
@@ -545,7 +721,7 @@ int32_t EdnBuf::ExpandCharacter(char c, int32_t indent, char outUTF8[MAX_EXP_CHA
// Otherwise, just return the character
//*outStr = c; // deprecated
convertIsoToUtf8(EDN_CHARSET_ISO_8859_15, c, outUTF8);
convertIsoToUtf8(unicode::EDN_CHARSET_ISO_8859_15, c, outUTF8);
return 1;
}
@@ -592,14 +768,14 @@ int32_t EdnBuf::CountDispChars(int32_t lineStartPos, int32_t targetPos)
int32_t charCount = 0;
char expandedChar[MAX_EXP_CHAR_LEN];
//EDN_DEBUG("lineStartPos="<< lineStartPos << " targetPos=" << targetPos);
//APPL_DEBUG("lineStartPos="<< lineStartPos << " targetPos=" << targetPos);
while( myPosIt
&& myPosIt.Position() < targetPos )
{
charCount += ExpandCharacter(*myPosIt, charCount, expandedChar);
myPosIt++;
}
//EDN_DEBUG(" result=" << charCount);
//APPL_DEBUG(" result=" << charCount);
return charCount;
}
@@ -727,19 +903,19 @@ int32_t EdnBuf::CountForwardNLines(int32_t startPos, int32_t nLines)
}
EdnVectorBuf::Iterator myPosIt = m_data.Position(startPos);
int32_t lineCount = 0;
//EDN_INFO("startPos=" << startPos << " nLines=" << nLines);
//APPL_INFO("startPos=" << startPos << " nLines=" << nLines);
while(myPosIt)
{
if ('\n' == *myPosIt) {
lineCount++;
if (lineCount == nLines) {
//EDN_INFO(" ==> (1) at position=" << myPosIt.Position()+1 );
//APPL_INFO(" ==> (1) at position=" << myPosIt.Position()+1 );
return myPosIt.Position()+1;
}
}
myPosIt++;
}
//EDN_INFO(" ==> (2) at position=" << myPosIt.Position() );
//APPL_INFO(" ==> (2) at position=" << myPosIt.Position() );
return myPosIt.Position();
}
@@ -760,7 +936,7 @@ int32_t EdnBuf::CountBackwardNLines(int32_t startPos, int32_t nLines)
} else if (startPos > m_data.Size() ) {
startPos = m_data.Size();
}
//EDN_INFO("startPos=" << startPos << " nLines=" << nLines);
//APPL_INFO("startPos=" << startPos << " nLines=" << nLines);
EdnVectorBuf::Iterator myPosIt = m_data.Position(startPos-1);
int32_t lineCount = -1;
@@ -769,13 +945,13 @@ int32_t EdnBuf::CountBackwardNLines(int32_t startPos, int32_t nLines)
if ('\n' == *myPosIt) {
lineCount++;
if (lineCount >= nLines) {
//EDN_INFO(" ==> (1) at position=" << myPosIt.Position()+1 );
//APPL_INFO(" ==> (1) at position=" << myPosIt.Position()+1 );
return myPosIt.Position()+1;
}
}
myPosIt--;
}
//EDN_INFO(" ==> (2) at position=0");
//APPL_INFO(" ==> (2) at position=0");
return 0;
}
@@ -791,10 +967,10 @@ bool EdnBuf::charMatch(char first, char second, bool caseSensitive)
}
}
if(first == second) {
//EDN_DEBUG("charMatch(" << first << ", " << second << ", " << caseSensitive << ") ==> true");
//APPL_DEBUG("charMatch(" << first << ", " << second << ", " << caseSensitive << ") ==> true");
return true;
} else {
//EDN_DEBUG("charMatch(" << first << ", " << second << ", " << caseSensitive << ") ==> false");
//APPL_DEBUG("charMatch(" << first << ", " << second << ", " << caseSensitive << ") ==> false");
return false;
}
}
@@ -816,7 +992,7 @@ bool EdnBuf::SearchForward(int32_t startPos, etk::VectorType<int8_t> &searchVect
int32_t searchLen = searchVect.Size();
int32_t dataLen = m_data.Size();
char currentChar = '\0';
//EDN_INFO(" startPos=" << startPos << " searchLen=" << searchLen);
//APPL_INFO(" startPos=" << startPos << " searchLen=" << searchLen);
for (position=startPos; position<dataLen - (searchLen-1); position++) {
currentChar = m_data[position];
if (true == charMatch(currentChar, searchVect[0], caseSensitive)) {
@@ -856,7 +1032,7 @@ bool EdnBuf::SearchBackward(int32_t startPos, etk::VectorType<int8_t> &searchVec
int32_t position;
int32_t searchLen = searchVect.Size();
char currentChar = '\0';
//EDN_INFO(" startPos=" << startPos << " searchLen=" << searchLen);
//APPL_INFO(" startPos=" << startPos << " searchLen=" << searchLen);
for (position=startPos; position>=searchLen-1; position--) {
currentChar = m_data[position];
if (true == charMatch(currentChar, searchVect[searchLen-1], caseSensitive)) {
@@ -887,10 +1063,10 @@ static bool isChar(char value)
|| '_' == value
|| '~' == value)
{
//EDN_DEBUG(" is a char \"" << value << "\"");
//APPL_DEBUG(" is a char \"" << value << "\"");
return true;
}
//EDN_DEBUG(" is NOT a char \"" << value << "\"");
//APPL_DEBUG(" is NOT a char \"" << value << "\"");
return false;
}
@@ -901,7 +1077,7 @@ bool EdnBuf::SelectAround(int32_t startPos, int32_t &beginPos, int32_t &endPos)
if( '\t' == currentChar
|| ' ' == currentChar)
{
EDN_DEBUG("select spacer");
APPL_DEBUG("select spacer");
// special case we are looking for separation
for (beginPos=startPos; beginPos>=0; beginPos--) {
currentChar = m_data[beginPos];
@@ -923,7 +1099,7 @@ bool EdnBuf::SelectAround(int32_t startPos, int32_t &beginPos, int32_t &endPos)
}
return true;
} else if( true == isChar(currentChar)){
EDN_DEBUG("select normal Char");
APPL_DEBUG("select normal Char");
// Search back
for (beginPos=startPos; beginPos>=0; beginPos--) {
currentChar = m_data[beginPos];
@@ -942,7 +1118,7 @@ bool EdnBuf::SelectAround(int32_t startPos, int32_t &beginPos, int32_t &endPos)
return true;
} else {
char comparechar = currentChar;
EDN_DEBUG("select same char");
APPL_DEBUG("select same char");
// Search back
for (beginPos=startPos; beginPos>=0; beginPos--) {
currentChar = m_data[beginPos];
@@ -977,7 +1153,7 @@ bool EdnBuf::SelectAround(int32_t startPos, int32_t &beginPos, int32_t &endPos)
* @return number of element inserted.
*
*/
int32_t EdnBuf::insert(int32_t pos, etk::VectorType<int8_t> &insertText)
int32_t EdnBuf::LocalInsert(int32_t pos, etk::VectorType<int8_t> &insertText)
{
// Insert data in buffer
m_data.Insert(pos, insertText);
@@ -986,6 +1162,25 @@ int32_t EdnBuf::insert(int32_t pos, etk::VectorType<int8_t> &insertText)
// return the number of element inserted ...
return insertText.Size();
}
int32_t EdnBuf::LocalInsert(int32_t pos, etk::UString &insertText)
{
etk::VectorType<int8_t> tmpInsertText;
if (true == m_isUtf8) {
char * tmpPointer = insertText.Utf8Data();
while (*tmpPointer != '\0') {
tmpInsertText.PushBack(*tmpPointer++);
}
} else {
etk::VectorType<unsigned int> tmppp = insertText.GetVector();
convertUnicodeToIso(m_charsetType, tmppp, tmpInsertText);
}
if (tmpInsertText.Size()>0) {
if (tmpInsertText[tmpInsertText.Size()-1] == '\0') {
tmpInsertText.PopBack();
}
}
return LocalInsert(pos, tmpInsertText);
}
/**
@@ -1004,13 +1199,13 @@ void EdnBuf::eventModification(int32_t pos, int32_t nInserted, etk::VectorType<i
&& 0 == nInserted)
{
// we do nothing ...
//EDN_INFO("EdnBuf::eventModification(pos="<<pos<<", ... , nRestyled=" << nRestyled << ", deletedText=\"" << textDisplay << "\");");
//APPL_INFO("EdnBuf::eventModification(pos="<<pos<<", ... , nRestyled=" << nRestyled << ", deletedText=\"" << textDisplay << "\");");
} else {
EDN_INFO("(pos="<<pos<<", nDeleted="<<deletedText.Size()<<", nInserted=" << nInserted << ", deletedText=\"xx???xx\");");
APPL_INFO("(pos="<<pos<<", nDeleted="<<deletedText.Size()<<", nInserted=" << nInserted << ", deletedText=\"xx???xx\");");
// update the number of lines :
//CountNumberOfLines(); //==> not efficent methode ...
// ==> better methode : just update the number of line added and removed ...
//EDN_INFO(" add=" << CountLines(pos, pos+nInserted) << " lines | remove="<< CountLines(deletedText) << " lines");
//APPL_INFO(" add=" << CountLines(pos, pos+nInserted) << " lines | remove="<< CountLines(deletedText) << " lines");
m_nbLine += CountLines(pos, pos+nInserted) - CountLines(deletedText);
// Update histories
if (false == m_isUndoProcessing) {

View File

@@ -34,7 +34,7 @@ class EdnBuf;
#include <EdnVectorBuf.h>
#include <EdnBufHistory.h>
#include <HighlightManager.h>
#include <charset.h>
#include <etk/unicode.h>
/*
@@ -68,7 +68,6 @@ typedef enum{
typedef struct {
etk::VectorType<colorInformation_ts> HLData;
int32_t idSequence;
int32_t posHLPass1;
int32_t posHLPass2;
}displayHLData_ts;
@@ -76,6 +75,7 @@ typedef struct {
class EdnBuf {
// TODO : Set an iterator to acces at every data without knowin the system ...
public:
// constructer
EdnBuf(void);
@@ -85,12 +85,15 @@ class EdnBuf {
void GetAll( etk::VectorType<int8_t> &text);
void SetAll( etk::VectorType<int8_t> &text);
void GetRange( int32_t start, int32_t end, etk::VectorType<int8_t> &output);
void GetRange( int32_t start, int32_t end, etk::UString &output);
bool DumpIn( FILE *myFile);
bool DumpFrom( FILE *myFile);
// replace with operator [] ...
int8_t operator[] (int32_t);
void Insert( int32_t pos, etk::VectorType<int8_t> &insertText);
void Replace( int32_t start, int32_t end, etk::VectorType<int8_t> &insertText);
int32_t Insert( int32_t pos, etk::VectorType<int8_t> &insertText);
int32_t Insert( int32_t pos, etk::UString &insertText);
int32_t Replace( int32_t start, int32_t end, etk::VectorType<int8_t> &insertText);
int32_t Replace( int32_t start, int32_t end, etk::UString &insertText);
void Remove( int32_t start, int32_t end);
int32_t Indent( selectionType_te select);
int32_t UnIndent( selectionType_te select);
@@ -100,9 +103,10 @@ class EdnBuf {
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 GetExpandedChar( int32_t &pos, int32_t indent, uniChar_t outUnicode[MAX_EXP_CHAR_LEN], uint32_t &currentChar);
int32_t GetExpandedChar( int32_t &pos, int32_t indent, char outUTF8[MAX_EXP_CHAR_LEN], uint32_t &currentChar);
int32_t ExpandCharacter( char c, int32_t indent, char outUTF8[MAX_EXP_CHAR_LEN]); // TODO : Remove
int32_t CharWidth( char c, int32_t indent); // TODO : rework this
int32_t CountDispChars( int32_t lineStartPos, int32_t targetPos);
int32_t CountForwardDispChars( int32_t lineStartPos, int32_t nChars);
int32_t CountLines( int32_t startPos, int32_t endPos);
@@ -131,8 +135,10 @@ class EdnBuf {
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, etk::VectorType<int8_t> &text);
void GetSelectionText( selectionType_te select, etk::UString &text);
void RemoveSelected( selectionType_te select);
void ReplaceSelected( selectionType_te select, etk::VectorType<int8_t> &text);
int32_t ReplaceSelected( selectionType_te select, etk::VectorType<int8_t> &text);
int32_t ReplaceSelected( selectionType_te select, etk::UString &text);
private:
// current selection of the buffer
selection m_selectionList[SELECTION_SIZE]; //!< Selection area of the buffer
@@ -157,7 +163,6 @@ class EdnBuf {
private:
Highlight * m_Highlight; //!< internal link with the Highlight system
etk::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);
@@ -178,19 +183,19 @@ class EdnBuf {
// 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; };
int32_t GetTabDistance(void) { return m_tabDist; } ;
void SetTabDistance(int32_t tabDist) { m_tabDist = tabDist; };
unicode::charset_te GetCharsetType(void) { return m_charsetType; };
void SetCharsetType(unicode::charset_te newOne) { m_charsetType = newOne; if (unicode::EDN_CHARSET_UTF8==newOne){m_isUtf8=true;} else {m_isUtf8=false;} };
bool GetUTF8Mode(void) { return m_isUtf8; };
void SetUTF8Mode(bool newOne) { m_isUtf8 = newOne; m_charsetType=unicode::EDN_CHARSET_UTF8; };
private:
// Special mode of the buffer :
bool m_isUtf8; //!< true if we are in UTF8 mode ==> if true the size of a char is 0, otherwise .. 1->4 ( TODO : not now)
charset_te m_charsetType; //!< if UTF8 mode is at false : the charset type of the buffer
bool m_isUtf8; //!< true if we are in UTF8 mode ==> if true the size of a char is 0, otherwise .. 1->4 ( TODO : not now)
unicode::charset_te m_charsetType; //!< if UTF8 mode is at false : the charset type of the buffer
// Local Tabulation policies
int32_t m_tabDist; //!< equiv. number of characters in a tab
bool m_useTabs; //!< True if buffer routines are allowed to use tabs for padding in rectangular operations
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 :
@@ -204,7 +209,8 @@ class EdnBuf {
void eventModification( int32_t pos, int32_t nInserted, etk::VectorType<int8_t> &deletedText);
int32_t insert( int32_t pos, etk::VectorType<int8_t> &insertText);
int32_t LocalInsert( int32_t pos, etk::VectorType<int8_t> &insertText);
int32_t LocalInsert( int32_t pos, etk::UString &insertText);
bool charMatch( char first, char second, bool caseSensitive = true);
};

View File

@@ -24,8 +24,8 @@
*/
#include <tools_debug.h>
#include <tools_globals.h>
#include <appl/Debug.h>
#include <appl/global.h>
#include <EdnBufHistory.h>
@@ -34,14 +34,14 @@
EdnBufHistory::EdnBufHistory(void)
{
//EDN_INFO("EdnBufHistory new");
//APPL_INFO("EdnBufHistory new");
m_pos = 0;
m_nInserted = 0;
}
EdnBufHistory::EdnBufHistory(int32_t pos, int32_t nInserted, etk::VectorType<int8_t> &deletedText)
{
//EDN_INFO("EdnBufHistory new + data");
//APPL_INFO("EdnBufHistory new + data");
m_pos = pos;
m_nInserted = nInserted;
m_deletedText = deletedText;
@@ -49,7 +49,7 @@ EdnBufHistory::EdnBufHistory(int32_t pos, int32_t nInserted, etk::VectorType<int
void EdnBufHistory::Set(int32_t pos, int32_t nInserted, etk::VectorType<int8_t> &deletedText)
{
//EDN_INFO("EdnBufHistory new + data");
//APPL_INFO("EdnBufHistory new + data");
m_pos = pos;
m_nInserted = nInserted;
m_deletedText = deletedText;

View File

@@ -23,8 +23,8 @@
*******************************************************************************
*/
#include <tools_debug.h>
#include <tools_globals.h>
#include <appl/Debug.h>
#include <appl/global.h>
#include <EdnBuf.h>
@@ -46,9 +46,6 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
//GTimeVal timeStart;
//g_get_current_time(&timeStart);
// remove display HL...
m_HLDataSequence++;
// prevent ERROR...
if (NULL == m_Highlight) {
return;
@@ -60,15 +57,15 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
return;
}
// normal case
//EDN_INFO("(pos="<<pos<<", nbDeleted="<<nbDeleted<<", nbAdded=" << nbAdded << "\");");
//APPL_INFO("(pos="<<pos<<", nbDeleted="<<nbDeleted<<", nbAdded=" << nbAdded << "\");");
int32_t i;
/*
for (i=0; i< (int32_t)m_HLDataPass1.Size(); i++) {
etk::String ploppp;
etk::UString 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 );
APPL_DEBUG("HighLight (previous) element id=" << i << " S=" << m_HLDataPass1[i].beginStart << " E=" << m_HLDataPass1[i].endStop << " patern name=" << ploppp );
}
*/
int32_t posEnd = pos + nbDeleted;
@@ -88,31 +85,31 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
} else if(-1 == startId) {
if (0 == stopId){
m_HLDataPass1.Erase(0);
//EDN_DEBUG("1 * Erase 0");
//APPL_DEBUG("1 * Erase 0");
} else {
m_HLDataPass1.EraseLen(0,stopId);
//EDN_DEBUG("2 * Erase 0->" << stopId);
//APPL_DEBUG("2 * Erase 0->" << stopId);
}
} else if(-1 == stopId) {
//EDN_DEBUG("3 * Erase " << startId+1 << "-> end");
//APPL_DEBUG("3 * Erase " << startId+1 << "-> end");
m_HLDataPass1.EraseLen(startId+1, m_HLDataPass1.Size() - startId);
stopId = -1;
} else {
int32_t currentSize = m_HLDataPass1.Size();
//EDN_DEBUG("4 * Erase " << startId+1 << "->" << stopId << " in " << currentSize << " elements" );
//APPL_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);
//APPL_DEBUG("new size=" << (int32_t)m_HLDataPass1.Size()-1);
/*
for (i=0; i< (int32_t)m_HLDataPass1.Size(); i++) {
etk::String ploppp;
etk::UString 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 );
APPL_DEBUG("HighLight (Middle) element id=" << i << " S=" << m_HLDataPass1[i].beginStart << " E=" << m_HLDataPass1[i].endStop << " patern name=" << ploppp );
}
*/
// update position after the range position :
@@ -123,7 +120,7 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
elemStart = startId+1;
}
for (i=elemStart; i< (int32_t)m_HLDataPass1.Size(); i++) {
//EDN_DEBUG("move element=" << i);
//APPL_DEBUG("move element=" << i);
m_HLDataPass1[i].beginStart += nbAdded - nbDeleted;
m_HLDataPass1[i].beginStop += nbAdded - nbDeleted;
m_HLDataPass1[i].endStart += nbAdded - nbDeleted;
@@ -133,16 +130,16 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
if( -1 == startId
&& -1 == stopId)
{
//EDN_DEBUG("******* Regenerate ALL");
//APPL_DEBUG("******* Regenerate ALL");
GenerateHighLightAt(0, m_data.Size());
} else if(-1 == startId) {
//EDN_DEBUG("******* Regenerate START");
//APPL_DEBUG("******* Regenerate START");
GenerateHighLightAt(0, m_HLDataPass1[0].beginStart, 0);
} else if(-1 == stopId) {
//EDN_DEBUG("******* Regenerate STOP");
//APPL_DEBUG("******* Regenerate STOP");
GenerateHighLightAt(m_HLDataPass1[m_HLDataPass1.Size() -1].endStop, m_data.Size(), m_HLDataPass1.Size());
} else {
//EDN_DEBUG("******* Regenerate RANGE");
//APPL_DEBUG("******* Regenerate RANGE");
GenerateHighLightAt(m_HLDataPass1[startId].endStop, m_HLDataPass1[startId+1].beginStart, startId+1);
}
} else {
@@ -151,16 +148,16 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
}
/*
for (i=0; i< (int32_t)m_HLDataPass1.Size(); i++) {
etk::String ploppp;
etk::UString 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 );
APPL_DEBUG("HighLight (end) element id=" << i << " S=" << m_HLDataPass1[i].beginStart << " E=" << m_HLDataPass1[i].endStop << " patern name=" << ploppp );
}
*/
//GTimeVal timeStop;
//g_get_current_time(&timeStop);
//EDN_DEBUG("HL General = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s");
//APPL_DEBUG("HL General = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s");
}
void EdnBuf::FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t &startId, int32_t &stopId, bool backPreviousNotEnded)
@@ -235,14 +232,14 @@ void EdnBuf::FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t
}
/*
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);
APPL_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);
APPL_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);
APPL_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);
APPL_DEBUG("==> END : start=???, stop=??? id=" << stopId);
}
*/
}
@@ -255,7 +252,7 @@ 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);
//APPL_DEBUG("area : ("<<pos<<","<<endPos<<") insert at : " << addinPos);
m_Highlight->Parse(pos, endPos, m_HLDataPass1, addinPos, m_data);
}
@@ -271,7 +268,7 @@ void EdnBuf::CleanHighLight(void)
colorInformation_ts *EdnBuf::GetElementColorAtPosition(int32_t pos, int32_t &starPos)
{
int32_t i;
int32_t start = edn_max(0, starPos-1);
int32_t start = etk_max(0, starPos-1);
for (i=start; i<(int32_t)m_HLDataPass1.Size(); i++) {
starPos = i;
if( m_HLDataPass1[i].beginStart <= pos
@@ -287,7 +284,6 @@ colorInformation_ts *EdnBuf::GetElementColorAtPosition(int32_t pos, int32_t &sta
}
void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart, int32_t nbLines)
{
MData.posHLPass1 = 0;
@@ -295,65 +291,62 @@ void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart,
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);
//GTimeVal timeStart;
//g_get_current_time(&timeStart);
HLStart = StartOfLine(HLStart);
MData.HLData.Clear();
int32_t HLStop = CountForwardNLines(HLStart, nbLines);
int32_t startId, stopId;
// find element previous
FindMainHighLightPosition(HLStart, HLStop, startId, stopId, true);
int32_t k;
//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,
int32_t k;
//APPL_DEBUG("List of section between : "<< startId << " & " << stopId);
int32_t endSearch = stopId+1;
if (-1 == stopId) {
endSearch = m_HLDataPass1.Size();
}
for (k=etk_max(startId, 0); k<endSearch; k++) {
// empty section :
if (0==k) {
if (HLStart < m_HLDataPass1[k].beginStart) {
//APPL_DEBUG(" ==> (empty section 1 ) k="<<k<<" start="<<HLStart<<" stop="<<m_HLDataPass1[k].beginStart );
m_Highlight->Parse2(HLStart,
m_HLDataPass1[k].beginStart,
MData.HLData,
m_data);
}
// under section :
//EDN_DEBUG(" ==> (under section ) k="<<k<<" start="<<m_HLDataPass1[k].beginStart<<" stop="<<m_HLDataPass1[k].endStop << " subSectionOfID=" << 99999999);
// TODO : ...
} // else : nothing to do ...
} else {
//APPL_DEBUG(" ==> (empty section 2 ) k="<<k<<" start="<<m_HLDataPass1[k-1].endStop<<" stop="<<m_HLDataPass1[k].beginStart );
m_Highlight->Parse2(m_HLDataPass1[k-1].endStop,
m_HLDataPass1[k].beginStart,
MData.HLData,
m_data);
}
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");
// under section :
//APPL_DEBUG(" ==> (under section ) k="<<k<<" start="<<m_HLDataPass1[k].beginStart<<" stop="<<m_HLDataPass1[k].endStop << " subSectionOfID=" << 99999999);
// TODO : ...
}
if (endSearch == (int32_t)m_HLDataPass1.Size() ){
//if( k < (int32_t)m_HLDataPass1.Size()) {
if (m_HLDataPass1.Size() != 0) {
//APPL_DEBUG(" ==> (empty section 3 ) k="<<k<<" start="<<m_HLDataPass1[k-1].endStop<<" stop="<<HLStop );
m_Highlight->Parse2(m_HLDataPass1[k-1].endStop,
HLStop,
MData.HLData,
m_data);
} else {
//APPL_DEBUG(" ==> (empty section 4 ) k="<<k<<" start=0 stop="<<HLStop );
m_Highlight->Parse2(0,
HLStop,
MData.HLData,
m_data);
}
}
//GTimeVal timeStop;
//g_get_current_time(&timeStop);
//APPL_DEBUG("Display reAnnalyse = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s");
}
@@ -361,7 +354,7 @@ void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart,
colorInformation_ts * EdnBuf::GetElementColorAtPosition(displayHLData_ts & MData, int32_t pos)
{
int32_t i;
int32_t start = edn_max(0, MData.posHLPass2-1);
int32_t start = etk_max(0, MData.posHLPass2-1);
for (i=start; i<(int32_t)MData.HLData.Size(); i++) {
MData.posHLPass2 = i;
if( MData.HLData[i].beginStart <= pos

View File

@@ -23,8 +23,8 @@
*******************************************************************************
*/
#include <tools_debug.h>
#include <tools_globals.h>
#include <appl/Debug.h>
#include <appl/global.h>
#include <EdnBuf.h>
@@ -37,16 +37,16 @@
int32_t EdnBuf::Undo(void)
{
int32_t nbElement = m_historyUndo.Size();
//EDN_DEBUG("EdnBuf::Undo Request id="<<nbElement);
//APPL_DEBUG("EdnBuf::Undo Request id="<<nbElement);
int32_t posDest = -1;
if (0 == nbElement) {
// nothing to do ...
EDN_ERROR("EdnBuf::Undo No more History");
APPL_ERROR("EdnBuf::Undo No more History");
return -1;
}
nbElement--;
if (m_historyUndo[nbElement] == NULL) {
EDN_ERROR("EdnBuf::Undo Find empty history ==> remove it");
APPL_ERROR("EdnBuf::Undo Find empty history ==> remove it");
m_historyUndo.PopBack();
return -1;
}
@@ -59,7 +59,7 @@ int32_t EdnBuf::Undo(void)
if (0 == nbInserted) {
// just add data at position ...
if (0 == nbDeleted) {
EDN_ERROR("EdnBuf::Undo nothing to do in UNDO");
APPL_ERROR("EdnBuf::Undo nothing to do in UNDO");
} else {
Insert(pos, deletedText);
posDest = pos + nbDeleted;
@@ -85,16 +85,16 @@ int32_t EdnBuf::Undo(void)
int32_t EdnBuf::Redo(void)
{
int32_t nbElement = m_historyRedo.Size();
//EDN_DEBUG("EdnBuf::Redo Request id="<<nbElement);
//APPL_DEBUG("EdnBuf::Redo Request id="<<nbElement);
int32_t posDest = -1;
if (0 == nbElement) {
// nothing to do ...
EDN_ERROR("EdnBuf::Redo No more History");
APPL_ERROR("EdnBuf::Redo No more History");
return -1;
}
nbElement--;
if (m_historyRedo[nbElement] == NULL) {
EDN_ERROR("EdnBuf::Redo Find empty history ==> remove it");
APPL_ERROR("EdnBuf::Redo Find empty history ==> remove it");
m_historyRedo.PopBack();
return -1;
}
@@ -107,7 +107,7 @@ int32_t EdnBuf::Redo(void)
if (0 == nbInserted) {
// just add data at position ...
if (0 == nbDeleted) {
EDN_ERROR("EdnBuf::Redo nothing to do in REDO");
APPL_ERROR("EdnBuf::Redo nothing to do in REDO");
} else {
Insert(pos, deletedText);
posDest = pos + nbDeleted;

View File

@@ -23,8 +23,8 @@
*******************************************************************************
*/
#include <tools_debug.h>
#include <tools_globals.h>
#include <appl/Debug.h>
#include <appl/global.h>
#include <EdnBuf.h>
@@ -58,12 +58,12 @@ bool EdnBuf::SelectHasSelection(selectionType_te select)
*/
void EdnBuf::Select(selectionType_te select, int32_t start, int32_t end)
{
selection oldSelection = m_selectionList[select];
//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);
m_selectionList[select].start = etk_min(start, end);
m_selectionList[select].end = etk_max(start, end);
}
@@ -77,7 +77,7 @@ void EdnBuf::Select(selectionType_te select, int32_t start, int32_t end)
*/
void EdnBuf::Unselect(selectionType_te select)
{
selection oldSelection = m_selectionList[select];
//selection oldSelection = m_selectionList[select];
m_selectionList[select].selected = false;
m_selectionList[select].zeroWidth = false;
}
@@ -158,6 +158,28 @@ void EdnBuf::GetSelectionText(selectionType_te select, etk::VectorType<int8_t> &
GetRange(start, end, text);
}
}
void EdnBuf::GetSelectionText(selectionType_te select, etk::UString &text)
{
int32_t start, end, rectStart, rectEnd;
bool isRect;
// remove output data
text = "";
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);
}
}
/**
@@ -198,7 +220,7 @@ void EdnBuf::RemoveSelected(selectionType_te select)
* @return ---
*
*/
void EdnBuf::ReplaceSelected(selectionType_te select, etk::VectorType<int8_t> &text)
int32_t EdnBuf::ReplaceSelected(selectionType_te select, etk::VectorType<int8_t> &text)
{
int32_t start, end, rectStart, rectEnd;
bool isRect;
@@ -206,17 +228,41 @@ void EdnBuf::ReplaceSelected(selectionType_te select, etk::VectorType<int8_t> &t
// No data selected ...
if (false == isSelected) {
return;
return 0;
}
int32_t returnSize = 0;
// Rectangular selection
if (true == isRect) {
//ReplaceRect(start, end, rectStart, rectEnd, text);
// TODO : ...
} else {
Replace(start, end, text);
returnSize = Replace(start, end, text);
}
// Clean selection
m_selectionList[select].selected = false;
return returnSize;
}
int32_t EdnBuf::ReplaceSelected(selectionType_te select, etk::UString &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 0;
}
int32_t returnSize = 0;
// Rectangular selection
if (true == isRect) {
//ReplaceRect(start, end, rectStart, rectEnd, text);
// TODO : ...
} else {
returnSize = Replace(start, end, text);
}
// Clean selection
m_selectionList[select].selected = false;
return returnSize;
}

View File

@@ -23,9 +23,8 @@
*******************************************************************************
*/
#include <tools_debug.h>
#include <tools_globals.h>
#include <toolsMemory.h>
#include <appl/Debug.h>
#include <appl/global.h>
#include <EdnVectorBuf.h>
#undef __class__
@@ -66,8 +65,8 @@ EdnVectorBuf::EdnVectorBuf(const EdnVectorBuf & Evb)
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");
m_data = (int8_t *)malloc( m_allocated * sizeof(int8_t) );
APPL_ASSERT(NULL!=m_data, "Error in data allocation");
// Copy all data ...
memcpy(m_data, Evb.m_data, m_allocated * sizeof(int8_t) );
}
@@ -84,7 +83,7 @@ EdnVectorBuf::EdnVectorBuf(const EdnVectorBuf & Evb)
EdnVectorBuf::~EdnVectorBuf()
{
if (NULL!=m_data) {
EDN_FREE(m_data);
free(m_data);
m_data = NULL;
m_allocated = 0;
m_gapStart = 0;
@@ -146,10 +145,10 @@ bool EdnVectorBuf::DumpFrom(FILE *myFile)
// insert Data
int32_t nbReadData = fread(&m_data[GAP_SIZE_MIN], sizeof(int8_t), length, myFile);
EDN_INFO("load data : filesize=" << length << ", readData=" << nbReadData);
APPL_INFO("load data : filesize=" << length << ", readData=" << nbReadData);
// check ERROR
if (nbReadData != length) {
EDN_ERROR("load data pb : filesize=" << length << ", readData=" << nbReadData);
APPL_ERROR("load data pb : filesize=" << length << ", readData=" << nbReadData);
ret = false;
}
// set the gapsize at the end ...
@@ -173,7 +172,7 @@ EdnVectorBuf& EdnVectorBuf::operator=(const EdnVectorBuf & Evb)
if( this != &Evb ) // avoid copy to itself
{
if (NULL!=m_data) {
EDN_FREE(m_data);
free(m_data);
m_data = NULL;
}
// Set the new value
@@ -181,8 +180,8 @@ EdnVectorBuf& EdnVectorBuf::operator=(const EdnVectorBuf & Evb)
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");
m_data = (int8_t *)malloc( m_allocated * sizeof(int8_t) );
APPL_ASSERT(NULL!=m_data, "Error in data allocation");
// Copy all data ...
memcpy(m_data, Evb.m_data, m_allocated * sizeof(int8_t) );
}
@@ -192,7 +191,7 @@ EdnVectorBuf& EdnVectorBuf::operator=(const EdnVectorBuf & Evb)
int8_t EdnVectorBuf::operator[] (int32_t pos)
{
EDN_ASSERT(0 <= pos || pos < Size(), "try to read an element non existing");
APPL_ASSERT(0 <= pos || pos < Size(), "try to read an element non existing");
if (pos < m_gapStart) {
return m_data[pos];
}
@@ -210,7 +209,7 @@ int8_t EdnVectorBuf::operator[] (int32_t pos)
*/
int8_t& EdnVectorBuf::Get(int32_t pos)
{
EDN_ASSERT(0 <= pos || pos < Size(), "try to read an element non existing");
APPL_ASSERT(0 <= pos || pos < Size(), "try to read an element non existing");
if (pos < m_gapStart) {
return m_data[pos];
}
@@ -283,11 +282,11 @@ 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());
APPL_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());
APPL_ERROR("Request remove more element than expected in the buffer pos+nbRemoveElement="<<pos+nbRemoveElement<< " bufferSize="<<Size());
return;
}
if (false == GapMove(pos) ) {
@@ -336,17 +335,17 @@ void EdnVectorBuf::ChangeAllocation(int32_t newSize)
if (newSize == m_allocated) {
return;
}
EDN_DEBUG("Change Allocation : " << m_allocated << " ==> " << newSize);
APPL_DEBUG("Change Allocation : " << m_allocated << " ==> " << newSize);
// check if something is allocated :
if (NULL == m_data) {
// no data allocated ==> request an allocation (might be the first)
EDN_MALLOC(m_data, newSize, int8_t);
m_data = (int8_t *)malloc( newSize * sizeof(int8_t) );
} else {
// move datas
EDN_REALLOC(m_data, newSize, int8_t);
m_data = (int8_t *)realloc( m_data, newSize* sizeof(int8_t) );
}
// Check result with assert :
EDN_ASSERT(NULL!=m_data, "Error in data allocation");
APPL_ASSERT(NULL!=m_data, "Error in data allocation");
// set the new allocation size
m_allocated = newSize;
}
@@ -364,7 +363,7 @@ 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());
APPL_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return;
}
if( 0 == GapSize() ) {
@@ -402,7 +401,7 @@ void EdnVectorBuf::Insert(int32_t pos, etk::VectorType<int8_t>& items)
{
if( pos > Size()
|| pos < 0 ) {
EDN_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
APPL_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return;
}
if( items.Size() > GapSize() ) {
@@ -434,7 +433,7 @@ 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());
APPL_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return;
}
// just replace the element, not update Gap position
@@ -458,11 +457,11 @@ void EdnVectorBuf::Replace(int32_t pos, int32_t nbRemoveElement, etk::VectorType
{
if( pos > Size()
|| pos < 0 ) {
EDN_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
APPL_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());
APPL_ERROR("Request remove more element than expected in the buffer pos+nbRemoveElement="<<pos+nbRemoveElement<< " bufferSize="<<Size());
return;
}
if (false == GapMove(pos)) {
@@ -490,7 +489,7 @@ bool EdnVectorBuf::GapMove(int32_t pos)
{
if( pos > Size()
|| pos < 0 ) {
EDN_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
APPL_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return false;
}
int32_t gapLen = m_gapEnd - m_gapStart;
@@ -517,7 +516,7 @@ 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());
APPL_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return false;
}
int32_t previousSize = Size();
@@ -590,12 +589,12 @@ void EdnVectorBuf::GapCheckMaxSize(void)
*/
void EdnVectorBuf::Display(void)
{
EDN_INFO(" Display Buffer : Size="<<Size()<<" m_allocated="<<m_allocated<<" m_gapStart="<<m_gapStart<<" m_gapEnd="<<m_gapEnd);
APPL_INFO(" Display Buffer : Size="<<Size()<<" m_allocated="<<m_allocated<<" m_gapStart="<<m_gapStart<<" m_gapEnd="<<m_gapEnd);
for(int32_t i=0; i<m_allocated; i++) {
if (i>= m_gapStart && i< m_gapEnd) {
EDN_INFO( "Element " << i << " : GAP");
APPL_INFO( "Element " << i << " : GAP");
} else {
EDN_INFO( "Element " << i << " : " << m_data[i]);
APPL_INFO( "Element " << i << " : " << m_data[i]);
}
}
}

View File

@@ -26,7 +26,6 @@
#ifndef __EDN_VECTOR_BUF_H__
#define __EDN_VECTOR_BUF_H__
#include <toolsMemory.h>
#include <etk/VectorType.h>
#undef __class__
@@ -226,7 +225,7 @@ class EdnVectorBuf
*/
int8_t & operator-> () const
{
EDN_CHECK_INOUT(m_current >= 0 && m_current < m_EdnVectorBuf->Size());
APPL_CHECK_INOUT(m_current >= 0 && m_current < m_EdnVectorBuf->Size());
return m_EdnVectorBuf->Get(m_current);
}
/**
@@ -235,7 +234,7 @@ class EdnVectorBuf
*/
int8_t & operator* () const
{
EDN_CHECK_INOUT(m_current >= 0 && m_current < m_EdnVectorBuf->Size());
APPL_CHECK_INOUT(m_current >= 0 && m_current < m_EdnVectorBuf->Size());
return m_EdnVectorBuf->Get(m_current);
}
private:

View File

@@ -23,8 +23,8 @@
*******************************************************************************
*/
#include <tools_debug.h>
#include <tools_globals.h>
#include <appl/Debug.h>
#include <appl/global.h>
#include <Colorize.h>
@@ -32,45 +32,33 @@
#define __class__ "Colorize"
Colorize::Colorize( etk::String &newColorName)
Colorize::Colorize( etk::UString &newColorName)
{
m_colorFG.red=0;
m_colorFG.green=0;
m_colorFG.blue=0;
m_colorFG.alpha=1;
m_colorBG.red=0;
m_colorBG.green=0;
m_colorBG.blue=0;
m_colorBG.alpha=1;
m_colorFG = etk::color::color_Black;
m_colorBG = etk::color::color_Black;
italic = false;
bold = false;
haveFG = false;
haveBG = false;
SetName(newColorName);
//EDN_INFO("New(Colorise)");
APPL_VERBOSE("New(Colorise)");
}
Colorize::Colorize(void)
{
ColorName = "no_name";
m_colorFG.red=0;
m_colorFG.green=0;
m_colorFG.blue=0;
m_colorFG.alpha=1;
m_colorBG.red=0;
m_colorBG.green=0;
m_colorBG.blue=0;
m_colorBG.alpha=1;
m_colorFG = etk::color::color_Black;
m_colorBG = etk::color::color_Black;
italic = false;
bold = false;
haveFG = false;
haveBG = false;
//EDN_INFO("New(Colorise)");
APPL_VERBOSE("New(Colorise)");
}
Colorize::~Colorize(void)
@@ -81,18 +69,18 @@ Colorize::~Colorize(void)
void Colorize::SetName(const char *newColorName)
{
//EDN_INFO("color change name : \"%s\" ==> \"%s\"",ColorName.c_str(), newColorName);
APPL_VERBOSE("color change name : \"" << ColorName << "\" ==> \"" << newColorName << "\"");
ColorName = newColorName;
}
void Colorize::SetName(etk::String &newColorName)
void Colorize::SetName(etk::UString &newColorName)
{
//EDN_INFO("color change name : \"%s\" ==> \"%s\"",ColorName.c_str(), newColorName.c_str());
APPL_VERBOSE("color change name : \"" << ColorName << "\" ==> \"" << newColorName << "\"");
ColorName = newColorName;
}
etk::String Colorize::GetName(void)
etk::UString Colorize::GetName(void)
{
return ColorName;
}
@@ -101,38 +89,15 @@ etk::String Colorize::GetName(void)
void Colorize::SetFgColor(const char *myColor)
{
haveFG = true;
signed int r=0;
signed int v=0;
signed int b=0;
signed int a=-1;
sscanf(myColor, "#%02x%02x%02x%02x", &r, &v, &b, &a);
m_colorFG.red = (float)r/255.0;
m_colorFG.green = (float)v/255.0;
m_colorFG.blue = (float)b/255.0;
if (-1 == a) {
m_colorFG.alpha = 1;
} else {
m_colorFG.alpha = (float)a/255.0;
}
//EDN_INFO(myColor << " ==> r="<< r <<" v="<< v <<" b="<< b );
m_colorFG = etk::color::Parse(myColor);
APPL_VERBOSE(myColor << " ==> "<< m_colorFG );
}
void Colorize::SetBgColor(const char *myColor)
{
haveBG = true;
signed int r=0;
signed int v=0;
signed int b=0;
signed int a=-1;
sscanf(myColor, "#%02x%02x%02x%02x", &r, &v, &b, &a);
m_colorBG.red = (float)r/255.0;
m_colorBG.green = (float)v/255.0;
m_colorBG.blue = (float)b/255.0;
if (-1 == a) {
m_colorBG.alpha = 1;
} else {
m_colorBG.alpha = (float)a/255.0;
}
m_colorBG = etk::color::Parse(myColor);
APPL_VERBOSE(myColor << " ==> "<< m_colorBG );
}
bool Colorize::HaveBg(void)
@@ -144,13 +109,11 @@ bool Colorize::HaveBg(void)
void Colorize::SetItalic(bool enable)
{
italic = enable;
/*
if (true == enable) {
EDN_INFO("color : \"%s\" enable italic", ColorName.c_str());
APPL_VERBOSE("color : \"" << ColorName << "\" enable italic");
} else {
EDN_INFO("color : \"%s\" disable italic", ColorName.c_str());
APPL_VERBOSE("color : \"" << ColorName << "\" disable italic");
}
*/
}
bool Colorize::GetItalic(void)
@@ -162,13 +125,11 @@ bool Colorize::GetItalic(void)
void Colorize::SetBold(bool enable)
{
bold = enable;
/*
if (true == enable) {
EDN_INFO("color : \"%s\" enable bold", ColorName.c_str());
APPL_VERBOSE("color : \"" << ColorName << "\" enable bold");
} else {
EDN_INFO("color : \"%s\" disable bold", ColorName.c_str());
APPL_VERBOSE("color : \"" << ColorName << "\" disable bold");
}
*/
}
bool Colorize::GetBold(void)

View File

@@ -25,18 +25,18 @@
#ifndef __COLORIZE_H__
#define __COLORIZE_H__
#include <etk/UString.h>
class Colorize {
public:
// Constructeur
Colorize(void);
Colorize(etk::String &newColorName);
Colorize(etk::UString &newColorName);
~Colorize(void);
void SetName(etk::String &newColorName);
void SetName(etk::UString &newColorName);
void SetName(const char *newColorName);
etk::String GetName(void);
etk::UString GetName(void);
void SetFgColor(const char *myColor);
void SetBgColor(const char *myColor);
@@ -50,10 +50,10 @@ class Colorize {
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 <<","<< m_colorFG.alpha /*<<" bg="<< m_colorBG.red <<","<< m_colorBG.green <<","<< m_colorBG.blue*/ ); };
void Display(int32_t i) { APPL_INFO(" " << i << " : \"" << ColorName << "\"" << " fg="<< m_colorFG); };
private:
etk::String ColorName; //!< curent color Name
etk::UString ColorName; //!< curent color Name
color_ts m_colorFG;
color_ts m_colorBG;

View File

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

View File

@@ -26,9 +26,9 @@
#ifndef __COLORIZE_MANAGER_H__
#define __COLORIZE_MANAGER_H__
#include <etk/Singleton.h>
#include <Colorize.h>
#include <MsgBroadcast.h>
#include <appl/globalMsg.h>
#include <ewol/Widget.h>
typedef enum {
// BASIC color for codeViewer
@@ -49,31 +49,18 @@ typedef enum {
class ColorizeManager: public etk::Singleton<ColorizeManager>, public MsgBroadcast
namespace ColorizeManager
{
friend class etk::Singleton<ColorizeManager>;
// specific for sigleton system...
private:
// Constructeur
ColorizeManager(void);
~ColorizeManager(void);
public:
void OnMessage(int32_t id, int32_t dataID);
public:
void LoadFile(etk::String &xmlFilename);
void LoadFile(const char * xmlFilename);
Colorize * Get(const char *colorName);
Colorize * Get(etk::String &colorName);
color_ts & Get(basicColor_te myColor);
bool Exist(etk::String &colorName);
bool Exist(const char *colorName);
void DisplayListOfColor(void);
private:
etk::String m_fileColor;
etk::VectorType<Colorize*> listMyColor; //!< List of ALL Color
Colorize * errorColor;
color_ts basicColors[COLOR_NUMBER_MAX];
void Init(void);
void UnInit(void);
void LoadFile(etk::UString &xmlFilename);
void LoadFile(const char * xmlFilename);
Colorize * Get(const char *colorName);
Colorize * Get(etk::UString &colorName);
color_ts & Get(basicColor_te myColor);
bool Exist(etk::UString &colorName);
bool Exist(const char *colorName);
void DisplayListOfColor(void);
};
#endif

View File

@@ -1,6 +1,6 @@
/**
*******************************************************************************
* @file tools_debug.h
* @file Debug.h
* @brief Editeur De N'ours : log implementation
* @author Edouard DUPIN
* @date 08/06/2010
@@ -24,4 +24,4 @@
*/
const char * ednLog = "edn ";
const char * applLog = "edn ";

78
jni/appl/Debug.h Normal file
View File

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

203
jni/appl/Gui/BufferView.cpp Normal file
View File

@@ -0,0 +1,203 @@
/**
*******************************************************************************
* @file BufferViewer.cpp
* @brief Editeur De N'ours : main textViewer diplayer
* @author Edouard DUPIN
* @date 04/12/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <appl/Debug.h>
#include <appl/global.h>
#include <BufferView.h>
#include <BufferManager.h>
#include <ColorizeManager.h>
#include <MainWindows.h>
#include <ewol/EObject.h>
#undef __class__
#define __class__ "BufferView"
extern const char * const TYPE_EOBJECT_EDN_BUFFER_VIEW = "BufferView";
BufferView::BufferView(void)
{
SetCanHaveFocus(true);
RegisterMultiCast(ednMsgBufferListChange);
RegisterMultiCast(ednMsgBufferState);
RegisterMultiCast(ednMsgBufferId);
m_selectedID = -1;
m_selectedIdRequested = -1;
}
BufferView::~BufferView(void)
{
}
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool BufferView::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_BUFFER_VIEW << "\" != NULL(pointer) ");
return false;
}
if (objectType == TYPE_EOBJECT_EDN_BUFFER_VIEW) {
return true;
} else {
if(true == ewol::List::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_BUFFER_VIEW << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const BufferView::GetObjectType(void)
{
return TYPE_EOBJECT_EDN_BUFFER_VIEW;
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void BufferView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
{
ewol::List::OnReceiveMessage(CallerObject, eventId, data);
if (eventId == ednMsgBufferListChange) {
MarkToReedraw();
}else if (eventId == ednMsgBufferId) {
m_selectedIdRequested = BufferManager::GetSelected();
MarkToReedraw();
}else if (eventId == ednMsgBufferState) {
MarkToReedraw();
}
}
color_ts BufferView::GetBasicBG(void)
{
return ColorizeManager::Get(COLOR_LIST_BG_1);
}
uint32_t BufferView::GetNuberOfColomn(void)
{
return 1;
}
bool BufferView::GetTitle(int32_t colomn, etk::UString &myTitle, color_ts &fg, color_ts &bg)
{
myTitle = "Buffers : ";
return true;
}
uint32_t BufferView::GetNuberOfRaw(void)
{
return BufferManager::SizeOpen();
}
bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, color_ts &fg, color_ts &bg)
{
etk::File name;
bool isModify;
basicColor_te selectFG = COLOR_LIST_TEXT_NORMAL;
basicColor_te selectBG = COLOR_LIST_BG_1;
// when requested a new display selection ==> reset the previous one ...
if (m_selectedIdRequested != -1) {
m_selectedID = -1;
}
// transforme the ID in the real value ...
int32_t realID = BufferManager::WitchBuffer(raw+1);
if (BufferManager::Exist(realID)) {
isModify = BufferManager::Get(realID)->IsModify();
name = BufferManager::Get(realID)->GetFileName();
#if 0
char *tmpModify = (char*)" ";
if (true == isModify) {
tmpModify = (char*)"M";
}
myTextToWrite = "[";
myTextToWrite += realID;
myTextToWrite += "](";
myTextToWrite += tmpModify;
myTextToWrite += ") ";
#else
myTextToWrite = "";
#endif
myTextToWrite += name.GetShortFilename();
if (true == isModify) {
selectFG = COLOR_LIST_TEXT_MODIFY;
} else {
selectFG = COLOR_LIST_TEXT_NORMAL;
}
if (raw%2==0) {
selectBG = COLOR_LIST_BG_1;
} else {
selectBG = COLOR_LIST_BG_2;
}
// the buffer change of selection ...
if (m_selectedIdRequested == realID) {
m_selectedID = raw;
// stop searching
m_selectedIdRequested = -1;
}
if (m_selectedID == raw) {
selectBG = COLOR_LIST_BG_SELECTED;
}
} else {
myTextToWrite = "ERROR";
}
fg = ColorizeManager::Get(selectFG);
bg = ColorizeManager::Get(selectBG);
return true;
}
bool BufferView::OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y)
{
if (1 == IdInput && typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) {
APPL_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw );
int32_t selectBuf = BufferManager::WitchBuffer(raw+1);
if ( 0 <= selectBuf) {
m_selectedID = raw;
SendMultiCast(ednMsgBufferId, selectBuf);
}
}
MarkToReedraw();
return false;
}

82
jni/appl/Gui/BufferView.h Normal file
View File

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

472
jni/appl/Gui/CodeView.cpp Normal file
View File

@@ -0,0 +1,472 @@
/**
*******************************************************************************
* @file CodeView.cpp
* @brief Editeur De N'ours : Code Viewer Widget
* This is an abstraction
* @author Edouard DUPIN
* @date 05/01/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <CodeView.h>
#include <appl/Debug.h>
#include <appl/global.h>
#include <CodeView.h>
#include <BufferManager.h>
#include <ColorizeManager.h>
#include <ewol/ClipBoard.h>
#include <SearchData.h>
#include <ewol/WidgetManager.h>
#include <ewol/EObject.h>
#undef __class__
#define __class__ "CodeView"
extern const char * const TYPE_EOBJECT_EDN_CODE_VIEW = "CodeView";
CodeView::CodeView(void)
{
m_label = "CodeView is disable ...";
m_fontNormal = -1;
m_fontBold = -1;
m_fontItalic = -1;
m_fontBoldItalic = -1;
m_fontSize = 15;
m_bufferID = -1;
m_buttunOneSelected = false;
m_lineNumberList.Clear();
m_textColorFg = etk::color::color_Black;
m_textColorBg = etk::color::color_Black;
m_textColorBg.alpha = 0.25;
SetCanHaveFocus(true);
RegisterMultiCast(ednMsgBufferId);
RegisterMultiCast(ednMsgGuiCopy);
RegisterMultiCast(ednMsgGuiPaste);
RegisterMultiCast(ednMsgGuiCut);
RegisterMultiCast(ednMsgGuiRedo);
RegisterMultiCast(ednMsgGuiUndo);
RegisterMultiCast(ednMsgGuiRm);
RegisterMultiCast(ednMsgGuiSelect);
RegisterMultiCast(ednMsgGuiChangeCharset);
}
CodeView::~CodeView(void)
{
}
/**
* @brief Check if the number of reference buffer is good or not ...
* @param[in] bufferID id of the current Buffer that needed to have a reference
* @return ---
*/
void CodeView::UpdateNumberOfLineReference(int32_t bufferID)
{
coord2D_ts tmpCoord;
tmpCoord.x = 0;
tmpCoord.y = 0;
if (m_lineNumberList.Size()<=bufferID) {
// update the number of elements :
for (int32_t iii=m_lineNumberList.Size(); iii <= bufferID; iii++) {
// add start line at 0 :
m_lineNumberList.PushBack(tmpCoord);
}
}
}
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool CodeView::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
APPL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_CODE_VIEW << "\" != NULL(pointer) ");
return false;
}
if (objectType == TYPE_EOBJECT_EDN_CODE_VIEW) {
return true;
} else {
if(true == ewol::WidgetScrooled::CheckObjectType(objectType)) {
return true;
}
APPL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_CODE_VIEW << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const CodeView::GetObjectType(void)
{
return TYPE_EOBJECT_EDN_CODE_VIEW;
}
bool CodeView::CalculateMinSize(void)
{
m_minSize.x = 50;
m_minSize.y = 50;
return true;
}
void CodeView::CalculateMaxSize(void)
{
m_maxSize.x = 2048;
int32_t letterHeight = ewol::GetHeight(m_fontNormal);
m_maxSize.y = BufferManager::Get(m_bufferID)->GetNumberOfLine() * letterHeight;
}
void CodeView::OnDraw(void)
{
m_OObjectsColored[ m_currentDrawId].Draw();
m_OObjectTextNormal[ m_currentDrawId].Draw();
m_OObjectTextBold[ m_currentDrawId].Draw();
m_OObjectTextItalic[ m_currentDrawId].Draw();
m_OObjectTextBoldItalic[m_currentDrawId].Draw();
}
void CodeView::OnRegenerateDisplay(void)
{
if (true == NeedRedraw()) {
int64_t startTime = GetCurrentTime();
// For the scrooling windows
CalculateMaxSize();
// clean internal elements ...
m_OObjectTextNormal[ m_currentCreateId].SetFontID(m_fontNormal);
m_OObjectTextBold[ m_currentCreateId].SetFontID(m_fontBold);
m_OObjectTextItalic[ m_currentCreateId].SetFontID(m_fontItalic);
m_OObjectTextBoldItalic[m_currentCreateId].SetFontID(m_fontBoldItalic);
m_OObjectTextNormal[ m_currentCreateId].Clear();
m_OObjectTextBold[ m_currentCreateId].Clear();
m_OObjectTextItalic[ m_currentCreateId].Clear();
m_OObjectTextBoldItalic[m_currentCreateId].Clear();
m_OObjectsColored[ m_currentCreateId].Clear();
if(true == BufferManager::Get(m_bufferID)->NeedToUpdateDisplayPosition() ) {
coord2D_ts borderWidth = BufferManager::Get(m_bufferID)->GetBorderSize();
bool centerRequested = false;
coord2D_ts currentPosition = BufferManager::Get(m_bufferID)->GetPosition(m_OObjectTextNormal[m_currentCreateId].GetFontID(), centerRequested);
SetScrollingPositionDynamic(borderWidth, currentPosition, centerRequested);
} // else : nothing to do ...
// generate the objects :
BufferManager::Get(m_bufferID)->Display(m_OObjectTextNormal[m_currentCreateId],
m_OObjectTextBold[m_currentCreateId],
m_OObjectTextItalic[m_currentCreateId],
m_OObjectTextBoldItalic[m_currentCreateId],
m_OObjectsColored[m_currentCreateId],
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
// set the current size of the windows
SetMaxSize(BufferManager::Get(m_bufferID)->GetMaxSize());
int64_t stopTime = GetCurrentTime();
APPL_DEBUG("Display Code Generation = " << stopTime - startTime << " micro-s");
// call the herited class...
WidgetScrooled::OnRegenerateDisplay();
m_needFlipFlop = true;
}
}
bool CodeView::OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData)
{
//APPL_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent);
if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) {
BufferManager::Get(m_bufferID)->AddChar(unicodeData);
MarkToReedraw();
}
return true;
}
bool CodeView::OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveType_te moveTypeEvent)
{
if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) {
BufferManager::Get(m_bufferID)->cursorMove(moveTypeEvent);
MarkToReedraw();
}
return true;
}
/**
* @brief Event on an input of this Widget
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, coord2D_ts pos)
{
coord2D_ts relativePos = RelativePosition(pos);
if (m_bufferID < 0) {
return false;
}
if (true == WidgetScrooled::OnEventInput(IdInput, typeEvent, pos)) {
ewol::widgetManager::FocusKeep(this);
// nothing to do ... done on upper widet ...
return true;
}
if (1 == IdInput) {
#ifndef __MODE__Touch
if (ewol::EVENT_INPUT_TYPE_DOWN == typeEvent) {
m_buttunOneSelected = true;
ewol::widgetManager::FocusKeep(this);
BufferManager::Get(m_bufferID)->MouseEvent(m_fontNormal, relativePos.x+m_originScrooled.x, relativePos.y+m_originScrooled.y);
MarkToReedraw();
} else if (ewol::EVENT_INPUT_TYPE_UP == typeEvent) {
m_buttunOneSelected = false;
BufferManager::Get(m_bufferID)->Copy(ewol::clipBoard::CLIPBOARD_SELECTION);
MarkToReedraw();
} else
#endif
if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) {
#ifdef __MODE__Touch
ewol::widgetManager::FocusKeep(this);
BufferManager::Get(m_bufferID)->MouseEvent(m_fontNormal, relativePos.x+m_originScrooled.x, relativePos.y+m_originScrooled.y);
MarkToReedraw();
#else
// nothing to do ...
#endif
} else if (ewol::EVENT_INPUT_TYPE_DOUBLE == typeEvent) {
BufferManager::Get(m_bufferID)->MouseEventDouble();
MarkToReedraw();
} else if (ewol::EVENT_INPUT_TYPE_TRIPLE == typeEvent) {
BufferManager::Get(m_bufferID)->MouseEventTriple();
MarkToReedraw();
} else if (ewol::EVENT_INPUT_TYPE_MOVE == typeEvent) {
if (true == m_buttunOneSelected) {
int xxx, yyy;
xxx = relativePos.x;
yyy = relativePos.y;
if (xxx<0) {
xxx = 0;
}
if (yyy<0) {
yyy = 0;
}
//APPL_INFO("mouse-motion BT1 %d, %d", xxx, yyy);
BufferManager::Get(m_bufferID)->MouseSelectFromCursorTo(m_fontNormal, xxx+m_originScrooled.x, yyy+m_originScrooled.y);
MarkToReedraw();
}
}
} else if (2 == IdInput) {
if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) {
BufferManager::Get(m_bufferID)->MouseEvent(m_fontNormal, relativePos.x+m_originScrooled.x, relativePos.y+m_originScrooled.y);
BufferManager::Get(m_bufferID)->Paste(ewol::clipBoard::CLIPBOARD_SELECTION);
MarkToReedraw();
ewol::widgetManager::FocusKeep(this);
}
}
return true;
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
{
ewol::WidgetScrooled::OnReceiveMessage(CallerObject, eventId, data);
APPL_DEBUG("Extern Event : " << CallerObject << " type : " << eventId << " data=\"" << data << "\"");
if(eventId == ednMsgBufferId) {
//keep the reference of the display offset :
if( m_bufferID >=0
&& m_bufferID < m_lineNumberList.Size()) {
m_lineNumberList[m_bufferID] = m_originScrooled;
}
int32_t bufferID = 0;
sscanf(data.Utf8Data(), "%d", &bufferID);
APPL_INFO("Select a new Buffer ... " << bufferID);
// set the new buffer ID
m_bufferID = bufferID;
// update the start display position...
UpdateNumberOfLineReference(m_bufferID);
// set back if needed the display position ...
if( m_bufferID >=0
&& m_bufferID < m_lineNumberList.Size()) {
m_originScrooled = m_lineNumberList[m_bufferID];
}
} else if (eventId == ednMsgGuiCopy) {
BufferManager::Get(m_bufferID)->Copy(ewol::clipBoard::CLIPBOARD_STD);
} else if (eventId == ednMsgGuiCut) {
BufferManager::Get(m_bufferID)->Cut(ewol::clipBoard::CLIPBOARD_STD);
} else if (eventId == ednMsgGuiPaste) {
BufferManager::Get(m_bufferID)->Paste(ewol::clipBoard::CLIPBOARD_STD);
} else if (eventId == ednMsgGuiUndo) {
BufferManager::Get(m_bufferID)->Undo();
} else if (eventId == ednMsgGuiRedo) {
BufferManager::Get(m_bufferID)->Redo();
} else if (eventId == ednMsgGuiRm) {
// data : "Word" "Line" "Paragraph"
if (data == "Word") {
APPL_WARNING(" on event " << eventId << " data=\"" << data << "\" ==> not coded" );
} else if (data == "Line") {
BufferManager::Get(m_bufferID)->RemoveLine();
} else if (data == "Paragraph") {
APPL_WARNING(" on event " << eventId << " data=\"" << data << "\" ==> not coded" );
} else {
APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
}
} else if (eventId == ednMsgGuiSelect) {
// data : "ALL" "NONE"
if (data == "ALL") {
BufferManager::Get(m_bufferID)->SelectAll();
} else if (data == "NONE") {
BufferManager::Get(m_bufferID)->SelectNone();
} else {
APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
}
} else if (eventId == ednMsgGuiChangeCharset) {
// data : "UTF-8" "ISO-8859-1" "ISO-8859-15"
if (data == "UTF-8") {
BufferManager::Get(m_bufferID)->SetCharset(unicode::EDN_CHARSET_UTF8);
} else if (data == "ISO-8859-1") {
BufferManager::Get(m_bufferID)->SetCharset(unicode::EDN_CHARSET_ISO_8859_1);
} else if (data == "ISO-8859-15") {
BufferManager::Get(m_bufferID)->SetCharset(unicode::EDN_CHARSET_ISO_8859_15);
} else {
APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
}
}
/*
switch (id)
{
case APPL_MSG__CURRENT_FIND_PREVIOUS:
{
etk::UString myDataString;
SearchData::GetSearch(myDataString);
BufferManager::Get(m_bufferID)->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
}
break;
case APPL_MSG__CURRENT_FIND_NEXT:
{
etk::UString myDataString;
SearchData::GetSearch(myDataString);
BufferManager::Get(m_bufferID)->Search(myDataString, false, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
}
break;
case APPL_MSG__CURRENT_REPLACE:
{
etk::UString myDataString;
SearchData::GetReplace(myDataString);
BufferManager::Get(m_bufferID)->Replace(myDataString);
}
break;
case APPL_MSG__CURRENT_REPLACE_ALL:
break;
case APPL_MSG__CURRENT_GOTO_LINE:
if (dataID<0) {
dataID = 0;
}
BufferManager::Get(m_bufferID)->JumpAtLine(dataID);
break;
case APPL_MSG__CURRENT_SET_CHARSET:
BufferManager::Get(m_bufferID)->SetCharset((unicode::charset_te)dataID);
break;
}
*/
// Force redraw of the widget
MarkToReedraw();
}
void CodeView::OnGetFocus(void)
{
/*
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_bufferID);
*/
ewol::KeyboardShow(ewol::KEYBOARD_MODE_CODE);
APPL_INFO("Focus - In");
}
void CodeView::OnLostFocus(void)
{
ewol::KeyboardHide();
APPL_INFO("Focus - out");
}
void CodeView::SetFontSize(int32_t size)
{
m_fontSize = size;
SetScrollingSize(m_fontSize*3.0*1.46); // 1.46 is a magic nmber ...
}
void CodeView::SetFontNameNormal(etk::UString fontName)
{
int32_t fontID = ewol::LoadFont(fontName, m_fontSize);
if (fontID >= 0) {
m_fontNormal = fontID;
}
}
void CodeView::SetFontNameBold(etk::UString fontName)
{
int32_t fontID = ewol::LoadFont(fontName, m_fontSize);
if (fontID >= 0) {
m_fontBold = fontID;
}
}
void CodeView::SetFontNameItalic(etk::UString fontName)
{
int32_t fontID = ewol::LoadFont(fontName, m_fontSize);
if (fontID >= 0) {
m_fontItalic = fontID;
}
}
void CodeView::SetFontNameBoldItalic(etk::UString fontName)
{
int32_t fontID = ewol::LoadFont(fontName, m_fontSize);
if (fontID >= 0) {
m_fontBoldItalic = fontID;
}
}

121
jni/appl/Gui/CodeView.h Normal file
View File

@@ -0,0 +1,121 @@
/**
*******************************************************************************
* @file CodeView.h
* @brief Editeur De N'ours : Code Viewer Widget (header)
* @author Edouard DUPIN
* @date 05/01/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __CODE_VIEW_H__
#define __CODE_VIEW_H__
#include <appl/Debug.h>
#include <CodeView.h>
#include <BufferManager.h>
#include <appl/globalMsg.h>
#include <etk/Types.h>
#include <ewol/widget/WidgetScrolled.h>
//!< EObject name :
extern const char * const TYPE_EOBJECT_EDN_CODE_VIEW;
class CodeView :public ewol::WidgetScrooled
{
public:
CodeView(void);
virtual ~CodeView(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void);
virtual bool CalculateMinSize(void);
private:
etk::UString m_label;
color_ts m_textColorFg; //!< Text color
color_ts m_textColorBg; //!< Background color
int32_t m_bufferID;
bool m_buttunOneSelected;
etk::VectorType<coord2D_ts> m_lineNumberList;
void UpdateNumberOfLineReference(int32_t bufferID);
// drawing elements :
ewol::OObject2DTextColored m_OObjectTextNormal[NB_BOUBLE_BUFFER];
ewol::OObject2DTextColored m_OObjectTextBold[NB_BOUBLE_BUFFER];
ewol::OObject2DTextColored m_OObjectTextItalic[NB_BOUBLE_BUFFER];
ewol::OObject2DTextColored m_OObjectTextBoldItalic[NB_BOUBLE_BUFFER];
ewol::OObject2DColored m_OObjectsColored[NB_BOUBLE_BUFFER];
public:
virtual void OnRegenerateDisplay(void);
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
public:
/**
* @brief Event on an input of this Widget
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
virtual bool OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, coord2D_ts pos);
virtual bool OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData);
virtual bool OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveType_te moveTypeEvent);
virtual void OnGetFocus(void);
virtual void OnLostFocus(void);
private:
int32_t m_fontSize;
int32_t m_fontNormal;
int32_t m_fontBold;
int32_t m_fontItalic;
int32_t m_fontBoldItalic;
public:
void SetFontSize(int32_t size);
void SetFontNameNormal(etk::UString fontName);
void SetFontNameBold(etk::UString fontName);
void SetFontNameItalic(etk::UString fontName);
void SetFontNameBoldItalic(etk::UString fontName);
private:
void CalculateMaxSize(void);
protected:
virtual void OnDraw(void);
};
#define EDN_CAST_CODE_VIEW(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_CODE_VIEW,CodeView,curentPointer)
#endif

View File

@@ -0,0 +1,341 @@
/**
*******************************************************************************
* @file MainWindows.cpp
* @brief Editeur De N'ours : main Windows diplayer (Sources)
* @author Edouard DUPIN
* @date 04/01/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <appl/Debug.h>
#include <appl/global.h>
#include <MainWindows.h>
#include <CodeView.h>
#include <BufferView.h>
#include <ewol/widget/Button.h>
#include <ewol/widget/CheckBox.h>
#include <ewol/widget/SizerHori.h>
#include <ewol/widget/SizerVert.h>
#include <ewol/widget/Label.h>
#include <ewol/widget/Entry.h>
#include <ewol/widget/List.h>
#include <ewol/widget/ContextMenu.h>
#include <ewol/widget/PopUp.h>
#include <ewol/widget/Spacer.h>
#include <ewol/widget/Menu.h>
#include <ewol/widgetMeta/FileChooser.h>
#include <ewol/WidgetManager.h>
#include <ewol/EObject.h>
#undef __class__
#define __class__ "MainWindows"
extern const char * const TYPE_EOBJECT_EDN_MAIN_WINDOWS = "MainWindows";
MainWindows::MainWindows(void)
{
APPL_DEBUG("CREATE WINDOWS ... ");
ewol::SizerVert * mySizerVert = NULL;
ewol::SizerHori * mySizerHori = NULL;
//ewol::Button * myButton = NULL;
CodeView * myCodeView = NULL;
BufferView * myBufferView = NULL;
ewol::Menu * myMenu = NULL;
mySizerVert = new ewol::SizerVert();
SetSubWidget(mySizerVert);
mySizerHori = new ewol::SizerHori();
mySizerVert->SubWidgetAdd(mySizerHori);
myMenu = new ewol::Menu();
mySizerHori->SubWidgetAdd(myMenu);
int32_t idMenuFile = myMenu->AddTitle("File");
(void)myMenu->Add(idMenuFile, "New", "", ednMsgGuiNew);
(void)myMenu->AddSpacer();
(void)myMenu->Add(idMenuFile, "Open", "icon/Load.svg", ednMsgGuiOpen);
(void)myMenu->Add(idMenuFile, "Close", "icon/Close.svg", ednMsgGuiClose, "current");
(void)myMenu->Add(idMenuFile, "Close (all)", "", ednMsgGuiClose, "All");
(void)myMenu->Add(idMenuFile, "Save", "icon/Save.svg", ednMsgGuiSave, "current");
(void)myMenu->Add(idMenuFile, "Save As ...", "", ednMsgGuiSaveAs);
(void)myMenu->AddSpacer();
//(void)myMenu->Add(idMenuFile, "Exit", "", ednMsgGuiExit);
int32_t idMenuEdit = myMenu->AddTitle("Edit");
(void)myMenu->Add(idMenuEdit, "Undo", "icon/Undo.svg", ednMsgGuiUndo);
(void)myMenu->Add(idMenuEdit, "Redo", "icon/Redo.svg", ednMsgGuiRedo);
(void)myMenu->AddSpacer();
(void)myMenu->Add(idMenuEdit, "Copy", "", ednMsgGuiCopy, "STD");
(void)myMenu->Add(idMenuEdit, "Cut", "", ednMsgGuiCut, "STD");
(void)myMenu->Add(idMenuEdit, "Paste", "", ednMsgGuiPaste, "STD");
(void)myMenu->Add(idMenuEdit, "Remove", "", ednMsgGuiRm);
(void)myMenu->AddSpacer();
(void)myMenu->Add(idMenuEdit, "Select All","", ednMsgGuiSelect, "ALL");
(void)myMenu->Add(idMenuEdit, "Un-Select","", ednMsgGuiSelect, "NONE");
(void)myMenu->Add(idMenuEdit, "Goto line ...","", ednMsgGuiGotoLine, "???");
int32_t idMenuSearch = myMenu->AddTitle("Search");
(void)myMenu->Add(idMenuSearch, "Search", "icon/Search.svg", ednMsgGuiSearch);
(void)myMenu->Add(idMenuSearch, "Replace", "icon/Replace.svg", ednMsgGuiReplace);
(void)myMenu->AddSpacer();
(void)myMenu->Add(idMenuSearch, "Find (previous)","", ednMsgGuiFind, "Previous");
(void)myMenu->Add(idMenuSearch, "Find (next)", "", ednMsgGuiFind, "Next");
(void)myMenu->Add(idMenuSearch, "Find (all)", "", ednMsgGuiFind, "All");
(void)myMenu->Add(idMenuSearch, "Un-Select", "", ednMsgGuiFind, "None");
int32_t idMenuCTags = myMenu->AddTitle("C-tags");
(void)myMenu->Add(idMenuCTags, "Load", "", ednMsgGuiCtags, "Load");
(void)myMenu->Add(idMenuCTags, "ReLoad", "", ednMsgGuiCtags, "ReLoad");
(void)myMenu->Add(idMenuCTags, "Jump", "", ednMsgGuiCtags, "Jump");
(void)myMenu->Add(idMenuCTags, "Back", "", ednMsgGuiCtags, "Back");
int32_t idMenugDisplay = myMenu->AddTitle("Display");
(void)myMenu->Add(idMenugDisplay, "Charset UTF-8", "", ednMsgGuiChangeCharset, "UTF-8");
(void)myMenu->Add(idMenugDisplay, "Charset ISO-8859-1", "", ednMsgGuiChangeCharset, "ISO-8859-1");
(void)myMenu->Add(idMenugDisplay, "Charset ISO-8859-15", "", ednMsgGuiChangeCharset, "ISO-8859-15");
(void)myMenu->AddSpacer();
(void)myMenu->Add(idMenugDisplay, "Color Black", "", ednMsgGuiChangeColor, "Black");
(void)myMenu->Add(idMenugDisplay, "Color White", "", ednMsgGuiChangeColor, "White");
(void)myMenu->AddTitle("?", "", ednMsgGuiAbout);
m_widgetLabelFileName = new ewol::Label("FileName");
m_widgetLabelFileName->SetExpendX(true);
m_widgetLabelFileName->SetFillY(true);
mySizerHori->SubWidgetAdd(m_widgetLabelFileName);
mySizerHori = new ewol::SizerHori();
mySizerVert->SubWidgetAdd(mySizerHori);
myBufferView = new BufferView();
myBufferView->SetExpendX(false);
myBufferView->SetExpendY(true);
myBufferView->SetFillX(true);
myBufferView->SetFillY(true);
mySizerHori->SubWidgetAdd(myBufferView);
myCodeView = new CodeView();
myCodeView->SetExpendX(true);
myCodeView->SetExpendY(true);
myCodeView->SetFillX(true);
myCodeView->SetFillY(true);
myCodeView->SetFontSize(11);
myCodeView->SetFontNameNormal( "freefont/FreeMono.ttf");
myCodeView->SetFontNameBold( "freefont/FreeMonoBold.ttf");
myCodeView->SetFontNameItalic( "freefont/FreeMonoOblique.ttf");
myCodeView->SetFontNameBoldItalic("freefont/FreeMonoBoldOblique.ttf");
/*
myCodeView->SetFontSize(11);
myCodeView->SetFontNameNormal( "ubuntu/UbuntuMono-R.ttf");
myCodeView->SetFontNameBold( "ubuntu/UbuntuMono-B.ttf");
myCodeView->SetFontNameItalic( "ubuntu/UbuntuMono-RI.ttf");
myCodeView->SetFontNameBoldItalic("ubuntu/UbuntuMono-BI.ttf");
*/
mySizerHori->SubWidgetAdd(myCodeView);
// Generic event ...
RegisterMultiCast(ednMsgGuiSaveAs);
RegisterMultiCast(ednMsgGuiOpen);
RegisterMultiCast(ednMsgGuiAbout);
// to update the title ...
RegisterMultiCast(ednMsgBufferState);
RegisterMultiCast(ednMsgBufferId);
}
MainWindows::~MainWindows(void)
{
}
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool MainWindows::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
APPL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_MAIN_WINDOWS << "\" != NULL(pointer) ");
return false;
}
if (objectType == TYPE_EOBJECT_EDN_MAIN_WINDOWS) {
return true;
} else {
if(true == ewol::Windows::CheckObjectType(objectType)) {
return true;
}
APPL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_MAIN_WINDOWS << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const MainWindows::GetObjectType(void)
{
return TYPE_EOBJECT_EDN_MAIN_WINDOWS;
}
const char *const ednEventPopUpFileSelected = "edn-mainWindows-openSelected";
const char *const ednEventPopUpFileSaveAs = "edn-mainWindows-saveAsSelected";
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
{
ewol::Windows::OnReceiveMessage(CallerObject, eventId, data);
//APPL_INFO("Receive Event from the main windows ... : widgetid=" << CallerObject << "\"" << eventId << "\" ==> data=\"" << data << "\"" );
// Open file Section ...
if (eventId == ednMsgGuiOpen) {
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
tmpWidget->SetTitle("Open Files ...");
tmpWidget->SetValidateLabel("Open");
Buffer * myBuffer = BufferManager::Get(BufferManager::GetSelected());
if (NULL!=myBuffer) {
etk::File tmpFile = myBuffer->GetFileName();
tmpWidget->SetFolder(tmpFile.GetFolder());
} else {
// nothing to do : just open the basic folder
}
//tmpWidget->SetFolder("/");
PopUpWidgetPush(tmpWidget);
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected);
} else if (eventId == ednEventPopUpFileSelected) {
// get widget:
ewol::FileChooser * tmpWidget = EWOL_CAST_WIDGET_FILE_CHOOSER(CallerObject);
if (NULL == tmpWidget) {
APPL_ERROR("impossible to get pop_upWidget " << CallerObject);
return;
}
// get the filename :
etk::UString tmpData = tmpWidget->GetCompleateFileName();
APPL_DEBUG("Request opening the file : " << tmpData);
SendMultiCast(ednMsgOpenFile, tmpData);
} else if (eventId == ednMsgGuiSaveAs) {
if (data == "") {
APPL_ERROR("Null data for Save As file ... ");
} else {
m_currentSavingAsIdBuffer = -1;
if (data == "current") {
m_currentSavingAsIdBuffer = BufferManager::GetSelected();
} else {
sscanf(data.Utf8Data(), "%d", &m_currentSavingAsIdBuffer);
}
if (false == BufferManager::Exist(m_currentSavingAsIdBuffer)) {
APPL_ERROR("Request saveAs on non existant Buffer ID=" << m_currentSavingAsIdBuffer);
} else {
Buffer * myBuffer = BufferManager::Get(m_currentSavingAsIdBuffer);
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
tmpWidget->SetTitle("Save Files As...");
tmpWidget->SetValidateLabel("Save");
etk::UString folder = "/home/";
etk::UString fileName = "";
if (true == myBuffer->HaveName()) {
etk::File tmpName = myBuffer->GetFileName();
folder = tmpName.GetFolder();
fileName = tmpName.GetShortFilename();
}
tmpWidget->SetFolder(folder);
tmpWidget->SetFileName(fileName);
PopUpWidgetPush(tmpWidget);
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSaveAs);
}
}
} else if (eventId == ednEventPopUpFileSaveAs) {
// get widget:
ewol::FileChooser * tmpWidget = EWOL_CAST_WIDGET_FILE_CHOOSER(CallerObject);
if (NULL == tmpWidget) {
APPL_ERROR("impossible to get pop_upWidget " << CallerObject);
return;
}
// get the filename :
etk::UString tmpData = tmpWidget->GetCompleateFileName();
APPL_DEBUG("Request Saving As file : " << tmpData);
BufferManager::Get(m_currentSavingAsIdBuffer)->SetFileName(tmpData);
SendMultiCast(ednMsgGuiSave, m_currentSavingAsIdBuffer);
} else if( eventId == ednMsgBufferState
|| eventId == ednMsgBufferId) {
// the buffer change we need to update the widget string
Buffer* tmpBuffer = BufferManager::Get(BufferManager::GetSelected());
if (NULL != tmpBuffer) {
etk::File compleateName = tmpBuffer->GetFileName();
bool isModify = tmpBuffer->IsModify();
etk::UString directName = compleateName.GetCompleateName();
if (true == isModify) {
directName += " *";
}
if (NULL == m_widgetLabelFileName) {
return;
}
m_widgetLabelFileName->SetLabel(directName);
etk::UString windowsTitle = "edn - ";
windowsTitle += directName;
ewol::SetTitle(windowsTitle);
return;
} else {
m_widgetLabelFileName->SetLabel("");
ewol::SetTitle("edn");
}
return;
// TODO : Set the Title ....
} else if (eventId == ednMsgGuiAbout) {
/*
//Title
"Edn"
// version
VERSION_TAG_NAME
// comments:
"Editeur De N'ours\n"
"L'Editeur Desoxyribo-Nucleique.\n"
"Source Code Editor\n"
"Build Time : " VERSION_BUILD_TIME;
// copyright
"Copyright 2010 Edouard DUPIN, all right reserved";
// licence
"This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY\n\n"
"You can:\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, just write somewhere \"Edn is great\" visible by the user (on 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\n"
"You can NOT:\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\n"
"I reserve the right to change this licence. If it change the version of the copy you have keep its own license."
*/
}
return;
}

View File

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

View File

@@ -24,12 +24,12 @@
*/
#include "tools_globals.h"
#include "appl/global.h"
#include "Search.h"
#include "SearchData.h"
#include "BufferManager.h"
#include "MainWindows.h"
#include "MsgBroadcast.h"
#include "appl/globalMsg.h"
#undef __class__
#define __class__ "Search"
@@ -183,7 +183,7 @@ void Search::Display(GtkWindow *parent)
gtk_widget_show_all(m_localDialog);
}
if(NULL == m_localDialog) {
EDN_ERROR("No search-dialog instance");
APPL_ERROR("No search-dialog instance");
} else {
// update datas :
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_CkWrapAround), SearchData::GetWrap());
@@ -195,7 +195,7 @@ void Search::Display(GtkWindow *parent)
gtk_widget_set_sensitive(m_CkMatchCase, true);
}
// Remove data form the search
etk::String myDataString = "";
etk::UString myDataString = "";
SearchData::SetSearch(myDataString);
gtk_entry_set_text(GTK_ENTRY(m_searchEntry), myDataString.c_str());
if (0 == strlen(myDataString.c_str())) {
@@ -251,39 +251,39 @@ void Search::Hide(void)
/*
void Search::OnButtonPrevious(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
GeneralSendMessage(EDN_MSG__CURRENT_FIND_PREVIOUS);
//APPL_INFO("CALLBACK");
GeneralSendMessage(APPL_MSG__CURRENT_FIND_PREVIOUS);
}
void Search::OnButtonNext(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
GeneralSendMessage(EDN_MSG__CURRENT_FIND_NEXT);
//APPL_INFO("CALLBACK");
GeneralSendMessage(APPL_MSG__CURRENT_FIND_NEXT);
}
void Search::OnButtonReplace(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
GeneralSendMessage(EDN_MSG__CURRENT_REPLACE);
//APPL_INFO("CALLBACK");
GeneralSendMessage(APPL_MSG__CURRENT_REPLACE);
}
void Search::OnButtonReplaceAndNext(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
GeneralSendMessage(EDN_MSG__CURRENT_REPLACE);
GeneralSendMessage(EDN_MSG__CURRENT_FIND_NEXT);
//APPL_INFO("CALLBACK");
GeneralSendMessage(APPL_MSG__CURRENT_REPLACE);
GeneralSendMessage(APPL_MSG__CURRENT_FIND_NEXT);
}
void Search::OnButtonQuit(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
Search * self = reinterpret_cast<Search*>(data);
//APPL_INFO("CALLBACK");
Search * self = static_cast<Search*>(data);
self->Destroy();
}
void Search::OnCheckBoxEventWrap(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
//APPL_INFO("CALLBACK");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
SearchData::SetWrap(true);
} else {
@@ -293,7 +293,7 @@ void Search::OnCheckBoxEventWrap(GtkWidget *widget, gpointer data)
void Search::OnCheckBoxEventCase(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
//APPL_INFO("CALLBACK");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
SearchData::SetCase(true);
} else {
@@ -303,8 +303,8 @@ void Search::OnCheckBoxEventCase(GtkWidget *widget, gpointer data)
void Search::OnCheckBoxEventRegExp(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
Search * self = reinterpret_cast<Search*>(data);
//APPL_INFO("CALLBACK");
Search * self = static_cast<Search*>(data);
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
SearchData::SetRegExp(true);
gtk_widget_set_sensitive(self->m_CkMatchCase, false);
@@ -316,12 +316,12 @@ void Search::OnCheckBoxEventRegExp(GtkWidget *widget, gpointer data)
void Search::OnEntrySearchChange(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
Search * self = reinterpret_cast<Search*>(data);
//APPL_INFO("CALLBACK");
Search * self = static_cast<Search*>(data);
// update research data
const char *testData = gtk_entry_get_text(GTK_ENTRY(widget));
if (NULL != testData) {
etk::String myDataString = testData;
etk::UString myDataString = testData;
SearchData::SetSearch(myDataString);
if (0 == strlen(testData)) {
self->m_haveSearchData = false;
@@ -342,12 +342,12 @@ void Search::OnEntrySearchChange(GtkWidget *widget, gpointer data)
void Search::OnEntryReplaceChange(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
Search * self = reinterpret_cast<Search*>(data);
//APPL_INFO("CALLBACK");
Search * self = static_cast<Search*>(data);
// update replace data
const char *testData = gtk_entry_get_text(GTK_ENTRY(widget));
if (NULL != testData) {
etk::String myDataString = testData;
etk::UString myDataString = testData;
SearchData::SetReplace(myDataString);
if (0 == strlen(testData)) {
self->m_haveReplaceData = false;

View File

@@ -26,15 +26,12 @@
#ifndef __SEARCH_H__
#define __SEARCH_H__
#include <tools_debug.h>
#include <etk/Singleton.h>
#include <appl/Debug.h>
class Search: public etk::Singleton<Search>
class Search
{
friend class etk::Singleton<Search>;
// specific for sigleton system...
private:
public:
// Constructeur
Search(void);
~Search(void);

View File

@@ -23,7 +23,7 @@
*******************************************************************************
*/
#include <tools_globals.h>
#include <appl/global.h>
#include <SearchData.h>
@@ -31,13 +31,13 @@
#define __class__ "SearchData"
static etk::String m_findRequest = "";
static etk::UString m_findRequest = "";
void SearchData::SetSearch(etk::String &myData)
void SearchData::SetSearch(etk::UString &myData)
{
m_findRequest = myData;
}
void SearchData::GetSearch(etk::String &myData)
void SearchData::GetSearch(etk::UString &myData)
{
myData = m_findRequest;
}
@@ -49,12 +49,12 @@ bool SearchData::IsSearchEmpty(void)
return true;
}
static etk::String m_replaceRequest = "";
void SearchData::SetReplace(etk::String &myData)
static etk::UString m_replaceRequest = "";
void SearchData::SetReplace(etk::UString &myData)
{
m_replaceRequest = myData;
}
void SearchData::GetReplace(etk::String &myData)
void SearchData::GetReplace(etk::UString &myData)
{
myData = m_replaceRequest;
}

View File

@@ -26,15 +26,16 @@
#ifndef __SEARCH_DATA_H__
#define __SEARCH_DATA_H__
#include <tools_debug.h>
#include <etk/UString.h>
#include <appl/Debug.h>
namespace SearchData
{
void SetSearch(etk::String &myData);
void GetSearch(etk::String &myData);
void SetSearch(etk::UString &myData);
void GetSearch(etk::UString &myData);
bool IsSearchEmpty(void);
void SetReplace(etk::String &myData);
void GetReplace(etk::String &myData);
void SetReplace(etk::UString &myData);
void GetReplace(etk::UString &myData);
bool IsReplaceEmpty(void);
void SetCase(bool value);
bool GetCase(void);

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