Selaa lähdekoodia

Initial skeleton

Bernardo Magri 3 kuukautta sitten
sitoutus
66f0bcecb6
5 muutettua tiedostoa jossa 59 lisäystä ja 0 poistoa
  1. 12 0
      meson.build
  2. 20 0
      shell.nix
  3. 7 0
      src/main.cpp
  4. 6 0
      src/mainwindow.cpp
  5. 14 0
      src/mainwindow.hpp

+ 12 - 0
meson.build

@@ -0,0 +1,12 @@
+project('bibliotheca', 'cpp',
+  version : '0.1.0',
+  default_options : ['cpp_std=c++17'])
+
+gtkmm_dep = dependency('gtkmm-4.0')
+
+src = ['src/main.cpp', 'src/mainwindow.cpp']
+
+executable('bibliotheca',
+  src,
+  dependencies : gtkmm_dep,
+  install : true)

+ 20 - 0
shell.nix

@@ -0,0 +1,20 @@
+# shell.nix
+{ pkgs ? import <nixpkgs> {} }:
+
+pkgs.mkShell {
+  buildInputs = [
+    pkgs.gcc
+    pkgs.pkg-config
+    pkgs.meson
+    pkgs.ninja
+    pkgs.gtkmm4
+  ];
+
+  # --- New Code Starts Here ---
+  # This hook runs when you enter the shell.
+  # It sets an environment variable telling GTK where to find its schemas.
+  shellHook = ''
+    export GSETTINGS_SCHEMA_PATH=${pkgs.gtk4}/share/glib-2.0/schemas
+  '';
+  # --- New Code Ends Here ---
+}

+ 7 - 0
src/main.cpp

@@ -0,0 +1,7 @@
+#include <gtkmm.h>
+#include "mainwindow.hpp"
+
+int main(int argc, char* argv[]) {
+  auto app = Gtk::Application::create("com.example.bibliotheca");
+  return app->make_window_and_run<MainWindow>(argc, argv);
+}

+ 6 - 0
src/mainwindow.cpp

@@ -0,0 +1,6 @@
+#include "mainwindow.hpp"
+
+MainWindow::MainWindow() {
+	set_title("Basic application");
+	set_default_size(800, 600);
+}

+ 14 - 0
src/mainwindow.hpp

@@ -0,0 +1,14 @@
+#pragma once
+
+#include <gtkmm.h>
+
+class MainWindow : public Gtk::Window {
+
+public:
+	MainWindow();
+
+private:
+	
+
+};
+