Change message system and threaded the system
This commit is contained in:
parent
65b288813e
commit
d2cb4a47b7
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
|
||||
|
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&é~"#'{([-|è
|
||||
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) # +
|
@ -27,6 +27,7 @@
|
||||
#include <tools_globals.h>
|
||||
#include <Buffer.h>
|
||||
#include <BufferManager.h>
|
||||
#include <ewol/WidgetMessageMultiCast.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "Buffer"
|
||||
@ -93,7 +94,7 @@ void Buffer::SetModify(bool status)
|
||||
{
|
||||
if (status != m_fileModify) {
|
||||
m_fileModify = status;
|
||||
GeneralSendMessage(EDN_MSG__BUFFER_CHANGE_MODIFY);
|
||||
ewol::widgetMessageMultiCast::Send(-1, ednMsgBufferModify);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <BufferManager.h>
|
||||
#include <ewol/WidgetMessageMultiCast.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "BufferManager"
|
||||
@ -40,11 +41,16 @@
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
BufferManager::BufferManager(void) : MsgBroadcast("Buffer Manager", EDN_CAT_BUFFER_MANAGER)
|
||||
BufferManager::BufferManager(void)
|
||||
{
|
||||
// nothing to do ...
|
||||
BufferNotExiste = new BufferEmpty();
|
||||
m_idSelected = -1;
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerNewFile);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerSaveAll);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerCloseAll);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerClose);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerSave);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -68,8 +74,9 @@ BufferManager::~BufferManager(void)
|
||||
}
|
||||
|
||||
|
||||
void BufferManager::OnMessage(int32_t id, int32_t dataID)
|
||||
bool BufferManager::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
/*
|
||||
switch (id)
|
||||
{
|
||||
case EDN_MSG__BUFFER_CHANGE_CURRENT:
|
||||
@ -127,6 +134,8 @@ void BufferManager::OnMessage(int32_t id, int32_t dataID)
|
||||
}
|
||||
break;
|
||||
}
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -149,7 +158,8 @@ void BufferManager::RemoveAll(void)
|
||||
for (i=0; i<listBuffer.Size(); i++) {
|
||||
Remove(i);
|
||||
}
|
||||
SendMessage(EDN_MSG__BUFFER_REMOVE_ALL);
|
||||
//SendMessage(EDN_MSG__BUFFER_REMOVE_ALL);
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferRemoveAll);
|
||||
}
|
||||
|
||||
|
||||
@ -169,7 +179,8 @@ int32_t BufferManager::Create(void)
|
||||
// Add at the list of element
|
||||
listBuffer.PushBack(myBuffer);
|
||||
int32_t basicID = listBuffer.Size() - 1;
|
||||
SendMessage(EDN_MSG__BUFFER_ADD, basicID);
|
||||
//SendMessage(EDN_MSG__BUFFER_ADD, basicID);
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferAdd);
|
||||
return basicID;
|
||||
}
|
||||
|
||||
@ -192,7 +203,8 @@ int32_t BufferManager::Open(etk::File &myFile)
|
||||
// Add at the list of element
|
||||
listBuffer.PushBack(myBuffer);
|
||||
int32_t basicID = listBuffer.Size() - 1;
|
||||
SendMessage(EDN_MSG__BUFFER_ADD, basicID);
|
||||
//SendMessage(EDN_MSG__BUFFER_ADD, basicID);
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferAdd);
|
||||
return basicID;
|
||||
}
|
||||
|
||||
@ -293,7 +305,8 @@ bool BufferManager::Remove(int32_t BufferID)
|
||||
// Delete the Buffer
|
||||
delete( listBuffer[BufferID] );
|
||||
listBuffer[BufferID] = NULL;
|
||||
SendMessage(EDN_MSG__BUFFER_REMOVE, BufferID);
|
||||
//SendMessage(EDN_MSG__BUFFER_REMOVE, BufferID);
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferRemove);
|
||||
return true;
|
||||
} else {
|
||||
EDN_INFO("non existing Buffer " << BufferID);
|
||||
|
@ -31,8 +31,9 @@
|
||||
#include <BufferEmpty.h>
|
||||
#include <etk/Singleton.h>
|
||||
#include <MsgBroadcast.h>
|
||||
#include <ewol/Widget.h>
|
||||
|
||||
class BufferManager: public etk::Singleton<BufferManager>, public MsgBroadcast
|
||||
class BufferManager: public etk::Singleton<BufferManager>, public ewol::Widget
|
||||
{
|
||||
friend class etk::Singleton<BufferManager>;
|
||||
// specific for sigleton system...
|
||||
@ -42,7 +43,7 @@ class BufferManager: public etk::Singleton<BufferManager>, public MsgBroadcast
|
||||
~BufferManager(void);
|
||||
|
||||
public:
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
||||
|
||||
// return the ID of the buffer allocated
|
||||
// create a buffer with no element
|
||||
|
@ -26,12 +26,14 @@
|
||||
#include <tools_globals.h>
|
||||
#include <ColorizeManager.h>
|
||||
#include <tinyXML/tinyxml.h>
|
||||
#include <ewol/WidgetMessageMultiCast.h>
|
||||
|
||||
#define PFX "ColorizeManager "
|
||||
|
||||
|
||||
ColorizeManager::ColorizeManager(void) : MsgBroadcast("Colorize Manager", EDN_CAT_COLOR)
|
||||
ColorizeManager::ColorizeManager(void)
|
||||
{
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgReloadColorFile);
|
||||
}
|
||||
|
||||
ColorizeManager::~ColorizeManager(void)
|
||||
@ -51,8 +53,9 @@ ColorizeManager::~ColorizeManager(void)
|
||||
}
|
||||
|
||||
|
||||
void ColorizeManager::OnMessage(int32_t id, int32_t dataID)
|
||||
bool ColorizeManager::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
/*
|
||||
switch (id)
|
||||
{
|
||||
case EDN_MSG__RELOAD_COLOR_FILE:
|
||||
@ -64,6 +67,8 @@ void ColorizeManager::OnMessage(int32_t id, int32_t dataID)
|
||||
}
|
||||
break;
|
||||
}
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -263,8 +268,8 @@ void ColorizeManager::LoadFile(const char * xmlFilename)
|
||||
if (NULL != fileBuffer) {
|
||||
delete[] fileBuffer;
|
||||
}
|
||||
SendMessage(EDN_MSG__COLOR_HAS_CHANGE);
|
||||
SendMessage(EDN_MSG__USER_DISPLAY_CHANGE);
|
||||
//SendMessage(EDN_MSG__COLOR_HAS_CHANGE);
|
||||
//SendMessage(EDN_MSG__USER_DISPLAY_CHANGE);
|
||||
}
|
||||
|
||||
Colorize *ColorizeManager::Get(const char *colorName)
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <etk/Singleton.h>
|
||||
#include <Colorize.h>
|
||||
#include <MsgBroadcast.h>
|
||||
#include <ewol/Widget.h>
|
||||
|
||||
typedef enum {
|
||||
// BASIC color for codeViewer
|
||||
@ -49,7 +50,7 @@ typedef enum {
|
||||
|
||||
|
||||
|
||||
class ColorizeManager: public etk::Singleton<ColorizeManager>, public MsgBroadcast
|
||||
class ColorizeManager: public etk::Singleton<ColorizeManager>, public ewol::Widget
|
||||
{
|
||||
friend class etk::Singleton<ColorizeManager>;
|
||||
// specific for sigleton system...
|
||||
@ -58,7 +59,7 @@ class ColorizeManager: public etk::Singleton<ColorizeManager>, public MsgBroadca
|
||||
ColorizeManager(void);
|
||||
~ColorizeManager(void);
|
||||
public:
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
||||
public:
|
||||
void LoadFile(etk::String &xmlFilename);
|
||||
void LoadFile(const char * xmlFilename);
|
||||
|
@ -30,14 +30,16 @@
|
||||
#include <BufferManager.h>
|
||||
#include <ColorizeManager.h>
|
||||
#include <MainWindows.h>
|
||||
#include <ewol/WidgetMessageMultiCast.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "BufferView"
|
||||
|
||||
BufferView::BufferView(void) : MsgBroadcast("Buffer View", EDN_CAT_GUI)
|
||||
BufferView::BufferView(void)
|
||||
{
|
||||
m_shawableAreaX = 0;
|
||||
m_shawableAreaY = 0;
|
||||
//ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerNewFile);
|
||||
// Init link with the buffer Manager
|
||||
//m_bufferManager = BufferManager::Get();
|
||||
//m_colorManager = ColorizeManager::Get();
|
||||
@ -89,9 +91,9 @@ GtkWidget * BufferView::GetMainWidget(void)
|
||||
return m_widget;
|
||||
}
|
||||
*/
|
||||
|
||||
void BufferView::OnMessage(int32_t id, int32_t dataID)
|
||||
bool BufferView::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
/*
|
||||
switch (id)
|
||||
{
|
||||
case EDN_MSG__BUFFER_CHANGE_CURRENT:
|
||||
@ -107,6 +109,8 @@ void BufferView::OnMessage(int32_t id, int32_t dataID)
|
||||
//gtk_widget_queue_draw(m_widget);
|
||||
break;
|
||||
}
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
#if 0
|
||||
|
||||
|
@ -33,14 +33,14 @@
|
||||
|
||||
|
||||
|
||||
class BufferView : public MsgBroadcast
|
||||
class BufferView : public ewol::Widget
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
BufferView(void);
|
||||
~BufferView(void);
|
||||
//GtkWidget *GetMainWidget(void);
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
||||
/*
|
||||
// sur : GTK+ callback :
|
||||
static gboolean CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data);
|
||||
|
@ -36,13 +36,14 @@
|
||||
#include <SearchData.h>
|
||||
|
||||
#include <ewol/WidgetManager.h>
|
||||
#include <ewol/WidgetMessageMultiCast.h>
|
||||
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "ewol::Button"
|
||||
#define __class__ "ewol::CodeView"
|
||||
|
||||
|
||||
CodeView::CodeView(void) : MsgBroadcast("Code View", EDN_CAT_WORK_AREA)
|
||||
CodeView::CodeView(void)
|
||||
{
|
||||
m_label = "CodeView is disable ...";
|
||||
m_bufferID = -1;
|
||||
@ -62,6 +63,25 @@ CodeView::CodeView(void) : MsgBroadcast("Code View", EDN_CAT_WORK_AREA)
|
||||
m_textColorBg.blue = 0.0;
|
||||
m_textColorBg.alpha = 0.25;
|
||||
SetCanHaveFocus(true);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentChangeBufferId);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentSave);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentSaveAs);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentSelectAll);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentRemoveLine);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentUnSelect);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentCopy);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentCut);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentPaste);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentFindPrevious);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentFindNext);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentFindOldNext);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentReplace);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentReplaceAll);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentClose);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentUndo);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentRedo);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentGotoLine);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentSetCharset);
|
||||
}
|
||||
|
||||
CodeView::~CodeView(void)
|
||||
@ -237,8 +257,60 @@ bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent,
|
||||
|
||||
|
||||
|
||||
void CodeView::OnMessage(int32_t id, int32_t dataID)
|
||||
bool CodeView::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
EDN_DEBUG("Extern Event : " << widgetID << " type : " << generateEventId << " position(" << x << "," << y << ")");
|
||||
|
||||
if( ednMsgCodeViewCurrentChangeBufferId == generateEventId) {
|
||||
int32_t bufferID = 0;
|
||||
sscanf(eventExternId, "%d", &bufferID);
|
||||
EDN_INFO("Select a new Buffer ... " << bufferID);
|
||||
m_bufferID = bufferID;
|
||||
m_bufferManager->Get(m_bufferID)->ForceReDraw(true);
|
||||
// request the display of the curent Editor
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferChangeCurrent, (char*)eventExternId);
|
||||
|
||||
} 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:
|
||||
@ -328,14 +400,17 @@ void CodeView::OnMessage(int32_t id, int32_t dataID)
|
||||
// Redraw all the display ... Done under ...
|
||||
break;
|
||||
}
|
||||
*/
|
||||
// Force redraw of the widget
|
||||
OnRegenerateDisplay();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void CodeView::OnGetFocus(void)
|
||||
{
|
||||
SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, m_bufferID);
|
||||
//SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, m_bufferID);
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferChangeCurrent);
|
||||
EDN_INFO("Focus - In");
|
||||
}
|
||||
|
||||
|
@ -35,12 +35,11 @@
|
||||
#include <etk/Types.h>
|
||||
#include <ewol/Widget.h>
|
||||
|
||||
class CodeView :public ewol::Widget, public MsgBroadcast
|
||||
class CodeView :public ewol::Widget
|
||||
{
|
||||
public:
|
||||
CodeView(void);
|
||||
virtual ~CodeView(void);
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
virtual bool CalculateMinSize(void);
|
||||
private:
|
||||
etk::String m_label;
|
||||
@ -52,6 +51,7 @@ class CodeView :public ewol::Widget, public MsgBroadcast
|
||||
bool m_buttunOneSelected;
|
||||
public:
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
||||
public:
|
||||
virtual bool OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y);
|
||||
virtual bool OnEventArea(const char * generateEventId, etkFloat_t x, etkFloat_t y);
|
||||
|
@ -43,11 +43,18 @@
|
||||
#include <ewol/widget/Spacer.h>
|
||||
#include <ewol/widgetMeta/FileChooser.h>
|
||||
#include <ewol/WidgetManager.h>
|
||||
#include <ewol/WidgetMessageMultiCast.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "MainWindows"
|
||||
|
||||
|
||||
const char * const ednEventOpenFile = "edn-Open-File";
|
||||
const char * const ednEventCloseFile = "edn-Close-File";
|
||||
const char * const ednEventSaveFile = "edn-Save-File";
|
||||
const char * const ednEventSaveAsFile = "edn-SaveAs-File";
|
||||
const char * const ednEventPopUpClose = "edn-PopUp-Close";
|
||||
const char * const ednEventPopUpFileSelected = "edn-PopUp-FileSelected";
|
||||
|
||||
MainWindows::MainWindows(void)
|
||||
{
|
||||
@ -66,12 +73,28 @@ MainWindows::MainWindows(void)
|
||||
|
||||
myButton = new ewol::Button("Open");
|
||||
mySizerHori->SubWidgetAdd(myButton);
|
||||
if (false == myButton->ExternLinkOnEvent(ewolEventButtonPressed, GetWidgetId(), ednEventOpenFile) ) {
|
||||
EDN_CRITICAL("link with an entry event");
|
||||
}
|
||||
|
||||
myButton = new ewol::Button("Close");
|
||||
mySizerHori->SubWidgetAdd(myButton);
|
||||
if (false == myButton->ExternLinkOnEvent(ewolEventButtonPressed, GetWidgetId(), ednEventCloseFile) ) {
|
||||
EDN_CRITICAL("link with an entry event");
|
||||
}
|
||||
|
||||
myButton = new ewol::Button("Save");
|
||||
mySizerHori->SubWidgetAdd(myButton);
|
||||
if (false == myButton->ExternLinkOnEvent(ewolEventButtonPressed, GetWidgetId(), ednEventSaveFile) ) {
|
||||
EDN_CRITICAL("link with an entry event");
|
||||
}
|
||||
|
||||
myButton = new ewol::Button("Save As ...");
|
||||
mySizerHori->SubWidgetAdd(myButton);
|
||||
if (false == myButton->ExternLinkOnEvent(ewolEventButtonPressed, GetWidgetId(), ednEventSaveAsFile) ) {
|
||||
EDN_CRITICAL("link with an entry event");
|
||||
}
|
||||
|
||||
|
||||
myLabel = new ewol::Label("FileName");
|
||||
myLabel->SetExpendX(true);
|
||||
@ -97,6 +120,46 @@ MainWindows::~MainWindows(void)
|
||||
|
||||
|
||||
|
||||
bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
EDN_INFO("Receive Event from the main windows ... : widgetid=" << widgetID << "\"" << generateEventId << "\" ==> data=\"" << data << "\"" );
|
||||
if (generateEventId == ednEventOpenFile) {
|
||||
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
|
||||
tmpWidget->SetTitle("Open Files ...");
|
||||
tmpWidget->SetValidateLabel("Open");
|
||||
tmpWidget->SetFolder("/");
|
||||
PopUpWidgetPush(tmpWidget);
|
||||
if (false == tmpWidget->ExternLinkOnEvent(ewolEventFileChooserCancel, GetWidgetId(), ednEventPopUpClose) ) {
|
||||
EDN_CRITICAL("link with an entry event");
|
||||
}
|
||||
if (false == tmpWidget->ExternLinkOnEvent(ewolEventFileChooserValidate, GetWidgetId(), ednEventPopUpFileSelected) ) {
|
||||
EDN_CRITICAL("link with an entry event");
|
||||
}
|
||||
} else if (generateEventId == ednEventPopUpClose) {
|
||||
PopUpWidgetPop();
|
||||
} else if (generateEventId == ednEventPopUpFileSelected) {
|
||||
// get widget:
|
||||
ewol::FileChooser * tmpWidget = (ewol::FileChooser*)ewol::widgetManager::Get(widgetID);
|
||||
if (NULL == tmpWidget) {
|
||||
EDN_ERROR("impossible to get pop_upWidget " << widgetID);
|
||||
PopUpWidgetPop();
|
||||
return false;
|
||||
}
|
||||
// get the filename :
|
||||
etk::String tmpData = tmpWidget->GetCompleateFileName();
|
||||
etk::File myfilename = tmpData;
|
||||
BufferManager *myBufferManager = BufferManager::getInstance();
|
||||
if (false == myBufferManager->Exist(myfilename) ) {
|
||||
int32_t openID = myBufferManager->Open(myfilename);
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgCodeViewCurrentChangeBufferId, openID);
|
||||
} else {
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgCodeViewCurrentChangeBufferId, myBufferManager->GetId(myfilename));
|
||||
}
|
||||
EDN_DEBUG("Request opening the file : " << tmpData);
|
||||
PopUpWidgetPop();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -74,6 +74,7 @@ class MainWindows : public ewol::Windows
|
||||
// Constructeur
|
||||
MainWindows(void);
|
||||
~MainWindows(void);
|
||||
virtual bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y);
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -34,11 +34,11 @@
|
||||
|
||||
//class MenuBarMain;
|
||||
|
||||
class MenuBar: public MsgBroadcast
|
||||
class MenuBar
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
MenuBar(void) : MsgBroadcast("Menu bar", EDN_CAT_GUI){};
|
||||
MenuBar(void) {};
|
||||
~MenuBar(void) {};
|
||||
//GtkWidget * GetWidget(void) { return m_mainWidget; };
|
||||
void OnMessage(int32_t id, int32_t dataID) {};
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
|
||||
|
||||
StatusBar::StatusBar(void) : MsgBroadcast("Status bar", EDN_CAT_GUI)
|
||||
StatusBar::StatusBar(void)
|
||||
{
|
||||
/*
|
||||
m_mainWidget = gtk_statusbar_new();
|
||||
|
@ -28,7 +28,7 @@
|
||||
#ifndef __STATUS_BAR_H__
|
||||
#define __STATUS_BAR_H__
|
||||
|
||||
class StatusBar: public MsgBroadcast
|
||||
class StatusBar
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
|
@ -37,7 +37,7 @@ static void CB_menuGenerique(GtkMenuItem *menu_item, gpointer data)
|
||||
}
|
||||
*/
|
||||
|
||||
ToolBar::ToolBar(void) : MsgBroadcast("Tool bar", EDN_CAT_GUI)
|
||||
ToolBar::ToolBar(void)
|
||||
{
|
||||
/*
|
||||
m_mainWidget = gtk_toolbar_new();
|
||||
|
@ -29,7 +29,7 @@
|
||||
#define __TOOL_BAR_H__
|
||||
|
||||
|
||||
class ToolBar: public MsgBroadcast
|
||||
class ToolBar
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
|
@ -42,7 +42,7 @@
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
WindowsManager::WindowsManager(void) : MsgBroadcast("Windows Manager", EDN_CAT_GUI_MANAGER)
|
||||
WindowsManager::WindowsManager(void)
|
||||
{
|
||||
m_currentBufferID = -1;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include <MsgBroadcast.h>
|
||||
#include <MainWindows.h>
|
||||
|
||||
class WindowsManager: public etk::Singleton<WindowsManager>, public MsgBroadcast
|
||||
class WindowsManager: public etk::Singleton<WindowsManager>
|
||||
{
|
||||
friend class etk::Singleton<WindowsManager>;
|
||||
// specific for sigleton system...
|
||||
|
@ -47,14 +47,40 @@ void Highlight::ParseRules(TiXmlNode *child, etk::VectorType<HighlightPattern*>
|
||||
|
||||
Highlight::Highlight(etk::String &xmlFilename)
|
||||
{
|
||||
|
||||
TiXmlDocument XmlDocument;
|
||||
// open the curent File
|
||||
bool loadError = XmlDocument.LoadFile(xmlFilename.c_str());
|
||||
|
||||
etk::File fileName(xmlFilename, etk::FILE_TYPE_DATA);
|
||||
if (false == fileName.Exist()) {
|
||||
EWOL_ERROR("File Does not exist : " << fileName);
|
||||
return;
|
||||
}
|
||||
int32_t fileSize = fileName.Size();
|
||||
if (0==fileSize) {
|
||||
EWOL_ERROR("This file is empty : " << fileName);
|
||||
return;
|
||||
}
|
||||
if (false == fileName.fOpenRead()) {
|
||||
EWOL_ERROR("Can not open the file : " << fileName);
|
||||
return;
|
||||
}
|
||||
// allocate data
|
||||
char * fileBuffer = new char[fileSize];
|
||||
if (NULL == fileBuffer) {
|
||||
EWOL_ERROR("Error Memory allocation size=" << fileSize);
|
||||
return;
|
||||
}
|
||||
// load data from the file :
|
||||
fileName.fRead(fileBuffer, 1, fileSize);
|
||||
// close the file:
|
||||
fileName.fClose();
|
||||
// load the XML from the memory
|
||||
bool loadError = XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8);
|
||||
if (false == loadError) {
|
||||
EDN_ERROR( "can not load Hightlight XML: PARSING error: \"" << xmlFilename << "\"");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
TiXmlElement* root = XmlDocument.FirstChildElement( "EdnLang" );
|
||||
if (NULL == root) {
|
||||
EDN_ERROR( "can not load Hightlight XML: main node not find: \"EdnLang\"");
|
||||
@ -109,6 +135,9 @@ Highlight::Highlight(etk::String &xmlFilename)
|
||||
// get the next node element :
|
||||
child = child->NextSibling();
|
||||
}
|
||||
if (NULL != fileBuffer) {
|
||||
delete[] fileBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
Highlight::~Highlight(void)
|
||||
|
@ -26,13 +26,14 @@
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <HighlightManager.h>
|
||||
#include <ewol/WidgetMessageMultiCast.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "HighlightManager"
|
||||
|
||||
HighlightManager::HighlightManager(void) : MsgBroadcast("Hight-light Manager", EDN_CAT_HL)
|
||||
HighlightManager::HighlightManager(void)
|
||||
{
|
||||
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgColorHasChange);
|
||||
}
|
||||
|
||||
HighlightManager::~HighlightManager(void)
|
||||
@ -50,8 +51,9 @@ HighlightManager::~HighlightManager(void)
|
||||
}
|
||||
|
||||
|
||||
void HighlightManager::OnMessage(int32_t id, int32_t dataID)
|
||||
bool HighlightManager::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
/*
|
||||
switch (id)
|
||||
{
|
||||
case EDN_MSG__COLOR_HAS_CHANGE:
|
||||
@ -63,6 +65,8 @@ void HighlightManager::OnMessage(int32_t id, int32_t dataID)
|
||||
}
|
||||
break;
|
||||
}
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
Highlight *HighlightManager::Get(etk::File &fileName)
|
||||
@ -87,58 +91,42 @@ bool HighlightManager::Exist(etk::File &fileName)
|
||||
|
||||
void HighlightManager::loadLanguages(void)
|
||||
{
|
||||
etk::String homedir;
|
||||
#ifdef NDEBUG
|
||||
homedir = "/usr/share/edn/";
|
||||
#else
|
||||
homedir = "./data/";
|
||||
#endif
|
||||
/*
|
||||
etk::String xmlFilename = homedir;
|
||||
xmlFilename += "lang_c.xml";
|
||||
etk::String xmlFilename = "lang_c.xml";
|
||||
Highlight *myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = homedir;
|
||||
xmlFilename += "lang_boo.xml";
|
||||
xmlFilename = "lang_boo.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = homedir;
|
||||
xmlFilename += "lang_Makefile.xml";
|
||||
xmlFilename = "lang_Makefile.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = homedir;
|
||||
xmlFilename += "lang_asm.xml";
|
||||
xmlFilename = "lang_asm.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = homedir;
|
||||
xmlFilename += "lang_xml.xml";
|
||||
xmlFilename = "lang_xml.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = homedir;
|
||||
xmlFilename += "lang_php.xml";
|
||||
xmlFilename = "lang_php.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = homedir;
|
||||
xmlFilename += "lang_bash.xml";
|
||||
xmlFilename = "lang_bash.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = homedir;
|
||||
xmlFilename += "lang_matlab.xml";
|
||||
xmlFilename = "lang_matlab.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
|
||||
xmlFilename = homedir;
|
||||
xmlFilename += "lang_java.xml";
|
||||
xmlFilename = "lang_java.xml";
|
||||
myHightline = new Highlight(xmlFilename);
|
||||
listHighlight.PushBack(myHightline);
|
||||
*/
|
||||
|
||||
//myHightline->Display();
|
||||
}
|
||||
|
||||
|
@ -31,9 +31,10 @@ class HighlightManager;
|
||||
#include <etk/Singleton.h>
|
||||
#include <MsgBroadcast.h>
|
||||
#include <Highlight.h>
|
||||
#include <ewol/Widget.h>
|
||||
|
||||
|
||||
class HighlightManager: public etk::Singleton<HighlightManager>, public MsgBroadcast
|
||||
class HighlightManager: public etk::Singleton<HighlightManager>, public ewol::Widget
|
||||
{
|
||||
friend class etk::Singleton<HighlightManager>;
|
||||
// specific for sigleton system...
|
||||
@ -43,7 +44,7 @@ class HighlightManager: public etk::Singleton<HighlightManager>, public MsgBroad
|
||||
~HighlightManager(void);
|
||||
|
||||
public:
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
||||
public:
|
||||
void loadLanguages(void);
|
||||
Highlight * Get(etk::File &fileName);
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <CTagsManager.h>
|
||||
#include <ClipBoard.h>
|
||||
#include <BufferManager.h>
|
||||
#include <ewol/WidgetMessageMultiCast.h>
|
||||
|
||||
|
||||
|
||||
@ -42,12 +43,16 @@
|
||||
* @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(), ednMsgCtagsOpen);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCtagsReload);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCtagsJumpCurrentSelection);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCtagsJumpBack);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -92,7 +97,7 @@ etk::String CTagsManager::GetFolder(etk::String &inputString)
|
||||
return out;
|
||||
}
|
||||
|
||||
void CTagsManager::OnMessage(int32_t id, int32_t dataID)
|
||||
bool CTagsManager::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
/*
|
||||
switch (id)
|
||||
@ -144,6 +149,7 @@ void CTagsManager::OnMessage(int32_t id, int32_t dataID)
|
||||
break;
|
||||
}
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
|
||||
#include <etk/Singleton.h>
|
||||
#include <ewol/Widget.h>
|
||||
#include "MsgBroadcast.h"
|
||||
#include "readtags.h"
|
||||
|
||||
@ -40,7 +41,7 @@ typedef struct{
|
||||
} TagListFind_ts;
|
||||
|
||||
|
||||
class CTagsManager: public etk::Singleton<CTagsManager>, public MsgBroadcast
|
||||
class CTagsManager: public etk::Singleton<CTagsManager>, public ewol::Widget
|
||||
{
|
||||
friend class etk::Singleton<CTagsManager>;
|
||||
// specific for sigleton system...
|
||||
@ -50,7 +51,7 @@ class CTagsManager: public etk::Singleton<CTagsManager>, public MsgBroadcast
|
||||
~CTagsManager(void);
|
||||
|
||||
public:
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
virtual bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
||||
private:
|
||||
int32_t m_currentSelectedID;
|
||||
void LoadTagFile(void);
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include <unistd.h>
|
||||
#include <readtags.h>
|
||||
#include <CTagsManager.h>
|
||||
#include <ewol/WidgetMessageMultiCast.h>
|
||||
|
||||
MainWindows * basicWindows = NULL;
|
||||
|
||||
@ -83,8 +84,6 @@ void APP_Init(int argc, char *argv[])
|
||||
|
||||
|
||||
// init ALL Singleton :
|
||||
(void)MsgBroadcastCore::getInstance();
|
||||
//(void)AccelKey::getInstance();
|
||||
(void)WindowsManager::getInstance();
|
||||
(void)CTagsManager::getInstance();
|
||||
BufferManager *myBufferManager = BufferManager::getInstance();
|
||||
@ -92,15 +91,7 @@ void APP_Init(int argc, char *argv[])
|
||||
// set color and other trucs...
|
||||
ColorizeManager *myColorManager = NULL;
|
||||
myColorManager = ColorizeManager::getInstance();
|
||||
etk::String homedir;
|
||||
//homedir = getenv("HOME");
|
||||
#ifdef NDEBUG
|
||||
homedir = "/usr/share/edn/";
|
||||
#else
|
||||
homedir = "./data/";
|
||||
#endif
|
||||
//homedir += "color_black.xml";
|
||||
homedir = "color_white.xml";
|
||||
etk::String homedir = "color_white.xml";
|
||||
myColorManager->LoadFile( homedir.c_str() );
|
||||
myColorManager->DisplayListOfColor();
|
||||
|
||||
@ -108,8 +99,6 @@ void APP_Init(int argc, char *argv[])
|
||||
myHighlightManager = HighlightManager::getInstance();
|
||||
myHighlightManager->loadLanguages();
|
||||
|
||||
// open display
|
||||
MsgBroadcastCore::getInstance()->SendMessage(NULL, EDN_MSG__GUI_SHOW_MAIN_WINDOWS);
|
||||
|
||||
// get the curent program folder
|
||||
char cCurrentPath[FILENAME_MAX];
|
||||
@ -130,20 +119,11 @@ void APP_Init(int argc, char *argv[])
|
||||
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);
|
||||
//MsgBroadcastCore::getInstance()->SendMessage(NULL, EDN_MSG__CURRENT_CHANGE_BUFFER_ID, idBuffOpened);
|
||||
ewol::widgetMessageMultiCast::Add(-1, ednMsgCodeViewCurrentChangeBufferId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
{
|
||||
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();
|
||||
|
@ -27,260 +27,54 @@
|
||||
#include <tools_globals.h>
|
||||
#include <MsgBroadcast.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "MsgBroadcast"
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
extern const char* const ednMsgBufferChangeCurrent = "edn-Msg-Buffer-Change-Current";
|
||||
extern const char* const ednMsgUserDisplayChange = "edn-Msg-User-Display-Change";
|
||||
|
||||
MsgBroadcast::~MsgBroadcast(void)
|
||||
{
|
||||
m_messageSystem->RmReceiver(this);
|
||||
m_messageSystem = NULL;
|
||||
}
|
||||
extern const char* const ednMsgBufferRemove = "edn-Msg-Buffer-Remove";
|
||||
extern const char* const ednMsgBufferRemoveAll = "edn-Msg-Buffer-Remove-All";
|
||||
extern const char* const ednMsgBufferAdd = "edn-Msg-Buffer-Add";
|
||||
extern const char* const ednMsgBufferChangeState = "edn-Msg-Buffer-Change-State";
|
||||
extern const char* const ednMsgBufferChangeName = "edn-Msg-Buffer-Change-Name";
|
||||
extern const char* const ednMsgBufferModify = "edn-Msg-Buffer-Modify";
|
||||
extern const char* const ednMsgBufferHasHistory = "edn-Msg-Buffer-Has-History";
|
||||
extern const char* const ednMsgBufferHasNotHistory = "edn-Msg-Buffer-Has-Not-History";
|
||||
extern const char* const ednMsgBufferHasFutureHistory = "edn-Msg-Buffer-Has-Future-History";
|
||||
extern const char* const ednMsgBufferHasNotFutureHistory = "edn-Msg-Buffer-Has-Not-Future-History";
|
||||
|
||||
void MsgBroadcast::OnMessage(int32_t id, int32_t dataID)
|
||||
{
|
||||
// nothing to do here
|
||||
}
|
||||
extern const char* const ednMsgBufferManagerNewFile = "edn-Msg-Buffer-Manager-New-File";
|
||||
extern const char* const ednMsgBufferManagerSaveAll = "edn-Msg-Buffer-Manager-Save-All";
|
||||
extern const char* const ednMsgBufferManagerCloseAll = "edn-Msg-Buffer-Manager-Close-All";
|
||||
extern const char* const ednMsgBufferManagerClose = "edn-Msg-Buffer-Manager-Close";
|
||||
extern const char* const ednMsgBufferManagerSave = "edn-Msg-Buffer-Manager-Save";
|
||||
|
||||
void MsgBroadcast::SendMessage(messageType_te id, int32_t dataID)
|
||||
{
|
||||
m_messageSystem->SendMessage(this, id, dataID);
|
||||
}
|
||||
extern const char* const ednMsgCodeViewCurrentChangeBufferId = "edn-Msg-CodeView-Current-Change-Buffer-Id";
|
||||
extern const char* const ednMsgCodeViewCurrentSave = "edn-Msg-CodeView-Current-Save";
|
||||
extern const char* const ednMsgCodeViewCurrentSaveAs = "edn-Msg-CodeView-Current-Save-As";
|
||||
extern const char* const ednMsgCodeViewCurrentSelectAll = "edn-Msg-CodeView-Current-Select-All";
|
||||
extern const char* const ednMsgCodeViewCurrentRemoveLine = "edn-Msg-CodeView-Current-Remove-Line";
|
||||
extern const char* const ednMsgCodeViewCurrentUnSelect = "edn-Msg-CodeView-Current-Un-Select";
|
||||
extern const char* const ednMsgCodeViewCurrentCopy = "edn-Msg-CodeView-Current-Copy";
|
||||
extern const char* const ednMsgCodeViewCurrentCut = "edn-Msg-CodeView-Current-Cut";
|
||||
extern const char* const ednMsgCodeViewCurrentPaste = "edn-Msg-CodeView-Current-Paste";
|
||||
extern const char* const ednMsgCodeViewCurrentFindPrevious = "edn-Msg-CodeView-Current-Find-Previous";
|
||||
extern const char* const ednMsgCodeViewCurrentFindNext = "edn-Msg-CodeView-Current-Find-Next";
|
||||
extern const char* const ednMsgCodeViewCurrentFindOldNext = "edn-Msg-CodeView-Current-Find-Old-Next";
|
||||
extern const char* const ednMsgCodeViewCurrentReplace = "edn-Msg-CodeView-Current-Replace";
|
||||
extern const char* const ednMsgCodeViewCurrentReplaceAll = "edn-Msg-CodeView-Current-Replace-All";
|
||||
extern const char* const ednMsgCodeViewCurrentClose = "edn-Msg-CodeView-Current-Close";
|
||||
extern const char* const ednMsgCodeViewCurrentUndo = "edn-Msg-CodeView-Current-Undo";
|
||||
extern const char* const ednMsgCodeViewCurrentRedo = "edn-Msg-CodeView-Current-Redo";
|
||||
extern const char* const ednMsgCodeViewCurrentGotoLine = "edn-Msg-CodeView-Current-Goto-Line";
|
||||
extern const char* const ednMsgCodeViewCurrentSetCharset = "edn-Msg-CodeView-Current-Set-Charset";
|
||||
|
||||
extern const char* const ednMsgCtagsOpen = "edn-Msg-Ctags-Open";
|
||||
extern const char* const ednMsgCtagsReload = "edn-Msg-Ctags-Reload";
|
||||
extern const char* const ednMsgCtagsJumpCurrentSelection = "edn-Msg-Ctags-Jump-Current-Selection";
|
||||
extern const char* const ednMsgCtagsJumpBack = "edn-Msg-Ctags-Jump-Back";
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "MsgBroadcastCore"
|
||||
extern const char* const ednMsgColorHasChange = "edn-Msg-Color-Has-Change";
|
||||
|
||||
extern const char* const ednMsgReloadColorFile = "edn-Msg-Reload-Color-File";
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
@ -27,186 +27,58 @@
|
||||
#define __MSG_BROADCAST_H__
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <etk/Singleton.h>
|
||||
#include <etk/String.h>
|
||||
|
||||
|
||||
extern const char* const ednMsgBufferChangeCurrent; // set the new current BUFFER ...
|
||||
extern const char* const ednMsgUserDisplayChange; // User change the display ==> need to reload all the display depending on color internal
|
||||
|
||||
// broadCast Message
|
||||
extern const char* const ednMsgBufferRemove;
|
||||
extern const char* const ednMsgBufferRemoveAll;
|
||||
extern const char* const ednMsgBufferAdd;
|
||||
extern const char* const ednMsgBufferChangeState;
|
||||
extern const char* const ednMsgBufferChangeName;
|
||||
extern const char* const ednMsgBufferModify;
|
||||
extern const char* const ednMsgBufferHasHistory;
|
||||
extern const char* const ednMsgBufferHasNotHistory;
|
||||
extern const char* const ednMsgBufferHasFutureHistory;
|
||||
extern const char* const ednMsgBufferHasNotFutureHistory;
|
||||
|
||||
// Message to prevent the curent thread that Buffer has changed
|
||||
// the ID we'll use to identify our event
|
||||
typedef enum {
|
||||
EDN_MSG__NONE = 0,
|
||||
EDN_MSG__BUFFER_CHANGE_CURRENT, // set the new current BUFFER ...
|
||||
EDN_MSG__USER_DISPLAY_CHANGE, // User change the display ==> need to reload all the display depending on color internal
|
||||
extern const char* const ednMsgBufferManagerNewFile;
|
||||
extern const char* const ednMsgBufferManagerSaveAll;
|
||||
extern const char* const ednMsgBufferManagerCloseAll;
|
||||
extern const char* const ednMsgBufferManagerClose;
|
||||
extern const char* const ednMsgBufferManagerSave;
|
||||
|
||||
// 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 ednMsgCodeViewCurrentChangeBufferId;
|
||||
extern const char* const ednMsgCodeViewCurrentSave;
|
||||
extern const char* const ednMsgCodeViewCurrentSaveAs;
|
||||
extern const char* const ednMsgCodeViewCurrentSelectAll;
|
||||
extern const char* const ednMsgCodeViewCurrentRemoveLine;
|
||||
extern const char* const ednMsgCodeViewCurrentUnSelect;
|
||||
extern const char* const ednMsgCodeViewCurrentCopy;
|
||||
extern const char* const ednMsgCodeViewCurrentCut;
|
||||
extern const char* const ednMsgCodeViewCurrentPaste;
|
||||
extern const char* const ednMsgCodeViewCurrentFindPrevious;
|
||||
extern const char* const ednMsgCodeViewCurrentFindNext;
|
||||
extern const char* const ednMsgCodeViewCurrentFindOldNext;
|
||||
extern const char* const ednMsgCodeViewCurrentReplace;
|
||||
extern const char* const ednMsgCodeViewCurrentReplaceAll;
|
||||
extern const char* const ednMsgCodeViewCurrentClose;
|
||||
extern const char* const ednMsgCodeViewCurrentUndo;
|
||||
extern const char* const ednMsgCodeViewCurrentRedo;
|
||||
extern const char* const ednMsgCodeViewCurrentGotoLine;
|
||||
extern const char* const ednMsgCodeViewCurrentSetCharset;
|
||||
|
||||
// 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 ednMsgCtagsOpen;
|
||||
extern const char* const ednMsgCtagsReload;
|
||||
extern const char* const ednMsgCtagsJumpCurrentSelection;
|
||||
extern const char* const ednMsgCtagsJumpBack;
|
||||
|
||||
// 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,
|
||||
extern const char* const ednMsgColorHasChange;
|
||||
|
||||
// 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 ednMsgReloadColorFile;
|
||||
|
||||
// DESTINATION : SYSTEM ...
|
||||
MSG_TO_SYSTEM__START,
|
||||
MSG_TO_SYSTEM__STOP,
|
||||
|
||||
|
||||
// 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,
|
||||
|
||||
// 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
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <tools_globals.h>
|
||||
#include <ColorizeManager.h>
|
||||
#include <MsgBroadcast.h>
|
||||
#include <ewol/WidgetMessageMultiCast.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "globals"
|
||||
@ -54,7 +55,7 @@ void globals::SetDisplayEndOfLine(bool newVal)
|
||||
{
|
||||
EDN_INFO("Set EndOfLine " << newVal);
|
||||
displayEOL = newVal;
|
||||
GeneralSendMessage(EDN_MSG__REFRESH_DISPLAY);
|
||||
ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------
|
||||
@ -68,7 +69,7 @@ void globals::SetDisplaySpaceChar(bool newVal)
|
||||
{
|
||||
EDN_INFO("Set SpaceChar " << newVal);
|
||||
displaySpaceChar = newVal;
|
||||
GeneralSendMessage(EDN_MSG__REFRESH_DISPLAY);
|
||||
ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user