diff --git a/.gitignore b/.gitignore index 36c3170..c37aa89 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ !*.cc !*.h !CMakeLists.txt +!config.json \ No newline at end of file diff --git a/juci/CMakeLists.txt b/juci/CMakeLists.txt index a47fe1c..57c6030 100644 --- a/juci/CMakeLists.txt +++ b/juci/CMakeLists.txt @@ -4,18 +4,19 @@ set(module juci_to_python_api) project (${project_name}) -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake/Modules/") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake/Modules/") INCLUDE(FindPkgConfig) -#libclang_LIBRARIES -#libclang_INCLUDE_DIR -find_package(Libclang) +message("Searcing for libclang") +#LIBCLANG_FOUND System has libclang. +#LIBCLANG_INCLUDE_DIRS The libclang include directories. +#LIBCLANG_LIBRARIES The libraries needed to use libclang. +#LIBCLANG_LIBRARY_DIR The path to the directory containing libclang. +#LIBCLANG_KNOWN_LLVM_VERSIONS Known LLVM release numbers. +find_package(Testlcl) -message("Libclang libraries ${Libclang_LIBRARIES}") -message("Libclang libraries ${Libclang_LIBRARY}") -message("Libclang include dirs ${Libclang_INCLUDE_DIR}") #### Finding boost, the variables below is set ##### #PYTHONLIBS_FOUND - True if headers and requested libraries were found @@ -68,36 +69,53 @@ else() message("Gtkmm link dirs ${GTKMM_LIBRARIES}") message(FATAL_ERROR "The gtkmm libraries are required. Quitting.") endif() - - - - # name of the executable on Windows will be example.exe add_executable(${project_name} #list of every needed file to create the executable - juci.h - juci.cc + juci.cc keybindings menu source + sourcefile.h + sourcefile.cc window api + notebook + entry + #there is no need for extentions ) - add_library(${module} SHARED - - api.h - api_ext.cc + api + api_ext ) # dependencies -include_directories(${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS} "/home/zalox/bachelor/libclang++/") -link_directories(${GTKMM_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS} ${PYTHON_INCLUDE_DIRS} "/home/zalox/bachelor/libclang++/") + + +if(${lcl_NOTFOUND}) + message("FATAL_ERROR ohh lord!") +else() + message("Found libs!") +endif() + +include_directories( + ${Boost_INCLUDE_DIRS} + ${PYTHON_INCLUDE_DIRS} + ${GTKMM_INCLUDE_DIRS} + "/home/zalox/bachelor/libclang++/headers/" + ) +link_directories( + ${GTKMM_LIBRARY_DIRS} + ${Boost_LIBRARY_DIRS} + ${PYTHON_INCLUDE_DIRS} + ${LCL_LIBRARY_DIRS} + ) #module: set_target_properties(${module} PROPERTIES PREFIX "") target_link_libraries(${module} ${PYTHON_LIBRARIES} ${Boost_LIBRARIES}) #executable: -target_link_libraries(${project_name} ${GTKMM_LIBRARIES} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} "/home/zalox/bachelor/libclang++/") +target_link_libraries(${project_name} ${LCL_LIBRARIES} ${GTKMM_LIBRARIES} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES}) + diff --git a/juci/api.cc b/juci/api.cc new file mode 100644 index 0000000..42149d0 --- /dev/null +++ b/juci/api.cc @@ -0,0 +1,47 @@ +#include "api.h" +namespace juci_api{ + + void cpp::ReplaceWord(const std::string word) { + //TODO implement api::ReplaceWord / change string to iter? + //some_namespace::controller::replaceWord(word_*); + std::cout << "unimplemented function: 'api::ReplaceWord()' called" + << std::endl; + + std::cout << "The string: " << g_test_string << std::endl; + } + + void cpp::ReplaceLine(const std::string line) { + //TODO implement api::ReplaceLine / change string to iter? + //some_namespace::controller::replaceLine(line_); + std::cout << "unimplemented function: 'api::ReplaceLine()' called" + << std::endl; + } + + //helpers + boost::python::api::object py::openPythonScript(const std::string path, + boost::python::api::object python_name_space) { + std::string temp = g_project_root + path + ".py"; + boost::python::str the_path(temp); + return boost::python::exec_file(the_path, python_name_space);//, python_name_space); + } + + void py::LoadPlugin(const std::string& plugin_name) { + try{ + /* initialize python interpreter */ + Py_Initialize(); + boost::python::api::object main_module = boost::python::import("__main__"); + boost::python::api::object main_namespace = main_module.attr("__dict__"); + + /* runs script from python */ + //boost::python::object ignored1 = setPythonVar("word", word, main_namespace); + boost::python::api::object ignored2 = openPythonScript(plugin_name, main_namespace); + /* extracts desired values */ + //boost::python::object pySnippet = boost::python::eval("getSnippet()", main_namespace); + //word = boost::python::extract(pySnippet); + /* add snippet to textView */ + //TODO add snippet + }catch(boost::python::error_already_set const&) { + PyErr_Print(); + } + } +} diff --git a/juci/api.h b/juci/api.h index ef84968..9bd42c4 100644 --- a/juci/api.h +++ b/juci/api.h @@ -1,77 +1,47 @@ +#ifndef JUCI_API_H_ +#define JUCI_API_H_ + #include #include #include -// + // Plugin API // -namespace juci_api{ +const std::string g_project_root("/home/forgie/bachelor/app/juci/"); +static std::string g_test_string("test"); +namespace juci_api { // // calls from python to C++ // - namespace cpp{ + namespace cpp { - // + // Replaceword: // replaces a word in the editor with a string - // - void ReplaceWord(const std::string word_){ - //TODO implement api::ReplaceWord / change string to iter? - //some_namespace::controller::replaceWord(word_*); - std::cout << "unimplemented function: 'api::ReplaceWord()' called" - << std::endl; - } + + void ReplaceWord(const std::string word_); // // ReplaceLine: // Replaces a line in the editor with a string // - void ReplaceLine(const std::string line_){ - //TODO implement api::ReplaceLine / change string to iter? - //some_namespace::controller::replaceLine(line_); - std::cout << "unimplemented function: 'api::ReplaceLine()' called" - << std::endl; - } + void ReplaceLine(const std::string line_); }//namespace cpp // // calls from C++ to Python // - namespace py{ - const std::string g_project_root("~/bachelor/app/juci/"); + namespace py { + + //helpers boost::python::api::object openPythonScript(const std::string path, - boost::python::api::object python_name_space) { - std::string temp = g_project_root + path + ".py"; - boost::python::str the_path(temp); - return boost::python::exec_file(the_path, python_name_space);//, python_name_space); - } + boost::python::api::object python_name_space); //void snippet(std::string& word); - void plugin(const std::string& plugin_name){ - try{ - /* initialize python interpreter */ - Py_Initialize(); - boost::python::api::object main_module = boost::python::import("__main__"); - boost::python::api::object main_namespace = main_module.attr("__dict__"); - - /* runs script from python */ - //boost::python::object ignored1 = setPythonVar("word", word, main_namespace); - boost::python::api::object ignored2 = openPythonScript(plugin_name, main_namespace); - /* extracts desired values */ - //boost::python::object pySnippet = boost::python::eval("getSnippet()", main_namespace); - //word = boost::python::extract(pySnippet); - /* add snippet to textView */ - //TODO add snippet - }catch(boost::python::error_already_set const&){ - PyErr_Print(); - } - } - - }// py - + void LoadPlugin(const std::string& plugin_name); + }// py }//juci_api - - - +#endif // JUCI_API_H diff --git a/juci/api_ext.cc b/juci/api_ext.cc index 922b86b..8ea43b2 100644 --- a/juci/api_ext.cc +++ b/juci/api_ext.cc @@ -1,6 +1,5 @@ #include "api.h" - -BOOST_PYTHON_MODULE(jucy_to_python_api) { +BOOST_PYTHON_MODULE(juci_to_python_api) { using namespace boost::python; // text editing def("replaceLine", &juci_api::cpp::ReplaceLine); diff --git a/juci/config.json b/juci/config.json new file mode 100644 index 0000000..c9814a5 --- /dev/null +++ b/juci/config.json @@ -0,0 +1,193 @@ +{ + "colors": { + "text_color": "black", + "string" : "green" + }, + "syntax": { + "1": "text_color", + "2": "text_color", + "2": "text_color", + "3": "text_color", + "4": "text_color", + "5": "text_color", + "6": "text_color", + "7": "text_color", + "8": "text_color", + "9": "text_color", + "10": "text_color", + "11": "text_color", + "12": "text_color", + "13": "text_color", + "14": "text_color", + "15": "text_color", + "16": "text_color", + "17": "text_color", + "18": "text_color", + "19": "text_color", + "20": "text_color", + "21": "text_color", + "22": "text_color", + "23": "text_color", + "24": "text_color", + "25": "text_color", + "26": "text_color", + "27": "text_color", + "28": "text_color", + "29": "text_color", + "30": "text_color", + "31": "text_color", + "32": "text_color", + "33": "text_color", + "34": "text_color", + "35": "text_color", + "36": "text_color", + "37": "text_color", + "38": "text_color", + "39": "text_color", + "40": "text_color", + "41": "text_color", + "42": "text_color", + "43": "text_color", + "44": "text_color", + "45": "text_color", + "46": "text_color", + "47": "text_color", + "48": "text_color", + "49": "text_color", + "50": "text_color", + "51": "text_color", + "70": "text_color", + "70": "text_color", + "71": "text_color", + "72": "text_color", + "73": "text_color", + "100": "text_color", + "100": "text_color", + "101": "text_color", + "102": "text_color", + "103": "text_color", + "104": "text_color", + "105": "text_color", + "106": "text_color", + "107": "text_color", + "108": "text_color", + "109": "string", + "110": "text_color", + "111": "text_color", + "112": "text_color", + "113": "text_color", + "114": "text_color", + "115": "text_color", + "116": "text_color", + "117": "text_color", + "118": "text_color", + "119": "text_color", + "120": "text_color", + "121": "text_color", + "122": "text_color", + "123": "text_color", + "124": "text_color", + "125": "text_color", + "126": "text_color", + "127": "text_color", + "128": "text_color", + "129": "text_color", + "130": "text_color", + "131": "text_color", + "132": "text_color", + "133": "text_color", + "134": "text_color", + "135": "text_color", + "136": "text_color", + "137": "text_color", + "138": "text_color", + "139": "text_color", + "140": "text_color", + "141": "text_color", + "142": "text_color", + "143": "text_color", + "144": "text_color", + "145": "text_color", + "146": "text_color", + "200": "text_color", + "200": "text_color", + "201": "text_color", + "202": "text_color", + "203": "text_color", + "204": "text_color", + "205": "text_color", + "206": "text_color", + "207": "text_color", + "208": "text_color", + "209": "text_color", + "210": "text_color", + "211": "text_color", + "212": "text_color", + "213": "text_color", + "214": "text_color", + "215": "text_color", + "216": "text_color", + "217": "text_color", + "218": "text_color", + "219": "text_color", + "220": "text_color", + "221": "text_color", + "222": "text_color", + "223": "text_color", + "224": "text_color", + "225": "text_color", + "226": "text_color", + "227": "text_color", + "228": "text_color", + "229": "text_color", + "230": "text_color", + "231": "text_color", + "232": "text_color", + "233": "text_color", + "234": "text_color", + "235": "text_color", + "236": "text_color", + "237": "text_color", + "238": "text_color", + "239": "text_color", + "240": "text_color", + "241": "text_color", + "242": "text_color", + "243": "text_color", + "244": "text_color", + "245": "text_color", + "246": "text_color", + "247": "text_color", + "248": "text_color", + "249": "text_color", + "250": "text_color", + "251": "text_color", + "252": "text_color", + "253": "text_color", + "300": "text_color", + "400": "text_color", + "400": "text_color", + "401": "text_color", + "402": "text_color", + "403": "text_color", + "404": "text_color", + "405": "text_color", + "406": "text_color", + "407": "text_color", + "408": "text_color", + "409": "text_color", + "410": "text_color", + "411": "text_color", + "412": "text_color", + "413": "text_color", + "414": "text_color", + "415": "text_color", + "416": "text_color", + "500": "text_color", + "501": "text_color", + "502": "text_color", + "503": "text_color", + "600": "text_color", + "700": "text_color" + } +} diff --git a/juci/entry.cc b/juci/entry.cc new file mode 100644 index 0000000..147dd5a --- /dev/null +++ b/juci/entry.cc @@ -0,0 +1,45 @@ +#include "entry.h" + +Entry::Model::Model() : + next_("Next"), + prev_("Prev"){ + std::cout<<"Model Entry"< +#include "gtkmm.h" +#include "keybindings.h" + +namespace Entry { + class View { + public: + View(); + Gtk::Box& view(); + Gtk::Entry& entry(){return entry_;} + Gtk::Button& button_apply(){return button_apply_;}; + Gtk::Button& button_cancel(){return button_cancel_;}; + void OnShowSetFilenName(std::string exstension); + void OnHideEntry(); + protected: + Gtk::Box view_; + Gtk::Entry entry_; + Gtk::Button button_apply_, button_cancel_; + }; + class Model { + public: + Model(); + std::string next(){return next_;}; + std::string prev(){return prev_;}; + private: + std::string next_, prev_; + }; + class Controller { + public: + Controller(); + Gtk::Box& view(); + Gtk::Button& button_apply(); + void OnShowSetFilenName(std::string exstension); + void OnHideEntries(); + View view_; + };// class controller +} // namespace notebook + + +#endif // JUCI_ENTRY_H_ diff --git a/juci/juci.cc b/juci/juci.cc index 5b206f6..68a06ad 100644 --- a/juci/juci.cc +++ b/juci/juci.cc @@ -1,5 +1,4 @@ -#include "juci.h" - +#include "window.h" int main(int argc, char *argv[]) { @@ -7,8 +6,6 @@ int main(int argc, char *argv[]) { argc, argv, "no.sout.juci"); - // app->set_flags(Gio::APPLICATION_NON_UNIQUE); - Window window; return app->run(window); } diff --git a/juci/juci.h b/juci/juci.h deleted file mode 100644 index f7c1efb..0000000 --- a/juci/juci.h +++ /dev/null @@ -1,26 +0,0 @@ -//juCi++ main header file -#ifndef JUCI_JUCI_H_ -#define JUCI_JUCI_H_ - -#include -#include "gtkmm.h" -#include "menu.h" -#include "source.h" - -class Window : public Gtk::Window { -public: - Window(); - virtual ~Window() {} - -private: - Keybindings::Controller keybindings_; - Menu::Controller menu_; - Source::Controller& source(); - Source::Controller source_; - Gtk::Box window_box_; - - /*signal handler*/ - void OnSystemQuit(); -}; - -#endif // JUCI_JUCI_H_ diff --git a/juci/keybindings.cc b/juci/keybindings.cc index c112c0a..d24bf47 100644 --- a/juci/keybindings.cc +++ b/juci/keybindings.cc @@ -1,21 +1,77 @@ #include "keybindings.h" +Keybindings::Model::Model() { + menu_ui_string_ = + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " "; + + hidden_ui_string_ = + " " + " " + " " + " " + " "; +}; - Keybindings::Controller::Controller() { - action_group_ = Gtk::ActionGroup::create(); - ui_manager_ = Gtk::UIManager::create(); - } -Keybindings::Controller::~Controller(){ +Keybindings::Model::~Model() { +} +Keybindings::Controller::Controller() { + action_group_menu_ = Gtk::ActionGroup::create(); + ui_manager_menu_ = Gtk::UIManager::create(); + action_group_hidden_ = Gtk::ActionGroup::create(); + ui_manager_hidden_ = Gtk::UIManager::create(); } -void Keybindings::Controller::set_ui_manager_action_group(Glib::RefPtr action_group) { - ui_manager_->insert_action_group(action_group); +Keybindings::Controller::~Controller() { } -void Keybindings::Controller::set_ui_manger_string(std::string ui_string) { +void Keybindings::Controller::BuildMenu() { try { - ui_manager_->add_ui_from_string(ui_string); + ui_manager_menu_->add_ui_from_string(model_.menu_ui_string()); } catch (const Glib::Error &ex) { - std::cerr << "building menus failed: " << ex.what(); + std::cerr << "building menu failed" << ex.what(); } + ui_manager_menu_->insert_action_group(action_group_menu_); } +void Keybindings::Controller::BuildHiddenMenu() { + try { + ui_manager_hidden_->add_ui_from_string(model_.hidden_ui_string()); + } + catch (const Glib::Error &ex) { + std::cerr << "building hidden menu failed" << ex.what(); + } + ui_manager_hidden_->insert_action_group(action_group_hidden_); +} + diff --git a/juci/keybindings.h b/juci/keybindings.h index c15a50c..f117028 100644 --- a/juci/keybindings.h +++ b/juci/keybindings.h @@ -1,28 +1,47 @@ +//juCi++ class that holds every keybinding. +#ifndef JUCI_KEYBINDINGS_H_ +#define JUCI_KEYBINDINGS_H_ + #include "iostream" #include "gtkmm.h" namespace Keybindings { - class Controller { - public: - Controller(); - - virtual ~Controller(); - - Glib::RefPtr action_group() { - return action_group_; - }; - - Glib::RefPtr ui_manager() { - return ui_manager_; - }; - - void set_ui_manger_string(std::string ui_string); - - void set_ui_manager_action_group(Glib::RefPtr action_group); - - protected: - Glib::RefPtr ui_manager_; - Glib::RefPtr action_group_; + class Model { + public: + Model(); + virtual ~Model(); + std::string menu_ui_string(){return menu_ui_string_;} + std::string hidden_ui_string(){return hidden_ui_string_;} + private: + std::string menu_ui_string_; + std::string hidden_ui_string_; + }; // Model + class Controller { + public: + Controller(); + virtual ~Controller(); + Glib::RefPtr action_group_menu() { + return action_group_menu_; }; - -} \ No newline at end of file + Glib::RefPtr ui_manager_menu() { + return ui_manager_menu_; + }; + Glib::RefPtr action_group_hidden() { + return action_group_hidden_; + }; + Glib::RefPtr ui_manager_hidden() { + return ui_manager_hidden_; + }; + void BuildMenu(); + void BuildHiddenMenu(); + protected: + Glib::RefPtr ui_manager_menu_; + Glib::RefPtr action_group_menu_; + Glib::RefPtr ui_manager_hidden_; + Glib::RefPtr action_group_hidden_; + private: + Keybindings::Model model_; + };//Controller +} + +#endif // JUCI_KEYBINDINGS_H_ diff --git a/juci/menu.cc b/juci/menu.cc index 2fcd916..8f7bd15 100644 --- a/juci/menu.cc +++ b/juci/menu.cc @@ -1,232 +1,90 @@ #include "menu.h" -/***********************************/ -/* MODEL */ -/***********************************/ - - -Menu::Model::Model() { - ui_string_ = - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " "; - -} - -Menu::Model::~Model() { -} - - -// VIEW - Menu::View::View(Gtk::Orientation orientation) : - view_(orientation) { - + view_(orientation) { + Gtk::MenuBar menutest; + view_.pack_end(menutest); } - Gtk::Box &Menu::View::view( - Glib::RefPtr ui_manager) { + Glib::RefPtr ui_manager) { view_.pack_start(*ui_manager->get_widget("/MenuBar"), Gtk::PACK_SHRINK); return view_; } -Menu::View::~View() { -} - -/***********************************/ -/* CONTROLLER */ -/***********************************/ -Menu::Controller::Controller(Keybindings::Controller keybindings) : - menu_view_(Gtk::ORIENTATION_VERTICAL), - menu_model_(), - keybindings_(keybindings) { -/* Add action to menues */ -/* START file menu */ - keybindings_.action_group()->add(Gtk::Action::create("FileMenu", Gtk::Stock::FILE)); - /* File->New files */ - keybindings_.action_group()->add(Gtk::Action::create("FileNew", "New")); - keybindings_.action_group()->add(Gtk::Action::create("FileNewStandard", - Gtk::Stock::NEW, "New empty file", "Create a new file"), - [this]() { - OnFileNewEmptyfile(); - }); - keybindings_.action_group()->add(Gtk::Action::create("FileNewCC", - Gtk::Stock::NEW, "New cc file", "Create a new cc file"), - Gtk::AccelKey("c"), - [this]() { - OnFileNewCCFile(); - }); - keybindings_.action_group()->add(Gtk::Action::create("FileNewH", - Gtk::Stock::NEW, "New h file", "Create a new h file"), - Gtk::AccelKey("h"), - [this]() { - OnFileNewHeaderFile(); - }); - /* File-> New files end */ - keybindings_.action_group()->add(Gtk::Action::create("FileOpenFile", Gtk::Stock::OPEN), - [this]() { - OnFileOpenFile(); - }); - keybindings_.action_group()->add(Gtk::Action::create("FileOpenFolder", "Open folder"), - [this]() { - OnFileOpenFolder(); - }); -/* END file menu */ -/* START edit menu */ - keybindings_.action_group()->add(Gtk::Action::create("EditMenu", Gtk::Stock::EDIT)); - keybindings_.action_group()->add(Gtk::Action::create("EditCopy", Gtk::Stock::COPY), - [this]() { - OnEditCopy(); - }); - keybindings_.action_group()->add(Gtk::Action::create("EditCut", Gtk::Stock::CUT), - [this]() { - OnEditCut(); - }); - keybindings_.action_group()->add(Gtk::Action::create("EditPaste", Gtk::Stock::PASTE), - [this]() { - OnEditPaste(); - }); - keybindings_.action_group()->add(Gtk::Action::create("EditFind", Gtk::Stock::FIND), - [this]() { - OnEditFind(); - }); -/* END edit menu */ -/* START window menu */ - keybindings_.action_group()->add(Gtk::Action::create("WindowMenu", "_Window")); - keybindings_.action_group()->add(Gtk::Action::create("WindowCloseTab", "Close tab"), - Gtk::AccelKey("w"), - [this]() { - OnWindowCloseTab(); - }); - keybindings_.action_group()->add(Gtk::Action::create("WindowSplitWindow", "Split window"), - Gtk::AccelKey("S"), - [this]() { - OnWindowSplitWindow(); - }); -/* END window menu */ -/* START Plugin menu */ - keybindings_.action_group()->add(Gtk::Action::create("PluginMenu", "_Plugins")); - /*Plugin->snippet*/ - keybindings_.action_group()->add(Gtk::Action::create("PluginSnippet", "Snippet")); - keybindings_.action_group()->add(Gtk::Action::create("PluginAddSnippet", "Add snippet"), - Gtk::AccelKey("space"), - [this]() { - OnPluginAddSnippet(); - }); - /* End snippet */ -/* END plugin menu */ -/* START help menu */ - keybindings_.action_group()->add(Gtk::Action::create("HelpMenu", Gtk::Stock::HELP)); - keybindings_.action_group()->add(Gtk::Action::create("HelpAbout", Gtk::Stock::ABOUT), - [this]() { - OnHelpAbout(); - }); - - -/* END help menu */ - - - keybindings_.ui_manager()->add_ui_from_string(menu_model_.ui_string()); - keybindings_.ui_manager()->insert_action_group(keybindings_.action_group()); -} - -Menu::Controller::~Controller() { -} - +Menu::Controller::Controller(Keybindings::Controller& keybindings) : + menu_view_(Gtk::ORIENTATION_VERTICAL), + keybindings_(keybindings) { + keybindings_.action_group_menu()->add(Gtk::Action::create("FileNew", + Gtk::Stock::FILE)); + + keybindings_.action_group_menu()->add(Gtk::Action::create("FileOpenFolder", + "Open folder"), + [this]() { + OnFileOpenFolder(); + }); + keybindings_.action_group_menu()->add(Gtk::Action::create("EditMenu", + Gtk::Stock::EDIT)); + keybindings_.action_group_menu()->add(Gtk::Action::create("WindowMenu", + "_Window")); + keybindings_.action_group_menu()->add(Gtk::Action::create("WindowSplitWindow", + "Split window"), + Gtk::AccelKey("S"), + [this]() { + OnWindowSplitWindow(); + }); + keybindings_.action_group_menu()->add(Gtk::Action::create("PluginMenu", + "_Plugins")); + keybindings_.action_group_menu()->add(Gtk::Action::create("PluginSnippet", + "Snippet")); + keybindings_.action_group_menu()->add(Gtk::Action::create("PluginAddSnippet", + "Add snippet"), + Gtk::AccelKey("space"), + [this]() { + OnPluginAddSnippet(); + }); + keybindings_.action_group_menu()->add(Gtk::Action::create("HelpMenu", + Gtk::Stock::HELP)); + keybindings_.action_group_menu()->add(Gtk::Action::create("HelpAbout", + Gtk::Stock::ABOUT), + [this]() { + OnHelpAbout(); + }); + keybindings_.action_group_hidden()->add(Gtk::Action::create("Test"), + Gtk::AccelKey("K"), + [this]() { + OnHelpAbout(); + }); + keybindings_.BuildMenu(); + keybindings_.BuildHiddenMenu(); + } // Controller Gtk::Box &Menu::Controller::view() { - return menu_view_.view(keybindings_.ui_manager()); -} - -void Menu::Controller::OnFileNewEmptyfile() { - std::cout << "New file clicked" << std::endl; - //TODO(Oyvang) Legg til funksjon -} - -void Menu::Controller::OnFileNewCCFile() { - std::cout << "New cc file clicked" << std::endl; - //TODO(Oyvang) Legg til funksjon -} - -void Menu::Controller::OnFileNewHeaderFile() { - std::cout << "New header file clicked" << std::endl; - //TODO(Oyvang) Legg til funksjon + return menu_view_.view(keybindings_.ui_manager_menu()); } - void Menu::Controller::OnPluginAddSnippet() { - std::cout << "Add snipper" << std::endl; //TODO(Forgi add you snippet magic code) + //TODO(Forgi add you snippet magic code) + std::cout << "Add snipper" << std::endl; + juci_api::py::LoadPlugin("snippet"); } - void Menu::Controller::OnFileOpenFile() { std::cout << "Open file clicked" << std::endl; //TODO(Oyvang) Legg til funksjon } - void Menu::Controller::OnFileOpenFolder() { std::cout << "Open folder clicked" << std::endl; //TODO(Oyvang) Legg til funksjon } - -void Menu::Controller::OnWindowCloseTab() { - std::cout << "Closing tab clicked" << std::endl; - //TODO(Oyvang) Legg til funksjon -} - -void Menu::Controller::OnEditCopy() { - std::cout << "Clicked copy" << std::endl; - //TODO(Oyvang) Legg til funksjon -} - void Menu::Controller::OnEditCut() { std::cout << "Clicked cut" << std::endl; //TODO(Oyvang) Legg til funksjon } - -void Menu::Controller::OnEditPaste() { - std::cout << "Clicked paste" << std::endl; - //TODO(Oyvang) Legg til funksjon -} - void Menu::Controller::OnEditFind() { std::cout << "Clicked find" << std::endl; //TODO(Oyvang) Legg til funksjon } - void Menu::Controller::OnWindowSplitWindow() { std::cout << "Clicked split window" << std::endl; //TODO(Oyvang) Legg til funksjon } - void Menu::Controller::OnHelpAbout() { std::cout << "Clicked about" << std::endl; //TODO(Oyvang) Legg til funksjon diff --git a/juci/menu.h b/juci/menu.h index 1eea96e..8e00bad 100644 --- a/juci/menu.h +++ b/juci/menu.h @@ -4,73 +4,34 @@ #include #include "gtkmm.h" #include "keybindings.h" +#include "api.h" namespace Menu { - class Model { - public: - Model(); - - virtual ~Model(); - - std::string ui_string() { - return ui_string_; - } - - private: - std::string ui_string_; - }; // class Model - - class View { - public: - explicit View(Gtk::Orientation orient); - - virtual ~View(); - - Gtk::Box &view(Glib::RefPtr ui_manager); - - protected: - Gtk::Box view_; - }; // class View - // controller - class Controller { - public: - explicit Controller(Keybindings::Controller keybindings); - - virtual ~Controller(); - - Gtk::Box &view(); - - private: - Keybindings::Controller keybindings_; - View menu_view_; - Model menu_model_; - - void OnFileNewEmptyfile(); - - /*Signal handlers*/ - void OnFileNewCCFile(); - - void OnFileNewHeaderFile(); - - void OnFileOpenFile(); - - void OnFileOpenFolder(); - - void OnPluginAddSnippet(); - - void OnWindowCloseTab(); - - void OnEditCopy(); - - void OnEditCut(); - - void OnEditPaste(); - - void OnEditFind(); - - void OnWindowSplitWindow(); - - void OnHelpAbout(); - }; // class Controller + class View { + public: + explicit View(Gtk::Orientation orient); + Gtk::Box &view(Glib::RefPtr ui_manager); + protected: + Gtk::Box view_; + }; // class View + class Controller { + public: + explicit Controller(Keybindings::Controller& keybindings); + Gtk::Box &view(); + private: + Keybindings::Controller &keybindings_; + View menu_view_; + void OnFileNewEmptyfile(); + void OnFileNewCCFile(); + void OnFileNewHeaderFile(); + void OnFileOpenFile(); + void OnFileOpenFolder(); + void OnPluginAddSnippet(); + void OnWindowCloseTab(); + void OnEditCut(); + void OnEditFind(); + void OnWindowSplitWindow(); + void OnHelpAbout(); + }; // class Controller } // namespace Menu #endif // JUCI_MENU_H_ diff --git a/juci/notebook.cc b/juci/notebook.cc new file mode 100644 index 0000000..cad945d --- /dev/null +++ b/juci/notebook.cc @@ -0,0 +1,148 @@ +#include "notebook.h" + + +Notebook::View::View() : + view_(Gtk::ORIENTATION_VERTICAL){ + +} +Gtk::Box& Notebook::View::view() { + view_.pack_start(notebook_); + return view_; +} +Notebook::Controller::Controller(Keybindings::Controller& keybindings){ + + scrolledwindow_vec_.push_back(new Gtk::ScrolledWindow()); + source_vec_.push_back(new Source::Controller); + scrolledwindow_vec_.back()->add(source_vec_.back()->view()); + source_vec_.back()->OnNewEmptyFile(); + view_.notebook().append_page(*scrolledwindow_vec_.back(), "juCi++"); + refClipboard = Gtk::Clipboard::get(); + + keybindings.action_group_menu()->add(Gtk::Action::create("FileMenu", + Gtk::Stock::FILE)); + /* File->New files */ + + keybindings.action_group_menu()->add(Gtk::Action::create("FileNewStandard", + Gtk::Stock::NEW, + "New empty file", + "Create a new file"), + [this]() { + OnFileNewEmptyfile(); + }); + keybindings.action_group_menu()->add(Gtk::Action::create("FileNewCC", + "New cc file"), + Gtk::AccelKey("c"), + [this]() { + OnFileNewCCFile(); + }); + keybindings.action_group_menu()->add(Gtk::Action::create("FileNewH", + "New h file"), + Gtk::AccelKey("h"), + [this]() { + OnFileNewHeaderFile(); + }); + keybindings.action_group_menu()->add(Gtk::Action::create("WindowCloseTab", + "Close tab"), + Gtk::AccelKey("w"), + [this]() { + OnCloseCurrentPage(); + }); + keybindings.action_group_menu()->add(Gtk::Action::create("EditFind", + Gtk::Stock::FIND), + [this]() { + //TODO(Oyvang, Zalox, Forgi)Create function OnEditFind(); + }); + keybindings.action_group_menu()->add(Gtk::Action::create("EditCopy", + Gtk::Stock::COPY), + [this]() { + OnEditCopy(); + }); + keybindings.action_group_menu()->add(Gtk::Action::create("EditCut", + Gtk::Stock::CUT), + [this]() { + OnEditCut(); + }); + keybindings.action_group_menu()->add(Gtk::Action::create("EditPaste", + Gtk::Stock::PASTE), + [this]() { + OnEditPaste(); + }); + entry_.view_.entry().signal_activate().connect( + [this]() { + OnNewPage(entry_.view_.entry().get_text()); + entry_.OnHideEntries(); + }); +}//Constructor +Gtk::Box& Notebook::Controller::view() { + return view_.view(); +} +Gtk::Box& Notebook::Controller::entry_view(){ + return entry_.view(); +} +void Notebook::Controller::OnNewPage(std::string name) { + scrolledwindow_vec_.push_back(new Gtk::ScrolledWindow()); + source_vec_.push_back(new Source::Controller); + scrolledwindow_vec_.back()->add(source_vec_.back()->view()); + source_vec_.back()->OnNewEmptyFile(); + view_.notebook().append_page(*scrolledwindow_vec_.back(), name); + view_.notebook().show_all_children(); + view_.notebook().set_focus_child(*scrolledwindow_vec_.back()); + view_.notebook().set_current_page(view_.notebook().get_n_pages()-1); +} +void Notebook::Controller::OnCloseCurrentPage() { + //TODO (oyvang, zalox, forgi) Save a temp file, in case you close one you dont want to close? + int page = view_.notebook().get_current_page(); + view_.notebook().remove_page(page); + delete source_vec_.at(page); + delete scrolledwindow_vec_.at(page); + source_vec_.erase(source_vec_.begin()+ page); + scrolledwindow_vec_.erase(scrolledwindow_vec_.begin()+page); +} +void Notebook::Controller::OnFileNewEmptyfile() { + entry_.OnShowSetFilenName(""); +} +void Notebook::Controller::OnFileNewCCFile() { + entry_.OnShowSetFilenName(".cc"); +} +void Notebook::Controller::OnFileNewHeaderFile() { + entry_.OnShowSetFilenName(".h"); +} +void Notebook::Controller::OnEditCopy() { + if (view_.notebook().get_n_pages() != 0) { + int source_pos = view_.notebook().get_current_page(); + Glib::RefPtr buffer = source_vec_.at(source_pos) + ->view().get_buffer(); + buffer->copy_clipboard(refClipboard); + } +} +void Notebook::Controller::OnEditPaste() { + if (view_.notebook().get_n_pages() != 0) { + int source_pos = view_.notebook().get_current_page(); + Glib::RefPtr buffer = source_vec_.at(source_pos) + ->view().get_buffer(); + buffer->paste_clipboard(refClipboard); + } +} +void Notebook::Controller::OnEditCut() { + if (view_.notebook().get_n_pages() != 0) { + int source_pos = view_.notebook().get_current_page(); + Glib::RefPtr buffer = source_vec_.at(source_pos) + ->view().get_buffer(); + buffer->cut_clipboard(refClipboard); + } +} + +void Notebook::Controller::OnOpenFile(std::string filename) { + scrolledwindow_vec_.push_back(new Gtk::ScrolledWindow()); + source_vec_.push_back(new Source::Controller); + scrolledwindow_vec_.back()->add(source_vec_.back()->view()); + source_vec_.back()->OnOpenFile(filename); + view_.notebook().append_page(*scrolledwindow_vec_.back(), filename); + view_.notebook().show_all_children(); + view_.notebook().set_focus_child(*scrolledwindow_vec_.back()); + view_.notebook().set_current_page(view_.notebook().get_n_pages()-1); +} + + + + diff --git a/juci/notebook.h b/juci/notebook.h new file mode 100644 index 0000000..7dfe02f --- /dev/null +++ b/juci/notebook.h @@ -0,0 +1,44 @@ +#ifndef JUCI_NOTEBOOK_H_ +#define JUCI_NOTEBOOK_H_ + +#include +#include "gtkmm.h" +#include "entry.h" +#include "source.h" + +namespace Notebook { + class View { + public: + View(); + Gtk::Box& view(); + Gtk::Notebook& notebook() { return notebook_; } + protected: + Gtk::Box view_; + Gtk::Notebook notebook_; + }; + class Controller { + public: + Controller(Keybindings::Controller& keybindings); + Gtk::Box& view(); + Gtk::Box& entry_view(); + void OnNewPage(std::string name); + void OnCloseCurrentPage(); + void OnOpenFile(std::string filename); + private: + View view_; + Entry::Controller entry_; + std::vector source_vec_; + std::vector scrolledwindow_vec_; + Glib::RefPtr refClipboard; + std::list listTargets; + void OnFileNewEmptyfile(); + void OnFileNewCCFile(); + void OnFileNewHeaderFile(); + void OnEditCopy(); + void OnEditPaste(); + void OnEditCut(); + }; // class controller +} // namespace Notebook + + +#endif // JUCI_NOTEBOOK_H_ diff --git a/juci/source.cc b/juci/source.cc index 735e8d4..7b12dc1 100644 --- a/juci/source.cc +++ b/juci/source.cc @@ -1,5 +1,8 @@ #include "source.h" #include +#include "sourcefile.h" +#include +#include ////////////// //// View //// @@ -11,12 +14,12 @@ Source::View::View() { // returns the new line string Source::View::UpdateLine() { Gtk::TextIter line(get_buffer()->get_insert()->get_iter()); + // std::cout << line.get_line() << std::endl; // for each word --> check what it is --> apply appropriate tag - - // retUrn ""; + return ""; } -String Source::View::Getline(const Gtk::TextIter &begin) { +string Source::View::GetLine(const Gtk::TextIter &begin) { Gtk::TextIter end(begin); while (!end.ends_line()) end++; @@ -31,12 +34,53 @@ void Source::View::ApplyTheme(const Source::Theme &theme) { } } +void Source::View::OnOpenFile(std::vector &locations, + const Source::Theme &theme) { + Glib::RefPtr buffer = get_buffer(); + for (auto &loc : locations) { + string type = std::to_string(loc.kind()); + int linum = loc.line_number(); + int begin = loc.begin(); + int end = loc.end(); + if(end < 0) end = 0; + if(begin < 0) begin = 0; + + // for (auto &i : theme.tagtable()) { + // std::cout << "first: "<< i.first << " second: "<< i.second << std::endl; + // } + + // std::cout << "type: " << type << std::endl; + buffer->apply_tag_by_name(theme.typetable().at(type), + buffer->get_iter_at_line_offset(linum, begin), + buffer->get_iter_at_line_offset(linum, end)); + // std::cout << "This is a ans" << std::endl; + } +} // Source::View::Theme::tagtable() // returns a const refrence to the tagtable const std::unordered_map& Source::Theme::tagtable() const { return tagtable_; } +// Source::View::Theme::tagtable() +// returns a const refrence to the tagtable +const std::unordered_map& Source::Theme::typetable() const { + return typetable_; +} + +void Source::Theme::InsertTag(const string &key, const string &value) { + tagtable_[key] = value; +} +// Source::View::Theme::SetTagTable() +// sets the tagtable for the view +void Source::Theme::SetTypeTable( + const std::unordered_map &typetable) { + typetable_ = typetable; +} + +void Source::Theme::InsertType(const string &key, const string &value) { + typetable_[key] = value; +} // Source::View::Theme::SetTagTable() // sets the tagtable for the view void Source::Theme::SetTagTable( @@ -47,14 +91,42 @@ void Source::Theme::SetTagTable( /////////////// //// Model //// /////////////// -Source::Model::Model() { +Source::Model::Model() : + theme_() { std::cout << "Model constructor run" << std::endl; + boost::property_tree::ptree pt; + boost::property_tree::json_parser::read_json("config.json", pt); + for ( auto &i : pt ) { + boost::property_tree::ptree props = pt.get_child(i.first); + for (auto &pi : props) { + if (i.first.compare("syntax")) { // checks the config-file + theme_.InsertTag(pi.first, pi.second.get_value()); + // std::cout << "inserting tag. " << pi.first << pi.second.get_value() << std::endl; + } + if (i.first.compare("colors")) { // checks the config-file + theme_.InsertType(pi.first, pi.second.get_value()); + // std::cout << "inserting type. " << pi.first << pi.second.get_value() << std::endl; + } + } + } +} + +Source::Theme& Source::Model::theme() { + return theme_; } const string Source::Model::filepath() { return filepath_; } +void Source::Model::SetFilePath(const string &filepath) { + filepath_ = filepath; +} + +void Source::Model:: +SetSourceLocations(const std::vector &locations) { + locations_ = locations; +} //////////////////// //// Controller //// //////////////////// @@ -82,3 +154,18 @@ Source::Model& Source::Controller::model() { void Source::Controller::OnLineEdit() { view().UpdateLine(); } + +void Source::Controller::OnNewEmptyFile() { + string filename("/tmp/juci_t"); + sourcefile s(filename); + model().SetFilePath(filename); + s.save(""); +} + +void Source::Controller::OnOpenFile(const string &filename) { + sourcefile s(filename); + view().get_buffer()->set_text(s.get_content()); + Clang::TranslationUnit tu(filename.c_str()); + model().SetSourceLocations(tu.getSourceLocations()); + view().OnOpenFile(model().getSourceLocations(), model().theme()); +} diff --git a/juci/source.h b/juci/source.h index 2e06a40..8b7011f 100644 --- a/juci/source.h +++ b/juci/source.h @@ -5,6 +5,7 @@ #include #include #include "gtkmm.h" +#include using std::string; @@ -12,9 +13,15 @@ namespace Source { class Theme { public: const std::unordered_map& tagtable() const; + const std::unordered_map& typetable() const; void SetTagTable(const std::unordered_map &tagtable); + void InsertTag(const string &key, const string &value); + void SetTypeTable(const std::unordered_map &tagtable); + void InsertType(const string &key, const string &value); + private: std::unordered_map tagtable_; + std::unordered_map typetable_; string background_; }; // class Theme @@ -23,6 +30,8 @@ namespace Source { View(); string UpdateLine(); void ApplyTheme(const Theme &theme); + void OnOpenFile(std::vector &locations, + const Theme &theme); private: string GetLine(const Gtk::TextIter &begin); }; // class View @@ -30,11 +39,18 @@ namespace Source { class Model{ public: Model(); - Theme theme(); + Theme& theme(); const string filepath(); + void SetFilePath(const string &filepath); + void SetSourceLocations(const std::vector &locations); + std::vector& getSourceLocations() { + return locations_; + } + private: Theme theme_; string filepath_; + std::vector locations_; }; class Controller { @@ -42,12 +58,13 @@ namespace Source { Controller(); View& view(); Model& model(); + void OnNewEmptyFile(); + void OnOpenFile(const string &filename); private: void OnLineEdit(); - void OnOpenFile(); void OnSaveFile(); - + protected: View view_; Model model_; diff --git a/juci/sourcefile.cc b/juci/sourcefile.cc new file mode 100644 index 0000000..0374584 --- /dev/null +++ b/juci/sourcefile.cc @@ -0,0 +1,92 @@ +#include "sourcefile.h" +#include +#include +#include +#include + +using namespace std; + +sourcefile::sourcefile(const string &input_filename) + : lines(), filename(input_filename) { + open(input_filename); +} + +/** + * + */ +void sourcefile::open(const string &filename) { + Gio::init(); + + // Creates/Opens a file specified by the input string. + Glib::RefPtr file = Gio::File::create_for_path(filename); + + if (!file) // Gio::File has overloaded operator + cerr << "Was not able to open file: " << filename << endl; + + // Creates pointer for filestream + + if (!file->query_exists()) { + file->create_file()->close(); + } + + Glib::RefPtr stream = file->read(); + + if (!stream) // error message on stream failure + cerr << filename << " returned an empty stream" << endl; + + Glib::RefPtr + datainput = Gio::DataInputStream::create(stream); + + string line; + while (datainput->read_line(line)) { + lines.push_back(line); + } + + datainput->close(); + stream->close(); +} + +vector sourcefile::get_lines() { + return lines; +} + +string sourcefile::get_line(int line_number) { + return lines[line_number]; +} + +int sourcefile::save(const string &text) { + Gio::init(); + + // Creates/Opens a file specified by the input string. + Glib::RefPtr file = Gio::File::create_for_path(filename); + + if (!file) // Gio::File has overloaded operator + cerr << "Was not able to open file: " << filename << endl; + + // Creates + Glib::RefPtr stream = + file->query_exists() ? file->replace() : file->create_file(); + + if (!stream) // error message on stream failure + cerr << filename << " returned an empty stream" << endl; + + Glib::RefPtr + output = Gio::DataOutputStream::create(stream); + + output->put_string(text); + + output->close(); + stream->close(); + + + return 0; +} + +string sourcefile::get_content() { + string res; + for (auto line : lines) { + res.append(line).append("\n"); + } + return res; +} + diff --git a/juci/sourcefile.h b/juci/sourcefile.h new file mode 100644 index 0000000..608ea05 --- /dev/null +++ b/juci/sourcefile.h @@ -0,0 +1,23 @@ +#ifndef JUCI_SOURCEFILE_H_ +#define JUCI_SOURCEFILE_H_ + +#include +#include + +using namespace std; + +class sourcefile { +public: + explicit sourcefile(const string &filename); + vector get_lines(); + string get_content(); + string get_line(int line_number); + int save(const string &text); + +private: + void open(const string &filename); + vector lines; + string filename; +}; + +#endif // JUCI_SOURCEFILE_H_ diff --git a/juci/window.cc b/juci/window.cc index b16c80a..5db176e 100644 --- a/juci/window.cc +++ b/juci/window.cc @@ -1,27 +1,80 @@ -#include "juci.h" +#include "window.h" Window::Window() : window_box_(Gtk::ORIENTATION_VERTICAL), - menu_(keybindings_) { + notebook_(keybindings_), + menu_(keybindings_){ set_title("juCi++"); - set_default_size(600, 600); + set_default_size(600, 400); add(window_box_); - keybindings_.action_group()->add(Gtk::Action::create("FileQuit", - Gtk::Stock::QUIT), - [this]() { - OnSystemQuit(); - }); - - add_accel_group(keybindings_.ui_manager()->get_accel_group()); + keybindings_.action_group_menu()->add(Gtk::Action::create("FileQuit", + Gtk::Stock::QUIT), + [this]() { + OnWindowHide(); + }); + keybindings_.action_group_menu()->add(Gtk::Action::create("FileOpenFile", + Gtk::Stock::OPEN), + [this]() { + OnOpenFile(); + }); + add_accel_group(keybindings_.ui_manager_menu()->get_accel_group()); + add_accel_group(keybindings_.ui_manager_hidden()->get_accel_group()); + window_box_.pack_start(menu_.view(), Gtk::PACK_SHRINK); - window_box_.pack_start(source().view()); + window_box_.pack_start(notebook_.entry_view(), Gtk::PACK_SHRINK); + window_box_.pack_start(notebook_.view()); show_all_children(); + } // Window constructor +void Window::OnWindowHide() { + hide(); } -Source::Controller& Window::source() { - return source_; -} +void Window::OnOpenFile() { + Gtk::FileChooserDialog dialog("Please choose a file", + Gtk::FILE_CHOOSER_ACTION_OPEN); + dialog.set_transient_for(*this); + dialog.set_position(Gtk::WindowPosition::WIN_POS_CENTER_ALWAYS); + + //Add response buttons the the dialog: + dialog.add_button("_Cancel", Gtk::RESPONSE_CANCEL); + dialog.add_button("_Open", Gtk::RESPONSE_OK); + + //Add filters, so that only certain file types can be selected: + Glib::RefPtr filter_text = Gtk::FileFilter::create(); + filter_text->set_name("Text files"); + filter_text->add_mime_type("text/plain"); + dialog.add_filter(filter_text); + + Glib::RefPtr filter_cpp = Gtk::FileFilter::create(); + filter_cpp->set_name("C/C++ files"); + filter_cpp->add_mime_type("text/x-c"); + filter_cpp->add_mime_type("text/x-c++"); + filter_cpp->add_mime_type("text/x-c-header"); + dialog.add_filter(filter_cpp); + + Glib::RefPtr filter_any = Gtk::FileFilter::create(); + filter_any->set_name("Any files"); + filter_any->add_pattern("*"); + dialog.add_filter(filter_any); + + int result = dialog.run(); + + switch (result) { + case(Gtk::RESPONSE_OK): { + std::cout << "Open clicked." << std::endl; + std::string path = dialog.get_filename(); + std::cout << "File selected: " << path << std::endl; + notebook_.OnOpenFile(path); + break; + } + case(Gtk::RESPONSE_CANCEL): { + std::cout << "Cancel clicked." << std::endl; + break; + } + default: { + std::cout << "Unexpected button clicked." << std::endl; + break; + } + } -void Window::OnSystemQuit() { - hide(); } diff --git a/juci/window.h b/juci/window.h new file mode 100644 index 0000000..d002781 --- /dev/null +++ b/juci/window.h @@ -0,0 +1,23 @@ +#ifndef JUCI_WINDOW_H_ +#define JUCI_WINDOW_H_ + +#include +#include "gtkmm.h" +#include "menu.h" +#include "notebook.h" + +class Window : public Gtk::Window { +public: + Window(); + Gtk::Box window_box_; +private: + Keybindings::Controller keybindings_; + Menu::Controller menu_; + Notebook::Controller notebook_; + + //signal handlers + void OnWindowHide(); + void OnOpenFile(); +}; + +#endif // JUCI_WINDOW_H_