~ubuntu-branches/ubuntu/karmic/icewm/karmic

« back to all changes in this revision

Viewing changes to src/ymenufile.h

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Starr-Bochicchio
  • Date: 2009-06-05 23:39:03 UTC
  • mfrom: (1.2.12 upstream) (3.2.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090605233903-an40kzzm9pdp0zue
Tags: 1.2.37+1.3.4pre2-2ubuntu1
* Merge from debian unstable, remaining changes:
 - debian/rules: call dh_icons

Show diffs side-by-side

added added

removed removed

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