From 6249f25238ddc6abfadfb977077d1ce0b61d0e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Wed, 11 Feb 2015 10:55:36 +0100 Subject: [PATCH] fix return in source --- juci/source.cc | 41 +++++++++++++++++++---------------------- juci/source.h | 8 ++++++-- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/juci/source.cc b/juci/source.cc index 8070f7e..48c5a19 100644 --- a/juci/source.cc +++ b/juci/source.cc @@ -1,47 +1,44 @@ #include "source.h" #include -using namespace std; - - ////////////// //// View //// ////////////// Source::View::View() { - cout << "View construktor run" << endl; + std::cout << "View constructor run" << std::endl; } void Source::View::UpdateLine(Glib::RefPtr mark) { - cout << "Update line called. linum: " << mark->get_iter().get_line() << endl; + std::cout << "Update line called. linum: "; + std::cout << mark->get_iter().get_line() << std::endl; } /////////////// //// Model //// /////////////// -Source::Model::Model(){ - cout << "Model construktor run" << endl; +Source::Model::Model() { + std::cout << "Model constructor run" << std::endl; } //////////////////// //// Controller //// //////////////////// -/** - * - */ +// Source::Controller::Controller() +// Constructor for Controller Source::Controller::Controller() { - cout << "Controller construktor run" << endl; + std::cout << "Controller constructor run" << std::endl; } -/** - * - */ -std::shared_ptr Source::Controller::sourceview() { - sourceview(); - return std::shared_ptr(&sourceview_); +// Source::Controller::view() +// return shared_ptr to the view +std::shared_ptr Source::Controller::view() { + return std::shared_ptr(&view_); } -/** - * - */ -void Source::Controller::OnLineEdit(Glib::RefPtr mark){ - +// Source::Controller::model() +// return shared_ptr to the model() +std::shared_ptr Source::Controller::model() { + return std::shared_ptr(&model_); } +// Source::Controller::OnLineEdit() +// fired when a line in the buffer is edited +void Source::Controller::OnLineEdit(Glib::RefPtr mark) {} diff --git a/juci/source.h b/juci/source.h index 773b15e..8d5d9a6 100644 --- a/juci/source.h +++ b/juci/source.h @@ -21,11 +21,15 @@ namespace Source { class Controller { public: Controller(); - std::shared_ptr sourceview(); + std::shared_ptr view(); + std::shared_ptr model(); + private: void OnLineEdit(Glib::RefPtr mark); + protected: - View sourceview_; + View view_; + Model model_; }; // class Controller } // namespace Source #endif // JUCI_SOURCE_H_