1 /* GTK - The GIMP Toolkit 2 * Copyright (C) 2008 Tristan Van Berkom <tristan.van.berkom@gmail.com> 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Library General Public 6 * License as published by the Free Software Foundation; either 7 * version 2 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Library General Public License for more details. 13 * 14 * You should have received a copy of the GNU Library General Public 15 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18 #ifndef __GTK_ACTIVATABLE_H__ 19 #define __GTK_ACTIVATABLE_H__ 20 21 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) 22 #error "Only <gtk/gtk.h> can be included directly." 23 #endif 24 25 #include <gtk/deprecated/gtkaction.h> 26 27 G_BEGIN_DECLS 28 29 #define GTK_TYPE_ACTIVATABLE (gtk_activatable_get_type ()) 30 #define GTK_ACTIVATABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ACTIVATABLE, GtkActivatable)) 31 #define GTK_ACTIVATABLE_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), GTK_TYPE_ACTIVATABLE, GtkActivatableIface)) 32 #define GTK_IS_ACTIVATABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ACTIVATABLE)) 33 #define GTK_ACTIVATABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_ACTIVATABLE, GtkActivatableIface)) 34 35 36 typedef struct _GtkActivatable GtkActivatable; /* Dummy typedef */ 37 typedef struct _GtkActivatableIface GtkActivatableIface; 38 39 40 /** 41 * GtkActivatableIface: 42 * @update: Called to update the activatable when its related action’s properties change. 43 * You must check the #GtkActivatable:use-action-appearance property only apply action 44 * properties that are meant to effect the appearance accordingly. 45 * @sync_action_properties: Called to update the activatable completely, this is called internally when 46 * #GtkActivatable:related-action property is set or unset and by the implementor when 47 * #GtkActivatable:use-action-appearance changes. 48 * 49 * > This method can be called with a %NULL action at times. 50 * 51 * Since: 2.16 52 * 53 * Deprecated: 3.10 54 */ 55 56 struct _GtkActivatableIface 57 { 58 /*< private >*/ 59 GTypeInterface g_iface; 60 61 /*< public >*/ 62 63 /* virtual table */ 64 void (* update) (GtkActivatable *activatable, 65 GtkAction *action, 66 const gchar *property_name); 67 void (* sync_action_properties) (GtkActivatable *activatable, 68 GtkAction *action); 69 }; 70 71 72 GDK_DEPRECATED_IN_3_10 73 GType gtk_activatable_get_type (void) G_GNUC_CONST; 74 75 GDK_DEPRECATED_IN_3_10 76 void gtk_activatable_sync_action_properties (GtkActivatable *activatable, 77 GtkAction *action); 78 79 GDK_DEPRECATED_IN_3_10 80 void gtk_activatable_set_related_action (GtkActivatable *activatable, 81 GtkAction *action); 82 GDK_DEPRECATED_IN_3_10 83 GtkAction *gtk_activatable_get_related_action (GtkActivatable *activatable); 84 85 GDK_DEPRECATED_IN_3_10 86 void gtk_activatable_set_use_action_appearance (GtkActivatable *activatable, 87 gboolean use_appearance); 88 GDK_DEPRECATED_IN_3_10 89 gboolean gtk_activatable_get_use_action_appearance (GtkActivatable *activatable); 90 91 /* For use in activatable implementations */ 92 GDK_DEPRECATED_IN_3_10 93 void gtk_activatable_do_set_related_action (GtkActivatable *activatable, 94 GtkAction *action); 95 96 G_END_DECLS 97 98 #endif /* __GTK_ACTIVATABLE_H__ */ 99