Context for the "About" label
[inkscape.git] / src / ui / dialog / startup.h
blob50382cfb2a8dfc5ad67ee777bfc1133dc9b18f7e
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /** @file
3 * @brief A dialog for the start screen
4 */
5 /*
6 * Copyright (C) Martin Owens 2020 <doctormo@gmail.com>
8 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
9 */
11 #ifndef STARTSCREEN_H
12 #define STARTSCREEN_H
14 #include <string> // for string
15 #include <gdk/gdk.h> // for GdkModifierType
16 #include <glibmm/refptr.h> // for RefPtr
17 #include <glibmm/ustring.h> // for ustring
18 #include <gtk/gtk.h> // for GtkEventControllerKey
19 #include <gtkmm/dialog.h> // for Dialog
20 #include <gtkmm/treemodel.h> // for TreeModel
21 #include <sigc++/scoped_connection.h>
23 #include "ui/widget/template-list.h"
25 namespace Gtk {
26 class Builder;
27 class Button;
28 class ComboBox;
29 class Notebook;
30 class Overlay;
31 class TreeView;
32 class Widget;
33 } // namespace Gtk
35 class SPDocument;
37 namespace Inkscape::UI::Dialog {
39 class StartScreen : public Gtk::Dialog {
40 public:
41 StartScreen();
42 ~StartScreen() override;
44 SPDocument* get_document() { return _document; }
46 protected:
47 void on_response(int response_id) override;
49 private:
50 void notebook_next(Gtk::Widget *button);
51 bool on_key_pressed(unsigned keyval, unsigned keycode, Gdk::ModifierType state);
52 Gtk::TreeModel::Row active_combo(std::string widget_name);
53 void set_active_combo(std::string widget_name, std::string unique_id);
54 void show_toggle();
55 void refresh_keys_warning();
56 void enlist_recent_files();
57 void enlist_keys();
58 void filter_themes();
59 void keyboard_changed();
60 void notebook_switch(Gtk::Widget *tab, unsigned page_num);
62 void theme_changed();
63 void canvas_changed();
64 void refresh_theme(Glib::ustring theme_name);
65 void refresh_dark_switch();
67 void new_document();
68 void load_document();
69 void on_recent_changed();
70 void on_kind_changed(const Glib::ustring& name);
72 Glib::RefPtr<Gtk::Builder> builder;
73 Gtk::Notebook &tabs;
74 Gtk::Overlay &banners;
75 Gtk::ComboBox &themes;
76 Gtk::TreeView &recent_treeview;
77 Gtk::Button &load_btn;
78 Inkscape::UI::Widget::TemplateList templates;
79 Gtk::Notebook& _kinds;
81 SPDocument* _document = nullptr;
82 sigc::scoped_connection _tabs_switch_page_conn;
83 sigc::scoped_connection _templates_switch_page_conn;
86 } // namespace Inkscape::UI::Dialog
88 #endif // STARTSCREEN_H
91 Local Variables:
92 mode:c++
93 c-file-style:"stroustrup"
94 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
95 indent-tabs-mode:nil
96 fill-column:99
97 End:
99 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :