diff options
Diffstat (limited to 'X11')
70 files changed, 18519 insertions, 159 deletions
diff --git a/X11/CallbackI.h b/X11/CallbackI.h new file mode 100644 index 000000000..64e815256 --- /dev/null +++ b/X11/CallbackI.h @@ -0,0 +1,121 @@ +/* $Xorg: CallbackI.h,v 1.4 2001/02/09 02:03:54 xorgcvs Exp $ */ +/*********************************************************** + +Copyright 1987, 1988, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ +/* $XFree86$ */ + +/**************************************************************** + * + * Callbacks + * + ****************************************************************/ + +typedef XrmResource **CallbackTable; + +#define _XtCBCalling 1 +#define _XtCBFreeAfterCalling 2 + +_XFUNCPROTOBEGIN + +typedef struct internalCallbackRec { + unsigned short count; + char is_padded; /* contains NULL padding for external form */ + char call_state; /* combination of _XtCB{FreeAfter}Calling */ +#ifdef LONG64 + unsigned int align_pad; /* padding to align callback list */ +#endif + /* XtCallbackList */ +} InternalCallbackRec, *InternalCallbackList; + +typedef Boolean (*_XtConditionProc)( + XtPointer /* data */ +); + +extern void _XtAddCallback( + InternalCallbackList* /* callbacks */, + XtCallbackProc /* callback */, + XtPointer /* closure */ +); + +extern void _XtAddCallbackOnce( + InternalCallbackList* /* callbacks */, + XtCallbackProc /* callback */, + XtPointer /* closure */ +); + +extern InternalCallbackList _XtCompileCallbackList( + XtCallbackList /* xtcallbacks */ +); + +extern XtCallbackList _XtGetCallbackList( + InternalCallbackList* /* callbacks */ +); + +extern void _XtRemoveAllCallbacks( + InternalCallbackList* /* callbacks */ +); + +extern void _XtRemoveCallback( + InternalCallbackList* /* callbacks */, + XtCallbackProc /* callback */, + XtPointer /* closure */ +); + +extern void _XtPeekCallback( + Widget /* widget */, + XtCallbackList /* callbacks */, + XtCallbackProc * /* callback */, + XtPointer * /* closure */ +); + +extern void _XtCallConditionalCallbackList( + Widget /* widget */, + XtCallbackList /* callbacks */, + XtPointer /* call_data */, + _XtConditionProc /* cond_proc */ +); + +_XFUNCPROTOEND diff --git a/X11/Composite.h b/X11/Composite.h new file mode 100644 index 000000000..c3c982868 --- /dev/null +++ b/X11/Composite.h @@ -0,0 +1,105 @@ +/* $Xorg: Composite.h,v 1.4 2001/02/09 02:03:54 xorgcvs Exp $ */ + +/*********************************************************** + +Copyright 1987, 1988, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ +/* $XFree86$ */ + +#ifndef _XtComposite_h +#define _XtComposite_h + +typedef struct _CompositeClassRec *CompositeWidgetClass; + +typedef Cardinal (*XtOrderProc)( + Widget /* child */ +); + +_XFUNCPROTOBEGIN + +extern void XtManageChildren( + WidgetList /* children */, + Cardinal /* num_children */ +); + +extern void XtManageChild( + Widget /* child */ +); + +extern void XtUnmanageChildren( + WidgetList /* children */, + Cardinal /* num_children */ +); + +extern void XtUnmanageChild( + Widget /* child */ +); + +typedef void (*XtDoChangeProc)( + Widget /* composite_parent */, + WidgetList /* unmanage_children */, + Cardinal * /* num_unmanage_children */, + WidgetList /* manage_children */, + Cardinal * /* num_manage_children */, + XtPointer /* client_data */ +); + +extern void XtChangeManagedSet( + WidgetList /* unmanage_children */, + Cardinal /* num_unmanage_children */, + XtDoChangeProc /* do_change_proc */, + XtPointer /* client_data */, + WidgetList /* manage_children */, + Cardinal /* num_manage_children */ +); + +_XFUNCPROTOEND + +#ifndef VMS +externalref WidgetClass compositeWidgetClass; +#endif + +#endif /* _XtComposite_h */ +/* DON'T ADD STUFF AFTER THIS #endif */ diff --git a/X11/CompositeP.h b/X11/CompositeP.h new file mode 100644 index 000000000..e93275ace --- /dev/null +++ b/X11/CompositeP.h @@ -0,0 +1,115 @@ +/* $Xorg: CompositeP.h,v 1.4 2001/02/09 02:03:54 xorgcvs Exp $ */ + +/*********************************************************** + +Copyright 1987, 1988, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +#ifndef _XtCompositeP_h +#define _XtCompositeP_h + +#include <X11/Composite.h> + +_XFUNCPROTOBEGIN + +/************************************************************************ + * + * Additional instance fields for widgets of (sub)class 'Composite' + * + ************************************************************************/ + +typedef struct _CompositePart { + WidgetList children; /* array of ALL widget children */ + Cardinal num_children; /* total number of widget children */ + Cardinal num_slots; /* number of slots in children array */ + XtOrderProc insert_position; /* compute position of new child */ +} CompositePart,*CompositePtr; + +typedef struct _CompositeRec { + CorePart core; + CompositePart composite; +} CompositeRec; + +/********************************************************************* + * + * Additional class fields for widgets of (sub)class 'Composite' + * + ********************************************************************/ + +typedef struct _CompositeClassPart { + XtGeometryHandler geometry_manager; /* geometry manager for children */ + XtWidgetProc change_managed; /* change managed state of child */ + XtWidgetProc insert_child; /* physically add child to parent */ + XtWidgetProc delete_child; /* physically remove child */ + XtPointer extension; /* pointer to extension record */ +} CompositeClassPart,*CompositePartPtr; + +typedef struct { + XtPointer next_extension; /* 1st 4 mandated for all extension records */ + XrmQuark record_type; /* NULLQUARK; on CompositeClassPart */ + long version; /* must be XtCompositeExtensionVersion */ + Cardinal record_size; /* sizeof(CompositeClassExtensionRec) */ + Boolean accepts_objects; + Boolean allows_change_managed_set; +} CompositeClassExtensionRec, *CompositeClassExtension; + + +typedef struct _CompositeClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; +} CompositeClassRec; + +externalref CompositeClassRec compositeClassRec; + +_XFUNCPROTOEND + +#define XtCompositeExtensionVersion 2L +#define XtInheritGeometryManager ((XtGeometryHandler) _XtInherit) +#define XtInheritChangeManaged ((XtWidgetProc) _XtInherit) +#define XtInheritInsertChild ((XtWidgetProc) _XtInherit) +#define XtInheritDeleteChild ((XtWidgetProc) _XtInherit) + +#endif /* _XtCompositeP_h */ +/* DON'T ADD STUFF AFTER THIS #endif */ diff --git a/X11/ConstrainP.h b/X11/ConstrainP.h new file mode 100644 index 000000000..7030a3411 --- /dev/null +++ b/X11/ConstrainP.h @@ -0,0 +1,98 @@ +/* $Xorg: ConstrainP.h,v 1.4 2001/02/09 02:03:54 xorgcvs Exp $ */ +/* $oHeader: ConstrainP.h,v 1.2 88/08/18 15:54:15 asente Exp $ */ +/*********************************************************** + +Copyright 1987, 1988, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +#ifndef _XtConstraintP_h +#define _XtConstraintP_h + +#include <X11/Constraint.h> + +_XFUNCPROTOBEGIN + +typedef struct _ConstraintPart { + XtPointer mumble; /* No new fields, keep C compiler happy */ +} ConstraintPart; + +typedef struct _ConstraintRec { + CorePart core; + CompositePart composite; + ConstraintPart constraint; +} ConstraintRec, *ConstraintWidget; + +typedef struct _ConstraintClassPart { + XtResourceList resources; /* constraint resource list */ + Cardinal num_resources; /* number of constraints in list */ + Cardinal constraint_size; /* size of constraint record */ + XtInitProc initialize; /* constraint initialization */ + XtWidgetProc destroy; /* constraint destroy proc */ + XtSetValuesFunc set_values; /* constraint set_values proc */ + XtPointer extension; /* pointer to extension record */ +} ConstraintClassPart; + +typedef struct { + XtPointer next_extension; /* 1st 4 mandated for all extension records */ + XrmQuark record_type; /* NULLQUARK; on ConstraintClassPart */ + long version; /* must be XtConstraintExtensionVersion */ + Cardinal record_size; /* sizeof(ConstraintClassExtensionRec) */ + XtArgsProc get_values_hook; +} ConstraintClassExtensionRec, *ConstraintClassExtension; + +typedef struct _ConstraintClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ConstraintClassPart constraint_class; +} ConstraintClassRec; + +externalref ConstraintClassRec constraintClassRec; + +_XFUNCPROTOEND + +#define XtConstraintExtensionVersion 1L + +#endif /* _XtConstraintP_h */ +/* DON'T ADD STUFF AFTER THIS #endif */ diff --git a/X11/Constraint.h b/X11/Constraint.h new file mode 100644 index 000000000..977e7eeac --- /dev/null +++ b/X11/Constraint.h @@ -0,0 +1,64 @@ +/* $Xorg: Constraint.h,v 1.4 2001/02/09 02:03:54 xorgcvs Exp $ */ +/* $oHeader: Constraint.h,v 1.2 88/08/18 15:54:18 asente Exp $ */ +/*********************************************************** + +Copyright 1987, 1988, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +#ifndef _XtConstraint_h +#define _XtConstraint_h + +_XFUNCPROTOBEGIN + +typedef struct _ConstraintClassRec *ConstraintWidgetClass; + +#ifndef VMS +externalref WidgetClass constraintWidgetClass; +#endif + +_XFUNCPROTOEND + +#endif /* _XtConstraint_h */ +/* DON'T ADD STUFF AFTER THIS #endif */ diff --git a/X11/ConvertI.h b/X11/ConvertI.h new file mode 100644 index 000000000..f3f7fb0ba --- /dev/null +++ b/X11/ConvertI.h @@ -0,0 +1,99 @@ +/* $Xorg: ConvertI.h,v 1.4 2001/02/09 02:03:54 xorgcvs Exp $ */ + +/*********************************************************** + +Copyright 1987, 1988, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ +/* $XFree86: xc/lib/Xt/ConvertI.h,v 1.3 2001/12/14 19:56:09 dawes Exp $ */ + +_XFUNCPROTOBEGIN + +/* Representation types */ + +extern XrmQuark _XtQString; + +/* + * Resource conversions + */ + +typedef struct _ConverterRec **ConverterTable; + +extern void _XtAddDefaultConverters( + ConverterTable /* table */ +); + +extern void _XtSetDefaultConverterTable( + ConverterTable* /* table */ +); + +extern void _XtFreeConverterTable( + ConverterTable /* table */ +); + +extern void _XtTableAddConverter( + ConverterTable /* table */, + XrmRepresentation /* from_type */, + XrmRepresentation /* to_type */, + XtTypeConverter /* converter */, + XtConvertArgList /* convert_args */, + Cardinal /* num_args */, + _XtBoolean /* new_style */, + XtCacheType /* cache_type */, + XtDestructor /* destructor */, + _XtBoolean /* global */ +); + +extern Boolean _XtConvert( + Widget /* widget */, + XrmRepresentation /* from_type */, + XrmValuePtr /* from */, + XrmRepresentation /* to_type */, + XrmValuePtr /* to */, + XtCacheRef* /* cache_ref_return */ +); + +void _XtConvertInitialize(void); + +_XFUNCPROTOEND diff --git a/X11/Core.h b/X11/Core.h new file mode 100644 index 000000000..5127b501a --- /dev/null +++ b/X11/Core.h @@ -0,0 +1,70 @@ +/* +* $Xorg: Core.h,v 1.4 2001/02/09 02:03:54 xorgcvs Exp $ +* $oHeader: Core.h,v 1.2 88/08/18 15:54:32 asente Exp $ +*/ + +/*********************************************************** + +Copyright 1987, 1988, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +#ifndef _XtCore_h +#define _XtCore_h + +_XFUNCPROTOBEGIN + +typedef struct _WidgetClassRec *CoreWidgetClass; +typedef struct _WidgetRec *CoreWidget; +externalref WidgetClass coreWidgetClass; + +#ifndef VMS +externalref WidgetClass widgetClass; + +#endif + +_XFUNCPROTOEND + +#endif /* _XtCore_h */ +/* DON'T ADD STUFF AFTER THIS #endif */ diff --git a/X11/CoreP.h b/X11/CoreP.h new file mode 100644 index 000000000..57836e615 --- /dev/null +++ b/X11/CoreP.h @@ -0,0 +1,175 @@ +/* +* $Xorg: CoreP.h,v 1.4 2001/02/09 02:03:54 xorgcvs Exp $ +* $oHeader: CoreP.h,v 1.2 88/08/18 15:54:37 asente Exp $ +*/ + +/*********************************************************** + +Copyright 1987, 1988, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +#ifndef XtCoreP_h +#define XtCoreP_h + +#include <X11/Core.h> + +_XFUNCPROTOBEGIN + +externalref int _XtInheritTranslations; + +#define XtInheritTranslations ((String) &_XtInheritTranslations) +#define XtInheritRealize ((XtRealizeProc) _XtInherit) +#define XtInheritResize ((XtWidgetProc) _XtInherit) +#define XtInheritExpose ((XtExposeProc) _XtInherit) +#define XtInheritSetValuesAlmost ((XtAlmostProc) _XtInherit) +#define XtInheritAcceptFocus ((XtAcceptFocusProc) _XtInherit) +#define XtInheritQueryGeometry ((XtGeometryHandler) _XtInherit) +#define XtInheritDisplayAccelerator ((XtStringProc) _XtInherit) + +/*************************************************************** + * Widget Core Data Structures + * + * + **************************************************************/ + +typedef struct _CorePart { + Widget self; /* pointer to widget itself */ + WidgetClass widget_class; /* pointer to Widget's ClassRec */ + Widget parent; /* parent widget */ + XrmName xrm_name; /* widget resource name quarkified */ + Boolean being_destroyed; /* marked for destroy */ + XtCallbackList destroy_callbacks; /* who to call when widget destroyed */ + XtPointer constraints; /* constraint record */ + Position x, y; /* window position */ + Dimension width, height; /* window dimensions */ + Dimension border_width; /* window border width */ + Boolean managed; /* is widget geometry managed? */ + Boolean sensitive; /* is widget sensitive to user events*/ + Boolean ancestor_sensitive; /* are all ancestors sensitive? */ + XtEventTable event_table; /* private to event dispatcher */ + XtTMRec tm; /* translation management */ + XtTranslations accelerators; /* accelerator translations */ + Pixel border_pixel; /* window border pixel */ + Pixmap border_pixmap; /* window border pixmap or NULL */ + WidgetList popup_list; /* list of popups */ + Cardinal num_popups; /* how many popups */ + String name; /* widget resource name */ + Screen *screen; /* window's screen */ + Colormap colormap; /* colormap */ + Window window; /* window ID */ + Cardinal depth; /* number of planes in window */ + Pixel background_pixel; /* window background pixel */ + Pixmap background_pixmap; /* window background pixmap or NULL */ + Boolean visible; /* is window mapped and not occluded?*/ + Boolean mapped_when_managed;/* map window if it's managed? */ +} CorePart; + +typedef struct _WidgetRec { + CorePart core; + } WidgetRec, CoreRec; + + + +/****************************************************************** + * + * Core Class Structure. Widgets, regardless of their class, will have + * these fields. All widgets of a given class will have the same values + * for these fields. Widgets of a given class may also have additional + * common fields. These additional fields are included in incremental + * class structures, such as CommandClass. + * + * The fields that are specific to this subclass, as opposed to fields that + * are part of the superclass, are called "subclass fields" below. Many + * procedures are responsible only for the subclass fields, and not for + * any superclass fields. + * + ********************************************************************/ + +typedef struct _CoreClassPart { + WidgetClass superclass; /* pointer to superclass ClassRec */ + String class_name; /* widget resource class name */ + Cardinal widget_size; /* size in bytes of widget record */ + XtProc class_initialize; /* class initialization proc */ + XtWidgetClassProc class_part_initialize; /* dynamic initialization */ + XtEnum class_inited; /* has class been initialized? */ + XtInitProc initialize; /* initialize subclass fields */ + XtArgsProc initialize_hook; /* notify that initialize called */ + XtRealizeProc realize; /* XCreateWindow for widget */ + XtActionList actions; /* widget semantics name to proc map */ + Cardinal num_actions; /* number of entries in actions */ + XtResourceList resources; /* resources for subclass fields */ + Cardinal num_resources; /* number of entries in resources */ + XrmClass xrm_class; /* resource class quarkified */ + Boolean compress_motion; /* compress MotionNotify for widget */ + XtEnum compress_exposure; /* compress Expose events for widget*/ + Boolean compress_enterleave;/* compress enter and leave events */ + Boolean visible_interest; /* select for VisibilityNotify */ + XtWidgetProc destroy; /* free data for subclass pointers */ + XtWidgetProc resize; /* geom manager changed widget size */ + XtExposeProc expose; /* rediplay window */ + XtSetValuesFunc set_values; /* set subclass resource values */ + XtArgsFunc set_values_hook; /* notify that set_values called */ + XtAlmostProc set_values_almost; /* set_values got "Almost" geo reply */ + XtArgsProc get_values_hook; /* notify that get_values called */ + XtAcceptFocusProc accept_focus; /* assign input focus to widget */ + XtVersionType version; /* version of intrinsics used */ + XtPointer callback_private; /* list of callback offsets */ + String tm_table; /* state machine */ + XtGeometryHandler query_geometry; /* return preferred geometry */ + XtStringProc display_accelerator;/* display your accelerator */ + XtPointer extension; /* pointer to extension record */ + } CoreClassPart; + +typedef struct _WidgetClassRec { + CoreClassPart core_class; +} WidgetClassRec, CoreClassRec; + +externalref WidgetClassRec widgetClassRec; +#define coreClassRec widgetClassRec + +_XFUNCPROTOEND + +#endif /* _XtCoreP_h */ +/* DON'T ADD STUFF AFTER THIS #endif */ diff --git a/X11/CreateI.h b/X11/CreateI.h new file mode 100644 index 000000000..e0ca9a3a6 --- /dev/null +++ b/X11/CreateI.h @@ -0,0 +1,44 @@ +/* $XFree86$ */ + +#ifndef _XtcreateI_h +#define _XtcreateI_h + +_XFUNCPROTOBEGIN + +extern Widget _XtCreateWidget(String name, WidgetClass widget_class, + Widget parent, ArgList args, Cardinal num_args, + XtTypedArgList typed_args, + Cardinal num_typed_args); +extern Widget _XtCreatePopupShell(String name, WidgetClass widget_class, + Widget parent, ArgList args, + Cardinal num_args, XtTypedArgList typed_args, + Cardinal num_typed_args); +extern Widget _XtAppCreateShell(String name, String class, + WidgetClass widget_class, Display *display, + ArgList args, Cardinal num_args, + XtTypedArgList typed_args, + Cardinal num_typed_args); +extern Widget _XtCreateHookObj(Screen *screen); + +_XFUNCPROTOEND + +#include <stdarg.h> + +_XFUNCPROTOBEGIN + +/* VarCreate.c */ +extern Widget _XtVaOpenApplication(XtAppContext *app_context_return, + _Xconst char* application_class, + XrmOptionDescList options, Cardinal num_options, + int *argc_in_out, String *argv_in_out, + String *fallback_resources, WidgetClass widget_class, + va_list var_args); +extern Widget _XtVaAppInitialize(XtAppContext *app_context_return, + _Xconst char* application_class, + XrmOptionDescList options, Cardinal num_options, + int *argc_in_out, String *argv_in_out, + String *fallback_resources, va_list var_args); + +_XFUNCPROTOEND + +#endif /* _XtcreateI_h */ diff --git a/X11/EventI.h b/X11/EventI.h new file mode 100644 index 000000000..d2d1d0f43 --- /dev/null +++ b/X11/EventI.h @@ -0,0 +1,138 @@ +/* $Xorg: EventI.h,v 1.4 2001/02/09 02:03:54 xorgcvs Exp $ */ +/* $oHeader: EventI.h,v 1.3 88/08/24 09:21:11 asente Exp $ */ + +/*********************************************************** + +Copyright 1987, 1988, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ +/* $XFree86: xc/lib/Xt/EventI.h,v 1.3 2001/12/14 19:56:12 dawes Exp $ */ + +/* + * Event.h - exported types and functions for toolkit event handler + * + * Author: Charles Haynes + * Digital Equipment Corporation + * Western Software Laboratory + * Date: Sun Dec 6 1987 + */ + +#ifndef _Event_h_ +#define _Event_h_ + +typedef struct _XtGrabRec *XtGrabList; + +#include "PassivGraI.h" + +_XFUNCPROTOBEGIN + +extern void _XtEventInitialize( + void +); + +typedef struct _XtEventRec { + XtEventTable next; + EventMask mask; /* also select_data count for RecExt */ + XtEventHandler proc; + XtPointer closure; + unsigned int select:1; + unsigned int has_type_specifier:1; + unsigned int async:1; /* not used, here for Digital extension? */ +} XtEventRec; + +typedef struct _XtGrabRec { + XtGrabList next; + Widget widget; + unsigned int exclusive:1; + unsigned int spring_loaded:1; +}XtGrabRec; + +typedef struct _BlockHookRec { + struct _BlockHookRec* next; + XtAppContext app; + XtBlockHookProc proc; + XtPointer closure; +} BlockHookRec, *BlockHook; + +extern void _XtFreeEventTable( + XtEventTable* /* event_table */ +); + +extern Boolean _XtOnGrabList( + Widget /* widget */, + XtGrabRec* /* grabList */ +); + +extern void _XtRemoveAllInputs( + XtAppContext /* app */ +); + +extern void _XtRefreshMapping( + XEvent* /* event */, + _XtBoolean /* dispatch */ +); + +extern void _XtSendFocusEvent( + Widget /* child */, + int /* type */); + +extern EventMask _XtConvertTypeToMask( + int /* eventType */ +); + +/* EventUtil.c */ +extern Widget _XtFindRemapWidget(XEvent *event, Widget widget, + EventMask mask, XtPerDisplayInput pdi); +extern void _XtUngrabBadGrabs(XEvent *event, Widget widget, + EventMask mask, XtPerDisplayInput pdi); +extern void _XtFillAncestorList(Widget **listPtr, int *maxElemsPtr, + int *numElemsPtr, Widget start, + Widget breakWidget); + +/* NextEvent.c */ +extern Boolean XtAppPeekEvent_SkipTimer; + +_XFUNCPROTOEND + +#endif /* _Event_h_ */ diff --git a/X11/HookObjI.h b/X11/HookObjI.h new file mode 100644 index 000000000..c0858c2b5 --- /dev/null +++ b/X11/HookObjI.h @@ -0,0 +1,75 @@ +/* $Xorg: HookObjI.h,v 1.4 2001/02/09 02:03:55 xorgcvs Exp $ */ + +/* + +Copyright 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ + +#ifndef _XtHookObjI_h +#define _XtHookObjI_h + +_XFUNCPROTOBEGIN + +/* This object is implementation-dependent and private to the library. */ + +typedef struct _HookObjRec *HookObject; +typedef struct _HookObjClassRec *HookObjectClass; + +externalref WidgetClass hookObjectClass; + +typedef struct _HookObjPart { + /* resources */ + XtCallbackList createhook_callbacks; + XtCallbackList changehook_callbacks; + XtCallbackList confighook_callbacks; + XtCallbackList geometryhook_callbacks; + XtCallbackList destroyhook_callbacks; + WidgetList shells; + Cardinal num_shells; + /* private data */ + Cardinal max_shells; + Screen* screen; +}HookObjPart; + +typedef struct _HookObjRec { + ObjectPart object; + HookObjPart hooks; +} HookObjRec; + +typedef struct _HookObjClassPart { + int unused; +} HookObjClassPart; + +typedef struct _HookObjClassRec { + ObjectClassPart object_class; + HookObjClassPart hook_class; +} HookObjClassRec; + +externalref HookObjClassRec hookObjClassRec; + +_XFUNCPROTOEND + +#endif /* ifndef _Xt_HookObjI_h */ + + diff --git a/X11/ImUtil.h b/X11/ImUtil.h new file mode 100644 index 000000000..89f038117 --- /dev/null +++ b/X11/ImUtil.h @@ -0,0 +1,31 @@ +/* $XFree86: xc/lib/X11/ImUtil.h,v 1.2 2003/04/15 22:10:07 herrb Exp $ */ + +#ifndef _IMUTIL_H_ +#define _IMUTIL_H_ + +extern int +_XGetScanlinePad( + Display *dpy, + int depth); + +extern int +_XGetBitsPerPixel( + Display *dpy, + int depth); + +extern int +_XSetImage( + XImage *srcimg, + register XImage *dstimg, + register int x, + register int y); + +extern int +_XReverse_Bytes( + register unsigned char *bpt, + register int nb); +extern void +_XInitImageFuncPtrs( + register XImage *image); + +#endif /* _IMUTIL_H_ */ diff --git a/X11/InitialI.h b/X11/InitialI.h new file mode 100644 index 000000000..2ae9b743c --- /dev/null +++ b/X11/InitialI.h @@ -0,0 +1,433 @@ +/* $Xorg: InitialI.h,v 1.4 2001/02/09 02:03:55 xorgcvs Exp $ */ + +/*********************************************************** + +Copyright 1987, 1988, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ +/* $XFree86: xc/lib/Xt/InitialI.h,v 3.10 2001/12/14 19:56:18 dawes Exp $ */ + +#ifndef _XtinitialI_h +#define _XtinitialI_h + +/**************************************************************** + * + * Displays + * + ****************************************************************/ + +#ifndef X_NOT_POSIX +#ifdef _POSIX_SOURCE +#include <limits.h> +#else +#define _POSIX_SOURCE +#include <limits.h> +#undef _POSIX_SOURCE +#endif +#endif +#ifndef PATH_MAX +#ifdef WIN32 +#define PATH_MAX 512 +#else +#include <sys/param.h> +#endif +#ifndef PATH_MAX +#ifdef MAXPATHLEN +#define PATH_MAX MAXPATHLEN +#else +#define PATH_MAX 1024 +#endif +#endif +#endif + +#include <X11/Xos.h> +#include <X11/Xpoll.h> + +_XFUNCPROTOBEGIN + +typedef struct _TimerEventRec { + struct timeval te_timer_value; + struct _TimerEventRec *te_next; + XtTimerCallbackProc te_proc; + XtAppContext app; + XtPointer te_closure; +} TimerEventRec; + +typedef struct _InputEvent { + XtInputCallbackProc ie_proc; + XtPointer ie_closure; + struct _InputEvent *ie_next; + struct _InputEvent *ie_oq; + XtAppContext app; + int ie_source; + XtInputMask ie_condition; +} InputEvent; + +typedef struct _SignalEventRec { + XtSignalCallbackProc se_proc; + XtPointer se_closure; + struct _SignalEventRec *se_next; + XtAppContext app; + Boolean se_notice; +} SignalEventRec; + +typedef struct _WorkProcRec { + XtWorkProc proc; + XtPointer closure; + struct _WorkProcRec *next; + XtAppContext app; +} WorkProcRec; + + +typedef struct +{ +#ifndef USE_POLL + fd_set rmask; + fd_set wmask; + fd_set emask; +#endif + int nfds; +} FdStruct; + +typedef struct _LangProcRec { + XtLanguageProc proc; + XtPointer closure; +} LangProcRec; + +typedef struct _ProcessContextRec { + XtAppContext defaultAppContext; + XtAppContext appContextList; + ConverterTable globalConverterTable; + LangProcRec globalLangProcRec; +} ProcessContextRec, *ProcessContext; + +typedef struct { + char* start; + char* current; + int bytes_remaining; +} Heap; + +typedef struct _DestroyRec DestroyRec; + + +typedef struct _XtAppStruct { + XtAppContext next; /* link to next app in process context */ + ProcessContext process; /* back pointer to our process context */ + InternalCallbackList destroy_callbacks; + Display **list; + TimerEventRec *timerQueue; + WorkProcRec *workQueue; + InputEvent **input_list; + InputEvent *outstandingQueue; + SignalEventRec *signalQueue; + XrmDatabase errorDB; + XtErrorMsgHandler errorMsgHandler, warningMsgHandler; + XtErrorHandler errorHandler, warningHandler; + struct _ActionListRec *action_table; + ConverterTable converterTable; + unsigned long selectionTimeout; + FdStruct fds; + short count; /* num of assigned entries in list */ + short max; /* allocate size of list */ + short last; + short input_count; + short input_max; /* elts input_list init'd with */ + Boolean sync, being_destroyed, error_inited; +#ifndef NO_IDENTIFY_WINDOWS + Boolean identify_windows; /* debugging hack */ +#endif + Heap heap; + String * fallback_resources; /* Set by XtAppSetFallbackResources. */ + struct _ActionHookRec* action_hook_list; + struct _BlockHookRec* block_hook_list; + int destroy_list_size; /* state data for 2-phase destroy */ + int destroy_count; + int dispatch_level; + DestroyRec* destroy_list; + Widget in_phase2_destroy; + LangProcRec langProcRec; + struct _TMBindCacheRec * free_bindings; + String display_name_tried; + Display **dpy_destroy_list; + int dpy_destroy_count; + Boolean exit_flag; + Boolean rebuild_fdlist; +#ifdef XTHREADS + LockPtr lock_info; + ThreadAppProc lock; + ThreadAppProc unlock; + ThreadAppYieldLockProc yield_lock; + ThreadAppRestoreLockProc restore_lock; + ThreadAppProc free_lock; +#endif +} XtAppStruct; + +extern void _XtHeapInit(Heap* heap); +extern void _XtHeapFree(Heap* heap); + +#ifdef XTTRACEMEMORY + + +extern char *_XtHeapMalloc( + Heap* /* heap */, + Cardinal /* size */, + char * /* file */, + int /* line */ +); + +#define _XtHeapAlloc(heap,bytes) _XtHeapMalloc(heap, bytes, __FILE__, __LINE__) + +#else /* XTTRACEMEMORY */ + +extern char* _XtHeapAlloc( + Heap* /* heap */, + Cardinal /* size */ +); + +#endif /* XTTRACEMEMORY */ + +extern void _XtSetDefaultErrorHandlers( + XtErrorMsgHandler* /* errMsg */, + XtErrorMsgHandler* /* warnMsg */, + XtErrorHandler* /* err */, + XtErrorHandler* /* warn */ +); + +extern void _XtSetDefaultSelectionTimeout( + unsigned long* /* timeout */ +); + +extern XtAppContext _XtDefaultAppContext( + void +); + +extern ProcessContext _XtGetProcessContext( + void +); + +Display * +_XtAppInit( + XtAppContext* /* app_context_return */, + String /* application_class */, + XrmOptionDescRec* /* options */, + Cardinal /* num_options */, + int* /* argc_in_out */, + String** /* argv_in_out */, + String* /* fallback_resources */ +); + +extern void _XtDestroyAppContexts( + void +); + +extern void _XtCloseDisplays( + XtAppContext /* app */ +); + +extern int _XtAppDestroyCount; + +extern int _XtWaitForSomething( + XtAppContext /* app */, + _XtBoolean /* ignoreEvents */, + _XtBoolean /* ignoreTimers */, + _XtBoolean /* ignoreInputs */, + _XtBoolean /* ignoreSignals */, + _XtBoolean /* block */, +#ifdef XTHREADS + _XtBoolean /* drop_lock */, +#endif + unsigned long* /* howlong */ +); + +typedef struct _CaseConverterRec *CaseConverterPtr; +typedef struct _CaseConverterRec { + KeySym start; /* first KeySym valid in converter */ + KeySym stop; /* last KeySym valid in converter */ + XtCaseProc proc; /* case converter function */ + CaseConverterPtr next; /* next converter record */ +} CaseConverterRec; + +typedef struct _ExtensionSelectorRec { + XtExtensionSelectProc proc; + int min, max; + XtPointer client_data; +} ExtSelectRec; + +typedef struct _XtPerDisplayStruct { + InternalCallbackList destroy_callbacks; + Region region; + CaseConverterPtr case_cvt; /* user-registered case converters */ + XtKeyProc defaultKeycodeTranslator; + XtAppContext appContext; + unsigned long keysyms_serial; /* for tracking MappingNotify events */ + KeySym *keysyms; /* keycode to keysym table */ + int keysyms_per_keycode; /* number of keysyms for each keycode*/ + int min_keycode, max_keycode; /* range of keycodes */ + KeySym *modKeysyms; /* keysym values for modToKeysysm */ + ModToKeysymTable *modsToKeysyms; /* modifiers to Keysysms index table*/ + unsigned char isModifier[32]; /* key-is-modifier-p bit table */ + KeySym lock_meaning; /* Lock modifier meaning */ + Modifiers mode_switch; /* keyboard group modifiers */ + Modifiers num_lock; /* keyboard numlock modifiers */ + Boolean being_destroyed; + Boolean rv; /* reverse_video resource */ + XrmName name; /* resolved app name */ + XrmClass class; /* application class */ + Heap heap; + struct _GCrec *GClist; /* support for XtGetGC */ + Drawable **pixmap_tab; /* ditto for XtGetGC */ + String language; /* XPG language string */ + XEvent last_event; /* last event dispatched */ + Time last_timestamp; /* from last event dispatched */ + int multi_click_time; /* for XtSetMultiClickTime */ + struct _TMKeyContextRec* tm_context; /* for XtGetActionKeysym */ + InternalCallbackList mapping_callbacks; /* special case for TM */ + XtPerDisplayInputRec pdi; /* state for modal grabs & kbd focus */ + struct _WWTable *WWtable; /* window to widget table */ + XrmDatabase *per_screen_db; /* per screen resource databases */ + XrmDatabase cmd_db; /* db from command line, if needed */ + XrmDatabase server_db; /* resource property else .Xdefaults */ + XtEventDispatchProc* dispatcher_list; + ExtSelectRec* ext_select_list; + int ext_select_count; + Widget hook_object; +#ifndef X_NO_RESOURCE_CONFIGURATION_MANAGEMENT + Atom rcm_init; /* ResConfig - initialize */ + Atom rcm_data; /* ResConfig - data atom */ +#endif +} XtPerDisplayStruct, *XtPerDisplay; + +typedef struct _PerDisplayTable { + Display *dpy; + XtPerDisplayStruct perDpy; + struct _PerDisplayTable *next; +} PerDisplayTable, *PerDisplayTablePtr; + +extern PerDisplayTablePtr _XtperDisplayList; + +extern XtPerDisplay _XtSortPerDisplayList( + Display* /* dpy */ +); + +extern XtPerDisplay _XtGetPerDisplay( + Display* /* dpy */ +); + +extern XtPerDisplayInputRec* _XtGetPerDisplayInput( + Display* /* dpy */ +); + +#if 0 +#ifdef DEBUG +#define _XtGetPerDisplay(display) \ + ((_XtperDisplayList != NULL && (_XtperDisplayList->dpy == (display))) \ + ? &_XtperDisplayList->perDpy \ + : _XtSortPerDisplayList(display)) +#define _XtGetPerDisplayInput(display) \ + ((_XtperDisplayList != NULL && (_XtperDisplayList->dpy == (display))) \ + ? &_XtperDisplayList->perDpy.pdi \ + : &_XtSortPerDisplayList(display)->pdi) +#else +#define _XtGetPerDisplay(display) \ + ((_XtperDisplayList->dpy == (display)) \ + ? &_XtperDisplayList->perDpy \ + : _XtSortPerDisplayList(display)) +#define _XtGetPerDisplayInput(display) \ + ((_XtperDisplayList->dpy == (display)) \ + ? &_XtperDisplayList->perDpy.pdi \ + : &_XtSortPerDisplayList(display)->pdi) +#endif /*DEBUG*/ +#endif + +extern void _XtDisplayInitialize( + Display* /* dpy */, + XtPerDisplay /* pd */, + _Xconst char* /* name */, + XrmOptionDescRec* /* urlist */, + Cardinal /* num_urs */, + int* /* argc */, + char** /* argv */ +); + +extern void _XtCacheFlushTag( + XtAppContext /* app */, + XtPointer /* tag */ +); + +extern void _XtFreeActions( + struct _ActionListRec* /* action_table */ +); + +extern void _XtDoPhase2Destroy( + XtAppContext /* app */, + int /* dispatch_level */ +); + +extern void _XtDoFreeBindings( + XtAppContext /* app */ +); + +extern void _XtExtensionSelect( + Widget /* widget */ +); + +#define _XtSafeToDestroy(app) ((app)->dispatch_level == 0) + +extern void _XtAllocWWTable( + XtPerDisplay pd +); + +extern void _XtFreeWWTable( + XtPerDisplay pd +); + +extern String _XtGetUserName(String dest, int len); +extern XrmDatabase _XtPreparseCommandLine(XrmOptionDescRec *urlist, + Cardinal num_urs, int argc, String *argv, + String *applName, String *displayName, + String *language); + +_XFUNCPROTOEND + +#endif /* _XtinitialI_h */ diff --git a/X11/Intrinsic.h b/X11/Intrinsic.h new file mode 100644 index 000000000..0461b842f --- /dev/null +++ b/X11/Intrinsic.h @@ -0,0 +1,2589 @@ +/* $Xorg: Intrinsic.h,v 1.4 2001/02/09 02:03:55 xorgcvs Exp $ */ + +/*********************************************************** +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts, + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +/* + +Copyright 1987, 1988, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/lib/Xt/Intrinsic.h,v 3.8 2001/12/14 19:56:22 dawes Exp $ */ + +#ifndef _XtIntrinsic_h +#define _XtIntrinsic_h + +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/Xresource.h> +#include <X11/Xfuncproto.h> +#ifdef XT_BC +#include <X11/Xos.h> /* for R4 compatibility */ +#else +#include <X11/Xosdefs.h> +#include <string.h> /* for XtNewString */ +#endif /* XT_BC else */ + +#define XtSpecificationRelease 6 + +typedef char *String; + +/* We do this in order to get "const" declarations to work right. We + * use _XtString instead of String so that C++ applications can + * #define String to something else if they choose, to avoid conflicts + * with other C++ libraries. + */ +#define _XtString char* + +/* _Xt names are private to Xt implementation, do not use in client code */ +#if NeedWidePrototypes +#define _XtBoolean int +#define _XtDimension unsigned int +#define _XtKeyCode unsigned int +#define _XtPosition int +#define _XtXtEnum unsigned int +#else +#define _XtBoolean Boolean +#define _XtDimension Dimension +#define _XtKeyCode KeyCode +#define _XtPosition Position +#define _XtXtEnum XtEnum +#endif /* NeedWidePrototypes */ + +#include <stddef.h> + +#ifdef VMS +#define externalref globalref +#define externaldef(psect) globaldef {"psect"} noshare +#else +#define externalref extern +#define externaldef(psect) +#endif /* VMS */ + +#ifndef FALSE +#define FALSE 0 +#define TRUE 1 +#endif + +#define XtNumber(arr) ((Cardinal) (sizeof(arr) / sizeof(arr[0]))) + +typedef struct _WidgetRec *Widget; +typedef Widget *WidgetList; +typedef struct _WidgetClassRec *WidgetClass; +typedef struct _CompositeRec *CompositeWidget; +typedef struct _XtActionsRec *XtActionList; +typedef struct _XtEventRec *XtEventTable; + +typedef struct _XtAppStruct *XtAppContext; +typedef unsigned long XtValueMask; +typedef unsigned long XtIntervalId; +typedef unsigned long XtInputId; +typedef unsigned long XtWorkProcId; +typedef unsigned long XtSignalId; +typedef unsigned int XtGeometryMask; +typedef unsigned long XtGCMask; /* Mask of values that are used by widget*/ +typedef unsigned long Pixel; /* Index into colormap */ +typedef int XtCacheType; +#define XtCacheNone 0x001 +#define XtCacheAll 0x002 +#define XtCacheByDisplay 0x003 +#define XtCacheRefCount 0x100 + +/**************************************************************** + * + * System Dependent Definitions; see spec for specific range + * requirements. Do not assume every implementation uses the + * same base types! + * + * + * XtArgVal ought to be a union of XtPointer, char *, long, int *, and proc * + * but casting to union types is not really supported. + * + * So the typedef for XtArgVal should be chosen such that + * + * sizeof (XtArgVal) >= sizeof(XtPointer) + * sizeof(char *) + * sizeof(long) + * sizeof(int *) + * sizeof(proc *) + * + * ArgLists rely heavily on the above typedef. + * + ****************************************************************/ +#ifdef CRAY +typedef long Boolean; +typedef char* XtArgVal; +typedef long XtEnum; +#else +typedef char Boolean; +typedef long XtArgVal; +typedef unsigned char XtEnum; +#endif + +typedef unsigned int Cardinal; +typedef unsigned short Dimension; /* Size in pixels */ +typedef short Position; /* Offset from 0 coordinate */ + +typedef void* XtPointer; + +/* The type Opaque is NOT part of the Xt standard, do NOT use it. */ +/* (It remains here only for backward compatibility.) */ +typedef XtPointer Opaque; + +#include <X11/Core.h> +#include <X11/Composite.h> +#include <X11/Constraint.h> +#include <X11/Object.h> +#include <X11/RectObj.h> + +typedef struct _TranslationData *XtTranslations; +typedef struct _TranslationData *XtAccelerators; +typedef unsigned int Modifiers; + +typedef void (*XtActionProc)( + Widget /* widget */, + XEvent* /* event */, + String* /* params */, + Cardinal* /* num_params */ +); + +typedef XtActionProc* XtBoundActions; + +typedef struct _XtActionsRec{ + String string; + XtActionProc proc; +} XtActionsRec; + +typedef enum { +/* address mode parameter representation */ +/* ------------ ------------------------ */ + XtAddress, /* address */ + XtBaseOffset, /* offset */ + XtImmediate, /* constant */ + XtResourceString, /* resource name string */ + XtResourceQuark, /* resource name quark */ + XtWidgetBaseOffset, /* offset from ancestor */ + XtProcedureArg /* procedure to invoke */ +} XtAddressMode; + +typedef struct { + XtAddressMode address_mode; + XtPointer address_id; + Cardinal size; +} XtConvertArgRec, *XtConvertArgList; + +typedef void (*XtConvertArgProc)( + Widget /* widget */, + Cardinal* /* size */, + XrmValue* /* value */ +); + +typedef struct { + XtGeometryMask request_mode; + Position x, y; + Dimension width, height, border_width; + Widget sibling; + int stack_mode; /* Above, Below, TopIf, BottomIf, Opposite, DontChange */ +} XtWidgetGeometry; + +/* Additions to Xlib geometry requests: ask what would happen, don't do it */ +#define XtCWQueryOnly (1 << 7) + +/* Additions to Xlib stack modes: don't change stack order */ +#define XtSMDontChange 5 + +typedef void (*XtConverter)( /* obsolete */ + XrmValue* /* args */, + Cardinal* /* num_args */, + XrmValue* /* from */, + XrmValue* /* to */ +); + +typedef Boolean (*XtTypeConverter)( + Display* /* dpy */, + XrmValue* /* args */, + Cardinal* /* num_args */, + XrmValue* /* from */, + XrmValue* /* to */, + XtPointer* /* converter_data */ +); + +typedef void (*XtDestructor)( + XtAppContext /* app */, + XrmValue* /* to */, + XtPointer /* converter_data */, + XrmValue* /* args */, + Cardinal* /* num_args */ +); + +typedef Opaque XtCacheRef; + +typedef Opaque XtActionHookId; + +typedef void (*XtActionHookProc)( + Widget /* w */, + XtPointer /* client_data */, + String /* action_name */, + XEvent* /* event */, + String* /* params */, + Cardinal* /* num_params */ +); + +typedef unsigned long XtBlockHookId; + +typedef void (*XtBlockHookProc)( + XtPointer /* client_data */ +); + +typedef void (*XtKeyProc)( + Display* /* dpy */, + _XtKeyCode /* keycode */, + Modifiers /* modifiers */, + Modifiers* /* modifiers_return */, + KeySym* /* keysym_return */ +); + +typedef void (*XtCaseProc)( + Display* /* display */, + KeySym /* keysym */, + KeySym* /* lower_return */, + KeySym* /* upper_return */ +); + +typedef void (*XtEventHandler)( + Widget /* widget */, + XtPointer /* closure */, + XEvent* /* event */, + Boolean* /* continue_to_dispatch */ +); +typedef unsigned long EventMask; + +typedef enum {XtListHead, XtListTail } XtListPosition; + +typedef unsigned long XtInputMask; +#define XtInputNoneMask 0L +#define XtInputReadMask (1L<<0) +#define XtInputWriteMask (1L<<1) +#define XtInputExceptMask (1L<<2) + +typedef void (*XtTimerCallbackProc)( + XtPointer /* closure */, + XtIntervalId* /* id */ +); + +typedef void (*XtInputCallbackProc)( + XtPointer /* closure */, + int* /* source */, + XtInputId* /* id */ +); + +typedef void (*XtSignalCallbackProc)( + XtPointer /* closure */, + XtSignalId* /* id */ +); + +typedef struct { + String name; + XtArgVal value; +} Arg, *ArgList; + +typedef XtPointer XtVarArgsList; + +typedef void (*XtCallbackProc)( + Widget /* widget */, + XtPointer /* closure */, /* data the application registered */ + XtPointer /* call_data */ /* callback specific data */ +); + +typedef struct _XtCallbackRec { + XtCallbackProc callback; + XtPointer closure; +} XtCallbackRec, *XtCallbackList; + +typedef enum { + XtCallbackNoList, + XtCallbackHasNone, + XtCallbackHasSome +} XtCallbackStatus; + +typedef enum { + XtGeometryYes, /* Request accepted. */ + XtGeometryNo, /* Request denied. */ + XtGeometryAlmost, /* Request denied, but willing to take replyBox. */ + XtGeometryDone /* Request accepted and done. */ +} XtGeometryResult; + +typedef enum {XtGrabNone, XtGrabNonexclusive, XtGrabExclusive} XtGrabKind; + +typedef struct { + Widget shell_widget; + Widget enable_widget; +} XtPopdownIDRec, *XtPopdownID; + +typedef struct _XtResource { + String resource_name; /* Resource name */ + String resource_class; /* Resource class */ + String resource_type; /* Representation type desired */ + Cardinal resource_size; /* Size in bytes of representation */ + Cardinal resource_offset;/* Offset from base to put resource value */ + String default_type; /* representation type of specified default */ + XtPointer default_addr; /* Address of default resource */ +} XtResource, *XtResourceList; + +typedef void (*XtResourceDefaultProc)( + Widget /* widget */, + int /* offset */, + XrmValue* /* value */ +); + +typedef String (*XtLanguageProc)( + Display* /* dpy */, + String /* xnl */, + XtPointer /* client_data */ +); + +typedef void (*XtErrorMsgHandler)( + String /* name */, + String /* type */, + String /* class */, + String /* default */, + String* /* params */, + Cardinal* /* num_params */ +); + +typedef void (*XtErrorHandler)( + String /* msg */ +); + +typedef void (*XtCreatePopupChildProc)( + Widget /* shell */ +); + +typedef Boolean (*XtWorkProc)( + XtPointer /* closure */ /* data the application registered */ +); + +typedef struct { + char match; + String substitution; +} SubstitutionRec, *Substitution; + +typedef Boolean (*XtFilePredicate)( + String /* filename */ +); + +typedef XtPointer XtRequestId; + +typedef Boolean (*XtConvertSelectionProc)( + Widget /* widget */, + Atom* /* selection */, + Atom* /* target */, + Atom* /* type_return */, + XtPointer* /* value_return */, + unsigned long* /* length_return */, + int* /* format_return */ +); + +typedef void (*XtLoseSelectionProc)( + Widget /* widget */, + Atom* /* selection */ +); + +typedef void (*XtSelectionDoneProc)( + Widget /* widget */, + Atom* /* selection */, + Atom* /* target */ +); + +typedef void (*XtSelectionCallbackProc)( + Widget /* widget */, + XtPointer /* closure */, + Atom* /* selection */, + Atom* /* type */, + XtPointer /* value */, + unsigned long* /* length */, + int* /* format */ +); + +typedef void (*XtLoseSelectionIncrProc)( + Widget /* widget */, + Atom* /* selection */, + XtPointer /* client_data */ +); + +typedef void (*XtSelectionDoneIncrProc)( + Widget /* widget */, + Atom* /* selection */, + Atom* /* target */, + XtRequestId* /* receiver_id */, + XtPointer /* client_data */ +); + +typedef Boolean (*XtConvertSelectionIncrProc)( + Widget /* widget */, + Atom* /* selection */, + Atom* /* target */, + Atom* /* type */, + XtPointer* /* value */, + unsigned long* /* length */, + int* /* format */, + unsigned long* /* max_length */, + XtPointer /* client_data */, + XtRequestId* /* receiver_id */ +); + +typedef void (*XtCancelConvertSelectionProc)( + Widget /* widget */, + Atom* /* selection */, + Atom* /* target */, + XtRequestId* /* receiver_id */, + XtPointer /* client_data */ +); + +typedef Boolean (*XtEventDispatchProc)( + XEvent* /* event */ +); + +typedef void (*XtExtensionSelectProc)( + Widget /* widget */, + int* /* event_types */, + XtPointer* /* select_data */, + int /* count */, + XtPointer /* client_data */ +); + +/*************************************************************** + * + * Exported Interfaces + * + ****************************************************************/ + +_XFUNCPROTOBEGIN + +extern Boolean XtConvertAndStore( + Widget /* widget */, + _Xconst _XtString /* from_type */, + XrmValue* /* from */, + _Xconst _XtString /* to_type */, + XrmValue* /* to_in_out */ +); + +extern Boolean XtCallConverter( + Display* /* dpy */, + XtTypeConverter /* converter */, + XrmValuePtr /* args */, + Cardinal /* num_args */, + XrmValuePtr /* from */, + XrmValue* /* to_in_out */, + XtCacheRef* /* cache_ref_return */ +); + +extern Boolean XtDispatchEvent( + XEvent* /* event */ +); + +extern Boolean XtCallAcceptFocus( + Widget /* widget */, + Time* /* time */ +); + +extern Boolean XtPeekEvent( /* obsolete */ + XEvent* /* event_return */ +); + +extern Boolean XtAppPeekEvent( + XtAppContext /* app_context */, + XEvent* /* event_return */ +); + +extern Boolean XtIsSubclass( + Widget /* widget */, + WidgetClass /* widgetClass */ +); + +extern Boolean XtIsObject( + Widget /* object */ +); + +extern Boolean _XtCheckSubclassFlag( /* implementation-private */ + Widget /* object */, + _XtXtEnum /* type_flag */ +); + +extern Boolean _XtIsSubclassOf( /* implementation-private */ + Widget /* object */, + WidgetClass /* widget_class */, + WidgetClass /* flag_class */, + _XtXtEnum /* type_flag */ +); + +extern Boolean XtIsManaged( + Widget /* rectobj */ +); + +extern Boolean XtIsRealized( + Widget /* widget */ +); + +extern Boolean XtIsSensitive( + Widget /* widget */ +); + +extern Boolean XtOwnSelection( + Widget /* widget */, + Atom /* selection */, + Time /* time */, + XtConvertSelectionProc /* convert */, + XtLoseSelectionProc /* lose */, + XtSelectionDoneProc /* done */ +); + +extern Boolean XtOwnSelectionIncremental( + Widget /* widget */, + Atom /* selection */, + Time /* time */, + XtConvertSelectionIncrProc /* convert_callback */, + XtLoseSelectionIncrProc /* lose_callback */, + XtSelectionDoneIncrProc /* done_callback */, + XtCancelConvertSelectionProc /* cancel_callback */, + XtPointer /* client_data */ +); + +extern XtGeometryResult XtMakeResizeRequest( + Widget /* widget */, + _XtDimension /* width */, + _XtDimension /* height */, + Dimension* /* width_return */, + Dimension* /* height_return */ +); + +extern void XtTranslateCoords( + Widget /* widget */, + _XtPosition /* x */, + _XtPosition /* y */, + Position* /* rootx_return */, + Position* /* rooty_return */ +); + +extern KeySym* XtGetKeysymTable( + Display* /* dpy */, + KeyCode* /* min_keycode_return */, + int* /* keysyms_per_keycode_return */ +); + +extern void XtKeysymToKeycodeList( + Display* /* dpy */, + KeySym /* keysym */, + KeyCode** /* keycodes_return */, + Cardinal* /* keycount_return */ +); + +extern void XtStringConversionWarning( /* obsolete */ + _Xconst _XtString /* from_value */, + _Xconst _XtString /* to_type */ +); + +extern void XtDisplayStringConversionWarning( + Display* /* dpy */, + _Xconst _XtString /* from_value */, + _Xconst _XtString /* to_type */ +); + +externalref XtConvertArgRec const colorConvertArgs[]; +externalref XtConvertArgRec const screenConvertArg[]; + +extern void XtAppAddConverter( /* obsolete */ + XtAppContext /* app_context */, + _Xconst _XtString /* from_type */, + _Xconst _XtString /* to_type */, + XtConverter /* converter */, + XtConvertArgList /* convert_args */, + Cardinal /* num_args */ +); + +extern void XtAddConverter( /* obsolete */ + _Xconst _XtString /* from_type */, + _Xconst _XtString /* to_type */, + XtConverter /* converter */, + XtConvertArgList /* convert_args */, + Cardinal /* num_args */ +); + +extern void XtSetTypeConverter( + _Xconst _XtString /* from_type */, + _Xconst _XtString /* to_type */, + XtTypeConverter /* converter */, + XtConvertArgList /* convert_args */, + Cardinal /* num_args */, + XtCacheType /* cache_type */, + XtDestructor /* destructor */ +); + +extern void XtAppSetTypeConverter( + XtAppContext /* app_context */, + _Xconst _XtString /* from_type */, + _Xconst _XtString /* to_type */, + XtTypeConverter /* converter */, + XtConvertArgList /* convert_args */, + Cardinal /* num_args */, + XtCacheType /* cache_type */, + XtDestructor /* destructor */ +); + +extern void XtConvert( /* obsolete */ + Widget /* widget */, + _Xconst _XtString /* from_type */, + XrmValue* /* from */, + _Xconst _XtString /* to_type */, + XrmValue* /* to_return */ +); + +extern void XtDirectConvert( /* obsolete */ + XtConverter /* converter */, + XrmValuePtr /* args */, + Cardinal /* num_args */, + XrmValuePtr /* from */, + XrmValue* /* to_return */ +); + +/**************************************************************** + * + * Translation Management + * + ****************************************************************/ + +extern XtTranslations XtParseTranslationTable( + _Xconst _XtString /* table */ +); + +extern XtAccelerators XtParseAcceleratorTable( + _Xconst _XtString /* source */ +); + +extern void XtOverrideTranslations( + Widget /* widget */, + XtTranslations /* translations */ +); + +extern void XtAugmentTranslations( + Widget /* widget */, + XtTranslations /* translations */ +); + +extern void XtInstallAccelerators( + Widget /* destination */, + Widget /* source */ +); + +extern void XtInstallAllAccelerators( + Widget /* destination */, + Widget /* source */ +); + +extern void XtUninstallTranslations( + Widget /* widget */ +); + +extern void XtAppAddActions( + XtAppContext /* app_context */, + XtActionList /* actions */, + Cardinal /* num_actions */ +); + +extern void XtAddActions( /* obsolete */ + XtActionList /* actions */, + Cardinal /* num_actions */ +); + +extern XtActionHookId XtAppAddActionHook( + XtAppContext /* app_context */, + XtActionHookProc /* proc */, + XtPointer /* client_data */ +); + +extern void XtRemoveActionHook( + XtActionHookId /* id */ +); + +extern void XtGetActionList( + WidgetClass /* widget_class */, + XtActionList* /* actions_return */, + Cardinal* /* num_actions_return */ +); + +extern void XtCallActionProc( + Widget /* widget */, + _Xconst _XtString /* action */, + XEvent* /* event */, + String* /* params */, + Cardinal /* num_params */ +); + +extern void XtRegisterGrabAction( + XtActionProc /* action_proc */, + _XtBoolean /* owner_events */, + unsigned int /* event_mask */, + int /* pointer_mode */, + int /* keyboard_mode */ +); + +extern void XtSetMultiClickTime( + Display* /* dpy */, + int /* milliseconds */ +); + +extern int XtGetMultiClickTime( + Display* /* dpy */ +); + +extern KeySym XtGetActionKeysym( + XEvent* /* event */, + Modifiers* /* modifiers_return */ +); + +/*************************************************************** + * + * Keycode and Keysym procedures for translation management + * + ****************************************************************/ + +extern void XtTranslateKeycode( + Display* /* dpy */, + _XtKeyCode /* keycode */, + Modifiers /* modifiers */, + Modifiers* /* modifiers_return */, + KeySym* /* keysym_return */ +); + +extern void XtTranslateKey( + Display* /* dpy */, + _XtKeyCode /* keycode */, + Modifiers /* modifiers */, + Modifiers* /* modifiers_return */, + KeySym* /* keysym_return */ +); + +extern void XtSetKeyTranslator( + Display* /* dpy */, + XtKeyProc /* proc */ +); + +extern void XtRegisterCaseConverter( + Display* /* dpy */, + XtCaseProc /* proc */, + KeySym /* start */, + KeySym /* stop */ +); + +extern void XtConvertCase( + Display* /* dpy */, + KeySym /* keysym */, + KeySym* /* lower_return */, + KeySym* /* upper_return */ +); + +/**************************************************************** + * + * Event Management + * + ****************************************************************/ + +/* XtAllEvents is valid only for XtRemoveEventHandler and + * XtRemoveRawEventHandler; don't use it to select events! + */ +#define XtAllEvents ((EventMask) -1L) + +extern void XtAddEventHandler( + Widget /* widget */, + EventMask /* event_mask */, + _XtBoolean /* nonmaskable */, + XtEventHandler /* proc */, + XtPointer /* closure */ +); + +extern void XtRemoveEventHandler( + Widget /* widget */, + EventMask /* event_mask */, + _XtBoolean /* nonmaskable */, + XtEventHandler /* proc */, + XtPointer /* closure */ +); + +extern void XtAddRawEventHandler( + Widget /* widget */, + EventMask /* event_mask */, + _XtBoolean /* nonmaskable */, + XtEventHandler /* proc */, + XtPointer /* closure */ +); + +extern void XtRemoveRawEventHandler( + Widget /* widget */, + EventMask /* event_mask */, + _XtBoolean /* nonmaskable */, + XtEventHandler /* proc */, + XtPointer /* closure */ +); + +extern void XtInsertEventHandler( + Widget /* widget */, + EventMask /* event_mask */, + _XtBoolean /* nonmaskable */, + XtEventHandler /* proc */, + XtPointer /* closure */, + XtListPosition /* position */ +); + +extern void XtInsertRawEventHandler( + Widget /* widget */, + EventMask /* event_mask */, + _XtBoolean /* nonmaskable */, + XtEventHandler /* proc */, + XtPointer /* closure */, + XtListPosition /* position */ +); + +extern XtEventDispatchProc XtSetEventDispatcher( + Display* /* dpy */, + int /* event_type */, + XtEventDispatchProc /* proc */ +); + +extern Boolean XtDispatchEventToWidget( + Widget /* widget */, + XEvent* /* event */ +); + +extern void XtInsertEventTypeHandler( + Widget /* widget */, + int /* type */, + XtPointer /* select_data */, + XtEventHandler /* proc */, + XtPointer /* closure */, + XtListPosition /* position */ +); + +extern void XtRemoveEventTypeHandler( + Widget /* widget */, + int /* type */, + XtPointer /* select_data */, + XtEventHandler /* proc */, + XtPointer /* closure */ +); + +extern EventMask XtBuildEventMask( + Widget /* widget */ +); + +extern void XtRegisterExtensionSelector( + Display* /* dpy */, + int /* min_event_type */, + int /* max_event_type */, + XtExtensionSelectProc /* proc */, + XtPointer /* client_data */ +); + +extern void XtAddGrab( + Widget /* widget */, + _XtBoolean /* exclusive */, + _XtBoolean /* spring_loaded */ +); + +extern void XtRemoveGrab( + Widget /* widget */ +); + +extern void XtProcessEvent( /* obsolete */ + XtInputMask /* mask */ +); + +extern void XtAppProcessEvent( + XtAppContext /* app_context */, + XtInputMask /* mask */ +); + +extern void XtMainLoop( /* obsolete */ + void +); + +extern void XtAppMainLoop( + XtAppContext /* app_context */ +); + +extern void XtAddExposureToRegion( + XEvent* /* event */, + Region /* region */ +); + +extern void XtSetKeyboardFocus( + Widget /* subtree */, + Widget /* descendent */ +); + +extern Widget XtGetKeyboardFocusWidget( + Widget /* widget */ +); + +extern XEvent* XtLastEventProcessed( + Display* /* dpy */ +); + +extern Time XtLastTimestampProcessed( + Display* /* dpy */ +); + +/**************************************************************** + * + * Event Gathering Routines + * + ****************************************************************/ + +extern XtIntervalId XtAddTimeOut( /* obsolete */ + unsigned long /* interval */, + XtTimerCallbackProc /* proc */, + XtPointer /* closure */ +); + +extern XtIntervalId XtAppAddTimeOut( + XtAppContext /* app_context */, + unsigned long /* interval */, + XtTimerCallbackProc /* proc */, + XtPointer /* closure */ +); + +extern void XtRemoveTimeOut( + XtIntervalId /* timer */ +); + +extern XtInputId XtAddInput( /* obsolete */ + int /* source */, + XtPointer /* condition */, + XtInputCallbackProc /* proc */, + XtPointer /* closure */ +); + +extern XtInputId XtAppAddInput( + XtAppContext /* app_context */, + int /* source */, + XtPointer /* condition */, + XtInputCallbackProc /* proc */, + XtPointer /* closure */ +); + +extern void XtRemoveInput( + XtInputId /* id */ +); + +extern XtSignalId XtAddSignal( + XtSignalCallbackProc /* proc */, + XtPointer /* closure */); + +extern XtSignalId XtAppAddSignal( + XtAppContext /* app_context */, + XtSignalCallbackProc /* proc */, + XtPointer /* closure */ +); + +extern void XtRemoveSignal( + XtSignalId /* id */ +); + +extern void XtNoticeSignal( + XtSignalId /* id */ +); + +extern void XtNextEvent( /* obsolete */ + XEvent* /* event */ +); + +extern void XtAppNextEvent( + XtAppContext /* app_context */, + XEvent* /* event_return */ +); + +#define XtIMXEvent 1 +#define XtIMTimer 2 +#define XtIMAlternateInput 4 +#define XtIMSignal 8 +#define XtIMAll (XtIMXEvent | XtIMTimer | XtIMAlternateInput | XtIMSignal) + +extern Boolean XtPending( /* obsolete */ + void +); + +extern XtInputMask XtAppPending( + XtAppContext /* app_context */ +); + +extern XtBlockHookId XtAppAddBlockHook( + XtAppContext /* app_context */, + XtBlockHookProc /* proc */, + XtPointer /* client_data */ +); + +extern void XtRemoveBlockHook( + XtBlockHookId /* id */ +); + +/**************************************************************** + * + * Random utility routines + * + ****************************************************************/ + +#define XtIsRectObj(object) (_XtCheckSubclassFlag(object, (XtEnum)0x02)) +#define XtIsWidget(object) (_XtCheckSubclassFlag(object, (XtEnum)0x04)) +#define XtIsComposite(widget) (_XtCheckSubclassFlag(widget, (XtEnum)0x08)) +#define XtIsConstraint(widget) (_XtCheckSubclassFlag(widget, (XtEnum)0x10)) +#define XtIsShell(widget) (_XtCheckSubclassFlag(widget, (XtEnum)0x20)) + +#undef XtIsOverrideShell +extern Boolean XtIsOverrideShell(Widget /* object */); +#define XtIsOverrideShell(widget) \ + (_XtIsSubclassOf(widget, (WidgetClass)overrideShellWidgetClass, \ + (WidgetClass)shellWidgetClass, (XtEnum)0x20)) + +#define XtIsWMShell(widget) (_XtCheckSubclassFlag(widget, (XtEnum)0x40)) + +#undef XtIsVendorShell +extern Boolean XtIsVendorShell(Widget /* object */); +#define XtIsVendorShell(widget) \ + (_XtIsSubclassOf(widget, (WidgetClass)vendorShellWidgetClass, \ + (WidgetClass)wmShellWidgetClass, (XtEnum)0x40)) + +#undef XtIsTransientShell +extern Boolean XtIsTransientShell(Widget /* object */); +#define XtIsTransientShell(widget) \ + (_XtIsSubclassOf(widget, (WidgetClass)transientShellWidgetClass, \ + (WidgetClass)wmShellWidgetClass, (XtEnum)0x40)) +#define XtIsTopLevelShell(widget) (_XtCheckSubclassFlag(widget, (XtEnum)0x80)) + +#undef XtIsApplicationShell +extern Boolean XtIsApplicationShell(Widget /* object */); +#define XtIsApplicationShell(widget) \ + (_XtIsSubclassOf(widget, (WidgetClass)applicationShellWidgetClass, \ + (WidgetClass)topLevelShellWidgetClass, (XtEnum)0x80)) + +#undef XtIsSessionShell +extern Boolean XtIsSessionShell(Widget /* object */); +#define XtIsSessionShell(widget) \ + (_XtIsSubclassOf(widget, (WidgetClass)sessionShellWidgetClass, \ + (WidgetClass)topLevelShellWidgetClass, (XtEnum)0x80)) + +extern void XtRealizeWidget( + Widget /* widget */ +); + +void XtUnrealizeWidget( + Widget /* widget */ +); + +extern void XtDestroyWidget( + Widget /* widget */ +); + +extern void XtSetSensitive( + Widget /* widget */, + _XtBoolean /* sensitive */ +); + +extern void XtSetMappedWhenManaged( + Widget /* widget */, + _XtBoolean /* mapped_when_managed */ +); + +extern Widget XtNameToWidget( + Widget /* reference */, + _Xconst _XtString /* names */ +); + +extern Widget XtWindowToWidget( + Display* /* display */, + Window /* window */ +); + +extern XtPointer XtGetClassExtension( + WidgetClass /* object_class */, + Cardinal /* byte_offset */, + XrmQuark /* type */, + long /* version */, + Cardinal /* record_size */ +); + +/*************************************************************** + * + * Arg lists + * + ****************************************************************/ + + +#define XtSetArg(arg, n, d) \ + ((void)( (arg).name = (n), (arg).value = (XtArgVal)(d) )) + +extern ArgList XtMergeArgLists( + ArgList /* args1 */, + Cardinal /* num_args1 */, + ArgList /* args2 */, + Cardinal /* num_args2 */ +); + +/*************************************************************** + * + * Vararg lists + * + ****************************************************************/ + +#define XtVaNestedList "XtVaNestedList" +#define XtVaTypedArg "XtVaTypedArg" + +extern XtVarArgsList XtVaCreateArgsList( + XtPointer /*unused*/, ... +) _X_SENTINEL(0); + +/************************************************************* + * + * Information routines + * + ************************************************************/ + +#ifndef _XtIntrinsicP_h + +/* We're not included from the private file, so define these */ + +extern Display *XtDisplay( + Widget /* widget */ +); + +extern Display *XtDisplayOfObject( + Widget /* object */ +); + +extern Screen *XtScreen( + Widget /* widget */ +); + +extern Screen *XtScreenOfObject( + Widget /* object */ +); + +extern Window XtWindow( + Widget /* widget */ +); + +extern Window XtWindowOfObject( + Widget /* object */ +); + +extern String XtName( + Widget /* object */ +); + +extern WidgetClass XtSuperclass( + Widget /* object */ +); + +extern WidgetClass XtClass( + Widget /* object */ +); + +extern Widget XtParent( + Widget /* widget */ +); + +#endif /*_XtIntrinsicP_h*/ + +#undef XtMapWidget +extern void XtMapWidget(Widget /* w */); +#define XtMapWidget(widget) XMapWindow(XtDisplay(widget), XtWindow(widget)) + +#undef XtUnmapWidget +extern void XtUnmapWidget(Widget /* w */); +#define XtUnmapWidget(widget) \ + XUnmapWindow(XtDisplay(widget), XtWindow(widget)) + +extern void XtAddCallback( + Widget /* widget */, + _Xconst _XtString /* callback_name */, + XtCallbackProc /* callback */, + XtPointer /* closure */ +); + +extern void XtRemoveCallback( + Widget /* widget */, + _Xconst _XtString /* callback_name */, + XtCallbackProc /* callback */, + XtPointer /* closure */ +); + +extern void XtAddCallbacks( + Widget /* widget */, + _Xconst _XtString /* callback_name */, + XtCallbackList /* callbacks */ +); + +extern void XtRemoveCallbacks( + Widget /* widget */, + _Xconst _XtString /* callback_name */, + XtCallbackList /* callbacks */ +); + +extern void XtRemoveAllCallbacks( + Widget /* widget */, + _Xconst _XtString /* callback_name */ +); + + +extern void XtCallCallbacks( + Widget /* widget */, + _Xconst _XtString /* callback_name */, + XtPointer /* call_data */ +); + +extern void XtCallCallbackList( + Widget /* widget */, + XtCallbackList /* callbacks */, + XtPointer /* call_data */ +); + +extern XtCallbackStatus XtHasCallbacks( + Widget /* widget */, + _Xconst _XtString /* callback_name */ +); + +/**************************************************************** + * + * Geometry Management + * + ****************************************************************/ + + +extern XtGeometryResult XtMakeGeometryRequest( + Widget /* widget */, + XtWidgetGeometry* /* request */, + XtWidgetGeometry* /* reply_return */ +); + +extern XtGeometryResult XtQueryGeometry( + Widget /* widget */, + XtWidgetGeometry* /* intended */, + XtWidgetGeometry* /* preferred_return */ +); + +extern Widget XtCreatePopupShell( + _Xconst _XtString /* name */, + WidgetClass /* widgetClass */, + Widget /* parent */, + ArgList /* args */, + Cardinal /* num_args */ +); + +extern Widget XtVaCreatePopupShell( + _Xconst _XtString /* name */, + WidgetClass /* widgetClass */, + Widget /* parent */, + ... +) _X_SENTINEL(0); + +extern void XtPopup( + Widget /* popup_shell */, + XtGrabKind /* grab_kind */ +); + +extern void XtPopupSpringLoaded( + Widget /* popup_shell */ +); + +extern void XtCallbackNone( + Widget /* widget */, + XtPointer /* closure */, + XtPointer /* call_data */ +); + +extern void XtCallbackNonexclusive( + Widget /* widget */, + XtPointer /* closure */, + XtPointer /* call_data */ +); + +extern void XtCallbackExclusive( + Widget /* widget */, + XtPointer /* closure */, + XtPointer /* call_data */ +); + +extern void XtPopdown( + Widget /* popup_shell */ +); + +extern void XtCallbackPopdown( + Widget /* widget */, + XtPointer /* closure */, + XtPointer /* call_data */ +); + +extern void XtMenuPopupAction( + Widget /* widget */, + XEvent* /* event */, + String* /* params */, + Cardinal* /* num_params */ +); + +extern Widget XtCreateWidget( + _Xconst _XtString /* name */, + WidgetClass /* widget_class */, + Widget /* parent */, + ArgList /* args */, + Cardinal /* num_args */ +); + +extern Widget XtCreateManagedWidget( + _Xconst _XtString /* name */, + WidgetClass /* widget_class */, + Widget /* parent */, + ArgList /* args */, + Cardinal /* num_args */ +); + +extern Widget XtVaCreateWidget( + _Xconst _XtString /* name */, + WidgetClass /* widget */, + Widget /* parent */, + ... +) _X_SENTINEL(0); + +extern Widget XtVaCreateManagedWidget( + _Xconst _XtString /* name */, + WidgetClass /* widget_class */, + Widget /* parent */, + ... +) _X_SENTINEL(0); + +extern Widget XtCreateApplicationShell( /* obsolete */ + _Xconst _XtString /* name */, + WidgetClass /* widget_class */, + ArgList /* args */, + Cardinal /* num_args */ +); + +extern Widget XtAppCreateShell( + _Xconst _XtString /* application_name */, + _Xconst _XtString /* application_class */, + WidgetClass /* widget_class */, + Display* /* display */, + ArgList /* args */, + Cardinal /* num_args */ +); + +extern Widget XtVaAppCreateShell( + _Xconst _XtString /* application_name */, + _Xconst _XtString /* application_class */, + WidgetClass /* widget_class */, + Display* /* display */, + ... +) _X_SENTINEL(0); + +/**************************************************************** + * + * Toolkit initialization + * + ****************************************************************/ + +extern void XtToolkitInitialize( + void +); + +extern XtLanguageProc XtSetLanguageProc( + XtAppContext /* app_context */, + XtLanguageProc /* proc */, + XtPointer /* client_data */ +); + +extern void XtDisplayInitialize( + XtAppContext /* app_context */, + Display* /* dpy */, + _Xconst _XtString /* application_name */, + _Xconst _XtString /* application_class */, + XrmOptionDescRec* /* options */, + Cardinal /* num_options */, + int* /* argc */, + char** /* argv */ +); + +extern Widget XtOpenApplication( + XtAppContext* /* app_context_return */, + _Xconst _XtString /* application_class */, + XrmOptionDescList /* options */, + Cardinal /* num_options */, + int* /* argc_in_out */, + String* /* argv_in_out */, + String* /* fallback_resources */, + WidgetClass /* widget_class */, + ArgList /* args */, + Cardinal /* num_args */ +); + +extern Widget XtVaOpenApplication( + XtAppContext* /* app_context_return */, + _Xconst _XtString /* application_class */, + XrmOptionDescList /* options */, + Cardinal /* num_options */, + int* /* argc_in_out */, + String* /* argv_in_out */, + String* /* fallback_resources */, + WidgetClass /* widget_class */, + ... +) _X_SENTINEL(0); + +extern Widget XtAppInitialize( /* obsolete */ + XtAppContext* /* app_context_return */, + _Xconst _XtString /* application_class */, + XrmOptionDescList /* options */, + Cardinal /* num_options */, + int* /* argc_in_out */, + String* /* argv_in_out */, + String* /* fallback_resources */, + ArgList /* args */, + Cardinal /* num_args */ +); + +extern Widget XtVaAppInitialize( /* obsolete */ + XtAppContext* /* app_context_return */, + _Xconst _XtString /* application_class */, + XrmOptionDescList /* options */, + Cardinal /* num_options */, + int* /* argc_in_out */, + String* /* argv_in_out */, + String* /* fallback_resources */, + ... +) _X_SENTINEL(0); + +extern Widget XtInitialize( /* obsolete */ + _Xconst _XtString /* shell_name */, + _Xconst _XtString /* application_class */, + XrmOptionDescRec* /* options */, + Cardinal /* num_options */, + int* /* argc */, + char** /* argv */ +); + +extern Display *XtOpenDisplay( + XtAppContext /* app_context */, + _Xconst _XtString /* display_string */, + _Xconst _XtString /* application_name */, + _Xconst _XtString /* application_class */, + XrmOptionDescRec* /* options */, + Cardinal /* num_options */, + int* /* argc */, + char** /* argv */ +); + +extern XtAppContext XtCreateApplicationContext( + void +); + +extern void XtAppSetFallbackResources( + XtAppContext /* app_context */, + String* /* specification_list */ +); + +extern void XtDestroyApplicationContext( + XtAppContext /* app_context */ +); + +extern void XtInitializeWidgetClass( + WidgetClass /* widget_class */ +); + +extern XtAppContext XtWidgetToApplicationContext( + Widget /* widget */ +); + +extern XtAppContext XtDisplayToApplicationContext( + Display* /* dpy */ +); + +extern XrmDatabase XtDatabase( + Display* /* dpy */ +); + +extern XrmDatabase XtScreenDatabase( + Screen* /* screen */ +); + +extern void XtCloseDisplay( + Display* /* dpy */ +); + +extern void XtGetApplicationResources( + Widget /* widget */, + XtPointer /* base */, + XtResourceList /* resources */, + Cardinal /* num_resources */, + ArgList /* args */, + Cardinal /* num_args */ +); + +extern void XtVaGetApplicationResources( + Widget /* widget */, + XtPointer /* base */, + XtResourceList /* resources */, + Cardinal /* num_resources */, + ... +) _X_SENTINEL(0); + +extern void XtGetSubresources( + Widget /* widget */, + XtPointer /* base */, + _Xconst _XtString /* name */, + _Xconst _XtString /* class */, + XtResourceList /* resources */, + Cardinal /* num_resources */, + ArgList /* args */, + Cardinal /* num_args */ +); + +extern void XtVaGetSubresources( + Widget /* widget */, + XtPointer /* base */, + _Xconst _XtString /* name */, + _Xconst _XtString /* class */, + XtResourceList /* resources */, + Cardinal /* num_resources */, + ... +) _X_SENTINEL(0); + +extern void XtSetValues( + Widget /* widget */, + ArgList /* args */, + Cardinal /* num_args */ +); + +extern void XtVaSetValues( + Widget /* widget */, + ... +) _X_SENTINEL(0); + +extern void XtGetValues( + Widget /* widget */, + ArgList /* args */, + Cardinal /* num_args */ +); + +extern void XtVaGetValues( + Widget /* widget */, + ... +) _X_SENTINEL(0); + +extern void XtSetSubvalues( + XtPointer /* base */, + XtResourceList /* resources */, + Cardinal /* num_resources */, + ArgList /* args */, + Cardinal /* num_args */ +); + +extern void XtVaSetSubvalues( + XtPointer /* base */, + XtResourceList /* resources */, + Cardinal /* num_resources */, + ... +) _X_SENTINEL(0); + +extern void XtGetSubvalues( + XtPointer /* base */, + XtResourceList /* resources */, + Cardinal /* num_resources */, + ArgList /* args */, + Cardinal /* num_args */ +); + +extern void XtVaGetSubvalues( + XtPointer /* base */, + XtResourceList /* resources */, + Cardinal /* num_resources */, + ... +) _X_SENTINEL(0); + +extern void XtGetResourceList( + WidgetClass /* widget_class */, + XtResourceList* /* resources_return */, + Cardinal* /* num_resources_return */ +); + +extern void XtGetConstraintResourceList( + WidgetClass /* widget_class */, + XtResourceList* /* resources_return */, + Cardinal* /* num_resources_return */ +); + +#define XtUnspecifiedPixmap ((Pixmap)2) +#define XtUnspecifiedShellInt (-1) +#define XtUnspecifiedWindow ((Window)2) +#define XtUnspecifiedWindowGroup ((Window)3) +#define XtCurrentDirectory "XtCurrentDirectory" +#define XtDefaultForeground "XtDefaultForeground" +#define XtDefaultBackground "XtDefaultBackground" +#define XtDefaultFont "XtDefaultFont" +#define XtDefaultFontSet "XtDefaultFontSet" + +#if defined(CRAY) +#define XtOffset(p_type,field) _Offsetof(p_type,field) +#else /* ! CRAY */ +#define XtOffset(p_type,field) \ + ((Cardinal) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) +#endif /* !CRAY */ + +#ifdef offsetof +#define XtOffsetOf(s_type,field) offsetof(s_type,field) +#else +#define XtOffsetOf(s_type,field) XtOffset(s_type*,field) +#endif + +/************************************************************* + * + * Session Management + * + ************************************************************/ + +typedef struct _XtCheckpointTokenRec { + int save_type; + int interact_style; + Boolean shutdown; + Boolean fast; + Boolean cancel_shutdown; + int phase; + int interact_dialog_type; /* return */ + Boolean request_cancel; /* return */ + Boolean request_next_phase; /* return */ + Boolean save_success; /* return */ + int type; /* implementation private */ + Widget widget; /* implementation private */ +} XtCheckpointTokenRec, *XtCheckpointToken; + +XtCheckpointToken XtSessionGetToken( + Widget /* widget */ +); + +void XtSessionReturnToken( + XtCheckpointToken /* token */ +); + +/************************************************************* + * + * Error Handling + * + ************************************************************/ + +extern XtErrorMsgHandler XtAppSetErrorMsgHandler( + XtAppContext /* app_context */, + XtErrorMsgHandler /* handler */ +); + +extern void XtSetErrorMsgHandler( /* obsolete */ + XtErrorMsgHandler /* handler */ +); + +extern XtErrorMsgHandler XtAppSetWarningMsgHandler( + XtAppContext /* app_context */, + XtErrorMsgHandler /* handler */ +); + +extern void XtSetWarningMsgHandler( /* obsolete */ + XtErrorMsgHandler /* handler */ +); + +extern void XtAppErrorMsg( + XtAppContext /* app_context */, + _Xconst _XtString /* name */, + _Xconst _XtString /* type */, + _Xconst _XtString /* class */, + _Xconst _XtString /* default */, + String* /* params */, + Cardinal* /* num_params */ +); + +extern void XtErrorMsg( /* obsolete */ + _Xconst _XtString /* name */, + _Xconst _XtString /* type */, + _Xconst _XtString /* class */, + _Xconst _XtString /* default */, + String* /* params */, + Cardinal* /* num_params */ +); + +extern void XtAppWarningMsg( + XtAppContext /* app_context */, + _Xconst _XtString /* name */, + _Xconst _XtString /* type */, + _Xconst _XtString /* class */, + _Xconst _XtString /* default */, + String* /* params */, + Cardinal* /* num_params */ +); + +extern void XtWarningMsg( /* obsolete */ + _Xconst _XtString /* name */, + _Xconst _XtString /* type */, + _Xconst _XtString /* class */, + _Xconst _XtString /* default */, + String* /* params */, + Cardinal* /* num_params */ +); + +extern XtErrorHandler XtAppSetErrorHandler( + XtAppContext /* app_context */, + XtErrorHandler /* handler */ +); + +extern void XtSetErrorHandler( /* obsolete */ + XtErrorHandler /* handler */ +); + +extern XtErrorHandler XtAppSetWarningHandler( + XtAppContext /* app_context */, + XtErrorHandler /* handler */ +); + +extern void XtSetWarningHandler( /* obsolete */ + XtErrorHandler /* handler */ +); + +extern void XtAppError( + XtAppContext /* app_context */, + _Xconst _XtString /* message */ +); + +extern void XtError( /* obsolete */ + _Xconst _XtString /* message */ +); + +extern void XtAppWarning( + XtAppContext /* app_context */, + _Xconst _XtString /* message */ +); + +extern void XtWarning( /* obsolete */ + _Xconst _XtString /* message */ +); + +extern XrmDatabase *XtAppGetErrorDatabase( + XtAppContext /* app_context */ +); + +extern XrmDatabase *XtGetErrorDatabase( /* obsolete */ + void +); + +extern void XtAppGetErrorDatabaseText( + XtAppContext /* app_context */, + _Xconst _XtString /* name */, + _Xconst _XtString /* type */, + _Xconst _XtString /* class */, + _Xconst _XtString /* default */, + String /* buffer_return */, + int /* nbytes */, + XrmDatabase /* database */ +); + +extern void XtGetErrorDatabaseText( /* obsolete */ + _Xconst _XtString /* name */, + _Xconst _XtString /* type */, + _Xconst _XtString /* class */, + _Xconst _XtString /* default */, + String /* buffer_return */, + int /* nbytes */ +); + +/**************************************************************** + * + * Memory Management + * + ****************************************************************/ + +extern char *XtMalloc( + Cardinal /* size */ +); + +extern char *XtCalloc( + Cardinal /* num */, + Cardinal /* size */ +); + +extern char *XtRealloc( + char* /* ptr */, + Cardinal /* num */ +); + +extern void XtFree( + char* /* ptr */ +); + +#ifdef XTTRACEMEMORY + +extern char *_XtMalloc( /* implementation-private */ + Cardinal /* size */, + char * /* file */, + int /* line */ +); + +extern char *_XtRealloc( /* implementation-private */ + char * /* ptr */, + Cardinal /* size */, + char * /* file */, + int /* line */ +); + +extern char *_XtCalloc( /* implementation-private */ + Cardinal /* num */, + Cardinal /* size */, + char * /* file */, + int /* line */ +); + +extern void _XtFree( /* implementation-private */ + char * /* ptr */ +); + +#define XtMalloc(size) _XtMalloc(size, __FILE__, __LINE__) +#define XtRealloc(ptr,size) _XtRealloc(ptr, size, __FILE__, __LINE__) +#define XtCalloc(num,size) _XtCalloc(num, size, __FILE__, __LINE__) +#define XtFree(ptr) _XtFree(ptr) + +#endif /* ifdef XTTRACEMEMORY */ + +#define XtNew(type) ((type *) XtMalloc((unsigned) sizeof(type))) + +#undef XtNewString +extern String XtNewString(String /* str */); +#define XtNewString(str) \ + ((str) != NULL ? (strcpy(XtMalloc((unsigned)strlen(str) + 1), str)) : NULL) + +/************************************************************* + * + * Work procs + * + **************************************************************/ + +extern XtWorkProcId XtAddWorkProc( /* obsolete */ + XtWorkProc /* proc */, + XtPointer /* closure */ +); + +extern XtWorkProcId XtAppAddWorkProc( + XtAppContext /* app_context */, + XtWorkProc /* proc */, + XtPointer /* closure */ +); + +extern void XtRemoveWorkProc( + XtWorkProcId /* id */ +); + + +/**************************************************************** + * + * Graphic Context Management + *****************************************************************/ + +extern GC XtGetGC( + Widget /* widget */, + XtGCMask /* valueMask */, + XGCValues* /* values */ +); + +extern GC XtAllocateGC( + Widget /* widget */, + Cardinal /* depth */, + XtGCMask /* valueMask */, + XGCValues* /* values */, + XtGCMask /* dynamicMask */, + XtGCMask /* unusedMask */ +); + +/* This implementation of XtDestroyGC differs from the formal specification + * for historic backwards compatibility reasons. As other implementations + * may conform to the spec, use of XtReleaseGC is strongly encouraged. + */ +extern void XtDestroyGC( /* obsolete */ + GC /* gc */ +); + +extern void XtReleaseGC( + Widget /* object */, + GC /* gc */ +); + + + +extern void XtAppReleaseCacheRefs( + XtAppContext /* app_context */, + XtCacheRef* /* cache_ref */ +); + +extern void XtCallbackReleaseCacheRef( + Widget /* widget */, + XtPointer /* closure */, /* XtCacheRef */ + XtPointer /* call_data */ +); + +extern void XtCallbackReleaseCacheRefList( + Widget /* widget */, + XtPointer /* closure */, /* XtCacheRef* */ + XtPointer /* call_data */ +); + +extern void XtSetWMColormapWindows( + Widget /* widget */, + Widget* /* list */, + Cardinal /* count */ +); + +extern String XtFindFile( + _Xconst _XtString /* path */, + Substitution /* substitutions */, + Cardinal /* num_substitutions */, + XtFilePredicate /* predicate */ +); + +extern String XtResolvePathname( + Display* /* dpy */, + _Xconst _XtString /* type */, + _Xconst _XtString /* filename */, + _Xconst _XtString /* suffix */, + _Xconst _XtString /* path */, + Substitution /* substitutions */, + Cardinal /* num_substitutions */, + XtFilePredicate /* predicate */ +); + +/**************************************************************** + * + * Selections + * + *****************************************************************/ + +#define XT_CONVERT_FAIL (Atom)0x80000001 + +extern void XtDisownSelection( + Widget /* widget */, + Atom /* selection */, + Time /* time */ +); + +extern void XtGetSelectionValue( + Widget /* widget */, + Atom /* selection */, + Atom /* target */, + XtSelectionCallbackProc /* callback */, + XtPointer /* closure */, + Time /* time */ +); + +extern void XtGetSelectionValues( + Widget /* widget */, + Atom /* selection */, + Atom* /* targets */, + int /* count */, + XtSelectionCallbackProc /* callback */, + XtPointer* /* closures */, + Time /* time */ +); + +extern void XtAppSetSelectionTimeout( + XtAppContext /* app_context */, + unsigned long /* timeout */ +); + +extern void XtSetSelectionTimeout( /* obsolete */ + unsigned long /* timeout */ +); + +extern unsigned long XtAppGetSelectionTimeout( + XtAppContext /* app_context */ +); + +extern unsigned long XtGetSelectionTimeout( /* obsolete */ + void +); + +extern XSelectionRequestEvent *XtGetSelectionRequest( + Widget /* widget */, + Atom /* selection */, + XtRequestId /* request_id */ +); + +extern void XtGetSelectionValueIncremental( + Widget /* widget */, + Atom /* selection */, + Atom /* target */, + XtSelectionCallbackProc /* selection_callback */, + XtPointer /* client_data */, + Time /* time */ +); + +extern void XtGetSelectionValuesIncremental( + Widget /* widget */, + Atom /* selection */, + Atom* /* targets */, + int /* count */, + XtSelectionCallbackProc /* callback */, + XtPointer* /* client_data */, + Time /* time */ +); + +extern void XtSetSelectionParameters( + Widget /* requestor */, + Atom /* selection */, + Atom /* type */, + XtPointer /* value */, + unsigned long /* length */, + int /* format */ +); + +extern void XtGetSelectionParameters( + Widget /* owner */, + Atom /* selection */, + XtRequestId /* request_id */, + Atom* /* type_return */, + XtPointer* /* value_return */, + unsigned long* /* length_return */, + int* /* format_return */ +); + +extern void XtCreateSelectionRequest( + Widget /* requestor */, + Atom /* selection */ +); + +extern void XtSendSelectionRequest( + Widget /* requestor */, + Atom /* selection */, + Time /* time */ +); + +extern void XtCancelSelectionRequest( + Widget /* requestor */, + Atom /* selection */ +); + +extern Atom XtReservePropertyAtom( + Widget /* widget */ +); + +extern void XtReleasePropertyAtom( + Widget /* widget */, + Atom /* selection */ +); + +extern void XtGrabKey( + Widget /* widget */, + _XtKeyCode /* keycode */, + Modifiers /* modifiers */, + _XtBoolean /* owner_events */, + int /* pointer_mode */, + int /* keyboard_mode */ +); + +extern void XtUngrabKey( + Widget /* widget */, + _XtKeyCode /* keycode */, + Modifiers /* modifiers */ +); + +extern int XtGrabKeyboard( + Widget /* widget */, + _XtBoolean /* owner_events */, + int /* pointer_mode */, + int /* keyboard_mode */, + Time /* time */ +); + +extern void XtUngrabKeyboard( + Widget /* widget */, + Time /* time */ +); + +extern void XtGrabButton( + Widget /* widget */, + int /* button */, + Modifiers /* modifiers */, + _XtBoolean /* owner_events */, + unsigned int /* event_mask */, + int /* pointer_mode */, + int /* keyboard_mode */, + Window /* confine_to */, + Cursor /* cursor */ +); + +extern void XtUngrabButton( + Widget /* widget */, + unsigned int /* button */, + Modifiers /* modifiers */ +); + +extern int XtGrabPointer( + Widget /* widget */, + _XtBoolean /* owner_events */, + unsigned int /* event_mask */, + int /* pointer_mode */, + int /* keyboard_mode */, + Window /* confine_to */, + Cursor /* cursor */, + Time /* time */ +); + +extern void XtUngrabPointer( + Widget /* widget */, + Time /* time */ +); + +extern void XtGetApplicationNameAndClass( + Display* /* dpy */, + String* /* name_return */, + String* /* class_return */ +); + +extern void XtRegisterDrawable( + Display* /* dpy */, + Drawable /* drawable */, + Widget /* widget */ +); + +extern void XtUnregisterDrawable( + Display* /* dpy */, + Drawable /* drawable */ +); + +extern Widget XtHooksOfDisplay( + Display* /* dpy */ +); + +typedef struct { + String type; + Widget widget; + ArgList args; + Cardinal num_args; +} XtCreateHookDataRec, *XtCreateHookData; + +typedef struct { + String type; + Widget widget; + XtPointer event_data; + Cardinal num_event_data; +} XtChangeHookDataRec, *XtChangeHookData; + +typedef struct { + Widget old, req; + ArgList args; + Cardinal num_args; +} XtChangeHookSetValuesDataRec, *XtChangeHookSetValuesData; + +typedef struct { + String type; + Widget widget; + XtGeometryMask changeMask; + XWindowChanges changes; +} XtConfigureHookDataRec, *XtConfigureHookData; + +typedef struct { + String type; + Widget widget; + XtWidgetGeometry* request; + XtWidgetGeometry* reply; + XtGeometryResult result; +} XtGeometryHookDataRec, *XtGeometryHookData; + +typedef struct { + String type; + Widget widget; +} XtDestroyHookDataRec, *XtDestroyHookData; + +extern void XtGetDisplays( + XtAppContext /* app_context */, + Display*** /* dpy_return */, + Cardinal* /* num_dpy_return */ +); + +extern Boolean XtToolkitThreadInitialize( + void +); + +extern void XtAppSetExitFlag( + XtAppContext /* app_context */ +); + +extern Boolean XtAppGetExitFlag( + XtAppContext /* app_context */ +); + +extern void XtAppLock( + XtAppContext /* app_context */ +); + +extern void XtAppUnlock( + XtAppContext /* app_context */ +); + +/* + * Predefined Resource Converters + */ + + +/* String converters */ + +extern Boolean XtCvtStringToAcceleratorTable( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToAtom( + Display* /* dpy */, + XrmValuePtr /* args */, /* Display */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToBool( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToBoolean( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToCommandArgArray( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToCursor( + Display* /* dpy */, + XrmValuePtr /* args */, /* Display */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToDimension( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToDirectoryString( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToDisplay( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToFile( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToFloat( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToFont( + Display* /* dpy */, + XrmValuePtr /* args */, /* Display */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToFontSet( + Display* /* dpy */, + XrmValuePtr /* args */, /* Display, locale */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToFontStruct( + Display* /* dpy */, + XrmValuePtr /* args */, /* Display */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToGravity( + Display* /* dpy */, + XrmValuePtr /* args */, + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToInitialState( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToInt( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToPixel( + Display* /* dpy */, + XrmValuePtr /* args */, /* Screen, Colormap */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +#define XtCvtStringToPosition XtCvtStringToShort + +extern Boolean XtCvtStringToRestartStyle( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToShort( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToTranslationTable( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToUnsignedChar( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtStringToVisual( + Display* /* dpy */, + XrmValuePtr /* args */, /* Screen, depth */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +/* int converters */ + +extern Boolean XtCvtIntToBool( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtIntToBoolean( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtIntToColor( + Display* /* dpy */, + XrmValuePtr /* args */, /* Screen, Colormap */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +#define XtCvtIntToDimension XtCvtIntToShort + +extern Boolean XtCvtIntToFloat( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtIntToFont( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtIntToPixel( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtIntToPixmap( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +#define XtCvtIntToPosition XtCvtIntToShort + +extern Boolean XtCvtIntToShort( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +extern Boolean XtCvtIntToUnsignedChar( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +/* Color converter */ + +extern Boolean XtCvtColorToPixel( + Display* /* dpy */, + XrmValuePtr /* args */, /* none */ + Cardinal* /* num_args */, + XrmValuePtr /* fromVal */, + XrmValuePtr /* toVal */, + XtPointer* /* closure_ret */ +); + +/* Pixel converter */ + +#define XtCvtPixelToColor XtCvtIntToColor + + +_XFUNCPROTOEND + +#endif /*_XtIntrinsic_h*/ +/* DON'T ADD STUFF AFTER THIS #endif */ diff --git a/X11/IntrinsicI.h b/X11/IntrinsicI.h new file mode 100644 index 000000000..d88166fc3 --- /dev/null +++ b/X11/IntrinsicI.h @@ -0,0 +1,265 @@ +/* $Xorg: IntrinsicI.h,v 1.4 2001/02/09 02:03:55 xorgcvs Exp $ */ + +/*********************************************************** + +Copyright 1987, 1988, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ +/* $XFree86: xc/lib/Xt/IntrinsicI.h,v 3.8 2001/12/14 19:56:25 dawes Exp $ */ + +#ifndef _XtintrinsicI_h +#define _XtintrinsicI_h + +#include "Xtos.h" +#include "IntrinsicP.h" +#ifdef WIN32 +#define _WILLWINSOCK_ +#endif +#include <X11/Xos.h> + +#include "Object.h" +#include "RectObj.h" +#include "ObjectP.h" +#include "RectObjP.h" + +#include "ConvertI.h" +#include "TranslateI.h" + +#define RectObjClassFlag 0x02 +#define WidgetClassFlag 0x04 +#define CompositeClassFlag 0x08 +#define ConstraintClassFlag 0x10 +#define ShellClassFlag 0x20 +#define WMShellClassFlag 0x40 +#define TopLevelClassFlag 0x80 + +/* + * The following macros, though very handy, are not suitable for + * IntrinsicP.h as they violate the rule that arguments are to + * be evaluated exactly once. + */ + +#define XtDisplayOfObject(object) \ + (XtIsWidget(object) ? (object)->core.screen->display : \ + _XtIsHookObject(object) ? ((HookObject)(object))->hooks.screen->display : \ + _XtWindowedAncestor(object)->core.screen->display) + +#define XtScreenOfObject(object) \ + (XtIsWidget(object) ? (object)->core.screen : \ + _XtIsHookObject(object) ? ((HookObject)(object))->hooks.screen : \ + _XtWindowedAncestor(object)->core.screen) + +#define XtWindowOfObject(object) \ + ((XtIsWidget(object) ? (object) : _XtWindowedAncestor(object)) \ + ->core.window) + +#define XtIsManaged(object) \ + (XtIsRectObj(object) ? (object)->core.managed : False) + +#define XtIsSensitive(object) \ + (XtIsRectObj(object) ? ((object)->core.sensitive && \ + (object)->core.ancestor_sensitive) : False) + + +/**************************************************************** + * + * Byte utilities + * + ****************************************************************/ + +#define _XBCOPYFUNC _XtBcopy +#include <X11/Xfuncs.h> + +/* If the alignment characteristics of your machine are right, these may be + faster */ + +#ifdef UNALIGNED + +#define XtMemmove(dst, src, size) \ + if ((char *)(dst) != (char *)(src)) { \ + if (size == sizeof(int)) \ + *((int *) (dst)) = *((int *) (src)); \ + else if (size == sizeof(char)) \ + *((char *) (dst)) = *((char *) (src)); \ + else if (size == sizeof(short)) \ + *((short *) (dst)) = *((short *) (src)); \ + else \ + (void) memcpy((char *) (dst), (char *) (src), (int) (size)); \ + } + +#define XtBZero(dst, size) \ + if (size == sizeof(int)) \ + *((int *) (dst)) = 0; \ + else \ + bzero((char *) (dst), (int) (size)) + +#define XtMemcmp(b1, b2, size) \ + (size == sizeof(int) ? \ + *((int *) (b1)) != *((int *) (b2)) \ + : memcmp((char *) (b1), (char *) (b2), (int) (size)) \ + ) + +#else + +#define XtMemmove(dst, src, size) \ + if ((char *)(dst) != (char *)(src)) { \ + (void) memcpy((char *) (dst), (char *) (src), (int) (size)); \ + } + +#define XtBZero(dst, size) \ + bzero((char *) (dst), (int) (size)) + +#define XtMemcmp(b1, b2, size) \ + memcmp((char *) (b1), (char *) (b2), (int) (size)) + +#endif + + +/**************************************************************** + * + * Stack cache allocation/free + * + ****************************************************************/ + +#define XtStackAlloc(size, stack_cache_array) \ + ((size) <= sizeof(stack_cache_array) \ + ? (XtPointer)(stack_cache_array) \ + : XtMalloc((unsigned)(size))) + +#define XtStackFree(pointer, stack_cache_array) \ + { if ((pointer) != ((XtPointer)(stack_cache_array))) XtFree(pointer); } + +/*************************************************************** + * + * Filename defines + * + **************************************************************/ + +/* used by XtResolvePathname */ +#ifndef XFILESEARCHPATHDEFAULT +#define XFILESEARCHPATHDEFAULT "/usr/lib/X11/%L/%T/%N%S:/usr/lib/X11/%l/%T/%N%S:/usr/lib/X11/%T/%N%S" +#endif + +/* the following two were both "X Toolkit " prior to R4 */ +#ifndef XTERROR_PREFIX +#define XTERROR_PREFIX "" +#endif + +#ifndef XTWARNING_PREFIX +#define XTWARNING_PREFIX "" +#endif + +#ifndef ERRORDB +#define ERRORDB "/usr/lib/X11/XtErrorDB" +#endif + +_XFUNCPROTOBEGIN + +extern String XtCXtToolkitError; + +extern void _XtAllocError( + String /* alloc_type */ +); + +extern void _XtCompileResourceList( + XtResourceList /* resources */, + Cardinal /* num_resources */ +); + +extern XtGeometryResult _XtMakeGeometryRequest( + Widget /* widget */, + XtWidgetGeometry* /* request */, + XtWidgetGeometry* /* reply_return */, + Boolean* /* clear_rect_obj */ +); + +extern Boolean _XtIsHookObject( + Widget /* widget */ +); + +extern void _XtAddShellToHookObj( + Widget /* widget */ +); + +/* GCManager.c */ +extern void _XtGClistFree(Display *dpy, XtPerDisplay pd); + +/** GeoTattler stuff */ + +#ifdef XT_GEO_TATTLER + +extern void _XtGeoTab (int); +extern void _XtGeoTrace ( + Widget widget, + ... +) _X_ATTRIBUTE_PRINTF(2,3); + +#define CALLGEOTAT(f) f + +#else /* XT_GEO_TATTLER */ + +#define CALLGEOTAT(f) + +#endif /* XT_GEO_TATTLER */ + +#ifndef XTTRACEMEMORY + +extern char* __XtMalloc ( + unsigned /* size */ +); +extern char* __XtCalloc ( + unsigned /* num */, + unsigned /* size */ +); + +#else + +#define __XtMalloc XtMalloc +#define __XtCalloc XtCalloc +#endif + +_XFUNCPROTOEND + +#endif /* _XtintrinsicI_h */ +/* DON'T ADD STUFF AFTER THIS #endif */ diff --git a/X11/IntrinsicP.h b/X11/IntrinsicP.h new file mode 100644 index 000000000..517c55d2b --- /dev/null +++ b/X11/IntrinsicP.h @@ -0,0 +1,327 @@ +/* $Xorg: IntrinsicP.h,v 1.4 2001/02/09 02:03:55 xorgcvs Exp $ */ + +/*********************************************************** + +Copyright 1987, 1988, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ +/* $XFree86$ */ + +#ifndef _XtintrinsicP_h +#define _XtintrinsicP_h + +#include <X11/Intrinsic.h> + +/* + * Field sizes and offsets of XrmResource must match those of XtResource. + * Type long is used instead of XrmQuark here because XrmQuark and String + * are not the same size on all systems. + */ +typedef struct { + long xrm_name; /* Resource name quark */ + long xrm_class; /* Resource class quark */ + long xrm_type; /* Resource representation type quark */ + Cardinal xrm_size; /* Size in bytes of representation */ + int xrm_offset; /* -offset-1 */ + long xrm_default_type; /* Default representation type quark */ + XtPointer xrm_default_addr; /* Default resource address */ +} XrmResource, *XrmResourceList; + +typedef unsigned long XtVersionType; + +#define XT_VERSION 11 +#ifndef XT_REVISION +#define XT_REVISION 6 +#endif +#define XtVersion (XT_VERSION * 1000 + XT_REVISION) +#define XtVersionDontCheck 0 + +typedef void (*XtProc)( + void +); + +typedef void (*XtWidgetClassProc)( + WidgetClass /* class */ +); + +typedef void (*XtWidgetProc)( + Widget /* widget */ +); + +typedef Boolean (*XtAcceptFocusProc)( + Widget /* widget */, + Time* /* time */ +); + +typedef void (*XtArgsProc)( + Widget /* widget */, + ArgList /* args */, + Cardinal* /* num_args */ +); + +typedef void (*XtInitProc)( + Widget /* request */, + Widget /* new */, + ArgList /* args */, + Cardinal* /* num_args */ +); + +typedef Boolean (*XtSetValuesFunc)( + Widget /* old */, + Widget /* request */, + Widget /* new */, + ArgList /* args */, + Cardinal* /* num_args */ +); + +typedef Boolean (*XtArgsFunc)( + Widget /* widget */, + ArgList /* args */, + Cardinal* /* num_args */ +); + +typedef void (*XtAlmostProc)( + Widget /* old */, + Widget /* new */, + XtWidgetGeometry* /* request */, + XtWidgetGeometry* /* reply */ +); + +typedef void (*XtExposeProc)( + Widget /* widget */, + XEvent* /* event */, + Region /* region */ +); + +/* compress_exposure options*/ +#define XtExposeNoCompress ((XtEnum)False) +#define XtExposeCompressSeries ((XtEnum)True) +#define XtExposeCompressMultiple 2 +#define XtExposeCompressMaximal 3 + +/* modifiers */ +#define XtExposeGraphicsExpose 0x10 +#define XtExposeGraphicsExposeMerged 0x20 +#define XtExposeNoExpose 0x40 +#define XtExposeNoRegion 0x80 + +typedef void (*XtRealizeProc)( + Widget /* widget */, + XtValueMask* /* mask */, + XSetWindowAttributes* /* attributes */ +); + +typedef XtGeometryResult (*XtGeometryHandler)( + Widget /* widget */, + XtWidgetGeometry* /* request */, + XtWidgetGeometry* /* reply */ +); + +typedef void (*XtStringProc)( + Widget /* widget */, + String /* str */ +); + +typedef struct { + String name; /* resource name */ + String type; /* representation type name */ + XtArgVal value; /* representation */ + int size; /* size of representation */ +} XtTypedArg, *XtTypedArgList; + +typedef void (*XtAllocateProc)( + WidgetClass /* widget_class */, + Cardinal * /* constraint_size */, + Cardinal * /* more_bytes */, + ArgList /* args */, + Cardinal * /* num_args */, + XtTypedArgList /* typed_args */, + Cardinal * /* num_typed_args */, + Widget * /* widget_return */, + XtPointer * /* more_bytes_return */ +); + +typedef void (*XtDeallocateProc)( + Widget /* widget */, + XtPointer /* more_bytes */ +); + +struct _XtStateRec; /* Forward declare before use for C++ */ + +typedef struct _XtTMRec { + XtTranslations translations; /* private to Translation Manager */ + XtBoundActions proc_table; /* procedure bindings for actions */ + struct _XtStateRec *current_state; /* Translation Manager state ptr */ + unsigned long lastEventTime; +} XtTMRec, *XtTM; + +#include <X11/CoreP.h> +#include <X11/CompositeP.h> +#include <X11/ConstrainP.h> +#include <X11/ObjectP.h> +#include <X11/RectObjP.h> + +#define XtDisplay(widget) DisplayOfScreen((widget)->core.screen) +#define XtScreen(widget) ((widget)->core.screen) +#define XtWindow(widget) ((widget)->core.window) + +#define XtClass(widget) ((widget)->core.widget_class) +#define XtSuperclass(widget) (XtClass(widget)->core_class.superclass) +#define XtIsRealized(object) (XtWindowOfObject(object) != None) +#define XtParent(widget) ((widget)->core.parent) + +#undef XtIsRectObj +extern Boolean XtIsRectObj(Widget); +#define XtIsRectObj(obj) \ + (((Object)(obj))->object.widget_class->core_class.class_inited & 0x02) + +#undef XtIsWidget +extern Boolean XtIsWidget(Widget); +#define XtIsWidget(obj) \ + (((Object)(obj))->object.widget_class->core_class.class_inited & 0x04) + +#undef XtIsComposite +extern Boolean XtIsComposite(Widget); +#define XtIsComposite(obj) \ + (((Object)(obj))->object.widget_class->core_class.class_inited & 0x08) + +#undef XtIsConstraint +extern Boolean XtIsConstraint(Widget); +#define XtIsConstraint(obj) \ + (((Object)(obj))->object.widget_class->core_class.class_inited & 0x10) + +#undef XtIsShell +extern Boolean XtIsShell(Widget); +#define XtIsShell(obj) \ + (((Object)(obj))->object.widget_class->core_class.class_inited & 0x20) + +#undef XtIsWMShell +extern Boolean XtIsWMShell(Widget); +#define XtIsWMShell(obj) \ + (((Object)(obj))->object.widget_class->core_class.class_inited & 0x40) + +#undef XtIsTopLevelShell +extern Boolean XtIsTopLevelShell(Widget); +#define XtIsTopLevelShell(obj) \ + (((Object)(obj))->object.widget_class->core_class.class_inited & 0x80) + +#ifdef DEBUG +#define XtCheckSubclass(w, widget_class_ptr, message) \ + if (!XtIsSubclass(((Widget)(w)), (widget_class_ptr))) { \ + String params[3]; \ + Cardinal num_params = 3; \ + params[0] = ((Widget)(w))->core.widget_class->core_class.class_name;\ + params[1] = (widget_class_ptr)->core_class.class_name; \ + params[2] = (message); \ + XtAppErrorMsg(XtWidgetToApplicationContext((Widget)(w)), \ + "subclassMismatch", "xtCheckSubclass", "XtToolkitError", \ + "Widget class %s found when subclass of %s expected: %s",\ + params, &num_params); \ + } +#else +#define XtCheckSubclass(w, widget_class, message) /* nothing */ +#endif + +_XFUNCPROTOBEGIN + +extern Widget _XtWindowedAncestor( /* internal; implementation-dependent */ + Widget /* object */ +); + +extern void _XtInherit( + void +); + +extern void _XtHandleFocus( + Widget /* widget */, + XtPointer /* client_data */, + XEvent * /* event */, + Boolean * /* cont */); + +extern void XtCreateWindow( + Widget /* widget */, + unsigned int /* window_class */, + Visual* /* visual */, + XtValueMask /* value_mask */, + XSetWindowAttributes* /* attributes */ +); + +extern void XtResizeWidget( + Widget /* widget */, + _XtDimension /* width */, + _XtDimension /* height */, + _XtDimension /* border_width */ +); + +extern void XtMoveWidget( + Widget /* widget */, + _XtPosition /* x */, + _XtPosition /* y */ +); + +extern void XtConfigureWidget( + Widget /* widget */, + _XtPosition /* x */, + _XtPosition /* y */, + _XtDimension /* width */, + _XtDimension /* height */, + _XtDimension /* border_width */ +); + +extern void XtResizeWindow( + Widget /* widget */ +); + +extern void XtProcessLock( + void +); + +extern void XtProcessUnlock( + void +); + +_XFUNCPROTOEND + +#endif /* _XtIntrinsicP_h */ +/* DON'T ADD STUFF AFTER THIS #endif */ diff --git a/X11/Object.h b/X11/Object.h new file mode 100644 index 000000000..5ef65de3c --- /dev/null +++ b/X11/Object.h @@ -0,0 +1,65 @@ +/* $Xorg: Object.h,v 1.4 2001/02/09 02:03:56 xorgcvs Exp $ */ +/* $oHeader: Object.h,v 1.2 88/08/18 15:55:32 asente Exp $ */ +/*********************************************************** + +Copyright 1987, 1988, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +#ifndef _XtObject_h +#define _XtObject_h + +_XFUNCPROTOBEGIN + +typedef struct _ObjectRec *Object; +typedef struct _ObjectClassRec *ObjectClass; + +#ifndef VMS +externalref WidgetClass objectClass; +#endif + +_XFUNCPROTOEND + +#endif /* _XtObject_h */ +/* DON'T ADD STUFF AFTER THIS #endif */ diff --git a/X11/ObjectP.h b/X11/ObjectP.h new file mode 100644 index 000000000..0f484d2fd --- /dev/null +++ b/X11/ObjectP.h @@ -0,0 +1,143 @@ +/* $Xorg: ObjectP.h,v 1.4 2001/02/09 02:03:56 xorgcvs Exp $ */ + +/*********************************************************** + +Copyright 1987, 1988, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +#ifndef _Xt_ObjectP_h_ +#define _Xt_ObjectP_h_ + +#include <X11/Object.h> + +_XFUNCPROTOBEGIN + +/********************************************************** + * Object Instance Data Structures + * + **********************************************************/ +/* these fields match CorePart and can not be changed */ + +typedef struct _ObjectPart { + Widget self; /* pointer to widget itself */ + WidgetClass widget_class; /* pointer to Widget's ClassRec */ + Widget parent; /* parent widget */ + XrmName xrm_name; /* widget resource name quarkified */ + Boolean being_destroyed; /* marked for destroy */ + XtCallbackList destroy_callbacks; /* who to call when widget destroyed */ + XtPointer constraints; /* constraint record */ +} ObjectPart; + +typedef struct _ObjectRec { + ObjectPart object; +} ObjectRec; + +/******************************************************** + * Object Class Data Structures + * + ********************************************************/ +/* these fields match CoreClassPart and can not be changed */ +/* ideally these structures would only contain the fields required; + but because the CoreClassPart cannot be changed at this late date + extraneous fields are necessary to make the field offsets match */ + +typedef struct _ObjectClassPart { + + WidgetClass superclass; /* pointer to superclass ClassRec */ + String class_name; /* widget resource class name */ + Cardinal widget_size; /* size in bytes of widget record */ + XtProc class_initialize; /* class initialization proc */ + XtWidgetClassProc class_part_initialize; /* dynamic initialization */ + XtEnum class_inited; /* has class been initialized? */ + XtInitProc initialize; /* initialize subclass fields */ + XtArgsProc initialize_hook; /* notify that initialize called */ + XtProc obj1; /* NULL */ + XtPointer obj2; /* NULL */ + Cardinal obj3; /* NULL */ + XtResourceList resources; /* resources for subclass fields */ + Cardinal num_resources; /* number of entries in resources */ + XrmClass xrm_class; /* resource class quarkified */ + Boolean obj4; /* NULL */ + XtEnum obj5; /* NULL */ + Boolean obj6; /* NULL */ + Boolean obj7; /* NULL */ + XtWidgetProc destroy; /* free data for subclass pointers */ + XtProc obj8; /* NULL */ + XtProc obj9; /* NULL */ + XtSetValuesFunc set_values; /* set subclass resource values */ + XtArgsFunc set_values_hook; /* notify that set_values called */ + XtProc obj10; /* NULL */ + XtArgsProc get_values_hook; /* notify that get_values called */ + XtProc obj11; /* NULL */ + XtVersionType version; /* version of intrinsics used */ + XtPointer callback_private; /* list of callback offsets */ + String obj12; /* NULL */ + XtProc obj13; /* NULL */ + XtProc obj14; /* NULL */ + XtPointer extension; /* pointer to extension record */ +}ObjectClassPart; + +typedef struct { + XtPointer next_extension; /* 1st 4 required for all extension records */ + XrmQuark record_type; /* NULLQUARK; when on ObjectClassPart */ + long version; /* must be XtObjectExtensionVersion */ + Cardinal record_size; /* sizeof(ObjectClassExtensionRec) */ + XtAllocateProc allocate; + XtDeallocateProc deallocate; +} ObjectClassExtensionRec, *ObjectClassExtension; + +typedef struct _ObjectClassRec { + ObjectClassPart object_class; +} ObjectClassRec; + +externalref ObjectClassRec objectClassRec; + +_XFUNCPROTOEND + +#define XtObjectExtensionVersion 1L +#define XtInheritAllocate ((XtAllocateProc) _XtInherit) +#define XtInheritDeallocate ((XtDeallocateProc) _XtInherit) + +#endif /*_Xt_ObjectP_h_*/ diff --git a/X11/PassivGraI.h b/X11/PassivGraI.h new file mode 100644 index 000000000..10591ac4d --- /dev/null +++ b/X11/PassivGraI.h @@ -0,0 +1,190 @@ +/* +* $Xorg: PassivGraI.h,v 1.4 2001/02/09 02:03:56 xorgcvs Exp $ +*/ + +/******************************************************** + +Copyright 1988 by Hewlett-Packard Company +Copyright 1987, 1988, 1989 by Digital Equipment Corporation, Maynard + +Permission to use, copy, modify, and distribute this software +and its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that copyright notice and this permission +notice appear in supporting documentation, and that the names of +Hewlett-Packard or Digital not be used in advertising or +publicity pertaining to distribution of the software without specific, +written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/* + +Copyright 1987, 1988, 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/lib/Xt/PassivGraI.h,v 1.3 2001/12/14 19:56:27 dawes Exp $ */ + +#ifndef _PDI_h_ +#define _PDI_h_ + + +#define KEYBOARD TRUE +#define POINTER FALSE + +_XFUNCPROTOBEGIN + +typedef enum { + XtNoServerGrab, + XtPassiveServerGrab, + XtActiveServerGrab, + XtPseudoPassiveServerGrab, + XtPseudoActiveServerGrab +}XtServerGrabType; + +typedef struct _XtServerGrabRec { + struct _XtServerGrabRec *next; + Widget widget; + unsigned int ownerEvents:1; + unsigned int pointerMode:1; + unsigned int keyboardMode:1; + unsigned int hasExt:1; + unsigned int confineToIsWidgetWin:1; + KeyCode keybut; + unsigned short modifiers; + unsigned short eventMask; +} XtServerGrabRec, *XtServerGrabPtr; + +typedef struct _XtGrabExtRec { + Mask *pKeyButMask; + Mask *pModifiersMask; + Window confineTo; + Cursor cursor; +} XtServerGrabExtRec, *XtServerGrabExtPtr; + +#define GRABEXT(p) ((XtServerGrabExtPtr)((p)+1)) + +typedef struct _XtDeviceRec{ + XtServerGrabRec grab; /* need copy in order to protect + during grab */ + XtServerGrabType grabType; +}XtDeviceRec, *XtDevice; + +#define XtMyAncestor 0 +#define XtMyDescendant 1 +#define XtMyCousin 2 +#define XtMySelf 3 +#define XtUnrelated 4 +typedef char XtGeneology; /* do not use an enum makes PerWidgetInput larger */ + +typedef struct { + Widget focusKid; + XtServerGrabPtr keyList, ptrList; + Widget queryEventDescendant; + unsigned int map_handler_added:1; + unsigned int realize_handler_added:1; + unsigned int active_handler_added:1; + unsigned int haveFocus:1; + XtGeneology focalPoint; +}XtPerWidgetInputRec, *XtPerWidgetInput; + +typedef struct XtPerDisplayInputRec{ + XtGrabList grabList; + XtDeviceRec keyboard, pointer; + KeyCode activatingKey; + Widget *trace; + int traceDepth, traceMax; + Widget focusWidget; +}XtPerDisplayInputRec, *XtPerDisplayInput; + +#define IsServerGrab(g) ((g == XtPassiveServerGrab) ||\ + (g == XtActiveServerGrab)) + +#define IsAnyGrab(g) ((g == XtPassiveServerGrab) ||\ + (g == XtActiveServerGrab) ||\ + (g == XtPseudoPassiveServerGrab)) + +#define IsEitherPassiveGrab(g) ((g == XtPassiveServerGrab) ||\ + (g == XtPseudoPassiveServerGrab)) + +#define IsPseudoGrab(g) ((g == XtPseudoPassiveServerGrab)) + +extern void _XtDestroyServerGrabs( + Widget /* w */, + XtPointer /* pwi */, /*XtPerWidgetInput*/ + XtPointer /* call_data */ +); + +extern XtPerWidgetInput _XtGetPerWidgetInput( + Widget /* widget */, + _XtBoolean /* create */ +); + +extern XtServerGrabPtr _XtCheckServerGrabsOnWidget( + XEvent* /* event */, + Widget /* widget */, + _XtBoolean /* isKeyboard */ +); + +/* +extern XtGrabList* _XtGetGrabList( XtPerDisplayInput ); +*/ + +#define _XtGetGrabList(pdi) (&(pdi)->grabList) + +extern void _XtFreePerWidgetInput( + Widget /* w */, + XtPerWidgetInput /* pwi */ +); + +extern Widget _XtProcessKeyboardEvent( + XKeyEvent* /* event */, + Widget /* widget */, + XtPerDisplayInput /* pdi */ +); + +extern Widget _XtProcessPointerEvent( + XButtonEvent* /* event */, + Widget /* widget */, + XtPerDisplayInput /* pdi */ +); + +extern void _XtRegisterPassiveGrabs( + Widget /* widget */ +); + +extern void _XtClearAncestorCache( + Widget /* widget */ +); + +_XFUNCPROTOEND + +#endif /* _PDI_h_ */ diff --git a/X11/RectObj.h b/X11/RectObj.h new file mode 100644 index 000000000..81e43a5e2 --- /dev/null +++ b/X11/RectObj.h @@ -0,0 +1,65 @@ +/* $Xorg: RectObj.h,v 1.4 2001/02/09 02:03:56 xorgcvs Exp $ */ +/* $oHeader: RectObj.h,v 1.2 88/08/18 17:39:17 asente Exp $ */ +/*********************************************************** + +Copyright 1987, 1988, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +#ifndef _XtRect_h +#define _XtRect_h + +_XFUNCPROTOBEGIN + +typedef struct _RectObjRec *RectObj; +typedef struct _RectObjClassRec *RectObjClass; + +#ifndef VMS +externalref WidgetClass rectObjClass; +#endif + +_XFUNCPROTOEND + +#endif /* _XtRect_h */ +/* DON'T ADD STUFF AFTER THIS #endif */ diff --git a/X11/RectObjP.h b/X11/RectObjP.h new file mode 100644 index 000000000..d6ffb7823 --- /dev/null +++ b/X11/RectObjP.h @@ -0,0 +1,133 @@ +/* $Xorg: RectObjP.h,v 1.4 2001/02/09 02:03:56 xorgcvs Exp $ */ +/* $oHeader: RectObjP.h,v 1.2 88/08/18 15:55:52 asente Exp $ */ +/*********************************************************** + +Copyright 1987, 1988, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +#ifndef _Xt_RectObjP_h_ +#define _Xt_RectObjP_h_ + +#include <X11/RectObj.h> +#include <X11/ObjectP.h> + +_XFUNCPROTOBEGIN + +/********************************************************** + * Rectangle Object Instance Data Structures + * + **********************************************************/ +/* these fields match CorePart and can not be changed */ + +typedef struct _RectObjPart { + Position x, y; /* rectangle position */ + Dimension width, height; /* rectangle dimensions */ + Dimension border_width; /* rectangle border width */ + Boolean managed; /* is widget geometry managed? */ + Boolean sensitive; /* is widget sensitive to user events*/ + Boolean ancestor_sensitive; /* are all ancestors sensitive? */ +}RectObjPart; + +typedef struct _RectObjRec { + ObjectPart object; + RectObjPart rectangle; +} RectObjRec; + + + +/******************************************************** + * Rectangle Object Class Data Structures + * + ********************************************************/ +/* these fields match CoreClassPart and can not be changed */ +/* ideally these structures would only contain the fields required; + but because the CoreClassPart cannot be changed at this late date + extraneous fields are necessary to make the field offsets match */ + +typedef struct _RectObjClassPart { + + WidgetClass superclass; /* pointer to superclass ClassRec */ + String class_name; /* widget resource class name */ + Cardinal widget_size; /* size in bytes of widget record */ + XtProc class_initialize; /* class initialization proc */ + XtWidgetClassProc class_part_initialize; /* dynamic initialization */ + XtEnum class_inited; /* has class been initialized? */ + XtInitProc initialize; /* initialize subclass fields */ + XtArgsProc initialize_hook; /* notify that initialize called */ + XtProc rect1; /* NULL */ + XtPointer rect2; /* NULL */ + Cardinal rect3; /* NULL */ + XtResourceList resources; /* resources for subclass fields */ + Cardinal num_resources; /* number of entries in resources */ + XrmClass xrm_class; /* resource class quarkified */ + Boolean rect4; /* NULL */ + XtEnum rect5; /* NULL */ + Boolean rect6; /* NULL */ + Boolean rect7; /* NULL */ + XtWidgetProc destroy; /* free data for subclass pointers */ + XtWidgetProc resize; /* geom manager changed widget size */ + XtExposeProc expose; /* rediplay rectangle */ + XtSetValuesFunc set_values; /* set subclass resource values */ + XtArgsFunc set_values_hook; /* notify that set_values called */ + XtAlmostProc set_values_almost; /* set values almost for geometry */ + XtArgsProc get_values_hook; /* notify that get_values called */ + XtProc rect9; /* NULL */ + XtVersionType version; /* version of intrinsics used */ + XtPointer callback_private; /* list of callback offsets */ + String rect10; /* NULL */ + XtGeometryHandler query_geometry; /* return preferred geometry */ + XtProc rect11; /* NULL */ + XtPointer extension; /* pointer to extension record */ +} RectObjClassPart; + +typedef struct _RectObjClassRec { + RectObjClassPart rect_class; +} RectObjClassRec; + +externalref RectObjClassRec rectObjClassRec; + +_XFUNCPROTOEND + +#endif /*_Xt_RectObjP_h_*/ diff --git a/X11/ResConfigP.h b/X11/ResConfigP.h new file mode 100644 index 000000000..a06cda715 --- /dev/null +++ b/X11/ResConfigP.h @@ -0,0 +1,78 @@ +/* $Xorg: ResConfigP.h,v 1.5 2001/02/09 02:03:56 xorgcvs Exp $ */ +/* + +Copyright 1987, 1988, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/***************************************************************** + +(C) COPYRIGHT International Business Machines Corp. 1992,1997 + 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"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE IBM CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, +BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the IBM Corporation shall +not be used in advertising or otherwise to promote the sale, use or other +dealings in this Software without prior written authorization from the IBM +Corporation. + +******************************************************************/ +/* $XFree86: xc/lib/Xt/ResConfigP.h,v 3.7 2001/12/20 19:40:59 tsi Exp $ */ + +#ifndef _RESCONFIGP_H +#define _RESCONFIGP_H + +#include <X11/Xfuncproto.h> + +_XFUNCPROTOBEGIN + +/* + * Atom names for resource configuration management customization tool. + */ +#define RCM_DATA "Custom Data" +#define RCM_INIT "Custom Init" + +extern void _XtResourceConfigurationEH( + Widget /* w */, + XtPointer /* client_data */, + XEvent * /* event */ +); + +_XFUNCPROTOEND + +#endif diff --git a/X11/ResourceI.h b/X11/ResourceI.h new file mode 100644 index 000000000..3db97f83e --- /dev/null +++ b/X11/ResourceI.h @@ -0,0 +1,103 @@ +/* $Xorg: ResourceI.h,v 1.4 2001/02/09 02:03:56 xorgcvs Exp $ */ + +/*********************************************************** + +Copyright 1987, 1988, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ +/* $XFree86: xc/lib/Xt/ResourceI.h,v 1.5 2001/12/14 19:56:28 dawes Exp $ */ + +/**************************************************************** + * + * Resources + * + ****************************************************************/ + +#ifndef _XtresourceI_h +#define _XtresourceI_h + +#define StringToQuark(string) XrmStringToQuark(string) +#define StringToName(string) XrmStringToName(string) +#define StringToClass(string) XrmStringToClass(string) + +_XFUNCPROTOBEGIN + +extern void _XtDependencies( + XtResourceList * /* class_resp */, + Cardinal * /* class_num_resp */, + XrmResourceList * /* super_res */, + Cardinal /* super_num_res */, + Cardinal /* super_widget_size */); + +extern void _XtResourceDependencies( + WidgetClass /* wc */ +); + +extern void _XtConstraintResDependencies( + ConstraintWidgetClass /* wc */ +); + +extern XtCacheRef* _XtGetResources( + Widget /* w */, + ArgList /* args */, + Cardinal /* num_args */, + XtTypedArgList /* typed_args */, + Cardinal* /* num_typed_args */ +); + +extern void _XtCopyFromParent( + Widget /* widget */, + int /* offset */, + XrmValue* /* value */ +); + +extern void _XtCopyToArg(char *src, XtArgVal *dst, unsigned int size); +extern void _XtCopyFromArg(XtArgVal src, char *dst, unsigned int size); +extern XrmResourceList* _XtCreateIndirectionTable(XtResourceList resources, + Cardinal num_resources); +extern void _XtResourceListInitialize(void); + +_XFUNCPROTOEND + +#endif /* _XtresourceI_h */ diff --git a/X11/SelectionI.h b/X11/SelectionI.h new file mode 100644 index 000000000..e589aece5 --- /dev/null +++ b/X11/SelectionI.h @@ -0,0 +1,170 @@ +/* $Xorg: SelectionI.h,v 1.4 2001/02/09 02:03:58 xorgcvs Exp $ */ + +/*********************************************************** + +Copyright 1987, 1988, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +#ifndef _XtselectionI_h +#define _XtselectionI_h + +#include "Intrinsic.h" + +typedef struct _RequestRec *Request; +typedef struct _SelectRec *Select; + +typedef struct _RequestRec { + Select ctx; /* logical owner */ + Widget widget; /* widget actually receiving Selection events */ + Window requestor; + Atom property; + Atom target; + Atom type; + int format; + XtPointer value; + unsigned long bytelength; + unsigned long offset; + XtIntervalId timeout; + XSelectionRequestEvent event; /* for XtGetSelectionRequest */ + Boolean allSent; +} RequestRec; + +typedef struct { + Atom prop; + Boolean avail; +} SelectionPropRec, *SelectionProp; + +typedef struct { + Display *dpy; + Atom incr_atom, indirect_atom, timestamp_atom; + int propCount; + SelectionProp list; +} PropListRec, *PropList; + +typedef struct _SelectRec { + Atom selection; /* constant */ + Display *dpy; /* constant */ + Widget widget; + Time time; + unsigned long serial; + XtConvertSelectionProc convert; + XtLoseSelectionProc loses; + XtSelectionDoneProc notify; + XtCancelConvertSelectionProc owner_cancel; + XtPointer owner_closure; + PropList prop_list; + Request req; /* state for local non-incr xfer */ + int ref_count; /* of active transfers */ + unsigned int incremental:1; + unsigned int free_when_done:1; + unsigned int was_disowned:1; +} SelectRec; + +typedef struct _ParamRec { + Atom selection; + Atom param; +} ParamRec, *Param; + +typedef struct _ParamInfoRec { + unsigned int count; + Param paramlist; +} ParamInfoRec, *ParamInfo; + +typedef struct _QueuedRequestRec { + Atom selection; + Atom target; + Atom param; + XtSelectionCallbackProc callback; + XtPointer closure; + Time time; + Boolean incremental; +} QueuedRequestRec, *QueuedRequest; + +typedef struct _QueuedRequestInfoRec { + int count; + Atom *selections; + QueuedRequest *requests; +} QueuedRequestInfoRec, *QueuedRequestInfo; + +typedef struct { + XtSelectionCallbackProc *callbacks; + XtPointer *req_closure; + Atom property; + Atom *target; + Atom type; + int format; + char *value; + int bytelength; + int offset; + XtIntervalId timeout; + XtEventHandler proc; + Widget widget; + Time time; + Select ctx; + Boolean *incremental; + int current; +} CallBackInfoRec, *CallBackInfo; + +typedef struct { + Atom target; + Atom property; +} IndirectPair; + +#define IndirectPairWordSize 2 + +typedef struct { + int active_transfer_count; +} RequestWindowRec; + +#define MAX_SELECTION_INCR(dpy) (((65536 < XMaxRequestSize(dpy)) ? \ + (65536 << 2) : (XMaxRequestSize(dpy) << 2))-100) + +#define MATCH_SELECT(event, info) ((event->time == info->time) && \ + (event->requestor == XtWindow(info->widget)) && \ + (event->selection == info->ctx->selection) && \ + (event->target == *info->target)) + +#endif /* _XtselectionI_h */ +/* DON'T ADD STUFF AFTER THIS #endif */ diff --git a/X11/ShellI.h b/X11/ShellI.h new file mode 100644 index 000000000..6a093d791 --- /dev/null +++ b/X11/ShellI.h @@ -0,0 +1,12 @@ +/* $XFree86$ */ + +#ifndef _XtShellInternal_h +#define _XtShellInternal_h + +#include <X11/Xfuncproto.h> + +_XFUNCPROTOBEGIN + +extern void _XtShellGetCoordinates(Widget widget, Position *x, Position *y); + +#endif /* _XtShellInternal_h */ diff --git a/X11/ShellP.h b/X11/ShellP.h new file mode 100644 index 000000000..6d2b44bae --- /dev/null +++ b/X11/ShellP.h @@ -0,0 +1,438 @@ +/* $Xorg: ShellP.h,v 1.4 2001/02/09 02:03:58 xorgcvs Exp $ */ + +/*********************************************************** + +Copyright 1987, 1988, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +/* + * ShellP.h - Private definitions for Shell widget + * + * Author: Paul Asente + * Digital Equipment Corporation + * Western Software Laboratory + * Date: Thu Dec 3, 1987 + */ + +#ifndef _XtShellPrivate_h +#define _XtShellPrivate_h + +#include <X11/Shell.h> + +/* ***** + * ***** VendorP.h is included later on; it needs fields defined in the first + * ***** part of this header file + * ***** + */ + +_XFUNCPROTOBEGIN + +/*********************************************************************** + * + * Shell Widget Private Data + * + ***********************************************************************/ + +/* New fields for the Shell widget class record */ + +typedef struct { + XtPointer extension; /* pointer to extension record */ +} ShellClassPart; + +typedef struct { + XtPointer next_extension; /* 1st 4 mandated for all extension records */ + XrmQuark record_type; /* NULLQUARK; on ShellClassPart */ + long version; /* must be XtShellExtensionVersion */ + Cardinal record_size; /* sizeof(ShellClassExtensionRec) */ + XtGeometryHandler root_geometry_manager; +} ShellClassExtensionRec, *ShellClassExtension; + +#define XtShellExtensionVersion 1L +#define XtInheritRootGeometryManager ((XtGeometryHandler)_XtInherit) + +typedef struct _ShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; +} ShellClassRec; + +externalref ShellClassRec shellClassRec; + +/* New fields for the shell widget */ + +typedef struct { + char *geometry; + XtCreatePopupChildProc create_popup_child_proc; + XtGrabKind grab_kind; + Boolean spring_loaded; + Boolean popped_up; + Boolean allow_shell_resize; + Boolean client_specified; /* re-using old name */ +#define _XtShellPositionValid ((Boolean)(1<<0)) +#define _XtShellNotReparented ((Boolean)(1<<1)) +#define _XtShellPPositionOK ((Boolean)(1<<2)) +#define _XtShellGeometryParsed ((Boolean)(1<<3)) + Boolean save_under; + Boolean override_redirect; + + XtCallbackList popup_callback; + XtCallbackList popdown_callback; + Visual* visual; +} ShellPart; + +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; +} ShellRec, *ShellWidget; + +/*********************************************************************** + * + * OverrideShell Widget Private Data + * + ***********************************************************************/ + +/* New fields for the OverrideShell widget class record */ + +typedef struct { + XtPointer extension; /* pointer to extension record */ +} OverrideShellClassPart; + +typedef struct _OverrideShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; + OverrideShellClassPart override_shell_class; +} OverrideShellClassRec; + +externalref OverrideShellClassRec overrideShellClassRec; + +/* No new fields for the override shell widget */ + +typedef struct {int frabjous;} OverrideShellPart; + +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + OverrideShellPart override; +} OverrideShellRec, *OverrideShellWidget; + +/*********************************************************************** + * + * WMShell Widget Private Data + * + ***********************************************************************/ + +/* New fields for the WMShell widget class record */ + +typedef struct { + XtPointer extension; /* pointer to extension record */ +} WMShellClassPart; + +typedef struct _WMShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; + WMShellClassPart wm_shell_class; +} WMShellClassRec; + +externalref WMShellClassRec wmShellClassRec; + +/* New fields for the WM shell widget */ + +typedef struct { + char *title; + int wm_timeout; + Boolean wait_for_wm; + Boolean transient; + Boolean urgency; + Widget client_leader; + String window_role; + struct _OldXSizeHints { /* pre-R4 Xlib structure */ + long flags; + int x, y; + int width, height; + int min_width, min_height; + int max_width, max_height; + int width_inc, height_inc; + struct { + int x; + int y; + } min_aspect, max_aspect; + } size_hints; + XWMHints wm_hints; + int base_width, base_height; + int win_gravity; + Atom title_encoding; +} WMShellPart; + +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + WMShellPart wm; +} WMShellRec, *WMShellWidget; + +_XFUNCPROTOEND + +#include <X11/VendorP.h> + +_XFUNCPROTOBEGIN + +/*********************************************************************** + * + * TransientShell Widget Private Data + * + ***********************************************************************/ + +/* New fields for the TransientShell widget class record */ + +typedef struct { + XtPointer extension; /* pointer to extension record */ +} TransientShellClassPart; + +typedef struct _TransientShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; + WMShellClassPart wm_shell_class; + VendorShellClassPart vendor_shell_class; + TransientShellClassPart transient_shell_class; +} TransientShellClassRec; + +externalref TransientShellClassRec transientShellClassRec; + +/* New fields for the transient shell widget */ + +typedef struct { + Widget transient_for; +} TransientShellPart; + +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + WMShellPart wm; + VendorShellPart vendor; + TransientShellPart transient; +} TransientShellRec, *TransientShellWidget; + +/*********************************************************************** + * + * TopLevelShell Widget Private Data + * + ***********************************************************************/ + +/* New fields for the TopLevelShell widget class record */ + +typedef struct { + XtPointer extension; /* pointer to extension record */ +} TopLevelShellClassPart; + +typedef struct _TopLevelShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; + WMShellClassPart wm_shell_class; + VendorShellClassPart vendor_shell_class; + TopLevelShellClassPart top_level_shell_class; +} TopLevelShellClassRec; + +externalref TopLevelShellClassRec topLevelShellClassRec; + +/* New fields for the top level shell widget */ + +typedef struct { + char *icon_name; + Boolean iconic; + Atom icon_name_encoding; +} TopLevelShellPart; + +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + WMShellPart wm; + VendorShellPart vendor; + TopLevelShellPart topLevel; +} TopLevelShellRec, *TopLevelShellWidget; + +/*********************************************************************** + * + * ApplicationShell Widget Private Data + * + ***********************************************************************/ + +/* New fields for the ApplicationShell widget class record */ + +typedef struct { + XtPointer extension; /* pointer to extension record */ +} ApplicationShellClassPart; + +typedef struct _ApplicationShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; + WMShellClassPart wm_shell_class; + VendorShellClassPart vendor_shell_class; + TopLevelShellClassPart top_level_shell_class; + ApplicationShellClassPart application_shell_class; +} ApplicationShellClassRec; + +externalref ApplicationShellClassRec applicationShellClassRec; + +/* New fields for the application shell widget */ + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + char *c_class; +#else + char *class; +#endif + XrmClass xrm_class; + int argc; + char **argv; +} ApplicationShellPart; + +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + WMShellPart wm; + VendorShellPart vendor; + TopLevelShellPart topLevel; + ApplicationShellPart application; +} ApplicationShellRec, *ApplicationShellWidget; + +/*********************************************************************** + * + * SessionShell Widget Private Data + * + ***********************************************************************/ + +/* New fields for the SessionShell widget class record */ + +typedef struct { + XtPointer extension; /* pointer to extension record */ +} SessionShellClassPart; + +typedef struct _SessionShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; + WMShellClassPart wm_shell_class; + VendorShellClassPart vendor_shell_class; + TopLevelShellClassPart top_level_shell_class; + ApplicationShellClassPart application_shell_class; + SessionShellClassPart session_shell_class; +} SessionShellClassRec; + +externalref SessionShellClassRec sessionShellClassRec; + +typedef struct _XtSaveYourselfRec *XtSaveYourself; /* implementation-private */ + +/* New fields for the session shell widget */ + +typedef struct { +#ifndef XT_NO_SM + SmcConn connection; +#endif + String session_id; + String* restart_command; + String* clone_command; + String* discard_command; + String* resign_command; + String* shutdown_command; + String* environment; + String current_dir; + String program_path; + unsigned char restart_style; + unsigned char checkpoint_state; + Boolean join_session; + XtCallbackList save_callbacks; + XtCallbackList interact_callbacks; + XtCallbackList cancel_callbacks; + XtCallbackList save_complete_callbacks; + XtCallbackList die_callbacks; + XtCallbackList error_callbacks; + XtSaveYourself save; + XtInputId input_id; + XtPointer ses20; + XtPointer ses19; + XtPointer ses18; + XtPointer ses17; + XtPointer ses16; + XtPointer ses15; + XtPointer ses14; + XtPointer ses13; + XtPointer ses12; + XtPointer ses11; + XtPointer ses10; + XtPointer ses9; + XtPointer ses8; + XtPointer ses7; + XtPointer ses6; + XtPointer ses5; + XtPointer ses4; + XtPointer ses3; + XtPointer ses2; + XtPointer ses1; +} SessionShellPart; + +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + WMShellPart wm; + VendorShellPart vendor; + TopLevelShellPart topLevel; + ApplicationShellPart application; + SessionShellPart session; +} SessionShellRec, *SessionShellWidget; + +_XFUNCPROTOEND + +#endif /* _XtShellPrivate_h */ diff --git a/X11/ThreadsI.h b/X11/ThreadsI.h new file mode 100644 index 000000000..f07fe290f --- /dev/null +++ b/X11/ThreadsI.h @@ -0,0 +1,134 @@ +/* $Xorg: ThreadsI.h,v 1.4 2001/02/09 02:03:59 xorgcvs Exp $ */ + +/************************************************************ +Copyright 1993 by Sun Microsystems, Inc. Mountain View, CA. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this +software and its documentation for any purpose and without +fee is hereby granted, provided that the above copyright no- +tice appear in all copies and that both that copyright no- +tice and this permission notice appear in supporting docu- +mentation, and that the name Sun not be used in advertising +or publicity pertaining to distribution of the software +without specific prior written permission. Sun makes no +representations about the suitability of this software for +any purpose. It is provided "as is" without any express or +implied warranty. + +SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT- +NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI- +ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR +PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH +THE USE OR PERFORMANCE OF THIS SOFTWARE. + +********************************************************/ + +/* + +Copyright 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/lib/Xt/ThreadsI.h,v 3.5 2001/12/14 19:56:31 dawes Exp $ */ + +#ifndef _XtThreadsI_h +#define _XtThreadsI_h + +#include <X11/XlibConf.h> + +#ifdef XTHREADS + +typedef struct _LockRec *LockPtr; + +typedef void (*ThreadAppProc)( + XtAppContext /* app */ +); + +typedef void (*ThreadAppYieldLockProc)( + XtAppContext, /* app */ + Boolean*, /* push_thread */ + Boolean*, /* pushed_thread */ + int* /* level */ +); + +typedef void (*ThreadAppRestoreLockProc)( + XtAppContext /* app */, + int, /* level */ + Boolean* /* pushed_thread */ +); + +_XFUNCPROTOBEGIN + +extern void (*_XtProcessLock)( + void +); + +extern void (*_XtProcessUnlock)( + void +); + +extern void (*_XtInitAppLock)( + XtAppContext /* app */ +); + +_XFUNCPROTOEND + +#define INIT_APP_LOCK(app) if(_XtInitAppLock) (*_XtInitAppLock)(app) +#define FREE_APP_LOCK(app) if(app && app->free_lock)(*app->free_lock)(app) + +#define LOCK_PROCESS if(_XtProcessLock)(*_XtProcessLock)() +#define UNLOCK_PROCESS if(_XtProcessUnlock)(*_XtProcessUnlock)() +#define LOCK_APP(app) if(app && app->lock)(*app->lock)(app) +#define UNLOCK_APP(app) if(app && app->unlock)(*app->unlock)(app) + +#define YIELD_APP_LOCK(app,push,pushed,level)\ + if(app && app->yield_lock) (*app->yield_lock)(app,push,pushed,level) +#define RESTORE_APP_LOCK(app,level,pushed)\ + if(app && app->restore_lock) (*app->restore_lock)(app,level,pushed) + +#define WIDGET_TO_APPCON(w) \ + XtAppContext app = (w && _XtProcessLock ? \ + XtWidgetToApplicationContext(w) : NULL) + +#define DPY_TO_APPCON(d) \ + XtAppContext app = (_XtProcessLock ? XtDisplayToApplicationContext(d): NULL) + +#else /* defined(XTHREADS) */ + +#define LOCK_PROCESS +#define UNLOCK_PROCESS +#define LOCK_APP(app) +#define UNLOCK_APP(app) + +#define INIT_APP_LOCK(app) +#define FREE_APP_LOCK(app) + +#define WIDGET_TO_APPCON(w) +#define DPY_TO_APPCON(d) + +#endif /* !defined(XTHREADS) */ +#endif /* _XtThreadsI_h */ diff --git a/X11/TranslateI.h b/X11/TranslateI.h new file mode 100644 index 000000000..6cc3099cf --- /dev/null +++ b/X11/TranslateI.h @@ -0,0 +1,609 @@ +/* $Xorg: TranslateI.h,v 1.4 2001/02/09 02:03:59 xorgcvs Exp $ */ + +/*********************************************************** + +Copyright 1987, 1988, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ +/* $XFree86: xc/lib/Xt/TranslateI.h,v 1.3 2001/12/14 19:56:32 dawes Exp $ */ + +/* + * TranslateI.h - Header file private to translation management + * + * Author: Gabe Beged-Dov, HP + * + * Former Author: Charles Haynes + * Digital Equipment Corporation + * Western Research Laboratory + * Date: Sat Aug 29 1987 + */ + +/*#define REFCNT_TRANSLATIONS*/ +#define CACHE_TRANSLATIONS + +#define TM_NO_MATCH (-2) + +#define _XtRStateTablePair "_XtStateTablePair" + +typedef unsigned char TMByteCard; +typedef unsigned short TMShortCard; +typedef unsigned long TMLongCard; +typedef short TMShortInt; + +typedef struct _TMTypeMatchRec *TMTypeMatch; +typedef struct _TMModifierMatchRec *TMModifierMatch; +typedef struct _TMEventRec *TMEventPtr; + +typedef Boolean (*MatchProc)(TMTypeMatch typeMatch, + TMModifierMatch modMatch, + TMEventPtr eventSeq); + +typedef struct _ModToKeysymTable { + Modifiers mask; + int count; + int idx; +} ModToKeysymTable; + +typedef struct _LateBindings { + unsigned int knot:1; + unsigned int pair:1; + unsigned short ref_count; /* garbage collection */ + KeySym keysym; +} LateBindings, *LateBindingsPtr; + +typedef short ModifierMask; + +typedef struct _ActionsRec *ActionPtr; +typedef struct _ActionsRec { + int idx; /* index into quarkTable to find proc */ + String *params; /* pointer to array of params */ + Cardinal num_params; /* number of params */ + ActionPtr next; /* next action to perform */ +} ActionRec; + +typedef struct _XtStateRec *StatePtr; +typedef struct _XtStateRec { + unsigned int isCycleStart:1; + unsigned int isCycleEnd:1; + TMShortCard typeIndex; + TMShortCard modIndex; + ActionPtr actions; /* rhs list of actions to perform */ + StatePtr nextLevel; +}StateRec; + + +#define XtTableReplace 0 +#define XtTableAugment 1 +#define XtTableOverride 2 +#define XtTableUnmerge 3 + +typedef unsigned int _XtTranslateOp; + +/* + * New Definitions + */ +typedef struct _TMModifierMatchRec{ + TMLongCard modifiers; + TMLongCard modifierMask; + LateBindingsPtr lateModifiers; + Boolean standard; +}TMModifierMatchRec; + +typedef struct _TMTypeMatchRec{ + TMLongCard eventType; + TMLongCard eventCode; + TMLongCard eventCodeMask; + MatchProc matchEvent; +}TMTypeMatchRec; + +typedef struct _TMBranchHeadRec { + unsigned int isSimple:1; + unsigned int hasActions:1; + unsigned int hasCycles:1; + unsigned int more:13; + TMShortCard typeIndex; + TMShortCard modIndex; +}TMBranchHeadRec, *TMBranchHead; + +/* NOTE: elements of this structure must match those of + * TMComplexStateTreeRec and TMParseStateTreeRec. + */ +typedef struct _TMSimpleStateTreeRec{ + unsigned int isSimple:1; + unsigned int isAccelerator:1; + unsigned int mappingNotifyInterest:1; + unsigned int refCount:13; + TMShortCard numBranchHeads; + TMShortCard numQuarks; /* # of entries in quarkTbl */ + TMShortCard unused; /* to ensure same alignment */ + TMBranchHeadRec *branchHeadTbl; + XrmQuark *quarkTbl; /* table of quarkified rhs*/ +}TMSimpleStateTreeRec, *TMSimpleStateTree; + +/* NOTE: elements of this structure must match those of + * TMSimpleStateTreeRec and TMParseStateTreeRec. + */ +typedef struct _TMComplexStateTreeRec{ + unsigned int isSimple:1; + unsigned int isAccelerator:1; + unsigned int mappingNotifyInterest:1; + unsigned int refCount:13; + TMShortCard numBranchHeads; + TMShortCard numQuarks; /* # of entries in quarkTbl */ + TMShortCard numComplexBranchHeads; + TMBranchHeadRec *branchHeadTbl; + XrmQuark *quarkTbl; /* table of quarkified rhs*/ + StatePtr *complexBranchHeadTbl; +}TMComplexStateTreeRec, *TMComplexStateTree; + +/* NOTE: elements of this structure must match those of + * TMSimpleStateTreeRec and TMComplexStateTreeRec. + */ +typedef struct _TMParseStateTreeRec{ + unsigned int isSimple:1; + unsigned int isAccelerator:1; + unsigned int mappingNotifyInterest:1; + unsigned int isStackQuarks:1; + unsigned int isStackBranchHeads:1; + unsigned int isStackComplexBranchHeads:1; + unsigned int unused:10; /* to ensure correct alignment */ + TMShortCard numBranchHeads; + TMShortCard numQuarks; /* # of entries in quarkTbl */ + TMShortCard numComplexBranchHeads; + TMBranchHeadRec *branchHeadTbl; + XrmQuark *quarkTbl; /* table of quarkified rhs*/ + StatePtr *complexBranchHeadTbl; + TMShortCard branchHeadTblSize; + TMShortCard quarkTblSize; /*total size of quarkTbl */ + TMShortCard complexBranchHeadTblSize; + StatePtr head; +}TMParseStateTreeRec, *TMParseStateTree; + +typedef union _TMStateTreeRec{ + TMSimpleStateTreeRec simple; + TMParseStateTreeRec parse; + TMComplexStateTreeRec complex; +}*TMStateTree, **TMStateTreePtr, **TMStateTreeList; + +typedef struct _TMSimpleBindProcsRec { + XtActionProc *procs; +}TMSimpleBindProcsRec, *TMSimpleBindProcs; + +typedef struct _TMComplexBindProcsRec { + Widget widget; /*widgetID to pass to action Proc*/ + XtTranslations aXlations; + XtActionProc *procs; +}TMComplexBindProcsRec, *TMComplexBindProcs; + +typedef struct _TMSimpleBindDataRec { + unsigned int isComplex:1; /* must be first */ + TMSimpleBindProcsRec bindTbl[1]; /* variable length */ +}TMSimpleBindDataRec, *TMSimpleBindData; + +typedef struct _TMComplexBindDataRec { + unsigned int isComplex:1; /* must be first */ + struct _ATranslationData *accel_context; /* for GetValues */ + TMComplexBindProcsRec bindTbl[1]; /* variable length */ +}TMComplexBindDataRec, *TMComplexBindData; + +typedef union _TMBindDataRec{ + TMSimpleBindDataRec simple; + TMComplexBindDataRec complex; +}*TMBindData; + +typedef struct _TranslationData{ + unsigned char hasBindings; /* must be first */ + unsigned char operation; /*replace,augment,override*/ + TMShortCard numStateTrees; + struct _TranslationData *composers[2]; + EventMask eventMask; + TMStateTree stateTreeTbl[1]; /* variable length */ +}TranslationData; + +/* + * ATranslations is returned by GetValues for translations that contain + * accelerators. The TM can differentiate between this and TranslationData + * (that don't have a bindTbl) by looking at the first field (hasBindings) + * of either structure. All ATranslationData structures associated with a + * widget are chained off the BindData record of the widget. + */ +typedef struct _ATranslationData{ + unsigned char hasBindings; /* must be first */ + unsigned char operation; + struct _TranslationData *xlations; /* actual translations */ + struct _ATranslationData *next; /* chain the contexts together */ + TMComplexBindProcsRec bindTbl[1]; /* accelerator bindings */ +}ATranslationData, *ATranslations; + +typedef struct _TMConvertRec { + XtTranslations old; /* table to merge into */ + XtTranslations new; /* table to merge from */ +} TMConvertRec; + +#define _XtEventTimerEventType ((TMLongCard)~0L) +#define KeysymModMask (1L<<27) /* private to TM */ +#define AnyButtonMask (1L<<28) /* private to TM */ + +typedef struct _EventRec { + TMLongCard modifiers; + TMLongCard modifierMask; + LateBindingsPtr lateModifiers; + TMLongCard eventType; + TMLongCard eventCode; + TMLongCard eventCodeMask; + MatchProc matchEvent; + Boolean standard; +} Event; + +typedef struct _EventSeqRec *EventSeqPtr; +typedef struct _EventSeqRec { + Event event; /* X event description */ + StatePtr state; /* private to state table builder */ + EventSeqPtr next; /* next event on line */ + ActionPtr actions; /* r.h.s. list of actions to perform */ +} EventSeqRec; + +typedef EventSeqRec EventRec; +typedef EventSeqPtr EventPtr; + +typedef struct _TMEventRec { + XEvent *xev; + Event event; +}TMEventRec; + +typedef struct _ActionHookRec { + struct _ActionHookRec* next; /* must remain first */ + XtAppContext app; + XtActionHookProc proc; + XtPointer closure; +} ActionHookRec, *ActionHook; + +/* choose a number between 2 and 8 */ +#define TMKEYCACHELOG2 6 +#define TMKEYCACHESIZE (1<<TMKEYCACHELOG2) + +typedef struct _KeyCacheRec { + unsigned char modifiers_return[256]; /* constant per KeyCode, key proc */ + KeyCode keycode[TMKEYCACHESIZE]; + unsigned char modifiers[TMKEYCACHESIZE]; + KeySym keysym[TMKEYCACHESIZE]; +} TMKeyCache; + +typedef struct _TMKeyContextRec { + XEvent *event; + unsigned long serial; + KeySym keysym; + Modifiers modifiers; + TMKeyCache keycache; /* keep this last, to keep offsets to others small */ +} TMKeyContextRec, *TMKeyContext; + +typedef struct _TMGlobalRec{ + TMTypeMatchRec **typeMatchSegmentTbl; + TMShortCard numTypeMatches; + TMShortCard numTypeMatchSegments; + TMShortCard typeMatchSegmentTblSize; + TMModifierMatchRec **modMatchSegmentTbl; + TMShortCard numModMatches; + TMShortCard numModMatchSegments; + TMShortCard modMatchSegmentTblSize; + Boolean newMatchSemantics; +#ifdef TRACE_TM + XtTranslations *tmTbl; + TMShortCard numTms; + TMShortCard tmTblSize; + struct _TMBindCacheRec **bindCacheTbl; + TMShortCard numBindCache; + TMShortCard bindCacheTblSize; + TMShortCard numLateBindings; + TMShortCard numBranchHeads; + TMShortCard numComplexStates; + TMShortCard numComplexActions; +#endif /* TRACE_TM */ +}TMGlobalRec; + +_XFUNCPROTOBEGIN + +extern TMGlobalRec _XtGlobalTM; + +#define TM_MOD_SEGMENT_SIZE 16 +#define TM_TYPE_SEGMENT_SIZE 16 + +#define TMGetTypeMatch(idx) \ + ((TMTypeMatch) \ + &((_XtGlobalTM.typeMatchSegmentTbl[((idx) >> 4)])[(idx) & 15])) +#define TMGetModifierMatch(idx) \ + ((TMModifierMatch) \ + &((_XtGlobalTM.modMatchSegmentTbl[(idx) >> 4])[(idx) & 15])) + +/* Useful Access Macros */ +#define TMNewMatchSemantics() (_XtGlobalTM.newMatchSemantics) +#define TMBranchMore(branch) (branch->more) +#define TMComplexBranchHead(tree, br) \ + (((TMComplexStateTree)tree)->complexBranchHeadTbl[TMBranchMore(br)]) + +#define TMGetComplexBindEntry(bindData, idx) \ + ((TMComplexBindProcs)&(((TMComplexBindData)bindData)->bindTbl[idx])) + +#define TMGetSimpleBindEntry(bindData, idx) \ + ((TMSimpleBindProcs)&(((TMSimpleBindData)bindData)->bindTbl[idx])) + + +#define _InitializeKeysymTables(dpy, pd) \ + if (pd->keysyms == NULL) \ + _XtBuildKeysymTables(dpy, pd) + +/* + * Internal Functions + */ + +extern void _XtPopup( + Widget /* widget */, + XtGrabKind /* grab_kind */, + _XtBoolean /* spring_loaded */ +); + +extern String _XtPrintXlations( + Widget /* w */, + XtTranslations /* xlations */, + Widget /* accelWidget */, + _XtBoolean /* includeRHS */ +); + +extern void _XtRegisterGrabs( + Widget /* widget */ +); + +extern XtPointer _XtInitializeActionData( + struct _XtActionsRec * /* actions */, + Cardinal /* count */, + _XtBoolean /* inPlace */ +); + +extern void _XtAddEventSeqToStateTree( + EventSeqPtr /* eventSeq */, + TMParseStateTree /* stateTree */ +); + +extern Boolean _XtMatchUsingStandardMods( + TMTypeMatch /* typeMatch */, + TMModifierMatch /* modMatch */, + TMEventPtr /* eventSeq */ +); + +extern Boolean _XtMatchUsingDontCareMods( + TMTypeMatch /* typeMatch */, + TMModifierMatch /* modMatch */, + TMEventPtr /* eventSeq */ +); + +extern Boolean _XtRegularMatch( + TMTypeMatch /* typeMatch */, + TMModifierMatch /* modMatch */, + TMEventPtr /* eventSeq */ +); + +extern Boolean _XtMatchAtom( + TMTypeMatch /* typeMatch */, + TMModifierMatch /* modMatch */, + TMEventPtr /* eventSeq */ +); + +extern void _XtTranslateEvent( + Widget /* widget */, + XEvent* /* event */ +); + +#include "CallbackI.h" +#include "EventI.h" +#include "HookObjI.h" +#include "PassivGraI.h" +#include "ThreadsI.h" +#include "InitialI.h" +#include "ResourceI.h" +#include "StringDefs.h" + +extern void _XtBuildKeysymTables(Display *dpy, XtPerDisplay pd); + +#ifndef NO_MIT_HACKS +extern void _XtDisplayTranslations( + Widget /* widget */, + XEvent* /* event */, + String* /* params */, + Cardinal* /* num_params */ +); + +extern void _XtDisplayAccelerators( + Widget /* widget */, + XEvent* /* event */, + String* /* params */, + Cardinal* /* num_params */ +); + +extern void _XtDisplayInstalledAccelerators( + Widget /* widget */, + XEvent* /* event */, + String* /* params */, + Cardinal* /* num_params */ +); +#endif /* ifndef NO_MIT_HACKS */ + +extern void _XtPopupInitialize( + XtAppContext /* app_context */ +); + +extern void _XtBindActions( + Widget /* widget */, + XtTM /* tm_rec */ +); + +extern Boolean _XtComputeLateBindings( + Display* /* dpy */, + LateBindingsPtr /* lateModifiers */, + Modifiers* /* computed */, + Modifiers* /* computedMask */ +); + +extern XtTranslations _XtCreateXlations( + TMStateTree * /* stateTrees */, + TMShortCard /* numStateTrees */, + XtTranslations /* first */, + XtTranslations /* second */ +); + +extern Boolean _XtCvtMergeTranslations( + Display* /* dpy */, + XrmValuePtr /* args */, + Cardinal* /* num_args */, + XrmValuePtr /* from */, + XrmValuePtr /* to */, + XtPointer* /* closure_ret */ +); + +void _XtRemoveStateTreeByIndex( + XtTranslations /* xlations */, + TMShortCard /* i */); + +void _XtFreeTranslations( + XtAppContext /* app */, + XrmValuePtr /* toVal */, + XtPointer /* closure */, + XrmValuePtr /* args */, + Cardinal* /* num_args */ +); + +extern TMShortCard _XtGetModifierIndex( + Event* /* event */ +); + +extern TMShortCard _XtGetQuarkIndex( + TMParseStateTree /* stateTreePtr */, + XrmQuark /* quark */ +); + +extern XtTranslations _XtGetTranslationValue( + Widget /* widget */ +); + +extern TMShortCard _XtGetTypeIndex( + Event* /* event */ +); + +extern void _XtGrabInitialize( + XtAppContext /* app */ +); + +extern void _XtInstallTranslations( + Widget /* widget */ +); + +extern void _XtRemoveTranslations( + Widget /* widget */ +); + +extern void _XtDestroyTMData( + Widget /* widget */ +); + +extern void _XtMergeTranslations( + Widget /* widget */, + XtTranslations /* newXlations */, + _XtTranslateOp /* operation */ +); + +extern void _XtActionInitialize( + XtAppContext /* app */ +); + +extern TMStateTree _XtParseTreeToStateTree( + TMParseStateTree /* parseTree */ +); + +extern String _XtPrintActions( + ActionRec* /* actions */, + XrmQuark* /* quarkTbl */ +); + +extern String _XtPrintState( + TMStateTree /* stateTree */, + TMBranchHead /* branchHead */); + +extern String _XtPrintEventSeq( + EventSeqPtr /* eventSeq */, + Display* /* dpy */ +); + +typedef Boolean (*_XtTraversalProc)( + StatePtr /* state */, + XtPointer /* data */ +); + +extern void _XtTraverseStateTree( + TMStateTree /* tree */, + _XtTraversalProc /* func */, + XtPointer /* data */ +); + +extern void _XtTranslateInitialize( + void +); + +extern void _XtAddTMConverters( + ConverterTable /* table */ +); + +extern void _XtUnbindActions( + Widget /* widget */, + XtTranslations /* xlations */, + TMBindData /* bindData */ +); + +extern void _XtUnmergeTranslations( + Widget /* widget */, + XtTranslations /* xlations */ +); + +/* TMKey.c */ +extern void _XtAllocTMContext(XtPerDisplay pd); + +_XFUNCPROTOEND diff --git a/X11/VarargsI.h b/X11/VarargsI.h new file mode 100644 index 000000000..76ce9bc7e --- /dev/null +++ b/X11/VarargsI.h @@ -0,0 +1,69 @@ +/* $Xorg: VarargsI.h,v 1.4 2001/02/09 02:03:59 xorgcvs Exp $ */ + +/* + +Copyright 1985, 1986, 1987, 1988, 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/lib/Xt/VarargsI.h,v 3.6 2001/12/14 19:56:32 dawes Exp $ */ + +#ifndef _VarargsI_h_ +#define _VarargsI_h_ + +#include <stdarg.h> + +/* private routines */ + +_XFUNCPROTOBEGIN + +extern void _XtCountVaList( + va_list /*var*/, int* /*total_count*/, int* /*typed_count*/ +); + +extern void _XtVaToArgList( + Widget /*widget*/, va_list /*var*/, int /*max_count*/, ArgList* /*args_return*/, Cardinal* /*num_args_return*/ +); + +extern void _XtVaToTypedArgList( + va_list /*var*/, int /*count*/, XtTypedArgList* /*args_return*/, Cardinal* /*num_args_return*/ +); + +extern XtTypedArgList _XtVaCreateTypedArgList( + va_list /*var*/, int /*count*/ +); + +extern void _XtFreeArgList( + ArgList /*args*/, int /*total_count*/, int /*typed_count*/ +); + +extern void _XtGetApplicationResources( + Widget /*w*/, XtPointer /*base*/, XtResourceList /*resources*/, Cardinal /*num_resources*/, ArgList /*args*/, Cardinal /*num_args*/, XtTypedArgList /*typed_args*/, Cardinal /*num_typed_args*/ +); + +extern void _XtGetSubresources( + Widget /*w*/, XtPointer /*base*/, const char* /*name*/, const char* /*class*/, XtResourceList /*resources*/, Cardinal /*num_resources*/, ArgList /*args*/, Cardinal /*num_args*/, XtTypedArgList /*typed_args*/, Cardinal /*num_typed_args*/ +); + +_XFUNCPROTOEND + +#endif /* _VarargsI_h_ */ diff --git a/X11/Vendor.h b/X11/Vendor.h new file mode 100644 index 000000000..633d17aa1 --- /dev/null +++ b/X11/Vendor.h @@ -0,0 +1,75 @@ +/* +* $Xorg: Vendor.h,v 1.5 2001/02/09 02:03:59 xorgcvs Exp $ +* $oHeader: Vendor.h,v 1.2 88/08/18 15:56:44 asente Exp $ +*/ + +/*********************************************************** + +Copyright 1987, 1988, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +#ifndef _XtVendor_h +#define _XtVendor_h + +#include <X11/Intrinsic.h> + +/*********************************************************************** + * + * VendorShell Widget + * + ***********************************************************************/ + +/* Class record constants */ + +typedef struct _VendorShellClassRec *VendorShellWidgetClass; + +_XFUNCPROTOBEGIN + +externalref WidgetClass vendorShellWidgetClass; + +_XFUNCPROTOEND + +#endif /* _XtVendor_h */ +/* DON'T ADD STUFF AFTER THIS #endif */ diff --git a/X11/VendorP.h b/X11/VendorP.h new file mode 100644 index 000000000..e60857d9e --- /dev/null +++ b/X11/VendorP.h @@ -0,0 +1,107 @@ +/* +* $Xorg: VendorP.h,v 1.4 2001/02/09 02:03:59 xorgcvs Exp $ +* $oHeader: VendorP.h,v 1.2 88/08/18 15:56:48 asente Exp $ +*/ + +/*********************************************************** + +Copyright 1987, 1988, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +/* + * VendorP.h - Private definitions for VendorShell widget + * + * Author: Paul Asente + * Digital Equipment Corporation + * Western Software Laboratory + * Date: Thu Dec 3, 1987 + */ + +/*********************************************************************** + * + * VendorShell Widget Private Data + * + ***********************************************************************/ + +#ifndef _XtVendorPrivate_h +#define _XtVendorPrivate_h + +#include <X11/Vendor.h> + +/* New fields for the VendorShell widget class record */ + +_XFUNCPROTOBEGIN + +typedef struct { + XtPointer extension; /* pointer to extension record */ +} VendorShellClassPart; + +typedef struct _VendorShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; + WMShellClassPart wm_shell_class; + VendorShellClassPart vendor_shell_class; +} VendorShellClassRec; + +externalref VendorShellClassRec vendorShellClassRec; + +/* New fields for the vendor shell widget. */ + +typedef struct { + int vendor_specific; +} VendorShellPart; + +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + WMShellPart wm; + VendorShellPart vendor; +} VendorShellRec, *VendorShellWidget; + +_XFUNCPROTOEND + +#endif /* _XtVendorPrivate_h */ diff --git a/X11/XKBlib.h b/X11/XKBlib.h new file mode 100644 index 000000000..019727525 --- /dev/null +++ b/X11/XKBlib.h @@ -0,0 +1,1151 @@ +/* $Xorg: XKBlib.h,v 1.6 2000/08/17 19:45:03 cpqbld Exp $ */ +/************************************************************ +Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. + +Permission to use, copy, modify, and distribute this +software and its documentation for any purpose and without +fee is hereby granted, provided that the above copyright +notice appear in all copies and that both that copyright +notice and this permission notice appear in supporting +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution +of the software without specific prior written permission. +Silicon Graphics makes no representation about the suitability +of this software for any purpose. It is provided "as is" +without any express or implied warranty. + +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON +GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL +DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH +THE USE OR PERFORMANCE OF THIS SOFTWARE. + +********************************************************/ +/* $XFree86: xc/lib/X11/XKBlib.h,v 3.5 2003/04/17 02:06:31 dawes Exp $ */ + +#ifndef _XKBLIB_H_ +#define _XKBLIB_H_ + +#include <X11/Xlib.h> +#include <X11/extensions/XKBstr.h> + +typedef struct _XkbAnyEvent { + int type; /* XkbAnyEvent */ + unsigned long serial; /* # of last req processed by server */ + Bool send_event; /* is this from a SendEvent request? */ + Display * display; /* Display the event was read from */ + Time time; /* milliseconds */ + int xkb_type; /* XKB event minor code */ + unsigned int device; /* device ID */ +} XkbAnyEvent; + +typedef struct _XkbNewKeyboardNotify { + int type; /* XkbAnyEvent */ + unsigned long serial; /* of last req processed by server */ + Bool send_event; /* is this from a SendEvent request? */ + Display * display; /* Display the event was read from */ + Time time; /* milliseconds */ + int xkb_type; /* XkbNewKeyboardNotify */ + int device; /* device ID */ + int old_device; /* device ID of previous keyboard */ + int min_key_code; /* minimum key code */ + int max_key_code; /* maximum key code */ + int old_min_key_code;/* min key code of previous kbd */ + int old_max_key_code;/* max key code of previous kbd */ + unsigned int changed; /* changed aspects of the keyboard */ + char req_major; /* major and minor opcode of req */ + char req_minor; /* that caused change, if applicable */ +} XkbNewKeyboardNotifyEvent; + +typedef struct _XkbMapNotifyEvent { + int type; /* XkbAnyEvent */ + unsigned long serial; /* of last req processed by server */ + Bool send_event; /* is this from a SendEvent request */ + Display * display; /* Display the event was read from */ + Time time; /* milliseconds */ + int xkb_type; /* XkbMapNotify */ + int device; /* device ID */ + unsigned int changed; /* fields which have been changed */ + unsigned int flags; /* reserved */ + int first_type; /* first changed key type */ + int num_types; /* number of changed key types */ + KeyCode min_key_code; + KeyCode max_key_code; + KeyCode first_key_sym; + KeyCode first_key_act; + KeyCode first_key_behavior; + KeyCode first_key_explicit; + KeyCode first_modmap_key; + KeyCode first_vmodmap_key; + int num_key_syms; + int num_key_acts; + int num_key_behaviors; + int num_key_explicit; + int num_modmap_keys; + int num_vmodmap_keys; + unsigned int vmods; /* mask of changed virtual mods */ +} XkbMapNotifyEvent; + +typedef struct _XkbStateNotifyEvent { + int type; /* XkbAnyEvent */ + unsigned long serial; /* # of last req processed by server */ + Bool send_event; /* is this from a SendEvent request? */ + Display * display; /* Display the event was read from */ + Time time; /* milliseconds */ + int xkb_type; /* XkbStateNotify */ + int device; /* device ID */ + unsigned int changed; /* mask of changed state components */ + int group; /* keyboard group */ + int base_group; /* base keyboard group */ + int latched_group; /* latched keyboard group */ + int locked_group; /* locked keyboard group */ + unsigned int mods; /* modifier state */ + unsigned int base_mods; /* base modifier state */ + unsigned int latched_mods; /* latched modifiers */ + unsigned int locked_mods; /* locked modifiers */ + int compat_state; /* compatibility state */ + unsigned char grab_mods; /* mods used for grabs */ + unsigned char compat_grab_mods;/* grab mods for non-XKB clients */ + unsigned char lookup_mods; /* mods sent to clients */ + unsigned char compat_lookup_mods; /* mods sent to non-XKB clients */ + int ptr_buttons; /* pointer button state */ + KeyCode keycode; /* keycode that caused the change */ + char event_type; /* KeyPress or KeyRelease */ + char req_major; /* Major opcode of request */ + char req_minor; /* Minor opcode of request */ +} XkbStateNotifyEvent; + +typedef struct _XkbControlsNotify { + int type; /* XkbAnyEvent */ + unsigned long serial; /* of last req processed by server */ + Bool send_event; /* is this from a SendEvent request? */ + Display * display; /* Display the event was read from */ + Time time; /* milliseconds */ + int xkb_type; /* XkbControlsNotify */ + int device; /* device ID */ + unsigned int changed_ctrls; /* controls with changed sub-values */ + unsigned int enabled_ctrls; /* controls currently enabled */ + unsigned int enabled_ctrl_changes;/* controls just {en,dis}abled */ + int num_groups; /* total groups on keyboard */ + KeyCode keycode; /* key that caused change or 0 */ + char event_type; /* type of event that caused change */ + char req_major; /* if keycode==0, major and minor */ + char req_minor; /* opcode of req that caused change */ +} XkbControlsNotifyEvent; + +typedef struct _XkbIndicatorNotify { + int type; /* XkbAnyEvent */ + unsigned long serial; /* of last req processed by server */ + Bool send_event; /* is this from a SendEvent request? */ + Display * display; /* Display the event was read from */ + Time time; /* milliseconds */ + int xkb_type; /* XkbIndicatorNotify */ + int device; /* device ID */ + unsigned int changed; /* indicators with new state or map */ + unsigned int state; /* current state of all indicators */ +} XkbIndicatorNotifyEvent; + +typedef struct _XkbNamesNotify { + int type; /* XkbAnyEvent */ + unsigned long serial; /* of last req processed by server */ + Bool send_event; /* is this from a SendEvent request? */ + Display * display; /* Display the event was read from */ + Time time; /* milliseconds */ + int xkb_type; /* XkbNamesNotify */ + int device; /* device ID */ + unsigned int changed; /* names that have changed */ + int first_type; /* first key type with new name */ + int num_types; /* number of key types with new names */ + int first_lvl; /* first key type new new level names */ + int num_lvls; /* # of key types w/new level names */ + int num_aliases; /* total number of key aliases*/ + int num_radio_groups;/* total number of radio groups */ + unsigned int changed_vmods; /* virtual modifiers with new names */ + unsigned int changed_groups; /* groups with new names */ + unsigned int changed_indicators;/* indicators with new names */ + int first_key; /* first key with new name */ + int num_keys; /* number of keys with new names */ +} XkbNamesNotifyEvent; + +typedef struct _XkbCompatMapNotify { + int type; /* XkbAnyEvent */ + unsigned long serial; /* of last req processed by server */ + Bool send_event; /* is this from a SendEvent request? */ + Display * display; /* Display the event was read from */ + Time time; /* milliseconds */ + int xkb_type; /* XkbCompatMapNotify */ + int device; /* device ID */ + unsigned int changed_groups; /* groups with new compat maps */ + int first_si; /* first new symbol interp */ + int num_si; /* number of new symbol interps */ + int num_total_si; /* total # of symbol interps */ +} XkbCompatMapNotifyEvent; + +typedef struct _XkbBellNotify { + int type; /* XkbAnyEvent */ + unsigned long serial; /* of last req processed by server */ + Bool send_event; /* is this from a SendEvent request? */ + Display * display; /* Display the event was read from */ + Time time; /* milliseconds */ + int xkb_type; /* XkbBellNotify */ + int device; /* device ID */ + int percent; /* requested volume as a % of maximum */ + int pitch; /* requested pitch in Hz */ + int duration; /* requested duration in useconds */ + int bell_class; /* (input extension) feedback class */ + int bell_id; /* (input extension) ID of feedback */ + Atom name; /* "name" of requested bell */ + Window window; /* window associated with event */ + Bool event_only; /* "event only" requested */ +} XkbBellNotifyEvent; + +typedef struct _XkbActionMessage { + int type; /* XkbAnyEvent */ + unsigned long serial; /* of last req processed by server */ + Bool send_event; /* is this from a SendEvent request? */ + Display * display; /* Display the event was read from */ + Time time; /* milliseconds */ + int xkb_type; /* XkbActionMessage */ + int device; /* device ID */ + KeyCode keycode; /* key that generated the event */ + Bool press; /* true if act caused by key press */ + Bool key_event_follows;/* true if key event also generated */ + int group; /* effective group */ + unsigned int mods; /* effective mods */ + char message[XkbActionMessageLength+1]; + /* message -- leave space for NUL */ +} XkbActionMessageEvent; + +typedef struct _XkbAccessXNotify { + int type; /* XkbAnyEvent */ + unsigned long serial; /* of last req processed by server */ + Bool send_event; /* is this from a SendEvent request? */ + Display * display; /* Display the event was read from */ + Time time; /* milliseconds */ + int xkb_type; /* XkbAccessXNotify */ + int device; /* device ID */ + int detail; /* XkbAXN_* */ + int keycode; /* key of event */ + int sk_delay; /* current slow keys delay */ + int debounce_delay; /* current debounce delay */ +} XkbAccessXNotifyEvent; + +typedef struct _XkbExtensionDeviceNotify { + int type; /* XkbAnyEvent */ + unsigned long serial; /* of last req processed by server */ + Bool send_event; /* is this from a SendEvent request? */ + Display * display; /* Display the event was read from */ + Time time; /* milliseconds */ + int xkb_type; /* XkbExtensionDeviceNotify */ + int device; /* device ID */ + unsigned int reason; /* reason for the event */ + unsigned int supported; /* mask of supported features */ + unsigned int unsupported; /* mask of unsupported features */ + /* that some app tried to use */ + int first_btn; /* first button that changed */ + int num_btns; /* range of buttons changed */ + unsigned int leds_defined; /* indicators with names or maps */ + unsigned int led_state; /* current state of the indicators */ + int led_class; /* feedback class for led changes */ + int led_id; /* feedback id for led changes */ +} XkbExtensionDeviceNotifyEvent; + +typedef union _XkbEvent { + int type; + XkbAnyEvent any; + XkbNewKeyboardNotifyEvent new_kbd; + XkbMapNotifyEvent map; + XkbStateNotifyEvent state; + XkbControlsNotifyEvent ctrls; + XkbIndicatorNotifyEvent indicators; + XkbNamesNotifyEvent names; + XkbCompatMapNotifyEvent compat; + XkbBellNotifyEvent bell; + XkbActionMessageEvent message; + XkbAccessXNotifyEvent accessx; + XkbExtensionDeviceNotifyEvent device; + XEvent core; +} XkbEvent; + +typedef struct _XkbKbdDpyState XkbKbdDpyStateRec,*XkbKbdDpyStatePtr; + + /* XkbOpenDisplay error codes */ +#define XkbOD_Success 0 +#define XkbOD_BadLibraryVersion 1 +#define XkbOD_ConnectionRefused 2 +#define XkbOD_NonXkbServer 3 +#define XkbOD_BadServerVersion 4 + + /* Values for XlibFlags */ +#define XkbLC_ForceLatin1Lookup (1<<0) +#define XkbLC_ConsumeLookupMods (1<<1) +#define XkbLC_AlwaysConsumeShiftAndLock (1<<2) +#define XkbLC_IgnoreNewKeyboards (1<<3) +#define XkbLC_ControlFallback (1<<4) +#define XkbLC_ConsumeKeysOnComposeFail (1<<29) +#define XkbLC_ComposeLED (1<<30) +#define XkbLC_BeepOnComposeFail (1<<31) + +#define XkbLC_AllComposeControls (0xc0000000) +#define XkbLC_AllControls (0xc000001f) + +_XFUNCPROTOBEGIN + +extern Bool XkbIgnoreExtension( + Bool /* ignore */ +); + +extern Display *XkbOpenDisplay( + char * /* name */, + int * /* ev_rtrn */, + int * /* err_rtrn */, + int * /* major_rtrn */, + int * /* minor_rtrn */, + int * /* reason */ +); + +extern Bool XkbQueryExtension( + Display * /* dpy */, + int * /* opcodeReturn */, + int * /* eventBaseReturn */, + int * /* errorBaseReturn */, + int * /* majorRtrn */, + int * /* minorRtrn */ +); + +extern Bool XkbUseExtension( + Display * /* dpy */, + int * /* major_rtrn */, + int * /* minor_rtrn */ +); + +extern Bool XkbLibraryVersion( + int * /* libMajorRtrn */, + int * /* libMinorRtrn */ +); + +extern unsigned int XkbSetXlibControls( + Display* /* dpy */, + unsigned int /* affect */, + unsigned int /* values */ +); + +extern unsigned int XkbGetXlibControls( + Display* /* dpy */ +); + +extern unsigned int XkbXlibControlsImplemented(void); + +typedef Atom (*XkbInternAtomFunc)( + Display * /* dpy */, + _Xconst char * /* name */, + Bool /* only_if_exists */ +); + +typedef char * (*XkbGetAtomNameFunc)( + Display * /* dpy */, + Atom /* atom */ +); + +extern void XkbSetAtomFuncs( + XkbInternAtomFunc /* getAtom */, + XkbGetAtomNameFunc /* getName */ +); + +extern KeySym XkbKeycodeToKeysym( + Display * /* dpy */, +#if NeedWidePrototypes + unsigned int /* kc */, +#else + KeyCode /* kc */, +#endif + int /* group */, + int /* level */ +); + +extern unsigned int XkbKeysymToModifiers( + Display * /* dpy */, + KeySym /* ks */ +); + +extern Bool XkbLookupKeySym( + Display * /* dpy */, + KeyCode /* keycode */, + unsigned int /* modifiers */, + unsigned int * /* modifiers_return */, + KeySym * /* keysym_return */ +); + +extern int XkbLookupKeyBinding( + Display * /* dpy */, + KeySym /* sym_rtrn */, + unsigned int /* mods */, + char * /* buffer */, + int /* nbytes */, + int * /* extra_rtrn */ +); + +extern Bool XkbTranslateKeyCode( + XkbDescPtr /* xkb */, + KeyCode /* keycode */, + unsigned int /* modifiers */, + unsigned int * /* modifiers_return */, + KeySym * /* keysym_return */ +); + +extern int XkbTranslateKeySym( + Display * /* dpy */, + register KeySym * /* sym_return */, + unsigned int /* modifiers */, + char * /* buffer */, + int /* nbytes */, + int * /* extra_rtrn */ +); + +extern Bool XkbSetAutoRepeatRate( + Display * /* dpy */, + unsigned int /* deviceSpec */, + unsigned int /* delay */, + unsigned int /* interval */ +); + +extern Bool XkbGetAutoRepeatRate( + Display * /* dpy */, + unsigned int /* deviceSpec */, + unsigned int * /* delayRtrn */, + unsigned int * /* intervalRtrn */ +); + +extern Bool XkbChangeEnabledControls( + Display * /* dpy */, + unsigned int /* deviceSpec */, + unsigned int /* affect */, + unsigned int /* values */ +); + +extern Bool XkbDeviceBell( + Display * /* dpy */, + Window /* win */, + int /* deviceSpec */, + int /* bellClass */, + int /* bellID */, + int /* percent */, + Atom /* name */ +); + +extern Bool XkbForceDeviceBell( + Display * /* dpy */, + int /* deviceSpec */, + int /* bellClass */, + int /* bellID */, + int /* percent */ +); + +extern Bool XkbDeviceBellEvent( + Display * /* dpy */, + Window /* win */, + int /* deviceSpec */, + int /* bellClass */, + int /* bellID */, + int /* percent */, + Atom /* name */ +); + +extern Bool XkbBell( + Display * /* dpy */, + Window /* win */, + int /* percent */, + Atom /* name */ +); + +extern Bool XkbForceBell( + Display * /* dpy */, + int /* percent */ +); + +extern Bool XkbBellEvent( + Display * /* dpy */, + Window /* win */, + int /* percent */, + Atom /* name */ +); + +extern Bool XkbSelectEvents( + Display * /* dpy */, + unsigned int /* deviceID */, + unsigned int /* affect */, + unsigned int /* values */ +); + +extern Bool XkbSelectEventDetails( + Display * /* dpy */, + unsigned int /* deviceID */, + unsigned int /* eventType */, + unsigned long /* affect */, + unsigned long /* details */ +); + +extern void XkbNoteMapChanges( + XkbMapChangesPtr /* old */, + XkbMapNotifyEvent * /* new */, + unsigned int /* wanted */ +); + +extern void XkbNoteNameChanges( + XkbNameChangesPtr /* old */, + XkbNamesNotifyEvent * /* new */, + unsigned int /* wanted */ +); + +extern Status XkbGetIndicatorState( + Display * /* dpy */, + unsigned int /* deviceSpec */, + unsigned int * /* pStateRtrn */ +); + +extern Status XkbGetDeviceIndicatorState( + Display * /* dpy */, + unsigned int /* deviceSpec */, + unsigned int /* ledClass */, + unsigned int /* ledID */, + unsigned int * /* pStateRtrn */ +); + +extern Status XkbGetIndicatorMap( + Display * /* dpy */, + unsigned long /* which */, + XkbDescPtr /* desc */ +); + +extern Bool XkbSetIndicatorMap( + Display * /* dpy */, + unsigned long /* which */, + XkbDescPtr /* desc */ +); + +#define XkbNoteIndicatorMapChanges(o,n,w) \ + ((o)->map_changes|=((n)->map_changes&(w))) +#define XkbNoteIndicatorStateChanges(o,n,w)\ + ((o)->state_changes|=((n)->state_changes&(w))) +#define XkbGetIndicatorMapChanges(d,x,c) \ + (XkbGetIndicatorMap((d),(c)->map_changes,x)) +#define XkbChangeIndicatorMaps(d,x,c) \ + (XkbSetIndicatorMap((d),(c)->map_changes,x)) + +extern Bool XkbGetNamedIndicator( + Display * /* dpy */, + Atom /* name */, + int * /* pNdxRtrn */, + Bool * /* pStateRtrn */, + XkbIndicatorMapPtr /* pMapRtrn */, + Bool * /* pRealRtrn */ +); + +extern Bool XkbGetNamedDeviceIndicator( + Display * /* dpy */, + unsigned int /* deviceSpec */, + unsigned int /* ledClass */, + unsigned int /* ledID */, + Atom /* name */, + int * /* pNdxRtrn */, + Bool * /* pStateRtrn */, + XkbIndicatorMapPtr /* pMapRtrn */, + Bool * /* pRealRtrn */ +); + +extern Bool XkbSetNamedIndicator( + Display * /* dpy */, + Atom /* name */, + Bool /* changeState */, + Bool /* state */, + Bool /* createNewMap */, + XkbIndicatorMapPtr /* pMap */ +); + +extern Bool XkbSetNamedDeviceIndicator( + Display * /* dpy */, + unsigned int /* deviceSpec */, + unsigned int /* ledClass */, + unsigned int /* ledID */, + Atom /* name */, + Bool /* changeState */, + Bool /* state */, + Bool /* createNewMap */, + XkbIndicatorMapPtr /* pMap */ +); + +extern Bool XkbLockModifiers( + Display * /* dpy */, + unsigned int /* deviceSpec */, + unsigned int /* affect */, + unsigned int /* values */ +); + +extern Bool XkbLatchModifiers( + Display * /* dpy */, + unsigned int /* deviceSpec */, + unsigned int /* affect */, + unsigned int /* values */ +); + +extern Bool XkbLockGroup( + Display * /* dpy */, + unsigned int /* deviceSpec */, + unsigned int /* group */ +); + +extern Bool XkbLatchGroup( + Display * /* dpy */, + unsigned int /* deviceSpec */, + unsigned int /* group */ +); + +extern Bool XkbSetServerInternalMods( + Display * /* dpy */, + unsigned int /* deviceSpec */, + unsigned int /* affectReal */, + unsigned int /* realValues */, + unsigned int /* affectVirtual */, + unsigned int /* virtualValues */ +); + +extern Bool XkbSetIgnoreLockMods( + Display * /* dpy */, + unsigned int /* deviceSpec */, + unsigned int /* affectReal */, + unsigned int /* realValues */, + unsigned int /* affectVirtual */, + unsigned int /* virtualValues */ +); + + +extern Bool XkbVirtualModsToReal( + XkbDescPtr /* xkb */, + unsigned int /* virtual_mask */, + unsigned int * /* mask_rtrn */ +); + +extern Bool XkbComputeEffectiveMap( + XkbDescPtr /* xkb */, + XkbKeyTypePtr /* type */, + unsigned char * /* map_rtrn */ +); + +extern Status XkbInitCanonicalKeyTypes( + XkbDescPtr /* xkb */, + unsigned int /* which */, + int /* keypadVMod */ +); + +extern XkbDescPtr XkbAllocKeyboard( + void +); + +extern void XkbFreeKeyboard( + XkbDescPtr /* xkb */, + unsigned int /* which */, + Bool /* freeDesc */ +); + +extern Status XkbAllocClientMap( + XkbDescPtr /* xkb */, + unsigned int /* which */, + unsigned int /* nTypes */ +); + +extern Status XkbAllocServerMap( + XkbDescPtr /* xkb */, + unsigned int /* which */, + unsigned int /* nActions */ +); + +extern void XkbFreeClientMap( + XkbDescPtr /* xkb */, + unsigned int /* what */, + Bool /* freeMap */ +); + +extern void XkbFreeServerMap( + XkbDescPtr /* xkb */, + unsigned int /* what */, + Bool /* freeMap */ +); + +extern XkbKeyTypePtr XkbAddKeyType( + XkbDescPtr /* xkb */, + Atom /* name */, + int /* map_count */, + Bool /* want_preserve */, + int /* num_lvls */ +); + +extern Status XkbAllocIndicatorMaps( + XkbDescPtr /* xkb */ +); + +extern void XkbFreeIndicatorMaps( + XkbDescPtr /* xkb */ +); + +extern XkbDescPtr XkbGetMap( + Display * /* dpy */, + unsigned int /* which */, + unsigned int /* deviceSpec */ +); + +extern Status XkbGetUpdatedMap( + Display * /* dpy */, + unsigned int /* which */, + XkbDescPtr /* desc */ +); + +extern Status XkbGetMapChanges( + Display * /* dpy */, + XkbDescPtr /* xkb */, + XkbMapChangesPtr /* changes */ +); + + +extern Status XkbRefreshKeyboardMapping( + XkbMapNotifyEvent * /* event */ +); + +extern Status XkbGetKeyTypes( + Display * /* dpy */, + unsigned int /* first */, + unsigned int /* num */, + XkbDescPtr /* xkb */ +); + +extern Status XkbGetKeySyms( + Display * /* dpy */, + unsigned int /* first */, + unsigned int /* num */, + XkbDescPtr /* xkb */ +); + +extern Status XkbGetKeyActions( + Display * /* dpy */, + unsigned int /* first */, + unsigned int /* num */, + XkbDescPtr /* xkb */ +); + +extern Status XkbGetKeyBehaviors( + Display * /* dpy */, + unsigned int /* firstKey */, + unsigned int /* nKeys */, + XkbDescPtr /* desc */ +); + +extern Status XkbGetVirtualMods( + Display * /* dpy */, + unsigned int /* which */, + XkbDescPtr /* desc */ +); + +extern Status XkbGetKeyExplicitComponents( + Display * /* dpy */, + unsigned int /* firstKey */, + unsigned int /* nKeys */, + XkbDescPtr /* desc */ +); + +extern Status XkbGetKeyModifierMap( + Display * /* dpy */, + unsigned int /* firstKey */, + unsigned int /* nKeys */, + XkbDescPtr /* desc */ +); + +extern Status XkbGetKeyVirtualModMap( + Display * /* dpy */, + unsigned int /* first */, + unsigned int /* num */, + XkbDescPtr /* xkb */ +); + +extern Status XkbAllocControls( + XkbDescPtr /* xkb */, + unsigned int /* which*/ +); + +extern void XkbFreeControls( + XkbDescPtr /* xkb */, + unsigned int /* which */, + Bool /* freeMap */ +); + +extern Status XkbGetControls( + Display * /* dpy */, + unsigned long /* which */, + XkbDescPtr /* desc */ +); + +extern Bool XkbSetControls( + Display * /* dpy */, + unsigned long /* which */, + XkbDescPtr /* desc */ +); + +extern void XkbNoteControlsChanges( + XkbControlsChangesPtr /* old */, + XkbControlsNotifyEvent * /* new */, + unsigned int /* wanted */ +); + +#define XkbGetControlsChanges(d,x,c) XkbGetControls(d,(c)->changed_ctrls,x) +#define XkbChangeControls(d,x,c) XkbSetControls(d,(c)->changed_ctrls,x) + +extern Status XkbAllocCompatMap( + XkbDescPtr /* xkb */, + unsigned int /* which */, + unsigned int /* nInterpret */ +); + +extern void XkbFreeCompatMap( + XkbDescPtr /* xkb */, + unsigned int /* which */, + Bool /* freeMap */ +); + +extern Status XkbGetCompatMap( + Display * /* dpy */, + unsigned int /* which */, + XkbDescPtr /* xkb */ +); + +extern Bool XkbSetCompatMap( + Display * /* dpy */, + unsigned int /* which */, + XkbDescPtr /* xkb */, + Bool /* updateActions */ +); + +extern XkbSymInterpretPtr XkbAddSymInterpret( + XkbDescPtr /* xkb */, + XkbSymInterpretPtr /* si */, + Bool /* updateMap */, + XkbChangesPtr /* changes */ +); + +extern Status XkbAllocNames( + XkbDescPtr /* xkb */, + unsigned int /* which */, + int /* nTotalRG */, + int /* nTotalAliases */ +); + +extern Status XkbGetNames( + Display * /* dpy */, + unsigned int /* which */, + XkbDescPtr /* desc */ +); + +extern Bool XkbSetNames( + Display * /* dpy */, + unsigned int /* which */, + unsigned int /* firstType */, + unsigned int /* nTypes */, + XkbDescPtr /* desc */ +); + +extern Bool XkbChangeNames( + Display * /* dpy */, + XkbDescPtr /* xkb */, + XkbNameChangesPtr /* changes */ +); + +extern void XkbFreeNames( + XkbDescPtr /* xkb */, + unsigned int /* which */, + Bool /* freeMap */ +); + + +extern Status XkbGetState( + Display * /* dpy */, + unsigned int /* deviceSpec */, + XkbStatePtr /* rtrnState */ +); + +extern Bool XkbSetMap( + Display * /* dpy */, + unsigned int /* which */, + XkbDescPtr /* desc */ +); + +extern Bool XkbChangeMap( + Display* /* dpy */, + XkbDescPtr /* desc */, + XkbMapChangesPtr /* changes */ +); + +extern Bool XkbSetDetectableAutoRepeat( + Display * /* dpy */, + Bool /* detectable */, + Bool * /* supported */ +); + +extern Bool XkbGetDetectableAutoRepeat( + Display * /* dpy */, + Bool * /* supported */ +); + +extern Bool XkbSetAutoResetControls( + Display * /* dpy */, + unsigned int /* changes */, + unsigned int * /* auto_ctrls */, + unsigned int * /* auto_values */ +); + +extern Bool XkbGetAutoResetControls( + Display * /* dpy */, + unsigned int * /* auto_ctrls */, + unsigned int * /* auto_ctrl_values */ +); + +extern Bool XkbSetPerClientControls( + Display * /* dpy */, + unsigned int /* change */, + unsigned int * /* values */ +); + +extern Bool XkbGetPerClientControls( + Display * /* dpy */, + unsigned int * /* ctrls */ +); + +extern Status XkbCopyKeyType( + XkbKeyTypePtr /* from */, + XkbKeyTypePtr /* into */ +); + +extern Status XkbCopyKeyTypes( + XkbKeyTypePtr /* from */, + XkbKeyTypePtr /* into */, + int /* num_types */ +); + +extern Status XkbResizeKeyType( + XkbDescPtr /* xkb */, + int /* type_ndx */, + int /* map_count */, + Bool /* want_preserve */, + int /* new_num_lvls */ +); + +extern KeySym *XkbResizeKeySyms( + XkbDescPtr /* desc */, + int /* forKey */, + int /* symsNeeded */ +); + +extern XkbAction *XkbResizeKeyActions( + XkbDescPtr /* desc */, + int /* forKey */, + int /* actsNeeded */ +); + +extern Status XkbChangeTypesOfKey( + XkbDescPtr /* xkb */, + int /* key */, + int /* num_groups */, + unsigned int /* groups */, + int * /* newTypes */, + XkbMapChangesPtr /* pChanges */ +); + +extern Status XkbChangeKeycodeRange( + XkbDescPtr /* xkb */, + int /* minKC */, + int /* maxKC */, + XkbChangesPtr /* changes */ +); + +/***====================================================================***/ + +extern XkbComponentListPtr XkbListComponents( + Display * /* dpy */, + unsigned int /* deviceSpec */, + XkbComponentNamesPtr /* ptrns */, + int * /* max_inout */ +); + +extern void XkbFreeComponentList( + XkbComponentListPtr /* list */ +); + +extern XkbDescPtr XkbGetKeyboard( + Display * /* dpy */, + unsigned int /* which */, + unsigned int /* deviceSpec */ +); + +extern XkbDescPtr XkbGetKeyboardByName( + Display * /* dpy */, + unsigned int /* deviceSpec */, + XkbComponentNamesPtr /* names */, + unsigned int /* want */, + unsigned int /* need */, + Bool /* load */ +); + +/***====================================================================***/ + +extern int XkbKeyTypesForCoreSymbols( /* returns # of groups */ + XkbDescPtr /* xkb */, /* keyboard device */ + int /* map_width */, /* width of core KeySym array */ + KeySym * /* core_syms */, /* always mapWidth symbols */ + unsigned int /* protected */, /* explicit key types */ + int * /* types_inout */, /* always four type indices */ + KeySym * /* xkb_syms_rtrn */ /* must have enough space */ +); + +extern Bool XkbApplyCompatMapToKey( /* False only on error */ + XkbDescPtr /* xkb */, /* keymap to be edited */ + KeyCode /* key */, /* key to be updated */ + XkbChangesPtr /* changes */ /* resulting changes to map */ +); + +extern Bool XkbUpdateMapFromCore( /* False only on error */ + XkbDescPtr /* xkb */, /* XKB keyboard to be edited */ + KeyCode /* first_key */, /* first changed key */ + int /* num_keys */, /* number of changed keys */ + int /* map_width */, /* width of core keymap */ + KeySym * /* core_keysyms */, /* symbols from core keymap */ + XkbChangesPtr /* changes */ /* resulting changes */ +); + +/***====================================================================***/ + +extern XkbDeviceLedInfoPtr XkbAddDeviceLedInfo( + XkbDeviceInfoPtr /* devi */, + unsigned int /* ledClass */, + unsigned int /* ledId */ +); + +extern Status XkbResizeDeviceButtonActions( + XkbDeviceInfoPtr /* devi */, + unsigned int /* newTotal */ +); + +extern XkbDeviceInfoPtr XkbAllocDeviceInfo( + unsigned int /* deviceSpec */, + unsigned int /* nButtons */, + unsigned int /* szLeds */ +); + +extern void XkbFreeDeviceInfo( + XkbDeviceInfoPtr /* devi */, + unsigned int /* which */, + Bool /* freeDevI */ +); + +extern void XkbNoteDeviceChanges( + XkbDeviceChangesPtr /* old */, + XkbExtensionDeviceNotifyEvent * /* new */, + unsigned int /* wanted */ +); + +extern XkbDeviceInfoPtr XkbGetDeviceInfo( + Display * /* dpy */, + unsigned int /* which */, + unsigned int /* deviceSpec */, + unsigned int /* ledClass */, + unsigned int /* ledID */ +); + +extern Status XkbGetDeviceInfoChanges( + Display * /* dpy */, + XkbDeviceInfoPtr /* devi */, + XkbDeviceChangesPtr /* changes */ +); + +extern Status XkbGetDeviceButtonActions( + Display * /* dpy */, + XkbDeviceInfoPtr /* devi */, + Bool /* all */, + unsigned int /* first */, + unsigned int /* nBtns */ +); + +extern Status XkbGetDeviceLedInfo( + Display * /* dpy */, + XkbDeviceInfoPtr /* devi */, + unsigned int /* ledClass (class, XIDflt, XIAll) */, + unsigned int /* ledId (id, XIDflt, XIAll) */, + unsigned int /* which (XkbXI_Indicator{Names,Map}Mask */ +); + +extern Bool XkbSetDeviceInfo( + Display * /* dpy */, + unsigned int /* which */, + XkbDeviceInfoPtr /* devi */ +); + +extern Bool XkbChangeDeviceInfo( + Display* /* dpy */, + XkbDeviceInfoPtr /* desc */, + XkbDeviceChangesPtr /* changes */ +); + +extern Bool XkbSetDeviceLedInfo( + Display * /* dpy */, + XkbDeviceInfoPtr /* devi */, + unsigned int /* ledClass */, + unsigned int /* ledID */, + unsigned int /* which */ +); + +extern Bool XkbSetDeviceButtonActions( + Display * /* dpy */, + XkbDeviceInfoPtr /* devi */, + unsigned int /* first */, + unsigned int /* nBtns */ +); + +/***====================================================================***/ + +extern char XkbToControl( + char /* c */ +); + +/***====================================================================***/ + +extern Bool XkbSetDebuggingFlags( + Display * /* dpy */, + unsigned int /* mask */, + unsigned int /* flags */, + char * /* msg */, + unsigned int /* ctrls_mask */, + unsigned int /* ctrls */, + unsigned int * /* rtrn_flags */, + unsigned int * /* rtrn_ctrls */ +); + +extern Bool XkbApplyVirtualModChanges( + XkbDescPtr /* xkb */, + unsigned int /* changed */, + XkbChangesPtr /* changes */ +); + +extern Bool XkbUpdateActionVirtualMods( + XkbDescPtr /* xkb */, + XkbAction * /* act */, + unsigned int /* changed */ +); + +extern void XkbUpdateKeyTypeVirtualMods( + XkbDescPtr /* xkb */, + XkbKeyTypePtr /* type */, + unsigned int /* changed */, + XkbChangesPtr /* changes */ +); + +_XFUNCPROTOEND + +#endif /* _XKBLIB_H_ */ diff --git a/X11/Xauth.h b/X11/Xauth.h new file mode 100644 index 000000000..ace975d84 --- /dev/null +++ b/X11/Xauth.h @@ -0,0 +1,141 @@ +/* $Xorg: Xauth.h,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */ + +/* + +Copyright 1988, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ + +/* $XFree86: xc/lib/Xau/Xauth.h,v 1.5 2001/12/14 19:54:36 dawes Exp $ */ + +#ifndef _Xauth_h +#define _Xauth_h + +typedef struct xauth { + unsigned short family; + unsigned short address_length; + char *address; + unsigned short number_length; + char *number; + unsigned short name_length; + char *name; + unsigned short data_length; + char *data; +} Xauth; + +#ifndef _XAUTH_STRUCT_ONLY + +# include <X11/Xfuncproto.h> +# include <X11/Xfuncs.h> + +# include <stdio.h> + +# define FamilyLocal (256) /* not part of X standard (i.e. X.h) */ +# define FamilyWild (65535) +# define FamilyNetname (254) /* not part of X standard */ +# define FamilyKrb5Principal (253) /* Kerberos 5 principal name */ +# define FamilyLocalHost (252) /* for local non-net authentication */ + + +_XFUNCPROTOBEGIN + +char *XauFileName(void); + +Xauth *XauReadAuth( +FILE* /* auth_file */ +); + +int XauLockAuth( +_Xconst char* /* file_name */, +int /* retries */, +int /* timeout */, +long /* dead */ +); + +int XauUnlockAuth( +_Xconst char* /* file_name */ +); + +int XauWriteAuth( +FILE* /* auth_file */, +Xauth* /* auth */ +); + +Xauth *XauGetAuthByAddr( +#if NeedWidePrototypes +unsigned int /* family */, +unsigned int /* address_length */, +#else +unsigned short /* family */, +unsigned short /* address_length */, +#endif +_Xconst char* /* address */, +#if NeedWidePrototypes +unsigned int /* number_length */, +#else +unsigned short /* number_length */, +#endif +_Xconst char* /* number */, +#if NeedWidePrototypes +unsigned int /* name_length */, +#else +unsigned short /* name_length */, +#endif +_Xconst char* /* name */ +); + +Xauth *XauGetBestAuthByAddr( +#if NeedWidePrototypes +unsigned int /* family */, +unsigned int /* address_length */, +#else +unsigned short /* family */, +unsigned short /* address_length */, +#endif +_Xconst char* /* address */, +#if NeedWidePrototypes +unsigned int /* number_length */, +#else +unsigned short /* number_length */, +#endif +_Xconst char* /* number */, +int /* types_length */, +char** /* type_names */, +_Xconst int* /* type_lengths */ +); + +void XauDisposeAuth( +Xauth* /* auth */ +); + +_XFUNCPROTOEND + +/* Return values from XauLockAuth */ + +# define LOCK_SUCCESS 0 /* lock succeeded */ +# define LOCK_ERROR 1 /* lock unexpectely failed, check errno */ +# define LOCK_TIMEOUT 2 /* lock failed, timeouts expired */ + +#endif /* _XAUTH_STRUCT_ONLY */ + +#endif /* _Xauth_h */ diff --git a/X11/Xcms.h b/X11/Xcms.h new file mode 100644 index 000000000..265719636 --- /dev/null +++ b/X11/Xcms.h @@ -0,0 +1,805 @@ +/* $Xorg: Xcms.h,v 1.6 2000/08/17 19:45:04 cpqbld Exp $ */ + +/* + * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. + * All Rights Reserved + * + * This file is a component of an X Window System-specific implementation + * of Xcms based on the TekColor Color Management System. Permission is + * hereby granted to use, copy, modify, sell, and otherwise distribute this + * software and its documentation for any purpose and without fee, provided + * that this copyright, permission, and disclaimer notice is reproduced in + * all copies of this software and in supporting documentation. TekColor + * is a trademark of Tektronix, Inc. + * + * Tektronix makes no representation about the suitability of this software + * for any purpose. It is provided "as is" and with all faults. + * + * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, + * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER IN AN ACTION OF + * CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR THE PERFORMANCE OF THIS SOFTWARE. + * + * + * DESCRIPTION + * Public include file for X Color Management System + */ +/* $XFree86: xc/lib/X11/Xcms.h,v 1.7 2003/11/03 03:46:26 dawes Exp $ */ +#ifndef _XCMS_H_ +#define _XCMS_H_ + +#include <X11/Xlib.h> + + /* + * XCMS Status Values + */ +#define XcmsFailure 0 +#define XcmsSuccess 1 +#define XcmsSuccessWithCompression 2 + + /* + * Color Space Format ID's + * Color Space ID's are of XcmsColorFormat type. + * + * bit 31 + * 0 == Device-Independent + * 1 == Device-Dependent + * + * bit 30: + * 0 == Registered with X Consortium + * 1 == Unregistered + */ +#define XcmsUndefinedFormat (XcmsColorFormat)0x00000000 +#define XcmsCIEXYZFormat (XcmsColorFormat)0x00000001 +#define XcmsCIEuvYFormat (XcmsColorFormat)0x00000002 +#define XcmsCIExyYFormat (XcmsColorFormat)0x00000003 +#define XcmsCIELabFormat (XcmsColorFormat)0x00000004 +#define XcmsCIELuvFormat (XcmsColorFormat)0x00000005 +#define XcmsTekHVCFormat (XcmsColorFormat)0x00000006 +#define XcmsRGBFormat (XcmsColorFormat)0x80000000 +#define XcmsRGBiFormat (XcmsColorFormat)0x80000001 + + /* + * State of XcmsPerScrnInfo + */ +#define XcmsInitNone 0x00 /* no initialization attempted */ +#define XcmsInitSuccess 0x01 /* initialization successful */ +#define XcmsInitFailure 0xff /* failure, use defaults */ + +#define DisplayOfCCC(ccc) ((ccc)->dpy) +#define ScreenNumberOfCCC(ccc) ((ccc)->screenNumber) +#define VisualOfCCC(ccc) ((ccc)->visual) +#define ClientWhitePointOfCCC(ccc) (&(ccc)->clientWhitePt) +#define ScreenWhitePointOfCCC(ccc) (&(ccc)->pPerScrnInfo->screenWhitePt) +#define FunctionSetOfCCC(ccc) ((ccc)->pPerScrnInfo->functionSet) + +typedef unsigned long XcmsColorFormat; /* Color Space Format ID */ + +typedef double XcmsFloat; + + /* + * Device RGB + */ +typedef struct { + unsigned short red; /* scaled from 0x0000 to 0xffff */ + unsigned short green; /* scaled from 0x0000 to 0xffff */ + unsigned short blue; /* scaled from 0x0000 to 0xffff */ +} XcmsRGB; + + /* + * RGB Intensity + */ +typedef struct { + XcmsFloat red; /* 0.0 - 1.0 */ + XcmsFloat green; /* 0.0 - 1.0 */ + XcmsFloat blue; /* 0.0 - 1.0 */ +} XcmsRGBi; + + /* + * CIE XYZ + */ +typedef struct { + XcmsFloat X; + XcmsFloat Y; + XcmsFloat Z; +} XcmsCIEXYZ; + + /* + * CIE u'v'Y + */ +typedef struct { + XcmsFloat u_prime; /* 0.0 - 1.0 */ + XcmsFloat v_prime; /* 0.0 - 1.0 */ + XcmsFloat Y; /* 0.0 - 1.0 */ +} XcmsCIEuvY; + + /* + * CIE xyY + */ +typedef struct { + XcmsFloat x; /* 0.0 - 1.0 */ + XcmsFloat y; /* 0.0 - 1.0 */ + XcmsFloat Y; /* 0.0 - 1.0 */ +} XcmsCIExyY; + + /* + * CIE L*a*b* + */ +typedef struct { + XcmsFloat L_star; /* 0.0 - 100.0 */ + XcmsFloat a_star; + XcmsFloat b_star; +} XcmsCIELab; + + /* + * CIE L*u*v* + */ +typedef struct { + XcmsFloat L_star; /* 0.0 - 100.0 */ + XcmsFloat u_star; + XcmsFloat v_star; +} XcmsCIELuv; + + /* + * TekHVC + */ +typedef struct { + XcmsFloat H; /* 0.0 - 360.0 */ + XcmsFloat V; /* 0.0 - 100.0 */ + XcmsFloat C; /* 0.0 - 100.0 */ +} XcmsTekHVC; + + /* + * PAD + */ +typedef struct { + XcmsFloat pad0; + XcmsFloat pad1; + XcmsFloat pad2; + XcmsFloat pad3; +} XcmsPad; + + + /* + * XCMS Color Structure + */ +typedef struct { + union { + XcmsRGB RGB; + XcmsRGBi RGBi; + XcmsCIEXYZ CIEXYZ; + XcmsCIEuvY CIEuvY; + XcmsCIExyY CIExyY; + XcmsCIELab CIELab; + XcmsCIELuv CIELuv; + XcmsTekHVC TekHVC; + XcmsPad Pad; + } spec; /* the color specification */ + unsigned long pixel; /* pixel value (as needed) */ + XcmsColorFormat format; /* the specification format */ +} XcmsColor; + + + /* + * XCMS Per Screen related data + */ + +typedef struct _XcmsPerScrnInfo { + XcmsColor screenWhitePt; /* Screen White point */ + XPointer functionSet; /* pointer to Screen Color Characterization */ + /* Function Set structure */ + XPointer screenData; /* pointer to corresponding Screen Color*/ + /* Characterization Data */ + unsigned char state; /* XcmsInitNone, XcmsInitSuccess, XcmsInitFailure */ + char pad[3]; +} XcmsPerScrnInfo; + +typedef struct _XcmsCCC *XcmsCCC; + +typedef Status (*XcmsCompressionProc)( /* Gamut Compression Proc */ + XcmsCCC /* ccc */, + XcmsColor* /* colors_in_out */, + unsigned int /* ncolors */, + unsigned int /* index */, + Bool* /* compression_flags_return */ +); + +typedef Status (*XcmsWhiteAdjustProc)( /* White Point Adjust Proc */ + XcmsCCC /* ccc */, + XcmsColor* /* initial_white_point*/, + XcmsColor* /* target_white_point*/, + XcmsColorFormat /* target_format */, + XcmsColor* /* colors_in_out */, + unsigned int /* ncolors */, + Bool* /* compression_flags_return */ +); + + /* + * XCMS Color Conversion Context + */ +typedef struct _XcmsCCC { + Display *dpy; /* X Display */ + int screenNumber; /* X screen number */ + Visual *visual; /* X Visual */ + XcmsColor clientWhitePt; /* Client White Point */ + XcmsCompressionProc gamutCompProc; /* Gamut Compression Function */ + XPointer gamutCompClientData; /* Gamut Comp Func Client Data */ + XcmsWhiteAdjustProc whitePtAdjProc; /* White Point Adjustment Function */ + XPointer whitePtAdjClientData; /* White Pt Adj Func Client Data */ + XcmsPerScrnInfo *pPerScrnInfo; /* pointer to per screen information */ + /* associated with the above display */ + /* screenNumber */ +} XcmsCCCRec; + +typedef Status (*XcmsScreenInitProc)( /* Screen Initialization Proc */ + Display* /* dpy */, + int /* screen_number */, + XcmsPerScrnInfo* /* screen_info */ +); + +typedef void (*XcmsScreenFreeProc)( + XPointer /* screenData */ +); + + /* + * Function List Pointer -- pointer to an array of function pointers. + * The end of list is indicated by a NULL pointer. + */ +/* + * XXX: The use of the XcmsConversionProc type is broken. The + * device-independent colour conversion code uses it as: + +typedef Status (*XcmsConversionProc)(XcmsCCC, XcmsColor *, XcmsColor *, + unsigned int); + + * while the device-dependent code uses it as: + +typedef Status (*XcmsConversionProc)(XcmsCCC, XcmsColor *, unsigned int, + Bool *); + + * Until this is reworked, it's probably best to leave it unprotoized. + * The code works regardless. + */ +typedef Status (*XcmsDDConversionProc)( /* using device-dependent version */ + XcmsCCC /* ccc */, + XcmsColor* /* pcolors_in_out */, + unsigned int /* ncolors */, + Bool* /* pCompressed */ + ); + +typedef Status (*XcmsDIConversionProc)( /* using device-independent version */ + XcmsCCC /* ccc */, + XcmsColor* /* white_point */, + XcmsColor* /* pcolors_in_out */, + unsigned int /* ncolors */ + ); + +typedef XcmsDIConversionProc XcmsConversionProc; +typedef XcmsConversionProc *XcmsFuncListPtr; + +typedef int (*XcmsParseStringProc)( /* Color String Parsing Proc */ + char* /* color_string */, + XcmsColor* /* color_return */ +); + + /* + * Color Space -- per Color Space related data (Device-Independent + * or Device-Dependent) + */ +typedef struct _XcmsColorSpace { + const char *prefix; /* Prefix of string format. */ + XcmsColorFormat id; /* Format ID number. */ + XcmsParseStringProc parseString; + /* String format parsing function */ + XcmsFuncListPtr to_CIEXYZ; /* Pointer to an array of function */ + /* pointers such that when the */ + /* functions are executed in sequence */ + /* will convert a XcmsColor structure */ + /* from this color space to CIEXYZ */ + /* space. */ + XcmsFuncListPtr from_CIEXYZ;/* Pointer to an array of function */ + /* pointers such that when the */ + /* functions are executed in sequence */ + /* will convert a XcmsColor structure */ + /* from CIEXYZ space to this color */ + /* space. */ + int inverse_flag; /* If 1, indicates that for 0 <= i < n */ + /* where n is the number of function */ + /* pointers in the lists to_CIEXYZ */ + /* and from_CIEXYZ; for each function */ + /* to_CIEXYZ[i] its inverse function */ + /* is from_CIEXYZ[n - i]. */ + +} XcmsColorSpace; + + /* + * Screen Color Characterization Function Set -- per device class + * color space conversion functions. + */ +typedef struct _XcmsFunctionSet { + XcmsColorSpace **DDColorSpaces; + /* Pointer to an array of pointers to */ + /* Device-DEPENDENT color spaces */ + /* understood by this SCCFuncSet. */ + XcmsScreenInitProc screenInitProc; + /* Screen initialization function that */ + /* reads Screen Color Characterization*/ + /* Data off properties on the screen's*/ + /* root window. */ + XcmsScreenFreeProc screenFreeProc; + /* Function that frees the SCCData */ + /* structures. */ +} XcmsFunctionSet; + +_XFUNCPROTOBEGIN + +extern Status XcmsAddColorSpace ( + XcmsColorSpace* /* pColorSpace */ +); + +extern Status XcmsAddFunctionSet ( + XcmsFunctionSet* /* functionSet */ +); + +extern Status XcmsAllocColor ( + Display* /* dpy */, + Colormap /* colormap */, + XcmsColor* /* color_in_out */, + XcmsColorFormat /* result_format */ +); + +extern Status XcmsAllocNamedColor ( + Display* /* dpy */, + Colormap /* colormap */, + _Xconst char* /* color_string */, + XcmsColor* /* color_scrn_return */, + XcmsColor* /* color_exact_return */, + XcmsColorFormat /* result_format */ +); + +extern XcmsCCC XcmsCCCOfColormap ( + Display* /* dpy */, + Colormap /* colormap */ +); + +extern Status XcmsCIELabClipab( + XcmsCCC /* ccc */, + XcmsColor* /* colors_in_out */, + unsigned int /* ncolors */, + unsigned int /* index */, + Bool* /* compression_flags_return */ +); + +extern Status XcmsCIELabClipL( + XcmsCCC /* ccc */, + XcmsColor* /* colors_in_out */, + unsigned int /* ncolors */, + unsigned int /* index */, + Bool* /* compression_flags_return */ +); + +extern Status XcmsCIELabClipLab( + XcmsCCC /* ccc */, + XcmsColor* /* colors_in_out */, + unsigned int /* ncolors */, + unsigned int /* index */, + Bool* /* compression_flags_return */ +); + +extern Status XcmsCIELabQueryMaxC ( + XcmsCCC /* ccc */, + XcmsFloat /* hue_angle */, + XcmsFloat /* L_star */, + XcmsColor* /* color_return */ +); + +extern Status XcmsCIELabQueryMaxL ( + XcmsCCC /* ccc */, + XcmsFloat /* hue_angle */, + XcmsFloat /* chroma */, + XcmsColor* /* color_return */ +); + +extern Status XcmsCIELabQueryMaxLC ( + XcmsCCC /* ccc */, + XcmsFloat /* hue_angle */, + XcmsColor* /* color_return */ +); + +extern Status XcmsCIELabQueryMinL ( + XcmsCCC /* ccc */, + XcmsFloat /* hue_angle */, + XcmsFloat /* chroma */, + XcmsColor* /* color_return */ +); + +extern Status XcmsCIELabToCIEXYZ ( + XcmsCCC /* ccc */, + XcmsColor* /* white_point */, + XcmsColor* /* colors */, + unsigned int /* ncolors */ +); + +extern Status XcmsCIELabWhiteShiftColors( + XcmsCCC /* ccc */, + XcmsColor* /* initial_white_point*/, + XcmsColor* /* target_white_point*/, + XcmsColorFormat /* target_format */, + XcmsColor* /* colors_in_out */, + unsigned int /* ncolors */, + Bool* /* compression_flags_return */ +); + +extern Status XcmsCIELuvClipL( + XcmsCCC /* ccc */, + XcmsColor* /* colors_in_out */, + unsigned int /* ncolors */, + unsigned int /* index */, + Bool* /* compression_flags_return */ +); + +extern Status XcmsCIELuvClipLuv( + XcmsCCC /* ccc */, + XcmsColor* /* colors_in_out */, + unsigned int /* ncolors */, + unsigned int /* index */, + Bool* /* compression_flags_return */ +); + +extern Status XcmsCIELuvClipuv( + XcmsCCC /* ccc */, + XcmsColor* /* colors_in_out */, + unsigned int /* ncolors */, + unsigned int /* index */, + Bool* /* compression_flags_return */ +); + +extern Status XcmsCIELuvQueryMaxC ( + XcmsCCC /* ccc */, + XcmsFloat /* hue_angle */, + XcmsFloat /* L_star */, + XcmsColor* /* color_return */ +); + +extern Status XcmsCIELuvQueryMaxL ( + XcmsCCC /* ccc */, + XcmsFloat /* hue_angle */, + XcmsFloat /* chroma */, + XcmsColor* /* color_return */ +); + +extern Status XcmsCIELuvQueryMaxLC ( + XcmsCCC /* ccc */, + XcmsFloat /* hue_angle */, + XcmsColor* /* color_return */ +); + +extern Status XcmsCIELuvQueryMinL ( + XcmsCCC /* ccc */, + XcmsFloat /* hue_angle */, + XcmsFloat /* chroma */, + XcmsColor* /* color_return */ +); + +extern Status XcmsCIELuvToCIEuvY ( + XcmsCCC /* ccc */, + XcmsColor* /* white_point */, + XcmsColor* /* colors */, + unsigned int /* ncolors */ +); + +extern Status XcmsCIELuvWhiteShiftColors( + XcmsCCC /* ccc */, + XcmsColor* /* initial_white_point*/, + XcmsColor* /* target_white_point*/, + XcmsColorFormat /* target_format */, + XcmsColor* /* colors_in_out */, + unsigned int /* ncolors */, + Bool* /* compression_flags_return */ +); + +extern Status XcmsCIEXYZToCIELab ( + XcmsCCC /* ccc */, + XcmsColor* /* white_point */, + XcmsColor* /* colors */, + unsigned int /* ncolors */ +); + +extern Status XcmsCIEXYZToCIEuvY ( + XcmsCCC /* ccc */, + XcmsColor* /* white_point */, + XcmsColor* /* colors */, + unsigned int /* ncolors */ +); + +extern Status XcmsCIEXYZToCIExyY ( + XcmsCCC /* ccc */, + XcmsColor* /* white_point */, + XcmsColor* /* colors */, + unsigned int /* ncolors */ +); + +extern Status XcmsCIEXYZToRGBi ( + XcmsCCC /* ccc */, + XcmsColor* /* colors */, + unsigned int /* ncolors */, + Bool* /* compression_flags_return */ +); + +extern Status XcmsCIEuvYToCIELuv ( + XcmsCCC /* ccc */, + XcmsColor* /* white_point */, + XcmsColor* /* colors */, + unsigned int /* ncolors */ +); + +extern Status XcmsCIEuvYToCIEXYZ ( + XcmsCCC /* ccc */, + XcmsColor* /* white_point */, + XcmsColor* /* colors */, + unsigned int /* ncolors */ +); + +extern Status XcmsCIEuvYToTekHVC ( + XcmsCCC /* ccc */, + XcmsColor* /* white_point */, + XcmsColor* /* colors */, + unsigned int /* ncolors */ +); + +extern Status XcmsCIExyYToCIEXYZ ( + XcmsCCC /* ccc */, + XcmsColor* /* white_point */, + XcmsColor* /* colors */, + unsigned int /* ncolors */ +); + +extern XcmsColor *XcmsClientWhitePointOfCCC ( + XcmsCCC /* ccc */ +); + +extern Status XcmsConvertColors ( + XcmsCCC /* ccc */, + XcmsColor* /* colorArry_in_out */, + unsigned int /* nColors */, + XcmsColorFormat /* targetFormat */, + Bool* /* compArry_return */ +); + +extern XcmsCCC XcmsCreateCCC ( + Display* /* dpy */, + int /* screenNumber */, + Visual* /* visual */, + XcmsColor* /* clientWhitePt */, + XcmsCompressionProc /* gamutCompProc */, + XPointer /* gamutCompClientData */, + XcmsWhiteAdjustProc /* whitePtAdjProc */, + XPointer /* whitePtAdjClientData */ +); + +extern XcmsCCC XcmsDefaultCCC ( + Display* /* dpy */, + int /* screenNumber */ +); + +extern Display *XcmsDisplayOfCCC ( + XcmsCCC /* ccc */ +); + +extern XcmsColorFormat XcmsFormatOfPrefix ( + char* /* prefix */ +); + +extern void XcmsFreeCCC ( + XcmsCCC /* ccc */ +); + +extern Status XcmsLookupColor ( + Display* /* dpy */, + Colormap /* colormap */, + _Xconst char* /* color_string */, + XcmsColor* /* pColor_exact_in_out */, + XcmsColor* /* pColor_scrn_in_out */, + XcmsColorFormat /* result_format */ +); + +extern char *XcmsPrefixOfFormat ( + XcmsColorFormat /* id */ +); + +extern Status XcmsQueryBlack ( + XcmsCCC /* ccc */, + XcmsColorFormat /* target_format */, + XcmsColor* /* color_return */ +); + +extern Status XcmsQueryBlue ( + XcmsCCC /* ccc */, + XcmsColorFormat /* target_format */, + XcmsColor* /* color_return */ +); + +extern Status XcmsQueryColor ( + Display* /* dpy */, + Colormap /* colormap */, + XcmsColor* /* pColor_in_out */, + XcmsColorFormat /* result_format */ +); + +extern Status XcmsQueryColors ( + Display* /* dpy */, + Colormap /* colormap */, + XcmsColor* /* colorArry_in_out */, + unsigned int /* nColors */, + XcmsColorFormat /* result_format */ +); + +extern Status XcmsQueryGreen ( + XcmsCCC /* ccc */, + XcmsColorFormat /* target_format */, + XcmsColor* /* color_return */ +); + +extern Status XcmsQueryRed ( + XcmsCCC /* ccc */, + XcmsColorFormat /* target_format */, + XcmsColor* /* color_return */ +); + +extern Status XcmsQueryWhite ( + XcmsCCC /* ccc */, + XcmsColorFormat /* target_format */, + XcmsColor* /* color_return */ +); + +extern Status XcmsRGBiToCIEXYZ ( + XcmsCCC /* ccc */, + XcmsColor* /* colors */, + unsigned int /* ncolors */, + Bool* /* compression_flags_return */ +); + +extern Status XcmsRGBiToRGB ( + XcmsCCC /* ccc */, + XcmsColor* /* colors */, + unsigned int /* ncolors */, + Bool* /* compression_flags_return */ +); + +extern Status XcmsRGBToRGBi ( + XcmsCCC /* ccc */, + XcmsColor* /* colors */, + unsigned int /* ncolors */, + Bool* /* compression_flags_return */ +); + +extern int XcmsScreenNumberOfCCC ( + XcmsCCC /* ccc */ +); + +extern XcmsColor *XcmsScreenWhitePointOfCCC ( + XcmsCCC /* ccc */ +); + +extern XcmsCCC XcmsSetCCCOfColormap( + Display* /* dpy */, + Colormap /* colormap */, + XcmsCCC /* ccc */ +); + +extern XcmsCompressionProc XcmsSetCompressionProc ( + XcmsCCC /* ccc */, + XcmsCompressionProc /* compression_proc */, + XPointer /* client_data */ +); + +extern XcmsWhiteAdjustProc XcmsSetWhiteAdjustProc ( + XcmsCCC /* ccc */, + XcmsWhiteAdjustProc /* white_adjust_proc */, + XPointer /* client_data */ +); + +extern Status XcmsSetWhitePoint ( + XcmsCCC /* ccc */, + XcmsColor* /* color */ +); + +extern Status XcmsStoreColor ( + Display* /* dpy */, + Colormap /* colormap */, + XcmsColor* /* pColor_in */ +); + +extern Status XcmsStoreColors ( + Display* /* dpy */, + Colormap /* colormap */, + XcmsColor* /* colorArry_in */, + unsigned int /* nColors */, + Bool* /* compArry_return */ +); + +extern Status XcmsTekHVCClipC( + XcmsCCC /* ccc */, + XcmsColor* /* colors_in_out */, + unsigned int /* ncolors */, + unsigned int /* index */, + Bool* /* compression_flags_return */ +); + +extern Status XcmsTekHVCClipV( + XcmsCCC /* ccc */, + XcmsColor* /* colors_in_out */, + unsigned int /* ncolors */, + unsigned int /* index */, + Bool* /* compression_flags_return */ +); + +extern Status XcmsTekHVCClipVC( + XcmsCCC /* ccc */, + XcmsColor* /* colors_in_out */, + unsigned int /* ncolors */, + unsigned int /* index */, + Bool* /* compression_flags_return */ +); + +extern Status XcmsTekHVCQueryMaxC ( + XcmsCCC /* ccc */, + XcmsFloat /* hue */, + XcmsFloat /* value */, + XcmsColor* /* color_return */ +); + +extern Status XcmsTekHVCQueryMaxV ( + XcmsCCC /* ccc */, + XcmsFloat /* hue */, + XcmsFloat /* chroma */, + XcmsColor* /* color_return */ +); + +extern Status XcmsTekHVCQueryMaxVC ( + XcmsCCC /* ccc */, + XcmsFloat /* hue */, + XcmsColor* /* color_return */ +); + +extern Status XcmsTekHVCQueryMaxVSamples ( + XcmsCCC /* ccc */, + XcmsFloat /* hue */, + XcmsColor* /* colors_return */, + unsigned int /* nsamples */ +); + +extern Status XcmsTekHVCQueryMinV ( + XcmsCCC /* ccc */, + XcmsFloat /* hue */, + XcmsFloat /* chroma */, + XcmsColor* /* color_return */ +); + +extern Status XcmsTekHVCToCIEuvY ( + XcmsCCC /* ccc */, + XcmsColor* /* white_point */, + XcmsColor* /* colors */, + unsigned int /* ncolors */ +); + +extern Status XcmsTekHVCWhiteShiftColors( + XcmsCCC /* ccc */, + XcmsColor* /* initial_white_point*/, + XcmsColor* /* target_white_point*/, + XcmsColorFormat /* target_format */, + XcmsColor* /* colors_in_out */, + unsigned int /* ncolors */, + Bool* /* compression_flags_return */ +); + +extern Visual *XcmsVisualOfCCC ( + XcmsCCC /* ccc */ +); + +_XFUNCPROTOEND + +#endif /* _XCMS_H_ */ diff --git a/X11/Xdmcp.h b/X11/Xdmcp.h new file mode 100644 index 000000000..254848565 --- /dev/null +++ b/X11/Xdmcp.h @@ -0,0 +1,190 @@ +/* $XdotOrg: xc/lib/Xdmcp/Xdmcp.h,v 1.2 2004/04/23 18:43:41 eich Exp $ */ +/* $Xorg: Xdmcp.h,v 1.7 2001/04/13 14:43:00 steve Exp $ */ +/* + * Copyright 1989 Network Computing Devices, Inc., Mountain View, California. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of N.C.D. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. N.C.D. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + */ +/* $XFree86: xc/lib/Xdmcp/Xdmcp.h,v 3.7 2003/07/09 15:27:29 tsi Exp $ */ + +#ifndef _XDMCP_H_ +#define _XDMCP_H_ + +#include <X11/Xmd.h> + +#include <X11/Xfuncproto.h> + +_XFUNCPROTOBEGIN + +#define XDM_PROTOCOL_VERSION 1 +#define XDM_UDP_PORT 177 + +/* IANA has assigned FF0X:0:0:0:0:0:0:12B as the permanently assigned + * multicast addresses for XDMCP, where X in the prefix may be replaced + * by any valid scope identifier, such as 1 for Node-Local, 2 for Link-Local, + * 5 for Site-Local, and so on. We set the default here to the Link-Local + * version to most closely match the old IPv4 subnet broadcast behavior. + * Both xdm and X -query allow specifying a different address if a different + * scope is defined. + */ +#define XDM_DEFAULT_MCAST_ADDR6 "ff02:0:0:0:0:0:0:12b" + +#define XDM_MAX_MSGLEN 8192 +#define XDM_MIN_RTX 2 +#define XDM_MAX_RTX 32 +#define XDM_RTX_LIMIT 7 +#define XDM_KA_RTX_LIMIT 4 +#define XDM_DEF_DORMANCY (3 * 60) /* 3 minutes */ +#define XDM_MAX_DORMANCY (24 * 60 * 60) /* 24 hours */ + +typedef enum { + BROADCAST_QUERY = 1, QUERY, INDIRECT_QUERY, FORWARD_QUERY, + WILLING, UNWILLING, REQUEST, ACCEPT, DECLINE, MANAGE, REFUSE, + FAILED, KEEPALIVE, ALIVE +} xdmOpCode; + +typedef enum { + XDM_QUERY, XDM_BROADCAST, XDM_INDIRECT, XDM_COLLECT_QUERY, + XDM_COLLECT_BROADCAST_QUERY, XDM_COLLECT_INDIRECT_QUERY, + XDM_START_CONNECTION, XDM_AWAIT_REQUEST_RESPONSE, + XDM_AWAIT_MANAGE_RESPONSE, XDM_MANAGE, XDM_RUN_SESSION, XDM_OFF, + XDM_AWAIT_USER_INPUT, XDM_KEEPALIVE, XDM_AWAIT_ALIVE_RESPONSE, +#if defined(IPv6) && defined(AF_INET6) + XDM_MULTICAST, XDM_COLLECT_MULTICAST_QUERY, +#endif + XDM_KEEP_ME_LAST +} xdmcp_states; + +#ifdef NOTDEF +/* table of hosts */ + +#define XDM_MAX_STR_LEN 21 +#define XDM_MAX_HOSTS 20 +struct xdm_host_table { + struct sockaddr_in sockaddr; + char name[XDM_MAX_STR_LEN]; + char status[XDM_MAX_STR_LEN]; +}; +#endif /* NOTDEF */ + +typedef CARD8 *CARD8Ptr; +typedef CARD16 *CARD16Ptr; +typedef CARD32 *CARD32Ptr; + +typedef struct _ARRAY8 { + CARD16 length; + CARD8Ptr data; +} ARRAY8, *ARRAY8Ptr; + +typedef struct _ARRAY16 { + CARD8 length; + CARD16Ptr data; +} ARRAY16, *ARRAY16Ptr; + +typedef struct _ARRAY32 { + CARD8 length; + CARD32Ptr data; +} ARRAY32, *ARRAY32Ptr; + +typedef struct _ARRAYofARRAY8 { + CARD8 length; + ARRAY8Ptr data; +} ARRAYofARRAY8, *ARRAYofARRAY8Ptr; + +typedef struct _XdmcpHeader { + CARD16 version, opcode, length; +} XdmcpHeader, *XdmcpHeaderPtr; + +typedef struct _XdmcpBuffer { + BYTE *data; + int size; /* size of buffer pointed by to data */ + int pointer; /* current index into data */ + int count; /* bytes read from network into data */ +} XdmcpBuffer, *XdmcpBufferPtr; + +typedef struct _XdmAuthKey { + BYTE data[8]; +} XdmAuthKeyRec, *XdmAuthKeyPtr; + + +/* implementation-independent network address structure. + Equiv to sockaddr* for sockets and netbuf* for STREAMS. */ + +typedef char *XdmcpNetaddr; + +extern int XdmcpWriteARRAY16(XdmcpBufferPtr buffer, ARRAY16Ptr array); +extern int XdmcpWriteARRAY32(XdmcpBufferPtr buffer, ARRAY32Ptr array); +extern int XdmcpWriteARRAY8(XdmcpBufferPtr buffer, ARRAY8Ptr array); +extern int XdmcpWriteARRAYofARRAY8(XdmcpBufferPtr buffer, ARRAYofARRAY8Ptr array); +extern int XdmcpWriteCARD16(XdmcpBufferPtr buffer, unsigned value); +extern int XdmcpWriteCARD32(XdmcpBufferPtr buffer, unsigned value); +extern int XdmcpWriteCARD8(XdmcpBufferPtr buffer, unsigned value); +extern int XdmcpWriteHeader(XdmcpBufferPtr buffer, XdmcpHeaderPtr header); + +extern int XdmcpFlush(int fd, XdmcpBufferPtr buffer, XdmcpNetaddr to, int tolen); + +extern int XdmcpReadARRAY16(XdmcpBufferPtr buffer, ARRAY16Ptr array); +extern int XdmcpReadARRAY32(XdmcpBufferPtr buffer, ARRAY32Ptr array); +extern int XdmcpReadARRAY8(XdmcpBufferPtr buffer, ARRAY8Ptr array); +extern int XdmcpReadARRAYofARRAY8(XdmcpBufferPtr buffer, ARRAYofARRAY8Ptr array); +extern int XdmcpReadCARD16(XdmcpBufferPtr buffer, CARD16Ptr valuep); +extern int XdmcpReadCARD32(XdmcpBufferPtr buffer, CARD32Ptr valuep); +extern int XdmcpReadCARD8(XdmcpBufferPtr buffer, CARD8Ptr valuep); +extern int XdmcpReadHeader(XdmcpBufferPtr buffer, XdmcpHeaderPtr header); + +extern int XdmcpFill(int fd, XdmcpBufferPtr buffer, XdmcpNetaddr from, int *fromlen); + +extern int XdmcpReadRemaining(XdmcpBufferPtr buffer); + +extern void XdmcpDisposeARRAY8(ARRAY8Ptr array); +extern void XdmcpDisposeARRAY16(ARRAY16Ptr array); +extern void XdmcpDisposeARRAY32(ARRAY32Ptr array); +extern void XdmcpDisposeARRAYofARRAY8(ARRAYofARRAY8Ptr array); + +extern int XdmcpCopyARRAY8(ARRAY8Ptr src, ARRAY8Ptr dst); + +extern int XdmcpARRAY8Equal(ARRAY8Ptr array1, ARRAY8Ptr array2); + +extern void XdmcpGenerateKey (XdmAuthKeyPtr key); +extern void XdmcpIncrementKey (XdmAuthKeyPtr key); +extern void XdmcpDecrementKey (XdmAuthKeyPtr key); +#ifdef HASXDMAUTH +extern void XdmcpWrap(unsigned char *input, unsigned char *wrapper, unsigned char *output, int bytes); +extern void XdmcpUnwrap(unsigned char *input, unsigned char *wrapper, unsigned char *output, int bytes); +#endif + +#ifndef TRUE +#define TRUE 1 +#define FALSE 0 +#endif + +#if !defined(Xalloc) && !defined(xalloc) && !defined(Xrealloc) +extern void *Xalloc (unsigned long amount); +extern void *Xrealloc (void *old, unsigned long amount); +extern void Xfree(void *old); +#endif + +extern int XdmcpCompareKeys (XdmAuthKeyPtr a, XdmAuthKeyPtr b); + +extern int XdmcpAllocARRAY16 (ARRAY16Ptr array, int length); +extern int XdmcpAllocARRAY32 (ARRAY32Ptr array, int length); +extern int XdmcpAllocARRAY8 (ARRAY8Ptr array, int length); +extern int XdmcpAllocARRAYofARRAY8 (ARRAYofARRAY8Ptr array, int length); + +extern int XdmcpReallocARRAY16 (ARRAY16Ptr array, int length); +extern int XdmcpReallocARRAY32 (ARRAY32Ptr array, int length); +extern int XdmcpReallocARRAY8 (ARRAY8Ptr array, int length); +extern int XdmcpReallocARRAYofARRAY8 (ARRAYofARRAY8Ptr array, int length); + +_XFUNCPROTOEND + +#endif /* _XDMCP_H_ */ diff --git a/X11/Xfuncproto.h b/X11/Xfuncproto.h new file mode 100644 index 000000000..0ebe7db43 --- /dev/null +++ b/X11/Xfuncproto.h @@ -0,0 +1,122 @@ +/* $Xorg: Xfuncproto.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */ +/* + * +Copyright 1989, 1991, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + * + */ +/* $XFree86: xc/include/Xfuncproto.h,v 3.4 2001/12/14 19:53:25 dawes Exp $ */ + +/* Definitions to make function prototypes manageable */ + +#ifndef _XFUNCPROTO_H_ +#define _XFUNCPROTO_H_ + +#ifndef NeedFunctionPrototypes +#define NeedFunctionPrototypes 1 +#endif /* NeedFunctionPrototypes */ + +#ifndef NeedVarargsPrototypes +#define NeedVarargsPrototypes 1 +#endif /* NeedVarargsPrototypes */ + +#if NeedFunctionPrototypes + +#ifndef NeedNestedPrototypes +#define NeedNestedPrototypes 1 +#endif /* NeedNestedPrototypes */ + +#ifndef _Xconst +#define _Xconst const +#endif /* _Xconst */ + +/* Function prototype configuration (see configure for more info) */ +#ifndef NARROWPROTO +/* #undef NARROWPROTO */ +#endif +#ifndef FUNCPROTO +/* #undef FUNCPROTO */ +#endif + +#ifndef NeedWidePrototypes +#ifdef NARROWPROTO +#define NeedWidePrototypes 0 +#else +#define NeedWidePrototypes 1 /* default to make interropt. easier */ +#endif +#endif /* NeedWidePrototypes */ + +#endif /* NeedFunctionPrototypes */ + +#ifndef _XFUNCPROTOBEGIN +#if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */ +#define _XFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */ +#define _XFUNCPROTOEND } +#else +#define _XFUNCPROTOBEGIN +#define _XFUNCPROTOEND +#endif +#endif /* _XFUNCPROTOBEGIN */ + +#if defined(__GNUC__) && (__GNUC__ >= 4) +# define _X_SENTINEL(x) __attribute__ ((__sentinel__(x))) +# define _X_ATTRIBUTE_PRINTF(x,y) __attribute__((__format__(__printf__,x,y))) +#else +# define _X_SENTINEL(x) +# define _X_ATTRIBUTE_PRINTF(x,y) +#endif /* GNUC >= 4 */ + +#if defined(__GNUC__) && (__GNUC__ >= 4) +# define _X_EXPORT __attribute__((visibility("default"))) +# define _X_HIDDEN __attribute__((visibility("hidden"))) +# define _X_INTERNAL __attribute__((visibility("internal"))) +#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) +# define _X_EXPORT __global +# define _X_HIDDEN __hidden +# define _X_INTERNAL __hidden +#else /* not gcc >= 4 and not Sun Studio >= 8 */ +# define _X_EXPORT +# define _X_HIDDEN +# define _X_INTERNAL +#endif /* GNUC >= 4 */ + +#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303) +# define _X_LIKELY(x) __builtin_expect(!!(x), 1) +# define _X_UNLIKELY(x) __builtin_expect(!!(x), 0) +# define _X_INLINE inline +#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) +# define _X_LIKELY(x) (x) +# define _X_UNLIKELY(x) (x) +# define _X_INLINE inline +#else /* not gcc >= 3.3 and not Sun Studio >= 8 */ +# define _X_LIKELY(x) (x) +# define _X_UNLIKELY(x) (x) +# define _X_INLINE +#endif + +#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 301) +# define _X_DEPRECATED __attribute__((deprecated)) +#else /* not gcc >= 3.1 */ +# define _X_DEPRECATED +#endif + +#endif /* _XFUNCPROTO_H_ */ diff --git a/X11/Xlib-xcb.h b/X11/Xlib-xcb.h new file mode 100644 index 000000000..03d8f9867 --- /dev/null +++ b/X11/Xlib-xcb.h @@ -0,0 +1,20 @@ +/* Copyright (C) 2003-2006 Jamey Sharp, Josh Triplett + * This file is licensed under the MIT license. See the file COPYING. */ + +#ifndef XLIB_XCB_H +#define XLIB_XCB_H + +#include <xcb/xcb.h> +#include <X11/Xlib.h> +#include <X11/Xfuncproto.h> + +_XFUNCPROTOBEGIN + +xcb_connection_t *XGetXCBConnection(Display *dpy); + +enum XEventQueueOwner { XlibOwnsEventQueue = 0, XCBOwnsEventQueue }; +void XSetEventQueueOwner(Display *dpy, enum XEventQueueOwner owner); + +_XFUNCPROTOEND + +#endif /* XLIB_XCB_H */ diff --git a/X11/Xlib.h b/X11/Xlib.h new file mode 100644 index 000000000..2c30bc09e --- /dev/null +++ b/X11/Xlib.h @@ -0,0 +1,4026 @@ +/* $XdotOrg: lib/X11/include/X11/Xlib.h,v 1.6 2005-11-08 06:33:25 jkj Exp $ */ +/* $Xorg: Xlib.h,v 1.6 2001/02/09 02:03:38 xorgcvs Exp $ */ +/* + +Copyright 1985, 1986, 1987, 1991, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/lib/X11/Xlib.h,v 3.25 2003/11/17 22:20:10 dawes Exp $ */ + + +/* + * Xlib.h - Header definition and support file for the C subroutine + * interface library (Xlib) to the X Window System Protocol (V11). + * Structures and symbols starting with "_" are private to the library. + */ +#ifndef _XLIB_H_ +#define _XLIB_H_ + +#define XlibSpecificationRelease 6 + +#include <sys/types.h> + +#if defined(__SCO__) || defined(__UNIXWARE__) +#include <stdint.h> +#endif + +#include <X11/X.h> + +/* applications should not depend on these two headers being included! */ +#include <X11/Xfuncproto.h> +#include <X11/Xosdefs.h> + +#ifndef X_WCHAR +#include <stddef.h> +#else +#ifdef __UNIXOS2__ +#include <stdlib.h> +#else +/* replace this with #include or typedef appropriate for your system */ +typedef unsigned long wchar_t; +#endif +#endif + +#if defined(ISC) && defined(USE_XMBTOWC) +#define wctomb(a,b) _Xwctomb(a,b) +#define mblen(a,b) _Xmblen(a,b) +#ifndef USE_XWCHAR_STRING +#define mbtowc(a,b,c) _Xmbtowc(a,b,c) +#endif +#endif + +extern int +_Xmblen( +#ifdef ISC + char const *str, + size_t len +#else + char *str, + int len +#endif + ); + +/* API mentioning "UTF8" or "utf8" is an XFree86 extension, introduced in + November 2000. Its presence is indicated through the following macro. */ +#define X_HAVE_UTF8_STRING 1 + +typedef char *XPointer; + +#define Bool int +#define Status int +#define True 1 +#define False 0 + +#define QueuedAlready 0 +#define QueuedAfterReading 1 +#define QueuedAfterFlush 2 + +#define ConnectionNumber(dpy) (((_XPrivDisplay)dpy)->fd) +#define RootWindow(dpy, scr) (ScreenOfDisplay(dpy,scr)->root) +#define DefaultScreen(dpy) (((_XPrivDisplay)dpy)->default_screen) +#define DefaultRootWindow(dpy) (ScreenOfDisplay(dpy,DefaultScreen(dpy))->root) +#define DefaultVisual(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_visual) +#define DefaultGC(dpy, scr) (ScreenOfDisplay(dpy,scr)->default_gc) +#define BlackPixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->black_pixel) +#define WhitePixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->white_pixel) +#define AllPlanes ((unsigned long)~0L) +#define QLength(dpy) (((_XPrivDisplay)dpy)->qlen) +#define DisplayWidth(dpy, scr) (ScreenOfDisplay(dpy,scr)->width) +#define DisplayHeight(dpy, scr) (ScreenOfDisplay(dpy,scr)->height) +#define DisplayWidthMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mwidth) +#define DisplayHeightMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mheight) +#define DisplayPlanes(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth) +#define DisplayCells(dpy, scr) (DefaultVisual(dpy,scr)->map_entries) +#define ScreenCount(dpy) (((_XPrivDisplay)dpy)->nscreens) +#define ServerVendor(dpy) (((_XPrivDisplay)dpy)->vendor) +#define ProtocolVersion(dpy) (((_XPrivDisplay)dpy)->proto_major_version) +#define ProtocolRevision(dpy) (((_XPrivDisplay)dpy)->proto_minor_version) +#define VendorRelease(dpy) (((_XPrivDisplay)dpy)->release) +#define DisplayString(dpy) (((_XPrivDisplay)dpy)->display_name) +#define DefaultDepth(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth) +#define DefaultColormap(dpy, scr)(ScreenOfDisplay(dpy,scr)->cmap) +#define BitmapUnit(dpy) (((_XPrivDisplay)dpy)->bitmap_unit) +#define BitmapBitOrder(dpy) (((_XPrivDisplay)dpy)->bitmap_bit_order) +#define BitmapPad(dpy) (((_XPrivDisplay)dpy)->bitmap_pad) +#define ImageByteOrder(dpy) (((_XPrivDisplay)dpy)->byte_order) +#ifdef CRAY /* unable to get WORD64 without pulling in other symbols */ +#define NextRequest(dpy) XNextRequest(dpy) +#else +#define NextRequest(dpy) (((_XPrivDisplay)dpy)->request + 1) +#endif +#define LastKnownRequestProcessed(dpy) (((_XPrivDisplay)dpy)->last_request_read) + +/* macros for screen oriented applications (toolkit) */ +#define ScreenOfDisplay(dpy, scr)(&((_XPrivDisplay)dpy)->screens[scr]) +#define DefaultScreenOfDisplay(dpy) ScreenOfDisplay(dpy,DefaultScreen(dpy)) +#define DisplayOfScreen(s) ((s)->display) +#define RootWindowOfScreen(s) ((s)->root) +#define BlackPixelOfScreen(s) ((s)->black_pixel) +#define WhitePixelOfScreen(s) ((s)->white_pixel) +#define DefaultColormapOfScreen(s)((s)->cmap) +#define DefaultDepthOfScreen(s) ((s)->root_depth) +#define DefaultGCOfScreen(s) ((s)->default_gc) +#define DefaultVisualOfScreen(s)((s)->root_visual) +#define WidthOfScreen(s) ((s)->width) +#define HeightOfScreen(s) ((s)->height) +#define WidthMMOfScreen(s) ((s)->mwidth) +#define HeightMMOfScreen(s) ((s)->mheight) +#define PlanesOfScreen(s) ((s)->root_depth) +#define CellsOfScreen(s) (DefaultVisualOfScreen((s))->map_entries) +#define MinCmapsOfScreen(s) ((s)->min_maps) +#define MaxCmapsOfScreen(s) ((s)->max_maps) +#define DoesSaveUnders(s) ((s)->save_unders) +#define DoesBackingStore(s) ((s)->backing_store) +#define EventMaskOfScreen(s) ((s)->root_input_mask) + +/* + * Extensions need a way to hang private data on some structures. + */ +typedef struct _XExtData { + int number; /* number returned by XRegisterExtension */ + struct _XExtData *next; /* next item on list of data for structure */ + int (*free_private)( /* called to free private storage */ + struct _XExtData *extension + ); + XPointer private_data; /* data private to this extension. */ +} XExtData; + +/* + * This file contains structures used by the extension mechanism. + */ +typedef struct { /* public to extension, cannot be changed */ + int extension; /* extension number */ + int major_opcode; /* major op-code assigned by server */ + int first_event; /* first event number for the extension */ + int first_error; /* first error number for the extension */ +} XExtCodes; + +/* + * Data structure for retrieving info about pixmap formats. + */ + +typedef struct { + int depth; + int bits_per_pixel; + int scanline_pad; +} XPixmapFormatValues; + + +/* + * Data structure for setting graphics context. + */ +typedef struct { + int function; /* logical operation */ + unsigned long plane_mask;/* plane mask */ + unsigned long foreground;/* foreground pixel */ + unsigned long background;/* background pixel */ + int line_width; /* line width */ + int line_style; /* LineSolid, LineOnOffDash, LineDoubleDash */ + int cap_style; /* CapNotLast, CapButt, + CapRound, CapProjecting */ + int join_style; /* JoinMiter, JoinRound, JoinBevel */ + int fill_style; /* FillSolid, FillTiled, + FillStippled, FillOpaeueStippled */ + int fill_rule; /* EvenOddRule, WindingRule */ + int arc_mode; /* ArcChord, ArcPieSlice */ + Pixmap tile; /* tile pixmap for tiling operations */ + Pixmap stipple; /* stipple 1 plane pixmap for stipping */ + int ts_x_origin; /* offset for tile or stipple operations */ + int ts_y_origin; + Font font; /* default text font for text operations */ + int subwindow_mode; /* ClipByChildren, IncludeInferiors */ + Bool graphics_exposures;/* boolean, should exposures be generated */ + int clip_x_origin; /* origin for clipping */ + int clip_y_origin; + Pixmap clip_mask; /* bitmap clipping; other calls for rects */ + int dash_offset; /* patterned/dashed line information */ + char dashes; +} XGCValues; + +/* + * Graphics context. The contents of this structure are implementation + * dependent. A GC should be treated as opaque by application code. + */ + +typedef struct _XGC +#ifdef XLIB_ILLEGAL_ACCESS +{ + XExtData *ext_data; /* hook for extension to hang data */ + GContext gid; /* protocol ID for graphics context */ + /* there is more to this structure, but it is private to Xlib */ +} +#endif +*GC; + +/* + * Visual structure; contains information about colormapping possible. + */ +typedef struct { + XExtData *ext_data; /* hook for extension to hang data */ + VisualID visualid; /* visual id of this visual */ +#if defined(__cplusplus) || defined(c_plusplus) + int c_class; /* C++ class of screen (monochrome, etc.) */ +#else + int class; /* class of screen (monochrome, etc.) */ +#endif + unsigned long red_mask, green_mask, blue_mask; /* mask values */ + int bits_per_rgb; /* log base 2 of distinct color values */ + int map_entries; /* color map entries */ +} Visual; + +/* + * Depth structure; contains information for each possible depth. + */ +typedef struct { + int depth; /* this depth (Z) of the depth */ + int nvisuals; /* number of Visual types at this depth */ + Visual *visuals; /* list of visuals possible at this depth */ +} Depth; + +/* + * Information about the screen. The contents of this structure are + * implementation dependent. A Screen should be treated as opaque + * by application code. + */ + +struct _XDisplay; /* Forward declare before use for C++ */ + +typedef struct { + XExtData *ext_data; /* hook for extension to hang data */ + struct _XDisplay *display;/* back pointer to display structure */ + Window root; /* Root window id. */ + int width, height; /* width and height of screen */ + int mwidth, mheight; /* width and height of in millimeters */ + int ndepths; /* number of depths possible */ + Depth *depths; /* list of allowable depths on the screen */ + int root_depth; /* bits per pixel */ + Visual *root_visual; /* root visual */ + GC default_gc; /* GC for the root root visual */ + Colormap cmap; /* default color map */ + unsigned long white_pixel; + unsigned long black_pixel; /* White and Black pixel values */ + int max_maps, min_maps; /* max and min color maps */ + int backing_store; /* Never, WhenMapped, Always */ + Bool save_unders; + long root_input_mask; /* initial root input mask */ +} Screen; + +/* + * Format structure; describes ZFormat data the screen will understand. + */ +typedef struct { + XExtData *ext_data; /* hook for extension to hang data */ + int depth; /* depth of this image format */ + int bits_per_pixel; /* bits/pixel at this depth */ + int scanline_pad; /* scanline must padded to this multiple */ +} ScreenFormat; + +/* + * Data structure for setting window attributes. + */ +typedef struct { + Pixmap background_pixmap; /* background or None or ParentRelative */ + unsigned long background_pixel; /* background pixel */ + Pixmap border_pixmap; /* border of the window */ + unsigned long border_pixel; /* border pixel value */ + int bit_gravity; /* one of bit gravity values */ + int win_gravity; /* one of the window gravity values */ + int backing_store; /* NotUseful, WhenMapped, Always */ + unsigned long backing_planes;/* planes to be preseved if possible */ + unsigned long backing_pixel;/* value to use in restoring planes */ + Bool save_under; /* should bits under be saved? (popups) */ + long event_mask; /* set of events that should be saved */ + long do_not_propagate_mask; /* set of events that should not propagate */ + Bool override_redirect; /* boolean value for override-redirect */ + Colormap colormap; /* color map to be associated with window */ + Cursor cursor; /* cursor to be displayed (or None) */ +} XSetWindowAttributes; + +typedef struct { + int x, y; /* location of window */ + int width, height; /* width and height of window */ + int border_width; /* border width of window */ + int depth; /* depth of window */ + Visual *visual; /* the associated visual structure */ + Window root; /* root of screen containing window */ +#if defined(__cplusplus) || defined(c_plusplus) + int c_class; /* C++ InputOutput, InputOnly*/ +#else + int class; /* InputOutput, InputOnly*/ +#endif + int bit_gravity; /* one of bit gravity values */ + int win_gravity; /* one of the window gravity values */ + int backing_store; /* NotUseful, WhenMapped, Always */ + unsigned long backing_planes;/* planes to be preserved if possible */ + unsigned long backing_pixel;/* value to be used when restoring planes */ + Bool save_under; /* boolean, should bits under be saved? */ + Colormap colormap; /* color map to be associated with window */ + Bool map_installed; /* boolean, is color map currently installed*/ + int map_state; /* IsUnmapped, IsUnviewable, IsViewable */ + long all_event_masks; /* set of events all people have interest in*/ + long your_event_mask; /* my event mask */ + long do_not_propagate_mask; /* set of events that should not propagate */ + Bool override_redirect; /* boolean value for override-redirect */ + Screen *screen; /* back pointer to correct screen */ +} XWindowAttributes; + +/* + * Data structure for host setting; getting routines. + * + */ + +typedef struct { + int family; /* for example FamilyInternet */ + int length; /* length of address, in bytes */ + char *address; /* pointer to where to find the bytes */ +} XHostAddress; + +/* + * Data structure for ServerFamilyInterpreted addresses in host routines + */ +typedef struct { + int typelength; /* length of type string, in bytes */ + int valuelength; /* length of value string, in bytes */ + char *type; /* pointer to where to find the type string */ + char *value; /* pointer to where to find the address */ +} XServerInterpretedAddress; + +/* + * Data structure for "image" data, used by image manipulation routines. + */ +typedef struct _XImage { + int width, height; /* size of image */ + int xoffset; /* number of pixels offset in X direction */ + int format; /* XYBitmap, XYPixmap, ZPixmap */ + char *data; /* pointer to image data */ + int byte_order; /* data byte order, LSBFirst, MSBFirst */ + int bitmap_unit; /* quant. of scanline 8, 16, 32 */ + int bitmap_bit_order; /* LSBFirst, MSBFirst */ + int bitmap_pad; /* 8, 16, 32 either XY or ZPixmap */ + int depth; /* depth of image */ + int bytes_per_line; /* accelarator to next line */ + int bits_per_pixel; /* bits per pixel (ZPixmap) */ + unsigned long red_mask; /* bits in z arrangment */ + unsigned long green_mask; + unsigned long blue_mask; + XPointer obdata; /* hook for the object routines to hang on */ + struct funcs { /* image manipulation routines */ + struct _XImage *(*create_image)( + struct _XDisplay* /* display */, + Visual* /* visual */, + unsigned int /* depth */, + int /* format */, + int /* offset */, + char* /* data */, + unsigned int /* width */, + unsigned int /* height */, + int /* bitmap_pad */, + int /* bytes_per_line */); + int (*destroy_image) (struct _XImage *); + unsigned long (*get_pixel) (struct _XImage *, int, int); + int (*put_pixel) (struct _XImage *, int, int, unsigned long); + struct _XImage *(*sub_image)(struct _XImage *, int, int, unsigned int, unsigned int); + int (*add_pixel) (struct _XImage *, long); + } f; +} XImage; + +/* + * Data structure for XReconfigureWindow + */ +typedef struct { + int x, y; + int width, height; + int border_width; + Window sibling; + int stack_mode; +} XWindowChanges; + +/* + * Data structure used by color operations + */ +typedef struct { + unsigned long pixel; + unsigned short red, green, blue; + char flags; /* do_red, do_green, do_blue */ + char pad; +} XColor; + +/* + * Data structures for graphics operations. On most machines, these are + * congruent with the wire protocol structures, so reformatting the data + * can be avoided on these architectures. + */ +typedef struct { + short x1, y1, x2, y2; +} XSegment; + +typedef struct { + short x, y; +} XPoint; + +typedef struct { + short x, y; + unsigned short width, height; +} XRectangle; + +typedef struct { + short x, y; + unsigned short width, height; + short angle1, angle2; +} XArc; + + +/* Data structure for XChangeKeyboardControl */ + +typedef struct { + int key_click_percent; + int bell_percent; + int bell_pitch; + int bell_duration; + int led; + int led_mode; + int key; + int auto_repeat_mode; /* On, Off, Default */ +} XKeyboardControl; + +/* Data structure for XGetKeyboardControl */ + +typedef struct { + int key_click_percent; + int bell_percent; + unsigned int bell_pitch, bell_duration; + unsigned long led_mask; + int global_auto_repeat; + char auto_repeats[32]; +} XKeyboardState; + +/* Data structure for XGetMotionEvents. */ + +typedef struct { + Time time; + short x, y; +} XTimeCoord; + +/* Data structure for X{Set,Get}ModifierMapping */ + +typedef struct { + int max_keypermod; /* The server's max # of keys per modifier */ + KeyCode *modifiermap; /* An 8 by max_keypermod array of modifiers */ +} XModifierKeymap; + + +/* + * Display datatype maintaining display specific data. + * The contents of this structure are implementation dependent. + * A Display should be treated as opaque by application code. + */ +#ifndef XLIB_ILLEGAL_ACCESS +typedef struct _XDisplay Display; +#endif + +struct _XPrivate; /* Forward declare before use for C++ */ +struct _XrmHashBucketRec; + +typedef struct +#ifdef XLIB_ILLEGAL_ACCESS +_XDisplay +#endif +{ + XExtData *ext_data; /* hook for extension to hang data */ + struct _XPrivate *private1; + int fd; /* Network socket. */ + int private2; + int proto_major_version;/* major version of server's X protocol */ + int proto_minor_version;/* minor version of servers X protocol */ + char *vendor; /* vendor of the server hardware */ + XID private3; + XID private4; + XID private5; + int private6; + XID (*resource_alloc)( /* allocator function */ + struct _XDisplay* + ); + int byte_order; /* screen byte order, LSBFirst, MSBFirst */ + int bitmap_unit; /* padding and data requirements */ + int bitmap_pad; /* padding requirements on bitmaps */ + int bitmap_bit_order; /* LeastSignificant or MostSignificant */ + int nformats; /* number of pixmap formats in list */ + ScreenFormat *pixmap_format; /* pixmap format list */ + int private8; + int release; /* release of the server */ + struct _XPrivate *private9, *private10; + int qlen; /* Length of input event queue */ + unsigned long last_request_read; /* seq number of last event read */ + unsigned long request; /* sequence number of last request. */ + XPointer private11; + XPointer private12; + XPointer private13; + XPointer private14; + unsigned max_request_size; /* maximum number 32 bit words in request*/ + struct _XrmHashBucketRec *db; + int (*private15)( + struct _XDisplay* + ); + char *display_name; /* "host:display" string used on this connect*/ + int default_screen; /* default screen for operations */ + int nscreens; /* number of screens on this server*/ + Screen *screens; /* pointer to list of screens */ + unsigned long motion_buffer; /* size of motion buffer */ + unsigned long private16; + int min_keycode; /* minimum defined keycode */ + int max_keycode; /* maximum defined keycode */ + XPointer private17; + XPointer private18; + int private19; + char *xdefaults; /* contents of defaults from server */ + /* there is more to this structure, but it is private to Xlib */ +} +#ifdef XLIB_ILLEGAL_ACCESS +Display, +#endif +*_XPrivDisplay; + +#undef _XEVENT_ +#ifndef _XEVENT_ +/* + * Definitions of specific events. + */ +typedef struct { + int type; /* of event */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* "event" window it is reported relative to */ + Window root; /* root window that the event occurred on */ + Window subwindow; /* child window */ + Time time; /* milliseconds */ + int x, y; /* pointer x, y coordinates in event window */ + int x_root, y_root; /* coordinates relative to root */ + unsigned int state; /* key or button mask */ + unsigned int keycode; /* detail */ + Bool same_screen; /* same screen flag */ +} XKeyEvent; +typedef XKeyEvent XKeyPressedEvent; +typedef XKeyEvent XKeyReleasedEvent; + +typedef struct { + int type; /* of event */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* "event" window it is reported relative to */ + Window root; /* root window that the event occurred on */ + Window subwindow; /* child window */ + Time time; /* milliseconds */ + int x, y; /* pointer x, y coordinates in event window */ + int x_root, y_root; /* coordinates relative to root */ + unsigned int state; /* key or button mask */ + unsigned int button; /* detail */ + Bool same_screen; /* same screen flag */ +} XButtonEvent; +typedef XButtonEvent XButtonPressedEvent; +typedef XButtonEvent XButtonReleasedEvent; + +typedef struct { + int type; /* of event */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* "event" window reported relative to */ + Window root; /* root window that the event occurred on */ + Window subwindow; /* child window */ + Time time; /* milliseconds */ + int x, y; /* pointer x, y coordinates in event window */ + int x_root, y_root; /* coordinates relative to root */ + unsigned int state; /* key or button mask */ + char is_hint; /* detail */ + Bool same_screen; /* same screen flag */ +} XMotionEvent; +typedef XMotionEvent XPointerMovedEvent; + +typedef struct { + int type; /* of event */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* "event" window reported relative to */ + Window root; /* root window that the event occurred on */ + Window subwindow; /* child window */ + Time time; /* milliseconds */ + int x, y; /* pointer x, y coordinates in event window */ + int x_root, y_root; /* coordinates relative to root */ + int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */ + int detail; + /* + * NotifyAncestor, NotifyVirtual, NotifyInferior, + * NotifyNonlinear,NotifyNonlinearVirtual + */ + Bool same_screen; /* same screen flag */ + Bool focus; /* boolean focus */ + unsigned int state; /* key or button mask */ +} XCrossingEvent; +typedef XCrossingEvent XEnterWindowEvent; +typedef XCrossingEvent XLeaveWindowEvent; + +typedef struct { + int type; /* FocusIn or FocusOut */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* window of event */ + int mode; /* NotifyNormal, NotifyWhileGrabbed, + NotifyGrab, NotifyUngrab */ + int detail; + /* + * NotifyAncestor, NotifyVirtual, NotifyInferior, + * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer, + * NotifyPointerRoot, NotifyDetailNone + */ +} XFocusChangeEvent; +typedef XFocusChangeEvent XFocusInEvent; +typedef XFocusChangeEvent XFocusOutEvent; + +/* generated on EnterWindow and FocusIn when KeyMapState selected */ +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; + char key_vector[32]; +} XKeymapEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; + int x, y; + int width, height; + int count; /* if non-zero, at least this many more */ +} XExposeEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Drawable drawable; + int x, y; + int width, height; + int count; /* if non-zero, at least this many more */ + int major_code; /* core is CopyArea or CopyPlane */ + int minor_code; /* not defined in the core */ +} XGraphicsExposeEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Drawable drawable; + int major_code; /* core is CopyArea or CopyPlane */ + int minor_code; /* not defined in the core */ +} XNoExposeEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; + int state; /* Visibility state */ +} XVisibilityEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window parent; /* parent of the window */ + Window window; /* window id of window created */ + int x, y; /* window location */ + int width, height; /* size of window */ + int border_width; /* border width */ + Bool override_redirect; /* creation should be overridden */ +} XCreateWindowEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window event; + Window window; +} XDestroyWindowEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window event; + Window window; + Bool from_configure; +} XUnmapEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window event; + Window window; + Bool override_redirect; /* boolean, is override set... */ +} XMapEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window parent; + Window window; +} XMapRequestEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window event; + Window window; + Window parent; + int x, y; + Bool override_redirect; +} XReparentEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window event; + Window window; + int x, y; + int width, height; + int border_width; + Window above; + Bool override_redirect; +} XConfigureEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window event; + Window window; + int x, y; +} XGravityEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; + int width, height; +} XResizeRequestEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window parent; + Window window; + int x, y; + int width, height; + int border_width; + Window above; + int detail; /* Above, Below, TopIf, BottomIf, Opposite */ + unsigned long value_mask; +} XConfigureRequestEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window event; + Window window; + int place; /* PlaceOnTop, PlaceOnBottom */ +} XCirculateEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window parent; + Window window; + int place; /* PlaceOnTop, PlaceOnBottom */ +} XCirculateRequestEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; + Atom atom; + Time time; + int state; /* NewValue, Deleted */ +} XPropertyEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; + Atom selection; + Time time; +} XSelectionClearEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window owner; + Window requestor; + Atom selection; + Atom target; + Atom property; + Time time; +} XSelectionRequestEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window requestor; + Atom selection; + Atom target; + Atom property; /* ATOM or None */ + Time time; +} XSelectionEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; + Colormap colormap; /* COLORMAP or None */ +#if defined(__cplusplus) || defined(c_plusplus) + Bool c_new; /* C++ */ +#else + Bool new; +#endif + int state; /* ColormapInstalled, ColormapUninstalled */ +} XColormapEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; + Atom message_type; + int format; + union { + char b[20]; + short s[10]; + long l[5]; + } data; +} XClientMessageEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* unused */ + int request; /* one of MappingModifier, MappingKeyboard, + MappingPointer */ + int first_keycode; /* first keycode */ + int count; /* defines range of change w. first_keycode*/ +} XMappingEvent; + +typedef struct { + int type; + Display *display; /* Display the event was read from */ + XID resourceid; /* resource id */ + unsigned long serial; /* serial number of failed request */ + unsigned char error_code; /* error code of failed request */ + unsigned char request_code; /* Major op-code of failed request */ + unsigned char minor_code; /* Minor op-code of failed request */ +} XErrorEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display;/* Display the event was read from */ + Window window; /* window on which event was requested in event mask */ +} XAnyEvent; + + +/*************************************************************** + * + * GenericEvent. This event is the standard event for all newer extensions. + */ + +typedef struct + { + int type; /* of event. Always GenericEvent */ + unsigned long serial; /* # of last request processed */ + Bool send_event; /* true if from SendEvent request */ + Display *display; /* Display the event was read from */ + int extension; /* major opcode of extension that caused the event */ + int evtype; /* actual event type. */ + } XGenericEvent; + +typedef struct { + int type; /* of event. Always GenericEvent */ + unsigned long serial; /* # of last request processed */ + Bool send_event; /* true if from SendEvent request */ + Display *display; /* Display the event was read from */ + int extension; /* major opcode of extension that caused the event */ + int evtype; /* actual event type. */ + unsigned int cookie; + void *data; +} XGenericEventCookie; + +/* + * this union is defined so Xlib can always use the same sized + * event structure internally, to avoid memory fragmentation. + */ +typedef union _XEvent { + int type; /* must not be changed; first element */ + XAnyEvent xany; + XKeyEvent xkey; + XButtonEvent xbutton; + XMotionEvent xmotion; + XCrossingEvent xcrossing; + XFocusChangeEvent xfocus; + XExposeEvent xexpose; + XGraphicsExposeEvent xgraphicsexpose; + XNoExposeEvent xnoexpose; + XVisibilityEvent xvisibility; + XCreateWindowEvent xcreatewindow; + XDestroyWindowEvent xdestroywindow; + XUnmapEvent xunmap; + XMapEvent xmap; + XMapRequestEvent xmaprequest; + XReparentEvent xreparent; + XConfigureEvent xconfigure; + XGravityEvent xgravity; + XResizeRequestEvent xresizerequest; + XConfigureRequestEvent xconfigurerequest; + XCirculateEvent xcirculate; + XCirculateRequestEvent xcirculaterequest; + XPropertyEvent xproperty; + XSelectionClearEvent xselectionclear; + XSelectionRequestEvent xselectionrequest; + XSelectionEvent xselection; + XColormapEvent xcolormap; + XClientMessageEvent xclient; + XMappingEvent xmapping; + XErrorEvent xerror; + XKeymapEvent xkeymap; + XGenericEvent xgeneric; + XGenericEventCookie xcookie; + long pad[24]; +} XEvent; +#endif + +#define XAllocID(dpy) ((*((_XPrivDisplay)dpy)->resource_alloc)((dpy))) + +/* + * per character font metric information. + */ +typedef struct { + short lbearing; /* origin to left edge of raster */ + short rbearing; /* origin to right edge of raster */ + short width; /* advance to next char's origin */ + short ascent; /* baseline to top edge of raster */ + short descent; /* baseline to bottom edge of raster */ + unsigned short attributes; /* per char flags (not predefined) */ +} XCharStruct; + +/* + * To allow arbitrary information with fonts, there are additional properties + * returned. + */ +typedef struct { + Atom name; + unsigned long card32; +} XFontProp; + +typedef struct { + XExtData *ext_data; /* hook for extension to hang data */ + Font fid; /* Font id for this font */ + unsigned direction; /* hint about direction the font is painted */ + unsigned min_char_or_byte2;/* first character */ + unsigned max_char_or_byte2;/* last character */ + unsigned min_byte1; /* first row that exists */ + unsigned max_byte1; /* last row that exists */ + Bool all_chars_exist;/* flag if all characters have non-zero size*/ + unsigned default_char; /* char to print for undefined character */ + int n_properties; /* how many properties there are */ + XFontProp *properties; /* pointer to array of additional properties*/ + XCharStruct min_bounds; /* minimum bounds over all existing char*/ + XCharStruct max_bounds; /* maximum bounds over all existing char*/ + XCharStruct *per_char; /* first_char to last_char information */ + int ascent; /* log. extent above baseline for spacing */ + int descent; /* log. descent below baseline for spacing */ +} XFontStruct; + +/* + * PolyText routines take these as arguments. + */ +typedef struct { + char *chars; /* pointer to string */ + int nchars; /* number of characters */ + int delta; /* delta between strings */ + Font font; /* font to print it in, None don't change */ +} XTextItem; + +typedef struct { /* normal 16 bit characters are two bytes */ + unsigned char byte1; + unsigned char byte2; +} XChar2b; + +typedef struct { + XChar2b *chars; /* two byte characters */ + int nchars; /* number of characters */ + int delta; /* delta between strings */ + Font font; /* font to print it in, None don't change */ +} XTextItem16; + + +typedef union { Display *display; + GC gc; + Visual *visual; + Screen *screen; + ScreenFormat *pixmap_format; + XFontStruct *font; } XEDataObject; + +typedef struct { + XRectangle max_ink_extent; + XRectangle max_logical_extent; +} XFontSetExtents; + +/* unused: +typedef void (*XOMProc)(); + */ + +typedef struct _XOM *XOM; +typedef struct _XOC *XOC, *XFontSet; + +typedef struct { + char *chars; + int nchars; + int delta; + XFontSet font_set; +} XmbTextItem; + +typedef struct { + wchar_t *chars; + int nchars; + int delta; + XFontSet font_set; +} XwcTextItem; + +#define XNRequiredCharSet "requiredCharSet" +#define XNQueryOrientation "queryOrientation" +#define XNBaseFontName "baseFontName" +#define XNOMAutomatic "omAutomatic" +#define XNMissingCharSet "missingCharSet" +#define XNDefaultString "defaultString" +#define XNOrientation "orientation" +#define XNDirectionalDependentDrawing "directionalDependentDrawing" +#define XNContextualDrawing "contextualDrawing" +#define XNFontInfo "fontInfo" + +typedef struct { + int charset_count; + char **charset_list; +} XOMCharSetList; + +typedef enum { + XOMOrientation_LTR_TTB, + XOMOrientation_RTL_TTB, + XOMOrientation_TTB_LTR, + XOMOrientation_TTB_RTL, + XOMOrientation_Context +} XOrientation; + +typedef struct { + int num_orientation; + XOrientation *orientation; /* Input Text description */ +} XOMOrientation; + +typedef struct { + int num_font; + XFontStruct **font_struct_list; + char **font_name_list; +} XOMFontInfo; + +typedef struct _XIM *XIM; +typedef struct _XIC *XIC; + +typedef void (*XIMProc)( + XIM, + XPointer, + XPointer +); + +typedef Bool (*XICProc)( + XIC, + XPointer, + XPointer +); + +typedef void (*XIDProc)( + Display*, + XPointer, + XPointer +); + +typedef unsigned long XIMStyle; + +typedef struct { + unsigned short count_styles; + XIMStyle *supported_styles; +} XIMStyles; + +#define XIMPreeditArea 0x0001L +#define XIMPreeditCallbacks 0x0002L +#define XIMPreeditPosition 0x0004L +#define XIMPreeditNothing 0x0008L +#define XIMPreeditNone 0x0010L +#define XIMStatusArea 0x0100L +#define XIMStatusCallbacks 0x0200L +#define XIMStatusNothing 0x0400L +#define XIMStatusNone 0x0800L + +#define XNVaNestedList "XNVaNestedList" +#define XNQueryInputStyle "queryInputStyle" +#define XNClientWindow "clientWindow" +#define XNInputStyle "inputStyle" +#define XNFocusWindow "focusWindow" +#define XNResourceName "resourceName" +#define XNResourceClass "resourceClass" +#define XNGeometryCallback "geometryCallback" +#define XNDestroyCallback "destroyCallback" +#define XNFilterEvents "filterEvents" +#define XNPreeditStartCallback "preeditStartCallback" +#define XNPreeditDoneCallback "preeditDoneCallback" +#define XNPreeditDrawCallback "preeditDrawCallback" +#define XNPreeditCaretCallback "preeditCaretCallback" +#define XNPreeditStateNotifyCallback "preeditStateNotifyCallback" +#define XNPreeditAttributes "preeditAttributes" +#define XNStatusStartCallback "statusStartCallback" +#define XNStatusDoneCallback "statusDoneCallback" +#define XNStatusDrawCallback "statusDrawCallback" +#define XNStatusAttributes "statusAttributes" +#define XNArea "area" +#define XNAreaNeeded "areaNeeded" +#define XNSpotLocation "spotLocation" +#define XNColormap "colorMap" +#define XNStdColormap "stdColorMap" +#define XNForeground "foreground" +#define XNBackground "background" +#define XNBackgroundPixmap "backgroundPixmap" +#define XNFontSet "fontSet" +#define XNLineSpace "lineSpace" +#define XNCursor "cursor" + +#define XNQueryIMValuesList "queryIMValuesList" +#define XNQueryICValuesList "queryICValuesList" +#define XNVisiblePosition "visiblePosition" +#define XNR6PreeditCallback "r6PreeditCallback" +#define XNStringConversionCallback "stringConversionCallback" +#define XNStringConversion "stringConversion" +#define XNResetState "resetState" +#define XNHotKey "hotKey" +#define XNHotKeyState "hotKeyState" +#define XNPreeditState "preeditState" +#define XNSeparatorofNestedList "separatorofNestedList" + +#define XBufferOverflow -1 +#define XLookupNone 1 +#define XLookupChars 2 +#define XLookupKeySym 3 +#define XLookupBoth 4 + +typedef void *XVaNestedList; + +typedef struct { + XPointer client_data; + XIMProc callback; +} XIMCallback; + +typedef struct { + XPointer client_data; + XICProc callback; +} XICCallback; + +typedef unsigned long XIMFeedback; + +#define XIMReverse 1L +#define XIMUnderline (1L<<1) +#define XIMHighlight (1L<<2) +#define XIMPrimary (1L<<5) +#define XIMSecondary (1L<<6) +#define XIMTertiary (1L<<7) +#define XIMVisibleToForward (1L<<8) +#define XIMVisibleToBackword (1L<<9) +#define XIMVisibleToCenter (1L<<10) + +typedef struct _XIMText { + unsigned short length; + XIMFeedback *feedback; + Bool encoding_is_wchar; + union { + char *multi_byte; + wchar_t *wide_char; + } string; +} XIMText; + +typedef unsigned long XIMPreeditState; + +#define XIMPreeditUnKnown 0L +#define XIMPreeditEnable 1L +#define XIMPreeditDisable (1L<<1) + +typedef struct _XIMPreeditStateNotifyCallbackStruct { + XIMPreeditState state; +} XIMPreeditStateNotifyCallbackStruct; + +typedef unsigned long XIMResetState; + +#define XIMInitialState 1L +#define XIMPreserveState (1L<<1) + +typedef unsigned long XIMStringConversionFeedback; + +#define XIMStringConversionLeftEdge (0x00000001) +#define XIMStringConversionRightEdge (0x00000002) +#define XIMStringConversionTopEdge (0x00000004) +#define XIMStringConversionBottomEdge (0x00000008) +#define XIMStringConversionConcealed (0x00000010) +#define XIMStringConversionWrapped (0x00000020) + +typedef struct _XIMStringConversionText { + unsigned short length; + XIMStringConversionFeedback *feedback; + Bool encoding_is_wchar; + union { + char *mbs; + wchar_t *wcs; + } string; +} XIMStringConversionText; + +typedef unsigned short XIMStringConversionPosition; + +typedef unsigned short XIMStringConversionType; + +#define XIMStringConversionBuffer (0x0001) +#define XIMStringConversionLine (0x0002) +#define XIMStringConversionWord (0x0003) +#define XIMStringConversionChar (0x0004) + +typedef unsigned short XIMStringConversionOperation; + +#define XIMStringConversionSubstitution (0x0001) +#define XIMStringConversionRetrieval (0x0002) + +typedef enum { + XIMForwardChar, XIMBackwardChar, + XIMForwardWord, XIMBackwardWord, + XIMCaretUp, XIMCaretDown, + XIMNextLine, XIMPreviousLine, + XIMLineStart, XIMLineEnd, + XIMAbsolutePosition, + XIMDontChange +} XIMCaretDirection; + +typedef struct _XIMStringConversionCallbackStruct { + XIMStringConversionPosition position; + XIMCaretDirection direction; + XIMStringConversionOperation operation; + unsigned short factor; + XIMStringConversionText *text; +} XIMStringConversionCallbackStruct; + +typedef struct _XIMPreeditDrawCallbackStruct { + int caret; /* Cursor offset within pre-edit string */ + int chg_first; /* Starting change position */ + int chg_length; /* Length of the change in character count */ + XIMText *text; +} XIMPreeditDrawCallbackStruct; + +typedef enum { + XIMIsInvisible, /* Disable caret feedback */ + XIMIsPrimary, /* UI defined caret feedback */ + XIMIsSecondary /* UI defined caret feedback */ +} XIMCaretStyle; + +typedef struct _XIMPreeditCaretCallbackStruct { + int position; /* Caret offset within pre-edit string */ + XIMCaretDirection direction; /* Caret moves direction */ + XIMCaretStyle style; /* Feedback of the caret */ +} XIMPreeditCaretCallbackStruct; + +typedef enum { + XIMTextType, + XIMBitmapType +} XIMStatusDataType; + +typedef struct _XIMStatusDrawCallbackStruct { + XIMStatusDataType type; + union { + XIMText *text; + Pixmap bitmap; + } data; +} XIMStatusDrawCallbackStruct; + +typedef struct _XIMHotKeyTrigger { + KeySym keysym; + int modifier; + int modifier_mask; +} XIMHotKeyTrigger; + +typedef struct _XIMHotKeyTriggers { + int num_hot_key; + XIMHotKeyTrigger *key; +} XIMHotKeyTriggers; + +typedef unsigned long XIMHotKeyState; + +#define XIMHotKeyStateON (0x0001L) +#define XIMHotKeyStateOFF (0x0002L) + +typedef struct { + unsigned short count_values; + char **supported_values; +} XIMValuesList; + +_XFUNCPROTOBEGIN + +#if defined(WIN32) && !defined(_XLIBINT_) +#define _Xdebug (*_Xdebug_p) +#endif + +extern int _Xdebug; + +extern XFontStruct *XLoadQueryFont( + Display* /* display */, + _Xconst char* /* name */ +); + +extern XFontStruct *XQueryFont( + Display* /* display */, + XID /* font_ID */ +); + + +extern XTimeCoord *XGetMotionEvents( + Display* /* display */, + Window /* w */, + Time /* start */, + Time /* stop */, + int* /* nevents_return */ +); + +extern XModifierKeymap *XDeleteModifiermapEntry( + XModifierKeymap* /* modmap */, +#if NeedWidePrototypes + unsigned int /* keycode_entry */, +#else + KeyCode /* keycode_entry */, +#endif + int /* modifier */ +); + +extern XModifierKeymap *XGetModifierMapping( + Display* /* display */ +); + +extern XModifierKeymap *XInsertModifiermapEntry( + XModifierKeymap* /* modmap */, +#if NeedWidePrototypes + unsigned int /* keycode_entry */, +#else + KeyCode /* keycode_entry */, +#endif + int /* modifier */ +); + +extern XModifierKeymap *XNewModifiermap( + int /* max_keys_per_mod */ +); + +extern XImage *XCreateImage( + Display* /* display */, + Visual* /* visual */, + unsigned int /* depth */, + int /* format */, + int /* offset */, + char* /* data */, + unsigned int /* width */, + unsigned int /* height */, + int /* bitmap_pad */, + int /* bytes_per_line */ +); +extern Status XInitImage( + XImage* /* image */ +); +extern XImage *XGetImage( + Display* /* display */, + Drawable /* d */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */, + unsigned long /* plane_mask */, + int /* format */ +); +extern XImage *XGetSubImage( + Display* /* display */, + Drawable /* d */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */, + unsigned long /* plane_mask */, + int /* format */, + XImage* /* dest_image */, + int /* dest_x */, + int /* dest_y */ +); + +/* + * X function declarations. + */ +extern Display *XOpenDisplay( + _Xconst char* /* display_name */ +); + +extern void XrmInitialize( + void +); + +extern char *XFetchBytes( + Display* /* display */, + int* /* nbytes_return */ +); +extern char *XFetchBuffer( + Display* /* display */, + int* /* nbytes_return */, + int /* buffer */ +); +extern char *XGetAtomName( + Display* /* display */, + Atom /* atom */ +); +extern Status XGetAtomNames( + Display* /* dpy */, + Atom* /* atoms */, + int /* count */, + char** /* names_return */ +); +extern char *XGetDefault( + Display* /* display */, + _Xconst char* /* program */, + _Xconst char* /* option */ +); +extern char *XDisplayName( + _Xconst char* /* string */ +); +extern char *XKeysymToString( + KeySym /* keysym */ +); + +extern int (*XSynchronize( + Display* /* display */, + Bool /* onoff */ +))( + Display* /* display */ +); +extern int (*XSetAfterFunction( + Display* /* display */, + int (*) ( + Display* /* display */ + ) /* procedure */ +))( + Display* /* display */ +); +extern Atom XInternAtom( + Display* /* display */, + _Xconst char* /* atom_name */, + Bool /* only_if_exists */ +); +extern Status XInternAtoms( + Display* /* dpy */, + char** /* names */, + int /* count */, + Bool /* onlyIfExists */, + Atom* /* atoms_return */ +); +extern Colormap XCopyColormapAndFree( + Display* /* display */, + Colormap /* colormap */ +); +extern Colormap XCreateColormap( + Display* /* display */, + Window /* w */, + Visual* /* visual */, + int /* alloc */ +); +extern Cursor XCreatePixmapCursor( + Display* /* display */, + Pixmap /* source */, + Pixmap /* mask */, + XColor* /* foreground_color */, + XColor* /* background_color */, + unsigned int /* x */, + unsigned int /* y */ +); +extern Cursor XCreateGlyphCursor( + Display* /* display */, + Font /* source_font */, + Font /* mask_font */, + unsigned int /* source_char */, + unsigned int /* mask_char */, + XColor _Xconst * /* foreground_color */, + XColor _Xconst * /* background_color */ +); +extern Cursor XCreateFontCursor( + Display* /* display */, + unsigned int /* shape */ +); +extern Font XLoadFont( + Display* /* display */, + _Xconst char* /* name */ +); +extern GC XCreateGC( + Display* /* display */, + Drawable /* d */, + unsigned long /* valuemask */, + XGCValues* /* values */ +); +extern GContext XGContextFromGC( + GC /* gc */ +); +extern void XFlushGC( + Display* /* display */, + GC /* gc */ +); +extern Pixmap XCreatePixmap( + Display* /* display */, + Drawable /* d */, + unsigned int /* width */, + unsigned int /* height */, + unsigned int /* depth */ +); +extern Pixmap XCreateBitmapFromData( + Display* /* display */, + Drawable /* d */, + _Xconst char* /* data */, + unsigned int /* width */, + unsigned int /* height */ +); +extern Pixmap XCreatePixmapFromBitmapData( + Display* /* display */, + Drawable /* d */, + char* /* data */, + unsigned int /* width */, + unsigned int /* height */, + unsigned long /* fg */, + unsigned long /* bg */, + unsigned int /* depth */ +); +extern Window XCreateSimpleWindow( + Display* /* display */, + Window /* parent */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */, + unsigned int /* border_width */, + unsigned long /* border */, + unsigned long /* background */ +); +extern Window XGetSelectionOwner( + Display* /* display */, + Atom /* selection */ +); +extern Window XCreateWindow( + Display* /* display */, + Window /* parent */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */, + unsigned int /* border_width */, + int /* depth */, + unsigned int /* class */, + Visual* /* visual */, + unsigned long /* valuemask */, + XSetWindowAttributes* /* attributes */ +); +extern Colormap *XListInstalledColormaps( + Display* /* display */, + Window /* w */, + int* /* num_return */ +); +extern char **XListFonts( + Display* /* display */, + _Xconst char* /* pattern */, + int /* maxnames */, + int* /* actual_count_return */ +); +extern char **XListFontsWithInfo( + Display* /* display */, + _Xconst char* /* pattern */, + int /* maxnames */, + int* /* count_return */, + XFontStruct** /* info_return */ +); +extern char **XGetFontPath( + Display* /* display */, + int* /* npaths_return */ +); +extern char **XListExtensions( + Display* /* display */, + int* /* nextensions_return */ +); +extern Atom *XListProperties( + Display* /* display */, + Window /* w */, + int* /* num_prop_return */ +); +extern XHostAddress *XListHosts( + Display* /* display */, + int* /* nhosts_return */, + Bool* /* state_return */ +); +extern KeySym XKeycodeToKeysym( + Display* /* display */, +#if NeedWidePrototypes + unsigned int /* keycode */, +#else + KeyCode /* keycode */, +#endif + int /* index */ +); +extern KeySym XLookupKeysym( + XKeyEvent* /* key_event */, + int /* index */ +); +extern KeySym *XGetKeyboardMapping( + Display* /* display */, +#if NeedWidePrototypes + unsigned int /* first_keycode */, +#else + KeyCode /* first_keycode */, +#endif + int /* keycode_count */, + int* /* keysyms_per_keycode_return */ +); +extern KeySym XStringToKeysym( + _Xconst char* /* string */ +); +extern long XMaxRequestSize( + Display* /* display */ +); +extern long XExtendedMaxRequestSize( + Display* /* display */ +); +extern char *XResourceManagerString( + Display* /* display */ +); +extern char *XScreenResourceString( + Screen* /* screen */ +); +extern unsigned long XDisplayMotionBufferSize( + Display* /* display */ +); +extern VisualID XVisualIDFromVisual( + Visual* /* visual */ +); + +/* multithread routines */ + +extern Status XInitThreads( + void +); + +extern void XLockDisplay( + Display* /* display */ +); + +extern void XUnlockDisplay( + Display* /* display */ +); + +/* routines for dealing with extensions */ + +extern XExtCodes *XInitExtension( + Display* /* display */, + _Xconst char* /* name */ +); + +extern XExtCodes *XAddExtension( + Display* /* display */ +); +extern XExtData *XFindOnExtensionList( + XExtData** /* structure */, + int /* number */ +); +extern XExtData **XEHeadOfExtensionList( + XEDataObject /* object */ +); + +/* these are routines for which there are also macros */ +extern Window XRootWindow( + Display* /* display */, + int /* screen_number */ +); +extern Window XDefaultRootWindow( + Display* /* display */ +); +extern Window XRootWindowOfScreen( + Screen* /* screen */ +); +extern Visual *XDefaultVisual( + Display* /* display */, + int /* screen_number */ +); +extern Visual *XDefaultVisualOfScreen( + Screen* /* screen */ +); +extern GC XDefaultGC( + Display* /* display */, + int /* screen_number */ +); +extern GC XDefaultGCOfScreen( + Screen* /* screen */ +); +extern unsigned long XBlackPixel( + Display* /* display */, + int /* screen_number */ +); +extern unsigned long XWhitePixel( + Display* /* display */, + int /* screen_number */ +); +extern unsigned long XAllPlanes( + void +); +extern unsigned long XBlackPixelOfScreen( + Screen* /* screen */ +); +extern unsigned long XWhitePixelOfScreen( + Screen* /* screen */ +); +extern unsigned long XNextRequest( + Display* /* display */ +); +extern unsigned long XLastKnownRequestProcessed( + Display* /* display */ +); +extern char *XServerVendor( + Display* /* display */ +); +extern char *XDisplayString( + Display* /* display */ +); +extern Colormap XDefaultColormap( + Display* /* display */, + int /* screen_number */ +); +extern Colormap XDefaultColormapOfScreen( + Screen* /* screen */ +); +extern Display *XDisplayOfScreen( + Screen* /* screen */ +); +extern Screen *XScreenOfDisplay( + Display* /* display */, + int /* screen_number */ +); +extern Screen *XDefaultScreenOfDisplay( + Display* /* display */ +); +extern long XEventMaskOfScreen( + Screen* /* screen */ +); + +extern int XScreenNumberOfScreen( + Screen* /* screen */ +); + +typedef int (*XErrorHandler) ( /* WARNING, this type not in Xlib spec */ + Display* /* display */, + XErrorEvent* /* error_event */ +); + +extern XErrorHandler XSetErrorHandler ( + XErrorHandler /* handler */ +); + + +typedef int (*XIOErrorHandler) ( /* WARNING, this type not in Xlib spec */ + Display* /* display */ +); + +extern XIOErrorHandler XSetIOErrorHandler ( + XIOErrorHandler /* handler */ +); + + +extern XPixmapFormatValues *XListPixmapFormats( + Display* /* display */, + int* /* count_return */ +); +extern int *XListDepths( + Display* /* display */, + int /* screen_number */, + int* /* count_return */ +); + +/* ICCCM routines for things that don't require special include files; */ +/* other declarations are given in Xutil.h */ +extern Status XReconfigureWMWindow( + Display* /* display */, + Window /* w */, + int /* screen_number */, + unsigned int /* mask */, + XWindowChanges* /* changes */ +); + +extern Status XGetWMProtocols( + Display* /* display */, + Window /* w */, + Atom** /* protocols_return */, + int* /* count_return */ +); +extern Status XSetWMProtocols( + Display* /* display */, + Window /* w */, + Atom* /* protocols */, + int /* count */ +); +extern Status XIconifyWindow( + Display* /* display */, + Window /* w */, + int /* screen_number */ +); +extern Status XWithdrawWindow( + Display* /* display */, + Window /* w */, + int /* screen_number */ +); +extern Status XGetCommand( + Display* /* display */, + Window /* w */, + char*** /* argv_return */, + int* /* argc_return */ +); +extern Status XGetWMColormapWindows( + Display* /* display */, + Window /* w */, + Window** /* windows_return */, + int* /* count_return */ +); +extern Status XSetWMColormapWindows( + Display* /* display */, + Window /* w */, + Window* /* colormap_windows */, + int /* count */ +); +extern void XFreeStringList( + char** /* list */ +); +extern int XSetTransientForHint( + Display* /* display */, + Window /* w */, + Window /* prop_window */ +); + +/* The following are given in alphabetical order */ + +extern int XActivateScreenSaver( + Display* /* display */ +); + +extern int XAddHost( + Display* /* display */, + XHostAddress* /* host */ +); + +extern int XAddHosts( + Display* /* display */, + XHostAddress* /* hosts */, + int /* num_hosts */ +); + +extern int XAddToExtensionList( + struct _XExtData** /* structure */, + XExtData* /* ext_data */ +); + +extern int XAddToSaveSet( + Display* /* display */, + Window /* w */ +); + +extern Status XAllocColor( + Display* /* display */, + Colormap /* colormap */, + XColor* /* screen_in_out */ +); + +extern Status XAllocColorCells( + Display* /* display */, + Colormap /* colormap */, + Bool /* contig */, + unsigned long* /* plane_masks_return */, + unsigned int /* nplanes */, + unsigned long* /* pixels_return */, + unsigned int /* npixels */ +); + +extern Status XAllocColorPlanes( + Display* /* display */, + Colormap /* colormap */, + Bool /* contig */, + unsigned long* /* pixels_return */, + int /* ncolors */, + int /* nreds */, + int /* ngreens */, + int /* nblues */, + unsigned long* /* rmask_return */, + unsigned long* /* gmask_return */, + unsigned long* /* bmask_return */ +); + +extern Status XAllocNamedColor( + Display* /* display */, + Colormap /* colormap */, + _Xconst char* /* color_name */, + XColor* /* screen_def_return */, + XColor* /* exact_def_return */ +); + +extern int XAllowEvents( + Display* /* display */, + int /* event_mode */, + Time /* time */ +); + +extern int XAutoRepeatOff( + Display* /* display */ +); + +extern int XAutoRepeatOn( + Display* /* display */ +); + +extern int XBell( + Display* /* display */, + int /* percent */ +); + +extern int XBitmapBitOrder( + Display* /* display */ +); + +extern int XBitmapPad( + Display* /* display */ +); + +extern int XBitmapUnit( + Display* /* display */ +); + +extern int XCellsOfScreen( + Screen* /* screen */ +); + +extern int XChangeActivePointerGrab( + Display* /* display */, + unsigned int /* event_mask */, + Cursor /* cursor */, + Time /* time */ +); + +extern int XChangeGC( + Display* /* display */, + GC /* gc */, + unsigned long /* valuemask */, + XGCValues* /* values */ +); + +extern int XChangeKeyboardControl( + Display* /* display */, + unsigned long /* value_mask */, + XKeyboardControl* /* values */ +); + +extern int XChangeKeyboardMapping( + Display* /* display */, + int /* first_keycode */, + int /* keysyms_per_keycode */, + KeySym* /* keysyms */, + int /* num_codes */ +); + +extern int XChangePointerControl( + Display* /* display */, + Bool /* do_accel */, + Bool /* do_threshold */, + int /* accel_numerator */, + int /* accel_denominator */, + int /* threshold */ +); + +extern int XChangeProperty( + Display* /* display */, + Window /* w */, + Atom /* property */, + Atom /* type */, + int /* format */, + int /* mode */, + _Xconst unsigned char* /* data */, + int /* nelements */ +); + +extern int XChangeSaveSet( + Display* /* display */, + Window /* w */, + int /* change_mode */ +); + +extern int XChangeWindowAttributes( + Display* /* display */, + Window /* w */, + unsigned long /* valuemask */, + XSetWindowAttributes* /* attributes */ +); + +extern Bool XCheckIfEvent( + Display* /* display */, + XEvent* /* event_return */, + Bool (*) ( + Display* /* display */, + XEvent* /* event */, + XPointer /* arg */ + ) /* predicate */, + XPointer /* arg */ +); + +extern Bool XCheckMaskEvent( + Display* /* display */, + long /* event_mask */, + XEvent* /* event_return */ +); + +extern Bool XCheckTypedEvent( + Display* /* display */, + int /* event_type */, + XEvent* /* event_return */ +); + +extern Bool XCheckTypedWindowEvent( + Display* /* display */, + Window /* w */, + int /* event_type */, + XEvent* /* event_return */ +); + +extern Bool XCheckWindowEvent( + Display* /* display */, + Window /* w */, + long /* event_mask */, + XEvent* /* event_return */ +); + +extern int XCirculateSubwindows( + Display* /* display */, + Window /* w */, + int /* direction */ +); + +extern int XCirculateSubwindowsDown( + Display* /* display */, + Window /* w */ +); + +extern int XCirculateSubwindowsUp( + Display* /* display */, + Window /* w */ +); + +extern int XClearArea( + Display* /* display */, + Window /* w */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */, + Bool /* exposures */ +); + +extern int XClearWindow( + Display* /* display */, + Window /* w */ +); + +extern int XCloseDisplay( + Display* /* display */ +); + +extern int XConfigureWindow( + Display* /* display */, + Window /* w */, + unsigned int /* value_mask */, + XWindowChanges* /* values */ +); + +extern int XConnectionNumber( + Display* /* display */ +); + +extern int XConvertSelection( + Display* /* display */, + Atom /* selection */, + Atom /* target */, + Atom /* property */, + Window /* requestor */, + Time /* time */ +); + +extern int XCopyArea( + Display* /* display */, + Drawable /* src */, + Drawable /* dest */, + GC /* gc */, + int /* src_x */, + int /* src_y */, + unsigned int /* width */, + unsigned int /* height */, + int /* dest_x */, + int /* dest_y */ +); + +extern int XCopyGC( + Display* /* display */, + GC /* src */, + unsigned long /* valuemask */, + GC /* dest */ +); + +extern int XCopyPlane( + Display* /* display */, + Drawable /* src */, + Drawable /* dest */, + GC /* gc */, + int /* src_x */, + int /* src_y */, + unsigned int /* width */, + unsigned int /* height */, + int /* dest_x */, + int /* dest_y */, + unsigned long /* plane */ +); + +extern int XDefaultDepth( + Display* /* display */, + int /* screen_number */ +); + +extern int XDefaultDepthOfScreen( + Screen* /* screen */ +); + +extern int XDefaultScreen( + Display* /* display */ +); + +extern int XDefineCursor( + Display* /* display */, + Window /* w */, + Cursor /* cursor */ +); + +extern int XDeleteProperty( + Display* /* display */, + Window /* w */, + Atom /* property */ +); + +extern int XDestroyWindow( + Display* /* display */, + Window /* w */ +); + +extern int XDestroySubwindows( + Display* /* display */, + Window /* w */ +); + +extern int XDoesBackingStore( + Screen* /* screen */ +); + +extern Bool XDoesSaveUnders( + Screen* /* screen */ +); + +extern int XDisableAccessControl( + Display* /* display */ +); + + +extern int XDisplayCells( + Display* /* display */, + int /* screen_number */ +); + +extern int XDisplayHeight( + Display* /* display */, + int /* screen_number */ +); + +extern int XDisplayHeightMM( + Display* /* display */, + int /* screen_number */ +); + +extern int XDisplayKeycodes( + Display* /* display */, + int* /* min_keycodes_return */, + int* /* max_keycodes_return */ +); + +extern int XDisplayPlanes( + Display* /* display */, + int /* screen_number */ +); + +extern int XDisplayWidth( + Display* /* display */, + int /* screen_number */ +); + +extern int XDisplayWidthMM( + Display* /* display */, + int /* screen_number */ +); + +extern int XDrawArc( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */, + int /* angle1 */, + int /* angle2 */ +); + +extern int XDrawArcs( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + XArc* /* arcs */, + int /* narcs */ +); + +extern int XDrawImageString( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst char* /* string */, + int /* length */ +); + +extern int XDrawImageString16( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst XChar2b* /* string */, + int /* length */ +); + +extern int XDrawLine( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x1 */, + int /* y1 */, + int /* x2 */, + int /* y2 */ +); + +extern int XDrawLines( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + XPoint* /* points */, + int /* npoints */, + int /* mode */ +); + +extern int XDrawPoint( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */ +); + +extern int XDrawPoints( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + XPoint* /* points */, + int /* npoints */, + int /* mode */ +); + +extern int XDrawRectangle( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */ +); + +extern int XDrawRectangles( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + XRectangle* /* rectangles */, + int /* nrectangles */ +); + +extern int XDrawSegments( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + XSegment* /* segments */, + int /* nsegments */ +); + +extern int XDrawString( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst char* /* string */, + int /* length */ +); + +extern int XDrawString16( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst XChar2b* /* string */, + int /* length */ +); + +extern int XDrawText( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + XTextItem* /* items */, + int /* nitems */ +); + +extern int XDrawText16( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + XTextItem16* /* items */, + int /* nitems */ +); + +extern int XEnableAccessControl( + Display* /* display */ +); + +extern int XEventsQueued( + Display* /* display */, + int /* mode */ +); + +extern Status XFetchName( + Display* /* display */, + Window /* w */, + char** /* window_name_return */ +); + +extern int XFillArc( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */, + int /* angle1 */, + int /* angle2 */ +); + +extern int XFillArcs( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + XArc* /* arcs */, + int /* narcs */ +); + +extern int XFillPolygon( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + XPoint* /* points */, + int /* npoints */, + int /* shape */, + int /* mode */ +); + +extern int XFillRectangle( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */ +); + +extern int XFillRectangles( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + XRectangle* /* rectangles */, + int /* nrectangles */ +); + +extern int XFlush( + Display* /* display */ +); + +extern int XForceScreenSaver( + Display* /* display */, + int /* mode */ +); + +extern int XFree( + void* /* data */ +); + +extern int XFreeColormap( + Display* /* display */, + Colormap /* colormap */ +); + +extern int XFreeColors( + Display* /* display */, + Colormap /* colormap */, + unsigned long* /* pixels */, + int /* npixels */, + unsigned long /* planes */ +); + +extern int XFreeCursor( + Display* /* display */, + Cursor /* cursor */ +); + +extern int XFreeExtensionList( + char** /* list */ +); + +extern int XFreeFont( + Display* /* display */, + XFontStruct* /* font_struct */ +); + +extern int XFreeFontInfo( + char** /* names */, + XFontStruct* /* free_info */, + int /* actual_count */ +); + +extern int XFreeFontNames( + char** /* list */ +); + +extern int XFreeFontPath( + char** /* list */ +); + +extern int XFreeGC( + Display* /* display */, + GC /* gc */ +); + +extern int XFreeModifiermap( + XModifierKeymap* /* modmap */ +); + +extern int XFreePixmap( + Display* /* display */, + Pixmap /* pixmap */ +); + +extern int XGeometry( + Display* /* display */, + int /* screen */, + _Xconst char* /* position */, + _Xconst char* /* default_position */, + unsigned int /* bwidth */, + unsigned int /* fwidth */, + unsigned int /* fheight */, + int /* xadder */, + int /* yadder */, + int* /* x_return */, + int* /* y_return */, + int* /* width_return */, + int* /* height_return */ +); + +extern int XGetErrorDatabaseText( + Display* /* display */, + _Xconst char* /* name */, + _Xconst char* /* message */, + _Xconst char* /* default_string */, + char* /* buffer_return */, + int /* length */ +); + +extern int XGetErrorText( + Display* /* display */, + int /* code */, + char* /* buffer_return */, + int /* length */ +); + +extern Bool XGetFontProperty( + XFontStruct* /* font_struct */, + Atom /* atom */, + unsigned long* /* value_return */ +); + +extern Status XGetGCValues( + Display* /* display */, + GC /* gc */, + unsigned long /* valuemask */, + XGCValues* /* values_return */ +); + +extern Status XGetGeometry( + Display* /* display */, + Drawable /* d */, + Window* /* root_return */, + int* /* x_return */, + int* /* y_return */, + unsigned int* /* width_return */, + unsigned int* /* height_return */, + unsigned int* /* border_width_return */, + unsigned int* /* depth_return */ +); + +extern Status XGetIconName( + Display* /* display */, + Window /* w */, + char** /* icon_name_return */ +); + +extern int XGetInputFocus( + Display* /* display */, + Window* /* focus_return */, + int* /* revert_to_return */ +); + +extern int XGetKeyboardControl( + Display* /* display */, + XKeyboardState* /* values_return */ +); + +extern int XGetPointerControl( + Display* /* display */, + int* /* accel_numerator_return */, + int* /* accel_denominator_return */, + int* /* threshold_return */ +); + +extern int XGetPointerMapping( + Display* /* display */, + unsigned char* /* map_return */, + int /* nmap */ +); + +extern int XGetScreenSaver( + Display* /* display */, + int* /* timeout_return */, + int* /* interval_return */, + int* /* prefer_blanking_return */, + int* /* allow_exposures_return */ +); + +extern Status XGetTransientForHint( + Display* /* display */, + Window /* w */, + Window* /* prop_window_return */ +); + +extern int XGetWindowProperty( + Display* /* display */, + Window /* w */, + Atom /* property */, + long /* long_offset */, + long /* long_length */, + Bool /* delete */, + Atom /* req_type */, + Atom* /* actual_type_return */, + int* /* actual_format_return */, + unsigned long* /* nitems_return */, + unsigned long* /* bytes_after_return */, + unsigned char** /* prop_return */ +); + +extern Status XGetWindowAttributes( + Display* /* display */, + Window /* w */, + XWindowAttributes* /* window_attributes_return */ +); + +extern int XGrabButton( + Display* /* display */, + unsigned int /* button */, + unsigned int /* modifiers */, + Window /* grab_window */, + Bool /* owner_events */, + unsigned int /* event_mask */, + int /* pointer_mode */, + int /* keyboard_mode */, + Window /* confine_to */, + Cursor /* cursor */ +); + +extern int XGrabKey( + Display* /* display */, + int /* keycode */, + unsigned int /* modifiers */, + Window /* grab_window */, + Bool /* owner_events */, + int /* pointer_mode */, + int /* keyboard_mode */ +); + +extern int XGrabKeyboard( + Display* /* display */, + Window /* grab_window */, + Bool /* owner_events */, + int /* pointer_mode */, + int /* keyboard_mode */, + Time /* time */ +); + +extern int XGrabPointer( + Display* /* display */, + Window /* grab_window */, + Bool /* owner_events */, + unsigned int /* event_mask */, + int /* pointer_mode */, + int /* keyboard_mode */, + Window /* confine_to */, + Cursor /* cursor */, + Time /* time */ +); + +extern int XGrabServer( + Display* /* display */ +); + +extern int XHeightMMOfScreen( + Screen* /* screen */ +); + +extern int XHeightOfScreen( + Screen* /* screen */ +); + +extern int XIfEvent( + Display* /* display */, + XEvent* /* event_return */, + Bool (*) ( + Display* /* display */, + XEvent* /* event */, + XPointer /* arg */ + ) /* predicate */, + XPointer /* arg */ +); + +extern int XImageByteOrder( + Display* /* display */ +); + +extern int XInstallColormap( + Display* /* display */, + Colormap /* colormap */ +); + +extern KeyCode XKeysymToKeycode( + Display* /* display */, + KeySym /* keysym */ +); + +extern int XKillClient( + Display* /* display */, + XID /* resource */ +); + +extern Status XLookupColor( + Display* /* display */, + Colormap /* colormap */, + _Xconst char* /* color_name */, + XColor* /* exact_def_return */, + XColor* /* screen_def_return */ +); + +extern int XLowerWindow( + Display* /* display */, + Window /* w */ +); + +extern int XMapRaised( + Display* /* display */, + Window /* w */ +); + +extern int XMapSubwindows( + Display* /* display */, + Window /* w */ +); + +extern int XMapWindow( + Display* /* display */, + Window /* w */ +); + +extern int XMaskEvent( + Display* /* display */, + long /* event_mask */, + XEvent* /* event_return */ +); + +extern int XMaxCmapsOfScreen( + Screen* /* screen */ +); + +extern int XMinCmapsOfScreen( + Screen* /* screen */ +); + +extern int XMoveResizeWindow( + Display* /* display */, + Window /* w */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */ +); + +extern int XMoveWindow( + Display* /* display */, + Window /* w */, + int /* x */, + int /* y */ +); + +extern int XNextEvent( + Display* /* display */, + XEvent* /* event_return */ +); + +extern int XNoOp( + Display* /* display */ +); + +extern Status XParseColor( + Display* /* display */, + Colormap /* colormap */, + _Xconst char* /* spec */, + XColor* /* exact_def_return */ +); + +extern int XParseGeometry( + _Xconst char* /* parsestring */, + int* /* x_return */, + int* /* y_return */, + unsigned int* /* width_return */, + unsigned int* /* height_return */ +); + +extern int XPeekEvent( + Display* /* display */, + XEvent* /* event_return */ +); + +extern int XPeekIfEvent( + Display* /* display */, + XEvent* /* event_return */, + Bool (*) ( + Display* /* display */, + XEvent* /* event */, + XPointer /* arg */ + ) /* predicate */, + XPointer /* arg */ +); + +extern int XPending( + Display* /* display */ +); + +extern int XPlanesOfScreen( + Screen* /* screen */ +); + +extern int XProtocolRevision( + Display* /* display */ +); + +extern int XProtocolVersion( + Display* /* display */ +); + + +extern int XPutBackEvent( + Display* /* display */, + XEvent* /* event */ +); + +extern int XPutImage( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + XImage* /* image */, + int /* src_x */, + int /* src_y */, + int /* dest_x */, + int /* dest_y */, + unsigned int /* width */, + unsigned int /* height */ +); + +extern int XQLength( + Display* /* display */ +); + +extern Status XQueryBestCursor( + Display* /* display */, + Drawable /* d */, + unsigned int /* width */, + unsigned int /* height */, + unsigned int* /* width_return */, + unsigned int* /* height_return */ +); + +extern Status XQueryBestSize( + Display* /* display */, + int /* class */, + Drawable /* which_screen */, + unsigned int /* width */, + unsigned int /* height */, + unsigned int* /* width_return */, + unsigned int* /* height_return */ +); + +extern Status XQueryBestStipple( + Display* /* display */, + Drawable /* which_screen */, + unsigned int /* width */, + unsigned int /* height */, + unsigned int* /* width_return */, + unsigned int* /* height_return */ +); + +extern Status XQueryBestTile( + Display* /* display */, + Drawable /* which_screen */, + unsigned int /* width */, + unsigned int /* height */, + unsigned int* /* width_return */, + unsigned int* /* height_return */ +); + +extern int XQueryColor( + Display* /* display */, + Colormap /* colormap */, + XColor* /* def_in_out */ +); + +extern int XQueryColors( + Display* /* display */, + Colormap /* colormap */, + XColor* /* defs_in_out */, + int /* ncolors */ +); + +extern Bool XQueryExtension( + Display* /* display */, + _Xconst char* /* name */, + int* /* major_opcode_return */, + int* /* first_event_return */, + int* /* first_error_return */ +); + +extern int XQueryKeymap( + Display* /* display */, + char [32] /* keys_return */ +); + +extern Bool XQueryPointer( + Display* /* display */, + Window /* w */, + Window* /* root_return */, + Window* /* child_return */, + int* /* root_x_return */, + int* /* root_y_return */, + int* /* win_x_return */, + int* /* win_y_return */, + unsigned int* /* mask_return */ +); + +extern int XQueryTextExtents( + Display* /* display */, + XID /* font_ID */, + _Xconst char* /* string */, + int /* nchars */, + int* /* direction_return */, + int* /* font_ascent_return */, + int* /* font_descent_return */, + XCharStruct* /* overall_return */ +); + +extern int XQueryTextExtents16( + Display* /* display */, + XID /* font_ID */, + _Xconst XChar2b* /* string */, + int /* nchars */, + int* /* direction_return */, + int* /* font_ascent_return */, + int* /* font_descent_return */, + XCharStruct* /* overall_return */ +); + +extern Status XQueryTree( + Display* /* display */, + Window /* w */, + Window* /* root_return */, + Window* /* parent_return */, + Window** /* children_return */, + unsigned int* /* nchildren_return */ +); + +extern int XRaiseWindow( + Display* /* display */, + Window /* w */ +); + +extern int XReadBitmapFile( + Display* /* display */, + Drawable /* d */, + _Xconst char* /* filename */, + unsigned int* /* width_return */, + unsigned int* /* height_return */, + Pixmap* /* bitmap_return */, + int* /* x_hot_return */, + int* /* y_hot_return */ +); + +extern int XReadBitmapFileData( + _Xconst char* /* filename */, + unsigned int* /* width_return */, + unsigned int* /* height_return */, + unsigned char** /* data_return */, + int* /* x_hot_return */, + int* /* y_hot_return */ +); + +extern int XRebindKeysym( + Display* /* display */, + KeySym /* keysym */, + KeySym* /* list */, + int /* mod_count */, + _Xconst unsigned char* /* string */, + int /* bytes_string */ +); + +extern int XRecolorCursor( + Display* /* display */, + Cursor /* cursor */, + XColor* /* foreground_color */, + XColor* /* background_color */ +); + +extern int XRefreshKeyboardMapping( + XMappingEvent* /* event_map */ +); + +extern int XRemoveFromSaveSet( + Display* /* display */, + Window /* w */ +); + +extern int XRemoveHost( + Display* /* display */, + XHostAddress* /* host */ +); + +extern int XRemoveHosts( + Display* /* display */, + XHostAddress* /* hosts */, + int /* num_hosts */ +); + +extern int XReparentWindow( + Display* /* display */, + Window /* w */, + Window /* parent */, + int /* x */, + int /* y */ +); + +extern int XResetScreenSaver( + Display* /* display */ +); + +extern int XResizeWindow( + Display* /* display */, + Window /* w */, + unsigned int /* width */, + unsigned int /* height */ +); + +extern int XRestackWindows( + Display* /* display */, + Window* /* windows */, + int /* nwindows */ +); + +extern int XRotateBuffers( + Display* /* display */, + int /* rotate */ +); + +extern int XRotateWindowProperties( + Display* /* display */, + Window /* w */, + Atom* /* properties */, + int /* num_prop */, + int /* npositions */ +); + +extern int XScreenCount( + Display* /* display */ +); + +extern int XSelectInput( + Display* /* display */, + Window /* w */, + long /* event_mask */ +); + +extern Status XSendEvent( + Display* /* display */, + Window /* w */, + Bool /* propagate */, + long /* event_mask */, + XEvent* /* event_send */ +); + +extern int XSetAccessControl( + Display* /* display */, + int /* mode */ +); + +extern int XSetArcMode( + Display* /* display */, + GC /* gc */, + int /* arc_mode */ +); + +extern int XSetBackground( + Display* /* display */, + GC /* gc */, + unsigned long /* background */ +); + +extern int XSetClipMask( + Display* /* display */, + GC /* gc */, + Pixmap /* pixmap */ +); + +extern int XSetClipOrigin( + Display* /* display */, + GC /* gc */, + int /* clip_x_origin */, + int /* clip_y_origin */ +); + +extern int XSetClipRectangles( + Display* /* display */, + GC /* gc */, + int /* clip_x_origin */, + int /* clip_y_origin */, + XRectangle* /* rectangles */, + int /* n */, + int /* ordering */ +); + +extern int XSetCloseDownMode( + Display* /* display */, + int /* close_mode */ +); + +extern int XSetCommand( + Display* /* display */, + Window /* w */, + char** /* argv */, + int /* argc */ +); + +extern int XSetDashes( + Display* /* display */, + GC /* gc */, + int /* dash_offset */, + _Xconst char* /* dash_list */, + int /* n */ +); + +extern int XSetFillRule( + Display* /* display */, + GC /* gc */, + int /* fill_rule */ +); + +extern int XSetFillStyle( + Display* /* display */, + GC /* gc */, + int /* fill_style */ +); + +extern int XSetFont( + Display* /* display */, + GC /* gc */, + Font /* font */ +); + +extern int XSetFontPath( + Display* /* display */, + char** /* directories */, + int /* ndirs */ +); + +extern int XSetForeground( + Display* /* display */, + GC /* gc */, + unsigned long /* foreground */ +); + +extern int XSetFunction( + Display* /* display */, + GC /* gc */, + int /* function */ +); + +extern int XSetGraphicsExposures( + Display* /* display */, + GC /* gc */, + Bool /* graphics_exposures */ +); + +extern int XSetIconName( + Display* /* display */, + Window /* w */, + _Xconst char* /* icon_name */ +); + +extern int XSetInputFocus( + Display* /* display */, + Window /* focus */, + int /* revert_to */, + Time /* time */ +); + +extern int XSetLineAttributes( + Display* /* display */, + GC /* gc */, + unsigned int /* line_width */, + int /* line_style */, + int /* cap_style */, + int /* join_style */ +); + +extern int XSetModifierMapping( + Display* /* display */, + XModifierKeymap* /* modmap */ +); + +extern int XSetPlaneMask( + Display* /* display */, + GC /* gc */, + unsigned long /* plane_mask */ +); + +extern int XSetPointerMapping( + Display* /* display */, + _Xconst unsigned char* /* map */, + int /* nmap */ +); + +extern int XSetScreenSaver( + Display* /* display */, + int /* timeout */, + int /* interval */, + int /* prefer_blanking */, + int /* allow_exposures */ +); + +extern int XSetSelectionOwner( + Display* /* display */, + Atom /* selection */, + Window /* owner */, + Time /* time */ +); + +extern int XSetState( + Display* /* display */, + GC /* gc */, + unsigned long /* foreground */, + unsigned long /* background */, + int /* function */, + unsigned long /* plane_mask */ +); + +extern int XSetStipple( + Display* /* display */, + GC /* gc */, + Pixmap /* stipple */ +); + +extern int XSetSubwindowMode( + Display* /* display */, + GC /* gc */, + int /* subwindow_mode */ +); + +extern int XSetTSOrigin( + Display* /* display */, + GC /* gc */, + int /* ts_x_origin */, + int /* ts_y_origin */ +); + +extern int XSetTile( + Display* /* display */, + GC /* gc */, + Pixmap /* tile */ +); + +extern int XSetWindowBackground( + Display* /* display */, + Window /* w */, + unsigned long /* background_pixel */ +); + +extern int XSetWindowBackgroundPixmap( + Display* /* display */, + Window /* w */, + Pixmap /* background_pixmap */ +); + +extern int XSetWindowBorder( + Display* /* display */, + Window /* w */, + unsigned long /* border_pixel */ +); + +extern int XSetWindowBorderPixmap( + Display* /* display */, + Window /* w */, + Pixmap /* border_pixmap */ +); + +extern int XSetWindowBorderWidth( + Display* /* display */, + Window /* w */, + unsigned int /* width */ +); + +extern int XSetWindowColormap( + Display* /* display */, + Window /* w */, + Colormap /* colormap */ +); + +extern int XStoreBuffer( + Display* /* display */, + _Xconst char* /* bytes */, + int /* nbytes */, + int /* buffer */ +); + +extern int XStoreBytes( + Display* /* display */, + _Xconst char* /* bytes */, + int /* nbytes */ +); + +extern int XStoreColor( + Display* /* display */, + Colormap /* colormap */, + XColor* /* color */ +); + +extern int XStoreColors( + Display* /* display */, + Colormap /* colormap */, + XColor* /* color */, + int /* ncolors */ +); + +extern int XStoreName( + Display* /* display */, + Window /* w */, + _Xconst char* /* window_name */ +); + +extern int XStoreNamedColor( + Display* /* display */, + Colormap /* colormap */, + _Xconst char* /* color */, + unsigned long /* pixel */, + int /* flags */ +); + +extern int XSync( + Display* /* display */, + Bool /* discard */ +); + +extern int XTextExtents( + XFontStruct* /* font_struct */, + _Xconst char* /* string */, + int /* nchars */, + int* /* direction_return */, + int* /* font_ascent_return */, + int* /* font_descent_return */, + XCharStruct* /* overall_return */ +); + +extern int XTextExtents16( + XFontStruct* /* font_struct */, + _Xconst XChar2b* /* string */, + int /* nchars */, + int* /* direction_return */, + int* /* font_ascent_return */, + int* /* font_descent_return */, + XCharStruct* /* overall_return */ +); + +extern int XTextWidth( + XFontStruct* /* font_struct */, + _Xconst char* /* string */, + int /* count */ +); + +extern int XTextWidth16( + XFontStruct* /* font_struct */, + _Xconst XChar2b* /* string */, + int /* count */ +); + +extern Bool XTranslateCoordinates( + Display* /* display */, + Window /* src_w */, + Window /* dest_w */, + int /* src_x */, + int /* src_y */, + int* /* dest_x_return */, + int* /* dest_y_return */, + Window* /* child_return */ +); + +extern int XUndefineCursor( + Display* /* display */, + Window /* w */ +); + +extern int XUngrabButton( + Display* /* display */, + unsigned int /* button */, + unsigned int /* modifiers */, + Window /* grab_window */ +); + +extern int XUngrabKey( + Display* /* display */, + int /* keycode */, + unsigned int /* modifiers */, + Window /* grab_window */ +); + +extern int XUngrabKeyboard( + Display* /* display */, + Time /* time */ +); + +extern int XUngrabPointer( + Display* /* display */, + Time /* time */ +); + +extern int XUngrabServer( + Display* /* display */ +); + +extern int XUninstallColormap( + Display* /* display */, + Colormap /* colormap */ +); + +extern int XUnloadFont( + Display* /* display */, + Font /* font */ +); + +extern int XUnmapSubwindows( + Display* /* display */, + Window /* w */ +); + +extern int XUnmapWindow( + Display* /* display */, + Window /* w */ +); + +extern int XVendorRelease( + Display* /* display */ +); + +extern int XWarpPointer( + Display* /* display */, + Window /* src_w */, + Window /* dest_w */, + int /* src_x */, + int /* src_y */, + unsigned int /* src_width */, + unsigned int /* src_height */, + int /* dest_x */, + int /* dest_y */ +); + +extern int XWidthMMOfScreen( + Screen* /* screen */ +); + +extern int XWidthOfScreen( + Screen* /* screen */ +); + +extern int XWindowEvent( + Display* /* display */, + Window /* w */, + long /* event_mask */, + XEvent* /* event_return */ +); + +extern int XWriteBitmapFile( + Display* /* display */, + _Xconst char* /* filename */, + Pixmap /* bitmap */, + unsigned int /* width */, + unsigned int /* height */, + int /* x_hot */, + int /* y_hot */ +); + +extern Bool XSupportsLocale (void); + +extern char *XSetLocaleModifiers( + const char* /* modifier_list */ +); + +extern XOM XOpenOM( + Display* /* display */, + struct _XrmHashBucketRec* /* rdb */, + _Xconst char* /* res_name */, + _Xconst char* /* res_class */ +); + +extern Status XCloseOM( + XOM /* om */ +); + +extern char *XSetOMValues( + XOM /* om */, + ... +) _X_SENTINEL(0); + +extern char *XGetOMValues( + XOM /* om */, + ... +) _X_SENTINEL(0); + +extern Display *XDisplayOfOM( + XOM /* om */ +); + +extern char *XLocaleOfOM( + XOM /* om */ +); + +extern XOC XCreateOC( + XOM /* om */, + ... +) _X_SENTINEL(0); + +extern void XDestroyOC( + XOC /* oc */ +); + +extern XOM XOMOfOC( + XOC /* oc */ +); + +extern char *XSetOCValues( + XOC /* oc */, + ... +) _X_SENTINEL(0); + +extern char *XGetOCValues( + XOC /* oc */, + ... +) _X_SENTINEL(0); + +extern XFontSet XCreateFontSet( + Display* /* display */, + _Xconst char* /* base_font_name_list */, + char*** /* missing_charset_list */, + int* /* missing_charset_count */, + char** /* def_string */ +); + +extern void XFreeFontSet( + Display* /* display */, + XFontSet /* font_set */ +); + +extern int XFontsOfFontSet( + XFontSet /* font_set */, + XFontStruct*** /* font_struct_list */, + char*** /* font_name_list */ +); + +extern char *XBaseFontNameListOfFontSet( + XFontSet /* font_set */ +); + +extern char *XLocaleOfFontSet( + XFontSet /* font_set */ +); + +extern Bool XContextDependentDrawing( + XFontSet /* font_set */ +); + +extern Bool XDirectionalDependentDrawing( + XFontSet /* font_set */ +); + +extern Bool XContextualDrawing( + XFontSet /* font_set */ +); + +extern XFontSetExtents *XExtentsOfFontSet( + XFontSet /* font_set */ +); + +extern int XmbTextEscapement( + XFontSet /* font_set */, + _Xconst char* /* text */, + int /* bytes_text */ +); + +extern int XwcTextEscapement( + XFontSet /* font_set */, + _Xconst wchar_t* /* text */, + int /* num_wchars */ +); + +extern int Xutf8TextEscapement( + XFontSet /* font_set */, + _Xconst char* /* text */, + int /* bytes_text */ +); + +extern int XmbTextExtents( + XFontSet /* font_set */, + _Xconst char* /* text */, + int /* bytes_text */, + XRectangle* /* overall_ink_return */, + XRectangle* /* overall_logical_return */ +); + +extern int XwcTextExtents( + XFontSet /* font_set */, + _Xconst wchar_t* /* text */, + int /* num_wchars */, + XRectangle* /* overall_ink_return */, + XRectangle* /* overall_logical_return */ +); + +extern int Xutf8TextExtents( + XFontSet /* font_set */, + _Xconst char* /* text */, + int /* bytes_text */, + XRectangle* /* overall_ink_return */, + XRectangle* /* overall_logical_return */ +); + +extern Status XmbTextPerCharExtents( + XFontSet /* font_set */, + _Xconst char* /* text */, + int /* bytes_text */, + XRectangle* /* ink_extents_buffer */, + XRectangle* /* logical_extents_buffer */, + int /* buffer_size */, + int* /* num_chars */, + XRectangle* /* overall_ink_return */, + XRectangle* /* overall_logical_return */ +); + +extern Status XwcTextPerCharExtents( + XFontSet /* font_set */, + _Xconst wchar_t* /* text */, + int /* num_wchars */, + XRectangle* /* ink_extents_buffer */, + XRectangle* /* logical_extents_buffer */, + int /* buffer_size */, + int* /* num_chars */, + XRectangle* /* overall_ink_return */, + XRectangle* /* overall_logical_return */ +); + +extern Status Xutf8TextPerCharExtents( + XFontSet /* font_set */, + _Xconst char* /* text */, + int /* bytes_text */, + XRectangle* /* ink_extents_buffer */, + XRectangle* /* logical_extents_buffer */, + int /* buffer_size */, + int* /* num_chars */, + XRectangle* /* overall_ink_return */, + XRectangle* /* overall_logical_return */ +); + +extern void XmbDrawText( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + XmbTextItem* /* text_items */, + int /* nitems */ +); + +extern void XwcDrawText( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + XwcTextItem* /* text_items */, + int /* nitems */ +); + +extern void Xutf8DrawText( + Display* /* display */, + Drawable /* d */, + GC /* gc */, + int /* x */, + int /* y */, + XmbTextItem* /* text_items */, + int /* nitems */ +); + +extern void XmbDrawString( + Display* /* display */, + Drawable /* d */, + XFontSet /* font_set */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst char* /* text */, + int /* bytes_text */ +); + +extern void XwcDrawString( + Display* /* display */, + Drawable /* d */, + XFontSet /* font_set */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst wchar_t* /* text */, + int /* num_wchars */ +); + +extern void Xutf8DrawString( + Display* /* display */, + Drawable /* d */, + XFontSet /* font_set */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst char* /* text */, + int /* bytes_text */ +); + +extern void XmbDrawImageString( + Display* /* display */, + Drawable /* d */, + XFontSet /* font_set */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst char* /* text */, + int /* bytes_text */ +); + +extern void XwcDrawImageString( + Display* /* display */, + Drawable /* d */, + XFontSet /* font_set */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst wchar_t* /* text */, + int /* num_wchars */ +); + +extern void Xutf8DrawImageString( + Display* /* display */, + Drawable /* d */, + XFontSet /* font_set */, + GC /* gc */, + int /* x */, + int /* y */, + _Xconst char* /* text */, + int /* bytes_text */ +); + +extern XIM XOpenIM( + Display* /* dpy */, + struct _XrmHashBucketRec* /* rdb */, + char* /* res_name */, + char* /* res_class */ +); + +extern Status XCloseIM( + XIM /* im */ +); + +extern char *XGetIMValues( + XIM /* im */, ... +) _X_SENTINEL(0); + +extern char *XSetIMValues( + XIM /* im */, ... +) _X_SENTINEL(0); + +extern Display *XDisplayOfIM( + XIM /* im */ +); + +extern char *XLocaleOfIM( + XIM /* im*/ +); + +extern XIC XCreateIC( + XIM /* im */, ... +) _X_SENTINEL(0); + +extern void XDestroyIC( + XIC /* ic */ +); + +extern void XSetICFocus( + XIC /* ic */ +); + +extern void XUnsetICFocus( + XIC /* ic */ +); + +extern wchar_t *XwcResetIC( + XIC /* ic */ +); + +extern char *XmbResetIC( + XIC /* ic */ +); + +extern char *Xutf8ResetIC( + XIC /* ic */ +); + +extern char *XSetICValues( + XIC /* ic */, ... +) _X_SENTINEL(0); + +extern char *XGetICValues( + XIC /* ic */, ... +) _X_SENTINEL(0); + +extern XIM XIMOfIC( + XIC /* ic */ +); + +extern Bool XFilterEvent( + XEvent* /* event */, + Window /* window */ +); + +extern int XmbLookupString( + XIC /* ic */, + XKeyPressedEvent* /* event */, + char* /* buffer_return */, + int /* bytes_buffer */, + KeySym* /* keysym_return */, + Status* /* status_return */ +); + +extern int XwcLookupString( + XIC /* ic */, + XKeyPressedEvent* /* event */, + wchar_t* /* buffer_return */, + int /* wchars_buffer */, + KeySym* /* keysym_return */, + Status* /* status_return */ +); + +extern int Xutf8LookupString( + XIC /* ic */, + XKeyPressedEvent* /* event */, + char* /* buffer_return */, + int /* bytes_buffer */, + KeySym* /* keysym_return */, + Status* /* status_return */ +); + +extern XVaNestedList XVaCreateNestedList( + int /*unused*/, ... +) _X_SENTINEL(0); + +/* internal connections for IMs */ + +extern Bool XRegisterIMInstantiateCallback( + Display* /* dpy */, + struct _XrmHashBucketRec* /* rdb */, + char* /* res_name */, + char* /* res_class */, + XIDProc /* callback */, + XPointer /* client_data */ +); + +extern Bool XUnregisterIMInstantiateCallback( + Display* /* dpy */, + struct _XrmHashBucketRec* /* rdb */, + char* /* res_name */, + char* /* res_class */, + XIDProc /* callback */, + XPointer /* client_data */ +); + +typedef void (*XConnectionWatchProc)( + Display* /* dpy */, + XPointer /* client_data */, + int /* fd */, + Bool /* opening */, /* open or close flag */ + XPointer* /* watch_data */ /* open sets, close uses */ +); + + +extern Status XInternalConnectionNumbers( + Display* /* dpy */, + int** /* fd_return */, + int* /* count_return */ +); + +extern void XProcessInternalConnection( + Display* /* dpy */, + int /* fd */ +); + +extern Status XAddConnectionWatch( + Display* /* dpy */, + XConnectionWatchProc /* callback */, + XPointer /* client_data */ +); + +extern void XRemoveConnectionWatch( + Display* /* dpy */, + XConnectionWatchProc /* callback */, + XPointer /* client_data */ +); + +extern void XSetAuthorization( + char * /* name */, + int /* namelen */, + char * /* data */, + int /* datalen */ +); + +extern int _Xmbtowc( + wchar_t * /* wstr */, +#ifdef ISC + char const * /* str */, + size_t /* len */ +#else + char * /* str */, + int /* len */ +#endif +); + +extern int _Xwctomb( + char * /* str */, + wchar_t /* wc */ +); + +extern Bool XGetEventData( + Display* /* dpy */, + XGenericEventCookie* /* cookie*/ +); + +extern void XFreeEventData( + Display* /* dpy */, + XGenericEventCookie* /* cookie*/ +); + +_XFUNCPROTOEND + +#endif /* _XLIB_H_ */ diff --git a/X11/XlibConf.h b/X11/XlibConf.h new file mode 100644 index 000000000..eda569510 --- /dev/null +++ b/X11/XlibConf.h @@ -0,0 +1,37 @@ +/* + * Copyright © 2005 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _XLIBCONF_H_ +#define _XLIBCONF_H_ +/* + * This header file exports defines necessary to correctly + * use Xlibint.h both inside Xlib and by external libraries + * such as extensions. + */ + +/* Threading support? */ +#define XTHREADS /**/ + +/* Use multi-threaded libc functions? */ +#define XUSE_MTSAFE_API /**/ + +#endif /* _XLIBCONF_H_ */ diff --git a/X11/Xlibint.h b/X11/Xlibint.h new file mode 100644 index 000000000..2acfc7690 --- /dev/null +++ b/X11/Xlibint.h @@ -0,0 +1,1398 @@ +/* $Xorg: Xlibint.h,v 1.5 2001/02/09 02:03:38 xorgcvs Exp $ */ + +/* + +Copyright 1984, 1985, 1987, 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ +/* $XFree86: xc/lib/X11/Xlibint.h,v 3.27 2003/05/27 22:26:26 tsi Exp $ */ + +#ifndef _XLIBINT_H_ +#define _XLIBINT_H_ 1 + +/* + * Xlibint.h - Header definition and support file for the internal + * support routines used by the C subroutine interface + * library (Xlib) to the X Window System. + * + * Warning, there be dragons here.... + */ + +#include <X11/Xlib.h> +#include <X11/Xproto.h> /* to declare xEvent */ +#include <X11/XlibConf.h> /* for configured options like XTHREADS */ + +#ifdef WIN32 +#define _XFlush _XFlushIt +#endif + +/* + * If your BytesReadable correctly detects broken connections, then + * you should NOT define XCONN_CHECK_FREQ. + */ +#ifndef XCONN_CHECK_FREQ +#define XCONN_CHECK_FREQ 256 +#endif + +struct _XGC +{ + XExtData *ext_data; /* hook for extension to hang data */ + GContext gid; /* protocol ID for graphics context */ + Bool rects; /* boolean: TRUE if clipmask is list of rectangles */ + Bool dashes; /* boolean: TRUE if dash-list is really a list */ + unsigned long dirty;/* cache dirty bits */ + XGCValues values; /* shadow structure of values */ +}; + +struct _XDisplay +{ + XExtData *ext_data; /* hook for extension to hang data */ + struct _XFreeFuncs *free_funcs; /* internal free functions */ + int fd; /* Network socket. */ + int conn_checker; /* ugly thing used by _XEventsQueued */ + int proto_major_version;/* maj. version of server's X protocol */ + int proto_minor_version;/* minor version of server's X protocol */ + char *vendor; /* vendor of the server hardware */ + XID resource_base; /* resource ID base */ + XID resource_mask; /* resource ID mask bits */ + XID resource_id; /* allocator current ID */ + int resource_shift; /* allocator shift to correct bits */ + XID (*resource_alloc)( /* allocator function */ + struct _XDisplay* + ); + int byte_order; /* screen byte order, LSBFirst, MSBFirst */ + int bitmap_unit; /* padding and data requirements */ + int bitmap_pad; /* padding requirements on bitmaps */ + int bitmap_bit_order; /* LeastSignificant or MostSignificant */ + int nformats; /* number of pixmap formats in list */ + ScreenFormat *pixmap_format; /* pixmap format list */ + int vnumber; /* Xlib's X protocol version number. */ + int release; /* release of the server */ + struct _XSQEvent *head, *tail; /* Input event queue. */ + int qlen; /* Length of input event queue */ + unsigned long last_request_read; /* seq number of last event read */ + unsigned long request; /* sequence number of last request. */ + char *last_req; /* beginning of last request, or dummy */ + char *buffer; /* Output buffer starting address. */ + char *bufptr; /* Output buffer index pointer. */ + char *bufmax; /* Output buffer maximum+1 address. */ + unsigned max_request_size; /* maximum number 32 bit words in request*/ + struct _XrmHashBucketRec *db; + int (*synchandler)( /* Synchronization handler */ + struct _XDisplay* + ); + char *display_name; /* "host:display" string used on this connect*/ + int default_screen; /* default screen for operations */ + int nscreens; /* number of screens on this server*/ + Screen *screens; /* pointer to list of screens */ + unsigned long motion_buffer; /* size of motion buffer */ + volatile unsigned long flags; /* internal connection flags */ + int min_keycode; /* minimum defined keycode */ + int max_keycode; /* maximum defined keycode */ + KeySym *keysyms; /* This server's keysyms */ + XModifierKeymap *modifiermap; /* This server's modifier keymap */ + int keysyms_per_keycode;/* number of rows */ + char *xdefaults; /* contents of defaults from server */ + char *scratch_buffer; /* place to hang scratch buffer */ + unsigned long scratch_length; /* length of scratch buffer */ + int ext_number; /* extension number on this display */ + struct _XExten *ext_procs; /* extensions initialized on this display */ + /* + * the following can be fixed size, as the protocol defines how + * much address space is available. + * While this could be done using the extension vector, there + * may be MANY events processed, so a search through the extension + * list to find the right procedure for each event might be + * expensive if many extensions are being used. + */ + Bool (*event_vec[128])( /* vector for wire to event */ + Display * /* dpy */, + XEvent * /* re */, + xEvent * /* event */ + ); + Status (*wire_vec[128])( /* vector for event to wire */ + Display * /* dpy */, + XEvent * /* re */, + xEvent * /* event */ + ); + KeySym lock_meaning; /* for XLookupString */ + struct _XLockInfo *lock; /* multi-thread state, display lock */ + struct _XInternalAsync *async_handlers; /* for internal async */ + unsigned long bigreq_size; /* max size of big requests */ + struct _XLockPtrs *lock_fns; /* pointers to threads functions */ + void (*idlist_alloc)( /* XID list allocator function */ + Display * /* dpy */, + XID * /* ids */, + int /* count */ + ); + /* things above this line should not move, for binary compatibility */ + struct _XKeytrans *key_bindings; /* for XLookupString */ + Font cursor_font; /* for XCreateFontCursor */ + struct _XDisplayAtoms *atoms; /* for XInternAtom */ + unsigned int mode_switch; /* keyboard group modifiers */ + unsigned int num_lock; /* keyboard numlock modifiers */ + struct _XContextDB *context_db; /* context database */ + Bool (**error_vec)( /* vector for wire to error */ + Display * /* display */, + XErrorEvent * /* he */, + xError * /* we */ + ); + /* + * Xcms information + */ + struct { + XPointer defaultCCCs; /* pointer to an array of default XcmsCCC */ + XPointer clientCmaps; /* pointer to linked list of XcmsCmapRec */ + XPointer perVisualIntensityMaps; + /* linked list of XcmsIntensityMap */ + } cms; + struct _XIMFilter *im_filters; + struct _XSQEvent *qfree; /* unallocated event queue elements */ + unsigned long next_event_serial_num; /* inserted into next queue elt */ + struct _XExten *flushes; /* Flush hooks */ + struct _XConnectionInfo *im_fd_info; /* _XRegisterInternalConnection */ + int im_fd_length; /* number of im_fd_info */ + struct _XConnWatchInfo *conn_watchers; /* XAddConnectionWatch */ + int watcher_count; /* number of conn_watchers */ + XPointer filedes; /* struct pollfd cache for _XWaitForReadable */ + int (*savedsynchandler)( /* user synchandler when Xlib usurps */ + Display * /* dpy */ + ); + XID resource_max; /* allocator max ID */ + int xcmisc_opcode; /* major opcode for XC-MISC */ + struct _XkbInfoRec *xkb_info; /* XKB info */ + struct _XtransConnInfo *trans_conn; /* transport connection object */ + struct _X11XCBPrivate *xcb; /* XCB glue private data */ + + /* Generic event cookie handling */ + unsigned int next_cookie; /* next event cookie */ + /* vector for wire to generic event, index is (extension - 128) */ + Bool (*generic_event_vec[128])( + Display * /* dpy */, + XGenericEventCookie * /* Xlib event */, + xEvent * /* wire event */); + /* vector for event copy, index is (extension - 128) */ + Bool (*generic_event_copy_vec[128])( + Display * /* dpy */, + XGenericEventCookie * /* in */, + XGenericEventCookie * /* out*/); + void *cookiejar; /* cookie events returned but not claimed */ +}; + +#define XAllocIDs(dpy,ids,n) (*(dpy)->idlist_alloc)(dpy,ids,n) + +/* + * define the following if you want the Data macro to be a procedure instead + */ +#ifdef CRAY +#define DataRoutineIsProcedure +#endif /* CRAY */ + +#ifndef _XEVENT_ +/* + * _QEvent datatype for use in input queueing. + */ +typedef struct _XSQEvent +{ + struct _XSQEvent *next; + XEvent event; + unsigned long qserial_num; /* so multi-threaded code can find new ones */ +} _XQEvent; +#endif + +#ifdef XTHREADS /* for xReply */ +#define NEED_REPLIES +#endif + +#define NEED_EVENTS +#define NEED_REPLIES +#include <X11/Xproto.h> +#ifdef __sgi +#define _SGI_MP_SOURCE /* turn this on to get MP safe errno */ +#endif +#include <errno.h> +#define _XBCOPYFUNC _Xbcopy +#include <X11/Xfuncs.h> +#include <X11/Xosdefs.h> + +/* Utek leaves kernel macros around in include files (bleah) */ +#ifdef dirty +#undef dirty +#endif + +#include <stdlib.h> +#include <string.h> + +#include <X11/Xfuncproto.h> + +_XFUNCPROTOBEGIN + +/* + * The following definitions can be used for locking requests in multi-threaded + * address spaces. + */ +#ifdef XTHREADS +/* Author: Stephen Gildea, MIT X Consortium + * + * declarations for C Threads locking + */ + +typedef struct _LockInfoRec *LockInfoPtr; + +/* interfaces for locking.c */ +struct _XLockPtrs { + /* used by all, including extensions; do not move */ + void (*lock_display)( + Display *dpy +#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) + , char *file + , int line +#endif + ); + void (*unlock_display)( + Display *dpy +#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) + , char *file + , int line +#endif + ); +}; + +#if defined(WIN32) && !defined(_XLIBINT_) +#define _XCreateMutex_fn (*_XCreateMutex_fn_p) +#define _XFreeMutex_fn (*_XFreeMutex_fn_p) +#define _XLockMutex_fn (*_XLockMutex_fn_p) +#define _XUnlockMutex_fn (*_XUnlockMutex_fn_p) +#define _Xglobal_lock (*_Xglobal_lock_p) +#endif + +/* in XlibInt.c */ +extern void (*_XCreateMutex_fn)( + LockInfoPtr /* lock */ +); +extern void (*_XFreeMutex_fn)( + LockInfoPtr /* lock */ +); +extern void (*_XLockMutex_fn)( + LockInfoPtr /* lock */ +#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) + , char * /* file */ + , int /* line */ +#endif +); +extern void (*_XUnlockMutex_fn)( + LockInfoPtr /* lock */ +#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) + , char * /* file */ + , int /* line */ +#endif +); + +extern LockInfoPtr _Xglobal_lock; + +#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) +#define LockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->lock_display)((d),__FILE__,__LINE__) +#define UnlockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)((d),__FILE__,__LINE__) +#define _XLockMutex(lock) if (_XLockMutex_fn) (*_XLockMutex_fn)(lock,__FILE__,__LINE__) +#define _XUnlockMutex(lock) if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock,__FILE__,__LINE__) +#else +/* used everywhere, so must be fast if not using threads */ +#define LockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->lock_display)(d) +#define UnlockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)(d) +#define _XLockMutex(lock) if (_XLockMutex_fn) (*_XLockMutex_fn)(lock) +#define _XUnlockMutex(lock) if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock) +#endif +#define _XCreateMutex(lock) if (_XCreateMutex_fn) (*_XCreateMutex_fn)(lock); +#define _XFreeMutex(lock) if (_XFreeMutex_fn) (*_XFreeMutex_fn)(lock); + +#else /* XTHREADS */ +#define LockDisplay(dis) +#define _XLockMutex(lock) +#define _XUnlockMutex(lock) +#define UnlockDisplay(dis) +#define _XCreateMutex(lock) +#define _XFreeMutex(lock) +#endif + +#define Xfree(ptr) free((ptr)) + +/* + * Note that some machines do not return a valid pointer for malloc(0), in + * which case we provide an alternate under the control of the + * define MALLOC_0_RETURNS_NULL. This is necessary because some + * Xlib code expects malloc(0) to return a valid pointer to storage. + */ +#ifdef MALLOC_0_RETURNS_NULL + +# define Xmalloc(size) malloc(((size) == 0 ? 1 : (size))) +# define Xrealloc(ptr, size) realloc((ptr), ((size) == 0 ? 1 : (size))) +# define Xcalloc(nelem, elsize) calloc(((nelem) == 0 ? 1 : (nelem)), (elsize)) + +#else + +# define Xmalloc(size) malloc((size)) +# define Xrealloc(ptr, size) realloc((ptr), (size)) +# define Xcalloc(nelem, elsize) calloc((nelem), (elsize)) + +#endif + +#include <stddef.h> + +#define LOCKED 1 +#define UNLOCKED 0 + +#ifndef BUFSIZE +#define BUFSIZE 2048 /* X output buffer size. */ +#endif +#ifndef PTSPERBATCH +#define PTSPERBATCH 1024 /* point batching */ +#endif +#ifndef WLNSPERBATCH +#define WLNSPERBATCH 50 /* wide line batching */ +#endif +#ifndef ZLNSPERBATCH +#define ZLNSPERBATCH 1024 /* thin line batching */ +#endif +#ifndef WRCTSPERBATCH +#define WRCTSPERBATCH 10 /* wide line rectangle batching */ +#endif +#ifndef ZRCTSPERBATCH +#define ZRCTSPERBATCH 256 /* thin line rectangle batching */ +#endif +#ifndef FRCTSPERBATCH +#define FRCTSPERBATCH 256 /* filled rectangle batching */ +#endif +#ifndef FARCSPERBATCH +#define FARCSPERBATCH 256 /* filled arc batching */ +#endif +#ifndef CURSORFONT +#define CURSORFONT "cursor" /* standard cursor fonts */ +#endif + +/* + * Display flags + */ +#define XlibDisplayIOError (1L << 0) +#define XlibDisplayClosing (1L << 1) +#define XlibDisplayNoXkb (1L << 2) +#define XlibDisplayPrivSync (1L << 3) +#define XlibDisplayProcConni (1L << 4) /* in _XProcessInternalConnection */ +#define XlibDisplayReadEvents (1L << 5) /* in _XReadEvents */ +#define XlibDisplayReply (1L << 5) /* in _XReply */ +#define XlibDisplayWriting (1L << 6) /* in _XFlushInt, _XSend */ +#define XlibDisplayDfltRMDB (1L << 7) /* mark if RM db from XGetDefault */ + +/* + * X Protocol packetizing macros. + */ + +/* Need to start requests on 64 bit word boundaries + * on a CRAY computer so add a NoOp (127) if needed. + * A character pointer on a CRAY computer will be non-zero + * after shifting right 61 bits of it is not pointing to + * a word boundary. + */ +#ifdef WORD64 +#define WORD64ALIGN if ((long)dpy->bufptr >> 61) {\ + dpy->last_req = dpy->bufptr;\ + *(dpy->bufptr) = X_NoOperation;\ + *(dpy->bufptr+1) = 0;\ + *(dpy->bufptr+2) = 0;\ + *(dpy->bufptr+3) = 1;\ + dpy->request++;\ + dpy->bufptr += 4;\ + } +#else /* else does not require alignment on 64-bit boundaries */ +#define WORD64ALIGN +#endif /* WORD64 */ + + +/* + * GetReq - Get the next available X request packet in the buffer and + * return it. + * + * "name" is the name of the request, e.g. CreatePixmap, OpenFont, etc. + * "req" is the name of the request pointer. + * + */ + +#if !defined(UNIXCPP) || defined(ANSICPP) +#define GetReq(name, req) \ + WORD64ALIGN\ + if ((dpy->bufptr + SIZEOF(x##name##Req)) > dpy->bufmax)\ + _XFlush(dpy);\ + req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\ + req->reqType = X_##name;\ + req->length = (SIZEOF(x##name##Req))>>2;\ + dpy->bufptr += SIZEOF(x##name##Req);\ + dpy->request++ + +#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */ +#define GetReq(name, req) \ + WORD64ALIGN\ + if ((dpy->bufptr + SIZEOF(x/**/name/**/Req)) > dpy->bufmax)\ + _XFlush(dpy);\ + req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\ + req->reqType = X_/**/name;\ + req->length = (SIZEOF(x/**/name/**/Req))>>2;\ + dpy->bufptr += SIZEOF(x/**/name/**/Req);\ + dpy->request++ +#endif + +/* GetReqExtra is the same as GetReq, but allocates "n" additional + bytes after the request. "n" must be a multiple of 4! */ + +#if !defined(UNIXCPP) || defined(ANSICPP) +#define GetReqExtra(name, n, req) \ + WORD64ALIGN\ + if ((dpy->bufptr + SIZEOF(x##name##Req) + n) > dpy->bufmax)\ + _XFlush(dpy);\ + req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\ + req->reqType = X_##name;\ + req->length = (SIZEOF(x##name##Req) + n)>>2;\ + dpy->bufptr += SIZEOF(x##name##Req) + n;\ + dpy->request++ +#else +#define GetReqExtra(name, n, req) \ + WORD64ALIGN\ + if ((dpy->bufptr + SIZEOF(x/**/name/**/Req) + n) > dpy->bufmax)\ + _XFlush(dpy);\ + req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\ + req->reqType = X_/**/name;\ + req->length = (SIZEOF(x/**/name/**/Req) + n)>>2;\ + dpy->bufptr += SIZEOF(x/**/name/**/Req) + n;\ + dpy->request++ +#endif + + +/* + * GetResReq is for those requests that have a resource ID + * (Window, Pixmap, GContext, etc.) as their single argument. + * "rid" is the name of the resource. + */ + +#if !defined(UNIXCPP) || defined(ANSICPP) +#define GetResReq(name, rid, req) \ + WORD64ALIGN\ + if ((dpy->bufptr + SIZEOF(xResourceReq)) > dpy->bufmax)\ + _XFlush(dpy);\ + req = (xResourceReq *) (dpy->last_req = dpy->bufptr);\ + req->reqType = X_##name;\ + req->length = 2;\ + req->id = (rid);\ + dpy->bufptr += SIZEOF(xResourceReq);\ + dpy->request++ +#else +#define GetResReq(name, rid, req) \ + WORD64ALIGN\ + if ((dpy->bufptr + SIZEOF(xResourceReq)) > dpy->bufmax)\ + _XFlush(dpy);\ + req = (xResourceReq *) (dpy->last_req = dpy->bufptr);\ + req->reqType = X_/**/name;\ + req->length = 2;\ + req->id = (rid);\ + dpy->bufptr += SIZEOF(xResourceReq);\ + dpy->request++ +#endif + +/* + * GetEmptyReq is for those requests that have no arguments + * at all. + */ +#if !defined(UNIXCPP) || defined(ANSICPP) +#define GetEmptyReq(name, req) \ + WORD64ALIGN\ + if ((dpy->bufptr + SIZEOF(xReq)) > dpy->bufmax)\ + _XFlush(dpy);\ + req = (xReq *) (dpy->last_req = dpy->bufptr);\ + req->reqType = X_##name;\ + req->length = 1;\ + dpy->bufptr += SIZEOF(xReq);\ + dpy->request++ +#else +#define GetEmptyReq(name, req) \ + WORD64ALIGN\ + if ((dpy->bufptr + SIZEOF(xReq)) > dpy->bufmax)\ + _XFlush(dpy);\ + req = (xReq *) (dpy->last_req = dpy->bufptr);\ + req->reqType = X_/**/name;\ + req->length = 1;\ + dpy->bufptr += SIZEOF(xReq);\ + dpy->request++ +#endif + +#ifdef WORD64 +#define MakeBigReq(req,n) \ + { \ + char _BRdat[4]; \ + unsigned long _BRlen = req->length - 1; \ + req->length = 0; \ + memcpy(_BRdat, ((char *)req) + (_BRlen << 2), 4); \ + memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \ + memcpy(((char *)req) + 4, _BRdat, 4); \ + Data32(dpy, (long *)&_BRdat, 4); \ + } +#else +#ifdef LONG64 +#define MakeBigReq(req,n) \ + { \ + CARD64 _BRdat; \ + CARD32 _BRlen = req->length - 1; \ + req->length = 0; \ + _BRdat = ((CARD32 *)req)[_BRlen]; \ + memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \ + ((CARD32 *)req)[1] = _BRlen + n + 2; \ + Data32(dpy, &_BRdat, 4); \ + } +#else +#define MakeBigReq(req,n) \ + { \ + CARD32 _BRdat; \ + CARD32 _BRlen = req->length - 1; \ + req->length = 0; \ + _BRdat = ((CARD32 *)req)[_BRlen]; \ + memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \ + ((CARD32 *)req)[1] = _BRlen + n + 2; \ + Data32(dpy, &_BRdat, 4); \ + } +#endif +#endif + +#define SetReqLen(req,n,badlen) \ + if ((req->length + n) > (unsigned)65535) { \ + if (dpy->bigreq_size) { \ + MakeBigReq(req,n) \ + } else { \ + n = badlen; \ + req->length += n; \ + } \ + } else \ + req->length += n + +#define SyncHandle() \ + if (dpy->synchandler) (*dpy->synchandler)(dpy) + +extern void _XFlushGCCache(Display *dpy, GC gc); +#define FlushGC(dpy, gc) \ + if ((gc)->dirty) _XFlushGCCache((dpy), (gc)) +/* + * Data - Place data in the buffer and pad the end to provide + * 32 bit word alignment. Transmit if the buffer fills. + * + * "dpy" is a pointer to a Display. + * "data" is a pinter to a data buffer. + * "len" is the length of the data buffer. + */ +#ifndef DataRoutineIsProcedure +#define Data(dpy, data, len) {\ + if (dpy->bufptr + (len) <= dpy->bufmax) {\ + memcpy(dpy->bufptr, data, (int)len);\ + dpy->bufptr += ((len) + 3) & ~3;\ + } else\ + _XSend(dpy, data, len);\ + } +#endif /* DataRoutineIsProcedure */ + + +/* Allocate bytes from the buffer. No padding is done, so if + * the length is not a multiple of 4, the caller must be + * careful to leave the buffer aligned after sending the + * current request. + * + * "type" is the type of the pointer being assigned to. + * "ptr" is the pointer being assigned to. + * "n" is the number of bytes to allocate. + * + * Example: + * xTextElt *elt; + * BufAlloc (xTextElt *, elt, nbytes) + */ + +#define BufAlloc(type, ptr, n) \ + if (dpy->bufptr + (n) > dpy->bufmax) \ + _XFlush (dpy); \ + ptr = (type) dpy->bufptr; \ + (void)ptr; \ + dpy->bufptr += (n); + +#ifdef WORD64 +#define Data16(dpy, data, len) _XData16(dpy, (short *)data, len) +#define Data32(dpy, data, len) _XData32(dpy, (long *)data, len) +#else +#define Data16(dpy, data, len) Data((dpy), (char *)(data), (len)) +#define _XRead16Pad(dpy, data, len) _XReadPad((dpy), (char *)(data), (len)) +#define _XRead16(dpy, data, len) _XRead((dpy), (char *)(data), (len)) +#ifdef LONG64 +#define Data32(dpy, data, len) _XData32(dpy, (long *)data, len) +extern int _XData32( + Display *dpy, + register long *data, + unsigned len +); +extern void _XRead32( + Display *dpy, + register long *data, + long len +); +#else +#define Data32(dpy, data, len) Data((dpy), (char *)(data), (len)) +#define _XRead32(dpy, data, len) _XRead((dpy), (char *)(data), (len)) +#endif +#endif /* not WORD64 */ + +#define PackData16(dpy,data,len) Data16 (dpy, data, len) +#define PackData32(dpy,data,len) Data32 (dpy, data, len) + +/* Xlib manual is bogus */ +#define PackData(dpy,data,len) PackData16 (dpy, data, len) + +#define min(a,b) (((a) < (b)) ? (a) : (b)) +#define max(a,b) (((a) > (b)) ? (a) : (b)) + +#define CI_NONEXISTCHAR(cs) (((cs)->width == 0) && \ + (((cs)->rbearing|(cs)->lbearing| \ + (cs)->ascent|(cs)->descent) == 0)) + +/* + * CI_GET_CHAR_INFO_1D - return the charinfo struct for the indicated 8bit + * character. If the character is in the column and exists, then return the + * appropriate metrics (note that fonts with common per-character metrics will + * return min_bounds). If none of these hold true, try again with the default + * char. + */ +#define CI_GET_CHAR_INFO_1D(fs,col,def,cs) \ +{ \ + cs = def; \ + if (col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \ + if (fs->per_char == NULL) { \ + cs = &fs->min_bounds; \ + } else { \ + cs = &fs->per_char[(col - fs->min_char_or_byte2)]; \ + if (CI_NONEXISTCHAR(cs)) cs = def; \ + } \ + } \ +} + +#define CI_GET_DEFAULT_INFO_1D(fs,cs) \ + CI_GET_CHAR_INFO_1D (fs, fs->default_char, NULL, cs) + + + +/* + * CI_GET_CHAR_INFO_2D - return the charinfo struct for the indicated row and + * column. This is used for fonts that have more than row zero. + */ +#define CI_GET_CHAR_INFO_2D(fs,row,col,def,cs) \ +{ \ + cs = def; \ + if (row >= fs->min_byte1 && row <= fs->max_byte1 && \ + col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \ + if (fs->per_char == NULL) { \ + cs = &fs->min_bounds; \ + } else { \ + cs = &fs->per_char[((row - fs->min_byte1) * \ + (fs->max_char_or_byte2 - \ + fs->min_char_or_byte2 + 1)) + \ + (col - fs->min_char_or_byte2)]; \ + if (CI_NONEXISTCHAR(cs)) cs = def; \ + } \ + } \ +} + +#define CI_GET_DEFAULT_INFO_2D(fs,cs) \ +{ \ + unsigned int r = (fs->default_char >> 8); \ + unsigned int c = (fs->default_char & 0xff); \ + CI_GET_CHAR_INFO_2D (fs, r, c, NULL, cs); \ +} + + +#ifdef MUSTCOPY + +/* for when 32-bit alignment is not good enough */ +#define OneDataCard32(dpy,dstaddr,srcvar) \ + { dpy->bufptr -= 4; Data32 (dpy, (char *) &(srcvar), 4); } + +#else + +/* srcvar must be a variable for large architecture version */ +#define OneDataCard32(dpy,dstaddr,srcvar) \ + { *(CARD32 *)(dstaddr) = (srcvar); } + +#endif /* MUSTCOPY */ + +typedef struct _XInternalAsync { + struct _XInternalAsync *next; + /* + * handler arguments: + * rep is the generic reply that caused this handler + * to be invoked. It must also be passed to _XGetAsyncReply. + * buf and len are opaque values that must be passed to + * _XGetAsyncReply or _XGetAsyncData. + * data is the closure stored in this struct. + * The handler returns True iff it handled this reply. + */ + Bool (*handler)( + Display* /* dpy */, + xReply* /* rep */, + char* /* buf */, + int /* len */, + XPointer /* data */ + ); + XPointer data; +} _XAsyncHandler; + +typedef struct _XAsyncEState { + unsigned long min_sequence_number; + unsigned long max_sequence_number; + unsigned char error_code; + unsigned char major_opcode; + unsigned short minor_opcode; + unsigned char last_error_received; + int error_count; +} _XAsyncErrorState; + +extern void _XDeqAsyncHandler(Display *dpy, _XAsyncHandler *handler); +#define DeqAsyncHandler(dpy,handler) { \ + if (dpy->async_handlers == (handler)) \ + dpy->async_handlers = (handler)->next; \ + else \ + _XDeqAsyncHandler(dpy, handler); \ + } + +typedef void (*FreeFuncType) ( + Display* /* display */ +); + +typedef int (*FreeModmapType) ( + XModifierKeymap* /* modmap */ +); + +/* + * This structure is private to the library. + */ +typedef struct _XFreeFuncs { + FreeFuncType atoms; /* _XFreeAtomTable */ + FreeModmapType modifiermap; /* XFreeModifierMap */ + FreeFuncType key_bindings; /* _XFreeKeyBindings */ + FreeFuncType context_db; /* _XFreeContextDB */ + FreeFuncType defaultCCCs; /* _XcmsFreeDefaultCCCs */ + FreeFuncType clientCmaps; /* _XcmsFreeClientCmaps */ + FreeFuncType intensityMaps; /* _XcmsFreeIntensityMaps */ + FreeFuncType im_filters; /* _XFreeIMFilters */ + FreeFuncType xkb; /* _XkbFreeInfo */ +} _XFreeFuncRec; + +/* types for InitExt.c */ +typedef int (*CreateGCType) ( + Display* /* display */, + GC /* gc */, + XExtCodes* /* codes */ +); + +typedef int (*CopyGCType)( + Display* /* display */, + GC /* gc */, + XExtCodes* /* codes */ +); + +typedef int (*FlushGCType) ( + Display* /* display */, + GC /* gc */, + XExtCodes* /* codes */ +); + +typedef int (*FreeGCType) ( + Display* /* display */, + GC /* gc */, + XExtCodes* /* codes */ +); + +typedef int (*CreateFontType) ( + Display* /* display */, + XFontStruct* /* fs */, + XExtCodes* /* codes */ +); + +typedef int (*FreeFontType) ( + Display* /* display */, + XFontStruct* /* fs */, + XExtCodes* /* codes */ +); + +typedef int (*CloseDisplayType) ( + Display* /* display */, + XExtCodes* /* codes */ +); + +typedef int (*ErrorType) ( + Display* /* display */, + xError* /* err */, + XExtCodes* /* codes */, + int* /* ret_code */ +); + +typedef char* (*ErrorStringType) ( + Display* /* display */, + int /* code */, + XExtCodes* /* codes */, + char* /* buffer */, + int /* nbytes */ +); + +typedef void (*PrintErrorType)( + Display* /* display */, + XErrorEvent* /* ev */, + void* /* fp */ +); + +typedef void (*BeforeFlushType)( + Display* /* display */, + XExtCodes* /* codes */, + _Xconst char* /* data */, + long /* len */ +); + +/* + * This structure is private to the library. + */ +typedef struct _XExten { /* private to extension mechanism */ + struct _XExten *next; /* next in list */ + XExtCodes codes; /* public information, all extension told */ + CreateGCType create_GC; /* routine to call when GC created */ + CopyGCType copy_GC; /* routine to call when GC copied */ + FlushGCType flush_GC; /* routine to call when GC flushed */ + FreeGCType free_GC; /* routine to call when GC freed */ + CreateFontType create_Font; /* routine to call when Font created */ + FreeFontType free_Font; /* routine to call when Font freed */ + CloseDisplayType close_display; /* routine to call when connection closed */ + ErrorType error; /* who to call when an error occurs */ + ErrorStringType error_string; /* routine to supply error string */ + char *name; /* name of this extension */ + PrintErrorType error_values; /* routine to supply error values */ + BeforeFlushType before_flush; /* routine to call when sending data */ + struct _XExten *next_flush; /* next in list of those with flushes */ +} _XExtension; + +/* extension hooks */ + +#ifdef DataRoutineIsProcedure +extern void Data(Display *dpy, char *data, long len); +#endif +extern int _XError( + Display* /* dpy */, + xError* /* rep */ +); +extern int _XIOError( + Display* /* dpy */ +); +extern int (*_XIOErrorFunction)( + Display* /* dpy */ +); +extern int (*_XErrorFunction)( + Display* /* dpy */, + XErrorEvent* /* error_event */ +); +extern void _XEatData( + Display* /* dpy */, + unsigned long /* n */ +); +extern char *_XAllocScratch( + Display* /* dpy */, + unsigned long /* nbytes */ +); +extern char *_XAllocTemp( + Display* /* dpy */, + unsigned long /* nbytes */ +); +extern void _XFreeTemp( + Display* /* dpy */, + char* /* buf */, + unsigned long /* nbytes */ +); +extern Visual *_XVIDtoVisual( + Display* /* dpy */, + VisualID /* id */ +); +extern unsigned long _XSetLastRequestRead( + Display* /* dpy */, + xGenericReply* /* rep */ +); +extern int _XGetHostname( + char* /* buf */, + int /* maxlen */ +); +extern Screen *_XScreenOfWindow( + Display* /* dpy */, + Window /* w */ +); +extern Bool _XAsyncErrorHandler( + Display* /* dpy */, + xReply* /* rep */, + char* /* buf */, + int /* len */, + XPointer /* data */ +); +extern char *_XGetAsyncReply( + Display* /* dpy */, + char* /* replbuf */, + xReply* /* rep */, + char* /* buf */, + int /* len */, + int /* extra */, + Bool /* discard */ +); +extern void _XGetAsyncData( + Display* /* dpy */, + char * /* data */, + char * /* buf */, + int /* len */, + int /* skip */, + int /* datalen */, + int /* discardtotal */ +); +extern void _XFlush( + Display* /* dpy */ +); +extern int _XEventsQueued( + Display* /* dpy */, + int /* mode */ +); +extern void _XReadEvents( + Display* /* dpy */ +); +extern int _XRead( + Display* /* dpy */, + char* /* data */, + long /* size */ +); +extern void _XReadPad( + Display* /* dpy */, + char* /* data */, + long /* size */ +); +extern void _XSend( + Display* /* dpy */, + _Xconst char* /* data */, + long /* size */ +); +extern Status _XReply( + Display* /* dpy */, + xReply* /* rep */, + int /* extra */, + Bool /* discard */ +); +extern void _XEnq( + Display* /* dpy */, + xEvent* /* event */ +); +extern void _XDeq( + Display* /* dpy */, + _XQEvent* /* prev */, + _XQEvent* /* qelt */ +); + +extern Bool _XUnknownWireEvent( + Display* /* dpy */, + XEvent* /* re */, + xEvent* /* event */ +); + +extern Bool _XUnknownWireEventCookie( + Display* /* dpy */, + XGenericEventCookie* /* re */, + xEvent* /* event */ +); + +extern Bool _XUnknownCopyEventCookie( + Display* /* dpy */, + XGenericEventCookie* /* in */, + XGenericEventCookie* /* out */ +); + +extern Status _XUnknownNativeEvent( + Display* /* dpy */, + XEvent* /* re */, + xEvent* /* event */ +); + +extern Bool _XWireToEvent(Display *dpy, XEvent *re, xEvent *event); +extern Bool _XDefaultWireError(Display *display, XErrorEvent *he, xError *we); +extern Bool _XPollfdCacheInit(Display *dpy); +extern void _XPollfdCacheAdd(Display *dpy, int fd); +extern void _XPollfdCacheDel(Display *dpy, int fd); +extern XID _XAllocID(Display *dpy); +extern void _XAllocIDs(Display *dpy, XID *ids, int count); + +extern int _XFreeExtData( + XExtData* /* extension */ +); + +extern int (*XESetCreateGC( + Display* /* display */, + int /* extension */, + int (*) ( + Display* /* display */, + GC /* gc */, + XExtCodes* /* codes */ + ) /* proc */ +))( + Display*, GC, XExtCodes* +); + +extern int (*XESetCopyGC( + Display* /* display */, + int /* extension */, + int (*) ( + Display* /* display */, + GC /* gc */, + XExtCodes* /* codes */ + ) /* proc */ +))( + Display*, GC, XExtCodes* +); + +extern int (*XESetFlushGC( + Display* /* display */, + int /* extension */, + int (*) ( + Display* /* display */, + GC /* gc */, + XExtCodes* /* codes */ + ) /* proc */ +))( + Display*, GC, XExtCodes* +); + +extern int (*XESetFreeGC( + Display* /* display */, + int /* extension */, + int (*) ( + Display* /* display */, + GC /* gc */, + XExtCodes* /* codes */ + ) /* proc */ +))( + Display*, GC, XExtCodes* +); + +extern int (*XESetCreateFont( + Display* /* display */, + int /* extension */, + int (*) ( + Display* /* display */, + XFontStruct* /* fs */, + XExtCodes* /* codes */ + ) /* proc */ +))( + Display*, XFontStruct*, XExtCodes* +); + +extern int (*XESetFreeFont( + Display* /* display */, + int /* extension */, + int (*) ( + Display* /* display */, + XFontStruct* /* fs */, + XExtCodes* /* codes */ + ) /* proc */ +))( + Display*, XFontStruct*, XExtCodes* +); + +extern int (*XESetCloseDisplay( + Display* /* display */, + int /* extension */, + int (*) ( + Display* /* display */, + XExtCodes* /* codes */ + ) /* proc */ +))( + Display*, XExtCodes* +); + +extern int (*XESetError( + Display* /* display */, + int /* extension */, + int (*) ( + Display* /* display */, + xError* /* err */, + XExtCodes* /* codes */, + int* /* ret_code */ + ) /* proc */ +))( + Display*, xError*, XExtCodes*, int* +); + +extern char* (*XESetErrorString( + Display* /* display */, + int /* extension */, + char* (*) ( + Display* /* display */, + int /* code */, + XExtCodes* /* codes */, + char* /* buffer */, + int /* nbytes */ + ) /* proc */ +))( + Display*, int, XExtCodes*, char*, int +); + +extern void (*XESetPrintErrorValues ( + Display* /* display */, + int /* extension */, + void (*)( + Display* /* display */, + XErrorEvent* /* ev */, + void* /* fp */ + ) /* proc */ +))( + Display*, XErrorEvent*, void* +); + +extern Bool (*XESetWireToEvent( + Display* /* display */, + int /* event_number */, + Bool (*) ( + Display* /* display */, + XEvent* /* re */, + xEvent* /* event */ + ) /* proc */ +))( + Display*, XEvent*, xEvent* +); + +extern Bool (*XESetWireToEventCookie( + Display* /* display */, + int /* extension */, + Bool (*) ( + Display* /* display */, + XGenericEventCookie* /* re */, + xEvent* /* event */ + ) /* proc */ +))( + Display*, XGenericEventCookie*, xEvent* +); + +extern Bool (*XESetCopyEventCookie( + Display* /* display */, + int /* extension */, + Bool (*) ( + Display* /* display */, + XGenericEventCookie* /* in */, + XGenericEventCookie* /* out */ + ) /* proc */ +))( + Display*, XGenericEventCookie*, XGenericEventCookie* +); + + +extern Status (*XESetEventToWire( + Display* /* display */, + int /* event_number */, + Status (*) ( + Display* /* display */, + XEvent* /* re */, + xEvent* /* event */ + ) /* proc */ +))( + Display*, XEvent*, xEvent* +); + +extern Bool (*XESetWireToError( + Display* /* display */, + int /* error_number */, + Bool (*) ( + Display* /* display */, + XErrorEvent* /* he */, + xError* /* we */ + ) /* proc */ +))( + Display*, XErrorEvent*, xError* +); + +extern void (*XESetBeforeFlush( + Display* /* display */, + int /* error_number */, + void (*) ( + Display* /* display */, + XExtCodes* /* codes */, + _Xconst char* /* data */, + long /* len */ + ) /* proc */ +))( + Display*, XExtCodes*, _Xconst char*, long +); + +/* internal connections for IMs */ + +typedef void (*_XInternalConnectionProc)( + Display* /* dpy */, + int /* fd */, + XPointer /* call_data */ +); + + +extern Status _XRegisterInternalConnection( + Display* /* dpy */, + int /* fd */, + _XInternalConnectionProc /* callback */, + XPointer /* call_data */ +); + +extern void _XUnregisterInternalConnection( + Display* /* dpy */, + int /* fd */ +); + +extern void _XProcessInternalConnection( + Display* /* dpy */, + struct _XConnectionInfo* /* conn_info */ +); + +/* Display structure has pointers to these */ + +struct _XConnectionInfo { /* info from _XRegisterInternalConnection */ + int fd; + _XInternalConnectionProc read_callback; + XPointer call_data; + XPointer *watch_data; /* set/used by XConnectionWatchProc */ + struct _XConnectionInfo *next; +}; + +struct _XConnWatchInfo { /* info from XAddConnectionWatch */ + XConnectionWatchProc fn; + XPointer client_data; + struct _XConnWatchInfo *next; +}; + +#ifdef __UNIXOS2__ +extern char* __XOS2RedirRoot( + char* +); +#endif + +extern int _XTextHeight( + XFontStruct* /* font_struct */, + _Xconst char* /* string */, + int /* count */ +); + +extern int _XTextHeight16( + XFontStruct* /* font_struct */, + _Xconst XChar2b* /* string */, + int /* count */ +); + +#if defined(WIN32) + +extern int _XOpenFile( + _Xconst char* /* path */, + int /* flags */ +); + +extern int _XOpenFileMode( + _Xconst char* /* path */, + int /* flags */, + mode_t /* mode */ +); + +extern void* _XFopenFile( + _Xconst char* /* path */, + _Xconst char* /* mode */ +); + +extern int _XAccessFile( + _Xconst char* /* path */ +); +#else +#define _XOpenFile(path,flags) open(path,flags) +#define _XOpenFileMode(path,flags,mode) open(path,flags,mode) +#define _XFopenFile(path,mode) fopen(path,mode) +#endif + +/* EvToWire.c */ +extern Status _XEventToWire(Display *dpy, XEvent *re, xEvent *event); + +extern int _XF86LoadQueryLocaleFont( + Display* /* dpy */, + _Xconst char* /* name*/, + XFontStruct** /* xfp*/, + Font* /* fidp */ +); + +extern void _XProcessWindowAttributes ( + register Display *dpy, + xChangeWindowAttributesReq *req, + register unsigned long valuemask, + register XSetWindowAttributes *attributes); + +extern int _XDefaultError( + Display *dpy, + XErrorEvent *event); + +extern int _XDefaultIOError( + Display *dpy); + +extern void _XSetClipRectangles ( + register Display *dpy, + GC gc, + int clip_x_origin, int clip_y_origin, + XRectangle *rectangles, + int n, + int ordering); + +Status _XGetWindowAttributes( + register Display *dpy, + Window w, + XWindowAttributes *attr); + +int _XPutBackEvent ( + register Display *dpy, + register XEvent *event); + +extern Bool _XIsEventCookie( + Display *dpy, + XEvent *ev); + +extern void _XFreeEventCookies( + Display *dpy); + +extern void _XStoreEventCookie( + Display *dpy, + XEvent *ev); + +extern Bool _XFetchEventCookie( + Display *dpy, + XGenericEventCookie *ev); + +extern Bool _XCopyEventCookie( + Display *dpy, + XGenericEventCookie *in, + XGenericEventCookie *out); + +_XFUNCPROTOEND + +#endif /* _XLIBINT_H_ */ diff --git a/X11/Xlocale.h b/X11/Xlocale.h new file mode 100644 index 000000000..61d2f7a84 --- /dev/null +++ b/X11/Xlocale.h @@ -0,0 +1,61 @@ +/* $Xorg: Xlocale.h,v 1.4 2001/02/09 02:03:38 xorgcvs Exp $ */ +/* + +Copyright 1991, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ +/* $XFree86: xc/lib/X11/Xlocale.h,v 1.4 2001/12/14 19:54:09 dawes Exp $ */ + +#ifndef _XLOCALE_H_ +#define _XLOCALE_H_ + +#include <X11/Xfuncproto.h> +#include <X11/Xosdefs.h> + +#ifndef X_LOCALE +#include <locale.h> +#else + +#define LC_ALL 0 +#define LC_COLLATE 1 +#define LC_CTYPE 2 +#define LC_MONETARY 3 +#define LC_NUMERIC 4 +#define LC_TIME 5 + +_XFUNCPROTOBEGIN +extern char *_Xsetlocale( + int /* category */, + _Xconst char* /* name */ +); +_XFUNCPROTOEND + +#define setlocale _Xsetlocale + +#include <stddef.h> + +#endif /* X_LOCALE */ + +#endif /* _XLOCALE_H_ */ @@ -1,148 +1,148 @@ -/* - * -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - * - * The X Window System is a Trademark of The Open Group. - * - */ - -/* This is a collection of things to try and minimize system dependencies - * in a "significant" number of source files. - */ - -#ifndef _XOS_H_ -# define _XOS_H_ - -# include <X11/Xosdefs.h> - -/* - * Get major data types (esp. caddr_t) - */ - -# include <sys/types.h> - -# if defined(__SCO__) || defined(__UNIXWARE__) -# include <stdint.h> -# endif - - -/* - * Just about everyone needs the strings routines. We provide both forms here, - * index/rindex and strchr/strrchr, so any systems that don't provide them all - * need to have #defines here. - * - * These macros are defined this way, rather than, e.g.: - * #defined index(s,c) strchr(s,c) - * because someone might be using them as function pointers, and such - * a change would break compatibility for anyone who's relying on them - * being the way they currently are. So we're stuck with them this way, - * which can be really inconvenient. :-( - */ - -# include <string.h> -# if defined(__SCO__) || defined(__UNIXWARE__) || defined(__sun) -# include <strings.h> -# else -# ifndef index -# define index(s,c) (strchr((s),(c))) -# endif -# ifndef rindex -# define rindex(s,c) (strrchr((s),(c))) -# endif -# endif - -/* - * Get open(2) constants - */ -# if defined(X_NOT_POSIX) -# include <fcntl.h> -# if defined(USL) || defined(__i386__) && (defined(SYSV) || defined(SVR4)) -# include <unistd.h> -# endif -# ifdef WIN32 -# include <X11/Xw32defs.h> -# else -# include <sys/file.h> -# endif -# else /* X_NOT_POSIX */ -# include <fcntl.h> -# include <unistd.h> -# endif /* X_NOT_POSIX else */ - -/* - * Get struct timeval and struct tm - */ - -# if defined(_POSIX_SOURCE) && defined(SVR4) -/* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */ -# undef _POSIX_SOURCE -# include <sys/time.h> -# define _POSIX_SOURCE -# elif defined(WIN32) -# include <time.h> -# if !defined(_WINSOCKAPI_) && !defined(_WILLWINSOCK_) && !defined(_TIMEVAL_DEFINED) && !defined(_STRUCT_TIMEVAL) -struct timeval { - long tv_sec; /* seconds */ - long tv_usec; /* and microseconds */ -}; -# define _TIMEVAL_DEFINED -# endif -# include <sys/timeb.h> -# define gettimeofday(t) \ -{ \ - struct _timeb _gtodtmp; \ - _ftime (&_gtodtmp); \ - (t)->tv_sec = _gtodtmp.time; \ - (t)->tv_usec = _gtodtmp.millitm * 1000; \ -} -# else -# include <sys/time.h> -# include <time.h> -# endif /* defined(_POSIX_SOURCE) && defined(SVR4) */ - -/* define X_GETTIMEOFDAY macro, a portable gettimeofday() */ -# if defined(_XOPEN_XPG4) || defined(_XOPEN_UNIX) /* _XOPEN_UNIX is XPG4.2 */ -# define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*)0) -# else -# if defined(SVR4) || defined(__SVR4) || defined(WIN32) -# define X_GETTIMEOFDAY(t) gettimeofday(t) -# else -# define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*)0) -# endif -# endif /* XPG4 else */ - - -# ifdef __GNU__ -# define PATH_MAX 4096 -# define MAXPATHLEN 4096 -# define OPEN_MAX 256 /* We define a reasonable limit. */ -# endif - -/* use POSIX name for signal */ -# if defined(X_NOT_POSIX) && defined(SYSV) && !defined(SIGCHLD) -# define SIGCHLD SIGCLD -# endif - -# include <X11/Xarch.h> - -#endif /* _XOS_H_ */ +/*
+ *
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ *
+ * The X Window System is a Trademark of The Open Group.
+ *
+ */
+
+/* This is a collection of things to try and minimize system dependencies
+ * in a "significant" number of source files.
+ */
+
+#ifndef _XOS_H_
+# define _XOS_H_
+
+# include <X11/Xosdefs.h>
+
+/*
+ * Get major data types (esp. caddr_t)
+ */
+
+# include <sys/types.h>
+
+# if defined(__SCO__) || defined(__UNIXWARE__)
+# include <stdint.h>
+# endif
+
+
+/*
+ * Just about everyone needs the strings routines. We provide both forms here,
+ * index/rindex and strchr/strrchr, so any systems that don't provide them all
+ * need to have #defines here.
+ *
+ * These macros are defined this way, rather than, e.g.:
+ * #defined index(s,c) strchr(s,c)
+ * because someone might be using them as function pointers, and such
+ * a change would break compatibility for anyone who's relying on them
+ * being the way they currently are. So we're stuck with them this way,
+ * which can be really inconvenient. :-(
+ */
+
+# include <string.h>
+# if defined(__SCO__) || defined(__UNIXWARE__) || defined(__sun)
+# include <strings.h>
+# else
+# ifndef index
+# define index(s,c) (strchr((s),(c)))
+# endif
+# ifndef rindex
+# define rindex(s,c) (strrchr((s),(c)))
+# endif
+# endif
+
+/*
+ * Get open(2) constants
+ */
+# if defined(X_NOT_POSIX)
+# include <fcntl.h>
+# if defined(USL) || defined(__i386__) && (defined(SYSV) || defined(SVR4))
+# include <unistd.h>
+# endif
+# ifdef WIN32
+# include <X11/Xw32defs.h>
+# else
+# include <sys/file.h>
+# endif
+# else /* X_NOT_POSIX */
+# include <fcntl.h>
+# include <unistd.h>
+# endif /* X_NOT_POSIX else */
+
+/*
+ * Get struct timeval and struct tm
+ */
+
+# if defined(_POSIX_SOURCE) && defined(SVR4)
+/* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */
+# undef _POSIX_SOURCE
+# include <sys/time.h>
+# define _POSIX_SOURCE
+# elif defined(WIN32)
+# include <time.h>
+# if !defined(_WINSOCKAPI_) && !defined(_WILLWINSOCK_) && !defined(_TIMEVAL_DEFINED) && !defined(_STRUCT_TIMEVAL)
+struct timeval {
+ long tv_sec; /* seconds */
+ long tv_usec; /* and microseconds */
+};
+# define _TIMEVAL_DEFINED
+# endif
+# include <sys/timeb.h>
+# define gettimeofday(t) \
+{ \
+ struct _timeb _gtodtmp; \
+ _ftime (&_gtodtmp); \
+ (t)->tv_sec = _gtodtmp.time; \
+ (t)->tv_usec = _gtodtmp.millitm * 1000; \
+}
+# else
+# include <sys/time.h>
+# include <time.h>
+# endif /* defined(_POSIX_SOURCE) && defined(SVR4) */
+
+/* define X_GETTIMEOFDAY macro, a portable gettimeofday() */
+# if defined(_XOPEN_XPG4) || defined(_XOPEN_UNIX) /* _XOPEN_UNIX is XPG4.2 */
+# define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*)0)
+# else
+# if defined(SVR4) || defined(__SVR4) || defined(WIN32)
+# define X_GETTIMEOFDAY(t) gettimeofday(t)
+# else
+# define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*)0)
+# endif
+# endif /* XPG4 else */
+
+
+# ifdef __GNU__
+# define PATH_MAX 4096
+# define MAXPATHLEN 4096
+# define OPEN_MAX 256 /* We define a reasonable limit. */
+# endif
+
+/* use POSIX name for signal */
+# if defined(X_NOT_POSIX) && defined(SYSV) && !defined(SIGCHLD)
+# define SIGCHLD SIGCLD
+# endif
+
+# include <X11/Xarch.h>
+
+#endif /* _XOS_H_ */
diff --git a/X11/Xpoll.h b/X11/Xpoll.h new file mode 100644 index 000000000..feb1112cf --- /dev/null +++ b/X11/Xpoll.h @@ -0,0 +1,255 @@ +/* $Xorg: Xpoll.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */ + +/* + +Copyright 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ + +/* + * Copyright © 2005 Daniel Stone + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Daniel Stone not be used in advertising + * or publicity pertaining to distribution of the software without specific, + * written prior permission. Daniel Stone makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * DANIEL STONE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * DANIEL STONE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +/* $XFree86: xc/include/Xpoll.h,v 3.8 2001/01/17 17:53:11 dawes Exp $ */ + +#ifndef _XPOLL_H_ +#define _XPOLL_H_ + +#ifndef WIN32 + +#ifndef USE_POLL + +#include <X11/Xos.h> + +/* Below is the monster branch from hell. Basically, most systems will drop to + * 'the branch below is the fallthrough for halfway modern systems', and include + * <sys/select.h>, so we get the FD_* macros. */ +#if !defined(DGUX) +# if (defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE) +# include <sys/select.h> +# ifdef luna +# include <sysent.h> +# endif +# else /* not SVR4/CRAY/AIXv3 */ +# if defined(AIXV4) /* AIX 4.2 fubar-ed <sys/select.h>, so try really hard. */ +# if !defined(NFDBITS) +# include <sys/select.h> +# endif +# else /* the branch below is the fallthrough for halfway modern systems */ +# ifdef __QNX__ /* Make sure we get 256 bit select masks */ +# define FD_SETSIZE 256 +# endif +# include <sys/select.h> +# endif +# endif +#else /* DGUX -- No sys/select in Intel DG/ux */ +# include <sys/time.h> +# include <sys/types.h> +# include <unistd.h> +#endif + +#include <X11/Xmd.h> + +#ifdef CSRG_BASED +#include <sys/param.h> +# if BSD < 199103 +typedef long fd_mask; +# endif +#endif + +#define XFD_SETSIZE 256 + +#ifndef FD_SETSIZE +#define FD_SETSIZE XFD_SETSIZE +#endif + +#ifndef NBBY +#define NBBY 8 /* number of bits in a byte */ +#endif + +#ifndef NFDBITS +#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ +#endif + +#ifndef howmany +#define howmany(x,y) (((x)+((y)-1))/(y)) +#endif + +#if defined(BSD) && BSD < 198911 && !defined(luna) +typedef struct fd_set { + fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; +} fd_set; +#endif + +#ifndef hpux /* and perhaps old BSD ??? */ +# define Select(n,r,w,e,t) select(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t) +#else +# ifndef _XPG4_EXTENDED /* HPUX 9.x and earlier */ +# define Select(n,r,w,e,t) select(n,(int*)r,(int*)w,(int*)e,(struct timeval*)t) +# else +# define Select(n,r,w,e,t) select(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t) +# endif +#endif + +#define __X_FDS_BITS fds_bits + +#ifndef __FDS_BITS +# define __FDS_BITS(p) ((p)->__X_FDS_BITS) +#endif + +#define __XFDS_BITS(p, n) (__FDS_BITS(p))[n] + +#ifndef FD_SET +#define FD_SET(n, p) (__XFDS_BITS(p, ((n)/NFDBITS)) |= ((fd_mask)1 << ((n) % NFDBITS))) +#endif +#ifndef FD_CLR +#define FD_CLR(n, p) (__XFDS_BITS((p), ((n)/NFDBITS)) &= ~((fd_mask)1 << ((n) % NFDBITS))) +#endif +#ifndef FD_ISSET +#define FD_ISSET(n, p) ((__XFDS_BITS((p), ((n)/NFDBITS))) & ((fd_mask)1 << ((n) % NFDBITS))) +#endif +#ifndef FD_ZERO +#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) +#endif + +/* + * The howmany(FD_SETSIZE, NFDBITS) computes the number of elements in the + * array. before accessing an element in the array we check it exists. + * If it does not exist then the compiler discards the code to access it. + */ +#define XFD_ANYSET(p) \ + ((howmany(FD_SETSIZE, NFDBITS) > 0 && (__XFDS_BITS(p, 0))) || \ + (howmany(FD_SETSIZE, NFDBITS) > 1 && (__XFDS_BITS(p, 1))) || \ + (howmany(FD_SETSIZE, NFDBITS) > 2 && (__XFDS_BITS(p, 2))) || \ + (howmany(FD_SETSIZE, NFDBITS) > 3 && (__XFDS_BITS(p, 3))) || \ + (howmany(FD_SETSIZE, NFDBITS) > 4 && (__XFDS_BITS(p, 4))) || \ + (howmany(FD_SETSIZE, NFDBITS) > 5 && (__XFDS_BITS(p, 5))) || \ + (howmany(FD_SETSIZE, NFDBITS) > 6 && (__XFDS_BITS(p, 6))) || \ + (howmany(FD_SETSIZE, NFDBITS) > 7 && (__XFDS_BITS(p, 7)))) + +#define XFD_COPYSET(src,dst) { \ + int __i__; \ + for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \ + __XFDS_BITS((dst), __i__) = __XFDS_BITS((src), __i__); \ + } +#define XFD_ANDSET(dst,b1,b2) { \ + int __i__; \ + for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \ + __XFDS_BITS((dst), __i__) = ((__XFDS_BITS((b1), __i__)) & (__XFDS_BITS((b2), __i__))); \ + } +#define XFD_ORSET(dst,b1,b2) { \ + int __i__; \ + for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \ + __XFDS_BITS((dst), __i__) = ((__XFDS_BITS((b1), __i__)) | (__XFDS_BITS((b2), __i__))); \ + } +#define XFD_UNSET(dst,b1) { \ + int __i__; \ + for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \ + __XFDS_BITS((dst), __i__) &= ~(__XFDS_BITS((b1), __i__)); \ + } + +#else /* USE_POLL */ +#include <sys/poll.h> +#endif /* USE_POLL */ + +#else /* WIN32 */ + +#define XFD_SETSIZE 256 +#ifndef FD_SETSIZE +#define FD_SETSIZE XFD_SETSIZE +#endif +#include <X11/Xwinsock.h> + +#define Select(n,r,w,e,t) select(0,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t) + +#define XFD_SETCOUNT(p) (((fd_set FAR *)(p))->fd_count) +#define XFD_FD(p,i) (((fd_set FAR *)(p))->fd_array[i]) +#define XFD_ANYSET(p) XFD_SETCOUNT(p) + +#define XFD_COPYSET(src,dst) { \ + u_int __i; \ + FD_ZERO(dst); \ + for (__i = 0; __i < XFD_SETCOUNT(src) ; __i++) { \ + XFD_FD(dst,__i) = XFD_FD(src,__i); \ + } \ + XFD_SETCOUNT(dst) = XFD_SETCOUNT(src); \ +} + +#define XFD_ANDSET(dst,b1,b2) { \ + u_int __i; \ + FD_ZERO(dst); \ + for (__i = 0; __i < XFD_SETCOUNT(b1) ; __i++) { \ + if (FD_ISSET(XFD_FD(b1,__i), b2)) \ + FD_SET(XFD_FD(b1,__i), dst); \ + } \ +} + +#define XFD_ORSET(dst,b1,b2) { \ + u_int __i; \ + if (dst != b1) XFD_COPYSET(b1,dst); \ + for (__i = 0; __i < XFD_SETCOUNT(b2) ; __i++) { \ + if (!FD_ISSET(XFD_FD(b2,__i), dst)) \ + FD_SET(XFD_FD(b2,__i), dst); \ + } \ +} + +/* this one is really sub-optimal */ +#define XFD_UNSET(dst,b1) { \ + u_int __i; \ + for (__i = 0; __i < XFD_SETCOUNT(b1) ; __i++) { \ + FD_CLR(XFD_FD(b1,__i), dst); \ + } \ +} + +/* we have to pay the price of having an array here, unlike with bitmasks + calling twice FD_SET with the same fd is not transparent, so be careful */ +#undef FD_SET +#define FD_SET(fd,set) do { \ + if (XFD_SETCOUNT(set) < FD_SETSIZE && !FD_ISSET(fd,set)) \ + XFD_FD(set,XFD_SETCOUNT(set)++)=(fd); \ +} while(0) + +#define getdtablesize() FD_SETSIZE + +#endif /* WIN32 */ + +#endif /* _XPOLL_H_ */ diff --git a/X11/Xregion.h b/X11/Xregion.h new file mode 100644 index 000000000..aca9e7a51 --- /dev/null +++ b/X11/Xregion.h @@ -0,0 +1,190 @@ +/* $Xorg: region.h,v 1.4 2001/02/09 02:03:40 xorgcvs Exp $ */ +/************************************************************************ + +Copyright 1987, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +************************************************************************/ + +#ifndef _XREGION_H +#define _XREGION_H + +typedef struct { + short x1, x2, y1, y2; +} Box, BOX, BoxRec, *BoxPtr; + +typedef struct { + short x, y, width, height; +}RECTANGLE, RectangleRec, *RectanglePtr; + +#define TRUE 1 +#define FALSE 0 +#define MAXSHORT 32767 +#define MINSHORT -MAXSHORT +#ifndef MAX +#define MAX(a,b) (((a) > (b)) ? (a) : (b)) +#endif +#ifndef MIN +#define MIN(a,b) (((a) < (b)) ? (a) : (b)) +#endif + + +/* + * clip region + */ + +typedef struct _XRegion { + long size; + long numRects; + BOX *rects; + BOX extents; +} REGION; + +/* Xutil.h contains the declaration: + * typedef struct _XRegion *Region; + */ + +/* 1 if two BOXs overlap. + * 0 if two BOXs do not overlap. + * Remember, x2 and y2 are not in the region + */ +#define EXTENTCHECK(r1, r2) \ + ((r1)->x2 > (r2)->x1 && \ + (r1)->x1 < (r2)->x2 && \ + (r1)->y2 > (r2)->y1 && \ + (r1)->y1 < (r2)->y2) + +/* + * update region extents + */ +#define EXTENTS(r,idRect){\ + if((r)->x1 < (idRect)->extents.x1)\ + (idRect)->extents.x1 = (r)->x1;\ + if((r)->y1 < (idRect)->extents.y1)\ + (idRect)->extents.y1 = (r)->y1;\ + if((r)->x2 > (idRect)->extents.x2)\ + (idRect)->extents.x2 = (r)->x2;\ + if((r)->y2 > (idRect)->extents.y2)\ + (idRect)->extents.y2 = (r)->y2;\ + } + +/* + * Check to see if there is enough memory in the present region. + */ +#define MEMCHECK(reg, rect, firstrect){\ + if ((reg)->numRects >= ((reg)->size - 1)){\ + (firstrect) = (BOX *) Xrealloc \ + ((char *)(firstrect), (unsigned) (2 * (sizeof(BOX)) * ((reg)->size)));\ + if ((firstrect) == 0)\ + return(0);\ + (reg)->size *= 2;\ + (rect) = &(firstrect)[(reg)->numRects];\ + }\ + } + +/* this routine checks to see if the previous rectangle is the same + * or subsumes the new rectangle to add. + */ + +#define CHECK_PREVIOUS(Reg, R, Rx1, Ry1, Rx2, Ry2)\ + (!(((Reg)->numRects > 0)&&\ + ((R-1)->y1 == (Ry1)) &&\ + ((R-1)->y2 == (Ry2)) &&\ + ((R-1)->x1 <= (Rx1)) &&\ + ((R-1)->x2 >= (Rx2)))) + +/* add a rectangle to the given Region */ +#define ADDRECT(reg, r, rx1, ry1, rx2, ry2){\ + if (((rx1) < (rx2)) && ((ry1) < (ry2)) &&\ + CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\ + (r)->x1 = (rx1);\ + (r)->y1 = (ry1);\ + (r)->x2 = (rx2);\ + (r)->y2 = (ry2);\ + EXTENTS((r), (reg));\ + (reg)->numRects++;\ + (r)++;\ + }\ + } + + + +/* add a rectangle to the given Region */ +#define ADDRECTNOX(reg, r, rx1, ry1, rx2, ry2){\ + if ((rx1 < rx2) && (ry1 < ry2) &&\ + CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\ + (r)->x1 = (rx1);\ + (r)->y1 = (ry1);\ + (r)->x2 = (rx2);\ + (r)->y2 = (ry2);\ + (reg)->numRects++;\ + (r)++;\ + }\ + } + +#define EMPTY_REGION(pReg) pReg->numRects = 0 + +#define REGION_NOT_EMPTY(pReg) pReg->numRects + +#define INBOX(r, x, y) \ + ( ( ((r).x2 > x)) && \ + ( ((r).x1 <= x)) && \ + ( ((r).y2 > y)) && \ + ( ((r).y1 <= y)) ) + +/* + * number of points to buffer before sending them off + * to scanlines() : Must be an even number + */ +#define NUMPTSTOBUFFER 200 + +/* + * used to allocate buffers for points and link + * the buffers together + */ +typedef struct _POINTBLOCK { + XPoint pts[NUMPTSTOBUFFER]; + struct _POINTBLOCK *next; +} POINTBLOCK; + +#endif diff --git a/X11/Xresource.h b/X11/Xresource.h new file mode 100644 index 000000000..56cc5adb4 --- /dev/null +++ b/X11/Xresource.h @@ -0,0 +1,360 @@ +/* $Xorg: Xresource.h,v 1.7 2001/02/09 02:03:39 xorgcvs Exp $ */ + +/*********************************************************** + +Copyright 1987, 1988, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ +/* $XFree86: xc/lib/X11/Xresource.h,v 3.8 2001/12/14 19:54:10 dawes Exp $ */ + +#ifndef _XRESOURCE_H_ +#define _XRESOURCE_H_ + +#ifndef _XP_PRINT_SERVER_ +#include <X11/Xlib.h> +#endif + +/**************************************************************** + **************************************************************** + *** *** + *** *** + *** X Resource Manager Intrinsics *** + *** *** + *** *** + **************************************************************** + ****************************************************************/ + +_XFUNCPROTOBEGIN + +/**************************************************************** + * + * Memory Management + * + ****************************************************************/ + +extern char *Xpermalloc( + unsigned int /* size */ +); + +/**************************************************************** + * + * Quark Management + * + ****************************************************************/ + +typedef int XrmQuark, *XrmQuarkList; +#define NULLQUARK ((XrmQuark) 0) + +typedef char *XrmString; +#define NULLSTRING ((XrmString) 0) + +/* find quark for string, create new quark if none already exists */ +extern XrmQuark XrmStringToQuark( + _Xconst char* /* string */ +); + +extern XrmQuark XrmPermStringToQuark( + _Xconst char* /* string */ +); + +/* find string for quark */ +extern XrmString XrmQuarkToString( + XrmQuark /* quark */ +); + +extern XrmQuark XrmUniqueQuark( + void +); + +#define XrmStringsEqual(a1, a2) (strcmp(a1, a2) == 0) + + +/**************************************************************** + * + * Conversion of Strings to Lists + * + ****************************************************************/ + +typedef enum {XrmBindTightly, XrmBindLoosely} XrmBinding, *XrmBindingList; + +extern void XrmStringToQuarkList( + _Xconst char* /* string */, + XrmQuarkList /* quarks_return */ +); + +extern void XrmStringToBindingQuarkList( + _Xconst char* /* string */, + XrmBindingList /* bindings_return */, + XrmQuarkList /* quarks_return */ +); + +/**************************************************************** + * + * Name and Class lists. + * + ****************************************************************/ + +typedef XrmQuark XrmName; +typedef XrmQuarkList XrmNameList; +#define XrmNameToString(name) XrmQuarkToString(name) +#define XrmStringToName(string) XrmStringToQuark(string) +#define XrmStringToNameList(str, name) XrmStringToQuarkList(str, name) + +typedef XrmQuark XrmClass; +typedef XrmQuarkList XrmClassList; +#define XrmClassToString(c_class) XrmQuarkToString(c_class) +#define XrmStringToClass(c_class) XrmStringToQuark(c_class) +#define XrmStringToClassList(str,c_class) XrmStringToQuarkList(str, c_class) + + + +/**************************************************************** + * + * Resource Representation Types and Values + * + ****************************************************************/ + +typedef XrmQuark XrmRepresentation; +#define XrmStringToRepresentation(string) XrmStringToQuark(string) +#define XrmRepresentationToString(type) XrmQuarkToString(type) + +typedef struct { + unsigned int size; + XPointer addr; +} XrmValue, *XrmValuePtr; + + +/**************************************************************** + * + * Resource Manager Functions + * + ****************************************************************/ + +typedef struct _XrmHashBucketRec *XrmHashBucket; +typedef XrmHashBucket *XrmHashTable; +typedef XrmHashTable XrmSearchList[]; +typedef struct _XrmHashBucketRec *XrmDatabase; + + +extern void XrmDestroyDatabase( + XrmDatabase /* database */ +); + +extern void XrmQPutResource( + XrmDatabase* /* database */, + XrmBindingList /* bindings */, + XrmQuarkList /* quarks */, + XrmRepresentation /* type */, + XrmValue* /* value */ +); + +extern void XrmPutResource( + XrmDatabase* /* database */, + _Xconst char* /* specifier */, + _Xconst char* /* type */, + XrmValue* /* value */ +); + +extern void XrmQPutStringResource( + XrmDatabase* /* database */, + XrmBindingList /* bindings */, + XrmQuarkList /* quarks */, + _Xconst char* /* value */ +); + +extern void XrmPutStringResource( + XrmDatabase* /* database */, + _Xconst char* /* specifier */, + _Xconst char* /* value */ +); + +extern void XrmPutLineResource( + XrmDatabase* /* database */, + _Xconst char* /* line */ +); + +extern Bool XrmQGetResource( + XrmDatabase /* database */, + XrmNameList /* quark_name */, + XrmClassList /* quark_class */, + XrmRepresentation* /* quark_type_return */, + XrmValue* /* value_return */ +); + +extern Bool XrmGetResource( + XrmDatabase /* database */, + _Xconst char* /* str_name */, + _Xconst char* /* str_class */, + char** /* str_type_return */, + XrmValue* /* value_return */ +); + +extern Bool XrmQGetSearchList( + XrmDatabase /* database */, + XrmNameList /* names */, + XrmClassList /* classes */, + XrmSearchList /* list_return */, + int /* list_length */ +); + +extern Bool XrmQGetSearchResource( + XrmSearchList /* list */, + XrmName /* name */, + XrmClass /* class */, + XrmRepresentation* /* type_return */, + XrmValue* /* value_return */ +); + +/**************************************************************** + * + * Resource Database Management + * + ****************************************************************/ + +#ifndef _XP_PRINT_SERVER_ + +extern void XrmSetDatabase( + Display* /* display */, + XrmDatabase /* database */ +); + +extern XrmDatabase XrmGetDatabase( + Display* /* display */ +); + +#endif /* !_XP_PRINT_SERVER_ */ + +extern XrmDatabase XrmGetFileDatabase( + _Xconst char* /* filename */ +); + +extern Status XrmCombineFileDatabase( + _Xconst char* /* filename */, + XrmDatabase* /* target */, + Bool /* override */ +); + +extern XrmDatabase XrmGetStringDatabase( + _Xconst char* /* data */ /* null terminated string */ +); + +extern void XrmPutFileDatabase( + XrmDatabase /* database */, + _Xconst char* /* filename */ +); + +extern void XrmMergeDatabases( + XrmDatabase /* source_db */, + XrmDatabase* /* target_db */ +); + +extern void XrmCombineDatabase( + XrmDatabase /* source_db */, + XrmDatabase* /* target_db */, + Bool /* override */ +); + +#define XrmEnumAllLevels 0 +#define XrmEnumOneLevel 1 + +extern Bool XrmEnumerateDatabase( + XrmDatabase /* db */, + XrmNameList /* name_prefix */, + XrmClassList /* class_prefix */, + int /* mode */, + Bool (*)( + XrmDatabase* /* db */, + XrmBindingList /* bindings */, + XrmQuarkList /* quarks */, + XrmRepresentation* /* type */, + XrmValue* /* value */, + XPointer /* closure */ + ) /* proc */, + XPointer /* closure */ +); + +extern const char *XrmLocaleOfDatabase( + XrmDatabase /* database */ +); + + +/**************************************************************** + * + * Command line option mapping to resource entries + * + ****************************************************************/ + +typedef enum { + XrmoptionNoArg, /* Value is specified in OptionDescRec.value */ + XrmoptionIsArg, /* Value is the option string itself */ + XrmoptionStickyArg, /* Value is characters immediately following option */ + XrmoptionSepArg, /* Value is next argument in argv */ + XrmoptionResArg, /* Resource and value in next argument in argv */ + XrmoptionSkipArg, /* Ignore this option and the next argument in argv */ + XrmoptionSkipLine, /* Ignore this option and the rest of argv */ + XrmoptionSkipNArgs /* Ignore this option and the next + OptionDescRes.value arguments in argv */ +} XrmOptionKind; + +typedef struct { + char *option; /* Option abbreviation in argv */ + char *specifier; /* Resource specifier */ + XrmOptionKind argKind; /* Which style of option it is */ + XPointer value; /* Value to provide if XrmoptionNoArg */ +} XrmOptionDescRec, *XrmOptionDescList; + + +extern void XrmParseCommand( + XrmDatabase* /* database */, + XrmOptionDescList /* table */, + int /* table_count */, + _Xconst char* /* name */, + int* /* argc_in_out */, + char** /* argv_in_out */ +); + +_XFUNCPROTOEND + +#endif /* _XRESOURCE_H_ */ +/* DON'T ADD STUFF AFTER THIS #endif */ diff --git a/X11/Xtos.h b/X11/Xtos.h new file mode 100644 index 000000000..013b2416c --- /dev/null +++ b/X11/Xtos.h @@ -0,0 +1,77 @@ +/* +* $Xorg: Xtos.h,v 1.4 2001/02/09 02:03:59 xorgcvs Exp $ +*/ + +/*********************************************************** + +Copyright 1987, 1988, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ +/* $XFree86: xc/lib/Xt/Xtos.h,v 3.12tsi Exp $ */ + +#ifndef _Xtos_h +#define _Xtos_h + +#define ALLOCATE_LOCAL_FALLBACK(_size) XtMalloc((unsigned long)(_size)) +#define DEALLOCATE_LOCAL_FALLBACK(_ptr) XtFree((XtPointer)(_ptr)) +#include <X11/Xalloca.h> + +#ifdef CRAY +#define WORD64 +#endif + +#if defined (_LP64) || \ + defined(__alpha) || defined(__alpha__) || \ + defined(__ia64__) || defined(ia64) || \ + defined(__sparc64__) || \ + defined(__s390x__) || \ + (defined(__hppa__) && defined(__LP64__)) || \ + defined(__amd64__) || defined(amd64) || \ + defined(__powerpc64__) || \ + (defined(sgi) && (_MIPS_SZLONG == 64)) +#define LONG64 +#endif + +#endif /* _Xtos_h */ +/* DON'T ADD STUFF AFTER THIS #endif */ diff --git a/X11/Xutil.h b/X11/Xutil.h new file mode 100644 index 000000000..9e37c35c6 --- /dev/null +++ b/X11/Xutil.h @@ -0,0 +1,828 @@ +/* $Xorg: Xutil.h,v 1.8 2001/02/09 02:03:39 xorgcvs Exp $ */ + +/*********************************************************** + +Copyright 1987, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ +/* $XFree86: xc/lib/X11/Xutil.h,v 3.6 2003/04/13 19:22:20 dawes Exp $ */ + +#ifndef _XUTIL_H_ +#define _XUTIL_H_ + +/* You must include <X11/Xlib.h> before including this file */ +#include <X11/Xlib.h> +#include <X11/keysym.h> + +/* + * Bitmask returned by XParseGeometry(). Each bit tells if the corresponding + * value (x, y, width, height) was found in the parsed string. + */ +#define NoValue 0x0000 +#define XValue 0x0001 +#define YValue 0x0002 +#define WidthValue 0x0004 +#define HeightValue 0x0008 +#define AllValues 0x000F +#define XNegative 0x0010 +#define YNegative 0x0020 + +/* + * new version containing base_width, base_height, and win_gravity fields; + * used with WM_NORMAL_HINTS. + */ +typedef struct { + long flags; /* marks which fields in this structure are defined */ + int x, y; /* obsolete for new window mgrs, but clients */ + int width, height; /* should set so old wm's don't mess up */ + int min_width, min_height; + int max_width, max_height; + int width_inc, height_inc; + struct { + int x; /* numerator */ + int y; /* denominator */ + } min_aspect, max_aspect; + int base_width, base_height; /* added by ICCCM version 1 */ + int win_gravity; /* added by ICCCM version 1 */ +} XSizeHints; + +/* + * The next block of definitions are for window manager properties that + * clients and applications use for communication. + */ + +/* flags argument in size hints */ +#define USPosition (1L << 0) /* user specified x, y */ +#define USSize (1L << 1) /* user specified width, height */ + +#define PPosition (1L << 2) /* program specified position */ +#define PSize (1L << 3) /* program specified size */ +#define PMinSize (1L << 4) /* program specified minimum size */ +#define PMaxSize (1L << 5) /* program specified maximum size */ +#define PResizeInc (1L << 6) /* program specified resize increments */ +#define PAspect (1L << 7) /* program specified min and max aspect ratios */ +#define PBaseSize (1L << 8) /* program specified base for incrementing */ +#define PWinGravity (1L << 9) /* program specified window gravity */ + +/* obsolete */ +#define PAllHints (PPosition|PSize|PMinSize|PMaxSize|PResizeInc|PAspect) + + + +typedef struct { + long flags; /* marks which fields in this structure are defined */ + Bool input; /* does this application rely on the window manager to + get keyboard input? */ + int initial_state; /* see below */ + Pixmap icon_pixmap; /* pixmap to be used as icon */ + Window icon_window; /* window to be used as icon */ + int icon_x, icon_y; /* initial position of icon */ + Pixmap icon_mask; /* icon mask bitmap */ + XID window_group; /* id of related window group */ + /* this structure may be extended in the future */ +} XWMHints; + +/* definition for flags of XWMHints */ + +#define InputHint (1L << 0) +#define StateHint (1L << 1) +#define IconPixmapHint (1L << 2) +#define IconWindowHint (1L << 3) +#define IconPositionHint (1L << 4) +#define IconMaskHint (1L << 5) +#define WindowGroupHint (1L << 6) +#define AllHints (InputHint|StateHint|IconPixmapHint|IconWindowHint| \ +IconPositionHint|IconMaskHint|WindowGroupHint) +#define XUrgencyHint (1L << 8) + +/* definitions for initial window state */ +#define WithdrawnState 0 /* for windows that are not mapped */ +#define NormalState 1 /* most applications want to start this way */ +#define IconicState 3 /* application wants to start as an icon */ + +/* + * Obsolete states no longer defined by ICCCM + */ +#define DontCareState 0 /* don't know or care */ +#define ZoomState 2 /* application wants to start zoomed */ +#define InactiveState 4 /* application believes it is seldom used; */ + /* some wm's may put it on inactive menu */ + + +/* + * new structure for manipulating TEXT properties; used with WM_NAME, + * WM_ICON_NAME, WM_CLIENT_MACHINE, and WM_COMMAND. + */ +typedef struct { + unsigned char *value; /* same as Property routines */ + Atom encoding; /* prop type */ + int format; /* prop data format: 8, 16, or 32 */ + unsigned long nitems; /* number of data items in value */ +} XTextProperty; + +#define XNoMemory -1 +#define XLocaleNotSupported -2 +#define XConverterNotFound -3 + +typedef enum { + XStringStyle, /* STRING */ + XCompoundTextStyle, /* COMPOUND_TEXT */ + XTextStyle, /* text in owner's encoding (current locale)*/ + XStdICCTextStyle, /* STRING, else COMPOUND_TEXT */ + /* The following is an XFree86 extension, introduced in November 2000 */ + XUTF8StringStyle /* UTF8_STRING */ +} XICCEncodingStyle; + +typedef struct { + int min_width, min_height; + int max_width, max_height; + int width_inc, height_inc; +} XIconSize; + +typedef struct { + char *res_name; + char *res_class; +} XClassHint; + +#ifdef XUTIL_DEFINE_FUNCTIONS +extern int XDestroyImage( + XImage *ximage); +extern unsigned long XGetPixel( + XImage *ximage, + int x, int y); +extern int XPutPixel( + XImage *ximage, + int x, int y, + unsigned long pixel); +extern XImage *XSubImage( + XImage *ximage, + int x, int y, + unsigned int width, unsigned int height); +extern int XAddPixel( + XImage *ximage, + long value); +#else +/* + * These macros are used to give some sugar to the image routines so that + * naive people are more comfortable with them. + */ +#define XDestroyImage(ximage) \ + ((*((ximage)->f.destroy_image))((ximage))) +#define XGetPixel(ximage, x, y) \ + ((*((ximage)->f.get_pixel))((ximage), (x), (y))) +#define XPutPixel(ximage, x, y, pixel) \ + ((*((ximage)->f.put_pixel))((ximage), (x), (y), (pixel))) +#define XSubImage(ximage, x, y, width, height) \ + ((*((ximage)->f.sub_image))((ximage), (x), (y), (width), (height))) +#define XAddPixel(ximage, value) \ + ((*((ximage)->f.add_pixel))((ximage), (value))) +#endif + +/* + * Compose sequence status structure, used in calling XLookupString. + */ +typedef struct _XComposeStatus { + XPointer compose_ptr; /* state table pointer */ + int chars_matched; /* match state */ +} XComposeStatus; + +/* + * Keysym macros, used on Keysyms to test for classes of symbols + */ +#define IsKeypadKey(keysym) \ + (((KeySym)(keysym) >= XK_KP_Space) && ((KeySym)(keysym) <= XK_KP_Equal)) + +#define IsPrivateKeypadKey(keysym) \ + (((KeySym)(keysym) >= 0x11000000) && ((KeySym)(keysym) <= 0x1100FFFF)) + +#define IsCursorKey(keysym) \ + (((KeySym)(keysym) >= XK_Home) && ((KeySym)(keysym) < XK_Select)) + +#define IsPFKey(keysym) \ + (((KeySym)(keysym) >= XK_KP_F1) && ((KeySym)(keysym) <= XK_KP_F4)) + +#define IsFunctionKey(keysym) \ + (((KeySym)(keysym) >= XK_F1) && ((KeySym)(keysym) <= XK_F35)) + +#define IsMiscFunctionKey(keysym) \ + (((KeySym)(keysym) >= XK_Select) && ((KeySym)(keysym) <= XK_Break)) + +#ifdef XK_XKB_KEYS +#define IsModifierKey(keysym) \ + ((((KeySym)(keysym) >= XK_Shift_L) && ((KeySym)(keysym) <= XK_Hyper_R)) \ + || (((KeySym)(keysym) >= XK_ISO_Lock) && \ + ((KeySym)(keysym) <= XK_ISO_Last_Group_Lock)) \ + || ((KeySym)(keysym) == XK_Mode_switch) \ + || ((KeySym)(keysym) == XK_Num_Lock)) +#else +#define IsModifierKey(keysym) \ + ((((KeySym)(keysym) >= XK_Shift_L) && ((KeySym)(keysym) <= XK_Hyper_R)) \ + || ((KeySym)(keysym) == XK_Mode_switch) \ + || ((KeySym)(keysym) == XK_Num_Lock)) +#endif +/* + * opaque reference to Region data type + */ +typedef struct _XRegion *Region; + +/* Return values from XRectInRegion() */ + +#define RectangleOut 0 +#define RectangleIn 1 +#define RectanglePart 2 + + +/* + * Information used by the visual utility routines to find desired visual + * type from the many visuals a display may support. + */ + +typedef struct { + Visual *visual; + VisualID visualid; + int screen; + int depth; +#if defined(__cplusplus) || defined(c_plusplus) + int c_class; /* C++ */ +#else + int class; +#endif + unsigned long red_mask; + unsigned long green_mask; + unsigned long blue_mask; + int colormap_size; + int bits_per_rgb; +} XVisualInfo; + +#define VisualNoMask 0x0 +#define VisualIDMask 0x1 +#define VisualScreenMask 0x2 +#define VisualDepthMask 0x4 +#define VisualClassMask 0x8 +#define VisualRedMaskMask 0x10 +#define VisualGreenMaskMask 0x20 +#define VisualBlueMaskMask 0x40 +#define VisualColormapSizeMask 0x80 +#define VisualBitsPerRGBMask 0x100 +#define VisualAllMask 0x1FF + +/* + * This defines a window manager property that clients may use to + * share standard color maps of type RGB_COLOR_MAP: + */ +typedef struct { + Colormap colormap; + unsigned long red_max; + unsigned long red_mult; + unsigned long green_max; + unsigned long green_mult; + unsigned long blue_max; + unsigned long blue_mult; + unsigned long base_pixel; + VisualID visualid; /* added by ICCCM version 1 */ + XID killid; /* added by ICCCM version 1 */ +} XStandardColormap; + +#define ReleaseByFreeingColormap ((XID) 1L) /* for killid field above */ + + +/* + * return codes for XReadBitmapFile and XWriteBitmapFile + */ +#define BitmapSuccess 0 +#define BitmapOpenFailed 1 +#define BitmapFileInvalid 2 +#define BitmapNoMemory 3 + +/**************************************************************** + * + * Context Management + * + ****************************************************************/ + + +/* Associative lookup table return codes */ + +#define XCSUCCESS 0 /* No error. */ +#define XCNOMEM 1 /* Out of memory */ +#define XCNOENT 2 /* No entry in table */ + +typedef int XContext; + +#define XUniqueContext() ((XContext) XrmUniqueQuark()) +#define XStringToContext(string) ((XContext) XrmStringToQuark(string)) + +_XFUNCPROTOBEGIN + +/* The following declarations are alphabetized. */ + +extern XClassHint *XAllocClassHint ( + void +); + +extern XIconSize *XAllocIconSize ( + void +); + +extern XSizeHints *XAllocSizeHints ( + void +); + +extern XStandardColormap *XAllocStandardColormap ( + void +); + +extern XWMHints *XAllocWMHints ( + void +); + +extern int XClipBox( + Region /* r */, + XRectangle* /* rect_return */ +); + +extern Region XCreateRegion( + void +); + +extern const char *XDefaultString (void); + +extern int XDeleteContext( + Display* /* display */, + XID /* rid */, + XContext /* context */ +); + +extern int XDestroyRegion( + Region /* r */ +); + +extern int XEmptyRegion( + Region /* r */ +); + +extern int XEqualRegion( + Region /* r1 */, + Region /* r2 */ +); + +extern int XFindContext( + Display* /* display */, + XID /* rid */, + XContext /* context */, + XPointer* /* data_return */ +); + +extern Status XGetClassHint( + Display* /* display */, + Window /* w */, + XClassHint* /* class_hints_return */ +); + +extern Status XGetIconSizes( + Display* /* display */, + Window /* w */, + XIconSize** /* size_list_return */, + int* /* count_return */ +); + +extern Status XGetNormalHints( + Display* /* display */, + Window /* w */, + XSizeHints* /* hints_return */ +); + +extern Status XGetRGBColormaps( + Display* /* display */, + Window /* w */, + XStandardColormap** /* stdcmap_return */, + int* /* count_return */, + Atom /* property */ +); + +extern Status XGetSizeHints( + Display* /* display */, + Window /* w */, + XSizeHints* /* hints_return */, + Atom /* property */ +); + +extern Status XGetStandardColormap( + Display* /* display */, + Window /* w */, + XStandardColormap* /* colormap_return */, + Atom /* property */ +); + +extern Status XGetTextProperty( + Display* /* display */, + Window /* window */, + XTextProperty* /* text_prop_return */, + Atom /* property */ +); + +extern XVisualInfo *XGetVisualInfo( + Display* /* display */, + long /* vinfo_mask */, + XVisualInfo* /* vinfo_template */, + int* /* nitems_return */ +); + +extern Status XGetWMClientMachine( + Display* /* display */, + Window /* w */, + XTextProperty* /* text_prop_return */ +); + +extern XWMHints *XGetWMHints( + Display* /* display */, + Window /* w */ +); + +extern Status XGetWMIconName( + Display* /* display */, + Window /* w */, + XTextProperty* /* text_prop_return */ +); + +extern Status XGetWMName( + Display* /* display */, + Window /* w */, + XTextProperty* /* text_prop_return */ +); + +extern Status XGetWMNormalHints( + Display* /* display */, + Window /* w */, + XSizeHints* /* hints_return */, + long* /* supplied_return */ +); + +extern Status XGetWMSizeHints( + Display* /* display */, + Window /* w */, + XSizeHints* /* hints_return */, + long* /* supplied_return */, + Atom /* property */ +); + +extern Status XGetZoomHints( + Display* /* display */, + Window /* w */, + XSizeHints* /* zhints_return */ +); + +extern int XIntersectRegion( + Region /* sra */, + Region /* srb */, + Region /* dr_return */ +); + +extern void XConvertCase( + KeySym /* sym */, + KeySym* /* lower */, + KeySym* /* upper */ +); + +extern int XLookupString( + XKeyEvent* /* event_struct */, + char* /* buffer_return */, + int /* bytes_buffer */, + KeySym* /* keysym_return */, + XComposeStatus* /* status_in_out */ +); + +extern Status XMatchVisualInfo( + Display* /* display */, + int /* screen */, + int /* depth */, + int /* class */, + XVisualInfo* /* vinfo_return */ +); + +extern int XOffsetRegion( + Region /* r */, + int /* dx */, + int /* dy */ +); + +extern Bool XPointInRegion( + Region /* r */, + int /* x */, + int /* y */ +); + +extern Region XPolygonRegion( + XPoint* /* points */, + int /* n */, + int /* fill_rule */ +); + +extern int XRectInRegion( + Region /* r */, + int /* x */, + int /* y */, + unsigned int /* width */, + unsigned int /* height */ +); + +extern int XSaveContext( + Display* /* display */, + XID /* rid */, + XContext /* context */, + _Xconst char* /* data */ +); + +extern int XSetClassHint( + Display* /* display */, + Window /* w */, + XClassHint* /* class_hints */ +); + +extern int XSetIconSizes( + Display* /* display */, + Window /* w */, + XIconSize* /* size_list */, + int /* count */ +); + +extern int XSetNormalHints( + Display* /* display */, + Window /* w */, + XSizeHints* /* hints */ +); + +extern void XSetRGBColormaps( + Display* /* display */, + Window /* w */, + XStandardColormap* /* stdcmaps */, + int /* count */, + Atom /* property */ +); + +extern int XSetSizeHints( + Display* /* display */, + Window /* w */, + XSizeHints* /* hints */, + Atom /* property */ +); + +extern int XSetStandardProperties( + Display* /* display */, + Window /* w */, + _Xconst char* /* window_name */, + _Xconst char* /* icon_name */, + Pixmap /* icon_pixmap */, + char** /* argv */, + int /* argc */, + XSizeHints* /* hints */ +); + +extern void XSetTextProperty( + Display* /* display */, + Window /* w */, + XTextProperty* /* text_prop */, + Atom /* property */ +); + +extern void XSetWMClientMachine( + Display* /* display */, + Window /* w */, + XTextProperty* /* text_prop */ +); + +extern int XSetWMHints( + Display* /* display */, + Window /* w */, + XWMHints* /* wm_hints */ +); + +extern void XSetWMIconName( + Display* /* display */, + Window /* w */, + XTextProperty* /* text_prop */ +); + +extern void XSetWMName( + Display* /* display */, + Window /* w */, + XTextProperty* /* text_prop */ +); + +extern void XSetWMNormalHints( + Display* /* display */, + Window /* w */, + XSizeHints* /* hints */ +); + +extern void XSetWMProperties( + Display* /* display */, + Window /* w */, + XTextProperty* /* window_name */, + XTextProperty* /* icon_name */, + char** /* argv */, + int /* argc */, + XSizeHints* /* normal_hints */, + XWMHints* /* wm_hints */, + XClassHint* /* class_hints */ +); + +extern void XmbSetWMProperties( + Display* /* display */, + Window /* w */, + _Xconst char* /* window_name */, + _Xconst char* /* icon_name */, + char** /* argv */, + int /* argc */, + XSizeHints* /* normal_hints */, + XWMHints* /* wm_hints */, + XClassHint* /* class_hints */ +); + +extern void Xutf8SetWMProperties( + Display* /* display */, + Window /* w */, + _Xconst char* /* window_name */, + _Xconst char* /* icon_name */, + char** /* argv */, + int /* argc */, + XSizeHints* /* normal_hints */, + XWMHints* /* wm_hints */, + XClassHint* /* class_hints */ +); + +extern void XSetWMSizeHints( + Display* /* display */, + Window /* w */, + XSizeHints* /* hints */, + Atom /* property */ +); + +extern int XSetRegion( + Display* /* display */, + GC /* gc */, + Region /* r */ +); + +extern void XSetStandardColormap( + Display* /* display */, + Window /* w */, + XStandardColormap* /* colormap */, + Atom /* property */ +); + +extern int XSetZoomHints( + Display* /* display */, + Window /* w */, + XSizeHints* /* zhints */ +); + +extern int XShrinkRegion( + Region /* r */, + int /* dx */, + int /* dy */ +); + +extern Status XStringListToTextProperty( + char** /* list */, + int /* count */, + XTextProperty* /* text_prop_return */ +); + +extern int XSubtractRegion( + Region /* sra */, + Region /* srb */, + Region /* dr_return */ +); + +extern int XmbTextListToTextProperty( + Display* display, + char** list, + int count, + XICCEncodingStyle style, + XTextProperty* text_prop_return +); + +extern int XwcTextListToTextProperty( + Display* display, + wchar_t** list, + int count, + XICCEncodingStyle style, + XTextProperty* text_prop_return +); + +extern int Xutf8TextListToTextProperty( + Display* display, + char** list, + int count, + XICCEncodingStyle style, + XTextProperty* text_prop_return +); + +extern void XwcFreeStringList( + wchar_t** list +); + +extern Status XTextPropertyToStringList( + XTextProperty* /* text_prop */, + char*** /* list_return */, + int* /* count_return */ +); + +extern int XmbTextPropertyToTextList( + Display* display, + const XTextProperty* text_prop, + char*** list_return, + int* count_return +); + +extern int XwcTextPropertyToTextList( + Display* display, + const XTextProperty* text_prop, + wchar_t*** list_return, + int* count_return +); + +extern int Xutf8TextPropertyToTextList( + Display* display, + const XTextProperty* text_prop, + char*** list_return, + int* count_return +); + +extern int XUnionRectWithRegion( + XRectangle* /* rectangle */, + Region /* src_region */, + Region /* dest_region_return */ +); + +extern int XUnionRegion( + Region /* sra */, + Region /* srb */, + Region /* dr_return */ +); + +extern int XWMGeometry( + Display* /* display */, + int /* screen_number */, + _Xconst char* /* user_geometry */, + _Xconst char* /* default_geometry */, + unsigned int /* border_width */, + XSizeHints* /* hints */, + int* /* x_return */, + int* /* y_return */, + int* /* width_return */, + int* /* height_return */, + int* /* gravity_return */ +); + +extern int XXorRegion( + Region /* sra */, + Region /* srb */, + Region /* dr_return */ +); + +_XFUNCPROTOEND + +#endif /* _XUTIL_H_ */ diff --git a/X11/cursorfont.h b/X11/cursorfont.h new file mode 100644 index 000000000..8fb165cf0 --- /dev/null +++ b/X11/cursorfont.h @@ -0,0 +1,112 @@ +/* $Xorg: cursorfont.h,v 1.4 2001/02/09 02:03:39 xorgcvs Exp $ */ +/* + +Copyright 1987, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ + +#ifndef _cursorfont_h_ +#define _cursorfont_h_ + +#define XC_num_glyphs 154 +#define XC_X_cursor 0 +#define XC_arrow 2 +#define XC_based_arrow_down 4 +#define XC_based_arrow_up 6 +#define XC_boat 8 +#define XC_bogosity 10 +#define XC_bottom_left_corner 12 +#define XC_bottom_right_corner 14 +#define XC_bottom_side 16 +#define XC_bottom_tee 18 +#define XC_box_spiral 20 +#define XC_center_ptr 22 +#define XC_circle 24 +#define XC_clock 26 +#define XC_coffee_mug 28 +#define XC_cross 30 +#define XC_cross_reverse 32 +#define XC_crosshair 34 +#define XC_diamond_cross 36 +#define XC_dot 38 +#define XC_dotbox 40 +#define XC_double_arrow 42 +#define XC_draft_large 44 +#define XC_draft_small 46 +#define XC_draped_box 48 +#define XC_exchange 50 +#define XC_fleur 52 +#define XC_gobbler 54 +#define XC_gumby 56 +#define XC_hand1 58 +#define XC_hand2 60 +#define XC_heart 62 +#define XC_icon 64 +#define XC_iron_cross 66 +#define XC_left_ptr 68 +#define XC_left_side 70 +#define XC_left_tee 72 +#define XC_leftbutton 74 +#define XC_ll_angle 76 +#define XC_lr_angle 78 +#define XC_man 80 +#define XC_middlebutton 82 +#define XC_mouse 84 +#define XC_pencil 86 +#define XC_pirate 88 +#define XC_plus 90 +#define XC_question_arrow 92 +#define XC_right_ptr 94 +#define XC_right_side 96 +#define XC_right_tee 98 +#define XC_rightbutton 100 +#define XC_rtl_logo 102 +#define XC_sailboat 104 +#define XC_sb_down_arrow 106 +#define XC_sb_h_double_arrow 108 +#define XC_sb_left_arrow 110 +#define XC_sb_right_arrow 112 +#define XC_sb_up_arrow 114 +#define XC_sb_v_double_arrow 116 +#define XC_shuttle 118 +#define XC_sizing 120 +#define XC_spider 122 +#define XC_spraycan 124 +#define XC_star 126 +#define XC_target 128 +#define XC_tcross 130 +#define XC_top_left_arrow 132 +#define XC_top_left_corner 134 +#define XC_top_right_corner 136 +#define XC_top_side 138 +#define XC_top_tee 140 +#define XC_trek 142 +#define XC_ul_angle 144 +#define XC_umbrella 146 +#define XC_ur_angle 148 +#define XC_watch 150 +#define XC_xterm 152 + +#endif /* _cursorfont_h_ */ diff --git a/X11/extensions/XI2proto.h b/X11/extensions/XI2proto.h index 2fd91ebf1..0b3bcc2f6 100644 --- a/X11/extensions/XI2proto.h +++ b/X11/extensions/XI2proto.h @@ -102,6 +102,11 @@ * COMMON STRUCTS * * * *************************************************************************************/ +#ifdef _MSC_VER +typedef int int32_t; +typedef unsigned uint32_t; +#endif + /** Fixed point 16.16 */ typedef int32_t FP1616; diff --git a/X11/extensions/XKBrules.h b/X11/extensions/XKBrules.h index 0d77ca323..91ec51099 100644 --- a/X11/extensions/XKBrules.h +++ b/X11/extensions/XKBrules.h @@ -181,7 +181,7 @@ extern void XkbRF_Free( #define _XKB_RF_NAMES_PROP_MAXLEN 1024 #ifndef XKB_IN_SERVER - +#ifndef _MSC_VER extern Bool XkbRF_GetNamesProp( Display * /* dpy */, char ** /* rules_file_rtrn */, @@ -195,6 +195,7 @@ extern Bool XkbRF_SetNamesProp( ); #endif +#endif _XFUNCPROTOEND diff --git a/X11/extensions/Xinerama.h b/X11/extensions/Xinerama.h new file mode 100644 index 000000000..666f52a78 --- /dev/null +++ b/X11/extensions/Xinerama.h @@ -0,0 +1,74 @@ +/* + +Copyright 2003 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ + +#ifndef _Xinerama_h +#define _Xinerama_h + +#include <X11/Xlib.h> + +typedef struct { + int screen_number; + short x_org; + short y_org; + short width; + short height; +} XineramaScreenInfo; + +_XFUNCPROTOBEGIN + +Bool XineramaQueryExtension ( + Display *dpy, + int *event_base, + int *error_base +); + +Status XineramaQueryVersion( + Display *dpy, + int *major_versionp, + int *minor_versionp +); + +Bool XineramaIsActive(Display *dpy); + + +/* + Returns the number of heads and a pointer to an array of + structures describing the position and size of the individual + heads. Returns NULL and number = 0 if Xinerama is not active. + + Returned array should be freed with XFree(). +*/ + +XineramaScreenInfo * +XineramaQueryScreens( + Display *dpy, + int *number +); + +_XFUNCPROTOEND + +#endif /* _Xinerama_h */ + diff --git a/X11/extensions/bigreqstr.h b/X11/extensions/bigreqstr.h index 0a023dbf1..df43f46de 100644 --- a/X11/extensions/bigreqstr.h +++ b/X11/extensions/bigreqstr.h @@ -1,3 +1,3 @@ -#warning "bigreqstr.h is obsolete and may be removed in the future." -#warning "include <X11/extensions/bigreqsproto.h> for the protocol defines." +#pragma message("bigreqstr.h is obsolete and may be removed in the future.") +#pragma message("include <X11/extensions/bigreqsproto.h> for the protocol defines.") #include <X11/extensions/bigreqsproto.h> diff --git a/X11/extensions/panoramiXext.h b/X11/extensions/panoramiXext.h new file mode 100644 index 000000000..9c756436e --- /dev/null +++ b/X11/extensions/panoramiXext.h @@ -0,0 +1,85 @@ +/***************************************************************** +Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, +BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of Digital Equipment Corporation +shall not be used in advertising or otherwise to promote the sale, use or other +dealings in this Software without prior written authorization from Digital +Equipment Corporation. +******************************************************************/ +/* + * PanoramiX definitions + */ + +/* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */ + +#ifndef _panoramiXext_h +#define _panoramiXext_h + +#include <X11/Xfuncproto.h> + +typedef struct { + Window window; /* PanoramiX window - may not exist */ + int screen; + int State; /* PanroamiXOff, PanoramiXOn */ + int width; /* width of this screen */ + int height; /* height of this screen */ + int ScreenCount; /* real physical number of screens */ + XID eventMask; /* selected events for this client */ +} XPanoramiXInfo; + +_XFUNCPROTOBEGIN + +extern Bool XPanoramiXQueryExtension ( + Display * /* dpy */, + int * /* event_base_return */, + int * /* error_base_return */ +); + +extern Status XPanoramiXQueryVersion( + Display * /* dpy */, + int * /* major_version_return */, + int * /* minor_version_return */ +); + +extern XPanoramiXInfo *XPanoramiXAllocInfo ( + void +); + +extern Status XPanoramiXGetState ( + Display * /* dpy */, + Drawable /* drawable */, + XPanoramiXInfo * /* panoramiX_info */ +); + +extern Status XPanoramiXGetScreenCount ( + Display * /* dpy */, + Drawable /* drawable */, + XPanoramiXInfo * /* panoramiX_info */ +); + +extern Status XPanoramiXGetScreenSize ( + Display * /* dpy */, + Drawable /* drawable */, + int /* screen_num */, + XPanoramiXInfo * /* panoramiX_info */ +); + +_XFUNCPROTOEND + +#endif /* _panoramiXext_h */ diff --git a/X11/extensions/recordstr.h b/X11/extensions/recordstr.h index 7f269b77e..983af4dc8 100644 --- a/X11/extensions/recordstr.h +++ b/X11/extensions/recordstr.h @@ -1,4 +1,4 @@ -#warning "recordstr.h is obsolete and may be removed in the future." -#warning "include <X11/extensions/record.h> for the library interfaces." -#warning "include <X11/extensions/recordproto.h> for the protocol defines." +#pragma message( "recordstr.h is obsolete and may be removed in the future.") +#pragma message("include <X11/extensions/record.h> for the library interfaces.") +#pragma message( "include <X11/extensions/recordproto.h> for the protocol defines.") #include <X11/extensions/recordproto.h> diff --git a/X11/extensions/xcmiscstr.h b/X11/extensions/xcmiscstr.h index c2b643308..43ab9ff8b 100644 --- a/X11/extensions/xcmiscstr.h +++ b/X11/extensions/xcmiscstr.h @@ -1,3 +1,3 @@ -#warning "xcmiscstr.h is obsolete and may be removed in the future." -#warning "include <X11/extensions/xcmiscproto.h> for the protocol defines." +#pragma message( "xcmiscstr.h is obsolete and may be removed in the future." ) +#pragma message( "include <X11/extensions/xcmiscproto.h> for the protocol defines." ) #include <X11/extensions/xcmiscproto.h> diff --git a/X11/fonts/bdfint.h b/X11/fonts/bdfint.h new file mode 100644 index 000000000..d41c4a556 --- /dev/null +++ b/X11/fonts/bdfint.h @@ -0,0 +1,90 @@ +/* $Xorg: bdfint.h,v 1.4 2001/02/09 02:04:01 xorgcvs Exp $ */ + +/* + +Copyright 1990, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ +/* $XFree86: xc/lib/font/bitmap/bdfint.h,v 1.4 2001/01/17 19:43:26 dawes Exp $ */ + +#ifndef BDFINT_H +#define BDFINT_H + +#define bdfIsPrefix(buf,str) (!strncmp((char *)buf,str,strlen(str))) +#define bdfStrEqual(s1,s2) (!strcmp(s1,s2)) + +#define BDF_GENPROPS 6 +#define NullProperty ((FontPropPtr)0) + +/* + * This structure holds some properties we need to generate if they aren't + * specified in the BDF file and some other values read from the file + * that we'll need to calculate them. We need to keep track of whether + * or not we've read them. + */ +typedef struct BDFSTAT { + int linenum; + char *fileName; + char fontName[MAXFONTNAMELEN]; + float pointSize; + int resolution_x; + int resolution_y; + int digitCount; + int digitWidths; + int exHeight; + + FontPropPtr fontProp; + FontPropPtr pointSizeProp; + FontPropPtr resolutionXProp; + FontPropPtr resolutionYProp; + FontPropPtr resolutionProp; + FontPropPtr xHeightProp; + FontPropPtr weightProp; + FontPropPtr quadWidthProp; + BOOL haveFontAscent; + BOOL haveFontDescent; + BOOL haveDefaultCh; +} bdfFileState; + +extern void bdfError ( char * message, ... ); +extern void bdfWarning ( char *message, ... ); +extern unsigned char * bdfGetLine ( FontFilePtr file, unsigned char *buf, + int len ); +extern Atom bdfForceMakeAtom ( char *str, int *size ); +extern Atom bdfGetPropertyValue ( char *s ); +extern int bdfIsInteger ( char *str ); +extern unsigned char bdfHexByte ( unsigned char *s ); +extern Bool bdfSpecialProperty ( FontPtr pFont, FontPropPtr prop, + char isString, bdfFileState *bdfState ); +extern int bdfReadFont( FontPtr pFont, FontFilePtr file, + int bit, int byte, int glyph, int scan ); +extern int bdfReadFontInfo( FontInfoPtr pFontInfo, FontFilePtr file ); + +extern void FontCharInkMetrics ( FontPtr pFont, CharInfoPtr pCI, + xCharInfo *pInk ); +extern void FontCharReshape ( FontPtr pFont, CharInfoPtr pSrc, + CharInfoPtr pDst ); + +#endif /* BDFINT_H */ diff --git a/X11/fonts/bitmap.h b/X11/fonts/bitmap.h new file mode 100644 index 000000000..731c85f5b --- /dev/null +++ b/X11/fonts/bitmap.h @@ -0,0 +1,109 @@ +/* $Xorg: bitmap.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ + +/* + +Copyright 1990, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ +/* $XFree86: xc/lib/font/include/bitmap.h,v 1.9 2001/01/17 19:43:31 dawes Exp $ */ + +/* + * Author: Keith Packard, MIT X Consortium + */ + +#ifndef _BITMAP_H_ +#define _BITMAP_H_ + +#include <X11/fonts/fntfilio.h> +#ifndef FONTMODULE +#include <stdio.h> /* just for NULL */ +#else +#include "xf86_ansic.h" +#endif + +/* + * Internal format used to store bitmap fonts + */ + +/* number of encoding entries in one segment */ +#define BITMAP_FONT_SEGMENT_SIZE 128 + +typedef struct _BitmapExtra { + Atom *glyphNames; + int *sWidths; + CARD32 bitmapsSizes[GLYPHPADOPTIONS]; + FontInfoRec info; +} BitmapExtraRec, *BitmapExtraPtr; + +typedef struct _BitmapFont { + unsigned version_num; + int num_chars; + int num_tables; + CharInfoPtr metrics; /* font metrics, including glyph pointers */ + xCharInfo *ink_metrics; /* ink metrics */ + char *bitmaps; /* base of bitmaps, useful only to free */ + CharInfoPtr **encoding; /* array of arrays of char info pointers */ + CharInfoPtr pDefault; /* default character */ + BitmapExtraPtr bitmapExtra; /* stuff not used by X server */ +} BitmapFontRec, *BitmapFontPtr; + +#define ACCESSENCODING(enc,i) \ +(enc[(i)/BITMAP_FONT_SEGMENT_SIZE]?\ +(enc[(i)/BITMAP_FONT_SEGMENT_SIZE][(i)%BITMAP_FONT_SEGMENT_SIZE]):\ +0) +#define ACCESSENCODINGL(enc,i) \ +(enc[(i)/BITMAP_FONT_SEGMENT_SIZE][(i)%BITMAP_FONT_SEGMENT_SIZE]) + +#define SEGMENT_MAJOR(n) ((n)/BITMAP_FONT_SEGMENT_SIZE) +#define SEGMENT_MINOR(n) ((n)%BITMAP_FONT_SEGMENT_SIZE) +#define NUM_SEGMENTS(n) \ + (((n)+BITMAP_FONT_SEGMENT_SIZE-1)/BITMAP_FONT_SEGMENT_SIZE) + +extern int bitmapGetGlyphs ( FontPtr pFont, unsigned long count, + unsigned char *chars, FontEncoding charEncoding, + unsigned long *glyphCount, CharInfoPtr *glyphs ); +extern int bitmapGetMetrics ( FontPtr pFont, unsigned long count, + unsigned char *chars, FontEncoding charEncoding, + unsigned long *glyphCount, xCharInfo **glyphs ); + +extern void bitmapComputeFontBounds ( FontPtr pFont ); +extern void bitmapComputeFontInkBounds ( FontPtr pFont ); +extern Bool bitmapAddInkMetrics ( FontPtr pFont ); +extern int bitmapComputeWeight ( FontPtr pFont ); + +extern void BitmapRegisterFontFileFunctions ( void ); +extern int BitmapGetRenderIndex ( FontRendererPtr renderer ); + +extern int BitmapOpenScalable ( FontPathElementPtr fpe, FontPtr *pFont, + int flags, FontEntryPtr entry, char *fileName, + FontScalablePtr vals, fsBitmapFormat format, + fsBitmapFormatMask fmask, + FontPtr non_cachable_font ); +extern int BitmapGetInfoScalable ( FontPathElementPtr fpe, + FontInfoPtr pFontInfo, FontEntryPtr entry, + FontNamePtr fontName, char *fileName, + FontScalablePtr vals ); + +#endif /* _BITMAP_H_ */ diff --git a/X11/fonts/bufio.h b/X11/fonts/bufio.h new file mode 100644 index 000000000..b5977b1d0 --- /dev/null +++ b/X11/fonts/bufio.h @@ -0,0 +1,93 @@ +/* $Xorg: bufio.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ + +/* + +Copyright 1993, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ +/* $XFree86: xc/lib/font/include/bufio.h,v 1.6 2001/07/31 16:44:55 alanh Exp $ */ + +#ifndef ___BUFIO_H___ +#define ___BUFIO_H___ 1 + +#include <X11/Xfuncproto.h> + +#ifdef TEST + +#define xalloc(s) malloc(s) +#define xfree(s) free(s) + +#endif + +#define BUFFILESIZE 8192 +#define BUFFILEEOF -1 + +typedef unsigned char BufChar; +typedef struct _buffile *BufFilePtr; + +typedef struct _buffile { + BufChar *bufp; + int left; + int eof; + BufChar buffer[BUFFILESIZE]; + int (*input)( BufFilePtr /* f */); + int (*output)( int /* c */, BufFilePtr /* f */); + int (*skip)( BufFilePtr /* f */, int /* count */); + int (*close)( BufFilePtr /* f */, int /* doClose */); + char *private; +} BufFileRec; + +extern BufFilePtr BufFileCreate ( + char*, + int (*)(BufFilePtr), + int (*)(int, BufFilePtr), + int (*)(BufFilePtr, int), + int (*)(BufFilePtr, int)); +extern BufFilePtr BufFileOpenRead ( int ); +extern BufFilePtr BufFileOpenWrite ( int ); +extern BufFilePtr BufFilePushCompressed ( BufFilePtr ); +#ifdef X_GZIP_FONT_COMPRESSION +extern BufFilePtr BufFilePushZIP ( BufFilePtr ); +#endif +#ifdef X_BZIP2_FONT_COMPRESSION +extern BufFilePtr BufFilePushBZIP2 ( BufFilePtr ); +#endif +extern int BufFileClose ( BufFilePtr, int ); +extern int BufFileRead ( BufFilePtr, char*, int ); +extern int BufFileWrite ( BufFilePtr, char*, int ); + +#define BufFileGet(f) ((f)->left-- ? *(f)->bufp++ : ((f)->eof = (*(f)->input) (f))) +#define BufFilePut(c,f) (--(f)->left ? *(f)->bufp++ = ((unsigned char)(c)) : (*(f)->output) ((unsigned char)(c),f)) +#define BufFileSkip(f,c) ((f)->eof = (*(f)->skip) (f, c)) + +#ifndef TRUE +#define TRUE 1 +#endif +#ifndef FALSE +#define FALSE 0 +#endif + +#endif /* ___BUFIO_H___ */ + diff --git a/X11/fonts/fntfil.h b/X11/fonts/fntfil.h new file mode 100644 index 000000000..074f2d0ea --- /dev/null +++ b/X11/fonts/fntfil.h @@ -0,0 +1,182 @@ +/* $Xorg: fntfil.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ + +/* + +Copyright 1991, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/lib/font/include/fntfil.h,v 1.9 2001/12/14 19:56:54 dawes Exp $ */ + +/* + * Author: Keith Packard, MIT X Consortium + */ + +#ifndef _FONTFILE_H_ +#define _FONTFILE_H_ + +#include <X11/fonts/fontxlfd.h> + +typedef struct _FontEntry *FontEntryPtr; +typedef struct _FontTable *FontTablePtr; +typedef struct _FontName *FontNamePtr; +typedef struct _FontScaled *FontScaledPtr; +typedef struct _FontScalableExtra *FontScalableExtraPtr; +typedef struct _FontScalableEntry *FontScalableEntryPtr; +typedef struct _FontScaleAliasEntry *FontScaleAliasEntryPtr; +typedef struct _FontBitmapEntry *FontBitmapEntryPtr; +typedef struct _FontAliasEntry *FontAliasEntryPtr; +typedef struct _FontBCEntry *FontBCEntryPtr; +typedef struct _FontDirectory *FontDirectoryPtr; +typedef struct _FontRenderer *FontRendererPtr; + +#define NullFontEntry ((FontEntryPtr) 0) +#define NullFontTable ((FontTablePtr) 0) +#define NullFontName ((FontNamePtr) 0) +#define NullFontScaled ((FontScaled) 0) +#define NullFontScalableExtra ((FontScalableExtra) 0) +#define NullFontscalableEntry ((FontScalableEntry) 0) +#define NullFontScaleAliasEntry ((FontScaleAliasEntry) 0) +#define NullFontBitmapEntry ((FontBitmapEntry) 0) +#define NullFontAliasEntry ((FontAliasEntry) 0) +#define NullFontBCEntry ((FontBCEntry) 0) +#define NullFontDirectory ((FontDirectoryPtr) 0) +#define NullFontRenderer ((FontRendererPtr) 0) + +#define FONT_ENTRY_SCALABLE 0 +#define FONT_ENTRY_SCALE_ALIAS 1 +#define FONT_ENTRY_BITMAP 2 +#define FONT_ENTRY_ALIAS 3 +#define FONT_ENTRY_BC 4 + +#define MAXFONTNAMELEN 1024 +#define MAXFONTFILENAMELEN 1024 + +#define FontDirFile "fonts.dir" +#define FontAliasFile "fonts.alias" +#define FontScalableFile "fonts.scale" + +extern int FontFileNameCheck ( char *name ); +extern int FontFileInitFPE ( FontPathElementPtr fpe ); +extern int FontFileResetFPE ( FontPathElementPtr fpe ); +extern int FontFileFreeFPE ( FontPathElementPtr fpe ); +extern int FontFileOpenFont ( pointer client, FontPathElementPtr fpe, + Mask flags, char *name, int namelen, + fsBitmapFormat format, fsBitmapFormatMask fmask, + XID id, FontPtr *pFont, char **aliasName, + FontPtr non_cachable_font ); +extern void FontFileCloseFont ( FontPathElementPtr fpe, FontPtr pFont ); +extern int FontFileOpenBitmap ( FontPathElementPtr fpe, FontPtr *pFont, + int flags, FontEntryPtr entry, + fsBitmapFormat format, + fsBitmapFormatMask fmask ); +extern int FontFileListFonts ( pointer client, FontPathElementPtr fpe, + char *pat, int len, int max, + FontNamesPtr names ); +extern int FontFileStartListFonts ( pointer client, FontPathElementPtr fpe, + char *pat, int len, int max, + pointer *privatep, int mark_aliases ); +extern int FontFileStartListFontsWithInfo ( pointer client, + FontPathElementPtr fpe, + char *pat, int len, int max, + pointer *privatep ); +extern int FontFileListNextFontWithInfo ( pointer client, + FontPathElementPtr fpe, + char **namep, int *namelenp, + FontInfoPtr *pFontInfo, + int *numFonts, pointer private ); +extern int FontFileStartListFontsAndAliases ( pointer client, + FontPathElementPtr fpe, + char *pat, int len, int max, + pointer *privatep ); +extern int FontFileListNextFontOrAlias ( pointer client, + FontPathElementPtr fpe, + char **namep, int *namelenp, + char **resolvedp, int *resolvedlenp, + pointer private ); +extern void FontFileRegisterLocalFpeFunctions ( void ); +extern void CatalogueRegisterLocalFpeFunctions ( void ); + + +extern FontEntryPtr FontFileAddEntry ( FontTablePtr table, + FontEntryPtr prototype ); +extern Bool FontFileAddFontAlias ( FontDirectoryPtr dir, char *aliasName, + char *fontName ); +extern Bool FontFileAddFontFile ( FontDirectoryPtr dir, char *fontName, + char *fileName ); +extern int FontFileCountDashes ( char *name, int namelen ); +extern FontEntryPtr FontFileFindNameInDir ( FontTablePtr table, + FontNamePtr pat ); +extern FontEntryPtr FontFileFindNameInScalableDir ( FontTablePtr table, + FontNamePtr pat, + FontScalablePtr vals ); +extern int FontFileFindNamesInDir ( FontTablePtr table, FontNamePtr pat, + int max, FontNamesPtr names ); +extern int FontFileFindNamesInScalableDir ( FontTablePtr table, + FontNamePtr pat, int max, + FontNamesPtr names, + FontScalablePtr vals, + int alias_behavior, int *newmax ); + +extern void FontFileFreeDir ( FontDirectoryPtr dir ); +extern void FontFileFreeEntry ( FontEntryPtr entry ); +extern void FontFileFreeTable ( FontTablePtr table ); +extern Bool FontFileInitTable ( FontTablePtr table, int size ); +extern FontDirectoryPtr FontFileMakeDir ( char *dirName, int size ); +extern Bool FontFileMatchName ( char *name, int length, FontNamePtr pat ); +extern char * FontFileSaveString ( char *s ); +extern void FontFileSortDir ( FontDirectoryPtr dir ); +extern void FontFileSortTable ( FontTablePtr table ); + +extern void FontDefaultFormat ( int *bit, int *byte, int *glyph, int *scan ); + +extern Bool FontFileRegisterRenderer ( FontRendererPtr renderer ); +extern Bool FontFilePriorityRegisterRenderer ( FontRendererPtr renderer, + int priority ); +extern FontRendererPtr FontFileMatchRenderer ( char *fileName ); + +extern Bool FontFileAddScaledInstance ( FontEntryPtr entry, + FontScalablePtr vals, FontPtr pFont, + char *bitmapName ); +extern void FontFileSwitchStringsToBitmapPointers ( FontDirectoryPtr dir ); +extern void FontFileRemoveScaledInstance ( FontEntryPtr entry, FontPtr pFont ); +extern Bool FontFileCompleteXLFD ( FontScalablePtr vals, FontScalablePtr def ); +extern FontScaledPtr FontFileFindScaledInstance ( FontEntryPtr entry, + FontScalablePtr vals, + int noSpecificSize ); + +extern Bool FontFileRegisterBitmapSource ( FontPathElementPtr fpe ); +extern void FontFileUnregisterBitmapSource ( FontPathElementPtr fpe ); +extern void FontFileEmptyBitmapSource ( void ); +extern int FontFileMatchBitmapSource ( FontPathElementPtr fpe, + FontPtr *pFont, int flags, + FontEntryPtr entry, + FontNamePtr zeroPat, + FontScalablePtr vals, + fsBitmapFormat format, + fsBitmapFormatMask fmask, + Bool noSpecificSize ); + +extern int FontFileReadDirectory ( char *directory, FontDirectoryPtr *pdir ); +extern Bool FontFileDirectoryChanged ( FontDirectoryPtr dir ); + +#endif /* _FONTFILE_H_ */ diff --git a/X11/fonts/fntfilio.h b/X11/fonts/fntfilio.h new file mode 100644 index 000000000..f8e24f390 --- /dev/null +++ b/X11/fonts/fntfilio.h @@ -0,0 +1,56 @@ +/* $Xorg: fntfilio.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ + +/* + +Copyright 1991, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/lib/font/include/fntfilio.h,v 1.6 2001/10/31 22:50:26 tsi Exp $ */ + +/* + * Author: Keith Packard, MIT X Consortium + */ + +#ifndef _FNTFILIO_H_ +#define _FNTFILIO_H_ + +#include <X11/fonts/bufio.h> + +typedef BufFilePtr FontFilePtr; + +#define FontFileGetc(f) BufFileGet(f) +#define FontFilePutc(c,f) BufFilePut(c,f) +#define FontFileRead(f,b,n) BufFileRead(f,b,n) +#define FontFileWrite(f,b,n) BufFileWrite(f,b,n) +#define FontFileSkip(f,n) (BufFileSkip (f, n) != BUFFILEEOF) +#define FontFileSeek(f,n) (BufFileSeek (f,n,0) != BUFFILEEOF) + +#define FontFileEOF BUFFILEEOF + +extern FontFilePtr FontFileOpen ( const char *name ); +extern int FontFileClose ( FontFilePtr f ); +extern FontFilePtr FontFileOpenWrite ( const char *name ); +extern FontFilePtr FontFileOpenWriteFd ( int fd ); +extern FontFilePtr FontFileOpenFd ( int fd ); + +#endif /* _FNTFILIO_H_ */ diff --git a/X11/fonts/fntfilst.h b/X11/fonts/fntfilst.h new file mode 100644 index 000000000..1a71eae7a --- /dev/null +++ b/X11/fonts/fntfilst.h @@ -0,0 +1,198 @@ +/* $Xorg: fntfilst.h,v 1.5 2001/02/09 02:04:04 xorgcvs Exp $ */ + +/* + +Copyright 1991, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/lib/font/include/fntfilst.h,v 3.8 2002/12/09 17:30:00 dawes Exp $ */ + +/* + * Author: Keith Packard, MIT X Consortium + */ + +#ifndef _FONTFILEST_H_ +#define _FONTFILEST_H_ + +#ifndef FONTMODULE +#include <X11/Xos.h> +#endif +#ifndef XP_PSTEXT +#include <X11/fonts/fontmisc.h> +#endif +#include <X11/fonts/fontstruct.h> +#include <X11/fonts/fontxlfd.h> +#include <X11/fonts/fntfil.h> + +typedef struct _FontName { + char *name; + short length; + short ndashes; +} FontNameRec; + +typedef struct _FontScaled { + FontScalableRec vals; + FontEntryPtr bitmap; + FontPtr pFont; +} FontScaledRec; + +typedef struct _FontScalableExtra { + FontScalableRec defaults; + int numScaled; + int sizeScaled; + FontScaledPtr scaled; + pointer private; +} FontScalableExtraRec; + +typedef struct _FontScalableEntry { + FontRendererPtr renderer; + char *fileName; + FontScalableExtraPtr extra; +} FontScalableEntryRec; + +/* + * This "can't" work yet - the returned alias string must be permanent, + * but this layer would need to generate the appropriate name from the + * resolved scalable + the XLFD values passed in. XXX + */ + +typedef struct _FontScaleAliasEntry { + char *resolved; +} FontScaleAliasEntryRec; + +typedef struct _FontBitmapEntry { + FontRendererPtr renderer; + char *fileName; + FontPtr pFont; +} FontBitmapEntryRec; + +typedef struct _FontAliasEntry { + char *resolved; +} FontAliasEntryRec; + +typedef struct _FontBCEntry { + FontScalableRec vals; + FontEntryPtr entry; +} FontBCEntryRec; + +typedef struct _FontEntry { + FontNameRec name; + int type; + union _FontEntryParts { + FontScalableEntryRec scalable; + FontBitmapEntryRec bitmap; + FontAliasEntryRec alias; + FontBCEntryRec bc; + } u; +} FontEntryRec; + +typedef struct _FontTable { + int used; + int size; + FontEntryPtr entries; + Bool sorted; +} FontTableRec; + +typedef struct _FontDirectory { + char *directory; + unsigned long dir_mtime; + unsigned long alias_mtime; + FontTableRec scalable; + FontTableRec nonScalable; + char *attributes; +} FontDirectoryRec; + +/* Capability bits: for definition of capabilities bitmap in the + FontRendererRec to indicate support of XLFD enhancements */ + +#define CAP_MATRIX 0x1 +#define CAP_CHARSUBSETTING 0x2 + +typedef struct _FontRenderer { + char *fileSuffix; + int fileSuffixLen; + int (*OpenBitmap)(FontPathElementPtr /* fpe */, + FontPtr * /* pFont */, + int /* flags */, + FontEntryPtr /* entry */, + char * /* fileName */, + fsBitmapFormat /* format */, + fsBitmapFormatMask /* mask */, + FontPtr /* non_cachable_font */); + int (*OpenScalable)(FontPathElementPtr /* fpe */, + FontPtr * /* pFont */, + int /* flags */, + FontEntryPtr /* entry */, + char * /* fileName */, + FontScalablePtr /* vals */, + fsBitmapFormat /* format */, + fsBitmapFormatMask /* fmask */, + FontPtr /* non_cachable_font */); + int (*GetInfoBitmap)(FontPathElementPtr /* fpe */, + FontInfoPtr /* pFontInfo */, + FontEntryPtr /* entry */, + char * /*fileName */); + int (*GetInfoScalable)(FontPathElementPtr /* fpe */, + FontInfoPtr /* pFontInfo */, + FontEntryPtr /* entry */, + FontNamePtr /* fontName */, + char * /* fileName */, + FontScalablePtr /* vals */); + int number; + int capabilities; /* Bitmap components defined above */ +} FontRendererRec; + +typedef struct _FontRenders { + int number; + struct _FontRenderersElement { + /* In order to preserve backward compatibility, the + priority field is made invisible to renderers */ + FontRendererPtr renderer; + int priority; + } *renderers; +} FontRenderersRec, *FontRenderersPtr; + +typedef struct _BitmapInstance { + FontScalableRec vals; + FontBitmapEntryPtr bitmap; +} BitmapInstanceRec, *BitmapInstancePtr; + +typedef struct _BitmapScalablePrivate { + int numInstances; + BitmapInstancePtr instances; +} BitmapScalablePrivateRec, *BitmapScalablePrivatePtr; + +typedef struct _BitmapSources { + FontPathElementPtr *fpe; + int size; + int count; +} BitmapSourcesRec, *BitmapSourcesPtr; + +extern BitmapSourcesRec FontFileBitmapSources; + +/* Defines for FontFileFindNamesInScalableDir() behavior */ +#define NORMAL_ALIAS_BEHAVIOR 0 +#define LIST_ALIASES_AND_TARGET_NAMES (1<<0) +#define IGNORE_SCALABLE_ALIASES (1<<1) + +#endif /* _FONTFILEST_H_ */ diff --git a/X11/fonts/fontenc.h b/X11/fonts/fontenc.h new file mode 100644 index 000000000..09472cfc5 --- /dev/null +++ b/X11/fonts/fontenc.h @@ -0,0 +1,124 @@ +/* +Copyright (c) 1998-2001 by Juliusz Chroboczek + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +/* $XFree86: xc/lib/font/include/fontenc.h,v 1.7 2000/11/14 16:54:45 dawes Exp $ */ + +/* Header for backend-independent encoding code */ + +/* An encoding is identified with a name. An encoding contains some + global encoding data, such as its size, and a set of mappings. + Mappings are identified by their type and two integers, known as + pid and eid, the interpretation of which is type dependent. */ + +#ifndef _FONTENC_H +#define _FONTENC_H + +/* Encoding types. For future extensions, clients should be prepared + to ignore unknown encoding types. */ + +/* 0 is treated specially. */ + +#define FONT_ENCODING_UNICODE 1 +#define FONT_ENCODING_TRUETYPE 2 +#define FONT_ENCODING_POSTSCRIPT 3 + +/* This structure represents a mapping, either from numeric codes from + numeric codes, or from numeric codes to strings. */ + +/* It is expected that only one of `recode' and `name' will actually + be present. However, having both fields simplifies the interface + somewhat. */ + +typedef struct _FontMap { + int type; /* the type of the mapping */ + int pid, eid; /* the identification of the mapping */ + unsigned (*recode)(unsigned, void*); /* mapping function */ + char *(*name)(unsigned, void*); /* function returning glyph names */ + void *client_data; /* second parameter of the two above */ + struct _FontMap *next; /* link to next element in list */ + /* The following was added for version 0.3 of the font interface. */ + /* It should be kept at the end to preserve binary compatibility. */ + struct _FontEnc *encoding; +} FontMapRec, *FontMapPtr; + +/* This is the structure that holds all the info for one encoding. It + consists of a charset name, its size, and a linked list of mappings + like above. */ + +typedef struct _FontEnc { + char *name; /* the name of the encoding */ + char **aliases; /* its aliases, null terminated */ + int size; /* its size, either in bytes or rows */ + int row_size; /* the size of a row, or 0 if bytes */ + FontMapPtr mappings; /* linked list of mappings */ + struct _FontEnc *next; /* link to next element */ + /* the following two were added in version 0.2 of the font interface */ + /* they should be kept at the end to preserve binary compatibility */ + int first; /* first byte or row */ + int first_col; /* first column in each row */ +} FontEncRec, *FontEncPtr; + +typedef struct _FontMapReverse { + unsigned int (*reverse)(unsigned, void*); + void *data; +} FontMapReverseRec, *FontMapReversePtr; + + +/* Function prototypes */ + +/* extract an encoding name from an XLFD name. Returns a pointer to a + *static* buffer, or NULL */ +char *FontEncFromXLFD(const char*, int); + +/* find the encoding data for a given encoding name; second parameter + is the filename of the font for which the encoding is needed. + Returns NULL on failure. */ +FontEncPtr FontEncFind(const char*, const char*); + +/* Find a given mapping for an encoding. This is only a convenience + function, as clients are allowed to scavenge the data structures + themselves (as the TrueType backend does). */ + +FontMapPtr FontMapFind(FontEncPtr, int, int, int); + +/* Do both in a single step */ +FontMapPtr FontEncMapFind(const char *, int, int, int, const char *); + +/* Recode a code. Always succeeds. */ +unsigned FontEncRecode(unsigned, FontMapPtr); + +/* Return a name for a code. Returns a string or NULL. */ +char *FontEncName(unsigned, FontMapPtr); + +/* Return a pointer to the name of the system encodings directory. */ +/* This string is static and should not be modified. */ +char* FontEncDirectory(void); + +/* Identify an encoding file. If fileName doesn't exist, or is not an + encoding file, return NULL, otherwise returns a NULL-terminated + array of strings. */ +char **FontEncIdentify(const char *fileName); + +FontMapReversePtr FontMapReverse(FontMapPtr); + +void FontMapReverseFree(FontMapReversePtr); +#endif diff --git a/X11/fonts/fontencc.h b/X11/fonts/fontencc.h new file mode 100644 index 000000000..51e0e1440 --- /dev/null +++ b/X11/fonts/fontencc.h @@ -0,0 +1,36 @@ +/* +Copyright (c) 1998-2001 by Juliusz Chroboczek + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ +/* $XFree86$ */ + +/* Binary compatibility entry points. */ + +/* This file includes code to make modules compiled for earlier + versions of the fontenc interfaces link with this one. It does + *not* provide source compatibility, as many of the data structures + now have different names. */ + +extern char *font_encoding_from_xlfd(const char*, int); +extern unsigned font_encoding_recode(unsigned, FontEncPtr, FontMapPtr); +extern FontEncPtr font_encoding_find(const char*, const char*); +extern char *font_encoding_name(unsigned, FontEncPtr, FontMapPtr); +extern char **identifyEncodingFile(const char *fileName); + diff --git a/X11/fonts/fontmisc.h b/X11/fonts/fontmisc.h new file mode 100644 index 000000000..92d4966ca --- /dev/null +++ b/X11/fonts/fontmisc.h @@ -0,0 +1,142 @@ +/* $Xorg: fontmisc.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ + +/* + +Copyright 1991, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/lib/font/include/fontmisc.h,v 3.16 2001/12/14 19:56:54 dawes Exp $ */ + +/* + * Author: Keith Packard, MIT X Consortium + */ + +#ifndef _FONTMISC_H_ +#define _FONTMISC_H_ + +#ifndef FONTMODULE +#include <X11/Xfuncs.h> +#include <stdlib.h> +#include <stdio.h> + +#ifndef X_NOT_POSIX +#include <unistd.h> +#else +extern int close(); +#endif + +#endif /* FONTMODULE */ + +#include <X11/Xdefs.h> + + +#ifndef LSBFirst +#define LSBFirst 0 +#define MSBFirst 1 +#endif + +#ifndef None +#define None 0l +#endif + +#ifndef TRUE +#define TRUE 1 +#define FALSE 0 +#endif + +extern Atom MakeAtom ( char *string, unsigned len, int makeit ); +extern int ValidAtom ( Atom atom ); +extern char *NameForAtom (Atom atom); + +#ifndef _MSC_VER +#ifndef _HAVE_XALLOC_DECLS +#define _HAVE_XALLOC_DECLS +extern pointer Xalloc(unsigned long); +extern pointer Xrealloc(pointer, unsigned long); +extern void Xfree(pointer); +extern pointer Xcalloc(unsigned long); +#endif +#endif +extern int f_strcasecmp(const char *s1, const char *s2); + +#ifndef xalloc +#ifdef _MSC_VER +#define xalloc(n) malloc ((unsigned) n) +#define xfree(p) free ((pointer) p) +#define xrealloc(p,n) realloc (p,n) +#define xcalloc(n,s) calloc(n, s) +#else +#define xalloc(n) Xalloc ((unsigned) n) +#define xfree(p) Xfree ((pointer) p) +#define xrealloc(p,n) Xrealloc ((pointer)p,n) +#define xcalloc(n,s) Xcalloc((unsigned) n * (unsigned) s) +#endif +#endif +#define lowbit(x) ((x) & (~(x) + 1)) + +#undef assert +#define assert(x) ((void)0) + +#ifndef strcasecmp +#if defined(NEED_STRCASECMP) && !defined(FONTMODULE) +#define strcasecmp(s1,s2) f_strcasecmp(s1,s2) +#endif +#endif + +extern void +BitOrderInvert( + register unsigned char *, + register int +); + +extern void +TwoByteSwap( + register unsigned char *, + register int +); + +extern void +FourByteSwap( + register unsigned char *, + register int +); + +extern int +RepadBitmap ( + char*, + char*, + unsigned, + unsigned, + int, + int +); + +extern void CopyISOLatin1Lowered( + char * /*dest*/, + char * /*source*/, + int /*length*/ +); + +extern void register_fpe_functions(void); + +#endif /* _FONTMISC_H_ */ diff --git a/X11/fonts/fontmod.h b/X11/fonts/fontmod.h new file mode 100644 index 000000000..42d277fd4 --- /dev/null +++ b/X11/fonts/fontmod.h @@ -0,0 +1,16 @@ +/* $XFree86: xc/lib/font/include/fontmod.h,v 1.2 1998/07/25 06:57:09 dawes Exp $ */ + +#ifndef _FONTMOD_H_ +#define _FONTMOD_H_ + +typedef void (*InitFont)(void); + +typedef struct { + InitFont initFunc; + char * name; + pointer module; +} FontModule; + +extern FontModule *FontModuleList; + +#endif /* _FONTMOD_H_ */ diff --git a/X11/fonts/fontutil.h b/X11/fonts/fontutil.h new file mode 100644 index 000000000..9a73eaa47 --- /dev/null +++ b/X11/fonts/fontutil.h @@ -0,0 +1,26 @@ +/* $XFree86: xc/lib/font/include/fontutil.h,v 1.1 1999/03/14 11:17:49 dawes Exp $ */ + +#ifndef _FONTUTIL_H_ +#define _FONTUTIL_H_ + +#include <X11/fonts/FSproto.h> + +extern int FontCouldBeTerminal(FontInfoPtr); +extern int CheckFSFormat(fsBitmapFormat, fsBitmapFormatMask, int *, int *, + int *, int *, int *); +extern void FontComputeInfoAccelerators(FontInfoPtr); + +extern void GetGlyphs ( FontPtr font, unsigned long count, + unsigned char *chars, FontEncoding fontEncoding, + unsigned long *glyphcount, CharInfoPtr *glyphs ); +extern void QueryGlyphExtents ( FontPtr pFont, CharInfoPtr *charinfo, + unsigned long count, ExtentInfoRec *info ); +extern Bool QueryTextExtents ( FontPtr pFont, unsigned long count, + unsigned char *chars, ExtentInfoRec *info ); +extern Bool ParseGlyphCachingMode ( char *str ); +extern void InitGlyphCaching ( void ); +extern void SetGlyphCachingMode ( int newmode ); +extern int add_range ( fsRange *newrange, int *nranges, fsRange **range, + Bool charset_subset ); + +#endif /* _FONTUTIL_H_ */ diff --git a/X11/fonts/fontxlfd.h b/X11/fonts/fontxlfd.h new file mode 100644 index 000000000..e87b93143 --- /dev/null +++ b/X11/fonts/fontxlfd.h @@ -0,0 +1,100 @@ +/* $Xorg: fontxlfd.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ + +/* + +Copyright 1990, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ +/* $XFree86: xc/lib/font/include/fontxlfd.h,v 1.5 2001/01/17 19:43:32 dawes Exp $ */ + +/* + * Author: Keith Packard, MIT X Consortium + */ + +#ifndef _FONTXLFD_H_ +#define _FONTXLFD_H_ + +#include <X11/fonts/FSproto.h> + +/* Constants for values_supplied bitmap */ + +#define SIZE_SPECIFY_MASK 0xf + +#define PIXELSIZE_MASK 0x3 +#define PIXELSIZE_UNDEFINED 0 +#define PIXELSIZE_SCALAR 0x1 +#define PIXELSIZE_ARRAY 0x2 +#define PIXELSIZE_SCALAR_NORMALIZED 0x3 /* Adjusted for resolution */ + +#define POINTSIZE_MASK 0xc +#define POINTSIZE_UNDEFINED 0 +#define POINTSIZE_SCALAR 0x4 +#define POINTSIZE_ARRAY 0x8 + +#define PIXELSIZE_WILDCARD 0x10 +#define POINTSIZE_WILDCARD 0x20 + +#define ENHANCEMENT_SPECIFY_MASK 0x40 + +#define CHARSUBSET_SPECIFIED 0x40 + +#define EPS 1.0e-20 +#define XLFD_NDIGITS 3 /* Round numbers in pixel and + point arrays to this many + digits for repeatability */ + +typedef struct _FontScalable { + int values_supplied; /* Bitmap identifying what advanced + capabilities or enhancements + were specified in the font name */ + double pixel_matrix[4]; + double point_matrix[4]; + + /* Pixel and point fields are deprecated in favor of the + transformation matrices. They are provided and filled in for the + benefit of rasterizers that do not handle the matrices. */ + + int pixel, + point; + + int x, + y, + width; + char *xlfdName; + int nranges; + fsRange *ranges; +} FontScalableRec, *FontScalablePtr; + + +extern double xlfd_round_double ( double x ); +extern Bool FontParseXLFDName ( char *fname, FontScalablePtr vals, int subst ); +extern fsRange *FontParseRanges ( char *name, int *nranges ); + +#define FONT_XLFD_REPLACE_NONE 0 +#define FONT_XLFD_REPLACE_STAR 1 +#define FONT_XLFD_REPLACE_ZERO 2 +#define FONT_XLFD_REPLACE_VALUE 3 + +#endif /* _FONTXLFD_H_ */ diff --git a/X11/fonts/pcf.h b/X11/fonts/pcf.h new file mode 100644 index 000000000..673e18449 --- /dev/null +++ b/X11/fonts/pcf.h @@ -0,0 +1,102 @@ +/* $Xorg: pcf.h,v 1.4 2001/02/09 02:04:02 xorgcvs Exp $ */ + +/* + +Copyright 1991, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ +/* $XFree86: xc/lib/font/bitmap/pcf.h,v 1.4 2001/12/14 19:56:47 dawes Exp $ */ + +/* + * Author: Keith Packard, MIT X Consortium + */ + +#ifndef _PCF_H_ +#define _PCF_H_ + +#include <X11/fonts/fntfilio.h> + +/* + * Information used to read/write PCF fonts + */ + +typedef struct _PCFTable { + CARD32 type; + CARD32 format; + CARD32 size; + CARD32 offset; +} PCFTableRec, *PCFTablePtr; + +#define PCF_FILE_VERSION (('p'<<24)|('c'<<16)|('f'<<8)|1) +#define PCF_FORMAT_MASK 0xffffff00 + +#define PCF_DEFAULT_FORMAT 0x00000000 +#define PCF_INKBOUNDS 0x00000200 +#define PCF_ACCEL_W_INKBOUNDS 0x00000100 +#define PCF_COMPRESSED_METRICS 0x00000100 + +#define PCF_FORMAT_MATCH(a,b) (((a)&PCF_FORMAT_MASK) == ((b)&PCF_FORMAT_MASK)) + +#define PCF_GLYPH_PAD_MASK (3<<0) +#define PCF_BYTE_MASK (1<<2) +#define PCF_BIT_MASK (1<<3) +#define PCF_SCAN_UNIT_MASK (3<<4) + +#define PCF_BYTE_ORDER(f) (((f) & PCF_BYTE_MASK)?MSBFirst:LSBFirst) +#define PCF_BIT_ORDER(f) (((f) & PCF_BIT_MASK)?MSBFirst:LSBFirst) +#define PCF_GLYPH_PAD_INDEX(f) ((f) & PCF_GLYPH_PAD_MASK) +#define PCF_GLYPH_PAD(f) (1<<PCF_GLYPH_PAD_INDEX(f)) +#define PCF_SCAN_UNIT_INDEX(f) (((f) & PCF_SCAN_UNIT_MASK) >> 4) +#define PCF_SCAN_UNIT(f) (1<<PCF_SCAN_UNIT_INDEX(f)) +#define PCF_FORMAT_BITS(f) ((f) & (PCF_GLYPH_PAD_MASK|PCF_BYTE_MASK|PCF_BIT_MASK|PCF_SCAN_UNIT_MASK)) + +#define PCF_SIZE_TO_INDEX(s) ((s) == 4 ? 2 : (s) == 2 ? 1 : 0) +#define PCF_INDEX_TO_SIZE(b) (1<<b) + +#define PCF_FORMAT(bit,byte,glyph,scan) (\ + (PCF_SIZE_TO_INDEX(scan) << 4) | \ + (((bit) == MSBFirst ? 1 : 0) << 3) | \ + (((byte) == MSBFirst ? 1 : 0) << 2) | \ + (PCF_SIZE_TO_INDEX(glyph) << 0)) + +#define PCF_PROPERTIES (1<<0) +#define PCF_ACCELERATORS (1<<1) +#define PCF_METRICS (1<<2) +#define PCF_BITMAPS (1<<3) +#define PCF_INK_METRICS (1<<4) +#define PCF_BDF_ENCODINGS (1<<5) +#define PCF_SWIDTHS (1<<6) +#define PCF_GLYPH_NAMES (1<<7) +#define PCF_BDF_ACCELERATORS (1<<8) + +extern int pcfReadFont ( FontPtr pFont, FontFilePtr file, + int bit, int byte, int glyph, int scan ); +extern int pcfReadFontInfo ( FontInfoPtr pFontInfo, FontFilePtr file ); +extern int pmfReadFont ( FontPtr pFont, FontFilePtr file, + int bit, int byte, int glyph, int scan ); +extern int pcfWriteFont ( FontPtr pFont, FontFilePtr file ); +extern void pcfError ( const char *, ... ); + +#endif /* _PCF_H_ */ diff --git a/X11/xtrans/Xtrans.c b/X11/xtrans/Xtrans.c index 7b18f1097..d3079ff48 100644 --- a/X11/xtrans/Xtrans.c +++ b/X11/xtrans/Xtrans.c @@ -49,6 +49,9 @@ from The Open Group. #include <ctype.h> +#ifdef _MSC_VER +#include <X11\Xwinsock.h> +#endif /* * The transport table contains a definition for every transport (protocol) * family. All operations that can be made on the transport go through this @@ -115,9 +118,10 @@ Xtransport_table Xtransports[] = { { &TRANS(SCOFuncs), TRANS_LOCAL_SCO_INDEX }, #endif /* sun */ #endif /* LOCALCONN */ + { NULL, 0} }; -#define NUMTRANS (sizeof(Xtransports)/sizeof(Xtransport_table)) +#define NUMTRANS (sizeof(Xtransports)/sizeof(Xtransport_table)-1) #ifdef WIN32 @@ -728,7 +732,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg) #if defined(WIN32) { #ifdef WIN32 - u_long arg; + unsigned long arg; #else int arg; #endif @@ -953,7 +957,7 @@ int TRANS(IsLocal) (XtransConnInfo ciptr) { - return (ciptr->family == AF_UNIX); + return (ciptr->family == AF_UNIX); } diff --git a/X11/xtrans/Xtranssock.c b/X11/xtrans/Xtranssock.c index 3d45c2bfb..4c39c4064 100644 --- a/X11/xtrans/Xtranssock.c +++ b/X11/xtrans/Xtranssock.c @@ -221,7 +221,11 @@ static int TRANS(SocketINETClose) (XtransConnInfo ciptr); #endif #if defined HAVE_SOCKLEN_T || (defined(IPv6) && defined(AF_INET6)) +#ifdef _MSC_VER +# define SOCKLEN_T int +#else # define SOCKLEN_T socklen_t +#endif #elif defined(SVR4) || defined(__SVR4) || defined(__SCO__) # define SOCKLEN_T size_t #else |