6 Commits
0.3.9 ... 0.4.0

12 changed files with 165 additions and 140 deletions

View File

@@ -6,19 +6,19 @@
# #
# Modules # Modules
# #
BUILD_EDN=y CONFIG_BUILD_EDN=y
# BUILD_AGG is not set # CONFIG_BUILD_AGG is not set
# BUILD_ETK is not set # CONFIG_BUILD_ETK is not set
# BUILD_EWOL is not set # CONFIG_BUILD_EWOL is not set
# BUILD_FREETYPE is not set # CONFIG_BUILD_FREETYPE is not set
# BUILD_LUA is not set # CONFIG_BUILD_LUA is not set
# BUILD_OGG is not set # CONFIG_BUILD_OGG is not set
# BUILD_PARSERSVG is not set # CONFIG_BUILD_PARSERSVG is not set
# BUILD_LIBPNG is not set # CONFIG_BUILD_LIBPNG is not set
# BUILD_PORTAUDIO is not set # CONFIG_BUILD_PORTAUDIO is not set
# BUILD_TINYXML is not set # CONFIG_BUILD_TINYXML is not set
# BUILD_ZLIB is not set # CONFIG_BUILD_ZLIB is not set
# BUILD_LIBZIP is not set # CONFIG_BUILD_LIBZIP is not set
# #
# edn # edn
@@ -27,37 +27,37 @@ BUILD_EDN=y
# #
# General # General
# #
APPL_BUFFER_FONT_NORMAL=y CONFIG_APPL_BUFFER_FONT_NORMAL=y
# APPL_BUFFER_FONT_DISTANCE_FIELD is not set # CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set
# #
# Android # Android
# #
__EWOL_ANDROID_MINIMUM_SDK_VERSION__=9 CONFIG___EWOL_ANDROID_MINIMUM_SDK_VERSION__=9
# __EWOL_ANDROID_SHOW_TITLE__ is not set # CONFIG___EWOL_ANDROID_SHOW_TITLE__ is not set
__EWOL_ANDROID_ORIENTATION_AUTO__=y CONFIG___EWOL_ANDROID_ORIENTATION_AUTO__=y
# __EWOL_ANDROID_ORIENTATION_LANDSCAPE__ is not set # CONFIG___EWOL_ANDROID_ORIENTATION_LANDSCAPE__ is not set
# __EWOL_ANDROID_ORIENTATION_PORTRAIT__ is not set # CONFIG___EWOL_ANDROID_ORIENTATION_PORTRAIT__ is not set
# #
# Permissions # Permissions
# #
__ANDROID_PERMISSION__WRITE_EXTERNAL_STORAGE__=y CONFIG___ANDROID_PERMISSION__WRITE_EXTERNAL_STORAGE__=y
# __ANDROID_PERMISSION__CAMERA__ is not set # CONFIG___ANDROID_PERMISSION__CAMERA__ is not set
# __ANDROID_PERMISSION__INTERNET__ is not set # CONFIG___ANDROID_PERMISSION__INTERNET__ is not set
# __ANDROID_PERMISSION__MODIFY_AUDIO_SETTINGS__ is not set # CONFIG___ANDROID_PERMISSION__MODIFY_AUDIO_SETTINGS__ is not set
# __ANDROID_PERMISSION__READ_CALENDAR__ is not set # CONFIG___ANDROID_PERMISSION__READ_CALENDAR__ is not set
# __ANDROID_PERMISSION__READ_CONTACTS__ is not set # CONFIG___ANDROID_PERMISSION__READ_CONTACTS__ is not set
# __ANDROID_PERMISSION__READ_FRAME_BUFFER__ is not set # CONFIG___ANDROID_PERMISSION__READ_FRAME_BUFFER__ is not set
# __ANDROID_PERMISSION__READ_PROFILE__ is not set # CONFIG___ANDROID_PERMISSION__READ_PROFILE__ is not set
# __ANDROID_PERMISSION__RECORD_AUDIO__ is not set # CONFIG___ANDROID_PERMISSION__RECORD_AUDIO__ is not set
# __ANDROID_PERMISSION__SET_ORIENTATION__ is not set # CONFIG___ANDROID_PERMISSION__SET_ORIENTATION__ is not set
# __ANDROID_PERMISSION__VIBRATE__ is not set # CONFIG___ANDROID_PERMISSION__VIBRATE__ is not set
# __ANDROID_PERMISSION__ACCESS_COARSE_LOCATION__ is not set # CONFIG___ANDROID_PERMISSION__ACCESS_COARSE_LOCATION__ is not set
# __ANDROID_PERMISSION__ACCESS_FINE_LOCATION__ is not set # CONFIG___ANDROID_PERMISSION__ACCESS_FINE_LOCATION__ is not set
# __VIDEO__OPENGL_ES_1 is not set # CONFIG___VIDEO__OPENGL_ES_1 is not set
# #
@@ -67,5 +67,5 @@ __ANDROID_PERMISSION__WRITE_EXTERNAL_STORAGE__=y
# #
# General # General
# #
__EWOL_INTEGRATED_FONT__=y CONFIG___EWOL_INTEGRATED_FONT__=y
__EWOL_APPL_BASIC_TITLE__="Edn : Sources Code Editor" CONFIG___EWOL_APPL_BASIC_TITLE__="Edn : Sources Code Editor"

View File

@@ -1,24 +1,26 @@
# #
# Automatically generated make config: don't edit # Automatically generated file; DO NOT EDIT.
# Linux kernel version: # Linux Kernel Configuration
# #
# #
# Modules # Modules
# #
BUILD_EDN=y CONFIG_BUILD_EDN=y
# BUILD_AGG is not set # CONFIG_BUILD_AGG is not set
# BUILD_ETK is not set CONFIG_BUILD_LINEARMATH=y
# BUILD_EWOL is not set CONFIG_BUILD_BULLET=y
# BUILD_FREETYPE is not set # CONFIG_BUILD_ETK is not set
# BUILD_LUA is not set # CONFIG_BUILD_FREETYPE is not set
# BUILD_OGG is not set # CONFIG_BUILD_LUA is not set
# BUILD_PARSERSVG is not set # CONFIG_BUILD_OGG is not set
# BUILD_LIBPNG is not set # CONFIG_BUILD_PARSERSVG is not set
# BUILD_PORTAUDIO is not set # CONFIG_BUILD_LIBPNG is not set
# BUILD_TINYXML is not set # CONFIG_BUILD_PORTAUDIO is not set
# BUILD_ZLIB is not set # CONFIG_BUILD_TINYXML is not set
# BUILD_LIBZIP is not set # CONFIG_BUILD_ZLIB is not set
# CONFIG_BUILD_LIBZIP is not set
# CONFIG_BUILD_EWOL is not set
# #
# edn # edn
@@ -27,8 +29,8 @@ BUILD_EDN=y
# #
# General # General
# #
APPL_BUFFER_FONT_NORMAL=y CONFIG_APPL_BUFFER_FONT_NORMAL=y
# APPL_BUFFER_FONT_DISTANCE_FIELD is not set # CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set
# #
# ewol # ewol
@@ -37,5 +39,11 @@ APPL_BUFFER_FONT_NORMAL=y
# #
# General # General
# #
# __EWOL_INTEGRATED_FONT__ is not set CONFIG___EWOL_APPL_BASIC_TITLE__="Edn : Sources Code Editor"
__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

View File

@@ -5,19 +5,19 @@
# #
# Modules # Modules
# #
BUILD_EDN=y CONFIG_BUILD_EDN=y
# BUILD_AGG is not set # CONFIG_BUILD_AGG is not set
# BUILD_ETK is not set # CONFIG_BUILD_ETK is not set
# BUILD_FREETYPE is not set # CONFIG_BUILD_FREETYPE is not set
BUILD_GLEW=y CONFIG_BUILD_GLEW=y
# BUILD_LUA is not set # CONFIG_BUILD_LUA is not set
# BUILD_OGG is not set # CONFIG_BUILD_OGG is not set
# BUILD_PARSERSVG is not set # CONFIG_BUILD_PARSERSVG is not set
# BUILD_LIBPNG is not set # CONFIG_BUILD_LIBPNG is not set
# BUILD_TINYXML is not set # CONFIG_BUILD_TINYXML is not set
# BUILD_ZLIB is not set # CONFIG_BUILD_ZLIB is not set
# BUILD_LIBZIP is not set # CONFIG_BUILD_LIBZIP is not set
# BUILD_EWOL is not set # CONFIG_BUILD_EWOL is not set
# #
# edn # edn
@@ -26,8 +26,8 @@ BUILD_GLEW=y
# #
# General # General
# #
APPL_BUFFER_FONT_NORMAL=y CONFIG_APPL_BUFFER_FONT_NORMAL=y
# APPL_BUFFER_FONT_DISTANCE_FIELD is not set # CONFIG_APPL_BUFFER_FONT_DISTANCE_FIELD is not set
# #
# ewol # ewol
@@ -36,5 +36,5 @@ APPL_BUFFER_FONT_NORMAL=y
# #
# General # General
# #
__EWOL_APPL_BASIC_TITLE__="Ewol Basic Title" CONFIG___EWOL_APPL_BASIC_TITLE__="Ewol Basic Title"
__EWOL_INTEGRATED_FONT__=y CONFIG___EWOL_INTEGRATED_FONT__=y

14
data/edn.desktop Normal file
View 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 ...

View File

@@ -52,11 +52,11 @@
</rule> </rule>
<rule name="my type"> <rule name="my type">
<color>type</color> <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>
<rule name="my storage keyword"> <rule name="my storage keyword">
<color>storageKeyword</color> <color>storageKeyword</color>
<start>\@varying|uniform|attribute\@</start> <start>\@varying|uniform|attribute|precision|mediump\@</start>
</rule> </rule>
<rule name="numeric constant"> <rule name="numeric constant">
<color>number</color> <color>number</color>

Binary file not shown.

View File

@@ -26,5 +26,7 @@ LOCAL_LDLIBS :=
LOCAL_CFLAGS := -DPROJECT_NAME="\"$(LOCAL_MODULE)\"" \ LOCAL_CFLAGS := -DPROJECT_NAME="\"$(LOCAL_MODULE)\"" \
-DAPPL_VERSION_TAG_NAME="\"$(LOCAL_VERSION)-$(BUILD_DIRECTORY_MODE)\"" -DAPPL_VERSION_TAG_NAME="\"$(LOCAL_VERSION)-$(BUILD_DIRECTORY_MODE)\""
LOCAL_COPY_FILES += ../data/icon.png:icon.png
include $(BUILD_EXECUTABLE) include $(BUILD_EXECUTABLE)

View File

@@ -45,8 +45,7 @@ void BufferText::BasicInit(void)
m_cursorPos = 0; m_cursorPos = 0;
m_cursorPreferredCol = -1; m_cursorPreferredCol = -1;
//m_cursorMode = CURSOR_DISPLAY_MODE_NORMAL; //m_cursorMode = CURSOR_DISPLAY_MODE_NORMAL;
m_displaySize.x = 200; m_displaySize.setValue(200,20);
m_displaySize.y = 20;
m_centerRequested = false; m_centerRequested = false;
} }
@@ -115,10 +114,7 @@ bool BufferText::NeedToUpdateDisplayPosition(void)
vec2 BufferText::GetBorderSize(void) vec2 BufferText::GetBorderSize(void)
{ {
vec2 tmpVal; return vec2(30,30);;
tmpVal.x = 30;
tmpVal.y = 30;
return tmpVal;
} }
@@ -315,8 +311,8 @@ int32_t BufferText::Display(ewol::Text& OOText,
vec3 tmpLetterSize = OOText.CalculateSize((uniChar_t)'A'); vec3 tmpLetterSize = OOText.CalculateSize((uniChar_t)'A');
int32_t letterWidth = tmpLetterSize.x; int32_t letterWidth = tmpLetterSize.x();
int32_t letterHeight = tmpLetterSize.y; int32_t letterHeight = tmpLetterSize.y();
int32_t displayStartLineId = offsetY / letterHeight - 1; int32_t displayStartLineId = offsetY / letterHeight - 1;
displayStartLineId = etk_max(0, displayStartLineId); displayStartLineId = etk_max(0, displayStartLineId);
@@ -325,14 +321,14 @@ int32_t BufferText::Display(ewol::Text& OOText,
// update the display position with the scroll ofset : // update the display position with the scroll ofset :
int32_t displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, displayStartLineId); int32_t displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, displayStartLineId);
vec2 maxSize; vec2 maxSize;
maxSize.x = 0.0; maxSize.setX(0);
maxSize.y = m_EdnBuf.NumberOfLines() * tmpLetterSize.y; maxSize.setY(m_EdnBuf.NumberOfLines() * tmpLetterSize.y());
int32_t nbColoneForLineNumber = GetLineNumberNumberOfElement(); int32_t nbColoneForLineNumber = GetLineNumberNumberOfElement();
// update the number of element that can be displayed // update the number of element that can be displayed
m_displaySize.x = (sizeX/letterWidth) + 1 - nbColoneForLineNumber; m_displaySize.setX((sizeX/letterWidth) + 1 - nbColoneForLineNumber);
m_displaySize.y = (sizeY/letterHeight) + 1; m_displaySize.setY((sizeY/letterHeight) + 1);
APPL_VERBOSE("main DIPLAY " << m_displaySize.x << " char * " << m_displaySize.y << " char"); APPL_VERBOSE("main DIPLAY " << m_displaySize.x() << " char * " << m_displaySize.y() << " char");
selHave = m_EdnBuf.GetSelectionPos(selStart, selEnd, selIsRect, selRectStart, selRectEnd); selHave = m_EdnBuf.GetSelectionPos(selStart, selEnd, selIsRect, selRectStart, selRectEnd);
@@ -353,7 +349,7 @@ int32_t BufferText::Display(ewol::Text& OOText,
int displayLines = 0; int displayLines = 0;
// Regenerate the colorizing if necessary ... // Regenerate the colorizing if necessary ...
displayHLData_ts m_displayLocalSyntax; displayHLData_ts m_displayLocalSyntax;
m_EdnBuf.HightlightGenerateLines(m_displayLocalSyntax, displayStartBufferPos, m_displaySize.y); m_EdnBuf.HightlightGenerateLines(m_displayLocalSyntax, displayStartBufferPos, m_displaySize.y());
int64_t stopTime = ewol::GetTime(); int64_t stopTime = ewol::GetTime();
APPL_DEBUG("Parsing Highlight = " << stopTime - startTime << " micro-s"); 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 drawClippingPos(0,0,-0.5);
vec3 drawClippingSize(sizeX, sizeY, 1); vec3 drawClippingSize(sizeX, sizeY, 1);
OOText.SetClippingWidth(vec3((float)pixelX, 0.0f, -0.5f), 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 : // Clear the line intexation :
m_elmentList.Clear(); m_elmentList.Clear();
@@ -403,12 +399,10 @@ int32_t BufferText::Display(ewol::Text& OOText,
int32_t drawSize = 0; int32_t drawSize = 0;
// update display position : // update display position :
vec2 textPos; vec2 textPos(pixelX-offsetX, y);
textPos.x = pixelX-offsetX;
textPos.y = y;
// update X pos // update X pos
tmpElementProperty.m_xOffset = textPos.x; tmpElementProperty.m_xOffset = textPos.x();
tmpElementProperty.m_yOffset = textPos.y; tmpElementProperty.m_yOffset = textPos.y();
//APPL_INFO("diplay element=" << new_i); //APPL_INFO("diplay element=" << new_i);
if (currentChar!='\n') { if (currentChar!='\n') {
@@ -447,10 +441,10 @@ int32_t BufferText::Display(ewol::Text& OOText,
OOText.SetFontBold(selectColor->GetBold()); OOText.SetFontBold(selectColor->GetBold());
OOText.SetFontItalic(selectColor->GetItalic()); OOText.SetFontItalic(selectColor->GetItalic());
myStringToDisplay = displayChar; myStringToDisplay = displayChar;
OOText.SetPos(vec3(textPos.x, textPos.y, 0.0f) ); OOText.SetPos(vec3(textPos.x(), textPos.y(), 0.0f) );
OOText.Print(myStringToDisplay); OOText.Print(myStringToDisplay);
// To update the display position // 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); //APPL_DEBUG("add element : " << tmpElementProperty.m_yOffset << "," << tmpElementProperty.m_xOffset);
m_elmentList.PushBack(tmpElementProperty); m_elmentList.PushBack(tmpElementProperty);
@@ -464,7 +458,7 @@ int32_t BufferText::Display(ewol::Text& OOText,
pixelX += drawSize; pixelX += drawSize;
// move to next line ... // move to next line ...
if (currentChar=='\n') { if (currentChar=='\n') {
maxSize.x = etk_max(lineMaxSize, maxSize.x); maxSize.setX(etk_max(lineMaxSize, maxSize.x()));
lineMaxSize = 0.0; lineMaxSize = 0.0;
idX =0; idX =0;
pixelX = x_base + SEPARATION_SIZE_LINE_NUMBER; pixelX = x_base + SEPARATION_SIZE_LINE_NUMBER;
@@ -486,7 +480,7 @@ int32_t BufferText::Display(ewol::Text& OOText,
if (m_cursorPos == iii) { if (m_cursorPos == iii) {
tmpCursorPosition = vec3(pixelX - offsetX, y, 0); tmpCursorPosition = vec3(pixelX - offsetX, y, 0);
} }
if (tmpCursorPosition.z!=-1) { if (tmpCursorPosition.z()!=-1) {
// display the cursor: // display the cursor:
OOText.SetPos(tmpCursorPosition); OOText.SetPos(tmpCursorPosition);
OOText.SetColor(ColorizeManager::Get(COLOR_CODE_CURSOR)); 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++) { 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)); //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(false == inLineDone) {
if( pos.y>=m_elmentList[iii].m_yOffset if( pos.y()>=m_elmentList[iii].m_yOffset
&& pos.y<m_elmentList[iii].m_yOffset + m_elmentList[iii].m_ySize ) { && 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 ... // 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 ... // this is to prevent multiple size font ...
inLineDone = true; inLineDone = true;
@@ -520,8 +514,8 @@ int32_t BufferText::GetMousePosition(vec2 pos)
} }
// we detected the line // we detected the line
if(true == inLineDone) { if(true == inLineDone) {
if( pos.x>=m_elmentList[iii].m_xOffset if( pos.x()>=m_elmentList[iii].m_xOffset
&& pos.x<m_elmentList[iii+1].m_xOffset ) { && pos.x()<m_elmentList[iii+1].m_xOffset ) {
// we get the position ... // we get the position ...
return m_elmentList[iii].m_bufferPos; return m_elmentList[iii].m_bufferPos;
} else if (m_elmentList[iii].m_xOffset>=m_elmentList[iii+1].m_xOffset) { } 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 (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)"); //APPL_DEBUG("Error to get position (return Last)");
return m_elmentList[m_elmentList.Size()-1].m_bufferPos; return m_elmentList[m_elmentList.Size()-1].m_bufferPos;
} else { } else {
@@ -831,11 +825,11 @@ void BufferText::cursorMove(ewol::keyEvent::keyboard_te moveTypeEvent)
break; break;
case ewol::keyEvent::keyboardPageUp: case ewol::keyEvent::keyboardPageUp:
//APPL_INFO("keyEvent : <PAGE-UP>"); //APPL_INFO("keyEvent : <PAGE-UP>");
TextDMoveUp(m_displaySize.y); TextDMoveUp(m_displaySize.y());
break; break;
case ewol::keyEvent::keyboardPageDown: case ewol::keyEvent::keyboardPageDown:
//APPL_INFO("keyEvent : <PAGE-DOWN>"); //APPL_INFO("keyEvent : <PAGE-DOWN>");
TextDMoveDown(m_displaySize.y); TextDMoveDown(m_displaySize.y());
break; break;
case ewol::keyEvent::keyboardStart: case ewol::keyEvent::keyboardStart:
//APPL_INFO("keyEvent : <Start of line>"); //APPL_INFO("keyEvent : <Start of line>");
@@ -868,16 +862,16 @@ vec2 BufferText::GetPosition(int32_t fontId, bool& centerRequested)
{ {
centerRequested = m_centerRequested; centerRequested = m_centerRequested;
m_centerRequested = false; m_centerRequested = false;
vec2 outputPosition; vec2 outputPosition(0,0);
// Display position (Y mode): // Display position (Y mode):
APPL_INFO("change the position : " << m_cursorPos); APPL_INFO("change the position : " << m_cursorPos);
// get the line id of the curent position of the cursor : // 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 // get the first position of the current line
int32_t lineStartPos = m_EdnBuf.StartOfLine(m_cursorPos); int32_t lineStartPos = m_EdnBuf.StartOfLine(m_cursorPos);
// count the number of char in the line (real displayed char with whar like <kjkj>) // 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); APPL_INFO("Curent cursor pos=" << outputPosition);
// get font porperties : // get font porperties :
@@ -889,14 +883,14 @@ vec2 BufferText::GetPosition(int32_t fontId, bool& centerRequested)
*/ */
float letterWidth = 10; float letterWidth = 10;
float letterHeight = 15; float letterHeight = 15;
outputPosition.x *= letterWidth; outputPosition.setValue(outputPosition.x() * letterWidth,
outputPosition.y *= letterHeight; outputPosition.y() * letterHeight);
return outputPosition; return outputPosition;
/* if we request a center : /* if we request a center :
} else { } else {
// center the line at the middle of the screen : // center the line at the middle of the screen :
vec2 outputPosition; vec2 outputPosition(0,0);
//APPL_DEBUG(" -------------------------------------------------"); //APPL_DEBUG(" -------------------------------------------------");
outputPosition.y = m_EdnBuf.CountLines(0, m_cursorPos); outputPosition.y = m_EdnBuf.CountLines(0, m_cursorPos);
//APPL_DEBUG(" cursor position : " << m_cursorPos << " ==> ligne=" << outputPosition.y); //APPL_DEBUG(" cursor position : " << m_cursorPos << " ==> ligne=" << outputPosition.y);

View File

@@ -84,9 +84,7 @@ CodeView::~CodeView(void)
*/ */
void CodeView::UpdateNumberOfLineReference(int32_t bufferID) void CodeView::UpdateNumberOfLineReference(int32_t bufferID)
{ {
vec2 tmpCoord; vec2 tmpCoord(0,0);
tmpCoord.x = 0;
tmpCoord.y = 0;
if (m_lineNumberList.Size()<=bufferID) { if (m_lineNumberList.Size()<=bufferID) {
// update the number of elements : // update the number of elements :
for (int32_t iii=m_lineNumberList.Size(); iii <= bufferID; iii++) { for (int32_t iii=m_lineNumberList.Size(); iii <= bufferID; iii++) {
@@ -99,20 +97,19 @@ void CodeView::UpdateNumberOfLineReference(int32_t bufferID)
bool CodeView::CalculateMinSize(void) bool CodeView::CalculateMinSize(void)
{ {
m_minSize.x = 50; m_minSize.setValue(50,50);
m_minSize.y = 50;
return true; return true;
} }
void CodeView::CalculateMaxSize(void) void CodeView::CalculateMaxSize(void)
{ {
m_maxSize.x = 2048; m_maxSize.setX(2048);
int32_t letterHeight = m_displayText.CalculateSize('A').y; int32_t letterHeight = m_displayText.CalculateSize('A').y();
BufferText* tmpBuffer = BufferManager::Get(m_bufferID); BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) { if (NULL!=tmpBuffer) {
m_maxSize.y = tmpBuffer->GetNumberOfLine() * letterHeight; m_maxSize.setY(tmpBuffer->GetNumberOfLine() * letterHeight);
} else { } else {
m_maxSize.y = 50; m_maxSize.setY(50);
} }
} }
@@ -151,10 +148,10 @@ void CodeView::OnRegenerateDisplay(void)
// generate the objects : // generate the objects :
if (-1 == m_bufferID) { 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.SetColor(0x00000022);
m_displayDrawing.SetPos(vec3(10, 0, 0)); 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)); m_displayText.SetRelPos(vec3(10, 0, 0));
// nothing to display : // nothing to display :
@@ -171,13 +168,13 @@ void CodeView::OnRegenerateDisplay(void)
" No Buffer Availlable to display\n" " No Buffer Availlable to display\n"
" </i>\n" " </i>\n"
"</font>\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.ForceLineReturn();
m_displayText.PrintDecorated(tmpString); m_displayText.PrintDecorated(tmpString);
} else { } else {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID); BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) { 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 // set the current size of the windows
SetMaxSize(BufferManager::Get(m_bufferID)->GetMaxSize()); 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; //relativePos.y = m_size.y - relativePos.y;
vec2 limitedPos = relativePos; vec2 limitedPos = relativePos;
limitedPos.x = etk_avg(1, limitedPos.x, m_size.x-1); limitedPos.setValue(etk_avg(1, limitedPos.x(), m_size.x()-1),
limitedPos.y = etk_avg(1, limitedPos.y, m_size.y-1); etk_avg(1, limitedPos.y(), m_size.y()-1));
if (true == WidgetScrooled::OnEventInput(type, IdInput, typeEvent, pos)) { if (true == WidgetScrooled::OnEventInput(type, IdInput, typeEvent, pos)) {
ewol::widgetManager::FocusKeep(this); ewol::widgetManager::FocusKeep(this);
// nothing to do ... done on upper widget ... // 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) { } else if (ewol::keyEvent::statusMove == typeEvent) {
if (true == m_buttunOneSelected) { if (true == m_buttunOneSelected) {
int xxx, yyy; int xxx, yyy;
xxx = relativePos.x; xxx = relativePos.x();
yyy = relativePos.y; yyy = relativePos.y();
if (xxx<0) { if (xxx<0) {
xxx = 0; xxx = 0;
} }

View File

@@ -48,19 +48,26 @@ int main(int argc, const char *argv[])
*/ */
void APP_Init(void) void APP_Init(void)
{ {
#ifdef __TARGET_OS__Linux #ifdef MODE_RELEASE
#ifdef MODE_RELEASE const char * debugMode = "Release";
APPL_INFO("==> Init "PROJECT_NAME" (START) (Linux) (Release)");
#else
APPL_INFO("==> Init "PROJECT_NAME" (START) (Linux) (Debug)");
#endif
#else #else
#ifdef MODE_RELEASE const char * debugMode = "Debug";
APPL_INFO("==> Init "PROJECT_NAME" (START) (Android) (Release)");
#else
APPL_INFO("==> Init "PROJECT_NAME" (START) (Android) (Debug)");
#endif
#endif #endif
#ifdef __TARGET_OS__Linux
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
const char * osMode = "Unknown";
#endif
APPL_INFO("==> Init "PROJECT_NAME" (START) [" << osMode << "] (" << debugMode << ")");
ewol::ChangeSize(ivec2(800, 600)); ewol::ChangeSize(ivec2(800, 600));
etk::InitDefaultFolder(PROJECT_NAME); etk::InitDefaultFolder(PROJECT_NAME);
#ifdef __TARGET_OS__Android #ifdef __TARGET_OS__Android
@@ -74,6 +81,8 @@ void APP_Init(void)
// init internal global value // init internal global value
globals::init(); globals::init();
// set the application icon ...
ewol::SetIcon("DATA:icon.png");
// init ALL Singleton : // init ALL Singleton :

View File

@@ -60,6 +60,7 @@ LOCAL_COPY_FOLDERS := ../data/icon.*: \
../data/languages/xml/*.xml:languages/xml/ \ ../data/languages/xml/*.xml:languages/xml/ \
../data/theme/default/*.svg:theme/default/ ../data/theme/default/*.svg:theme/default/
LOCAL_COPY_FILES :=
ifneq ($(__EWOL_INTEGRATED_FONT__),$(empty)) ifneq ($(__EWOL_INTEGRATED_FONT__),$(empty))

2
tag
View File

@@ -1 +1 @@
0.3.8 0.4.0