summaryrefslogtreecommitdiff
path: root/man/waffle_display.3.xml
blob: 9ee5c0277ce823bc79e241c474c9b430f0f7c361 (plain)
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<?xml version='1.0'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">

<!--
  Copyright Intel 2012

  This manual page is licensed under the Creative Commons Attribution-ShareAlike 3.0 United States License (CC BY-SA 3.0
  US). To view a copy of this license, visit http://creativecommons.org.license/by-sa/3.0/us.
-->

<refentry
    id="waffle_display"
    xmlns:xi="http://www.w3.org/2001/XInclude">

  <!-- See http://www.docbook.org/tdg/en/html/refentry.html. -->

  <refmeta>
    <refentrytitle>waffle_display</refentrytitle>
    <manvolnum>3</manvolnum>
  </refmeta>

  <refnamediv>
    <refname>waffle_display</refname>
    <refname>waffle_display_connect</refname>
    <refname>waffle_display_disconnect</refname>
    <refname>waffle_display_supports_context_api</refname>
    <refname>waffle_display_get_native</refname>
    <refpurpose>class <classname>waffle_display</classname></refpurpose>
  </refnamediv>

  <refentryinfo>
    <title>Waffle Manual</title>
    <productname>waffle</productname>
    <xi:include href="common/author-chad.versace.xml"/>
    <xi:include href="common/copyright.xml"/>
    <xi:include href="common/legalnotice.xml"/>
  </refentryinfo>

  <refsynopsisdiv>

    <funcsynopsis language="C">

      <funcsynopsisinfo>
#include &lt;waffle.h&gt;

struct waffle_display;
      </funcsynopsisinfo>

      <funcprototype>
        <funcdef>struct waffle_display* <function>waffle_display_connect</function></funcdef>
        <paramdef>const char* <parameter>name</parameter></paramdef>
      </funcprototype>

      <funcprototype>
        <funcdef>bool <function>waffle_display_disconnect</function></funcdef>
        <paramdef>struct waffle_display *<parameter>self</parameter></paramdef>
      </funcprototype>

      <funcprototype>
        <funcdef>bool <function>waffle_display_supports_context_api</function></funcdef>
        <paramdef>struct waffle_display *<parameter>self</parameter></paramdef>
        <paramdef>int32_t <parameter>context_api</parameter></paramdef>
      </funcprototype>

      <funcprototype>
        <funcdef>union waffle_native_display* <function>waffle_display_get_native</function></funcdef>
        <paramdef>struct waffle_display *<parameter>self</parameter></paramdef>
      </funcprototype>

    </funcsynopsis>
  </refsynopsisdiv>

  <refsect1>
    <title>Description</title>

    <variablelist>

      <varlistentry>
        <term><type>struct waffle_display</type></term>
        <listitem>
          <para>
            An opaque type.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><function>waffle_display_connect()</function></term>
        <listitem>
          <para>
            Connect to a display. The interpretation of <parameter>name</parameter> differs according to the platform
            given to <citerefentry><refentrytitle>waffle_init</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
          </para>
          <para>
            On Android and CGL, <parameter>name</parameter> is ignored.
          </para>
          <para>
            On the X11 platforms, GLX and X11/EGL, the function connects to the X11 display with the given
            <parameter>name</parameter>. If <parameter>name</parameter> is null, then it uses the value of the
            environment variable <envar>DISPLAY</envar>.
          </para>
          <para>
            On Wayland, the function connects to the Wayland display with the given name. If <parameter>name</parameter> is null, then it
            uses the value of the environment variable <envar>WAYLAND_DISPLAY</envar>.
          </para>
          <para>
            On GBM, the function opens the device at the filepath <parameter>name</parameter>. If
            <parameter>name</parameter> is null, then it iterates using udev through the set of card devices in the drm
            subsystem, which are usually located in <filename>/dev/dri</filename>, and attempts to open each in turn
            with <code>open(O_RDWR | O_CLOEXEC)</code> until successful.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><function>waffle_display_disconnect()</function></term>
        <listitem>
          <para>
            Disconnect from the <type>waffle_display</type> and release it's memory. All pointers to waffle objects that
            were created with the display become invalid.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><function>waffle_display_supports_context_api()</function></term>
        <listitem>
          <para>
            Check if the display is capable of creating
            a <citerefentry><refentrytitle>waffle_context</refentrytitle><manvolnum>3</manvolnum></citerefentry> with
            the given <parameter>context_api</parameter>. See
            <citerefentry><refentrytitle>waffle_config</refentrytitle><manvolnum>3</manvolnum></citerefentry> for
            choices of <parameter>context_api</parameter> and expectations for each platform.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><function>waffle_display_get_native()</function></term>
        <listitem>
          <para>
            Get the display's underlying native objects. Use
            <citerefentry><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry> to deallocate the
            returned pointer.
            See <citerefentry><refentrytitle>waffle_native</refentrytitle><manvolnum>3</manvolnum></citerefentry>
            for the definition of <type>union waffle_native_display</type>.
          </para>
        </listitem>
      </varlistentry>

    </variablelist>
  </refsect1>

  <refsect1>
    <title>Return Value</title>
    <xi:include href="common/return-value.xml"/>
  </refsect1>

  <refsect1>
    <title>Errors</title>

    <xi:include href="common/error-codes.xml"/>

    <para>
      No errors are specific to any of the <type>waffle_display</type> functions.
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <citerefentry><refentrytitle>waffle</refentrytitle><manvolnum>7</manvolnum></citerefentry>
    </para>
  </refsect1>

</refentry>

<!--
vim:tw=120 et ts=2 sw=2:
-->