aboutsummaryrefslogtreecommitdiffstats
path: root/LibOVR/Src/Displays/OVR_OSX_FocusObserver.h
diff options
context:
space:
mode:
authorBrad Davis <[email protected]>2014-09-04 15:26:04 -0700
committerBrad Davis <[email protected]>2014-09-04 15:26:04 -0700
commit911239601768bacf9420ab9cfeffed7e861844ac (patch)
treed83bfa128b827e034cdc9c923e3a9bd444e9b952 /LibOVR/Src/Displays/OVR_OSX_FocusObserver.h
parent32dc394487af8e4fb1b43fb852f1d5448eaf7f31 (diff)
Adding OSX 0.4.2 files0.4.2
Diffstat (limited to 'LibOVR/Src/Displays/OVR_OSX_FocusObserver.h')
-rw-r--r--LibOVR/Src/Displays/OVR_OSX_FocusObserver.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/LibOVR/Src/Displays/OVR_OSX_FocusObserver.h b/LibOVR/Src/Displays/OVR_OSX_FocusObserver.h
new file mode 100644
index 0000000..66ed12f
--- /dev/null
+++ b/LibOVR/Src/Displays/OVR_OSX_FocusObserver.h
@@ -0,0 +1,47 @@
+#ifndef OVR_OSX_FocusObserver_h
+#define OVR_OSX_FocusObserver_h
+
+#include "../Kernel/OVR_Threads.h"
+#include "../Kernel/OVR_System.h"
+#include "../Kernel/OVR_Lockless.h"
+
+#include "../Service/Service_NetServer.h"
+
+namespace OVR { namespace OSX{
+
+ struct FocusReaderImpl;
+
+class AppFocusObserver : public SystemSingletonBase<AppFocusObserver>
+{
+ OVR_DECLARE_SINGLETON(AppFocusObserver);
+
+public:
+ Lock ListLock;
+ Array<pid_t> AppList;
+ Service::NetServerListener *listener;
+ FocusReaderImpl* impl;
+
+ void OnProcessFocus(pid_t pid);
+ void SetListener(Service::NetServerListener *_listener);
+
+ pid_t LastProcessId;
+ pid_t ActiveProcessId;
+ void AddProcess(pid_t pid);
+ void nextProcess();
+ void RemoveProcess(pid_t pid);
+
+
+protected:
+ void onAppFocus(pid_t pid);
+
+ pid_t LastAppFocus;
+
+};
+
+
+
+}} // namespace OVR, OSX
+
+
+#endif /* defined(__OVR_OSX_FocusReader__OVR_OSX_FocusObserver__) */
+