Update Serbian translation from master branch
[wmaker-crm.git] / util / wmmenugen.h
blob1250954a2d5c6c96d4b4866c1e81d969e6f69099
1 /*
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 #ifndef WMMENUGEN_H
22 #define WMMENUGEN_H
24 #include <WINGs/WUtil.h>
26 #include "../src/wconfig.h"
28 /* flags attached to a particular WMMenuEntry */
29 #define F_TERMINAL (1 << 0)
30 #define F_RESTART_SELF (1 << 1)
31 #define F_RESTART_OTHER (1 << 2)
32 #define F_QUIT (1 << 3)
33 #define F_FREE_CMD_LINE (1 << 4)
36 /* a representation of a Window Maker menu entry. all menus are
37 * transformed into this form.
39 typedef struct {
40 char *Name; /* display name; submenu path of submenu */
41 char *CmdLine; /* command to execute, NULL if submenu */
42 char *SubMenu; /* submenu to place entry in; only used when an entry is */
43 /* added to the tree by the parser; new entries created in */
44 /* main (submenu creation) should set this to NULL */
45 int Flags; /* flags */
46 } WMMenuEntry;
48 /* the abstract menu tree
50 extern WMTreeNode *menu;
52 extern char *env_lang, *env_ctry, *env_enc, *env_mod;
54 /* Type for the call-back function to add a menu entry to the current menu */
55 typedef void cb_add_menu_entry(WMMenuEntry *entry);
57 /* wmmenu_misc.c
59 void parse_locale(const char *what, char **env_lang, char **env_ctry, char **env_enc, char **env_mod);
60 char *find_terminal_emulator(void);
61 Bool fileInPath(const char *file);
63 /* implemented parsers
65 void parse_xdg(const char *file, cb_add_menu_entry *addWMMenuEntryCallback);
66 void parse_wmconfig(const char *file, cb_add_menu_entry *addWMMenuEntryCallback);
67 Bool wmconfig_validate_file(const char *filename, const struct stat *st, int tflags, struct FTW *ftw);
69 #endif /* WMMENUGEN_H */