2 * wmmenugen - Window Maker PropList menu generator
4 * Copyright (c) 2010. Tamas Tevesz <ice@extreme.hu>
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 along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include <WINGs/WUtil.h>
23 #include "../src/wconfig.h"
25 /* flags attached to a particular WMMenuEntry */
26 #define F_TERMINAL (1 << 0)
27 #define F_RESTART_SELF (1 << 1)
28 #define F_RESTART_OTHER (1 << 2)
29 #define F_QUIT (1 << 3)
32 /* a representation of a Window Maker menu entry. all menus are
33 * transformed into this form.
36 char *Name
; /* display name; submenu path of submenu */
37 char *CmdLine
; /* command to execute, NULL if submenu */
38 char *SubMenu
; /* submenu to place entry in; only used when an entry is */
39 /* added to the tree by the parser; new entries created in */
40 /* main (submenu creation) should set this to NULL */
41 int Flags
; /* flags */
44 /* the abstract menu tree
48 char *env_lang
, *env_ctry
, *env_enc
, *env_mod
;
52 void parse_locale(const char *what
, char **env_lang
, char **env_ctry
, char **env_enc
, char **env_mod
);
53 char *find_terminal_emulator(void);
54 Bool
fileInPath(const char *file
);
56 /* implemented parsers
58 void parse_xdg(const char *file
, void (*addWMMenuEntryCallback
)(WMMenuEntry
*aEntry
));
59 void parse_wmconfig(const char *file
, void (*addWMMenuEntryCallback
)(WMMenuEntry
*aEntry
));
60 Bool
wmconfig_validate_file(const char *filename
, const struct stat
*st
, int tflags
, struct FTW
*ftw
);