summaryrefslogtreecommitdiff
path: root/src/privatescreen.h
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@compiz-fusion.org>2008-09-15 22:05:41 +0200
committerDennis Kasprzyk <onestone@compiz-fusion.org>2008-09-15 22:05:41 +0200
commitd5acffa9795add9ebc9c6e6920a5e80581584863 (patch)
treea55558b31b3b8b455aa9286cf139b9f6c19df003 /src/privatescreen.h
parent8fcba7fa8ec54cac55d4136cfd41a3a8d9ccb192 (diff)
downloadunity-window-decorator-d5acffa9795add9ebc9c6e6920a5e80581584863.tar.gz
unity-window-decorator-d5acffa9795add9ebc9c6e6920a5e80581584863.tar.bz2
Merge CompCore and CompDisplay into CompScreen class.
Diffstat (limited to 'src/privatescreen.h')
-rw-r--r--src/privatescreen.h247
1 files changed, 234 insertions, 13 deletions
diff --git a/src/privatescreen.h b/src/privatescreen.h
index 1932eec..9ba403b 100644
--- a/src/privatescreen.h
+++ b/src/privatescreen.h
@@ -5,6 +5,16 @@
#include <compscreen.h>
#include <compsize.h>
#include <comppoint.h>
+#include <core/timer.h>
+
+extern bool shutDown;
+extern bool restartSignal;
+
+typedef struct _CompWatchFd {
+ int fd;
+ FdWatchCallBack callBack;
+ CompWatchFdHandle handle;
+} CompWatchFd;
extern CompWindow *lastFoundWindow;
extern CompWindow *lastDamagedWindow;
@@ -14,16 +24,100 @@ extern bool onlyCurrentScreen;
extern int defaultRefreshRate;
extern const char *defaultTextureFilter;
-#define COMP_SCREEN_OPTION_HSIZE 0
-#define COMP_SCREEN_OPTION_VSIZE 1
-#define COMP_SCREEN_OPTION_DEFAULT_ICON 2
-#define COMP_SCREEN_OPTION_NUMBER_OF_DESKTOPS 3
-#define COMP_SCREEN_OPTION_DETECT_OUTPUTS 4
-#define COMP_SCREEN_OPTION_OUTPUTS 5
-#define COMP_SCREEN_OPTION_OVERLAPPING_OUTPUTS 6
-#define COMP_SCREEN_OPTION_FOCUS_PREVENTION_LEVEL 7
-#define COMP_SCREEN_OPTION_FOCUS_PREVENTION_MATCH 8
-#define COMP_SCREEN_OPTION_NUM 9
+
+#define COMP_OPTION_ACTIVE_PLUGINS 0
+#define COMP_OPTION_CLICK_TO_FOCUS 1
+#define COMP_OPTION_AUTORAISE 2
+#define COMP_OPTION_AUTORAISE_DELAY 3
+#define COMP_OPTION_CLOSE_WINDOW_KEY 4
+#define COMP_OPTION_CLOSE_WINDOW_BUTTON 5
+#define COMP_OPTION_MAIN_MENU_KEY 6
+#define COMP_OPTION_RUN_DIALOG_KEY 7
+#define COMP_OPTION_COMMAND0 8
+#define COMP_OPTION_COMMAND1 9
+#define COMP_OPTION_COMMAND2 10
+#define COMP_OPTION_COMMAND3 11
+#define COMP_OPTION_COMMAND4 12
+#define COMP_OPTION_COMMAND5 13
+#define COMP_OPTION_COMMAND6 14
+#define COMP_OPTION_COMMAND7 15
+#define COMP_OPTION_COMMAND8 16
+#define COMP_OPTION_COMMAND9 17
+#define COMP_OPTION_COMMAND10 18
+#define COMP_OPTION_COMMAND11 19
+#define COMP_OPTION_RUN_COMMAND0_KEY 20
+#define COMP_OPTION_RUN_COMMAND1_KEY 21
+#define COMP_OPTION_RUN_COMMAND2_KEY 22
+#define COMP_OPTION_RUN_COMMAND3_KEY 23
+#define COMP_OPTION_RUN_COMMAND4_KEY 24
+#define COMP_OPTION_RUN_COMMAND5_KEY 25
+#define COMP_OPTION_RUN_COMMAND6_KEY 26
+#define COMP_OPTION_RUN_COMMAND7_KEY 27
+#define COMP_OPTION_RUN_COMMAND8_KEY 28
+#define COMP_OPTION_RUN_COMMAND9_KEY 29
+#define COMP_OPTION_RUN_COMMAND10_KEY 30
+#define COMP_OPTION_RUN_COMMAND11_KEY 31
+#define COMP_OPTION_RAISE_WINDOW_KEY 32
+#define COMP_OPTION_RAISE_WINDOW_BUTTON 33
+#define COMP_OPTION_LOWER_WINDOW_KEY 34
+#define COMP_OPTION_LOWER_WINDOW_BUTTON 35
+#define COMP_OPTION_UNMAXIMIZE_WINDOW_KEY 36
+#define COMP_OPTION_MINIMIZE_WINDOW_KEY 37
+#define COMP_OPTION_MINIMIZE_WINDOW_BUTTON 38
+#define COMP_OPTION_MAXIMIZE_WINDOW_KEY 39
+#define COMP_OPTION_MAXIMIZE_WINDOW_HORZ_KEY 40
+#define COMP_OPTION_MAXIMIZE_WINDOW_VERT_KEY 41
+#define COMP_OPTION_SCREENSHOT 42
+#define COMP_OPTION_RUN_SCREENSHOT_KEY 43
+#define COMP_OPTION_WINDOW_SCREENSHOT 44
+#define COMP_OPTION_RUN_WINDOW_SCREENSHOT_KEY 45
+#define COMP_OPTION_WINDOW_MENU_BUTTON 46
+#define COMP_OPTION_WINDOW_MENU_KEY 47
+#define COMP_OPTION_SHOW_DESKTOP_KEY 48
+#define COMP_OPTION_SHOW_DESKTOP_EDGE 49
+#define COMP_OPTION_RAISE_ON_CLICK 50
+#define COMP_OPTION_AUDIBLE_BELL 51
+#define COMP_OPTION_TOGGLE_WINDOW_MAXIMIZED_KEY 52
+#define COMP_OPTION_TOGGLE_WINDOW_MAXIMIZED_BUTTON 53
+#define COMP_OPTION_TOGGLE_WINDOW_MAXIMIZED_HORZ_KEY 54
+#define COMP_OPTION_TOGGLE_WINDOW_MAXIMIZED_VERT_KEY 55
+#define COMP_OPTION_HIDE_SKIP_TASKBAR_WINDOWS 56
+#define COMP_OPTION_TOGGLE_WINDOW_SHADED_KEY 57
+#define COMP_OPTION_IGNORE_HINTS_WHEN_MAXIMIZED 58
+#define COMP_OPTION_TERMINAL 59
+#define COMP_OPTION_RUN_TERMINAL_KEY 60
+#define COMP_OPTION_PING_DELAY 61
+#define COMP_OPTION_EDGE_DELAY 62
+#define COMP_OPTION_HSIZE 63
+#define COMP_OPTION_VSIZE 64
+#define COMP_OPTION_DEFAULT_ICON 65
+#define COMP_OPTION_NUMBER_OF_DESKTOPS 66
+#define COMP_OPTION_DETECT_OUTPUTS 67
+#define COMP_OPTION_OUTPUTS 68
+#define COMP_OPTION_OVERLAPPING_OUTPUTS 69
+#define COMP_OPTION_FOCUS_PREVENTION_LEVEL 70
+#define COMP_OPTION_FOCUS_PREVENTION_MATCH 71
+#define COMP_OPTION_NUM 72
+
+extern bool inHandleEvent;
+
+extern CompScreen *targetScreen;
+extern CompOutput *targetOutput;
+
+
+typedef struct _CompDelayedEdgeSettings
+{
+ CompAction::CallBack initiate;
+ CompAction::CallBack terminate;
+
+ unsigned int edge;
+ unsigned int state;
+
+ CompOption::Vector options;
+} CompDelayedEdgeSettings;
+
+
+
#define OUTPUT_OVERLAP_MODE_SMART 0
#define OUTPUT_OVERLAP_MODE_PREFER_LARGER 1
@@ -37,7 +131,7 @@ extern const char *defaultTextureFilter;
#define FOCUS_PREVENTION_LEVEL_LAST FOCUS_PREVENTION_LEVEL_VERYHIGH
extern const CompMetadata::OptionInfo
-coreScreenOptionInfo[COMP_SCREEN_OPTION_NUM];
+coreOptionInfo[COMP_OPTION_NUM];
class PrivateScreen {
@@ -69,6 +163,71 @@ class PrivateScreen {
PrivateScreen (CompScreen *screen);
~PrivateScreen ();
+ void processEvents ();
+
+ void removeDestroyed ();
+
+ void updatePassiveGrabs ();
+
+ short int
+ watchFdEvents (CompWatchFdHandle handle);
+
+ int
+ doPoll (int timeout);
+
+ void
+ handleTimers (struct timeval *tv);
+
+ void addTimer (CompTimer *timer);
+ void removeTimer (CompTimer *timer);
+
+ void
+ updatePlugins ();
+
+ bool
+ triggerButtonPressBindings (CompOption::Vector &options,
+ XEvent *event,
+ CompOption::Vector &arguments);
+
+ bool
+ triggerButtonReleaseBindings (CompOption::Vector &options,
+ XEvent *event,
+ CompOption::Vector &arguments);
+
+ bool
+ triggerKeyPressBindings (CompOption::Vector &options,
+ XEvent *event,
+ CompOption::Vector &arguments);
+
+ bool
+ triggerKeyReleaseBindings (CompOption::Vector &options,
+ XEvent *event,
+ CompOption::Vector &arguments);
+
+ bool
+ triggerStateNotifyBindings (CompOption::Vector &options,
+ XkbStateNotifyEvent *event,
+ CompOption::Vector &arguments);
+ bool
+ triggerEdgeEnter (unsigned int edge,
+ CompAction::State state,
+ CompOption::Vector &arguments);
+
+ void
+ setAudibleBell (bool audible);
+
+ bool
+ handlePingTimeout ();
+
+ bool
+ handleActionEvent (XEvent *event);
+
+ void
+ handleSelectionRequest (XEvent *event);
+
+ void
+ handleSelectionClear (XEvent *event);
+
bool
desktopHintEqual (unsigned long *data,
int size,
@@ -143,12 +302,74 @@ class PrivateScreen {
void
computeWorkareaForBox (BoxPtr pBox, XRectangle *area);
+ void updateScreenInfo ();
+
public:
+
+ std::list<CompFileWatch *> fileWatch;
+ CompFileWatchHandle lastFileWatchHandle;
+
+ std::list<CompTimer *> timers;
+ struct timeval lastTimeout;
+
+ std::list<CompWatchFd *> watchFds;
+ CompWatchFdHandle lastWatchFdHandle;
+ struct pollfd *watchPollFds;
+ int nWatchFds;
+
+ std::map<CompString, CompPrivate> valueMap;
+
+ xcb_connection_t *connection;
+
+ Display *dpy;
+
+ int syncEvent, syncError;
+
+ bool randrExtension;
+ int randrEvent, randrError;
+
+ bool shapeExtension;
+ int shapeEvent, shapeError;
+
+ bool xkbExtension;
+ int xkbEvent, xkbError;
+
+ bool xineramaExtension;
+ int xineramaEvent, xineramaError;
+
+ std::vector<XineramaScreenInfo> screenInfo;
+
+ SnDisplay *snDisplay;
+
+ unsigned int lastPing;
+ CompTimer pingTimer;
+
+ Window activeWindow;
+
+ Window below;
+ char displayString[256];
+
+ XModifierKeymap *modMap;
+ unsigned int modMask[CompModNum];
+ unsigned int ignoredModMask;
+
+ KeyCode escapeKeyCode;
+ KeyCode returnKeyCode;
+
+ CompTimer autoRaiseTimer;
+ Window autoRaiseWindow;
+
+ CompTimer edgeDelayTimer;
+ CompDelayedEdgeSettings edgeDelaySettings;
+
+ CompOption::Value plugin;
+ bool dirtyPluginList;
+
CompScreen *screen;
- CompDisplay *display;
+
CompWindowList windows;
CompWindow::Map windowsMap;
@@ -187,7 +408,7 @@ class PrivateScreen {
SnMonitorContext *snContext;
std::list<CompStartupSequence *> startupSequences;
- CompCore::Timer startupSequenceTimer;
+ CompTimer startupSequenceTimer;
std::list<CompGroup *> groups;