From 21cc5e6fefaf737b6468dd1783ea1afa23ee8313 Mon Sep 17 00:00:00 2001
From: Heghedus Razvan <heghedus.razvan@gmail.com>
Date: Sun, 7 Jan 2018 21:41:43 +0200
Subject: Add idle protocol

Signed-off-by: Heghedus Razvan <heghedus.razvan@gmail.com>
---
 protocol/idle.xml    | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 protocol/meson.build |  2 ++
 2 files changed, 51 insertions(+)
 create mode 100644 protocol/idle.xml

(limited to 'protocol')

diff --git a/protocol/idle.xml b/protocol/idle.xml
new file mode 100644
index 00000000..92d9989c
--- /dev/null
+++ b/protocol/idle.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="idle">
+  <copyright><![CDATA[
+    Copyright (C) 2015 Martin Gräßlin
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Lesser General Public License as published by
+    the Free Software Foundation, either version 2.1 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  ]]></copyright>
+  <interface  name="org_kde_kwin_idle" version="1">
+      <description summary="User idle time manager">
+        This interface allows to monitor user idle time on a given seat. The interface
+        allows to register timers which trigger after no user activity was registered
+        on the seat for a given interval. It notifies when user activity resumes.
+
+        This is useful for applications wanting to perform actions when the user is not
+        interacting with the system, e.g. chat applications setting the user as away, power
+        management features to dim screen, etc..
+      </description>
+      <request name="get_idle_timeout">
+        <arg name="id" type="new_id" interface="org_kde_kwin_idle_timeout"/>
+        <arg name="seat" type="object" interface="wl_seat"/>
+        <arg name="timeout" type="uint" summary="The idle timeout in msec"/>
+      </request>
+  </interface>
+  <interface name="org_kde_kwin_idle_timeout" version="1">
+      <request name="release" type="destructor">
+        <description summary="release the timeout object"/>
+      </request>
+      <request name="simulate_user_activity">
+          <description summary="Simulates user activity for this timeout, behaves just like real user activity on the seat"/>
+      </request>
+      <event name="idle">
+          <description summary="Triggered when there has not been any user activity in the requested idle time interval"/>
+      </event>
+      <event name="resumed">
+          <description summary="Triggered on the first user activity after an idle event"/>
+      </event>
+  </interface>
+</protocol>
diff --git a/protocol/meson.build b/protocol/meson.build
index f6aca5f5..6e9f4125 100644
--- a/protocol/meson.build
+++ b/protocol/meson.build
@@ -26,6 +26,7 @@ protocols = [
 	'gtk-primary-selection.xml',
 	'screenshooter.xml',
 	'server-decoration.xml',
+	'idle.xml',
 ]
 
 client_protocols = [
@@ -34,6 +35,7 @@ client_protocols = [
 	'gtk-primary-selection.xml',
 	'screenshooter.xml',
 	'server-decoration.xml',
+	'idle.xml',
 ]
 
 wl_protos_src = []
-- 
cgit v1.2.3