2022-01-20 18:27:56 +00:00
|
|
|
// This file Copyright © 2007-2022 Mnemosyne LLC.
|
2022-08-08 18:05:39 +00:00
|
|
|
// It may be used under GPLv2 (SPDX: GPL-2.0-only), GPLv3 (SPDX: GPL-3.0-only),
|
2022-01-20 18:27:56 +00:00
|
|
|
// or any future license endorsed by Mnemosyne LLC.
|
|
|
|
// License text can be found in the licenses/ folder.
|
2007-06-18 03:40:41 +00:00
|
|
|
|
2016-03-29 16:37:21 +00:00
|
|
|
#pragma once
|
2007-06-18 03:40:41 +00:00
|
|
|
|
2022-12-29 02:42:20 +00:00
|
|
|
#include "GtkCompat.h"
|
2021-11-12 09:12:50 +00:00
|
|
|
#include "Utils.h"
|
|
|
|
|
2022-12-27 01:43:20 +00:00
|
|
|
#include <giomm/listmodel.h>
|
|
|
|
#include <giomm/menumodel.h>
|
|
|
|
#include <giomm/simpleactiongroup.h>
|
|
|
|
#include <glibmm/object.h>
|
|
|
|
#include <glibmm/refptr.h>
|
|
|
|
#include <glibmm/ustring.h>
|
|
|
|
#include <gtkmm/builder.h>
|
2022-12-26 21:13:21 +00:00
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
class Session;
|
2007-06-18 03:40:41 +00:00
|
|
|
|
2022-08-27 00:45:46 +00:00
|
|
|
Glib::RefPtr<Gio::SimpleActionGroup> gtr_actions_init(Glib::RefPtr<Gtk::Builder> const& builder, gpointer callback_user_data);
|
2021-11-01 00:11:23 +00:00
|
|
|
void gtr_actions_set_core(Glib::RefPtr<Session> const& core);
|
2021-12-14 08:43:27 +00:00
|
|
|
void gtr_actions_handler(Glib::ustring const& action_name, gpointer user_data);
|
2021-10-18 20:22:31 +00:00
|
|
|
|
|
|
|
void gtr_action_activate(Glib::ustring const& action_name);
|
|
|
|
void gtr_action_set_sensitive(Glib::ustring const& action_name, bool is_sensitive);
|
|
|
|
void gtr_action_set_toggled(Glib::ustring const& action_name, bool is_toggled);
|
2021-11-12 09:12:50 +00:00
|
|
|
Glib::RefPtr<Glib::Object> gtr_action_get_object(Glib::ustring const& name);
|
|
|
|
|
2022-10-08 22:50:03 +00:00
|
|
|
#if GTKMM_CHECK_VERSION(4, 0, 0)
|
|
|
|
Glib::RefPtr<Gio::ListModel> gtr_shortcuts_get_from_menu(Glib::RefPtr<Gio::MenuModel> const& menu);
|
|
|
|
#endif
|
2010-01-21 20:51:48 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
template<typename T>
|
2021-11-12 09:12:50 +00:00
|
|
|
inline Glib::RefPtr<T> gtr_action_get_object(Glib::ustring const& name)
|
2021-10-18 20:22:31 +00:00
|
|
|
{
|
2021-11-12 09:12:50 +00:00
|
|
|
return gtr_ptr_static_cast<T>(gtr_action_get_object(name));
|
2021-10-18 20:22:31 +00:00
|
|
|
}
|