Browse Source

fix return in source

merge-requests/365/head
Jørgen Lien Sellæg 11 years ago
parent
commit
6249f25238
  1. 41
      juci/source.cc
  2. 8
      juci/source.h

41
juci/source.cc

@ -1,47 +1,44 @@
#include "source.h" #include "source.h"
#include <iostream> #include <iostream>
using namespace std;
////////////// //////////////
//// View //// //// View ////
////////////// //////////////
Source::View::View() { Source::View::View() {
cout << "View construktor run" << endl; std::cout << "View constructor run" << std::endl;
} }
void Source::View::UpdateLine(Glib::RefPtr<Gtk::TextBuffer::Mark> mark) { void Source::View::UpdateLine(Glib::RefPtr<Gtk::TextBuffer::Mark> 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 //// //// Model ////
/////////////// ///////////////
Source::Model::Model(){ Source::Model::Model() {
cout << "Model construktor run" << endl; std::cout << "Model constructor run" << std::endl;
} }
//////////////////// ////////////////////
//// Controller //// //// Controller ////
//////////////////// ////////////////////
/** // Source::Controller::Controller()
* // Constructor for Controller
*/
Source::Controller::Controller() { Source::Controller::Controller() {
cout << "Controller construktor run" << endl; std::cout << "Controller constructor run" << std::endl;
} }
/** // Source::Controller::view()
* // return shared_ptr to the view
*/ std::shared_ptr<Source::View> Source::Controller::view() {
std::shared_ptr<Source::View> Source::Controller::sourceview() { return std::shared_ptr<Source::View>(&view_);
sourceview();
return std::shared_ptr<Source::View>(&sourceview_);
} }
/** // Source::Controller::model()
* // return shared_ptr to the model()
*/ std::shared_ptr<Source::Model> Source::Controller::model() {
void Source::Controller::OnLineEdit(Glib::RefPtr<Gtk::TextBuffer::Mark> mark){ return std::shared_ptr<Source::Model>(&model_);
} }
// Source::Controller::OnLineEdit()
// fired when a line in the buffer is edited
void Source::Controller::OnLineEdit(Glib::RefPtr<Gtk::TextBuffer::Mark> mark) {}

8
juci/source.h

@ -21,11 +21,15 @@ namespace Source {
class Controller { class Controller {
public: public:
Controller(); Controller();
std::shared_ptr<Source::View> sourceview(); std::shared_ptr<View> view();
std::shared_ptr<Model> model();
private: private:
void OnLineEdit(Glib::RefPtr<Gtk::TextBuffer::Mark> mark); void OnLineEdit(Glib::RefPtr<Gtk::TextBuffer::Mark> mark);
protected: protected:
View sourceview_; View view_;
Model model_;
}; // class Controller }; // class Controller
} // namespace Source } // namespace Source
#endif // JUCI_SOURCE_H_ #endif // JUCI_SOURCE_H_

Loading…
Cancel
Save