mirror of https://gitlab.com/cppit/jucipp
8 changed files with 274 additions and 256 deletions
@ -1,9 +1,7 @@
|
||||
#include "juci.h" |
||||
|
||||
int main(int argc, char *argv[]) { |
||||
|
||||
Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "no.sout.juci"); |
||||
Window window; |
||||
|
||||
return app->run(window);; |
||||
Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "no.sout.juci"); |
||||
Window window; |
||||
return app->run(window);; |
||||
} |
||||
|
||||
@ -0,0 +1,21 @@
|
||||
#include "keybindings.h" |
||||
|
||||
|
||||
Keybindings::Controller::Controller() { |
||||
action_group_ = Gtk::ActionGroup::create(); |
||||
ui_manager_ = Gtk::UIManager::create(); |
||||
} |
||||
Keybindings::Controller::~Controller(){ |
||||
|
||||
} |
||||
void Keybindings::Controller::set_ui_manager_action_group(Glib::RefPtr<Gtk::ActionGroup> action_group) { |
||||
ui_manager_->insert_action_group(action_group); |
||||
} |
||||
void Keybindings::Controller::set_ui_manger_string(std::string ui_string) { |
||||
try { |
||||
ui_manager_->add_ui_from_string(ui_string); |
||||
} |
||||
catch (const Glib::Error &ex) { |
||||
std::cerr << "building menus failed: " << ex.what(); |
||||
} |
||||
} |
||||
@ -0,0 +1,28 @@
|
||||
#include "iostream" |
||||
#include "gtkmm.h" |
||||
|
||||
namespace Keybindings { |
||||
|
||||
class Controller { |
||||
public: |
||||
Controller(); |
||||
virtual ~Controller(); |
||||
|
||||
Glib::RefPtr<Gtk::ActionGroup> action_group() { |
||||
return action_group_; |
||||
}; |
||||
|
||||
Glib::RefPtr<Gtk::UIManager> ui_manager() { |
||||
return ui_manager_; |
||||
}; |
||||
void set_ui_manger_string(std::string ui_string); |
||||
|
||||
void set_ui_manager_action_group(Glib::RefPtr<Gtk::ActionGroup> action_group); |
||||
|
||||
|
||||
protected: |
||||
Glib::RefPtr<Gtk::UIManager> ui_manager_; |
||||
Glib::RefPtr<Gtk::ActionGroup> action_group_; |
||||
}; |
||||
|
||||
} |
||||
@ -1,90 +1,69 @@
|
||||
#include <iostream> |
||||
#include "gtkmm.h" |
||||
#include "keybindings.h" |
||||
namespace Menu { |
||||
class Model { |
||||
public: |
||||
Model(); |
||||
Model(); |
||||
|
||||
virtual~Model(); |
||||
virtual~Model(); |
||||
|
||||
std::string ui_string() { |
||||
return ui_string_; |
||||
}; |
||||
std::string ui_string() { |
||||
return ui_string_; |
||||
}; |
||||
private: |
||||
std::string ui_string_; |
||||
std::string ui_string_; |
||||
}; |
||||
|
||||
|
||||
class View { |
||||
public: |
||||
View(Gtk::Orientation orient); |
||||
|
||||
virtual ~View(); |
||||
|
||||
Gtk::Box &view(); |
||||
|
||||
Glib::RefPtr <Gtk::ActionGroup> action_group() { |
||||
return action_group_; |
||||
}; |
||||
|
||||
Glib::RefPtr <Gtk::UIManager> ui_manager() { |
||||
return ui_manager_; |
||||
}; |
||||
|
||||
void set_ui_manger_string(std::string ui_string); |
||||
|
||||
void set_ui_manager_action_group(Glib::RefPtr <Gtk::ActionGroup> action_group); |
||||
View(Gtk::Orientation orient); |
||||
virtual ~View(); |
||||
Gtk::Box &view(Glib::RefPtr<Gtk::UIManager> ui_manager); |
||||
|
||||
protected: |
||||
Gtk::Box view_; |
||||
Glib::RefPtr <Gtk::UIManager> ui_manager_; |
||||
Glib::RefPtr <Gtk::ActionGroup> action_group_; |
||||
Gtk::Box view_; |
||||
|
||||
}; |
||||
|
||||
class Controller { |
||||
public: |
||||
Controller(); |
||||
|
||||
virtual ~Controller(); |
||||
|
||||
Gtk::Box &view(); |
||||
|
||||
Glib::RefPtr <Gtk::UIManager> ui_manager() { |
||||
return menu_view_.ui_manager(); |
||||
}; |
||||
|
||||
Controller(Keybindings::Controller keybindings); |
||||
virtual ~Controller(); |
||||
Gtk::Box &view(); |
||||
private: |
||||
Menu::View menu_view_; |
||||
Menu::Model menu_model_; |
||||
Keybindings::Controller keybindings_; |
||||
Menu::View menu_view_; |
||||
Menu::Model menu_model_; |
||||
|
||||
/*Signal handlers*/ |
||||
void onFileNewEmptyfile(); |
||||
/*Signal handlers*/ |
||||
void OnFileNewEmptyfile(); |
||||
|
||||
void onFileNewCCFile(); |
||||
void OnFileNewCCFile(); |
||||
|
||||
void onFileNewHeaderFile(); |
||||
void OnFileNewHeaderFile(); |
||||
|
||||
void onFileOpenFile(); |
||||
void OnFileOpenFile(); |
||||
|
||||
void onFileOpenFolder(); |
||||
void OnFileOpenFolder(); |
||||
|
||||
void onSystemQuit(); |
||||
void OnSystemQuit(); |
||||
|
||||
void onPluginAddSnippet(); |
||||
void OnPluginAddSnippet(); |
||||
|
||||
void onWindowCloseTab(); |
||||
void OnWindowCloseTab(); |
||||
|
||||
void onEditCopy(); |
||||
void OnEditCopy(); |
||||
|
||||
void onEditCut(); |
||||
void OnEditCut(); |
||||
|
||||
void onEditPaste(); |
||||
void OnEditPaste(); |
||||
|
||||
void onEditFind(); |
||||
void OnEditFind(); |
||||
|
||||
void onWindowSplitWindow(); |
||||
void OnWindowSplitWindow(); |
||||
|
||||
void onHelpAbout(); |
||||
void OnHelpAbout(); |
||||
|
||||
}; |
||||
} |
||||
Loading…
Reference in new issue