X11 (empty) → 1.2
raw patch · 25 files changed
+10587/−0 lines, 25 filesdep +basebuild-type:Customsetup-changed
Dependencies added: base
Files
- Graphics/X11.hs +25/−0
- Graphics/X11/Types.hsc +1679/−0
- Graphics/X11/Xlib.hs +89/−0
- Graphics/X11/Xlib/Atom.hsc +193/−0
- Graphics/X11/Xlib/Color.hs +162/−0
- Graphics/X11/Xlib/Context.hs +238/−0
- Graphics/X11/Xlib/Display.hs +231/−0
- Graphics/X11/Xlib/Event.hsc +546/−0
- Graphics/X11/Xlib/Font.hsc +250/−0
- Graphics/X11/Xlib/Misc.hsc +1262/−0
- Graphics/X11/Xlib/Region.hs +272/−0
- Graphics/X11/Xlib/Screen.hs +132/−0
- Graphics/X11/Xlib/Types.hsc +293/−0
- Graphics/X11/Xlib/Window.hs +277/−0
- LICENSE +26/−0
- Setup.hs +6/−0
- X11.buildinfo.in +6/−0
- X11.cabal +43/−0
- cbits/auxiliaries.c +11/−0
- cbits/fdset.c +4/−0
- config.mk.in +10/−0
- configure +4718/−0
- configure.ac +51/−0
- include/HsX11Config.h.in +25/−0
- include/HsXlib.h +38/−0
+ Graphics/X11.hs view
@@ -0,0 +1,25 @@+-----------------------------------------------------------------------------+-- |+-- Module : Graphics.X11+-- Copyright : (c) Alastair Reid, 1999-2003+-- License : BSD-style (see the file libraries/base/LICENSE)+-- +-- Maintainer : libraries@haskell.org+-- Stability : provisional+-- Portability : portable+--+-- A Haskell binding for the X11 libraries.+--+-----------------------------------------------------------------------------++module Graphics.X11 + ( module Graphics.X11.Types+ , module Graphics.X11.Xlib + ) where++import Graphics.X11.Types+import Graphics.X11.Xlib ++----------------------------------------------------------------+-- End+----------------------------------------------------------------
+ Graphics/X11/Types.hsc view
@@ -0,0 +1,1679 @@+-----------------------------------------------------------------------------+-- |+-- Module : Graphics.X11.Types+-- Copyright : (c) Alastair Reid, 1999-2003+-- License : BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : provisional+-- Portability : portable+--+-- A collection of type declarations for interfacing with X11.+--+-----------------------------------------------------------------------------++module Graphics.X11.Types+ (++ XID,+ Mask,+ Atom,+ VisualID,+ Time,+ Window,+ Drawable,+ Font,+ Pixmap,+ Cursor,+ Colormap,+ GContext,+ KeyCode,++ -- * Enumeration types+ -- | These types were introduced to make function types clearer.+ -- Note that the types are synonyms for 'Int', so no extra+ -- typesafety was obtained.++ -- ** Key symbols+ KeySym,++ xK_VoidSymbol,+ xK_BackSpace,+ xK_Tab,+ xK_Linefeed,+ xK_Clear,+ xK_Return,+ xK_Pause,+ xK_Scroll_Lock,+ xK_Sys_Req,+ xK_Escape,+ xK_Delete,+ xK_Multi_key,+ xK_Home,+ xK_Left,+ xK_Up,+ xK_Right,+ xK_Down,+ xK_Prior,+ xK_Page_Up,+ xK_Next,+ xK_Page_Down,+ xK_End,+ xK_Begin,+ xK_Select,+ xK_Print,+ xK_Execute,+ xK_Insert,+ xK_Undo,+ xK_Redo,+ xK_Menu,+ xK_Find,+ xK_Cancel,+ xK_Help,+ xK_Break,+ xK_Mode_switch,+ xK_script_switch,+ xK_Num_Lock,+ xK_KP_Space,+ xK_KP_Tab,+ xK_KP_Enter,+ xK_KP_F1,+ xK_KP_F2,+ xK_KP_F3,+ xK_KP_F4,+ xK_KP_Home,+ xK_KP_Left,+ xK_KP_Up,+ xK_KP_Right,+ xK_KP_Down,+ xK_KP_Prior,+ xK_KP_Page_Up,+ xK_KP_Next,+ xK_KP_Page_Down,+ xK_KP_End,+ xK_KP_Begin,+ xK_KP_Insert,+ xK_KP_Delete,+ xK_KP_Equal,+ xK_KP_Multiply,+ xK_KP_Add,+ xK_KP_Separator,+ xK_KP_Subtract,+ xK_KP_Decimal,+ xK_KP_Divide,+ xK_KP_0,+ xK_KP_1,+ xK_KP_2,+ xK_KP_3,+ xK_KP_4,+ xK_KP_5,+ xK_KP_6,+ xK_KP_7,+ xK_KP_8,+ xK_KP_9,+ xK_F1,+ xK_F2,+ xK_F3,+ xK_F4,+ xK_F5,+ xK_F6,+ xK_F7,+ xK_F8,+ xK_F9,+ xK_F10,+ xK_F11,+ xK_L1,+ xK_F12,+ xK_L2,+ xK_F13,+ xK_L3,+ xK_F14,+ xK_L4,+ xK_F15,+ xK_L5,+ xK_F16,+ xK_L6,+ xK_F17,+ xK_L7,+ xK_F18,+ xK_L8,+ xK_F19,+ xK_L9,+ xK_F20,+ xK_L10,+ xK_F21,+ xK_R1,+ xK_F22,+ xK_R2,+ xK_F23,+ xK_R3,+ xK_F24,+ xK_R4,+ xK_F25,+ xK_R5,+ xK_F26,+ xK_R6,+ xK_F27,+ xK_R7,+ xK_F28,+ xK_R8,+ xK_F29,+ xK_R9,+ xK_F30,+ xK_R10,+ xK_F31,+ xK_R11,+ xK_F32,+ xK_R12,+ xK_F33,+ xK_R13,+ xK_F34,+ xK_R14,+ xK_F35,+ xK_R15,+ xK_Shift_L,+ xK_Shift_R,+ xK_Control_L,+ xK_Control_R,+ xK_Caps_Lock,+ xK_Shift_Lock,+ xK_Meta_L,+ xK_Meta_R,+ xK_Alt_L,+ xK_Alt_R,+ xK_Super_L,+ xK_Super_R,+ xK_Hyper_L,+ xK_Hyper_R,+ xK_space,+ xK_exclam,+ xK_quotedbl,+ xK_numbersign,+ xK_dollar,+ xK_percent,+ xK_ampersand,+ xK_apostrophe,+ xK_quoteright,+ xK_parenleft,+ xK_parenright,+ xK_asterisk,+ xK_plus,+ xK_comma,+ xK_minus,+ xK_period,+ xK_slash,+ xK_0,+ xK_1,+ xK_2,+ xK_3,+ xK_4,+ xK_5,+ xK_6,+ xK_7,+ xK_8,+ xK_9,+ xK_colon,+ xK_semicolon,+ xK_less,+ xK_equal,+ xK_greater,+ xK_question,+ xK_at,+ xK_A,+ xK_B,+ xK_C,+ xK_D,+ xK_E,+ xK_F,+ xK_G,+ xK_H,+ xK_I,+ xK_J,+ xK_K,+ xK_L,+ xK_M,+ xK_N,+ xK_O,+ xK_P,+ xK_Q,+ xK_R,+ xK_S,+ xK_T,+ xK_U,+ xK_V,+ xK_W,+ xK_X,+ xK_Y,+ xK_Z,+ xK_bracketleft,+ xK_backslash,+ xK_bracketright,+ xK_asciicircum,+ xK_underscore,+ xK_grave,+ xK_quoteleft,+ xK_a,+ xK_b,+ xK_c,+ xK_d,+ xK_e,+ xK_f,+ xK_g,+ xK_h,+ xK_i,+ xK_j,+ xK_k,+ xK_l,+ xK_m,+ xK_n,+ xK_o,+ xK_p,+ xK_q,+ xK_r,+ xK_s,+ xK_t,+ xK_u,+ xK_v,+ xK_w,+ xK_x,+ xK_y,+ xK_z,+ xK_braceleft,+ xK_bar,+ xK_braceright,+ xK_asciitilde,+ xK_nobreakspace,+ xK_exclamdown,+ xK_cent,+ xK_sterling,+ xK_currency,+ xK_yen,+ xK_brokenbar,+ xK_section,+ xK_diaeresis,+ xK_copyright,+ xK_ordfeminine,+ xK_guillemotleft,+ xK_notsign,+ xK_hyphen,+ xK_registered,+ xK_macron,+ xK_degree,+ xK_plusminus,+ xK_twosuperior,+ xK_threesuperior,+ xK_acute,+ xK_mu,+ xK_paragraph,+ xK_periodcentered,+ xK_cedilla,+ xK_onesuperior,+ xK_masculine,+ xK_guillemotright,+ xK_onequarter,+ xK_onehalf,+ xK_threequarters,+ xK_questiondown,+ xK_Agrave,+ xK_Aacute,+ xK_Acircumflex,+ xK_Atilde,+ xK_Adiaeresis,+ xK_Aring,+ xK_AE,+ xK_Ccedilla,+ xK_Egrave,+ xK_Eacute,+ xK_Ecircumflex,+ xK_Ediaeresis,+ xK_Igrave,+ xK_Iacute,+ xK_Icircumflex,+ xK_Idiaeresis,+ xK_ETH,+ xK_Eth,+ xK_Ntilde,+ xK_Ograve,+ xK_Oacute,+ xK_Ocircumflex,+ xK_Otilde,+ xK_Odiaeresis,+ xK_multiply,+ xK_Ooblique,+ xK_Ugrave,+ xK_Uacute,+ xK_Ucircumflex,+ xK_Udiaeresis,+ xK_Yacute,+ xK_THORN,+ xK_Thorn,+ xK_ssharp,+ xK_agrave,+ xK_aacute,+ xK_acircumflex,+ xK_atilde,+ xK_adiaeresis,+ xK_aring,+ xK_ae,+ xK_ccedilla,+ xK_egrave,+ xK_eacute,+ xK_ecircumflex,+ xK_ediaeresis,+ xK_igrave,+ xK_iacute,+ xK_icircumflex,+ xK_idiaeresis,+ xK_eth,+ xK_ntilde,+ xK_ograve,+ xK_oacute,+ xK_ocircumflex,+ xK_otilde,+ xK_odiaeresis,+ xK_division,+ xK_oslash,+ xK_ugrave,+ xK_uacute,+ xK_ucircumflex,+ xK_udiaeresis,+ xK_yacute,+ xK_thorn,+ xK_ydiaeresis,++ -- ** Event masks+ EventMask,+ noEventMask,+ keyPressMask,+ keyReleaseMask,+ buttonPressMask,+ buttonReleaseMask,+ enterWindowMask,+ leaveWindowMask,+ pointerMotionMask,+ pointerMotionHintMask,+ button1MotionMask,+ button2MotionMask,+ button3MotionMask,+ button4MotionMask,+ button5MotionMask,+ buttonMotionMask,+ keymapStateMask,+ exposureMask,+ visibilityChangeMask,+ structureNotifyMask,+ resizeRedirectMask,+ substructureNotifyMask,+ substructureRedirectMask,+ focusChangeMask,+ propertyChangeMask,+ colormapChangeMask,+ ownerGrabButtonMask,++ -- ** Event types+ EventType,+ keyPress,+ keyRelease,+ buttonPress,+ buttonRelease,+ motionNotify,+ enterNotify,+ leaveNotify,+ focusIn,+ focusOut,+ keymapNotify,+ expose,+ graphicsExpose,+ noExpose,+ visibilityNotify,+ createNotify,+ destroyNotify,+ unmapNotify,+ mapNotify,+ mapRequest,+ reparentNotify,+ configureNotify,+ configureRequest,+ gravityNotify,+ resizeRequest,+ circulateNotify,+ circulateRequest,+ propertyNotify,+ selectionClear,+ selectionRequest,+ selectionNotify,+ colormapNotify,+ clientMessage,+ mappingNotify,+ lASTEvent,++ -- ** Modifiers+ Modifier,+ shiftMapIndex,+ lockMapIndex,+ controlMapIndex,+ mod1MapIndex,+ mod2MapIndex,+ mod3MapIndex,+ mod4MapIndex,+ mod5MapIndex,+ anyModifier,++ -- ** Key masks+ KeyMask,+ shiftMask,+ lockMask,+ controlMask,+ mod1Mask,+ mod2Mask,+ mod3Mask,+ mod4Mask,+ mod5Mask,++ -- ** Button masks+ ButtonMask,+ button1Mask,+ button2Mask,+ button3Mask,+ button4Mask,+ button5Mask,++ -- ** Buttons+ Button,+ button1,+ button2,+ button3,+ button4,+ button5,++ -- ** Notify modes+ NotifyMode,+ notifyNormal,+ notifyGrab,+ notifyUngrab,+ notifyWhileGrabbed,+ notifyHint,++ -- ** Notify details+ NotifyDetail,+ notifyAncestor,+ notifyVirtual,+ notifyInferior,+ notifyNonlinear,+ notifyNonlinearVirtual,+ notifyPointer,+ notifyPointerRoot,+ notifyDetailNone,++ -- ** Visibility+ Visibility,+ visibilityUnobscured,+ visibilityPartiallyObscured,+ visibilityFullyObscured,++ -- ** Place of window+ Place,+ placeOnTop,+ placeOnBottom,++ -- ** Protocols+ Protocol,+ familyInternet,+ familyDECnet,+ familyChaos,++ -- ** Property notification+ PropertyNotification,+ propertyNewValue,+ propertyDelete,++ -- ** Colormap notification+ ColormapNotification,+ colormapUninstalled,+ colormapInstalled,++ -- ** Grab modes+ GrabMode,+ grabModeSync,+ grabModeAsync,++ -- ** Grab status+ GrabStatus,+ grabSuccess,+ alreadyGrabbed,+ grabInvalidTime,+ grabNotViewable,+ grabFrozen,++ -- ** Allow events+ AllowEvents,+ asyncPointer,+ syncPointer,+ replayPointer,+ asyncKeyboard,+ syncKeyboard,+ replayKeyboard,+ asyncBoth,+ syncBoth,++ -- ** Focus modes+ FocusMode,+ revertToNone,+ revertToPointerRoot,+ revertToParent,++ -- ** Error codes+ ErrorCode,+ success,+ badRequest,+ badValue,+ badWindow,+ badPixmap,+ badAtom,+ badCursor,+ badFont,+ badMatch,+ badDrawable,+ badAccess,+ badAlloc,+ badColor,+ badGC,+ badIDChoice,+ badName,+ badLength,+ badImplementation,+ firstExtensionError,+ lastExtensionError,++ -- ** Return status+ Status,+ throwIfZero,++ -- ** WindowClass+ WindowClass,+ copyFromParent,+ inputOutput,+ inputOnly,++ -- ** Attribute masks+ AttributeMask,+ cWBackPixmap,+ cWBackPixel,+ cWBorderPixmap,+ cWBorderPixel,+ cWBitGravity,+ cWWinGravity,+ cWBackingStore,+ cWBackingPlanes,+ cWBackingPixel,+ cWOverrideRedirect,+ cWSaveUnder,+ cWEventMask,+ cWDontPropagate,+ cWColormap,+ cWCursor,++ -- ** Close down modes+ CloseDownMode,+ destroyAll,+ retainPermanent,+ retainTemporary,++ -- ** QueryBestSize classes+ QueryBestSizeClass,+ cursorShape,+ tileShape,+ stippleShape,++ -- ** Graphics functions+ GXFunction,+ gXclear,+ gXand,+ gXandReverse,+ gXcopy,+ gXandInverted,+ gXnoop,+ gXxor,+ gXor,+ gXnor,+ gXequiv,+ gXinvert,+ gXorReverse,+ gXcopyInverted,+ gXorInverted,+ gXnand,+ gXset,++ -- ** Line styles+ LineStyle,+ lineSolid,+ lineOnOffDash,+ lineDoubleDash,++ -- ** Cap styles+ CapStyle,+ capNotLast,+ capButt,+ capRound,+ capProjecting,++ -- ** Join styles+ JoinStyle,+ joinMiter,+ joinRound,+ joinBevel,++ -- ** Fill styles+ FillStyle,+ fillSolid,+ fillTiled,+ fillStippled,+ fillOpaqueStippled,++ -- ** Fill rules+ FillRule,+ evenOddRule,+ windingRule,++ -- ** Subwindow modes+ SubWindowMode,+ clipByChildren,+ includeInferiors,++ -- ** Coordinate modes+ CoordinateMode,+ coordModeOrigin,+ coordModePrevious,++ -- ** Polygon shapes+ PolygonShape,+ complex,+ nonconvex,+ convex,++ -- ** Arc modes+ ArcMode,+ arcChord,+ arcPieSlice,++ -- ** GC masks+ GCMask,+ gCFunction,+ gCPlaneMask,+ gCForeground,+ gCBackground,+ gCLineWidth,+ gCLineStyle,+ gCCapStyle,+ gCJoinStyle,+ gCFillStyle,+ gCFillRule,+ gCTile,+ gCStipple,+ gCTileStipXOrigin,+ gCTileStipYOrigin,+ gCFont,+ gCSubwindowMode,+ gCGraphicsExposures,+ gCClipXOrigin,+ gCClipYOrigin,+ gCClipMask,+ gCDashOffset,+ gCDashList,+ gCArcMode,+ gCLastBit,++ -- ** Circulation direction+ CirculationDirection,+ raiseLowest,+ lowerHighest,++ -- ** Byte order+ ByteOrder,+ lSBFirst,+ mSBFirst,++ -- ** ColormapAlloc+ ColormapAlloc,+ allocNone,+ allocAll,++ -- ** Mapping requests+ MappingRequest,+ mappingModifier,+ mappingKeyboard,+ mappingPointer,++ -- ** ChangeSaveSetMode+ ChangeSaveSetMode,+ setModeInsert,+ setModeDelete,++ -- ** Bit gravity+ BitGravity,+ forgetGravity,+ northWestGravity,+ northGravity,+ northEastGravity,+ westGravity,+ centerGravity,+ eastGravity,+ southWestGravity,+ southGravity,+ southEastGravity,+ staticGravity,++ -- ** Window gravity+ WindowGravity,+ unmapGravity,++ -- ** Backing store+ BackingStore,+ notUseful,+ whenMapped,+ always,+ doRed,+ doGreen,+ doBlue,++ -- ** Font direction+ FontDirection,+ fontLeftToRight,+ fontRightToLeft,++ ) where++import Data.Int+import Data.Word+import Foreign.Marshal.Error++#include "HsXlib.h"++-- ToDo: use newtype+type XID = #{type XID}+type Mask = #{type Mask}+type Atom = #{type Atom}+type VisualID = #{type VisualID}+type Time = #{type Time}++-- end platform dependency++type Window = XID+type Drawable = XID+type Font = XID+type Pixmap = XID+type Cursor = XID+type Colormap = XID+type GContext = XID++type KeyCode = Char++type KeySym = XID++#{enum KeySym,+ , xK_VoidSymbol = XK_VoidSymbol+ }++-- TTY Functions, cleverly chosen to map to ascii, for convenience of+-- programming, but could have been arbitrary (at the cost of lookup+-- tables in client code.++#{enum KeySym,+ , xK_BackSpace = XK_BackSpace+ , xK_Tab = XK_Tab+ , xK_Linefeed = XK_Linefeed+ , xK_Clear = XK_Clear+ , xK_Return = XK_Return+ , xK_Pause = XK_Pause+ , xK_Scroll_Lock = XK_Scroll_Lock+ , xK_Sys_Req = XK_Sys_Req+ , xK_Escape = XK_Escape+ , xK_Delete = XK_Delete+ }++-- International & multi-key character composition+#{enum KeySym,+ , xK_Multi_key = XK_Multi_key+ }+-- xK_Codeinput = XK_Codeinput -- Not defined for SunOS.+-- xK_SingleCandidate = XK_SingleCandidate -- Not defined for SunOS.+-- xK_MultipleCandidate = XK_MultipleCandidate -- Not defined for SunOS.+-- xK_PreviousCandidate = XK_PreviousCandidate -- Not defined for SunOS.++-- Cursor control & motion+#{enum KeySym,+ , xK_Home = XK_Home+ , xK_Left = XK_Left+ , xK_Up = XK_Up+ , xK_Right = XK_Right+ , xK_Down = XK_Down+ , xK_Prior = XK_Prior+ , xK_Page_Up = XK_Page_Up+ , xK_Next = XK_Next+ , xK_Page_Down = XK_Page_Down+ , xK_End = XK_End+ , xK_Begin = XK_Begin++ , xK_Select = XK_Select+ , xK_Print = XK_Print+ , xK_Execute = XK_Execute+ , xK_Insert = XK_Insert+ , xK_Undo = XK_Undo+ , xK_Redo = XK_Redo+ , xK_Menu = XK_Menu+ , xK_Find = XK_Find+ , xK_Cancel = XK_Cancel+ , xK_Help = XK_Help+ , xK_Break = XK_Break+ , xK_Mode_switch = XK_Mode_switch+ , xK_script_switch = XK_script_switch+ , xK_Num_Lock = XK_Num_Lock+ }++-- Keypad Functions, keypad numbers cleverly chosen to map to ascii+#{enum KeySym,+ , xK_KP_Space = XK_KP_Space+ , xK_KP_Tab = XK_KP_Tab+ , xK_KP_Enter = XK_KP_Enter+ , xK_KP_F1 = XK_KP_F1+ , xK_KP_F2 = XK_KP_F2+ , xK_KP_F3 = XK_KP_F3+ , xK_KP_F4 = XK_KP_F4+ , xK_KP_Home = XK_KP_Home+ , xK_KP_Left = XK_KP_Left+ , xK_KP_Up = XK_KP_Up+ , xK_KP_Right = XK_KP_Right+ , xK_KP_Down = XK_KP_Down+ , xK_KP_Prior = XK_KP_Prior+ , xK_KP_Page_Up = XK_KP_Page_Up+ , xK_KP_Next = XK_KP_Next+ , xK_KP_Page_Down = XK_KP_Page_Down+ , xK_KP_End = XK_KP_End+ , xK_KP_Begin = XK_KP_Begin+ , xK_KP_Insert = XK_KP_Insert+ , xK_KP_Delete = XK_KP_Delete+ , xK_KP_Equal = XK_KP_Equal+ , xK_KP_Multiply = XK_KP_Multiply+ , xK_KP_Add = XK_KP_Add+ , xK_KP_Separator = XK_KP_Separator+ , xK_KP_Subtract = XK_KP_Subtract+ , xK_KP_Decimal = XK_KP_Decimal+ , xK_KP_Divide = XK_KP_Divide++ , xK_KP_0 = XK_KP_0+ , xK_KP_1 = XK_KP_1+ , xK_KP_2 = XK_KP_2+ , xK_KP_3 = XK_KP_3+ , xK_KP_4 = XK_KP_4+ , xK_KP_5 = XK_KP_5+ , xK_KP_6 = XK_KP_6+ , xK_KP_7 = XK_KP_7+ , xK_KP_8 = XK_KP_8+ , xK_KP_9 = XK_KP_9++ , xK_F1 = XK_F1+ , xK_F2 = XK_F2+ , xK_F3 = XK_F3+ , xK_F4 = XK_F4+ , xK_F5 = XK_F5+ , xK_F6 = XK_F6+ , xK_F7 = XK_F7+ , xK_F8 = XK_F8+ , xK_F9 = XK_F9+ , xK_F10 = XK_F10+ , xK_F11 = XK_F11+ , xK_L1 = XK_L1+ , xK_F12 = XK_F12+ , xK_L2 = XK_L2+ , xK_F13 = XK_F13+ , xK_L3 = XK_L3+ , xK_F14 = XK_F14+ , xK_L4 = XK_L4+ , xK_F15 = XK_F15+ , xK_L5 = XK_L5+ , xK_F16 = XK_F16+ , xK_L6 = XK_L6+ , xK_F17 = XK_F17+ , xK_L7 = XK_L7+ , xK_F18 = XK_F18+ , xK_L8 = XK_L8+ , xK_F19 = XK_F19+ , xK_L9 = XK_L9+ , xK_F20 = XK_F20+ , xK_L10 = XK_L10+ , xK_F21 = XK_F21+ , xK_R1 = XK_R1+ , xK_F22 = XK_F22+ , xK_R2 = XK_R2+ , xK_F23 = XK_F23+ , xK_R3 = XK_R3+ , xK_F24 = XK_F24+ , xK_R4 = XK_R4+ , xK_F25 = XK_F25+ , xK_R5 = XK_R5+ , xK_F26 = XK_F26+ , xK_R6 = XK_R6+ , xK_F27 = XK_F27+ , xK_R7 = XK_R7+ , xK_F28 = XK_F28+ , xK_R8 = XK_R8+ , xK_F29 = XK_F29+ , xK_R9 = XK_R9+ , xK_F30 = XK_F30+ , xK_R10 = XK_R10+ , xK_F31 = XK_F31+ , xK_R11 = XK_R11+ , xK_F32 = XK_F32+ , xK_R12 = XK_R12+ , xK_F33 = XK_F33+ , xK_R13 = XK_R13+ , xK_F34 = XK_F34+ , xK_R14 = XK_R14+ , xK_F35 = XK_F35+ , xK_R15 = XK_R15+ }++#{enum KeySym,+ , xK_Shift_L = XK_Shift_L+ , xK_Shift_R = XK_Shift_R+ , xK_Control_L = XK_Control_L+ , xK_Control_R = XK_Control_R+ , xK_Caps_Lock = XK_Caps_Lock+ , xK_Shift_Lock = XK_Shift_Lock++ , xK_Meta_L = XK_Meta_L+ , xK_Meta_R = XK_Meta_R+ , xK_Alt_L = XK_Alt_L+ , xK_Alt_R = XK_Alt_R+ , xK_Super_L = XK_Super_L+ , xK_Super_R = XK_Super_R+ , xK_Hyper_L = XK_Hyper_L+ , xK_Hyper_R = XK_Hyper_R+ }++#{enum KeySym,+ , xK_space = XK_space+ , xK_exclam = XK_exclam+ , xK_quotedbl = XK_quotedbl+ , xK_numbersign = XK_numbersign+ , xK_dollar = XK_dollar+ , xK_percent = XK_percent+ , xK_ampersand = XK_ampersand+ , xK_apostrophe = XK_apostrophe+ , xK_quoteright = XK_quoteright+ , xK_parenleft = XK_parenleft+ , xK_parenright = XK_parenright+ , xK_asterisk = XK_asterisk+ , xK_plus = XK_plus+ , xK_comma = XK_comma+ , xK_minus = XK_minus+ , xK_period = XK_period+ , xK_slash = XK_slash+ , xK_0 = XK_0+ , xK_1 = XK_1+ , xK_2 = XK_2+ , xK_3 = XK_3+ , xK_4 = XK_4+ , xK_5 = XK_5+ , xK_6 = XK_6+ , xK_7 = XK_7+ , xK_8 = XK_8+ , xK_9 = XK_9+ , xK_colon = XK_colon+ , xK_semicolon = XK_semicolon+ , xK_less = XK_less+ , xK_equal = XK_equal+ , xK_greater = XK_greater+ , xK_question = XK_question+ , xK_at = XK_at+ , xK_A = XK_A+ , xK_B = XK_B+ , xK_C = XK_C+ , xK_D = XK_D+ , xK_E = XK_E+ , xK_F = XK_F+ , xK_G = XK_G+ , xK_H = XK_H+ , xK_I = XK_I+ , xK_J = XK_J+ , xK_K = XK_K+ , xK_L = XK_L+ , xK_M = XK_M+ , xK_N = XK_N+ , xK_O = XK_O+ , xK_P = XK_P+ , xK_Q = XK_Q+ , xK_R = XK_R+ , xK_S = XK_S+ , xK_T = XK_T+ , xK_U = XK_U+ , xK_V = XK_V+ , xK_W = XK_W+ , xK_X = XK_X+ , xK_Y = XK_Y+ , xK_Z = XK_Z+ , xK_bracketleft = XK_bracketleft+ , xK_backslash = XK_backslash+ , xK_bracketright = XK_bracketright+ , xK_asciicircum = XK_asciicircum+ , xK_underscore = XK_underscore+ , xK_grave = XK_grave+ , xK_quoteleft = XK_quoteleft+ , xK_a = XK_a+ , xK_b = XK_b+ , xK_c = XK_c+ , xK_d = XK_d+ , xK_e = XK_e+ , xK_f = XK_f+ , xK_g = XK_g+ , xK_h = XK_h+ , xK_i = XK_i+ , xK_j = XK_j+ , xK_k = XK_k+ , xK_l = XK_l+ , xK_m = XK_m+ , xK_n = XK_n+ , xK_o = XK_o+ , xK_p = XK_p+ , xK_q = XK_q+ , xK_r = XK_r+ , xK_s = XK_s+ , xK_t = XK_t+ , xK_u = XK_u+ , xK_v = XK_v+ , xK_w = XK_w+ , xK_x = XK_x+ , xK_y = XK_y+ , xK_z = XK_z+ , xK_braceleft = XK_braceleft+ , xK_bar = XK_bar+ , xK_braceright = XK_braceright+ , xK_asciitilde = XK_asciitilde+ }++#{enum KeySym,+ , xK_nobreakspace = XK_nobreakspace+ , xK_exclamdown = XK_exclamdown+ , xK_cent = XK_cent+ , xK_sterling = XK_sterling+ , xK_currency = XK_currency+ , xK_yen = XK_yen+ , xK_brokenbar = XK_brokenbar+ , xK_section = XK_section+ , xK_diaeresis = XK_diaeresis+ , xK_copyright = XK_copyright+ , xK_ordfeminine = XK_ordfeminine+ , xK_guillemotleft = XK_guillemotleft+ , xK_notsign = XK_notsign+ , xK_hyphen = XK_hyphen+ , xK_registered = XK_registered+ , xK_macron = XK_macron+ , xK_degree = XK_degree+ , xK_plusminus = XK_plusminus+ , xK_twosuperior = XK_twosuperior+ , xK_threesuperior = XK_threesuperior+ , xK_acute = XK_acute+ , xK_mu = XK_mu+ , xK_paragraph = XK_paragraph+ , xK_periodcentered = XK_periodcentered+ , xK_cedilla = XK_cedilla+ , xK_onesuperior = XK_onesuperior+ , xK_masculine = XK_masculine+ , xK_guillemotright = XK_guillemotright+ , xK_onequarter = XK_onequarter+ , xK_onehalf = XK_onehalf+ , xK_threequarters = XK_threequarters+ , xK_questiondown = XK_questiondown+ , xK_Agrave = XK_Agrave+ , xK_Aacute = XK_Aacute+ , xK_Acircumflex = XK_Acircumflex+ , xK_Atilde = XK_Atilde+ , xK_Adiaeresis = XK_Adiaeresis+ , xK_Aring = XK_Aring+ , xK_AE = XK_AE+ , xK_Ccedilla = XK_Ccedilla+ , xK_Egrave = XK_Egrave+ , xK_Eacute = XK_Eacute+ , xK_Ecircumflex = XK_Ecircumflex+ , xK_Ediaeresis = XK_Ediaeresis+ , xK_Igrave = XK_Igrave+ , xK_Iacute = XK_Iacute+ , xK_Icircumflex = XK_Icircumflex+ , xK_Idiaeresis = XK_Idiaeresis+ , xK_ETH = XK_ETH+ , xK_Eth = XK_Eth+ , xK_Ntilde = XK_Ntilde+ , xK_Ograve = XK_Ograve+ , xK_Oacute = XK_Oacute+ , xK_Ocircumflex = XK_Ocircumflex+ , xK_Otilde = XK_Otilde+ , xK_Odiaeresis = XK_Odiaeresis+ , xK_multiply = XK_multiply+ , xK_Ooblique = XK_Ooblique+ , xK_Ugrave = XK_Ugrave+ , xK_Uacute = XK_Uacute+ , xK_Ucircumflex = XK_Ucircumflex+ , xK_Udiaeresis = XK_Udiaeresis+ , xK_Yacute = XK_Yacute+ , xK_THORN = XK_THORN+ , xK_Thorn = XK_Thorn+ , xK_ssharp = XK_ssharp+ , xK_agrave = XK_agrave+ , xK_aacute = XK_aacute+ , xK_acircumflex = XK_acircumflex+ , xK_atilde = XK_atilde+ , xK_adiaeresis = XK_adiaeresis+ , xK_aring = XK_aring+ , xK_ae = XK_ae+ , xK_ccedilla = XK_ccedilla+ , xK_egrave = XK_egrave+ , xK_eacute = XK_eacute+ , xK_ecircumflex = XK_ecircumflex+ , xK_ediaeresis = XK_ediaeresis+ , xK_igrave = XK_igrave+ , xK_iacute = XK_iacute+ , xK_icircumflex = XK_icircumflex+ , xK_idiaeresis = XK_idiaeresis+ , xK_eth = XK_eth+ , xK_ntilde = XK_ntilde+ , xK_ograve = XK_ograve+ , xK_oacute = XK_oacute+ , xK_ocircumflex = XK_ocircumflex+ , xK_otilde = XK_otilde+ , xK_odiaeresis = XK_odiaeresis+ , xK_division = XK_division+ , xK_oslash = XK_oslash+ , xK_ugrave = XK_ugrave+ , xK_uacute = XK_uacute+ , xK_ucircumflex = XK_ucircumflex+ , xK_udiaeresis = XK_udiaeresis+ , xK_yacute = XK_yacute+ , xK_thorn = XK_thorn+ , xK_ydiaeresis = XK_ydiaeresis+ }++type EventMask = Mask+#{enum EventMask,+ , noEventMask = NoEventMask+ , keyPressMask = KeyPressMask+ , keyReleaseMask = KeyReleaseMask+ , buttonPressMask = ButtonPressMask+ , buttonReleaseMask = ButtonReleaseMask+ , enterWindowMask = EnterWindowMask+ , leaveWindowMask = LeaveWindowMask+ , pointerMotionMask = PointerMotionMask+ , pointerMotionHintMask = PointerMotionHintMask+ , button1MotionMask = Button1MotionMask+ , button2MotionMask = Button2MotionMask+ , button3MotionMask = Button3MotionMask+ , button4MotionMask = Button4MotionMask+ , button5MotionMask = Button5MotionMask+ , buttonMotionMask = ButtonMotionMask+ , keymapStateMask = KeymapStateMask+ , exposureMask = ExposureMask+ , visibilityChangeMask = VisibilityChangeMask+ , structureNotifyMask = StructureNotifyMask+ , resizeRedirectMask = ResizeRedirectMask+ , substructureNotifyMask = SubstructureNotifyMask+ , substructureRedirectMask = SubstructureRedirectMask+ , focusChangeMask = FocusChangeMask+ , propertyChangeMask = PropertyChangeMask+ , colormapChangeMask = ColormapChangeMask+ , ownerGrabButtonMask = OwnerGrabButtonMask+ }++type EventType = Word32+#{enum EventType,+ , keyPress = KeyPress+ , keyRelease = KeyRelease+ , buttonPress = ButtonPress+ , buttonRelease = ButtonRelease+ , motionNotify = MotionNotify+ , enterNotify = EnterNotify+ , leaveNotify = LeaveNotify+ , focusIn = FocusIn+ , focusOut = FocusOut+ , keymapNotify = KeymapNotify+ , expose = Expose+ , graphicsExpose = GraphicsExpose+ , noExpose = NoExpose+ , visibilityNotify = VisibilityNotify+ , createNotify = CreateNotify+ , destroyNotify = DestroyNotify+ , unmapNotify = UnmapNotify+ , mapNotify = MapNotify+ , mapRequest = MapRequest+ , reparentNotify = ReparentNotify+ , configureNotify = ConfigureNotify+ , configureRequest = ConfigureRequest+ , gravityNotify = GravityNotify+ , resizeRequest = ResizeRequest+ , circulateNotify = CirculateNotify+ , circulateRequest = CirculateRequest+ , propertyNotify = PropertyNotify+ , selectionClear = SelectionClear+ , selectionRequest = SelectionRequest+ , selectionNotify = SelectionNotify+ , colormapNotify = ColormapNotify+ , clientMessage = ClientMessage+ , mappingNotify = MappingNotify+ , lASTEvent = LASTEvent+ }++type Modifier = Mask+#{enum Modifier,+ , shiftMapIndex = ShiftMapIndex+ , lockMapIndex = LockMapIndex+ , controlMapIndex = ControlMapIndex+ , mod1MapIndex = Mod1MapIndex+ , mod2MapIndex = Mod2MapIndex+ , mod3MapIndex = Mod3MapIndex+ , mod4MapIndex = Mod4MapIndex+ , mod5MapIndex = Mod5MapIndex+ , anyModifier = AnyModifier+ }++type KeyMask = Modifier+#{enum KeyMask,+ , shiftMask = ShiftMask+ , lockMask = LockMask+ , controlMask = ControlMask+ , mod1Mask = Mod1Mask+ , mod2Mask = Mod2Mask+ , mod3Mask = Mod3Mask+ , mod4Mask = Mod4Mask+ , mod5Mask = Mod5Mask+ }++type ButtonMask = Modifier+#{enum ButtonMask,+ , button1Mask = Button1Mask+ , button2Mask = Button2Mask+ , button3Mask = Button3Mask+ , button4Mask = Button4Mask+ , button5Mask = Button5Mask+ }++type Button = Word32+#{enum Button,+ , button1 = Button1+ , button2 = Button2+ , button3 = Button3+ , button4 = Button4+ , button5 = Button5+ }++type NotifyMode = Int+-- NotifyNormal and NotifyHint are used as detail in XMotionEvents+#{enum NotifyMode,+ , notifyNormal = NotifyNormal+ , notifyGrab = NotifyGrab+ , notifyUngrab = NotifyUngrab+ , notifyWhileGrabbed = NotifyWhileGrabbed+ , notifyHint = NotifyHint+ }++type NotifyDetail = Int+#{enum NotifyDetail,+ , notifyAncestor = NotifyAncestor+ , notifyVirtual = NotifyVirtual+ , notifyInferior = NotifyInferior+ , notifyNonlinear = NotifyNonlinear+ , notifyNonlinearVirtual = NotifyNonlinearVirtual+ , notifyPointer = NotifyPointer+ , notifyPointerRoot = NotifyPointerRoot+ , notifyDetailNone = NotifyDetailNone+ }++type Visibility = Int+#{enum Visibility,+ , visibilityUnobscured = VisibilityUnobscured+ , visibilityPartiallyObscured = VisibilityPartiallyObscured+ , visibilityFullyObscured = VisibilityFullyObscured+ }++-- | Place of window relative to siblings+-- (used in Circulation requests or events)+type Place = Int+#{enum Place,+ , placeOnTop = PlaceOnTop+ , placeOnBottom = PlaceOnBottom+ }++type Protocol = Int+#{enum Protocol,+ , familyInternet = FamilyInternet+ , familyDECnet = FamilyDECnet+ , familyChaos = FamilyChaos+ }++type PropertyNotification = Int+#{enum PropertyNotification,+ , propertyNewValue = PropertyNewValue+ , propertyDelete = PropertyDelete+ }++type ColormapNotification = Int+#{enum ColormapNotification,+ , colormapUninstalled = ColormapUninstalled+ , colormapInstalled = ColormapInstalled+ }++-- Grab{Pointer,Button,Keyboard,Key} Modes+type GrabMode = Int+#{enum GrabMode,+ , grabModeSync = GrabModeSync+ , grabModeAsync = GrabModeAsync+ }++-- Grab{Pointer,Keyboard} reply status++type GrabStatus = Int+#{enum GrabStatus,+ , grabSuccess = GrabSuccess+ , alreadyGrabbed = AlreadyGrabbed+ , grabInvalidTime = GrabInvalidTime+ , grabNotViewable = GrabNotViewable+ , grabFrozen = GrabFrozen+ }++-- AllowEvents modes+type AllowEvents = Int+#{enum AllowEvents,+ , asyncPointer = AsyncPointer+ , syncPointer = SyncPointer+ , replayPointer = ReplayPointer+ , asyncKeyboard = AsyncKeyboard+ , syncKeyboard = SyncKeyboard+ , replayKeyboard = ReplayKeyboard+ , asyncBoth = AsyncBoth+ , syncBoth = SyncBoth+ }++-- {Set,Get}InputFocus Modes+type FocusMode = Int+#{enum FocusMode,+ , revertToNone = RevertToNone+ , revertToPointerRoot = RevertToPointerRoot+ , revertToParent = RevertToParent+ }++-- Error codes+type ErrorCode = Int+#{enum ErrorCode,+ , success = Success+ , badRequest = BadRequest+ , badValue = BadValue+ , badWindow = BadWindow+ , badPixmap = BadPixmap+ , badAtom = BadAtom+ , badCursor = BadCursor+ , badFont = BadFont+ , badMatch = BadMatch+ , badDrawable = BadDrawable+ , badAccess = BadAccess+ , badAlloc = BadAlloc+ , badColor = BadColor+ , badGC = BadGC+ , badIDChoice = BadIDChoice+ , badName = BadName+ , badLength = BadLength+ , badImplementation = BadImplementation+ , firstExtensionError = FirstExtensionError+ , lastExtensionError = LastExtensionError+ }++type Status = Int++-- |Xlib functions with return values of type @Status@ return zero on+-- failure and nonzero on success.+throwIfZero :: String -> IO Status -> IO ()+throwIfZero fn_name = throwIf_ (== 0) (const ("Error in function " ++ fn_name))++type WindowClass = Int+#{enum WindowClass,+ , copyFromParent = CopyFromParent+ , inputOutput = InputOutput+ , inputOnly = InputOnly+ }++-- Window attributes mask+type AttributeMask = Mask+#{enum AttributeMask,+ , cWBackPixmap = CWBackPixmap+ , cWBackPixel = CWBackPixel+ , cWBorderPixmap = CWBorderPixmap+ , cWBorderPixel = CWBorderPixel+ , cWBitGravity = CWBitGravity+ , cWWinGravity = CWWinGravity+ , cWBackingStore = CWBackingStore+ , cWBackingPlanes = CWBackingPlanes+ , cWBackingPixel = CWBackingPixel+ , cWOverrideRedirect = CWOverrideRedirect+ , cWSaveUnder = CWSaveUnder+ , cWEventMask = CWEventMask+ , cWDontPropagate = CWDontPropagate+ , cWColormap = CWColormap+ , cWCursor = CWCursor+ }++-- Used in ChangeCloseDownMode+type CloseDownMode = Int+#{enum CloseDownMode,+ , destroyAll = DestroyAll+ , retainPermanent = RetainPermanent+ , retainTemporary = RetainTemporary+ }++----------------------------------------------------------------+-- CURSOR STUFF+----------------------------------------------------------------++type QueryBestSizeClass = Int+#{enum QueryBestSizeClass,+ , cursorShape = CursorShape+ , tileShape = TileShape+ , stippleShape = StippleShape+ }++----------------------------------------------------------------+-- GRAPHICS DEFINITIONS+----------------------------------------------------------------++-- graphics functions, as in GC.alu++type GXFunction = Int+#{enum GXFunction,+ , gXclear = GXclear+ , gXand = GXand+ , gXandReverse = GXandReverse+ , gXcopy = GXcopy+ , gXandInverted = GXandInverted+ , gXnoop = GXnoop+ , gXxor = GXxor+ , gXor = GXor+ , gXnor = GXnor+ , gXequiv = GXequiv+ , gXinvert = GXinvert+ , gXorReverse = GXorReverse+ , gXcopyInverted = GXcopyInverted+ , gXorInverted = GXorInverted+ , gXnand = GXnand+ , gXset = GXset+ }++type LineStyle = Int+#{enum LineStyle,+ , lineSolid = LineSolid+ , lineOnOffDash = LineOnOffDash+ , lineDoubleDash = LineDoubleDash+ }++type CapStyle = Int+#{enum CapStyle,+ , capNotLast = CapNotLast+ , capButt = CapButt+ , capRound = CapRound+ , capProjecting = CapProjecting+ }++type JoinStyle = Int+#{enum JoinStyle,+ , joinMiter = JoinMiter+ , joinRound = JoinRound+ , joinBevel = JoinBevel+ }++type FillStyle = Int+#{enum FillStyle,+ , fillSolid = FillSolid+ , fillTiled = FillTiled+ , fillStippled = FillStippled+ , fillOpaqueStippled = FillOpaqueStippled+ }++type FillRule = Int+#{enum FillRule,+ , evenOddRule = EvenOddRule+ , windingRule = WindingRule+ }++type SubWindowMode = Int+#{enum SubWindowMode,+ , clipByChildren = ClipByChildren+ , includeInferiors = IncludeInferiors+ }++-- -- SetClipRectangles ordering+-- type Ordering = Int+-- {enum Ordering,+-- , unsorted = Unsorted+-- , ySorted = YSorted+-- , yXSorted = YXSorted+-- , yXBanded = YXBanded+-- }++-- CoordinateMode for drawing routines+type CoordinateMode = Int+#{enum CoordinateMode,+ , coordModeOrigin = CoordModeOrigin+ , coordModePrevious = CoordModePrevious+ }++type PolygonShape = Int+#{enum PolygonShape,+ , complex = Complex+ , nonconvex = Nonconvex+ , convex = Convex+ }++-- Arc modes for PolyFillArc+type ArcMode = Int+#{enum ArcMode,+ , arcChord = ArcChord+ , arcPieSlice = ArcPieSlice+ }++-- GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into+-- GC.stateChanges++type GCMask = Int+#{enum GCMask,+ , gCFunction = GCFunction+ , gCPlaneMask = GCPlaneMask+ , gCForeground = GCForeground+ , gCBackground = GCBackground+ , gCLineWidth = GCLineWidth+ , gCLineStyle = GCLineStyle+ , gCCapStyle = GCCapStyle+ , gCJoinStyle = GCJoinStyle+ , gCFillStyle = GCFillStyle+ , gCFillRule = GCFillRule+ , gCTile = GCTile+ , gCStipple = GCStipple+ , gCTileStipXOrigin = GCTileStipXOrigin+ , gCTileStipYOrigin = GCTileStipYOrigin+ , gCFont = GCFont+ , gCSubwindowMode = GCSubwindowMode+ , gCGraphicsExposures = GCGraphicsExposures+ , gCClipXOrigin = GCClipXOrigin+ , gCClipYOrigin = GCClipYOrigin+ , gCClipMask = GCClipMask+ , gCDashOffset = GCDashOffset+ , gCDashList = GCDashList+ , gCArcMode = GCArcMode+ , gCLastBit = GCLastBit+ }++type CirculationDirection = Int+#{enum CirculationDirection,+ , raiseLowest = RaiseLowest+ , lowerHighest = LowerHighest+ }++-- used in imageByteOrder and bitmapBitOrder+type ByteOrder = Int+#{enum ByteOrder,+ , lSBFirst = LSBFirst+ , mSBFirst = MSBFirst+ }++type ColormapAlloc = Int+#{enum ColormapAlloc,+ , allocNone = AllocNone+ , allocAll = AllocAll+ }++type MappingRequest = Int+#{enum MappingRequest,+ , mappingModifier = MappingModifier+ , mappingKeyboard = MappingKeyboard+ , mappingPointer = MappingPointer+ }++type ChangeSaveSetMode = Int+#{enum ChangeSaveSetMode,+ , setModeInsert = SetModeInsert+ , setModeDelete = SetModeDelete+ }++type BitGravity = Int+#{enum BitGravity,+ , forgetGravity = ForgetGravity+ , northWestGravity = NorthWestGravity+ , northGravity = NorthGravity+ , northEastGravity = NorthEastGravity+ , westGravity = WestGravity+ , centerGravity = CenterGravity+ , eastGravity = EastGravity+ , southWestGravity = SouthWestGravity+ , southGravity = SouthGravity+ , southEastGravity = SouthEastGravity+ , staticGravity = StaticGravity+ }++-- All the BitGravity's plus ...+type WindowGravity = Int+#{enum WindowGravity,+ , unmapGravity = UnmapGravity+ }++-- Used in CreateWindow for backing-store hint+type BackingStore = Int+#{enum BackingStore,+ , notUseful = NotUseful+ , whenMapped = WhenMapped+ , always = Always+ }++#{enum Word8,+ , doRed = DoRed+ , doGreen = DoGreen+ , doBlue = DoBlue+ }++type FontDirection = Int+#{enum FontDirection,+ , fontLeftToRight = FontLeftToRight+ , fontRightToLeft = FontRightToLeft+ }
+ Graphics/X11/Xlib.hs view
@@ -0,0 +1,89 @@+-----------------------------------------------------------------------------+-- |+-- Module : Graphics.X11.Xlib+-- Copyright : (c) Alastair Reid, 1999-2003+-- License : BSD-style (see the file libraries/base/LICENSE)+-- +-- Maintainer : libraries@haskell.org+-- Stability : provisional+-- Portability : portable+--+-- A collection of FFI declarations for interfacing with Xlib.+--+-- The library aims to provide a direct translation of the X+-- binding into Haskell so the most important documentation you+-- should read is /The Xlib Programming Manual/, available online at+-- <http://tronche.com/gui/x/xlib/>. Let me say that again because+-- it is very important. Get hold of this documentation and read it:+-- it tells you almost everything you need to know to use this library.+--+-----------------------------------------------------------------------------++module Graphics.X11.Xlib + ( -- * Conventions+ -- $conventions++ -- * Types+ module Graphics.X11.Types,+ -- module Graphics.X11.Xlib.Types,+ Display, Screen, Visual, GC, SetWindowAttributes,+ Point(..), Rectangle(..), Arc(..), Segment(..), Color(..),+ Pixel, Position, Dimension, Angle, ScreenNumber, Buffer,++ -- * X11 library functions+ module Graphics.X11.Xlib.Event,+ module Graphics.X11.Xlib.Display,+ module Graphics.X11.Xlib.Screen,+ module Graphics.X11.Xlib.Window,+ module Graphics.X11.Xlib.Context,+ module Graphics.X11.Xlib.Color,+ module Graphics.X11.Xlib.Font,+ module Graphics.X11.Xlib.Atom,+ module Graphics.X11.Xlib.Region,+ module Graphics.X11.Xlib.Misc,+ + ) where++import Graphics.X11.Types+import Graphics.X11.Xlib.Types+import Graphics.X11.Xlib.Event+import Graphics.X11.Xlib.Display+import Graphics.X11.Xlib.Screen+import Graphics.X11.Xlib.Window+import Graphics.X11.Xlib.Context+import Graphics.X11.Xlib.Color+import Graphics.X11.Xlib.Font+import Graphics.X11.Xlib.Atom+import Graphics.X11.Xlib.Region+import Graphics.X11.Xlib.Misc++{- $conventions++In translating the library, we had to change names to conform with+Haskell's lexical syntax: function names and names of constants must start+with a lowercase letter; type names must start with an uppercase letter.+The case of the remaining letters is unchanged.++In addition, we chose to take advantage of Haskell's module system to+allow us to drop common prefixes (@X@, @XA_@, etc.) attached to X11+identifiers.++We named enumeration types so that function types would be easier+to understand. For example, we added 'Status', 'WindowClass', etc.+Note that the types are synonyms for 'Int' so no extra typesafety was+obtained.++We consistently raise exceptions when a function returns an error code.+In practice, this only affects the following functions because most Xlib+functions do not return error codes: 'allocColor', 'allocNamedColor',+'fetchBuffer', 'fetchBytes', 'fontFromGC', 'getGeometry', 'getIconName',+'iconifyWindow', 'loadQueryFont', 'lookupColor', 'openDisplay',+'parseColor', 'queryBestCursor', 'queryBestSize', 'queryBestStipple',+'queryBestTile', 'rotateBuffers', 'selectInput', 'storeBuffer',+'storeBytes', 'withdrawWindow'.++-}++----------------------------------------------------------------+-- End+----------------------------------------------------------------
+ Graphics/X11/Xlib/Atom.hsc view
@@ -0,0 +1,193 @@+-----------------------------------------------------------------------------+-- |+-- Module : Graphics.X11.Xlib.Atom+-- Copyright : (c) Alastair Reid, 1999-2003+-- License : BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : provisional+-- Portability : portable+--+-- A collection of type declarations for interfacing with X11 Atoms.+--+-----------------------------------------------------------------------------++module Graphics.X11.Xlib.Atom(+ internAtom,++ pRIMARY,+ sECONDARY,+ aRC,+ aTOM,+ bITMAP,+ cARDINAL,+ cOLORMAP,+ cURSOR,+ cUT_BUFFER0,+ cUT_BUFFER1,+ cUT_BUFFER2,+ cUT_BUFFER3,+ cUT_BUFFER4,+ cUT_BUFFER5,+ cUT_BUFFER6,+ cUT_BUFFER7,+ dRAWABLE,+ fONT,+ iNTEGER,+ pIXMAP,+ pOINT,+ rECTANGLE,+ rESOURCE_MANAGER,+ rGB_COLOR_MAP,+ rGB_BEST_MAP,+ rGB_BLUE_MAP,+ rGB_DEFAULT_MAP,+ rGB_GRAY_MAP,+ rGB_GREEN_MAP,+ rGB_RED_MAP,+ sTRING,+ vISUALID,+ wINDOW,+ wM_COMMAND,+ wM_HINTS,+ wM_CLIENT_MACHINE,+ wM_ICON_NAME,+ wM_ICON_SIZE,+ wM_NAME,+ wM_NORMAL_HINTS,+ wM_SIZE_HINTS,+ wM_ZOOM_HINTS,+ mIN_SPACE,+ nORM_SPACE,+ mAX_SPACE,+ eND_SPACE,+ sUPERSCRIPT_X,+ sUPERSCRIPT_Y,+ sUBSCRIPT_X,+ sUBSCRIPT_Y,+ uNDERLINE_POSITION,+ uNDERLINE_THICKNESS,+ sTRIKEOUT_ASCENT,+ sTRIKEOUT_DESCENT,+ iTALIC_ANGLE,+ x_HEIGHT,+ qUAD_WIDTH,+ wEIGHT,+ pOINT_SIZE,+ rESOLUTION,+ cOPYRIGHT,+ nOTICE,+ fONT_NAME,+ fAMILY_NAME,+ fULL_NAME,+ cAP_HEIGHT,+ wM_CLASS,+ wM_TRANSIENT_FOR,+ lAST_PREDEFINED,++ ) where++import Graphics.X11.Types+import Graphics.X11.Xlib.Types++import Foreign.C.String++#include "HsXlib.h"++----------------------------------------------------------------+-- Atoms+----------------------------------------------------------------++-- AC, 1/9/2000: Added definition for XInternAtom++-- | interface to the X11 library function @XInternAtom()@.+internAtom :: Display -> String -> Bool -> IO Atom+internAtom display atom_name only_if_exists =+ withCString atom_name $ \ c_atom_name ->+ xInternAtom display c_atom_name only_if_exists+foreign import ccall unsafe "XInternAtom"+ xInternAtom :: Display -> CString -> Bool -> IO Atom++-- XInternAtoms omitted+-- XGetAtomName omitted+-- XGetAtomNames omitted+-- XConvertSelection omitted+-- XListProperties omitted+-- XChangeProperty omitted+-- XDeleteProperty omitted++#{enum Atom,+ , pRIMARY = XA_PRIMARY+ , sECONDARY = XA_SECONDARY+ , aRC = XA_ARC+ , aTOM = XA_ATOM+ , bITMAP = XA_BITMAP+ , cARDINAL = XA_CARDINAL+ , cOLORMAP = XA_COLORMAP+ , cURSOR = XA_CURSOR+ , cUT_BUFFER0 = XA_CUT_BUFFER0+ , cUT_BUFFER1 = XA_CUT_BUFFER1+ , cUT_BUFFER2 = XA_CUT_BUFFER2+ , cUT_BUFFER3 = XA_CUT_BUFFER3+ , cUT_BUFFER4 = XA_CUT_BUFFER4+ , cUT_BUFFER5 = XA_CUT_BUFFER5+ , cUT_BUFFER6 = XA_CUT_BUFFER6+ , cUT_BUFFER7 = XA_CUT_BUFFER7+ , dRAWABLE = XA_DRAWABLE+ , fONT = XA_FONT+ , iNTEGER = XA_INTEGER+ , pIXMAP = XA_PIXMAP+ , pOINT = XA_POINT+ , rECTANGLE = XA_RECTANGLE+ , rESOURCE_MANAGER = XA_RESOURCE_MANAGER+ , rGB_COLOR_MAP = XA_RGB_COLOR_MAP+ , rGB_BEST_MAP = XA_RGB_BEST_MAP+ , rGB_BLUE_MAP = XA_RGB_BLUE_MAP+ , rGB_DEFAULT_MAP = XA_RGB_DEFAULT_MAP+ , rGB_GRAY_MAP = XA_RGB_GRAY_MAP+ , rGB_GREEN_MAP = XA_RGB_GREEN_MAP+ , rGB_RED_MAP = XA_RGB_RED_MAP+ , sTRING = XA_STRING+ , vISUALID = XA_VISUALID+ , wINDOW = XA_WINDOW+ , wM_COMMAND = XA_WM_COMMAND+ , wM_HINTS = XA_WM_HINTS+ , wM_CLIENT_MACHINE = XA_WM_CLIENT_MACHINE+ , wM_ICON_NAME = XA_WM_ICON_NAME+ , wM_ICON_SIZE = XA_WM_ICON_SIZE+ , wM_NAME = XA_WM_NAME+ , wM_NORMAL_HINTS = XA_WM_NORMAL_HINTS+ , wM_SIZE_HINTS = XA_WM_SIZE_HINTS+ , wM_ZOOM_HINTS = XA_WM_ZOOM_HINTS+ , mIN_SPACE = XA_MIN_SPACE+ , nORM_SPACE = XA_NORM_SPACE+ , mAX_SPACE = XA_MAX_SPACE+ , eND_SPACE = XA_END_SPACE+ , sUPERSCRIPT_X = XA_SUPERSCRIPT_X+ , sUPERSCRIPT_Y = XA_SUPERSCRIPT_Y+ , sUBSCRIPT_X = XA_SUBSCRIPT_X+ , sUBSCRIPT_Y = XA_SUBSCRIPT_Y+ , uNDERLINE_POSITION = XA_UNDERLINE_POSITION+ , uNDERLINE_THICKNESS = XA_UNDERLINE_THICKNESS+ , sTRIKEOUT_ASCENT = XA_STRIKEOUT_ASCENT+ , sTRIKEOUT_DESCENT = XA_STRIKEOUT_DESCENT+ , iTALIC_ANGLE = XA_ITALIC_ANGLE+ , x_HEIGHT = XA_X_HEIGHT+ , qUAD_WIDTH = XA_QUAD_WIDTH+ , wEIGHT = XA_WEIGHT+ , pOINT_SIZE = XA_POINT_SIZE+ , rESOLUTION = XA_RESOLUTION+ , cOPYRIGHT = XA_COPYRIGHT+ , nOTICE = XA_NOTICE+ , fONT_NAME = XA_FONT_NAME+ , fAMILY_NAME = XA_FAMILY_NAME+ , fULL_NAME = XA_FULL_NAME+ , cAP_HEIGHT = XA_CAP_HEIGHT+ , wM_CLASS = XA_WM_CLASS+ , wM_TRANSIENT_FOR = XA_WM_TRANSIENT_FOR+ , lAST_PREDEFINED = XA_LAST_PREDEFINED+ }++----------------------------------------------------------------+-- End+----------------------------------------------------------------
+ Graphics/X11/Xlib/Color.hs view
@@ -0,0 +1,162 @@+-----------------------------------------------------------------------------+-- |+-- Module : Graphics.X11.Xlib.Color+-- Copyright : (c) Alastair Reid, 1999-2003+-- License : BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : provisional+-- Portability : portable+--+-- A collection of FFI declarations for interfacing with Xlib Colors.+--+-----------------------------------------------------------------------------++module Graphics.X11.Xlib.Color(++ lookupColor,+ allocNamedColor,+ allocColor,+ parseColor,+ freeColors,+ storeColor,+ queryColor,+ queryColors,+ installColormap,+ uninstallColormap,+ copyColormapAndFree,+ createColormap,+ freeColormap,++ ) where++import Graphics.X11.Types+import Graphics.X11.Xlib.Types++import Foreign+import Foreign.C++----------------------------------------------------------------+-- Color and Colormaps+----------------------------------------------------------------++-- | interface to the X11 library function @XLookupColor()@.+lookupColor :: Display -> Colormap -> String -> IO (Color, Color)+lookupColor display colormap color_name =+ withCString color_name $ \c_color_name ->+ alloca $ \ exact_def_return ->+ alloca $ \ screen_def_return -> do+ throwIfZero "lookupColor" $+ xLookupColor display colormap c_color_name+ exact_def_return screen_def_return+ exact_def <- peek exact_def_return+ screen_def <- peek screen_def_return+ return (exact_def, screen_def)+foreign import ccall unsafe "HsXlib.h XLookupColor"+ xLookupColor :: Display -> Colormap -> CString ->+ Ptr Color -> Ptr Color -> IO Status++-- | interface to the X11 library function @XAllocNamedColor()@.+allocNamedColor :: Display -> Colormap -> String -> IO (Color, Color)+allocNamedColor display colormap color_name =+ withCString color_name $ \c_color_name ->+ alloca $ \ exact_def_return ->+ alloca $ \ screen_def_return -> do+ throwIfZero "allocNamedColor" $+ xAllocNamedColor display colormap c_color_name+ exact_def_return screen_def_return+ exact_def <- peek exact_def_return+ screen_def <- peek screen_def_return+ return (exact_def, screen_def)+foreign import ccall unsafe "HsXlib.h XAllocNamedColor"+ xAllocNamedColor :: Display -> Colormap -> CString ->+ Ptr Color -> Ptr Color -> IO Status++-- | interface to the X11 library function @XAllocColor()@.+allocColor :: Display -> Colormap -> Color -> IO Color+allocColor display colormap color =+ with color $ \ color_ptr -> do+ throwIfZero "allocColor" $+ xAllocColor display colormap color_ptr+ peek color_ptr+foreign import ccall unsafe "HsXlib.h XAllocColor"+ xAllocColor :: Display -> Colormap -> Ptr Color -> IO Status++-- | interface to the X11 library function @XParseColor()@.+parseColor :: Display -> Colormap -> String -> IO Color+parseColor display colormap color_spec =+ withCString color_spec $ \ spec ->+ alloca $ \ exact_def_return -> do+ throwIfZero "parseColor" $+ xParseColor display colormap spec exact_def_return+ peek exact_def_return+foreign import ccall unsafe "HsXlib.h XParseColor"+ xParseColor :: Display -> Colormap -> CString -> Ptr Color -> IO Status++-- ToDo: Can't express relationship between arg4 and res1 properly (or arg5, res2)+-- %errfun Zero XAllocColorCells :: Display -> Colormap -> Bool -> Int -> Int -> IO (ListPixel, ListPixel) using err = XAllocColorCells(arg1,arg2,arg3,arg4_size,res1,arg5_size,res2)++-- ToDo: Can't express relationship between arg4 and res1 properly+-- %errfun Zero XAllocColorPlanes :: Display -> Colormap -> Bool -> Int -> Int -> Int -> Int IO (ListPixel, Pixel, Pixel, Pixel) using err = XAllocColorPlanes(...)++-- | interface to the X11 library function @XFreeColors()@.+freeColors :: Display -> Colormap -> [Pixel] -> Pixel -> IO ()+freeColors display colormap pixels planes =+ withArray pixels $ \ pixel_array ->+ xFreeColors display colormap pixel_array (length pixels) planes+foreign import ccall unsafe "HsXlib.h XFreeColors"+ xFreeColors :: Display -> Colormap -> Ptr Pixel -> Int -> Pixel -> IO ()++-- | interface to the X11 library function @XStoreColor()@.+storeColor :: Display -> Colormap -> Color -> IO ()+storeColor display colormap color =+ with color $ \ color_ptr ->+ xStoreColor display colormap color_ptr+foreign import ccall unsafe "HsXlib.h XStoreColor"+ xStoreColor :: Display -> Colormap -> Ptr Color -> IO ()++-- %fun XStoreColors :: Display -> Colormap -> ListColor -> IO ()+-- %code XStoreColors(arg1,arg2,arg3,arg3_size)+-- %fun XStoreNamedColor :: Display -> Colormap -> String -> Pixel -> PrimaryMask -> IO ()++-- | interface to the X11 library function @XQueryColor()@.+queryColor :: Display -> Colormap -> Color -> IO Color+queryColor display colormap color =+ with color $ \ color_ptr -> do+ xQueryColor display colormap color_ptr+ peek color_ptr+foreign import ccall unsafe "HsXlib.h XQueryColor"+ xQueryColor :: Display -> Colormap -> Ptr Color -> IO ()++-- | interface to the X11 library function @XQueryColors()@.+queryColors :: Display -> Colormap -> [Color] -> IO [Color]+queryColors display colormap colors =+ withArrayLen colors $ \ ncolors color_array -> do+ xQueryColors display colormap color_array ncolors+ peekArray ncolors color_array+foreign import ccall unsafe "HsXlib.h XQueryColors"+ xQueryColors :: Display -> Colormap -> Ptr Color -> Int -> IO ()++-- | interface to the X11 library function @XInstallColormap()@.+foreign import ccall unsafe "HsXlib.h XInstallColormap"+ installColormap :: Display -> Colormap -> IO ()++-- | interface to the X11 library function @XUninstallColormap()@.+foreign import ccall unsafe "HsXlib.h XUninstallColormap"+ uninstallColormap :: Display -> Colormap -> IO ()++-- | interface to the X11 library function @XCopyColormapAndFree()@.+foreign import ccall unsafe "HsXlib.h XCopyColormapAndFree"+ copyColormapAndFree :: Display -> Colormap -> IO Colormap++-- | interface to the X11 library function @XCreateColormap()@.+foreign import ccall unsafe "HsXlib.h XCreateColormap"+ createColormap :: Display -> Window -> Visual -> ColormapAlloc -> IO Colormap++-- | interface to the X11 library function @XFreeColormap()@.+foreign import ccall unsafe "HsXlib.h XFreeColormap"+ freeColormap :: Display -> Colormap -> IO ()++----------------------------------------------------------------+-- End+----------------------------------------------------------------
+ Graphics/X11/Xlib/Context.hs view
@@ -0,0 +1,238 @@+-----------------------------------------------------------------------------+-- |+-- Module : Graphics.X11.Xlib.Context+-- Copyright : (c) Alastair Reid, 1999-2003+-- License : BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : provisional+-- Portability : portable+--+-- A collection of FFI declarations for interfacing with Xlib Graphics+-- Contexts.+--+-----------------------------------------------------------------------------++module Graphics.X11.Xlib.Context(++ setArcMode,+ setBackground,+ setForeground,+ setFunction,+ setGraphicsExposures,+ setClipMask,+ setClipOrigin,+ setDashes,+ setFillRule,+ setFillStyle,+ setFont,+ setLineAttributes,+ setPlaneMask,+ setState,+ setStipple,+ setSubwindowMode,+ setTSOrigin,+ setTile,+ createGC,+ gContextFromGC,+ freeGC,+ flushGC,+ copyGC,++ ) where++import Graphics.X11.Types+import Graphics.X11.Xlib.Types++import Foreign+import Foreign.C++----------------------------------------------------------------+-- Graphics contexts+----------------------------------------------------------------++-- Convenience functions++-- | interface to the X11 library function @XSetArcMode()@.+foreign import ccall unsafe "HsXlib.h XSetArcMode"+ setArcMode :: Display -> GC -> ArcMode -> IO ()++-- | interface to the X11 library function @XSetBackground()@.+foreign import ccall unsafe "HsXlib.h XSetBackground"+ setBackground :: Display -> GC -> Pixel -> IO ()++-- | interface to the X11 library function @XSetForeground()@.+foreign import ccall unsafe "HsXlib.h XSetForeground"+ setForeground :: Display -> GC -> Pixel -> IO ()++-- | interface to the X11 library function @XSetFunction()@.+foreign import ccall unsafe "HsXlib.h XSetFunction"+ setFunction :: Display -> GC -> GXFunction -> IO ()++-- | interface to the X11 library function @XSetGraphicsExposures()@.+foreign import ccall unsafe "HsXlib.h XSetGraphicsExposures"+ setGraphicsExposures :: Display -> GC -> Bool -> IO ()++-- | interface to the X11 library function @XSetClipMask()@.+foreign import ccall unsafe "HsXlib.h XSetClipMask"+ setClipMask :: Display -> GC -> Pixmap -> IO ()++-- | interface to the X11 library function @XSetClipOrigin()@.+foreign import ccall unsafe "HsXlib.h XSetClipOrigin"+ setClipOrigin :: Display -> GC -> Position -> Position -> IO ()++-- XSetClipRectangles omitted because it's not clear when it's safe to delete the+-- array of rectangles++-- | interface to the X11 library function @XSetDashes()@.+setDashes :: Display -> GC -> Int -> String -> Int -> IO ()+setDashes display gc dash_offset dashes n =+ withCString dashes $ \ dash_list ->+ xSetDashes display gc dash_offset dash_list n+foreign import ccall unsafe "HsXlib.h XSetDashes"+ xSetDashes :: Display -> GC -> Int -> CString -> Int -> IO ()++-- | interface to the X11 library function @XSetFillRule()@.+foreign import ccall unsafe "HsXlib.h XSetFillRule"+ setFillRule :: Display -> GC -> FillRule -> IO ()++-- | interface to the X11 library function @XSetFillStyle()@.+foreign import ccall unsafe "HsXlib.h XSetFillStyle"+ setFillStyle :: Display -> GC -> FillStyle -> IO ()++-- | interface to the X11 library function @XSetFont()@.+foreign import ccall unsafe "HsXlib.h XSetFont"+ setFont :: Display -> GC -> Font -> IO ()++-- | interface to the X11 library function @XSetLineAttributes()@.+foreign import ccall unsafe "HsXlib.h XSetLineAttributes"+ setLineAttributes :: Display -> GC -> Int -> LineStyle ->+ CapStyle -> JoinStyle -> IO ()++-- | interface to the X11 library function @XSetPlaneMask()@.+foreign import ccall unsafe "HsXlib.h XSetPlaneMask"+ setPlaneMask :: Display -> GC -> Pixel -> IO ()++-- | interface to the X11 library function @XSetState()@.+foreign import ccall unsafe "HsXlib.h XSetState"+ setState :: Display -> GC -> Pixel -> Pixel ->+ GXFunction -> Pixel -> IO ()++-- | interface to the X11 library function @XSetStipple()@.+foreign import ccall unsafe "HsXlib.h XSetStipple"+ setStipple :: Display -> GC -> Pixmap -> IO ()++-- | interface to the X11 library function @XSetSubwindowMode()@.+foreign import ccall unsafe "HsXlib.h XSetSubwindowMode"+ setSubwindowMode :: Display -> GC -> SubWindowMode -> IO ()++-- | interface to the X11 library function @XSetTSOrigin()@.+foreign import ccall unsafe "HsXlib.h XSetTSOrigin"+ setTSOrigin :: Display -> GC -> Position -> Position -> IO ()++-- | interface to the X11 library function @XSetTile()@.+foreign import ccall unsafe "HsXlib.h XSetTile"+ setTile :: Display -> GC -> Pixmap -> IO ()++-- ToDo: create a real interface to this+-- | partial interface to the X11 library function @XCreateGC()@.+createGC :: Display -> Drawable -> IO GC+createGC display d = xCreateGC display d 0 nullPtr+foreign import ccall unsafe "HsXlib.h XCreateGC"+ xCreateGC :: Display -> Drawable -> ValueMask -> Ptr GCValues -> IO GC++type ValueMask = Word32++-- OLD:+-- %synonym : GCValueSet : Ptr+-- in rtsDummy+--+-- {%+-- typedef unsigned long GCMask; /* cf XtGCMask */+-- typedef struct _gcvalues {+-- GCMask mask;+-- XGCValues values;+-- }* GCValueSet;+-- %}+--+-- IMPURE GCValueSet emptyGCValueSet()+-- RESULT: (RETVAL = (GCValueSet) malloc(sizeof(struct _gcvalues))) ? RETVAL->mask = 0, RETVAL : RETVAL;+-- POST: RETVAL != NULL+--+-- IMPURE void setGCForeground(colour, set)+-- IN Pixel colour+-- IN GCValueSet set+-- RESULT: set->mask |= GCForeground; set->values.foreground = colour+--+-- IMPURE void setGCBackground(colour, set)+-- IN Pixel colour+-- IN GCValueSet set+-- RESULT: set->mask |= GCBackground; set->values.background = colour+--+-- IMPURE void freeGCValueSet(set)+-- IN GCValueSet set+-- RESULT: free(set)+--+-- IMPURE GC XCreateGC(display, d, set->mask, &(set->values))+-- NAME: xCreateGC+-- IN Display* display+-- IN Drawable d+-- IN GCValueSet set+--+-- IMPURE void XChangeGC(display, gc, set->mask, &(set->values))+-- NAME: xChangeGC+-- IN Display* display+-- IN GC gc+-- IN GCValueSet set+--+-- STARTH+-- -- Code that packages GCValueSets up in a clean monoidic way.+--+-- data GCSetter = GCSetter (GCValueSet -> IO ()) -- should be newtype+--+-- createGC :: Display -> Drawable -> GCSetter -> IO GC+-- createGC display d (GCSetter setter) =+-- emptyGCValueSet >>= \ set ->+-- setter set >>+-- xCreateGC display d set >>= \ gc ->+-- freeGCValueSet set >>+-- return gc+--+-- changeGC :: Display -> Drawable -> GC -> GCSetter -> IO ()+-- changeGC display d gc (GCSetter setter) =+-- emptyGCValueSet >>= \ set ->+-- setter set >>+-- xChangeGC display d set >>= \ gc ->+-- freeGCValueSet set+--+-- instance Monoid GCSetter where+-- (GCSetter m) >>> (GCSetter k)+-- = GCSetter (\ settings -> m settings >> k settings)+-- unit = GCSetter (\ _ -> return ())+--+-- set_Background :: Pixel -> GCSetter+-- set_Background c = GCSetter (setGCBackground c)+--+-- set_Foreground :: Pixel -> GCSetter+-- set_Foreground c = GCSetter (setGCForeground c)+-- ENDH++-- | interface to the X11 library function @XGContextFromGC()@.+foreign import ccall unsafe "HsXlib.h XGContextFromGC"+ gContextFromGC :: GC -> GContext++-- | interface to the X11 library function @XFreeGC()@.+foreign import ccall unsafe "HsXlib.h XFreeGC"+ freeGC :: Display -> GC -> IO ()++-- | interface to the X11 library function @XFlushGC()@.+foreign import ccall unsafe "HsXlib.h XFlushGC"+ flushGC :: Display -> GC -> IO ()++-- | interface to the X11 library function @XCopyGC()@.+foreign import ccall unsafe "HsXlib.h XCopyGC"+ copyGC :: Display -> GC -> Mask -> GC -> IO ()++----------------------------------------------------------------+-- End+----------------------------------------------------------------
+ Graphics/X11/Xlib/Display.hs view
@@ -0,0 +1,231 @@+-----------------------------------------------------------------------------+-- |+-- Module : Graphics.X11.Xlib.Display+-- Copyright : (c) Alastair Reid, 1999-2003+-- License : BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : provisional+-- Portability : portable+--+-- A collection of FFI declarations for interfacing with Xlib Displays.+--+-----------------------------------------------------------------------------++module Graphics.X11.Xlib.Display(++ allPlanes_aux,+ blackPixel,+ whitePixel,+ connectionNumber,+ defaultColormap,+ defaultGC,+ defaultDepth,+ defaultScreen,+ defaultScreenOfDisplay,+ displayHeight,+ displayHeightMM,+ displayWidth,+ displayWidthMM,+ maxRequestSize,+ displayMotionBufferSize,+ resourceManagerString,+ screenResourceString,+ displayString,+ imageByteOrder,+ protocolRevision,+ protocolVersion,+ serverVendor,+ screenCount,+ defaultVisual,+ displayCells,+ displayPlanes,+ screenOfDisplay,+ defaultRootWindow,+ rootWindow,+ qLength,+ noOp,+ openDisplay,+ closeDisplay,++ ) where++import Graphics.X11.Types+import Graphics.X11.Xlib.Types++import Foreign+import Foreign.C++----------------------------------------------------------------+-- Display+----------------------------------------------------------------++-- | interface to the X11 library function @XAllPlanes()@.+foreign import ccall unsafe "HsXlib.h XAllPlanes"+ allPlanes_aux :: Pixel++-- | interface to the X11 library function @XBlackPixel()@.+foreign import ccall unsafe "HsXlib.h XBlackPixel"+ blackPixel :: Display -> ScreenNumber -> Pixel++-- | interface to the X11 library function @XWhitePixel()@.+foreign import ccall unsafe "HsXlib.h XWhitePixel"+ whitePixel :: Display -> ScreenNumber -> Pixel++-- This may vary from one execution to another but I believe it+-- is constant during any given execution and so it can be made PURE+-- without breaking referential transparency.+--+-- Note: underneath the opaque name, it turns out that this+-- is the file descriptor. You need to know this if you want to+-- use select.++-- | interface to the X11 library function @XConnectionNumber()@.+foreign import ccall unsafe "HsXlib.h XConnectionNumber"+ connectionNumber :: Display -> Int++-- | interface to the X11 library function @XDefaultColormap()@.+foreign import ccall unsafe "HsXlib.h XDefaultColormap"+ defaultColormap :: Display -> ScreenNumber -> Colormap++-- XListDepths :: Display -> ScreenNumber -> ListInt using res1 = XListDepths(arg1,arg2,&res1_size)++-- | interface to the X11 library function @XDefaultGC()@.+foreign import ccall unsafe "HsXlib.h XDefaultGC"+ defaultGC :: Display -> ScreenNumber -> GC++-- | interface to the X11 library function @XDefaultDepth()@.+foreign import ccall unsafe "HsXlib.h XDefaultDepth"+ defaultDepth :: Display -> ScreenNumber -> Int++-- | interface to the X11 library function @XDefaultScreen()@.+foreign import ccall unsafe "HsXlib.h XDefaultScreen"+ defaultScreen :: Display -> ScreenNumber++-- | interface to the X11 library function @XDefaultScreenOfDisplay()@.+foreign import ccall unsafe "HsXlib.h XDefaultScreenOfDisplay"+ defaultScreenOfDisplay :: Display -> Screen++-- | interface to the X11 library function @XDisplayHeight()@.+foreign import ccall unsafe "HsXlib.h XDisplayHeight"+ displayHeight :: Display -> ScreenNumber -> Int++-- | interface to the X11 library function @XDisplayHeightMM()@.+foreign import ccall unsafe "HsXlib.h XDisplayHeightMM"+ displayHeightMM :: Display -> ScreenNumber -> Int++-- | interface to the X11 library function @XDisplayWidth()@.+foreign import ccall unsafe "HsXlib.h XDisplayWidth"+ displayWidth :: Display -> ScreenNumber -> Int++-- | interface to the X11 library function @XDisplayWidthMM()@.+foreign import ccall unsafe "HsXlib.h XDisplayWidthMM"+ displayWidthMM :: Display -> ScreenNumber -> Int++-- | interface to the X11 library function @XMaxRequestSize()@.+foreign import ccall unsafe "HsXlib.h XMaxRequestSize"+ maxRequestSize :: Display -> Int++-- | interface to the X11 library function @XDisplayMotionBufferSize()@.+foreign import ccall unsafe "HsXlib.h XDisplayMotionBufferSize"+ displayMotionBufferSize :: Display -> Int+--Disnae exist in X11R5 XExtendedMaxRequestSize :: Display -> Int++-- | interface to the X11 library function @XResourceManagerString()@.+resourceManagerString :: Display -> String+resourceManagerString display = xlibCString (xResourceManagerString display)+foreign import ccall unsafe "HsXlib.h XResourceManagerString"+ xResourceManagerString :: Display -> IO CString++-- | interface to the X11 library function @XScreenResourceString()@.+screenResourceString :: Screen -> String+screenResourceString screen = xlibCString (xScreenResourceString screen)+foreign import ccall unsafe "HsXlib.h XScreenResourceString"+ xScreenResourceString :: Screen -> IO CString++-- | interface to the X11 library function @XDisplayString()@.+displayString :: Display -> String+displayString display = xlibCString (xDisplayString display)+foreign import ccall unsafe "HsXlib.h XDisplayString"+ xDisplayString :: Display -> IO CString++-- | interface to the X11 library function @XImageByteOrder()@.+foreign import ccall unsafe "HsXlib.h XImageByteOrder"+ imageByteOrder :: Display -> Int++-- | interface to the X11 library function @XProtocolRevision()@.+foreign import ccall unsafe "HsXlib.h XProtocolRevision"+ protocolRevision :: Display -> Int++-- | interface to the X11 library function @XProtocolVersion()@.+foreign import ccall unsafe "HsXlib.h XProtocolVersion"+ protocolVersion :: Display -> Int++-- | interface to the X11 library function @XServerVendor()@.+serverVendor :: Display -> String+serverVendor display = xlibCString (xServerVendor display)+foreign import ccall unsafe "HsXlib.h XServerVendor"+ xServerVendor :: Display -> IO CString++--Disnae exist: XServerRelease :: Display -> Int++-- | interface to the X11 library function @XScreenCount()@.+foreign import ccall unsafe "HsXlib.h XScreenCount"+ screenCount :: Display -> Int++-- | interface to the X11 library function @XDefaultVisual()@.+foreign import ccall unsafe "HsXlib.h XDefaultVisual"+ defaultVisual :: Display -> ScreenNumber -> Visual++-- | interface to the X11 library function @XDisplayCells()@.+foreign import ccall unsafe "HsXlib.h XDisplayCells"+ displayCells :: Display -> ScreenNumber -> Int++-- | interface to the X11 library function @XDisplayPlanes()@.+foreign import ccall unsafe "HsXlib.h XDisplayPlanes"+ displayPlanes :: Display -> ScreenNumber -> Int++-- | interface to the X11 library function @XScreenOfDisplay()@.+foreign import ccall unsafe "HsXlib.h XScreenOfDisplay"+ screenOfDisplay :: Display -> ScreenNumber -> Screen++-- | interface to the X11 library function @XDefaultRootWindow()@.+foreign import ccall unsafe "HsXlib.h XDefaultRootWindow"+ defaultRootWindow :: Display -> Window++-- The following are believed to be order dependent++-- | interface to the X11 library function @XRootWindow()@.+foreign import ccall unsafe "HsXlib.h XRootWindow"+ rootWindow :: Display -> ScreenNumber -> IO Window++-- | interface to the X11 library function @XQLength()@.+foreign import ccall unsafe "HsXlib.h XQLength"+ qLength :: Display -> IO Int++-- | interface to the X11 library function @XNoOp()@.+foreign import ccall unsafe "HsXlib.h XNoOp"+ noOp :: Display -> IO ()++-- | interface to the X11 library function @XOpenDisplay()@.+openDisplay :: String -> IO Display+openDisplay name =+ withCString name $ \ c_name -> do+ display <- throwIfNull "openDisplay" (xOpenDisplay c_name)+ return (Display display)+foreign import ccall unsafe "HsXlib.h XOpenDisplay"+ xOpenDisplay :: CString -> IO (Ptr Display)++-- | interface to the X11 library function @XCloseDisplay()@.+foreign import ccall unsafe "HsXlib.h XCloseDisplay"+ closeDisplay :: Display -> IO ()++-- | convert a CString owned by Xlib to a Haskell String+xlibCString :: IO CString -> String+xlibCString act = unsafePerformIO $ do+ cs <- act+ peekCString cs++----------------------------------------------------------------+-- End+----------------------------------------------------------------
+ Graphics/X11/Xlib/Event.hsc view
@@ -0,0 +1,546 @@+{-# OPTIONS_GHC -fglasgow-exts #-}+-----------------------------------------------------------------------------+-- |+-- Module : Graphics.X11.Xlib.Event+-- Copyright : (c) Alastair Reid, 1999-2003+-- License : BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : provisional+-- Portability : portable+--+-- A collection of FFI declarations for interfacing with Xlib Events.+--+-----------------------------------------------------------------------------++module Graphics.X11.Xlib.Event(+ QueuedMode,+ queuedAlready,+ queuedAfterFlush,+ queuedAfterReading,+ XEvent,+ XEventPtr,+ allocaXEvent,+ get_EventType,+ get_Window,+ XKeyEvent,+ XKeyEventPtr,+ asKeyEvent,+ XButtonEvent,+ get_KeyEvent,+ get_ButtonEvent,+ get_MotionEvent,+ XMotionEvent,+ XExposeEvent,+ get_ExposeEvent,+ XMappingEvent,+ XConfigureEvent,+ get_ConfigureEvent,+ waitForEvent,+ gettimeofday_in_milliseconds,+ -- gettimeofday_in_milliseconds_internal,+ flush,+ sync,+ pending,+ eventsQueued,+ nextEvent,+ allowEvents,+ selectInput,+ sendEvent,+ windowEvent,+ checkWindowEvent,+ maskEvent,+ checkMaskEvent,+ checkTypedEvent,+ checkTypedWindowEvent,+ putBackEvent,+ peekEvent,+ refreshKeyboardMapping,++ ) where++import Graphics.X11.Types+import Graphics.X11.Xlib.Types+import Graphics.X11.Xlib.Display( connectionNumber )++import Foreign++#if __GLASGOW_HASKELL__+import Data.Generics+#endif++#include "HsXlib.h"++{-# CFILES cbits/fdset.c #-}++----------------------------------------------------------------+-- Events+----------------------------------------------------------------++type QueuedMode = Int+#{enum QueuedMode,+ , queuedAlready = QueuedAlready+ , queuedAfterFlush = QueuedAfterFlush+ , queuedAfterReading = QueuedAfterReading+ }++-- Because of the way the corresponding C types are defined,+-- These "structs" are somewhat unusual - they omit fields which can+-- be found in more general structs.+-- For example, XAnyEvent omits type since it is in XEvent.+-- Therefore, to get the complete contents of an event one typically+-- writes:+-- do+-- ty <- get_XEvent e+-- (serial,send_event,display,window) <- get_XAnyEvent+-- window' <- get_XDestroyWindowEvent++newtype XEvent = XEvent XEventPtr+#if __GLASGOW_HASKELL__+ deriving (Eq, Ord, Show, Typeable, Data)+#else+ deriving (Eq, Ord, Show)+#endif+type XEventPtr = Ptr XEvent++allocaXEvent :: (XEventPtr -> IO a) -> IO a+allocaXEvent = allocaBytes #{size XEvent}++get_EventType :: XEventPtr -> IO EventType+get_EventType = #{peek XEvent,type}++get_Window :: XEventPtr -> IO Window+get_Window = #{peek XAnyEvent,window}++-- %struct : XAnyEvent : XAnyEvent arg1+-- Int32 : serial # # of last request processed by server+-- Bool : send_event # true if this came from a SendEvent request+-- Display : display # Display the event was read from+-- Window : window # window on which event was requested in event mask++type XKeyEvent =+ ( Window -- root window that the event occured on+ , Window -- child window+ , Time -- milliseconds+ , Int -- pointer x, y coordinates in event window+ , Int --+ , Int -- coordinates relative to root+ , Int --+ , Modifier -- key or button mask+ , KeyCode -- detail+ , Bool -- same screen flag+ )++peekXKeyEvent :: Ptr XKeyEvent -> IO XKeyEvent+peekXKeyEvent p = do+ root <- #{peek XKeyEvent,root} p+ subwindow <- #{peek XKeyEvent,subwindow} p+ time <- #{peek XKeyEvent,time} p+ x <- #{peek XKeyEvent,x} p+ y <- #{peek XKeyEvent,y} p+ x_root <- #{peek XKeyEvent,x_root} p+ y_root <- #{peek XKeyEvent,y_root} p+ state <- #{peek XKeyEvent,state} p+ keycode <- #{peek XKeyEvent,keycode} p+ same_screen <- #{peek XKeyEvent,same_screen} p+ return (root, subwindow, time, x, y, x_root, y_root,+ state, keycode, same_screen)++get_KeyEvent :: XEventPtr -> IO XKeyEvent+get_KeyEvent p = peekXKeyEvent (castPtr p)++type XKeyEventPtr = Ptr XKeyEvent++asKeyEvent :: XEventPtr -> XKeyEventPtr+asKeyEvent = castPtr++type XButtonEvent =+ ( Window -- root window that the event occured on+ , Window -- child window+ , Time -- milliseconds+ , Int -- pointer x, y coordinates in event window+ , Int+ , Int -- coordinates relative to root+ , Int+ , Modifier -- key or button mask+ , Button -- detail+ , Bool -- same screen flag+ )++peekXButtonEvent :: Ptr XButtonEvent -> IO XButtonEvent+peekXButtonEvent p = do+ root <- #{peek XButtonEvent,root} p+ subwindow <- #{peek XButtonEvent,subwindow} p+ time <- #{peek XButtonEvent,time} p+ x <- #{peek XButtonEvent,x} p+ y <- #{peek XButtonEvent,y} p+ x_root <- #{peek XButtonEvent,x_root} p+ y_root <- #{peek XButtonEvent,y_root} p+ state <- #{peek XButtonEvent,state} p+ button <- #{peek XButtonEvent,button} p+ same_screen <- #{peek XButtonEvent,same_screen} p+ return (root, subwindow, time, x, y, x_root, y_root,+ state, button, same_screen)++get_ButtonEvent :: XEventPtr -> IO XButtonEvent+get_ButtonEvent p = peekXButtonEvent (castPtr p)++type XMotionEvent =+ ( Window -- root window that the event occured on+ , Window -- child window+ , Time -- milliseconds+ , Int -- pointer x, y coordinates in event window+ , Int+ , Int -- coordinates relative to root+ , Int+ , Modifier -- key or button mask+ , NotifyMode -- detail+ , Bool -- same screen flag+ )++peekXMotionEvent :: Ptr XMotionEvent -> IO XMotionEvent+peekXMotionEvent p = do+ root <- #{peek XMotionEvent,root} p+ subwindow <- #{peek XMotionEvent,subwindow} p+ time <- #{peek XMotionEvent,time} p+ x <- #{peek XMotionEvent,x} p+ y <- #{peek XMotionEvent,y} p+ x_root <- #{peek XMotionEvent,x_root} p+ y_root <- #{peek XMotionEvent,y_root} p+ state <- #{peek XMotionEvent,state} p+ is_hint <- #{peek XMotionEvent,is_hint} p+ same_screen <- #{peek XMotionEvent,same_screen} p+ return (root, subwindow, time, x, y, x_root, y_root,+ state, is_hint, same_screen)++get_MotionEvent :: XEventPtr -> IO XMotionEvent+get_MotionEvent p = peekXMotionEvent (castPtr p)++-- %struct : XCrossingEvent : XCrossingEvent arg1+-- Window : root # root window that the event occured on+-- Window : subwindow # child window+-- Time : time # milliseconds+-- Int : x # pointer x, y coordinates in event window+-- Int : y+-- Int : x_root # coordinates relative to root+-- Int : y_root+-- NotifyMode : mode+-- NotifyDetail : detail+-- Bool : same_screen # same screen flag+-- Bool : focus # boolean focus+-- Modifier : state # key or button mask+--+-- %struct : XFocusChangeEvent : XFocusChangeEvent arg1+-- NotifyMode : mode+-- NotifyDetail : detail+--+-- -- omitted: should be translated into bitmaps+-- -- PURE void getKeymapEvent(event)+-- -- IN XEvent* event+-- -- OUT Window window = ((XKeymapEvent*)event)->window+-- -- OUT array[32] Char key_vector = ((XKeymapEvent*)event)->key_vector+-- -- RESULT:++type XExposeEvent =+ ( Position -- x+ , Position -- y+ , Dimension -- width+ , Dimension -- height+ , Int -- count+ )++peekXExposeEvent :: Ptr XExposeEvent -> IO XExposeEvent+peekXExposeEvent p = do+ x <- #{peek XExposeEvent,x} p+ y <- #{peek XExposeEvent,y} p+ width <- #{peek XExposeEvent,width} p+ height <- #{peek XExposeEvent,height} p+ count <- #{peek XExposeEvent,count} p+ return (x, y, width, height, count)++get_ExposeEvent :: XEventPtr -> IO XExposeEvent+get_ExposeEvent p = peekXExposeEvent (castPtr p)++-- %struct : XGraphicsExposeEvent : XGraphicsExposeEvent arg1+-- Position : x+-- Position : y+-- Dimension : width .+-- Dimension : height+-- Int : count+-- Int : major_code+-- Int : minor_code+--+-- %struct : XCirculateEvent : XCirculateEvent arg1+-- Window : window+-- Place : place+--+-- %struct : XConfigureEvent : XConfigureEvent arg1+-- Window : window+-- Position : x+-- Position : y+-- Dimension : width+-- Dimension : height+-- Dimension : border_width+-- Window : above+-- Bool : override_redirect+--+-- %struct : XCreateWindowEvent : XCreateWindowEvent arg1+-- Window : window+-- Position : x+-- Position : y+-- Dimension : width+-- Dimension : height+-- Dimension : border_width+-- Bool : override_redirect+--+-- %struct : XDestroyWindowEvent : XDestroyWindowEvent arg1+-- Window : window+--+-- %struct : XGravityEvent : XGravityEvent arg1+-- Window : window+-- Position : x+-- Position : y+--+-- %struct : XMapEvent : XMapEvent arg1+-- Bool : override_redirect++type XMappingEvent =+ ( MappingRequest -- request+ , KeyCode -- first_keycode+ , Int -- count+ )++withXMappingEvent :: XMappingEvent -> (Ptr XMappingEvent -> IO a) -> IO a+withXMappingEvent event_map f =+ allocaBytes #{size XMappingEvent} $ \ event_map_ptr -> do+ pokeXMappingEvent event_map_ptr event_map+ f event_map_ptr++pokeXMappingEvent :: Ptr XMappingEvent -> XMappingEvent -> IO ()+pokeXMappingEvent p (request, first_keycode, count) = do+ #{poke XMappingEvent,request} p request+ #{poke XMappingEvent,first_keycode} p first_keycode+ #{poke XMappingEvent,count} p count++type XConfigureEvent =+ ( Position+ , Position+ , Dimension+ , Dimension+ )++peekXConfigureEvent :: Ptr XConfigureEvent -> IO XConfigureEvent+peekXConfigureEvent p = do+ x <- #{peek XConfigureEvent,x} p+ y <- #{peek XConfigureEvent,y} p+ width <- #{peek XConfigureEvent,width} p+ height <- #{peek XConfigureEvent,height} p+ return (x, y, width, height)++get_ConfigureEvent :: XEventPtr -> IO XConfigureEvent+get_ConfigureEvent p = peekXConfigureEvent (castPtr p)++-- %struct : XResizeRequestEvent : XResizeRequestEvent arg1+-- Dimension : width+-- Dimension : height+--++-- %struct : XReparentEvent : XReparentEvent arg1+-- Window : window+-- Window : parent+-- Position : x+-- Position : y+-- Bool : override_redirect+--+-- %struct : XUnmapEvent : XUnmapEvent arg1+-- Window : window+-- Bool : from_configure+--+-- %struct : XVisibilityEvent : XVisibilityEvent arg1+-- Visibility : state+--+-- %struct : XCirculateRequestEvent : XCirculateRequestEvent arg1+-- Place : place+--+-- -- omitted because valuemask looks tricky+-- -- %struct : XConfigureRequestEvent : XConfigureRequestEvent arg1+-- -- Window : window+-- -- Position : x+-- -- Position : y+-- -- Dimension : width+-- -- Dimension : height+-- -- Dimension : border_width+-- -- Window : above+-- -- StackingMethod : detail+-- -- ??? : valuemask+--+-- %struct : XMapRequestEvent : XMapRequestEvent arg1+-- Window : window+--+-- %struct : XColormapEvent : XColormapEvent arg1+-- Colormap : colormap+-- Bool : new+-- ColormapNotification : state+--+-- -- getClientMessageEvent omitted+-- -- getPropertyEvent omitted+-- -- getSelectionClearEvent omitted+-- -- getSelectionRequestEvent omitted+-- -- getSelectionEvent omitted++-- functions++-- The following is useful if you want to do a read with timeout.++-- | Reads an event with a timeout (in microseconds).+-- Returns True if timeout occurs.+waitForEvent :: Display -> Word32 -> IO Bool+waitForEvent display usecs =+ with (TimeVal (usecs `div` 1000000) (usecs `mod` 1000000)) $ \ tv_ptr ->+ allocaBytes #{size fd_set} $ \ readfds ->+ allocaBytes #{size fd_set} $ \ nofds -> do+ let fd = connectionNumber display+ fdZero readfds+ fdZero nofds+ fdSet fd readfds+ n <- select (fd+1) readfds nofds nofds tv_ptr+ return (n == 0)++newtype FdSet = FdSet (Ptr FdSet)+#if __GLASGOW_HASKELL__+ deriving (Eq, Ord, Show, Typeable, Data)+#else+ deriving (Eq, Ord, Show)+#endif++foreign import ccall unsafe "HsXlib.h" fdZero :: Ptr FdSet -> IO ()+foreign import ccall unsafe "HsXlib.h" fdSet :: Int -> Ptr FdSet -> IO ()++foreign import ccall unsafe "HsXlib.h" select ::+ Int -> Ptr FdSet -> Ptr FdSet -> Ptr FdSet -> Ptr TimeVal -> IO Int++-- | This function is somewhat compatible with Win32's @TimeGetTime()@+gettimeofday_in_milliseconds :: IO Integer+gettimeofday_in_milliseconds =+ alloca $ \ tv_ptr -> do+ rc <- gettimeofday tv_ptr nullPtr+ TimeVal sec usec <- peek tv_ptr+ return (toInteger sec * 1000 + toInteger usec `div` 1000)++data TimeVal = TimeVal Word32 Word32++instance Storable TimeVal where+ alignment _ = #{size int}+ sizeOf _ = #{size struct timeval}+ peek p = do+ sec <- #{peek struct timeval,tv_sec} p+ usec <- #{peek struct timeval,tv_usec} p+ return (TimeVal sec usec)+ poke p (TimeVal sec usec) = do+ #{poke struct timeval,tv_sec} p sec+ #{poke struct timeval,tv_usec} p usec++newtype TimeZone = TimeZone (Ptr TimeZone)+#if __GLASGOW_HASKELL__+ deriving (Eq, Ord, Show, Typeable, Data)+#else+ deriving (Eq, Ord, Show)+#endif++foreign import ccall unsafe "HsXlib.h"+ gettimeofday :: Ptr TimeVal -> Ptr TimeZone -> IO ()++-- | interface to the X11 library function @XFlush()@.+foreign import ccall unsafe "HsXlib.h XFlush"+ flush :: Display -> IO ()++-- | interface to the X11 library function @XSync()@.+foreign import ccall unsafe "HsXlib.h XSync"+ sync :: Display -> Bool -> IO ()++-- | interface to the X11 library function @XPending()@.+foreign import ccall unsafe "HsXlib.h XPending"+ pending :: Display -> IO Int++-- | interface to the X11 library function @XEventsQueued()@.+foreign import ccall unsafe "HsXlib.h XEventsQueued"+ eventsQueued :: Display -> QueuedMode -> IO Int++-- | interface to the X11 library function @XNextEvent()@.+foreign import ccall unsafe "HsXlib.h XNextEvent"+ nextEvent :: Display -> XEventPtr -> IO ()++-- | interface to the X11 library function @XAllowEvents()@.+foreign import ccall unsafe "HsXlib.h XAllowEvents"+ allowEvents :: Display -> AllowEvents -> Time -> IO ()++-- ToDo: XFree(res1) after constructing result+-- %fun XGetMotionEvents :: Display -> Window -> Time -> Time -> IO ListXTimeCoord+-- %code res1 = XGetMotionEvents(arg1,arg2,arg3,arg4,&res1_size)++-- | interface to the X11 library function @XSelectInput()@.+foreign import ccall unsafe "HsXlib.h XSelectInput"+ selectInput :: Display -> Window -> EventMask -> IO ()++-- | interface to the X11 library function @XSendEvent()@.+sendEvent :: Display -> Window -> Bool -> EventMask -> XEventPtr -> IO ()+sendEvent display w propagate event_mask event_send =+ throwIfZero "sendEvent" $+ xSendEvent display w propagate event_mask event_send+foreign import ccall unsafe "HsXlib.h XSendEvent"+ xSendEvent :: Display -> Window -> Bool -> EventMask ->+ XEventPtr -> IO Status++-- | interface to the X11 library function @XWindowEvent()@.+foreign import ccall unsafe "HsXlib.h XWindowEvent"+ windowEvent :: Display -> Window -> EventMask -> XEventPtr -> IO ()++-- | interface to the X11 library function @XCheckWindowEvent()@.+foreign import ccall unsafe "HsXlib.h XCheckWindowEvent"+ checkWindowEvent :: Display -> Window -> EventMask ->+ XEventPtr -> IO Bool++-- | interface to the X11 library function @XMaskEvent()@.+foreign import ccall unsafe "HsXlib.h XMaskEvent"+ maskEvent :: Display -> EventMask -> XEventPtr -> IO ()++-- | interface to the X11 library function @XCheckMaskEvent()@.+foreign import ccall unsafe "HsXlib.h XCheckMaskEvent"+ checkMaskEvent :: Display -> EventMask -> XEventPtr -> IO Bool++-- | interface to the X11 library function @XCheckTypedEvent()@.+foreign import ccall unsafe "HsXlib.h XCheckTypedEvent"+ checkTypedEvent :: Display -> EventType -> XEventPtr -> IO Bool++-- | interface to the X11 library function @XCheckTypedWindowEvent()@.+foreign import ccall unsafe "HsXlib.h XCheckTypedWindowEvent"+ checkTypedWindowEvent :: Display -> Window -> EventType ->+ XEventPtr -> IO Bool++-- | interface to the X11 library function @XPutBackEvent()@.+foreign import ccall unsafe "HsXlib.h XPutBackEvent"+ putBackEvent :: Display -> XEventPtr -> IO ()++-- | interface to the X11 library function @XPeekEvent()@.+foreign import ccall unsafe "HsXlib.h XPeekEvent"+ peekEvent :: Display -> XEventPtr -> IO ()++-- XFilterEvent omitted (can't find documentation)+-- XIfEvent omitted (can't pass predicates (yet))+-- XCheckIfEvent omitted (can't pass predicates (yet))+-- XPeekIfEvent omitted (can't pass predicates (yet))++-- | interface to the X11 library function @XRefreshKeyboardMapping()@.+refreshKeyboardMapping :: XMappingEvent -> IO ()+refreshKeyboardMapping event_map =+ withXMappingEvent event_map $ \ event_map_ptr ->+ xRefreshKeyboardMapping event_map_ptr+foreign import ccall unsafe "HsXlib.h XRefreshKeyboardMapping"+ xRefreshKeyboardMapping :: Ptr XMappingEvent -> IO ()++-- XSynchronize omitted (returns C function)+-- XSetAfterFunction omitted (can't pass functions (yet))++----------------------------------------------------------------+-- End+----------------------------------------------------------------
+ Graphics/X11/Xlib/Font.hsc view
@@ -0,0 +1,250 @@+{-# OPTIONS_GHC -fglasgow-exts #-}+-----------------------------------------------------------------------------+-- |+-- Module : Graphics.X11.Xlib.Font+-- Copyright : (c) Alastair Reid, 1999-2003+-- License : BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : provisional+-- Portability : portable+--+-- A collection of FFI declarations for interfacing with Xlib Fonts.+--+-----------------------------------------------------------------------------++module Graphics.X11.Xlib.Font(++ Glyph,+ queryFont,+ fontFromGC,+ loadQueryFont,+ freeFont,+ FontStruct,+ fontFromFontStruct,+ ascentFromFontStruct,+ descentFromFontStruct,+ CharStruct,+ textExtents,+ textWidth,++ ) where++#include "HsXlib.h"++import Graphics.X11.Types+import Graphics.X11.Xlib.Types++import Foreign+import Foreign.C++#if __GLASGOW_HASKELL__+import Data.Generics+#endif++----------------------------------------------------------------+-- Fonts+----------------------------------------------------------------++-- A glyph (or Char2b) is a 16 bit character identification.+-- The top 8 bits are zero in many fonts.+type Glyph = Word16++-- | pointer to an X11 @XFontStruct@ structure+newtype FontStruct = FontStruct (Ptr FontStruct)+#if __GLASGOW_HASKELL__+ deriving (Eq, Ord, Show, Typeable, Data)+#else+ deriving (Eq, Ord, Show)+#endif++-- Disnae exist: %fun LoadFont :: Display -> String -> IO Font+-- Disnae exist: %fun UnloadFont :: Display -> Font -> IO ()++-- Argument can be a Font or a GContext.+-- But, if it's a GContext, the fontStruct will use the GContext as the+-- FontID - which will cause most things to break so it's probably+-- safer using XGetGCValues to get a genuine font ID++-- | interface to the X11 library function @XQueryFont()@.+foreign import ccall unsafe "HsXlib.h XQueryFont"+ queryFont :: Display -> Font -> IO FontStruct++-- Note that this _WILL NOT WORK_ unless you have explicitly set the font.+-- I'm slowly but surely coming to the conclusion that Xlib is a pile of+-- steaming shit.++-- | interface to the X11 library function @XGetGCValues()@.+fontFromGC :: Display -> GC -> IO Font+fontFromGC display gc =+ allocaBytes #{size XGCValues} $ \ values -> do+ throwIfZero "fontFromGC" $+ xGetGCValues display gc #{const GCFont} values+ #{peek XGCValues,font} values+foreign import ccall unsafe "HsXlib.h XGetGCValues"+ xGetGCValues :: Display -> GC -> ValueMask -> Ptr GCValues -> IO Int++type ValueMask = #{type unsigned long}++-- | interface to the X11 library function @XLoadQueryFont()@.+loadQueryFont :: Display -> String -> IO FontStruct+loadQueryFont display name =+ withCString name $ \ c_name -> do+ fs <- throwIfNull "loadQueryFont" $ xLoadQueryFont display c_name+ return (FontStruct fs)+foreign import ccall unsafe "HsXlib.h XLoadQueryFont"+ xLoadQueryFont :: Display -> CString -> IO (Ptr FontStruct)++-- | interface to the X11 library function @XFreeFont()@.+foreign import ccall unsafe "HsXlib.h XFreeFont"+ freeFont :: Display -> FontStruct -> IO ()+-- %fun XSetFontPath :: Display -> ListString -> IO () using XSetFontPath(arg1,arg2,arg2_size)++fontFromFontStruct :: FontStruct -> Font+fontFromFontStruct (FontStruct fs) = unsafePerformIO $+ #{peek XFontStruct,fid} fs++ascentFromFontStruct :: FontStruct -> Int32+ascentFromFontStruct (FontStruct fs) = unsafePerformIO $+ #{peek XFontStruct,ascent} fs++descentFromFontStruct :: FontStruct -> Int32+descentFromFontStruct (FontStruct fs) = unsafePerformIO $+ #{peek XFontStruct,descent} fs++-- %prim XGetFontPath :: Display -> IO ListString+--Int r_size;+--String* r = XGetFontPath(arg1,&r_size);+-- %update(r);+--XFreeFontPath(r);+--return;++-- %prim XListFonts :: Display -> String -> Int -> IO ListString+--Int r_size;+--String *r = XListFonts(arg1,arg2,arg3,&r_size);+-- %update(r);+--XFreeFontNames(r);+--return;++-- XListFontsWithInfo omitted (no support for FontStruct yet)++-- XQueryTextExtents omitted (no support for CharStruct yet)+-- XQueryTextExtents16 omitted (no support for CharStruct yet)++-- We marshall this across right away because it's usually one-off info+type CharStruct =+ ( Int -- lbearing (origin to left edge of raster)+ , Int -- rbearing (origin to right edge of raster)+ , Int -- width (advance to next char's origin)+ , Int -- ascent (baseline to top edge of raster)+ , Int -- descent (baseline to bottom edge of raster)+ -- attributes omitted+ )++peekCharStruct :: Ptr CharStruct -> IO CharStruct+peekCharStruct p = do+ lbearing <- #{peek XCharStruct,lbearing} p+ rbearing <- #{peek XCharStruct,rbearing} p+ width <- #{peek XCharStruct,width} p+ ascent <- #{peek XCharStruct,ascent} p+ descent <- #{peek XCharStruct,descent} p+ return (fromIntegral (lbearing::CShort),+ fromIntegral (rbearing::CShort),+ fromIntegral (width::CShort),+ fromIntegral (ascent::CShort),+ fromIntegral (descent::CShort))++-- No need to put this in the IO monad - this info is essentially constant++-- | interface to the X11 library function @XTextExtents()@.+textExtents :: FontStruct -> String -> (FontDirection, Int32, Int32, CharStruct)+textExtents font_struct string = unsafePerformIO $+ withCStringLen string $ \ (c_string, nchars) ->+ alloca $ \ direction_return ->+ alloca $ \ font_ascent_return ->+ alloca $ \ font_descent_return ->+ allocaBytes #{size XCharStruct} $ \ overall_return -> do+ xTextExtents font_struct c_string nchars direction_return+ font_ascent_return font_descent_return overall_return+ direction <- peek direction_return+ ascent <- peek font_ascent_return+ descent <- peek font_descent_return+ cs <- peekCharStruct overall_return+ return (direction, ascent, descent, cs)+foreign import ccall unsafe "HsXlib.h XTextExtents"+ xTextExtents :: FontStruct -> CString -> Int ->+ Ptr FontDirection -> Ptr Int32 -> Ptr Int32 ->+ Ptr CharStruct -> IO Int++-- No need to put ths in the IO monad - this info is essentially constant++-- | interface to the X11 library function @XTextWidth()@.+textWidth :: FontStruct -> String -> Int32+textWidth font_struct string = unsafePerformIO $+ withCStringLen string $ \ (c_string, len) ->+ xTextWidth font_struct c_string len+foreign import ccall unsafe "HsXlib.h XTextWidth"+ xTextWidth :: FontStruct -> CString -> Int -> IO Int32++-- XTextExtents16 omitted+-- XTextWidth16 omitted++-- XGetFontProperty omitted+-- XFreeFontInfo omitted+-- XFreeFontNames omitted++-- XCreateFontSet omitted (no documentation available)+-- XFreeFontSet omitted (no documentation available)+-- XFontsOfFontSet omitted (no documentation available)+-- XBaseFontNameListOfFontSet omitted (no documentation available)+-- XLocaleOfFontSet omitted (no documentation available)+-- XExtentsOfFontSet omitted (no documentation available)++-- XContextDependentDrawing omitted+-- XDirectionalDependentDrawing omitted+-- XContextualDrawing omitted++-- XmbTextEscapement omitted+-- XwcTextEscapement omitted+-- XmbTextExtents omitted+-- XwcTextExtents omitted+-- XmbTextPerCharExtents omitted+-- XwcTextPerCharExtents omitted+-- XmbDrawText omitted+-- XwcDrawText omitted+-- XmbDrawString omitted+-- XwcDrawString omitted+-- XmbDrawImageString omitted+-- XwcDrawImageString omitted++-- XOpenIM omitted+-- XCloseIM omitted+-- XGetIMValues omitted+-- XSetIMValues omitted+-- DisplayOfIM omitted+-- XLocaleOfIM omitted++-- XCreateIC omitted+-- XDestroyIC omitted+-- XSetICFocus omitted+-- XUnsetICFocus omitted+-- XwcResetIC omitted+-- XmbResetIC omitted+-- XSetICValues omitted+-- XGetICValues omitted+-- XIMOfIC omitted++-- XRegisterIMInstantiateCallback omitted+-- XUnregisterIMInstantiateCallback omitted++-- XInternalConnectionNumbers omitted+-- XProcessInternalConnection omitted+-- XAddConnectionWatch omitted+-- XRemoveConnectionWatch omitted++-- XmbLookupString omitted+-- XwcLookupString omitted++----------------------------------------------------------------+-- End+----------------------------------------------------------------
+ Graphics/X11/Xlib/Misc.hsc view
@@ -0,0 +1,1262 @@+{-# OPTIONS_GHC -fglasgow-exts #-}+-----------------------------------------------------------------------------+-- |+-- Module : Graphics.X11.Xlib.Misc+-- Copyright : (c) Alastair Reid, 1999-2003+-- License : BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : provisional+-- Portability : portable+--+-- A collection of FFI declarations for interfacing with Xlib.+--+-----------------------------------------------------------------------------++module Graphics.X11.Xlib.Misc(++ rmInitialize,+ autoRepeatOff,+ autoRepeatOn,+ bell,+ setCloseDownMode,+ lastKnownRequestProcessed,+ getInputFocus,+ setInputFocus,+ grabButton,+ ungrabButton,+ grabPointer,+ ungrabPointer,+ grabKey,+ ungrabKey,+ grabKeyboard,+ ungrabKeyboard,+ grabServer,+ ungrabServer,+ queryBestTile,+ queryBestStipple,+ queryBestCursor,+ queryBestSize,+ queryPointer,++ -- * Error reporting+ displayName,+ setDefaultErrorHandler,++ -- * Geometry+ geometry,+ getGeometry,++ -- * Locale+ supportsLocale,+ setLocaleModifiers,++ -- * Screen saver+ AllowExposuresMode,+ dontAllowExposures,+ allowExposures,+ defaultExposures,+ PreferBlankingMode,+ dontPreferBlanking,+ preferBlanking,+ defaultBlanking,+ ScreenSaverMode,+ screenSaverActive,+ screenSaverReset,+ getScreenSaver,+ setScreenSaver,+ activateScreenSaver,+ resetScreenSaver,+ forceScreenSaver,++ -- * Pointer+ getPointerControl,+ warpPointer,++ -- * Pixmaps+ createPixmap,+ freePixmap,+ bitmapBitOrder,+ bitmapUnit,+ bitmapPad,++ -- * Keycodes+ displayKeycodes,+ lookupKeysym,+ keycodeToKeysym,+ keysymToKeycode,+ keysymToString,+ stringToKeysym,+ noSymbol,+ lookupString,++ -- * Icons+ getIconName,+ setIconName,++ -- * Cursors+ defineCursor,+ undefineCursor,+ createPixmapCursor,+ createGlyphCursor,+ createFontCursor,+ freeCursor,+ recolorCursor,++ -- * Window manager stuff+ setWMProtocols,++ -- * Set window attributes+ allocaSetWindowAttributes,+ set_background_pixmap,+ set_background_pixel,+ set_border_pixmap,+ set_border_pixel,+ set_bit_gravity,+ set_win_gravity,+ set_backing_store,+ set_backing_planes,+ set_backing_pixel,+ set_save_under,+ set_event_mask,+ set_do_not_propagate_mask,+ set_override_redirect,+ set_colormap,+ set_cursor,++ -- * Drawing+ drawPoint,+ drawPoints,+ drawLine,+ drawLines,+ drawSegments,+ drawRectangle,+ drawRectangles,+ drawArc,+ drawArcs,+ fillRectangle,+ fillRectangles,+ fillPolygon,+ fillArc,+ fillArcs,+ copyArea,+ copyPlane,+ drawString,+ drawImageString,++ -- * Cut and paste buffers+ storeBuffer,+ storeBytes,+ fetchBuffer,+ fetchBytes,+ rotateBuffers,++ -- * Window properties+ setTextProperty,++ ) where++import Graphics.X11.Types+import Graphics.X11.Xlib.Types+import Graphics.X11.Xlib.Atom+import Graphics.X11.Xlib.Event+import Graphics.X11.Xlib.Font++import Foreign+import Foreign.C++#if __GLASGOW_HASKELL__+import Data.Generics+#endif++#include "HsXlib.h"++-- I'm not sure why I added this since I don't have any of the related+-- functions.++-- | interface to the X11 library function @XrmInitialize()@.+foreign import ccall unsafe "HsXlib.h XrmInitialize"+ rmInitialize :: IO ()++-- %fun XGetDefault :: Display -> String -> String -> IO ()++-- | interface to the X11 library function @XAutoRepeatOff()@.+foreign import ccall unsafe "HsXlib.h XAutoRepeatOff"+ autoRepeatOff :: Display -> IO ()++-- | interface to the X11 library function @XAutoRepeatOn()@.+foreign import ccall unsafe "HsXlib.h XAutoRepeatOn"+ autoRepeatOn :: Display -> IO ()++-- | interface to the X11 library function @XBell()@.+foreign import ccall unsafe "HsXlib.h XBell"+ bell :: Display -> Int -> IO ()++-- | interface to the X11 library function @XSetCloseDownMode()@.+foreign import ccall unsafe "HsXlib.h XSetCloseDownMode"+ setCloseDownMode :: Display -> CloseDownMode -> IO ()++-- | interface to the X11 library function @XLastKnownRequestProcessed()@.+foreign import ccall unsafe "HsXlib.h XLastKnownRequestProcessed"+ lastKnownRequestProcessed :: Display -> IO Int++-- | interface to the X11 library function @XGetInputFocus()@.+getInputFocus :: Display -> IO (Window, FocusMode)+getInputFocus display =+ alloca $ \ focus_return ->+ alloca $ \ revert_to_return -> do+ xGetInputFocus display focus_return revert_to_return+ focus <- peek focus_return+ revert_to <- peek revert_to_return+ return (focus, revert_to)+foreign import ccall unsafe "HsXlib.h XGetInputFocus"+ xGetInputFocus :: Display -> Ptr Window -> Ptr FocusMode -> IO ()++-- | interface to the X11 library function @XSetInputFocus()@.+foreign import ccall unsafe "HsXlib.h XSetInputFocus"+ setInputFocus :: Display -> Window -> FocusMode -> Time -> IO ()++-- XAllocID omitted+-- XKillClient omitted+-- XFetchName omitted+-- XGetKeyboardControl omitted+-- XChangeKeyboardControl omitted+-- XChangeKeyboardMapping omitted+-- XChangePointerControl omitted++-- | interface to the X11 library function @XGrabButton()@.+foreign import ccall unsafe "HsXlib.h XGrabButton"+ grabButton :: Display -> Button -> ButtonMask -> Window -> Bool -> EventMask -> GrabMode -> GrabMode -> Window -> Cursor -> IO ()++-- | interface to the X11 library function @XUngrabButton()@.+foreign import ccall unsafe "HsXlib.h XUngrabButton"+ ungrabButton :: Display -> Button -> ButtonMask -> Window -> IO ()++-- | interface to the X11 library function @XGrabPointer()@.+foreign import ccall unsafe "HsXlib.h XGrabPointer"+ grabPointer :: Display -> Window -> Bool -> EventMask -> GrabMode -> GrabMode -> Window -> Cursor -> Time -> IO GrabStatus++-- | interface to the X11 library function @XUngrabPointer()@.+foreign import ccall unsafe "HsXlib.h XUngrabPointer"+ ungrabPointer :: Display -> Time -> IO ()++-- | interface to the X11 library function @XGrabKey()@.+foreign import ccall unsafe "HsXlib.h XGrabKey"+ grabKey :: Display -> KeyCode -> ButtonMask -> Window -> Bool -> GrabMode -> GrabMode -> IO ()++-- | interface to the X11 library function @XUngrabKey()@.+foreign import ccall unsafe "HsXlib.h XUngrabKey"+ ungrabKey :: Display -> KeyCode -> ButtonMask -> Window -> IO ()++-- | interface to the X11 library function @XGrabKeyboard()@.+foreign import ccall unsafe "HsXlib.h XGrabKeyboard"+ grabKeyboard :: Display -> Window -> Bool -> GrabMode -> GrabMode -> Time -> IO GrabStatus++-- | interface to the X11 library function @XUngrabKeyboard()@.+foreign import ccall unsafe "HsXlib.h XUngrabKeyboard"+ ungrabKeyboard :: Display -> Time -> IO ()++-- | interface to the X11 library function @XGrabServer()@.+foreign import ccall unsafe "HsXlib.h XGrabServer"+ grabServer :: Display -> IO ()++-- | interface to the X11 library function @XUngrabServer()@.+foreign import ccall unsafe "HsXlib.h XUngrabServer"+ ungrabServer :: Display -> IO ()++-- XChangeActivePointerGrab omitted++-- | interface to the X11 library function @XFree()@.+foreign import ccall unsafe "HsXlib.h XFree" xFree :: Ptr a -> IO ()++-- XFreeStringList omitted++-- | interface to the X11 library function @XQueryBestTile()@.+queryBestTile :: Display -> Drawable -> Dimension -> Dimension ->+ IO (Dimension, Dimension)+queryBestTile display which_screen width height =+ outParameters2 (throwIfZero "queryBestTile") $+ xQueryBestTile display which_screen width height+foreign import ccall unsafe "HsXlib.h XQueryBestTile"+ xQueryBestTile :: Display -> Drawable -> Dimension -> Dimension ->+ Ptr Dimension -> Ptr Dimension -> IO Status++-- | interface to the X11 library function @XQueryBestStipple()@.+queryBestStipple :: Display -> Drawable -> Dimension -> Dimension ->+ IO (Dimension, Dimension)+queryBestStipple display which_screen width height =+ outParameters2 (throwIfZero "queryBestStipple") $+ xQueryBestStipple display which_screen width height+foreign import ccall unsafe "HsXlib.h XQueryBestStipple"+ xQueryBestStipple :: Display -> Drawable -> Dimension -> Dimension ->+ Ptr Dimension -> Ptr Dimension -> IO Status++-- | interface to the X11 library function @XQueryBestCursor()@.+queryBestCursor :: Display -> Drawable -> Dimension -> Dimension ->+ IO (Dimension, Dimension)+queryBestCursor display d width height =+ outParameters2 (throwIfZero "queryBestCursor") $+ xQueryBestCursor display d width height+foreign import ccall unsafe "HsXlib.h XQueryBestCursor"+ xQueryBestCursor :: Display -> Drawable -> Dimension -> Dimension ->+ Ptr Dimension -> Ptr Dimension -> IO Status++-- | interface to the X11 library function @XQueryBestSize()@.+queryBestSize :: Display -> QueryBestSizeClass -> Drawable ->+ Dimension -> Dimension -> IO (Dimension, Dimension)+queryBestSize display shape_class which_screen width height =+ outParameters2 (throwIfZero "queryBestSize") $+ xQueryBestSize display shape_class which_screen width height+foreign import ccall unsafe "HsXlib.h XQueryBestSize"+ xQueryBestSize :: Display -> QueryBestSizeClass -> Drawable ->+ Dimension -> Dimension ->+ Ptr Dimension -> Ptr Dimension -> IO Status++-- Note: Returns false if pointer not in window w (and win_x = win_y = 0)+-- ToDo: more effective use of Maybes?++-- | interface to the X11 library function @XQueryPointer()@.+queryPointer :: Display -> Window ->+ IO (Bool, Window, Window, Int, Int, Int, Int, Modifier)+queryPointer display w =+ alloca $ \ root_return ->+ alloca $ \ child_return ->+ alloca $ \ root_x_return ->+ alloca $ \ root_y_return ->+ alloca $ \ win_x_return ->+ alloca $ \ win_y_return ->+ alloca $ \ mask_return -> do+ rel <- xQueryPointer display w root_return child_return root_x_return+ root_y_return win_x_return win_y_return mask_return+ root <- peek root_return+ child <- peek child_return+ root_x <- peek root_x_return+ root_y <- peek root_y_return+ win_x <- peek win_x_return+ win_y <- peek win_y_return+ mask <- peek mask_return+ return (rel, root, child, root_x, root_y, win_x, win_y, mask)+foreign import ccall unsafe "HsXlib.h XQueryPointer"+ xQueryPointer :: Display -> Window ->+ Ptr Window -> Ptr Window -> Ptr Int -> Ptr Int ->+ Ptr Int -> Ptr Int -> Ptr Modifier -> IO Bool++-- XSetSelectionOwner omitted++-- XOpenOM omitted+-- XCloseOM omitted+-- XSetOMValues omitted+-- XGetOMValues omitted+-- DisplayOfOM omitted+-- XLocaleOfOM omitted++-- XCreateOC omitted+-- XDestroyOC omitted+-- XOMOfOC omitted+-- XSetOCValues omitted+-- XGetOCValues omitted++-- XVaCreateNestedList omitted++----------------------------------------------------------------+-- Error reporting+----------------------------------------------------------------++-- | interface to the X11 library function @XDisplayName()@.+displayName :: String -> String+displayName str = unsafePerformIO $+ withCString str $ \ c_str -> do+ c_name <- xDisplayName c_str+ peekCString c_name+foreign import ccall unsafe "HsXlib.h XDisplayName"+ xDisplayName :: CString -> IO CString++-- type ErrorHandler = Display -> ErrorEvent -> IO Int+-- %dis errorHandler x = (stable x)+--+-- type IOErrorHandler = Display -> IO Int+-- %dis ioErrorHandler x = (stable x)++-- Sadly, this code doesn't work because hugs->runIO creates a fresh+-- stack of exception handlers so the exception gets thrown to the+-- wrong place.+--+-- %C+-- % static HugsStablePtr ioErrorHandlerPtr;+-- %+-- % int genericIOErrorHandler(Display *d)+-- % {+-- % if (ioErrorHandlerPtr >= 0) {+-- % hugs->putStablePtr(ioErrorHandlerPtr);+-- % hugs->putAddr(d);+-- % if (hugs->runIO(1)) { /* exitWith value returned */+-- % return hugs->getInt();+-- % } else {+-- % return hugs->getWord();+-- % }+-- % }+-- % return 1;+-- % }++-- Here's what we might do instead. The two error handlers set flags+-- when they fire and every single call to X contains the line:+--+-- %fail { errorFlags != 0 } { XError(errorFlags) }+--+-- This really sucks.+-- Oh, and it won't even work with IOErrors since they terminate+-- the process if the handler returns. I don't know what the hell they+-- think they're doing taking it upon themselves to terminate MY+-- process when THEIR library has a problem but I don't think anyone+-- ever accused X of being well-designed.+--+-- % static int genericIOErrorHandler(Display *d)+-- % {+-- % if (ioErrorHandlerPtr >= 0) {+-- % hugs->putStablePtr(ioErrorHandlerPtr);+-- % hugs->putAddr(d);+-- % if (hugs->runIO(1)) { /* exitWith value returned */+-- % return hugs->getInt();+-- % } else {+-- % return hugs->getWord();+-- % }+-- % }+-- % return 1;+-- % }++-- HN 2001-02-06+-- Moved to auxiliaries.c to make it easier to use the inlining option.+-- -- Sigh, for now we just use an error handler that prints an error+-- -- message on the screen+-- %C+-- % static int defaultErrorHandler(Display *d, XErrorEvent *ev)+-- % {+-- % char buffer[1000];+-- % XGetErrorText(d,ev->error_code,buffer,1000);+-- % printf("Error: %s\n", buffer);+-- % return 0;+-- % }++{-# CFILES cbits/auxiliaries.c #-}++newtype XErrorEvent = XErrorEvent (Ptr XErrorEvent)+#if __GLASGOW_HASKELL__+ deriving (Eq, Ord, Show, Typeable, Data)+#else+ deriving (Eq, Ord, Show)+#endif++type ErrorHandler = FunPtr (Display -> Ptr XErrorEvent -> IO Int)++foreign import ccall unsafe "HsXlib.h &defaultErrorHandler"+ defaultErrorHandler :: FunPtr (Display -> Ptr XErrorEvent -> IO Int)++-- | The Xlib library reports most errors by invoking a user-provided+-- error handler. This function installs an error handler that prints a+-- textual representation of the error.+setDefaultErrorHandler :: IO ()+setDefaultErrorHandler = do+ xSetErrorHandler defaultErrorHandler+ return ()++-- %fun XSetIOErrorHandler :: IOErrorHandler -> IO IOErrorHandler++foreign import ccall unsafe "HsXlib.h XSetErrorHandler"+ xSetErrorHandler :: ErrorHandler -> IO ErrorHandler++-- XGetErrorDatabaseText omitted+-- XGetErrorText omitted++----------------------------------------------------------------+-- -- Buffers+-- ----------------------------------------------------------------+--+-- -- OLD: Would arrays be more appropriate?+-- --+-- -- IMPURE void XStoreBytes(display, bytes, nbytes)+-- -- IN Display* display+-- -- VAR Int nbytes+-- -- IN list[nbytes] Byte bytes+-- --+-- -- IMPURE list[nbytes] Byte XFetchBytes(display, &nbytes)+-- -- IN Display* display+-- -- VAR Int nbytes+-- --+-- -- IMPURE void XStoreBuffer(display, bytes, nbytes, buffer)+-- -- IN Display* display+-- -- VAR Int nbytes+-- -- IN list[nbytes] Byte bytes+-- -- IN Buffer buffer+-- --+-- -- IMPURE list[nbytes] Byte XFetchBuffer(display, &nbytes, buffer)+-- -- IN Display* display+-- -- VAR Int nbytes+-- -- IN Buffer buffer+-- --+-- -- IMPURE void XRotateBuffers(display, rotate)+-- -- IN Display* display+-- -- VAR Int rotate++----------------------------------------------------------------+-- Extensions+----------------------------------------------------------------++-- ToDo: Use XFreeExtensionList+-- %fun XListExtensions :: Display -> IO ListString using res1 = XListExtensions(arg1,&res1_size)++-- %errfun False XQueryExtension :: Display -> String -> IO (Int,Int,Int) using res4 = XQueryExtension(arg1,arg2,&res1,&res2,&res3)->(res1,res2,res3)+-- %fun XInitExtensions :: Display -> String -> IO XExtCodes+-- %fun XAddExtensions :: Display -> IO XExtCodes++-- XAddToExtensionList omitted+-- XFindOnExtensionList omitted+-- XEHeadOfExtensionList omitted++----------------------------------------------------------------+-- Hosts+----------------------------------------------------------------++-- ToDo: operations to construct and destruct an XHostAddress++-- %fun XAddHost :: Display -> XHostAddress -> IO ()+-- %fun XRemoveHost :: Display -> XHostAddress -> IO ()+--+-- %fun XAddHosts :: Display -> ListXHostAddress -> IO () using XAddHosts(arg1,arg2,arg2_size)+-- %fun XRemoveHosts :: Display -> ListXHostAddress -> IO () using XRemoveHosts(arg1,arg2,arg2_size)+--+-- -- Uses %prim to let us call XFree+-- %prim XListHosts :: Display -> IO (ListXHostAddress, Bool)+-- Bool state;+-- Int r_size;+-- XHostAddress* r = XListHosts(arg1,&r_size,&state);+-- %update(r,state);+-- XFree(r);+-- return;++-- %fun XEnableAccessControl :: Display -> IO ()+-- %fun XDisableAccessControl :: Display -> IO ()+-- %fun XSetAccessControl :: Display -> Access -> IO ()++----------------------------------------------------------------+-- Geometry+----------------------------------------------------------------++-- | interface to the X11 library function @XGeometry()@.+geometry :: Display -> Int -> String -> String ->+ Dimension -> Dimension -> Dimension -> Int -> Int ->+ IO (Int, Position, Position, Dimension, Dimension)+geometry display screen position default_position+ bwidth fwidth fheight xadder yadder =+ withCString position $ \ c_position ->+ withCString default_position $ \ c_default_position ->+ alloca $ \ x_return ->+ alloca $ \ y_return ->+ alloca $ \ width_return ->+ alloca $ \ height_return -> do+ res <- xGeometry display screen c_position c_default_position+ bwidth fwidth fheight xadder yadder+ x_return y_return width_return height_return+ x <- peek x_return+ y <- peek y_return+ width <- peek width_return+ height <- peek height_return+ return (res, x, y, width, height)+foreign import ccall unsafe "HsXlib.h XGeometry"+ xGeometry :: Display -> Int -> CString -> CString ->+ Dimension -> Dimension -> Dimension -> Int -> Int ->+ Ptr Position -> Ptr Position ->+ Ptr Dimension -> Ptr Dimension -> IO Int++-- | interface to the X11 library function @XGetGeometry()@.+getGeometry :: Display -> Drawable ->+ IO (Window, Position, Position, Dimension, Dimension, Dimension, Int)+getGeometry display d =+ outParameters7 (throwIfZero "getGeometry") $+ xGetGeometry display d+foreign import ccall unsafe "HsXlib.h XGetGeometry"+ xGetGeometry :: Display -> Drawable ->+ Ptr Window -> Ptr Position -> Ptr Position -> Ptr Dimension ->+ Ptr Dimension -> Ptr Dimension -> Ptr Int -> IO Status++-- XParseGeometry omitted (returned bitset too weird)++----------------------------------------------------------------+-- Locale+----------------------------------------------------------------++-- | interface to the X11 library function @XSupportsLocale()@.+foreign import ccall unsafe "HsXlib.h XSupportsLocale"+ supportsLocale :: IO Bool++-- | interface to the X11 library function @XSetLocaleModifiers()@.+setLocaleModifiers :: String -> IO String+setLocaleModifiers mods =+ withCString mods $ \ modifier_list -> do+ c_str <- xSetLocaleModifiers modifier_list+ peekCString c_str+foreign import ccall unsafe "HsXlib.h XSetLocaleModifiers"+ xSetLocaleModifiers :: CString -> IO CString++----------------------------------------------------------------+-- Screen Saver+----------------------------------------------------------------++type AllowExposuresMode = Int+#{enum AllowExposuresMode,+ , dontAllowExposures = DontAllowExposures+ , allowExposures = AllowExposures+ , defaultExposures = DefaultExposures+ }++type PreferBlankingMode = Int+#{enum PreferBlankingMode,+ , dontPreferBlanking = DontPreferBlanking+ , preferBlanking = PreferBlanking+ , defaultBlanking = DefaultBlanking+ }++type ScreenSaverMode = Int+#{enum ScreenSaverMode,+ , screenSaverActive = ScreenSaverActive+ , screenSaverReset = ScreenSaverReset+ }++getScreenSaver :: Display ->+ IO (Int, Int, PreferBlankingMode, AllowExposuresMode)+getScreenSaver display = outParameters4 id (xGetScreenSaver display)+foreign import ccall unsafe "HsXlib.h XGetScreenSaver"+ xGetScreenSaver :: Display -> Ptr Int -> Ptr Int ->+ Ptr PreferBlankingMode -> Ptr AllowExposuresMode -> IO ()++-- | interface to the X11 library function @XSetScreenSaver()@.+foreign import ccall unsafe "HsXlib.h XSetScreenSaver"+ setScreenSaver :: Display -> Int -> Int ->+ PreferBlankingMode -> AllowExposuresMode -> IO ()++-- | interface to the X11 library function @XActivateScreenSaver()@.+foreign import ccall unsafe "HsXlib.h XActivateScreenSaver"+ activateScreenSaver :: Display -> IO ()++-- | interface to the X11 library function @XResetScreenSaver()@.+foreign import ccall unsafe "HsXlib.h XResetScreenSaver"+ resetScreenSaver :: Display -> IO ()++-- | interface to the X11 library function @XForceScreenSaver()@.+foreign import ccall unsafe "HsXlib.h XForceScreenSaver"+ forceScreenSaver :: Display -> ScreenSaverMode -> IO ()++----------------------------------------------------------------+-- Pointer+----------------------------------------------------------------++-- | interface to the X11 library function @XGetPointerControl()@.+getPointerControl :: Display -> IO (Int, Int, Int)+getPointerControl display = outParameters3 id (xGetPointerControl display)+foreign import ccall unsafe "HsXlib.h XGetPointerControl"+ xGetPointerControl :: Display -> Ptr Int -> Ptr Int -> Ptr Int -> IO ()++-- | interface to the X11 library function @XWarpPointer()@.+foreign import ccall unsafe "HsXlib.h XWarpPointer"+ warpPointer :: Display -> Window -> Window -> Position -> Position ->+ Dimension -> Dimension -> Position -> Position -> IO ()++-- XGetPointerMapping omitted+-- XSetPointerMapping omitted++----------------------------------------------------------------+-- Visuals+----------------------------------------------------------------++-- XVisualIDFromVisual omitted++----------------------------------------------------------------+-- Threads+----------------------------------------------------------------++-- XInitThreads omitted (leary of thread stuff)+-- XLockDisplay omitted (leary of thread stuff)+-- XUnlockDisplay omitted (leary of thread stuff)++----------------------------------------------------------------+-- Pixmaps+----------------------------------------------------------------++-- | interface to the X11 library function @XCreatePixmap()@.+foreign import ccall unsafe "HsXlib.h XCreatePixmap"+ createPixmap :: Display -> Drawable -> Dimension -> Dimension -> Int -> IO Pixmap++-- | interface to the X11 library function @XFreePixmap()@.+foreign import ccall unsafe "HsXlib.h XFreePixmap"+ freePixmap :: Display -> Pixmap -> IO ()++-- XCreatePixmapFromBitmapData omitted (type looks strange)++-- %fun XListPixmapFormatValues = res1 = XListPixmapFormatValues(display, &res1_size) :: Display -> ListXPixmapFormatValues++----------------------------------------------------------------+-- Bitmaps+----------------------------------------------------------------++-- ToDo: do these need to be available to the programmer?+-- Maybe I could just wire them into all other operations?++-- | interface to the X11 library function @XBitmapBitOrder()@.+foreign import ccall unsafe "HsXlib.h XBitmapBitOrder"+ bitmapBitOrder :: Display -> ByteOrder++-- | interface to the X11 library function @XBitmapUnit()@.+foreign import ccall unsafe "HsXlib.h XBitmapUnit"+ bitmapUnit :: Display -> Int++-- | interface to the X11 library function @XBitmapPad()@.+foreign import ccall unsafe "HsXlib.h XBitmapPad"+ bitmapPad :: Display -> Int++-- ToDo: make sure that initialisation works correctly for x/y_hot+-- omitted+-- IMPURE void XWriteBitmapFile(display, filename, bitmap, width, height, x_hot, y_hot) RAISES Either+-- RETURNTYPE BitmapFileStatus+-- GLOBAL ERROR BitmapFileStatus RETVAL+-- IN Display* display+-- IN String filename+-- IN Pixmap bitmap+-- IN Dimension width+-- IN Dimension height+-- IN Maybe Int x_hot = -1+-- IN Maybe Int y_hot = -1+-- POST: RETVAL == BitmapSuccess++-- omitted+-- IMPURE void XReadBitmapFile(display, d, filename, bitmap, width, height, x_hot, y_hot) RAISES Either+-- RETURNTYPE BitmapFileStatus+-- GLOBAL ERROR BitmapFileStatus RETVAL+-- IN Display* display+-- IN Drawable d+-- IN String filename+-- OUT Pixmap bitmap+-- OUT Dimension width+-- OUT Dimension height+-- OUT Int x_hot RAISES Maybe IF x_hot == -1+-- OUT Int y_hot RAISES Maybe IF x_hot == -1+-- POST: RETVAL == BitmapSuccess++-- XCreateBitmapFromData omitted (awkward looking type)+-- XReadBitmapFileData omitted (awkward looking type)++----------------------------------------------------------------+-- Keycodes+----------------------------------------------------------------++-- | interface to the X11 library function @XDisplayKeycodes()@.+displayKeycodes :: Display -> (Int,Int)+displayKeycodes display =+ unsafePerformIO $ outParameters2 id $ xDisplayKeycodes display+foreign import ccall unsafe "HsXlib.h XDisplayKeycodes"+ xDisplayKeycodes :: Display -> Ptr Int -> Ptr Int -> IO ()++-- | interface to the X11 library function @XLookupKeysym()@.+foreign import ccall unsafe "HsXlib.h XLookupKeysym"+ lookupKeysym :: XKeyEventPtr -> Int -> IO KeySym++-- | interface to the X11 library function @XKeycodeToKeysym()@.+foreign import ccall unsafe "HsXlib.h XKeycodeToKeysym"+ keycodeToKeysym :: Display -> KeyCode -> Int -> IO KeySym++-- | interface to the X11 library function @XKeysymToKeycode()@.+foreign import ccall unsafe "HsXlib.h XKeysymToKeycode"+ keysymToKeycode :: Display -> KeySym -> IO KeyCode++-- | interface to the X11 library function @XKeysymToString()@.+keysymToString :: KeySym -> String+keysymToString keysym = unsafePerformIO $ do+ c_str <- xKeysymToString keysym+ peekCString c_str+foreign import ccall unsafe "HsXlib.h XKeysymToString"+ xKeysymToString :: KeySym -> IO CString++-- | interface to the X11 library function @XStringToKeysym()@.+stringToKeysym :: String -> KeySym+stringToKeysym str = unsafePerformIO $+ withCString str $ \ c_str ->+ xStringToKeysym c_str+foreign import ccall unsafe "HsXlib.h XStringToKeysym"+ xStringToKeysym :: CString -> IO KeySym++noSymbol :: KeySym+noSymbol = #{const NoSymbol}++newtype XComposeStatus = XComposeStatus (Ptr XComposeStatus)+#if __GLASGOW_HASKELL__+ deriving (Eq, Ord, Show, Typeable, Data)+#else+ deriving (Eq, Ord, Show)+#endif++-- XLookupString cannot handle compose, it seems.++-- | interface to the X11 library function @XLookupString()@.+lookupString :: XKeyEventPtr -> IO (Maybe KeySym, String)+lookupString event_ptr =+ allocaBytes 100 $ \ buf ->+ alloca $ \ keysym_return -> do+ n <- xLookupString event_ptr buf 100 keysym_return nullPtr+ str <- peekCStringLen (buf, n)+ keysym <- peek keysym_return+ return (if keysym == noSymbol then Nothing else Just keysym, str)+foreign import ccall unsafe "HsXlib.h XLookupString"+ xLookupString :: XKeyEventPtr -> CString -> Int ->+ Ptr KeySym -> Ptr XComposeStatus -> IO Int++-- XQueryKeymap omitted+-- XRebindKeysym omitted+-- XDeleteModifiermapEntry omitted+-- XInsertModifiermapEntry omitted+-- XNewModifiermap omitted+-- XFreeModifiermap omitted+-- XSetModifierMapping omitted+-- XGetModifierMapping omitted+-- XGetKeyboardMapping omitted++----------------------------------------------------------------+-- Image+----------------------------------------------------------------++-- XCreateImage omitted+-- XInitImage omitted+-- XGetImage omitted+-- XPutImage omitted+-- XGetSubImage omitted++----------------------------------------------------------------+-- Icons+----------------------------------------------------------------++-- | interface to the X11 library function @XGetIconName()@.+getIconName :: Display -> Window -> IO String+getIconName display w =+ alloca $ \ icon_name_return -> do+ throwIfZero "getIconName" $+ xGetIconName display w icon_name_return+ c_icon_name <- peek icon_name_return+ peekCString c_icon_name+foreign import ccall unsafe "HsXlib.h XGetIconName"+ xGetIconName :: Display -> Window -> Ptr CString -> IO Status++-- | interface to the X11 library function @XSetIconName()@.+setIconName :: Display -> Window -> String -> IO ()+setIconName display w icon_name =+ withCString icon_name $ \ c_icon_name ->+ xSetIconName display w c_icon_name+foreign import ccall unsafe "HsXlib.h XSetIconName"+ xSetIconName :: Display -> Window -> CString -> IO ()++----------------------------------------------------------------+-- Cursors+----------------------------------------------------------------++-- | interface to the X11 library function @XDefineCursor()@.+foreign import ccall unsafe "HsXlib.h XDefineCursor"+ defineCursor :: Display -> Window -> Cursor -> IO ()++-- | interface to the X11 library function @XUndefineCursor()@.+foreign import ccall unsafe "HsXlib.h XUndefineCursor"+ undefineCursor :: Display -> Window -> IO ()++-- | interface to the X11 library function @XCreatePixmapCursor()@.+createPixmapCursor :: Display -> Pixmap -> Pixmap -> Color -> Color ->+ Dimension -> Dimension -> IO Cursor+createPixmapCursor display source mask fg_color bg_color x y =+ with fg_color $ \ fg_color_ptr ->+ with bg_color $ \ bg_color_ptr ->+ xCreatePixmapCursor display source mask fg_color_ptr bg_color_ptr x y+foreign import ccall unsafe "HsXlib.h XCreatePixmapCursor"+ xCreatePixmapCursor :: Display -> Pixmap -> Pixmap ->+ Ptr Color -> Ptr Color -> Dimension -> Dimension -> IO Cursor++-- | interface to the X11 library function @XCreateGlyphCursor()@.+createGlyphCursor :: Display -> Font -> Font -> Glyph -> Glyph ->+ Color -> Color -> IO Cursor+createGlyphCursor display source_font mask_font source_char mask_char+ fg_color bg_color =+ with fg_color $ \ fg_color_ptr ->+ with bg_color $ \ bg_color_ptr ->+ xCreateGlyphCursor display source_font mask_font source_char mask_char+ fg_color_ptr bg_color_ptr+foreign import ccall unsafe "HsXlib.h XCreateGlyphCursor"+ xCreateGlyphCursor :: Display -> Font -> Font -> Glyph -> Glyph ->+ Ptr Color -> Ptr Color -> IO Cursor++-- | interface to the X11 library function @XCreateFontCursor()@.+foreign import ccall unsafe "HsXlib.h XCreateFontCursor"+ createFontCursor :: Display -> Glyph -> IO Cursor++-- | interface to the X11 library function @XFreeCursor()@.+foreign import ccall unsafe "HsXlib.h XFreeCursor"+ freeCursor :: Display -> Font -> IO ()++-- | interface to the X11 library function @XRecolorCursor()@.+recolorCursor :: Display -> Cursor -> Color -> Color -> IO ()+recolorCursor display cursor fg_color bg_color =+ with fg_color $ \ fg_color_ptr ->+ with bg_color $ \ bg_color_ptr ->+ xRecolorCursor display cursor fg_color_ptr bg_color_ptr+foreign import ccall unsafe "HsXlib.h XRecolorCursor"+ xRecolorCursor :: Display -> Cursor -> Ptr Color -> Ptr Color -> IO ()++----------------------------------------------------------------+-- Window Manager stuff+----------------------------------------------------------------++-- XConfigureWMWindow omitted (can't find documentation)+-- XReconfigureWMWindow omitted (can't find documentation)+-- XWMGeometry omitted (can't find documentation)+-- XGetWMColormapWindows omitted (can't find documentation)+-- XSetWMColormapWindows omitted (can't find documentation)+-- XGetWMProtocols omitted++-- AC, 1/9/2000: Added definition for XSetWMProtocols++-- | interface to the X11 library function @XSetWMProtocols()@.+setWMProtocols :: Display -> Window -> [Atom] -> IO ()+setWMProtocols display w protocols =+ withArray protocols $ \ protocol_array ->+ xSetWMProtocols display w protocol_array (length protocols)+foreign import ccall unsafe "HsXlib.h XSetWMProtocols"+ xSetWMProtocols :: Display -> Window -> Ptr Atom -> Int -> IO ()++----------------------------------------------------------------+-- Set Window Attributes+----------------------------------------------------------------++-- ToDo: generate this kind of stuff automatically.++allocaSetWindowAttributes :: (Ptr SetWindowAttributes -> IO a) -> IO a+allocaSetWindowAttributes = allocaBytes #{size XSetWindowAttributes}++---------------- Access to individual fields ----------------++set_background_pixmap :: Ptr SetWindowAttributes -> Pixmap -> IO ()+set_background_pixmap = #{poke XSetWindowAttributes,background_pixmap}++set_background_pixel :: Ptr SetWindowAttributes -> Pixel -> IO ()+set_background_pixel = #{poke XSetWindowAttributes,background_pixel}++set_border_pixmap :: Ptr SetWindowAttributes -> Pixmap -> IO ()+set_border_pixmap = #{poke XSetWindowAttributes,border_pixmap}++set_border_pixel :: Ptr SetWindowAttributes -> Pixel -> IO ()+set_border_pixel = #{poke XSetWindowAttributes,border_pixel}++set_bit_gravity :: Ptr SetWindowAttributes -> BitGravity -> IO ()+set_bit_gravity = #{poke XSetWindowAttributes,bit_gravity}++set_win_gravity :: Ptr SetWindowAttributes -> WindowGravity -> IO ()+set_win_gravity = #{poke XSetWindowAttributes,win_gravity}++set_backing_store :: Ptr SetWindowAttributes -> BackingStore -> IO ()+set_backing_store = #{poke XSetWindowAttributes,backing_store}++set_backing_planes :: Ptr SetWindowAttributes -> Pixel -> IO ()+set_backing_planes = #{poke XSetWindowAttributes,backing_planes}++set_backing_pixel :: Ptr SetWindowAttributes -> Pixel -> IO ()+set_backing_pixel = #{poke XSetWindowAttributes,backing_pixel}++set_save_under :: Ptr SetWindowAttributes -> Bool -> IO ()+set_save_under = #{poke XSetWindowAttributes,save_under}++set_event_mask :: Ptr SetWindowAttributes -> EventMask -> IO ()+set_event_mask = #{poke XSetWindowAttributes,event_mask}++set_do_not_propagate_mask :: Ptr SetWindowAttributes -> EventMask -> IO ()+set_do_not_propagate_mask = #{poke XSetWindowAttributes,do_not_propagate_mask}++set_override_redirect :: Ptr SetWindowAttributes -> Bool -> IO ()+set_override_redirect = #{poke XSetWindowAttributes,override_redirect}++set_colormap :: Ptr SetWindowAttributes -> Colormap -> IO ()+set_colormap = #{poke XSetWindowAttributes,colormap}++set_cursor :: Ptr SetWindowAttributes -> Cursor -> IO ()+set_cursor = #{poke XSetWindowAttributes,cursor}++----------------------------------------------------------------+-- Drawing+----------------------------------------------------------------++-- | interface to the X11 library function @XDrawPoint()@.+foreign import ccall unsafe "HsXlib.h XDrawPoint"+ drawPoint :: Display -> Drawable -> GC -> Position -> Position -> IO ()++-- | interface to the X11 library function @XDrawPoints()@.+drawPoints :: Display -> Drawable -> GC -> [Point] -> CoordinateMode -> IO ()+drawPoints display d gc points mode =+ withArrayLen points $ \ npoints point_array ->+ xDrawPoints display d gc point_array npoints mode+foreign import ccall unsafe "HsXlib.h XDrawPoints"+ xDrawPoints :: Display -> Drawable -> GC -> Ptr Point -> Int ->+ CoordinateMode -> IO ()++-- | interface to the X11 library function @XDrawLine()@.+foreign import ccall unsafe "HsXlib.h XDrawLine"+ drawLine :: Display -> Drawable -> GC -> Position -> Position ->+ Position -> Position -> IO ()++-- | interface to the X11 library function @XDrawLines()@.+drawLines :: Display -> Drawable -> GC -> [Point] -> CoordinateMode -> IO ()+drawLines display d gc points mode =+ withArrayLen points $ \ npoints point_array ->+ xDrawLines display d gc point_array npoints mode+foreign import ccall unsafe "HsXlib.h XDrawLines"+ xDrawLines :: Display -> Drawable -> GC -> Ptr Point -> Int ->+ CoordinateMode -> IO ()++-- | interface to the X11 library function @XDrawSegments()@.+drawSegments :: Display -> Drawable -> GC -> [Segment] -> IO ()+drawSegments display d gc segments =+ withArrayLen segments $ \ nsegments segment_array ->+ xDrawSegments display d gc segment_array nsegments+foreign import ccall unsafe "HsXlib.h XDrawSegments"+ xDrawSegments :: Display -> Drawable -> GC -> Ptr Segment -> Int -> IO ()++-- | interface to the X11 library function @XDrawRectangle()@.+foreign import ccall unsafe "HsXlib.h XDrawRectangle"+ drawRectangle :: Display -> Drawable -> GC -> Position -> Position -> Dimension -> Dimension -> IO ()++-- | interface to the X11 library function @XDrawRectangles()@.+drawRectangles :: Display -> Drawable -> GC -> [Rectangle] -> IO ()+drawRectangles display d gc rectangles =+ withArrayLen rectangles $ \ nrectangles rectangle_array ->+ xDrawRectangles display d gc rectangle_array nrectangles+foreign import ccall unsafe "HsXlib.h XDrawRectangles"+ xDrawRectangles :: Display -> Drawable -> GC -> Ptr Rectangle -> Int -> IO ()++-- | interface to the X11 library function @XDrawArc()@.+foreign import ccall unsafe "HsXlib.h XDrawArc"+ drawArc :: Display -> Drawable -> GC -> Position -> Position ->+ Dimension -> Dimension -> Angle -> Angle -> IO ()++-- | interface to the X11 library function @XDrawArcs()@.+drawArcs :: Display -> Drawable -> GC -> [Arc] -> IO ()+drawArcs display d gc arcs =+ withArrayLen arcs $ \ narcs arc_array ->+ xDrawArcs display d gc arc_array narcs+foreign import ccall unsafe "HsXlib.h XDrawArcs"+ xDrawArcs :: Display -> Drawable -> GC -> Ptr Arc -> Int -> IO ()++-- | interface to the X11 library function @XFillRectangle()@.+foreign import ccall unsafe "HsXlib.h XFillRectangle"+ fillRectangle :: Display -> Drawable -> GC -> Position -> Position ->+ Dimension -> Dimension -> IO ()++-- | interface to the X11 library function @XFillRectangles()@.+fillRectangles :: Display -> Drawable -> GC -> [Rectangle] -> IO ()+fillRectangles display d gc rectangles =+ withArrayLen rectangles $ \ nrectangles rectangle_array ->+ xFillRectangles display d gc rectangle_array nrectangles+foreign import ccall unsafe "HsXlib.h XFillRectangles"+ xFillRectangles :: Display -> Drawable -> GC -> Ptr Rectangle -> Int -> IO ()++-- | interface to the X11 library function @XFillPolygon()@.+fillPolygon :: Display -> Drawable -> GC -> [Point] -> PolygonShape -> CoordinateMode -> IO ()+fillPolygon display d gc points shape mode =+ withArrayLen points $ \ npoints point_array ->+ xFillPolygon display d gc point_array npoints shape mode+foreign import ccall unsafe "HsXlib.h XFillPolygon"+ xFillPolygon :: Display -> Drawable -> GC -> Ptr Point -> Int -> PolygonShape -> CoordinateMode -> IO ()++-- | interface to the X11 library function @XFillArc()@.+foreign import ccall unsafe "HsXlib.h XFillArc"+ fillArc :: Display -> Drawable -> GC -> Position -> Position ->+ Dimension -> Dimension -> Angle -> Angle -> IO ()++-- | interface to the X11 library function @XFillArcs()@.+fillArcs :: Display -> Drawable -> GC -> [Arc] -> IO ()+fillArcs display d gc arcs =+ withArrayLen arcs $ \ narcs arc_array ->+ xFillArcs display d gc arc_array narcs+foreign import ccall unsafe "HsXlib.h XFillArcs"+ xFillArcs :: Display -> Drawable -> GC -> Ptr Arc -> Int -> IO ()++-- | interface to the X11 library function @XCopyArea()@.+foreign import ccall unsafe "HsXlib.h XCopyArea"+ copyArea :: Display -> Drawable -> Drawable -> GC -> Position -> Position -> Dimension -> Dimension -> Position -> Position -> IO ()++-- | interface to the X11 library function @XCopyPlane()@.+foreign import ccall unsafe "HsXlib.h XCopyPlane"+ copyPlane :: Display -> Drawable -> Drawable -> GC -> Position -> Position -> Dimension -> Dimension -> Position -> Position -> Pixel -> IO ()++-- draw characters over existing background++-- | interface to the X11 library function @XDrawString()@.+drawString :: Display -> Drawable -> GC -> Position -> Position -> String -> IO ()+drawString display d gc x y str =+ withCStringLen str $ \ (c_str, len) ->+ xDrawString display d gc x y c_str len+foreign import ccall unsafe "HsXlib.h XDrawString"+ xDrawString :: Display -> Drawable -> GC -> Position -> Position -> CString -> Int -> IO ()++-- draw characters over a blank rectangle of current background colour++-- | interface to the X11 library function @XDrawImageString()@.+drawImageString :: Display -> Drawable -> GC -> Position -> Position -> String -> IO ()+drawImageString display d gc x y str =+ withCStringLen str $ \ (c_str, len) ->+ xDrawImageString display d gc x y c_str len+foreign import ccall unsafe "HsXlib.h XDrawImageString"+ xDrawImageString :: Display -> Drawable -> GC -> Position -> Position -> CString -> Int -> IO ()++-- XDrawString16 omitted (16bit chars not supported)+-- XDrawImageString16 omitted (16bit chars not supported)+-- XDrawText omitted (XTextItem not supported)+-- XDrawText16 omitted (XTextItem not supported)++----------------------------------------------------------------+-- Cut and paste buffers+----------------------------------------------------------------++-- | interface to the X11 library function @XStoreBuffer()@.+storeBuffer :: Display -> String -> Int -> IO ()+storeBuffer display bytes buffer =+ withCStringLen bytes $ \ (c_bytes, nbytes) ->+ throwIfZero "storeBuffer" $+ xStoreBuffer display c_bytes nbytes buffer+foreign import ccall unsafe "HsXlib.h XStoreBuffer"+ xStoreBuffer :: Display -> CString -> Int -> Int -> IO Status++-- | interface to the X11 library function @XStoreBytes()@.+storeBytes :: Display -> String -> IO ()+storeBytes display bytes =+ withCStringLen bytes $ \ (c_bytes, nbytes) ->+ throwIfZero "storeBytes" $+ xStoreBytes display c_bytes nbytes+foreign import ccall unsafe "HsXlib.h XStoreBytes"+ xStoreBytes :: Display -> CString -> Int -> IO Status++-- | interface to the X11 library function @XFetchBuffer()@.+fetchBuffer :: Display -> Int -> IO String+fetchBuffer display buffer =+ alloca $ \ nbytes_return -> do+ c_bytes <- throwIfNull "fetchBuffer" $+ xFetchBuffer display nbytes_return buffer+ nbytes <- peek nbytes_return+ bytes <- peekCStringLen (c_bytes, nbytes)+ xFree c_bytes+ return bytes+foreign import ccall unsafe "HsXlib.h XFetchBuffer"+ xFetchBuffer :: Display -> Ptr Int -> Int -> IO CString++-- | interface to the X11 library function @XFetchBytes()@.+fetchBytes :: Display -> IO String+fetchBytes display =+ alloca $ \ nbytes_return -> do+ c_bytes <- throwIfNull "fetchBytes" $+ xFetchBytes display nbytes_return+ nbytes <- peek nbytes_return+ bytes <- peekCStringLen (c_bytes, nbytes)+ xFree c_bytes+ return bytes+foreign import ccall unsafe "HsXlib.h XFetchBytes"+ xFetchBytes :: Display -> Ptr Int -> IO CString++-- | interface to the X11 library function @XRotateBuffers()@.+rotateBuffers :: Display -> Int -> IO ()+rotateBuffers display rotate =+ throwIfZero "rotateBuffers" $+ xRotateBuffers display rotate+foreign import ccall unsafe "HsXlib.h XRotateBuffers"+ xRotateBuffers :: Display -> Int -> IO Status++----------------------------------------------------------------+-- Window properties+----------------------------------------------------------------++newtype XTextProperty = XTextProperty (Ptr XTextProperty)+#if __GLASGOW_HASKELL__+ deriving (Eq, Ord, Show, Typeable, Data)+#else+ deriving (Eq, Ord, Show)+#endif++-- | interface to the X11 library function @XSetTextProperty()@.+setTextProperty :: Display -> Window -> String -> Atom -> IO ()+setTextProperty display w value property =+ withCStringLen value $ \ (c_value, value_len) ->+ allocaBytes #{size XTextProperty} $ \ text_prop -> do+ #{poke XTextProperty,value} text_prop c_value+ #{poke XTextProperty,encoding} text_prop sTRING+ #{poke XTextProperty,format} text_prop (8::Int)+ #{poke XTextProperty,nitems} text_prop (fromIntegral value_len::Word32)+ xSetTextProperty display w text_prop property+foreign import ccall unsafe "HsXlib.h XSetTextProperty"+ xSetTextProperty :: Display -> Window -> Ptr XTextProperty -> Atom -> IO ()++-- %fun XSetStandardProperties :: Display -> Window -> String -> String -> Pixmap -> [String] -> XSizeHints -> IO ()+-- %code Status err = XSetStandardProperties(arg1,arg2,arg3,arg4,arg5,arg6,arg6_size,&arg7)+-- %fail { Success != err }{ BadStatus(err,XSetStandardProperties) }++----------------------------------------------------------------+-- Canned handling of output parameters+----------------------------------------------------------------++outParameters2 :: (Storable a, Storable b) =>+ (IO r -> IO ()) -> (Ptr a -> Ptr b -> IO r) -> IO (a,b)+outParameters2 check fn =+ alloca $ \ a_return ->+ alloca $ \ b_return -> do+ check (fn a_return b_return)+ a <- peek a_return+ b <- peek b_return+ return (a,b)++outParameters3 :: (Storable a, Storable b, Storable c) =>+ (IO r -> IO ()) -> (Ptr a -> Ptr b -> Ptr c -> IO r) -> IO (a,b,c)+outParameters3 check fn =+ alloca $ \ a_return ->+ alloca $ \ b_return ->+ alloca $ \ c_return -> do+ check (fn a_return b_return c_return)+ a <- peek a_return+ b <- peek b_return+ c <- peek c_return+ return (a,b,c)++outParameters4 :: (Storable a, Storable b, Storable c, Storable d) =>+ (IO r -> IO ()) -> (Ptr a -> Ptr b -> Ptr c -> Ptr d -> IO r) ->+ IO (a,b,c,d)+outParameters4 check fn =+ alloca $ \ a_return ->+ alloca $ \ b_return ->+ alloca $ \ c_return ->+ alloca $ \ d_return -> do+ check (fn a_return b_return c_return d_return)+ a <- peek a_return+ b <- peek b_return+ c <- peek c_return+ d <- peek d_return+ return (a,b,c,d)++outParameters7 :: (Storable a, Storable b, Storable c, Storable d, Storable e, Storable f, Storable g) =>+ (IO r -> IO ()) -> (Ptr a -> Ptr b -> Ptr c -> Ptr d -> Ptr e -> Ptr f -> Ptr g -> IO r) ->+ IO (a,b,c,d,e,f,g)+outParameters7 check fn =+ alloca $ \ a_return ->+ alloca $ \ b_return ->+ alloca $ \ c_return ->+ alloca $ \ d_return ->+ alloca $ \ e_return ->+ alloca $ \ f_return ->+ alloca $ \ g_return -> do+ check (fn a_return b_return c_return d_return e_return f_return g_return)+ a <- peek a_return+ b <- peek b_return+ c <- peek c_return+ d <- peek d_return+ e <- peek e_return+ f <- peek f_return+ g <- peek g_return+ return (a,b,c,d,e,f,g)++----------------------------------------------------------------+-- End+----------------------------------------------------------------
+ Graphics/X11/Xlib/Region.hs view
@@ -0,0 +1,272 @@+{-# OPTIONS_GHC -cpp -fglasgow-exts #-}+-----------------------------------------------------------------------------+-- |+-- Module : Graphics.X11.Xlib.Region+-- Copyright : (c) Alastair Reid, 1999-2003+-- License : BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : provisional+-- Portability : portable+--+-- A collection of FFI declarations for interfacing with Xlib Regions.+--+-----------------------------------------------------------------------------++module Graphics.X11.Xlib.Region(+ Region,++ RectInRegionResult,+ rectangleOut,+ rectangleIn,+ rectanglePart,++ createRegion,+ polygonRegion,+ intersectRegion,+ subtractRegion,+ unionRectWithRegion,+ unionRegion,+ xorRegion,+ emptyRegion,+ equalRegion,+ pointInRegion,+ rectInRegion,+ clipBox,+ offsetRegion,+ shrinkRegion,+ setRegion,++ ) where++import Graphics.X11.Types+import Graphics.X11.Xlib.Types++import Foreign.ForeignPtr+import Foreign.Ptr+import Foreign.Storable+import Foreign.Marshal.Alloc+import Foreign.Marshal.Array+import Foreign.Marshal.Utils++#if __GLASGOW_HASKELL__+import Data.Generics+#endif++----------------------------------------------------------------+-- Regions+----------------------------------------------------------------++newtype Region = Region (ForeignPtr Region)+#if __GLASGOW_HASKELL__+ deriving (Eq, Ord, Show, Typeable, Data)+#else+ deriving (Eq, Ord, Show)+#endif++withRegion :: Region -> (Ptr Region -> IO a) -> IO a+withRegion (Region r) = withForeignPtr r++type RectInRegionResult = Int++-- Return values from XRectInRegion()+rectangleOut, rectangleIn, rectanglePart :: RectInRegionResult+rectangleOut = 0+rectangleIn = 1+rectanglePart = 2++----------------------------------------------------------------+-- Creating regions+----------------------------------------------------------------++-- regions deallocation is handled by the GC (ForeignPtr magic)+-- so we don't provide XDestroyRegion explicitly+-- no idea what the int is for+-- %fun XDestroyRegion :: Region -> IO Int+foreign import ccall unsafe "HsXlib.h &XDestroyRegion"+ xDestroyRegionPtr :: FunPtr (Ptr Region -> IO ())++makeRegion :: Ptr Region -> IO Region+makeRegion rp = do+ r <- newForeignPtr xDestroyRegionPtr rp+ return (Region r)++-- an empty region+-- (often used as "out argument" to binary operators which return regions)++-- | interface to the X11 library function @XCreateRegion()@.+createRegion :: IO Region+createRegion = do+ rp <- xCreateRegion+ makeRegion rp+foreign import ccall unsafe "HsXlib.h XCreateRegion"+ xCreateRegion :: IO (Ptr Region)++-- | interface to the X11 library function @XPolygonRegion()@.+polygonRegion :: [Point] -> FillRule -> IO Region+polygonRegion points fill_rule =+ withArrayLen points $ \ n point_arr -> do+ rp <- xPolygonRegion point_arr n fill_rule+ makeRegion rp+foreign import ccall unsafe "HsXlib.h XPolygonRegion"+ xPolygonRegion :: Ptr Point -> Int -> FillRule -> IO (Ptr Region)++----------------------------------------------------------------+-- Combining Regions+--+-- The usual shoddy state of Xlib documentation fails to mention+-- what the Int is for.+--+-- All operations overwrite the region in their third argument+-- which is usually a freshly created region.+----------------------------------------------------------------++-- | interface to the X11 library function @XIntersectRegion()@.+intersectRegion :: Region -> Region -> Region -> IO Int+intersectRegion src1 src2 dest =+ withRegion src1 $ \ src1_ptr ->+ withRegion src2 $ \ src2_ptr ->+ withRegion dest $ \ dest_ptr ->+ xIntersectRegion src1_ptr src2_ptr dest_ptr+foreign import ccall unsafe+ "HsXlib.h XIntersectRegion" xIntersectRegion ::+ Ptr Region -> Ptr Region -> Ptr Region -> IO Int++-- | interface to the X11 library function @XSubtractRegion()@.+subtractRegion :: Region -> Region -> Region -> IO Int+subtractRegion src1 src2 dest =+ withRegion src1 $ \ src1_ptr ->+ withRegion src2 $ \ src2_ptr ->+ withRegion dest $ \ dest_ptr ->+ xSubtractRegion src1_ptr src2_ptr dest_ptr+foreign import ccall unsafe+ "HsXlib.h XSubtractRegion" xSubtractRegion ::+ Ptr Region -> Ptr Region -> Ptr Region -> IO Int++-- | interface to the X11 library function @XUnionRectWithRegion()@.+unionRectWithRegion :: Rectangle -> Region -> Region -> IO Int+unionRectWithRegion rect src dest =+ with rect $ \ rect_ptr ->+ withRegion src $ \ src_ptr ->+ withRegion dest $ \ dest_ptr ->+ xUnionRectWithRegion rect_ptr src_ptr dest_ptr+foreign import ccall unsafe+ "HsXlib.h XUnionRectWithRegion" xUnionRectWithRegion ::+ Ptr Rectangle -> Ptr Region -> Ptr Region -> IO Int++-- | interface to the X11 library function @XUnionRegion()@.+unionRegion :: Region -> Region -> Region -> IO Int+unionRegion src1 src2 dest =+ withRegion src1 $ \ src1_ptr ->+ withRegion src2 $ \ src2_ptr ->+ withRegion dest $ \ dest_ptr ->+ xUnionRegion src1_ptr src2_ptr dest_ptr+foreign import ccall unsafe+ "HsXlib.h XUnionRegion" xUnionRegion ::+ Ptr Region -> Ptr Region -> Ptr Region -> IO Int++-- | interface to the X11 library function @XXorRegion()@.+xorRegion :: Region -> Region -> Region -> IO Int+xorRegion src1 src2 dest =+ withRegion src1 $ \ src1_ptr ->+ withRegion src2 $ \ src2_ptr ->+ withRegion dest $ \ dest_ptr ->+ xXorRegion src1_ptr src2_ptr dest_ptr+foreign import ccall unsafe+ "HsXlib.h XXorRegion" xXorRegion ::+ Ptr Region -> Ptr Region -> Ptr Region -> IO Int++----------------------------------------------------------------+-- Examining regions (tests, bounding boxes, etc)+----------------------------------------------------------------++-- | interface to the X11 library function @XEmptyRegion()@.+emptyRegion :: Region -> IO Bool+emptyRegion r = withRegion r xEmptyRegion+foreign import ccall unsafe "HsXlib.h XEmptyRegion"+ xEmptyRegion :: Ptr Region -> IO Bool++-- | interface to the X11 library function @XEqualRegion()@.+equalRegion :: Region -> Region -> IO Bool+equalRegion r1 r2 =+ withRegion r1 $ \ rp1 ->+ withRegion r2 $ \ rp2 ->+ xEqualRegion rp1 rp2+foreign import ccall unsafe "HsXlib.h XEqualRegion"+ xEqualRegion :: Ptr Region -> Ptr Region -> IO Bool++-- | interface to the X11 library function @XPointInRegion()@.+pointInRegion :: Region -> Point -> IO Bool+pointInRegion r (Point x y) =+ withRegion r $ \ rp ->+ xPointInRegion rp x y+foreign import ccall unsafe "HsXlib.h XPointInRegion"+ xPointInRegion :: Ptr Region -> Position -> Position -> IO Bool++-- | interface to the X11 library function @XRectInRegion()@.+rectInRegion :: Region -> Rectangle -> IO RectInRegionResult+rectInRegion r (Rectangle x y w h) =+ withRegion r $ \ rp ->+ xRectInRegion rp x y w h+foreign import ccall unsafe "HsXlib.h XRectInRegion"+ xRectInRegion :: Ptr Region -> Position -> Position ->+ Dimension -> Dimension -> IO RectInRegionResult++-- I have no idea what the int is for++-- | interface to the X11 library function @XClipBox()@.+clipBox :: Region -> IO (Rectangle,Int)+clipBox r =+ withRegion r $ \ rp ->+ alloca $ \ rect_ptr -> do+ res <- xClipBox rp rect_ptr+ rect <- peek rect_ptr+ return (rect, res)+foreign import ccall unsafe "HsXlib.h XClipBox"+ xClipBox :: Ptr Region -> Ptr Rectangle -> IO Int++----------------------------------------------------------------+-- Modifying regions+-- (If you use any of these, you can't make regions look like+-- first class data structures.)+----------------------------------------------------------------++-- translate region++-- | interface to the X11 library function @XOffsetRegion()@.+offsetRegion :: Region -> Point -> IO Int+offsetRegion r (Point x y) =+ withRegion r $ \ rp ->+ xOffsetRegion rp x y+foreign import ccall unsafe "HsXlib.h XOffsetRegion"+ xOffsetRegion :: Ptr Region -> Position -> Position -> IO Int++-- increase size of region by +ve or -ve number of pixels+-- while preserving the centre of the region (ie half the pixels+-- come off the left, and half off the right)++-- | interface to the X11 library function @XShrinkRegion()@.+shrinkRegion :: Region -> Point -> IO Int+shrinkRegion r (Point x y) =+ withRegion r $ \ rp ->+ xShrinkRegion rp x y+foreign import ccall unsafe "HsXlib.h XShrinkRegion"+ xShrinkRegion :: Ptr Region -> Position -> Position -> IO Int++----------------------------------------------------------------+-- Graphics Context+----------------------------------------------------------------++-- set clip mask of GC++-- | interface to the X11 library function @XSetRegion()@.+setRegion :: Display -> GC -> Region -> IO Int+setRegion disp gc r =+ withRegion r $ \ rp ->+ xSetRegion disp gc rp+foreign import ccall unsafe "HsXlib.h XSetRegion"+ xSetRegion :: Display -> GC -> Ptr Region -> IO Int++----------------------------------------------------------------+-- End+----------------------------------------------------------------
+ Graphics/X11/Xlib/Screen.hs view
@@ -0,0 +1,132 @@+-----------------------------------------------------------------------------+-- |+-- Module : Graphics.X11.Xlib.Screen+-- Copyright : (c) Alastair Reid, 1999-2003+-- License : BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : provisional+-- Portability : portable+--+-- A collection of FFI declarations for interfacing with Xlib Screens.+--+-----------------------------------------------------------------------------++module Graphics.X11.Xlib.Screen(++ blackPixelOfScreen,+ whitePixelOfScreen,+ cellsOfScreen,+ defaultColormapOfScreen,+ defaultDepthOfScreen,+ defaultGCOfScreen,+ defaultVisualOfScreen,+ doesBackingStore,+ doesSaveUnders,+ displayOfScreen,+ eventMaskOfScreen,+ minCmapsOfScreen,+ maxCmapsOfScreen,+ rootWindowOfScreen,+ widthOfScreen,+ widthMMOfScreen,+ heightOfScreen,+ heightMMOfScreen,+ planesOfScreen,+ screenNumberOfScreen,++ ) where++import Graphics.X11.Types+import Graphics.X11.Xlib.Types++----------------------------------------------------------------+-- Screen+----------------------------------------------------------------++-- Many flags assumed to be PURE.++-- | interface to the X11 library function @XBlackPixelOfScreen()@.+foreign import ccall unsafe "HsXlib.h XBlackPixelOfScreen"+ blackPixelOfScreen :: Screen -> Pixel++-- | interface to the X11 library function @XWhitePixelOfScreen()@.+foreign import ccall unsafe "HsXlib.h XWhitePixelOfScreen"+ whitePixelOfScreen :: Screen -> Pixel++-- | interface to the X11 library function @XCellsOfScreen()@.+foreign import ccall unsafe "HsXlib.h XCellsOfScreen"+ cellsOfScreen :: Screen -> Int++-- | interface to the X11 library function @XDefaultColormapOfScreen()@.+foreign import ccall unsafe "HsXlib.h XDefaultColormapOfScreen"+ defaultColormapOfScreen :: Screen -> Colormap++-- | interface to the X11 library function @XDefaultDepthOfScreen()@.+foreign import ccall unsafe "HsXlib.h XDefaultDepthOfScreen"+ defaultDepthOfScreen :: Screen -> Int++-- | interface to the X11 library function @XDefaultGCOfScreen()@.+foreign import ccall unsafe "HsXlib.h XDefaultGCOfScreen"+ defaultGCOfScreen :: Screen -> GC++-- | interface to the X11 library function @XDefaultVisualOfScreen()@.+foreign import ccall unsafe "HsXlib.h XDefaultVisualOfScreen"+ defaultVisualOfScreen :: Screen -> Visual++-- | interface to the X11 library function @XDoesBackingStore()@.+foreign import ccall unsafe "HsXlib.h XDoesBackingStore"+ doesBackingStore :: Screen -> Bool++-- | interface to the X11 library function @XDoesSaveUnders()@.+foreign import ccall unsafe "HsXlib.h XDoesSaveUnders"+ doesSaveUnders :: Screen -> Bool++-- | interface to the X11 library function @XDisplayOfScreen()@.+foreign import ccall unsafe "HsXlib.h XDisplayOfScreen"+ displayOfScreen :: Screen -> Display++-- | interface to the X11 library function @XEventMaskOfScreen()@.+-- Event mask at connection setup time - not current event mask!+foreign import ccall unsafe "HsXlib.h XEventMaskOfScreen"+ eventMaskOfScreen :: Screen -> EventMask++-- | interface to the X11 library function @XMinCmapsOfScreen()@.+foreign import ccall unsafe "HsXlib.h XMinCmapsOfScreen"+ minCmapsOfScreen :: Screen -> Int++-- | interface to the X11 library function @XMaxCmapsOfScreen()@.+foreign import ccall unsafe "HsXlib.h XMaxCmapsOfScreen"+ maxCmapsOfScreen :: Screen -> Int++-- | interface to the X11 library function @XRootWindowOfScreen()@.+foreign import ccall unsafe "HsXlib.h XRootWindowOfScreen"+ rootWindowOfScreen :: Screen -> Window++-- | interface to the X11 library function @XWidthOfScreen()@.+foreign import ccall unsafe "HsXlib.h XWidthOfScreen"+ widthOfScreen :: Screen -> Dimension++-- | interface to the X11 library function @XWidthMMOfScreen()@.+foreign import ccall unsafe "HsXlib.h XWidthMMOfScreen"+ widthMMOfScreen :: Screen -> Dimension++-- | interface to the X11 library function @XHeightOfScreen()@.+foreign import ccall unsafe "HsXlib.h XHeightOfScreen"+ heightOfScreen :: Screen -> Dimension++-- | interface to the X11 library function @XHeightMMOfScreen()@.+foreign import ccall unsafe "HsXlib.h XHeightMMOfScreen"+ heightMMOfScreen :: Screen -> Dimension++-- | interface to the X11 library function @XPlanesOfScreen()@.+foreign import ccall unsafe "HsXlib.h XPlanesOfScreen"+ planesOfScreen :: Screen -> Int++-- | interface to the X11 library function @XScreenNumberOfScreen()@.+foreign import ccall unsafe "HsXlib.h XScreenNumberOfScreen"+ screenNumberOfScreen :: Screen -> ScreenNumber++----------------------------------------------------------------+-- End+----------------------------------------------------------------
+ Graphics/X11/Xlib/Types.hsc view
@@ -0,0 +1,293 @@+{-# OPTIONS_GHC -fglasgow-exts #-}+-----------------------------------------------------------------------------+-- |+-- Module : Graphics.X11.Xlib.Types+-- Copyright : (c) Alastair Reid, 1999-2003+-- License : BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : provisional+-- Portability : portable+--+-- A collection of type declarations for interfacing with Xlib.+--+-----------------------------------------------------------------------------++-- #hide+module Graphics.X11.Xlib.Types(+ Display(..), Screen, Visual, GC, GCValues, SetWindowAttributes,+ Point(..), Rectangle(..), Arc(..), Segment(..), Color(..),+ Pixel, Position, Dimension, Angle, ScreenNumber, Buffer+ ) where++import Control.Monad( zipWithM_ )+import Data.Int+import Data.Word+import Foreign.C.Types+import Foreign.Marshal.Alloc( allocaBytes )+import Foreign.Ptr+import Foreign.Storable( Storable(..) )++#if __GLASGOW_HASKELL__+import Data.Generics+#endif++#include "HsXlib.h"++----------------------------------------------------------------+-- Types+----------------------------------------------------------------++-- | pointer to an X11 @Display@ structure+newtype Display = Display (Ptr Display)+#if __GLASGOW_HASKELL__+ deriving (Eq, Ord, Show, Typeable, Data)+#else+ deriving (Eq, Ord, Show)+#endif++-- | pointer to an X11 @Screen@ structure+newtype Screen = Screen (Ptr Screen)+#if __GLASGOW_HASKELL__+ deriving (Eq, Ord, Show, Typeable, Data)+#else+ deriving (Eq, Ord, Show)+#endif++-- | pointer to an X11 @Visual@ structure+newtype Visual = Visual (Ptr Visual)+#if __GLASGOW_HASKELL__+ deriving (Eq, Ord, Show, Typeable, Data)+#else+ deriving (Eq, Ord, Show)+#endif++-- | pointer to an X11 @GC@ structure+newtype GC = GC (Ptr GC)+#if __GLASGOW_HASKELL__+ deriving (Eq, Ord, Show, Typeable, Data)+#else+ deriving (Eq, Ord, Show)+#endif++-- | pointer to an X11 @XGCValues@ structure+newtype GCValues = GCValues (Ptr GCValues)+#if __GLASGOW_HASKELL__+ deriving (Eq, Ord, Show, Typeable, Data)+#else+ deriving (Eq, Ord, Show)+#endif++-- | pointer to an X11 @XSetWindowAttributes@ structure+newtype SetWindowAttributes = SetWindowAttributes (Ptr SetWindowAttributes)+#if __GLASGOW_HASKELL__+ deriving (Eq, Ord, Show, Typeable, Data)+#else+ deriving (Eq, Ord, Show)+#endif++type Pixel = #{type unsigned long}+type Position = #{type int}+type Dimension = #{type unsigned int}+type Angle = Int+type ScreenNumber = Word32+type Buffer = Int++----------------------------------------------------------------+-- Short forms used in structs+----------------------------------------------------------------++type ShortPosition = CShort+type ShortDimension = CUShort+type ShortAngle = CShort++peekPositionField :: Ptr a -> Int -> IO Position+peekPositionField ptr off = do+ v <- peekByteOff ptr off+ return (fromIntegral (v::ShortPosition))++peekDimensionField :: Ptr a -> Int -> IO Dimension+peekDimensionField ptr off = do+ v <- peekByteOff ptr off+ return (fromIntegral (v::ShortDimension))++peekAngleField :: Ptr a -> Int -> IO Angle+peekAngleField ptr off = do+ v <- peekByteOff ptr off+ return (fromIntegral (v::ShortAngle))++pokePositionField :: Ptr a -> Int -> Position -> IO ()+pokePositionField ptr off v =+ pokeByteOff ptr off (fromIntegral v::ShortPosition)++pokeDimensionField :: Ptr a -> Int -> Dimension -> IO ()+pokeDimensionField ptr off v =+ pokeByteOff ptr off (fromIntegral v::ShortDimension)++pokeAngleField :: Ptr a -> Int -> Angle -> IO ()+pokeAngleField ptr off v =+ pokeByteOff ptr off (fromIntegral v::ShortAngle)++----------------------------------------------------------------+-- Point+----------------------------------------------------------------++-- | counterpart of an X11 @XPoint@ structure+data Point = Point { pt_x :: Position, pt_y :: Position }+#if __GLASGOW_HASKELL__+ deriving (Eq, Show, Typeable, Data)+#else+ deriving (Eq, Show)+#endif++instance Storable Point where+ sizeOf _ = #{size XPoint}+ alignment _ = alignment (undefined::CInt)+ peek p = do+ x <- peekPositionField p #{offset XPoint,x}+ y <- peekPositionField p #{offset XPoint,y}+ return (Point x y)+ poke p (Point x y) = do+ pokePositionField p #{offset XPoint,x} x+ pokePositionField p #{offset XPoint,y} y++----------------------------------------------------------------+-- Rectangle+----------------------------------------------------------------++-- | counterpart of an X11 @XRectangle@ structure+data Rectangle = Rectangle {+ rect_x :: Position,+ rect_y :: Position,+ rect_width :: Dimension,+ rect_height :: Dimension+ }+#if __GLASGOW_HASKELL__+ deriving (Eq, Show, Typeable, Data)+#else+ deriving (Eq, Show)+#endif++instance Storable Rectangle where+ sizeOf _ = #{size XRectangle}+ alignment _ = alignment (undefined::CInt)+ peek p = do+ x <- peekPositionField p #{offset XRectangle,x}+ y <- peekPositionField p #{offset XRectangle,y}+ width <- peekDimensionField p #{offset XRectangle,width}+ height <- peekDimensionField p #{offset XRectangle,height}+ return (Rectangle x y width height)+ poke p (Rectangle x y width height) = do+ pokePositionField p #{offset XRectangle,x} x+ pokePositionField p #{offset XRectangle,y} y+ pokeDimensionField p #{offset XRectangle,width} width+ pokeDimensionField p #{offset XRectangle,height} height++----------------------------------------------------------------+-- Arc+----------------------------------------------------------------++-- | counterpart of an X11 @XArc@ structure+data Arc = Arc {+ arc_x :: Position,+ arc_y :: Position,+ arc_width :: Dimension,+ arc_height :: Dimension,+ arc_angle1 :: Angle,+ arc_angle2 :: Angle+ }+#if __GLASGOW_HASKELL__+ deriving (Eq, Show, Typeable, Data)+#else+ deriving (Eq, Show)+#endif++instance Storable Arc where+ sizeOf _ = #{size XArc}+ alignment _ = alignment (undefined::CInt)+ peek p = do+ x <- peekPositionField p #{offset XArc,x}+ y <- peekPositionField p #{offset XArc,y}+ width <- peekDimensionField p #{offset XArc,width}+ height <- peekDimensionField p #{offset XArc,height}+ angle1 <- peekAngleField p #{offset XArc,angle1}+ angle2 <- peekAngleField p #{offset XArc,angle2}+ return (Arc x y width height angle1 angle2)+ poke p (Arc x y width height angle1 angle2) = do+ pokePositionField p #{offset XArc,x} x+ pokePositionField p #{offset XArc,y} y+ pokeDimensionField p #{offset XArc,width} width+ pokeDimensionField p #{offset XArc,height} height+ pokeAngleField p #{offset XArc,angle1} angle1+ pokeAngleField p #{offset XArc,angle2} angle2++----------------------------------------------------------------+-- Segment+----------------------------------------------------------------++-- | counterpart of an X11 @XSegment@ structure+data Segment = Segment {+ seg_x1 :: Position,+ seg_y1 :: Position,+ seg_x2 :: Position,+ seg_y2 :: Position+ }+#if __GLASGOW_HASKELL__+ deriving (Eq, Show, Typeable, Data)+#else+ deriving (Eq, Show)+#endif++instance Storable Segment where+ sizeOf _ = #{size XSegment}+ alignment _ = alignment (undefined::CInt)+ peek p = do+ x1 <- peekPositionField p #{offset XSegment,x1}+ y1 <- peekPositionField p #{offset XSegment,y1}+ x2 <- peekPositionField p #{offset XSegment,x2}+ y2 <- peekPositionField p #{offset XSegment,y2}+ return (Segment x1 y1 x2 y2)+ poke p (Segment x1 y1 x2 y2) = do+ pokePositionField p #{offset XSegment,x1} x1+ pokePositionField p #{offset XSegment,y1} y1+ pokePositionField p #{offset XSegment,x2} x2+ pokePositionField p #{offset XSegment,y2} y2++----------------------------------------------------------------+-- Color+----------------------------------------------------------------++-- | counterpart of an X11 @XColor@ structure+data Color = Color {+ color_pixel :: Pixel,+ color_red :: Word16,+ color_green :: Word16,+ color_blue :: Word16,+ color_flags :: Word8+ }+#if __GLASGOW_HASKELL__+ deriving (Eq, Show, Typeable, Data)+#else+ deriving (Eq, Show)+#endif++instance Storable Color where+ sizeOf _ = #{size XColor}+ alignment _ = alignment (undefined::CInt)+ peek p = do+ pixel <- #{peek XColor,pixel} p+ red <- #{peek XColor,red} p+ green <- #{peek XColor,green} p+ blue <- #{peek XColor,blue} p+ flags <- #{peek XColor,flags} p+ return (Color pixel red green blue flags)+ poke p (Color pixel red green blue flags) = do+ #{poke XColor,pixel} p pixel+ #{poke XColor,red} p red+ #{poke XColor,green} p green+ #{poke XColor,blue} p blue+ #{poke XColor,flags} p flags++----------------------------------------------------------------+-- End+----------------------------------------------------------------
+ Graphics/X11/Xlib/Window.hs view
@@ -0,0 +1,277 @@+-----------------------------------------------------------------------------+-- |+-- Module : Graphics.X11.Xlib.Window+-- Copyright : (c) Alastair Reid, 1999-2003+-- License : BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : provisional+-- Portability : portable+--+-- A collection of FFI declarations for interfacing with Xlib Windows.+--+-----------------------------------------------------------------------------++module Graphics.X11.Xlib.Window(+ storeName,+ createSimpleWindow,+ createWindow,+ translateCoordinates,+ moveResizeWindow,+ resizeWindow,+ moveWindow,+ reparentWindow,+ mapSubwindows,+ unmapSubwindows,+ mapWindow,+ lowerWindow,+ raiseWindow,+ circulateSubwindowsDown,+ circulateSubwindowsUp,+ circulateSubwindows,+ iconifyWindow,+ withdrawWindow,+ destroyWindow,+ destroySubwindows,+ setWindowBorder,+ setWindowBorderPixmap,+ setWindowBorderWidth,+ setWindowBackground,+ setWindowBackgroundPixmap,+ setWindowColormap,+ addToSaveSet,+ removeFromSaveSet,+ changeSaveSet,+ clearWindow,+ clearArea,+ restackWindows,++ ) where++import Graphics.X11.Types+import Graphics.X11.Xlib.Types++import Foreign+import Foreign.C++----------------------------------------------------------------+-- Windows+----------------------------------------------------------------++-- | interface to the X11 library function @XStoreName()@.+storeName :: Display -> Window -> String -> IO ()+storeName display window name =+ withCString name $ \ c_name ->+ xStoreName display window c_name+foreign import ccall unsafe "HsXlib.h XStoreName"+ xStoreName :: Display -> Window -> CString -> IO ()++-- | interface to the X11 library function @XCreateSimpleWindow()@.+foreign import ccall unsafe "HsXlib.h XCreateSimpleWindow"+ createSimpleWindow :: Display -> Window -> Position -> Position ->+ Dimension -> Dimension -> Int -> Pixel -> Pixel -> IO Window++-- | interface to the X11 library function @XCreateWindow()@.+foreign import ccall unsafe "HsXlib.h XCreateWindow"+ createWindow :: Display -> Window -> Position -> Position ->+ Dimension -> Dimension -> Int -> Int -> WindowClass ->+ Visual -> AttributeMask -> Ptr SetWindowAttributes -> IO Window++----------------------------------------------------------------++--ToDo: find an effective way to use Maybes++-- | interface to the X11 library function @XTranslateCoordinates()@.+translateCoordinates :: Display -> Window -> Window -> Position -> Position ->+ IO (Bool,Position,Position,Window)+translateCoordinates display src_w dest_w src_x src_y =+ alloca $ \ dest_x_return ->+ alloca $ \ dest_y_return ->+ alloca $ \ child_return -> do+ res <- xTranslateCoordinates display src_w dest_w src_x src_y+ dest_x_return dest_y_return child_return+ dest_x <- peek dest_x_return+ dest_y <- peek dest_y_return+ child <- peek child_return+ return (res, dest_x, dest_y, child)+foreign import ccall unsafe "HsXlib.h XTranslateCoordinates"+ xTranslateCoordinates :: Display -> Window -> Window ->+ Position -> Position ->+ Ptr Position -> Ptr Position -> Ptr Window -> IO Bool++-- | interface to the X11 library function @XMoveResizeWindow()@.+foreign import ccall unsafe "HsXlib.h XMoveResizeWindow"+ moveResizeWindow :: Display -> Window -> Position -> Position -> Dimension -> Dimension -> IO ()++-- | interface to the X11 library function @XResizeWindow()@.+foreign import ccall unsafe "HsXlib.h XResizeWindow"+ resizeWindow :: Display -> Window -> Dimension -> Dimension -> IO ()++-- | interface to the X11 library function @XMoveWindow()@.+foreign import ccall unsafe "HsXlib.h XMoveWindow"+ moveWindow :: Display -> Window -> Position -> Position -> IO ()++-- | interface to the X11 library function @XReparentWindow()@.+foreign import ccall unsafe "HsXlib.h XReparentWindow"+ reparentWindow :: Display -> Window -> Window -> Position -> Position -> IO ()++-- | interface to the X11 library function @XMapSubwindows()@.+foreign import ccall unsafe "HsXlib.h XMapSubwindows"+ mapSubwindows :: Display -> Window -> IO ()++-- | interface to the X11 library function @XUnmapSubwindows()@.+foreign import ccall unsafe "HsXlib.h XUnmapSubwindows"+ unmapSubwindows :: Display -> Window -> IO ()++-- | interface to the X11 library function @XMapWindow()@.+foreign import ccall unsafe "HsXlib.h XMapWindow"+ mapWindow :: Display -> Window -> IO ()+-- Disnae exist: %fun XUnmapWindows :: Display -> Window -> IO ()+-- Disnae exist: %fun XMapRaisedWindow :: Display -> Window -> IO ()++-- | interface to the X11 library function @XLowerWindow()@.+foreign import ccall unsafe "HsXlib.h XLowerWindow"+ lowerWindow :: Display -> Window -> IO ()++-- | interface to the X11 library function @XRaiseWindow()@.+foreign import ccall unsafe "HsXlib.h XRaiseWindow"+ raiseWindow :: Display -> Window -> IO ()++-- | interface to the X11 library function @XCirculateSubwindowsDown()@.+foreign import ccall unsafe "HsXlib.h XCirculateSubwindowsDown"+ circulateSubwindowsDown :: Display -> Window -> IO ()++-- | interface to the X11 library function @XCirculateSubwindowsUp()@.+foreign import ccall unsafe "HsXlib.h XCirculateSubwindowsUp"+ circulateSubwindowsUp :: Display -> Window -> IO ()++-- | interface to the X11 library function @XCirculateSubwindows()@.+foreign import ccall unsafe "HsXlib.h XCirculateSubwindows"+ circulateSubwindows :: Display -> Window -> CirculationDirection -> IO ()++-- | interface to the X11 library function @XIconifyWindow()@.+iconifyWindow :: Display -> Window -> ScreenNumber -> IO ()+iconifyWindow display window screenno =+ throwIfZero "iconifyWindow"+ (xIconifyWindow display window screenno)+foreign import ccall unsafe "HsXlib.h XIconifyWindow"+ xIconifyWindow :: Display -> Window -> ScreenNumber -> IO Status++-- | interface to the X11 library function @XWithdrawWindow()@.+withdrawWindow :: Display -> Window -> ScreenNumber -> IO ()+withdrawWindow display window screenno =+ throwIfZero "withdrawWindow"+ (xWithdrawWindow display window screenno)+foreign import ccall unsafe "HsXlib.h XWithdrawWindow"+ xWithdrawWindow :: Display -> Window -> ScreenNumber -> IO Status++-- | interface to the X11 library function @XDestroyWindow()@.+foreign import ccall unsafe "HsXlib.h XDestroyWindow"+ destroyWindow :: Display -> Window -> IO ()++-- | interface to the X11 library function @XDestroySubwindows()@.+foreign import ccall unsafe "HsXlib.h XDestroySubwindows"+ destroySubwindows :: Display -> Window -> IO ()++-- | interface to the X11 library function @XSetWindowBorder()@.+foreign import ccall unsafe "HsXlib.h XSetWindowBorder"+ setWindowBorder :: Display -> Window -> Pixel -> IO ()++-- | interface to the X11 library function @XSetWindowBorderPixmap()@.+foreign import ccall unsafe "HsXlib.h XSetWindowBorderPixmap"+ setWindowBorderPixmap :: Display -> Window -> Pixmap -> IO ()++-- | interface to the X11 library function @XSetWindowBorderWidth()@.+foreign import ccall unsafe "HsXlib.h XSetWindowBorderWidth"+ setWindowBorderWidth :: Display -> Window -> Dimension -> IO ()++-- | interface to the X11 library function @XSetWindowBackground()@.+foreign import ccall unsafe "HsXlib.h XSetWindowBackground"+ setWindowBackground :: Display -> Window -> Pixel -> IO ()++-- | interface to the X11 library function @XSetWindowBackgroundPixmap()@.+foreign import ccall unsafe "HsXlib.h XSetWindowBackgroundPixmap"+ setWindowBackgroundPixmap :: Display -> Window -> Pixmap -> IO ()++-- | interface to the X11 library function @XSetWindowColormap()@.+foreign import ccall unsafe "HsXlib.h XSetWindowColormap"+ setWindowColormap :: Display -> Window -> Colormap -> IO ()++-- | interface to the X11 library function @XAddToSaveSet()@.+foreign import ccall unsafe "HsXlib.h XAddToSaveSet"+ addToSaveSet :: Display -> Window -> IO ()++-- | interface to the X11 library function @XRemoveFromSaveSet()@.+foreign import ccall unsafe "HsXlib.h XRemoveFromSaveSet"+ removeFromSaveSet :: Display -> Window -> IO ()++-- | interface to the X11 library function @XChangeSaveSet()@.+foreign import ccall unsafe "HsXlib.h XChangeSaveSet"+ changeSaveSet :: Display -> Window -> ChangeSaveSetMode -> IO ()++-- | interface to the X11 library function @XClearWindow()@.+foreign import ccall unsafe "HsXlib.h XClearWindow"+ clearWindow :: Display -> Window -> IO ()++-- | interface to the X11 library function @XClearArea()@.+foreign import ccall unsafe "HsXlib.h XClearArea"+ clearArea :: Display -> Window ->+ Position -> Position -> Dimension -> Dimension -> Bool -> IO ()++-- This is almost good enough - but doesn't call XFree+-- -- %errfun BadStatus XQueryTree :: Display -> Window -> IO (Window, Window, ListWindow) using err = XQueryTree(arg1,arg2,&res1,&res2,&res3,&res3_size)+-- %prim XQueryTree :: Display -> Window -> IO (Window, Window, ListWindow)+-- Window root_w, parent;+-- Int children_size;+-- Window *children;+-- Status r = XQueryTree(arg1,arg2,&root_w, &parent, &children, &children_size);+-- if (Success != r) { %failWith(BadStatus,r); }+-- %update(root_w,parent,children);+-- XFree(children);+-- return;++-- | interface to the X11 library function @XRestackWindows()@.+restackWindows :: Display -> [Window] -> IO ()+restackWindows display windows =+ withArray windows $ \ window_array ->+ xRestackWindows display window_array (length windows)+foreign import ccall unsafe "HsXlib.h XRestackWindows"+ xRestackWindows :: Display -> Ptr Window -> Int -> IO ()++-- ToDo: I want to be able to write this+-- -- %fun XListInstalledColormaps :: Display -> Window -> IO ListColormap using res1 = XListInstalledColormaps(arg1,arg2,&res1_size)+-- -- But I have to write this instead - need to add a notion of cleanup code!+-- %prim XListInstalledColormaps :: Display -> Window -> IO ListColormap+-- Int r_size;+-- Colormap* r = XListInstalledColormaps(arg1,arg2,&r_size);+-- %update(r);+-- XFree(r);+-- return;+--+-- -- Again, this is almost good enough+-- -- %errfun BadStatus XGetCommand :: Display -> Window -> IO ListString using err = XGetCommand(arg1,arg2,&res1,&res1_size)+-- -- but not quite+-- -- %prim XGetCommand :: Display -> Window -> IO ListString+-- --Int argv_size;+-- --String *argv;+-- --Status r = XGetCommand(arg1,arg2,&argv,&argv_size);+-- --if (Success != r) { %failWith(BadStatus, r); }+-- -- %update(argv);+-- --XFreeStringList(argv);+-- --return;+--+-- -- %fun XSetCommand :: Display -> Window -> ListString -> IO () using XSetCommand(arg1,arg2,arg3,res3_size)+--+-- %errfun BadStatus XGetTransientForHint :: Display -> Window -> IO Window using err = XGetTransientForHint(arg1,arg2,&res1)+--+-- %fun XSetTransientForHint :: Display -> Window -> Window -> IO ()+--+-- -- XRotateWindowProperties omitted+-- -- XGetWindowProperty omitted+--+-- -- XGetWindowAttributes omitted+-- -- XChangeWindowAttributes omitted++----------------------------------------------------------------+-- End+----------------------------------------------------------------
+ LICENSE view
@@ -0,0 +1,26 @@+The HSX11 Library is Copyright (c) Alastair Reid,+1997-2003, All rights reserved, and is distributed as free software+under the following license.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions+are met:++- Redistributions of source code must retain the above copyright notice,+this list of conditions and the following disclaimer.++- Neither name of the copyright holders nor the names of its+contributors may be used to endorse or promote products derived from+this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND THE CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+HOLDERS OR THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS+OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ Setup.hs view
@@ -0,0 +1,6 @@+module Main (main) where++import Distribution.Simple (defaultMainWithHooks, defaultUserHooks)++main :: IO ()+main = defaultMainWithHooks defaultUserHooks
+ X11.buildinfo.in view
@@ -0,0 +1,6 @@+-- @configure_input@+-- System-dependent values used by Distribution.Simple.defaultUserHooks+--+buildable: @BUILD_PACKAGE_BOOL@+cc-options: @X_CFLAGS@+ld-options: @X_LIBS@
+ X11.cabal view
@@ -0,0 +1,43 @@+name: X11+version: 1.2+license: BSD3+license-file: LICENSE+copyright: Alastair Reid, 1999-2003+maintainer: <libraries@haskell.org>+category: Graphics+synopsis: A binding to the X11 graphics library+description: A Haskell binding to the X11 graphics library.+ .+ The binding is a direct translation of the C binding; for+ documentation of these calls, refer to "The Xlib Programming+ Manual", available online at <http://tronche.com/gui/x/xlib/>.+extra-source-files:+ configure.ac configure+ config.mk.in X11.buildinfo.in include/HsX11Config.h.in+ include/HsXlib.h+extra-tmp-files:+ config.log config.status autom4te.cache+ config.mk X11.buildinfo include/HsX11Config.h+exposed-modules:+ Graphics.X11,+ Graphics.X11.Types,+ Graphics.X11.Xlib,+ Graphics.X11.Xlib.Atom,+ Graphics.X11.Xlib.Color,+ Graphics.X11.Xlib.Context,+ Graphics.X11.Xlib.Display,+ Graphics.X11.Xlib.Event,+ Graphics.X11.Xlib.Font,+ Graphics.X11.Xlib.Misc,+ Graphics.X11.Xlib.Region,+ Graphics.X11.Xlib.Screen,+ Graphics.X11.Xlib.Types,+ Graphics.X11.Xlib.Window+c-sources:+ cbits/fdset.c,+ cbits/auxiliaries.c+extensions: ForeignFunctionInterface, CPP+extra-libraries: "X11"+include-dirs: include+install-includes: HsXlib.h+build-depends: base
+ cbits/auxiliaries.c view
@@ -0,0 +1,11 @@+#include <stdio.h>+#include <X11/X.h>+#include <X11/Xlib.h>++int defaultErrorHandler(Display *d, XErrorEvent *ev)+{+ char buffer[1000];+ XGetErrorText(d,ev->error_code,buffer,1000);+ printf("Error: %s\n", buffer);+ return 0;+}
+ cbits/fdset.c view
@@ -0,0 +1,4 @@+#include "HsXlib.h"++void fdZero(fd_set *set) { FD_ZERO(set); }+void fdSet(int fd, fd_set *set) { FD_SET(fd, set); }
+ config.mk.in view
@@ -0,0 +1,10 @@+X11_BUILD_PACKAGE=@X11_BUILD_PACKAGE@+ifneq "$(X11_BUILD_PACKAGE)" "no"+X_CFLAGS=@X_CFLAGS@+X_PRE_LIBS=@X_PRE_LIBS@+X_LIBS=@X_LIBS@+X_EXTRA_LIBS=@X_EXTRA_LIBS@+PACKAGE=@PACKAGE_TARNAME@+VERSION=@PACKAGE_VERSION@+MAINTAINER=@PACKAGE_BUGREPORT@+endif
+ configure view
@@ -0,0 +1,4718 @@+#! /bin/sh+# Guess values for system-dependent variables and create Makefiles.+# Generated by GNU Autoconf 2.57 for Haskell X11 package 1.1.+#+# Report bugs to <libraries@haskell.org>.+#+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002+# Free Software Foundation, Inc.+# This configure script is free software; the Free Software Foundation+# gives unlimited permission to copy, distribute and modify it.+## --------------------- ##+## M4sh Initialization. ##+## --------------------- ##++# Be Bourne compatible+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then+ emulate sh+ NULLCMD=:+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which+ # is contrary to our usage. Disable this feature.+ alias -g '${1+"$@"}'='"$@"'+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then+ set -o posix+fi++# Support unset when possible.+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then+ as_unset=unset+else+ as_unset=false+fi+++# Work around bugs in pre-3.0 UWIN ksh.+$as_unset ENV MAIL MAILPATH+PS1='$ '+PS2='> '+PS4='+ '++# NLS nuisances.+for as_var in \+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \+ LC_TELEPHONE LC_TIME+do+ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then+ eval $as_var=C; export $as_var+ else+ $as_unset $as_var+ fi+done++# Required to use basename.+if expr a : '\(a\)' >/dev/null 2>&1; then+ as_expr=expr+else+ as_expr=false+fi++if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then+ as_basename=basename+else+ as_basename=false+fi+++# Name of the executable.+as_me=`$as_basename "$0" ||+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \+ X"$0" : 'X\(//\)$' \| \+ X"$0" : 'X\(/\)$' \| \+ . : '\(.\)' 2>/dev/null ||+echo X/"$0" |+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }+ /^X\/\(\/\/\)$/{ s//\1/; q; }+ /^X\/\(\/\).*/{ s//\1/; q; }+ s/.*/./; q'`+++# PATH needs CR, and LINENO needs CR and PATH.+# Avoid depending upon Character Ranges.+as_cr_letters='abcdefghijklmnopqrstuvwxyz'+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'+as_cr_Letters=$as_cr_letters$as_cr_LETTERS+as_cr_digits='0123456789'+as_cr_alnum=$as_cr_Letters$as_cr_digits++# The user is always right.+if test "${PATH_SEPARATOR+set}" != set; then+ echo "#! /bin/sh" >conf$$.sh+ echo "exit 0" >>conf$$.sh+ chmod +x conf$$.sh+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then+ PATH_SEPARATOR=';'+ else+ PATH_SEPARATOR=:+ fi+ rm -f conf$$.sh+fi+++ as_lineno_1=$LINENO+ as_lineno_2=$LINENO+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`+ test "x$as_lineno_1" != "x$as_lineno_2" &&+ test "x$as_lineno_3" = "x$as_lineno_2" || {+ # Find who we are. Look in the path if we contain no path at all+ # relative or not.+ case $0 in+ *[\\/]* ) as_myself=$0 ;;+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break+done++ ;;+ esac+ # We did not find ourselves, most probably we were run as `sh COMMAND'+ # in which case we are not to be found in the path.+ if test "x$as_myself" = x; then+ as_myself=$0+ fi+ if test ! -f "$as_myself"; then+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2+ { (exit 1); exit 1; }; }+ fi+ case $CONFIG_SHELL in+ '')+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ for as_base in sh bash ksh sh5; do+ case $as_dir in+ /*)+ if ("$as_dir/$as_base" -c '+ as_lineno_1=$LINENO+ as_lineno_2=$LINENO+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`+ test "x$as_lineno_1" != "x$as_lineno_2" &&+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }+ CONFIG_SHELL=$as_dir/$as_base+ export CONFIG_SHELL+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}+ fi;;+ esac+ done+done+;;+ esac++ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO+ # uniformly replaced by the line number. The first 'sed' inserts a+ # line-number line before each line; the second 'sed' does the real+ # work. The second script uses 'N' to pair each line-number line+ # with the numbered line, and appends trailing '-' during+ # substitution so that $LINENO is not a special case at line end.+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)+ sed '=' <$as_myself |+ sed '+ N+ s,$,-,+ : loop+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,+ t loop+ s,-$,,+ s,^['$as_cr_digits']*\n,,+ ' >$as_me.lineno &&+ chmod +x $as_me.lineno ||+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2+ { (exit 1); exit 1; }; }++ # Don't try to exec as it changes $[0], causing all sort of problems+ # (the dirname of $[0] is not the place where we might find the+ # original and so on. Autoconf is especially sensible to this).+ . ./$as_me.lineno+ # Exit status is that of the last command.+ exit+}+++case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in+ *c*,-n*) ECHO_N= ECHO_C='+' ECHO_T=' ' ;;+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;+esac++if expr a : '\(a\)' >/dev/null 2>&1; then+ as_expr=expr+else+ as_expr=false+fi++rm -f conf$$ conf$$.exe conf$$.file+echo >conf$$.file+if ln -s conf$$.file conf$$ 2>/dev/null; then+ # We could just check for DJGPP; but this test a) works b) is more generic+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).+ if test -f conf$$.exe; then+ # Don't use ln at all; we don't have any links+ as_ln_s='cp -p'+ else+ as_ln_s='ln -s'+ fi+elif ln conf$$.file conf$$ 2>/dev/null; then+ as_ln_s=ln+else+ as_ln_s='cp -p'+fi+rm -f conf$$ conf$$.exe conf$$.file++if mkdir -p . 2>/dev/null; then+ as_mkdir_p=:+else+ as_mkdir_p=false+fi++as_executable_p="test -f"++# Sed expression to map a string onto a valid CPP name.+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"++# Sed expression to map a string onto a valid variable name.+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"+++# IFS+# We need space, tab and new line, in precisely that order.+as_nl='+'+IFS=" $as_nl"++# CDPATH.+$as_unset CDPATH+++# Name of the host.+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,+# so uname gets run too.+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`++exec 6>&1++#+# Initializations.+#+ac_default_prefix=/usr/local+ac_config_libobj_dir=.+cross_compiling=no+subdirs=+MFLAGS=+MAKEFLAGS=+SHELL=${CONFIG_SHELL-/bin/sh}++# Maximum number of lines to put in a shell here document.+# This variable seems obsolete. It should probably be removed, and+# only ac_max_sed_lines should be used.+: ${ac_max_here_lines=38}++# Identity of this package.+PACKAGE_NAME='Haskell X11 package'+PACKAGE_TARNAME='X11'+PACKAGE_VERSION='1.1'+PACKAGE_STRING='Haskell X11 package 1.1'+PACKAGE_BUGREPORT='libraries@haskell.org'++ac_unique_file="include/HsXlib.h"+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS X11_BUILD_PACKAGE BUILD_PACKAGE_BOOL LIBOBJS LTLIBOBJS'+ac_subst_files=''++# Initialize some variables set by options.+ac_init_help=+ac_init_version=false+# The variables have the same names as the options, with+# dashes changed to underlines.+cache_file=/dev/null+exec_prefix=NONE+no_create=+no_recursion=+prefix=NONE+program_prefix=NONE+program_suffix=NONE+program_transform_name=s,x,x,+silent=+site=+srcdir=+verbose=+x_includes=NONE+x_libraries=NONE++# Installation directory options.+# These are left unexpanded so users can "make install exec_prefix=/foo"+# and all the variables that are supposed to be based on exec_prefix+# by default will actually change.+# Use braces instead of parens because sh, perl, etc. also accept them.+bindir='${exec_prefix}/bin'+sbindir='${exec_prefix}/sbin'+libexecdir='${exec_prefix}/libexec'+datadir='${prefix}/share'+sysconfdir='${prefix}/etc'+sharedstatedir='${prefix}/com'+localstatedir='${prefix}/var'+libdir='${exec_prefix}/lib'+includedir='${prefix}/include'+oldincludedir='/usr/include'+infodir='${prefix}/info'+mandir='${prefix}/man'++ac_prev=+for ac_option+do+ # If the previous option needs an argument, assign it.+ if test -n "$ac_prev"; then+ eval "$ac_prev=\$ac_option"+ ac_prev=+ continue+ fi++ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`++ # Accept the important Cygnus configure options, so we can diagnose typos.++ case $ac_option in++ -bindir | --bindir | --bindi | --bind | --bin | --bi)+ ac_prev=bindir ;;+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)+ bindir=$ac_optarg ;;++ -build | --build | --buil | --bui | --bu)+ ac_prev=build_alias ;;+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)+ build_alias=$ac_optarg ;;++ -cache-file | --cache-file | --cache-fil | --cache-fi \+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)+ ac_prev=cache_file ;;+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)+ cache_file=$ac_optarg ;;++ --config-cache | -C)+ cache_file=config.cache ;;++ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)+ ac_prev=datadir ;;+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \+ | --da=*)+ datadir=$ac_optarg ;;++ -disable-* | --disable-*)+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`+ # Reject names that are not valid shell variable names.+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2+ { (exit 1); exit 1; }; }+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`+ eval "enable_$ac_feature=no" ;;++ -enable-* | --enable-*)+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`+ # Reject names that are not valid shell variable names.+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2+ { (exit 1); exit 1; }; }+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`+ case $ac_option in+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;+ *) ac_optarg=yes ;;+ esac+ eval "enable_$ac_feature='$ac_optarg'" ;;++ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \+ | --exec | --exe | --ex)+ ac_prev=exec_prefix ;;+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \+ | --exec=* | --exe=* | --ex=*)+ exec_prefix=$ac_optarg ;;++ -gas | --gas | --ga | --g)+ # Obsolete; use --with-gas.+ with_gas=yes ;;++ -help | --help | --hel | --he | -h)+ ac_init_help=long ;;+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)+ ac_init_help=recursive ;;+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)+ ac_init_help=short ;;++ -host | --host | --hos | --ho)+ ac_prev=host_alias ;;+ -host=* | --host=* | --hos=* | --ho=*)+ host_alias=$ac_optarg ;;++ -includedir | --includedir | --includedi | --included | --include \+ | --includ | --inclu | --incl | --inc)+ ac_prev=includedir ;;+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \+ | --includ=* | --inclu=* | --incl=* | --inc=*)+ includedir=$ac_optarg ;;++ -infodir | --infodir | --infodi | --infod | --info | --inf)+ ac_prev=infodir ;;+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)+ infodir=$ac_optarg ;;++ -libdir | --libdir | --libdi | --libd)+ ac_prev=libdir ;;+ -libdir=* | --libdir=* | --libdi=* | --libd=*)+ libdir=$ac_optarg ;;++ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \+ | --libexe | --libex | --libe)+ ac_prev=libexecdir ;;+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \+ | --libexe=* | --libex=* | --libe=*)+ libexecdir=$ac_optarg ;;++ -localstatedir | --localstatedir | --localstatedi | --localstated \+ | --localstate | --localstat | --localsta | --localst \+ | --locals | --local | --loca | --loc | --lo)+ ac_prev=localstatedir ;;+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)+ localstatedir=$ac_optarg ;;++ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)+ ac_prev=mandir ;;+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)+ mandir=$ac_optarg ;;++ -nfp | --nfp | --nf)+ # Obsolete; use --without-fp.+ with_fp=no ;;++ -no-create | --no-create | --no-creat | --no-crea | --no-cre \+ | --no-cr | --no-c | -n)+ no_create=yes ;;++ -no-recursion | --no-recursion | --no-recursio | --no-recursi \+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)+ no_recursion=yes ;;++ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \+ | --oldin | --oldi | --old | --ol | --o)+ ac_prev=oldincludedir ;;+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)+ oldincludedir=$ac_optarg ;;++ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)+ ac_prev=prefix ;;+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)+ prefix=$ac_optarg ;;++ -program-prefix | --program-prefix | --program-prefi | --program-pref \+ | --program-pre | --program-pr | --program-p)+ ac_prev=program_prefix ;;+ -program-prefix=* | --program-prefix=* | --program-prefi=* \+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)+ program_prefix=$ac_optarg ;;++ -program-suffix | --program-suffix | --program-suffi | --program-suff \+ | --program-suf | --program-su | --program-s)+ ac_prev=program_suffix ;;+ -program-suffix=* | --program-suffix=* | --program-suffi=* \+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)+ program_suffix=$ac_optarg ;;++ -program-transform-name | --program-transform-name \+ | --program-transform-nam | --program-transform-na \+ | --program-transform-n | --program-transform- \+ | --program-transform | --program-transfor \+ | --program-transfo | --program-transf \+ | --program-trans | --program-tran \+ | --progr-tra | --program-tr | --program-t)+ ac_prev=program_transform_name ;;+ -program-transform-name=* | --program-transform-name=* \+ | --program-transform-nam=* | --program-transform-na=* \+ | --program-transform-n=* | --program-transform-=* \+ | --program-transform=* | --program-transfor=* \+ | --program-transfo=* | --program-transf=* \+ | --program-trans=* | --program-tran=* \+ | --progr-tra=* | --program-tr=* | --program-t=*)+ program_transform_name=$ac_optarg ;;++ -q | -quiet | --quiet | --quie | --qui | --qu | --q \+ | -silent | --silent | --silen | --sile | --sil)+ silent=yes ;;++ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)+ ac_prev=sbindir ;;+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \+ | --sbi=* | --sb=*)+ sbindir=$ac_optarg ;;++ -sharedstatedir | --sharedstatedir | --sharedstatedi \+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \+ | --sharedst | --shareds | --shared | --share | --shar \+ | --sha | --sh)+ ac_prev=sharedstatedir ;;+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \+ | --sha=* | --sh=*)+ sharedstatedir=$ac_optarg ;;++ -site | --site | --sit)+ ac_prev=site ;;+ -site=* | --site=* | --sit=*)+ site=$ac_optarg ;;++ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)+ ac_prev=srcdir ;;+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)+ srcdir=$ac_optarg ;;++ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \+ | --syscon | --sysco | --sysc | --sys | --sy)+ ac_prev=sysconfdir ;;+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)+ sysconfdir=$ac_optarg ;;++ -target | --target | --targe | --targ | --tar | --ta | --t)+ ac_prev=target_alias ;;+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)+ target_alias=$ac_optarg ;;++ -v | -verbose | --verbose | --verbos | --verbo | --verb)+ verbose=yes ;;++ -version | --version | --versio | --versi | --vers | -V)+ ac_init_version=: ;;++ -with-* | --with-*)+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`+ # Reject names that are not valid shell variable names.+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&+ { echo "$as_me: error: invalid package name: $ac_package" >&2+ { (exit 1); exit 1; }; }+ ac_package=`echo $ac_package| sed 's/-/_/g'`+ case $ac_option in+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;+ *) ac_optarg=yes ;;+ esac+ eval "with_$ac_package='$ac_optarg'" ;;++ -without-* | --without-*)+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`+ # Reject names that are not valid shell variable names.+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&+ { echo "$as_me: error: invalid package name: $ac_package" >&2+ { (exit 1); exit 1; }; }+ ac_package=`echo $ac_package | sed 's/-/_/g'`+ eval "with_$ac_package=no" ;;++ --x)+ # Obsolete; use --with-x.+ with_x=yes ;;++ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \+ | --x-incl | --x-inc | --x-in | --x-i)+ ac_prev=x_includes ;;+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)+ x_includes=$ac_optarg ;;++ -x-libraries | --x-libraries | --x-librarie | --x-librari \+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)+ ac_prev=x_libraries ;;+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)+ x_libraries=$ac_optarg ;;++ -*) { echo "$as_me: error: unrecognized option: $ac_option+Try \`$0 --help' for more information." >&2+ { (exit 1); exit 1; }; }+ ;;++ *=*)+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`+ # Reject names that are not valid shell variable names.+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2+ { (exit 1); exit 1; }; }+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`+ eval "$ac_envvar='$ac_optarg'"+ export $ac_envvar ;;++ *)+ # FIXME: should be removed in autoconf 3.0.+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}+ ;;++ esac+done++if test -n "$ac_prev"; then+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`+ { echo "$as_me: error: missing argument to $ac_option" >&2+ { (exit 1); exit 1; }; }+fi++# Be sure to have absolute paths.+for ac_var in exec_prefix prefix+do+ eval ac_val=$`echo $ac_var`+ case $ac_val in+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2+ { (exit 1); exit 1; }; };;+ esac+done++# Be sure to have absolute paths.+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \+ localstatedir libdir includedir oldincludedir infodir mandir+do+ eval ac_val=$`echo $ac_var`+ case $ac_val in+ [\\/$]* | ?:[\\/]* ) ;;+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2+ { (exit 1); exit 1; }; };;+ esac+done++# There might be people who depend on the old broken behavior: `$host'+# used to hold the argument of --host etc.+# FIXME: To remove some day.+build=$build_alias+host=$host_alias+target=$target_alias++# FIXME: To remove some day.+if test "x$host_alias" != x; then+ if test "x$build_alias" = x; then+ cross_compiling=maybe+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.+ If a cross compiler is detected then cross compile mode will be used." >&2+ elif test "x$build_alias" != "x$host_alias"; then+ cross_compiling=yes+ fi+fi++ac_tool_prefix=+test -n "$host_alias" && ac_tool_prefix=$host_alias-++test "$silent" = yes && exec 6>/dev/null+++# Find the source files, if location was not specified.+if test -z "$srcdir"; then+ ac_srcdir_defaulted=yes+ # Try the directory containing this script, then its parent.+ ac_confdir=`(dirname "$0") 2>/dev/null ||+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \+ X"$0" : 'X\(//\)[^/]' \| \+ X"$0" : 'X\(//\)$' \| \+ X"$0" : 'X\(/\)' \| \+ . : '\(.\)' 2>/dev/null ||+echo X"$0" |+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }+ /^X\(\/\/\)$/{ s//\1/; q; }+ /^X\(\/\).*/{ s//\1/; q; }+ s/.*/./; q'`+ srcdir=$ac_confdir+ if test ! -r $srcdir/$ac_unique_file; then+ srcdir=..+ fi+else+ ac_srcdir_defaulted=no+fi+if test ! -r $srcdir/$ac_unique_file; then+ if test "$ac_srcdir_defaulted" = yes; then+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2+ { (exit 1); exit 1; }; }+ else+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2+ { (exit 1); exit 1; }; }+ fi+fi+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2+ { (exit 1); exit 1; }; }+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`+ac_env_build_alias_set=${build_alias+set}+ac_env_build_alias_value=$build_alias+ac_cv_env_build_alias_set=${build_alias+set}+ac_cv_env_build_alias_value=$build_alias+ac_env_host_alias_set=${host_alias+set}+ac_env_host_alias_value=$host_alias+ac_cv_env_host_alias_set=${host_alias+set}+ac_cv_env_host_alias_value=$host_alias+ac_env_target_alias_set=${target_alias+set}+ac_env_target_alias_value=$target_alias+ac_cv_env_target_alias_set=${target_alias+set}+ac_cv_env_target_alias_value=$target_alias+ac_env_CC_set=${CC+set}+ac_env_CC_value=$CC+ac_cv_env_CC_set=${CC+set}+ac_cv_env_CC_value=$CC+ac_env_CFLAGS_set=${CFLAGS+set}+ac_env_CFLAGS_value=$CFLAGS+ac_cv_env_CFLAGS_set=${CFLAGS+set}+ac_cv_env_CFLAGS_value=$CFLAGS+ac_env_LDFLAGS_set=${LDFLAGS+set}+ac_env_LDFLAGS_value=$LDFLAGS+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}+ac_cv_env_LDFLAGS_value=$LDFLAGS+ac_env_CPPFLAGS_set=${CPPFLAGS+set}+ac_env_CPPFLAGS_value=$CPPFLAGS+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}+ac_cv_env_CPPFLAGS_value=$CPPFLAGS+ac_env_CPP_set=${CPP+set}+ac_env_CPP_value=$CPP+ac_cv_env_CPP_set=${CPP+set}+ac_cv_env_CPP_value=$CPP++#+# Report the --help message.+#+if test "$ac_init_help" = "long"; then+ # Omit some internal or obsolete options to make the list less imposing.+ # This message is too long to be a string in the A/UX 3.1 sh.+ cat <<_ACEOF+\`configure' configures Haskell X11 package 1.1 to adapt to many kinds of systems.++Usage: $0 [OPTION]... [VAR=VALUE]...++To assign environment variables (e.g., CC, CFLAGS...), specify them as+VAR=VALUE. See below for descriptions of some of the useful variables.++Defaults for the options are specified in brackets.++Configuration:+ -h, --help display this help and exit+ --help=short display options specific to this package+ --help=recursive display the short help of all the included packages+ -V, --version display version information and exit+ -q, --quiet, --silent do not print \`checking...' messages+ --cache-file=FILE cache test results in FILE [disabled]+ -C, --config-cache alias for \`--cache-file=config.cache'+ -n, --no-create do not create output files+ --srcdir=DIR find the sources in DIR [configure dir or \`..']++_ACEOF++ cat <<_ACEOF+Installation directories:+ --prefix=PREFIX install architecture-independent files in PREFIX+ [$ac_default_prefix]+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX+ [PREFIX]++By default, \`make install' will install all the files in+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify+an installation prefix other than \`$ac_default_prefix' using \`--prefix',+for instance \`--prefix=\$HOME'.++For better control, use the options below.++Fine tuning of the installation directories:+ --bindir=DIR user executables [EPREFIX/bin]+ --sbindir=DIR system admin executables [EPREFIX/sbin]+ --libexecdir=DIR program executables [EPREFIX/libexec]+ --datadir=DIR read-only architecture-independent data [PREFIX/share]+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]+ --libdir=DIR object code libraries [EPREFIX/lib]+ --includedir=DIR C header files [PREFIX/include]+ --oldincludedir=DIR C header files for non-gcc [/usr/include]+ --infodir=DIR info documentation [PREFIX/info]+ --mandir=DIR man documentation [PREFIX/man]+_ACEOF++ cat <<\_ACEOF++X features:+ --x-includes=DIR X include files are in DIR+ --x-libraries=DIR X library files are in DIR+_ACEOF+fi++if test -n "$ac_init_help"; then+ case $ac_init_help in+ short | recursive ) echo "Configuration of Haskell X11 package 1.1:";;+ esac+ cat <<\_ACEOF++Optional Features:+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]+ --enable-x11 build a Haskell binding for X11.+ (default=autodetect)++Optional Packages:+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)+ --with-x use the X Window System++Some influential environment variables:+ CC C compiler command+ CFLAGS C compiler flags+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a+ nonstandard directory <lib dir>+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have+ headers in a nonstandard directory <include dir>+ CPP C preprocessor++Use these variables to override the choices made by `configure' or to help+it to find libraries and programs with nonstandard names/locations.++Report bugs to <libraries@haskell.org>.+_ACEOF+fi++if test "$ac_init_help" = "recursive"; then+ # If there are subdirs, report their specific --help.+ ac_popdir=`pwd`+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue+ test -d $ac_dir || continue+ ac_builddir=.++if test "$ac_dir" != .; then+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`+ # A "../" for each directory in $ac_dir_suffix.+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`+else+ ac_dir_suffix= ac_top_builddir=+fi++case $srcdir in+ .) # No --srcdir option. We are building in place.+ ac_srcdir=.+ if test -z "$ac_top_builddir"; then+ ac_top_srcdir=.+ else+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`+ fi ;;+ [\\/]* | ?:[\\/]* ) # Absolute path.+ ac_srcdir=$srcdir$ac_dir_suffix;+ ac_top_srcdir=$srcdir ;;+ *) # Relative path.+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix+ ac_top_srcdir=$ac_top_builddir$srcdir ;;+esac+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be+# absolute.+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`++ cd $ac_dir+ # Check for guested configure; otherwise get Cygnus style configure.+ if test -f $ac_srcdir/configure.gnu; then+ echo+ $SHELL $ac_srcdir/configure.gnu --help=recursive+ elif test -f $ac_srcdir/configure; then+ echo+ $SHELL $ac_srcdir/configure --help=recursive+ elif test -f $ac_srcdir/configure.ac ||+ test -f $ac_srcdir/configure.in; then+ echo+ $ac_configure --help+ else+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2+ fi+ cd $ac_popdir+ done+fi++test -n "$ac_init_help" && exit 0+if $ac_init_version; then+ cat <<\_ACEOF+Haskell X11 package configure 1.1+generated by GNU Autoconf 2.57++Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002+Free Software Foundation, Inc.+This configure script is free software; the Free Software Foundation+gives unlimited permission to copy, distribute and modify it.+_ACEOF+ exit 0+fi+exec 5>config.log+cat >&5 <<_ACEOF+This file contains any messages produced by compilers while+running configure, to aid debugging if configure makes a mistake.++It was created by Haskell X11 package $as_me 1.1, which was+generated by GNU Autoconf 2.57. Invocation command line was++ $ $0 $@++_ACEOF+{+cat <<_ASUNAME+## --------- ##+## Platform. ##+## --------- ##++hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`+uname -m = `(uname -m) 2>/dev/null || echo unknown`+uname -r = `(uname -r) 2>/dev/null || echo unknown`+uname -s = `(uname -s) 2>/dev/null || echo unknown`+uname -v = `(uname -v) 2>/dev/null || echo unknown`++/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`++/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`++_ASUNAME++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ echo "PATH: $as_dir"+done++} >&5++cat >&5 <<_ACEOF+++## ----------- ##+## Core tests. ##+## ----------- ##++_ACEOF+++# Keep a trace of the command line.+# Strip out --no-create and --no-recursion so they do not pile up.+# Strip out --silent because we don't want to record it for future runs.+# Also quote any args containing shell meta-characters.+# Make two passes to allow for proper duplicate-argument suppression.+ac_configure_args=+ac_configure_args0=+ac_configure_args1=+ac_sep=+ac_must_keep_next=false+for ac_pass in 1 2+do+ for ac_arg+ do+ case $ac_arg in+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \+ | -silent | --silent | --silen | --sile | --sil)+ continue ;;+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;+ esac+ case $ac_pass in+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;+ 2)+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"+ if test $ac_must_keep_next = true; then+ ac_must_keep_next=false # Got value, back to normal.+ else+ case $ac_arg in+ *=* | --config-cache | -C | -disable-* | --disable-* \+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \+ | -with-* | --with-* | -without-* | --without-* | --x)+ case "$ac_configure_args0 " in+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;+ esac+ ;;+ -* ) ac_must_keep_next=true ;;+ esac+ fi+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"+ # Get rid of the leading space.+ ac_sep=" "+ ;;+ esac+ done+done+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }++# When interrupted or exit'd, cleanup temporary files, and complete+# config.log. We remove comments because anyway the quotes in there+# would cause problems or look ugly.+# WARNING: Be sure not to use single quotes in there, as some shells,+# such as our DU 5.0 friend, will then `close' the trap.+trap 'exit_status=$?+ # Save into config.log some information that might help in debugging.+ {+ echo++ cat <<\_ASBOX+## ---------------- ##+## Cache variables. ##+## ---------------- ##+_ASBOX+ echo+ # The following way of writing the cache mishandles newlines in values,+{+ (set) 2>&1 |+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in+ *ac_space=\ *)+ sed -n \+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"+ ;;+ *)+ sed -n \+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"+ ;;+ esac;+}+ echo++ cat <<\_ASBOX+## ----------------- ##+## Output variables. ##+## ----------------- ##+_ASBOX+ echo+ for ac_var in $ac_subst_vars+ do+ eval ac_val=$`echo $ac_var`+ echo "$ac_var='"'"'$ac_val'"'"'"+ done | sort+ echo++ if test -n "$ac_subst_files"; then+ cat <<\_ASBOX+## ------------- ##+## Output files. ##+## ------------- ##+_ASBOX+ echo+ for ac_var in $ac_subst_files+ do+ eval ac_val=$`echo $ac_var`+ echo "$ac_var='"'"'$ac_val'"'"'"+ done | sort+ echo+ fi++ if test -s confdefs.h; then+ cat <<\_ASBOX+## ----------- ##+## confdefs.h. ##+## ----------- ##+_ASBOX+ echo+ sed "/^$/d" confdefs.h | sort+ echo+ fi+ test "$ac_signal" != 0 &&+ echo "$as_me: caught signal $ac_signal"+ echo "$as_me: exit $exit_status"+ } >&5+ rm -f core core.* *.core &&+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&+ exit $exit_status+ ' 0+for ac_signal in 1 2 13 15; do+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal+done+ac_signal=0++# confdefs.h avoids OS command line length limits that DEFS can exceed.+rm -rf conftest* confdefs.h+# AIX cpp loses on an empty file, so make sure it contains at least a newline.+echo >confdefs.h++# Predefined preprocessor variables.++cat >>confdefs.h <<_ACEOF+#define PACKAGE_NAME "$PACKAGE_NAME"+_ACEOF+++cat >>confdefs.h <<_ACEOF+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"+_ACEOF+++cat >>confdefs.h <<_ACEOF+#define PACKAGE_VERSION "$PACKAGE_VERSION"+_ACEOF+++cat >>confdefs.h <<_ACEOF+#define PACKAGE_STRING "$PACKAGE_STRING"+_ACEOF+++cat >>confdefs.h <<_ACEOF+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"+_ACEOF+++# Let the site file select an alternate cache file if it wants to.+# Prefer explicitly selected file to automatically selected ones.+if test -z "$CONFIG_SITE"; then+ if test "x$prefix" != xNONE; then+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"+ else+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"+ fi+fi+for ac_site_file in $CONFIG_SITE; do+ if test -r "$ac_site_file"; then+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5+echo "$as_me: loading site script $ac_site_file" >&6;}+ sed 's/^/| /' "$ac_site_file" >&5+ . "$ac_site_file"+ fi+done++if test -r "$cache_file"; then+ # Some versions of bash will fail to source /dev/null (special+ # files actually), so we avoid doing that.+ if test -f "$cache_file"; then+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5+echo "$as_me: loading cache $cache_file" >&6;}+ case $cache_file in+ [\\/]* | ?:[\\/]* ) . $cache_file;;+ *) . ./$cache_file;;+ esac+ fi+else+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5+echo "$as_me: creating cache $cache_file" >&6;}+ >$cache_file+fi++# Check that the precious variables saved in the cache have kept the same+# value.+ac_cache_corrupted=false+for ac_var in `(set) 2>&1 |+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do+ eval ac_old_set=\$ac_cv_env_${ac_var}_set+ eval ac_new_set=\$ac_env_${ac_var}_set+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"+ eval ac_new_val="\$ac_env_${ac_var}_value"+ case $ac_old_set,$ac_new_set in+ set,)+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}+ ac_cache_corrupted=: ;;+ ,set)+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}+ ac_cache_corrupted=: ;;+ ,);;+ *)+ if test "x$ac_old_val" != "x$ac_new_val"; then+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5+echo "$as_me: former value: $ac_old_val" >&2;}+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5+echo "$as_me: current value: $ac_new_val" >&2;}+ ac_cache_corrupted=:+ fi;;+ esac+ # Pass precious variables to config.status.+ if test "$ac_new_set" = set; then+ case $ac_new_val in+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;+ *) ac_arg=$ac_var=$ac_new_val ;;+ esac+ case " $ac_configure_args " in+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;+ esac+ fi+done+if $ac_cache_corrupted; then+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5+echo "$as_me: error: changes in the environment can compromise the build" >&2;}+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}+ { (exit 1); exit 1; }; }+fi++ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu+++++++++++++++++++++++++++++# Check whether --enable-x11 or --disable-x11 was given.+if test "${enable_x11+set}" = set; then+ enableval="$enable_x11"+ enable_x11=$enableval+else+ enable_x11=yes+fi;+++if test "$enable_x11" = no; then+ X11_BUILD_PACKAGE=no+ BUILD_PACKAGE_BOOL=False+else+# Safety check: Ensure that we are in the correct source directory.+++ ac_config_headers="$ac_config_headers include/HsX11Config.h"+++# Check for X11 include paths and libraries+ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu+if test -n "$ac_tool_prefix"; then+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.+set dummy ${ac_tool_prefix}gcc; ac_word=$2+echo "$as_me:$LINENO: checking for $ac_word" >&5+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6+if test "${ac_cv_prog_CC+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ if test -n "$CC"; then+ ac_cv_prog_CC="$CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ for ac_exec_ext in '' $ac_executable_extensions; do+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+ ac_cv_prog_CC="${ac_tool_prefix}gcc"+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5+ break 2+ fi+done+done++fi+fi+CC=$ac_cv_prog_CC+if test -n "$CC"; then+ echo "$as_me:$LINENO: result: $CC" >&5+echo "${ECHO_T}$CC" >&6+else+ echo "$as_me:$LINENO: result: no" >&5+echo "${ECHO_T}no" >&6+fi++fi+if test -z "$ac_cv_prog_CC"; then+ ac_ct_CC=$CC+ # Extract the first word of "gcc", so it can be a program name with args.+set dummy gcc; ac_word=$2+echo "$as_me:$LINENO: checking for $ac_word" >&5+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ if test -n "$ac_ct_CC"; then+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ for ac_exec_ext in '' $ac_executable_extensions; do+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+ ac_cv_prog_ac_ct_CC="gcc"+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5+ break 2+ fi+done+done++fi+fi+ac_ct_CC=$ac_cv_prog_ac_ct_CC+if test -n "$ac_ct_CC"; then+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5+echo "${ECHO_T}$ac_ct_CC" >&6+else+ echo "$as_me:$LINENO: result: no" >&5+echo "${ECHO_T}no" >&6+fi++ CC=$ac_ct_CC+else+ CC="$ac_cv_prog_CC"+fi++if test -z "$CC"; then+ if test -n "$ac_tool_prefix"; then+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.+set dummy ${ac_tool_prefix}cc; ac_word=$2+echo "$as_me:$LINENO: checking for $ac_word" >&5+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6+if test "${ac_cv_prog_CC+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ if test -n "$CC"; then+ ac_cv_prog_CC="$CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ for ac_exec_ext in '' $ac_executable_extensions; do+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+ ac_cv_prog_CC="${ac_tool_prefix}cc"+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5+ break 2+ fi+done+done++fi+fi+CC=$ac_cv_prog_CC+if test -n "$CC"; then+ echo "$as_me:$LINENO: result: $CC" >&5+echo "${ECHO_T}$CC" >&6+else+ echo "$as_me:$LINENO: result: no" >&5+echo "${ECHO_T}no" >&6+fi++fi+if test -z "$ac_cv_prog_CC"; then+ ac_ct_CC=$CC+ # Extract the first word of "cc", so it can be a program name with args.+set dummy cc; ac_word=$2+echo "$as_me:$LINENO: checking for $ac_word" >&5+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ if test -n "$ac_ct_CC"; then+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ for ac_exec_ext in '' $ac_executable_extensions; do+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+ ac_cv_prog_ac_ct_CC="cc"+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5+ break 2+ fi+done+done++fi+fi+ac_ct_CC=$ac_cv_prog_ac_ct_CC+if test -n "$ac_ct_CC"; then+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5+echo "${ECHO_T}$ac_ct_CC" >&6+else+ echo "$as_me:$LINENO: result: no" >&5+echo "${ECHO_T}no" >&6+fi++ CC=$ac_ct_CC+else+ CC="$ac_cv_prog_CC"+fi++fi+if test -z "$CC"; then+ # Extract the first word of "cc", so it can be a program name with args.+set dummy cc; ac_word=$2+echo "$as_me:$LINENO: checking for $ac_word" >&5+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6+if test "${ac_cv_prog_CC+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ if test -n "$CC"; then+ ac_cv_prog_CC="$CC" # Let the user override the test.+else+ ac_prog_rejected=no+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ for ac_exec_ext in '' $ac_executable_extensions; do+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then+ ac_prog_rejected=yes+ continue+ fi+ ac_cv_prog_CC="cc"+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5+ break 2+ fi+done+done++if test $ac_prog_rejected = yes; then+ # We found a bogon in the path, so make sure we never use it.+ set dummy $ac_cv_prog_CC+ shift+ if test $# != 0; then+ # We chose a different compiler from the bogus one.+ # However, it has the same basename, so the bogon will be chosen+ # first if we set CC to just the basename; use the full file name.+ shift+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"+ fi+fi+fi+fi+CC=$ac_cv_prog_CC+if test -n "$CC"; then+ echo "$as_me:$LINENO: result: $CC" >&5+echo "${ECHO_T}$CC" >&6+else+ echo "$as_me:$LINENO: result: no" >&5+echo "${ECHO_T}no" >&6+fi++fi+if test -z "$CC"; then+ if test -n "$ac_tool_prefix"; then+ for ac_prog in cl+ do+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.+set dummy $ac_tool_prefix$ac_prog; ac_word=$2+echo "$as_me:$LINENO: checking for $ac_word" >&5+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6+if test "${ac_cv_prog_CC+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ if test -n "$CC"; then+ ac_cv_prog_CC="$CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ for ac_exec_ext in '' $ac_executable_extensions; do+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5+ break 2+ fi+done+done++fi+fi+CC=$ac_cv_prog_CC+if test -n "$CC"; then+ echo "$as_me:$LINENO: result: $CC" >&5+echo "${ECHO_T}$CC" >&6+else+ echo "$as_me:$LINENO: result: no" >&5+echo "${ECHO_T}no" >&6+fi++ test -n "$CC" && break+ done+fi+if test -z "$CC"; then+ ac_ct_CC=$CC+ for ac_prog in cl+do+ # Extract the first word of "$ac_prog", so it can be a program name with args.+set dummy $ac_prog; ac_word=$2+echo "$as_me:$LINENO: checking for $ac_word" >&5+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ if test -n "$ac_ct_CC"; then+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ for ac_exec_ext in '' $ac_executable_extensions; do+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+ ac_cv_prog_ac_ct_CC="$ac_prog"+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5+ break 2+ fi+done+done++fi+fi+ac_ct_CC=$ac_cv_prog_ac_ct_CC+if test -n "$ac_ct_CC"; then+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5+echo "${ECHO_T}$ac_ct_CC" >&6+else+ echo "$as_me:$LINENO: result: no" >&5+echo "${ECHO_T}no" >&6+fi++ test -n "$ac_ct_CC" && break+done++ CC=$ac_ct_CC+fi++fi+++test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH+See \`config.log' for more details." >&5+echo "$as_me: error: no acceptable C compiler found in \$PATH+See \`config.log' for more details." >&2;}+ { (exit 1); exit 1; }; }++# Provide some information about the compiler.+echo "$as_me:$LINENO:" \+ "checking for C compiler version" >&5+ac_compiler=`set X $ac_compile; echo $2`+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5+ (eval $ac_compiler --version </dev/null >&5) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5+ (eval $ac_compiler -v </dev/null >&5) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5+ (eval $ac_compiler -V </dev/null >&5) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }++cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */++int+main ()+{++ ;+ return 0;+}+_ACEOF+ac_clean_files_save=$ac_clean_files+ac_clean_files="$ac_clean_files a.out a.exe b.out"+# Try to create an executable without -o first, disregard a.out.+# It will help us diagnose broken compilers, and finding out an intuition+# of exeext.+echo "$as_me:$LINENO: checking for C compiler default output" >&5+echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5+ (eval $ac_link_default) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; then+ # Find the output, starting from the most likely. This scheme is+# not robust to junk in `.', hence go to wildcards (a.*) only as a last+# resort.++# Be careful to initialize this variable, since it used to be cached.+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.+ac_cv_exeext=+# b.out is created by i960 compilers.+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out+do+ test -f "$ac_file" || continue+ case $ac_file in+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )+ ;;+ conftest.$ac_ext )+ # This is the source file.+ ;;+ [ab].out )+ # We found the default executable, but exeext='' is most+ # certainly right.+ break;;+ *.* )+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`+ # FIXME: I believe we export ac_cv_exeext for Libtool,+ # but it would be cool to find out if it's true. Does anybody+ # maintain Libtool? --akim.+ export ac_cv_exeext+ break;;+ * )+ break;;+ esac+done+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++{ { echo "$as_me:$LINENO: error: C compiler cannot create executables+See \`config.log' for more details." >&5+echo "$as_me: error: C compiler cannot create executables+See \`config.log' for more details." >&2;}+ { (exit 77); exit 77; }; }+fi++ac_exeext=$ac_cv_exeext+echo "$as_me:$LINENO: result: $ac_file" >&5+echo "${ECHO_T}$ac_file" >&6++# Check the compiler produces executables we can run. If not, either+# the compiler is broken, or we cross compile.+echo "$as_me:$LINENO: checking whether the C compiler works" >&5+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0+# If not cross compiling, check that we can run a simple program.+if test "$cross_compiling" != yes; then+ if { ac_try='./$ac_file'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ cross_compiling=no+ else+ if test "$cross_compiling" = maybe; then+ cross_compiling=yes+ else+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.+If you meant to cross compile, use \`--host'.+See \`config.log' for more details." >&5+echo "$as_me: error: cannot run C compiled programs.+If you meant to cross compile, use \`--host'.+See \`config.log' for more details." >&2;}+ { (exit 1); exit 1; }; }+ fi+ fi+fi+echo "$as_me:$LINENO: result: yes" >&5+echo "${ECHO_T}yes" >&6++rm -f a.out a.exe conftest$ac_cv_exeext b.out+ac_clean_files=$ac_clean_files_save+# Check the compiler produces executables we can run. If not, either+# the compiler is broken, or we cross compile.+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6+echo "$as_me:$LINENO: result: $cross_compiling" >&5+echo "${ECHO_T}$cross_compiling" >&6++echo "$as_me:$LINENO: checking for suffix of executables" >&5+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5+ (eval $ac_link) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; then+ # If both `conftest.exe' and `conftest' are `present' (well, observable)+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will+# work properly (i.e., refer to `conftest.exe'), while it won't with+# `rm'.+for ac_file in conftest.exe conftest conftest.*; do+ test -f "$ac_file" || continue+ case $ac_file in+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`+ export ac_cv_exeext+ break;;+ * ) break;;+ esac+done+else+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link+See \`config.log' for more details." >&5+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link+See \`config.log' for more details." >&2;}+ { (exit 1); exit 1; }; }+fi++rm -f conftest$ac_cv_exeext+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5+echo "${ECHO_T}$ac_cv_exeext" >&6++rm -f conftest.$ac_ext+EXEEXT=$ac_cv_exeext+ac_exeext=$EXEEXT+echo "$as_me:$LINENO: checking for suffix of object files" >&5+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6+if test "${ac_cv_objext+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */++int+main ()+{++ ;+ return 0;+}+_ACEOF+rm -f conftest.o conftest.obj+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5+ (eval $ac_compile) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; then+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do+ case $ac_file in+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`+ break;;+ esac+done+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile+See \`config.log' for more details." >&5+echo "$as_me: error: cannot compute suffix of object files: cannot compile+See \`config.log' for more details." >&2;}+ { (exit 1); exit 1; }; }+fi++rm -f conftest.$ac_cv_objext conftest.$ac_ext+fi+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5+echo "${ECHO_T}$ac_cv_objext" >&6+OBJEXT=$ac_cv_objext+ac_objext=$OBJEXT+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6+if test "${ac_cv_c_compiler_gnu+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */++int+main ()+{+#ifndef __GNUC__+ choke me+#endif++ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5+ (eval $ac_compile) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest.$ac_objext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ ac_compiler_gnu=yes+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ac_compiler_gnu=no+fi+rm -f conftest.$ac_objext conftest.$ac_ext+ac_cv_c_compiler_gnu=$ac_compiler_gnu++fi+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6+GCC=`test $ac_compiler_gnu = yes && echo yes`+ac_test_CFLAGS=${CFLAGS+set}+ac_save_CFLAGS=$CFLAGS+CFLAGS="-g"+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6+if test "${ac_cv_prog_cc_g+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */++int+main ()+{++ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5+ (eval $ac_compile) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest.$ac_objext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ ac_cv_prog_cc_g=yes+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ac_cv_prog_cc_g=no+fi+rm -f conftest.$ac_objext conftest.$ac_ext+fi+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6+if test "$ac_test_CFLAGS" = set; then+ CFLAGS=$ac_save_CFLAGS+elif test $ac_cv_prog_cc_g = yes; then+ if test "$GCC" = yes; then+ CFLAGS="-g -O2"+ else+ CFLAGS="-g"+ fi+else+ if test "$GCC" = yes; then+ CFLAGS="-O2"+ else+ CFLAGS=+ fi+fi+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6+if test "${ac_cv_prog_cc_stdc+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ ac_cv_prog_cc_stdc=no+ac_save_CC=$CC+cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */+#include <stdarg.h>+#include <stdio.h>+#include <sys/types.h>+#include <sys/stat.h>+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */+struct buf { int x; };+FILE * (*rcsopen) (struct buf *, struct stat *, int);+static char *e (p, i)+ char **p;+ int i;+{+ return p[i];+}+static char *f (char * (*g) (char **, int), char **p, ...)+{+ char *s;+ va_list v;+ va_start (v,p);+ s = g (p, va_arg (v,int));+ va_end (v);+ return s;+}+int test (int i, double x);+struct s1 {int (*f) (int a);};+struct s2 {int (*f) (double a);};+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);+int argc;+char **argv;+int+main ()+{+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];+ ;+ return 0;+}+_ACEOF+# Don't try gcc -ansi; that turns off useful extensions and+# breaks some systems' header files.+# AIX -qlanglvl=ansi+# Ultrix and OSF/1 -std1+# HP-UX 10.20 and later -Ae+# HP-UX older versions -Aa -D_HPUX_SOURCE+# SVR4 -Xc -D__EXTENSIONS__+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"+do+ CC="$ac_save_CC $ac_arg"+ rm -f conftest.$ac_objext+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5+ (eval $ac_compile) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest.$ac_objext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ ac_cv_prog_cc_stdc=$ac_arg+break+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++fi+rm -f conftest.$ac_objext+done+rm -f conftest.$ac_ext conftest.$ac_objext+CC=$ac_save_CC++fi++case "x$ac_cv_prog_cc_stdc" in+ x|xno)+ echo "$as_me:$LINENO: result: none needed" >&5+echo "${ECHO_T}none needed" >&6 ;;+ *)+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6+ CC="$CC $ac_cv_prog_cc_stdc" ;;+esac++# Some people use a C++ compiler to compile C. Since we use `exit',+# in C++ we need to declare it. In case someone uses the same compiler+# for both compiling C and C++ we need to have the C++ compiler decide+# the declaration of exit, since it's the most demanding environment.+cat >conftest.$ac_ext <<_ACEOF+#ifndef __cplusplus+ choke me+#endif+_ACEOF+rm -f conftest.$ac_objext+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5+ (eval $ac_compile) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest.$ac_objext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ for ac_declaration in \+ ''\+ '#include <stdlib.h>' \+ 'extern "C" void std::exit (int) throw (); using std::exit;' \+ 'extern "C" void std::exit (int); using std::exit;' \+ 'extern "C" void exit (int) throw ();' \+ 'extern "C" void exit (int);' \+ 'void exit (int);'+do+ cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */+#include <stdlib.h>+$ac_declaration+int+main ()+{+exit (42);+ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5+ (eval $ac_compile) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest.$ac_objext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ :+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++continue+fi+rm -f conftest.$ac_objext conftest.$ac_ext+ cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */+$ac_declaration+int+main ()+{+exit (42);+ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5+ (eval $ac_compile) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest.$ac_objext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ break+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++fi+rm -f conftest.$ac_objext conftest.$ac_ext+done+rm -f conftest*+if test -n "$ac_declaration"; then+ echo '#ifdef __cplusplus' >>confdefs.h+ echo $ac_declaration >>confdefs.h+ echo '#endif' >>confdefs.h+fi++else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++fi+rm -f conftest.$ac_objext conftest.$ac_ext+ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu+++ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6+# On Suns, sometimes $CPP names a directory.+if test -n "$CPP" && test -d "$CPP"; then+ CPP=+fi+if test -z "$CPP"; then+ if test "${ac_cv_prog_CPP+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ # Double quotes because CPP needs to be expanded+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"+ do+ ac_preproc_ok=false+for ac_c_preproc_warn_flag in '' yes+do+ # Use a header file that comes with gcc, so configuring glibc+ # with a fresh cross-compiler works.+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since+ # <limits.h> exists even on freestanding compilers.+ # On the NeXT, cc -E runs the code through the compiler's parser,+ # not just through cpp. "Syntax error" is here to catch this case.+ cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */+#ifdef __STDC__+# include <limits.h>+#else+# include <assert.h>+#endif+ Syntax error+_ACEOF+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1+ ac_status=$?+ grep -v '^ *+' conftest.er1 >conftest.err+ rm -f conftest.er1+ cat conftest.err >&5+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } >/dev/null; then+ if test -s conftest.err; then+ ac_cpp_err=$ac_c_preproc_warn_flag+ else+ ac_cpp_err=+ fi+else+ ac_cpp_err=yes+fi+if test -z "$ac_cpp_err"; then+ :+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ # Broken: fails on valid input.+continue+fi+rm -f conftest.err conftest.$ac_ext++ # OK, works on sane cases. Now check whether non-existent headers+ # can be detected and how.+ cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */+#include <ac_nonexistent.h>+_ACEOF+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1+ ac_status=$?+ grep -v '^ *+' conftest.er1 >conftest.err+ rm -f conftest.er1+ cat conftest.err >&5+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } >/dev/null; then+ if test -s conftest.err; then+ ac_cpp_err=$ac_c_preproc_warn_flag+ else+ ac_cpp_err=+ fi+else+ ac_cpp_err=yes+fi+if test -z "$ac_cpp_err"; then+ # Broken: success on invalid input.+continue+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ # Passes both tests.+ac_preproc_ok=:+break+fi+rm -f conftest.err conftest.$ac_ext++done+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.+rm -f conftest.err conftest.$ac_ext+if $ac_preproc_ok; then+ break+fi++ done+ ac_cv_prog_CPP=$CPP++fi+ CPP=$ac_cv_prog_CPP+else+ ac_cv_prog_CPP=$CPP+fi+echo "$as_me:$LINENO: result: $CPP" >&5+echo "${ECHO_T}$CPP" >&6+ac_preproc_ok=false+for ac_c_preproc_warn_flag in '' yes+do+ # Use a header file that comes with gcc, so configuring glibc+ # with a fresh cross-compiler works.+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since+ # <limits.h> exists even on freestanding compilers.+ # On the NeXT, cc -E runs the code through the compiler's parser,+ # not just through cpp. "Syntax error" is here to catch this case.+ cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */+#ifdef __STDC__+# include <limits.h>+#else+# include <assert.h>+#endif+ Syntax error+_ACEOF+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1+ ac_status=$?+ grep -v '^ *+' conftest.er1 >conftest.err+ rm -f conftest.er1+ cat conftest.err >&5+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } >/dev/null; then+ if test -s conftest.err; then+ ac_cpp_err=$ac_c_preproc_warn_flag+ else+ ac_cpp_err=+ fi+else+ ac_cpp_err=yes+fi+if test -z "$ac_cpp_err"; then+ :+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ # Broken: fails on valid input.+continue+fi+rm -f conftest.err conftest.$ac_ext++ # OK, works on sane cases. Now check whether non-existent headers+ # can be detected and how.+ cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */+#include <ac_nonexistent.h>+_ACEOF+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1+ ac_status=$?+ grep -v '^ *+' conftest.er1 >conftest.err+ rm -f conftest.er1+ cat conftest.err >&5+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } >/dev/null; then+ if test -s conftest.err; then+ ac_cpp_err=$ac_c_preproc_warn_flag+ else+ ac_cpp_err=+ fi+else+ ac_cpp_err=yes+fi+if test -z "$ac_cpp_err"; then+ # Broken: success on invalid input.+continue+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ # Passes both tests.+ac_preproc_ok=:+break+fi+rm -f conftest.err conftest.$ac_ext++done+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.+rm -f conftest.err conftest.$ac_ext+if $ac_preproc_ok; then+ :+else+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check+See \`config.log' for more details." >&5+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check+See \`config.log' for more details." >&2;}+ { (exit 1); exit 1; }; }+fi++ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu+++echo "$as_me:$LINENO: checking for X" >&5+echo $ECHO_N "checking for X... $ECHO_C" >&6+++# Check whether --with-x or --without-x was given.+if test "${with_x+set}" = set; then+ withval="$with_x"++fi;+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.+if test "x$with_x" = xno; then+ # The user explicitly disabled X.+ have_x=disabled+else+ if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then+ # Both variables are already set.+ have_x=yes+ else+ if test "${ac_cv_have_x+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ # One or both of the vars are not set, and there is no cached value.+ac_x_includes=no ac_x_libraries=no+rm -fr conftest.dir+if mkdir conftest.dir; then+ cd conftest.dir+ # Make sure to not put "make" in the Imakefile rules, since we grep it out.+ cat >Imakefile <<'_ACEOF'+acfindx:+ @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'+_ACEOF+ if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then+ # GNU make sometimes prints "make[1]: Entering...", which would confuse us.+ eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`+ # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.+ for ac_extension in a so sl; do+ if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&+ test -f $ac_im_libdir/libX11.$ac_extension; then+ ac_im_usrlibdir=$ac_im_libdir; break+ fi+ done+ # Screen out bogus values from the imake configuration. They are+ # bogus both because they are the default anyway, and because+ # using them would break gcc on systems where it needs fixed includes.+ case $ac_im_incroot in+ /usr/include) ;;+ *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;+ esac+ case $ac_im_usrlibdir in+ /usr/lib | /lib) ;;+ *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;+ esac+ fi+ cd ..+ rm -fr conftest.dir+fi++# Standard set of common directories for X headers.+# Check X11 before X11Rn because it is often a symlink to the current release.+ac_x_header_dirs='+/usr/X11/include+/usr/X11R6/include+/usr/X11R5/include+/usr/X11R4/include++/usr/include/X11+/usr/include/X11R6+/usr/include/X11R5+/usr/include/X11R4++/usr/local/X11/include+/usr/local/X11R6/include+/usr/local/X11R5/include+/usr/local/X11R4/include++/usr/local/include/X11+/usr/local/include/X11R6+/usr/local/include/X11R5+/usr/local/include/X11R4++/usr/X386/include+/usr/x386/include+/usr/XFree86/include/X11++/usr/include+/usr/local/include+/usr/unsupported/include+/usr/athena/include+/usr/local/x11r5/include+/usr/lpp/Xamples/include++/usr/openwin/include+/usr/openwin/share/include'++if test "$ac_x_includes" = no; then+ # Guess where to find include files, by looking for Intrinsic.h.+ # First, try using that file with no special directory specified.+ cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */+#include <X11/Intrinsic.h>+_ACEOF+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1+ ac_status=$?+ grep -v '^ *+' conftest.er1 >conftest.err+ rm -f conftest.er1+ cat conftest.err >&5+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } >/dev/null; then+ if test -s conftest.err; then+ ac_cpp_err=$ac_c_preproc_warn_flag+ else+ ac_cpp_err=+ fi+else+ ac_cpp_err=yes+fi+if test -z "$ac_cpp_err"; then+ # We can compile using X headers with no special include directory.+ac_x_includes=+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ for ac_dir in $ac_x_header_dirs; do+ if test -r "$ac_dir/X11/Intrinsic.h"; then+ ac_x_includes=$ac_dir+ break+ fi+done+fi+rm -f conftest.err conftest.$ac_ext+fi # $ac_x_includes = no++if test "$ac_x_libraries" = no; then+ # Check for the libraries.+ # See if we find them without any special options.+ # Don't add to $LIBS permanently.+ ac_save_LIBS=$LIBS+ LIBS="-lXt $LIBS"+ cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */+#include <X11/Intrinsic.h>+int+main ()+{+XtMalloc (0)+ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext conftest$ac_exeext+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5+ (eval $ac_link) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest$ac_exeext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ LIBS=$ac_save_LIBS+# We can link X programs with no special library path.+ac_x_libraries=+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++LIBS=$ac_save_LIBS+for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`+do+ # Don't even attempt the hair of trying to link an X program!+ for ac_extension in a so sl; do+ if test -r $ac_dir/libXt.$ac_extension; then+ ac_x_libraries=$ac_dir+ break 2+ fi+ done+done+fi+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext+fi # $ac_x_libraries = no++if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then+ # Didn't find X anywhere. Cache the known absence of X.+ ac_cv_have_x="have_x=no"+else+ # Record where we found X for the cache.+ ac_cv_have_x="have_x=yes \+ ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"+fi+fi++ fi+ eval "$ac_cv_have_x"+fi # $with_x != no++if test "$have_x" != yes; then+ echo "$as_me:$LINENO: result: $have_x" >&5+echo "${ECHO_T}$have_x" >&6+ no_x=yes+else+ # If each of the values was on the command line, it overrides each guess.+ test "x$x_includes" = xNONE && x_includes=$ac_x_includes+ test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries+ # Update the cache value to reflect the command line values.+ ac_cv_have_x="have_x=yes \+ ac_x_includes=$x_includes ac_x_libraries=$x_libraries"+ echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5+echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6+fi++if test "$no_x" = yes; then+ # Not all programs may use this symbol, but it does not hurt to define it.++cat >>confdefs.h <<\_ACEOF+#define X_DISPLAY_MISSING 1+_ACEOF++ X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=+else+ if test -n "$x_includes"; then+ X_CFLAGS="$X_CFLAGS -I$x_includes"+ fi++ # It would also be nice to do this for all -L options, not just this one.+ if test -n "$x_libraries"; then+ X_LIBS="$X_LIBS -L$x_libraries"+ # For Solaris; some versions of Sun CC require a space after -R and+ # others require no space. Words are not sufficient . . . .+ case `(uname -sr) 2>/dev/null` in+ "SunOS 5"*)+ echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5+echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6+ ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"+ cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */++int+main ()+{++ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext conftest$ac_exeext+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5+ (eval $ac_link) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest$ac_exeext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ ac_R_nospace=yes+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ac_R_nospace=no+fi+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext+ if test $ac_R_nospace = yes; then+ echo "$as_me:$LINENO: result: no" >&5+echo "${ECHO_T}no" >&6+ X_LIBS="$X_LIBS -R$x_libraries"+ else+ LIBS="$ac_xsave_LIBS -R $x_libraries"+ cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */++int+main ()+{++ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext conftest$ac_exeext+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5+ (eval $ac_link) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest$ac_exeext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ ac_R_space=yes+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ac_R_space=no+fi+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext+ if test $ac_R_space = yes; then+ echo "$as_me:$LINENO: result: yes" >&5+echo "${ECHO_T}yes" >&6+ X_LIBS="$X_LIBS -R $x_libraries"+ else+ echo "$as_me:$LINENO: result: neither works" >&5+echo "${ECHO_T}neither works" >&6+ fi+ fi+ LIBS=$ac_xsave_LIBS+ esac+ fi++ # Check for system-dependent libraries X programs must link with.+ # Do this before checking for the system-independent R6 libraries+ # (-lICE), since we may need -lsocket or whatever for X linking.++ if test "$ISC" = yes; then+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"+ else+ # Martyn Johnson says this is needed for Ultrix, if the X+ # libraries were built with DECnet support. And Karl Berry says+ # the Alpha needs dnet_stub (dnet does not exist).+ ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"+ cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */++/* Override any gcc2 internal prototype to avoid an error. */+#ifdef __cplusplus+extern "C"+#endif+/* We use char because int might match the return type of a gcc2+ builtin and then its argument prototype would still apply. */+char XOpenDisplay ();+int+main ()+{+XOpenDisplay ();+ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext conftest$ac_exeext+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5+ (eval $ac_link) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest$ac_exeext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ :+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5+echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6+if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ ac_check_lib_save_LIBS=$LIBS+LIBS="-ldnet $LIBS"+cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */++/* Override any gcc2 internal prototype to avoid an error. */+#ifdef __cplusplus+extern "C"+#endif+/* We use char because int might match the return type of a gcc2+ builtin and then its argument prototype would still apply. */+char dnet_ntoa ();+int+main ()+{+dnet_ntoa ();+ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext conftest$ac_exeext+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5+ (eval $ac_link) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest$ac_exeext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ ac_cv_lib_dnet_dnet_ntoa=yes+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ac_cv_lib_dnet_dnet_ntoa=no+fi+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext+LIBS=$ac_check_lib_save_LIBS+fi+echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5+echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6+if test $ac_cv_lib_dnet_dnet_ntoa = yes; then+ X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"+fi++ if test $ac_cv_lib_dnet_dnet_ntoa = no; then+ echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5+echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6+if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ ac_check_lib_save_LIBS=$LIBS+LIBS="-ldnet_stub $LIBS"+cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */++/* Override any gcc2 internal prototype to avoid an error. */+#ifdef __cplusplus+extern "C"+#endif+/* We use char because int might match the return type of a gcc2+ builtin and then its argument prototype would still apply. */+char dnet_ntoa ();+int+main ()+{+dnet_ntoa ();+ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext conftest$ac_exeext+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5+ (eval $ac_link) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest$ac_exeext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ ac_cv_lib_dnet_stub_dnet_ntoa=yes+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ac_cv_lib_dnet_stub_dnet_ntoa=no+fi+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext+LIBS=$ac_check_lib_save_LIBS+fi+echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5+echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6+if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then+ X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"+fi++ fi+fi+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext+ LIBS="$ac_xsave_LIBS"++ # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,+ # to get the SysV transport functions.+ # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)+ # needs -lnsl.+ # The nsl library prevents programs from opening the X display+ # on Irix 5.2, according to T.E. Dickey.+ # The functions gethostbyname, getservbyname, and inet_addr are+ # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.+ echo "$as_me:$LINENO: checking for gethostbyname" >&5+echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6+if test "${ac_cv_func_gethostbyname+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */+/* System header to define __stub macros and hopefully few prototypes,+ which can conflict with char gethostbyname (); below.+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since+ <limits.h> exists even on freestanding compilers. */+#ifdef __STDC__+# include <limits.h>+#else+# include <assert.h>+#endif+/* Override any gcc2 internal prototype to avoid an error. */+#ifdef __cplusplus+extern "C"+{+#endif+/* We use char because int might match the return type of a gcc2+ builtin and then its argument prototype would still apply. */+char gethostbyname ();+/* The GNU C library defines this for functions which it implements+ to always fail with ENOSYS. Some functions are actually named+ something starting with __ and the normal name is an alias. */+#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)+choke me+#else+char (*f) () = gethostbyname;+#endif+#ifdef __cplusplus+}+#endif++int+main ()+{+return f != gethostbyname;+ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext conftest$ac_exeext+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5+ (eval $ac_link) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest$ac_exeext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ ac_cv_func_gethostbyname=yes+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ac_cv_func_gethostbyname=no+fi+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext+fi+echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5+echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6++ if test $ac_cv_func_gethostbyname = no; then+ echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5+echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ ac_check_lib_save_LIBS=$LIBS+LIBS="-lnsl $LIBS"+cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */++/* Override any gcc2 internal prototype to avoid an error. */+#ifdef __cplusplus+extern "C"+#endif+/* We use char because int might match the return type of a gcc2+ builtin and then its argument prototype would still apply. */+char gethostbyname ();+int+main ()+{+gethostbyname ();+ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext conftest$ac_exeext+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5+ (eval $ac_link) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest$ac_exeext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ ac_cv_lib_nsl_gethostbyname=yes+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ac_cv_lib_nsl_gethostbyname=no+fi+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext+LIBS=$ac_check_lib_save_LIBS+fi+echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5+echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6+if test $ac_cv_lib_nsl_gethostbyname = yes; then+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"+fi++ if test $ac_cv_lib_nsl_gethostbyname = no; then+ echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5+echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6+if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ ac_check_lib_save_LIBS=$LIBS+LIBS="-lbsd $LIBS"+cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */++/* Override any gcc2 internal prototype to avoid an error. */+#ifdef __cplusplus+extern "C"+#endif+/* We use char because int might match the return type of a gcc2+ builtin and then its argument prototype would still apply. */+char gethostbyname ();+int+main ()+{+gethostbyname ();+ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext conftest$ac_exeext+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5+ (eval $ac_link) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest$ac_exeext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ ac_cv_lib_bsd_gethostbyname=yes+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ac_cv_lib_bsd_gethostbyname=no+fi+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext+LIBS=$ac_check_lib_save_LIBS+fi+echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5+echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6+if test $ac_cv_lib_bsd_gethostbyname = yes; then+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"+fi++ fi+ fi++ # lieder@skyler.mavd.honeywell.com says without -lsocket,+ # socket/setsockopt and other routines are undefined under SCO ODT+ # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary+ # on later versions), says Simon Leinen: it contains gethostby*+ # variants that don't use the name server (or something). -lsocket+ # must be given before -lnsl if both are needed. We assume that+ # if connect needs -lnsl, so does gethostbyname.+ echo "$as_me:$LINENO: checking for connect" >&5+echo $ECHO_N "checking for connect... $ECHO_C" >&6+if test "${ac_cv_func_connect+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */+/* System header to define __stub macros and hopefully few prototypes,+ which can conflict with char connect (); below.+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since+ <limits.h> exists even on freestanding compilers. */+#ifdef __STDC__+# include <limits.h>+#else+# include <assert.h>+#endif+/* Override any gcc2 internal prototype to avoid an error. */+#ifdef __cplusplus+extern "C"+{+#endif+/* We use char because int might match the return type of a gcc2+ builtin and then its argument prototype would still apply. */+char connect ();+/* The GNU C library defines this for functions which it implements+ to always fail with ENOSYS. Some functions are actually named+ something starting with __ and the normal name is an alias. */+#if defined (__stub_connect) || defined (__stub___connect)+choke me+#else+char (*f) () = connect;+#endif+#ifdef __cplusplus+}+#endif++int+main ()+{+return f != connect;+ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext conftest$ac_exeext+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5+ (eval $ac_link) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest$ac_exeext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ ac_cv_func_connect=yes+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ac_cv_func_connect=no+fi+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext+fi+echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5+echo "${ECHO_T}$ac_cv_func_connect" >&6++ if test $ac_cv_func_connect = no; then+ echo "$as_me:$LINENO: checking for connect in -lsocket" >&5+echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6+if test "${ac_cv_lib_socket_connect+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ ac_check_lib_save_LIBS=$LIBS+LIBS="-lsocket $X_EXTRA_LIBS $LIBS"+cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */++/* Override any gcc2 internal prototype to avoid an error. */+#ifdef __cplusplus+extern "C"+#endif+/* We use char because int might match the return type of a gcc2+ builtin and then its argument prototype would still apply. */+char connect ();+int+main ()+{+connect ();+ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext conftest$ac_exeext+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5+ (eval $ac_link) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest$ac_exeext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ ac_cv_lib_socket_connect=yes+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ac_cv_lib_socket_connect=no+fi+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext+LIBS=$ac_check_lib_save_LIBS+fi+echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5+echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6+if test $ac_cv_lib_socket_connect = yes; then+ X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"+fi++ fi++ # Guillermo Gomez says -lposix is necessary on A/UX.+ echo "$as_me:$LINENO: checking for remove" >&5+echo $ECHO_N "checking for remove... $ECHO_C" >&6+if test "${ac_cv_func_remove+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */+/* System header to define __stub macros and hopefully few prototypes,+ which can conflict with char remove (); below.+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since+ <limits.h> exists even on freestanding compilers. */+#ifdef __STDC__+# include <limits.h>+#else+# include <assert.h>+#endif+/* Override any gcc2 internal prototype to avoid an error. */+#ifdef __cplusplus+extern "C"+{+#endif+/* We use char because int might match the return type of a gcc2+ builtin and then its argument prototype would still apply. */+char remove ();+/* The GNU C library defines this for functions which it implements+ to always fail with ENOSYS. Some functions are actually named+ something starting with __ and the normal name is an alias. */+#if defined (__stub_remove) || defined (__stub___remove)+choke me+#else+char (*f) () = remove;+#endif+#ifdef __cplusplus+}+#endif++int+main ()+{+return f != remove;+ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext conftest$ac_exeext+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5+ (eval $ac_link) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest$ac_exeext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ ac_cv_func_remove=yes+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ac_cv_func_remove=no+fi+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext+fi+echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5+echo "${ECHO_T}$ac_cv_func_remove" >&6++ if test $ac_cv_func_remove = no; then+ echo "$as_me:$LINENO: checking for remove in -lposix" >&5+echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6+if test "${ac_cv_lib_posix_remove+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ ac_check_lib_save_LIBS=$LIBS+LIBS="-lposix $LIBS"+cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */++/* Override any gcc2 internal prototype to avoid an error. */+#ifdef __cplusplus+extern "C"+#endif+/* We use char because int might match the return type of a gcc2+ builtin and then its argument prototype would still apply. */+char remove ();+int+main ()+{+remove ();+ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext conftest$ac_exeext+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5+ (eval $ac_link) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest$ac_exeext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ ac_cv_lib_posix_remove=yes+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ac_cv_lib_posix_remove=no+fi+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext+LIBS=$ac_check_lib_save_LIBS+fi+echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5+echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6+if test $ac_cv_lib_posix_remove = yes; then+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"+fi++ fi++ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.+ echo "$as_me:$LINENO: checking for shmat" >&5+echo $ECHO_N "checking for shmat... $ECHO_C" >&6+if test "${ac_cv_func_shmat+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */+/* System header to define __stub macros and hopefully few prototypes,+ which can conflict with char shmat (); below.+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since+ <limits.h> exists even on freestanding compilers. */+#ifdef __STDC__+# include <limits.h>+#else+# include <assert.h>+#endif+/* Override any gcc2 internal prototype to avoid an error. */+#ifdef __cplusplus+extern "C"+{+#endif+/* We use char because int might match the return type of a gcc2+ builtin and then its argument prototype would still apply. */+char shmat ();+/* The GNU C library defines this for functions which it implements+ to always fail with ENOSYS. Some functions are actually named+ something starting with __ and the normal name is an alias. */+#if defined (__stub_shmat) || defined (__stub___shmat)+choke me+#else+char (*f) () = shmat;+#endif+#ifdef __cplusplus+}+#endif++int+main ()+{+return f != shmat;+ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext conftest$ac_exeext+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5+ (eval $ac_link) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest$ac_exeext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ ac_cv_func_shmat=yes+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ac_cv_func_shmat=no+fi+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext+fi+echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5+echo "${ECHO_T}$ac_cv_func_shmat" >&6++ if test $ac_cv_func_shmat = no; then+ echo "$as_me:$LINENO: checking for shmat in -lipc" >&5+echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6+if test "${ac_cv_lib_ipc_shmat+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ ac_check_lib_save_LIBS=$LIBS+LIBS="-lipc $LIBS"+cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */++/* Override any gcc2 internal prototype to avoid an error. */+#ifdef __cplusplus+extern "C"+#endif+/* We use char because int might match the return type of a gcc2+ builtin and then its argument prototype would still apply. */+char shmat ();+int+main ()+{+shmat ();+ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext conftest$ac_exeext+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5+ (eval $ac_link) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest$ac_exeext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ ac_cv_lib_ipc_shmat=yes+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ac_cv_lib_ipc_shmat=no+fi+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext+LIBS=$ac_check_lib_save_LIBS+fi+echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5+echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6+if test $ac_cv_lib_ipc_shmat = yes; then+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"+fi++ fi+ fi++ # Check for libraries that X11R6 Xt/Xaw programs need.+ ac_save_LDFLAGS=$LDFLAGS+ test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"+ # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to+ # check for ICE first), but we must link in the order -lSM -lICE or+ # we get undefined symbols. So assume we have SM if we have ICE.+ # These have to be linked with before -lX11, unlike the other+ # libraries we check for below, so use a different variable.+ # John Interrante, Karl Berry+ echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5+echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6+if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ ac_check_lib_save_LIBS=$LIBS+LIBS="-lICE $X_EXTRA_LIBS $LIBS"+cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */++/* Override any gcc2 internal prototype to avoid an error. */+#ifdef __cplusplus+extern "C"+#endif+/* We use char because int might match the return type of a gcc2+ builtin and then its argument prototype would still apply. */+char IceConnectionNumber ();+int+main ()+{+IceConnectionNumber ();+ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext conftest$ac_exeext+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5+ (eval $ac_link) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest$ac_exeext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ ac_cv_lib_ICE_IceConnectionNumber=yes+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ac_cv_lib_ICE_IceConnectionNumber=no+fi+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext+LIBS=$ac_check_lib_save_LIBS+fi+echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5+echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6+if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then+ X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"+fi++ LDFLAGS=$ac_save_LDFLAGS++fi+++# AC_PATH_XTRA doesn't actually check that the C compiler can+# really include the X headers, so double-check here. In particular,+# this will catch the case of using a mingw32 gcc on a Cygwin system:+# Cygwin has the X headers & libs installed, but the mingw32 gcc can't+# use them, and we want to disable the package in this case.+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */+#include <X11/Xlib.h>+_ACEOF+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1+ ac_status=$?+ grep -v '^ *+' conftest.er1 >conftest.err+ rm -f conftest.er1+ cat conftest.err >&5+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } >/dev/null; then+ if test -s conftest.err; then+ ac_cpp_err=$ac_c_preproc_warn_flag+ else+ ac_cpp_err=+ fi+else+ ac_cpp_err=yes+fi+if test -z "$ac_cpp_err"; then+ :+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ no_x=yes+fi+rm -f conftest.err conftest.$ac_ext++# Build the package if we found X11 stuff+if test "$no_x" = yes; then+ X11_BUILD_PACKAGE=no+ BUILD_PACKAGE_BOOL=False+else+ X11_BUILD_PACKAGE=yes+ BUILD_PACKAGE_BOOL=True+fi+fi++++# Define CPP variables used in package.conf.in+if test "$X11_BUILD_PACKAGE" = yes; then+++cat >>confdefs.h <<_ACEOF+#define X_CFLAGS `echo '' $X_CFLAGS | sed -e 's/-[^ ]*/,"&"/g' -e 's/^ *,//'`+_ACEOF++++cat >>confdefs.h <<_ACEOF+#define X_LIBS `echo '' $X_LIBS | sed -e 's/-[^ ]*/,"&"/g' -e 's/^ *,//'`+_ACEOF+++fi++ ac_config_files="$ac_config_files config.mk X11.buildinfo"++cat >confcache <<\_ACEOF+# This file is a shell script that caches the results of configure+# tests run on this system so they can be shared between configure+# scripts and configure runs, see configure's option --config-cache.+# It is not useful on other systems. If it contains results you don't+# want to keep, you may remove or edit it.+#+# config.status only pays attention to the cache file if you give it+# the --recheck option to rerun configure.+#+# `ac_cv_env_foo' variables (set or unset) will be overridden when+# loading this file, other *unset* `ac_cv_foo' will be assigned the+# following values.++_ACEOF++# The following way of writing the cache mishandles newlines in values,+# but we know of no workaround that is simple, portable, and efficient.+# So, don't put newlines in cache variables' values.+# Ultrix sh set writes to stderr and can't be redirected directly,+# and sets the high bit in the cache file unless we assign to the vars.+{+ (set) 2>&1 |+ case `(ac_space=' '; set | grep ac_space) 2>&1` in+ *ac_space=\ *)+ # `set' does not quote correctly, so add quotes (double-quote+ # substitution turns \\\\ into \\, and sed turns \\ into \).+ sed -n \+ "s/'/'\\\\''/g;+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"+ ;;+ *)+ # `set' quotes correctly as required by POSIX, so do not add quotes.+ sed -n \+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"+ ;;+ esac;+} |+ sed '+ t clear+ : clear+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/+ t end+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/+ : end' >>confcache+if diff $cache_file confcache >/dev/null 2>&1; then :; else+ if test -w $cache_file; then+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"+ cat confcache >$cache_file+ else+ echo "not updating unwritable cache $cache_file"+ fi+fi+rm -f confcache++test "x$prefix" = xNONE && prefix=$ac_default_prefix+# Let make expand exec_prefix.+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'++# VPATH may cause trouble with some makes, so we remove $(srcdir),+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and+# trailing colons and then remove the whole line if VPATH becomes empty+# (actually we leave an empty line to preserve line numbers).+if test "x$srcdir" = x.; then+ ac_vpsub='/^[ ]*VPATH[ ]*=/{+s/:*\$(srcdir):*/:/;+s/:*\${srcdir}:*/:/;+s/:*@srcdir@:*/:/;+s/^\([^=]*=[ ]*\):*/\1/;+s/:*$//;+s/^[^=]*=[ ]*$//;+}'+fi++DEFS=-DHAVE_CONFIG_H++ac_libobjs=+ac_ltlibobjs=+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue+ # 1. Remove the extension, and $U if already installed.+ ac_i=`echo "$ac_i" |+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`+ # 2. Add them.+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'+done+LIBOBJS=$ac_libobjs++LTLIBOBJS=$ac_ltlibobjs++++: ${CONFIG_STATUS=./config.status}+ac_clean_files_save=$ac_clean_files+ac_clean_files="$ac_clean_files $CONFIG_STATUS"+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5+echo "$as_me: creating $CONFIG_STATUS" >&6;}+cat >$CONFIG_STATUS <<_ACEOF+#! $SHELL+# Generated by $as_me.+# Run this file to recreate the current configuration.+# Compiler output produced by configure, useful for debugging+# configure, is in config.log if it exists.++debug=false+ac_cs_recheck=false+ac_cs_silent=false+SHELL=\${CONFIG_SHELL-$SHELL}+_ACEOF++cat >>$CONFIG_STATUS <<\_ACEOF+## --------------------- ##+## M4sh Initialization. ##+## --------------------- ##++# Be Bourne compatible+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then+ emulate sh+ NULLCMD=:+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which+ # is contrary to our usage. Disable this feature.+ alias -g '${1+"$@"}'='"$@"'+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then+ set -o posix+fi++# Support unset when possible.+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then+ as_unset=unset+else+ as_unset=false+fi+++# Work around bugs in pre-3.0 UWIN ksh.+$as_unset ENV MAIL MAILPATH+PS1='$ '+PS2='> '+PS4='+ '++# NLS nuisances.+for as_var in \+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \+ LC_TELEPHONE LC_TIME+do+ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then+ eval $as_var=C; export $as_var+ else+ $as_unset $as_var+ fi+done++# Required to use basename.+if expr a : '\(a\)' >/dev/null 2>&1; then+ as_expr=expr+else+ as_expr=false+fi++if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then+ as_basename=basename+else+ as_basename=false+fi+++# Name of the executable.+as_me=`$as_basename "$0" ||+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \+ X"$0" : 'X\(//\)$' \| \+ X"$0" : 'X\(/\)$' \| \+ . : '\(.\)' 2>/dev/null ||+echo X/"$0" |+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }+ /^X\/\(\/\/\)$/{ s//\1/; q; }+ /^X\/\(\/\).*/{ s//\1/; q; }+ s/.*/./; q'`+++# PATH needs CR, and LINENO needs CR and PATH.+# Avoid depending upon Character Ranges.+as_cr_letters='abcdefghijklmnopqrstuvwxyz'+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'+as_cr_Letters=$as_cr_letters$as_cr_LETTERS+as_cr_digits='0123456789'+as_cr_alnum=$as_cr_Letters$as_cr_digits++# The user is always right.+if test "${PATH_SEPARATOR+set}" != set; then+ echo "#! /bin/sh" >conf$$.sh+ echo "exit 0" >>conf$$.sh+ chmod +x conf$$.sh+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then+ PATH_SEPARATOR=';'+ else+ PATH_SEPARATOR=:+ fi+ rm -f conf$$.sh+fi+++ as_lineno_1=$LINENO+ as_lineno_2=$LINENO+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`+ test "x$as_lineno_1" != "x$as_lineno_2" &&+ test "x$as_lineno_3" = "x$as_lineno_2" || {+ # Find who we are. Look in the path if we contain no path at all+ # relative or not.+ case $0 in+ *[\\/]* ) as_myself=$0 ;;+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break+done++ ;;+ esac+ # We did not find ourselves, most probably we were run as `sh COMMAND'+ # in which case we are not to be found in the path.+ if test "x$as_myself" = x; then+ as_myself=$0+ fi+ if test ! -f "$as_myself"; then+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}+ { (exit 1); exit 1; }; }+ fi+ case $CONFIG_SHELL in+ '')+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ for as_base in sh bash ksh sh5; do+ case $as_dir in+ /*)+ if ("$as_dir/$as_base" -c '+ as_lineno_1=$LINENO+ as_lineno_2=$LINENO+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`+ test "x$as_lineno_1" != "x$as_lineno_2" &&+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }+ CONFIG_SHELL=$as_dir/$as_base+ export CONFIG_SHELL+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}+ fi;;+ esac+ done+done+;;+ esac++ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO+ # uniformly replaced by the line number. The first 'sed' inserts a+ # line-number line before each line; the second 'sed' does the real+ # work. The second script uses 'N' to pair each line-number line+ # with the numbered line, and appends trailing '-' during+ # substitution so that $LINENO is not a special case at line end.+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)+ sed '=' <$as_myself |+ sed '+ N+ s,$,-,+ : loop+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,+ t loop+ s,-$,,+ s,^['$as_cr_digits']*\n,,+ ' >$as_me.lineno &&+ chmod +x $as_me.lineno ||+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}+ { (exit 1); exit 1; }; }++ # Don't try to exec as it changes $[0], causing all sort of problems+ # (the dirname of $[0] is not the place where we might find the+ # original and so on. Autoconf is especially sensible to this).+ . ./$as_me.lineno+ # Exit status is that of the last command.+ exit+}+++case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in+ *c*,-n*) ECHO_N= ECHO_C='+' ECHO_T=' ' ;;+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;+esac++if expr a : '\(a\)' >/dev/null 2>&1; then+ as_expr=expr+else+ as_expr=false+fi++rm -f conf$$ conf$$.exe conf$$.file+echo >conf$$.file+if ln -s conf$$.file conf$$ 2>/dev/null; then+ # We could just check for DJGPP; but this test a) works b) is more generic+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).+ if test -f conf$$.exe; then+ # Don't use ln at all; we don't have any links+ as_ln_s='cp -p'+ else+ as_ln_s='ln -s'+ fi+elif ln conf$$.file conf$$ 2>/dev/null; then+ as_ln_s=ln+else+ as_ln_s='cp -p'+fi+rm -f conf$$ conf$$.exe conf$$.file++if mkdir -p . 2>/dev/null; then+ as_mkdir_p=:+else+ as_mkdir_p=false+fi++as_executable_p="test -f"++# Sed expression to map a string onto a valid CPP name.+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"++# Sed expression to map a string onto a valid variable name.+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"+++# IFS+# We need space, tab and new line, in precisely that order.+as_nl='+'+IFS=" $as_nl"++# CDPATH.+$as_unset CDPATH++exec 6>&1++# Open the log real soon, to keep \$[0] and so on meaningful, and to+# report actual input values of CONFIG_FILES etc. instead of their+# values after options handling. Logging --version etc. is OK.+exec 5>>config.log+{+ echo+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX+## Running $as_me. ##+_ASBOX+} >&5+cat >&5 <<_CSEOF++This file was extended by Haskell X11 package $as_me 1.1, which was+generated by GNU Autoconf 2.57. Invocation command line was++ CONFIG_FILES = $CONFIG_FILES+ CONFIG_HEADERS = $CONFIG_HEADERS+ CONFIG_LINKS = $CONFIG_LINKS+ CONFIG_COMMANDS = $CONFIG_COMMANDS+ $ $0 $@++_CSEOF+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5+echo >&5+_ACEOF++# Files that config.status was made for.+if test -n "$ac_config_files"; then+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS+fi++if test -n "$ac_config_headers"; then+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS+fi++if test -n "$ac_config_links"; then+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS+fi++if test -n "$ac_config_commands"; then+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS+fi++cat >>$CONFIG_STATUS <<\_ACEOF++ac_cs_usage="\+\`$as_me' instantiates files from templates according to the+current configuration.++Usage: $0 [OPTIONS] [FILE]...++ -h, --help print this help, then exit+ -V, --version print version number, then exit+ -q, --quiet do not print progress messages+ -d, --debug don't remove temporary files+ --recheck update $as_me by reconfiguring in the same conditions+ --file=FILE[:TEMPLATE]+ instantiate the configuration file FILE+ --header=FILE[:TEMPLATE]+ instantiate the configuration header FILE++Configuration files:+$config_files++Configuration headers:+$config_headers++Report bugs to <bug-autoconf@gnu.org>."+_ACEOF++cat >>$CONFIG_STATUS <<_ACEOF+ac_cs_version="\\+Haskell X11 package config.status 1.1+configured by $0, generated by GNU Autoconf 2.57,+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"++Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001+Free Software Foundation, Inc.+This config.status script is free software; the Free Software Foundation+gives unlimited permission to copy, distribute and modify it."+srcdir=$srcdir+_ACEOF++cat >>$CONFIG_STATUS <<\_ACEOF+# If no file are specified by the user, then we need to provide default+# value. By we need to know if files were specified by the user.+ac_need_defaults=:+while test $# != 0+do+ case $1 in+ --*=*)+ ac_option=`expr "x$1" : 'x\([^=]*\)='`+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`+ ac_shift=:+ ;;+ -*)+ ac_option=$1+ ac_optarg=$2+ ac_shift=shift+ ;;+ *) # This is not an option, so the user has probably given explicit+ # arguments.+ ac_option=$1+ ac_need_defaults=false;;+ esac++ case $ac_option in+ # Handling of the options.+_ACEOF+cat >>$CONFIG_STATUS <<\_ACEOF+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)+ ac_cs_recheck=: ;;+ --version | --vers* | -V )+ echo "$ac_cs_version"; exit 0 ;;+ --he | --h)+ # Conflict between --help and --header+ { { echo "$as_me:$LINENO: error: ambiguous option: $1+Try \`$0 --help' for more information." >&5+echo "$as_me: error: ambiguous option: $1+Try \`$0 --help' for more information." >&2;}+ { (exit 1); exit 1; }; };;+ --help | --hel | -h )+ echo "$ac_cs_usage"; exit 0 ;;+ --debug | --d* | -d )+ debug=: ;;+ --file | --fil | --fi | --f )+ $ac_shift+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"+ ac_need_defaults=false;;+ --header | --heade | --head | --hea )+ $ac_shift+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"+ ac_need_defaults=false;;+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \+ | -silent | --silent | --silen | --sile | --sil | --si | --s)+ ac_cs_silent=: ;;++ # This is an error.+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1+Try \`$0 --help' for more information." >&5+echo "$as_me: error: unrecognized option: $1+Try \`$0 --help' for more information." >&2;}+ { (exit 1); exit 1; }; } ;;++ *) ac_config_targets="$ac_config_targets $1" ;;++ esac+ shift+done++ac_configure_extra_args=++if $ac_cs_silent; then+ exec 6>/dev/null+ ac_configure_extra_args="$ac_configure_extra_args --silent"+fi++_ACEOF+cat >>$CONFIG_STATUS <<_ACEOF+if \$ac_cs_recheck; then+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion+fi++_ACEOF++++++cat >>$CONFIG_STATUS <<\_ACEOF+for ac_config_target in $ac_config_targets+do+ case "$ac_config_target" in+ # Handling of arguments.+ "config.mk" ) CONFIG_FILES="$CONFIG_FILES config.mk" ;;+ "X11.buildinfo" ) CONFIG_FILES="$CONFIG_FILES X11.buildinfo" ;;+ "include/HsX11Config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/HsX11Config.h" ;;+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}+ { (exit 1); exit 1; }; };;+ esac+done++# If the user did not use the arguments to specify the items to instantiate,+# then the envvar interface is used. Set only those that are not.+# We use the long form for the default assignment because of an extremely+# bizarre bug on SunOS 4.1.3.+if $ac_need_defaults; then+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers+fi++# Have a temporary directory for convenience. Make it in the build tree+# simply because there is no reason to put it here, and in addition,+# creating and moving files from /tmp can sometimes cause problems.+# Create a temporary directory, and hook for its removal unless debugging.+$debug ||+{+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0+ trap '{ (exit 1); exit 1; }' 1 2 13 15+}++# Create a (secure) tmp directory for tmp files.++{+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&+ test -n "$tmp" && test -d "$tmp"+} ||+{+ tmp=./confstat$$-$RANDOM+ (umask 077 && mkdir $tmp)+} ||+{+ echo "$me: cannot create a temporary directory in ." >&2+ { (exit 1); exit 1; }+}++_ACEOF++cat >>$CONFIG_STATUS <<_ACEOF++#+# CONFIG_FILES section.+#++# No need to generate the scripts if there are no CONFIG_FILES.+# This happens for instance when ./config.status config.h+if test -n "\$CONFIG_FILES"; then+ # Protect against being on the right side of a sed subst in config.status.+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF+s,@SHELL@,$SHELL,;t t+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t+s,@exec_prefix@,$exec_prefix,;t t+s,@prefix@,$prefix,;t t+s,@program_transform_name@,$program_transform_name,;t t+s,@bindir@,$bindir,;t t+s,@sbindir@,$sbindir,;t t+s,@libexecdir@,$libexecdir,;t t+s,@datadir@,$datadir,;t t+s,@sysconfdir@,$sysconfdir,;t t+s,@sharedstatedir@,$sharedstatedir,;t t+s,@localstatedir@,$localstatedir,;t t+s,@libdir@,$libdir,;t t+s,@includedir@,$includedir,;t t+s,@oldincludedir@,$oldincludedir,;t t+s,@infodir@,$infodir,;t t+s,@mandir@,$mandir,;t t+s,@build_alias@,$build_alias,;t t+s,@host_alias@,$host_alias,;t t+s,@target_alias@,$target_alias,;t t+s,@DEFS@,$DEFS,;t t+s,@ECHO_C@,$ECHO_C,;t t+s,@ECHO_N@,$ECHO_N,;t t+s,@ECHO_T@,$ECHO_T,;t t+s,@LIBS@,$LIBS,;t t+s,@CC@,$CC,;t t+s,@CFLAGS@,$CFLAGS,;t t+s,@LDFLAGS@,$LDFLAGS,;t t+s,@CPPFLAGS@,$CPPFLAGS,;t t+s,@ac_ct_CC@,$ac_ct_CC,;t t+s,@EXEEXT@,$EXEEXT,;t t+s,@OBJEXT@,$OBJEXT,;t t+s,@CPP@,$CPP,;t t+s,@X_CFLAGS@,$X_CFLAGS,;t t+s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t+s,@X_LIBS@,$X_LIBS,;t t+s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t+s,@X11_BUILD_PACKAGE@,$X11_BUILD_PACKAGE,;t t+s,@BUILD_PACKAGE_BOOL@,$BUILD_PACKAGE_BOOL,;t t+s,@LIBOBJS@,$LIBOBJS,;t t+s,@LTLIBOBJS@,$LTLIBOBJS,;t t+CEOF++_ACEOF++ cat >>$CONFIG_STATUS <<\_ACEOF+ # Split the substitutions into bite-sized pieces for seds with+ # small command number limits, like on Digital OSF/1 and HP-UX.+ ac_max_sed_lines=48+ ac_sed_frag=1 # Number of current file.+ ac_beg=1 # First line for current file.+ ac_end=$ac_max_sed_lines # Line after last line for current file.+ ac_more_lines=:+ ac_sed_cmds=+ while $ac_more_lines; do+ if test $ac_beg -gt 1; then+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag+ else+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag+ fi+ if test ! -s $tmp/subs.frag; then+ ac_more_lines=false+ else+ # The purpose of the label and of the branching condition is to+ # speed up the sed processing (if there are no `@' at all, there+ # is no need to browse any of the substitutions).+ # These are the two extra sed commands mentioned above.+ (echo ':t+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed+ if test -z "$ac_sed_cmds"; then+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"+ else+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"+ fi+ ac_sed_frag=`expr $ac_sed_frag + 1`+ ac_beg=$ac_end+ ac_end=`expr $ac_end + $ac_max_sed_lines`+ fi+ done+ if test -z "$ac_sed_cmds"; then+ ac_sed_cmds=cat+ fi+fi # test -n "$CONFIG_FILES"++_ACEOF+cat >>$CONFIG_STATUS <<\_ACEOF+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".+ case $ac_file in+ - | *:- | *:-:* ) # input from stdin+ cat >$tmp/stdin+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;+ * ) ac_file_in=$ac_file.in ;;+ esac++ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \+ X"$ac_file" : 'X\(//\)[^/]' \| \+ X"$ac_file" : 'X\(//\)$' \| \+ X"$ac_file" : 'X\(/\)' \| \+ . : '\(.\)' 2>/dev/null ||+echo X"$ac_file" |+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }+ /^X\(\/\/\)$/{ s//\1/; q; }+ /^X\(\/\).*/{ s//\1/; q; }+ s/.*/./; q'`+ { if $as_mkdir_p; then+ mkdir -p "$ac_dir"+ else+ as_dir="$ac_dir"+ as_dirs=+ while test ! -d "$as_dir"; do+ as_dirs="$as_dir $as_dirs"+ as_dir=`(dirname "$as_dir") 2>/dev/null ||+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \+ X"$as_dir" : 'X\(//\)[^/]' \| \+ X"$as_dir" : 'X\(//\)$' \| \+ X"$as_dir" : 'X\(/\)' \| \+ . : '\(.\)' 2>/dev/null ||+echo X"$as_dir" |+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }+ /^X\(\/\/\)$/{ s//\1/; q; }+ /^X\(\/\).*/{ s//\1/; q; }+ s/.*/./; q'`+ done+ test ! -n "$as_dirs" || mkdir $as_dirs+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}+ { (exit 1); exit 1; }; }; }++ ac_builddir=.++if test "$ac_dir" != .; then+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`+ # A "../" for each directory in $ac_dir_suffix.+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`+else+ ac_dir_suffix= ac_top_builddir=+fi++case $srcdir in+ .) # No --srcdir option. We are building in place.+ ac_srcdir=.+ if test -z "$ac_top_builddir"; then+ ac_top_srcdir=.+ else+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`+ fi ;;+ [\\/]* | ?:[\\/]* ) # Absolute path.+ ac_srcdir=$srcdir$ac_dir_suffix;+ ac_top_srcdir=$srcdir ;;+ *) # Relative path.+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix+ ac_top_srcdir=$ac_top_builddir$srcdir ;;+esac+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be+# absolute.+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`++++ if test x"$ac_file" != x-; then+ { echo "$as_me:$LINENO: creating $ac_file" >&5+echo "$as_me: creating $ac_file" >&6;}+ rm -f "$ac_file"+ fi+ # Let's still pretend it is `configure' which instantiates (i.e., don't+ # use $as_me), people would be surprised to read:+ # /* config.h. Generated by config.status. */+ if test x"$ac_file" = x-; then+ configure_input=+ else+ configure_input="$ac_file. "+ fi+ configure_input=$configure_input"Generated from `echo $ac_file_in |+ sed 's,.*/,,'` by configure."++ # First look for the input files in the build tree, otherwise in the+ # src tree.+ ac_file_inputs=`IFS=:+ for f in $ac_file_in; do+ case $f in+ -) echo $tmp/stdin ;;+ [\\/$]*)+ # Absolute (can't be DOS-style, as IFS=:)+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5+echo "$as_me: error: cannot find input file: $f" >&2;}+ { (exit 1); exit 1; }; }+ echo $f;;+ *) # Relative+ if test -f "$f"; then+ # Build tree+ echo $f+ elif test -f "$srcdir/$f"; then+ # Source tree+ echo $srcdir/$f+ else+ # /dev/null tree+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5+echo "$as_me: error: cannot find input file: $f" >&2;}+ { (exit 1); exit 1; }; }+ fi;;+ esac+ done` || { (exit 1); exit 1; }+_ACEOF+cat >>$CONFIG_STATUS <<_ACEOF+ sed "$ac_vpsub+$extrasub+_ACEOF+cat >>$CONFIG_STATUS <<\_ACEOF+:t+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b+s,@configure_input@,$configure_input,;t t+s,@srcdir@,$ac_srcdir,;t t+s,@abs_srcdir@,$ac_abs_srcdir,;t t+s,@top_srcdir@,$ac_top_srcdir,;t t+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t+s,@builddir@,$ac_builddir,;t t+s,@abs_builddir@,$ac_abs_builddir,;t t+s,@top_builddir@,$ac_top_builddir,;t t+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out+ rm -f $tmp/stdin+ if test x"$ac_file" != x-; then+ mv $tmp/out $ac_file+ else+ cat $tmp/out+ rm -f $tmp/out+ fi++done+_ACEOF+cat >>$CONFIG_STATUS <<\_ACEOF++#+# CONFIG_HEADER section.+#++# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where+# NAME is the cpp macro being defined and VALUE is the value it is being given.+#+# ac_d sets the value in "#define NAME VALUE" lines.+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'+ac_dB='[ ].*$,\1#\2'+ac_dC=' '+ac_dD=',;t'+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'+ac_uB='$,\1#\2define\3'+ac_uC=' '+ac_uD=',;t'++for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".+ case $ac_file in+ - | *:- | *:-:* ) # input from stdin+ cat >$tmp/stdin+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;+ * ) ac_file_in=$ac_file.in ;;+ esac++ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5+echo "$as_me: creating $ac_file" >&6;}++ # First look for the input files in the build tree, otherwise in the+ # src tree.+ ac_file_inputs=`IFS=:+ for f in $ac_file_in; do+ case $f in+ -) echo $tmp/stdin ;;+ [\\/$]*)+ # Absolute (can't be DOS-style, as IFS=:)+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5+echo "$as_me: error: cannot find input file: $f" >&2;}+ { (exit 1); exit 1; }; }+ echo $f;;+ *) # Relative+ if test -f "$f"; then+ # Build tree+ echo $f+ elif test -f "$srcdir/$f"; then+ # Source tree+ echo $srcdir/$f+ else+ # /dev/null tree+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5+echo "$as_me: error: cannot find input file: $f" >&2;}+ { (exit 1); exit 1; }; }+ fi;;+ esac+ done` || { (exit 1); exit 1; }+ # Remove the trailing spaces.+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in++_ACEOF++# Transform confdefs.h into two sed scripts, `conftest.defines' and+# `conftest.undefs', that substitutes the proper values into+# config.h.in to produce config.h. The first handles `#define'+# templates, and the second `#undef' templates.+# And first: Protect against being on the right side of a sed subst in+# config.status. Protect against being in an unquoted here document+# in config.status.+rm -f conftest.defines conftest.undefs+# Using a here document instead of a string reduces the quoting nightmare.+# Putting comments in sed scripts is not portable.+#+# `end' is used to avoid that the second main sed command (meant for+# 0-ary CPP macros) applies to n-ary macro definitions.+# See the Autoconf documentation for `clear'.+cat >confdef2sed.sed <<\_ACEOF+s/[\\&,]/\\&/g+s,[\\$`],\\&,g+t clear+: clear+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp+t end+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp+: end+_ACEOF+# If some macros were called several times there might be several times+# the same #defines, which is useless. Nevertheless, we may not want to+# sort them, since we want the *last* AC-DEFINE to be honored.+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs+rm -f confdef2sed.sed++# This sed command replaces #undef with comments. This is necessary, for+# example, in the case of _POSIX_SOURCE, which is predefined and required+# on some systems where configure will not decide to define it.+cat >>conftest.undefs <<\_ACEOF+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,+_ACEOF++# Break up conftest.defines because some shells have a limit on the size+# of here documents, and old seds have small limits too (100 cmds).+echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS+echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS+echo ' :' >>$CONFIG_STATUS+rm -f conftest.tail+while grep . conftest.defines >/dev/null+do+ # Write a limited-size here document to $tmp/defines.sed.+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS+ # Speed up: don't consider the non `#define' lines.+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS+ # Work around the forget-to-reset-the-flag bug.+ echo 't clr' >>$CONFIG_STATUS+ echo ': clr' >>$CONFIG_STATUS+ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS+ echo 'CEOF+ sed -f $tmp/defines.sed $tmp/in >$tmp/out+ rm -f $tmp/in+ mv $tmp/out $tmp/in+' >>$CONFIG_STATUS+ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail+ rm -f conftest.defines+ mv conftest.tail conftest.defines+done+rm -f conftest.defines+echo ' fi # grep' >>$CONFIG_STATUS+echo >>$CONFIG_STATUS++# Break up conftest.undefs because some shells have a limit on the size+# of here documents, and old seds have small limits too (100 cmds).+echo ' # Handle all the #undef templates' >>$CONFIG_STATUS+rm -f conftest.tail+while grep . conftest.undefs >/dev/null+do+ # Write a limited-size here document to $tmp/undefs.sed.+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS+ # Speed up: don't consider the non `#undef'+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS+ # Work around the forget-to-reset-the-flag bug.+ echo 't clr' >>$CONFIG_STATUS+ echo ': clr' >>$CONFIG_STATUS+ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS+ echo 'CEOF+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out+ rm -f $tmp/in+ mv $tmp/out $tmp/in+' >>$CONFIG_STATUS+ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail+ rm -f conftest.undefs+ mv conftest.tail conftest.undefs+done+rm -f conftest.undefs++cat >>$CONFIG_STATUS <<\_ACEOF+ # Let's still pretend it is `configure' which instantiates (i.e., don't+ # use $as_me), people would be surprised to read:+ # /* config.h. Generated by config.status. */+ if test x"$ac_file" = x-; then+ echo "/* Generated by configure. */" >$tmp/config.h+ else+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h+ fi+ cat $tmp/in >>$tmp/config.h+ rm -f $tmp/in+ if test x"$ac_file" != x-; then+ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5+echo "$as_me: $ac_file is unchanged" >&6;}+ else+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \+ X"$ac_file" : 'X\(//\)[^/]' \| \+ X"$ac_file" : 'X\(//\)$' \| \+ X"$ac_file" : 'X\(/\)' \| \+ . : '\(.\)' 2>/dev/null ||+echo X"$ac_file" |+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }+ /^X\(\/\/\)$/{ s//\1/; q; }+ /^X\(\/\).*/{ s//\1/; q; }+ s/.*/./; q'`+ { if $as_mkdir_p; then+ mkdir -p "$ac_dir"+ else+ as_dir="$ac_dir"+ as_dirs=+ while test ! -d "$as_dir"; do+ as_dirs="$as_dir $as_dirs"+ as_dir=`(dirname "$as_dir") 2>/dev/null ||+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \+ X"$as_dir" : 'X\(//\)[^/]' \| \+ X"$as_dir" : 'X\(//\)$' \| \+ X"$as_dir" : 'X\(/\)' \| \+ . : '\(.\)' 2>/dev/null ||+echo X"$as_dir" |+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }+ /^X\(\/\/\)$/{ s//\1/; q; }+ /^X\(\/\).*/{ s//\1/; q; }+ s/.*/./; q'`+ done+ test ! -n "$as_dirs" || mkdir $as_dirs+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}+ { (exit 1); exit 1; }; }; }++ rm -f $ac_file+ mv $tmp/config.h $ac_file+ fi+ else+ cat $tmp/config.h+ rm -f $tmp/config.h+ fi+done+_ACEOF++cat >>$CONFIG_STATUS <<\_ACEOF++{ (exit 0); exit 0; }+_ACEOF+chmod +x $CONFIG_STATUS+ac_clean_files=$ac_clean_files_save+++# configure is writing to config.log, and then calls config.status.+# config.status does its own redirection, appending to config.log.+# Unfortunately, on DOS this fails, as config.log is still kept open+# by configure, so config.status won't be able to write to it; its+# output is simply discarded. So we exec the FD to /dev/null,+# effectively closing config.log, so it can be properly (re)opened and+# appended to by config.status. When coming back to configure, we+# need to make the FD available again.+if test "$no_create" != yes; then+ ac_cs_success=:+ ac_config_status_args=+ test "$silent" = yes &&+ ac_config_status_args="$ac_config_status_args --quiet"+ exec 5>/dev/null+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false+ exec 5>>config.log+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which+ # would make configure fail if this is the last instruction.+ $ac_cs_success || { (exit 1); exit 1; }+fi+
+ configure.ac view
@@ -0,0 +1,51 @@+AC_INIT([Haskell X11 package], [1.1], [libraries@haskell.org], [X11])++FP_ARG_X11++if test "$enable_x11" = no; then+ X11_BUILD_PACKAGE=no+ BUILD_PACKAGE_BOOL=False+else+# Safety check: Ensure that we are in the correct source directory.+AC_CONFIG_SRCDIR([include/HsXlib.h])++AC_CONFIG_HEADERS([include/HsX11Config.h])++# Check for X11 include paths and libraries+AC_PATH_XTRA++# AC_PATH_XTRA doesn't actually check that the C compiler can+# really include the X headers, so double-check here. In particular,+# this will catch the case of using a mingw32 gcc on a Cygwin system:+# Cygwin has the X headers & libs installed, but the mingw32 gcc can't+# use them, and we want to disable the package in this case.+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+AC_TRY_CPP([#include <X11/Xlib.h>],,[no_x=yes])++# Build the package if we found X11 stuff+if test "$no_x" = yes; then+ X11_BUILD_PACKAGE=no+ BUILD_PACKAGE_BOOL=False+else+ X11_BUILD_PACKAGE=yes+ BUILD_PACKAGE_BOOL=True+fi+fi+AC_SUBST([X11_BUILD_PACKAGE])+AC_SUBST([BUILD_PACKAGE_BOOL])++# Define CPP variables used in package.conf.in+if test "$X11_BUILD_PACKAGE" = yes; then++ AC_DEFINE_UNQUOTED(X_CFLAGS,+ [`echo '' $X_CFLAGS | sed -e 's/-[[^ ]]*/,"&"/g' -e 's/^ *,//'`],+ [C flags for X11, as a list of string literals.])++ AC_DEFINE_UNQUOTED(X_LIBS,+ [`echo '' $X_LIBS | sed -e 's/-[[^ ]]*/,"&"/g' -e 's/^ *,//'`],+ [Library flags for X11, as a list of string literals.])++fi++AC_CONFIG_FILES([config.mk X11.buildinfo])+AC_OUTPUT
+ include/HsX11Config.h.in view
@@ -0,0 +1,25 @@+/* include/HsX11Config.h.in. Generated from configure.ac by autoheader. */++/* Define to the address where bug reports for this package should be sent. */+#undef PACKAGE_BUGREPORT++/* Define to the full name of this package. */+#undef PACKAGE_NAME++/* Define to the full name and version of this package. */+#undef PACKAGE_STRING++/* Define to the one symbol short name of this package. */+#undef PACKAGE_TARNAME++/* Define to the version of this package. */+#undef PACKAGE_VERSION++/* C flags for X11, as a list of string literals. */+#undef X_CFLAGS++/* Define to 1 if the X Window System is missing or not being used. */+#undef X_DISPLAY_MISSING++/* Library flags for X11, as a list of string literals. */+#undef X_LIBS
+ include/HsXlib.h view
@@ -0,0 +1,38 @@+/* -----------------------------------------------------------------------------+ * $Id: HsXlib.h,v 1.3 2004/02/16 18:01:29 ross Exp $+ *+ * Definitions for package `X11' which are visible in Haskell land.+ *+ * ---------------------------------------------------------------------------*/++#ifndef HSXLIB_H+#define HSXLIB_H++#include <stdlib.h>++#include <X11/X.h>+#include <X11/X.h>+#include <X11/Xlib.h>+#include <X11/Xatom.h>+#include <X11/Xutil.h>++#define XK_MISCELLANY+#define XK_LATIN1+#include <X11/keysymdef.h>++/* This error handler is used from FFI code.+ * It generates a slightly better error message than the one+ * that comes with Xlib.+ */+extern int defaultErrorHandler(Display *, XErrorEvent *);++/* Used in waitForEvent */+#include <sys/select.h>+#include <sys/time.h>+#include <sys/types.h>+#include <unistd.h>++extern void fdZero(fd_set *set);+extern void fdSet(int fd, fd_set *set);++#endif