| 1 |
/* Copyright (C) 2009 The gtkmm Development Team |
| 2 |
* |
| 3 |
* This library is free software; you can redistribute it and/or |
| 4 |
* modify it under the terms of the GNU Lesser General Public |
| 5 |
* License as published by the Free Software Foundation; either |
| 6 |
* version 2.1 of the License, or (at your option) any later version. |
| 7 |
* |
| 8 |
* This library is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 |
* Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public |
| 14 |
* License along with this library; if not, see <https://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
#include <gtkmm/action.h> |
| 18 |
#include <glibmm/interface.h> |
| 19 |
_DEFS(gtkmm,gtk) |
| 20 |
_PINCLUDE(glibmm/private/interface_p.h) |
| 21 |
|
| 22 |
#m4 _PUSH(SECTION_CC_PRE_INCLUDES) |
| 23 |
#undef GTK_DISABLE_DEPRECATED |
| 24 |
#define GDK_DISABLE_DEPRECATION_WARNINGS 1 |
| 25 |
#m4 _POP() |
| 26 |
|
| 27 |
//TODO: Do this when we can stop using this as a base class elsewhere, when we break ABI: |
| 28 |
//_IS_DEPRECATED // This whole file is deprecated. |
| 29 |
|
| 30 |
#ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 31 |
extern "C" |
| 32 |
{ |
| 33 |
typedef struct _GtkActivatableIface GtkActivatableIface; |
| 34 |
} |
| 35 |
#endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 36 |
|
| 37 |
namespace Gtk |
| 38 |
{ |
| 39 |
|
| 40 |
/** %Activatable widgets can be connected to a Gtk::Action and reflect the state |
| 41 |
* of the action. An %Activatable can also provide feedback through its action, |
| 42 |
* as it is responsible for activating the related action. |
| 43 |
* |
| 44 |
* @newin{2,16} |
| 45 |
* |
| 46 |
* @deprecated Use Gio::Action instead of Gtk::Action. |
| 47 |
* Gtk::Actionable is roughly a replacement for %Gtk::Activatable. |
| 48 |
*/ |
| 49 |
class GTKMM_API Activatable : public Glib::Interface |
| 50 |
{ |
| 51 |
_CLASS_INTERFACE(Activatable, GtkActivatable, GTK_ACTIVATABLE, GtkActivatableIface, , , GTKMM_API) |
| 52 |
|
| 53 |
public: |
| 54 |
_WRAP_METHOD(void do_set_related_action(const Glib::RefPtr<Action>& action), gtk_activatable_do_set_related_action, |
| 55 |
deprecated "There is no corresponding replacement when using Gio::Action.") |
| 56 |
_WRAP_METHOD(Glib::RefPtr<Action> get_related_action(), gtk_activatable_get_related_action, refreturn, |
| 57 |
deprecated "Use Gtk::Actionable::get_action_name() on Gtk::Actionable widgets instead.") |
| 58 |
_WRAP_METHOD(Glib::RefPtr<const Action> get_related_action() const, gtk_activatable_get_related_action, refreturn, constversion, |
| 59 |
deprecated "Use Gtk::Actionable::get_action_name() on Gtk::Actionable widgets instead.") |
| 60 |
_WRAP_METHOD(bool get_use_action_appearance() const, gtk_activatable_get_use_action_appearance, |
| 61 |
deprecated "There is no corresponding replacement when using Gio::Action.") |
| 62 |
_WRAP_METHOD(void sync_action_properties(const Glib::RefPtr<Action>& action), gtk_activatable_sync_action_properties, |
| 63 |
deprecated "There is no corresponding replacement when using Gio::Action.") |
| 64 |
_WRAP_METHOD(void set_related_action(const Glib::RefPtr<Action>& action), gtk_activatable_set_related_action, |
| 65 |
deprecated "Use Gtk::Actionable::set_action_name() on Gtk::Actionable widgets instead.") |
| 66 |
_WRAP_METHOD(void set_use_action_appearance(bool use_appearance = true), gtk_activatable_set_use_action_appearance, |
| 67 |
deprecated "There is no corresponding replacement when using Gio::Action.") |
| 68 |
|
| 69 |
_WRAP_PROPERTY("related-action", Glib::RefPtr<Action>, |
| 70 |
deprecated "Use Gtk::Actionable::property_action_name() on Gtk::Actionable widgets instead.") |
| 71 |
_WRAP_PROPERTY("use-action-appearance", bool, |
| 72 |
deprecated "There is no corresponding replacement when using Gio::Action.") |
| 73 |
|
| 74 |
#m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING) |
| 75 |
#m4 _CONVERSION(`GtkAction*',`const Glib::RefPtr<Action>&',`Glib::wrap($3, true)') |
| 76 |
_WRAP_VFUNC(void update(const Glib::RefPtr<Action>& action, const Glib::ustring& property_name), update) |
| 77 |
_WRAP_VFUNC(void sync_action_properties(const Glib::RefPtr<Action>& action), sync_action_properties) |
| 78 |
}; |
| 79 |
|
| 80 |
} // namespace Gtk |