Browse Source

Fix pointer settings

master
Jørgen Lien Sellæg 11 years ago
parent
commit
19311982e0
  1. 3
      juci/CMakeLists.txt
  2. 4
      juci/juci.h
  3. 8
      juci/source.cc
  4. 4
      juci/source.h
  5. 7
      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
)

4
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::Controller> source();
Source::Controller& source();
private:
Keybindings::Controller keybindings_;
Menu::Controller menu_;

8
juci/source.cc

@ -31,13 +31,13 @@ Source::Controller::Controller() {
}
// Source::Controller::view()
// return shared_ptr to the view
std::shared_ptr<Source::View> Source::Controller::view() {
return std::shared_ptr<Source::View>(&view_);
Source::View& Source::Controller::view() {
return view_;
}
// Source::Controller::model()
// return shared_ptr to the model()
std::shared_ptr<Source::Model> Source::Controller::model() {
return std::shared_ptr<Source::Model>(&model_);
Source::Model& Source::Controller::model() {
return model_;
}
// Source::Controller::OnLineEdit()
// fired when a line in the buffer is edited

4
juci/source.h

@ -21,8 +21,8 @@ namespace Source {
class Controller {
public:
Controller();
std::shared_ptr<View> view();
std::shared_ptr<Model> model();
View& view();
Model& model();
private:
void OnLineEdit(Glib::RefPtr<Gtk::TextBuffer::Mark> mark);

7
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<Source::Controller> Window::source() {
return std::shared_ptr<Source::Controller>(&source_);
Source::Controller& Window::source() {
return source_;
}

Loading…
Cancel
Save