AutoCatGnome/gtkpp/Window.h

39 lines
951 B
C++

//
// Created by selim on 10.05.2022.
//
#ifndef AUTOCAT_GNOME_WINDOW_H
#define AUTOCAT_GNOME_WINDOW_H
#include "Application.h"
#include <adwaita.h>
#include <memory>
namespace gtkpp {
class Window {
protected:
GtkBuilder* _builder;
GtkWindow* _window;
std::weak_ptr<Application> _app;
private:
friend bool operator==(const Window& wnd1, const Window& wnd2);
public:
Window();
Window(std::shared_ptr<Application> app, bool isAppWindow);
Window(std::shared_ptr<Application> app, const char* resourceName, const char* id);
void show();
void hide();
void setTitle(const std::string& title);
void setDefaultSize(int width, int height);
[[nodiscard]] GtkWindow* gobj() const;
[[nodiscard]] std::shared_ptr<Application> application() const;
};
using WindowPtr = std::shared_ptr<Window>;
}
#endif //AUTOCAT_GNOME_WINDOW_H