Fix view space
parent
3fa80619d3
commit
d58455d2d7
|
@ -1,9 +1,11 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <gtkmm.h>
|
#include <gtkmm.h>
|
||||||
|
#include <sirEdit/data/serialize.hpp>
|
||||||
|
|
||||||
namespace sirEdit {
|
namespace sirEdit {
|
||||||
extern Gtk::Application* mainApplication;
|
extern Gtk::Application* mainApplication;
|
||||||
|
extern sirEdit::data::HistoricalView* views;
|
||||||
|
|
||||||
extern void loadFile(Gtk::Window* window, Gtk::FileChooserNative* chooser);
|
extern void loadFile(Gtk::Window* window, Gtk::FileChooserNative* chooser);
|
||||||
extern void runInGui(std::function<void()> func);
|
extern void runInGui(std::function<void()> func);
|
||||||
|
|
|
@ -6,13 +6,14 @@
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
using namespace sirEdit;
|
||||||
|
|
||||||
|
|
||||||
// INFO: Hack to to protect crashes after main program
|
// INFO: Hack to to protect crashes after main program
|
||||||
static Glib::RefPtr<Gtk::Builder>* _mainWindowBuild = new Glib::RefPtr<Gtk::Builder>();
|
static Glib::RefPtr<Gtk::Builder>* _mainWindowBuild = new Glib::RefPtr<Gtk::Builder>();
|
||||||
static Glib::RefPtr<Gtk::Builder>& mainWindowBuild = *_mainWindowBuild;
|
static Glib::RefPtr<Gtk::Builder>& mainWindowBuild = *_mainWindowBuild;
|
||||||
|
|
||||||
static sirEdit::data::HistoricalView* views;
|
|
||||||
static unordered_map<string, int> tabs;
|
static unordered_map<string, int> tabs;
|
||||||
|
|
||||||
extern void sirEdit::gui::openMainWindow(shared_ptr<sirEdit::data::Serializer> serializer, Glib::RefPtr<Gio::File> file) {
|
extern void sirEdit::gui::openMainWindow(shared_ptr<sirEdit::data::Serializer> serializer, Glib::RefPtr<Gio::File> file) {
|
||||||
|
|
|
@ -9,11 +9,14 @@
|
||||||
|
|
||||||
#include "gui/startupWindow.hpp"
|
#include "gui/startupWindow.hpp"
|
||||||
|
|
||||||
|
#include <sirEdit/data/serialize.hpp>
|
||||||
|
|
||||||
using namespace sir::api;
|
using namespace sir::api;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace sirEdit {
|
namespace sirEdit {
|
||||||
Gtk::Application* mainApplication;
|
Gtk::Application* mainApplication;
|
||||||
|
sirEdit::data::HistoricalView* views = nullptr;
|
||||||
static Glib::Dispatcher* dispatcher;
|
static Glib::Dispatcher* dispatcher;
|
||||||
static list<std::function<void()>> dispatcher_funcs;
|
static list<std::function<void()>> dispatcher_funcs;
|
||||||
static mutex dispatcher_mutex;
|
static mutex dispatcher_mutex;
|
||||||
|
@ -61,7 +64,10 @@ int main(int args, char** argv) {
|
||||||
});
|
});
|
||||||
sirEdit::gui::runStartupWindow();
|
sirEdit::gui::runStartupWindow();
|
||||||
});
|
});
|
||||||
return application->run(args, argv);
|
auto reuslt = application->run(args, argv);
|
||||||
|
if(sirEdit::views != nullptr)
|
||||||
|
delete sirEdit::views;
|
||||||
|
return reuslt;
|
||||||
|
|
||||||
// GTK startup
|
// GTK startup
|
||||||
//Gtk::Main gtkMain(args, argv);
|
//Gtk::Main gtkMain(args, argv);
|
||||||
|
|
Loading…
Reference in New Issue