diff --git a/juci/CMakeLists.txt b/juci/CMakeLists.txt index 9d13438..5581401 100644 --- a/juci/CMakeLists.txt +++ b/juci/CMakeLists.txt @@ -67,11 +67,12 @@ 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 keybindings menu source window - juci api #there is no need for extentions ) diff --git a/juci/juci.h b/juci/juci.h index 6eb5018..ab439b8 100644 --- a/juci/juci.h +++ b/juci/juci.h @@ -1,4 +1,4 @@ -/*juCi++ main header file*/ +//juCi++ main header file #ifndef JUCI_JUCI_H_ #define JUCI_JUCI_H_ @@ -12,7 +12,7 @@ public: Window(); virtual ~Window() {} Gtk::Box window_box_; - std::shared_ptr source(); + Source::Controller& source(); private: Keybindings::Controller keybindings_; Menu::Controller menu_; diff --git a/juci/source.cc b/juci/source.cc index 48c5a19..9fb3b05 100644 --- a/juci/source.cc +++ b/juci/source.cc @@ -31,13 +31,13 @@ Source::Controller::Controller() { } // Source::Controller::view() // return shared_ptr to the view -std::shared_ptr Source::Controller::view() { - return std::shared_ptr(&view_); +Source::View& Source::Controller::view() { + return view_; } // Source::Controller::model() // return shared_ptr to the model() -std::shared_ptr Source::Controller::model() { - return std::shared_ptr(&model_); +Source::Model& Source::Controller::model() { + return model_; } // Source::Controller::OnLineEdit() // fired when a line in the buffer is edited diff --git a/juci/source.h b/juci/source.h index 8d5d9a6..4c901f4 100644 --- a/juci/source.h +++ b/juci/source.h @@ -21,8 +21,8 @@ namespace Source { class Controller { public: Controller(); - std::shared_ptr view(); - std::shared_ptr model(); + View& view(); + Model& model(); private: void OnLineEdit(Glib::RefPtr mark); diff --git a/juci/window.cc b/juci/window.cc index 4e27b3b..977fc1a 100644 --- a/juci/window.cc +++ b/juci/window.cc @@ -5,14 +5,13 @@ Window::Window() : menu_(keybindings_) { set_title("example juCi++"); set_default_size(600, 600); - // window_box_.add(*source_.sourceview()); + window_box_.add(source().view()); add(window_box_); add_accel_group(keybindings_.ui_manager()->get_accel_group()); window_box_.pack_start(menu_.view()); show_all_children(); - } -std::shared_ptr Window::source() { - return std::shared_ptr(&source_); +Source::Controller& Window::source() { + return source_; }