Change tree ==> simplify
This commit is contained in:
parent
4e7491e5fc
commit
1894f56217
@ -96,6 +96,7 @@ void CodeView::CalculateMaxSize(void)
|
||||
void CodeView::OnRegenerateDisplay(void)
|
||||
{
|
||||
if (true == NeedRedraw()) {
|
||||
EDN_WARNING("Regenerate compleately the CODE display ... ");
|
||||
// For the scrooling windows
|
||||
CalculateMaxSize();
|
||||
|
@ -143,6 +143,7 @@ MainWindows::MainWindows(void)
|
||||
// Generic event ...
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiSaveAs);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiOpen);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiAbout);
|
||||
}
|
||||
|
||||
|
||||
@ -159,7 +160,7 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve
|
||||
if (true == ewol::Windows::OnEventAreaExternal(widgetID, generateEventId, data, x, y) ) {
|
||||
return true;
|
||||
}
|
||||
//EDN_INFO("Receive Event from the main windows ... : widgetid=" << widgetID << "\"" << generateEventId << "\" ==> data=\"" << data << "\"" );
|
||||
EDN_INFO("Receive Event from the main windows ... : widgetid=" << widgetID << "\"" << generateEventId << "\" ==> data=\"" << data << "\"" );
|
||||
// Open file Section ...
|
||||
if (generateEventId == ednMsgGuiOpen) {
|
||||
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
|
||||
@ -230,6 +231,36 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve
|
||||
BufferManager * myMng = BufferManager::getInstance();
|
||||
myMng->Get(m_currentSavingAsIdBuffer)->SetFileName(tmpData);
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgGuiSave, m_currentSavingAsIdBuffer);
|
||||
} else if (generateEventId == ednMsgGuiAbout) {
|
||||
/*
|
||||
//Title
|
||||
"Edn"
|
||||
// version
|
||||
VERSION_TAG_NAME
|
||||
// comments:
|
||||
"Editeur De N'ours\n"
|
||||
"L'Editeur Desoxyribo-Nucleique.\n"
|
||||
"Source Code Editor\n"
|
||||
"Build Time : " VERSION_BUILD_TIME;
|
||||
// copyright
|
||||
"Copyright 2010 Edouard DUPIN, all right reserved";
|
||||
// licence
|
||||
"This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY\n\n"
|
||||
"You can:\n"
|
||||
" * Redistribute the sources code and binaries.\n"
|
||||
" * Modify the Sources code.\n"
|
||||
" * Use a part of the sources (less than 50%) in an other software, just write somewhere \"Edn is great\" visible by the user (on your product or on your website with a link to my page).\n"
|
||||
" * Redistribute the modification only if you want.\n"
|
||||
" * Send me the bug-fix (it could be great).\n"
|
||||
" * Pay me a beer or some other things.\n"
|
||||
" * Print the source code on WC paper ...\n\n"
|
||||
"You can NOT:\n"
|
||||
" * Earn money with this Software (But I can).\n"
|
||||
" * Add malware in the Sources.\n"
|
||||
" * Do something bad with the sources.\n"
|
||||
" * Use it to travel in the space with a toaster.\n\n"
|
||||
"I reserve the right to change this licence. If it change the version of the copy you have keep its own license."
|
||||
*/
|
||||
}
|
||||
|
||||
return true;
|
@ -1,9 +1,9 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file WindowsManager.h
|
||||
* @brief Editeur De N'ours : Windows creation, pop up, destruction ... (header)
|
||||
* @file MainWindows.h
|
||||
* @brief Editeur De N'ours : main Windows diplayer (header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 20/06/2011
|
||||
* @date 04/01/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
@ -22,29 +22,29 @@
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef __WINDOWS_MANAGER_H__
|
||||
#define __WINDOWS_MANAGER_H__
|
||||
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <etk/Singleton.h>
|
||||
#include <MsgBroadcast.h>
|
||||
#include <MainWindows.h>
|
||||
|
||||
class WindowsManager: public etk::Singleton<WindowsManager>
|
||||
#include <CodeView.h>
|
||||
#include <BufferView.h>
|
||||
#include <BufferManager.h>
|
||||
|
||||
|
||||
#ifndef __MAIN_WINDOWS_H__
|
||||
#define __MAIN_WINDOWS_H__
|
||||
class MainWindows : public ewol::Windows
|
||||
{
|
||||
friend class etk::Singleton<WindowsManager>;
|
||||
// specific for sigleton system...
|
||||
private:
|
||||
// Constructeur
|
||||
WindowsManager(void);
|
||||
~WindowsManager(void);
|
||||
|
||||
int32_t m_currentSavingAsIdBuffer;
|
||||
public:
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
private:
|
||||
MainWindows * m_mainWindow;
|
||||
int32_t m_currentBufferID;
|
||||
// Constructeur
|
||||
MainWindows(void);
|
||||
~MainWindows(void);
|
||||
virtual bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,83 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file MainWindows.h
|
||||
* @brief Editeur De N'ours : main Windows diplayer (header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 04/01/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <etk/Singleton.h>
|
||||
#include <MsgBroadcast.h>
|
||||
|
||||
#include <CodeView.h>
|
||||
#include <BufferView.h>
|
||||
#include <BufferManager.h>
|
||||
#include <MenuBar.h>
|
||||
#include <StatusBar.h>
|
||||
#include <ToolBar.h>
|
||||
|
||||
|
||||
#ifndef __MAIN_WINDOWS_H__
|
||||
#define __MAIN_WINDOWS_H__
|
||||
#if 0
|
||||
class MainWindows: public etk::Singleton<MainWindows>, public MsgBroadcast
|
||||
{
|
||||
friend class etk::Singleton<MainWindows>;
|
||||
// specific for sigleton system...
|
||||
private:
|
||||
// Constructeur
|
||||
MainWindows(void);
|
||||
~MainWindows(void);
|
||||
public:
|
||||
//GtkWidget * GetWidget(void) { return m_mainWindow;};
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
//static bool OnQuit(GtkWidget *widget, gpointer data);
|
||||
//static gboolean OnStateChange(GtkWidget *widget, GdkEvent* event, gpointer data);
|
||||
|
||||
private:
|
||||
void SetTitle(etk::File &fileName, bool isModify);
|
||||
void SetNoTitle(void);
|
||||
// main windows widget :
|
||||
/*
|
||||
GtkWidget * m_mainWindow;
|
||||
GtkWidget * m_internalTitleLabel;
|
||||
BufferView m_BufferView;
|
||||
CodeView m_CodeView;
|
||||
MenuBar m_MenuBar;
|
||||
StatusBar m_StatusBar;
|
||||
ToolBar m_ToolBar;
|
||||
*/
|
||||
};
|
||||
#endif
|
||||
class MainWindows : public ewol::Windows
|
||||
{
|
||||
private:
|
||||
int32_t m_currentSavingAsIdBuffer;
|
||||
public:
|
||||
// Constructeur
|
||||
MainWindows(void);
|
||||
~MainWindows(void);
|
||||
virtual bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y);
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -1,386 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file MenuBar.cpp
|
||||
* @brief Editeur De N'ours : abstraction of the menu bar (Sources)
|
||||
* @author Edouard DUPIN
|
||||
* @date 17/06/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <MenuBar.h>
|
||||
#include <ClipBoard.h>
|
||||
#include <etk/unicode.h>
|
||||
#include <ColorizeManager.h>
|
||||
#if 0
|
||||
#define MENU_MSG
|
||||
const char * MSG_TogleDisplayChar = "Request a Togle of char displaying";
|
||||
const char * MSG_TogleDisplayEOL = "Request a Togle of displaying EndOfLine";
|
||||
const char * MSG_TogleAutoIndent = "Request a Togle of Auto Indent";
|
||||
const char * MSG_SetCharsetIso559_1 = "Set ISO 5589-1";
|
||||
const char * MSG_SetCharsetIso559_15 = "Set ISO 5589-15";
|
||||
const char * MSG_SetCharsetUTF8 = "Set UTF 8";
|
||||
const char * MSG_LoadColorBlack = "Load Color Black";
|
||||
const char * MSG_LoadColorWhite = "Load Color White";
|
||||
#define MSG_LINK(data)
|
||||
|
||||
|
||||
static void CB_menuGenerique(GtkMenuItem *menu_item, gpointer data)
|
||||
{
|
||||
//EDN_INFO("basic menue_event");
|
||||
messageData_ts * msg = (messageData_ts*)data;
|
||||
GeneralSendMessage(msg->msgId, msg->dataId);
|
||||
}
|
||||
|
||||
static void CB_menuInternal(GtkMenuItem *menu_item, gpointer data)
|
||||
{
|
||||
//EDN_INFO("basic menue_event");
|
||||
const char * myPointer = (const char*)data;
|
||||
if (myPointer == MSG_TogleDisplayChar) {
|
||||
if (globals::IsSetDisplaySpaceChar() == true) {
|
||||
globals::SetDisplaySpaceChar(false);
|
||||
} else {
|
||||
globals::SetDisplaySpaceChar(true);
|
||||
}
|
||||
} else if (myPointer == MSG_TogleDisplayEOL) {
|
||||
if (globals::IsSetDisplayEndOfLine() == true) {
|
||||
globals::SetDisplayEndOfLine(false);
|
||||
} else {
|
||||
globals::SetDisplayEndOfLine(true);
|
||||
}
|
||||
} else if (myPointer == MSG_TogleAutoIndent) {
|
||||
if (globals::IsSetAutoIndent() == true) {
|
||||
globals::SetAutoIndent(false);
|
||||
} else {
|
||||
globals::SetAutoIndent(true);
|
||||
}
|
||||
} else if (myPointer == MSG_SetCharsetIso559_1) {
|
||||
GeneralSendMessage(EDN_MSG__CURRENT_SET_CHARSET, EDN_CHARSET_ISO_8859_1);
|
||||
} else if (myPointer == MSG_SetCharsetIso559_15) {
|
||||
GeneralSendMessage(EDN_MSG__CURRENT_SET_CHARSET, EDN_CHARSET_ISO_8859_15);
|
||||
} else if (myPointer == MSG_SetCharsetUTF8) {
|
||||
GeneralSendMessage(EDN_MSG__CURRENT_SET_CHARSET, EDN_CHARSET_UTF8);
|
||||
} else if (myPointer == MSG_LoadColorWhite) {
|
||||
ColorizeManager * myColorSystem = ColorizeManager::getInstance();
|
||||
etk::UString homedir;
|
||||
# ifdef NDEBUG
|
||||
homedir = "/usr/share/edn/";
|
||||
# else
|
||||
homedir = "./data/";
|
||||
# endif
|
||||
homedir += "color_white.xml";
|
||||
myColorSystem->LoadFile(homedir);
|
||||
} else if (myPointer == MSG_LoadColorBlack) {
|
||||
ColorizeManager * myColorSystem = ColorizeManager::getInstance();
|
||||
etk::UString homedir;
|
||||
# ifdef NDEBUG
|
||||
homedir = "/usr/share/edn/";
|
||||
# else
|
||||
homedir = "./data/";
|
||||
# endif
|
||||
homedir += "color_black.xml";
|
||||
myColorSystem->LoadFile(homedir);
|
||||
}
|
||||
}
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "MenuBarMain"
|
||||
|
||||
class MenuBarMain
|
||||
{
|
||||
public:
|
||||
MenuBarMain(const char * title, GtkWidget * parent) : m_parent(NULL), m_menu(NULL), m_menuListe(NULL)
|
||||
{
|
||||
m_parent = parent;
|
||||
m_menu = gtk_menu_item_new_with_mnemonic(title);
|
||||
gtk_menu_shell_append( GTK_MENU_SHELL (parent), m_menu);
|
||||
}
|
||||
|
||||
~MenuBarMain(void)
|
||||
{
|
||||
|
||||
}
|
||||
private:
|
||||
void CheckSubMenu(void)
|
||||
{
|
||||
if (NULL == m_menuListe) {
|
||||
m_menuListe = gtk_menu_new();
|
||||
if (NULL != m_menuListe) {
|
||||
gtk_menu_item_set_submenu( GTK_MENU_ITEM (m_menu), m_menuListe);
|
||||
} else {
|
||||
EDN_ERROR("Can not create sub menu");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
void AddInternal(const char * title, const char * accelKey, const char * msg, bool enable = false)
|
||||
{
|
||||
CheckSubMenu();
|
||||
if (NULL == m_menuListe) {
|
||||
return;
|
||||
}
|
||||
// create ITEM
|
||||
GtkWidget *tmpWidget = gtk_menu_item_new_with_mnemonic(title);
|
||||
// set grisage :
|
||||
gtk_widget_set_sensitive(tmpWidget, enable);
|
||||
// add to the menu :
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(m_menuListe), tmpWidget);
|
||||
// accel KEY :
|
||||
AccelKey::getInstance()->SetAccel(tmpWidget, (char *)accelKey);
|
||||
// set callback
|
||||
g_signal_connect(G_OBJECT(tmpWidget), "activate", G_CALLBACK(CB_menuInternal), (void*)msg);
|
||||
}
|
||||
|
||||
|
||||
void Add(const char * title, const char * accelKey, messageType_te id = EDN_MSG__NONE, bool enable = false, int32_t dataSpecificID = -1)
|
||||
{
|
||||
CheckSubMenu();
|
||||
if (NULL == m_menuListe) {
|
||||
return;
|
||||
}
|
||||
messageData_ts * message = new messageData_ts;
|
||||
message->msgId = id;
|
||||
message->dataId = dataSpecificID;
|
||||
m_message.PushBack(message);
|
||||
// create ITEM
|
||||
GtkWidget *tmpWidget = gtk_menu_item_new_with_mnemonic(title);
|
||||
// set grisage :
|
||||
gtk_widget_set_sensitive(tmpWidget, enable);
|
||||
// add to the menu :
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(m_menuListe), tmpWidget);
|
||||
// accel KEY :
|
||||
AccelKey::getInstance()->SetAccel(tmpWidget, (char *)accelKey);
|
||||
// set callback
|
||||
if(EDN_MSG__NONE!=id) {
|
||||
g_signal_connect(G_OBJECT(tmpWidget), "activate", G_CALLBACK(CB_menuGenerique), message);
|
||||
}
|
||||
}
|
||||
|
||||
void AddGen(const char * title, const char * accelKey, messageType_te id = EDN_MSG__NONE, bool enable = false, int32_t dataSpecificID = -1)
|
||||
{
|
||||
CheckSubMenu();
|
||||
if (NULL == m_menuListe) {
|
||||
return;
|
||||
}
|
||||
messageData_ts * message = new messageData_ts;
|
||||
message->msgId = id;
|
||||
message->dataId = dataSpecificID;
|
||||
m_message.PushBack(message);
|
||||
// create ITEM
|
||||
GtkWidget *tmpWidget = gtk_image_menu_item_new_from_stock( title, AccelKey::getInstance()->GetAccel() );
|
||||
GdkColor color;
|
||||
gdk_color_parse ("red", &color);
|
||||
gtk_widget_modify_fg(tmpWidget, GTK_STATE_NORMAL, &color);
|
||||
gtk_widget_modify_bg(tmpWidget, GTK_STATE_NORMAL, &color);
|
||||
gtk_widget_modify_text(tmpWidget, GTK_STATE_NORMAL, &color);
|
||||
// set grisage :
|
||||
gtk_widget_set_sensitive(tmpWidget, enable);
|
||||
// add to the menu :
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(m_menuListe), tmpWidget);
|
||||
// accel KEY :
|
||||
AccelKey::getInstance()->SetAccel(tmpWidget, (char *)accelKey);
|
||||
// set callback
|
||||
if(EDN_MSG__NONE!=id) {
|
||||
g_signal_connect(G_OBJECT(tmpWidget), "activate", G_CALLBACK(CB_menuGenerique), message);
|
||||
}
|
||||
}
|
||||
|
||||
void AddSeparator(void)
|
||||
{
|
||||
CheckSubMenu();
|
||||
if (NULL == m_menuListe) {
|
||||
return;
|
||||
}
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL (m_menuListe), gtk_separator_menu_item_new() );
|
||||
}
|
||||
|
||||
private:
|
||||
GtkWidget * m_parent;
|
||||
GtkWidget * m_menu;
|
||||
GtkWidget * m_menuListe;
|
||||
etk::VectorType<messageData_ts*> m_message;
|
||||
};
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "MenuBar"
|
||||
|
||||
MenuBar::MenuBar(void) : MsgBroadcast("Menu bar", EDN_CAT_GUI)
|
||||
{
|
||||
m_mainWidget = gtk_menu_bar_new();
|
||||
MenuBarMain *tmp = NULL;
|
||||
|
||||
tmp = new MenuBarMain("_File", m_mainWidget);
|
||||
tmp->AddGen(GTK_STOCK_NEW, "ctrl+n", EDN_MSG__NEW, true);
|
||||
tmp->AddGen(GTK_STOCK_OPEN, "ctrl+o", EDN_MSG__GUI_SHOW_OPEN_FILE, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen("Close file", "ctrl+q", EDN_MSG__CURRENT_CLOSE, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen(GTK_STOCK_SAVE, "ctrl+s", EDN_MSG__CURRENT_SAVE, true);
|
||||
tmp->AddGen(GTK_STOCK_SAVE_AS, "ctrl+shift+s", EDN_MSG__CURRENT_SAVE_AS, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen(GTK_STOCK_QUIT, "ctrl+shift+q", EDN_MSG__GUI_SHOW_EXIT_CONFIRMATION, true);
|
||||
m_listMenu.PushBack(tmp);
|
||||
|
||||
tmp = new MenuBarMain("_Edit", m_mainWidget);
|
||||
tmp->AddGen(GTK_STOCK_UNDO, "ctrl+z", EDN_MSG__CURRENT_UNDO, true);
|
||||
tmp->AddGen(GTK_STOCK_REDO, "ctrl+shift+z", EDN_MSG__CURRENT_REDO, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen(GTK_STOCK_CUT, "ctrl+x", EDN_MSG__CURRENT_CUT, true, COPY_STD);
|
||||
tmp->AddGen(GTK_STOCK_COPY, "ctrl+c", EDN_MSG__CURRENT_COPY, true, COPY_STD);
|
||||
tmp->AddGen(GTK_STOCK_PASTE, "ctrl+v", EDN_MSG__CURRENT_PASTE, true, COPY_STD);
|
||||
// tmp->AddGen(GTK_STOCK_DELETE, NULL);
|
||||
tmp->AddGen("Remove line", "ctrl+w", EDN_MSG__CURRENT_REMOVE_LINE, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen(GTK_STOCK_SELECT_ALL, "ctrl+a", EDN_MSG__CURRENT_SELECT_ALL, true);
|
||||
tmp->AddGen("Unselect", "ctrl+shift+a", EDN_MSG__CURRENT_UN_SELECT, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen("Goto Line number ...", "ctrl+l", EDN_MSG__GUI_SHOW_GOTO_LINE, true);
|
||||
// tmp->AddSeparator();
|
||||
// tmp->AddGen(GTK_STOCK_PREFERENCES, NULL, EDN_MSG__GUI_SHOW_PREFERENCE, true);
|
||||
m_listMenu.PushBack(tmp);
|
||||
|
||||
tmp = new MenuBarMain("_Search", m_mainWidget);
|
||||
tmp->AddGen(GTK_STOCK_FIND, "ctrl+f", EDN_MSG__GUI_SHOW_SEARCH, true);
|
||||
tmp->AddGen(GTK_STOCK_FIND_AND_REPLACE, "ctrl+r", EDN_MSG__GUI_SHOW_REPLACE, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen("Find next", "ctrl+h", EDN_MSG__CURRENT_FIND_NEXT, true);
|
||||
tmp->AddGen("Find previous", "ctrl+shift+h", EDN_MSG__CURRENT_FIND_PREVIOUS, true);
|
||||
// tmp->AddGen("Find old next", "ctrl+g", EDN_MSG__CURRENT_FIND_OLD_NEXT, true);
|
||||
// tmp->AddGen("Find old previous", "ctrl+shift+g", EDN_MSG__CURRENT_FIND_OLD_PREVIOUS, true);
|
||||
// tmp->AddSeparator();
|
||||
// tmp->AddGen("Suprimer colorisation", NULL);
|
||||
// tmp->AddSeparator();
|
||||
// tmp->AddGen("Goto Line", "ctrl+l", EDN_MSG__CURRENT_GOTO_LINE, true);
|
||||
m_listMenu.PushBack(tmp);
|
||||
|
||||
tmp = new MenuBarMain("Display", m_mainWidget);
|
||||
tmp->AddInternal("Show space & tabs", NULL, MSG_TogleDisplayChar, true);
|
||||
tmp->AddInternal("Show end of lines", NULL, MSG_TogleDisplayEOL, true);
|
||||
tmp->AddInternal("Audo Indent", NULL, MSG_TogleAutoIndent, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddInternal("Set charset Occidental (ISO-8859-1)", NULL, MSG_SetCharsetIso559_1, true);
|
||||
tmp->AddInternal("Set charset Occidental (ISO-8859-15)", NULL, MSG_SetCharsetIso559_15, true);
|
||||
tmp->AddInternal("Set charset Internationnal (UTF 8)", NULL, MSG_SetCharsetUTF8, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen( "Reload Color File", NULL, EDN_MSG__RELOAD_COLOR_FILE, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddInternal("Set Color Black", NULL, MSG_LoadColorBlack, true);
|
||||
tmp->AddInternal("Set Color White", NULL, MSG_LoadColorWhite, true);
|
||||
m_listMenu.PushBack(tmp);
|
||||
/*
|
||||
tmp = new MenuBarMain("Project", m_mainWidget);
|
||||
m_listMenu.PushBack(tmp);
|
||||
*/
|
||||
tmp = new MenuBarMain("Ctags", m_mainWidget);
|
||||
tmp->AddGen("load Ctags file", NULL, EDN_MSG__OPEN_CTAGS, true);
|
||||
tmp->AddGen("re-load Ctags file", NULL, EDN_MSG__RELOAD_CTAGS, true);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen("Find Definition", "ctrl+d", EDN_MSG__JUMP_TO_CURRENT_SELECTION, true);
|
||||
tmp->AddGen("Back previous", "ctrl+shift+d", EDN_MSG__JUMP_BACK, true);
|
||||
/*
|
||||
tmp->AddGen("Gestion Ctags", NULL);
|
||||
tmp->AddGen("Add Ctags Folder", NULL);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen("Trouver la definition", NULL);
|
||||
tmp->AddGen("Trouver la declaration", NULL);
|
||||
tmp->AddGen("Retour...", NULL);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen("Tout desactiver", NULL);
|
||||
*/
|
||||
m_listMenu.PushBack(tmp);
|
||||
/*
|
||||
tmp = new MenuBarMain("Macros", m_mainWidget);
|
||||
m_listMenu.PushBack(tmp);
|
||||
*/
|
||||
/*
|
||||
tmp = new MenuBarMain("Tools", m_mainWidget);
|
||||
tmp->AddGen("Execute Commande", "ctrl+e");
|
||||
tmp->AddGen("Set Command", NULL);
|
||||
m_listMenu.PushBack(tmp);
|
||||
*/
|
||||
tmp = new MenuBarMain("Internal ClipBoard", m_mainWidget);
|
||||
// tmp->AddGen("Cut 1", "ctrl+alt+1", EDN_MSG__CURRENT_CUT, true, 1);
|
||||
tmp->AddGen("Copy 1", "ctrl+1", EDN_MSG__CURRENT_COPY, true, 1);
|
||||
tmp->AddGen("Paste 1", "alt+1", EDN_MSG__CURRENT_PASTE, true, 1);
|
||||
tmp->AddSeparator();
|
||||
// tmp->AddGen("Cut 2", "ctrl+alt+2", EDN_MSG__CURRENT_CUT, true, 2);
|
||||
tmp->AddGen("Copy 2", "ctrl+2", EDN_MSG__CURRENT_COPY, true, 2);
|
||||
tmp->AddGen("Paste 2", "alt+2", EDN_MSG__CURRENT_PASTE, true, 2);
|
||||
tmp->AddSeparator();
|
||||
// tmp->AddGen("Cut 3", "ctrl+alt+3", EDN_MSG__CURRENT_CUT, true, 3);
|
||||
tmp->AddGen("Copy 3", "ctrl+3", EDN_MSG__CURRENT_COPY, true, 3);
|
||||
tmp->AddGen("Paste 3", "alt+3", EDN_MSG__CURRENT_PASTE, true, 3);
|
||||
tmp->AddSeparator();
|
||||
// tmp->AddGen("Cut 4", "ctrl+alt+4", EDN_MSG__CURRENT_CUT, true, 4);
|
||||
tmp->AddGen("Copy 4", "ctrl+4", EDN_MSG__CURRENT_COPY, true, 4);
|
||||
tmp->AddGen("Paste 4", "alt+4", EDN_MSG__CURRENT_PASTE, true, 4);
|
||||
tmp->AddSeparator();
|
||||
// tmp->AddGen("Cut 5", "ctrl+alt+5", EDN_MSG__CURRENT_CUT, true, 5);
|
||||
tmp->AddGen("Copy 5", "ctrl+5", EDN_MSG__CURRENT_COPY, true, 5);
|
||||
tmp->AddGen("Paste 5", "alt+5", EDN_MSG__CURRENT_PASTE, true, 5);
|
||||
tmp->AddSeparator();
|
||||
// tmp->AddGen("Cut 6", "ctrl+alt+6", EDN_MSG__CURRENT_CUT, true, 6);
|
||||
tmp->AddGen("Copy 6", "ctrl+6", EDN_MSG__CURRENT_COPY, true, 6);
|
||||
tmp->AddGen("Paste 6", "alt+6", EDN_MSG__CURRENT_PASTE, true, 6);
|
||||
tmp->AddSeparator();
|
||||
// tmp->AddGen("Cut 7", "ctrl+alt+7", EDN_MSG__CURRENT_CUT, true, 7);
|
||||
tmp->AddGen("Copy 7", "ctrl+7", EDN_MSG__CURRENT_COPY, true, 7);
|
||||
tmp->AddGen("Paste 7", "alt+7", EDN_MSG__CURRENT_PASTE, true, 7);
|
||||
tmp->AddSeparator();
|
||||
// tmp->AddGen("Cut 8", "ctrl+alt+8", EDN_MSG__CURRENT_CUT, true, 8);
|
||||
tmp->AddGen("Copy 8", "ctrl+8", EDN_MSG__CURRENT_COPY, true, 8);
|
||||
tmp->AddGen("Paste 8", "alt+8", EDN_MSG__CURRENT_PASTE, true, 8);
|
||||
tmp->AddSeparator();
|
||||
// tmp->AddGen("Cut 9", "ctrl+alt+9", EDN_MSG__CURRENT_CUT, true, 9);
|
||||
tmp->AddGen("Copy 9", "ctrl+9", EDN_MSG__CURRENT_COPY, true, 9);
|
||||
tmp->AddGen("Paste 9", "alt+9", EDN_MSG__CURRENT_PASTE, true, 9);
|
||||
m_listMenu.PushBack(tmp);
|
||||
|
||||
tmp = new MenuBarMain("Help", m_mainWidget);
|
||||
tmp->AddGen("help display", NULL, EDN_MSG__OPEN_CTAGS, false);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen("About ...", NULL, EDN_MSG__GUI_SHOW_ABOUT, true);
|
||||
/*
|
||||
tmp->AddGen("Gestion Ctags", NULL);
|
||||
tmp->AddGen("Add Ctags Folder", NULL);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen("Trouver la definition", NULL);
|
||||
tmp->AddGen("Trouver la declaration", NULL);
|
||||
tmp->AddGen("Retour...", NULL);
|
||||
tmp->AddSeparator();
|
||||
tmp->AddGen("Tout desactiver", NULL);
|
||||
*/
|
||||
m_listMenu.PushBack(tmp);
|
||||
|
||||
}
|
||||
|
||||
MenuBar::~MenuBar(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MenuBar::OnMessage(int32_t id, int32_t dataID)
|
||||
{
|
||||
//EDN_INFO("ReceiveMessage");
|
||||
}
|
||||
|
||||
#endif
|
@ -1,55 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file MenuBar.h
|
||||
* @brief Editeur De N'ours : abstraction of the menu bar (Header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 17/06/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <MsgBroadcast.h>
|
||||
#include <etk/VectorType.h>
|
||||
#include <AccelKey.h>
|
||||
|
||||
#ifndef __MENU_BAR_H__
|
||||
#define __MENU_BAR_H__
|
||||
|
||||
//class MenuBarMain;
|
||||
|
||||
class MenuBar
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
MenuBar(void) {};
|
||||
~MenuBar(void) {};
|
||||
//GtkWidget * GetWidget(void) { return m_mainWidget; };
|
||||
void OnMessage(int32_t id, int32_t dataID) {};
|
||||
|
||||
private:
|
||||
/*
|
||||
GtkWidget * m_mainWidget;
|
||||
GtkAccelGroup * m_accelGroup;
|
||||
etk::VectorType<MenuBarMain*> m_listMenu;
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@ -1,54 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file StatusBar.cpp
|
||||
* @brief Editeur De N'ours : abstraction of the status bar (Sources)
|
||||
* @author Edouard DUPIN
|
||||
* @date 17/06/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <StatusBar.h>
|
||||
|
||||
|
||||
|
||||
StatusBar::StatusBar(void)
|
||||
{
|
||||
/*
|
||||
m_mainWidget = gtk_statusbar_new();
|
||||
// pas très bien compris pourquoi mais ca marche...
|
||||
m_iContextId = gtk_statusbar_get_context_id(GTK_STATUSBAR(m_mainWidget), "ExitMsg");
|
||||
// ajout d'un message :
|
||||
gtk_statusbar_push(GTK_STATUSBAR (m_mainWidget), GPOINTER_TO_INT(m_iContextId), "Edn Editeur de n'ours");
|
||||
// Supression du précédent message :
|
||||
//gtk_statusbar_pop(GTK_STATUSBAR(m_mainWidget), GPOINTER_TO_INT(m_iContextId));
|
||||
*/
|
||||
}
|
||||
|
||||
StatusBar::~StatusBar(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void StatusBar::OnMessage(int32_t id, int32_t dataID)
|
||||
{
|
||||
//EDN_INFO("ReceiveMessage");
|
||||
}
|
||||
|
||||
|
@ -1,46 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file StatusBar.h
|
||||
* @brief Editeur De N'ours : abstraction of the status bar (Header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 17/06/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <MsgBroadcast.h>
|
||||
|
||||
#ifndef __STATUS_BAR_H__
|
||||
#define __STATUS_BAR_H__
|
||||
|
||||
class StatusBar
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
StatusBar(void);
|
||||
~StatusBar(void);
|
||||
//GtkWidget * GetWidget(void) { return m_mainWidget; };
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
|
||||
private:
|
||||
//GtkWidget * m_mainWidget;
|
||||
//guint m_iContextId;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@ -1,95 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file ToolBar.cpp
|
||||
* @brief Editeur De N'ours : abstraction of the tool bar (Sources)
|
||||
* @author Edouard DUPIN
|
||||
* @date 17/06/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <ToolBar.h>
|
||||
#include <ClipBoard.h>
|
||||
|
||||
/*
|
||||
static void CB_menuGenerique(GtkMenuItem *menu_item, gpointer data)
|
||||
{
|
||||
//EDN_INFO("basic menue_event");
|
||||
messageData_ts * msg = (messageData_ts*)data;
|
||||
// broacast message :
|
||||
GeneralSendMessage(msg->msgId, msg->dataId);
|
||||
}
|
||||
*/
|
||||
|
||||
ToolBar::ToolBar(void)
|
||||
{
|
||||
/*
|
||||
m_mainWidget = gtk_toolbar_new();
|
||||
# ifdef USE_GTK_VERSION_2_0
|
||||
gtk_toolbar_set_orientation(GTK_TOOLBAR(m_mainWidget), GTK_ORIENTATION_VERTICAL);
|
||||
# endif
|
||||
// Modification de la taille des icones
|
||||
gtk_toolbar_set_icon_size(GTK_TOOLBAR(m_mainWidget), GTK_ICON_SIZE_BUTTON);
|
||||
// Affichage uniquement des icones
|
||||
gtk_toolbar_set_style(GTK_TOOLBAR(m_mainWidget), GTK_TOOLBAR_ICONS);
|
||||
|
||||
Add(GTK_STOCK_NEW, "Nouveau", EDN_MSG__NEW);
|
||||
Add(GTK_STOCK_OPEN, "Ouvrir", EDN_MSG__GUI_SHOW_OPEN_FILE);
|
||||
AddSeparator();
|
||||
Add(GTK_STOCK_SAVE, "Enregistrer", EDN_MSG__CURRENT_SAVE);
|
||||
Add(GTK_STOCK_SAVE_AS, "Enregistrer sous", EDN_MSG__CURRENT_SAVE_AS);
|
||||
AddSeparator();
|
||||
Add(GTK_STOCK_QUIT, "Quitter");
|
||||
*/
|
||||
}
|
||||
|
||||
ToolBar::~ToolBar(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ToolBar::OnMessage(int32_t id, int32_t dataID)
|
||||
{
|
||||
//EDN_INFO("ReceiveMessage");
|
||||
}
|
||||
/*
|
||||
void ToolBar::AddSeparator(void)
|
||||
{
|
||||
# ifdef USE_GTK_VERSION_3_0
|
||||
# elif defined( USE_GTK_VERSION_2_0)
|
||||
gtk_toolbar_append_space(GTK_TOOLBAR(m_mainWidget));
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
void ToolBar::Add(const char * title, const char * labelHelp, messageType_te id, bool enable)
|
||||
{
|
||||
messageData_ts * message = new messageData_ts;
|
||||
message->msgId = id;
|
||||
message->dataId = -1;
|
||||
m_message.PushBack(message);
|
||||
# ifdef USE_GTK_VERSION_3_0
|
||||
# elif defined( USE_GTK_VERSION_2_0)
|
||||
gtk_toolbar_insert_stock(GTK_TOOLBAR(m_mainWidget), title, labelHelp, NULL, G_CALLBACK(CB_menuGenerique), message, -1);
|
||||
# endif
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
@ -1,49 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file ToolBar.h
|
||||
* @brief Editeur De N'ours : abstraction of the tool bar (Header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 17/06/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <MsgBroadcast.h>
|
||||
|
||||
#ifndef __TOOL_BAR_H__
|
||||
#define __TOOL_BAR_H__
|
||||
|
||||
|
||||
class ToolBar
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
ToolBar(void);
|
||||
~ToolBar(void);
|
||||
//GtkWidget * GetWidget(void) { return m_mainWidget; };
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
|
||||
private:
|
||||
//void AddSeparator(void);
|
||||
//void Add(const char * title, const char * labelHelp, messageType_te id = EDN_MSG__NONE, bool enable = false);
|
||||
//GtkWidget * m_mainWidget;
|
||||
//etk::VectorType<messageData_ts*> m_message;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@ -1,320 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file WindowsManager.cpp
|
||||
* @brief Editeur De N'ours : Windows creation, pop up, destruction ... (Sources)
|
||||
* @author Edouard DUPIN
|
||||
* @date 20/06/2011
|
||||
* @par Project
|
||||
* Edn
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
* You can not earn money with this Software (if the source extract from Edn
|
||||
* represent less than 50% of original Sources)
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <WindowsManager.h>
|
||||
#include <MainWindows.h>
|
||||
#include <Search.h>
|
||||
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "WindowsManager"
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
WindowsManager::WindowsManager(void)
|
||||
{
|
||||
m_currentBufferID = -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param[in,out] ---
|
||||
*
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
WindowsManager::~WindowsManager(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void WindowsManager::OnMessage(int32_t id, int32_t dataID)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
/*
|
||||
case EDN_MSG__BUFFER_CHANGE_CURRENT:
|
||||
m_currentBufferID = dataID;
|
||||
break;
|
||||
case EDN_MSG__GUI_SHOW_MAIN_WINDOWS:
|
||||
EDN_INFO("Request opening MAIN_WINDOWS");
|
||||
m_mainWindow = MainWindows::getInstance();
|
||||
break;
|
||||
case EDN_MSG__GUI_SHOW_SEARCH:
|
||||
EDN_INFO("Request opening SEARCH");
|
||||
{
|
||||
Search *myInstance = Search::getInstance();
|
||||
myInstance->Display(GTK_WINDOW(m_mainWindow->GetWidget()));
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__GUI_SHOW_PREFERENCE:
|
||||
EDN_INFO("Request opening PREFERENCE");
|
||||
break;
|
||||
case EDN_MSG__GUI_SHOW_REPLACE:
|
||||
EDN_INFO("Request opening REPLACE");
|
||||
break;
|
||||
case EDN_MSG__GUI_SHOW_OPEN_FILE:
|
||||
EDN_INFO("Request opening OPEN_FILE");
|
||||
{
|
||||
BufferManager *myBufferManager = NULL;
|
||||
myBufferManager = BufferManager::getInstance();
|
||||
|
||||
GtkWidget *dialog = gtk_file_chooser_dialog_new( "Open File", NULL,
|
||||
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
|
||||
NULL); // end button/response list
|
||||
// this element did not apear in the miniature of the windows
|
||||
gtk_window_set_skip_pager_hint(GTK_WINDOW(dialog), TRUE);
|
||||
if( -1 != m_currentBufferID
|
||||
&& true == myBufferManager->Exist(m_currentBufferID) )
|
||||
{
|
||||
etk::File fileName = myBufferManager->Get(m_currentBufferID)->GetFileName();
|
||||
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), fileName.GetFolder().c_str());
|
||||
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), fileName.GetShortFilename().c_str());
|
||||
}
|
||||
if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
|
||||
{
|
||||
etk::File myfilename;
|
||||
myfilename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (dialog));
|
||||
|
||||
if (false == myBufferManager->Exist(myfilename) ) {
|
||||
int32_t openID = myBufferManager->Open(myfilename);
|
||||
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, openID);
|
||||
} else {
|
||||
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, myBufferManager->GetId(myfilename));
|
||||
}
|
||||
}
|
||||
gtk_widget_destroy(dialog);
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__GUI_SHOW_SAVE_AS:
|
||||
EDN_INFO("Request opening SAVE_AS");
|
||||
// save only if one element is selected
|
||||
if (BufferManager::getInstance()->Size() > 0) {
|
||||
int32_t idSelected;
|
||||
if(-1 == dataID) {
|
||||
idSelected = BufferManager::getInstance()->GetSelected();
|
||||
} else {
|
||||
idSelected = dataID;
|
||||
}
|
||||
Buffer *myBuffer = BufferManager::getInstance()->Get(idSelected);
|
||||
etk::UString tmpString = "Save as file : ";
|
||||
tmpString += myBuffer->GetFileName().GetShortFilename().c_str();
|
||||
GtkWidget *dialog = gtk_file_chooser_dialog_new( tmpString.c_str(), NULL,
|
||||
GTK_FILE_CHOOSER_ACTION_SAVE,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
|
||||
NULL); // end button/response list
|
||||
// this element did not apear in the miniature of the windows
|
||||
gtk_window_set_skip_pager_hint(GTK_WINDOW(dialog), TRUE);
|
||||
if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
|
||||
{
|
||||
etk::UString myfilename;
|
||||
myfilename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (dialog));
|
||||
|
||||
myBuffer->SetFileName(myfilename);
|
||||
myBuffer->Save();
|
||||
|
||||
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, idSelected);
|
||||
}
|
||||
gtk_widget_destroy(dialog); // implicitly hides dialog
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__GUI_SHOW_ABOUT:
|
||||
{
|
||||
GtkWidget *myDialog = gtk_about_dialog_new();
|
||||
gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(myDialog), "Edn");
|
||||
gtk_about_dialog_set_version( GTK_ABOUT_DIALOG(myDialog), VERSION_TAG_NAME);
|
||||
gtk_about_dialog_set_comments( GTK_ABOUT_DIALOG(myDialog), "Editeur De N'ours\n"
|
||||
"L'Editeur Desoxyribo-Nucleique.\n"
|
||||
"Source Code Editor\n"
|
||||
"Build Time : " VERSION_BUILD_TIME);
|
||||
gtk_about_dialog_set_copyright( GTK_ABOUT_DIALOG(myDialog), "Copyright 2010 Edouard DUPIN, all right reserved");
|
||||
gtk_about_dialog_set_license( GTK_ABOUT_DIALOG(myDialog), "This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY\n\n"
|
||||
"You can:\n"
|
||||
" * Redistribute the sources code and binaries.\n"
|
||||
" * Modify the Sources code.\n"
|
||||
" * Use a part of the sources (less than 50%) in an other software, just write somewhere \"Edn is great\" visible by the user (on your product or on your website with a link to my page).\n"
|
||||
" * Redistribute the modification only if you want.\n"
|
||||
" * Send me the bug-fix (it could be great).\n"
|
||||
" * Pay me a beer or some other things.\n"
|
||||
" * Print the source code on WC paper ...\n\n"
|
||||
"You can NOT:\n"
|
||||
" * Earn money with this Software (But I can).\n"
|
||||
" * Add malware in the Sources.\n"
|
||||
" * Do something bad with the sources.\n"
|
||||
" * Use it to travel in the space with a toaster.\n\n"
|
||||
"I reserve the right to change this licence. If it change the version of the copy you have keep its own license.");
|
||||
gtk_about_dialog_set_wrap_license(GTK_ABOUT_DIALOG(myDialog), true);
|
||||
# if USE_GTK_VERSION_3_0
|
||||
gtk_about_dialog_set_license_type(GTK_ABOUT_DIALOG(myDialog), GTK_LICENSE_CUSTOM);
|
||||
# endif
|
||||
gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(myDialog), "http://HeeroYui.github.com/edn");
|
||||
gtk_about_dialog_set_website_label(GTK_ABOUT_DIALOG(myDialog), "Edn on github");
|
||||
const char * listAutor[] = {"Edouard DUPIN", NULL};
|
||||
gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(myDialog), listAutor);
|
||||
// Display About
|
||||
gtk_dialog_run(GTK_DIALOG(myDialog));
|
||||
gtk_widget_destroy(myDialog);
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__GUI_SHOW_GOTO_LINE:
|
||||
{
|
||||
// dlg to confirm the quit event :
|
||||
GtkWidget *myDialog = gtk_dialog_new_with_buttons("Goto Line",
|
||||
GTK_WINDOW(m_mainWindow->GetWidget()),
|
||||
GTK_DIALOG_MODAL,
|
||||
"Jump", GTK_RESPONSE_YES,
|
||||
GTK_STOCK_QUIT, GTK_RESPONSE_NO,
|
||||
NULL);
|
||||
// this element did not apear in the miniature of the windows
|
||||
gtk_window_set_skip_pager_hint(GTK_WINDOW(myDialog), TRUE);
|
||||
// Set over main windows
|
||||
gtk_window_set_transient_for(GTK_WINDOW(myDialog), GTK_WINDOW(m_mainWindow->GetWidget()));
|
||||
// add writting area
|
||||
GtkWidget *myContentArea = gtk_dialog_get_content_area( GTK_DIALOG(myDialog));
|
||||
GtkWidget *myEntry = gtk_entry_new();
|
||||
gtk_box_pack_start(GTK_BOX(myContentArea), myEntry, TRUE, TRUE, 0);
|
||||
// Display it
|
||||
gtk_widget_show_all(myContentArea);
|
||||
int32_t result = gtk_dialog_run (GTK_DIALOG (myDialog));
|
||||
// Get data from the gtk entry
|
||||
const char *myData = gtk_entry_get_text(GTK_ENTRY(myEntry));
|
||||
if (NULL != myData) {
|
||||
int32_t lineID=0;
|
||||
if (1==sscanf(myData, "%d",&lineID)) {
|
||||
EDN_DEBUG("find in : \"" << myData << "\" = " << lineID);
|
||||
if(GTK_RESPONSE_YES == result) {
|
||||
SendMessage(EDN_MSG__CURRENT_GOTO_LINE, lineID-1);
|
||||
}
|
||||
} else {
|
||||
if (GTK_RESPONSE_YES == result) {
|
||||
EDN_WARNING("find in : \"" << myData << "\" line Number is not correct ");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
EDN_DEBUG("no line Writen ...");
|
||||
}
|
||||
// Remove dialogue
|
||||
gtk_widget_destroy(myDialog);
|
||||
}
|
||||
break;
|
||||
case EDN_MSG__GUI_SHOW_EXIT_CONFIRMATION:
|
||||
{
|
||||
EDN_INFO("quit requested");
|
||||
// dlg to confirm the quit event :
|
||||
GtkWidget *p_dialog = gtk_dialog_new_with_buttons("Exit",
|
||||
GTK_WINDOW(m_mainWindow->GetWidget()),
|
||||
GTK_DIALOG_MODAL,
|
||||
GTK_STOCK_YES, GTK_RESPONSE_YES,
|
||||
GTK_STOCK_NO, GTK_RESPONSE_NO,
|
||||
NULL);
|
||||
GtkWidget *p_label = gtk_label_new ("Do you want exit Edn ?");
|
||||
gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area( GTK_DIALOG(p_dialog) )), p_label, TRUE, TRUE, 0);
|
||||
gtk_widget_show(p_label);
|
||||
|
||||
switch (gtk_dialog_run (GTK_DIALOG (p_dialog)))
|
||||
{
|
||||
case GTK_RESPONSE_YES:
|
||||
gtk_widget_destroy (p_dialog);
|
||||
p_dialog = NULL;
|
||||
{
|
||||
BufferManager * myBufferMng = BufferManager::getInstance();
|
||||
for (int32_t iii=0 ; iii<myBufferMng->Size() ; iii++) {
|
||||
if (true==myBufferMng->Exist(iii) ) {
|
||||
Buffer * myBuffer = myBufferMng->Get(iii);
|
||||
if (NULL != myBuffer) {
|
||||
if (true == myBuffer->IsModify()) {
|
||||
if (true == myBuffer->HaveName()) {
|
||||
p_dialog = gtk_dialog_new_with_buttons("Save Before Exit",
|
||||
GTK_WINDOW(m_mainWindow->GetWidget()),
|
||||
GTK_DIALOG_MODAL,
|
||||
GTK_STOCK_SAVE, GTK_RESPONSE_YES,
|
||||
GTK_STOCK_SAVE_AS, GTK_RESPONSE_ACCEPT,
|
||||
GTK_STOCK_NO, GTK_RESPONSE_NO,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
NULL);
|
||||
} else {
|
||||
p_dialog = gtk_dialog_new_with_buttons("Save Before Exit",
|
||||
GTK_WINDOW(m_mainWindow->GetWidget()),
|
||||
GTK_DIALOG_MODAL,
|
||||
GTK_STOCK_SAVE_AS, GTK_RESPONSE_ACCEPT,
|
||||
GTK_STOCK_NO, GTK_RESPONSE_NO,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
NULL);
|
||||
}
|
||||
char tmpName[1024];
|
||||
sprintf(tmpName, "Save file \"%s\" ?", myBuffer->GetFileName().GetCompleateName().c_str());
|
||||
p_label = gtk_label_new(tmpName);
|
||||
gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area( GTK_DIALOG(p_dialog) )), p_label, TRUE, TRUE, 0);
|
||||
gtk_widget_show(p_label);
|
||||
|
||||
switch (gtk_dialog_run (GTK_DIALOG (p_dialog)))
|
||||
{
|
||||
case GTK_RESPONSE_YES:
|
||||
myBuffer->Save();
|
||||
break;
|
||||
case GTK_RESPONSE_ACCEPT:
|
||||
OnMessage(EDN_MSG__GUI_SHOW_SAVE_AS, iii);
|
||||
break;
|
||||
case GTK_RESPONSE_NO:
|
||||
// nothing to do ...
|
||||
break;
|
||||
case GTK_RESPONSE_CANCEL:
|
||||
gtk_widget_destroy (p_dialog);
|
||||
return;
|
||||
break;
|
||||
}
|
||||
gtk_widget_destroy (p_dialog);
|
||||
p_dialog = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
gtk_main_quit();
|
||||
break;
|
||||
case GTK_RESPONSE_NO:
|
||||
gtk_widget_destroy (p_dialog);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
*/
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
@ -26,13 +26,13 @@
|
||||
#include <tools_debug.h>
|
||||
#include <tools_globals.h>
|
||||
#include <ewol/ewol.h>
|
||||
#include <Gui/MainWindows.h>
|
||||
#include <Display.h>
|
||||
#include <BufferManager.h>
|
||||
#include <ColorizeManager.h>
|
||||
#include <HighlightManager.h>
|
||||
#include <ClipBoard.h>
|
||||
#include <WindowsManager.h>
|
||||
#include <Search.h>
|
||||
#include <Gui/Search.h>
|
||||
#include <unistd.h>
|
||||
#include <readtags.h>
|
||||
#include <CTagsManager.h>
|
||||
@ -85,7 +85,6 @@ void APP_Init(void)
|
||||
|
||||
|
||||
// init ALL Singleton :
|
||||
(void)WindowsManager::getInstance();
|
||||
(void)CTagsManager::getInstance();
|
||||
(void)BufferManager::getInstance();
|
||||
|
||||
|
52
jni/file.mk
52
jni/file.mk
@ -5,50 +5,46 @@
|
||||
###############################################################################
|
||||
|
||||
# ExuberantCtags reading file tools (extern OPEN Sources) :
|
||||
FILE_LIST+= edn/ctags/readtags.cpp \
|
||||
FILE_LIST+= edn/ctags/readtags.cpp \
|
||||
edn/ctags/CTagsManager.cpp
|
||||
|
||||
|
||||
# Globals debug tool:
|
||||
FILE_LIST+= edn/tools/debug/tools_debug.cpp \
|
||||
edn/tools/globals/tools_globals.cpp \
|
||||
FILE_LIST+= edn/tools/debug/tools_debug.cpp \
|
||||
edn/tools/globals/tools_globals.cpp \
|
||||
edn/tools/memory/toolsMemory.cpp
|
||||
|
||||
# Buffers internal:
|
||||
FILE_LIST+= edn/tools/EdnTemplate/EdnVectorBuf.cpp \
|
||||
edn/tools/EdnBuf/EdnBuf.cpp \
|
||||
edn/tools/EdnBuf/EdnBuf_HighLight.cpp \
|
||||
edn/tools/EdnBuf/EdnBuf_History.cpp \
|
||||
edn/tools/EdnBuf/EdnBuf_Selection.cpp \
|
||||
FILE_LIST+= edn/tools/EdnTemplate/EdnVectorBuf.cpp \
|
||||
edn/tools/EdnBuf/EdnBuf.cpp \
|
||||
edn/tools/EdnBuf/EdnBuf_HighLight.cpp \
|
||||
edn/tools/EdnBuf/EdnBuf_History.cpp \
|
||||
edn/tools/EdnBuf/EdnBuf_Selection.cpp \
|
||||
edn/tools/EdnBuf/EdnBufHistory.cpp
|
||||
|
||||
|
||||
# Tools internal:
|
||||
FILE_LIST+= edn/tools/Display/Display.cpp \
|
||||
edn/tools/ClipBoard/ClipBoard.cpp \
|
||||
edn/tools/MsgBroadcast/MsgBroadcast.cpp \
|
||||
FILE_LIST+= edn/tools/Display/Display.cpp \
|
||||
edn/tools/ClipBoard/ClipBoard.cpp \
|
||||
edn/tools/MsgBroadcast/MsgBroadcast.cpp \
|
||||
edn/tools/MsgBroadcast/AccelKey.cpp
|
||||
|
||||
# Gui:
|
||||
FILE_LIST+= edn/CustumWidget/BufferView/BufferView.cpp \
|
||||
edn/CustumWidget/CodeView/CodeView.cpp \
|
||||
edn/GuiTools/WindowsManager/WindowsManager.cpp \
|
||||
edn/GuiTools/MainWindows/MainWindows.cpp \
|
||||
edn/GuiTools/MainWindows/StatusBar.cpp \
|
||||
edn/GuiTools/MainWindows/MenuBar.cpp \
|
||||
edn/GuiTools/MainWindows/ToolBar.cpp \
|
||||
edn/GuiTools/Search/Search.cpp \
|
||||
edn/GuiTools/Search/SearchData.cpp
|
||||
FILE_LIST+= edn/Gui/BufferView.cpp \
|
||||
edn/Gui/CodeView.cpp \
|
||||
edn/Gui/MainWindows.cpp \
|
||||
edn/Gui/Search.cpp \
|
||||
edn/Gui/SearchData.cpp
|
||||
|
||||
# Basic Interface :
|
||||
FILE_LIST+= edn/Buffer/Buffer.cpp \
|
||||
edn/Buffer/BufferText.cpp \
|
||||
edn/Buffer/BufferEmpty.cpp \
|
||||
edn/Buffer/BufferManager.cpp \
|
||||
edn/Colorize/Colorize.cpp \
|
||||
edn/Colorize/ColorizeManager.cpp \
|
||||
edn/Highlight/HighlightPattern.cpp \
|
||||
edn/Highlight/Highlight.cpp \
|
||||
FILE_LIST+= edn/Buffer/Buffer.cpp \
|
||||
edn/Buffer/BufferText.cpp \
|
||||
edn/Buffer/BufferEmpty.cpp \
|
||||
edn/Buffer/BufferManager.cpp \
|
||||
edn/Colorize/Colorize.cpp \
|
||||
edn/Colorize/ColorizeManager.cpp \
|
||||
edn/Highlight/HighlightPattern.cpp \
|
||||
edn/Highlight/Highlight.cpp \
|
||||
edn/Highlight/HighlightManager.cpp
|
||||
|
||||
# Main entry file :
|
||||
|
Loading…
x
Reference in New Issue
Block a user