[go: up one dir, main page]

Menu

[2e2bd2]: / src / wmprog.h  Maximize  Restore  History

Download this file

97 lines (76 with data), 2.0 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef __WMPROG_H
#define __WMPROG_H
#ifndef NO_CONFIGURE_MENUS
#include "objmenu.h"
#include <sys/time.h>
class ObjectContainer;
void loadMenus(const char *fileName, ObjectContainer *container);
class DProgram: public DObject {
public:
virtual ~DProgram();
virtual void open();
static char *fullname(const char *exe);
static DProgram *newProgram(const char *name, YIcon *icon,
const bool restart, const char *wmclass,
const char *exe, const char **args);
protected:
DProgram(const char *name, YIcon *icon, const bool restart,
const char *wmclass, const char *exe, const char **args);
private:
const bool fRestart;
const char *fRes;
const char *fCmd;
const char **fArgs;
};
class DFile: public DObject {
public:
DFile(const char *name, YIcon *icon, const char *path);
virtual ~DFile();
virtual void open();
private:
char *fPath;
};
class MenuFileMenu: public ObjectMenu {
public:
MenuFileMenu(const char *name, YWindow *parent = 0);
virtual ~MenuFileMenu();
virtual void updatePopup();
virtual void refresh();
private:
char *fName;
char *fPath;
protected:
time_t fModTime;
};
class StartMenu: public MenuFileMenu {
public:
StartMenu(const char *name, YWindow *parent = 0);
virtual bool handleKey(const XKeyEvent &key);
virtual void updatePopup();
virtual void refresh();
bool fHasGnomeAppsMenu;
bool fHasGnomeUserMenu;
bool fHasKDEMenu;
};
class KProgram {
public:
KProgram(const char *key, DProgram *prog);
bool isKey(KeySym key, unsigned int mod) {
return (key == fKey && mod == fMod) ? true : false;
}
void open() {
if (fProg)
fProg->open();
}
KeySym key() { return fKey; }
unsigned int modifiers() { return fMod; }
KProgram *getNext() { return fNext; }
private:
KProgram *fNext;
KeySym fKey;
unsigned int fMod;
DProgram *fProg;
};
#endif
extern KProgram *keyProgs;
#endif