1 /* GIMP - The GNU Image Manipulation Program 2 * Copyright (C) 1995 Spencer Kimball and Peter Mattis 3 * 4 * gimpaction.h 5 * Copyright (C) 2004-2019 Michael Natterer <mitch@gimp.org> 6 * 7 * This program is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program. If not, see <https://www.gnu.org/licenses/>. 19 */ 20 21 #ifndef __GIMP_ACTION_H__ 22 #define __GIMP_ACTION_H__ 23 24 25 #define GIMP_TYPE_ACTION (gimp_action_get_type ()) 26 #define GIMP_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_ACTION, GimpAction)) 27 #define GIMP_IS_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_ACTION)) 28 #define GIMP_ACTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE((obj), GIMP_TYPE_ACTION, GimpActionInterface)) 29 30 31 typedef struct _GimpActionInterface GimpActionInterface; 32 33 struct _GimpActionInterface 34 { 35 GTypeInterface base_interface; 36 37 void (* activate) (GimpAction *action, 38 GVariant *value); 39 void (* change_state) (GimpAction *action, 40 GVariant *value); 41 }; 42 43 44 GType gimp_action_get_type (void) G_GNUC_CONST; 45 46 void gimp_action_init (GimpAction *action); 47 48 void gimp_action_emit_activate (GimpAction *action, 49 GVariant *value); 50 void gimp_action_emit_change_state (GimpAction *action, 51 GVariant *value); 52 53 void gimp_action_set_proxy (GimpAction *action, 54 GtkWidget *proxy); 55 56 const gchar * gimp_action_get_name (GimpAction *action); 57 58 void gimp_action_set_label (GimpAction *action, 59 const gchar *label); 60 const gchar * gimp_action_get_label (GimpAction *action); 61 62 void gimp_action_set_tooltip (GimpAction *action, 63 const gchar *tooltip); 64 const gchar * gimp_action_get_tooltip (GimpAction *action); 65 66 void gimp_action_set_icon_name (GimpAction *action, 67 const gchar *icon_name); 68 const gchar * gimp_action_get_icon_name (GimpAction *action); 69 70 void gimp_action_set_gicon (GimpAction *action, 71 GIcon *icon); 72 GIcon * gimp_action_get_gicon (GimpAction *action); 73 74 void gimp_action_set_help_id (GimpAction *action, 75 const gchar *help_id); 76 const gchar * gimp_action_get_help_id (GimpAction *action); 77 78 void gimp_action_set_visible (GimpAction *action, 79 gboolean visible); 80 gboolean gimp_action_get_visible (GimpAction *action); 81 gboolean gimp_action_is_visible (GimpAction *action); 82 83 void gimp_action_set_sensitive (GimpAction *action, 84 gboolean sensitive); 85 gboolean gimp_action_get_sensitive (GimpAction *action); 86 gboolean gimp_action_is_sensitive (GimpAction *action); 87 88 GClosure * gimp_action_get_accel_closure (GimpAction *action); 89 90 void gimp_action_set_accel_path (GimpAction *action, 91 const gchar *accel_path); 92 const gchar * gimp_action_get_accel_path (GimpAction *action); 93 94 void gimp_action_set_accel_group (GimpAction *action, 95 GtkAccelGroup *accel_group); 96 void gimp_action_connect_accelerator (GimpAction *action); 97 98 GSList * gimp_action_get_proxies (GimpAction *action); 99 100 void gimp_action_activate (GimpAction *action); 101 102 gint gimp_action_name_compare (GimpAction *action1, 103 GimpAction *action2); 104 105 gboolean gimp_action_is_gui_blacklisted (const gchar *action_name); 106 107 108 #endif /* __GIMP_ACTION_H__ */ 109