O'Reilly logo

Xlib Reference Manual for Version 11 Volume 2, 5th Editon by Adrian Nye

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

XStringToKeysym

XLookupKeysym

XRebindKeysym

Convert a keycode to a keysym.

Convert a keysym to the appropriate keycode.

Convert a keysym symbol to a string.

Convert a keysym name string to a keysym.

Get the keysym corresponding to a keycode in a structure.

Rebind a keysym to a string for client.

Function Group Summary

Keyboard (continued)

XLookupString

XQueryKeymap

XGetKeyboardMapping

XChangeKeyboardMapping

XRefreshKeyboardMapping

XSe-tModifierMapping

XGetModifierMapping

XDeleteModifiermapEntry

XInsertModifiermapEntry

XNewModifiermap

XFreeModifiermap

XDisplayKeycodes

Macros, Display

Map a key event to ASCII string, keysym, and Compose-

Status.

Obtain a bit vector for the current state of the keyboard.

Return symbols for keycodes.

Change the keyboard mapping.

Update the stored modifier and keymap information.

Set keycodes to be used as modifiers (Shift, Control, etc.).

Obtain modifier key mapping (Shift, Control, etc.).

Delete an entry from an XModif ierKeymap structure.

Add a new entry to an XModif ierKeymap structure.

Create a keyboard modifier mapping structure.

Destroy and free a keyboard modifier mapping structure.

Returns range of keycodes used by server.

AllPlanes BlackPixel BlackPixelOfScreen

CellsOfScreen ConnectionNumber

DefaultColormap DefaultColormapOfScreen DefaultDepth DefaultDepthOfScreen DefaultGC

DefaultGCOfScreen

DefaultRootWindow DefaultScreen

DefaultScreenOfDisplay DefaultVisual DefaultVisualOfScreen DisplayCells

DisplayHeight

DisplayHeightMM DisplayOfScreen Display?lanes

Return an unsigned long value with all bits set Return a black pixel value on the default colormap of screen. Return the black pixel value in the default colormap of the specified screen.

Return the number of colormap cells of the specified screen. Return the connection number (file descriptor on UNIX sys tem).

Return the default colormap on the specified screen. Return the default colormap of the specified screen. Return the depth of the default root window for a screen. Return the default depth of the specified screen. Return the default graphics context for the root window of a screen.

Return the default graphics context (GC) of the specified screen.

Return the root window for the default screen. Return the screen integer; the last segment of a string passed to XOpenDisplay, or the DISPLAY environment variable if NULL was used.

Return the default screen of the specified display. Return the default visual structure for a screen. Return the default visual of the specified screen. Return the maximum number of colormap cells on the con nected display.

Return an integer that describes the height of the screen in pix els.

Return the height of the specified screen in millimeters. Return the display of the specified screen. Return the number of planes on the connected display.

554

Xlib Reference Manual

Macros, Display (continued)

DisplayString DisplayType

DisplayWidth

DisplayWidthMM

DoesBackingStore

DoesSaveUnders

dpyno

EventMaskOfScreen HeightOfScreen HeightMMOfScreen Keyboard

LastKnownRequest-

Processed MaxCmapsOfScreen

MinCmapsOfScreen

NextRequest PlanesOfScreen ProtocolRevision ProtocolVersion

QLength

RootWindow RootWindowOfScreen ScreenCount XScreenNumberOfScreen

ScreenOfDisplay ServerVendor

VendorRelease

WhitePixel WhitePixelOfScreen

WidthOfScreen

WidthMMOfScreen

XDisplayMotionBufferSize

Return the string that was passed to XOpenDisplay or if that was NULL, the DISPLAY variable. Return the connected display manufacturer, as defined in <XlllXvendors.h>.

Return the width of the screen in pixels. Return the width of the specified screen in millimeters. Return a value indicating whether the screen supports backing stores. Return one of WhenMapped, NotUseful, or Always.

Return whether the screen supports save unders. True or False.

Return the file descriptor of the connected display. Return the initial root event mask for the specified screen. Return the height of the specified screen. Return the height of the specified screen in millimeters. Return the device ID for the main keyboard connected to the display.

Return the serial ID of the last known protocol request to have been issued.

Return the maximum number of colormaps supported by a screen.

Return the minimum number of colormaps supported by a screen.

Return the serial ID of the next protocol request to be issued. Return the number of planes in a screen. Return the minor protocol revision number of the X server. Return the version number of the X protocol on the connected display.

Return the current length of the input queue on the connected display.

Return the ID of the root window. Return the root window of the specified screen. Return the number of available screens. Return the integer corresponding to the specified pointer to a Screen structure.

Return the specified screen of the specified display. Return a pointer to a null-terminated string giving some identi fication of the maker of the X server implementation. Return a number related to the release of the X server by the vendor.

Return a pixel value representing white in default colormap. Return the white pixel value in the default colormap of the specified screen.

Return the width of the specified screen. Return the width of the specified screen in millimeters. Return size of server's motion history buffer.

Function Group Summary

Macros, Display (continued)

XListDepths Return a list of the depths supported on this server.

XListPixmapFormats Return a list of the pixmap formats supported on this server.

XMaxRequestsize Return maximum request size allowed on this server.

XResourceManagerString Return string containing user's resource database.

Macros, Image Format

BitmapBitOrder Return LeastSignifleant or MostSignifleant.

Indicates the bit order in BitmapUnit.

BitmapPad Each scan line is padded to a multiple of bits specified by the

value returned by this macro.

BitmapUnit The scan line is quantized (calculated) in multiples of this

value.

ByteOrder Specifies the required byte order for images for each scan line

unit in XYFormat (bitmap) or for each pixel value in ZFor-mat. Possible values are LSBFirst orMSBFirst.

i mage ByteOrder Specifies the required byte order for images for each scan line

unit in XYFormat (bitmap) or for each pixel value in zFor mat. Return either LSBFirst orMSBFirst.

Macros, Keysym Classification

isCursorKey Return True if the keysym is on the cursor key.

isFunctionKey Return True if the keysym is on the function keys.

I sKeypadKey Return T rue if the keysym is on the key pad.

isMiscFunct ionKey Return True if the keysym is on the miscellaneous function keys.

isModif ierKey Return True if the keysym is on the modifier keys.

I sPFKey Return T rue if the keysym is on the PF keys.

Mapping

(see Window Mapping, Keyboard, or Pointer) Output Buffer

<Flush Rush the request buffer.

xs ync Flush the request buffer and wait for all events to be processed

by the server.

Pointers

XQueryPointer Get the current pointer location.

xwarpPointer Move the pointer to another point on the screen.

XGrabPointer Grab the pointer.

xungrabPointer Release the pointer from grab.

556

Xlib Reference Manual

Pointers (continued)

XGetPointerMapping

XSetPointerMapping

XGetPointerControl

XChangePointerControl

XChangeActivePointerGrab

Get the pointer button mapping.

Set the pointer button mapping.

Get the current pointer preferences.

Change the pointer preferences.

Change the parameters of an active pointer grab.

Properties

XListProperties

XDeleteProperty

XChangeProperty

XSetStandardProperties

XRotateWindowProperties

XGetAtomName

XGetFontProperty

XGetWindowProperty

XInternAtom

XGetTextProperty

XSetTextProperty

XStringListToTextProperty

XTextPropertyToStringList

XFreeStringList

Get the property list for a window.

Delete a window property.

Change a property associated with a window.

Set the minimum set of properties for the window manager.

Rotate properties in the properties array.

Get a name for a given atom.

Get a font property given its atom.

Obtain the atom type and property format for a window.

Return an atom for a given name string.

Read a TEXT property.

Write a TEXT property.

Convert a list of strings to an XTextProperty structure.

Convert an XTextProperty to a list of strings.

Free memory allocated by XTextPropertyToStringList.

Regions

XCreateRegion

XDestroyRegion

XEmptyRegion

XPolygonRegion

XPointlnRegion

XRectlnRegion

XUnionRectWithRegion

XClipBox

XOffsetRegion

XShrinkRegion

XEqualRegion

XSetRegion

XSubtractRegion XIntersectRegion XUnionRegion XXorRegion

Create a new empty region.

Deallocate storage associated with a region.

Determine if a region is empty.

Generate a region from points.

Determine if a point resides in a region.

Determine if a rectangle resides in a region.

Add a rectangle to a region.

Generate the smallest rectangle enclosing a region.

Change offset of a region.

Reduce the size of a region.

Determine if two regions have the same size, offset, and space.

Set clip_mask of the graphics context to the specified

region.

Subtract one region from another.

Compute the intersection of two regions.

Compute the union of two regions.

Calculate the difference between the union and intersection of

2 regions.

Function Group Summary

Resource Manager

XrmDestroyDatabase

XrmGetFileDatabase

XrmGetResource

XrmGetStringDatabase

Xrmlnitialize

XrmMergeDatabases

XrmParseCommand

XrmPutFileDatabase

XrmPutLineResource

XrmPutResource

XrmPutStringResource

XrmQGetResource

XrmQGetSearchList

XrmQGetSearchResource

XrmQPutResource

XrmQPutStringResource

XrmQuarkToString

XrmStringToBinding-

QuarkList

XrmStringToQuarkList XrmStringToQuark XrmUniqueQuark Xpermalloc XResourceManagerString

Destroy a resource database.

Retrieve a database from a file.

Get a resource from name and class as strings.

Create a database from a string.

Initialize the resource manager.

Merge the contents of one database with another.

Load a resource database from command line arguments.

Store a database in a file.

Add a resource entry given as a string of name and value.

Store a resource into a database.

Add a resource that is specified as a string.

Get a resource from name and class as quarks.

Return a list of database levels.

Search resource database levels for a given resource.

Store a resource into a database using quarks.

Add a string resource value to a database using quarks.

Convert a quark to a string.

Convert a key string to a binding list and a quark list.

Convert a key string to a quark list.

Convert a string to a quark.

Allocate a new quark.

Allocate memory never to be freed.

Get user's database set with xrdb from Display structure.

Save Set

XAddToSaveSet

XRemoveFromSaveSet

XChangeSaveSet

Add a window to the client's save-set.

Remove a window from the client's save-set.

Add or remove a window to or from the client's save-set.

Screen Saver

XActivateScreenSaver

XForceScreenSaver

XResetScreenSaver

XGetScreenSaver

XSetScreenSaver

Activate screen blanking.

Turn the screen saver on or off.

Reset the screen saver.

Get the current screen saver parameters.

Set the parameters of the screen saver.

Selections

XGetSelectionOwner XSetSelectionOwner XConvertSelection

Return the owner of a selection. Set the owner of a selection. Use the value of a selection.

555

Xlib Reference Manual

Server Specifications

(see Display Specifications)

Standard Geometry

XGeometry XWMGeometry XParseGeometry XTranslateCoordinates

Calculate window geometry given user geometry string and

default geometry. Superceded in R4 by XWMGeometry.

Calculate window geometry given user geometry string and

default geometry.

Generate position and size from standard window geometry

string.

Change the coordinate system from one window to another.

Text

XDrawImageString XDrawImageStringl6 XDrawString XDrawStringlG XDrawText XDrawTextl6 XQueryTextExtents XQueryTextExtentsl6

XTextExtents XTextExtentslG XTextWidth XTextWidthlG

Draw 8-bit image text characters. Draw 16-bit image text characters. Draw an 8-bit text string, foreground only. Draw two-byte text strings. Draw 8-bit polytext strings. Draw 16-bit polytext strings. Query the server for string and font metrics. Query the server for string and font metrics of a 16-bit charac ter string.

Get string and font metrics.

Get string and font metrics of a 16-bit character string. Get the width in pixels of an 8-bit character string. Get the width in pixels of a 16-bit character string.

Tile, Pixmap, Stipple and Bitmap

XCreatePixmap

XFreePixmap

XQueryBestSize

XQueryBestStipple

XQueryBestTile

XSetTile

XSetWindowBorderPixmap

XSetWindowBackgroundPixmap

XReadBitmapFile

XWriteBitmapFile

XCreateBitmapFromData

XCreatePixmapFromBitmapData

XListPixmapFormats

Create a pixmap.

Free a pixmap ID.

Obtain the "best" supported cursor, tile, or stipple size.

Obtain the best supported stipple shape.

Obtain the best supported fill tile shape.

Set the fill tile in a graphics context.

Change a window border tile attribute and repaint the border.

Change the background tile attribute of a window.

Read a bitmap from disk.

Write a bitmap to a file.

Create a bitmap from XI1 bitmap format data.

Create a pixmap with depth from bitmap data.

Read supported pixmap formats from Display structure.

Function Group Summary

User Preferences

XAutoRepeatOff

XAutoRepeatOn

XBell

XGetDefault

XGetPointerControl

XGetKeyboardControl

XChangeKeyboardControl

Turn off the keyboard auto-repeat keys.

Turn on the keyboard auto-repeat keys.

Ring the bell (Control G).

Scan the user preferences for program name and options.

Get the current pointer preferences.

Obtain a list of the current keyboard preferences.

Change the keyboard preferences.

Visuals

XGetVisuallnfo XMatchVisuallnfo

DefaultVisual XVisuallDFromVisual

Find a visual information structure that matches the specified

template.

Obtain the visual information that matches the desired depth

and class.

Return the default visual structure for a screen.

Get resource ID from a visual structure.

Window Attributes

XGetWindowAttributes XChangeWindowAttributes XSetWindowBackground XSetWindowBackgroundPixmap XSetWindowBorder

XSetWindowBorderPixmap

XSetWindowColormap

XDefineCursor

XGetGeometry

XSelectlnput

Obtain the current attributes of window.

Set window attributes.

Set the background pixel attribute of a window.

Change the background tile attribute of a window.

Change a window border attribute to the specified pixel value

and repaint the border.

Change a window border tile attribute and repaint the border.

Set the colormap for a specified window.

Assign a cursor to a window.

Obtain the current geometry of drawable.

Select the event types to be sent to a window.

Window Configuration

XMoveWindow

XResizeWindow

XMoveResizeWindow

XSetWindowBorderWidth

XRestackWindows

XConfigureWindow

XGetGeometry XReconfigureWMWindow

Move a window.

Change a window's size.

Change the size and position of a window.

Change the border width of a window.

Change the stacking order of siblings.

Change the window position, size, border width, or stacking

order.

Obtain the current geometry of drawable.

Change top-level window position, size, border width, or

stacking order.

560

Xlib Reference Manual

Window Existence

XCreateSimpleWindow XCreateWindow XDestroySubwindows XDestroyWindow

Create an unmapped inputOutput subwindow.

Create a window and set attributes.

Destroy all subwindows of a window.

Unmap and destroy a window and all subwindows.

Window Manager Hints

XGetClassHint

XSetClassHint

XGetNormalHints

XSetNormalHints

XGetSizeHints

XSetSizeHints

XGetTranslentForHint

XSetTransientForHint

XGetWMHints

XSetWMHints

XGetZoomHints

XSetZoomHints

XFetchName

XStoreName

XGetlconName XSetlconName

XGetlconSizes XSetlconSizes XSetCommand

XAllocClassHint

XAllocIconSize

XAllocSizeHints

XAllocStandardColormap

XAllocWMHints

Get the XA_WM_CLASS property of a window. Obsolete in

R4.

Set the XA_WM_CLASS property of a window. Obsolete in

R4.

Get the size hints property of a window in normal state (not

zoomed or iconified). Obsolete in R4.

Set the size hints property of a window in normal state (not

zoomed or iconified). Obsolete in R4.

Read any property of type XA_WM_SIZE_HINTS. Obsolete

inR4.

Set the value of any property of type XA_WM_-

SIZE_HINTS. Obsolete in R4.

Get the XA_WM_TRANSIENT_FOR property of a window.

Set the XA_WM_TRANSIENT_FOR property of a window.

Read a window manager hints property.

Set a window manager hints property.

Read the size hints property of a zoomed window. Obsolete in

R4.

Set the size hints property of a zoomed window. Obsolete in

R4.

Get a window's name (XA_WM_NAME property). Obsolete in

R4.

Assign a name to a window for the window manager. Obsolete

inR4.

Get the name to be displayed in an icon. Obsolete in R4.

Set the name to be displayed in a window's icon. Obsolete in

R4.

Get preferred icon sizes.

Set the value of the XA_WM_ICON_SIZE property.

Set the XA_WM_COMMAND property (command line arguments).

Obsolete in R4.

Allocate and zero fields in XClassHint structure.

Allocate and zero fields in xlconSize structure.

Allocate and zero fields in xsizeHints structure.

Allocate and zero fields in XStandardColormap structure.

Allocate and zero fields in xwMHints structure.

Function Group Summary

Window Manager Hints (continued)

XGetRGBColormaps XSetRGBColormaps

XGetWMClientMachine XSetWMClientMachine XGetWMIconName

XSetWMIconName

XGetWMProtocols XSetWMProtocols XGetWMNormalHints

XSetWMNormalHints XSetWMSizeHints

XSetWMColormapWindows XGetWMColormapWindows XSetWMProperties

XSetWMName XGetWMName

Read standard colormap property. Replaces XGetStan-

dardColormap.

Write standard colormap property. Replaces xsetstan-

dardColormap.

Read WM_CLIENT_MACHINE property.

Write WM_CLIENT_MACHINE property.

Read XA_WM_ICON_NAME property. Replaces XGet-

IconName.

Write XA_WM_ICON_NAME property. Replaces xset-

IconName.

Read WM_PROTOCOLS property.

Write WM_PROTOCOLS property.

Read XA_WM_NORMAL_HINTS property. Replaces xGet-

NormalHints.

Write XA_WM_NORMAL_HINTS property. Replaces XSet-

NormalHints.

Write XA_WM_SIZE_HINTS property. Replaces xset-

SizeHints.

Write WM_COLORMAP_WINDOWS property.

Read WM_COLORMAP_WINDOWS property.

Write all standard properties. Replaces XSetStan-

dardProperties.

Write XA_WM_NAME property. Replaces XStoreName.

Read XA_WM_NAME property. Replaces XFetchName.

Window Manipulation

XLowerWindow

XRaiseWindow

XCirculateSubwindows

XCirculateSubwindowsDown

XCirculateSubwindowsUp

XQueryTree

XReparentWindow

XMoveWindow

XResizeWindow

XMoveResizeWindow

XSetWindowBorderWidth

XRestackWindows

XConfigureWindow

XlconifyWindow

XWithdrawWindow

XReconfigureWMWindow

Lower a window in the stacking order.

Raise a window to the top of the stacking order.

Circulate the stacking order of children up or down.

Circulate the bottom child to the top of the stacking order.

Circulate the top child to the bottom of the stacking order.

Return a list of children, parent, and root.

Change a window's parent

Move a window.

Change a window's size.

Change the size and position of a window.

Change the border width of a window.

Change the stacking order of siblings.

Change the window position, size, border width, or stacking

order.

Inform window manager that a top-level window should be

iconified.

Inform window manager that a top-level window should be

unmapped.

Reconfigure a top-level window.

562

Xlib Reference Manual

Window Mapping

XMapRaised

XMapSubwindows

XMapWindow

XUnmapSubwindows

XUnmapWindow

XlconifyWindow

XWithdrawWindow

Map a window on top of its siblings.

Map all subwindows.

Map a window.

Unmap all subwindows of a given window.

Unmap a window.

Inform window manager that a top-level window should be iconified.

Inform window manager that a top-level window should be unmapped.

A.2 Alphabetical Listing of Routines

Table A-1. Alphabetical Listing of Routines

Routine

Description

XActivateScreenSaver

XAddHost

XAddHosts

XAddPixel

XAddToSaveSet

XAllocClassHint

XAllocIconSize

XAllocSizeHints

XAllocStandardColormap

XAllocWMHints

XAllocColor

XAllocColorCells XAllocColorPlanes XAllocNamedColor XAllowEvents

XAutoRepeatOff

XAutoRepeatOn

XBell

XChangeActivePointerGrab

XChangeGC

XChangeKeyboardControl

XChangeKeyboardMapping

XChangePointerControl

XChangeProperty

XChangeSaveSet

XChangeWindowAttributes

XChecklfEvent

XCheckMaskEvent

Activate screen blanking. Add a host to the access control list. Add multiple hosts to the access control list. Add a constant value to every pixel value in an image. Add a window to the client's save-set. Allocate and zero fields in XClassHint structure. Allocate and zero fields inxiconSize structure. Allocate and zero fields in XSizeHints structure. Allocate and zero fields in XStandardColormap structure. Allocate and zero fields in XWMHints structure. Allocate a read-only colormap cell with closest hardware-supported color.

Allocate read/write (nonshared) colorcells. Allocate read/write (nonshareable) color planes. Allocate a read-only colorcell from color name. Control the behavior of keyboard and pointer events when these resources are grabbed. Turn off the keyboard auto-repeat keys. Turn on the keyboard auto-repeat keys. Ring the bell (Control G). Change the parameters of an active pointer grab. Change the components of a given graphics context. Change the keyboard preferences such as key click. Change the keyboard mapping. Change the pointer preferences. Change a property associated with a window. Add or remove a window to or from the client's save-set Set window attributes.

Check the event queue for a matching event. Remove the next event that matches mask; don't wait.

Function Group Summary

Table A-1. Alphabetical Listing of Routines (continued)

Routine

Description

XCheckTypedEvent

XCheckTypedWindowEvent

XCheckWindowEvent

XCirculateSubwindows XCirculateSubwindowsDown

XCirculateSubwindowsUp

XClearArea XClearWindow XClipBox XCloseDisplay XConfigureWindow

XConvertSelection

XCopyArea

XCopyColormapAndFree

XCopyGC

XCopyPlane

XCreateAssocTable XCreateBitmapFromData XCreateColormap XCreateFontCursor XCreateGC

XCreateGlyphCursor XCreateImage XCreatePixmap XCreatePixmapCursor XCreatePixmapFrom-

BitmapData XCreateRegion XCreateSimpleWindow XCreateWindow XDefineCursor XDeleteAssoc XDeleteContext XDeleteModifiermapEntry XDeleteProperty XDestroyAssocTable XDestroylmage XDestroyRegion

Return the next event in queue that matches event type;

Return the next event in queue matching type and window.

Remove the next event matching both passed window and

passed mask; don't wait.

Circulate the stacking order of children up or down.

Circulate the bottom child to the top of the

stacking order.

Circulate the top child to the bottom of the

stacking order.

Clear a rectangular area in a window.

Clear an entire window.

Generate the smallest rectangle enclosing a region.

Disconnect a client program from an X server and display.

Change the window position, size, border width, or stacking

order.

Use the value of a selection.

Copy an area of a drawable.

Copy a colormap and return a new colormap ID.

Copy a graphics context.

Copy a single plane of a drawable into a drawable with depth,

applying pixel values.

Create a new association table (X10).

Create a bitmap from XI1 bitmap format data.

Create a colormap.

Create a cursor from the standard cursor font

Create a new graphics context for a given screen with the depth

of the specified drawable.

Create a cursor from font glyphs.

Allocate memory for an xImage structure.

Create a pixmap.

Create a cursor from two bitmaps.

Create a pixmap with depth from bitmap data.

Create a new empty region.

Create an unmapped inputOutput window.

Create a window and set attributes.

Assign a cursor to a window.

Delete an entry from an association table.

Delete a context entry for a given window and type.

Delete an entry from an XModif ierKeymap structure.

Delete a window property.

Free the memory allocated for an association table.

Deallocate memory associated with an image.

Deallocate storage associated with a region.

564

Xlib Reference Manual

Table A-1. Alphabetical Listing of Routines (continued)

Routine

Description

XDestroySubwindows

XDestroyWindow

XDisableAccessControl

XDisplayKeycodes

XDisplayMotionBufferSize

XDisplayName

XDraw

XDrawArc

XDrawArcs

XDrawFilled

XDrawImageString

XDrawImageStringlG

XDrawLine

XDrawLines

XDrawPoint

XDrawPoints

XDrawRectangle

XDrawRectangles

XDrawSegments

XDrawString

XDrawStringl6

XDrawText

XDrawTextlG

XEmptyRegion

XEnableAccessControl

XEqualRegion

XEventsQueued

XFetchBuffer

XFetchBytes

XFetchName

XFillArc

XFillArcs

XFillPolygon

XFillRectangle

XFillRectangles

XFindContext

XFlush

XForceScreenSaver

XFree

XFreeColormap

XFreeColors

XFreeCursor

Destroy all subwindows of a window.

Unmap and destroy a window and all subwindows.

Allow access from any host

Returns range of keycodes used by server.

Return size of server's motion history buffer.

Report the display name when connection to a display fails.

Draw a polyline or curve between vertex list (from X10).

Draw an arc fitting inside a rectangle.

Draw multiple arcs.

Draw a filled polygon or curve from vertex list (from X10).

Draw 8-bit image text characters.

Draw 16-bit image text characters.

Draw a line between two points.

Draw multiple connected lines.

Draw a point.

Draw multiple points.

Draw an outline of a rectangle.

Draw the outlines of multiple rectangles.

Draw multiple disjoint lines.

Draw an 8-bit text string, foreground only.

Draw two-byte text strings.

Draw 8-bit polytext strings.

Draw 16-bit polytext strings.

Determine if a region is empty.

Use access control list to allow or deny connection requests.

Determine if two regions have the same size, offset, and shape.

Check the number of events in the event queue.

Return data from a cut buffer.

Return data from cut buffer 0.

Get a window's name (XA_WM_NAME property).

Fill an arc.

Fill multiple arcs.

Fill a polygon.

Fill a rectangular area.

Fill multiple rectangular areas.

Get data from the context manager (not graphics context).

Flush the request buffer (display all queued requests).

Turn the screen saver on or off.

Free specified in-memory data created by an Xlib function.

Delete a colormap and install the default colormap.

Free colormap cells or planes.

Destroy a cursor.

Function Group Summary

Table A-1. Alphabetical Listing of Routines (continued)

Routine

Description

XCheckTypedEvent

XCheckTypedWindowEvent

XCheckWindowEvent

XCirculateSubwindows XCirculateSubwindowsDown

XCirculateSubwindowsUp

XClearArea

XClearWindow

XClipBox

XCloseDisplay

XConfigureWindow

XConvertSelection

XCopyArea

XCopyColormapAndFree

XCopyGC

XCopyPlane

XCreateAssocTable

XCreateBitmapFromData

XCreateColormap

XCreateFontCursor

XCreateGC

XCreateGlyphCursor XCreateImage XCreatePixmap XCreatePixmapCursor XCreatePixmapFrom-

BitmapData XCreateRegion XCreateSimpleWindow XCreateWindow XDefineCursor XDeleteAssoc XDeleteContext XDeleteModifiermapEntry XDeleteProperty XDestroyAssocTable XDestroylmage XDestroyRegion

Return the next event in queue that matches event type;

Return the next event in queue matching type and window.

Remove the next event matching both passed window and

passed mask; don't wait.

Circulate the stacking order of children up or down.

Circulate the bottom child to the top of the

stacking order.

Circulate the top child to the bottom of the

stacking order.

Clear a rectangular area in a window.

Clear an entire window.

Generate the smallest rectangle enclosing a region.

Disconnect a client program from an X server and display.

Change the window position, size, border width, or stacking

order.

Use the value of a selection.

Copy an area of a drawable.

Copy a colormap and return a new colormap ID.

Copy a graphics context.

Copy a single plane of a drawable into a drawable with depth,

applying pixel values.

Create a new association table (X10).

Create a bitmap from XI1 bitmap format data.

Create a colormap.

Create a cursor from the standard cursor font

Create a new graphics context for a given screen with the depth

of the specified drawable.

Create a cursor from font glyphs.

Allocate memory for an XImage structure.

Create a pixmap.

Create a cursor from two bitmaps.

Create a pixmap with depth from bitmap data.

Create a new empty region.

Create an unmapped inputOutput window.

Create a window and set attributes.

Assign a cursor to a window.

Delete an entry from an association table.

Delete a context entry for a given window and type.

Delete an entry from an XModif ierKeymap structure.

Delete a window property.

Free the memory allocated for an association table.

Deallocate memory associated with an image.

Deallocate storage associated with a region.

564

Xlib Reference Manual

Table A-1. Alphabetical Listing of Routines (continued)

Routine

Description

XDestroySubwindows

XDestroyWindow

XDisableAccessControl

XDisplayKeycodes

XDisplayMotionBufferSize

XDisplayName

XDraw

XDrawArc

XDrawArcs

XDrawFilled

XDrawImageString

XDrawImageString16

XDrawLine

XDrawLines

XDrawPoint

XDrawPoints

XDrawRectangle

XDrawRectangles

XDrawSegments

XDrawString

XDrawStringlG

XDrawText

XDrawTextl6

XEmptyRegion

XEnableAccessControl

XEqualRegion

XEventsQueued

XFetchBuffer

XFetchBytes

XFetchName

XFillArc

XFillArcs

XFillPolygon

XFillRectangle

XFillRectangles

XFindContext

XFlush

XForceScreenSaver

XFree

XFreeColormap

XFreeColors

XFreeCursor

Destroy all subwindows of a window.

Unmap and destroy a window and all subwindows.

Allow access from any host

Returns range of keycodes used by server.

Return size of server's motion history buffer.

Report the display name when connection to a display fails.

Draw a polyline or curve between vertex list (from X10).

Draw an arc fitting inside a rectangle.

Draw multiple arcs.

Draw a filled polygon or curve from vertex list (from X10).

Draw 8-bit image text characters.

Draw 16-bit image text characters.

Draw a line between two points.

Draw multiple connected lines.

Draw a point.

Draw multiple points.

Draw an outline of a rectangle.

Draw the outlines of multiple rectangles.

Draw multiple disjoint lines.

Draw an 8-bit text string, foreground only.

Draw two-byte text strings.

Draw 8-bit polytext strings.

Draw 16-bit polytext strings.

Determine if a region is empty.

Use access control list to allow or deny connection requests.

Determine if two regions have the same size, offset, and shape.

Check the number of events in the event queue.

Return data from a cut buffer.

Return data from cut buffer 0.

Get a window's name (XA_WM_NAME property).

Fill an arc.

Fill multiple arcs.

Fill a polygon.

Fill a rectangular area.

Fill multiple rectangular areas.

Get data from the context manager (not graphics context).

Flush the request buffer (display all queued requests).

Turn the screen saver on or off.

Free specified in-memory data created by an Xlib function.

Delete a colormap and install the default colormap.

Free colormap cells or planes.

Destroy a cursor.

Function Group Summary

Table A-1. Alphabetical Listing of Routines (continued)

Routine

Description

XFreeExtensionList

XFreeFont

XFreeFontlnfo

XFreeFontNames

XFreeFontPath

XFreeGC

XFreeModifiermap

XFreePixmap

XFreeStringList

XGContextFromGC XGeometry

XGetAtomName

XGetClassHint

XGetDefault

XGetErrorDatabaseText

XGetErrorText

XGetFontPath

XGetFontProperty

XGetGeometry

XGetGCValues

XGetlconName

XGetlconSizes

XGetlmage

XGetlnputFocus

XGetKeyboardControl

XGetKeyboardMapping

XGetModifierMapping

XGetMotionEvents

XGetNormalHints

XGetPixel

XGetPointerControl

XGetPointerMapping

XGetRGBColormaps

XGetScreenSaver XGetSelectionOwner XGetSizeHints XGetStandardColormap

Free memory allocated for a list of installed

extensions to X.

Unload a font and free storage for the font structure.

Free multiple font information arrays.

Free the font name array.

Free the memory allocated by XGetFontPath.

Free a graphics context.

Destroy and free a keyboard modifier mapping structure.

Free a pixmap ID.

Free memory allocated by XTextProperty-

ToStringList.

Obtain the GContext (resource ID) associated

with the specified graphics context.

Calculate window geometry given user geometry string

and default geometry.

Get a name for a given atom.

Get the XA_WM_CLASS property of a window.

Scan the user preferences for program name and options.

Obtain error messages from the error database.

Obtain a description of error code.

Get the current font search path.

Get a font property given its atom.

Obtain the current geometry of drawable.

Get GC component values from Xlib's GC cache.

Get the name to be displayed in an icon.

Get preferred icon sizes.

Place contents of a rectangle from drawable into an image.

Return the current keyboard focus window.

Obtain a list of the current keyboard preferences.

Return symbols for keycodes.

Obtain a mapping of modifier keys (Shift, Control, etc.).

Get pointer motion events.

Get the size hints property of a window in normal state (not

zoomed or iconified).

Obtain a single pixel value from an image.

Get the current pointer preferences.

Get the pointer button mapping.

Read standard colormap property.

Replaces XGetStandardColormap.

Get the current screen saver parameters.

Return the owner of a selection.

Read any property of type XA_WM_SIZE_HINTS.

Get the standard colormap property.

566

Xlib Reference Manual

Table A-1. Alphabetical Listing of Routines (continued)

Routine

Description

XGetSublmage

XGetTextProperty

XGetTransientForHint

XGetVisuallnfo

XGetWindowAttributes

XGetWindowProperty

XGetWMClientMachine

XGetWMColormapWindows

XGetWMHints

XGetWMIconName

XGetWMName XGetWMNormalHints

XGetWMProtocols XGetWMSizeHints

XGetZoomHints

XGrabButton

XGrabKey

XGrabKeyboard

XGrabPointer

XGrabServer

XlconifyWindow

XlfEvent

XInsertModifiermapEntry

XInstallColormap

XInternAtom

XIntersectRegion

XKeycodeToKeysym

XKeysymToKeycode

XKeysymToString

XKillClient

XListDepths

XListExtensions

XListFonts

XListFontsWithlnfo

XListHosts

XListlnstalledColormaps

XListPixmapFormats

Copy a rectangle in drawable to a location within the

pre-existing image.

Read a TEXT property.

Get the XA_WM_TRANS IENT_FOR property of a window.

Find a visual information structure that matches the

specified template.

Obtain the current attributes of window.

Obtain the atom type and property format for a window.

Read WM_CLIENT_MACHINE property.

Read WM_COLORMAP_WINDOWS property.

Read a window manager hints property.

Read XA_WM_ICON_NAME property.

Replaces XGetlconName.

Read XA_WM_NAME property. Replaces XFetchName.

Read XA_WM_NORMAL_HINTS property. Replaces

XGetNormalHints.

Read WM_PROTOCOLS property.

Read XA_WM_SIZE_HINTS property. Replaces

XGetSizeHints.

Read the size hints property of a zoomed window.

Grab a pointer button.

Grab a key.

Grab the keyboard.

Grab the pointer.

Grab the server.

Inform window manager that a top-level window should

be iconified.

Wait for matching event

Add a new entry to an XModif ierKeymap structure.

Install a colormap.

Return an atom for a given name string.

Compute the intersection of two regions.

Convert a keycode to a keysym.

Convert a keysym to the appropriate keycode.

Convert a keysym symbol to a string.

Destroy a client or its remaining resources.

Return a list of the depths supported on this server.

Return a list of all extensions to X supported by the server.

Return a list of the available font names.

Obtain the names and information about loaded fonts.

Obtain a list of hosts having access to this display.

Get a list of installed colormaps.

Return a list of the pixmap formats supported on

this server.

Function Group Summary

Table A-1. Alphabetical Listing of Routines (continued)

Routine

Description

XrmQuarkToString XrmStringToBinding-

QuarkList XrmStringToQuark XrmStringToQuarkList XrmUniqueQuark XRotateBuffers XRotateWindowProperties XSaveContext

XSelectlnput

XSendEvent

XSetAccessControl

XSetAfterFunction

XSetArcMode

XSetBackground

XSetClassHint

XSetClipMask

XSetClipOrigin

XSetClipRectangles

XSetCloseDownMode

XSetCommand

XSetDashes

XSetErrorHandler

XSetFillRule

XSetFillStyle

XSetFont

XSetFontPath

XSetForeground

XSetFunction

XSetGraphicsExposures

XSetlconName

XSetlconSizes

XSetlnputFocus

XSetlOErrorHandler

XSetLineAttributes

XSetModifierMapping

XSetNormalHints

XSetPlaneMask XSetPointerMapping

Convert a quark to a string.

Convert a key string to a binding list and a quark

list.

Convert a string to a quark.

Convert a key string to a quark list.

Allocate a new quark.

Rotate the cut buffers.

Rotate properties in the properties array.

Save a data value corresponding to a window and

context type (not graphics context).

Select the event types to be sent to a window.

Send an event

Disable or enable access control.

Set a function called after all Xlib functions.

Set the arc mode in a graphics context.

Set the background pixel value in a graphics context.

Set the XA_WM_CLASS property of a window.

Set clip_mask pixmap in a graphics context.

Set the clip origin in a graphics context.

Change clip_mask in a graphics context to the

list of rectangles.

Change the close down mode of a client.

Set the XA_WM_COMMAND atom (command line arguments).

Set dash_of f set and dashes (for lines) in a graphics context.

Set a nonfatal error event handler.

Set the fill rule in a graphics context.

Set the fill style in a graphics context.

Set the current font in a graphics context.

Set the font search path.

Set the foreground pixel value in a graphics context.

Set the bitwise logical operation in a graphics context.

Set graphics_exposures in a graphics context.

Set the name to be displayed in a window's icon.

Set the value of the XA_WM_ICON_SIZE property.

Set the keyboard focus window.

Handle fatal I/O errors.

Set the line drawing components in a graphics context.

Set keycodes to be used as modifiers (Shift, Control,

etc.).

Set the size hints property of a window in normal state

(not zoomed or iconified).

Set the plane mask in a graphics context.

Set the pointer button mapping.

570

Xlib Reference Manual

Table A-1. Alphabetical Listing of Routines (continued)

Routine

Description

XSetRegion XSetRGBColormaps

XSetScreenSaver

XSetSelectionOwner

XSetSizeHints

XSetStandardColormap

XSetStandardProperties

XSetState

XSetStipple

XSetSubwindowMode

XSetTextProperty

XSetTile

XSetTransientForHint

XSetTSOrigin

XSetWindowBackground

XSetWindowBackground-

Pixmap XSetWindowBorder

XSetWindowBorderP ixmap

XSetWindowBorderWidth

XSetWindowColormap

XSetWMClientMachine

XSetWMColormapWindows

XSetWMHints

XSetWMIconName

XSetWMName

XSetWMNormalHints

XSetWMProperties

XSetWMProtocols XSetWMSizeHints

XSetZoomHints XShrinkRegion XStoreBuffer

Set clip_mask of the graphics context to

the specified region.

Write standard colormap property. Replaces

XSetStandardColormap.

Set the parameters of the screen saver.

Set the owner of a selection.

Set the value of any property of type XA_WM_S I z E_H I N T s.

Change the standard colormap property.

Set the minimum set of properties for the window manager.

Set the foreground, background, logical function, and

plane mask in a graphics context.

Set the stipple in a graphics context.

Set the subwindow mode in a graphics context.

Write a TEXT property using XTextProperty structure.

Set the fill tile in a graphics context.

Set the XA_WM_TRANSIENT_FOR property

of a window.

Set the tile/stipple origin in a graphics context.

Set the background pixel attribute of a window.

Change the background tile attribute of

a window.

Change a window border attribute to the specified

pixel value and repaint the border.

Change a window border tile attribute and repaint

the border.

Change the border width of a window.

Set the colormap for a specified window.

Write WM_CLIENT_MACHINE property.

Write WM_COLORMAP_WINDOWS property.

Set a window manager hints property.

Write XA_WM_ICON_NAME property. Replaces

XSetlconName.

Write XA_WM_NAME property. Replaces

XStoreName.

Write XA_WM_NORMAL_HINTS property.

Replaces XSetNormalHints.

Write all standard properties. Replaces

XSetStandardProperties.

Write WM_PROTOCOLS property.

Write XA_WM_SIZE_HINTS property. Replaces

XSetSizeHints.

Set the size hints property of a zoomed window.

Reduce or expand the size of a region.

Store data in a cut buffer.

Function Group Summary

Table A-1. Alphabetical Listing of Routines (continued)

Routine

Description

XStoreBytes XStoreColor

XStoreColors

XStoreName

XStoreNamedColor

XStringListToTextProperty

XStringToKeysym XSublmage XSubtractRegion XSync

XSynchronize

XTextExtents

XTextExtentslG

XTextWidth

XTextWidthlG

XTranslateCoordinates

XUndefineCursor

XUngrabButton

XUngrabKey

XUngrabKeyboard

XUngrabPointer

XUngrabServer

XUninstallColormap

XUnionRectWithRegion

XUnionRegion

XUniqueContext

XUnloadFont

XUnmapSubwindows

XUnmapWindow

XWarpPointer

XWindowEvent

XWMGeometry

XWriteBitmapFile XXorRegion

Store data in cut buffer 0.

Set or change a read/write entry of a colormap to the closest

available hardware color.

Set or change read/write colorcells to the closest available

hardware colors.

Assign a name to a window for the window manager.

Allocate a read/write colorcell by English color name.

Convert a list of strings to an XTextProperty

structure.

Convert a keysym name string to a keysym.

Create a subimage from part of an image.

Subtract one region from another.

Rush the request buffer and wait for all events and errors

to be processed by the server.

Enable or disable synchronization for debugging.

Get string and font metrics.

Get string and font metrics of a 16-bit character string.

Get the width in pixels of an 8-bit character string.

Get the width in pixels of a 16-bit character string.

Change the coordinate system from one window to

another.

Disassociate a cursor from a window.

Release a button from grab.

Release a key from grab.

Release the keyboard from grab.

Release the pointer from grab.

Release the server from grab.

Uninstall a colormap; install default if not

already installed.

Add a rectangle to a region.

Compute the union of two regions.

Create a new context ID (not graphics context).

Unload a font

Unmap all subwindows of a given window.

Unmap a window.

Move the pointer to another point on the screen.

Remove the next event matching mask and window.

Calculate window geometry given user geometry string

and default geometry.

Write a bitmap to a file.

Calculate the difference between the union and intersection

of two regions.

572

Xlib Reference Manual

B Error Messages and Protocol Requests

This appendix contains two tables: Table B-l describes the standard error codes (the error_code member of XErrorEvent) and what causes them, and Table B-2 describes the mapping between protocol requests and Xlib functions. Each reference page in this vol ume describes in more detail the errors that may occur because of that Xlib routine. Volume One, Chapter 3, Basic Window Program, describes the handling of errors in general.

A protocol request is the actual network message that is sent from Xlib to the server. Many convenience functions are provided in Xlib to make programs easier to write and more read able. When any one of several convenience routines is called it will be translated into one type of protocol request. For example, XMoveWindow and XResizeWindow are conve nience routines for the more general XConf igureWindow. Both of these Xlib routines use the protocol request Configure Window. The protocol request that causes an error, along with other information about the error is printed to the standard error output by the default error handlers. In order to find out where in your code the error occurred, you will need to know what Xlib function to look for. Use Table B-2 to find this function.

Xlib functions that do not appear in Table B-2 do not generate protocol requests. They per form their function without affecting the display and without requiring information from the server. If errors can occur in them, the errors are reported in the returned value.

Table B-1. Error Messages

Error Codes:

Possible Cause

BadAccess

BadAlloc BadAtom

Specifies that the client attempted to grab a key/button combination that is already grabbed by another client; free a colormap entry that is not allocated by the client; store into a read-only colormap entry; modify the access control list from other than the local (or otherwise authorized) host; or select an event type that only one client can select at a time, when another client has already selected it.

Specifies that the server failed to allocate the requested resource.

Specifies that a value for an Atom argument does not name a defined Atom.

Appendix B: Error Messages and Protocol Requests

Table B-1. Error Messages (continued)

Error Codes:

Possible Cause

BadColor

BadCursor

BadDrawable

BadFont

BadGC

BadlDChoice

Badlmplement-ation

BadLength BadMatch

BadName BadPixmap

BadRequest BadValue

BadWindow

Specifies that a value for a Colormap argument does not name a defined Colormap.

Specifies that a value for a Cursor argument does not name a defined Cursor.

Specifies that a value for a Drawable argument does not name a defined Window or Pixmap.

Specifies that a value for a Font or GContext argument does not name a defined Font.

Specifies that a value for a GContext argument does not name a defined GContext.

Specifies that the value chosen for a resource identifier either is not included in the range assigned to the client or is already in use.

Specifies that the server does not implement some aspect of the request A server that generates this error for a core request is defi cient. Clients should be prepared to receive such errors and either handle or discard them.

Specifies that the length of a request is shorter or longer than that required to minimally contain the arguments. This usually indicates an internal Xlib error.

Specifies that an inputOnly window is used as a Drawable.

Some argument (or pair of arguments) has the correct type and range but fails to "match" in some other way required by the request

Specifies that a font or color of the specified name does not exist.

Specifies that a value for a Pixmap argument does not name a defined Pixmap.

Specifies that the major or minor opcode does not specify a valid request

Specifies that some numeric value falls outside the range of values accepted by the request Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error.

Specifies that a value for a window argument does not name a defined window.

The BadAtom, BadColor, BadCursor, BadDrawable, BadFont, BadGC, Bad Pixmap, and BadWindow errors are also used when the argument type should be among a

574

Xlib Reference Manual

set of fixed alternatives (for example, a window ID, PointerRoot, or None) and some other constant or variable is used.

Table B-2. Xlib Functions and Protocol Requests

Protocol Request

AllocColor

AllocColorCells

AllocColorPlanes

AllocNamedColor

AllowEvents

Bell

ChangeActivePointerGrab

ChangeGC

ChangeHosts

ChangeKeyboardControl

ChangeKeyboardMapping

ChangePointerControl

ChangeProperty

Xlib Function

XAllocColor

XAllocColorCells

XAllocColorPlanes

XAllocNamedColor

XAllowEvents

XBell

XChangeActivePointerGrab

XChangeGC

XSetArcMode

XSetBackground

XSetClipMask

XSetClipOrigin

XSetFillRule

XSetFillStyle

XSetFont

XSetForeground

XSetFunction

XSetGraphicsExposures

XSetLineAttributes

XSetPlaneMask

XSetState

XSetStipple

XSetSubwindowMode

XSetTile

XSetTSOrigin

XAddHost XAddHosts XRemoveHost XRemoveHosts

XAutoRepeatOff

XAutoRepeatOn

XChangeKeyboardControl

XChangeKeyboardMapping XChangePointerControl

XChangeProperty

XSetCommand

XSetlconName

XSetlconSizes

XSetNormalHints

Appendix B: Error Messages and Protocol Requests

Table B-2. Xlib Functions and Protocol Requests (continued)

Protocol Request

Xlib Function

ChangeSaveSet

Change Window Attributes

CirculateWindow

Clear Area CloseFont Configure Window

ConvertSelection Copy Area

CopyColormapAndFree CopyGC CopyPlane

XSetWMProperties

XSetSizeHints

XSetStandardProperties

XSetWMHints

XSetZoomHints

XStoreBuffer

XStoreBytes

XStoreName

XAddToSaveSet

XChangeSaveSet

XRemoveFromSaveSet

XChangeWindowAttributes

XDefineCursor

XSelectlnput

XSetWindowBackground

XSetWindowBackgroundPixmap

XSetWindowBorder

XSetWindowBorderPixmap

XSetWindowColormap

XUndefineCursor

XCirculateSubwindows

XCirculateSubwindowsDown

XCirculateSubwindowsUp

XClearArea XClearWindow

XFreeFont XUnloadFont

XConfigureWindow

XLowerWindow

XMapRaised

XMoveResizeWindow

XMoveWindow

XRaiseWindow

XReconfigureWMWindow

XResizeWindow

XRestackWindows

XSetWindowBorderWidth

XConvertSelection

XCopyArea

XCopyColormapAndFree

XCopyGC

XCopyPlane

576

Xlib Reference Manual

Table B-2. Xlib Functions and Protocol Requests (continued)

Protocol Request

Xlib Function

CreateColormap

CreateCursor

CreateGC

CreateGlyphCursor

CreatePixmap Create Window

DeleteProperty

DestroySubwindows

DestroyWindow

FillPoly

ForceScreenSaver

FreeColormap

FreeColors

FreeCursor

FreeGC

FreePixmap

GetAtomName

GetFontPath

GetGeometry

Getlmage GetlnputFocus

GetKeyboardControl

GetKeyboardMapping

GetModifierMapping

GetMotionEvents

GetPointerControl

GetPointerMapping

XCreateColormap XCreatePixmapCursor

XCreateGC XOpenDisplay

XCreateFontCursor XCreateGlyphCursor

XCreatePixmap

XCreateSimpleWindow XCreateWindow

XDeleteProperty XDestroySubwindows XDestroyWindow XFillPolygon

XActivateScreenSaver XForceScreenSaver XResetScreenSaver

XFreeColormap

XFreeColors

XFreeCursor

XFreeGC

XFreePixmap

XGetAtomName

XGetFontPath

XGetGeometry XGetWindowAttributes

XGetImage

XGetlnputFocus XSync

XGetKeyboardControl

XGetKeyboardMapping

XGetModifierMapping

XGetMotionEvents

XGetPointerControl

XGetPonterMapping

Appendix B: Error Messages and Protocol Requests

Table B-2. Xlib Functions and Protocol Requests (continued)

Protocol Request

Xlib Function

GetProperty

GetScreenSaver

GetSelectionOwner

GetWindow Attributes

GrabButton

GrabKey

GrabKeyboard

GrabPointer

GrabServer

ImageTextS

ImageTextl6

InstallColormap

InternAtom

KillClient

ListExtensions

ListFonts

ListFontsWithlnfo

ListHosts

LisanstaUedColormaps

ListProperties

LookupColor

MapS ub windows MapWindow

NoOperation

XFetchBytes

XFetchName

XGetlconSizes

XGetIconName

XGetNormalHints

XGetSizeHints

XGetWindowProperty

XGetWMProperties

XGetWMHints

XGetZoomHints

XGetScreenSaver

XGetSelectionOwner

XGetWindowAttributes

XGrabButton

XGrabKey

XGrabKeyboard

XGrabPointer

XGrabServer

XDrawImageString

XDrawImageStringlG

XInstallColormap

XInternAtom

XKillClient

XListExtensions

XListFonts

XListFontsWithlnfo

XListHosts

XListInstalledColormaps

XListProperties

XLookupColor XParseColor

XMapSubwindows

XMapRaised XMapWindow

XNoOp

578

Xlib Reference Manual

Table B-2. Xlib Functions and Protocol Requests (continued)

Protocol Request

Xlib Function

OpenFont PolyArc PolyFillArc PolyFillRectangle

PolyLine PolyPoint

PolyRectangle Poly Segment PolyText8 PolyTextl6

Putlmage QueryBestSize

QueryColors QueryExtension

QueryFont QueryKeymap QueryPointer QueryTextExtents

Query Tree RecolorCursor ReparentWindow RotateProperties

XLoadFont XLoadQueryFont

XDrawArc XDrawArcs

XFillArc XFillArcs

XFillRectangle XFillRectangles

XDrawLines

XDrawPoint XDrawPoints

XDrawRectangle XDrawRectangles

XDrawLine XDrawSegments

XDrawString XDrawText

XDrawStringl6 XDrawText16

XPutImage

XQueryBestCursor XQueryBestSize XQueryBestStipple XQueryBestTile

XQueryColor XQueryColors

XInitExtension XQueryExtension

XLoadQueryFont XQueryKeymap XQueryPointer

XQueryTextExtents XQueryTextExtentsl6

XQueryTree XRecolorCursor XReparentWindow XRotateBuffers

Appendix B: Error Messages and Protocol Requests

Table B-2. Xlib Functions and Protocol Requests (continued)

Protocol Request

Xlib Function

SendEvent SetAccessControl

SetClipRectangles

SetCloseDownMode

SetDashes

SetFontPath

SetlnputFocus

SetModifierMapping

SetPointerMapping

SetScreenSaver

SetSelectionOwner

StoreColors

StoreNamedColor

TranslateCoords

UngrabButton

UngrabKey

UngrabKeyboard

UngrabPointer

UngrabServer

UninstallColormap

UnmapS ubwindows

UnmapWindow

WarpPointer

XRotateWindowProperties XSendEvent

XDisableAccessControl

XEnableAccessControl

XSetAccessControl

XSetClipRectangles

XSetCloseDownMode

XSetDashes

XSetFontPath

XSetlnputFocus

XSetModifierMapping

XSetPointerMapping

XSetScreenSaver

XSetSelectionOwner

XStoreColor XStoreColors

XStoreNamedColor

XTranslateCoordinates

XUngrabButton

XUngrabKey

XUngrabKeyboard

XUngrabPointer

XUngrabServer

XUninstallColormap

XUnmapSubWindows

XUnmapWindow

XWarpPointer

580

Xlib Reference Manual

c

Macros

Once you have successfully connected your application to an X server, you can obtain data from the Display structure associated with that display. The Xlib interface provides a number of useful C language macros and corresponding functions for other language bind ings which return data from the Display structure.

The function versions of these macros have the same names as the macros except that the function forms begin with the letter "X." They use the same arguments. Using the macro versions is slightly more efficient in C because it eliminates function call overhead.

In R3 and R4, a few new functions were added that access members of the Display struc ture. These are XDisplayMotionBufferSize, XResourceManagerString, XDisplayKeycodes, and XMaxRequestSize in R3 and XScreenNumber-OfScreen, XListDepths, and XListPixmapFormats in R4. Also, XVisual-iDFromVisual was added in R3 to extract the resource ID from a visual structure. XDisplayMotionBufferSize, XResourceManagerString, XMaxRequest Size, XScreenNumberOf Screen, and XVisuallDFromVisual are simple enough to have macro versions, but these were not provided. Nevertheless, we have chosen to cover them in this macro appendix instead of devoting a reference page to each. XDisplay Keycodes, XListDepths, and XListPixmapFormats are more complicated and therefore have their own reference pages; they are not covered here.

For the purposes of this appendix, the macros are divided into four categories: Display mac ros, Image Format macros, Keysym Classification macros, and Resource Manager macros. The macros are listed alphabetically within each category.

Note that some macros take as arguments an integer screen (scr_num) while others take a pointer to a Screen structure (scr_ptr). scr_num is returned by the Default-Screen macro and scr_ptr is returned by the Default ScreenOf Display macro.

C.1 Display Macros

AllPlanes

BlackPixel(display, scr_num)

BlackPixelOfScreen(scr_ptr)

CellsOfScreen(scr_ptr)

Connect ionNumber(disp_Z ay)

Return a value with all bits set suitable for use as a plane mask argument

Return the black pixel value in the default color-map that is created by XOpenDisplay.

Return the black pixel value in the default color-map of the specified screen.

Return the number of colormap cells in the default colormap of the specified screen.

Return a connection number for the specified display. On a UNIX system, this is the file descriptor of the connection.

DefaultColormap(dispJay,scr_/ium) Return the default colormap for the specified

screen. Most routine allocations of color should be made out of this colormap.

DefauitCoiormapOfScreen(scr_ptr) Return the default colormap of the specified

screen.

DefaultDepth(dJsplay,scr_/iu/n)

DefaultDepthOfScreen(scr_ptr) DefaultGC(dispJay,scr_/5u/n)

DefaultGCOfScreen(scr ptr) DefaultRootWindow(dispIay)

DefaultScreen(dispJay)

Return the depth (number of planes) of the root window for the specified screen. Other depths may also be supported on this screen. See Vol ume One, Chapter 7, Color, or the reference pages for XMatchVisuallnfo and XGet-visuallnfo to find out how to determine what depths are available.

Return the default depth of the specified screen.

Return the default graphics context for the speci fied screen.

Return the default graphics context (GC) of the specified screen.

Return the ID of the root window on the default screen. Most applications should use Root-window instead so that screen selection is sup ported.

Return the integer that was specified in the last segment of the string passed to XOpen Display or from the DISPLAY environment variable if NULL was used. For example, if the DISPLAY environment were Ogre: 0 .1, then Def aultScreen would return 1.

582

Xlib Reference Manual

DefaultScreenOfDisplay(display) Return the default screen of the specified dis play.

DefaultVisual(display,scr_/7um)

DefaultVisualOfScreen(scr_ptr) DisplayCells (display, scr_num)

DisplayHeight(display,scr_r3um)

DisplayHeightMM(display,scr_/iu/n)

DisplayOfScreen(scr_ptr)

Display? lanes (displ ay, scr_n urn)

DisplayString(display)

DisplayWidth(d-isp_Zay,scr nu/n)

DisplayWidthMM(dispIay,scr num)

DoesBackingStore(scr_ptr)

DoesSaveUnders(scr_ptr)

Return a pointer to the default visual structure for the specified screen.

Return the default visual of the specified screen.

Return the maximum possible number of color-map cells on the specified screen. This macro is misnamed: it should have been Screen-Cells.

Return the height in pixels of the screen. This macro is misnamed: it should have been ScreenHeight.

Return the height in millimeters of the specified screen. This macro is misnamed: it should have been ScreenHeightMM.

Return the display associated with the specified screen.

Return the number of planes on the specified screen. This macro is misnamed: it should have been ScreenPlanes.

Return the string that was passed to XOpen-Display when the current display was opened (or, if that was NULL, the value of the DISPLAY environment variable). This macro is useful in applications which invoke the fork system call and want to open a new connection to the same display from the child process.

Return the width in pixels of the screen. This macro is misnamed: it should have been ScreenWidth.

Return the width in millimeters of the specified screen. This macro is misnamed: it should have been ScreenWidthMM.

Return a value indicating whether the screen supports backing stores. Values are When-Mapped, NotUsef ul, or Always. See Vol ume One, Section 4.3.5 for a discussion of the backing store.

Return a Boolean value indicating whether the screen supports save unders. If True, the screen supports save unders. If False, the screen does not support save unders. See

Appendix C: Macros

dpyno( display)

EventMaskOfScreen(scr_ptr) HeightOfScreen(scr_ptr) HeightMMOfScreen(scr_ptr) Keyboard(display)

LastKnownRequestProcessed (display)

MaxCmapsOfScreen(scr_ptr) MinCmapsOfScreen(scr ptr) NextRequest(display)

PlanesOfScreen(scr_ptr) ProtocolRevision(display) ProtocolVersion(display)

QLength(display) RootWindow(display,scr num)

Volume One, Section 4.3.6 for a discussion of the save under.

Return the file descriptor of the connected dis play. On a UNIX system, you can then pass this returned file descriptor to the select(3) system call when your application program is driving more than one display at a time.

Return the initial event mask for the root win dow of the specified screen.

Return the height in pixels of the specified screen.

Return the height in millimeters of the specified screen.

Return the device ID for the main keyboard con nected to the display.

Return the serial ID of the last known protocol request to have been issued. This can be useful in processing errors, since the serial number of failing requests are provided in the XError-Event structure.

Return the maximum number of installed (hard ware) colormaps supported by the specified screen.

Return the minimum number of installed (hard ware) colormaps supported by the specified screen.

Return the serial ID of the next protocol request to be issued. This can be useful in processing errors, since the serial number of failing requests are provided in the XErrorEvent structure.

Return the number of planes in the specified screen.

Return the minor protocol revision number of the X server.

Return the version number of the X protocol associated with the connected display. This is currently 11.

Return the number of events that can be queued by the specified display.

Return the ID of the root window. This macro is necessary for routines that reference the root

584

Xlib Reference Manual

RootWindowOfScreen(scr_ptr) ScreenCount( display) ScreenOf Display (disp_Zay,scr_/iim?) ServerVendor( display)

VendorRelease (display) WhitePixel(display,scr_/]U/n) WhitePixelOfScreen(scr_ptr)

WidthOfScreen(scr_ptr) WidthMMOfScreen(scr_ptr)

XDisplayMotionBufferSize(display)

XMaxRequestSize(dispIay)

XScreenNumberOfScreen(scr_ptr) XVisualIDFromVisual(visual)

window or create a top-level window for an application.

Return the ID of the root window of the speci fied screen.

Return the number of available screens on a specified display.

Return the specified screen of the specified dis play.

Return a pointer to a null terminated string giv ing some identification of the owner of the X server implementation.

Return a number related to the release of the X server by the vendor.

Return the white pixel value in the default color-map that is created by XOpenDisplay.

Return the white pixel value in the default color-map of the specified screen.

Return the width of the specified screen.

Return the width of the specified screen in milli meters.

Return an unsigned long value containing the size of the motion buffer on the server. If this function returns zero, the server has no motion history buffer.

Return a long value containing the maximum size of a protocol request for the specified server, in units of four bytes.

Return the integer screen number corresponding to the specified pointer to a Screen structure.

Returns the ID of the server resource associated with a visual structure. This is useful when stor ing standard colormap properties.

Appendix C: Macros

C.2 Image Format Macros

BitmapBitOrder(display) Within each BitmapUnit, the leftmost bit in the bit map as displayed on the screen is either the least or the most significant bit in the unit. Returns LSBFirst or MSBFirst.

BitmapPad(display) Each scan line must be padded to a multiple of bits speci

fied by the value returned by this macro.

BitmapUnit (display) Returns the size of a bitmap's unit. The scan line is quan

tized (calculated) in multiples of this value.

imageByteOrder(dispiay) Returns the byte order for images required by the server

for each scan line unit in XY format (bitmap) or for each pixel value in Z format. Values are LSBFirst or MSBFirst.

C.3 Keysym Classification Macros

You may want to test if a keysym of the defined set (XK_MISCELLANY) is, for example, on the key pad or the function keys. You can use the keysym macros to perform the following tests:

I sCursorKey (keysym) Return True if the keysym represents a cursor key.

isFunctionKeyUeysym) Return True if the keysym represents a function key.

isKeypadKeyUeysym) Return True if the keysym represents a key pad.

IsMiscFunctionKey(keysym) Return True if the keysym represents a miscellaneous

function key.

isModif ierKey (keysym) Return True if the keysym represents a modifier key.

i sPFKey (keysym) Return True if the keysym represents a PF key.

C.4 Resource Manager Macros

These macros convert from strings to quarks and quarks to strings. They are used by the resource manager. Note that they do not follow the normal naming conventions for macros, since they begin with an X.

XrmStringToName(stri/ig) Convert String to XrmName. Same as XString-

ToQuark.

XrmStringToClass(string) Convert String to XrmClass. Same as XString-

ToQuark.

XrmStringToRepresentation Convert String to XrmRepresentation. Same as

(string) XrmNameToString(/ja/ne)

XrmClassToString(class)

XStringToQuark.

Convert XrmName to string. Same as XrmQuark-ToString.

Convert XrmClass to string. Same as XrmQuark-ToString.

XrmRepresentationToString Convert XrmRepresentation to String. Same as (type) XrmQuarkToString.

XResourceManagerString( display)

Return a pointer to the resource database string stored in the Display structure. This string is read from the RESOURCE_MANAGER property on the root window; this property is normally set by the xrdb client.

Appendix C: Macros

D

The Color Database

The color database translates color name strings into RGB values. It is used by XParse-Color, XLookupColor, and xstoreNamedColor. These routines make it easier to allow the user to specify color names. Use of these names for routine color allocation of read-only colorcells is encouraged since this increases the chance of sharing colorcells and thereby makes the colormap go further before running out of colorcells. The location in the file system of the text version of the color database is an implementation detail, but by default on a UNIX system it is lusrlliblXlllrgb.txt.

It should be noted that while a sample color database is provided with the standard XI1 dis tribution, it is not specified as an X Consortium standard and is not part of the X Protocol or Xlib. Therefore, it is permissible for server vendors to change the color names, although they will probably only add color names. Furthermore, hardware vendors can change the RGB values for each display hardware to achieve the proper "gamma correction" so that the colors described by the name really generate that color.

The RGB values in the R3 database were originally tuned for the DEC VT240 display. The color that appears on a Sun system given these RGB values for "pink," for example, looks more like light burgundy. In R4 a new RGB color database is provided, which provides many more color names and provides values that generate colors that match their names on more monitors.

Each color name in the database may be used in the form shown or in mixed case, with initial capitals and all spaces eliminated. Table D-l (see next page) shows the R3 database, and Table D-2 shows the R4 database.

Table D-1. The R3 Color Database'

*Also defined are the color names "grayO" through "graylOO", spelled with an V or an "a". "grayO" is black and "gray 100" is white.

530

Xlib Reference Manual

Table D-2. The R4 Color Database

Appendix D: Colors

Table D-2. The R4 Color Database (continued)

Xlib Reference Manual

Table D-2. The R4 Color Database (continued)

Appendix D: Colors

Table D-2. The R4 Color Database (continued)

Xlib Reference Manual

Table D-2. The R4 Color Database (continued)

Appendix D: Colors

Table D-2. The R4 Color Database (continued)

596

Xlib Reference Manual

Table D-2. The R4 Color Database (continued)

Appendix D: Colors

'' VIV 100»,speUedwith«d«c"or« V. "gmyO" « black and

595

Xlib Reference Manual

Event Reference

This appendix describes each event structure in detail and briefly shows how each event type is used. It covers the most common uses of each event type, the information contained in each event structure, how the event is selected, and the side effects of the event, if any. Each event is described on a separate reference page.

Table E-l lists each event mask, its associated event types, and the associated structure defi nition. See Chapter 8, Events, of Volume One, Xlib Programming Manual, for more informa tion on events.

Table E-1. Event Masks, Event Types, and Event Structures

Appendix E: Event Reference

Table E-1. Event Masks, Event Types, and Event Structures (continued)

600

Xlib Reference Manual

E.1 Meaning of Common Structure Elements

Example E-l shows the XEvent union and a simple event structure that is one member of the union. Several of the members of this structure are present in nearly every event struc ture. They are described here before we go into the event-specific members (see also Sec tion 8.2.2 of Volume One, Xlib Programming Manual).

Example E-1. XEvent union and XAnyEvent structure

typedef union _XEvent {

int type;

XAnyEvent xany;

XButtonEvent xbutton;

XCirculateEvent xcirculate;

XCirculateRequestEvent xcirculaterequest;

XClientMessageEvent xclient;

XColormapEvent xcolormap;

XConfigureEvent xconfigure;

XConfigureRequestEvent xconfigurerequest;

XCreateWindowEvent xcreatewindow;

XDestroyWindowEvent xdestroywindow;

XCrossingEvent xcrossing;

XExposeEvent xexpose;

XFocusChangeEvent xfocus;

XNoExposeEvent xnoexpose;

XGraphicsExposeEvent xgraphicsexpose;

XGravityEvent xgravity;

XKeymapEvent xkeymap;

XKeyEvent xkey;

XMapEvent xmap;

XUnmapEvent xunmap;

XMappingEvent xmapping;

XMapRequestEvent xmaprequest;

XMotionEvent xmotion;

XPropertyEvent xproperty;

XReparentEvent xreparent;

XResizeRequestEvent xresizerequest;

XSelectionClearEvent xselectionclear;

XSelectionEvent xselection;

XSelectionRequestEvent xselectionrequest;

XVisibilityEvent xvisibility; } XEvent;

typedef struct { int type;

unsigned long serial; Bool send_event;

Display *display; Window window;

} XAnyEvent ;

/* Must not be changed; first member */

/* # of last request processed by server */

/* True if this came from SendEvent

* request */

/* Display the event was read from */

/* window on which event was requested

* in event mask */

Appendix E: Event Reference

The first member of the XEvent union is the type of event When an event is received (with XNextEvent, for example), the application checks the type member in the XEvent union. Then the specific event type is known and the specific event structure (such as xbutton) is used to access information specific to that event type.

Before the branching depending on the event type, only the XEvent union is used. After the branching, only the event structure which contains the specific information for each event type should be used in each branch. For example, if the XEvent union were called report, the report .xexpose structure should be used within the branch for Expose events.

You will notice that each event structure also begins with a type member. This member is rarely used, since it is an identical copy of the type member in the XEvent union.

Most event structures also have a window member. The only ones that do not are selection events (SelectionClear, SelectionNotify, and SelectionRequest) and events selected by the graphics_exposures member of the GC (GraphicsExpose and NoExpose). The window member indicates the event window that selected and received the event This is the window where the event arrives if it has propagated through the hierarchy as described in Section 8.3.2, of Volume One, Xlib Programming Manual. One event type may have two different meanings to an application, depending on which window it appears in.

Many of the event structures also have a display and/or root member. The display member identifies the connection to the server that is active. The root member indicates which screen the window that received the event is linked to in the hierarchy. Most programs only use a single screen and therefore do not need to worry about the root member. The display member can be useful, since you can pass the display variable into routines by simply passing a pointer to the event structure, eliminating the need for a separate display argument

All event structures include a serial member that gives the nur " er of the last protocol request processed by the server. This is useful in debugging, since an error can be detected by the server but not reported to the user (or programmer) until the next routine that gets an event That means several routines may execute successfully after the error occurs. The last request processed will often indicate the request that contained the error.

All event structures also include a send_event flag, which, if True, indicates that the event was sent by XSendEvent (i.e., by another client rather than by the server).

The following pages describe each event type in detail. The events are presented in alphabet ical order, each on a separate page. Each page describes the circumstances under which the event is generated, the mask used to select it, the structure itself, its members, and useful pro gramming notes. Note that the description of the structure members does not include those members common to many structures. If you need more information on these members, please refer to this introductory section.

—xbutton-

ButtonPress, ButtonRelease

When Generated

There are two types of pointer button events: ButtonPress and ButtonRelease. Both contain the same information.

Select With

May be selected separately, using ButtonPressMask and ButtonReleaseMask.

XEvent Structure Name

typedef union _XEvent {

XButtonEvent xbutton; } XEvent;

Event Structure

typedef struct { int type;

unsigned long serial; Bool send_event; Display ^display; Window window; Window root; Window subwindow; Time time; int x, y;

int x_root, y_root; unsigned int state; unsigned int button; Bool same_screen; } XButtonEvent; typedef XButtonEvent typedef XButtonEvent

/* of event */

/* # of last request processed by server */

/* True if this came from a SendEvent request *

/* Display the event was read from */

/* event window it is reported relative to */

/* root window that the event occurred under */

/* child window */

/* when event occurred, in milliseconds */

/* pointer coordinates relative to receiving

* window */

/* coordinates relative to root */

/* mask of all buttons and modifier keys */

/* button that triggered event */

/* same screen flag */

XButtonPressedEvent; XButtonReleasedEvent;

Event Structure Members

subwindow If the source window is the child of the receiving window, then the

subwindow member is set to the ID of that child.

time

The server time when the button event occurred, in milliseconds. Time is declared as unsigned long, so it wraps around when it reaches the maximum value of a 32-bit number (every 49.7 days).

If the receiving window is on the same screen as the root window speci fied by root, then x and y are the pointer coordinates relative to the receiving window's origin. Otherwise, x and y are zero.

Xlib Reference Manual

Button Press, Button Release

(continued)

xbutton

When active button grabs and pointer grabs are in effect (see Section 9.4 of Volume One, Xlib Programming Manual), the coordinates relative to the receiving window may not be within the window (they may be nega tive or greater than window height or width).

x root, y_root The pointer coordinates relative to the root window which is an ancestor of the event window. If the pointer was on a different screen, these are zero.

state The state of all the buttons and modifier keys just before the event,

represented by a mask of the button and modifier key symbols:

ButtonlMask, Button2Mask, ButtonSMask, Button4Mask, ButtonSMask, ControlMask, LockMask, ModlMask, Mod2-Mask, ModSMask, Mod4Mask, ModSMask, and ShiftMask. If a modifier key is pressed and released when no other modifier keys are held, the ButtonPress will have a state member of 0 and the ButtonRelease will have a nonzero state member indicating that itself was held just before the event

button A value indicating which button changed state to trigger this event One

of the constants: Buttonl, Button2, Buttons, Button4, or Buttons.

same_screen Indicates whether the pointer is currently on the same screen as this win dow. This is always True unless the pointer was actively grabbed before the automatic grab could take place.

Notes

Unless an active grab already exists or a passive grab on the button combination that was pressed already exists at a higher level in the hierarchy than where the ButtonPress occurred, an automatic active grab of the pointer takes place when a ButtonPress occurs. Because of the automatic grab, the matching ButtonRelease is sent to the same application that received the ButtonPress event If OwnerGrabButtonMask has been selected, the ButtonRelease event is delivered to the window which contained the pointer when the button was released, as long as that window belongs to the same client as the window in which the ButtonPress event occurred. If the ButtonRelease occurs outside of the client's windows or OwnerGrabButtonMask was not selected, the ButtonRelease is delivered to the window in which the ButtonPress occurred. The grab is terminated when all buttons are released. During the grab, the cursor associated with the grabbing window will track the pointer anywhere on the screen.

If the application has invoked a passive button grab on an ancestor of the window in which the ButtonPress event occurs, then that grab takes precedence over the automatic grab, and the ButtonRelease will go to that window, or it will be handled normally by that client depend ing on the owner_events flag in the XGrabButton call.

604

Xlib Reference Manual

—xcirculate-

CirculateNotify

When Generated

A CirculateNotify event reports a call to change the stacking order, and it includes whether the final position is on the top or on the bottom. This event is generated by

XCirculateSubwindows, XCirculateSubwindowsDown, or XCirculate-SubwindowsUp. See also the CirculateRequest and ConfigureNotify reference pages.

Select With

This event is selected with StructureNotifyMask in the XSelectlnput call for the window to be moved or with SubstructureNotif yMask for the parent of the window to be moved.

XEvent Structure Name

typedef union _XEvent { . . .

XCirculateEvent xcirculate;

} XEvent;

Event Structure

typedef struct {

int type;

unsigned long serial,

Bool send_event;

Display *display;

Window event;

Window window;

int place; } XCirculateEvent;

/* # of last request processed by server */ /* True if this came from SendEvent request /* Display the event was read from */

/* PlaceOnTop, PlaceOnBottom */

*/

Event Structure Members

event The window receiving the event If the event was selected by Structure

NotifyMask, event will be the same as window. If the event was selected by SubstructureNotif yMask, event will be the parent of window.

window The window that was restacked.

place Either PlaceOnTop or PlaceOnBottom. Indicates whether the window was

raised to the top or bottom of the stack.

Xlib Reference Manual

CirculateRequest \

xcirculaterequest—

When Generated

A CirculateRequest event reports when XCirculateSubwindows, XCirculate-SubwindowsDown, XCirculateSubwindowsUp, or XRestackWindows is called to change the stacking order of a group of children.

This event differs from CirculateNotif y in that it delivers the parameters of the request before it is carried out This gives the client that selects this event (usually the window man ager) the opportunity to review the request in the light of its window management policy before executing the circulate request itself or to deny the request (CirculateNotify indicates the final outcome of the request)

Select With

This event is selected for the parent window with SubstructureRedirectMask.

XEvent Structure Name

typedef union _XEvent {

XCirculateRequestEvent xcirculaterequest; } XEvent;

Event Structure

typedef struct {

int type;

unsigned long serial; /* # of last request processed by server */

Bool send_event; /* True if this came from SendEvent request */

Display ^display; /* Display the event was read from */

Window parent;

Window window;

int place; /* PlaceOnTop, PlaceOnBottom */

} XCirculateRequestEvent;

Event Structure Members

parent The parent of the window that was restacked. This is the window that selected the event

window The window being restacked.

place PlaceOnTop or PlaceOnBottom. Indicates whether the window was to be

placed on the top or on the bottom of the stacking order.

Xlib Reference Manual

— xclient-

J ClientMessage

When Generated

A ClientMessage event is sent as a result of a call to XSendEvent by a client to a particu lar window. Any type of event can be sent with XSendEvent, but it will be distinguished from normal events by the send_event member being set to True. If your program wants to be able to treat events sent with XSendEvent as different from normal events, you can read this member.

Select With

There is no event mask for ClientMessage events, and they are not selected with XSelect Input. Instead XSendEvent directs them to a specific window, which is given as a window ID: the PointerWindow or the inputFocus.

XEvent Structure Name

typedef union _XEvent {

XClientMessageEvent xclient; } XEvent;

Event Structure

typedef struct { int type;

unsigned long serial; /* # of last request processed by server */ Bool send_event; /* True if this came from 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 1[5]; } data; } XClientMessageEvent;

Event Structure Members

message_type An atom that specifies how the data is to be interpreted by the receiving client. The X server places no interpretation on the type or the data, but it must be a list of 8-bit, 16-bit, or 32-bit quantities, so that the X server can correctly swap bytes as necessary. The data always consists of twenty 8-bit values, ten 16-bit values, or five 32-bit values, although each particular message might not make use of all of these values.

format Specifies the format of the property specified by message_type. This

will be on of the values 8,16, or 32.

ColormapNotify

X

•xcolormap—

When Generated

A ColormapNotify event reports when the colormap attribute of a window changes or when the colormap specified by the attribute is installed, uninstalled, or freed. This event is generated by XChangeWindowAttributes, XFreeColormap, XInstallColormap, and XUninstallColormap.

Select With

This event is selected with ColormapChangeMask.

XEvent Structure Name

typedef union _XEvent {

XColormapEvent xcolormap; } XEvent;

Event Structure

typedef struct {

int type;

unsigned long serial,

Bool send_event;

Display ^display;

Window window;

Colormap colormap;

Bool new;

int state; } XColormapEvent;

# of last request processed by server */ True if this came from SendEvent request */ Display the event was read from */

a colormap or None */

Colormaplnstalled, ColormapUninstalled */

Event Structure Members

window The window whose associated colormap or attribute changes.

colormap The colormap associated with the window, either a colormap ID or the constant None. It will be None only if this event was generated due to an XFree Colormap call.

new True when the colormap attribute has been changed, or False when the color-

map is installed or uninstalled.

state Either Colormaplnstalled or ColormapUninstalled; it indicates

whether the colormap is installed or uninstalled.

Xlib Reference Manual

—xconfigure-

ConfigureNotify

When Generated

A ConfigureNotify event announces actual changes to a window's configuration (size, position, border, and stacking order). See also the CirculateRequest reference page.

Select With

This event is selected for a single window by specifying the window ID of that window with StructureNotifyMask. To receive this event for all children of a window, specify the parent window ID with SubstructureNotif yMask.

XEvent Structure Name

typedef union _XEvent {

XConfigureEvent xconfigure; } XEvent;

Event Structure

typedef struct {

int type;

unsigned long serial

Bool send_event;

Display *display;

Window event;

Window window;

int x, y;

int width, height;

int border_width;

Window above;

Bool override_redirect; } XConfigureEvent;

/* # of last request processed by server */ /* True if this came from SendEvent request /* Display the event was read from */

Event Structure Members

event

window

width, height border_width above

The window that selected the event The event and window members are identical if the event was selected with Structure-Not if yMask.

The window whose configuration was changed.

The final coordinates of the reconfigured window relative to its par ent.

The width and height in pixels of the window after reconfiguration. The width in pixels of the border after reconfiguration.

If this member is None, then the window is on the bottom of the stack with respect to its siblings. Otherwise, the window is immedi ately on top of the specified sibling window.

Xlib Reference Manual

ConfigureNotify (continued) xconflgure

override_redirect The override_redirect attribute of the reconfigured window. If True, it indicates that the client wants this window to be immune to interception by the window manager of configuration requests. Window managers normally should ignore this event if

override redirect is True.

—xconf igurerequest-

ConfigureRequest

When Generated

A ConfigureRequest event reports when another client attempts to change a window's size, position, border, and/or stacking order.

This event differs from Conf igureNotif y in that it delivers the parameters of the request before it is carried out This gives the client that selects this event (usually the window man ager) the opportunity to revise the requested configuration before executing the XConf igureWindow request itself or to deny the request (Conf igureNotif y indicates the final outcome of the request)

Select With

This event is selected for any window in a group of children by specifying the parent window with SubstructureRedirectMask.

XEvent Structure Name

typedef union _XEvent {

XConfigureRequestEvent xconfigurerequest; } XEvent;

Event Structure

typedef struct {

int type;

unsigned long serial

Bool send_event;

Display *display;

Window parent;

Window window;

int x, y;

int width, height;

int border_width;

Window above;

int detail;

unsigned long value_mask } XConfigureRequestEvent;

# of last request processed by server */ True if this came from SendEvent request Display the event was read from */

*/

/* Above, Below, Bottomlf, Toplf, Opposite */

Event Structure Members

parent The window that selected the event This is the parent of the window

being configured.

window The window that is being configured.

x, y The requested position for the upper-left pixel of the window's border

relative to the origin of the parent window.

width, height The requested width and height in pixels for the window.

Xlib Reference Manual

ConfigureRequest

(continued)

xconfigurerequest

border_width The requested border width for the window.

above None, Above, Below, Toplf, Bottomlf, or Opposite. Specifies

the sibling window on top of which the specified window should be placed. If this member has the constant None, then the specified win dow should be placed on the bottom.

Notes

The geometry is derived from the XConf igurewindow request that triggered the event.

612

Xlib Reference Manual

—xcreatewindow-

CreateNotify

When Generated

A CreateNotify event reports when a window is created.

Select With

This event is selected on children of a window by specifying the parent window ID with SubstructureNotifyMask. (Note that this event type cannot be selected by

StructureNotifyMask.)

XEvent Structure Name

typedef union _XEvent {

XCreateWindowEvent xcreatewindow; } XEvent;

Event Structure

typedef struct { int type;

unsigned long serial; /' Bool send_event; /'

i

Display ^display; /' Window parent;

Window window; /'

int x, y; /'

int width, height; /'

int border_width; /' Bool override_redirect; /' } XCreateWindowEvent;

# of last request processed by server */ True if this came from SendEvent request */

Display the event was read from */ /* parent of the window */

window ID of window created */

window location */

size of window */

border width */

creation should be overridden */

Event Structure Members

parent window x,y

width,height border_width override redirect

The ID of the created window's parent

The ID of the created window.

The coordinates of the created window relative to its parent

The width and height in pixels of the created window.

The width in pixels of the border of the created window.

The override_redirect attribute of the created window. If True, it indicates that the client wants this window to be immune to interception by the window manager of configuration requests, managers normally should ignore this event if

Window

override

redirect is True.

Xlib Reference Manual

CreateNotify (continued) xcreatewlndow

Notes

For descriptions of these members, see the XCreateWindow function and the XSet-WindowAttributes structure.

—xdestroywindow •

DestroyNotify

When Generated

A DestroyNotify event reports that a window has been destroyed.

Select With

To receive this event type on children of a window, specify the parent window ID and pass SubstructureNotifyMask as part of the event_mask argument to XSelectInput. This event type cannot be selected with StructureNotif yMask.

XEvent Structure Name

typedef union _XEvent {

XDestroyWindowEvent xdestroywindow; } XEvent;

Event Structure

typedef struct {

int type;

unsigned long serial,

Bool send_event;

Display ^display;

Window event;

Window window; } XDestroyWindowEvent;

/* # of last request processed by server */ /* True if this came from SendEvent request */ /* Display the event was read from */

Event Structure Members

event The window that selected the event

window The window that was destroyed.

Xlib Reference Manual

EnterNotify, LeaveNotify \

When Generated

EnterNotify and LeaveNotify events occur when the pointer enters or leaves a window.

When the pointer crosses a window border, a LeaveNotify event occurs in the window being left and an EnterNotify event occurs in the window being entered. Whether or not each event is queued for any application depends on whether any application selected the right event on the window in which it occurred.

In addition, EnterNotify and LeaveNotify events are delivered to windows that are virtually crossed. These are windows that are between the origin and destination windows in the hierarchy but not necessarily on the screen. Further explanation of virtual crossing is pro vided two pages following.

Select With

Each of these events can be selected separately with XEnterWindowMask and XLeave-WindowMask.

XEvent Structure Name

typedef union _XEvent {

XCrossingEvent xcrossing; } XEvent;

Event Structure

typedef struct {

int type; /* of event */

unsigned long serial; /* # of last request processed by server */

Bool send_event; /* True if this came from 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 receiving

* window */

int x_root, y_root; /* coordinates relative to root */

int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */

int detail; /* NotifyAncestor, Notifylnferior,

* NotifyNonLinear, NotifyNonLinearVirtual,

* NotifyVirtual */

Bool same_screen; /* same screen flag */ Bool focus; /* boolean focus */

unsigned int state; /* key or button mask */

} XCrossingEvent;

typedef XCrossingEvent XEnterWindowEvent;

typedef XCrossingEvent XLeaveWindowEvent;

xcrossing

(continued)

EnterNotify, LeaveNotify

Event Structure Members

The following list describes the members of the XGrossingEvent structure.

subwindow In a LeaveNotify event, if the pointer began in a child of the receiv

ing window, then the child member is set to the window ID of the child. Otherwise, it is set to None. For an EnterNotify event, if the pointer ends up in a child of the receiving window, then the child member is set to the window ID of the child. Otherwise, it is set to None.

time

The server time when the crossing event occurred, in milliseconds. Time is declared as unsigned long, so it wraps around when it reaches the maximum value of a 32-bit number (every 49.7 days).

x, y The point of entry or exit of the pointer relative to the event window.

x_root, y_root The point of entry or exit of the pointer relative to the root window.

mode Normal crossing events or those caused by pointer warps have mode

NotifyNormal, events caused by a grab have mode NotifyGrab, and events caused by a released grab have mode Not if yUngrab.

detail The value of the detail member depends on the hierarchical relation

ship between the origin and destination windows and the direction of pointer transfer. Determining which windows receive events and with which detail members is quite complicated. This topic is described in the next section.

same_screen Indicates whether the pointer is currently on the same screen as this win dow. This is always True unless the pointer was actively grabbed before the automatic grab could take place.

focus If the receiving window is the focus window or a descendant of the focus

window, the focus member is True; otherwise, it is False.

state The state of all the buttons and modifier keys just before the event,

represented by a mask of the button and modifier key symbols:

ButtonlMask, Button2Mask, ButtonSMask, Button4Mask, ButtonSMask, ControlMask, LockMask, ModlMask, Mod2-Mask, ModSMask, Mod4Mask, ModSMask, and Shif tMask.

Virtual Crossing and the detail Member

Virtual crossing occurs when the pointer moves between two windows that do not have a parent-child relationship. Windows between the origin and destination windows in the hierar chy receive EnterNotify and LeaveNotify events. The detail member of each of these events depends on the hierarchical relationship of the origin and destination windows and the direction of pointer transfer.

Xlib Reference Manual

EnterNotify, LeaveNotify (continued) xcrossing

Virtual crossing is an advanced topic that you should not spend time figuring out unless you have an important reason to use it We have never seen an application that uses this feature, and we know of no reason for its extreme complexity. With that word of warning, proceed.

Let's say the pointer has moved from one window, the origin, to another, the destination. First, we'll specify what types of events each window gets and then the detail member of each of those events.

The window of origin receives a LeaveNotify event and the destination window receives an EnterNotify event, if they have requested this type of event If one is an inferior of the other, the detail member of the event received by the inferior is Notif yAncestor and the detail of the event received by the superior is Notif yinferior. If the crossing is between parent and child, these are the only events generated.

However, if the origin and destination windows are not parent and child, other windows are virtually crossed and also receive events. If neither window is an ancestor of the other, ancestors of each window, up to but not including the least common ancestor, receive Leave-Notify events, if they are in the same branch of the hierarchy as the origin, and Enter-Notify events, if they are in the same branch as the destination. These events can be used to track the motion of the pointer through the hierarchy.

• In the case of a crossing between a parent and a child of a child, the middle child receives a

LeaveNotify with detail NotifyVirtual.

• In the case of a crossing between a child and the parent of its parent, the middle child receives an EnterNotify with detail Notif yVirtual.

• In a crossing between windows whose least common ancestor is two or more windows away, both the origin and destination windows receive events with detail Not if y-Nonlinear. The windows between the origin and the destination in the hierarchy, up to but not including their least common ancestor, receive events with detail Not if y-NonlinearVirtual. The least common ancestor is the lowest window from which both are descendants.

• If the origin and destination windows are on separate screens, the events and details gen erated are the same as for two windows not parent and child, except that the root windows of the two screens are considered the least common ancestor. Both root windows also receive events.

xcrossing

(continued)

EnterNotify, LeaveNotify

Table E-l shows the event types generated by a pointer crossing from window A to window B when window C is the least common ancestor of A and B.

Table E-1. Border Crossing Events and Window Relationship

LeaveNotify

Origin window (A)

Windows between A and B, exclusive, if A is inferior

Windows between A and C, exclusive

Root window on screen of origin if different from screen of destination

EnterNotify

Destination window (5)

Windows between A and B, exclusive, if B is inferior

Windows between B and C, exclusive,

Root window on screen of destination if different from screen of origin

Table E-2 lists the detail members in events generated by a pointer crossing from window A to window B.

Table E-2. Event detail Member and Window Relationship de t a i 1 Rag Window Delivered To

NotifyAncestor NotifyInferior NotifyVirtual

NotifyNonlinear NotifyNonlinearVirtual

Origin or destination when either is descendant Origin or destination when either is ancestor

Windows between A and B, exclusive, if either is descendant

Origin and destination when A and B are two or more windows distant from least common ancestor C

Windows between A and C, exclusive, and between B and C, exclusive, when A and B have least common ancestor C; also on both root windows if A and B are on different screens

Xlib Reference Manual

EnterNotify, LeaveNotify

(continued)

xcrossing

For example, Figure E-l shows the events that are generated by a movement from a window (window A) to a child (window Bl) of a sibling (window B). This would generate three events: a LeaveNotify with detail Notif yNonlinear for the window A, an EnterNotify with detail NotifyNonlinearVirtual for its sibling window 5, and an EnterNotify with detail Notif yNonlinear for the child (window Bl).

Figure E-1. Events generated by a move between windows

EnterNotify and LeaveNotify events are also generated when the pointer is grabbed, if the pointer was not already inside the grabbing window. In this case, the grabbing window receives an EnterNotify and the window containing the pointer receives a LeaveNotify event, both with mode NotifyUngrab. The pointer position in both events is the position before the grab. The result when the grab is released is exactly the same, except that the two windows receive EnterNotify instead of LeaveNotify and vice versa.

620

Xlib Reference Manual

xcrossing

(continued)

EnterNotify, Leave Notify

Figure E-2 demonstrates the events and details caused by various pointer transitions, indicated by heavy arrows.

LeaveNotify Ancestor

picture17

picture18

picture19

picture20

Figure E-2. Border crossing events and detail member for pointer movement from window A to window B, for various window relationships

Xlib Reference Manual

•xexpose—

When Generated

An Expose event is generated when a window becomes visible or a previously invisible part of a window becomes visible. Only inputOutput windows generate or need to respond to Expose events; inputOnly windows never generate or need to respond to them. The Expose event provides the position and size of the exposed area within the window and a rough count of the number of remaining exposure events for the current window.

Select With

This event is selected with ExposureMask.

XEvent Structure Name

typedef union _XEvent {

XExposeEvent xexpose; } XEvent;

Event Structure

typedef struct {

int type;

unsigned long serial; /* # of last request processed by server */

Bool send_event; /* True if this came from SendEvent request */

Display ^display; /* Display the event was read from */

Window window;

int x, y;

int width, height;

int count; /* If nonzero, at least this many more */

} XExposeEvent;

Event Structure Members

x, y The coordinates of the upper-left corner of the exposed region relative to

the origin of the window.

width, height The width and height in pixels of the exposed region.

count The approximate number of remaining contiguous Expose events that

were generated as a result of a single function call.

Notes

A single action such as a window movement or a function call can generate several exposure events on one window or on several windows. The server guarantees that all exposure events generated from a single action will be sent contiguously, so that they can all be handled before moving on to other event types. This allows an application to keep track of the rectangles specified in contiguous Expose events, set the clip_mask in a GC to the areas specified in

622 Xlib Reference Manual

xexpose (continued) Expose

the rectangle using XSetRegion or XSetClipRectangles, and then finally redraw the window clipped with the GC in a single operation after all the Expose events have arrived. The last event to arrive is indicated by a count of 0. In Release 2, XUnionRectwith-Region can be used to add the rectangle in Expose events to a region before calling XSet Region.

If your application is able to redraw partial windows, you can also read each exposure event in turn and redraw each area.

Focusln, FocusOut \

•xfocus—

When Generated

Focusln and FocusOut events occur when the keyboard focus window changes as a result of an XSetlnputFocus call. They are much like EnterNotify and LeaveNotify events except that they track the focus rather than the pointer.

When a focus change occurs, a FocusOut event is delivered to the old focus window and a Focusln event to the window which receives the focus. In addition, windows in between these two windows in the window hierarchy are virtually crossed and receive focus change events, as described below. Some or all of the windows between the window containing the pointer at the time of the focus change and the root window also receive focus change events, as described below.

Select With

Focusln and FocusOut events are selected with FocusChangeMask. They cannot be selected separately.

XEvent Structure Name

typedef union _XEvent {

XFocusChangeEvent xfocus; (... } XEvent;

Event Structure

typedef struct {

int type; /* Focusln or FocusOut */

unsigned long serial; /* # of last request processed by server */

Bool send_event; /* True if this came from SendEvent request */

Display ^display; /* Display the event was read from */

Window window; /* Window of event */

int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */

int detail; /* NotifyAncestor, NotifyDetailNone,

* Notifylnferior, NotifyNonLinear,

* NotifyNonLinearVirtual, NotifyPointer,

* NotifyPointerRoot, NotifyVirtuaW } XFocusChangeEvent;

typedef XFocusChangeEvent XFocusInEvent; typedef XFocusChangeEvent XFocusOutEvent;

Event Structure Members

mode For events generated when the keyboard is not grabbed, mode is Notify

Normal; when the keyboard is grabbed, mode is NotifyGrab; and when a keyboard is ungrabbed, mode is NotifyUngrab.

detail The detail member identifies the relationship between the window that receives the event and the origin and destination windows. It will be described in detail after the description of which windows get what types of events.

624

Xlib Reference Manual

xfocus (continued) Focusln, FocusOut

Notes

The keyboard focus is a window that has been designated as the one to receive all keyboard input irrespective of the pointer position. Only the keyboard focus window and its descendants receive keyboard events. By default, the focus window is the root window. Since all windows are descendants of the root, the pointer controls the window that receives input.

Most window managers allow the user to set a focus window to avoid the problem where the pointer sometimes gets bumped into the wrong window and your typing does not go to the intended window. If the pointer is pointing at the root window, all typing is usually lost, since there is no application for this input to propagate to. Some applications may set the keyboard focus so that they can get all keyboard input for a given period of time, but this practice is not encouraged.

Focus events are used when an application wants to act differently when the keyboard focus is set to another window or to itself. FocusChangeMask is used to select Focusln and FocusOut events.

When a focus change occurs, a FocusOut event is delivered to the old focus window and a Focusln event is delivered to the window which receives the focus. Windows in between in the hierarchy are virtually crossed and receive one focus change event each depending on the relationship and direction of transfer between the origin and destination windows. Some or all of the windows between the window containing the pointer at the time of the focus change and that window's root window can also receive focus change events. By checking the detail member of Focusln and FocusOut events, an application can tell which of its windows can receive input.

The detail member gives clues about the relationship of the event receiving window to the origin and destination of the focus. The detail member of Focus in and FocusOut events is analogous to the detail member of EnterNotify and LeaveNotify events but with even more permutations to make life complicated.

Virtual Focus Crossing and the detail Member

We will now embark on specifying the types of events sent to each window and the detail member in each event, depending on the relative position in the hierarchy of the origin window (old focus), destination window (new focus), and the pointer window (window containing pointer at time of focus change). Don't even try to figure this out unless you have to.

Focusln, FocusOut

(continued)

xfocus

Table E-3 shows the event types generated by a focus transition from window A to window B when window C is the least common ancestor of A and B. This table includes most of the events generated, but not all of them. It is quite possible for a single window to receive more than one focus change event from a single focus change.

Table E-3. Focusln and FocusOut Events and Window Relationship

FocusOut

Origin window (A)

Windows between A and 5, exclusive, if A is inferior

Windows between A and C, exclusive

Root window on screen of origin if different from screen of destination

Pointer window up to but not including origin window if pointer window is descen dant of origin

Pointer window up to and including pointer window's root if transfer was from

PointerRoot

Focusln

Destination window (B)

Windows between A and 5, exclusive, if B is inferior

Windows between B and C, exclusive

Root window on screen of destination if different from screen of origin

Pointer window up to but not including destination window if pointer window is descendant of destina tion

Pointer window up to and including pointer win dow's root if transfer was to PointerRoot

Xlib Reference Manual

xfocus

(continued)

Focusln, FocusOut

Table E-4 lists the detail members in events generated by a focus transition from window A to window B when window C is the least common ancestor of A and B, with P being the win dow containing the pointer.

Table E-4. Event detail Member and Window Relationship

detail Flag

NotifyAncestor Notifylnferior NotifyVirtual

NotifyNonlinear NotifyNonlinearVirtual

NotifyPointer NotifyPointerRoot

NotifyDetailNone

Window Delivered To

Origin or destination when either is descendant Origin or destination when either is ancestor

Windows between A and B, exclusive, if either is descendant

Origin and destination when A and B are two or more windows distant from least common ancestor C

Windows between A and C, exclusive, and between B and C, exclusive, when A and B have least common ancestor C; also on both root windows if A and B are on different screens

Window P and windows up to but not including the origin or destination windows

Window P and all windows up to its root, and all other roots, when focus is set to or from Pointer-Root

All roots, when focus is set to or from None

Figure E-3 shows all the possible combinations of focus transitions and of origin, destination, and pointer windows and shows the types of events that are generated and their detail mem ber. Solid lines indicate branches of the hierarchy. Dotted arrows indicate the direction of transition of the focus. At each end of this arrow are the origin and destination windows, win dows A to B. Arrows ending in a bar indicate that the event type and detail described are delivered to all windows up to the bar.

In any branch, there may be windows that are not shown. Windows in a single branch between two boxes shown will get the event types and details shown beside the branch.

Xlib Reference Manual

Focusln, FocusOut

(continued)

xfocus

LeaveNotify,

picture21

If window P is between A and B, windows from P up to but not including B get FOCUS in with detail

Notifylnterior

picture22

picture23

FocusOut,

Nonlinear-Virtual

1

Roots of other Screens: FOCUS:.-, with Detail :;or.f

picture24

Root Window

FOCUS: None

picture25

FocusOut,

y

Figure E-3. Focusln and FocusOut event schematics

628

Xlib Reference Manual

xfocus

(continued)

Focusln, FocusOut

Roots of other Screens: isOut with Detail PointerRoot

Focus:

PointerP.cot I

picture26

1

T

Roots of other Screens:

"ocusGut with Detail •;• n<

Root Window FOCUS: Kone

picture27

Focus change from PointerRoot to :

All Root Windows: 2ui with Detail E int erF

Pointer's Root Window

1 _J

Focus change from PointerRoot to ::.:.•

All Root Windows: : - with Detail No.

Pointer's Root Window

Figure E-3. Focusln and FocusOut event schematics (cont.)

Focusln and FocusOut events are also generated when the keyboard is grabbed, if the focus was not already assigned to the grabbing window. In this case, all windows receive events as if the focus was set from the current focus to the grab window. When the grab is released, the events generated are just as if the focus was set back.

Xlib Reference Manual

GraphicsExpose, NoExpose \

•xnoexpose—

When Generated

GraphicsExpose events indicate that the source area for a XCopyArea or XCopyPlane request was not available because it was outside the source window or obscured by a window. NoExpose events indicate that the source region was completely available.

Select With

These events are not selected with xselect Input but are sent if the GC in the XCopyArea or XCopyPlane request had its graphics_exposures flag set to True. If graphics_exposures is True in the GC used for the copy, either one NoExpose event or one or more GraphicsExpose events will be generated for every XCopyArea or XCopyPlane call made.

XEvent Structure Name

typedef union _XEvent {

XNoExposeEvent xnoexpose; XGraphicsExposeEvent xgraphicsexpose;

} XEvent;

Event Structure

typedef struct {

int type;

unsigned long serial,

Bool send_event;

Display *display;

Drawable drawable;

int x, y;

int width, height;

int count;

int major_code;

int minor_code; } XGraphicsExposeEvent;

typedef struct {

int type;

unsigned long serial;

Bool send_event;

Display *display;

Drawable drawable;

int major_code;

int minor_code; } XNoExposeEvent;

/* # of last request processed by server */ /* True if this came from SendEvent request /* Display the event was read from */

/* if nonzero, at least this many more */ /* core is CopyArea or CopyPlane */ /* not defined in the core */

/* # of last request processed by server */ /* True if this came from SendEvent request */ /* Display the event was read from */

/* core is CopyArea or CopyPlane */ /* not defined in the core */

Xlib Reference Manual

(continued)

GraphicsExpose, NoExpose

xnoexpose

Event Structure Members

drawable A window or an off-screen pixmap. This specifies the destination of the

graphics request that generated the event

x, y The coordinates of the upper-left corner of the exposed region relative to

the origin of the window.

width, height The width and height in pixels of the exposed region.

count The approximate number of remaining contiguous GraphicsExpose

events that were generated as a result of the xcopyArea or XGopy-Plane call.

ma jor_code The graphics request used. This may be one of the symbols CopyArea

or CopyPlane or a symbol defined by a loaded extension.

minor_code Zero unless the request is part of an extension.

Notes

Expose events and GraphicsExpose events both indicate the region of a window that was actually exposed (x, y, width, and height). Therefore, they can often be handled similarly.

Xlib Reference Manual

GravityNotify \

•xgravity—

When Generated

A GravityNotify event reports when a window is moved because of a change in the size of its parent This happens when the win_gravity attribute of the child window is something other than StaticGravity or UnmapGravity.

Select With

This event is selected for a single window by specifying the window ID of that window with St ructureNotif yMask. To receive notification of movement due to gravity for a group of siblings, specify the parent window ID with SubstructureNotif yMask.

XEvent Structure Name

typedef union _XEvent {

XGravityEvent xgravity; } XEvent;

Event Structure

typedef struct {

int type;

unsigned long serial; /* # of last request processed by server */

Bool send_event; /* True if this came from SendEvent request */

Display *display; /* Display the event was read from */

Window event;

Window window;

int x, y; } XGravityEvent;

Event Structure Members

event The window that selected the event

window The window that was moved.

x, y The new coordinates of the window relative to its parent

632

Xlib Reference Manual

—xkeymap-

KeymapNotify

When Generated

A KeymapNotify event reports the state of the keyboard and occurs when the pointer or keyboard focus enters a window. KeymapNotify events are reported immediately after EnterNotify or Focusln events. This is a way for the application to read the keyboard state as the application is "woken up," since the two triggering events usually indicate that the application is about to receive user input.

Select With

This event is selected with KeymapStateMask.

XEvent Structure Name

typedef union _XEvent {

XKeymapEvent xkeymap; } XEvent;

Event Structure

typedef struct {

int type;

unsigned long serial,

Bool send_event;

Display *display;

Window window;

char key_vector[32]; } XKeymapEvent;

/* # of last request processed by server */ /* True if this came from SendEvent request */ /* Display the event was read from */

Event Structure Members

window Reports the window which was reported in the window member of the pre

ceding EnterNotify or Focusln event

key_vector A bit vector or mask, each bit representing one physical key, with a total of 256 bits. For a given key, its keycode is its position in the keyboard vector. You can also get this bit vector by calling XQueryKeymap.

Notes

The serial member of KeymapNotify does not contain the serial number of the most recent protocol request processed, because this event always follows immediately after EnterNotify or Focusln events in which the serial member is valid.

Xlib Reference Manual

KeyPress, KeyRelease

X

•xkey—

When Generated

KeyPress and KeyRelease events are generated for all keys, even those mapped to modifier keys such as Shift or Control.

Select With

Each type of keyboard event may be selected separately with KeyPressMask and Key-ReleaseMask.

XEvent Structure Name

typedef union _XEvent {

XKeyEvent xkey; } XEvent;

Event Structure

typedef struct { int type;

unsigned long serial, Bool send_event; Display *display; Window window; Window root; Window subwindow; Time time; int x, y;

int x_root, y_root;

unsigned int state;

unsigned int keycode;

Bool same_screen; } XKeyEvent;

typedef XKeyEvent XKeyPressedEvent; typedef XKeyEvent XKeyReleasedEvent;

/* of event */

/* # of last request processed by server */

/* True if this came from SendEvent request */

/* Display the event was read from */

/* event window it is reported relative to */

/* root window that the event occurred on */

/* child window */

/* milliseconds */

/* pointer coordinates relative to receiving

* window */

/* coordinates relative to root */

/* modifier key and button mask */

/* server-dependent code for key */

/* same screen flag */

Event Structure Members

subwindow If the source window is the child of the receiving window, then the

subwindow member is set to the ID of that child.

time

x,y

The server time when the button event occurred, in milliseconds. Time is declared as unsigned long, so it wraps around when it reaches the maximum value of a 32-bit number (every 49.7 days).

If the receiving window is on the same screen as the root window speci fied by root, then x and y are the pointer coordinates relative to the receiving window's origin. Otherwise, x and y are zero.

634

Xlib Reference Manual

xkey

(continued)

KeyPress, KeyRelease

When active button grabs and pointer grabs are in effect (see Section 9.4 of Volume One, Xlib Programming Manual), the coordinates relative to the receiving window may not be within the window (they may be nega tive or greater than window height or width).

xjcoot, y_root The pointer coordinates relative to the root window which is an ancestor of the event window. If the pointer was on a different screen, these ?~e zero.

state The state of all the buttons and modifier keys just before the event,

represented by a mask of the button and modifier key symbols:

ButtonlMask, Button2Mask, ButtonSMask, Button4Mask, ButtonSMask, ControlMask, LockMask, ModlMask, Mod2-Mask,ModSMask,Mod4Mask, ModSMask, and Shif tMask.

keycode The keycode member contains a server-dependent code for the key that

changed state. As such, it should be translated into the portable symbol called a keysym before being used. It can also be converted directly into ASCII with XLookupString. For a description and examples of how to translate keycodes, see Volume One, Section 9.1.1.

Notes

Remember that not all hardware is capable of generating release events and that only the main keyboard (a-z, A-Z, 0-9), Shift, and Control keys are always found.

Keyboard events are analogous to button events, though, of course, there are many more keys than buttons and the keyboard is not automatically grabbed between press and release.

All the structure members have the same meaning as described for ButtonPress and ButtonRelease events, except that button is replaced by keycode.

Xlib Reference Manual

MapNotlfy, UnmapNotify

X

•xmap, xunmap—

When Generated

The X server generates MapNotify and UnmapNotify events when a window changes state from unmapped to mapped or vice versa.

Select With

To receive these events on a single window, use StructureNotifyMask in the call to XSelect Input for the window. To receive these events for all children of a particular parent, specify the parent window ID and use SubstructureNotif yMask.

XEvent Structure Name

typedef union _XEvent {

XMapEvent xmap; XUnmapEvent xunmap;

} XEvent;

Event Structure

typedef struct {

int type;

unsigned long serial;

Bool send_event;

Display *display;

Window event;

Window window;

Bool override_redirect, } XMapEvent;

typedef struct {

int type;

unsigned long serial;

Bool send_event;

Display *display;

Window event;

Window window;

Bool from_configure; } XUnmapEvent;

/* # of last request processed by server */ /* True if this came from SendEvent request */ /* Display the event was read from */

/* boolean, is override set */

/* # of last request processed by server */ /* True if this came from SendEvent request */ /* Display the event was read from */

Event Structure Members

event The window that selected this event

The window that was just mapped or unmapped. override_redirect (XMapEvent only)

True or False. The value of the override_redirect attribute of the window that was just mapped.

636

Xlib Reference Manual

xmap, xunmap

(continued)

MapNotify, UnmapNotify

from_configure (XUnmapEvent only)

True if the event was generated as a result of a resizing of the window's parent when the window itself had a win_gravity of UnmapGravity. See the description of the win_gravity attribute in Section 4.3.4 of Volume One, Xlib Programming Manual. False otherwise.

Xlib Reference Manual

MappingNotify

X

•xmapping—

When Generated

A MappingNotify event is sent when any of the following is changed by another client: the mapping between physical keyboard keys (keycodes) and keysyms, the mapping between modifier keys and logical modifiers, or the mapping between physical and logical pointer buttons. These events are triggered by a call to XSetModifierMapping or XSet-PointerMapping, if the return status is MappingSuccess, or by any call to XChange-Keyboa rdMapping.

This event type should not be confused with the event that occurs when a window is mapped; that is a MapNotify event Nor should it be confused with the KeymapNotify event, which reports the state of the keyboard as a mask instead of as a keycode.

Select With

The X server sends MappingNotify events to all clients. It is never selected and cannot be masked with the window attributes.

XEvent Structure Name

typedef union _XEvent {

XMappingEvent xmapping; } XEvent;

/* # of last request processed by server */

/* True if this came from SendEvent request */

/* Display the event was read from */

/* unused */

/* one of MappingMapping, MappingKeyboard,

* MappingPointer */

/* first keycode */

/* range of change with first_keycode*/

Event Structure

typedef struct { int type;

unsigned long serial Bool send_event; Display *display; Window window; int request;

int first_keycode; int count; } XMappingEvent;

Event Structure Members

request The kind of mapping change that occurred: MappingModif ier for a

successful XSetModifierMapping (keyboard Shift, Lock, Control, Meta keys), MappingKeyboard for a successful XChange-KeyboardMapping (other keys), and MappingPointer for a suc cessful XSetPointerMapping (pointer button numbers).

first_keycode If the request member is MappingKeyboard or Mapping-Modifier, then f irst_keycode indicates the first in a range of key-codes with altered mappings. Otherwise, it is not set

Xlib Reference Manual

xmapplng (continued) MappingNotify

count If the request member is MappingKeyboard or Mapping-

Modifier, then count indicates the number of keycodes with altered mappings. Otherwise, it is not set

Notes

If the request member is MappingKeyboard, clients should call XRefreshKeyboard-Mapping.

The normal response to a request member of MappingPointer or MappingModif ier is no action. This is because the clients should use the logical mapping of the buttons and modifiers to allow the user to customize the keyboard if desired. If the application requires a particular mapping regardless of the user's preferences, it should call XGetModif ier-Mapping or XGetPointerMapping to find out about the new mapping.

MapRequest \ xm ,p r . qu .«_

When Generated

A MapRequest event occurs when the functions XMapRaised and XMapWindow are called.

This event differs from MapNot if y in that it delivers the parameters of the request before it is carried out This gives the client that selects this event (usually the window manager) the opportunity to revise the size or position of the window before executing the map request itself or to deny the request (MapNot i f y indicates the final outcome of the request)

Select With

This event is selected by specifying the window ID of the parent of the receiving window with SubstructureRedirectMask. (In addition, the override_redirect member of the XSetwindowAttributes structure for the specified window must be False.)

XEvent Structure Name

typedef union _XEvent {

XMapRequestEvent xmaprequest; } XEvent;

Event Structure

typedef struct { int type;

unsigned long serial; /* # of last request processed by server */ Bool send_event; /* True if this came from SendEvent request */ Display *display; /* Display the event was read from */ Window parent; Window window;

} XMapRequestEvent;

Event Structure Members

pa rent The ID of the parent of the window being mapped. window The ID of the window being mapped.

CAf)

Xlib Reference Manual

—xmotion-

MotionNotify

When Generated

A MotionNotify event reports that the user moved the pointer or that a program warped the pointer to a new position within a single window.

Select With

This event is selected with ButtonMotionMask, ButtonlMotionMask, Button2-MotionMask, ButtonSMotionMask, Button4MotionMask, ButtonSMotionMask, PointerMotionHintMask, and PointerMotionMask. These masks determine the spe cific conditions under which the event is generated.

See Section 8.3.3.3 of Volume One, Xlib Programming Manual, for a description of selecting button events.

XEvent Structure Name

typedef union _XEvent {

XMotionEvent xmotion; } XEvent;

Event Structure

typedef struct { int type;

unsigned long serial, Bool send_event; Display *display; Window window; Window root; Window subwindow; Time time; int x, y;

int x_root, y_root; unsigned int state; char is_hint; Bool same_screen; } XMotionEvent;

/* of event */

/* # of last request processed by server */

/* True if this came from SendEvent request */

/* Display the event was read from */

/* event window it is reported relative to */

/* root window that the event occurred on */

/* child window */

/* milliseconds */

/* pointer coordinates relative to receiving

* window */

/* coordinates relative to root */ /* button and modifier key mask */ /* is this a motion hint */ /* same screen flag */

typedef XMotionEvent XPointerMovedEvent;

Event Structure Members

subwindow If the source window is the child of the receiving window, then the

subwindow member is set to the ID of that child.

time

The server time when the button event occurred, in milliseconds. Time is declared as unsigned long, so it wraps around when it reaches the maximum value of a 32-bit number (every 49.7 days).

Xlib Reference Manual

MotionNotify

(continued)

xmotion

x , y if the receiving window is on the same screen as the root window speci

fied by root, then x and y are the pointer coordinates relative to the receiving window's origin. Otherwise, x and y are zero.

When active button grabs and pointer grabs are in effect (see Volume One, Section 9.4), the coordinates relative to the receiving window may not be within the window (they may be negative or greater than window height or width).

x_root, y_root The pointer coordinates relative to the root window which is an ancestor of the event window. If the pointer was on a different screen, these are zero.

state The state of all the buttons and modifier keys just before the event,

represented by a mask of the button and modifier key symbols:

ButtonlMask, Button2Mask, ButtonSMask, Button4Mask, ButtonSMask, ControlMask, LockMask, ModlMask, Mod2-Mask, ModSMask, Mod4Mask, ModSMask, and Shif tMask.

is_hint Either the constant NotifyNormal or NotifyHint. NotifyHint

indicates that the PointerMotionHintMask was selected. In this case, just one event is sent when the mouse moves, and the current posi tion can be found by calling XQueryPointer or by examining the motion history buffer with XGetMotionEvents, if a motion history buffer is available on the server. Not if yNormal indicates that the event is real, but it may not be up to date, since there may be many more later motion events on the queue.

same_screen Indicates whether the pointer is currently on the same screen as this win dow. This is always True unless the pointer was actively grabbed before the automatic grab could take place.

Notes

If the processing you have to do for every motion event is fast, you can probably handle all of them without requiring motion hints. However, if you have extensive processing to do for each one, you might be better off using the hints and calling XQueryPointer or using the history buffer if it exists. XQueryPointer is a round-trip request, so it can be slow.

EnterNotify and LeaveNotify events are generated instead of MotionEvents if the pointer starts and stops in different windows.

642

Xlib Reference Manual

—xproperty-

PropertyNotify

When Generated

A PropertyNotify event indicates that a property of a window has changed or been deleted. This event can also be used to get the current server time (by appending zero-length data to a property). PropertyNotify events are generated by XChangeProperty, XDeleteProperty, XGetWindowProperty, or XRotateWindowProperties.

Select With

This event is selected with PropertyChangeMask.

XEvent Structure Name

typedef union _XEvent {

XPropertyEvent xproperty; } XEvent;

Event Structure

typedef struct {

int type;

unsigned long serial;

Bool send_event;

Display *display;

Window window;

Atom atom;

Time time;

int state; } XPropertyEvent;

/* # of last request processed by server */ /* True if this came from SendEvent request */ /* Display the event was read from */

/* property NewValue, property Deleted */

Event Structure Members

window The window whose property was changed, not the window that selected the event

atom The property that was changed.

state Either PropertyNewValue or PropertyDelete. Whether the property

was changed to a new value or deleted.

t ime The t ime member specifies the server time when the property was changed.

Xlib Reference Manual

ReparentNotify

X

•xreparent—

When Generated

A ReparentNotify event reports when a client successfully reparents a window.

Select With

This event is selected with SubstructureNotif yMask by specifying the window ID of the old or the new parent window or with StructureNotifyMask by specifying the window ID.

XEvent Structure Name

typedef union _XEvent {

XReparentEvent xreparent; } XEvent;

Event Structure

typedef struct {

int type;

unsigned long serial

Bool send_event;

Display *display;

Window event;

Window window;

Window parent;

int x, y;

Bool override_redirect; } XReparentEvent;

/* # of last request processed by server */ /* True if this came from SendEvent request /* Display the event was read from */

Event Structure Members

window The window whose parent window was changed.

pa rent The new parent of the window.

x, y The coordinates of the upper-left pixel of the window's border rela

tive to the new parent window's origin.

override_redirect The override_redirect attribute of the reparented window. If True, it indicates that the client wants this window to be immune to meddling by the window manager. Window managers normally should not have reparented this window to begin with.

644

Xlib Reference Manual

—xresizerequest-

ResizeRequest

When Generated

A ResizeRequest event reports another client's attempt to change the size of a window. The X server generates this event type when another client calls XConf igurewindow, XMoveResizeWindow, or XResizeWindow. If this event type is selected, the window is not resized. This gives the client that selects this event (usually the window manager) the opportunity to revise the new size of the window before executing the resize request or to deny the request itself.

Select With

To receive this event type, specify a window ID and pass ResizeRedirectMask as part of the event_mask argument to XSelectlnput. Only one client can select this event on a particular window. When selected, this event is triggered instead of resizing the window.

XEvent Structure Name

typedef union _XEvent {

XResizeRequestEvent xresizerequest; } XEvent;

Event Structure

typedef struct {

int type;

unsigned long serial,

Bool send_event;

Display *display;

Window window;

int width, height; } XResizeRequestEvent;

/* # of last request processed by server */ /* True if this came from SendEvent request */ /* Display the event was read from */

Event Structure Members

window The window whose size another client attempted to change.

width, height The requested size of the window, not including its border.

Xlib Reference Manual

SelectionClear V.

v xselectlonclear —

When Generated

A SelectionClear event reports to the current owner of a selection that a new owner is being defined.

Select With

This event is not selected. It is sent to the previous selection owner when another client calls XSetSelectionOwner for the same selection.

XEvent Structure Name

typedef union _XEvent {

XSelectionClearEvent xselectionclear; } XEvent;

Event Structure

typedef struct {

int type;

unsigned long serial; /* # of last request processed by server */

Bool send_event; /* True if this came from SendEvent request */

Display 'display; /* Display the event was read from */

Window window;

Atom selection;

Time time; } XSelectionClearEvent;

Event Structure Members

window The window that is receiving the event and losing the selection.

selection The selection atom specifying the selection that is changing ownership, t ime The last-change time recorded for the selection.

— xselection-

SelectionNotify

When Generated

A SelectionNotify event is sent only by clients, not by the server, by calling xSend-Event. The owner of a selection sends this event to a requestor (a client that calls XConvertSelection for a given property) when a selection has been converted and stored as a property or when a selection conversion could not be performed (indicated with property

None).

Select With

There is no event mask for SelectionNotify events, and they are not selected with XSelectInput. Instead XSendEvent directs the event to a specific window, which is given as a window ID: PointerWindow, which identifies the window the pointer is in, or inputFocus, which identifies the focus window.

XEvent Structure Name

typedef union _XEvent {

XSelectionEvent xselection; } XEvent;

Event Structure

typedef struct {

int type;

unsigned long serial,

Bool send_event;

Display ^display;

Window requestor;

Atom selection;

Atom target;

Atom property;

Time time; } XSelectionEvent;

/* # of last request processed by server */ /* True if this came from SendEvent request /* Display the event was read from */

/* Atom or None */

Event Structure Members

The members of this structure have the values specified in the XConvertSelection call that triggers the selection owner to send this event, except that the property member either will return the atom specifying a property on the requestor window with the data type specified in target or will return None, which indicates that the data could not be converted into the target type.

Xlib Reference Manual

SelectionRequest \

• xse lectionrequest—

When Generated

A SelectionRequest event is sent to the owner of a selection when another client requests the selection by calling xConvert Select ion.

Select With

There is no event mask for SelectionRequest events, and they are not selected with

XSelectlnput.

XEvent Structure Name

typedef union _XEvent {

XSelectionRequestEvent xselectionrequest; } XEvent;

Event Structure

typedef struct {

int type;

unsigned long serial; /* # of last request processed by server */

Bool send_event; /* True if this came from SendEvent request */

Display *display; /* Display the event was read from */

Window owner;

Window requestor;

Atom selection;

Atom target;

Atom property;

Time time; } XSelectionRequestEvent;

Event Structure Members

The members of this structure have the values specified in the XConvert Select ion call that triggers this event

The owner should convert the selection based on the specified target type, if possible. If a property is specified, the owner should store the result as that property on the requestor window and then send a SelectionNotify event to the requestor by calling xSendEvent. If the selection cannot be converted as requested, the owner should send a SelectionNotify event with property set to the constant None.

—xvisibility-

VisibilityNotify

When Generated

A VisibilityNotify event reports any change in the visibility of the specified window. This event type is never generated on windows whose class is inputOnly. All of the win dow's subwindows are ignored when calculating the visibility of the window.

Select With

This event is selected with visibilityChangeMask.

XEvent Structure Name

typedef union _XEvent {

XVisibilityEvent xvisibility; } XEvent;

Event Structure

typedef struct { int type;

unsigned long serial, Bool send_event; Display ^display; Window window; int state;

/* # of last request processed by server */

/* True if this came from SendEvent request

/* Display the event was read from */

/* VisibilityObscured,

* VisibilityPartiallyObscured,

* VisibilityUnobscured*/

} XVisibilityEvent;

Event Structure Members

state A symbol indicating the final visibility status of the window: Visibility-

Obscured, VisibilityPartiallyObscured, or Visibility Unobscured.

Notes

Table E-5 lists the transitions that generate VisibilityNotify events and the correspond ing state member of the XVisibilityEvent structure.

Xlib Reference Manual

VisibilityNotify

(continued)

xvisibility

Table E-5. State Element of the XVisibilityEvent Structure

Visibility Status Before Visibility Status After State Member

Partially obscured, fully obscured, or not viewable

Viewable and completely unobscured, or not viewable

Viewable and completely unobscured, or viewable and partially obscured, or not viewable

Viewable and completely unobscured

Viewable and partially obscured

Viewable and partially obscured

VisibilityUnobscured

VisibilityPartially-Obscured

VisibilityPartially-Obscured

650

Xlib Reference Manual

Structure Reference

This appendix summarizes the contents of the include files for Xlib, and presents each struc ture in alphabetical order.

F.1 Description of Header Files

All include files are normally located in lusrlindudelXl 1. All Xlib programs require <XU/Xlib.h>, which includes <Xll/X.h>. <Xll/Xlib.h> contains most of the structure dec larations, while <Xll/X.h> contains most of the defined constants. Virtually all programs will also require <XlllXutil.h>, which include structure types and declarations applicable to window manager hints, colors, visuals, regions, standard geometry strings, and images.

Here is a summary of the contents of the include files:

<XlllXlib.h> structure declarations for core Xlib functions.

<XlllX.h> constant definitions for Xlib functions.

<Xll/Xutil.h> additional structure types and constant definitions for miscellaneous

Xlib functions.

<XlllXatom.h> the predefined atoms for properties, types, and font characteristics.

<Xll/cursorfont.h> the constants used to select a cursor shape from the standard cursor font.

<Xlllkeysym.h> predefined key symbols corresponding to keycodes. It includes

<Xll/keysymdef.h>.

<Xll/Xresource.h> resource manager structure definitions and function declarations.

Appendix F: Structure Reference

F.2 Resource Types

The following types are defined in <XU/X.h>:

unsigned long XID

XID Colormap

XID Cursor

XID Drawable

XID Font

XID GContext

XID KeySym

XID Pixmap

XID Window

unsigned long Atom

unsigned char KeyCode

unsigned long Mask

unsigned long Time

unsigned long VisuallD

F.3 Structure Definitions

This section lists all public Xlib structure definitions in XI ib. h and Xutil. h, in alphabet ical order, except the event structures, which are listed on the reference page for each event in Appendix E, Event Reference.

Before each structure is a description of what the structure is used for and a list of the Xlib routines that use the structure.

F.3.1 XArc

XArc specifies the bounding box for an arc and two angles indicating the extent of the arc within the box. A list of these structures is used in XDrawArcs and XFillArcs.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required