2006-12-03 Dimitris Glezos <dimitris@glezos.com>
[dia.git] / lib / diamenu.h
blob926882af954c6dd5a7d9a5f1860f4aea563db2db
1 /* Dia -- an diagram creation/manipulation program
2 * Copyright (C) 1999 Alexander Larsson
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.
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.
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.
18 #ifndef DIAMENU_H
19 #define DIAMENU_H
21 #include "diatypes.h"
23 /* Flags for DiaMenuItem->active */
24 #define DIAMENU_ACTIVE (1<<0)
25 #define DIAMENU_TOGGLE (1<<1)
26 #define DIAMENU_TOGGLE_ON (1<<2)
28 /* Note: The returned change is already applied. */
29 typedef ObjectChange *(*DiaMenuCallback)(DiaObject *obj, Point *pos, gpointer data);
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 */
40 typedef void (*DiaMenuAppDataFree) (DiaMenu *menu);
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;
51 #endif /*DIAMENU_H*/