#ifndef WH_LX_H_a4ac7219_ #define WH_LX_H_a4ac7219_ // TODO: // Implement struct variants of CreateGC and ChangeGC // Implement struct variant of ChangeKeyboardControl // Implement convenience APIs a la XDrawLine() #include typedef unsigned int LX_XID; typedef unsigned int LX_KEYSYM; /* * Words with differing USA/British spelling, such as color/colour, are * spelt with the USA spellings, here, because those are the spellings * used by X. For some such words, I prefer the British spellings * (most notably for X, `color' and related words such as `colormap'); * I may someday add aliases using the British spellings. * * Ideally, I'd like to set things up so that (to pick an example) * LX_WCLASS is the type of a window class, with values such as * LX_WCLASS_InputOutput and LX_WCLASS_InputOnly, and we get strict * typechecking from the compiler, so that passing a non-LX_WCLASS_* * value as an LX_WCLASS argument produces a type mismatch error. But * I also want LX_WCLASS_InputOutput and LX_WCLASS_InputOnly to be * compile-time constants, so they are suitable for use in switches. * * I have not come up with a way to get both. The compromise I'm * picking is to use compile-time constant values and back off to * run-time typechecking, by using values such that (for example) * LX_WCLASS_InputOutput does not equal LX_BACKINGSTORE_WhenMapped, * even though they have the same representation in the protocol, so, * while it won't be a compile-time error to pass * LX_BACKINGSTORE_WhenMapped as a window class, it will be a run-time * error. * * This is especially relevant for values that are a set of fixed * alternatives or an X ID, such as the input focus window (which is a * window ID or None or PointerRoot). * * We can pick values which are known to be disjoint from X IDs because * X IDs never have any of the 0xe0000000 bits set. * * The library uses various internal names, some of which end up in * this file and thus are technically visible to application code. * Any name herein which begins lx__ or LX__ is library-internal. * Such names are not documented or committed interfaces; using them * from application code is not advised, is not supported, and is very * much "entirely at your own risk". */ typedef unsigned char LX_KEYCODE; /* * Image-byte-order (from connection setup). */ typedef unsigned int LX_IMAGE_BYTE_ORDER; #define LX_IBO_LSBFirst 0x20000001 #define LX_IBO_MSBFirst 0x20000002 /* * Bitmap-bit-order (from connection setup). */ typedef unsigned int LX_BITMAP_BIT_ORDER; #define LX_BBO_LeastSignificant 0x20000003 #define LX_BBO_MostSignificant 0x20000004 /* * Window class, when creating windows or querying their class, though * CopyFromParent is valid only when creating. */ typedef unsigned int LX_WINDOW_CLASS; #define LX_WCLASS_InputOutput 0x20000005 #define LX_WCLASS_InputOnly 0x20000006 #define LX_WCLASS_CopyFromParent 0x20000007 /* * Most of these are used for both bit-gravity and win-gravity, but * Forget is used only for bit-gravity and Unmap only for win-gravity. */ typedef unsigned int LX_GRAVITY; #define LX_GRAVITY_NorthWest 0x2000000d #define LX_GRAVITY_North 0x2000000e #define LX_GRAVITY_NorthEast 0x2000000f #define LX_GRAVITY_West 0x20000010 #define LX_GRAVITY_Center 0x20000011 #define LX_GRAVITY_East 0x20000012 #define LX_GRAVITY_SouthWest 0x20000013 #define LX_GRAVITY_South 0x20000014 #define LX_GRAVITY_SouthEast 0x20000015 #define LX_GRAVITY_Static 0x20000016 #define LX_GRAVITY_Forget 0x20000017 #define LX_GRAVITY_Unmap 0x20000018 /* * Backing-store hint values. */ typedef unsigned int LX_BACKINGSTORE; #define LX_BACKINGSTORE_NotUseful 0x2000001d #define LX_BACKINGSTORE_WhenMapped 0x2000001e #define LX_BACKINGSTORE_Always 0x2000001f /* * GC function values. Unlike most of the liblx interface values, * there is a little bit promised about these values. Specifically, * they are chosen such that bit operations on function values work, * with __src and __dst available to represent the source and * destination respectively, *provided* that, once done with the bit * operations, you AND with __mask and then OR in __base. * LX_GCFUNCTION_norm() is a convenience macro for this, as in * * LX_GCFUNCTION_norm(LX_GCFUNCTION__src & ~LX_GCFUNCTION_dst) * * (which evaluates to the same value as LX_GCFUNCTION_AndReverse, * AndReverse being the canonical X name for the src&~dst operation). */ typedef unsigned int LX_GCFUNCTION; #define LX_GCFUNCTION__base 0x20000030 #define LX_GCFUNCTION__mask 0x0000000f #define LX_GCFUNCTION__src 0x00000003 #define LX_GCFUNCTION__dst 0x00000005 #define LX_GCFUNCTION_norm(x) (((x) & LX_GCFUNCTION__mask) | LX_GCFUNCTION__base) #define LX_GCFUNCTION_Clear 0x20000030 #define LX_GCFUNCTION_And 0x20000031 #define LX_GCFUNCTION_AndReverse 0x20000032 #define LX_GCFUNCTION_Copy 0x20000033 #define LX_GCFUNCTION_AndInverted 0x20000034 #define LX_GCFUNCTION_NoOp 0x20000035 #define LX_GCFUNCTION_Xor 0x20000036 #define LX_GCFUNCTION_Or 0x20000037 #define LX_GCFUNCTION_Nor 0x20000038 #define LX_GCFUNCTION_Equiv 0x20000039 #define LX_GCFUNCTION_Invert 0x2000003a #define LX_GCFUNCTION_OrReverse 0x2000003b #define LX_GCFUNCTION_CopyInverted 0x2000003c #define LX_GCFUNCTION_OrInverted 0x2000003d #define LX_GCFUNCTION_Nand 0x2000003e #define LX_GCFUNCTION_Set 0x2000003f /* * Line-style in GCs. */ typedef unsigned int LX_GCLINESTYLE; #define LX_GCLINESTYLE_Solid 0x2000002d #define LX_GCLINESTYLE_OnOffDash 0x2000002e #define LX_GCLINESTYLE_DoubleDash 0x2000002f /* * Cap-style in GCs. */ typedef unsigned int LX_GCCAPSTYLE; #define LX_GCCAPSTYLE_NotLast 0x20000041 #define LX_GCCAPSTYLE_Butt 0x20000042 #define LX_GCCAPSTYLE_Round 0x20000043 #define LX_GCCAPSTYLE_Projecting 0x20000044 /* * Join-style in GC. */ typedef unsigned int LX_GCJOINSTYLE; #define LX_GCJOINSTYLE_Miter 0x20000046 #define LX_GCJOINSTYLE_Round 0x20000047 #define LX_GCJOINSTYLE_Bevel 0x20000048 /* * Fill-style in GC. */ typedef unsigned int LX_GCFILLSTYLE; #define LX_GCFILLSTYLE_Solid 0x2000004a #define LX_GCFILLSTYLE_Tiled 0x2000004b #define LX_GCFILLSTYLE_Stippled 0x2000004c #define LX_GCFILLSTYLE_OpaqueStippled 0x2000004d /* * Fill-rule in GCs. */ typedef unsigned int LX_GCFILLRULE; #define LX_GCFILLRULE_EvenOdd 0x2000004f #define LX_GCFILLRULE_Winding 0x20000050 /* * Subwindow-mode in GCs. */ typedef unsigned int LX_GCSUBWINDOWMODE; #define LX_GCSUBWINDOWMODE_ClipByChildren 0x20000052 #define LX_GCSUBWINDOWMODE_IncludeInferiors 0x20000053 /* * Arc-mode in GCs. */ typedef unsigned int LX_GCARCMODE; #define LX_GCARCMODE_Chord 0x20000055 #define LX_GCARCMODE_PieSlice 0x20000056 /* * Coord-mode in GCs. */ typedef unsigned int LX_COORDMODE; #define LX_COORDMODE_Origin 0x20000058 #define LX_COORDMODE_Previous 0x20000059 /* * Map-state of windows. */ typedef unsigned int LX_MAPSTATE; #define LX_MAPSTATE_Unmapped 0x2000005a #define LX_MAPSTATE_Unviewable 0x2000005b #define LX_MAPSTATE_Viewable 0x2000005c /* * Operations to lx_ForceScreenSaver. */ typedef unsigned int LX_FORCESCREENSAVER; #define LX_FORCESCREENSAVER_Reset 0x2000005e #define LX_FORCESCREENSAVER_Activate 0x2000005f /* * Distinguished values for atoms. (Not the predefined atom values; * those are separate.) */ typedef unsigned int LX_ATOM; #define LX_ATOM_None 0x20000060 #define LX_ATOM_AnyPropertyType 0x20000061 /* * Protocol-defined atom values. */ #define LX_ATOM_PRIMARY 1 #define LX_ATOM_SECONDARY 2 #define LX_ATOM_ARC 3 #define LX_ATOM_ATOM 4 #define LX_ATOM_BITMAP 5 #define LX_ATOM_CARDINAL 6 #define LX_ATOM_COLORMAP 7 #define LX_ATOM_CURSOR 8 #define LX_ATOM_CUT_BUFFER0 9 #define LX_ATOM_CUT_BUFFER1 10 #define LX_ATOM_CUT_BUFFER2 11 #define LX_ATOM_CUT_BUFFER3 12 #define LX_ATOM_CUT_BUFFER4 13 #define LX_ATOM_CUT_BUFFER5 14 #define LX_ATOM_CUT_BUFFER6 15 #define LX_ATOM_CUT_BUFFER7 16 #define LX_ATOM_DRAWABLE 17 #define LX_ATOM_FONT 18 #define LX_ATOM_INTEGER 19 #define LX_ATOM_PIXMAP 20 #define LX_ATOM_POINT 21 #define LX_ATOM_RECTANGLE 22 #define LX_ATOM_RESOURCE_MANGER 23 #define LX_ATOM_RGB_COLOR_MAP 24 #define LX_ATOM_RGB_BEST_MAP 25 #define LX_ATOM_RGB_BLUE_MAP 26 #define LX_ATOM_RGB_DEFAULT_MAP 27 #define LX_ATOM_RGB_GRAY_MAP 28 #define LX_ATOM_RGB_GREEN_MAP 29 #define LX_ATOM_RGB_RED_MAP 30 #define LX_ATOM_STRING 31 #define LX_ATOM_VISUALID 32 #define LX_ATOM_WINDOW 33 #define LX_ATOM_WM_COMMAND 34 #define LX_ATOM_WM_HINTS 35 #define LX_ATOM_WM_CLIENT_MACHINE 36 #define LX_ATOM_WM_ICON_NAME 37 #define LX_ATOM_WM_ICON_SIZE 38 #define LX_ATOM_WM_NAME 39 #define LX_ATOM_WM_NORMAL_HINTS 40 #define LX_ATOM_WM_SIZE_HINTS 41 #define LX_ATOM_WM_ZOOM_HINTS 42 #define LX_ATOM_MIN_SPACE 43 #define LX_ATOM_NORM_SPACE 44 #define LX_ATOM_MAX_SPACE 45 #define LX_ATOM_END_SPACE 46 #define LX_ATOM_SUPERSCRIPT_X 47 #define LX_ATOM_SUPERSCRIPT_Y 48 #define LX_ATOM_SUBSCRIPT_X 49 #define LX_ATOM_SUBSCRIPT_Y 50 #define LX_ATOM_UNDERLINE_POSITION 51 #define LX_ATOM_UNDERLINE_THICKNESS 52 #define LX_ATOM_STRIKEOUT_ASCENT 53 #define LX_ATOM_STRIKEOUT_DESCENT 54 #define LX_ATOM_ITALIC_ANGLE 55 #define LX_ATOM_X_HEIGHT 56 #define LX_ATOM_QUAD_WIDTH 57 #define LX_ATOM_WEIGHT 58 #define LX_ATOM_POINT_SIZE 59 #define LX_ATOM_RESOLUTION 60 #define LX_ATOM_COPYRIGHT 61 #define LX_ATOM_NOTICE 62 #define LX_ATOM_FONT_NAME 63 #define LX_ATOM_FAMILY_NAME 64 #define LX_ATOM_FULL_NAME 65 #define LX_ATOM_CAP_HEIGHT 66 #define LX_ATOM_WM_CLASS 67 #define LX_ATOM_WM_TRANSIENT_FOR 68 /* * Connection close-down modes. */ typedef unsigned int LX_CLOSEDOWNMODE; #define LX_CLOSEDOWNMODE_Destroy 0x20000063 #define LX_CLOSEDOWNMODE_RetainPermanent 0x20000064 #define LX_CLOSEDOWNMODE_RetainTemporary 0x20000065 /* * Access control states. */ typedef unsigned int LX_ACCESSCONTROL; #define LX_ACCESSCONTROL_Disable 0x20000066 #define LX_ACCESSCONTROL_Enable 0x20000067 /* * Host address types. All but _Error represent various host types in * the protocol; _Other is used for types other than the rest. (For * _Other, the type-specific data blob has the protocol type byte * prepended to it as the interface data blob.) _Error exists for * error returns from lx_hostlist_entry_type. */ typedef unsigned int LX_HOSTTYPE; #define LX_HOSTTYPE_IPv4 0x20000069 #define LX_HOSTTYPE_IPv6 0x2000006a #define LX_HOSTTYPE_DECnet 0x2000006b #define LX_HOSTTYPE_Chaos 0x2000006c #define LX_HOSTTYPE_Other 0x2000006d #define LX_HOSTTYPE_Error 0x2000006e /* * The mode argument to ChangeHosts operations. */ typedef unsigned int LX_CHANGEHOSTSMODE; #define LX_CHANGEHOSTSMODE_Insert 0x2000006f #define LX_CHANGEHOSTSMODE_Delete 0x20000070 /* * The mode argument to ChangeSaveSet operations. */ typedef unsigned int LX_CHANGESAVESETMODE; #define LX_CHANGESAVESETMODE_Insert 0x2000008d #define LX_CHANGESAVESETMODE_Delete 0x2000008e /* * Prefer-blanking values for the screen-saver interfaces. */ typedef unsigned int LX_SSBLANKING; #define LX_SSBLANKING_No 0x20000071 #define LX_SSBLANKING_Yes 0x20000072 #define LX_SSBLANKING_Default 0x20000073 /* * Allow-exposures values for the screen-saver interfaces. */ typedef unsigned int LX_SSEXPOSURES; #define LX_SSEXPOSURES_No 0x20000075 #define LX_SSEXPOSURES_Yes 0x20000076 #define LX_SSEXPOSURES_Default 0x20000077 /* * LED-action values to ChangeKeyboardControl operations. */ typedef unsigned int LX_KBCTLLEDACTION; #define LX_KBCTLLEDACTION_Off 0x20000079 #define LX_KBCTLLEDACTION_On 0x2000007a /* * Repeat-action values to ChangeKeyboardControl operations. */ typedef unsigned int LX_KBCTLREPEATACTION; #define LX_KBCTLREPEATACTION_Off 0x2000007b #define LX_KBCTLREPEATACTION_On 0x2000007c #define LX_KBCTLREPEATACTION_Default 0x2000007d /* * Size classes to QueryBestSize operations. */ typedef unsigned int LX_SIZECLASS; #define LX_SIZECLASS_Cursor 0x2000007e #define LX_SIZECLASS_Tile 0x2000007f #define LX_SIZECLASS_Stipple 0x20000080 /* * Image format values for the image interfaces. */ typedef unsigned int LX_IMAGEFORMAT; #define LX_IMAGEFORMAT_Bitmap 0x20000083 #define LX_IMAGEFORMAT_XYPixmap 0x20000084 #define LX_IMAGEFORMAT_ZPixmap 0x20000085 /* * Shape class values for, eg, FillPoly operations. */ typedef unsigned int LX_SHAPECLASS; #define LX_SHAPECLASS_Complex 0x20000086 #define LX_SHAPECLASS_Nonconvex 0x20000087 #define LX_SHAPECLASS_Convex 0x20000088 /* * Rectangle ordering values for, eg, SetClipRectangles operations. */ typedef unsigned int LX_RECTORDER; #define LX_RECTORDER_UnSorted 0x20000089 #define LX_RECTORDER_YSorted 0x2000008a #define LX_RECTORDER_YXSorted 0x2000008b #define LX_RECTORDER_YXBanded 0x2000008c /* * Operations for CirculateWindow operations. */ typedef unsigned int LX_CIRCULATE; #define LX_CIRCULATE_RaiseLowest 0x2000008f #define LX_CIRCULATE_LowerHighest 0x20000090 /* * Stacking modes for, eg, ConfigureWindow operations. */ typedef unsigned int LX_STACKMODE; #define LX_STACKMODE_Above 0x20000091 #define LX_STACKMODE_Below 0x20000092 #define LX_STACKMODE_TopIf 0x20000093 #define LX_STACKMODE_BottomIf 0x20000094 #define LX_STACKMODE_Opposite 0x20000095 /* * Operations on properties. */ typedef unsigned int LX_PROPERTYMODE; #define LX_PROPERTYMODE_Replace 0x20000096 #define LX_PROPERTYMODE_Prepend 0x20000097 #define LX_PROPERTYMODE_Append 0x20000098 /* * Grab modes. */ typedef unsigned int LX_GRABMODE; #define LX_GRABMODE_Synchronous 0x20000099 #define LX_GRABMODE_Asynchronous 0x2000009a /* * Grab stati. */ typedef unsigned int LX_GRABSTATUS; #define LX_GRABSTATUS_Success 0x2000009b #define LX_GRABSTATUS_AlreadyGrabbed 0x2000009c #define LX_GRABSTATUS_InvalidTime 0x2000009d #define LX_GRABSTATUS_NotViewable 0x2000009e #define LX_GRABSTATUS_Frozen 0x2000009f /* * Allow-events operations. */ typedef unsigned int LX_ALLOWMODE; #define LX_ALLOWMODE_AsyncPointer 0x200000a1 #define LX_ALLOWMODE_SyncPointer 0x200000a2 #define LX_ALLOWMODE_ReplayPointer 0x200000a3 #define LX_ALLOWMODE_AsyncKeyboard 0x200000a4 #define LX_ALLOWMODE_SyncKeyboard 0x200000a5 #define LX_ALLOWMODE_ReplayKeyboard 0x200000a6 #define LX_ALLOWMODE_AsyncBoth 0x200000a7 #define LX_ALLOWMODE_SyncBoth 0x200000a8 /* * Text directions. */ typedef unsigned int LX_TEXTDIRECTION; #define LX_TEXTDIRECTION_LeftToRight 0x200000a9 #define LX_TEXTDIRECTION_RightToLeft 0x200000aa /* * Detail values in MotionNotify events. */ typedef unsigned int LX_MOTIONDETAIL; #define LX_MOTIONDETAIL_Normal 0x200000ac #define LX_MOTIONDETAIL_Hint 0x200000ad /* * Detail values in EnterNotify and LeaveNotifiy events. */ typedef unsigned int LX_ENTERLEAVEDETAIL; #define LX_ENTERLEAVEDETAIL_Ancestor 0x200000af #define LX_ENTERLEAVEDETAIL_Virtual 0x200000b0 #define LX_ENTERLEAVEDETAIL_Inferior 0x200000b1 #define LX_ENTERLEAVEDETAIL_Nonlinear 0x200000b2 #define LX_ENTERLEAVEDETAIL_NonlinearVirtual 0x200000b3 /* * Mode values in EnterNotify and LeaveNotifiy events. */ typedef unsigned int LX_ENTERLEAVEMODE; #define LX_ENTERLEAVEMODE_Normal 0x200000b4 #define LX_ENTERLEAVEMODE_Grab 0x200000b5 #define LX_ENTERLEAVEMODE_Ungrab 0x200000b6 /* * Detail values in focus events. */ typedef unsigned int LX_FOCUSDETAIL; #define LX_FOCUSDETAIL_Ancestor 0x200000b7 #define LX_FOCUSDETAIL_Virtual 0x200000b8 #define LX_FOCUSDETAIL_Inferior 0x200000b9 #define LX_FOCUSDETAIL_Nonlinear 0x200000ba #define LX_FOCUSDETAIL_NonlinearVirtual 0x200000bb #define LX_FOCUSDETAIL_Pointer 0x200000bc #define LX_FOCUSDETAIL_PointerRoot 0x200000bd #define LX_FOCUSDETAIL_None 0x200000be /* * Mode values in focus events. */ typedef unsigned int LX_FOCUSMODE; #define LX_FOCUSMODE_Normal 0x200000bf #define LX_FOCUSMODE_Grab 0x200000c0 #define LX_FOCUSMODE_Ungrab 0x200000c1 #define LX_FOCUSMODE_WhileGrabbed 0x200000c2 /* * State values in visibility events. */ typedef unsigned int LX_VISIBILITYSTATE; #define LX_VISIBILITYSTATE_Unobscured 0x200000c3 #define LX_VISIBILITYSTATE_PartiallyObscured 0x200000c4 #define LX_VISIBILITYSTATE_FullyObscured 0x200000c5 /* * Place values in window-circulate events. */ typedef unsigned int LX_CIRCULATEPLACE; #define LX_CIRCULATEPLACE_Top 0x200000c6 #define LX_CIRCULATEPLACE_Bottom 0x200000c7 /* * State values in property events. */ typedef unsigned int LX_PROPERTYSTATE; #define LX_PROPERTYSTATE_NewValue 0x200000c8 #define LX_PROPERTYSTATE_Deleted 0x200000c9 /* * State values in colormap events. */ typedef unsigned int LX_COLORMAPSTATE; #define LX_COLORMAPSTATE_Uninstalled 0x200000ca #define LX_COLORMAPSTATE_Installed 0x200000cb /* * Request values in MappingNotify events. */ typedef unsigned int LX_MAPPINGREQUEST; #define LX_MAPPINGREQUEST_Modifier 0x200000cc #define LX_MAPPINGREQUEST_Keyboard 0x200000cd #define LX_MAPPINGREQUEST_Pointer 0x200000ce /* * Event state masks in, eg, KeyPress events. * * As the code is currently written, these values must equal the * corresponding protocol values. It is ill-advised to depend on * that, though. */ #define LX_EVS_Shift 0x0001 #define LX_EVS_Lock 0x0002 #define LX_EVS_Control 0x0004 #define LX_EVS_Mod1 0x0008 #define LX_EVS_Mod2 0x0010 #define LX_EVS_Mod3 0x0020 #define LX_EVS_Mod4 0x0040 #define LX_EVS_Mod5 0x0080 #define LX_EVS_Button1 0x0100 #define LX_EVS_Button2 0x0200 #define LX_EVS_Button3 0x0400 #define LX_EVS_Button4 0x0800 #define LX_EVS_Button5 0x1000 /* * Value-mask bits in ConfigureRequest events. * * As the code is currently written, these values must equal the * corresponding protocol values. It is ill-advised to depend on * that, though. */ #define LX_CONFIGUREREQUEST_X 0x00000001 #define LX_CONFIGUREREQUEST_Y 0x00000002 #define LX_CONFIGUREREQUEST_Width 0x00000004 #define LX_CONFIGUREREQUEST_Height 0x00000008 #define LX_CONFIGUREREQUEST_BorderWidth 0x00000010 #define LX_CONFIGUREREQUEST_Sibling 0x00000020 #define LX_CONFIGUREREQUEST_StackMode 0x00000040 /* * Mask bits for the struct variants of CreateGC and ChangeGC (which * don't currently exist...). */ #define LX_GCM_Function 0x00000001 #define LX_GCM_PlaneMask 0x00000002 #define LX_GCM_Foreground 0x00000004 #define LX_GCM_Background 0x00000008 #define LX_GCM_LineWidth 0x00000010 #define LX_GCM_LineStyle 0x00000020 #define LX_GCM_CapStyle 0x00000040 #define LX_GCM_JoinStyle 0x00000080 #define LX_GCM_FillStyle 0x00000100 #define LX_GCM_FillRule 0x00000200 #define LX_GCM_Tile 0x00000400 #define LX_GCM_Stipple 0x00000800 #define LX_GCM_TileStipXOrigin 0x00001000 #define LX_GCM_TileStipYOrigin 0x00002000 #define LX_GCM_Font 0x00004000 #define LX_GCM_SubwindowMode 0x00008000 #define LX_GCM_GraphicsExposures 0x00010000 #define LX_GCM_ClipXOrigin 0x00020000 #define LX_GCM_ClipYOrigin 0x00040000 #define LX_GCM_ClipMask 0x00080000 #define LX_GCM_DashOffset 0x00100000 #define LX_GCM_Dashes 0x00200000 #define LX_GCM_ArcMode 0x00400000 /* * Mask bits for the struct variant of, eg, CreateWindow. * * As the code is currently written, these values must equal the * corresponding protocol values. It is ill-advised to depend on * that, though. */ #define LX_SWM_BackPixmap 0x00000001 #define LX_SWM_BackPixel 0x00000002 #define LX_SWM_BorderPixmap 0x00000004 #define LX_SWM_BorderPixel 0x00000008 #define LX_SWM_BitGravity 0x00000010 #define LX_SWM_WinGravity 0x00000020 #define LX_SWM_BackingStore 0x00000040 #define LX_SWM_BackingPlanes 0x00000080 #define LX_SWM_BackingPixel 0x00000100 #define LX_SWM_OverrideRedirect 0x00000200 #define LX_SWM_SaveUnder 0x00000400 #define LX_SWM_EventMask 0x00000800 #define LX_SWM_DontPropagate 0x00001000 #define LX_SWM_Colormap 0x00002000 #define LX_SWM_Cursor 0x00004000 /* * Event mask bits. * * As the code is currently written, these values must equal the * corresponding protocol values. It is ill-advised to depend on * that, though. */ #define LX_EM_KeyPress 0x00000001 #define LX_EM_KeyRelease 0x00000002 #define LX_EM_ButtonPress 0x00000004 #define LX_EM_ButtonRelease 0x00000008 #define LX_EM_EnterWindow 0x00000010 #define LX_EM_LeaveWindow 0x00000020 #define LX_EM_PointerMotion 0x00000040 #define LX_EM_PointerMotionHint 0x00000080 #define LX_EM_Button1Motion 0x00000100 #define LX_EM_Button2Motion 0x00000200 #define LX_EM_Button3Motion 0x00000400 #define LX_EM_Button4Motion 0x00000800 #define LX_EM_Button5Motion 0x00001000 #define LX_EM_ButtonMotion 0x00002000 #define LX_EM_KeymapState 0x00004000 #define LX_EM_Exposure 0x00008000 #define LX_EM_VisibilityChange 0x00010000 #define LX_EM_StructureNotify 0x00020000 #define LX_EM_ResizeRedirect 0x00040000 #define LX_EM_SubstructureNotify 0x00080000 #define LX_EM_SubstructureRedirect 0x00100000 #define LX_EM_FocusChange 0x00200000 #define LX_EM_PropertyChange 0x00400000 #define LX_EM_ColormapChange 0x00800000 #define LX_EM_OwnerGrabButton 0x01000000 /* * Event types. * * As the code is currently written, these values must equal the * corresponding protocol values. It is ill-advised to depend on * that, though. */ #define LX_EV_KeyPress 2 #define LX_EV_KeyRelease 3 #define LX_EV_ButtonPress 4 #define LX_EV_ButtonRelease 5 #define LX_EV_MotionNotify 6 #define LX_EV_EnterNotify 7 #define LX_EV_LeaveNotify 8 #define LX_EV_FocusIn 9 #define LX_EV_FocusOut 10 #define LX_EV_KeymapNotify 11 #define LX_EV_Expose 12 #define LX_EV_GraphicsExposure 13 #define LX_EV_NoExposure 14 #define LX_EV_VisibilityNotify 15 #define LX_EV_CreateNotify 16 #define LX_EV_DestroyNotify 17 #define LX_EV_UnmapNotify 18 #define LX_EV_MapNotify 19 #define LX_EV_MapRequest 20 #define LX_EV_ReparentNotify 21 #define LX_EV_ConfigureNotify 22 #define LX_EV_ConfigureRequest 23 #define LX_EV_GravityNotify 24 #define LX_EV_ResizeRequest 25 #define LX_EV_CirculateNotify 26 #define LX_EV_CirculateRequest 27 #define LX_EV_PropertyNotify 28 #define LX_EV_SelectionClear 29 #define LX_EV_SelectionRequest 30 #define LX_EV_SelectionNotify 31 #define LX_EV_ColormapNotify 32 #define LX_EV_ClientMessage 33 #define LX_EV_MappingNotify 34 /* * Types which are opaque to application code. */ typedef struct lx_conn LX_CONN; typedef struct lx_op LX_OP; typedef struct lx_hostlist LX_HOSTLIST; typedef struct lx_strlist LX_STRLIST; typedef struct lx_XIDlist LX_XIDLIST; /* * Library types which are _not_ opaque to application code. */ /* * Time values such as are used in, eg, grabs. */ typedef unsigned int LX_TIME; #define LX_TIME_CurrentTime 0 /* * Events are represented as a discriminated union. The type is * LX_EVENT, with the discriminant called type. Each event type name * provides both the name of the per-type member and the name of the * struct for that type. For example, KeyPress events use * LX_EVENT_KeyPress as the KeyPress-specific struct, and the * discriminated union member name is called KeyPress. * * There is one other non-discriminated member in LX_EVENT, since there * is one other attribute of events which applies to all events: the * "came from a SendEvent request" bit. */ typedef struct lx_event_KeyPress LX_EVENT_KeyPress; struct lx_event_KeyPress { unsigned char keycode; unsigned short int seq; LX_TIME time; LX_XID rootw; LX_XID eventw; LX_XID childw; int rootx; int rooty; int eventx; int eventy; unsigned int state; int samescreen; } ; typedef struct lx_event_KeyRelease LX_EVENT_KeyRelease; struct lx_event_KeyRelease { unsigned char keycode; unsigned short int seq; LX_TIME time; LX_XID rootw; LX_XID eventw; LX_XID childw; int rootx; int rooty; int eventx; int eventy; unsigned int state; int samescreen; } ; typedef struct lx_event_ButtonPress LX_EVENT_ButtonPress; struct lx_event_ButtonPress { unsigned char button; unsigned short int seq; LX_TIME time; LX_XID rootw; LX_XID eventw; LX_XID childw; int rootx; int rooty; int eventx; int eventy; unsigned int state; int samescreen; } ; typedef struct lx_event_ButtonRelease LX_EVENT_ButtonRelease; struct lx_event_ButtonRelease { unsigned char button; unsigned short int seq; LX_TIME time; LX_XID rootw; LX_XID eventw; LX_XID childw; int rootx; int rooty; int eventx; int eventy; unsigned int state; int samescreen; } ; typedef struct lx_event_MotionNotify LX_EVENT_MotionNotify; struct lx_event_MotionNotify { LX_MOTIONDETAIL detail; unsigned short int seq; LX_TIME time; LX_XID rootw; LX_XID eventw; LX_XID childw; int rootx; int rooty; int eventx; int eventy; unsigned int state; int samescreen; } ; typedef struct lx_event_EnterNotify LX_EVENT_EnterNotify; struct lx_event_EnterNotify { LX_ENTERLEAVEDETAIL detail; unsigned short int seq; LX_TIME time; LX_XID rootw; LX_XID eventw; LX_XID childw; int rootx; int rooty; int eventx; int eventy; unsigned int state; LX_ENTERLEAVEMODE mode; int samescreen; int focus; } ; typedef struct lx_event_LeaveNotify LX_EVENT_LeaveNotify; struct lx_event_LeaveNotify { LX_ENTERLEAVEDETAIL detail; unsigned short int seq; LX_TIME time; LX_XID rootw; LX_XID eventw; LX_XID childw; int rootx; int rooty; int eventx; int eventy; unsigned int state; LX_ENTERLEAVEMODE mode; int samescreen; int focus; } ; typedef struct lx_event_FocusIn LX_EVENT_FocusIn; struct lx_event_FocusIn { LX_FOCUSDETAIL detail; unsigned short int seq; LX_XID eventw; LX_FOCUSMODE mode; } ; typedef struct lx_event_FocusOut LX_EVENT_FocusOut; struct lx_event_FocusOut { LX_FOCUSDETAIL detail; unsigned short int seq; LX_XID eventw; LX_FOCUSMODE mode; } ; typedef struct lx_event_KeymapNotify LX_EVENT_KeymapNotify; struct lx_event_KeymapNotify { unsigned char map[31]; } ; typedef struct lx_event_Expose LX_EVENT_Expose; struct lx_event_Expose { unsigned short int seq; LX_XID eventw; unsigned int x; unsigned int y; unsigned int w; unsigned int h; unsigned int count; } ; typedef struct lx_event_GraphicsExposure LX_EVENT_GraphicsExposure; struct lx_event_GraphicsExposure { unsigned short int seq; LX_XID drawable; unsigned int x; unsigned int y; unsigned int w; unsigned int h; unsigned int minor_opc; unsigned int count; unsigned int major_opc; } ; typedef struct lx_event_NoExposure LX_EVENT_NoExposure; struct lx_event_NoExposure { unsigned short int seq; LX_XID drawable; unsigned int minor_opc; unsigned int major_opc; } ; typedef struct lx_event_VisibilityNotify LX_EVENT_VisibilityNotify; struct lx_event_VisibilityNotify { unsigned short int seq; LX_XID window; LX_VISIBILITYSTATE state; } ; typedef struct lx_event_CreateNotify LX_EVENT_CreateNotify; struct lx_event_CreateNotify { unsigned short int seq; LX_XID parent; LX_XID window; int x; int y; unsigned int w; unsigned int h; unsigned int borderwidth; int override_redirect; } ; typedef struct lx_event_DestroyNotify LX_EVENT_DestroyNotify; struct lx_event_DestroyNotify { unsigned short int seq; LX_XID eventw; LX_XID window; } ; typedef struct lx_event_UnmapNotify LX_EVENT_UnmapNotify; struct lx_event_UnmapNotify { unsigned short int seq; LX_XID eventw; LX_XID window; int from_configure; } ; typedef struct lx_event_MapNotify LX_EVENT_MapNotify; struct lx_event_MapNotify { unsigned short int seq; LX_XID eventw; LX_XID window; int override_redirect; } ; typedef struct lx_event_MapRequest LX_EVENT_MapRequest; struct lx_event_MapRequest { unsigned short int seq; LX_XID parent; LX_XID window; } ; typedef struct lx_event_ReparentNotify LX_EVENT_ReparentNotify; struct lx_event_ReparentNotify { unsigned short int seq; LX_XID eventw; LX_XID window; LX_XID parent; int x; int y; int override_redirect; } ; typedef struct lx_event_ConfigureNotify LX_EVENT_ConfigureNotify; struct lx_event_ConfigureNotify { unsigned short int seq; LX_XID eventw; LX_XID window; LX_XID above_sibling; int x; int y; unsigned int w; unsigned int h; unsigned int borderwidth; int override_redirect; } ; typedef struct lx_event_ConfigureRequest LX_EVENT_ConfigureRequest; struct lx_event_ConfigureRequest { LX_STACKMODE stackmode; unsigned short int seq; LX_XID parent; LX_XID window; LX_XID sibling; int x; int y; unsigned int w; unsigned int h; unsigned int borderwidth; unsigned int mask; // LX_CONFIGUREREQUEST_* bits } ; typedef struct lx_event_GravityNotify LX_EVENT_GravityNotify; struct lx_event_GravityNotify { unsigned short int seq; LX_XID eventw; LX_XID window; int x; int y; } ; typedef struct lx_event_ResizeRequest LX_EVENT_ResizeRequest; struct lx_event_ResizeRequest { unsigned short int seq; LX_XID window; unsigned int w; unsigned int h; } ; typedef struct lx_event_CirculateNotify LX_EVENT_CirculateNotify; struct lx_event_CirculateNotify { unsigned short int seq; LX_XID eventw; LX_XID window; LX_CIRCULATEPLACE place; } ; typedef struct lx_event_CirculateRequest LX_EVENT_CirculateRequest; struct lx_event_CirculateRequest { unsigned short int seq; LX_XID parent; LX_XID window; LX_CIRCULATEPLACE place; } ; typedef struct lx_event_PropertyNotify LX_EVENT_PropertyNotify; struct lx_event_PropertyNotify { unsigned short int seq; LX_XID window; LX_XID atom; LX_TIME time; LX_PROPERTYSTATE state; } ; typedef struct lx_event_SelectionClear LX_EVENT_SelectionClear; struct lx_event_SelectionClear { unsigned short int seq; LX_TIME time; LX_XID owner; LX_XID selection; } ; typedef struct lx_event_SelectionRequest LX_EVENT_SelectionRequest; struct lx_event_SelectionRequest { unsigned short int seq; LX_TIME time; LX_XID owner; LX_XID requestor; LX_XID selection; LX_XID target; LX_XID property; } ; typedef struct lx_event_SelectionNotify LX_EVENT_SelectionNotify; struct lx_event_SelectionNotify { unsigned short int seq; LX_TIME time; LX_XID requestor; LX_XID selection; LX_XID target; LX_XID property; } ; typedef struct lx_event_ColormapNotify LX_EVENT_ColormapNotify; struct lx_event_ColormapNotify { unsigned short int seq; LX_XID window; LX_XID colormap; int new; LX_COLORMAPSTATE state; } ; typedef struct lx_event_ClientMessage LX_EVENT_ClientMessage; struct lx_event_ClientMessage { int format; unsigned short int seq; LX_XID window; LX_XID type; union { unsigned char data8[20]; unsigned short int data16[10]; unsigned int data32[5]; } u; } ; typedef struct lx_event_MappingNotify LX_EVENT_MappingNotify; struct lx_event_MappingNotify { unsigned short int seq; LX_MAPPINGREQUEST request; unsigned int first_keycode; unsigned int count; } ; typedef struct lx_event LX_EVENT; struct lx_event { int type; int send_event; union { LX_EVENT_KeyPress KeyPress; LX_EVENT_KeyRelease KeyRelease; LX_EVENT_ButtonPress ButtonPress; LX_EVENT_ButtonRelease ButtonRelease; LX_EVENT_MotionNotify MotionNotify; LX_EVENT_EnterNotify EnterNotify; LX_EVENT_LeaveNotify LeaveNotify; LX_EVENT_FocusIn FocusIn; LX_EVENT_FocusOut FocusOut; LX_EVENT_KeymapNotify KeymapNotify; LX_EVENT_Expose Expose; LX_EVENT_GraphicsExposure GraphicsExposure; LX_EVENT_NoExposure NoExposure; LX_EVENT_VisibilityNotify VisibilityNotify; LX_EVENT_CreateNotify CreateNotify; LX_EVENT_DestroyNotify DestroyNotify; LX_EVENT_UnmapNotify UnmapNotify; LX_EVENT_MapNotify MapNotify; LX_EVENT_MapRequest MapRequest; LX_EVENT_ReparentNotify ReparentNotify; LX_EVENT_ConfigureNotify ConfigureNotify; LX_EVENT_ConfigureRequest ConfigureRequest; LX_EVENT_GravityNotify GravityNotify; LX_EVENT_ResizeRequest ResizeRequest; LX_EVENT_CirculateNotify CirculateNotify; LX_EVENT_CirculateRequest CirculateRequest; LX_EVENT_PropertyNotify PropertyNotify; LX_EVENT_SelectionClear SelectionClear; LX_EVENT_SelectionRequest SelectionRequest; LX_EVENT_SelectionNotify SelectionNotify; LX_EVENT_ColormapNotify ColormapNotify; LX_EVENT_ClientMessage ClientMessage; LX_EVENT_MappingNotify MappingNotify; } u; } ; /* * Font information. * * LX_FONTINFO is per-font information. LX_CHARINFO serves two * purposes. One is as per-character information for fonts; the other * is to represent the same information for a whole string of * characters in calls such as QueryTextExtents8. * * lx__priv is library-private info. Library code that uses * LX_FONTINFOs may use the public struct members or may use the * private info; if application code changes any of the public * members, it must call lx_fontinfo_recache for the library to udpate * its cached info. If creating an LX_FONTINFO on its own, the * appropriate thing to do with lx__priv is to set it to nil; * lx_fontinfo_recache will then allocate private data as appropriate * and compute anything relevant. * * When the library creates an LX_FONTINFO, it, the propnames vector, * the propvalues vector, and the charinfos vector are each * individually malloc()ed. To free an LX_FONTINFO allocated by the * library, or manually allocated equiavlently, use * lx_fontinfo_free(). To free just the lx__priv library-private data * (such as before freeing an LX_FONTINFO allocated some other way), * use lx_fontinfo_free_priv(). */ typedef struct lx_fontinfo LX_FONTINFO; typedef struct lx_charinfo LX_CHARINFO; struct lx_charinfo { int lbearing; int rbearing; int width; int ascent; int descent; unsigned int attr; } ; struct lx_fontinfo { LX_CHARINFO minbounds; LX_CHARINFO maxbounds; unsigned int minb1; unsigned int maxb1; unsigned int mincb2; unsigned int maxcb2; unsigned int defchar; unsigned int nprops; LX_XID *propnames; unsigned int *propvalues; LX_TEXTDIRECTION dir; int all_chars_exist; int font_ascent; int font_descent; int ncharinfo; LX_CHARINFO *charinfos; void *lx__priv; } ; /* * A time-and-coordinates triple, such as is used for motion event * history. */ typedef struct lx_timecoord LX_TIMECOORD; struct lx_timecoord { LX_TIME time; int x; int y; } ; /* * A line segment, for calls such as PolySegment. */ typedef struct lx_segment LX_SEGMENT; struct lx_segment { int x1; int y1; int x2; int y2; } ; /* * A point, for calls such as PolyPoint. */ typedef struct lx_point LX_POINT; struct lx_point { int x; int y; } ; /* * An arc, for calls such as PolyArc. */ typedef struct lx_arc LX_ARC; struct lx_arc { int x; int y; int w; int h; int a1; int a2; } ; /* * A rectangle, for calls such as PolyRectangle. */ typedef struct lx_rectangle LX_RECTANGLE; struct lx_rectangle { int x; int y; int w; int h; } ; /* * Gettable window attributes, for GetWindowAttributes operations. */ typedef struct lx_get_window_attributes LX_GET_WINDOW_ATTRIBUTES; struct lx_get_window_attributes { unsigned int backing_store; LX_XID visual; unsigned int class; LX_GRAVITY bit_gravity; LX_GRAVITY win_gravity; unsigned int backing_planes; unsigned int backing_pixel; int save_under; int cmap_installed; LX_MAPSTATE map_state; int override_redirect; LX_XID colormap; unsigned int all_events; unsigned int our_events; unsigned int dont_propagate; } ; /* * Settable window attributes, for calls such as the attribute-struct * variant of CreateWindow. */ typedef struct lx_set_window_attributes LX_SET_WINDOW_ATTRIBUTES; struct lx_set_window_attributes { LX_XID background_pixmap; unsigned int background_pixel; LX_XID border_pixmap; unsigned int border_pixel; LX_GRAVITY bit_gravity; LX_GRAVITY win_gravity; LX_BACKINGSTORE backing_store; unsigned int backing_planes; unsigned int backing_pixel; int override_redirect; int save_under; unsigned int event_mask; unsigned int dont_propagate; LX_XID colormap; LX_XID cursor; } ; /* * More window attributes, this time the ones which can be affected by * ConfigureWindow requests. */ typedef struct lx_cfg_window_attributes LX_CFG_WINDOW_ATTRIBUTES; struct lx_cfg_window_attributes { int x; int y; int w; int h; int border_width; LX_XID sibling; LX_STACKMODE stack_mode; } ; /* * Screen saver attributes, for, eg, SetScreenSaver operations. */ typedef struct lx_screensaver LX_SCREENSAVER; struct lx_screensaver { int timeout; // -1 for default int interval; // -1 for default LX_SSBLANKING prefer_blanking; LX_SSEXPOSURES allow_exposures; } ; /* * The information returned by GetGeometry requests. */ typedef struct lx_get_geometry LX_GET_GEOMETRY; struct lx_get_geometry { LX_XID root; int depth; int x; int y; int w; int h; int borderwidth; } ; /* * Pointer control values. In the application->library direction, * flags indicates which values are meaningful: if _ACCEL isn't set, * numerator and denominator are meaningless and ignored; if _THRESH * isn't set, threshold is meaningless and ignored. Trying to set a * value to -1 sets it to the (server-specific) default value. In the * library->application direction, both flag bits are set, not because * they might not be but rather to make it easier to copy the struct * and pass it back later. */ typedef struct lx_pointercontrol LX_POINTERCONTROL; struct lx_pointercontrol { unsigned int flags; #define LX_POINTERCONTROL_ACCEL 0x00000001 #define LX_POINTERCONTROL_THRESH 0x00000002 int numerator; int denominator; int threshold; } ; /* * Keyboard control values. This struct is presently used by nothing * but GetKeyboardControl, but if a struct variant of * ChangeKeyboardControl is implemented, it too will presumably use * this. */ typedef struct lx_keyboardcontrol LX_KEYBOARDCONTROL; struct lx_keyboardcontrol { unsigned int clickpercent; unsigned int bellpercent; unsigned int bellpitch; unsigned int bellduration; unsigned int leds; int global_repeat; unsigned char key_repeat[32]; } ; /* * An RGB triple packaged up into a struct, for the _rgb variants of * some color-using calls. The values here take on the 0-65535 range * used by the protocol. */ typedef struct lx_rgb LX_RGB; struct lx_rgb { unsigned int r; unsigned int g; unsigned int b; } ; /* * An RGB triple and an associated pixel. The flags field uses the * LX_DO_* values defined below to indicate which primaries to use in * certain calls. */ typedef struct lx_rgbpf LX_RGBPF; struct lx_rgbpf { unsigned int r; unsigned int g; unsigned int b; unsigned int pixel; unsigned int flags; } ; /* * A 16-bit text item, for some 16-bit-text calls, eg PolyText16. */ typedef struct lx_textitem16 LX_TEXTITEM16; struct lx_textitem16 { const unsigned short int *text; int nchars; int delta; LX_XID font; // LX_FONT_None -> no change } ; /* * A 8-bit text item, for some 8-bit-text calls, eg PolyText8. */ typedef struct lx_textitem8 LX_TEXTITEM8; struct lx_textitem8 { const unsigned char *text; int nchars; int delta; LX_XID font; // LX_FONT_None -> no change } ; /* * The return type from the QueryPointer variant which uses a struct * return type instead of individual pointers. */ typedef struct lx_querypointer_status LX_QUERYPOINTER_STATUS; struct lx_querypointer_status { int samescreen; LX_XID root; LX_XID child; int rootx; int rooty; int winx; int winy; unsigned int mask; } ; /* * Distinguished values for button numbers for, eg, GrabButton. */ #define LX_AnyButton 0 /* * Distinguished values for keycodes for, eg, GrabKey. */ #define LX_AnyKey 0 /* * Special values for modifier masks for, eg, GrabButton. When not * using AnyModifier, such masks use the LX_EVS_* bits. */ #define LX_AnyModifier 0x8000 /* * An X error. See below for further discussion of error handling. * * X errors are represented with a discriminated union; the discrimnant * is the error type. Each error type has an arm of the union named * after the error type - for example, a Value error will be * represented with type set to LXXE_Value and the error-specific * information in the .u.value sub-struct. * * LX_X_ERR_TYPE is the error type. These mostly match the protocol * values at this writing, but this is specifically not promised. * LXXE_Other is used to represent an error the library doesn't * recognize; the error-specific variant for this type includes just * the data present for all errors (sequence number and major and * minor opcode values) plus the on-wire error type value. */ typedef enum { LXXE_Request = 1, LXXE_Value, LXXE_Window, LXXE_Pixmap, LXXE_Atom, LXXE_Cursor, LXXE_Font, LXXE_Match, LXXE_Drawable, LXXE_Access, LXXE_Alloc, LXXE_Colormap, LXXE_GContext, LXXE_IDChoice, LXXE_Name, LXXE_Length, LXXE_Implementation, LXXE_Other, } LX_X_ERR_TYPE; typedef struct lx_X_err LX_X_ERR; struct lx_X_err { LX_X_ERR_TYPE type; union { struct { unsigned int seq; unsigned int opc_major; unsigned int opc_minor; } request; // if LXXE_Request struct { unsigned int seq; unsigned int value; unsigned int opc_major; unsigned int opc_minor; } value; // if LXXE_Value struct { unsigned int seq; unsigned int id; unsigned int opc_major; unsigned int opc_minor; } window; // if LXXE_Window struct { unsigned int seq; unsigned int id; unsigned int opc_major; unsigned int opc_minor; } pixmap; // if LXXE_Pixmap struct { unsigned int seq; unsigned int id; unsigned int opc_major; unsigned int opc_minor; } atom; // if LXXE_Atom struct { unsigned int seq; unsigned int id; unsigned int opc_major; unsigned int opc_minor; } cursor; // if LXXE_Cursor struct { unsigned int seq; unsigned int id; unsigned int opc_major; unsigned int opc_minor; } font; // if LXXE_Font struct { unsigned int seq; unsigned int opc_major; unsigned int opc_minor; } match; // if LXXE_Match struct { unsigned int seq; unsigned int id; unsigned int opc_major; unsigned int opc_minor; } drawable; // if LXXE_Drawable struct { unsigned int seq; unsigned int opc_major; unsigned int opc_minor; } access; // if LXXE_Access struct { unsigned int seq; unsigned int opc_major; unsigned int opc_minor; } alloc; // if LXXE_Alloc struct { unsigned int seq; unsigned int id; unsigned int opc_major; unsigned int opc_minor; } colormap; // if LXXE_Colormap struct { unsigned int seq; unsigned int id; unsigned int opc_major; unsigned int opc_minor; } gcontext; // if LXXE_GContext struct { unsigned int seq; unsigned int id; unsigned int opc_major; unsigned int opc_minor; } idchoice; // if LXXE_IDChoice; struct { unsigned int seq; unsigned int opc_major; unsigned int opc_minor; } name; // if LXXE_Name struct { unsigned int seq; unsigned int opc_major; unsigned int opc_minor; } length; // if LXXE_Length struct { unsigned int seq; unsigned int opc_major; unsigned int opc_minor; } implementation; // if LXXE_Implementation struct { unsigned int type; unsigned int seq; unsigned int opc_major; unsigned int opc_minor; } other; // if LXXE_Other } u; } ; /* * A library-internal error. See below for further discussion of error * handling. Such an error is represented as a discrimnated union. * The discrimnant is the error type, one of the LXLE_* values (see * below for descriptions); most types have a per-type struct in the * union which gives more detail. * * LXLE_NOMEM * Out of memory (eg, malloc() failed). * LXLE_SYSERR * Error from a syscall, with errno. * LXLE_OSLIBERR * Error from an OS library call, potentially with message. * LXLE_BAD_CALL * Some API function was called incorrectly. This is an * application failure. u.bad_call.fn is the name of the * incorrectly-called API function. * LXLE_NO_DISPLAY * lx_open was passed no display string and thre was no $DISPLAY * in the environment. * LXLE_BAD_DISPLAY * The display string to lx_open (either passed in or from * $DISPLAY) was erroneous in some way. * LXLE_UNX_EOF * The library got an unexpected EOF on the X connection. * LXLE_ALL_FAIL * lx_open ran out of addresses to try without getting a * connection. u.all_fail.msg has a possibly-helpful message. * LXLE_PROTO_ERR * The library got an X protocol error. u.proto_err.msg briefly * states the error. * LXLE_REJECTED * The X server rejected the connection. u.rejected.msg is the * message the server returned. */ typedef enum { LXLE_NOMEM = 1, LXLE_SYSERR, LXLE_OSLIBERR, LXLE_BAD_CALL, LXLE_NO_DISPLAY, LXLE_BAD_DISPLAY, LXLE_NO_SCREEN, LXLE_UNX_EOF, LXLE_ALL_FAIL, LXLE_PROTO_ERR, LXLE_REJECTED, } LX_LIB_ERR_TYPE; typedef struct lx_lib_err LX_LIB_ERR; struct lx_lib_err { LX_LIB_ERR_TYPE type; union { // nothing for LXLE_NOMEM struct { // syscall which returned error const char *call; // errno returned int err; } syserr; // for LXLE_SYSERR struct { // library call which returned error const char *call; // message, nil if none const char *msg; } osliberr; // for LXLE_OSLIBERR struct { // API function which was called wrong const char *fn; } bad_call; // for LXLE_BAD_CALL // nothing for LXLE_NO_DISPLAY // nothing for LXLE_BAD_DISPLAY // nothing for LXLE_NO_SCREEN // nothing for LXLE_UNX_EOF struct { const char *msg; } all_fail; // for LXLE_ALL_FAIL struct { const char *msg; } proto_err; // for LXLE_PROTO_ERR struct { const char *msg; } rejected; // for LXLE_REJECTED } u; } ; /* * Error handling (the bane of many APIs). We deal with errors via * callbacks. Each connection has two error callbacks, an X error * callback and a library error callback. * * The X error callback is called when an X error is received. It gets * the relevant LX_CONN * and an LX_X_ERR *, which is a discriminated * union holding the unpacked X error packet (see above). It must * return an LX_X_ERR_ACTION, one of * * LX_X_ERR_IGNORE * Ignore the X error event. Carry on as though it had * not been received at all; the application either has * done or will do anything relevant. * * LX_X_ERR_CRASH * Print a description of the error to stderr and exit(1). * * If no X error callback is set, it is as if one were which did * nothing but return LX_X_ERR_CRASH. * * The library error callback is called when a locally-detected error * is discovered by the library. This can be anything from a * can't-happen test firing in the library code to an I/O error to an * incorrect application call. The library error callback gets the * relevant LX_CONN * and an LX_LIB_ERR value describing the error. * (lx_open has its own, different, error handling mechanisms, because * it can encounter errors when it doesn't have an LX_CONN * at all.) * It returns void; if it returns, the library unwinds far enough to * return to the application, but in most cases the LX_CONN is no * longer usable and there is nothing useful to do but lx_close it. * There is one exception; if an LXLE_BAD_CALL handler returns, the * bad call is ignored, as if it had not been made at all. * * If no library error callback is set, the library supplies one which * prints a message to stderr and exits with code 1. * * Error handlers must never throw out. Doing so may leave things in * an inconsistent state, leading to indeterminate later trouble. * * In all cases, the LX_X_ERR or LX_LIB_ERR object pointed to (and * anything it in turn points to) may go invalid as soon as the * handler returns. Any data to be saved from it must be copied * within the handler. * * As indicated by the `const' qualifier in the types, below, error * handlers must never try to modify the error events. Doing so * produces undefined behaviour from the library. * * When a connection is first created, its error handlers are unset. * They can be set with lx_err_set_X() and lx_err_set_lib(), each of * which returns the previously set handler. Passing in a nil pointer * is equivalent to passing in the original library-provided default * function pointer. (The actual function pointer can be obtained by * saving the `previously set handler' return value from one of these * functions when the previous handler is the default handler.) * * The type of an X error handler pointer is * LX_X_ERR_ACTION (*)(LX_CONN *, const LX_X_ERR *). * * The type of a library-internal error handler pointer is * void (*)(LX_CONN *, const LX_LIB_ERR *). */ typedef enum { LX_X_ERR_IGNORE = 1, LX_X_ERR_CRASH, } LX_X_ERR_ACTION; extern LX_X_ERR_ACTION (*lx_err_set_X(LX_CONN *, LX_X_ERR_ACTION (*)(LX_CONN *, const LX_X_ERR *)))(LX_CONN *, const LX_X_ERR *); extern void (*lx_err_set_lib(LX_CONN *, void (*)(LX_CONN *, const LX_LIB_ERR *)))(LX_CONN *, const LX_LIB_ERR *); /* * There are various internal functions prototyped here as well, * typically because they are part of the implementation behind a * macro. Any name lx__* or LX__*, as noted above, is internal, not * part of the interface contract and not to be used directly. */ /* * Open a new connection. Arglist: * * const char *dispname, * void (*err)(const LX_LIB_ERR *, void *), * void (*done)(LX_CONN *, void *), * AIO_LOOP *loop, * void *cbarg, * unsigned int flags * * dispname is a string is of the form * lhs:rhs * where lhs is one of * hostname * numeric-v4-address * [address-literal] * the four-character string "unix" * the zero-length string * and rhs is one of * D * D.S * (D and S are decimal integers) * * err is a function which is called on error. It gets passed an * LX_LIB_ERR pointer and the cbarg value (see below). This pointer * may be nil, in which case the library provides a default which * prints a suitable message to stderr and exits with status 1. As * for calls to the library error handler (see above), the LX_LIB_ERR * pointer must be considered invalid once the handler returns. * * done is a function which is called on success. It gets the * resulting LX_CONN pointer and the cbarg value (see below). * * loop is the AIO_LOOP the library is to use for this connection. * This may be nil, in which case the library uses the global loop. * * cbarg is a pointer, opaque to the library, which is passaed to err * or done, whichever gets called. * * flags is zero or more of the LX_OPENF_* flag bits: * * LX_OPENF_NO_PREAMBLE * By default, the library automatically does some initial * protocol exchanges (such as querying and, if supported, * enabling BIG_REQUESTS) as part of the connection open. * Specifying this suppresses these; the only protocol * done as part of open is then just the strict minimum. * LX_OPENF_DEBUG * Turns on internal debugging code. What there is and * what it does is not documented here; it is there to * help debug the library, so UTSL. * * Note that err and done may be called from within lx_open(); it is an * error to assume that they will not be called until later. */ extern void lx_open( const char *, void (*)(const LX_LIB_ERR *, void *), void (*)(LX_CONN *, void *), AIO_LOOP *, void *, unsigned int ); #define LX_OPENF_NO_PREAMBLE 0x00000001 #define LX_OPENF_DEBUG 0x00000002 /* * lx_close closes an X connection. This implies lx_op_abort on all * pending LX_OPs on it. */ extern void lx_close(LX_CONN *); /* * User data. Each LX_CONN has a void * user data pointer. This is * set to nil when the connection is created and can be set by * lx_set_udata and get by lx_get_udata, but is otherwise not used by * the library at all. */ extern void lx_set_udata(LX_CONN *, void *); extern void *lx_get_udata(LX_CONN *); /* * There are two general paradigms for requests: open-loop and * response-expected. Which paradigm applies depends on the request. * As an example of an open-loop request, consider MapWindow; as * example of a response-expected request, consider * GetWindowAttributes. * * For open-loop requests, the call (eg, lx_CreateWindow) returns the * results, if any, immediately (eg, an LX_XID for lx_CreateWindow, or * nothing for lx_Bell) and there is no way to tell when it has * completed, except indirectly, such as by a later response-expected * request's response arriving. * * For response-expected requests, the call returns an LX_OP pointer, * which can be passed to various calls, such as lx_op_callback, to do * useful things with the pending request. */ // conn, parent, x, y, w, h, bw, dp, class, vis, ... extern LX_XID lx_CreateWindow(LX_CONN *, LX_XID, int, int, unsigned int, unsigned int, unsigned int, int, LX_WINDOW_CLASS, LX_XID, ...); #define LX_CWV_BackPixmap(pm) LX__CWV_BackPixmap, lx__cvt_LX_XID((pm)) #define LX_CWV_BackPixel(pix) LX__CWV_BackPixel, lx__cvt_pixel((pix)) #define LX_CWV_BorderPixmap(pm) LX__CWV_BorderPixmap, lx__cvt_LX_XID((pm)) #define LX_CWV_BorderPixel(pix) LX__CWV_BorderPixel, lx__cvt_pixel((pix)) #define LX_CWV_BitGravity(g) LX__CWV_BitGravity, lx__cvt_LX_XID((g)) #define LX_CWV_WinGravity(g) LX__CWV_WinGravity, lx__cvt_LX_XID((g)) #define LX_CWV_BackingStore(bs) LX__CWV_BackingStore, lx__cvt_LX_XID((bs)) #define LX_CWV_BackingPlanes(bp) LX__CWV_BackingPlanes, lx__cvt_pixel((bp)) #define LX_CWV_BackingPixel(bp) LX__CWV_BackingPixel, lx__cvt_pixel((bp)) #define LX_CWV_OverrideRedirect(or) LX__CWV_OverrideRedirect, lx__cvt_bool((or)) #define LX_CWV_SaveUnder(su) LX__CWV_SaveUnder, lx__cvt_bool((su)) #define LX_CWV_EventMask(em) LX__CWV_EventMask, lx__cvt_mask((em)) #define LX_CWV_DontPropagate(dp) LX__CWV_DontPropagate, lx__cvt_eventmask((dp)) #define LX_CWV_Colormap(cmap) LX__CWV_Colormap, lx__cvt_LX_XID((cmap)) #define LX_CWV_Cursor(curs) LX__CWV_Cursor, lx__cvt_LX_XID((curs)) #define LX_CWV_END LX__CWV_END // conn, parent, x, y, w, h, bw, dp, class, vis, mask, attr // mask uses LX_SWM_* values extern LX_XID lx_CreateWindow_attr(LX_CONN *, LX_XID, int, int, unsigned int, unsigned int, unsigned int, int, LX_WINDOW_CLASS, LX_XID, unsigned int, const LX_SET_WINDOW_ATTRIBUTES *); // conn, window, ... // varargs are the same as for lx_CreateWindow extern void lx_ChangeWindowAttributes(LX_CONN *, LX_XID, ...); // conn, window, mask, attr // mask uses LX_SWM_* values extern void lx_ChangeWindowAttributes_attr(LX_CONN *, LX_XID, unsigned int, const LX_SET_WINDOW_ATTRIBUTES *); // conn, window, attrs extern LX_OP *lx_GetWindowAttributes(LX_CONN *, LX_XID, LX_GET_WINDOW_ATTRIBUTES *); // conn, window extern void lx_DestroyWindow(LX_CONN *, LX_XID); // conn, window extern void lx_DestroySubwindows(LX_CONN *, LX_XID); // conn, window, mode extern void lx_ChangeSaveSet(LX_CONN *, LX_XID, LX_CHANGESAVESETMODE); // conn, window, parent, x, y extern void lx_ReparentWindow(LX_CONN *, LX_XID, LX_XID, int, int); // conn, window extern void lx_MapWindow(LX_CONN *, LX_XID); // conn, window extern void lx_MapSubwindows(LX_CONN *, LX_XID); // conn, window extern void lx_UnmapWindow(LX_CONN *, LX_XID); // conn, window extern void lx_UnmapSubwindows(LX_CONN *, LX_XID); // conn, window, ... extern void lx_ConfigureWindow(LX_CONN *, LX_XID, ...); #define LX_CWV_X(x) LX__CWV_X, lx__cvt_int((x)) #define LX_CWV_Y(y) LX__CWV_Y, lx__cvt_int((y)) #define LX_CWV_W(w) LX__CWV_W, lx__cvt_int((w)) #define LX_CWV_H(h) LX__CWV_H, lx__cvt_int((h)) #define LX_CWV_BorderWidth(bw) LX__CWV_BorderWidth, lx__cvt_int((bw)) #define LX_CWV_Sibling(sib) LX__CWV_Sibling, lx__cvt_LX_XID((sib)) #define LX_CWV_StackMode(sm) LX__CWV_StackMode, lx__cvt_LX_XID((sm)) // LX_CWV_END already defined above // conn, window, mask, attr extern void lx_ConfigureWindow_attr(LX_CONN *, LX_XID, unsigned int, const LX_CFG_WINDOW_ATTRIBUTES *); // conn, window, direction extern void lx_CirculateWindow(LX_CONN *, LX_XID, LX_CIRCULATE); // conn, drawable, geomp extern LX_OP *lx_GetGeometry(LX_CONN *, LX_XID, LX_GET_GEOMETRY *); // conn, window, rootp, parentp, childrenp // See also the lx_XIDlist_* functions extern LX_OP *lx_QueryTree(LX_CONN *, LX_XID, LX_XID *, LX_XID *, LX_XIDLIST **); // conn, only-if-exists, name, len, atomp // len==-1 means use strlen(name) extern LX_OP *lx_InternAtom(LX_CONN *, int, const char *, int, LX_XID *); // conn, atom, lenp, textp // *textp will have a trailing '\0' appended, not counted in *lenp // *textp freeable with free() extern LX_OP *lx_GetAtomName(LX_CONN *, LX_XID, int *, char **); // conn, window, property, type, format, mode, data, len // len is in format-sized units extern void lx_ChangeProperty(LX_CONN *, LX_XID, LX_XID, LX_XID, int, LX_PROPERTYMODE, const void *, int); // conn, window, property extern void lx_DeleteProperty(LX_CONN *, LX_XID, LX_XID); // conn, window, property, type, offset, len, delete, formatp, typep, afterp, lenp, valuep // *valuep freeable with free() extern LX_OP *lx_GetProperty(LX_CONN *, LX_XID, LX_XID, LX_XID, unsigned int, unsigned int, int, int *, LX_XID *, unsigned int *, int *, void **); // conn, window, listp // See also the lx_XIDlist_* functions extern LX_OP *lx_ListProperties(LX_CONN *, LX_XID, LX_XIDLIST **); // conn, selection, window, time extern void lx_SetSelectionOwner(LX_CONN *, LX_XID, LX_XID, LX_TIME); // conn, selection, ownerp extern LX_OP *lx_GetSelectionOwner(LX_CONN *, LX_XID, LX_XID *); // conn, requestor, selection, target, property, time extern void lx_ConvertSelection(LX_CONN *, LX_XID, LX_XID, LX_XID, LX_XID, LX_TIME); // conn, dest, prop, emask, event extern void lx_SendEvent(LX_CONN *, LX_XID, int, unsigned int, const LX_EVENT *); // conn, grabwin, ownerevents, eventmask, ptrmode, kbdmode, confine, cursor, time, statusp extern LX_OP *lx_GrabPointer(LX_CONN *, LX_XID, int, unsigned int, LX_GRABMODE, LX_GRABMODE, LX_XID, LX_XID, LX_TIME, LX_XID *); // conn, time extern void lx_UngrabPointer(LX_CONN *, LX_TIME); // conn, button, modifiers, grabwin, ownerevents, mask, ptrmode, kbdmode, confine, cursor extern void lx_GrabButton(LX_CONN *, int, unsigned int, LX_XID, int, unsigned int, LX_GRABMODE, LX_GRABMODE, LX_XID, LX_XID); // conn, button, modifiers, grabwin extern void lx_UngrabButton(LX_CONN *, int, unsigned int, LX_XID); // conn, eventmask, cursor, time) extern void lx_ChangeActivePointerGrab(LX_CONN *, unsigned int, LX_XID, LX_TIME); // conn, grabwin, ownerevents, ptrmode, kbdmode, time, statusp extern LX_OP *lx_GrabKeyboard(LX_CONN *, LX_XID, int, LX_GRABMODE, LX_GRABMODE, LX_TIME, LX_XID *); // conn, time extern void lx_UngrabKeyboard(LX_CONN *, LX_TIME); // conn, keycode, modifiers, grabwin, ownerevents, ptrmode, kbdmode extern void lx_GrabKey(LX_CONN *, unsigned int, unsigned int, LX_XID, int, LX_GRABMODE, LX_GRABMODE); // conn, keycode, modifiers, grabwin extern void lx_UngrabKey(LX_CONN *, unsigned int, unsigned int, LX_XID); // conn, mode, time extern void lx_AllowEvents(LX_CONN *, LX_ALLOWMODE, LX_TIME); // conn extern void lx_GrabServer(LX_CONN *); // conn extern void lx_UngrabServer(LX_CONN *); // conn, window, samescreenp, rootp, childp, rxp, ryp, wxp, wyp, maskp extern LX_OP *lx_QueryPointer(LX_CONN *, LX_XID, int *, LX_XID *, LX_XID *, int *, int *, int *, int *, unsigned int *); // conn, window, statusp extern LX_OP *lx_QueryPointer_status(LX_CONN *, LX_XID, LX_QUERYPOINTER_STATUS *); // conn, window, start, stop, nevp, evp // *evp freeable with free() extern LX_OP *lx_GetMotionEvents(LX_CONN *, LX_XID, LX_TIME, LX_TIME, int *, LX_TIMECOORD **); // conn, srcwin, dstwin, sx, sy, samescreenp, dxp, dyp, childp extern LX_OP *lx_TranslateCoordinates(LX_CONN *, LX_XID, LX_XID, int, int, int *, int *, int *, LX_XID *); // conn, srcwin, dstwin, srcx, srcy, srcw, srch, dstx, dsty extern void lx_WarpPointer(LX_CONN *, LX_XID, LX_XID, int, int, int, int, int, int); // conn, focus, revert, time // revert, and non-window values for focus, use LX_FOCUS_* values extern void lx_SetInputFocus(LX_CONN *, LX_XID, LX_XID, LX_TIME); // conn, focusp, revertp extern LX_OP *lx_GetInputFocus(LX_CONN *, LX_XID *, LX_XID *); // conn, statep // statep points to (at least) 32 unsigned chars extern LX_OP *lx_QueryKeymap(LX_CONN *, unsigned char *); // conn, name // XXX Do we want an interface supporting NULs in font names? extern LX_XID lx_OpenFont(LX_CONN *, const char *); // conn, font extern void lx_CloseFont(LX_CONN *, LX_XID); // conn, fontable, infop extern LX_OP *lx_QueryFont(LX_CONN *, LX_XID, LX_FONTINFO **); // conn, fontable, str, len, dirp, ascp, descp, overallp // len==-1 means use strlen(str) extern LX_OP *lx_QueryTextExtents8(LX_CONN *, LX_XID, const unsigned char *, int, LX_TEXTDIRECTION *, int *, int *, LX_CHARINFO *); // conn, fontable, str, len, dirp, ascp, descp, overallp // len is in characters, not chars extern LX_OP *lx_QueryTextExtents16(LX_CONN *, LX_XID, const unsigned short int *, int, LX_TEXTDIRECTION *, int *, int *, LX_CHARINFO *); // conn, pattern, maxnames, listp // XXX Do we want an interface supporting NULs in patterns? // XXX Do we want an interface supporting NULs in path names? extern LX_OP *lx_ListFonts(LX_CONN *, const char *, int, LX_STRLIST **); // conn, pattern, maxnames, eachcb // XXX Do we want an interface supporting NULs in patterns? // XXX Do we want an interface supporting NULs in path names? // eachcb is called for each font and takes ownership of its arguments // string arg is freeable with free() // for info arg, see LX_FONTINFO comment extern LX_OP *lx_ListFontsWithInfo(LX_CONN *, const char *, int, void (*)(char *, LX_FONTINFO *)); // conn, nstrs, strs // XXX Do we want an interface supporting NULs in path list entries? extern void lx_SetFontPath(LX_CONN *, int, const char * const *); // conn, pathp extern LX_OP *lx_GetFontPath(LX_CONN *, LX_STRLIST **); // conn, drawable, depth, width, height extern LX_XID lx_CreatePixmap(LX_CONN *, LX_XID, unsigned int, unsigned int, unsigned int); // conn, pixmap extern void lx_FreePixmap(LX_CONN *, LX_XID); // conn, drawable, ... extern LX_XID lx_CreateGC(LX_CONN *, LX_XID, ...); #define LX_GCV_Function(f) LX__GCV_Function, lx__cvt_LX_XID((f)) #define LX_GCV_PlaneMask(pm) LX__GCV_PlaneMask, lx__cvt_mask((pm)) #define LX_GCV_Foreground(pix) LX__GCV_Foreground, lx__cvt_pixel((pix)) #define LX_GCV_Background(pix) LX__GCV_Background, lx__cvt_pixel((pix)) #define LX_GCV_LineWidth(w) LX__GCV_LineWidth, lx__cvt_uint((w)) #define LX_GCV_LineStyle(ls) LX__GCV_LineStyle, lx__cvt_LX_XID((ls)) #define LX_GCV_CapStyle(cs) LX__GCV_CapStyle, lx__cvt_LX_XID((cs)) #define LX_GCV_JoinStyle(js) LX__GCV_JoinStyle, lx__cvt_LX_XID((js)) #define LX_GCV_FillStyle(fs) LX__GCV_FillStyle, lx__cvt_LX_XID((fs)) #define LX_GCV_FillRule(fr) LX__GCV_FillRule, lx__cvt_LX_XID((fr)) #define LX_GCV_Tile(pm) LX__GCV_Tile, lx__cvt_LX_XID((pm)) #define LX_GCV_Stipple(pm) LX__GCV_Stipple, lx__cvt_LX_XID((pm)) #define LX_GCV_TileStipXOrigin(xo) LX__GCV_TileStipXOrigin, lx__cvt_int((xo)) #define LX_GCV_TileStipYOrigin(yo) LX__GCV_TileStipYOrigin, lx__cvt_int((yo)) #define LX_GCV_Font(f) LX__GCV_Font, lx__cvt_LX_XID((f)) #define LX_GCV_SubwindowMode(sm) LX__GCV_SubwindowMode, lx__cvt_LX_XID((sm)) #define LX_GCV_GraphicsExposures(gx) LX__GCV_GraphicsExposures, lx__cvt_bool((gx)) #define LX_GCV_ClipXOrigin(cxo) LX__GCV_ClipXOrigin, lx__cvt_int((cxo)) #define LX_GCV_ClipYOrigin(cyo) LX__GCV_ClipYOrigin, lx__cvt_int((cyo)) #define LX_GCV_ClipMask(pm) LX__GCV_ClipMask, lx__cvt_LX_XID((pm)) #define LX_GCV_DashOffset(do) LX__GCV_DashOffset, lx__cvt_uint((do)) #define LX_GCV_Dashes(dl) LX__GCV_DashList, lx__cvt_uint((dl)) #define LX_GCV_ArcMode(am) LX__GCV_ArcMode, lx__cvt_LX_XID((am)) #define LX_GCV_END LX__GCV_END // conn, gc, ... // varargs are the same as for lx_CreateGC extern void lx_ChangeGC(LX_CONN *, LX_XID, ...); // conn, src, dst, mask // mask uses LX_GCM_* bits extern void lx_CopyGC(LX_CONN *, LX_XID, LX_XID, unsigned int); // conn, gc, offset, ndash, dashes extern void lx_SetDashes(LX_CONN *, LX_XID, int, int, const unsigned char *); // conn, gc, xo, yo, nrects, rects, ordering extern void lx_SetClipRectangles(LX_CONN *, LX_XID, int, int, int, const LX_RECTANGLE *, LX_RECTORDER); // conn, gc extern void lx_FreeGC(LX_CONN *, LX_XID); // conn, window, x, y, w, h, exposures extern void lx_ClearArea(LX_CONN *, LX_XID, int, int, int, int, int); // conn, srcd, dstd, gc, sx, sy, dx, dy, w, h extern void lx_CopyArea(LX_CONN *, LX_XID, LX_XID, LX_XID, int, int, int, int, int, int); // conn, srcd, dstd, gc, sx, sy, dx, dy, w, h, bit extern void lx_CopyPlane(LX_CONN *, LX_XID, LX_XID, LX_XID, int, int, int, int, int, int, unsigned int); // conn, drawable, gc, coord-mode, npts, points extern void lx_PolyPoint(LX_CONN *, LX_XID, LX_XID, LX_COORDMODE, int, const LX_POINT *); // conn, drawable, gc, coordmode, npts, pts extern void lx_PolyLine(LX_CONN *, LX_XID, LX_XID, LX_COORDMODE, int, const LX_POINT *); // conn, drawable, gc, nseg, segments extern void lx_PolySegment(LX_CONN *, LX_XID, LX_XID, int, const LX_SEGMENT *); // conn, drawable, gc, nrects, rects extern void lx_PolyRectangle(LX_CONN *, LX_XID, LX_XID, int, const LX_RECTANGLE *); // conn, drawable, gc, narcs, arcs extern void lx_PolyArc(LX_CONN *, LX_XID, LX_XID, int, const LX_ARC *); // conn, drawable, gc, shape, coordmode, npts, pts extern void lx_FillPoly(LX_CONN *, LX_XID, LX_XID, LX_SHAPECLASS, LX_COORDMODE, int, const LX_POINT *); // conn, drawable, gc, nrects, rects extern void lx_PolyFillRectangle(LX_CONN *, LX_XID, LX_XID, int, const LX_RECTANGLE *); // conn, drawable, gc, narcs, arcs extern void lx_PolyFillArc(LX_CONN *, LX_XID, LX_XID, int, const LX_ARC *); // conn, drawable, gc, format, depth, w, h, dstx, dsty, leftpad, datalen, data extern void lx_PutImage(LX_CONN *, LX_XID, LX_XID, LX_IMAGEFORMAT, int, int, int, int, int, int, int, const void *); // conn, drawable, format, x, y, int w, int h, planes, depthp, visualp, sizep, bitsp // *bitsp freeable with free() extern LX_OP *lx_GetImage(LX_CONN *, LX_XID, LX_IMAGEFORMAT, int, int, int, int, unsigned int, int *, LX_XID *, int *, void **); // conn, drawable, gc, x, y, nitems, items extern void lx_PolyText8(LX_CONN *, LX_XID, LX_XID, int, int, int, const LX_TEXTITEM8 *); // conn, drawable, gc, x, y, nitems, items extern void lx_PolyText16(LX_CONN *, LX_XID, LX_XID, int, int, int, const LX_TEXTITEM16 *); // conn, drawable, gc, x, y, string, len // len==-1 means use strlen(string) extern void lx_ImageText8(LX_CONN *, LX_XID, LX_XID, int, int, const unsigned char *, int); // conn, drawable, gc, x, y, string, len extern void lx_ImageText16(LX_CONN *, LX_XID, LX_XID, int, int, const unsigned short int *, int); // conn, visual, window, alloc extern LX_XID lx_CreateColormap(LX_CONN *, LX_XID, LX_XID, LX_XID); // conn, cmap extern void lx_FreeColormap(LX_CONN *, LX_XID); // conn, old extern LX_XID lx_CopyColormapAndFree(LX_CONN *, LX_XID); // conn, cmap extern void lx_InstallColormap(LX_CONN *, LX_XID); // conn, cmap extern void lx_UninstallColormap(LX_CONN *, LX_XID); // conn, window, listp // See also the lx_XIDlist_* functions extern LX_OP *lx_ListInstalledColormaps(LX_CONN *, LX_XID, LX_XIDLIST **); // conn, cmap, r, g, b, pix, actr, actg, actb extern LX_OP *lx_AllocColor(LX_CONN *, LX_XID, unsigned int, unsigned int, unsigned int, unsigned int *, unsigned int *, unsigned int *, unsigned int *); // conn, cmap, name, len, pixp, xrp, xgp, xbp, vrp, vgp, vbp // len==-1 means use strlen(name) extern LX_OP *lx_AllocNamedColor(LX_CONN *, LX_XID, const char *, int, unsigned int *, unsigned int *, unsigned int *, unsigned int *, unsigned int *, unsigned int *, unsigned int *); // conn, cmap, name, len, pixp, xp, vp // len==-1 means use strlen(name) extern LX_OP *lx_AllocNamedColor_rgb(LX_CONN *, LX_XID, const char *, int, unsigned int *, LX_RGB *, LX_RGB *); // conn, cmap, contig, cols, planes, pixp, planep extern LX_OP *lx_AllocColorCells(LX_CONN *, LX_XID, int, int, int, unsigned int *, unsigned int *); // conn, cmap, contig, ncol, nr, ng, nb, pixp, rmp, gmp, bmp extern LX_OP *lx_AllocColorPlanes(LX_CONN *, LX_XID, int, int, int, int, int, unsigned int *, unsigned int *, unsigned int *, unsigned int *); // conn, cmap, planes, npix, pixv extern void lx_FreeColors(LX_CONN *, LX_XID, unsigned int, int, const unsigned int *); // conn, cmap, num, items extern void lx_StoreColors(LX_CONN *, LX_XID, int, const LX_RGBPF *); // conn, cmap, pixel, name, len, doflags // len==-1 means use strlen(name); doflags uses LX_DO_* extern void lx_StoreNamedColor(LX_CONN *, LX_XID, unsigned int, const char *, int, unsigned int); // conn, cmap, npix, pixels, rgbp // rgbp must point to at least npix LX_RGBs extern LX_OP *lx_QueryColors(LX_CONN *, LX_XID, int, const unsigned int *, LX_RGB *); // conn, cmap, name, len, xrp, xgp, xbp, vrp, vgp, vbp // len==-1 means use strlen(name) extern LX_OP *lx_LookupColor(LX_CONN *, LX_XID, const char *, int, unsigned int *, unsigned int *, unsigned int *, unsigned int *, unsigned int *, unsigned int *); // conn, cmap, name, len, xp, vp // len==-1 means use strlen(name) extern LX_OP *lx_LookupColor_rgb(LX_CONN *, LX_XID, const char *, int, LX_RGB *, LX_RGB *); // conn, src, mask, fr, fg, fb, br, bg, bb, hotx, hoty extern LX_XID lx_CreateCursor(LX_CONN *, LX_XID, LX_XID, int, int, int, int, int, int, int, int); // conn, src, mask, fg, bg, hotx, hoty extern LX_XID lx_CreateCursor_rgb(LX_CONN *, LX_XID, LX_XID, LX_RGB, LX_RGB, int, int); // conn, srcfont, maskfont, srcchar, maskchar, fr, fg, fb, br, bg, bb extern LX_XID lx_CreateGlyphCursor(LX_CONN *, LX_XID, LX_XID, int, int, int, int, int, int, int, int); // conn, srcfont, maskfont, srcchar, maskchar, fg, bg extern LX_XID lx_CreateGlyphCursor_rgb(LX_CONN *, LX_XID, LX_XID, int, int, LX_RGB, LX_RGB); // conn, cursor extern void lx_FreeCursor(LX_CONN *, LX_XID); // conn, cursor, fr, fg, fb, br, bg, bb extern void lx_RecolorCursor(LX_CONN *, LX_XID, int, int, int, int, int, int); // conn, cursor, fg, bg extern void lx_RecolorCursor_rgb(LX_CONN *, LX_XID, LX_RGB, LX_RGB); // conn, drawable, class, w, h, rwp, rhp extern LX_OP *lx_QueryBestSize(LX_CONN *, LX_XID, LX_SIZECLASS, int, int, int *, int *); // conn, name, len, presentp, majorp, eventbasep, errorbasep // len==-1 means use strlen(name) // if !*presentp the other return values are meaningless extern LX_OP *lx_QueryExtension(LX_CONN *, const char *, int, int *, int *, int *, int *); // conn, namesp // See also the lx_strlist_* functions extern LX_OP *lx_ListExtensions(LX_CONN *, LX_STRLIST **listp); // conn, first, keycodes, symspercode, syms extern void lx_ChangeKeyboardMapping(LX_CONN *, int, int, int, const LX_KEYSYM *); // conn, minkeycode, count, symspercodep, keysymsp // LX_KEYSYM vector is allocated by the library, freeable with free() extern LX_OP *lx_GetKeyboardMapping(LX_CONN *, int, int, int *, LX_KEYSYM **); // conn, ... extern void lx_ChangeKeyboardControl(LX_CONN *, ...); #define LX_KCV_KeyClickPercent(p) LX__KCV_KeyClickPercent, lx__cvt_int((p)) #define LX_KCV_BellPercent(p) LX__KCV_BellPercent, lx__cvt_int((p)) #define LX_KCV_BellPitch(p) LX__KCV_BellPitch, lx__cvt_int((p)) #define LX_KCV_BellDuration(d) LX__KCV_BellDuration, lx__cvt_int((d)) #define LX_KCV_LED(led,action) LX__KCV_LED, lx__cvt_int((led)) lx__LX_XID((action)) #define LX_KCV_AllLED(action) LX__KCV_LED, (-1), lx__LX_XID((action)) #define LX_KCV_Repeat(key,action) LX__KCV_Repeat, lx__cvt_int((key)) lx__LX_XID((action)) #define LX_KCV_GlobalRepeat(action) LX__KCV_Repeat, (-1) lx__LX_XID((action)) #define LX_KCV_END LX__KCV_END // conn, status extern LX_OP *lx_GetKeyboardControl(LX_CONN *, LX_KEYBOARDCONTROL *); // conn, percent extern void lx_Bell(LX_CONN *, int); // conn, status extern void lx_ChangePointerControl(LX_CONN *, const LX_POINTERCONTROL *); // conn, status extern LX_OP *lx_GetPointerControl(LX_CONN *, LX_POINTERCONTROL *); // conn, status extern void lx_SetScreenSaver(LX_CONN *, const LX_SCREENSAVER *); // conn, status extern LX_OP *lx_GetScreenSaver(LX_CONN *, LX_SCREENSAVER *); // conn, mode, type, datalen, data extern void lx_ChangeHosts(LX_CONN *, LX_CHANGEHOSTSMODE, LX_HOSTTYPE, int, const void *); // conn, accctl, list // See also the lx_hostlist_* functions. extern LX_OP *lx_ListHosts(LX_CONN *, LX_ACCESSCONTROL *, LX_HOSTLIST **); // conn, mode extern void lx_SetAccessControl(LX_CONN *, LX_ACCESSCONTROL); // conn, mode extern void lx_SetCloseDownMode(LX_CONN *, LX_CLOSEDOWNMODE); // conn, resource extern void lx_KillClient(LX_CONN *, LX_XID); // conn, window, delta, nprop, props extern void lx_RotateProperties(LX_CONN *, LX_XID, int, int, const LX_ATOM *); // conn, mode extern void lx_ForceScreenSaver(LX_CONN *, LX_FORCESCREENSAVER); // conn, num, mapping // mapping must point to num unsigned chars extern void lx_SetPointerMapping(LX_CONN *, int, const unsigned char *); // conn, nump, mapping // mapping must point to enough unsigned chars (255 are always enough) extern LX_OP *lx_GetPointerMapping(LX_CONN *, int *, unsigned char *); // conn, num, keycodesp // keycodesp must point to 8*num LX_KeyCodes extern void lx_SetModifierMapping(LX_CONN *, int, const LX_KEYCODE *); // conn, nump, keycodesp // keycodesp must point to enough space (2048 LX_KEYCODEs is always enough) extern LX_OP *lx_GetModifierMapping(LX_CONN *, int *, LX_KEYCODE *); // conn extern void lx_NoOperation(LX_CONN *); /* * There are also a few functions which are conceptually like requests * but which are handled entirely within the library. */ // return number of screens // conn extern int lx_nscreens(LX_CONN *); // return default screen number // conn extern int lx_default_screen(LX_CONN *); // return root window of screen N (LX_WINDOW_None if error) // conn, N extern LX_XID lx_root(LX_CONN *, int); // return depth of root window of screen N (-1 if error) // conn, N extern int lx_root_depth(LX_CONN *, int); // return visual of root window of screen N (LX_VISUAL_None if error) // conn, N extern LX_XID lx_root_visual(LX_CONN *, int); // return default colormap of screen N (LX_COLORMAP_None if error) // conn, N extern LX_XID lx_root_colormap(LX_CONN *, int); // return width in pixels of screen N (0 if error) // conn, N extern unsigned int lx_root_width(LX_CONN *, int); // return height in pixels of screen N (0 if error) // conn, N extern unsigned int lx_root_height(LX_CONN *, int); /* * Some things can take on an X resource ID or certain distinguished * values. (An example is the keyboard input focus, which can be a * window, PointerRoot, or None.) We define constants for these, with * values unrelated to their protocol values. (See the to-of-file * comment for a little on why the use of unrelated values.) */ // Distinguished values for input focus #define LX_FOCUS_None 0x20000008 #define LX_FOCUS_PointerRoot 0x20000009 #define LX_FOCUS_Parent 0x2000000a // Distinguished values for window IDs #define LX_WINDOW_None 0x2000000b #define LX_WINDOW_PointerWindow 0x200000cf #define LX_WINDOW_InputFocus 0x200000d0 // Distinguished values for pixmap IDs #define LX_PIXMAP_None 0x2000001a #define LX_PIXMAP_ParentRelative 0x2000001b #define LX_PIXMAP_CopyFromParent 0x2000001c // Distinguished values for visual IDs #define LX_VISUAL_None 0x2000000c #define LX_VISUAL_CopyFromParent 0x20000024 // Distinguished values for colormap IDs #define LX_COLORMAP_CopyFromParent 0x20000020 #define LX_COLORMAP_None 0x20000027 // Distinguished values for cursor IDs #define LX_CURSOR_None 0x20000021 // Distinguished values for CreateColormap alloc #define LX_AllocNone 0x20000025 #define LX_AllocAll 0x20000026 // Distinguished values for GC IDs #define LX_GC_None 0x2000002a // Distinguished values for GC clip-mask #define LX_GCCLIPMASK_None 0x2000002b // Distinguished values for KillClient #define LX_KILLCLIENT_AllTemporary 0x20000062 // Distinguished values for font IDs #define LX_FONT_None 0x20000081 // Distinguished values for generic resource IDs #define LX_XID_Error 0x20000082 // Flag bits for colormap operations #define LX_DO_R 0x01 #define LX_DO_G 0x02 #define LX_DO_B 0x04 #define LX_DO_ALL (LX_DO_R|LX_DO_G|LX_DO_B) /* * Handling for operations in progress. As outlined above, such * operations return LX_OP pointers. Every LX_OP pointer must * eventually be disposed of by one of: * * - Passing it to lx_op_drop. * - Passing it to lx_op_abort. * - Passing it to lx_op_callback without the LX_OP_KEEP flag. * - Calling lx_close on its XCONN pointer. * * The calls are: * * void lx_op_callback(LX_OP *op, void (*cb)(void *), void *arg, unsigned int flags) * Sets a callback and argument to be called when op completes. * See below for flags. If the LX_OP has already completed, this * calls the callback (and, if no LX_OP_KEEP, disposes of the * LX_OP) from within lx_op_callback. * * int lx_op_test(LX_OP *op) * Tests whether the request has completed, returning 0 if it has * not completed or 1 if it has. * * void lx_op_drop(LX_OP *op) * Indicates that the application no longer cares to hear * explicitly about op's completion. This also revokes any * lx_op_callback on this op. The LX_OP must not be used after * this call returns; it goes invalid at some indeterminate (from * the caller's point of view) time after entry to lx_op_drop(). * * Any output arguments passed to the relevant call will still be * written as normal; the only thing lx_op_drop does is cause no * explicit notification of completion. (Compare to lx_op_abort.) * * void lx_op_abort(LX_OP *op) * Indicates that the application no longer cares about op at all. * This has the effects of lx_op_drop, but also cancels writing of * any output arguments which were passed to the relevant call. * (An internal version of the LX_OP is kept around internally to * the library, but only reason for doing even this much is to * handle the reply when it arrives.) * * If the request has already completed and results returned, this * simply drops the LX_OP, like lx_op_drop. But any results not * yet written before the lx_op_abort call will not be written * anywhere. * * void lx_op_set_udata(LX_OP *op, void *udata) * Sets op's user data pointer to udata. * * void *lx_op_udata(LX_OP *op) * Returns op's user data pointer. * * For lx_op_callback, the flags argument selects optional behaviour: * * LX_OP_KEEP * By default, lx_op_callback performs the equivalent of * lx_op_drop on the LX_OP once it completes. If * LX_OP_KEEP is set in the flags word, the LX_OP remains * valid. (To dispose of an LX_OP that is done but which * was kept this way, use lx_op_drop().) * * lx_op_callback, lx_op_drop, and lx_op_abort will accept a nil LX_OP * pointer; they do nothing in this case. (This is to tolerate cases * where request calls return a nil pointer; while that happens only * on error, some applications may want to handle such errors.) */ #define LX_OP_KEEP 0x00000001 extern void lx_op_callback(LX_OP *, void (*)(void *), void *, unsigned int); extern int lx_op_test(LX_OP *); extern void lx_op_drop(LX_OP *); extern void lx_op_abort(LX_OP *); extern void lx_op_set_udata(LX_OP *, void *); extern void *lx_op_udata(LX_OP *); /* * Handling for host lists. * * Host lists are, conceptually, lists of host addresses. They are * stored in an opaque type LX_HOSTLIST. Such lists are created by * lx_ListHosts and freed by lx_hostlist_free. Each entry on the list * consists of a type and a data blob; the size of the data blob can * vary from entry to entry, though for most types it depends on only * the type. * * Given a host list, lx_hostlist_entries returns the number of entries * on it. For N from 0 to one less than that number, * lx_hostlist_entry_type returns the entry's type, * lx_hostlist_entry_size returns its size, and lx_hostlist_entry_data * returns a pointer to its data. If passed an out-of-range index, * lx_hostlist_entry_type returns LX_HOSTTYPE_Error, * lx_hostlist_entry_size returns -1, and lx_hostlist_entry_data * returns a nil pointer. * * It is up to the application to interpret the data appropriately for * the type. * * Host type LX_HOSTTYPE_Other is used for unrecognized host types. * The host type on the wire appears as an additional byte at the * beginning of the data. */ extern void lx_hostlist_free(LX_HOSTLIST *); extern int lx_hostlist_entries(const LX_HOSTLIST *); extern LX_HOSTTYPE lx_hostlist_entry_type(const LX_HOSTLIST *, int); extern int lx_hostlist_entry_size(const LX_HOSTLIST *, int); extern const void *lx_hostlist_entry_data(const LX_HOSTLIST *, int); /* * Handling for string lists. * * String lists are, conceptually, lists of strings (eg, extension * names). They are stored in an opaque type LX_STRLIST. Such lists * are created by lx_ListExtensions and similar functions and freed by * lx_strlist_free. Each entry on the list consists of a length and a * string; the length can vary from entry to entry. * * Given a string list, lx_strlist_entries returns the number of entries * on it. For N from 0 to one less than that number, * lx_strlist_entry_len returns the entry's length and * lx_strlist_entry_data returns a pointer to its string. The string * will have a '\0' appended to what the server returned; it is not * included in the length. If passed an out-of-range index, * lx_strlist_entry_len returns -1 and lx_strlist_entry_data returns a * nil pointer. */ extern void lx_strlist_free(LX_STRLIST *); extern int lx_strlist_entries(const LX_STRLIST *); extern int lx_strlist_entry_len(const LX_STRLIST *, int); extern const void *lx_strlist_entry_data(const LX_STRLIST *, int); /* * Handling for resource ID lists. * * Resource ID lists are, conceptually, lists of LX_XIDs (eg, windows). * They are stored in an opaque type LX_XIDLIST. Such lists are * created by lx_ListInstalledColormaps and similar functions and * freed by lx_XIDlist_free. Each entry on the list consists of a * resource ID, an LX_XID. * * Given a resource ID list, lx_XIDlist_entries returns the number of * entries on it. For N from 0 to one less than that number, * lx_XIDlist_entry_id returns the entry's ID. If passed an * out-of-range index, lx_XIDlist_entry_id returns LX_XID_Error. */ extern void lx_XIDlist_free(LX_XIDLIST *); extern int lx_XIDlist_entries(const LX_XIDLIST *); extern LX_XID lx_XIDlist_entry_id(const LX_XIDLIST *, int); /* * Event handlers. */ extern void (*lx_set_event_handler(LX_CONN *, void (*)(LX_CONN *, LX_EVENT *)))(LX_CONN *, LX_EVENT *); /* * lx_abort() is a somewhat odd case. It is an interface which lx * calls but the application can, optionally, provide. It is called * in a few circumstances that should never happen, such as when the * library bugchecks. If the application defines lx_abort(), the * library will call it in these circumstances. Otherwise, it will * call a version of its own which calls abort(). * * lx_abort() normally should not return. If it ever does, the library * tries to do something reasonable, but no promises are made about * precisely what. */ extern void lx_abort(void); /* * Implementation support for the LX_OPEN_* macros. */ #define LX__OPEN_END (-1700) #define LX__OPEN_ERR (-1701) #define LX__OPEN_CB (-1702) #define LX__OPEN_USE_LOOP (-1703) #define LX__OPEN_NO_PREAMBLE (-1704) #define LX__OPEN_DEBUG (-1705) /* * Implementation support for the LX_CWV_* macros. */ #define LX__CWV_BackPixmap (-1750) #define LX__CWV_BackPixel (-1751) #define LX__CWV_BorderPixmap (-1752) #define LX__CWV_BorderPixel (-1753) #define LX__CWV_BitGravity (-1754) #define LX__CWV_WinGravity (-1755) #define LX__CWV_BackingStore (-1756) #define LX__CWV_BackingPlanes (-1757) #define LX__CWV_BackingPixel (-1758) #define LX__CWV_OverrideRedirect (-1759) #define LX__CWV_SaveUnder (-1760) #define LX__CWV_EventMask (-1761) #define LX__CWV_DontPropagate (-1762) #define LX__CWV_Colormap (-1763) #define LX__CWV_Cursor (-1764) #define LX__CWV_X (-1765) #define LX__CWV_Y (-1766) #define LX__CWV_W (-1767) #define LX__CWV_H (-1768) #define LX__CWV_BorderWidth (-1769) #define LX__CWV_Sibling (-1770) #define LX__CWV_StackMode (-1771) #define LX__CWV_END (-1772) /* * Implementation support for the LX_GCV_* macros. */ #define LX__GCV_Function (-1800) #define LX__GCV_PlaneMask (-1801) #define LX__GCV_Foreground (-1802) #define LX__GCV_Background (-1803) #define LX__GCV_LineWidth (-1804) #define LX__GCV_LineStyle (-1805) #define LX__GCV_CapStyle (-1806) #define LX__GCV_JoinStyle (-1807) #define LX__GCV_FillStyle (-1808) #define LX__GCV_FillRule (-1809) #define LX__GCV_Tile (-1810) #define LX__GCV_Stipple (-1811) #define LX__GCV_TileStipXOrigin (-1812) #define LX__GCV_TileStipYOrigin (-1813) #define LX__GCV_Font (-1814) #define LX__GCV_SubwindowMode (-1815) #define LX__GCV_GraphicsExposures (-1816) #define LX__GCV_ClipXOrigin (-1817) #define LX__GCV_ClipYOrigin (-1818) #define LX__GCV_ClipMask (-1819) #define LX__GCV_DashOffset (-1820) #define LX__GCV_Dashes (-1821) #define LX__GCV_ArcMode (-1822) #define LX__GCV_END (-1823) /* * Implementation support for the LX_KCV_* macros. */ #define LX__KCV_KeyClickPercent (-1850) #define LX__KCV_BellPercent (-1851) #define LX__KCV_BellPitch (-1852) #define LX__KCV_BellDuration (-1853) #define LX__KCV_LED (-1854) #define LX__KCV_Repeat (-1855) #define LX__KCV_END (-1856) /* * Arglist converters. */ #ifndef LX__EXTERN_INLINE #define LX__EXTERN_INLINE extern inline #endif extern char **lx__cvt_char_p_p(char **); LX__EXTERN_INLINE char **lx__cvt_char_p_p(char **arg) { return(arg); } extern void *lx__cvt_void_p(void *); LX__EXTERN_INLINE void *lx__cvt_void_p(void *arg) { return(arg); } extern int lx__cvt_int(int); LX__EXTERN_INLINE int lx__cvt_int(int arg) { return(arg); } extern AIO_LOOP *lx__cvt_AIO_LOOP_p(AIO_LOOP *); LX__EXTERN_INLINE AIO_LOOP *lx__cvt_AIO_LOOP_p(AIO_LOOP *arg) { return(arg); } extern unsigned long int lx__cvt_LX_XID(LX_XID); LX__EXTERN_INLINE unsigned long int lx__cvt_LX_XID(LX_XID arg) { return(arg); } extern int lx__cvt_bool(int); LX__EXTERN_INLINE int lx__cvt_bool(int arg) { return(arg); } extern unsigned int lx__cvt_mask(unsigned int); LX__EXTERN_INLINE unsigned int lx__cvt_mask(unsigned int arg) { return(arg); } extern unsigned int lx__cvt_pixel(unsigned int); LX__EXTERN_INLINE unsigned int lx__cvt_pixel(unsigned int arg) { return(arg); } /* * Reverse mapping for 0x20000000-and-up values. This is here to serve * as a registry, to make it harder to accidentally allocate the same * value to multiple names. * 0x20000001 LX_IBO_LSBFirst 0x20000002 LX_IBO_MSBFirst 0x20000003 LX_BBO_LeastSignificant 0x20000004 LX_BBO_MostSignificant 0x20000005 LX_WCLASS_InputOutput 0x20000006 LX_WCLASS_InputOnly 0x20000007 LX_WCLASS_CopyFromParent 0x20000008 LX_FOCUS_None 0x20000009 LX_FOCUS_PointerRoot 0x2000000a LX_FOCUS_Parent 0x2000000b LX_WINDOW_None 0x2000000c LX_VISUAL_None 0x2000000d LX_GRAVITY_NorthWest 0x2000000e LX_GRAVITY_North 0x2000000f LX_GRAVITY_NorthEast 0x20000010 LX_GRAVITY_West 0x20000011 LX_GRAVITY_Center 0x20000012 LX_GRAVITY_East 0x20000013 LX_GRAVITY_SouthWest 0x20000014 LX_GRAVITY_South 0x20000015 LX_GRAVITY_SouthEast 0x20000016 LX_GRAVITY_Static 0x20000017 LX_GRAVITY_Forget 0x20000018 LX_GRAVITY_Unmap 0x20000019 LX__map_error 0x2000001a LX_PIXMAP_None 0x2000001b LX_PIXMAP_ParentRelative 0x2000001c LX_PIXMAP_CopyFromParent 0x2000001d LX_BACKINGSTORE_NotUseful 0x2000001e LX_BACKINGSTORE_WhenMapped 0x2000001f LX_BACKINGSTORE_Always 0x20000020 LX_COLORMAP_CopyFromParent 0x20000021 LX_CURSOR_None 0x20000022 (hole) 0x20000023 (hole) 0x20000024 LX_VISUAL_CopyFromParent 0x20000025 LX_AllocNone 0x20000026 LX_AllocAll 0x20000027 LX_COLORMAP_None 0x20000028 LX_OPENSTATUS_failed 0x20000029 LX_OPENSTATUS_worked 0x2000002a LX_GC_None 0x2000002b LX_GCCLIPMASK_None 0x2000002c (hole) 0x2000002d LX_GCLINESTYLE_Solid 0x2000002e LX_GCLINESTYLE_OnOffDash 0x2000002f LX_GCLINESTYLE_DoubleDash 0x20000030 LX_GCFUNCTION_Clear 0x20000031 LX_GCFUNCTION_And 0x20000032 LX_GCFUNCTION_AndReverse 0x20000033 LX_GCFUNCTION_Copy 0x20000034 LX_GCFUNCTION_AndInverted 0x20000035 LX_GCFUNCTION_NoOp 0x20000036 LX_GCFUNCTION_Xor 0x20000037 LX_GCFUNCTION_Or 0x20000038 LX_GCFUNCTION_Nor 0x20000039 LX_GCFUNCTION_Equiv 0x2000003a LX_GCFUNCTION_Invert 0x2000003b LX_GCFUNCTION_OrReverse 0x2000003c LX_GCFUNCTION_CopyInverted 0x2000003d LX_GCFUNCTION_OrInverted 0x2000003e LX_GCFUNCTION_Nand 0x2000003f LX_GCFUNCTION_Set 0x20000040 (hole) 0x20000041 LX_GCCAPSTYLE_NotLast 0x20000042 LX_GCCAPSTYLE_Butt 0x20000043 LX_GCCAPSTYLE_Round 0x20000044 LX_GCCAPSTYLE_Projecting 0x20000045 (hole) 0x20000046 LX_GCJOINSTYLE_Miter 0x20000047 LX_GCJOINSTYLE_Round 0x20000048 LX_GCJOINSTYLE_Bevel 0x20000049 (hole) 0x2000004a LX_GCFILLSTYLE_Solid 0x2000004b LX_GCFILLSTYLE_Tiled 0x2000004c LX_GCFILLSTYLE_Stippled 0x2000004d LX_GCFILLSTYLE_OpaqueStippled 0x2000004e (hole) 0x2000004f LX_GCFILLRULE_EvenOdd 0x20000050 LX_GCFILLRULE_Winding 0x20000051 (hole) 0x20000052 LX_GCSUBWINDOWMODE_ClipByChildren 0x20000053 LX_GCSUBWINDOWMODE_IncludeInferiors 0x20000054 (hole) 0x20000055 LX_GCARCMODE_Chord 0x20000056 LX_GCARCMODE_PieSlice 0x20000057 (hole) 0x20000058 LX_COORDMODE_Origin 0x20000059 LX_COORDMODE_Previous 0x2000005a LX_MAPSTATE_Unmapped 0x2000005b LX_MAPSTATE_Unviewable 0x2000005c LX_MAPSTATE_Viewable 0x2000005d (hole) 0x2000005e LX_FORCESCREENSAVER_Reset 0x2000005f LX_FORCESCREENSAVER_Activate 0x20000060 LX_ATOM_None 0x20000061 LX_ATOM_AnyPropertyType 0x20000062 LX_KILLCLIENT_AllTemporary 0x20000063 LX_CLOSEDOWNMODE_Destroy 0x20000064 LX_CLOSEDOWNMODE_RetainPermanent 0x20000065 LX_CLOSEDOWNMODE_RetainTemporary 0x20000066 LX_ACCESSCONTROL_Disable 0x20000067 LX_ACCESSCONTROL_Enable 0x20000068 (hole) 0x20000069 LX_HOSTTYPE_IPv4 0x2000006a LX_HOSTTYPE_IPv6 0x2000006b LX_HOSTTYPE_DECnet 0x2000006c LX_HOSTTYPE_Chaos 0x2000006d LX_HOSTTYPE_Other 0x2000006e LX_HOSTTYPE_Error 0x2000006f LX_CHANGEHOSTSMODE_Insert 0x20000070 LX_CHANGEHOSTSMODE_Delete 0x20000071 LX_SSBLANKING_No 0x20000072 LX_SSBLANKING_Yes 0x20000073 LX_SSBLANKING_Default 0x20000074 (hole) 0x20000075 LX_SSEXPOSURES_No 0x20000076 LX_SSEXPOSURES_Yes 0x20000077 LX_SSEXPOSURES_Default 0x20000078 (hole) 0x20000079 LX_KBCTLLEDACTION_Off 0x2000007a LX_KBCTLLEDACTION_On 0x2000007b LX_KBCTLREPEATACTION_Off 0x2000007c LX_KBCTLREPEATACTION_On 0x2000007d LX_KBCTLREPEATACTION_Default 0x2000007e LX_SIZECLASS_Cursor 0x2000007f LX_SIZECLASS_Tile 0x20000080 LX_SIZECLASS_Stipple 0x20000081 LX_FONT_None 0x20000082 LX_XID_Error 0x20000083 LX_IMAGEFORMAT_Bitmap 0x20000084 LX_IMAGEFORMAT_XYPixmap 0x20000085 LX_IMAGEFORMAT_ZPixmap 0x20000086 LX_SHAPECLASS_Complex 0x20000087 LX_SHAPECLASS_Nonconvex 0x20000088 LX_SHAPECLASS_Convex 0x20000089 LX_RECTORDER_UnSorted 0x2000008a LX_RECTORDER_YSorted 0x2000008b LX_RECTORDER_YXSorted 0x2000008c LX_RECTORDER_YXBanded 0x2000008d LX_CHANGESAVESETMODE_Insert 0x2000008e LX_CHANGESAVESETMODE_Delete 0x2000008f LX_CIRCULATE_RaiseLowest 0x20000090 LX_CIRCULATE_LowerHighest 0x20000091 LX_STACKMODE_Above 0x20000092 LX_STACKMODE_Below 0x20000093 LX_STACKMODE_TopIf 0x20000094 LX_STACKMODE_BottomIf 0x20000095 LX_STACKMODE_Opposite 0x20000096 LX_PROPERTYMODE_Replace 0x20000097 LX_PROPERTYMODE_Prepend 0x20000098 LX_PROPERTYMODE_Append 0x20000099 LX_GRABMODE_Synchronous 0x2000009a LX_GRABMODE_Asynchronous 0x2000009b LX_GRABSTATUS_Succses 0x2000009c LX_GRABSTATUS_AlreadyGrabbed 0x2000009d LX_GRABSTATUS_InvalidTime 0x2000009e LX_GRABSTATUS_NotViewable 0x2000009f LX_GRABSTATUS_Frozen 0x200000a0 (hole) 0x200000a1 LX_ALLOWMODE_AsyncPointer 0x200000a2 LX_ALLOWMODE_SyncPointer 0x200000a3 LX_ALLOWMODE_ReplayPointer 0x200000a4 LX_ALLOWMODE_AsyncKeyboard 0x200000a5 LX_ALLOWMODE_SyncKeyboard 0x200000a6 LX_ALLOWMODE_ReplayKeyboard 0x200000a7 LX_ALLOWMODE_AsyncBoth 0x200000a8 LX_ALLOWMODE_SyncBoth 0x200000a9 LX_TEXTDIRECTION_LeftToRight 0x200000aa LX_TEXTDIRECTION_RightToLeft 0x200000ab (hole) 0x200000ac LX_MOTIONDETAIL_Normal 0x200000ad LX_MOTIONDETAIL_Hint 0x200000ae (hole) 0x200000af LX_ENTERLEAVEDETAIL_Ancestor 0x200000b0 LX_ENTERLEAVEDETAIL_Virtual 0x200000b1 LX_ENTERLEAVEDETAIL_Inferior 0x200000b2 LX_ENTERLEAVEDETAIL_Nonlinear 0x200000b3 LX_ENTERLEAVEDETAIL_NonlinearVirtual 0x200000b4 LX_ENTERLEAVEMODE_Normal 0x200000b5 LX_ENTERLEAVEMODE_Grab 0x200000b6 LX_ENTERLEAVEMODE_Ungrab 0x200000b7 LX_FOCUSDETAIL_Ancestor 0x200000b8 LX_FOCUSDETAIL_Virtual 0x200000b9 LX_FOCUSDETAIL_Inferior 0x200000ba LX_FOCUSDETAIL_Nonlinear 0x200000bb LX_FOCUSDETAIL_NonlinearVirtual 0x200000bc LX_FOCUSDETAIL_Pointer 0x200000bd LX_FOCUSDETAIL_PointerRoot 0x200000be LX_FOCUSDETAIL_None 0x200000bf LX_FOCUSMODE_Normal 0x200000c0 LX_FOCUSMODE_Grab 0x200000c1 LX_FOCUSMODE_Ungrab 0x200000c2 LX_FOCUSMODE_WhileGrabbed 0x200000c3 LX_VISIBILITYSTATE_Unobscured 0x200000c4 LX_VISIBILITYSTATE_PartiallyObscured 0x200000c5 LX_VISIBILITYSTATE_FullyObscured 0x200000c6 LX_CIRCULATEPLACE_Top 0x200000c7 LX_CIRCULATEPLACE_Bottom 0x200000c8 LX_PROPERTYSTATE_NewValue 0x200000c9 LX_PROPERTYSTATE_Deleted 0x200000ca LX_COLORMAPSTATE_Uninstalled 0x200000cb LX_COLORMAPSTATE_Installed 0x200000cc LX_MAPPINGREQUEST_Modifier 0x200000cd LX_MAPPINGREQUEST_Keyboard 0x200000ce LX_MAPPINGREQUEST_Pointer 0x200000cf LX_WINDOW_PointerWindow 0x200000d0 LX_WINDOW_InputFocus */ #endif