Compare commits
44 Commits
Author | SHA1 | Date | |
---|---|---|---|
8af2e7902d | |||
6459d11737 | |||
c1ab16ec1f | |||
4d7f4d8531 | |||
ad12b68ead | |||
b5371c4d13 | |||
0240bced14 | |||
3747bffa2f | |||
1864f9aa75 | |||
0a12bd17ed | |||
757a9a49ee | |||
6422d91883 | |||
24bb4f515c | |||
86552172d7 | |||
dcdfbe3647 | |||
421dc0c404 | |||
9678d46cb1 | |||
1724955f67 | |||
543cd8ddf1 | |||
7b456f1cdb | |||
cd8b5772e9 | |||
0633355169 | |||
52ac167872 | |||
b55be0aeca | |||
e325bffc5e | |||
b47d6f359d | |||
7d3e8d4d26 | |||
e85a34c988 | |||
9f7af89567 | |||
8c241ef106 | |||
73c2e6a547 | |||
c5b6519dc6 | |||
df24216dac | |||
b8c819936e | |||
91c1201f69 | |||
3aac9ab9a7 | |||
e6d078e0c9 | |||
af417b44f0 | |||
aabc92f309 | |||
46969e15b1 | |||
e1d2c2a3c7 | |||
4139e88a6c | |||
dd6f05540f | |||
d2f2afd129 |
57
Makefile
57
Makefile
@@ -1,57 +0,0 @@
|
|||||||
#############################################################################"
|
|
||||||
# main makefile for a basic application
|
|
||||||
# this is minimal application main makefile
|
|
||||||
#############################################################################"
|
|
||||||
|
|
||||||
# Project name ==> generate the application name [a-z] <== make attention at the case this generate error on Android compilation
|
|
||||||
PROJECT_NAME=edn
|
|
||||||
|
|
||||||
#Can be manny things, but limit whith no space no special char and no Maj ... [a-z]
|
|
||||||
# com : Commercial
|
|
||||||
# net : Network??
|
|
||||||
# org : Organisation
|
|
||||||
# gov : Governement
|
|
||||||
# mil : Military
|
|
||||||
# edu : Education
|
|
||||||
# pri : Private
|
|
||||||
# museum : ...
|
|
||||||
PROJECT_COMPAGNY_TYPE=org
|
|
||||||
|
|
||||||
# Compagny name of the project [a-zA-Z0-9 \-]
|
|
||||||
PROJECT_COMPAGNY_NAME=Edouard DUPIN
|
|
||||||
|
|
||||||
# List of mainainer that might be contact in problem case : "Mr NAME Surname<mail@host.com>" "second ..."
|
|
||||||
PROJECT_MAINTAINER="Mr DUPIN Edouard <yui.heero@gmail.com>"
|
|
||||||
|
|
||||||
# the icon of the project is all time needed ... if it is not present the ewol icon might be set (must be a .png file) (and no space in the fileName and filePath)
|
|
||||||
PROJECT_ICON=$(shell pwd)/data/icon.png
|
|
||||||
|
|
||||||
# project section : (must be separate by coma
|
|
||||||
# refer to : http://packages.debian.org/sid/
|
|
||||||
# admin cli-mono comm database debian-installer
|
|
||||||
# debug doc editors electronics devel embedded
|
|
||||||
# fonts games gnome gnu-r gnustep graphics
|
|
||||||
# hamradio haskell httpd interpreters java
|
|
||||||
# kde kernel libdevel libs lisp localization
|
|
||||||
# mail math misc net news ocaml oldlibs otherosfs
|
|
||||||
# perl php python ruby science shells sound tex
|
|
||||||
# text utils vcs video virtual web x11 xfce zope ...
|
|
||||||
PROJECT_SECTION=Development,Editors
|
|
||||||
|
|
||||||
# project prority
|
|
||||||
# required : Packages which are necessary for the proper functioning of the system (usually, this means that dpkg functionality depends on these packages). Removing a required package may cause your system to become totally broken and you may not even be able to use dpkg to put things back, so only do so if you know what you are doing. Systems with only the required packages are probably unusable, but they do have enough functionality to allow the sysadmin to boot and install more software.
|
|
||||||
# important : Important programs, including those which one would expect to find on any Unix-like system. If the expectation is that an experienced Unix person who found it missing would say "What on earth is going on, where is foo?", it must be an important package.[6] Other packages without which the system will not run well or be usable must also have priority important. This does not include Emacs, the X Window System, TeX or any other large applications. The important packages are just a bare minimum of commonly-expected and necessary tools.
|
|
||||||
# standard : These packages provide a reasonably small but not too limited character-mode system. This is what will be installed by default if the user doesn't select anything else. It doesn't include many large applications.
|
|
||||||
# optional : (In a sense everything that isn't required is optional, but that's not what is meant here.) This is all the software that you might reasonably want to install if you didn't know what it was and don't have specialized requirements. This is a much larger system and includes the X Window System, a full TeX distribution, and many applications. Note that optional packages should not conflict with each other.
|
|
||||||
# extra : This contains all packages that conflict with others with required, important, standard or optional priorities, or are only likely to be useful if you already know what they are or have specialized requirements (such as packages containing only detached debugging symbols).
|
|
||||||
PROJECT_PRIORITY=optional
|
|
||||||
|
|
||||||
# description of the current project inside quote and no \n
|
|
||||||
PROJECT_DESCRIPTION="Text editor for sources code with ctags management"
|
|
||||||
|
|
||||||
# Add package needed :
|
|
||||||
# current user packages
|
|
||||||
USER_PACKAGES =$(shell pwd)/sources/
|
|
||||||
|
|
||||||
# include the basic makefile of ewol :
|
|
||||||
include $(shell pwd)/../ewol/Makefile.mk
|
|
49
README.md
49
README.md
@@ -20,25 +20,23 @@ download the software :
|
|||||||
git clone git://github.com/HeeroYui/edn.git
|
git clone git://github.com/HeeroYui/edn.git
|
||||||
cd edn
|
cd edn
|
||||||
|
|
||||||
|
|
||||||
(debug) Compile software & Run debug version:
|
(debug) Compile software & Run debug version:
|
||||||
|
|
||||||
make DEBUG=1
|
../ewol/build/lutin.py --color --mode=debug
|
||||||
or
|
or
|
||||||
make CLANG=1 DEBUG=1
|
../ewol/build/lutin.py --color --compilator=clang --mode=debug
|
||||||
./out/Linux/debug/staging/edn/usr/bin/edn -l6 yourFile.txt
|
./out/Linux/debug/staging/edn//usr/bin/edn -l6 yourFile.txt
|
||||||
Note : -l6 corespond at the LOG level to display.
|
Note : -l6 corespond at the LOG level to display.
|
||||||
Note : If you not compile in debug mode, you must install it to execure it.
|
|
||||||
|
|
||||||
(release) Compile software & install & run:
|
(release) Compile software & install & run:
|
||||||
|
|
||||||
# generate binary and tree
|
# generate binary, tree, package and install it ...
|
||||||
make
|
../ewol/build/lutin.py -c edn-install
|
||||||
# generate .deb packages
|
|
||||||
make final
|
|
||||||
# install .deb packages
|
|
||||||
make install
|
|
||||||
edn exemple.txt
|
edn exemple.txt
|
||||||
|
|
||||||
|
|
||||||
(Android) Compile software & install
|
(Android) Compile software & install
|
||||||
|
|
||||||
cd yourDevFolder
|
cd yourDevFolder
|
||||||
@@ -50,26 +48,35 @@ download the software :
|
|||||||
==> you need to download sub package of the NDK (refer to the NDK doccumentation) but only supported android version >4.0
|
==> you need to download sub package of the NDK (refer to the NDK doccumentation) but only supported android version >4.0
|
||||||
cd ../edn
|
cd ../edn
|
||||||
# generate .so
|
# generate .so
|
||||||
make PLATFORM=Android
|
../ewol/build/lutin.py --color --target=Android --mode=debug edn-install
|
||||||
# generate .apk
|
|
||||||
make PLATFORM=Android final
|
|
||||||
# To send it on the board :
|
|
||||||
make PLATFORM=Android install
|
|
||||||
# to show the log :
|
# to show the log :
|
||||||
make PLATFORM=Android log
|
../ewol/build/lutin.py --target=Android edn-log
|
||||||
|
|
||||||
|
|
||||||
(Windows) Compile software & install
|
(Windows) Compile software & install
|
||||||
|
|
||||||
cd yourDevFolder/edn
|
cd yourDevFolder/edn
|
||||||
make PLATFORM=Windows
|
../ewol/build/lutin.py --color --target=Windows --mode=debug
|
||||||
# generate ...
|
|
||||||
make PLATFORM=Windows final
|
|
||||||
|
|
||||||
|
|
||||||
|
(MAC) All needed and some useful packages
|
||||||
|
|
||||||
|
- Git access (client you want or : http://code.google.com/p/git-osx-installer/ ==>need a ctrl+click to remove the normal installation control)
|
||||||
|
- Xcode ==> for all developement packages
|
||||||
|
- in Xcode : XCode->Setting->Download and install component: "Command Line Tools"
|
||||||
|
|
||||||
|
cd yourDevFolder/edn
|
||||||
|
../ewol/build/lutin.py --color --mode=debug
|
||||||
|
|
||||||
|
|
||||||
|
On linux you can generate 3 board in one time
|
||||||
|
=============================================
|
||||||
|
|
||||||
|
cd yourDevFolder/edn
|
||||||
|
../ewol/build/lutin.py --color --target=Linux --mode=debug edn --target=Windows --mode=debug edn --target=Android --mode=debug edn
|
||||||
|
|
||||||
Dependency packages
|
Dependency packages
|
||||||
===================
|
===================
|
||||||
|
|
||||||
sudo apt-get install g++ libgl1-mesa-dev zlib1g-dev libasound2-dev
|
sudo apt-get install g++ libgl1-mesa-dev zlib1g-dev libasound2-dev
|
||||||
# if you want to compile with clang :
|
# if you want to compile with clang :
|
||||||
sudo apt-get install clang
|
sudo apt-get install clang
|
||||||
@@ -77,7 +84,7 @@ Dependency packages
|
|||||||
sudo apt-get install mingw32
|
sudo apt-get install mingw32
|
||||||
|
|
||||||
|
|
||||||
License (GPL)
|
License (GPLv3)
|
||||||
==================
|
==================
|
||||||
|
|
||||||
Edn (Editeur De N'ours) : Source code editor
|
Edn (Editeur De N'ours) : Source code editor
|
||||||
|
@@ -1,35 +1,35 @@
|
|||||||
#
|
#
|
||||||
# Automatically generated make config: don't edit
|
# Automatically generated file; DO NOT EDIT.
|
||||||
# Linux kernel version:
|
# Linux Kernel Configuration
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
#
|
||||||
# Modules
|
# Modules
|
||||||
#
|
#
|
||||||
CONFIG_BUILD_EDN=y
|
|
||||||
# CONFIG_BUILD_AGG is not set
|
# CONFIG_BUILD_AGG is not set
|
||||||
|
# CONFIG_BUILD_LINEARMATH is not set
|
||||||
|
# CONFIG_BUILD_BULLET is not set
|
||||||
# CONFIG_BUILD_ETK is not set
|
# CONFIG_BUILD_ETK is not set
|
||||||
# CONFIG_BUILD_EWOL is not set
|
|
||||||
# CONFIG_BUILD_FREETYPE is not set
|
# CONFIG_BUILD_FREETYPE is not set
|
||||||
# CONFIG_BUILD_LUA is not set
|
# CONFIG_BUILD_LUA is not set
|
||||||
# CONFIG_BUILD_OGG is not set
|
# CONFIG_BUILD_OGG is not set
|
||||||
# CONFIG_BUILD_PARSERSVG is not set
|
# CONFIG_BUILD_PARSERSVG is not set
|
||||||
# CONFIG_BUILD_LIBPNG is not set
|
# CONFIG_BUILD_LIBPNG is not set
|
||||||
# CONFIG_BUILD_PORTAUDIO is not set
|
|
||||||
# CONFIG_BUILD_TINYXML is not set
|
# CONFIG_BUILD_TINYXML is not set
|
||||||
# CONFIG_BUILD_ZLIB is not set
|
# CONFIG_BUILD_ZLIB is not set
|
||||||
# CONFIG_BUILD_LIBZIP is not set
|
# CONFIG_BUILD_LIBZIP is not set
|
||||||
|
# CONFIG_BUILD_EWOL is not set
|
||||||
|
CONFIG_BUILD_EDN=y
|
||||||
|
|
||||||
#
|
#
|
||||||
# edn
|
# ewol
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
#
|
||||||
# General
|
# General
|
||||||
#
|
#
|
||||||
CONFIG_APPL_BUFFER_FONT_NORMAL=y
|
CONFIG___EWOL_APPL_BASIC_TITLE__="Edn : Sources Code Editor"
|
||||||
# CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set
|
CONFIG___EWOL_INTEGRATED_FONT__=y
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Android
|
# Android
|
||||||
@@ -40,7 +40,6 @@ CONFIG___EWOL_ANDROID_ORIENTATION_AUTO__=y
|
|||||||
# CONFIG___EWOL_ANDROID_ORIENTATION_LANDSCAPE__ is not set
|
# CONFIG___EWOL_ANDROID_ORIENTATION_LANDSCAPE__ is not set
|
||||||
# CONFIG___EWOL_ANDROID_ORIENTATION_PORTRAIT__ is not set
|
# CONFIG___EWOL_ANDROID_ORIENTATION_PORTRAIT__ is not set
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Permissions
|
# Permissions
|
||||||
#
|
#
|
||||||
@@ -57,15 +56,13 @@ CONFIG___ANDROID_PERMISSION__WRITE_EXTERNAL_STORAGE__=y
|
|||||||
# CONFIG___ANDROID_PERMISSION__VIBRATE__ is not set
|
# CONFIG___ANDROID_PERMISSION__VIBRATE__ is not set
|
||||||
# CONFIG___ANDROID_PERMISSION__ACCESS_COARSE_LOCATION__ is not set
|
# CONFIG___ANDROID_PERMISSION__ACCESS_COARSE_LOCATION__ is not set
|
||||||
# CONFIG___ANDROID_PERMISSION__ACCESS_FINE_LOCATION__ is not set
|
# CONFIG___ANDROID_PERMISSION__ACCESS_FINE_LOCATION__ is not set
|
||||||
# CONFIG___VIDEO__OPENGL_ES_1 is not set
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# ewol
|
# edn
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
#
|
||||||
# General
|
# General
|
||||||
#
|
#
|
||||||
CONFIG___EWOL_INTEGRATED_FONT__=y
|
CONFIG_APPL_BUFFER_FONT_NORMAL=y
|
||||||
CONFIG___EWOL_APPL_BASIC_TITLE__="Edn : Sources Code Editor"
|
# CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set
|
||||||
|
@@ -6,10 +6,9 @@
|
|||||||
#
|
#
|
||||||
# Modules
|
# Modules
|
||||||
#
|
#
|
||||||
CONFIG_BUILD_EDN=y
|
|
||||||
# CONFIG_BUILD_AGG is not set
|
# CONFIG_BUILD_AGG is not set
|
||||||
CONFIG_BUILD_LINEARMATH=y
|
# CONFIG_BUILD_LINEARMATH is not set
|
||||||
CONFIG_BUILD_BULLET=y
|
# CONFIG_BUILD_BULLET is not set
|
||||||
# CONFIG_BUILD_ETK is not set
|
# CONFIG_BUILD_ETK is not set
|
||||||
# CONFIG_BUILD_FREETYPE is not set
|
# CONFIG_BUILD_FREETYPE is not set
|
||||||
# CONFIG_BUILD_LUA is not set
|
# CONFIG_BUILD_LUA is not set
|
||||||
@@ -21,16 +20,7 @@ CONFIG_BUILD_BULLET=y
|
|||||||
# CONFIG_BUILD_ZLIB is not set
|
# CONFIG_BUILD_ZLIB is not set
|
||||||
# CONFIG_BUILD_LIBZIP is not set
|
# CONFIG_BUILD_LIBZIP is not set
|
||||||
# CONFIG_BUILD_EWOL is not set
|
# CONFIG_BUILD_EWOL is not set
|
||||||
|
CONFIG_BUILD_EDN=y
|
||||||
#
|
|
||||||
# edn
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# General
|
|
||||||
#
|
|
||||||
CONFIG_APPL_BUFFER_FONT_NORMAL=y
|
|
||||||
# CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# ewol
|
# ewol
|
||||||
@@ -47,3 +37,13 @@ CONFIG___EWOL_APPL_BASIC_TITLE__="Edn : Sources Code Editor"
|
|||||||
#
|
#
|
||||||
CONFIG___EWOL_LINUX_GUI_MODE_X11__=y
|
CONFIG___EWOL_LINUX_GUI_MODE_X11__=y
|
||||||
# CONFIG___EWOL_LINUX_GUI_MODE_DIRECT_FB__ is not set
|
# CONFIG___EWOL_LINUX_GUI_MODE_DIRECT_FB__ is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# edn
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# General
|
||||||
|
#
|
||||||
|
CONFIG_APPL_BUFFER_FONT_NORMAL=y
|
||||||
|
# CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set
|
||||||
|
48
config/MacOs.config
Normal file
48
config/MacOs.config
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
#
|
||||||
|
# Automatically generated file; DO NOT EDIT.
|
||||||
|
# Linux Kernel Configuration
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Modules
|
||||||
|
#
|
||||||
|
# CONFIG_BUILD_AGG is not set
|
||||||
|
# CONFIG_BUILD_LINEARMATH is not set
|
||||||
|
# CONFIG_BUILD_BULLET is not set
|
||||||
|
# CONFIG_BUILD_ETK is not set
|
||||||
|
# CONFIG_BUILD_FREETYPE is not set
|
||||||
|
# CONFIG_BUILD_LUA is not set
|
||||||
|
# CONFIG_BUILD_OGG is not set
|
||||||
|
# CONFIG_BUILD_PARSERSVG is not set
|
||||||
|
# CONFIG_BUILD_LIBPNG is not set
|
||||||
|
# CONFIG_BUILD_TINYXML is not set
|
||||||
|
# CONFIG_BUILD_ZLIB is not set
|
||||||
|
# CONFIG_BUILD_LIBZIP is not set
|
||||||
|
# CONFIG_BUILD_EWOL is not set
|
||||||
|
CONFIG_BUILD_EDN=y
|
||||||
|
|
||||||
|
#
|
||||||
|
# ewol
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# General
|
||||||
|
#
|
||||||
|
CONFIG___EWOL_APPL_BASIC_TITLE__="Edn : Sources Code Editor"
|
||||||
|
CONFIG___EWOL_INTEGRATED_FONT__=y
|
||||||
|
|
||||||
|
#
|
||||||
|
# Linux
|
||||||
|
#
|
||||||
|
CONFIG___EWOL_LINUX_GUI_MODE_X11__=y
|
||||||
|
# CONFIG___EWOL_LINUX_GUI_MODE_DIRECT_FB__ is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# edn
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# General
|
||||||
|
#
|
||||||
|
CONFIG_APPL_BUFFER_FONT_NORMAL=y
|
||||||
|
# CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set
|
@@ -1,15 +1,17 @@
|
|||||||
#
|
#
|
||||||
# Automatically generated make config: don't edit
|
# Automatically generated file; DO NOT EDIT.
|
||||||
|
# Linux Kernel Configuration
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
#
|
||||||
# Modules
|
# Modules
|
||||||
#
|
#
|
||||||
CONFIG_BUILD_EDN=y
|
|
||||||
# CONFIG_BUILD_AGG is not set
|
# CONFIG_BUILD_AGG is not set
|
||||||
|
# CONFIG_BUILD_LINEARMATH is not set
|
||||||
|
# CONFIG_BUILD_BULLET is not set
|
||||||
# CONFIG_BUILD_ETK is not set
|
# CONFIG_BUILD_ETK is not set
|
||||||
# CONFIG_BUILD_FREETYPE is not set
|
# CONFIG_BUILD_FREETYPE is not set
|
||||||
CONFIG_BUILD_GLEW=y
|
# CONFIG_BUILD_GLEW is not set
|
||||||
# CONFIG_BUILD_LUA is not set
|
# CONFIG_BUILD_LUA is not set
|
||||||
# CONFIG_BUILD_OGG is not set
|
# CONFIG_BUILD_OGG is not set
|
||||||
# CONFIG_BUILD_PARSERSVG is not set
|
# CONFIG_BUILD_PARSERSVG is not set
|
||||||
@@ -18,16 +20,7 @@ CONFIG_BUILD_GLEW=y
|
|||||||
# CONFIG_BUILD_ZLIB is not set
|
# CONFIG_BUILD_ZLIB is not set
|
||||||
# CONFIG_BUILD_LIBZIP is not set
|
# CONFIG_BUILD_LIBZIP is not set
|
||||||
# CONFIG_BUILD_EWOL is not set
|
# CONFIG_BUILD_EWOL is not set
|
||||||
|
CONFIG_BUILD_EDN=y
|
||||||
#
|
|
||||||
# edn
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# General
|
|
||||||
#
|
|
||||||
CONFIG_APPL_BUFFER_FONT_NORMAL=y
|
|
||||||
# CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# ewol
|
# ewol
|
||||||
@@ -38,3 +31,13 @@ CONFIG_APPL_BUFFER_FONT_NORMAL=y
|
|||||||
#
|
#
|
||||||
CONFIG___EWOL_APPL_BASIC_TITLE__="Ewol Basic Title"
|
CONFIG___EWOL_APPL_BASIC_TITLE__="Ewol Basic Title"
|
||||||
CONFIG___EWOL_INTEGRATED_FONT__=y
|
CONFIG___EWOL_INTEGRATED_FONT__=y
|
||||||
|
|
||||||
|
#
|
||||||
|
# edn
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# General
|
||||||
|
#
|
||||||
|
CONFIG_APPL_BUFFER_FONT_NORMAL=y
|
||||||
|
# CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set
|
||||||
|
@@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
<!-- hightline description : -->
|
<!-- hightline description : -->
|
||||||
<color name="type" FG="#376d0a" bold="yes"/>
|
<color name="type" FG="#376d0a" bold="yes"/>
|
||||||
|
<color name="memberClass" FG="#7c5406" bold="yes"/>
|
||||||
|
<color name="inputFunction" FG="#B80000" bold="yes" italic="yes"/>
|
||||||
<color name="storageKeyword" FG="#466cb4"/>
|
<color name="storageKeyword" FG="#466cb4"/>
|
||||||
<color name="number" FG="#007b00"/>
|
<color name="number" FG="#007b00"/>
|
||||||
<color name="systemFunction" FG="#acaa00"/>
|
<color name="systemFunction" FG="#acaa00"/>
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
<ext>*.cc</ext>
|
<ext>*.cc</ext>
|
||||||
<ext>*.h</ext>
|
<ext>*.h</ext>
|
||||||
<ext>*.hpp</ext>
|
<ext>*.hpp</ext>
|
||||||
|
<ext>*.mm</ext>
|
||||||
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
||||||
<rule name="my comment multiline doxygen">
|
<rule name="my comment multiline doxygen">
|
||||||
<color>commentDoxygen</color>
|
<color>commentDoxygen</color>
|
||||||
@@ -23,7 +24,7 @@
|
|||||||
</rule>
|
</rule>
|
||||||
<rule name="code Review">
|
<rule name="code Review">
|
||||||
<color>SYNTAX_ERROR</color>
|
<color>SYNTAX_ERROR</color>
|
||||||
<start>/\*[ \t]*@review</start>
|
<start>/\*[ \t]*TODO :</start>
|
||||||
<end>\*/</end>
|
<end>\*/</end>
|
||||||
</rule>
|
</rule>
|
||||||
<rule name="my comment multiline">
|
<rule name="my comment multiline">
|
||||||
@@ -88,7 +89,7 @@
|
|||||||
</rule>
|
</rule>
|
||||||
<rule name="my storage keyword">
|
<rule name="my storage keyword">
|
||||||
<color>storageKeyword</color>
|
<color>storageKeyword</color>
|
||||||
<start>\@const|class|virtual|private|public|protected|friend|const|extern|auto|register|static|unsigned|signed|volatile|char|double|float|int|long|short|void|typedef|struct|union|enum\@</start>
|
<start>\@inline|const|class|virtual|private|public|protected|friend|const|extern|auto|register|static|unsigned|signed|volatile|char|double|float|int|long|short|void|typedef|struct|union|enum\@</start>
|
||||||
</rule>
|
</rule>
|
||||||
<rule name="my common Define">
|
<rule name="my common Define">
|
||||||
<color>commonDefine</color>
|
<color>commonDefine</color>
|
||||||
@@ -106,6 +107,14 @@
|
|||||||
<color>macro</color>
|
<color>macro</color>
|
||||||
<start>\@[A-Z_][A-Z_0-9]{3,500}\@</start>
|
<start>\@[A-Z_][A-Z_0-9]{3,500}\@</start>
|
||||||
</rule>
|
</rule>
|
||||||
|
<rule name="CPP member">
|
||||||
|
<color>memberClass</color>
|
||||||
|
<start>\@m_[A-Za-z_0-9]*\@</start>
|
||||||
|
</rule>
|
||||||
|
<rule name="function input">
|
||||||
|
<color>inputFunction</color>
|
||||||
|
<start>\@_[A-Za-z_0-9]*\@</start>
|
||||||
|
</rule>
|
||||||
<rule name="Function name">
|
<rule name="Function name">
|
||||||
<color>functionName</color>
|
<color>functionName</color>
|
||||||
<start>\@(\w|_)+[ \t]*\(</start>
|
<start>\@(\w|_)+[ \t]*\(</start>
|
||||||
|
26
data/languages/json/highlight.xml
Normal file
26
data/languages/json/highlight.xml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<EdnLang version="0.1" lang="json">
|
||||||
|
<ext>*.json</ext>
|
||||||
|
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
||||||
|
<rule name="doubleQuteText">
|
||||||
|
<color>doubleQuoteText</color>
|
||||||
|
<start>"</start>
|
||||||
|
<end>"</end>
|
||||||
|
<EscapeChar>\</EscapeChar>
|
||||||
|
</rule>
|
||||||
|
</pass1>
|
||||||
|
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
|
||||||
|
<rule name="my keyword">
|
||||||
|
<color>keyword</color>
|
||||||
|
<start>\{|\}|\[|\]</start>
|
||||||
|
</rule>
|
||||||
|
<rule name="separator">
|
||||||
|
<color>error</color>
|
||||||
|
<start>:|,</start>
|
||||||
|
</rule>
|
||||||
|
<rule name="names">
|
||||||
|
<color>functionName</color>
|
||||||
|
<start>([a-zA-Z0-9]|-|_)*</start>
|
||||||
|
</rule>
|
||||||
|
</pass2>
|
||||||
|
</EdnLang>
|
@@ -25,7 +25,7 @@
|
|||||||
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
|
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
|
||||||
<rule name="confition">
|
<rule name="confition">
|
||||||
<color>type</color>
|
<color>type</color>
|
||||||
<start>\@if|ifed|ifneq|else|endif\@</start>
|
<start>\@if|ifeq|ifneq|else|endif|define|endef\@</start>
|
||||||
</rule>
|
</rule>
|
||||||
<rule name="my keyword">
|
<rule name="my keyword">
|
||||||
<color>keyword</color>
|
<color>keyword</color>
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
</rule>
|
</rule>
|
||||||
<rule name="function call">
|
<rule name="function call">
|
||||||
<color>functionName</color>
|
<color>functionName</color>
|
||||||
<start>\$\((call|info|error|warning|shell|patsubst|lastword|wildcard|addprefix|foreach|subst|if|word|eval)</start>
|
<start>\$\((call|info|error|warning|shell|patsubst|lastword|wildcard|addprefix|foreach|subst|word|eval)</start>
|
||||||
</rule>
|
</rule>
|
||||||
<rule name="condition">
|
<rule name="condition">
|
||||||
<color>boolean</color>
|
<color>boolean</color>
|
||||||
|
77
data/languages/python/highlight.xml
Normal file
77
data/languages/python/highlight.xml
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<EdnLang version="0.1" lang="c">
|
||||||
|
<ext>*.py</ext>
|
||||||
|
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
||||||
|
<rule name="my comment multiline">
|
||||||
|
<color>comment</color>
|
||||||
|
<start>"""</start>
|
||||||
|
<end>"""</end>
|
||||||
|
</rule>
|
||||||
|
<rule name="my comment doxygen">
|
||||||
|
<color>commentDoxygen</color>
|
||||||
|
<start>##</start>
|
||||||
|
<end>\n</end>
|
||||||
|
</rule>
|
||||||
|
<rule name="my comment">
|
||||||
|
<color>comment</color>
|
||||||
|
<start>#</start>
|
||||||
|
<end>\n</end>
|
||||||
|
<EscapeChar>\</EscapeChar>
|
||||||
|
</rule>
|
||||||
|
<rule name="doubleQuteText">
|
||||||
|
<color>doubleQuoteText</color>
|
||||||
|
<start>"</start>
|
||||||
|
<end>"</end>
|
||||||
|
<EscapeChar>\</EscapeChar>
|
||||||
|
</rule>
|
||||||
|
<rule name="simpleQuteText">
|
||||||
|
<color>doubleQuoteText</color>
|
||||||
|
<start>'</start>
|
||||||
|
<end>'</end>
|
||||||
|
</rule>
|
||||||
|
</pass1>
|
||||||
|
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
|
||||||
|
<rule name="my keyword">
|
||||||
|
<color>keyword</color>
|
||||||
|
<start>\@if|else|elif|break|pass|continue|while|do|for|in|return\@</start>
|
||||||
|
</rule>
|
||||||
|
<rule name="my function keyword">
|
||||||
|
<color>systemFunction</color>
|
||||||
|
<start>\@print|len|range|del|__init__|self|os\.|sys\.|path\.\@</start>
|
||||||
|
</rule>
|
||||||
|
<rule name="my type">
|
||||||
|
<color>type</color>
|
||||||
|
<start>\@bool|BOOL|char|double|float\@</start>
|
||||||
|
</rule>
|
||||||
|
<rule name="my storage keyword">
|
||||||
|
<color>storageKeyword</color>
|
||||||
|
<start>\@def|class|import|from|as|try|except\@</start>
|
||||||
|
</rule>
|
||||||
|
<rule name="numeric constant">
|
||||||
|
<color>number</color>
|
||||||
|
<start>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</start>
|
||||||
|
</rule>
|
||||||
|
<rule name="my boolean">
|
||||||
|
<color>boolean</color>
|
||||||
|
<start>\@True|False\@</start>
|
||||||
|
</rule>
|
||||||
|
<rule name="BIG LETTER">
|
||||||
|
<color>macro</color>
|
||||||
|
<start>\@[A-Z_][A-Z_0-9]{3,500}\@</start>
|
||||||
|
</rule>
|
||||||
|
<rule name="Function name">
|
||||||
|
<color>functionName</color>
|
||||||
|
<start>\@(\w|_)+[ \t]*\(</start>
|
||||||
|
</rule>
|
||||||
|
<rule name="condition">
|
||||||
|
<color>boolean</color>
|
||||||
|
<start>==|<=|>=|!=|<{1,2}|>{1,2}|&&|\{|\}|</start>
|
||||||
|
</rule>
|
||||||
|
<!-- With all elementes : -->
|
||||||
|
<rule name="BIG LETTER">
|
||||||
|
<color>macro</color>
|
||||||
|
<start>([A-Z]|_){4,500}</start>
|
||||||
|
<elemSubColor id="1">doxElem</elemSubColor>
|
||||||
|
</rule>
|
||||||
|
</pass2>
|
||||||
|
</EdnLang>
|
@@ -28,7 +28,7 @@
|
|||||||
</rule>
|
</rule>
|
||||||
<rule name="normale Balise">
|
<rule name="normale Balise">
|
||||||
<color>functionName</color>
|
<color>functionName</color>
|
||||||
<start></[0-9a-fA-F_]*|<[0-9a-fA-F_]*|/>|></start>
|
<start></[0-9a-zA-Z_]+|<[0-9a-zA-Z_]+|/>|></start>
|
||||||
</rule>
|
</rule>
|
||||||
</pass2>
|
</pass2>
|
||||||
</EdnLang>
|
</EdnLang>
|
||||||
|
@@ -1,9 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
#really simple to install
|
|
||||||
echo "- copy binary /usr/bin/edn"
|
|
||||||
sudo cp -vf out/Linux/release/staging/edn/usr/bin/edn /usr/bin/edn
|
|
||||||
sudo mkdir -p /usr/share/edn
|
|
||||||
echo "- Remove the folder /usr/share/edn/*"
|
|
||||||
sudo rm -rf /usr/share/edn/*
|
|
||||||
sudo cp -rfv out/Linux/release/staging/edn/usr/share/* /usr/share/
|
|
6
lutinBase.py
Executable file
6
lutinBase.py
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
import lutinModule
|
||||||
|
import lutinTools
|
||||||
|
|
||||||
|
lutinModule.ImportPath(lutinTools.GetCurrentPath(__file__) + "/sources/")
|
||||||
|
lutinModule.ImportPath(lutinTools.GetCurrentPath(__file__) + "/../ewol/")
|
@@ -1,31 +0,0 @@
|
|||||||
LOCAL_PATH := $(call my-dir)
|
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
|
|
||||||
# load the common sources file of the platform
|
|
||||||
include $(LOCAL_PATH)/file.mk
|
|
||||||
|
|
||||||
LOCAL_CONFIG_FILES := Config.in
|
|
||||||
|
|
||||||
# name of the librairy
|
|
||||||
LOCAL_MODULE := edn
|
|
||||||
|
|
||||||
# get the tag of the current project :
|
|
||||||
LOCAL_VERSION=$(shell cat $(LOCAL_PATH)/../tag)
|
|
||||||
$(info [TAG:$(LOCAL_MODULE)] $(LOCAL_VERSION))
|
|
||||||
|
|
||||||
# name of the dependency
|
|
||||||
LOCAL_LIBRARIES := ewol freetype libpng parsersvg tinyxml lua etk libzip
|
|
||||||
|
|
||||||
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(addprefix $(LOCAL_PATH)/, $(sort $(dir $(FILE_LIST))))
|
|
||||||
|
|
||||||
LOCAL_SRC_FILES := $(FILE_LIST)
|
|
||||||
|
|
||||||
LOCAL_LDLIBS := -llog -landroid
|
|
||||||
|
|
||||||
LOCAL_CFLAGS := -DPROJECT_NAME="\"$(LOCAL_MODULE)\"" \
|
|
||||||
-DAPPL_VERSION_TAG_NAME="\"$(LOCAL_VERSION)-$(BUILD_DIRECTORY_MODE)\""
|
|
||||||
|
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
|
||||||
|
|
@@ -1,16 +0,0 @@
|
|||||||
menu "General"
|
|
||||||
choice
|
|
||||||
prompt "Buffer text configuration"
|
|
||||||
default APPL_BUFFER_FONT_NORMAL
|
|
||||||
help
|
|
||||||
Buffer display mode :
|
|
||||||
0 : Basic Sprite font mode.
|
|
||||||
==> Old standard mode fast but need to reaload distint font for every size
|
|
||||||
1 : Distance Field.
|
|
||||||
==> New theoric mode for the display of the font ==> really slow but insteresting ...
|
|
||||||
config APPL_BUFFER_FONT_NORMAL
|
|
||||||
bool "0: Basic Sprite font mode"
|
|
||||||
config APPL_BUFFER_FONT_DISTANCE_FIELD
|
|
||||||
bool "1: Distance Field"
|
|
||||||
endchoice
|
|
||||||
endmenu
|
|
@@ -1,32 +0,0 @@
|
|||||||
LOCAL_PATH := $(call my-dir)
|
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
|
|
||||||
# load the common sources file of the platform
|
|
||||||
include $(LOCAL_PATH)/file.mk
|
|
||||||
|
|
||||||
LOCAL_CONFIG_FILES := Config.in
|
|
||||||
|
|
||||||
# name of the librairy
|
|
||||||
LOCAL_MODULE := edn
|
|
||||||
# get the tag of the current project :
|
|
||||||
LOCAL_VERSION=$(shell cat $(LOCAL_PATH)/../tag)
|
|
||||||
$(info [TAG:$(LOCAL_MODULE)] $(LOCAL_VERSION))
|
|
||||||
|
|
||||||
# name of the dependency
|
|
||||||
LOCAL_STATIC_LIBRARIES := ewol
|
|
||||||
|
|
||||||
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(addprefix $(LOCAL_PATH)/, $(sort $(dir $(FILE_LIST))))
|
|
||||||
|
|
||||||
LOCAL_SRC_FILES := $(FILE_LIST)
|
|
||||||
|
|
||||||
|
|
||||||
LOCAL_LDLIBS :=
|
|
||||||
|
|
||||||
LOCAL_CFLAGS := -DPROJECT_NAME="\"$(LOCAL_MODULE)\"" \
|
|
||||||
-DAPPL_VERSION_TAG_NAME="\"$(LOCAL_VERSION)-$(BUILD_DIRECTORY_MODE)\""
|
|
||||||
|
|
||||||
LOCAL_COPY_FILES += ../data/icon.png:icon.png
|
|
||||||
|
|
||||||
include $(BUILD_EXECUTABLE)
|
|
||||||
|
|
@@ -1,30 +0,0 @@
|
|||||||
LOCAL_PATH := $(call my-dir)
|
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
|
|
||||||
# load the common sources file of the platform
|
|
||||||
include $(LOCAL_PATH)/file.mk
|
|
||||||
|
|
||||||
LOCAL_CONFIG_FILES := Config.in
|
|
||||||
|
|
||||||
# name of the librairy
|
|
||||||
LOCAL_MODULE := edn
|
|
||||||
|
|
||||||
# get the tag of the current project :
|
|
||||||
LOCAL_VERSION=$(shell cat $(LOCAL_PATH)/../tag)
|
|
||||||
$(info [TAG:$(LOCAL_MODULE)] $(LOCAL_VERSION))
|
|
||||||
|
|
||||||
# name of the dependency
|
|
||||||
LOCAL_STATIC_LIBRARIES := ewol
|
|
||||||
|
|
||||||
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(addprefix $(LOCAL_PATH)/, $(sort $(dir $(FILE_LIST))))
|
|
||||||
|
|
||||||
LOCAL_SRC_FILES := $(FILE_LIST)
|
|
||||||
|
|
||||||
|
|
||||||
LOCAL_LDLIBS :=
|
|
||||||
|
|
||||||
LOCAL_CFLAGS := -DPROJECT_NAME="\"$(LOCAL_MODULE)\"" \
|
|
||||||
-DAPPL_VERSION_TAG_NAME="\"$(LOCAL_VERSION)-$(BUILD_DIRECTORY_MODE)\""
|
|
||||||
|
|
||||||
include $(BUILD_EXECUTABLE)
|
|
@@ -9,8 +9,8 @@
|
|||||||
#include <appl/Debug.h>
|
#include <appl/Debug.h>
|
||||||
#include <appl/global.h>
|
#include <appl/global.h>
|
||||||
#include <BufferManager.h>
|
#include <BufferManager.h>
|
||||||
#include <ewol/eObject/EObject.h>
|
#include <ewol/renderer/EObject.h>
|
||||||
#include <ewol/eObject/EObjectManager.h>
|
#include <ewol/renderer/EObjectManager.h>
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "classBufferManager"
|
#define __class__ "classBufferManager"
|
||||||
@@ -21,25 +21,12 @@ class classBufferManager: public ewol::EObject
|
|||||||
// Constructeur
|
// Constructeur
|
||||||
classBufferManager(void);
|
classBufferManager(void);
|
||||||
~classBufferManager(void);
|
~classBufferManager(void);
|
||||||
/**
|
|
||||||
* @brief Get the current Object type of the EObject
|
|
||||||
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
|
|
||||||
* @param[in] objectType type description
|
|
||||||
* @return true if the object is compatible, otherwise false
|
|
||||||
*/
|
|
||||||
const char * const GetObjectType(void)
|
const char * const GetObjectType(void)
|
||||||
{
|
{
|
||||||
return "ApplBufferManager";
|
return "ApplBufferManager";
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
/**
|
virtual void OnReceiveMessage(const ewol::EMessage& _msg);
|
||||||
* @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:
|
private:
|
||||||
// return the ID of the buffer allocated
|
// return the ID of the buffer allocated
|
||||||
// create a buffer with no element
|
// create a buffer with no element
|
||||||
@@ -70,14 +57,6 @@ class classBufferManager: public ewol::EObject
|
|||||||
|
|
||||||
|
|
||||||
// Constructeur
|
// Constructeur
|
||||||
/**
|
|
||||||
* @brief
|
|
||||||
*
|
|
||||||
* @param[in,out] ---
|
|
||||||
*
|
|
||||||
* @return ---
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
classBufferManager::classBufferManager(void)
|
classBufferManager::classBufferManager(void)
|
||||||
{
|
{
|
||||||
m_idSelected = -1;
|
m_idSelected = -1;
|
||||||
@@ -89,14 +68,6 @@ classBufferManager::classBufferManager(void)
|
|||||||
RegisterMultiCast(ednMsgBufferId);
|
RegisterMultiCast(ednMsgBufferId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief
|
|
||||||
*
|
|
||||||
* @param[in,out] ---
|
|
||||||
*
|
|
||||||
* @return ---
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
classBufferManager::~classBufferManager(void)
|
classBufferManager::~classBufferManager(void)
|
||||||
{
|
{
|
||||||
//clean All Buffer
|
//clean All Buffer
|
||||||
@@ -108,24 +79,17 @@ classBufferManager::~classBufferManager(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
void classBufferManager::OnReceiveMessage(const ewol::EMessage& _msg)
|
||||||
* @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);
|
ewol::EObject::OnReceiveMessage(_msg);
|
||||||
|
|
||||||
if (eventId == ednMsgBufferId) {
|
if (_msg.GetMessage() == ednMsgBufferId) {
|
||||||
// select a new buffer ID :
|
// select a new buffer ID :
|
||||||
if (data == "") {
|
if (_msg.GetData() == "") {
|
||||||
APPL_ERROR("Request select buffer ID = \"\" ");
|
APPL_ERROR("Request select buffer ID = \"\" ");
|
||||||
} else {
|
} else {
|
||||||
int32_t newID = -1;
|
int32_t newID = -1;
|
||||||
sscanf(data.c_str(), "%d", &newID);
|
sscanf(_msg.GetData().c_str(), "%d", &newID);
|
||||||
if(true == Exist(newID)) {
|
if(true == Exist(newID)) {
|
||||||
m_idSelected = newID;
|
m_idSelected = newID;
|
||||||
} else {
|
} else {
|
||||||
@@ -133,17 +97,18 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
|
|||||||
APPL_ERROR("Request a non existant ID : " << newID << " reset to -1...");
|
APPL_ERROR("Request a non existant ID : " << newID << " reset to -1...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (eventId == ednMsgGuiNew) {
|
} else if (_msg.GetMessage() == ednMsgGuiNew) {
|
||||||
int32_t newOne = Create();
|
int32_t newOne = Create();
|
||||||
if (-1 != newOne) {
|
if (-1 != newOne) {
|
||||||
m_idSelected = newOne;
|
m_idSelected = newOne;
|
||||||
SendMultiCast(ednMsgBufferId, m_idSelected);
|
SendMultiCast(ednMsgBufferId, m_idSelected);
|
||||||
SendMultiCast(ednMsgBufferListChange);
|
SendMultiCast(ednMsgBufferListChange);
|
||||||
}
|
}
|
||||||
} else if (eventId == ednMsgOpenFile) {
|
} else if (_msg.GetMessage() == ednMsgOpenFile) {
|
||||||
if (data != "" ) {
|
if (_msg.GetData() != "" ) {
|
||||||
etk::FSNode myFile(data);
|
etk::FSNode myFile(_msg.GetData());
|
||||||
APPL_DEBUG("request open file = \"" <<data << "\" ?= \"" << myFile << "\"");
|
if (myFile.GetNodeType() == etk::FSN_FILE) {
|
||||||
|
APPL_DEBUG("request open file = \"" << _msg.GetData() << "\" ?= \"" << myFile << "\"");
|
||||||
int32_t newOne = Open(myFile);
|
int32_t newOne = Open(myFile);
|
||||||
if (-1 != newOne) {
|
if (-1 != newOne) {
|
||||||
m_idSelected = newOne;
|
m_idSelected = newOne;
|
||||||
@@ -153,12 +118,15 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
|
|||||||
// TODO : notify user that we can not open the request file...
|
// TODO : notify user that we can not open the request file...
|
||||||
APPL_ERROR("Can not open the file : \"" << myFile << "\"");
|
APPL_ERROR("Can not open the file : \"" << myFile << "\"");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
APPL_ERROR("Request to open an Unknox element file : " << myFile << " type:" << myFile.GetNodeType());
|
||||||
}
|
}
|
||||||
} else if (eventId == ednMsgGuiSave) {
|
}
|
||||||
if (data == "") {
|
} else if (_msg.GetMessage() == ednMsgGuiSave) {
|
||||||
|
if (_msg.GetData() == "") {
|
||||||
APPL_ERROR("Null data for close file ... ");
|
APPL_ERROR("Null data for close file ... ");
|
||||||
} else {
|
} else {
|
||||||
if (data == "current") {
|
if (_msg.GetData() == "current") {
|
||||||
// Check buffer existence
|
// Check buffer existence
|
||||||
if(true == Exist(m_idSelected)) {
|
if(true == Exist(m_idSelected)) {
|
||||||
// If no name ==> request a Gui display ...
|
// If no name ==> request a Gui display ...
|
||||||
@@ -170,7 +138,7 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int32_t newId;
|
int32_t newId;
|
||||||
sscanf(data.c_str(), "%d", &newId);
|
sscanf(_msg.GetData().c_str(), "%d", &newId);
|
||||||
if (false == Exist(newId)) {
|
if (false == Exist(newId)) {
|
||||||
APPL_ERROR("Request a save As with a non existant ID=" << newId);
|
APPL_ERROR("Request a save As with a non existant ID=" << newId);
|
||||||
} else {
|
} else {
|
||||||
@@ -184,20 +152,20 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
|
|||||||
SendMultiCast(ednMsgBufferState, "saved");
|
SendMultiCast(ednMsgBufferState, "saved");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (eventId == ednMsgGuiClose) {
|
} else if (_msg.GetMessage() == ednMsgGuiClose) {
|
||||||
if (data == "") {
|
if (_msg.GetData() == "") {
|
||||||
APPL_ERROR("Null data for close file ... ");
|
APPL_ERROR("Null data for close file ... ");
|
||||||
} else {
|
} else {
|
||||||
if (data == "All") {
|
if (_msg.GetData() == "All") {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
int32_t closeID = -1;
|
int32_t closeID = -1;
|
||||||
if (data == "current") {
|
if (_msg.GetData() == "current") {
|
||||||
closeID = m_idSelected;
|
closeID = m_idSelected;
|
||||||
APPL_DEBUG("Close specific buffer ID" << closeID);
|
APPL_DEBUG("Close specific buffer ID" << closeID);
|
||||||
} else {
|
} else {
|
||||||
// close specific buffer ...
|
// close specific buffer ...
|
||||||
sscanf(data.c_str(), "%d", &closeID);
|
sscanf(_msg.GetData().c_str(), "%d", &closeID);
|
||||||
APPL_DEBUG("Close specific buffer ID="<< closeID);
|
APPL_DEBUG("Close specific buffer ID="<< closeID);
|
||||||
}
|
}
|
||||||
if(true == Exist(closeID)) {
|
if(true == Exist(closeID)) {
|
||||||
@@ -232,13 +200,13 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (eventId == ednMsgCodeViewSelectedId) {
|
} else if (_msg.GetMessage() == ednMsgCodeViewSelectedId) {
|
||||||
//Change the selected buffer
|
//Change the selected buffer
|
||||||
if (data == "") {
|
if (_msg.GetData() == "") {
|
||||||
APPL_ERROR("Null data for changing buffer ID file ... ");
|
APPL_ERROR("Null data for changing buffer ID file ... ");
|
||||||
} else {
|
} else {
|
||||||
int32_t newId;
|
int32_t newId;
|
||||||
sscanf(data.c_str(), "%d", &newId);
|
sscanf(_msg.GetData().c_str(), "%d", &newId);
|
||||||
if (true == Exist(newId)) {
|
if (true == Exist(newId)) {
|
||||||
m_idSelected = newId;
|
m_idSelected = newId;
|
||||||
} else {
|
} else {
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
#include <ewol/widget/WidgetManager.h>
|
#include <ewol/widget/WidgetManager.h>
|
||||||
#include <ewol/widget/Widget.h>
|
#include <ewol/widget/Widget.h>
|
||||||
#include <ewol/clipBoard.h>
|
#include <ewol/clipBoard.h>
|
||||||
|
#include <ewol/renderer/eContext.h>
|
||||||
|
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
@@ -92,7 +93,7 @@ void BufferText::SetModify(bool status)
|
|||||||
m_fileModify = status;
|
m_fileModify = status;
|
||||||
// TODO : Remove from here
|
// TODO : Remove from here
|
||||||
etk::UString data = "Modify";
|
etk::UString data = "Modify";
|
||||||
ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgBufferState, data);
|
ewol::GetContext().GetEObjectManager().MultiCast().AnonymousSend(ednMsgBufferState, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,12 +169,10 @@ BufferText::BufferText(etk::FSNode &fileName)
|
|||||||
APPL_INFO("Add Data from file(" << GetFileName() << ")");
|
APPL_INFO("Add Data from file(" << GetFileName() << ")");
|
||||||
etk::FSNode myFile(fileName);
|
etk::FSNode myFile(fileName);
|
||||||
if (true == myFile.Exist()) {
|
if (true == myFile.Exist()) {
|
||||||
if (false == myFile.FileOpenRead()) {
|
if (false == m_EdnBuf.DumpFrom(myFile)) {
|
||||||
APPL_WARNING("File can not be open in read mode : " << myFile);
|
APPL_WARNING("File can not be open in read mode : " << myFile);
|
||||||
SetModify(true);
|
SetModify(true);
|
||||||
} else {
|
} else {
|
||||||
m_EdnBuf.DumpFrom(myFile);
|
|
||||||
myFile.FileClose();
|
|
||||||
SetModify(false);
|
SetModify(false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -197,11 +196,9 @@ void BufferText::Save(void)
|
|||||||
{
|
{
|
||||||
APPL_INFO("Save File : \"" << GetFileName() << "\"" );
|
APPL_INFO("Save File : \"" << GetFileName() << "\"" );
|
||||||
etk::FSNode myFile(GetFileName());
|
etk::FSNode myFile(GetFileName());
|
||||||
if (false == myFile.FileOpenWrite()) {
|
if (false == m_EdnBuf.DumpIn(myFile)) {
|
||||||
APPL_ERROR("Can not open in writing the specify file");
|
APPL_ERROR("Can not open in writing the specify file");
|
||||||
} else {
|
} else {
|
||||||
m_EdnBuf.DumpIn(myFile);
|
|
||||||
myFile.FileClose();
|
|
||||||
SetModify(false);
|
SetModify(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -338,8 +335,8 @@ int32_t BufferText::Display(ewol::Text& OOText,
|
|||||||
// Get color :
|
// Get color :
|
||||||
Colorize * myColor = ColorizeManager::Get("normal");
|
Colorize * myColor = ColorizeManager::Get("normal");
|
||||||
Colorize * myColorSel = ColorizeManager::Get("SelectedText");
|
Colorize * myColorSel = ColorizeManager::Get("SelectedText");
|
||||||
draw::Color & myColorSpace = ColorizeManager::Get(COLOR_CODE_SPACE);
|
etk::Color<> & myColorSpace = ColorizeManager::Get(COLOR_CODE_SPACE);
|
||||||
draw::Color & myColorTab = ColorizeManager::Get(COLOR_CODE_TAB);
|
etk::Color<> & myColorTab = ColorizeManager::Get(COLOR_CODE_TAB);
|
||||||
Colorize * selectColor = NULL;
|
Colorize * selectColor = NULL;
|
||||||
int mylen = m_EdnBuf.Size();
|
int mylen = m_EdnBuf.Size();
|
||||||
int32_t x_base=nbColoneForLineNumber*letterWidth;
|
int32_t x_base=nbColoneForLineNumber*letterWidth;
|
||||||
@@ -408,12 +405,12 @@ int32_t BufferText::Display(ewol::Text& OOText,
|
|||||||
if (currentChar!='\n') {
|
if (currentChar!='\n') {
|
||||||
selectColor = myColor;
|
selectColor = myColor;
|
||||||
HLColor = m_EdnBuf.GetElementColorAtPosition(m_displayLocalSyntax, iii);
|
HLColor = m_EdnBuf.GetElementColorAtPosition(m_displayLocalSyntax, iii);
|
||||||
if (NULL != HLColor) {
|
if (HLColor != NULL) {
|
||||||
if (NULL != HLColor->patern) {
|
if (HLColor->patern != NULL) {
|
||||||
selectColor = HLColor->patern->GetColor();
|
selectColor = HLColor->patern->GetColor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OOText.SetColorBg(draw::color::none);
|
OOText.SetColorBg(etk::color::none);
|
||||||
if( true == selHave
|
if( true == selHave
|
||||||
&& selStart <= iii
|
&& selStart <= iii
|
||||||
&& selEnd > iii)
|
&& selEnd > iii)
|
||||||
@@ -422,12 +419,12 @@ int32_t BufferText::Display(ewol::Text& OOText,
|
|||||||
OOText.SetColorBg(selectColor->GetBG() );
|
OOText.SetColorBg(selectColor->GetBG() );
|
||||||
} else {
|
} else {
|
||||||
if(false == selectColor->HaveBg()) {
|
if(false == selectColor->HaveBg()) {
|
||||||
if( (uniChar_t)' ' == currentChar
|
if( currentChar == ' '
|
||||||
&& true == globals::IsSetDisplaySpaceChar() )
|
&& globals::IsSetDisplaySpaceChar() == true )
|
||||||
{
|
{
|
||||||
OOText.SetColorBg(myColorSpace);
|
OOText.SetColorBg(myColorSpace);
|
||||||
} else if( '\t' == currentChar
|
} else if( currentChar == '\t'
|
||||||
&& true == globals::IsSetDisplayTabChar() )
|
&& globals::IsSetDisplayTabChar() == true )
|
||||||
{
|
{
|
||||||
OOText.SetColorBg(myColorTab);
|
OOText.SetColorBg(myColorTab);
|
||||||
}
|
}
|
||||||
@@ -487,12 +484,19 @@ int32_t BufferText::Display(ewol::Text& OOText,
|
|||||||
OOText.SetColorBg(ColorizeManager::Get(COLOR_CODE_CURSOR));
|
OOText.SetColorBg(ColorizeManager::Get(COLOR_CODE_CURSOR));
|
||||||
OOText.PrintCursor(ewol::GetCurrentSpecialKeyStatus().IsSetInsert());
|
OOText.PrintCursor(ewol::GetCurrentSpecialKeyStatus().IsSetInsert());
|
||||||
}
|
}
|
||||||
|
// Display the 80 colomn limit line :
|
||||||
|
|
||||||
|
OOText.SetClippingMode(false);
|
||||||
|
OOText.GetDrawing().SetThickness(2);
|
||||||
|
OOText.GetDrawing().SetColor(etk::Color<>(200,200,0,255));
|
||||||
|
OOText.GetDrawing().SetPos(vec2((float)((nbColoneForLineNumber+80)*tmpLetterSize.x()), 0.0f));
|
||||||
|
OOText.GetDrawing().LineRel(vec2(0.0f, 2500.0f));
|
||||||
// set the maximum size for the display ...
|
// set the maximum size for the display ...
|
||||||
SetMaximumSize(maxSize);
|
SetMaximumSize(maxSize);
|
||||||
int64_t stopTime2 = ewol::GetTime();
|
int64_t stopTime2 = ewol::GetTime();
|
||||||
APPL_DEBUG("DRAW text (brut) = " << stopTime2 - stopTime << " micro-s");
|
APPL_DEBUG("DRAW text (brut) = " << stopTime2 - stopTime << " micro-s");
|
||||||
|
|
||||||
return ERR_NONE;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1001,7 +1005,7 @@ void BufferText::AddChar(uniChar_t unicodeData)
|
|||||||
// normal adding char ...
|
// normal adding char ...
|
||||||
if (true == m_EdnBuf.GetUTF8Mode()) {
|
if (true == m_EdnBuf.GetUTF8Mode()) {
|
||||||
char tmpUTF8[16];
|
char tmpUTF8[16];
|
||||||
unicode::convertUnicodeToUtf8(unicodeData, tmpUTF8);
|
unicodeData.GetUtf8(tmpUTF8);
|
||||||
etk::Vector<int8_t> tmpVect;
|
etk::Vector<int8_t> tmpVect;
|
||||||
int32_t localOfset = strlen(tmpUTF8);
|
int32_t localOfset = strlen(tmpUTF8);
|
||||||
tmpVect.PushBack((int8_t*)tmpUTF8, localOfset);
|
tmpVect.PushBack((int8_t*)tmpUTF8, localOfset);
|
||||||
|
@@ -34,7 +34,8 @@ static const char *ControlCodeTable[32] = {
|
|||||||
*/
|
*/
|
||||||
EdnBuf::EdnBuf(void)
|
EdnBuf::EdnBuf(void)
|
||||||
{
|
{
|
||||||
m_tabDist = 4;
|
// TODO : Set it configurable !!!
|
||||||
|
m_tabDist = 8;
|
||||||
m_useTabs = true;
|
m_useTabs = true;
|
||||||
|
|
||||||
// Current selection
|
// Current selection
|
||||||
@@ -167,7 +168,7 @@ void EdnBuf::GetRange(int32_t start, int32_t end, etk::UString &output)
|
|||||||
* @return The character at buffer position "pos"
|
* @return The character at buffer position "pos"
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int8_t EdnBuf::operator[] (int32_t pos)
|
int8_t EdnBuf::operator[] (int32_t pos) const
|
||||||
{
|
{
|
||||||
int8_t res = m_data.Get(pos);
|
int8_t res = m_data.Get(pos);
|
||||||
return res;
|
return res;
|
||||||
@@ -240,12 +241,13 @@ int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::UString &insertText)
|
|||||||
GetRange(start, end, deletedText);
|
GetRange(start, end, deletedText);
|
||||||
etk::Vector<int8_t> tmpInsertText;
|
etk::Vector<int8_t> tmpInsertText;
|
||||||
if (true == m_isUtf8) {
|
if (true == m_isUtf8) {
|
||||||
char * tmpPointer = insertText.c_str();
|
etk::Char tmpChar = insertText.c_str();
|
||||||
|
const char * tmpPointer = tmpChar;
|
||||||
while (*tmpPointer != '\0') {
|
while (*tmpPointer != '\0') {
|
||||||
tmpInsertText.PushBack(*tmpPointer++);
|
tmpInsertText.PushBack(*tmpPointer++);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
etk::Vector<unsigned int> tmppp = insertText.GetVector();
|
etk::Vector<uniChar_t> tmppp = insertText.GetVector();
|
||||||
convertUnicodeToIso(m_charsetType, tmppp, tmpInsertText);
|
convertUnicodeToIso(m_charsetType, tmppp, tmpInsertText);
|
||||||
}
|
}
|
||||||
if (tmpInsertText.Size()>0) {
|
if (tmpInsertText.Size()>0) {
|
||||||
@@ -500,7 +502,7 @@ int32_t EdnBuf::GetExpandedChar(int32_t &pos, int32_t indent, char outUTF8[MAX_E
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, just return the character
|
// Otherwise, just return the character
|
||||||
if (false ==m_isUtf8) {
|
if (m_isUtf8 == false) {
|
||||||
convertIsoToUtf8(m_charsetType, c, outUTF8);
|
convertIsoToUtf8(m_charsetType, c, outUTF8);
|
||||||
pos++;
|
pos++;
|
||||||
} else {
|
} else {
|
||||||
@@ -513,10 +515,10 @@ int32_t EdnBuf::GetExpandedChar(int32_t &pos, int32_t indent, char outUTF8[MAX_E
|
|||||||
bool baseValid;
|
bool baseValid;
|
||||||
unicode::Utf8_SizeElement(tmpString, 6 , size, baseValid);
|
unicode::Utf8_SizeElement(tmpString, 6 , size, baseValid);
|
||||||
currentChar = 0; // TODO : Set UNICODE char ...
|
currentChar = 0; // TODO : Set UNICODE char ...
|
||||||
if (true == baseValid) {
|
if (baseValid == true) {
|
||||||
char *tmp = outUTF8;
|
char *tmp = outUTF8;
|
||||||
for (int32_t k=0; k<size; k++) {
|
for (int32_t kkk=0; kkk<size; kkk++) {
|
||||||
*tmp++ = tmpString[k];
|
*tmp++ = tmpString[kkk];
|
||||||
}
|
}
|
||||||
*tmp = '\0';
|
*tmp = '\0';
|
||||||
} else {
|
} else {
|
||||||
@@ -621,7 +623,7 @@ int32_t EdnBuf::GetExpandedChar(int32_t &pos, int32_t indent, uniChar_t outUnico
|
|||||||
tmp[kkk] = tmpString[kkk];
|
tmp[kkk] = tmpString[kkk];
|
||||||
tmp[kkk+1] = '\0';
|
tmp[kkk+1] = '\0';
|
||||||
}
|
}
|
||||||
unicode::convertUtf8ToUnicode(tmp, outUnicode[0]);
|
outUnicode[0].SetUtf8(tmp);
|
||||||
outUnicode[1] = 0;
|
outUnicode[1] = 0;
|
||||||
} else {
|
} else {
|
||||||
outUnicode[0] = '<';
|
outUnicode[0] = '<';
|
||||||
@@ -932,12 +934,13 @@ bool EdnBuf::SearchForward(int32_t startPos, etk::UString &search, int32_t *foun
|
|||||||
{
|
{
|
||||||
etk::Vector<int8_t> searchVect;
|
etk::Vector<int8_t> searchVect;
|
||||||
if (true == m_isUtf8) {
|
if (true == m_isUtf8) {
|
||||||
char * tmpPointer = search.c_str();
|
etk::Char tmpChar = search.c_str();
|
||||||
|
const char * tmpPointer = tmpChar;
|
||||||
while (*tmpPointer != '\0') {
|
while (*tmpPointer != '\0') {
|
||||||
searchVect.PushBack(*tmpPointer++);
|
searchVect.PushBack(*tmpPointer++);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
etk::Vector<unsigned int> tmppp = search.GetVector();
|
etk::Vector<etk::UniChar> tmppp = search.GetVector();
|
||||||
convertUnicodeToIso(m_charsetType, tmppp, searchVect);
|
convertUnicodeToIso(m_charsetType, tmppp, searchVect);
|
||||||
}
|
}
|
||||||
// remove the '\0' at the end of the string ...
|
// remove the '\0' at the end of the string ...
|
||||||
@@ -987,12 +990,13 @@ bool EdnBuf::SearchBackward(int32_t startPos, etk::UString &search, int32_t *fou
|
|||||||
{
|
{
|
||||||
etk::Vector<int8_t> searchVect;
|
etk::Vector<int8_t> searchVect;
|
||||||
if (true == m_isUtf8) {
|
if (true == m_isUtf8) {
|
||||||
char * tmpPointer = search.c_str();
|
etk::Char tmpChar = search.c_str();
|
||||||
|
const char * tmpPointer = tmpChar;
|
||||||
while (*tmpPointer != '\0') {
|
while (*tmpPointer != '\0') {
|
||||||
searchVect.PushBack(*tmpPointer++);
|
searchVect.PushBack(*tmpPointer++);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
etk::Vector<unsigned int> tmppp = search.GetVector();
|
etk::Vector<etk::UniChar> tmppp = search.GetVector();
|
||||||
convertUnicodeToIso(m_charsetType, tmppp, searchVect);
|
convertUnicodeToIso(m_charsetType, tmppp, searchVect);
|
||||||
}
|
}
|
||||||
// remove the '\0' at the end of the string ...
|
// remove the '\0' at the end of the string ...
|
||||||
@@ -1137,12 +1141,13 @@ int32_t EdnBuf::LocalInsert(int32_t pos, etk::UString &insertText)
|
|||||||
{
|
{
|
||||||
etk::Vector<int8_t> tmpInsertText;
|
etk::Vector<int8_t> tmpInsertText;
|
||||||
if (true == m_isUtf8) {
|
if (true == m_isUtf8) {
|
||||||
char * tmpPointer = insertText.c_str();
|
etk::Char tmpChar = insertText.c_str();
|
||||||
|
const char * tmpPointer = tmpChar;
|
||||||
while (*tmpPointer != '\0') {
|
while (*tmpPointer != '\0') {
|
||||||
tmpInsertText.PushBack(*tmpPointer++);
|
tmpInsertText.PushBack(*tmpPointer++);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
etk::Vector<unsigned int> tmppp = insertText.GetVector();
|
etk::Vector<etk::UniChar> tmppp = insertText.GetVector();
|
||||||
convertUnicodeToIso(m_charsetType, tmppp, tmpInsertText);
|
convertUnicodeToIso(m_charsetType, tmppp, tmpInsertText);
|
||||||
}
|
}
|
||||||
if (tmpInsertText.Size()>0) {
|
if (tmpInsertText.Size()>0) {
|
||||||
|
@@ -65,7 +65,7 @@ class EdnBuf {
|
|||||||
bool DumpIn( etk::FSNode &file);
|
bool DumpIn( etk::FSNode &file);
|
||||||
bool DumpFrom( etk::FSNode &file);
|
bool DumpFrom( etk::FSNode &file);
|
||||||
// replace with operator [] ...
|
// replace with operator [] ...
|
||||||
int8_t operator[] (int32_t);
|
int8_t operator[] (int32_t) const;
|
||||||
int32_t Insert( int32_t pos, etk::Vector<int8_t> &insertText);
|
int32_t Insert( int32_t pos, etk::Vector<int8_t> &insertText);
|
||||||
int32_t Insert( int32_t pos, etk::UString &insertText);
|
int32_t Insert( int32_t pos, etk::UString &insertText);
|
||||||
int32_t Replace( int32_t start, int32_t end, etk::Vector<int8_t> &insertText);
|
int32_t Replace( int32_t start, int32_t end, etk::Vector<int8_t> &insertText);
|
||||||
|
@@ -15,108 +15,35 @@
|
|||||||
#define __class__ "Colorize"
|
#define __class__ "Colorize"
|
||||||
|
|
||||||
|
|
||||||
Colorize::Colorize( etk::UString &newColorName)
|
Colorize::Colorize(const etk::UString &_newColorName) :
|
||||||
|
m_colorName(_newColorName),
|
||||||
|
m_colorFG(etk::color::black),
|
||||||
|
m_colorBG(etk::color::none),
|
||||||
|
m_italic(false),
|
||||||
|
m_bold(false)
|
||||||
{
|
{
|
||||||
|
|
||||||
m_colorFG = draw::color::black;
|
|
||||||
m_colorBG = draw::color::none;
|
|
||||||
|
|
||||||
italic = false;
|
|
||||||
bold = false;
|
|
||||||
SetName(newColorName);
|
|
||||||
APPL_VERBOSE("New(Colorise)");
|
APPL_VERBOSE("New(Colorise)");
|
||||||
}
|
}
|
||||||
|
|
||||||
Colorize::Colorize(void)
|
void Colorize::SetItalic(bool _enable)
|
||||||
{
|
{
|
||||||
ColorName = "no_name";
|
m_italic = _enable;
|
||||||
|
if (true == _enable) {
|
||||||
m_colorFG = draw::color::black;
|
APPL_VERBOSE("color : \"" << m_colorName << "\" enable italic");
|
||||||
m_colorBG = draw::color::none;
|
|
||||||
|
|
||||||
italic = false;
|
|
||||||
bold = false;
|
|
||||||
|
|
||||||
APPL_VERBOSE("New(Colorise)");
|
|
||||||
}
|
|
||||||
|
|
||||||
Colorize::~Colorize(void)
|
|
||||||
{
|
|
||||||
// nothing to do ...
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Colorize::SetName(const char *newColorName)
|
|
||||||
{
|
|
||||||
APPL_VERBOSE("color change name : \"" << ColorName << "\" ==> \"" << newColorName << "\"");
|
|
||||||
ColorName = newColorName;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Colorize::SetName(etk::UString &newColorName)
|
|
||||||
{
|
|
||||||
APPL_VERBOSE("color change name : \"" << ColorName << "\" ==> \"" << newColorName << "\"");
|
|
||||||
ColorName = newColorName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
etk::UString Colorize::GetName(void)
|
|
||||||
{
|
|
||||||
return ColorName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Colorize::SetFgColor(const char *myColor)
|
|
||||||
{
|
|
||||||
m_colorFG = myColor;
|
|
||||||
APPL_VERBOSE(myColor << " ==> "<< m_colorFG );
|
|
||||||
}
|
|
||||||
|
|
||||||
void Colorize::SetBgColor(const char *myColor)
|
|
||||||
{
|
|
||||||
m_colorBG = myColor;
|
|
||||||
APPL_VERBOSE(myColor << " ==> "<< m_colorBG );
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Colorize::HaveBg(void)
|
|
||||||
{
|
|
||||||
return m_colorBG.a!=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Colorize::SetItalic(bool enable)
|
|
||||||
{
|
|
||||||
italic = enable;
|
|
||||||
if (true == enable) {
|
|
||||||
APPL_VERBOSE("color : \"" << ColorName << "\" enable italic");
|
|
||||||
} else {
|
} else {
|
||||||
APPL_VERBOSE("color : \"" << ColorName << "\" disable italic");
|
APPL_VERBOSE("color : \"" << m_colorName << "\" disable italic");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Colorize::GetItalic(void)
|
void Colorize::SetBold(bool _enable)
|
||||||
{
|
{
|
||||||
return italic;
|
m_bold = _enable;
|
||||||
}
|
if (true == _enable) {
|
||||||
|
APPL_VERBOSE("color : \"" << m_colorName << "\" enable bold");
|
||||||
|
|
||||||
void Colorize::SetBold(bool enable)
|
|
||||||
{
|
|
||||||
bold = enable;
|
|
||||||
if (true == enable) {
|
|
||||||
APPL_VERBOSE("color : \"" << ColorName << "\" enable bold");
|
|
||||||
} else {
|
} else {
|
||||||
APPL_VERBOSE("color : \"" << ColorName << "\" disable bold");
|
APPL_VERBOSE("color : \"" << m_colorName << "\" disable bold");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Colorize::GetBold(void)
|
|
||||||
{
|
|
||||||
return bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -8,42 +8,44 @@
|
|||||||
|
|
||||||
#ifndef __COLORIZE_H__
|
#ifndef __COLORIZE_H__
|
||||||
#define __COLORIZE_H__
|
#define __COLORIZE_H__
|
||||||
#include <draw/Color.h>
|
#include <etk/Color.h>
|
||||||
#include <etk/UString.h>
|
#include <etk/UString.h>
|
||||||
|
|
||||||
class Colorize {
|
class Colorize {
|
||||||
public:
|
public:
|
||||||
// Constructeur
|
// Constructeur
|
||||||
Colorize(void);
|
Colorize(const etk::UString& _newColorName="no_name");
|
||||||
Colorize(etk::UString &newColorName);
|
~Colorize(void) { };
|
||||||
~Colorize(void);
|
|
||||||
|
|
||||||
void SetName(etk::UString &newColorName);
|
|
||||||
void SetName(const char *newColorName);
|
|
||||||
etk::UString GetName(void);
|
|
||||||
void SetFgColor(const char *myColor);
|
|
||||||
void SetBgColor(const char *myColor);
|
|
||||||
|
|
||||||
draw::Color & GetFG(void) { return m_colorFG; };
|
|
||||||
draw::Color & GetBG(void) { return m_colorBG; };
|
|
||||||
|
|
||||||
bool HaveBg(void);
|
|
||||||
|
|
||||||
void SetItalic(bool enable);
|
|
||||||
void SetBold(bool enable);
|
|
||||||
bool GetItalic(void);
|
|
||||||
bool GetBold(void);
|
|
||||||
|
|
||||||
void Display(int32_t i) { APPL_INFO(" " << i << " : \"" << ColorName << "\"" << " fg="<< m_colorFG); };
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
etk::UString ColorName; //!< curent color Name
|
etk::UString m_colorName; //!< curent color Name
|
||||||
draw::Color m_colorFG;
|
public:
|
||||||
draw::Color m_colorBG;
|
void SetName(const etk::UString& _newColorName) { m_colorName = _newColorName; };
|
||||||
|
const etk::UString& GetName(void) { return m_colorName; };
|
||||||
bool italic;
|
|
||||||
bool bold;
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
etk::Color<> m_colorFG;
|
||||||
|
public:
|
||||||
|
void SetFgColor(const etk::UString& _myColor) { m_colorFG=_myColor; };
|
||||||
|
const etk::Color<>& GetFG(void) { return m_colorFG; };
|
||||||
|
bool HaveFg(void) { return m_colorFG.a()!=0; };
|
||||||
|
private:
|
||||||
|
etk::Color<> m_colorBG;
|
||||||
|
public:
|
||||||
|
void SetBgColor(const etk::UString& _myColor) { m_colorBG=_myColor; };
|
||||||
|
const etk::Color<>& GetBG(void) { return m_colorBG; };
|
||||||
|
bool HaveBg(void) { return m_colorBG.a()!=0; };
|
||||||
|
private:
|
||||||
|
bool m_italic;
|
||||||
|
public:
|
||||||
|
void SetItalic(bool _enable);
|
||||||
|
bool GetItalic(void) { return m_italic; };
|
||||||
|
private:
|
||||||
|
bool m_bold;
|
||||||
|
public:
|
||||||
|
void SetBold(bool _enable);
|
||||||
|
bool GetBold(void) { return m_bold; };
|
||||||
|
void Display(int32_t _i) { APPL_INFO(" " << _i << " : fg="<< m_colorFG << " bold=" << m_italic << " bold=" << m_italic << "\"" << m_colorName << "\""); };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -9,62 +9,28 @@
|
|||||||
#include <appl/Debug.h>
|
#include <appl/Debug.h>
|
||||||
#include <appl/global.h>
|
#include <appl/global.h>
|
||||||
#include <ColorizeManager.h>
|
#include <ColorizeManager.h>
|
||||||
#include <tinyXML/tinyxml.h>
|
#include <exml/exml.h>
|
||||||
#include <ewol/eObject/EObject.h>
|
#include <ewol/renderer/EObject.h>
|
||||||
#include <ewol/eObject/EObjectManager.h>
|
#include <ewol/renderer/EObjectManager.h>
|
||||||
#include <etk/os/FSNode.h>
|
#include <etk/os/FSNode.h>
|
||||||
|
|
||||||
#define PFX "ColorizeManager "
|
#define PFX "ColorizeManager "
|
||||||
|
|
||||||
class classColorManager: public ewol::EObject
|
class classColorManager: public ewol::EObject
|
||||||
{
|
{
|
||||||
public:
|
|
||||||
// Constructeur
|
|
||||||
classColorManager(void);
|
|
||||||
~classColorManager(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Get the current Object type of the EObject
|
|
||||||
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
|
|
||||||
* @param[in] objectType type description
|
|
||||||
* @return true if the object is compatible, otherwise false
|
|
||||||
*/
|
|
||||||
const char * const GetObjectType(void)
|
|
||||||
{
|
|
||||||
return "ApplColorManager";
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
|
||||||
* @param[in] CallerObject Pointer on the EObject that information came from
|
|
||||||
* @param[in] eventId Message registered by this class
|
|
||||||
* @param[in] data Data registered by this class
|
|
||||||
* @return ---
|
|
||||||
*/
|
|
||||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
|
|
||||||
public:
|
|
||||||
void LoadFile(etk::UString &xmlFilename);
|
|
||||||
void LoadFile(const char * xmlFilename);
|
|
||||||
Colorize * Get(const char *colorName);
|
|
||||||
Colorize * Get(etk::UString &colorName);
|
|
||||||
draw::Color& Get(basicColor_te myColor);
|
|
||||||
bool Exist(etk::UString &colorName);
|
|
||||||
bool Exist(const char *colorName);
|
|
||||||
void DisplayListOfColor(void);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
etk::UString m_fileColor;
|
etk::UString m_fileColor;
|
||||||
etk::Vector<Colorize*> listMyColor; //!< List of ALL Color
|
etk::Vector<Colorize*> listMyColor; //!< List of ALL Color
|
||||||
Colorize * errorColor;
|
Colorize * errorColor;
|
||||||
draw::Color basicColors[COLOR_NUMBER_MAX];
|
etk::Color<> basicColors[COLOR_NUMBER_MAX];
|
||||||
};
|
|
||||||
|
|
||||||
|
public:
|
||||||
classColorManager::classColorManager(void)
|
// Constructeur
|
||||||
|
classColorManager(void)
|
||||||
{
|
{
|
||||||
//ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiChangeColor);
|
//ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiChangeColor);
|
||||||
}
|
}
|
||||||
|
~classColorManager(void)
|
||||||
classColorManager::~classColorManager(void)
|
|
||||||
{
|
{
|
||||||
delete(errorColor);
|
delete(errorColor);
|
||||||
|
|
||||||
@@ -80,7 +46,11 @@ classColorManager::~classColorManager(void)
|
|||||||
listMyColor.Clear();
|
listMyColor.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void classColorManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
const char * const GetObjectType(void)
|
||||||
|
{
|
||||||
|
return "Appl::ColorManager";
|
||||||
|
}
|
||||||
|
void OnReceiveMessage(const ewol::EMessage& _msg)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
switch (id)
|
switch (id)
|
||||||
@@ -96,241 +66,39 @@ void classColorManager::OnReceiveMessage(ewol::EObject * CallerObject, const cha
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
public:
|
||||||
|
void LoadFile(const etk::UString& _xmlFilename);
|
||||||
void classColorManager::LoadFile(etk::UString &xmlFilename)
|
Colorize* Get(const etk::UString& _colorName)
|
||||||
{
|
|
||||||
// TODO : Remove this
|
|
||||||
LoadFile(xmlFilename.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO : Remove this ...
|
|
||||||
void classColorManager::LoadFile(const char * xmlFilename)
|
|
||||||
{
|
|
||||||
// Remove all old color :
|
|
||||||
int32_t i;
|
|
||||||
// clean all Element
|
|
||||||
for (i=0; i< listMyColor.Size(); i++) {
|
|
||||||
if (NULL != listMyColor[i]) {
|
|
||||||
delete(listMyColor[i]);
|
|
||||||
listMyColor[i] = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// clear the compleate list
|
|
||||||
listMyColor.Clear();
|
|
||||||
|
|
||||||
m_fileColor = xmlFilename;
|
|
||||||
APPL_DEBUG("open file (COLOR) \"" << xmlFilename << "\" ? = \"" << m_fileColor << "\"");
|
|
||||||
errorColor = new Colorize();
|
|
||||||
errorColor->SetBgColor("#00FF00FF");
|
|
||||||
errorColor->SetFgColor("#FF00FFFF");
|
|
||||||
|
|
||||||
// allocate the document in the stack
|
|
||||||
TiXmlDocument XmlDocument;
|
|
||||||
// open the curent File
|
|
||||||
etk::FSNode fileName(etk::UString("DATA:color/") + xmlFilename + etk::UString(".xml"));
|
|
||||||
if (false == fileName.Exist()) {
|
|
||||||
APPL_ERROR("File Does not exist : " << fileName);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int32_t fileSize = fileName.FileSize();
|
|
||||||
if (0==fileSize) {
|
|
||||||
APPL_ERROR("This file is empty : " << fileName);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (false == fileName.FileOpenRead()) {
|
|
||||||
APPL_ERROR("Can not open the file : " << fileName);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// allocate data
|
|
||||||
char * fileBuffer = new char[fileSize+5];
|
|
||||||
if (NULL == fileBuffer) {
|
|
||||||
APPL_ERROR("Error Memory allocation size=" << fileSize);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
|
|
||||||
// load data from the file :
|
|
||||||
fileName.FileRead(fileBuffer, 1, fileSize);
|
|
||||||
// close the file:
|
|
||||||
fileName.FileClose();
|
|
||||||
// load the XML from the memory
|
|
||||||
XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8);
|
|
||||||
|
|
||||||
TiXmlElement* root = XmlDocument.FirstChildElement( "EdnColor" );
|
|
||||||
if (NULL == root ) {
|
|
||||||
APPL_ERROR(PFX"(l ?) main node not find: \"EdnColor\" in \"" << xmlFilename << "\"");
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
TiXmlNode * pNode = root->FirstChild();
|
|
||||||
while(NULL != pNode) {
|
|
||||||
if (pNode->Type()==TiXmlNode::TINYXML_COMMENT) {
|
|
||||||
// nothing to do, just proceed to next step
|
|
||||||
} else if (!strcmp(pNode->Value(), "gui")) {
|
|
||||||
TiXmlNode * pGuiNode = pNode->FirstChild();
|
|
||||||
while(NULL != pGuiNode) {
|
|
||||||
if (pGuiNode->Type()==TiXmlNode::TINYXML_COMMENT) {
|
|
||||||
// nothing to do, just proceed to next step
|
|
||||||
} else if (!strcmp(pGuiNode->Value(), "color")) {
|
|
||||||
//--------------------------------------------------------------------------------------------
|
|
||||||
//<color name="basicBackground" val="#000000"/>
|
|
||||||
//--------------------------------------------------------------------------------------------
|
|
||||||
const char *colorName = pGuiNode->ToElement()->Attribute("name");
|
|
||||||
int32_t id = 0;
|
|
||||||
if (NULL == colorName) {
|
|
||||||
APPL_ERROR("(l "<< pGuiNode->Row() <<") node with no name");
|
|
||||||
// get next node element
|
|
||||||
pGuiNode = pGuiNode->NextSibling();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!strcmp(colorName, "CODE_space")) {
|
|
||||||
id = COLOR_CODE_SPACE;
|
|
||||||
} else if (!strcmp(colorName, "CODE_tabulation")) {
|
|
||||||
id = COLOR_CODE_TAB;
|
|
||||||
} else if (!strcmp(colorName, "CODE_basicBackgroung")) {
|
|
||||||
id = COLOR_CODE_BASIC_BG;
|
|
||||||
} else if (!strcmp(colorName, "CODE_cursor")) {
|
|
||||||
id = COLOR_CODE_CURSOR;
|
|
||||||
} else if (!strcmp(colorName, "CODE_lineNumber")) {
|
|
||||||
id = COLOR_CODE_LINE_NUMBER;
|
|
||||||
} else if (!strcmp(colorName, "LIST_backgroung1")) {
|
|
||||||
id = COLOR_LIST_BG_1;
|
|
||||||
} else if (!strcmp(colorName, "LIST_backgroung2")) {
|
|
||||||
id = COLOR_LIST_BG_2;
|
|
||||||
} else if (!strcmp(colorName, "LIST_backgroungSelected")) {
|
|
||||||
id = COLOR_LIST_BG_SELECTED;
|
|
||||||
} else if (!strcmp(colorName, "LIST_textNormal")) {
|
|
||||||
id = COLOR_LIST_TEXT_NORMAL;
|
|
||||||
} else if (!strcmp(colorName, "LIST_textModify")) {
|
|
||||||
id = COLOR_LIST_TEXT_MODIFY;
|
|
||||||
} else {
|
|
||||||
APPL_ERROR("(l "<<pGuiNode->Row()<<") Unknown basic gui color : \"" << colorName << "\"" );
|
|
||||||
// get next node element
|
|
||||||
pGuiNode = pGuiNode->NextSibling();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
const char *color = pGuiNode->ToElement()->Attribute("val");
|
|
||||||
if (NULL != color) {
|
|
||||||
basicColors[id] = color;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
APPL_ERROR("(l "<<pGuiNode->Row()<<") node not suported : \""<<pGuiNode->Value()<<"\" must be [color]");
|
|
||||||
}
|
|
||||||
// get next node element
|
|
||||||
pGuiNode = pGuiNode->NextSibling();
|
|
||||||
}
|
|
||||||
} else if (!strcmp(pNode->Value(), "syntax")) {
|
|
||||||
TiXmlNode * pGuiNode = pNode->FirstChild();
|
|
||||||
while(NULL != pGuiNode)
|
|
||||||
{
|
|
||||||
if (pGuiNode->Type()==TiXmlNode::TINYXML_COMMENT) {
|
|
||||||
// nothing to do, just proceed to next step
|
|
||||||
} else if (!strcmp(pGuiNode->Value(), "color")) {
|
|
||||||
Colorize *myNewColor = new Colorize();
|
|
||||||
//--------------------------------------------------------------------------------------------
|
|
||||||
//<color name="basicBackground" FG="#000000" BG="#000000" bold="no" italic="no"/>
|
|
||||||
//--------------------------------------------------------------------------------------------
|
|
||||||
// get the name of the Chaine
|
|
||||||
const char *colorName = pGuiNode->ToElement()->Attribute("name");
|
|
||||||
if (NULL == colorName) {
|
|
||||||
APPL_ERROR(PFX"(l "<< pGuiNode->Row() <<") node with no name");
|
|
||||||
// get next node element
|
|
||||||
pGuiNode = pGuiNode->NextSibling();
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
myNewColor->SetName(colorName);
|
|
||||||
//APPL_INFO(PFX"Add a new color in the panel : \"%s\"", colorName);
|
|
||||||
}
|
|
||||||
const char *colorBG = pGuiNode->ToElement()->Attribute("BG");
|
|
||||||
if (NULL != colorBG) {
|
|
||||||
myNewColor->SetBgColor(colorBG);
|
|
||||||
}
|
|
||||||
const char *colorFG = pGuiNode->ToElement()->Attribute("FG");
|
|
||||||
if (NULL != colorFG) {
|
|
||||||
myNewColor->SetFgColor(colorFG);
|
|
||||||
}
|
|
||||||
const char *bold = pGuiNode->ToElement()->Attribute("bold");
|
|
||||||
if (NULL != bold) {
|
|
||||||
if(0 == strcmp(bold, "yes") ) {
|
|
||||||
myNewColor->SetBold(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const char *italic = pGuiNode->ToElement()->Attribute("italic");
|
|
||||||
if (NULL != italic) {
|
|
||||||
if(0 == strcmp(italic, "yes") ) {
|
|
||||||
myNewColor->SetItalic(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
listMyColor.PushBack(myNewColor);
|
|
||||||
} else {
|
|
||||||
APPL_ERROR(PFX"(l "<<pNode->Row()<<") node not suported : \""<<pNode->Value()<<"\" must be [color]");
|
|
||||||
}
|
|
||||||
pGuiNode = pGuiNode->NextSibling();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
APPL_ERROR(PFX"(l "<<pNode->Row()<<") node not suported : \""<<pNode->Value()<<"\" must be [gui,syntax]");
|
|
||||||
}
|
|
||||||
// get next node element
|
|
||||||
pNode = pNode->NextSibling();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (NULL != fileBuffer) {
|
|
||||||
delete[] fileBuffer;
|
|
||||||
}
|
|
||||||
//SendMessage(APPL_MSG__COLOR_HAS_CHANGE);
|
|
||||||
//SendMessage(APPL_MSG__USER_DISPLAY_CHANGE);
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO : Remove this ...
|
|
||||||
Colorize *classColorManager::Get(const char *colorName)
|
|
||||||
{
|
{
|
||||||
int32_t i;
|
int32_t i;
|
||||||
for (i=0; i<listMyColor.Size(); i++) {
|
for (i=0; i<listMyColor.Size(); i++) {
|
||||||
etk::UString elementName = listMyColor[i]->GetName();
|
if (listMyColor[i]->GetName() == _colorName) {
|
||||||
if (elementName == colorName) {
|
|
||||||
return listMyColor[i];
|
return listMyColor[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
APPL_ERROR(PFX"Color does not Existed ["<< colorName<<"]" );
|
APPL_ERROR(PFX"Color does not Existed ["<< _colorName<<"]" );
|
||||||
// an error
|
// an error
|
||||||
return errorColor;
|
return errorColor;
|
||||||
}
|
}
|
||||||
|
etk::Color<>& Get(basicColor_te _myColor)
|
||||||
Colorize *classColorManager::Get(etk::UString &colorName)
|
|
||||||
{
|
{
|
||||||
// TODO : Remove this
|
if (_myColor < COLOR_NUMBER_MAX) {
|
||||||
return Get(colorName.c_str());
|
return basicColors[_myColor];
|
||||||
}
|
|
||||||
|
|
||||||
draw::Color & classColorManager::Get(basicColor_te myColor)
|
|
||||||
{
|
|
||||||
if (myColor < COLOR_NUMBER_MAX) {
|
|
||||||
return basicColors[myColor];
|
|
||||||
} else {
|
} else {
|
||||||
return basicColors[0];
|
return basicColors[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
bool Exist(const etk::UString& _colorName)
|
||||||
|
|
||||||
// TODO : Remove this ...
|
|
||||||
bool classColorManager::Exist(const char *colorName)
|
|
||||||
{
|
{
|
||||||
int32_t i;
|
int32_t i;
|
||||||
for (i=0; i<listMyColor.Size(); i++) {
|
for (i=0; i<listMyColor.Size(); i++) {
|
||||||
etk::UString elementName = listMyColor[i]->GetName();
|
if (listMyColor[i]->GetName() == _colorName) {
|
||||||
if (elementName == colorName) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
void DisplayListOfColor(void)
|
||||||
bool classColorManager::Exist(etk::UString &colorName)
|
|
||||||
{
|
|
||||||
// TODO : Remove this
|
|
||||||
return Exist(colorName.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
void classColorManager::DisplayListOfColor(void)
|
|
||||||
{
|
{
|
||||||
int32_t i;
|
int32_t i;
|
||||||
APPL_INFO(PFX"List of ALL COLOR : ");
|
APPL_INFO(PFX"List of ALL COLOR : ");
|
||||||
@@ -340,6 +108,145 @@ void classColorManager::DisplayListOfColor(void)
|
|||||||
listMyColor[i]->Display(i);
|
listMyColor[i]->Display(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void classColorManager::LoadFile(const etk::UString& _xmlFilename)
|
||||||
|
{
|
||||||
|
// Remove all old color :
|
||||||
|
for (int32_t iii=0; iii< listMyColor.Size(); iii++) {
|
||||||
|
if (NULL != listMyColor[iii]) {
|
||||||
|
delete(listMyColor[iii]);
|
||||||
|
listMyColor[iii] = 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");
|
||||||
|
|
||||||
|
// open the curent File
|
||||||
|
etk::UString fileName(etk::UString("DATA:color/") + _xmlFilename + etk::UString(".xml"));
|
||||||
|
exml::Document doc;
|
||||||
|
if (doc.Load(fileName)==false) {
|
||||||
|
APPL_ERROR(" can not load file XML : " << fileName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
exml::Element* root = (exml::Element*)doc.GetNamed("EdnColor");
|
||||||
|
if (NULL == root ) {
|
||||||
|
APPL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} (l ?) main node not find: \"EdnColor\" ...");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// parse all the elements :
|
||||||
|
for(int32_t iii=0; iii< root->Size(); iii++) {
|
||||||
|
exml::Element* pNode = root->GetElement(iii);
|
||||||
|
if (pNode==NULL) {
|
||||||
|
// trash here all that is not element.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (pNode->GetValue()=="gui") {
|
||||||
|
for(int32_t iii=0; iii< pNode->Size(); iii++) {
|
||||||
|
exml::Element* pGuiNode = pNode->GetElement(iii);
|
||||||
|
if (pGuiNode==NULL) {
|
||||||
|
// trash here all that is not element.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (pGuiNode->GetValue()!="color") {
|
||||||
|
APPL_ERROR("(l "<<pGuiNode->GetPos()<<") node not suported : \""<<pGuiNode->GetValue()<<"\" must be [color]");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//--------------------------------------------------------------------------------------------
|
||||||
|
//<color name="basicBackground" val="#000000"/>
|
||||||
|
//--------------------------------------------------------------------------------------------
|
||||||
|
etk::UString colorName = pGuiNode->GetAttribute("name");
|
||||||
|
if (colorName.Size()==0) {
|
||||||
|
APPL_ERROR("(l "<< pGuiNode->GetPos() <<") node with no name");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
int32_t id = 0;
|
||||||
|
if (colorName=="CODE_space") {
|
||||||
|
id = COLOR_CODE_SPACE;
|
||||||
|
} else if (colorName=="CODE_tabulation") {
|
||||||
|
id = COLOR_CODE_TAB;
|
||||||
|
} else if (colorName=="CODE_basicBackgroung") {
|
||||||
|
id = COLOR_CODE_BASIC_BG;
|
||||||
|
} else if (colorName=="CODE_cursor") {
|
||||||
|
id = COLOR_CODE_CURSOR;
|
||||||
|
} else if (colorName=="CODE_lineNumber") {
|
||||||
|
id = COLOR_CODE_LINE_NUMBER;
|
||||||
|
} else if (colorName=="LIST_backgroung1") {
|
||||||
|
id = COLOR_LIST_BG_1;
|
||||||
|
} else if (colorName=="LIST_backgroung2") {
|
||||||
|
id = COLOR_LIST_BG_2;
|
||||||
|
} else if (colorName=="LIST_backgroungSelected") {
|
||||||
|
id = COLOR_LIST_BG_SELECTED;
|
||||||
|
} else if (colorName=="LIST_textNormal") {
|
||||||
|
id = COLOR_LIST_TEXT_NORMAL;
|
||||||
|
} else if (colorName=="LIST_textModify") {
|
||||||
|
id = COLOR_LIST_TEXT_MODIFY;
|
||||||
|
} else {
|
||||||
|
APPL_ERROR("(l "<<pGuiNode->GetPos()<<") Unknown basic gui color : \"" << colorName << "\"" );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
etk::UString color = pGuiNode->GetAttribute("val");
|
||||||
|
if (color.Size()!=0) {
|
||||||
|
basicColors[id] = color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (pNode->GetValue()=="syntax") {
|
||||||
|
for(int32_t iii=0; iii< pNode->Size(); iii++) {
|
||||||
|
exml::Element* pGuiNode = pNode->GetElement(iii);
|
||||||
|
if (pGuiNode==NULL) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (pGuiNode->GetValue()!="color") {
|
||||||
|
APPL_ERROR(PFX"(l "<<pGuiNode->GetPos()<<") node not suported : \""<<pGuiNode->GetValue()<<"\" must be [color]");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//--------------------------------------------------------------------------------------------
|
||||||
|
//<color name="basicBackground" FG="#000000" BG="#000000" bold="no" italic="no"/>
|
||||||
|
//--------------------------------------------------------------------------------------------
|
||||||
|
// get the name of the Chaine
|
||||||
|
etk::UString colorName = pGuiNode->GetAttribute("name");
|
||||||
|
if (colorName.Size()==0) {
|
||||||
|
APPL_ERROR(PFX"(l "<< pGuiNode->GetPos() <<") node with no name");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Colorize* myNewColor = new Colorize();
|
||||||
|
if (NULL==myNewColor) {
|
||||||
|
APPL_ERROR(PFX"(l "<< pGuiNode->GetPos() <<") ==> allocation error");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
myNewColor->SetName(colorName);
|
||||||
|
etk::UString colorBG = pGuiNode->GetAttribute("BG");
|
||||||
|
if (colorBG.Size()!=0) {
|
||||||
|
myNewColor->SetBgColor(colorBG);
|
||||||
|
}
|
||||||
|
etk::UString colorFG = pGuiNode->GetAttribute("FG");
|
||||||
|
if (colorFG.Size()!=0) {
|
||||||
|
myNewColor->SetFgColor(colorFG);
|
||||||
|
}
|
||||||
|
etk::UString bold = pGuiNode->GetAttribute("bold");
|
||||||
|
if (bold.Size()!=0) {
|
||||||
|
myNewColor->SetBold(bold.ToBool());
|
||||||
|
}
|
||||||
|
etk::UString italic = pGuiNode->GetAttribute("italic");
|
||||||
|
if (italic.Size()!=0) {
|
||||||
|
myNewColor->SetItalic(italic.ToBool());
|
||||||
|
}
|
||||||
|
listMyColor.PushBack(myNewColor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//SendMessage(APPL_MSG__COLOR_HAS_CHANGE);
|
||||||
|
//SendMessage(APPL_MSG__USER_DISPLAY_CHANGE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -369,63 +276,38 @@ void ColorizeManager::UnInit(void)
|
|||||||
localManager = NULL;
|
localManager = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorizeManager::LoadFile(etk::UString &xmlFilename)
|
void ColorizeManager::LoadFile(const etk::UString& _xmlFilename)
|
||||||
{
|
{
|
||||||
if (NULL == localManager) {
|
if (NULL == localManager) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
localManager->LoadFile(xmlFilename);
|
localManager->LoadFile(_xmlFilename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Colorize* ColorizeManager::Get(const etk::UString& _colorName)
|
||||||
void ColorizeManager::LoadFile(const char * xmlFilename)
|
|
||||||
{
|
|
||||||
if (NULL == localManager) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
localManager->LoadFile(xmlFilename);
|
|
||||||
}
|
|
||||||
|
|
||||||
Colorize* ColorizeManager::Get(const char *colorName)
|
|
||||||
{
|
{
|
||||||
if (NULL == localManager) {
|
if (NULL == localManager) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return localManager->Get(colorName);
|
return localManager->Get(_colorName);
|
||||||
}
|
}
|
||||||
|
|
||||||
Colorize* ColorizeManager::Get(etk::UString &colorName)
|
|
||||||
{
|
etk::Color<>& ColorizeManager::Get(basicColor_te _myColor)
|
||||||
if (NULL == localManager) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
return localManager->Get(colorName);
|
|
||||||
}
|
|
||||||
|
|
||||||
draw::Color errorColor;
|
|
||||||
|
|
||||||
draw::Color& ColorizeManager::Get(basicColor_te myColor)
|
|
||||||
{
|
{
|
||||||
|
static etk::Color<> errorColor;
|
||||||
if (NULL == localManager) {
|
if (NULL == localManager) {
|
||||||
return errorColor;
|
return errorColor;
|
||||||
}
|
}
|
||||||
return localManager->Get(myColor);
|
return localManager->Get(_myColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ColorizeManager::Exist(etk::UString &colorName)
|
bool ColorizeManager::Exist(const etk::UString& _colorName)
|
||||||
{
|
{
|
||||||
if (NULL == localManager) {
|
if (NULL == localManager) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return localManager->Exist(colorName);
|
return localManager->Exist(_colorName);
|
||||||
}
|
|
||||||
|
|
||||||
bool ColorizeManager::Exist(const char *colorName)
|
|
||||||
{
|
|
||||||
if (NULL == localManager) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return localManager->Exist(colorName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorizeManager::DisplayListOfColor(void)
|
void ColorizeManager::DisplayListOfColor(void)
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
#include <Colorize.h>
|
#include <Colorize.h>
|
||||||
#include <appl/globalMsg.h>
|
#include <appl/globalMsg.h>
|
||||||
#include <draw/Color.h>
|
#include <etk/Color.h>
|
||||||
#include <ewol/widget/Widget.h>
|
#include <ewol/widget/Widget.h>
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@@ -37,13 +37,10 @@ namespace ColorizeManager
|
|||||||
{
|
{
|
||||||
void Init(void);
|
void Init(void);
|
||||||
void UnInit(void);
|
void UnInit(void);
|
||||||
void LoadFile(etk::UString &xmlFilename);
|
void LoadFile(const etk::UString& _xmlFilename);
|
||||||
void LoadFile(const char * xmlFilename);
|
Colorize * Get(const etk::UString& _colorName);
|
||||||
Colorize * Get(const char *colorName);
|
etk::Color<>& Get(basicColor_te _myColor);
|
||||||
Colorize * Get(etk::UString &colorName);
|
bool Exist(const etk::UString& _colorName);
|
||||||
draw::Color& Get(basicColor_te myColor);
|
|
||||||
bool Exist(etk::UString &colorName);
|
|
||||||
bool Exist(const char *colorName);
|
|
||||||
void DisplayListOfColor(void);
|
void DisplayListOfColor(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
#include <BufferManager.h>
|
#include <BufferManager.h>
|
||||||
#include <ColorizeManager.h>
|
#include <ColorizeManager.h>
|
||||||
#include <MainWindows.h>
|
#include <MainWindows.h>
|
||||||
#include <ewol/eObject/EObject.h>
|
#include <ewol/renderer/EObject.h>
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "BufferView"
|
#define __class__ "BufferView"
|
||||||
@@ -68,17 +68,10 @@ void BufferView::RemoveAllElement(void)
|
|||||||
m_list.Clear();
|
m_list.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
void BufferView::OnReceiveMessage(const ewol::EMessage& _msg)
|
||||||
* @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)
|
|
||||||
{
|
{
|
||||||
widget::List::OnReceiveMessage(CallerObject, eventId, data);
|
widget::List::OnReceiveMessage(_msg);
|
||||||
if (eventId == ednMsgBufferListChange) {
|
if (_msg.GetMessage() == ednMsgBufferListChange) {
|
||||||
// clean The list
|
// clean The list
|
||||||
RemoveAllElement();
|
RemoveAllElement();
|
||||||
// Get all the buffer name and properties:
|
// Get all the buffer name and properties:
|
||||||
@@ -102,10 +95,10 @@ void BufferView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eve
|
|||||||
SortElementList(m_list);
|
SortElementList(m_list);
|
||||||
}
|
}
|
||||||
MarkToRedraw();
|
MarkToRedraw();
|
||||||
}else if (eventId == ednMsgBufferId) {
|
}else if (_msg.GetMessage() == ednMsgBufferId) {
|
||||||
m_selectedIdRequested = BufferManager::GetSelected();
|
m_selectedIdRequested = BufferManager::GetSelected();
|
||||||
MarkToRedraw();
|
MarkToRedraw();
|
||||||
}else if (eventId == ednMsgBufferState) {
|
}else if (_msg.GetMessage() == ednMsgBufferState) {
|
||||||
// Update list of modify section ...
|
// Update list of modify section ...
|
||||||
for (int32_t iii=0; iii<m_list.Size(); iii++) {
|
for (int32_t iii=0; iii<m_list.Size(); iii++) {
|
||||||
if (NULL!=m_list[iii]) {
|
if (NULL!=m_list[iii]) {
|
||||||
@@ -117,7 +110,7 @@ void BufferView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eve
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
draw::Color BufferView::GetBasicBG(void)
|
etk::Color<> BufferView::GetBasicBG(void)
|
||||||
{
|
{
|
||||||
return ColorizeManager::Get(COLOR_LIST_BG_1);
|
return ColorizeManager::Get(COLOR_LIST_BG_1);
|
||||||
}
|
}
|
||||||
@@ -127,7 +120,7 @@ uint32_t BufferView::GetNuberOfColomn(void)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BufferView::GetTitle(int32_t colomn, etk::UString &myTitle, draw::Color &fg, draw::Color &bg)
|
bool BufferView::GetTitle(int32_t colomn, etk::UString &myTitle, etk::Color<> &fg, etk::Color<> &bg)
|
||||||
{
|
{
|
||||||
myTitle = "Buffers : ";
|
myTitle = "Buffers : ";
|
||||||
return true;
|
return true;
|
||||||
@@ -138,7 +131,7 @@ uint32_t BufferView::GetNuberOfRaw(void)
|
|||||||
return m_list.Size();
|
return m_list.Size();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg)
|
bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color<> &fg, etk::Color<> &bg)
|
||||||
{
|
{
|
||||||
bool isModify;
|
bool isModify;
|
||||||
basicColor_te selectFG = COLOR_LIST_TEXT_NORMAL;
|
basicColor_te selectFG = COLOR_LIST_TEXT_NORMAL;
|
||||||
@@ -167,6 +160,8 @@ bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToW
|
|||||||
m_selectedID = raw;
|
m_selectedID = raw;
|
||||||
// stop searching
|
// stop searching
|
||||||
m_selectedIdRequested = -1;
|
m_selectedIdRequested = -1;
|
||||||
|
// set the raw visible :
|
||||||
|
SetRawVisible(m_selectedID);
|
||||||
}
|
}
|
||||||
if (m_selectedID == raw) {
|
if (m_selectedID == raw) {
|
||||||
selectBG = COLOR_LIST_BG_SELECTED;
|
selectBG = COLOR_LIST_BG_SELECTED;
|
||||||
@@ -186,7 +181,7 @@ bool BufferView::OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEven
|
|||||||
if( raw>=0
|
if( raw>=0
|
||||||
&& raw<m_list.Size()
|
&& raw<m_list.Size()
|
||||||
&& NULL != m_list[raw]) {
|
&& NULL != m_list[raw]) {
|
||||||
m_selectedID = raw;
|
m_selectedIdRequested = m_list[raw]->m_bufferID;
|
||||||
SendMultiCast(ednMsgBufferId, m_list[raw]->m_bufferID);
|
SendMultiCast(ednMsgBufferId, m_list[raw]->m_bufferID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
#include <BufferManager.h>
|
#include <BufferManager.h>
|
||||||
#include <appl/globalMsg.h>
|
#include <appl/globalMsg.h>
|
||||||
#include <ewol/widget/List.h>
|
#include <ewol/widget/List.h>
|
||||||
|
#include <ewol/widget/Windows.h>
|
||||||
|
|
||||||
namespace appl
|
namespace appl
|
||||||
{
|
{
|
||||||
@@ -47,21 +48,17 @@ class BufferView : public widget::List
|
|||||||
// Derived function
|
// Derived function
|
||||||
const char * const GetObjectType(void) { return "ApplBufferView"; };
|
const char * const GetObjectType(void) { return "ApplBufferView"; };
|
||||||
// Derived function
|
// Derived function
|
||||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
|
virtual void OnReceiveMessage(const ewol::EMessage& _msg);
|
||||||
protected:
|
protected:
|
||||||
// function call to display the list :
|
// function call to display the list :
|
||||||
virtual draw::Color GetBasicBG(void);
|
virtual etk::Color<> GetBasicBG(void);
|
||||||
|
void RemoveAllElement(void);
|
||||||
// Derived function
|
// Derived function
|
||||||
virtual uint32_t GetNuberOfColomn(void);
|
virtual uint32_t GetNuberOfColomn(void);
|
||||||
// Derived function
|
virtual bool GetTitle(int32_t colomn, etk::UString &myTitle, etk::Color<> &fg, etk::Color<> &bg);
|
||||||
virtual bool GetTitle(int32_t colomn, etk::UString &myTitle, draw::Color &fg, draw::Color &bg);
|
|
||||||
// Derived function
|
|
||||||
virtual uint32_t GetNuberOfRaw(void);
|
virtual uint32_t GetNuberOfRaw(void);
|
||||||
// Derived function
|
virtual bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color<> &fg, etk::Color<> &bg);
|
||||||
virtual bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg);
|
|
||||||
// Derived function
|
|
||||||
virtual bool OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEvent, int32_t colomn, int32_t raw, float x, float y);
|
virtual bool OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEvent, int32_t colomn, int32_t raw, float x, float y);
|
||||||
void RemoveAllElement(void);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
#include <SearchData.h>
|
#include <SearchData.h>
|
||||||
|
|
||||||
#include <ewol/widget/WidgetManager.h>
|
#include <ewol/widget/WidgetManager.h>
|
||||||
#include <ewol/eObject/EObject.h>
|
#include <ewol/renderer/EObject.h>
|
||||||
|
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
@@ -32,10 +32,10 @@ void CodeView::Init(void)
|
|||||||
|
|
||||||
m_lineNumberList.Clear();
|
m_lineNumberList.Clear();
|
||||||
|
|
||||||
m_textColorFg = draw::color::black;
|
m_textColorFg = etk::color::black;
|
||||||
|
|
||||||
m_textColorBg = draw::color::black;
|
m_textColorBg = etk::color::black;
|
||||||
m_textColorBg.a = 0x40;
|
m_textColorBg.SetA(0x40);
|
||||||
SetCanHaveFocus(true);
|
SetCanHaveFocus(true);
|
||||||
RegisterMultiCast(ednMsgBufferId);
|
RegisterMultiCast(ednMsgBufferId);
|
||||||
RegisterMultiCast(ednMsgGuiCopy);
|
RegisterMultiCast(ednMsgGuiCopy);
|
||||||
@@ -80,7 +80,6 @@ CodeView::~CodeView(void)
|
|||||||
/**
|
/**
|
||||||
* @brief Check if the number of reference buffer is good or not ...
|
* @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
|
* @param[in] bufferID id of the current Buffer that needed to have a reference
|
||||||
* @return ---
|
|
||||||
*/
|
*/
|
||||||
void CodeView::UpdateNumberOfLineReference(int32_t bufferID)
|
void CodeView::UpdateNumberOfLineReference(int32_t bufferID)
|
||||||
{
|
{
|
||||||
@@ -104,7 +103,7 @@ bool CodeView::CalculateMinSize(void)
|
|||||||
void CodeView::CalculateMaxSize(void)
|
void CodeView::CalculateMaxSize(void)
|
||||||
{
|
{
|
||||||
m_maxSize.setX(2048);
|
m_maxSize.setX(2048);
|
||||||
int32_t letterHeight = m_displayText.CalculateSize('A').y();
|
int32_t letterHeight = m_displayText.CalculateSize(etk::UniChar('A')).y();
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
m_maxSize.setY(tmpBuffer->GetNumberOfLine() * letterHeight);
|
m_maxSize.setY(tmpBuffer->GetNumberOfLine() * letterHeight);
|
||||||
@@ -114,11 +113,11 @@ void CodeView::CalculateMaxSize(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CodeView::OnDraw(ewol::DrawProperty& displayProp)
|
void CodeView::OnDraw(void)
|
||||||
{
|
{
|
||||||
m_displayDrawing.Draw();
|
m_displayDrawing.Draw();
|
||||||
m_displayText.Draw();
|
m_displayText.Draw();
|
||||||
WidgetScrooled::OnDraw(displayProp);
|
WidgetScrooled::OnDraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeView::OnRegenerateDisplay(void)
|
void CodeView::OnRegenerateDisplay(void)
|
||||||
@@ -188,67 +187,51 @@ void CodeView::OnRegenerateDisplay(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool CodeView::OnEventKb(ewol::keyEvent::status_te typeEvent, uniChar_t unicodeData)
|
bool CodeView::OnEventEntry(const ewol::EventEntry& _event)
|
||||||
{
|
{
|
||||||
|
if (_event.GetType() == ewol::keyEvent::keyboardChar) {
|
||||||
//APPL_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent);
|
//APPL_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent);
|
||||||
if (typeEvent == ewol::keyEvent::statusDown) {
|
if (_event.GetStatus() == ewol::keyEvent::statusDown) {
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->AddChar(unicodeData);
|
tmpBuffer->AddChar(_event.GetChar());
|
||||||
|
}
|
||||||
|
MarkToRedraw();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// move events ...
|
||||||
|
if (_event.GetStatus() == ewol::keyEvent::statusDown) {
|
||||||
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
|
if (NULL!=tmpBuffer) {
|
||||||
|
tmpBuffer->cursorMove(_event.GetType());
|
||||||
}
|
}
|
||||||
MarkToRedraw();
|
MarkToRedraw();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CodeView::OnEventClipboard(ewol::clipBoard::clipboardListe_te _clipboardID)
|
||||||
bool CodeView::OnEventKbMove(ewol::keyEvent::status_te typeEvent, ewol::keyEvent::keyboard_te moveTypeEvent)
|
|
||||||
{
|
|
||||||
if (typeEvent == ewol::keyEvent::statusDown) {
|
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
|
||||||
if (NULL!=tmpBuffer) {
|
|
||||||
tmpBuffer->cursorMove(moveTypeEvent);
|
|
||||||
}
|
|
||||||
MarkToRedraw();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Event on a past event ==> this event is asynchronous due to all system does not support direct getting datas
|
|
||||||
* @note : need to have focus ...
|
|
||||||
* @param[in] mode Mode of data requested
|
|
||||||
* @return ---
|
|
||||||
*/
|
|
||||||
void CodeView::OnEventClipboard(ewol::clipBoard::clipboardListe_te clipboardID)
|
|
||||||
{
|
{
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->Paste(clipboardID);
|
tmpBuffer->Paste(_clipboardID);
|
||||||
}
|
}
|
||||||
MarkToRedraw();
|
MarkToRedraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
bool CodeView::OnEventInput(const ewol::EventInput& _event)
|
||||||
* @brief Event on an input of this Widget
|
|
||||||
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
|
|
||||||
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
|
|
||||||
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
|
|
||||||
* @param[in] pos Absolute position of the event
|
|
||||||
* @return true the event is used
|
|
||||||
* @return false the event is not used
|
|
||||||
*/
|
|
||||||
bool CodeView::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
|
|
||||||
{
|
{
|
||||||
vec2 relativePos = RelativePosition(pos);
|
vec2 relativePos = RelativePosition(_event.GetPos());
|
||||||
|
//APPL_DEBUG("Event at pos : " << _event.GetPos() << " ==> " << relativePos );
|
||||||
// corection for the openGl abstraction
|
// corection for the openGl abstraction
|
||||||
//relativePos.y = m_size.y - relativePos.y;
|
//relativePos.y = m_size.y - relativePos.y;
|
||||||
|
|
||||||
vec2 limitedPos = relativePos;
|
vec2 limitedPos = relativePos;
|
||||||
limitedPos.setValue(etk_avg(1, limitedPos.x(), m_size.x()-1),
|
limitedPos.setValue(etk_avg(1, limitedPos.x(), m_size.x()-1),
|
||||||
etk_avg(1, limitedPos.y(), m_size.y()-1));
|
etk_avg(1, limitedPos.y(), m_size.y()-1));
|
||||||
if (true == WidgetScrooled::OnEventInput(type, IdInput, typeEvent, pos)) {
|
if (true == WidgetScrooled::OnEventInput(_event)) {
|
||||||
ewol::widgetManager::FocusKeep(this);
|
KeepFocus();
|
||||||
// nothing to do ... done on upper widget ...
|
// nothing to do ... done on upper widget ...
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -257,50 +240,51 @@ bool CodeView::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (1 == IdInput) {
|
if (1 == _event.GetId()) {
|
||||||
#ifndef __MODE__Touch
|
|
||||||
if (ewol::keyEvent::statusDown == typeEvent) {
|
if (ewol::keyEvent::typeMouse == _event.GetType()) {
|
||||||
|
if (ewol::keyEvent::statusDown == _event.GetStatus()) {
|
||||||
m_buttunOneSelected = true;
|
m_buttunOneSelected = true;
|
||||||
ewol::widgetManager::FocusKeep(this);
|
KeepFocus();
|
||||||
// TODO : Set something good
|
// TODO : Set something good
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->MouseEvent(limitedPos);
|
tmpBuffer->MouseEvent(limitedPos);
|
||||||
}
|
}
|
||||||
MarkToRedraw();
|
MarkToRedraw();
|
||||||
} else if (ewol::keyEvent::statusUp == typeEvent) {
|
} else if (ewol::keyEvent::statusUp == _event.GetStatus()) {
|
||||||
m_buttunOneSelected = false;
|
m_buttunOneSelected = false;
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->Copy(ewol::clipBoard::clipboardSelection);
|
tmpBuffer->Copy(ewol::clipBoard::clipboardSelection);
|
||||||
}
|
}
|
||||||
MarkToRedraw();
|
MarkToRedraw();
|
||||||
} else
|
}
|
||||||
#endif
|
}
|
||||||
if (ewol::keyEvent::statusSingle == typeEvent) {
|
if (ewol::keyEvent::statusSingle == _event.GetStatus()) {
|
||||||
#ifdef __MODE__Touch
|
if (ewol::keyEvent::typeMouse == _event.GetType()) {
|
||||||
ewol::widgetManager::FocusKeep(this);
|
KeepFocus();
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->MouseEvent(limitedPos);
|
tmpBuffer->MouseEvent(limitedPos);
|
||||||
}
|
}
|
||||||
MarkToRedraw();
|
MarkToRedraw();
|
||||||
#else
|
} else {
|
||||||
// nothing to do ...
|
// nothing to do ...
|
||||||
#endif
|
}
|
||||||
} else if (ewol::keyEvent::statusDouble == typeEvent) {
|
} else if (ewol::keyEvent::statusDouble == _event.GetStatus()) {
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->MouseEventDouble();
|
tmpBuffer->MouseEventDouble();
|
||||||
}
|
}
|
||||||
MarkToRedraw();
|
MarkToRedraw();
|
||||||
} else if (ewol::keyEvent::statusTriple == typeEvent) {
|
} else if (ewol::keyEvent::statusTriple == _event.GetStatus()) {
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->MouseEventTriple();
|
tmpBuffer->MouseEventTriple();
|
||||||
}
|
}
|
||||||
MarkToRedraw();
|
MarkToRedraw();
|
||||||
} else if (ewol::keyEvent::statusMove == typeEvent) {
|
} else if (ewol::keyEvent::statusMove == _event.GetStatus()) {
|
||||||
if (true == m_buttunOneSelected) {
|
if (true == m_buttunOneSelected) {
|
||||||
int xxx, yyy;
|
int xxx, yyy;
|
||||||
xxx = relativePos.x();
|
xxx = relativePos.x();
|
||||||
@@ -320,42 +304,33 @@ bool CodeView::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol:
|
|||||||
MarkToRedraw();
|
MarkToRedraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (2 == IdInput) {
|
} else if (2 == _event.GetId()) {
|
||||||
if (ewol::keyEvent::statusSingle == typeEvent) {
|
if (ewol::keyEvent::statusSingle == _event.GetStatus()) {
|
||||||
// TODO : Set something good
|
// TODO : Set something good
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->MouseEvent(limitedPos);
|
tmpBuffer->MouseEvent(limitedPos);
|
||||||
}
|
}
|
||||||
ewol::clipBoard::Request(ewol::clipBoard::clipboardSelection);
|
ewol::clipBoard::Request(ewol::clipBoard::clipboardSelection);
|
||||||
ewol::widgetManager::FocusKeep(this);
|
KeepFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CodeView::OnReceiveMessage(const ewol::EMessage& _msg)
|
||||||
|
|
||||||
/**
|
|
||||||
* @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)
|
|
||||||
{
|
{
|
||||||
widget::WidgetScrooled::OnReceiveMessage(CallerObject, eventId, data);
|
widget::WidgetScrooled::OnReceiveMessage(_msg);
|
||||||
APPL_DEBUG("Extern Event : " << CallerObject << " type : " << eventId << " data=\"" << data << "\"");
|
APPL_DEBUG("Extern Event : " << _msg.GetCaller() << " type : " << _msg.GetMessage() << " data=\"" << _msg.GetData() << "\"");
|
||||||
|
|
||||||
if(eventId == ednMsgBufferId) {
|
if(_msg.GetMessage() == ednMsgBufferId) {
|
||||||
//keep the reference of the display offset :
|
//keep the reference of the display offset :
|
||||||
if( m_bufferID >=0
|
if( m_bufferID >=0
|
||||||
&& m_bufferID < m_lineNumberList.Size()) {
|
&& m_bufferID < m_lineNumberList.Size()) {
|
||||||
m_lineNumberList[m_bufferID] = m_originScrooled;
|
m_lineNumberList[m_bufferID] = m_originScrooled;
|
||||||
}
|
}
|
||||||
int32_t bufferID = 0;
|
int32_t bufferID = 0;
|
||||||
sscanf(data.c_str(), "%d", &bufferID);
|
sscanf(_msg.GetData().c_str(), "%d", &bufferID);
|
||||||
APPL_INFO("Select a new Buffer ... " << bufferID);
|
APPL_INFO("Select a new Buffer ... " << bufferID);
|
||||||
// set the new buffer ID
|
// set the new buffer ID
|
||||||
m_bufferID = bufferID;
|
m_bufferID = bufferID;
|
||||||
@@ -366,105 +341,105 @@ void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * event
|
|||||||
&& m_bufferID < m_lineNumberList.Size()) {
|
&& m_bufferID < m_lineNumberList.Size()) {
|
||||||
m_originScrooled = m_lineNumberList[m_bufferID];
|
m_originScrooled = m_lineNumberList[m_bufferID];
|
||||||
}
|
}
|
||||||
} else if (eventId == ednMsgGuiCopy) {
|
} else if (_msg.GetMessage() == ednMsgGuiCopy) {
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->Copy(ewol::clipBoard::clipboardStd);
|
tmpBuffer->Copy(ewol::clipBoard::clipboardStd);
|
||||||
}
|
}
|
||||||
} else if (eventId == ednMsgGuiCut) {
|
} else if (_msg.GetMessage() == ednMsgGuiCut) {
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->Cut(ewol::clipBoard::clipboardStd);
|
tmpBuffer->Cut(ewol::clipBoard::clipboardStd);
|
||||||
}
|
}
|
||||||
} else if (eventId == ednMsgGuiPaste) {
|
} else if (_msg.GetMessage() == ednMsgGuiPaste) {
|
||||||
ewol::clipBoard::Request(ewol::clipBoard::clipboardStd);
|
ewol::clipBoard::Request(ewol::clipBoard::clipboardStd);
|
||||||
} else if (eventId == ednMsgGuiUndo) {
|
} else if (_msg.GetMessage() == ednMsgGuiUndo) {
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->Undo();
|
tmpBuffer->Undo();
|
||||||
}
|
}
|
||||||
} else if (eventId == ednMsgGuiRedo) {
|
} else if (_msg.GetMessage() == ednMsgGuiRedo) {
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->Redo();
|
tmpBuffer->Redo();
|
||||||
}
|
}
|
||||||
} else if (eventId == ednMsgGuiRm) {
|
} else if (_msg.GetMessage() == ednMsgGuiRm) {
|
||||||
// data : "Word" "Line" "Paragraph"
|
// data : "Word" "Line" "Paragraph"
|
||||||
if (data == "Word") {
|
if (_msg.GetData() == "Word") {
|
||||||
APPL_WARNING(" on event " << eventId << " data=\"" << data << "\" ==> not coded" );
|
APPL_WARNING(" on event " << _msg.GetMessage() << " data=\"" << _msg.GetData() << "\" ==> not coded" );
|
||||||
} else if (data == "Line") {
|
} else if (_msg.GetData() == "Line") {
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->RemoveLine();
|
tmpBuffer->RemoveLine();
|
||||||
}
|
}
|
||||||
} else if (data == "Paragraph") {
|
} else if (_msg.GetData() == "Paragraph") {
|
||||||
APPL_WARNING(" on event " << eventId << " data=\"" << data << "\" ==> not coded" );
|
APPL_WARNING(" on event " << _msg.GetMessage() << " data=\"" << _msg.GetData() << "\" ==> not coded" );
|
||||||
} else {
|
} else {
|
||||||
APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
|
APPL_ERROR(" on event " << _msg.GetMessage() << " unknow data=\"" << _msg.GetData() << "\"" );
|
||||||
}
|
}
|
||||||
} else if (eventId == ednMsgGuiSelect) {
|
} else if (_msg.GetMessage() == ednMsgGuiSelect) {
|
||||||
// data : "ALL" "NONE"
|
// data : "ALL" "NONE"
|
||||||
if (data == "ALL") {
|
if (_msg.GetData() == "ALL") {
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->SelectAll();
|
tmpBuffer->SelectAll();
|
||||||
}
|
}
|
||||||
} else if (data == "NONE") {
|
} else if (_msg.GetData() == "NONE") {
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->SelectNone();
|
tmpBuffer->SelectNone();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
|
APPL_ERROR(" on event " << _msg.GetMessage() << " unknow data=\"" << _msg.GetData() << "\"" );
|
||||||
}
|
}
|
||||||
} else if (eventId == ednMsgGuiChangeCharset) {
|
} else if (_msg.GetMessage() == ednMsgGuiChangeCharset) {
|
||||||
// data : "UTF-8" "ISO-8859-1" "ISO-8859-15"
|
// data : "UTF-8" "ISO-8859-1" "ISO-8859-15"
|
||||||
if (data == "UTF-8") {
|
if (_msg.GetData() == "UTF-8") {
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->SetCharset(unicode::EDN_CHARSET_UTF8);
|
tmpBuffer->SetCharset(unicode::EDN_CHARSET_UTF8);
|
||||||
}
|
}
|
||||||
} else if (data == "ISO-8859-1") {
|
} else if (_msg.GetData() == "ISO-8859-1") {
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->SetCharset(unicode::EDN_CHARSET_ISO_8859_1);
|
tmpBuffer->SetCharset(unicode::EDN_CHARSET_ISO_8859_1);
|
||||||
}
|
}
|
||||||
} else if (data == "ISO-8859-15") {
|
} else if (_msg.GetData() == "ISO-8859-15") {
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->SetCharset(unicode::EDN_CHARSET_ISO_8859_15);
|
tmpBuffer->SetCharset(unicode::EDN_CHARSET_ISO_8859_15);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
|
APPL_ERROR(" on event " << _msg.GetMessage() << " unknow data=\"" << _msg.GetData() << "\"" );
|
||||||
}
|
}
|
||||||
} else if (eventId == ednMsgGuiFind) {
|
} else if (_msg.GetMessage() == ednMsgGuiFind) {
|
||||||
etk::UString myDataString;
|
etk::UString myDataString;
|
||||||
SearchData::GetSearch(myDataString);
|
SearchData::GetSearch(myDataString);
|
||||||
if (data == "Next") {
|
if (_msg.GetData() == "Next") {
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->Search(myDataString, false, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
|
tmpBuffer->Search(myDataString, false, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
|
||||||
}
|
}
|
||||||
} else if (data == "Previous") {
|
} else if (_msg.GetData() == "Previous") {
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
|
tmpBuffer->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (eventId == ednMsgGuiReplace) {
|
} else if (_msg.GetMessage() == ednMsgGuiReplace) {
|
||||||
etk::UString myDataString;
|
etk::UString myDataString;
|
||||||
SearchData::GetReplace(myDataString);
|
SearchData::GetReplace(myDataString);
|
||||||
if (data == "Normal") {
|
if (_msg.GetData() == "Normal") {
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
tmpBuffer->Replace(myDataString);
|
tmpBuffer->Replace(myDataString);
|
||||||
}
|
}
|
||||||
} else if (data == "All") {
|
} else if (_msg.GetData() == "All") {
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if (eventId == ednMsgGuiGotoLine) {
|
} else if (_msg.GetMessage() == ednMsgGuiGotoLine) {
|
||||||
int32_t lineID = 0;
|
int32_t lineID = 0;
|
||||||
sscanf(data.c_str(), "%d", &lineID);
|
sscanf(_msg.GetData().c_str(), "%d", &lineID);
|
||||||
APPL_INFO("Goto line : " << lineID);
|
APPL_INFO("Goto line : " << lineID);
|
||||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||||
if (NULL!=tmpBuffer) {
|
if (NULL!=tmpBuffer) {
|
||||||
@@ -481,14 +456,14 @@ void CodeView::OnGetFocus(void)
|
|||||||
/*
|
/*
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_bufferID);
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_bufferID);
|
||||||
*/
|
*/
|
||||||
ewol::Keyboard(true);
|
ShowKeyboard();
|
||||||
APPL_INFO("Focus - In");
|
APPL_INFO("Focus - In");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CodeView::OnLostFocus(void)
|
void CodeView::OnLostFocus(void)
|
||||||
{
|
{
|
||||||
ewol::Keyboard(false);
|
HideKeyboard();
|
||||||
APPL_INFO("Focus - out");
|
APPL_INFO("Focus - out");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,14 +25,10 @@ class CodeView :public widget::WidgetScrooled
|
|||||||
CodeView(etk::UString fontName, int32_t fontSize);
|
CodeView(etk::UString fontName, int32_t fontSize);
|
||||||
CodeView(void);
|
CodeView(void);
|
||||||
virtual ~CodeView(void);
|
virtual ~CodeView(void);
|
||||||
// Derived function
|
|
||||||
const char * const GetObjectType(void) { return "ApplCodeView"; };
|
|
||||||
// Derived function
|
|
||||||
virtual bool CalculateMinSize(void);
|
|
||||||
private:
|
private:
|
||||||
etk::UString m_label;
|
etk::UString m_label;
|
||||||
draw::Color m_textColorFg; //!< Text color
|
etk::Color<> m_textColorFg; //!< Text color
|
||||||
draw::Color m_textColorBg; //!< Background color
|
etk::Color<> m_textColorBg; //!< Background color
|
||||||
int32_t m_bufferID;
|
int32_t m_bufferID;
|
||||||
bool m_buttunOneSelected;
|
bool m_buttunOneSelected;
|
||||||
etk::Vector<vec2 > m_lineNumberList;
|
etk::Vector<vec2 > m_lineNumberList;
|
||||||
@@ -40,31 +36,23 @@ class CodeView :public widget::WidgetScrooled
|
|||||||
// drawing elements :
|
// drawing elements :
|
||||||
ewol::Text m_displayText;
|
ewol::Text m_displayText;
|
||||||
ewol::Drawing m_displayDrawing;
|
ewol::Drawing m_displayDrawing;
|
||||||
public:
|
|
||||||
// Derived function
|
|
||||||
virtual void OnRegenerateDisplay(void);
|
|
||||||
// Derived function
|
|
||||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
|
|
||||||
public:
|
|
||||||
// Derived function
|
|
||||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
|
|
||||||
// Derived function
|
|
||||||
virtual bool OnEventKb(ewol::keyEvent::status_te typeEvent, uniChar_t unicodeData);
|
|
||||||
// Derived function
|
|
||||||
virtual bool OnEventKbMove(ewol::keyEvent::status_te typeEvent, ewol::keyEvent::keyboard_te moveTypeEvent);
|
|
||||||
// Derived function
|
|
||||||
virtual void OnEventClipboard(ewol::clipBoard::clipboardListe_te clipboardID);
|
|
||||||
// Derived function
|
|
||||||
virtual void OnGetFocus(void);
|
|
||||||
// Derived function
|
|
||||||
virtual void OnLostFocus(void);
|
|
||||||
public:
|
public:
|
||||||
void SetFontSize(int32_t size);
|
void SetFontSize(int32_t size);
|
||||||
void SetFontName(etk::UString fontName);
|
void SetFontName(etk::UString fontName);
|
||||||
private:
|
private:
|
||||||
void CalculateMaxSize(void);
|
void CalculateMaxSize(void);
|
||||||
protected:
|
protected: // derived function
|
||||||
virtual void OnDraw(ewol::DrawProperty& displayProp);
|
virtual void OnDraw(void);
|
||||||
|
public: // Derived function
|
||||||
|
const char * const GetObjectType(void) { return "ApplCodeView"; };
|
||||||
|
virtual bool CalculateMinSize(void);
|
||||||
|
virtual void OnRegenerateDisplay(void);
|
||||||
|
virtual void OnReceiveMessage(const ewol::EMessage& _msg);
|
||||||
|
virtual bool OnEventInput(const ewol::EventInput& _event);
|
||||||
|
virtual bool OnEventEntry(const ewol::EventEntry& _event);
|
||||||
|
virtual void OnEventClipboard(ewol::clipBoard::clipboardListe_te clipboardID);
|
||||||
|
virtual void OnGetFocus(void);
|
||||||
|
virtual void OnLostFocus(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -16,8 +16,7 @@
|
|||||||
|
|
||||||
#include <ewol/widget/Button.h>
|
#include <ewol/widget/Button.h>
|
||||||
#include <ewol/widget/CheckBox.h>
|
#include <ewol/widget/CheckBox.h>
|
||||||
#include <ewol/widget/SizerHori.h>
|
#include <ewol/widget/Sizer.h>
|
||||||
#include <ewol/widget/SizerVert.h>
|
|
||||||
#include <ewol/widget/Label.h>
|
#include <ewol/widget/Label.h>
|
||||||
#include <ewol/widget/Entry.h>
|
#include <ewol/widget/Entry.h>
|
||||||
#include <ewol/widget/List.h>
|
#include <ewol/widget/List.h>
|
||||||
@@ -29,9 +28,24 @@
|
|||||||
#include <ewol/widget/meta/FileChooser.h>
|
#include <ewol/widget/meta/FileChooser.h>
|
||||||
#include <ewol/widget/meta/Parameter.h>
|
#include <ewol/widget/meta/Parameter.h>
|
||||||
#include <ewol/widget/WidgetManager.h>
|
#include <ewol/widget/WidgetManager.h>
|
||||||
#include <ewol/eObject/EObject.h>
|
#include <ewol/renderer/EObject.h>
|
||||||
|
#include <ewol/renderer/eContext.h>
|
||||||
|
#include <date/date.h>
|
||||||
|
|
||||||
|
namespace appl
|
||||||
|
{
|
||||||
|
etk::UString GetVersion(void)
|
||||||
|
{
|
||||||
|
#define FIRST_YEAR (2010)
|
||||||
|
etk::UString tmpOutput = (date::GetYear()-FIRST_YEAR);
|
||||||
|
tmpOutput += ".";
|
||||||
|
tmpOutput += date::GetMonth();
|
||||||
|
tmpOutput += ".";
|
||||||
|
tmpOutput += date::GetDay();
|
||||||
|
return tmpOutput;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
@@ -40,10 +54,11 @@
|
|||||||
#include <ewol/widget/Label.h>
|
#include <ewol/widget/Label.h>
|
||||||
#include <ewol/widget/Spacer.h>
|
#include <ewol/widget/Spacer.h>
|
||||||
|
|
||||||
class ParameterAboutGui : public widget::SizerVert
|
class ParameterAboutGui : public widget::Sizer
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
ParameterAboutGui(void)
|
ParameterAboutGui(void) :
|
||||||
|
widget::Sizer(widget::Sizer::modeVert)
|
||||||
{
|
{
|
||||||
widget::Spacer* mySpacer = NULL;
|
widget::Spacer* mySpacer = NULL;
|
||||||
|
|
||||||
@@ -51,16 +66,23 @@ class ParameterAboutGui : public widget::SizerVert
|
|||||||
if (NULL == mySpacer) {
|
if (NULL == mySpacer) {
|
||||||
APPL_ERROR("Can not allocate widget ==> display might be in error");
|
APPL_ERROR("Can not allocate widget ==> display might be in error");
|
||||||
} else {
|
} else {
|
||||||
mySpacer->SetExpendX(true);
|
mySpacer->SetExpand(bvec2(true,true));
|
||||||
mySpacer->SetExpendY(true);
|
|
||||||
SubWidgetAdd(mySpacer);
|
SubWidgetAdd(mySpacer);
|
||||||
}
|
}
|
||||||
etk::UString tmpLabel = "<left>";
|
etk::UString tmpLabel = "<left>";
|
||||||
tmpLabel += " <b>Editeur De N'ours</b> : v";
|
tmpLabel += " <b>Editeur De N'ours</b> : v:";
|
||||||
tmpLabel += APPL_VERSION_TAG_NAME;
|
tmpLabel += appl::GetVersion();
|
||||||
tmpLabel += "<br/>";
|
tmpLabel += "<br/>";
|
||||||
tmpLabel += " <b>Build Time</b> : ";
|
tmpLabel += " <b>Build Time</b> : ";
|
||||||
tmpLabel += BUILD_TIME;
|
tmpLabel += date::GetYear();
|
||||||
|
tmpLabel += "/";
|
||||||
|
tmpLabel += date::GetMonth();
|
||||||
|
tmpLabel += "/";
|
||||||
|
tmpLabel += date::GetDay();
|
||||||
|
tmpLabel += " ";
|
||||||
|
tmpLabel += date::GetHour();
|
||||||
|
tmpLabel += "h";
|
||||||
|
tmpLabel += date::GetMinute();
|
||||||
tmpLabel += "<br/>";
|
tmpLabel += "<br/>";
|
||||||
tmpLabel += " <b>Website</b> : https://github.com/HeeroYui/edn<br/>";
|
tmpLabel += " <b>Website</b> : https://github.com/HeeroYui/edn<br/>";
|
||||||
tmpLabel += " <b>License</b> : GPL v3<br/>";
|
tmpLabel += " <b>License</b> : GPL v3<br/>";
|
||||||
@@ -74,7 +96,7 @@ class ParameterAboutGui : public widget::SizerVert
|
|||||||
if (NULL == myLabel) {
|
if (NULL == myLabel) {
|
||||||
APPL_ERROR("Can not allocate widget ==> display might be in error");
|
APPL_ERROR("Can not allocate widget ==> display might be in error");
|
||||||
} else {
|
} else {
|
||||||
myLabel->SetExpendX(true);
|
myLabel->SetExpand(bvec2(true,false));
|
||||||
SubWidgetAdd(myLabel);
|
SubWidgetAdd(myLabel);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -93,35 +115,31 @@ const char * l_smoothMax = "tmpEvent_maxChange";
|
|||||||
MainWindows::MainWindows(void)
|
MainWindows::MainWindows(void)
|
||||||
{
|
{
|
||||||
APPL_DEBUG("CREATE WINDOWS ... ");
|
APPL_DEBUG("CREATE WINDOWS ... ");
|
||||||
widget::SizerVert * mySizerVert = NULL;
|
widget::Sizer * mySizerVert = NULL;
|
||||||
widget::SizerVert * mySizerVert2 = NULL;
|
widget::Sizer * mySizerVert2 = NULL;
|
||||||
widget::SizerHori * mySizerHori = NULL;
|
widget::Sizer * mySizerHori = NULL;
|
||||||
//ewol::Button * myButton = NULL;
|
//ewol::Button * myButton = NULL;
|
||||||
CodeView * myCodeView = NULL;
|
CodeView * myCodeView = NULL;
|
||||||
BufferView * myBufferView = NULL;
|
BufferView * myBufferView = NULL;
|
||||||
widget::Menu * myMenu = NULL;
|
widget::Menu * myMenu = NULL;
|
||||||
|
|
||||||
mySizerVert = new widget::SizerVert();
|
mySizerVert = new widget::Sizer(widget::Sizer::modeVert);
|
||||||
SetSubWidget(mySizerVert);
|
SetSubWidget(mySizerVert);
|
||||||
|
|
||||||
mySizerHori = new widget::SizerHori();
|
mySizerHori = new widget::Sizer(widget::Sizer::modeHori);
|
||||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||||
myBufferView = new BufferView();
|
myBufferView = new BufferView();
|
||||||
myBufferView->SetExpendX(false);
|
myBufferView->SetExpand(bvec2(false,true));
|
||||||
myBufferView->SetExpendY(true);
|
myBufferView->SetFill(bvec2(true,true));
|
||||||
myBufferView->SetFillX(true);
|
|
||||||
myBufferView->SetFillY(true);
|
|
||||||
mySizerHori->SubWidgetAdd(myBufferView);
|
mySizerHori->SubWidgetAdd(myBufferView);
|
||||||
|
|
||||||
mySizerVert2 = new widget::SizerVert();
|
mySizerVert2 = new widget::Sizer(widget::Sizer::modeVert);
|
||||||
mySizerHori->SubWidgetAdd(mySizerVert2);
|
mySizerHori->SubWidgetAdd(mySizerVert2);
|
||||||
|
|
||||||
// main buffer Area :
|
// main buffer Area :
|
||||||
myCodeView = new CodeView("FreeMono", 11);
|
myCodeView = new CodeView("FreeMono;DejaVuSansMono", 11);
|
||||||
myCodeView->SetExpendX(true);
|
myCodeView->SetExpand(bvec2(true,true));
|
||||||
myCodeView->SetExpendY(true);
|
myCodeView->SetFill(bvec2(true,true));
|
||||||
myCodeView->SetFillX(true);
|
|
||||||
myCodeView->SetFillY(true);
|
|
||||||
mySizerVert2->SubWidgetAdd(myCodeView);
|
mySizerVert2->SubWidgetAdd(myCodeView);
|
||||||
|
|
||||||
// search area :
|
// search area :
|
||||||
@@ -129,7 +147,7 @@ MainWindows::MainWindows(void)
|
|||||||
mySizerVert2->SubWidgetAdd(mySearch);
|
mySizerVert2->SubWidgetAdd(mySearch);
|
||||||
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
|
||||||
{
|
{
|
||||||
widget::SizerHori * mySizerHori2 = new widget::SizerHori();
|
widget::Sizer * mySizerHori2 = new widget::Sizer(widget::Sizer::modeHori);
|
||||||
mySizerVert2->SubWidgetAdd(mySizerHori2);
|
mySizerVert2->SubWidgetAdd(mySizerHori2);
|
||||||
|
|
||||||
widget::CheckBox* tmpCheck = new widget::CheckBox("smooth");
|
widget::CheckBox* tmpCheck = new widget::CheckBox("smooth");
|
||||||
@@ -139,7 +157,7 @@ MainWindows::MainWindows(void)
|
|||||||
widget::Slider* tmpSlider = new widget::Slider();
|
widget::Slider* tmpSlider = new widget::Slider();
|
||||||
mySizerHori2->SubWidgetAdd(tmpSlider);
|
mySizerHori2->SubWidgetAdd(tmpSlider);
|
||||||
tmpSlider->RegisterOnEvent(this, ewolEventSliderChange, l_smoothMin);
|
tmpSlider->RegisterOnEvent(this, ewolEventSliderChange, l_smoothMin);
|
||||||
tmpSlider->SetExpendX(true);
|
tmpSlider->SetExpand(bvec2(true,false));
|
||||||
tmpSlider->SetMin(0);
|
tmpSlider->SetMin(0);
|
||||||
tmpSlider->SetMax(1000);
|
tmpSlider->SetMax(1000);
|
||||||
tmpSlider->SetValue(0450);
|
tmpSlider->SetValue(0450);
|
||||||
@@ -148,7 +166,7 @@ MainWindows::MainWindows(void)
|
|||||||
tmpSlider = new widget::Slider();
|
tmpSlider = new widget::Slider();
|
||||||
mySizerHori2->SubWidgetAdd(tmpSlider);
|
mySizerHori2->SubWidgetAdd(tmpSlider);
|
||||||
tmpSlider->RegisterOnEvent(this, ewolEventSliderChange, l_smoothMax);
|
tmpSlider->RegisterOnEvent(this, ewolEventSliderChange, l_smoothMax);
|
||||||
tmpSlider->SetExpendX(true);
|
tmpSlider->SetExpand(bvec2(true,false));
|
||||||
tmpSlider->SetMin(0);
|
tmpSlider->SetMin(0);
|
||||||
tmpSlider->SetMax(1000);
|
tmpSlider->SetMax(1000);
|
||||||
tmpSlider->SetValue(0550);
|
tmpSlider->SetValue(0550);
|
||||||
@@ -156,7 +174,7 @@ MainWindows::MainWindows(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mySizerHori = new widget::SizerHori();
|
mySizerHori = new widget::Sizer(widget::Sizer::modeHori);
|
||||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||||
|
|
||||||
myMenu = new widget::Menu();
|
myMenu = new widget::Menu();
|
||||||
@@ -209,8 +227,8 @@ MainWindows::MainWindows(void)
|
|||||||
(void)myMenu->Add(idMenugDisplay, "Reload OpenGl Shader", "", ednMsgGuiReloadShader);
|
(void)myMenu->Add(idMenugDisplay, "Reload OpenGl Shader", "", ednMsgGuiReloadShader);
|
||||||
|
|
||||||
m_widgetLabelFileName = new widget::Label("<left>FileName</left>");
|
m_widgetLabelFileName = new widget::Label("<left>FileName</left>");
|
||||||
m_widgetLabelFileName->SetExpendX(true);
|
m_widgetLabelFileName->SetExpand(bvec2(true,false));
|
||||||
m_widgetLabelFileName->SetFillY(true);
|
m_widgetLabelFileName->SetFill(bvec2(false,true));;
|
||||||
mySizerHori->SubWidgetAdd(m_widgetLabelFileName);
|
mySizerHori->SubWidgetAdd(m_widgetLabelFileName);
|
||||||
|
|
||||||
|
|
||||||
@@ -257,20 +275,14 @@ MainWindows::~MainWindows(void)
|
|||||||
const char *const ednEventPopUpFileSelected = "edn-mainWindows-openSelected";
|
const char *const ednEventPopUpFileSelected = "edn-mainWindows-openSelected";
|
||||||
const char *const ednEventPopUpFileSaveAs = "edn-mainWindows-saveAsSelected";
|
const char *const ednEventPopUpFileSaveAs = "edn-mainWindows-saveAsSelected";
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
void MainWindows::OnReceiveMessage(const ewol::EMessage& _msg)
|
||||||
* @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);
|
ewol::Windows::OnReceiveMessage(_msg);
|
||||||
|
|
||||||
//APPL_INFO("Receive Event from the main windows ... : \"" << eventId << "\" ==> data=\"" << data << "\"" );
|
//APPL_INFO("Receive Event from the main windows ... : \"" << eventId << "\" ==> data=\"" << data << "\"" );
|
||||||
// Open file Section ...
|
// Open file Section ...
|
||||||
if (eventId == ednMsgGuiOpen) {
|
if (_msg.GetMessage() == ednMsgGuiOpen) {
|
||||||
widget::FileChooser* tmpWidget = new widget::FileChooser();
|
widget::FileChooser* tmpWidget = new widget::FileChooser();
|
||||||
tmpWidget->SetTitle("Open Files ...");
|
tmpWidget->SetTitle("Open Files ...");
|
||||||
tmpWidget->SetValidateLabel("Open");
|
tmpWidget->SetValidateLabel("Open");
|
||||||
@@ -283,18 +295,18 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
|
|||||||
}
|
}
|
||||||
PopUpWidgetPush(tmpWidget);
|
PopUpWidgetPush(tmpWidget);
|
||||||
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected);
|
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected);
|
||||||
} else if (eventId == ednEventPopUpFileSelected) {
|
} else if (_msg.GetMessage() == ednEventPopUpFileSelected) {
|
||||||
APPL_DEBUG("Request opening the file : " << data);
|
APPL_DEBUG("Request opening the file : " << _msg.GetData());
|
||||||
SendMultiCast(ednMsgOpenFile, data);
|
SendMultiCast(ednMsgOpenFile, _msg.GetData());
|
||||||
} else if (eventId == ednMsgGuiSaveAs) {
|
} else if (_msg.GetMessage() == ednMsgGuiSaveAs) {
|
||||||
if (data == "") {
|
if (_msg.GetData() == "") {
|
||||||
APPL_ERROR("Null data for Save As file ... ");
|
APPL_ERROR("Null data for Save As file ... ");
|
||||||
} else {
|
} else {
|
||||||
m_currentSavingAsIdBuffer = -1;
|
m_currentSavingAsIdBuffer = -1;
|
||||||
if (data == "current") {
|
if (_msg.GetData() == "current") {
|
||||||
m_currentSavingAsIdBuffer = BufferManager::GetSelected();
|
m_currentSavingAsIdBuffer = BufferManager::GetSelected();
|
||||||
} else {
|
} else {
|
||||||
sscanf(data.c_str(), "%d", &m_currentSavingAsIdBuffer);
|
sscanf(_msg.GetData().c_str(), "%d", &m_currentSavingAsIdBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (false == BufferManager::Exist(m_currentSavingAsIdBuffer)) {
|
if (false == BufferManager::Exist(m_currentSavingAsIdBuffer)) {
|
||||||
@@ -321,15 +333,15 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (eventId == ednEventPopUpFileSaveAs) {
|
} else if (_msg.GetMessage() == ednEventPopUpFileSaveAs) {
|
||||||
// get the filename :
|
// get the filename :
|
||||||
etk::UString tmpData = data;
|
etk::UString tmpData = _msg.GetData();
|
||||||
APPL_DEBUG("Request Saving As file : " << tmpData);
|
APPL_DEBUG("Request Saving As file : " << tmpData);
|
||||||
|
|
||||||
BufferManager::Get(m_currentSavingAsIdBuffer)->SetFileName(tmpData);
|
BufferManager::Get(m_currentSavingAsIdBuffer)->SetFileName(tmpData);
|
||||||
SendMultiCast(ednMsgGuiSave, m_currentSavingAsIdBuffer);
|
SendMultiCast(ednMsgGuiSave, m_currentSavingAsIdBuffer);
|
||||||
} else if( eventId == ednMsgBufferState
|
} else if( _msg.GetMessage() == ednMsgBufferState
|
||||||
|| eventId == ednMsgBufferId) {
|
|| _msg.GetMessage() == ednMsgBufferId) {
|
||||||
// the buffer change we need to update the widget string
|
// the buffer change we need to update the widget string
|
||||||
BufferText* tmpBuffer = BufferManager::Get(BufferManager::GetSelected());
|
BufferText* tmpBuffer = BufferManager::Get(BufferManager::GetSelected());
|
||||||
if (NULL != tmpBuffer) {
|
if (NULL != tmpBuffer) {
|
||||||
@@ -344,15 +356,15 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
|
|||||||
}
|
}
|
||||||
etk::UString windowsTitle = "edn - ";
|
etk::UString windowsTitle = "edn - ";
|
||||||
windowsTitle += directName;
|
windowsTitle += directName;
|
||||||
ewol::SetTitle(windowsTitle);
|
SetTitle(windowsTitle);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
m_widgetLabelFileName->SetLabel("");
|
m_widgetLabelFileName->SetLabel("");
|
||||||
ewol::SetTitle("edn");
|
SetTitle("edn");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
// TODO : Set the Title ....
|
// TODO : Set the Title ....
|
||||||
} else if (eventId == ednMsgProperties) {
|
} else if (_msg.GetMessage() == ednMsgProperties) {
|
||||||
// Request the parameter GUI
|
// Request the parameter GUI
|
||||||
widget::Parameter* tmpWidget = new widget::Parameter();
|
widget::Parameter* tmpWidget = new widget::Parameter();
|
||||||
if (NULL == tmpWidget) {
|
if (NULL == tmpWidget) {
|
||||||
@@ -363,32 +375,27 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
|
|||||||
tmpWidget->MenuAddGroup("Editor");
|
tmpWidget->MenuAddGroup("Editor");
|
||||||
ewol::Widget* tmpSubWidget = new globals::ParameterGlobalsGui();
|
ewol::Widget* tmpSubWidget = new globals::ParameterGlobalsGui();
|
||||||
tmpWidget->MenuAdd("Editor", "", tmpSubWidget);
|
tmpWidget->MenuAdd("Editor", "", tmpSubWidget);
|
||||||
tmpWidget->MenuAdd("Polices & Color", "", NULL);
|
tmpWidget->MenuAdd("Font & Color", "", NULL);
|
||||||
tmpWidget->MenuAdd("Highlight", "", NULL);
|
tmpWidget->MenuAdd("Highlight", "", NULL);
|
||||||
tmpWidget->MenuAddGroup("Genral");
|
tmpWidget->MenuAddGroup("General");
|
||||||
tmpWidget->MenuAdd("Affichage", "", NULL);
|
tmpWidget->MenuAdd("Display", "", NULL);
|
||||||
tmpSubWidget = new ParameterAboutGui();
|
tmpSubWidget = new ParameterAboutGui();
|
||||||
tmpWidget->MenuAdd("About", "", tmpSubWidget);
|
tmpWidget->MenuAdd("About", "", tmpSubWidget);
|
||||||
}
|
}
|
||||||
} else if (eventId == ednMsgGuiReloadShader) {
|
} else if (_msg.GetMessage() == ednMsgGuiReloadShader) {
|
||||||
ewol::resource::ReLoadResources();
|
ewol::GetContext().GetResourcesManager().ReLoadResources();
|
||||||
ewol::ForceRedrawAll();
|
ewol::GetContext().ForceRedrawAll();
|
||||||
|
} else if (_msg.GetMessage() == ednMsgGuiExit) {
|
||||||
|
// TODO ...
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindows::OnObjectRemove(ewol::EObject * _removeObject)
|
||||||
/**
|
|
||||||
* @brief Inform object that an other object is removed ...
|
|
||||||
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
|
|
||||||
* @note : Sub classes must call this class
|
|
||||||
* @return ---
|
|
||||||
*/
|
|
||||||
void MainWindows::OnObjectRemove(ewol::EObject * removeObject)
|
|
||||||
{
|
{
|
||||||
ewol::Windows::OnObjectRemove(removeObject);
|
ewol::Windows::OnObjectRemove(_removeObject);
|
||||||
if (m_widgetLabelFileName == removeObject) {
|
if (m_widgetLabelFileName == _removeObject) {
|
||||||
m_widgetLabelFileName = NULL;
|
m_widgetLabelFileName = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -26,12 +26,10 @@ class MainWindows : public ewol::Windows
|
|||||||
// Constructeur
|
// Constructeur
|
||||||
MainWindows(void);
|
MainWindows(void);
|
||||||
~MainWindows(void);
|
~MainWindows(void);
|
||||||
// Derived function
|
public: // Derived function
|
||||||
const char * const GetObjectType(void) { return "MainWindows"; };
|
virtual const char * const GetObjectType(void) { return "MainWindows"; };
|
||||||
// Derived function
|
virtual void OnReceiveMessage(const ewol::EMessage& _msg);
|
||||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
|
virtual void OnObjectRemove(ewol::EObject * _removeObject);
|
||||||
// Derived function
|
|
||||||
virtual void OnObjectRemove(ewol::EObject * removeObject);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define EDN_CAST_MAIN_WINDOWS(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_MAIN_WINDOWS,MainWindows,curentPointer)
|
#define EDN_CAST_MAIN_WINDOWS(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_MAIN_WINDOWS,MainWindows,curentPointer)
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
#include "appl/globalMsg.h"
|
#include "appl/globalMsg.h"
|
||||||
|
|
||||||
#include <ewol/widget/Button.h>
|
#include <ewol/widget/Button.h>
|
||||||
|
#include <ewol/widget/Image.h>
|
||||||
|
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
@@ -31,19 +32,50 @@ const char* const l_eventForwardCb = "appl-forward-CheckBox";
|
|||||||
const char* const l_eventHideBt = "appl-hide-button";
|
const char* const l_eventHideBt = "appl-hide-button";
|
||||||
|
|
||||||
Search::Search(void) :
|
Search::Search(void) :
|
||||||
|
widget::Sizer(widget::Sizer::modeHori),
|
||||||
m_searchEntry(NULL),
|
m_searchEntry(NULL),
|
||||||
m_replaceEntry(NULL)
|
m_replaceEntry(NULL)
|
||||||
{
|
{
|
||||||
m_forward = false;
|
m_forward = false;
|
||||||
|
// TODO : Change the mode of creating interface :
|
||||||
|
/*
|
||||||
|
<composer>
|
||||||
|
<sizer mode="hori" expand="true,false" fill="true" lock="true">
|
||||||
|
<button name="SEARCH:close">
|
||||||
|
<image src="THEME:GUI:Remove.svg" fill="true" size="70,70mm"/>
|
||||||
|
</button>
|
||||||
|
<entry name="SEARCH:search-entry" expand="true" fill="true"/>
|
||||||
|
<button name="SEARCH:search">
|
||||||
|
<image src="THEME:GUI:Search.svg" fill="true" size="70,70mm"/>
|
||||||
|
</button>
|
||||||
|
<entry name="SEARCH:replace-entry" expand="true" fill="true"/>
|
||||||
|
<button name="SEARCH:replace">
|
||||||
|
<image src="THEME:GUI:Replace.svg" fill="true" size="70,70mm"/>
|
||||||
|
</button>
|
||||||
|
<button name="SEARCH:case">
|
||||||
|
<image src="THEME:GUI:CaseSensitive.svg" fill="true" size="70,70mm" hover="Close search bar"/>
|
||||||
|
<image src="THEME:GUI:CaseSensitive.svg" fill="true" size="70,70mm" hover="Close search bar"/>
|
||||||
|
</button>
|
||||||
|
<button name="SEARCH:wrap">
|
||||||
|
<image src="THEME:GUI:WrapAround.svg" fill="true" size="70,70mm" hover="Close search bar"/>
|
||||||
|
<image src="THEME:GUI:WrapAround.svg" fill="true" size="70,70mm" hover="Close search bar"/>
|
||||||
|
</button>
|
||||||
|
<button name="SEARCH:up-down">
|
||||||
|
<image src="THEME:GUI:Up.svg" fill="true" size="70,70mm" hover="Close search bar"/>
|
||||||
|
<image src="THEME:GUI:Down.svg" fill="true" size="70,70mm" hover="Close search bar"/>
|
||||||
|
</button>
|
||||||
|
</size>
|
||||||
|
</composer>
|
||||||
|
*/
|
||||||
widget::Button * myButtonImage = NULL;
|
widget::Button * myButtonImage = NULL;
|
||||||
myButtonImage = new widget::Button("", "");
|
myButtonImage = new widget::Button();
|
||||||
if (NULL == myButtonImage) {
|
if (NULL == myButtonImage) {
|
||||||
APPL_ERROR("Widget allocation error ==> it will missing in the display");
|
APPL_ERROR("Widget allocation error ==> it will missing in the display");
|
||||||
} else {
|
} else {
|
||||||
myButtonImage->SetImage("THEME:GUI:Remove.svg");
|
widget::Image* tmpImage = new widget::Image("THEME:GUI:Remove.svg");
|
||||||
myButtonImage->SetMinSize(32,32);
|
tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter));
|
||||||
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventHideBt);
|
myButtonImage->SetSubWidget(tmpImage);
|
||||||
|
myButtonImage->RegisterOnEvent(this, widget::Button::eventPressed, l_eventHideBt);
|
||||||
SubWidgetAdd(myButtonImage);
|
SubWidgetAdd(myButtonImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,20 +83,21 @@ Search::Search(void) :
|
|||||||
if (NULL == m_searchEntry) {
|
if (NULL == m_searchEntry) {
|
||||||
APPL_ERROR("Widget allocation error ==> it will missing in the display");
|
APPL_ERROR("Widget allocation error ==> it will missing in the display");
|
||||||
} else {
|
} else {
|
||||||
m_searchEntry->RegisterOnEvent(this, ewolEventEntryModify, l_eventSearchEntry);
|
m_searchEntry->RegisterOnEvent(this, widget::Entry::eventModify, l_eventSearchEntry);
|
||||||
m_searchEntry->RegisterOnEvent(this, ewolEventEntryEnter, l_eventSearchEntryEnter);
|
m_searchEntry->RegisterOnEvent(this, widget::Entry::eventEnter, l_eventSearchEntryEnter);
|
||||||
m_searchEntry->SetExpendX(true);
|
m_searchEntry->SetExpand(bvec2(true,false));
|
||||||
m_searchEntry->SetFillX(true);
|
m_searchEntry->SetFill(bvec2(true,false));
|
||||||
SubWidgetAdd(m_searchEntry);
|
SubWidgetAdd(m_searchEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
myButtonImage = new widget::Button("","");
|
myButtonImage = new widget::Button();
|
||||||
if (NULL == myButtonImage) {
|
if (NULL == myButtonImage) {
|
||||||
APPL_ERROR("Widget allocation error ==> it will missing in the display");
|
APPL_ERROR("Widget allocation error ==> it will missing in the display");
|
||||||
} else {
|
} else {
|
||||||
myButtonImage->SetImage("THEME:GUI:Search.svg");
|
widget::Image* tmpImage = new widget::Image("THEME:GUI:Search.svg");
|
||||||
myButtonImage->SetMinSize(32,32);
|
tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter));
|
||||||
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventSearchBt);
|
myButtonImage->SetSubWidget(tmpImage);
|
||||||
|
myButtonImage->RegisterOnEvent(this, widget::Button::eventPressed, l_eventSearchBt);
|
||||||
SubWidgetAdd(myButtonImage);
|
SubWidgetAdd(myButtonImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,59 +105,78 @@ Search::Search(void) :
|
|||||||
if (NULL == m_replaceEntry) {
|
if (NULL == m_replaceEntry) {
|
||||||
APPL_ERROR("Widget allocation error ==> it will missing in the display");
|
APPL_ERROR("Widget allocation error ==> it will missing in the display");
|
||||||
} else {
|
} else {
|
||||||
m_replaceEntry->RegisterOnEvent(this, ewolEventEntryModify, l_eventReplaceEntry);
|
m_replaceEntry->RegisterOnEvent(this, widget::Entry::eventModify, l_eventReplaceEntry);
|
||||||
m_replaceEntry->RegisterOnEvent(this, ewolEventEntryEnter, l_eventReplaceEntryEnter);
|
m_replaceEntry->RegisterOnEvent(this, widget::Entry::eventEnter, l_eventReplaceEntryEnter);
|
||||||
m_replaceEntry->SetExpendX(true);
|
m_replaceEntry->SetExpand(bvec2(true,false));
|
||||||
m_replaceEntry->SetFillX(true);
|
m_replaceEntry->SetFill(bvec2(true,false));
|
||||||
SubWidgetAdd(m_replaceEntry);
|
SubWidgetAdd(m_replaceEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
myButtonImage = new widget::Button("","");
|
myButtonImage = new widget::Button();
|
||||||
if (NULL == myButtonImage) {
|
if (NULL == myButtonImage) {
|
||||||
APPL_ERROR("Widget allocation error ==> it will missing in the display");
|
APPL_ERROR("Widget allocation error ==> it will missing in the display");
|
||||||
} else {
|
} else {
|
||||||
myButtonImage->SetImage("THEME:GUI:Replace.svg");
|
widget::Image* tmpImage = new widget::Image("THEME:GUI:Replace.svg");
|
||||||
myButtonImage->SetMinSize(32,32);
|
tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter));
|
||||||
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventReplaceBt);
|
myButtonImage->SetSubWidget(tmpImage);
|
||||||
|
myButtonImage->RegisterOnEvent(this, widget::Button::eventPressed, l_eventReplaceBt);
|
||||||
SubWidgetAdd(myButtonImage);
|
SubWidgetAdd(myButtonImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
myButtonImage = new widget::Button("","");
|
myButtonImage = new widget::Button();
|
||||||
if (NULL == myButtonImage) {
|
if (NULL == myButtonImage) {
|
||||||
APPL_ERROR("Widget allocation error ==> it will missing in the display");
|
APPL_ERROR("Widget allocation error ==> it will missing in the display");
|
||||||
} else {
|
} else {
|
||||||
myButtonImage->SetImage("THEME:GUI:CaseSensitive.svg");
|
|
||||||
myButtonImage->SetImageToggle("THEME:GUI:CaseSensitive.svg", 0xFFFFFF5F);
|
|
||||||
myButtonImage->SetMinSize(32,32);
|
|
||||||
myButtonImage->SetToggleMode(true);
|
myButtonImage->SetToggleMode(true);
|
||||||
|
|
||||||
|
widget::Image* tmpImage = new widget::Image("THEME:GUI:CaseSensitive.svg");
|
||||||
|
tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter));
|
||||||
|
myButtonImage->SetSubWidget(tmpImage);
|
||||||
|
|
||||||
|
tmpImage = new widget::Image("THEME:GUI:CaseSensitive.svg"); // TODO : Set color on Image .... 0xFFFFFF5F
|
||||||
|
tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter));
|
||||||
|
myButtonImage->SetSubWidgetToggle(tmpImage);
|
||||||
|
|
||||||
myButtonImage->SetValue(!SearchData::GetCase());
|
myButtonImage->SetValue(!SearchData::GetCase());
|
||||||
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventCaseCb);
|
myButtonImage->RegisterOnEvent(this, widget::Button::eventPressed, l_eventCaseCb);
|
||||||
SubWidgetAdd(myButtonImage);
|
SubWidgetAdd(myButtonImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
myButtonImage = new widget::Button("","");
|
myButtonImage = new widget::Button();
|
||||||
if (NULL == myButtonImage) {
|
if (NULL == myButtonImage) {
|
||||||
APPL_ERROR("Widget allocation error ==> it will missing in the display");
|
APPL_ERROR("Widget allocation error ==> it will missing in the display");
|
||||||
} else {
|
} else {
|
||||||
myButtonImage->SetImage("THEME:GUI:WrapAround.svg");
|
|
||||||
myButtonImage->SetImageToggle("THEME:GUI:WrapAround.svg", 0xFFFFFF5F);
|
|
||||||
myButtonImage->SetMinSize(32,32);
|
|
||||||
myButtonImage->SetToggleMode(true);
|
myButtonImage->SetToggleMode(true);
|
||||||
|
|
||||||
|
widget::Image* tmpImage = new widget::Image("THEME:GUI:WrapAround.svg");
|
||||||
|
tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter));
|
||||||
|
myButtonImage->SetSubWidget(tmpImage);
|
||||||
|
|
||||||
|
tmpImage = new widget::Image("THEME:GUI:WrapAround.svg"); // TODO : Set color on Image .... 0xFFFFFF5F
|
||||||
|
tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter));
|
||||||
|
myButtonImage->SetSubWidgetToggle(tmpImage);
|
||||||
|
|
||||||
myButtonImage->SetValue(!SearchData::GetWrap());
|
myButtonImage->SetValue(!SearchData::GetWrap());
|
||||||
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventWrapCb);
|
myButtonImage->RegisterOnEvent(this, widget::Button::eventPressed, l_eventWrapCb);
|
||||||
SubWidgetAdd(myButtonImage);
|
SubWidgetAdd(myButtonImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
myButtonImage = new widget::Button("","");
|
myButtonImage = new widget::Button();
|
||||||
if (NULL == myButtonImage) {
|
if (NULL == myButtonImage) {
|
||||||
APPL_ERROR("Widget allocation error ==> it will missing in the display");
|
APPL_ERROR("Widget allocation error ==> it will missing in the display");
|
||||||
} else {
|
} else {
|
||||||
myButtonImage->SetImage("THEME:GUI:Up.svg");
|
|
||||||
myButtonImage->SetImageToggle("THEME:GUI:Down.svg");
|
|
||||||
myButtonImage->SetMinSize(32,32);
|
|
||||||
myButtonImage->SetToggleMode(true);
|
myButtonImage->SetToggleMode(true);
|
||||||
|
|
||||||
|
widget::Image* tmpImage = new widget::Image("THEME:GUI:Up.svg");
|
||||||
|
tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter));
|
||||||
|
myButtonImage->SetSubWidget(tmpImage);
|
||||||
|
|
||||||
|
tmpImage = new widget::Image("THEME:GUI:Down.svg");
|
||||||
|
tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter));
|
||||||
|
myButtonImage->SetSubWidgetToggle(tmpImage);
|
||||||
|
|
||||||
myButtonImage->SetValue(!m_forward);
|
myButtonImage->SetValue(!m_forward);
|
||||||
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventForwardCb);
|
myButtonImage->RegisterOnEvent(this, widget::Button::eventPressed, l_eventForwardCb);
|
||||||
SubWidgetAdd(myButtonImage);
|
SubWidgetAdd(myButtonImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,70 +191,63 @@ Search::~Search(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
void Search::OnReceiveMessage(const ewol::EMessage& _msg)
|
||||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
|
||||||
* @param[in] CallerObject Pointer on the EObject that information came from
|
|
||||||
* @param[in] eventId Message registered by this class
|
|
||||||
* @param[in] data Data registered by this class
|
|
||||||
* @return ---
|
|
||||||
*/
|
|
||||||
void Search::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
|
||||||
{
|
{
|
||||||
widget::SizerHori::OnReceiveMessage(CallerObject, eventId, data);
|
widget::Sizer::OnReceiveMessage(_msg);
|
||||||
//APPL_INFO("Search receive message : \"" << eventId << "\" data=\"" << data << "\"");
|
//APPL_INFO("Search receive message : \"" << eventId << "\" data=\"" << data << "\"");
|
||||||
if ( eventId == l_eventSearchEntry) {
|
if ( _msg.GetMessage() == l_eventSearchEntry) {
|
||||||
SearchData::SetSearch(data);
|
SearchData::SetSearch(_msg.GetData());
|
||||||
} else if ( eventId == l_eventSearchEntryEnter) {
|
} else if ( _msg.GetMessage() == l_eventSearchEntryEnter) {
|
||||||
SearchData::SetSearch(data);
|
SearchData::SetSearch(_msg.GetData());
|
||||||
if (true==m_forward) {
|
if (true==m_forward) {
|
||||||
SendMultiCast(ednMsgGuiFind, "Previous");
|
SendMultiCast(ednMsgGuiFind, "Previous");
|
||||||
} else {
|
} else {
|
||||||
SendMultiCast(ednMsgGuiFind, "Next");
|
SendMultiCast(ednMsgGuiFind, "Next");
|
||||||
}
|
}
|
||||||
} else if ( eventId == l_eventReplaceEntry) {
|
} else if ( _msg.GetMessage() == l_eventReplaceEntry) {
|
||||||
SearchData::SetReplace(data);
|
SearchData::SetReplace(_msg.GetData());
|
||||||
} else if ( eventId == l_eventReplaceEntryEnter) {
|
} else if ( _msg.GetMessage() == l_eventReplaceEntryEnter) {
|
||||||
SearchData::SetReplace(data);
|
SearchData::SetReplace(_msg.GetData());
|
||||||
SendMultiCast(ednMsgGuiReplace, "Normal");
|
SendMultiCast(ednMsgGuiReplace, "Normal");
|
||||||
if (true==m_forward) {
|
if (true==m_forward) {
|
||||||
SendMultiCast(ednMsgGuiFind, "Previous");
|
SendMultiCast(ednMsgGuiFind, "Previous");
|
||||||
} else {
|
} else {
|
||||||
SendMultiCast(ednMsgGuiFind, "Next");
|
SendMultiCast(ednMsgGuiFind, "Next");
|
||||||
}
|
}
|
||||||
} else if ( eventId == l_eventSearchBt) {
|
} else if ( _msg.GetMessage() == l_eventSearchBt) {
|
||||||
if (true==m_forward) {
|
if (true==m_forward) {
|
||||||
SendMultiCast(ednMsgGuiFind, "Previous");
|
SendMultiCast(ednMsgGuiFind, "Previous");
|
||||||
} else {
|
} else {
|
||||||
SendMultiCast(ednMsgGuiFind, "Next");
|
SendMultiCast(ednMsgGuiFind, "Next");
|
||||||
}
|
}
|
||||||
} else if ( eventId == l_eventReplaceBt) {
|
} else if ( _msg.GetMessage() == l_eventReplaceBt) {
|
||||||
SendMultiCast(ednMsgGuiReplace, "Normal");
|
SendMultiCast(ednMsgGuiReplace, "Normal");
|
||||||
if (true==m_forward) {
|
if (true==m_forward) {
|
||||||
SendMultiCast(ednMsgGuiFind, "Previous");
|
SendMultiCast(ednMsgGuiFind, "Previous");
|
||||||
} else {
|
} else {
|
||||||
SendMultiCast(ednMsgGuiFind, "Next");
|
SendMultiCast(ednMsgGuiFind, "Next");
|
||||||
}
|
}
|
||||||
} else if ( eventId == l_eventCaseCb) {
|
} else if ( _msg.GetMessage() == l_eventCaseCb) {
|
||||||
if (data == "1") {
|
if (_msg.GetData() == "1") {
|
||||||
SearchData::SetCase(false);
|
SearchData::SetCase(false);
|
||||||
} else {
|
} else {
|
||||||
SearchData::SetCase(true);
|
SearchData::SetCase(true);
|
||||||
}
|
}
|
||||||
} else if ( eventId == l_eventWrapCb) {
|
} else if ( _msg.GetMessage() == l_eventWrapCb) {
|
||||||
if (data == "1") {
|
if (_msg.GetData() == "1") {
|
||||||
SearchData::SetWrap(false);
|
SearchData::SetWrap(false);
|
||||||
} else {
|
} else {
|
||||||
SearchData::SetWrap(true);
|
SearchData::SetWrap(true);
|
||||||
}
|
}
|
||||||
} else if ( eventId == l_eventForwardCb) {
|
} else if ( _msg.GetMessage() == l_eventForwardCb) {
|
||||||
if (data == "1") {
|
if (_msg.GetData() == "1") {
|
||||||
m_forward = false;
|
m_forward = false;
|
||||||
} else {
|
} else {
|
||||||
m_forward = true;
|
m_forward = true;
|
||||||
}
|
}
|
||||||
} else if ( eventId == l_eventHideBt) {
|
} else if ( _msg.GetMessage() == l_eventHideBt) {
|
||||||
Hide();
|
Hide();
|
||||||
} else if ( eventId == ednMsgGuiSearch) {
|
} else if ( _msg.GetMessage() == ednMsgGuiSearch) {
|
||||||
if (true == IsHide()) {
|
if (true == IsHide()) {
|
||||||
Show();
|
Show();
|
||||||
if (m_searchEntry!= NULL) {
|
if (m_searchEntry!= NULL) {
|
||||||
@@ -221,19 +266,13 @@ void Search::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
void Search::OnObjectRemove(ewol::EObject * _removeObject)
|
||||||
* @brief Inform object that an other object is removed ...
|
|
||||||
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
|
|
||||||
* @note : Sub classes must call this class
|
|
||||||
* @return ---
|
|
||||||
*/
|
|
||||||
void Search::OnObjectRemove(ewol::EObject * removeObject)
|
|
||||||
{
|
{
|
||||||
widget::SizerHori::OnObjectRemove(removeObject);
|
widget::Sizer::OnObjectRemove(_removeObject);
|
||||||
if (removeObject == m_searchEntry) {
|
if (_removeObject == m_searchEntry) {
|
||||||
m_searchEntry = NULL;
|
m_searchEntry = NULL;
|
||||||
}
|
}
|
||||||
if (removeObject == m_replaceEntry) {
|
if (_removeObject == m_replaceEntry) {
|
||||||
m_replaceEntry = NULL;
|
m_replaceEntry = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -10,41 +10,23 @@
|
|||||||
#define __SEARCH_H__
|
#define __SEARCH_H__
|
||||||
|
|
||||||
#include <appl/Debug.h>
|
#include <appl/Debug.h>
|
||||||
#include <ewol/widget/SizerHori.h>
|
#include <ewol/widget/Sizer.h>
|
||||||
#include <ewol/widget/Entry.h>
|
#include <ewol/widget/Entry.h>
|
||||||
|
|
||||||
class Search : public widget::SizerHori
|
class Search : public widget::Sizer
|
||||||
{
|
{
|
||||||
public:
|
|
||||||
// Constructeur
|
|
||||||
Search(void);
|
|
||||||
~Search(void);
|
|
||||||
/**
|
|
||||||
* @brief Get the current Object type of the EObject
|
|
||||||
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
|
|
||||||
* @param[in] objectType type description
|
|
||||||
* @return true if the object is compatible, otherwise false
|
|
||||||
*/
|
|
||||||
const char * const GetObjectType(void) { return "ApplSearch"; };
|
|
||||||
/**
|
|
||||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
|
||||||
* @param[in] CallerObject Pointer on the EObject that information came from
|
|
||||||
* @param[in] eventId Message registered by this class
|
|
||||||
* @param[in] data Data registered by this class
|
|
||||||
* @return ---
|
|
||||||
*/
|
|
||||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
|
|
||||||
/**
|
|
||||||
* @brief Inform object that an other object is removed ...
|
|
||||||
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
|
|
||||||
* @note : Sub classes must call this class
|
|
||||||
* @return ---
|
|
||||||
*/
|
|
||||||
virtual void OnObjectRemove(ewol::EObject * removeObject);
|
|
||||||
private:
|
private:
|
||||||
bool m_forward;
|
bool m_forward;
|
||||||
widget::Entry * m_searchEntry;
|
widget::Entry * m_searchEntry;
|
||||||
widget::Entry * m_replaceEntry;
|
widget::Entry * m_replaceEntry;
|
||||||
|
public:
|
||||||
|
// Constructeur
|
||||||
|
Search(void);
|
||||||
|
~Search(void);
|
||||||
|
public: // derived function
|
||||||
|
virtual const char * const GetObjectType(void) { return "ApplSearch"; };
|
||||||
|
virtual void OnReceiveMessage(const ewol::EMessage& _msg);
|
||||||
|
virtual void OnObjectRemove(ewol::EObject * _removeObject);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
static etk::UString m_findRequest = "";
|
static etk::UString m_findRequest = "";
|
||||||
|
|
||||||
void SearchData::SetSearch(etk::UString &myData)
|
void SearchData::SetSearch(const etk::UString &myData)
|
||||||
{
|
{
|
||||||
m_findRequest = myData;
|
m_findRequest = myData;
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,7 @@ bool SearchData::IsSearchEmpty(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static etk::UString m_replaceRequest = "";
|
static etk::UString m_replaceRequest = "";
|
||||||
void SearchData::SetReplace(etk::UString &myData)
|
void SearchData::SetReplace(const etk::UString &myData)
|
||||||
{
|
{
|
||||||
m_replaceRequest = myData;
|
m_replaceRequest = myData;
|
||||||
}
|
}
|
||||||
|
@@ -14,10 +14,10 @@
|
|||||||
|
|
||||||
namespace SearchData
|
namespace SearchData
|
||||||
{
|
{
|
||||||
void SetSearch(etk::UString &myData);
|
void SetSearch(const etk::UString &myData);
|
||||||
void GetSearch(etk::UString &myData);
|
void GetSearch(etk::UString &myData);
|
||||||
bool IsSearchEmpty(void);
|
bool IsSearchEmpty(void);
|
||||||
void SetReplace(etk::UString &myData);
|
void SetReplace(const etk::UString &myData);
|
||||||
void GetReplace(etk::UString &myData);
|
void GetReplace(etk::UString &myData);
|
||||||
bool IsReplaceEmpty(void);
|
bool IsReplaceEmpty(void);
|
||||||
void SetCase(bool value);
|
void SetCase(bool value);
|
||||||
|
@@ -36,16 +36,15 @@ appl::TagFileList::~TagFileList(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
draw::Color appl::TagFileList::GetBasicBG(void) {
|
etk::Color<> appl::TagFileList::GetBasicBG(void) {
|
||||||
draw::Color bg(0x00000010);
|
return 0x00000010;
|
||||||
return bg;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t appl::TagFileList::GetNuberOfColomn(void) {
|
uint32_t appl::TagFileList::GetNuberOfColomn(void) {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool appl::TagFileList::GetTitle(int32_t colomn, etk::UString &myTitle, draw::Color &fg, draw::Color &bg) {
|
bool appl::TagFileList::GetTitle(int32_t colomn, etk::UString &myTitle, etk::Color<> &fg, etk::Color<> &bg) {
|
||||||
myTitle = "title";
|
myTitle = "title";
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -54,7 +53,7 @@ uint32_t appl::TagFileList::GetNuberOfRaw(void) {
|
|||||||
return m_list.Size();
|
return m_list.Size();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool appl::TagFileList::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg) {
|
bool appl::TagFileList::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color<> &fg, etk::Color<> &bg) {
|
||||||
if (raw >= 0 && raw < m_list.Size() && NULL != m_list[raw]) {
|
if (raw >= 0 && raw < m_list.Size() && NULL != m_list[raw]) {
|
||||||
if (0==colomn) {
|
if (0==colomn) {
|
||||||
myTextToWrite = etk::UString(m_list[raw]->fileLine);
|
myTextToWrite = etk::UString(m_list[raw]->fileLine);
|
||||||
@@ -64,7 +63,7 @@ bool appl::TagFileList::GetElement(int32_t colomn, int32_t raw, etk::UString &my
|
|||||||
} else {
|
} else {
|
||||||
myTextToWrite = "ERROR";
|
myTextToWrite = "ERROR";
|
||||||
}
|
}
|
||||||
fg = draw::color::black;
|
fg = etk::color::black;
|
||||||
if (raw % 2) {
|
if (raw % 2) {
|
||||||
if (colomn%2==0) {
|
if (colomn%2==0) {
|
||||||
bg = 0xFFFFFF00;
|
bg = 0xFFFFFF00;
|
||||||
|
@@ -34,25 +34,19 @@ namespace appl {
|
|||||||
TagFileList(void);
|
TagFileList(void);
|
||||||
~TagFileList(void);
|
~TagFileList(void);
|
||||||
// display API :
|
// display API :
|
||||||
virtual draw::Color GetBasicBG(void);
|
virtual etk::Color<> GetBasicBG(void);
|
||||||
uint32_t GetNuberOfColomn(void);
|
uint32_t GetNuberOfColomn(void);
|
||||||
bool GetTitle(int32_t colomn, etk::UString &myTitle, draw::Color &fg, draw::Color &bg);
|
bool GetTitle(int32_t colomn, etk::UString &myTitle, etk::Color<> &fg, etk::Color<> &bg);
|
||||||
uint32_t GetNuberOfRaw(void);
|
uint32_t GetNuberOfRaw(void);
|
||||||
bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg);
|
bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color<> &fg, etk::Color<> &bg);
|
||||||
bool OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEvent, int32_t colomn, int32_t raw, float x, float y);
|
bool OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEvent, int32_t colomn, int32_t raw, float x, float y);
|
||||||
/**
|
// derived function
|
||||||
* @brief Get the current Object type of the EObject
|
|
||||||
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
|
|
||||||
* @param[in] objectType type description
|
|
||||||
* @return true if the object is compatible, otherwise false
|
|
||||||
*/
|
|
||||||
const char * const GetObjectType(void) { return "TagFileList"; };
|
const char * const GetObjectType(void) { return "TagFileList"; };
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Add a Ctags item on the curent list
|
* @brief Add a Ctags item on the curent list
|
||||||
* @param[in] file Compleate file name
|
* @param[in] file Compleate file name
|
||||||
* @param[in] jump line id
|
* @param[in] jump line id
|
||||||
* @return ---
|
|
||||||
*/
|
*/
|
||||||
void Add(etk::UString& file, int32_t line);
|
void Add(etk::UString& file, int32_t line);
|
||||||
};
|
};
|
||||||
|
@@ -7,8 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <appl/Gui/TagFileSelection.h>
|
#include <appl/Gui/TagFileSelection.h>
|
||||||
#include <ewol/widget/SizerHori.h>
|
#include <ewol/widget/Sizer.h>
|
||||||
#include <ewol/widget/SizerVert.h>
|
|
||||||
#include <ewol/widget/List.h>
|
#include <ewol/widget/List.h>
|
||||||
#include <ewol/widget/Spacer.h>
|
#include <ewol/widget/Spacer.h>
|
||||||
#include <ewol/widget/Image.h>
|
#include <ewol/widget/Image.h>
|
||||||
@@ -17,6 +16,7 @@
|
|||||||
#include <etk/tool.h>
|
#include <etk/tool.h>
|
||||||
#include <ewol/widget/Button.h>
|
#include <ewol/widget/Button.h>
|
||||||
#include <ewol/widget/Label.h>
|
#include <ewol/widget/Label.h>
|
||||||
|
#include <ewol/widget/Composer.h>
|
||||||
|
|
||||||
#include <ewol/ewol.h>
|
#include <ewol/ewol.h>
|
||||||
|
|
||||||
@@ -39,26 +39,26 @@ appl::TagFileSelection::TagFileSelection(void)
|
|||||||
widget::Button* myWidgetValidate = NULL;
|
widget::Button* myWidgetValidate = NULL;
|
||||||
widget::Button* myWidgetCancel = NULL;
|
widget::Button* myWidgetCancel = NULL;
|
||||||
|
|
||||||
widget::SizerVert * mySizerVert = NULL;
|
widget::Sizer * mySizerVert = NULL;
|
||||||
widget::SizerHori * mySizerHori = NULL;
|
widget::Sizer * mySizerHori = NULL;
|
||||||
widget::Spacer * mySpacer = NULL;
|
widget::Spacer * mySpacer = NULL;
|
||||||
#if defined(__TARGET_OS__Android)
|
#if defined(__TARGET_OS__Android)
|
||||||
SetDisplayRatio(0.90);
|
SetMinSize(ewol::Dimension(vec2(90,90),ewol::Dimension::Pourcent));
|
||||||
#elif defined(__TARGET_OS__Windows)
|
#elif defined(__TARGET_OS__Windows)
|
||||||
SetDisplayRatio(0.80);
|
SetMinSize(ewol::Dimension(vec2(80,80),ewol::Dimension::Pourcent));
|
||||||
#else
|
#else
|
||||||
SetDisplayRatio(0.80);
|
SetMinSize(ewol::Dimension(vec2(80,80),ewol::Dimension::Pourcent));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mySizerVert = new widget::SizerVert();
|
mySizerVert = new widget::Sizer(widget::Sizer::modeVert);
|
||||||
if (NULL == mySizerVert) {
|
if (NULL == mySizerVert) {
|
||||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||||
} else {
|
} else {
|
||||||
mySizerVert->LockExpendContamination(true);
|
mySizerVert->LockExpand(bvec2(true,true));
|
||||||
// set it in the pop-up-system :
|
// set it in the pop-up-system :
|
||||||
SubWidgetSet(mySizerVert);
|
SetSubWidget(mySizerVert);
|
||||||
|
|
||||||
mySizerHori = new widget::SizerHori();
|
mySizerHori = new widget::Sizer(widget::Sizer::modeHori);
|
||||||
if (NULL == mySizerHori) {
|
if (NULL == mySizerHori) {
|
||||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||||
} else {
|
} else {
|
||||||
@@ -67,23 +67,38 @@ appl::TagFileSelection::TagFileSelection(void)
|
|||||||
if (NULL == mySpacer) {
|
if (NULL == mySpacer) {
|
||||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||||
} else {
|
} else {
|
||||||
mySpacer->SetExpendX(true);
|
mySpacer->SetExpand(bvec2(true,false));
|
||||||
mySizerHori->SubWidgetAdd(mySpacer);
|
mySizerHori->SubWidgetAdd(mySpacer);
|
||||||
}
|
}
|
||||||
myWidgetValidate = new widget::Button("Jump");
|
myWidgetValidate = new widget::Button();
|
||||||
if (NULL == myWidgetValidate) {
|
if (NULL == myWidgetValidate) {
|
||||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||||
} else {
|
} else {
|
||||||
myWidgetValidate->SetImage("icon/Load.svg");
|
myWidgetValidate->SetSubWidget(
|
||||||
myWidgetValidate->RegisterOnEvent(this, ewolEventButtonPressed, applEventctagsSelection);
|
new widget::Composer(widget::Composer::String,
|
||||||
|
"<composer>\n"
|
||||||
|
" <sizer mode=\"hori\">\n"
|
||||||
|
" <image src=\"THEME:GUI:icon/Load.svg\" fill=\"true\" size=\"70,70mm\"/>\n"
|
||||||
|
" <label>Jump</label>\n"
|
||||||
|
" </sizer>\n"
|
||||||
|
"</composer\n"));
|
||||||
|
|
||||||
|
myWidgetValidate->RegisterOnEvent(this, widget::Button::eventPressed, applEventctagsSelection);
|
||||||
mySizerHori->SubWidgetAdd(myWidgetValidate);
|
mySizerHori->SubWidgetAdd(myWidgetValidate);
|
||||||
}
|
}
|
||||||
myWidgetCancel = new widget::Button("Cancel");
|
myWidgetCancel = new widget::Button();
|
||||||
if (NULL == myWidgetCancel) {
|
if (NULL == myWidgetCancel) {
|
||||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||||
} else {
|
} else {
|
||||||
myWidgetCancel->SetImage("icon/Remove.svg");
|
myWidgetCancel->SetSubWidget(
|
||||||
myWidgetCancel->RegisterOnEvent(this, ewolEventButtonPressed, applEventctagsCancel);
|
new widget::Composer(widget::Composer::String,
|
||||||
|
"<composer>\n"
|
||||||
|
" <sizer mode=\"hori\">\n"
|
||||||
|
" <image src=\"THEME:GUI:icon/Remove.svg\" fill=\"true\" size=\"70,70mm\"/>\n"
|
||||||
|
" <label>Cancel</label>\n"
|
||||||
|
" </sizer>\n"
|
||||||
|
"</composer\n"));
|
||||||
|
myWidgetCancel->RegisterOnEvent(this, widget::Button::eventPressed, applEventctagsCancel);
|
||||||
mySizerHori->SubWidgetAdd(myWidgetCancel);
|
mySizerHori->SubWidgetAdd(myWidgetCancel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -94,10 +109,8 @@ appl::TagFileSelection::TagFileSelection(void)
|
|||||||
m_listTag->RegisterOnEvent(this, applEventCtagsListValidate);
|
m_listTag->RegisterOnEvent(this, applEventCtagsListValidate);
|
||||||
m_listTag->RegisterOnEvent(this, applEventCtagsListSelect);
|
m_listTag->RegisterOnEvent(this, applEventCtagsListSelect);
|
||||||
m_listTag->RegisterOnEvent(this, applEventCtagsListUnSelect);
|
m_listTag->RegisterOnEvent(this, applEventCtagsListUnSelect);
|
||||||
m_listTag->SetExpendX(true);
|
m_listTag->SetExpand(bvec2(true,true));
|
||||||
m_listTag->SetExpendY(true);
|
m_listTag->SetFill(bvec2(true,true));
|
||||||
m_listTag->SetFillX(true);
|
|
||||||
m_listTag->SetFillY(true);
|
|
||||||
mySizerVert->SubWidgetAdd(m_listTag);
|
mySizerVert->SubWidgetAdd(m_listTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,33 +129,25 @@ appl::TagFileSelection::~TagFileSelection(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void appl::TagFileSelection::OnReceiveMessage(const ewol::EMessage& _msg)
|
||||||
/**
|
|
||||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
|
||||||
* @param[in] CallerObject Pointer on the EObject that information came from
|
|
||||||
* @param[in] eventId Message registered by this class
|
|
||||||
* @param[in] data Data registered by this class
|
|
||||||
* @return ---
|
|
||||||
*/
|
|
||||||
void appl::TagFileSelection::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
|
||||||
{
|
{
|
||||||
EWOL_INFO("ctags LIST ... : \"" << eventId << "\" ==> data=\"" << data << "\"" );
|
EWOL_INFO("ctags LIST ... : \"" << _msg.GetMessage() << "\" ==> data=\"" << _msg.GetData() << "\"" );
|
||||||
if (eventId == applEventctagsSelection) {
|
if (_msg.GetMessage() == applEventctagsSelection) {
|
||||||
if (m_eventNamed!="") {
|
if (m_eventNamed!="") {
|
||||||
GenerateEventId(applEventctagsSelection, m_eventNamed);
|
GenerateEventId(applEventctagsSelection, m_eventNamed);
|
||||||
//==> Auto remove ...
|
//==> Auto remove ...
|
||||||
AutoDestroy();
|
AutoDestroy();
|
||||||
}
|
}
|
||||||
} else if (eventId == applEventCtagsListSelect) {
|
} else if (_msg.GetMessage() == applEventCtagsListSelect) {
|
||||||
m_eventNamed = data;
|
m_eventNamed = _msg.GetData();
|
||||||
|
|
||||||
} else if (eventId == applEventCtagsListUnSelect) {
|
} else if (_msg.GetMessage() == applEventCtagsListUnSelect) {
|
||||||
m_eventNamed = "";
|
m_eventNamed = "";
|
||||||
} else if (eventId == applEventCtagsListValidate) {
|
} else if (_msg.GetMessage() == applEventCtagsListValidate) {
|
||||||
GenerateEventId(applEventctagsSelection, data);
|
GenerateEventId(applEventctagsSelection, _msg.GetData());
|
||||||
//==> Auto remove ...
|
//==> Auto remove ...
|
||||||
AutoDestroy();
|
AutoDestroy();
|
||||||
} else if (eventId == applEventctagsCancel) {
|
} else if (_msg.GetMessage() == applEventctagsCancel) {
|
||||||
GenerateEventId(applEventctagsCancel, "");
|
GenerateEventId(applEventctagsCancel, "");
|
||||||
//==> Auto remove ...
|
//==> Auto remove ...
|
||||||
AutoDestroy();
|
AutoDestroy();
|
||||||
@@ -155,7 +160,6 @@ void appl::TagFileSelection::OnReceiveMessage(ewol::EObject * CallerObject, cons
|
|||||||
* @brief Add a Ctags item on the curent list
|
* @brief Add a Ctags item on the curent list
|
||||||
* @param[in] file Compleate file name
|
* @param[in] file Compleate file name
|
||||||
* @param[in] jump line id
|
* @param[in] jump line id
|
||||||
* @return ---
|
|
||||||
*/
|
*/
|
||||||
void appl::TagFileSelection::AddCtagsNewItem(etk::UString file, int32_t line)
|
void appl::TagFileSelection::AddCtagsNewItem(etk::UString file, int32_t line)
|
||||||
{
|
{
|
||||||
@@ -164,19 +168,12 @@ void appl::TagFileSelection::AddCtagsNewItem(etk::UString file, int32_t line)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void appl::TagFileSelection::OnObjectRemove(ewol::EObject * _removeObject)
|
||||||
/**
|
|
||||||
* @brief Inform object that an other object is removed ...
|
|
||||||
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
|
|
||||||
* @note : Sub classes must call this class
|
|
||||||
* @return ---
|
|
||||||
*/
|
|
||||||
void appl::TagFileSelection::OnObjectRemove(ewol::EObject * removeObject)
|
|
||||||
{
|
{
|
||||||
// First step call parrent :
|
// First step call parrent :
|
||||||
widget::PopUp::OnObjectRemove(m_listTag);
|
widget::PopUp::OnObjectRemove(_removeObject);
|
||||||
// second step find if in all the elements ...
|
// second step find if in all the elements ...
|
||||||
if(removeObject == m_listTag) {
|
if(_removeObject == m_listTag) {
|
||||||
m_listTag = NULL;
|
m_listTag = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,36 +25,16 @@ namespace appl {
|
|||||||
public:
|
public:
|
||||||
TagFileSelection(void);
|
TagFileSelection(void);
|
||||||
virtual ~TagFileSelection(void);
|
virtual ~TagFileSelection(void);
|
||||||
/**
|
|
||||||
* @brief Get the current Object type of the EObject
|
|
||||||
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
|
|
||||||
* @param[in] objectType type description
|
|
||||||
* @return true if the object is compatible, otherwise false
|
|
||||||
*/
|
|
||||||
const char * const GetObjectType(void) { return "EwolFileChooser"; };
|
|
||||||
/**
|
|
||||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
|
||||||
* @param[in] CallerObject Pointer on the EObject that information came from
|
|
||||||
* @param[in] eventId Message registered by this class
|
|
||||||
* @param[in] data Data registered by this class
|
|
||||||
* @return ---
|
|
||||||
*/
|
|
||||||
void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
|
|
||||||
/**
|
|
||||||
* @brief Inform object that an other object is removed ...
|
|
||||||
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
|
|
||||||
* @note : Sub classes must call this class
|
|
||||||
* @return ---
|
|
||||||
*/
|
|
||||||
void OnObjectRemove(ewol::EObject * removeObject);
|
|
||||||
/**
|
/**
|
||||||
* @brief Add a Ctags item on the curent list
|
* @brief Add a Ctags item on the curent list
|
||||||
* @param[in] file Compleate file name
|
* @param[in] file Compleate file name
|
||||||
* @param[in] jump line id
|
* @param[in] jump line id
|
||||||
* @return ---
|
|
||||||
*/
|
*/
|
||||||
void AddCtagsNewItem(etk::UString file, int32_t line);
|
void AddCtagsNewItem(etk::UString file, int32_t line);
|
||||||
|
public: // herited function
|
||||||
|
const char * const GetObjectType(void) { return "EwolFileChooser"; };
|
||||||
|
void OnReceiveMessage(const ewol::EMessage& _msg);
|
||||||
|
void OnObjectRemove(ewol::EObject * _removeObject);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -9,14 +9,14 @@
|
|||||||
#include <appl/Debug.h>
|
#include <appl/Debug.h>
|
||||||
#include <appl/global.h>
|
#include <appl/global.h>
|
||||||
#include <Highlight.h>
|
#include <Highlight.h>
|
||||||
#include <tinyXML/tinyxml.h>
|
#include <exml/exml.h>
|
||||||
|
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "Highlight"
|
#define __class__ "Highlight"
|
||||||
|
|
||||||
|
|
||||||
void Highlight::ParseRules(TiXmlNode *child, etk::Vector<HighlightPattern*> &mListPatern, int32_t level)
|
void Highlight::ParseRules(exml::Element* child, etk::Vector<HighlightPattern*> &mListPatern, int32_t level)
|
||||||
{
|
{
|
||||||
// Create the patern ...
|
// Create the patern ...
|
||||||
HighlightPattern *myPattern = new HighlightPattern();
|
HighlightPattern *myPattern = new HighlightPattern();
|
||||||
@@ -28,99 +28,62 @@ void Highlight::ParseRules(TiXmlNode *child, etk::Vector<HighlightPattern*> &mLi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Highlight::Highlight(etk::UString &xmlFilename)
|
Highlight::Highlight(const etk::UString& _xmlFilename)
|
||||||
{
|
{
|
||||||
TiXmlDocument XmlDocument;
|
exml::Document doc;
|
||||||
|
if (doc.Load(_xmlFilename)==false) {
|
||||||
etk::FSNode fileName(etk::UString("DATA:") + xmlFilename);
|
APPL_ERROR(" can not load file XML : " << _xmlFilename);
|
||||||
if (false == fileName.Exist()) {
|
|
||||||
APPL_ERROR("File Does not exist : " << fileName);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int32_t fileSize = fileName.FileSize();
|
exml::Element* root = (exml::Element*)doc.GetNamed("EdnLang");
|
||||||
if (0==fileSize) {
|
|
||||||
APPL_ERROR("This file is empty : " << fileName);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (false == fileName.FileOpenRead()) {
|
|
||||||
APPL_ERROR("Can not open the file : " << fileName);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// allocate data
|
|
||||||
char * fileBuffer = new char[fileSize+5];
|
|
||||||
if (NULL == fileBuffer) {
|
|
||||||
APPL_ERROR("Error Memory allocation size=" << fileSize);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
|
|
||||||
// load data from the file :
|
|
||||||
fileName.FileRead(fileBuffer, 1, fileSize);
|
|
||||||
// close the file:
|
|
||||||
fileName.FileClose();
|
|
||||||
// load the XML from the memory
|
|
||||||
bool loadError = XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8);
|
|
||||||
if (false == loadError) {
|
|
||||||
APPL_ERROR( "can not load Hightlight XML: PARSING error: \"" << xmlFilename << "\"");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
TiXmlElement* root = XmlDocument.FirstChildElement( "EdnLang" );
|
|
||||||
if (NULL == root ) {
|
if (NULL == root ) {
|
||||||
APPL_ERROR( "can not load Hightlight XML: main node not find: \"EdnLang\"");
|
APPL_ERROR("(l ?) main node not find: \"EdnLang\" ...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t level1 = 0;
|
int32_t level1 = 0;
|
||||||
int32_t level2 = 0;
|
int32_t level2 = 0;
|
||||||
TiXmlNode * child = root->FirstChild();
|
// parse all the elements :
|
||||||
while(NULL != child)
|
for(int32_t iii=0; iii< root->Size(); iii++) {
|
||||||
{
|
exml::Element* child = root->GetElement(iii);
|
||||||
if (child->Type()==TiXmlNode::TINYXML_COMMENT) {
|
if (child==NULL) {
|
||||||
// nothing to do ...
|
// trash here all that is not element ...
|
||||||
} else if (!strcmp(child->Value(), "ext")) {
|
continue;
|
||||||
const char *myData = child->ToElement()->GetText();
|
}
|
||||||
if (NULL != myData) {
|
if (child->GetValue() == "ext") {
|
||||||
|
etk::UString myData = child->GetText();
|
||||||
|
if (myData.Size()!=0) {
|
||||||
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", child->Row(), child->Value() , myData);
|
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", child->Row(), child->Value() , myData);
|
||||||
etk::UString * myEdnData = new etk::UString(myData);
|
m_listExtentions.PushBack(myData);
|
||||||
m_listExtentions.PushBack(myEdnData);
|
|
||||||
}
|
}
|
||||||
} else if (!strcmp(child->Value(), "pass1")) {
|
} else if (child->GetValue()=="pass1") {
|
||||||
// Get sub Nodes ...
|
// Get sub Nodes ...
|
||||||
TiXmlNode *passChild = child->FirstChild();
|
for(int32_t jjj=0; jjj< child->Size(); jjj++) {
|
||||||
while (NULL != passChild) {
|
exml::Element* passChild = child->GetElement(jjj);
|
||||||
if (passChild->Type()==TiXmlNode::TINYXML_COMMENT) {
|
if (passChild==NULL) {
|
||||||
// nothing to do ...
|
continue;
|
||||||
} else if (!strcmp(passChild->Value(), "rule")) {
|
}
|
||||||
|
if (passChild->GetValue() != "rule") {
|
||||||
|
APPL_ERROR("(l "<< passChild->GetPos() << ") node not suported : \""<< passChild->GetValue() << "\" must be [rule]" );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
ParseRules(passChild, m_listHighlightPass1, level1++);
|
ParseRules(passChild, m_listHighlightPass1, level1++);
|
||||||
} else {
|
|
||||||
APPL_ERROR("(l "<< passChild->Row() << ") node not suported : \""<< passChild->Value() << "\" must be [rule]" );
|
|
||||||
}
|
}
|
||||||
// get the next node element :
|
} else if (child->GetValue() == "pass2") {
|
||||||
passChild = passChild->NextSibling();
|
|
||||||
}
|
|
||||||
} else if (!strcmp(child->Value(), "pass2")) {
|
|
||||||
// Get sub Nodes ...
|
// Get sub Nodes ...
|
||||||
TiXmlNode *passChild = child->FirstChild();
|
for(int32_t jjj=0; jjj< child->Size(); jjj++) {
|
||||||
while (NULL != passChild) {
|
exml::Element* passChild = child->GetElement(jjj);
|
||||||
if (passChild->Type()==TiXmlNode::TINYXML_COMMENT) {
|
if (passChild==NULL) {
|
||||||
// nothing to do ...
|
continue;
|
||||||
} else if (!strcmp(passChild->Value(), "rule")) {
|
}
|
||||||
|
if (passChild->GetValue() != "rule") {
|
||||||
|
APPL_ERROR("(l "<< passChild->GetPos() << ") node not suported : \""<< passChild->GetValue() << "\" must be [rule]" );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
ParseRules(passChild, m_listHighlightPass2, level2++);
|
ParseRules(passChild, m_listHighlightPass2, level2++);
|
||||||
} else {
|
|
||||||
APPL_ERROR("(l "<< passChild->Row() << ") node not suported : \""<< passChild->Value() << "\" must be [rule]" );
|
|
||||||
}
|
|
||||||
// get the next node element :
|
|
||||||
passChild = passChild->NextSibling();
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
APPL_ERROR("(l "<< child->Row() << ") node not suported : \""<< child->Value() << "\" must be [ext,pass1,pass2]" );
|
APPL_ERROR("(l "<< child->GetPos() << ") node not suported : \""<< child->GetValue() << "\" must be [ext,pass1,pass2]" );
|
||||||
}
|
}
|
||||||
// get the next node element :
|
|
||||||
child = child->NextSibling();
|
|
||||||
}
|
|
||||||
if (NULL != fileBuffer) {
|
|
||||||
delete[] fileBuffer;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,14 +99,6 @@ Highlight::~Highlight(void)
|
|||||||
}
|
}
|
||||||
// clear the compleate list
|
// clear the compleate list
|
||||||
m_listHighlightPass1.Clear();
|
m_listHighlightPass1.Clear();
|
||||||
|
|
||||||
// clean all Element
|
|
||||||
for (i=0; i< m_listExtentions.Size(); i++) {
|
|
||||||
if (NULL != m_listExtentions[i]) {
|
|
||||||
delete(m_listExtentions[i]);
|
|
||||||
m_listExtentions[i] = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// clear the compleate list
|
// clear the compleate list
|
||||||
m_listExtentions.Clear();
|
m_listExtentions.Clear();
|
||||||
}
|
}
|
||||||
@@ -163,31 +118,29 @@ void Highlight::ReloadColor(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Highlight::HasExtention(etk::UString &ext)
|
bool Highlight::HasExtention(const etk::UString& _ext)
|
||||||
{
|
{
|
||||||
int32_t i;
|
for (int32_t iii=0; iii<m_listExtentions.Size(); iii++) {
|
||||||
for (i=0; i<m_listExtentions.Size(); i++) {
|
if (_ext == m_listExtentions[iii] ) {
|
||||||
if (ext == *m_listExtentions[i] ) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Highlight::FileNameCompatible(etk::FSNode &fileName)
|
bool Highlight::FileNameCompatible(etk::FSNode &_fileName)
|
||||||
{
|
{
|
||||||
int32_t i;
|
|
||||||
etk::UString extention;
|
etk::UString extention;
|
||||||
if (true == fileName.FileHasExtention() ) {
|
if (true == _fileName.FileHasExtention() ) {
|
||||||
extention = "*.";
|
extention = "*.";
|
||||||
extention += fileName.FileGetExtention();
|
extention += _fileName.FileGetExtention();
|
||||||
} else {
|
} else {
|
||||||
extention = fileName.GetNameFile();
|
extention = _fileName.GetNameFile();
|
||||||
}
|
}
|
||||||
APPL_DEBUG(" try to find : in \"" << fileName << "\" extention:\"" << extention << "\" ");
|
APPL_DEBUG(" try to find : in \"" << _fileName << "\" extention:\"" << extention << "\" ");
|
||||||
|
|
||||||
for (i=0; i<m_listExtentions.Size(); i++) {
|
for (int32_t iii=0; iii<m_listExtentions.Size(); iii++) {
|
||||||
if (extention == *m_listExtentions[i] ) {
|
if (extention == m_listExtentions[iii] ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -197,19 +150,18 @@ bool Highlight::FileNameCompatible(etk::FSNode &fileName)
|
|||||||
|
|
||||||
void Highlight::Display(void)
|
void Highlight::Display(void)
|
||||||
{
|
{
|
||||||
int32_t i;
|
|
||||||
APPL_INFO("List of ALL Highlight : ");
|
APPL_INFO("List of ALL Highlight : ");
|
||||||
for (i=0; i< m_listExtentions.Size(); i++) {
|
for (int32_t iii=0; iii< m_listExtentions.Size(); iii++) {
|
||||||
APPL_INFO(" Extention : " << i << " : " << *m_listExtentions[i] );
|
APPL_INFO(" Extention : " << iii << " : " << m_listExtentions[iii] );
|
||||||
}
|
}
|
||||||
// Display all elements
|
// Display all elements
|
||||||
for (i=0; i< m_listHighlightPass1.Size(); i++) {
|
for (int32_t iii=0; iii< m_listHighlightPass1.Size(); iii++) {
|
||||||
APPL_INFO(" " << i << " Pass 1 : " << m_listHighlightPass1[i]->GetName() );
|
APPL_INFO(" " << iii << " Pass 1 : " << m_listHighlightPass1[iii]->GetName() );
|
||||||
//m_listHighlightPass1[i]->Display();
|
//m_listHighlightPass1[i]->Display();
|
||||||
}
|
}
|
||||||
// Display all elements
|
// Display all elements
|
||||||
for (i=0; i< m_listHighlightPass2.Size(); i++) {
|
for (int32_t iii=0; iii< m_listHighlightPass2.Size(); iii++) {
|
||||||
APPL_INFO(" " << i << " Pass 2 : " << m_listHighlightPass2[i]->GetName() );
|
APPL_INFO(" " << iii << " Pass 2 : " << m_listHighlightPass2[iii]->GetName() );
|
||||||
//m_listHighlightPass2[i]->Display();
|
//m_listHighlightPass2[i]->Display();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -29,15 +29,15 @@ extern "C" {
|
|||||||
#include <HighlightPattern.h>
|
#include <HighlightPattern.h>
|
||||||
#include <Colorize.h>
|
#include <Colorize.h>
|
||||||
#include <etk/Buffer.h>
|
#include <etk/Buffer.h>
|
||||||
#include <tinyXML/tinyxml.h>
|
#include <exml/exml.h>
|
||||||
|
|
||||||
class Highlight {
|
class Highlight {
|
||||||
public:
|
public:
|
||||||
// Constructeur
|
// Constructeur
|
||||||
Highlight(etk::UString &xmlFilename);
|
Highlight(const etk::UString& _xmlFilename);
|
||||||
~Highlight(void);
|
~Highlight(void);
|
||||||
bool HasExtention(etk::UString &ext);
|
bool HasExtention(const etk::UString& _ext);
|
||||||
bool FileNameCompatible(etk::FSNode &fileName);
|
bool FileNameCompatible(etk::FSNode &_fileName);
|
||||||
void Display(void);
|
void Display(void);
|
||||||
void ReloadColor(void);
|
void ReloadColor(void);
|
||||||
void Parse(int32_t start,
|
void Parse(int32_t start,
|
||||||
@@ -50,9 +50,9 @@ class Highlight {
|
|||||||
etk::Vector<colorInformation_ts> &metaData,
|
etk::Vector<colorInformation_ts> &metaData,
|
||||||
etk::Buffer &buffer);
|
etk::Buffer &buffer);
|
||||||
private:
|
private:
|
||||||
void ParseRules(TiXmlNode *child, etk::Vector<HighlightPattern*> &mListPatern, int32_t level);
|
void ParseRules(exml::Element* child, etk::Vector<HighlightPattern*> &mListPatern, int32_t level);
|
||||||
etk::UString m_styleName; //!< curent style name (like "c++" or "c" or "script Bash")
|
etk::UString m_styleName; //!< curent style name (like "c++" or "c" or "script Bash")
|
||||||
etk::Vector<etk::UString*> m_listExtentions; //!< List of possible extention for this high-light, like : ".c", ".cpp", ".h"
|
etk::Vector<etk::UString> m_listExtentions; //!< List of possible extention for this high-light, like : ".c", ".cpp", ".h"
|
||||||
etk::Vector<HighlightPattern*> m_listHighlightPass1; //!< List of ALL hightlight modules (pass 1 ==> when we load and wride data on the buffer)
|
etk::Vector<HighlightPattern*> m_listHighlightPass1; //!< List of ALL hightlight modules (pass 1 ==> when we load and wride data on the buffer)
|
||||||
etk::Vector<HighlightPattern*> m_listHighlightPass2; //!< List of ALL hightlight modules (pass 2 ==> When we display the buffer( only the display area (100 lines)) )
|
etk::Vector<HighlightPattern*> m_listHighlightPass2; //!< List of ALL hightlight modules (pass 2 ==> When we display the buffer( only the display area (100 lines)) )
|
||||||
};
|
};
|
||||||
|
@@ -9,8 +9,8 @@
|
|||||||
#include <appl/Debug.h>
|
#include <appl/Debug.h>
|
||||||
#include <appl/global.h>
|
#include <appl/global.h>
|
||||||
#include <HighlightManager.h>
|
#include <HighlightManager.h>
|
||||||
#include <ewol/eObject/EObject.h>
|
#include <ewol/renderer/EObject.h>
|
||||||
#include <ewol/eObject/EObjectManager.h>
|
#include <ewol/renderer/EObjectManager.h>
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "HighlightManager"
|
#define __class__ "HighlightManager"
|
||||||
@@ -37,25 +37,14 @@ class localClassHighlightManager: public ewol::EObject
|
|||||||
listHighlight.Clear();
|
listHighlight.Clear();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
// herited function
|
||||||
* @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)
|
const char * const GetObjectType(void)
|
||||||
{
|
{
|
||||||
return "ApplHighlightManager";
|
return "ApplHighlightManager";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// herited function
|
||||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
virtual void OnReceiveMessage(const ewol::EMessage& _msg)
|
||||||
* @param[in] CallerObject Pointer on the EObject that information came from
|
|
||||||
* @param[in] eventId Message registered by this class
|
|
||||||
* @param[in] data Data registered by this class
|
|
||||||
* @return ---
|
|
||||||
*/
|
|
||||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
switch (id)
|
switch (id)
|
||||||
@@ -94,61 +83,24 @@ class localClassHighlightManager: public ewol::EObject
|
|||||||
|
|
||||||
void loadLanguages(void)
|
void loadLanguages(void)
|
||||||
{
|
{
|
||||||
etk::UString xmlFilename = "languages/c/highlight.xml";
|
etk::FSNode myFile("DATA:languages/");
|
||||||
Highlight *myHightline = new Highlight(xmlFilename);
|
// get the subfolder list :
|
||||||
|
etk::Vector<etk::FSNode *> list = myFile.FolderGetSubList(false, true, false,false);
|
||||||
|
for ( int32_t iii=0 ; iii<list.Size() ; iii++ ) {
|
||||||
|
if (NULL!=list[iii]) {
|
||||||
|
if (list[iii]->GetNodeType()==etk::FSN_FOLDER) {
|
||||||
|
etk::UString filename = list[iii]->GetName() + "/highlight.xml";
|
||||||
|
APPL_DEBUG("Load xml name : " << filename);
|
||||||
|
Highlight *myHightline = new Highlight(filename);
|
||||||
listHighlight.PushBack(myHightline);
|
listHighlight.PushBack(myHightline);
|
||||||
|
}
|
||||||
xmlFilename = "languages/boo/highlight.xml";
|
}
|
||||||
myHightline = new Highlight(xmlFilename);
|
}
|
||||||
listHighlight.PushBack(myHightline);
|
|
||||||
|
|
||||||
xmlFilename = "languages/makefile/highlight.xml";
|
|
||||||
myHightline = new Highlight(xmlFilename);
|
|
||||||
listHighlight.PushBack(myHightline);
|
|
||||||
|
|
||||||
xmlFilename = "languages/asm/highlight.xml";
|
|
||||||
myHightline = new Highlight(xmlFilename);
|
|
||||||
listHighlight.PushBack(myHightline);
|
|
||||||
|
|
||||||
xmlFilename = "languages/xml/highlight.xml";
|
|
||||||
myHightline = new Highlight(xmlFilename);
|
|
||||||
listHighlight.PushBack(myHightline);
|
|
||||||
|
|
||||||
xmlFilename = "languages/php/highlight.xml";
|
|
||||||
myHightline = new Highlight(xmlFilename);
|
|
||||||
listHighlight.PushBack(myHightline);
|
|
||||||
|
|
||||||
xmlFilename = "languages/bash/highlight.xml";
|
|
||||||
myHightline = new Highlight(xmlFilename);
|
|
||||||
listHighlight.PushBack(myHightline);
|
|
||||||
|
|
||||||
xmlFilename = "languages/matlab/highlight.xml";
|
|
||||||
myHightline = new Highlight(xmlFilename);
|
|
||||||
listHighlight.PushBack(myHightline);
|
|
||||||
|
|
||||||
xmlFilename = "languages/java/highlight.xml";
|
|
||||||
myHightline = new Highlight(xmlFilename);
|
|
||||||
listHighlight.PushBack(myHightline);
|
|
||||||
|
|
||||||
xmlFilename = "languages/lua/highlight.xml";
|
|
||||||
myHightline = new Highlight(xmlFilename);
|
|
||||||
listHighlight.PushBack(myHightline);
|
|
||||||
|
|
||||||
xmlFilename = "languages/in/highlight.xml";
|
|
||||||
myHightline = new Highlight(xmlFilename);
|
|
||||||
listHighlight.PushBack(myHightline);
|
|
||||||
|
|
||||||
xmlFilename = "languages/glsl/highlight.xml";
|
|
||||||
myHightline = new Highlight(xmlFilename);
|
|
||||||
listHighlight.PushBack(myHightline);
|
|
||||||
|
|
||||||
//myHightline->Display();
|
//myHightline->Display();
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define EDN_CAST_HIGHLIGHT_MANAGER(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_HIGHLIGHT_MANAGER,localClassHighlightManager,curentPointer)
|
|
||||||
|
|
||||||
static localClassHighlightManager * localManager = NULL;
|
static localClassHighlightManager * localManager = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -107,7 +107,7 @@ void HighlightPattern::Display(void)
|
|||||||
m_subPatern[i]->Display();
|
m_subPatern[i]->Display();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void HighlightPattern::ParseRules(TiXmlNode *child, int32_t level)
|
void HighlightPattern::ParseRules(exml::Element *child, int32_t level)
|
||||||
{
|
{
|
||||||
//--------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------
|
||||||
/*
|
/*
|
||||||
@@ -120,51 +120,51 @@ void HighlightPattern::ParseRules(TiXmlNode *child, int32_t level)
|
|||||||
*/
|
*/
|
||||||
//--------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------
|
||||||
// process attribute
|
// process attribute
|
||||||
const char *highLightName = child->ToElement()->Attribute("name");
|
etk::UString highLightName = child->GetAttribute("name");
|
||||||
etk::UString myEdnDataTmp = "???";
|
etk::UString myEdnDataTmp = "???";
|
||||||
if (NULL != highLightName) {
|
if (highLightName.Size()!=0) {
|
||||||
myEdnDataTmp = highLightName;
|
myEdnDataTmp = highLightName;
|
||||||
}
|
}
|
||||||
SetName(myEdnDataTmp);
|
SetName(myEdnDataTmp);
|
||||||
SetLevel(level);
|
SetLevel(level);
|
||||||
|
|
||||||
TiXmlElement *xChild = child->FirstChildElement("color");
|
exml::Element* xChild = (exml::Element*)child->GetNamed("color");
|
||||||
if (NULL != xChild) {
|
if (NULL != xChild) {
|
||||||
const char *myData = xChild->GetText();
|
etk::UString myData = xChild->GetText();
|
||||||
if (myData) {
|
if (myData.Size()!=0) {
|
||||||
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
||||||
etk::UString myEdnData = myData;
|
etk::UString myEdnData = myData;
|
||||||
SetColor(myEdnData);
|
SetColor(myEdnData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xChild = child->FirstChildElement("start");
|
xChild = (exml::Element*)child->GetNamed("start");
|
||||||
if (NULL != xChild) {
|
if (NULL != xChild) {
|
||||||
const char *myData = xChild->GetText();
|
etk::UString myData = xChild->GetText();
|
||||||
if (myData) {
|
if (myData.Size()!=0) {
|
||||||
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
||||||
etk::UString myEdnData = myData;
|
etk::UString myEdnData = myData;
|
||||||
SetPaternStart(myEdnData);
|
SetPaternStart(myEdnData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xChild = child->FirstChildElement("end");
|
xChild = (exml::Element*)child->GetNamed("end");
|
||||||
if (NULL != xChild) {
|
if (NULL != xChild) {
|
||||||
const char *myData = xChild->GetText();
|
etk::UString myData = xChild->GetText();
|
||||||
if (myData) {
|
if (myData.Size()!=0) {
|
||||||
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
||||||
etk::UString myEdnData = myData;
|
etk::UString myEdnData = myData;
|
||||||
SetPaternStop(myEdnData);
|
SetPaternStop(myEdnData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xChild = child->FirstChildElement("EscapeChar");
|
xChild = (exml::Element*)child->GetNamed("EscapeChar");
|
||||||
if (NULL != xChild) {
|
if (NULL != xChild) {
|
||||||
const char *myData = xChild->GetText();
|
etk::UString myData = xChild->GetText();
|
||||||
if (myData) {
|
if (myData.Size()!=0) {
|
||||||
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
||||||
etk::UString myEdnData = myData;
|
etk::UString myEdnData = myData;
|
||||||
SetEscapeChar(myEdnData);
|
SetEscapeChar(myEdnData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xChild = child->FirstChildElement("rule");
|
xChild = (exml::Element*)child->GetNamed("rule");
|
||||||
if (NULL != xChild) {
|
if (NULL != xChild) {
|
||||||
/*
|
/*
|
||||||
// Create the patern ...
|
// Create the patern ...
|
||||||
|
@@ -17,7 +17,7 @@ class HighlightPattern;
|
|||||||
#include <etk/RegExp.h>
|
#include <etk/RegExp.h>
|
||||||
#include <Colorize.h>
|
#include <Colorize.h>
|
||||||
#include <etk/Vector.h>
|
#include <etk/Vector.h>
|
||||||
#include <tinyXML/tinyxml.h>
|
#include <exml/exml.h>
|
||||||
#include <etk/Buffer.h>
|
#include <etk/Buffer.h>
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@@ -50,7 +50,7 @@ class HighlightPattern {
|
|||||||
void Display(void);
|
void Display(void);
|
||||||
resultFind_te Find(int32_t start, int32_t stop, colorInformation_ts &resultat, etk::Buffer &buffer);
|
resultFind_te Find(int32_t start, int32_t stop, colorInformation_ts &resultat, etk::Buffer &buffer);
|
||||||
Colorize * GetColor(void) { return m_color; };
|
Colorize * GetColor(void) { return m_color; };
|
||||||
void ParseRules(TiXmlNode *child, int32_t level);
|
void ParseRules(exml::Element *child, int32_t level);
|
||||||
|
|
||||||
void ReloadColor(void);
|
void ReloadColor(void);
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ class HighlightPattern {
|
|||||||
etk::RegExp<etk::Buffer> * m_regExpStop; //!< Stop of Regular Expression
|
etk::RegExp<etk::Buffer> * m_regExpStop; //!< Stop of Regular Expression
|
||||||
bool m_haveStopPatern; //!< Stop patern presence
|
bool m_haveStopPatern; //!< Stop patern presence
|
||||||
bool m_multiline; //!< The patern is multiline
|
bool m_multiline; //!< The patern is multiline
|
||||||
uniChar_t m_escapeChar; //!< Escape char to prevent exeit of patern ....
|
etk::UniChar m_escapeChar; //!< Escape char to prevent exeit of patern ....
|
||||||
etk::Vector<HighlightPattern *> m_subPatern; //!< Under patern of this one
|
etk::Vector<HighlightPattern *> m_subPatern; //!< Under patern of this one
|
||||||
// etk::Vector<HighlightPattern *> m_subColor; //!< Under Color in the start RegExp ...
|
// etk::Vector<HighlightPattern *> m_subColor; //!< Under Color in the start RegExp ...
|
||||||
};
|
};
|
||||||
|
@@ -10,7 +10,8 @@
|
|||||||
#include <appl/global.h>
|
#include <appl/global.h>
|
||||||
#include <CTagsManager.h>
|
#include <CTagsManager.h>
|
||||||
#include <BufferManager.h>
|
#include <BufferManager.h>
|
||||||
#include <ewol/eObject/EObject.h>
|
#include <ewol/renderer/EObject.h>
|
||||||
|
#include <ewol/renderer/eContext.h>
|
||||||
#include <ewol/widget/meta/FileChooser.h>
|
#include <ewol/widget/meta/FileChooser.h>
|
||||||
#include <appl/Gui/TagFileSelection.h>
|
#include <appl/Gui/TagFileSelection.h>
|
||||||
|
|
||||||
@@ -26,24 +27,11 @@ class CTagsManager: public ewol::EObject
|
|||||||
CTagsManager(void);
|
CTagsManager(void);
|
||||||
~CTagsManager(void);
|
~CTagsManager(void);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Get the current Object type of the EObject
|
|
||||||
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
|
|
||||||
* @param[in] objectType type description
|
|
||||||
* @return true if the object is compatible, otherwise false
|
|
||||||
*/
|
|
||||||
const char * const GetObjectType(void)
|
const char * const GetObjectType(void)
|
||||||
{
|
{
|
||||||
return "CTagsManager";
|
return "CTagsManager";
|
||||||
};
|
};
|
||||||
/**
|
void OnReceiveMessage(const ewol::EMessage& _msg);
|
||||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
|
||||||
* @param[in] CallerObject Pointer on the EObject that information came from
|
|
||||||
* @param[in] eventId Message registered by this class
|
|
||||||
* @param[in] data Data registered by this class
|
|
||||||
* @return ---
|
|
||||||
*/
|
|
||||||
void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
|
|
||||||
|
|
||||||
int32_t m_currentSelectedID;
|
int32_t m_currentSelectedID;
|
||||||
void LoadTagFile(void);
|
void LoadTagFile(void);
|
||||||
@@ -125,21 +113,21 @@ CTagsManager::~CTagsManager(void)
|
|||||||
|
|
||||||
const char * ednEventPopUpCtagsLoadFile = "edn-event-load-ctags";
|
const char * ednEventPopUpCtagsLoadFile = "edn-event-load-ctags";
|
||||||
|
|
||||||
void CTagsManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
void CTagsManager::OnReceiveMessage(const ewol::EMessage& _msg)
|
||||||
{
|
{
|
||||||
//EWOL_INFO("ctags manager event ... : \"" << eventId << "\" ==> data=\"" << data << "\"" );
|
//EWOL_INFO("ctags manager event ... : \"" << eventId << "\" ==> data=\"" << data << "\"" );
|
||||||
if (eventId == ednMsgBufferId) {
|
if (_msg.GetMessage() == ednMsgBufferId) {
|
||||||
//m_currentSelectedID = dataID;
|
//m_currentSelectedID = dataID;
|
||||||
} else if( eventId == ednEventPopUpCtagsLoadFile
|
} else if( _msg.GetMessage() == ednEventPopUpCtagsLoadFile
|
||||||
|| eventId == ednMsgCtagsLoadFile) {
|
|| _msg.GetMessage() == ednMsgCtagsLoadFile) {
|
||||||
// open the new one :
|
// open the new one :
|
||||||
etk::FSNode tmpFilename = data;
|
etk::FSNode tmpFilename = _msg.GetData();
|
||||||
m_tagFilename = tmpFilename.GetNameFile();
|
m_tagFilename = tmpFilename.GetNameFile();
|
||||||
m_tagFolderBase = tmpFilename.GetNameFolder();
|
m_tagFolderBase = tmpFilename.GetNameFolder();
|
||||||
APPL_DEBUG("Receive load Ctags file : " << m_tagFolderBase << "/" << m_tagFilename << " ");
|
APPL_DEBUG("Receive load Ctags file : " << m_tagFolderBase << "/" << m_tagFilename << " ");
|
||||||
LoadTagFile();
|
LoadTagFile();
|
||||||
} else if (eventId == ednMsgGuiCtags) {
|
} else if (_msg.GetMessage() == ednMsgGuiCtags) {
|
||||||
if (data == "Load") {
|
if (_msg.GetData() == "Load") {
|
||||||
APPL_INFO("Request opening ctag file");
|
APPL_INFO("Request opening ctag file");
|
||||||
widget::FileChooser* tmpWidget = new widget::FileChooser();
|
widget::FileChooser* tmpWidget = new widget::FileChooser();
|
||||||
if (NULL == tmpWidget) {
|
if (NULL == tmpWidget) {
|
||||||
@@ -147,15 +135,15 @@ void CTagsManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * e
|
|||||||
} else {
|
} else {
|
||||||
tmpWidget->SetTitle("Open Exuberant Ctags File");
|
tmpWidget->SetTitle("Open Exuberant Ctags File");
|
||||||
tmpWidget->SetValidateLabel("Open");
|
tmpWidget->SetValidateLabel("Open");
|
||||||
ewol::WindowsPopUpAdd(tmpWidget);
|
ewol::GetContext().GetWindows()->PopUpWidgetPush(tmpWidget);
|
||||||
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpCtagsLoadFile);
|
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpCtagsLoadFile);
|
||||||
}
|
}
|
||||||
} else if (data == "ReLoad") {
|
} else if (_msg.GetData() == "ReLoad") {
|
||||||
APPL_INFO("Request re-load ctag file");
|
APPL_INFO("Request re-load ctag file");
|
||||||
LoadTagFile();
|
LoadTagFile();
|
||||||
} else if (data == "Jump") {
|
} else if (_msg.GetData() == "Jump") {
|
||||||
JumpTo();
|
JumpTo();
|
||||||
} else if (data == "Back") {
|
} else if (_msg.GetData() == "Back") {
|
||||||
if (m_historyList.Size() > 0) {
|
if (m_historyList.Size() > 0) {
|
||||||
int32_t id = m_historyList.Size()-1;
|
int32_t id = m_historyList.Size()-1;
|
||||||
SendMultiCast(ednMsgOpenFile, m_historyList[id]->GetName() );
|
SendMultiCast(ednMsgOpenFile, m_historyList[id]->GetName() );
|
||||||
@@ -168,13 +156,13 @@ void CTagsManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * e
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if (eventId == applEventctagsSelection) {
|
} else if (_msg.GetMessage() == applEventctagsSelection) {
|
||||||
// save the current file in the history
|
// save the current file in the history
|
||||||
RegisterHistory();
|
RegisterHistory();
|
||||||
// parse the input data
|
// parse the input data
|
||||||
char tmp[4096];
|
char tmp[4096];
|
||||||
int32_t lineID;
|
int32_t lineID;
|
||||||
sscanf(data.c_str(), "%d:%s", &lineID, tmp);
|
sscanf(_msg.GetData().c_str(), "%d:%s", &lineID, tmp);
|
||||||
// generate envents
|
// generate envents
|
||||||
SendMultiCast(ednMsgOpenFile, tmp);
|
SendMultiCast(ednMsgOpenFile, tmp);
|
||||||
SendMultiCast(ednMsgGuiGotoLine, lineID - 1);
|
SendMultiCast(ednMsgGuiGotoLine, lineID - 1);
|
||||||
@@ -254,7 +242,7 @@ void CTagsManager::JumpTo(void)
|
|||||||
PrintTag(&entry);
|
PrintTag(&entry);
|
||||||
tmpWidget->AddCtagsNewItem(myfile.GetName(), lineID);
|
tmpWidget->AddCtagsNewItem(myfile.GetName(), lineID);
|
||||||
} while (tagsFindNext (m_ctagFile, &entry) == TagSuccess);
|
} while (tagsFindNext (m_ctagFile, &entry) == TagSuccess);
|
||||||
ewol::WindowsPopUpAdd(tmpWidget);
|
ewol::GetContext().GetWindows()->PopUpWidgetPush(tmpWidget);
|
||||||
tmpWidget->RegisterOnEvent(this, applEventctagsSelection);
|
tmpWidget->RegisterOnEvent(this, applEventctagsSelection);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@@ -9,78 +9,170 @@
|
|||||||
#include <appl/global.h>
|
#include <appl/global.h>
|
||||||
#include <ColorizeManager.h>
|
#include <ColorizeManager.h>
|
||||||
#include <appl/globalMsg.h>
|
#include <appl/globalMsg.h>
|
||||||
#include <ewol/eObject/EObject.h>
|
#include <ewol/renderer/EObject.h>
|
||||||
#include <ewol/renderer/ResourceManager.h>
|
#include <ewol/renderer/eContext.h>
|
||||||
|
#include <ewol/resources/ResourceManager.h>
|
||||||
#include <etk/os/FSNode.h>
|
#include <etk/os/FSNode.h>
|
||||||
|
//#include <ewol/UserConfig.h>
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "globals"
|
#define __class__ "globals"
|
||||||
|
|
||||||
|
class myParamGlobal : public ewol::EObject
|
||||||
|
|
||||||
|
|
||||||
erreurCode_te globals::init(void)
|
|
||||||
{
|
{
|
||||||
erreurCode_te ret = ERR_NONE;
|
public:
|
||||||
|
static const char * const configEOL;
|
||||||
|
static const char * const configAutoIndent;
|
||||||
|
static const char * const configShowTabChar;
|
||||||
|
static const char * const configShowSpaceChar;
|
||||||
|
public:
|
||||||
|
bool m_displayEOL;
|
||||||
|
bool m_AutoIndent;
|
||||||
|
bool m_displayTabChar;
|
||||||
|
bool m_displaySpaceChar;
|
||||||
|
public :
|
||||||
|
myParamGlobal(void) {
|
||||||
|
m_static = true; // Note : Set the object static notification( Must be set or assert at the end of process)
|
||||||
|
SetName("edn_global_param");
|
||||||
|
m_displayEOL=false;
|
||||||
|
m_AutoIndent = true;
|
||||||
|
m_displayTabChar = true;
|
||||||
|
m_displaySpaceChar = true;
|
||||||
|
RegisterConfig(configEOL, "bool", NULL, "Display end of line character");
|
||||||
|
RegisterConfig(configAutoIndent, "bool", NULL, "Auto indent when create new line");
|
||||||
|
RegisterConfig(configShowTabChar, "bool", NULL, "Display the Tab char");
|
||||||
|
RegisterConfig(configShowSpaceChar, "bool", NULL, "Display the space char");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool OnSetConfig(const ewol::EConfig& _conf)
|
||||||
|
{
|
||||||
|
// Not set the EObject node parameter (name ==> not change ...)
|
||||||
|
if (_conf.GetConfig() == configEOL) {
|
||||||
|
m_displayEOL = _conf.GetData().ToBool();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (_conf.GetConfig() == configAutoIndent) {
|
||||||
|
m_AutoIndent = _conf.GetData().ToBool();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (_conf.GetConfig() == configShowTabChar) {
|
||||||
|
m_displayTabChar = _conf.GetData().ToBool();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (_conf.GetConfig() == configShowSpaceChar) {
|
||||||
|
m_displaySpaceChar = _conf.GetData().ToBool();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
bool OnGetConfig(const char* _config, etk::UString& _result) const
|
||||||
|
{
|
||||||
|
// Not set the EObject node parameter (name ==> not change ...)
|
||||||
|
if (_config == configEOL) {
|
||||||
|
if (true==m_displayEOL) {
|
||||||
|
_result = "true";
|
||||||
|
} else {
|
||||||
|
_result = "false";
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (_config == configAutoIndent) {
|
||||||
|
if (true==m_AutoIndent) {
|
||||||
|
_result = "true";
|
||||||
|
} else {
|
||||||
|
_result = "false";
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (_config == configShowTabChar) {
|
||||||
|
if (true==m_displayTabChar) {
|
||||||
|
_result = "true";
|
||||||
|
} else {
|
||||||
|
_result = "false";
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (_config == configShowSpaceChar) {
|
||||||
|
if (true==m_displaySpaceChar) {
|
||||||
|
_result = "true";
|
||||||
|
} else {
|
||||||
|
_result = "false";
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return ret;
|
const char * const myParamGlobal::configEOL = "eol";
|
||||||
|
const char * const myParamGlobal::configAutoIndent = "auto-indent";
|
||||||
|
const char * const myParamGlobal::configShowTabChar = "display-tab";
|
||||||
|
const char * const myParamGlobal::configShowSpaceChar = "display-space";
|
||||||
|
|
||||||
|
static myParamGlobal& l_obj(void)
|
||||||
|
{
|
||||||
|
static myParamGlobal s_obj;
|
||||||
|
return s_obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void globals::Init(void)
|
||||||
|
{
|
||||||
|
//ewol::userConfig::AddUserConfig(&l_obj());
|
||||||
|
}
|
||||||
|
|
||||||
|
void globals::UnInit(void)
|
||||||
|
{
|
||||||
|
// nothing to do ...
|
||||||
|
//ewol::userConfig::RmUserConfig(&l_obj());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
static bool displayEOL = false;
|
|
||||||
bool globals::IsSetDisplayEndOfLine(void)
|
bool globals::IsSetDisplayEndOfLine(void)
|
||||||
{
|
{
|
||||||
return displayEOL;
|
return l_obj().m_displayEOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void globals::SetDisplayEndOfLine(bool newVal)
|
void globals::SetDisplayEndOfLine(bool newVal)
|
||||||
{
|
{
|
||||||
APPL_INFO("Set EndOfLine " << newVal);
|
l_obj().m_displayEOL = newVal;
|
||||||
displayEOL = newVal;
|
|
||||||
//ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
|
//ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
static bool displaySpaceChar = true;
|
|
||||||
bool globals::IsSetDisplaySpaceChar(void)
|
bool globals::IsSetDisplaySpaceChar(void)
|
||||||
{
|
{
|
||||||
return displaySpaceChar;
|
return l_obj().m_displaySpaceChar;
|
||||||
}
|
}
|
||||||
|
|
||||||
void globals::SetDisplaySpaceChar(bool newVal)
|
void globals::SetDisplaySpaceChar(bool newVal)
|
||||||
{
|
{
|
||||||
APPL_INFO("Set SpaceChar " << newVal);
|
l_obj().m_displaySpaceChar = newVal;
|
||||||
displaySpaceChar = newVal;
|
|
||||||
//ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
|
//ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
|
||||||
}
|
}
|
||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
static bool displayTabChar = true;
|
|
||||||
bool globals::IsSetDisplayTabChar(void)
|
bool globals::IsSetDisplayTabChar(void)
|
||||||
{
|
{
|
||||||
return displayTabChar;
|
return l_obj().m_displayTabChar;
|
||||||
}
|
}
|
||||||
|
|
||||||
void globals::SetDisplayTabChar(bool newVal)
|
void globals::SetDisplayTabChar(bool newVal)
|
||||||
{
|
{
|
||||||
APPL_INFO("Set SpaceChar " << newVal);
|
l_obj().m_displayTabChar = newVal;
|
||||||
displayTabChar = newVal;
|
|
||||||
//ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
|
//ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
static bool AutoIndent = true;
|
|
||||||
bool globals::IsSetAutoIndent(void)
|
bool globals::IsSetAutoIndent(void)
|
||||||
{
|
{
|
||||||
return AutoIndent;
|
return l_obj().m_AutoIndent;
|
||||||
}
|
}
|
||||||
|
|
||||||
void globals::SetAutoIndent(bool newVal)
|
void globals::SetAutoIndent(bool newVal)
|
||||||
{
|
{
|
||||||
APPL_INFO("Set AutoIndent " << newVal);
|
l_obj().m_AutoIndent = newVal;
|
||||||
AutoIndent = newVal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
@@ -113,7 +205,8 @@ static const char * const l_changeTabulation = "edn-event-change-tabulation";
|
|||||||
static const char * const l_changeEndOfLine = "edn-event-change-endOfLine";
|
static const char * const l_changeEndOfLine = "edn-event-change-endOfLine";
|
||||||
static const char * const l_changeRounded = "edn-event-change-rounded";
|
static const char * const l_changeRounded = "edn-event-change-rounded";
|
||||||
|
|
||||||
globals::ParameterGlobalsGui::ParameterGlobalsGui(void)
|
globals::ParameterGlobalsGui::ParameterGlobalsGui(void) :
|
||||||
|
widget::Sizer(widget::Sizer::modeVert)
|
||||||
{
|
{
|
||||||
widget::CheckBox* myCheckbox = NULL;
|
widget::CheckBox* myCheckbox = NULL;
|
||||||
widget::Spacer* mySpacer = NULL;
|
widget::Spacer* mySpacer = NULL;
|
||||||
@@ -122,15 +215,14 @@ globals::ParameterGlobalsGui::ParameterGlobalsGui(void)
|
|||||||
if (NULL == mySpacer) {
|
if (NULL == mySpacer) {
|
||||||
APPL_ERROR("Can not allocate widget ==> display might be in error");
|
APPL_ERROR("Can not allocate widget ==> display might be in error");
|
||||||
} else {
|
} else {
|
||||||
mySpacer->SetExpendX(true);
|
mySpacer->SetExpand(bvec2(true,true));
|
||||||
mySpacer->SetExpendY(true);
|
|
||||||
SubWidgetAdd(mySpacer);
|
SubWidgetAdd(mySpacer);
|
||||||
}
|
}
|
||||||
myCheckbox = new widget::CheckBox("Automatic Indentation");
|
myCheckbox = new widget::CheckBox("Automatic Indentation");
|
||||||
if (NULL == myCheckbox) {
|
if (NULL == myCheckbox) {
|
||||||
APPL_ERROR("Can not allocate widget ==> display might be in error");
|
APPL_ERROR("Can not allocate widget ==> display might be in error");
|
||||||
} else {
|
} else {
|
||||||
myCheckbox->SetExpendX(true);
|
myCheckbox->SetExpand(bvec2(true,false));
|
||||||
myCheckbox->SetValue(IsSetAutoIndent());
|
myCheckbox->SetValue(IsSetAutoIndent());
|
||||||
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeIndentation);
|
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeIndentation);
|
||||||
SubWidgetAdd(myCheckbox);
|
SubWidgetAdd(myCheckbox);
|
||||||
@@ -139,7 +231,7 @@ globals::ParameterGlobalsGui::ParameterGlobalsGui(void)
|
|||||||
if (NULL == myCheckbox) {
|
if (NULL == myCheckbox) {
|
||||||
APPL_ERROR("Can not allocate widget ==> display might be in error");
|
APPL_ERROR("Can not allocate widget ==> display might be in error");
|
||||||
} else {
|
} else {
|
||||||
myCheckbox->SetExpendX(true);
|
myCheckbox->SetExpand(bvec2(true,false));
|
||||||
myCheckbox->SetValue(IsSetDisplaySpaceChar());
|
myCheckbox->SetValue(IsSetDisplaySpaceChar());
|
||||||
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeSpace);
|
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeSpace);
|
||||||
SubWidgetAdd(myCheckbox);
|
SubWidgetAdd(myCheckbox);
|
||||||
@@ -148,7 +240,7 @@ globals::ParameterGlobalsGui::ParameterGlobalsGui(void)
|
|||||||
if (NULL == myCheckbox) {
|
if (NULL == myCheckbox) {
|
||||||
APPL_ERROR("Can not allocate widget ==> display might be in error");
|
APPL_ERROR("Can not allocate widget ==> display might be in error");
|
||||||
} else {
|
} else {
|
||||||
myCheckbox->SetExpendX(true);
|
myCheckbox->SetExpand(bvec2(true,false));
|
||||||
myCheckbox->SetValue(IsSetDisplayTabChar());
|
myCheckbox->SetValue(IsSetDisplayTabChar());
|
||||||
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeTabulation);
|
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeTabulation);
|
||||||
SubWidgetAdd(myCheckbox);
|
SubWidgetAdd(myCheckbox);
|
||||||
@@ -157,7 +249,7 @@ globals::ParameterGlobalsGui::ParameterGlobalsGui(void)
|
|||||||
if (NULL == myCheckbox) {
|
if (NULL == myCheckbox) {
|
||||||
APPL_ERROR("Can not allocate widget ==> display might be in error");
|
APPL_ERROR("Can not allocate widget ==> display might be in error");
|
||||||
} else {
|
} else {
|
||||||
myCheckbox->SetExpendX(true);
|
myCheckbox->SetExpand(bvec2(true,false));
|
||||||
myCheckbox->SetValue(IsSetDisplayEndOfLine());
|
myCheckbox->SetValue(IsSetDisplayEndOfLine());
|
||||||
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeEndOfLine);
|
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeEndOfLine);
|
||||||
SubWidgetAdd(myCheckbox);
|
SubWidgetAdd(myCheckbox);
|
||||||
@@ -166,7 +258,7 @@ globals::ParameterGlobalsGui::ParameterGlobalsGui(void)
|
|||||||
if (NULL == myCheckbox) {
|
if (NULL == myCheckbox) {
|
||||||
APPL_ERROR("Can not allocate widget ==> display might be in error");
|
APPL_ERROR("Can not allocate widget ==> display might be in error");
|
||||||
} else {
|
} else {
|
||||||
myCheckbox->SetExpendX(true);
|
myCheckbox->SetExpand(bvec2(true,false));
|
||||||
myCheckbox->SetValue(IsSetDisplayEndOfLine());
|
myCheckbox->SetValue(IsSetDisplayEndOfLine());
|
||||||
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeRounded);
|
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeRounded);
|
||||||
SubWidgetAdd(myCheckbox);
|
SubWidgetAdd(myCheckbox);
|
||||||
@@ -179,49 +271,43 @@ globals::ParameterGlobalsGui::~ParameterGlobalsGui(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
void globals::ParameterGlobalsGui::OnReceiveMessage(const ewol::EMessage& _msg)
|
||||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
|
||||||
* @param[in] CallerObject Pointer on the EObject that information came from
|
|
||||||
* @param[in] eventId Message registered by this class
|
|
||||||
* @param[in] data Data registered by this class
|
|
||||||
* @return ---
|
|
||||||
*/
|
|
||||||
void globals::ParameterGlobalsGui::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
|
||||||
{
|
{
|
||||||
widget::SizerVert::OnReceiveMessage(CallerObject, eventId, data);
|
widget::Sizer::OnReceiveMessage(_msg);
|
||||||
|
|
||||||
if (eventId == l_changeEndOfLine) {
|
if (_msg.GetMessage() == l_changeEndOfLine) {
|
||||||
if (data == "true") {
|
if (_msg.GetData() == "true") {
|
||||||
SetDisplayEndOfLine(true);
|
SetDisplayEndOfLine(true);
|
||||||
} else {
|
} else {
|
||||||
SetDisplayEndOfLine(false);
|
SetDisplayEndOfLine(false);
|
||||||
}
|
}
|
||||||
} else if (eventId == l_changeIndentation) {
|
} else if (_msg.GetMessage() == l_changeIndentation) {
|
||||||
if (data == "true") {
|
if (_msg.GetData() == "true") {
|
||||||
SetAutoIndent(true);
|
SetAutoIndent(true);
|
||||||
} else {
|
} else {
|
||||||
SetAutoIndent(false);
|
SetAutoIndent(false);
|
||||||
}
|
}
|
||||||
} else if (eventId == l_changeSpace) {
|
} else if (_msg.GetMessage() == l_changeSpace) {
|
||||||
if (data == "true") {
|
if (_msg.GetData() == "true") {
|
||||||
SetDisplaySpaceChar(true);
|
SetDisplaySpaceChar(true);
|
||||||
} else {
|
} else {
|
||||||
SetDisplaySpaceChar(false);
|
SetDisplaySpaceChar(false);
|
||||||
}
|
}
|
||||||
} else if (eventId == l_changeTabulation) {
|
} else if (_msg.GetMessage() == l_changeTabulation) {
|
||||||
if (data == "true") {
|
if (_msg.GetData() == "true") {
|
||||||
SetDisplayTabChar(true);
|
SetDisplayTabChar(true);
|
||||||
} else {
|
} else {
|
||||||
SetDisplayTabChar(false);
|
SetDisplayTabChar(false);
|
||||||
}
|
}
|
||||||
} else if (eventId == l_changeRounded) {
|
} else if (_msg.GetMessage() == l_changeRounded) {
|
||||||
if (data == "true") {
|
if (_msg.GetData() == "true") {
|
||||||
etk::theme::SetName("GUI", "rounded");;
|
etk::theme::SetName("GUI", "rounded");;
|
||||||
} else {
|
} else {
|
||||||
etk::theme::SetName("GUI", "default");;
|
etk::theme::SetName("GUI", "default");;
|
||||||
}
|
}
|
||||||
// Reload shaders and graphic system ...
|
// Reload shaders and graphic system ...
|
||||||
ewol::resource::ReLoadResources();
|
ewol::GetContext().GetResourcesManager().ReLoadResources();
|
||||||
|
ewol::GetContext().ForceRedrawAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -10,12 +10,13 @@
|
|||||||
#define __TOOLS_GLOBALS_H__
|
#define __TOOLS_GLOBALS_H__
|
||||||
|
|
||||||
#include <appl/Debug.h>
|
#include <appl/Debug.h>
|
||||||
#include <ewol/widget/SizerVert.h>
|
#include <ewol/widget/Sizer.h>
|
||||||
|
|
||||||
|
|
||||||
namespace globals
|
namespace globals
|
||||||
{
|
{
|
||||||
erreurCode_te init(void);
|
void Init(void);
|
||||||
|
void UnInit(void);
|
||||||
int32_t getNbColoneBorder(void);
|
int32_t getNbColoneBorder(void);
|
||||||
int32_t getNbLineBorder(void);
|
int32_t getNbLineBorder(void);
|
||||||
|
|
||||||
@@ -35,19 +36,13 @@ namespace globals
|
|||||||
|
|
||||||
bool OrderTheBufferList(void);
|
bool OrderTheBufferList(void);
|
||||||
|
|
||||||
class ParameterGlobalsGui : public widget::SizerVert
|
class ParameterGlobalsGui : public widget::Sizer
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
ParameterGlobalsGui(void);
|
ParameterGlobalsGui(void);
|
||||||
~ParameterGlobalsGui(void);
|
~ParameterGlobalsGui(void);
|
||||||
/**
|
// herited function
|
||||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
virtual void OnReceiveMessage(const ewol::EMessage& _msg);
|
||||||
* @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);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -18,6 +18,7 @@ extern const char* const ednMsgGuiClose = "edn-Msg-Gui-Close";
|
|||||||
extern const char* const ednMsgGuiSave = "edn-Msg-Gui-Save";
|
extern const char* const ednMsgGuiSave = "edn-Msg-Gui-Save";
|
||||||
extern const char* const ednMsgGuiSaveAs = "edn-Msg-Gui-SaveAs";
|
extern const char* const ednMsgGuiSaveAs = "edn-Msg-Gui-SaveAs";
|
||||||
extern const char* const ednMsgProperties = "edn-Msg-Gui-Properties";
|
extern const char* const ednMsgProperties = "edn-Msg-Gui-Properties";
|
||||||
|
extern const char* const ednMsgGuiExit = "edn-Msg-Gui-quit";
|
||||||
|
|
||||||
extern const char* const ednMsgGuiUndo = "edn-Msg-Gui-Undo";
|
extern const char* const ednMsgGuiUndo = "edn-Msg-Gui-Undo";
|
||||||
extern const char* const ednMsgGuiRedo = "edn-Msg-Gui-Redo";
|
extern const char* const ednMsgGuiRedo = "edn-Msg-Gui-Redo";
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
extern const char* const ednMsgGuiSave; // data : ""
|
extern const char* const ednMsgGuiSave; // data : ""
|
||||||
extern const char* const ednMsgGuiSaveAs; // data : ""
|
extern const char* const ednMsgGuiSaveAs; // data : ""
|
||||||
extern const char* const ednMsgProperties; // data : ""
|
extern const char* const ednMsgProperties; // data : ""
|
||||||
|
extern const char* const ednMsgGuiExit; // data : ""
|
||||||
|
|
||||||
extern const char* const ednMsgGuiUndo; // data : ""
|
extern const char* const ednMsgGuiUndo; // data : ""
|
||||||
extern const char* const ednMsgGuiRedo; // data : ""
|
extern const char* const ednMsgGuiRedo; // data : ""
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
#include <etk/types.h>
|
#include <etk/types.h>
|
||||||
#include <etk/UString.h>
|
#include <etk/UString.h>
|
||||||
#include <ewol/ewol.h>
|
#include <ewol/ewol.h>
|
||||||
#include <ewol/eObject/EObject.h>
|
#include <ewol/renderer/EObject.h>
|
||||||
#include <ewol/widget/WidgetManager.h>
|
#include <ewol/widget/WidgetManager.h>
|
||||||
|
|
||||||
#include <appl/Debug.h>
|
#include <appl/Debug.h>
|
||||||
@@ -25,65 +25,46 @@
|
|||||||
#include <readtags.h>
|
#include <readtags.h>
|
||||||
#include <CTagsManager.h>
|
#include <CTagsManager.h>
|
||||||
#include <globalMsg.h>
|
#include <globalMsg.h>
|
||||||
#include <ewol/config.h>
|
//#include <ewol/config.h>
|
||||||
#include <ewol/commandLine.h>
|
#include <ewol/commandLine.h>
|
||||||
|
//#include <ewol/UserConfig.h>
|
||||||
MainWindows * basicWindows = NULL;
|
#include <ewol/renderer/eContext.h>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Main of the program (This can be set in every case, but it is not used in Andoid...).
|
* @brief Main of the program (This can be set in every case, but it is not used in Andoid...).
|
||||||
* @param std IO
|
* @param std IO
|
||||||
* @return std IO
|
* @return std IO
|
||||||
*/
|
*/
|
||||||
int main(int argc, const char *argv[])
|
int main(int _argc, const char *_argv[])
|
||||||
{
|
{
|
||||||
// only one things to do:
|
// only one things to do:
|
||||||
return ewol::Run(argc, argv);
|
return ewol::Run(_argc, _argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief main application function Initialisation
|
* @brief main application function Initialisation
|
||||||
*/
|
*/
|
||||||
void APP_Init(void)
|
bool APP_Init(ewol::eContext& _context)
|
||||||
{
|
{
|
||||||
#ifdef MODE_RELEASE
|
APPL_INFO("==> Init APPL (START) [" << ewol::GetBoardType() << "] (" << ewol::GetCompilationMode() << ")");
|
||||||
const char * debugMode = "Release";
|
|
||||||
#else
|
|
||||||
const char * debugMode = "Debug";
|
|
||||||
#endif
|
|
||||||
#ifdef __TARGET_OS__Linux
|
|
||||||
const char * osMode = "Linux";
|
|
||||||
#elif defined(__TARGET_OS__Android)
|
|
||||||
const char * osMode = "Android";
|
|
||||||
#elif defined(__TARGET_OS__Windows)
|
|
||||||
const char * osMode = "Windows";
|
|
||||||
#elif defined(__TARGET_OS__IOs)
|
|
||||||
const char * osMode = "IOs";
|
|
||||||
#elif defined(__TARGET_OS__MacOs)
|
|
||||||
const char * osMode = "MacOs";
|
|
||||||
#else
|
|
||||||
const char * osMode = "Unknown";
|
|
||||||
#endif
|
|
||||||
APPL_INFO("==> Init "PROJECT_NAME" (START) [" << osMode << "] (" << debugMode << ")");
|
|
||||||
|
|
||||||
ewol::ChangeSize(ivec2(800, 600));
|
// TODO : Remove this : Move if in the windows properties
|
||||||
etk::InitDefaultFolder(PROJECT_NAME);
|
_context.SetSize(vec2(800, 600));
|
||||||
|
|
||||||
|
// select internal data for font ...
|
||||||
|
_context.GetFontDefault().SetUseExternal(true);
|
||||||
#ifdef __TARGET_OS__Android
|
#ifdef __TARGET_OS__Android
|
||||||
ewol::config::FontSetDefault("FreeSerif", 19);
|
_context.GetFontDefault().Set("FreeSerif", 19);
|
||||||
#else
|
#else
|
||||||
ewol::config::FontSetDefault("FreeSerif", 14);
|
_context.GetFontDefault().Set("FreeSerif;DejaVuSansMono",14);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// set the application icon ...
|
// set the application icon ...
|
||||||
ewol::SetIcon("DATA:icon.png");
|
_context.SetIcon("DATA:icon.png");
|
||||||
|
|
||||||
// init internal global value
|
// init internal global value
|
||||||
globals::init();
|
globals::Init();
|
||||||
// set the application icon ...
|
|
||||||
ewol::SetIcon("DATA:icon.png");
|
|
||||||
|
|
||||||
|
|
||||||
// init ALL Singleton :
|
// init ALL Singleton :
|
||||||
//(void)CTagsManager::getInstance();
|
//(void)CTagsManager::getInstance();
|
||||||
@@ -98,56 +79,63 @@ void APP_Init(void)
|
|||||||
HighlightManager::loadLanguages();
|
HighlightManager::loadLanguages();
|
||||||
cTagsManager::Init();
|
cTagsManager::Init();
|
||||||
|
|
||||||
|
// Request load of the user configuration ...
|
||||||
|
//ewol::userConfig::Load();
|
||||||
|
|
||||||
char cCurrentPath[FILENAME_MAX];
|
char cCurrentPath[FILENAME_MAX];
|
||||||
// get the curent program folder
|
// get the curent program folder
|
||||||
if (!getcwd(cCurrentPath, FILENAME_MAX)) {
|
if (!getcwd(cCurrentPath, FILENAME_MAX)) {
|
||||||
return ;
|
return false;
|
||||||
}
|
}
|
||||||
cCurrentPath[FILENAME_MAX - 1] = '\0';
|
cCurrentPath[FILENAME_MAX - 1] = '\0';
|
||||||
//APPL_INFO("The current working directory is " << cCurrentPath);
|
//APPL_INFO("The current working directory is " << cCurrentPath);
|
||||||
|
|
||||||
basicWindows = new MainWindows();
|
MainWindows* basicWindows = new MainWindows();
|
||||||
|
|
||||||
if (NULL == basicWindows) {
|
if (NULL == basicWindows) {
|
||||||
APPL_ERROR("Can not allocate the basic windows");
|
APPL_ERROR("Can not allocate the basic windows");
|
||||||
ewol::Stop();
|
_context.Stop();
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
// create the specific windows
|
// create the specific windows
|
||||||
ewol::WindowsSet(basicWindows);
|
_context.SetWindows(basicWindows);
|
||||||
|
|
||||||
|
|
||||||
// add files
|
// add files
|
||||||
APPL_INFO("show list of files : ");
|
APPL_INFO("show list of files : ");
|
||||||
bool ctagDetected = false;
|
bool ctagDetected = false;
|
||||||
for( int32_t iii=0 ; iii<ewol::commandLine::Size(); iii++) {
|
for( int32_t iii=0 ; iii<_context.GetCmd().Size(); iii++) {
|
||||||
etk::UString tmpppp = ewol::commandLine::Get(iii);
|
etk::UString tmpppp = _context.GetCmd().Get(iii);
|
||||||
if (tmpppp == "-t") {
|
if (tmpppp == "-t") {
|
||||||
ctagDetected = true;
|
ctagDetected = true;
|
||||||
} else if (true == ctagDetected) {
|
} else if (true == ctagDetected) {
|
||||||
APPL_INFO("Load ctag file : \"" << tmpppp << "\"" );
|
APPL_INFO("Load ctag file : \"" << tmpppp << "\"" );
|
||||||
ctagDetected = false;
|
ctagDetected = false;
|
||||||
ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgCtagsLoadFile, tmpppp);
|
_context.GetEObjectManager().MultiCast().AnonymousSend(ednMsgCtagsLoadFile, tmpppp);
|
||||||
} else {
|
} else {
|
||||||
APPL_INFO("need load file : \"" << tmpppp << "\"" );
|
APPL_INFO("need load file : \"" << tmpppp << "\"" );
|
||||||
ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgOpenFile, tmpppp);
|
_context.GetEObjectManager().MultiCast().AnonymousSend(ednMsgOpenFile, tmpppp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
APPL_INFO("==> Init Edn (END)");
|
APPL_INFO("==> Init "PROJECT_NAME" (END)");
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief main application function Un-Initialisation
|
* @brief main application function Un-Initialisation
|
||||||
*/
|
*/
|
||||||
void APP_UnInit(void)
|
void APP_UnInit(ewol::eContext& _context)
|
||||||
{
|
{
|
||||||
APPL_INFO("==> Un-Init Edn (START)");
|
APPL_INFO("==> Un-Init "PROJECT_NAME" (START)");
|
||||||
|
ewol::Windows* tmpWindows = _context.GetWindows();
|
||||||
|
|
||||||
if (NULL != basicWindows) {
|
_context.SetWindows(NULL);
|
||||||
delete(basicWindows);
|
|
||||||
basicWindows = NULL;
|
if (NULL != tmpWindows) {
|
||||||
|
delete(tmpWindows);
|
||||||
|
tmpWindows = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
cTagsManager::UnInit();
|
cTagsManager::UnInit();
|
||||||
@@ -159,6 +147,6 @@ void APP_UnInit(void)
|
|||||||
BufferManager::UnInit();
|
BufferManager::UnInit();
|
||||||
APPL_INFO("Stop ColorizeManager");
|
APPL_INFO("Stop ColorizeManager");
|
||||||
ColorizeManager::UnInit();
|
ColorizeManager::UnInit();
|
||||||
APPL_INFO("==> Un-Init Edn (END)");
|
APPL_INFO("==> Un-Init "PROJECT_NAME" (END)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,69 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
### Files Listes ###
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# ExuberantCtags reading file tools (extern OPEN Sources) :
|
|
||||||
FILE_LIST+= appl/ctags/readtags.cpp \
|
|
||||||
appl/ctags/CTagsManager.cpp
|
|
||||||
|
|
||||||
# Globals debug tool:
|
|
||||||
FILE_LIST+= appl/Debug.cpp \
|
|
||||||
appl/global.cpp \
|
|
||||||
appl/globalMsg.cpp
|
|
||||||
|
|
||||||
# Gui:
|
|
||||||
FILE_LIST+= appl/Gui/BufferView.cpp \
|
|
||||||
appl/Gui/CodeView.cpp \
|
|
||||||
appl/Gui/MainWindows.cpp \
|
|
||||||
appl/Gui/Search.cpp \
|
|
||||||
appl/Gui/SearchData.cpp \
|
|
||||||
appl/Gui/TagFileSelection.cpp \
|
|
||||||
appl/Gui/TagFileList.cpp
|
|
||||||
|
|
||||||
# All needed for the buffer management :
|
|
||||||
FILE_LIST+= appl/Buffer/EdnBuf/EdnBuf.cpp \
|
|
||||||
appl/Buffer/EdnBuf/EdnBuf_HighLight.cpp \
|
|
||||||
appl/Buffer/EdnBuf/EdnBuf_History.cpp \
|
|
||||||
appl/Buffer/EdnBuf/EdnBuf_Selection.cpp \
|
|
||||||
appl/Buffer/EdnBuf/EdnBufHistory.cpp \
|
|
||||||
appl/Buffer/BufferText.cpp \
|
|
||||||
appl/Buffer/BufferManager.cpp
|
|
||||||
|
|
||||||
# Generic color management for the text editor :
|
|
||||||
FILE_LIST+= appl/Colorize/Colorize.cpp \
|
|
||||||
appl/Colorize/ColorizeManager.cpp
|
|
||||||
|
|
||||||
# syntax coloration for the text editor
|
|
||||||
FILE_LIST+= appl/Highlight/HighlightPattern.cpp \
|
|
||||||
appl/Highlight/Highlight.cpp \
|
|
||||||
appl/Highlight/HighlightManager.cpp
|
|
||||||
|
|
||||||
# Main entry file :
|
|
||||||
FILE_LIST+= appl/init.cpp
|
|
||||||
|
|
||||||
|
|
||||||
LOCAL_COPY_FOLDERS := ../data/icon.*: \
|
|
||||||
../data/color/*.xml:color/ \
|
|
||||||
../data/languages/asm/*.xml:languages/asm/ \
|
|
||||||
../data/languages/bash/*.xml:languages/bash/ \
|
|
||||||
../data/languages/boo/*.xml:languages/boo/ \
|
|
||||||
../data/languages/c/*.xml:languages/c/ \
|
|
||||||
../data/languages/glsl/*.xml:languages/glsl/ \
|
|
||||||
../data/languages/in/*.xml:languages/in/ \
|
|
||||||
../data/languages/java/*.xml:languages/java/ \
|
|
||||||
../data/languages/lua/*.xml:languages/lua/ \
|
|
||||||
../data/languages/makefile/*.xml:languages/makefile/ \
|
|
||||||
../data/languages/matlab/*.xml:languages/matlab/ \
|
|
||||||
../data/languages/php/*.xml:languages/php/ \
|
|
||||||
../data/languages/xml/*.xml:languages/xml/ \
|
|
||||||
../data/theme/default/*.svg:theme/default/
|
|
||||||
|
|
||||||
LOCAL_COPY_FILES :=
|
|
||||||
|
|
||||||
ifneq ($(__EWOL_INTEGRATED_FONT__),$(empty))
|
|
||||||
|
|
||||||
LOCAL_COPY_FILES := ../data/Font/freefont/FreeSerif.ttf:fonts/FreeSerif.ttf
|
|
||||||
LOCAL_COPY_FOLDERS += ../data/Font/freefont/FreeMon*.ttf:fonts
|
|
||||||
endif
|
|
111
sources/lutin_edn.py
Executable file
111
sources/lutin_edn.py
Executable file
@@ -0,0 +1,111 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
import lutinModule
|
||||||
|
import lutinTools
|
||||||
|
import datetime
|
||||||
|
|
||||||
|
def Create(target):
|
||||||
|
# module name is 'edn' and type binary.
|
||||||
|
myModule = lutinModule.module(__file__, 'edn', 'PACKAGE')
|
||||||
|
# add the file to compile:
|
||||||
|
myModule.AddSrcFile([
|
||||||
|
'appl/ctags/readtags.cpp',
|
||||||
|
'appl/ctags/CTagsManager.cpp'])
|
||||||
|
|
||||||
|
myModule.AddSrcFile([
|
||||||
|
'appl/Debug.cpp',
|
||||||
|
'appl/global.cpp',
|
||||||
|
'appl/globalMsg.cpp',
|
||||||
|
'appl/init.cpp'])
|
||||||
|
|
||||||
|
# Gui:
|
||||||
|
myModule.AddSrcFile([
|
||||||
|
'appl/Gui/BufferView.cpp',
|
||||||
|
'appl/Gui/CodeView.cpp',
|
||||||
|
'appl/Gui/MainWindows.cpp',
|
||||||
|
'appl/Gui/Search.cpp',
|
||||||
|
'appl/Gui/SearchData.cpp',
|
||||||
|
'appl/Gui/TagFileSelection.cpp',
|
||||||
|
'appl/Gui/TagFileList.cpp'])
|
||||||
|
|
||||||
|
# All needed for the buffer management :
|
||||||
|
myModule.AddSrcFile([
|
||||||
|
'appl/Buffer/EdnBuf/EdnBuf.cpp',
|
||||||
|
'appl/Buffer/EdnBuf/EdnBuf_HighLight.cpp',
|
||||||
|
'appl/Buffer/EdnBuf/EdnBuf_History.cpp',
|
||||||
|
'appl/Buffer/EdnBuf/EdnBuf_Selection.cpp',
|
||||||
|
'appl/Buffer/EdnBuf/EdnBufHistory.cpp',
|
||||||
|
'appl/Buffer/BufferText.cpp',
|
||||||
|
'appl/Buffer/BufferManager.cpp'])
|
||||||
|
|
||||||
|
# Generic color management for the text editor :
|
||||||
|
myModule.AddSrcFile([
|
||||||
|
'appl/Colorize/Colorize.cpp',
|
||||||
|
'appl/Colorize/ColorizeManager.cpp'])
|
||||||
|
|
||||||
|
# syntax coloration for the text editor
|
||||||
|
myModule.AddSrcFile([
|
||||||
|
'appl/Highlight/HighlightPattern.cpp',
|
||||||
|
'appl/Highlight/Highlight.cpp',
|
||||||
|
'appl/Highlight/HighlightManager.cpp'])
|
||||||
|
|
||||||
|
myModule.AddModuleDepend('ewol')
|
||||||
|
|
||||||
|
myModule.CompileFlags_CC([
|
||||||
|
"-DPROJECT_NAME=\"\\\""+myModule.name+"\\\"\""])
|
||||||
|
|
||||||
|
myModule.CopyFile('../data/icon.png','icon.png')
|
||||||
|
|
||||||
|
myModule.CopyFolder('../data/icon.*','')
|
||||||
|
myModule.CopyFolder('../data/color/*.xml','color/')
|
||||||
|
myModule.CopyFolder('../data/languages/asm/*.xml','languages/asm/')
|
||||||
|
myModule.CopyFolder('../data/languages/bash/*.xml','languages/bash/')
|
||||||
|
myModule.CopyFolder('../data/languages/boo/*.xml','languages/boo/')
|
||||||
|
myModule.CopyFolder('../data/languages/c/*.xml','languages/c/')
|
||||||
|
myModule.CopyFolder('../data/languages/glsl/*.xml','languages/glsl/')
|
||||||
|
myModule.CopyFolder('../data/languages/in/*.xml','languages/in/')
|
||||||
|
myModule.CopyFolder('../data/languages/java/*.xml','languages/java/')
|
||||||
|
myModule.CopyFolder('../data/languages/json/*.xml','languages/json/')
|
||||||
|
myModule.CopyFolder('../data/languages/lua/*.xml','languages/lua/')
|
||||||
|
myModule.CopyFolder('../data/languages/makefile/*.xml','languages/makefile/')
|
||||||
|
myModule.CopyFolder('../data/languages/matlab/*.xml','languages/matlab/')
|
||||||
|
myModule.CopyFolder('../data/languages/php/*.xml','languages/php/')
|
||||||
|
myModule.CopyFolder('../data/languages/xml/*.xml','languages/xml/')
|
||||||
|
myModule.CopyFolder('../data/languages/python/*.xml','languages/python/')
|
||||||
|
myModule.CopyFolder('../data/theme/default/*.svg','theme/default/')
|
||||||
|
|
||||||
|
myModule.AddPath(lutinTools.GetCurrentPath(__file__))
|
||||||
|
myModule.AddPath(lutinTools.GetCurrentPath(__file__)+"/appl")
|
||||||
|
myModule.AddPath(lutinTools.GetCurrentPath(__file__)+"/appl/Buffer")
|
||||||
|
myModule.AddPath(lutinTools.GetCurrentPath(__file__)+"/appl/Buffer/EdnBuf")
|
||||||
|
myModule.AddPath(lutinTools.GetCurrentPath(__file__)+"/appl/Colorize")
|
||||||
|
myModule.AddPath(lutinTools.GetCurrentPath(__file__)+"/appl/ctags")
|
||||||
|
myModule.AddPath(lutinTools.GetCurrentPath(__file__)+"/appl/Gui")
|
||||||
|
myModule.AddPath(lutinTools.GetCurrentPath(__file__)+"/appl/Highlight")
|
||||||
|
|
||||||
|
|
||||||
|
myModule.CopyFile("../data/Font/freefont/FreeSerif.ttf","fonts/FreeSerif.ttf")
|
||||||
|
myModule.CopyFolder("../data/Font/freefont/FreeMon*.ttf","fonts/")
|
||||||
|
|
||||||
|
now = datetime.datetime.now()
|
||||||
|
versionID=str(now.year-2012)+"."+str(now.month)+"."+str(now.day)
|
||||||
|
|
||||||
|
# set the package properties :
|
||||||
|
myModule.pkgSet("VERSION", versionID)
|
||||||
|
myModule.pkgSet("COMPAGNY_TYPE", "org")
|
||||||
|
myModule.pkgSet("COMPAGNY_NAME", "Edouard DUPIN")
|
||||||
|
myModule.pkgSet("MAINTAINER", ["Mr DUPIN Edouard <yui.heero@gmail.com>"])
|
||||||
|
myModule.pkgSet("ICON", lutinTools.GetCurrentPath(__file__) + "/../data/icon.png")
|
||||||
|
myModule.pkgSet("SECTION", ["Development", "Editors"])
|
||||||
|
myModule.pkgSet("PRIORITY", "optional")
|
||||||
|
myModule.pkgSet("DESCRIPTION", "Text editor for sources code with ctags management")
|
||||||
|
myModule.pkgSet("NAME", "Editeur de N'ours")
|
||||||
|
|
||||||
|
myModule.pkgAdd("RIGHT", "WRITE_EXTERNAL_STORAGE")
|
||||||
|
myModule.pkgAdd("RIGHT", "SET_ORIENTATION")
|
||||||
|
|
||||||
|
# add the currrent module at the
|
||||||
|
return myModule
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user