Starting integration of the main display in EWOL system

This commit is contained in:
Edouard Dupin 2012-01-13 13:06:15 +01:00
parent 70837bd769
commit bd7aa98324
21 changed files with 10742 additions and 94 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -0,0 +1,129 @@
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&é~"#'{([-|è
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) # é
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) # è
#`_\ç^à@)]=}
0x60 (0,335) (33,54) # `
0x5F (33,335) (33,54) # _
0x5C (66,335) (33,54) # \
#0x (99,335) (33,54) # ç
0x5E (132,335) (33,54) # ^
#0x (165,335) (33,54) # à
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
#$£*µ%!§:/
#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) # £
0x2A (231,391) (33,54) # *
#0x (264,391) (33,54) # µ
#0x (297,391) (33,54) # ù
0x25 (330,391) (33,54) # %
0x21 (363,391) (33,54) # !
#0x (396,391) (33,54) # §
0x3A (429,391) (33,54) # :
0x2F (462,391) (33,54) # /
#;.,?<>²!+
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) # ²
#0x21 (231,453) (33,54) # ! ==> doublon ...
0x2B (264,453) (33,54) # +

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -146,7 +146,7 @@ void Buffer::SetLineDisplay(uint32_t lineNumber)
* @return ---
*
*/
int32_t Buffer::Display(DrawerManager &drawer)
int32_t Buffer::Display(ewol::OObject2DText* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY)
{
return ERR_NONE;
}

View File

@ -30,7 +30,7 @@
#include <etk/File.h>
#include <Display.h>
#include <charset.h>
#include <ewol/ewol.h>
typedef struct{
@ -82,7 +82,7 @@ class Buffer {
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate);
virtual void SetLineDisplay(uint32_t lineNumber);
virtual int32_t Display(DrawerManager &drawer);
virtual int32_t Display(ewol::OObject2DText* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY);
virtual void ForceReDraw(bool allElement);
virtual void AddChar(char * UTF8data);
virtual void cursorMove(int32_t gtkKey);

View File

@ -67,30 +67,28 @@ BufferEmpty::~BufferEmpty(void)
* @return ---
*
*/
int32_t BufferEmpty::Display(DrawerManager &drawer)
int32_t BufferEmpty::Display(ewol::OObject2DText* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY)
{
ColorizeManager * myColorManager = ColorizeManager::getInstance();
// Get color :
Colorize *myColor = NULL;
// Clean Buffer
drawer.Clean(myColorManager->Get(COLOR_CODE_BASIC_BG) );
if (NULL == OOText) {
EDN_ERROR("Input VALUE is NULL");
return ERR_FAIL;
}
if (NULL == OOColored) {
EDN_ERROR("Input VALUE is NULL");
return ERR_FAIL;
}
OOText->TextAdd(20, 20, "edn - Editeur De N'ours, l'Editeur Desoxyribo-Nucleique", sizeX);
OOText->TextAdd(20, 50, "No Buffer Availlable to display", sizeX);
color_ts bgColor; //!< Text color
bgColor.red = 1.0;
bgColor.green = 1.0;
bgColor.blue = 1.0;
bgColor.alpha = 1.0;
OOColored->SetColor(bgColor);
OOColored->Rectangle( 0, 0, sizeX, sizeY);
myColor = myColorManager->Get("normal");
// Draw the 2 comments Lines :
drawer.Text(myColor, 20,20, "edn - Editeur De N'ours, l'Editeur Desoxyribo-Nucleique");
//drawer.Flush();
myColor = myColorManager->Get("commentDoxygen");
drawer.Text(myColor, 20,25 + Display::GetFontHeight(), "No Buffer Availlable to display");
drawer.Flush();
/*
myColor = myColorManager->Get(("SelectedText"));
drawer.Cursor(20, 50);
drawer.EndOfLine(20, 70);
drawer.Tabulation(myColor, 20, 90, 5);
drawer.UTF8UnknownElement(myColor, 20, 120, 3, false);
drawer.Flush();
*/
return ERR_NONE;
}

View File

@ -32,7 +32,7 @@ class BufferEmpty : public Buffer {
public:
BufferEmpty(void);
virtual ~BufferEmpty(void);
virtual int32_t Display(DrawerManager &drawer);
int32_t Display(ewol::OObject2DText* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY);
};

View File

@ -30,6 +30,12 @@
#include <toolsMemory.h>
#include <etk/RegExp.h>
#include <ewol/ewol.h>
#include <ewol/OObject.h>
#include <ewol/WidgetManager.h>
#include <ewol/Widget.h>
#undef __class__
#define __class__ "BufferText"
@ -274,25 +280,27 @@ void BufferText::UpdatePointerNumber(void)
* @return
*
*/
int32_t BufferText::Display(DrawerManager &drawer)
int32_t BufferText::Display(ewol::OObject2DText* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY)
{
int32_t letterHeight = Display::GetFontHeight();
int32_t letterWidth = Display::GetFontWidth();
// update the number of element that can be displayed
m_displaySize.x = (drawer.GetWidth()/letterWidth) + 1 - nbColoneForLineNumber;;
m_displaySize.y = (drawer.GetHeight()/letterHeight) + 1;
EDN_INFO("main DIPLAY " << m_displaySize.x << " char * " << m_displaySize.y << " char");
int32_t selStart, selEnd, selRectStart, selRectEnd;
bool selIsRect;
int32_t selHave = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, selStart, selEnd, selIsRect, selRectStart, selRectEnd);
int32_t selHave;
int32_t fontId = ewol::GetDefaultFontId();
int32_t letterWidth = ewol::GetWidth(fontId, "A");
int32_t letterHeight = ewol::GetHeight(fontId);
// update the number of element that can be displayed
m_displaySize.x = (sizeX/letterWidth) + 1 - nbColoneForLineNumber;
m_displaySize.y = (sizeY/letterHeight) + 1;
EDN_INFO("main DIPLAY " << m_displaySize.x << " char * " << m_displaySize.y << " char");
selHave = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, selStart, selEnd, selIsRect, selRectStart, selRectEnd);
colorInformation_ts * HLColor = NULL;
//displayLineNumber(drawer);
// get the number of line in the buffer
int32_t maxNumberLine = m_EdnBuf.NumberOfLines();
//int32_t maxNumberLine = 2096;
char *myPrint = NULL;
if (10 > maxNumberLine) { nbColoneForLineNumber = 1; myPrint = (char *)"%1d";
} else if (100 > maxNumberLine) { nbColoneForLineNumber = 2; myPrint = (char *)"%2d";
@ -316,21 +324,27 @@ int32_t BufferText::Display(DrawerManager &drawer)
Colorize * selectColor = NULL;
char displayChar[MAX_EXP_CHAR_LEN];
memset(displayChar, 0, sizeof(char)*MAX_EXP_CHAR_LEN);
int mylen = m_EdnBuf.Size();
int32_t x_base=nbColoneForLineNumber*letterWidth + 3;
uint32_t xx = 0;
int32_t idX = 0;
drawer.Clean(myColorManager->Get(COLOR_CODE_BASIC_BG));
color_ts bgColor; //!< Text color
color_ts & tmpppppp = myColorManager->Get(COLOR_CODE_BASIC_BG);
OOColored->SetColor(tmpppppp);
OOColored->Rectangle( 0, 0, sizeX, sizeY);
int displayLines = 0;
// Regenerate the colorizing if necessary ...
m_EdnBuf.HightlightGenerateLines(m_displayLocalSyntax, m_displayStartBufferPos, m_displaySize.y);
//GTimeVal timeStart;
//g_get_current_time(&timeStart);
// draw the lineNumber :
int32_t currentLineID = m_displayStart.y+1;
#if 0
DrawLineNumber(drawer, myPrint, currentLineID, y);
for (iii=m_displayStartBufferPos; iii<mylen && displayLines < m_displaySize.y ; iii = new_i) {
//EDN_INFO("diplay element=" << iii);
@ -452,7 +466,7 @@ int32_t BufferText::Display(DrawerManager &drawer)
//GTimeVal timeStop;
//g_get_current_time(&timeStop);
//EDN_DEBUG("Display Generation = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s");
#endif
return ERR_NONE;
}

View File

@ -46,7 +46,7 @@ class BufferText : public Buffer {
void GetInfo(infoStatBuffer_ts &infoToUpdate);
void SetLineDisplay(uint32_t lineNumber);
int32_t Display(DrawerManager &drawer);
int32_t Display(ewol::OObject2DText* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY);
void ForceReDraw(bool allElement);
void AddChar(char * UTF8data);
void cursorMove(int32_t gtkKey);

View File

@ -36,6 +36,149 @@
#include <SearchData.h>
#undef __class__
#define __class__ "ewol::Button"
CodeView::CodeView(void)
{
m_label = "CodeView is disable ...";
m_bufferID = -1;
m_buttunOneSelected = false;
// Init link with the buffer Manager
m_bufferManager = BufferManager::getInstance();
m_colorManager = ColorizeManager::getInstance();
m_textColorFg.red = 0.0;
m_textColorFg.green = 0.0;
m_textColorFg.blue = 0.0;
m_textColorFg.alpha = 1.0;
m_textColorBg.red = 0.0;
m_textColorBg.green = 0.0;
m_textColorBg.blue = 0.0;
m_textColorBg.alpha = 0.25;
SetCanHaveFocus(true);
}
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::OObject2DText* myOObjectText = new ewol::OObject2DText("", -1, m_textColorFg);
ewol::OObject2DColored* myOObjectsColored = new ewol::OObject2DColored();
// generate the objects :
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");
/*
// TODO later : Add this in the basic element of the widget ...
int32_t borderSize = 2;
int32_t paddingSize = 3;
int32_t tmpSizeX = m_minSize.x;
int32_t tmpSizeY = m_minSize.y;
int32_t tmpOriginX = (m_size.x - tmpSizeX) / 2;
int32_t tmpOriginY = (m_size.y - tmpSizeY) / 2;
// no change for the text orogin :
int32_t tmpTextOriginX = (m_size.x - tmpSizeX) / 2 + borderSize + 2*paddingSize;
int32_t tmpTextOriginY = (m_size.y - tmpSizeY) / 2 + borderSize + 2*paddingSize;
if (true==m_userFillX) {
tmpSizeX = m_size.x;
tmpOriginX = 0;
}
if (true==m_userFillY) {
tmpSizeY = m_size.y;
tmpOriginY = 0;
}
tmpOriginX += paddingSize;
tmpOriginY += paddingSize;
tmpSizeX -= 2*paddingSize;
tmpSizeY -= 2*paddingSize;
ewol::OObject2DText * tmpText = new ewol::OObject2DText("", -1, m_textColorFg);
//int32_t fontId = GetDefaultFontId();
//int32_t fontHeight = ewol::GetHeight(fontId);
//int32_t fontWidth = ewol::GetWidth(fontId, m_label.c_str());
tmpText->Text(tmpTextOriginX, tmpTextOriginY, m_label.c_str(), m_size.x - borderSize - 2*paddingSize);
ewol::OObject2DColored * tmpOObjects = new ewol::OObject2DColored;
tmpOObjects->SetColor(m_textColorBg);
tmpOObjects->Rectangle( tmpOriginX, tmpOriginY, tmpSizeX, tmpSizeY);
tmpOObjects->SetColor(m_textColorFg);
tmpOObjects->RectangleBorder( tmpOriginX, tmpOriginY, tmpSizeX, tmpSizeY, borderSize);
AddOObject(tmpOObjects, "BouttonDecoration");
AddOObject(tmpText, "BouttonText");
*/
}
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])
{
//EWOL_DEBUG("BT PRESSED : \"" << UTF8_data << "\" size=" << strlen(UTF8_data));
if( UTF8_data != NULL
&& typeEvent == ewol::EVENT_KB_TYPE_DOWN
&& UTF8_data[0] == '\r') {
//return OnEventArea(ewolEventButtonPressed, -1, -1);
}
return false;
}
#ifdef SDFGSDFGSDFG_FGSDFG_SDF_G___DSFG_SD_FG__SD_F_G_SD_FG
CodeView::CodeView(void) : MsgBroadcast("Code View", EDN_CAT_WORK_AREA)
{
m_bufferID = -1;
@ -189,7 +332,6 @@ void CodeView::OnMessage(int32_t id, int32_t dataID)
}
#if 0
gboolean CodeView::CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data)
{
CodeView * self = reinterpret_cast<CodeView*>(data);
@ -420,3 +562,4 @@ gint CodeView::CB_mouseScrollEvent( GtkWidget *widget, GdkEventScroll *event, gp
#endif

View File

@ -32,6 +32,34 @@
#include <Display.h>
#include <MsgBroadcast.h>
#include <etk/Types.h>
#include <ewol/Widget.h>
class CodeView :public ewol::Widget
{
public:
CodeView(void);
virtual ~CodeView(void);
virtual bool CalculateMinSize(void);
private:
etk::String m_label;
color_ts m_textColorFg; //!< Text color
color_ts m_textColorBg; //!< Background color
BufferManager * m_bufferManager;
ColorizeManager * m_colorManager;
int32_t m_bufferID;
bool m_buttunOneSelected;
public:
virtual void OnRegenerateDisplay(void);
public:
//virtual bool OnEventInput(int32_t IdInput, 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]);
};
#if 0
class CodeView : public MsgBroadcast
{
public:
@ -63,6 +91,9 @@ class CodeView : public MsgBroadcast
int32_t m_bufferID;
bool m_buttunOneSelected;
};
#endif
#endif

View File

@ -31,22 +31,94 @@
#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)
{
#if 0
m_mainWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
// select the program icone
GError *err = NULL;
etk::String iconeFile;
#ifdef NDEBUG
iconeFile = "/usr/share/edn/images/icone.png";
#else
iconeFile = "./data/imagesSources/icone.png";
#endif
GdkPixbuf * icone = gdk_pixbuf_new_from_file(iconeFile.c_str(), &err);
if (err != NULL) {
@ -54,17 +126,11 @@ MainWindows::MainWindows(void) : MsgBroadcast("Main Windows", EDN_CAT_GUI)
} else {
gtk_window_set_icon(GTK_WINDOW(m_mainWindow), icone);
}
// Default size open windows
gtk_window_set_default_size(GTK_WINDOW(m_mainWindow), 800, 600);
// enable the close signal of the windows
g_signal_connect(G_OBJECT(m_mainWindow), "delete-event", G_CALLBACK(OnQuit), this);
g_signal_connect(G_OBJECT(m_mainWindow), "window-state-event", G_CALLBACK(OnStateChange), this);
//g_signal_connect(G_OBJECT(m_mainWindow), "destroy", G_CALLBACK(OnQuit), this);
// remove decoration
//gtk_window_set_decorated(GTK_WINDOW(m_mainWindow), FALSE);
// Create a vertical box for stacking the menu and editor widgets in.
GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add(GTK_CONTAINER(m_mainWindow), vbox);
@ -73,18 +139,11 @@ MainWindows::MainWindows(void) : MsgBroadcast("Main Windows", EDN_CAT_GUI)
AccelKey::getInstance()->LinkCommonAccel(GTK_WINDOW(m_mainWindow));
// Create the menu bar.
#if 0
gtk_box_pack_start( GTK_BOX (vbox), m_MenuBar.GetWidget(), FALSE, FALSE, 0);
#else
GtkWidget *hboxMenu = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start( GTK_BOX (vbox), hboxMenu, FALSE, FALSE, 0);
// Add Exit boutton
etk::String ExitIconeFile;
#ifdef NDEBUG
ExitIconeFile = "/usr/share/edn/images/delete-24px.png";
#else
ExitIconeFile = "./data/imagesSources/delete-24px.png";
#endif
// TODO : find a good way to change the size of an image
GtkWidget *myImageQuit = gtk_image_new_from_file(ExitIconeFile.c_str());
GtkIconSize mySize = GTK_ICON_SIZE_SMALL_TOOLBAR;
@ -100,25 +159,10 @@ MainWindows::MainWindows(void) : MsgBroadcast("Main Windows", EDN_CAT_GUI)
// add the real menu bar
gtk_box_pack_start( GTK_BOX (hboxMenu), m_MenuBar.GetWidget(), FALSE, FALSE, 0);
GdkColor color;
GtkStateType tmpppppp = GTK_STATE_NORMAL;
//GtkStateType tmpppppp = GTK_STATE_ACTIVE;
//GtkStateType tmpppppp = GTK_STATE_PRELIGHT;
//GtkStateType tmpppppp = GTK_STATE_SELECTED;
//GtkStateType tmpppppp = GTK_STATE_INSENSITIVE;
//gdk_color_parse ("green", &color);
//gtk_widget_modify_fg(m_MenuBar.GetWidget(), tmpppppp, &color);
//gdk_color_parse ("blue", &color);
//gtk_widget_modify_bg(m_MenuBar.GetWidget(), tmpppppp, &color);
gdk_color_parse ("red", &color);
gtk_widget_modify_text(m_MenuBar.GetWidget(), tmpppppp, &color);
//gdk_color_parse ("orange", &color);
gtk_widget_modify_base(m_MenuBar.GetWidget(), tmpppppp, &color);
// Add title
m_internalTitleLabel = gtk_label_new("Edn");
gtk_box_pack_start( GTK_BOX (hboxMenu), m_internalTitleLabel, FALSE, FALSE, 0);
#endif
// **********************************************************
// * Horizontal ELEMENTS : *
// **********************************************************
@ -126,9 +170,6 @@ MainWindows::MainWindows(void) : MsgBroadcast("Main Windows", EDN_CAT_GUI)
GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
gtk_container_add(GTK_CONTAINER (vbox), hbox);
// create the toolbar :
# if USE_GTK_VERSION_2_0
//gtk_box_pack_start(GTK_BOX(hbox), m_ToolBar.GetWidget(), FALSE, FALSE, 0);
# endif
// TreeView :
gtk_box_pack_start(GTK_BOX(hbox), m_BufferView.GetMainWidget(), FALSE, TRUE, 1);
@ -140,8 +181,7 @@ MainWindows::MainWindows(void) : MsgBroadcast("Main Windows", EDN_CAT_GUI)
// recursive version of gtk_widget_show
gtk_widget_show_all(m_mainWindow);
#endif
}
MainWindows::~MainWindows(void)
{
@ -206,7 +246,6 @@ void MainWindows::OnMessage(int32_t id, int32_t dataID)
break;
}
}
/*
bool MainWindows::OnQuit(GtkWidget *widget, gpointer data)
{
//MainWindows * self = reinterpret_cast<MainWindows*>(data);
@ -234,7 +273,7 @@ gboolean MainWindows::OnStateChange(GtkWidget *widget, GdkEvent* event, gpointer
}
}
}
*/
#endif

View File

@ -38,7 +38,7 @@
#ifndef __MAIN_WINDOWS_H__
#define __MAIN_WINDOWS_H__
#if 0
class MainWindows: public etk::Singleton<MainWindows>, public MsgBroadcast
{
friend class etk::Singleton<MainWindows>;
@ -67,7 +67,14 @@ class MainWindows: public etk::Singleton<MainWindows>, public MsgBroadcast
ToolBar m_ToolBar;
*/
};
#endif
class MainWindows : public ewol::Windows
{
public:
// Constructeur
MainWindows(void);
~MainWindows(void);
};
#endif

View File

@ -25,6 +25,7 @@
#include <tools_debug.h>
#include <tools_globals.h>
#include <ewol/ewol.h>
#include <Display.h>
#include <BufferManager.h>
#include <ColorizeManager.h>
@ -37,19 +38,44 @@
#include <readtags.h>
#include <CTagsManager.h>
MainWindows * basicWindows = NULL;
/**
* @brief main application function Initialisation
*/
void APP_Init(int argc, char *argv[])
{
EDN_INFO("Start Edn");
ewol::ChangeSize(800, 600);
//etk::TestUntaire_String();
//return 0;
// Use and remove GTK arguments from the application argument list.
//gtk_init (&argc, &argv);
// set the default Path of the application :
#ifdef PLATFORM_Linux
etk::String homedir;
#ifdef NDEBUG
homedir = "/usr/share/"PROJECT_NAME"/";
#else
char cCurrentPath[FILENAME_MAX];
if (!getcwd(cCurrentPath, FILENAME_MAX)) {
homedir = "./assets/";
} else {
cCurrentPath[FILENAME_MAX - 1] = '\0';
homedir = cCurrentPath;
homedir += "/assets/";
}
#endif
SetBaseFolderData(homedir.c_str());
SetBaseFolderDataUser("~/."PROJECT_NAME"/");
SetBaseFolderCache("/tmp/"PROJECT_NAME"/");
#endif
ewol::SetFontFolder("Font");
#ifdef EWOL_USE_FREE_TYPE
ewol::SetDefaultFont("freefont/FreeMono", 14);
#else
//ewol::SetDefaultFont("ebtfont/Monospace", 14);
ewol::SetDefaultFont("ebtfont/Monospace", 22);
#endif
// init internal global value
globals::init();
@ -108,6 +134,16 @@ void APP_Init(int argc, char *argv[])
}
}
}
basicWindows = new MainWindows();
if (NULL == basicWindows) {
EDN_ERROR("Can not allocate the basic windows");
ewol::Stop();
}
// create the specific windows
ewol::DisplayWindows(basicWindows);
}
@ -128,7 +164,9 @@ void APP_UnInit(void)
//AccelKey::kill();
EDN_INFO("Stop Display");
Display::UnInit();
if (NULL != basicWindows) {
delete(basicWindows);
}
EDN_INFO("Stop Edn");