LMMS
Loading...
Searching...
No Matches
plugins
CarlaBase
carla
source
modules
ysfx
thirdparty
WDL
source
WDL
swell
swell-menugen.h
Go to the documentation of this file.
1
#ifndef _SWELL_MENUGEN_H_
2
#define _SWELL_MENUGEN_H_
3
4
5
/* Cockos SWELL (Simple/Small Win32 Emulation Layer for Linux/OSX)
6
Copyright (C) 2006 and later, Cockos, Inc.
7
8
This software is provided 'as-is', without any express or implied
9
warranty. In no event will the authors be held liable for any damages
10
arising from the use of this software.
11
12
Permission is granted to anyone to use this software for any purpose,
13
including commercial applications, and to alter it and redistribute it
14
freely, subject to the following restrictions:
15
16
1. The origin of this software must not be misrepresented; you must not
17
claim that you wrote the original software. If you use this software
18
in a product, an acknowledgment in the product documentation would be
19
appreciated but is not required.
20
2. Altered source versions must be plainly marked as such, and must not be
21
misrepresented as being the original software.
22
3. This notice may not be removed or altered from any source distribution.
23
24
Dynamic menu generation
25
26
Usage:
27
28
See: swell_resgen.php etc
29
30
*/
31
32
33
#include "
swell.h
"
34
35
36
#ifdef BEGIN
37
#undef BEGIN
38
#endif
39
40
#ifdef END
41
#undef END
42
#endif
43
44
45
typedef
struct
SWELL_MenuResourceIndex
46
{
47
const
char
*
resid
;
48
void
(*
createFunc
)(
HMENU
hMenu);
49
struct
SWELL_MenuResourceIndex
*
_next
;
50
}
SWELL_MenuResourceIndex
;
51
extern
SWELL_MenuResourceIndex
*
SWELL_curmodule_menuresource_head
;
52
53
54
#define SWELL_MENUGEN_POPUP_PREFIX "/.BO^O:"
55
#define SWELL_MENUGEN_ENDPOPUP "EN%%%^:"
56
struct
SWELL_MenuGen_Entry
57
{
58
const
char
*
name
;
// will begin with SWELL_MENUGEN_POPUP_PREFIX on submenus, and will be SWELL_MENUGEN_ENDPOPUP at the end of a submenu
59
unsigned
short
idx
;
60
unsigned
short
flags
;
61
};
62
63
class
SWELL_MenuGenHelper
64
{
65
public
:
66
SWELL_MenuResourceIndex
m_rec
;
67
SWELL_MenuGenHelper
(
SWELL_MenuResourceIndex
**
h
,
void
(*
cf
)(
HMENU
),
int
recid)
68
{
69
m_rec
.resid=
MAKEINTRESOURCE
(recid);
70
m_rec
.createFunc=
cf
;
71
m_rec
._next=*
h
;
72
*
h
= &
m_rec
;
73
}
74
};
75
76
#define SWELL_DEFINE_MENU_RESOURCE_BEGIN(recid) \
77
static void __swell_menu_cf__##recid(HMENU hMenu); \
78
static SWELL_MenuGenHelper __swell_menu_cf_helper__##recid(&SWELL_curmodule_menuresource_head, __swell_menu_cf__##recid, recid); \
79
static void __swell_menu_cf__##recid(HMENU hMenu) { static const SWELL_MenuGen_Entry list[]={{NULL,0,0
80
81
#define SWELL_DEFINE_MENU_RESOURCE_END(recid) } }; SWELL_GenerateMenuFromList(hMenu,list+1,sizeof(list)/sizeof(list[0])-1); }
82
83
84
#define GRAYED 1
85
#define INACTIVE 2
86
#define POPUP }, { SWELL_MENUGEN_POPUP_PREFIX
87
#define MENUITEM }, {
88
#define SEPARATOR NULL, 0xffff
89
#define BEGIN
90
#define END }, { SWELL_MENUGEN_ENDPOPUP
91
92
#endif
//_SWELL_MENUGEN_H_
93
SWELL_MenuGenHelper::m_rec
SWELL_MenuResourceIndex m_rec
Definition
swell-menugen.h:66
SWELL_MenuGenHelper::SWELL_MenuGenHelper
SWELL_MenuGenHelper(SWELL_MenuResourceIndex **h, void(*cf)(HMENU), int recid)
Definition
swell-menugen.h:67
SWELL_MenuGen_Entry
Definition
swell-menugen.h:57
SWELL_MenuGen_Entry::idx
unsigned short idx
Definition
swell-menugen.h:59
SWELL_MenuGen_Entry::flags
unsigned short flags
Definition
swell-menugen.h:60
SWELL_MenuGen_Entry::name
const char * name
Definition
swell-menugen.h:58
SWELL_MenuResourceIndex
Definition
swell-menugen.h:46
SWELL_MenuResourceIndex::createFunc
void(* createFunc)(HMENU hMenu)
Definition
swell-menugen.h:48
SWELL_MenuResourceIndex::_next
struct SWELL_MenuResourceIndex * _next
Definition
swell-menugen.h:49
SWELL_MenuResourceIndex::resid
const char * resid
Definition
swell-menugen.h:47
cf
void DWORD DWORD LPVOID DWORD cf
Definition
swell-functions.h:807
SWELL_curmodule_menuresource_head
SWELL_MenuResourceIndex * SWELL_curmodule_menuresource_head
Definition
swell-menu-generic.cpp:1293
HMENU
struct HMENU__ * HMENU
Definition
swell-types.h:211
MAKEINTRESOURCE
#define MAKEINTRESOURCE(x)
Definition
swell-types.h:1157
swell.h
h
uch h[RAND_HEAD_LEN]
Definition
crypt.c:459
void
#define void
Definition
unzip.h:396
Generated on
for LMMS by
1.16.1