Browse Source

Fixed merge conflict

merge-requests/365/head
oyvang 11 years ago
parent
commit
416a65742b
  1. 3
      juci/CMakeLists.txt
  2. 9
      juci/juci.h
  3. 41
      juci/source.cc
  4. 8
      juci/source.h
  5. 15
      juci/window.cc

3
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
)

9
juci/juci.h

@ -1,4 +1,4 @@
/*juCi++ main header file*/
//juCi++ main header file
#ifndef JUCI_JUCI_H_
#define JUCI_JUCI_H_
@ -10,15 +10,12 @@
class Window : public Gtk::Window {
public:
Window();
virtual ~Window() {
}
std::shared_ptr<Source::Controller> source();
virtual ~Window() {}
private:
Keybindings::Controller keybindings_;
Menu::Controller menu_;
Source::Controller& source();
Source::Controller source_;
Gtk::Box window_box_;

41
juci/source.cc

@ -1,47 +1,44 @@
#include "source.h"
#include <iostream>
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<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 ////
///////////////
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::View> Source::Controller::sourceview() {
sourceview();
return std::shared_ptr<Source::View>(&sourceview_);
// Source::Controller::view()
// return shared_ptr to the view
Source::View& Source::Controller::view() {
return view_;
}
/**
*
*/
void Source::Controller::OnLineEdit(Glib::RefPtr<Gtk::TextBuffer::Mark> mark){
// Source::Controller::model()
// return shared_ptr to the model()
Source::Model& Source::Controller::model() {
return 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 {
public:
Controller();
std::shared_ptr<Source::View> sourceview();
View& view();
Model& model();
private:
void OnLineEdit(Glib::RefPtr<Gtk::TextBuffer::Mark> mark);
protected:
View sourceview_;
View view_;
Model model_;
}; // class Controller
} // namespace Source
#endif // JUCI_SOURCE_H_

15
juci/window.cc

@ -1,24 +1,25 @@
#include "juci.h"
Window::Window() :
window_box_(Gtk::ORIENTATION_HORIZONTAL),
menu_(keybindings_) {
window_box_(Gtk::ORIENTATION_VERTICAL),
menu_(keybindings_) {
set_title("juCi++");
set_default_size(600, 600);
// window_box_.add(*source_.sourceview());
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());
//Add views under here
window_box_.pack_start(menu_.view());
window_box_.pack_start(menu_.view(), Gtk::PACK_SHRINK);
window_box_.pack_start(source().view());
show_all_children();
}
std::shared_ptr<Source::Controller> Window::source() {
return std::shared_ptr<Source::Controller>(&source_);
Source::Controller& Window::source() {
return source_;
}
void Window::OnSystemQuit() {

Loading…
Cancel
Save