44 Commits
0.4.0 ... 1.0

Author SHA1 Message Date
8af2e7902d [DEV] add line at 80 char limitation and set tab at 8 char (not configurable for now) 2013-10-25 09:19:28 +02:00
6459d11737 [DEV] correction of the buffer new api 2013-09-25 15:20:58 +02:00
c1ab16ec1f [DEV] add color at the /* TODO : */ 2013-09-17 17:48:04 +02:00
4d7f4d8531 [DEV] remove the end error 2013-09-02 21:06:50 +02:00
ad12b68ead [DEV] update to the new ewol system 2013-09-02 06:45:12 +02:00
b5371c4d13 [DEV] add json parsing 2013-08-01 23:22:58 +02:00
0240bced14 [DEV] update at the new color class 2013-07-09 15:18:53 +02:00
3747bffa2f [DEV] update last exml 2013-06-30 17:01:02 +02:00
1864f9aa75 [DEV] a little change in the exml lib 2013-06-28 22:13:21 +02:00
0a12bd17ed [DEV] add multiple font request 2013-06-27 21:40:48 +02:00
757a9a49ee [DEV] update for debian 2013-06-27 07:26:31 +02:00
6422d91883 [DEV] aupdate at exml api ==> tested and validate 2013-06-26 23:48:23 +02:00
24bb4f515c [DEV] start move to exml 2013-06-24 21:17:45 +02:00
86552172d7 [DEV] do not open folder like file (not open at all) 2013-06-12 22:58:11 +02:00
dcdfbe3647 [DEV] Save configuration of the user 2013-05-28 22:09:53 +02:00
421dc0c404 [DEV] revove dependency of the build date (use external lib) 2013-05-25 10:59:50 +02:00
9678d46cb1 [DISPLAY] english correction 2013-05-23 21:24:44 +02:00
1724955f67 [DEV] display code correction 2013-05-22 21:28:26 +02:00
543cd8ddf1 [DEV] editork work again like as previous 2013-05-21 09:50:19 +02:00
7b456f1cdb [DEV] change color of member 2013-05-21 09:11:50 +02:00
cd8b5772e9 Revert "[DEV] BROKEN-gitcc start dev of a naw mode of display for the Internal system"
This reverts commit 0633355169.
2013-05-21 09:11:14 +02:00
0633355169 [DEV] BROKEN-gitcc start dev of a naw mode of display for the Internal system 2013-05-14 23:20:17 +02:00
52ac167872 [DEV] update the system interface 2013-05-12 21:08:31 +02:00
b55be0aeca [DEV] change the input and entry event function 2013-05-08 12:13:49 +02:00
e325bffc5e [RM] remove some deprecated files 2013-04-26 22:49:49 +02:00
b47d6f359d [DEV] remove old maker ==> replace by lutin 2013-04-24 21:33:38 +02:00
7d3e8d4d26 [DEBUG] date correction in maker 2013-04-24 21:33:38 +02:00
e85a34c988 [DEV] change date and time in only date to prevent multiple rebuild in one day 2013-04-24 12:48:28 +02:00
9f7af89567 [DEV] add the package property ok 2013-04-23 21:44:49 +02:00
8c241ef106 [DEV] add the package properties of the edn package 2013-04-22 21:57:24 +02:00
73c2e6a547 [DEV] change build to lutin mode 2013-04-21 22:15:45 +02:00
c5b6519dc6 [DEV] build the soft with the new builder 2013-04-18 18:02:27 +02:00
df24216dac [DEV] First file compiled with new python maker 2013-04-18 01:56:40 +02:00
b8c819936e [DEV] add python parser and start work on the python makefile 2013-04-17 21:40:05 +02:00
91c1201f69 [DEV] mac : missing font 2013-04-16 22:41:03 +02:00
3aac9ab9a7 [DEV] seems to work not so bak with the new ewol rework 2013-04-15 21:12:13 +02:00
e6d078e0c9 [DEV] add capacity od C highlight 2013-04-15 09:11:18 +02:00
af417b44f0 [DEV] work better than previously but this is the start of rework 2013-04-14 13:58:59 +02:00
aabc92f309 [DEV] base rework 2013-04-10 22:04:54 +02:00
46969e15b1 [DEV] mac dev ... 2013-04-07 23:40:49 +02:00
e1d2c2a3c7 [DEV] adapte to the EWOL modification of Sizer and const string callback 2013-03-25 21:30:16 +01:00
4139e88a6c [DEV] update config 2013-03-11 21:10:19 +01:00
dd6f05540f (DEV) add MacOs config and makefile 2013-03-09 17:33:28 +01:00
d2f2afd129 update android config 2013-03-03 20:58:59 +01:00
54 changed files with 1410 additions and 1670 deletions

View File

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

View File

@@ -20,25 +20,23 @@ download the software :
git clone git://github.com/HeeroYui/edn.git
cd edn
(debug) Compile software & Run debug version:
make DEBUG=1
../ewol/build/lutin.py --color --mode=debug
or
make CLANG=1 DEBUG=1
./out/Linux/debug/staging/edn/usr/bin/edn -l6 yourFile.txt
../ewol/build/lutin.py --color --compilator=clang --mode=debug
./out/Linux/debug/staging/edn//usr/bin/edn -l6 yourFile.txt
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:
# generate binary and tree
make
# generate .deb packages
make final
# install .deb packages
make install
# generate binary, tree, package and install it ...
../ewol/build/lutin.py -c edn-install
edn exemple.txt
(Android) Compile software & install
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
cd ../edn
# generate .so
make PLATFORM=Android
# generate .apk
make PLATFORM=Android final
# To send it on the board :
make PLATFORM=Android install
../ewol/build/lutin.py --color --target=Android --mode=debug edn-install
# to show the log :
make PLATFORM=Android log
../ewol/build/lutin.py --target=Android edn-log
(Windows) Compile software & install
cd yourDevFolder/edn
make PLATFORM=Windows
# generate ...
make PLATFORM=Windows final
../ewol/build/lutin.py --color --target=Windows --mode=debug
(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
===================
sudo apt-get install g++ libgl1-mesa-dev zlib1g-dev libasound2-dev
# if you want to compile with clang :
sudo apt-get install clang
@@ -77,7 +84,7 @@ Dependency packages
sudo apt-get install mingw32
License (GPL)
License (GPLv3)
==================
Edn (Editeur De N'ours) : Source code editor

View File

@@ -1,35 +1,35 @@
#
# Automatically generated make config: don't edit
# Linux kernel version:
# Automatically generated file; DO NOT EDIT.
# Linux Kernel Configuration
#
#
# Modules
#
CONFIG_BUILD_EDN=y
# 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_EWOL is not set
# CONFIG_BUILD_FREETYPE is not set
# CONFIG_BUILD_LUA is not set
# CONFIG_BUILD_OGG is not set
# CONFIG_BUILD_PARSERSVG is not set
# CONFIG_BUILD_LIBPNG is not set
# CONFIG_BUILD_PORTAUDIO is not set
# CONFIG_BUILD_TINYXML is not set
# CONFIG_BUILD_ZLIB is not set
# CONFIG_BUILD_LIBZIP is not set
# CONFIG_BUILD_EWOL is not set
CONFIG_BUILD_EDN=y
#
# edn
# ewol
#
#
# General
#
CONFIG_APPL_BUFFER_FONT_NORMAL=y
# CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set
CONFIG___EWOL_APPL_BASIC_TITLE__="Edn : Sources Code Editor"
CONFIG___EWOL_INTEGRATED_FONT__=y
#
# Android
@@ -40,7 +40,6 @@ CONFIG___EWOL_ANDROID_ORIENTATION_AUTO__=y
# CONFIG___EWOL_ANDROID_ORIENTATION_LANDSCAPE__ is not set
# CONFIG___EWOL_ANDROID_ORIENTATION_PORTRAIT__ is not set
#
# Permissions
#
@@ -57,15 +56,13 @@ CONFIG___ANDROID_PERMISSION__WRITE_EXTERNAL_STORAGE__=y
# CONFIG___ANDROID_PERMISSION__VIBRATE__ is not set
# CONFIG___ANDROID_PERMISSION__ACCESS_COARSE_LOCATION__ is not set
# CONFIG___ANDROID_PERMISSION__ACCESS_FINE_LOCATION__ is not set
# CONFIG___VIDEO__OPENGL_ES_1 is not set
#
# ewol
# edn
#
#
# General
#
CONFIG___EWOL_INTEGRATED_FONT__=y
CONFIG___EWOL_APPL_BASIC_TITLE__="Edn : Sources Code Editor"
CONFIG_APPL_BUFFER_FONT_NORMAL=y
# CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set

View File

@@ -6,10 +6,9 @@
#
# Modules
#
CONFIG_BUILD_EDN=y
# CONFIG_BUILD_AGG is not set
CONFIG_BUILD_LINEARMATH=y
CONFIG_BUILD_BULLET=y
# 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
@@ -21,16 +20,7 @@ CONFIG_BUILD_BULLET=y
# CONFIG_BUILD_ZLIB is not set
# CONFIG_BUILD_LIBZIP is not set
# CONFIG_BUILD_EWOL is not set
#
# edn
#
#
# General
#
CONFIG_APPL_BUFFER_FONT_NORMAL=y
# CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set
CONFIG_BUILD_EDN=y
#
# 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_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
View 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

View File

@@ -1,15 +1,17 @@
#
# Automatically generated make config: don't edit
# Automatically generated file; DO NOT EDIT.
# Linux Kernel Configuration
#
#
# Modules
#
CONFIG_BUILD_EDN=y
# 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_GLEW=y
# CONFIG_BUILD_GLEW is not set
# CONFIG_BUILD_LUA is not set
# CONFIG_BUILD_OGG 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_LIBZIP is not set
# CONFIG_BUILD_EWOL is not set
#
# edn
#
#
# General
#
CONFIG_APPL_BUFFER_FONT_NORMAL=y
# CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set
CONFIG_BUILD_EDN=y
#
# ewol
@@ -38,3 +31,13 @@ CONFIG_APPL_BUFFER_FONT_NORMAL=y
#
CONFIG___EWOL_APPL_BASIC_TITLE__="Ewol Basic Title"
CONFIG___EWOL_INTEGRATED_FONT__=y
#
# edn
#
#
# General
#
CONFIG_APPL_BUFFER_FONT_NORMAL=y
# CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set

View File

@@ -21,6 +21,8 @@
<!-- hightline description : -->
<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="number" FG="#007b00"/>
<color name="systemFunction" FG="#acaa00"/>

View File

@@ -5,6 +5,7 @@
<ext>*.cc</ext>
<ext>*.h</ext>
<ext>*.hpp</ext>
<ext>*.mm</ext>
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="my comment multiline doxygen">
<color>commentDoxygen</color>
@@ -23,7 +24,7 @@
</rule>
<rule name="code Review">
<color>SYNTAX_ERROR</color>
<start>/\*[ \t]*@review</start>
<start>/\*[ \t]*TODO :</start>
<end>\*/</end>
</rule>
<rule name="my comment multiline">
@@ -88,7 +89,7 @@
</rule>
<rule name="my storage keyword">
<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 name="my common Define">
<color>commonDefine</color>
@@ -106,6 +107,14 @@
<color>macro</color>
<start>\@[A-Z_][A-Z_0-9]{3,500}\@</start>
</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">
<color>functionName</color>
<start>\@(\w|_)+[ \t]*\(</start>

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

View File

@@ -25,7 +25,7 @@
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="confition">
<color>type</color>
<start>\@if|ifed|ifneq|else|endif\@</start>
<start>\@if|ifeq|ifneq|else|endif|define|endef\@</start>
</rule>
<rule name="my keyword">
<color>keyword</color>
@@ -33,7 +33,7 @@
</rule>
<rule name="function call">
<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 name="condition">
<color>boolean</color>

View 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>==|&lt;=|&gt;=|!=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}|</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>

View File

@@ -28,7 +28,7 @@
</rule>
<rule name="normale Balise">
<color>functionName</color>
<start>&lt;/[0-9a-fA-F_]*|&lt;[0-9a-fA-F_]*|/&gt;|&gt;</start>
<start>&lt;/[0-9a-zA-Z_]+|&lt;[0-9a-zA-Z_]+|/&gt;|&gt;</start>
</rule>
</pass2>
</EdnLang>

View File

@@ -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
View File

@@ -0,0 +1,6 @@
#!/usr/bin/python
import lutinModule
import lutinTools
lutinModule.ImportPath(lutinTools.GetCurrentPath(__file__) + "/sources/")
lutinModule.ImportPath(lutinTools.GetCurrentPath(__file__) + "/../ewol/")

View File

@@ -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)

View File

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

View File

@@ -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)

View File

@@ -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)

View File

@@ -9,8 +9,8 @@
#include <appl/Debug.h>
#include <appl/global.h>
#include <BufferManager.h>
#include <ewol/eObject/EObject.h>
#include <ewol/eObject/EObjectManager.h>
#include <ewol/renderer/EObject.h>
#include <ewol/renderer/EObjectManager.h>
#undef __class__
#define __class__ "classBufferManager"
@@ -21,25 +21,12 @@ class classBufferManager: public ewol::EObject
// Constructeur
classBufferManager(void);
~classBufferManager(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void)
{
return "ApplBufferManager";
}
public:
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
virtual void OnReceiveMessage(const ewol::EMessage& _msg);
private:
// return the ID of the buffer allocated
// create a buffer with no element
@@ -70,14 +57,6 @@ class classBufferManager: public ewol::EObject
// Constructeur
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
classBufferManager::classBufferManager(void)
{
m_idSelected = -1;
@@ -89,14 +68,6 @@ classBufferManager::classBufferManager(void)
RegisterMultiCast(ednMsgBufferId);
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
classBufferManager::~classBufferManager(void)
{
//clean All Buffer
@@ -108,24 +79,17 @@ classBufferManager::~classBufferManager(void)
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
void classBufferManager::OnReceiveMessage(const ewol::EMessage& _msg)
{
ewol::EObject::OnReceiveMessage(CallerObject, eventId, data);
ewol::EObject::OnReceiveMessage(_msg);
if (eventId == ednMsgBufferId) {
if (_msg.GetMessage() == ednMsgBufferId) {
// select a new buffer ID :
if (data == "") {
if (_msg.GetData() == "") {
APPL_ERROR("Request select buffer ID = \"\" ");
} else {
int32_t newID = -1;
sscanf(data.c_str(), "%d", &newID);
sscanf(_msg.GetData().c_str(), "%d", &newID);
if(true == Exist(newID)) {
m_idSelected = newID;
} else {
@@ -133,17 +97,18 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
APPL_ERROR("Request a non existant ID : " << newID << " reset to -1...");
}
}
} else if (eventId == ednMsgGuiNew) {
} else if (_msg.GetMessage() == ednMsgGuiNew) {
int32_t newOne = Create();
if (-1 != newOne) {
m_idSelected = newOne;
SendMultiCast(ednMsgBufferId, m_idSelected);
SendMultiCast(ednMsgBufferListChange);
}
} else if (eventId == ednMsgOpenFile) {
if (data != "" ) {
etk::FSNode myFile(data);
APPL_DEBUG("request open file = \"" <<data << "\" ?= \"" << myFile << "\"");
} else if (_msg.GetMessage() == ednMsgOpenFile) {
if (_msg.GetData() != "" ) {
etk::FSNode myFile(_msg.GetData());
if (myFile.GetNodeType() == etk::FSN_FILE) {
APPL_DEBUG("request open file = \"" << _msg.GetData() << "\" ?= \"" << myFile << "\"");
int32_t newOne = Open(myFile);
if (-1 != 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...
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 ... ");
} else {
if (data == "current") {
if (_msg.GetData() == "current") {
// Check buffer existence
if(true == Exist(m_idSelected)) {
// If no name ==> request a Gui display ...
@@ -170,7 +138,7 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
}
} else {
int32_t newId;
sscanf(data.c_str(), "%d", &newId);
sscanf(_msg.GetData().c_str(), "%d", &newId);
if (false == Exist(newId)) {
APPL_ERROR("Request a save As with a non existant ID=" << newId);
} else {
@@ -184,20 +152,20 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
SendMultiCast(ednMsgBufferState, "saved");
}
}
} else if (eventId == ednMsgGuiClose) {
if (data == "") {
} else if (_msg.GetMessage() == ednMsgGuiClose) {
if (_msg.GetData() == "") {
APPL_ERROR("Null data for close file ... ");
} else {
if (data == "All") {
if (_msg.GetData() == "All") {
} else {
int32_t closeID = -1;
if (data == "current") {
if (_msg.GetData() == "current") {
closeID = m_idSelected;
APPL_DEBUG("Close specific buffer ID" << closeID);
} else {
// close specific buffer ...
sscanf(data.c_str(), "%d", &closeID);
sscanf(_msg.GetData().c_str(), "%d", &closeID);
APPL_DEBUG("Close specific buffer ID="<< 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
if (data == "") {
if (_msg.GetData() == "") {
APPL_ERROR("Null data for changing buffer ID file ... ");
} else {
int32_t newId;
sscanf(data.c_str(), "%d", &newId);
sscanf(_msg.GetData().c_str(), "%d", &newId);
if (true == Exist(newId)) {
m_idSelected = newId;
} else {

View File

@@ -16,6 +16,7 @@
#include <ewol/widget/WidgetManager.h>
#include <ewol/widget/Widget.h>
#include <ewol/clipBoard.h>
#include <ewol/renderer/eContext.h>
#undef __class__
@@ -92,7 +93,7 @@ void BufferText::SetModify(bool status)
m_fileModify = status;
// TODO : Remove from here
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() << ")");
etk::FSNode myFile(fileName);
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);
SetModify(true);
} else {
m_EdnBuf.DumpFrom(myFile);
myFile.FileClose();
SetModify(false);
}
} else {
@@ -197,11 +196,9 @@ void BufferText::Save(void)
{
APPL_INFO("Save File : \"" << 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");
} else {
m_EdnBuf.DumpIn(myFile);
myFile.FileClose();
SetModify(false);
}
}
@@ -338,8 +335,8 @@ int32_t BufferText::Display(ewol::Text& OOText,
// Get color :
Colorize * myColor = ColorizeManager::Get("normal");
Colorize * myColorSel = ColorizeManager::Get("SelectedText");
draw::Color & myColorSpace = ColorizeManager::Get(COLOR_CODE_SPACE);
draw::Color & myColorTab = ColorizeManager::Get(COLOR_CODE_TAB);
etk::Color<> & myColorSpace = ColorizeManager::Get(COLOR_CODE_SPACE);
etk::Color<> & myColorTab = ColorizeManager::Get(COLOR_CODE_TAB);
Colorize * selectColor = NULL;
int mylen = m_EdnBuf.Size();
int32_t x_base=nbColoneForLineNumber*letterWidth;
@@ -408,12 +405,12 @@ int32_t BufferText::Display(ewol::Text& OOText,
if (currentChar!='\n') {
selectColor = myColor;
HLColor = m_EdnBuf.GetElementColorAtPosition(m_displayLocalSyntax, iii);
if (NULL != HLColor) {
if (NULL != HLColor->patern) {
if (HLColor != NULL) {
if (HLColor->patern != NULL) {
selectColor = HLColor->patern->GetColor();
}
}
OOText.SetColorBg(draw::color::none);
OOText.SetColorBg(etk::color::none);
if( true == selHave
&& selStart <= iii
&& selEnd > iii)
@@ -422,12 +419,12 @@ int32_t BufferText::Display(ewol::Text& OOText,
OOText.SetColorBg(selectColor->GetBG() );
} else {
if(false == selectColor->HaveBg()) {
if( (uniChar_t)' ' == currentChar
&& true == globals::IsSetDisplaySpaceChar() )
if( currentChar == ' '
&& globals::IsSetDisplaySpaceChar() == true )
{
OOText.SetColorBg(myColorSpace);
} else if( '\t' == currentChar
&& true == globals::IsSetDisplayTabChar() )
} else if( currentChar == '\t'
&& globals::IsSetDisplayTabChar() == true )
{
OOText.SetColorBg(myColorTab);
}
@@ -487,12 +484,19 @@ int32_t BufferText::Display(ewol::Text& OOText,
OOText.SetColorBg(ColorizeManager::Get(COLOR_CODE_CURSOR));
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 ...
SetMaximumSize(maxSize);
int64_t stopTime2 = ewol::GetTime();
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 ...
if (true == m_EdnBuf.GetUTF8Mode()) {
char tmpUTF8[16];
unicode::convertUnicodeToUtf8(unicodeData, tmpUTF8);
unicodeData.GetUtf8(tmpUTF8);
etk::Vector<int8_t> tmpVect;
int32_t localOfset = strlen(tmpUTF8);
tmpVect.PushBack((int8_t*)tmpUTF8, localOfset);

View File

@@ -34,7 +34,8 @@ static const char *ControlCodeTable[32] = {
*/
EdnBuf::EdnBuf(void)
{
m_tabDist = 4;
// TODO : Set it configurable !!!
m_tabDist = 8;
m_useTabs = true;
// 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"
*
*/
int8_t EdnBuf::operator[] (int32_t pos)
int8_t EdnBuf::operator[] (int32_t pos) const
{
int8_t res = m_data.Get(pos);
return res;
@@ -240,12 +241,13 @@ int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::UString &insertText)
GetRange(start, end, deletedText);
etk::Vector<int8_t> tmpInsertText;
if (true == m_isUtf8) {
char * tmpPointer = insertText.c_str();
etk::Char tmpChar = insertText.c_str();
const char * tmpPointer = tmpChar;
while (*tmpPointer != '\0') {
tmpInsertText.PushBack(*tmpPointer++);
}
} else {
etk::Vector<unsigned int> tmppp = insertText.GetVector();
etk::Vector<uniChar_t> tmppp = insertText.GetVector();
convertUnicodeToIso(m_charsetType, tmppp, tmpInsertText);
}
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
if (false ==m_isUtf8) {
if (m_isUtf8 == false) {
convertIsoToUtf8(m_charsetType, c, outUTF8);
pos++;
} else {
@@ -513,10 +515,10 @@ int32_t EdnBuf::GetExpandedChar(int32_t &pos, int32_t indent, char outUTF8[MAX_E
bool baseValid;
unicode::Utf8_SizeElement(tmpString, 6 , size, baseValid);
currentChar = 0; // TODO : Set UNICODE char ...
if (true == baseValid) {
if (baseValid == true) {
char *tmp = outUTF8;
for (int32_t k=0; k<size; k++) {
*tmp++ = tmpString[k];
for (int32_t kkk=0; kkk<size; kkk++) {
*tmp++ = tmpString[kkk];
}
*tmp = '\0';
} else {
@@ -621,7 +623,7 @@ int32_t EdnBuf::GetExpandedChar(int32_t &pos, int32_t indent, uniChar_t outUnico
tmp[kkk] = tmpString[kkk];
tmp[kkk+1] = '\0';
}
unicode::convertUtf8ToUnicode(tmp, outUnicode[0]);
outUnicode[0].SetUtf8(tmp);
outUnicode[1] = 0;
} else {
outUnicode[0] = '<';
@@ -932,12 +934,13 @@ bool EdnBuf::SearchForward(int32_t startPos, etk::UString &search, int32_t *foun
{
etk::Vector<int8_t> searchVect;
if (true == m_isUtf8) {
char * tmpPointer = search.c_str();
etk::Char tmpChar = search.c_str();
const char * tmpPointer = tmpChar;
while (*tmpPointer != '\0') {
searchVect.PushBack(*tmpPointer++);
}
} else {
etk::Vector<unsigned int> tmppp = search.GetVector();
etk::Vector<etk::UniChar> tmppp = search.GetVector();
convertUnicodeToIso(m_charsetType, tmppp, searchVect);
}
// 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;
if (true == m_isUtf8) {
char * tmpPointer = search.c_str();
etk::Char tmpChar = search.c_str();
const char * tmpPointer = tmpChar;
while (*tmpPointer != '\0') {
searchVect.PushBack(*tmpPointer++);
}
} else {
etk::Vector<unsigned int> tmppp = search.GetVector();
etk::Vector<etk::UniChar> tmppp = search.GetVector();
convertUnicodeToIso(m_charsetType, tmppp, searchVect);
}
// 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;
if (true == m_isUtf8) {
char * tmpPointer = insertText.c_str();
etk::Char tmpChar = insertText.c_str();
const char * tmpPointer = tmpChar;
while (*tmpPointer != '\0') {
tmpInsertText.PushBack(*tmpPointer++);
}
} else {
etk::Vector<unsigned int> tmppp = insertText.GetVector();
etk::Vector<etk::UniChar> tmppp = insertText.GetVector();
convertUnicodeToIso(m_charsetType, tmppp, tmpInsertText);
}
if (tmpInsertText.Size()>0) {

View File

@@ -65,7 +65,7 @@ class EdnBuf {
bool DumpIn( etk::FSNode &file);
bool DumpFrom( etk::FSNode &file);
// 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::UString &insertText);
int32_t Replace( int32_t start, int32_t end, etk::Vector<int8_t> &insertText);

View File

@@ -15,108 +15,35 @@
#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)");
}
Colorize::Colorize(void)
void Colorize::SetItalic(bool _enable)
{
ColorName = "no_name";
m_colorFG = draw::color::black;
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");
m_italic = _enable;
if (true == _enable) {
APPL_VERBOSE("color : \"" << m_colorName << "\" enable italic");
} 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;
}
void Colorize::SetBold(bool enable)
{
bold = enable;
if (true == enable) {
APPL_VERBOSE("color : \"" << ColorName << "\" enable bold");
m_bold = _enable;
if (true == _enable) {
APPL_VERBOSE("color : \"" << m_colorName << "\" enable bold");
} else {
APPL_VERBOSE("color : \"" << ColorName << "\" disable bold");
APPL_VERBOSE("color : \"" << m_colorName << "\" disable bold");
}
}
bool Colorize::GetBold(void)
{
return bold;
}

View File

@@ -8,42 +8,44 @@
#ifndef __COLORIZE_H__
#define __COLORIZE_H__
#include <draw/Color.h>
#include <etk/Color.h>
#include <etk/UString.h>
class Colorize {
public:
// Constructeur
Colorize(void);
Colorize(etk::UString &newColorName);
~Colorize(void);
void SetName(etk::UString &newColorName);
void SetName(const char *newColorName);
etk::UString GetName(void);
void SetFgColor(const char *myColor);
void SetBgColor(const char *myColor);
draw::Color & GetFG(void) { return m_colorFG; };
draw::Color & GetBG(void) { return m_colorBG; };
bool HaveBg(void);
void SetItalic(bool enable);
void SetBold(bool enable);
bool GetItalic(void);
bool GetBold(void);
void Display(int32_t i) { APPL_INFO(" " << i << " : \"" << ColorName << "\"" << " fg="<< m_colorFG); };
Colorize(const etk::UString& _newColorName="no_name");
~Colorize(void) { };
private:
etk::UString ColorName; //!< curent color Name
draw::Color m_colorFG;
draw::Color m_colorBG;
bool italic;
bool bold;
etk::UString m_colorName; //!< curent color Name
public:
void SetName(const etk::UString& _newColorName) { m_colorName = _newColorName; };
const etk::UString& GetName(void) { return m_colorName; };
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

View File

@@ -9,63 +9,29 @@
#include <appl/Debug.h>
#include <appl/global.h>
#include <ColorizeManager.h>
#include <tinyXML/tinyxml.h>
#include <ewol/eObject/EObject.h>
#include <ewol/eObject/EObjectManager.h>
#include <exml/exml.h>
#include <ewol/renderer/EObject.h>
#include <ewol/renderer/EObjectManager.h>
#include <etk/os/FSNode.h>
#define PFX "ColorizeManager "
class classColorManager: public ewol::EObject
{
public:
// Constructeur
classColorManager(void);
~classColorManager(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void)
{
return "ApplColorManager";
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
public:
void LoadFile(etk::UString &xmlFilename);
void LoadFile(const char * xmlFilename);
Colorize * Get(const char *colorName);
Colorize * Get(etk::UString &colorName);
draw::Color& Get(basicColor_te myColor);
bool Exist(etk::UString &colorName);
bool Exist(const char *colorName);
void DisplayListOfColor(void);
private:
etk::UString m_fileColor;
etk::Vector<Colorize*> listMyColor; //!< List of ALL Color
Colorize * errorColor;
draw::Color basicColors[COLOR_NUMBER_MAX];
};
etk::Color<> basicColors[COLOR_NUMBER_MAX];
classColorManager::classColorManager(void)
{
public:
// Constructeur
classColorManager(void)
{
//ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiChangeColor);
}
classColorManager::~classColorManager(void)
{
}
~classColorManager(void)
{
delete(errorColor);
int32_t i;
@@ -78,10 +44,14 @@ classColorManager::~classColorManager(void)
}
// clear the compleate list
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)
{
@@ -95,243 +65,41 @@ void classColorManager::OnReceiveMessage(ewol::EObject * CallerObject, const cha
break;
}
*/
}
void classColorManager::LoadFile(etk::UString &xmlFilename)
{
// TODO : Remove this
LoadFile(xmlFilename.c_str());
}
// TODO : Remove this ...
void classColorManager::LoadFile(const char * xmlFilename)
{
// Remove all old color :
int32_t i;
// clean all Element
for (i=0; i< listMyColor.Size(); i++) {
if (NULL != listMyColor[i]) {
delete(listMyColor[i]);
listMyColor[i] = NULL;
}
}
// clear the compleate list
listMyColor.Clear();
m_fileColor = xmlFilename;
APPL_DEBUG("open file (COLOR) \"" << xmlFilename << "\" ? = \"" << m_fileColor << "\"");
errorColor = new Colorize();
errorColor->SetBgColor("#00FF00FF");
errorColor->SetFgColor("#FF00FFFF");
// allocate the document in the stack
TiXmlDocument XmlDocument;
// open the curent File
etk::FSNode fileName(etk::UString("DATA: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)
public:
void LoadFile(const etk::UString& _xmlFilename);
Colorize* Get(const etk::UString& _colorName)
{
if (pGuiNode->Type()==TiXmlNode::TINYXML_COMMENT) {
// nothing to do, just proceed to next step
} else if (!strcmp(pGuiNode->Value(), "color")) {
Colorize *myNewColor = new Colorize();
//--------------------------------------------------------------------------------------------
//<color name="basicBackground" FG="#000000" BG="#000000" bold="no" italic="no"/>
//--------------------------------------------------------------------------------------------
// get the name of the Chaine
const char *colorName = pGuiNode->ToElement()->Attribute("name");
if (NULL == colorName) {
APPL_ERROR(PFX"(l "<< pGuiNode->Row() <<") node with no name");
// get next node element
pGuiNode = pGuiNode->NextSibling();
continue;
} else {
myNewColor->SetName(colorName);
//APPL_INFO(PFX"Add a new color in the panel : \"%s\"", colorName);
}
const char *colorBG = pGuiNode->ToElement()->Attribute("BG");
if (NULL != colorBG) {
myNewColor->SetBgColor(colorBG);
}
const char *colorFG = pGuiNode->ToElement()->Attribute("FG");
if (NULL != colorFG) {
myNewColor->SetFgColor(colorFG);
}
const char *bold = pGuiNode->ToElement()->Attribute("bold");
if (NULL != bold) {
if(0 == strcmp(bold, "yes") ) {
myNewColor->SetBold(true);
}
}
const char *italic = pGuiNode->ToElement()->Attribute("italic");
if (NULL != italic) {
if(0 == strcmp(italic, "yes") ) {
myNewColor->SetItalic(true);
}
}
listMyColor.PushBack(myNewColor);
} else {
APPL_ERROR(PFX"(l "<<pNode->Row()<<") node not suported : \""<<pNode->Value()<<"\" must be [color]");
}
pGuiNode = pGuiNode->NextSibling();
}
} else {
APPL_ERROR(PFX"(l "<<pNode->Row()<<") node not suported : \""<<pNode->Value()<<"\" must be [gui,syntax]");
}
// get next node element
pNode = pNode->NextSibling();
}
}
if (NULL != fileBuffer) {
delete[] fileBuffer;
}
//SendMessage(APPL_MSG__COLOR_HAS_CHANGE);
//SendMessage(APPL_MSG__USER_DISPLAY_CHANGE);
}
// TODO : Remove this ...
Colorize *classColorManager::Get(const char *colorName)
{
int32_t i;
for (i=0; i<listMyColor.Size(); i++) {
etk::UString elementName = listMyColor[i]->GetName();
if (elementName == colorName) {
if (listMyColor[i]->GetName() == _colorName) {
return listMyColor[i];
}
}
APPL_ERROR(PFX"Color does not Existed ["<< colorName<<"]" );
APPL_ERROR(PFX"Color does not Existed ["<< _colorName<<"]" );
// an error
return errorColor;
}
Colorize *classColorManager::Get(etk::UString &colorName)
{
// TODO : Remove this
return Get(colorName.c_str());
}
draw::Color & classColorManager::Get(basicColor_te myColor)
{
if (myColor < COLOR_NUMBER_MAX) {
return basicColors[myColor];
}
etk::Color<>& Get(basicColor_te _myColor)
{
if (_myColor < COLOR_NUMBER_MAX) {
return basicColors[_myColor];
} else {
return basicColors[0];
}
}
// TODO : Remove this ...
bool classColorManager::Exist(const char *colorName)
{
}
bool Exist(const etk::UString& _colorName)
{
int32_t i;
for (i=0; i<listMyColor.Size(); i++) {
etk::UString elementName = listMyColor[i]->GetName();
if (elementName == colorName) {
if (listMyColor[i]->GetName() == _colorName) {
return true;
}
}
return false;
}
bool classColorManager::Exist(etk::UString &colorName)
{
// TODO : Remove this
return Exist(colorName.c_str());
}
void classColorManager::DisplayListOfColor(void)
{
}
void DisplayListOfColor(void)
{
int32_t i;
APPL_INFO(PFX"List of ALL COLOR : ");
for (i=0; i<listMyColor.Size(); i++) {
@@ -339,10 +107,149 @@ void classColorManager::DisplayListOfColor(void)
//APPL_INFO(i << " : \"" << elementName.c_str() << "\"" );
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);
}
static classColorManager * localManager = NULL;
@@ -369,63 +276,38 @@ void ColorizeManager::UnInit(void)
localManager = NULL;
}
void ColorizeManager::LoadFile(etk::UString &xmlFilename)
void ColorizeManager::LoadFile(const etk::UString& _xmlFilename)
{
if (NULL == localManager) {
return;
}
localManager->LoadFile(xmlFilename);
localManager->LoadFile(_xmlFilename);
}
void ColorizeManager::LoadFile(const char * xmlFilename)
{
if (NULL == localManager) {
return;
}
localManager->LoadFile(xmlFilename);
}
Colorize* ColorizeManager::Get(const char *colorName)
Colorize* ColorizeManager::Get(const etk::UString& _colorName)
{
if (NULL == localManager) {
return NULL;
}
return localManager->Get(colorName);
return localManager->Get(_colorName);
}
Colorize* ColorizeManager::Get(etk::UString &colorName)
{
if (NULL == localManager) {
return NULL;
}
return localManager->Get(colorName);
}
draw::Color errorColor;
draw::Color& ColorizeManager::Get(basicColor_te myColor)
etk::Color<>& ColorizeManager::Get(basicColor_te _myColor)
{
static etk::Color<> errorColor;
if (NULL == localManager) {
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) {
return false;
}
return localManager->Exist(colorName);
}
bool ColorizeManager::Exist(const char *colorName)
{
if (NULL == localManager) {
return false;
}
return localManager->Exist(colorName);
return localManager->Exist(_colorName);
}
void ColorizeManager::DisplayListOfColor(void)

View File

@@ -11,7 +11,7 @@
#include <Colorize.h>
#include <appl/globalMsg.h>
#include <draw/Color.h>
#include <etk/Color.h>
#include <ewol/widget/Widget.h>
typedef enum {
@@ -37,13 +37,10 @@ namespace ColorizeManager
{
void Init(void);
void UnInit(void);
void LoadFile(etk::UString &xmlFilename);
void LoadFile(const char * xmlFilename);
Colorize * Get(const char *colorName);
Colorize * Get(etk::UString &colorName);
draw::Color& Get(basicColor_te myColor);
bool Exist(etk::UString &colorName);
bool Exist(const char *colorName);
void LoadFile(const etk::UString& _xmlFilename);
Colorize * Get(const etk::UString& _colorName);
etk::Color<>& Get(basicColor_te _myColor);
bool Exist(const etk::UString& _colorName);
void DisplayListOfColor(void);
};

View File

@@ -12,7 +12,7 @@
#include <BufferManager.h>
#include <ColorizeManager.h>
#include <MainWindows.h>
#include <ewol/eObject/EObject.h>
#include <ewol/renderer/EObject.h>
#undef __class__
#define __class__ "BufferView"
@@ -68,17 +68,10 @@ void BufferView::RemoveAllElement(void)
m_list.Clear();
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void BufferView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
void BufferView::OnReceiveMessage(const ewol::EMessage& _msg)
{
widget::List::OnReceiveMessage(CallerObject, eventId, data);
if (eventId == ednMsgBufferListChange) {
widget::List::OnReceiveMessage(_msg);
if (_msg.GetMessage() == ednMsgBufferListChange) {
// clean The list
RemoveAllElement();
// Get all the buffer name and properties:
@@ -102,10 +95,10 @@ void BufferView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eve
SortElementList(m_list);
}
MarkToRedraw();
}else if (eventId == ednMsgBufferId) {
}else if (_msg.GetMessage() == ednMsgBufferId) {
m_selectedIdRequested = BufferManager::GetSelected();
MarkToRedraw();
}else if (eventId == ednMsgBufferState) {
}else if (_msg.GetMessage() == ednMsgBufferState) {
// Update list of modify section ...
for (int32_t iii=0; iii<m_list.Size(); 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);
}
@@ -127,7 +120,7 @@ uint32_t BufferView::GetNuberOfColomn(void)
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 : ";
return true;
@@ -138,7 +131,7 @@ uint32_t BufferView::GetNuberOfRaw(void)
return m_list.Size();
}
bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg)
bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color<> &fg, etk::Color<> &bg)
{
bool isModify;
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;
// stop searching
m_selectedIdRequested = -1;
// set the raw visible :
SetRawVisible(m_selectedID);
}
if (m_selectedID == raw) {
selectBG = COLOR_LIST_BG_SELECTED;
@@ -186,7 +181,7 @@ bool BufferView::OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEven
if( raw>=0
&& raw<m_list.Size()
&& NULL != m_list[raw]) {
m_selectedID = raw;
m_selectedIdRequested = m_list[raw]->m_bufferID;
SendMultiCast(ednMsgBufferId, m_list[raw]->m_bufferID);
}
}

View File

@@ -14,6 +14,7 @@
#include <BufferManager.h>
#include <appl/globalMsg.h>
#include <ewol/widget/List.h>
#include <ewol/widget/Windows.h>
namespace appl
{
@@ -47,21 +48,17 @@ class BufferView : public widget::List
// Derived function
const char * const GetObjectType(void) { return "ApplBufferView"; };
// Derived function
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
virtual void OnReceiveMessage(const ewol::EMessage& _msg);
protected:
// function call to display the list :
virtual draw::Color GetBasicBG(void);
virtual etk::Color<> GetBasicBG(void);
void RemoveAllElement(void);
// Derived function
virtual uint32_t GetNuberOfColomn(void);
// Derived function
virtual bool GetTitle(int32_t colomn, etk::UString &myTitle, draw::Color &fg, draw::Color &bg);
// Derived function
virtual bool GetTitle(int32_t colomn, etk::UString &myTitle, etk::Color<> &fg, etk::Color<> &bg);
virtual uint32_t GetNuberOfRaw(void);
// Derived function
virtual bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg);
// Derived function
virtual bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color<> &fg, etk::Color<> &bg);
virtual bool OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEvent, int32_t colomn, int32_t raw, float x, float y);
void RemoveAllElement(void);
};

View File

@@ -17,7 +17,7 @@
#include <SearchData.h>
#include <ewol/widget/WidgetManager.h>
#include <ewol/eObject/EObject.h>
#include <ewol/renderer/EObject.h>
#undef __class__
@@ -32,10 +32,10 @@ void CodeView::Init(void)
m_lineNumberList.Clear();
m_textColorFg = draw::color::black;
m_textColorFg = etk::color::black;
m_textColorBg = draw::color::black;
m_textColorBg.a = 0x40;
m_textColorBg = etk::color::black;
m_textColorBg.SetA(0x40);
SetCanHaveFocus(true);
RegisterMultiCast(ednMsgBufferId);
RegisterMultiCast(ednMsgGuiCopy);
@@ -80,7 +80,6 @@ CodeView::~CodeView(void)
/**
* @brief Check if the number of reference buffer is good or not ...
* @param[in] bufferID id of the current Buffer that needed to have a reference
* @return ---
*/
void CodeView::UpdateNumberOfLineReference(int32_t bufferID)
{
@@ -104,7 +103,7 @@ bool CodeView::CalculateMinSize(void)
void CodeView::CalculateMaxSize(void)
{
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);
if (NULL!=tmpBuffer) {
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_displayText.Draw();
WidgetScrooled::OnDraw(displayProp);
WidgetScrooled::OnDraw();
}
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);
if (typeEvent == ewol::keyEvent::statusDown) {
if (_event.GetStatus() == ewol::keyEvent::statusDown) {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
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();
}
return true;
}
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)
void CodeView::OnEventClipboard(ewol::clipBoard::clipboardListe_te _clipboardID)
{
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->Paste(clipboardID);
tmpBuffer->Paste(_clipboardID);
}
MarkToRedraw();
}
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
bool CodeView::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
bool CodeView::OnEventInput(const ewol::EventInput& _event)
{
vec2 relativePos = RelativePosition(pos);
vec2 relativePos = RelativePosition(_event.GetPos());
//APPL_DEBUG("Event at pos : " << _event.GetPos() << " ==> " << relativePos );
// corection for the openGl abstraction
//relativePos.y = m_size.y - relativePos.y;
vec2 limitedPos = relativePos;
limitedPos.setValue(etk_avg(1, limitedPos.x(), m_size.x()-1),
etk_avg(1, limitedPos.y(), m_size.y()-1));
if (true == WidgetScrooled::OnEventInput(type, IdInput, typeEvent, pos)) {
ewol::widgetManager::FocusKeep(this);
if (true == WidgetScrooled::OnEventInput(_event)) {
KeepFocus();
// nothing to do ... done on upper widget ...
return true;
}
@@ -257,50 +240,51 @@ bool CodeView::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol:
return false;
}
if (1 == IdInput) {
#ifndef __MODE__Touch
if (ewol::keyEvent::statusDown == typeEvent) {
if (1 == _event.GetId()) {
if (ewol::keyEvent::typeMouse == _event.GetType()) {
if (ewol::keyEvent::statusDown == _event.GetStatus()) {
m_buttunOneSelected = true;
ewol::widgetManager::FocusKeep(this);
KeepFocus();
// TODO : Set something good
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->MouseEvent(limitedPos);
}
MarkToRedraw();
} else if (ewol::keyEvent::statusUp == typeEvent) {
} else if (ewol::keyEvent::statusUp == _event.GetStatus()) {
m_buttunOneSelected = false;
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->Copy(ewol::clipBoard::clipboardSelection);
}
MarkToRedraw();
} else
#endif
if (ewol::keyEvent::statusSingle == typeEvent) {
#ifdef __MODE__Touch
ewol::widgetManager::FocusKeep(this);
}
}
if (ewol::keyEvent::statusSingle == _event.GetStatus()) {
if (ewol::keyEvent::typeMouse == _event.GetType()) {
KeepFocus();
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->MouseEvent(limitedPos);
}
MarkToRedraw();
#else
} else {
// nothing to do ...
#endif
} else if (ewol::keyEvent::statusDouble == typeEvent) {
}
} else if (ewol::keyEvent::statusDouble == _event.GetStatus()) {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->MouseEventDouble();
}
MarkToRedraw();
} else if (ewol::keyEvent::statusTriple == typeEvent) {
} else if (ewol::keyEvent::statusTriple == _event.GetStatus()) {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->MouseEventTriple();
}
MarkToRedraw();
} else if (ewol::keyEvent::statusMove == typeEvent) {
} else if (ewol::keyEvent::statusMove == _event.GetStatus()) {
if (true == m_buttunOneSelected) {
int xxx, yyy;
xxx = relativePos.x();
@@ -320,42 +304,33 @@ bool CodeView::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol:
MarkToRedraw();
}
}
} else if (2 == IdInput) {
if (ewol::keyEvent::statusSingle == typeEvent) {
} else if (2 == _event.GetId()) {
if (ewol::keyEvent::statusSingle == _event.GetStatus()) {
// TODO : Set something good
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->MouseEvent(limitedPos);
}
ewol::clipBoard::Request(ewol::clipBoard::clipboardSelection);
ewol::widgetManager::FocusKeep(this);
KeepFocus();
}
}
return true;
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
void CodeView::OnReceiveMessage(const ewol::EMessage& _msg)
{
widget::WidgetScrooled::OnReceiveMessage(CallerObject, eventId, data);
APPL_DEBUG("Extern Event : " << CallerObject << " type : " << eventId << " data=\"" << data << "\"");
widget::WidgetScrooled::OnReceiveMessage(_msg);
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 :
if( m_bufferID >=0
&& m_bufferID < m_lineNumberList.Size()) {
m_lineNumberList[m_bufferID] = m_originScrooled;
}
int32_t bufferID = 0;
sscanf(data.c_str(), "%d", &bufferID);
sscanf(_msg.GetData().c_str(), "%d", &bufferID);
APPL_INFO("Select a new Buffer ... " << bufferID);
// set the new buffer ID
m_bufferID = bufferID;
@@ -366,105 +341,105 @@ void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * event
&& m_bufferID < m_lineNumberList.Size()) {
m_originScrooled = m_lineNumberList[m_bufferID];
}
} else if (eventId == ednMsgGuiCopy) {
} else if (_msg.GetMessage() == ednMsgGuiCopy) {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->Copy(ewol::clipBoard::clipboardStd);
}
} else if (eventId == ednMsgGuiCut) {
} else if (_msg.GetMessage() == ednMsgGuiCut) {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->Cut(ewol::clipBoard::clipboardStd);
}
} else if (eventId == ednMsgGuiPaste) {
} else if (_msg.GetMessage() == ednMsgGuiPaste) {
ewol::clipBoard::Request(ewol::clipBoard::clipboardStd);
} else if (eventId == ednMsgGuiUndo) {
} else if (_msg.GetMessage() == ednMsgGuiUndo) {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->Undo();
}
} else if (eventId == ednMsgGuiRedo) {
} else if (_msg.GetMessage() == ednMsgGuiRedo) {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->Redo();
}
} else if (eventId == ednMsgGuiRm) {
} else if (_msg.GetMessage() == ednMsgGuiRm) {
// data : "Word" "Line" "Paragraph"
if (data == "Word") {
APPL_WARNING(" on event " << eventId << " data=\"" << data << "\" ==> not coded" );
} else if (data == "Line") {
if (_msg.GetData() == "Word") {
APPL_WARNING(" on event " << _msg.GetMessage() << " data=\"" << _msg.GetData() << "\" ==> not coded" );
} else if (_msg.GetData() == "Line") {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->RemoveLine();
}
} else if (data == "Paragraph") {
APPL_WARNING(" on event " << eventId << " data=\"" << data << "\" ==> not coded" );
} else if (_msg.GetData() == "Paragraph") {
APPL_WARNING(" on event " << _msg.GetMessage() << " data=\"" << _msg.GetData() << "\" ==> not coded" );
} 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"
if (data == "ALL") {
if (_msg.GetData() == "ALL") {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->SelectAll();
}
} else if (data == "NONE") {
} else if (_msg.GetData() == "NONE") {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) {
tmpBuffer->SelectNone();
}
} 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"
if (data == "UTF-8") {
if (_msg.GetData() == "UTF-8") {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) {
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);
if (NULL!=tmpBuffer) {
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);
if (NULL!=tmpBuffer) {
tmpBuffer->SetCharset(unicode::EDN_CHARSET_ISO_8859_15);
}
} 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;
SearchData::GetSearch(myDataString);
if (data == "Next") {
if (_msg.GetData() == "Next") {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) {
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);
if (NULL!=tmpBuffer) {
tmpBuffer->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
}
}
} else if (eventId == ednMsgGuiReplace) {
} else if (_msg.GetMessage() == ednMsgGuiReplace) {
etk::UString myDataString;
SearchData::GetReplace(myDataString);
if (data == "Normal") {
if (_msg.GetData() == "Normal") {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) {
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;
sscanf(data.c_str(), "%d", &lineID);
sscanf(_msg.GetData().c_str(), "%d", &lineID);
APPL_INFO("Goto line : " << lineID);
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) {
@@ -481,14 +456,14 @@ void CodeView::OnGetFocus(void)
/*
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_bufferID);
*/
ewol::Keyboard(true);
ShowKeyboard();
APPL_INFO("Focus - In");
}
void CodeView::OnLostFocus(void)
{
ewol::Keyboard(false);
HideKeyboard();
APPL_INFO("Focus - out");
}

View File

@@ -25,14 +25,10 @@ class CodeView :public widget::WidgetScrooled
CodeView(etk::UString fontName, int32_t fontSize);
CodeView(void);
virtual ~CodeView(void);
// Derived function
const char * const GetObjectType(void) { return "ApplCodeView"; };
// Derived function
virtual bool CalculateMinSize(void);
private:
etk::UString m_label;
draw::Color m_textColorFg; //!< Text color
draw::Color m_textColorBg; //!< Background color
etk::Color<> m_textColorFg; //!< Text color
etk::Color<> m_textColorBg; //!< Background color
int32_t m_bufferID;
bool m_buttunOneSelected;
etk::Vector<vec2 > m_lineNumberList;
@@ -40,31 +36,23 @@ class CodeView :public widget::WidgetScrooled
// drawing elements :
ewol::Text m_displayText;
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:
void SetFontSize(int32_t size);
void SetFontName(etk::UString fontName);
private:
void CalculateMaxSize(void);
protected:
virtual void OnDraw(ewol::DrawProperty& displayProp);
protected: // derived function
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

View File

@@ -16,8 +16,7 @@
#include <ewol/widget/Button.h>
#include <ewol/widget/CheckBox.h>
#include <ewol/widget/SizerHori.h>
#include <ewol/widget/SizerVert.h>
#include <ewol/widget/Sizer.h>
#include <ewol/widget/Label.h>
#include <ewol/widget/Entry.h>
#include <ewol/widget/List.h>
@@ -29,9 +28,24 @@
#include <ewol/widget/meta/FileChooser.h>
#include <ewol/widget/meta/Parameter.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__
@@ -40,10 +54,11 @@
#include <ewol/widget/Label.h>
#include <ewol/widget/Spacer.h>
class ParameterAboutGui : public widget::SizerVert
class ParameterAboutGui : public widget::Sizer
{
public :
ParameterAboutGui(void)
ParameterAboutGui(void) :
widget::Sizer(widget::Sizer::modeVert)
{
widget::Spacer* mySpacer = NULL;
@@ -51,16 +66,23 @@ class ParameterAboutGui : public widget::SizerVert
if (NULL == mySpacer) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
mySpacer->SetExpendX(true);
mySpacer->SetExpendY(true);
mySpacer->SetExpand(bvec2(true,true));
SubWidgetAdd(mySpacer);
}
etk::UString tmpLabel = "<left>";
tmpLabel += " <b>Editeur De N'ours</b> : v";
tmpLabel += APPL_VERSION_TAG_NAME;
tmpLabel += " <b>Editeur De N'ours</b> : v:";
tmpLabel += appl::GetVersion();
tmpLabel += "<br/>";
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 += " <b>Website</b> : https://github.com/HeeroYui/edn<br/>";
tmpLabel += " <b>License</b> : GPL v3<br/>";
@@ -74,7 +96,7 @@ class ParameterAboutGui : public widget::SizerVert
if (NULL == myLabel) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
myLabel->SetExpendX(true);
myLabel->SetExpand(bvec2(true,false));
SubWidgetAdd(myLabel);
}
};
@@ -93,35 +115,31 @@ const char * l_smoothMax = "tmpEvent_maxChange";
MainWindows::MainWindows(void)
{
APPL_DEBUG("CREATE WINDOWS ... ");
widget::SizerVert * mySizerVert = NULL;
widget::SizerVert * mySizerVert2 = NULL;
widget::SizerHori * mySizerHori = NULL;
widget::Sizer * mySizerVert = NULL;
widget::Sizer * mySizerVert2 = NULL;
widget::Sizer * mySizerHori = NULL;
//ewol::Button * myButton = NULL;
CodeView * myCodeView = NULL;
BufferView * myBufferView = NULL;
widget::Menu * myMenu = NULL;
mySizerVert = new widget::SizerVert();
mySizerVert = new widget::Sizer(widget::Sizer::modeVert);
SetSubWidget(mySizerVert);
mySizerHori = new widget::SizerHori();
mySizerHori = new widget::Sizer(widget::Sizer::modeHori);
mySizerVert->SubWidgetAdd(mySizerHori);
myBufferView = new BufferView();
myBufferView->SetExpendX(false);
myBufferView->SetExpendY(true);
myBufferView->SetFillX(true);
myBufferView->SetFillY(true);
myBufferView->SetExpand(bvec2(false,true));
myBufferView->SetFill(bvec2(true,true));
mySizerHori->SubWidgetAdd(myBufferView);
mySizerVert2 = new widget::SizerVert();
mySizerVert2 = new widget::Sizer(widget::Sizer::modeVert);
mySizerHori->SubWidgetAdd(mySizerVert2);
// main buffer Area :
myCodeView = new CodeView("FreeMono", 11);
myCodeView->SetExpendX(true);
myCodeView->SetExpendY(true);
myCodeView->SetFillX(true);
myCodeView->SetFillY(true);
myCodeView = new CodeView("FreeMono;DejaVuSansMono", 11);
myCodeView->SetExpand(bvec2(true,true));
myCodeView->SetFill(bvec2(true,true));
mySizerVert2->SubWidgetAdd(myCodeView);
// search area :
@@ -129,7 +147,7 @@ MainWindows::MainWindows(void)
mySizerVert2->SubWidgetAdd(mySearch);
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
{
widget::SizerHori * mySizerHori2 = new widget::SizerHori();
widget::Sizer * mySizerHori2 = new widget::Sizer(widget::Sizer::modeHori);
mySizerVert2->SubWidgetAdd(mySizerHori2);
widget::CheckBox* tmpCheck = new widget::CheckBox("smooth");
@@ -139,7 +157,7 @@ MainWindows::MainWindows(void)
widget::Slider* tmpSlider = new widget::Slider();
mySizerHori2->SubWidgetAdd(tmpSlider);
tmpSlider->RegisterOnEvent(this, ewolEventSliderChange, l_smoothMin);
tmpSlider->SetExpendX(true);
tmpSlider->SetExpand(bvec2(true,false));
tmpSlider->SetMin(0);
tmpSlider->SetMax(1000);
tmpSlider->SetValue(0450);
@@ -148,7 +166,7 @@ MainWindows::MainWindows(void)
tmpSlider = new widget::Slider();
mySizerHori2->SubWidgetAdd(tmpSlider);
tmpSlider->RegisterOnEvent(this, ewolEventSliderChange, l_smoothMax);
tmpSlider->SetExpendX(true);
tmpSlider->SetExpand(bvec2(true,false));
tmpSlider->SetMin(0);
tmpSlider->SetMax(1000);
tmpSlider->SetValue(0550);
@@ -156,7 +174,7 @@ MainWindows::MainWindows(void)
}
#endif
mySizerHori = new widget::SizerHori();
mySizerHori = new widget::Sizer(widget::Sizer::modeHori);
mySizerVert->SubWidgetAdd(mySizerHori);
myMenu = new widget::Menu();
@@ -209,8 +227,8 @@ MainWindows::MainWindows(void)
(void)myMenu->Add(idMenugDisplay, "Reload OpenGl Shader", "", ednMsgGuiReloadShader);
m_widgetLabelFileName = new widget::Label("<left>FileName</left>");
m_widgetLabelFileName->SetExpendX(true);
m_widgetLabelFileName->SetFillY(true);
m_widgetLabelFileName->SetExpand(bvec2(true,false));
m_widgetLabelFileName->SetFill(bvec2(false,true));;
mySizerHori->SubWidgetAdd(m_widgetLabelFileName);
@@ -257,20 +275,14 @@ MainWindows::~MainWindows(void)
const char *const ednEventPopUpFileSelected = "edn-mainWindows-openSelected";
const char *const ednEventPopUpFileSaveAs = "edn-mainWindows-saveAsSelected";
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
void MainWindows::OnReceiveMessage(const ewol::EMessage& _msg)
{
ewol::Windows::OnReceiveMessage(CallerObject, eventId, data);
ewol::Windows::OnReceiveMessage(_msg);
//APPL_INFO("Receive Event from the main windows ... : \"" << eventId << "\" ==> data=\"" << data << "\"" );
// Open file Section ...
if (eventId == ednMsgGuiOpen) {
if (_msg.GetMessage() == ednMsgGuiOpen) {
widget::FileChooser* tmpWidget = new widget::FileChooser();
tmpWidget->SetTitle("Open Files ...");
tmpWidget->SetValidateLabel("Open");
@@ -283,18 +295,18 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
}
PopUpWidgetPush(tmpWidget);
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected);
} else if (eventId == ednEventPopUpFileSelected) {
APPL_DEBUG("Request opening the file : " << data);
SendMultiCast(ednMsgOpenFile, data);
} else if (eventId == ednMsgGuiSaveAs) {
if (data == "") {
} else if (_msg.GetMessage() == ednEventPopUpFileSelected) {
APPL_DEBUG("Request opening the file : " << _msg.GetData());
SendMultiCast(ednMsgOpenFile, _msg.GetData());
} else if (_msg.GetMessage() == ednMsgGuiSaveAs) {
if (_msg.GetData() == "") {
APPL_ERROR("Null data for Save As file ... ");
} else {
m_currentSavingAsIdBuffer = -1;
if (data == "current") {
if (_msg.GetData() == "current") {
m_currentSavingAsIdBuffer = BufferManager::GetSelected();
} else {
sscanf(data.c_str(), "%d", &m_currentSavingAsIdBuffer);
sscanf(_msg.GetData().c_str(), "%d", &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 :
etk::UString tmpData = data;
etk::UString tmpData = _msg.GetData();
APPL_DEBUG("Request Saving As file : " << tmpData);
BufferManager::Get(m_currentSavingAsIdBuffer)->SetFileName(tmpData);
SendMultiCast(ednMsgGuiSave, m_currentSavingAsIdBuffer);
} else if( eventId == ednMsgBufferState
|| eventId == ednMsgBufferId) {
} else if( _msg.GetMessage() == ednMsgBufferState
|| _msg.GetMessage() == ednMsgBufferId) {
// the buffer change we need to update the widget string
BufferText* tmpBuffer = BufferManager::Get(BufferManager::GetSelected());
if (NULL != tmpBuffer) {
@@ -344,15 +356,15 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
}
etk::UString windowsTitle = "edn - ";
windowsTitle += directName;
ewol::SetTitle(windowsTitle);
SetTitle(windowsTitle);
return;
} else {
m_widgetLabelFileName->SetLabel("");
ewol::SetTitle("edn");
SetTitle("edn");
}
return;
// TODO : Set the Title ....
} else if (eventId == ednMsgProperties) {
} else if (_msg.GetMessage() == ednMsgProperties) {
// Request the parameter GUI
widget::Parameter* tmpWidget = new widget::Parameter();
if (NULL == tmpWidget) {
@@ -363,32 +375,27 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
tmpWidget->MenuAddGroup("Editor");
ewol::Widget* tmpSubWidget = new globals::ParameterGlobalsGui();
tmpWidget->MenuAdd("Editor", "", tmpSubWidget);
tmpWidget->MenuAdd("Polices & Color", "", NULL);
tmpWidget->MenuAdd("Font & Color", "", NULL);
tmpWidget->MenuAdd("Highlight", "", NULL);
tmpWidget->MenuAddGroup("Genral");
tmpWidget->MenuAdd("Affichage", "", NULL);
tmpWidget->MenuAddGroup("General");
tmpWidget->MenuAdd("Display", "", NULL);
tmpSubWidget = new ParameterAboutGui();
tmpWidget->MenuAdd("About", "", tmpSubWidget);
}
} else if (eventId == ednMsgGuiReloadShader) {
ewol::resource::ReLoadResources();
ewol::ForceRedrawAll();
} else if (_msg.GetMessage() == ednMsgGuiReloadShader) {
ewol::GetContext().GetResourcesManager().ReLoadResources();
ewol::GetContext().ForceRedrawAll();
} else if (_msg.GetMessage() == ednMsgGuiExit) {
// TODO ...
}
return;
}
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
void MainWindows::OnObjectRemove(ewol::EObject * removeObject)
void MainWindows::OnObjectRemove(ewol::EObject * _removeObject)
{
ewol::Windows::OnObjectRemove(removeObject);
if (m_widgetLabelFileName == removeObject) {
ewol::Windows::OnObjectRemove(_removeObject);
if (m_widgetLabelFileName == _removeObject) {
m_widgetLabelFileName = NULL;
}
}

View File

@@ -26,12 +26,10 @@ class MainWindows : public ewol::Windows
// Constructeur
MainWindows(void);
~MainWindows(void);
// Derived function
const char * const GetObjectType(void) { return "MainWindows"; };
// Derived function
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
// Derived function
virtual void OnObjectRemove(ewol::EObject * removeObject);
public: // Derived function
virtual const char * const GetObjectType(void) { return "MainWindows"; };
virtual void OnReceiveMessage(const ewol::EMessage& _msg);
virtual void OnObjectRemove(ewol::EObject * _removeObject);
};
#define EDN_CAST_MAIN_WINDOWS(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_MAIN_WINDOWS,MainWindows,curentPointer)

View File

@@ -14,6 +14,7 @@
#include "appl/globalMsg.h"
#include <ewol/widget/Button.h>
#include <ewol/widget/Image.h>
#undef __class__
@@ -31,19 +32,50 @@ const char* const l_eventForwardCb = "appl-forward-CheckBox";
const char* const l_eventHideBt = "appl-hide-button";
Search::Search(void) :
widget::Sizer(widget::Sizer::modeHori),
m_searchEntry(NULL),
m_replaceEntry(NULL)
{
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;
myButtonImage = new widget::Button("", "");
myButtonImage = new widget::Button();
if (NULL == myButtonImage) {
APPL_ERROR("Widget allocation error ==> it will missing in the display");
} else {
myButtonImage->SetImage("THEME:GUI:Remove.svg");
myButtonImage->SetMinSize(32,32);
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventHideBt);
widget::Image* tmpImage = new widget::Image("THEME:GUI:Remove.svg");
tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter));
myButtonImage->SetSubWidget(tmpImage);
myButtonImage->RegisterOnEvent(this, widget::Button::eventPressed, l_eventHideBt);
SubWidgetAdd(myButtonImage);
}
@@ -51,20 +83,21 @@ Search::Search(void) :
if (NULL == m_searchEntry) {
APPL_ERROR("Widget allocation error ==> it will missing in the display");
} else {
m_searchEntry->RegisterOnEvent(this, ewolEventEntryModify, l_eventSearchEntry);
m_searchEntry->RegisterOnEvent(this, ewolEventEntryEnter, l_eventSearchEntryEnter);
m_searchEntry->SetExpendX(true);
m_searchEntry->SetFillX(true);
m_searchEntry->RegisterOnEvent(this, widget::Entry::eventModify, l_eventSearchEntry);
m_searchEntry->RegisterOnEvent(this, widget::Entry::eventEnter, l_eventSearchEntryEnter);
m_searchEntry->SetExpand(bvec2(true,false));
m_searchEntry->SetFill(bvec2(true,false));
SubWidgetAdd(m_searchEntry);
}
myButtonImage = new widget::Button("","");
myButtonImage = new widget::Button();
if (NULL == myButtonImage) {
APPL_ERROR("Widget allocation error ==> it will missing in the display");
} else {
myButtonImage->SetImage("THEME:GUI:Search.svg");
myButtonImage->SetMinSize(32,32);
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventSearchBt);
widget::Image* tmpImage = new widget::Image("THEME:GUI:Search.svg");
tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter));
myButtonImage->SetSubWidget(tmpImage);
myButtonImage->RegisterOnEvent(this, widget::Button::eventPressed, l_eventSearchBt);
SubWidgetAdd(myButtonImage);
}
@@ -72,59 +105,78 @@ Search::Search(void) :
if (NULL == m_replaceEntry) {
APPL_ERROR("Widget allocation error ==> it will missing in the display");
} else {
m_replaceEntry->RegisterOnEvent(this, ewolEventEntryModify, l_eventReplaceEntry);
m_replaceEntry->RegisterOnEvent(this, ewolEventEntryEnter, l_eventReplaceEntryEnter);
m_replaceEntry->SetExpendX(true);
m_replaceEntry->SetFillX(true);
m_replaceEntry->RegisterOnEvent(this, widget::Entry::eventModify, l_eventReplaceEntry);
m_replaceEntry->RegisterOnEvent(this, widget::Entry::eventEnter, l_eventReplaceEntryEnter);
m_replaceEntry->SetExpand(bvec2(true,false));
m_replaceEntry->SetFill(bvec2(true,false));
SubWidgetAdd(m_replaceEntry);
}
myButtonImage = new widget::Button("","");
myButtonImage = new widget::Button();
if (NULL == myButtonImage) {
APPL_ERROR("Widget allocation error ==> it will missing in the display");
} else {
myButtonImage->SetImage("THEME:GUI:Replace.svg");
myButtonImage->SetMinSize(32,32);
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventReplaceBt);
widget::Image* tmpImage = new widget::Image("THEME:GUI:Replace.svg");
tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter));
myButtonImage->SetSubWidget(tmpImage);
myButtonImage->RegisterOnEvent(this, widget::Button::eventPressed, l_eventReplaceBt);
SubWidgetAdd(myButtonImage);
}
myButtonImage = new widget::Button("","");
myButtonImage = new widget::Button();
if (NULL == myButtonImage) {
APPL_ERROR("Widget allocation error ==> it will missing in the display");
} else {
myButtonImage->SetImage("THEME:GUI:CaseSensitive.svg");
myButtonImage->SetImageToggle("THEME:GUI:CaseSensitive.svg", 0xFFFFFF5F);
myButtonImage->SetMinSize(32,32);
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->RegisterOnEvent(this, ewolEventButtonPressed, l_eventCaseCb);
myButtonImage->RegisterOnEvent(this, widget::Button::eventPressed, l_eventCaseCb);
SubWidgetAdd(myButtonImage);
}
myButtonImage = new widget::Button("","");
myButtonImage = new widget::Button();
if (NULL == myButtonImage) {
APPL_ERROR("Widget allocation error ==> it will missing in the display");
} else {
myButtonImage->SetImage("THEME:GUI:WrapAround.svg");
myButtonImage->SetImageToggle("THEME:GUI:WrapAround.svg", 0xFFFFFF5F);
myButtonImage->SetMinSize(32,32);
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->RegisterOnEvent(this, ewolEventButtonPressed, l_eventWrapCb);
myButtonImage->RegisterOnEvent(this, widget::Button::eventPressed, l_eventWrapCb);
SubWidgetAdd(myButtonImage);
}
myButtonImage = new widget::Button("","");
myButtonImage = new widget::Button();
if (NULL == myButtonImage) {
APPL_ERROR("Widget allocation error ==> it will missing in the display");
} else {
myButtonImage->SetImage("THEME:GUI:Up.svg");
myButtonImage->SetImageToggle("THEME:GUI:Down.svg");
myButtonImage->SetMinSize(32,32);
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->RegisterOnEvent(this, ewolEventButtonPressed, l_eventForwardCb);
myButtonImage->RegisterOnEvent(this, widget::Button::eventPressed, l_eventForwardCb);
SubWidgetAdd(myButtonImage);
}
@@ -139,70 +191,63 @@ Search::~Search(void)
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void Search::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
void Search::OnReceiveMessage(const ewol::EMessage& _msg)
{
widget::SizerHori::OnReceiveMessage(CallerObject, eventId, data);
widget::Sizer::OnReceiveMessage(_msg);
//APPL_INFO("Search receive message : \"" << eventId << "\" data=\"" << data << "\"");
if ( eventId == l_eventSearchEntry) {
SearchData::SetSearch(data);
} else if ( eventId == l_eventSearchEntryEnter) {
SearchData::SetSearch(data);
if ( _msg.GetMessage() == l_eventSearchEntry) {
SearchData::SetSearch(_msg.GetData());
} else if ( _msg.GetMessage() == l_eventSearchEntryEnter) {
SearchData::SetSearch(_msg.GetData());
if (true==m_forward) {
SendMultiCast(ednMsgGuiFind, "Previous");
} else {
SendMultiCast(ednMsgGuiFind, "Next");
}
} else if ( eventId == l_eventReplaceEntry) {
SearchData::SetReplace(data);
} else if ( eventId == l_eventReplaceEntryEnter) {
SearchData::SetReplace(data);
} else if ( _msg.GetMessage() == l_eventReplaceEntry) {
SearchData::SetReplace(_msg.GetData());
} else if ( _msg.GetMessage() == l_eventReplaceEntryEnter) {
SearchData::SetReplace(_msg.GetData());
SendMultiCast(ednMsgGuiReplace, "Normal");
if (true==m_forward) {
SendMultiCast(ednMsgGuiFind, "Previous");
} else {
SendMultiCast(ednMsgGuiFind, "Next");
}
} else if ( eventId == l_eventSearchBt) {
} else if ( _msg.GetMessage() == l_eventSearchBt) {
if (true==m_forward) {
SendMultiCast(ednMsgGuiFind, "Previous");
} else {
SendMultiCast(ednMsgGuiFind, "Next");
}
} else if ( eventId == l_eventReplaceBt) {
} else if ( _msg.GetMessage() == l_eventReplaceBt) {
SendMultiCast(ednMsgGuiReplace, "Normal");
if (true==m_forward) {
SendMultiCast(ednMsgGuiFind, "Previous");
} else {
SendMultiCast(ednMsgGuiFind, "Next");
}
} else if ( eventId == l_eventCaseCb) {
if (data == "1") {
} else if ( _msg.GetMessage() == l_eventCaseCb) {
if (_msg.GetData() == "1") {
SearchData::SetCase(false);
} else {
SearchData::SetCase(true);
}
} else if ( eventId == l_eventWrapCb) {
if (data == "1") {
} else if ( _msg.GetMessage() == l_eventWrapCb) {
if (_msg.GetData() == "1") {
SearchData::SetWrap(false);
} else {
SearchData::SetWrap(true);
}
} else if ( eventId == l_eventForwardCb) {
if (data == "1") {
} else if ( _msg.GetMessage() == l_eventForwardCb) {
if (_msg.GetData() == "1") {
m_forward = false;
} else {
m_forward = true;
}
} else if ( eventId == l_eventHideBt) {
} else if ( _msg.GetMessage() == l_eventHideBt) {
Hide();
} else if ( eventId == ednMsgGuiSearch) {
} else if ( _msg.GetMessage() == ednMsgGuiSearch) {
if (true == IsHide()) {
Show();
if (m_searchEntry!= NULL) {
@@ -221,19 +266,13 @@ void Search::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId
}
}
/**
* @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)
void Search::OnObjectRemove(ewol::EObject * _removeObject)
{
widget::SizerHori::OnObjectRemove(removeObject);
if (removeObject == m_searchEntry) {
widget::Sizer::OnObjectRemove(_removeObject);
if (_removeObject == m_searchEntry) {
m_searchEntry = NULL;
}
if (removeObject == m_replaceEntry) {
if (_removeObject == m_replaceEntry) {
m_replaceEntry = NULL;
}
}

View File

@@ -10,41 +10,23 @@
#define __SEARCH_H__
#include <appl/Debug.h>
#include <ewol/widget/SizerHori.h>
#include <ewol/widget/Sizer.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:
bool m_forward;
widget::Entry * m_searchEntry;
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

View File

@@ -16,7 +16,7 @@
static etk::UString m_findRequest = "";
void SearchData::SetSearch(etk::UString &myData)
void SearchData::SetSearch(const etk::UString &myData)
{
m_findRequest = myData;
}
@@ -33,7 +33,7 @@ bool SearchData::IsSearchEmpty(void)
}
static etk::UString m_replaceRequest = "";
void SearchData::SetReplace(etk::UString &myData)
void SearchData::SetReplace(const etk::UString &myData)
{
m_replaceRequest = myData;
}

View File

@@ -14,10 +14,10 @@
namespace SearchData
{
void SetSearch(etk::UString &myData);
void SetSearch(const etk::UString &myData);
void GetSearch(etk::UString &myData);
bool IsSearchEmpty(void);
void SetReplace(etk::UString &myData);
void SetReplace(const etk::UString &myData);
void GetReplace(etk::UString &myData);
bool IsReplaceEmpty(void);
void SetCase(bool value);

View File

@@ -36,16 +36,15 @@ appl::TagFileList::~TagFileList(void)
}
}
draw::Color appl::TagFileList::GetBasicBG(void) {
draw::Color bg(0x00000010);
return bg;
etk::Color<> appl::TagFileList::GetBasicBG(void) {
return 0x00000010;
}
uint32_t appl::TagFileList::GetNuberOfColomn(void) {
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";
return true;
}
@@ -54,7 +53,7 @@ uint32_t appl::TagFileList::GetNuberOfRaw(void) {
return m_list.Size();
}
bool appl::TagFileList::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg) {
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 (0==colomn) {
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 {
myTextToWrite = "ERROR";
}
fg = draw::color::black;
fg = etk::color::black;
if (raw % 2) {
if (colomn%2==0) {
bg = 0xFFFFFF00;

View File

@@ -34,25 +34,19 @@ namespace appl {
TagFileList(void);
~TagFileList(void);
// display API :
virtual draw::Color GetBasicBG(void);
virtual etk::Color<> GetBasicBG(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);
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);
/**
* @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
*/
// derived function
const char * const GetObjectType(void) { return "TagFileList"; };
public:
/**
* @brief Add a Ctags item on the curent list
* @param[in] file Compleate file name
* @param[in] jump line id
* @return ---
*/
void Add(etk::UString& file, int32_t line);
};

View File

@@ -7,8 +7,7 @@
*/
#include <appl/Gui/TagFileSelection.h>
#include <ewol/widget/SizerHori.h>
#include <ewol/widget/SizerVert.h>
#include <ewol/widget/Sizer.h>
#include <ewol/widget/List.h>
#include <ewol/widget/Spacer.h>
#include <ewol/widget/Image.h>
@@ -17,6 +16,7 @@
#include <etk/tool.h>
#include <ewol/widget/Button.h>
#include <ewol/widget/Label.h>
#include <ewol/widget/Composer.h>
#include <ewol/ewol.h>
@@ -39,26 +39,26 @@ appl::TagFileSelection::TagFileSelection(void)
widget::Button* myWidgetValidate = NULL;
widget::Button* myWidgetCancel = NULL;
widget::SizerVert * mySizerVert = NULL;
widget::SizerHori * mySizerHori = NULL;
widget::Sizer * mySizerVert = NULL;
widget::Sizer * mySizerHori = NULL;
widget::Spacer * mySpacer = NULL;
#if defined(__TARGET_OS__Android)
SetDisplayRatio(0.90);
SetMinSize(ewol::Dimension(vec2(90,90),ewol::Dimension::Pourcent));
#elif defined(__TARGET_OS__Windows)
SetDisplayRatio(0.80);
SetMinSize(ewol::Dimension(vec2(80,80),ewol::Dimension::Pourcent));
#else
SetDisplayRatio(0.80);
SetMinSize(ewol::Dimension(vec2(80,80),ewol::Dimension::Pourcent));
#endif
mySizerVert = new widget::SizerVert();
mySizerVert = new widget::Sizer(widget::Sizer::modeVert);
if (NULL == mySizerVert) {
EWOL_ERROR("Can not allocate widget ==> display might be in error");
} else {
mySizerVert->LockExpendContamination(true);
mySizerVert->LockExpand(bvec2(true,true));
// 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) {
EWOL_ERROR("Can not allocate widget ==> display might be in error");
} else {
@@ -67,23 +67,38 @@ appl::TagFileSelection::TagFileSelection(void)
if (NULL == mySpacer) {
EWOL_ERROR("Can not allocate widget ==> display might be in error");
} else {
mySpacer->SetExpendX(true);
mySpacer->SetExpand(bvec2(true,false));
mySizerHori->SubWidgetAdd(mySpacer);
}
myWidgetValidate = new widget::Button("Jump");
myWidgetValidate = new widget::Button();
if (NULL == myWidgetValidate) {
EWOL_ERROR("Can not allocate widget ==> display might be in error");
} else {
myWidgetValidate->SetImage("icon/Load.svg");
myWidgetValidate->RegisterOnEvent(this, ewolEventButtonPressed, applEventctagsSelection);
myWidgetValidate->SetSubWidget(
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);
}
myWidgetCancel = new widget::Button("Cancel");
myWidgetCancel = new widget::Button();
if (NULL == myWidgetCancel) {
EWOL_ERROR("Can not allocate widget ==> display might be in error");
} else {
myWidgetCancel->SetImage("icon/Remove.svg");
myWidgetCancel->RegisterOnEvent(this, ewolEventButtonPressed, applEventctagsCancel);
myWidgetCancel->SetSubWidget(
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);
}
}
@@ -94,10 +109,8 @@ appl::TagFileSelection::TagFileSelection(void)
m_listTag->RegisterOnEvent(this, applEventCtagsListValidate);
m_listTag->RegisterOnEvent(this, applEventCtagsListSelect);
m_listTag->RegisterOnEvent(this, applEventCtagsListUnSelect);
m_listTag->SetExpendX(true);
m_listTag->SetExpendY(true);
m_listTag->SetFillX(true);
m_listTag->SetFillY(true);
m_listTag->SetExpand(bvec2(true,true));
m_listTag->SetFill(bvec2(true,true));
mySizerVert->SubWidgetAdd(m_listTag);
}
@@ -116,33 +129,25 @@ appl::TagFileSelection::~TagFileSelection(void)
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void appl::TagFileSelection::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
void appl::TagFileSelection::OnReceiveMessage(const ewol::EMessage& _msg)
{
EWOL_INFO("ctags LIST ... : \"" << eventId << "\" ==> data=\"" << data << "\"" );
if (eventId == applEventctagsSelection) {
EWOL_INFO("ctags LIST ... : \"" << _msg.GetMessage() << "\" ==> data=\"" << _msg.GetData() << "\"" );
if (_msg.GetMessage() == applEventctagsSelection) {
if (m_eventNamed!="") {
GenerateEventId(applEventctagsSelection, m_eventNamed);
//==> Auto remove ...
AutoDestroy();
}
} else if (eventId == applEventCtagsListSelect) {
m_eventNamed = data;
} else if (_msg.GetMessage() == applEventCtagsListSelect) {
m_eventNamed = _msg.GetData();
} else if (eventId == applEventCtagsListUnSelect) {
} else if (_msg.GetMessage() == applEventCtagsListUnSelect) {
m_eventNamed = "";
} else if (eventId == applEventCtagsListValidate) {
GenerateEventId(applEventctagsSelection, data);
} else if (_msg.GetMessage() == applEventCtagsListValidate) {
GenerateEventId(applEventctagsSelection, _msg.GetData());
//==> Auto remove ...
AutoDestroy();
} else if (eventId == applEventctagsCancel) {
} else if (_msg.GetMessage() == applEventctagsCancel) {
GenerateEventId(applEventctagsCancel, "");
//==> Auto remove ...
AutoDestroy();
@@ -155,7 +160,6 @@ void appl::TagFileSelection::OnReceiveMessage(ewol::EObject * CallerObject, cons
* @brief Add a Ctags item on the curent list
* @param[in] file Compleate file name
* @param[in] jump line id
* @return ---
*/
void appl::TagFileSelection::AddCtagsNewItem(etk::UString file, int32_t line)
{
@@ -164,19 +168,12 @@ void appl::TagFileSelection::AddCtagsNewItem(etk::UString file, int32_t line)
}
}
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
void appl::TagFileSelection::OnObjectRemove(ewol::EObject * removeObject)
void appl::TagFileSelection::OnObjectRemove(ewol::EObject * _removeObject)
{
// First step call parrent :
widget::PopUp::OnObjectRemove(m_listTag);
widget::PopUp::OnObjectRemove(_removeObject);
// second step find if in all the elements ...
if(removeObject == m_listTag) {
if(_removeObject == m_listTag) {
m_listTag = NULL;
}
}

View File

@@ -25,36 +25,16 @@ namespace appl {
public:
TagFileSelection(void);
virtual ~TagFileSelection(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void) { return "EwolFileChooser"; };
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
void OnObjectRemove(ewol::EObject * removeObject);
/**
* @brief Add a Ctags item on the curent list
* @param[in] file Compleate file name
* @param[in] jump line id
* @return ---
*/
void AddCtagsNewItem(etk::UString file, int32_t line);
public: // herited function
const char * const GetObjectType(void) { return "EwolFileChooser"; };
void OnReceiveMessage(const ewol::EMessage& _msg);
void OnObjectRemove(ewol::EObject * _removeObject);
};
};

View File

@@ -9,14 +9,14 @@
#include <appl/Debug.h>
#include <appl/global.h>
#include <Highlight.h>
#include <tinyXML/tinyxml.h>
#include <exml/exml.h>
#undef __class__
#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 ...
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;
etk::FSNode fileName(etk::UString("DATA:") + xmlFilename);
if (false == fileName.Exist()) {
APPL_ERROR("File Does not exist : " << fileName);
exml::Document doc;
if (doc.Load(_xmlFilename)==false) {
APPL_ERROR(" can not load file XML : " << _xmlFilename);
return;
}
int32_t fileSize = fileName.FileSize();
if (0==fileSize) {
APPL_ERROR("This file is empty : " << fileName);
exml::Element* root = (exml::Element*)doc.GetNamed("EdnLang");
if (NULL == root ) {
APPL_ERROR("(l ?) main node not find: \"EdnLang\" ...");
return;
}
if (false == fileName.FileOpenRead()) {
APPL_ERROR("Can not open the file : " << fileName);
return;
}
// allocate data
char * fileBuffer = new char[fileSize+5];
if (NULL == fileBuffer) {
APPL_ERROR("Error Memory allocation size=" << fileSize);
return;
}
memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
// load data from the file :
fileName.FileRead(fileBuffer, 1, fileSize);
// close the file:
fileName.FileClose();
// load the XML from the memory
bool loadError = XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8);
if (false == loadError) {
APPL_ERROR( "can not load Hightlight XML: PARSING error: \"" << xmlFilename << "\"");
return;
}
TiXmlElement* root = XmlDocument.FirstChildElement( "EdnLang" );
if (NULL == root) {
APPL_ERROR( "can not load Hightlight XML: main node not find: \"EdnLang\"");
return;
}
int32_t level1 = 0;
int32_t level2 = 0;
TiXmlNode * child = root->FirstChild();
while(NULL != child)
{
if (child->Type()==TiXmlNode::TINYXML_COMMENT) {
// nothing to do ...
} else if (!strcmp(child->Value(), "ext")) {
const char *myData = child->ToElement()->GetText();
if (NULL != myData) {
// parse all the elements :
for(int32_t iii=0; iii< root->Size(); iii++) {
exml::Element* child = root->GetElement(iii);
if (child==NULL) {
// trash here all that is not element ...
continue;
}
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);
etk::UString * myEdnData = new etk::UString(myData);
m_listExtentions.PushBack(myEdnData);
m_listExtentions.PushBack(myData);
}
} else if (!strcmp(child->Value(), "pass1")) {
} else if (child->GetValue()=="pass1") {
// Get sub Nodes ...
TiXmlNode *passChild = child->FirstChild();
while (NULL != passChild) {
if (passChild->Type()==TiXmlNode::TINYXML_COMMENT) {
// nothing to do ...
} else if (!strcmp(passChild->Value(), "rule")) {
for(int32_t jjj=0; jjj< child->Size(); jjj++) {
exml::Element* passChild = child->GetElement(jjj);
if (passChild==NULL) {
continue;
}
if (passChild->GetValue() != "rule") {
APPL_ERROR("(l "<< passChild->GetPos() << ") node not suported : \""<< passChild->GetValue() << "\" must be [rule]" );
continue;
}
ParseRules(passChild, m_listHighlightPass1, level1++);
} else {
APPL_ERROR("(l "<< passChild->Row() << ") node not suported : \""<< passChild->Value() << "\" must be [rule]" );
}
// get the next node element :
passChild = passChild->NextSibling();
}
} else if (!strcmp(child->Value(), "pass2")) {
} else if (child->GetValue() == "pass2") {
// Get sub Nodes ...
TiXmlNode *passChild = child->FirstChild();
while (NULL != passChild) {
if (passChild->Type()==TiXmlNode::TINYXML_COMMENT) {
// nothing to do ...
} else if (!strcmp(passChild->Value(), "rule")) {
for(int32_t jjj=0; jjj< child->Size(); jjj++) {
exml::Element* passChild = child->GetElement(jjj);
if (passChild==NULL) {
continue;
}
if (passChild->GetValue() != "rule") {
APPL_ERROR("(l "<< passChild->GetPos() << ") node not suported : \""<< passChild->GetValue() << "\" must be [rule]" );
continue;
}
ParseRules(passChild, m_listHighlightPass2, level2++);
} else {
APPL_ERROR("(l "<< passChild->Row() << ") node not suported : \""<< passChild->Value() << "\" must be [rule]" );
}
// get the next node element :
passChild = passChild->NextSibling();
}
} else {
APPL_ERROR("(l "<< child->Row() << ") node not suported : \""<< child->Value() << "\" must be [ext,pass1,pass2]" );
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
m_listHighlightPass1.Clear();
// clean all Element
for (i=0; i< m_listExtentions.Size(); i++) {
if (NULL != m_listExtentions[i]) {
delete(m_listExtentions[i]);
m_listExtentions[i] = NULL;
}
}
// clear the compleate list
m_listExtentions.Clear();
}
@@ -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 (i=0; i<m_listExtentions.Size(); i++) {
if (ext == *m_listExtentions[i] ) {
for (int32_t iii=0; iii<m_listExtentions.Size(); iii++) {
if (_ext == m_listExtentions[iii] ) {
return true;
}
}
return false;
}
bool Highlight::FileNameCompatible(etk::FSNode &fileName)
bool Highlight::FileNameCompatible(etk::FSNode &_fileName)
{
int32_t i;
etk::UString extention;
if (true == fileName.FileHasExtention() ) {
if (true == _fileName.FileHasExtention() ) {
extention = "*.";
extention += fileName.FileGetExtention();
extention += _fileName.FileGetExtention();
} 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++) {
if (extention == *m_listExtentions[i] ) {
for (int32_t iii=0; iii<m_listExtentions.Size(); iii++) {
if (extention == m_listExtentions[iii] ) {
return true;
}
}
@@ -197,19 +150,18 @@ bool Highlight::FileNameCompatible(etk::FSNode &fileName)
void Highlight::Display(void)
{
int32_t i;
APPL_INFO("List of ALL Highlight : ");
for (i=0; i< m_listExtentions.Size(); i++) {
APPL_INFO(" Extention : " << i << " : " << *m_listExtentions[i] );
for (int32_t iii=0; iii< m_listExtentions.Size(); iii++) {
APPL_INFO(" Extention : " << iii << " : " << m_listExtentions[iii] );
}
// Display all elements
for (i=0; i< m_listHighlightPass1.Size(); i++) {
APPL_INFO(" " << i << " Pass 1 : " << m_listHighlightPass1[i]->GetName() );
for (int32_t iii=0; iii< m_listHighlightPass1.Size(); iii++) {
APPL_INFO(" " << iii << " Pass 1 : " << m_listHighlightPass1[iii]->GetName() );
//m_listHighlightPass1[i]->Display();
}
// Display all elements
for (i=0; i< m_listHighlightPass2.Size(); i++) {
APPL_INFO(" " << i << " Pass 2 : " << m_listHighlightPass2[i]->GetName() );
for (int32_t iii=0; iii< m_listHighlightPass2.Size(); iii++) {
APPL_INFO(" " << iii << " Pass 2 : " << m_listHighlightPass2[iii]->GetName() );
//m_listHighlightPass2[i]->Display();
}
}

View File

@@ -29,15 +29,15 @@ extern "C" {
#include <HighlightPattern.h>
#include <Colorize.h>
#include <etk/Buffer.h>
#include <tinyXML/tinyxml.h>
#include <exml/exml.h>
class Highlight {
public:
// Constructeur
Highlight(etk::UString &xmlFilename);
Highlight(const etk::UString& _xmlFilename);
~Highlight(void);
bool HasExtention(etk::UString &ext);
bool FileNameCompatible(etk::FSNode &fileName);
bool HasExtention(const etk::UString& _ext);
bool FileNameCompatible(etk::FSNode &_fileName);
void Display(void);
void ReloadColor(void);
void Parse(int32_t start,
@@ -50,9 +50,9 @@ class Highlight {
etk::Vector<colorInformation_ts> &metaData,
etk::Buffer &buffer);
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::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_listHighlightPass2; //!< List of ALL hightlight modules (pass 2 ==> When we display the buffer( only the display area (100 lines)) )
};

View File

@@ -9,8 +9,8 @@
#include <appl/Debug.h>
#include <appl/global.h>
#include <HighlightManager.h>
#include <ewol/eObject/EObject.h>
#include <ewol/eObject/EObjectManager.h>
#include <ewol/renderer/EObject.h>
#include <ewol/renderer/EObjectManager.h>
#undef __class__
#define __class__ "HighlightManager"
@@ -37,25 +37,14 @@ class localClassHighlightManager: public ewol::EObject
listHighlight.Clear();
};
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// herited function
const char * const GetObjectType(void)
{
return "ApplHighlightManager";
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
// herited function
virtual void OnReceiveMessage(const ewol::EMessage& _msg)
{
/*
switch (id)
@@ -94,61 +83,24 @@ class localClassHighlightManager: public ewol::EObject
void loadLanguages(void)
{
etk::UString xmlFilename = "languages/c/highlight.xml";
Highlight *myHightline = new Highlight(xmlFilename);
etk::FSNode myFile("DATA:languages/");
// 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);
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();
}
};
#define EDN_CAST_HIGHLIGHT_MANAGER(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_HIGHLIGHT_MANAGER,localClassHighlightManager,curentPointer)
static localClassHighlightManager * localManager = NULL;

View File

@@ -107,7 +107,7 @@ void HighlightPattern::Display(void)
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
const char *highLightName = child->ToElement()->Attribute("name");
etk::UString highLightName = child->GetAttribute("name");
etk::UString myEdnDataTmp = "???";
if (NULL != highLightName) {
if (highLightName.Size()!=0) {
myEdnDataTmp = highLightName;
}
SetName(myEdnDataTmp);
SetLevel(level);
TiXmlElement *xChild = child->FirstChildElement("color");
exml::Element* xChild = (exml::Element*)child->GetNamed("color");
if (NULL != xChild) {
const char *myData = xChild->GetText();
if (myData) {
etk::UString myData = xChild->GetText();
if (myData.Size()!=0) {
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
etk::UString myEdnData = myData;
SetColor(myEdnData);
}
}
xChild = child->FirstChildElement("start");
xChild = (exml::Element*)child->GetNamed("start");
if (NULL != xChild) {
const char *myData = xChild->GetText();
if (myData) {
etk::UString myData = xChild->GetText();
if (myData.Size()!=0) {
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
etk::UString myEdnData = myData;
SetPaternStart(myEdnData);
}
}
xChild = child->FirstChildElement("end");
xChild = (exml::Element*)child->GetNamed("end");
if (NULL != xChild) {
const char *myData = xChild->GetText();
if (myData) {
etk::UString myData = xChild->GetText();
if (myData.Size()!=0) {
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
etk::UString myEdnData = myData;
SetPaternStop(myEdnData);
}
}
xChild = child->FirstChildElement("EscapeChar");
xChild = (exml::Element*)child->GetNamed("EscapeChar");
if (NULL != xChild) {
const char *myData = xChild->GetText();
if (myData) {
etk::UString myData = xChild->GetText();
if (myData.Size()!=0) {
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
etk::UString myEdnData = myData;
SetEscapeChar(myEdnData);
}
}
xChild = child->FirstChildElement("rule");
xChild = (exml::Element*)child->GetNamed("rule");
if (NULL != xChild) {
/*
// Create the patern ...

View File

@@ -17,7 +17,7 @@ class HighlightPattern;
#include <etk/RegExp.h>
#include <Colorize.h>
#include <etk/Vector.h>
#include <tinyXML/tinyxml.h>
#include <exml/exml.h>
#include <etk/Buffer.h>
typedef enum {
@@ -50,7 +50,7 @@ class HighlightPattern {
void Display(void);
resultFind_te Find(int32_t start, int32_t stop, colorInformation_ts &resultat, etk::Buffer &buffer);
Colorize * GetColor(void) { return m_color; };
void ParseRules(TiXmlNode *child, int32_t level);
void ParseRules(exml::Element *child, int32_t level);
void ReloadColor(void);
@@ -63,7 +63,7 @@ class HighlightPattern {
etk::RegExp<etk::Buffer> * m_regExpStop; //!< Stop of Regular Expression
bool m_haveStopPatern; //!< Stop patern presence
bool m_multiline; //!< The patern is multiline
uniChar_t m_escapeChar; //!< Escape char to prevent exeit of patern ....
etk::UniChar m_escapeChar; //!< Escape char to prevent exeit of patern ....
etk::Vector<HighlightPattern *> m_subPatern; //!< Under patern of this one
// etk::Vector<HighlightPattern *> m_subColor; //!< Under Color in the start RegExp ...
};

View File

@@ -10,7 +10,8 @@
#include <appl/global.h>
#include <CTagsManager.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 <appl/Gui/TagFileSelection.h>
@@ -26,24 +27,11 @@ class CTagsManager: public ewol::EObject
CTagsManager(void);
~CTagsManager(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void)
{
return "CTagsManager";
};
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
void OnReceiveMessage(const ewol::EMessage& _msg);
int32_t m_currentSelectedID;
void LoadTagFile(void);
@@ -125,21 +113,21 @@ CTagsManager::~CTagsManager(void)
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 << "\"" );
if (eventId == ednMsgBufferId) {
if (_msg.GetMessage() == ednMsgBufferId) {
//m_currentSelectedID = dataID;
} else if( eventId == ednEventPopUpCtagsLoadFile
|| eventId == ednMsgCtagsLoadFile) {
} else if( _msg.GetMessage() == ednEventPopUpCtagsLoadFile
|| _msg.GetMessage() == ednMsgCtagsLoadFile) {
// open the new one :
etk::FSNode tmpFilename = data;
etk::FSNode tmpFilename = _msg.GetData();
m_tagFilename = tmpFilename.GetNameFile();
m_tagFolderBase = tmpFilename.GetNameFolder();
APPL_DEBUG("Receive load Ctags file : " << m_tagFolderBase << "/" << m_tagFilename << " ");
LoadTagFile();
} else if (eventId == ednMsgGuiCtags) {
if (data == "Load") {
} else if (_msg.GetMessage() == ednMsgGuiCtags) {
if (_msg.GetData() == "Load") {
APPL_INFO("Request opening ctag file");
widget::FileChooser* tmpWidget = new widget::FileChooser();
if (NULL == tmpWidget) {
@@ -147,15 +135,15 @@ void CTagsManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * e
} else {
tmpWidget->SetTitle("Open Exuberant Ctags File");
tmpWidget->SetValidateLabel("Open");
ewol::WindowsPopUpAdd(tmpWidget);
ewol::GetContext().GetWindows()->PopUpWidgetPush(tmpWidget);
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpCtagsLoadFile);
}
} else if (data == "ReLoad") {
} else if (_msg.GetData() == "ReLoad") {
APPL_INFO("Request re-load ctag file");
LoadTagFile();
} else if (data == "Jump") {
} else if (_msg.GetData() == "Jump") {
JumpTo();
} else if (data == "Back") {
} else if (_msg.GetData() == "Back") {
if (m_historyList.Size() > 0) {
int32_t id = m_historyList.Size()-1;
SendMultiCast(ednMsgOpenFile, m_historyList[id]->GetName() );
@@ -168,13 +156,13 @@ void CTagsManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * e
} else {
}
} else if (eventId == applEventctagsSelection) {
} else if (_msg.GetMessage() == applEventctagsSelection) {
// save the current file in the history
RegisterHistory();
// parse the input data
char tmp[4096];
int32_t lineID;
sscanf(data.c_str(), "%d:%s", &lineID, tmp);
sscanf(_msg.GetData().c_str(), "%d:%s", &lineID, tmp);
// generate envents
SendMultiCast(ednMsgOpenFile, tmp);
SendMultiCast(ednMsgGuiGotoLine, lineID - 1);
@@ -254,7 +242,7 @@ void CTagsManager::JumpTo(void)
PrintTag(&entry);
tmpWidget->AddCtagsNewItem(myfile.GetName(), lineID);
} while (tagsFindNext (m_ctagFile, &entry) == TagSuccess);
ewol::WindowsPopUpAdd(tmpWidget);
ewol::GetContext().GetWindows()->PopUpWidgetPush(tmpWidget);
tmpWidget->RegisterOnEvent(this, applEventctagsSelection);
}
} else {

View File

@@ -9,78 +9,170 @@
#include <appl/global.h>
#include <ColorizeManager.h>
#include <appl/globalMsg.h>
#include <ewol/eObject/EObject.h>
#include <ewol/renderer/ResourceManager.h>
#include <ewol/renderer/EObject.h>
#include <ewol/renderer/eContext.h>
#include <ewol/resources/ResourceManager.h>
#include <etk/os/FSNode.h>
//#include <ewol/UserConfig.h>
#undef __class__
#define __class__ "globals"
erreurCode_te globals::init(void)
class myParamGlobal : public ewol::EObject
{
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)
{
return displayEOL;
return l_obj().m_displayEOL;
}
void globals::SetDisplayEndOfLine(bool newVal)
{
APPL_INFO("Set EndOfLine " << newVal);
displayEOL = newVal;
l_obj().m_displayEOL = newVal;
//ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
}
// -----------------------------------------------------------
static bool displaySpaceChar = true;
bool globals::IsSetDisplaySpaceChar(void)
{
return displaySpaceChar;
return l_obj().m_displaySpaceChar;
}
void globals::SetDisplaySpaceChar(bool newVal)
{
APPL_INFO("Set SpaceChar " << newVal);
displaySpaceChar = newVal;
l_obj().m_displaySpaceChar = newVal;
//ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
}
// -----------------------------------------------------------
static bool displayTabChar = true;
bool globals::IsSetDisplayTabChar(void)
{
return displayTabChar;
return l_obj().m_displayTabChar;
}
void globals::SetDisplayTabChar(bool newVal)
{
APPL_INFO("Set SpaceChar " << newVal);
displayTabChar = newVal;
l_obj().m_displayTabChar = newVal;
//ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
}
// -----------------------------------------------------------
static bool AutoIndent = true;
bool globals::IsSetAutoIndent(void)
{
return AutoIndent;
return l_obj().m_AutoIndent;
}
void globals::SetAutoIndent(bool newVal)
{
APPL_INFO("Set AutoIndent " << newVal);
AutoIndent = newVal;
l_obj().m_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_changeRounded = "edn-event-change-rounded";
globals::ParameterGlobalsGui::ParameterGlobalsGui(void)
globals::ParameterGlobalsGui::ParameterGlobalsGui(void) :
widget::Sizer(widget::Sizer::modeVert)
{
widget::CheckBox* myCheckbox = NULL;
widget::Spacer* mySpacer = NULL;
@@ -122,15 +215,14 @@ globals::ParameterGlobalsGui::ParameterGlobalsGui(void)
if (NULL == mySpacer) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
mySpacer->SetExpendX(true);
mySpacer->SetExpendY(true);
mySpacer->SetExpand(bvec2(true,true));
SubWidgetAdd(mySpacer);
}
myCheckbox = new widget::CheckBox("Automatic Indentation");
if (NULL == myCheckbox) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
myCheckbox->SetExpendX(true);
myCheckbox->SetExpand(bvec2(true,false));
myCheckbox->SetValue(IsSetAutoIndent());
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeIndentation);
SubWidgetAdd(myCheckbox);
@@ -139,7 +231,7 @@ globals::ParameterGlobalsGui::ParameterGlobalsGui(void)
if (NULL == myCheckbox) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
myCheckbox->SetExpendX(true);
myCheckbox->SetExpand(bvec2(true,false));
myCheckbox->SetValue(IsSetDisplaySpaceChar());
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeSpace);
SubWidgetAdd(myCheckbox);
@@ -148,7 +240,7 @@ globals::ParameterGlobalsGui::ParameterGlobalsGui(void)
if (NULL == myCheckbox) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
myCheckbox->SetExpendX(true);
myCheckbox->SetExpand(bvec2(true,false));
myCheckbox->SetValue(IsSetDisplayTabChar());
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeTabulation);
SubWidgetAdd(myCheckbox);
@@ -157,7 +249,7 @@ globals::ParameterGlobalsGui::ParameterGlobalsGui(void)
if (NULL == myCheckbox) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
myCheckbox->SetExpendX(true);
myCheckbox->SetExpand(bvec2(true,false));
myCheckbox->SetValue(IsSetDisplayEndOfLine());
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeEndOfLine);
SubWidgetAdd(myCheckbox);
@@ -166,7 +258,7 @@ globals::ParameterGlobalsGui::ParameterGlobalsGui(void)
if (NULL == myCheckbox) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
myCheckbox->SetExpendX(true);
myCheckbox->SetExpand(bvec2(true,false));
myCheckbox->SetValue(IsSetDisplayEndOfLine());
myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeRounded);
SubWidgetAdd(myCheckbox);
@@ -179,49 +271,43 @@ globals::ParameterGlobalsGui::~ParameterGlobalsGui(void)
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void globals::ParameterGlobalsGui::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
void globals::ParameterGlobalsGui::OnReceiveMessage(const ewol::EMessage& _msg)
{
widget::SizerVert::OnReceiveMessage(CallerObject, eventId, data);
widget::Sizer::OnReceiveMessage(_msg);
if (eventId == l_changeEndOfLine) {
if (data == "true") {
if (_msg.GetMessage() == l_changeEndOfLine) {
if (_msg.GetData() == "true") {
SetDisplayEndOfLine(true);
} else {
SetDisplayEndOfLine(false);
}
} else if (eventId == l_changeIndentation) {
if (data == "true") {
} else if (_msg.GetMessage() == l_changeIndentation) {
if (_msg.GetData() == "true") {
SetAutoIndent(true);
} else {
SetAutoIndent(false);
}
} else if (eventId == l_changeSpace) {
if (data == "true") {
} else if (_msg.GetMessage() == l_changeSpace) {
if (_msg.GetData() == "true") {
SetDisplaySpaceChar(true);
} else {
SetDisplaySpaceChar(false);
}
} else if (eventId == l_changeTabulation) {
if (data == "true") {
} else if (_msg.GetMessage() == l_changeTabulation) {
if (_msg.GetData() == "true") {
SetDisplayTabChar(true);
} else {
SetDisplayTabChar(false);
}
} else if (eventId == l_changeRounded) {
if (data == "true") {
} else if (_msg.GetMessage() == l_changeRounded) {
if (_msg.GetData() == "true") {
etk::theme::SetName("GUI", "rounded");;
} else {
etk::theme::SetName("GUI", "default");;
}
// Reload shaders and graphic system ...
ewol::resource::ReLoadResources();
ewol::GetContext().GetResourcesManager().ReLoadResources();
ewol::GetContext().ForceRedrawAll();
}
}

View File

@@ -10,12 +10,13 @@
#define __TOOLS_GLOBALS_H__
#include <appl/Debug.h>
#include <ewol/widget/SizerVert.h>
#include <ewol/widget/Sizer.h>
namespace globals
{
erreurCode_te init(void);
void Init(void);
void UnInit(void);
int32_t getNbColoneBorder(void);
int32_t getNbLineBorder(void);
@@ -35,19 +36,13 @@ namespace globals
bool OrderTheBufferList(void);
class ParameterGlobalsGui : public widget::SizerVert
class ParameterGlobalsGui : public widget::Sizer
{
public :
ParameterGlobalsGui(void);
~ParameterGlobalsGui(void);
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
// herited function
virtual void OnReceiveMessage(const ewol::EMessage& _msg);
};
}

View File

@@ -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 ednMsgGuiSaveAs = "edn-Msg-Gui-SaveAs";
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 ednMsgGuiRedo = "edn-Msg-Gui-Redo";

View File

@@ -18,6 +18,7 @@
extern const char* const ednMsgGuiSave; // data : ""
extern const char* const ednMsgGuiSaveAs; // data : ""
extern const char* const ednMsgProperties; // data : ""
extern const char* const ednMsgGuiExit; // data : ""
extern const char* const ednMsgGuiUndo; // data : ""
extern const char* const ednMsgGuiRedo; // data : ""

View File

@@ -9,7 +9,7 @@
#include <etk/types.h>
#include <etk/UString.h>
#include <ewol/ewol.h>
#include <ewol/eObject/EObject.h>
#include <ewol/renderer/EObject.h>
#include <ewol/widget/WidgetManager.h>
#include <appl/Debug.h>
@@ -25,65 +25,46 @@
#include <readtags.h>
#include <CTagsManager.h>
#include <globalMsg.h>
#include <ewol/config.h>
//#include <ewol/config.h>
#include <ewol/commandLine.h>
MainWindows * basicWindows = NULL;
//#include <ewol/UserConfig.h>
#include <ewol/renderer/eContext.h>
/**
* @brief Main of the program (This can be set in every case, but it is not used in Andoid...).
* @param std IO
* @return std IO
*/
int main(int argc, const char *argv[])
int main(int _argc, const char *_argv[])
{
// only one things to do :
return ewol::Run(argc, argv);
// only one things to do:
return ewol::Run(_argc, _argv);
}
/**
* @brief main application function Initialisation
*/
void APP_Init(void)
bool APP_Init(ewol::eContext& _context)
{
#ifdef MODE_RELEASE
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 << ")");
APPL_INFO("==> Init APPL (START) [" << ewol::GetBoardType() << "] (" << ewol::GetCompilationMode() << ")");
ewol::ChangeSize(ivec2(800, 600));
etk::InitDefaultFolder(PROJECT_NAME);
// TODO : Remove this : Move if in the windows properties
_context.SetSize(vec2(800, 600));
// select internal data for font ...
_context.GetFontDefault().SetUseExternal(true);
#ifdef __TARGET_OS__Android
ewol::config::FontSetDefault("FreeSerif", 19);
_context.GetFontDefault().Set("FreeSerif", 19);
#else
ewol::config::FontSetDefault("FreeSerif", 14);
_context.GetFontDefault().Set("FreeSerif;DejaVuSansMono",14);
#endif
// set the application icon ...
ewol::SetIcon("DATA:icon.png");
_context.SetIcon("DATA:icon.png");
// init internal global value
globals::init();
// set the application icon ...
ewol::SetIcon("DATA:icon.png");
globals::Init();
// init ALL Singleton :
//(void)CTagsManager::getInstance();
@@ -98,56 +79,63 @@ void APP_Init(void)
HighlightManager::loadLanguages();
cTagsManager::Init();
// Request load of the user configuration ...
//ewol::userConfig::Load();
char cCurrentPath[FILENAME_MAX];
// get the curent program folder
if (!getcwd(cCurrentPath, FILENAME_MAX)) {
return ;
return false;
}
cCurrentPath[FILENAME_MAX - 1] = '\0';
//APPL_INFO("The current working directory is " << cCurrentPath);
basicWindows = new MainWindows();
MainWindows* basicWindows = new MainWindows();
if (NULL == basicWindows) {
APPL_ERROR("Can not allocate the basic windows");
ewol::Stop();
return;
_context.Stop();
return false;
}
// create the specific windows
ewol::WindowsSet(basicWindows);
_context.SetWindows(basicWindows);
// add files
APPL_INFO("show list of files : ");
bool ctagDetected = false;
for( int32_t iii=0 ; iii<ewol::commandLine::Size(); iii++) {
etk::UString tmpppp = ewol::commandLine::Get(iii);
for( int32_t iii=0 ; iii<_context.GetCmd().Size(); iii++) {
etk::UString tmpppp = _context.GetCmd().Get(iii);
if (tmpppp == "-t") {
ctagDetected = true;
} else if (true == ctagDetected) {
APPL_INFO("Load ctag file : \"" << tmpppp << "\"" );
ctagDetected = false;
ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgCtagsLoadFile, tmpppp);
_context.GetEObjectManager().MultiCast().AnonymousSend(ednMsgCtagsLoadFile, tmpppp);
} else {
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
*/
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) {
delete(basicWindows);
basicWindows = NULL;
_context.SetWindows(NULL);
if (NULL != tmpWindows) {
delete(tmpWindows);
tmpWindows = NULL;
}
cTagsManager::UnInit();
@@ -159,6 +147,6 @@ void APP_UnInit(void)
BufferManager::UnInit();
APPL_INFO("Stop ColorizeManager");
ColorizeManager::UnInit();
APPL_INFO("==> Un-Init Edn (END)");
APPL_INFO("==> Un-Init "PROJECT_NAME" (END)");
}

View File

@@ -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
View 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

1
tag
View File

@@ -1 +0,0 @@
0.4.0