Compare commits
49 Commits
Author | SHA1 | Date | |
---|---|---|---|
188bd69f06 | |||
0ab5588a93 | |||
df3c97b17e | |||
03cb9d7cbd | |||
c8b9b37c8e | |||
75f56d52d4 | |||
f6f8679b76 | |||
ae113a8a2f | |||
45f37a0c4b | |||
02e7de2397 | |||
ea344225e3 | |||
40d6de087b | |||
7bf7668686 | |||
e2e0fc25d3 | |||
9f2718f97a | |||
a943ddd4f7 | |||
fced6df123 | |||
a4d314723d | |||
f716055c40 | |||
0a11251ccc | |||
0d0afec709 | |||
1894f56217 | |||
4e7491e5fc | |||
dc73285cb7 | |||
5d7870248d | |||
4b16540744 | |||
f0cda0de78 | |||
e21e7e7c21 | |||
cd84475aea | |||
71fa38d61e | |||
fdd4ddf978 | |||
f610c23638 | |||
610afddc9d | |||
4038dd74af | |||
8ba3e2e3d4 | |||
7734a8ce36 | |||
d088866891 | |||
0341795cbb | |||
9e0720b476 | |||
8bce8893e8 | |||
d2cb4a47b7 | |||
65b288813e | |||
7bad5d42f2 | |||
fda95289bd | |||
102e11b74a | |||
ee80871434 | |||
43c3092fe3 | |||
d05d82ba7b | |||
6052df85dc |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -4,9 +4,14 @@
|
||||
###################################
|
||||
CVS
|
||||
.svn
|
||||
.gitk-tmp.*
|
||||
Object/
|
||||
doxygen/API/
|
||||
doxygen/ALL/
|
||||
bin/
|
||||
gen/
|
||||
linux/
|
||||
obj/
|
||||
|
||||
###################################
|
||||
# backup files
|
||||
|
22
AndroidManifest.xml
Normal file
22
AndroidManifest.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.heeroyui.ednpackage"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
<application android:label="Edn"
|
||||
android:icon="@drawable/ic_luncher_edn">
|
||||
<!--android:hasCode="false"-->
|
||||
<!-- classpath-->
|
||||
<activity android:name=".edn"
|
||||
android:label="Edn Text-Editor"
|
||||
android:icon="@drawable/ic_luncher_edn"
|
||||
android:configChanges="orientation">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
<uses-sdk android:minSdkVersion="4" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
</manifest>
|
2
Application.mk
Normal file
2
Application.mk
Normal file
@@ -0,0 +1,2 @@
|
||||
APP_BUILD_SCRIPT=$PROJECT/Sources/Android.mk
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.0 MiB |
@@ -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) # +
|
BIN
assets/Font/freefont/FreeSans.ttf
Normal file
BIN
assets/Font/freefont/FreeSans.ttf
Normal file
Binary file not shown.
BIN
assets/Font/freefont/FreeSansBold.ttf
Normal file
BIN
assets/Font/freefont/FreeSansBold.ttf
Normal file
Binary file not shown.
BIN
assets/Font/freefont/FreeSansBoldOblique.ttf
Normal file
BIN
assets/Font/freefont/FreeSansBoldOblique.ttf
Normal file
Binary file not shown.
BIN
assets/Font/freefont/FreeSansOblique.ttf
Normal file
BIN
assets/Font/freefont/FreeSansOblique.ttf
Normal file
Binary file not shown.
BIN
assets/Font/freefont/FreeSerif.ttf
Normal file
BIN
assets/Font/freefont/FreeSerif.ttf
Normal file
Binary file not shown.
BIN
assets/Font/freefont/FreeSerifBold.ttf
Normal file
BIN
assets/Font/freefont/FreeSerifBold.ttf
Normal file
Binary file not shown.
BIN
assets/Font/freefont/FreeSerifBoldItalic.ttf
Normal file
BIN
assets/Font/freefont/FreeSerifBoldItalic.ttf
Normal file
Binary file not shown.
BIN
assets/Font/freefont/FreeSerifItalic.ttf
Normal file
BIN
assets/Font/freefont/FreeSerifItalic.ttf
Normal file
Binary file not shown.
@@ -1,4 +1,14 @@
|
||||
# action a faire (ordonner par r<>vision) :
|
||||
|
||||
dans la liste des truc important a refaire
|
||||
retirer tout les singleton ==> passer par des namespace ==> fonctionnera mieux ...
|
||||
finir de netoyer la classe widget
|
||||
netoyer les classe text ...
|
||||
mettre en pla ce le repositionnement automatique quand on change de buffer
|
||||
Curseur au bon endroit
|
||||
|
||||
|
||||
|
||||
* 0.2.X :
|
||||
- gui : Amelioration du full-screen et du display de base (sans l'entete de la fenetre)
|
||||
- gui : Mise en place d'un display ligne par ligne
|
||||
|
85
build.xml
Normal file
85
build.xml
Normal file
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="edn" default="help">
|
||||
|
||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||
It contains the path to the SDK. It should *NOT* be checked into
|
||||
Version Control Systems. -->
|
||||
<loadproperties srcFile="local.properties" />
|
||||
|
||||
<!-- The ant.properties file can be created by you. It is only edited by the
|
||||
'android' tool to add properties to it.
|
||||
This is the place to change some Ant specific build properties.
|
||||
Here are some properties you may want to change/update:
|
||||
|
||||
source.dir
|
||||
The name of the source directory. Default is 'src'.
|
||||
out.dir
|
||||
The name of the output directory. Default is 'bin'.
|
||||
|
||||
For other overridable properties, look at the beginning of the rules
|
||||
files in the SDK, at tools/ant/build.xml
|
||||
|
||||
Properties related to the SDK location or the project target should
|
||||
be updated using the 'android' tool with the 'update' action.
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems.
|
||||
|
||||
-->
|
||||
<property file="ant.properties" />
|
||||
|
||||
<!-- The project.properties file is created and updated by the 'android'
|
||||
tool, as well as ADT.
|
||||
|
||||
This contains project specific properties such as project target, and library
|
||||
dependencies. Lower level build properties are stored in ant.properties
|
||||
(or in .classpath for Eclipse projects).
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems. -->
|
||||
<loadproperties srcFile="project.properties" />
|
||||
|
||||
<!-- quick check on sdk.dir -->
|
||||
<fail
|
||||
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
|
||||
unless="sdk.dir"
|
||||
/>
|
||||
|
||||
|
||||
<!-- extension targets. Uncomment the ones where you want to do custom work
|
||||
in between standard targets -->
|
||||
<!--
|
||||
<target name="-pre-build">
|
||||
</target>
|
||||
<target name="-pre-compile">
|
||||
</target>
|
||||
|
||||
/* This is typically used for code obfuscation.
|
||||
Compiled code location: ${out.classes.absolute.dir}
|
||||
If this is not done in place, override ${out.dex.input.absolute.dir} */
|
||||
<target name="-post-compile">
|
||||
</target>
|
||||
-->
|
||||
|
||||
<!-- Import the actual build file.
|
||||
|
||||
To customize existing targets, there are two options:
|
||||
- Customize only one target:
|
||||
- copy/paste the target into this file, *before* the
|
||||
<import> task.
|
||||
- customize it to your needs.
|
||||
- Customize the whole content of build.xml
|
||||
- copy/paste the content of the rules files (minus the top node)
|
||||
into this file, replacing the <import> task.
|
||||
- customize to your needs.
|
||||
|
||||
***********************
|
||||
****** IMPORTANT ******
|
||||
***********************
|
||||
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
|
||||
in order to avoid having your file be overridden by tools such as "android update project"
|
||||
-->
|
||||
<!-- version-tag: 1 -->
|
||||
<import file="${sdk.dir}/tools/ant/build.xml" />
|
||||
|
||||
</project>
|
@@ -2,19 +2,28 @@ 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 \
|
||||
-D__MODE__Touch \
|
||||
-DEWOL_USE_FREE_TYPE \
|
||||
-DETK_DEBUG_LEVEL=3 \
|
||||
-DEDN_DEBUG_LEVEL=3 \
|
||||
-DDATA_IN_APK \
|
||||
-frtti
|
||||
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
NDK_MODULE_PATH := $(LOCAL_PATH)/../../
|
||||
|
@@ -6,15 +6,18 @@ 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 \
|
||||
-DEDN_DEBUG_LEVEL=3
|
||||
LOCAL_CFLAGS := -D__PLATFORM__Linux \
|
||||
-DEWOL_USE_FREE_TYPE \
|
||||
-DEDN_DEBUG_LEVEL=3
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include <tools_globals.h>
|
||||
#include <Buffer.h>
|
||||
#include <BufferManager.h>
|
||||
#include <ewol/EObject.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "Buffer"
|
||||
@@ -44,7 +45,7 @@ Buffer::Buffer()
|
||||
static int32_t fileBasicID = 0;
|
||||
m_fileModify = true;
|
||||
m_haveName = false;
|
||||
etk::String mString = "Untitle - ";
|
||||
etk::UString mString = "Untitle - ";
|
||||
mString += fileBasicID++;
|
||||
SetFileName(mString);
|
||||
m_haveName = false;
|
||||
@@ -93,7 +94,9 @@ void Buffer::SetModify(bool status)
|
||||
{
|
||||
if (status != m_fileModify) {
|
||||
m_fileModify = status;
|
||||
GeneralSendMessage(EDN_MSG__BUFFER_CHANGE_MODIFY);
|
||||
// TODO : Remove from here
|
||||
etk::UString data = "Modify";
|
||||
ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgBufferState, data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +149,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;
|
||||
}
|
||||
@@ -161,7 +168,7 @@ int32_t Buffer::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColor
|
||||
* @todo : Set the move up and DOWN...
|
||||
*
|
||||
*/
|
||||
void Buffer::MouseSelectFromCursorTo(int32_t width, int32_t height)
|
||||
void Buffer::MouseSelectFromCursorTo(int32_t fontId, int32_t width, int32_t height)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
@@ -176,7 +183,7 @@ void Buffer::MouseSelectFromCursorTo(int32_t width, int32_t height)
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void Buffer::MouseEvent(int32_t width, int32_t height)
|
||||
void Buffer::MouseEvent(int32_t fontId, int32_t width, int32_t height)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
@@ -208,49 +215,6 @@ void Buffer::MouseEventTriple(void)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void Buffer::ScrollDown(void)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void Buffer::ScrollUp(void)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void Buffer::ForceReDraw(bool allElement)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Buffer::cursorMove(ewol::eventKbMoveType_te moveTypeEvent)
|
||||
{
|
||||
// nothing to do
|
||||
@@ -264,22 +228,22 @@ void Buffer::cursorMove(ewol::eventKbMoveType_te moveTypeEvent)
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void Buffer::AddChar(char * UTF8data)
|
||||
void Buffer::AddChar(uniChar_t unicodeData)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
void Buffer::Search(etk::String &data, bool back, bool caseSensitive, bool wrap, bool regExp)
|
||||
void Buffer::Search(etk::UString &data, bool back, bool caseSensitive, bool wrap, bool regExp)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
void Buffer::Replace(etk::String &data)
|
||||
void Buffer::Replace(etk::UString &data)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
int32_t Buffer::FindLine(etk::String &data)
|
||||
int32_t Buffer::FindLine(etk::UString &data)
|
||||
{
|
||||
// nothing to do
|
||||
return 0;
|
||||
|
@@ -26,10 +26,10 @@
|
||||
#ifndef __BUFFER_H__
|
||||
#define __BUFFER_H__
|
||||
|
||||
#include <etk/String.h>
|
||||
#include <etk/UString.h>
|
||||
#include <etk/File.h>
|
||||
#include <Display.h>
|
||||
#include <charset.h>
|
||||
#include <etk/unicode.h>
|
||||
#include <ewol/ewol.h>
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ class Buffer {
|
||||
NameChange();
|
||||
};
|
||||
|
||||
void SetFileName(etk::String &newName)
|
||||
void SetFileName(etk::UString &newName)
|
||||
{
|
||||
m_fileName.SetCompleateName(newName, etk::FILE_TYPE_DIRECT);
|
||||
m_haveName = true;
|
||||
@@ -82,33 +82,36 @@ 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 void ForceReDraw(bool allElement);
|
||||
virtual void AddChar(char * UTF8data);
|
||||
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 AddChar(uniChar_t unicodeData);
|
||||
virtual void cursorMove(ewol::eventKbMoveType_te moveTypeEvent);
|
||||
virtual void MouseSelectFromCursorTo(int32_t width, int32_t height);
|
||||
virtual void MouseEvent(int32_t width, int32_t height);
|
||||
virtual void MouseSelectFromCursorTo(int32_t fontId, int32_t width, int32_t height);
|
||||
virtual void MouseEvent(int32_t fontId, int32_t width, int32_t height);
|
||||
virtual void MouseEventDouble(void);
|
||||
virtual void MouseEventTriple(void);
|
||||
virtual void ScrollDown(void);
|
||||
virtual void ScrollUp(void);
|
||||
virtual void RemoveLine(void);
|
||||
virtual void SelectAll(void);
|
||||
virtual void SelectNone(void);
|
||||
virtual void Undo(void);
|
||||
virtual void Redo(void);
|
||||
virtual void SetCharset(charset_te newCharset) {};
|
||||
virtual void SetCharset(unicode::charset_te newCharset) {};
|
||||
|
||||
//virtual void SelectAll(void);
|
||||
virtual void Copy(int8_t clipboardID);
|
||||
virtual void Cut(int8_t clipboardID);
|
||||
virtual void Paste(int8_t clipboardID);
|
||||
virtual void Search(etk::String &data, bool back, bool caseSensitive, bool wrap, bool regExp);
|
||||
virtual void Replace(etk::String &data);
|
||||
virtual int32_t FindLine(etk::String &data);
|
||||
virtual void Search(etk::UString &data, bool back, bool caseSensitive, bool wrap, bool regExp);
|
||||
virtual void Replace(etk::UString &data);
|
||||
virtual int32_t FindLine(etk::UString &data);
|
||||
virtual void JumpAtLine(int32_t newLine);
|
||||
virtual int32_t GetCurrentLine(void);
|
||||
|
||||
virtual int32_t GetNumberOfLine(void) { return 1; };
|
||||
|
||||
protected:
|
||||
bool m_fileModify; //!<
|
||||
// naming
|
||||
|
@@ -67,30 +67,32 @@ 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 :
|
||||
Colorize *myColor = NULL;
|
||||
//drawer.Flush();
|
||||
|
||||
int32_t fontId = OOTextNormal.GetFontID();
|
||||
int32_t letterHeight = ewol::GetHeight(fontId);
|
||||
|
||||
if (NULL == OOText) {
|
||||
EDN_ERROR("Input VALUE is NULL");
|
||||
return ERR_FAIL;
|
||||
}
|
||||
if (NULL == OOColored) {
|
||||
EDN_ERROR("Input VALUE is NULL");
|
||||
return ERR_FAIL;
|
||||
}
|
||||
coord2D_ts textPos;
|
||||
textPos.x = 20;
|
||||
textPos.y = 20;
|
||||
|
||||
myColor = myColorManager->Get("normal");
|
||||
OOText->SetColor(myColor->GetFG());
|
||||
OOText->TextAdd(20, 20, "edn - Editeur De N'ours, l'Editeur Desoxyribo-Nucleique", sizeX);
|
||||
myColor = ColorizeManager::Get("normal");
|
||||
OOTextBold.SetColor(myColor->GetFG());
|
||||
etk::UString tmpDisplay = "edn - Editeur De N'ours";
|
||||
OOTextBold.Text(textPos, tmpDisplay);
|
||||
|
||||
myColor = myColorManager->Get("commentDoxygen");
|
||||
OOText->SetColor(myColor->GetFG());
|
||||
OOText->TextAdd(20, 50, "No Buffer Availlable to display", sizeX);
|
||||
myColor = ColorizeManager::Get("commentDoxygen");
|
||||
OOTextNormal.SetColor(myColor->GetFG());
|
||||
textPos.y = (int32_t)(textPos.y + letterHeight*1.30);
|
||||
tmpDisplay = "No Buffer Availlable to display";
|
||||
OOTextNormal.Text(textPos, tmpDisplay);
|
||||
|
||||
|
||||
color_ts bgColor; //!< Text color
|
||||
@@ -98,8 +100,8 @@ int32_t BufferEmpty::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2D
|
||||
bgColor.green = 1.0;
|
||||
bgColor.blue = 1.0;
|
||||
bgColor.alpha = 1.0;
|
||||
OOColored->SetColor(bgColor);
|
||||
OOColored->Rectangle( 0, 0, sizeX, sizeY);
|
||||
OOColored.SetColor(bgColor);
|
||||
OOColored.Rectangle( 0, 0, sizeX, sizeY);
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
@@ -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);
|
||||
|
||||
};
|
||||
|
||||
|
@@ -27,9 +27,58 @@
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <BufferManager.h>
|
||||
#include <ewol/EObject.h>
|
||||
#include <ewol/EObjectManager.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "BufferManager"
|
||||
#define __class__ "classBufferManager"
|
||||
|
||||
class classBufferManager: public ewol::EObject
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
classBufferManager(void);
|
||||
~classBufferManager(void);
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
||||
* @param[in] CallerObject Pointer on the EObject that information came from
|
||||
* @param[in] eventId Message registered by this class
|
||||
* @param[in] data Data registered by this class
|
||||
* @return ---
|
||||
*/
|
||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
|
||||
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;};
|
||||
Buffer * Get(int32_t BufferID);
|
||||
bool Exist(int32_t BufferID);
|
||||
bool Exist(etk::File &myFile);
|
||||
int32_t GetId(etk::File &myFile);
|
||||
// return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5
|
||||
uint32_t Size(void);
|
||||
uint32_t SizeOpen(void);
|
||||
int32_t WitchBuffer(int32_t iEmeElement);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
etk::VectorType<Buffer*> listBuffer; //!< element List of the char Elements
|
||||
|
||||
void RemoveAll(void); //!< remove all buffer
|
||||
int32_t m_idSelected;
|
||||
Buffer * BufferNotExiste; //!< When an error arrive in get buffer we return the Error buffer (not writable)
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Constructeur
|
||||
/**
|
||||
@@ -40,11 +89,17 @@
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
BufferManager::BufferManager(void) : MsgBroadcast("Buffer Manager", EDN_CAT_BUFFER_MANAGER)
|
||||
classBufferManager::classBufferManager(void)
|
||||
{
|
||||
// nothing to do ...
|
||||
BufferNotExiste = new BufferEmpty();
|
||||
m_idSelected = -1;
|
||||
RegisterMultiCast(ednMsgGuiNew);
|
||||
RegisterMultiCast(ednMsgOpenFile);
|
||||
RegisterMultiCast(ednMsgGuiClose);
|
||||
RegisterMultiCast(ednMsgGuiSave);
|
||||
RegisterMultiCast(ednMsgCodeViewSelectedId);
|
||||
RegisterMultiCast(ednMsgBufferId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,67 +110,159 @@ BufferManager::BufferManager(void) : MsgBroadcast("Buffer Manager", EDN_CAT_BUFF
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
BufferManager::~BufferManager(void)
|
||||
classBufferManager::~classBufferManager(void)
|
||||
{
|
||||
//clean All Buffer
|
||||
EDN_INFO("~BufferManager::RemoveAll();");
|
||||
EDN_INFO("~classBufferManager::RemoveAll();");
|
||||
RemoveAll();
|
||||
// clear The list of Buffer
|
||||
EDN_INFO("~BufferManager::listBuffer.Clear();");
|
||||
EDN_INFO("~classBufferManager::listBuffer.Clear();");
|
||||
listBuffer.Clear();
|
||||
EDN_INFO("~BufferManager::delete(BufferNotExiste);");
|
||||
EDN_INFO("~classBufferManager::delete(BufferNotExiste);");
|
||||
delete(BufferNotExiste);
|
||||
}
|
||||
|
||||
|
||||
void BufferManager::OnMessage(int32_t id, int32_t dataID)
|
||||
/**
|
||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
||||
* @param[in] CallerObject Pointer on the EObject that information came from
|
||||
* @param[in] eventId Message registered by this class
|
||||
* @param[in] data Data registered by this class
|
||||
* @return ---
|
||||
*/
|
||||
void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case EDN_MSG__BUFFER_CHANGE_CURRENT:
|
||||
m_idSelected = dataID;
|
||||
break;
|
||||
case EDN_MSG__NEW:
|
||||
{
|
||||
int32_t newOne = Create();
|
||||
if (-1 != newOne) {
|
||||
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, newOne);
|
||||
}
|
||||
ewol::EObject::OnReceiveMessage(CallerObject, eventId, data);
|
||||
|
||||
if (eventId == ednMsgBufferId) {
|
||||
// select a new buffer ID :
|
||||
if (data == "") {
|
||||
EDN_ERROR("Request select buffer ID = \"\" ");
|
||||
} else {
|
||||
int32_t newID = -1;
|
||||
sscanf(data.Utf8Data(), "%d", &newID);
|
||||
if(true == Exist(newID)) {
|
||||
m_idSelected = newID;
|
||||
} else {
|
||||
m_idSelected = -1;
|
||||
EDN_ERROR("Request a non existant ID : " << newID << " reset to -1...");
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__BUFF_ID_CLOSE:
|
||||
// Check buffer existence
|
||||
if(true == Exist(dataID)) {
|
||||
// Get the new display buffer
|
||||
if (m_idSelected == dataID) {
|
||||
// Try previous buffer
|
||||
int32_t destBuffer = -1;
|
||||
for(int32_t ii=dataID-1; ii >= 0; ii--) {
|
||||
if (true == Exist(ii) ) {
|
||||
destBuffer = ii;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (eventId == ednMsgGuiNew) {
|
||||
int32_t newOne = Create();
|
||||
if (-1 != newOne) {
|
||||
m_idSelected = newOne;
|
||||
SendMultiCast(ednMsgBufferId, m_idSelected);
|
||||
SendMultiCast(ednMsgBufferListChange);
|
||||
}
|
||||
} else if (eventId == ednMsgOpenFile) {
|
||||
if (data != "" ) {
|
||||
etk::File myFile(data, etk::FILE_TYPE_DIRECT);
|
||||
int32_t newOne = Open(myFile);
|
||||
if (-1 != newOne) {
|
||||
m_idSelected = newOne;
|
||||
SendMultiCast(ednMsgBufferId, m_idSelected);
|
||||
SendMultiCast(ednMsgBufferListChange);
|
||||
}
|
||||
}
|
||||
} else if (eventId == ednMsgGuiSave) {
|
||||
if (data == "") {
|
||||
EDN_ERROR("Null data for close file ... ");
|
||||
} else {
|
||||
if (data == "current") {
|
||||
// Check buffer existence
|
||||
if(true == Exist(m_idSelected)) {
|
||||
// If no name ==> request a Gui display ...
|
||||
if (Get(m_idSelected)->HaveName() == false) {
|
||||
SendMultiCast(ednMsgGuiSaveAs, "current");
|
||||
} else {
|
||||
Get(m_idSelected)->Save();
|
||||
}
|
||||
//EDN_DEBUG("new buffer selected : ?? " << destBuffer);
|
||||
// try next buffer
|
||||
if (-1 == destBuffer) {
|
||||
for(int32_t ii=dataID+1; ii < listBuffer.Size(); ii++) {
|
||||
}
|
||||
} else {
|
||||
int32_t newId;
|
||||
sscanf(data.Utf8Data(), "%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) {
|
||||
SendMultiCast(ednMsgGuiSaveAs, newId);
|
||||
} else {
|
||||
Get(m_idSelected)->Save();
|
||||
}
|
||||
}
|
||||
SendMultiCast(ednMsgBufferState, "saved");
|
||||
}
|
||||
}
|
||||
} else if (eventId == ednMsgGuiClose) {
|
||||
if (data == "") {
|
||||
EDN_ERROR("Null data for close file ... ");
|
||||
} else {
|
||||
if (data == "All") {
|
||||
|
||||
} else {
|
||||
int32_t closeID = -1;
|
||||
if (data == "current") {
|
||||
closeID = m_idSelected;
|
||||
EDN_DEBUG("Close specific buffer ID" << closeID);
|
||||
} else {
|
||||
// close specific buffer ...
|
||||
sscanf(data.Utf8Data(), "%d", &closeID);
|
||||
EDN_DEBUG("Close specific buffer ID="<< closeID);
|
||||
}
|
||||
if(true == Exist(closeID)) {
|
||||
// Get the new display buffer
|
||||
if (m_idSelected == closeID) {
|
||||
// Try previous buffer
|
||||
int32_t destBuffer = -1;
|
||||
for(int32_t ii=closeID-1; ii >= 0; ii--) {
|
||||
if (true == Exist(ii) ) {
|
||||
destBuffer = ii;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// try next buffer
|
||||
if (-1 == destBuffer) {
|
||||
for(int32_t ii=closeID+1; ii < listBuffer.Size(); ii++) {
|
||||
if (true == Exist(ii) ) {
|
||||
destBuffer = ii;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// set it to the currect display
|
||||
SendMultiCast(ednMsgBufferId, destBuffer);
|
||||
m_idSelected = destBuffer;
|
||||
}
|
||||
//EDN_DEBUG("new buffer selected : ?? " << destBuffer);
|
||||
// set it to the currect display
|
||||
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, destBuffer);
|
||||
// Remove requested buffer
|
||||
Remove(closeID);
|
||||
SendMultiCast(ednMsgBufferListChange);
|
||||
} else {
|
||||
EDN_ERROR("Request Close of a non existant ID : " << closeID);
|
||||
}
|
||||
//EDN_DEBUG("Remove : " << dataID);
|
||||
// Remove requested buffer
|
||||
Remove(dataID);
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__BUFF_ID_SAVE:
|
||||
}
|
||||
} else if (eventId == ednMsgCodeViewSelectedId) {
|
||||
//Change the selected buffer
|
||||
if (data == "") {
|
||||
EDN_ERROR("Null data for changing buffer ID file ... ");
|
||||
} else {
|
||||
int32_t newId;
|
||||
sscanf(data.Utf8Data(), "%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;
|
||||
}
|
||||
SendMultiCast(ednMsgBufferId, m_idSelected);
|
||||
SendMultiCast(ednMsgBufferListChange);
|
||||
}
|
||||
}
|
||||
/*
|
||||
switch (id)
|
||||
{
|
||||
// Check buffer existence
|
||||
if(true == Exist(dataID)) {
|
||||
// If no name ==> request a Gui display ...
|
||||
@@ -127,6 +274,7 @@ void BufferManager::OnMessage(int32_t id, int32_t dataID)
|
||||
}
|
||||
break;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@@ -143,13 +291,13 @@ void BufferManager::OnMessage(int32_t id, int32_t dataID)
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
void BufferManager::RemoveAll(void)
|
||||
void classBufferManager::RemoveAll(void)
|
||||
{
|
||||
int32_t i;
|
||||
for (i=0; i<listBuffer.Size(); i++) {
|
||||
Remove(i);
|
||||
}
|
||||
SendMessage(EDN_MSG__BUFFER_REMOVE_ALL);
|
||||
SendMultiCast(ednMsgGuiClose, "All");
|
||||
}
|
||||
|
||||
|
||||
@@ -162,14 +310,13 @@ void BufferManager::RemoveAll(void)
|
||||
* @return The ID of the curent buffer where the file is loaded
|
||||
*
|
||||
*/
|
||||
int32_t BufferManager::Create(void)
|
||||
int32_t classBufferManager::Create(void)
|
||||
{
|
||||
// allocate a new Buffer
|
||||
Buffer *myBuffer = new BufferText();
|
||||
// Add at the list of element
|
||||
listBuffer.PushBack(myBuffer);
|
||||
int32_t basicID = listBuffer.Size() - 1;
|
||||
SendMessage(EDN_MSG__BUFFER_ADD, basicID);
|
||||
return basicID;
|
||||
}
|
||||
|
||||
@@ -184,21 +331,19 @@ int32_t BufferManager::Create(void)
|
||||
* @todo : check if this file is not curently open and return the old ID
|
||||
*
|
||||
*/
|
||||
int32_t BufferManager::Open(etk::File &myFile)
|
||||
int32_t classBufferManager::Open(etk::File &myFile)
|
||||
{
|
||||
// TODO : Check here if the file is already open ==> and display it if needed
|
||||
// allocate a new Buffer
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Buffer * BufferManager::Get(int32_t BufferID)
|
||||
Buffer * classBufferManager::Get(int32_t BufferID)
|
||||
{
|
||||
// possible special case : -1;
|
||||
if (-1 >= BufferID) {
|
||||
@@ -219,7 +364,7 @@ Buffer * BufferManager::Get(int32_t BufferID)
|
||||
}
|
||||
|
||||
|
||||
bool BufferManager::Exist(int32_t BufferID)
|
||||
bool classBufferManager::Exist(int32_t BufferID)
|
||||
{
|
||||
if (-1 >= BufferID) {
|
||||
return false;
|
||||
@@ -235,7 +380,7 @@ bool BufferManager::Exist(int32_t BufferID)
|
||||
}
|
||||
|
||||
|
||||
bool BufferManager::Exist(etk::File &myFile )
|
||||
bool classBufferManager::Exist(etk::File &myFile )
|
||||
{
|
||||
if (-1 == GetId(myFile)) {
|
||||
return false;
|
||||
@@ -244,7 +389,7 @@ bool BufferManager::Exist(etk::File &myFile )
|
||||
}
|
||||
|
||||
|
||||
int32_t BufferManager::GetId(etk::File &myFile)
|
||||
int32_t classBufferManager::GetId(etk::File &myFile)
|
||||
{
|
||||
int32_t iii;
|
||||
// check if the Buffer existed
|
||||
@@ -261,11 +406,24 @@ int32_t BufferManager::GetId(etk::File &myFile)
|
||||
|
||||
|
||||
// return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5
|
||||
uint32_t BufferManager::Size(void)
|
||||
uint32_t classBufferManager::Size(void)
|
||||
{
|
||||
return listBuffer.Size();
|
||||
}
|
||||
|
||||
// nb of opens file Now ...
|
||||
uint32_t classBufferManager::SizeOpen(void)
|
||||
{
|
||||
uint32_t jjj = 0;
|
||||
// check if the Buffer existed
|
||||
for (int32_t iii=0; iii<listBuffer.Size(); iii++) {
|
||||
// check if the buffer already existed
|
||||
if (NULL != listBuffer[iii]) {
|
||||
jjj++;
|
||||
}
|
||||
}
|
||||
return jjj;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
@@ -275,7 +433,7 @@ uint32_t BufferManager::Size(void)
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
bool BufferManager::Remove(int32_t BufferID)
|
||||
bool classBufferManager::Remove(int32_t BufferID)
|
||||
{
|
||||
if (-1 >= BufferID) {
|
||||
return false;
|
||||
@@ -293,7 +451,9 @@ 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);
|
||||
@@ -313,7 +473,7 @@ bool BufferManager::Remove(int32_t BufferID)
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
int32_t BufferManager::WitchBuffer(int32_t iEmeElement)
|
||||
int32_t classBufferManager::WitchBuffer(int32_t iEmeElement)
|
||||
{
|
||||
int32_t i;
|
||||
for (i=0; i<listBuffer.Size(); i++) {
|
||||
@@ -329,7 +489,105 @@ int32_t BufferManager::WitchBuffer(int32_t iEmeElement)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Namespace part :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static classBufferManager * localManager = NULL;
|
||||
|
||||
void BufferManager::Init(void)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
EWOL_ERROR("classBufferManager ==> already exist, just unlink the previous ...");
|
||||
localManager = NULL;
|
||||
}
|
||||
localManager = new classBufferManager();
|
||||
|
||||
if (NULL == localManager) {
|
||||
EWOL_CRITICAL("Allocation of classBufferManager not done ...");
|
||||
}
|
||||
}
|
||||
|
||||
void BufferManager::UnInit(void)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
|
||||
return;
|
||||
}
|
||||
ewol::EObjectManager::MarkToRemoved(localManager);
|
||||
localManager = NULL;
|
||||
}
|
||||
|
||||
int32_t BufferManager::GetSelected(void)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
|
||||
return -1;
|
||||
}
|
||||
return localManager->GetSelected();
|
||||
}
|
||||
|
||||
Buffer * BufferManager::Get(int32_t BufferID)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
|
||||
return NULL;
|
||||
}
|
||||
return localManager->Get(BufferID);
|
||||
}
|
||||
|
||||
bool BufferManager::Exist(int32_t BufferID)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
|
||||
return false;
|
||||
}
|
||||
return localManager->Exist(BufferID);
|
||||
}
|
||||
|
||||
bool BufferManager::Exist(etk::File &myFile)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
|
||||
return false;
|
||||
}
|
||||
return localManager->Exist(myFile);
|
||||
}
|
||||
|
||||
int32_t BufferManager::GetId(etk::File &myFile)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
|
||||
return -1;
|
||||
}
|
||||
return localManager->GetId(myFile);
|
||||
}
|
||||
|
||||
uint32_t BufferManager::Size(void)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
|
||||
return 0;
|
||||
}
|
||||
return localManager->Size();
|
||||
}
|
||||
|
||||
uint32_t BufferManager::SizeOpen(void)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
|
||||
return 0;
|
||||
}
|
||||
return localManager->SizeOpen();
|
||||
}
|
||||
|
||||
int32_t BufferManager::WitchBuffer(int32_t iEmeElement)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
|
||||
return -1;
|
||||
}
|
||||
return localManager->WitchBuffer(iEmeElement);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -22,52 +22,29 @@
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __BUFFER_MANAGER_H__
|
||||
#define __BUFFER_MANAGER_H__
|
||||
|
||||
#include <Buffer.h>
|
||||
#include <BufferText.h>
|
||||
#include <BufferEmpty.h>
|
||||
#include <etk/Singleton.h>
|
||||
#include <MsgBroadcast.h>
|
||||
#include <ewol/Widget.h>
|
||||
|
||||
class BufferManager: public etk::Singleton<BufferManager>, public MsgBroadcast
|
||||
namespace BufferManager
|
||||
{
|
||||
friend class etk::Singleton<BufferManager>;
|
||||
// specific for sigleton system...
|
||||
private:
|
||||
// Constructeur
|
||||
BufferManager(void);
|
||||
~BufferManager(void);
|
||||
|
||||
public:
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
|
||||
// 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);
|
||||
int32_t GetSelected(void) { return m_idSelected;};
|
||||
void SetSelected(int32_t id) {m_idSelected = id;};
|
||||
Buffer * Get(int32_t BufferID);
|
||||
bool Exist(int32_t BufferID);
|
||||
bool Exist(etk::File &myFile);
|
||||
int32_t GetId(etk::File &myFile);
|
||||
// return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5
|
||||
uint32_t Size(void);
|
||||
int32_t WitchBuffer(int32_t iEmeElement);
|
||||
|
||||
bool Remove(int32_t BufferID);
|
||||
|
||||
private:
|
||||
|
||||
etk::VectorType<Buffer*> listBuffer; //!< element List of the char Elements
|
||||
|
||||
void RemoveAll(void); //!< remove all buffer
|
||||
int32_t m_idSelected;
|
||||
Buffer * BufferNotExiste; //!< When an error arrive in get buffer we return the Error buffer (not writable)
|
||||
void Init(void);
|
||||
void UnInit(void);
|
||||
int32_t GetSelected(void);
|
||||
Buffer * Get(int32_t BufferID);
|
||||
bool Exist(int32_t BufferID);
|
||||
bool Exist(etk::File &myFile);
|
||||
int32_t GetId(etk::File &myFile);
|
||||
// return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5
|
||||
uint32_t Size(void);
|
||||
uint32_t SizeOpen(void);
|
||||
int32_t WitchBuffer(int32_t iEmeElement);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -46,24 +46,27 @@ 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);
|
||||
void ForceReDraw(bool allElement);
|
||||
void AddChar(char * UTF8data);
|
||||
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 AddChar(uniChar_t unicodeData);
|
||||
void cursorMove(ewol::eventKbMoveType_te moveTypeEvent);
|
||||
void MouseSelectFromCursorTo(int32_t width, int32_t height);
|
||||
void MouseEvent(int32_t width, int32_t height);
|
||||
void MouseSelectFromCursorTo(int32_t fontId, int32_t width, int32_t height);
|
||||
void MouseEvent(int32_t fontId, int32_t width, int32_t height);
|
||||
void MouseEventDouble(void);
|
||||
void MouseEventTriple(void);
|
||||
void ScrollDown(void);
|
||||
void ScrollUp(void);
|
||||
|
||||
void Copy(int8_t clipboardID);
|
||||
void Cut(int8_t clipboardID);
|
||||
void Paste(int8_t clipboardID);
|
||||
|
||||
void Search(etk::String &data, bool back, bool caseSensitive, bool wrap, bool regExp);
|
||||
void Replace(etk::String &data);
|
||||
int32_t FindLine(etk::String &data);
|
||||
void Search(etk::UString &data, bool back, bool caseSensitive, bool wrap, bool regExp);
|
||||
void Replace(etk::UString &data);
|
||||
int32_t FindLine(etk::UString &data);
|
||||
void JumpAtLine(int32_t newLine);
|
||||
int32_t GetCurrentLine(void);
|
||||
|
||||
@@ -72,51 +75,40 @@ 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);
|
||||
|
||||
private:
|
||||
// Display
|
||||
bool NeedToCleanEndPage; //!< if true, the end of the page need to be clean (arrive after a remove line)
|
||||
uint32_t nbColoneForLineNumber; //!< number of colome used to display the line Number
|
||||
ColorizeManager * myColorManager; //!< for the background color :
|
||||
|
||||
int32_t GetLineNumberNumberOfElement(void);
|
||||
|
||||
// Direct buffer IO
|
||||
EdnBuf m_EdnBuf; //!< buffer associated on this displayer
|
||||
position_ts m_displayStart; //!< position where the display is starting
|
||||
position_ts m_displaySize; //!< number of char displayable in the screan
|
||||
int32_t m_displayStartBufferPos; //!< position where the buffer start
|
||||
coord2D_ts m_displaySize; //!< number of char displayable in the screan
|
||||
// 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 BasicInit(void);
|
||||
// moving the current position of the display windows ...
|
||||
private:
|
||||
coord2D_ts m_requestDisplayPos; //!< number of char displayable in the screan
|
||||
void RequestPositionUpdate(bool centerPage = false);
|
||||
public:
|
||||
bool RequestPositionRequest(coord2D_ts& newPos);
|
||||
|
||||
void CleanSelectLine(void);
|
||||
|
||||
void SelectionStart(void);
|
||||
void SelectionEnd(void);
|
||||
void SelectionCheckMode(void);
|
||||
|
||||
void CheckAndUpdateLineForModification(uint32_t lineID);
|
||||
private:
|
||||
bool TextDMoveUp(int32_t offset);
|
||||
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);
|
||||
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);
|
||||
int32_t GetMousePosition(int32_t fontId, int32_t width, int32_t height);
|
||||
|
||||
void CursorDisplay(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth);
|
||||
void DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY, int32_t nbColomn, int32_t lineNumber, int32_t positionY);
|
||||
void DrawCursor(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth, clipping_ts &clip);
|
||||
|
||||
};
|
||||
|
||||
|
@@ -32,7 +32,7 @@
|
||||
#define __class__ "Colorize"
|
||||
|
||||
|
||||
Colorize::Colorize( etk::String &newColorName)
|
||||
Colorize::Colorize( etk::UString &newColorName)
|
||||
{
|
||||
|
||||
m_colorFG.red=0;
|
||||
@@ -85,14 +85,14 @@ void Colorize::SetName(const char *newColorName)
|
||||
ColorName = newColorName;
|
||||
}
|
||||
|
||||
void Colorize::SetName(etk::String &newColorName)
|
||||
void Colorize::SetName(etk::UString &newColorName)
|
||||
{
|
||||
//EDN_INFO("color change name : \"%s\" ==> \"%s\"",ColorName.c_str(), newColorName.c_str());
|
||||
ColorName = newColorName;
|
||||
}
|
||||
|
||||
|
||||
etk::String Colorize::GetName(void)
|
||||
etk::UString Colorize::GetName(void)
|
||||
{
|
||||
return ColorName;
|
||||
}
|
||||
|
@@ -31,12 +31,12 @@ class Colorize {
|
||||
public:
|
||||
// Constructeur
|
||||
Colorize(void);
|
||||
Colorize(etk::String &newColorName);
|
||||
Colorize(etk::UString &newColorName);
|
||||
~Colorize(void);
|
||||
|
||||
void SetName(etk::String &newColorName);
|
||||
void SetName(etk::UString &newColorName);
|
||||
void SetName(const char *newColorName);
|
||||
etk::String GetName(void);
|
||||
etk::UString GetName(void);
|
||||
void SetFgColor(const char *myColor);
|
||||
void SetBgColor(const char *myColor);
|
||||
|
||||
@@ -50,10 +50,10 @@ class Colorize {
|
||||
bool GetItalic(void);
|
||||
bool GetBold(void);
|
||||
|
||||
void Display(int32_t i) { EDN_INFO(" " << i << " : \"" << ColorName.c_str() << "\"" << " fg="<< m_colorFG.red <<","<< m_colorFG.green <<","<< m_colorFG.blue <<","<< m_colorFG.alpha /*<<" bg="<< m_colorBG.red <<","<< m_colorBG.green <<","<< m_colorBG.blue*/ ); };
|
||||
void Display(int32_t i) { EDN_INFO(" " << i << " : \"" << ColorName << "\"" << " fg="<< m_colorFG.red <<","<< m_colorFG.green <<","<< m_colorFG.blue <<","<< m_colorFG.alpha /*<<" bg="<< m_colorBG.red <<","<< m_colorBG.green <<","<< m_colorBG.blue*/ ); };
|
||||
|
||||
private:
|
||||
etk::String ColorName; //!< curent color Name
|
||||
etk::UString ColorName; //!< curent color Name
|
||||
color_ts m_colorFG;
|
||||
color_ts m_colorBG;
|
||||
|
||||
|
@@ -26,15 +26,52 @@
|
||||
#include <tools_globals.h>
|
||||
#include <ColorizeManager.h>
|
||||
#include <tinyXML/tinyxml.h>
|
||||
#include <ewol/EObject.h>
|
||||
#include <ewol/EObjectManager.h>
|
||||
|
||||
#define PFX "ColorizeManager "
|
||||
|
||||
|
||||
ColorizeManager::ColorizeManager(void) : MsgBroadcast("Colorize Manager", EDN_CAT_COLOR)
|
||||
|
||||
class classColorManager: public ewol::EObject
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
classColorManager(void);
|
||||
~classColorManager(void);
|
||||
public:
|
||||
/**
|
||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
||||
* @param[in] CallerObject Pointer on the EObject that information came from
|
||||
* @param[in] eventId Message registered by this class
|
||||
* @param[in] data Data registered by this class
|
||||
* @return ---
|
||||
*/
|
||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
|
||||
public:
|
||||
void LoadFile(etk::UString &xmlFilename);
|
||||
void LoadFile(const char * xmlFilename);
|
||||
Colorize * Get(const char *colorName);
|
||||
Colorize * Get(etk::UString &colorName);
|
||||
color_ts & Get(basicColor_te myColor);
|
||||
bool Exist(etk::UString &colorName);
|
||||
bool Exist(const char *colorName);
|
||||
void DisplayListOfColor(void);
|
||||
|
||||
private:
|
||||
etk::UString m_fileColor;
|
||||
etk::VectorType<Colorize*> listMyColor; //!< List of ALL Color
|
||||
Colorize * errorColor;
|
||||
color_ts basicColors[COLOR_NUMBER_MAX];
|
||||
};
|
||||
|
||||
|
||||
classColorManager::classColorManager(void)
|
||||
{
|
||||
//ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiChangeColor);
|
||||
}
|
||||
|
||||
ColorizeManager::~ColorizeManager(void)
|
||||
classColorManager::~classColorManager(void)
|
||||
{
|
||||
delete(errorColor);
|
||||
|
||||
@@ -50,29 +87,32 @@ ColorizeManager::~ColorizeManager(void)
|
||||
listMyColor.Clear();
|
||||
}
|
||||
|
||||
|
||||
void ColorizeManager::OnMessage(int32_t id, int32_t dataID)
|
||||
void classColorManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
||||
{
|
||||
/*
|
||||
switch (id)
|
||||
{
|
||||
case EDN_MSG__RELOAD_COLOR_FILE:
|
||||
{
|
||||
// Reaload File
|
||||
// TODO : Check this : Pb in the recopy etk::String element
|
||||
etk::String plop = m_fileColor;
|
||||
LoadFile(plop.c_str());
|
||||
// TODO : Check this : Pb in the recopy etk::UString element
|
||||
etk::UString plop = m_fileColor;
|
||||
LoadFile(plop);
|
||||
}
|
||||
break;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
void ColorizeManager::LoadFile(etk::String &xmlFilename)
|
||||
void classColorManager::LoadFile(etk::UString &xmlFilename)
|
||||
{
|
||||
LoadFile(xmlFilename.c_str());
|
||||
// TODO : Remove this
|
||||
LoadFile(xmlFilename.Utf8Data());
|
||||
}
|
||||
|
||||
void ColorizeManager::LoadFile(const char * xmlFilename)
|
||||
// TODO : Remove this ...
|
||||
void classColorManager::LoadFile(const char * xmlFilename)
|
||||
{
|
||||
// Remove all old color :
|
||||
int32_t i;
|
||||
@@ -95,7 +135,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,15 +301,19 @@ 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)
|
||||
// TODO : Remove this ...
|
||||
Colorize *classColorManager::Get(const char *colorName)
|
||||
{
|
||||
int32_t i;
|
||||
for (i=0; i<listMyColor.Size(); i++) {
|
||||
etk::String elementName = listMyColor[i]->GetName();
|
||||
etk::UString elementName = listMyColor[i]->GetName();
|
||||
if (elementName == colorName) {
|
||||
return listMyColor[i];
|
||||
}
|
||||
@@ -252,12 +323,13 @@ Colorize *ColorizeManager::Get(const char *colorName)
|
||||
return errorColor;
|
||||
}
|
||||
|
||||
Colorize *ColorizeManager::Get(etk::String &colorName)
|
||||
Colorize *classColorManager::Get(etk::UString &colorName)
|
||||
{
|
||||
return Get(colorName.c_str());
|
||||
// TODO : Remove this
|
||||
return Get(colorName.Utf8Data());
|
||||
}
|
||||
|
||||
color_ts & ColorizeManager::Get(basicColor_te myColor)
|
||||
color_ts & classColorManager::Get(basicColor_te myColor)
|
||||
{
|
||||
if (myColor < COLOR_NUMBER_MAX) {
|
||||
return basicColors[myColor];
|
||||
@@ -267,28 +339,31 @@ color_ts & ColorizeManager::Get(basicColor_te myColor)
|
||||
}
|
||||
|
||||
|
||||
bool ColorizeManager::Exist(const char *colorName)
|
||||
// TODO : Remove this ...
|
||||
bool classColorManager::Exist(const char *colorName)
|
||||
{
|
||||
int32_t i;
|
||||
for (i=0; i<listMyColor.Size(); i++) {
|
||||
etk::String elementName = listMyColor[i]->GetName();
|
||||
etk::UString elementName = listMyColor[i]->GetName();
|
||||
if (elementName == colorName) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool ColorizeManager::Exist(etk::String &colorName)
|
||||
|
||||
bool classColorManager::Exist(etk::UString &colorName)
|
||||
{
|
||||
return Exist(colorName.c_str());
|
||||
// TODO : Remove this
|
||||
return Exist(colorName.Utf8Data());
|
||||
}
|
||||
|
||||
void ColorizeManager::DisplayListOfColor(void)
|
||||
void classColorManager::DisplayListOfColor(void)
|
||||
{
|
||||
int32_t i;
|
||||
EDN_INFO(PFX"List of ALL COLOR : ");
|
||||
for (i=0; i<listMyColor.Size(); i++) {
|
||||
//etk::String elementName = listMyColor[i]->GetName();
|
||||
//etk::UString elementName = listMyColor[i]->GetName();
|
||||
//EDN_INFO(i << " : \"" << elementName.c_str() << "\"" );
|
||||
listMyColor[i]->Display(i);
|
||||
}
|
||||
@@ -296,3 +371,97 @@ void ColorizeManager::DisplayListOfColor(void)
|
||||
|
||||
|
||||
|
||||
static classColorManager * localManager = NULL;
|
||||
|
||||
|
||||
void ColorizeManager::Init(void)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
EWOL_ERROR("ColorizeManager ==> already exist, just unlink the previous ...");
|
||||
localManager = NULL;
|
||||
}
|
||||
localManager = new classColorManager();
|
||||
|
||||
if (NULL == localManager) {
|
||||
EWOL_CRITICAL("Allocation of HighlightManager not done ...");
|
||||
}
|
||||
}
|
||||
|
||||
void ColorizeManager::UnInit(void)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
EWOL_ERROR("ColorizeManager ==> request UnInit, but does not exist ...");
|
||||
return;
|
||||
}
|
||||
ewol::EObjectManager::MarkToRemoved(localManager);
|
||||
localManager = NULL;
|
||||
}
|
||||
|
||||
void ColorizeManager::LoadFile(etk::UString &xmlFilename)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
return;
|
||||
}
|
||||
localManager->LoadFile(xmlFilename);
|
||||
}
|
||||
|
||||
|
||||
void ColorizeManager::LoadFile(const char * xmlFilename)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
return;
|
||||
}
|
||||
localManager->LoadFile(xmlFilename);
|
||||
}
|
||||
|
||||
Colorize* ColorizeManager::Get(const char *colorName)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
return NULL;
|
||||
}
|
||||
return localManager->Get(colorName);
|
||||
}
|
||||
|
||||
Colorize* ColorizeManager::Get(etk::UString &colorName)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
return NULL;
|
||||
}
|
||||
return localManager->Get(colorName);
|
||||
}
|
||||
|
||||
color_ts errorColor;
|
||||
|
||||
color_ts& ColorizeManager::Get(basicColor_te myColor)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
return errorColor;
|
||||
}
|
||||
return localManager->Get(myColor);
|
||||
}
|
||||
|
||||
bool ColorizeManager::Exist(etk::UString &colorName)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
return false;
|
||||
}
|
||||
return localManager->Exist(colorName);
|
||||
}
|
||||
|
||||
bool ColorizeManager::Exist(const char *colorName)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
return false;
|
||||
}
|
||||
return localManager->Exist(colorName);
|
||||
}
|
||||
|
||||
void ColorizeManager::DisplayListOfColor(void)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
return;
|
||||
}
|
||||
localManager->DisplayListOfColor();
|
||||
}
|
||||
|
||||
|
||||
|
@@ -26,9 +26,9 @@
|
||||
#ifndef __COLORIZE_MANAGER_H__
|
||||
#define __COLORIZE_MANAGER_H__
|
||||
|
||||
#include <etk/Singleton.h>
|
||||
#include <Colorize.h>
|
||||
#include <MsgBroadcast.h>
|
||||
#include <ewol/Widget.h>
|
||||
|
||||
typedef enum {
|
||||
// BASIC color for codeViewer
|
||||
@@ -49,31 +49,18 @@ typedef enum {
|
||||
|
||||
|
||||
|
||||
class ColorizeManager: public etk::Singleton<ColorizeManager>, public MsgBroadcast
|
||||
namespace ColorizeManager
|
||||
{
|
||||
friend class etk::Singleton<ColorizeManager>;
|
||||
// specific for sigleton system...
|
||||
private:
|
||||
// Constructeur
|
||||
ColorizeManager(void);
|
||||
~ColorizeManager(void);
|
||||
public:
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
public:
|
||||
void LoadFile(etk::String &xmlFilename);
|
||||
void LoadFile(const char * xmlFilename);
|
||||
Colorize * Get(const char *colorName);
|
||||
Colorize * Get(etk::String &colorName);
|
||||
color_ts & Get(basicColor_te myColor);
|
||||
bool Exist(etk::String &colorName);
|
||||
bool Exist(const char *colorName);
|
||||
void DisplayListOfColor(void);
|
||||
|
||||
private:
|
||||
etk::String m_fileColor;
|
||||
etk::VectorType<Colorize*> listMyColor; //!< List of ALL Color
|
||||
Colorize * errorColor;
|
||||
color_ts basicColors[COLOR_NUMBER_MAX];
|
||||
void Init(void);
|
||||
void UnInit(void);
|
||||
void LoadFile(etk::UString &xmlFilename);
|
||||
void LoadFile(const char * xmlFilename);
|
||||
Colorize * Get(const char *colorName);
|
||||
Colorize * Get(etk::UString &colorName);
|
||||
color_ts & Get(basicColor_te myColor);
|
||||
bool Exist(etk::UString &colorName);
|
||||
bool Exist(const char *colorName);
|
||||
void DisplayListOfColor(void);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -1,387 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file BufferViewer.cpp
|
||||
* @brief Editeur De N'ours : main textViewer diplayer
|
||||
* @author Edouard DUPIN
|
||||
* @date 04/12/2010
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <Display.h>
|
||||
#include <BufferView.h>
|
||||
#include <BufferManager.h>
|
||||
#include <ColorizeManager.h>
|
||||
#include <MainWindows.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "BufferView"
|
||||
|
||||
BufferView::BufferView(void) : MsgBroadcast("Buffer View", EDN_CAT_GUI)
|
||||
{
|
||||
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_selectedID = -1;
|
||||
|
||||
}
|
||||
|
||||
BufferView::~BufferView(void)
|
||||
{
|
||||
|
||||
}
|
||||
/*
|
||||
GtkWidget * BufferView::GetMainWidget(void)
|
||||
{
|
||||
return m_widget;
|
||||
}
|
||||
*/
|
||||
|
||||
void BufferView::OnMessage(int32_t id, int32_t dataID)
|
||||
{
|
||||
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 0
|
||||
|
||||
gboolean BufferView::CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data)
|
||||
{
|
||||
BufferView * self = reinterpret_cast<BufferView*>(data);
|
||||
|
||||
# ifdef USE_GTK_VERSION_3_0
|
||||
GtkAllocation allocation;
|
||||
gtk_widget_get_allocation(widget, &allocation);
|
||||
bool needRedrawAll = false;
|
||||
if (self->m_shawableAreaX != allocation.width) {
|
||||
needRedrawAll = true;
|
||||
self->m_shawableAreaX = allocation.width;
|
||||
}
|
||||
if (self->m_shawableAreaY != allocation.height) {
|
||||
needRedrawAll = true;
|
||||
self->m_shawableAreaY = allocation.height;
|
||||
}
|
||||
# elif defined( USE_GTK_VERSION_2_0)
|
||||
bool needRedrawAll = false;
|
||||
if (self->m_shawableAreaX != widget->allocation.width) {
|
||||
needRedrawAll = true;
|
||||
self->m_shawableAreaX = widget->allocation.width;
|
||||
}
|
||||
if (self->m_shawableAreaY != widget->allocation.height) {
|
||||
needRedrawAll = true;
|
||||
self->m_shawableAreaY = widget->allocation.height;
|
||||
}
|
||||
#endif
|
||||
if (true == needRedrawAll) {
|
||||
//myBuffer->ForceReDraw(true);
|
||||
}
|
||||
EDN_INFO("==========================================================================");
|
||||
EDN_INFO("Request a display of : " << self->m_shawableAreaX << "px * "<< self->m_shawableAreaY<<"px");
|
||||
DrawerManager monDrawer(widget, self->m_shawableAreaX, self->m_shawableAreaY);
|
||||
|
||||
// clean buffer
|
||||
monDrawer.Clean(self->m_colorManager->Get(COLOR_LIST_BG_1));
|
||||
|
||||
// get the number of buffer open
|
||||
int32_t nbBufferOpen = self->m_bufferManager->Size();
|
||||
int32_t i;
|
||||
uint32_t lineID = 0;
|
||||
uint32_t fontHeight = Display::GetFontHeight();
|
||||
basicColor_te selectFG = COLOR_LIST_TEXT_NORMAL;
|
||||
basicColor_te selectBG = COLOR_LIST_BG_1;
|
||||
for (i=0; i < nbBufferOpen; i++) {
|
||||
Edn::File name;
|
||||
bool isModify;
|
||||
if (self->m_bufferManager->Exist(i)) {
|
||||
isModify = self->m_bufferManager->Get(i)->IsModify();
|
||||
name = self->m_bufferManager->Get(i)->GetFileName();
|
||||
char *tmpModify = (char*)" ";
|
||||
if (true == isModify) {
|
||||
tmpModify = (char*)"M";
|
||||
}
|
||||
char name2[1024] = "";
|
||||
sprintf(name2, "[%2d](%s) %s", i, tmpModify, name.GetShortFilename().c_str() );
|
||||
|
||||
if (true == isModify) {
|
||||
selectFG = COLOR_LIST_TEXT_MODIFY;
|
||||
} else {
|
||||
selectFG = COLOR_LIST_TEXT_NORMAL;
|
||||
}
|
||||
if (lineID%2==0) {
|
||||
selectBG = COLOR_LIST_BG_1;
|
||||
} else {
|
||||
selectBG = COLOR_LIST_BG_2;
|
||||
}
|
||||
if (self->m_selectedID == i) {
|
||||
selectBG = COLOR_LIST_BG_SELECTED;
|
||||
}
|
||||
EDN_INFO("color fg=" << selectFG << " bg="<< selectBG);
|
||||
monDrawer.Rectangle(self->m_colorManager->Get(selectBG), 0, lineID*fontHeight, self->m_shawableAreaX, Display::GetFontHeight());
|
||||
|
||||
monDrawer.Text(self->m_colorManager->Get(selectFG), 2, lineID*fontHeight, name2);
|
||||
monDrawer.Flush();
|
||||
lineID ++;
|
||||
}
|
||||
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// sur : <20>mis lors du premier affichage de la GtkDrawingArea
|
||||
gboolean BufferView::CB_displayInit( GtkWidget *widget, gpointer data)
|
||||
{
|
||||
BufferView * self = reinterpret_cast<BufferView*>(data);
|
||||
|
||||
# ifdef USE_GTK_VERSION_3_0
|
||||
GtkAllocation allocation;
|
||||
gtk_widget_get_allocation(widget, &allocation);
|
||||
int32_t size_x = allocation.width;
|
||||
int32_t size_y = allocation.height;
|
||||
|
||||
self->m_shawableAreaX = allocation.width;
|
||||
self->m_shawableAreaY = allocation.height;
|
||||
# elif defined( USE_GTK_VERSION_2_0)
|
||||
int32_t size_x = widget->allocation.width;
|
||||
int32_t size_y = widget->allocation.height;
|
||||
|
||||
self->m_shawableAreaX = widget->allocation.width;
|
||||
self->m_shawableAreaY = widget->allocation.height;
|
||||
# endif
|
||||
EDN_INFO("Request a diplay of : " << size_x << "px * " << size_y << "px");
|
||||
|
||||
//Display::InitDisplayParam(self->m_displayParameters, widget, 700, 1200);
|
||||
|
||||
gtk_widget_queue_draw( widget );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gint BufferView::CB_focusGet( GtkWidget *widget, GdkEventFocus *event, gpointer data)
|
||||
{
|
||||
//BufferView * self = reinterpret_cast<BufferView*>(data);
|
||||
|
||||
# ifdef USE_GTK_VERSION_2_0
|
||||
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
|
||||
# endif
|
||||
EDN_INFO("Focus - In");
|
||||
gtk_widget_queue_draw( widget );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gint BufferView::CB_focusLost( GtkWidget *widget, GdkEventFocus *event, gpointer data)
|
||||
{
|
||||
//BufferView * self = reinterpret_cast<BufferView*>(data);
|
||||
|
||||
# ifdef USE_GTK_VERSION_2_0
|
||||
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
|
||||
# endif
|
||||
EDN_INFO("Focus - out");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gint BufferView::CB_keyboardEvent( GtkWidget *widget, GdkEventKey *event, gpointer data)
|
||||
{
|
||||
//BufferView * self = reinterpret_cast<BufferView*>(data);
|
||||
|
||||
if(event->type == GDK_KEY_PRESS) {
|
||||
gtk_widget_queue_draw( widget );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void BufferView::OnPopupEventShow(GtkWidget *menuitem, gpointer data)
|
||||
{
|
||||
BufferView * self = reinterpret_cast<BufferView*>(data);
|
||||
self->SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, self->m_contectMenuSelectID);
|
||||
self->m_contectMenuSelectID = -1;
|
||||
}
|
||||
|
||||
void BufferView::OnPopupEventClose(GtkWidget *menuitem, gpointer data)
|
||||
{
|
||||
BufferView * self = reinterpret_cast<BufferView*>(data);
|
||||
self->SendMessage(EDN_MSG__BUFF_ID_CLOSE, self->m_contectMenuSelectID);
|
||||
self->m_contectMenuSelectID = -1;
|
||||
}
|
||||
|
||||
void BufferView::OnPopupEventSave(GtkWidget *menuitem, gpointer data)
|
||||
{
|
||||
BufferView * self = reinterpret_cast<BufferView*>(data);
|
||||
self->SendMessage(EDN_MSG__BUFF_ID_SAVE, self->m_contectMenuSelectID);
|
||||
self->m_contectMenuSelectID = -1;
|
||||
}
|
||||
|
||||
void BufferView::OnPopupEventSaveAs(GtkWidget *menuitem, gpointer data)
|
||||
{
|
||||
BufferView * self = reinterpret_cast<BufferView*>(data);
|
||||
self->SendMessage(EDN_MSG__GUI_SHOW_SAVE_AS, self->m_contectMenuSelectID);
|
||||
self->m_contectMenuSelectID = -1;
|
||||
}
|
||||
|
||||
|
||||
void BufferView::ViewPopupMenu(GtkWidget *parrent, GdkEventButton *event, int32_t BufferID)
|
||||
{
|
||||
// Save the slected buffer
|
||||
m_contectMenuSelectID = BufferID;
|
||||
if (m_bufferManager->Exist(m_contectMenuSelectID)) {
|
||||
GtkWidget *menu, *menuitem;
|
||||
menu = gtk_menu_new();
|
||||
menuitem = gtk_menu_item_new_with_label("Show");
|
||||
g_signal_connect( G_OBJECT(menuitem), "activate", G_CALLBACK(OnPopupEventShow), this);
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
|
||||
if (true == m_bufferManager->Get(m_contectMenuSelectID)->HaveName()) {
|
||||
if (true == m_bufferManager->Get(m_contectMenuSelectID)->IsModify()) {
|
||||
menuitem = gtk_menu_item_new_with_label("Save");
|
||||
} else {
|
||||
menuitem = gtk_menu_item_new_with_label("Force Save");
|
||||
}
|
||||
g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(OnPopupEventSave), this);
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
|
||||
}
|
||||
menuitem = gtk_menu_item_new_with_label("Save As ...");
|
||||
g_signal_connect( G_OBJECT(menuitem), "activate", G_CALLBACK(OnPopupEventSaveAs), this);
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
|
||||
menuitem = gtk_menu_item_new_with_label("Close");
|
||||
g_signal_connect( G_OBJECT(menuitem), "activate", G_CALLBACK(OnPopupEventClose), this);
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
|
||||
gtk_widget_show_all(menu);
|
||||
// Note: event can be NULL here when called from view_onPopupMenu;
|
||||
// gdk_event_get_time() accepts a NULL argument
|
||||
gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,
|
||||
(event != NULL) ? event->button : 0,
|
||||
gdk_event_get_time((GdkEvent*)event));
|
||||
} else {
|
||||
EDN_ERROR("Buffer does not Exist !!! " << m_contectMenuSelectID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
gint BufferView::CB_mouseButtonEvent(GtkWidget *widget, GdkEventButton *event, gpointer data)
|
||||
{
|
||||
BufferView * self = reinterpret_cast<BufferView*>(data);
|
||||
// get focus on the widget
|
||||
gtk_widget_grab_focus(widget);
|
||||
if (event->button == 1) {
|
||||
if (event->type == GDK_BUTTON_PRESS) {
|
||||
EDN_INFO("mouse-event BT1 ==> One Clicked");
|
||||
}else if (event->type == GDK_2BUTTON_PRESS) {
|
||||
//EDN_INFO("mouse-event BT1 ==> Double Clicked %d, %d", (uint32_t)event->x, (uint32_t)event->y);
|
||||
uint32_t fontHeight = Display::GetFontHeight();
|
||||
int32_t selectBuf = self->m_bufferManager->WitchBuffer((event->y / fontHeight) + 1);
|
||||
//EDN_INFO(" plop %d / %d = %d ==> %d", (uint32_t)event->y, fontHeight, ((uint32_t)event->y / fontHeight), selectBuf);
|
||||
if ( 0 <= selectBuf) {
|
||||
self->SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, selectBuf);
|
||||
}
|
||||
}
|
||||
} else if (event->button == 3) {
|
||||
if (event->type == GDK_BUTTON_PRESS) {
|
||||
EDN_INFO("mouse-event BT3 PRESS");
|
||||
uint32_t fontHeight = Display::GetFontHeight();
|
||||
int32_t selectBuf = self->m_bufferManager->WitchBuffer((event->y / fontHeight) + 1);
|
||||
if ( 0 <= selectBuf) {
|
||||
self->ViewPopupMenu(widget, event, selectBuf);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// not usefull to redraw
|
||||
return true;
|
||||
}
|
||||
gtk_widget_queue_draw( widget );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
gint BufferView::CB_mouseMotionEvent( GtkWidget *widget, GdkEventMotion *event, gpointer data)
|
||||
{
|
||||
//BufferView * self = reinterpret_cast<BufferView*>(data);
|
||||
|
||||
/*
|
||||
if (true == ButtunOneSelected) {
|
||||
int x, y;
|
||||
GdkModifierType state;
|
||||
|
||||
if (event->is_hint) {
|
||||
gdk_window_get_pointer(event->window, &x, &y, &state);
|
||||
} else {
|
||||
x = event->x;
|
||||
y = event->y;
|
||||
state = (GdkModifierType)event->state;
|
||||
}
|
||||
EDN_INFO("mouse-motion BT1 %d, %d", x, y);
|
||||
}
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,77 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file BufferView.h
|
||||
* @brief Editeur De N'ours : main List Buffer Viewer (header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 09/12/2010
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
#ifndef __BUFFER_VIEW_H__
|
||||
#define __BUFFER_VIEW_H__
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <CodeView.h>
|
||||
#include <BufferManager.h>
|
||||
#include <Display.h>
|
||||
#include <MsgBroadcast.h>
|
||||
|
||||
|
||||
|
||||
class BufferView : public MsgBroadcast
|
||||
{
|
||||
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);
|
||||
*/
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -1,348 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file CodeView.cpp
|
||||
* @brief Editeur De N'ours : Code Viewer Widget
|
||||
* This is an abstraction
|
||||
* @author Edouard DUPIN
|
||||
* @date 05/01/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <CodeView.h>
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <Display.h>
|
||||
#include <CodeView.h>
|
||||
#include <BufferManager.h>
|
||||
#include <ColorizeManager.h>
|
||||
#include <ClipBoard.h>
|
||||
#include <SearchData.h>
|
||||
|
||||
#include <ewol/WidgetManager.h>
|
||||
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "ewol::Button"
|
||||
|
||||
|
||||
CodeView::CodeView(void) : MsgBroadcast("Code View", EDN_CAT_WORK_AREA)
|
||||
{
|
||||
m_label = "CodeView is disable ...";
|
||||
m_bufferID = -1;
|
||||
m_buttunOneSelected = false;
|
||||
|
||||
// Init link with the buffer Manager
|
||||
m_bufferManager = BufferManager::getInstance();
|
||||
m_colorManager = ColorizeManager::getInstance();
|
||||
|
||||
m_textColorFg.red = 0.0;
|
||||
m_textColorFg.green = 0.0;
|
||||
m_textColorFg.blue = 0.0;
|
||||
m_textColorFg.alpha = 1.0;
|
||||
|
||||
m_textColorBg.red = 0.0;
|
||||
m_textColorBg.green = 0.0;
|
||||
m_textColorBg.blue = 0.0;
|
||||
m_textColorBg.alpha = 0.25;
|
||||
SetCanHaveFocus(true);
|
||||
}
|
||||
|
||||
CodeView::~CodeView(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool CodeView::CalculateMinSize(void)
|
||||
{
|
||||
m_minSize.x = 50;
|
||||
m_minSize.y = 50;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CodeView::OnRegenerateDisplay(void)
|
||||
{
|
||||
// create tmp object :
|
||||
ewol::OObject2DTextColored* myOObjectText = new ewol::OObject2DTextColored("", -1);
|
||||
ewol::OObject2DColored* myOObjectsColored = new ewol::OObject2DColored();
|
||||
|
||||
// generate the objects :
|
||||
//m_bufferID = 0;
|
||||
m_bufferManager->Get(m_bufferID)->Display(myOObjectText, myOObjectsColored, m_size.x, m_size.y);
|
||||
|
||||
// clean the object list ...
|
||||
ClearOObjectList();
|
||||
// add generated element
|
||||
AddOObject(myOObjectsColored, "CodeViewBackground");
|
||||
AddOObject(myOObjectText, "CodeViewText");
|
||||
}
|
||||
|
||||
bool CodeView::OnEventArea(const char * generateEventId, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
/*
|
||||
//bool eventIsOK = false;
|
||||
//EWOL_DEBUG("Receive event : \"" << generateEventId << "\"");
|
||||
if(ewolEventButtonPressed == generateEventId) {
|
||||
EWOL_INFO("BT pressed ... " << m_label);
|
||||
//eventIsOK = true;
|
||||
ewol::widgetManager::FocusKeep(this);
|
||||
} else if(ewolEventButtonEnter == generateEventId) {
|
||||
OnRegenerateDisplay();
|
||||
}
|
||||
//return eventIsOK;
|
||||
*/
|
||||
// in every case this not stop the propagation of the event
|
||||
return false;
|
||||
// if overwrited... you can ...
|
||||
}
|
||||
|
||||
|
||||
bool CodeView::OnEventKb(ewol::eventKbType_te typeEvent, char UTF8_data[UTF8_MAX_SIZE])
|
||||
{
|
||||
//EDN_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent);
|
||||
if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) {
|
||||
m_bufferManager->Get(m_bufferID)->AddChar(UTF8_data);
|
||||
OnRegenerateDisplay();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CodeView::OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveType_te moveTypeEvent)
|
||||
{
|
||||
if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) {
|
||||
m_bufferManager->Get(m_bufferID)->cursorMove(moveTypeEvent);
|
||||
OnRegenerateDisplay();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
x -= m_origin.x;
|
||||
y -= m_origin.y;
|
||||
/*
|
||||
etk::String type = (int)typeEvent;
|
||||
switch (typeEvent)
|
||||
{
|
||||
case ewol::EVENT_INPUT_TYPE_DOWN:
|
||||
type = "EVENT_INPUT_TYPE_DOWN";
|
||||
break;
|
||||
case ewol::EVENT_INPUT_TYPE_MOVE:
|
||||
type = "EVENT_INPUT_TYPE_MOVE";
|
||||
break;
|
||||
case ewol::EVENT_INPUT_TYPE_SINGLE:
|
||||
type = "EVENT_INPUT_TYPE_SINGLE";
|
||||
break;
|
||||
case ewol::EVENT_INPUT_TYPE_DOUBLE:
|
||||
type = "EVENT_INPUT_TYPE_DOUBLE";
|
||||
break;
|
||||
case ewol::EVENT_INPUT_TYPE_TRIPLE:
|
||||
type = "EVENT_INPUT_TYPE_TRIPLE";
|
||||
break;
|
||||
case ewol::EVENT_INPUT_TYPE_UP:
|
||||
type = "EVENT_INPUT_TYPE_UP";
|
||||
break;
|
||||
case ewol::EVENT_INPUT_TYPE_ENTER:
|
||||
type = "EVENT_INPUT_TYPE_ENTER";
|
||||
break;
|
||||
case ewol::EVENT_INPUT_TYPE_LEAVE:
|
||||
type = "EVENT_INPUT_TYPE_LEAVE";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
|
||||
EDN_DEBUG("Event : " << IdInput << " type : " << type << " position(" << x << "," << y << ")");
|
||||
*/
|
||||
if (1 == IdInput) {
|
||||
if (ewol::EVENT_INPUT_TYPE_DOWN == typeEvent) {
|
||||
m_buttunOneSelected = true;
|
||||
ewol::widgetManager::FocusKeep(this);
|
||||
} else if (ewol::EVENT_INPUT_TYPE_UP == typeEvent) {
|
||||
m_buttunOneSelected = false;
|
||||
m_bufferManager->Get(m_bufferID)->Copy(COPY_MIDDLE_BUTTON);
|
||||
OnRegenerateDisplay();
|
||||
} else if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) {
|
||||
//EDN_INFO("mouse-event BT1 ==> One Clicked %d, %d", (uint32_t)event->x, (uint32_t)event->y);
|
||||
m_bufferManager->Get(m_bufferID)->MouseEvent(x, y);
|
||||
OnRegenerateDisplay();
|
||||
} else if (ewol::EVENT_INPUT_TYPE_DOUBLE == typeEvent) {
|
||||
//EDN_INFO("mouse-event BT1 ==> Double Clicked %d, %d", (uint32_t)event->x, (uint32_t)event->y);
|
||||
m_bufferManager->Get(m_bufferID)->MouseEventDouble();
|
||||
OnRegenerateDisplay();
|
||||
} else if (ewol::EVENT_INPUT_TYPE_TRIPLE == typeEvent) {
|
||||
//EDN_INFO("mouse-event BT1 ==> Triple Clicked");
|
||||
m_bufferManager->Get(m_bufferID)->MouseEventTriple();
|
||||
OnRegenerateDisplay();
|
||||
} else if (ewol::EVENT_INPUT_TYPE_MOVE == typeEvent) {
|
||||
if (true == m_buttunOneSelected) {
|
||||
int xxx, yyy;
|
||||
xxx = x;
|
||||
yyy = y;
|
||||
if (xxx<0) {
|
||||
xxx = 0;
|
||||
}
|
||||
if (yyy<0) {
|
||||
yyy = 0;
|
||||
}
|
||||
//EDN_INFO("mouse-motion BT1 %d, %d", xxx, yyy);
|
||||
m_bufferManager->Get(m_bufferID)->MouseSelectFromCursorTo(xxx, yyy);
|
||||
OnRegenerateDisplay();
|
||||
}
|
||||
}
|
||||
} else if (2 == IdInput) {
|
||||
if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) {
|
||||
m_bufferManager->Get(m_bufferID)->MouseEvent(x, y);
|
||||
m_bufferManager->Get(m_bufferID)->Paste(COPY_MIDDLE_BUTTON);
|
||||
OnRegenerateDisplay();
|
||||
ewol::widgetManager::FocusKeep(this);
|
||||
}
|
||||
}
|
||||
if (4 == IdInput && ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent)
|
||||
{
|
||||
//EDN_INFO("mouse-event GDK_SCROLL_UP");
|
||||
m_bufferManager->Get(m_bufferID)->ScrollUp();
|
||||
OnRegenerateDisplay();
|
||||
ewol::widgetManager::FocusKeep(this);
|
||||
} else if (5 == IdInput && ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent)
|
||||
{
|
||||
//EDN_INFO("mouse-event GDK_SCROLL_DOWN");
|
||||
m_bufferManager->Get(m_bufferID)->ScrollDown();
|
||||
OnRegenerateDisplay();
|
||||
ewol::widgetManager::FocusKeep(this);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CodeView::OnMessage(int32_t id, int32_t dataID)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case EDN_MSG__CURRENT_CHANGE_BUFFER_ID:
|
||||
EDN_INFO("Select a new Buffer ... " << dataID);
|
||||
m_bufferID = dataID;
|
||||
m_bufferManager->Get(m_bufferID)->ForceReDraw(true);
|
||||
// request the display of the curent Editor
|
||||
SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, m_bufferID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_SAVE:
|
||||
SendMessage(EDN_MSG__BUFF_ID_SAVE, m_bufferID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_SAVE_AS:
|
||||
SendMessage(EDN_MSG__GUI_SHOW_SAVE_AS, m_bufferID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_REMOVE_LINE:
|
||||
m_bufferManager->Get(m_bufferID)->RemoveLine();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_SELECT_ALL:
|
||||
m_bufferManager->Get(m_bufferID)->SelectAll();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_UN_SELECT:
|
||||
m_bufferManager->Get(m_bufferID)->SelectNone();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_COPY:
|
||||
if (dataID == -1) {
|
||||
dataID = COPY_STD;
|
||||
}
|
||||
m_bufferManager->Get(m_bufferID)->Copy(dataID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_CUT:
|
||||
if (dataID == -1) {
|
||||
dataID = COPY_STD;
|
||||
}
|
||||
m_bufferManager->Get(m_bufferID)->Cut(dataID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_PASTE:
|
||||
if (dataID == -1) {
|
||||
dataID = COPY_STD;
|
||||
}
|
||||
m_bufferManager->Get(m_bufferID)->Paste(dataID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_FIND_PREVIOUS:
|
||||
{
|
||||
etk::String myDataString;
|
||||
SearchData::GetSearch(myDataString);
|
||||
m_bufferManager->Get(m_bufferID)->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__CURRENT_FIND_NEXT:
|
||||
{
|
||||
etk::String myDataString;
|
||||
SearchData::GetSearch(myDataString);
|
||||
m_bufferManager->Get(m_bufferID)->Search(myDataString, false, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__CURRENT_REPLACE:
|
||||
{
|
||||
etk::String myDataString;
|
||||
SearchData::GetReplace(myDataString);
|
||||
m_bufferManager->Get(m_bufferID)->Replace(myDataString);
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__CURRENT_REPLACE_ALL:
|
||||
break;
|
||||
case EDN_MSG__CURRENT_CLOSE:
|
||||
SendMessage(EDN_MSG__BUFF_ID_CLOSE, m_bufferID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_UNDO:
|
||||
m_bufferManager->Get(m_bufferID)->Undo();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_REDO:
|
||||
m_bufferManager->Get(m_bufferID)->Redo();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_GOTO_LINE:
|
||||
if (dataID<0) {
|
||||
dataID = 0;
|
||||
}
|
||||
m_bufferManager->Get(m_bufferID)->JumpAtLine(dataID);
|
||||
break;
|
||||
case EDN_MSG__REFRESH_DISPLAY:
|
||||
break;
|
||||
case EDN_MSG__CURRENT_SET_CHARSET:
|
||||
m_bufferManager->Get(m_bufferID)->SetCharset((charset_te)dataID);
|
||||
break;
|
||||
case EDN_MSG__USER_DISPLAY_CHANGE:
|
||||
// Redraw all the display ... Done under ...
|
||||
break;
|
||||
}
|
||||
// Force redraw of the widget
|
||||
OnRegenerateDisplay();
|
||||
}
|
||||
|
||||
|
||||
void CodeView::OnGetFocus(void)
|
||||
{
|
||||
SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, m_bufferID);
|
||||
EDN_INFO("Focus - In");
|
||||
}
|
||||
|
||||
|
||||
void CodeView::OnLostFocus(void)
|
||||
{
|
||||
EDN_INFO("Focus - out");
|
||||
}
|
||||
|
||||
|
@@ -1,103 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file CodeView.h
|
||||
* @brief Editeur De N'ours : Code Viewer Widget (header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 05/01/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef __CODE_VIEW_H__
|
||||
#define __CODE_VIEW_H__
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <CodeView.h>
|
||||
#include <BufferManager.h>
|
||||
#include <Display.h>
|
||||
#include <MsgBroadcast.h>
|
||||
|
||||
#include <etk/Types.h>
|
||||
#include <ewol/Widget.h>
|
||||
|
||||
class CodeView :public ewol::Widget, public MsgBroadcast
|
||||
{
|
||||
public:
|
||||
CodeView(void);
|
||||
virtual ~CodeView(void);
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
virtual bool CalculateMinSize(void);
|
||||
private:
|
||||
etk::String m_label;
|
||||
color_ts m_textColorFg; //!< Text color
|
||||
color_ts m_textColorBg; //!< Background color
|
||||
BufferManager * m_bufferManager;
|
||||
ColorizeManager * m_colorManager;
|
||||
int32_t m_bufferID;
|
||||
bool m_buttunOneSelected;
|
||||
public:
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
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;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
152
jni/edn/Gui/BufferView.cpp
Normal file
152
jni/edn/Gui/BufferView.cpp
Normal file
@@ -0,0 +1,152 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file BufferViewer.cpp
|
||||
* @brief Editeur De N'ours : main textViewer diplayer
|
||||
* @author Edouard DUPIN
|
||||
* @date 04/12/2010
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <Display.h>
|
||||
#include <BufferView.h>
|
||||
#include <BufferManager.h>
|
||||
#include <ColorizeManager.h>
|
||||
#include <MainWindows.h>
|
||||
#include <ewol/EObject.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "BufferView"
|
||||
|
||||
BufferView::BufferView(void)
|
||||
{
|
||||
SetCanHaveFocus(true);
|
||||
RegisterMultiCast(ednMsgBufferListChange);
|
||||
RegisterMultiCast(ednMsgBufferState);
|
||||
RegisterMultiCast(ednMsgBufferId);
|
||||
m_selectedID = -1;
|
||||
}
|
||||
|
||||
BufferView::~BufferView(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
||||
* @param[in] CallerObject Pointer on the EObject that information came from
|
||||
* @param[in] eventId Message registered by this class
|
||||
* @param[in] data Data registered by this class
|
||||
* @return ---
|
||||
*/
|
||||
void BufferView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
||||
{
|
||||
ewol::List::OnReceiveMessage(CallerObject, eventId, data);
|
||||
if (eventId == ednMsgBufferListChange) {
|
||||
MarkToReedraw();
|
||||
}else if (eventId == ednMsgBufferId) {
|
||||
MarkToReedraw();
|
||||
}else if (eventId == ednMsgBufferState) {
|
||||
MarkToReedraw();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
color_ts BufferView::GetBasicBG(void)
|
||||
{
|
||||
return ColorizeManager::Get(COLOR_LIST_BG_1);
|
||||
}
|
||||
|
||||
uint32_t BufferView::GetNuberOfColomn(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool BufferView::GetTitle(int32_t colomn, etk::UString &myTitle, color_ts &fg, color_ts &bg)
|
||||
{
|
||||
myTitle = "Buffers : ";
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t BufferView::GetNuberOfRaw(void)
|
||||
{
|
||||
return BufferManager::SizeOpen();
|
||||
}
|
||||
|
||||
bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &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;
|
||||
|
||||
// transforme the ID in the real value ...
|
||||
int32_t realID = BufferManager::WitchBuffer(raw+1);
|
||||
if (BufferManager::Exist(realID)) {
|
||||
isModify = BufferManager::Get(realID)->IsModify();
|
||||
name = BufferManager::Get(realID)->GetFileName();
|
||||
char *tmpModify = (char*)" ";
|
||||
if (true == isModify) {
|
||||
tmpModify = (char*)"M";
|
||||
}
|
||||
myTextToWrite = "[";
|
||||
myTextToWrite += realID;
|
||||
myTextToWrite += "](";
|
||||
myTextToWrite += tmpModify;
|
||||
myTextToWrite += ") ";
|
||||
myTextToWrite += name.GetShortFilename();
|
||||
|
||||
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 = ColorizeManager::Get(selectFG);
|
||||
bg = ColorizeManager::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 (1 == IdInput && typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) {
|
||||
EDN_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw );
|
||||
int32_t selectBuf = BufferManager::WitchBuffer(raw+1);
|
||||
if ( 0 <= selectBuf) {
|
||||
m_selectedID = raw;
|
||||
SendMultiCast(ednMsgBufferId, selectBuf);
|
||||
}
|
||||
}
|
||||
MarkToReedraw();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
66
jni/edn/Gui/BufferView.h
Normal file
66
jni/edn/Gui/BufferView.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file BufferView.h
|
||||
* @brief Editeur De N'ours : main List Buffer Viewer (header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 09/12/2010
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
#ifndef __BUFFER_VIEW_H__
|
||||
#define __BUFFER_VIEW_H__
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <CodeView.h>
|
||||
#include <BufferManager.h>
|
||||
#include <Display.h>
|
||||
#include <MsgBroadcast.h>
|
||||
#include <ewol/widget/List.h>
|
||||
|
||||
|
||||
|
||||
class BufferView : public ewol::List
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
BufferView(void);
|
||||
~BufferView(void);
|
||||
/**
|
||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
||||
* @param[in] CallerObject Pointer on the EObject that information came from
|
||||
* @param[in] eventId Message registered by this class
|
||||
* @param[in] data Data registered by this class
|
||||
* @return ---
|
||||
*/
|
||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
|
||||
protected:
|
||||
// function call to display the list :
|
||||
virtual color_ts GetBasicBG(void);
|
||||
virtual uint32_t GetNuberOfColomn(void);
|
||||
virtual bool GetTitle(int32_t colomn, etk::UString &myTitle, color_ts &fg, color_ts &bg);
|
||||
virtual uint32_t GetNuberOfRaw(void);
|
||||
virtual bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, color_ts &fg, color_ts &bg);
|
||||
virtual bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y);
|
||||
private:
|
||||
int32_t m_selectedID;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
459
jni/edn/Gui/CodeView.cpp
Normal file
459
jni/edn/Gui/CodeView.cpp
Normal file
@@ -0,0 +1,459 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file CodeView.cpp
|
||||
* @brief Editeur De N'ours : Code Viewer Widget
|
||||
* This is an abstraction
|
||||
* @author Edouard DUPIN
|
||||
* @date 05/01/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <CodeView.h>
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <Display.h>
|
||||
#include <CodeView.h>
|
||||
#include <BufferManager.h>
|
||||
#include <ColorizeManager.h>
|
||||
#include <ClipBoard.h>
|
||||
#include <SearchData.h>
|
||||
|
||||
#include <ewol/WidgetManager.h>
|
||||
#include <ewol/EObject.h>
|
||||
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "ewol::CodeView"
|
||||
|
||||
|
||||
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;
|
||||
|
||||
m_textColorFg.red = 0.0;
|
||||
m_textColorFg.green = 0.0;
|
||||
m_textColorFg.blue = 0.0;
|
||||
m_textColorFg.alpha = 1.0;
|
||||
|
||||
m_textColorBg.red = 0.0;
|
||||
m_textColorBg.green = 0.0;
|
||||
m_textColorBg.blue = 0.0;
|
||||
m_textColorBg.alpha = 0.25;
|
||||
SetCanHaveFocus(true);
|
||||
RegisterMultiCast(ednMsgBufferId);
|
||||
}
|
||||
|
||||
CodeView::~CodeView(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool CodeView::CalculateMinSize(void)
|
||||
{
|
||||
m_minSize.x = 50;
|
||||
m_minSize.y = 50;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CodeView::CalculateMaxSize(void)
|
||||
{
|
||||
m_maxSize.x = 2048;
|
||||
int32_t letterHeight = ewol::GetHeight(m_fontNormal);
|
||||
m_maxSize.y = BufferManager::Get(m_bufferID)->GetNumberOfLine() * letterHeight;
|
||||
}
|
||||
|
||||
|
||||
void CodeView::OnDraw(void)
|
||||
{
|
||||
m_OObjectsColored[ m_currentDrawId].Draw();
|
||||
m_OObjectTextNormal[ m_currentDrawId].Draw();
|
||||
m_OObjectTextBold[ m_currentDrawId].Draw();
|
||||
m_OObjectTextItalic[ m_currentDrawId].Draw();
|
||||
m_OObjectTextBoldItalic[m_currentDrawId].Draw();
|
||||
}
|
||||
|
||||
void CodeView::OnRegenerateDisplay(void)
|
||||
{
|
||||
if (true == NeedRedraw()) {
|
||||
int64_t startTime = GetCurrentTime();
|
||||
|
||||
// For the scrooling windows
|
||||
CalculateMaxSize();
|
||||
|
||||
// clean internal elements ...
|
||||
m_OObjectTextNormal[ m_currentCreateId].SetFontID(m_fontNormal);
|
||||
m_OObjectTextBold[ m_currentCreateId].SetFontID(m_fontBold);
|
||||
m_OObjectTextItalic[ m_currentCreateId].SetFontID(m_fontItalic);
|
||||
m_OObjectTextBoldItalic[m_currentCreateId].SetFontID(m_fontBoldItalic);
|
||||
|
||||
m_OObjectTextNormal[ m_currentCreateId].Clear();
|
||||
m_OObjectTextBold[ m_currentCreateId].Clear();
|
||||
m_OObjectTextItalic[ m_currentCreateId].Clear();
|
||||
m_OObjectTextBoldItalic[m_currentCreateId].Clear();
|
||||
m_OObjectsColored[ m_currentCreateId].Clear();
|
||||
|
||||
|
||||
// generate the objects :
|
||||
BufferManager::Get(m_bufferID)->Display(m_OObjectTextNormal[m_currentCreateId],
|
||||
m_OObjectTextBold[m_currentCreateId],
|
||||
m_OObjectTextItalic[m_currentCreateId],
|
||||
m_OObjectTextBoldItalic[m_currentCreateId],
|
||||
m_OObjectsColored[m_currentCreateId],
|
||||
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
|
||||
|
||||
int64_t stopTime = GetCurrentTime();
|
||||
EDN_DEBUG("Display Code Generation = " << stopTime - startTime << " milli-s");
|
||||
|
||||
// call the herited class...
|
||||
WidgetScrooled::OnRegenerateDisplay();
|
||||
m_needFlipFlop = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool CodeView::OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData)
|
||||
{
|
||||
//EDN_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent);
|
||||
if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) {
|
||||
BufferManager::Get(m_bufferID)->AddChar(unicodeData);
|
||||
MarkToReedraw();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CodeView::OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveType_te moveTypeEvent)
|
||||
{
|
||||
if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) {
|
||||
BufferManager::Get(m_bufferID)->cursorMove(moveTypeEvent);
|
||||
MarkToReedraw();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Event on an input of this Widget
|
||||
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
|
||||
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
|
||||
* @param[in] pos Absolute position of the event
|
||||
* @return true the event is used
|
||||
* @return false the event is not used
|
||||
*/
|
||||
bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, coord2D_ts pos)
|
||||
{
|
||||
coord2D_ts relativePos = RelativePosition(pos);
|
||||
if (m_bufferID < 0) {
|
||||
return false;
|
||||
}
|
||||
if (true == WidgetScrooled::OnEventInput(IdInput, typeEvent, pos)) {
|
||||
ewol::widgetManager::FocusKeep(this);
|
||||
// nothing to do ... done on upper widet ...
|
||||
return true;
|
||||
}
|
||||
if (1 == IdInput) {
|
||||
#ifndef __MODE__Touch
|
||||
if (ewol::EVENT_INPUT_TYPE_DOWN == typeEvent) {
|
||||
m_buttunOneSelected = true;
|
||||
ewol::widgetManager::FocusKeep(this);
|
||||
BufferManager::Get(m_bufferID)->MouseEvent(m_fontNormal, relativePos.x+m_originScrooled.x, relativePos.y+m_originScrooled.y);
|
||||
MarkToReedraw();
|
||||
} else if (ewol::EVENT_INPUT_TYPE_UP == typeEvent) {
|
||||
m_buttunOneSelected = false;
|
||||
BufferManager::Get(m_bufferID)->Copy(COPY_MIDDLE_BUTTON);
|
||||
MarkToReedraw();
|
||||
} else
|
||||
#endif
|
||||
if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) {
|
||||
#ifdef __MODE__Touch
|
||||
ewol::widgetManager::FocusKeep(this);
|
||||
BufferManager::Get(m_bufferID)->MouseEvent(m_fontNormal, relativePos.x+m_originScrooled.x, relativePos.y+m_originScrooled.y);
|
||||
MarkToReedraw();
|
||||
#else
|
||||
// nothing to do ...
|
||||
#endif
|
||||
} else if (ewol::EVENT_INPUT_TYPE_DOUBLE == typeEvent) {
|
||||
BufferManager::Get(m_bufferID)->MouseEventDouble();
|
||||
MarkToReedraw();
|
||||
} else if (ewol::EVENT_INPUT_TYPE_TRIPLE == typeEvent) {
|
||||
BufferManager::Get(m_bufferID)->MouseEventTriple();
|
||||
MarkToReedraw();
|
||||
} else if (ewol::EVENT_INPUT_TYPE_MOVE == typeEvent) {
|
||||
if (true == m_buttunOneSelected) {
|
||||
int xxx, yyy;
|
||||
xxx = relativePos.x;
|
||||
yyy = relativePos.y;
|
||||
if (xxx<0) {
|
||||
xxx = 0;
|
||||
}
|
||||
if (yyy<0) {
|
||||
yyy = 0;
|
||||
}
|
||||
//EDN_INFO("mouse-motion BT1 %d, %d", xxx, yyy);
|
||||
BufferManager::Get(m_bufferID)->MouseSelectFromCursorTo(m_fontNormal, xxx, yyy);
|
||||
MarkToReedraw();
|
||||
}
|
||||
}
|
||||
} else if (2 == IdInput) {
|
||||
if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) {
|
||||
BufferManager::Get(m_bufferID)->MouseEvent(m_fontNormal, relativePos.x+m_originScrooled.x, relativePos.y+m_originScrooled.y);
|
||||
BufferManager::Get(m_bufferID)->Paste(COPY_MIDDLE_BUTTON);
|
||||
MarkToReedraw();
|
||||
ewol::widgetManager::FocusKeep(this);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
||||
* @param[in] CallerObject Pointer on the EObject that information came from
|
||||
* @param[in] eventId Message registered by this class
|
||||
* @param[in] data Data registered by this class
|
||||
* @return ---
|
||||
*/
|
||||
void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
||||
{
|
||||
ewol::WidgetScrooled::OnReceiveMessage(CallerObject, eventId, data);
|
||||
EDN_DEBUG("Extern Event : " << CallerObject << " type : " << eventId << " data=\"" << data << "\"");
|
||||
|
||||
|
||||
|
||||
if(eventId == ednMsgBufferId) {
|
||||
int32_t bufferID = 0;
|
||||
sscanf(data.Utf8Data(), "%d", &bufferID);
|
||||
EDN_INFO("Select a new Buffer ... " << bufferID);
|
||||
m_bufferID = bufferID;
|
||||
// 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;
|
||||
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:
|
||||
EDN_INFO("Select a new Buffer ... " << dataID);
|
||||
m_bufferID = dataID;
|
||||
BufferManager::Get(m_bufferID)->ForceReDraw(true);
|
||||
// request the display of the curent Editor
|
||||
SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, m_bufferID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_SAVE:
|
||||
SendMessage(EDN_MSG__BUFF_ID_SAVE, m_bufferID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_SAVE_AS:
|
||||
SendMessage(EDN_MSG__GUI_SHOW_SAVE_AS, m_bufferID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_REMOVE_LINE:
|
||||
BufferManager::Get(m_bufferID)->RemoveLine();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_SELECT_ALL:
|
||||
BufferManager::Get(m_bufferID)->SelectAll();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_UN_SELECT:
|
||||
BufferManager::Get(m_bufferID)->SelectNone();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_COPY:
|
||||
if (dataID == -1) {
|
||||
dataID = COPY_STD;
|
||||
}
|
||||
BufferManager::Get(m_bufferID)->Copy(dataID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_CUT:
|
||||
if (dataID == -1) {
|
||||
dataID = COPY_STD;
|
||||
}
|
||||
BufferManager::Get(m_bufferID)->Cut(dataID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_PASTE:
|
||||
if (dataID == -1) {
|
||||
dataID = COPY_STD;
|
||||
}
|
||||
BufferManager::Get(m_bufferID)->Paste(dataID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_FIND_PREVIOUS:
|
||||
{
|
||||
etk::UString myDataString;
|
||||
SearchData::GetSearch(myDataString);
|
||||
BufferManager::Get(m_bufferID)->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__CURRENT_FIND_NEXT:
|
||||
{
|
||||
etk::UString myDataString;
|
||||
SearchData::GetSearch(myDataString);
|
||||
BufferManager::Get(m_bufferID)->Search(myDataString, false, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__CURRENT_REPLACE:
|
||||
{
|
||||
etk::UString myDataString;
|
||||
SearchData::GetReplace(myDataString);
|
||||
BufferManager::Get(m_bufferID)->Replace(myDataString);
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__CURRENT_REPLACE_ALL:
|
||||
break;
|
||||
case EDN_MSG__CURRENT_CLOSE:
|
||||
SendMessage(EDN_MSG__BUFF_ID_CLOSE, m_bufferID);
|
||||
break;
|
||||
case EDN_MSG__CURRENT_UNDO:
|
||||
BufferManager::Get(m_bufferID)->Undo();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_REDO:
|
||||
BufferManager::Get(m_bufferID)->Redo();
|
||||
break;
|
||||
case EDN_MSG__CURRENT_GOTO_LINE:
|
||||
if (dataID<0) {
|
||||
dataID = 0;
|
||||
}
|
||||
BufferManager::Get(m_bufferID)->JumpAtLine(dataID);
|
||||
break;
|
||||
case EDN_MSG__REFRESH_DISPLAY:
|
||||
break;
|
||||
case EDN_MSG__CURRENT_SET_CHARSET:
|
||||
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
|
||||
MarkToReedraw();
|
||||
}
|
||||
|
||||
|
||||
void CodeView::OnGetFocus(void)
|
||||
{
|
||||
/*
|
||||
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::UString fontName)
|
||||
{
|
||||
int32_t fontID = ewol::LoadFont(fontName, m_fontSize);
|
||||
if (fontID >= 0) {
|
||||
m_fontNormal = fontID;
|
||||
}
|
||||
}
|
||||
|
||||
void CodeView::SetFontNameBold(etk::UString fontName)
|
||||
{
|
||||
int32_t fontID = ewol::LoadFont(fontName, m_fontSize);
|
||||
if (fontID >= 0) {
|
||||
m_fontBold = fontID;
|
||||
}
|
||||
}
|
||||
|
||||
void CodeView::SetFontNameItalic(etk::UString fontName)
|
||||
{
|
||||
int32_t fontID = ewol::LoadFont(fontName, m_fontSize);
|
||||
if (fontID >= 0) {
|
||||
m_fontItalic = fontID;
|
||||
}
|
||||
}
|
||||
|
||||
void CodeView::SetFontNameBoldItalic(etk::UString fontName)
|
||||
{
|
||||
int32_t fontID = ewol::LoadFont(fontName, m_fontSize);
|
||||
if (fontID >= 0) {
|
||||
m_fontBoldItalic = fontID;
|
||||
}
|
||||
}
|
100
jni/edn/Gui/CodeView.h
Normal file
100
jni/edn/Gui/CodeView.h
Normal file
@@ -0,0 +1,100 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file CodeView.h
|
||||
* @brief Editeur De N'ours : Code Viewer Widget (header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 05/01/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef __CODE_VIEW_H__
|
||||
#define __CODE_VIEW_H__
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <CodeView.h>
|
||||
#include <BufferManager.h>
|
||||
#include <Display.h>
|
||||
#include <MsgBroadcast.h>
|
||||
|
||||
#include <etk/Types.h>
|
||||
#include <ewol/widget/WidgetScrolled.h>
|
||||
|
||||
class CodeView :public ewol::WidgetScrooled
|
||||
{
|
||||
public:
|
||||
CodeView(void);
|
||||
virtual ~CodeView(void);
|
||||
virtual bool CalculateMinSize(void);
|
||||
private:
|
||||
etk::UString m_label;
|
||||
color_ts m_textColorFg; //!< Text color
|
||||
color_ts m_textColorBg; //!< Background color
|
||||
int32_t m_bufferID;
|
||||
bool m_buttunOneSelected;
|
||||
// drawing elements :
|
||||
ewol::OObject2DTextColored m_OObjectTextNormal[NB_BOUBLE_BUFFER];
|
||||
ewol::OObject2DTextColored m_OObjectTextBold[NB_BOUBLE_BUFFER];
|
||||
ewol::OObject2DTextColored m_OObjectTextItalic[NB_BOUBLE_BUFFER];
|
||||
ewol::OObject2DTextColored m_OObjectTextBoldItalic[NB_BOUBLE_BUFFER];
|
||||
ewol::OObject2DColored m_OObjectsColored[NB_BOUBLE_BUFFER];
|
||||
|
||||
public:
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
/**
|
||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
||||
* @param[in] CallerObject Pointer on the EObject that information came from
|
||||
* @param[in] eventId Message registered by this class
|
||||
* @param[in] data Data registered by this class
|
||||
* @return ---
|
||||
*/
|
||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
|
||||
public:
|
||||
/**
|
||||
* @brief Event on an input of this Widget
|
||||
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
|
||||
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
|
||||
* @param[in] pos Absolute position of the event
|
||||
* @return true the event is used
|
||||
* @return false the event is not used
|
||||
*/
|
||||
virtual bool OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, coord2D_ts pos);
|
||||
virtual bool OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData);
|
||||
virtual bool OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveType_te moveTypeEvent);
|
||||
virtual void OnGetFocus(void);
|
||||
virtual void OnLostFocus(void);
|
||||
private:
|
||||
int32_t m_fontSize;
|
||||
int32_t m_fontNormal;
|
||||
int32_t m_fontBold;
|
||||
int32_t m_fontItalic;
|
||||
int32_t m_fontBoldItalic;
|
||||
public:
|
||||
void SetFontSize(int32_t size);
|
||||
void SetFontNameNormal(etk::UString fontName);
|
||||
void SetFontNameBold(etk::UString fontName);
|
||||
void SetFontNameItalic(etk::UString fontName);
|
||||
void SetFontNameBoldItalic(etk::UString fontName);
|
||||
private:
|
||||
void CalculateMaxSize(void);
|
||||
protected:
|
||||
virtual void OnDraw(void);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
287
jni/edn/Gui/MainWindows.cpp
Normal file
287
jni/edn/Gui/MainWindows.cpp
Normal file
@@ -0,0 +1,287 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file MainWindows.cpp
|
||||
* @brief Editeur De N'ours : main Windows diplayer (Sources)
|
||||
* @author Edouard DUPIN
|
||||
* @date 04/01/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <MainWindows.h>
|
||||
#include <CodeView.h>
|
||||
#include <ClipBoard.h>
|
||||
#include <BufferView.h>
|
||||
|
||||
#include <ewol/widget/Button.h>
|
||||
#include <ewol/widget/CheckBox.h>
|
||||
#include <ewol/widget/SizerHori.h>
|
||||
#include <ewol/widget/SizerVert.h>
|
||||
#include <ewol/widget/Label.h>
|
||||
#include <ewol/widget/Entry.h>
|
||||
#include <ewol/widget/List.h>
|
||||
#include <ewol/widget/ContextMenu.h>
|
||||
#include <ewol/widget/PopUp.h>
|
||||
#include <ewol/widget/Spacer.h>
|
||||
#include <ewol/widget/Menu.h>
|
||||
#include <ewol/widgetMeta/FileChooser.h>
|
||||
#include <ewol/WidgetManager.h>
|
||||
#include <ewol/EObject.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "MainWindows"
|
||||
|
||||
MainWindows::MainWindows(void)
|
||||
{
|
||||
EDN_DEBUG("CREATE WINDOWS ... ");
|
||||
ewol::SizerVert * mySizerVert = NULL;
|
||||
ewol::SizerHori * mySizerHori = NULL;
|
||||
//ewol::Button * myButton = NULL;
|
||||
CodeView * myCodeView = NULL;
|
||||
BufferView * myBufferView = NULL;
|
||||
ewol::Menu * myMenu = NULL;
|
||||
|
||||
mySizerVert = new ewol::SizerVert();
|
||||
SetSubWidget(mySizerVert);
|
||||
|
||||
mySizerHori = new ewol::SizerHori();
|
||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||
|
||||
myMenu = new ewol::Menu();
|
||||
mySizerHori->SubWidgetAdd(myMenu);
|
||||
int32_t idMenuFile = myMenu->AddTitle("File");
|
||||
(void)myMenu->Add(idMenuFile, "New", "", ednMsgGuiNew);
|
||||
(void)myMenu->AddSpacer();
|
||||
(void)myMenu->Add(idMenuFile, "Open", "", ednMsgGuiOpen);
|
||||
(void)myMenu->Add(idMenuFile, "Close", "", ednMsgGuiClose, "current");
|
||||
(void)myMenu->Add(idMenuFile, "Close (all)", "", ednMsgGuiClose, "All");
|
||||
(void)myMenu->Add(idMenuFile, "Save", "", ednMsgGuiSave, "current");
|
||||
(void)myMenu->Add(idMenuFile, "Save As ...", "", ednMsgGuiSaveAs);
|
||||
(void)myMenu->AddSpacer();
|
||||
//(void)myMenu->Add(idMenuFile, "Exit", "", ednMsgGuiExit);
|
||||
int32_t idMenuEdit = myMenu->AddTitle("Edit");
|
||||
(void)myMenu->Add(idMenuEdit, "Undo", "", ednMsgGuiUndo);
|
||||
(void)myMenu->Add(idMenuEdit, "Redo", "", ednMsgGuiRedo);
|
||||
(void)myMenu->AddSpacer();
|
||||
(void)myMenu->Add(idMenuEdit, "Copy", "", ednMsgGuiCopy, "STD");
|
||||
(void)myMenu->Add(idMenuEdit, "Cut", "", ednMsgGuiCut, "STD");
|
||||
(void)myMenu->Add(idMenuEdit, "Paste", "", ednMsgGuiPaste, "STD");
|
||||
(void)myMenu->Add(idMenuEdit, "Redo", "", ednMsgGuiRedo);
|
||||
(void)myMenu->Add(idMenuEdit, "Remove","", ednMsgGuiRm);
|
||||
(void)myMenu->AddSpacer();
|
||||
(void)myMenu->Add(idMenuEdit, "Select All","", ednMsgGuiSelect, "ALL");
|
||||
(void)myMenu->Add(idMenuEdit, "Un-Select","", ednMsgGuiSelect, "NONE");
|
||||
(void)myMenu->Add(idMenuEdit, "Goto line ...","", ednMsgGuiGotoLine, "???");
|
||||
int32_t idMenuSearch = myMenu->AddTitle("Search");
|
||||
(void)myMenu->Add(idMenuSearch, "Search", "", ednMsgGuiSearch);
|
||||
(void)myMenu->Add(idMenuSearch, "Replace", "", ednMsgGuiReplace);
|
||||
(void)myMenu->AddSpacer();
|
||||
(void)myMenu->Add(idMenuSearch, "Find (previous)","", ednMsgGuiFind, "Previous");
|
||||
(void)myMenu->Add(idMenuSearch, "Find (next)", "", ednMsgGuiFind, "Next");
|
||||
(void)myMenu->Add(idMenuSearch, "Find (all)", "", ednMsgGuiFind, "All");
|
||||
(void)myMenu->Add(idMenuSearch, "Un-Select", "", ednMsgGuiFind, "None");
|
||||
int32_t idMenuCTags = myMenu->AddTitle("C-tags");
|
||||
(void)myMenu->Add(idMenuCTags, "Load", "", ednMsgGuiCtags, "Load");
|
||||
(void)myMenu->Add(idMenuCTags, "ReLoad", "", ednMsgGuiCtags, "ReLoad");
|
||||
(void)myMenu->Add(idMenuCTags, "Jump", "", ednMsgGuiCtags, "Jump");
|
||||
(void)myMenu->Add(idMenuCTags, "Back", "", ednMsgGuiCtags, "Back");
|
||||
(void)myMenu->AddTitle("?", "", ednMsgGuiAbout);
|
||||
|
||||
m_widgetLabelFileName = new ewol::Label("FileName");
|
||||
m_widgetLabelFileName->SetExpendX(true);
|
||||
m_widgetLabelFileName->SetFillY(true);
|
||||
mySizerHori->SubWidgetAdd(m_widgetLabelFileName);
|
||||
|
||||
mySizerHori = new ewol::SizerHori();
|
||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||
myBufferView = new BufferView();
|
||||
myBufferView->SetExpendX(false);
|
||||
myBufferView->SetExpendY(true);
|
||||
myBufferView->SetFillX(true);
|
||||
myBufferView->SetFillY(true);
|
||||
mySizerHori->SubWidgetAdd(myBufferView);
|
||||
myCodeView = new CodeView();
|
||||
myCodeView->SetExpendX(true);
|
||||
myCodeView->SetExpendY(true);
|
||||
myCodeView->SetFillX(true);
|
||||
myCodeView->SetFillY(true);
|
||||
|
||||
myCodeView->SetFontSize(11);
|
||||
myCodeView->SetFontNameNormal( "freefont/FreeMono.ttf");
|
||||
myCodeView->SetFontNameBold( "freefont/FreeMonoBold.ttf");
|
||||
myCodeView->SetFontNameItalic( "freefont/FreeMonoOblique.ttf");
|
||||
myCodeView->SetFontNameBoldItalic("freefont/FreeMonoBoldOblique.ttf");
|
||||
/*
|
||||
myCodeView->SetFontSize(11);
|
||||
myCodeView->SetFontNameNormal( "ubuntu/UbuntuMono-R.ttf");
|
||||
myCodeView->SetFontNameBold( "ubuntu/UbuntuMono-B.ttf");
|
||||
myCodeView->SetFontNameItalic( "ubuntu/UbuntuMono-RI.ttf");
|
||||
myCodeView->SetFontNameBoldItalic("ubuntu/UbuntuMono-BI.ttf");
|
||||
*/
|
||||
mySizerHori->SubWidgetAdd(myCodeView);
|
||||
|
||||
// Generic event ...
|
||||
RegisterMultiCast(ednMsgGuiSaveAs);
|
||||
RegisterMultiCast(ednMsgGuiOpen);
|
||||
RegisterMultiCast(ednMsgGuiAbout);
|
||||
// to update the title ...
|
||||
RegisterMultiCast(ednMsgBufferState);
|
||||
RegisterMultiCast(ednMsgBufferId);
|
||||
}
|
||||
|
||||
|
||||
MainWindows::~MainWindows(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
const char *const ednEventPopUpFileSelected = "edn-mainWindows-openSelected";
|
||||
const char *const ednEventPopUpFileSaveAs = "edn-mainWindows-saveAsSelected";
|
||||
|
||||
/**
|
||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
||||
* @param[in] CallerObject Pointer on the EObject that information came from
|
||||
* @param[in] eventId Message registered by this class
|
||||
* @param[in] data Data registered by this class
|
||||
* @return ---
|
||||
*/
|
||||
void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
||||
{
|
||||
ewol::Windows::OnReceiveMessage(CallerObject, eventId, data);
|
||||
|
||||
EDN_INFO("Receive Event from the main windows ... : widgetid=" << CallerObject << "\"" << eventId << "\" ==> data=\"" << data << "\"" );
|
||||
// Open file Section ...
|
||||
if (eventId == ednMsgGuiOpen) {
|
||||
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
|
||||
tmpWidget->SetTitle("Open Files ...");
|
||||
tmpWidget->SetValidateLabel("Open");
|
||||
// TODO : Set the good folder ...
|
||||
//tmpWidget->SetFolder("/");
|
||||
PopUpWidgetPush(tmpWidget);
|
||||
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected);
|
||||
} else if (eventId == ednEventPopUpFileSelected) {
|
||||
// get widget:
|
||||
ewol::FileChooser * tmpWidget = static_cast<ewol::FileChooser*>(CallerObject);
|
||||
if (NULL == tmpWidget) {
|
||||
EDN_ERROR("impossible to get pop_upWidget " << CallerObject);
|
||||
return;
|
||||
}
|
||||
// get the filename :
|
||||
etk::UString tmpData = tmpWidget->GetCompleateFileName();
|
||||
EDN_DEBUG("Request opening the file : " << tmpData);
|
||||
SendMultiCast(ednMsgOpenFile, tmpData);
|
||||
} else if (eventId == ednMsgGuiSaveAs) {
|
||||
if (data == "") {
|
||||
EDN_ERROR("Null data for Save As file ... ");
|
||||
} else {
|
||||
m_currentSavingAsIdBuffer = -1;
|
||||
if (data == "current") {
|
||||
m_currentSavingAsIdBuffer = BufferManager::GetSelected();
|
||||
} else {
|
||||
sscanf(data.Utf8Data(), "%d", &m_currentSavingAsIdBuffer);
|
||||
}
|
||||
|
||||
if (false == BufferManager::Exist(m_currentSavingAsIdBuffer)) {
|
||||
EDN_ERROR("Request saveAs on non existant Buffer ID=" << m_currentSavingAsIdBuffer);
|
||||
} else {
|
||||
Buffer * myBuffer = BufferManager::Get(m_currentSavingAsIdBuffer);
|
||||
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
|
||||
tmpWidget->SetTitle("Save Files As...");
|
||||
tmpWidget->SetValidateLabel("Save");
|
||||
etk::UString folder = "/home/";
|
||||
etk::UString fileName = "";
|
||||
if (true == myBuffer->HaveName()) {
|
||||
etk::File tmpName = myBuffer->GetFileName();
|
||||
folder = tmpName.GetFolder();
|
||||
fileName = tmpName.GetShortFilename();
|
||||
}
|
||||
tmpWidget->SetFolder(folder);
|
||||
tmpWidget->SetFileName(fileName);
|
||||
PopUpWidgetPush(tmpWidget);
|
||||
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSaveAs);
|
||||
}
|
||||
}
|
||||
} else if (eventId == ednEventPopUpFileSaveAs) {
|
||||
// get widget:
|
||||
ewol::FileChooser * tmpWidget = static_cast<ewol::FileChooser*>(CallerObject);
|
||||
if (NULL == tmpWidget) {
|
||||
EDN_ERROR("impossible to get pop_upWidget " << CallerObject);
|
||||
return;
|
||||
}
|
||||
// get the filename :
|
||||
etk::UString tmpData = tmpWidget->GetCompleateFileName();
|
||||
EDN_DEBUG("Request Saving As file : " << tmpData);
|
||||
|
||||
BufferManager::Get(m_currentSavingAsIdBuffer)->SetFileName(tmpData);
|
||||
SendMultiCast(ednMsgGuiSave, m_currentSavingAsIdBuffer);
|
||||
} else if( eventId == ednMsgBufferState
|
||||
|| eventId == ednMsgBufferId) {
|
||||
// the buffer change we need to update the widget string
|
||||
Buffer* tmpBuffer = BufferManager::Get(BufferManager::GetSelected());
|
||||
if (NULL != tmpBuffer) {
|
||||
etk::File compleateName = tmpBuffer->GetFileName();
|
||||
bool isModify = tmpBuffer->IsModify();
|
||||
etk::UString directName = compleateName.GetCompleateName();
|
||||
if (true == isModify) {
|
||||
directName += " *";
|
||||
}
|
||||
if (NULL == m_widgetLabelFileName) {
|
||||
return;
|
||||
}
|
||||
m_widgetLabelFileName->SetLabel(directName);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
// TODO : Set the Title ....
|
||||
} else if (eventId == ednMsgGuiAbout) {
|
||||
/*
|
||||
//Title
|
||||
"Edn"
|
||||
// version
|
||||
VERSION_TAG_NAME
|
||||
// comments:
|
||||
"Editeur De N'ours\n"
|
||||
"L'Editeur Desoxyribo-Nucleique.\n"
|
||||
"Source Code Editor\n"
|
||||
"Build Time : " VERSION_BUILD_TIME;
|
||||
// copyright
|
||||
"Copyright 2010 Edouard DUPIN, all right reserved";
|
||||
// licence
|
||||
"This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY\n\n"
|
||||
"You can:\n"
|
||||
" * Redistribute the sources code and binaries.\n"
|
||||
" * Modify the Sources code.\n"
|
||||
" * Use a part of the sources (less than 50%) in an other software, just write somewhere \"Edn is great\" visible by the user (on your product or on your website with a link to my page).\n"
|
||||
" * Redistribute the modification only if you want.\n"
|
||||
" * Send me the bug-fix (it could be great).\n"
|
||||
" * Pay me a beer or some other things.\n"
|
||||
" * Print the source code on WC paper ...\n\n"
|
||||
"You can NOT:\n"
|
||||
" * Earn money with this Software (But I can).\n"
|
||||
" * Add malware in the Sources.\n"
|
||||
" * Do something bad with the sources.\n"
|
||||
" * Use it to travel in the space with a toaster.\n\n"
|
||||
"I reserve the right to change this licence. If it change the version of the copy you have keep its own license."
|
||||
*/
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
@@ -25,55 +25,33 @@
|
||||
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <etk/Singleton.h>
|
||||
#include <MsgBroadcast.h>
|
||||
|
||||
#include <CodeView.h>
|
||||
#include <BufferView.h>
|
||||
#include <BufferManager.h>
|
||||
#include <MenuBar.h>
|
||||
#include <StatusBar.h>
|
||||
#include <ToolBar.h>
|
||||
#include <ewol/widget/Label.h>
|
||||
|
||||
|
||||
#ifndef __MAIN_WINDOWS_H__
|
||||
#define __MAIN_WINDOWS_H__
|
||||
#if 0
|
||||
class MainWindows: public etk::Singleton<MainWindows>, public MsgBroadcast
|
||||
{
|
||||
friend class etk::Singleton<MainWindows>;
|
||||
// specific for sigleton system...
|
||||
private:
|
||||
// Constructeur
|
||||
MainWindows(void);
|
||||
~MainWindows(void);
|
||||
public:
|
||||
//GtkWidget * GetWidget(void) { return m_mainWindow;};
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
//static bool OnQuit(GtkWidget *widget, gpointer data);
|
||||
//static gboolean OnStateChange(GtkWidget *widget, GdkEvent* event, gpointer data);
|
||||
|
||||
private:
|
||||
void SetTitle(etk::File &fileName, bool isModify);
|
||||
void SetNoTitle(void);
|
||||
// main windows widget :
|
||||
/*
|
||||
GtkWidget * m_mainWindow;
|
||||
GtkWidget * m_internalTitleLabel;
|
||||
BufferView m_BufferView;
|
||||
CodeView m_CodeView;
|
||||
MenuBar m_MenuBar;
|
||||
StatusBar m_StatusBar;
|
||||
ToolBar m_ToolBar;
|
||||
*/
|
||||
};
|
||||
#endif
|
||||
class MainWindows : public ewol::Windows
|
||||
{
|
||||
private:
|
||||
int32_t m_currentSavingAsIdBuffer;
|
||||
ewol::Label* m_widgetLabelFileName;
|
||||
public:
|
||||
// Constructeur
|
||||
MainWindows(void);
|
||||
~MainWindows(void);
|
||||
/**
|
||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
||||
* @param[in] CallerObject Pointer on the EObject that information came from
|
||||
* @param[in] eventId Message registered by this class
|
||||
* @param[in] data Data registered by this class
|
||||
* @return ---
|
||||
*/
|
||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
|
||||
};
|
||||
#endif
|
||||
|
@@ -195,7 +195,7 @@ void Search::Display(GtkWindow *parent)
|
||||
gtk_widget_set_sensitive(m_CkMatchCase, true);
|
||||
}
|
||||
// Remove data form the search
|
||||
etk::String myDataString = "";
|
||||
etk::UString myDataString = "";
|
||||
SearchData::SetSearch(myDataString);
|
||||
gtk_entry_set_text(GTK_ENTRY(m_searchEntry), myDataString.c_str());
|
||||
if (0 == strlen(myDataString.c_str())) {
|
||||
@@ -277,7 +277,7 @@ void Search::OnButtonReplaceAndNext(GtkWidget *widget, gpointer data)
|
||||
void Search::OnButtonQuit(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
//EDN_INFO("CALLBACK");
|
||||
Search * self = reinterpret_cast<Search*>(data);
|
||||
Search * self = static_cast<Search*>(data);
|
||||
self->Destroy();
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ void Search::OnCheckBoxEventCase(GtkWidget *widget, gpointer data)
|
||||
void Search::OnCheckBoxEventRegExp(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
//EDN_INFO("CALLBACK");
|
||||
Search * self = reinterpret_cast<Search*>(data);
|
||||
Search * self = static_cast<Search*>(data);
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
|
||||
SearchData::SetRegExp(true);
|
||||
gtk_widget_set_sensitive(self->m_CkMatchCase, false);
|
||||
@@ -317,11 +317,11 @@ void Search::OnCheckBoxEventRegExp(GtkWidget *widget, gpointer data)
|
||||
void Search::OnEntrySearchChange(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
//EDN_INFO("CALLBACK");
|
||||
Search * self = reinterpret_cast<Search*>(data);
|
||||
Search * self = static_cast<Search*>(data);
|
||||
// update research data
|
||||
const char *testData = gtk_entry_get_text(GTK_ENTRY(widget));
|
||||
if (NULL != testData) {
|
||||
etk::String myDataString = testData;
|
||||
etk::UString myDataString = testData;
|
||||
SearchData::SetSearch(myDataString);
|
||||
if (0 == strlen(testData)) {
|
||||
self->m_haveSearchData = false;
|
||||
@@ -343,11 +343,11 @@ void Search::OnEntrySearchChange(GtkWidget *widget, gpointer data)
|
||||
void Search::OnEntryReplaceChange(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
//EDN_INFO("CALLBACK");
|
||||
Search * self = reinterpret_cast<Search*>(data);
|
||||
Search * self = static_cast<Search*>(data);
|
||||
// update replace data
|
||||
const char *testData = gtk_entry_get_text(GTK_ENTRY(widget));
|
||||
if (NULL != testData) {
|
||||
etk::String myDataString = testData;
|
||||
etk::UString myDataString = testData;
|
||||
SearchData::SetReplace(myDataString);
|
||||
if (0 == strlen(testData)) {
|
||||
self->m_haveReplaceData = false;
|
@@ -27,14 +27,11 @@
|
||||
#define __SEARCH_H__
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <etk/Singleton.h>
|
||||
|
||||
|
||||
class Search: public etk::Singleton<Search>
|
||||
class Search
|
||||
{
|
||||
friend class etk::Singleton<Search>;
|
||||
// specific for sigleton system...
|
||||
private:
|
||||
public:
|
||||
// Constructeur
|
||||
Search(void);
|
||||
~Search(void);
|
@@ -31,13 +31,13 @@
|
||||
#define __class__ "SearchData"
|
||||
|
||||
|
||||
static etk::String m_findRequest = "";
|
||||
static etk::UString m_findRequest = "";
|
||||
|
||||
void SearchData::SetSearch(etk::String &myData)
|
||||
void SearchData::SetSearch(etk::UString &myData)
|
||||
{
|
||||
m_findRequest = myData;
|
||||
}
|
||||
void SearchData::GetSearch(etk::String &myData)
|
||||
void SearchData::GetSearch(etk::UString &myData)
|
||||
{
|
||||
myData = m_findRequest;
|
||||
}
|
||||
@@ -49,12 +49,12 @@ bool SearchData::IsSearchEmpty(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
static etk::String m_replaceRequest = "";
|
||||
void SearchData::SetReplace(etk::String &myData)
|
||||
static etk::UString m_replaceRequest = "";
|
||||
void SearchData::SetReplace(etk::UString &myData)
|
||||
{
|
||||
m_replaceRequest = myData;
|
||||
}
|
||||
void SearchData::GetReplace(etk::String &myData)
|
||||
void SearchData::GetReplace(etk::UString &myData)
|
||||
{
|
||||
myData = m_replaceRequest;
|
||||
}
|
@@ -30,11 +30,11 @@
|
||||
|
||||
namespace SearchData
|
||||
{
|
||||
void SetSearch(etk::String &myData);
|
||||
void GetSearch(etk::String &myData);
|
||||
void SetSearch(etk::UString &myData);
|
||||
void GetSearch(etk::UString &myData);
|
||||
bool IsSearchEmpty(void);
|
||||
void SetReplace(etk::String &myData);
|
||||
void GetReplace(etk::String &myData);
|
||||
void SetReplace(etk::UString &myData);
|
||||
void GetReplace(etk::UString &myData);
|
||||
bool IsReplaceEmpty(void);
|
||||
void SetCase(bool value);
|
||||
bool GetCase(void);
|
@@ -1,279 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file MainWindows.cpp
|
||||
* @brief Editeur De N'ours : main Windows diplayer (Sources)
|
||||
* @author Edouard DUPIN
|
||||
* @date 04/01/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <MainWindows.h>
|
||||
#include <CodeView.h>
|
||||
#include <ClipBoard.h>
|
||||
#include <BufferView.h>
|
||||
#include <AccelKey.h>
|
||||
|
||||
#include <ewol/widget/Button.h>
|
||||
#include <ewol/widget/CheckBox.h>
|
||||
#include <ewol/widget/SizerHori.h>
|
||||
#include <ewol/widget/SizerVert.h>
|
||||
#include <ewol/widget/Test.h>
|
||||
#include <ewol/widget/Label.h>
|
||||
#include <ewol/widget/Entry.h>
|
||||
#include <ewol/widget/List.h>
|
||||
#include <ewol/widget/PopUp.h>
|
||||
#include <ewol/widget/Spacer.h>
|
||||
#include <ewol/widgetMeta/FileChooser.h>
|
||||
#include <ewol/WidgetManager.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "MainWindows"
|
||||
|
||||
|
||||
|
||||
MainWindows::MainWindows(void)
|
||||
{
|
||||
EDN_DEBUG("CREATE WINDOWS ... ");
|
||||
ewol::SizerVert * mySizerVert = NULL;
|
||||
ewol::SizerHori * mySizerHori = NULL;
|
||||
ewol::Button * myButton = NULL;
|
||||
ewol::Label * myLabel = NULL;
|
||||
CodeView * myCodeView = NULL;
|
||||
|
||||
mySizerVert = new ewol::SizerVert();
|
||||
SetSubWidget(mySizerVert);
|
||||
|
||||
mySizerHori = new ewol::SizerHori();
|
||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||
|
||||
myButton = new ewol::Button("Open");
|
||||
mySizerHori->SubWidgetAdd(myButton);
|
||||
myButton = new ewol::Button("Close");
|
||||
mySizerHori->SubWidgetAdd(myButton);
|
||||
myButton = new ewol::Button("Save");
|
||||
mySizerHori->SubWidgetAdd(myButton);
|
||||
myButton = new ewol::Button("Save As ...");
|
||||
mySizerHori->SubWidgetAdd(myButton);
|
||||
|
||||
myLabel = new ewol::Label("FileName");
|
||||
myLabel->SetExpendX(true);
|
||||
myLabel->SetFillY(true);
|
||||
mySizerHori->SubWidgetAdd(myLabel);
|
||||
|
||||
mySizerHori = new ewol::SizerHori();
|
||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||
myCodeView = new CodeView();
|
||||
myCodeView->SetExpendX(true);
|
||||
myCodeView->SetExpendY(true);
|
||||
myCodeView->SetFillX(true);
|
||||
myCodeView->SetFillY(true);
|
||||
mySizerHori->SubWidgetAdd(myCodeView);
|
||||
|
||||
}
|
||||
|
||||
|
||||
MainWindows::~MainWindows(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef SDFGSDFGSDF___SDFGSDFG
|
||||
MainWindows::MainWindows(void) : MsgBroadcast("Main Windows", EDN_CAT_GUI)
|
||||
{
|
||||
m_mainWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||
|
||||
// select the program icone
|
||||
GError *err = NULL;
|
||||
etk::String iconeFile;
|
||||
iconeFile = "/usr/share/edn/images/icone.png";
|
||||
|
||||
GdkPixbuf * icone = gdk_pixbuf_new_from_file(iconeFile.c_str(), &err);
|
||||
if (err != NULL) {
|
||||
gtk_window_set_default_icon_name("text-editor");
|
||||
} else {
|
||||
gtk_window_set_icon(GTK_WINDOW(m_mainWindow), icone);
|
||||
}
|
||||
|
||||
// enable the close signal of the windows
|
||||
g_signal_connect(G_OBJECT(m_mainWindow), "delete-event", G_CALLBACK(OnQuit), this);
|
||||
g_signal_connect(G_OBJECT(m_mainWindow), "window-state-event", G_CALLBACK(OnStateChange), this);
|
||||
|
||||
// Create a vertical box for stacking the menu and editor widgets in.
|
||||
GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_add(GTK_CONTAINER(m_mainWindow), vbox);
|
||||
|
||||
// Set key Accelerator :
|
||||
AccelKey::getInstance()->LinkCommonAccel(GTK_WINDOW(m_mainWindow));
|
||||
|
||||
// Create the menu bar.
|
||||
GtkWidget *hboxMenu = gtk_hbox_new (FALSE, 0);
|
||||
gtk_box_pack_start( GTK_BOX (vbox), hboxMenu, FALSE, FALSE, 0);
|
||||
// Add Exit boutton
|
||||
etk::String ExitIconeFile;
|
||||
ExitIconeFile = "/usr/share/edn/images/delete-24px.png";
|
||||
// TODO : find a good way to change the size of an image
|
||||
GtkWidget *myImageQuit = gtk_image_new_from_file(ExitIconeFile.c_str());
|
||||
GtkIconSize mySize = GTK_ICON_SIZE_SMALL_TOOLBAR;
|
||||
//EDN_DEBUG(" plop : " << mySize);
|
||||
//gtk_image_get_icon_set( GTK_IMAGE(myImageQuit), NULL, &mySize);
|
||||
//EDN_DEBUG(" plop : " << mySize);
|
||||
GtkWidget *event_box = gtk_event_box_new();
|
||||
gtk_container_add(GTK_CONTAINER(event_box),myImageQuit);
|
||||
gtk_widget_add_events(event_box,GDK_BUTTON_PRESS_MASK);
|
||||
g_signal_connect(G_OBJECT(event_box), "button_press_event", G_CALLBACK(OnQuit), this);
|
||||
|
||||
gtk_box_pack_start( GTK_BOX(hboxMenu), event_box, FALSE, FALSE, 0);
|
||||
|
||||
// add the real menu bar
|
||||
gtk_box_pack_start( GTK_BOX (hboxMenu), m_MenuBar.GetWidget(), FALSE, FALSE, 0);
|
||||
|
||||
// Add title
|
||||
m_internalTitleLabel = gtk_label_new("Edn");
|
||||
gtk_box_pack_start( GTK_BOX (hboxMenu), m_internalTitleLabel, FALSE, FALSE, 0);
|
||||
// **********************************************************
|
||||
// * Horizontal ELEMENTS : *
|
||||
// **********************************************************
|
||||
// Create a vertical box for stacking the menu and editor widgets in.
|
||||
GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
|
||||
gtk_container_add(GTK_CONTAINER (vbox), hbox);
|
||||
// create the toolbar :
|
||||
// TreeView :
|
||||
gtk_box_pack_start(GTK_BOX(hbox), m_BufferView.GetMainWidget(), FALSE, TRUE, 1);
|
||||
|
||||
// Text displayer :
|
||||
gtk_box_pack_start( GTK_BOX (hbox), m_CodeView.GetMainWidget(), TRUE, TRUE, 0);
|
||||
|
||||
// Create the status bar
|
||||
//gtk_box_pack_end(GTK_BOX(vbox), m_StatusBar.GetWidget(), FALSE, FALSE, 0);
|
||||
|
||||
// recursive version of gtk_widget_show
|
||||
gtk_widget_show_all(m_mainWindow);
|
||||
|
||||
|
||||
MainWindows::~MainWindows(void)
|
||||
{
|
||||
/*
|
||||
if (NULL != m_DlgSearch) {
|
||||
delete m_DlgSearch;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MainWindows::SetTitle(etk::File &fileName, bool isModify)
|
||||
{
|
||||
etk::String tmp = "";
|
||||
if (fileName.GetShortFilename() != "") {
|
||||
tmp += fileName.GetShortFilename();
|
||||
tmp += " - ";
|
||||
tmp += fileName.GetFolder();
|
||||
tmp += " - ";
|
||||
}
|
||||
tmp += "Edn";
|
||||
//gtk_window_set_title(GTK_WINDOW(m_mainWindow), tmp.c_str());
|
||||
tmp = " ";
|
||||
if (fileName.GetShortFilename() != "") {
|
||||
tmp += fileName.GetFolder();
|
||||
tmp += "/";
|
||||
tmp += fileName.GetShortFilename();
|
||||
} else {
|
||||
tmp += "Edn";
|
||||
}
|
||||
tmp += " ";
|
||||
//gtk_label_set_text(GTK_LABEL(m_internalTitleLabel), tmp.c_str());
|
||||
|
||||
}
|
||||
|
||||
void MainWindows::SetNoTitle(void)
|
||||
{
|
||||
etk::String tmp = "Edn";
|
||||
//gtk_window_set_title(GTK_WINDOW(m_mainWindow), tmp.c_str());
|
||||
//gtk_label_set_text(GTK_LABEL(m_internalTitleLabel), tmp.c_str());
|
||||
}
|
||||
|
||||
void MainWindows::OnMessage(int32_t id, int32_t dataID)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case EDN_MSG__BUFFER_CHANGE_CURRENT:
|
||||
// change Title :
|
||||
// TODO : String error when remove the error with -1;
|
||||
if (-1 == dataID) {
|
||||
SetNoTitle();
|
||||
} else {
|
||||
/*
|
||||
Buffer *mybuf = BufferManager::getInstance()->Get(dataID);
|
||||
if (NULL != mybuf) {
|
||||
etk::File plop = mybuf->GetFileName();
|
||||
SetTitle(plop, mybuf->IsModify() );
|
||||
}
|
||||
*/
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
bool MainWindows::OnQuit(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
//MainWindows * self = reinterpret_cast<MainWindows*>(data);
|
||||
GeneralSendMessage(EDN_MSG__GUI_SHOW_EXIT_CONFIRMATION);
|
||||
// Close is not managed here ...
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
gboolean MainWindows::OnStateChange(GtkWidget *widget, GdkEvent* event, gpointer data)
|
||||
{
|
||||
MainWindows * self = reinterpret_cast<MainWindows*>(data);
|
||||
EDN_DEBUG("State change");
|
||||
EDN_INFO(" change state mask : " << event->window_state.changed_mask);
|
||||
EDN_INFO(" change state new val : " << event->window_state.new_window_state);
|
||||
if (event->window_state.changed_mask == GDK_WINDOW_STATE_MAXIMIZED) {
|
||||
EDN_INFO(" ==> Maximisation change...");
|
||||
if (event->window_state.new_window_state == GDK_WINDOW_STATE_MAXIMIZED) {
|
||||
EDN_INFO(" ==> ENABLE");
|
||||
gtk_window_set_decorated(GTK_WINDOW(self->m_mainWindow), FALSE);
|
||||
} else {
|
||||
EDN_INFO(" ==> DISABLE");
|
||||
gtk_window_set_decorated(GTK_WINDOW(self->m_mainWindow), TRUE);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
@@ -1,386 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file MenuBar.cpp
|
||||
* @brief Editeur De N'ours : abstraction of the menu bar (Sources)
|
||||
* @author Edouard DUPIN
|
||||
* @date 17/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 <MenuBar.h>
|
||||
#include <ClipBoard.h>
|
||||
#include <charset.h>
|
||||
#include <ColorizeManager.h>
|
||||
#if 0
|
||||
#define MENU_MSG
|
||||
const char * MSG_TogleDisplayChar = "Request a Togle of char displaying";
|
||||
const char * MSG_TogleDisplayEOL = "Request a Togle of displaying EndOfLine";
|
||||
const char * MSG_TogleAutoIndent = "Request a Togle of Auto Indent";
|
||||
const char * MSG_SetCharsetIso559_1 = "Set ISO 5589-1";
|
||||
const char * MSG_SetCharsetIso559_15 = "Set ISO 5589-15";
|
||||
const char * MSG_SetCharsetUTF8 = "Set UTF 8";
|
||||
const char * MSG_LoadColorBlack = "Load Color Black";
|
||||
const char * MSG_LoadColorWhite = "Load Color White";
|
||||
#define MSG_LINK(data)
|
||||
|
||||
|
||||
static void CB_menuGenerique(GtkMenuItem *menu_item, gpointer data)
|
||||
{
|
||||
//EDN_INFO("basic menue_event");
|
||||
messageData_ts * msg = (messageData_ts*)data;
|
||||
GeneralSendMessage(msg->msgId, msg->dataId);
|
||||
}
|
||||
|
||||
static void CB_menuInternal(GtkMenuItem *menu_item, gpointer data)
|
||||
{
|
||||
//EDN_INFO("basic menue_event");
|
||||
const char * myPointer = (const char*)data;
|
||||
if (myPointer == MSG_TogleDisplayChar) {
|
||||
if (globals::IsSetDisplaySpaceChar() == true) {
|
||||
globals::SetDisplaySpaceChar(false);
|
||||
} else {
|
||||
globals::SetDisplaySpaceChar(true);
|
||||
}
|
||||
} else if (myPointer == MSG_TogleDisplayEOL) {
|
||||
if (globals::IsSetDisplayEndOfLine() == true) {
|
||||
globals::SetDisplayEndOfLine(false);
|
||||
} else {
|
||||
globals::SetDisplayEndOfLine(true);
|
||||
}
|
||||
} else if (myPointer == MSG_TogleAutoIndent) {
|
||||
if (globals::IsSetAutoIndent() == true) {
|
||||
globals::SetAutoIndent(false);
|
||||
} else {
|
||||
globals::SetAutoIndent(true);
|
||||
}
|
||||
} else if (myPointer == MSG_SetCharsetIso559_1) {
|
||||
GeneralSendMessage(EDN_MSG__CURRENT_SET_CHARSET, EDN_CHARSET_ISO_8859_1);
|
||||
} else if (myPointer == MSG_SetCharsetIso559_15) {
|
||||
GeneralSendMessage(EDN_MSG__CURRENT_SET_CHARSET, EDN_CHARSET_ISO_8859_15);
|
||||
} else if (myPointer == MSG_SetCharsetUTF8) {
|
||||
GeneralSendMessage(EDN_MSG__CURRENT_SET_CHARSET, EDN_CHARSET_UTF8);
|
||||
} else if (myPointer == MSG_LoadColorWhite) {
|
||||
ColorizeManager * myColorSystem = ColorizeManager::getInstance();
|
||||
etk::String homedir;
|
||||
# ifdef NDEBUG
|
||||
homedir = "/usr/share/edn/";
|
||||
# else
|
||||
homedir = "./data/";
|
||||
# endif
|
||||
homedir += "color_white.xml";
|
||||
myColorSystem->LoadFile(homedir);
|
||||
} else if (myPointer == MSG_LoadColorBlack) {
|
||||
ColorizeManager * myColorSystem = ColorizeManager::getInstance();
|
||||
etk::String homedir;
|
||||
# ifdef NDEBUG
|
||||
homedir = "/usr/share/edn/";
|
||||
# else
|
||||
homedir = "./data/";
|
||||
# endif
|
||||
homedir += "color_black.xml";
|
||||
myColorSystem->LoadFile(homedir);
|
||||
}
|
||||
}
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "MenuBarMain"
|
||||
|
||||
class MenuBarMain
|
||||
{
|
||||
public:
|
||||
MenuBarMain(const char * title, GtkWidget * parent) : m_parent(NULL), m_menu(NULL), m_menuListe(NULL)
|
||||
{
|
||||
m_parent = parent;
|
||||
m_menu = gtk_menu_item_new_with_mnemonic(title);
|
||||
gtk_menu_shell_append( GTK_MENU_SHELL (parent), m_menu);
|
||||
}
|
||||
|
||||
~MenuBarMain(void)
|
||||
{
|
||||
|
||||
}
|
||||
private:
|
||||
void CheckSubMenu(void)
|
||||
{
|
||||
if (NULL == m_menuListe) {
|
||||
m_menuListe = gtk_menu_new();
|
||||
if (NULL != m_menuListe) {
|
||||
gtk_menu_item_set_submenu( GTK_MENU_ITEM (m_menu), m_menuListe);
|
||||
} else {
|
||||
EDN_ERROR("Can not create sub menu");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
void AddInternal(const char * title, const char * accelKey, const char * msg, bool enable = false)
|
||||
{
|
||||
CheckSubMenu();
|
||||
if (NULL == m_menuListe) {
|
||||
return;
|
||||
}
|
||||
// create ITEM
|
||||
GtkWidget *tmpWidget = gtk_menu_item_new_with_mnemonic(title);
|
||||
// set grisage :
|
||||
gtk_widget_set_sensitive(tmpWidget, enable);
|
||||
// add to the menu :
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(m_menuListe), tmpWidget);
|
||||
// accel KEY :
|
||||
AccelKey::getInstance()->SetAccel(tmpWidget, (char *)accelKey);
|
||||
// set callback
|
||||
g_signal_connect(G_OBJECT(tmpWidget), "activate", G_CALLBACK(CB_menuInternal), (void*)msg);
|
||||
}
|
||||
|
||||
|
||||
void Add(const char * title, const char * accelKey, messageType_te id = EDN_MSG__NONE, bool enable = false, int32_t dataSpecificID = -1)
|
||||
{
|
||||
CheckSubMenu();
|
||||
if (NULL == m_menuListe) {
|
||||
return;
|
||||
}
|
||||
messageData_ts * message = new messageData_ts;
|
||||
message->msgId = id;
|
||||
message->dataId = dataSpecificID;
|
||||
m_message.PushBack(message);
|
||||
// create ITEM
|
||||
GtkWidget *tmpWidget = gtk_menu_item_new_with_mnemonic(title);
|
||||
// set grisage :
|
||||
gtk_widget_set_sensitive(tmpWidget, enable);
|
||||
// add to the menu :
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(m_menuListe), tmpWidget);
|
||||
// accel KEY :
|
||||
AccelKey::getInstance()->SetAccel(tmpWidget, (char *)accelKey);
|
||||
// set callback
|
||||
if(EDN_MSG__NONE!=id) {
|
||||
g_signal_connect(G_OBJECT(tmpWidget), "activate", G_CALLBACK(CB_menuGenerique), message);
|
||||
}
|
||||
}
|
||||
|
||||
void AddGen(const char * title, const char * accelKey, messageType_te id = EDN_MSG__NONE, bool enable = false, int32_t dataSpecificID = -1)
|
||||
{
|
||||
CheckSubMenu();
|
||||
if (NULL == m_menuListe) {
|
||||
return;
|
||||
}
|
||||
messageData_ts * message = new messageData_ts;
|
||||
message->msgId = id;
|
||||
message->dataId = dataSpecificID;
|
||||
m_message.PushBack(message);
|
||||
// create ITEM
|
||||
GtkWidget *tmpWidget = gtk_image_menu_item_new_from_stock( title, AccelKey::getInstance()->GetAccel() );
|
||||
GdkColor color;
|
||||
gdk_color_parse ("red", &color);
|
||||
gtk_widget_modify_fg(tmpWidget, GTK_STATE_NORMAL, &color);
|
||||
gtk_widget_modify_bg(tmpWidget, GTK_STATE_NORMAL, &color);
|
||||
gtk_widget_modify_text(tmpWidget, GTK_STATE_NORMAL, &color);
|
||||
// set grisage :
|
||||
gtk_widget_set_sensitive(tmpWidget, enable);
|
||||
// add to the menu :
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(m_menuListe), tmpWidget);
|
||||
// accel KEY :
|
||||
AccelKey::getInstance()->SetAccel(tmpWidget, (char *)accelKey);
|
||||
// set callback
|
||||
if(EDN_MSG__NONE!=id) {
|
||||
g_signal_connect(G_OBJECT(tmpWidget), "activate", G_CALLBACK(CB_menuGenerique), message);
|
||||
}
|
||||
}
|
||||
|
||||
void AddSeparator(void)
|
||||
{
|
||||
CheckSubMenu();
|
||||
if (NULL == m_menuListe) {
|
||||
return;
|
||||
}
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL (m_menuListe), gtk_separator_menu_item_new() );
|
||||
}
|
||||
|
||||
private:
|
||||
GtkWidget * m_parent;
|
||||
GtkWidget * m_menu;
|
||||
GtkWidget * m_menuListe;
|
||||
etk::VectorType<messageData_ts*> m_message;
|
||||
};
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "MenuBar"
|
||||
|
||||
MenuBar::MenuBar(void) : MsgBroadcast("Menu bar", EDN_CAT_GUI)
|
||||
{
|
||||
m_mainWidget = gtk_menu_bar_new();
|
||||
MenuBarMain *tmp = NULL;
|
||||
|
||||
tmp = new MenuBarMain("_File", m_mainWidget);
|
||||
tmp->AddGen(GTK_STOCK_NEW, "ctrl+n", EDN_MSG__NEW, true);
|
||||
tmp->AddGen(GTK_STOCK_OPEN, "ctrl+o", EDN_MSG__GUI_SHOW_OPEN_FILE, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen("Close file", "ctrl+q", EDN_MSG__CURRENT_CLOSE, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen(GTK_STOCK_SAVE, "ctrl+s", EDN_MSG__CURRENT_SAVE, true);
|
||||
tmp->AddGen(GTK_STOCK_SAVE_AS, "ctrl+shift+s", EDN_MSG__CURRENT_SAVE_AS, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen(GTK_STOCK_QUIT, "ctrl+shift+q", EDN_MSG__GUI_SHOW_EXIT_CONFIRMATION, true);
|
||||
m_listMenu.PushBack(tmp);
|
||||
|
||||
tmp = new MenuBarMain("_Edit", m_mainWidget);
|
||||
tmp->AddGen(GTK_STOCK_UNDO, "ctrl+z", EDN_MSG__CURRENT_UNDO, true);
|
||||
tmp->AddGen(GTK_STOCK_REDO, "ctrl+shift+z", EDN_MSG__CURRENT_REDO, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen(GTK_STOCK_CUT, "ctrl+x", EDN_MSG__CURRENT_CUT, true, COPY_STD);
|
||||
tmp->AddGen(GTK_STOCK_COPY, "ctrl+c", EDN_MSG__CURRENT_COPY, true, COPY_STD);
|
||||
tmp->AddGen(GTK_STOCK_PASTE, "ctrl+v", EDN_MSG__CURRENT_PASTE, true, COPY_STD);
|
||||
// tmp->AddGen(GTK_STOCK_DELETE, NULL);
|
||||
tmp->AddGen("Remove line", "ctrl+w", EDN_MSG__CURRENT_REMOVE_LINE, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen(GTK_STOCK_SELECT_ALL, "ctrl+a", EDN_MSG__CURRENT_SELECT_ALL, true);
|
||||
tmp->AddGen("Unselect", "ctrl+shift+a", EDN_MSG__CURRENT_UN_SELECT, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen("Goto Line number ...", "ctrl+l", EDN_MSG__GUI_SHOW_GOTO_LINE, true);
|
||||
// tmp->AddSeparator();
|
||||
// tmp->AddGen(GTK_STOCK_PREFERENCES, NULL, EDN_MSG__GUI_SHOW_PREFERENCE, true);
|
||||
m_listMenu.PushBack(tmp);
|
||||
|
||||
tmp = new MenuBarMain("_Search", m_mainWidget);
|
||||
tmp->AddGen(GTK_STOCK_FIND, "ctrl+f", EDN_MSG__GUI_SHOW_SEARCH, true);
|
||||
tmp->AddGen(GTK_STOCK_FIND_AND_REPLACE, "ctrl+r", EDN_MSG__GUI_SHOW_REPLACE, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen("Find next", "ctrl+h", EDN_MSG__CURRENT_FIND_NEXT, true);
|
||||
tmp->AddGen("Find previous", "ctrl+shift+h", EDN_MSG__CURRENT_FIND_PREVIOUS, true);
|
||||
// tmp->AddGen("Find old next", "ctrl+g", EDN_MSG__CURRENT_FIND_OLD_NEXT, true);
|
||||
// tmp->AddGen("Find old previous", "ctrl+shift+g", EDN_MSG__CURRENT_FIND_OLD_PREVIOUS, true);
|
||||
// tmp->AddSeparator();
|
||||
// tmp->AddGen("Suprimer colorisation", NULL);
|
||||
// tmp->AddSeparator();
|
||||
// tmp->AddGen("Goto Line", "ctrl+l", EDN_MSG__CURRENT_GOTO_LINE, true);
|
||||
m_listMenu.PushBack(tmp);
|
||||
|
||||
tmp = new MenuBarMain("Display", m_mainWidget);
|
||||
tmp->AddInternal("Show space & tabs", NULL, MSG_TogleDisplayChar, true);
|
||||
tmp->AddInternal("Show end of lines", NULL, MSG_TogleDisplayEOL, true);
|
||||
tmp->AddInternal("Audo Indent", NULL, MSG_TogleAutoIndent, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddInternal("Set charset Occidental (ISO-8859-1)", NULL, MSG_SetCharsetIso559_1, true);
|
||||
tmp->AddInternal("Set charset Occidental (ISO-8859-15)", NULL, MSG_SetCharsetIso559_15, true);
|
||||
tmp->AddInternal("Set charset Internationnal (UTF 8)", NULL, MSG_SetCharsetUTF8, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen( "Reload Color File", NULL, EDN_MSG__RELOAD_COLOR_FILE, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddInternal("Set Color Black", NULL, MSG_LoadColorBlack, true);
|
||||
tmp->AddInternal("Set Color White", NULL, MSG_LoadColorWhite, true);
|
||||
m_listMenu.PushBack(tmp);
|
||||
/*
|
||||
tmp = new MenuBarMain("Project", m_mainWidget);
|
||||
m_listMenu.PushBack(tmp);
|
||||
*/
|
||||
tmp = new MenuBarMain("Ctags", m_mainWidget);
|
||||
tmp->AddGen("load Ctags file", NULL, EDN_MSG__OPEN_CTAGS, true);
|
||||
tmp->AddGen("re-load Ctags file", NULL, EDN_MSG__RELOAD_CTAGS, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen("Find Definition", "ctrl+d", EDN_MSG__JUMP_TO_CURRENT_SELECTION, true);
|
||||
tmp->AddGen("Back previous", "ctrl+shift+d", EDN_MSG__JUMP_BACK, true);
|
||||
/*
|
||||
tmp->AddGen("Gestion Ctags", NULL);
|
||||
tmp->AddGen("Add Ctags Folder", NULL);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen("Trouver la definition", NULL);
|
||||
tmp->AddGen("Trouver la declaration", NULL);
|
||||
tmp->AddGen("Retour...", NULL);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen("Tout desactiver", NULL);
|
||||
*/
|
||||
m_listMenu.PushBack(tmp);
|
||||
/*
|
||||
tmp = new MenuBarMain("Macros", m_mainWidget);
|
||||
m_listMenu.PushBack(tmp);
|
||||
*/
|
||||
/*
|
||||
tmp = new MenuBarMain("Tools", m_mainWidget);
|
||||
tmp->AddGen("Execute Commande", "ctrl+e");
|
||||
tmp->AddGen("Set Command", NULL);
|
||||
m_listMenu.PushBack(tmp);
|
||||
*/
|
||||
tmp = new MenuBarMain("Internal ClipBoard", m_mainWidget);
|
||||
// tmp->AddGen("Cut 1", "ctrl+alt+1", EDN_MSG__CURRENT_CUT, true, 1);
|
||||
tmp->AddGen("Copy 1", "ctrl+1", EDN_MSG__CURRENT_COPY, true, 1);
|
||||
tmp->AddGen("Paste 1", "alt+1", EDN_MSG__CURRENT_PASTE, true, 1);
|
||||
tmp->AddSeparator();
|
||||
// tmp->AddGen("Cut 2", "ctrl+alt+2", EDN_MSG__CURRENT_CUT, true, 2);
|
||||
tmp->AddGen("Copy 2", "ctrl+2", EDN_MSG__CURRENT_COPY, true, 2);
|
||||
tmp->AddGen("Paste 2", "alt+2", EDN_MSG__CURRENT_PASTE, true, 2);
|
||||
tmp->AddSeparator();
|
||||
// tmp->AddGen("Cut 3", "ctrl+alt+3", EDN_MSG__CURRENT_CUT, true, 3);
|
||||
tmp->AddGen("Copy 3", "ctrl+3", EDN_MSG__CURRENT_COPY, true, 3);
|
||||
tmp->AddGen("Paste 3", "alt+3", EDN_MSG__CURRENT_PASTE, true, 3);
|
||||
tmp->AddSeparator();
|
||||
// tmp->AddGen("Cut 4", "ctrl+alt+4", EDN_MSG__CURRENT_CUT, true, 4);
|
||||
tmp->AddGen("Copy 4", "ctrl+4", EDN_MSG__CURRENT_COPY, true, 4);
|
||||
tmp->AddGen("Paste 4", "alt+4", EDN_MSG__CURRENT_PASTE, true, 4);
|
||||
tmp->AddSeparator();
|
||||
// tmp->AddGen("Cut 5", "ctrl+alt+5", EDN_MSG__CURRENT_CUT, true, 5);
|
||||
tmp->AddGen("Copy 5", "ctrl+5", EDN_MSG__CURRENT_COPY, true, 5);
|
||||
tmp->AddGen("Paste 5", "alt+5", EDN_MSG__CURRENT_PASTE, true, 5);
|
||||
tmp->AddSeparator();
|
||||
// tmp->AddGen("Cut 6", "ctrl+alt+6", EDN_MSG__CURRENT_CUT, true, 6);
|
||||
tmp->AddGen("Copy 6", "ctrl+6", EDN_MSG__CURRENT_COPY, true, 6);
|
||||
tmp->AddGen("Paste 6", "alt+6", EDN_MSG__CURRENT_PASTE, true, 6);
|
||||
tmp->AddSeparator();
|
||||
// tmp->AddGen("Cut 7", "ctrl+alt+7", EDN_MSG__CURRENT_CUT, true, 7);
|
||||
tmp->AddGen("Copy 7", "ctrl+7", EDN_MSG__CURRENT_COPY, true, 7);
|
||||
tmp->AddGen("Paste 7", "alt+7", EDN_MSG__CURRENT_PASTE, true, 7);
|
||||
tmp->AddSeparator();
|
||||
// tmp->AddGen("Cut 8", "ctrl+alt+8", EDN_MSG__CURRENT_CUT, true, 8);
|
||||
tmp->AddGen("Copy 8", "ctrl+8", EDN_MSG__CURRENT_COPY, true, 8);
|
||||
tmp->AddGen("Paste 8", "alt+8", EDN_MSG__CURRENT_PASTE, true, 8);
|
||||
tmp->AddSeparator();
|
||||
// tmp->AddGen("Cut 9", "ctrl+alt+9", EDN_MSG__CURRENT_CUT, true, 9);
|
||||
tmp->AddGen("Copy 9", "ctrl+9", EDN_MSG__CURRENT_COPY, true, 9);
|
||||
tmp->AddGen("Paste 9", "alt+9", EDN_MSG__CURRENT_PASTE, true, 9);
|
||||
m_listMenu.PushBack(tmp);
|
||||
|
||||
tmp = new MenuBarMain("Help", m_mainWidget);
|
||||
tmp->AddGen("help display", NULL, EDN_MSG__OPEN_CTAGS, false);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen("About ...", NULL, EDN_MSG__GUI_SHOW_ABOUT, true);
|
||||
/*
|
||||
tmp->AddGen("Gestion Ctags", NULL);
|
||||
tmp->AddGen("Add Ctags Folder", NULL);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen("Trouver la definition", NULL);
|
||||
tmp->AddGen("Trouver la declaration", NULL);
|
||||
tmp->AddGen("Retour...", NULL);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen("Tout desactiver", NULL);
|
||||
*/
|
||||
m_listMenu.PushBack(tmp);
|
||||
|
||||
}
|
||||
|
||||
MenuBar::~MenuBar(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MenuBar::OnMessage(int32_t id, int32_t dataID)
|
||||
{
|
||||
//EDN_INFO("ReceiveMessage");
|
||||
}
|
||||
|
||||
#endif
|
@@ -1,55 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file MenuBar.h
|
||||
* @brief Editeur De N'ours : abstraction of the menu bar (Header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 17/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 <MsgBroadcast.h>
|
||||
#include <etk/VectorType.h>
|
||||
#include <AccelKey.h>
|
||||
|
||||
#ifndef __MENU_BAR_H__
|
||||
#define __MENU_BAR_H__
|
||||
|
||||
//class MenuBarMain;
|
||||
|
||||
class MenuBar: public MsgBroadcast
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
MenuBar(void) : MsgBroadcast("Menu bar", EDN_CAT_GUI){};
|
||||
~MenuBar(void) {};
|
||||
//GtkWidget * GetWidget(void) { return m_mainWidget; };
|
||||
void OnMessage(int32_t id, int32_t dataID) {};
|
||||
|
||||
private:
|
||||
/*
|
||||
GtkWidget * m_mainWidget;
|
||||
GtkAccelGroup * m_accelGroup;
|
||||
etk::VectorType<MenuBarMain*> m_listMenu;
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@@ -1,54 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file StatusBar.cpp
|
||||
* @brief Editeur De N'ours : abstraction of the status bar (Sources)
|
||||
* @author Edouard DUPIN
|
||||
* @date 17/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 <StatusBar.h>
|
||||
|
||||
|
||||
|
||||
StatusBar::StatusBar(void) : MsgBroadcast("Status bar", EDN_CAT_GUI)
|
||||
{
|
||||
/*
|
||||
m_mainWidget = gtk_statusbar_new();
|
||||
// pas tr<74>s bien compris pourquoi mais ca marche...
|
||||
m_iContextId = gtk_statusbar_get_context_id(GTK_STATUSBAR(m_mainWidget), "ExitMsg");
|
||||
// ajout d'un message :
|
||||
gtk_statusbar_push(GTK_STATUSBAR (m_mainWidget), GPOINTER_TO_INT(m_iContextId), "Edn Editeur de n'ours");
|
||||
// Supression du pr<70>c<EFBFBD>dent message :
|
||||
//gtk_statusbar_pop(GTK_STATUSBAR(m_mainWidget), GPOINTER_TO_INT(m_iContextId));
|
||||
*/
|
||||
}
|
||||
|
||||
StatusBar::~StatusBar(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void StatusBar::OnMessage(int32_t id, int32_t dataID)
|
||||
{
|
||||
//EDN_INFO("ReceiveMessage");
|
||||
}
|
||||
|
||||
|
@@ -1,46 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file StatusBar.h
|
||||
* @brief Editeur De N'ours : abstraction of the status bar (Header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 17/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 <MsgBroadcast.h>
|
||||
|
||||
#ifndef __STATUS_BAR_H__
|
||||
#define __STATUS_BAR_H__
|
||||
|
||||
class StatusBar: public MsgBroadcast
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
StatusBar(void);
|
||||
~StatusBar(void);
|
||||
//GtkWidget * GetWidget(void) { return m_mainWidget; };
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
|
||||
private:
|
||||
//GtkWidget * m_mainWidget;
|
||||
//guint m_iContextId;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@@ -1,95 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file ToolBar.cpp
|
||||
* @brief Editeur De N'ours : abstraction of the tool bar (Sources)
|
||||
* @author Edouard DUPIN
|
||||
* @date 17/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 <ToolBar.h>
|
||||
#include <ClipBoard.h>
|
||||
|
||||
/*
|
||||
static void CB_menuGenerique(GtkMenuItem *menu_item, gpointer data)
|
||||
{
|
||||
//EDN_INFO("basic menue_event");
|
||||
messageData_ts * msg = (messageData_ts*)data;
|
||||
// broacast message :
|
||||
GeneralSendMessage(msg->msgId, msg->dataId);
|
||||
}
|
||||
*/
|
||||
|
||||
ToolBar::ToolBar(void) : MsgBroadcast("Tool bar", EDN_CAT_GUI)
|
||||
{
|
||||
/*
|
||||
m_mainWidget = gtk_toolbar_new();
|
||||
# ifdef USE_GTK_VERSION_2_0
|
||||
gtk_toolbar_set_orientation(GTK_TOOLBAR(m_mainWidget), GTK_ORIENTATION_VERTICAL);
|
||||
# endif
|
||||
// Modification de la taille des icones
|
||||
gtk_toolbar_set_icon_size(GTK_TOOLBAR(m_mainWidget), GTK_ICON_SIZE_BUTTON);
|
||||
// Affichage uniquement des icones
|
||||
gtk_toolbar_set_style(GTK_TOOLBAR(m_mainWidget), GTK_TOOLBAR_ICONS);
|
||||
|
||||
Add(GTK_STOCK_NEW, "Nouveau", EDN_MSG__NEW);
|
||||
Add(GTK_STOCK_OPEN, "Ouvrir", EDN_MSG__GUI_SHOW_OPEN_FILE);
|
||||
AddSeparator();
|
||||
Add(GTK_STOCK_SAVE, "Enregistrer", EDN_MSG__CURRENT_SAVE);
|
||||
Add(GTK_STOCK_SAVE_AS, "Enregistrer sous", EDN_MSG__CURRENT_SAVE_AS);
|
||||
AddSeparator();
|
||||
Add(GTK_STOCK_QUIT, "Quitter");
|
||||
*/
|
||||
}
|
||||
|
||||
ToolBar::~ToolBar(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ToolBar::OnMessage(int32_t id, int32_t dataID)
|
||||
{
|
||||
//EDN_INFO("ReceiveMessage");
|
||||
}
|
||||
/*
|
||||
void ToolBar::AddSeparator(void)
|
||||
{
|
||||
# ifdef USE_GTK_VERSION_3_0
|
||||
# elif defined( USE_GTK_VERSION_2_0)
|
||||
gtk_toolbar_append_space(GTK_TOOLBAR(m_mainWidget));
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
void ToolBar::Add(const char * title, const char * labelHelp, messageType_te id, bool enable)
|
||||
{
|
||||
messageData_ts * message = new messageData_ts;
|
||||
message->msgId = id;
|
||||
message->dataId = -1;
|
||||
m_message.PushBack(message);
|
||||
# ifdef USE_GTK_VERSION_3_0
|
||||
# elif defined( USE_GTK_VERSION_2_0)
|
||||
gtk_toolbar_insert_stock(GTK_TOOLBAR(m_mainWidget), title, labelHelp, NULL, G_CALLBACK(CB_menuGenerique), message, -1);
|
||||
# endif
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
@@ -1,49 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file ToolBar.h
|
||||
* @brief Editeur De N'ours : abstraction of the tool bar (Header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 17/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 <MsgBroadcast.h>
|
||||
|
||||
#ifndef __TOOL_BAR_H__
|
||||
#define __TOOL_BAR_H__
|
||||
|
||||
|
||||
class ToolBar: public MsgBroadcast
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
ToolBar(void);
|
||||
~ToolBar(void);
|
||||
//GtkWidget * GetWidget(void) { return m_mainWidget; };
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
|
||||
private:
|
||||
//void AddSeparator(void);
|
||||
//void Add(const char * title, const char * labelHelp, messageType_te id = EDN_MSG__NONE, bool enable = false);
|
||||
//GtkWidget * m_mainWidget;
|
||||
//etk::VectorType<messageData_ts*> m_message;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@@ -1,320 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file WindowsManager.cpp
|
||||
* @brief Editeur De N'ours : Windows creation, pop up, destruction ... (Sources)
|
||||
* @author Edouard DUPIN
|
||||
* @date 20/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 <WindowsManager.h>
|
||||
#include <MainWindows.h>
|
||||
#include <Search.h>
|
||||
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "WindowsManager"
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
WindowsManager::WindowsManager(void) : MsgBroadcast("Windows Manager", EDN_CAT_GUI_MANAGER)
|
||||
{
|
||||
m_currentBufferID = -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
WindowsManager::~WindowsManager(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void WindowsManager::OnMessage(int32_t id, int32_t dataID)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
/*
|
||||
case EDN_MSG__BUFFER_CHANGE_CURRENT:
|
||||
m_currentBufferID = dataID;
|
||||
break;
|
||||
case EDN_MSG__GUI_SHOW_MAIN_WINDOWS:
|
||||
EDN_INFO("Request opening MAIN_WINDOWS");
|
||||
m_mainWindow = MainWindows::getInstance();
|
||||
break;
|
||||
case EDN_MSG__GUI_SHOW_SEARCH:
|
||||
EDN_INFO("Request opening SEARCH");
|
||||
{
|
||||
Search *myInstance = Search::getInstance();
|
||||
myInstance->Display(GTK_WINDOW(m_mainWindow->GetWidget()));
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__GUI_SHOW_PREFERENCE:
|
||||
EDN_INFO("Request opening PREFERENCE");
|
||||
break;
|
||||
case EDN_MSG__GUI_SHOW_REPLACE:
|
||||
EDN_INFO("Request opening REPLACE");
|
||||
break;
|
||||
case EDN_MSG__GUI_SHOW_OPEN_FILE:
|
||||
EDN_INFO("Request opening OPEN_FILE");
|
||||
{
|
||||
BufferManager *myBufferManager = NULL;
|
||||
myBufferManager = BufferManager::getInstance();
|
||||
|
||||
GtkWidget *dialog = gtk_file_chooser_dialog_new( "Open File", NULL,
|
||||
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
|
||||
NULL); // end button/response list
|
||||
// this element did not apear in the miniature of the windows
|
||||
gtk_window_set_skip_pager_hint(GTK_WINDOW(dialog), TRUE);
|
||||
if( -1 != m_currentBufferID
|
||||
&& true == myBufferManager->Exist(m_currentBufferID) )
|
||||
{
|
||||
etk::File fileName = myBufferManager->Get(m_currentBufferID)->GetFileName();
|
||||
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), fileName.GetFolder().c_str());
|
||||
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), fileName.GetShortFilename().c_str());
|
||||
}
|
||||
if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
|
||||
{
|
||||
etk::File myfilename;
|
||||
myfilename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (dialog));
|
||||
|
||||
if (false == myBufferManager->Exist(myfilename) ) {
|
||||
int32_t openID = myBufferManager->Open(myfilename);
|
||||
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, openID);
|
||||
} else {
|
||||
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, myBufferManager->GetId(myfilename));
|
||||
}
|
||||
}
|
||||
gtk_widget_destroy(dialog);
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__GUI_SHOW_SAVE_AS:
|
||||
EDN_INFO("Request opening SAVE_AS");
|
||||
// save only if one element is selected
|
||||
if (BufferManager::getInstance()->Size() > 0) {
|
||||
int32_t idSelected;
|
||||
if(-1 == dataID) {
|
||||
idSelected = BufferManager::getInstance()->GetSelected();
|
||||
} else {
|
||||
idSelected = dataID;
|
||||
}
|
||||
Buffer *myBuffer = BufferManager::getInstance()->Get(idSelected);
|
||||
etk::String tmpString = "Save as file : ";
|
||||
tmpString += myBuffer->GetFileName().GetShortFilename().c_str();
|
||||
GtkWidget *dialog = gtk_file_chooser_dialog_new( tmpString.c_str(), NULL,
|
||||
GTK_FILE_CHOOSER_ACTION_SAVE,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
|
||||
NULL); // end button/response list
|
||||
// this element did not apear in the miniature of the windows
|
||||
gtk_window_set_skip_pager_hint(GTK_WINDOW(dialog), TRUE);
|
||||
if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
|
||||
{
|
||||
etk::String myfilename;
|
||||
myfilename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (dialog));
|
||||
|
||||
myBuffer->SetFileName(myfilename);
|
||||
myBuffer->Save();
|
||||
|
||||
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, idSelected);
|
||||
}
|
||||
gtk_widget_destroy(dialog); // implicitly hides dialog
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__GUI_SHOW_ABOUT:
|
||||
{
|
||||
GtkWidget *myDialog = gtk_about_dialog_new();
|
||||
gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(myDialog), "Edn");
|
||||
gtk_about_dialog_set_version( GTK_ABOUT_DIALOG(myDialog), VERSION_TAG_NAME);
|
||||
gtk_about_dialog_set_comments( GTK_ABOUT_DIALOG(myDialog), "Editeur De N'ours\n"
|
||||
"L'Editeur Desoxyribo-Nucleique.\n"
|
||||
"Source Code Editor\n"
|
||||
"Build Time : " VERSION_BUILD_TIME);
|
||||
gtk_about_dialog_set_copyright( GTK_ABOUT_DIALOG(myDialog), "Copyright 2010 Edouard DUPIN, all right reserved");
|
||||
gtk_about_dialog_set_license( GTK_ABOUT_DIALOG(myDialog), "This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY\n\n"
|
||||
"You can:\n"
|
||||
" * Redistribute the sources code and binaries.\n"
|
||||
" * Modify the Sources code.\n"
|
||||
" * Use a part of the sources (less than 50%) in an other software, just write somewhere \"Edn is great\" visible by the user (on your product or on your website with a link to my page).\n"
|
||||
" * Redistribute the modification only if you want.\n"
|
||||
" * Send me the bug-fix (it could be great).\n"
|
||||
" * Pay me a beer or some other things.\n"
|
||||
" * Print the source code on WC paper ...\n\n"
|
||||
"You can NOT:\n"
|
||||
" * Earn money with this Software (But I can).\n"
|
||||
" * Add malware in the Sources.\n"
|
||||
" * Do something bad with the sources.\n"
|
||||
" * Use it to travel in the space with a toaster.\n\n"
|
||||
"I reserve the right to change this licence. If it change the version of the copy you have keep its own license.");
|
||||
gtk_about_dialog_set_wrap_license(GTK_ABOUT_DIALOG(myDialog), true);
|
||||
# if USE_GTK_VERSION_3_0
|
||||
gtk_about_dialog_set_license_type(GTK_ABOUT_DIALOG(myDialog), GTK_LICENSE_CUSTOM);
|
||||
# endif
|
||||
gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(myDialog), "http://HeeroYui.github.com/edn");
|
||||
gtk_about_dialog_set_website_label(GTK_ABOUT_DIALOG(myDialog), "Edn on github");
|
||||
const char * listAutor[] = {"Edouard DUPIN", NULL};
|
||||
gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(myDialog), listAutor);
|
||||
// Display About
|
||||
gtk_dialog_run(GTK_DIALOG(myDialog));
|
||||
gtk_widget_destroy(myDialog);
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__GUI_SHOW_GOTO_LINE:
|
||||
{
|
||||
// dlg to confirm the quit event :
|
||||
GtkWidget *myDialog = gtk_dialog_new_with_buttons("Goto Line",
|
||||
GTK_WINDOW(m_mainWindow->GetWidget()),
|
||||
GTK_DIALOG_MODAL,
|
||||
"Jump", GTK_RESPONSE_YES,
|
||||
GTK_STOCK_QUIT, GTK_RESPONSE_NO,
|
||||
NULL);
|
||||
// this element did not apear in the miniature of the windows
|
||||
gtk_window_set_skip_pager_hint(GTK_WINDOW(myDialog), TRUE);
|
||||
// Set over main windows
|
||||
gtk_window_set_transient_for(GTK_WINDOW(myDialog), GTK_WINDOW(m_mainWindow->GetWidget()));
|
||||
// add writting area
|
||||
GtkWidget *myContentArea = gtk_dialog_get_content_area( GTK_DIALOG(myDialog));
|
||||
GtkWidget *myEntry = gtk_entry_new();
|
||||
gtk_box_pack_start(GTK_BOX(myContentArea), myEntry, TRUE, TRUE, 0);
|
||||
// Display it
|
||||
gtk_widget_show_all(myContentArea);
|
||||
int32_t result = gtk_dialog_run (GTK_DIALOG (myDialog));
|
||||
// Get data from the gtk entry
|
||||
const char *myData = gtk_entry_get_text(GTK_ENTRY(myEntry));
|
||||
if (NULL != myData) {
|
||||
int32_t lineID=0;
|
||||
if (1==sscanf(myData, "%d",&lineID)) {
|
||||
EDN_DEBUG("find in : \"" << myData << "\" = " << lineID);
|
||||
if(GTK_RESPONSE_YES == result) {
|
||||
SendMessage(EDN_MSG__CURRENT_GOTO_LINE, lineID-1);
|
||||
}
|
||||
} else {
|
||||
if (GTK_RESPONSE_YES == result) {
|
||||
EDN_WARNING("find in : \"" << myData << "\" line Number is not correct ");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
EDN_DEBUG("no line Writen ...");
|
||||
}
|
||||
// Remove dialogue
|
||||
gtk_widget_destroy(myDialog);
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__GUI_SHOW_EXIT_CONFIRMATION:
|
||||
{
|
||||
EDN_INFO("quit requested");
|
||||
// dlg to confirm the quit event :
|
||||
GtkWidget *p_dialog = gtk_dialog_new_with_buttons("Exit",
|
||||
GTK_WINDOW(m_mainWindow->GetWidget()),
|
||||
GTK_DIALOG_MODAL,
|
||||
GTK_STOCK_YES, GTK_RESPONSE_YES,
|
||||
GTK_STOCK_NO, GTK_RESPONSE_NO,
|
||||
NULL);
|
||||
GtkWidget *p_label = gtk_label_new ("Do you want exit Edn ?");
|
||||
gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area( GTK_DIALOG(p_dialog) )), p_label, TRUE, TRUE, 0);
|
||||
gtk_widget_show(p_label);
|
||||
|
||||
switch (gtk_dialog_run (GTK_DIALOG (p_dialog)))
|
||||
{
|
||||
case GTK_RESPONSE_YES:
|
||||
gtk_widget_destroy (p_dialog);
|
||||
p_dialog = NULL;
|
||||
{
|
||||
BufferManager * myBufferMng = BufferManager::getInstance();
|
||||
for (int32_t iii=0 ; iii<myBufferMng->Size() ; iii++) {
|
||||
if (true==myBufferMng->Exist(iii) ) {
|
||||
Buffer * myBuffer = myBufferMng->Get(iii);
|
||||
if (NULL != myBuffer) {
|
||||
if (true == myBuffer->IsModify()) {
|
||||
if (true == myBuffer->HaveName()) {
|
||||
p_dialog = gtk_dialog_new_with_buttons("Save Before Exit",
|
||||
GTK_WINDOW(m_mainWindow->GetWidget()),
|
||||
GTK_DIALOG_MODAL,
|
||||
GTK_STOCK_SAVE, GTK_RESPONSE_YES,
|
||||
GTK_STOCK_SAVE_AS, GTK_RESPONSE_ACCEPT,
|
||||
GTK_STOCK_NO, GTK_RESPONSE_NO,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
NULL);
|
||||
} else {
|
||||
p_dialog = gtk_dialog_new_with_buttons("Save Before Exit",
|
||||
GTK_WINDOW(m_mainWindow->GetWidget()),
|
||||
GTK_DIALOG_MODAL,
|
||||
GTK_STOCK_SAVE_AS, GTK_RESPONSE_ACCEPT,
|
||||
GTK_STOCK_NO, GTK_RESPONSE_NO,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
NULL);
|
||||
}
|
||||
char tmpName[1024];
|
||||
sprintf(tmpName, "Save file \"%s\" ?", myBuffer->GetFileName().GetCompleateName().c_str());
|
||||
p_label = gtk_label_new(tmpName);
|
||||
gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area( GTK_DIALOG(p_dialog) )), p_label, TRUE, TRUE, 0);
|
||||
gtk_widget_show(p_label);
|
||||
|
||||
switch (gtk_dialog_run (GTK_DIALOG (p_dialog)))
|
||||
{
|
||||
case GTK_RESPONSE_YES:
|
||||
myBuffer->Save();
|
||||
break;
|
||||
case GTK_RESPONSE_ACCEPT:
|
||||
OnMessage(EDN_MSG__GUI_SHOW_SAVE_AS, iii);
|
||||
break;
|
||||
case GTK_RESPONSE_NO:
|
||||
// nothing to do ...
|
||||
break;
|
||||
case GTK_RESPONSE_CANCEL:
|
||||
gtk_widget_destroy (p_dialog);
|
||||
return;
|
||||
break;
|
||||
}
|
||||
gtk_widget_destroy (p_dialog);
|
||||
p_dialog = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
gtk_main_quit();
|
||||
break;
|
||||
case GTK_RESPONSE_NO:
|
||||
gtk_widget_destroy (p_dialog);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
*/
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
@@ -1,50 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file WindowsManager.h
|
||||
* @brief Editeur De N'ours : Windows creation, pop up, destruction ... (header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 20/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 __WINDOWS_MANAGER_H__
|
||||
#define __WINDOWS_MANAGER_H__
|
||||
|
||||
#include <etk/Singleton.h>
|
||||
#include <MsgBroadcast.h>
|
||||
#include <MainWindows.h>
|
||||
|
||||
class WindowsManager: public etk::Singleton<WindowsManager>, public MsgBroadcast
|
||||
{
|
||||
friend class etk::Singleton<WindowsManager>;
|
||||
// specific for sigleton system...
|
||||
private:
|
||||
// Constructeur
|
||||
WindowsManager(void);
|
||||
~WindowsManager(void);
|
||||
|
||||
public:
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
private:
|
||||
MainWindows * m_mainWindow;
|
||||
int32_t m_currentBufferID;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -45,16 +45,43 @@ void Highlight::ParseRules(TiXmlNode *child, etk::VectorType<HighlightPattern*>
|
||||
|
||||
|
||||
|
||||
Highlight::Highlight(etk::String &xmlFilename)
|
||||
Highlight::Highlight(etk::UString &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\"");
|
||||
@@ -72,7 +99,7 @@ Highlight::Highlight(etk::String &xmlFilename)
|
||||
const char *myData = child->ToElement()->GetText();
|
||||
if (NULL != myData) {
|
||||
//EDN_INFO(PFX"(l %d) node fined : %s=\"%s\"", child->Row(), child->Value() , myData);
|
||||
etk::String * myEdnData = new etk::String(myData);
|
||||
etk::UString * myEdnData = new etk::UString(myData);
|
||||
m_listExtentions.PushBack(myEdnData);
|
||||
}
|
||||
} else if (!strcmp(child->Value(), "pass1")) {
|
||||
@@ -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)
|
||||
@@ -150,7 +180,7 @@ void Highlight::ReloadColor(void)
|
||||
}
|
||||
}
|
||||
|
||||
bool Highlight::HasExtention(etk::String &ext)
|
||||
bool Highlight::HasExtention(etk::UString &ext)
|
||||
{
|
||||
int32_t i;
|
||||
for (i=0; i<m_listExtentions.Size(); i++) {
|
||||
@@ -164,7 +194,7 @@ bool Highlight::HasExtention(etk::String &ext)
|
||||
bool Highlight::FileNameCompatible(etk::File &fileName)
|
||||
{
|
||||
int32_t i;
|
||||
etk::String extention;
|
||||
etk::UString extention;
|
||||
if (true == fileName.HasExtention() ) {
|
||||
extention = "*.";
|
||||
extention += fileName.GetExtention();
|
||||
|
@@ -50,9 +50,9 @@ extern "C" {
|
||||
class Highlight {
|
||||
public:
|
||||
// Constructeur
|
||||
Highlight(etk::String &xmlFilename);
|
||||
Highlight(etk::UString &xmlFilename);
|
||||
~Highlight(void);
|
||||
bool HasExtention(etk::String &ext);
|
||||
bool HasExtention(etk::UString &ext);
|
||||
bool FileNameCompatible(etk::File &fileName);
|
||||
void Display(void);
|
||||
void ReloadColor(void);
|
||||
@@ -67,8 +67,8 @@ class Highlight {
|
||||
EdnVectorBuf &buffer);
|
||||
private:
|
||||
void ParseRules(TiXmlNode *child, etk::VectorType<HighlightPattern*> &mListPatern, int32_t level);
|
||||
etk::String m_styleName; //!< curent style name (like "c++" or "c" or "script Bash")
|
||||
etk::VectorType<etk::String*> m_listExtentions; //!< List of possible extention for this high-light, like : ".c", ".cpp", ".h"
|
||||
etk::UString m_styleName; //!< curent style name (like "c++" or "c" or "script Bash")
|
||||
etk::VectorType<etk::UString*> m_listExtentions; //!< List of possible extention for this high-light, like : ".c", ".cpp", ".h"
|
||||
etk::VectorType<HighlightPattern*> m_listHighlightPass1; //!< List of ALL hightlight modules (pass 1 ==> when we load and wride data on the buffer)
|
||||
etk::VectorType<HighlightPattern*> m_listHighlightPass2; //!< List of ALL hightlight modules (pass 2 ==> When we display the buffer( only the display area (100 lines)) )
|
||||
};
|
||||
|
@@ -26,119 +26,172 @@
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <HighlightManager.h>
|
||||
#include <ewol/EObject.h>
|
||||
#include <ewol/EObjectManager.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "HighlightManager"
|
||||
|
||||
HighlightManager::HighlightManager(void) : MsgBroadcast("Hight-light Manager", EDN_CAT_HL)
|
||||
|
||||
class localClassHighlightManager: public ewol::EObject
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
HighlightManager::~HighlightManager(void)
|
||||
{
|
||||
int32_t i;
|
||||
// clean all Element
|
||||
for (i=0; i< listHighlight.Size(); i++) {
|
||||
if (NULL != listHighlight[i]) {
|
||||
delete(listHighlight[i]);
|
||||
listHighlight[i] = NULL;
|
||||
}
|
||||
}
|
||||
// clear the compleate list
|
||||
listHighlight.Clear();
|
||||
}
|
||||
|
||||
|
||||
void HighlightManager::OnMessage(int32_t id, int32_t dataID)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case EDN_MSG__COLOR_HAS_CHANGE:
|
||||
EDN_INFO("UPDATE the color pointer on the HL");
|
||||
for (int32_t i=0; i<listHighlight.Size(); i++) {
|
||||
private:
|
||||
etk::VectorType<Highlight*> listHighlight; //!< List of ALL hightlight modules
|
||||
public:
|
||||
// Constructeur
|
||||
localClassHighlightManager(void) {
|
||||
//ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferColor);
|
||||
};
|
||||
~localClassHighlightManager(void) {
|
||||
int32_t i;
|
||||
// clean all Element
|
||||
for (i=0; i< listHighlight.Size(); i++) {
|
||||
if (NULL != listHighlight[i]) {
|
||||
listHighlight[i]->ReloadColor();
|
||||
delete(listHighlight[i]);
|
||||
listHighlight[i] = NULL;
|
||||
}
|
||||
}
|
||||
break;
|
||||
// clear the compleate list
|
||||
listHighlight.Clear();
|
||||
};
|
||||
/**
|
||||
* @brief Receive a message from an other EObject with a specific eventId and data
|
||||
* @param[in] CallerObject Pointer on the EObject that information came from
|
||||
* @param[in] eventId Message registered by this class
|
||||
* @param[in] data Data registered by this class
|
||||
* @return ---
|
||||
*/
|
||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
||||
{
|
||||
/*
|
||||
switch (id)
|
||||
{
|
||||
case EDN_MSG__COLOR_HAS_CHANGE:
|
||||
EDN_INFO("UPDATE the color pointer on the HL");
|
||||
for (int32_t i=0; i<listHighlight.Size(); i++) {
|
||||
if (NULL != listHighlight[i]) {
|
||||
listHighlight[i]->ReloadColor();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
Highlight* Get(etk::File &fileName)
|
||||
{
|
||||
int32_t i;
|
||||
for (i=0; i<listHighlight.Size(); i++) {
|
||||
if (true == listHighlight[i]->FileNameCompatible(fileName) ) {
|
||||
return listHighlight[i];
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool Exist(etk::File &fileName)
|
||||
{
|
||||
if (NULL != Get(fileName) ) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void loadLanguages(void)
|
||||
{
|
||||
etk::UString xmlFilename = "lang_c.xml";
|
||||
Highlight *myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = "lang_boo.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = "lang_Makefile.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = "lang_asm.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = "lang_xml.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = "lang_php.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = "lang_bash.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = "lang_matlab.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = "lang_java.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
//myHightline->Display();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
static localClassHighlightManager * localManager = NULL;
|
||||
|
||||
|
||||
|
||||
void HighlightManager::Init(void)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
EWOL_ERROR("HighlightManager ==> already exist, just unlink the previous ...");
|
||||
localManager = NULL;
|
||||
}
|
||||
localManager = new localClassHighlightManager();
|
||||
|
||||
if (NULL == localManager) {
|
||||
EWOL_CRITICAL("Allocation of HighlightManager not done ...");
|
||||
}
|
||||
}
|
||||
|
||||
Highlight *HighlightManager::Get(etk::File &fileName)
|
||||
void HighlightManager::UnInit(void)
|
||||
{
|
||||
int32_t i;
|
||||
for (i=0; i<listHighlight.Size(); i++) {
|
||||
if (true == listHighlight[i]->FileNameCompatible(fileName) ) {
|
||||
return listHighlight[i];
|
||||
}
|
||||
if (NULL == localManager) {
|
||||
EWOL_ERROR("HighlightManager ==> request UnInit, but does not exist ...");
|
||||
return;
|
||||
}
|
||||
return NULL;
|
||||
ewol::EObjectManager::MarkToRemoved(localManager);
|
||||
localManager = NULL;
|
||||
}
|
||||
|
||||
void HighlightManager::loadLanguages(void)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
return;
|
||||
}
|
||||
localManager->loadLanguages();
|
||||
}
|
||||
|
||||
Highlight* HighlightManager::Get(etk::File &fileName)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
return NULL;
|
||||
}
|
||||
return localManager->Get(fileName);
|
||||
}
|
||||
|
||||
bool HighlightManager::Exist(etk::File &fileName)
|
||||
{
|
||||
if (NULL != Get(fileName) ) {
|
||||
return true;
|
||||
if (NULL == localManager) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
return localManager->Exist(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";
|
||||
Highlight *myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = homedir;
|
||||
xmlFilename += "lang_boo.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = homedir;
|
||||
xmlFilename += "lang_Makefile.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = homedir;
|
||||
xmlFilename += "lang_asm.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = homedir;
|
||||
xmlFilename += "lang_xml.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = homedir;
|
||||
xmlFilename += "lang_php.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = homedir;
|
||||
xmlFilename += "lang_bash.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = homedir;
|
||||
xmlFilename += "lang_matlab.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = homedir;
|
||||
xmlFilename += "lang_java.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
//myHightline->Display();
|
||||
}
|
||||
|
||||
|
@@ -26,32 +26,20 @@
|
||||
#ifndef __HIGHLIGHT_MANAGER_H__
|
||||
#define __HIGHLIGHT_MANAGER_H__
|
||||
|
||||
class HighlightManager;
|
||||
|
||||
#include <etk/Singleton.h>
|
||||
#include <etk/UString.h>
|
||||
#include <MsgBroadcast.h>
|
||||
#include <Highlight.h>
|
||||
#include <ewol/Widget.h>
|
||||
|
||||
|
||||
class HighlightManager: public etk::Singleton<HighlightManager>, public MsgBroadcast
|
||||
{
|
||||
friend class etk::Singleton<HighlightManager>;
|
||||
// specific for sigleton system...
|
||||
private:
|
||||
// Constructeur
|
||||
HighlightManager(void);
|
||||
~HighlightManager(void);
|
||||
|
||||
public:
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
public:
|
||||
void loadLanguages(void);
|
||||
Highlight * Get(etk::File &fileName);
|
||||
bool Exist(etk::File &fileName);
|
||||
|
||||
private:
|
||||
etk::VectorType<Highlight*> listHighlight; //!< List of ALL hightlight modules
|
||||
namespace HighlightManager{
|
||||
void Init(void);
|
||||
void UnInit(void);
|
||||
void loadLanguages(void);
|
||||
Highlight* Get(etk::File &fileName);
|
||||
bool Exist(etk::File &fileName);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -37,8 +37,7 @@ HighlightPattern::HighlightPattern(void)
|
||||
{
|
||||
m_haveStopPatern = false;
|
||||
m_multiline = false;
|
||||
ColorizeManager *myColorManager = ColorizeManager::getInstance();
|
||||
m_color = myColorManager->Get("normal");
|
||||
m_color = ColorizeManager::Get("normal");
|
||||
m_regExpStart = new etk::RegExp<EdnVectorBuf>();
|
||||
m_regExpStop = new etk::RegExp<EdnVectorBuf>();
|
||||
m_escapeChar = 0;
|
||||
@@ -50,12 +49,12 @@ HighlightPattern::~HighlightPattern(void)
|
||||
delete(m_regExpStop);
|
||||
}
|
||||
|
||||
void HighlightPattern::SetPaternStart(etk::String ®Exp)
|
||||
void HighlightPattern::SetPaternStart(etk::UString ®Exp)
|
||||
{
|
||||
m_regExpStart->SetRegExp(regExp);
|
||||
}
|
||||
|
||||
void HighlightPattern::SetPaternStop(etk::String ®Exp)
|
||||
void HighlightPattern::SetPaternStop(etk::UString ®Exp)
|
||||
{
|
||||
if (regExp.Size() != 0) {
|
||||
m_regExpStop->SetRegExp(regExp);
|
||||
@@ -65,21 +64,20 @@ void HighlightPattern::SetPaternStop(etk::String ®Exp)
|
||||
}
|
||||
}
|
||||
|
||||
void HighlightPattern::SetEscapeChar(etk::String &EscapeChar)
|
||||
void HighlightPattern::SetEscapeChar(etk::UString &EscapeChar)
|
||||
{
|
||||
if (EscapeChar.Size()>0) {
|
||||
m_escapeChar = EscapeChar.c_str()[0];
|
||||
m_escapeChar = EscapeChar[0];
|
||||
} else {
|
||||
m_escapeChar = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void HighlightPattern::SetColor(etk::String &colorName)
|
||||
void HighlightPattern::SetColor(etk::UString &colorName)
|
||||
{
|
||||
m_colorName = colorName;
|
||||
ColorizeManager *myColorManager = ColorizeManager::getInstance();
|
||||
m_color = myColorManager->Get(m_colorName);
|
||||
m_color = ColorizeManager::Get(m_colorName);
|
||||
}
|
||||
|
||||
bool HighlightPattern::IsEnable(void)
|
||||
@@ -90,8 +88,7 @@ bool HighlightPattern::IsEnable(void)
|
||||
|
||||
void HighlightPattern::ReloadColor(void)
|
||||
{
|
||||
ColorizeManager *myColorManager = ColorizeManager::getInstance();
|
||||
m_color = myColorManager->Get(m_colorName);
|
||||
m_color = ColorizeManager::Get(m_colorName);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -140,7 +137,7 @@ void HighlightPattern::ParseRules(TiXmlNode *child, int32_t level)
|
||||
//--------------------------------------------------------------------------------------------
|
||||
// process attribute
|
||||
const char *highLightName = child->ToElement()->Attribute("name");
|
||||
etk::String myEdnDataTmp = "???";
|
||||
etk::UString myEdnDataTmp = "???";
|
||||
if (NULL != highLightName) {
|
||||
myEdnDataTmp = highLightName;
|
||||
}
|
||||
@@ -152,7 +149,7 @@ void HighlightPattern::ParseRules(TiXmlNode *child, int32_t level)
|
||||
const char *myData = xChild->GetText();
|
||||
if (myData) {
|
||||
//EDN_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
||||
etk::String myEdnData = myData;
|
||||
etk::UString myEdnData = myData;
|
||||
SetColor(myEdnData);
|
||||
}
|
||||
}
|
||||
@@ -161,7 +158,7 @@ void HighlightPattern::ParseRules(TiXmlNode *child, int32_t level)
|
||||
const char *myData = xChild->GetText();
|
||||
if (myData) {
|
||||
//EDN_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
||||
etk::String myEdnData = myData;
|
||||
etk::UString myEdnData = myData;
|
||||
SetPaternStart(myEdnData);
|
||||
}
|
||||
}
|
||||
@@ -170,7 +167,7 @@ void HighlightPattern::ParseRules(TiXmlNode *child, int32_t level)
|
||||
const char *myData = xChild->GetText();
|
||||
if (myData) {
|
||||
//EDN_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
||||
etk::String myEdnData = myData;
|
||||
etk::UString myEdnData = myData;
|
||||
SetPaternStop(myEdnData);
|
||||
}
|
||||
}
|
||||
@@ -179,7 +176,7 @@ void HighlightPattern::ParseRules(TiXmlNode *child, int32_t level)
|
||||
const char *myData = xChild->GetText();
|
||||
if (myData) {
|
||||
//EDN_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
||||
etk::String myEdnData = myData;
|
||||
etk::UString myEdnData = myData;
|
||||
SetEscapeChar(myEdnData);
|
||||
}
|
||||
}
|
||||
|
@@ -51,13 +51,13 @@ class HighlightPattern {
|
||||
HighlightPattern(void);
|
||||
~HighlightPattern(void);
|
||||
|
||||
void SetName(etk::String &name) { m_paternName = name;};
|
||||
etk::String GetName(void) { return m_paternName;};
|
||||
void SetName(etk::UString &name) { m_paternName = name;};
|
||||
etk::UString GetName(void) { return m_paternName;};
|
||||
|
||||
void SetPaternStart(etk::String ®Exp);
|
||||
void SetPaternStop(etk::String ®Exp);
|
||||
void SetColor(etk::String &colorName);
|
||||
void SetEscapeChar(etk::String &EscapeChar);
|
||||
void SetPaternStart(etk::UString ®Exp);
|
||||
void SetPaternStop(etk::UString ®Exp);
|
||||
void SetColor(etk::UString &colorName);
|
||||
void SetEscapeChar(etk::UString &EscapeChar);
|
||||
void SetMultiline(bool enable) { m_multiline = enable; };
|
||||
|
||||
void SetLevel(int32_t newLevel) { m_level = newLevel; };
|
||||
@@ -73,14 +73,14 @@ class HighlightPattern {
|
||||
|
||||
private:
|
||||
int32_t m_level; //!< Level of the pattern ==> this is to overwrite next pattern when we create an higher ....
|
||||
etk::String m_paternName; //!< Current style name (like "c++" or "c" or "script Bash")
|
||||
etk::String m_colorName; //!< Current color name
|
||||
etk::UString m_paternName; //!< Current style name (like "c++" or "c" or "script Bash")
|
||||
etk::UString m_colorName; //!< Current color name
|
||||
Colorize * m_color; //!< Link to the color manager
|
||||
etk::RegExp<EdnVectorBuf> * m_regExpStart; //!< Start of Regular expression
|
||||
etk::RegExp<EdnVectorBuf> * m_regExpStop; //!< Stop of Regular Expression
|
||||
bool m_haveStopPatern; //!< Stop patern presence
|
||||
bool m_multiline; //!< The patern is multiline
|
||||
char m_escapeChar; //!< Escape char to prevent exeit of patern ....
|
||||
uniChar_t m_escapeChar; //!< Escape char to prevent exeit of patern ....
|
||||
etk::VectorType<HighlightPattern *> m_subPatern; //!< Under patern of this one
|
||||
// etk::VectorType<HighlightPattern *> m_subColor; //!< Under Color in the start RegExp ...
|
||||
};
|
||||
|
@@ -28,12 +28,13 @@
|
||||
#include <CTagsManager.h>
|
||||
#include <ClipBoard.h>
|
||||
#include <BufferManager.h>
|
||||
#include <ewol/EObject.h>
|
||||
|
||||
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "CTagsManager"
|
||||
|
||||
#if 0
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,7 +72,7 @@ CTagsManager::~CTagsManager(void)
|
||||
*/
|
||||
}
|
||||
|
||||
etk::String CTagsManager::GetFolder(etk::String &inputString)
|
||||
etk::UString CTagsManager::GetFolder(etk::UString &inputString)
|
||||
{
|
||||
/*
|
||||
char tmpVal[4096];
|
||||
@@ -80,7 +82,7 @@ etk::String CTagsManager::GetFolder(etk::String &inputString)
|
||||
if (NULL == ptr) {
|
||||
ptr = strrchr(tmpVal, '\\');
|
||||
}
|
||||
etk::String out = "./";
|
||||
etk::UString out = "./";
|
||||
if (NULL != ptr) {
|
||||
*ptr = '\0';
|
||||
out = tmpVal;
|
||||
@@ -88,11 +90,11 @@ etk::String CTagsManager::GetFolder(etk::String &inputString)
|
||||
}
|
||||
return out;
|
||||
*/
|
||||
etk::String out = "./";
|
||||
etk::UString out = "./";
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -200,7 +203,7 @@ void CTagsManager::cb_row(GtkTreeView *p_treeview,
|
||||
gpointer data)
|
||||
{
|
||||
EDN_DEBUG("event");
|
||||
CTagsManager * self = reinterpret_cast<CTagsManager*>(data);
|
||||
CTagsManager * self = static_cast<CTagsManager*>(data);
|
||||
|
||||
gchar * p_file=NULL;
|
||||
gint lineNumber;
|
||||
@@ -357,7 +360,7 @@ void CTagsManager::JumpTo(void)
|
||||
|
||||
// For all tags : Save in an internal Structure :
|
||||
do {
|
||||
etk::String destinationFilename = m_tagFolderBase;
|
||||
etk::UString destinationFilename = m_tagFolderBase;
|
||||
destinationFilename += entry.file;
|
||||
etk::File myfile = destinationFilename;
|
||||
TagListFind_ts myStruct;
|
||||
@@ -409,4 +412,7 @@ void CTagsManager::PrintTag (const tagEntry *entry, bool small)
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -27,7 +27,7 @@
|
||||
#define __C_TAGS_MANAGER_H__
|
||||
|
||||
|
||||
#include <etk/Singleton.h>
|
||||
#include <ewol/Widget.h>
|
||||
#include "MsgBroadcast.h"
|
||||
#include "readtags.h"
|
||||
|
||||
@@ -39,8 +39,8 @@ typedef struct{
|
||||
int32_t lineID;
|
||||
} 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,16 +50,16 @@ 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);
|
||||
int32_t MultipleJump(void);
|
||||
void JumpTo(void);
|
||||
void PrintTag(const tagEntry *entry, bool small);
|
||||
etk::String GetFolder(etk::String &inputString);
|
||||
etk::String m_tagFolderBase;
|
||||
etk::String m_tagFilename;
|
||||
etk::UString GetFolder(etk::UString &inputString);
|
||||
etk::UString m_tagFolderBase;
|
||||
etk::UString m_tagFilename;
|
||||
tagFile * m_ctagFile;
|
||||
// history system
|
||||
void AddToHistory(int32_t bufferID);
|
||||
@@ -67,16 +67,6 @@ class CTagsManager: public etk::Singleton<CTagsManager>, public MsgBroadcast
|
||||
etk::VectorType<etk::File*> m_historyList;
|
||||
etk::VectorType<TagListFind_ts> m_currentList;
|
||||
void JumpAtID(int32_t selectID);
|
||||
/*
|
||||
GtkWidget * CreateViewAndModel(void);
|
||||
static void cb_row (GtkTreeView *p_treeview,
|
||||
GtkTreePath * p_path,
|
||||
GtkTreeViewColumn * p_column,
|
||||
gpointer p_data);
|
||||
// save data in the list :
|
||||
GtkListStore * m_listStore;
|
||||
GtkWidget * m_Dialog;
|
||||
*/
|
||||
};
|
||||
|
||||
*/
|
||||
#endif
|
||||
|
151
jni/edn/init.cpp
151
jni/edn/init.cpp
@@ -26,17 +26,20 @@
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <ewol/ewol.h>
|
||||
#include <Gui/MainWindows.h>
|
||||
#include <Display.h>
|
||||
#include <BufferManager.h>
|
||||
#include <ColorizeManager.h>
|
||||
#include <HighlightManager.h>
|
||||
#include <ClipBoard.h>
|
||||
#include <etk/String.h>
|
||||
#include <WindowsManager.h>
|
||||
#include <Search.h>
|
||||
#include <Gui/Search.h>
|
||||
#include <unistd.h>
|
||||
#include <readtags.h>
|
||||
#include <CTagsManager.h>
|
||||
#include <etk/UString.h>
|
||||
#include <ewol/EObject.h>
|
||||
#include <ewol/WidgetManager.h>
|
||||
#include <tools/MsgBroadcast/MsgBroadcast.h>
|
||||
|
||||
MainWindows * basicWindows = NULL;
|
||||
|
||||
@@ -44,14 +47,14 @@ 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 :
|
||||
#ifdef PLATFORM_Linux
|
||||
etk::String homedir;
|
||||
etk::UString homedir;
|
||||
#ifdef NDEBUG
|
||||
homedir = "/usr/share/"PROJECT_NAME"/";
|
||||
#else
|
||||
@@ -64,57 +67,38 @@ void APP_Init(int argc, char *argv[])
|
||||
homedir += "/assets/";
|
||||
}
|
||||
#endif
|
||||
SetBaseFolderData(homedir.c_str());
|
||||
// TODO : Remove the Utf8Data
|
||||
SetBaseFolderData(homedir.Utf8Data());
|
||||
SetBaseFolderDataUser("~/."PROJECT_NAME"/");
|
||||
SetBaseFolderCache("/tmp/"PROJECT_NAME"/");
|
||||
#endif
|
||||
|
||||
ewol::SetFontFolder("Font");
|
||||
#ifdef EWOL_USE_FREE_TYPE
|
||||
//ewol::SetDefaultFont("freefont/FreeMono.ttf", 12);
|
||||
//ewol::SetDefaultFont("freefont/FreeMonoBold.ttf", 12);
|
||||
ewol::SetDefaultFont("ACharmingFont.ttf", 45);
|
||||
//ewol::SetDefaultFont("Monospace/Monospace", 40);
|
||||
//ewol::SetDefaultFont("unispace.ttf", 12);
|
||||
|
||||
#ifdef __PLATFORM__Android
|
||||
ewol::SetDefaultFont("freefont/FreeSerif.ttf", 16);
|
||||
#else
|
||||
//ewol::SetDefaultFont("ebtfont/Monospace", 14);
|
||||
ewol::SetDefaultFont("ebtfont/Monospace", 22);
|
||||
ewol::SetDefaultFont("freefont/FreeSerif.ttf", 12);
|
||||
#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)CTagsManager::getInstance();
|
||||
BufferManager::Init();
|
||||
|
||||
// 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";
|
||||
myColorManager->LoadFile( homedir.c_str() );
|
||||
myColorManager->DisplayListOfColor();
|
||||
ColorizeManager::Init();
|
||||
etk::UString homedir = "color_white.xml";
|
||||
ColorizeManager::LoadFile( homedir.Utf8Data() );
|
||||
ColorizeManager::DisplayListOfColor();
|
||||
|
||||
HighlightManager *myHighlightManager = NULL;
|
||||
myHighlightManager = HighlightManager::getInstance();
|
||||
myHighlightManager->loadLanguages();
|
||||
HighlightManager::Init();
|
||||
HighlightManager::loadLanguages();
|
||||
|
||||
// open display
|
||||
MsgBroadcastCore::getInstance()->SendMessage(NULL, EDN_MSG__GUI_SHOW_MAIN_WINDOWS);
|
||||
|
||||
// get the curent program folder
|
||||
char cCurrentPath[FILENAME_MAX];
|
||||
@@ -126,33 +110,50 @@ 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 generic shortcut ...
|
||||
// (shift, control, alt, meta, uniChar_t unicodeValue, const char * generateEventId, etk::UString& data)
|
||||
ewol::shortCut::Add("ctrl+o", ednMsgGuiOpen, "");
|
||||
ewol::shortCut::Add("ctrl+n", ednMsgGuiNew, "");
|
||||
|
||||
ewol::shortCut::Add("ctrl+s", ednMsgGuiSave, "current");
|
||||
ewol::shortCut::Add("ctrl+shift+s", ednMsgGuiSave, "All");
|
||||
|
||||
ewol::shortCut::Add("ctrl+q", ednMsgGuiClose, "current");
|
||||
ewol::shortCut::Add("ctrl+shift+q", ednMsgGuiClose, "All");
|
||||
|
||||
ewol::shortCut::Add("ctrl+z", ednMsgGuiUndo, "");
|
||||
ewol::shortCut::Add("ctrl+shift+z", ednMsgGuiRedo, "");
|
||||
|
||||
ewol::shortCut::Add("ctrl+w", ednMsgGuiRm, "Line");
|
||||
ewol::shortCut::Add("ctrl+shift+w", ednMsgGuiRm, "Paragraph");
|
||||
ewol::shortCut::Add("ctrl+x", ednMsgGuiCut, "STD");
|
||||
ewol::shortCut::Add("ctrl+c", ednMsgGuiCopy, "STD");
|
||||
ewol::shortCut::Add("ctrl+v", ednMsgGuiPaste, "STD");
|
||||
ewol::shortCut::Add("ctrl+a", ednMsgGuiSelect, "ALL");
|
||||
ewol::shortCut::Add("ctrl+shift+a", ednMsgGuiSelect, "NONE");
|
||||
|
||||
ewol::shortCut::Add("ctrl+l", ednMsgGuiGotoLine, "???");
|
||||
|
||||
|
||||
|
||||
// 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) << "\"" );
|
||||
etk::UString tmpppp = ewol::CmdLineGet(iii);
|
||||
ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgOpenFile, tmpppp);
|
||||
}
|
||||
|
||||
EDN_INFO("==> Init Edn (END)");
|
||||
}
|
||||
|
||||
|
||||
@@ -161,24 +162,26 @@ void APP_Init(int argc, char *argv[])
|
||||
*/
|
||||
void APP_UnInit(void)
|
||||
{
|
||||
|
||||
EDN_INFO("==> Un-Init Edn (START)");
|
||||
// Remove windows :
|
||||
ewol::DisplayWindows(NULL);
|
||||
|
||||
EDN_INFO("Stop Hightlight");
|
||||
HighlightManager::UnInit();
|
||||
//Kill all singleton
|
||||
EDN_INFO("Stop BufferManager");
|
||||
//BufferManager::kill();
|
||||
BufferManager::UnInit();
|
||||
EDN_INFO("Stop ColorizeManager");
|
||||
//ColorizeManager::kill();
|
||||
ColorizeManager::UnInit();
|
||||
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);
|
||||
basicWindows->MarkToRemove();
|
||||
basicWindows = NULL;
|
||||
}
|
||||
|
||||
|
||||
EDN_INFO("Stop Edn");
|
||||
//return EXIT_SUCCESS;
|
||||
}
|
||||
EDN_INFO("==> Un-Init Edn (END)");
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
*/
|
@@ -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
|
||||
|
||||
|
@@ -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 ¤tChar)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
@@ -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,9 +100,10 @@ class EdnBuf {
|
||||
int32_t StartOfLine( int32_t pos);
|
||||
int32_t EndOfLine( int32_t pos);
|
||||
|
||||
int32_t GetExpandedChar( int32_t &pos, int32_t indent, char outUTF8[MAX_EXP_CHAR_LEN], uint32_t ¤tChar);
|
||||
int32_t ExpandCharacter( char c, int32_t indent, char outUTF8[MAX_EXP_CHAR_LEN]); // TODO : rework this
|
||||
int32_t CharWidth( char c, int32_t indent); // TODO : rework this
|
||||
int32_t GetExpandedChar( int32_t &pos, int32_t indent, uniChar_t outUnicode[MAX_EXP_CHAR_LEN], uint32_t ¤tChar);
|
||||
int32_t GetExpandedChar( int32_t &pos, int32_t indent, char outUTF8[MAX_EXP_CHAR_LEN], uint32_t ¤tChar);
|
||||
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);
|
||||
int32_t CountLines( int32_t startPos, int32_t endPos);
|
||||
@@ -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);
|
||||
@@ -178,19 +178,19 @@ class EdnBuf {
|
||||
// Display property and charset ...
|
||||
// -----------------------------------------
|
||||
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;} };
|
||||
bool GetUTF8Mode(void) { return m_isUtf8; };
|
||||
void SetUTF8Mode(bool newOne) { m_isUtf8 = newOne; m_charsetType=EDN_CHARSET_UTF8; };
|
||||
int32_t GetTabDistance(void) { return m_tabDist; } ;
|
||||
void SetTabDistance(int32_t tabDist) { m_tabDist = tabDist; };
|
||||
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=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
|
||||
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)
|
||||
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
|
||||
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
|
||||
|
||||
// -----------------------------------------
|
||||
// Local function :
|
||||
|
@@ -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;
|
||||
@@ -64,7 +61,7 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
|
||||
int32_t i;
|
||||
/*
|
||||
for (i=0; i< (int32_t)m_HLDataPass1.Size(); i++) {
|
||||
etk::String ploppp;
|
||||
etk::UString ploppp;
|
||||
if (NULL != m_HLDataPass1[i].patern ) {
|
||||
ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->GetName();
|
||||
}
|
||||
@@ -108,7 +105,7 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
|
||||
//EDN_DEBUG("new size=" << (int32_t)m_HLDataPass1.Size()-1);
|
||||
/*
|
||||
for (i=0; i< (int32_t)m_HLDataPass1.Size(); i++) {
|
||||
etk::String ploppp;
|
||||
etk::UString ploppp;
|
||||
if (NULL != m_HLDataPass1[i].patern ) {
|
||||
ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->GetName();
|
||||
}
|
||||
@@ -151,7 +148,7 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
|
||||
}
|
||||
/*
|
||||
for (i=0; i< (int32_t)m_HLDataPass1.Size(); i++) {
|
||||
etk::String ploppp;
|
||||
etk::UString ploppp;
|
||||
if (NULL != m_HLDataPass1[i].patern ) {
|
||||
ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->GetName();
|
||||
}
|
||||
@@ -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,65 +291,62 @@ 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);
|
||||
int32_t startId, stopId;
|
||||
// find element previous
|
||||
FindMainHighLightPosition(HLStart, HLStop, startId, stopId, true);
|
||||
//GTimeVal timeStart;
|
||||
//g_get_current_time(&timeStart);
|
||||
HLStart = StartOfLine(HLStart);
|
||||
MData.HLData.Clear();
|
||||
int32_t HLStop = CountForwardNLines(HLStart, nbLines);
|
||||
int32_t startId, stopId;
|
||||
// find element previous
|
||||
FindMainHighLightPosition(HLStart, HLStop, startId, stopId, true);
|
||||
|
||||
int32_t k;
|
||||
//EDN_DEBUG("List of section between : "<< startId << " & " << stopId);
|
||||
int32_t endSearch = stopId+1;
|
||||
if (-1 == stopId) {
|
||||
endSearch = m_HLDataPass1.Size();
|
||||
}
|
||||
for (k=edn_max(startId, 0); k<endSearch; k++) {
|
||||
// empty section :
|
||||
if (0==k) {
|
||||
if (HLStart < m_HLDataPass1[k].beginStart) {
|
||||
//EDN_DEBUG(" ==> (empty section 1 ) k="<<k<<" start="<<HLStart<<" stop="<<m_HLDataPass1[k].beginStart );
|
||||
m_Highlight->Parse2(HLStart,
|
||||
m_HLDataPass1[k].beginStart,
|
||||
MData.HLData,
|
||||
m_data);
|
||||
} // else : nothing to do ...
|
||||
} else {
|
||||
//EDN_DEBUG(" ==> (empty section 2 ) k="<<k<<" start="<<m_HLDataPass1[k-1].endStop<<" stop="<<m_HLDataPass1[k].beginStart );
|
||||
m_Highlight->Parse2(m_HLDataPass1[k-1].endStop,
|
||||
int32_t k;
|
||||
//EDN_DEBUG("List of section between : "<< startId << " & " << stopId);
|
||||
int32_t endSearch = stopId+1;
|
||||
if (-1 == stopId) {
|
||||
endSearch = m_HLDataPass1.Size();
|
||||
}
|
||||
for (k=edn_max(startId, 0); k<endSearch; k++) {
|
||||
// empty section :
|
||||
if (0==k) {
|
||||
if (HLStart < m_HLDataPass1[k].beginStart) {
|
||||
//EDN_DEBUG(" ==> (empty section 1 ) k="<<k<<" start="<<HLStart<<" stop="<<m_HLDataPass1[k].beginStart );
|
||||
m_Highlight->Parse2(HLStart,
|
||||
m_HLDataPass1[k].beginStart,
|
||||
MData.HLData,
|
||||
m_data);
|
||||
}
|
||||
// under section :
|
||||
//EDN_DEBUG(" ==> (under section ) k="<<k<<" start="<<m_HLDataPass1[k].beginStart<<" stop="<<m_HLDataPass1[k].endStop << " subSectionOfID=" << 99999999);
|
||||
// TODO : ...
|
||||
} // else : nothing to do ...
|
||||
} else {
|
||||
//EDN_DEBUG(" ==> (empty section 2 ) k="<<k<<" start="<<m_HLDataPass1[k-1].endStop<<" stop="<<m_HLDataPass1[k].beginStart );
|
||||
m_Highlight->Parse2(m_HLDataPass1[k-1].endStop,
|
||||
m_HLDataPass1[k].beginStart,
|
||||
MData.HLData,
|
||||
m_data);
|
||||
}
|
||||
if (endSearch == (int32_t)m_HLDataPass1.Size() ){
|
||||
//if( k < (int32_t)m_HLDataPass1.Size()) {
|
||||
if (m_HLDataPass1.Size() != 0) {
|
||||
//EDN_DEBUG(" ==> (empty section 3 ) k="<<k<<" start="<<m_HLDataPass1[k-1].endStop<<" stop="<<HLStop );
|
||||
m_Highlight->Parse2(m_HLDataPass1[k-1].endStop,
|
||||
HLStop,
|
||||
MData.HLData,
|
||||
m_data);
|
||||
} else {
|
||||
//EDN_DEBUG(" ==> (empty section 4 ) k="<<k<<" start=0 stop="<<HLStop );
|
||||
m_Highlight->Parse2(0,
|
||||
HLStop,
|
||||
MData.HLData,
|
||||
m_data);
|
||||
}
|
||||
}
|
||||
|
||||
//GTimeVal timeStop;
|
||||
//g_get_current_time(&timeStop);
|
||||
//EDN_DEBUG("Display reAnnalyse = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s");
|
||||
// under section :
|
||||
//EDN_DEBUG(" ==> (under section ) k="<<k<<" start="<<m_HLDataPass1[k].beginStart<<" stop="<<m_HLDataPass1[k].endStop << " subSectionOfID=" << 99999999);
|
||||
// TODO : ...
|
||||
}
|
||||
if (endSearch == (int32_t)m_HLDataPass1.Size() ){
|
||||
//if( k < (int32_t)m_HLDataPass1.Size()) {
|
||||
if (m_HLDataPass1.Size() != 0) {
|
||||
//EDN_DEBUG(" ==> (empty section 3 ) k="<<k<<" start="<<m_HLDataPass1[k-1].endStop<<" stop="<<HLStop );
|
||||
m_Highlight->Parse2(m_HLDataPass1[k-1].endStop,
|
||||
HLStop,
|
||||
MData.HLData,
|
||||
m_data);
|
||||
} else {
|
||||
//EDN_DEBUG(" ==> (empty section 4 ) k="<<k<<" start=0 stop="<<HLStop );
|
||||
m_Highlight->Parse2(0,
|
||||
HLStop,
|
||||
MData.HLData,
|
||||
m_data);
|
||||
}
|
||||
}
|
||||
|
||||
//GTimeVal timeStop;
|
||||
//g_get_current_time(&timeStop);
|
||||
//EDN_DEBUG("Display reAnnalyse = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s");
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -1,97 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file AccelKey.cpp
|
||||
* @brief Editeur De N'ours : Basic Gui Accelerator Key (common for ALL) or nearly (Sources)
|
||||
* @author Edouard DUPIN
|
||||
* @date 17/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 <AccelKey.h>
|
||||
#if 0
|
||||
AccelKey::AccelKey(void)
|
||||
{
|
||||
m_accelGroup = gtk_accel_group_new();
|
||||
}
|
||||
|
||||
AccelKey::~AccelKey(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void AccelKey::SetAccel(GtkWidget * widget, char * accelKey)
|
||||
{
|
||||
SetAccel(widget, m_accelGroup, accelKey);
|
||||
}
|
||||
|
||||
void AccelKey::SetAccel(GtkWidget * widget, GtkAccelGroup * accel, char * accelKey)
|
||||
{
|
||||
guint accel_key = 0;
|
||||
int32_t accel_mods = 0;
|
||||
if( NULL==accelKey
|
||||
|| 0==strlen(accelKey))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// parsing of the string :
|
||||
//"ctrl+shift+alt+pomme+s"
|
||||
//EDN_DEBUG("Parse acxel string : \"" << accelKey << "\"");
|
||||
char * tmp = strstr(accelKey, "ctrl");
|
||||
if(NULL != tmp) {
|
||||
accel_mods |= GDK_CONTROL_MASK;
|
||||
//EDN_DEBUG(" => find CTRL");
|
||||
}
|
||||
tmp = strstr(accelKey, "shift");
|
||||
if(NULL != tmp) {
|
||||
accel_mods |= GDK_SHIFT_MASK;
|
||||
//EDN_DEBUG(" => find SHIFT");
|
||||
}
|
||||
tmp = strstr(accelKey, "alt");
|
||||
if(NULL != tmp) {
|
||||
accel_mods |= GDK_MOD1_MASK;
|
||||
//EDN_DEBUG(" => find ALT");
|
||||
}
|
||||
tmp = strstr(accelKey, "pomme");
|
||||
if(NULL != tmp) {
|
||||
accel_mods |= GDK_MOD2_MASK;
|
||||
//EDN_DEBUG(" => find POMME");
|
||||
}
|
||||
accel_key = accelKey[strlen(accelKey) -1];
|
||||
//char plop = accel_key;
|
||||
//EDN_DEBUG(" => find letter : '" << plop << "'");
|
||||
|
||||
// Ajout du racourcis clavier :
|
||||
gtk_widget_add_accelerator( widget, "activate", accel,
|
||||
accel_key, // key
|
||||
(GdkModifierType)accel_mods, // modifier keys
|
||||
GTK_ACCEL_VISIBLE);
|
||||
}
|
||||
|
||||
void AccelKey::LinkCommonAccel(GtkWidget * widget)
|
||||
{
|
||||
gtk_window_add_accel_group(GTK_WINDOW(widget), m_accelGroup);
|
||||
}
|
||||
|
||||
void AccelKey::LinkCommonAccel(GtkWindow * widget)
|
||||
{
|
||||
gtk_window_add_accel_group(GTK_WINDOW(widget), m_accelGroup);
|
||||
}
|
||||
|
||||
#endif
|
@@ -1,56 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file AccelKey.h
|
||||
* @brief Editeur De N'ours : Basic Gui Accelerator Key (common for ALL) or nearly (header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 17/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 __ACCEL_KEY_H__
|
||||
#define __ACCEL_KEY_H__
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <etk/Singleton.h>
|
||||
/*
|
||||
// need to create a syngleton ...
|
||||
class AccelKey: public Singleton<AccelKey>
|
||||
{
|
||||
friend class Singleton<AccelKey>;
|
||||
// specific for sigleton system...
|
||||
private:
|
||||
// Constructeur
|
||||
AccelKey(void);
|
||||
~AccelKey(void);
|
||||
public:
|
||||
// for internal Parsing
|
||||
void SetAccel(GtkWidget * widget, char * accelKey);
|
||||
// For external parsing
|
||||
void SetAccel(GtkWidget * widget, GtkAccelGroup * accel, char * accelKey);
|
||||
void LinkCommonAccel(GtkWidget * widget);
|
||||
void LinkCommonAccel(GtkWindow * widget);
|
||||
GtkAccelGroup * GetAccel(void) { return m_accelGroup; };
|
||||
|
||||
private:
|
||||
GtkAccelGroup * m_accelGroup;
|
||||
};
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
@@ -23,264 +23,52 @@
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <MsgBroadcast.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "MsgBroadcast"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// 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);
|
||||
}
|
||||
|
@@ -26,187 +26,51 @@
|
||||
#ifndef __MSG_BROADCAST_H__
|
||||
#define __MSG_BROADCAST_H__
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <etk/Singleton.h>
|
||||
#include <etk/String.h>
|
||||
|
||||
|
||||
|
||||
// broadCast Message
|
||||
|
||||
// Message to prevent the curent thread that Buffer has changed
|
||||
// the ID we'll use to identify our event
|
||||
typedef enum {
|
||||
EDN_MSG__NONE = 0,
|
||||
EDN_MSG__BUFFER_CHANGE_CURRENT, // set the new current BUFFER ...
|
||||
EDN_MSG__USER_DISPLAY_CHANGE, // User change the display ==> need to reload all the display depending on color internal
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// 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 : ""
|
||||
|
||||
// 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 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"
|
||||
|
||||
// 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 ednMsgGuiSearch; // data : ""
|
||||
extern const char* const ednMsgGuiReplace; // data : ""
|
||||
extern const char* const ednMsgGuiFind; // data : "Next" "Previous" "All" "None"
|
||||
|
||||
// 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,
|
||||
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 : SYSTEM ...
|
||||
MSG_TO_SYSTEM__START,
|
||||
MSG_TO_SYSTEM__STOP,
|
||||
extern const char* const ednMsgGuiCtags; // data : "Load" "ReLoad" "Jump" "Back"
|
||||
|
||||
extern const char* const ednMsgGuiAbout; // data : ""
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// 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 : 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,
|
||||
extern const char* const ednMsgBufferListChange; // data : ""
|
||||
|
||||
extern const char* const ednMsgBufferColor; // data : "new"
|
||||
|
||||
// DESTINATION : context popup ...
|
||||
MSG_TO_CONTEXT__START,
|
||||
MSG_TO_CONTEXT__STOP,
|
||||
|
||||
// DESTINATION : highlight system ...
|
||||
MSG_TO_HL__START,
|
||||
EDN_MSG__COLOR_HAS_CHANGE,
|
||||
MSG_TO_HL__STOP,
|
||||
|
||||
// DESTINATION : Color System ...
|
||||
MSG_TO_COLOR__START,
|
||||
EDN_MSG__RELOAD_COLOR_FILE,
|
||||
MSG_TO_COLOR__STOP,
|
||||
|
||||
|
||||
}messageType_te;
|
||||
|
||||
typedef enum {
|
||||
EDN_CAT_NONE,
|
||||
EDN_CAT_GUI,
|
||||
EDN_CAT_WORK_AREA,
|
||||
EDN_CAT_SYSTEM,
|
||||
EDN_CAT_BUFFER_MANAGER,
|
||||
EDN_CAT_GUI_MANAGER,
|
||||
EDN_CAT_CTAGS,
|
||||
EDN_CAT_MENU_CONTEXT,
|
||||
EDN_CAT_HL,
|
||||
EDN_CAT_COLOR,
|
||||
}messageCat_te;
|
||||
|
||||
|
||||
typedef struct {
|
||||
messageType_te msgId;
|
||||
int32_t dataId;
|
||||
}messageData_ts;
|
||||
|
||||
|
||||
class MsgBroadcastCore;
|
||||
|
||||
class MsgBroadcast
|
||||
{
|
||||
private:
|
||||
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
@@ -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
|
||||
|
@@ -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
|
||||
};
|
||||
|
||||
}
|
||||
|
@@ -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
|
@@ -24,4 +24,4 @@
|
||||
*/
|
||||
|
||||
|
||||
const char * ednLog = "edn ";
|
||||
const char * ednLog = "edn ";
|
||||
|
@@ -59,7 +59,7 @@ extern const char * ednLog;
|
||||
# define EDN_VERBOSE(data) do {}while(0)
|
||||
#endif
|
||||
|
||||
#define EDN_TODO(data) DRAW_WARNING("TODO : " << data)
|
||||
#define EDN_TODO(data) ETK_WARNING(ednLog, "TODO : " << data)
|
||||
|
||||
#define EDN_ASSERT(cond, data) ETK_ASSERT(ednLog, cond, data)
|
||||
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include <tools_globals.h>
|
||||
#include <ColorizeManager.h>
|
||||
#include <MsgBroadcast.h>
|
||||
#include <ewol/EObject.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);
|
||||
}
|
||||
|
||||
|
||||
|
55
jni/file.mk
55
jni/file.mk
@@ -5,52 +5,45 @@
|
||||
###############################################################################
|
||||
|
||||
# ExuberantCtags reading file tools (extern OPEN Sources) :
|
||||
FILE_LIST+= edn/ctags/readtags.cpp \
|
||||
FILE_LIST+= edn/ctags/readtags.cpp \
|
||||
edn/ctags/CTagsManager.cpp
|
||||
|
||||
|
||||
# Globals debug tool:
|
||||
FILE_LIST+= edn/tools/debug/tools_debug.cpp \
|
||||
edn/tools/globals/tools_globals.cpp \
|
||||
FILE_LIST+= edn/tools/debug/tools_debug.cpp \
|
||||
edn/tools/globals/tools_globals.cpp \
|
||||
edn/tools/memory/toolsMemory.cpp
|
||||
|
||||
# Buffers internal:
|
||||
FILE_LIST+= edn/tools/EdnTemplate/EdnVectorBuf.cpp \
|
||||
edn/tools/EdnBuf/EdnBuf.cpp \
|
||||
edn/tools/EdnBuf/EdnBuf_HighLight.cpp \
|
||||
edn/tools/EdnBuf/EdnBuf_History.cpp \
|
||||
edn/tools/EdnBuf/EdnBuf_Selection.cpp \
|
||||
FILE_LIST+= edn/tools/EdnTemplate/EdnVectorBuf.cpp \
|
||||
edn/tools/EdnBuf/EdnBuf.cpp \
|
||||
edn/tools/EdnBuf/EdnBuf_HighLight.cpp \
|
||||
edn/tools/EdnBuf/EdnBuf_History.cpp \
|
||||
edn/tools/EdnBuf/EdnBuf_Selection.cpp \
|
||||
edn/tools/EdnBuf/EdnBufHistory.cpp
|
||||
|
||||
|
||||
# Tools internal:
|
||||
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
|
||||
FILE_LIST+= edn/tools/Display/Display.cpp \
|
||||
edn/tools/ClipBoard/ClipBoard.cpp \
|
||||
edn/tools/MsgBroadcast/MsgBroadcast.cpp
|
||||
|
||||
# Gui:
|
||||
FILE_LIST+= edn/CustumWidget/BufferView/BufferView.cpp \
|
||||
edn/CustumWidget/CodeView/CodeView.cpp \
|
||||
edn/GuiTools/WindowsManager/WindowsManager.cpp \
|
||||
edn/GuiTools/MainWindows/MainWindows.cpp \
|
||||
edn/GuiTools/MainWindows/StatusBar.cpp \
|
||||
edn/GuiTools/MainWindows/MenuBar.cpp \
|
||||
edn/GuiTools/MainWindows/ToolBar.cpp \
|
||||
edn/GuiTools/Search/Search.cpp \
|
||||
edn/GuiTools/Search/SearchData.cpp
|
||||
FILE_LIST+= edn/Gui/BufferView.cpp \
|
||||
edn/Gui/CodeView.cpp \
|
||||
edn/Gui/MainWindows.cpp \
|
||||
edn/Gui/Search.cpp \
|
||||
edn/Gui/SearchData.cpp
|
||||
|
||||
# Basic Interface :
|
||||
FILE_LIST+= edn/Buffer/Buffer.cpp \
|
||||
edn/Buffer/BufferText.cpp \
|
||||
edn/Buffer/BufferEmpty.cpp \
|
||||
edn/Buffer/BufferManager.cpp \
|
||||
edn/Colorize/Colorize.cpp \
|
||||
edn/Colorize/ColorizeManager.cpp \
|
||||
edn/Highlight/HighlightPattern.cpp \
|
||||
edn/Highlight/Highlight.cpp \
|
||||
FILE_LIST+= edn/Buffer/Buffer.cpp \
|
||||
edn/Buffer/BufferText.cpp \
|
||||
edn/Buffer/BufferEmpty.cpp \
|
||||
edn/Buffer/BufferManager.cpp \
|
||||
edn/Colorize/Colorize.cpp \
|
||||
edn/Colorize/ColorizeManager.cpp \
|
||||
edn/Highlight/HighlightPattern.cpp \
|
||||
edn/Highlight/Highlight.cpp \
|
||||
edn/Highlight/HighlightManager.cpp
|
||||
|
||||
# Main entry file :
|
||||
|
10
local.properties
Normal file
10
local.properties
Normal 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
40
proguard.cfg
Normal 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
11
project.properties
Normal 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
|
BIN
res/drawable/ic_luncher_edn.png
Normal file
BIN
res/drawable/ic_luncher_edn.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.4 KiB |
@@ -1,202 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file pngToCpp.cpp
|
||||
* @brief convert a binary file into a C source vector
|
||||
* @author Sandro Sigala
|
||||
* @date 26/01/2011
|
||||
* @par Project
|
||||
* ---
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @compilation g++ pngToCpp -o pngToCpp
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 1024
|
||||
#endif
|
||||
|
||||
bool zeroTerminated = false;
|
||||
|
||||
int myfgetc(FILE *f)
|
||||
{
|
||||
int c = fgetc(f);
|
||||
if (c == EOF && zeroTerminated)
|
||||
{
|
||||
zeroTerminated = 0;
|
||||
return 0;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
void generateHeader(FILE *file)
|
||||
{
|
||||
fprintf(file, "/**\n");
|
||||
fprintf(file, " ******************************************************************************* \n");
|
||||
fprintf(file, " * \n");
|
||||
fprintf(file, " * @par Project\n");
|
||||
fprintf(file, " * Edn\n");
|
||||
fprintf(file, " * \n");
|
||||
fprintf(file, " * Automatic generated file for Edn Software\n");
|
||||
fprintf(file, " * Please do not save this file on File configuration server\n");
|
||||
fprintf(file, " * \n");
|
||||
fprintf(file, " * @par Copyright\n");
|
||||
fprintf(file, " * \n");
|
||||
fprintf(file, " * Copyright 2010 Edouard DUPIN, all right reserved\n");
|
||||
fprintf(file, " * \n");
|
||||
fprintf(file, " * his software is distributed in the hope that it will be useful, but WITHOUT\n");
|
||||
fprintf(file, " * ANY WARRANTY.\n");
|
||||
fprintf(file, " * \n");
|
||||
fprintf(file, " * Licence summary : \n");
|
||||
fprintf(file, " * You can modify and redistribute the sources code and binaries.\n");
|
||||
fprintf(file, " * You can send me the bug-fix\n");
|
||||
fprintf(file, " * You can not earn money with this Software (if the source extract from Edn\n");
|
||||
fprintf(file, " * represent less than 50/100 of original Sources)\n");
|
||||
fprintf(file, " * Term of the licence in in the file licence.txt.\n");
|
||||
fprintf(file, " * \n");
|
||||
fprintf(file, " ******************************************************************************* \n");
|
||||
fprintf(file, " */\n\n");
|
||||
}
|
||||
|
||||
FILE *ofile=NULL;
|
||||
FILE *ofileH=NULL;
|
||||
|
||||
void process(const char *ifname)
|
||||
{
|
||||
FILE *ifile=NULL;
|
||||
ifile = fopen(ifname, "rb");
|
||||
if (ifile == NULL)
|
||||
{
|
||||
fprintf(stderr, "cannot open %s for reading\n", ifname);
|
||||
exit(1);
|
||||
}
|
||||
char buf[PATH_MAX], *p;
|
||||
const char *cp;
|
||||
if ((cp = strrchr(ifname, '/')) != NULL)
|
||||
{
|
||||
++cp;
|
||||
} else {
|
||||
if ((cp = strrchr(ifname, '\\')) != NULL)
|
||||
++cp;
|
||||
else
|
||||
cp = ifname;
|
||||
}
|
||||
strcpy(buf, cp);
|
||||
for (p = buf; *p != '\0'; ++p)
|
||||
{
|
||||
if (!isalnum(*p))
|
||||
*p = '_';
|
||||
}
|
||||
fprintf(ofile, "unsigned char %s[] = {\n\t\t", buf);
|
||||
int n = 0;
|
||||
unsigned char c = 0;
|
||||
while(fread(&c, 1, 1, ifile) == 1)
|
||||
{
|
||||
if(n%100 == 0) {
|
||||
fprintf(ofile, "\n\t\t");
|
||||
}
|
||||
fprintf(ofile, "0x%02x,", c);
|
||||
n++;
|
||||
}
|
||||
fprintf(ofile, "\n};\n");
|
||||
fprintf(ofile, "unsigned long int %s_size = sizeof(%s);\n\n\n", buf, buf);
|
||||
|
||||
fprintf(ofileH, "extern unsigned char %s[];\n", buf);
|
||||
fprintf(ofileH, "extern unsigned long int %s_size;\n", buf);
|
||||
|
||||
fclose(ifile);
|
||||
}
|
||||
|
||||
void usage(void)
|
||||
{
|
||||
fprintf(stderr, "usage: pngToCpp <output_file>.xxx <input_file>\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
//zeroTerminated = true;
|
||||
if (argc < 3) {
|
||||
usage();
|
||||
}
|
||||
// dynamic output name :
|
||||
char tmpOutput[PATH_MAX*2] = "";
|
||||
strcpy(tmpOutput, argv[1]);
|
||||
int32_t sizeName = strlen(tmpOutput);
|
||||
if (6>=sizeName) {
|
||||
usage();
|
||||
}
|
||||
if (tmpOutput[sizeName-1] == '.') {
|
||||
tmpOutput[sizeName-1] = '\0';
|
||||
} else if (tmpOutput[sizeName-2] == '.') {
|
||||
tmpOutput[sizeName-2] = '\0';
|
||||
} else if (tmpOutput[sizeName-3] == '.') {
|
||||
tmpOutput[sizeName-3] = '\0';
|
||||
} else if (tmpOutput[sizeName-4] == '.') {
|
||||
tmpOutput[sizeName-4] = '\0';
|
||||
} else if (tmpOutput[sizeName-5] == '.') {
|
||||
tmpOutput[sizeName-5] = '\0';
|
||||
} else if (tmpOutput[sizeName-6] == '.') {
|
||||
tmpOutput[sizeName-6] = '\0';
|
||||
}
|
||||
//fprintf(stderr, "writing to %s\n", tmpOutput);
|
||||
|
||||
char tmpOutputCPP[PATH_MAX*2] = "";
|
||||
char tmpOutputH[PATH_MAX*2] = "";
|
||||
// Generate the output filename
|
||||
sprintf(tmpOutputCPP,"%s.cpp", tmpOutput);
|
||||
sprintf(tmpOutputH,"%s.h", tmpOutput);
|
||||
// open destination name :
|
||||
ofile = fopen(tmpOutputCPP, "wb");
|
||||
if (ofile == NULL)
|
||||
{
|
||||
fprintf(stderr, "cannot open %s for writing\n", tmpOutputCPP);
|
||||
exit(1);
|
||||
}
|
||||
generateHeader(ofile);
|
||||
ofileH = fopen(tmpOutputH, "wb");
|
||||
if (ofileH == NULL)
|
||||
{
|
||||
fprintf(stderr, "cannot open %s for writing\n", tmpOutputH);
|
||||
exit(1);
|
||||
}
|
||||
generateHeader(ofileH);
|
||||
fprintf(ofileH, "#ifndef __INPUT_PNG_FILE_GENERATED_H__\n");
|
||||
fprintf(ofileH, "#define __INPUT_PNG_FILE_GENERATED_H__\n");
|
||||
//fprintf(ofileH, "#ifdef __cplusplus\nextern \"C\" {\n#endif\n");
|
||||
//fprintf(ofile, "#ifdef __cplusplus\nextern \"C\" {\n#endif\n");
|
||||
|
||||
// Generate the output
|
||||
int32_t i;
|
||||
for(i=2; i<argc; i++) {
|
||||
process(argv[i]);
|
||||
}
|
||||
|
||||
//fprintf(ofile, "#ifdef __cplusplus\n}\n#endif\n");
|
||||
//fprintf(ofileH, "#ifdef __cplusplus\n}\n#endif\n");
|
||||
|
||||
fprintf(ofileH, "#endif\n\n");
|
||||
// Close destination files
|
||||
fclose(ofile);
|
||||
fclose(ofileH);
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user