Browse Source

Fix pointer settings

merge-requests/365/head
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 # name of the executable on Windows will be example.exe
add_executable(${project_name} add_executable(${project_name}
#list of every needed file to create the executable #list of every needed file to create the executable
juci.h
juci.cc
keybindings keybindings
menu menu
source source
window window
juci
api api
#there is no need for extentions #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_ #ifndef JUCI_JUCI_H_
#define JUCI_JUCI_H_ #define JUCI_JUCI_H_
@ -12,7 +12,7 @@ public:
Window(); Window();
virtual ~Window() {} virtual ~Window() {}
Gtk::Box window_box_; Gtk::Box window_box_;
std::shared_ptr<Source::Controller> source(); Source::Controller& source();
private: private:
Keybindings::Controller keybindings_; Keybindings::Controller keybindings_;
Menu::Controller menu_; Menu::Controller menu_;

8
juci/source.cc

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

4
juci/source.h

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

7
juci/window.cc

@ -5,14 +5,13 @@ Window::Window() :
menu_(keybindings_) { menu_(keybindings_) {
set_title("example juCi++"); set_title("example juCi++");
set_default_size(600, 600); set_default_size(600, 600);
// window_box_.add(*source_.sourceview()); window_box_.add(source().view());
add(window_box_); add(window_box_);
add_accel_group(keybindings_.ui_manager()->get_accel_group()); add_accel_group(keybindings_.ui_manager()->get_accel_group());
window_box_.pack_start(menu_.view()); window_box_.pack_start(menu_.view());
show_all_children(); show_all_children();
} }
std::shared_ptr<Source::Controller> Window::source() { Source::Controller& Window::source() {
return std::shared_ptr<Source::Controller>(&source_); return source_;
} }

Loading…
Cancel
Save