1 /* gEDA - GPL Electronic Design Automation
2 * gschem - gEDA Schematic Capture
3 * Copyright (C) 1998-2010 Ales Hvezda
4 * Copyright (C) 1998-2020 gEDA Contributors (see ChangeLog for details)
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef GSCHEM_ACTION_H
22 #define GSCHEM_ACTION_H
24 #define GSCHEM_ACTION(obj) ((GschemAction *) (obj))
27 GSCHEM_ACTION_TYPE_ACTUATE
,
28 GSCHEM_ACTION_TYPE_TOGGLE_PLAIN
,
29 GSCHEM_ACTION_TYPE_TOGGLE_CHECK
,
30 GSCHEM_ACTION_TYPE_TOGGLE_RADIO
33 typedef struct _GschemAction GschemAction
;
35 struct _GschemAction
{
42 GschemActionType type
;
44 void (*activate
) (GschemAction
*action
,
45 GschemToplevel
*w_current
);
48 SCM smob
; /* not owned */
52 int scm_is_action (SCM x
);
53 GschemAction
*scm_to_action (SCM smob
);
55 void gschem_action_activate (GschemAction
*action
,
56 GschemToplevel
*w_current
);
58 GtkWidget
*gschem_action_create_menu_item (GschemAction
*action
,
59 gboolean use_menu_label
,
60 GschemToplevel
*w_current
);
61 GtkToolItem
*gschem_action_create_tool_button (GschemAction
*action
,
62 GschemToplevel
*w_current
);
64 void gschem_action_set_sensitive (GschemAction
*action
, gboolean sensitive
,
65 GschemToplevel
*w_current
);
66 void gschem_action_set_active (GschemAction
*action
, gboolean is_active
,
67 GschemToplevel
*w_current
);
68 void gschem_action_set_strings (GschemAction
*action
,
69 gchar
*name
, gchar
*label
, gchar
*menu_label
,
70 GschemToplevel
*w_current
);
72 GschemAction
*gschem_action_register (gchar
*id
,
78 GschemActionType type
,
79 void (*activate
) (GschemAction
*,
82 void gschem_action_init (void);
84 #endif /* GSCHEM_ACTION_H */