Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
e97f6a77d4 | |||
e56ade0856 | |||
ed462a3b36 | |||
c767266dfe | |||
4f09da0f0f | |||
50addbecbb |
@@ -6,19 +6,19 @@
|
||||
#
|
||||
# Modules
|
||||
#
|
||||
BUILD_EDN=y
|
||||
# BUILD_AGG is not set
|
||||
# BUILD_ETK is not set
|
||||
# BUILD_EWOL is not set
|
||||
# BUILD_FREETYPE is not set
|
||||
# BUILD_LUA is not set
|
||||
# BUILD_OGG is not set
|
||||
# BUILD_PARSERSVG is not set
|
||||
# BUILD_LIBPNG is not set
|
||||
# BUILD_PORTAUDIO is not set
|
||||
# BUILD_TINYXML is not set
|
||||
# BUILD_ZLIB is not set
|
||||
# BUILD_LIBZIP is not set
|
||||
CONFIG_BUILD_EDN=y
|
||||
# CONFIG_BUILD_AGG is not set
|
||||
# CONFIG_BUILD_ETK is not set
|
||||
# CONFIG_BUILD_EWOL is not set
|
||||
# CONFIG_BUILD_FREETYPE is not set
|
||||
# CONFIG_BUILD_LUA is not set
|
||||
# CONFIG_BUILD_OGG is not set
|
||||
# CONFIG_BUILD_PARSERSVG is not set
|
||||
# CONFIG_BUILD_LIBPNG is not set
|
||||
# CONFIG_BUILD_PORTAUDIO is not set
|
||||
# CONFIG_BUILD_TINYXML is not set
|
||||
# CONFIG_BUILD_ZLIB is not set
|
||||
# CONFIG_BUILD_LIBZIP is not set
|
||||
|
||||
#
|
||||
# edn
|
||||
@@ -27,37 +27,37 @@ BUILD_EDN=y
|
||||
#
|
||||
# General
|
||||
#
|
||||
APPL_BUFFER_FONT_NORMAL=y
|
||||
# APPL_BUFFER_FONT_DISTANCE_FIELD is not set
|
||||
CONFIG_APPL_BUFFER_FONT_NORMAL=y
|
||||
# CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set
|
||||
|
||||
|
||||
#
|
||||
# Android
|
||||
#
|
||||
__EWOL_ANDROID_MINIMUM_SDK_VERSION__=9
|
||||
# __EWOL_ANDROID_SHOW_TITLE__ is not set
|
||||
__EWOL_ANDROID_ORIENTATION_AUTO__=y
|
||||
# __EWOL_ANDROID_ORIENTATION_LANDSCAPE__ is not set
|
||||
# __EWOL_ANDROID_ORIENTATION_PORTRAIT__ is not set
|
||||
CONFIG___EWOL_ANDROID_MINIMUM_SDK_VERSION__=9
|
||||
# CONFIG___EWOL_ANDROID_SHOW_TITLE__ is not set
|
||||
CONFIG___EWOL_ANDROID_ORIENTATION_AUTO__=y
|
||||
# CONFIG___EWOL_ANDROID_ORIENTATION_LANDSCAPE__ is not set
|
||||
# CONFIG___EWOL_ANDROID_ORIENTATION_PORTRAIT__ is not set
|
||||
|
||||
|
||||
#
|
||||
# Permissions
|
||||
#
|
||||
__ANDROID_PERMISSION__WRITE_EXTERNAL_STORAGE__=y
|
||||
# __ANDROID_PERMISSION__CAMERA__ is not set
|
||||
# __ANDROID_PERMISSION__INTERNET__ is not set
|
||||
# __ANDROID_PERMISSION__MODIFY_AUDIO_SETTINGS__ is not set
|
||||
# __ANDROID_PERMISSION__READ_CALENDAR__ is not set
|
||||
# __ANDROID_PERMISSION__READ_CONTACTS__ is not set
|
||||
# __ANDROID_PERMISSION__READ_FRAME_BUFFER__ is not set
|
||||
# __ANDROID_PERMISSION__READ_PROFILE__ is not set
|
||||
# __ANDROID_PERMISSION__RECORD_AUDIO__ is not set
|
||||
# __ANDROID_PERMISSION__SET_ORIENTATION__ is not set
|
||||
# __ANDROID_PERMISSION__VIBRATE__ is not set
|
||||
# __ANDROID_PERMISSION__ACCESS_COARSE_LOCATION__ is not set
|
||||
# __ANDROID_PERMISSION__ACCESS_FINE_LOCATION__ is not set
|
||||
# __VIDEO__OPENGL_ES_1 is not set
|
||||
CONFIG___ANDROID_PERMISSION__WRITE_EXTERNAL_STORAGE__=y
|
||||
# CONFIG___ANDROID_PERMISSION__CAMERA__ is not set
|
||||
# CONFIG___ANDROID_PERMISSION__INTERNET__ is not set
|
||||
# CONFIG___ANDROID_PERMISSION__MODIFY_AUDIO_SETTINGS__ is not set
|
||||
# CONFIG___ANDROID_PERMISSION__READ_CALENDAR__ is not set
|
||||
# CONFIG___ANDROID_PERMISSION__READ_CONTACTS__ is not set
|
||||
# CONFIG___ANDROID_PERMISSION__READ_FRAME_BUFFER__ is not set
|
||||
# CONFIG___ANDROID_PERMISSION__READ_PROFILE__ is not set
|
||||
# CONFIG___ANDROID_PERMISSION__RECORD_AUDIO__ is not set
|
||||
# CONFIG___ANDROID_PERMISSION__SET_ORIENTATION__ is not set
|
||||
# CONFIG___ANDROID_PERMISSION__VIBRATE__ is not set
|
||||
# CONFIG___ANDROID_PERMISSION__ACCESS_COARSE_LOCATION__ is not set
|
||||
# CONFIG___ANDROID_PERMISSION__ACCESS_FINE_LOCATION__ is not set
|
||||
# CONFIG___VIDEO__OPENGL_ES_1 is not set
|
||||
|
||||
|
||||
#
|
||||
@@ -67,5 +67,5 @@ __ANDROID_PERMISSION__WRITE_EXTERNAL_STORAGE__=y
|
||||
#
|
||||
# General
|
||||
#
|
||||
__EWOL_INTEGRATED_FONT__=y
|
||||
__EWOL_APPL_BASIC_TITLE__="Edn : Sources Code Editor"
|
||||
CONFIG___EWOL_INTEGRATED_FONT__=y
|
||||
CONFIG___EWOL_APPL_BASIC_TITLE__="Edn : Sources Code Editor"
|
||||
|
@@ -1,24 +1,26 @@
|
||||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Linux kernel version:
|
||||
# Automatically generated file; DO NOT EDIT.
|
||||
# Linux Kernel Configuration
|
||||
#
|
||||
|
||||
#
|
||||
# Modules
|
||||
#
|
||||
BUILD_EDN=y
|
||||
# BUILD_AGG is not set
|
||||
# BUILD_ETK is not set
|
||||
# BUILD_EWOL is not set
|
||||
# BUILD_FREETYPE is not set
|
||||
# BUILD_LUA is not set
|
||||
# BUILD_OGG is not set
|
||||
# BUILD_PARSERSVG is not set
|
||||
# BUILD_LIBPNG is not set
|
||||
# BUILD_PORTAUDIO is not set
|
||||
# BUILD_TINYXML is not set
|
||||
# BUILD_ZLIB is not set
|
||||
# BUILD_LIBZIP is not set
|
||||
CONFIG_BUILD_EDN=y
|
||||
# CONFIG_BUILD_AGG is not set
|
||||
CONFIG_BUILD_LINEARMATH=y
|
||||
CONFIG_BUILD_BULLET=y
|
||||
# CONFIG_BUILD_ETK is not set
|
||||
# CONFIG_BUILD_FREETYPE is not set
|
||||
# CONFIG_BUILD_LUA is not set
|
||||
# CONFIG_BUILD_OGG is not set
|
||||
# CONFIG_BUILD_PARSERSVG is not set
|
||||
# CONFIG_BUILD_LIBPNG is not set
|
||||
# CONFIG_BUILD_PORTAUDIO is not set
|
||||
# CONFIG_BUILD_TINYXML is not set
|
||||
# CONFIG_BUILD_ZLIB is not set
|
||||
# CONFIG_BUILD_LIBZIP is not set
|
||||
# CONFIG_BUILD_EWOL is not set
|
||||
|
||||
#
|
||||
# edn
|
||||
@@ -27,8 +29,8 @@ BUILD_EDN=y
|
||||
#
|
||||
# General
|
||||
#
|
||||
APPL_BUFFER_FONT_NORMAL=y
|
||||
# APPL_BUFFER_FONT_DISTANCE_FIELD is not set
|
||||
CONFIG_APPL_BUFFER_FONT_NORMAL=y
|
||||
# CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set
|
||||
|
||||
#
|
||||
# ewol
|
||||
@@ -37,5 +39,11 @@ APPL_BUFFER_FONT_NORMAL=y
|
||||
#
|
||||
# General
|
||||
#
|
||||
# __EWOL_INTEGRATED_FONT__ is not set
|
||||
__EWOL_APPL_BASIC_TITLE__="Edn : Sources Code Editor"
|
||||
CONFIG___EWOL_APPL_BASIC_TITLE__="Edn : Sources Code Editor"
|
||||
# CONFIG___EWOL_INTEGRATED_FONT__ is not set
|
||||
|
||||
#
|
||||
# Linux
|
||||
#
|
||||
CONFIG___EWOL_LINUX_GUI_MODE_X11__=y
|
||||
# CONFIG___EWOL_LINUX_GUI_MODE_DIRECT_FB__ is not set
|
||||
|
@@ -5,19 +5,19 @@
|
||||
#
|
||||
# Modules
|
||||
#
|
||||
BUILD_EDN=y
|
||||
# BUILD_AGG is not set
|
||||
# BUILD_ETK is not set
|
||||
# BUILD_FREETYPE is not set
|
||||
BUILD_GLEW=y
|
||||
# BUILD_LUA is not set
|
||||
# BUILD_OGG is not set
|
||||
# BUILD_PARSERSVG is not set
|
||||
# BUILD_LIBPNG is not set
|
||||
# BUILD_TINYXML is not set
|
||||
# BUILD_ZLIB is not set
|
||||
# BUILD_LIBZIP is not set
|
||||
# BUILD_EWOL is not set
|
||||
CONFIG_BUILD_EDN=y
|
||||
# CONFIG_BUILD_AGG is not set
|
||||
# CONFIG_BUILD_ETK is not set
|
||||
# CONFIG_BUILD_FREETYPE is not set
|
||||
CONFIG_BUILD_GLEW=y
|
||||
# CONFIG_BUILD_LUA is not set
|
||||
# CONFIG_BUILD_OGG is not set
|
||||
# CONFIG_BUILD_PARSERSVG is not set
|
||||
# CONFIG_BUILD_LIBPNG is not set
|
||||
# CONFIG_BUILD_TINYXML is not set
|
||||
# CONFIG_BUILD_ZLIB is not set
|
||||
# CONFIG_BUILD_LIBZIP is not set
|
||||
# CONFIG_BUILD_EWOL is not set
|
||||
|
||||
#
|
||||
# edn
|
||||
@@ -26,8 +26,8 @@ BUILD_GLEW=y
|
||||
#
|
||||
# General
|
||||
#
|
||||
APPL_BUFFER_FONT_NORMAL=y
|
||||
# APPL_BUFFER_FONT_DISTANCE_FIELD is not set
|
||||
CONFIG_APPL_BUFFER_FONT_NORMAL=y
|
||||
# CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set
|
||||
|
||||
#
|
||||
# ewol
|
||||
@@ -36,5 +36,5 @@ APPL_BUFFER_FONT_NORMAL=y
|
||||
#
|
||||
# General
|
||||
#
|
||||
__EWOL_APPL_BASIC_TITLE__="Ewol Basic Title"
|
||||
__EWOL_INTEGRATED_FONT__=y
|
||||
CONFIG___EWOL_APPL_BASIC_TITLE__="Ewol Basic Title"
|
||||
CONFIG___EWOL_INTEGRATED_FONT__=y
|
||||
|
14
data/edn.desktop
Normal file
14
data/edn.desktop
Normal file
@@ -0,0 +1,14 @@
|
||||
[Desktop Entry]
|
||||
Version=0.3.0
|
||||
Name=Edn : Editeur de N'ours
|
||||
Exec=edn
|
||||
Icon=Edn
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Development;Utility;TextEditor;
|
||||
GenericName=Text editor
|
||||
GenericName[en]=Text editor
|
||||
GenericName[nl]=Tekst verwerker
|
||||
GenericName[fr]=éditeur de text
|
||||
Comment=Code editor for c, c++, php, bash, xml ...
|
||||
Comment[fr]=éditeur de text pour les language c, c++, php, bash, xml ...
|
@@ -52,11 +52,11 @@
|
||||
</rule>
|
||||
<rule name="my type">
|
||||
<color>type</color>
|
||||
<start>\@bool|float|int|(vec|mat|ivect|bvect)[2-4]\@</start>
|
||||
<start>\@void|bool|float|int|(vec|mat|ivect|bvect)[2-4]\@</start>
|
||||
</rule>
|
||||
<rule name="my storage keyword">
|
||||
<color>storageKeyword</color>
|
||||
<start>\@varying|uniform|attribute\@</start>
|
||||
<start>\@varying|uniform|attribute|precision|mediump\@</start>
|
||||
</rule>
|
||||
<rule name="numeric constant">
|
||||
<color>number</color>
|
||||
|
BIN
edn-debug.jks
BIN
edn-debug.jks
Binary file not shown.
@@ -26,5 +26,7 @@ LOCAL_LDLIBS :=
|
||||
LOCAL_CFLAGS := -DPROJECT_NAME="\"$(LOCAL_MODULE)\"" \
|
||||
-DAPPL_VERSION_TAG_NAME="\"$(LOCAL_VERSION)-$(BUILD_DIRECTORY_MODE)\""
|
||||
|
||||
LOCAL_COPY_FILES += ../data/icon.png:icon.png
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
||||
|
@@ -45,8 +45,7 @@ void BufferText::BasicInit(void)
|
||||
m_cursorPos = 0;
|
||||
m_cursorPreferredCol = -1;
|
||||
//m_cursorMode = CURSOR_DISPLAY_MODE_NORMAL;
|
||||
m_displaySize.x = 200;
|
||||
m_displaySize.y = 20;
|
||||
m_displaySize.setValue(200,20);
|
||||
m_centerRequested = false;
|
||||
}
|
||||
|
||||
@@ -115,10 +114,7 @@ bool BufferText::NeedToUpdateDisplayPosition(void)
|
||||
|
||||
vec2 BufferText::GetBorderSize(void)
|
||||
{
|
||||
vec2 tmpVal;
|
||||
tmpVal.x = 30;
|
||||
tmpVal.y = 30;
|
||||
return tmpVal;
|
||||
return vec2(30,30);;
|
||||
}
|
||||
|
||||
|
||||
@@ -315,8 +311,8 @@ int32_t BufferText::Display(ewol::Text& OOText,
|
||||
|
||||
vec3 tmpLetterSize = OOText.CalculateSize((uniChar_t)'A');
|
||||
|
||||
int32_t letterWidth = tmpLetterSize.x;
|
||||
int32_t letterHeight = tmpLetterSize.y;
|
||||
int32_t letterWidth = tmpLetterSize.x();
|
||||
int32_t letterHeight = tmpLetterSize.y();
|
||||
|
||||
int32_t displayStartLineId = offsetY / letterHeight - 1;
|
||||
displayStartLineId = etk_max(0, displayStartLineId);
|
||||
@@ -325,14 +321,14 @@ int32_t BufferText::Display(ewol::Text& OOText,
|
||||
// update the display position with the scroll ofset :
|
||||
int32_t displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, displayStartLineId);
|
||||
vec2 maxSize;
|
||||
maxSize.x = 0.0;
|
||||
maxSize.y = m_EdnBuf.NumberOfLines() * tmpLetterSize.y;
|
||||
maxSize.setX(0);
|
||||
maxSize.setY(m_EdnBuf.NumberOfLines() * tmpLetterSize.y());
|
||||
int32_t nbColoneForLineNumber = GetLineNumberNumberOfElement();
|
||||
|
||||
// update the number of element that can be displayed
|
||||
m_displaySize.x = (sizeX/letterWidth) + 1 - nbColoneForLineNumber;
|
||||
m_displaySize.y = (sizeY/letterHeight) + 1;
|
||||
APPL_VERBOSE("main DIPLAY " << m_displaySize.x << " char * " << m_displaySize.y << " char");
|
||||
m_displaySize.setX((sizeX/letterWidth) + 1 - nbColoneForLineNumber);
|
||||
m_displaySize.setY((sizeY/letterHeight) + 1);
|
||||
APPL_VERBOSE("main DIPLAY " << m_displaySize.x() << " char * " << m_displaySize.y() << " char");
|
||||
|
||||
selHave = m_EdnBuf.GetSelectionPos(selStart, selEnd, selIsRect, selRectStart, selRectEnd);
|
||||
|
||||
@@ -353,7 +349,7 @@ int32_t BufferText::Display(ewol::Text& OOText,
|
||||
int displayLines = 0;
|
||||
// Regenerate the colorizing if necessary ...
|
||||
displayHLData_ts m_displayLocalSyntax;
|
||||
m_EdnBuf.HightlightGenerateLines(m_displayLocalSyntax, displayStartBufferPos, m_displaySize.y);
|
||||
m_EdnBuf.HightlightGenerateLines(m_displayLocalSyntax, displayStartBufferPos, m_displaySize.y());
|
||||
|
||||
int64_t stopTime = ewol::GetTime();
|
||||
APPL_DEBUG("Parsing Highlight = " << stopTime - startTime << " micro-s");
|
||||
@@ -377,7 +373,7 @@ int32_t BufferText::Display(ewol::Text& OOText,
|
||||
vec3 drawClippingPos(0,0,-0.5);
|
||||
vec3 drawClippingSize(sizeX, sizeY, 1);
|
||||
OOText.SetClippingWidth(vec3((float)pixelX, 0.0f, -0.5f),
|
||||
vec3((float)(sizeX - drawClippingPos.x), (float)sizeY, 0.5f) );
|
||||
vec3((float)(sizeX - drawClippingPos.x()), (float)sizeY, 0.5f) );
|
||||
|
||||
// Clear the line intexation :
|
||||
m_elmentList.Clear();
|
||||
@@ -403,12 +399,10 @@ int32_t BufferText::Display(ewol::Text& OOText,
|
||||
int32_t drawSize = 0;
|
||||
|
||||
// update display position :
|
||||
vec2 textPos;
|
||||
textPos.x = pixelX-offsetX;
|
||||
textPos.y = y;
|
||||
vec2 textPos(pixelX-offsetX, y);
|
||||
// update X pos
|
||||
tmpElementProperty.m_xOffset = textPos.x;
|
||||
tmpElementProperty.m_yOffset = textPos.y;
|
||||
tmpElementProperty.m_xOffset = textPos.x();
|
||||
tmpElementProperty.m_yOffset = textPos.y();
|
||||
|
||||
//APPL_INFO("diplay element=" << new_i);
|
||||
if (currentChar!='\n') {
|
||||
@@ -447,10 +441,10 @@ int32_t BufferText::Display(ewol::Text& OOText,
|
||||
OOText.SetFontBold(selectColor->GetBold());
|
||||
OOText.SetFontItalic(selectColor->GetItalic());
|
||||
myStringToDisplay = displayChar;
|
||||
OOText.SetPos(vec3(textPos.x, textPos.y, 0.0f) );
|
||||
OOText.SetPos(vec3(textPos.x(), textPos.y(), 0.0f) );
|
||||
OOText.Print(myStringToDisplay);
|
||||
// To update the display position
|
||||
drawSize = OOText.GetPos().x - textPos.x;
|
||||
drawSize = OOText.GetPos().x() - textPos.x();
|
||||
//APPL_DEBUG("add element : " << tmpElementProperty.m_yOffset << "," << tmpElementProperty.m_xOffset);
|
||||
m_elmentList.PushBack(tmpElementProperty);
|
||||
|
||||
@@ -464,7 +458,7 @@ int32_t BufferText::Display(ewol::Text& OOText,
|
||||
pixelX += drawSize;
|
||||
// move to next line ...
|
||||
if (currentChar=='\n') {
|
||||
maxSize.x = etk_max(lineMaxSize, maxSize.x);
|
||||
maxSize.setX(etk_max(lineMaxSize, maxSize.x()));
|
||||
lineMaxSize = 0.0;
|
||||
idX =0;
|
||||
pixelX = x_base + SEPARATION_SIZE_LINE_NUMBER;
|
||||
@@ -486,7 +480,7 @@ int32_t BufferText::Display(ewol::Text& OOText,
|
||||
if (m_cursorPos == iii) {
|
||||
tmpCursorPosition = vec3(pixelX - offsetX, y, 0);
|
||||
}
|
||||
if (tmpCursorPosition.z!=-1) {
|
||||
if (tmpCursorPosition.z()!=-1) {
|
||||
// display the cursor:
|
||||
OOText.SetPos(tmpCursorPosition);
|
||||
OOText.SetColor(ColorizeManager::Get(COLOR_CODE_CURSOR));
|
||||
@@ -510,8 +504,8 @@ int32_t BufferText::GetMousePosition(vec2 pos)
|
||||
for(int32_t iii=0; iii<m_elmentList.Size()-1; iii++) {
|
||||
//APPL_DEBUG("check element : " << m_elmentList[iii].m_yOffset << "<= " << pos.y << " <" << (m_elmentList[iii].m_yOffset + m_elmentList[iii].m_ySize));
|
||||
if(false == inLineDone) {
|
||||
if( pos.y>=m_elmentList[iii].m_yOffset
|
||||
&& pos.y<m_elmentList[iii].m_yOffset + m_elmentList[iii].m_ySize ) {
|
||||
if( pos.y()>=m_elmentList[iii].m_yOffset
|
||||
&& pos.y()<m_elmentList[iii].m_yOffset + m_elmentList[iii].m_ySize ) {
|
||||
// we find the line (int theory) ==> note : Some problem can appear here when the size are not the same ...
|
||||
// this is to prevent multiple size font ...
|
||||
inLineDone = true;
|
||||
@@ -520,8 +514,8 @@ int32_t BufferText::GetMousePosition(vec2 pos)
|
||||
}
|
||||
// we detected the line
|
||||
if(true == inLineDone) {
|
||||
if( pos.x>=m_elmentList[iii].m_xOffset
|
||||
&& pos.x<m_elmentList[iii+1].m_xOffset ) {
|
||||
if( pos.x()>=m_elmentList[iii].m_xOffset
|
||||
&& pos.x()<m_elmentList[iii+1].m_xOffset ) {
|
||||
// we get the position ...
|
||||
return m_elmentList[iii].m_bufferPos;
|
||||
} else if (m_elmentList[iii].m_xOffset>=m_elmentList[iii+1].m_xOffset) {
|
||||
@@ -531,7 +525,7 @@ int32_t BufferText::GetMousePosition(vec2 pos)
|
||||
}
|
||||
}
|
||||
if (m_elmentList.Size()>0) {
|
||||
if(pos.y<m_elmentList[m_elmentList.Size()/2].m_yOffset) {
|
||||
if(pos.y()<m_elmentList[m_elmentList.Size()/2].m_yOffset) {
|
||||
//APPL_DEBUG("Error to get position (return Last)");
|
||||
return m_elmentList[m_elmentList.Size()-1].m_bufferPos;
|
||||
} else {
|
||||
@@ -831,11 +825,11 @@ void BufferText::cursorMove(ewol::keyEvent::keyboard_te moveTypeEvent)
|
||||
break;
|
||||
case ewol::keyEvent::keyboardPageUp:
|
||||
//APPL_INFO("keyEvent : <PAGE-UP>");
|
||||
TextDMoveUp(m_displaySize.y);
|
||||
TextDMoveUp(m_displaySize.y());
|
||||
break;
|
||||
case ewol::keyEvent::keyboardPageDown:
|
||||
//APPL_INFO("keyEvent : <PAGE-DOWN>");
|
||||
TextDMoveDown(m_displaySize.y);
|
||||
TextDMoveDown(m_displaySize.y());
|
||||
break;
|
||||
case ewol::keyEvent::keyboardStart:
|
||||
//APPL_INFO("keyEvent : <Start of line>");
|
||||
@@ -868,16 +862,16 @@ vec2 BufferText::GetPosition(int32_t fontId, bool& centerRequested)
|
||||
{
|
||||
centerRequested = m_centerRequested;
|
||||
m_centerRequested = false;
|
||||
vec2 outputPosition;
|
||||
vec2 outputPosition(0,0);
|
||||
|
||||
// Display position (Y mode):
|
||||
APPL_INFO("change the position : " << m_cursorPos);
|
||||
// get the line id of the curent position of the cursor :
|
||||
outputPosition.y = m_EdnBuf.CountLines(0, m_cursorPos);
|
||||
outputPosition.setY(m_EdnBuf.CountLines(0, m_cursorPos));
|
||||
// get the first position of the current line
|
||||
int32_t lineStartPos = m_EdnBuf.StartOfLine(m_cursorPos);
|
||||
// count the number of char in the line (real displayed char with whar like <kjkj>)
|
||||
outputPosition.x = m_EdnBuf.CountDispChars(lineStartPos, m_cursorPos);
|
||||
outputPosition.setX(m_EdnBuf.CountDispChars(lineStartPos, m_cursorPos));
|
||||
APPL_INFO("Curent cursor pos=" << outputPosition);
|
||||
|
||||
// get font porperties :
|
||||
@@ -889,14 +883,14 @@ vec2 BufferText::GetPosition(int32_t fontId, bool& centerRequested)
|
||||
*/
|
||||
float letterWidth = 10;
|
||||
float letterHeight = 15;
|
||||
outputPosition.x *= letterWidth;
|
||||
outputPosition.y *= letterHeight;
|
||||
outputPosition.setValue(outputPosition.x() * letterWidth,
|
||||
outputPosition.y() * letterHeight);
|
||||
return outputPosition;
|
||||
|
||||
/* if we request a center :
|
||||
} else {
|
||||
// center the line at the middle of the screen :
|
||||
vec2 outputPosition;
|
||||
vec2 outputPosition(0,0);
|
||||
//APPL_DEBUG(" -------------------------------------------------");
|
||||
outputPosition.y = m_EdnBuf.CountLines(0, m_cursorPos);
|
||||
//APPL_DEBUG(" cursor position : " << m_cursorPos << " ==> ligne=" << outputPosition.y);
|
||||
|
@@ -84,9 +84,7 @@ CodeView::~CodeView(void)
|
||||
*/
|
||||
void CodeView::UpdateNumberOfLineReference(int32_t bufferID)
|
||||
{
|
||||
vec2 tmpCoord;
|
||||
tmpCoord.x = 0;
|
||||
tmpCoord.y = 0;
|
||||
vec2 tmpCoord(0,0);
|
||||
if (m_lineNumberList.Size()<=bufferID) {
|
||||
// update the number of elements :
|
||||
for (int32_t iii=m_lineNumberList.Size(); iii <= bufferID; iii++) {
|
||||
@@ -99,20 +97,19 @@ void CodeView::UpdateNumberOfLineReference(int32_t bufferID)
|
||||
|
||||
bool CodeView::CalculateMinSize(void)
|
||||
{
|
||||
m_minSize.x = 50;
|
||||
m_minSize.y = 50;
|
||||
m_minSize.setValue(50,50);
|
||||
return true;
|
||||
}
|
||||
|
||||
void CodeView::CalculateMaxSize(void)
|
||||
{
|
||||
m_maxSize.x = 2048;
|
||||
int32_t letterHeight = m_displayText.CalculateSize('A').y;
|
||||
m_maxSize.setX(2048);
|
||||
int32_t letterHeight = m_displayText.CalculateSize('A').y();
|
||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||
if (NULL!=tmpBuffer) {
|
||||
m_maxSize.y = tmpBuffer->GetNumberOfLine() * letterHeight;
|
||||
m_maxSize.setY(tmpBuffer->GetNumberOfLine() * letterHeight);
|
||||
} else {
|
||||
m_maxSize.y = 50;
|
||||
m_maxSize.setY(50);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,10 +148,10 @@ void CodeView::OnRegenerateDisplay(void)
|
||||
|
||||
// generate the objects :
|
||||
if (-1 == m_bufferID) {
|
||||
m_displayText.SetTextAlignement(10, m_size.x-20, ewol::Text::alignLeft);
|
||||
m_displayText.SetTextAlignement(10, m_size.x()-20, ewol::Text::alignLeft);
|
||||
m_displayDrawing.SetColor(0x00000022);
|
||||
m_displayDrawing.SetPos(vec3(10, 0, 0));
|
||||
m_displayDrawing.Rectangle(vec3((int32_t)m_size.x-20, 1500, 0) );
|
||||
m_displayDrawing.Rectangle(vec3((int32_t)m_size.x()-20, 1500, 0) );
|
||||
|
||||
m_displayText.SetRelPos(vec3(10, 0, 0));
|
||||
// nothing to display :
|
||||
@@ -171,13 +168,13 @@ void CodeView::OnRegenerateDisplay(void)
|
||||
" No Buffer Availlable to display\n"
|
||||
" </i>\n"
|
||||
"</font>\n");
|
||||
m_displayText.SetPos(vec3(0.0f, m_size.y, 0.0f) );
|
||||
m_displayText.SetPos(vec3(0.0f, m_size.y(), 0.0f) );
|
||||
m_displayText.ForceLineReturn();
|
||||
m_displayText.PrintDecorated(tmpString);
|
||||
} else {
|
||||
BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
|
||||
if (NULL!=tmpBuffer) {
|
||||
tmpBuffer->Display(m_displayText, m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
|
||||
tmpBuffer->Display(m_displayText, m_originScrooled.x(), m_originScrooled.y(), m_size.x(), m_size.y());
|
||||
}
|
||||
// set the current size of the windows
|
||||
SetMaxSize(BufferManager::Get(m_bufferID)->GetMaxSize());
|
||||
@@ -248,8 +245,8 @@ bool CodeView::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol:
|
||||
//relativePos.y = m_size.y - relativePos.y;
|
||||
|
||||
vec2 limitedPos = relativePos;
|
||||
limitedPos.x = etk_avg(1, limitedPos.x, m_size.x-1);
|
||||
limitedPos.y = etk_avg(1, limitedPos.y, m_size.y-1);
|
||||
limitedPos.setValue(etk_avg(1, limitedPos.x(), m_size.x()-1),
|
||||
etk_avg(1, limitedPos.y(), m_size.y()-1));
|
||||
if (true == WidgetScrooled::OnEventInput(type, IdInput, typeEvent, pos)) {
|
||||
ewol::widgetManager::FocusKeep(this);
|
||||
// nothing to do ... done on upper widget ...
|
||||
@@ -306,8 +303,8 @@ bool CodeView::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol:
|
||||
} else if (ewol::keyEvent::statusMove == typeEvent) {
|
||||
if (true == m_buttunOneSelected) {
|
||||
int xxx, yyy;
|
||||
xxx = relativePos.x;
|
||||
yyy = relativePos.y;
|
||||
xxx = relativePos.x();
|
||||
yyy = relativePos.y();
|
||||
if (xxx<0) {
|
||||
xxx = 0;
|
||||
}
|
||||
|
@@ -48,19 +48,26 @@ int main(int argc, const char *argv[])
|
||||
*/
|
||||
void APP_Init(void)
|
||||
{
|
||||
#ifdef MODE_RELEASE
|
||||
const char * debugMode = "Release";
|
||||
#else
|
||||
const char * debugMode = "Debug";
|
||||
#endif
|
||||
#ifdef __TARGET_OS__Linux
|
||||
#ifdef MODE_RELEASE
|
||||
APPL_INFO("==> Init "PROJECT_NAME" (START) (Linux) (Release)");
|
||||
const char * osMode = "Linux";
|
||||
#elif defined(__TARGET_OS__Android)
|
||||
const char * osMode = "Android";
|
||||
#elif defined(__TARGET_OS__Windows)
|
||||
const char * osMode = "Windows";
|
||||
#elif defined(__TARGET_OS__IOs)
|
||||
const char * osMode = "IOs";
|
||||
#elif defined(__TARGET_OS__MacOs)
|
||||
const char * osMode = "MacOs";
|
||||
#else
|
||||
APPL_INFO("==> Init "PROJECT_NAME" (START) (Linux) (Debug)");
|
||||
#endif
|
||||
#else
|
||||
#ifdef MODE_RELEASE
|
||||
APPL_INFO("==> Init "PROJECT_NAME" (START) (Android) (Release)");
|
||||
#else
|
||||
APPL_INFO("==> Init "PROJECT_NAME" (START) (Android) (Debug)");
|
||||
#endif
|
||||
const char * osMode = "Unknown";
|
||||
#endif
|
||||
APPL_INFO("==> Init "PROJECT_NAME" (START) [" << osMode << "] (" << debugMode << ")");
|
||||
|
||||
ewol::ChangeSize(ivec2(800, 600));
|
||||
etk::InitDefaultFolder(PROJECT_NAME);
|
||||
#ifdef __TARGET_OS__Android
|
||||
@@ -74,6 +81,8 @@ void APP_Init(void)
|
||||
|
||||
// init internal global value
|
||||
globals::init();
|
||||
// set the application icon ...
|
||||
ewol::SetIcon("DATA:icon.png");
|
||||
|
||||
|
||||
// init ALL Singleton :
|
||||
|
@@ -60,6 +60,7 @@ LOCAL_COPY_FOLDERS := ../data/icon.*: \
|
||||
../data/languages/xml/*.xml:languages/xml/ \
|
||||
../data/theme/default/*.svg:theme/default/
|
||||
|
||||
LOCAL_COPY_FILES :=
|
||||
|
||||
ifneq ($(__EWOL_INTEGRATED_FONT__),$(empty))
|
||||
|
||||
|
Reference in New Issue
Block a user