1 /* Dia -- an diagram creation/manipulation program
2  * Copyright (C) 1999 Alexander Larsson
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program 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
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  */
18 #ifndef DIAMENU_H
19 #define DIAMENU_H
20 
21 #include "diatypes.h"
22 
23 /* Flags for DiaMenuItem->active */
24 #define DIAMENU_ACTIVE (1<<0)
25 #define DIAMENU_TOGGLE (1<<1)
26 #define DIAMENU_TOGGLE_ON (1<<2)
27 
28 /* Note: The returned change is already applied. */
29 typedef ObjectChange *(*DiaMenuCallback)(DiaObject *obj, Point *pos, gpointer data);
30 
31 struct _DiaMenuItem {
32   char *text;
33   DiaMenuCallback callback;
34   gpointer callback_data;
35   int active; /* Actually flags now, but keeps name for compatibility */
36   /* Private for app:  */
37   void *app_data; /* init to NULL */
38 };
39 
40 typedef void (*DiaMenuAppDataFree) (DiaMenu *menu);
41 
42 struct _DiaMenu {
43   char *title;
44   int num_items;
45   DiaMenuItem *items;
46   /* Private for app:  */
47   void *app_data; /* init to NULL */
48   DiaMenuAppDataFree app_data_free;
49 };
50 
51 #endif /*DIAMENU_H*/
52