sync with OpenBSD -current

This commit is contained in:
purplerain 2024-07-12 14:44:09 +02:00
parent 2d1e52c274
commit b5b25afdb8
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
657 changed files with 21464 additions and 54675 deletions

View file

@ -1346,15 +1346,11 @@ field of the indicators structure. The only way to change the
field is to change the keyboard map.</para></note>
<para>
There are two ways to make changes to indicator maps and state: either change a
To make changes to indicator maps and state, change a
local copy of the indicator maps and use
<function>XkbSetIndicatorMap</function>
or
<function>XkbSetNamedDeviceIndicator</function>,
or, to reduce network traffic, use an
<structname>XkbIndicatorChangesRec</structname>
structure and use
<function>XkbChangeIndicators</function>.
<function>XkbSetNamedDeviceIndicator</function>.
</para>
@ -1852,135 +1848,7 @@ and returns the value which was returned by
</para>
</sect2>
<sect2 id='XkbIndicatorChangesRec'>
<title>The XkbIndicatorChangesRec Structure</title>
<indexterm significance="preferred" zone="XkbIndicatorChangesRec">
<primary><structname>XkbIndicatorChangesRec</structname></primary></indexterm>
<para>
The
<structname>XkbIndicatorChangesRec</structname>
identifies small modifications to the indicator map. Use it with the function
<function>XkbChangeIndicators</function>
to reduce the amount of traffic sent to the server.
</para>
<para><programlisting>
typedef struct _XkbIndicatorChanges {
unsigned int state_changes;
unsigned int map_changes;
} <structname>XkbIndicatorChangesRec</structname>,*XkbIndicatorChangesPtr;
</programlisting></para>
<para>
The
<structfield>state_changes</structfield>
field is a mask that specifies the indicators that have changed state, and
<structfield>map_changes</structfield>
is a mask that specifies the indicators whose maps have changed.
</para>
<para>
To change indicator maps or state without passing the entire keyboard
description, use
<function>XkbChangeIndicators</function>.
</para>
<indexterm significance="preferred" zone="XkbChangeIndicators"><primary><function>XkbChangeIndicators</function></primary></indexterm>
<funcsynopsis id="XkbChangeIndicators">
<funcprototype>
<funcdef>Bool <function>XkbChangeIndicators</function></funcdef>
<!-- (
<parameter>dpy, xkb, changes, state</parameter>
) -->
<paramdef>Display *<parameter>dpy</parameter></paramdef>
<paramdef>XkbDescPtr <parameter>xkb</parameter></paramdef>
<paramdef>XkbIndicatorChangesPtr <parameter>changes</parameter></paramdef>
<paramdef>unsigned int <parameter>state</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<variablelist>
<varlistentry>
<term>
<parameter>dpy</parameter>
</term>
<listitem>
<para>
connection to the X server
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>xkb</parameter>
</term>
<listitem>
<para>
keyboard description from which names are to be taken.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>changes</parameter>
</term>
<listitem>
<para>
indicators to be updated on the server
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>state</parameter>
</term>
<listitem>
<para>
new state of indicators listed in <parameter>changes</parameter>-&gt;<structfield>state_changes</structfield>
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
<function>XkbChangeIndicators</function>
copies any maps specified by
<parameter>changes</parameter>
from the keyboard description,
<parameter>xkb</parameter>,
to the server specified by
<parameter>dpy</parameter>.
If any bits are set in the
<structfield>state_changes</structfield>
field of
<parameter>changes</parameter>,
<function>XkbChangeIndicators</function>
also sets the state of those indicators to the values specified in the
<parameter>state</parameter>
mask. A 1 bit in
<parameter>state</parameter>
turns the corresponding indicator on, a 0 bit turns it off.
</para>
<para>
<function>XkbChangeIndicators</function>
can generate
<errorname>BadAtom</errorname>
and
<errorname>BadImplementation</errorname>
errors. In addition, it can also generate
<symbol>XkbIndicatorStateNotify</symbol>
and
<symbol>XkbIndicatorMapNotify</symbol>
events (see <link linkend="Tracking_Changes_to_Indicator_State_or_Map">section 8.5</link>).
</para>
</sect2>
</sect1>
<sect1 id='Tracking_Changes_to_Indicator_State_or_Map'>
<title>Tracking Changes to Indicator State or Map</title>
@ -2091,189 +1959,6 @@ have changed or not, for both
and <symbol>XkbIndicatorMapNotify</symbol> events.
</para>
<para>
When your client application receives either a
<symbol>XkbIndicatorStateNotify</symbol>
event or
<symbol>XkbIndicatorMapNotify</symbol>
event, you can note the changes in a changes structure by calling
<function>XkbNoteIndicatorChanges</function>.
</para>
<indexterm significance="preferred" zone="XkbNoteIndicatorChanges"><primary><function>XkbNoteIndicatorChanges</function></primary></indexterm>
<funcsynopsis id="XkbNoteIndicatorChanges">
<funcprototype>
<funcdef>void <function>XkbNoteIndicatorChanges</function></funcdef>
<!-- (
<parameter>old</parameter>,
<parameter>new</parameter>,
<parameter>wanted</parameter>
) -->
<paramdef>XkbIndicatorChangesPtr <parameter>old</parameter></paramdef>
<paramdef>XkbIndicatorNotifyEvent *<parameter>new</parameter></paramdef>
<paramdef>unsigned int <parameter>wanted</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<variablelist>
<varlistentry>
<term>
<parameter>old</parameter>
</term>
<listitem>
<para>
XkbIndicatorChanges structure to be updated
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>new</parameter>
</term>
<listitem>
<para>
event from which changes are to be copied
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>wanted</parameter>
</term>
<listitem>
<para>
which changes are to be noted
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
The
<parameter>wanted</parameter>
parameter is the bitwise inclusive OR of
<symbol>XkbIndicatorMapMask</symbol>
and
<emphasis>XkbIndicatorStateMask</emphasis>.
<function>XkbNoteIndicatorChanges</function>
copies any changes reported in
<parameter>new</parameter>
and specified in
<parameter>wanted</parameter>
into the changes record specified by
<parameter>old</parameter>.
</para>
<para>
To update a local copy of the keyboard description with the actual values, pass
the results of one or more calls to
<function>XkbNoteIndicatorChanges</function>
to
<function>XkbGetIndicatorChanges</function>:
</para>
<indexterm significance="preferred" zone="XkbGetIndicatorChanges"><primary><function>XkbGetIndicatorChanges</function></primary></indexterm>
<funcsynopsis id="XkbGetIndicatorChanges">
<funcprototype>
<funcdef>Status <function>XkbGetIndicatorChanges</function></funcdef>
<!-- (
<parameter>dpy</parameter>,
<parameter>xkb</parameter>,
<parameter>changes</parameter>,
<parameter>state</parameter>
) -->
<paramdef>Display *<parameter>dpy</parameter></paramdef>
<paramdef>XkbDescPtr <parameter>xkb</parameter></paramdef>
<paramdef>XkbIndicatorChangesPtr <parameter>changes</parameter></paramdef>
<paramdef>unsigned int *<parameter>state</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<variablelist>
<varlistentry>
<term>
<parameter>dpy</parameter>
</term>
<listitem>
<para>
connection to the X server
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>xkb</parameter>
</term>
<listitem>
<para>
keyboard description to hold the new values
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>changes</parameter>
</term>
<listitem>
<para>
indicator maps/state to be obtained from the server
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>state</parameter>
</term>
<listitem>
<para>
backfilled with the state of the indicators
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
<function>XkbGetIndicatorChanges</function>
examines the
<parameter>changes</parameter>
parameter, pulls over the necessary information from the server, and copies
the results into the
<parameter>xkb</parameter>
keyboard description. If any bits are set in the
<structfield>state_changes</structfield>
field of
<parameter>changes</parameter>,
<function>XkbGetIndicatorChanges</function>
also places the state of those indicators in
<parameter>state</parameter>.
If the
<structfield>indicators</structfield>
field of
<parameter>xkb</parameter>
is
<symbol>NULL</symbol>,
<function>XkbGetIndicatorChanges</function>
allocates and initializes it. To free the
<structfield>indicators</structfield>
field, use
<function>XkbFreeIndicatorMaps</function>
(see <link linkend="Allocating_and_Freeing_Indicator_Maps">section 8.6</link>).
</para>
<para>
<function>XkbGetIndicatorChanges</function>
can generate
<errorname>BadAlloc</errorname>,
<errorname>BadImplementation</errorname>,
and
<errorname>BadMatch</errorname>
errors.
</para>
</sect1>
<sect1 id='Allocating_and_Freeing_Indicator_Maps'>
<title>Allocating and Freeing Indicator Maps</title>