[gnome-shell/wip/hadess/add-nvidia-other-gpu-support: 6/9] main: Add switcheroo-control generated code



commit 751c0863a990aab35a5a1dd2cef401e47633cf57
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Nov 6 13:02:27 2019 +0100

    main: Add switcheroo-control generated code
    
    See: https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/781

 src/meson.build                      |  9 +++++--
 src/net.hadess.SwitcherooControl.xml | 46 ++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+), 2 deletions(-)
---
diff --git a/src/meson.build b/src/meson.build
index 3523fb16cb..1607e6dac2 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -183,12 +183,17 @@ libshell_no_gir_sources = [
   libshell_private_sources
 ]
 
-dbus_generated = gnome.gdbus_codegen('org-gtk-application',
+gtk_application_dbus_generated = gnome.gdbus_codegen('org-gtk-application',
   'org.gtk.Application.xml',
   namespace: 'Shell'
 )
 
-libshell_no_gir_sources += dbus_generated
+switcheroo_control_dbus_generated = gnome.gdbus_codegen('switcheroo-control',
+  'net.hadess.SwitcherooControl.xml',
+  namespace: 'Shell'
+)
+
+libshell_no_gir_sources += [ gtk_application_dbus_generated, switcheroo_control_dbus_generated ]
 
 libshell = library('gnome-shell',
   sources: libshell_gir_sources + libshell_no_gir_sources,
diff --git a/src/net.hadess.SwitcherooControl.xml b/src/net.hadess.SwitcherooControl.xml
new file mode 100644
index 0000000000..762d0236b1
--- /dev/null
+++ b/src/net.hadess.SwitcherooControl.xml
@@ -0,0 +1,46 @@
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
+"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd";>
+
+<node>
+
+  <!--
+      net.hadess.SwitcherooControl:
+      @short_description: D-Bus proxy to access dual-GPU controls.
+
+      After checking the availability of two switchable GPUs in the machine,
+      check the value of net.hadess.SwitcherooControl.HasDualGpu to see
+      if running applications on the discrete GPU should be offered.
+
+      The object path will be "/net/hadess/SwitcherooControl".
+  -->
+  <interface name="net.hadess.SwitcherooControl">
+    <!--
+        HasDualGpu:
+
+        Whether two switchable GPUs are present on the system. This property
+        has been obsoleted in favour of the "NumGPUs" property.
+    -->
+    <property name="HasDualGpu" type="b" access="read"/>
+
+    <!--
+        NumGPUs:
+
+        The number of GPUs available on the system. Note that while having no
+        GPUs is unlikely, consumers of this API should probably not throw errors
+        if that were the case.
+    -->
+    <property name="NumGPUs" type="u" access="read"/>
+
+    <!--
+        GPUs:
+
+        An array of key-pair values representing each GPU. The key named "Name" (s)
+        will contain a user-facing name for the GPU, the "Environment" (as) key will
+        contain an array of even number of strings, each being an environment
+        variable to set to use the GPU, followed by its value, the "Default" (b) key
+        will tag the default (usually integrated) GPU.
+    -->
+    <property name="GPUs" type="a(a{sv})" access="read"/>
+
+  </interface>
+</node>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]