Skip to content
Commits on Source (34)
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([libX11], [1.6.5],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libX11])
AC_INIT([libX11], [1.6.6],
[https://gitlab.freedesktop.org/xorg/lib/libx11/issues], [libX11])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([src/config.h include/X11/XlibConf.h])
AC_CONFIG_MACRO_DIR([m4])
......
......@@ -111,6 +111,7 @@ libman_PRE = \
XkbGetKeyboardByName.man \
XkbGetMap.man \
XkbGetNameChanges.man \
XkbGetNamedDeviceIndicator.man \
XkbGetNamedGeometry.man \
XkbGetNamedIndicator.man \
XkbGetNames.man \
......@@ -191,6 +192,7 @@ libman_PRE = \
XkbSetIndicatorMap.man \
XkbSetMap.man \
XkbSetModActionVMods.man \
XkbSetNamedDeviceIndicator.man \
XkbSetNamedIndicator.man \
XkbSetNames.man \
XkbSetPtrActionX.man \
......
......@@ -99,37 +99,41 @@ Table 1 Xkb Controls
_
Control Control
Selection Relevant
Mask XkbControlsRec Boolean Control
(which parameter) DataFields enabled_ctrls bit Section
Mask (which XkbControlsRec Boolean Control
parameter) DataFields enabled_ctrls bit Section
_
T{
AccessXFeedback
T} T{
XkbAccessXFeedbackMask
T} ax_options: T{
XkbAccessXFeedbackMask
T} 10.6.3
XkbAccessX\%FeedbackMask
T} T{
ax_options:
XkbAX_*FBMask
T} T{
XkbAccessX\%FeedbackMask
T} 10.6.3
T{
AccessXKeys
T} T{
XkbAccessXKeysMask
XkbAccessX\%Keys\%Mask
T} 10.6.1
T{
AccessXTimeout
AccessX\%Timeout
T} T{
XkbAccessXTimeoutMask
T} ax_timeout T{
XkbAccessXTimeoutMask
T} 10.6.2
XkbAccessX\%Timeout\%Mask
T} T{
ax_timeout
axt_opts_mask
axt_opts_values
axt_ctrls_mask
axt_ctrls_values
T} T{
XkbAccessX\%Timeout\%Mask
T} 10.6.2
T{
AudibleBell
T} T{
XkbAudibleBellMask
XkbAudible\%Bell\%Mask
T} 9.2
T{
AutoReset
......@@ -137,9 +141,9 @@ T} 10.1.2
T{
BounceKeys
T} T{
XkbBounceKeysMask
XkbBounce\%KeysMask
T} debounce_delay T{
XkbBounceKeysMask
XkbBounce\%KeysMask
T} 10.6.7
T{
Detectable-
......@@ -150,35 +154,35 @@ T}
T{
EnabledControls
T} T{
XkbControlsEnabledMask
XkbControls\%EnabledMask
T} enabled_ctrls T{
Non-Boolean Control
Non-Boolean \%Control
T} 10.1.1
T{
GroupsWrap
T} T{
XkbGroupsWrapMask
XkbGroups\%Wrap\%Mask
T} groups_wrap T{
Non-Boolean Control
Non-Boolean \%Control
T} 10.7.1
T{
IgnoreGroupLock
T} T{
XkbIgnoreGroupLockMask
XkbIgnore\%GroupLock\%Mask
T} 10.7.3
T{
IgnoreLockMods
T} T{
XkbIgnoreLockModsMask
XkbIgnore\%LockMods\%Mask
T} ignore_lock T{
Non-Boolean Control
Non-Boolean \%Control
T} 5.1
T{
InternalMods
T} T{
XkbInternalModsMask
XkbInternal\%Mods\%Mask
T} internal T{
Non-Boolean Control
Non-Boolean \%Control
T} 5.1
T{
MouseKeys
......@@ -190,14 +194,16 @@ T} 10.5.1
T{
MouseKeysAccel
T} T{
XkbMouseKeysAccelMask
T} mk_delay T{
XkbMouseKeysAccelMask
T} 10.5.2
XkbMouseKeys\%Accel\%Mask
T} T{
mk_delay
mk_interval
mk_time_to_max
mk_max_speed
mk_curve
T} T{
XkbMouseKeys\%Accel\%Mask
T} 10.5.2
T{
Overlay1
T} T{
......@@ -211,34 +217,36 @@ T} 10.4
T{
PerKeyRepeat
T} T{
XkbPerKeyRepeatMask
XkbPerKey\%Repeat\%Mask
T} per_key_repeat T{
Non-Boolean Control
Non-Boolean \%Control
T} 10.3.1
T{
RepeatKeys
T} T{
XkbRepeatKeysMask
Xkb\%Repeat\%Keys\%Mask
T} repeat_delay T{
XkbRepeatKeysMask
Xkb\%Repeat\%Keys\%Mask
T} 10.3
repeat_interval
T{
SlowKeys
T} T{
XkbSlowKeysMask
Xkb\%Slow\%Keys\%Mask
T} slow_keys_delay T{
XkbSlowKeysMask
Xkb\%Slow\%Keys\%Mask
T} 10.6.6
T{
StickyKeys
T} T{
XkbStickyKeysMask
T} ax_options: T{
XkbStickyKeysMask
T} 10.6.8
Xkb\%Sticky\%Keys\%Mask
T} T{
ax_options:
XkbAX_TwoKeysMask
XkbAX_LatchToLockMask
T} T{
Xkb\%Sticky\%Keys\%Mask
T} 10.6.8
.TE
Table 2 shows the actual values for the individual mask bits used to select
......@@ -260,8 +268,9 @@ l l l l
l l l l.
Table 2 Controls Mask Bits
_
Mask Bit which or enabled Value
changed_ctrls _ctrls
Mask Bit which or Value
changed enabled
_ctrls _ctrls
_
XkbRepeatKeysMask ok ok (1L<<0)
XkbSlowKeysMask ok ok (1L<<1)
......
.so man__libmansuffix__/XkbGetNamedIndicator.__libmansuffix__
.\" Copyright 1999 Oracle and/or its affiliates. All rights reserved.
.\" Copyright 1999, 2017, Oracle and/or its affiliates. All rights reserved.
.\"
.\" Permission is hereby granted, free of charge, to any person obtaining a
.\" copy of this software and associated documentation files (the "Software"),
......@@ -25,9 +25,19 @@ XkbGetNamedIndicator \- Look up the indicator map and other information for an
indicator by name
.SH SYNOPSIS
.HP
.B Bool XkbGetNamedIndicator
.B Bool XkbGetNamedDeviceIndicator
.BI "(\^Display *" "dpy" "\^,"
.BI "unsigned int " "dev_spec" "\^,"
.BI "unsigned int " "led_class" "\^,"
.BI "unsigned int " "led_id" "\^,"
.BI "Atom " "name" "\^,"
.BI "int *" "ndx_rtrn" "\^,"
.BI "Bool *" "state_rtrn" "\^,"
.BI "XkbIndicatorMapPtr " "map_rtrn" "\^,"
.BI "Bool *" "real_rtrn" "\^);"
.HP
.B Bool XkbGetNamedIndicator
.BI "(\^Display *" "dpy" "\^,"
.BI "Atom " "name" "\^,"
.BI "int *" "ndx_rtrn" "\^,"
.BI "Bool *" "state_rtrn" "\^,"
......@@ -43,6 +53,12 @@ connection to the X server
.I \- dev_spec
keyboard device ID, or XkbUseCoreKbd
.TP
.I \- led_class
feedback class, or XkbDfltXIClass
.TP
.I \- led_id
feedback ID, or XkbDfltXIId
.TP
.I \- name
name of the indicator to be retrieved
.TP
......@@ -65,16 +81,16 @@ to get the indicator names. Using names eliminates the need for hard-coding
bitmask values for particular keyboards. For example, instead of using
vendor-specific constants such as WSKBLed_ScrollLock mask on Digital
workstations or XLED_SCROLL_LOCK on Sun workstations, you can instead use
.I XkbGetNamedIndicator
.I XkbGetNamedDeviceIndicator
to look up information on the indicator named "Scroll Lock."
If the device specified by
.I device_spec
has an indicator named
.I name, XkbGetNamedIndicator
.IR name ", " XkbGetNamedDeviceIndicator
returns True and populates the rest of the parameters with information about the
indicator. Otherwise,
.I XkbGetNamedIndicator
.I XkbGetNamedDeviceIndicator
returns False.
The
......@@ -95,22 +111,42 @@ Each of the "
" arguments is optional; you can pass NULL for any unneeded "
.I _rtrn
" arguments.
.LP
.I XkbGetNamedIndicator
is a convenience function that calls
.I XkbGetNamedDeviceIndicator
with a
.I device_spec
of
.BR XkbUseCoreKbd ,
a
.I led_class
of
.BR XkbDfltXIClass ,
and a
.I led_id
of
.BR XkbDfltXIId .
It returns the return value from
.IR XkbGetNamedDeviceIndicator .
.SH "RETURN VALUES"
.TP 15
True
The
.I XkbGetNamedIndicator
function returns True if the device specified by
.IR XkbGetNamedIndicator " and " XkbGetNamedDeviceIndicator
functions return True if the device specified by
.I device_spec
has an indicator named
.I name.
.IR name .
.TP 15
False
The
.I XkbGetNamedIndicator
function returns False if the device specified by
.IR XkbGetNamedIndicator " and " XkbGetNamedDeviceIndicator
functions return False if the device specified by
.I device_spec
does not have an indicator named
.I name.
.IR name .
.SH "SEE ALSO"
.BR XkbGetNames (__libmansuffix__)
......@@ -97,7 +97,7 @@ XkbRedirectIntoRange XkbRedirectIntoRange
XkbClampIntoRange XkbClampIntoRange
none of the above XkbWrapIntoRange
.TE
.LP
.\"--- Chapter 10
The Xkb extension is composed of two parts: a server extension, and a
client-side X library extension.
......@@ -142,7 +142,7 @@ function to manipulate one
control individually, you do not use an XkbControlsRec structure directly.
The Xkb controls are grouped as shown in Table 2.
.ad l
.TS
c s s
l l l
......@@ -152,43 +152,51 @@ _
Type of Control Control Name Boolean Control?
_
T{
Controls for enabling and disabling other controls
Controls for enabling and \%disabling other controls
T} EnabledControls No
AutoReset No
\^ AutoReset No
_
T{
Control for bell behavior
T} AudibleBell Boolean
_
T{
Controls for repeat key behavior
T} PerKeyRepeat No
RepeatKeys Boolean
DetectableAutorepeat Boolean
\^ RepeatKeys Boolean
\^ DetectableAutorepeat Boolean
_
T{
Controls for keyboard overlays
Controls for \%keyboard overlays
T} Overlay1 Boolean
Overlay2 Boolean
\^ Overlay2 Boolean
_
T{
Controls for using the mouse from the keyboard
T} MouseKeys Boolean
MouseKeysAccel Boolean
\^ MouseKeysAccel Boolean
_
T{
Controls for better keyboard access by
T} AccessXFeedback Boolean
T{
physically impaired persons
T} AccessXKeys Boolean
AccessXTimeout Boolean
BounceKeys Boolean
SlowKeys Boolean
StickyKeys Boolean
T} AccessXFeedback Boolean
\^ AccessXKeys Boolean
\^ AccessXTimeout Boolean
\^ BounceKeys Boolean
\^ SlowKeys Boolean
\^ StickyKeys Boolean
_
T{
Controls for general keyboard mapping
T} GroupsWrap No
IgnoreGroupLock Boolean
IgnoreLockMods No
InternalMods No
\^ IgnoreGroupLock Boolean
\^ IgnoreLockMods No
\^ InternalMods No
_
.TE
.ad n
.LP
The individual categories and controls are described first, together with
functions for manipulating
them.
......@@ -212,9 +220,9 @@ handling */
} XkbSymMapRec, *XkbSymMapPtr;
.fi
.nf
.LP
The XkbControlsRec structure is defined as follows:
.nf
#define XkbMaxLegalKeyCode 255
#define XkbPerKeyBitArraySize ((XkbMaxLegalKeyCode+1)/8)
......
......@@ -25,7 +25,7 @@ XkbOpenDisplay \- Checks for a compatible version of the Xkb extension in both
the library and the server, and initializes the extension for use.
.SH SYNOPSIS
.HP
.B Display XkbOpenDisplay
.B Display *XkbOpenDisplay
.BI "(\^char *" "display_name" "\^,"
.BI "int *" "event_rtrn" "\^,"
.BI "int *" "error_rtrn" "\^,"
......
.so man__libmansuffix__/XkbSetNamedIndicator.__libmansuffix__
.\" Copyright 1999 Oracle and/or its affiliates. All rights reserved.
.\" Copyright 1999, 2017, Oracle and/or its affiliates. All rights reserved.
.\"
.\" Permission is hereby granted, free of charge, to any person obtaining a
.\" copy of this software and associated documentation files (the "Software"),
......@@ -26,9 +26,19 @@ the state of the indicator; sets the indicator to a specified state and sets the
indicator map for the indicator
.SH SYNOPSIS
.HP
.B Bool XkbSetNamedIndicator
.HP
.B Bool XkbSetNamedDeviceIndicator
.BI "(\^Display *" "dpy" "\^,"
.BI "unsigned int " "device_spec" "\^,"
.BI "unsigned int " "led_class" "\^,"
.BI "unsigned int " "led_id" "\^,"
.BI "Atom " "name" "\^,"
.BI "Bool " "change_state" "\^,"
.BI "Bool " "state" "\^,"
.BI "Bool " "create_new" "\^,"
.BI "XkbIndicatorMapPtr " "map" "\^);"
.B Bool XkbSetNamedIndicator
.BI "(\^Display *" "dpy" "\^,"
.BI "Atom " "name" "\^,"
.BI "Bool " "change_state" "\^,"
.BI "Bool " "state" "\^,"
......@@ -44,6 +54,12 @@ connection to the X server
.I \- device_spec
device ID, or XkbUseCoreKbd
.TP
.I \- led_class
feedback class, or XkbDfltXIClass
.TP
.I \- led_id
feedback ID, or XkbDfltXIId
.TP
.I \- name
name of the indicator to change
.TP
......@@ -61,7 +77,7 @@ new map for the indicator
.SH DESCRIPTION
.LP
If a compatible version of the Xkb extension is not available in the server,
.I XkbSetNamedIndicator
.I XkbSetNamedDeviceIndicator
returns False. Otherwise, it sends a request to the X server to change the
indicator specified by
.I name
......@@ -69,13 +85,16 @@ and returns True.
If
.I change_state
is True, and the optional parameter,
.I state,
is not NULL,
.I XkbSetNamedIndicator
is True,
.I XkbSetNamedDeviceIndicator
tells the server to change the state of the named indicator to the value
specified by
.I state.
.IR state .
If
.I change_state
is False, then
.I state
is not used.
If an indicator with the name specified by
.I name
......@@ -85,26 +104,45 @@ parameter tells the server whether it should create a new named indicator. If
.I create_new
is True, the server finds the first indicator that doesn't have a name and gives
it the name specified by
.I name.
.IR name .
If the optional parameter,
.I map, is not NULL,
.I XkbSetNamedIndicator
.IR map ,
is not NULL,
.I XkbSetNamedDeviceIndicator
tells the server to change the indicator's map to the values specified in
.I map.
.IR map .
In addition, it can also generate XkbIndicatorStateNotify,
XkbIndicatorMapNotify, and XkbNamesNotify events.
.LP
.I XkbSetNamedIndicator
is a convenience function that calls
.I XkbSetNamedDeviceIndicator
with a
.I device_spec
of
.BR XkbUseCoreKbd ,
a
.I led_class
of
.BR XkbDfltXIClass ,
and a
.I led_id
of
.BR XkbDfltXIId .
It returns the return value from
.IR XkbSetNamedDeviceIndicator .
.SH "RETURN VALUES"
.TP 15
True
The
.I XkbSetNamedIndicator
function returns True if a compatible version of the Xkb extension is available in the server.
.IR XkbSetNamedIndicator " and " XkbSetNamedDeviceIndicator
functions return True if a compatible version of the Xkb extension is available in the server.
.TP 15
False
The
.I XkbSetNamedIndicator
function returns False if a compatible version of the Xkb extension is not available in the server.
.IR XkbSetNamedIndicator " and " XkbSetNamedDeviceIndicator
functions return False if a compatible version of the Xkb extension is not available in the server.
.SH DIAGNOSTICS
.TP 15
.B BadAtom
......@@ -112,6 +150,24 @@ A name is neither a valid Atom or None
.TP 15
.B BadImplementation
Invalid reply from server
.TP 15
.B BadKeyboard
.I device_spec
does not specify a device with indicators.
.TP 15
.B BadMatch
.I led_id
is not
.B DfltXIId
and does not specify a feedback of the class specified by
.I led_class
on the device specified by
.IR device_spec .
.TP 15
.B BadValue
.I led_class
does not specify
.BR DfltXIClass ", " LedFeedbackClass ", or " KbdFeedbackClass .
.SH "SEE ALSO"
.BR XkbIndicatorMapNotify (__libmansuffix__),
.BR XkbIndicatorStateNotify (__libmansuffix__),
......
......@@ -624,16 +624,16 @@ _XimPreeditCaretCallback(Xim im,
*/
{
CARD8 buf[sz_ximPacketHeader + sz_ximPreeditCaretReply];
INT16 len = sz_XIMID + sz_XICID + sz_ximPreeditCaretReply;
INT16 rlen = sz_XIMID + sz_XICID + sz_ximPreeditCaretReply;
int p;
_XimSetHeader((XPointer)buf, XIM_PREEDIT_CARET_REPLY, 0, &len);
_XimSetHeader((XPointer)buf, XIM_PREEDIT_CARET_REPLY, 0, &rlen);
p = XIM_HEADER_SIZE;
*(CARD16*)&buf[p] = (CARD16)im->private.proto.imid; p += sz_CARD16;
*(CARD16*)&buf[p] = (CARD16)ic->private.proto.icid; p += sz_CARD16;
*(CARD32*)&buf[p] = (CARD32)cbs.position;
if (!(_XimWriteData(im, len, buf))) {
if (!(_XimWriteData(im, rlen, buf))) {
return XimCbError;
}
_XimFlushData(im);
......
......@@ -231,9 +231,8 @@ _XimReCreateIC(ic)
_XimRegisterFilter(ic);
MARK_IC_CONNECTED(ic);
if (save_ic->private.proto.ic_resources)
Xfree(save_ic->private.proto.ic_resources);
if (save_ic->private.proto.ic_inner_resources)
Xfree(save_ic->private.proto.ic_inner_resources);
Xfree(save_ic);
return True;
......@@ -845,22 +844,22 @@ _XimProtoICFree(
Xim im = (Xim)ic->core.im;
#endif
if (ic->private.proto.preedit_font) {
Xfree(ic->private.proto.preedit_font);
ic->private.proto.preedit_font = NULL;
}
if (ic->private.proto.status_font) {
Xfree(ic->private.proto.status_font);
ic->private.proto.status_font = NULL;
}
if (ic->private.proto.commit_info) {
_XimFreeCommitInfo(ic);
ic->private.proto.commit_info = NULL;
}
if (ic->private.proto.ic_inner_resources) {
Xfree(ic->private.proto.ic_inner_resources);
ic->private.proto.ic_inner_resources = NULL;
}
#ifdef XIM_CONNECTABLE
if (IS_SERVER_CONNECTED(im) && IS_RECONNECTABLE(im)) {
......@@ -868,18 +867,18 @@ _XimProtoICFree(
}
#endif /* XIM_CONNECTABLE */
if (ic->private.proto.saved_icvalues) {
Xfree(ic->private.proto.saved_icvalues);
ic->private.proto.saved_icvalues = NULL;
}
if (ic->private.proto.ic_resources) {
Xfree(ic->private.proto.ic_resources);
ic->private.proto.ic_resources = NULL;
}
if (ic->core.hotkey) {
Xfree(ic->core.hotkey);
ic->core.hotkey = NULL;
}
return;
}
......
......@@ -108,7 +108,7 @@ _XimFilterPropertyNotify(
}
lock = True;
for( ii = 0; ii < nitems; ii++, atoms ) {
for( ii = 0; ii < nitems; ii++ ) {
if(XGetSelectionOwner (display, atoms[ii])) {
for( icb = callback_list; icb; icb = icb->next ) {
if( !icb->call && !icb->destroy ) {
......
......@@ -82,8 +82,8 @@ struct _XimCacheStruct {
DTCharIndex mbused;
DTCharIndex wcused;
DTCharIndex utf8used;
char fname[1];
/* char encoding[1] */
char fname[];
/* char encoding[] */
};
static struct _XimCacheStruct* _XimCache_mmap = NULL;
......@@ -281,7 +281,7 @@ _XimReadCachedDefaultTree(
assert (m->id == XIM_CACHE_MAGIC);
assert (m->version == XIM_CACHE_VERSION);
if (size != m->size ||
size < XOffsetOf (struct _XimCacheStruct, fname) + namelen + encodinglen) {
size < sizeof (struct _XimCacheStruct) + namelen + encodinglen) {
fprintf (stderr, "Ignoring broken XimCache %s [%s]\n", name, encoding);
munmap (m, size);
return False;
......@@ -442,7 +442,7 @@ _XimWriteCachedDefaultTree(
int fd;
FILE *fp;
struct _XimCacheStruct *m;
int msize = (XOffsetOf(struct _XimCacheStruct, fname)
int msize = (sizeof(struct _XimCacheStruct)
+ strlen(name) + strlen(encoding) + 2
+ XIM_CACHE_TREE_ALIGNMENT-1) & -XIM_CACHE_TREE_ALIGNMENT;
DefTreeBase *b = &im->private.local.base;
......
......@@ -61,8 +61,8 @@ _XimLocalMbLookupString(XIC xic, XKeyEvent *ev, char *buffer, int bytes,
||(ic->private.local.brl_committed != 0))) {
if (ic->private.local.brl_committed != 0) { /* Braille Event */
unsigned char pattern = ic->private.local.brl_committed;
char mb[XLC_PUBLIC(ic->core.im->core.lcd, mb_cur_max)];
ret = _Xlcwctomb(ic->core.im->core.lcd, mb, BRL_UC_ROW | pattern);
char mb2[XLC_PUBLIC(ic->core.im->core.lcd, mb_cur_max)];
ret = _Xlcwctomb(ic->core.im->core.lcd, mb2, BRL_UC_ROW | pattern);
if(ret > bytes) {
if(status) *status = XBufferOverflow;
return(ret);
......@@ -74,7 +74,7 @@ _XimLocalMbLookupString(XIC xic, XKeyEvent *ev, char *buffer, int bytes,
} else {
if(status) *status = XLookupChars;
}
memcpy(buffer, mb, ret);
memcpy(buffer, mb2, ret);
} else {
if(keysym) {
if(status) *status = XLookupKeySym;
......
......@@ -1617,17 +1617,16 @@ free_fontdataOM(
FontData font_data,
int font_data_count)
{
if (!font_data)
return;
for( ; font_data_count-- ; font_data++) {
if(font_data->name){
Xfree(font_data->name);
font_data->name = NULL;
}
if(font_data->scopes){
Xfree(font_data->scopes);
font_data->scopes = NULL;
}
}
}
static Status
close_om(
......@@ -1639,51 +1638,41 @@ close_om(
if ((data = gen->data)) {
for (count = gen->data_num; count-- > 0; data++) {
if (data->charset_list){
Xfree(data->charset_list);
data->charset_list = NULL;
}
/* free font_data for om */
if (data->font_data) {
free_fontdataOM(data->font_data,data->font_data_count);
Xfree(data->font_data);
data->font_data = NULL;
}
/* free substitute for om */
if (data->substitute) {
free_fontdataOM(data->substitute,data->substitute_num);
Xfree(data->substitute);
data->substitute = NULL;
}
/* free vmap for om */
if (data->vmap) {
free_fontdataOM(data->vmap,data->vmap_num);
Xfree(data->vmap);
data->vmap = NULL;
}
/* free vrotate for om */
if (data->vrotate) {
Xfree(data->vrotate);
data->vrotate = NULL;
}
}
Xfree(gen->data);
gen->data = NULL;
}
if (gen->object_name){
Xfree(gen->object_name);
gen->object_name = NULL;
}
if (om->core.res_name){
Xfree(om->core.res_name);
om->core.res_name = NULL;
}
if (om->core.res_class){
Xfree(om->core.res_class);
om->core.res_class = NULL;
}
if (om->core.required_charset.charset_list &&
om->core.required_charset.charset_count > 0){
XFreeStringList(om->core.required_charset.charset_list);
......@@ -1692,10 +1681,9 @@ close_om(
Xfree((char*)om->core.required_charset.charset_list);
om->core.required_charset.charset_list = NULL;
}
if (om->core.orientation_list.orientation){
Xfree(om->core.orientation_list.orientation);
om->core.orientation_list.orientation = NULL;
}
Xfree(om);
......
......@@ -62,7 +62,7 @@ as discussed in <xref linkend="Symbolic_Names" />. Then set the map using
<function>XkbSetMap</function>
(see <link linkend="Changing_Map_Components_in_the_Server">section 14.3</link>)
or
<function>XkbSetNamedIndicator</function>
<function>XkbSetNamedDeviceIndicator</function>
(below). To retrieve indicator names, use
<function>XkbGetNames</function>
(<xref linkend="Symbolic_Names" />).
......@@ -266,7 +266,7 @@ is not, and if you call a function which updates the server’s image of the
indicator map (such as
<function>XkbSetIndicatorMap</function>
or
<function>XkbSetNamedIndicator</function>),
<function>XkbSetNamedDeviceIndicator</function>),
Xkb changes the keyboard state and controls to reflect the other fields of
the indicator map, as described in the remainder of this section. If you
attempt to explicitly change the value of an indicator for which
......@@ -840,7 +840,7 @@ implementation, uses a mask to specify the indicators. The second method, which
is more suitable for applications concerned with interoperability, uses
indicator names. The correspondence between the indicator name and the bit
position in masks is as follows: one of the parameters returned from
<function>XkbGetNamedIndicator</function>
<function>XkbGetNamedDeviceIndicator</function>
is an index that is the bit position to use in any function call that requires
a mask of indicator bits, as well as the indicator’s index into the
<structname>XkbIndicatorRec</structname>
......@@ -1038,20 +1038,22 @@ of using vendor-specific constants such as
mask on Digital workstations or
<symbol>XLED_SCROLL_LOCK</symbol>
on Sun workstations, you can instead use
<function>XkbGetNamedDeviceIndicator</function> or
<function>XkbGetNamedIndicator</function>
to look up information on the indicator named <quote>Scroll Lock.</quote>
</para>
<para>
Use
<function>XkbGetNamedIndicator</function>
to look up the indicator map and other information for an indicator by name.
<function>XkbGetNamedDeviceIndicator</function>
to look up the indicator map and other information for an indicator by name
on a specific device.
</para>
<indexterm significance="preferred" zone="XkbGetNamedIndicator"><primary><function>XkbGetNamedIndicator</function></primary></indexterm>
<funcsynopsis id="XkbGetNamedIndicator">
<indexterm significance="preferred" zone="XkbGetNamedDeviceIndicator"><primary><function>XkbGetNamedDeviceIndicator</function></primary></indexterm>
<funcsynopsis id="XkbGetNamedDeviceIndicator">
<funcprototype>
<funcdef>Bool <function>XkbGetNamedIndicator</function></funcdef>
<funcdef>Bool <function>XkbGetNamedDeviceIndicator</function></funcdef>
<!-- (
<parameter>dpy</parameter>,
<parameter>dev_spec</parameter>,
......@@ -1064,6 +1066,8 @@ to look up the indicator map and other information for an indicator by name.
<paramdef>Display *<parameter>dpy</parameter></paramdef>
<paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
<paramdef>unsigned int <parameter>led_class</parameter></paramdef>
<paramdef>unsigned int <parameter>led_id</parameter></paramdef>
<paramdef>Atom <parameter>name</parameter></paramdef>
<paramdef>int *<parameter>ndx_rtrn</parameter></paramdef>
<paramdef>Bool *<parameter>state_rtrn</parameter></paramdef>
......@@ -1092,6 +1096,26 @@ to look up the indicator map and other information for an indicator by name.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>led_class</parameter>
</term>
<listitem>
<para>
feedback class, or <symbol>XkbDfltXIClass</symbol>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>led_id</parameter>
</term>
<listitem>
<para>
feedback ID, or <symbol>XkbDfltXIId</symbol>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>name</parameter>
......@@ -1148,14 +1172,16 @@ to look up the indicator map and other information for an indicator by name.
<para>
If the device specified by
<parameter>device_spec</parameter>
with feedback specified by
<parameter>led_class</parameter> and <parameter>led_id</parameter>
has an indicator named
<parameter>name</parameter>,
<function>XkbGetNamedIndicator</function>
<function>XkbGetNamedDeviceIndicator</function>
returns
<symbol>True</symbol>
and populates the rest of the parameters with information about the indicator.
Otherwise,
<function>XkbGetNamedIndicator</function>
<function>XkbGetNamedDeviceIndicator</function>
returns
<symbol>False</symbol>.
</para>
......@@ -1192,7 +1218,7 @@ for any unneeded "<parameter>_rtrn</parameter>" arguments.
<para>
<function>XkbGetNamedIndicator</function>
<function>XkbGetNamedDeviceIndicator</function>
can generate
<errorname>BadAtom</errorname>
and
......@@ -1200,6 +1226,108 @@ and
errors.
</para>
<para>
As a convenience function, Xkb provides a function to get information about
indicators with the default class and identifier on the default device:
<function>XkbGetNamedIndicator</function>.
</para>
<indexterm significance="preferred" zone="XkbGetNamedIndicator"><primary><function>XkbGetNamedIndicator</function></primary></indexterm>
<funcsynopsis id="XkbGetNamedIndicator">
<funcprototype>
<funcdef>Bool <function>XkbGetNamedIndicator</function></funcdef>
<paramdef>Display *<parameter>dpy</parameter></paramdef>
<paramdef>Atom <parameter>name</parameter></paramdef>
<paramdef>int *<parameter>ndx_rtrn</parameter></paramdef>
<paramdef>Bool *<parameter>state_rtrn</parameter></paramdef>
<paramdef>XkbIndicatorMapPtr <parameter>map_rtrn</parameter></paramdef>
<paramdef>Bool *<parameter>real_rtrn</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<variablelist>
<varlistentry>
<term>
<parameter>dpy</parameter>
</term>
<listitem>
<para>
connection to the X server
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>name</parameter>
</term>
<listitem>
<para>
name of the indicator to be retrieved
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>ndx_rtrn</parameter>
</term>
<listitem>
<para>
backfilled with the index of the retrieved indicator
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>state_rtrn</parameter>
</term>
<listitem>
<para>
backfilled with the current state of the retrieved indicator
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>map_rtrn</parameter>
</term>
<listitem>
<para>
backfilled with the mapping for the retrieved indicator
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>real_rtrn</parameter>
</term>
<listitem>
<para>
backfilled with <symbol>True</symbol>
if the named indicator is real (physical)
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
<function>XkbGetNamedIndicator</function>
calls
<function>XkbGetNamedDeviceIndicator</function>
with the specified parameters, a
<structfield>device_spec</structfield>
of
<symbol>XkbUseCoreKbd</symbol>,
a
<structfield>led_class</structfield>
of
<symbol>XkbDfltXIClass</symbol>,
and a
<structfield>led_id</structfield>
of
<symbol>XkbDfltXIId</symbol>,
and returns the value which was returned by
<function>XkbGetNamedDeviceIndicator</function>.
</para>
</sect2>
</sect1>
......@@ -1222,7 +1350,7 @@ There are two ways to make changes to indicator maps and state: either change a
local copy of the indicator maps and use
<function>XkbSetIndicatorMap</function>
or
<function>XkbSetNamedIndicator</function>,
<function>XkbSetNamedDeviceIndicator</function>,
or, to reduce network traffic, use an
<structname>XkbIndicatorChangesRec</structname>
structure and use
......@@ -1252,7 +1380,7 @@ is not, and if you call a function that updates the server’s image of the
indicator map (such as
<function>XkbSetIndicatorMap</function>
or
<function>XkbSetNamedIndicator</function>),
<function>XkbSetNamedDeviceIndicator</function>),
Xkb changes the keyboard state and controls to reflect the other fields of
the indicator map. If you attempt to explicitly change the value of an
indicator for which
......@@ -1404,6 +1532,7 @@ parameter to the server.
<title>Changing Indicator Maps by Name</title>
<para>
<function>XkbSetNamedDeviceIndicator</function> and
<function>XkbSetNamedIndicator</function>
can do several related things:
</para>
......@@ -1431,10 +1560,10 @@ Set the indicator map for the indicator
</listitem>
</itemizedlist>
<indexterm significance="preferred" zone="XkbSetNamedIndicator"><primary><function>XkbSetNamedIndicator</function></primary></indexterm>
<funcsynopsis id="XkbSetNamedIndicator">
<indexterm significance="preferred" zone="XkbSetNamedDeviceIndicator"><primary><function>XkbSetNamedDeviceIndicator</function></primary></indexterm>
<funcsynopsis id="XkbSetNamedDeviceIndicator">
<funcprototype>
<funcdef>Bool<function>XkbSetNamedIndicator</function></funcdef>
<funcdef>Bool<function>XkbSetNamedDeviceIndicator</function></funcdef>
<!-- (
<parameter>dpy</parameter>,
<parameter>device_spec</parameter>,
......@@ -1446,6 +1575,8 @@ Set the indicator map for the indicator
<paramdef>Display *<parameter>dpy</parameter></paramdef>
<paramdef>unsigned int <parameter>device_spec</parameter></paramdef>
<paramdef>unsigned int <parameter>led_class</parameter></paramdef>
<paramdef>unsigned int <parameter>led_id</parameter></paramdef>
<paramdef>Atom <parameter>name</parameter></paramdef>
<paramdef>Bool <parameter>change_state</parameter></paramdef>
<paramdef>Bool <parameter>state</parameter></paramdef>
......@@ -1474,6 +1605,26 @@ Set the indicator map for the indicator
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>led_class</parameter>
</term>
<listitem>
<para>
feedback class, or <symbol>XkbDfltXIClass</symbol>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>led_id</parameter>
</term>
<listitem>
<para>
feedback ID, or <symbol>XkbDfltXIId</symbol>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>name</parameter>
......@@ -1529,7 +1680,7 @@ Set the indicator map for the indicator
<para>
If a compatible version of the Xkb extension is not available in the server,
<function>XkbSetNamedIndicator</function>
<function>XkbSetNamedDeviceIndicator</function>
returns
<symbol>False</symbol>.
Otherwise, it sends a request to the X server to change the indicator
......@@ -1545,14 +1696,16 @@ If
<parameter>change_state</parameter>
is
<symbol>True</symbol>,
and the optional parameter,
<parameter>state</parameter>,
is not
<symbol>NULL</symbol>,
<function>XkbSetNamedIndicator</function>
<function>XkbSetNamedDeviceIndicator</function>
tells the server to change the state of the named indicator to the value
specified by
<parameter>state</parameter>.
If
<parameter>change_state</parameter>
is
<symbol>False</symbol>,
<parameter>state</parameter>
is not used.
</para>
......@@ -1576,13 +1729,13 @@ If the optional parameter,
<parameter>map</parameter>,
is not
<symbol>NULL</symbol>,
<function>XkbSetNamedIndicator</function>
<function>XkbSetNamedDeviceIndicator</function>
tells the server to change the indicator’s map to the values specified
in <parameter>map</parameter>.
</para>
<para>
<function>XkbSetNamedIndicator</function>
<function>XkbSetNamedDeviceIndicator</function>
can generate
<errorname>BadAtom</errorname>
and
......@@ -1596,6 +1749,107 @@ and
events (see <link linkend="Tracking_Name_Changes">section 18.5</link>).
</para>
<para>
As a convenience function, Xkb provides a function to set information about
indicators with the default class and identifier on the default device:
<function>XkbSetNamedIndicator</function>.
</para>
<indexterm significance="preferred" zone="XkbSetNamedIndicator"><primary><function>XkbSetNamedIndicator</function></primary></indexterm>
<funcsynopsis id="XkbSetNamedIndicator">
<funcprototype>
<funcdef>Bool<function>XkbSetNamedIndicator</function></funcdef>
<paramdef>Display *<parameter>dpy</parameter></paramdef>
<paramdef>Atom <parameter>name</parameter></paramdef>
<paramdef>Bool <parameter>change_state</parameter></paramdef>
<paramdef>Bool <parameter>state</parameter></paramdef>
<paramdef>Bool <parameter>create_new</parameter></paramdef>
<paramdef>XkbIndicatorMapPtr <parameter>map</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<variablelist>
<varlistentry>
<term>
<parameter>dpy</parameter>
</term>
<listitem>
<para>
connection to the X server
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>name</parameter>
</term>
<listitem>
<para>
name of the indicator to change
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>change_state</parameter>
</term>
<listitem>
<para>
whether to change the indicator state or not
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>state</parameter>
</term>
<listitem>
<para>
desired new state for the indicator
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>create_new</parameter>
</term>
<listitem>
<para>
whether a new indicator with the specified name should be
created when necessary
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>map</parameter>
</term>
<listitem>
<para>
new map for the indicator
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
<function>XkbSetNamedIndicator</function>
calls
<function>XkbSetNamedDeviceIndicator</function>
with the specified parameters, a
<structfield>device_spec</structfield>
of
<symbol>XkbUseCoreKbd</symbol>,
a
<structfield>led_class</structfield>
of
<symbol>XkbDfltXIClass</symbol>,
and a
<structfield>led_id</structfield>
of
<symbol>XkbDfltXIId</symbol>,
and returns the value which was returned by
<function>XkbSetNamedDeviceIndicator</function>.
</para>
</sect2>
<sect2 id='XkbIndicatorChangesRec'>
......
......@@ -60,5 +60,5 @@ XDisplayName(
return( (char *)display );
if ( (d = getenv( "DISPLAY" )) != (char *)NULL )
return( d );
return( "" );
return( (char *) "" );
}
......@@ -195,7 +195,7 @@ XCreateFontSet (
if (oc && def_string) {
*def_string = oc->core.default_string;
if (!*def_string)
*def_string = "";
*def_string = (char *)"";
}
if (oc == NULL)
......
......@@ -88,14 +88,13 @@ int *actualCount) /* RETURN */
* unpack into null terminated strings.
*/
chstart = ch;
chend = ch + (rlen + 1);
chend = ch + rlen;
length = *(unsigned char *)ch;
*ch = 1; /* make sure it is non-zero for XFreeFontNames */
for (i = 0; i < rep.nFonts; i++) {
if (ch + length < chend) {
flist[i] = ch + 1; /* skip over length */
ch += length + 1; /* find next length ... */
if (ch <= chend) {
length = *(unsigned char *)ch;
*ch = '\0'; /* and replace with null-termination */
count++;
......@@ -106,13 +105,6 @@ int *actualCount) /* RETURN */
count = 0;
break;
}
} else {
Xfree(chstart);
Xfree(flist);
flist = NULL;
count = 0;
break;
}
}
}
*actualCount = count;
......
......@@ -42,7 +42,7 @@ char **XGetFontPath(
int count = 0;
register unsigned i;
register int length;
register xReq *req;
_X_UNUSED register xReq *req;
LockDisplay(dpy);
GetEmptyReq (GetFontPath, req);
......@@ -69,15 +69,20 @@ char **XGetFontPath(
/*
* unpack into null terminated strings.
*/
chend = ch + (nbytes + 1);
length = *ch;
chend = ch + nbytes;
length = *(unsigned char *)ch;
for (i = 0; i < rep.nPaths; i++) {
if (ch + length < chend) {
flist[i] = ch+1; /* skip over length */
ch += length + 1; /* find next length ... */
length = *ch;
length = *(unsigned char *)ch;
*ch = '\0'; /* and replace with null-termination */
count++;
} else if (i == 0) {
Xfree(flist);
Xfree(ch);
flist = NULL;
break;
} else
flist[i] = NULL;
}
......