17 Commits
0.3.0 ... 0.3.2

Author SHA1 Message Date
610afddc9d Update the message list and open/Save(as) files 2012-02-09 17:20:52 +01:00
4038dd74af Add basic close and save event generation 2012-02-08 18:05:19 +01:00
8ba3e2e3d4 Change the redraw methode of the code viewer ==> reparse every time needed the line in the buffer for the second pass of highlight 2012-02-07 18:04:15 +01:00
7734a8ce36 start Abstraction of the scrooling windows 2012-02-06 17:59:48 +01:00
d088866891 change the system to open file message 2012-02-05 22:03:36 +01:00
0341795cbb Add the display of the buffer list and change some generic event of the edn system.
Add the text display with a different font ==> must rework all the event X/Y position of the mouse
2012-02-03 18:14:45 +01:00
9e0720b476 Add the cmdline argument in the init 2012-02-02 18:19:31 +01:00
8bce8893e8 Change the basic font 2012-02-01 18:24:23 +01:00
d2cb4a47b7 Change message system and threaded the system 2012-01-31 18:26:04 +01:00
65b288813e corrction of the missing log in android and remove the pb with the rotation remove context of open GL 2012-01-27 02:04:02 +01:00
7bad5d42f2 Start to add the thread between the interface and the system 2012-01-26 18:13:43 +01:00
fda95289bd try error 2012-01-25 23:32:14 +01:00
102e11b74a First port of edn on the android platform ==> can do nothing but not crach every 10 second 2012-01-25 18:30:33 +01:00
ee80871434 Add the display of the space and tabulation 2012-01-24 23:50:23 +01:00
43c3092fe3 update the methode of calculation of the mouse event 2012-01-24 23:35:17 +01:00
d05d82ba7b Display is now ready to manage the Unicode and the multiple size font 2012-01-24 17:54:16 +01:00
6052df85dc bad day 2012-01-23 12:41:40 +01:00
76 changed files with 1444 additions and 3438 deletions

5
.gitignore vendored
View File

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

21
AndroidManifest.xml Normal file
View 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
View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

View File

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

85
build.xml Normal file
View File

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

View File

@@ -2,19 +2,25 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := ednpackage
LOCAL_STATIC_LIBRARIES := ewol
LOCAL_C_INCLUDES := $(LOCAL_PATH)
# load the common sources file of the platform
include $(LOCAL_PATH)/file.mk
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)/../../

View File

@@ -6,11 +6,13 @@ include $(CLEAR_VARS)
include $(LOCAL_PATH)/file.mk
LOCAL_MODULE := ednn
LOCAL_STATIC_LIBRARIES := ewol etk tinyxml libzip libpng
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 \

View File

@@ -27,6 +27,7 @@
#include <tools_globals.h>
#include <Buffer.h>
#include <BufferManager.h>
#include <ewol/WidgetMessageMultiCast.h>
#undef __class__
#define __class__ "Buffer"
@@ -93,7 +94,8 @@ void Buffer::SetModify(bool status)
{
if (status != m_fileModify) {
m_fileModify = status;
GeneralSendMessage(EDN_MSG__BUFFER_CHANGE_MODIFY);
// TODO : Remove from here
ewol::widgetMessageMultiCast::Send(-1, ednMsgBufferState, "Modify");
}
}
@@ -146,7 +148,11 @@ void Buffer::SetLineDisplay(uint32_t lineNumber)
* @return ---
*
*/
int32_t Buffer::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY)
int32_t Buffer::Display(ewol::OObject2DTextColored* OOTextNormal,
ewol::OObject2DTextColored* OOTextBold,
ewol::OObject2DTextColored* OOTextItalic,
ewol::OObject2DTextColored* OOTextBoldItalic, ewol::OObject2DColored* OOColored,
int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
{
return ERR_NONE;
}

View File

@@ -29,7 +29,7 @@
#include <etk/String.h>
#include <etk/File.h>
#include <Display.h>
#include <charset.h>
#include <etk/unicode.h>
#include <ewol/ewol.h>
@@ -82,7 +82,11 @@ class Buffer {
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate);
virtual void SetLineDisplay(uint32_t lineNumber);
virtual int32_t Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY);
virtual int32_t Display(ewol::OObject2DTextColored* OOTextNormal,
ewol::OObject2DTextColored* OOTextBold,
ewol::OObject2DTextColored* OOTextItalic,
ewol::OObject2DTextColored* OOTextBoldItalic,
ewol::OObject2DColored* OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY);
virtual void ForceReDraw(bool allElement);
virtual void AddChar(char * UTF8data);
virtual void cursorMove(ewol::eventKbMoveType_te moveTypeEvent);
@@ -97,7 +101,7 @@ 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);
@@ -109,6 +113,8 @@ class Buffer {
virtual void JumpAtLine(int32_t newLine);
virtual int32_t GetCurrentLine(void);
virtual int32_t GetNumberOfLine(void) { return 1; };
protected:
bool m_fileModify; //!<
// naming

View File

@@ -67,7 +67,11 @@ BufferEmpty::~BufferEmpty(void)
* @return ---
*
*/
int32_t BufferEmpty::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY)
int32_t BufferEmpty::Display(ewol::OObject2DTextColored* OOTextNormal,
ewol::OObject2DTextColored* OOTextBold,
ewol::OObject2DTextColored* OOTextItalic,
ewol::OObject2DTextColored* OOTextBoldItalic,
ewol::OObject2DColored* OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
{
ColorizeManager * myColorManager = ColorizeManager::getInstance();
// Get color :
@@ -75,7 +79,7 @@ int32_t BufferEmpty::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2D
//drawer.Flush();
if (NULL == OOText) {
if (NULL == OOTextNormal) {
EDN_ERROR("Input VALUE is NULL");
return ERR_FAIL;
}
@@ -83,14 +87,16 @@ int32_t BufferEmpty::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2D
EDN_ERROR("Input VALUE is NULL");
return ERR_FAIL;
}
int32_t fontId = OOTextNormal->GetFontID();
int32_t letterHeight = ewol::GetHeight(fontId);
myColor = myColorManager->Get("normal");
OOText->SetColor(myColor->GetFG());
OOText->TextAdd(20, 20, "edn - Editeur De N'ours, l'Editeur Desoxyribo-Nucleique", sizeX);
OOTextNormal->SetColor(myColor->GetFG());
OOTextNormal->TextAdd(20, 20, "edn - Editeur De N'ours, l'Editeur Desoxyribo-Nucleique", sizeX);
myColor = myColorManager->Get("commentDoxygen");
OOText->SetColor(myColor->GetFG());
OOText->TextAdd(20, 50, "No Buffer Availlable to display", sizeX);
OOTextNormal->SetColor(myColor->GetFG());
OOTextNormal->TextAdd(20, (int32_t)(20 + letterHeight*1.30), "No Buffer Availlable to display", sizeX);
color_ts bgColor; //!< Text color

View File

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

View File

@@ -27,6 +27,7 @@
#include <tools_debug.h>
#include <tools_globals.h>
#include <BufferManager.h>
#include <ewol/WidgetMessageMultiCast.h>
#undef __class__
#define __class__ "BufferManager"
@@ -40,11 +41,23 @@
* @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(), ednMsgGuiNew);
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgOpenFile);
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiClose);
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiSave);
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewSelectedId);
/*
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);
*/
}
/**
@@ -68,21 +81,85 @@ BufferManager::~BufferManager(void)
}
void BufferManager::OnMessage(int32_t id, int32_t dataID)
bool BufferManager::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y)
{
switch (id)
{
case EDN_MSG__BUFFER_CHANGE_CURRENT:
m_idSelected = dataID;
break;
case EDN_MSG__NEW:
{
if (generateEventId == ednMsgGuiNew) {
int32_t newOne = Create();
if (-1 != newOne) {
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, newOne);
m_idSelected = newOne;
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_idSelected);
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferListChange);
}
} else if (generateEventId == ednMsgOpenFile) {
if (NULL != data) {
etk::File myFile(data, etk::FILE_TYPE_DIRECT);
int32_t newOne = Open(myFile);
if (-1 != newOne) {
m_idSelected = newOne;
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_idSelected);
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferListChange);
}
}
break;
} else if (generateEventId == ednMsgGuiSave) {
if (NULL == data) {
EDN_ERROR("Null data for close file ... ");
} else {
if (0 == strcmp(data , "current")) {
// Check buffer existence
if(true == Exist(m_idSelected)) {
// If no name ==> request a Gui display ...
if (Get(m_idSelected)->HaveName() == false) {
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgGuiSaveAs, "current");
} else {
Get(m_idSelected)->Save();
}
}
} else {
int32_t newId;
sscanf(data, "%d", &newId);
if (false == Exist(newId)) {
EDN_ERROR("Request a save As with a non existant ID=" << newId);
} else {
// If no name ==> request a Gui display ...
if (Get(newId)->HaveName() == false) {
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgGuiSaveAs, newId);
} else {
Get(m_idSelected)->Save();
}
}
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferState, "saved");
}
}
} else if (generateEventId == ednMsgGuiClose) {
if (NULL == data) {
EDN_ERROR("Null data for close file ... ");
} else {
if (0 == strcmp(data , "current")) {
} else if (0 == strcmp(data , "All")) {
}
}
} else if (generateEventId == ednMsgCodeViewSelectedId) {
//Change the selected buffer
if (NULL == data) {
EDN_ERROR("Null data for changing buffer ID file ... ");
} else {
int32_t newId;
sscanf(data, "%d", &newId);
if (true == Exist(newId)) {
m_idSelected = newId;
} else {
EDN_ERROR("code biew request the selection of an non -existant buffer ==> reset to -1");
m_idSelected = -1;
}
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_idSelected);
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferListChange);
}
}
/*
switch (id)
{
case EDN_MSG__BUFF_ID_CLOSE:
// Check buffer existence
if(true == Exist(dataID)) {
@@ -127,6 +204,8 @@ void BufferManager::OnMessage(int32_t id, int32_t dataID)
}
break;
}
*/
return false;
}
@@ -149,7 +228,7 @@ void BufferManager::RemoveAll(void)
for (i=0; i<listBuffer.Size(); i++) {
Remove(i);
}
SendMessage(EDN_MSG__BUFFER_REMOVE_ALL);
ewol::widgetMessageMultiCast::Send(-1, ednMsgGuiClose, "All");
}
@@ -169,7 +248,6 @@ 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);
return basicID;
}
@@ -191,9 +269,7 @@ int32_t BufferManager::Open(etk::File &myFile)
Buffer *myBuffer = new BufferText(myFile);
// Add at the list of element
listBuffer.PushBack(myBuffer);
int32_t basicID = listBuffer.Size() - 1;
SendMessage(EDN_MSG__BUFFER_ADD, basicID);
return basicID;
return listBuffer.Size() - 1;
}
@@ -293,7 +369,7 @@ bool BufferManager::Remove(int32_t BufferID)
// Delete the Buffer
delete( listBuffer[BufferID] );
listBuffer[BufferID] = NULL;
SendMessage(EDN_MSG__BUFFER_REMOVE, BufferID);
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferListChange);
return true;
} else {
EDN_INFO("non existing Buffer " << BufferID);

View File

@@ -31,8 +31,9 @@
#include <BufferEmpty.h>
#include <etk/Singleton.h>
#include <MsgBroadcast.h>
#include <ewol/Widget.h>
class BufferManager: public etk::Singleton<BufferManager>, public MsgBroadcast
class BufferManager: public etk::Singleton<BufferManager>, public ewol::Widget
{
friend class etk::Singleton<BufferManager>;
// specific for sigleton system...
@@ -42,15 +43,17 @@ class BufferManager: public etk::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);
private:
// return the ID of the buffer allocated
// create a buffer with no element
int32_t Create(void);
// open curent filename
int32_t Open(etk::File &myFile);
bool Remove(int32_t BufferID);
public:
int32_t GetSelected(void) { return m_idSelected;};
void SetSelected(int32_t id) {m_idSelected = id;};
//void SetSelected(int32_t id) {m_idSelected = id;};
Buffer * Get(int32_t BufferID);
bool Exist(int32_t BufferID);
bool Exist(etk::File &myFile);
@@ -59,7 +62,6 @@ class BufferManager: public etk::Singleton<BufferManager>, public MsgBroadcast
uint32_t Size(void);
int32_t WitchBuffer(int32_t iEmeElement);
bool Remove(int32_t BufferID);
private:

View File

@@ -34,6 +34,7 @@
#include <ewol/OObject.h>
#include <ewol/WidgetManager.h>
#include <ewol/Widget.h>
#include <ewol/Font.h>
#undef __class__
@@ -73,13 +74,11 @@ 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;
}
@@ -238,11 +237,14 @@ void BufferText::SetLineDisplay(uint32_t lineNumber)
}
#define SEPARATION_SIZE_LINE_NUMBER (3)
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, sizeX+0.5*SEPARATION_SIZE_LINE_NUMBER, sizeY);
OOText->SetColor(myColorManager->Get(COLOR_CODE_LINE_NUMBER));
OOText->TextAdd(1, positionY, tmpLineNumber, -1);
}
@@ -290,6 +292,17 @@ void BufferText::UpdatePointerNumber(void)
}
}
*/
int32_t BufferText::GetNumberOfLine(void)
{
return m_EdnBuf.CountLines();
}
// TODO : Remove this ... it is really bad...
static int32_t g_basicfontId = 0;
/**
* @brief Display the curent buffer with all the probematic imposed by the xharset and the user contraint.
*
@@ -298,21 +311,38 @@ void BufferText::UpdatePointerNumber(void)
* @return
*
*/
int32_t BufferText::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY)
int32_t BufferText::Display(ewol::OObject2DTextColored* OOTextNormal,
ewol::OObject2DTextColored* OOTextBold,
ewol::OObject2DTextColored* OOTextItalic,
ewol::OObject2DTextColored* OOTextBoldItalic,
ewol::OObject2DColored* OOColored,
int32_t offsetX, int32_t offsetY,
int32_t sizeX, int32_t sizeY)
{
offsetX -= 40;
if (offsetX<0) {
offsetX = 0;
}
int32_t selStart, selEnd, selRectStart, selRectEnd;
bool selIsRect;
int32_t selHave;
int32_t fontId = ewol::GetDefaultFontId();
int32_t fontId = OOTextNormal->GetFontID();
// TODO : Remove this ...
g_basicfontId = fontId;
int32_t letterWidth = ewol::GetWidth(fontId, "A");
int32_t spaceWidth = ewol::GetWidth(fontId, " ");
int32_t letterHeight = ewol::GetHeight(fontId);
m_displayStartLineId = offsetY / letterHeight;
// update the display position with the scroll ofset :
m_displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, m_displayStartLineId);
// 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");
EDN_VERBOSE("main DIPLAY " << m_displaySize.x << " char * " << m_displaySize.y << " char");
selHave = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, selStart, selEnd, selIsRect, selRectStart, selRectEnd);
@@ -341,178 +371,129 @@ int32_t BufferText::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DC
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);
ewol::OObject2DTextColored* OOTextSelected = NULL;
int mylen = m_EdnBuf.Size();
int32_t x_base=nbColoneForLineNumber*letterWidth + 3;
uint32_t xx = 0;
int32_t x_base=nbColoneForLineNumber*letterWidth;
int32_t idX = 0;
color_ts bgColor; //!< Text color
color_ts & tmpppppp = myColorManager->Get(COLOR_CODE_BASIC_BG);
OOColored->SetColor(tmpppppp);
OOColored->SetColor(myColorManager->Get(COLOR_CODE_BASIC_BG));
OOColored->Rectangle( 0, 0, sizeX, sizeY);
int displayLines = 0;
// Regenerate the colorizing if necessary ...
displayHLData_ts m_displayLocalSyntax;
m_EdnBuf.HightlightGenerateLines(m_displayLocalSyntax, m_displayStartBufferPos, m_displaySize.y);
//GTimeVal timeStart;
//g_get_current_time(&timeStart);
#if 0
// TODO : change diplay methode :
// Extract the entire line on the buffer with all char expended and the data in Unicode
// Second parsing of the line ==> to have the syntax highligt
// Draw all needed char in the
int32_t currentLineID = m_displayStart.y+1;
EDN_DEBUG("Start display of text buffer [" << m_displayStartBufferPos<< ".." << mylen << "]");
bool ended = false;
while (true == ended) {
currentLineID++;
ended = true;
}
#else
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;
EDN_DEBUG("Start display of text buffer [" << m_displayStartBufferPos<< ".." << mylen << "]");
EDN_DEBUG("cursor Pos : " << m_cursorPos << "start at pos=" << m_displayStartBufferPos);
int32_t currentLineID = m_displayStartLineId+1;
EDN_VERBOSE("Start display of text buffer [" << m_displayStartBufferPos<< ".." << mylen << "]");
EDN_VERBOSE("cursor Pos : " << m_cursorPos << "start at pos=" << m_displayStartBufferPos);
DrawLineNumber(OOTextNormal, OOColored, x_base, sizeY, myPrint, currentLineID, y);
int32_t pixelX = x_base + SEPARATION_SIZE_LINE_NUMBER;
clipping_ts drawClipping;
drawClipping.x = 0;
drawClipping.y = 0;
drawClipping.w = sizeX;
drawClipping.h = sizeY;
clipping_ts drawClippingTextArea;
drawClippingTextArea.x = pixelX;
drawClippingTextArea.y = 0;
drawClippingTextArea.w = sizeX - drawClipping.x;
drawClippingTextArea.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_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();
}
}
// 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() )
{
selectColor = myColorSel;
if( true == selHave
&& selStart <= iii
&& selEnd > iii)
{
OOColored->SetColor(myColorSel->GetBG());
} else if (true == selectColor->HaveBg()) {
OOColored->SetColor(selectColor->GetBG());
} else {
OOColored->SetColor(myColorSpace);
}
OOColored->Rectangle( pixelX, y, spaceWidth, letterHeight);
pixelX += spaceWidth;
haveBg = true;
} else if( '\t' == currentChar
&& true == globals::IsSetDisplaySpaceChar() )
{
if( true == selHave
&& selStart <= iii
&& selEnd > iii)
{
OOColored->SetColor(myColorSel->GetBG());
} else if (true == selectColor->HaveBg()) {
OOColored->SetColor(selectColor->GetBG());
} else {
OOColored->SetColor(myColorTab);
}
OOColored->Rectangle( pixelX, y, spaceWidth*strlen(tmpDisplayOfset), letterHeight);
pixelX += spaceWidth*strlen(tmpDisplayOfset);
haveBg = true;
} else {
if( true == selHave
&& selStart <= iii
&& selEnd > iii)
{
selectColor = myColorSel;
}
OOColored->SetColor(selectColor->GetBG());
OOText->SetColor(selectColor->GetFG());
if (currentChar <= 0x7F) {
int32_t drawSize = OOText->TextAdd(pixelX, y, tmpDisplayOfset, -1);
if (true == selectColor->HaveBg() ) {
OOColored->Rectangle( pixelX, y, drawSize*strlen(tmpDisplayOfset), letterHeight);
haveBg = selectColor->HaveBg();
}
pixelX += drawSize;
}
coord2D_ts textPos;
textPos.x = pixelX-offsetX;
textPos.y = y;
if (true == selectColor->GetItalic() ) {
if (true == selectColor->GetBold() ) {
OOTextSelected = OOTextBoldItalic;
} else {
int32_t drawSize = OOText->TextAdd(pixelX, y, displayChar, -1);
if (true == selectColor->HaveBg() ) {
OOColored->Rectangle( pixelX, y, drawSize*strlen(tmpDisplayOfset), letterHeight);
OOTextSelected = OOTextItalic;
}
pixelX += drawSize;
} else {
if (true == selectColor->GetBold() ) {
OOTextSelected = OOTextBold;
} else {
OOTextSelected = OOTextNormal;
}
}
xx+=widthToDisplay;
OOTextSelected->SetColor(selectColor->GetFG());
drawSize = OOTextSelected->TextAdd(textPos, drawClippingTextArea, displayChar);
if (true == haveBg ) {
OOColored->Rectangle(textPos.x, y, drawSize, letterHeight, drawClippingTextArea);
}
}
idX += displaywidth;
}
// display cursor :
//EDN_DEBUG(" is equal : " << m_cursorPos << "=" << iii);
if (m_cursorPos == iii) {
// display the cursor:
CursorDisplay(OOColored, pixelX, y, letterHeight, letterWidth);
/*if (true == m_cursorOn) {
//Cursor(OOColored, pixelX, y+letterHeight, letterHeight, letterWidth);
//m_cursorOn = false;
} else {
m_cursorOn = true;
}*/
}
pixelX += drawSize;
// move to next line ...
if (currentChar=='\n') {
//drawer.EndOfLine(pixelX, y+letterHeight);
//drawer.Flush();
xx = 0;
idX =0;
pixelX = x_base;
pixelX = x_base + SEPARATION_SIZE_LINE_NUMBER;
y += letterHeight;
displayLines++;
currentLineID++;
DrawLineNumber(OOText, OOColored, sizeX, sizeY, myPrint, currentLineID, y);
DrawLineNumber(OOTextNormal, OOColored, x_base, sizeY, myPrint, currentLineID, y);
}
}
// special case : the cursor is at the end of the buffer...
if (m_cursorPos == iii) {
CursorDisplay(OOColored, pixelX, y, letterHeight, letterWidth);
// display the cursor:
if (true == m_cursorOn) {
//Cursor(OOColored, xx*letterWidth + x_base, yy+letterHeight, letterHeight, letterWidth);
m_cursorOn = false;
} else {
m_cursorOn = true;
}
}
#endif
//GTimeVal timeStop;
//g_get_current_time(&timeStop);
@@ -523,17 +504,70 @@ int32_t BufferText::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DC
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)
{
int32_t letterWidth = ewol::GetWidth(g_basicfontId, "9");
int32_t letterHeight = ewol::GetHeight(g_basicfontId);
x = (width - 3) / Display::GetFontWidth() - nbColoneForLineNumber;
y = height / Display::GetFontHeight();
if (x < 0) {
x = 0;
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 + SEPARATION_SIZE_LINE_NUMBER;
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_VERBOSE("Get id element : x=" << width << "px y=" << height << "px");
EDN_VERBOSE(" line offset = " << lineOffset);
for (iii=startLinePosition; iii<mylen; iii = new_i) {
int displaywidth;
uint32_t currentChar = '\0';
new_i = iii;
displaywidth = m_EdnBuf.GetExpandedChar(new_i, idX, displayChar, currentChar);
if (currentChar!='\n') {
int32_t drawSize = ewol::GetWidth(g_basicfontId, displayChar);
EDN_VERBOSE(" Element : " << currentChar << "=\"" << (char)currentChar << "\" display offset=" << pixelX << "px width=" << drawSize << "px");
pixelX += drawSize;
if (width <= pixelX) {
EDN_VERBOSE(" Find IT ==> END");
// find position ...
break;
}
} else {
EDN_VERBOSE(" Element : \"\\n\" display width=---px ==> end of line ==> END");
// end of line ... exit cycle
break;
}
idX += displaywidth;
}
EDN_VERBOSE("BufferText::GetMousePosition(" << width << "," << height << "); ==> " << iii );
return iii;
}
@@ -551,20 +585,15 @@ void BufferText::MouseEvent(int32_t width, int32_t height)
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);
@@ -585,28 +614,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);
@@ -717,23 +739,22 @@ void BufferText::ScrollUp(void)
*/
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);
}
}
@@ -752,7 +773,6 @@ void BufferText::MoveUpDown(int32_t ofset)
void BufferText::ForceReDraw(bool allElement)
{
NeedToCleanEndPage = true;
//m_displayLocalSyntax.idSequence = -1;
}
void BufferText::SetInsertPosition(int32_t newPos, bool insertChar)
@@ -777,8 +797,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) {
@@ -953,39 +971,41 @@ void BufferText::cursorMove(ewol::eventKbMoveType_te moveTypeEvent)
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;
@@ -994,14 +1014,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(" -------------------------------------------------");
}
}
@@ -1393,7 +1413,7 @@ void BufferText::Redo(void)
}
void BufferText::SetCharset(charset_te newCharset)
void BufferText::SetCharset(unicode::charset_te newCharset)
{
m_EdnBuf.SetCharsetType(newCharset);
ForceReDraw(true);

View File

@@ -46,7 +46,13 @@ class BufferText : public Buffer {
void GetInfo(infoStatBuffer_ts &infoToUpdate);
void SetLineDisplay(uint32_t lineNumber);
int32_t Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY);
int32_t Display(ewol::OObject2DTextColored* OOTextNormal,
ewol::OObject2DTextColored* OOTextBold,
ewol::OObject2DTextColored* OOTextItalic,
ewol::OObject2DTextColored* OOTextBoldItalic,
ewol::OObject2DColored* OOColored,
int32_t offsetX, int32_t offsetY,
int32_t sizeX, int32_t sizeY);
void ForceReDraw(bool allElement);
void AddChar(char * UTF8data);
void cursorMove(ewol::eventKbMoveType_te moveTypeEvent);
@@ -72,7 +78,8 @@ class BufferText : public Buffer {
void SelectNone(void);
void Undo(void);
void Redo(void);
void SetCharset(charset_te newCharset);
void SetCharset(unicode::charset_te newCharset);
int32_t GetNumberOfLine(void);
protected:
void NameChange(void);
@@ -85,21 +92,18 @@ 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)
// internal function
void BasicInit(void);
void UpdateWindowsPosition(bool centerPage = false);
void displayLineNumber(DrawerManager &drawer);
void CleanSelectLine(void);
@@ -112,7 +116,7 @@ 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(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY,char *myPrint, int32_t lineNumber, int32_t positionY);

View File

@@ -26,12 +26,14 @@
#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(), ednMsgGuiChangeColor);
}
ColorizeManager::~ColorizeManager(void)
@@ -51,8 +53,9 @@ 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:
@@ -64,6 +67,8 @@ void ColorizeManager::OnMessage(int32_t id, int32_t dataID)
}
break;
}
*/
return false;
}
@@ -95,7 +100,34 @@ 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+5];
if (NULL == fileBuffer) {
EWOL_ERROR("Error Memory allocation size=" << fileSize);
return;
}
memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
// load data from the file :
fileName.fRead(fileBuffer, 1, fileSize);
// close the file:
fileName.fClose();
// load the XML from the memory
XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8);
TiXmlElement* root = XmlDocument.FirstChildElement( "EdnColor" );
if (NULL == root ) {
EDN_ERROR(PFX"(l ?) main node not find: \"EdnColor\" in \"" << xmlFilename << "\"");
@@ -234,8 +266,11 @@ 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)

View File

@@ -29,6 +29,7 @@
#include <etk/Singleton.h>
#include <Colorize.h>
#include <MsgBroadcast.h>
#include <ewol/Widget.h>
typedef enum {
// BASIC color for codeViewer
@@ -49,7 +50,7 @@ typedef enum {
class ColorizeManager: public etk::Singleton<ColorizeManager>, public MsgBroadcast
class ColorizeManager: public etk::Singleton<ColorizeManager>, public ewol::Widget
{
friend class etk::Singleton<ColorizeManager>;
// specific for sigleton system...
@@ -58,7 +59,7 @@ class ColorizeManager: public etk::Singleton<ColorizeManager>, public MsgBroadca
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(etk::String &xmlFilename);
void LoadFile(const char * xmlFilename);

View File

@@ -30,51 +30,20 @@
#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;
// Init link with the buffer Manager
//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);
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);
// 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
#endif
m_bufferManager = BufferManager::getInstance();
m_colorManager = ColorizeManager::getInstance();
SetCanHaveFocus(true);
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferListChange);
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferState);
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferId);
m_selectedID = -1;
}
@@ -89,25 +58,100 @@ 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:
m_selectedID = dataID;
case EDN_MSG__BUFFER_CHANGE_STATE:
case EDN_MSG__BUFFER_CHANGE_NAME:
case EDN_MSG__BUFFER_CHANGE_MODIFY:
// change Title :
//gtk_widget_queue_draw(m_widget);
break;
case EDN_MSG__USER_DISPLAY_CHANGE:
// Redraw all the display ...
//gtk_widget_queue_draw(m_widget);
break;
if (generateEventId == ednMsgBufferListChange) {
MarkToReedraw();
}else if (generateEventId == ednMsgBufferId) {
MarkToReedraw();
}else if (generateEventId == ednMsgBufferState) {
MarkToReedraw();
}
return false;
}
color_ts BufferView::GetBasicBG(void)
{
return m_colorManager->Get(COLOR_LIST_BG_1);
}
uint32_t BufferView::GetNuberOfColomn(void)
{
return 1;
}
bool BufferView::GetTitle(int32_t colomn, etk::String &myTitle, color_ts &fg, color_ts &bg)
{
myTitle = "Buffers : ";
return true;
}
uint32_t BufferView::GetNuberOfRaw(void)
{
if (NULL != m_bufferManager) {
return m_bufferManager->Size();
}
return 0;
}
bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::String &myTextToWrite, color_ts &fg, color_ts &bg)
{
etk::File name;
bool isModify;
basicColor_te selectFG = COLOR_LIST_TEXT_NORMAL;
basicColor_te selectBG = COLOR_LIST_BG_1;
if (m_bufferManager->Exist(raw)) {
isModify = m_bufferManager->Get(raw)->IsModify();
name = m_bufferManager->Get(raw)->GetFileName();
char *tmpModify = (char*)" ";
if (true == isModify) {
tmpModify = (char*)"M";
}
char name2[1024] = "";
sprintf(name2, "[%2d](%s) %s", raw, tmpModify, name.GetShortFilename().c_str() );
myTextToWrite = name2;
if (true == isModify) {
selectFG = COLOR_LIST_TEXT_MODIFY;
} else {
selectFG = COLOR_LIST_TEXT_NORMAL;
}
if (raw%2==0) {
selectBG = COLOR_LIST_BG_1;
} else {
selectBG = COLOR_LIST_BG_2;
}
if (m_selectedID == raw) {
selectBG = COLOR_LIST_BG_SELECTED;
}
} else {
myTextToWrite = "ERROR";
}
fg = m_colorManager->Get(selectFG);
bg = m_colorManager->Get(selectBG);
return true;
}
bool BufferView::OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y)
{
if (typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) {
EDN_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw );
int32_t selectBuf = m_bufferManager->WitchBuffer(raw+1);
if ( 0 <= selectBuf) {
m_selectedID = raw;
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, selectBuf);
}
}
MarkToReedraw();
return false;
}
#if 0
gboolean BufferView::CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data)

View File

@@ -30,45 +30,31 @@
#include <BufferManager.h>
#include <Display.h>
#include <MsgBroadcast.h>
#include <ewol/widget/List.h>
class BufferView : public MsgBroadcast
class BufferView : public ewol::List
{
public:
// Constructeur
BufferView(void);
~BufferView(void);
//GtkWidget *GetMainWidget(void);
void OnMessage(int32_t id, int32_t dataID);
/*
// sur : GTK+ callback :
static gboolean CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data);
static gboolean CB_displayInit( GtkWidget *widget, gpointer data);
static gint CB_focusGet( GtkWidget *widget, GdkEventFocus *event, gpointer data);
static gint CB_focusLost( GtkWidget *widget, GdkEventFocus *event, gpointer data);
static gint CB_keyboardEvent( GtkWidget *widget, GdkEventKey *event, gpointer data);
static gint CB_mouseButtonEvent(GtkWidget *widget, GdkEventButton *event, gpointer data);
static gint CB_mouseMotionEvent( GtkWidget *widget, GdkEventMotion *event, gpointer data);
static void CB_EventOnBufferManager(gpointer data);
static void OnPopupEventShow(GtkWidget *menuitem, gpointer data);
static void OnPopupEventClose(GtkWidget *menuitem, gpointer data);
static void OnPopupEventSave(GtkWidget *menuitem, gpointer data);
static void OnPopupEventSaveAs(GtkWidget *menuitem, gpointer data);
*/
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
protected:
// function call to display the list :
virtual color_ts GetBasicBG(void);
virtual uint32_t GetNuberOfColomn(void);
virtual bool GetTitle(int32_t colomn, etk::String &myTitle, color_ts &fg, color_ts &bg);
virtual uint32_t GetNuberOfRaw(void);
virtual bool GetElement(int32_t colomn, int32_t raw, etk::String &myTextToWrite, color_ts &fg, color_ts &bg);
virtual bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y);
private:
//void ViewPopupMenu(GtkWidget *parrent, GdkEventButton *event, int32_t BufferID);
// main windows widget :
//GtkWidget * m_widget;
// r<>cup<75>ration des proprieter g<>n<EFBFBD>ral...
BufferManager * m_bufferManager;
ColorizeManager * m_colorManager;
int32_t m_shawableAreaX;
int32_t m_shawableAreaY;
int32_t m_selectedID;
int32_t m_contectMenuSelectID;
};

View File

@@ -36,15 +36,22 @@
#include <SearchData.h>
#include <ewol/WidgetManager.h>
#include <ewol/WidgetMessageMultiCast.h>
#undef __class__
#define __class__ "ewol::Button"
#define __class__ "ewol::CodeView"
CodeView::CodeView(void) : MsgBroadcast("Code View", EDN_CAT_WORK_AREA)
CodeView::CodeView(void)
{
m_label = "CodeView is disable ...";
m_fontNormal = -1;
m_fontBold = -1;
m_fontItalic = -1;
m_fontBoldItalic = -1;
m_fontSize = 15;
m_bufferID = -1;
m_buttunOneSelected = false;
@@ -62,6 +69,31 @@ CodeView::CodeView(void) : MsgBroadcast("Code View", EDN_CAT_WORK_AREA)
m_textColorBg.blue = 0.0;
m_textColorBg.alpha = 0.25;
SetCanHaveFocus(true);
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferId);
//old
/*
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)
@@ -76,42 +108,45 @@ bool CodeView::CalculateMinSize(void)
return true;
}
void CodeView::CalculateMaxSize(void)
{
m_maxSize.x = 4096;
int32_t letterHeight = ewol::GetHeight(m_fontNormal);
m_maxSize.y = m_bufferManager->Get(m_bufferID)->GetNumberOfLine() * letterHeight;
}
void CodeView::OnRegenerateDisplay(void)
{
if (true == NeedRedraw()) {
// For the scrooling windows
CalculateMaxSize();
// create tmp object :
ewol::OObject2DTextColored* myOObjectText = new ewol::OObject2DTextColored("", -1);
ewol::OObject2DTextColored* myOObjectTextNormal = new ewol::OObject2DTextColored(m_fontNormal);
ewol::OObject2DTextColored* myOObjectTextBold = new ewol::OObject2DTextColored(m_fontBold);
ewol::OObject2DTextColored* myOObjectTextItalic = new ewol::OObject2DTextColored(m_fontItalic);
ewol::OObject2DTextColored* myOObjectTextBoldItalic = new ewol::OObject2DTextColored(m_fontBoldItalic);
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);
m_bufferManager->Get(m_bufferID)->Display(myOObjectTextNormal, myOObjectTextBold, myOObjectTextItalic, myOObjectTextBoldItalic, myOObjectsColored,
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
// clean the object list ...
ClearOObjectList();
// add generated element
AddOObject(myOObjectsColored, "CodeViewBackground");
AddOObject(myOObjectText, "CodeViewText");
}
AddOObject(myOObjectTextNormal, "CodeViewTextNormal");
AddOObject(myOObjectTextBold, "CodeViewTextBold");
AddOObject(myOObjectTextItalic, "CodeViewTextItalic");
AddOObject(myOObjectTextBoldItalic, "CodeViewTextBoldItalic");
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();
// call the herited class...
WidgetScrooled::OnRegenerateDisplay();
}
//return eventIsOK;
*/
// in every case this not stop the propagation of the event
return false;
// if overwrited... you can ...
}
@@ -120,7 +155,7 @@ bool CodeView::OnEventKb(ewol::eventKbType_te typeEvent, char UTF8_data[UTF8_MAX
//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();
MarkToReedraw();
}
return true;
}
@@ -130,7 +165,7 @@ bool CodeView::OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveTy
{
if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) {
m_bufferManager->Get(m_bufferID)->cursorMove(moveTypeEvent);
OnRegenerateDisplay();
MarkToReedraw();
}
return true;
}
@@ -139,6 +174,11 @@ bool CodeView::OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveTy
bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y)
{
if (true == WidgetScrooled::OnEventInput(IdInput, typeEvent, x, y)) {
ewol::widgetManager::FocusKeep(this);
// nothing to do ... done on upper widet ...
return true;
}
x -= m_origin.x;
y -= m_origin.y;
/*
@@ -179,22 +219,23 @@ bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent,
if (ewol::EVENT_INPUT_TYPE_DOWN == typeEvent) {
m_buttunOneSelected = true;
ewol::widgetManager::FocusKeep(this);
//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);
MarkToReedraw();
} else if (ewol::EVENT_INPUT_TYPE_UP == typeEvent) {
m_buttunOneSelected = false;
m_bufferManager->Get(m_bufferID)->Copy(COPY_MIDDLE_BUTTON);
OnRegenerateDisplay();
MarkToReedraw();
} 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();
// nothing to do ...
} 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();
MarkToReedraw();
} else if (ewol::EVENT_INPUT_TYPE_TRIPLE == typeEvent) {
//EDN_INFO("mouse-event BT1 ==> Triple Clicked");
m_bufferManager->Get(m_bufferID)->MouseEventTriple();
OnRegenerateDisplay();
MarkToReedraw();
} else if (ewol::EVENT_INPUT_TYPE_MOVE == typeEvent) {
if (true == m_buttunOneSelected) {
int xxx, yyy;
@@ -208,37 +249,109 @@ bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent,
}
//EDN_INFO("mouse-motion BT1 %d, %d", xxx, yyy);
m_bufferManager->Get(m_bufferID)->MouseSelectFromCursorTo(xxx, yyy);
OnRegenerateDisplay();
MarkToReedraw();
}
}
} 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();
MarkToReedraw();
ewol::widgetManager::FocusKeep(this);
}
}
if (4 == IdInput && ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent)
// TODO : No mere used here ... ==> set in the scrooled windows ...
/*
if (4 == IdInput && ewol::EVENT_INPUT_TYPE_UP == typeEvent)
{
//EDN_INFO("mouse-event GDK_SCROLL_UP");
m_bufferManager->Get(m_bufferID)->ScrollUp();
OnRegenerateDisplay();
MarkToReedraw();
ewol::widgetManager::FocusKeep(this);
} else if (5 == IdInput && ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent)
} else if (5 == IdInput && ewol::EVENT_INPUT_TYPE_UP == typeEvent)
{
//EDN_INFO("mouse-event GDK_SCROLL_DOWN");
m_bufferManager->Get(m_bufferID)->ScrollDown();
OnRegenerateDisplay();
MarkToReedraw();
ewol::widgetManager::FocusKeep(this);
}
*/
return true;
}
void CodeView::OnMessage(int32_t id, int32_t dataID)
bool CodeView::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y)
{
EDN_DEBUG("Extern Event : " << widgetID << " type : " << generateEventId << " position(" << x << "," << y << ")");
if( ednMsgBufferId == generateEventId) {
int32_t bufferID = 0;
sscanf(data, "%d", &bufferID);
EDN_INFO("Select a new Buffer ... " << bufferID);
m_bufferID = bufferID;
m_bufferManager->Get(m_bufferID)->ForceReDraw(true);
// TODO : need to update the state of the file and the filenames ...
}
// old
/*
else if( ednMsgCodeViewCurrentChangeBufferId == generateEventId) {
int32_t bufferID = 0;
sscanf(data, "%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*)data);
}
*/
/*
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:
@@ -322,27 +435,66 @@ void CodeView::OnMessage(int32_t id, int32_t dataID)
case EDN_MSG__REFRESH_DISPLAY:
break;
case EDN_MSG__CURRENT_SET_CHARSET:
m_bufferManager->Get(m_bufferID)->SetCharset((charset_te)dataID);
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();
MarkToReedraw();
return true;
}
void CodeView::OnGetFocus(void)
{
SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, m_bufferID);
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_bufferID);
ewol::KeyboardShow(ewol::KEYBOARD_MODE_CODE);
EDN_INFO("Focus - In");
}
void CodeView::OnLostFocus(void)
{
ewol::KeyboardHide();
EDN_INFO("Focus - out");
}
void CodeView::SetFontSize(int32_t size)
{
m_fontSize = size;
}
void CodeView::SetFontNameNormal(etk::String fontName)
{
int32_t fontID = ewol::LoadFont(fontName, m_fontSize);
if (fontID >= 0) {
m_fontNormal = fontID;
}
}
void CodeView::SetFontNameBold(etk::String fontName)
{
int32_t fontID = ewol::LoadFont(fontName, m_fontSize);
if (fontID >= 0) {
m_fontBold = fontID;
}
}
void CodeView::SetFontNameItalic(etk::String fontName)
{
int32_t fontID = ewol::LoadFont(fontName, m_fontSize);
if (fontID >= 0) {
m_fontItalic = fontID;
}
}
void CodeView::SetFontNameBoldItalic(etk::String fontName)
{
int32_t fontID = ewol::LoadFont(fontName, m_fontSize);
if (fontID >= 0) {
m_fontBoldItalic = fontID;
}
}

View File

@@ -34,13 +34,13 @@
#include <etk/Types.h>
#include <ewol/Widget.h>
#include <ewol/widget/WidgetScrolled.h>
class CodeView :public ewol::Widget, public MsgBroadcast
class CodeView :public ewol::WidgetScrooled
{
public:
CodeView(void);
virtual ~CodeView(void);
void OnMessage(int32_t id, int32_t dataID);
virtual bool CalculateMinSize(void);
private:
etk::String m_label;
@@ -52,52 +52,28 @@ class CodeView :public ewol::Widget, public MsgBroadcast
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:
// Constructeur
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);
static gboolean CB_displayInit( GtkWidget *widget, gpointer data);
static gint CB_focusGet( GtkWidget *widget, GdkEventFocus *event, gpointer data);
static gint CB_focusLost( GtkWidget *widget, GdkEventFocus *event, gpointer data);
static gint CB_keyboardEvent( GtkWidget *widget, GdkEventKey *event, gpointer data);
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;
// récupération des proprieter général...
BufferManager * m_bufferManager;
ColorizeManager * m_colorManager;
int32_t m_shawableAreaX;
int32_t m_shawableAreaY;
int32_t m_bufferID;
bool m_buttunOneSelected;
int32_t m_fontSize;
int32_t m_fontNormal;
int32_t m_fontBold;
int32_t m_fontItalic;
int32_t m_fontBoldItalic;
public:
void SetFontSize(int32_t size);
void SetFontNameNormal(etk::String fontName);
void SetFontNameBold(etk::String fontName);
void SetFontNameItalic(etk::String fontName);
void SetFontNameBoldItalic(etk::String fontName);
private:
void CalculateMaxSize(void);
};
#endif
#endif

View File

@@ -43,11 +43,20 @@
#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 ednEventNewFile = "edn-New-File";
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";
const char * const ednEventPopUpFileSaveAs = "edn-PopUp-FileSaveAs";
MainWindows::MainWindows(void)
{
@@ -57,6 +66,7 @@ MainWindows::MainWindows(void)
ewol::Button * myButton = NULL;
ewol::Label * myLabel = NULL;
CodeView * myCodeView = NULL;
BufferView * myBufferView = NULL;
mySizerVert = new ewol::SizerVert();
SetSubWidget(mySizerVert);
@@ -64,14 +74,36 @@ MainWindows::MainWindows(void)
mySizerHori = new ewol::SizerHori();
mySizerVert->SubWidgetAdd(mySizerHori);
myButton = new ewol::Button("New");
mySizerHori->SubWidgetAdd(myButton);
if (false == myButton->ExternLinkOnEvent(ewolEventButtonPressed, GetWidgetId(), ednEventNewFile) ) {
EDN_CRITICAL("link with an entry event");
}
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);
@@ -80,13 +112,34 @@ MainWindows::MainWindows(void)
mySizerHori = new ewol::SizerHori();
mySizerVert->SubWidgetAdd(mySizerHori);
myBufferView = new BufferView();
myBufferView->SetExpendX(false);
myBufferView->SetExpendY(true);
myBufferView->SetFillX(true);
myBufferView->SetFillY(true);
mySizerHori->SubWidgetAdd(myBufferView);
myCodeView = new CodeView();
myCodeView->SetExpendX(true);
myCodeView->SetExpendY(true);
myCodeView->SetFillX(true);
myCodeView->SetFillY(true);
myCodeView->SetFontSize(11);
myCodeView->SetFontNameNormal( "freefont/FreeMono.ttf");
myCodeView->SetFontNameBold( "freefont/FreeMonoBold.ttf");
myCodeView->SetFontNameItalic( "freefont/FreeMonoOblique.ttf");
myCodeView->SetFontNameBoldItalic("freefont/FreeMonoBoldOblique.ttf");
/*
myCodeView->SetFontSize(11);
myCodeView->SetFontNameNormal( "ubuntu/UbuntuMono-R.ttf");
myCodeView->SetFontNameBold( "ubuntu/UbuntuMono-B.ttf");
myCodeView->SetFontNameItalic( "ubuntu/UbuntuMono-RI.ttf");
myCodeView->SetFontNameBoldItalic("ubuntu/UbuntuMono-BI.ttf");
*/
mySizerHori->SubWidgetAdd(myCodeView);
// Generic event ...
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiSaveAs);
}
@@ -97,6 +150,97 @@ MainWindows::~MainWindows(void)
bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y)
{
if (true == ewol::Windows::OnEventAreaExternal(widgetID, generateEventId, data, x, y) ) {
return true;
}
//EDN_INFO("Receive Event from the main windows ... : widgetid=" << widgetID << "\"" << generateEventId << "\" ==> data=\"" << data << "\"" );
// newFile section ...
if (generateEventId == ednEventNewFile) {
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgGuiNew);
}
else if (generateEventId == ednEventCloseFile) {
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgGuiClose, "current");
}
else if (generateEventId == ednEventSaveFile) {
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgGuiSave, "current");
}
else if (generateEventId == ednEventSaveAsFile) {
OnEventAreaExternal(GetWidgetId(), ednMsgGuiSaveAs, "current", x, y);
}
// Open file Section ...
else if (generateEventId == ednEventOpenFile) {
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
tmpWidget->SetTitle("Open Files ...");
tmpWidget->SetValidateLabel("Open");
// TODO : Set the good folder ...
//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) {
// TODO : Set this in the upper windows ...
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();
EDN_DEBUG("Request opening the file : " << tmpData);
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgOpenFile, tmpData.c_str());
PopUpWidgetPop();
} else if (generateEventId == ednMsgGuiSaveAs) {
if (NULL == data) {
EDN_ERROR("Null data for Save As file ... ");
} else {
BufferManager * myMng = BufferManager::getInstance();
m_currentSavingAsIdBuffer = -1;
if (0 == strcmp(data , "current")) {
m_currentSavingAsIdBuffer = myMng->GetSelected();
} else {
sscanf(data, "%d", &m_currentSavingAsIdBuffer);
}
if (false == myMng->Exist(m_currentSavingAsIdBuffer)) {
EDN_ERROR("Request saveAs on non existant Buffer ID=" << m_currentSavingAsIdBuffer);
} else {
Buffer * myBuffer = myMng->Get(m_currentSavingAsIdBuffer);
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
tmpWidget->SetTitle("Save Files As...");
tmpWidget->SetValidateLabel("Save");
etk::String folder = "/home/";
etk::String fileName = "";
if (true == myBuffer->HaveName()) {
etk::File tmpName = myBuffer->GetFileName();
folder = tmpName.GetFolder();
fileName = tmpName.GetShortFilename();
}
tmpWidget->SetFolder(folder);
tmpWidget->SetFileName(fileName);
PopUpWidgetPush(tmpWidget);
if (false == tmpWidget->ExternLinkOnEvent(ewolEventFileChooserCancel, GetWidgetId(), ednEventPopUpClose) ) {
EDN_CRITICAL("link with an entry event");
}
if (false == tmpWidget->ExternLinkOnEvent(ewolEventFileChooserValidate, GetWidgetId(), ednEventPopUpFileSaveAs) ) {
EDN_CRITICAL("link with an entry event");
}
}
}
} else if (generateEventId == ednEventPopUpFileSaveAs) {
PopUpWidgetPop();
}
return true;
}

View File

@@ -70,10 +70,13 @@ class MainWindows: public etk::Singleton<MainWindows>, public MsgBroadcast
#endif
class MainWindows : public ewol::Windows
{
private:
int32_t m_currentSavingAsIdBuffer;
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

View File

@@ -27,7 +27,7 @@
#include <tools_debug.h>
#include <MenuBar.h>
#include <ClipBoard.h>
#include <charset.h>
#include <etk/unicode.h>
#include <ColorizeManager.h>
#if 0
#define MENU_MSG

View File

@@ -34,11 +34,11 @@
//class MenuBarMain;
class MenuBar: public MsgBroadcast
class MenuBar
{
public:
// Constructeur
MenuBar(void) : MsgBroadcast("Menu bar", EDN_CAT_GUI){};
MenuBar(void) {};
~MenuBar(void) {};
//GtkWidget * GetWidget(void) { return m_mainWidget; };
void OnMessage(int32_t id, int32_t dataID) {};

View File

@@ -28,7 +28,7 @@
StatusBar::StatusBar(void) : MsgBroadcast("Status bar", EDN_CAT_GUI)
StatusBar::StatusBar(void)
{
/*
m_mainWidget = gtk_statusbar_new();

View File

@@ -28,7 +28,7 @@
#ifndef __STATUS_BAR_H__
#define __STATUS_BAR_H__
class StatusBar: public MsgBroadcast
class StatusBar
{
public:
// Constructeur

View File

@@ -37,7 +37,7 @@ static void CB_menuGenerique(GtkMenuItem *menu_item, gpointer data)
}
*/
ToolBar::ToolBar(void) : MsgBroadcast("Tool bar", EDN_CAT_GUI)
ToolBar::ToolBar(void)
{
/*
m_mainWidget = gtk_toolbar_new();

View File

@@ -29,7 +29,7 @@
#define __TOOL_BAR_H__
class ToolBar: public MsgBroadcast
class ToolBar
{
public:
// Constructeur

View File

@@ -42,7 +42,7 @@
* @return ---
*
*/
WindowsManager::WindowsManager(void) : MsgBroadcast("Windows Manager", EDN_CAT_GUI_MANAGER)
WindowsManager::WindowsManager(void)
{
m_currentBufferID = -1;
}

View File

@@ -30,7 +30,7 @@
#include <MsgBroadcast.h>
#include <MainWindows.h>
class WindowsManager: public etk::Singleton<WindowsManager>, public MsgBroadcast
class WindowsManager: public etk::Singleton<WindowsManager>
{
friend class etk::Singleton<WindowsManager>;
// specific for sigleton system...

View File

@@ -47,14 +47,41 @@ void Highlight::ParseRules(TiXmlNode *child, etk::VectorType<HighlightPattern*>
Highlight::Highlight(etk::String &xmlFilename)
{
TiXmlDocument XmlDocument;
// open the curent File
bool loadError = XmlDocument.LoadFile(xmlFilename.c_str());
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+5];
if (NULL == fileBuffer) {
EWOL_ERROR("Error Memory allocation size=" << fileSize);
return;
}
memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
// load data from the file :
fileName.fRead(fileBuffer, 1, fileSize);
// close the file:
fileName.fClose();
// load the XML from the memory
bool loadError = XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8);
if (false == loadError) {
EDN_ERROR( "can not load Hightlight XML: PARSING error: \"" << xmlFilename << "\"");
return;
}
TiXmlElement* root = XmlDocument.FirstChildElement( "EdnLang" );
if (NULL == root) {
EDN_ERROR( "can not load Hightlight XML: main node not find: \"EdnLang\"");
@@ -109,6 +136,9 @@ Highlight::Highlight(etk::String &xmlFilename)
// get the next node element :
child = child->NextSibling();
}
if (NULL != fileBuffer) {
delete[] fileBuffer;
}
}
Highlight::~Highlight(void)

View File

@@ -26,13 +26,14 @@
#include <tools_debug.h>
#include <tools_globals.h>
#include <HighlightManager.h>
#include <ewol/WidgetMessageMultiCast.h>
#undef __class__
#define __class__ "HighlightManager"
HighlightManager::HighlightManager(void) : MsgBroadcast("Hight-light Manager", EDN_CAT_HL)
HighlightManager::HighlightManager(void)
{
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferColor);
}
HighlightManager::~HighlightManager(void)
@@ -50,8 +51,9 @@ HighlightManager::~HighlightManager(void)
}
void HighlightManager::OnMessage(int32_t id, int32_t dataID)
bool HighlightManager::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
{
/*
switch (id)
{
case EDN_MSG__COLOR_HAS_CHANGE:
@@ -63,6 +65,8 @@ void HighlightManager::OnMessage(int32_t id, int32_t dataID)
}
break;
}
*/
return false;
}
Highlight *HighlightManager::Get(etk::File &fileName)
@@ -87,55 +91,39 @@ bool HighlightManager::Exist(etk::File &fileName)
void HighlightManager::loadLanguages(void)
{
etk::String homedir;
#ifdef NDEBUG
homedir = "/usr/share/edn/";
#else
homedir = "./data/";
#endif
etk::String xmlFilename = homedir;
xmlFilename += "lang_c.xml";
etk::String xmlFilename = "lang_c.xml";
Highlight *myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = homedir;
xmlFilename += "lang_boo.xml";
xmlFilename = "lang_boo.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = homedir;
xmlFilename += "lang_Makefile.xml";
xmlFilename = "lang_Makefile.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = homedir;
xmlFilename += "lang_asm.xml";
xmlFilename = "lang_asm.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = homedir;
xmlFilename += "lang_xml.xml";
xmlFilename = "lang_xml.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = homedir;
xmlFilename += "lang_php.xml";
xmlFilename = "lang_php.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = homedir;
xmlFilename += "lang_bash.xml";
xmlFilename = "lang_bash.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = homedir;
xmlFilename += "lang_matlab.xml";
xmlFilename = "lang_matlab.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = homedir;
xmlFilename += "lang_java.xml";
xmlFilename = "lang_java.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);

View File

@@ -31,9 +31,10 @@ class HighlightManager;
#include <etk/Singleton.h>
#include <MsgBroadcast.h>
#include <Highlight.h>
#include <ewol/Widget.h>
class HighlightManager: public etk::Singleton<HighlightManager>, public MsgBroadcast
class HighlightManager: public etk::Singleton<HighlightManager>, public ewol::Widget
{
friend class etk::Singleton<HighlightManager>;
// specific for sigleton system...
@@ -43,7 +44,7 @@ class HighlightManager: public etk::Singleton<HighlightManager>, public MsgBroad
~HighlightManager(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 loadLanguages(void);
Highlight * Get(etk::File &fileName);

View File

@@ -28,6 +28,7 @@
#include <CTagsManager.h>
#include <ClipBoard.h>
#include <BufferManager.h>
#include <ewol/WidgetMessageMultiCast.h>
@@ -42,12 +43,13 @@
* @return ---
*
*/
CTagsManager::CTagsManager(void) : MsgBroadcast("C-Tags Manager", EDN_CAT_CTAGS)
CTagsManager::CTagsManager(void)
{
m_tagFilename = "";
m_tagFolderBase = "";
m_ctagFile = NULL;
m_historyPos = 0;
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiCtags);
}
/**
@@ -92,7 +94,7 @@ etk::String CTagsManager::GetFolder(etk::String &inputString)
return out;
}
void CTagsManager::OnMessage(int32_t id, int32_t dataID)
bool CTagsManager::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
{
/*
switch (id)
@@ -144,6 +146,7 @@ void CTagsManager::OnMessage(int32_t id, int32_t dataID)
break;
}
*/
return false;
}

View File

@@ -28,6 +28,7 @@
#include <etk/Singleton.h>
#include <ewol/Widget.h>
#include "MsgBroadcast.h"
#include "readtags.h"
@@ -40,7 +41,7 @@ typedef struct{
} TagListFind_ts;
class CTagsManager: public etk::Singleton<CTagsManager>, public MsgBroadcast
class CTagsManager: public etk::Singleton<CTagsManager>, public ewol::Widget
{
friend class etk::Singleton<CTagsManager>;
// specific for sigleton system...
@@ -50,7 +51,7 @@ class CTagsManager: public etk::Singleton<CTagsManager>, public MsgBroadcast
~CTagsManager(void);
public:
void OnMessage(int32_t id, int32_t dataID);
virtual bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
private:
int32_t m_currentSelectedID;
void LoadTagFile(void);

View File

@@ -37,6 +37,7 @@
#include <unistd.h>
#include <readtags.h>
#include <CTagsManager.h>
#include <ewol/WidgetMessageMultiCast.h>
MainWindows * basicWindows = NULL;
@@ -44,9 +45,9 @@ MainWindows * basicWindows = NULL;
/**
* @brief main application function Initialisation
*/
void APP_Init(int argc, char *argv[])
void APP_Init(void)
{
EDN_INFO("Start Edn");
EDN_INFO("==> Init Edn (START)");
ewol::ChangeSize(800, 600);
// set the default Path of the application :
@@ -70,42 +71,28 @@ void APP_Init(int argc, char *argv[])
#endif
ewol::SetFontFolder("Font");
#ifdef EWOL_USE_FREE_TYPE
//ewol::SetDefaultFont("freefont/FreeMono.ttf", 12);
ewol::SetDefaultFont("freefont/FreeSerif.ttf", 12);
//ewol::SetDefaultFont("freefont/FreeMonoBold.ttf", 12);
ewol::SetDefaultFont("ACharmingFont.ttf", 45);
//ewol::SetDefaultFont("ACharmingFont.ttf", 45);
//ewol::SetDefaultFont("Monospace/Monospace", 40);
//ewol::SetDefaultFont("unispace.ttf", 12);
#else
//ewol::SetDefaultFont("ebtfont/Monospace", 14);
ewol::SetDefaultFont("ebtfont/Monospace", 22);
#endif
// 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();
(void)BufferManager::getInstance();
// set color and other trucs...
ColorizeManager *myColorManager = NULL;
myColorManager = ColorizeManager::getInstance();
etk::String homedir;
//homedir = getenv("HOME");
#ifdef NDEBUG
homedir = "/usr/share/edn/";
#else
homedir = "./data/";
#endif
//homedir += "color_black.xml";
homedir += "color_white.xml";
etk::String homedir = "color_white.xml";
myColorManager->LoadFile( homedir.c_str() );
myColorManager->DisplayListOfColor();
@@ -113,8 +100,6 @@ void APP_Init(int argc, char *argv[])
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];
@@ -126,33 +111,22 @@ void APP_Init(int argc, char *argv[])
basicWindows = new MainWindows();
// add files
EDN_INFO("show list of files : ");
for( int32_t i=1 ; i<argc; i++) {
EDN_INFO("need load file : \"" << argv[i] << "\"" );
etk::File myfile((char *)argv[i], etk::FILE_TYPE_DIRECT);
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);
}
}
}
{
etk::File myfile((char *)"licence.txt", etk::FILE_TYPE_DIRECT);
if (false == myBufferManager->Exist(myfile) ) {
int32_t idBuffOpened = myBufferManager->Open(myfile);
MsgBroadcastCore::getInstance()->SendMessage(NULL, EDN_MSG__CURRENT_CHANGE_BUFFER_ID, idBuffOpened);
}
}
if (NULL == basicWindows) {
EDN_ERROR("Can not allocate the basic windows");
ewol::Stop();
return;
}
// create the specific windows
ewol::DisplayWindows(basicWindows);
// add files
EDN_INFO("show list of files : ");
for( int32_t iii=0 ; iii<ewol::CmdLineNb(); iii++) {
EDN_INFO("need load file : \"" << ewol::CmdLineGet(iii) << "\"" );
ewol::widgetMessageMultiCast::Send(-1, ednMsgOpenFile, ewol::CmdLineGet(iii).c_str());
}
EDN_INFO("==> Init Edn (END)");
}
@@ -161,24 +135,24 @@ void APP_Init(int argc, char *argv[])
*/
void APP_UnInit(void)
{
EDN_INFO("==> Un-Init Edn (START)");
// Remove windows :
ewol::DisplayWindows(NULL);
//Kill all singleton
EDN_INFO("Stop BufferManager");
//BufferManager::kill();
BufferManager::Kill();
EDN_INFO("Stop ColorizeManager");
//ColorizeManager::kill();
ColorizeManager::Kill();
EDN_INFO("Stop Search");
//Search::kill();
EDN_INFO("Stop Accel key");
//AccelKey::kill();
EDN_INFO("Stop Display");
Display::UnInit();
Search::Kill();
//EDN_INFO("Stop Accel key");
//AccelKey::Kill();
if (NULL != basicWindows) {
delete(basicWindows);
}
EDN_INFO("Stop Edn");
//return EXIT_SUCCESS;
basicWindows = NULL;
EDN_INFO("==> Un-Init Edn (END)");
}

View File

@@ -26,83 +26,10 @@
#include <tools_debug.h>
#include <tools_globals.h>
#include <Display.h>
#include <ColorizeManager.h>
#include <charset.h>
#include <etk/String.h>
#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)
{
int32_t fontId = ewol::GetDefaultFontId();
@@ -115,540 +42,3 @@ int32_t Display::GetFontWidth(void)
return ewol::GetWidth(fontId, "A");
}
void * 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];
*/
return NULL;
}
#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(void * widget, int32_t x, int32_t y)
{
m_size.x = x;
m_size.y = y;
m_haveWork = false;
m_nbElement = 0;
// 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);
}
/**
* @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 0
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);
}
#endif
}
/**
* @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)
{
#if 0
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);
#endif
}
/* 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);
*/

View File

@@ -27,8 +27,6 @@
#define __TOOLS_DISPLAY_H__
#include <tools_debug.h>
#include <Colorize.h>
#include <ColorizeManager.h>
/**
@@ -36,60 +34,10 @@
*/
namespace Display
{
void Init(void);
void UnInit(void);
//cairo_font_face_t * GetFont(bool bold, bool italic);
void * 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 * 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

View File

@@ -25,6 +25,7 @@
#include <tools_debug.h>
#include <tools_globals.h>
#include <etk/unicode.h>
#include <EdnBuf.h>
@@ -69,7 +70,7 @@ EdnBuf::EdnBuf(void)
// charset :
m_isUtf8 = false;
m_charsetType = EDN_CHARSET_ISO_8859_15;
m_charsetType = unicode::EDN_CHARSET_ISO_8859_15;
m_isUndoProcessing = false;
m_isRedoProcessing = false;
@@ -77,7 +78,6 @@ EdnBuf::EdnBuf(void)
// basicly no HL system ...
m_Highlight = NULL;
m_nbLine = 1;
m_HLDataSequence = 0;
}
/**
@@ -468,7 +468,7 @@ int32_t EdnBuf::GetExpandedChar(int32_t &pos, int32_t indent, char outUTF8[MAX_E
tmpString[6] = '\0';
uint8_t size;
bool baseValid;
Utf8_SizeElement(tmpString, 6 , size, baseValid);
unicode::Utf8_SizeElement(tmpString, 6 , size, baseValid);
currentChar = 0; // TODO : Set UNICODE char ...
if (true == baseValid) {
char *tmp = outUTF8;
@@ -488,6 +488,119 @@ int32_t EdnBuf::GetExpandedChar(int32_t &pos, int32_t indent, char outUTF8[MAX_E
return 1;
}
/**
* @brief Transform the current caracter in the buffer in a displayable vector of char
*
* @param[in,out] pos position of the char that might be converted (incremented to the next char (in case of UTF8)
* @param[in] indent Curent indentation befor the curent char
* @param[out] outUTF8 string of the displayed element
* @param[out] currentChar curent unicode output char
*
* @return number of displayable char (display char width)
*
*/
int32_t EdnBuf::GetExpandedChar(int32_t &pos, int32_t indent, uniChar_t outUnicode[MAX_EXP_CHAR_LEN], uint32_t &currentChar)
{
int32_t i, nSpaces;
char c = m_data.Get(pos);
currentChar = (uint32_t)c & 0xFF;
/* Convert tabs to spaces */
if (c == '\t') {
nSpaces = m_tabDist - (indent % m_tabDist);
for (i=0; i<nSpaces; i++) {
outUnicode[i] = ' ';
}
outUnicode[i] = '\0';
pos++;
return nSpaces;
}
// Convert ASCII control codes to readable character sequences
if (c == '\0') {
outUnicode[0] = '<';
outUnicode[1] = 'n';
outUnicode[2] = 'u';
outUnicode[3] = 'l';
outUnicode[4] = '>';
outUnicode[5] = '\0';
pos++;
return 5;
}
if (((unsigned char)c) == '\n') {
outUnicode[0] = (unsigned char)c;
outUnicode[1] = '\0';
pos++;
return 1;
}
if (((unsigned char)c) <= 31) {
const char * tmp = ControlCodeTable[(unsigned char)c];
int32_t nbElem = 2;
*outUnicode++ = '<';
while (*tmp!='\0') {
*outUnicode++ = *tmp;
tmp++;
nbElem++;
}
*outUnicode++ = '>';
*outUnicode++ = '\0';
pos++;
return nbElem;
} else if (c == 127) {
outUnicode[0] = '<';
outUnicode[1] = 'd';
outUnicode[2] = 'e';
outUnicode[3] = 'l';
outUnicode[4] = '>';
outUnicode[5] = '\0';
pos++;
return 5;
}
// clear all the data ...
memset(outUnicode, 0, sizeof(uniChar_t)*MAX_EXP_CHAR_LEN);
// Otherwise, just return the character
if (false ==m_isUtf8) {
unicode::convertIsoToUnicode(m_charsetType, c, outUnicode[0]);
pos++;
} else {
char tmpString[8];
for (int32_t k=0; k<6 && k< m_data.Size() - pos; k++) {
tmpString[k] = m_data.Get(pos+k);
}
tmpString[6] = '\0';
uint8_t size;
bool baseValid;
unicode::Utf8_SizeElement(tmpString, 6 , size, baseValid);
currentChar = 0;
if (true == baseValid) {
uniChar_t *tmp = outUnicode;
for (int32_t k=0; k<size; k++) {
*tmp++ = tmpString[k];
}
*tmp = '\0';
unicode::convertIsoToUnicode(m_charsetType, c, outUnicode[0]);
} else {
outUnicode[0] = '<';
outUnicode[1] = '?';
outUnicode[2] = '?';
outUnicode[3] = '?';
outUnicode[4] = '>';
outUnicode[5] = 0;
}
if (0 == size) {
EDN_ERROR("plop");
}
pos+=size;
int32_t outSize = 0;
while (outUnicode[outSize]!=0) {
outSize++;
}
return outSize;
}
return 1;
}
/**
* @brief generate the real display of character of the output (ex : \t ==> 4 spaces or less ...)
@@ -545,7 +658,7 @@ int32_t EdnBuf::ExpandCharacter(char c, int32_t indent, char outUTF8[MAX_EXP_CHA
// Otherwise, just return the character
//*outStr = c; // deprecated
convertIsoToUtf8(EDN_CHARSET_ISO_8859_15, c, outUTF8);
convertIsoToUtf8(unicode::EDN_CHARSET_ISO_8859_15, c, outUTF8);
return 1;
}

View File

@@ -34,7 +34,7 @@ class EdnBuf;
#include <EdnVectorBuf.h>
#include <EdnBufHistory.h>
#include <HighlightManager.h>
#include <charset.h>
#include <etk/unicode.h>
/*
@@ -68,7 +68,6 @@ typedef enum{
typedef struct {
etk::VectorType<colorInformation_ts> HLData;
int32_t idSequence;
int32_t posHLPass1;
int32_t posHLPass2;
}displayHLData_ts;
@@ -76,6 +75,7 @@ typedef struct {
class EdnBuf {
// TODO : Set an iterator to acces at every data without knowin the system ...
public:
// constructer
EdnBuf(void);
@@ -100,8 +100,9 @@ class EdnBuf {
int32_t StartOfLine( int32_t pos);
int32_t EndOfLine( int32_t pos);
int32_t GetExpandedChar( int32_t &pos, int32_t indent, uniChar_t outUnicode[MAX_EXP_CHAR_LEN], uint32_t &currentChar);
int32_t GetExpandedChar( int32_t &pos, int32_t indent, char outUTF8[MAX_EXP_CHAR_LEN], uint32_t &currentChar);
int32_t ExpandCharacter( char c, int32_t indent, char outUTF8[MAX_EXP_CHAR_LEN]); // TODO : rework this
int32_t ExpandCharacter( char c, int32_t indent, char outUTF8[MAX_EXP_CHAR_LEN]); // TODO : Remove
int32_t CharWidth( char c, int32_t indent); // TODO : rework this
int32_t CountDispChars( int32_t lineStartPos, int32_t targetPos);
int32_t CountForwardDispChars( int32_t lineStartPos, int32_t nChars);
@@ -157,7 +158,6 @@ class EdnBuf {
private:
Highlight * m_Highlight; //!< internal link with the Highlight system
etk::VectorType<colorInformation_ts> m_HLDataPass1; //!< colorisation position in the current buffer pass 1
int32_t m_HLDataSequence; //!< position of the start of line requested by the screen viewer
void RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdded);
void GenerateHighLightAt(int32_t pos, int32_t endPos, int32_t addinPos=0);
void CleanHighLight(void);
@@ -180,14 +180,14 @@ class EdnBuf {
public:
int32_t GetTabDistance(void) { return m_tabDist; } ;
void SetTabDistance(int32_t tabDist) { m_tabDist = tabDist; };
charset_te GetCharsetType(void) { return m_charsetType; };
void SetCharsetType(charset_te newOne) { m_charsetType = newOne; if (EDN_CHARSET_UTF8==newOne){m_isUtf8=true;} else {m_isUtf8=false;} };
unicode::charset_te GetCharsetType(void) { return m_charsetType; };
void SetCharsetType(unicode::charset_te newOne) { m_charsetType = newOne; if (unicode::EDN_CHARSET_UTF8==newOne){m_isUtf8=true;} else {m_isUtf8=false;} };
bool GetUTF8Mode(void) { return m_isUtf8; };
void SetUTF8Mode(bool newOne) { m_isUtf8 = newOne; m_charsetType=EDN_CHARSET_UTF8; };
void SetUTF8Mode(bool newOne) { m_isUtf8 = newOne; m_charsetType=unicode::EDN_CHARSET_UTF8; };
private:
// Special mode of the buffer :
bool m_isUtf8; //!< true if we are in UTF8 mode ==> if true the size of a char is 0, otherwise .. 1->4 ( TODO : not now)
charset_te m_charsetType; //!< if UTF8 mode is at false : the charset type of the buffer
unicode::charset_te m_charsetType; //!< if UTF8 mode is at false : the charset type of the buffer
// Local Tabulation policies
int32_t m_tabDist; //!< equiv. number of characters in a tab
bool m_useTabs; //!< True if buffer routines are allowed to use tabs for padding in rectangular operations

View File

@@ -46,9 +46,6 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
//GTimeVal timeStart;
//g_get_current_time(&timeStart);
// remove display HL...
m_HLDataSequence++;
// prevent ERROR...
if (NULL == m_Highlight) {
return;
@@ -287,7 +284,6 @@ colorInformation_ts *EdnBuf::GetElementColorAtPosition(int32_t pos, int32_t &sta
}
void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart, int32_t nbLines)
{
MData.posHLPass1 = 0;
@@ -295,10 +291,8 @@ void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart,
if (NULL == m_Highlight) {
return;
}
if (MData.idSequence != m_HLDataSequence) {
//GTimeVal timeStart;
//g_get_current_time(&timeStart);
MData.idSequence = m_HLDataSequence;
HLStart = StartOfLine(HLStart);
MData.HLData.Clear();
int32_t HLStop = CountForwardNLines(HLStart, nbLines);
@@ -353,7 +347,6 @@ void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart,
//GTimeVal timeStop;
//g_get_current_time(&timeStop);
//EDN_DEBUG("Display reAnnalyse = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s");
}
}

View File

@@ -58,7 +58,7 @@ bool EdnBuf::SelectHasSelection(selectionType_te select)
*/
void EdnBuf::Select(selectionType_te select, int32_t start, int32_t end)
{
selection oldSelection = m_selectionList[select];
//selection oldSelection = m_selectionList[select];
m_selectionList[select].selected = start != end;
m_selectionList[select].zeroWidth = (start == end) ? true : false;
m_selectionList[select].rectangular = false;
@@ -77,7 +77,7 @@ void EdnBuf::Select(selectionType_te select, int32_t start, int32_t end)
*/
void EdnBuf::Unselect(selectionType_te select)
{
selection oldSelection = m_selectionList[select];
//selection oldSelection = m_selectionList[select];
m_selectionList[select].selected = false;
m_selectionList[select].zeroWidth = false;
}

View File

@@ -27,260 +27,51 @@
#include <tools_globals.h>
#include <MsgBroadcast.h>
#undef __class__
#define __class__ "MsgBroadcast"
// new list of edn event generic :
////////////////////////////////////////////////////////////////////////
// Event of the gui request something :
////////////////////////////////////////////////////////////////////////
extern const char* const ednMsgGuiNew = "edn-Msg-Gui-New";
extern const char* const ednMsgGuiOpen = "edn-Msg-Gui-Open";
extern const char* const ednMsgGuiClose = "edn-Msg-Gui-Close";
extern const char* const ednMsgGuiSave = "edn-Msg-Gui-Save";
extern const char* const ednMsgGuiSaveAs = "edn-Msg-Gui-SaveAs";
extern const char* const ednMsgGuiUndo = "edn-Msg-Gui-Undo";
extern const char* const ednMsgGuiRedo = "edn-Msg-Gui-Redo";
extern const char* const ednMsgGuiCopy = "edn-Msg-Gui-Copy";
extern const char* const ednMsgGuiCut = "edn-Msg-Gui-Cut";
extern const char* const ednMsgGuiPaste = "edn-Msg-Gui-Paste";
extern const char* const ednMsgGuiRm = "edn-Msg-Gui-Rm";
extern const char* const ednMsgGuiSelect = "edn-Msg-Gui-Select";
extern const char* const ednMsgGuiGotoLine = "edn-Msg-Gui-GotoLine";
extern const char* const ednMsgGuiSearch = "edn-Msg-Gui-Search";
extern const char* const ednMsgGuiReplace = "edn-Msg-Gui-Replace";
extern const char* const ednMsgGuiFind = "edn-Msg-Gui-Find";
extern const char* const ednMsgGuiChangeColor = "edn-Msg-Gui-ChangeColor";
extern const char* const ednMsgGuiChangeCharset = "edn-Msg-Gui-ChangeCharset";
extern const char* const ednMsgGuiShowSpaces = "edn-Msg-Gui-ShowSpaces";
extern const char* const ednMsgGuiShowEndOfLine = "edn-Msg-Gui-ShowEndOfLine";
extern const char* const ednMsgGuiCtags = "edn-Msg-Gui-CTags";
extern const char* const ednMsgGuiAbout = "edn-Msg-Gui-About";
MsgBroadcast::MsgBroadcast(const char * className, messageCat_te cat)
{
m_messageSystem = MsgBroadcastCore::Get();
m_className = className;
m_cat = cat;
// add on listner
m_messageSystem->AddReceiver(this);
}
////////////////////////////////////////////////////////////////////////
// Event internal :
////////////////////////////////////////////////////////////////////////
extern const char* const ednMsgBufferState = "edn-Msg-Buffer-State";
extern const char* const ednMsgBufferName = "edn-Msg-Buffer-Name";
extern const char* const ednMsgBufferId = "edn-Msg-Buffer-Id";
extern const char* const ednMsgCodeViewSelectedId = "edn-Msg-CodeView-Select-Id";
extern const char* const ednMsgOpenFile = "edn-Msg-OpenFile";
MsgBroadcast::~MsgBroadcast(void)
{
m_messageSystem->RmReceiver(this);
m_messageSystem = NULL;
}
extern const char* const ednMsgBufferListChange = "edn-Msg-BufferListChange";
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);
}
extern const char* const ednMsgBufferColor = "edn-Msg-Buffer-Color";
#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::Get()->SendMessage(NULL, id, dataID);
}

View File

@@ -27,186 +27,55 @@
#define __MSG_BROADCAST_H__
#include <tools_debug.h>
#include <etk/Singleton.h>
#include <etk/String.h>
// new list of edn event generic :
////////////////////////////////////////////////////////////////////////
// Event of the gui request something :
////////////////////////////////////////////////////////////////////////
extern const char* const ednMsgGuiNew; // data : ""
extern const char* const ednMsgGuiOpen; // data : ""
extern const char* const ednMsgGuiClose; // data : "current" "All"
extern const char* const ednMsgGuiSave; // data : ""
extern const char* const ednMsgGuiSaveAs; // data : ""
// broadCast Message
extern const char* const ednMsgGuiUndo; // data : ""
extern const char* const ednMsgGuiRedo; // data : ""
extern const char* const ednMsgGuiCopy; // data : "STD" "Middle" "1" ... "9"
extern const char* const ednMsgGuiCut; // data : "STD" "Middle" "1" ... "9"
extern const char* const ednMsgGuiPaste; // data : "STD" "Middle" "1" ... "9"
extern const char* const ednMsgGuiRm; // data : "Word" "Line" "Paragraph"
extern const char* const ednMsgGuiSelect; // data : "ALL" "NONE"
extern const char* const ednMsgGuiGotoLine; // data : "???" / "1" ... "999999999999"
// 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
extern const char* const ednMsgGuiSearch; // data : ""
extern const char* const ednMsgGuiReplace; // data : ""
extern const char* const ednMsgGuiFind; // data : "Next" "Previous"
// 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,
extern const char* const ednMsgGuiChangeColor; // data : "Black" "White"
extern const char* const ednMsgGuiChangeCharset; // data : "UTF-8" "ISO-8859-1" "ISO-8859-15"
extern const char* const ednMsgGuiShowSpaces; // data : "enable" "disable"
extern const char* const ednMsgGuiShowEndOfLine; // data : "enable" "disable"
// 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,
extern const char* const ednMsgGuiCtags; // data : "Load" "ReLoad" "Jump" "Back"
// 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,
extern const char* const ednMsgGuiAbout; // data : ""
// 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,
////////////////////////////////////////////////////////////////////////
// Event internal :
////////////////////////////////////////////////////////////////////////
extern const char* const ednMsgBufferState; // data : "Saved" "Modify" "HasHistory" "HasNotHistory" "HasFutureHistory" "HasNotFutureHistory"
extern const char* const ednMsgBufferName; // data : "filename"
extern const char* const ednMsgBufferId; // data : "0" ... "99999999999"
extern const char* const ednMsgCodeViewSelectedId; // data : "0" ... "99999999999"
extern const char* const ednMsgOpenFile; // data : "/Compleate/file/name.xx"
// DESTINATION : context popup ...
MSG_TO_CONTEXT__START,
MSG_TO_CONTEXT__STOP,
extern const char* const ednMsgBufferListChange; // data : ""
// DESTINATION : highlight system ...
MSG_TO_HL__START,
EDN_MSG__COLOR_HAS_CHANGE,
MSG_TO_HL__STOP,
extern const char* const ednMsgBufferColor; // data : "new"
// 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:
etk::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);
etk::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 etk::Singleton<MsgBroadcastCore>
{
friend class etk::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:
etk::VectorType<MsgBroadcast*> m_listMessage;
uint32_t m_messageID;
etk::VectorType<messageElement_ts> m_listOfMessage;
};
void GeneralSendMessage(messageType_te id, int32_t dataID = -1);
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -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 <etk/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, etk::VectorType<char>& input_ISO, etk::VectorType<int32_t>& output_Unicode);
int32_t convertUnicodeToIso(charset_te inputCharset, etk::VectorType<int32_t>& input_Unicode, etk::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( etk::VectorType<int32_t>& input_Unicode, etk::VectorType<char>& output_UTF8);
int32_t convertUtf8ToUnicode( etk::VectorType<char>& input_UTF8, etk::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, etk::VectorType<char>& input_ISO, etk::VectorType<char>& output_UTF8);
int32_t convertUtf8ToIso( charset_te inputCharset, etk::VectorType<char>& input_UTF8, etk::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

View File

@@ -1,300 +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
};
}

View File

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

View File

@@ -26,6 +26,7 @@
#include <tools_globals.h>
#include <ColorizeManager.h>
#include <MsgBroadcast.h>
#include <ewol/WidgetMessageMultiCast.h>
#undef __class__
#define __class__ "globals"
@@ -54,7 +55,7 @@ void globals::SetDisplayEndOfLine(bool newVal)
{
EDN_INFO("Set EndOfLine " << newVal);
displayEOL = newVal;
GeneralSendMessage(EDN_MSG__REFRESH_DISPLAY);
//ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
}
// -----------------------------------------------------------
@@ -68,7 +69,7 @@ void globals::SetDisplaySpaceChar(bool newVal)
{
EDN_INFO("Set SpaceChar " << newVal);
displaySpaceChar = newVal;
GeneralSendMessage(EDN_MSG__REFRESH_DISPLAY);
//ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
}

View File

@@ -27,9 +27,7 @@ FILE_LIST+= edn/tools/EdnTemplate/EdnVectorBuf.cpp \
FILE_LIST+= edn/tools/Display/Display.cpp \
edn/tools/ClipBoard/ClipBoard.cpp \
edn/tools/MsgBroadcast/MsgBroadcast.cpp \
edn/tools/MsgBroadcast/AccelKey.cpp \
edn/tools/charset/charsetTable.cpp \
edn/tools/charset/charset.cpp
edn/tools/MsgBroadcast/AccelKey.cpp
# Gui:
FILE_LIST+= edn/CustumWidget/BufferView/BufferView.cpp \

10
local.properties Normal file
View File

@@ -0,0 +1,10 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked in Version Control Systems,
# as it contains information specific to your local configuration.
# location of the SDK. This is only used by Ant
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=/home/heero/dev/perso/android/sdk-r15

40
proguard.cfg Normal file
View File

@@ -0,0 +1,40 @@
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

11
project.properties Normal file
View File

@@ -0,0 +1,11 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=Google Inc.:Google APIs:13

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB