[go: up one dir, main page]

Menu

[e0151d]: / src / yapp.h  Maximize  Restore  History

Download this file

147 lines (108 with data), 3.6 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
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#ifndef __YAPP_H
#define __YAPP_H
#include <signal.h>
#include "ywindow.h"
#include "ycursor.h"
#include "ypaths.h"
class YTimer;
class YSocket;
class YClipboard;
class YApplication {
public:
YApplication(int *argc, char ***argv, const char *displayName = 0);
virtual ~YApplication();
int mainLoop();
void exitLoop(int exitCode);
void exit(int exitCode);
Display * display() const { return fDisplay; }
int screen() { return DefaultScreen (display()); }
Visual * visual() { return DefaultVisual(display(), screen()); }
Colormap colormap() { return DefaultColormap(display(), screen()); }
unsigned depth() { return DefaultDepth(display(), screen()); }
char const * executable() { return fExecutable; }
bool hasColormap();
bool hasGNOME();
void saveEventTime(XEvent &xev);
Time getEventTime() const { return lastEventTime; }
int grabEvents(YWindow *win, Cursor ptr, unsigned int eventMask, int grabMouse = 1, int grabKeyboard = 1, int grabTree = 0);
int releaseEvents();
void handleGrabEvent(YWindow *win, XEvent &xev);
void replayEvent();
void captureGrabEvents(YWindow *win);
void releaseGrabEvents(YWindow *win);
void dispatchEvent(YWindow *win, XEvent &e);
virtual void afterWindowEvent(XEvent &xev);
YPopupWindow *popup() const { return fPopup; }
bool popup(YWindow *forWindow, YPopupWindow *popup);
void popdown(YPopupWindow *popdown);
YWindow *grabWindow() const { return fGrabWindow; }
virtual void handleSignal(int sig);
virtual void handleIdle();
void catchSignal(int sig);
void resetSignals();
//void unblockSignal(int sig);
void initModifiers();
void alert();
void runProgram(const char *str, const char *const *args);
void runCommand(const char *prog);
static char * findConfigFile(const char *name);
#ifdef CONFIG_SESSION
bool haveSessionManager();
virtual void smSaveYourself(bool shutdown, bool fast);
virtual void smSaveYourselfPhase2();
virtual void smSaveComplete();
virtual void smShutdownCancelled();
virtual void smDie();
void smSaveDone();
void smRequestShutdown();
void smCancelShutdown();
#endif
void setClipboardText(char *data, int len);
static YCursor leftPointer;
static YCursor rightPointer;
static YCursor movePointer;
#ifndef LITE
static YResourcePaths iconPaths;
#endif
unsigned int AltMask;
unsigned int MetaMask;
unsigned int NumLockMask;
unsigned int ScrollLockMask;
unsigned int SuperMask;
unsigned int HyperMask;
unsigned int ModeSwitchMask;
unsigned int WinMask;
unsigned int Win_L;
unsigned int Win_R;
unsigned int KeyMask;
unsigned int ButtonMask;
unsigned int ButtonKeyMask;
static char const * Name;
private:
Display *fDisplay;
Time lastEventTime;
YPopupWindow *fPopup;
int fGrabTree;
YWindow *fXGrabWindow;
int fGrabMouse;
YWindow *fGrabWindow;
YTimer *fFirstTimer, *fLastTimer;
YSocket *fFirstSocket, *fLastSocket;
YClipboard *fClip;
bool fReplayEvent;
int fLoopLevel;
int fExitLoop;
int fExitCode;
int fExitApp;
char const * fExecutable;
friend class YTimer;
friend class YSocket;
void registerTimer(YTimer *t);
void unregisterTimer(YTimer *t);
void getTimeout(struct timeval *timeout);
void handleTimeouts();
void registerSocket(YSocket *t);
void unregisterSocket(YSocket *t);
};
extern YApplication *app;
#endif