83 Commits
0.3.5 ... 0.3.8

Author SHA1 Message Date
450fc0532d [DEBUG] correction of the read write access in the buffer system 2012-11-08 08:43:18 +01:00
841f23a2db [DEV] permit to change the display 2012-11-06 18:08:44 +01:00
858fd3a428 [DEV] cghange the basic Idea of the basic env variable 2012-11-04 15:46:13 +01:00
4514239076 [DEV] Change error display in the manager 2012-11-02 18:06:14 +01:00
8fdeb39b5a [DEV] update to etk::FSNode 2012-11-01 10:48:27 +01:00
eac1f8f594 [DEV] update the config file and the project management 2012-10-27 17:43:10 +02:00
0ba1c33525 [DEV] change the compilation Basic flag in the basic makefile 2012-10-27 01:25:51 +02:00
e88bfb0f0b [DEV] start the copy of files 2012-10-26 18:02:27 +02:00
2031631b77 [DEV] Change the ETK vector and matrix 2012-10-26 16:56:53 +02:00
708e8794a0 [DEBUG] set back an other font to display for test 2012-10-25 18:12:23 +02:00
64edc96eb0 [DEV] add glsl file parsing 2012-10-25 12:05:36 +02:00
79d95a8554 [DEBUG] lower the level debug of the Undo Redo when empty 2012-10-25 11:55:01 +02:00
377662c3a0 [DEBUG] missing copy of the share 2012-10-24 09:23:42 +02:00
8afe7a16f8 [DEV] change the environement of the short-cut ==> only on the code-viewer 2012-10-23 17:47:31 +02:00
2266ba7040 [DEV] Do not display more text than needed 2012-10-19 15:18:20 +02:00
2e96e5bfb1 Reorder the buffer list system 2012-10-18 11:09:19 +02:00
667fe86dc7 [DEV] display line of the CTAGS 2012-10-17 13:31:09 +02:00
e383600df6 [DEV] the Ctags is now availlable inmultiple files 2012-10-17 10:24:23 +02:00
33a36fa0f7 [DEV][CTAGS] integration of the first ewol display version 2012-10-16 18:32:21 +02:00
7aa4f9ae4d [DEV] set the reload of the shader 2012-10-11 18:05:56 +02:00
ecced51f81 small modif in the debug log 2012-10-09 18:00:44 +02:00
6e2df2dc77 Set the distance field test in compilation flags 2012-10-09 09:40:11 +02:00
fc129e2745 update config 2012-09-14 17:24:31 +02:00
5696539e2d cange android system generation 2012-09-12 18:24:26 +02:00
dbcde77a61 change config files* 2012-09-11 18:22:05 +02:00
e5e2ccc56f change android compialtion 2012-09-09 23:39:08 +02:00
dab060c4fe display of the special font work.... 2012-09-07 16:31:49 +02:00
3bdc96097c display big distance field 2012-09-06 18:42:57 +02:00
6ed410d936 First test of the distance field methode for the font 2012-09-06 02:48:41 +02:00
9587e21498 the android specific file is compile internly at ewol 2012-09-04 10:14:32 +02:00
244b83ed16 Change makefile principe and rework the mouse position event 2012-08-31 16:46:57 +02:00
27db00a6f6 some Windows correction 2012-08-31 01:30:34 +02:00
d4f313a54d Request of openGl 2 done corectly 2012-08-30 13:36:27 +02:00
29a5f34a3a update manifest to force request of openGL ES 2 2012-08-30 01:27:04 +02:00
4a916418d7 some change on ewol 2012-08-28 18:11:17 +02:00
f51ea408fa change the resources manager system 2012-08-26 22:44:33 +02:00
cd3968dd20 codeView error in touche mode specific system 2012-08-23 14:12:22 +02:00
76cd7bef21 Ewol change the idea of how the Font are managed 2012-08-22 18:18:59 +02:00
e27720372b remove management of color from etk to agg lib 2012-08-21 18:17:09 +02:00
6f10243046 update to ewol 0.3.4 ==> change the arbo 2012-08-20 18:12:14 +02:00
ae9c0f8eeb adapt at the new OS abstraction 2012-08-19 16:56:59 +02:00
699564e17f change the clipboard system (normalisation and standardisation 2012-08-18 21:06:21 +02:00
0fc8934d93 ewol change his time API 2012-08-16 18:22:10 +02:00
04c86769d6 Reorganise the internal data of this repository 2012-08-15 23:11:44 +02:00
d3e963749b change install on PC basic folder 2012-08-15 11:48:23 +02:00
9640f3c527 change the color_ts in a better class anc rename VectorType in Vector 2012-08-14 16:11:09 +02:00
c992d4a830 orthograph correction of redraw 2012-08-14 08:58:56 +02:00
761fabbac8 direct remove of the widget to simplify the system 2012-08-13 18:00:30 +02:00
2a7a0d0d9b remove the double buffering 2012-08-10 17:27:32 +02:00
c36a9d21f3 Simplify makefiles 2012-08-10 12:11:28 +02:00
96047c36e8 Compilation on Android availlable 2012-08-09 18:33:35 +02:00
a20f3e4063 Revert "STANDARD ==> remove vector type and replace with std::vector (done but sone assertion)" ==> bad idea
This reverts commit 4012d75279.
2012-08-09 14:26:30 +02:00
7ee4747cc2 DEV : try to compile Android directly 2012-08-08 18:22:01 +02:00
4012d75279 STANDARD ==> remove vector type and replace with std::vector (done but sone assertion) 2012-08-07 18:05:02 +02:00
d58bda6896 back compile android 2012-07-25 21:55:34 +02:00
64be551b35 simplify the EObject class 2012-07-24 17:48:18 +02:00
53c34d0894 add About at the parametyer display 2012-07-24 13:01:40 +02:00
9de7bafcb5 First parameter display 2012-07-23 17:21:44 +02:00
1d3ed3f200 update the readme documentation 2012-07-23 14:59:19 +02:00
694e73a29c installer no more availlable due to the new buld system 2012-07-23 09:02:51 +02:00
0dbef0d349 start update avancement.boo 2012-07-22 22:19:57 +02:00
4e7eac1399 Gui is back to normal 2012-07-20 14:37:46 +02:00
12cd1db0e1 first step to update to the OpenGl real orientation 2012-07-19 18:13:21 +02:00
ae2bea1918 Update to the new drawing mode 2012-07-19 16:54:44 +02:00
d1708610c7 Start of the dev of the Parameter section 2012-07-18 18:21:21 +02:00
628c10ff3a Change the close position of the search windows 2012-07-17 13:27:16 +02:00
e10e633949 update the focus metode to the search windows 2012-07-17 13:25:33 +02:00
750e663eca update to the new compilation system for Linux 2012-07-16 17:59:56 +02:00
33c6de5450 small bug 2012-07-13 18:12:14 +02:00
0d4b7188c0 add highlight of the .in files 2012-07-10 12:28:28 +02:00
10d0fb5674 Better search bar 2012-07-03 16:59:22 +02:00
fee00e79c7 set search element in basic image ... 2012-07-02 17:40:49 +02:00
7146a00371 try to simplify 'buffer' manager 2012-07-01 21:43:57 +02:00
2e974251fa Search is back 2012-07-01 17:54:50 +02:00
0d79b55112 remove etkFloat_t element and coord2D_ts with float and Vector2D<float> 2012-07-01 10:13:24 +02:00
df8d2772da add lua parser 2012-05-30 14:16:45 +02:00
aea60950ff Change the image needed in edn 2012-05-29 12:57:07 +02:00
a210af5627 [BREAK compatibility] Update to the new input call function 2012-05-22 09:49:11 +02:00
c594be7a5f scrolling bar in codeView 2012-05-15 13:03:45 +02:00
d19586c4d8 nomenclature of space corection 2012-05-13 21:28:59 +02:00
e5a06889b6 Missing File.svg 2012-05-13 09:46:33 +02:00
4676ea0a63 Remove unnedded code in the application interface 2012-05-13 09:44:18 +02:00
8e4e0a52b6 Correction of the buffer remove ==> no more selectable buffer 2012-05-12 08:58:05 +02:00
214 changed files with 4031 additions and 5027 deletions

15
.gitignore vendored
View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -10,19 +10,46 @@ Instructions
download the software : download the software :
mkdir yourDevFolder
cd yourDevFolder
git clone git://github.com/HeeroYui/ewol.git
cd ewol
git submodule init
git submodule update
cd ..
git clone git://github.com/HeeroYui/edn.git git clone git://github.com/HeeroYui/edn.git
cd edn cd edn
Compile software and install : (debug) Compile software & Run debug version:
sudo make DEBUG=0 install make DEBUG=1
or
make CLANG=1 DEBUG=1
cp -r ../ewol/share/* share/
./out_LINUX/debug/obj/usr/bin/edn -l6 yourFile.txt
Note : -l6 corespond at the LOG level to display
Run Software : (release) Compile software & install & run:
make
./install.sh
edn exemple.txt edn exemple.txt
License (Android) Compile software & install
=======
cd yourDevFolder
mkdir andoid
cd android
download here in "sdk" and "ndk" the coresponding SDK and NDK of Android:
http://developer.android.com/tools/sdk/ndk/index.html
http://developer.android.com/sdk/index.html
==> you need to download sub package of the NDK (refer to the NDK doccumentation) but only supported android version >4.0
cd ../edn
make PLATFORM=Android
make PLATFORM=Android install
License (like GPL)
==================
You can: You can:
- Redistribute the sources code and binaries. - Redistribute the sources code and binaries.

44
Sources/Android.mk Normal file
View File

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

23
Sources/Config.in Normal file
View File

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

42
Sources/Linux.mk Normal file
View File

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

41
Sources/Windows.mk Normal file
View File

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

View File

@@ -27,7 +27,7 @@
#include <appl/global.h> #include <appl/global.h>
#include <Buffer.h> #include <Buffer.h>
#include <BufferManager.h> #include <BufferManager.h>
#include <ewol/EObject.h> #include <ewol/eObject/EObject.h>
#undef __class__ #undef __class__
#define __class__ "Buffer" #define __class__ "Buffer"
@@ -48,8 +48,10 @@ Buffer::Buffer()
m_haveName = false; m_haveName = false;
etk::UString mString = "Untitle - "; etk::UString mString = "Untitle - ";
mString += fileBasicID++; mString += fileBasicID++;
EWOL_DEBUG("Create buffer try name : \"" << mString << "\"");
SetFileName(mString); SetFileName(mString);
m_haveName = false; m_haveName = false;
EWOL_DEBUG("Create buffer with name : " << m_fileName );
} }
/** /**
@@ -60,10 +62,12 @@ Buffer::Buffer()
* @return --- * @return ---
* *
*/ */
Buffer::Buffer(etk::File &newName) Buffer::Buffer(etk::FSNode &newName)
{ {
m_fileModify = false; m_fileModify = false;
EWOL_DEBUG("Create buffer try name : \"" << newName << "\"");
SetFileName(newName); SetFileName(newName);
EWOL_DEBUG("Create buffer with name : " << m_fileName );
} }
/** /**
@@ -76,7 +80,7 @@ Buffer::Buffer(etk::File &newName)
*/ */
Buffer::~Buffer(void) Buffer::~Buffer(void)
{ {
} }
/** /**
* @brief * @brief
@@ -117,19 +121,19 @@ bool Buffer::NeedToUpdateDisplayPosition(void)
return tmpVal; return tmpVal;
} }
coord2D_ts Buffer::GetBorderSize(void) etk::Vector2D<float> Buffer::GetBorderSize(void)
{ {
coord2D_ts tmpVal; etk::Vector2D<float> tmpVal;
tmpVal.x = 30; tmpVal.x = 30;
tmpVal.y = 30; tmpVal.y = 30;
return tmpVal; return tmpVal;
} }
coord2D_ts Buffer::GetPosition(int32_t fontId,bool& centerRequested) etk::Vector2D<float> Buffer::GetPosition(int32_t fontId,bool& centerRequested)
{ {
centerRequested = false; centerRequested = false;
coord2D_ts tmpVal; etk::Vector2D<float> tmpVal;
tmpVal.x = 0; tmpVal.x = 0;
tmpVal.y = 0; tmpVal.y = 0;
return tmpVal; return tmpVal;

View File

@@ -27,7 +27,7 @@
#define __BUFFER_H__ #define __BUFFER_H__
#include <etk/UString.h> #include <etk/UString.h>
#include <etk/File.h> #include <etk/os/FSNode.h>
#include <etk/unicode.h> #include <etk/unicode.h>
#include <ewol/ewol.h> #include <ewol/ewol.h>
@@ -41,19 +41,24 @@ typedef struct{
uint32_t diplayableLine; //!< NB Line that can be displayed uint32_t diplayableLine; //!< NB Line that can be displayed
}infoStatBuffer_ts; }infoStatBuffer_ts;
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
#define TEXT_DISPLAY_TYPE OObject2DTextShader
#else
#define TEXT_DISPLAY_TYPE OObject2DTextColored
#endif
class Buffer { class Buffer {
public: public:
Buffer(void); Buffer(void);
Buffer(etk::File &newName); Buffer(etk::FSNode &newName);
virtual ~Buffer(void); virtual ~Buffer(void);
etk::File GetFileName(void) etk::FSNode GetFileName(void)
{ {
return m_fileName; return m_fileName;
}; };
void SetFileName(etk::File &newName) void SetFileName(etk::FSNode &newName)
{ {
m_fileName = newName; m_fileName = newName;
m_haveName = true; m_haveName = true;
@@ -62,7 +67,7 @@ class Buffer {
void SetFileName(etk::UString &newName) void SetFileName(etk::UString &newName)
{ {
m_fileName.SetCompleateName(newName, etk::FILE_TYPE_DIRECT); m_fileName.SetName(newName);
m_haveName = true; m_haveName = true;
NameChange(); NameChange();
}; };
@@ -80,19 +85,24 @@ class Buffer {
public: public:
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate) {}; virtual void GetInfo(infoStatBuffer_ts &infoToUpdate) {};
virtual void SetLineDisplay(uint32_t lineNumber) {}; virtual void SetLineDisplay(uint32_t lineNumber) {};
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
virtual int32_t Display(ewol::OObject2DTextColored& OOTextNormal, virtual int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOText,
ewol::OObject2DTextColored& OOTextBold,
ewol::OObject2DTextColored& OOTextItalic,
ewol::OObject2DTextColored& OOTextBoldItalic,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY) ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
#else
virtual int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
ewol::TEXT_DISPLAY_TYPE& OOTextBold,
ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
#endif
{ {
return ERR_NONE; return ERR_NONE;
} }
virtual void AddChar(uniChar_t unicodeData) {}; virtual void AddChar(uniChar_t unicodeData) {};
virtual void cursorMove(ewol::eventKbMoveType_te moveTypeEvent) {}; virtual void cursorMove(ewol::eventKbMoveType_te moveTypeEvent) {};
virtual void MouseSelectFromCursorTo(int32_t fontId, int32_t width, int32_t height) {}; virtual void MouseSelectFromCursorTo(etk::Vector2D<float> pos) {};
virtual void MouseEvent(int32_t fontId, int32_t width, int32_t height) {}; virtual void MouseEvent(etk::Vector2D<float> pos) {};
virtual void MouseEventDouble(void) {}; virtual void MouseEventDouble(void) {};
virtual void MouseEventTriple(void) {}; virtual void MouseEventTriple(void) {};
virtual void RemoveLine(void) {}; virtual void RemoveLine(void) {};
@@ -103,9 +113,9 @@ class Buffer {
virtual void SetCharset(unicode::charset_te newCharset) {}; virtual void SetCharset(unicode::charset_te newCharset) {};
//virtual void SelectAll(void); //virtual void SelectAll(void);
virtual void Copy(int8_t clipboardID) {}; virtual void Copy(ewol::clipBoard::clipboardListe_te clipboardID) {};
virtual void Cut(int8_t clipboardID) {}; virtual void Cut(ewol::clipBoard::clipboardListe_te clipboardID) {};
virtual void Paste(int8_t clipboardID) {}; virtual void Paste(ewol::clipBoard::clipboardListe_te clipboardID) {};
virtual void Search(etk::UString &data, bool back, bool caseSensitive, bool wrap, bool regExp) {}; virtual void Search(etk::UString &data, bool back, bool caseSensitive, bool wrap, bool regExp) {};
virtual void Replace(etk::UString &data) {}; virtual void Replace(etk::UString &data) {};
virtual int32_t FindLine(etk::UString &data) { return 0; }; virtual int32_t FindLine(etk::UString &data) { return 0; };
@@ -117,19 +127,19 @@ class Buffer {
// moving with cursor change position: // moving with cursor change position:
private: private:
bool m_updatePositionRequested; //!< if a position xhange in the windows ... bool m_updatePositionRequested; //!< if a position xhange in the windows ...
coord2D_ts m_maximumSize; //!< current maxSize of the buffer etk::Vector2D<float> m_maximumSize; //!< current maxSize of the buffer
protected: protected:
void RequestUpdateOfThePosition(void) { m_updatePositionRequested = true; }; void RequestUpdateOfThePosition(void) { m_updatePositionRequested = true; };
void SetMaximumSize(coord2D_ts maxSize) { m_maximumSize = maxSize; }; void SetMaximumSize(etk::Vector2D<float> maxSize) { m_maximumSize = maxSize; };
public: public:
bool NeedToUpdateDisplayPosition(void); bool NeedToUpdateDisplayPosition(void);
virtual coord2D_ts GetBorderSize(void); // this is to requested the minimum size for the buffer that is not consider as visible ... virtual etk::Vector2D<float> GetBorderSize(void); // this is to requested the minimum size for the buffer that is not consider as visible ...
virtual coord2D_ts GetPosition(int32_t fontId, bool& centerRequested); virtual etk::Vector2D<float> GetPosition(int32_t fontId, bool& centerRequested);
coord2D_ts GetMaxSize(void) { return m_maximumSize; }; etk::Vector2D<float> GetMaxSize(void) { return m_maximumSize; };
protected: protected:
bool m_fileModify; //!< bool m_fileModify; //!<
// naming // naming
etk::File m_fileName; //!< filename of the curent buffer etk::FSNode m_fileName; //!< filename of the curent buffer
bool m_haveName; //!< to know if the file have a name or NOT bool m_haveName; //!< to know if the file have a name or NOT
}; };

View File

@@ -67,34 +67,57 @@ BufferEmpty::~BufferEmpty(void)
* @return --- * @return ---
* *
*/ */
int32_t BufferEmpty::Display(ewol::OObject2DTextColored& OOTextNormal, #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
ewol::OObject2DTextColored& OOTextBold, int32_t BufferEmpty::Display(ewol::TEXT_DISPLAY_TYPE& OOText,
ewol::OObject2DTextColored& OOTextItalic,
ewol::OObject2DTextColored& OOTextBoldItalic,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY) ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
#else
int32_t BufferEmpty::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
ewol::TEXT_DISPLAY_TYPE& OOTextBold,
ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
#endif
{ {
// Get color : // Get color :
Colorize *myColor = NULL; Colorize *myColor = NULL;
int32_t fontId = OOTextNormal.GetFontID(); #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
int32_t letterHeight = ewol::GetHeight(fontId); int32_t letterHeight = OOText.GetHeight();
#else
int32_t letterHeight = OOTextNormal.GetHeight();
#endif
coord2D_ts textPos; etk::Vector2D<float> textPos;
textPos.x = 20; textPos.x = 20;
textPos.y = 20; textPos.y = sizeY - 20 - letterHeight;
etk::UString tmpDisplay ;
myColor = ColorizeManager::Get("normal"); myColor = ColorizeManager::Get("normal");
OOTextBold.SetColor(myColor->GetFG()); tmpDisplay = "edn - Editeur De N'ours";
etk::UString tmpDisplay = "edn - Editeur De N'ours"; #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
OOTextBold.Text(textPos, tmpDisplay); OOText.SetColor(myColor->GetFG());
OOText.SetBold(true);
OOText.SetItalic(false);
OOText.Text(textPos, tmpDisplay);
#else
OOTextBold.SetColor(myColor->GetFG());
OOTextBold.Text(textPos, tmpDisplay);
#endif
myColor = ColorizeManager::Get("commentDoxygen"); myColor = ColorizeManager::Get("commentDoxygen");
OOTextNormal.SetColor(myColor->GetFG()); textPos.y = (int32_t)(textPos.y - letterHeight*1.30);
textPos.y = (int32_t)(textPos.y + letterHeight*1.30);
tmpDisplay = "No Buffer Availlable to display"; tmpDisplay = "No Buffer Availlable to display";
OOTextNormal.Text(textPos, tmpDisplay); #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
OOText.SetBold(false);
OOText.SetItalic(false);
OOText.SetColor(myColor->GetFG());
OOText.Text(textPos, tmpDisplay);
#else
OOTextNormal.SetColor(myColor->GetFG());
OOTextNormal.Text(textPos, tmpDisplay);
#endif
OOColored.SetColor(etk::color::color_White); OOColored.SetColor(draw::color::white);
OOColored.Rectangle( 0, 0, sizeX, sizeY); OOColored.Rectangle( 0, 0, sizeX, sizeY);
return ERR_NONE; return ERR_NONE;

View File

@@ -32,11 +32,17 @@ class BufferEmpty : public Buffer {
public: public:
BufferEmpty(void); BufferEmpty(void);
virtual ~BufferEmpty(void); virtual ~BufferEmpty(void);
int32_t Display(ewol::OObject2DTextColored& OOTextNormal, #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
ewol::OObject2DTextColored& OOTextBold, int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOText,
ewol::OObject2DTextColored& OOTextItalic,
ewol::OObject2DTextColored& OOTextBoldItalic,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY); ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY);
#else
int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
ewol::TEXT_DISPLAY_TYPE& OOTextBold,
ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY);
#endif
}; };

View File

@@ -27,45 +27,18 @@
#include <appl/Debug.h> #include <appl/Debug.h>
#include <appl/global.h> #include <appl/global.h>
#include <BufferManager.h> #include <BufferManager.h>
#include <ewol/EObject.h> #include <ewol/eObject/EObject.h>
#include <ewol/EObjectManager.h> #include <ewol/eObject/EObjectManager.h>
#undef __class__ #undef __class__
#define __class__ "classBufferManager" #define __class__ "classBufferManager"
//!< EObject name :
extern const char * const TYPE_EOBJECT_EDN_BUFFER_MANAGER = "BufferManager";
class classBufferManager: public ewol::EObject class classBufferManager: public ewol::EObject
{ {
public: public:
// Constructeur // Constructeur
classBufferManager(void); classBufferManager(void);
~classBufferManager(void); ~classBufferManager(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_BUFFER_MANAGER << "\" != NULL(pointer) ");
return false;
}
if (objectType == TYPE_EOBJECT_EDN_BUFFER_MANAGER) {
return true;
} else {
if(true == ewol::EObject::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_BUFFER_MANAGER << "\" != \"" << objectType << "\"");
return false;
}
}
/** /**
* @brief Get the current Object type of the EObject * @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 * @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
@@ -74,7 +47,7 @@ class classBufferManager: public ewol::EObject
*/ */
const char * const GetObjectType(void) const char * const GetObjectType(void)
{ {
return TYPE_EOBJECT_EDN_BUFFER_MANAGER; return "ApplBufferManager";
} }
public: public:
/** /**
@@ -90,15 +63,15 @@ class classBufferManager: public ewol::EObject
// create a buffer with no element // create a buffer with no element
int32_t Create(void); int32_t Create(void);
// open curent filename // open curent filename
int32_t Open(etk::File &myFile); int32_t Open(etk::FSNode &myFile);
bool Remove(int32_t BufferID); bool Remove(int32_t BufferID);
public: public:
int32_t GetSelected(void) { return m_idSelected;}; int32_t GetSelected(void) { return m_idSelected;};
//void SetSelected(int32_t id) {m_idSelected = id;}; //void SetSelected(int32_t id) {m_idSelected = id;};
Buffer * Get(int32_t BufferID); Buffer * Get(int32_t BufferID);
bool Exist(int32_t BufferID); bool Exist(int32_t BufferID);
bool Exist(etk::File &myFile); bool Exist(etk::FSNode &myFile);
int32_t GetId(etk::File &myFile); int32_t GetId(etk::FSNode &myFile);
// return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5 // return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5
uint32_t Size(void); uint32_t Size(void);
uint32_t SizeOpen(void); uint32_t SizeOpen(void);
@@ -107,15 +80,13 @@ class classBufferManager: public ewol::EObject
private: private:
etk::VectorType<Buffer*> listBuffer; //!< element List of the char Elements etk::Vector<Buffer*> listBuffer; //!< element List of the char Elements
void RemoveAll(void); //!< remove all buffer void RemoveAll(void); //!< remove all buffer
int32_t m_idSelected; int32_t m_idSelected;
Buffer * BufferNotExiste; //!< When an error arrive in get buffer we return the Error buffer (not writable) Buffer * BufferNotExiste; //!< When an error arrive in get buffer we return the Error buffer (not writable)
}; };
#define EDN_CAST_BUFFER_MANAGER(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_BUFFER_MANAGER,classBufferManager,curentPointer)
// Constructeur // Constructeur
/** /**
@@ -177,7 +148,7 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
APPL_ERROR("Request select buffer ID = \"\" "); APPL_ERROR("Request select buffer ID = \"\" ");
} else { } else {
int32_t newID = -1; int32_t newID = -1;
sscanf(data.Utf8Data(), "%d", &newID); sscanf(data.c_str(), "%d", &newID);
if(true == Exist(newID)) { if(true == Exist(newID)) {
m_idSelected = newID; m_idSelected = newID;
} else { } else {
@@ -194,7 +165,8 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
} }
} else if (eventId == ednMsgOpenFile) { } else if (eventId == ednMsgOpenFile) {
if (data != "" ) { if (data != "" ) {
etk::File myFile(data, etk::FILE_TYPE_DIRECT); etk::FSNode myFile(data);
APPL_DEBUG("request open file = \"" <<data << "\" ?= \"" << myFile << "\"");
int32_t newOne = Open(myFile); int32_t newOne = Open(myFile);
if (-1 != newOne) { if (-1 != newOne) {
m_idSelected = newOne; m_idSelected = newOne;
@@ -221,7 +193,7 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
} }
} else { } else {
int32_t newId; int32_t newId;
sscanf(data.Utf8Data(), "%d", &newId); sscanf(data.c_str(), "%d", &newId);
if (false == Exist(newId)) { if (false == Exist(newId)) {
APPL_ERROR("Request a save As with a non existant ID=" << newId); APPL_ERROR("Request a save As with a non existant ID=" << newId);
} else { } else {
@@ -248,7 +220,7 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
APPL_DEBUG("Close specific buffer ID" << closeID); APPL_DEBUG("Close specific buffer ID" << closeID);
} else { } else {
// close specific buffer ... // close specific buffer ...
sscanf(data.Utf8Data(), "%d", &closeID); sscanf(data.c_str(), "%d", &closeID);
APPL_DEBUG("Close specific buffer ID="<< closeID); APPL_DEBUG("Close specific buffer ID="<< closeID);
} }
if(true == Exist(closeID)) { if(true == Exist(closeID)) {
@@ -272,8 +244,8 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
} }
} }
// set it to the currect display // set it to the currect display
SendMultiCast(ednMsgBufferId, destBuffer);
m_idSelected = destBuffer; m_idSelected = destBuffer;
SendMultiCast(ednMsgBufferId, destBuffer);
} }
// Remove requested buffer // Remove requested buffer
Remove(closeID); Remove(closeID);
@@ -289,7 +261,7 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
APPL_ERROR("Null data for changing buffer ID file ... "); APPL_ERROR("Null data for changing buffer ID file ... ");
} else { } else {
int32_t newId; int32_t newId;
sscanf(data.Utf8Data(), "%d", &newId); sscanf(data.c_str(), "%d", &newId);
if (true == Exist(newId)) { if (true == Exist(newId)) {
m_idSelected = newId; m_idSelected = newId;
} else { } else {
@@ -371,7 +343,7 @@ int32_t classBufferManager::Create(void)
* @todo : check if this file is not curently open and return the old ID * @todo : check if this file is not curently open and return the old ID
* *
*/ */
int32_t classBufferManager::Open(etk::File &myFile) int32_t classBufferManager::Open(etk::FSNode &myFile)
{ {
if (false == Exist(myFile)) { if (false == Exist(myFile)) {
// allocate a new Buffer // allocate a new Buffer
@@ -424,7 +396,7 @@ bool classBufferManager::Exist(int32_t BufferID)
} }
bool classBufferManager::Exist(etk::File &myFile ) bool classBufferManager::Exist(etk::FSNode &myFile )
{ {
if (-1 == GetId(myFile)) { if (-1 == GetId(myFile)) {
return false; return false;
@@ -433,7 +405,7 @@ bool classBufferManager::Exist(etk::File &myFile )
} }
int32_t classBufferManager::GetId(etk::File &myFile) int32_t classBufferManager::GetId(etk::FSNode &myFile)
{ {
int32_t iii; int32_t iii;
// check if the Buffer existed // check if the Buffer existed
@@ -541,7 +513,7 @@ static classBufferManager * localManager = NULL;
void BufferManager::Init(void) void BufferManager::Init(void)
{ {
if (NULL == localManager) { if (NULL != localManager) {
EWOL_ERROR("classBufferManager ==> already exist, just unlink the previous ..."); EWOL_ERROR("classBufferManager ==> already exist, just unlink the previous ...");
localManager = NULL; localManager = NULL;
} }
@@ -558,7 +530,7 @@ void BufferManager::UnInit(void)
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ..."); EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
return; return;
} }
ewol::EObjectManager::MarkToRemoved(localManager); delete(localManager);
localManager = NULL; localManager = NULL;
} }
@@ -589,7 +561,7 @@ bool BufferManager::Exist(int32_t BufferID)
return localManager->Exist(BufferID); return localManager->Exist(BufferID);
} }
bool BufferManager::Exist(etk::File &myFile) bool BufferManager::Exist(etk::FSNode &myFile)
{ {
if (NULL == localManager) { if (NULL == localManager) {
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ..."); EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
@@ -598,7 +570,7 @@ bool BufferManager::Exist(etk::File &myFile)
return localManager->Exist(myFile); return localManager->Exist(myFile);
} }
int32_t BufferManager::GetId(etk::File &myFile) int32_t BufferManager::GetId(etk::FSNode &myFile)
{ {
if (NULL == localManager) { if (NULL == localManager) {
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ..."); EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");

View File

@@ -30,7 +30,7 @@
#include <BufferText.h> #include <BufferText.h>
#include <BufferEmpty.h> #include <BufferEmpty.h>
#include <appl/globalMsg.h> #include <appl/globalMsg.h>
#include <ewol/Widget.h> #include <ewol/widget/Widget.h>
namespace BufferManager namespace BufferManager
{ {
@@ -39,8 +39,8 @@ namespace BufferManager
int32_t GetSelected(void); int32_t GetSelected(void);
Buffer * Get(int32_t BufferID); Buffer * Get(int32_t BufferID);
bool Exist(int32_t BufferID); bool Exist(int32_t BufferID);
bool Exist(etk::File &myFile); bool Exist(etk::FSNode &myFile);
int32_t GetId(etk::File &myFile); int32_t GetId(etk::FSNode &myFile);
// return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5 // return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5
uint32_t Size(void); uint32_t Size(void);
uint32_t SizeOpen(void); uint32_t SizeOpen(void);

View File

@@ -30,10 +30,10 @@
#include <etk/unicode.h> #include <etk/unicode.h>
#include <ewol/ewol.h> #include <ewol/ewol.h>
#include <ewol/OObject.h> #include <ewol/oObject/OObject.h>
#include <ewol/WidgetManager.h> #include <ewol/widget/WidgetManager.h>
#include <ewol/Widget.h> #include <ewol/widget/Widget.h>
#include <ewol/Font.h> #include <ewol/font/Font.h>
#include <ewol/ClipBoard.h> #include <ewol/ClipBoard.h>
@@ -117,20 +117,21 @@ BufferText::BufferText()
* @return --- * @return ---
* *
*/ */
BufferText::BufferText(etk::File &fileName) : Buffer(fileName) BufferText::BufferText(etk::FSNode &fileName) : Buffer(fileName)
{ {
BasicInit(); BasicInit();
NameChange(); NameChange();
APPL_INFO("Add Data from file(" << GetFileName() << ")"); APPL_INFO("Add Data from file(" << GetFileName() << ")");
FILE * myFile = NULL; etk::FSNode myFile(fileName);
// try to open the file. if not existed, new file if (true == myFile.Exist()) {
if (false == myFile.FileOpenRead()) {
myFile = fopen(fileName.GetCompleateName().Utf8Data(), "r"); APPL_WARNING("File can not be open in read mode : " << myFile);
if (NULL != myFile) { SetModify(true);
m_EdnBuf.DumpFrom(myFile); } else {
// close the input file m_EdnBuf.DumpFrom(myFile);
fclose(myFile); myFile.FileClose();
SetModify(false); SetModify(false);
}
} else { } else {
// fichier inexistant... creation d'un nouveaux // fichier inexistant... creation d'un nouveaux
APPL_WARNING("No File ==> created a new one(" << GetFileName() << ")"); APPL_WARNING("No File ==> created a new one(" << GetFileName() << ")");
@@ -151,14 +152,13 @@ BufferText::BufferText(etk::File &fileName) : Buffer(fileName)
void BufferText::Save(void) void BufferText::Save(void)
{ {
APPL_INFO("Save File : \"" << GetFileName() << "\"" ); APPL_INFO("Save File : \"" << GetFileName() << "\"" );
FILE * myFile = NULL; etk::FSNode myFile(GetFileName());
myFile = fopen(GetFileName().GetCompleateName().Utf8Data(), "w"); if (false == myFile.FileOpenWrite()) {
if (NULL != myFile) {
m_EdnBuf.DumpIn(myFile);
fclose(myFile);
SetModify(false);
} else {
APPL_ERROR("Can not open in writing the specify file"); APPL_ERROR("Can not open in writing the specify file");
} else {
m_EdnBuf.DumpIn(myFile);
myFile.FileClose();
SetModify(false);
} }
} }
@@ -206,7 +206,7 @@ void BufferText::SetLineDisplay(uint32_t lineNumber)
#define SEPARATION_SIZE_LINE_NUMBER (3) #define SEPARATION_SIZE_LINE_NUMBER (3)
void BufferText::DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY, int32_t nbColomn, int32_t lineNumber, int32_t positionY) void BufferText::DrawLineNumber(ewol::TEXT_DISPLAY_TYPE* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY, int32_t nbColomn, int32_t lineNumber, int32_t positionY)
{ {
char tmpLineNumber[50]; char tmpLineNumber[50];
sprintf(tmpLineNumber, "%*d", nbColomn, lineNumber); sprintf(tmpLineNumber, "%*d", nbColomn, lineNumber);
@@ -214,7 +214,7 @@ void BufferText::DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObjec
OOColored->Rectangle( 0, positionY, sizeX+0.5*SEPARATION_SIZE_LINE_NUMBER, sizeY); OOColored->Rectangle( 0, positionY, sizeX+0.5*SEPARATION_SIZE_LINE_NUMBER, sizeY);
OOText->SetColor(ColorizeManager::Get(COLOR_CODE_LINE_NUMBER)); OOText->SetColor(ColorizeManager::Get(COLOR_CODE_LINE_NUMBER));
coord2D_ts textPos; etk::Vector2D<float> textPos;
textPos.x = 1; textPos.x = 1;
textPos.y = positionY; textPos.y = positionY;
etk::UString tmppp = tmpLineNumber; etk::UString tmppp = tmpLineNumber;
@@ -225,7 +225,7 @@ void BufferText::DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObjec
#define CURSOR_THICKNESS (1.2) #define CURSOR_THICKNESS (1.2)
void BufferText::DrawCursor(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth, clipping_ts &clip) void BufferText::DrawCursor(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth, clipping_ts &clip)
{ {
color_ts & tmpppppp = ColorizeManager::Get(COLOR_CODE_CURSOR); draw::Color & tmpppppp = ColorizeManager::Get(COLOR_CODE_CURSOR);
OOColored->SetColor(tmpppppp); OOColored->SetColor(tmpppppp);
if (true == ewol::IsSetInsert()) { if (true == ewol::IsSetInsert()) {
OOColored->Rectangle( x, y, letterWidth, letterHeight); OOColored->Rectangle( x, y, letterWidth, letterHeight);
@@ -277,29 +277,39 @@ int32_t BufferText::GetNumberOfLine(void)
* @return * @return
* *
*/ */
int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal, #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
ewol::OObject2DTextColored& OOTextBold, int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOText,
ewol::OObject2DTextColored& OOTextItalic,
ewol::OObject2DTextColored& OOTextBoldItalic,
ewol::OObject2DColored& OOColored, ewol::OObject2DColored& OOColored,
int32_t offsetX, int32_t offsetY, int32_t offsetX, int32_t offsetY,
int32_t sizeX, int32_t sizeY) int32_t sizeX, int32_t sizeY)
#else
int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
ewol::TEXT_DISPLAY_TYPE& OOTextBold,
ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
ewol::OObject2DColored& OOColored,
int32_t offsetX, int32_t offsetY,
int32_t sizeX, int32_t sizeY)
#endif
{ {
int32_t selStart, selEnd, selRectStart, selRectEnd; int32_t selStart, selEnd, selRectStart, selRectEnd;
bool selIsRect; bool selIsRect;
int32_t selHave; int32_t selHave;
int32_t fontId = OOTextNormal.GetFontID(); #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
int32_t letterWidth = ewol::GetWidth(fontId, "A"); int32_t letterWidth = OOText.GetSize("A").x;
int32_t letterHeight = ewol::GetHeight(fontId); int32_t letterHeight = OOText.GetHeight();
#else
int32_t letterWidth = OOTextNormal.GetSize("A").x;
int32_t letterHeight = OOTextNormal.GetHeight();
#endif
int32_t displayStartLineId = offsetY / letterHeight - 1; int32_t displayStartLineId = offsetY / letterHeight - 1;
displayStartLineId = etk_max(0, displayStartLineId); displayStartLineId = etk_max(0, displayStartLineId);
uint32_t y = - offsetY + displayStartLineId*letterHeight; int32_t y = - offsetY + displayStartLineId*letterHeight;
// update the display position with the scroll ofset : // update the display position with the scroll ofset :
int32_t displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, displayStartLineId); int32_t displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, displayStartLineId);
coord2D_ts maxSize; etk::Vector2D<float> maxSize;
maxSize.x = 0.0; maxSize.x = 0.0;
maxSize.y = m_EdnBuf.NumberOfLines() * letterHeight; maxSize.y = m_EdnBuf.NumberOfLines() * letterHeight;
int32_t nbColoneForLineNumber = GetLineNumberNumberOfElement(); int32_t nbColoneForLineNumber = GetLineNumberNumberOfElement();
@@ -309,7 +319,7 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
m_displaySize.y = (sizeY/letterHeight) + 1; m_displaySize.y = (sizeY/letterHeight) + 1;
APPL_VERBOSE("main DIPLAY " << m_displaySize.x << " char * " << m_displaySize.y << " char"); APPL_VERBOSE("main DIPLAY " << m_displaySize.x << " char * " << m_displaySize.y << " char");
selHave = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, selStart, selEnd, selIsRect, selRectStart, selRectEnd); selHave = m_EdnBuf.GetSelectionPos(selStart, selEnd, selIsRect, selRectStart, selRectEnd);
colorInformation_ts * HLColor = NULL; colorInformation_ts * HLColor = NULL;
@@ -317,11 +327,12 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
// Get color : // Get color :
Colorize * myColor = ColorizeManager::Get("normal"); Colorize * myColor = ColorizeManager::Get("normal");
Colorize * myColorSel = ColorizeManager::Get("SelectedText"); Colorize * myColorSel = ColorizeManager::Get("SelectedText");
color_ts & myColorSpace = ColorizeManager::Get(COLOR_CODE_SPACE); draw::Color & myColorSpace = ColorizeManager::Get(COLOR_CODE_SPACE);
color_ts & myColorTab = ColorizeManager::Get(COLOR_CODE_TAB); draw::Color & myColorTab = ColorizeManager::Get(COLOR_CODE_TAB);
Colorize * selectColor = NULL; Colorize * selectColor = NULL;
ewol::OObject2DTextColored* OOTextSelected = NULL; #ifndef APPL_BUFFER_FONT_DISTANCE_FIELD
ewol::TEXT_DISPLAY_TYPE* OOTextSelected = NULL;
#endif
int mylen = m_EdnBuf.Size(); int mylen = m_EdnBuf.Size();
int32_t x_base=nbColoneForLineNumber*letterWidth; int32_t x_base=nbColoneForLineNumber*letterWidth;
int32_t idX = 0; int32_t idX = 0;
@@ -329,13 +340,13 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
OOColored.SetColor(ColorizeManager::Get(COLOR_CODE_BASIC_BG)); OOColored.SetColor(ColorizeManager::Get(COLOR_CODE_BASIC_BG));
OOColored.Rectangle( 0, 0, sizeX, sizeY); OOColored.Rectangle( 0, 0, sizeX, sizeY);
int64_t startTime = GetCurrentTime(); int64_t startTime = ewol::GetTime();
int displayLines = 0; int displayLines = 0;
// Regenerate the colorizing if necessary ... // Regenerate the colorizing if necessary ...
displayHLData_ts m_displayLocalSyntax; displayHLData_ts m_displayLocalSyntax;
m_EdnBuf.HightlightGenerateLines(m_displayLocalSyntax, displayStartBufferPos, m_displaySize.y); m_EdnBuf.HightlightGenerateLines(m_displayLocalSyntax, displayStartBufferPos, m_displaySize.y);
int64_t stopTime = GetCurrentTime(); int64_t stopTime = ewol::GetTime();
APPL_DEBUG("Parsing Highlight = " << stopTime - startTime << " micro-s"); APPL_DEBUG("Parsing Highlight = " << stopTime - startTime << " micro-s");
uniChar_t displayChar[MAX_EXP_CHAR_LEN]; uniChar_t displayChar[MAX_EXP_CHAR_LEN];
@@ -346,10 +357,18 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
APPL_VERBOSE("Start display of text buffer [" << displayStartBufferPos<< ".." << mylen << "]"); APPL_VERBOSE("Start display of text buffer [" << displayStartBufferPos<< ".." << mylen << "]");
APPL_VERBOSE("cursor Pos : " << m_cursorPos << "start at pos=" << displayStartBufferPos); APPL_VERBOSE("cursor Pos : " << m_cursorPos << "start at pos=" << displayStartBufferPos);
// note corection of the openGl invertion system :
y = sizeY - y;
y -= letterHeight;
OOTextNormal.clippingDisable();
OOColored.clippingDisable(); OOColored.clippingDisable();
DrawLineNumber(&OOTextNormal, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y); #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
OOText.clippingDisable();
DrawLineNumber(&OOText, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y);
#else
OOTextNormal.clippingDisable();
DrawLineNumber(&OOTextNormal, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y);
#endif
int32_t pixelX = x_base + SEPARATION_SIZE_LINE_NUMBER; int32_t pixelX = x_base + SEPARATION_SIZE_LINE_NUMBER;
clipping_ts drawClipping; clipping_ts drawClipping;
@@ -364,20 +383,45 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
drawClippingTextArea.w = sizeX - drawClipping.x; drawClippingTextArea.w = sizeX - drawClipping.x;
drawClippingTextArea.h = sizeY; drawClippingTextArea.h = sizeY;
OOTextNormal.clippingSet(drawClippingTextArea); #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
OOTextBold.clippingSet(drawClippingTextArea); OOText.clippingSet(drawClippingTextArea);
OOTextItalic.clippingSet(drawClippingTextArea); #else
OOTextBoldItalic.clippingSet(drawClippingTextArea); OOTextNormal.clippingSet(drawClippingTextArea);
OOTextBold.clippingSet(drawClippingTextArea);
OOTextItalic.clippingSet(drawClippingTextArea);
OOTextBoldItalic.clippingSet(drawClippingTextArea);
#endif
OOColored.clippingSet(drawClippingTextArea); OOColored.clippingSet(drawClippingTextArea);
etkFloat_t lineMaxSize = 0.0; // Clear the line intexation :
for (iii=displayStartBufferPos; iii<mylen && displayLines < m_displaySize.y ; iii = new_i) { m_elmentList.Clear();
//APPL_DEBUG("diplay element=" << iii); // every char element is register to find the diplay pos when mouse event arrive
CharElement tmpElementProperty;
tmpElementProperty.m_yOffset = y;
tmpElementProperty.m_xOffset = 0;
tmpElementProperty.m_ySize = 10;
tmpElementProperty.m_bufferPos = displayStartBufferPos;
m_elmentList.PushBack(tmpElementProperty);
float lineMaxSize = 0.0;
for (iii=displayStartBufferPos; iii<mylen && displayLines >=0 && y >= -2*letterHeight; iii = new_i) {
//APPL_DEBUG("display pos =" << y);
int displaywidth; int displaywidth;
uint32_t currentChar = '\0'; uint32_t currentChar = '\0';
new_i = iii; new_i = iii;
// update the element buffer pos:
tmpElementProperty.m_bufferPos = new_i;
displaywidth = m_EdnBuf.GetExpandedChar(new_i, idX, displayChar, currentChar); displaywidth = m_EdnBuf.GetExpandedChar(new_i, idX, displayChar, currentChar);
int32_t drawSize = 0; int32_t drawSize = 0;
// update display position :
etk::Vector2D<float> textPos;
textPos.x = pixelX-offsetX;
textPos.y = y;
// update X pos
tmpElementProperty.m_xOffset = textPos.x;
tmpElementProperty.m_yOffset = textPos.y;
//APPL_INFO("diplay element=" << new_i); //APPL_INFO("diplay element=" << new_i);
if (currentChar!='\n') { if (currentChar!='\n') {
selectColor = myColor; selectColor = myColor;
@@ -411,26 +455,36 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
haveBg = selectColor->HaveBg(); haveBg = selectColor->HaveBg();
} }
} }
coord2D_ts textPos; #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
textPos.x = pixelX-offsetX; tmpElementProperty.m_ySize = OOText.GetHeight();
textPos.y = y; OOText.SetColor(selectColor->GetFG());
if (true == selectColor->GetItalic() ) { OOText.SetBold(selectColor->GetBold());
if (true == selectColor->GetBold() ) { OOText.SetItalic(selectColor->GetItalic());
OOTextSelected = &OOTextBoldItalic; myStringToDisplay = displayChar;
drawSize = OOText.Text(textPos, myStringToDisplay);
#else
if (true == selectColor->GetItalic() ) {
if (true == selectColor->GetBold() ) {
OOTextSelected = &OOTextBoldItalic;
} else {
OOTextSelected = &OOTextItalic;
}
} else { } else {
OOTextSelected = &OOTextItalic; if (true == selectColor->GetBold() ) {
OOTextSelected = &OOTextBold;
} else {
OOTextSelected = &OOTextNormal;
}
} }
} else { tmpElementProperty.m_ySize = OOTextSelected->GetHeight();
if (true == selectColor->GetBold() ) { //tmpElementProperty.m_yOffset += tmpElementProperty.m_ySize;
OOTextSelected = &OOTextBold; OOTextSelected->SetColor(selectColor->GetFG());
} else { // TODO : Remove this unreallistic leak of time
OOTextSelected = &OOTextNormal; myStringToDisplay = displayChar;
} drawSize = OOTextSelected->Text(textPos, myStringToDisplay);
} #endif
OOTextSelected->SetColor(selectColor->GetFG()); //APPL_DEBUG("add element : " << tmpElementProperty.m_yOffset << "," << tmpElementProperty.m_xOffset);
// TODO : Remove this unreallistic leak of time m_elmentList.PushBack(tmpElementProperty);
myStringToDisplay = displayChar;
drawSize = OOTextSelected->Text(textPos, myStringToDisplay);
if (true == haveBg ) { if (true == haveBg ) {
OOColored.Rectangle(textPos.x, y, drawSize, letterHeight); OOColored.Rectangle(textPos.x, y, drawSize, letterHeight);
@@ -450,23 +504,35 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
lineMaxSize = 0.0; lineMaxSize = 0.0;
idX =0; idX =0;
pixelX = x_base + SEPARATION_SIZE_LINE_NUMBER; pixelX = x_base + SEPARATION_SIZE_LINE_NUMBER;
y += letterHeight; y -= letterHeight;
//APPL_DEBUG("display pos =" << y);
displayLines++; displayLines++;
currentLineID++; currentLineID++;
OOTextNormal.clippingDisable();
OOColored.clippingDisable(); OOColored.clippingDisable();
DrawLineNumber(&OOTextNormal, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y); #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
OOTextNormal.clippingEnable(); OOText.clippingDisable();
OOText.SetBold(false);
OOText.SetItalic(false);
DrawLineNumber(&OOText, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y);
OOText.clippingEnable();
#else
OOTextNormal.clippingDisable();
DrawLineNumber(&OOTextNormal, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y);
OOTextNormal.clippingEnable();
#endif
OOColored.clippingEnable(); OOColored.clippingEnable();
// add elements :
m_elmentList.PushBack(tmpElementProperty);
} }
} }
//APPL_DEBUG("end at pos buf =" << iii << " / " << m_EdnBuf.Size());
// special case : the cursor is at the end of the buffer... // special case : the cursor is at the end of the buffer...
if (m_cursorPos == iii) { if (m_cursorPos == iii) {
DrawCursor(&OOColored, pixelX - offsetX, y, letterHeight, letterWidth, drawClippingTextArea); DrawCursor(&OOColored, pixelX - offsetX, y, letterHeight, letterWidth, drawClippingTextArea);
} }
// set the maximum size for the display ... // set the maximum size for the display ...
SetMaximumSize(maxSize); SetMaximumSize(maxSize);
int64_t stopTime2 = GetCurrentTime(); int64_t stopTime2 = ewol::GetTime();
APPL_DEBUG("DRAW text (brut) = " << stopTime2 - stopTime << " micro-s"); APPL_DEBUG("DRAW text (brut) = " << stopTime2 - stopTime << " micro-s");
return ERR_NONE; return ERR_NONE;
@@ -474,59 +540,45 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
int32_t BufferText::GetMousePosition(int32_t fontId, int32_t width, int32_t height) int32_t BufferText::GetMousePosition(etk::Vector2D<float> pos)
{ {
int32_t letterWidth = ewol::GetWidth(fontId, "9"); bool inLineDone=false;
int32_t letterHeight = ewol::GetHeight(fontId); //APPL_DEBUG("try to find in : " << width << "," << height);
for(int32_t iii=0; iii<m_elmentList.Size()-1; iii++) {
int32_t lineOffset = height / letterHeight; //APPL_DEBUG("check element : " << m_elmentList[iii].m_yOffset << "<= " << pos.y << " <" << (m_elmentList[iii].m_yOffset + m_elmentList[iii].m_ySize));
if(false == inLineDone) {
//******************************* get the X position : ******************************************* if( pos.y>=m_elmentList[iii].m_yOffset
&& pos.y<m_elmentList[iii].m_yOffset + m_elmentList[iii].m_ySize ) {
int32_t iii, new_i; // we find the line (int theory) ==> note : Some problem can appear here when the size are not the same ...
// this is to prevent multiple size font ...
int mylen = m_EdnBuf.Size(); inLineDone = true;
int32_t x_base=GetLineNumberNumberOfElement()*letterWidth + SEPARATION_SIZE_LINE_NUMBER; //APPL_DEBUG(" ==> " << m_elmentList[iii+1].m_xOffset << "> " << pos.x << " >=" << m_elmentList[iii].m_xOffset);
width -= x_base; }
if (width < 0) { }
width = 0; // we detected the line
} if(true == inLineDone) {
int32_t idX = 0; if( pos.x>=m_elmentList[iii].m_xOffset
&& pos.x<m_elmentList[iii+1].m_xOffset ) {
uniChar_t displayChar[MAX_EXP_CHAR_LEN]; // we get the position ...
memset(displayChar, 0, sizeof(uniChar_t)*MAX_EXP_CHAR_LEN); return m_elmentList[iii].m_bufferPos;
} else if (m_elmentList[iii].m_xOffset>=m_elmentList[iii+1].m_xOffset) {
int32_t pixelX = 0; // prevent "end of line" cursor pos ...
int32_t startLinePosition = m_EdnBuf.CountForwardNLines(0, lineOffset); return m_elmentList[iii].m_bufferPos;
if (width <= 0) {
APPL_DEBUG(" Element : Befor the start of the line ... ==> END");
return startLinePosition;
}
APPL_VERBOSE("Get id element : x=" << width << "px y=" << height << "px");
APPL_VERBOSE(" line offset = " << lineOffset);
for (iii=startLinePosition; iii<mylen; iii = new_i) {
int displaywidth;
uint32_t currentChar = '\0';
new_i = iii;
displaywidth = m_EdnBuf.GetExpandedChar(new_i, idX, displayChar, currentChar);
if (currentChar!='\n') {
int32_t drawSize = ewol::GetWidth(fontId, displayChar);
APPL_VERBOSE(" Element : " << currentChar << "=\"" << (char)currentChar << "\" display offset=" << pixelX << "px width=" << drawSize << "px");
pixelX += drawSize;
if (width <= pixelX) {
APPL_VERBOSE(" Find IT ==> END");
// find position ...
break;
} }
} else {
APPL_VERBOSE(" Element : \"\\n\" display width=---px ==> end of line ==> END");
// end of line ... exit cycle
break;
} }
idX += displaywidth;
} }
APPL_VERBOSE("BufferText::GetMousePosition(" << width << "," << height << "); ==> " << iii ); if (m_elmentList.Size()>0) {
return iii; if(pos.y<m_elmentList[m_elmentList.Size()/2].m_yOffset) {
//APPL_DEBUG("Error to get position (return Last)");
return m_elmentList[m_elmentList.Size()-1].m_bufferPos;
} else {
//APPL_DEBUG("Error to get position (return begin)");
return m_elmentList[0].m_bufferPos;
}
} else {
APPL_CRITICAL("Error to get position (very bad)");
return 0;
}
} }
@@ -539,13 +591,13 @@ int32_t BufferText::GetMousePosition(int32_t fontId, int32_t width, int32_t heig
* *
*/ */
// TODO : Simplify selection .... // TODO : Simplify selection ....
void BufferText::MouseEvent(int32_t fontId, int32_t width, int32_t height) void BufferText::MouseEvent(etk::Vector2D<float> pos)
{ {
if (true == ewol::IsSetShift() ) { if (true == ewol::IsSetShift() ) {
MouseSelectFromCursorTo(fontId, width, height); MouseSelectFromCursorTo(pos);
} else { } else {
// Get the caracter mouse position // Get the caracter mouse position
int32_t newPos = GetMousePosition(fontId, width, height); int32_t newPos = GetMousePosition(pos);
// move the cursor // move the cursor
SetInsertPosition(newPos); SetInsertPosition(newPos);
@@ -553,7 +605,7 @@ void BufferText::MouseEvent(int32_t fontId, int32_t width, int32_t height)
/*if (m_cursorPreferredCol < 0) { /*if (m_cursorPreferredCol < 0) {
m_cursorPreferredCol = posX; m_cursorPreferredCol = posX;
}*/ }*/
m_EdnBuf.Unselect(SELECTION_PRIMARY); m_EdnBuf.Unselect();
RequestUpdateOfThePosition(); RequestUpdateOfThePosition();
} }
@@ -569,15 +621,14 @@ void BufferText::MouseEvent(int32_t fontId, int32_t width, int32_t height)
* @todo : Set the move up and DOWN... * @todo : Set the move up and DOWN...
* *
*/ */
// TODO : Simplify selection .... void BufferText::MouseSelectFromCursorTo(etk::Vector2D<float> pos)
void BufferText::MouseSelectFromCursorTo(int32_t fontId, int32_t width, int32_t height)
{ {
// Get the caracter mouse position // Get the caracter mouse position
int32_t newPos = GetMousePosition(fontId, width, height); int32_t newPos = GetMousePosition(pos);
int32_t selStart, selEnd, selRectStart, selRectEnd; int32_t selStart, selEnd, selRectStart, selRectEnd;
bool selIsRect; bool selIsRect;
int32_t selHave = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, selStart, selEnd, selIsRect, selRectStart, selRectEnd); int32_t selHave = m_EdnBuf.GetSelectionPos(selStart, selEnd, selIsRect, selRectStart, selRectEnd);
//APPL_DEBUG("BufferText:: " << selHave << " = BufGetSelectionPos(SELECTION_PRIMARY," << selStart << "," << selEnd << "," << selIsRect << "," << selRectStart << "," << selRectEnd << ");" ); //APPL_DEBUG("BufferText:: " << selHave << " = BufGetSelectionPos(SELECTION_PRIMARY," << selStart << "," << selEnd << "," << selIsRect << "," << selRectStart << "," << selRectEnd << ");" );
int32_t rememberCursorPos = m_cursorPos; int32_t rememberCursorPos = m_cursorPos;
// move the cursor // move the cursor
@@ -589,12 +640,12 @@ void BufferText::MouseSelectFromCursorTo(int32_t fontId, int32_t width, int32_t
}*/ }*/
if (false == selHave) { if (false == selHave) {
m_EdnBuf.Select(SELECTION_PRIMARY, rememberCursorPos, m_cursorPos); m_EdnBuf.Select(rememberCursorPos, m_cursorPos);
} else { } else {
if (rememberCursorPos == selStart) { if (rememberCursorPos == selStart) {
m_EdnBuf.Select(SELECTION_PRIMARY, m_cursorPos, selEnd); m_EdnBuf.Select(m_cursorPos, selEnd);
} else { } else {
m_EdnBuf.Select(SELECTION_PRIMARY, selStart, m_cursorPos); m_EdnBuf.Select(selStart, m_cursorPos);
} }
} }
Copy(ewol::clipBoard::CLIPBOARD_SELECTION); Copy(ewol::clipBoard::CLIPBOARD_SELECTION);
@@ -615,7 +666,7 @@ void BufferText::MouseEventDouble(void)
{ {
int32_t beginPos, endPos; int32_t beginPos, endPos;
if (true == m_EdnBuf.SelectAround(m_cursorPos, beginPos, endPos)) { if (true == m_EdnBuf.SelectAround(m_cursorPos, beginPos, endPos)) {
m_EdnBuf.Select(SELECTION_PRIMARY, beginPos, endPos); m_EdnBuf.Select(beginPos, endPos);
m_cursorPos = endPos; m_cursorPos = endPos;
} }
Copy(ewol::clipBoard::CLIPBOARD_SELECTION); Copy(ewol::clipBoard::CLIPBOARD_SELECTION);
@@ -632,7 +683,7 @@ void BufferText::MouseEventDouble(void)
*/ */
void BufferText::MouseEventTriple(void) void BufferText::MouseEventTriple(void)
{ {
m_EdnBuf.Select(SELECTION_PRIMARY, m_EdnBuf.StartOfLine(m_cursorPos), m_EdnBuf.EndOfLine(m_cursorPos)); m_EdnBuf.Select(m_EdnBuf.StartOfLine(m_cursorPos), m_EdnBuf.EndOfLine(m_cursorPos));
m_cursorPos = m_EdnBuf.EndOfLine(m_cursorPos); m_cursorPos = m_EdnBuf.EndOfLine(m_cursorPos);
Copy(ewol::clipBoard::CLIPBOARD_SELECTION); Copy(ewol::clipBoard::CLIPBOARD_SELECTION);
} }
@@ -648,14 +699,14 @@ void BufferText::RemoveLine(void)
void BufferText::SelectAll(void) void BufferText::SelectAll(void)
{ {
m_EdnBuf.Select(SELECTION_PRIMARY, 0, m_EdnBuf.Size()); m_EdnBuf.Select(0, m_EdnBuf.Size());
m_cursorPos = m_EdnBuf.Size(); m_cursorPos = m_EdnBuf.Size();
Copy(ewol::clipBoard::CLIPBOARD_SELECTION); Copy(ewol::clipBoard::CLIPBOARD_SELECTION);
} }
void BufferText::SelectNone(void) void BufferText::SelectNone(void)
{ {
m_EdnBuf.Unselect(SELECTION_PRIMARY); m_EdnBuf.Unselect();
} }
@@ -671,13 +722,13 @@ void BufferText::SetInsertPosition(int32_t newPos, bool insertChar)
{ {
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd; int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
bool SelectionIsRect; bool SelectionIsRect;
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
int32_t rememberCursorPos = m_cursorPos; int32_t rememberCursorPos = m_cursorPos;
//APPL_DEBUG("newPos=" << newPos); //APPL_DEBUG("newPos=" << newPos);
// unselect buffer: // unselect buffer:
m_EdnBuf.Unselect(SELECTION_PRIMARY); m_EdnBuf.Unselect();
/* make sure new position is ok, do nothing if it hasn't changed */ /* make sure new position is ok, do nothing if it hasn't changed */
if (newPos != m_cursorPos) { if (newPos != m_cursorPos) {
if (newPos < 0){ if (newPos < 0){
@@ -695,19 +746,19 @@ void BufferText::SetInsertPosition(int32_t newPos, bool insertChar)
return; return;
} }
if( false == haveSelectionActive if( false == haveSelectionActive
&& true == ewol::IsSetShift() ) && true == ewol::IsSetShift() )
{ {
// new selection // new selection
m_EdnBuf.Select(SELECTION_PRIMARY, rememberCursorPos, m_cursorPos); m_EdnBuf.Select(rememberCursorPos, m_cursorPos);
} else if( true == ewol::IsSetShift() } else if( true == ewol::IsSetShift()
&& true == haveSelectionActive) && true == haveSelectionActive)
{ {
// update selection // update selection
if (rememberCursorPos == SelectionStart) { if (rememberCursorPos == SelectionStart) {
m_EdnBuf.Select(SELECTION_PRIMARY, m_cursorPos, SelectionEnd); m_EdnBuf.Select(m_cursorPos, SelectionEnd);
} else { } else {
m_EdnBuf.Select(SELECTION_PRIMARY, SelectionStart, m_cursorPos); m_EdnBuf.Select(SelectionStart, m_cursorPos);
} }
} }
} }
@@ -849,11 +900,11 @@ void BufferText::cursorMove(ewol::eventKbMoveType_te moveTypeEvent)
* @return --- * @return ---
* *
*/ */
coord2D_ts BufferText::GetPosition(int32_t fontId, bool& centerRequested) etk::Vector2D<float> BufferText::GetPosition(int32_t fontId, bool& centerRequested)
{ {
centerRequested = m_centerRequested; centerRequested = m_centerRequested;
m_centerRequested = false; m_centerRequested = false;
coord2D_ts outputPosition; etk::Vector2D<float> outputPosition;
// Display position (Y mode): // Display position (Y mode):
APPL_INFO("change the position : " << m_cursorPos); APPL_INFO("change the position : " << m_cursorPos);
@@ -867,8 +918,13 @@ coord2D_ts BufferText::GetPosition(int32_t fontId, bool& centerRequested)
// get font porperties : // get font porperties :
// TODO : change this : // TODO : change this :
etkFloat_t letterWidth = ewol::GetWidth(fontId, "A"); // TODO : Set it back ...
etkFloat_t letterHeight = ewol::GetHeight(fontId); /*
float letterWidth = ewol::GetWidth(fontId, "A");
float letterHeight = ewol::GetHeight(fontId);
*/
float letterWidth = 10;
float letterHeight = 15;
outputPosition.x *= letterWidth; outputPosition.x *= letterWidth;
outputPosition.y *= letterHeight; outputPosition.y *= letterHeight;
return outputPosition; return outputPosition;
@@ -876,7 +932,7 @@ coord2D_ts BufferText::GetPosition(int32_t fontId, bool& centerRequested)
/* if we request a center : /* if we request a center :
} else { } else {
// center the line at the middle of the screen : // center the line at the middle of the screen :
coord2D_ts outputPosition; etk::Vector2D<float> outputPosition;
//APPL_DEBUG(" -------------------------------------------------"); //APPL_DEBUG(" -------------------------------------------------");
outputPosition.y = m_EdnBuf.CountLines(0, m_cursorPos); outputPosition.y = m_EdnBuf.CountLines(0, m_cursorPos);
//APPL_DEBUG(" cursor position : " << m_cursorPos << " ==> ligne=" << outputPosition.y); //APPL_DEBUG(" cursor position : " << m_cursorPos << " ==> ligne=" << outputPosition.y);
@@ -907,10 +963,10 @@ void BufferText::AddChar(uniChar_t unicodeData)
{ {
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd; int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
bool SelectionIsRect; bool SelectionIsRect;
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
if (unicodeData == 0x09) { if (unicodeData == 0x09) {
if (false == haveSelectionActive) { if (false == haveSelectionActive) {
etk::VectorType<int8_t> tmpVect; etk::Vector<int8_t> tmpVect;
tmpVect.PushBack(0x09); tmpVect.PushBack(0x09);
m_EdnBuf.Insert(m_cursorPos, tmpVect); m_EdnBuf.Insert(m_cursorPos, tmpVect);
SetInsertPosition(m_cursorPos+1, true); SetInsertPosition(m_cursorPos+1, true);
@@ -919,20 +975,20 @@ void BufferText::AddChar(uniChar_t unicodeData)
// count the number of line : // count the number of line :
int32_t nbSelectedLines = m_EdnBuf.CountLines(SelectionStart, SelectionEnd); int32_t nbSelectedLines = m_EdnBuf.CountLines(SelectionStart, SelectionEnd);
if (0 == nbSelectedLines) { if (0 == nbSelectedLines) {
etk::VectorType<int8_t> tmpVect; etk::Vector<int8_t> tmpVect;
tmpVect.PushBack(0x09); tmpVect.PushBack(0x09);
m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, tmpVect); m_EdnBuf.ReplaceSelected(tmpVect);
SetInsertPosition(SelectionStart+tmpVect.Size(), true); SetInsertPosition(SelectionStart+tmpVect.Size(), true);
} else { } else {
if (true == ewol::IsSetShift() ) { if (true == ewol::IsSetShift() ) {
m_cursorPos = m_EdnBuf.UnIndent(SELECTION_PRIMARY); m_cursorPos = m_EdnBuf.UnIndent();
} else { } else {
m_cursorPos = m_EdnBuf.Indent(SELECTION_PRIMARY); m_cursorPos = m_EdnBuf.Indent();
} }
} }
} }
} else if (unicodeData == '\n') { } else if (unicodeData == '\n') {
etk::VectorType<int8_t> tmpVect; etk::Vector<int8_t> tmpVect;
if (true == ewol::IsSetShift()) { if (true == ewol::IsSetShift()) {
tmpVect.PushBack('\r'); tmpVect.PushBack('\r');
} else { } else {
@@ -963,7 +1019,7 @@ void BufferText::AddChar(uniChar_t unicodeData)
m_EdnBuf.Insert(m_cursorPos, tmpVect); m_EdnBuf.Insert(m_cursorPos, tmpVect);
SetInsertPosition(m_cursorPos+tmpVect.Size(), true); SetInsertPosition(m_cursorPos+tmpVect.Size(), true);
} else { } else {
m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, tmpVect); m_EdnBuf.ReplaceSelected(tmpVect);
SetInsertPosition(SelectionStart+tmpVect.Size(), true); SetInsertPosition(SelectionStart+tmpVect.Size(), true);
} }
} else if (unicodeData == 0x7F ) { } else if (unicodeData == 0x7F ) {
@@ -971,7 +1027,7 @@ void BufferText::AddChar(uniChar_t unicodeData)
if (false == haveSelectionActive) { if (false == haveSelectionActive) {
m_EdnBuf.Remove(m_cursorPos, m_cursorPos+1); m_EdnBuf.Remove(m_cursorPos, m_cursorPos+1);
} else { } else {
m_EdnBuf.RemoveSelected(SELECTION_PRIMARY); m_EdnBuf.RemoveSelected();
SetInsertPosition(SelectionStart, true); SetInsertPosition(SelectionStart, true);
} }
} else if (unicodeData == 0x08) { } else if (unicodeData == 0x08) {
@@ -980,7 +1036,7 @@ void BufferText::AddChar(uniChar_t unicodeData)
m_EdnBuf.Remove(m_cursorPos-1, m_cursorPos); m_EdnBuf.Remove(m_cursorPos-1, m_cursorPos);
SetInsertPosition(m_cursorPos-1, true); SetInsertPosition(m_cursorPos-1, true);
} else { } else {
m_EdnBuf.RemoveSelected(SELECTION_PRIMARY); m_EdnBuf.RemoveSelected();
SetInsertPosition(SelectionStart, true); SetInsertPosition(SelectionStart, true);
} }
} else { } else {
@@ -988,14 +1044,14 @@ void BufferText::AddChar(uniChar_t unicodeData)
if (true == m_EdnBuf.GetUTF8Mode()) { if (true == m_EdnBuf.GetUTF8Mode()) {
char tmpUTF8[16]; char tmpUTF8[16];
unicode::convertUnicodeToUtf8(unicodeData, tmpUTF8); unicode::convertUnicodeToUtf8(unicodeData, tmpUTF8);
etk::VectorType<int8_t> tmpVect; etk::Vector<int8_t> tmpVect;
int32_t localOfset = strlen(tmpUTF8); int32_t localOfset = strlen(tmpUTF8);
tmpVect.PushBack((int8_t*)tmpUTF8, localOfset); tmpVect.PushBack((int8_t*)tmpUTF8, localOfset);
if (false == haveSelectionActive) { if (false == haveSelectionActive) {
m_EdnBuf.Insert(m_cursorPos, tmpVect); m_EdnBuf.Insert(m_cursorPos, tmpVect);
SetInsertPosition(m_cursorPos+localOfset, true); SetInsertPosition(m_cursorPos+localOfset, true);
} else { } else {
m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, tmpVect); m_EdnBuf.ReplaceSelected(tmpVect);
SetInsertPosition(SelectionStart+localOfset, true); SetInsertPosition(SelectionStart+localOfset, true);
} }
} else { } else {
@@ -1003,13 +1059,13 @@ void BufferText::AddChar(uniChar_t unicodeData)
char output_ISO; char output_ISO;
unicode::convertUnicodeToIso(m_EdnBuf.GetCharsetType(), unicodeData, output_ISO); unicode::convertUnicodeToIso(m_EdnBuf.GetCharsetType(), unicodeData, output_ISO);
//printf(" insert : \"%s\"==> 0x%08x=%d ", UTF8data, (unsigned int)output_ISO, (int)output_ISO); //printf(" insert : \"%s\"==> 0x%08x=%d ", UTF8data, (unsigned int)output_ISO, (int)output_ISO);
etk::VectorType<int8_t> tmpVect; etk::Vector<int8_t> tmpVect;
tmpVect.PushBack(output_ISO); tmpVect.PushBack(output_ISO);
if (false == haveSelectionActive) { if (false == haveSelectionActive) {
m_EdnBuf.Insert(m_cursorPos, tmpVect); m_EdnBuf.Insert(m_cursorPos, tmpVect);
SetInsertPosition(m_cursorPos+1, true); SetInsertPosition(m_cursorPos+1, true);
} else { } else {
m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, tmpVect); m_EdnBuf.ReplaceSelected(tmpVect);
SetInsertPosition(SelectionStart+1, true); SetInsertPosition(SelectionStart+1, true);
} }
} }
@@ -1027,7 +1083,7 @@ int32_t BufferText::FindLine(etk::UString &data)
return 0; return 0;
} }
APPL_INFO("Search data line : \"" << data << "\""); APPL_INFO("Search data line : \"" << data << "\"");
etk::VectorType<uniChar_t> mVectSearch; etk::Vector<uniChar_t> mVectSearch;
mVectSearch = data.GetVector(); mVectSearch = data.GetVector();
//APPL_INFO("search data Forward : startSearchPos=" << startSearchPos ); //APPL_INFO("search data Forward : startSearchPos=" << startSearchPos );
/* /*
@@ -1047,7 +1103,7 @@ int32_t BufferText::FindLine(etk::UString &data)
void BufferText::JumpAtLine(int32_t newLine) void BufferText::JumpAtLine(int32_t newLine)
{ {
int32_t positionLine = m_EdnBuf.CountForwardNLines(0, newLine); int32_t positionLine = m_EdnBuf.CountForwardNLines(0, newLine);
m_EdnBuf.Unselect(SELECTION_PRIMARY); m_EdnBuf.Unselect();
APPL_DEBUG("jump at the line : " << newLine ); APPL_DEBUG("jump at the line : " << newLine );
SetInsertPosition(positionLine); SetInsertPosition(positionLine);
m_centerRequested = true; m_centerRequested = true;
@@ -1075,7 +1131,7 @@ void BufferText::Search(etk::UString &data, bool back, bool caseSensitive, bool
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd; int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
bool SelectionIsRect; bool SelectionIsRect;
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
int32_t startSearchPos = m_cursorPos; int32_t startSearchPos = m_cursorPos;
if (true == haveSelectionActive) { if (true == haveSelectionActive) {
@@ -1090,46 +1146,41 @@ void BufferText::Search(etk::UString &data, bool back, bool caseSensitive, bool
APPL_WARNING("no search data"); APPL_WARNING("no search data");
return; return;
} }
etk::VectorType<uniChar_t> mVectSearch;
mVectSearch = data.GetVector();
APPL_TODO("Remove for now ...");
/*
if (false == back) { if (false == back) {
//APPL_INFO("search data Forward : startSearchPos=" << startSearchPos ); //APPL_INFO("search data Forward : startSearchPos=" << startSearchPos );
int32_t foundPos; int32_t foundPos;
bool findSomething = m_EdnBuf.SearchForward(startSearchPos, mVectSearch, &foundPos, caseSensitive); int32_t foundPosEnd;
bool findSomething = m_EdnBuf.SearchForward(startSearchPos, data, &foundPos, &foundPosEnd, caseSensitive);
if( false == findSomething if( false == findSomething
&& true == wrap) && true == wrap)
{ {
//APPL_INFO("WrapMode !!! 0 ==> end"); //APPL_INFO("WrapMode !!! 0 ==> end");
findSomething = m_EdnBuf.SearchForward(0, mVectSearch, &foundPos, caseSensitive); findSomething = m_EdnBuf.SearchForward(0, data, &foundPos, &foundPosEnd, caseSensitive);
} }
// if find data : // if find data :
if (true == findSomething) { if (true == findSomething) {
// select new position // select new position
int32_t endSelectionPos = foundPos+mVectSearch.Size(); SetInsertPosition(foundPosEnd);
SetInsertPosition(endSelectionPos); m_EdnBuf.Select(foundPos, foundPosEnd);
m_EdnBuf.Select(SELECTION_PRIMARY, foundPos, endSelectionPos);
} }
} else { } else {
//APPL_INFO("search data Backward : " << data.GetDirectPointer() ); //APPL_INFO("search data Backward : " << data.GetDirectPointer() );
int32_t foundPos; int32_t foundPos;
bool findSomething = m_EdnBuf.SearchBackward(startSearchPos, mVectSearch, &foundPos, caseSensitive); int32_t foundPosEnd;
bool findSomething = m_EdnBuf.SearchBackward(startSearchPos, data, &foundPos, &foundPosEnd, caseSensitive);
if( false == findSomething if( false == findSomething
&& true == wrap) && true == wrap)
{ {
//APPL_INFO("WrapMode !!! end ==> 0"); //APPL_INFO("WrapMode !!! end ==> 0");
findSomething = m_EdnBuf.SearchBackward(m_EdnBuf.Size(), mVectSearch, &foundPos, caseSensitive); findSomething = m_EdnBuf.SearchBackward(m_EdnBuf.Size(), data, &foundPos, &foundPosEnd, caseSensitive);
} }
// if find data : // if find data :
if (true == findSomething) { if (true == findSomething) {
// select new position // select new position
int32_t endSelectionPos = foundPos+mVectSearch.Size();
SetInsertPosition(foundPos); SetInsertPosition(foundPos);
m_EdnBuf.Select(SELECTION_PRIMARY, foundPos, endSelectionPos); m_EdnBuf.Select(foundPos, foundPosEnd);
} }
} }
*/
m_centerRequested = true; m_centerRequested = true;
RequestUpdateOfThePosition(); RequestUpdateOfThePosition();
} }
@@ -1139,10 +1190,10 @@ void BufferText::Replace(etk::UString &data)
{ {
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd; int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
bool SelectionIsRect; bool SelectionIsRect;
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
if (true == haveSelectionActive) { if (true == haveSelectionActive) {
// Replace Data : // Replace Data :
int32_t size = m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, data); int32_t size = m_EdnBuf.ReplaceSelected(data);
SetInsertPosition(SelectionStart + size); SetInsertPosition(SelectionStart + size);
} }
SetModify(true); SetModify(true);
@@ -1157,12 +1208,12 @@ void BufferText::Replace(etk::UString &data)
* @return --- * @return ---
* *
*/ */
void BufferText::Copy(int8_t clipboardID) void BufferText::Copy(ewol::clipBoard::clipboardListe_te clipboardID)
{ {
etk::UString mVect; etk::UString mVect;
// get the curent selected data // get the curent selected data
if (true == m_EdnBuf.SelectHasSelection(SELECTION_PRIMARY) ) { if (true == m_EdnBuf.SelectHasSelection() ) {
m_EdnBuf.GetSelectionText(SELECTION_PRIMARY, mVect); m_EdnBuf.GetSelectionText(mVect);
} }
// copy data in the click board : // copy data in the click board :
ewol::clipBoard::Set(clipboardID, mVect); ewol::clipBoard::Set(clipboardID, mVect);
@@ -1177,19 +1228,19 @@ void BufferText::Copy(int8_t clipboardID)
* @return --- * @return ---
* *
*/ */
void BufferText::Cut(int8_t clipboardID) void BufferText::Cut(ewol::clipBoard::clipboardListe_te clipboardID)
{ {
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd; int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
bool SelectionIsRect; bool SelectionIsRect;
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
// copy data // copy data
Copy(clipboardID); Copy(clipboardID);
// remove data : // remove data :
if (true == haveSelectionActive ) { if (true == haveSelectionActive ) {
APPL_INFO("REMOVE SELECTION"); APPL_INFO("REMOVE SELECTION");
m_EdnBuf.RemoveSelected(SELECTION_PRIMARY); m_EdnBuf.RemoveSelected();
m_cursorPos = SelectionStart; m_cursorPos = SelectionStart;
} }
RequestUpdateOfThePosition(); RequestUpdateOfThePosition();
@@ -1205,19 +1256,19 @@ void BufferText::Cut(int8_t clipboardID)
* @return --- * @return ---
* *
*/ */
void BufferText::Paste(int8_t clipboardID) void BufferText::Paste(ewol::clipBoard::clipboardListe_te clipboardID)
{ {
etk::UString mVect; etk::UString mVect;
// copy data from the click board : // copy data from the click board :
ewol::clipBoard::Get(clipboardID, mVect); mVect = ewol::clipBoard::Get(clipboardID);
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd; int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
bool SelectionIsRect; bool SelectionIsRect;
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
if (true == haveSelectionActive ) { if (true == haveSelectionActive ) {
// replace data // replace data
int32_t size = m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, mVect ); int32_t size = m_EdnBuf.ReplaceSelected(mVect );
m_cursorPos = SelectionStart + size; m_cursorPos = SelectionStart + size;
} else { } else {
// insert data // insert data

View File

@@ -36,33 +36,48 @@ typedef enum {
CURSOR_DISPLAY_MODE_NOT_FOCUS, CURSOR_DISPLAY_MODE_NOT_FOCUS,
} cursorDisplayMode_te; } cursorDisplayMode_te;
class CharElement
{
public:
int16_t m_yOffset;
int16_t m_xOffset;
int16_t m_ySize;
int32_t m_bufferPos;
};
class BufferText : public Buffer { class BufferText : public Buffer {
public: public:
BufferText(void); BufferText(void);
BufferText(etk::File &fileName); BufferText(etk::FSNode &fileName);
virtual ~BufferText(void); virtual ~BufferText(void);
void Save(void); void Save(void);
void GetInfo(infoStatBuffer_ts &infoToUpdate); void GetInfo(infoStatBuffer_ts &infoToUpdate);
void SetLineDisplay(uint32_t lineNumber); void SetLineDisplay(uint32_t lineNumber);
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
int32_t Display(ewol::OObject2DTextColored& OOTextNormal, int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOText,
ewol::OObject2DTextColored& OOTextBold,
ewol::OObject2DTextColored& OOTextItalic,
ewol::OObject2DTextColored& OOTextBoldItalic,
ewol::OObject2DColored& OOColored, ewol::OObject2DColored& OOColored,
int32_t offsetX, int32_t offsetY, int32_t offsetX, int32_t offsetY,
int32_t sizeX, int32_t sizeY); int32_t sizeX, int32_t sizeY);
#else
int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
ewol::TEXT_DISPLAY_TYPE& OOTextBold,
ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
ewol::OObject2DColored& OOColored,
int32_t offsetX, int32_t offsetY,
int32_t sizeX, int32_t sizeY);
#endif
void AddChar(uniChar_t unicodeData); void AddChar(uniChar_t unicodeData);
void cursorMove(ewol::eventKbMoveType_te moveTypeEvent); void cursorMove(ewol::eventKbMoveType_te moveTypeEvent);
void MouseSelectFromCursorTo(int32_t fontId, int32_t width, int32_t height); void MouseSelectFromCursorTo(etk::Vector2D<float> pos);
void MouseEvent(int32_t fontId, int32_t width, int32_t height); void MouseEvent(etk::Vector2D<float> pos);
void MouseEventDouble(void); void MouseEventDouble(void);
void MouseEventTriple(void); void MouseEventTriple(void);
void Copy(int8_t clipboardID); void Copy(ewol::clipBoard::clipboardListe_te clipboardID);
void Cut(int8_t clipboardID); void Cut(ewol::clipBoard::clipboardListe_te clipboardID);
void Paste(int8_t clipboardID); void Paste(ewol::clipBoard::clipboardListe_te clipboardID);
void Search(etk::UString &data, bool back, bool caseSensitive, bool wrap, bool regExp); void Search(etk::UString &data, bool back, bool caseSensitive, bool wrap, bool regExp);
void Replace(etk::UString &data); void Replace(etk::UString &data);
@@ -84,27 +99,28 @@ class BufferText : public Buffer {
int32_t GetLineNumberNumberOfElement(void); int32_t GetLineNumberNumberOfElement(void);
// Direct buffer IO // Direct buffer IO
EdnBuf m_EdnBuf; //!< buffer associated on this displayer EdnBuf m_EdnBuf; //!< buffer associated on this displayer
coord2D_ts m_displaySize; //!< number of char displayable in the screan etk::Vector2D<float> m_displaySize; //!< number of char displayable in the screan
// Cursor : // Cursor :
int32_t m_cursorPos; //!< position in the buffer of the cursor int32_t m_cursorPos; //!< position in the buffer of the cursor
int32_t m_cursorPreferredCol; //!< colomn of the last up and down ... int32_t m_cursorPreferredCol; //!< colomn of the last up and down ...
cursorDisplayMode_te m_cursorMode; //!< type of cursor Selected cursorDisplayMode_te m_cursorMode; //!< type of cursor Selected
etk::Vector<CharElement> m_elmentList; //!< Elemnt position for every char displayed
// internal function // internal function
void BasicInit(void); void BasicInit(void);
private: private:
bool m_centerRequested; bool m_centerRequested;
public: public:
virtual coord2D_ts GetPosition(int32_t fontId, bool& centerRequested); virtual etk::Vector2D<float> GetPosition(int32_t fontId, bool& centerRequested);
private: private:
bool TextDMoveUp(int32_t offset); bool TextDMoveUp(int32_t offset);
bool TextDMoveDown(int32_t offset); bool TextDMoveDown(int32_t offset);
void SetInsertPosition(int32_t newPosition, bool insertChar = false); void SetInsertPosition(int32_t newPosition, bool insertChar = false);
int32_t GetMousePosition(int32_t fontId, int32_t width, int32_t height); int32_t GetMousePosition(etk::Vector2D<float> pos);
void DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY, int32_t nbColomn, int32_t lineNumber, int32_t positionY); void DrawLineNumber(ewol::TEXT_DISPLAY_TYPE* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY, int32_t nbColomn, int32_t lineNumber, int32_t positionY);
void DrawCursor(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth, clipping_ts &clip); void DrawCursor(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth, clipping_ts &clip);
}; };

View File

@@ -56,18 +56,10 @@ EdnBuf::EdnBuf(void)
m_useTabs = true; m_useTabs = true;
// Current selection // Current selection
m_selectionList[SELECTION_PRIMARY].selected = false; m_selectionList.selected = false;
m_selectionList[SELECTION_PRIMARY].zeroWidth = false; m_selectionList.zeroWidth = false;
m_selectionList[SELECTION_PRIMARY].rectangular = false; m_selectionList.rectangular = false;
m_selectionList[SELECTION_PRIMARY].start = m_selectionList[SELECTION_PRIMARY].end = 0; m_selectionList.start = m_selectionList.end = 0;
m_selectionList[SELECTION_SECONDARY].selected = false;
m_selectionList[SELECTION_SECONDARY].zeroWidth = false;
m_selectionList[SELECTION_SECONDARY].rectangular = false;
m_selectionList[SELECTION_SECONDARY].start = m_selectionList[SELECTION_SECONDARY].end = 0;
m_selectionList[SELECTION_HIGHTLIGHT].selected = false;
m_selectionList[SELECTION_HIGHTLIGHT].zeroWidth = false;
m_selectionList[SELECTION_HIGHTLIGHT].rectangular = false;
m_selectionList[SELECTION_HIGHTLIGHT].start = m_selectionList[SELECTION_HIGHTLIGHT].end = 0;
// charset : // charset :
m_isUtf8 = false; m_isUtf8 = false;
@@ -97,10 +89,10 @@ EdnBuf::~EdnBuf(void)
* @return true if OK / false if an error occured * @return true if OK / false if an error occured
* *
*/ */
bool EdnBuf::DumpIn(FILE *myFile) bool EdnBuf::DumpIn(etk::FSNode &file)
{ {
// write Data // write Data
return m_data.DumpIn(myFile); return m_data.DumpIn(file);
} }
@@ -112,11 +104,11 @@ bool EdnBuf::DumpIn(FILE *myFile)
* @return true if OK / false if an error occured * @return true if OK / false if an error occured
* *
*/ */
bool EdnBuf::DumpFrom(FILE *myFile) bool EdnBuf::DumpFrom(etk::FSNode &file)
{ {
if (true == m_data.DumpFrom(myFile) ) { if (true == m_data.DumpFrom(file) ) {
// set no selection // set no selection
UpdateSelections(0, 0, m_data.Size() ); UpdateSelection(0, 0, m_data.Size() );
// generate HighLight // generate HighLight
CleanHighLight(); CleanHighLight();
GenerateHighLightAt(0, m_data.Size()); GenerateHighLightAt(0, m_data.Size());
@@ -127,7 +119,7 @@ bool EdnBuf::DumpFrom(FILE *myFile)
} }
void EdnBuf::GetAll(etk::VectorType<int8_t> &text) void EdnBuf::GetAll(etk::Vector<int8_t> &text)
{ {
// Clean output vector // Clean output vector
text.Clear(); text.Clear();
@@ -136,9 +128,9 @@ void EdnBuf::GetAll(etk::VectorType<int8_t> &text)
} }
void EdnBuf::SetAll(etk::VectorType<int8_t> &text) void EdnBuf::SetAll(etk::Vector<int8_t> &text)
{ {
etk::VectorType<int8_t> deletedText; etk::Vector<int8_t> deletedText;
// extract all data of the buffer : // extract all data of the buffer :
GetAll(deletedText); GetAll(deletedText);
@@ -150,13 +142,13 @@ void EdnBuf::SetAll(etk::VectorType<int8_t> &text)
m_data.Insert(0, text); m_data.Insert(0, text);
// Zero all of the existing selections // Zero all of the existing selections
UpdateSelections(0, deletedText.Size(), 0); UpdateSelection(0, deletedText.Size(), 0);
// Call the modification Event Manager // Call the modification Event Manager
eventModification(0, m_data.Size(), deletedText); eventModification(0, m_data.Size(), deletedText);
} }
void EdnBuf::GetRange(int32_t start, int32_t end, etk::VectorType<int8_t> &output) void EdnBuf::GetRange(int32_t start, int32_t end, etk::Vector<int8_t> &output)
{ {
// Remove all data ... // Remove all data ...
output.Clear(); output.Clear();
@@ -170,14 +162,14 @@ void EdnBuf::GetRange(int32_t start, int32_t end, etk::UString &output)
// Remove all data ... // Remove all data ...
output = ""; output = "";
// import data : // import data :
etk::VectorType<int8_t> localOutput; etk::Vector<int8_t> localOutput;
m_data.Get(start, end-start, localOutput); m_data.Get(start, end-start, localOutput);
// transcript in UNICODE ... // transcript in UNICODE ...
if (true == m_isUtf8) { if (true == m_isUtf8) {
localOutput.PushBack('\0'); localOutput.PushBack('\0');
output = (char*)&localOutput[0]; output = (char*)&localOutput[0];
} else { } else {
etk::VectorType<uniChar_t> tmpUnicodeData; etk::Vector<uniChar_t> tmpUnicodeData;
// transform in unicode : // transform in unicode :
convertIsoToUnicode(m_charsetType, localOutput, tmpUnicodeData); convertIsoToUnicode(m_charsetType, localOutput, tmpUnicodeData);
output = tmpUnicodeData; output = tmpUnicodeData;
@@ -210,7 +202,7 @@ int8_t EdnBuf::operator[] (int32_t pos)
* @return --- * @return ---
* *
*/ */
int32_t EdnBuf::Insert(int32_t pos, etk::VectorType<int8_t> &insertText) int32_t EdnBuf::Insert(int32_t pos, etk::Vector<int8_t> &insertText)
{ {
// if pos is not contiguous to existing text, make it // if pos is not contiguous to existing text, make it
pos = etk_avg(0, pos, m_data.Size() ); pos = etk_avg(0, pos, m_data.Size() );
@@ -218,7 +210,7 @@ int32_t EdnBuf::Insert(int32_t pos, etk::VectorType<int8_t> &insertText)
int32_t sizeInsert=LocalInsert(pos, insertText); int32_t sizeInsert=LocalInsert(pos, insertText);
// Call the redisplay ... // Call the redisplay ...
etk::VectorType<int8_t> deletedText; etk::Vector<int8_t> deletedText;
eventModification(pos, insertText.Size(), deletedText); eventModification(pos, insertText.Size(), deletedText);
return sizeInsert; return sizeInsert;
} }
@@ -230,7 +222,7 @@ int32_t EdnBuf::Insert(int32_t pos, etk::UString &insertText)
int32_t sizeInsert=LocalInsert(pos, insertText); int32_t sizeInsert=LocalInsert(pos, insertText);
// Call the redisplay ... // Call the redisplay ...
etk::VectorType<int8_t> deletedText; etk::Vector<int8_t> deletedText;
eventModification(pos, insertText.Size(), deletedText); eventModification(pos, insertText.Size(), deletedText);
return sizeInsert; return sizeInsert;
} }
@@ -245,27 +237,34 @@ int32_t EdnBuf::Insert(int32_t pos, etk::UString &insertText)
* @return nb Octet inserted * @return nb Octet inserted
* *
*/ */
int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::VectorType<int8_t> &insertText) int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::Vector<int8_t> &insertText)
{ {
etk::VectorType<int8_t> deletedText; if (end-start == 0) {
return 0;
}
etk::Vector<int8_t> deletedText;
GetRange(start, end, deletedText); GetRange(start, end, deletedText);
m_data.Replace(start, end-start, insertText); m_data.Replace(start, end-start, insertText);
// update internal elements // update internal elements
eventModification(start, insertText.Size(), deletedText); eventModification(start, insertText.Size(), deletedText);
return insertText.Size(); return insertText.Size();
} }
int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::UString &insertText) int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::UString &insertText)
{ {
etk::VectorType<int8_t> deletedText; if (end-start == 0) {
return 0;
}
etk::Vector<int8_t> deletedText;
GetRange(start, end, deletedText); GetRange(start, end, deletedText);
etk::VectorType<int8_t> tmpInsertText; etk::Vector<int8_t> tmpInsertText;
if (true == m_isUtf8) { if (true == m_isUtf8) {
char * tmpPointer = insertText.Utf8Data(); char * tmpPointer = insertText.c_str();
while (*tmpPointer != '\0') { while (*tmpPointer != '\0') {
tmpInsertText.PushBack(*tmpPointer++); tmpInsertText.PushBack(*tmpPointer++);
} }
} else { } else {
etk::VectorType<unsigned int> tmppp = insertText.GetVector(); etk::Vector<unsigned int> tmppp = insertText.GetVector();
convertUnicodeToIso(m_charsetType, tmppp, tmpInsertText); convertUnicodeToIso(m_charsetType, tmppp, tmpInsertText);
} }
if (tmpInsertText.Size()>0) { if (tmpInsertText.Size()>0) {
@@ -297,7 +296,7 @@ int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::UString &insertText)
void EdnBuf::Remove(int32_t start, int32_t end) void EdnBuf::Remove(int32_t start, int32_t end)
{ {
etk::VectorType<int8_t> deletedText; etk::Vector<int8_t> deletedText;
// Make sure the arguments make sense // Make sure the arguments make sense
if (start > end) { if (start > end) {
int32_t temp = start; int32_t temp = start;
@@ -314,21 +313,21 @@ void EdnBuf::Remove(int32_t start, int32_t end)
} }
int32_t EdnBuf::Indent(selectionType_te select) int32_t EdnBuf::Indent(void)
{ {
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd; int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
bool SelectionIsRect; bool SelectionIsRect;
bool haveSelectionActive = GetSelectionPos(select, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); bool haveSelectionActive = GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
if (false == haveSelectionActive) { if (false == haveSelectionActive) {
return SelectionEnd; return SelectionEnd;
} }
// Disable selection: // Disable selection:
Unselect(select); Unselect();
// Get Range : // Get Range :
int32_t l_start = StartOfLine(SelectionStart); int32_t l_start = StartOfLine(SelectionStart);
int32_t l_end = EndOfLine(SelectionEnd); int32_t l_end = EndOfLine(SelectionEnd);
etk::VectorType<int8_t> l_tmpData; etk::Vector<int8_t> l_tmpData;
GetRange(l_start, l_end, l_tmpData); GetRange(l_start, l_end, l_tmpData);
l_tmpData.Insert(0, '\n'); l_tmpData.Insert(0, '\n');
@@ -348,26 +347,26 @@ int32_t EdnBuf::Indent(selectionType_te select)
Replace(l_start, l_end, l_tmpData); Replace(l_start, l_end, l_tmpData);
// Set the new selection : // Set the new selection :
l_end = l_start + l_tmpData.Size(); l_end = l_start + l_tmpData.Size();
Select(select, l_start, l_end); Select(l_start, l_end);
// Return the position of the cursor // Return the position of the cursor
return l_end; return l_end;
} }
int32_t EdnBuf::UnIndent(selectionType_te select) int32_t EdnBuf::UnIndent(void)
{ {
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd; int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
bool SelectionIsRect; bool SelectionIsRect;
bool haveSelectionActive = GetSelectionPos(select, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); bool haveSelectionActive = GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
if (false == haveSelectionActive) { if (false == haveSelectionActive) {
return SelectionEnd; return SelectionEnd;
} }
// Disable selection: // Disable selection:
Unselect(select); Unselect();
// Get Range : // Get Range :
int32_t l_start = StartOfLine(SelectionStart); int32_t l_start = StartOfLine(SelectionStart);
int32_t l_end = EndOfLine(SelectionEnd); int32_t l_end = EndOfLine(SelectionEnd);
etk::VectorType<int8_t> l_tmpData; etk::Vector<int8_t> l_tmpData;
GetRange(l_start, l_end, l_tmpData); GetRange(l_start, l_end, l_tmpData);
l_tmpData.Insert(0, '\n'); l_tmpData.Insert(0, '\n');
@@ -394,7 +393,7 @@ int32_t EdnBuf::UnIndent(selectionType_te select)
Replace(l_start, l_end, l_tmpData); Replace(l_start, l_end, l_tmpData);
// Set the new selection : // Set the new selection :
l_end = l_start + l_tmpData.Size(); l_end = l_start + l_tmpData.Size();
Select(select, l_start, l_end); Select(l_start, l_end);
// Return the position of the cursor // Return the position of the cursor
return l_end; return l_end;
} }
@@ -409,7 +408,7 @@ int32_t EdnBuf::UnIndent(selectionType_te select)
* @return --- * @return ---
* *
*/ */
void EdnBuf::GetLineText(int32_t pos, etk::VectorType<int8_t> &text) void EdnBuf::GetLineText(int32_t pos, etk::Vector<int8_t> &text)
{ {
GetRange( StartOfLine(pos), EndOfLine(pos), text); GetRange( StartOfLine(pos), EndOfLine(pos), text);
} }
@@ -842,9 +841,9 @@ int32_t EdnBuf::CountLines(int32_t startPos, int32_t endPos)
* @return number of line found * @return number of line found
* *
*/ */
int32_t EdnBuf::CountLines(etk::VectorType<int8_t> &data) int32_t EdnBuf::CountLines(etk::Vector<int8_t> &data)
{ {
etk::VectorType<int8_t>::Iterator myPosIt = data.Begin(); etk::Vector<int8_t>::Iterator myPosIt = data.Begin();
int32_t lineCount = 0; int32_t lineCount = 0;
while(myPosIt) { while(myPosIt) {
@@ -986,13 +985,25 @@ bool EdnBuf::charMatch(char first, char second, bool caseSensitive)
* @return false ==> not found data * @return false ==> not found data
* *
*/ */
bool EdnBuf::SearchForward(int32_t startPos, etk::VectorType<int8_t> &searchVect, int32_t *foundPos, bool caseSensitive) bool EdnBuf::SearchForward(int32_t startPos, etk::UString &search, int32_t *foundPos, int32_t *foundPosEnd, bool caseSensitive)
{ {
etk::Vector<int8_t> searchVect;
if (true == m_isUtf8) {
char * tmpPointer = search.c_str();
while (*tmpPointer != '\0') {
searchVect.PushBack(*tmpPointer++);
}
} else {
etk::Vector<unsigned int> tmppp = search.GetVector();
convertUnicodeToIso(m_charsetType, tmppp, searchVect);
}
// remove the '\0' at the end of the string ...
searchVect.PopBack();
int32_t position; int32_t position;
int32_t searchLen = searchVect.Size(); int32_t searchLen = searchVect.Size();
int32_t dataLen = m_data.Size(); int32_t dataLen = m_data.Size();
char currentChar = '\0'; char currentChar = '\0';
//APPL_INFO(" startPos=" << startPos << " searchLen=" << searchLen); APPL_INFO(" startPos=" << startPos << " searchLen=" << searchLen);
for (position=startPos; position<dataLen - (searchLen-1); position++) { for (position=startPos; position<dataLen - (searchLen-1); position++) {
currentChar = m_data[position]; currentChar = m_data[position];
if (true == charMatch(currentChar, searchVect[0], caseSensitive)) { if (true == charMatch(currentChar, searchVect[0], caseSensitive)) {
@@ -1007,11 +1018,13 @@ bool EdnBuf::SearchForward(int32_t startPos, etk::VectorType<int8_t> &searchVect
} }
if (true == found) { if (true == found) {
*foundPos = position; *foundPos = position;
*foundPosEnd = position + searchVect.Size();
return true; return true;
} }
} }
} }
*foundPos = m_data.Size(); *foundPos = m_data.Size();
*foundPosEnd = m_data.Size();
return false; return false;
} }
@@ -1027,8 +1040,21 @@ bool EdnBuf::SearchForward(int32_t startPos, etk::VectorType<int8_t> &searchVect
* @return false ==> not found data * @return false ==> not found data
* *
*/ */
bool EdnBuf::SearchBackward(int32_t startPos, etk::VectorType<int8_t> &searchVect, int32_t *foundPos, bool caseSensitive) bool EdnBuf::SearchBackward(int32_t startPos, etk::UString &search, int32_t *foundPos, int32_t *foundPosEnd, bool caseSensitive)
{ {
etk::Vector<int8_t> searchVect;
if (true == m_isUtf8) {
char * tmpPointer = search.c_str();
while (*tmpPointer != '\0') {
searchVect.PushBack(*tmpPointer++);
}
} else {
etk::Vector<unsigned int> tmppp = search.GetVector();
convertUnicodeToIso(m_charsetType, tmppp, searchVect);
}
// remove the '\0' at the end of the string ...
searchVect.PopBack();
int32_t position; int32_t position;
int32_t searchLen = searchVect.Size(); int32_t searchLen = searchVect.Size();
char currentChar = '\0'; char currentChar = '\0';
@@ -1047,11 +1073,13 @@ bool EdnBuf::SearchBackward(int32_t startPos, etk::VectorType<int8_t> &searchVec
} }
if (true == found) { if (true == found) {
*foundPos = position - (searchLen-1); *foundPos = position - (searchLen-1);
*foundPosEnd = position + searchVect.Size();
return true; return true;
} }
} }
} }
*foundPos = m_data.Size(); *foundPos = m_data.Size();
*foundPosEnd = m_data.Size();
return false; return false;
} }
@@ -1153,25 +1181,25 @@ bool EdnBuf::SelectAround(int32_t startPos, int32_t &beginPos, int32_t &endPos)
* @return number of element inserted. * @return number of element inserted.
* *
*/ */
int32_t EdnBuf::LocalInsert(int32_t pos, etk::VectorType<int8_t> &insertText) int32_t EdnBuf::LocalInsert(int32_t pos, etk::Vector<int8_t> &insertText)
{ {
// Insert data in buffer // Insert data in buffer
m_data.Insert(pos, insertText); m_data.Insert(pos, insertText);
// update the current selected area // update the current selected area
UpdateSelections(pos, 0, insertText.Size() ); UpdateSelection(pos, 0, insertText.Size() );
// return the number of element inserted ... // return the number of element inserted ...
return insertText.Size(); return insertText.Size();
} }
int32_t EdnBuf::LocalInsert(int32_t pos, etk::UString &insertText) int32_t EdnBuf::LocalInsert(int32_t pos, etk::UString &insertText)
{ {
etk::VectorType<int8_t> tmpInsertText; etk::Vector<int8_t> tmpInsertText;
if (true == m_isUtf8) { if (true == m_isUtf8) {
char * tmpPointer = insertText.Utf8Data(); char * tmpPointer = insertText.c_str();
while (*tmpPointer != '\0') { while (*tmpPointer != '\0') {
tmpInsertText.PushBack(*tmpPointer++); tmpInsertText.PushBack(*tmpPointer++);
} }
} else { } else {
etk::VectorType<unsigned int> tmppp = insertText.GetVector(); etk::Vector<unsigned int> tmppp = insertText.GetVector();
convertUnicodeToIso(m_charsetType, tmppp, tmpInsertText); convertUnicodeToIso(m_charsetType, tmppp, tmpInsertText);
} }
if (tmpInsertText.Size()>0) { if (tmpInsertText.Size()>0) {
@@ -1193,7 +1221,7 @@ int32_t EdnBuf::LocalInsert(int32_t pos, etk::UString &insertText)
* @return --- * @return ---
* *
*/ */
void EdnBuf::eventModification(int32_t pos, int32_t nInserted, etk::VectorType<int8_t> &deletedText) void EdnBuf::eventModification(int32_t pos, int32_t nInserted, etk::Vector<int8_t> &deletedText)
{ {
if( 0 == deletedText.Size() if( 0 == deletedText.Size()
&& 0 == nInserted) && 0 == nInserted)

View File

@@ -58,16 +58,8 @@ typedef struct {
int32_t rectEnd; //!< Indent of right edge of rect. selection int32_t rectEnd; //!< Indent of right edge of rect. selection
} selection; } selection;
typedef enum{
SELECTION_PRIMARY,
SELECTION_SECONDARY,
SELECTION_HIGHTLIGHT,
SELECTION_SIZE
}selectionType_te;
typedef struct { typedef struct {
etk::VectorType<colorInformation_ts> HLData; etk::Vector<colorInformation_ts> HLData;
int32_t posHLPass1; int32_t posHLPass1;
int32_t posHLPass2; int32_t posHLPass2;
}displayHLData_ts; }displayHLData_ts;
@@ -82,24 +74,24 @@ class EdnBuf {
// destructer // destructer
~EdnBuf(void); ~EdnBuf(void);
// public function : // public function :
void GetAll( etk::VectorType<int8_t> &text); void GetAll( etk::Vector<int8_t> &text);
void SetAll( etk::VectorType<int8_t> &text); void SetAll( etk::Vector<int8_t> &text);
void GetRange( int32_t start, int32_t end, etk::VectorType<int8_t> &output); void GetRange( int32_t start, int32_t end, etk::Vector<int8_t> &output);
void GetRange( int32_t start, int32_t end, etk::UString &output); void GetRange( int32_t start, int32_t end, etk::UString &output);
bool DumpIn( FILE *myFile); bool DumpIn( etk::FSNode &file);
bool DumpFrom( FILE *myFile); bool DumpFrom( etk::FSNode &file);
// replace with operator [] ... // replace with operator [] ...
int8_t operator[] (int32_t); int8_t operator[] (int32_t);
int32_t Insert( int32_t pos, etk::VectorType<int8_t> &insertText); int32_t Insert( int32_t pos, etk::Vector<int8_t> &insertText);
int32_t Insert( int32_t pos, etk::UString &insertText); int32_t Insert( int32_t pos, etk::UString &insertText);
int32_t Replace( int32_t start, int32_t end, etk::VectorType<int8_t> &insertText); int32_t Replace( int32_t start, int32_t end, etk::Vector<int8_t> &insertText);
int32_t Replace( int32_t start, int32_t end, etk::UString &insertText); int32_t Replace( int32_t start, int32_t end, etk::UString &insertText);
void Remove( int32_t start, int32_t end); void Remove( int32_t start, int32_t end);
int32_t Indent( selectionType_te select); int32_t Indent( void);
int32_t UnIndent( selectionType_te select); int32_t UnIndent( void);
void GetLineText( int32_t pos, etk::VectorType<int8_t> &text); void GetLineText( int32_t pos, etk::Vector<int8_t> &text);
int32_t StartOfLine( int32_t pos); int32_t StartOfLine( int32_t pos);
int32_t EndOfLine( int32_t pos); int32_t EndOfLine( int32_t pos);
@@ -111,39 +103,38 @@ class EdnBuf {
int32_t CountForwardDispChars( int32_t lineStartPos, int32_t nChars); int32_t CountForwardDispChars( int32_t lineStartPos, int32_t nChars);
int32_t CountLines( int32_t startPos, int32_t endPos); int32_t CountLines( int32_t startPos, int32_t endPos);
int32_t CountLines( void); int32_t CountLines( void);
int32_t CountLines( etk::VectorType<int8_t> &data); int32_t CountLines( etk::Vector<int8_t> &data);
int32_t CountForwardNLines( int32_t startPos, int32_t nLines); int32_t CountForwardNLines( int32_t startPos, int32_t nLines);
int32_t CountBackwardNLines( int32_t startPos, int32_t nLines); int32_t CountBackwardNLines( int32_t startPos, int32_t nLines);
bool SearchForward( int32_t startPos, etk::VectorType<int8_t> &searchVect, int32_t *foundPos, bool caseSensitive = true); bool SearchForward( int32_t startPos, etk::UString &search, int32_t *foundPos, int32_t *foundPosEnd, bool caseSensitive = true);
bool SearchBackward( int32_t startPos, etk::VectorType<int8_t> &searchVect, int32_t *foundPos, bool caseSensitive = true); bool SearchBackward( int32_t startPos, etk::UString &search, int32_t *foundPos, int32_t *foundPosEnd, bool caseSensitive = true);
bool SearchForward( int32_t startPos, char searchChar, int32_t *foundPos); bool SearchForward( int32_t startPos, char searchChar, int32_t *foundPos);
bool SearchBackward( int32_t startPos, char searchChar, int32_t *foundPos); bool SearchBackward( int32_t startPos, char searchChar, int32_t *foundPos);
bool SelectAround( int32_t startPos, int32_t &beginPos, int32_t &endPos); bool SelectAround( int32_t startPos, int32_t &beginPos, int32_t &endPos);
// Buffer Size system : // Buffer Size system :
int32_t Size(void) { return m_data.Size(); }; int32_t Size(void) { return m_data.Size(); };
int32_t NumberOfLines(void) {return m_nbLine;}; int32_t NumberOfLines(void) { return m_nbLine; };
// ----------------------------------------- // -----------------------------------------
// selection remember... // selection remember...
// ----------------------------------------- // -----------------------------------------
public: public:
bool SelectHasSelection( selectionType_te select); bool SelectHasSelection(void);
void Select( selectionType_te select, int32_t start, int32_t end); void Select( int32_t start, int32_t end);
void Unselect( selectionType_te select); void Unselect( void);
void RectSelect( selectionType_te select, int32_t start, int32_t end, int32_t rectStart, int32_t rectEnd); void RectSelect( int32_t start, int32_t end, int32_t rectStart, int32_t rectEnd);
bool GetSelectionPos( selectionType_te select, int32_t &start, int32_t &end, bool &isRect, int32_t &rectStart, int32_t &rectEnd); bool GetSelectionPos( int32_t &start, int32_t &end, bool &isRect, int32_t &rectStart, int32_t &rectEnd);
void GetSelectionText( selectionType_te select, etk::VectorType<int8_t> &text); void GetSelectionText( etk::Vector<int8_t> &text);
void GetSelectionText( selectionType_te select, etk::UString &text); void GetSelectionText( etk::UString &text);
void RemoveSelected( selectionType_te select); void RemoveSelected( void);
int32_t ReplaceSelected( selectionType_te select, etk::VectorType<int8_t> &text); int32_t ReplaceSelected( etk::Vector<int8_t> &text);
int32_t ReplaceSelected( selectionType_te select, etk::UString &text); int32_t ReplaceSelected( etk::UString &text);
private: private:
// current selection of the buffer // current selection of the buffer
selection m_selectionList[SELECTION_SIZE]; //!< Selection area of the buffer selection m_selectionList; //!< Selection area of the buffer
void UpdateSelection( selectionType_te select, int32_t pos, int32_t nDeleted, int32_t nInserted); void UpdateSelection( int32_t pos, int32_t nDeleted, int32_t nInserted);
void UpdateSelections( int32_t pos, int32_t nDeleted, int32_t nInserted);
// ----------------------------------------- // -----------------------------------------
// History section : // History section :
@@ -154,15 +145,15 @@ class EdnBuf {
private: private:
bool m_isUndoProcessing; bool m_isUndoProcessing;
bool m_isRedoProcessing; bool m_isRedoProcessing;
etk::VectorType<EdnBufHistory*> m_historyUndo; etk::Vector<EdnBufHistory*> m_historyUndo;
etk::VectorType<EdnBufHistory*> m_historyRedo; etk::Vector<EdnBufHistory*> m_historyRedo;
// ----------------------------------------- // -----------------------------------------
// hightlight section : // hightlight section :
// ----------------------------------------- // -----------------------------------------
private: private:
Highlight * m_Highlight; //!< internal link with the Highlight system Highlight * m_Highlight; //!< internal link with the Highlight system
etk::VectorType<colorInformation_ts> m_HLDataPass1; //!< colorisation position in the current buffer pass 1 etk::Vector<colorInformation_ts> m_HLDataPass1; //!< colorisation position in the current buffer pass 1
void RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdded); void RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdded);
void GenerateHighLightAt(int32_t pos, int32_t endPos, int32_t addinPos=0); void GenerateHighLightAt(int32_t pos, int32_t endPos, int32_t addinPos=0);
void CleanHighLight(void); void CleanHighLight(void);
@@ -206,10 +197,10 @@ class EdnBuf {
void removeSelected( selection &sel); void removeSelected( selection &sel);
void replaceSelected( selection &sel, const char *text); void replaceSelected( selection &sel, const char *text);
void eventModification( int32_t pos, int32_t nInserted, etk::VectorType<int8_t> &deletedText); void eventModification( int32_t pos, int32_t nInserted, etk::Vector<int8_t> &deletedText);
int32_t LocalInsert( int32_t pos, etk::VectorType<int8_t> &insertText); int32_t LocalInsert( int32_t pos, etk::Vector<int8_t> &insertText);
int32_t LocalInsert( int32_t pos, etk::UString &insertText); int32_t LocalInsert( int32_t pos, etk::UString &insertText);
bool charMatch( char first, char second, bool caseSensitive = true); bool charMatch( char first, char second, bool caseSensitive = true);

View File

@@ -39,7 +39,7 @@ EdnBufHistory::EdnBufHistory(void)
m_nInserted = 0; m_nInserted = 0;
} }
EdnBufHistory::EdnBufHistory(int32_t pos, int32_t nInserted, etk::VectorType<int8_t> &deletedText) EdnBufHistory::EdnBufHistory(int32_t pos, int32_t nInserted, etk::Vector<int8_t> &deletedText)
{ {
//APPL_INFO("EdnBufHistory new + data"); //APPL_INFO("EdnBufHistory new + data");
m_pos = pos; m_pos = pos;
@@ -47,7 +47,7 @@ EdnBufHistory::EdnBufHistory(int32_t pos, int32_t nInserted, etk::VectorType<int
m_deletedText = deletedText; m_deletedText = deletedText;
} }
void EdnBufHistory::Set(int32_t pos, int32_t nInserted, etk::VectorType<int8_t> &deletedText) void EdnBufHistory::Set(int32_t pos, int32_t nInserted, etk::Vector<int8_t> &deletedText)
{ {
//APPL_INFO("EdnBufHistory new + data"); //APPL_INFO("EdnBufHistory new + data");
m_pos = pos; m_pos = pos;
@@ -75,7 +75,7 @@ int32_t EdnBufHistory::getnbInserted(void)
return m_nInserted; return m_nInserted;
} }
void EdnBufHistory::getData(etk::VectorType<int8_t> &deletedText) void EdnBufHistory::getData(etk::Vector<int8_t> &deletedText)
{ {
deletedText = m_deletedText; deletedText = m_deletedText;
} }

View File

@@ -27,22 +27,22 @@
#define __EDN_BUFFER_HISTORY_H__ #define __EDN_BUFFER_HISTORY_H__
#include <etk/VectorType.h> #include <etk/Vector.h>
class EdnBufHistory{ class EdnBufHistory{
public: public:
EdnBufHistory(void); EdnBufHistory(void);
EdnBufHistory(int32_t pos, int32_t nInserted, etk::VectorType<int8_t> &deletedText); EdnBufHistory(int32_t pos, int32_t nInserted, etk::Vector<int8_t> &deletedText);
~EdnBufHistory(void); ~EdnBufHistory(void);
void Set(int32_t pos, int32_t nInserted, etk::VectorType<int8_t> &deletedText); void Set(int32_t pos, int32_t nInserted, etk::Vector<int8_t> &deletedText);
int32_t getPos(void); int32_t getPos(void);
int32_t getnbDeleted(void); int32_t getnbDeleted(void);
int32_t getnbInserted(void); int32_t getnbInserted(void);
void getData(etk::VectorType<int8_t> &deletedText); void getData(etk::Vector<int8_t> &deletedText);
private: private:
int32_t m_pos; int32_t m_pos;
int32_t m_nInserted; int32_t m_nInserted;
etk::VectorType<int8_t> m_deletedText; etk::Vector<int8_t> m_deletedText;
}; };
#endif #endif

View File

@@ -367,4 +367,4 @@ colorInformation_ts * EdnBuf::GetElementColorAtPosition(displayHLData_ts & MData
} }
} }
return GetElementColorAtPosition(pos, MData.posHLPass1); return GetElementColorAtPosition(pos, MData.posHLPass1);
} }

View File

@@ -53,13 +53,13 @@ int32_t EdnBuf::Undo(void)
int32_t pos = m_historyUndo[nbElement]->getPos(); int32_t pos = m_historyUndo[nbElement]->getPos();
int32_t nbDeleted = m_historyUndo[nbElement]->getnbDeleted(); int32_t nbDeleted = m_historyUndo[nbElement]->getnbDeleted();
int32_t nbInserted = m_historyUndo[nbElement]->getnbInserted(); int32_t nbInserted = m_historyUndo[nbElement]->getnbInserted();
etk::VectorType<int8_t> deletedText; etk::Vector<int8_t> deletedText;
m_historyUndo[nbElement]->getData(deletedText); m_historyUndo[nbElement]->getData(deletedText);
m_isUndoProcessing = true; m_isUndoProcessing = true;
if (0 == nbInserted) { if (0 == nbInserted) {
// just add data at position ... // just add data at position ...
if (0 == nbDeleted) { if (0 == nbDeleted) {
APPL_ERROR("EdnBuf::Undo nothing to do in UNDO"); APPL_DEBUG("EdnBuf::Undo nothing to do in UNDO");
} else { } else {
Insert(pos, deletedText); Insert(pos, deletedText);
posDest = pos + nbDeleted; posDest = pos + nbDeleted;
@@ -89,7 +89,7 @@ int32_t EdnBuf::Redo(void)
int32_t posDest = -1; int32_t posDest = -1;
if (0 == nbElement) { if (0 == nbElement) {
// nothing to do ... // nothing to do ...
APPL_ERROR("EdnBuf::Redo No more History"); APPL_DEBUG("EdnBuf::Redo No more History");
return -1; return -1;
} }
nbElement--; nbElement--;
@@ -101,7 +101,7 @@ int32_t EdnBuf::Redo(void)
int32_t pos = m_historyRedo[nbElement]->getPos(); int32_t pos = m_historyRedo[nbElement]->getPos();
int32_t nbDeleted = m_historyRedo[nbElement]->getnbDeleted(); int32_t nbDeleted = m_historyRedo[nbElement]->getnbDeleted();
int32_t nbInserted = m_historyRedo[nbElement]->getnbInserted(); int32_t nbInserted = m_historyRedo[nbElement]->getnbInserted();
etk::VectorType<int8_t> deletedText; etk::Vector<int8_t> deletedText;
m_historyRedo[nbElement]->getData(deletedText); m_historyRedo[nbElement]->getData(deletedText);
m_isRedoProcessing = true; m_isRedoProcessing = true;
if (0 == nbInserted) { if (0 == nbInserted) {

View File

@@ -0,0 +1,310 @@
/**
*******************************************************************************
* @file EdnBuf_Selection.cpp
* @brief Editeur De N'ours : Buffer for internal Data - section selection (Sources)
* @author Edouard DUPIN
* @date 23/03/2011
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <appl/Debug.h>
#include <appl/global.h>
#include <EdnBuf.h>
#undef __class__
#define __class__ "EdnBuf{Selection}"
/**
* @brief
*
* @param[in,out] ---
* @param[in,out] ---
*
* @return ---
*
*/
bool EdnBuf::SelectHasSelection(void)
{
return m_selectionList.selected;
}
/**
* @brief
*
* @param[in,out] ---
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::Select(int32_t start, int32_t end)
{
//selection oldSelection = m_selectionList[select];
m_selectionList.selected = start != end;
m_selectionList.zeroWidth = (start == end) ? true : false;
m_selectionList.rectangular = false;
m_selectionList.start = etk_min(start, end);
m_selectionList.end = etk_max(start, end);
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::Unselect(void)
{
//selection oldSelection = m_selectionList[select];
m_selectionList.selected = false;
m_selectionList.zeroWidth = false;
}
/**
* @brief
*
* @param[in,out] ---
* @param[in,out] ---
* @param[in,out] ---
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::RectSelect(int32_t start, int32_t end, int32_t rectStart, int32_t rectEnd)
{
m_selectionList.selected = rectStart < rectEnd;
m_selectionList.zeroWidth = (rectStart == rectEnd) ? false : true;
m_selectionList.rectangular = true;
m_selectionList.start = start;
m_selectionList.end = end;
m_selectionList.rectStart = rectStart;
m_selectionList.rectEnd = rectEnd;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
bool EdnBuf::GetSelectionPos(int32_t &start, int32_t &end, bool &isRect, int32_t &rectStart, int32_t &rectEnd)
{
/* Always fill in the parameters (zero-width can be requested too). */
isRect = m_selectionList.rectangular;
start = m_selectionList.start;
end = m_selectionList.end;
if (m_selectionList.rectangular) {
rectStart = m_selectionList.rectStart;
rectEnd = m_selectionList.rectEnd;
}
return m_selectionList.selected;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::GetSelectionText(etk::Vector<int8_t> &text)
{
int32_t start, end, rectStart, rectEnd;
bool isRect;
// remove output data
text.Clear();
bool isSelected = GetSelectionPos(start, end, isRect, rectStart, rectEnd);
// No data selected ...
if (false == isSelected) {
return;
}
// Rectangular selection
if (true == isRect) {
//GetTextInRect(start, end, rectStart, rectEnd, text);
// TODO : ...
} else {
GetRange(start, end, text);
}
}
void EdnBuf::GetSelectionText(etk::UString &text)
{
int32_t start, end, rectStart, rectEnd;
bool isRect;
// remove output data
text = "";
bool isSelected = GetSelectionPos(start, end, isRect, rectStart, rectEnd);
// No data selected ...
if (false == isSelected) {
return;
}
// Rectangular selection
if (true == isRect) {
//GetTextInRect(start, end, rectStart, rectEnd, text);
// TODO : ...
} else {
GetRange(start, end, text);
}
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::RemoveSelected(void)
{
int32_t start, end;
int32_t rectStart, rectEnd;
bool isRect;
bool isSelected = GetSelectionPos(start, end, isRect, rectStart, rectEnd);
// No data selected ...
if (false == isSelected) {
return;
}
// Rectangular selection
if (true == isRect) {
//RemoveRect(start, end, rectStart, rectEnd);
// TODO : ...
} else {
Remove(start, end);
}
Unselect();
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
int32_t EdnBuf::ReplaceSelected(etk::Vector<int8_t> &text)
{
int32_t start, end, rectStart, rectEnd;
bool isRect;
bool isSelected = GetSelectionPos(start, end, isRect, rectStart, rectEnd);
// No data selected ...
if (false == isSelected) {
return 0;
}
int32_t returnSize = 0;
// Rectangular selection
if (true == isRect) {
//ReplaceRect(start, end, rectStart, rectEnd, text);
// TODO : ...
} else {
returnSize = Replace(start, end, text);
}
// Clean selection
m_selectionList.selected = false;
return returnSize;
}
int32_t EdnBuf::ReplaceSelected(etk::UString &text)
{
int32_t start, end, rectStart, rectEnd;
bool isRect;
bool isSelected = GetSelectionPos(start, end, isRect, rectStart, rectEnd);
// No data selected ...
if (false == isSelected) {
return 0;
}
int32_t returnSize = 0;
// Rectangular selection
if (true == isRect) {
//ReplaceRect(start, end, rectStart, rectEnd, text);
// TODO : ...
} else {
returnSize = Replace(start, end, text);
}
// Clean selection
m_selectionList.selected = false;
return returnSize;
}
/*
** Update an individual selection for changes in the corresponding text
*/
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::UpdateSelection(int32_t pos, int32_t nDeleted, int32_t nInserted)
{
if( ( false == m_selectionList.selected
&& false == m_selectionList.zeroWidth)
|| pos > m_selectionList.end )
{
return;
}
if (pos+nDeleted <= m_selectionList.start) {
m_selectionList.start += nInserted - nDeleted;
m_selectionList.end += nInserted - nDeleted;
} else if( pos <= m_selectionList.start
&& pos+nDeleted >= m_selectionList.end)
{
m_selectionList.start = pos;
m_selectionList.end = pos;
m_selectionList.selected = false;
m_selectionList.zeroWidth = false;
} else if( pos <= m_selectionList.start
&& pos+nDeleted < m_selectionList.end)
{
m_selectionList.start = pos;
m_selectionList.end = nInserted + m_selectionList.end - nDeleted;
} else if(pos < m_selectionList.end) {
m_selectionList.end += nInserted - nDeleted;
if (m_selectionList.end <= m_selectionList.start) {
m_selectionList.selected = false;
}
}
}

View File

@@ -114,12 +114,12 @@ static int32_t getFileSize(FILE *myFile)
* @return true if OK / false if an error occured * @return true if OK / false if an error occured
* *
*/ */
bool EdnVectorBuf::DumpIn(FILE *myFile) bool EdnVectorBuf::DumpIn(etk::FSNode &file)
{ {
bool ret = true; bool ret = true;
// write Data // write Data
(void)fwrite(m_data, sizeof(int8_t), m_gapStart, myFile); (void)file.FileWrite(m_data, sizeof(int8_t), m_gapStart);
(void)fwrite(&m_data[m_gapEnd], sizeof(int8_t), m_allocated - m_gapEnd, myFile); (void)file.FileWrite(&m_data[m_gapEnd], sizeof(int8_t), m_allocated - m_gapEnd);
return ret; return ret;
} }
@@ -132,19 +132,19 @@ bool EdnVectorBuf::DumpIn(FILE *myFile)
* @return true if OK / false if an error occured * @return true if OK / false if an error occured
* *
*/ */
bool EdnVectorBuf::DumpFrom(FILE *myFile) bool EdnVectorBuf::DumpFrom(etk::FSNode &file)
{ {
bool ret = true; bool ret = true;
int32_t length = getFileSize(myFile); uint32_t length = file.FileSize();
// error case ... // error case ...
if (length < 0) { if (length > 2000000000) {
length = 0; return false;
} }
// allocate the current buffer : // allocate the current buffer :
ChangeAllocation(length + GAP_SIZE_MIN); ChangeAllocation(length + GAP_SIZE_MIN);
// insert Data // insert Data
int32_t nbReadData = fread(&m_data[GAP_SIZE_MIN], sizeof(int8_t), length, myFile); int32_t nbReadData = file.FileRead(&m_data[GAP_SIZE_MIN], sizeof(int8_t), length);
APPL_INFO("load data : filesize=" << length << ", readData=" << nbReadData); APPL_INFO("load data : filesize=" << length << ", readData=" << nbReadData);
// check ERROR // check ERROR
if (nbReadData != length) { if (nbReadData != length) {
@@ -225,7 +225,7 @@ int8_t& EdnVectorBuf::Get(int32_t pos)
* @return --- * @return ---
* *
*/ */
void EdnVectorBuf::Get(int32_t pos, int32_t nbElement, etk::VectorType<int8_t> &tmpBuffer) void EdnVectorBuf::Get(int32_t pos, int32_t nbElement, etk::Vector<int8_t> &tmpBuffer)
{ {
tmpBuffer.Clear(); tmpBuffer.Clear();
if (pos < m_gapStart) { if (pos < m_gapStart) {
@@ -397,7 +397,7 @@ void EdnVectorBuf::Insert(int32_t pos, const int8_t& item)
* @return --- * @return ---
* *
*/ */
void EdnVectorBuf::Insert(int32_t pos, etk::VectorType<int8_t>& items) void EdnVectorBuf::Insert(int32_t pos, etk::Vector<int8_t>& items)
{ {
if( pos > Size() if( pos > Size()
|| pos < 0 ) { || pos < 0 ) {
@@ -453,7 +453,7 @@ void EdnVectorBuf::Replace(int32_t pos, const int8_t& item)
* @return --- * @return ---
* *
*/ */
void EdnVectorBuf::Replace(int32_t pos, int32_t nbRemoveElement, etk::VectorType<int8_t>& items) void EdnVectorBuf::Replace(int32_t pos, int32_t nbRemoveElement, etk::Vector<int8_t>& items)
{ {
if( pos > Size() if( pos > Size()
|| pos < 0 ) { || pos < 0 ) {
@@ -650,7 +650,7 @@ void TestEdnVectorBuf(void)
myBufferTmp.Display(); myBufferTmp.Display();
plop='m'; plop='m';
etk::VectorType<int8_t> items; etk::Vector<int8_t> items;
items.PushBack('i'); items.PushBack('i');
items.PushBack('j'); items.PushBack('j');
items.PushBack('k'); items.PushBack('k');

View File

@@ -26,7 +26,8 @@
#ifndef __EDN_VECTOR_BUF_H__ #ifndef __EDN_VECTOR_BUF_H__
#define __EDN_VECTOR_BUF_H__ #define __EDN_VECTOR_BUF_H__
#include <etk/VectorType.h> #include <etk/Vector.h>
#include <etk/os/FSNode.h>
#undef __class__ #undef __class__
#define __class__ "EdnVectorBuf" #define __class__ "EdnVectorBuf"
@@ -265,20 +266,20 @@ class EdnVectorBuf
EdnVectorBuf(const EdnVectorBuf & Evb); EdnVectorBuf(const EdnVectorBuf & Evb);
~EdnVectorBuf(); ~EdnVectorBuf();
bool DumpIn( FILE *myFile); bool DumpIn( etk::FSNode &file);
bool DumpFrom( FILE *myFile); bool DumpFrom( etk::FSNode &file);
EdnVectorBuf & operator=( const EdnVectorBuf & Evb); EdnVectorBuf & operator=( const EdnVectorBuf & Evb);
int8_t operator[] (int32_t pos); int8_t operator[] (int32_t pos);
int8_t & Get( int32_t pos); int8_t & Get( int32_t pos);
void Get( int32_t pos, int32_t nbElement, etk::VectorType<int8_t> &tmpBuffer); void Get( int32_t pos, int32_t nbElement, etk::Vector<int8_t> &tmpBuffer);
// insert functions // insert functions
void PushBack( const int8_t& item); void PushBack( const int8_t& item);
void Insert( int32_t pos, const int8_t& item); void Insert( int32_t pos, const int8_t& item);
void Insert( int32_t pos, etk::VectorType<int8_t>& items); void Insert( int32_t pos, etk::Vector<int8_t>& items);
// Remove and insert functions // Remove and insert functions
void Replace( int32_t pos, const int8_t& item); void Replace( int32_t pos, const int8_t& item);
void Replace( int32_t pos, int32_t nbRemoveElement, etk::VectorType<int8_t>& items); void Replace( int32_t pos, int32_t nbRemoveElement, etk::Vector<int8_t>& items);
// Revove fonctions // Revove fonctions
void Remove( int32_t pos, int32_t nbRemoveElement = 1); void Remove( int32_t pos, int32_t nbRemoveElement = 1);
void PopBack( void); void PopBack( void);

View File

@@ -35,8 +35,8 @@
Colorize::Colorize( etk::UString &newColorName) Colorize::Colorize( etk::UString &newColorName)
{ {
m_colorFG = etk::color::color_Black; m_colorFG = draw::color::black;
m_colorBG = etk::color::color_Black; m_colorBG = draw::color::black;
italic = false; italic = false;
bold = false; bold = false;
@@ -50,8 +50,8 @@ Colorize::Colorize(void)
{ {
ColorName = "no_name"; ColorName = "no_name";
m_colorFG = etk::color::color_Black; m_colorFG = draw::color::black;
m_colorBG = etk::color::color_Black; m_colorBG = draw::color::black;
italic = false; italic = false;
bold = false; bold = false;
@@ -89,14 +89,14 @@ etk::UString Colorize::GetName(void)
void Colorize::SetFgColor(const char *myColor) void Colorize::SetFgColor(const char *myColor)
{ {
haveFG = true; haveFG = true;
m_colorFG = etk::color::Parse(myColor); m_colorFG = myColor;
APPL_VERBOSE(myColor << " ==> "<< m_colorFG ); APPL_VERBOSE(myColor << " ==> "<< m_colorFG );
} }
void Colorize::SetBgColor(const char *myColor) void Colorize::SetBgColor(const char *myColor)
{ {
haveBG = true; haveBG = true;
m_colorBG = etk::color::Parse(myColor); m_colorBG = myColor;
APPL_VERBOSE(myColor << " ==> "<< m_colorBG ); APPL_VERBOSE(myColor << " ==> "<< m_colorBG );
} }

View File

@@ -40,8 +40,8 @@ class Colorize {
void SetFgColor(const char *myColor); void SetFgColor(const char *myColor);
void SetBgColor(const char *myColor); void SetBgColor(const char *myColor);
color_ts & GetFG(void) { return m_colorFG; }; draw::Color & GetFG(void) { return m_colorFG; };
color_ts & GetBG(void) { return m_colorBG; }; draw::Color & GetBG(void) { return m_colorBG; };
bool HaveBg(void); bool HaveBg(void);
@@ -54,8 +54,8 @@ class Colorize {
private: private:
etk::UString ColorName; //!< curent color Name etk::UString ColorName; //!< curent color Name
color_ts m_colorFG; draw::Color m_colorFG;
color_ts m_colorBG; draw::Color m_colorBG;
bool italic; bool italic;
bool bold; bool bold;

View File

@@ -26,43 +26,18 @@
#include <appl/global.h> #include <appl/global.h>
#include <ColorizeManager.h> #include <ColorizeManager.h>
#include <tinyXML/tinyxml.h> #include <tinyXML/tinyxml.h>
#include <ewol/EObject.h> #include <ewol/eObject/EObject.h>
#include <ewol/EObjectManager.h> #include <ewol/eObject/EObjectManager.h>
#include <etk/os/FSNode.h>
#define PFX "ColorizeManager " #define PFX "ColorizeManager "
//!< EObject name :
extern const char * const TYPE_EOBJECT_EDN_COLORIZE_MANAGER = "ColorizeManager";
class classColorManager: public ewol::EObject class classColorManager: public ewol::EObject
{ {
public: public:
// Constructeur // Constructeur
classColorManager(void); classColorManager(void);
~classColorManager(void); ~classColorManager(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_COLORIZE_MANAGER << "\" != NULL(pointer) ");
return false;
}
if (objectType == TYPE_EOBJECT_EDN_COLORIZE_MANAGER) {
return true;
} else {
if(true == ewol::EObject::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_COLORIZE_MANAGER << "\" != \"" << objectType << "\"");
return false;
}
}
/** /**
* @brief Get the current Object type of the EObject * @brief Get the current Object type of the EObject
@@ -72,7 +47,7 @@ class classColorManager: public ewol::EObject
*/ */
const char * const GetObjectType(void) const char * const GetObjectType(void)
{ {
return TYPE_EOBJECT_EDN_COLORIZE_MANAGER; return "ApplColorManager";
} }
/** /**
* @brief Receive a message from an other EObject with a specific eventId and data * @brief Receive a message from an other EObject with a specific eventId and data
@@ -87,20 +62,18 @@ class classColorManager: public ewol::EObject
void LoadFile(const char * xmlFilename); void LoadFile(const char * xmlFilename);
Colorize * Get(const char *colorName); Colorize * Get(const char *colorName);
Colorize * Get(etk::UString &colorName); Colorize * Get(etk::UString &colorName);
color_ts & Get(basicColor_te myColor); draw::Color& Get(basicColor_te myColor);
bool Exist(etk::UString &colorName); bool Exist(etk::UString &colorName);
bool Exist(const char *colorName); bool Exist(const char *colorName);
void DisplayListOfColor(void); void DisplayListOfColor(void);
private: private:
etk::UString m_fileColor; etk::UString m_fileColor;
etk::VectorType<Colorize*> listMyColor; //!< List of ALL Color etk::Vector<Colorize*> listMyColor; //!< List of ALL Color
Colorize * errorColor; Colorize * errorColor;
color_ts basicColors[COLOR_NUMBER_MAX]; draw::Color basicColors[COLOR_NUMBER_MAX];
}; };
#define EDN_CAST_COLORIZE_MANAGER(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_COLORIZE_MANAGER,classColorManager,curentPointer)
classColorManager::classColorManager(void) classColorManager::classColorManager(void)
{ {
@@ -144,7 +117,7 @@ void classColorManager::OnReceiveMessage(ewol::EObject * CallerObject, const cha
void classColorManager::LoadFile(etk::UString &xmlFilename) void classColorManager::LoadFile(etk::UString &xmlFilename)
{ {
// TODO : Remove this // TODO : Remove this
LoadFile(xmlFilename.Utf8Data()); LoadFile(xmlFilename.c_str());
} }
// TODO : Remove this ... // TODO : Remove this ...
@@ -171,17 +144,17 @@ void classColorManager::LoadFile(const char * xmlFilename)
// allocate the document in the stack // allocate the document in the stack
TiXmlDocument XmlDocument; TiXmlDocument XmlDocument;
// open the curent File // open the curent File
etk::File fileName(xmlFilename, etk::FILE_TYPE_DATA); etk::FSNode fileName(etk::UString("DATA:") + xmlFilename);
if (false == fileName.Exist()) { if (false == fileName.Exist()) {
APPL_ERROR("File Does not exist : " << fileName); APPL_ERROR("File Does not exist : " << fileName);
return; return;
} }
int32_t fileSize = fileName.Size(); int32_t fileSize = fileName.FileSize();
if (0==fileSize) { if (0==fileSize) {
APPL_ERROR("This file is empty : " << fileName); APPL_ERROR("This file is empty : " << fileName);
return; return;
} }
if (false == fileName.fOpenRead()) { if (false == fileName.FileOpenRead()) {
APPL_ERROR("Can not open the file : " << fileName); APPL_ERROR("Can not open the file : " << fileName);
return; return;
} }
@@ -193,9 +166,9 @@ void classColorManager::LoadFile(const char * xmlFilename)
} }
memset(fileBuffer, 0, (fileSize+5)*sizeof(char)); memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
// load data from the file : // load data from the file :
fileName.fRead(fileBuffer, 1, fileSize); fileName.FileRead(fileBuffer, 1, fileSize);
// close the file: // close the file:
fileName.fClose(); fileName.FileClose();
// load the XML from the memory // load the XML from the memory
XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8); XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8);
@@ -253,7 +226,7 @@ void classColorManager::LoadFile(const char * xmlFilename)
} }
const char *color = pGuiNode->ToElement()->Attribute("val"); const char *color = pGuiNode->ToElement()->Attribute("val");
if (NULL != color) { if (NULL != color) {
basicColors[id] = etk::color::Parse(color); basicColors[id] = color;
} }
} else { } else {
APPL_ERROR("(l "<<pGuiNode->Row()<<") node not suported : \""<<pGuiNode->Value()<<"\" must be [color]"); APPL_ERROR("(l "<<pGuiNode->Row()<<") node not suported : \""<<pGuiNode->Value()<<"\" must be [color]");
@@ -341,10 +314,10 @@ Colorize *classColorManager::Get(const char *colorName)
Colorize *classColorManager::Get(etk::UString &colorName) Colorize *classColorManager::Get(etk::UString &colorName)
{ {
// TODO : Remove this // TODO : Remove this
return Get(colorName.Utf8Data()); return Get(colorName.c_str());
} }
color_ts & classColorManager::Get(basicColor_te myColor) draw::Color & classColorManager::Get(basicColor_te myColor)
{ {
if (myColor < COLOR_NUMBER_MAX) { if (myColor < COLOR_NUMBER_MAX) {
return basicColors[myColor]; return basicColors[myColor];
@@ -370,7 +343,7 @@ bool classColorManager::Exist(const char *colorName)
bool classColorManager::Exist(etk::UString &colorName) bool classColorManager::Exist(etk::UString &colorName)
{ {
// TODO : Remove this // TODO : Remove this
return Exist(colorName.Utf8Data()); return Exist(colorName.c_str());
} }
void classColorManager::DisplayListOfColor(void) void classColorManager::DisplayListOfColor(void)
@@ -391,7 +364,7 @@ static classColorManager * localManager = NULL;
void ColorizeManager::Init(void) void ColorizeManager::Init(void)
{ {
if (NULL == localManager) { if (NULL != localManager) {
EWOL_ERROR("ColorizeManager ==> already exist, just unlink the previous ..."); EWOL_ERROR("ColorizeManager ==> already exist, just unlink the previous ...");
localManager = NULL; localManager = NULL;
} }
@@ -408,7 +381,7 @@ void ColorizeManager::UnInit(void)
EWOL_ERROR("ColorizeManager ==> request UnInit, but does not exist ..."); EWOL_ERROR("ColorizeManager ==> request UnInit, but does not exist ...");
return; return;
} }
ewol::EObjectManager::MarkToRemoved(localManager); delete(localManager);
localManager = NULL; localManager = NULL;
} }
@@ -445,9 +418,9 @@ Colorize* ColorizeManager::Get(etk::UString &colorName)
return localManager->Get(colorName); return localManager->Get(colorName);
} }
color_ts errorColor; draw::Color errorColor;
color_ts& ColorizeManager::Get(basicColor_te myColor) draw::Color& ColorizeManager::Get(basicColor_te myColor)
{ {
if (NULL == localManager) { if (NULL == localManager) {
return errorColor; return errorColor;

View File

@@ -28,7 +28,7 @@
#include <Colorize.h> #include <Colorize.h>
#include <appl/globalMsg.h> #include <appl/globalMsg.h>
#include <ewol/Widget.h> #include <ewol/widget/Widget.h>
typedef enum { typedef enum {
// BASIC color for codeViewer // BASIC color for codeViewer
@@ -57,7 +57,7 @@ namespace ColorizeManager
void LoadFile(const char * xmlFilename); void LoadFile(const char * xmlFilename);
Colorize * Get(const char *colorName); Colorize * Get(const char *colorName);
Colorize * Get(etk::UString &colorName); Colorize * Get(etk::UString &colorName);
color_ts & Get(basicColor_te myColor); draw::Color& Get(basicColor_te myColor);
bool Exist(etk::UString &colorName); bool Exist(etk::UString &colorName);
bool Exist(const char *colorName); bool Exist(const char *colorName);
void DisplayListOfColor(void); void DisplayListOfColor(void);

44
Sources/appl/Debug.h Normal file
View File

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

View File

@@ -29,13 +29,35 @@
#include <BufferManager.h> #include <BufferManager.h>
#include <ColorizeManager.h> #include <ColorizeManager.h>
#include <MainWindows.h> #include <MainWindows.h>
#include <ewol/EObject.h> #include <ewol/eObject/EObject.h>
#undef __class__ #undef __class__
#define __class__ "BufferView" #define __class__ "BufferView"
extern const char * const TYPE_EOBJECT_EDN_BUFFER_VIEW = "BufferView";
static void SortElementList(etk::Vector<appl::dataBufferStruct *> &list)
{
etk::Vector<appl::dataBufferStruct *> tmpList = list;
list.Clear();
for(int32_t iii=0; iii<tmpList.Size(); iii++) {
if (NULL != tmpList[iii]) {
int32_t findPos = 0;
for(int32_t jjj=0; jjj<list.Size(); jjj++) {
//EWOL_DEBUG("compare : \""<<*tmpList[iii] << "\" and \"" << *m_listDirectory[jjj] << "\"");
if (list[jjj]!=NULL) {
if (tmpList[iii]->m_bufferName.GetNameFile() > list[jjj]->m_bufferName.GetNameFile()) {
findPos = jjj+1;
}
}
}
//EWOL_DEBUG("position="<<findPos);
list.Insert(findPos, tmpList[iii]);
}
}
}
BufferView::BufferView(void) BufferView::BufferView(void)
{ {
@@ -49,41 +71,18 @@ BufferView::BufferView(void)
BufferView::~BufferView(void) BufferView::~BufferView(void)
{ {
RemoveAllElement();
} }
/** void BufferView::RemoveAllElement(void)
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool BufferView::CheckObjectType(const char * const objectType)
{ {
if (NULL == objectType) { for(int32_t iii=0; iii<m_list.Size(); iii++) {
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_BUFFER_VIEW << "\" != NULL(pointer) "); if (NULL!=m_list[iii]) {
return false; delete(m_list[iii]);
} m_list[iii] = NULL;
if (objectType == TYPE_EOBJECT_EDN_BUFFER_VIEW) {
return true;
} else {
if(true == ewol::List::CheckObjectType(objectType)) {
return true;
} }
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_BUFFER_VIEW << "\" != \"" << objectType << "\"");
return false;
} }
} m_list.Clear();
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const BufferView::GetObjectType(void)
{
return TYPE_EOBJECT_EDN_BUFFER_VIEW;
} }
/** /**
@@ -97,17 +96,42 @@ void BufferView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eve
{ {
ewol::List::OnReceiveMessage(CallerObject, eventId, data); ewol::List::OnReceiveMessage(CallerObject, eventId, data);
if (eventId == ednMsgBufferListChange) { if (eventId == ednMsgBufferListChange) {
MarkToReedraw(); // clean The list
RemoveAllElement();
// Get all the buffer name and properties:
int32_t nbBufferOpen = BufferManager::Size();
for (int32_t iii=0; iii<nbBufferOpen; iii++) {
if (BufferManager::Exist(iii)) {
bool isModify = BufferManager::Get(iii)->IsModify();
etk::FSNode name = BufferManager::Get(iii)->GetFileName();
appl::dataBufferStruct* tmpElement = new appl::dataBufferStruct(name, iii, isModify);
if (NULL != tmpElement) {
m_list.PushBack(tmpElement);
} else {
APPL_ERROR("Allocation error of the tmp buffer list element");
}
}
}
if (true == globals::OrderTheBufferList() ) {
SortElementList(m_list);
}
MarkToRedraw();
}else if (eventId == ednMsgBufferId) { }else if (eventId == ednMsgBufferId) {
m_selectedIdRequested = BufferManager::GetSelected(); m_selectedIdRequested = BufferManager::GetSelected();
MarkToReedraw(); MarkToRedraw();
}else if (eventId == ednMsgBufferState) { }else if (eventId == ednMsgBufferState) {
MarkToReedraw(); // Update list of modify section ...
for (int32_t iii=0; iii<m_list.Size(); iii++) {
if (NULL!=m_list[iii]) {
m_list[iii]->m_isModify = BufferManager::Get(m_list[iii]->m_bufferID)->IsModify();
}
}
MarkToRedraw();
} }
} }
color_ts BufferView::GetBasicBG(void) draw::Color BufferView::GetBasicBG(void)
{ {
return ColorizeManager::Get(COLOR_LIST_BG_1); return ColorizeManager::Get(COLOR_LIST_BG_1);
} }
@@ -117,7 +141,7 @@ uint32_t BufferView::GetNuberOfColomn(void)
return 1; return 1;
} }
bool BufferView::GetTitle(int32_t colomn, etk::UString &myTitle, color_ts &fg, color_ts &bg) bool BufferView::GetTitle(int32_t colomn, etk::UString &myTitle, draw::Color &fg, draw::Color &bg)
{ {
myTitle = "Buffers : "; myTitle = "Buffers : ";
return true; return true;
@@ -125,12 +149,11 @@ bool BufferView::GetTitle(int32_t colomn, etk::UString &myTitle, color_ts &fg, c
uint32_t BufferView::GetNuberOfRaw(void) uint32_t BufferView::GetNuberOfRaw(void)
{ {
return BufferManager::SizeOpen(); return m_list.Size();
} }
bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, color_ts &fg, color_ts &bg) bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg)
{ {
etk::File name;
bool isModify; bool isModify;
basicColor_te selectFG = COLOR_LIST_TEXT_NORMAL; basicColor_te selectFG = COLOR_LIST_TEXT_NORMAL;
basicColor_te selectBG = COLOR_LIST_BG_1; basicColor_te selectBG = COLOR_LIST_BG_1;
@@ -138,28 +161,12 @@ bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToW
if (m_selectedIdRequested != -1) { if (m_selectedIdRequested != -1) {
m_selectedID = -1; m_selectedID = -1;
} }
// transforme the ID in the real value ... if( raw>=0
int32_t realID = BufferManager::WitchBuffer(raw+1); && raw<m_list.Size()
if (BufferManager::Exist(realID)) { && NULL != m_list[raw]) {
isModify = BufferManager::Get(realID)->IsModify(); myTextToWrite = m_list[raw]->m_bufferName.GetNameFile();
name = BufferManager::Get(realID)->GetFileName();
#if 0 if (true == m_list[raw]->m_isModify) {
char *tmpModify = (char*)" ";
if (true == isModify) {
tmpModify = (char*)"M";
}
myTextToWrite = "[";
myTextToWrite += realID;
myTextToWrite += "](";
myTextToWrite += tmpModify;
myTextToWrite += ") ";
#else
myTextToWrite = "";
#endif
myTextToWrite += name.GetShortFilename();
if (true == isModify) {
selectFG = COLOR_LIST_TEXT_MODIFY; selectFG = COLOR_LIST_TEXT_MODIFY;
} else { } else {
selectFG = COLOR_LIST_TEXT_NORMAL; selectFG = COLOR_LIST_TEXT_NORMAL;
@@ -170,7 +177,7 @@ bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToW
selectBG = COLOR_LIST_BG_2; selectBG = COLOR_LIST_BG_2;
} }
// the buffer change of selection ... // the buffer change of selection ...
if (m_selectedIdRequested == realID) { if (m_selectedIdRequested == m_list[raw]->m_bufferID) {
m_selectedID = raw; m_selectedID = raw;
// stop searching // stop searching
m_selectedIdRequested = -1; m_selectedIdRequested = -1;
@@ -186,17 +193,18 @@ bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToW
return true; return true;
} }
bool BufferView::OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y) bool BufferView::OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, float x, float y)
{ {
if (1 == IdInput && typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) { if (1 == IdInput && typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) {
APPL_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw ); APPL_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw );
int32_t selectBuf = BufferManager::WitchBuffer(raw+1); if( raw>=0
if ( 0 <= selectBuf) { && raw<m_list.Size()
&& NULL != m_list[raw]) {
m_selectedID = raw; m_selectedID = raw;
SendMultiCast(ednMsgBufferId, selectBuf); SendMultiCast(ednMsgBufferId, m_list[raw]->m_bufferID);
} }
} }
MarkToReedraw(); MarkToRedraw();
return false; return false;
} }

View File

@@ -31,29 +31,42 @@
#include <appl/globalMsg.h> #include <appl/globalMsg.h>
#include <ewol/widget/List.h> #include <ewol/widget/List.h>
//!< EObject name : namespace appl
extern const char * const TYPE_EOBJECT_EDN_BUFFER_VIEW; {
class dataBufferStruct
{
public:
etk::FSNode m_bufferName;
uint32_t m_bufferID;
bool m_isModify;
dataBufferStruct(etk::FSNode& bufferName, int32_t bufferID, bool isModify) :
m_bufferName(bufferName),
m_bufferID(bufferID),
m_isModify(isModify)
{
};
~dataBufferStruct(void) { };
};
};
class BufferView : public ewol::List class BufferView : public ewol::List
{ {
private:
int32_t m_selectedIdRequested;
int32_t m_selectedID;
etk::Vector<appl::dataBufferStruct*> m_list;
public: public:
// Constructeur // Constructeur
BufferView(void); BufferView(void);
~BufferView(void); ~BufferView(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool CheckObjectType(const char * const objectType);
/** /**
* @brief Get the current Object type of the EObject * @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 * @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 * @param[in] objectType type description
* @return true if the object is compatible, otherwise false * @return true if the object is compatible, otherwise false
*/ */
const char * const GetObjectType(void); const char * const GetObjectType(void) { return "ApplBufferView"; };
/** /**
* @brief Receive a message from an other EObject with a specific eventId and data * @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] CallerObject Pointer on the EObject that information came from
@@ -64,18 +77,15 @@ class BufferView : public ewol::List
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data); virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
protected: protected:
// function call to display the list : // function call to display the list :
virtual color_ts GetBasicBG(void); virtual draw::Color GetBasicBG(void);
virtual uint32_t GetNuberOfColomn(void); virtual uint32_t GetNuberOfColomn(void);
virtual bool GetTitle(int32_t colomn, etk::UString &myTitle, color_ts &fg, color_ts &bg); virtual bool GetTitle(int32_t colomn, etk::UString &myTitle, draw::Color &fg, draw::Color &bg);
virtual uint32_t GetNuberOfRaw(void); virtual uint32_t GetNuberOfRaw(void);
virtual bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, color_ts &fg, color_ts &bg); virtual bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg);
virtual bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y); virtual bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, float x, float y);
private: void RemoveAllElement(void);
int32_t m_selectedIdRequested;
int32_t m_selectedID;
}; };
#define EDN_CAST_BUFFER_VIEW(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_BUFFER_VIEW,BufferView,curentPointer)
#endif #endif

View File

@@ -34,34 +34,26 @@
#include <ewol/ClipBoard.h> #include <ewol/ClipBoard.h>
#include <SearchData.h> #include <SearchData.h>
#include <ewol/WidgetManager.h> #include <ewol/widget/WidgetManager.h>
#include <ewol/EObject.h> #include <ewol/eObject/EObject.h>
#undef __class__ #undef __class__
#define __class__ "CodeView" #define __class__ "CodeView"
void CodeView::Init(void)
extern const char * const TYPE_EOBJECT_EDN_CODE_VIEW = "CodeView";
CodeView::CodeView(void)
{ {
m_label = "CodeView is disable ..."; m_label = "CodeView is disable ...";
m_fontNormal = -1;
m_fontBold = -1;
m_fontItalic = -1;
m_fontBoldItalic = -1;
m_fontSize = 15;
m_bufferID = -1; m_bufferID = -1;
m_buttunOneSelected = false; m_buttunOneSelected = false;
m_lineNumberList.Clear(); m_lineNumberList.Clear();
m_textColorFg = etk::color::color_Black; m_textColorFg = draw::color::black;
m_textColorBg = etk::color::color_Black; m_textColorBg = draw::color::black;
m_textColorBg.alpha = 0.25; m_textColorBg.a = 0x40;
SetCanHaveFocus(true); SetCanHaveFocus(true);
RegisterMultiCast(ednMsgBufferId); RegisterMultiCast(ednMsgBufferId);
RegisterMultiCast(ednMsgGuiCopy); RegisterMultiCast(ednMsgGuiCopy);
@@ -72,6 +64,31 @@ CodeView::CodeView(void)
RegisterMultiCast(ednMsgGuiRm); RegisterMultiCast(ednMsgGuiRm);
RegisterMultiCast(ednMsgGuiSelect); RegisterMultiCast(ednMsgGuiSelect);
RegisterMultiCast(ednMsgGuiChangeCharset); RegisterMultiCast(ednMsgGuiChangeCharset);
RegisterMultiCast(ednMsgGuiFind);
RegisterMultiCast(ednMsgGuiReplace);
RegisterMultiCast(ednMsgGuiGotoLine);
SetLimitScrolling(0.2);
ShortCutAdd("ctrl+w", ednMsgGuiRm, "Line");
ShortCutAdd("ctrl+shift+w", ednMsgGuiRm, "Paragraph");
ShortCutAdd("ctrl+x", ednMsgGuiCut, "STD");
ShortCutAdd("ctrl+c", ednMsgGuiCopy, "STD");
ShortCutAdd("ctrl+v", ednMsgGuiPaste, "STD");
ShortCutAdd("ctrl+a", ednMsgGuiSelect, "ALL");
ShortCutAdd("ctrl+shift+a", ednMsgGuiSelect, "NONE");
}
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
CodeView::CodeView(etk::UString fontName, int32_t fontSize) :
m_OObjectText(fontName, fontSize)
{
Init();
}
#endif
CodeView::CodeView(void)
{
Init();
} }
CodeView::~CodeView(void) CodeView::~CodeView(void)
@@ -87,7 +104,7 @@ CodeView::~CodeView(void)
*/ */
void CodeView::UpdateNumberOfLineReference(int32_t bufferID) void CodeView::UpdateNumberOfLineReference(int32_t bufferID)
{ {
coord2D_ts tmpCoord; etk::Vector2D<float> tmpCoord;
tmpCoord.x = 0; tmpCoord.x = 0;
tmpCoord.y = 0; tmpCoord.y = 0;
if (m_lineNumberList.Size()<=bufferID) { if (m_lineNumberList.Size()<=bufferID) {
@@ -100,41 +117,6 @@ void CodeView::UpdateNumberOfLineReference(int32_t bufferID)
} }
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool CodeView::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
APPL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_CODE_VIEW << "\" != NULL(pointer) ");
return false;
}
if (objectType == TYPE_EOBJECT_EDN_CODE_VIEW) {
return true;
} else {
if(true == ewol::WidgetScrooled::CheckObjectType(objectType)) {
return true;
}
APPL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_CODE_VIEW << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const CodeView::GetObjectType(void)
{
return TYPE_EOBJECT_EDN_CODE_VIEW;
}
bool CodeView::CalculateMinSize(void) bool CodeView::CalculateMinSize(void)
{ {
m_minSize.x = 50; m_minSize.x = 50;
@@ -145,64 +127,77 @@ bool CodeView::CalculateMinSize(void)
void CodeView::CalculateMaxSize(void) void CodeView::CalculateMaxSize(void)
{ {
m_maxSize.x = 2048; m_maxSize.x = 2048;
int32_t letterHeight = ewol::GetHeight(m_fontNormal); #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
int32_t letterHeight = m_OObjectText.GetHeight();
#else
int32_t letterHeight = m_OObjectTextNormal.GetHeight();
#endif
m_maxSize.y = BufferManager::Get(m_bufferID)->GetNumberOfLine() * letterHeight; m_maxSize.y = BufferManager::Get(m_bufferID)->GetNumberOfLine() * letterHeight;
} }
void CodeView::OnDraw(void) void CodeView::OnDraw(ewol::DrawProperty& displayProp)
{ {
m_OObjectsColored[ m_currentDrawId].Draw(); m_OObjectsColored.Draw();
m_OObjectTextNormal[ m_currentDrawId].Draw(); #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
m_OObjectTextBold[ m_currentDrawId].Draw(); m_OObjectText.Draw();
m_OObjectTextItalic[ m_currentDrawId].Draw(); #else
m_OObjectTextBoldItalic[m_currentDrawId].Draw(); m_OObjectTextNormal.Draw();
m_OObjectTextBold.Draw();
m_OObjectTextItalic.Draw();
m_OObjectTextBoldItalic.Draw();
#endif
WidgetScrooled::OnDraw(displayProp);
} }
void CodeView::OnRegenerateDisplay(void) void CodeView::OnRegenerateDisplay(void)
{ {
if (true == NeedRedraw()) { if (true == NeedRedraw()) {
int64_t startTime = GetCurrentTime(); int64_t startTime = ewol::GetTime();
// For the scrooling windows // For the scrooling windows
CalculateMaxSize(); CalculateMaxSize();
// clean internal elements ... #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
m_OObjectTextNormal[ m_currentCreateId].SetFontID(m_fontNormal); m_OObjectText.Clear();
m_OObjectTextBold[ m_currentCreateId].SetFontID(m_fontBold); #else
m_OObjectTextItalic[ m_currentCreateId].SetFontID(m_fontItalic); m_OObjectTextNormal.Clear();
m_OObjectTextBoldItalic[m_currentCreateId].SetFontID(m_fontBoldItalic); m_OObjectTextBold.Clear();
m_OObjectTextItalic.Clear();
m_OObjectTextNormal[ m_currentCreateId].Clear(); m_OObjectTextBoldItalic.Clear();
m_OObjectTextBold[ m_currentCreateId].Clear(); #endif
m_OObjectTextItalic[ m_currentCreateId].Clear(); m_OObjectsColored.Clear();
m_OObjectTextBoldItalic[m_currentCreateId].Clear();
m_OObjectsColored[ m_currentCreateId].Clear();
if(true == BufferManager::Get(m_bufferID)->NeedToUpdateDisplayPosition() ) { if(true == BufferManager::Get(m_bufferID)->NeedToUpdateDisplayPosition() ) {
coord2D_ts borderWidth = BufferManager::Get(m_bufferID)->GetBorderSize(); etk::Vector2D<float> borderWidth = BufferManager::Get(m_bufferID)->GetBorderSize();
bool centerRequested = false; bool centerRequested = false;
coord2D_ts currentPosition = BufferManager::Get(m_bufferID)->GetPosition(m_OObjectTextNormal[m_currentCreateId].GetFontID(), centerRequested); // TODO : set it back ...
etk::Vector2D<float> currentPosition = BufferManager::Get(m_bufferID)->GetPosition(999/*m_OObjectTextNormal.GetFontID()*/, centerRequested);
SetScrollingPositionDynamic(borderWidth, currentPosition, centerRequested); SetScrollingPositionDynamic(borderWidth, currentPosition, centerRequested);
} // else : nothing to do ... } // else : nothing to do ...
// generate the objects : // generate the objects :
BufferManager::Get(m_bufferID)->Display(m_OObjectTextNormal[m_currentCreateId], #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
m_OObjectTextBold[m_currentCreateId], BufferManager::Get(m_bufferID)->Display(m_OObjectText,
m_OObjectTextItalic[m_currentCreateId], m_OObjectsColored,
m_OObjectTextBoldItalic[m_currentCreateId], m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
m_OObjectsColored[m_currentCreateId], #else
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y); BufferManager::Get(m_bufferID)->Display(m_OObjectTextNormal,
m_OObjectTextBold,
m_OObjectTextItalic,
m_OObjectTextBoldItalic,
m_OObjectsColored,
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
#endif
// set the current size of the windows // set the current size of the windows
SetMaxSize(BufferManager::Get(m_bufferID)->GetMaxSize()); SetMaxSize(BufferManager::Get(m_bufferID)->GetMaxSize());
int64_t stopTime = GetCurrentTime(); int64_t stopTime = ewol::GetTime();
APPL_DEBUG("Display Code Generation = " << stopTime - startTime << " micro-s"); APPL_DEBUG("Display Code Generation = " << stopTime - startTime << " micro-s");
// call the herited class... // call the herited class...
WidgetScrooled::OnRegenerateDisplay(); WidgetScrooled::OnRegenerateDisplay();
m_needFlipFlop = true;
} }
} }
@@ -212,7 +207,7 @@ bool CodeView::OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData)
//APPL_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent); //APPL_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent);
if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) { if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) {
BufferManager::Get(m_bufferID)->AddChar(unicodeData); BufferManager::Get(m_bufferID)->AddChar(unicodeData);
MarkToReedraw(); MarkToRedraw();
} }
return true; return true;
} }
@@ -222,29 +217,48 @@ bool CodeView::OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveTy
{ {
if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) { if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) {
BufferManager::Get(m_bufferID)->cursorMove(moveTypeEvent); BufferManager::Get(m_bufferID)->cursorMove(moveTypeEvent);
MarkToReedraw(); MarkToRedraw();
} }
return true; return true;
} }
/**
* @brief Event on a past event ==> this event is asynchronous due to all system does not support direct getting datas
* @note : need to have focus ...
* @param[in] mode Mode of data requested
* @return ---
*/
void CodeView::OnEventClipboard(ewol::clipBoard::clipboardListe_te clipboardID)
{
BufferManager::Get(m_bufferID)->Paste(clipboardID);
MarkToRedraw();
}
/** /**
* @brief Event on an input of this Widget * @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] 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] 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 * @param[in] pos Absolute position of the event
* @return true the event is used * @return true the event is used
* @return false the event is not used * @return false the event is not used
*/ */
bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, coord2D_ts pos) bool CodeView::OnEventInput(ewol::inputType_te type, int32_t IdInput, ewol::eventInputType_te typeEvent, etk::Vector2D<float> pos)
{ {
coord2D_ts relativePos = RelativePosition(pos); etk::Vector2D<float> relativePos = RelativePosition(pos);
// corection for the openGl abstraction
//relativePos.y = m_size.y - relativePos.y;
etk::Vector2D<float> limitedPos = relativePos;
limitedPos.x = etk_avg(1, limitedPos.x, m_size.x-1);
limitedPos.y = etk_avg(1, limitedPos.y, m_size.y-1);
if (m_bufferID < 0) { if (m_bufferID < 0) {
return false; return false;
} }
if (true == WidgetScrooled::OnEventInput(IdInput, typeEvent, pos)) { if (true == WidgetScrooled::OnEventInput(type, IdInput, typeEvent, pos)) {
ewol::widgetManager::FocusKeep(this); ewol::widgetManager::FocusKeep(this);
// nothing to do ... done on upper widet ... // nothing to do ... done on upper widget ...
return true; return true;
} }
if (1 == IdInput) { if (1 == IdInput) {
@@ -252,28 +266,29 @@ bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent,
if (ewol::EVENT_INPUT_TYPE_DOWN == typeEvent) { if (ewol::EVENT_INPUT_TYPE_DOWN == typeEvent) {
m_buttunOneSelected = true; m_buttunOneSelected = true;
ewol::widgetManager::FocusKeep(this); ewol::widgetManager::FocusKeep(this);
BufferManager::Get(m_bufferID)->MouseEvent(m_fontNormal, relativePos.x+m_originScrooled.x, relativePos.y+m_originScrooled.y); // TODO : Set something good
MarkToReedraw(); BufferManager::Get(m_bufferID)->MouseEvent(limitedPos);
MarkToRedraw();
} else if (ewol::EVENT_INPUT_TYPE_UP == typeEvent) { } else if (ewol::EVENT_INPUT_TYPE_UP == typeEvent) {
m_buttunOneSelected = false; m_buttunOneSelected = false;
BufferManager::Get(m_bufferID)->Copy(ewol::clipBoard::CLIPBOARD_SELECTION); BufferManager::Get(m_bufferID)->Copy(ewol::clipBoard::CLIPBOARD_SELECTION);
MarkToReedraw(); MarkToRedraw();
} else } else
#endif #endif
if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) { if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) {
#ifdef __MODE__Touch #ifdef __MODE__Touch
ewol::widgetManager::FocusKeep(this); ewol::widgetManager::FocusKeep(this);
BufferManager::Get(m_bufferID)->MouseEvent(m_fontNormal, relativePos.x+m_originScrooled.x, relativePos.y+m_originScrooled.y); BufferManager::Get(m_bufferID)->MouseEvent(limitedPos);
MarkToReedraw(); MarkToRedraw();
#else #else
// nothing to do ... // nothing to do ...
#endif #endif
} else if (ewol::EVENT_INPUT_TYPE_DOUBLE == typeEvent) { } else if (ewol::EVENT_INPUT_TYPE_DOUBLE == typeEvent) {
BufferManager::Get(m_bufferID)->MouseEventDouble(); BufferManager::Get(m_bufferID)->MouseEventDouble();
MarkToReedraw(); MarkToRedraw();
} else if (ewol::EVENT_INPUT_TYPE_TRIPLE == typeEvent) { } else if (ewol::EVENT_INPUT_TYPE_TRIPLE == typeEvent) {
BufferManager::Get(m_bufferID)->MouseEventTriple(); BufferManager::Get(m_bufferID)->MouseEventTriple();
MarkToReedraw(); MarkToRedraw();
} else if (ewol::EVENT_INPUT_TYPE_MOVE == typeEvent) { } else if (ewol::EVENT_INPUT_TYPE_MOVE == typeEvent) {
if (true == m_buttunOneSelected) { if (true == m_buttunOneSelected) {
int xxx, yyy; int xxx, yyy;
@@ -286,15 +301,16 @@ bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent,
yyy = 0; yyy = 0;
} }
//APPL_INFO("mouse-motion BT1 %d, %d", xxx, yyy); //APPL_INFO("mouse-motion BT1 %d, %d", xxx, yyy);
BufferManager::Get(m_bufferID)->MouseSelectFromCursorTo(m_fontNormal, xxx+m_originScrooled.x, yyy+m_originScrooled.y); // TODO : Set something good
MarkToReedraw(); BufferManager::Get(m_bufferID)->MouseSelectFromCursorTo(limitedPos);
MarkToRedraw();
} }
} }
} else if (2 == IdInput) { } else if (2 == IdInput) {
if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) { if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) {
BufferManager::Get(m_bufferID)->MouseEvent(m_fontNormal, relativePos.x+m_originScrooled.x, relativePos.y+m_originScrooled.y); // TODO : Set something good
BufferManager::Get(m_bufferID)->Paste(ewol::clipBoard::CLIPBOARD_SELECTION); BufferManager::Get(m_bufferID)->MouseEvent(limitedPos);
MarkToReedraw(); ewol::clipBoard::Request(ewol::clipBoard::CLIPBOARD_SELECTION);
ewol::widgetManager::FocusKeep(this); ewol::widgetManager::FocusKeep(this);
} }
} }
@@ -322,7 +338,7 @@ void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * event
m_lineNumberList[m_bufferID] = m_originScrooled; m_lineNumberList[m_bufferID] = m_originScrooled;
} }
int32_t bufferID = 0; int32_t bufferID = 0;
sscanf(data.Utf8Data(), "%d", &bufferID); sscanf(data.c_str(), "%d", &bufferID);
APPL_INFO("Select a new Buffer ... " << bufferID); APPL_INFO("Select a new Buffer ... " << bufferID);
// set the new buffer ID // set the new buffer ID
m_bufferID = bufferID; m_bufferID = bufferID;
@@ -338,7 +354,7 @@ void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * event
} else if (eventId == ednMsgGuiCut) { } else if (eventId == ednMsgGuiCut) {
BufferManager::Get(m_bufferID)->Cut(ewol::clipBoard::CLIPBOARD_STD); BufferManager::Get(m_bufferID)->Cut(ewol::clipBoard::CLIPBOARD_STD);
} else if (eventId == ednMsgGuiPaste) { } else if (eventId == ednMsgGuiPaste) {
BufferManager::Get(m_bufferID)->Paste(ewol::clipBoard::CLIPBOARD_STD); ewol::clipBoard::Request(ewol::clipBoard::CLIPBOARD_STD);
} else if (eventId == ednMsgGuiUndo) { } else if (eventId == ednMsgGuiUndo) {
BufferManager::Get(m_bufferID)->Undo(); BufferManager::Get(m_bufferID)->Undo();
} else if (eventId == ednMsgGuiRedo) { } else if (eventId == ednMsgGuiRedo) {
@@ -374,46 +390,30 @@ void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * event
} else { } else {
APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" ); APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
} }
} else if (eventId == ednMsgGuiFind) {
etk::UString myDataString;
SearchData::GetSearch(myDataString);
if (data == "Next") {
BufferManager::Get(m_bufferID)->Search(myDataString, false, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
} else if (data == "Previous") {
BufferManager::Get(m_bufferID)->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
}
} else if (eventId == ednMsgGuiReplace) {
etk::UString myDataString;
SearchData::GetReplace(myDataString);
if (data == "Normal") {
BufferManager::Get(m_bufferID)->Replace(myDataString);
} else if (data == "All") {
}
} else if (eventId == ednMsgGuiGotoLine) {
int32_t lineID = 0;
sscanf(data.c_str(), "%d", &lineID);
APPL_INFO("Goto line : " << lineID);
BufferManager::Get(m_bufferID)->JumpAtLine(lineID);
} }
/*
switch (id)
{
case APPL_MSG__CURRENT_FIND_PREVIOUS:
{
etk::UString myDataString;
SearchData::GetSearch(myDataString);
BufferManager::Get(m_bufferID)->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
}
break;
case APPL_MSG__CURRENT_FIND_NEXT:
{
etk::UString myDataString;
SearchData::GetSearch(myDataString);
BufferManager::Get(m_bufferID)->Search(myDataString, false, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
}
break;
case APPL_MSG__CURRENT_REPLACE:
{
etk::UString myDataString;
SearchData::GetReplace(myDataString);
BufferManager::Get(m_bufferID)->Replace(myDataString);
}
break;
case APPL_MSG__CURRENT_REPLACE_ALL:
break;
case APPL_MSG__CURRENT_GOTO_LINE:
if (dataID<0) {
dataID = 0;
}
BufferManager::Get(m_bufferID)->JumpAtLine(dataID);
break;
case APPL_MSG__CURRENT_SET_CHARSET:
BufferManager::Get(m_bufferID)->SetCharset((unicode::charset_te)dataID);
break;
}
*/
// Force redraw of the widget // Force redraw of the widget
MarkToReedraw(); MarkToRedraw();
} }
@@ -422,7 +422,7 @@ void CodeView::OnGetFocus(void)
/* /*
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_bufferID); ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_bufferID);
*/ */
ewol::KeyboardShow(ewol::KEYBOARD_MODE_CODE); ewol::KeyboardShow();
APPL_INFO("Focus - In"); APPL_INFO("Focus - In");
} }
@@ -435,38 +435,41 @@ void CodeView::OnLostFocus(void)
void CodeView::SetFontSize(int32_t size) void CodeView::SetFontSize(int32_t size)
{ {
m_fontSize = size; #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
SetScrollingSize(m_fontSize*3.0*1.46); // 1.46 is a magic nmber ... m_OObjectText.SetSize(size);
#else
m_OObjectTextNormal.SetSize(size);
m_OObjectTextBold.SetSize(size);
m_OObjectTextItalic.SetSize(size);
m_OObjectTextBoldItalic.SetSize(size);
#endif
SetScrollingSize(size*3.0*1.46); // 1.46 is a magic nmber ...
} }
void CodeView::SetFontNameNormal(etk::UString fontName) #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
{ void CodeView::SetFontName(etk::UString fontName)
int32_t fontID = ewol::LoadFont(fontName, m_fontSize); {
if (fontID >= 0) { m_OObjectText.SetFont(fontName);
m_fontNormal = fontID;
} }
} #else
void CodeView::SetFontNameNormal(etk::UString fontName)
{
m_OObjectTextNormal.SetFont(fontName);
}
void CodeView::SetFontNameBold(etk::UString fontName)
{
m_OObjectTextBold.SetFont(fontName);
}
void CodeView::SetFontNameItalic(etk::UString fontName)
{
m_OObjectTextItalic.SetFont(fontName);
}
void CodeView::SetFontNameBoldItalic(etk::UString fontName)
{
m_OObjectTextBoldItalic.SetFont(fontName);
}
#endif
void CodeView::SetFontNameBold(etk::UString fontName)
{
int32_t fontID = ewol::LoadFont(fontName, m_fontSize);
if (fontID >= 0) {
m_fontBold = fontID;
}
}
void CodeView::SetFontNameItalic(etk::UString fontName)
{
int32_t fontID = ewol::LoadFont(fontName, m_fontSize);
if (fontID >= 0) {
m_fontItalic = fontID;
}
}
void CodeView::SetFontNameBoldItalic(etk::UString fontName)
{
int32_t fontID = ewol::LoadFont(fontName, m_fontSize);
if (fontID >= 0) {
m_fontBoldItalic = fontID;
}
}

View File

@@ -33,44 +33,43 @@
#include <etk/Types.h> #include <etk/Types.h>
#include <ewol/widget/WidgetScrolled.h> #include <ewol/widget/WidgetScrolled.h>
#include <ewol/ResourceManager.h>
//!< EObject name :
extern const char * const TYPE_EOBJECT_EDN_CODE_VIEW;
class CodeView :public ewol::WidgetScrooled class CodeView :public ewol::WidgetScrooled
{ {
public: public:
CodeView(void); void Init(void);
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
CodeView(etk::UString fontName, int32_t fontSize);
#endif
CodeView(void);
virtual ~CodeView(void); virtual ~CodeView(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool CheckObjectType(const char * const objectType);
/** /**
* @brief Get the current Object type of the EObject * @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 * @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 * @param[in] objectType type description
* @return true if the object is compatible, otherwise false * @return true if the object is compatible, otherwise false
*/ */
const char * const GetObjectType(void); const char * const GetObjectType(void) { return "ApplCodeView"; };
virtual bool CalculateMinSize(void); virtual bool CalculateMinSize(void);
private: private:
etk::UString m_label; etk::UString m_label;
color_ts m_textColorFg; //!< Text color draw::Color m_textColorFg; //!< Text color
color_ts m_textColorBg; //!< Background color draw::Color m_textColorBg; //!< Background color
int32_t m_bufferID; int32_t m_bufferID;
bool m_buttunOneSelected; bool m_buttunOneSelected;
etk::VectorType<coord2D_ts> m_lineNumberList; etk::Vector<etk::Vector2D<float> > m_lineNumberList;
void UpdateNumberOfLineReference(int32_t bufferID); void UpdateNumberOfLineReference(int32_t bufferID);
// drawing elements : // drawing elements :
ewol::OObject2DTextColored m_OObjectTextNormal[NB_BOUBLE_BUFFER]; #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
ewol::OObject2DTextColored m_OObjectTextBold[NB_BOUBLE_BUFFER]; ewol::TEXT_DISPLAY_TYPE m_OObjectText;
ewol::OObject2DTextColored m_OObjectTextItalic[NB_BOUBLE_BUFFER]; #else
ewol::OObject2DTextColored m_OObjectTextBoldItalic[NB_BOUBLE_BUFFER]; ewol::TEXT_DISPLAY_TYPE m_OObjectTextNormal;
ewol::OObject2DColored m_OObjectsColored[NB_BOUBLE_BUFFER]; ewol::TEXT_DISPLAY_TYPE m_OObjectTextBold;
ewol::TEXT_DISPLAY_TYPE m_OObjectTextItalic;
ewol::TEXT_DISPLAY_TYPE m_OObjectTextBoldItalic;
#endif
ewol::OObject2DColored m_OObjectsColored;
public: public:
virtual void OnRegenerateDisplay(void); virtual void OnRegenerateDisplay(void);
@@ -85,37 +84,41 @@ class CodeView :public ewol::WidgetScrooled
public: public:
/** /**
* @brief Event on an input of this Widget * @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] 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] 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 * @param[in] pos Absolute position of the event
* @return true the event is used * @return true the event is used
* @return false the event is not used * @return false the event is not used
*/ */
virtual bool OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, coord2D_ts pos); virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, ewol::eventInputType_te typeEvent, etk::Vector2D<float> pos);
virtual bool OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData); virtual bool OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData);
virtual bool OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveType_te moveTypeEvent); virtual bool OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveType_te moveTypeEvent);
/**
* @brief Event on a past event ==> this event is asynchronous due to all system does not support direct getting datas
* @note : need to have focus ...
* @param[in] mode Mode of data requested
* @return ---
*/
virtual void OnEventClipboard(ewol::clipBoard::clipboardListe_te clipboardID);
virtual void OnGetFocus(void); virtual void OnGetFocus(void);
virtual void OnLostFocus(void); virtual void OnLostFocus(void);
private:
int32_t m_fontSize;
int32_t m_fontNormal;
int32_t m_fontBold;
int32_t m_fontItalic;
int32_t m_fontBoldItalic;
public: public:
void SetFontSize(int32_t size); void SetFontSize(int32_t size);
void SetFontNameNormal(etk::UString fontName); #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
void SetFontNameBold(etk::UString fontName); void SetFontName(etk::UString fontName);
void SetFontNameItalic(etk::UString fontName); #else
void SetFontNameBoldItalic(etk::UString fontName); void SetFontNameNormal(etk::UString fontName);
void SetFontNameBold(etk::UString fontName);
void SetFontNameItalic(etk::UString fontName);
void SetFontNameBoldItalic(etk::UString fontName);
#endif
private: private:
void CalculateMaxSize(void); void CalculateMaxSize(void);
protected: protected:
virtual void OnDraw(void); virtual void OnDraw(ewol::DrawProperty& displayProp);
}; };
#define EDN_CAST_CODE_VIEW(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_CODE_VIEW,CodeView,curentPointer)
#endif #endif

View File

@@ -28,6 +28,7 @@
#include <MainWindows.h> #include <MainWindows.h>
#include <CodeView.h> #include <CodeView.h>
#include <BufferView.h> #include <BufferView.h>
#include <Search.h>
#include <ewol/widget/Button.h> #include <ewol/widget/Button.h>
#include <ewol/widget/CheckBox.h> #include <ewol/widget/CheckBox.h>
@@ -39,20 +40,99 @@
#include <ewol/widget/ContextMenu.h> #include <ewol/widget/ContextMenu.h>
#include <ewol/widget/PopUp.h> #include <ewol/widget/PopUp.h>
#include <ewol/widget/Spacer.h> #include <ewol/widget/Spacer.h>
#include <ewol/widget/Slider.h>
#include <ewol/widget/Menu.h> #include <ewol/widget/Menu.h>
#include <ewol/widgetMeta/FileChooser.h> #include <ewol/widget/meta/FileChooser.h>
#include <ewol/WidgetManager.h> #include <ewol/widget/meta/Parameter.h>
#include <ewol/EObject.h> #include <ewol/widget/WidgetManager.h>
#include <ewol/ResourceManager.h>
#include <ewol/eObject/EObject.h>
#undef __class__
#define __class__ "AboutGui"
#include <ewol/widget/Label.h>
#include <ewol/widget/Spacer.h>
class ParameterAboutGui : public ewol::SizerVert
{
public :
ParameterAboutGui(void)
{
ewol::Spacer* mySpacer = NULL;
mySpacer = new ewol::Spacer();
if (NULL == mySpacer) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
mySpacer->SetExpendX(true);
mySpacer->SetExpendY(true);
SubWidgetAdd(mySpacer);
}
AddElement(" libPng");
AddElement(" ogg-tremor");
AddElement(" portaudio");
AddElement(" libZip");
AddElement(" tinyXml");
AddElement(" freetype");
AddElement(" agg2.4");
AddElement(" etk (BSD)");
AddElement(" ewol is based on");
AddElement(" Website : https://github.com/HeeroYui/ewol");
AddElement(" Licence : BSD like");
AddElement(" Copyright 2010 Edouard DUPIN, all right reserved");
AddElement(" Supported OS : Linux, Windows, Android" );
AddElement(etk::UString(" OpenGl librairy : v") + ewol::GetVersion() );
AddElement("Ewol", true);
AddElement("");
AddElement(" Website : https://github.com/HeeroYui/edn");
AddElement(" Licence : GPL");
AddElement(" Copyright 2010 Edouard DUPIN, all right reserved");
AddElement(etk::UString(" Build Time : ") + etk::UString(BUILD_TIME));
AddElement(" Source Code Editor");
AddElement(etk::UString(" Editeur De N'ours : v") + etk::UString(APPL_VERSION_TAG_NAME));
AddElement("Edn", true);
};
~ParameterAboutGui(void) { };
void AddElement(etk::UString label, bool bold=false, bool italic=false)
{
ewol::Label* myLabel = new ewol::Label(label);
if (NULL == myLabel) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
myLabel->SetExpendX(true);
SubWidgetAdd(myLabel);
}
};
};
const char * l_smoothChick = "tmpEvent_smooth";
const char * l_smoothMin = "tmpEvent_minChange";
const char * l_smoothMax = "tmpEvent_maxChange";
extern float DF_SoftEdge_min;
extern float DF_SoftEdge_max;
extern int32_t DF_SoftEdge;
ewol::Slider* tmpSliderMin = NULL;
ewol::Slider* tmpSliderMax = NULL;
#undef __class__ #undef __class__
#define __class__ "MainWindows" #define __class__ "MainWindows"
extern const char * const TYPE_EOBJECT_EDN_MAIN_WINDOWS = "MainWindows";
MainWindows::MainWindows(void) MainWindows::MainWindows(void)
{ {
APPL_DEBUG("CREATE WINDOWS ... "); APPL_DEBUG("CREATE WINDOWS ... ");
ewol::SizerVert * mySizerVert = NULL; ewol::SizerVert * mySizerVert = NULL;
ewol::SizerVert * mySizerVert2 = NULL;
ewol::SizerHori * mySizerHori = NULL; ewol::SizerHori * mySizerHori = NULL;
//ewol::Button * myButton = NULL; //ewol::Button * myButton = NULL;
CodeView * myCodeView = NULL; CodeView * myCodeView = NULL;
@@ -62,6 +142,69 @@ MainWindows::MainWindows(void)
mySizerVert = new ewol::SizerVert(); mySizerVert = new ewol::SizerVert();
SetSubWidget(mySizerVert); SetSubWidget(mySizerVert);
mySizerHori = new ewol::SizerHori();
mySizerVert->SubWidgetAdd(mySizerHori);
myBufferView = new BufferView();
myBufferView->SetExpendX(false);
myBufferView->SetExpendY(true);
myBufferView->SetFillX(true);
myBufferView->SetFillY(true);
mySizerHori->SubWidgetAdd(myBufferView);
mySizerVert2 = new ewol::SizerVert();
mySizerHori->SubWidgetAdd(mySizerVert2);
// main buffer Area :
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
myCodeView = new CodeView("Font/freefont/FreeMono.ttf", 24);
#else
myCodeView = new CodeView();
#endif
myCodeView->SetExpendX(true);
myCodeView->SetExpendY(true);
myCodeView->SetFillX(true);
myCodeView->SetFillY(true);
#ifndef APPL_BUFFER_FONT_DISTANCE_FIELD
myCodeView->SetFontSize(11);
myCodeView->SetFontNameNormal( "Font/freefont/FreeMono.ttf");
myCodeView->SetFontNameBold( "Font/freefont/FreeMonoBold.ttf");
myCodeView->SetFontNameItalic( "Font/freefont/FreeMonoOblique.ttf");
myCodeView->SetFontNameBoldItalic("Font/freefont/FreeMonoBoldOblique.ttf");
#endif
mySizerVert2->SubWidgetAdd(myCodeView);
// search area :
Search * mySearch = new Search();
mySizerVert2->SubWidgetAdd(mySearch);
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
{
ewol::SizerHori * mySizerHori2 = new ewol::SizerHori();
mySizerVert2->SubWidgetAdd(mySizerHori2);
ewol::CheckBox* tmpCheck = new ewol::CheckBox("smooth");
mySizerHori2->SubWidgetAdd(tmpCheck);
tmpCheck->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_smoothChick);
ewol::Slider* tmpSlider = new ewol::Slider();
mySizerHori2->SubWidgetAdd(tmpSlider);
tmpSlider->RegisterOnEvent(this, ewolEventSliderChange, l_smoothMin);
tmpSlider->SetExpendX(true);
tmpSlider->SetMin(0);
tmpSlider->SetMax(1000);
tmpSlider->SetValue(0450);
tmpSliderMin = tmpSlider;
tmpSlider = new ewol::Slider();
mySizerHori2->SubWidgetAdd(tmpSlider);
tmpSlider->RegisterOnEvent(this, ewolEventSliderChange, l_smoothMax);
tmpSlider->SetExpendX(true);
tmpSlider->SetMin(0);
tmpSlider->SetMax(1000);
tmpSlider->SetValue(0550);
tmpSliderMax = tmpSlider;
}
#endif
mySizerHori = new ewol::SizerHori(); mySizerHori = new ewol::SizerHori();
mySizerVert->SubWidgetAdd(mySizerHori); mySizerVert->SubWidgetAdd(mySizerHori);
@@ -77,6 +220,8 @@ MainWindows::MainWindows(void)
(void)myMenu->Add(idMenuFile, "Save As ...", "", ednMsgGuiSaveAs); (void)myMenu->Add(idMenuFile, "Save As ...", "", ednMsgGuiSaveAs);
(void)myMenu->AddSpacer(); (void)myMenu->AddSpacer();
//(void)myMenu->Add(idMenuFile, "Exit", "", ednMsgGuiExit); //(void)myMenu->Add(idMenuFile, "Exit", "", ednMsgGuiExit);
(void)myMenu->AddSpacer();
(void)myMenu->Add(idMenuFile, "Properties", "icon/Parameter.svg", ednMsgProperties);
int32_t idMenuEdit = myMenu->AddTitle("Edit"); int32_t idMenuEdit = myMenu->AddTitle("Edit");
(void)myMenu->Add(idMenuEdit, "Undo", "icon/Undo.svg", ednMsgGuiUndo); (void)myMenu->Add(idMenuEdit, "Undo", "icon/Undo.svg", ednMsgGuiUndo);
(void)myMenu->Add(idMenuEdit, "Redo", "icon/Redo.svg", ednMsgGuiRedo); (void)myMenu->Add(idMenuEdit, "Redo", "icon/Redo.svg", ednMsgGuiRedo);
@@ -109,48 +254,22 @@ MainWindows::MainWindows(void)
(void)myMenu->AddSpacer(); (void)myMenu->AddSpacer();
(void)myMenu->Add(idMenugDisplay, "Color Black", "", ednMsgGuiChangeColor, "Black"); (void)myMenu->Add(idMenugDisplay, "Color Black", "", ednMsgGuiChangeColor, "Black");
(void)myMenu->Add(idMenugDisplay, "Color White", "", ednMsgGuiChangeColor, "White"); (void)myMenu->Add(idMenugDisplay, "Color White", "", ednMsgGuiChangeColor, "White");
(void)myMenu->AddTitle("?", "", ednMsgGuiAbout); (void)myMenu->AddSpacer();
(void)myMenu->Add(idMenugDisplay, "Reload OpenGl Shader", "", ednMsgGuiReloadShader);
m_widgetLabelFileName = new ewol::Label("FileName"); m_widgetLabelFileName = new ewol::Label("FileName");
m_widgetLabelFileName->SetExpendX(true); m_widgetLabelFileName->SetExpendX(true);
m_widgetLabelFileName->SetFillY(true); m_widgetLabelFileName->SetFillY(true);
mySizerHori->SubWidgetAdd(m_widgetLabelFileName); mySizerHori->SubWidgetAdd(m_widgetLabelFileName);
mySizerHori = new ewol::SizerHori();
mySizerVert->SubWidgetAdd(mySizerHori);
myBufferView = new BufferView();
myBufferView->SetExpendX(false);
myBufferView->SetExpendY(true);
myBufferView->SetFillX(true);
myBufferView->SetFillY(true);
mySizerHori->SubWidgetAdd(myBufferView);
myCodeView = new CodeView();
myCodeView->SetExpendX(true);
myCodeView->SetExpendY(true);
myCodeView->SetFillX(true);
myCodeView->SetFillY(true);
myCodeView->SetFontSize(11);
myCodeView->SetFontNameNormal( "freefont/FreeMono.ttf");
myCodeView->SetFontNameBold( "freefont/FreeMonoBold.ttf");
myCodeView->SetFontNameItalic( "freefont/FreeMonoOblique.ttf");
myCodeView->SetFontNameBoldItalic("freefont/FreeMonoBoldOblique.ttf");
/*
myCodeView->SetFontSize(11);
myCodeView->SetFontNameNormal( "ubuntu/UbuntuMono-R.ttf");
myCodeView->SetFontNameBold( "ubuntu/UbuntuMono-B.ttf");
myCodeView->SetFontNameItalic( "ubuntu/UbuntuMono-RI.ttf");
myCodeView->SetFontNameBoldItalic("ubuntu/UbuntuMono-BI.ttf");
*/
mySizerHori->SubWidgetAdd(myCodeView);
// Generic event ... // Generic event ...
RegisterMultiCast(ednMsgGuiSaveAs); RegisterMultiCast(ednMsgGuiSaveAs);
RegisterMultiCast(ednMsgProperties);
RegisterMultiCast(ednMsgGuiOpen); RegisterMultiCast(ednMsgGuiOpen);
RegisterMultiCast(ednMsgGuiAbout);
// to update the title ... // to update the title ...
RegisterMultiCast(ednMsgBufferState); RegisterMultiCast(ednMsgBufferState);
RegisterMultiCast(ednMsgBufferId); RegisterMultiCast(ednMsgBufferId);
RegisterMultiCast(ednMsgGuiReloadShader);
} }
@@ -159,40 +278,6 @@ MainWindows::~MainWindows(void)
} }
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool MainWindows::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
APPL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_MAIN_WINDOWS << "\" != NULL(pointer) ");
return false;
}
if (objectType == TYPE_EOBJECT_EDN_MAIN_WINDOWS) {
return true;
} else {
if(true == ewol::Windows::CheckObjectType(objectType)) {
return true;
}
APPL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_MAIN_WINDOWS << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const MainWindows::GetObjectType(void)
{
return TYPE_EOBJECT_EDN_MAIN_WINDOWS;
}
const char *const ednEventPopUpFileSelected = "edn-mainWindows-openSelected"; const char *const ednEventPopUpFileSelected = "edn-mainWindows-openSelected";
const char *const ednEventPopUpFileSaveAs = "edn-mainWindows-saveAsSelected"; const char *const ednEventPopUpFileSaveAs = "edn-mainWindows-saveAsSelected";
@@ -208,33 +293,24 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
{ {
ewol::Windows::OnReceiveMessage(CallerObject, eventId, data); ewol::Windows::OnReceiveMessage(CallerObject, eventId, data);
//APPL_INFO("Receive Event from the main windows ... : widgetid=" << CallerObject << "\"" << eventId << "\" ==> data=\"" << data << "\"" ); //APPL_INFO("Receive Event from the main windows ... : \"" << eventId << "\" ==> data=\"" << data << "\"" );
// Open file Section ... // Open file Section ...
if (eventId == ednMsgGuiOpen) { if (eventId == ednMsgGuiOpen) {
ewol::FileChooser* tmpWidget = new ewol::FileChooser(); ewol::FileChooser* tmpWidget = new ewol::FileChooser();
tmpWidget->SetTitle("Open Files ..."); tmpWidget->SetTitle("Open Files ...");
tmpWidget->SetValidateLabel("Open"); tmpWidget->SetValidateLabel("Open");
Buffer * myBuffer = BufferManager::Get(BufferManager::GetSelected()); if (BufferManager::GetSelected()!=-1) {
if (NULL!=myBuffer) { Buffer * myBuffer = BufferManager::Get(BufferManager::GetSelected());
etk::File tmpFile = myBuffer->GetFileName(); if (NULL!=myBuffer) {
tmpWidget->SetFolder(tmpFile.GetFolder()); etk::FSNode tmpFile = myBuffer->GetFileName();
} else { tmpWidget->SetFolder(tmpFile.GetNameFolder());
// nothing to do : just open the basic folder }
} }
//tmpWidget->SetFolder("/");
PopUpWidgetPush(tmpWidget); PopUpWidgetPush(tmpWidget);
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected); tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected);
} else if (eventId == ednEventPopUpFileSelected) { } else if (eventId == ednEventPopUpFileSelected) {
// get widget: APPL_DEBUG("Request opening the file : " << data);
ewol::FileChooser * tmpWidget = EWOL_CAST_WIDGET_FILE_CHOOSER(CallerObject); SendMultiCast(ednMsgOpenFile, data);
if (NULL == tmpWidget) {
APPL_ERROR("impossible to get pop_upWidget " << CallerObject);
return;
}
// get the filename :
etk::UString tmpData = tmpWidget->GetCompleateFileName();
APPL_DEBUG("Request opening the file : " << tmpData);
SendMultiCast(ednMsgOpenFile, tmpData);
} else if (eventId == ednMsgGuiSaveAs) { } else if (eventId == ednMsgGuiSaveAs) {
if (data == "") { if (data == "") {
APPL_ERROR("Null data for Save As file ... "); APPL_ERROR("Null data for Save As file ... ");
@@ -243,7 +319,7 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
if (data == "current") { if (data == "current") {
m_currentSavingAsIdBuffer = BufferManager::GetSelected(); m_currentSavingAsIdBuffer = BufferManager::GetSelected();
} else { } else {
sscanf(data.Utf8Data(), "%d", &m_currentSavingAsIdBuffer); sscanf(data.c_str(), "%d", &m_currentSavingAsIdBuffer);
} }
if (false == BufferManager::Exist(m_currentSavingAsIdBuffer)) { if (false == BufferManager::Exist(m_currentSavingAsIdBuffer)) {
@@ -251,30 +327,28 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
} else { } else {
Buffer * myBuffer = BufferManager::Get(m_currentSavingAsIdBuffer); Buffer * myBuffer = BufferManager::Get(m_currentSavingAsIdBuffer);
ewol::FileChooser* tmpWidget = new ewol::FileChooser(); ewol::FileChooser* tmpWidget = new ewol::FileChooser();
tmpWidget->SetTitle("Save Files As..."); if (NULL == tmpWidget) {
tmpWidget->SetValidateLabel("Save"); APPL_ERROR("Can not allocate widget ==> display might be in error");
etk::UString folder = "/home/"; } else {
etk::UString fileName = ""; tmpWidget->SetTitle("Save Files As...");
if (true == myBuffer->HaveName()) { tmpWidget->SetValidateLabel("Save");
etk::File tmpName = myBuffer->GetFileName(); etk::UString folder = "/home/";
folder = tmpName.GetFolder(); etk::UString fileName = "";
fileName = tmpName.GetShortFilename(); if (true == myBuffer->HaveName()) {
etk::FSNode tmpName = myBuffer->GetFileName();
folder = tmpName.GetNameFolder();
fileName = tmpName.GetNameFile();
}
tmpWidget->SetFolder(folder);
tmpWidget->SetFileName(fileName);
PopUpWidgetPush(tmpWidget);
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSaveAs);
} }
tmpWidget->SetFolder(folder);
tmpWidget->SetFileName(fileName);
PopUpWidgetPush(tmpWidget);
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSaveAs);
} }
} }
} else if (eventId == ednEventPopUpFileSaveAs) { } else if (eventId == ednEventPopUpFileSaveAs) {
// get widget:
ewol::FileChooser * tmpWidget = EWOL_CAST_WIDGET_FILE_CHOOSER(CallerObject);
if (NULL == tmpWidget) {
APPL_ERROR("impossible to get pop_upWidget " << CallerObject);
return;
}
// get the filename : // get the filename :
etk::UString tmpData = tmpWidget->GetCompleateFileName(); etk::UString tmpData = data;
APPL_DEBUG("Request Saving As file : " << tmpData); APPL_DEBUG("Request Saving As file : " << tmpData);
BufferManager::Get(m_currentSavingAsIdBuffer)->SetFileName(tmpData); BufferManager::Get(m_currentSavingAsIdBuffer)->SetFileName(tmpData);
@@ -284,9 +358,9 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
// the buffer change we need to update the widget string // the buffer change we need to update the widget string
Buffer* tmpBuffer = BufferManager::Get(BufferManager::GetSelected()); Buffer* tmpBuffer = BufferManager::Get(BufferManager::GetSelected());
if (NULL != tmpBuffer) { if (NULL != tmpBuffer) {
etk::File compleateName = tmpBuffer->GetFileName(); etk::FSNode compleateName = tmpBuffer->GetFileName();
bool isModify = tmpBuffer->IsModify(); bool isModify = tmpBuffer->IsModify();
etk::UString directName = compleateName.GetCompleateName(); etk::UString directName = compleateName.GetName();
if (true == isModify) { if (true == isModify) {
directName += " *"; directName += " *";
} }
@@ -304,38 +378,65 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
} }
return; return;
// TODO : Set the Title .... // TODO : Set the Title ....
} else if (eventId == ednMsgGuiAbout) { } else if (eventId == ednMsgProperties) {
/* // Request the parameter GUI
//Title ewol::Parameter* tmpWidget = new ewol::Parameter();
"Edn" if (NULL == tmpWidget) {
// version APPL_ERROR("Can not allocate widget ==> display might be in error");
VERSION_TAG_NAME } else {
// comments: tmpWidget->SetTitle("Properties");
"Editeur De N'ours\n" PopUpWidgetPush(tmpWidget);
"L'Editeur Desoxyribo-Nucleique.\n" tmpWidget->MenuAddGroup("Editor");
"Source Code Editor\n" ewol::Widget* tmpSubWidget = new globals::ParameterGlobalsGui();
"Build Time : " VERSION_BUILD_TIME; tmpWidget->MenuAdd("Editor", "", tmpSubWidget);
// copyright tmpWidget->MenuAdd("Polices & Color", "", NULL);
"Copyright 2010 Edouard DUPIN, all right reserved"; tmpWidget->MenuAdd("Highlight", "", NULL);
// licence tmpWidget->MenuAddGroup("Genral");
"This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY\n\n" tmpWidget->MenuAdd("Affichage", "", NULL);
"You can:\n" tmpSubWidget = new ParameterAboutGui();
" * Redistribute the sources code and binaries.\n" tmpWidget->MenuAdd("About", "", tmpSubWidget);
" * Modify the Sources code.\n" }
" * Use a part of the sources (less than 50%) in an other software, just write somewhere \"Edn is great\" visible by the user (on your product or on your website with a link to my page).\n" } else if (eventId == l_smoothChick) {
" * Redistribute the modification only if you want.\n" if (data == "true") {
" * Send me the bug-fix (it could be great).\n" DF_SoftEdge = 1;
" * Pay me a beer or some other things.\n" } else {
" * Print the source code on WC paper ...\n\n" DF_SoftEdge = 0;
"You can NOT:\n" }
" * Earn money with this Software (But I can).\n" } else if (eventId == l_smoothMin) {
" * Add malware in the Sources.\n" int32_t newVal = 0;
" * Do something bad with the sources.\n" sscanf(data.c_str(), "%d", &newVal);
" * Use it to travel in the space with a toaster.\n\n" DF_SoftEdge_min = (float)newVal / 1000.0;
"I reserve the right to change this licence. If it change the version of the copy you have keep its own license." if (DF_SoftEdge_min>DF_SoftEdge_max) {
*/ DF_SoftEdge_max = DF_SoftEdge_min;
tmpSliderMax->SetValue(DF_SoftEdge_max*1000.0);
}
} else if (eventId == l_smoothMax) {
int32_t newVal = 0;
sscanf(data.c_str(), "%d", &newVal);
DF_SoftEdge_max = (float)newVal / 1000.0;
if (DF_SoftEdge_min>DF_SoftEdge_max) {
DF_SoftEdge_min = DF_SoftEdge_max;
tmpSliderMin->SetValue(DF_SoftEdge_min*1000.0);
}
} else if (eventId == ednMsgGuiReloadShader) {
ewol::resource::ReLoadResources();
ewol::ForceRedrawAll();
} }
return; return;
} }
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
void MainWindows::OnObjectRemove(ewol::EObject * removeObject)
{
ewol::Windows::OnObjectRemove(removeObject);
if (m_widgetLabelFileName == removeObject) {
m_widgetLabelFileName = NULL;
}
}

View File

@@ -33,8 +33,6 @@
#include <BufferManager.h> #include <BufferManager.h>
#include <ewol/widget/Label.h> #include <ewol/widget/Label.h>
extern const char * const TYPE_EOBJECT_EDN_MAIN_WINDOWS;
class MainWindows : public ewol::Windows class MainWindows : public ewol::Windows
{ {
private: private:
@@ -44,20 +42,13 @@ class MainWindows : public ewol::Windows
// Constructeur // Constructeur
MainWindows(void); MainWindows(void);
~MainWindows(void); ~MainWindows(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool CheckObjectType(const char * const objectType);
/** /**
* @brief Get the current Object type of the EObject * @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 * @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 * @param[in] objectType type description
* @return true if the object is compatible, otherwise false * @return true if the object is compatible, otherwise false
*/ */
const char * const GetObjectType(void); const char * const GetObjectType(void) { return "MainWindows"; };
/** /**
* @brief Receive a message from an other EObject with a specific eventId and data * @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] CallerObject Pointer on the EObject that information came from
@@ -66,6 +57,13 @@ class MainWindows : public ewol::Windows
* @return --- * @return ---
*/ */
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data); virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
virtual void OnObjectRemove(ewol::EObject * removeObject);
}; };
#define EDN_CAST_MAIN_WINDOWS(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_MAIN_WINDOWS,MainWindows,curentPointer) #define EDN_CAST_MAIN_WINDOWS(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_MAIN_WINDOWS,MainWindows,curentPointer)

253
Sources/appl/Gui/Search.cpp Normal file
View File

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

69
Sources/appl/Gui/Search.h Normal file
View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -33,7 +33,7 @@
#define __class__ "Highlight" #define __class__ "Highlight"
void Highlight::ParseRules(TiXmlNode *child, etk::VectorType<HighlightPattern*> &mListPatern, int32_t level) void Highlight::ParseRules(TiXmlNode *child, etk::Vector<HighlightPattern*> &mListPatern, int32_t level)
{ {
// Create the patern ... // Create the patern ...
HighlightPattern *myPattern = new HighlightPattern(); HighlightPattern *myPattern = new HighlightPattern();
@@ -49,17 +49,17 @@ Highlight::Highlight(etk::UString &xmlFilename)
{ {
TiXmlDocument XmlDocument; TiXmlDocument XmlDocument;
etk::File fileName(xmlFilename, etk::FILE_TYPE_DATA); etk::FSNode fileName(etk::UString("DATA:") + xmlFilename);
if (false == fileName.Exist()) { if (false == fileName.Exist()) {
APPL_ERROR("File Does not exist : " << fileName); APPL_ERROR("File Does not exist : " << fileName);
return; return;
} }
int32_t fileSize = fileName.Size(); int32_t fileSize = fileName.FileSize();
if (0==fileSize) { if (0==fileSize) {
APPL_ERROR("This file is empty : " << fileName); APPL_ERROR("This file is empty : " << fileName);
return; return;
} }
if (false == fileName.fOpenRead()) { if (false == fileName.FileOpenRead()) {
APPL_ERROR("Can not open the file : " << fileName); APPL_ERROR("Can not open the file : " << fileName);
return; return;
} }
@@ -71,9 +71,9 @@ Highlight::Highlight(etk::UString &xmlFilename)
} }
memset(fileBuffer, 0, (fileSize+5)*sizeof(char)); memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
// load data from the file : // load data from the file :
fileName.fRead(fileBuffer, 1, fileSize); fileName.FileRead(fileBuffer, 1, fileSize);
// close the file: // close the file:
fileName.fClose(); fileName.FileClose();
// load the XML from the memory // load the XML from the memory
bool loadError = XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8); bool loadError = XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8);
if (false == loadError) { if (false == loadError) {
@@ -191,15 +191,15 @@ bool Highlight::HasExtention(etk::UString &ext)
return false; return false;
} }
bool Highlight::FileNameCompatible(etk::File &fileName) bool Highlight::FileNameCompatible(etk::FSNode &fileName)
{ {
int32_t i; int32_t i;
etk::UString extention; etk::UString extention;
if (true == fileName.HasExtention() ) { if (true == fileName.FileHasExtention() ) {
extention = "*."; extention = "*.";
extention += fileName.GetExtention(); extention += fileName.FileGetExtention();
} else { } else {
extention = fileName.GetShortFilename(); extention = fileName.GetNameFile();
} }
APPL_DEBUG(" try to find : in \"" << fileName << "\" extention:\"" << extention << "\" "); APPL_DEBUG(" try to find : in \"" << fileName << "\" extention:\"" << extention << "\" ");
@@ -236,7 +236,7 @@ void Highlight::Display(void)
// TODO : Celui qui appelle suprime des element pour rien ... Enfin c'est pas trègrave... Il suffirait juste de suprimer celuis d'avant si il n'est pas terminer... // TODO : Celui qui appelle suprime des element pour rien ... Enfin c'est pas trègrave... Il suffirait juste de suprimer celuis d'avant si il n'est pas terminer...
void Highlight::Parse(int32_t start, void Highlight::Parse(int32_t start,
int32_t stop, int32_t stop,
etk::VectorType<colorInformation_ts> &metaData, etk::Vector<colorInformation_ts> &metaData,
int32_t addingPos, int32_t addingPos,
EdnVectorBuf &buffer) EdnVectorBuf &buffer)
{ {
@@ -300,7 +300,7 @@ void Highlight::Parse(int32_t start,
*/ */
void Highlight::Parse2(int32_t start, void Highlight::Parse2(int32_t start,
int32_t stop, int32_t stop,
etk::VectorType<colorInformation_ts> &metaData, etk::Vector<colorInformation_ts> &metaData,
EdnVectorBuf &buffer) EdnVectorBuf &buffer)
{ {
//APPL_DEBUG("Parse element 0 => " << m_listHighlightPass2.size() << " ==> position search: (" << start << "," << stop << ")" ); //APPL_DEBUG("Parse element 0 => " << m_listHighlightPass2.size() << " ==> position search: (" << start << "," << stop << ")" );

View File

@@ -42,7 +42,7 @@ extern "C" {
} colorInformation_ts; } colorInformation_ts;
} }
#include <etk/File.h> #include <etk/os/FSNode.h>
#include <HighlightPattern.h> #include <HighlightPattern.h>
#include <Colorize.h> #include <Colorize.h>
#include <EdnVectorBuf.h> #include <EdnVectorBuf.h>
@@ -54,24 +54,24 @@ class Highlight {
Highlight(etk::UString &xmlFilename); Highlight(etk::UString &xmlFilename);
~Highlight(void); ~Highlight(void);
bool HasExtention(etk::UString &ext); bool HasExtention(etk::UString &ext);
bool FileNameCompatible(etk::File &fileName); bool FileNameCompatible(etk::FSNode &fileName);
void Display(void); void Display(void);
void ReloadColor(void); void ReloadColor(void);
void Parse(int32_t start, void Parse(int32_t start,
int32_t stop, int32_t stop,
etk::VectorType<colorInformation_ts> &metaData, etk::Vector<colorInformation_ts> &metaData,
int32_t addingPos, int32_t addingPos,
EdnVectorBuf &buffer); EdnVectorBuf &buffer);
void Parse2(int32_t start, void Parse2(int32_t start,
int32_t stop, int32_t stop,
etk::VectorType<colorInformation_ts> &metaData, etk::Vector<colorInformation_ts> &metaData,
EdnVectorBuf &buffer); EdnVectorBuf &buffer);
private: private:
void ParseRules(TiXmlNode *child, etk::VectorType<HighlightPattern*> &mListPatern, int32_t level); void ParseRules(TiXmlNode *child, etk::Vector<HighlightPattern*> &mListPatern, int32_t level);
etk::UString m_styleName; //!< curent style name (like "c++" or "c" or "script Bash") etk::UString m_styleName; //!< curent style name (like "c++" or "c" or "script Bash")
etk::VectorType<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::VectorType<HighlightPattern*> m_listHighlightPass1; //!< List of ALL hightlight modules (pass 1 ==> when we load and wride data on the buffer) etk::Vector<HighlightPattern*> m_listHighlightPass1; //!< List of ALL hightlight modules (pass 1 ==> when we load and wride data on the buffer)
etk::VectorType<HighlightPattern*> m_listHighlightPass2; //!< List of ALL hightlight modules (pass 2 ==> When we display the buffer( only the display area (100 lines)) ) etk::Vector<HighlightPattern*> m_listHighlightPass2; //!< List of ALL hightlight modules (pass 2 ==> When we display the buffer( only the display area (100 lines)) )
}; };

View File

@@ -26,20 +26,16 @@
#include <appl/Debug.h> #include <appl/Debug.h>
#include <appl/global.h> #include <appl/global.h>
#include <HighlightManager.h> #include <HighlightManager.h>
#include <ewol/EObject.h> #include <ewol/eObject/EObject.h>
#include <ewol/EObjectManager.h> #include <ewol/eObject/EObjectManager.h>
#undef __class__ #undef __class__
#define __class__ "HighlightManager" #define __class__ "HighlightManager"
//!< EObject name :
extern const char * const TYPE_EOBJECT_EDN_HIGHLIGHT_MANAGER = "HighlightManager";
class localClassHighlightManager: public ewol::EObject class localClassHighlightManager: public ewol::EObject
{ {
private: private:
etk::VectorType<Highlight*> listHighlight; //!< List of ALL hightlight modules etk::Vector<Highlight*> listHighlight; //!< List of ALL hightlight modules
public: public:
// Constructeur // Constructeur
localClassHighlightManager(void) { localClassHighlightManager(void) {
@@ -58,29 +54,6 @@ class localClassHighlightManager: public ewol::EObject
listHighlight.Clear(); listHighlight.Clear();
}; };
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
APPL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_HIGHLIGHT_MANAGER << "\" != NULL(pointer) ");
return false;
}
if (objectType == TYPE_EOBJECT_EDN_HIGHLIGHT_MANAGER) {
return true;
} else {
if(true == ewol::EObject::CheckObjectType(objectType)) {
return true;
}
APPL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_HIGHLIGHT_MANAGER << "\" != \"" << objectType << "\"");
return false;
}
}
/** /**
* @brief Get the current Object type of the EObject * @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 * @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
@@ -89,7 +62,7 @@ class localClassHighlightManager: public ewol::EObject
*/ */
const char * const GetObjectType(void) const char * const GetObjectType(void)
{ {
return TYPE_EOBJECT_EDN_HIGHLIGHT_MANAGER; return "ApplHighlightManager";
} }
/** /**
@@ -116,7 +89,7 @@ class localClassHighlightManager: public ewol::EObject
*/ */
} }
Highlight* Get(etk::File &fileName) Highlight* Get(etk::FSNode &fileName)
{ {
int32_t i; int32_t i;
for (i=0; i<listHighlight.Size(); i++) { for (i=0; i<listHighlight.Size(); i++) {
@@ -127,7 +100,7 @@ class localClassHighlightManager: public ewol::EObject
return NULL; return NULL;
} }
bool Exist(etk::File &fileName) bool Exist(etk::FSNode &fileName)
{ {
if (NULL != Get(fileName) ) { if (NULL != Get(fileName) ) {
return true; return true;
@@ -174,6 +147,18 @@ class localClassHighlightManager: public ewol::EObject
myHightline = new Highlight(xmlFilename); myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline); listHighlight.PushBack(myHightline);
xmlFilename = "lang_lua.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = "lang_in.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = "lang_glsl.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
//myHightline->Display(); //myHightline->Display();
} }
@@ -187,7 +172,7 @@ static localClassHighlightManager * localManager = NULL;
void HighlightManager::Init(void) void HighlightManager::Init(void)
{ {
if (NULL == localManager) { if (NULL != localManager) {
APPL_ERROR("HighlightManager ==> already exist, just unlink the previous ..."); APPL_ERROR("HighlightManager ==> already exist, just unlink the previous ...");
localManager = NULL; localManager = NULL;
} }
@@ -204,7 +189,7 @@ void HighlightManager::UnInit(void)
APPL_ERROR("HighlightManager ==> request UnInit, but does not exist ..."); APPL_ERROR("HighlightManager ==> request UnInit, but does not exist ...");
return; return;
} }
ewol::EObjectManager::MarkToRemoved(localManager); delete(localManager);
localManager = NULL; localManager = NULL;
} }
@@ -216,7 +201,7 @@ void HighlightManager::loadLanguages(void)
localManager->loadLanguages(); localManager->loadLanguages();
} }
Highlight* HighlightManager::Get(etk::File &fileName) Highlight* HighlightManager::Get(etk::FSNode &fileName)
{ {
if (NULL == localManager) { if (NULL == localManager) {
return NULL; return NULL;
@@ -224,7 +209,7 @@ Highlight* HighlightManager::Get(etk::File &fileName)
return localManager->Get(fileName); return localManager->Get(fileName);
} }
bool HighlightManager::Exist(etk::File &fileName) bool HighlightManager::Exist(etk::FSNode &fileName)
{ {
if (NULL == localManager) { if (NULL == localManager) {
return false; return false;

View File

@@ -30,14 +30,14 @@
#include <etk/UString.h> #include <etk/UString.h>
#include <appl/globalMsg.h> #include <appl/globalMsg.h>
#include <Highlight.h> #include <Highlight.h>
#include <ewol/Widget.h> #include <ewol/widget/Widget.h>
namespace HighlightManager{ namespace HighlightManager{
void Init(void); void Init(void);
void UnInit(void); void UnInit(void);
void loadLanguages(void); void loadLanguages(void);
Highlight* Get(etk::File &fileName); Highlight* Get(etk::FSNode &fileName);
bool Exist(etk::File &fileName); bool Exist(etk::FSNode &fileName);
}; };

View File

@@ -33,7 +33,7 @@ class HighlightPattern;
#include <etk/RegExp.h> #include <etk/RegExp.h>
#include <Colorize.h> #include <Colorize.h>
#include <etk/VectorType.h> #include <etk/Vector.h>
#include <tinyXML/tinyxml.h> #include <tinyXML/tinyxml.h>
#include <EdnVectorBuf.h> #include <EdnVectorBuf.h>
@@ -81,8 +81,8 @@ class HighlightPattern {
bool m_haveStopPatern; //!< Stop patern presence bool m_haveStopPatern; //!< Stop patern presence
bool m_multiline; //!< The patern is multiline bool m_multiline; //!< The patern is multiline
uniChar_t m_escapeChar; //!< Escape char to prevent exeit of patern .... uniChar_t m_escapeChar; //!< Escape char to prevent exeit of patern ....
etk::VectorType<HighlightPattern *> m_subPatern; //!< Under patern of this one etk::Vector<HighlightPattern *> m_subPatern; //!< Under patern of this one
// etk::VectorType<HighlightPattern *> m_subColor; //!< Under Color in the start RegExp ... // etk::Vector<HighlightPattern *> m_subColor; //!< Under Color in the start RegExp ...
}; };
#endif #endif

View File

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

View File

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

245
Sources/appl/global.cpp Normal file
View File

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

View File

@@ -28,6 +28,7 @@
#include <appl/Debug.h> #include <appl/Debug.h>
#include <etk/Types.h> #include <etk/Types.h>
#include <ewol/widget/SizerVert.h>
namespace globals namespace globals
@@ -42,10 +43,30 @@ namespace globals
bool IsSetDisplaySpaceChar(void); bool IsSetDisplaySpaceChar(void);
void SetDisplaySpaceChar(bool newVal); void SetDisplaySpaceChar(bool newVal);
bool IsSetDisplayTabChar(void);
void SetDisplayTabChar(bool newVal);
bool IsSetAutoIndent(void); bool IsSetAutoIndent(void);
void SetAutoIndent(bool newVal); void SetAutoIndent(bool newVal);
void init2(void); void init2(void);
bool OrderTheBufferList(void);
class ParameterGlobalsGui : public ewol::SizerVert
{
public :
ParameterGlobalsGui(void);
~ParameterGlobalsGui(void);
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
};
} }

View File

@@ -34,6 +34,7 @@ extern const char* const ednMsgGuiOpen = "edn-Msg-Gui-Open";
extern const char* const ednMsgGuiClose = "edn-Msg-Gui-Close"; extern const char* const ednMsgGuiClose = "edn-Msg-Gui-Close";
extern const char* const ednMsgGuiSave = "edn-Msg-Gui-Save"; extern const char* const ednMsgGuiSave = "edn-Msg-Gui-Save";
extern const char* const ednMsgGuiSaveAs = "edn-Msg-Gui-SaveAs"; extern const char* const ednMsgGuiSaveAs = "edn-Msg-Gui-SaveAs";
extern const char* const ednMsgProperties = "edn-Msg-Gui-Properties";
extern const char* const ednMsgGuiUndo = "edn-Msg-Gui-Undo"; extern const char* const ednMsgGuiUndo = "edn-Msg-Gui-Undo";
extern const char* const ednMsgGuiRedo = "edn-Msg-Gui-Redo"; extern const char* const ednMsgGuiRedo = "edn-Msg-Gui-Redo";
@@ -54,8 +55,9 @@ extern const char* const ednMsgGuiShowSpaces = "edn-Msg-Gui-ShowSpaces";
extern const char* const ednMsgGuiShowEndOfLine = "edn-Msg-Gui-ShowEndOfLine"; extern const char* const ednMsgGuiShowEndOfLine = "edn-Msg-Gui-ShowEndOfLine";
extern const char* const ednMsgGuiCtags = "edn-Msg-Gui-CTags"; extern const char* const ednMsgGuiCtags = "edn-Msg-Gui-CTags";
extern const char* const ednMsgCtagsLoadFile = "edn-Msg-CTags-direct-load";
extern const char* const ednMsgGuiAbout = "edn-Msg-Gui-About"; extern const char* const ednMsgGuiReloadShader = "edn-Msg-Gui-ReloadOpenGlShader";
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////

View File

@@ -34,6 +34,7 @@
extern const char* const ednMsgGuiClose; // data : "current" "All" extern const char* const ednMsgGuiClose; // data : "current" "All"
extern const char* const ednMsgGuiSave; // data : "" extern const char* const ednMsgGuiSave; // data : ""
extern const char* const ednMsgGuiSaveAs; // data : "" extern const char* const ednMsgGuiSaveAs; // data : ""
extern const char* const ednMsgProperties; // data : ""
extern const char* const ednMsgGuiUndo; // data : "" extern const char* const ednMsgGuiUndo; // data : ""
extern const char* const ednMsgGuiRedo; // data : "" extern const char* const ednMsgGuiRedo; // data : ""
@@ -45,7 +46,7 @@
extern const char* const ednMsgGuiGotoLine; // data : "???" / "1" ... "999999999999" extern const char* const ednMsgGuiGotoLine; // data : "???" / "1" ... "999999999999"
extern const char* const ednMsgGuiSearch; // data : "" extern const char* const ednMsgGuiSearch; // data : ""
extern const char* const ednMsgGuiReplace; // data : "" extern const char* const ednMsgGuiReplace; // data : "Normal" "All"
extern const char* const ednMsgGuiFind; // data : "Next" "Previous" "All" "None" extern const char* const ednMsgGuiFind; // data : "Next" "Previous" "All" "None"
extern const char* const ednMsgGuiChangeColor; // data : "Black" "White" extern const char* const ednMsgGuiChangeColor; // data : "Black" "White"
@@ -54,8 +55,9 @@
extern const char* const ednMsgGuiShowEndOfLine; // data : "enable" "disable" extern const char* const ednMsgGuiShowEndOfLine; // data : "enable" "disable"
extern const char* const ednMsgGuiCtags; // data : "Load" "ReLoad" "Jump" "Back" extern const char* const ednMsgGuiCtags; // data : "Load" "ReLoad" "Jump" "Back"
extern const char* const ednMsgCtagsLoadFile; // data : "filename of the ctags file"
extern const char* const ednMsgGuiAbout; // data : "" extern const char* const ednMsgGuiReloadShader; // data : ""
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////

View File

@@ -23,14 +23,16 @@
******************************************************************************* *******************************************************************************
*/ */
#include <etk/Types.h>
#include <etk/UString.h> #include <etk/UString.h>
#include <ewol/ewol.h> #include <ewol/ewol.h>
#include <ewol/EObject.h> #include <ewol/eObject/EObject.h>
#include <ewol/WidgetManager.h> #include <ewol/widget/WidgetManager.h>
#include <appl/Debug.h> #include <appl/Debug.h>
#include <appl/global.h> #include <appl/global.h>
#include <etk/File.h> #include <etk/os/FSNode.h>
#include <etk/tool.h>
#include <Gui/MainWindows.h> #include <Gui/MainWindows.h>
#include <BufferManager.h> #include <BufferManager.h>
#include <ColorizeManager.h> #include <ColorizeManager.h>
@@ -40,6 +42,7 @@
#include <readtags.h> #include <readtags.h>
#include <CTagsManager.h> #include <CTagsManager.h>
#include <globalMsg.h> #include <globalMsg.h>
#include <ewol/font/FontManager.h>
MainWindows * basicWindows = NULL; MainWindows * basicWindows = NULL;
@@ -49,7 +52,7 @@ MainWindows * basicWindows = NULL;
*/ */
void APP_Init(void) void APP_Init(void)
{ {
#ifdef __PLATFORM__Linux #ifdef __TARGET_OS__Linux
#ifdef MODE_RELEASE #ifdef MODE_RELEASE
APPL_INFO("==> Init "PROJECT_NAME" (START) (Linux) (Release)"); APPL_INFO("==> Init "PROJECT_NAME" (START) (Linux) (Release)");
#else #else
@@ -62,36 +65,16 @@ void APP_Init(void)
APPL_INFO("==> Init "PROJECT_NAME" (START) (Android) (Debug)"); APPL_INFO("==> Init "PROJECT_NAME" (START) (Android) (Debug)");
#endif #endif
#endif #endif
ewol::ChangeSize(800, 600); ewol::ChangeSize(etk::Vector2D<int32_t>(800, 600));
etk::InitDefaultFolder(PROJECT_NAME);
char cCurrentPath[FILENAME_MAX]; ewol::font::SetDefaultFont("Font/freefont/FreeSerif.ttf");
// set the default Path of the application : //ewol::font::SetDefaultFont("Font/ACharmingFont.ttf");
#ifdef __PLATFORM__Linux #ifdef __TARGET_OS__Android
etk::UString homedir; ewol::font::SetDefaultSize(19);
#ifdef MODE_RELEASE
homedir = "/usr/share/"PROJECT_NAME"/";
#else
if (!getcwd(cCurrentPath, FILENAME_MAX)) {
homedir = "./assets/";
} else {
cCurrentPath[FILENAME_MAX - 1] = '\0';
homedir = cCurrentPath;
homedir += "/assets/";
}
#endif
// TODO : Remove the Utf8Data
etk::SetBaseFolderData(homedir.Utf8Data());
etk::SetBaseFolderDataUser("~/."PROJECT_NAME"/");
etk::SetBaseFolderCache("/tmp/"PROJECT_NAME"/");
#endif
ewol::SetFontFolder("Font");
#ifdef __PLATFORM__Android
ewol::SetDefaultFont("freefont/FreeSerif.ttf", 19);
#else #else
ewol::SetDefaultFont("freefont/FreeSerif.ttf", 14); ewol::font::SetDefaultSize(14);
#endif #endif
// init internal global value // init internal global value
globals::init(); globals::init();
@@ -103,13 +86,14 @@ void APP_Init(void)
// set color and other trucs... // set color and other trucs...
ColorizeManager::Init(); ColorizeManager::Init();
etk::UString corlorFile = "color_white.xml"; etk::UString corlorFile = "color_white.xml";
ColorizeManager::LoadFile( corlorFile.Utf8Data() ); ColorizeManager::LoadFile( corlorFile.c_str() );
ColorizeManager::DisplayListOfColor(); ColorizeManager::DisplayListOfColor();
HighlightManager::Init(); HighlightManager::Init();
HighlightManager::loadLanguages(); HighlightManager::loadLanguages();
cTagsManager::Init();
char cCurrentPath[FILENAME_MAX];
// get the curent program folder // get the curent program folder
if (!getcwd(cCurrentPath, FILENAME_MAX)) { if (!getcwd(cCurrentPath, FILENAME_MAX)) {
return ; return ;
@@ -141,33 +125,38 @@ void APP_Init(void)
ewol::shortCut::Add("ctrl+z", ednMsgGuiUndo, ""); ewol::shortCut::Add("ctrl+z", ednMsgGuiUndo, "");
ewol::shortCut::Add("ctrl+shift+z", ednMsgGuiRedo, ""); ewol::shortCut::Add("ctrl+shift+z", ednMsgGuiRedo, "");
ewol::shortCut::Add("ctrl+w", ednMsgGuiRm, "Line");
ewol::shortCut::Add("ctrl+shift+w", ednMsgGuiRm, "Paragraph");
ewol::shortCut::Add("ctrl+x", ednMsgGuiCut, "STD");
ewol::shortCut::Add("ctrl+c", ednMsgGuiCopy, "STD");
ewol::shortCut::Add("ctrl+v", ednMsgGuiPaste, "STD");
ewol::shortCut::Add("ctrl+a", ednMsgGuiSelect, "ALL");
ewol::shortCut::Add("ctrl+shift+a", ednMsgGuiSelect, "NONE");
ewol::shortCut::Add("ctrl+l", ednMsgGuiGotoLine, "???"); ewol::shortCut::Add("ctrl+l", ednMsgGuiGotoLine, "???");
ewol::shortCut::Add("ctrl+f", ednMsgGuiSearch, "");
ewol::shortCut::Add("F12", ednMsgGuiReloadShader, "");
ewol::shortCut::Add("ctrl+d", ednMsgGuiCtags, "Jump");
// add files // add files
APPL_INFO("show list of files : "); APPL_INFO("show list of files : ");
bool ctagDetected = false;
for( int32_t iii=0 ; iii<ewol::CmdLineNb(); iii++) { for( int32_t iii=0 ; iii<ewol::CmdLine::Nb(); iii++) {
APPL_INFO("need load file : \"" << ewol::CmdLineGet(iii) << "\"" ); etk::UString tmpppp = ewol::CmdLine::Get(iii);
etk::UString tmpppp = ewol::CmdLineGet(iii); if (tmpppp == "-t") {
ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgOpenFile, tmpppp); ctagDetected = true;
} else if (true == ctagDetected) {
APPL_INFO("Load ctag file : \"" << tmpppp << "\"" );
ctagDetected = false;
ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgCtagsLoadFile, tmpppp);
} else {
APPL_INFO("need load file : \"" << tmpppp << "\"" );
ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgOpenFile, tmpppp);
}
} }
APPL_INFO("==> Init Edn (END)"); APPL_INFO("==> Init Edn (END)");
} }
etk::File APP_Icon(void) etk::FSNode APP_Icon(void)
{ {
etk::File bitmapFile("iconEdn.bmp", etk::FILE_TYPE_DATA); etk::FSNode bitmapFile("DATA:iconEdn.bmp");
return bitmapFile; return bitmapFile;
} }
@@ -180,6 +169,8 @@ void APP_UnInit(void)
// Remove windows : // Remove windows :
ewol::DisplayWindows(NULL); ewol::DisplayWindows(NULL);
cTagsManager::UnInit();
APPL_INFO("Stop Hightlight"); APPL_INFO("Stop Hightlight");
HighlightManager::UnInit(); HighlightManager::UnInit();
//Kill all singleton //Kill all singleton
@@ -193,7 +184,7 @@ void APP_UnInit(void)
//AccelKey::Kill(); //AccelKey::Kill();
if (NULL != basicWindows) { if (NULL != basicWindows) {
basicWindows->MarkToRemove(); delete(basicWindows);
basicWindows = NULL; basicWindows = NULL;
} }
APPL_INFO("==> Un-Init Edn (END)"); APPL_INFO("==> Un-Init Edn (END)");

View File

@@ -18,7 +18,9 @@ FILE_LIST+= appl/Gui/BufferView.cpp \
appl/Gui/CodeView.cpp \ appl/Gui/CodeView.cpp \
appl/Gui/MainWindows.cpp \ appl/Gui/MainWindows.cpp \
appl/Gui/Search.cpp \ appl/Gui/Search.cpp \
appl/Gui/SearchData.cpp appl/Gui/SearchData.cpp \
appl/Gui/TagFileSelection.cpp \
appl/Gui/TagFileList.cpp
# All needed for the buffer management : # All needed for the buffer management :
FILE_LIST+= appl/Buffer/EdnVectorBuf.cpp \ FILE_LIST+= appl/Buffer/EdnVectorBuf.cpp \
@@ -44,3 +46,13 @@ FILE_LIST+= appl/Highlight/HighlightPattern.cpp \
# Main entry file : # Main entry file :
FILE_LIST+= appl/init.cpp FILE_LIST+= appl/init.cpp
LOCAL_COPY_FILES := \
../share/Font/freefont/FreeSerif.ttf:Font/freefont/FreeSerif.ttf
LOCAL_COPY_FOLDERS := \
../share/*.xml: \
../share/icon/*.svg:icon \
../share/Font/freefont/FreeMon*.ttf:Font/freefont

View File

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

Before

Width:  |  Height:  |  Size: 648 B

View File

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

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

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

Before

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -1,32 +1,25 @@
# action a faire (ordonner par r<>vision) : # action a faire (ordonner par r<>vision) :
dans la liste des truc important a refaire dans la liste des truc important a refaire
retirer tout les singleton ==> passer par des namespace ==> fonctionnera mieux ...
finir de netoyer la classe widget finir de netoyer la classe widget
netoyer les classe text ... netoyer les classe text ...
mettre en pla ce le repositionnement automatique quand on change de buffer mettre en place le repositionnement automatique quand on change de buffer
Curseur au bon endroit Curseur au bon endroit
* 0.3.6 ...
* 0.2.X : * 0.2.X :
- gui : Amelioration du full-screen et du display de base (sans l'entete de la fenetre)
- gui : Mise en place d'un display ligne par ligne
- gui : ascenceur quand n<>cessaire
- gui : Demander la cr<63>ation de nouveaux fichier quand il n'existe pas (a l'ouverture en ligne de commande) - gui : Demander la cr<63>ation de nouveaux fichier quand il n'existe pas (a l'ouverture en ligne de commande)
- sys : Mise en place des colorisation de base pour le - sys : Mise en place des colorisation de base pour le
* java script * java script
* SQL * SQL
- sys : replace TAB with space when Tab is pressed
- sys : Catch F[1-12] ==> for user personal event - sys : Catch F[1-12] ==> for user personal event
- BUG : Correction du bug des entr<74> bizard tel que les chapot et les guillemets - BUG : Correction du bug des entr<74> bizard tel que les chapot et les guillemets
- BUG : de s<>lection quand la ligne est pleine et la premi<6D>re ligne s<>ctionn<6E>e. ==> regarder apr<70>s avoir fait le display ligne par ligne... - BUG : de s<>lection quand la ligne est pleine et la premi<6D>re ligne s<>ctionn<6E>e. ==> regarder apr<70>s avoir fait le display ligne par ligne...
- BUG : de copier coller sur les <20><><EFBFBD> ... - BUG : de copier coller sur les <20><><EFBFBD> è ...
- BUG : les caract<63>re multiples type chapot ... - BUG : les caract<63>re multiples type chapot ...
- BUG : italique non g<>n<EFBFBD>r<EFBFBD>
* 0.3.X : * 0.3.X :
- SEARCH : get selected text in the search windows
- SEARCH : Select the search windows when call crtl+F
- sys : personal property file in the ~/.edn ou ~/.gnome/edn - sys : personal property file in the ~/.edn ou ~/.gnome/edn
- gui : Ordonner les fichier ouvert par nom ... - gui : Ordonner les fichier ouvert par nom ...
- gui : parameter gui : et en autre la taille de la police ... et voir pour la r<>cup<75>rer sur le system... et ce serait cool... - gui : parameter gui : et en autre la taille de la police ... et voir pour la r<>cup<75>rer sur le system... et ce serait cool...
@@ -77,4 +70,4 @@ dans la liste des truc important a refaire
# note utiles : # note utiles :
http://majutsushi.github.com/tagbar/ ==> je devrais regarder ca pour savoir ce que je peux faire avec du ctags http://majutsushi.github.com/tagbar/ ==> je devrais regarder ca pour savoir ce que je peux faire avec du ctags
CTags : Set the parsing methode : "ctags -R --fields=+n Sources/ /usr/include/gtk-3.0/" CTags : Set the parsing methode : "ctags -R --fields=+n jni ../ewol/Sources/"

View File

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

0
changelog Normal file
View File

64
config/Android.config Normal file
View File

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

42
config/Linux.config Normal file
View File

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

42
config/Windows.config Normal file
View File

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

View File

@@ -1,774 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="9" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="event_handler">impl_virtual</property>
<property name="file"></property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">0</property>
<property name="name">MyProject1</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Panel" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">MyPanel1</property>
<property name="pos"></property>
<property name="size">500,196</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer1</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">1</property>
<property name="flag"></property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer2</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">String to find:</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_staticText1</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">1</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="minimum_size"></property>
<property name="name">m_textCtrl1</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Replace With:</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_staticText2</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">1</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="minimum_size"></property>
<property name="name">m_textCtrl2</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">1</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Case Sensitive</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_checkBox1</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">1</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Circular Search</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_checkBox2</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">1</property>
<property name="flag"></property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer3</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">1</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Find previous</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_button1</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick"></event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">1</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Find next</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_button2</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick"></event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">1</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Replace &amp;&amp; Find previous</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_button3</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick"></event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">1</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Replace &amp;&amp; Find next</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_button4</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick"></event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">1</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Replace in all window</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_button5</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick"></event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">1</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Cancel</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_button6</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick"></event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<EdnConfig version="0.1">
<option name="DisplayTab" value="true"/>
<option name="ConvertTabInSpace" value="false"/>
<option name="TabWidth" value="4"/>
<option name="CleanSpaceEndOfLine" value="false"/>
<option name="DisplaySpace" value="false"/>
<option name="DisplayEndOfLine" value="false"/>
<option name="DisplayEndOfFile" value="false"/>
<option name="ColorMode" value="color_black.xml"/>
<option name="IndentationMode" value="clever"/>
<option name="FontName" value="Monospace"/>
<option name="FontSize" value="8"/>
<option name="SaveCopyBeforSave" value="true"/>
<option name="SaveCopyPrefix" value=".save_"/>
<option name="SaveCopySufix" value="DATE"/>
<option name="SaveAutomatic" value="-1"/>
<option name="DisplayLineNumber" value="true"/>
<option name="LeftMarging" value="150"/>
</EdnConfig>

View File

@@ -1,521 +0,0 @@
BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
font-family: Geneva, Arial, Helvetica, sans-serif;
}
BODY,TD {
font-size: 90%;
}
body {
counter-reset: chapitre; /* Nous mettons <20> z<>ro le compteur chapitre */
}
H1 {
text-align: center;
font-size: 160%;
}
H2 {
font-size: 120%;
}
H3 {
font-size: 100%;
}
H4 {
font-size: 100%;
}
.contents H1 {
text-align: center;
}
.contents H2 {
padding-left: 5px;
counter-reset: section;
}
.contents h2:before {
counter-increment: chapitre; /* Ajoute 1 au compteur chapitre */
content: counter(chapitre) ". ";
}
.contents H3 {
padding-left: 10px;
counter-reset: soussection;
}
.contents h3:before {
counter-increment: section; /* Ajoute 1 au compteur section */
content: counter(chapitre) "." counter(section) ". ";
}
.contents H4 {
font-size: 100%;
}
.contents h4:before {
counter-increment: soussection; /* Ajoute 1 au compteur section */
content: counter(chapitre) "." counter(section) "." counter(soussection) ". ";
}
CAPTION {
font-weight: bold
}
DIV.qindex {
width: 100%;
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
padding: 2px;
line-height: 140%;
}
DIV.navpath {
width: 100%;
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
padding: 2px;
line-height: 140%;
}
DIV.navtab {
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
margin-right: 15px;
padding: 2px;
}
TD.navtab {
font-size: 70%;
}
A.qindex {
text-decoration: none;
font-weight: bold;
color: #1A419D;
}
A.qindex:visited {
text-decoration: none;
font-weight: bold;
color: #1A419D
}
A.qindex:hover {
text-decoration: none;
background-color: #ddddff;
}
A.qindexHL {
text-decoration: none;
font-weight: bold;
background-color: #6666cc;
color: #ffffff;
border: 1px double #9295C2;
}
A.qindexHL:hover {
text-decoration: none;
background-color: #6666cc;
color: #ffffff;
}
A.qindexHL:visited {
text-decoration: none;
background-color: #6666cc;
color: #ffffff
}
A.el {
text-decoration: none;
font-weight: bold
}
A.elRef {
font-weight: bold
}
A.code:link {
text-decoration: none;
font-weight: normal;
color: #0000FF
}
A.code:visited {
text-decoration: none;
font-weight: normal;
color: #0000FF
}
A.codeRef:link {
font-weight: normal;
color: #0000FF
}
A.codeRef:visited {
font-weight: normal;
color: #0000FF
}
A:hover {
text-decoration: none;
background-color: #f2f2ff
}
DL.el {
margin-left: -1cm
}
.fragment {
font-family: monospace, fixed;
font-size: 95%;
}
PRE.fragment {
border: 1px solid #CCCCCC;
background-color: #f5f5f5;
margin-top: 4px;
margin-bottom: 4px;
margin-left: 2px;
margin-right: 8px;
padding-left: 6px;
padding-right: 6px;
padding-top: 4px;
padding-bottom: 4px;
}
DIV.ah {
background-color: black;
font-weight: bold;
color: #ffffff;
margin-bottom: 3px;
margin-top: 3px
}
DIV.groupHeader {
margin-left: 16px;
margin-top: 12px;
margin-bottom: 6px;
font-weight: bold;
}
DIV.groupText {
margin-left: 16px;
font-style: italic;
font-size: 90%
}
BODY {
background: white;
color: black;
margin-right: 20px;
margin-left: 20px;
}
TD.indexkey {
background-color: #e8eef2;
font-weight: bold;
padding-right : 10px;
padding-top : 2px;
padding-left : 10px;
padding-bottom : 2px;
margin-left : 0px;
margin-right : 0px;
margin-top : 2px;
margin-bottom : 2px;
border: 1px solid #CCCCCC;
}
TD.indexvalue {
background-color: #e8eef2;
font-style: italic;
padding-right : 10px;
padding-top : 2px;
padding-left : 10px;
padding-bottom : 2px;
margin-left : 0px;
margin-right : 0px;
margin-top : 2px;
margin-bottom : 2px;
border: 1px solid #CCCCCC;
}
TR.memlist {
background-color: #f0f0f0;
}
P.formulaDsp {
text-align: center;
}
IMG.formulaDsp {
}
IMG.formulaInl {
vertical-align: middle;
}
SPAN.keyword { color: #008000 }
SPAN.keywordtype { color: #604020 }
SPAN.keywordflow { color: #e08000 }
SPAN.comment { color: #800000 }
SPAN.preprocessor { color: #806020 }
SPAN.stringliteral { color: #002080 }
SPAN.charliteral { color: #008080 }
SPAN.vhdldigit { color: #ff00ff }
SPAN.vhdlchar { color: #000000 }
SPAN.vhdlkeyword { color: #700070 }
SPAN.vhdllogic { color: #ff0000 }
.mdescLeft {
padding: 0px 8px 4px 8px;
font-size: 80%;
font-style: italic;
background-color: #FAFAFA;
border-top: 1px none #E0E0E0;
border-right: 1px none #E0E0E0;
border-bottom: 1px none #E0E0E0;
border-left: 1px none #E0E0E0;
margin: 0px;
}
.mdescRight {
padding: 0px 8px 4px 8px;
font-size: 80%;
font-style: italic;
background-color: #FAFAFA;
border-top: 1px none #E0E0E0;
border-right: 1px none #E0E0E0;
border-bottom: 1px none #E0E0E0;
border-left: 1px none #E0E0E0;
margin: 0px;
}
.memItemLeft {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memItemRight {
padding: 1px 8px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memTemplItemLeft {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memTemplItemRight {
padding: 1px 8px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memTemplParams {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
color: #606060;
background-color: #FAFAFA;
font-size: 80%;
}
.search {
color: #003399;
font-weight: bold;
}
FORM.search {
margin-bottom: 0px;
margin-top: 0px;
}
INPUT.search {
font-size: 75%;
color: #000080;
font-weight: normal;
background-color: #e8eef2;
}
TD.tiny {
font-size: 75%;
}
a {
color: #1A41A8;
}
a:visited {
color: #2A3798;
}
.dirtab {
padding: 4px;
border-collapse: collapse;
border: 1px solid #84b0c7;
}
TH.dirtab {
background: #e8eef2;
font-weight: bold;
}
HR {
height: 1px;
border: none;
border-top: 1px solid black;
}
/* Style for detailed member documentation */
.memtemplate {
font-size: 80%;
color: #606060;
font-weight: normal;
margin-left: 3px;
}
.memnav {
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
margin-right: 15px;
padding: 2px;
}
.memitem {
padding: 4px;
background-color: #eef3f5;
border-width: 1px;
border-style: solid;
border-color: #dedeee;
-moz-border-radius: 8px 8px 8px 8px;
}
.memname {
white-space: nowrap;
font-weight: bold;
}
.memdoc{
padding-left: 10px;
}
.memproto {
background-color: #d5e1e8;
width: 100%;
border-width: 1px;
border-style: solid;
border-color: #84b0c7;
font-weight: bold;
-moz-border-radius: 8px 8px 8px 8px;
}
.paramkey {
text-align: right;
}
.paramtype {
white-space: nowrap;
}
.paramname {
color: #602020;
font-style: italic;
white-space: nowrap;
}
/* End Styling for detailed member documentation */
/* for the tree view */
.ftvtree {
font-family: sans-serif;
margin:0.5em;
}
.directory {
font-size: 9pt;
font-weight: bold;
}
directory.directory h3 {
margin: 0px;
margin-top: 1em;
font-size: 11pt;
}
.directory > h3 {
margin-top: 0;
}
.directory p {
margin: 0px;
white-space: nowrap;
}
.directory div {
display: none;
margin: 0px;
}
.directory img {
vertical-align: -30%;
}
/* classe mise dans le tableau : table */
.tableau{
margin-left:35px;
border: medium solid #6495ed;
border-collapse: collapse;
border-spacing: 0px;
}
.tableau th {
border: thin solid #6495ed;
padding: 5px;
background-color: #D0E3FA;
}
.tableau td {
border: thin solid #6495ed;
padding: 5px;
text-align: center;
background-color: #ffffff;
}
.tableau tr p {
padding: 0px;
border: 0px;
margin: 0px;
}
.contents p{
padding-left: 35px;
}
.contents ul{
padding-left: 80px;
}
.contents ul ul{
padding-left: 65px;
}

View File

@@ -1,14 +0,0 @@
[Desktop Entry]
Version=0.3.0
Name=Edn : Editeur de N'ours
Exec=edn
Icon=Edn
Terminal=false
Type=Application
Categories=Development;Utility;TextEditor;
GenericName=Text editor
GenericName[en]=Text editor
GenericName[nl]=Tekst verwerker
GenericName[fr]=<EFBFBD>diteur de text
Comment=Code editor for c, c++, php, bash, xml ...
Comment[fr]=<EFBFBD>diteur de text pour les language c, c++, php, bash, xml ...

View File

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

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