2007-06-18 03:40:41 +00:00
|
|
|
/*
|
2021-10-18 20:22:31 +00:00
|
|
|
* This file Copyright (C) 2007-2021 Mnemosyne LLC
|
2007-06-18 03:40:41 +00:00
|
|
|
*
|
2014-01-21 03:10:30 +00:00
|
|
|
* It may be used under the GNU GPL versions 2 or 3
|
2014-01-19 01:09:44 +00:00
|
|
|
* or any future license endorsed by Mnemosyne LLC.
|
2008-09-23 19:11:04 +00:00
|
|
|
*
|
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
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
#include <gtkmm.h>
|
|
|
|
|
2021-11-12 09:12:50 +00:00
|
|
|
#include "Utils.h"
|
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
class Session;
|
2007-06-18 03:40:41 +00:00
|
|
|
|
2017-04-19 12:04:45 +00:00
|
|
|
#define WINDOW_ICON "transmission-main-window-icon"
|
|
|
|
#define TRAY_ICON "transmission-tray-icon"
|
|
|
|
#define NOTIFICATION_ICON "transmission-notification-icon"
|
2010-01-21 20:51:48 +00:00
|
|
|
|
2021-11-12 09:12:50 +00:00
|
|
|
Glib::RefPtr<Gio::SimpleActionGroup> gtr_actions_init(Glib::RefPtr<Gtk::Builder> const& builder, void* callback_user_data);
|
2021-11-01 00:11:23 +00:00
|
|
|
void gtr_actions_set_core(Glib::RefPtr<Session> const& core);
|
2021-10-18 20:22:31 +00:00
|
|
|
void gtr_actions_handler(Glib::ustring const& action_name, void* user_data);
|
|
|
|
|
|
|
|
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
|
|
|
Gtk::Widget* gtr_action_get_widget(Glib::ustring const& name);
|
|
|
|
Glib::RefPtr<Glib::Object> gtr_action_get_object(Glib::ustring const& name);
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
inline T* gtr_action_get_widget(Glib::ustring const& name)
|
|
|
|
{
|
|
|
|
return static_cast<T*>(gtr_action_get_widget(name));
|
|
|
|
}
|
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
|
|
|
}
|