Compare commits
30 Commits
Author | SHA1 | Date | |
---|---|---|---|
9e0720b476 | |||
8bce8893e8 | |||
d2cb4a47b7 | |||
65b288813e | |||
7bad5d42f2 | |||
fda95289bd | |||
102e11b74a | |||
ee80871434 | |||
43c3092fe3 | |||
d05d82ba7b | |||
6052df85dc | |||
a9eb976b48 | |||
411bf03e74 | |||
a53903d628 | |||
f3bf0b557c | |||
6f6b0a6f7f | |||
43d8aaef48 | |||
9c9eac7d37 | |||
c61876b919 | |||
10ceb14268 | |||
8c014312c6 | |||
01868a2114 | |||
bd7aa98324 | |||
70837bd769 | |||
2d355d05c6 | |||
a6e583f8c9 | |||
870e127932 | |||
a351fe72bd | |||
9b7707cf9a | |||
![]() |
a03fb96dc9 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -4,9 +4,14 @@
|
||||
###################################
|
||||
CVS
|
||||
.svn
|
||||
.gitk-tmp.*
|
||||
Object/
|
||||
doxygen/API/
|
||||
doxygen/ALL/
|
||||
bin/
|
||||
gen/
|
||||
linux/
|
||||
obj/
|
||||
|
||||
###################################
|
||||
# backup files
|
||||
|
21
AndroidManifest.xml
Normal file
21
AndroidManifest.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?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" />
|
||||
</manifest>
|
2
Application.mk
Normal file
2
Application.mk
Normal file
@@ -0,0 +1,2 @@
|
||||
APP_BUILD_SCRIPT=$PROJECT/Sources/Android.mk
|
||||
|
361
Makefile
361
Makefile
@@ -1,336 +1,59 @@
|
||||
##################################################################################################################
|
||||
# #
|
||||
# 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=[1m
|
||||
export F_INVERSER=[7m
|
||||
export F_SOUSLIGNER=[4m
|
||||
export F_NORMALE=[m
|
||||
export F_NOIR=[31m
|
||||
export F_ROUGE=[31m
|
||||
export F_VERT=[32m
|
||||
export F_MARRON=[33m
|
||||
export F_BLUE=[34m
|
||||
export F_VIOLET=[35m
|
||||
export F_CYAN=[36m
|
||||
export F_GRIS=[37m
|
||||
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)
|
||||
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
### Some Preject properties : ###
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
CXX=g++
|
||||
CC=gcc
|
||||
|
||||
PROJECT_PATH=$(shell pwd)
|
||||
ifeq ($(PLATFORM), Linux)
|
||||
PROJECT_NDK?=$(PROJECT_PATH)/../ewol/
|
||||
else ifeq ($(PLATFORM), Android)
|
||||
PROJECT_NDK?=$(PROJECT_PATH)/../android/ndk-r7/
|
||||
PROJECT_SDK?=$(PROJECT_PATH)/../android/sdk-r15/
|
||||
endif
|
||||
|
||||
|
||||
PROJECT_MODULE?=$(PROJECT_PATH)/../
|
||||
|
||||
EWOL_FOLDER=$(PROJECT_MODULE)ewol
|
||||
|
||||
# group name or constructor ... (no dot, no MAJ no Numerical char)
|
||||
PROJECT_VENDOR=heeroyui
|
||||
# Binary name ... (no dot, no MAJ no Numerical char)
|
||||
PROJECT_NAME=edn
|
||||
|
||||
#dependence of the librairies :
|
||||
#PROJECT_LIB_DEPENDENCY= ewol
|
||||
|
||||
PROJECT_FILE_DIRECTORY=jni
|
||||
|
||||
# get the tag of the current project :
|
||||
PROJECT_VERSION_TAG=$(shell git describe --tags)
|
||||
#$(info Project version TAG : $(PROJECT_VERSION_TAG))
|
||||
|
||||
PROJECT_VERSION_TAG_SHORT=$(shell git describe --tags --abbrev=0)
|
||||
#$(info Project version TAG Short: $(PROJECT_VERSION_TAG_SHORT))
|
||||
|
||||
# enable or disable debug :
|
||||
DEBUG:=1
|
||||
|
||||
###############################################################################
|
||||
### Compilation Define ###
|
||||
###############################################################################
|
||||
ifeq ("$(DEBUG)", "0")
|
||||
ifeq ("$(DEBUG)", "0")
|
||||
PROJECT_CXXFLAGS = -DPROJECT_DEBUG_LEVEL=1
|
||||
PROJECT_CXXFLAGS+= -DPROJECT_NDEBUG
|
||||
PROJECT_CXXFLAGS+= -DPROJECT_VERSION_TAG_NAME="\"$(VERSION_TAG)-release\""
|
||||
else
|
||||
else
|
||||
PROJECT_CXXFLAGS = -DPROJECT_DEBUG_LEVEL=3
|
||||
PROJECT_CXXFLAGS+= -DPROJECT_VERSION_TAG_NAME="\"$(VERSION_TAG)-debug\""
|
||||
endif
|
||||
endif
|
||||
PROJECT_CXXFLAGS+= -DPROJECT_VERSION_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
|
||||
PROJECT_CXXFLAGS+= -I$(EWOL_FOLDER)/Sources/
|
||||
|
||||
|
||||
###############################################################################
|
||||
### Basic Cfags ###
|
||||
PROJECT_LDFLAGS= -L$(EWOL_FOLDER)
|
||||
|
||||
|
||||
# basic GTK librairy
|
||||
CXXFLAGS= $(GTKFLAGS)
|
||||
# Linux thread system
|
||||
CXXFLAGS+= -lpthread
|
||||
# Enable debug (cgdb edn)
|
||||
CXXFLAGS+= -g -O0
|
||||
#CXXFLAGS+= -O2
|
||||
# display all flags
|
||||
CXXFLAGS+= -Wall
|
||||
# ...
|
||||
CXXFLAGS+= -D_REENTRANT
|
||||
# internal defines
|
||||
CXXFLAGS+= $(DEFINE)
|
||||
|
||||
CFLAGS= $(CXXFLAGS) -std=c99
|
||||
|
||||
# basic GTK librairy
|
||||
LDFLAGS= $(GTKFLAGS)
|
||||
# Linux thread system
|
||||
LDFLAGS+= -lpthread
|
||||
# Dynamic connection of the CALLBACK of the GUI
|
||||
LDFLAGS+= -Wl,--export-dynamic
|
||||
|
||||
###############################################################################
|
||||
### Project Name ###
|
||||
###############################################################################
|
||||
PROG_NAME=edn
|
||||
|
||||
###############################################################################
|
||||
### Basic Project description Files ###
|
||||
###############################################################################
|
||||
FILE_DIRECTORY=Sources
|
||||
OUTPUT_NAME_RELEASE=$(PROG_NAME)_release
|
||||
OUTPUT_NAME_DEBUG=$(PROG_NAME)_debug
|
||||
OBJECT_DIR=Object
|
||||
|
||||
ifeq ("$(DEBUG)", "0")
|
||||
OBJECT_DIRECTORY=$(OBJECT_DIR)/release
|
||||
OUTPUT_NAME = $(OUTPUT_NAME_RELEASE)
|
||||
else
|
||||
OBJECT_DIRECTORY=$(OBJECT_DIR)/debug
|
||||
OUTPUT_NAME = $(OUTPUT_NAME_DEBUG)
|
||||
endif
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
### Generique dependency ###
|
||||
###############################################################################
|
||||
MAKE_DEPENDENCE=Makefile
|
||||
|
||||
###############################################################################
|
||||
### Files Listes ###
|
||||
###############################################################################
|
||||
|
||||
# tiny XML (extern OPEN Sources) :
|
||||
CXXFILES = tools/tinyXML/tinyxml.cpp \
|
||||
tools/tinyXML/tinyxmlparser.cpp \
|
||||
tools/tinyXML/tinyxmlerror.cpp \
|
||||
tools/tinyXML/tinystr.cpp
|
||||
|
||||
# ExuberantCtags reading file tools (extern OPEN Sources) :
|
||||
CXXFILES+= ctags/readtags.cpp \
|
||||
ctags/CTagsManager.cpp
|
||||
|
||||
|
||||
# Globals debug tool:
|
||||
CXXFILES+= tools/debug/tools_debug.cpp \
|
||||
tools/globals/tools_globals.cpp \
|
||||
tools/memory/toolsMemory.cpp
|
||||
|
||||
# Buffers internal:
|
||||
CXXFILES+= tools/EdnTemplate/EdnVectorBuf.cpp \
|
||||
tools/EdnBuf/EdnBuf.cpp \
|
||||
tools/EdnBuf/EdnBuf_HighLight.cpp \
|
||||
tools/EdnBuf/EdnBuf_History.cpp \
|
||||
tools/EdnBuf/EdnBuf_Selection.cpp \
|
||||
tools/EdnBuf/EdnBufHistory.cpp
|
||||
|
||||
|
||||
# Tools internal:
|
||||
CXXFILES+= tools/Display/Display.cpp \
|
||||
tools/ClipBoard/ClipBoard.cpp \
|
||||
tools/MsgBroadcast/MsgBroadcast.cpp \
|
||||
tools/MsgBroadcast/AccelKey.cpp \
|
||||
tools/charset/charsetTable.cpp \
|
||||
tools/charset/charset.cpp \
|
||||
tools/NameSpaceEdn/File.cpp \
|
||||
tools/NameSpaceEdn/String.cpp \
|
||||
tools/NameSpaceEdn/RegExp.cpp
|
||||
|
||||
# Gui:
|
||||
CXXFILES+= CustumWidget/BufferView/BufferView.cpp \
|
||||
CustumWidget/CodeView/CodeView.cpp \
|
||||
GuiTools/WindowsManager/WindowsManager.cpp \
|
||||
GuiTools/MainWindows/MainWindows.cpp \
|
||||
GuiTools/MainWindows/StatusBar.cpp \
|
||||
GuiTools/MainWindows/MenuBar.cpp \
|
||||
GuiTools/MainWindows/ToolBar.cpp \
|
||||
GuiTools/Search/Search.cpp \
|
||||
GuiTools/Search/SearchData.cpp
|
||||
|
||||
# Basic Interface :
|
||||
CXXFILES+= Buffer/Buffer.cpp \
|
||||
Buffer/BufferText.cpp \
|
||||
Buffer/BufferEmpty.cpp \
|
||||
Buffer/BufferManager.cpp \
|
||||
Colorize/Colorize.cpp \
|
||||
Colorize/ColorizeManager.cpp \
|
||||
Highlight/HighlightPattern.cpp \
|
||||
Highlight/Highlight.cpp \
|
||||
Highlight/HighlightManager.cpp
|
||||
|
||||
# Main entry file :
|
||||
CXXFILES+= init.cpp
|
||||
|
||||
|
||||
###############################################################################
|
||||
### Liste of folder where .h can be ###
|
||||
###############################################################################
|
||||
LISTE_MODULES = $(dir $(CXXFILES))
|
||||
INCLUDE_DIRECTORY = $(addprefix -I$(FILE_DIRECTORY)/, $(LISTE_MODULES))
|
||||
|
||||
###############################################################################
|
||||
### Build Object Files List ###
|
||||
###############################################################################
|
||||
OBJ = $(addprefix $(OBJECT_DIRECTORY)/, $(CXXFILES:.cpp=.o))
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
### Main Part of Makefile ###
|
||||
###############################################################################
|
||||
all: build
|
||||
|
||||
-include $(OBJ:.o=.d)
|
||||
|
||||
build: .encadrer .versionFile $(OUTPUT_NAME)
|
||||
|
||||
|
||||
.encadrer:
|
||||
@echo $(CADRE_HAUT_BAS)
|
||||
@echo $(CADRE_COTERS)
|
||||
@echo '
|
||||
DEBUT DE COMPILATION DU PROGRAMME :'$(CADRE_COTERS)
|
||||
@echo '
|
||||
Repertoire Sources : $(FILE_DIRECTORY)/'$(CADRE_COTERS)
|
||||
@echo '
|
||||
Repertoire object : $(OBJECT_DIRECTORY)/'$(CADRE_COTERS)
|
||||
@echo '
|
||||
Binaire de sortie : $(F_VIOLET)$(OUTPUT_NAME) $(F_NORMALE)'$(CADRE_COTERS)
|
||||
@echo $(CADRE_COTERS)
|
||||
@echo $(CADRE_HAUT_BAS)
|
||||
@mkdir -p $(addprefix $(OBJECT_DIRECTORY)/, $(LISTE_MODULES))
|
||||
|
||||
|
||||
FILE_IMAGES= data/imagesSources/*.png
|
||||
|
||||
|
||||
.versionFile :
|
||||
@rm -f $(OBJECT_DIRECTORY)/GuiTools/WindowsManager/WindowsManager.o
|
||||
|
||||
|
||||
# Tool used to create a binary version of every element png or other needed by the application
|
||||
pngToCpp: tools/pngToCpp/pngToCpp.c
|
||||
@echo $(F_ROUGE)"
|
||||
(bin) $@"$(F_NORMALE)
|
||||
@$(CXX) $< -o $@
|
||||
@strip -s $@
|
||||
|
||||
# Generate basic
|
||||
$(FILE_DIRECTORY)/GuiTools/myImage.cpp: $(FILE_IMAGES) $(MAKE_DEPENDENCE) pngToCpp
|
||||
@echo $(F_BLUE)"
|
||||
(.cpp) *.png ==> $@"$(F_NORMALE)
|
||||
@./pngToCpp $@ $(FILE_IMAGES)
|
||||
|
||||
|
||||
# build C++
|
||||
$(OBJECT_DIRECTORY)/%.o: $(FILE_DIRECTORY)/%.cpp $(MAKE_DEPENDENCE)
|
||||
@echo $(F_VERT)"
|
||||
(.o) $<"$(F_NORMALE)
|
||||
@$(CXX) $< -c -o $@ $(INCLUDE_DIRECTORY) $(CXXFLAGS) -MMD
|
||||
|
||||
# build binary Release Mode
|
||||
$(OUTPUT_NAME_RELEASE): $(OBJ) $(MAKE_DEPENDENCE)
|
||||
@echo $(F_ROUGE)"
|
||||
(bin) $@ "$(F_NORMALE)
|
||||
@$(CXX) $(OBJ) $(LDFLAGS) -o $@
|
||||
@cp $@ $(PROG_NAME)
|
||||
|
||||
# build binary Debug Mode
|
||||
$(OUTPUT_NAME_DEBUG): $(OBJ) $(MAKE_DEPENDENCE)
|
||||
@echo $(F_ROUGE)"
|
||||
(bin) $@ "$(F_NORMALE)
|
||||
@$(CXX) $(OBJ) $(LDFLAGS) -o $@
|
||||
@cp $@ $(PROG_NAME)
|
||||
|
||||
clean:
|
||||
@echo $(CADRE_HAUT_BAS)
|
||||
@echo ' CLEANING : $(F_VIOLET)$(OUTPUT_NAME)$(F_NORMALE)'$(CADRE_COTERS)
|
||||
@echo $(CADRE_HAUT_BAS)
|
||||
@echo Remove Folder : $(OBJECT_DIR)
|
||||
@rm -rf $(OBJECT_DIR)
|
||||
@echo Remove File : $(PROG_NAME) $(OUTPUT_NAME_DEBUG) $(OUTPUT_NAME_RELEASE)
|
||||
@rm -f $(PROG_NAME) $(OUTPUT_NAME_DEBUG) $(OUTPUT_NAME_RELEASE)
|
||||
@echo Remove File : pngToCpp
|
||||
@rm -f pngToCpp
|
||||
@echo Remove File : $(FILE_DIRECTORY)/GuiTools/myImage.*
|
||||
@rm -f $(FILE_DIRECTORY)/GuiTools/myImage.*
|
||||
@echo Remove doxygen files : doxygen/*
|
||||
@rm -rf doxygen
|
||||
@rm -f doxygen.log
|
||||
@echo Remove temporary files *.bck
|
||||
@rm -f `find . -name "*.bck"`
|
||||
|
||||
count:
|
||||
wc -l Makefile `find $(FILE_DIRECTORY)/ -name "*.cpp"` `find $(FILE_DIRECTORY)/ -name "*.h"`
|
||||
|
||||
install: .encadrer .versionFile $(OUTPUT_NAME_RELEASE)
|
||||
@echo $(CADRE_HAUT_BAS)
|
||||
@echo ' INSTALL : $(F_VIOLET)$(OUTPUT_NAME_RELEASE)=>$(PROG_NAME)$(F_NORMALE)'$(CADRE_COTERS)
|
||||
@echo $(CADRE_HAUT_BAS)
|
||||
@echo $(F_ROUGE)"
|
||||
(stripped) $(OUTPUT_NAME_RELEASE) => $(PROG_NAME) "$(F_NORMALE)
|
||||
@cp $(OUTPUT_NAME_RELEASE) $(PROG_NAME)
|
||||
@strip -s $(PROG_NAME)
|
||||
@echo $(F_VERT)"
|
||||
(copy) $(PROG_NAME) /usr/bin/ "$(F_NORMALE)
|
||||
@cp -vf $(PROG_NAME) /usr/bin/
|
||||
@echo $(F_VERT)"
|
||||
(data) data/* ==> /usr/share/edn/ "$(F_NORMALE)
|
||||
@mkdir -p /usr/share/edn/
|
||||
@rm -rf /usr/share/edn/*
|
||||
@cp -vf data/*.xml /usr/share/edn/
|
||||
@mkdir -p /usr/share/edn/images/
|
||||
@cp -vf data/imagesSources/icone.png /usr/share/edn/images/
|
||||
@cp -vf data/imagesSources/delete-24px.png /usr/share/edn/images/
|
||||
|
||||
|
||||
# http://alp.developpez.com/tutoriels/debian/creer-paquet/
|
||||
package: .encadrer
|
||||
@echo 'Create Folders ...'
|
||||
@mkdir -p package/$(PROG_NAME)/DEBIAN/
|
||||
@mkdir -p package/$(PROG_NAME)/usr/bin/
|
||||
@mkdir -p package/$(PROG_NAME)/usr/share/doc/
|
||||
@mkdir -p package/$(PROG_NAME)/usr/share/edn/
|
||||
# Create the control file
|
||||
@echo "Package: "$(PROG_NAME) > package/$(PROG_NAME)/DEBIAN/control
|
||||
@echo "Version: "$(VERSION_TAG_SHORT) >> package/$(PROG_NAME)/DEBIAN/control
|
||||
@echo "Section: Development,Editors" >> package/$(PROG_NAME)/DEBIAN/control
|
||||
@echo "Priority: optional" >>package/$(PROG_NAME)/DEBIAN/control
|
||||
@echo "Architecture: all" >> package/$(PROG_NAME)/DEBIAN/control
|
||||
@echo "Depends: bash" >> package/$(PROG_NAME)/DEBIAN/control
|
||||
@echo "Maintainer: Mr DUPIN Edouard <yui.heero@gmail.com>" >> package/$(PROG_NAME)/DEBIAN/control
|
||||
@echo "Description: Text editor for sources code with ctags management" >> package/$(PROG_NAME)/DEBIAN/control
|
||||
@echo "" >> package/$(PROG_NAME)/DEBIAN/control
|
||||
# Create the PostRm
|
||||
#include the specific platefom makefile
|
||||
include $(EWOL_FOLDER)/Build/Makefile.$(PLATFORM).mk
|
||||
|
||||
|
||||
|
340
Makefile_old
Normal file
340
Makefile_old
Normal file
@@ -0,0 +1,340 @@
|
||||
##################################################################################################################
|
||||
# #
|
||||
# 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=[1m
|
||||
export F_INVERSER=[7m
|
||||
export F_SOUSLIGNER=[4m
|
||||
export F_NORMALE=[m
|
||||
export F_NOIR=[31m
|
||||
export F_ROUGE=[31m
|
||||
export F_VERT=[32m
|
||||
export F_MARRON=[33m
|
||||
export F_BLUE=[34m
|
||||
export F_VIOLET=[35m
|
||||
export F_CYAN=[36m
|
||||
export F_GRIS=[37m
|
||||
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
|
@@ -1,421 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file CodeView.cpp
|
||||
* @brief Editeur De N'ours : Code Viewer Widget
|
||||
* This is an abstraction
|
||||
* @author Edouard DUPIN
|
||||
* @date 05/01/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "CodeView.h"
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "tools_globals.h"
|
||||
#include "Display.h"
|
||||
#include "CodeView.h"
|
||||
#include "BufferManager.h"
|
||||
#include "ColorizeManager.h"
|
||||
#include "ClipBoard.h"
|
||||
#include "SearchData.h"
|
||||
|
||||
|
||||
CodeView::CodeView(void) : MsgBroadcast("Code View", EDN_CAT_WORK_AREA)
|
||||
{
|
||||
m_bufferID = -1;
|
||||
m_buttunOneSelected = false;
|
||||
m_shawableAreaX = 0;
|
||||
m_shawableAreaY = 0;
|
||||
|
||||
// Init link with the buffer Manager
|
||||
m_bufferManager = BufferManager::getInstance();
|
||||
m_colorManager = ColorizeManager::getInstance();
|
||||
|
||||
m_widget = gtk_drawing_area_new();
|
||||
gtk_widget_set_size_request( m_widget, 200, 100);
|
||||
|
||||
gtk_widget_add_events( m_widget,
|
||||
GDK_KEY_PRESS_MASK
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_BUTTON_RELEASE_MASK
|
||||
| GDK_POINTER_MOTION_MASK
|
||||
| GDK_POINTER_MOTION_HINT_MASK);
|
||||
# ifdef USE_GTK_VERSION_3_0
|
||||
g_object_set(m_widget,"can-focus", TRUE, NULL);
|
||||
# elif defined( USE_GTK_VERSION_2_0 )
|
||||
GTK_WIDGET_SET_FLAGS(m_widget, GTK_CAN_FOCUS);
|
||||
# endif
|
||||
// Focus Event
|
||||
g_signal_connect( G_OBJECT(m_widget), "focus_in_event", G_CALLBACK(CB_focusGet), this);
|
||||
g_signal_connect( G_OBJECT(m_widget), "focus_out_event", G_CALLBACK(CB_focusLost), this);
|
||||
// Keyboard Event
|
||||
g_signal_connect_after( G_OBJECT(m_widget), "key_press_event", G_CALLBACK(CB_keyboardEvent), this);
|
||||
g_signal_connect_after( G_OBJECT(m_widget), "key_release_event", G_CALLBACK(CB_keyboardEvent), this);
|
||||
// Mouse Event
|
||||
g_signal_connect( G_OBJECT(m_widget), "button_press_event", G_CALLBACK(CB_mouseButtonEvent), this);
|
||||
g_signal_connect( G_OBJECT(m_widget), "button_release_event", G_CALLBACK(CB_mouseButtonEvent), this);
|
||||
g_signal_connect( G_OBJECT(m_widget), "motion_notify_event", G_CALLBACK(CB_mouseMotionEvent), this);
|
||||
g_signal_connect( G_OBJECT(m_widget), "scroll-event", G_CALLBACK(CB_mouseScrollEvent), this);
|
||||
// Display Event
|
||||
g_signal_connect( G_OBJECT(m_widget), "realize", G_CALLBACK(CB_displayInit), this);
|
||||
# ifdef USE_GTK_VERSION_3_0
|
||||
g_signal_connect( G_OBJECT(m_widget), "draw", G_CALLBACK(CB_displayDraw), this);
|
||||
# elif defined( USE_GTK_VERSION_2_0 )
|
||||
g_signal_connect( G_OBJECT(m_widget), "expose_event", G_CALLBACK(CB_displayDraw), this);
|
||||
# endif
|
||||
}
|
||||
|
||||
CodeView::~CodeView(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
GtkWidget * CodeView::GetMainWidget(void)
|
||||
{
|
||||
return m_widget;
|
||||
}
|
||||
|
||||
|
||||
void CodeView::OnMessage(int32_t id, int32_t dataID)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case EDN_MSG__CURRENT_CHANGE_BUFFER_ID:
|
||||
//EDN_INFO("Select a new Buffer ... " << dataID);
|
||||
m_bufferID = dataID;
|
||||
m_bufferManager->Get(m_bufferID)->ForceReDraw(true);
|
||||
// request the dispplay of the curent Editor
|
||||
SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, m_bufferID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_SAVE:
|
||||
SendMessage(EDN_MSG__BUFF_ID_SAVE, m_bufferID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_SAVE_AS:
|
||||
SendMessage(EDN_MSG__GUI_SHOW_SAVE_AS, m_bufferID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_REMOVE_LINE:
|
||||
m_bufferManager->Get(m_bufferID)->RemoveLine();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_SELECT_ALL:
|
||||
m_bufferManager->Get(m_bufferID)->SelectAll();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_UN_SELECT:
|
||||
m_bufferManager->Get(m_bufferID)->SelectNone();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_COPY:
|
||||
if (dataID == -1) {
|
||||
dataID = COPY_STD;
|
||||
}
|
||||
m_bufferManager->Get(m_bufferID)->Copy(dataID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_CUT:
|
||||
if (dataID == -1) {
|
||||
dataID = COPY_STD;
|
||||
}
|
||||
m_bufferManager->Get(m_bufferID)->Cut(dataID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_PASTE:
|
||||
if (dataID == -1) {
|
||||
dataID = COPY_STD;
|
||||
}
|
||||
m_bufferManager->Get(m_bufferID)->Paste(dataID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_FIND_PREVIOUS:
|
||||
{
|
||||
Edn::String myDataString;
|
||||
SearchData::GetSearch(myDataString);
|
||||
m_bufferManager->Get(m_bufferID)->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__CURRENT_FIND_NEXT:
|
||||
{
|
||||
Edn::String myDataString;
|
||||
SearchData::GetSearch(myDataString);
|
||||
m_bufferManager->Get(m_bufferID)->Search(myDataString, false, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__CURRENT_REPLACE:
|
||||
{
|
||||
Edn::String myDataString;
|
||||
SearchData::GetReplace(myDataString);
|
||||
m_bufferManager->Get(m_bufferID)->Replace(myDataString);
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__CURRENT_REPLACE_ALL:
|
||||
break;
|
||||
case EDN_MSG__CURRENT_CLOSE:
|
||||
SendMessage(EDN_MSG__BUFF_ID_CLOSE, m_bufferID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_UNDO:
|
||||
m_bufferManager->Get(m_bufferID)->Undo();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_REDO:
|
||||
m_bufferManager->Get(m_bufferID)->Redo();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_GOTO_LINE:
|
||||
if (dataID<0) {
|
||||
dataID = 0;
|
||||
}
|
||||
m_bufferManager->Get(m_bufferID)->JumpAtLine(dataID);
|
||||
break;
|
||||
case EDN_MSG__REFRESH_DISPLAY:
|
||||
break;
|
||||
case EDN_MSG__CURRENT_SET_CHARSET:
|
||||
m_bufferManager->Get(m_bufferID)->SetCharset((charset_te)dataID);
|
||||
break;
|
||||
case EDN_MSG__USER_DISPLAY_CHANGE:
|
||||
// Redraw all the display ... Done under ...
|
||||
break;
|
||||
}
|
||||
// Force redraw of the widget
|
||||
gtk_widget_queue_draw(m_widget);
|
||||
}
|
||||
|
||||
|
||||
|
||||
gboolean CodeView::CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data)
|
||||
{
|
||||
CodeView * self = reinterpret_cast<CodeView*>(data);
|
||||
|
||||
//EDN_INFO("displayDraw_cb");
|
||||
# ifdef USE_GTK_VERSION_3_0
|
||||
GtkAllocation allocation;
|
||||
gtk_widget_get_allocation(widget, &allocation);
|
||||
bool needRedrawAll = false;
|
||||
if (self->m_shawableAreaX != allocation.width) {
|
||||
needRedrawAll = true;
|
||||
self->m_shawableAreaX = allocation.width;
|
||||
}
|
||||
if (self->m_shawableAreaY != allocation.height) {
|
||||
needRedrawAll = true;
|
||||
self->m_shawableAreaY = allocation.height;
|
||||
}
|
||||
# elif defined( USE_GTK_VERSION_2_0)
|
||||
bool needRedrawAll = false;
|
||||
if (self->m_shawableAreaX != widget->allocation.width) {
|
||||
needRedrawAll = true;
|
||||
self->m_shawableAreaX = widget->allocation.width;
|
||||
}
|
||||
if (self->m_shawableAreaY != widget->allocation.height) {
|
||||
needRedrawAll = true;
|
||||
self->m_shawableAreaY = widget->allocation.height;
|
||||
}
|
||||
# endif
|
||||
if (true == needRedrawAll) {
|
||||
//updateScrollElement();
|
||||
self->m_bufferManager->Get(self->m_bufferID)->ForceReDraw(true);
|
||||
}
|
||||
EDN_INFO("Request a display of : " << self->m_shawableAreaX << "px * "<< self->m_shawableAreaY<<"px");
|
||||
/*
|
||||
EDN_INFO("widget width=%d", widget->allocation.width);
|
||||
EDN_INFO("widget height=%d", widget->allocation.height);
|
||||
*/
|
||||
|
||||
//EDN_INFO("BufferView Display");
|
||||
// Get the color Manager :
|
||||
ColorizeManager *myColorManager = NULL;
|
||||
myColorManager = ColorizeManager::getInstance();
|
||||
|
||||
//(void)m_bufferManager->Get(m_bufferID)->Display(m_displayParameters, m_shawableAreaX, m_shawableAreaY);
|
||||
DrawerManager monDrawer(widget, self->m_shawableAreaX, self->m_shawableAreaY);
|
||||
//EDN_INFO("Display buffer ID = " << m_bufferID);
|
||||
(void)self->m_bufferManager->Get(self->m_bufferID)->Display(monDrawer);
|
||||
// EDN_WARNING("Must display here ... ");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// sur : émis lors du premier affichage de la GtkDrawingArea
|
||||
gboolean CodeView::CB_displayInit( GtkWidget *widget, gpointer data)
|
||||
{
|
||||
CodeView * self = reinterpret_cast<CodeView*>(data);
|
||||
# ifdef USE_GTK_VERSION_3_0
|
||||
GtkAllocation allocation;
|
||||
gtk_widget_get_allocation(widget, &allocation);
|
||||
int32_t size_x = allocation.width;
|
||||
int32_t size_y = allocation.height;
|
||||
|
||||
self->m_shawableAreaX = allocation.width;
|
||||
self->m_shawableAreaY = allocation.height;
|
||||
# elif defined( USE_GTK_VERSION_2_0)
|
||||
int32_t size_x = widget->allocation.width;
|
||||
int32_t size_y = widget->allocation.height;
|
||||
|
||||
self->m_shawableAreaX = widget->allocation.width;
|
||||
self->m_shawableAreaY = widget->allocation.height;
|
||||
# endif
|
||||
EDN_INFO("Request a diplay of : "<< size_x <<"px * "<< size_y <<"px");
|
||||
|
||||
gtk_widget_queue_draw( widget );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gint CodeView::CB_focusGet( GtkWidget *widget, GdkEventFocus *event, gpointer data)
|
||||
{
|
||||
CodeView * self = reinterpret_cast<CodeView*>(data);
|
||||
# ifdef USE_GTK_VERSION_2_0
|
||||
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
|
||||
# endif
|
||||
self->SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, self->m_bufferID);
|
||||
EDN_INFO("Focus - In");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gint CodeView::CB_focusLost( GtkWidget *widget, GdkEventFocus *event, gpointer data)
|
||||
{
|
||||
//CodeView * self = reinterpret_cast<CodeView*>(data);
|
||||
|
||||
# ifdef USE_GTK_VERSION_2_0
|
||||
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
|
||||
# endif
|
||||
EDN_INFO("Focus - out");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gint CodeView::CB_keyboardEvent(GtkWidget *widget, GdkEventKey *event, gpointer data)
|
||||
{
|
||||
CodeView * self = reinterpret_cast<CodeView*>(data);
|
||||
|
||||
char Utf8Out[10];
|
||||
bool controlKey;
|
||||
bool moveKey;
|
||||
int32_t key;
|
||||
// Convert input key :
|
||||
ConvertInput(event, Utf8Out, controlKey, moveKey, key);
|
||||
|
||||
if(event->type == GDK_KEY_PRESS) {
|
||||
if(false==controlKey) {
|
||||
self->m_bufferManager->Get(self->m_bufferID)->AddChar(Utf8Out);
|
||||
gtk_widget_queue_draw( widget );
|
||||
} else if (true == moveKey) {
|
||||
self->m_bufferManager->Get(self->m_bufferID)->cursorMove(key);
|
||||
gtk_widget_queue_draw( widget );
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
gint CodeView::CB_mouseButtonEvent(GtkWidget *widget, GdkEventButton *event, gpointer data)
|
||||
{
|
||||
|
||||
CodeView * self = reinterpret_cast<CodeView*>(data);
|
||||
|
||||
// get focus on the widget
|
||||
gtk_widget_grab_focus(widget);
|
||||
if (event->button == 1) {
|
||||
if (event->type == GDK_BUTTON_PRESS) {
|
||||
//EDN_INFO("mouse-event BT1 ==> One Clicked %d, %d", (uint32_t)event->x, (uint32_t)event->y);
|
||||
self->m_bufferManager->Get(self->m_bufferID)->MouseEvent(event->x, event->y);
|
||||
gtk_widget_queue_draw( widget );
|
||||
self->m_buttunOneSelected = true;
|
||||
}else if (event->type == GDK_2BUTTON_PRESS) {
|
||||
//EDN_INFO("mouse-event BT1 ==> Double Clicked %d, %d", (uint32_t)event->x, (uint32_t)event->y);
|
||||
self->m_bufferManager->Get(self->m_bufferID)->MouseEventDouble();
|
||||
gtk_widget_queue_draw( widget );
|
||||
self->m_buttunOneSelected = true;
|
||||
}else if (event->type == GDK_3BUTTON_PRESS) {
|
||||
//EDN_INFO("mouse-event BT1 ==> Triple Clicked");
|
||||
self->m_bufferManager->Get(self->m_bufferID)->MouseEventTriple();
|
||||
gtk_widget_queue_draw( widget );
|
||||
self->m_buttunOneSelected = true;
|
||||
}else if (event->type == GDK_BUTTON_RELEASE) {
|
||||
//EDN_INFO("mouse-event BT1 ==> Realease");
|
||||
self->m_buttunOneSelected = false;
|
||||
self->m_bufferManager->Get(self->m_bufferID)->Copy(COPY_MIDDLE_BUTTON);
|
||||
}
|
||||
} else if (event->button == 2) {
|
||||
if (event->type == GDK_BUTTON_PRESS) {
|
||||
EDN_INFO("mouse-event BT2 PRESS");
|
||||
self->m_bufferManager->Get(self->m_bufferID)->MouseEvent(event->x, event->y);
|
||||
self->m_bufferManager->Get(self->m_bufferID)->Paste(COPY_MIDDLE_BUTTON);
|
||||
gtk_widget_queue_draw(widget);
|
||||
}
|
||||
} else if (event->button == 3) {
|
||||
if (event->type == GDK_BUTTON_PRESS) {
|
||||
EDN_INFO("mouse-event BT3 PRESS");
|
||||
}
|
||||
} else {
|
||||
EDN_INFO("mouse-event BT" << event->type <<" PRESS");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
gint CodeView::CB_mouseMotionEvent( GtkWidget *widget, GdkEventMotion *event, gpointer data)
|
||||
{
|
||||
CodeView * self = reinterpret_cast<CodeView*>(data);
|
||||
|
||||
if (true == self->m_buttunOneSelected) {
|
||||
int x, y;
|
||||
GdkModifierType state;
|
||||
|
||||
if (event->is_hint) {
|
||||
gdk_window_get_pointer(event->window, &x, &y, &state);
|
||||
} else {
|
||||
x = event->x;
|
||||
y = event->y;
|
||||
state = (GdkModifierType)event->state;
|
||||
}
|
||||
if (x<0) {
|
||||
x = 0;
|
||||
}
|
||||
if (y<0) {
|
||||
y = 0;
|
||||
}
|
||||
//EDN_INFO("mouse-motion BT1 %d, %d", x, y);
|
||||
self->m_bufferManager->Get(self->m_bufferID)->MouseSelectFromCursorTo(x, y);
|
||||
gtk_widget_queue_draw( widget );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
gint CodeView::CB_mouseScrollEvent( GtkWidget *widget, GdkEventScroll *event, gpointer data)
|
||||
{
|
||||
CodeView * self = reinterpret_cast<CodeView*>(data);
|
||||
|
||||
if (event->direction == GDK_SCROLL_UP)
|
||||
{
|
||||
// up code
|
||||
//EDN_INFO("mouse-event GDK_SCROLL_UP");
|
||||
self->m_bufferManager->Get(self->m_bufferID)->ScrollUp();
|
||||
gtk_widget_queue_draw( widget );
|
||||
}
|
||||
else if (event->direction == GDK_SCROLL_DOWN)
|
||||
{
|
||||
// down code
|
||||
//EDN_INFO("mouse-event GDK_SCROLL_DOWN");
|
||||
self->m_bufferManager->Get(self->m_bufferID)->ScrollDown();
|
||||
gtk_widget_queue_draw( widget );
|
||||
} else {
|
||||
EDN_INFO("mouse-event SCROLL");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -1,59 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file Search.h
|
||||
* @brief Editeur De N'ours : Search system (header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 03/01/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef __SEARCH_H__
|
||||
#define __SEARCH_H__
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "Singleton.h"
|
||||
|
||||
|
||||
|
||||
class MainAreaView: public Singleton<MainAreaView>
|
||||
{
|
||||
friend class Singleton<MainAreaView>;
|
||||
// specific for sigleton system...
|
||||
private:
|
||||
// Constructeur
|
||||
MainAreaView(void);
|
||||
~MainAreaView(void);
|
||||
|
||||
public:
|
||||
GtkWidget * GetWidget(void);
|
||||
void SplitV(void); // split current window vertically (max 1 by section)
|
||||
void SplitH(void); // split current window horizontaly (max 3)
|
||||
void Remove(void); // remove current selected element
|
||||
//ViewArea * GetCurent(void); // Get a pointer on the current displayed area
|
||||
|
||||
|
||||
private:
|
||||
GtkWidget * m_localDialog; //!< local dialog element
|
||||
ViewArea * m_EntrySearch[6];
|
||||
uint8_t m_CurentSelected
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
143
Sources/init.cpp
143
Sources/init.cpp
@@ -1,143 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file init.cpp
|
||||
* @brief Editeur De N'ours : main fonction
|
||||
* @author Edouard DUPIN
|
||||
* @date 26/01/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "tools_globals.h"
|
||||
#include "Display.h"
|
||||
#include "BufferManager.h"
|
||||
#include "ColorizeManager.h"
|
||||
#include "HighlightManager.h"
|
||||
#include "ClipBoard.h"
|
||||
#include <string>
|
||||
#include "WindowsManager.h"
|
||||
#include "Search.h"
|
||||
#include <unistd.h>
|
||||
#include "readtags.h"
|
||||
#include "CTagsManager.h"
|
||||
|
||||
|
||||
#include "Edn.h"
|
||||
|
||||
|
||||
/**
|
||||
* @brief Main start function of the system
|
||||
*
|
||||
* @param[in] argc number of argument when called
|
||||
* @param[in] argv sus nomer arguments
|
||||
*
|
||||
* @return EXIT_SUCCESS, all time
|
||||
*
|
||||
*/
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
EDN_INFO("Start Edn");
|
||||
|
||||
//Edn::TestUntaire_String();
|
||||
//return 0;
|
||||
|
||||
|
||||
// Use and remove GTK arguments from the application argument list.
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
// init internal global value
|
||||
globals::init();
|
||||
ClipBoard::Init();
|
||||
Display::Init();
|
||||
|
||||
|
||||
// init ALL Singleton :
|
||||
(void)MsgBroadcastCore::getInstance();
|
||||
(void)AccelKey::getInstance();
|
||||
(void)WindowsManager::getInstance();
|
||||
(void)CTagsManager::getInstance();
|
||||
BufferManager *myBufferManager = BufferManager::getInstance();
|
||||
|
||||
// set color and other trucs...
|
||||
ColorizeManager *myColorManager = NULL;
|
||||
myColorManager = ColorizeManager::getInstance();
|
||||
Edn::String homedir;
|
||||
//homedir = getenv("HOME");
|
||||
#ifdef NDEBUG
|
||||
homedir = "/usr/share/edn/";
|
||||
#else
|
||||
homedir = "./data/";
|
||||
#endif
|
||||
//homedir += "color_black.xml";
|
||||
homedir += "color_white.xml";
|
||||
myColorManager->LoadFile( homedir.c_str() );
|
||||
myColorManager->DisplayListOfColor();
|
||||
|
||||
HighlightManager *myHighlightManager = NULL;
|
||||
myHighlightManager = HighlightManager::getInstance();
|
||||
myHighlightManager->loadLanguages();
|
||||
|
||||
// open display
|
||||
MsgBroadcastCore::getInstance()->SendMessage(NULL, EDN_MSG__GUI_SHOW_MAIN_WINDOWS);
|
||||
|
||||
// get the curent program folder
|
||||
char cCurrentPath[FILENAME_MAX];
|
||||
if (!getcwd(cCurrentPath, FILENAME_MAX)) {
|
||||
return -1;
|
||||
}
|
||||
cCurrentPath[FILENAME_MAX - 1] = '\0';
|
||||
//EDN_INFO("The current working directory is " << cCurrentPath);
|
||||
|
||||
|
||||
// add files
|
||||
EDN_INFO("show list of files : ");
|
||||
for( int32_t i=1 ; i<argc; i++) {
|
||||
EDN_INFO("need load file : \"" << argv[i] << "\"" );
|
||||
Edn::File myfile = (char *)argv[i];
|
||||
|
||||
if (false == myBufferManager->Exist(myfile) ) {
|
||||
int32_t idBuffOpened = myBufferManager->Open(myfile);
|
||||
if (1==i) {
|
||||
MsgBroadcastCore::getInstance()->SendMessage(NULL, EDN_MSG__CURRENT_CHANGE_BUFFER_ID, idBuffOpened);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EDN_INFO("Start gtk main");
|
||||
gtk_main();
|
||||
EDN_INFO("Stop gtk main");
|
||||
|
||||
//Kill all singleton
|
||||
EDN_INFO("Stop BufferManager");
|
||||
BufferManager::kill();
|
||||
EDN_INFO("Stop ColorizeManager");
|
||||
ColorizeManager::kill();
|
||||
EDN_INFO("Stop Search");
|
||||
Search::kill();
|
||||
EDN_INFO("Stop Accel key");
|
||||
AccelKey::kill();
|
||||
EDN_INFO("Stop Display");
|
||||
Display::UnInit();
|
||||
|
||||
|
||||
|
||||
EDN_INFO("Stop Edn");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
@@ -1,626 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file Display.cpp
|
||||
* @brief Editeur De N'ours : Basic Pixbuf display function
|
||||
* @author Edouard DUPIN
|
||||
* @date 21/01/2010
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "tools_globals.h"
|
||||
#include "Display.h"
|
||||
#include "ColorizeManager.h"
|
||||
#include "charset.h"
|
||||
#include <string>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "Display"
|
||||
|
||||
|
||||
#define FONT_BOLD_NO (0)
|
||||
#define FONT_BOLD_YES (1)
|
||||
#define FONT_ITALIC_NO (0)
|
||||
#define FONT_ITALIC_YES (1)
|
||||
|
||||
|
||||
// Variables privé du namespace
|
||||
#define POLICE_NAME "Monospace"
|
||||
|
||||
#ifdef USE_GTK_VERSION_3_0
|
||||
#define POLICE_SIZE 15
|
||||
static int32_t m_pangoFontWidth = 9;
|
||||
static int32_t m_pangoFontHeight = 19;
|
||||
#elif USE_GTK_VERSION_2_0
|
||||
#define POLICE_SIZE 12
|
||||
static int32_t m_pangoFontWidth = 7;
|
||||
static int32_t m_pangoFontHeight = 15;
|
||||
#endif
|
||||
/*
|
||||
#define POLICE_SIZE 11
|
||||
static int32_t m_pangoFontWidth = 7;
|
||||
static int32_t m_pangoFontHeight = 11;
|
||||
static cairo_font_face_t * m_cairoFont[2][2] = {{NULL, NULL},{ NULL, NULL}};
|
||||
*/
|
||||
static cairo_font_face_t * m_cairoFont[2][2] = {{NULL, NULL},{ NULL, NULL}};
|
||||
void Display::Init(void)
|
||||
{
|
||||
m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_NO] = cairo_toy_font_face_create(POLICE_NAME, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
|
||||
m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_NO] = cairo_toy_font_face_create(POLICE_NAME, CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_WEIGHT_NORMAL);
|
||||
m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_YES] = cairo_toy_font_face_create(POLICE_NAME, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
|
||||
m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_YES] = cairo_toy_font_face_create(POLICE_NAME, CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_WEIGHT_BOLD);
|
||||
if ( NULL == m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_NO]) {
|
||||
EDN_ASSERT(FALSE, "basic font ERROR");
|
||||
}
|
||||
if ( NULL == m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_NO]) {
|
||||
EDN_ERROR("Italic font error ... link with basic font");
|
||||
m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_NO] = m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_NO];
|
||||
}
|
||||
if ( NULL == m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_YES]) {
|
||||
EDN_ERROR("Bold font error ... link with basic font");
|
||||
m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_YES] = m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_NO];
|
||||
}
|
||||
if ( NULL == m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_YES]) {
|
||||
EDN_ERROR("Italic & Bold font error ... link with basic font");
|
||||
m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_YES] = m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_NO];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void Display::UnInit(void)
|
||||
{
|
||||
// clean the builder...
|
||||
cairo_font_face_destroy(m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_NO]);
|
||||
cairo_font_face_destroy(m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_NO]);
|
||||
cairo_font_face_destroy(m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_YES]);
|
||||
cairo_font_face_destroy(m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_YES]);
|
||||
}
|
||||
|
||||
|
||||
int32_t Display::GetFontHeight(void)
|
||||
{
|
||||
return m_pangoFontHeight;
|
||||
}
|
||||
|
||||
int32_t Display::GetFontWidth(void)
|
||||
{
|
||||
return m_pangoFontWidth;
|
||||
}
|
||||
|
||||
|
||||
|
||||
cairo_font_face_t * Display::GetFont(bool bold, bool italic)
|
||||
{
|
||||
if( false == bold
|
||||
&& false == italic) {
|
||||
return m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_NO];
|
||||
} else if( true == bold
|
||||
&& false == italic) {
|
||||
return m_cairoFont[FONT_ITALIC_NO][FONT_BOLD_YES];
|
||||
} else if ( false == bold
|
||||
&& true == italic) {
|
||||
return m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_NO];
|
||||
}
|
||||
return m_cairoFont[FONT_ITALIC_YES][FONT_BOLD_YES];
|
||||
}
|
||||
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "DrawerManager"
|
||||
|
||||
/**
|
||||
* @brief DrawerManager constructor : generate a memoryDC where we can draw everything...
|
||||
*
|
||||
* @param [in] window Current windows where the memoryDC must be paint
|
||||
* @param [in] x Current width of the Display
|
||||
* @param [in] y Current Height of the Display
|
||||
*
|
||||
* @note : No exeption
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
DrawerManager::DrawerManager(GtkWidget * widget, int32_t x, int32_t y)
|
||||
{
|
||||
|
||||
m_size.x = x;
|
||||
m_size.y = y;
|
||||
m_haveWork = false;
|
||||
// Create the Cairo Element
|
||||
# if USE_GTK_VERSION_3_0
|
||||
m_cairo = gdk_cairo_create(gtk_widget_get_window(widget));
|
||||
# elif USE_GTK_VERSION_2_0
|
||||
m_cairo = gdk_cairo_create(widget->window);
|
||||
# endif
|
||||
//cairo_translate(m_cairo, 0, 7);
|
||||
cairo_set_source_rgb(m_cairo, 0, 0, 0);
|
||||
cairo_paint(m_cairo);
|
||||
cairo_set_font_size(m_cairo, POLICE_SIZE);
|
||||
m_dataToDisplay[0] = '\0';
|
||||
|
||||
cairo_scale(m_cairo, 1.0, 1.0);
|
||||
|
||||
// http://cairographics.org/FAQ/#clear_a_surface
|
||||
// http://gtk.developpez.com/faq/?page=gtkwidget#GTK_WIDGET_transparent
|
||||
//cairo_set_source_rgba(m_cairo, 1, 1, 1, 0);
|
||||
//cairo_set_operator(m_cairo, CAIRO_OPERATOR_SOURCE);
|
||||
//cairo_paint(m_cairo);
|
||||
//cairo_fill(m_cairo);
|
||||
//cairo_stroke (m_cairo);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief main DrawerManager destructor : Copy data on the curent screen
|
||||
*
|
||||
* @param ---
|
||||
*
|
||||
* @note : No exeption
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
DrawerManager::~DrawerManager()
|
||||
{
|
||||
cairo_destroy(m_cairo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Draw Text with the specify color
|
||||
*
|
||||
* This function does not display the text directly, it save it while a flush appare or the y position differ, or the color differ.
|
||||
* This is for the char by char writing ==> more efficient when we write multiple char.
|
||||
*
|
||||
* @param [in] SelectColor Color that is used to display data
|
||||
* @param [in] x Horizontal position to display data
|
||||
* @param [in] y Vertical position to display data
|
||||
* @param [in] myText Text to write in UTF8 ...
|
||||
* @param [in] displayBG unused
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void DrawerManager::Text(Colorize *SelectColor, int32_t x, int32_t y,const char *myUTF8Text, int32_t len)
|
||||
{
|
||||
EDN_CHECK_INOUT(NULL!=SelectColor);
|
||||
// check if flush is needed :
|
||||
if (true == m_haveWork) {
|
||||
if( m_pos.y != y
|
||||
|| m_selectColor != SelectColor)
|
||||
{
|
||||
Flush();
|
||||
}
|
||||
}
|
||||
|
||||
// check change
|
||||
if (false == m_haveWork) {
|
||||
m_pos.x = x;
|
||||
m_pos.y = y;
|
||||
m_selectColor = SelectColor;
|
||||
}
|
||||
//EDN_WARNING("add data : \"" << myText << "\" x=" << x << " y=" << y );
|
||||
// process :
|
||||
m_haveWork = true;
|
||||
strcat(m_dataToDisplay, myUTF8Text);
|
||||
if (len != -1 ) {
|
||||
m_nbElement+=len;
|
||||
} else {
|
||||
m_nbElement+=strUtf8Len(myUTF8Text);
|
||||
}
|
||||
}
|
||||
|
||||
void DrawerManager::Text(color_ts & SelectColorFg, color_ts & SelectColorBg, int32_t x, int32_t y,const char *myText)
|
||||
{
|
||||
Flush();
|
||||
cairo_set_font_face(m_cairo, Display::GetFont(false, false));
|
||||
int32_t letterHeight = Display::GetFontHeight();
|
||||
int32_t letterWidth = Display::GetFontWidth();
|
||||
DirectRectangle(SelectColorBg, x, y, letterWidth*strlen(myText), letterHeight);
|
||||
cairo_fill(m_cairo);
|
||||
cairo_move_to(m_cairo, x, y+letterHeight-4);
|
||||
cairo_set_source_rgb(m_cairo, SelectColorFg.red, SelectColorFg.green, SelectColorFg.blue);
|
||||
cairo_show_text(m_cairo, myText);
|
||||
cairo_fill(m_cairo);
|
||||
}
|
||||
|
||||
void DrawerManager::Text(color_ts & SelectColorFg, int32_t x, int32_t y,const char *myText)
|
||||
{
|
||||
Flush();
|
||||
cairo_set_font_face(m_cairo, Display::GetFont(false, false));
|
||||
int32_t letterHeight = Display::GetFontHeight();
|
||||
cairo_move_to(m_cairo, x, y+letterHeight-4);
|
||||
cairo_set_source_rgb(m_cairo, SelectColorFg.red, SelectColorFg.green, SelectColorFg.blue);
|
||||
cairo_show_text(m_cairo, myText);
|
||||
cairo_fill(m_cairo);
|
||||
|
||||
}
|
||||
|
||||
void DrawerManager::SpaceText(color_ts & SelectColor, int32_t x, int32_t y,int32_t nbChar)
|
||||
{
|
||||
Flush();
|
||||
int32_t letterHeight = Display::GetFontHeight();
|
||||
int32_t letterWidth = Display::GetFontWidth();
|
||||
DirectRectangle(SelectColor, x, y, letterWidth*nbChar, letterHeight);
|
||||
cairo_fill(m_cairo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Force de display of the curent Text
|
||||
*
|
||||
* The flush is to be more performent with the Pango display methode...
|
||||
*
|
||||
* @param ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void DrawerManager::Flush(void)
|
||||
{
|
||||
if (true == m_haveWork) {
|
||||
//EDN_WARNING("flush : \"" << m_dataToDisplay << "\"" << " bold=" << m_selectColor->GetBold() << " italic=" << m_selectColor->GetItalic());
|
||||
m_haveWork = false;
|
||||
|
||||
cairo_set_font_face(m_cairo, Display::GetFont(m_selectColor->GetBold(), m_selectColor->GetItalic()));
|
||||
int32_t letterHeight = Display::GetFontHeight();
|
||||
if (true == m_selectColor->HaveBg() ) {
|
||||
int32_t letterWidth = Display::GetFontWidth();
|
||||
int32_t stringLen = m_nbElement;
|
||||
// generate Clean BG:
|
||||
DirectRectangle(m_selectColor, m_pos.x, m_pos.y, letterWidth*stringLen, letterHeight);
|
||||
}
|
||||
cairo_move_to(m_cairo, m_pos.x, m_pos.y+letterHeight-4);
|
||||
m_selectColor->ApplyFG(m_cairo);
|
||||
cairo_show_text(m_cairo, m_dataToDisplay);
|
||||
cairo_fill(m_cairo);
|
||||
|
||||
m_dataToDisplay[0] = '\0';
|
||||
m_nbElement = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief display a rectangle with the curent bgColor and no border
|
||||
*
|
||||
* This function in the open API to drow the rectangle, it flush the curent Text in the buffer
|
||||
*
|
||||
* @param [in] SelectColor Color that is used to display rectangle
|
||||
* @param [in] x Horizontal position to display rectangle
|
||||
* @param [in] y Vertical position to display rectangle
|
||||
* @param [in] width Width of the rectangle
|
||||
* @param [in] height Height of the rectangle
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void DrawerManager::Rectangle(Colorize *SelectColor, int32_t x, int32_t y, int32_t width, int32_t height)
|
||||
{
|
||||
Flush();
|
||||
DirectRectangle(SelectColor, x, y, width, height);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Real function to display the rectangle (no flush done (expectially for the Background display)
|
||||
*
|
||||
* @param [in] SelectColor Color that is used to display rectangle
|
||||
* @param [in] x Horizontal position to display rectangle
|
||||
* @param [in] y Vertical position to display rectangle
|
||||
* @param [in] width Width of the rectangle
|
||||
* @param [in] height Height of the rectangle
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void DrawerManager::DirectRectangle(Colorize *SelectColor, int32_t x, int32_t y, int32_t width, int32_t height)
|
||||
{
|
||||
EDN_CHECK_INOUT(NULL!=SelectColor);
|
||||
//EDN_INFO("x="<< x <<" y="<< y <<" width="<< width <<" height="<< height);
|
||||
//gdk_draw_rectangle( p_pixmap, SelectColor->GetColorBG(), TRUE, x, y, width, height);
|
||||
// set color
|
||||
SelectColor->ApplyBG(m_cairo);
|
||||
// set postion
|
||||
cairo_rectangle(m_cairo, x, y, width, height);
|
||||
//cairo_stroke(m_cairo);
|
||||
// flush
|
||||
cairo_fill(m_cairo);
|
||||
}
|
||||
void DrawerManager::DirectRectangle(color_ts &SelectColor, int32_t x, int32_t y, int32_t width, int32_t height)
|
||||
{
|
||||
|
||||
cairo_set_source_rgb(m_cairo, SelectColor.red, SelectColor.green, SelectColor.blue);
|
||||
// set postion
|
||||
cairo_rectangle(m_cairo, x, y, width, height);
|
||||
//cairo_stroke(m_cairo);
|
||||
// flush
|
||||
cairo_fill(m_cairo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Clean the curent Windows with the curent color
|
||||
*
|
||||
* @param [in] SelectColor Color that is used to display background
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void DrawerManager::Clean(Colorize *SelectColor)
|
||||
{
|
||||
m_haveWork = false;
|
||||
DirectRectangle(SelectColor, 0, 0, m_size.x, m_size.y);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clean the curent Windows with the curent color
|
||||
*
|
||||
* @param [in] SelectColor Color that is used to display background
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void DrawerManager::Clean(color_ts & SelectColor)
|
||||
{
|
||||
m_haveWork = false;
|
||||
DirectRectangle(SelectColor, 0, 0, m_size.x, m_size.y);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Display a cursor with the cortect form.
|
||||
*
|
||||
* Automatic selection of the XML color "cursorColor"
|
||||
*
|
||||
* @param [in] x Horizontal position to display cursor
|
||||
* @param [in] y Vertical position to display cursor
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
#define CURSOR_WIDTH (4)
|
||||
void DrawerManager::Cursor(int32_t x, int32_t y)
|
||||
{
|
||||
Flush();
|
||||
// get the cursor Color :
|
||||
color_ts myColor = ColorizeManager::getInstance()->Get(COLOR_CODE_CURSOR);
|
||||
cairo_set_source_rgb(m_cairo, myColor.red, myColor.green, myColor.blue);
|
||||
|
||||
// draw cursor
|
||||
int32_t letterHeight = Display::GetFontHeight();
|
||||
int32_t letterWidth = Display::GetFontWidth();
|
||||
// depending on the inserting mode
|
||||
if (false == globals::IsSetInsert()) {
|
||||
cairo_set_line_width(m_cairo, 2);
|
||||
cairo_move_to(m_cairo, x-CURSOR_WIDTH, y - letterHeight+1);
|
||||
cairo_rel_line_to(m_cairo, CURSOR_WIDTH*2, 0);
|
||||
cairo_rel_move_to(m_cairo, -CURSOR_WIDTH, 0);
|
||||
cairo_rel_line_to(m_cairo, 0, letterHeight-2);
|
||||
cairo_rel_move_to(m_cairo, -CURSOR_WIDTH, 0);
|
||||
cairo_rel_line_to(m_cairo, CURSOR_WIDTH*2, 0);
|
||||
} else {
|
||||
cairo_set_line_width(m_cairo, 1);
|
||||
cairo_move_to(m_cairo, x, y - letterHeight + 1);
|
||||
cairo_rel_line_to(m_cairo, letterWidth, 0);
|
||||
cairo_rel_line_to(m_cairo, 0, letterHeight);
|
||||
cairo_rel_line_to(m_cairo, -letterWidth, 0);
|
||||
cairo_rel_line_to(m_cairo, 0, -letterHeight);
|
||||
}
|
||||
cairo_stroke(m_cairo);
|
||||
cairo_fill(m_cairo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Display a end of the curent line ...
|
||||
*
|
||||
* Automatic draw the end of line with the curent XML color "cursorColor"
|
||||
*
|
||||
* @param [in] x Horizontal position to display cursor
|
||||
* @param [in] y Vertical position to display cursor
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void DrawerManager::EndOfLine(int32_t x, int32_t y)
|
||||
{
|
||||
if (true == globals::IsSetDisplayEndOfLine() ) {
|
||||
Flush();
|
||||
// get the cursor Color :
|
||||
color_ts myColor = ColorizeManager::getInstance()->Get(COLOR_CODE_CURSOR);
|
||||
cairo_set_source_rgb(m_cairo, myColor.red, myColor.green, myColor.blue);
|
||||
// draw cursor
|
||||
int32_t letterHeight = Display::GetFontHeight();
|
||||
// depending on the inserting mode
|
||||
/*
|
||||
x1 x2
|
||||
y1 | |-----
|
||||
| |-----
|
||||
| |
|
||||
y2 | |
|
||||
*/
|
||||
cairo_set_line_width(m_cairo, 2);
|
||||
cairo_move_to(m_cairo, x, y - letterHeight+1);
|
||||
cairo_rel_line_to(m_cairo, 0, letterHeight);
|
||||
cairo_move_to(m_cairo, x+2, y - letterHeight+1);
|
||||
cairo_rel_line_to(m_cairo, 0, letterHeight);
|
||||
cairo_arc(m_cairo, x+3, y - letterHeight/4*3, 3.0, -3.149/2, 3.149/2);
|
||||
cairo_stroke(m_cairo);
|
||||
cairo_fill(m_cairo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Display a Tabulation with the user form selection.
|
||||
*
|
||||
* @param [in] SelectColor Color that is used to display Tabulation
|
||||
* @param [in] x Horizontal position to display cursor
|
||||
* @param [in] y Vertical position to display cursor
|
||||
* @param [in] mbColomn Width of the current Tabulation caracter (in number of Char)
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void DrawerManager::Tabulation(Colorize *SelectColor, int32_t x, int32_t y, int32_t mbColomn)
|
||||
{
|
||||
Flush();
|
||||
int32_t letterWidth = Display::GetFontWidth();
|
||||
int32_t letterHeight = Display::GetFontHeight();
|
||||
|
||||
// generate Clean BG:
|
||||
DirectRectangle(SelectColor, x, y-letterHeight, letterWidth*mbColomn, letterHeight);
|
||||
|
||||
// set the pen for the display
|
||||
SelectColor->ApplyFG(m_cairo);
|
||||
|
||||
uint32_t yCalc = y - (letterHeight+1)/2;
|
||||
|
||||
cairo_move_to(m_cairo, x + 3, yCalc);
|
||||
cairo_line_to(m_cairo, x + letterWidth*mbColomn - 2 , yCalc);
|
||||
cairo_rel_line_to(m_cairo, -6 , -2);
|
||||
cairo_move_to(m_cairo, x + letterWidth*mbColomn - 2 , yCalc);
|
||||
cairo_rel_line_to(m_cairo, -6 , +2);
|
||||
|
||||
cairo_stroke(m_cairo);
|
||||
cairo_fill(m_cairo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Display an unknow UTF8 character (a special rectangle)
|
||||
*
|
||||
* @param [in] SelectColor Color that is used to display Tabulation
|
||||
* @param [in] x Horizontal position to display cursor
|
||||
* @param [in] y Vertical position to display cursor
|
||||
* @param [in] utf8Size number of char used by the UTF8 character
|
||||
* @param [in] ValidUtf8 true if the character UTF8 is well encoded
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void DrawerManager::UTF8UnknownElement(Colorize *SelectColor, int32_t x, int32_t y, int8_t utf8Size, bool ValidUtf8)
|
||||
{
|
||||
Flush();
|
||||
int32_t letterWidth = Display::GetFontWidth();
|
||||
int32_t letterHeight = Display::GetFontHeight();
|
||||
|
||||
// generate Clean BG:
|
||||
DirectRectangle(SelectColor, x, y-letterHeight, letterWidth*2, letterHeight);
|
||||
|
||||
SelectColor->ApplyFG(m_cairo);
|
||||
|
||||
/*
|
||||
y1 y2
|
||||
x1 |-------|
|
||||
| |
|
||||
| |
|
||||
x2 |-------|
|
||||
*/
|
||||
uint32_t x1 = x + 2;
|
||||
uint32_t x2 = x + letterWidth*2 - 2;
|
||||
uint32_t y1 = y - letterHeight + 2;
|
||||
uint32_t y2 = y - 2;
|
||||
// Box
|
||||
cairo_move_to(m_cairo, x1 , y1);
|
||||
cairo_line_to(m_cairo, x2 , y1);
|
||||
cairo_line_to(m_cairo, x2 , y2);
|
||||
cairo_line_to(m_cairo, x1 , y2);
|
||||
cairo_line_to(m_cairo, x1 , y1);
|
||||
// croix in the middle
|
||||
switch(utf8Size)
|
||||
{
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
cairo_line_to(m_cairo, x2 , y2);
|
||||
break;
|
||||
case 3:
|
||||
cairo_move_to(m_cairo, x1 , y2);
|
||||
cairo_line_to(m_cairo, x2 , y1);
|
||||
break;
|
||||
default:
|
||||
cairo_line_to(m_cairo, x2 , y2);
|
||||
cairo_move_to(m_cairo, x1 , y2);
|
||||
cairo_line_to(m_cairo, x2 , y1);
|
||||
break;
|
||||
}
|
||||
if (false == ValidUtf8) {
|
||||
cairo_move_to(m_cairo, x1 , y2-2);
|
||||
cairo_line_to(m_cairo, x2 , y2-2);
|
||||
}
|
||||
cairo_stroke(m_cairo);
|
||||
cairo_fill(m_cairo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Basic axample with cairo and pango...
|
||||
cairo_t *cr;
|
||||
|
||||
cr = gdk_cairo_create(widget->window);
|
||||
|
||||
cairo_translate(cr, 0, 7);
|
||||
|
||||
cairo_set_source_rgb(cr, 0, 0, 0);
|
||||
cairo_paint(cr);
|
||||
|
||||
gint pos = 18;//GTK_CPU(widget)->sel;
|
||||
gint rect = pos / 5;
|
||||
|
||||
cairo_set_source_rgb(cr, 0.2, 0.4, 0);
|
||||
|
||||
gint i;
|
||||
for ( i = 1; i <= 20; i++) {
|
||||
if (i > 20 - rect) {
|
||||
cairo_set_source_rgb(cr, 0.6, 1.0, 0);
|
||||
} else {
|
||||
cairo_set_source_rgb(cr, 0.2, 0.4, 0);
|
||||
}
|
||||
cairo_rectangle(cr, 8, i*4, 30, 3);
|
||||
cairo_rectangle(cr, 42, i*4, 30, 3);
|
||||
cairo_fill(cr);
|
||||
}
|
||||
//----
|
||||
PangoLayout *layout;
|
||||
PangoFontDescription *desc;
|
||||
|
||||
cairo_translate(cr, 10, 20);
|
||||
layout = pango_cairo_create_layout(cr);
|
||||
pango_layout_set_text(layout, "Hello World!", -1);
|
||||
desc = pango_font_description_from_string("Sans Bold 12");
|
||||
pango_layout_set_font_description(layout, desc);
|
||||
pango_font_description_free(desc);
|
||||
|
||||
cairo_set_source_rgb(cr, 0.0, 0.0, 1.0);
|
||||
pango_cairo_update_layout(cr, layout);
|
||||
pango_cairo_show_layout(cr, layout);
|
||||
|
||||
g_object_unref(layout);
|
||||
//-----
|
||||
cairo_destroy(cr);
|
||||
*/
|
@@ -1,93 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file Display.h
|
||||
* @brief Editeur De N'ours : Basic Pixbuf display function (header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 21/01/2010
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef __TOOLS_DISPLAY_H__
|
||||
#define __TOOLS_DISPLAY_H__
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "Colorize.h"
|
||||
#include "ColorizeManager.h"
|
||||
|
||||
|
||||
/**
|
||||
* Basic namespace for the font display system
|
||||
*/
|
||||
namespace Display
|
||||
{
|
||||
void Init(void);
|
||||
void UnInit(void);
|
||||
cairo_font_face_t * GetFont(bool bold, bool italic);
|
||||
int32_t GetFontHeight(void);
|
||||
int32_t GetFontWidth(void);
|
||||
};
|
||||
|
||||
#define MAX_CARACTER_CYCLE (512)
|
||||
/**
|
||||
* class to abstrate the writing on the curent GUI (INTEFACE to be no dependent of the one chosen)
|
||||
*/
|
||||
class DrawerManager;
|
||||
|
||||
class DrawerManager {
|
||||
public:
|
||||
// Constructeur
|
||||
DrawerManager(GtkWidget * widget, int32_t x, int32_t y);
|
||||
~DrawerManager();
|
||||
|
||||
void Rectangle(Colorize *SelectColor, int32_t x, int32_t y, int32_t width, int32_t height);
|
||||
void Rectangle(color_ts & SelectColor, int32_t x, int32_t y, int32_t width, int32_t height) {
|
||||
DirectRectangle(SelectColor, x, y, width, height);
|
||||
}
|
||||
void Clean(Colorize *SelectColor);
|
||||
void Clean(color_ts & SelectColor);
|
||||
void Text(Colorize *SelectColor, int32_t x, int32_t y,const char *myUTF8Text, int32_t len = -1);
|
||||
void Text(color_ts & SelectColorFg, color_ts & SelectColorBg, int32_t x, int32_t y,const char *myText);
|
||||
void Text(color_ts & SelectColorFg, int32_t x, int32_t y,const char *myText);
|
||||
void SpaceText(color_ts & SelectColor, int32_t x, int32_t y,int32_t nbChar);
|
||||
void Cursor(int32_t x, int32_t y);
|
||||
void EndOfLine(int32_t x, int32_t y);
|
||||
void Tabulation(Colorize *SelectColor, int32_t x, int32_t y, int32_t mbColomn);
|
||||
void UTF8UnknownElement(Colorize *SelectColor, int32_t x, int32_t y, int8_t utf8Size, bool ValidUtf8);
|
||||
void Flush(void);
|
||||
int32_t GetWidth(void) { return m_size.x; };
|
||||
int32_t GetHeight(void) { return m_size.y; };
|
||||
|
||||
private:
|
||||
void DirectRectangle(Colorize *SelectColor, int32_t x, int32_t y, int32_t width, int32_t height);
|
||||
void DirectRectangle(color_ts & SelectColor, int32_t x, int32_t y, int32_t width, int32_t height);
|
||||
|
||||
bool m_haveWork; //!< if data might be print (true)
|
||||
char m_dataToDisplay[MAX_CARACTER_CYCLE]; //!< curent string to display
|
||||
uint32_t m_nbElement; //!< nb element in the string
|
||||
position_ts m_pos; //!< position where start the string display (X,Y)
|
||||
Colorize * m_selectColor; //!< curent color to display
|
||||
|
||||
position_ts m_size; //!< Total size
|
||||
cairo_t * m_cairo; //!< Cairo Layout pointer
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -1,85 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file Singleton.h
|
||||
* @brief Editeur De N'ours : singleton system class
|
||||
* @author Edouard DUPIN
|
||||
* @date 04/12/2010
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef __SINGLETON_H__
|
||||
#define __SINGLETON_H__
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Singleton - modèle Singleton applicable à n'importe quelle classe.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template <typename T>
|
||||
class Singleton
|
||||
{
|
||||
protected:
|
||||
// Constructeur/destructeur
|
||||
Singleton() { }
|
||||
~Singleton() { /*std::cout << "destroying singleton." << std::endl;*/ }
|
||||
|
||||
public:
|
||||
// Interface publique
|
||||
static T *getInstance()
|
||||
{
|
||||
if (NULL == _singleton)
|
||||
{
|
||||
/*std::cout << "C: Singleton | creating singleton." << std::endl;*/
|
||||
_singleton = new T;
|
||||
}
|
||||
/*
|
||||
else
|
||||
{
|
||||
std::cout << "C: Singleton | singleton already created!" << std::endl;
|
||||
}
|
||||
*/
|
||||
|
||||
return (static_cast<T*> (_singleton));
|
||||
}
|
||||
|
||||
static void kill()
|
||||
{
|
||||
if (NULL != _singleton)
|
||||
{
|
||||
delete _singleton;
|
||||
_singleton = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
// Unique instance
|
||||
static T *_singleton;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
T *Singleton<T>::_singleton = NULL;
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -1,286 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file MsgBroadcast.cpp
|
||||
* @brief Editeur De N'ours : message beetween thread and GUI elements ... (Souces)
|
||||
* @author Edouard DUPIN
|
||||
* @date 04/02/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "tools_globals.h"
|
||||
#include "MsgBroadcast.h"
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "MsgBroadcast"
|
||||
|
||||
|
||||
MsgBroadcast::MsgBroadcast(const char * className, messageCat_te cat)
|
||||
{
|
||||
m_messageSystem = MsgBroadcastCore::getInstance();
|
||||
m_className = className;
|
||||
m_cat = cat;
|
||||
// add on listner
|
||||
m_messageSystem->AddReceiver(this);
|
||||
}
|
||||
|
||||
MsgBroadcast::~MsgBroadcast(void)
|
||||
{
|
||||
m_messageSystem->RmReceiver(this);
|
||||
m_messageSystem = NULL;
|
||||
}
|
||||
|
||||
void MsgBroadcast::OnMessage(int32_t id, int32_t dataID)
|
||||
{
|
||||
// nothing to do here
|
||||
}
|
||||
|
||||
void MsgBroadcast::SendMessage(messageType_te id, int32_t dataID)
|
||||
{
|
||||
m_messageSystem->SendMessage(this, id, dataID);
|
||||
}
|
||||
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "MsgBroadcastCore"
|
||||
|
||||
|
||||
// need to create a syngleton ...
|
||||
MsgBroadcastCore::MsgBroadcastCore(void)
|
||||
{
|
||||
EDN_INFO("Init broadcast message System : ");
|
||||
m_messageID = 0;
|
||||
}
|
||||
|
||||
MsgBroadcastCore::~MsgBroadcastCore(void)
|
||||
{
|
||||
EDN_INFO("Un-Init broadcast message System : ");
|
||||
}
|
||||
|
||||
#define MACRO_DISPLAY_MSG(data) case data: return (char*)#data ; break;
|
||||
|
||||
static char * GetMessageChar(messageType_te Id)
|
||||
{
|
||||
switch(Id)
|
||||
{
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_CHANGE_CURRENT)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__USER_DISPLAY_CHANGE)
|
||||
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_MAIN_WINDOWS)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_SEARCH)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_PREFERENCE)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_REPLACE)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_OPEN_FILE)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_SAVE_AS)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_GOTO_LINE)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_ABOUT)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__GUI_SHOW_EXIT_CONFIRMATION)
|
||||
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_REMOVE)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_REMOVE_ALL)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_ADD)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_CHANGE_STATE)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_CHANGE_NAME)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_CHANGE_MODIFY)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_CHANGE_HAS_HISTORY)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_CHANGE_HAS_NOT_HISTORY)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_CHANGE_HAS_FUTURE_HISTORY)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__BUFFER_CHANGE_HAS_NOT_FUTURE_HISTORY)
|
||||
|
||||
// create a new buffer
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__NEW)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__BUFF_ALL_SAVE)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__BUFF_ALL_CLOSE)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__BUFF_ID_CLOSE)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__BUFF_ID_SAVE)
|
||||
|
||||
// GUI event for the selected buffer
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_CHANGE_BUFFER_ID)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_SAVE)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_SAVE_AS)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_REMOVE_LINE)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_SELECT_ALL)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_UN_SELECT)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_COPY)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_CUT)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_PASTE)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_FIND_PREVIOUS)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_FIND_OLD_PREVIOUS)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_FIND_NEXT)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_FIND_OLD_NEXT)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_REPLACE)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_REPLACE_ALL)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_CLOSE)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_UNDO)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_REDO)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_GOTO_LINE)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__REFRESH_DISPLAY)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__CURRENT_SET_CHARSET)
|
||||
|
||||
// Ctags MESSAGE :
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__OPEN_CTAGS)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__RELOAD_CTAGS)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__JUMP_TO_CURRENT_SELECTION)
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__JUMP_BACK)
|
||||
|
||||
// HL message :
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__COLOR_HAS_CHANGE)
|
||||
|
||||
// Color message :
|
||||
MACRO_DISPLAY_MSG(EDN_MSG__RELOAD_COLOR_FILE)
|
||||
|
||||
default:
|
||||
return (char*)"??";
|
||||
}
|
||||
}
|
||||
|
||||
static char * GetMessageTypeChar(messageCat_te Id)
|
||||
{
|
||||
switch(Id)
|
||||
{
|
||||
case EDN_CAT_NONE:
|
||||
return (char*)"NONE";
|
||||
case EDN_CAT_GUI:
|
||||
return (char*)"GUI";
|
||||
case EDN_CAT_WORK_AREA:
|
||||
return (char*)"WORK_AREA";
|
||||
case EDN_CAT_SYSTEM:
|
||||
return (char*)"SYSTEM";
|
||||
case EDN_CAT_BUFFER_MANAGER:
|
||||
return (char*)"BUFFER_MANAGER";
|
||||
case EDN_CAT_GUI_MANAGER:
|
||||
return (char*)"GUI_MANAGER";
|
||||
case EDN_CAT_CTAGS:
|
||||
return (char*)"C-TAGS_MANAGER";
|
||||
case EDN_CAT_MENU_CONTEXT:
|
||||
return (char*)"MENU CONTEXT";
|
||||
case EDN_CAT_HL:
|
||||
return (char*)"HIGHT-LIGHT";
|
||||
case EDN_CAT_COLOR:
|
||||
return (char*)"COLOR";
|
||||
default:
|
||||
return (char*)"??";
|
||||
}
|
||||
}
|
||||
|
||||
void MsgBroadcastCore::SendMessage(MsgBroadcast * pointerOnSender, messageType_te id, int32_t dataID)
|
||||
{
|
||||
// Add message on the list :
|
||||
messageElement_ts myStructMessage;
|
||||
messageCat_te catDest = EDN_CAT_NONE;
|
||||
|
||||
|
||||
// DESTINATION : GUI_MANAGER
|
||||
if( MSG_TO_GUI_MANAGER__START <= id
|
||||
&& MSG_TO_GUI_MANAGER__STOP >= id )
|
||||
{
|
||||
catDest = EDN_CAT_GUI_MANAGER;
|
||||
} else if( MSG_TO_GUI__START <= id
|
||||
&& MSG_TO_GUI__STOP >= id )
|
||||
{
|
||||
catDest = EDN_CAT_GUI;
|
||||
} else if( MSG_TO_BUFFER_MANAGER__START <= id
|
||||
&& MSG_TO_BUFFER_MANAGER__STOP >= id )
|
||||
{
|
||||
catDest = EDN_CAT_BUFFER_MANAGER;
|
||||
} else if( MSG_TO_WORKING_AREA__START <= id
|
||||
&& MSG_TO_WORKING_AREA__STOP >= id )
|
||||
{
|
||||
catDest = EDN_CAT_WORK_AREA;
|
||||
} else if( MSG_TO_SYSTEM__START <= id
|
||||
&& MSG_TO_SYSTEM__STOP >= id )
|
||||
{
|
||||
catDest = EDN_CAT_SYSTEM;
|
||||
} else if( MSG_TO_CTAGS__START <= id
|
||||
&& MSG_TO_CTAGS__STOP >= id )
|
||||
{
|
||||
catDest = EDN_CAT_CTAGS;
|
||||
} else if( MSG_TO_CONTEXT__START <= id
|
||||
&& MSG_TO_CONTEXT__STOP >= id )
|
||||
{
|
||||
catDest = EDN_CAT_MENU_CONTEXT;
|
||||
} else if( MSG_TO_HL__START <= id
|
||||
&& MSG_TO_HL__STOP >= id )
|
||||
{
|
||||
catDest = EDN_CAT_HL;
|
||||
} else if( MSG_TO_COLOR__START <= id
|
||||
&& MSG_TO_COLOR__STOP >= id )
|
||||
{
|
||||
catDest = EDN_CAT_COLOR;
|
||||
}
|
||||
|
||||
myStructMessage.localMessageID = m_messageID++;
|
||||
if (NULL == pointerOnSender) {
|
||||
EDN_INFO("#" << myStructMessage.localMessageID << " From \"NULL\" CAT=" << GetMessageTypeChar(catDest) << " id=" << id << "=\"" << GetMessageChar(id) << "\" dataID=" << dataID);
|
||||
} else {
|
||||
EDN_INFO("#" << myStructMessage.localMessageID << " From \"" << pointerOnSender->GetName().c_str() << "\" CAT=" << GetMessageTypeChar(catDest) << " id=" << id << "=\"" << GetMessageChar(id) << "\" dataID=" << dataID);
|
||||
}
|
||||
myStructMessage.msgCatDest = catDest;
|
||||
myStructMessage.msgId = id;
|
||||
myStructMessage.data = dataID;
|
||||
m_listOfMessage.PushBack(myStructMessage);
|
||||
|
||||
|
||||
if (m_listOfMessage.Size() > 1 ) {
|
||||
// we are curently in message processing ==> wait end to process this message
|
||||
return;
|
||||
}
|
||||
// send message on system :
|
||||
while (m_listOfMessage.Size() > 0) {
|
||||
for (int32_t i=0 ; i<m_listMessage.Size() ; i++) {
|
||||
if( EDN_CAT_NONE == m_listOfMessage[0].msgCatDest
|
||||
|| m_listOfMessage[0].msgCatDest == m_listMessage[i]->GetCat())
|
||||
{
|
||||
EDN_INFO(" #" << m_listOfMessage[0].localMessageID << " ==> process In :\"" << m_listMessage[i]->GetName().c_str() << "\" ");
|
||||
m_listMessage[i]->OnMessage(m_listOfMessage[0].msgId, m_listOfMessage[0].data);
|
||||
}
|
||||
}
|
||||
m_listOfMessage.Erase(0);
|
||||
}
|
||||
}
|
||||
|
||||
void MsgBroadcastCore::AddReceiver(MsgBroadcast * pointerOnReceiver)
|
||||
{
|
||||
for (int32_t i=0 ; i<m_listMessage.Size() ; i++) {
|
||||
if (m_listMessage[i] == pointerOnReceiver) {
|
||||
// nothing to do ...
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_listMessage.PushBack(pointerOnReceiver);
|
||||
EDN_INFO("Add a listner for the broadCast messages : \"" << pointerOnReceiver->GetName().c_str() << "\"");
|
||||
}
|
||||
|
||||
|
||||
void MsgBroadcastCore::RmReceiver(MsgBroadcast * pointerOnReceiver)
|
||||
{
|
||||
for (int32_t i=0 ; i<m_listMessage.Size() ; i++) {
|
||||
if (m_listMessage[i] == pointerOnReceiver) {
|
||||
m_listMessage.Erase(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void GeneralSendMessage(messageType_te id, int32_t dataID)
|
||||
{
|
||||
MsgBroadcastCore::getInstance()->SendMessage(NULL, id, dataID);
|
||||
}
|
@@ -1,216 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file MsgBroadcast.h
|
||||
* @brief Editeur De N'ours : message beetween thread and GUI elements ... (header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 04/02/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef __MSG_BROADCAST_H__
|
||||
#define __MSG_BROADCAST_H__
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "Edn.h"
|
||||
#include "Singleton.h"
|
||||
|
||||
|
||||
|
||||
// broadCast Message
|
||||
|
||||
// Message to prevent the curent thread that Buffer has changed
|
||||
// the ID we'll use to identify our event
|
||||
typedef enum {
|
||||
EDN_MSG__NONE = 0,
|
||||
EDN_MSG__BUFFER_CHANGE_CURRENT, // set the new current BUFFER ...
|
||||
EDN_MSG__USER_DISPLAY_CHANGE, // User change the display ==> need to reload all the display depending on color internal
|
||||
|
||||
// DESTINATION : GUI_MANAGER
|
||||
MSG_TO_GUI_MANAGER__START,
|
||||
// GUI windows openning and closing
|
||||
EDN_MSG__GUI_SHOW_MAIN_WINDOWS,
|
||||
EDN_MSG__GUI_SHOW_SEARCH,
|
||||
EDN_MSG__GUI_SHOW_PREFERENCE,
|
||||
EDN_MSG__GUI_SHOW_REPLACE,
|
||||
EDN_MSG__GUI_SHOW_OPEN_FILE,
|
||||
EDN_MSG__GUI_SHOW_SAVE_AS,
|
||||
EDN_MSG__GUI_SHOW_GOTO_LINE,
|
||||
EDN_MSG__GUI_SHOW_ABOUT,
|
||||
EDN_MSG__GUI_SHOW_EXIT_CONFIRMATION,
|
||||
MSG_TO_GUI_MANAGER__STOP,
|
||||
|
||||
// DESTINATION : GUI
|
||||
// generate by the current buffer to said the buffer has changing
|
||||
MSG_TO_GUI__START,
|
||||
EDN_MSG__BUFFER_REMOVE,
|
||||
EDN_MSG__BUFFER_REMOVE_ALL,
|
||||
EDN_MSG__BUFFER_ADD,
|
||||
EDN_MSG__BUFFER_CHANGE_STATE,
|
||||
EDN_MSG__BUFFER_CHANGE_NAME,
|
||||
EDN_MSG__BUFFER_CHANGE_MODIFY,
|
||||
EDN_MSG__BUFFER_CHANGE_HAS_HISTORY,
|
||||
EDN_MSG__BUFFER_CHANGE_HAS_NOT_HISTORY,
|
||||
EDN_MSG__BUFFER_CHANGE_HAS_FUTURE_HISTORY,
|
||||
EDN_MSG__BUFFER_CHANGE_HAS_NOT_FUTURE_HISTORY,
|
||||
MSG_TO_GUI__STOP,
|
||||
|
||||
// DESTINATION : Buffer MANAGER
|
||||
MSG_TO_BUFFER_MANAGER__START,
|
||||
// create a new buffer
|
||||
EDN_MSG__NEW,
|
||||
// Event For All buffer ==> goto the buffer MANAGER
|
||||
EDN_MSG__BUFF_ALL_SAVE,
|
||||
EDN_MSG__BUFF_ALL_CLOSE,
|
||||
// Event For Specific Buffer ID : ==> GOTO the buffer MANAGER
|
||||
EDN_MSG__BUFF_ID_CLOSE,
|
||||
EDN_MSG__BUFF_ID_SAVE,
|
||||
MSG_TO_BUFFER_MANAGER__STOP,
|
||||
|
||||
// DESTINATION : Working AREA
|
||||
MSG_TO_WORKING_AREA__START,
|
||||
// GUI event for the selected buffer
|
||||
EDN_MSG__CURRENT_CHANGE_BUFFER_ID,
|
||||
EDN_MSG__CURRENT_SAVE,
|
||||
EDN_MSG__CURRENT_SAVE_AS,
|
||||
EDN_MSG__CURRENT_SELECT_ALL,
|
||||
EDN_MSG__CURRENT_REMOVE_LINE,
|
||||
EDN_MSG__CURRENT_UN_SELECT,
|
||||
EDN_MSG__CURRENT_COPY,
|
||||
EDN_MSG__CURRENT_CUT,
|
||||
EDN_MSG__CURRENT_PASTE,
|
||||
EDN_MSG__CURRENT_FIND_PREVIOUS,
|
||||
EDN_MSG__CURRENT_FIND_OLD_PREVIOUS,
|
||||
EDN_MSG__CURRENT_FIND_NEXT,
|
||||
EDN_MSG__CURRENT_FIND_OLD_NEXT,
|
||||
EDN_MSG__CURRENT_REPLACE,
|
||||
EDN_MSG__CURRENT_REPLACE_ALL,
|
||||
EDN_MSG__CURRENT_CLOSE,
|
||||
EDN_MSG__CURRENT_UNDO,
|
||||
EDN_MSG__CURRENT_REDO,
|
||||
EDN_MSG__CURRENT_GOTO_LINE,
|
||||
EDN_MSG__REFRESH_DISPLAY,
|
||||
EDN_MSG__CURRENT_SET_CHARSET,
|
||||
MSG_TO_WORKING_AREA__STOP,
|
||||
|
||||
// DESTINATION : SYSTEM ...
|
||||
MSG_TO_SYSTEM__START,
|
||||
MSG_TO_SYSTEM__STOP,
|
||||
|
||||
|
||||
// DESTINATION : CTAGS ...
|
||||
MSG_TO_CTAGS__START,
|
||||
EDN_MSG__OPEN_CTAGS,
|
||||
EDN_MSG__RELOAD_CTAGS,
|
||||
EDN_MSG__JUMP_TO_CURRENT_SELECTION,
|
||||
EDN_MSG__JUMP_BACK,
|
||||
MSG_TO_CTAGS__STOP,
|
||||
|
||||
// DESTINATION : context popup ...
|
||||
MSG_TO_CONTEXT__START,
|
||||
MSG_TO_CONTEXT__STOP,
|
||||
|
||||
// DESTINATION : highlight system ...
|
||||
MSG_TO_HL__START,
|
||||
EDN_MSG__COLOR_HAS_CHANGE,
|
||||
MSG_TO_HL__STOP,
|
||||
|
||||
// DESTINATION : Color System ...
|
||||
MSG_TO_COLOR__START,
|
||||
EDN_MSG__RELOAD_COLOR_FILE,
|
||||
MSG_TO_COLOR__STOP,
|
||||
|
||||
|
||||
}messageType_te;
|
||||
|
||||
typedef enum {
|
||||
EDN_CAT_NONE,
|
||||
EDN_CAT_GUI,
|
||||
EDN_CAT_WORK_AREA,
|
||||
EDN_CAT_SYSTEM,
|
||||
EDN_CAT_BUFFER_MANAGER,
|
||||
EDN_CAT_GUI_MANAGER,
|
||||
EDN_CAT_CTAGS,
|
||||
EDN_CAT_MENU_CONTEXT,
|
||||
EDN_CAT_HL,
|
||||
EDN_CAT_COLOR,
|
||||
}messageCat_te;
|
||||
|
||||
|
||||
typedef struct {
|
||||
messageType_te msgId;
|
||||
int32_t dataId;
|
||||
}messageData_ts;
|
||||
|
||||
|
||||
class MsgBroadcastCore;
|
||||
|
||||
class MsgBroadcast
|
||||
{
|
||||
private:
|
||||
Edn::String m_className;
|
||||
MsgBroadcastCore * m_messageSystem;
|
||||
messageCat_te m_cat;
|
||||
public:
|
||||
MsgBroadcast(const char * className, messageCat_te cat);
|
||||
virtual ~MsgBroadcast(void);
|
||||
// caul when a message is send
|
||||
virtual void OnMessage(int32_t id, int32_t dataID);
|
||||
Edn::String& GetName(void) { return m_className; };
|
||||
messageCat_te GetCat(void) { return m_cat; };
|
||||
protected :
|
||||
void SendMessage(messageType_te id, int32_t dataID = -1);
|
||||
};
|
||||
|
||||
|
||||
typedef struct {
|
||||
int32_t localMessageID;
|
||||
messageCat_te msgCatDest;
|
||||
messageType_te msgId;
|
||||
int32_t data;
|
||||
}messageElement_ts;
|
||||
|
||||
// need to create a syngleton ...
|
||||
class MsgBroadcastCore: public Singleton<MsgBroadcastCore>
|
||||
{
|
||||
friend class Singleton<MsgBroadcastCore>;
|
||||
// specific for sigleton system...
|
||||
private:
|
||||
// Constructeur
|
||||
MsgBroadcastCore(void);
|
||||
~MsgBroadcastCore(void);
|
||||
public:
|
||||
void SendMessage(MsgBroadcast * pointerOnSender, messageType_te id, int32_t dataID = -1);
|
||||
void AddReceiver(MsgBroadcast * pointerOnReceiver);
|
||||
void RmReceiver(MsgBroadcast * pointerOnReceiver);
|
||||
|
||||
private:
|
||||
Edn::VectorType<MsgBroadcast*> m_listMessage;
|
||||
uint32_t m_messageID;
|
||||
Edn::VectorType<messageElement_ts> m_listOfMessage;
|
||||
};
|
||||
|
||||
|
||||
void GeneralSendMessage(messageType_te id, int32_t dataID = -1);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -1,246 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file File.cpp
|
||||
* @brief Editeur De N'ours : File folder and name abstraction (Sources)
|
||||
* @author Edouard DUPIN
|
||||
* @date 16/07/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "tools_globals.h"
|
||||
#include "Edn.h"
|
||||
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "Edn::File"
|
||||
|
||||
|
||||
std::ostream& Edn::operator <<(std::ostream &os, const Edn::File &obj)
|
||||
{
|
||||
os << obj.m_folder;
|
||||
os << "/";
|
||||
os << obj.m_shortFilename;
|
||||
return os;
|
||||
}
|
||||
|
||||
Edn::File::File(Edn::String &filename, int32_t LineNumber)
|
||||
{
|
||||
m_lineNumberOpen = LineNumber;
|
||||
SetCompleateName(filename);
|
||||
}
|
||||
|
||||
|
||||
Edn::File::File(const char *filename, int32_t LineNumber)
|
||||
{
|
||||
Edn::String tmpString = filename;
|
||||
m_lineNumberOpen = LineNumber;
|
||||
SetCompleateName(tmpString);
|
||||
}
|
||||
|
||||
|
||||
Edn::File::File(Edn::String &filename, Edn::String &folder, int32_t lineNumber)
|
||||
{
|
||||
Edn::String tmpString = folder;
|
||||
tmpString += '/';
|
||||
tmpString += filename;
|
||||
SetCompleateName(tmpString);
|
||||
m_lineNumberOpen = lineNumber;
|
||||
}
|
||||
|
||||
Edn::File::~File(void)
|
||||
{
|
||||
// nothing to do ...
|
||||
}
|
||||
|
||||
|
||||
Edn::String Edn::File::GetFolder(void) const
|
||||
{
|
||||
return m_folder;
|
||||
}
|
||||
|
||||
Edn::String Edn::File::GetShortFilename(void) const
|
||||
{
|
||||
return m_shortFilename;
|
||||
}
|
||||
|
||||
Edn::String Edn::File::GetCompleateName(void) const
|
||||
{
|
||||
Edn::String out;
|
||||
out = m_folder;
|
||||
out += '/';
|
||||
out += m_shortFilename;
|
||||
return out;
|
||||
}
|
||||
|
||||
const Edn::File& Edn::File::operator= (const Edn::File &ednF )
|
||||
{
|
||||
if( this != &ednF ) // avoid copy to itself
|
||||
{
|
||||
m_folder = ednF.m_folder;
|
||||
m_shortFilename = ednF.m_shortFilename;
|
||||
m_lineNumberOpen = ednF.m_lineNumberOpen;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
bool Edn::File::operator== (const Edn::File &ednF) const
|
||||
{
|
||||
if( this != &ednF ) {
|
||||
if (ednF.GetCompleateName() == GetCompleateName() ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
bool Edn::File::operator!= (const Edn::File &ednF) const
|
||||
{
|
||||
return !(*this == ednF);
|
||||
}
|
||||
|
||||
|
||||
void Edn::File::SetCompleateName(Edn::String &newFilename)
|
||||
{
|
||||
char buf[MAX_FILE_NAME];
|
||||
memset(buf, 0, MAX_FILE_NAME);
|
||||
char * ok;
|
||||
// Reset ALL DATA :
|
||||
m_folder = "";
|
||||
m_shortFilename = "";
|
||||
m_lineNumberOpen = 0;
|
||||
EDN_DEBUG("1 :Set Name : " << newFilename );
|
||||
Edn::String destFilename;
|
||||
if (newFilename.Size() == 0) {
|
||||
destFilename = "no-name";
|
||||
} else {
|
||||
destFilename = newFilename;
|
||||
}
|
||||
EDN_DEBUG("2 : Get file Name : " << destFilename );
|
||||
if ('/' != *destFilename.c_str()) {
|
||||
// Get the command came from the running of the program :
|
||||
char cCurrentPath[FILENAME_MAX];
|
||||
if (!getcwd(cCurrentPath, FILENAME_MAX)) {
|
||||
return;
|
||||
}
|
||||
cCurrentPath[FILENAME_MAX - 1] = '\0';
|
||||
Edn::String tmpFilename = destFilename;
|
||||
destFilename = cCurrentPath;
|
||||
destFilename += '/';
|
||||
destFilename += tmpFilename;
|
||||
}
|
||||
EDN_DEBUG("3 : Get file Name : " << destFilename );
|
||||
|
||||
// Get the real Path of the current File
|
||||
ok = realpath(destFilename.c_str(), buf);
|
||||
if (!ok) {
|
||||
int32_t lastPos = destFilename.FindBack('/');
|
||||
if (-1 != lastPos) {
|
||||
// Get the FileName
|
||||
Edn::String tmpFilename = destFilename.Extract(lastPos+1);
|
||||
destFilename.Remove(lastPos, destFilename.Size() - lastPos);
|
||||
EDN_DEBUG("try to find :\"" << destFilename << "\" / \"" << tmpFilename << "\" ");
|
||||
ok = realpath(destFilename.c_str(), buf);
|
||||
if (!ok) {
|
||||
EDN_ERROR("Can not find real Path name of \"" << destFilename << "\"");
|
||||
m_shortFilename = tmpFilename;
|
||||
m_folder = destFilename;
|
||||
} else {
|
||||
// ALL is OK ...
|
||||
m_shortFilename = tmpFilename;
|
||||
m_folder = destFilename;
|
||||
}
|
||||
} else {
|
||||
EDN_WARNING("file : \"" << destFilename << "\" ==> No data???");
|
||||
// Basic ERROR ...
|
||||
m_shortFilename = destFilename;
|
||||
}
|
||||
} else {
|
||||
destFilename = buf;
|
||||
int32_t lastPos = destFilename.FindBack('/');
|
||||
if (-1 != lastPos) {
|
||||
m_shortFilename = destFilename.Extract(lastPos+1);
|
||||
m_folder = destFilename.Extract(0, lastPos);
|
||||
} else {
|
||||
// Basic ERROR ...
|
||||
EDN_WARNING("file : \"" << destFilename << "\" ==> No data???");
|
||||
m_shortFilename = destFilename;
|
||||
}
|
||||
}
|
||||
EDN_DEBUG("Set FileName :\"" << m_folder << "\" / \"" << m_shortFilename << "\" ");
|
||||
}
|
||||
|
||||
int32_t Edn::File::GetLineNumber(void)
|
||||
{
|
||||
return m_lineNumberOpen;
|
||||
}
|
||||
|
||||
void Edn::File::SetLineNumber(int32_t newline)
|
||||
{
|
||||
m_lineNumberOpen = newline;
|
||||
}
|
||||
|
||||
bool Edn::File::HasExtention(void)
|
||||
{
|
||||
int32_t lastPos = m_shortFilename.FindBack('.');
|
||||
if( -1 != lastPos // not find the .
|
||||
&& 0 != lastPos // Find a . at the fist position .jdlskjdfklj ==> hiden file
|
||||
&& m_shortFilename.Size() != lastPos ) // Remove file ended with .
|
||||
{
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Edn::String Edn::File::GetExtention(void)
|
||||
{
|
||||
Edn::String tmpExt = "";
|
||||
int32_t lastPos = m_shortFilename.FindBack('.');
|
||||
if( -1 != lastPos // not find the .
|
||||
&& 0 != lastPos // Find a . at the fist position .jdlskjdfklj ==> hiden file
|
||||
&& m_shortFilename.Size() != lastPos ) // Remove file ended with .
|
||||
{
|
||||
// Get the FileName
|
||||
tmpExt = m_shortFilename.Extract(lastPos+1);
|
||||
}
|
||||
return tmpExt;
|
||||
}
|
@@ -1,66 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file File.h
|
||||
* @brief Editeur De N'ours : File folder and name abstraction (header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 16/07/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef __EDN__FILE_H__
|
||||
#define __EDN__FILE_H__
|
||||
|
||||
#define MAX_FILE_NAME (10240)
|
||||
|
||||
namespace Edn
|
||||
{
|
||||
class File
|
||||
{
|
||||
public:
|
||||
File(void) { m_lineNumberOpen=0; }
|
||||
File(Edn::String &filename, int32_t LineNumber = 0);
|
||||
File(const char *filename, int32_t LineNumber = 0);
|
||||
File(Edn::String &filename, Edn::String &folder, int32_t lineNumber = 0);
|
||||
~File(void);
|
||||
Edn::String GetFolder(void) const;
|
||||
Edn::String GetShortFilename(void) const;
|
||||
Edn::String GetCompleateName(void) const;
|
||||
bool HasExtention(void);
|
||||
Edn::String GetExtention(void);
|
||||
int32_t GetLineNumber(void);
|
||||
void SetLineNumber(int32_t newline);
|
||||
void SetCompleateName(Edn::String &newFilename);
|
||||
|
||||
const Edn::File& operator= (const Edn::File &ednF );
|
||||
bool operator== (const Edn::File &ednF ) const;
|
||||
bool operator!= (const Edn::File &ednF ) const;
|
||||
friend std::ostream& operator <<( std::ostream &os,const Edn::File &obj);
|
||||
|
||||
private :
|
||||
Edn::String m_folder;
|
||||
Edn::String m_shortFilename;
|
||||
int32_t m_lineNumberOpen;
|
||||
};
|
||||
|
||||
std::ostream& operator <<(std::ostream &os, const Edn::File &obj);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -1,488 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file RegExp.cpp
|
||||
* @brief Editeur De N'ours : Regular expression annalyser (sources)
|
||||
* @author Edouard DUPIN
|
||||
* @date 04/04/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "tools_globals.h"
|
||||
#include "toolsMemory.h"
|
||||
#include "RegExp.h"
|
||||
|
||||
|
||||
|
||||
const convertionTable_ts constConvertionTable[] = {
|
||||
// haveBackSlash, inputValue, newValue
|
||||
{ false , '(' , OPCODE_PTHESE_IN},
|
||||
{ true , '(' , (int16_t)'('},
|
||||
{ false , ')' , OPCODE_PTHESE_OUT},
|
||||
{ true , ')' , (int16_t)')'},
|
||||
{ false , '[' , OPCODE_BRACKET_IN},
|
||||
{ true , '[' , (int16_t)'['},
|
||||
{ false , ']' , OPCODE_BRACKET_OUT},
|
||||
{ true , ']' , (int16_t)']'},
|
||||
{ false , '{' , OPCODE_BRACE_IN},
|
||||
{ true , '{' , (int16_t)'{'},
|
||||
{ false , '}' , OPCODE_BRACE_OUT},
|
||||
{ true , '}' , (int16_t)'}'},
|
||||
{ false , '-' , OPCODE_TO},
|
||||
{ true , '-' , (int16_t)'-'},
|
||||
{ false , '*' , OPCODE_STAR},
|
||||
{ true , '*' , (int16_t)'*'},
|
||||
{ false , '.' , OPCODE_DOT},
|
||||
{ true , '.' , (int16_t)'.'},
|
||||
{ false , '?' , OPCODE_QUESTION},
|
||||
{ true , '?' , (int16_t)'?'},
|
||||
{ false , '+' , OPCODE_PLUS},
|
||||
{ true , '+' , (int16_t)'+'},
|
||||
{ false , '|' , OPCODE_PIPE},
|
||||
{ true , '|' , (int16_t)'|'},
|
||||
{ false , '^' , OPCODE_START_OF_LINE},
|
||||
{ true , '^' , (int16_t)'^'},
|
||||
{ false , '$' , OPCODE_END_OF_LINE},
|
||||
{ true , '$' , (int16_t)'$'},
|
||||
{ true , 'd' , OPCODE_DIGIT},
|
||||
{ true , 'D' , OPCODE_DIGIT_NOT},
|
||||
{ true , 'l' , OPCODE_LETTER},
|
||||
{ true , 'L' , OPCODE_LETTER_NOT},
|
||||
{ true , 's' , OPCODE_SPACE},
|
||||
{ true , 'S' , OPCODE_SPACE_NOT},
|
||||
{ true , 'w' , OPCODE_WORD},
|
||||
{ true , 'W' , OPCODE_WORD_NOT},
|
||||
{ true , 'a' , (int16_t)'\a'},
|
||||
{ true , 'b' , (int16_t)'\b'},
|
||||
{ true , 'e' , 0x001B}, // Escape character <Esc>
|
||||
{ true , 'f' , (int16_t)'\f'},
|
||||
{ true , 'n' , (int16_t)'\n'},
|
||||
{ true , 'r' , (int16_t)'\r'},
|
||||
{ true , 't' , (int16_t)'\t'},
|
||||
{ true , 'v' , (int16_t)'\v'},
|
||||
{ true , '\\' , (int16_t)'\\'},
|
||||
{ true , '&' , (int16_t)'&'},
|
||||
{ true , '0' , (int16_t)'\0'},
|
||||
{ true , '@' , OPCODE_NO_CHAR},
|
||||
};
|
||||
const int32_t constConvertionTableSize = sizeof(constConvertionTable) / sizeof(convertionTable_ts) ;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Display the internal data of a node
|
||||
*
|
||||
* @param[in] data element do display in the console
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void DisplayData(Edn::VectorType<char> &data)
|
||||
{
|
||||
int32_t i;
|
||||
for (i=0; i<(int32_t)data.Size() ; i++) {
|
||||
std::cout<< (char)(data[i]&0x00FF );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Display of a part of the Regexp element
|
||||
*
|
||||
* @param[in] data Vector where data is constain
|
||||
* @param[in] start Position where the display might start
|
||||
* @param[in] stop Position where the display might stop
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void DisplayElem(Edn::VectorType<int16_t> &data, int32_t start, int32_t stop)
|
||||
{
|
||||
int32_t i;
|
||||
std::cout<< COLOR_NORMAL;
|
||||
for (i=start; i<(int32_t)data.Size() && i<stop ; i++) {
|
||||
switch(data[i])
|
||||
{
|
||||
case OPCODE_PTHESE_IN: std::cout<<COLOR_RED << (char*)"(" << COLOR_NORMAL; break;
|
||||
case OPCODE_PTHESE_OUT: std::cout<<COLOR_RED << (char*)")" << COLOR_NORMAL; break;
|
||||
case OPCODE_BRACKET_IN: std::cout<<COLOR_YELLOW << (char*)"[" << COLOR_NORMAL; break;
|
||||
case OPCODE_BRACKET_OUT: std::cout<<COLOR_YELLOW << (char*)"]" << COLOR_NORMAL; break;
|
||||
case OPCODE_TO: std::cout<<COLOR_YELLOW << (char*)"-" << COLOR_NORMAL; break;
|
||||
case OPCODE_BRACE_IN: std::cout<<COLOR_GREEN << (char*)"{" << COLOR_NORMAL; break;
|
||||
case OPCODE_BRACE_OUT: std::cout<<COLOR_GREEN << (char*)"}" << COLOR_NORMAL; break;
|
||||
case OPCODE_STAR: std::cout<<COLOR_BLUE << (char*)"*" << COLOR_NORMAL; break;
|
||||
case OPCODE_DOT: std::cout<<COLOR_BLUE << (char*)"." << COLOR_NORMAL; break;
|
||||
case OPCODE_QUESTION: std::cout<<COLOR_BLUE << (char*)"?" << COLOR_NORMAL; break;
|
||||
case OPCODE_PLUS: std::cout<<COLOR_BLUE << (char*)"+" << COLOR_NORMAL; break;
|
||||
case OPCODE_PIPE: std::cout<<COLOR_BLUE << (char*)"|" << COLOR_NORMAL; break;
|
||||
case OPCODE_NO_CHAR: std::cout<<COLOR_MAGENTA << (char*)"@" << COLOR_NORMAL; break;
|
||||
case OPCODE_START_OF_LINE: std::cout<<COLOR_MAGENTA << (char*)"^" << COLOR_NORMAL; break;
|
||||
case OPCODE_END_OF_LINE: std::cout<<COLOR_MAGENTA << (char*)"$" << COLOR_NORMAL; break;
|
||||
case OPCODE_DIGIT: std::cout<<COLOR_MAGENTA << (char*)"\\d" << COLOR_NORMAL; break;
|
||||
case OPCODE_DIGIT_NOT: std::cout<<COLOR_MAGENTA << (char*)"\\D" << COLOR_NORMAL; break;
|
||||
case OPCODE_LETTER: std::cout<<COLOR_MAGENTA << (char*)"\\l" << COLOR_NORMAL; break;
|
||||
case OPCODE_LETTER_NOT: std::cout<<COLOR_MAGENTA << (char*)"\\L" << COLOR_NORMAL; break;
|
||||
case OPCODE_SPACE: std::cout<<COLOR_MAGENTA << (char*)"\\s" << COLOR_NORMAL; break;
|
||||
case OPCODE_SPACE_NOT: std::cout<<COLOR_MAGENTA << (char*)"\\S" << COLOR_NORMAL; break;
|
||||
case OPCODE_WORD: std::cout<<COLOR_MAGENTA << (char*)"\\w" << COLOR_NORMAL; break;
|
||||
case OPCODE_WORD_NOT: std::cout<<COLOR_MAGENTA << (char*)"\\W" << COLOR_NORMAL; break;
|
||||
case '\n': std::cout<<COLOR_MAGENTA << (char*)"\\n" << COLOR_NORMAL; break;
|
||||
case '\t': std::cout<<COLOR_MAGENTA << (char*)"\\t" << COLOR_NORMAL; break;
|
||||
default: std::cout<< (char)(data[i]&0x00FF ); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
char * levelSpace(int32_t level)
|
||||
{
|
||||
switch(level)
|
||||
{
|
||||
case 0: return (char*)"";
|
||||
case 1: return (char*)" ";
|
||||
case 2: return (char*)" ";
|
||||
case 3: return (char*)" ";
|
||||
case 4: return (char*)" ";
|
||||
case 5: return (char*)" ";
|
||||
case 6: return (char*)" ";
|
||||
case 7: return (char*)" ";
|
||||
case 8: return (char*)" ";
|
||||
case 9: return (char*)" ";
|
||||
case 10: return (char*)" ";
|
||||
case 11: return (char*)" ";
|
||||
case 12: return (char*)" ";
|
||||
case 13: return (char*)" ";
|
||||
case 14: return (char*)" ";
|
||||
case 15: return (char*)" ";
|
||||
case 16: return (char*)" ";
|
||||
default: return (char*)" ";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
int32_t GetLenOfPTheseElem(Edn::VectorType<int16_t> &data, int32_t startPos)
|
||||
{
|
||||
int32_t pos = startPos;
|
||||
int32_t nbOpen = 0;
|
||||
// special case of the (...) or | ==> we search '|' or ')'
|
||||
if( OPCODE_PTHESE_OUT == data[pos]
|
||||
|| OPCODE_PIPE == data[pos]) {
|
||||
return 0;
|
||||
}
|
||||
// find size ...
|
||||
while (pos < (int32_t)data.Size() ) {
|
||||
if(OPCODE_PTHESE_IN == data[pos]) {
|
||||
// find a sub section :
|
||||
nbOpen++;
|
||||
} else if(0 < nbOpen) {
|
||||
if (OPCODE_PTHESE_OUT == data[pos])
|
||||
{
|
||||
nbOpen--;
|
||||
if (0 > nbOpen) {
|
||||
EDN_ERROR("Error in the (...) find element at "<< pos);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
} else if( OPCODE_PTHESE_OUT == data[pos]
|
||||
|| OPCODE_PIPE == data[pos])
|
||||
{
|
||||
// Find the end of the (...)
|
||||
// just return the size inside
|
||||
int32_t sizeInside = pos - startPos;
|
||||
if (0 >= sizeInside) {
|
||||
EDN_ERROR("Error in the (...) no data at "<< pos-1);
|
||||
return -1;
|
||||
} else {
|
||||
return sizeInside;
|
||||
}
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
return pos - startPos;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
int32_t GetLenOfPThese(Edn::VectorType<int16_t> &data, int32_t startPos)
|
||||
{
|
||||
int32_t pos = startPos;
|
||||
int32_t nbOpen = 0;
|
||||
// special case of the (...) or | ==> we search '|' or ')'
|
||||
if( OPCODE_PTHESE_OUT == data[pos]) {
|
||||
return 0;
|
||||
} else if( OPCODE_PTHESE_IN == data[pos])
|
||||
{
|
||||
pos++;
|
||||
// find size ...
|
||||
while (pos < (int32_t)data.Size() ) {
|
||||
if(OPCODE_PTHESE_IN == data[pos]) {
|
||||
// find a sub section :
|
||||
nbOpen++;
|
||||
} else if(0 < nbOpen) {
|
||||
if (OPCODE_PTHESE_OUT == data[pos])
|
||||
{
|
||||
nbOpen--;
|
||||
if (0 > nbOpen) {
|
||||
EDN_ERROR("Error in the (...) find element at "<< pos);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
} else if( OPCODE_PTHESE_OUT == data[pos])
|
||||
{
|
||||
// Find the end of the (...)
|
||||
// just return the size inside
|
||||
int32_t sizeInside = pos - startPos-1;
|
||||
if (0 >= sizeInside) {
|
||||
EDN_ERROR("Error in the (...) no data at "<< pos-1);
|
||||
return -1;
|
||||
} else {
|
||||
return sizeInside;
|
||||
}
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
int32_t GetLenOfBracket(Edn::VectorType<int16_t> &data, int32_t startPos)
|
||||
{
|
||||
int32_t pos = startPos;
|
||||
// special case of the (...) or | ==> we search '|' or ')'
|
||||
if( OPCODE_BRACKET_OUT == data[pos]) {
|
||||
return 0;
|
||||
} else if( OPCODE_BRACKET_IN == data[pos]) {
|
||||
pos++;
|
||||
// find size ...
|
||||
while (pos < (int32_t)data.Size() ) {
|
||||
if(OPCODE_BRACKET_OUT == data[pos]) {
|
||||
// Find the end of the [...]
|
||||
// just return the size inside
|
||||
int32_t sizeInside = pos - startPos -1 ;
|
||||
if (0 >= sizeInside) {
|
||||
EDN_ERROR("Error in the [...] no data at "<< pos-1);
|
||||
return sizeInside;
|
||||
} else {
|
||||
return sizeInside;
|
||||
}
|
||||
} else if( OPCODE_TO != data[pos]
|
||||
&& ( 0 > data[pos]
|
||||
|| 0xFF < data[pos]) )
|
||||
{
|
||||
EDN_ERROR("Error in the [...] not permited element at "<< pos << " '" << (char)data[pos] << "'");
|
||||
return false;
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
int32_t GetLenOfBrace(Edn::VectorType<int16_t> &data, int32_t startPos)
|
||||
{
|
||||
int32_t pos = startPos;
|
||||
// special case of the (...) or | ==> we search '|' or ')'
|
||||
if( OPCODE_BRACE_OUT == data[pos]) {
|
||||
return 0;
|
||||
} else if( OPCODE_BRACE_IN == data[pos]) {
|
||||
pos++;
|
||||
// find size ...
|
||||
while (pos < (int32_t)data.Size() ) {
|
||||
if(OPCODE_BRACE_OUT == data[pos]) {
|
||||
// Find the end of the [...]
|
||||
// just return the size inside
|
||||
int32_t sizeInside = pos - startPos -1 ;
|
||||
if (0 >= sizeInside) {
|
||||
EDN_ERROR("Error in the {...} no data at "<< pos-1);
|
||||
return sizeInside;
|
||||
} else {
|
||||
return sizeInside;
|
||||
}
|
||||
} else if( ',' != data[pos]
|
||||
&& ( '0' > data[pos]
|
||||
|| '9' < data[pos]) )
|
||||
{
|
||||
EDN_ERROR("Error in the {...} not permited element at "<< pos << " '" << (char)data[pos] << "'");
|
||||
return false;
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
int32_t GetLenOfNormal(Edn::VectorType<int16_t> &data, int32_t startPos)
|
||||
{
|
||||
int32_t pos = startPos;
|
||||
|
||||
// find size ...
|
||||
while (pos < (int32_t)data.Size() ) {
|
||||
switch(data[pos])
|
||||
{
|
||||
case OPCODE_PTHESE_IN:
|
||||
case OPCODE_PTHESE_OUT:
|
||||
case OPCODE_BRACKET_IN:
|
||||
case OPCODE_BRACKET_OUT:
|
||||
case OPCODE_BRACE_IN:
|
||||
case OPCODE_BRACE_OUT:
|
||||
case OPCODE_TO:
|
||||
case OPCODE_STAR:
|
||||
case OPCODE_DOT:
|
||||
case OPCODE_QUESTION:
|
||||
case OPCODE_PLUS:
|
||||
case OPCODE_PIPE:
|
||||
case OPCODE_START_OF_LINE:
|
||||
case OPCODE_END_OF_LINE:
|
||||
case OPCODE_DIGIT:
|
||||
case OPCODE_DIGIT_NOT:
|
||||
case OPCODE_LETTER:
|
||||
case OPCODE_LETTER_NOT:
|
||||
case OPCODE_SPACE:
|
||||
case OPCODE_SPACE_NOT:
|
||||
case OPCODE_WORD:
|
||||
case OPCODE_WORD_NOT:
|
||||
{
|
||||
// just return the size inside
|
||||
int32_t sizeInside = pos - startPos;
|
||||
if (0 >= sizeInside) {
|
||||
EDN_ERROR("Error in the normal data : no data ...");
|
||||
}
|
||||
return sizeInside;
|
||||
}
|
||||
break;
|
||||
default :
|
||||
// nothing to do ...
|
||||
break;
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
return pos - startPos ;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
bool ParseBrace(Edn::VectorType<int16_t> &data, int32_t &min, int32_t &max)
|
||||
{
|
||||
//EDN_INFO("parse {...} in "; DisplayElem(data); );
|
||||
int32_t k=0;
|
||||
|
||||
int32_t firstElement = 0;
|
||||
int32_t SecondElement = 0;
|
||||
|
||||
while(k<data.Size()) {
|
||||
if (',' == (char)data[k]) {
|
||||
k++;
|
||||
break;
|
||||
} if ('}' == (char)data[k]) {
|
||||
SecondElement = firstElement;
|
||||
goto allIsSet;
|
||||
} else if ('0' <= (char)data[k] && '9' >= (char)data[k]) {
|
||||
firstElement *=10;
|
||||
firstElement += (char)data[k] - '0';
|
||||
} else {
|
||||
EDN_ERROR("Can not parse this element " << (char)data[k] << " at pos " << k);
|
||||
return false;
|
||||
}
|
||||
k++;
|
||||
}
|
||||
if (k==data.Size()) {
|
||||
SecondElement = firstElement;
|
||||
}
|
||||
while(k<data.Size()) {
|
||||
if (',' == (char)data[k]) {
|
||||
EDN_ERROR("Can not find a second , in {} at pos " << k);
|
||||
return false;
|
||||
} if ('}' == (char)data[k]) {
|
||||
goto allIsSet;
|
||||
} else if ('0' <= (char)data[k] && '9' >= (char)data[k]) {
|
||||
SecondElement *=10;
|
||||
SecondElement += (char)data[k] - '0';
|
||||
} else {
|
||||
EDN_ERROR("Can not parse this element " << (char)data[k] << " at pos " << k);
|
||||
return false;
|
||||
}
|
||||
k++;
|
||||
}
|
||||
|
||||
allIsSet:
|
||||
if (SecondElement == 0 && firstElement != 0) {
|
||||
min = 0;
|
||||
max = firstElement;
|
||||
} else {
|
||||
min = firstElement;
|
||||
max = SecondElement;
|
||||
}
|
||||
if (min > max) {
|
||||
EDN_ERROR("Minimum=" << min << " can not be < maximum=" << max );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,718 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file EdnString.cpp
|
||||
* @brief Editeur De N'ours : normal sting management... (sources)
|
||||
* @author Edouard DUPIN
|
||||
* @date 26/01/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "Edn.h"
|
||||
#include "toolsMemory.h"
|
||||
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "Edn::String"
|
||||
|
||||
std::ostream& Edn::operator <<(std::ostream &os, const Edn::String &obj)
|
||||
{
|
||||
os << (char*)&obj.m_data[0];
|
||||
return os;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
Edn::String::~String(void)
|
||||
{
|
||||
m_data.Clear();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
Edn::String::String(void)
|
||||
{
|
||||
//EDN_INFO("new Edn::String()");
|
||||
m_data.Clear();
|
||||
m_data.PushBack('\0');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
Edn::String::String(const char myInput)
|
||||
{
|
||||
m_data.Clear();
|
||||
m_data.PushBack(myInput);
|
||||
m_data.PushBack('\0');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
Edn::String::String(const char* inputData, int32_t len)
|
||||
{
|
||||
m_data.Clear();
|
||||
m_data.PushBack('\0');
|
||||
Set(inputData, len);
|
||||
}
|
||||
|
||||
void Edn::String::Set(const char * inputData, int32_t len)
|
||||
{
|
||||
// overwrite the len if needed :
|
||||
if ((-1) == len) {
|
||||
len = strlen(inputData);
|
||||
}
|
||||
|
||||
if (len != 0) {
|
||||
// remove the last '\0'
|
||||
m_data.PopBack();
|
||||
// copy the data ...
|
||||
m_data.PushBack((int8_t*)inputData, len);
|
||||
// add the last '\0'
|
||||
m_data.PushBack('\0');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
Edn::String::String(int inputData)
|
||||
{
|
||||
char tmpVal[256];
|
||||
// generate the string :
|
||||
sprintf(tmpVal, "%d", inputData);
|
||||
// set the internal data :
|
||||
m_data.Clear();
|
||||
m_data.PushBack('\0');
|
||||
Set(tmpVal);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
Edn::String::String(unsigned int inputData)
|
||||
{
|
||||
char tmpVal[256];
|
||||
// generate the string :
|
||||
sprintf(tmpVal, "%d", inputData);
|
||||
// set the internal data :
|
||||
m_data.Clear();
|
||||
m_data.PushBack('\0');
|
||||
Set(tmpVal);
|
||||
}
|
||||
|
||||
Edn::String::String(const Edn::String &ednS)
|
||||
{
|
||||
//EDN_INFO("Constructeur de recopie");
|
||||
m_data = ednS.m_data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
const Edn::String& Edn::String::operator= (const Edn::String &ednS )
|
||||
{
|
||||
//EDN_INFO("OPERATOR de recopie");
|
||||
if( this != &ednS ) // avoid copy to itself
|
||||
{
|
||||
m_data = ednS.m_data;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
const Edn::String& Edn::String::operator= (const char * inputData)
|
||||
{
|
||||
m_data.Clear();
|
||||
m_data.PushBack('\0');
|
||||
// calculate the size :
|
||||
uint32_t len = strlen(inputData);
|
||||
// check the new size ...
|
||||
if (len > 0 ) {
|
||||
// copy all data :
|
||||
Set(inputData, len);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
const Edn::String& Edn::String::operator= (Edn::VectorType<int8_t> inputData)
|
||||
{
|
||||
m_data = inputData;
|
||||
if (m_data.Size()>0) {
|
||||
if (m_data[m_data.Size()-1] != '\0') {
|
||||
m_data.PushBack('\0');
|
||||
}
|
||||
}
|
||||
//EDN_DEBUG("m_dataLen="<<m_dataLen << " m_dataLenUTF8="<<m_dataLenUTF8 << " description=" << m_data);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
bool Edn::String::operator== (const Edn::String& ednS) const
|
||||
{
|
||||
if( this != &ednS ) {
|
||||
if (ednS.m_data.Size() != m_data.Size()) {
|
||||
//EDN_DEBUG(" not the same size : " << ednS.m_data.Size() << "!=" << m_data.Size());
|
||||
return false;
|
||||
}
|
||||
for (int32_t iii= 0; iii<m_data.Size(); iii++) {
|
||||
//EDN_DEBUG(" check : " << ednS.m_data[iii] << "!=" << m_data[iii]);
|
||||
if (ednS.m_data[iii]!= m_data[iii]){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
bool Edn::String::operator== (const char * inputData) const
|
||||
{
|
||||
|
||||
// calculate the size :
|
||||
int32_t len = strlen(inputData);
|
||||
if (len+1 != m_data.Size()) {
|
||||
return false;
|
||||
}
|
||||
for (int32_t iii= 0; iii<m_data.Size(); iii++) {
|
||||
if (inputData[iii]!= m_data[iii]){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
bool Edn::String::operator!= (const Edn::String& ednS) const
|
||||
{
|
||||
return !(*this == ednS);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
bool Edn::String::operator!= (const char * inputData) const
|
||||
{
|
||||
return !(*this == inputData);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
const Edn::String& Edn::String::operator+= (const Edn::String &ednS)
|
||||
{
|
||||
if (0 < ednS.Size()) {
|
||||
// remove the last '\0'
|
||||
m_data.PopBack();
|
||||
// copy the data ...
|
||||
m_data += ednS.m_data;
|
||||
// This previous include the \0 in case of the 2 string are different...
|
||||
if( this == &ednS ) {
|
||||
// add the removed end string
|
||||
m_data.PushBack('\0');
|
||||
}
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
const Edn::String& Edn::String::operator+= (const char * inputData)
|
||||
{
|
||||
//EDN_INFO(" string(arg) : \"" << inputData << "\"");
|
||||
//EDN_INFO(" string(direct) : \"" << m_data << "\"");
|
||||
int32_t len = strlen(inputData);
|
||||
|
||||
if (len != 0) {
|
||||
// remove the last '\0'
|
||||
m_data.PopBack();
|
||||
// copy the data ...
|
||||
m_data.PushBack((int8_t*)inputData, len+1 );
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
Edn::String Edn::String::operator+ (const Edn::String &ednS)
|
||||
{
|
||||
Edn::String temp;
|
||||
//EDN_INFO(" string(arg) : \"" << ednS.m_data << "\"");
|
||||
//EDN_INFO(" string(direct) : \"" << m_data << "\"");
|
||||
temp += *this;
|
||||
temp += ednS;
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
Edn::String Edn::String::operator+ (const char * inputData)
|
||||
{
|
||||
Edn::String temp;
|
||||
//EDN_INFO(" string(arg) : \"" << inputData << "\"");
|
||||
//EDN_INFO(" string(direct) : \"" << m_data << "\"");
|
||||
temp += *this;
|
||||
temp += inputData;
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
bool Edn::String::IsEmpty(void) const
|
||||
{
|
||||
if(1 >= m_data.Size() ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
int32_t Edn::String::Size(void) const
|
||||
{
|
||||
if (m_data.Size() == 0) {
|
||||
return 0;
|
||||
} else {
|
||||
return m_data.Size() - 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
void Edn::String::Add(int32_t currentID, const char* inputData)
|
||||
{
|
||||
// get the input lenght
|
||||
int32_t len = strlen(inputData);
|
||||
if (0 == len) {
|
||||
EDN_WARNING("no data to add on the current string");
|
||||
return;
|
||||
} else if (currentID < 0) {
|
||||
EDN_WARNING("Curent ID(" << currentID << ") < 0 ==> Add at the start");
|
||||
currentID = 0;
|
||||
} else if (currentID > Size() ) {
|
||||
EDN_ERROR("Curent ID(" << currentID << ") > maxSize ... (" << Size() << ") ==> add at the end ...");
|
||||
m_data.PushBack((int8_t*)inputData, len);
|
||||
return;
|
||||
}
|
||||
m_data.Insert(currentID, (int8_t*)inputData, len);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out]
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
void Edn::String::Remove(int32_t currentID, int32_t len)
|
||||
{
|
||||
if (0 >= len) {
|
||||
EDN_ERROR("no data to remove on the current string");
|
||||
return;
|
||||
}
|
||||
// TODO : check the size of the data
|
||||
m_data.EraseLen(currentID, len);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Remove all element in the string
|
||||
*
|
||||
* @param ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void Edn::String::Clear(void)
|
||||
{
|
||||
m_data.Clear();
|
||||
m_data.PushBack('\0');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief find the first accurence after the position indicated
|
||||
*
|
||||
* @param[in] element Element that might be find in the string
|
||||
* @param[in] startPos Stert position to begin the search
|
||||
*
|
||||
* @return the position of the first occurence or -1 if not find...
|
||||
*
|
||||
*/
|
||||
int32_t Edn::String::FindForward(const char element, int32_t startPos)
|
||||
{
|
||||
if (startPos < 0) {
|
||||
startPos = 0;
|
||||
} else if (startPos >= Size() ) {
|
||||
return -1;
|
||||
}
|
||||
for (int32_t iii=startPos; iii< Size(); iii++) {
|
||||
if (m_data[iii] == element) {
|
||||
return iii;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief find the first accurence before the position indicated.
|
||||
*
|
||||
* @param[in] element Element that might be find in the string
|
||||
* @param[in] startPos Stert position to begin the search
|
||||
*
|
||||
* @return the position of the first occurence begining by the end or -1 if not find...
|
||||
*
|
||||
*/
|
||||
int32_t Edn::String::FindBack(const char element, int32_t startPos)
|
||||
{
|
||||
if (startPos < 0) {
|
||||
return -1;
|
||||
} else if (startPos >= Size() ) {
|
||||
startPos = Size();
|
||||
}
|
||||
for (int32_t iii=startPos; iii>=0; iii--) {
|
||||
if (m_data[iii] == element) {
|
||||
return iii;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Extract data from the data between two position
|
||||
*
|
||||
* @param[in] posStart Start position where to extract data
|
||||
* @param[in] posEnd End position where to extract data
|
||||
*
|
||||
* @return the extracted string
|
||||
*
|
||||
*/
|
||||
Edn::String Edn::String::Extract(int32_t posStart, int32_t posEnd)
|
||||
{
|
||||
Edn::String out;
|
||||
if (posStart < 0) {
|
||||
posStart = 0;
|
||||
} else if (posStart >= Size() ) {
|
||||
return out;
|
||||
}
|
||||
if (posEnd < 0) {
|
||||
return out;
|
||||
} else if (posEnd >= Size() ) {
|
||||
posEnd = Size();
|
||||
}
|
||||
out.m_data = m_data.Extract(posStart, posEnd);
|
||||
out.m_data.PushBack('\0');
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get a basic vector in int8 data with no \0 at the end of the string
|
||||
*
|
||||
* @param ---
|
||||
*
|
||||
* @return The desired vector with data
|
||||
*
|
||||
*/
|
||||
Edn::VectorType<int8_t> Edn::String::GetVector(void)
|
||||
{
|
||||
Edn::VectorType<int8_t> out = m_data;
|
||||
out.PopBack();
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Unitary test for the string system
|
||||
*
|
||||
* @param ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void Edn::TestUntaire_String(void)
|
||||
{
|
||||
EDN_WARNING("*********************************************************");
|
||||
EDN_WARNING("** Test Unitaire 'EdnString' (START)");
|
||||
EDN_WARNING("*********************************************************");
|
||||
|
||||
int32_t iddd = 0;
|
||||
Edn::String * monString = new Edn::String();
|
||||
EDN_INFO("phase : " << iddd++ << " : \"" << monString << "\"");
|
||||
delete(monString);
|
||||
|
||||
monString = new Edn::String("test de direct data");
|
||||
EDN_INFO("phase : " << iddd++ << " : \"" << monString << "\"");
|
||||
delete(monString);
|
||||
|
||||
monString = new Edn::String("test de direct data", 7);
|
||||
EDN_INFO("phase : " << iddd++ << " : \"" << monString << "\"");
|
||||
delete(monString);
|
||||
|
||||
int32_t testId = -6789;
|
||||
monString = new Edn::String(testId);
|
||||
EDN_INFO("phase : " << iddd++ << " : \"" << monString << "\"");
|
||||
delete(monString);
|
||||
|
||||
uint32_t testId2 = 12345;
|
||||
monString = new Edn::String((unsigned int)testId2);
|
||||
EDN_INFO("phase : " << iddd++ << " : \"" << monString << "\"");
|
||||
delete(monString);
|
||||
|
||||
Edn::String plop = "otherString";
|
||||
monString = new Edn::String(plop);
|
||||
EDN_INFO("phase : " << iddd++ << " : \"" << monString << "\"");
|
||||
delete(monString);
|
||||
|
||||
|
||||
Edn::String s1 = "test de base ...";
|
||||
s1 += s1;
|
||||
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
|
||||
s1 += " plop 2 ";
|
||||
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
|
||||
s1 += plop;
|
||||
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
|
||||
s1 = plop;
|
||||
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
|
||||
s1 = "test direct 44";
|
||||
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
|
||||
Edn::VectorType<int8_t> vb1;
|
||||
vb1.PushBack('v');
|
||||
vb1.PushBack('b');
|
||||
vb1.PushBack('1');
|
||||
s1 = vb1;
|
||||
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
|
||||
vb1.Clear();
|
||||
vb1.PushBack('v');
|
||||
vb1.PushBack('b');
|
||||
vb1.PushBack('2');
|
||||
vb1.PushBack('\0');
|
||||
s1 = vb1;
|
||||
EDN_INFO("phase : " << iddd++ << " : \"" << s1 << "\"");
|
||||
|
||||
if (s1 == "vb2") {
|
||||
EDN_INFO("phase : " << iddd++ << " : == OK");
|
||||
} else {
|
||||
EDN_ERROR("phase : " << iddd++ << " : == ERROR");
|
||||
}
|
||||
|
||||
|
||||
if (s1 == "vb3") {
|
||||
EDN_ERROR("phase : " << iddd++ << " : == ERROR");
|
||||
} else {
|
||||
EDN_INFO("phase : " << iddd++ << " : == OK");
|
||||
}
|
||||
|
||||
|
||||
if (s1 != "vb3") {
|
||||
EDN_INFO("phase : " << iddd++ << " : == OK");
|
||||
} else {
|
||||
EDN_ERROR("phase : " << iddd++ << " : == ERROR");
|
||||
}
|
||||
|
||||
|
||||
if (s1 != "vb2") {
|
||||
EDN_ERROR("phase : " << iddd++ << " : == ERROR");
|
||||
} else {
|
||||
EDN_INFO("phase : " << iddd++ << " : == OK");
|
||||
}
|
||||
|
||||
|
||||
Edn::String s2 = "vb2";
|
||||
Edn::String s3 = "vb3";
|
||||
|
||||
if (s1 == s2) {
|
||||
EDN_INFO("phase : " << iddd++ << " : == OK");
|
||||
} else {
|
||||
EDN_ERROR("phase : " << iddd++ << " : == ERROR");
|
||||
}
|
||||
|
||||
|
||||
if (s1 == s3) {
|
||||
EDN_ERROR("phase : " << iddd++ << " : == ERROR");
|
||||
} else {
|
||||
EDN_INFO("phase : " << iddd++ << " : == OK");
|
||||
}
|
||||
|
||||
|
||||
if (s1 != s3) {
|
||||
EDN_INFO("phase : " << iddd++ << " : == OK");
|
||||
} else {
|
||||
EDN_ERROR("phase : " << iddd++ << " : == ERROR");
|
||||
}
|
||||
|
||||
|
||||
if (s1 != s2) {
|
||||
EDN_ERROR("phase : " << iddd++ << " : == ERROR");
|
||||
} else {
|
||||
EDN_INFO("phase : " << iddd++ << " : == OK");
|
||||
}
|
||||
EDN_WARNING("*********************************************************");
|
||||
EDN_WARNING("** Test Unitaire 'EdnString' (STOP)");
|
||||
EDN_WARNING("*********************************************************");
|
||||
}
|
||||
|
@@ -1,92 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file EdnString.h
|
||||
* @brief Editeur De N'ours : normal sting management... (header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 26/01/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
#ifndef __END__STRING_H__
|
||||
#define __END__STRING_H__
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace Edn
|
||||
{
|
||||
class String
|
||||
{
|
||||
public:
|
||||
// Constructeurs
|
||||
String(void);
|
||||
String(const char myInput);
|
||||
String(const char* inputData, int32_t len = -1);//, bool noAllocation=false);
|
||||
void Set(const char* inputData, int32_t len=-1);
|
||||
// basic convertion integer en string
|
||||
String(int inputData);
|
||||
String(unsigned int inputData);
|
||||
//String(const wchar_t *inputData);
|
||||
String(const Edn::String &ednS);
|
||||
// destructor :
|
||||
~String(void);
|
||||
|
||||
const Edn::String& operator= (const Edn::String &ednS ); // assigment
|
||||
const Edn::String& operator= (const char * inputData);
|
||||
const Edn::String& operator= (Edn::VectorType<int8_t> inputData);
|
||||
bool operator== (const Edn::String& ednS) const; // == operator
|
||||
bool operator== (const char * inputData) const;
|
||||
bool operator!= (const Edn::String& ednS) const; // != operator
|
||||
bool operator!= (const char * inputData) const;
|
||||
const Edn::String& operator+= (const Edn::String &ednS); // += operator
|
||||
const Edn::String& operator+= (const char * inputData);
|
||||
Edn::String operator+ (const Edn::String &ednS); // + operator
|
||||
Edn::String operator+ (const char * inputData);
|
||||
//operator const char *()
|
||||
friend std::ostream& operator <<( std::ostream &os,const Edn::String &obj);
|
||||
|
||||
bool IsEmpty(void) const;
|
||||
int32_t Size(void) const;
|
||||
|
||||
void Add(int32_t currentID, const char* inputData);
|
||||
void Remove(int32_t currentID, int32_t len);
|
||||
void Clear(void);
|
||||
|
||||
Edn::VectorType<int8_t> GetVector(void);
|
||||
char * c_str(void) { return (char*)&m_data[0]; };
|
||||
|
||||
// Sting operation :
|
||||
int32_t FindForward(const char element, int32_t startPos=0);
|
||||
int32_t FindBack(const char element, int32_t startPos=0x7FFFFFFF);
|
||||
Edn::String Extract(int32_t posStart=0, int32_t posEnd=0x7FFFFFFF);
|
||||
|
||||
private :
|
||||
Edn::VectorType<int8_t> m_data;
|
||||
};
|
||||
|
||||
void TestUntaire_String(void);
|
||||
|
||||
std::ostream& operator <<(std::ostream &os, const Edn::String &obj);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -1,506 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file Vector.h
|
||||
* @brief Editeur De N'ours : Basic Edn::Vector (template)
|
||||
* @author Edouard DUPIN
|
||||
* @date 07/04/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
#ifndef __EDN_EdnVector_H__
|
||||
#define __EDN_EdnVector_H__
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "Edn::Vector"
|
||||
|
||||
/**
|
||||
* @brief EdnVector classes ...
|
||||
*
|
||||
* @tparam[in] T The type of objects to store.
|
||||
* @tparam[in] INC Incrementation mode (0 : Exponential to 200 and increment by stemp of 200)
|
||||
*
|
||||
* @todo : Need to add : popBack / Assign / Insert / Erase / Swap / Clear
|
||||
*
|
||||
* m_data
|
||||
* ---------- |-----------------------|
|
||||
* | 0 |-------->| Class Data |
|
||||
* |--------| |-----------------------|
|
||||
* | 1 |----|
|
||||
* |--------| |
|
||||
* | 2 |====|==============| |-----------------------|
|
||||
* |--------| | --->| Class Data |
|
||||
* m_count | 3 |-| | |-----------------------|
|
||||
* |--------| | |
|
||||
* | x | | | |-----------------------|
|
||||
* |--------| | -------->| Class Data |
|
||||
* | x | | |-----------------------|
|
||||
* |--------| |
|
||||
* | x | |
|
||||
* |--------| | |-----------------------|
|
||||
* | x | --------------------->| Class Data |
|
||||
* |--------| |-----------------------|
|
||||
* | x |
|
||||
* |--------|
|
||||
* | x |
|
||||
* |--------|
|
||||
* m_size | x |
|
||||
* ----------
|
||||
*
|
||||
*/
|
||||
namespace Edn
|
||||
{
|
||||
|
||||
template<class T, int32_t INC=0> class Vector
|
||||
{
|
||||
public:
|
||||
class Iterator
|
||||
{
|
||||
// Private data :
|
||||
private:
|
||||
int32_t m_current; // curent Id on the vector
|
||||
Edn::Vector<T> * m_Vector; // Pointer on the curent element of the vector
|
||||
public:
|
||||
/**
|
||||
* @brief Basic itarator constructor with no link with an Vector
|
||||
*/
|
||||
Iterator():
|
||||
m_current(-1),
|
||||
m_Vector(NULL)
|
||||
{
|
||||
// nothing to do ...
|
||||
}
|
||||
/**
|
||||
* @brief Recopy constructor on a specific Vector.
|
||||
* @param[in] otherIterator The Iterator that might be copy
|
||||
*/
|
||||
Iterator(const Iterator & otherIterator):
|
||||
m_current(otherIterator.m_current),
|
||||
m_Vector(otherIterator.m_Vector)
|
||||
{
|
||||
// nothing to do ...
|
||||
}
|
||||
/**
|
||||
* @brief Asignation operator.
|
||||
* @param[in] otherIterator The Iterator that might be copy
|
||||
* @return reference on the curent Iterator
|
||||
*/
|
||||
Iterator& operator=(const Iterator & otherIterator)
|
||||
{
|
||||
m_current = otherIterator.m_current;
|
||||
m_Vector = otherIterator.m_Vector;
|
||||
return *this;
|
||||
}
|
||||
/**
|
||||
* @brief Basic destructor
|
||||
*/
|
||||
~Iterator()
|
||||
{
|
||||
m_current = -1;
|
||||
m_Vector = NULL;
|
||||
}
|
||||
/**
|
||||
* @brief basic boolean cast
|
||||
* @return true if the element is present in the Vector size
|
||||
*/
|
||||
operator bool ()
|
||||
{
|
||||
if( 0 <= m_current
|
||||
&& m_current < m_EdnVector->Size() )
|
||||
{
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @brief Incremental operator
|
||||
* @return Reference on the current iterator incremented
|
||||
*/
|
||||
Iterator& operator++ ()
|
||||
{
|
||||
if( NULL != m_EdnVector
|
||||
&& m_current < m_EdnVector->Size() )
|
||||
{
|
||||
m_current++;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
/**
|
||||
* @brief Decremental operator
|
||||
* @return Reference on the current iterator decremented
|
||||
*/
|
||||
Iterator& operator-- ()
|
||||
{
|
||||
if (m_current >= 0) {
|
||||
m_current--;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
/**
|
||||
* @brief Incremental operator
|
||||
* @return Reference on a new iterator and increment the other one
|
||||
*/
|
||||
Iterator operator++ (int32_t)
|
||||
{
|
||||
Iterator it(*this);
|
||||
++(*this);
|
||||
return it;
|
||||
}
|
||||
/**
|
||||
* @brief Decremental operator
|
||||
* @return Reference on a new iterator and decrement the other one
|
||||
*
|
||||
*/
|
||||
Iterator operator-- (int32_t)
|
||||
{
|
||||
Iterator it(*this);
|
||||
--(*this);
|
||||
return it;
|
||||
}
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
T * operator-> () const
|
||||
{
|
||||
EDN_CHECK_INOUT(m_current >= 0 && m_current < m_EdnVector->Size());
|
||||
return &m_EdnVector->Get(m_current);
|
||||
}
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
T & operator* () const
|
||||
{
|
||||
EDN_CHECK_INOUT(m_current >= 0 && m_current < m_EdnVector->Size());
|
||||
return m_EdnVector->Get(m_current);
|
||||
}
|
||||
private:
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
Iterator(Edn::Vector<T> * myVector, int pos):
|
||||
m_current(pos),
|
||||
m_Vector(myVector)
|
||||
{
|
||||
// nothing to do ...
|
||||
}
|
||||
friend class Edn::Vector<T>;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
Vector(int count = 0):
|
||||
m_data(NULL),
|
||||
m_count(0),
|
||||
m_size(0)
|
||||
{
|
||||
Resize(count);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
Vector(const Edn::Vector<T> & myVector):
|
||||
m_size(myVector.m_size),
|
||||
m_count(myVector.m_count),
|
||||
m_data(NULL)
|
||||
{
|
||||
int32_t i;
|
||||
EDN_MALLOC_CAST(m_data, m_size, T, reinterpret_cast<T*>);
|
||||
for(i=0; i<m_count; i++) {
|
||||
new (&m_data[i]) T(myVector[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
~Vector()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
Vector& operator=(const Edn::Vector<T> & EdnVector)
|
||||
{
|
||||
int32_t i;
|
||||
this->~EdnVector();
|
||||
m_size = EdnVector.m_size;
|
||||
m_count = EdnVector.m_count;
|
||||
EDN_MALLOC_CAST(m_data, m_size, T, reinterpret_cast<T*>);
|
||||
for(i=0; i<m_count; i++) {
|
||||
new (&m_data[i]) T(EdnVector[i]);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
int32_t Size()
|
||||
{
|
||||
return m_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
T& Get(int32_t pos)
|
||||
{
|
||||
return m_data[pos];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
T& operator[] (int32_t pos)
|
||||
{
|
||||
return Get(pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
const T& operator[] (int32_t pos) const
|
||||
{
|
||||
return m_data[pos];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
int IndexOf(const T * item) const
|
||||
{
|
||||
int32_t res = item - m_data;
|
||||
if( 0 > res
|
||||
|| res >= Size())
|
||||
{
|
||||
return -1
|
||||
} else {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void PushBack(const T& item)
|
||||
{
|
||||
int32_t idx = Size();
|
||||
Resize(idx+1);
|
||||
Get(idx) = item;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
Iterator Get(int pos)
|
||||
{
|
||||
return Iterator(this, pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
Iterator Begin()
|
||||
{
|
||||
return Get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
Iterator End()
|
||||
{
|
||||
return Get( Size()-1 );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void Resize(int32_t count)
|
||||
{
|
||||
int32_t i;
|
||||
// Reallocate memory
|
||||
if (count > m_size) {
|
||||
ChangeAllocation(count);
|
||||
}
|
||||
|
||||
// Remove deprecated element
|
||||
for(i=count; i<m_count; i++) {
|
||||
m_data[i].~T();
|
||||
}
|
||||
|
||||
// Create nex item
|
||||
for(i=m_count;i<count;i++) {
|
||||
new (&m_data[i]) T();
|
||||
}
|
||||
|
||||
m_count = count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void ChangeAllocation(int count)
|
||||
{
|
||||
if (count > m_size) {
|
||||
// generate new size
|
||||
while(count > m_size) {
|
||||
if (INC) {
|
||||
m_size = (m_size + INC)
|
||||
} else if (m_size==0) {
|
||||
m_size = 1;
|
||||
} else {
|
||||
m_size = m_size * 2;
|
||||
}
|
||||
}
|
||||
// Allocate the curent element
|
||||
T * data = NULL;
|
||||
EDN_MALLOC_CAST(data, m_size, T, reinterpret_cast<T*>);
|
||||
for(int i=0; i<m_count; i++) {
|
||||
new (&data[i]) T(m_data[i]);
|
||||
}
|
||||
Destroy();
|
||||
m_data = data;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
T * m_data; //!< pointer on the current Data
|
||||
int32_t m_count; //!< number of element
|
||||
int32_t m_size; //!< current allocated size
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void Destroy()
|
||||
{
|
||||
for(int i=0; i<m_count; i++) {
|
||||
m_data[i].~T();
|
||||
}
|
||||
if (m_data) {
|
||||
EDN_FREE(m_data);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#undef __class__
|
||||
#define __class__ NULL
|
||||
|
||||
#endif
|
||||
|
@@ -1,671 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file VectorType.h
|
||||
* @brief Editeur De N'ours : Basic VectorType for direct data insertion (template)
|
||||
* @author Edouard DUPIN
|
||||
* @date 07/04/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef __EDN_VECTOR_BIN_H__
|
||||
#define __EDN_VECTOR_BIN_H__
|
||||
|
||||
#include "toolsMemory.h"
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "Edn::VectorType"
|
||||
|
||||
/**
|
||||
* @brief VectorType classes ...
|
||||
*
|
||||
* @tparam[in] SIZE Size of the current element.
|
||||
*
|
||||
* m_data
|
||||
* <------------ m_dataSize ------------>
|
||||
* ----------------------------------------
|
||||
* | 0 |
|
||||
* |--------------------------------------|
|
||||
* | 1 |
|
||||
* |--------------------------------------|
|
||||
* | 2 |
|
||||
* |--------------------------------------|
|
||||
* m_size | 3 |
|
||||
* |--------------------------------------|
|
||||
* | x |
|
||||
* |--------------------------------------|
|
||||
* | x |
|
||||
* |--------------------------------------|
|
||||
* | x |
|
||||
* |--------------------------------------|
|
||||
* | x |
|
||||
* |--------------------------------------|
|
||||
* | x |
|
||||
* |--------------------------------------|
|
||||
* | x |
|
||||
* |--------------------------------------|
|
||||
* m_allocated | x |
|
||||
* ----------------------------------------
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Edn
|
||||
{
|
||||
|
||||
template<typename MY_TYPE=int32_t> class VectorType
|
||||
{
|
||||
public:
|
||||
class Iterator
|
||||
{
|
||||
// Private data :
|
||||
private:
|
||||
int32_t m_current; //!< curent Id on the vector
|
||||
VectorType<MY_TYPE> * m_VectorType; //!< Pointer on the curent element of the vectorBin
|
||||
public:
|
||||
/**
|
||||
* @brief Basic itarator constructor with no link with an EdnVector
|
||||
*/
|
||||
Iterator():
|
||||
m_current(-1),
|
||||
m_VectorType(NULL)
|
||||
{
|
||||
// nothing to do ...
|
||||
}
|
||||
/**
|
||||
* @brief Recopy constructor on a specific EdnVector.
|
||||
* @param[in] otherIterator The Iterator that might be copy
|
||||
*/
|
||||
Iterator(const Iterator & otherIterator):
|
||||
m_current(otherIterator.m_current),
|
||||
m_VectorType(otherIterator.m_VectorType)
|
||||
{
|
||||
// nothing to do ...
|
||||
}
|
||||
/**
|
||||
* @brief Asignation operator.
|
||||
* @param[in] otherIterator The Iterator that might be copy
|
||||
* @return reference on the curent Iterator
|
||||
*/
|
||||
Iterator& operator=(const Iterator & otherIterator)
|
||||
{
|
||||
m_current = otherIterator.m_current;
|
||||
m_VectorType = otherIterator.m_VectorType;
|
||||
return *this;
|
||||
}
|
||||
/**
|
||||
* @brief Basic destructor
|
||||
*/
|
||||
~Iterator()
|
||||
{
|
||||
m_current = -1;
|
||||
m_VectorType = NULL;
|
||||
}
|
||||
/**
|
||||
* @brief basic boolean cast
|
||||
* @return true if the element is present in the EdnVector size
|
||||
*/
|
||||
operator bool ()
|
||||
{
|
||||
if( 0 <= m_current
|
||||
&& m_current < m_VectorType->Size() )
|
||||
{
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @brief Incremental operator
|
||||
* @return Reference on the current iterator incremented
|
||||
*/
|
||||
Iterator& operator++ ()
|
||||
{
|
||||
if( NULL != m_VectorType
|
||||
&& m_current < m_VectorType->Size() )
|
||||
{
|
||||
m_current++;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
/**
|
||||
* @brief Decremental operator
|
||||
* @return Reference on the current iterator decremented
|
||||
*/
|
||||
Iterator& operator-- ()
|
||||
{
|
||||
if (m_current >= 0) {
|
||||
m_current--;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
/**
|
||||
* @brief Incremental operator
|
||||
* @return Reference on a new iterator and increment the other one
|
||||
*/
|
||||
Iterator operator++ (int32_t)
|
||||
{
|
||||
Iterator it(*this);
|
||||
++(*this);
|
||||
return it;
|
||||
}
|
||||
/**
|
||||
* @brief Decremental operator
|
||||
* @return Reference on a new iterator and decrement the other one
|
||||
*/
|
||||
Iterator operator-- (int32_t)
|
||||
{
|
||||
Iterator it(*this);
|
||||
--(*this);
|
||||
return it;
|
||||
}
|
||||
/**
|
||||
* @brief Get reference on the current Element
|
||||
* @return the reference on the current Element
|
||||
*/
|
||||
MY_TYPE & operator-> () const
|
||||
{
|
||||
EDN_CHECK_INOUT(m_current >= 0 && m_current < m_VectorType->Size());
|
||||
return &m_VectorType->Get(m_current);
|
||||
}
|
||||
/**
|
||||
* @brief Get reference on the current Element
|
||||
* @return the reference on the current Element
|
||||
*/
|
||||
MY_TYPE & operator* () const
|
||||
{
|
||||
EDN_CHECK_INOUT(m_current >= 0 && m_current < m_VectorType->Size());
|
||||
return m_VectorType->Get(m_current);
|
||||
}
|
||||
private:
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
Iterator(VectorType<MY_TYPE> * Evb, int32_t pos):
|
||||
m_current(pos),
|
||||
m_VectorType(Evb)
|
||||
{
|
||||
// nothing to do ...
|
||||
}
|
||||
friend class VectorType;
|
||||
};
|
||||
|
||||
private:
|
||||
MY_TYPE * m_data; //!< pointer on the curetn table of Data
|
||||
int32_t m_size; //!< nb Element in the buffer
|
||||
int32_t m_allocated; //!< Current allocated size
|
||||
int32_t m_increment; //!< methode of increment
|
||||
public:
|
||||
/**
|
||||
* @brief Create an empty vector
|
||||
* @param[in] count Minimum request size of the Buffer
|
||||
*/
|
||||
VectorType(int32_t count = 0):
|
||||
m_data(NULL),
|
||||
m_size(0),
|
||||
m_allocated(0),
|
||||
m_increment(1)
|
||||
{
|
||||
ChangeAllocation(count);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Re-copy constructor (copy all needed data)
|
||||
* @param[in] Evb Vector that might be copy
|
||||
*/
|
||||
VectorType(const Edn::VectorType<MY_TYPE> & Evb)
|
||||
{
|
||||
m_allocated = Evb.m_allocated;
|
||||
m_size = Evb.m_size;
|
||||
m_increment = Evb.m_increment;
|
||||
m_data = NULL;
|
||||
//EDN_DEBUG("USE Specific vector allocator ... Evb.m_size=" << Evb.m_size << " Evb.m_increment=" << Evb.m_increment);
|
||||
// allocate all same data
|
||||
EDN_MALLOC(m_data, m_allocated, MY_TYPE);
|
||||
EDN_ASSERT(NULL!=m_data, "Error in data allocation");
|
||||
// Copy all data ...
|
||||
memcpy(m_data, Evb.m_data, m_allocated * sizeof(MY_TYPE) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Destructor of the current Class
|
||||
*/
|
||||
~VectorType()
|
||||
{
|
||||
if (NULL!=m_data) {
|
||||
EDN_FREE(m_data);
|
||||
m_data = NULL;
|
||||
m_allocated = 0;
|
||||
m_size = 0;
|
||||
m_increment = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Re-copy operator
|
||||
* @param[in] Evb Vector that might be copy
|
||||
* @return reference on the curent re-copy vector
|
||||
*/
|
||||
VectorType& operator=(const Edn::VectorType<MY_TYPE> & Evb)
|
||||
{
|
||||
//EDN_DEBUG("USE RECOPY vector ... Evb.m_size=" << Evb.m_size << " Evb.m_increment=" << Evb.m_increment);
|
||||
if( this != &Evb ) // avoid copy to itself
|
||||
{
|
||||
if (NULL!=m_data) {
|
||||
EDN_FREE(m_data);
|
||||
m_data = NULL;
|
||||
}
|
||||
// Set the new value
|
||||
m_allocated = Evb.m_allocated;
|
||||
m_size = Evb.m_size;
|
||||
m_increment = Evb.m_increment;
|
||||
// allocate all same data
|
||||
EDN_MALLOC(m_data, m_allocated, MY_TYPE);
|
||||
EDN_ASSERT(NULL!=m_data, "Error in data allocation");
|
||||
// Copy all data ...
|
||||
memcpy(m_data, Evb.m_data, m_allocated * sizeof(MY_TYPE) );
|
||||
}
|
||||
// Return the curent pointer
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Add at the Last position of the Vector
|
||||
* @param[in] item Element to add at the end of vector
|
||||
*/
|
||||
VectorType& operator+= (const Edn::VectorType<MY_TYPE> & Evb) // += operator
|
||||
{
|
||||
int32_t nbElememt = Evb.Size();
|
||||
int32_t idx = m_size;
|
||||
Resize(m_size+nbElememt);
|
||||
memcpy(&m_data[idx], &Evb.m_data[0], nbElememt*sizeof(MY_TYPE) );
|
||||
// Return the curent pointer
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set increment mode of this vector (default it match corectly with the number of element inside)
|
||||
* @param[in] newIncrementNumber methode requested
|
||||
*/
|
||||
void SetIncrement(int32_t newIncrementNumber)
|
||||
{
|
||||
m_increment = newIncrementNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the number of element in the vector
|
||||
* @return The number requested
|
||||
*/
|
||||
int32_t Size() const
|
||||
{
|
||||
return m_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the Allocated size in the vector
|
||||
* @return The size of allocation
|
||||
*/
|
||||
int32_t AllocatedSize() const
|
||||
{
|
||||
return m_allocated;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get a current element in the vector
|
||||
* @param[in] pos Desired position read
|
||||
* @return Reference on the Element
|
||||
*/
|
||||
MY_TYPE& Get(int32_t pos)
|
||||
{
|
||||
return m_data[pos];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get an copy Element an a special position
|
||||
* @param[in] pos Position in the vector that might be get [0..Size()]
|
||||
* @return An reference on the copy of selected element
|
||||
*/
|
||||
MY_TYPE& operator[] (int32_t pos)
|
||||
{
|
||||
return Get(pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get an Element an a special position
|
||||
* @param[in] pos Position in the vector that might be get [0..Size()]
|
||||
* @return An reference on the selected element
|
||||
*/
|
||||
const MY_TYPE& operator[] (int32_t pos) const
|
||||
{
|
||||
return m_data[pos];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Add at the Last position of the Vector
|
||||
* @param[in] item Element to add at the end of vector
|
||||
*/
|
||||
void PushBack(const MY_TYPE& item)
|
||||
{
|
||||
int32_t idx = m_size;
|
||||
Resize(m_size+1);
|
||||
m_data[idx] = item;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Add at the Last position of the Vector
|
||||
* @param[in] item Element to add at the end of vector
|
||||
*/
|
||||
void PushBack(const MY_TYPE * item, int32_t nbElement)
|
||||
{
|
||||
if (NULL == item) {
|
||||
return;
|
||||
}
|
||||
int32_t idx = m_size;
|
||||
Resize(m_size+nbElement);
|
||||
memcpy(&m_data[idx], item, nbElement*sizeof(MY_TYPE) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Remove the last element of the vector
|
||||
*/
|
||||
void PopBack(void)
|
||||
{
|
||||
if(m_size>0) {
|
||||
Resize(m_size-1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Remove all alement in the current vector
|
||||
*/
|
||||
void Clear(void)
|
||||
{
|
||||
if(m_size>0) {
|
||||
Resize(0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void Insert(int32_t pos, const MY_TYPE& item)
|
||||
{
|
||||
if (pos>m_size) {
|
||||
EDN_ERROR(" can not insert Element at this position : " << pos << " > " << m_size<< " add it at the end ... ");
|
||||
PushBack(item);
|
||||
return;
|
||||
}
|
||||
int32_t tmpSize = m_size;
|
||||
// Request resize of the current buffer
|
||||
Resize(m_size+1);
|
||||
// move curent data
|
||||
memmove((m_data + pos + 1), (m_data + pos), (tmpSize - pos)*sizeof(MY_TYPE) );
|
||||
// affectation of the current element
|
||||
m_data[pos] = item;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void Insert(int32_t pos, const MY_TYPE * item, int32_t nbElement)
|
||||
{
|
||||
if (pos>m_size) {
|
||||
EDN_WARNING(" can not insert Element at this position : " << pos << " > " << m_size << " add it at the end ... ");
|
||||
PushBack(item, nbElement);
|
||||
return;
|
||||
}
|
||||
int32_t tmpSize = m_size;
|
||||
// Request resize of the current buffer
|
||||
Resize(m_size+nbElement);
|
||||
// move curent data (after the position)
|
||||
memmove((m_data + pos + nbElement), (m_data + pos), (tmpSize - pos)*sizeof(MY_TYPE) );
|
||||
// affectation of all input element
|
||||
memcpy(&m_data[pos], item, nbElement*sizeof(MY_TYPE) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Remove one element
|
||||
*
|
||||
* @param[in] pos Position to remove the data
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void Erase(int32_t pos)
|
||||
{
|
||||
if (pos>m_size) {
|
||||
EDN_ERROR(" can not Erase Element at this position : " << pos << " > " << m_size);
|
||||
return;
|
||||
}
|
||||
int32_t tmpSize = m_size;
|
||||
// move curent data
|
||||
memmove((m_data + pos), (m_data + pos + 1), (tmpSize - (pos+1))*sizeof(MY_TYPE) );
|
||||
// Request resize of the current buffer
|
||||
Resize(m_size-1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Remove N elements
|
||||
*
|
||||
* @param[in] pos Position to remove the data
|
||||
* @param[in] posEnd Last position number
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void Erase(int32_t pos, int32_t posEnd)
|
||||
{
|
||||
if (pos>m_size) {
|
||||
EDN_ERROR(" can not Erase Element at this position : " << pos << " > " << m_size);
|
||||
return;
|
||||
}
|
||||
if (posEnd>m_size) {
|
||||
posEnd = m_size;
|
||||
}
|
||||
int32_t nbElement = m_size - pos;
|
||||
int32_t tmpSize = m_size;
|
||||
// move curent data
|
||||
memmove((m_data + pos), (m_data + pos + nbElement), (tmpSize - (pos+nbElement))*sizeof(MY_TYPE) );
|
||||
// Request resize of the current buffer
|
||||
Resize(m_size-nbElement);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Remove N element
|
||||
*
|
||||
* @param[in] pos Position to remove the data
|
||||
* @param[in] nbElement number of element to remove
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void EraseLen(int32_t pos, int32_t nbElement)
|
||||
{
|
||||
if (pos>m_size) {
|
||||
EDN_ERROR(" can not Erase Len Element at this position : " << pos << " > " << m_size);
|
||||
return;
|
||||
}
|
||||
if (pos+nbElement>m_size) {
|
||||
nbElement = m_size - pos;
|
||||
}
|
||||
int32_t tmpSize = m_size;
|
||||
// move curent data
|
||||
memmove((m_data + pos), (m_data + pos + nbElement), (tmpSize - (pos+nbElement))*sizeof(MY_TYPE) );
|
||||
// Request resize of the current buffer
|
||||
Resize(m_size-nbElement);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief extract data between two point :
|
||||
* @param[in] posStart start position to extract data
|
||||
* @param[in] posEnd End position to extract data
|
||||
* @return the extracted vector
|
||||
*/
|
||||
VectorType Extract(int32_t posStart = 0, int32_t posEnd=0x7FFFFFFF)
|
||||
{
|
||||
VectorType<MY_TYPE> out;
|
||||
if (posStart < 0) {
|
||||
posStart = 0;
|
||||
} else if (posStart >= Size() ) {
|
||||
return out;
|
||||
}
|
||||
if (posEnd < 0) {
|
||||
return out;
|
||||
} else if (posEnd >= Size() ) {
|
||||
posEnd = Size();
|
||||
}
|
||||
out.PushBack(&m_data[posStart], posEnd-posStart);
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the minimum allocation in memory for the curent vector ==> reallocate the
|
||||
* buffer to fit exactly the mumber of element needed
|
||||
*/
|
||||
void Fit(void)
|
||||
{
|
||||
if (m_size > m_allocated) {
|
||||
// Reallocate the curent data to the correct size ...
|
||||
EDN_REALLOC(m_data, m_size, MY_TYPE);
|
||||
}
|
||||
// Check result with assert :
|
||||
EDN_ASSERT(NULL!=m_data, "Error in data Fitting");
|
||||
m_allocated = m_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get an iterator an an specific position
|
||||
* @param[in] pos Requested position of the iterator in the vector
|
||||
* @return The Iterator
|
||||
*/
|
||||
Iterator Position(int32_t pos)
|
||||
{
|
||||
return Iterator(this, pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get an Iterator on the start position of the Vector
|
||||
* @return The Iterator
|
||||
*/
|
||||
Iterator Begin(void)
|
||||
{
|
||||
return Position(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get an Iterator on the end position of the Vector
|
||||
* @return The Iterator
|
||||
*/
|
||||
Iterator End(void)
|
||||
{
|
||||
return Position( Size()-1 );
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Change the current size of the vector
|
||||
* @param[in] newSize New requested size of element in the vector
|
||||
*/
|
||||
void Resize(int32_t newSize)
|
||||
{
|
||||
// Reallocate memory
|
||||
if (newSize > m_allocated) {
|
||||
ChangeAllocation(newSize);
|
||||
}
|
||||
m_size = newSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Change the current allocation to the corect one (depend on the current size)
|
||||
* @param[in] newSize Minimum number of element needed
|
||||
*/
|
||||
void ChangeAllocation(int32_t newSize)
|
||||
{
|
||||
// set the minimal size to 1
|
||||
if(newSize <= 0) {
|
||||
newSize = 1;
|
||||
}
|
||||
int32_t requestSize = m_allocated;
|
||||
// set the size with the corect chose type :
|
||||
if (newSize == m_allocated) {
|
||||
return;
|
||||
} else if (newSize < requestSize) {
|
||||
// down the size of the vector:
|
||||
if (0==m_increment) {
|
||||
// never down size...
|
||||
} else {
|
||||
int32_t devide = m_increment;
|
||||
if (devide == 0) {
|
||||
devide = 1;
|
||||
}
|
||||
int32_t numberOfStep = m_allocated / devide;
|
||||
if (newSize< ((numberOfStep-2)*devide + devide/2) ) {
|
||||
//Allow Reallocation of a new size shoerter
|
||||
requestSize = ((newSize / devide)+1) * devide;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
while(newSize > requestSize) {
|
||||
if (0 == requestSize) {
|
||||
requestSize = 1;
|
||||
} else if (0==m_increment) {
|
||||
requestSize = requestSize * 2;
|
||||
} else {
|
||||
requestSize = (requestSize + m_increment);
|
||||
}
|
||||
}
|
||||
}
|
||||
// No reallocation needed :
|
||||
if (requestSize == m_allocated) {
|
||||
return;
|
||||
}
|
||||
// check if something is allocated :
|
||||
if (NULL == m_data) {
|
||||
// no data allocated ==> request an allocation (might be the first)
|
||||
EDN_MALLOC(m_data, requestSize, MY_TYPE);
|
||||
} else {
|
||||
// move datas
|
||||
EDN_REALLOC(m_data, requestSize, MY_TYPE);
|
||||
}
|
||||
// Check result with assert :
|
||||
EDN_ASSERT(NULL!=m_data, "Error in data allocation");
|
||||
// set the new allocation size
|
||||
m_allocated = requestSize;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#undef __class__
|
||||
#define __class__ NULL
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,87 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file charset.h
|
||||
* @brief Editeur De N'ours : Abstraction Charset layer (header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 06/06/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef __CHARSET_H__
|
||||
#define __CHARSET_H__
|
||||
|
||||
#include "VectorType.h"
|
||||
|
||||
typedef enum {
|
||||
EDN_CHARSET_UTF8,
|
||||
EDN_CHARSET_ISO_8859_1,
|
||||
EDN_CHARSET_ISO_8859_2,
|
||||
EDN_CHARSET_ISO_8859_3,
|
||||
EDN_CHARSET_ISO_8859_4,
|
||||
EDN_CHARSET_ISO_8859_5,
|
||||
EDN_CHARSET_ISO_8859_6,
|
||||
EDN_CHARSET_ISO_8859_7,
|
||||
EDN_CHARSET_ISO_8859_8,
|
||||
EDN_CHARSET_ISO_8859_9,
|
||||
EDN_CHARSET_ISO_8859_10,
|
||||
EDN_CHARSET_ISO_8859_11,
|
||||
EDN_CHARSET_ISO_8859_13,
|
||||
EDN_CHARSET_ISO_8859_14,
|
||||
EDN_CHARSET_ISO_8859_15,
|
||||
} charset_te;
|
||||
|
||||
// transform ISO <==> Unicode
|
||||
void convertIsoToUnicode(charset_te inputCharset, char input_ISO, int32_t & output_Unicode);
|
||||
void convertUnicodeToIso(charset_te inputCharset, int32_t input_Unicode, char & output_ISO);
|
||||
int32_t convertIsoToUnicode(charset_te inputCharset, Edn::VectorType<char>& input_ISO, Edn::VectorType<int32_t>& output_Unicode);
|
||||
int32_t convertUnicodeToIso(charset_te inputCharset, Edn::VectorType<int32_t>& input_Unicode, Edn::VectorType<char>& output_ISO);
|
||||
// Transform UTF-8 <==> Unicode
|
||||
void convertUnicodeToUtf8( int32_t input_Unicode, char * output_UTF8);
|
||||
void convertUtf8ToUnicode( char * input_UTF8, int32_t& output_Unicode);
|
||||
int32_t convertUnicodeToUtf8( Edn::VectorType<int32_t>& input_Unicode, Edn::VectorType<char>& output_UTF8);
|
||||
int32_t convertUtf8ToUnicode( Edn::VectorType<char>& input_UTF8, Edn::VectorType<int32_t>& output_Unicode);
|
||||
// Transform ISO <==> UTF-8
|
||||
void convertIsoToUtf8( charset_te inputCharset, char input_ISO, char * output_UTF8);
|
||||
void convertUtf8ToIso( charset_te inputCharset, char * input_UTF8, char & output_ISO);
|
||||
int32_t convertIsoToUtf8( charset_te inputCharset, Edn::VectorType<char>& input_ISO, Edn::VectorType<char>& output_UTF8);
|
||||
int32_t convertUtf8ToIso( charset_te inputCharset, Edn::VectorType<char>& input_UTF8, Edn::VectorType<char>& output_ISO);
|
||||
|
||||
void Utf8_SizeElement(const char * data, int32_t lenMax , uint8_t &size, bool &baseValid);
|
||||
int32_t strUtf8Len(const char *input_UTF8);
|
||||
|
||||
|
||||
#ifdef USE_GTK_VERSION_3_0
|
||||
# define GDK_KEY_Esc (65305)
|
||||
# define GDK_KEY_Alt_Gr (65027)
|
||||
# define GDK_KEY_Pomme_L (65515)
|
||||
# define GDK_KEY_Pomme_R (65516)
|
||||
#elif USE_GTK_VERSION_2_0
|
||||
# define GDK_Esc (65305)
|
||||
# define GDK_Alt_Gr (65027)
|
||||
# define GDK_Pomme_L (65515)
|
||||
# define GDK_Pomme_R (65516)
|
||||
#endif
|
||||
//# define GDK_Retur (65516)
|
||||
|
||||
void ConvertInput(GdkEventKey *event, char* Utf8Out, bool &controlKey, bool &moveKey, int32_t &key);
|
||||
|
||||
void testDisplayConvChar(void);
|
||||
|
||||
#endif
|
||||
|
@@ -1,312 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file charsetTable.cpp
|
||||
* @brief Editeur De N'ours : Table of all charset convertions (Sources)
|
||||
* @author Edouard DUPIN
|
||||
* @date 06/06/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "tools_globals.h"
|
||||
#include "charsetTable.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
const int32_t TableIso8859_1[] = {
|
||||
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
|
||||
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
|
||||
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
|
||||
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
|
||||
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
|
||||
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
|
||||
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
|
||||
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
|
||||
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
|
||||
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
|
||||
0x000000A0, 0x000000A1, 0x000000A2, 0x000000A3, 0x000000A4, 0x000000A5, 0x000000A6, 0x000000A7, 0x000000A8, 0x000000A9, 0x000000AA, 0x000000AB, 0x000000AC, 0x000000AD, 0x000000AE, 0x000000AF,
|
||||
0x000000B0, 0x000000B1, 0x000000B2, 0x000000B3, 0x000000B4, 0x000000B5, 0x000000B6, 0x000000B7, 0x000000B8, 0x000000B9, 0x000000BA, 0x000000BB, 0x000000BC, 0x000000BD, 0x000000BE, 0x000000BF,
|
||||
0x000000C0, 0x000000C1, 0x000000C2, 0x000000C3, 0x000000C4, 0x000000C5, 0x000000C6, 0x000000C7, 0x000000C8, 0x000000C9, 0x000000CA, 0x000000CB, 0x000000CC, 0x000000CD, 0x000000CE, 0x000000CF,
|
||||
0x000000D0, 0x000000D1, 0x000000D2, 0x000000D3, 0x000000D4, 0x000000D5, 0x000000D6, 0x000000D7, 0x000000D8, 0x000000D9, 0x000000DA, 0x000000DB, 0x000000DC, 0x000000DD, 0x000000DE, 0x000000DF,
|
||||
0x000000E0, 0x000000E1, 0x000000E2, 0x000000E3, 0x000000E4, 0x000000E5, 0x000000E6, 0x000000E7, 0x000000E8, 0x000000E9, 0x000000EA, 0x000000EB, 0x000000EC, 0x000000ED, 0x000000EE, 0x000000EF,
|
||||
0x000000F0, 0x000000F1, 0x000000F2, 0x000000F3, 0x000000F4, 0x000000F5, 0x000000F6, 0x000000F7, 0x000000F8, 0x000000F9, 0x000000FA, 0x000000FB, 0x000000FC, 0x000000FD, 0x000000FE, 0x000000FF
|
||||
};
|
||||
|
||||
const int32_t TableIso8859_2[] = {
|
||||
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
|
||||
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
|
||||
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
|
||||
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
|
||||
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
|
||||
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
|
||||
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
|
||||
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
|
||||
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
|
||||
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
|
||||
0x000000A0, 0x00000104, 0x000002D8, 0x00000141, 0x000000A4, 0x0000013D, 0x0000015A, 0x000000A7, 0x000000A8, 0x00000160, 0x0000015E, 0x00000164, 0x00000179, 0x000000AD, 0x0000017D, 0x0000017B,
|
||||
0x000000B0, 0x00000105, 0x000002DB, 0x00000142, 0x000000B4, 0x0000013E, 0x0000015B, 0x000002C7, 0x000000B8, 0x00000161, 0x0000015F, 0x00000165, 0x0000017A, 0x000002DD, 0x0000017E, 0x0000017C,
|
||||
0x00000154, 0x000000C1, 0x000000C2, 0x00000102, 0x000000C4, 0x00000139, 0x00000106, 0x000000C7, 0x0000010C, 0x000000C9, 0x00000118, 0x000000CB, 0x0000011A, 0x000000CD, 0x000000CE, 0x0000010E,
|
||||
0x00000110, 0x00000143, 0x00000147, 0x000000D3, 0x000000D4, 0x00000150, 0x000000D6, 0x000000D7, 0x00000158, 0x0000016E, 0x000000DA, 0x00000170, 0x000000DC, 0x000000DD, 0x00000162, 0x000000DF,
|
||||
0x00000155, 0x000000E1, 0x000000E2, 0x00000103, 0x000000E4, 0x0000013A, 0x00000107, 0x000000E7, 0x0000010D, 0x000000E9, 0x00000119, 0x000000EB, 0x0000011B, 0x000000ED, 0x000000EE, 0x0000010F,
|
||||
0x00000111, 0x00000144, 0x00000148, 0x000000F3, 0x000000F4, 0x00000151, 0x000000F6, 0x000000F7, 0x00000159, 0x0000016F, 0x000000FA, 0x00000171, 0x000000FC, 0x000000FD, 0x00000163, 0x000002D9
|
||||
};
|
||||
|
||||
const int32_t TableIso8859_3[] = {
|
||||
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
|
||||
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
|
||||
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
|
||||
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
|
||||
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
|
||||
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
|
||||
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
|
||||
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
|
||||
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
|
||||
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
|
||||
0x000000A0, 0x00000126, 0x000002D8, 0x000000A3, 0x000000A4, 0x00000000, 0x00000124, 0x000000A7, 0x000000A8, 0x00000130, 0x0000015E, 0x0000011E, 0x00000134, 0x000000AD, 0x00000000, 0x0000017B,
|
||||
0x000000B0, 0x00000127, 0x000000B2, 0x000000B3, 0x000000B4, 0x000000B5, 0x00000125, 0x000000B7, 0x000000B8, 0x00000131, 0x0000015F, 0x0000011F, 0x00000135, 0x000000BD, 0x00000000, 0x0000017C,
|
||||
0x000000C0, 0x000000C1, 0x000000C2, 0x00000000, 0x000000C4, 0x0000010A, 0x00000108, 0x000000C7, 0x000000C8, 0x000000C9, 0x000000CA, 0x000000CB, 0x000000CC, 0x000000CD, 0x000000CE, 0x000000CF,
|
||||
0x00000000, 0x000000D1, 0x000000D2, 0x000000D3, 0x000000D4, 0x00000120, 0x000000D6, 0x000000D7, 0x0000011C, 0x000000D9, 0x000000DA, 0x000000DB, 0x000000DC, 0x0000016C, 0x0000015C, 0x000000DF,
|
||||
0x000000E0, 0x000000E1, 0x000000E2, 0x00000000, 0x000000E4, 0x0000010B, 0x00000109, 0x000000E7, 0x000000E8, 0x000000E9, 0x000000EA, 0x000000EB, 0x000000EC, 0x000000ED, 0x000000EE, 0x000000EF,
|
||||
0x00000000, 0x000000F1, 0x000000F2, 0x000000F3, 0x000000F4, 0x00000121, 0x000000F6, 0x000000F7, 0x0000011D, 0x000000F9, 0x000000FA, 0x000000FB, 0x000000FC, 0x0000016D, 0x0000015D, 0x000002D9
|
||||
};
|
||||
|
||||
const int32_t TableIso8859_4[] = {
|
||||
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
|
||||
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
|
||||
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
|
||||
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
|
||||
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
|
||||
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
|
||||
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
|
||||
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
|
||||
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
|
||||
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
|
||||
0x000000A0, 0x00000104, 0x00000138, 0x00000156, 0x000000A4, 0x00000128, 0x0000013B, 0x000000A7, 0x000000A8, 0x00000160, 0x00000112, 0x00000122, 0x00000166, 0x000000AD, 0x0000017D, 0x000000AF,
|
||||
0x000000B0, 0x00000105, 0x000002DB, 0x00000157, 0x000000B4, 0x00000129, 0x0000013C, 0x000002C7, 0x000000B8, 0x00000161, 0x00000113, 0x00000123, 0x00000167, 0x0000014A, 0x0000017E, 0x0000014B,
|
||||
0x00000100, 0x000000C1, 0x000000C2, 0x000000C3, 0x000000C4, 0x000000C5, 0x000000C6, 0x0000012E, 0x0000010C, 0x000000C9, 0x00000118, 0x000000CB, 0x00000116, 0x000000CD, 0x000000CE, 0x0000012A,
|
||||
0x00000110, 0x00000145, 0x0000014C, 0x00000136, 0x000000D4, 0x000000D5, 0x000000D6, 0x000000D7, 0x000000D8, 0x00000172, 0x000000DA, 0x000000DB, 0x000000DC, 0x00000168, 0x0000016A, 0x000000DF,
|
||||
0x00000101, 0x000000E1, 0x000000E2, 0x000000E3, 0x000000E4, 0x000000E5, 0x000000E6, 0x0000012F, 0x0000010D, 0x000000E9, 0x00000119, 0x000000EB, 0x00000117, 0x000000ED, 0x000000EE, 0x0000012B,
|
||||
0x00000111, 0x00000146, 0x0000014D, 0x00000137, 0x000000F4, 0x000000F5, 0x000000F6, 0x000000F7, 0x000000F8, 0x00000173, 0x000000FA, 0x000000FB, 0x000000FC, 0x00000169, 0x0000016B, 0x000002D9
|
||||
};
|
||||
|
||||
const int32_t TableIso8859_5[] = {
|
||||
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
|
||||
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
|
||||
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
|
||||
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
|
||||
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
|
||||
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
|
||||
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
|
||||
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
|
||||
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
|
||||
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
|
||||
0x000000A0, 0x00000401, 0x00000402, 0x00000403, 0x00000404, 0x00000405, 0x00000406, 0x00000407, 0x00000408, 0x00000409, 0x0000040A, 0x0000040B, 0x0000040C, 0x000000AD, 0x0000040E, 0x0000040F,
|
||||
0x00000410, 0x00000411, 0x00000412, 0x00000413, 0x00000414, 0x00000415, 0x00000416, 0x00000417, 0x00000418, 0x00000419, 0x0000041A, 0x0000041B, 0x0000041C, 0x0000041D, 0x0000041E, 0x0000041F,
|
||||
0x00000420, 0x00000421, 0x00000422, 0x00000423, 0x00000424, 0x00000425, 0x00000426, 0x00000427, 0x00000428, 0x00000429, 0x0000042A, 0x0000042B, 0x0000042C, 0x0000042D, 0x0000042E, 0x0000042F,
|
||||
0x00000430, 0x00000431, 0x00000432, 0x00000433, 0x00000434, 0x00000435, 0x00000436, 0x00000437, 0x00000438, 0x00000439, 0x0000043A, 0x0000043B, 0x0000043C, 0x0000043D, 0x0000043E, 0x0000043F,
|
||||
0x00000440, 0x00000441, 0x00000442, 0x00000443, 0x00000444, 0x00000445, 0x00000446, 0x00000447, 0x00000448, 0x00000449, 0x0000044A, 0x0000044B, 0x0000044C, 0x0000044D, 0x0000044E, 0x0000044F,
|
||||
0x00002116, 0x00000451, 0x00000452, 0x00000453, 0x00000454, 0x00000455, 0x00000456, 0x00000457, 0x00000458, 0x00000459, 0x0000045A, 0x0000045B, 0x0000045C, 0x000000A7, 0x0000045E, 0x0000045F
|
||||
};
|
||||
|
||||
const int32_t TableIso8859_6[] = {
|
||||
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
|
||||
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
|
||||
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
|
||||
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
|
||||
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
|
||||
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
|
||||
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
|
||||
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
|
||||
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
|
||||
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
|
||||
0x000000A0, 0x00000000, 0x00000000, 0x00000000, 0x000000A4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000060C, 0x000000AD, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000061B, 0x00000000, 0x00000000, 0x00000000, 0x0000061F,
|
||||
0x00000000, 0x00000621, 0x00000622, 0x00000623, 0x00000624, 0x00000625, 0x00000626, 0x00000627, 0x00000628, 0x00000629, 0x0000062A, 0x0000062B, 0x0000062C, 0x0000062D, 0x0000062E, 0x0000062F,
|
||||
0x00000630, 0x00000631, 0x00000632, 0x00000633, 0x00000634, 0x00000635, 0x00000636, 0x00000637, 0x00000638, 0x00000639, 0x0000063A, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000640, 0x00000641, 0x00000642, 0x00000643, 0x00000644, 0x00000645, 0x00000646, 0x00000647, 0x00000648, 0x00000649, 0x0000064A, 0x0000064B, 0x0000064C, 0x0000064D, 0x0000064E, 0x0000064F,
|
||||
0x00000650, 0x00000651, 0x00000652, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
|
||||
};
|
||||
|
||||
const int32_t TableIso8859_7[] = {
|
||||
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
|
||||
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
|
||||
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
|
||||
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
|
||||
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
|
||||
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
|
||||
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
|
||||
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
|
||||
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
|
||||
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
|
||||
0x000000A0, 0x00002018, 0x00002019, 0x000000A3, 0x000020AC, 0x000020AF, 0x000000A6, 0x000000A7, 0x000000A8, 0x000000A9, 0x0000037A, 0x000000AB, 0x000000AC, 0x000000AD, 0x00000000, 0x00002015,
|
||||
0x000000B0, 0x000000B1, 0x000000B2, 0x000000B3, 0x00000384, 0x00000385, 0x00000386, 0x000000B7, 0x00000388, 0x00000389, 0x0000038A, 0x000000BB, 0x0000038C, 0x000000BD, 0x0000038E, 0x0000038F,
|
||||
0x00000390, 0x00000391, 0x00000392, 0x00000393, 0x00000394, 0x00000395, 0x00000396, 0x00000397, 0x00000398, 0x00000399, 0x0000039A, 0x0000039B, 0x0000039C, 0x0000039D, 0x0000039E, 0x0000039F,
|
||||
0x000003A0, 0x000003A1, 0x00000000, 0x000003A3, 0x000003A4, 0x000003A5, 0x000003A6, 0x000003A7, 0x000003A8, 0x000003A9, 0x000003AA, 0x000003AB, 0x000003AC, 0x000003AD, 0x000003AE, 0x000003AF,
|
||||
0x000003B0, 0x000003B1, 0x000003B2, 0x000003B3, 0x000003B4, 0x000003B5, 0x000003B6, 0x000003B7, 0x000003B8, 0x000003B9, 0x000003BA, 0x000003BB, 0x000003BC, 0x000003BD, 0x000003BE, 0x000003BF,
|
||||
0x000003C0, 0x000003C1, 0x000003C2, 0x000003C3, 0x000003C4, 0x000003C5, 0x000003C6, 0x000003C7, 0x000003C8, 0x000003C9, 0x000003CA, 0x000003CB, 0x000003CC, 0x000003CD, 0x000003CE, 0x00000000
|
||||
};
|
||||
|
||||
const int32_t TableIso8859_8[] = {
|
||||
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
|
||||
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
|
||||
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
|
||||
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
|
||||
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
|
||||
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
|
||||
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
|
||||
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
|
||||
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
|
||||
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
|
||||
0x000000A0, 0x00000000, 0x000000A2, 0x000000A3, 0x000000A4, 0x000000A5, 0x000000A6, 0x000000A7, 0x000000A8, 0x000000A9, 0x000000D7, 0x000000AB, 0x000000AC, 0x000000AD, 0x000000AE, 0x000000AF,
|
||||
0x000000B0, 0x000000B1, 0x000000B2, 0x000000B3, 0x000000B4, 0x000000B5, 0x000000B6, 0x000000B7, 0x000000B8, 0x000000B9, 0x000000F7, 0x000000BB, 0x000000BC, 0x000000BD, 0x000000BE, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00002017,
|
||||
0x000005D0, 0x000005D1, 0x000005D2, 0x000005D3, 0x000005D4, 0x000005D5, 0x000005D6, 0x000005D7, 0x000005D8, 0x000005D9, 0x000005DA, 0x000005DB, 0x000005DC, 0x000005DD, 0x000005DE, 0x000005DF,
|
||||
0x000005E0, 0x000005E1, 0x000005E2, 0x000005E3, 0x000005E4, 0x000005E5, 0x000005E6, 0x000005E7, 0x000005E8, 0x000005E9, 0x000005EA, 0x00000000, 0x00000000, 0x0000200E, 0x0000200F, 0x000003C0
|
||||
};
|
||||
|
||||
const int32_t TableIso8859_9[] = {
|
||||
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
|
||||
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
|
||||
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
|
||||
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
|
||||
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
|
||||
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
|
||||
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
|
||||
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
|
||||
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
|
||||
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
|
||||
0x000000A0, 0x000000A1, 0x000000A2, 0x000000A3, 0x000000A4, 0x000000A5, 0x000000A6, 0x000000A7, 0x000000A8, 0x000000A9, 0x000000AA, 0x000000AB, 0x000000AC, 0x000000AD, 0x000000AE, 0x000000AF,
|
||||
0x000000B0, 0x000000B1, 0x000000B2, 0x000000B3, 0x000000B4, 0x000000B5, 0x000000B6, 0x000000B7, 0x000000B8, 0x000000B9, 0x000000BA, 0x000000BB, 0x000000BC, 0x000000BD, 0x000000BE, 0x000000BF,
|
||||
0x000000C0, 0x000000C1, 0x000000C2, 0x000000C3, 0x000000C4, 0x000000C5, 0x000000C6, 0x000000C7, 0x000000C8, 0x000000C9, 0x000000CA, 0x000000CB, 0x000000CC, 0x000000CD, 0x000000CE, 0x000000CF,
|
||||
0x0000011E, 0x000000D1, 0x000000D2, 0x000000D3, 0x000000D4, 0x000000D5, 0x000000D6, 0x000000D7, 0x000000D8, 0x000000D9, 0x000000DA, 0x000000DB, 0x000000DC, 0x00000130, 0x0000015E, 0x000000DF,
|
||||
0x000000E0, 0x000000E1, 0x000000E2, 0x000000E3, 0x000000E4, 0x000000E5, 0x000000E6, 0x000000E7, 0x000000E8, 0x000000E9, 0x000000EA, 0x000000EB, 0x000000EC, 0x000000ED, 0x000000EE, 0x000000EF,
|
||||
0x0000011F, 0x000000F1, 0x000000F2, 0x000000F3, 0x000000F4, 0x000000F5, 0x000000F6, 0x000000F7, 0x000000F8, 0x000000F9, 0x000000FA, 0x000000FB, 0x000000FC, 0x00000131, 0x0000015F, 0x000000FF
|
||||
};
|
||||
|
||||
const int32_t TableIso8859_10[] = {
|
||||
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
|
||||
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
|
||||
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
|
||||
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
|
||||
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
|
||||
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
|
||||
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
|
||||
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
|
||||
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
|
||||
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
|
||||
0x000000A0, 0x00000104, 0x00000112, 0x00000122, 0x0000012A, 0x00000128, 0x00000136, 0x000000A7, 0x0000013B, 0x00000110, 0x00000160, 0x00000166, 0x0000017D, 0x000000AD, 0x0000016A, 0x0000014A,
|
||||
0x000000B0, 0x00000105, 0x00000113, 0x00000123, 0x0000012B, 0x00000129, 0x00000137, 0x000000B7, 0x0000013C, 0x00000111, 0x00000161, 0x00000167, 0x0000017E, 0x00002015, 0x0000016B, 0x0000014B,
|
||||
0x00000100, 0x000000C1, 0x000000C2, 0x000000C3, 0x000000C4, 0x000000C5, 0x000000C6, 0x0000012E, 0x0000010C, 0x000000C9, 0x00000118, 0x000000CB, 0x00000116, 0x000000CD, 0x000000CE, 0x000000CF,
|
||||
0x000000D0, 0x00000145, 0x0000014C, 0x000000D3, 0x000000D4, 0x000000D5, 0x000000D6, 0x00000168, 0x000000D8, 0x00000172, 0x000000DA, 0x000000DB, 0x000000DC, 0x000000DD, 0x000000DE, 0x000000DF,
|
||||
0x00000101, 0x000000E1, 0x000000E2, 0x000000E3, 0x000000E4, 0x000000E5, 0x000000E6, 0x0000012F, 0x0000010D, 0x000000E9, 0x00000119, 0x000000EB, 0x00000117, 0x000000ED, 0x000000EE, 0x000000EF,
|
||||
0x000000F0, 0x00000146, 0x0000014D, 0x000000F3, 0x000000F4, 0x000000F5, 0x000000F6, 0x00000169, 0x000000F8, 0x00000173, 0x000000FA, 0x000000FB, 0x000000FC, 0x000000FD, 0x000000FE, 0x00000138
|
||||
};
|
||||
|
||||
const int32_t TableIso8859_11[] = {
|
||||
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
|
||||
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
|
||||
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
|
||||
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
|
||||
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
|
||||
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
|
||||
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
|
||||
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
|
||||
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
|
||||
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
|
||||
0x000000A0, 0x00000E01, 0x00000E02, 0x00000E03, 0x00000E04, 0x00000E05, 0x00000E06, 0x00000E07, 0x00000E08, 0x00000E09, 0x00000E0A, 0x00000E0B, 0x00000E0C, 0x00000E0D, 0x00000E0E, 0x00000E0F,
|
||||
0x00000E10, 0x00000E11, 0x00000E12, 0x00000E13, 0x00000E14, 0x00000E15, 0x00000E16, 0x00000E17, 0x00000E18, 0x00000E19, 0x00000E1A, 0x00000E1B, 0x00000E1C, 0x00000E1D, 0x00000E1E, 0x00000E1F,
|
||||
0x00000E20, 0x00000E21, 0x00000E22, 0x00000E23, 0x00000E24, 0x00000E25, 0x00000E26, 0x00000E27, 0x00000E28, 0x00000E29, 0x00000E2A, 0x00000E2B, 0x00000E2C, 0x00000E2D, 0x00000E2E, 0x00000E2F,
|
||||
0x00000E30, 0x00000E31, 0x00000E32, 0x00000E33, 0x00000E34, 0x00000E35, 0x00000E36, 0x00000E37, 0x00000E38, 0x00000E39, 0x00000E3A, 0x00000E80, 0x00000E80, 0x00000E80, 0x00000E80, 0x00000E3F,
|
||||
0x00000E40, 0x00000E41, 0x00000E42, 0x00000E43, 0x00000E44, 0x00000E45, 0x00000E46, 0x00000E47, 0x00000E48, 0x00000E49, 0x00000E4A, 0x00000E4B, 0x00000E4C, 0x00000E4D, 0x00000E4E, 0x00000E4F,
|
||||
0x00000E50, 0x00000E51, 0x00000E52, 0x00000E53, 0x00000E54, 0x00000E55, 0x00000E56, 0x00000E57, 0x00000E58, 0x00000E59, 0x00000E5A, 0x00000E5B, 0x000006C0, 0x000006C0, 0x000006C0, 0x000006C0
|
||||
};
|
||||
|
||||
const int32_t TableIso8859_13[] = {
|
||||
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
|
||||
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
|
||||
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
|
||||
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
|
||||
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
|
||||
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
|
||||
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
|
||||
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
|
||||
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
|
||||
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
|
||||
0x000000A0, 0x0000201D, 0x000000A2, 0x000000A3, 0x000000A4, 0x0000201E, 0x000000A6, 0x000000A7, 0x000000D8, 0x000000A9, 0x00000156, 0x000000AB, 0x000000AC, 0x000000AD, 0x000000AE, 0x000000C6,
|
||||
0x000000B0, 0x000000B1, 0x000000B2, 0x000000B3, 0x0000201C, 0x000000B5, 0x000000B6, 0x000000B7, 0x000000F8, 0x000000B9, 0x00000157, 0x000000BB, 0x000000BC, 0x000000BD, 0x000000BE, 0x000000E6,
|
||||
0x00000104, 0x0000012E, 0x00000100, 0x00000106, 0x000000C4, 0x000000C5, 0x00000118, 0x00000112, 0x0000010C, 0x000000C9, 0x00000179, 0x00000116, 0x00000122, 0x00000136, 0x0000012A, 0x0000013B,
|
||||
0x00000160, 0x00000143, 0x00000145, 0x000000D3, 0x0000014C, 0x000000D5, 0x000000D6, 0x000000D7, 0x00000172, 0x00000141, 0x0000015A, 0x0000016A, 0x000000DC, 0x0000017B, 0x0000017D, 0x000000DF,
|
||||
0x00000105, 0x0000012F, 0x00000101, 0x00000107, 0x000000E4, 0x000000E5, 0x00000119, 0x00000113, 0x0000010D, 0x000000E9, 0x0000017A, 0x00000117, 0x00000123, 0x00000137, 0x0000012B, 0x0000013C,
|
||||
0x00000161, 0x00000144, 0x00000146, 0x000000F3, 0x0000014D, 0x000000F5, 0x000000F6, 0x000000F7, 0x00000173, 0x00000142, 0x0000015B, 0x0000016B, 0x000000FC, 0x0000017C, 0x0000017E, 0x00002019
|
||||
};
|
||||
|
||||
const int32_t TableIso8859_14[] = {
|
||||
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
|
||||
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
|
||||
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
|
||||
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
|
||||
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
|
||||
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
|
||||
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
|
||||
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
|
||||
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
|
||||
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
|
||||
0x000000A0, 0x00001E02, 0x00001E03, 0x000000A3, 0x0000010A, 0x0000010B, 0x00001E0A, 0x000000A7, 0x00001E80, 0x000000A9, 0x00001E82, 0x00001E0B, 0x00001EF2, 0x000000AD, 0x000000AE, 0x00000178,
|
||||
0x00001E1E, 0x00001E1F, 0x00000120, 0x00000121, 0x00001E40, 0x00001E41, 0x000000B6, 0x00001E56, 0x00001E81, 0x00001E57, 0x00001E83, 0x00001E60, 0x00001EF3, 0x00001E84, 0x00001E85, 0x00001E61,
|
||||
0x000000C0, 0x000000C1, 0x000000C2, 0x000000C3, 0x000000C4, 0x000000C5, 0x000000C6, 0x000000C7, 0x000000C8, 0x000000C9, 0x000000CA, 0x000000CB, 0x000000CC, 0x000000CD, 0x000000CE, 0x000000CF,
|
||||
0x00000174, 0x000000D1, 0x000000D2, 0x000000D3, 0x000000D4, 0x000000D5, 0x000000D6, 0x00001E6A, 0x000000D8, 0x000000D9, 0x000000DA, 0x000000DB, 0x000000DC, 0x000000DD, 0x00000176, 0x000000DF,
|
||||
0x000000E0, 0x000000E1, 0x000000E2, 0x000000E3, 0x000000E4, 0x000000E5, 0x000000E6, 0x000000E7, 0x000000E8, 0x000000E9, 0x000000EA, 0x000000EB, 0x000000EC, 0x000000ED, 0x000000EE, 0x000000EF,
|
||||
0x00000175, 0x000000F1, 0x000000F2, 0x000000F3, 0x000000F4, 0x000000F5, 0x000000F6, 0x00001E6B, 0x000000F8, 0x000000F9, 0x000000FA, 0x000000FB, 0x000000FC, 0x000000FD, 0x00000177, 0x000000FF
|
||||
};
|
||||
|
||||
const int32_t TableIso8859_15[] = {
|
||||
0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, 0x0000000F,
|
||||
0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001A, 0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000001F,
|
||||
0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002A, 0x0000002B, 0x0000002C, 0x0000002D, 0x0000002E, 0x0000002F,
|
||||
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003A, 0x0000003B, 0x0000003C, 0x0000003D, 0x0000003E, 0x0000003F,
|
||||
0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004A, 0x0000004B, 0x0000004C, 0x0000004D, 0x0000004E, 0x0000004F,
|
||||
0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005A, 0x0000005B, 0x0000005C, 0x0000005D, 0x0000005E, 0x0000005F,
|
||||
0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006A, 0x0000006B, 0x0000006C, 0x0000006D, 0x0000006E, 0x0000006F,
|
||||
0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, 0x0000007A, 0x0000007B, 0x0000007C, 0x0000007D, 0x0000007E, 0x0000007F,
|
||||
0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008A, 0x0000008B, 0x0000008C, 0x0000008D, 0x0000008E, 0x0000008F,
|
||||
0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009A, 0x0000009B, 0x0000009C, 0x0000009D, 0x0000009E, 0x0000009F,
|
||||
0x000000A0, 0x000000A1, 0x000000A2, 0x000000A3, 0x000020AC, 0x000000A5, 0x00000160, 0x000000A7, 0x00000161, 0x000000A9, 0x000000AA, 0x000000AB, 0x000000AC, 0x000000AD, 0x000000AE, 0x000000AF,
|
||||
0x000000B0, 0x000000B1, 0x000000B2, 0x000000B3, 0x0000017D, 0x000000B5, 0x000000B6, 0x000000B7, 0x0000017E, 0x000000B9, 0x000000BA, 0x000000BB, 0x00000152, 0x00000153, 0x00000178, 0x000000BF,
|
||||
0x000000C0, 0x000000C1, 0x000000C2, 0x000000C3, 0x000000C4, 0x000000C5, 0x000000C6, 0x000000C7, 0x000000C8, 0x000000C9, 0x000000CA, 0x000000CB, 0x000000CC, 0x000000CD, 0x000000CE, 0x000000CF,
|
||||
0x000000D0, 0x000000D1, 0x000000D2, 0x000000D3, 0x000000D4, 0x000000D5, 0x000000D6, 0x000000D7, 0x000000D8, 0x000000D9, 0x000000DA, 0x000000DB, 0x000000DC, 0x000000DD, 0x000000DE, 0x000000DF,
|
||||
0x000000E0, 0x000000E1, 0x000000E2, 0x000000E3, 0x000000E4, 0x000000E5, 0x000000E6, 0x000000E7, 0x000000E8, 0x000000E9, 0x000000EA, 0x000000EB, 0x000000EC, 0x000000ED, 0x000000EE, 0x000000EF,
|
||||
0x000000F0, 0x000000F1, 0x000000F2, 0x000000F3, 0x000000F4, 0x000000F5, 0x000000F6, 0x000000F7, 0x000000F8, 0x000000F9, 0x000000FA, 0x000000FB, 0x000000FC, 0x000000FD, 0x000000FE, 0x000000FF
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1,51 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file charsetTable.h
|
||||
* @brief Editeur De N'ours : Table of all charset convertions (Header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 06/06/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef __CHARSET_TABLE_H__
|
||||
#define __CHARSET_TABLE_H__
|
||||
|
||||
|
||||
|
||||
extern "C" {
|
||||
|
||||
extern const int32_t TableIso8859_1[];
|
||||
extern const int32_t TableIso8859_2[];
|
||||
extern const int32_t TableIso8859_3[];
|
||||
extern const int32_t TableIso8859_4[];
|
||||
extern const int32_t TableIso8859_5[];
|
||||
extern const int32_t TableIso8859_6[];
|
||||
extern const int32_t TableIso8859_7[];
|
||||
extern const int32_t TableIso8859_8[];
|
||||
extern const int32_t TableIso8859_9[];
|
||||
extern const int32_t TableIso8859_10[];
|
||||
extern const int32_t TableIso8859_11[];
|
||||
extern const int32_t TableIso8859_13[];
|
||||
extern const int32_t TableIso8859_14[];
|
||||
extern const int32_t TableIso8859_15[];
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
#endif
|
@@ -1,62 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file tools_debug.h
|
||||
* @brief Editeur De N'ours : log implementation
|
||||
* @author Edouard DUPIN
|
||||
* @date 08/06/2010
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "time.h"
|
||||
|
||||
// Max string size : (wide screan console nb caractere)
|
||||
#define EDN_LOG_MAX_LENGTH 250
|
||||
|
||||
|
||||
#define FUNCTION_NAME_SIZE (50)
|
||||
|
||||
void TOOLS_DisplayFuncName(int32_t ligne, const char* className, const char* funcName)
|
||||
{
|
||||
char tmpName[FUNCTION_NAME_SIZE] = "";
|
||||
if (NULL == className) {
|
||||
snprintf(tmpName, FUNCTION_NAME_SIZE, "(l=%5d) %s ",ligne, funcName);
|
||||
} else {
|
||||
snprintf(tmpName, FUNCTION_NAME_SIZE, "(l=%5d) %s::%s ",ligne, className, funcName);
|
||||
}
|
||||
tmpName[FUNCTION_NAME_SIZE-4] = ' ';
|
||||
tmpName[FUNCTION_NAME_SIZE-3] = '|';
|
||||
tmpName[FUNCTION_NAME_SIZE-2] = ' ';
|
||||
tmpName[FUNCTION_NAME_SIZE-1] = '\0';
|
||||
std::cout << tmpName;
|
||||
}
|
||||
|
||||
|
||||
void TOOLS_DisplayTime(void)
|
||||
{
|
||||
time_t rawtime;
|
||||
struct tm * timeinfo;
|
||||
char tmpdata[50];
|
||||
|
||||
time ( &rawtime );
|
||||
timeinfo = localtime ( &rawtime );
|
||||
sprintf(tmpdata, " %2dh %2dmin %2ds | ", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
|
||||
std::cout << tmpdata ;
|
||||
}
|
||||
|
@@ -1,155 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file tools_debug.h
|
||||
* @brief Editeur De N'ours : log implementation
|
||||
* @author Edouard DUPIN
|
||||
* @date 08/06/2010
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef __TOOLS_DEBUG_H__
|
||||
#define __TOOLS_DEBUG_H__
|
||||
|
||||
#include <iostream>
|
||||
#include "types_generique.h"
|
||||
|
||||
// Log Message System For EDN
|
||||
void TOOLS_DisplayFuncName(int32_t ligne, const char* className, const char* funcName);
|
||||
void TOOLS_DisplayTime(void);
|
||||
|
||||
//regular colors
|
||||
#define COLOR_BLACK "\e[0;30m"
|
||||
#define COLOR_RED "\e[0;31m"
|
||||
#define COLOR_GREEN "\e[0;32m"
|
||||
#define COLOR_YELLOW "\e[0;33m"
|
||||
#define COLOR_BLUE "\e[0;34m"
|
||||
#define COLOR_MAGENTA "\e[0;35m"
|
||||
#define COLOR_CYAN "\e[0;36m"
|
||||
#define COLOR_WHITE "\e[0;37m"
|
||||
//emphasized (bolded) colors
|
||||
#define COLOR_BOLD_BLACK "\e[1;30m"
|
||||
#define COLOR_BOLD_RED "\e[1;31m"
|
||||
#define COLOR_BOLD_GREEN "\e[1;32m"
|
||||
#define COLOR_BOLD_YELLOW "\e[1;33m"
|
||||
#define COLOR_BOLD_BLUE "\e[1;34m"
|
||||
#define COLOR_BOLD_MAGENTA "\e[1;35m"
|
||||
#define COLOR_BOLD_CYAN "\e[1;36m"
|
||||
#define COLOR_BOLD_WHITE "\e[1;37m"
|
||||
//background colors
|
||||
#define COLOR_BG_BLACK "\e[40m"
|
||||
#define COLOR_BG_RED "\e[41m"
|
||||
#define COLOR_BG_GREEN "\e[42m"
|
||||
#define COLOR_BG_YELLOW "\e[43m"
|
||||
#define COLOR_BG_BLUE "\e[44m"
|
||||
#define COLOR_BG_MAGENTA "\e[45m"
|
||||
#define COLOR_BG_CYAN "\e[46m"
|
||||
#define COLOR_BG_WHITE "\e[47m"
|
||||
// Return to the normal color setings
|
||||
#define COLOR_NORMAL "\e[0m"
|
||||
//go to the Top of bash
|
||||
#define GO_TOP "\e[0;0f"
|
||||
|
||||
#undef __class__
|
||||
#define __class__ (NULL)
|
||||
|
||||
/*
|
||||
#define DEFINE_CLASS_NAME(name) #undef __class__ \
|
||||
#define __class__ (#name)
|
||||
at the start of the class :
|
||||
#undef __class__
|
||||
#define __class__ ""
|
||||
*/
|
||||
|
||||
#define EDN_DBG_COMMON(color, info, data) do { \
|
||||
std::cout << color; \
|
||||
TOOLS_DisplayTime(); \
|
||||
TOOLS_DisplayFuncName(__LINE__, __class__, __func__); \
|
||||
std::cout << "[" << info << "] " << data; \
|
||||
std::cout << COLOR_NORMAL <<std::endl; \
|
||||
}while(0)
|
||||
|
||||
#define EDN_CRITICAL(data) EDN_DBG_COMMON(COLOR_BOLD_RED, "CC", data)
|
||||
// General
|
||||
#if EDN_DEBUG_LEVEL > 0
|
||||
# define EDN_WARNING(data) EDN_DBG_COMMON(COLOR_MAGENTA, "WW", data)
|
||||
# define EDN_ERROR(data) EDN_DBG_COMMON(COLOR_BOLD_RED, "EE", data)
|
||||
#else
|
||||
# define EDN_WARNING(data) do {}while(0)
|
||||
# define EDN_ERROR(data) do {}while(0)
|
||||
#endif
|
||||
|
||||
#if EDN_DEBUG_LEVEL > 1
|
||||
# define EDN_INFO(data) EDN_DBG_COMMON(COLOR_CYAN, "II", data)
|
||||
#else
|
||||
# define EDN_INFO(data) do {}while(0)
|
||||
#endif
|
||||
|
||||
#if EDN_DEBUG_LEVEL > 2
|
||||
# define EDN_DEBUG(data) EDN_DBG_COMMON(COLOR_YELLOW, "DD", data)
|
||||
#else
|
||||
# define EDN_DEBUG(data) do {}while(0)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if EDN_DEBUG_LEVEL > 0
|
||||
# define EDN_ASSERT(cond, format, ...) \
|
||||
do { \
|
||||
if (!(cond)) { \
|
||||
EDN_CRITICAL(format, ##__VA_ARGS__); \
|
||||
assert(!#cond); \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
# define EDN_ASSERT(cond, format, ...) \
|
||||
do { \
|
||||
assert(cond); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#if EDN_DEBUG_LEVEL > 1
|
||||
# define EDN_CHECK_INOUT(cond) EDN_ASSERT((cond), "Internal input error : "#cond)
|
||||
#elif EDN_DEBUG_LEVEL > 0
|
||||
// Critical warning mode
|
||||
# define EDN_CHECK_INOUT(cond) \
|
||||
do { \
|
||||
if (!(cond)) { \
|
||||
EDN_CRITICAL("Internal input error : "#cond);\
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
// Default : No check
|
||||
# define EDN_CHECK_INOUT(cond) do { } while (0)
|
||||
#endif
|
||||
|
||||
|
||||
// Enable or disable the magic element checking...
|
||||
#if EDN_DEBUG_LEVEL > 0
|
||||
#define CHECK_MAGIC(cond) EDN_ASSERT((cond), "MAGIC check error : "#cond)
|
||||
#define EDN_ENABLE_CHECK_MAGIC (1)
|
||||
#else
|
||||
#define CHECK_MAGIC(cond) do {}while(0)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
@@ -1,116 +0,0 @@
|
||||
/*
|
||||
www.sourceforge.net/projects/tinyxml
|
||||
Original file by Yves Berquin.
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must
|
||||
not claim that you wrote the original software. If you use this
|
||||
software in a product, an acknowledgment in the product documentation
|
||||
would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS FILE WAS ALTERED BY Tyge L<>vset, 7. April 2005.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef TIXML_USE_STL
|
||||
|
||||
#include "tinystr.h"
|
||||
|
||||
// Error value for find primitive
|
||||
const TiXmlString::size_type TiXmlString::npos = static_cast< TiXmlString::size_type >(-1);
|
||||
|
||||
|
||||
// Null rep.
|
||||
TiXmlString::Rep TiXmlString::nullrep_ = { 0, 0, { '\0' } };
|
||||
|
||||
|
||||
void TiXmlString::reserve (size_type cap)
|
||||
{
|
||||
if (cap > capacity())
|
||||
{
|
||||
TiXmlString tmp;
|
||||
tmp.init(length(), cap);
|
||||
memcpy(tmp.start(), data(), length());
|
||||
swap(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TiXmlString& TiXmlString::assign(const char* str, size_type len)
|
||||
{
|
||||
size_type cap = capacity();
|
||||
if (len > cap || cap > 3*(len + 8))
|
||||
{
|
||||
TiXmlString tmp;
|
||||
tmp.init(len);
|
||||
memcpy(tmp.start(), str, len);
|
||||
swap(tmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
memmove(start(), str, len);
|
||||
set_size(len);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
TiXmlString& TiXmlString::append(const char* str, size_type len)
|
||||
{
|
||||
size_type newsize = length() + len;
|
||||
if (newsize > capacity())
|
||||
{
|
||||
reserve (newsize + capacity());
|
||||
}
|
||||
memmove(finish(), str, len);
|
||||
set_size(newsize);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
TiXmlString operator + (const TiXmlString & a, const TiXmlString & b)
|
||||
{
|
||||
TiXmlString tmp;
|
||||
tmp.reserve(a.length() + b.length());
|
||||
tmp += a;
|
||||
tmp += b;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
TiXmlString operator + (const TiXmlString & a, const char* b)
|
||||
{
|
||||
TiXmlString tmp;
|
||||
TiXmlString::size_type b_len = static_cast<TiXmlString::size_type>( strlen(b) );
|
||||
tmp.reserve(a.length() + b_len);
|
||||
tmp += a;
|
||||
tmp.append(b, b_len);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
TiXmlString operator + (const char* a, const TiXmlString & b)
|
||||
{
|
||||
TiXmlString tmp;
|
||||
TiXmlString::size_type a_len = static_cast<TiXmlString::size_type>( strlen(a) );
|
||||
tmp.reserve(a_len + b.length());
|
||||
tmp.append(a, a_len);
|
||||
tmp += b;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
#endif // TIXML_USE_STL
|
@@ -1,319 +0,0 @@
|
||||
/*
|
||||
www.sourceforge.net/projects/tinyxml
|
||||
Original file by Yves Berquin.
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must
|
||||
not claim that you wrote the original software. If you use this
|
||||
software in a product, an acknowledgment in the product documentation
|
||||
would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS FILE WAS ALTERED BY Tyge Lovset, 7. April 2005.
|
||||
*
|
||||
* - completely rewritten. compact, clean, and fast implementation.
|
||||
* - sizeof(TiXmlString) = pointer size (4 bytes on 32-bit systems)
|
||||
* - fixed reserve() to work as per specification.
|
||||
* - fixed buggy compares operator==(), operator<(), and operator>()
|
||||
* - fixed operator+=() to take a const ref argument, following spec.
|
||||
* - added "copy" constructor with length, and most compare operators.
|
||||
* - added swap(), clear(), size(), capacity(), operator+().
|
||||
*/
|
||||
|
||||
#ifndef TIXML_USE_STL
|
||||
|
||||
#ifndef TIXML_STRING_INCLUDED
|
||||
#define TIXML_STRING_INCLUDED
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
/* The support for explicit isn't that universal, and it isn't really
|
||||
required - it is used to check that the TiXmlString class isn't incorrectly
|
||||
used. Be nice to old compilers and macro it here:
|
||||
*/
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1200 )
|
||||
// Microsoft visual studio, version 6 and higher.
|
||||
#define TIXML_EXPLICIT explicit
|
||||
#elif defined(__GNUC__) && (__GNUC__ >= 3 )
|
||||
// GCC version 3 and higher.s
|
||||
#define TIXML_EXPLICIT explicit
|
||||
#else
|
||||
#define TIXML_EXPLICIT
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
TiXmlString is an emulation of a subset of the std::string template.
|
||||
Its purpose is to allow compiling TinyXML on compilers with no or poor STL support.
|
||||
Only the member functions relevant to the TinyXML project have been implemented.
|
||||
The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase
|
||||
a string and there's no more room, we allocate a buffer twice as big as we need.
|
||||
*/
|
||||
class TiXmlString
|
||||
{
|
||||
public :
|
||||
// The size type used
|
||||
typedef size_t size_type;
|
||||
|
||||
// Error value for find primitive
|
||||
static const size_type npos; // = -1;
|
||||
|
||||
|
||||
// TiXmlString empty constructor
|
||||
TiXmlString () : rep_(&nullrep_)
|
||||
{
|
||||
}
|
||||
|
||||
// TiXmlString copy constructor
|
||||
TiXmlString ( const TiXmlString & copy) : rep_(0)
|
||||
{
|
||||
init(copy.length());
|
||||
memcpy(start(), copy.data(), length());
|
||||
}
|
||||
|
||||
// TiXmlString constructor, based on a string
|
||||
TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(0)
|
||||
{
|
||||
init( static_cast<size_type>( strlen(copy) ));
|
||||
memcpy(start(), copy, length());
|
||||
}
|
||||
|
||||
// TiXmlString constructor, based on a string
|
||||
TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(0)
|
||||
{
|
||||
init(len);
|
||||
memcpy(start(), str, len);
|
||||
}
|
||||
|
||||
// TiXmlString destructor
|
||||
~TiXmlString ()
|
||||
{
|
||||
quit();
|
||||
}
|
||||
|
||||
// = operator
|
||||
TiXmlString& operator = (const char * copy)
|
||||
{
|
||||
return assign( copy, (size_type)strlen(copy));
|
||||
}
|
||||
|
||||
// = operator
|
||||
TiXmlString& operator = (const TiXmlString & copy)
|
||||
{
|
||||
return assign(copy.start(), copy.length());
|
||||
}
|
||||
|
||||
|
||||
// += operator. Maps to append
|
||||
TiXmlString& operator += (const char * suffix)
|
||||
{
|
||||
return append(suffix, static_cast<size_type>( strlen(suffix) ));
|
||||
}
|
||||
|
||||
// += operator. Maps to append
|
||||
TiXmlString& operator += (char single)
|
||||
{
|
||||
return append(&single, 1);
|
||||
}
|
||||
|
||||
// += operator. Maps to append
|
||||
TiXmlString& operator += (const TiXmlString & suffix)
|
||||
{
|
||||
return append(suffix.data(), suffix.length());
|
||||
}
|
||||
|
||||
|
||||
// Convert a TiXmlString into a null-terminated char *
|
||||
const char * c_str () const { return rep_->str; }
|
||||
|
||||
// Convert a TiXmlString into a char * (need not be null terminated).
|
||||
const char * data () const { return rep_->str; }
|
||||
|
||||
// Return the length of a TiXmlString
|
||||
size_type length () const { return rep_->size; }
|
||||
|
||||
// Alias for length()
|
||||
size_type size () const { return rep_->size; }
|
||||
|
||||
// Checks if a TiXmlString is empty
|
||||
bool empty () const { return rep_->size == 0; }
|
||||
|
||||
// Return capacity of string
|
||||
size_type capacity () const { return rep_->capacity; }
|
||||
|
||||
|
||||
// single char extraction
|
||||
const char& at (size_type index) const
|
||||
{
|
||||
assert( index < length() );
|
||||
return rep_->str[ index ];
|
||||
}
|
||||
|
||||
// [] operator
|
||||
char& operator [] (size_type index) const
|
||||
{
|
||||
assert( index < length() );
|
||||
return rep_->str[ index ];
|
||||
}
|
||||
|
||||
// find a char in a string. Return TiXmlString::npos if not found
|
||||
size_type find (char lookup) const
|
||||
{
|
||||
return find(lookup, 0);
|
||||
}
|
||||
|
||||
// find a char in a string from an offset. Return TiXmlString::npos if not found
|
||||
size_type find (char tofind, size_type offset) const
|
||||
{
|
||||
if (offset >= length()) return npos;
|
||||
|
||||
for (const char* p = c_str() + offset; *p != '\0'; ++p)
|
||||
{
|
||||
if (*p == tofind) return static_cast< size_type >( p - c_str() );
|
||||
}
|
||||
return npos;
|
||||
}
|
||||
|
||||
void clear ()
|
||||
{
|
||||
//Lee:
|
||||
//The original was just too strange, though correct:
|
||||
// TiXmlString().swap(*this);
|
||||
//Instead use the quit & re-init:
|
||||
quit();
|
||||
init(0,0);
|
||||
}
|
||||
|
||||
/* Function to reserve a big amount of data when we know we'll need it. Be aware that this
|
||||
function DOES NOT clear the content of the TiXmlString if any exists.
|
||||
*/
|
||||
void reserve (size_type cap);
|
||||
|
||||
TiXmlString& assign (const char* str, size_type len);
|
||||
|
||||
TiXmlString& append (const char* str, size_type len);
|
||||
|
||||
void swap (TiXmlString& other)
|
||||
{
|
||||
Rep* r = rep_;
|
||||
rep_ = other.rep_;
|
||||
other.rep_ = r;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void init(size_type sz) { init(sz, sz); }
|
||||
void set_size(size_type sz) { rep_->str[ rep_->size = sz ] = '\0'; }
|
||||
char* start() const { return rep_->str; }
|
||||
char* finish() const { return rep_->str + rep_->size; }
|
||||
|
||||
struct Rep
|
||||
{
|
||||
size_type size, capacity;
|
||||
char str[1];
|
||||
};
|
||||
|
||||
void init(size_type sz, size_type cap)
|
||||
{
|
||||
if (cap)
|
||||
{
|
||||
// Lee: the original form:
|
||||
// rep_ = static_cast<Rep*>(operator new(sizeof(Rep) + cap));
|
||||
// doesn't work in some cases of new being overloaded. Switching
|
||||
// to the normal allocation, although use an 'int' for systems
|
||||
// that are overly picky about structure alignment.
|
||||
const size_type bytesNeeded = sizeof(Rep) + cap;
|
||||
const size_type intsNeeded = ( bytesNeeded + sizeof(int) - 1 ) / sizeof( int );
|
||||
rep_ = reinterpret_cast<Rep*>( new int[ intsNeeded ] );
|
||||
|
||||
rep_->str[ rep_->size = sz ] = '\0';
|
||||
rep_->capacity = cap;
|
||||
}
|
||||
else
|
||||
{
|
||||
rep_ = &nullrep_;
|
||||
}
|
||||
}
|
||||
|
||||
void quit()
|
||||
{
|
||||
if (rep_ != &nullrep_)
|
||||
{
|
||||
// The rep_ is really an array of ints. (see the allocator, above).
|
||||
// Cast it back before delete, so the compiler won't incorrectly call destructors.
|
||||
delete [] ( reinterpret_cast<int*>( rep_ ) );
|
||||
}
|
||||
}
|
||||
|
||||
Rep * rep_;
|
||||
static Rep nullrep_;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
inline bool operator == (const TiXmlString & a, const TiXmlString & b)
|
||||
{
|
||||
return ( a.length() == b.length() ) // optimization on some platforms
|
||||
&& ( strcmp(a.c_str(), b.c_str()) == 0 ); // actual compare
|
||||
}
|
||||
inline bool operator < (const TiXmlString & a, const TiXmlString & b)
|
||||
{
|
||||
return strcmp(a.c_str(), b.c_str()) < 0;
|
||||
}
|
||||
|
||||
inline bool operator != (const TiXmlString & a, const TiXmlString & b) { return !(a == b); }
|
||||
inline bool operator > (const TiXmlString & a, const TiXmlString & b) { return b < a; }
|
||||
inline bool operator <= (const TiXmlString & a, const TiXmlString & b) { return !(b < a); }
|
||||
inline bool operator >= (const TiXmlString & a, const TiXmlString & b) { return !(a < b); }
|
||||
|
||||
inline bool operator == (const TiXmlString & a, const char* b) { return strcmp(a.c_str(), b) == 0; }
|
||||
inline bool operator == (const char* a, const TiXmlString & b) { return b == a; }
|
||||
inline bool operator != (const TiXmlString & a, const char* b) { return !(a == b); }
|
||||
inline bool operator != (const char* a, const TiXmlString & b) { return !(b == a); }
|
||||
|
||||
TiXmlString operator + (const TiXmlString & a, const TiXmlString & b);
|
||||
TiXmlString operator + (const TiXmlString & a, const char* b);
|
||||
TiXmlString operator + (const char* a, const TiXmlString & b);
|
||||
|
||||
|
||||
/*
|
||||
TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString.
|
||||
Only the operators that we need for TinyXML have been developped.
|
||||
*/
|
||||
class TiXmlOutStream : public TiXmlString
|
||||
{
|
||||
public :
|
||||
|
||||
// TiXmlOutStream << operator.
|
||||
TiXmlOutStream & operator << (const TiXmlString & in)
|
||||
{
|
||||
*this += in;
|
||||
return *this;
|
||||
}
|
||||
|
||||
// TiXmlOutStream << operator.
|
||||
TiXmlOutStream & operator << (const char * in)
|
||||
{
|
||||
*this += in;
|
||||
return *this;
|
||||
}
|
||||
|
||||
} ;
|
||||
|
||||
#endif // TIXML_STRING_INCLUDED
|
||||
#endif // TIXML_USE_STL
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
www.sourceforge.net/projects/tinyxml
|
||||
Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must
|
||||
not claim that you wrote the original software. If you use this
|
||||
software in a product, an acknowledgment in the product documentation
|
||||
would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
*/
|
||||
|
||||
#include "tinyxml.h"
|
||||
|
||||
// The goal of the seperate error file is to make the first
|
||||
// step towards localization. tinyxml (currently) only supports
|
||||
// english error messages, but the could now be translated.
|
||||
//
|
||||
// It also cleans up the code a bit.
|
||||
//
|
||||
|
||||
const char* TiXmlBase::errorString[ TIXML_ERROR_STRING_COUNT ] =
|
||||
{
|
||||
"No error",
|
||||
"Error",
|
||||
"Failed to open file",
|
||||
"Error parsing Element.",
|
||||
"Failed to read Element name",
|
||||
"Error reading Element value.",
|
||||
"Error reading Attributes.",
|
||||
"Error: empty tag.",
|
||||
"Error reading end tag.",
|
||||
"Error parsing Unknown.",
|
||||
"Error parsing Comment.",
|
||||
"Error parsing Declaration.",
|
||||
"Error document empty.",
|
||||
"Error null (0) or unexpected EOF found in input stream.",
|
||||
"Error parsing CDATA.",
|
||||
"Error when TiXmlDocument added to document, because TiXmlDocument can only be at the root.",
|
||||
};
|
File diff suppressed because it is too large
Load Diff
BIN
assets/Font/ACharmingFont.ttf
Normal file
BIN
assets/Font/ACharmingFont.ttf
Normal file
Binary file not shown.
2744
assets/Font/Monospace/Monospace
Normal file
2744
assets/Font/Monospace/Monospace
Normal file
File diff suppressed because it is too large
Load Diff
2354
assets/Font/Monospace/Monospace-Bold
Normal file
2354
assets/Font/Monospace/Monospace-Bold
Normal file
File diff suppressed because it is too large
Load Diff
2445
assets/Font/Monospace/Monospace-BoldOblique
Normal file
2445
assets/Font/Monospace/Monospace-BoldOblique
Normal file
File diff suppressed because it is too large
Load Diff
2706
assets/Font/Monospace/Monospace-Oblique
Normal file
2706
assets/Font/Monospace/Monospace-Oblique
Normal file
File diff suppressed because it is too large
Load Diff
BIN
assets/Font/freefont/FreeMono.ttf
Normal file
BIN
assets/Font/freefont/FreeMono.ttf
Normal file
Binary file not shown.
BIN
assets/Font/freefont/FreeMonoBold.ttf
Normal file
BIN
assets/Font/freefont/FreeMonoBold.ttf
Normal file
Binary file not shown.
BIN
assets/Font/freefont/FreeMonoBoldOblique.ttf
Normal file
BIN
assets/Font/freefont/FreeMonoBoldOblique.ttf
Normal file
Binary file not shown.
BIN
assets/Font/freefont/FreeMonoOblique.ttf
Normal file
BIN
assets/Font/freefont/FreeMonoOblique.ttf
Normal file
Binary file not shown.
BIN
assets/Font/freefont/FreeSans.ttf
Normal file
BIN
assets/Font/freefont/FreeSans.ttf
Normal file
Binary file not shown.
BIN
assets/Font/freefont/FreeSansBold.ttf
Normal file
BIN
assets/Font/freefont/FreeSansBold.ttf
Normal file
Binary file not shown.
BIN
assets/Font/freefont/FreeSansBoldOblique.ttf
Normal file
BIN
assets/Font/freefont/FreeSansBoldOblique.ttf
Normal file
Binary file not shown.
BIN
assets/Font/freefont/FreeSansOblique.ttf
Normal file
BIN
assets/Font/freefont/FreeSansOblique.ttf
Normal file
Binary file not shown.
BIN
assets/Font/freefont/FreeSerif.ttf
Normal file
BIN
assets/Font/freefont/FreeSerif.ttf
Normal file
Binary file not shown.
BIN
assets/Font/freefont/FreeSerifBold.ttf
Normal file
BIN
assets/Font/freefont/FreeSerifBold.ttf
Normal file
Binary file not shown.
BIN
assets/Font/freefont/FreeSerifBoldItalic.ttf
Normal file
BIN
assets/Font/freefont/FreeSerifBoldItalic.ttf
Normal file
Binary file not shown.
BIN
assets/Font/freefont/FreeSerifItalic.ttf
Normal file
BIN
assets/Font/freefont/FreeSerifItalic.ttf
Normal file
Binary file not shown.
@@ -79,7 +79,7 @@
|
||||
</rule>
|
||||
<rule name="my function keyword">
|
||||
<color>systemFunction</color>
|
||||
<start>\@try|catch|memset|fopen|fread|fwrite|fgets|fclose|printf|(f|s|diag_)printf|calloc|malloc|realloc|(cyg|sup)_([a-z]|[A-Z]|[0-9]|_)+\@</start>
|
||||
<start>\@new|delete|try|catch|memset|fopen|fread|fwrite|fgets|fclose|printf|(f|s|diag_)printf|calloc|malloc|realloc|(cyg|sup)_([a-z]|[A-Z]|[0-9]|_)+\@</start>
|
||||
</rule>
|
||||
<rule name="my type">
|
||||
<color>type</color>
|
87
assets/lang_java.xml
Normal file
87
assets/lang_java.xml
Normal file
@@ -0,0 +1,87 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<EdnLang version="0.1" lang="java">
|
||||
<ext>*.java</ext>
|
||||
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
||||
<rule name="my comment multiline doxygen">
|
||||
<color>commentDoxygen</color>
|
||||
<start>/\*\*</start>
|
||||
<end>\*/</end>
|
||||
</rule>
|
||||
<rule name="my comment multiline">
|
||||
<color>comment</color>
|
||||
<start>/\*</start>
|
||||
<end>\*/</end>
|
||||
</rule>
|
||||
<rule name="my comment doxygen">
|
||||
<color>commentDoxygen</color>
|
||||
<start>//!</start>
|
||||
<end>\n</end>
|
||||
</rule>
|
||||
<rule name="my todo comment">
|
||||
<color>SYNTAX_ERROR</color>
|
||||
<start>//[ \t]*TODO[ \t]*:</start>
|
||||
<end>\n</end>
|
||||
<EscapeChar>\</EscapeChar>
|
||||
</rule>
|
||||
<rule name="my comment">
|
||||
<color>comment</color>
|
||||
<start>//</start>
|
||||
<end>\n</end>
|
||||
<EscapeChar>\</EscapeChar>
|
||||
</rule>
|
||||
<rule name="doubleQuteText">
|
||||
<color>doubleQuoteText</color>
|
||||
<start>"</start>
|
||||
<end>"</end>
|
||||
<EscapeChar>\</EscapeChar>
|
||||
</rule>
|
||||
<rule name="simpleQuteText">
|
||||
<color>doubleQuoteText</color>
|
||||
<start>'</start>
|
||||
<end>'</end>
|
||||
<!--<EscapeChar>\</EscapeChar>-->
|
||||
</rule>
|
||||
</pass1>
|
||||
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
|
||||
<rule name="my keyword">
|
||||
<color>keyword</color>
|
||||
<start>\@return|goto|if|else|case|default|switch|break|continue|while|do|for|sizeof\@</start>
|
||||
</rule>
|
||||
<rule name="my function keyword">
|
||||
<color>systemFunction</color>
|
||||
<start>\@new|delete|try|catch|memset|fopen|fread|fwrite|fgets|fclose|printf|(f|s|diag_)printf|calloc|malloc|realloc|(cyg|sup)_([a-z]|[A-Z]|[0-9]|_)+\@</start>
|
||||
</rule>
|
||||
<rule name="my type">
|
||||
<color>type</color>
|
||||
<start>\@bool|char|double|float|u?int(8|16|32|64|128)?(_t)?|long|short|signed|size_t|unsigned|void|(I|U)(8|16|32|64|128)\@</start>
|
||||
</rule>
|
||||
<rule name="my storage keyword">
|
||||
<color>storageKeyword</color>
|
||||
<start>\@import|package|extends|Override|const|class|virtual|private|public|protected|friend|const|extern|auto|register|static|unsigned|signed|volatile|char|double|float|int|long|short|void|typedef|struct|union|enum\@</start>
|
||||
</rule>
|
||||
<rule name="my common Define">
|
||||
<color>commonDefine</color>
|
||||
<start>\@NULL|MAX|MIN|__LINE__|__DATA__|__FILE__|__func__|__TIME__|__STDC__\@</start>
|
||||
</rule>
|
||||
<rule name="numeric constant">
|
||||
<color>number</color>
|
||||
<start>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</start>
|
||||
</rule>
|
||||
<rule name="my boolean">
|
||||
<color>boolean</color>
|
||||
<start>\@true|TRUE|false|FALSE\@</start>
|
||||
</rule>
|
||||
<rule name="BIG LETTER">
|
||||
<color>macro</color>
|
||||
<start>\@[A-Z_][A-Z_0-9]{3,500}\@</start>
|
||||
</rule>
|
||||
<rule name="Function name">
|
||||
<color>functionName</color>
|
||||
<start>\@(\w|_)+[ \t]*\(</start>
|
||||
</rule>
|
||||
<rule name="condition">
|
||||
<color>boolean</color>
|
||||
<start>==|<=|>=|!=|<{1,2}|>{1,2}|&&|\{|\}|</start>
|
||||
</rule>
|
||||
</pass2>
|
||||
</EdnLang>
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<EdnLang version="0.1" lang="XML">
|
||||
<EdnLang version="0.2" lang="XML">
|
||||
<ext>*.xml</ext>
|
||||
<ext>*.eol</ext>
|
||||
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
|
||||
<rule name="Comment">
|
||||
<color>comment</color>
|
||||
@@ -27,7 +28,7 @@
|
||||
</rule>
|
||||
<rule name="normale Balise">
|
||||
<color>functionName</color>
|
||||
<start></\w*|<\w*|/>|></start>
|
||||
<start></[0-9a-fA-F_]*|<[0-9a-fA-F_]*|/>|></start>
|
||||
</rule>
|
||||
</pass2>
|
||||
</EdnLang>
|
85
build.xml
Normal file
85
build.xml
Normal file
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="edn" default="help">
|
||||
|
||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||
It contains the path to the SDK. It should *NOT* be checked into
|
||||
Version Control Systems. -->
|
||||
<loadproperties srcFile="local.properties" />
|
||||
|
||||
<!-- The ant.properties file can be created by you. It is only edited by the
|
||||
'android' tool to add properties to it.
|
||||
This is the place to change some Ant specific build properties.
|
||||
Here are some properties you may want to change/update:
|
||||
|
||||
source.dir
|
||||
The name of the source directory. Default is 'src'.
|
||||
out.dir
|
||||
The name of the output directory. Default is 'bin'.
|
||||
|
||||
For other overridable properties, look at the beginning of the rules
|
||||
files in the SDK, at tools/ant/build.xml
|
||||
|
||||
Properties related to the SDK location or the project target should
|
||||
be updated using the 'android' tool with the 'update' action.
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems.
|
||||
|
||||
-->
|
||||
<property file="ant.properties" />
|
||||
|
||||
<!-- The project.properties file is created and updated by the 'android'
|
||||
tool, as well as ADT.
|
||||
|
||||
This contains project specific properties such as project target, and library
|
||||
dependencies. Lower level build properties are stored in ant.properties
|
||||
(or in .classpath for Eclipse projects).
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems. -->
|
||||
<loadproperties srcFile="project.properties" />
|
||||
|
||||
<!-- quick check on sdk.dir -->
|
||||
<fail
|
||||
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
|
||||
unless="sdk.dir"
|
||||
/>
|
||||
|
||||
|
||||
<!-- extension targets. Uncomment the ones where you want to do custom work
|
||||
in between standard targets -->
|
||||
<!--
|
||||
<target name="-pre-build">
|
||||
</target>
|
||||
<target name="-pre-compile">
|
||||
</target>
|
||||
|
||||
/* This is typically used for code obfuscation.
|
||||
Compiled code location: ${out.classes.absolute.dir}
|
||||
If this is not done in place, override ${out.dex.input.absolute.dir} */
|
||||
<target name="-post-compile">
|
||||
</target>
|
||||
-->
|
||||
|
||||
<!-- Import the actual build file.
|
||||
|
||||
To customize existing targets, there are two options:
|
||||
- Customize only one target:
|
||||
- copy/paste the target into this file, *before* the
|
||||
<import> task.
|
||||
- customize it to your needs.
|
||||
- Customize the whole content of build.xml
|
||||
- copy/paste the content of the rules files (minus the top node)
|
||||
into this file, replacing the <import> task.
|
||||
- customize to your needs.
|
||||
|
||||
***********************
|
||||
****** IMPORTANT ******
|
||||
***********************
|
||||
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
|
||||
in order to avoid having your file be overridden by tools such as "android update project"
|
||||
-->
|
||||
<!-- version-tag: 1 -->
|
||||
<import file="${sdk.dir}/tools/ant/build.xml" />
|
||||
|
||||
</project>
|
3
ctags.sh
Executable file
3
ctags.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
ctags -R --fields=+n jni/ ../../../../usr/include/freetype2 ../ewol/
|
14
data/edn.desktop
Normal file
14
data/edn.desktop
Normal file
@@ -0,0 +1,14 @@
|
||||
[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 ...
|
Binary file not shown.
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.3 KiB |
Binary file not shown.
421
data/imagesSources/icone.xpm
Normal file
421
data/imagesSources/icone.xpm
Normal file
@@ -0,0 +1,421 @@
|
||||
/* XPM */
|
||||
static char * icone_xpm[] = {
|
||||
"128 128 290 2",
|
||||
" c None",
|
||||
". c #0A0A0A",
|
||||
"+ c #0B0B0B",
|
||||
"@ c #0C0C0C",
|
||||
"# c #0D0D0D",
|
||||
"$ c #0E0E0E",
|
||||
"% c #0F0F0F",
|
||||
"& c #070707",
|
||||
"* c #030303",
|
||||
"= c #020202",
|
||||
"- c #010101",
|
||||
"; c #040404",
|
||||
"> c #000000",
|
||||
", c #111111",
|
||||
"' c #000100",
|
||||
") c #131313",
|
||||
"! c #262626",
|
||||
"~ c #151515",
|
||||
"{ c #000301",
|
||||
"] c #000602",
|
||||
"^ c #000502",
|
||||
"/ c #000401",
|
||||
"( c #000803",
|
||||
"_ c #1E1E1E",
|
||||
": c #013413",
|
||||
"< c #016023",
|
||||
"[ c #026625",
|
||||
"} c #016424",
|
||||
"| c #016324",
|
||||
"1 c #026525",
|
||||
"2 c #016524",
|
||||
"3 c #016223",
|
||||
"4 c #026725",
|
||||
"5 c #00270E",
|
||||
"6 c #000200",
|
||||
"7 c #040505",
|
||||
"8 c #1A1A1A",
|
||||
"9 c #014A1A",
|
||||
"0 c #03B843",
|
||||
"a c #04CB4A",
|
||||
"b c #02802E",
|
||||
"c c #000D04",
|
||||
"d c #000001",
|
||||
"e c #1C1C1C",
|
||||
"f c #252626",
|
||||
"g c #014C1B",
|
||||
"h c #03B943",
|
||||
"i c #026D28",
|
||||
"j c #000C1B",
|
||||
"k c #0A438A",
|
||||
"l c #24282C",
|
||||
"m c #014E1C",
|
||||
"n c #03BB44",
|
||||
"o c #03CA49",
|
||||
"p c #000702",
|
||||
"q c #000B19",
|
||||
"r c #005DD2",
|
||||
"s c #0072FF",
|
||||
"t c #0C58B6",
|
||||
"u c #01501D",
|
||||
"v c #03BE45",
|
||||
"w c #000A18",
|
||||
"x c #0061D9",
|
||||
"y c #0C58B5",
|
||||
"z c #24282D",
|
||||
"A c #03BF45",
|
||||
"B c #0E55AF",
|
||||
"C c #24292F",
|
||||
"D c #03BD45",
|
||||
"E c #026D27",
|
||||
"F c #0F52A5",
|
||||
"G c #242931",
|
||||
"H c #014B1B",
|
||||
"I c #02752A",
|
||||
"J c #000E20",
|
||||
"K c #0058C7",
|
||||
"L c #10509D",
|
||||
"M c #232A32",
|
||||
"N c #03B743",
|
||||
"O c #027A2C",
|
||||
"P c #000F23",
|
||||
"Q c #0054BD",
|
||||
"R c #114F9C",
|
||||
"S c #232A31",
|
||||
"T c #01491A",
|
||||
"U c #03B642",
|
||||
"V c #027B2C",
|
||||
"W c #0053BA",
|
||||
"X c #0071FE",
|
||||
"Y c #10509F",
|
||||
"Z c #242930",
|
||||
"` c #03B742",
|
||||
" . c #02772B",
|
||||
".. c #0054BC",
|
||||
"+. c #0F53A8",
|
||||
"@. c #24282E",
|
||||
"#. c #026F28",
|
||||
"$. c #000C1C",
|
||||
"%. c #0058C5",
|
||||
"&. c #0D56B1",
|
||||
"*. c #005CD0",
|
||||
"=. c #0061DA",
|
||||
"-. c #0D56B0",
|
||||
";. c #026B27",
|
||||
">. c #030406",
|
||||
",. c #0452B1",
|
||||
"'. c #0F53A7",
|
||||
"). c #02742A",
|
||||
"!. c #1D1D1D",
|
||||
"~. c #222C39",
|
||||
"{. c #0566DC",
|
||||
"]. c #10509E",
|
||||
"^. c #02792C",
|
||||
"/. c #050505",
|
||||
"(. c #222C38",
|
||||
"_. c #0665DC",
|
||||
":. c #114F9B",
|
||||
"<. c #1B1B1B",
|
||||
"[. c #222D3A",
|
||||
"}. c #0763D4",
|
||||
"|. c #02782B",
|
||||
"1. c #212E3C",
|
||||
"2. c #095FCB",
|
||||
"3. c #027129",
|
||||
"4. c #212F40",
|
||||
"5. c #0A5DC3",
|
||||
"6. c #026826",
|
||||
"7. c #203042",
|
||||
"8. c #0A5CC1",
|
||||
"9. c #212F42",
|
||||
"0. c #0A5DC5",
|
||||
"a. c #212E3F",
|
||||
"b. c #0860CD",
|
||||
"c. c #252525",
|
||||
"d. c #026A26",
|
||||
"e. c #222D3C",
|
||||
"f. c #0763D7",
|
||||
"g. c #02732A",
|
||||
"h. c #202020",
|
||||
"i. c #090909",
|
||||
"j. c #1F2020",
|
||||
"k. c #080808",
|
||||
"l. c #0763D5",
|
||||
"m. c #23282F",
|
||||
"n. c #0860CB",
|
||||
"o. c #0070FB",
|
||||
"p. c #082D5A",
|
||||
"q. c #0A5DC4",
|
||||
"r. c #0071FD",
|
||||
"s. c #003B84",
|
||||
"t. c #00040A",
|
||||
"u. c #026926",
|
||||
"v. c #00387F",
|
||||
"w. c #00050D",
|
||||
"x. c #00060F",
|
||||
"y. c #00250D",
|
||||
"z. c #006FF9",
|
||||
"A. c #003E8C",
|
||||
"B. c #016C27",
|
||||
"C. c #006EF7",
|
||||
"D. c #004193",
|
||||
"E. c #000206",
|
||||
"F. c #004397",
|
||||
"G. c #000104",
|
||||
"H. c #004294",
|
||||
"I. c #001608",
|
||||
"J. c #02762B",
|
||||
"K. c #003F8D",
|
||||
"L. c #028932",
|
||||
"M. c #000A03",
|
||||
"N. c #003B85",
|
||||
"O. c #000409",
|
||||
"P. c #029034",
|
||||
"Q. c #001708",
|
||||
"R. c #029536",
|
||||
"S. c #001909",
|
||||
"T. c #029737",
|
||||
"U. c #00230C",
|
||||
"V. c #202E3E",
|
||||
"W. c #043068",
|
||||
"X. c #00060E",
|
||||
"Y. c #002D10",
|
||||
"Z. c #141414",
|
||||
"`. c #010102",
|
||||
" + c #002B0F",
|
||||
".+ c #242424",
|
||||
"++ c #028A32",
|
||||
"@+ c #161616",
|
||||
"#+ c #028530",
|
||||
"$+ c #00290F",
|
||||
"%+ c #028430",
|
||||
"&+ c #02812F",
|
||||
"*+ c #028831",
|
||||
"=+ c #029636",
|
||||
"-+ c #028F34",
|
||||
";+ c #003111",
|
||||
">+ c #03AF40",
|
||||
",+ c #029436",
|
||||
"'+ c #014318",
|
||||
")+ c #03C146",
|
||||
"!+ c #015D21",
|
||||
"~+ c #029135",
|
||||
"{+ c #028B32",
|
||||
"]+ c #028631",
|
||||
"^+ c #03A63C",
|
||||
"/+ c #000F21",
|
||||
"(+ c #0E3564",
|
||||
"_+ c #000F22",
|
||||
":+ c #026DF3",
|
||||
"<+ c #144888",
|
||||
"[+ c #000D1F",
|
||||
"}+ c #0054BE",
|
||||
"|+ c #026DF2",
|
||||
"1+ c #028D33",
|
||||
"2+ c #0059C8",
|
||||
"3+ c #016EF3",
|
||||
"4+ c #144889",
|
||||
"5+ c #24282B",
|
||||
"6+ c #029435",
|
||||
"7+ c #005ED3",
|
||||
"8+ c #016FF6",
|
||||
"9+ c #14498B",
|
||||
"0+ c #252628",
|
||||
"a+ c #0070F9",
|
||||
"b+ c #134A8C",
|
||||
"c+ c #0071FC",
|
||||
"d+ c #134A8D",
|
||||
"e+ c #029235",
|
||||
"f+ c #14498C",
|
||||
"g+ c #252729",
|
||||
"h+ c #028C33",
|
||||
"i+ c #016FF9",
|
||||
"j+ c #14498A",
|
||||
"k+ c #001206",
|
||||
"l+ c #016EF5",
|
||||
"m+ c #001E0B",
|
||||
"n+ c #028731",
|
||||
"o+ c #003312",
|
||||
"p+ c #029335",
|
||||
"q+ c #027D2D",
|
||||
"r+ c #000F05",
|
||||
"s+ c #000A17",
|
||||
"t+ c #027C2D",
|
||||
"u+ c #123764",
|
||||
"v+ c #026DF1",
|
||||
"w+ c #000C04",
|
||||
"x+ c #16447B",
|
||||
"y+ c #000E05",
|
||||
"z+ c #101010",
|
||||
"A+ c #026CF0",
|
||||
"B+ c #001106",
|
||||
"C+ c #174379",
|
||||
"D+ c #026CED",
|
||||
"E+ c #03C949",
|
||||
"F+ c #001407",
|
||||
"G+ c #174276",
|
||||
"H+ c #036AEA",
|
||||
"I+ c #25272A",
|
||||
"J+ c #184174",
|
||||
"K+ c #036AE8",
|
||||
"L+ c #184173",
|
||||
"M+ c #036AE9",
|
||||
"N+ c #121212",
|
||||
"O+ c #001307",
|
||||
"P+ c #25272B",
|
||||
"Q+ c #036BEB",
|
||||
"R+ c #001006",
|
||||
"S+ c #174277",
|
||||
"T+ c #026CEE",
|
||||
"U+ c #242525",
|
||||
"V+ c #17437A",
|
||||
"W+ c #232426",
|
||||
"X+ c #006CF1",
|
||||
"Y+ c #0B2A51",
|
||||
"Z+ c #004396",
|
||||
"`+ c #000103",
|
||||
" @ c #004192",
|
||||
".@ c #000205",
|
||||
"+@ c #003D8A",
|
||||
"@@ c #000307",
|
||||
"#@ c #003A83",
|
||||
"$@ c #0269E8",
|
||||
"%@ c #242629",
|
||||
"&@ c #0B223D",
|
||||
"*@ c #00050C",
|
||||
"=@ c #039938",
|
||||
"-@ c #015920",
|
||||
";@ c #014D1C",
|
||||
">@ c #232323",
|
||||
",@ c #181818",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" . + @ # @ @ @ # # # # @ @ @ # # # @ @ @ # # # @ @ @ # # # # @ @ @ # # $ % ",
|
||||
" & * = - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - = * & $ ",
|
||||
" ; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ; , ",
|
||||
" > ' > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ) ",
|
||||
" > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > , ! ",
|
||||
" > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > - ~ ! ! ",
|
||||
" > > > > > > > > > { ] ^ / / / ] ^ ^ / / / ^ ^ ] / / / ^ ^ ] ^ / / ^ ] ( ' > > > > > > > > & _ ! ! ! ",
|
||||
" > > > > > > > > / : < [ } | | | 1 2 2 3 | 3 1 2 1 | | 3 } 1 1 } | | | 4 5 6 > > > > > > > 7 8 ! ! ! ! ! ",
|
||||
" > > > > > > > > 6 9 0 a a a a a a a a a a a a a a a a a a a a a a a a a b c > > > > > d > 7 e f ! ! ! ! ! ! ",
|
||||
" > > > > > > > > > g h a a a a a a a a a a a a a a a a a a a a a a a a a i ^ > > > > > d > j k l ! f ! ! ! ! ! ! ",
|
||||
" > > > > > > > > > m n a a a a a a a a a a a a a a a a a a a a a a a o a 1 p > > > > > d > q r s t l ! f ! ! ! ! ! ! ",
|
||||
" > > > > > > > > > u v a a a a a a a a a a a a a a a a a a a a a a a a a 3 p > > > > > d > w x s s s y z ! f ! ! ! ! ! ! ",
|
||||
" > > > > > > > > > u A a a a a a a a a a a a a a a a a a a a a a a a a a 2 ( > > > > > d > q x s s s s s B C ! f ! ! ! ! ! ! ",
|
||||
" > > > > > > > > > m D a a a a a a a a a a a a a a a a a a a a a a a a a E p > > > > d > > j r s s s s s s s F G ! ! ! ! ! ! ! ! ",
|
||||
" > > > > > > > > { H n a a a a a a a a a a a a a a a a a a a a a a a a a I ^ > > > > d > > J K s s s s s s s s s L M ! f ! ! ! ! ! ! ",
|
||||
" > > > > > > > > ^ 9 N a a a a a a a a a a a a a a a a a a a a a a a a a O / > > > > d > > P Q s s s s s s s s s s s R S ! f ! ! ! ! ! ! ",
|
||||
" > > > > > > > > / T U a a a a a a a a a a a a a a a a a a a a a a a a a V { > > > > > > > P W s s s s s s s s s s s X s Y Z ! f ! ! ! ! ! ! ",
|
||||
" > > > > > > > > { 9 ` a a a a a a a a a a a a a a a a a a a a a a a a a .{ > > > > > d > J ..s s s s s s s s s s s s s s s +.@.! f ! ! ! ! ! ! ",
|
||||
" > > > > > > > > > g 0 a a a a a a a a a a a a a a a a a a a a a a a a a #.^ > > > > > d > $.%.s s s s s s s s s s s s s s s s s &.l ! f ! ! ! ! ! ! ",
|
||||
" > > > > > > > > > m n a a a a a a a a a a a a a a a a a a a a a a a o a 4 ] > > > > > d > q *.s s s s s s s s s s s s s s s s s s s t l ! f ! ! ! ! ! ! ",
|
||||
" > > > > > > > > > u v a a a a a a a a a a a a a a a a a a a a a a a a a 3 p > > > > > d > w x s s s s s s s s s s s s s s s s s s s s s y z ! f ! ! ! ! ! ! ",
|
||||
" > > > > > > > > > u A a a a a a a a a a a a a a a a a a a a a a a a a a } ( > > > > > > > w =.s s s s s s s s s s s s s s s s s s s s s s s -.@.! f ! ! ! ! ! ! ",
|
||||
" > > > > > > > > > m v a a a a a a a a a a a a a a a a a a a a a a a a a ;.p > > > > > > > >.,.s s s s s s s s s s s s s s s s s s s s s s s s s '.G ! ! f ! ! ! ! ! ",
|
||||
" > > > > > > > > { H n a a a a a a a a a a a a a a a a a a a a a a a a a ).^ > > > > > > > ; !.~.{.s s s s s s s s s s s s s s s s s s s s s s s s s ].M ! ! ! ! ! ! ! ! ",
|
||||
" > > > > > > > > ^ 9 0 a a a a a a a a a a a a a a a a a a a a a a a a a ^./ > > > > > > > /.e f ! (._.s s s s s s s s s s s s s s s s s s s s s s s s s :.M ! f ! ! ! ! ! ! ",
|
||||
" > > > > > > > > ^ T ` a a a a a a a a a a a a a a a a a a a a a a a a a V { > > > > > > > /.<.! ! f ! [.}.s s s s s s s s s s s s s s s s s s s s s s s X s ].G ! f ! ! ! ! ! ! ",
|
||||
" > > > > > > > > { 9 ` a a a a a a a a a a a a a a a a a a a a a a a a a |.{ > > > > > > > ; e ! ! ! ! f ! 1.2.s s s s s s s s s s s s s s s s s s s s s s s s s '.@.! f ! ! ! ! ! ! ",
|
||||
" > > > > > > > > > H 0 a a a a a a a a a a a a a a a a a a a a a a a a a 3./ > > > > > > > > ~ ! ! ! ! ! ! f ! 4.5.s s s s s s s s s s s s s s s s s s s s s s s s s -.z ! f ! ! ! ! ! ! ",
|
||||
" > > > > > > > > > m n a a a a a a a a a a a a a a a a a a a a a a a o a 6.] > > > > > > > > ! ! ! ! ! ! ! ! 7.8.s s s s s s s s s s s s s s s s s s s s s s s s s y l ! f ! ! ! ! ! ! ",
|
||||
" > > > > > > > > > u v a a a a a a a a a a a a a a a a a a a a a a a a a | p > > > > > > > > ! ! ! ! ! ! ! ! 9.0.s s s s s s s s s s s s s s s s s s s s s s s s s t l ! f ! ! ! ! ! ! ",
|
||||
" > > > > > > > > > u A a a a a a a a a a a a a a a a a a a a a a a a a a } ( > > > > > > > > ! ! ! ! ! ! ! ! a.b.s s s s s s s s s s s s s s s s s s s s s s s s s &.@.! f ! ! ! ! ! c. ",
|
||||
" > > > > > > > > > m v a a a a a a a a a a a a a a a a a a a a a a a a a d.p > > > > > > > > ! ! ! ! ! ! ! ! e.f.s s s s s s s s s s s s s s s s s s s s s s s s s +.Z ! f ! ! ! c.~ - ",
|
||||
" > > > > > > > > { g n a a a a a a a a a a a a a a a a a a a a a a a a a g.] > > > > > > > > ! ! ! ! ! ! f ! ~.{.s s s s s s s s s s s s s s s s s s s s s s s s s Y S ! ! ! h.i.> > > ",
|
||||
" e = > > > > > > > / 9 0 a a a a a a a a a a a a a a a a a a a a a a a a a ^./ > > > > > > > > ! ! ! ! ! ! ! f ! (._.s s s s s s s s s s s s s s s s s s s s s s s s s R M ! j.k.> > > > > ",
|
||||
" !.k.> > > > > > > ^ T ` a a a a a a a a a a a a a a a a a a a a a a a a a V { > > > > > > > > ! ! ! ! ! ! f ! ~.l.s s s s s s s s s s s s s s s s s s s s s s s X s L m., > > > > > > ",
|
||||
" $ = > > > > > > > { 9 U a a a a a a a a a a a a a a a a a a a a a a a a a ^.{ > > > > > > > > ! ! ! ! ! ! f ! e.n.s s s s s s s s s s s s s s s s s s s s s s s s o.p.> > > > > > > ",
|
||||
" > > > > > > > > > H N a a a a a a a a a a a a a a a a a a a a a a a a a 3./ > > > > > > > > ! ! ! ! ! ! f ! a.q.s s s s s s s s s s s s s s s s s s s s s s r.s.t.> > > > > > > ",
|
||||
" > > > > > > > > > m n a a a a a a a a a a a a a a a a a a a a a a a a a u.] > > > > > > > > ! ! ! ! ! ! ! ! 9.8.s s s s s s s s s s s s s s s s s s s s r.v.w.> > > > > > > > ",
|
||||
" > > > > > > > > u D a a a a a a a a a a a a a a a a a a a a a a a a a | p > > > > > > > > ! ! ! ! ! ! ! ! 9.q.s s s s s s s s s s s s s s s s s s r.v.x.> > > > > > > > > > ",
|
||||
" > > > > > > > > u A a a a a a a a a a a a a a a a a a a a a a a a a a | ( > > > > > > > > ! ! ! ! ! ! ! ! a.n.s s s s s s s s s s s s s s s s o.s.w.> > d > > > > > > > > ",
|
||||
" > > > > > > > y.v a a a a a a a a a a a a a a a a a a a a a a a a a u.p > > > > > > > > ! ! ! ! ! ! ! ! e.l.s s s s s s s s s s s s s s z.A.t.> > d > > > > > > > > ' ",
|
||||
" > > > > > > > B.a a a a a a a a a a a a a a a a a a a a a a a a a 3.] > > > > > > > > ! ! ! ! ! ! f ! ~._.s s s s s s s s s s s s C.D.E.> d > > > > > > > > > > ' ",
|
||||
" > > > > > > > O a a a a a a a a a a a a a a a a a a a a a a a a ^./ > > > > > > > > ! ! ! ! ! ! ! f ! (.{.s s s s s s s s s s C.F.G.> d > > > > > > > > > > > > ",
|
||||
" > > > > > > > I a a a a a a a a a a a a a a a a a a a a a a a V { > > > > > > > > ! ! ! ! ! ! f ! ~.f.s s s s s s s s z.H.G.> d > > > > > I.] > > > > > > ",
|
||||
" > > > > > > > J.a a a a a a a a a a a a a a a a a a a a a a ^.{ > > > > > > > > ! ! ! ! ! ! f ! e.b.s s s s s s o.K.E.> d > > > > > I.L.M.> > > > > > ",
|
||||
" > > > > > > > J.a a a a a a a a a a a a a a a a a a a a a g./ > > > > > > > > ! ! ! ! ! ! f ! a.0.s s s s r.N.O.> d > > > > > I.P.a c > > > > > > ",
|
||||
" > > > > > > > I a a a a a a a a a a a a a a a a a a a a d.] > > > > > > > > ! ! ! ! ! ! ! ! 9.8.s s r.v.w.> d > > > > > Q.R.a a S.> > > > > > ",
|
||||
" / > > > > > > O a a a a a a a a a a a a a a a a a o a } p > > > > > > > > ! ! ! ! ! ! ! ! 7.5.r.v.x.> > > > > > > Q.T.a a a U.> > > > > > ",
|
||||
" p > > > > > > O a a a a a a a a a a a a a a a a a a | ( > > > > > > > > ! ! ! ! ! ! ! ! V.W.X.> > d > > > > I.R.a a a a Y.> > > > > > ",
|
||||
" M.> > > > > > O a a a a a a a a a a a a a a a a a 6.p > > > > > > > > ! ! ! ! ! ! c.Z.`.> > d > > > > I.P.a a a a a +> > > > > > ",
|
||||
" ( > > > > > > I a a a a a a a a a a a a a a a a 3.] > > > > > > > > ! ! ! ! .+~ - > > > > > > > I.++a a a a a a Y.> > > > > > ",
|
||||
" p > > > > > > J.a a a a a a a a a a a a a a a |./ > > > > > > > > ! ! ! .+@+> > > > > > > > Q.#+a a a a a a a $+> > > > > > ",
|
||||
" ( > > > > > > J.a a a a a a a a a a a a a a V { > > > > > > > > .+@+> > > > > > > > I.%+a a a a a a a a $+> > > > > > ",
|
||||
" p > > > > > > &+a a a a a a a a a a a a a ^.{ > > > > > > > > # > > > > > > > > I.*+a a a a a a a a a $+> > > > > > ",
|
||||
" ] > > > > > > =+a a a a a a a a a a a a )./ > > > > > > > > > > > > > > > > I.-+a a a a a a a a a a ;+> > > > > > ",
|
||||
" > > > > > > > >+a a a a a a a a a a a ;.^ > > > > > > > > > > > > > > > > > Q.,+a a a a a a a a a a a '+> > > > > > ",
|
||||
" 6 > > > > > ' )+a a a a a a a a o a } p > > > > > > > * > > > > > > > > > Q.T.a a a a a a a a a a a a !+> > > > > > ",
|
||||
" ' > > > > > ' a a a a a a a a a a 3 ( > > > > > > > * h.! > > > > > > > > I.=+a a a a a a a a a a a a a 3.> > > > > > ",
|
||||
" > > > > > > > a a a a a a a a a 4 p > > > > > > > * h.! ! ! > > > > > > > > I.~+a a a a a a a a a a a a a a b > > > > > > ",
|
||||
" > > > > > > > a a a a a a a a #.] > > > > > > > ; _ ! ! ! ! ! > > > > > > > > I.{+a a a a a a a a a a a a a a a P.> > > > > > ",
|
||||
" ' > > > > > ' a a a a a a a .^ > > > > d > > 7 !.! ! ! ! ! ! ! > > > > > > > > Q.]+a a a a a a a a a a a a a a a a ^+> > > > > > ",
|
||||
" 6 > > > > > 6 a a a a a a V { > > > > d > > /+(+C ! ! ! ! ! ! ! ! > > > > > > > > I.%+a a a a a a a a a a a a a a a a a h > > > > > > ",
|
||||
" > > > > > > > a a a a a O { > > > > > > > _+W :+<+Z ! ! ! ! ! ! ! ! > > > > > > > > I.*+a a a a a a a a a a a a a a a a a a a ' > > > > > ",
|
||||
" 6 > > > > > 6 a a a a I / > > > > > d > [+}+s s |+<+@.! ! ! ! ! ! ! ! > > > > > > > > I.1+a a a a a a a a a a a a a a a a a a a a > > > > > > ",
|
||||
" ' > > > > > ' a a a E ^ > > > > > d > j 2+s s s s 3+4+5+! f ! ! ! ! ! ! > > > > > > > > > Q.6+a a a a a a a a a a a a a a a a a a a a a 6 > > > > > ",
|
||||
" > > > > > > > o a 2 p > > > > > d > w 7+s s s s s s 8+9+0+! f ! ! ! ! ! ! > > > > > > > > > Q.T.a a a a a a a a a a a a a a a a a a a a a a { > > > > > > ",
|
||||
" > > > > > > > a 3 ( > > > > > d > w =.s s s s s s s s a+b+f ! f ! ! ! ! ! ! > > > > > > > > Q.=+a a a a a a a a a a a a a a a a a a a a a a a ] > > > > > > ",
|
||||
" ' > > > > > ' 1 p > > > > > d > q x s s s s s s s s s s c+d+f ! f ! ! ! ! ! ! > > > > > > > > I.e+a a a a a a a a a a a a a a a a a a a a a a a a p > > > > > > ",
|
||||
" ' > > > > > 6 p > > > > d > > $.*.s s s s s s s s s s s s o.f+g+! ! ! ! ! ! ! ! > > > > > > > > I.h+a a a a a a a a a a a a a a a a a a a a a a a a a M.> > > > > > ",
|
||||
" > > > > > > > > > > > d > > J %.s s s s s s s s s s s s s s i+j+l ! ! ! ! ! ! ! ! > > > > > > > > Q.]+a a a a a a a a a a a a a a a a a a a a a a a a a a k+> > > > > > ",
|
||||
" > > > > > > > > > > d > > P ..s s s s s s s s s s s s s s s s l+<+C ! ! ! ! ! ! ! ! > > > > > > > > Q.%+a a a a a a a a a a a a a a a a a a a a a a a a a a a m+> > > > > > ",
|
||||
" > > > > > > > > > > > > P W s s s s s s s s s s s s s s s s s s :+<+Z ! ! ! ! ! ! ! ! > > > > > > > > I.n+a a a a a a a a a a a a a a a a a a a a a a a a a a a a $+> > > > > > ",
|
||||
" > > > > > > > > > d > J Q s s s s s s s s s s s s s s s s s s s s |+<+C ! ! ! ! ! ! ! ! > > > > > > > > I.h+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a o+> > > > > > ",
|
||||
" > > > > > > > > d > j K s s s s s s s s s s s s s s s s s s s s s s 3+4+5+! f ! ! ! ! ! ! > > > > > > > > Q.p+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a Y.> > > > > > ",
|
||||
" > > > > > > > d > q r s s s s s s s s s s s s s s s s s s s s s s s s 8+j+0+! f ! ! ! ! ! ! > > > > > > > > > Q.T.a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a q+M.> > > > > > ",
|
||||
" > > > > > > > > w x s s s s s s s s s s s s s s s s s s s s s s s s s s a+b+f ! f ! ! ! ! ! ! > > > > > > > > > Q.T.a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a q+r+> > > > > > > ",
|
||||
" > > > > > > > s+x s s s s s s s s s s s s s s s s s s s s s s s s s s s s o.d+f ! f ! ! ! ! ! ! > > > > > > > > I.p+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a t+c > > > > > > > > ",
|
||||
" > > > > > > - u+v+s s s s s s s s s s s s s s s s s s s s s s s s s s s s s o.b+0+! ! ! ! ! ! ! ! > > > > > > > > I.h+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a t+w+> > > > > > > - ",
|
||||
" > > > > > > , ! x+|+s s s s s s s s s s s s s s s s s s s s s s s s s s s s s a+j+5+! ! ! ! ! ! ! ! > > > > > > > > Q.n+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a q+y+> > > > > > > > ",
|
||||
" > > > - z+! ! ! x+A+s s s s s s s s s s s s s s s s s s s s s s s s s s s s s 8+4+C ! ! ! ! ! ! ! ! > > > > > > > > Q.%+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a q+B+> > > > > > > > ",
|
||||
" > > /.<.! ! ! ! ! C+D+s s s s s s s s s s s s s s s s s s s s s s s s s s s s s 3+<+Z ! ! ! ! ! ! ! ! > > > > > > > > I.]+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a E+q+F+> > > > > > > > ",
|
||||
" * e ! ! ! ! ! ! f G+H+s s s s s s s s s s s s s s s s s s s s s s s s s s s s s |+<+C ! ! ! ! ! ! ! ! > > > > > > > > I.h+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a E+q+I.> > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! I+J+K+s s s s s s s s s s s s s s s s s s s s s s s s s s s s s :+<+l ! f ! ! ! ! ! c.k.> > > > > > > > Q.e+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a q+I.> > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! 5+L+M+s s s s s s s s s s s s s s s s s s s s s s s s s s s s s l+j+g+! f ! ! ! c.N+- > > > > > > > Q.=+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a q+O+> > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! P+J+Q+s s s s s s s s s s s s s s s s s s s s s s s s s s s s s i+f+f ! f ! c.) = > > > > > > > Q.T.a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a q+R+> > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! g+S+T+s s s s s s s s s s s s s s s s s s s s s s s s s s s s s o.d+f ! U+) - > > > > > > > I.6+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a t+c > > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! ! V+v+s s s s s s s s s s s s s s s s s s s s s s s s s s s s s c+b+W+~ - > > > > > > > I.1+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a t+w+> > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! ! x+|+s s s s s s s s s s s s s s s s s s s s s s s s s s s s s X+Y+d > > > > > > > I.*+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a q+c > > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! ! x+v+s s s s s s s s s s s s s s s s s s s s s s s s s s s C.Z+`+> > > > > > > Q.%+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a q+R+> > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! ! C+D+s s s s s s s s s s s s s s s s s s s s s s s s s z. @.@> > > > > > > I.]+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a E+q+F+> > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! f G+Q+s s s s s s s s s s s s s s s s s s s s s s s o.+@@@> > > > > > > I.{+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a E+q+I.> > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! g+J+M+s s s s s s s s s s s s s s s s s s s s s r.#@t.> > > > > > > I.~+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a q+I.> > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! 5+L+M+s s s s s s s s s s s s s s s s s s s r.v.X.> d > > > > > Q.=+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a q+F+> > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! 5+J+Q+s s s s s s s s s s s s s s s s s r.v.x.> > > > > > > Q.T.a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a q+R+> > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! g+G+D+s s s s s s s s s s s s s s s o.N.w.> > > > > > > I.,+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a t+c > > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! f C+v+s s s s s s s s s s s s s z.K.O.> > > > > > > I.-+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a t+w+> > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! ! x+|+s s s s s s s s s s s C.H.E.> d > > > > > I.*+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a q+c > > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! ! x+v+s s s s s s s s s C.F.G.> > > > > > > Q.%+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a q+R+> > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! ! V+T+s s s s s s s z.D.G.> > > > > > > I.#+a a a a a a a a a a a a a a a a a a a a a a a a a a a a a E+q+O+> > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! ! S+Q+s s s s s o.A.E.> > > > > > > I.++a a a a a a a a a a a a a a a a a a a a a a a a a a a a a E+q+I.> > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! g+J+M+s s s r.s.t.> > > > > > > I.P.a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a q+I.> > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! P+L+K+s r.v.w.> > > > > > > Q.R.a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a q+F+> > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! 5+J+$@v.x.> > > > > > > Q.T.a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a q+B+> > > > > > > > ",
|
||||
" ! ! ! ! ! ! ! ! %@&@*@> > d > > > > S.=@a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a t+y+> > > > > > > > ",
|
||||
" ! ! ! ! ! ! c.~ > > > d > > > > y+-@t+^.^. .q+q+t+|.^.|.t+q+q+ .^.^.^.q+q+^.^.^.|.q+q+V |.^. .b ;@( > > > > > > > > ",
|
||||
" ! ! ! ! c._ i.> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ",
|
||||
" ! ! c._ z+= > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ",
|
||||
" ! >@N+- > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ",
|
||||
" >@z+> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ",
|
||||
" @+; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > = /. ",
|
||||
" k.> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > * + $ ",
|
||||
" ,@8 8 ,@ ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" "};
|
29
jni/Android.mk
Normal file
29
jni/Android.mk
Normal file
@@ -0,0 +1,29 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
# load the common sources file of the platform
|
||||
include $(LOCAL_PATH)/file.mk
|
||||
|
||||
LOCAL_MODULE := ednpackage
|
||||
LOCAL_STATIC_LIBRARIES := ewol etk tinyxml libzip libpng
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(addprefix $(LOCAL_PATH)/, $(sort $(dir $(FILE_LIST))))
|
||||
|
||||
LOCAL_SRC_FILES := ewolAndroidAbstraction.cpp \
|
||||
$(FILE_LIST)
|
||||
|
||||
LOCAL_LDLIBS := -llog -landroid
|
||||
|
||||
LOCAL_CFLAGS := -D__PLATFORM__Android \
|
||||
-DEWOL_USE_FREE_TYPE \
|
||||
-DETK_DEBUG_LEVEL=3 \
|
||||
-DEDN_DEBUG_LEVEL=3 \
|
||||
-DDATA_IN_APK
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
NDK_MODULE_PATH := $(LOCAL_PATH)/../../
|
||||
|
||||
|
||||
$(call import-module,ewol/Sources)
|
26
jni/Linux.mk
Normal file
26
jni/Linux.mk
Normal file
@@ -0,0 +1,26 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
# load the common sources file of the platform
|
||||
include $(LOCAL_PATH)/file.mk
|
||||
|
||||
LOCAL_MODULE := ednn
|
||||
LOCAL_STATIC_LIBRARIES := ewol etk tinyxml libzip libpng libfreetype
|
||||
|
||||
LOCAL_C_INCLUDES := -I$(LOCAL_PATH) $(addprefix -I$(LOCAL_PATH)/, $(sort $(dir $(FILE_LIST))))
|
||||
|
||||
LOCAL_SRC_FILES := $(FILE_LIST)
|
||||
|
||||
|
||||
LOCAL_LDLIBS :=
|
||||
|
||||
LOCAL_CFLAGS := -DEWOL_USE_FREE_TYPE \
|
||||
-DEDN_DEBUG_LEVEL=3
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
||||
NDK_MODULE_PATH := $(LOCAL_PATH)/../../
|
||||
|
||||
|
||||
$(call import-module,ewol/Sources)
|
@@ -23,10 +23,11 @@
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "tools_globals.h"
|
||||
#include "Buffer.h"
|
||||
#include "BufferManager.h"
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <Buffer.h>
|
||||
#include <BufferManager.h>
|
||||
#include <ewol/WidgetMessageMultiCast.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "Buffer"
|
||||
@@ -44,7 +45,7 @@ Buffer::Buffer()
|
||||
static int32_t fileBasicID = 0;
|
||||
m_fileModify = true;
|
||||
m_haveName = false;
|
||||
Edn::String mString = "Untitle - ";
|
||||
etk::String mString = "Untitle - ";
|
||||
mString += fileBasicID++;
|
||||
SetFileName(mString);
|
||||
m_haveName = false;
|
||||
@@ -58,7 +59,7 @@ Buffer::Buffer()
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
Buffer::Buffer(Edn::File &newName)
|
||||
Buffer::Buffer(etk::File &newName)
|
||||
{
|
||||
m_fileModify = false;
|
||||
SetFileName(newName);
|
||||
@@ -93,7 +94,7 @@ void Buffer::SetModify(bool status)
|
||||
{
|
||||
if (status != m_fileModify) {
|
||||
m_fileModify = status;
|
||||
GeneralSendMessage(EDN_MSG__BUFFER_CHANGE_MODIFY);
|
||||
ewol::widgetMessageMultiCast::Send(-1, ednMsgBufferModify);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +147,7 @@ void Buffer::SetLineDisplay(uint32_t lineNumber)
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
int32_t Buffer::Display(DrawerManager &drawer)
|
||||
int32_t Buffer::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY)
|
||||
{
|
||||
return ERR_NONE;
|
||||
}
|
||||
@@ -251,7 +252,7 @@ void Buffer::ForceReDraw(bool allElement)
|
||||
|
||||
|
||||
|
||||
void Buffer::cursorMove(int32_t gtkKey)
|
||||
void Buffer::cursorMove(ewol::eventKbMoveType_te moveTypeEvent)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
@@ -269,17 +270,17 @@ void Buffer::AddChar(char * UTF8data)
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
void Buffer::Search(Edn::String &data, bool back, bool caseSensitive, bool wrap, bool regExp)
|
||||
void Buffer::Search(etk::String &data, bool back, bool caseSensitive, bool wrap, bool regExp)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
void Buffer::Replace(Edn::String &data)
|
||||
void Buffer::Replace(etk::String &data)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
int32_t Buffer::FindLine(Edn::String &data)
|
||||
int32_t Buffer::FindLine(etk::String &data)
|
||||
{
|
||||
// nothing to do
|
||||
return 0;
|
@@ -26,10 +26,11 @@
|
||||
#ifndef __BUFFER_H__
|
||||
#define __BUFFER_H__
|
||||
|
||||
#include <string>
|
||||
#include "Display.h"
|
||||
#include "charset.h"
|
||||
#include "Edn.h"
|
||||
#include <etk/String.h>
|
||||
#include <etk/File.h>
|
||||
#include <Display.h>
|
||||
#include <etk/unicode.h>
|
||||
#include <ewol/ewol.h>
|
||||
|
||||
|
||||
typedef struct{
|
||||
@@ -45,24 +46,24 @@ typedef struct{
|
||||
class Buffer {
|
||||
public:
|
||||
Buffer(void);
|
||||
Buffer(Edn::File &newName);
|
||||
Buffer(etk::File &newName);
|
||||
virtual ~Buffer(void);
|
||||
|
||||
Edn::File GetFileName(void)
|
||||
etk::File GetFileName(void)
|
||||
{
|
||||
return m_fileName;
|
||||
};
|
||||
|
||||
void SetFileName(Edn::File &newName)
|
||||
void SetFileName(etk::File &newName)
|
||||
{
|
||||
m_fileName = newName;
|
||||
m_haveName = true;
|
||||
NameChange();
|
||||
};
|
||||
|
||||
void SetFileName(Edn::String &newName)
|
||||
void SetFileName(etk::String &newName)
|
||||
{
|
||||
m_fileName.SetCompleateName(newName);
|
||||
m_fileName.SetCompleateName(newName, etk::FILE_TYPE_DIRECT);
|
||||
m_haveName = true;
|
||||
NameChange();
|
||||
};
|
||||
@@ -81,10 +82,10 @@ class Buffer {
|
||||
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate);
|
||||
virtual void SetLineDisplay(uint32_t lineNumber);
|
||||
|
||||
virtual int32_t Display(DrawerManager &drawer);
|
||||
virtual int32_t Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY);
|
||||
virtual void ForceReDraw(bool allElement);
|
||||
virtual void AddChar(char * UTF8data);
|
||||
virtual void cursorMove(int32_t gtkKey);
|
||||
virtual void cursorMove(ewol::eventKbMoveType_te moveTypeEvent);
|
||||
virtual void MouseSelectFromCursorTo(int32_t width, int32_t height);
|
||||
virtual void MouseEvent(int32_t width, int32_t height);
|
||||
virtual void MouseEventDouble(void);
|
||||
@@ -96,22 +97,22 @@ class Buffer {
|
||||
virtual void SelectNone(void);
|
||||
virtual void Undo(void);
|
||||
virtual void Redo(void);
|
||||
virtual void SetCharset(charset_te newCharset) {};
|
||||
virtual void SetCharset(unicode::charset_te newCharset) {};
|
||||
|
||||
//virtual void SelectAll(void);
|
||||
virtual void Copy(int8_t clipboardID);
|
||||
virtual void Cut(int8_t clipboardID);
|
||||
virtual void Paste(int8_t clipboardID);
|
||||
virtual void Search(Edn::String &data, bool back, bool caseSensitive, bool wrap, bool regExp);
|
||||
virtual void Replace(Edn::String &data);
|
||||
virtual int32_t FindLine(Edn::String &data);
|
||||
virtual void Search(etk::String &data, bool back, bool caseSensitive, bool wrap, bool regExp);
|
||||
virtual void Replace(etk::String &data);
|
||||
virtual int32_t FindLine(etk::String &data);
|
||||
virtual void JumpAtLine(int32_t newLine);
|
||||
virtual int32_t GetCurrentLine(void);
|
||||
|
||||
protected:
|
||||
bool m_fileModify; //!<
|
||||
// naming
|
||||
Edn::File m_fileName; //!< filename of the curent buffer
|
||||
etk::File m_fileName; //!< filename of the curent buffer
|
||||
bool m_haveName; //!< to know if the file have a name or NOT
|
||||
};
|
||||
|
@@ -23,11 +23,11 @@
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "tools_globals.h"
|
||||
#include "BufferEmpty.h"
|
||||
#include "ColorizeManager.h"
|
||||
#include "MainWindows.h"
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <BufferEmpty.h>
|
||||
#include <ColorizeManager.h>
|
||||
#include <MainWindows.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "BufferEmpty"
|
||||
@@ -67,30 +67,40 @@ BufferEmpty::~BufferEmpty(void)
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
int32_t BufferEmpty::Display(DrawerManager &drawer)
|
||||
int32_t BufferEmpty::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY)
|
||||
{
|
||||
|
||||
ColorizeManager * myColorManager = ColorizeManager::getInstance();
|
||||
// Get color :
|
||||
Colorize *myColor = NULL;
|
||||
// Clean Buffer
|
||||
drawer.Clean(myColorManager->Get(COLOR_CODE_BASIC_BG) );
|
||||
//drawer.Flush();
|
||||
|
||||
|
||||
if (NULL == OOText) {
|
||||
EDN_ERROR("Input VALUE is NULL");
|
||||
return ERR_FAIL;
|
||||
}
|
||||
if (NULL == OOColored) {
|
||||
EDN_ERROR("Input VALUE is NULL");
|
||||
return ERR_FAIL;
|
||||
}
|
||||
|
||||
myColor = myColorManager->Get("normal");
|
||||
// Draw the 2 comments Lines :
|
||||
drawer.Text(myColor, 20,20, "edn - Editeur De N'ours, l'Editeur Desoxyribo-Nucleique");
|
||||
//drawer.Flush();
|
||||
OOText->SetColor(myColor->GetFG());
|
||||
OOText->TextAdd(20, 20, "edn - Editeur De N'ours, l'Editeur Desoxyribo-Nucleique", sizeX);
|
||||
|
||||
myColor = myColorManager->Get("commentDoxygen");
|
||||
drawer.Text(myColor, 20,25 + Display::GetFontHeight(), "No Buffer Availlable to display");
|
||||
drawer.Flush();
|
||||
/*
|
||||
myColor = myColorManager->Get(("SelectedText"));
|
||||
drawer.Cursor(20, 50);
|
||||
drawer.EndOfLine(20, 70);
|
||||
drawer.Tabulation(myColor, 20, 90, 5);
|
||||
drawer.UTF8UnknownElement(myColor, 20, 120, 3, false);
|
||||
drawer.Flush();
|
||||
*/
|
||||
OOText->SetColor(myColor->GetFG());
|
||||
OOText->TextAdd(20, 50, "No Buffer Availlable to display", sizeX);
|
||||
|
||||
|
||||
color_ts bgColor; //!< Text color
|
||||
bgColor.red = 1.0;
|
||||
bgColor.green = 1.0;
|
||||
bgColor.blue = 1.0;
|
||||
bgColor.alpha = 1.0;
|
||||
OOColored->SetColor(bgColor);
|
||||
OOColored->Rectangle( 0, 0, sizeX, sizeY);
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
@@ -26,13 +26,13 @@
|
||||
#ifndef __BUFFER_EMPTY_H__
|
||||
#define __BUFFER_EMPTY_H__
|
||||
|
||||
#include "Buffer.h"
|
||||
#include <Buffer.h>
|
||||
|
||||
class BufferEmpty : public Buffer {
|
||||
public:
|
||||
BufferEmpty(void);
|
||||
virtual ~BufferEmpty(void);
|
||||
virtual int32_t Display(DrawerManager &drawer);
|
||||
int32_t Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY);
|
||||
|
||||
};
|
||||
|
@@ -24,10 +24,10 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "tools_globals.h"
|
||||
#include "BufferManager.h"
|
||||
//#include "MsgBroadcast.h"
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <BufferManager.h>
|
||||
#include <ewol/WidgetMessageMultiCast.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "BufferManager"
|
||||
@@ -41,11 +41,16 @@
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
BufferManager::BufferManager(void) : MsgBroadcast("Buffer Manager", EDN_CAT_BUFFER_MANAGER)
|
||||
BufferManager::BufferManager(void)
|
||||
{
|
||||
// nothing to do ...
|
||||
BufferNotExiste = new BufferEmpty();
|
||||
m_idSelected = -1;
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerNewFile);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerSaveAll);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerCloseAll);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerClose);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerSave);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,8 +74,9 @@ BufferManager::~BufferManager(void)
|
||||
}
|
||||
|
||||
|
||||
void BufferManager::OnMessage(int32_t id, int32_t dataID)
|
||||
bool BufferManager::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
/*
|
||||
switch (id)
|
||||
{
|
||||
case EDN_MSG__BUFFER_CHANGE_CURRENT:
|
||||
@@ -128,6 +134,8 @@ void BufferManager::OnMessage(int32_t id, int32_t dataID)
|
||||
}
|
||||
break;
|
||||
}
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +158,8 @@ void BufferManager::RemoveAll(void)
|
||||
for (i=0; i<listBuffer.Size(); i++) {
|
||||
Remove(i);
|
||||
}
|
||||
SendMessage(EDN_MSG__BUFFER_REMOVE_ALL);
|
||||
//SendMessage(EDN_MSG__BUFFER_REMOVE_ALL);
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferRemoveAll);
|
||||
}
|
||||
|
||||
|
||||
@@ -170,7 +179,8 @@ int32_t BufferManager::Create(void)
|
||||
// Add at the list of element
|
||||
listBuffer.PushBack(myBuffer);
|
||||
int32_t basicID = listBuffer.Size() - 1;
|
||||
SendMessage(EDN_MSG__BUFFER_ADD, basicID);
|
||||
//SendMessage(EDN_MSG__BUFFER_ADD, basicID);
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferAdd);
|
||||
return basicID;
|
||||
}
|
||||
|
||||
@@ -185,7 +195,7 @@ int32_t BufferManager::Create(void)
|
||||
* @todo : check if this file is not curently open and return the old ID
|
||||
*
|
||||
*/
|
||||
int32_t BufferManager::Open(Edn::File &myFile)
|
||||
int32_t BufferManager::Open(etk::File &myFile)
|
||||
{
|
||||
// TODO : Check here if the file is already open ==> and display it if needed
|
||||
// allocate a new Buffer
|
||||
@@ -193,7 +203,8 @@ int32_t BufferManager::Open(Edn::File &myFile)
|
||||
// Add at the list of element
|
||||
listBuffer.PushBack(myBuffer);
|
||||
int32_t basicID = listBuffer.Size() - 1;
|
||||
SendMessage(EDN_MSG__BUFFER_ADD, basicID);
|
||||
//SendMessage(EDN_MSG__BUFFER_ADD, basicID);
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferAdd);
|
||||
return basicID;
|
||||
}
|
||||
|
||||
@@ -236,7 +247,7 @@ bool BufferManager::Exist(int32_t BufferID)
|
||||
}
|
||||
|
||||
|
||||
bool BufferManager::Exist(Edn::File &myFile )
|
||||
bool BufferManager::Exist(etk::File &myFile )
|
||||
{
|
||||
if (-1 == GetId(myFile)) {
|
||||
return false;
|
||||
@@ -245,7 +256,7 @@ bool BufferManager::Exist(Edn::File &myFile )
|
||||
}
|
||||
|
||||
|
||||
int32_t BufferManager::GetId(Edn::File &myFile)
|
||||
int32_t BufferManager::GetId(etk::File &myFile)
|
||||
{
|
||||
int32_t iii;
|
||||
// check if the Buffer existed
|
||||
@@ -294,7 +305,8 @@ bool BufferManager::Remove(int32_t BufferID)
|
||||
// Delete the Buffer
|
||||
delete( listBuffer[BufferID] );
|
||||
listBuffer[BufferID] = NULL;
|
||||
SendMessage(EDN_MSG__BUFFER_REMOVE, BufferID);
|
||||
//SendMessage(EDN_MSG__BUFFER_REMOVE, BufferID);
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferRemove);
|
||||
return true;
|
||||
} else {
|
||||
EDN_INFO("non existing Buffer " << BufferID);
|
@@ -26,15 +26,16 @@
|
||||
#ifndef __BUFFER_MANAGER_H__
|
||||
#define __BUFFER_MANAGER_H__
|
||||
|
||||
#include "Buffer.h"
|
||||
#include "BufferText.h"
|
||||
#include "BufferEmpty.h"
|
||||
#include "Singleton.h"
|
||||
#include "MsgBroadcast.h"
|
||||
#include <Buffer.h>
|
||||
#include <BufferText.h>
|
||||
#include <BufferEmpty.h>
|
||||
#include <etk/Singleton.h>
|
||||
#include <MsgBroadcast.h>
|
||||
#include <ewol/Widget.h>
|
||||
|
||||
class BufferManager: public Singleton<BufferManager>, public MsgBroadcast
|
||||
class BufferManager: public etk::Singleton<BufferManager>, public ewol::Widget
|
||||
{
|
||||
friend class Singleton<BufferManager>;
|
||||
friend class etk::Singleton<BufferManager>;
|
||||
// specific for sigleton system...
|
||||
private:
|
||||
// Constructeur
|
||||
@@ -42,32 +43,32 @@ class BufferManager: public Singleton<BufferManager>, public MsgBroadcast
|
||||
~BufferManager(void);
|
||||
|
||||
public:
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
||||
|
||||
// return the ID of the buffer allocated
|
||||
// create a buffer with no element
|
||||
int32_t Create(void);
|
||||
int32_t Create(void);
|
||||
// open curent filename
|
||||
int32_t Open(Edn::File &myFile);
|
||||
int32_t Open(etk::File &myFile);
|
||||
int32_t GetSelected(void) { return m_idSelected;};
|
||||
void SetSelected(int32_t id) {m_idSelected = id;};
|
||||
Buffer * Get(int32_t BufferID);
|
||||
bool Exist(int32_t BufferID);
|
||||
bool Exist(Edn::File &myFile);
|
||||
int32_t GetId(Edn::File &myFile);
|
||||
bool Exist(int32_t BufferID);
|
||||
bool Exist(etk::File &myFile);
|
||||
int32_t GetId(etk::File &myFile);
|
||||
// return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5
|
||||
uint32_t Size(void);
|
||||
int32_t WitchBuffer(int32_t iEmeElement);
|
||||
uint32_t Size(void);
|
||||
int32_t WitchBuffer(int32_t iEmeElement);
|
||||
|
||||
bool Remove(int32_t BufferID);
|
||||
bool Remove(int32_t BufferID);
|
||||
|
||||
private:
|
||||
|
||||
Edn::VectorType<Buffer*> listBuffer; //!< element List of the char Elements
|
||||
etk::VectorType<Buffer*> listBuffer; //!< element List of the char Elements
|
||||
|
||||
void RemoveAll(void); //!< remove all buffer
|
||||
int32_t m_idSelected;
|
||||
Buffer * BufferNotExiste; //!< When an error arrive in get buffer we return the Error buffer (not writable)
|
||||
void RemoveAll(void); //!< remove all buffer
|
||||
int32_t m_idSelected;
|
||||
Buffer * BufferNotExiste; //!< When an error arrive in get buffer we return the Error buffer (not writable)
|
||||
};
|
||||
|
||||
#endif
|
@@ -23,13 +23,19 @@
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "tools_globals.h"
|
||||
#include "ClipBoard.h"
|
||||
#include "BufferText.h"
|
||||
#include "toolsMemory.h"
|
||||
#include "Edn.h"
|
||||
#include "RegExp.h"
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <ClipBoard.h>
|
||||
#include <BufferText.h>
|
||||
#include <toolsMemory.h>
|
||||
#include <etk/RegExp.h>
|
||||
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/OObject.h>
|
||||
#include <ewol/WidgetManager.h>
|
||||
#include <ewol/Widget.h>
|
||||
#include <ewol/Font.h>
|
||||
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "BufferText"
|
||||
@@ -68,10 +74,9 @@ void BufferText::BasicInit(void)
|
||||
// new mode :
|
||||
m_cursorPos = 0;
|
||||
m_cursorPreferredCol = -1;
|
||||
m_cursorOn = true;
|
||||
//m_cursorMode = CURSOR_DISPLAY_MODE_NORMAL;
|
||||
m_displayStart.x = 0;
|
||||
m_displayStart.y = 0;
|
||||
m_displayStartPixelX = 0;
|
||||
m_displayStartLineId = 0;
|
||||
m_displaySize.x = 200;
|
||||
m_displaySize.y = 20;
|
||||
m_displayLocalSyntax.idSequence = -1;
|
||||
@@ -125,7 +130,7 @@ BufferText::BufferText()
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
BufferText::BufferText(Edn::File &fileName) : Buffer(fileName)
|
||||
BufferText::BufferText(etk::File &fileName) : Buffer(fileName)
|
||||
{
|
||||
BasicInit();
|
||||
NameChange();
|
||||
@@ -200,7 +205,7 @@ void BufferText::SelectionEnd(void)
|
||||
void BufferText::SelectionCheckMode(void)
|
||||
{
|
||||
/*
|
||||
if (true == globals::IsSetCtrl() ) {
|
||||
if (true == ewol::IsSetCtrl() ) {
|
||||
} else {
|
||||
}
|
||||
*/
|
||||
@@ -233,13 +238,32 @@ void BufferText::SetLineDisplay(uint32_t lineNumber)
|
||||
|
||||
}
|
||||
|
||||
void BufferText::DrawLineNumber(DrawerManager &drawer,char *myPrint, int32_t lineNumber, int32_t positionY)
|
||||
void BufferText::DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY,char *myPrint, int32_t lineNumber, int32_t positionY)
|
||||
{
|
||||
char tmpLineNumber[50];
|
||||
sprintf(tmpLineNumber, myPrint, lineNumber);
|
||||
drawer.Text(myColorManager->Get(COLOR_CODE_LINE_NUMBER), 1, positionY, tmpLineNumber);
|
||||
OOColored->SetColor(myColorManager->Get(COLOR_LIST_BG_2));
|
||||
OOColored->Rectangle( 0, positionY, 68, sizeY);
|
||||
OOText->SetColor(myColorManager->Get(COLOR_CODE_LINE_NUMBER));
|
||||
OOText->TextAdd(1, positionY, tmpLineNumber, -1);
|
||||
}
|
||||
|
||||
#define CURSOR_WIDTH (5)
|
||||
#define CURSOR_THICKNESS (1.2)
|
||||
void BufferText::CursorDisplay(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth)
|
||||
{
|
||||
color_ts & tmpppppp = ColorizeManager::getInstance()->Get(COLOR_CODE_CURSOR);
|
||||
OOColored->SetColor(tmpppppp);
|
||||
if (true == ewol::IsSetInsert()) {
|
||||
OOColored->Rectangle( x, y, letterWidth, letterHeight);
|
||||
} else {
|
||||
OOColored->Line( (int32_t)(x-CURSOR_WIDTH), (int32_t)(y) , (int32_t)(x+CURSOR_WIDTH), (int32_t)(y) , CURSOR_THICKNESS);
|
||||
OOColored->Line( (int32_t)(x-CURSOR_WIDTH), (int32_t)(y+letterHeight-CURSOR_THICKNESS), (int32_t)(x+CURSOR_WIDTH), (int32_t)(y+letterHeight-CURSOR_THICKNESS), CURSOR_THICKNESS);
|
||||
OOColored->Line( (int32_t)(x) , (int32_t)(y) , (int32_t)(x) , (int32_t)(y+letterHeight-CURSOR_THICKNESS), CURSOR_THICKNESS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Update internal data of the pointer to display
|
||||
*
|
||||
@@ -275,25 +299,27 @@ void BufferText::UpdatePointerNumber(void)
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
int32_t BufferText::Display(DrawerManager &drawer)
|
||||
int32_t BufferText::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY)
|
||||
{
|
||||
int32_t letterHeight = Display::GetFontHeight();
|
||||
int32_t letterWidth = Display::GetFontWidth();
|
||||
// update the number of element that can be displayed
|
||||
m_displaySize.x = (drawer.GetWidth()/letterWidth) + 1 - nbColoneForLineNumber;;
|
||||
m_displaySize.y = (drawer.GetHeight()/letterHeight) + 1;
|
||||
EDN_INFO("main DIPLAY " << m_displaySize.x << " char * " << m_displaySize.y << " char");
|
||||
|
||||
int32_t selStart, selEnd, selRectStart, selRectEnd;
|
||||
bool selIsRect;
|
||||
int32_t selHave = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, selStart, selEnd, selIsRect, selRectStart, selRectEnd);
|
||||
int32_t selHave;
|
||||
|
||||
int32_t fontId = ewol::GetDefaultFontId();
|
||||
int32_t letterWidth = ewol::GetWidth(fontId, "A");
|
||||
int32_t letterHeight = ewol::GetHeight(fontId);
|
||||
|
||||
// update the number of element that can be displayed
|
||||
m_displaySize.x = (sizeX/letterWidth) + 1 - nbColoneForLineNumber;
|
||||
m_displaySize.y = (sizeY/letterHeight) + 1;
|
||||
EDN_INFO("main DIPLAY " << m_displaySize.x << " char * " << m_displaySize.y << " char");
|
||||
|
||||
selHave = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, selStart, selEnd, selIsRect, selRectStart, selRectEnd);
|
||||
|
||||
colorInformation_ts * HLColor = NULL;
|
||||
|
||||
//displayLineNumber(drawer);
|
||||
// get the number of line in the buffer
|
||||
int32_t maxNumberLine = m_EdnBuf.NumberOfLines();
|
||||
//int32_t maxNumberLine = 2096;
|
||||
char *myPrint = NULL;
|
||||
if (10 > maxNumberLine) { nbColoneForLineNumber = 1; myPrint = (char *)"%1d";
|
||||
} else if (100 > maxNumberLine) { nbColoneForLineNumber = 2; myPrint = (char *)"%2d";
|
||||
@@ -315,160 +341,181 @@ int32_t BufferText::Display(DrawerManager &drawer)
|
||||
color_ts & myColorSpace = myColorManager->Get(COLOR_CODE_SPACE);
|
||||
color_ts & myColorTab = myColorManager->Get(COLOR_CODE_TAB);
|
||||
Colorize * selectColor = NULL;
|
||||
char displayChar[MAX_EXP_CHAR_LEN];
|
||||
memset(displayChar, 0, sizeof(char)*MAX_EXP_CHAR_LEN);
|
||||
|
||||
|
||||
|
||||
int mylen = m_EdnBuf.Size();
|
||||
int32_t x_base=nbColoneForLineNumber*letterWidth + 3;
|
||||
uint32_t xx = 0;
|
||||
int32_t idX = 0;
|
||||
drawer.Clean(myColorManager->Get(COLOR_CODE_BASIC_BG));
|
||||
|
||||
OOColored->SetColor(myColorManager->Get(COLOR_CODE_BASIC_BG));
|
||||
OOColored->Rectangle( 0, 0, sizeX, sizeY);
|
||||
|
||||
int displayLines = 0;
|
||||
// Regenerate the colorizing if necessary ...
|
||||
m_EdnBuf.HightlightGenerateLines(m_displayLocalSyntax, m_displayStartBufferPos, m_displaySize.y);
|
||||
GTimeVal timeStart;
|
||||
g_get_current_time(&timeStart);
|
||||
|
||||
//GTimeVal timeStart;
|
||||
//g_get_current_time(&timeStart);
|
||||
|
||||
|
||||
uniChar_t displayChar[MAX_EXP_CHAR_LEN];
|
||||
memset(displayChar, 0, sizeof(uniChar_t)*MAX_EXP_CHAR_LEN);
|
||||
// draw the lineNumber :
|
||||
int32_t currentLineID = m_displayStart.y+1;
|
||||
DrawLineNumber(drawer, myPrint, currentLineID, y);
|
||||
int32_t currentLineID = m_displayStartLineId+1;
|
||||
EDN_DEBUG("Start display of text buffer [" << m_displayStartBufferPos<< ".." << mylen << "]");
|
||||
EDN_DEBUG("cursor Pos : " << m_cursorPos << "start at pos=" << m_displayStartBufferPos);
|
||||
|
||||
clipping_ts drawClipping;
|
||||
drawClipping.x = 0;
|
||||
drawClipping.y = 0;
|
||||
drawClipping.w = sizeX;
|
||||
drawClipping.h = sizeY;
|
||||
|
||||
DrawLineNumber(OOText, OOColored, sizeX, sizeY, myPrint, currentLineID, y);
|
||||
int32_t pixelX = x_base;
|
||||
for (iii=m_displayStartBufferPos; iii<mylen && displayLines < m_displaySize.y ; iii = new_i) {
|
||||
//EDN_INFO("diplay element=" << iii);
|
||||
int32_t pixelX = xx*letterWidth + x_base;
|
||||
//EDN_DEBUG("diplay element=" << iii);
|
||||
int displaywidth;
|
||||
uint32_t currentChar = '\0';
|
||||
new_i = iii;
|
||||
displaywidth = m_EdnBuf.GetExpandedChar(new_i, idX, displayChar, currentChar);
|
||||
int32_t drawSize = 0;
|
||||
//EDN_INFO("diplay element=" << new_i);
|
||||
if (currentChar!='\n') {
|
||||
selectColor = myColor;
|
||||
//kwow size to display
|
||||
int32_t widthToDisplay;
|
||||
char * tmpDisplayOfset;
|
||||
bool inTheScreen = true;
|
||||
if (m_displayStart.x <= idX) {
|
||||
// Normal display
|
||||
tmpDisplayOfset = displayChar;
|
||||
widthToDisplay = displaywidth;
|
||||
} else if (m_displayStart.x < idX + displaywidth) {
|
||||
// special case of partial display :
|
||||
widthToDisplay = idX + displaywidth - m_displayStart.x;
|
||||
tmpDisplayOfset = displayChar + (displaywidth-widthToDisplay);
|
||||
} else {
|
||||
// Out of range ...
|
||||
widthToDisplay = displaywidth;
|
||||
tmpDisplayOfset = displayChar;
|
||||
inTheScreen = false;
|
||||
}
|
||||
if (true==inTheScreen) {
|
||||
HLColor = m_EdnBuf.GetElementColorAtPosition(m_displayLocalSyntax, iii);
|
||||
if (NULL != HLColor) {
|
||||
if (NULL != HLColor->patern) {
|
||||
selectColor = HLColor->patern->GetColor();
|
||||
}
|
||||
HLColor = m_EdnBuf.GetElementColorAtPosition(m_displayLocalSyntax, iii);
|
||||
if (NULL != HLColor) {
|
||||
if (NULL != HLColor->patern) {
|
||||
selectColor = HLColor->patern->GetColor();
|
||||
}
|
||||
|
||||
// If user want to display space char : overwrite curent color
|
||||
}
|
||||
bool haveBg = false;
|
||||
if( true == selHave
|
||||
&& selStart <= iii
|
||||
&& selEnd > iii)
|
||||
{
|
||||
selectColor = myColorSel;
|
||||
OOColored->SetColor(selectColor->GetBG());
|
||||
haveBg = selectColor->HaveBg();
|
||||
} else {
|
||||
if( ' ' == currentChar
|
||||
&& true == globals::IsSetDisplaySpaceChar() )
|
||||
&& true == globals::IsSetDisplaySpaceChar() )
|
||||
{
|
||||
//selectColor = myColorSel;
|
||||
//SpaceText(color_ts & SelectColor, int32_t x, int32_t y,int32_t nbChar)
|
||||
|
||||
if( true == selHave
|
||||
&& selStart <= iii
|
||||
&& selEnd > iii)
|
||||
{
|
||||
drawer.SpaceText(myColorSel->GetBG(), pixelX ,y , 1);
|
||||
} else if (true == selectColor->HaveBg()) {
|
||||
drawer.SpaceText(selectColor->GetBG(), pixelX ,y , 1);
|
||||
} else {
|
||||
drawer.SpaceText(myColorSpace, pixelX ,y , 1);
|
||||
}
|
||||
OOColored->SetColor(myColorSpace);
|
||||
haveBg = true;
|
||||
} else if( '\t' == currentChar
|
||||
&& true == globals::IsSetDisplaySpaceChar() )
|
||||
{
|
||||
if( true == selHave
|
||||
&& selStart <= iii
|
||||
&& selEnd > iii)
|
||||
{
|
||||
drawer.SpaceText(myColorSel->GetBG(), pixelX ,y , strlen(tmpDisplayOfset));
|
||||
} else if (true == selectColor->HaveBg()) {
|
||||
drawer.SpaceText(selectColor->GetBG(), pixelX ,y , strlen(tmpDisplayOfset));
|
||||
} else {
|
||||
drawer.SpaceText(myColorTab, pixelX ,y , strlen(tmpDisplayOfset));
|
||||
}
|
||||
OOColored->SetColor(myColorTab);
|
||||
haveBg = true;
|
||||
} else {
|
||||
if( true == selHave
|
||||
&& selStart <= iii
|
||||
&& selEnd > iii)
|
||||
{
|
||||
selectColor = myColorSel;
|
||||
}
|
||||
if (currentChar <= 0x7F) {
|
||||
drawer.Text(selectColor, pixelX ,y, tmpDisplayOfset);
|
||||
} else {
|
||||
drawer.Text(selectColor, pixelX ,y, displayChar);
|
||||
}
|
||||
OOColored->SetColor(selectColor->GetBG());
|
||||
haveBg = selectColor->HaveBg();
|
||||
}
|
||||
xx+=widthToDisplay;
|
||||
}
|
||||
idX += displaywidth;
|
||||
OOText->SetColor(selectColor->GetFG());
|
||||
coord2D_ts textPos;
|
||||
textPos.x = pixelX-m_displayStartPixelX;
|
||||
textPos.y = y;
|
||||
drawSize = OOText->TextAdd(textPos, drawClipping, displayChar);
|
||||
if (true == haveBg ) {
|
||||
OOColored->Rectangle( pixelX, y, drawSize, letterHeight, drawClipping);
|
||||
}
|
||||
}
|
||||
idX += displaywidth;
|
||||
// display cursor :
|
||||
if (m_cursorPos == iii) {
|
||||
// display the cursor:
|
||||
if (true == m_cursorOn) {
|
||||
drawer.Cursor(pixelX, y+letterHeight);
|
||||
//m_cursorOn = false;
|
||||
} else {
|
||||
m_cursorOn = true;
|
||||
}
|
||||
CursorDisplay(OOColored, pixelX, y, letterHeight, letterWidth);
|
||||
}
|
||||
pixelX += drawSize;
|
||||
// move to next line ...
|
||||
if (currentChar=='\n') {
|
||||
drawer.EndOfLine(pixelX, y+letterHeight);
|
||||
drawer.Flush();
|
||||
xx = 0;
|
||||
idX =0;
|
||||
pixelX = x_base;
|
||||
y += letterHeight;
|
||||
displayLines++;
|
||||
currentLineID++;
|
||||
DrawLineNumber(drawer, myPrint, currentLineID, y);
|
||||
DrawLineNumber(OOText, OOColored, sizeX, sizeY, myPrint, currentLineID, y);
|
||||
}
|
||||
}
|
||||
// special case : the cursor is at the end of the buffer...
|
||||
if (m_cursorPos == iii) {
|
||||
// display the cursor:
|
||||
if (true == m_cursorOn) {
|
||||
drawer.Cursor(xx*letterWidth + x_base, y+letterHeight);
|
||||
m_cursorOn = false;
|
||||
} else {
|
||||
m_cursorOn = true;
|
||||
}
|
||||
CursorDisplay(OOColored, pixelX, y, letterHeight, letterWidth);
|
||||
}
|
||||
drawer.Flush();
|
||||
|
||||
GTimeVal timeStop;
|
||||
g_get_current_time(&timeStop);
|
||||
EDN_DEBUG("Display Generation = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s");
|
||||
//GTimeVal timeStop;
|
||||
//g_get_current_time(&timeStop);
|
||||
//EDN_DEBUG("Display Generation = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s");
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void BufferText::GetMousePosition(int32_t width, int32_t height, int32_t &x, int32_t &y)
|
||||
int32_t BufferText::GetMousePosition(int32_t width, int32_t height)
|
||||
{
|
||||
x = (width - 3) / Display::GetFontWidth() - nbColoneForLineNumber;
|
||||
y = height / Display::GetFontHeight();
|
||||
if (x < 0) {
|
||||
x = 0;
|
||||
int32_t fontId = ewol::GetDefaultFontId();
|
||||
int32_t letterWidth = ewol::GetWidth(fontId, "9");
|
||||
int32_t letterHeight = ewol::GetHeight(fontId);
|
||||
|
||||
int32_t lineOffset = height / letterHeight;
|
||||
|
||||
//******************************* get the X position : *******************************************
|
||||
|
||||
|
||||
// get the number of line in the buffer
|
||||
int32_t maxNumberLine = m_EdnBuf.NumberOfLines();
|
||||
if (10 > maxNumberLine) { nbColoneForLineNumber = 1;
|
||||
} else if (100 > maxNumberLine) { nbColoneForLineNumber = 2;
|
||||
} else if (1000 > maxNumberLine) { nbColoneForLineNumber = 3;
|
||||
} else if (10000 > maxNumberLine) { nbColoneForLineNumber = 4;
|
||||
} else if (100000 > maxNumberLine) { nbColoneForLineNumber = 5;
|
||||
} else if (1000000 > maxNumberLine) { nbColoneForLineNumber = 6;
|
||||
} else if (1000000 > maxNumberLine) { nbColoneForLineNumber = 7;
|
||||
} else if (10000000 > maxNumberLine) { nbColoneForLineNumber = 8;
|
||||
} else if (100000000 > maxNumberLine) { nbColoneForLineNumber = 9;
|
||||
} else { nbColoneForLineNumber = 10;
|
||||
}
|
||||
x += m_displayStart.x;
|
||||
y += m_displayStart.y;
|
||||
//EDN_DEBUG("BufferText::GetMousePosition(" << width << "," << height << "); ==> (" << x << "," << y << ")" );
|
||||
|
||||
int32_t iii, new_i;
|
||||
|
||||
int mylen = m_EdnBuf.Size();
|
||||
int32_t x_base=nbColoneForLineNumber*letterWidth + 3;
|
||||
int32_t idX = 0;
|
||||
|
||||
uniChar_t displayChar[MAX_EXP_CHAR_LEN];
|
||||
memset(displayChar, 0, sizeof(uniChar_t)*MAX_EXP_CHAR_LEN);
|
||||
|
||||
int32_t pixelX = x_base;
|
||||
int32_t startLinePosition = m_EdnBuf.CountForwardNLines(m_displayStartBufferPos, lineOffset);
|
||||
if (width <= pixelX) {
|
||||
EDN_DEBUG(" Element : Befor the start of the line ... ==> END");
|
||||
return startLinePosition;
|
||||
}
|
||||
EDN_DEBUG("Get id element : x=" << width << "px y=" << height << "px");
|
||||
EDN_DEBUG(" 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);
|
||||
EDN_DEBUG(" Element : " << currentChar << "=\"" << (char)currentChar << "\" display offset=" << pixelX << "px width=" << drawSize << "px");
|
||||
pixelX += drawSize;
|
||||
if (width <= pixelX) {
|
||||
EDN_DEBUG(" Find IT ==> END");
|
||||
// find position ...
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
EDN_DEBUG(" Element : \"\\n\" display width=---px ==> end of line ==> END");
|
||||
// end of line ... exit cycle
|
||||
break;
|
||||
}
|
||||
idX += displaywidth;
|
||||
}
|
||||
EDN_DEBUG("BufferText::GetMousePosition(" << width << "," << height << "); ==> " << iii );
|
||||
return iii;
|
||||
}
|
||||
|
||||
|
||||
@@ -483,23 +530,18 @@ void BufferText::GetMousePosition(int32_t width, int32_t height, int32_t &x, int
|
||||
// TODO : Simplify selection ....
|
||||
void BufferText::MouseEvent(int32_t width, int32_t height)
|
||||
{
|
||||
if (true == globals::IsSetShift() ) {
|
||||
if (true == ewol::IsSetShift() ) {
|
||||
MouseSelectFromCursorTo(width, height);
|
||||
} else {
|
||||
int32_t posX, posY;
|
||||
// Get the caracter mouse position
|
||||
GetMousePosition(width, height, posX, posY);
|
||||
// find the current selected line :
|
||||
int32_t newPos = m_EdnBuf.CountForwardNLines(0, posY);
|
||||
// Get the display char position
|
||||
newPos = m_EdnBuf.CountForwardDispChars(newPos, posX);
|
||||
int32_t newPos = GetMousePosition(width, height);
|
||||
// move the cursor
|
||||
SetInsertPosition(newPos);
|
||||
|
||||
// if a preferred column wasn't aleady established, establish it
|
||||
if (m_cursorPreferredCol < 0) {
|
||||
/*if (m_cursorPreferredCol < 0) {
|
||||
m_cursorPreferredCol = posX;
|
||||
}
|
||||
}*/
|
||||
m_EdnBuf.Unselect(SELECTION_PRIMARY);
|
||||
|
||||
ForceReDraw(true);
|
||||
@@ -520,28 +562,21 @@ void BufferText::MouseEvent(int32_t width, int32_t height)
|
||||
// TODO : Simplify selection ....
|
||||
void BufferText::MouseSelectFromCursorTo(int32_t width, int32_t height)
|
||||
{
|
||||
int32_t posX, posY;
|
||||
// Get the caracter mouse position
|
||||
GetMousePosition(width, height, posX, posY);
|
||||
int32_t newPos = GetMousePosition(width, height);
|
||||
|
||||
int32_t selStart, selEnd, selRectStart, selRectEnd;
|
||||
bool selIsRect;
|
||||
int32_t selHave = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, selStart, selEnd, selIsRect, selRectStart, selRectEnd);
|
||||
//EDN_DEBUG("BufferText:: " << selHave << " = BufGetSelectionPos(SELECTION_PRIMARY," << selStart << "," << selEnd << "," << selIsRect << "," << selRectStart << "," << selRectEnd << ");" );
|
||||
|
||||
int32_t rememberCursorPos = m_cursorPos;
|
||||
|
||||
// find the current selected line :
|
||||
int32_t newPos = m_EdnBuf.CountForwardNLines(0, posY);
|
||||
// Get the display char position
|
||||
newPos = m_EdnBuf.CountForwardDispChars(newPos, posX);
|
||||
// move the cursor
|
||||
SetInsertPosition(newPos);
|
||||
|
||||
// if a preferred column wasn't aleady established, establish it
|
||||
if (m_cursorPreferredCol < 0) {
|
||||
/*if (m_cursorPreferredCol < 0) {
|
||||
m_cursorPreferredCol = posX;
|
||||
}
|
||||
}*/
|
||||
|
||||
if (false == selHave) {
|
||||
m_EdnBuf.Select(SELECTION_PRIMARY, rememberCursorPos, m_cursorPos);
|
||||
@@ -655,20 +690,20 @@ void BufferText::MoveUpDown(int32_t ofset)
|
||||
m_displayLocalSyntax.idSequence = -1;
|
||||
if (ofset >= 0) {
|
||||
int32_t nbLine = m_EdnBuf.NumberOfLines();
|
||||
if (m_displayStart.y+ofset+3 > nbLine) {
|
||||
m_displayStart.y = nbLine-3;
|
||||
if (m_displayStartLineId+ofset+3 > nbLine) {
|
||||
m_displayStartLineId = nbLine-3;
|
||||
} else {
|
||||
m_displayStart.y += ofset;
|
||||
m_displayStartLineId += ofset;
|
||||
}
|
||||
m_displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, m_displayStart.y);
|
||||
m_displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, m_displayStartLineId);
|
||||
} else {
|
||||
ofset *= -1;
|
||||
if (m_displayStart.y < ofset) {
|
||||
m_displayStart.y = 0;
|
||||
if (m_displayStartLineId < ofset) {
|
||||
m_displayStartLineId = 0;
|
||||
m_displayStartBufferPos = 0;
|
||||
} else {
|
||||
m_displayStart.y -= ofset;
|
||||
m_displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, m_displayStart.y);
|
||||
m_displayStartLineId -= ofset;
|
||||
m_displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, m_displayStartLineId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -712,8 +747,6 @@ void BufferText::SetInsertPosition(int32_t newPos, bool insertChar)
|
||||
m_cursorPos = newPos;
|
||||
}
|
||||
m_cursorPreferredCol = -1;
|
||||
// Force the cursor display
|
||||
m_cursorOn = true;
|
||||
|
||||
// special case when insert char ...
|
||||
if (true == insertChar) {
|
||||
@@ -721,11 +754,11 @@ void BufferText::SetInsertPosition(int32_t newPos, bool insertChar)
|
||||
}
|
||||
|
||||
if( false == haveSelectionActive
|
||||
&& true == globals::IsSetShift() )
|
||||
&& true == ewol::IsSetShift() )
|
||||
{
|
||||
// new selection
|
||||
m_EdnBuf.Select(SELECTION_PRIMARY, rememberCursorPos, m_cursorPos);
|
||||
} else if( true == globals::IsSetShift()
|
||||
} else if( true == ewol::IsSetShift()
|
||||
&& true == haveSelectionActive)
|
||||
{
|
||||
// update selection
|
||||
@@ -813,12 +846,12 @@ bool BufferText::TextDMoveDown(int32_t offset)
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void BufferText::cursorMove(int32_t gtkKey)
|
||||
void BufferText::cursorMove(ewol::eventKbMoveType_te moveTypeEvent)
|
||||
{
|
||||
bool needUpdatePosition = true;
|
||||
// check selection event ...
|
||||
/*
|
||||
if (true == globals::IsSetShift() ) {
|
||||
if (true == ewol::IsSetShift() ) {
|
||||
if ( CURSOR_MODE_NORMAL == cursorMode) {
|
||||
SelectionStart();
|
||||
} else {
|
||||
@@ -828,73 +861,41 @@ void BufferText::cursorMove(int32_t gtkKey)
|
||||
SelectionEnd();
|
||||
}
|
||||
*/
|
||||
switch(gtkKey) {
|
||||
# ifdef USE_GTK_VERSION_3_0
|
||||
case GDK_KEY_Left:
|
||||
# elif defined( USE_GTK_VERSION_2_0)
|
||||
case GDK_Left:
|
||||
# endif
|
||||
switch(moveTypeEvent) {
|
||||
case ewol::EVENT_KB_MOVE_TYPE_LEFT:
|
||||
//EDN_INFO("keyEvent : <LEFT>");
|
||||
if (m_cursorPos > 0) {
|
||||
SetInsertPosition(m_cursorPos - 1);
|
||||
}
|
||||
break;
|
||||
# ifdef USE_GTK_VERSION_3_0
|
||||
case GDK_KEY_Right:
|
||||
# elif defined( USE_GTK_VERSION_2_0)
|
||||
case GDK_Right:
|
||||
# endif
|
||||
case ewol::EVENT_KB_MOVE_TYPE_RIGHT:
|
||||
//EDN_INFO("keyEvent : <RIGHT>");
|
||||
if (m_cursorPos < m_EdnBuf.Size() ) {
|
||||
SetInsertPosition(m_cursorPos + 1);
|
||||
}
|
||||
break;
|
||||
# ifdef USE_GTK_VERSION_3_0
|
||||
case GDK_KEY_Up:
|
||||
# elif defined( USE_GTK_VERSION_2_0)
|
||||
case GDK_Up:
|
||||
# endif
|
||||
case ewol::EVENT_KB_MOVE_TYPE_UP:
|
||||
//EDN_INFO("keyEvent : <UP>");
|
||||
TextDMoveUp(1);
|
||||
break;
|
||||
# ifdef USE_GTK_VERSION_3_0
|
||||
case GDK_KEY_Down:
|
||||
# elif defined( USE_GTK_VERSION_2_0)
|
||||
case GDK_Down:
|
||||
# endif
|
||||
case ewol::EVENT_KB_MOVE_TYPE_DOWN:
|
||||
//EDN_INFO("keyEvent : <DOWN>");
|
||||
// check if we have enought line ...
|
||||
TextDMoveDown(1);
|
||||
break;
|
||||
# ifdef USE_GTK_VERSION_3_0
|
||||
case GDK_KEY_Page_Up:
|
||||
# elif defined( USE_GTK_VERSION_2_0)
|
||||
case GDK_Page_Up:
|
||||
# endif
|
||||
case ewol::EVENT_KB_MOVE_TYPE_PAGE_UP:
|
||||
//EDN_INFO("keyEvent : <PAGE-UP>");
|
||||
TextDMoveUp(m_displaySize.y);
|
||||
break;
|
||||
# ifdef USE_GTK_VERSION_3_0
|
||||
case GDK_KEY_Page_Down:
|
||||
# elif defined( USE_GTK_VERSION_2_0)
|
||||
case GDK_Page_Down:
|
||||
# endif
|
||||
case ewol::EVENT_KB_MOVE_TYPE_PAGE_DOWN:
|
||||
//EDN_INFO("keyEvent : <PAGE-DOWN>");
|
||||
TextDMoveDown(m_displaySize.y);
|
||||
break;
|
||||
# ifdef USE_GTK_VERSION_3_0
|
||||
case GDK_KEY_Begin:
|
||||
# elif defined( USE_GTK_VERSION_2_0)
|
||||
case GDK_Begin:
|
||||
# endif
|
||||
case ewol::EVENT_KB_MOVE_TYPE_START:
|
||||
//EDN_INFO("keyEvent : <Start of line>");
|
||||
SetInsertPosition(m_EdnBuf.StartOfLine(m_cursorPos) );
|
||||
break;
|
||||
# ifdef USE_GTK_VERSION_3_0
|
||||
case GDK_KEY_End:
|
||||
# elif defined( USE_GTK_VERSION_2_0)
|
||||
case GDK_End:
|
||||
# endif
|
||||
case ewol::EVENT_KB_MOVE_TYPE_END:
|
||||
//EDN_INFO("keyEvent : <End of line>");
|
||||
SetInsertPosition(m_EdnBuf.EndOfLine(m_cursorPos) );
|
||||
break;
|
||||
@@ -920,39 +921,41 @@ void BufferText::cursorMove(int32_t gtkKey)
|
||||
void BufferText::UpdateWindowsPosition(bool centerPage)
|
||||
{
|
||||
if (centerPage == false) {
|
||||
/*
|
||||
// Display position (Y mode):
|
||||
//EDN_INFO("BufferText::UpdateWindowsPosition() m_displayStart(" << m_displayStart.x << "," << m_displayStart.y << ") m_displaySize(" << m_displaySize.x << "," <<m_displaySize.y << ")");
|
||||
//EDN_INFO("BufferText::UpdateWindowsPosition() m_displayStart(" << m_displayStartPixelX << "px," << m_displayStartLineId << "id) m_displaySize(" << m_displaySize.x << "," <<m_displaySize.y << ")");
|
||||
position_ts cursorPosition;
|
||||
cursorPosition.y = m_EdnBuf.CountLines(0, m_cursorPos);
|
||||
int32_t lineStartPos = m_EdnBuf.StartOfLine(m_cursorPos);
|
||||
cursorPosition.x = m_EdnBuf.CountDispChars(lineStartPos, m_cursorPos);
|
||||
//EDN_INFO("BufferText::UpdateWindowsPosition() curent cursor position : (" << cursorPosition.x << "," << cursorPosition.y << ")");
|
||||
|
||||
if (m_displayStart.y > (int32_t)cursorPosition.y - globals::getNbLineBorder() ) {
|
||||
m_displayStart.y = cursorPosition.y - globals::getNbLineBorder();
|
||||
if (m_displayStart.y < 0) {
|
||||
m_displayStart.y = 0;
|
||||
if (m_displayStartLineId > (int32_t)cursorPosition.y - globals::getNbLineBorder() ) {
|
||||
m_displayStartLineId = cursorPosition.y - globals::getNbLineBorder();
|
||||
if (m_displayStartLineId < 0) {
|
||||
m_displayStartLineId = 0;
|
||||
ForceReDraw(true);
|
||||
}
|
||||
} else if (m_displayStart.y + m_displaySize.y <= (int32_t)cursorPosition.y + globals::getNbLineBorder() ) {
|
||||
m_displayStart.y = cursorPosition.y - m_displaySize.y + globals::getNbLineBorder() + 1;
|
||||
} else if (m_displayStartLineId + m_displaySize.y <= (int32_t)cursorPosition.y + globals::getNbLineBorder() ) {
|
||||
m_displayStartLineId = cursorPosition.y - m_displaySize.y + globals::getNbLineBorder() + 1;
|
||||
ForceReDraw(true);
|
||||
}
|
||||
// Display position (X mode):
|
||||
//EDN_INFO("cursorPosition X : " << cursorPosition.y << " windows " << m_displayStart.y << "=>" << m_displayStart.x + m_displaySize.x);
|
||||
if (m_displayStart.x > cursorPosition.x - globals::getNbColoneBorder() ) {
|
||||
m_displayStart.x = cursorPosition.x - globals::getNbColoneBorder();
|
||||
if (m_displayStart.x < 0) {
|
||||
m_displayStart.x = 0;
|
||||
//EDN_INFO("cursorPosition X : " << cursorPosition.y << " windows " << m_displayStartLineId << "=>" << m_displayStartPixelX + m_displaySize.x);
|
||||
if (m_displayStartPixelX > cursorPosition.x - globals::getNbColoneBorder() ) {
|
||||
m_displayStartPixelX = cursorPosition.x - globals::getNbColoneBorder();
|
||||
if (m_displayStartPixelX < 0) {
|
||||
m_displayStartPixelX = 0;
|
||||
ForceReDraw(true);
|
||||
}
|
||||
} else if (m_displayStart.x + m_displaySize.x <= cursorPosition.x + globals::getNbColoneBorder() ) {
|
||||
m_displayStart.x = cursorPosition.x - m_displaySize.x + globals::getNbColoneBorder() + 1;
|
||||
} else if (m_displayStartPixelX + m_displaySize.x <= cursorPosition.x + globals::getNbColoneBorder() ) {
|
||||
m_displayStartPixelX = cursorPosition.x - m_displaySize.x + globals::getNbColoneBorder() + 1;
|
||||
ForceReDraw(true);
|
||||
}
|
||||
|
||||
//update the buffer position ID :
|
||||
m_displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, m_displayStart.y);
|
||||
m_displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, m_displayStartLineId);
|
||||
*/
|
||||
} else {
|
||||
// center the line at the middle of the screen :
|
||||
position_ts cursorPosition;
|
||||
@@ -961,14 +964,14 @@ void BufferText::UpdateWindowsPosition(bool centerPage)
|
||||
//EDN_DEBUG(" cursor position : " << m_cursorPos << " ==> ligne=" << cursorPosition.y);
|
||||
cursorPosition.x = 0;
|
||||
|
||||
m_displayStart.x = 0;
|
||||
m_displayStartPixelX = 0;
|
||||
//EDN_DEBUG(" display size : " << m_displaySize.y);
|
||||
m_displayStart.y = cursorPosition.y - m_displaySize.y/2;
|
||||
m_displayStart.y = edn_max(m_displayStart.y, 0);
|
||||
m_displayStartLineId = cursorPosition.y - m_displaySize.y/2;
|
||||
m_displayStartLineId = edn_max(m_displayStartLineId, 0);
|
||||
|
||||
m_displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, m_displayStart.y);
|
||||
m_displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, m_displayStartLineId);
|
||||
ForceReDraw(true);
|
||||
//EDN_DEBUG(" display start : " << m_displayStart.x << "x" << m_displayStart.y);
|
||||
//EDN_DEBUG(" display start : " << m_displayStartPixelX << "x" << m_displayStartLineId);
|
||||
//EDN_DEBUG(" -------------------------------------------------");
|
||||
}
|
||||
}
|
||||
@@ -993,7 +996,7 @@ void BufferText::AddChar(char * UTF8data)
|
||||
if (1==size) {
|
||||
if (UTF8data[0] == 0x09) {
|
||||
if (false == haveSelectionActive) {
|
||||
Edn::VectorType<int8_t> tmpVect;
|
||||
etk::VectorType<int8_t> tmpVect;
|
||||
tmpVect.PushBack(0x09);
|
||||
m_EdnBuf.Insert(m_cursorPos, tmpVect);
|
||||
SetInsertPosition(m_cursorPos+1, true);
|
||||
@@ -1002,12 +1005,12 @@ void BufferText::AddChar(char * UTF8data)
|
||||
// count the number of line :
|
||||
int32_t nbSelectedLines = m_EdnBuf.CountLines(SelectionStart, SelectionEnd);
|
||||
if (0 == nbSelectedLines) {
|
||||
Edn::VectorType<int8_t> tmpVect;
|
||||
etk::VectorType<int8_t> tmpVect;
|
||||
tmpVect.PushBack(0x09);
|
||||
m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, tmpVect);
|
||||
SetInsertPosition(SelectionStart+tmpVect.Size(), true);
|
||||
} else {
|
||||
if (true == globals::IsSetShift() ) {
|
||||
if (true == ewol::IsSetShift() ) {
|
||||
m_cursorPos = m_EdnBuf.UnIndent(SELECTION_PRIMARY);
|
||||
} else {
|
||||
m_cursorPos = m_EdnBuf.Indent(SELECTION_PRIMARY);
|
||||
@@ -1016,8 +1019,8 @@ void BufferText::AddChar(char * UTF8data)
|
||||
}
|
||||
actionDone = true;
|
||||
} else if (UTF8data[0] == '\n') {
|
||||
Edn::VectorType<int8_t> tmpVect;
|
||||
if (true == globals::IsSetShift()) {
|
||||
etk::VectorType<int8_t> tmpVect;
|
||||
if (true == ewol::IsSetShift()) {
|
||||
tmpVect.PushBack('\r');
|
||||
} else {
|
||||
tmpVect.PushBack('\n');
|
||||
@@ -1075,7 +1078,7 @@ void BufferText::AddChar(char * UTF8data)
|
||||
|
||||
if (false == actionDone) {
|
||||
if (true == m_EdnBuf.GetUTF8Mode()) {
|
||||
Edn::VectorType<int8_t> tmpVect;
|
||||
etk::VectorType<int8_t> tmpVect;
|
||||
int32_t localOfset = strlen(UTF8data);
|
||||
tmpVect.PushBack((int8_t*)UTF8data, localOfset);
|
||||
if (false == haveSelectionActive) {
|
||||
@@ -1090,7 +1093,7 @@ void BufferText::AddChar(char * UTF8data)
|
||||
char output_ISO;
|
||||
convertUtf8ToIso(m_EdnBuf.GetCharsetType(), UTF8data, output_ISO);
|
||||
//printf(" insert : \"%s\"==> 0x%08x=%d ", UTF8data, (unsigned int)output_ISO, (int)output_ISO);
|
||||
Edn::VectorType<int8_t> tmpVect;
|
||||
etk::VectorType<int8_t> tmpVect;
|
||||
tmpVect.PushBack(output_ISO);
|
||||
if (false == haveSelectionActive) {
|
||||
m_EdnBuf.Insert(m_cursorPos, tmpVect);
|
||||
@@ -1107,14 +1110,14 @@ void BufferText::AddChar(char * UTF8data)
|
||||
}
|
||||
|
||||
|
||||
int32_t BufferText::FindLine(Edn::String &data)
|
||||
int32_t BufferText::FindLine(etk::String &data)
|
||||
{
|
||||
if ( 0 == data.Size()) {
|
||||
EDN_WARNING("no search data");
|
||||
return 0;
|
||||
}
|
||||
EDN_INFO("Search data line : \"" << data << "\"");
|
||||
Edn::VectorType<int8_t> mVectSearch;
|
||||
etk::VectorType<int8_t> mVectSearch;
|
||||
mVectSearch = data.GetVector();
|
||||
//EDN_INFO("search data Forward : startSearchPos=" << startSearchPos );
|
||||
int32_t foundPos;
|
||||
@@ -1151,7 +1154,7 @@ int32_t BufferText::GetCurrentLine(void)
|
||||
|
||||
|
||||
|
||||
void BufferText::Search(Edn::String &data, bool back, bool caseSensitive, bool wrap, bool regExp)
|
||||
void BufferText::Search(etk::String &data, bool back, bool caseSensitive, bool wrap, bool regExp)
|
||||
{
|
||||
EDN_INFO("Search data : \"" << data << "\"");
|
||||
|
||||
@@ -1172,7 +1175,7 @@ void BufferText::Search(Edn::String &data, bool back, bool caseSensitive, bool w
|
||||
EDN_WARNING("no search data");
|
||||
return;
|
||||
}
|
||||
Edn::VectorType<int8_t> mVectSearch;
|
||||
etk::VectorType<int8_t> mVectSearch;
|
||||
mVectSearch = data.GetVector();
|
||||
if (false == back) {
|
||||
//EDN_INFO("search data Forward : startSearchPos=" << startSearchPos );
|
||||
@@ -1239,14 +1242,14 @@ void BufferText::Search(Edn::String &data, bool back, bool caseSensitive, bool w
|
||||
}
|
||||
|
||||
|
||||
void BufferText::Replace(Edn::String &data)
|
||||
void BufferText::Replace(etk::String &data)
|
||||
{
|
||||
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
|
||||
bool SelectionIsRect;
|
||||
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
|
||||
if (true == haveSelectionActive) {
|
||||
// Replace Data :
|
||||
Edn::VectorType<int8_t> myData = data.GetVector();
|
||||
etk::VectorType<int8_t> myData = data.GetVector();
|
||||
m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, myData);
|
||||
SetInsertPosition(SelectionStart + myData.Size());
|
||||
}
|
||||
@@ -1264,7 +1267,7 @@ void BufferText::Replace(Edn::String &data)
|
||||
*/
|
||||
void BufferText::Copy(int8_t clipboardID)
|
||||
{
|
||||
Edn::VectorType<int8_t> mVect;
|
||||
etk::VectorType<int8_t> mVect;
|
||||
// get the curent selected data
|
||||
if (true == m_EdnBuf.SelectHasSelection(SELECTION_PRIMARY) ) {
|
||||
m_EdnBuf.GetSelectionText(SELECTION_PRIMARY, mVect);
|
||||
@@ -1313,7 +1316,7 @@ void BufferText::Cut(int8_t clipboardID)
|
||||
*/
|
||||
void BufferText::Paste(int8_t clipboardID)
|
||||
{
|
||||
Edn::VectorType<int8_t> mVect;
|
||||
etk::VectorType<int8_t> mVect;
|
||||
// copy data from the click board :
|
||||
ClipBoard::Get(clipboardID, mVect);
|
||||
|
||||
@@ -1360,7 +1363,7 @@ void BufferText::Redo(void)
|
||||
}
|
||||
|
||||
|
||||
void BufferText::SetCharset(charset_te newCharset)
|
||||
void BufferText::SetCharset(unicode::charset_te newCharset)
|
||||
{
|
||||
m_EdnBuf.SetCharsetType(newCharset);
|
||||
ForceReDraw(true);
|
@@ -39,17 +39,17 @@ typedef enum {
|
||||
class BufferText : public Buffer {
|
||||
public:
|
||||
BufferText(void);
|
||||
BufferText(Edn::File &fileName);
|
||||
BufferText(etk::File &fileName);
|
||||
virtual ~BufferText(void);
|
||||
void Save(void);
|
||||
|
||||
void GetInfo(infoStatBuffer_ts &infoToUpdate);
|
||||
void SetLineDisplay(uint32_t lineNumber);
|
||||
|
||||
int32_t Display(DrawerManager &drawer);
|
||||
int32_t Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY);
|
||||
void ForceReDraw(bool allElement);
|
||||
void AddChar(char * UTF8data);
|
||||
void cursorMove(int32_t gtkKey);
|
||||
void cursorMove(ewol::eventKbMoveType_te moveTypeEvent);
|
||||
void MouseSelectFromCursorTo(int32_t width, int32_t height);
|
||||
void MouseEvent(int32_t width, int32_t height);
|
||||
void MouseEventDouble(void);
|
||||
@@ -61,9 +61,9 @@ class BufferText : public Buffer {
|
||||
void Cut(int8_t clipboardID);
|
||||
void Paste(int8_t clipboardID);
|
||||
|
||||
void Search(Edn::String &data, bool back, bool caseSensitive, bool wrap, bool regExp);
|
||||
void Replace(Edn::String &data);
|
||||
int32_t FindLine(Edn::String &data);
|
||||
void Search(etk::String &data, bool back, bool caseSensitive, bool wrap, bool regExp);
|
||||
void Replace(etk::String &data);
|
||||
int32_t FindLine(etk::String &data);
|
||||
void JumpAtLine(int32_t newLine);
|
||||
int32_t GetCurrentLine(void);
|
||||
|
||||
@@ -72,7 +72,7 @@ class BufferText : public Buffer {
|
||||
void SelectNone(void);
|
||||
void Undo(void);
|
||||
void Redo(void);
|
||||
void SetCharset(charset_te newCharset);
|
||||
void SetCharset(unicode::charset_te newCharset);
|
||||
protected:
|
||||
void NameChange(void);
|
||||
|
||||
@@ -85,13 +85,13 @@ class BufferText : public Buffer {
|
||||
|
||||
// Direct buffer IO
|
||||
EdnBuf m_EdnBuf; //!< buffer associated on this displayer
|
||||
position_ts m_displayStart; //!< position where the display is starting
|
||||
int32_t m_displayStartLineId; //!< Id of the line that the display is starting (in nb line)
|
||||
int32_t m_displayStartPixelX; //!< Pixel of the display starting (in pixel)
|
||||
position_ts m_displaySize; //!< number of char displayable in the screan
|
||||
int32_t m_displayStartBufferPos; //!< position where the buffer start
|
||||
// Cursor :
|
||||
int32_t m_cursorPos; //!< position in the buffer of the cursor
|
||||
int32_t m_cursorPreferredCol; //!< colomn of the last up and down ...
|
||||
bool m_cursorOn; //!< the blink of the cursor ...
|
||||
cursorDisplayMode_te m_cursorMode; //!< type of cursor Selected
|
||||
|
||||
displayHLData_ts m_displayLocalSyntax; //!< for the display of the local elements (display HL mode)
|
||||
@@ -99,7 +99,6 @@ class BufferText : public Buffer {
|
||||
// internal function
|
||||
void BasicInit(void);
|
||||
void UpdateWindowsPosition(bool centerPage = false);
|
||||
void displayLineNumber(DrawerManager &drawer);
|
||||
|
||||
void CleanSelectLine(void);
|
||||
|
||||
@@ -112,9 +111,11 @@ class BufferText : public Buffer {
|
||||
bool TextDMoveDown(int32_t offset);
|
||||
void SetInsertPosition(int32_t newPosition, bool insertChar = false);
|
||||
|
||||
void GetMousePosition(int32_t width, int32_t height, int32_t &x, int32_t &y);
|
||||
int32_t GetMousePosition(int32_t width, int32_t height);
|
||||
void MoveUpDown(int32_t ofset);
|
||||
void DrawLineNumber(DrawerManager &drawer,char *myPrint, int32_t lineNumber, int32_t positionY);
|
||||
void DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY,char *myPrint, int32_t lineNumber, int32_t positionY);
|
||||
|
||||
void CursorDisplay(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth);
|
||||
|
||||
};
|
||||
|
@@ -23,25 +23,26 @@
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "tools_globals.h"
|
||||
#include "Colorize.h"
|
||||
#include "Edn.h"
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <Colorize.h>
|
||||
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "Colorize"
|
||||
|
||||
|
||||
Colorize::Colorize( Edn::String &newColorName)
|
||||
Colorize::Colorize( etk::String &newColorName)
|
||||
{
|
||||
|
||||
m_colorFG.red=0;
|
||||
m_colorFG.green=0;
|
||||
m_colorFG.blue=0;
|
||||
m_colorFG.alpha=1;
|
||||
m_colorBG.red=0;
|
||||
m_colorBG.green=0;
|
||||
m_colorBG.blue=0;
|
||||
m_colorBG.alpha=1;
|
||||
|
||||
italic = false;
|
||||
bold = false;
|
||||
@@ -58,9 +59,11 @@ Colorize::Colorize(void)
|
||||
m_colorFG.red=0;
|
||||
m_colorFG.green=0;
|
||||
m_colorFG.blue=0;
|
||||
m_colorFG.alpha=1;
|
||||
m_colorBG.red=0;
|
||||
m_colorBG.green=0;
|
||||
m_colorBG.blue=0;
|
||||
m_colorBG.alpha=1;
|
||||
|
||||
italic = false;
|
||||
bold = false;
|
||||
@@ -82,14 +85,14 @@ void Colorize::SetName(const char *newColorName)
|
||||
ColorName = newColorName;
|
||||
}
|
||||
|
||||
void Colorize::SetName(Edn::String &newColorName)
|
||||
void Colorize::SetName(etk::String &newColorName)
|
||||
{
|
||||
//EDN_INFO("color change name : \"%s\" ==> \"%s\"",ColorName.c_str(), newColorName.c_str());
|
||||
ColorName = newColorName;
|
||||
}
|
||||
|
||||
|
||||
Edn::String Colorize::GetName(void)
|
||||
etk::String Colorize::GetName(void)
|
||||
{
|
||||
return ColorName;
|
||||
}
|
||||
@@ -98,24 +101,38 @@ Edn::String Colorize::GetName(void)
|
||||
void Colorize::SetFgColor(const char *myColor)
|
||||
{
|
||||
haveFG = true;
|
||||
unsigned int r=0;
|
||||
unsigned int v=0;
|
||||
unsigned int b=0;
|
||||
sscanf(myColor, "#%02x%02x%02x", &r,&v,&b);
|
||||
signed int r=0;
|
||||
signed int v=0;
|
||||
signed int b=0;
|
||||
signed int a=-1;
|
||||
sscanf(myColor, "#%02x%02x%02x%02x", &r, &v, &b, &a);
|
||||
m_colorFG.red = (float)r/255.0;
|
||||
m_colorFG.green = (float)v/255.0;
|
||||
m_colorFG.blue = (float)b/255.0;
|
||||
if (-1 == a) {
|
||||
m_colorFG.alpha = 1;
|
||||
} else {
|
||||
m_colorFG.alpha = (float)a/255.0;
|
||||
}
|
||||
//EDN_INFO(myColor << " ==> r="<< r <<" v="<< v <<" b="<< b );
|
||||
}
|
||||
|
||||
void Colorize::SetBgColor(const char *myColor)
|
||||
{
|
||||
haveBG = true;
|
||||
unsigned int r,v,b;
|
||||
sscanf(myColor, "#%02x%02x%02x", &r,&v,&b);
|
||||
signed int r=0;
|
||||
signed int v=0;
|
||||
signed int b=0;
|
||||
signed int a=-1;
|
||||
sscanf(myColor, "#%02x%02x%02x%02x", &r, &v, &b, &a);
|
||||
m_colorBG.red = (float)r/255.0;
|
||||
m_colorBG.green = (float)v/255.0;
|
||||
m_colorBG.blue = (float)b/255.0;
|
||||
if (-1 == a) {
|
||||
m_colorBG.alpha = 1;
|
||||
} else {
|
||||
m_colorBG.alpha = (float)a/255.0;
|
||||
}
|
||||
}
|
||||
|
||||
bool Colorize::HaveBg(void)
|
@@ -26,31 +26,19 @@
|
||||
#ifndef __COLORIZE_H__
|
||||
#define __COLORIZE_H__
|
||||
|
||||
#include "Edn.h"
|
||||
|
||||
extern "C" {
|
||||
typedef struct {
|
||||
float red;
|
||||
float green;
|
||||
float blue;
|
||||
} color_ts;
|
||||
}
|
||||
|
||||
|
||||
class Colorize {
|
||||
public:
|
||||
// Constructeur
|
||||
Colorize(void);
|
||||
Colorize(Edn::String &newColorName);
|
||||
Colorize(etk::String &newColorName);
|
||||
~Colorize(void);
|
||||
|
||||
void SetName(Edn::String &newColorName);
|
||||
void SetName(etk::String &newColorName);
|
||||
void SetName(const char *newColorName);
|
||||
Edn::String GetName(void);
|
||||
etk::String GetName(void);
|
||||
void SetFgColor(const char *myColor);
|
||||
void SetBgColor(const char *myColor);
|
||||
void ApplyFG(cairo_t * cr) { cairo_set_source_rgba(cr, m_colorFG.red, m_colorFG.green, m_colorFG.blue, 1); };
|
||||
void ApplyBG(cairo_t * cr) { cairo_set_source_rgba(cr, m_colorBG.red, m_colorBG.green, m_colorBG.blue, 1); };
|
||||
|
||||
color_ts & GetFG(void) { return m_colorFG; };
|
||||
color_ts & GetBG(void) { return m_colorBG; };
|
||||
@@ -62,10 +50,10 @@ class Colorize {
|
||||
bool GetItalic(void);
|
||||
bool GetBold(void);
|
||||
|
||||
void Display(int32_t i) { EDN_INFO(" " << i << " : \"" << ColorName.c_str() << "\"" /*<< " fg="<< m_colorFG.red <<","<< m_colorFG.green <<","<< m_colorFG.blue <<" bg="<< m_colorBG.red <<","<< m_colorBG.green <<","<< m_colorBG.blue*/ ); };
|
||||
void Display(int32_t i) { EDN_INFO(" " << i << " : \"" << ColorName.c_str() << "\"" << " fg="<< m_colorFG.red <<","<< m_colorFG.green <<","<< m_colorFG.blue <<","<< m_colorFG.alpha /*<<" bg="<< m_colorBG.red <<","<< m_colorBG.green <<","<< m_colorBG.blue*/ ); };
|
||||
|
||||
private:
|
||||
Edn::String ColorName; //!< curent color Name
|
||||
etk::String ColorName; //!< curent color Name
|
||||
color_ts m_colorFG;
|
||||
color_ts m_colorBG;
|
||||
|
@@ -22,16 +22,18 @@
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
#include "tools_debug.h"
|
||||
#include "tools_globals.h"
|
||||
#include "ColorizeManager.h"
|
||||
#include "tinyxml.h"
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <ColorizeManager.h>
|
||||
#include <tinyXML/tinyxml.h>
|
||||
#include <ewol/WidgetMessageMultiCast.h>
|
||||
|
||||
#define PFX "ColorizeManager "
|
||||
|
||||
|
||||
ColorizeManager::ColorizeManager(void) : MsgBroadcast("Colorize Manager", EDN_CAT_COLOR)
|
||||
ColorizeManager::ColorizeManager(void)
|
||||
{
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgReloadColorFile);
|
||||
}
|
||||
|
||||
ColorizeManager::~ColorizeManager(void)
|
||||
@@ -51,23 +53,26 @@ ColorizeManager::~ColorizeManager(void)
|
||||
}
|
||||
|
||||
|
||||
void ColorizeManager::OnMessage(int32_t id, int32_t dataID)
|
||||
bool ColorizeManager::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
/*
|
||||
switch (id)
|
||||
{
|
||||
case EDN_MSG__RELOAD_COLOR_FILE:
|
||||
{
|
||||
// Reaload File
|
||||
// TODO : Check this : Pb in the recopy Edn::String element
|
||||
Edn::String plop = m_fileColor;
|
||||
// TODO : Check this : Pb in the recopy etk::String element
|
||||
etk::String plop = m_fileColor;
|
||||
LoadFile(plop.c_str());
|
||||
}
|
||||
break;
|
||||
}
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void ColorizeManager::LoadFile(Edn::String &xmlFilename)
|
||||
void ColorizeManager::LoadFile(etk::String &xmlFilename)
|
||||
{
|
||||
LoadFile(xmlFilename.c_str());
|
||||
}
|
||||
@@ -95,7 +100,33 @@ void ColorizeManager::LoadFile(const char * xmlFilename)
|
||||
// allocate the document in the stack
|
||||
TiXmlDocument XmlDocument;
|
||||
// open the curent File
|
||||
XmlDocument.LoadFile(xmlFilename);
|
||||
etk::File fileName(xmlFilename, etk::FILE_TYPE_DATA);
|
||||
if (false == fileName.Exist()) {
|
||||
EWOL_ERROR("File Does not exist : " << fileName);
|
||||
return;
|
||||
}
|
||||
int32_t fileSize = fileName.Size();
|
||||
if (0==fileSize) {
|
||||
EWOL_ERROR("This file is empty : " << fileName);
|
||||
return;
|
||||
}
|
||||
if (false == fileName.fOpenRead()) {
|
||||
EWOL_ERROR("Can not open the file : " << fileName);
|
||||
return;
|
||||
}
|
||||
// allocate data
|
||||
char * fileBuffer = new char[fileSize];
|
||||
if (NULL == fileBuffer) {
|
||||
EWOL_ERROR("Error Memory allocation size=" << fileSize);
|
||||
return;
|
||||
}
|
||||
// load data from the file :
|
||||
fileName.fRead(fileBuffer, 1, fileSize);
|
||||
// close the file:
|
||||
fileName.fClose();
|
||||
// load the XML from the memory
|
||||
XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8);
|
||||
|
||||
TiXmlElement* root = XmlDocument.FirstChildElement( "EdnColor" );
|
||||
if (NULL == root ) {
|
||||
EDN_ERROR(PFX"(l ?) main node not find: \"EdnColor\" in \"" << xmlFilename << "\"");
|
||||
@@ -150,13 +181,19 @@ void ColorizeManager::LoadFile(const char * xmlFilename)
|
||||
}
|
||||
const char *color = pGuiNode->ToElement()->Attribute("val");
|
||||
if (NULL != color) {
|
||||
unsigned int r=0;
|
||||
unsigned int v=0;
|
||||
unsigned int b=0;
|
||||
sscanf(color, "#%02x%02x%02x", &r,&v,&b);
|
||||
int r=0;
|
||||
int v=0;
|
||||
int b=0;
|
||||
int a=-1;
|
||||
sscanf(color, "#%02x%02x%02x%02x", &r, &v, &b, &a);
|
||||
basicColors[id].red = (float)r/255.0;
|
||||
basicColors[id].green = (float)v/255.0;
|
||||
basicColors[id].blue = (float)b/255.0;
|
||||
if (-1 == a) {
|
||||
basicColors[id].alpha = 1;
|
||||
} else {
|
||||
basicColors[id].alpha = (float)a/255.0;
|
||||
}
|
||||
/*
|
||||
EDN_INFO(" Specify color for system ID="<< id );
|
||||
EDN_INFO(" " << color << " ==> r="<< r <<" v="<< v <<" b="<< b );
|
||||
@@ -228,15 +265,18 @@ void ColorizeManager::LoadFile(const char * xmlFilename)
|
||||
pNode = pNode->NextSibling();
|
||||
}
|
||||
}
|
||||
SendMessage(EDN_MSG__COLOR_HAS_CHANGE);
|
||||
SendMessage(EDN_MSG__USER_DISPLAY_CHANGE);
|
||||
if (NULL != fileBuffer) {
|
||||
delete[] fileBuffer;
|
||||
}
|
||||
//SendMessage(EDN_MSG__COLOR_HAS_CHANGE);
|
||||
//SendMessage(EDN_MSG__USER_DISPLAY_CHANGE);
|
||||
}
|
||||
|
||||
Colorize *ColorizeManager::Get(const char *colorName)
|
||||
{
|
||||
int32_t i;
|
||||
for (i=0; i<listMyColor.Size(); i++) {
|
||||
Edn::String elementName = listMyColor[i]->GetName();
|
||||
etk::String elementName = listMyColor[i]->GetName();
|
||||
if (elementName == colorName) {
|
||||
return listMyColor[i];
|
||||
}
|
||||
@@ -246,7 +286,7 @@ Colorize *ColorizeManager::Get(const char *colorName)
|
||||
return errorColor;
|
||||
}
|
||||
|
||||
Colorize *ColorizeManager::Get(Edn::String &colorName)
|
||||
Colorize *ColorizeManager::Get(etk::String &colorName)
|
||||
{
|
||||
return Get(colorName.c_str());
|
||||
}
|
||||
@@ -265,14 +305,14 @@ bool ColorizeManager::Exist(const char *colorName)
|
||||
{
|
||||
int32_t i;
|
||||
for (i=0; i<listMyColor.Size(); i++) {
|
||||
Edn::String elementName = listMyColor[i]->GetName();
|
||||
etk::String elementName = listMyColor[i]->GetName();
|
||||
if (elementName == colorName) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool ColorizeManager::Exist(Edn::String &colorName)
|
||||
bool ColorizeManager::Exist(etk::String &colorName)
|
||||
{
|
||||
return Exist(colorName.c_str());
|
||||
}
|
||||
@@ -282,7 +322,7 @@ void ColorizeManager::DisplayListOfColor(void)
|
||||
int32_t i;
|
||||
EDN_INFO(PFX"List of ALL COLOR : ");
|
||||
for (i=0; i<listMyColor.Size(); i++) {
|
||||
//Edn::String elementName = listMyColor[i]->GetName();
|
||||
//etk::String elementName = listMyColor[i]->GetName();
|
||||
//EDN_INFO(i << " : \"" << elementName.c_str() << "\"" );
|
||||
listMyColor[i]->Display(i);
|
||||
}
|
@@ -26,10 +26,10 @@
|
||||
#ifndef __COLORIZE_MANAGER_H__
|
||||
#define __COLORIZE_MANAGER_H__
|
||||
|
||||
#include "Singleton.h"
|
||||
#include "Colorize.h"
|
||||
#include "MsgBroadcast.h"
|
||||
#include "Edn.h"
|
||||
#include <etk/Singleton.h>
|
||||
#include <Colorize.h>
|
||||
#include <MsgBroadcast.h>
|
||||
#include <ewol/Widget.h>
|
||||
|
||||
typedef enum {
|
||||
// BASIC color for codeViewer
|
||||
@@ -50,29 +50,29 @@ typedef enum {
|
||||
|
||||
|
||||
|
||||
class ColorizeManager: public Singleton<ColorizeManager>, public MsgBroadcast
|
||||
class ColorizeManager: public etk::Singleton<ColorizeManager>, public ewol::Widget
|
||||
{
|
||||
friend class Singleton<ColorizeManager>;
|
||||
friend class etk::Singleton<ColorizeManager>;
|
||||
// specific for sigleton system...
|
||||
private:
|
||||
// Constructeur
|
||||
ColorizeManager(void);
|
||||
~ColorizeManager(void);
|
||||
public:
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
||||
public:
|
||||
void LoadFile(Edn::String &xmlFilename);
|
||||
void LoadFile(etk::String &xmlFilename);
|
||||
void LoadFile(const char * xmlFilename);
|
||||
Colorize * Get(const char *colorName);
|
||||
Colorize * Get(Edn::String &colorName);
|
||||
Colorize * Get(etk::String &colorName);
|
||||
color_ts & Get(basicColor_te myColor);
|
||||
bool Exist(Edn::String &colorName);
|
||||
bool Exist(etk::String &colorName);
|
||||
bool Exist(const char *colorName);
|
||||
void DisplayListOfColor(void);
|
||||
|
||||
private:
|
||||
Edn::String m_fileColor;
|
||||
Edn::VectorType<Colorize*> listMyColor; //!< List of ALL Color
|
||||
etk::String m_fileColor;
|
||||
etk::VectorType<Colorize*> listMyColor; //!< List of ALL Color
|
||||
Colorize * errorColor;
|
||||
color_ts basicColors[COLOR_NUMBER_MAX];
|
||||
};
|
@@ -23,25 +23,27 @@
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "tools_globals.h"
|
||||
#include "Display.h"
|
||||
#include "BufferView.h"
|
||||
#include "BufferManager.h"
|
||||
#include "ColorizeManager.h"
|
||||
#include "MainWindows.h"
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <Display.h>
|
||||
#include <BufferView.h>
|
||||
#include <BufferManager.h>
|
||||
#include <ColorizeManager.h>
|
||||
#include <MainWindows.h>
|
||||
#include <ewol/WidgetMessageMultiCast.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "BufferView"
|
||||
|
||||
BufferView::BufferView(void) : MsgBroadcast("Buffer View", EDN_CAT_GUI)
|
||||
BufferView::BufferView(void)
|
||||
{
|
||||
m_shawableAreaX = 0;
|
||||
m_shawableAreaY = 0;
|
||||
//ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerNewFile);
|
||||
// Init link with the buffer Manager
|
||||
m_bufferManager = BufferManager::getInstance();
|
||||
m_colorManager = ColorizeManager::getInstance();
|
||||
|
||||
//m_bufferManager = BufferManager::Get();
|
||||
//m_colorManager = ColorizeManager::Get();
|
||||
#if 0
|
||||
m_widget = gtk_drawing_area_new();
|
||||
gtk_widget_set_size_request( m_widget, 250, 100);
|
||||
|
||||
@@ -74,6 +76,7 @@ BufferView::BufferView(void) : MsgBroadcast("Buffer View", EDN_CAT_GUI)
|
||||
# elif defined( USE_GTK_VERSION_2_0 )
|
||||
g_signal_connect( G_OBJECT(m_widget), "expose_event", G_CALLBACK(CB_displayDraw), this);
|
||||
# endif
|
||||
#endif
|
||||
m_selectedID = -1;
|
||||
|
||||
}
|
||||
@@ -82,14 +85,15 @@ BufferView::~BufferView(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
GtkWidget * BufferView::GetMainWidget(void)
|
||||
{
|
||||
return m_widget;
|
||||
}
|
||||
|
||||
void BufferView::OnMessage(int32_t id, int32_t dataID)
|
||||
*/
|
||||
bool BufferView::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
/*
|
||||
switch (id)
|
||||
{
|
||||
case EDN_MSG__BUFFER_CHANGE_CURRENT:
|
||||
@@ -98,15 +102,17 @@ void BufferView::OnMessage(int32_t id, int32_t dataID)
|
||||
case EDN_MSG__BUFFER_CHANGE_NAME:
|
||||
case EDN_MSG__BUFFER_CHANGE_MODIFY:
|
||||
// change Title :
|
||||
gtk_widget_queue_draw(m_widget);
|
||||
//gtk_widget_queue_draw(m_widget);
|
||||
break;
|
||||
case EDN_MSG__USER_DISPLAY_CHANGE:
|
||||
// Redraw all the display ...
|
||||
gtk_widget_queue_draw(m_widget);
|
||||
//gtk_widget_queue_draw(m_widget);
|
||||
break;
|
||||
}
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
gboolean BufferView::CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data)
|
||||
{
|
||||
@@ -381,5 +387,5 @@ gint BufferView::CB_mouseMotionEvent( GtkWidget *widget, GdkEventMotion *event,
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -25,23 +25,23 @@
|
||||
#ifndef __BUFFER_VIEW_H__
|
||||
#define __BUFFER_VIEW_H__
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "Singleton.h"
|
||||
#include "CodeView.h"
|
||||
#include "BufferManager.h"
|
||||
#include "Display.h"
|
||||
#include "MsgBroadcast.h"
|
||||
#include <tools_debug.h>
|
||||
#include <CodeView.h>
|
||||
#include <BufferManager.h>
|
||||
#include <Display.h>
|
||||
#include <MsgBroadcast.h>
|
||||
|
||||
|
||||
|
||||
class BufferView : public MsgBroadcast
|
||||
class BufferView : public ewol::Widget
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
BufferView(void);
|
||||
~BufferView(void);
|
||||
GtkWidget *GetMainWidget(void);
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
//GtkWidget *GetMainWidget(void);
|
||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
||||
/*
|
||||
// sur : GTK+ callback :
|
||||
static gboolean CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data);
|
||||
static gboolean CB_displayInit( GtkWidget *widget, gpointer data);
|
||||
@@ -56,12 +56,12 @@ class BufferView : public MsgBroadcast
|
||||
static void OnPopupEventClose(GtkWidget *menuitem, gpointer data);
|
||||
static void OnPopupEventSave(GtkWidget *menuitem, gpointer data);
|
||||
static void OnPopupEventSaveAs(GtkWidget *menuitem, gpointer data);
|
||||
|
||||
*/
|
||||
|
||||
private:
|
||||
void ViewPopupMenu(GtkWidget *parrent, GdkEventButton *event, int32_t BufferID);
|
||||
//void ViewPopupMenu(GtkWidget *parrent, GdkEventButton *event, int32_t BufferID);
|
||||
// main windows widget :
|
||||
GtkWidget * m_widget;
|
||||
//GtkWidget * m_widget;
|
||||
// récupération des proprieter général...
|
||||
BufferManager * m_bufferManager;
|
||||
ColorizeManager * m_colorManager;
|
423
jni/edn/CustumWidget/CodeView/CodeView.cpp
Normal file
423
jni/edn/CustumWidget/CodeView/CodeView.cpp
Normal file
@@ -0,0 +1,423 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file CodeView.cpp
|
||||
* @brief Editeur De N'ours : Code Viewer Widget
|
||||
* This is an abstraction
|
||||
* @author Edouard DUPIN
|
||||
* @date 05/01/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <CodeView.h>
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <Display.h>
|
||||
#include <CodeView.h>
|
||||
#include <BufferManager.h>
|
||||
#include <ColorizeManager.h>
|
||||
#include <ClipBoard.h>
|
||||
#include <SearchData.h>
|
||||
|
||||
#include <ewol/WidgetManager.h>
|
||||
#include <ewol/WidgetMessageMultiCast.h>
|
||||
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "ewol::CodeView"
|
||||
|
||||
|
||||
CodeView::CodeView(void)
|
||||
{
|
||||
m_label = "CodeView is disable ...";
|
||||
m_bufferID = -1;
|
||||
m_buttunOneSelected = false;
|
||||
|
||||
// Init link with the buffer Manager
|
||||
m_bufferManager = BufferManager::getInstance();
|
||||
m_colorManager = ColorizeManager::getInstance();
|
||||
|
||||
m_textColorFg.red = 0.0;
|
||||
m_textColorFg.green = 0.0;
|
||||
m_textColorFg.blue = 0.0;
|
||||
m_textColorFg.alpha = 1.0;
|
||||
|
||||
m_textColorBg.red = 0.0;
|
||||
m_textColorBg.green = 0.0;
|
||||
m_textColorBg.blue = 0.0;
|
||||
m_textColorBg.alpha = 0.25;
|
||||
SetCanHaveFocus(true);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentChangeBufferId);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentSave);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentSaveAs);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentSelectAll);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentRemoveLine);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentUnSelect);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentCopy);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentCut);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentPaste);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentFindPrevious);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentFindNext);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentFindOldNext);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentReplace);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentReplaceAll);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentClose);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentUndo);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentRedo);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentGotoLine);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentSetCharset);
|
||||
}
|
||||
|
||||
CodeView::~CodeView(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool CodeView::CalculateMinSize(void)
|
||||
{
|
||||
m_minSize.x = 50;
|
||||
m_minSize.y = 50;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CodeView::OnRegenerateDisplay(void)
|
||||
{
|
||||
// create tmp object :
|
||||
ewol::OObject2DTextColored* myOObjectText = new ewol::OObject2DTextColored("", -1);
|
||||
ewol::OObject2DColored* myOObjectsColored = new ewol::OObject2DColored();
|
||||
|
||||
// generate the objects :
|
||||
//m_bufferID = 0;
|
||||
m_bufferManager->Get(m_bufferID)->Display(myOObjectText, myOObjectsColored, m_size.x, m_size.y);
|
||||
|
||||
// clean the object list ...
|
||||
ClearOObjectList();
|
||||
// add generated element
|
||||
AddOObject(myOObjectsColored, "CodeViewBackground");
|
||||
AddOObject(myOObjectText, "CodeViewText");
|
||||
}
|
||||
|
||||
bool CodeView::OnEventArea(const char * generateEventId, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
/*
|
||||
//bool eventIsOK = false;
|
||||
//EWOL_DEBUG("Receive event : \"" << generateEventId << "\"");
|
||||
if(ewolEventButtonPressed == generateEventId) {
|
||||
EWOL_INFO("BT pressed ... " << m_label);
|
||||
//eventIsOK = true;
|
||||
ewol::widgetManager::FocusKeep(this);
|
||||
} else if(ewolEventButtonEnter == generateEventId) {
|
||||
OnRegenerateDisplay();
|
||||
}
|
||||
//return eventIsOK;
|
||||
*/
|
||||
// in every case this not stop the propagation of the event
|
||||
return false;
|
||||
// if overwrited... you can ...
|
||||
}
|
||||
|
||||
|
||||
bool CodeView::OnEventKb(ewol::eventKbType_te typeEvent, char UTF8_data[UTF8_MAX_SIZE])
|
||||
{
|
||||
//EDN_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent);
|
||||
if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) {
|
||||
m_bufferManager->Get(m_bufferID)->AddChar(UTF8_data);
|
||||
OnRegenerateDisplay();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CodeView::OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveType_te moveTypeEvent)
|
||||
{
|
||||
if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) {
|
||||
m_bufferManager->Get(m_bufferID)->cursorMove(moveTypeEvent);
|
||||
OnRegenerateDisplay();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
x -= m_origin.x;
|
||||
y -= m_origin.y;
|
||||
/*
|
||||
etk::String type = (int)typeEvent;
|
||||
switch (typeEvent)
|
||||
{
|
||||
case ewol::EVENT_INPUT_TYPE_DOWN:
|
||||
type = "EVENT_INPUT_TYPE_DOWN";
|
||||
break;
|
||||
case ewol::EVENT_INPUT_TYPE_MOVE:
|
||||
type = "EVENT_INPUT_TYPE_MOVE";
|
||||
break;
|
||||
case ewol::EVENT_INPUT_TYPE_SINGLE:
|
||||
type = "EVENT_INPUT_TYPE_SINGLE";
|
||||
break;
|
||||
case ewol::EVENT_INPUT_TYPE_DOUBLE:
|
||||
type = "EVENT_INPUT_TYPE_DOUBLE";
|
||||
break;
|
||||
case ewol::EVENT_INPUT_TYPE_TRIPLE:
|
||||
type = "EVENT_INPUT_TYPE_TRIPLE";
|
||||
break;
|
||||
case ewol::EVENT_INPUT_TYPE_UP:
|
||||
type = "EVENT_INPUT_TYPE_UP";
|
||||
break;
|
||||
case ewol::EVENT_INPUT_TYPE_ENTER:
|
||||
type = "EVENT_INPUT_TYPE_ENTER";
|
||||
break;
|
||||
case ewol::EVENT_INPUT_TYPE_LEAVE:
|
||||
type = "EVENT_INPUT_TYPE_LEAVE";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
|
||||
EDN_DEBUG("Event : " << IdInput << " type : " << type << " position(" << x << "," << y << ")");
|
||||
*/
|
||||
if (1 == IdInput) {
|
||||
if (ewol::EVENT_INPUT_TYPE_DOWN == typeEvent) {
|
||||
m_buttunOneSelected = true;
|
||||
ewol::widgetManager::FocusKeep(this);
|
||||
} else if (ewol::EVENT_INPUT_TYPE_UP == typeEvent) {
|
||||
m_buttunOneSelected = false;
|
||||
m_bufferManager->Get(m_bufferID)->Copy(COPY_MIDDLE_BUTTON);
|
||||
OnRegenerateDisplay();
|
||||
} else if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) {
|
||||
//EDN_INFO("mouse-event BT1 ==> One Clicked %d, %d", (uint32_t)event->x, (uint32_t)event->y);
|
||||
m_bufferManager->Get(m_bufferID)->MouseEvent(x, y);
|
||||
OnRegenerateDisplay();
|
||||
} else if (ewol::EVENT_INPUT_TYPE_DOUBLE == typeEvent) {
|
||||
//EDN_INFO("mouse-event BT1 ==> Double Clicked %d, %d", (uint32_t)event->x, (uint32_t)event->y);
|
||||
m_bufferManager->Get(m_bufferID)->MouseEventDouble();
|
||||
OnRegenerateDisplay();
|
||||
} else if (ewol::EVENT_INPUT_TYPE_TRIPLE == typeEvent) {
|
||||
//EDN_INFO("mouse-event BT1 ==> Triple Clicked");
|
||||
m_bufferManager->Get(m_bufferID)->MouseEventTriple();
|
||||
OnRegenerateDisplay();
|
||||
} else if (ewol::EVENT_INPUT_TYPE_MOVE == typeEvent) {
|
||||
if (true == m_buttunOneSelected) {
|
||||
int xxx, yyy;
|
||||
xxx = x;
|
||||
yyy = y;
|
||||
if (xxx<0) {
|
||||
xxx = 0;
|
||||
}
|
||||
if (yyy<0) {
|
||||
yyy = 0;
|
||||
}
|
||||
//EDN_INFO("mouse-motion BT1 %d, %d", xxx, yyy);
|
||||
m_bufferManager->Get(m_bufferID)->MouseSelectFromCursorTo(xxx, yyy);
|
||||
OnRegenerateDisplay();
|
||||
}
|
||||
}
|
||||
} else if (2 == IdInput) {
|
||||
if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) {
|
||||
m_bufferManager->Get(m_bufferID)->MouseEvent(x, y);
|
||||
m_bufferManager->Get(m_bufferID)->Paste(COPY_MIDDLE_BUTTON);
|
||||
OnRegenerateDisplay();
|
||||
ewol::widgetManager::FocusKeep(this);
|
||||
}
|
||||
}
|
||||
if (4 == IdInput && ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent)
|
||||
{
|
||||
//EDN_INFO("mouse-event GDK_SCROLL_UP");
|
||||
m_bufferManager->Get(m_bufferID)->ScrollUp();
|
||||
OnRegenerateDisplay();
|
||||
ewol::widgetManager::FocusKeep(this);
|
||||
} else if (5 == IdInput && ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent)
|
||||
{
|
||||
//EDN_INFO("mouse-event GDK_SCROLL_DOWN");
|
||||
m_bufferManager->Get(m_bufferID)->ScrollDown();
|
||||
OnRegenerateDisplay();
|
||||
ewol::widgetManager::FocusKeep(this);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool CodeView::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
EDN_DEBUG("Extern Event : " << widgetID << " type : " << generateEventId << " position(" << x << "," << y << ")");
|
||||
|
||||
if( ednMsgCodeViewCurrentChangeBufferId == generateEventId) {
|
||||
int32_t bufferID = 0;
|
||||
sscanf(eventExternId, "%d", &bufferID);
|
||||
EDN_INFO("Select a new Buffer ... " << bufferID);
|
||||
m_bufferID = bufferID;
|
||||
m_bufferManager->Get(m_bufferID)->ForceReDraw(true);
|
||||
// request the display of the curent Editor
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferChangeCurrent, (char*)eventExternId);
|
||||
|
||||
} else if (ednMsgCodeViewCurrentSave == generateEventId) {
|
||||
|
||||
} else if (ednMsgCodeViewCurrentSaveAs == generateEventId) {
|
||||
|
||||
} else if (ednMsgCodeViewCurrentSelectAll == generateEventId) {
|
||||
|
||||
} else if (ednMsgCodeViewCurrentRemoveLine == generateEventId) {
|
||||
|
||||
} else if (ednMsgCodeViewCurrentUnSelect == generateEventId) {
|
||||
|
||||
} else if (ednMsgCodeViewCurrentCopy == generateEventId) {
|
||||
|
||||
} else if (ednMsgCodeViewCurrentCut == generateEventId) {
|
||||
|
||||
} else if (ednMsgCodeViewCurrentPaste == generateEventId) {
|
||||
|
||||
} else if (ednMsgCodeViewCurrentFindPrevious == generateEventId) {
|
||||
|
||||
} else if (ednMsgCodeViewCurrentFindNext == generateEventId) {
|
||||
|
||||
} else if (ednMsgCodeViewCurrentFindOldNext == generateEventId) {
|
||||
|
||||
} else if (ednMsgCodeViewCurrentReplace == generateEventId) {
|
||||
|
||||
} else if (ednMsgCodeViewCurrentReplaceAll == generateEventId) {
|
||||
|
||||
} else if (ednMsgCodeViewCurrentClose == generateEventId) {
|
||||
|
||||
} else if (ednMsgCodeViewCurrentUndo == generateEventId) {
|
||||
|
||||
} else if (ednMsgCodeViewCurrentRedo == generateEventId) {
|
||||
|
||||
} else if (ednMsgCodeViewCurrentGotoLine == generateEventId) {
|
||||
|
||||
} else if (ednMsgCodeViewCurrentSetCharset == generateEventId) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
switch (id)
|
||||
{
|
||||
case EDN_MSG__CURRENT_CHANGE_BUFFER_ID:
|
||||
EDN_INFO("Select a new Buffer ... " << dataID);
|
||||
m_bufferID = dataID;
|
||||
m_bufferManager->Get(m_bufferID)->ForceReDraw(true);
|
||||
// request the display of the curent Editor
|
||||
SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, m_bufferID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_SAVE:
|
||||
SendMessage(EDN_MSG__BUFF_ID_SAVE, m_bufferID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_SAVE_AS:
|
||||
SendMessage(EDN_MSG__GUI_SHOW_SAVE_AS, m_bufferID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_REMOVE_LINE:
|
||||
m_bufferManager->Get(m_bufferID)->RemoveLine();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_SELECT_ALL:
|
||||
m_bufferManager->Get(m_bufferID)->SelectAll();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_UN_SELECT:
|
||||
m_bufferManager->Get(m_bufferID)->SelectNone();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_COPY:
|
||||
if (dataID == -1) {
|
||||
dataID = COPY_STD;
|
||||
}
|
||||
m_bufferManager->Get(m_bufferID)->Copy(dataID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_CUT:
|
||||
if (dataID == -1) {
|
||||
dataID = COPY_STD;
|
||||
}
|
||||
m_bufferManager->Get(m_bufferID)->Cut(dataID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_PASTE:
|
||||
if (dataID == -1) {
|
||||
dataID = COPY_STD;
|
||||
}
|
||||
m_bufferManager->Get(m_bufferID)->Paste(dataID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_FIND_PREVIOUS:
|
||||
{
|
||||
etk::String myDataString;
|
||||
SearchData::GetSearch(myDataString);
|
||||
m_bufferManager->Get(m_bufferID)->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__CURRENT_FIND_NEXT:
|
||||
{
|
||||
etk::String myDataString;
|
||||
SearchData::GetSearch(myDataString);
|
||||
m_bufferManager->Get(m_bufferID)->Search(myDataString, false, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__CURRENT_REPLACE:
|
||||
{
|
||||
etk::String myDataString;
|
||||
SearchData::GetReplace(myDataString);
|
||||
m_bufferManager->Get(m_bufferID)->Replace(myDataString);
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__CURRENT_REPLACE_ALL:
|
||||
break;
|
||||
case EDN_MSG__CURRENT_CLOSE:
|
||||
SendMessage(EDN_MSG__BUFF_ID_CLOSE, m_bufferID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_UNDO:
|
||||
m_bufferManager->Get(m_bufferID)->Undo();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_REDO:
|
||||
m_bufferManager->Get(m_bufferID)->Redo();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_GOTO_LINE:
|
||||
if (dataID<0) {
|
||||
dataID = 0;
|
||||
}
|
||||
m_bufferManager->Get(m_bufferID)->JumpAtLine(dataID);
|
||||
break;
|
||||
case EDN_MSG__REFRESH_DISPLAY:
|
||||
break;
|
||||
case EDN_MSG__CURRENT_SET_CHARSET:
|
||||
m_bufferManager->Get(m_bufferID)->SetCharset((unicode::charset_te)dataID);
|
||||
break;
|
||||
case EDN_MSG__USER_DISPLAY_CHANGE:
|
||||
// Redraw all the display ... Done under ...
|
||||
break;
|
||||
}
|
||||
*/
|
||||
// Force redraw of the widget
|
||||
OnRegenerateDisplay();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void CodeView::OnGetFocus(void)
|
||||
{
|
||||
//SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, m_bufferID);
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferChangeCurrent);
|
||||
EDN_INFO("Focus - In");
|
||||
}
|
||||
|
||||
|
||||
void CodeView::OnLostFocus(void)
|
||||
{
|
||||
EDN_INFO("Focus - out");
|
||||
}
|
||||
|
||||
|
@@ -26,13 +26,44 @@
|
||||
#ifndef __CODE_VIEW_H__
|
||||
#define __CODE_VIEW_H__
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "Singleton.h"
|
||||
#include "CodeView.h"
|
||||
#include "BufferManager.h"
|
||||
#include "Display.h"
|
||||
#include "MsgBroadcast.h"
|
||||
#include <tools_debug.h>
|
||||
#include <CodeView.h>
|
||||
#include <BufferManager.h>
|
||||
#include <Display.h>
|
||||
#include <MsgBroadcast.h>
|
||||
|
||||
#include <etk/Types.h>
|
||||
#include <ewol/Widget.h>
|
||||
|
||||
class CodeView :public ewol::Widget
|
||||
{
|
||||
public:
|
||||
CodeView(void);
|
||||
virtual ~CodeView(void);
|
||||
virtual bool CalculateMinSize(void);
|
||||
private:
|
||||
etk::String m_label;
|
||||
color_ts m_textColorFg; //!< Text color
|
||||
color_ts m_textColorBg; //!< Background color
|
||||
BufferManager * m_bufferManager;
|
||||
ColorizeManager * m_colorManager;
|
||||
int32_t m_bufferID;
|
||||
bool m_buttunOneSelected;
|
||||
public:
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
||||
public:
|
||||
virtual bool OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y);
|
||||
virtual bool OnEventArea(const char * generateEventId, etkFloat_t x, etkFloat_t y);
|
||||
virtual bool OnEventKb(ewol::eventKbType_te typeEvent, char UTF8_data[UTF8_MAX_SIZE]);
|
||||
virtual bool OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveType_te moveTypeEvent);
|
||||
virtual void OnGetFocus(void);
|
||||
virtual void OnLostFocus(void);
|
||||
};
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
class CodeView : public MsgBroadcast
|
||||
{
|
||||
public:
|
||||
@@ -40,6 +71,7 @@ class CodeView : public MsgBroadcast
|
||||
CodeView(void);
|
||||
~CodeView(void);
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
/*
|
||||
GtkWidget *GetMainWidget(void);
|
||||
// sur : GTK+ callback :
|
||||
static gboolean CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data);
|
||||
@@ -50,10 +82,11 @@ class CodeView : public MsgBroadcast
|
||||
static gint CB_mouseButtonEvent(GtkWidget *widget, GdkEventButton *event, gpointer data);
|
||||
static gint CB_mouseMotionEvent( GtkWidget *widget, GdkEventMotion *event, gpointer data);
|
||||
static gint CB_mouseScrollEvent( GtkWidget *widget, GdkEventScroll *event, gpointer data);
|
||||
*/
|
||||
|
||||
private:
|
||||
// main windows widget :
|
||||
GtkWidget * m_widget;
|
||||
//GtkWidget * m_widget;
|
||||
// récupération des proprieter général...
|
||||
BufferManager * m_bufferManager;
|
||||
ColorizeManager * m_colorManager;
|
||||
@@ -62,6 +95,9 @@ class CodeView : public MsgBroadcast
|
||||
int32_t m_bufferID;
|
||||
bool m_buttunOneSelected;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -23,30 +23,165 @@
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "tools_globals.h"
|
||||
#include "MainWindows.h"
|
||||
#include "CodeView.h"
|
||||
#include "ClipBoard.h"
|
||||
#include "BufferView.h"
|
||||
#include "AccelKey.h"
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <MainWindows.h>
|
||||
#include <CodeView.h>
|
||||
#include <ClipBoard.h>
|
||||
#include <BufferView.h>
|
||||
#include <AccelKey.h>
|
||||
|
||||
#include <ewol/widget/Button.h>
|
||||
#include <ewol/widget/CheckBox.h>
|
||||
#include <ewol/widget/SizerHori.h>
|
||||
#include <ewol/widget/SizerVert.h>
|
||||
#include <ewol/widget/Test.h>
|
||||
#include <ewol/widget/Label.h>
|
||||
#include <ewol/widget/Entry.h>
|
||||
#include <ewol/widget/List.h>
|
||||
#include <ewol/widget/PopUp.h>
|
||||
#include <ewol/widget/Spacer.h>
|
||||
#include <ewol/widgetMeta/FileChooser.h>
|
||||
#include <ewol/WidgetManager.h>
|
||||
#include <ewol/WidgetMessageMultiCast.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "MainWindows"
|
||||
|
||||
|
||||
const char * const ednEventOpenFile = "edn-Open-File";
|
||||
const char * const ednEventCloseFile = "edn-Close-File";
|
||||
const char * const ednEventSaveFile = "edn-Save-File";
|
||||
const char * const ednEventSaveAsFile = "edn-SaveAs-File";
|
||||
const char * const ednEventPopUpClose = "edn-PopUp-Close";
|
||||
const char * const ednEventPopUpFileSelected = "edn-PopUp-FileSelected";
|
||||
|
||||
MainWindows::MainWindows(void)
|
||||
{
|
||||
EDN_DEBUG("CREATE WINDOWS ... ");
|
||||
ewol::SizerVert * mySizerVert = NULL;
|
||||
ewol::SizerHori * mySizerHori = NULL;
|
||||
ewol::Button * myButton = NULL;
|
||||
ewol::Label * myLabel = NULL;
|
||||
CodeView * myCodeView = NULL;
|
||||
|
||||
mySizerVert = new ewol::SizerVert();
|
||||
SetSubWidget(mySizerVert);
|
||||
|
||||
mySizerHori = new ewol::SizerHori();
|
||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||
|
||||
myButton = new ewol::Button("Open");
|
||||
mySizerHori->SubWidgetAdd(myButton);
|
||||
if (false == myButton->ExternLinkOnEvent(ewolEventButtonPressed, GetWidgetId(), ednEventOpenFile) ) {
|
||||
EDN_CRITICAL("link with an entry event");
|
||||
}
|
||||
|
||||
myButton = new ewol::Button("Close");
|
||||
mySizerHori->SubWidgetAdd(myButton);
|
||||
if (false == myButton->ExternLinkOnEvent(ewolEventButtonPressed, GetWidgetId(), ednEventCloseFile) ) {
|
||||
EDN_CRITICAL("link with an entry event");
|
||||
}
|
||||
|
||||
myButton = new ewol::Button("Save");
|
||||
mySizerHori->SubWidgetAdd(myButton);
|
||||
if (false == myButton->ExternLinkOnEvent(ewolEventButtonPressed, GetWidgetId(), ednEventSaveFile) ) {
|
||||
EDN_CRITICAL("link with an entry event");
|
||||
}
|
||||
|
||||
myButton = new ewol::Button("Save As ...");
|
||||
mySizerHori->SubWidgetAdd(myButton);
|
||||
if (false == myButton->ExternLinkOnEvent(ewolEventButtonPressed, GetWidgetId(), ednEventSaveAsFile) ) {
|
||||
EDN_CRITICAL("link with an entry event");
|
||||
}
|
||||
|
||||
|
||||
myLabel = new ewol::Label("FileName");
|
||||
myLabel->SetExpendX(true);
|
||||
myLabel->SetFillY(true);
|
||||
mySizerHori->SubWidgetAdd(myLabel);
|
||||
|
||||
mySizerHori = new ewol::SizerHori();
|
||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||
myCodeView = new CodeView();
|
||||
myCodeView->SetExpendX(true);
|
||||
myCodeView->SetExpendY(true);
|
||||
myCodeView->SetFillX(true);
|
||||
myCodeView->SetFillY(true);
|
||||
mySizerHori->SubWidgetAdd(myCodeView);
|
||||
|
||||
}
|
||||
|
||||
|
||||
MainWindows::~MainWindows(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
EDN_INFO("Receive Event from the main windows ... : widgetid=" << widgetID << "\"" << generateEventId << "\" ==> data=\"" << data << "\"" );
|
||||
if (generateEventId == ednEventOpenFile) {
|
||||
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
|
||||
tmpWidget->SetTitle("Open Files ...");
|
||||
tmpWidget->SetValidateLabel("Open");
|
||||
tmpWidget->SetFolder("/");
|
||||
PopUpWidgetPush(tmpWidget);
|
||||
if (false == tmpWidget->ExternLinkOnEvent(ewolEventFileChooserCancel, GetWidgetId(), ednEventPopUpClose) ) {
|
||||
EDN_CRITICAL("link with an entry event");
|
||||
}
|
||||
if (false == tmpWidget->ExternLinkOnEvent(ewolEventFileChooserValidate, GetWidgetId(), ednEventPopUpFileSelected) ) {
|
||||
EDN_CRITICAL("link with an entry event");
|
||||
}
|
||||
} else if (generateEventId == ednEventPopUpClose) {
|
||||
PopUpWidgetPop();
|
||||
} else if (generateEventId == ednEventPopUpFileSelected) {
|
||||
// get widget:
|
||||
ewol::FileChooser * tmpWidget = (ewol::FileChooser*)ewol::widgetManager::Get(widgetID);
|
||||
if (NULL == tmpWidget) {
|
||||
EDN_ERROR("impossible to get pop_upWidget " << widgetID);
|
||||
PopUpWidgetPop();
|
||||
return false;
|
||||
}
|
||||
// get the filename :
|
||||
etk::String tmpData = tmpWidget->GetCompleateFileName();
|
||||
etk::File myfilename = tmpData;
|
||||
BufferManager *myBufferManager = BufferManager::getInstance();
|
||||
if (false == myBufferManager->Exist(myfilename) ) {
|
||||
int32_t openID = myBufferManager->Open(myfilename);
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgCodeViewCurrentChangeBufferId, openID);
|
||||
} else {
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgCodeViewCurrentChangeBufferId, myBufferManager->GetId(myfilename));
|
||||
}
|
||||
EDN_DEBUG("Request opening the file : " << tmpData);
|
||||
PopUpWidgetPop();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef SDFGSDFGSDF___SDFGSDFG
|
||||
MainWindows::MainWindows(void) : MsgBroadcast("Main Windows", EDN_CAT_GUI)
|
||||
{
|
||||
|
||||
m_mainWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||
|
||||
// select the program icone
|
||||
GError *err = NULL;
|
||||
Edn::String iconeFile;
|
||||
#ifdef NDEBUG
|
||||
etk::String iconeFile;
|
||||
iconeFile = "/usr/share/edn/images/icone.png";
|
||||
#else
|
||||
iconeFile = "./data/imagesSources/icone.png";
|
||||
#endif
|
||||
|
||||
GdkPixbuf * icone = gdk_pixbuf_new_from_file(iconeFile.c_str(), &err);
|
||||
if (err != NULL) {
|
||||
@@ -54,17 +189,11 @@ MainWindows::MainWindows(void) : MsgBroadcast("Main Windows", EDN_CAT_GUI)
|
||||
} else {
|
||||
gtk_window_set_icon(GTK_WINDOW(m_mainWindow), icone);
|
||||
}
|
||||
// Default size open windows
|
||||
gtk_window_set_default_size(GTK_WINDOW(m_mainWindow), 800, 600);
|
||||
|
||||
// enable the close signal of the windows
|
||||
g_signal_connect(G_OBJECT(m_mainWindow), "delete-event", G_CALLBACK(OnQuit), this);
|
||||
g_signal_connect(G_OBJECT(m_mainWindow), "window-state-event", G_CALLBACK(OnStateChange), this);
|
||||
//g_signal_connect(G_OBJECT(m_mainWindow), "destroy", G_CALLBACK(OnQuit), this);
|
||||
|
||||
// remove decoration
|
||||
//gtk_window_set_decorated(GTK_WINDOW(m_mainWindow), FALSE);
|
||||
|
||||
|
||||
// Create a vertical box for stacking the menu and editor widgets in.
|
||||
GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_add(GTK_CONTAINER(m_mainWindow), vbox);
|
||||
@@ -73,18 +202,11 @@ MainWindows::MainWindows(void) : MsgBroadcast("Main Windows", EDN_CAT_GUI)
|
||||
AccelKey::getInstance()->LinkCommonAccel(GTK_WINDOW(m_mainWindow));
|
||||
|
||||
// Create the menu bar.
|
||||
#if 0
|
||||
gtk_box_pack_start( GTK_BOX (vbox), m_MenuBar.GetWidget(), FALSE, FALSE, 0);
|
||||
#else
|
||||
GtkWidget *hboxMenu = gtk_hbox_new (FALSE, 0);
|
||||
gtk_box_pack_start( GTK_BOX (vbox), hboxMenu, FALSE, FALSE, 0);
|
||||
// Add Exit boutton
|
||||
Edn::String ExitIconeFile;
|
||||
#ifdef NDEBUG
|
||||
etk::String ExitIconeFile;
|
||||
ExitIconeFile = "/usr/share/edn/images/delete-24px.png";
|
||||
#else
|
||||
ExitIconeFile = "./data/imagesSources/delete-24px.png";
|
||||
#endif
|
||||
// TODO : find a good way to change the size of an image
|
||||
GtkWidget *myImageQuit = gtk_image_new_from_file(ExitIconeFile.c_str());
|
||||
GtkIconSize mySize = GTK_ICON_SIZE_SMALL_TOOLBAR;
|
||||
@@ -100,25 +222,10 @@ MainWindows::MainWindows(void) : MsgBroadcast("Main Windows", EDN_CAT_GUI)
|
||||
|
||||
// add the real menu bar
|
||||
gtk_box_pack_start( GTK_BOX (hboxMenu), m_MenuBar.GetWidget(), FALSE, FALSE, 0);
|
||||
GdkColor color;
|
||||
GtkStateType tmpppppp = GTK_STATE_NORMAL;
|
||||
//GtkStateType tmpppppp = GTK_STATE_ACTIVE;
|
||||
//GtkStateType tmpppppp = GTK_STATE_PRELIGHT;
|
||||
//GtkStateType tmpppppp = GTK_STATE_SELECTED;
|
||||
//GtkStateType tmpppppp = GTK_STATE_INSENSITIVE;
|
||||
//gdk_color_parse ("green", &color);
|
||||
//gtk_widget_modify_fg(m_MenuBar.GetWidget(), tmpppppp, &color);
|
||||
//gdk_color_parse ("blue", &color);
|
||||
//gtk_widget_modify_bg(m_MenuBar.GetWidget(), tmpppppp, &color);
|
||||
gdk_color_parse ("red", &color);
|
||||
gtk_widget_modify_text(m_MenuBar.GetWidget(), tmpppppp, &color);
|
||||
//gdk_color_parse ("orange", &color);
|
||||
gtk_widget_modify_base(m_MenuBar.GetWidget(), tmpppppp, &color);
|
||||
|
||||
// Add title
|
||||
m_internalTitleLabel = gtk_label_new("Edn");
|
||||
gtk_box_pack_start( GTK_BOX (hboxMenu), m_internalTitleLabel, FALSE, FALSE, 0);
|
||||
#endif
|
||||
// **********************************************************
|
||||
// * Horizontal ELEMENTS : *
|
||||
// **********************************************************
|
||||
@@ -126,9 +233,6 @@ MainWindows::MainWindows(void) : MsgBroadcast("Main Windows", EDN_CAT_GUI)
|
||||
GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
|
||||
gtk_container_add(GTK_CONTAINER (vbox), hbox);
|
||||
// create the toolbar :
|
||||
# if USE_GTK_VERSION_2_0
|
||||
//gtk_box_pack_start(GTK_BOX(hbox), m_ToolBar.GetWidget(), FALSE, FALSE, 0);
|
||||
# endif
|
||||
// TreeView :
|
||||
gtk_box_pack_start(GTK_BOX(hbox), m_BufferView.GetMainWidget(), FALSE, TRUE, 1);
|
||||
|
||||
@@ -141,7 +245,6 @@ MainWindows::MainWindows(void) : MsgBroadcast("Main Windows", EDN_CAT_GUI)
|
||||
// recursive version of gtk_widget_show
|
||||
gtk_widget_show_all(m_mainWindow);
|
||||
|
||||
}
|
||||
|
||||
MainWindows::~MainWindows(void)
|
||||
{
|
||||
@@ -154,9 +257,9 @@ MainWindows::~MainWindows(void)
|
||||
|
||||
|
||||
|
||||
void MainWindows::SetTitle(Edn::File &fileName, bool isModify)
|
||||
void MainWindows::SetTitle(etk::File &fileName, bool isModify)
|
||||
{
|
||||
Edn::String tmp = "";
|
||||
etk::String tmp = "";
|
||||
if (fileName.GetShortFilename() != "") {
|
||||
tmp += fileName.GetShortFilename();
|
||||
tmp += " - ";
|
||||
@@ -164,21 +267,25 @@ void MainWindows::SetTitle(Edn::File &fileName, bool isModify)
|
||||
tmp += " - ";
|
||||
}
|
||||
tmp += "Edn";
|
||||
gtk_window_set_title(GTK_WINDOW(m_mainWindow), tmp.c_str());
|
||||
//gtk_window_set_title(GTK_WINDOW(m_mainWindow), tmp.c_str());
|
||||
tmp = " ";
|
||||
if (fileName.GetShortFilename() != "") {
|
||||
tmp = fileName.GetFolder();
|
||||
tmp += fileName.GetFolder();
|
||||
tmp += "/";
|
||||
tmp += fileName.GetShortFilename();
|
||||
} else {
|
||||
tmp = "Edn";
|
||||
tmp += "Edn";
|
||||
}
|
||||
gtk_label_set_text(GTK_LABEL(m_internalTitleLabel), tmp.c_str());
|
||||
tmp += " ";
|
||||
//gtk_label_set_text(GTK_LABEL(m_internalTitleLabel), tmp.c_str());
|
||||
|
||||
}
|
||||
|
||||
void MainWindows::SetNoTitle(void)
|
||||
{
|
||||
Edn::String tmp = "Edn";
|
||||
gtk_window_set_title(GTK_WINDOW(m_mainWindow), tmp.c_str());
|
||||
gtk_label_set_text(GTK_LABEL(m_internalTitleLabel), tmp.c_str());
|
||||
etk::String tmp = "Edn";
|
||||
//gtk_window_set_title(GTK_WINDOW(m_mainWindow), tmp.c_str());
|
||||
//gtk_label_set_text(GTK_LABEL(m_internalTitleLabel), tmp.c_str());
|
||||
}
|
||||
|
||||
void MainWindows::OnMessage(int32_t id, int32_t dataID)
|
||||
@@ -191,16 +298,17 @@ void MainWindows::OnMessage(int32_t id, int32_t dataID)
|
||||
if (-1 == dataID) {
|
||||
SetNoTitle();
|
||||
} else {
|
||||
/*
|
||||
Buffer *mybuf = BufferManager::getInstance()->Get(dataID);
|
||||
if (NULL != mybuf) {
|
||||
Edn::File plop = mybuf->GetFileName();
|
||||
etk::File plop = mybuf->GetFileName();
|
||||
SetTitle(plop, mybuf->IsModify() );
|
||||
}
|
||||
*/
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool MainWindows::OnQuit(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
//MainWindows * self = reinterpret_cast<MainWindows*>(data);
|
||||
@@ -228,7 +336,7 @@ gboolean MainWindows::OnStateChange(GtkWidget *widget, GdkEvent* event, gpointer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@@ -24,39 +24,40 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "Singleton.h"
|
||||
#include "MsgBroadcast.h"
|
||||
#include <tools_debug.h>
|
||||
#include <etk/Singleton.h>
|
||||
#include <MsgBroadcast.h>
|
||||
|
||||
#include "CodeView.h"
|
||||
#include "BufferView.h"
|
||||
#include "BufferManager.h"
|
||||
#include "MenuBar.h"
|
||||
#include "StatusBar.h"
|
||||
#include "ToolBar.h"
|
||||
#include <CodeView.h>
|
||||
#include <BufferView.h>
|
||||
#include <BufferManager.h>
|
||||
#include <MenuBar.h>
|
||||
#include <StatusBar.h>
|
||||
#include <ToolBar.h>
|
||||
|
||||
|
||||
#ifndef __MAIN_WINDOWS_H__
|
||||
#define __MAIN_WINDOWS_H__
|
||||
|
||||
class MainWindows: public Singleton<MainWindows>, public MsgBroadcast
|
||||
#if 0
|
||||
class MainWindows: public etk::Singleton<MainWindows>, public MsgBroadcast
|
||||
{
|
||||
friend class Singleton<MainWindows>;
|
||||
friend class etk::Singleton<MainWindows>;
|
||||
// specific for sigleton system...
|
||||
private:
|
||||
// Constructeur
|
||||
MainWindows(void);
|
||||
~MainWindows(void);
|
||||
public:
|
||||
GtkWidget * GetWidget(void) { return m_mainWindow;};
|
||||
//GtkWidget * GetWidget(void) { return m_mainWindow;};
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
static bool OnQuit(GtkWidget *widget, gpointer data);
|
||||
static gboolean OnStateChange(GtkWidget *widget, GdkEvent* event, gpointer data);
|
||||
//static bool OnQuit(GtkWidget *widget, gpointer data);
|
||||
//static gboolean OnStateChange(GtkWidget *widget, GdkEvent* event, gpointer data);
|
||||
|
||||
private:
|
||||
void SetTitle(Edn::File &fileName, bool isModify);
|
||||
void SetTitle(etk::File &fileName, bool isModify);
|
||||
void SetNoTitle(void);
|
||||
// main windows widget :
|
||||
/*
|
||||
GtkWidget * m_mainWindow;
|
||||
GtkWidget * m_internalTitleLabel;
|
||||
BufferView m_BufferView;
|
||||
@@ -64,8 +65,17 @@ class MainWindows: public Singleton<MainWindows>, public MsgBroadcast
|
||||
MenuBar m_MenuBar;
|
||||
StatusBar m_StatusBar;
|
||||
ToolBar m_ToolBar;
|
||||
*/
|
||||
};
|
||||
#endif
|
||||
class MainWindows : public ewol::Windows
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
MainWindows(void);
|
||||
~MainWindows(void);
|
||||
virtual bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -24,12 +24,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "MenuBar.h"
|
||||
#include "ClipBoard.h"
|
||||
#include "charset.h"
|
||||
#include "ColorizeManager.h"
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <MenuBar.h>
|
||||
#include <ClipBoard.h>
|
||||
#include <etk/unicode.h>
|
||||
#include <ColorizeManager.h>
|
||||
#if 0
|
||||
#define MENU_MSG
|
||||
const char * MSG_TogleDisplayChar = "Request a Togle of char displaying";
|
||||
const char * MSG_TogleDisplayEOL = "Request a Togle of displaying EndOfLine";
|
||||
@@ -79,7 +79,7 @@ static void CB_menuInternal(GtkMenuItem *menu_item, gpointer data)
|
||||
GeneralSendMessage(EDN_MSG__CURRENT_SET_CHARSET, EDN_CHARSET_UTF8);
|
||||
} else if (myPointer == MSG_LoadColorWhite) {
|
||||
ColorizeManager * myColorSystem = ColorizeManager::getInstance();
|
||||
Edn::String homedir;
|
||||
etk::String homedir;
|
||||
# ifdef NDEBUG
|
||||
homedir = "/usr/share/edn/";
|
||||
# else
|
||||
@@ -89,7 +89,7 @@ static void CB_menuInternal(GtkMenuItem *menu_item, gpointer data)
|
||||
myColorSystem->LoadFile(homedir);
|
||||
} else if (myPointer == MSG_LoadColorBlack) {
|
||||
ColorizeManager * myColorSystem = ColorizeManager::getInstance();
|
||||
Edn::String homedir;
|
||||
etk::String homedir;
|
||||
# ifdef NDEBUG
|
||||
homedir = "/usr/share/edn/";
|
||||
# else
|
||||
@@ -217,7 +217,7 @@ class MenuBarMain
|
||||
GtkWidget * m_parent;
|
||||
GtkWidget * m_menu;
|
||||
GtkWidget * m_menuListe;
|
||||
Edn::VectorType<messageData_ts*> m_message;
|
||||
etk::VectorType<messageData_ts*> m_message;
|
||||
};
|
||||
|
||||
#undef __class__
|
||||
@@ -383,4 +383,4 @@ void MenuBar::OnMessage(int32_t id, int32_t dataID)
|
||||
//EDN_INFO("ReceiveMessage");
|
||||
}
|
||||
|
||||
|
||||
#endif
|
@@ -23,30 +23,32 @@
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "tools_globals.h"
|
||||
#include "MsgBroadcast.h"
|
||||
#include "VectorType.h"
|
||||
#include "AccelKey.h"
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <MsgBroadcast.h>
|
||||
#include <etk/VectorType.h>
|
||||
#include <AccelKey.h>
|
||||
|
||||
#ifndef __MENU_BAR_H__
|
||||
#define __MENU_BAR_H__
|
||||
|
||||
class MenuBarMain;
|
||||
//class MenuBarMain;
|
||||
|
||||
class MenuBar: public MsgBroadcast
|
||||
class MenuBar
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
MenuBar(void);
|
||||
~MenuBar(void);
|
||||
GtkWidget * GetWidget(void) { return m_mainWidget; };
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
MenuBar(void) {};
|
||||
~MenuBar(void) {};
|
||||
//GtkWidget * GetWidget(void) { return m_mainWidget; };
|
||||
void OnMessage(int32_t id, int32_t dataID) {};
|
||||
|
||||
private:
|
||||
/*
|
||||
GtkWidget * m_mainWidget;
|
||||
GtkAccelGroup * m_accelGroup;
|
||||
Edn::VectorType<MenuBarMain*> m_listMenu;
|
||||
etk::VectorType<MenuBarMain*> m_listMenu;
|
||||
*/
|
||||
};
|
||||
|
||||
|
@@ -23,13 +23,14 @@
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "StatusBar.h"
|
||||
#include <tools_debug.h>
|
||||
#include <StatusBar.h>
|
||||
|
||||
|
||||
|
||||
StatusBar::StatusBar(void) : MsgBroadcast("Status bar", EDN_CAT_GUI)
|
||||
StatusBar::StatusBar(void)
|
||||
{
|
||||
/*
|
||||
m_mainWidget = gtk_statusbar_new();
|
||||
// pas très bien compris pourquoi mais ca marche...
|
||||
m_iContextId = gtk_statusbar_get_context_id(GTK_STATUSBAR(m_mainWidget), "ExitMsg");
|
||||
@@ -37,6 +38,7 @@ StatusBar::StatusBar(void) : MsgBroadcast("Status bar", EDN_CAT_GUI)
|
||||
gtk_statusbar_push(GTK_STATUSBAR (m_mainWidget), GPOINTER_TO_INT(m_iContextId), "Edn Editeur de n'ours");
|
||||
// Supression du précédent message :
|
||||
//gtk_statusbar_pop(GTK_STATUSBAR(m_mainWidget), GPOINTER_TO_INT(m_iContextId));
|
||||
*/
|
||||
}
|
||||
|
||||
StatusBar::~StatusBar(void)
|
@@ -23,23 +23,23 @@
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "MsgBroadcast.h"
|
||||
#include <MsgBroadcast.h>
|
||||
|
||||
#ifndef __STATUS_BAR_H__
|
||||
#define __STATUS_BAR_H__
|
||||
|
||||
class StatusBar: public MsgBroadcast
|
||||
class StatusBar
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
StatusBar(void);
|
||||
~StatusBar(void);
|
||||
GtkWidget * GetWidget(void) { return m_mainWidget; };
|
||||
//GtkWidget * GetWidget(void) { return m_mainWidget; };
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
|
||||
private:
|
||||
GtkWidget * m_mainWidget;
|
||||
guint m_iContextId;
|
||||
//GtkWidget * m_mainWidget;
|
||||
//guint m_iContextId;
|
||||
};
|
||||
|
||||
|
@@ -23,10 +23,11 @@
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "ToolBar.h"
|
||||
#include "ClipBoard.h"
|
||||
#include <tools_debug.h>
|
||||
#include <ToolBar.h>
|
||||
#include <ClipBoard.h>
|
||||
|
||||
/*
|
||||
static void CB_menuGenerique(GtkMenuItem *menu_item, gpointer data)
|
||||
{
|
||||
//EDN_INFO("basic menue_event");
|
||||
@@ -34,11 +35,11 @@ static void CB_menuGenerique(GtkMenuItem *menu_item, gpointer data)
|
||||
// broacast message :
|
||||
GeneralSendMessage(msg->msgId, msg->dataId);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
ToolBar::ToolBar(void) : MsgBroadcast("Tool bar", EDN_CAT_GUI)
|
||||
ToolBar::ToolBar(void)
|
||||
{
|
||||
/*
|
||||
m_mainWidget = gtk_toolbar_new();
|
||||
# ifdef USE_GTK_VERSION_2_0
|
||||
gtk_toolbar_set_orientation(GTK_TOOLBAR(m_mainWidget), GTK_ORIENTATION_VERTICAL);
|
||||
@@ -55,6 +56,7 @@ ToolBar::ToolBar(void) : MsgBroadcast("Tool bar", EDN_CAT_GUI)
|
||||
Add(GTK_STOCK_SAVE_AS, "Enregistrer sous", EDN_MSG__CURRENT_SAVE_AS);
|
||||
AddSeparator();
|
||||
Add(GTK_STOCK_QUIT, "Quitter");
|
||||
*/
|
||||
}
|
||||
|
||||
ToolBar::~ToolBar(void)
|
||||
@@ -66,7 +68,7 @@ void ToolBar::OnMessage(int32_t id, int32_t dataID)
|
||||
{
|
||||
//EDN_INFO("ReceiveMessage");
|
||||
}
|
||||
|
||||
/*
|
||||
void ToolBar::AddSeparator(void)
|
||||
{
|
||||
# ifdef USE_GTK_VERSION_3_0
|
||||
@@ -87,7 +89,7 @@ void ToolBar::Add(const char * title, const char * labelHelp, messageType_te id,
|
||||
gtk_toolbar_insert_stock(GTK_TOOLBAR(m_mainWidget), title, labelHelp, NULL, G_CALLBACK(CB_menuGenerique), message, -1);
|
||||
# endif
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
@@ -23,26 +23,26 @@
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "MsgBroadcast.h"
|
||||
#include <MsgBroadcast.h>
|
||||
|
||||
#ifndef __TOOL_BAR_H__
|
||||
#define __TOOL_BAR_H__
|
||||
|
||||
|
||||
class ToolBar: public MsgBroadcast
|
||||
class ToolBar
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
ToolBar(void);
|
||||
~ToolBar(void);
|
||||
GtkWidget * GetWidget(void) { return m_mainWidget; };
|
||||
//GtkWidget * GetWidget(void) { return m_mainWidget; };
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
|
||||
private:
|
||||
void AddSeparator(void);
|
||||
void Add(const char * title, const char * labelHelp, messageType_te id = EDN_MSG__NONE, bool enable = false);
|
||||
GtkWidget * m_mainWidget;
|
||||
Edn::VectorType<messageData_ts*> m_message;
|
||||
//void AddSeparator(void);
|
||||
//void Add(const char * title, const char * labelHelp, messageType_te id = EDN_MSG__NONE, bool enable = false);
|
||||
//GtkWidget * m_mainWidget;
|
||||
//etk::VectorType<messageData_ts*> m_message;
|
||||
};
|
||||
|
||||
|
@@ -36,26 +36,28 @@
|
||||
|
||||
|
||||
Search::Search(void)
|
||||
: m_localDialog(NULL),
|
||||
/*: m_localDialog(NULL),
|
||||
m_searchLabel(NULL),
|
||||
m_searchEntry(NULL),
|
||||
m_replaceLabel(NULL),
|
||||
m_replaceEntry(NULL),
|
||||
m_CkMatchCase(NULL),
|
||||
m_CkWrapAround(NULL)
|
||||
m_CkWrapAround(NULL) */
|
||||
{
|
||||
// nothing to do ...
|
||||
}
|
||||
|
||||
Search::~Search(void)
|
||||
{
|
||||
/*
|
||||
if (NULL!=m_localDialog) {
|
||||
gtk_widget_hide(m_localDialog);
|
||||
gtk_widget_destroy(m_localDialog);
|
||||
m_localDialog = NULL;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
void Search::Display(GtkWindow *parent)
|
||||
{
|
||||
if(NULL == m_localDialog) {
|
||||
@@ -193,7 +195,7 @@ void Search::Display(GtkWindow *parent)
|
||||
gtk_widget_set_sensitive(m_CkMatchCase, true);
|
||||
}
|
||||
// Remove data form the search
|
||||
Edn::String myDataString = "";
|
||||
etk::String myDataString = "";
|
||||
SearchData::SetSearch(myDataString);
|
||||
gtk_entry_set_text(GTK_ENTRY(m_searchEntry), myDataString.c_str());
|
||||
if (0 == strlen(myDataString.c_str())) {
|
||||
@@ -228,21 +230,25 @@ void Search::Display(GtkWindow *parent)
|
||||
gtk_widget_hide(m_CkRegularExpression);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
void Search::Destroy(void)
|
||||
{
|
||||
/*
|
||||
if (NULL!=m_localDialog) {
|
||||
gtk_widget_destroy(m_localDialog);
|
||||
m_localDialog = NULL;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
void Search::Hide(void)
|
||||
{
|
||||
gtk_widget_hide(m_localDialog);
|
||||
//gtk_widget_hide(m_localDialog);
|
||||
}
|
||||
|
||||
/*
|
||||
void Search::OnButtonPrevious(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
//EDN_INFO("CALLBACK");
|
||||
@@ -315,7 +321,7 @@ void Search::OnEntrySearchChange(GtkWidget *widget, gpointer data)
|
||||
// update research data
|
||||
const char *testData = gtk_entry_get_text(GTK_ENTRY(widget));
|
||||
if (NULL != testData) {
|
||||
Edn::String myDataString = testData;
|
||||
etk::String myDataString = testData;
|
||||
SearchData::SetSearch(myDataString);
|
||||
if (0 == strlen(testData)) {
|
||||
self->m_haveSearchData = false;
|
||||
@@ -341,7 +347,7 @@ void Search::OnEntryReplaceChange(GtkWidget *widget, gpointer data)
|
||||
// update replace data
|
||||
const char *testData = gtk_entry_get_text(GTK_ENTRY(widget));
|
||||
if (NULL != testData) {
|
||||
Edn::String myDataString = testData;
|
||||
etk::String myDataString = testData;
|
||||
SearchData::SetReplace(myDataString);
|
||||
if (0 == strlen(testData)) {
|
||||
self->m_haveReplaceData = false;
|
||||
@@ -357,3 +363,4 @@ void Search::OnEntryReplaceChange(GtkWidget *widget, gpointer data)
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
@@ -26,13 +26,13 @@
|
||||
#ifndef __SEARCH_H__
|
||||
#define __SEARCH_H__
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "Singleton.h"
|
||||
#include <tools_debug.h>
|
||||
#include <etk/Singleton.h>
|
||||
|
||||
|
||||
class Search: public Singleton<Search>
|
||||
class Search: public etk::Singleton<Search>
|
||||
{
|
||||
friend class Singleton<Search>;
|
||||
friend class etk::Singleton<Search>;
|
||||
// specific for sigleton system...
|
||||
private:
|
||||
// Constructeur
|
||||
@@ -41,9 +41,9 @@ class Search: public Singleton<Search>
|
||||
|
||||
public:
|
||||
void Destroy(void);
|
||||
void Display(GtkWindow *parent);
|
||||
//void Display(GtkWindow *parent);
|
||||
void Hide(void);
|
||||
|
||||
/*
|
||||
private:
|
||||
GtkWidget * m_localDialog; //!< local dialog element
|
||||
// entry
|
||||
@@ -75,7 +75,7 @@ class Search: public Singleton<Search>
|
||||
static void OnCheckBoxEventRegExp(GtkWidget *widget, gpointer user_data);
|
||||
static void OnEntrySearchChange(GtkWidget *widget, gpointer user_data);
|
||||
static void OnEntryReplaceChange(GtkWidget *widget, gpointer user_data);
|
||||
|
||||
*/
|
||||
};
|
||||
|
||||
|
@@ -23,22 +23,21 @@
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "tools_globals.h"
|
||||
#include "SearchData.h"
|
||||
#include "Edn.h"
|
||||
#include <tools_globals.h>
|
||||
#include <SearchData.h>
|
||||
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "SearchData"
|
||||
|
||||
|
||||
static Edn::String m_findRequest = "";
|
||||
static etk::String m_findRequest = "";
|
||||
|
||||
void SearchData::SetSearch(Edn::String &myData)
|
||||
void SearchData::SetSearch(etk::String &myData)
|
||||
{
|
||||
m_findRequest = myData;
|
||||
}
|
||||
void SearchData::GetSearch(Edn::String &myData)
|
||||
void SearchData::GetSearch(etk::String &myData)
|
||||
{
|
||||
myData = m_findRequest;
|
||||
}
|
||||
@@ -50,12 +49,12 @@ bool SearchData::IsSearchEmpty(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
static Edn::String m_replaceRequest = "";
|
||||
void SearchData::SetReplace(Edn::String &myData)
|
||||
static etk::String m_replaceRequest = "";
|
||||
void SearchData::SetReplace(etk::String &myData)
|
||||
{
|
||||
m_replaceRequest = myData;
|
||||
}
|
||||
void SearchData::GetReplace(Edn::String &myData)
|
||||
void SearchData::GetReplace(etk::String &myData)
|
||||
{
|
||||
myData = m_replaceRequest;
|
||||
}
|
@@ -26,16 +26,15 @@
|
||||
#ifndef __SEARCH_DATA_H__
|
||||
#define __SEARCH_DATA_H__
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "Edn.h"
|
||||
#include <tools_debug.h>
|
||||
|
||||
namespace SearchData
|
||||
{
|
||||
void SetSearch(Edn::String &myData);
|
||||
void GetSearch(Edn::String &myData);
|
||||
void SetSearch(etk::String &myData);
|
||||
void GetSearch(etk::String &myData);
|
||||
bool IsSearchEmpty(void);
|
||||
void SetReplace(Edn::String &myData);
|
||||
void GetReplace(Edn::String &myData);
|
||||
void SetReplace(etk::String &myData);
|
||||
void GetReplace(etk::String &myData);
|
||||
bool IsReplaceEmpty(void);
|
||||
void SetCase(bool value);
|
||||
bool GetCase(void);
|
@@ -24,12 +24,11 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "tools_debug.h"
|
||||
#include "tools_globals.h"
|
||||
#include "WindowsManager.h"
|
||||
#include "MainWindows.h"
|
||||
#include "Edn.h"
|
||||
#include "Search.h"
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <WindowsManager.h>
|
||||
#include <MainWindows.h>
|
||||
#include <Search.h>
|
||||
|
||||
|
||||
#undef __class__
|
||||
@@ -43,7 +42,7 @@
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
WindowsManager::WindowsManager(void) : MsgBroadcast("Windows Manager", EDN_CAT_GUI_MANAGER)
|
||||
WindowsManager::WindowsManager(void)
|
||||
{
|
||||
m_currentBufferID = -1;
|
||||
}
|
||||
@@ -65,6 +64,7 @@ void WindowsManager::OnMessage(int32_t id, int32_t dataID)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
/*
|
||||
case EDN_MSG__BUFFER_CHANGE_CURRENT:
|
||||
m_currentBufferID = dataID;
|
||||
break;
|
||||
@@ -101,13 +101,13 @@ void WindowsManager::OnMessage(int32_t id, int32_t dataID)
|
||||
if( -1 != m_currentBufferID
|
||||
&& true == myBufferManager->Exist(m_currentBufferID) )
|
||||
{
|
||||
Edn::File fileName = myBufferManager->Get(m_currentBufferID)->GetFileName();
|
||||
etk::File fileName = myBufferManager->Get(m_currentBufferID)->GetFileName();
|
||||
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), fileName.GetFolder().c_str());
|
||||
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), fileName.GetShortFilename().c_str());
|
||||
}
|
||||
if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
|
||||
{
|
||||
Edn::File myfilename;
|
||||
etk::File myfilename;
|
||||
myfilename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (dialog));
|
||||
|
||||
if (false == myBufferManager->Exist(myfilename) ) {
|
||||
@@ -131,7 +131,7 @@ void WindowsManager::OnMessage(int32_t id, int32_t dataID)
|
||||
idSelected = dataID;
|
||||
}
|
||||
Buffer *myBuffer = BufferManager::getInstance()->Get(idSelected);
|
||||
Edn::String tmpString = "Save as file : ";
|
||||
etk::String tmpString = "Save as file : ";
|
||||
tmpString += myBuffer->GetFileName().GetShortFilename().c_str();
|
||||
GtkWidget *dialog = gtk_file_chooser_dialog_new( tmpString.c_str(), NULL,
|
||||
GTK_FILE_CHOOSER_ACTION_SAVE,
|
||||
@@ -142,7 +142,7 @@ void WindowsManager::OnMessage(int32_t id, int32_t dataID)
|
||||
gtk_window_set_skip_pager_hint(GTK_WINDOW(dialog), TRUE);
|
||||
if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
|
||||
{
|
||||
Edn::String myfilename;
|
||||
etk::String myfilename;
|
||||
myfilename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (dialog));
|
||||
|
||||
myBuffer->SetFileName(myfilename);
|
||||
@@ -311,10 +311,10 @@ void WindowsManager::OnMessage(int32_t id, int32_t dataID)
|
||||
gtk_widget_destroy (p_dialog);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
*/
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
@@ -26,13 +26,13 @@
|
||||
#ifndef __WINDOWS_MANAGER_H__
|
||||
#define __WINDOWS_MANAGER_H__
|
||||
|
||||
#include "Singleton.h"
|
||||
#include "MsgBroadcast.h"
|
||||
#include "MainWindows.h"
|
||||
#include <etk/Singleton.h>
|
||||
#include <MsgBroadcast.h>
|
||||
#include <MainWindows.h>
|
||||
|
||||
class WindowsManager: public Singleton<WindowsManager>, public MsgBroadcast
|
||||
class WindowsManager: public etk::Singleton<WindowsManager>
|
||||
{
|
||||
friend class Singleton<WindowsManager>;
|
||||
friend class etk::Singleton<WindowsManager>;
|
||||
// specific for sigleton system...
|
||||
private:
|
||||
// Constructeur
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user