From cca66b9ec4e494c1d919bff0f71a820d8afab1fa Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:24:48 +0200 Subject: Adding upstream version 1.2.2. Signed-off-by: Daniel Baumann --- src/ui/dialog/dialog-window.h | 78 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 src/ui/dialog/dialog-window.h (limited to 'src/ui/dialog/dialog-window.h') diff --git a/src/ui/dialog/dialog-window.h b/src/ui/dialog/dialog-window.h new file mode 100644 index 0000000..56d9247 --- /dev/null +++ b/src/ui/dialog/dialog-window.h @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#ifndef INKSCAPE_UI_DIALOG_WINDOW_H +#define INKSCAPE_UI_DIALOG_WINDOW_H + +/** @file + * @brief A window for floating docks. + * + * Authors: see git history + * Tavmjong Bah + * + * Copyright (c) 2018 Tavmjong Bah, Authors + * + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + +#include +#include +#include + +#include "inkscape-application.h" + +using Gtk::Label; +using Gtk::Widget; + +class InkscapeWindow; + +namespace Inkscape { +namespace UI { +namespace Dialog { + +class DialogContainer; +class DialogMultipaned; + +/** + * DialogWindow holds DialogContainer instances for undocked dialogs. + * + * It watches the last active InkscapeWindow and updates its inner dialogs, if any. + */ +class DialogWindow : public Gtk::Window +{ +public: + DialogWindow(InkscapeWindow* window, Gtk::Widget *page = nullptr); + ~DialogWindow() override; + + void set_inkscape_window(InkscapeWindow *window); + InkscapeWindow* get_inkscape_window() { return _inkscape_window; } + void update_dialogs(); + void update_window_size_to_fit_children(); + + // Getters + DialogContainer *get_container() { return _container; } + +private: + bool on_key_press_event(GdkEventKey* key_event) override; + + InkscapeApplication *_app = nullptr; + InkscapeWindow *_inkscape_window = nullptr; // The Inkscape window that dialog window is attached to, changes when mouse moves into new Inkscape window. + DialogContainer *_container = nullptr; + Glib::ustring _title; +}; + +} // namespace Dialog +} // namespace UI +} // namespace Inkscape + +#endif // INKSCAPE_UI_DIALOG_WINDOW_H + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : -- cgit v1.2.3