diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 52 |
1 files changed, 44 insertions, 8 deletions
diff --git a/src/main.cpp b/src/main.cpp index e085836..d83fd27 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,13 +1,49 @@ -#include <gtkmm.h> +#include "../include/Window.hpp" +#include <gtkmm/application.h> +#include <gtkmm/cssprovider.h> +#include <odhtdb/Database.hpp> -int main(int argc, char *argv[]) +int main (int argc, char *argv[]) { - auto app = - Gtk::Application::create(argc, argv, - "org.gtkmm.examples.base"); + auto app = Gtk::Application::create(argc, argv, "dec05eba.dchat"); - Gtk::Window window; - window.set_default_size(200, 200); + auto css = Gtk::CssProvider::create(); + try + { + if(!css->load_from_path("css/style.css")) + { + fprintf(stderr, "Failed to load css/style.css"); + return 1; + } + } + catch(Gtk::CssProviderError &e) + { + fprintf(stderr, "Failed to load css/style.css, error: %s\n", e.what().c_str()); + return 1; + } - return app->run(window); + dchat::Window window; + auto ctx = window.get_style_context(); + auto screen = Gdk::Screen::get_default(); + ctx->add_provider_for_screen(screen, css, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + + odhtdb::DatabaseCallbackFuncs callbackFuncs; + callbackFuncs.createNodeCallbackFunc = [](const odhtdb::DatabaseCreateNodeRequest &request) + { + + }; + + callbackFuncs.addNodeCallbackFunc = [](const odhtdb::DatabaseAddNodeRequest &request) + { + + }; + + callbackFuncs.addUserCallbackFunc = [](const odhtdb::DatabaseAddUserRequest &request) + { + + }; + + //odhtdb::Database database("206.189.13.66", 27130, "/tmp/dchat_gtk", callbackFuncs); + + return app->run(window); } |