[go: up one dir, main page]

Menu

[3cb4b9]: / src / ymenufile.h  Maximize  Restore  History

Download this file

73 lines (55 with data), 1.9 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
* IceWM - Definition of a parser for IceWM's menu files
* Copyright (C) 2002 The Authors of IceWM
*
* Release under terms of the GNU Library General Public License
*/
#ifndef __YMENU_PARSER_H
#define __YMENU_PARSER_H
#include "yparser.h"
class YIcon;
class YAction;
/*******************************************************************************
* A .menu file parser
******************************************************************************/
class YAbstractMenuParser: public YParser {
protected:
virtual void createSeparator(void) = 0;
virtual void createProgram(const char *name, YIcon *icon,
const char *wmclass, const char *command,
bool restart) = 0;
virtual void createMenu(const char *name, YIcon *icon) = 0;
virtual void createAction(const char *name, YIcon *icon,
YAction *action) = 0;
virtual void createInclusion(const char *path, const char *args) = 0;
virtual void parseStream();
const char *parseProgram(const char *type);
const char *parseMenu();
const char *parseSeparator();
const char *parseInclusion();
const char *parseAction();
private:
int menuLevel;
};
class YMenuParser: public YAbstractMenuParser {
public:
YMenuParser();
virtual ~YMenuParser();
const char *getExec() const { return fExec; }
const char *getType() const { return fType; }
const char *getName() const { return fName; }
const char *getIcon() const { return fIcon; }
protected:
virtual void beginSection(const char *name);
virtual void setValue(const char *key, const char *locale,
const char *value);
virtual void resetParser();
private:
bool fInMenuSection;
char *fType, *fExec;
char *fName, *fNameLocale;
int fNameQuality;
char *fIcon, *fIconLocale;
int fIconQuality;
};
#endif