Browse Source

fixed some google style issues

merge-requests/365/head
oyvang 11 years ago
parent
commit
b789965da5
  1. 1
      juci/CMakeLists.txt
  2. 2
      juci/juci.cc
  3. 6
      juci/keybindings.h
  4. 85
      juci/menu.cc
  5. 23
      juci/menu.h
  6. 0
      juci/notebook.cc
  7. 0
      juci/notebook.h
  8. 4
      juci/window.cc
  9. 3
      juci/window.h

1
juci/CMakeLists.txt

@ -63,7 +63,6 @@ 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

2
juci/juci.cc

@ -1,4 +1,4 @@
#include "juci.h"
#include "window.h"

6
juci/keybindings.h

@ -1,3 +1,7 @@
//juCi++ class that holds every keybinding.
#ifndef JUCI_KEYBINDINGS_H_
#define JUCI_KEYBINDINGS_H_
#include "iostream"
#include "gtkmm.h"
@ -50,3 +54,5 @@ namespace Keybindings {
};
}
#endif // JUCI_KEYBINDINGS_H_

85
juci/menu.cc

@ -1,25 +1,10 @@
#include "menu.h"
/***********************************/
/* MODEL */
/***********************************/
Menu::Model::Model() {
}
Menu::Model::~Model() {
}
// VIEW
Menu::View::View(Gtk::Orientation orientation) :
view_(orientation) {
}
}// view controller
Gtk::Box &Menu::View::view(
Glib::RefPtr<Gtk::UIManager> ui_manager) {
@ -27,19 +12,15 @@ Gtk::Box &Menu::View::view(
return view_;
}
Menu::View::~View() {
}
/***********************************/
/* CONTROLLER */
/***********************************/
// CONTROLLER
Menu::Controller::Controller(Keybindings::Controller keybindings) :
menu_view_(Gtk::ORIENTATION_VERTICAL),
menu_model_(),
keybindings_(keybindings) {
/* Add action to menues */
/* START file menu */
keybindings_.action_group_menu()->add(Gtk::Action::create("FileMenu", Gtk::Stock::FILE));
keybindings_.action_group_menu()->add(Gtk::Action::create("FileMenu",
Gtk::Stock::FILE));
/* File->New files */
keybindings_.action_group_menu()->add(Gtk::Action::create("FileNew", "New"));
keybindings_.action_group_menu()->add(Gtk::Action::create("FileNewStandard",
@ -47,63 +28,78 @@ Menu::Controller::Controller(Keybindings::Controller keybindings) :
[this]() {
OnFileNewEmptyfile();
});
keybindings_.action_group_menu()->add(Gtk::Action::create("FileNewCC", "New cc file"),
keybindings_.action_group_menu()->add(Gtk::Action::create("FileNewCC",
"New cc file"),
Gtk::AccelKey("<control><alt>c"),
[this]() {
OnFileNewCCFile();
});
keybindings_.action_group_menu()->add(Gtk::Action::create("FileNewH","New h file" ),
keybindings_.action_group_menu()->add(Gtk::Action::create("FileNewH",
"New h file"),
Gtk::AccelKey("<control><alt>h"),
[this]() {
OnFileNewHeaderFile();
});
/* File-> New files end */
keybindings_.action_group_menu()->add(Gtk::Action::create("FileOpenFile", Gtk::Stock::OPEN),
keybindings_.action_group_menu()->add(Gtk::Action::create("FileOpenFile",
Gtk::Stock::OPEN),
[this]() {
OnFileOpenFile();
});
keybindings_.action_group_menu()->add(Gtk::Action::create("FileOpenFolder", "Open folder"),
keybindings_.action_group_menu()->add(Gtk::Action::create("FileOpenFolder",
"Open folder"),
[this]() {
OnFileOpenFolder();
});
/* END file menu */
/* START edit menu */
keybindings_.action_group_menu()->add(Gtk::Action::create("EditMenu", Gtk::Stock::EDIT));
keybindings_.action_group_menu()->add(Gtk::Action::create("EditCopy", Gtk::Stock::COPY),
keybindings_.action_group_menu()->add(Gtk::Action::create("EditMenu",
Gtk::Stock::EDIT));
keybindings_.action_group_menu()->add(Gtk::Action::create("EditCopy",
Gtk::Stock::COPY),
[this]() {
OnEditCopy();
});
keybindings_.action_group_menu()->add(Gtk::Action::create("EditCut", Gtk::Stock::CUT),
keybindings_.action_group_menu()->add(Gtk::Action::create("EditCut",
Gtk::Stock::CUT),
[this]() {
OnEditCut();
});
keybindings_.action_group_menu()->add(Gtk::Action::create("EditPaste", Gtk::Stock::PASTE),
keybindings_.action_group_menu()->add(Gtk::Action::create("EditPaste",
Gtk::Stock::PASTE),
[this]() {
OnEditPaste();
});
keybindings_.action_group_menu()->add(Gtk::Action::create("EditFind", Gtk::Stock::FIND),
keybindings_.action_group_menu()->add(Gtk::Action::create("EditFind",
Gtk::Stock::FIND),
[this]() {
OnEditFind();
});
/* END edit menu */
/* START window menu */
keybindings_.action_group_menu()->add(Gtk::Action::create("WindowMenu", "_Window"));
keybindings_.action_group_menu()->add(Gtk::Action::create("WindowCloseTab", "Close tab"),
keybindings_.action_group_menu()->add(Gtk::Action::create("WindowMenu",
"_Window"));
keybindings_.action_group_menu()->add(Gtk::Action::create("WindowCloseTab",
"Close tab"),
Gtk::AccelKey("<control>w"),
[this]() {
OnWindowCloseTab();
});
keybindings_.action_group_menu()->add(Gtk::Action::create("WindowSplitWindow", "Split window"),
keybindings_.action_group_menu()->add(Gtk::Action::create("WindowSplitWindow",
"Split window"),
Gtk::AccelKey("<control><alt>S"),
[this]() {
OnWindowSplitWindow();
});
/* END window menu */
/* START Plugin menu */
keybindings_.action_group_menu()->add(Gtk::Action::create("PluginMenu", "_Plugins"));
keybindings_.action_group_menu()->add(Gtk::Action::create("PluginMenu",
"_Plugins"));
/*Plugin->snippet*/
keybindings_.action_group_menu()->add(Gtk::Action::create("PluginSnippet", "Snippet"));
keybindings_.action_group_menu()->add(Gtk::Action::create("PluginAddSnippet", "Add snippet"),
keybindings_.action_group_menu()->add(Gtk::Action::create("PluginSnippet",
"Snippet"));
keybindings_.action_group_menu()->add(Gtk::Action::create("PluginAddSnippet",
"Add snippet"),
Gtk::AccelKey("<alt>space"),
[this]() {
OnPluginAddSnippet();
@ -111,8 +107,10 @@ Menu::Controller::Controller(Keybindings::Controller keybindings) :
/* End snippet */
/* END plugin menu */
/* START help menu */
keybindings_.action_group_menu()->add(Gtk::Action::create("HelpMenu", Gtk::Stock::HELP));
keybindings_.action_group_menu()->add(Gtk::Action::create("HelpAbout", Gtk::Stock::ABOUT),
keybindings_.action_group_menu()->add(Gtk::Action::create("HelpMenu",
Gtk::Stock::HELP));
keybindings_.action_group_menu()->add(Gtk::Action::create("HelpAbout",
Gtk::Stock::ABOUT),
[this]() {
OnHelpAbout();
});
@ -123,8 +121,6 @@ Menu::Controller::Controller(Keybindings::Controller keybindings) :
[this]() {
OnHelpAbout();
});
keybindings_.BuildMenu();
keybindings_.BuildHiddenMenu();
@ -135,8 +131,6 @@ Menu::Controller::Controller(Keybindings::Controller keybindings) :
}
Menu::Controller::~Controller() {
}
Gtk::Box &Menu::Controller::view() {
return menu_view_.view(keybindings_.ui_manager_menu());
@ -158,7 +152,8 @@ void Menu::Controller::OnFileNewHeaderFile() {
}
void Menu::Controller::OnPluginAddSnippet() {
std::cout << "Add snipper" << std::endl; //TODO(Forgi add you snippet magic code)
//TODO(Forgi add you snippet magic code)
std::cout << "Add snipper" << std::endl;
juci_api::py::LoadPlugin("snippet");
}

23
juci/menu.h

@ -8,50 +8,29 @@
namespace Menu {
class Model {
public:
Model();
virtual ~Model();
std::string ui_string() {
return ui_string_;
}
private:
std::string ui_string_;
}; // class Model
class View {
public:
explicit View(Gtk::Orientation orient);
virtual ~View();
Gtk::Box &view(Glib::RefPtr<Gtk::UIManager> ui_manager);
protected:
Gtk::Box view_;
}; // class View
// controller
class Controller {
public:
explicit Controller(Keybindings::Controller keybindings);
virtual ~Controller();
Gtk::Box &view();
private:
Keybindings::Controller keybindings_;
View menu_view_;
Model menu_model_;
void OnFileNewEmptyfile();
/*Signal handlers*/
// Signal handlers
void OnFileNewCCFile();
void OnFileNewHeaderFile();

0
juci/notebook.cc

0
juci/notebook.h

4
juci/window.cc

@ -1,4 +1,4 @@
#include "juci.h"
#include "window.h"
Window::Window() :
window_box_(Gtk::ORIENTATION_VERTICAL),
@ -19,7 +19,7 @@ Window::Window() :
window_box_.pack_start(source().view());
show_all_children();
}
} // Window constructor
Source::Controller& Window::source() {
return source_;

3
juci/juci.h → juci/window.h

@ -1,4 +1,3 @@
//juCi++ main header file
#ifndef JUCI_JUCI_H_
#define JUCI_JUCI_H_
@ -19,7 +18,7 @@ private:
Source::Controller source_;
Gtk::Box window_box_;
/*signal handler*/
//signal handlers
void OnSystemQuit();
};
Loading…
Cancel
Save