NetSurf
frontends
amiga
menu.h
Go to the documentation of this file.
1
/*
2
* Copyright 2017 Chris Young <chris@unsatisfactorysoftware.co.uk>
3
*
4
* This file is part of NetSurf, http://www.netsurf-browser.org/
5
*
6
* NetSurf 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; version 2 of the License.
9
*
10
* NetSurf is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
#ifndef AMIGA_MENU_H
20
#define AMIGA_MENU_H
21
22
#include <exec/types.h>
23
#include <intuition/intuition.h>
24
#include <libraries/gadtools.h>
25
26
struct
ami_menu_data
{
27
char
*restrict
menulab
;
28
Object *restrict
menuobj
;
29
char
*restrict
menukey
;
30
char
*restrict
menuicon
;
31
struct
Hook
menu_hook
;
32
UBYTE
menutype
;
33
UWORD
flags
;
34
};
35
36
/** empty space */
37
#define NSA_SPACE "blankspace.png"
38
39
/* cleanup */
40
void
ami_menu_free_glyphs
(
void
);
41
42
/* generic menu alloc/free/layout */
43
void
ami_menu_alloc_item
(
struct
ami_menu_data
**md,
int
num, UBYTE
type
,
44
const
char
*restrict label,
const
char
*restrict key,
const
char
*restrict icon,
45
void
*restrict func,
void
*restrict hookdata, UWORD flags);
46
struct
Menu *
ami_menu_layout
(
struct
ami_menu_data
**md,
int
max
);
47
void
ami_menu_free_menu
(
struct
ami_menu_data
**md,
int
max
,
struct
Menu *imenu);
48
void
ami_menu_free_lab_item
(
struct
ami_menu_data
**md,
int
i);
49
50
/* refresh a menu's children */
51
void
ami_menu_refresh
(
struct
Menu *menu,
struct
ami_menu_data
**md,
int
menu_item,
int
max
,
52
nserror
(*cb)(
struct
ami_menu_data
**md));
53
54
/**
55
* Get the selected state of a menu item
56
*/
57
bool
ami_menu_get_selected
(
struct
Menu *menu,
struct
IntuiMessage *msg);
58
#endif
59
ami_menu_refresh
void ami_menu_refresh(struct Menu *menu, struct ami_menu_data **md, int menu_item, int max, nserror(*cb)(struct ami_menu_data **md))
Definition:
menu.c:440
ami_menu_layout
struct Menu * ami_menu_layout(struct ami_menu_data **md, int max)
Definition:
menu.c:419
ami_menu_free_menu
void ami_menu_free_menu(struct ami_menu_data **md, int max, struct Menu *imenu)
Definition:
menu.c:430
ami_menu_alloc_item
void ami_menu_alloc_item(struct ami_menu_data **md, int num, UBYTE type, const char *restrict label, const char *restrict key, const char *restrict icon, void *restrict func, void *restrict hookdata, UWORD flags)
Definition:
menu.c:115
ami_menu_free_glyphs
void ami_menu_free_glyphs(void)
Definition:
menu.c:182
ami_menu_free_lab_item
void ami_menu_free_lab_item(struct ami_menu_data **md, int i)
Definition:
menu.c:83
ami_menu_get_selected
bool ami_menu_get_selected(struct Menu *menu, struct IntuiMessage *msg)
Get the selected state of a menu item.
Definition:
menu.c:63
nserror
nserror
Enumeration of error codes.
Definition:
errors.h:29
type
const char * type
Definition:
filetype.cpp:44
ami_menu_data
Definition:
menu.h:26
ami_menu_data::menuobj
Object *restrict menuobj
Definition:
menu.h:28
ami_menu_data::menulab
char *restrict menulab
Definition:
menu.h:27
ami_menu_data::menuicon
char *restrict menuicon
Definition:
menu.h:30
ami_menu_data::menutype
UBYTE menutype
Definition:
menu.h:32
ami_menu_data::menukey
char *restrict menukey
Definition:
menu.h:29
ami_menu_data::flags
UWORD flags
Definition:
menu.h:33
ami_menu_data::menu_hook
struct Hook menu_hook
Definition:
menu.h:31
max
#define max(x, y)
Definition:
utils.h:50
Generated on Sun Oct 20 2024 12:52:18 for NetSurf by
1.9.4