Import Tk 8.6.6 (as of svn r86089)
This commit is contained in:
677
xlib/X11/X.h
Normal file
677
xlib/X11/X.h
Normal file
@@ -0,0 +1,677 @@
|
||||
/*
|
||||
* $XConsortium: X.h,v 1.66 88/09/06 15:55:56 jim Exp $
|
||||
*/
|
||||
|
||||
/* Definitions for the X window system likely to be used by applications */
|
||||
|
||||
#ifndef X_H
|
||||
#define X_H
|
||||
|
||||
/***********************************************************
|
||||
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
|
||||
and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
|
||||
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
documentation for any purpose and without fee is hereby granted,
|
||||
provided that the above copyright notice appear in all copies and that
|
||||
both that copyright notice and this permission notice appear in
|
||||
supporting documentation, and that the names of Digital or MIT not be
|
||||
used in advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission.
|
||||
|
||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
||||
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
SOFTWARE.
|
||||
|
||||
******************************************************************/
|
||||
#define X_PROTOCOL 11 /* current protocol version */
|
||||
#define X_PROTOCOL_REVISION 0 /* current minor version */
|
||||
|
||||
#if defined(MAC_OSX_TK)
|
||||
# define Cursor XCursor
|
||||
# define Region XRegion
|
||||
#endif
|
||||
|
||||
/* Resources */
|
||||
|
||||
#ifdef _WIN64
|
||||
typedef __int64 XID;
|
||||
#else
|
||||
typedef unsigned long XID;
|
||||
#endif
|
||||
|
||||
typedef XID Window;
|
||||
typedef XID Drawable;
|
||||
typedef XID Font;
|
||||
typedef XID Pixmap;
|
||||
typedef XID Cursor;
|
||||
typedef XID Colormap;
|
||||
typedef XID GContext;
|
||||
typedef XID KeySym;
|
||||
|
||||
typedef unsigned long Mask;
|
||||
|
||||
typedef unsigned long Atom;
|
||||
|
||||
typedef unsigned long VisualID;
|
||||
|
||||
typedef unsigned long Time;
|
||||
|
||||
typedef unsigned long KeyCode; /* In order to use IME, the Macintosh needs
|
||||
* to pack 3 bytes into the keyCode field in
|
||||
* the XEvent. In the real X.h, a KeyCode is
|
||||
* defined as a short, which wouldn't be big
|
||||
* enough. */
|
||||
|
||||
/*****************************************************************
|
||||
* RESERVED RESOURCE AND CONSTANT DEFINITIONS
|
||||
*****************************************************************/
|
||||
|
||||
#define None 0L /* universal null resource or null atom */
|
||||
|
||||
#define ParentRelative 1L /* background pixmap in CreateWindow
|
||||
and ChangeWindowAttributes */
|
||||
|
||||
#define CopyFromParent 0L /* border pixmap in CreateWindow
|
||||
and ChangeWindowAttributes
|
||||
special VisualID and special window
|
||||
class passed to CreateWindow */
|
||||
|
||||
#define PointerWindow 0L /* destination window in SendEvent */
|
||||
#define InputFocus 1L /* destination window in SendEvent */
|
||||
|
||||
#define PointerRoot 1L /* focus window in SetInputFocus */
|
||||
|
||||
#define AnyPropertyType 0L /* special Atom, passed to GetProperty */
|
||||
|
||||
#define AnyKey 0L /* special Key Code, passed to GrabKey */
|
||||
|
||||
#define AnyButton 0L /* special Button Code, passed to GrabButton */
|
||||
|
||||
#define AllTemporary 0L /* special Resource ID passed to KillClient */
|
||||
|
||||
#define CurrentTime 0L /* special Time */
|
||||
|
||||
#define NoSymbol 0L /* special KeySym */
|
||||
|
||||
/*****************************************************************
|
||||
* EVENT DEFINITIONS
|
||||
*****************************************************************/
|
||||
|
||||
/* Input Event Masks. Used as event-mask window attribute and as arguments
|
||||
to Grab requests. Not to be confused with event names. */
|
||||
|
||||
#define NoEventMask 0L
|
||||
#define KeyPressMask (1L<<0)
|
||||
#define KeyReleaseMask (1L<<1)
|
||||
#define ButtonPressMask (1L<<2)
|
||||
#define ButtonReleaseMask (1L<<3)
|
||||
#define EnterWindowMask (1L<<4)
|
||||
#define LeaveWindowMask (1L<<5)
|
||||
#define PointerMotionMask (1L<<6)
|
||||
#define PointerMotionHintMask (1L<<7)
|
||||
#define Button1MotionMask (1L<<8)
|
||||
#define Button2MotionMask (1L<<9)
|
||||
#define Button3MotionMask (1L<<10)
|
||||
#define Button4MotionMask (1L<<11)
|
||||
#define Button5MotionMask (1L<<12)
|
||||
#define ButtonMotionMask (1L<<13)
|
||||
#define KeymapStateMask (1L<<14)
|
||||
#define ExposureMask (1L<<15)
|
||||
#define VisibilityChangeMask (1L<<16)
|
||||
#define StructureNotifyMask (1L<<17)
|
||||
#define ResizeRedirectMask (1L<<18)
|
||||
#define SubstructureNotifyMask (1L<<19)
|
||||
#define SubstructureRedirectMask (1L<<20)
|
||||
#define FocusChangeMask (1L<<21)
|
||||
#define PropertyChangeMask (1L<<22)
|
||||
#define ColormapChangeMask (1L<<23)
|
||||
#define OwnerGrabButtonMask (1L<<24)
|
||||
|
||||
/* Event names. Used in "type" field in XEvent structures. Not to be
|
||||
confused with event masks above. They start from 2 because 0 and 1
|
||||
are reserved in the protocol for errors and replies. */
|
||||
|
||||
#define KeyPress 2
|
||||
#define KeyRelease 3
|
||||
#define ButtonPress 4
|
||||
#define ButtonRelease 5
|
||||
#define MotionNotify 6
|
||||
#define EnterNotify 7
|
||||
#define LeaveNotify 8
|
||||
#define FocusIn 9
|
||||
#define FocusOut 10
|
||||
#define KeymapNotify 11
|
||||
#define Expose 12
|
||||
#define GraphicsExpose 13
|
||||
#define NoExpose 14
|
||||
#define VisibilityNotify 15
|
||||
#define CreateNotify 16
|
||||
#define DestroyNotify 17
|
||||
#define UnmapNotify 18
|
||||
#define MapNotify 19
|
||||
#define MapRequest 20
|
||||
#define ReparentNotify 21
|
||||
#define ConfigureNotify 22
|
||||
#define ConfigureRequest 23
|
||||
#define GravityNotify 24
|
||||
#define ResizeRequest 25
|
||||
#define CirculateNotify 26
|
||||
#define CirculateRequest 27
|
||||
#define PropertyNotify 28
|
||||
#define SelectionClear 29
|
||||
#define SelectionRequest 30
|
||||
#define SelectionNotify 31
|
||||
#define ColormapNotify 32
|
||||
#define ClientMessage 33
|
||||
#define MappingNotify 34
|
||||
#define LASTEvent 35 /* must be bigger than any event # */
|
||||
|
||||
|
||||
/* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
|
||||
state in various key-, mouse-, and button-related events. */
|
||||
|
||||
#define ShiftMask (1<<0)
|
||||
#define LockMask (1<<1)
|
||||
#define ControlMask (1<<2)
|
||||
#define Mod1Mask (1<<3)
|
||||
#define Mod2Mask (1<<4)
|
||||
#define Mod3Mask (1<<5)
|
||||
#define Mod4Mask (1<<6)
|
||||
#define Mod5Mask (1<<7)
|
||||
|
||||
/* modifier names. Used to build a SetModifierMapping request or
|
||||
to read a GetModifierMapping request. These correspond to the
|
||||
masks defined above. */
|
||||
#define ShiftMapIndex 0
|
||||
#define LockMapIndex 1
|
||||
#define ControlMapIndex 2
|
||||
#define Mod1MapIndex 3
|
||||
#define Mod2MapIndex 4
|
||||
#define Mod3MapIndex 5
|
||||
#define Mod4MapIndex 6
|
||||
#define Mod5MapIndex 7
|
||||
|
||||
|
||||
/* button masks. Used in same manner as Key masks above. Not to be confused
|
||||
with button names below. */
|
||||
|
||||
#define Button1Mask (1<<8)
|
||||
#define Button2Mask (1<<9)
|
||||
#define Button3Mask (1<<10)
|
||||
#define Button4Mask (1<<11)
|
||||
#define Button5Mask (1<<12)
|
||||
|
||||
#define AnyModifier (1<<15) /* used in GrabButton, GrabKey */
|
||||
|
||||
|
||||
/* button names. Used as arguments to GrabButton and as detail in ButtonPress
|
||||
and ButtonRelease events. Not to be confused with button masks above.
|
||||
Note that 0 is already defined above as "AnyButton". */
|
||||
|
||||
#define Button1 1
|
||||
#define Button2 2
|
||||
#define Button3 3
|
||||
#define Button4 4
|
||||
#define Button5 5
|
||||
|
||||
/* Notify modes */
|
||||
|
||||
#define NotifyNormal 0
|
||||
#define NotifyGrab 1
|
||||
#define NotifyUngrab 2
|
||||
#define NotifyWhileGrabbed 3
|
||||
|
||||
#define NotifyHint 1 /* for MotionNotify events */
|
||||
|
||||
/* Notify detail */
|
||||
|
||||
#define NotifyAncestor 0
|
||||
#define NotifyVirtual 1
|
||||
#define NotifyInferior 2
|
||||
#define NotifyNonlinear 3
|
||||
#define NotifyNonlinearVirtual 4
|
||||
#define NotifyPointer 5
|
||||
#define NotifyPointerRoot 6
|
||||
#define NotifyDetailNone 7
|
||||
|
||||
/* Visibility notify */
|
||||
|
||||
#define VisibilityUnobscured 0
|
||||
#define VisibilityPartiallyObscured 1
|
||||
#define VisibilityFullyObscured 2
|
||||
|
||||
/* Circulation request */
|
||||
|
||||
#define PlaceOnTop 0
|
||||
#define PlaceOnBottom 1
|
||||
|
||||
/* protocol families */
|
||||
|
||||
#define FamilyInternet 0
|
||||
#define FamilyDECnet 1
|
||||
#define FamilyChaos 2
|
||||
|
||||
/* Property notification */
|
||||
|
||||
#define PropertyNewValue 0
|
||||
#define PropertyDelete 1
|
||||
|
||||
/* Color Map notification */
|
||||
|
||||
#define ColormapUninstalled 0
|
||||
#define ColormapInstalled 1
|
||||
|
||||
/* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */
|
||||
|
||||
#define GrabModeSync 0
|
||||
#define GrabModeAsync 1
|
||||
|
||||
/* GrabPointer, GrabKeyboard reply status */
|
||||
|
||||
#define GrabSuccess 0
|
||||
#define AlreadyGrabbed 1
|
||||
#define GrabInvalidTime 2
|
||||
#define GrabNotViewable 3
|
||||
#define GrabFrozen 4
|
||||
|
||||
/* AllowEvents modes */
|
||||
|
||||
#define AsyncPointer 0
|
||||
#define SyncPointer 1
|
||||
#define ReplayPointer 2
|
||||
#define AsyncKeyboard 3
|
||||
#define SyncKeyboard 4
|
||||
#define ReplayKeyboard 5
|
||||
#define AsyncBoth 6
|
||||
#define SyncBoth 7
|
||||
|
||||
/* Used in SetInputFocus, GetInputFocus */
|
||||
|
||||
#define RevertToNone (int)None
|
||||
#define RevertToPointerRoot (int)PointerRoot
|
||||
#define RevertToParent 2
|
||||
|
||||
/*****************************************************************
|
||||
* ERROR CODES
|
||||
*****************************************************************/
|
||||
|
||||
#define Success 0 /* everything's okay */
|
||||
#define BadRequest 1 /* bad request code */
|
||||
#define BadValue 2 /* int parameter out of range */
|
||||
#define BadWindow 3 /* parameter not a Window */
|
||||
#define BadPixmap 4 /* parameter not a Pixmap */
|
||||
#define BadAtom 5 /* parameter not an Atom */
|
||||
#define BadCursor 6 /* parameter not a Cursor */
|
||||
#define BadFont 7 /* parameter not a Font */
|
||||
#define BadMatch 8 /* parameter mismatch */
|
||||
#define BadDrawable 9 /* parameter not a Pixmap or Window */
|
||||
#define BadAccess 10 /* depending on context:
|
||||
- key/button already grabbed
|
||||
- attempt to free an illegal
|
||||
cmap entry
|
||||
- attempt to store into a read-only
|
||||
color map entry.
|
||||
- attempt to modify the access control
|
||||
list from other than the local host.
|
||||
*/
|
||||
#define BadAlloc 11 /* insufficient resources */
|
||||
#define BadColor 12 /* no such colormap */
|
||||
#define BadGC 13 /* parameter not a GC */
|
||||
#define BadIDChoice 14 /* choice not in range or already used */
|
||||
#define BadName 15 /* font or color name doesn't exist */
|
||||
#define BadLength 16 /* Request length incorrect */
|
||||
#define BadImplementation 17 /* server is defective */
|
||||
|
||||
#define FirstExtensionError 128
|
||||
#define LastExtensionError 255
|
||||
|
||||
/*****************************************************************
|
||||
* WINDOW DEFINITIONS
|
||||
*****************************************************************/
|
||||
|
||||
/* Window classes used by CreateWindow */
|
||||
/* Note that CopyFromParent is already defined as 0 above */
|
||||
|
||||
#define InputOutput 1
|
||||
#define InputOnly 2
|
||||
|
||||
/* Window attributes for CreateWindow and ChangeWindowAttributes */
|
||||
|
||||
#define CWBackPixmap (1L<<0)
|
||||
#define CWBackPixel (1L<<1)
|
||||
#define CWBorderPixmap (1L<<2)
|
||||
#define CWBorderPixel (1L<<3)
|
||||
#define CWBitGravity (1L<<4)
|
||||
#define CWWinGravity (1L<<5)
|
||||
#define CWBackingStore (1L<<6)
|
||||
#define CWBackingPlanes (1L<<7)
|
||||
#define CWBackingPixel (1L<<8)
|
||||
#define CWOverrideRedirect (1L<<9)
|
||||
#define CWSaveUnder (1L<<10)
|
||||
#define CWEventMask (1L<<11)
|
||||
#define CWDontPropagate (1L<<12)
|
||||
#define CWColormap (1L<<13)
|
||||
#define CWCursor (1L<<14)
|
||||
|
||||
/* ConfigureWindow structure */
|
||||
|
||||
#define CWX (1<<0)
|
||||
#define CWY (1<<1)
|
||||
#define CWWidth (1<<2)
|
||||
#define CWHeight (1<<3)
|
||||
#define CWBorderWidth (1<<4)
|
||||
#define CWSibling (1<<5)
|
||||
#define CWStackMode (1<<6)
|
||||
|
||||
|
||||
/* Bit Gravity */
|
||||
|
||||
#define ForgetGravity 0
|
||||
#define NorthWestGravity 1
|
||||
#define NorthGravity 2
|
||||
#define NorthEastGravity 3
|
||||
#define WestGravity 4
|
||||
#define CenterGravity 5
|
||||
#define EastGravity 6
|
||||
#define SouthWestGravity 7
|
||||
#define SouthGravity 8
|
||||
#define SouthEastGravity 9
|
||||
#define StaticGravity 10
|
||||
|
||||
/* Window gravity + bit gravity above */
|
||||
|
||||
#define UnmapGravity 0
|
||||
|
||||
/* Used in CreateWindow for backing-store hint */
|
||||
|
||||
#define NotUseful 0
|
||||
#define WhenMapped 1
|
||||
#define Always 2
|
||||
|
||||
/* Used in GetWindowAttributes reply */
|
||||
|
||||
#define IsUnmapped 0
|
||||
#define IsUnviewable 1
|
||||
#define IsViewable 2
|
||||
|
||||
/* Used in ChangeSaveSet */
|
||||
|
||||
#define SetModeInsert 0
|
||||
#define SetModeDelete 1
|
||||
|
||||
/* Used in ChangeCloseDownMode */
|
||||
|
||||
#define DestroyAll 0
|
||||
#define RetainPermanent 1
|
||||
#define RetainTemporary 2
|
||||
|
||||
/* Window stacking method (in configureWindow) */
|
||||
|
||||
#define Above 0
|
||||
#define Below 1
|
||||
#define TopIf 2
|
||||
#define BottomIf 3
|
||||
#define Opposite 4
|
||||
|
||||
/* Circulation direction */
|
||||
|
||||
#define RaiseLowest 0
|
||||
#define LowerHighest 1
|
||||
|
||||
/* Property modes */
|
||||
|
||||
#define PropModeReplace 0
|
||||
#define PropModePrepend 1
|
||||
#define PropModeAppend 2
|
||||
|
||||
/*****************************************************************
|
||||
* GRAPHICS DEFINITIONS
|
||||
*****************************************************************/
|
||||
|
||||
/* graphics functions, as in GC.alu */
|
||||
|
||||
#define GXclear 0x0 /* 0 */
|
||||
#define GXand 0x1 /* src AND dst */
|
||||
#define GXandReverse 0x2 /* src AND NOT dst */
|
||||
#define GXcopy 0x3 /* src */
|
||||
#define GXandInverted 0x4 /* NOT src AND dst */
|
||||
#define GXnoop 0x5 /* dst */
|
||||
#define GXxor 0x6 /* src XOR dst */
|
||||
#define GXor 0x7 /* src OR dst */
|
||||
#define GXnor 0x8 /* NOT src AND NOT dst */
|
||||
#define GXequiv 0x9 /* NOT src XOR dst */
|
||||
#define GXinvert 0xa /* NOT dst */
|
||||
#define GXorReverse 0xb /* src OR NOT dst */
|
||||
#define GXcopyInverted 0xc /* NOT src */
|
||||
#define GXorInverted 0xd /* NOT src OR dst */
|
||||
#define GXnand 0xe /* NOT src OR NOT dst */
|
||||
#define GXset 0xf /* 1 */
|
||||
|
||||
/* LineStyle */
|
||||
|
||||
#define LineSolid 0
|
||||
#define LineOnOffDash 1
|
||||
#define LineDoubleDash 2
|
||||
|
||||
/* capStyle */
|
||||
|
||||
#define CapNotLast 0
|
||||
#define CapButt 1
|
||||
#define CapRound 2
|
||||
#define CapProjecting 3
|
||||
|
||||
/* joinStyle */
|
||||
|
||||
#define JoinMiter 0
|
||||
#define JoinRound 1
|
||||
#define JoinBevel 2
|
||||
|
||||
/* fillStyle */
|
||||
|
||||
#define FillSolid 0
|
||||
#define FillTiled 1
|
||||
#define FillStippled 2
|
||||
#define FillOpaqueStippled 3
|
||||
|
||||
/* fillRule */
|
||||
|
||||
#define EvenOddRule 0
|
||||
#define WindingRule 1
|
||||
|
||||
/* subwindow mode */
|
||||
|
||||
#define ClipByChildren 0
|
||||
#define IncludeInferiors 1
|
||||
|
||||
/* SetClipRectangles ordering */
|
||||
|
||||
#define Unsorted 0
|
||||
#define YSorted 1
|
||||
#define YXSorted 2
|
||||
#define YXBanded 3
|
||||
|
||||
/* CoordinateMode for drawing routines */
|
||||
|
||||
#define CoordModeOrigin 0 /* relative to the origin */
|
||||
#define CoordModePrevious 1 /* relative to previous point */
|
||||
|
||||
/* Polygon shapes */
|
||||
|
||||
#define Complex 0 /* paths may intersect */
|
||||
#define Nonconvex 1 /* no paths intersect, but not convex */
|
||||
#define Convex 2 /* wholly convex */
|
||||
|
||||
/* Arc modes for PolyFillArc */
|
||||
|
||||
#define ArcChord 0 /* join endpoints of arc */
|
||||
#define ArcPieSlice 1 /* join endpoints to center of arc */
|
||||
|
||||
/* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into
|
||||
GC.stateChanges */
|
||||
|
||||
#define GCFunction (1L<<0)
|
||||
#define GCPlaneMask (1L<<1)
|
||||
#define GCForeground (1L<<2)
|
||||
#define GCBackground (1L<<3)
|
||||
#define GCLineWidth (1L<<4)
|
||||
#define GCLineStyle (1L<<5)
|
||||
#define GCCapStyle (1L<<6)
|
||||
#define GCJoinStyle (1L<<7)
|
||||
#define GCFillStyle (1L<<8)
|
||||
#define GCFillRule (1L<<9)
|
||||
#define GCTile (1L<<10)
|
||||
#define GCStipple (1L<<11)
|
||||
#define GCTileStipXOrigin (1L<<12)
|
||||
#define GCTileStipYOrigin (1L<<13)
|
||||
#define GCFont (1L<<14)
|
||||
#define GCSubwindowMode (1L<<15)
|
||||
#define GCGraphicsExposures (1L<<16)
|
||||
#define GCClipXOrigin (1L<<17)
|
||||
#define GCClipYOrigin (1L<<18)
|
||||
#define GCClipMask (1L<<19)
|
||||
#define GCDashOffset (1L<<20)
|
||||
#define GCDashList (1L<<21)
|
||||
#define GCArcMode (1L<<22)
|
||||
|
||||
#define GCLastBit 22
|
||||
/*****************************************************************
|
||||
* FONTS
|
||||
*****************************************************************/
|
||||
|
||||
/* used in QueryFont -- draw direction */
|
||||
|
||||
#define FontLeftToRight 0
|
||||
#define FontRightToLeft 1
|
||||
|
||||
#define FontChange 255
|
||||
|
||||
/*****************************************************************
|
||||
* IMAGING
|
||||
*****************************************************************/
|
||||
|
||||
/* ImageFormat -- PutImage, GetImage */
|
||||
|
||||
#define XYBitmap 0 /* depth 1, XYFormat */
|
||||
#define XYPixmap 1 /* depth == drawable depth */
|
||||
#define ZPixmap 2 /* depth == drawable depth */
|
||||
|
||||
/*****************************************************************
|
||||
* COLOR MAP STUFF
|
||||
*****************************************************************/
|
||||
|
||||
/* For CreateColormap */
|
||||
|
||||
#define AllocNone 0 /* create map with no entries */
|
||||
#define AllocAll 1 /* allocate entire map writeable */
|
||||
|
||||
|
||||
/* Flags used in StoreNamedColor, StoreColors */
|
||||
|
||||
#define DoRed (1<<0)
|
||||
#define DoGreen (1<<1)
|
||||
#define DoBlue (1<<2)
|
||||
|
||||
/*****************************************************************
|
||||
* CURSOR STUFF
|
||||
*****************************************************************/
|
||||
|
||||
/* QueryBestSize Class */
|
||||
|
||||
#define CursorShape 0 /* largest size that can be displayed */
|
||||
#define TileShape 1 /* size tiled fastest */
|
||||
#define StippleShape 2 /* size stippled fastest */
|
||||
|
||||
/*****************************************************************
|
||||
* KEYBOARD/POINTER STUFF
|
||||
*****************************************************************/
|
||||
|
||||
#define AutoRepeatModeOff 0
|
||||
#define AutoRepeatModeOn 1
|
||||
#define AutoRepeatModeDefault 2
|
||||
|
||||
#define LedModeOff 0
|
||||
#define LedModeOn 1
|
||||
|
||||
/* masks for ChangeKeyboardControl */
|
||||
|
||||
#define KBKeyClickPercent (1L<<0)
|
||||
#define KBBellPercent (1L<<1)
|
||||
#define KBBellPitch (1L<<2)
|
||||
#define KBBellDuration (1L<<3)
|
||||
#define KBLed (1L<<4)
|
||||
#define KBLedMode (1L<<5)
|
||||
#define KBKey (1L<<6)
|
||||
#define KBAutoRepeatMode (1L<<7)
|
||||
|
||||
#define MappingSuccess 0
|
||||
#define MappingBusy 1
|
||||
#define MappingFailed 2
|
||||
|
||||
#define MappingModifier 0
|
||||
#define MappingKeyboard 1
|
||||
#define MappingPointer 2
|
||||
|
||||
/*****************************************************************
|
||||
* SCREEN SAVER STUFF
|
||||
*****************************************************************/
|
||||
|
||||
#define DontPreferBlanking 0
|
||||
#define PreferBlanking 1
|
||||
#define DefaultBlanking 2
|
||||
|
||||
#define DisableScreenSaver 0
|
||||
#define DisableScreenInterval 0
|
||||
|
||||
#define DontAllowExposures 0
|
||||
#define AllowExposures 1
|
||||
#define DefaultExposures 2
|
||||
|
||||
/* for ForceScreenSaver */
|
||||
|
||||
#define ScreenSaverReset 0
|
||||
#define ScreenSaverActive 1
|
||||
|
||||
/*****************************************************************
|
||||
* HOSTS AND CONNECTIONS
|
||||
*****************************************************************/
|
||||
|
||||
/* for ChangeHosts */
|
||||
|
||||
#define HostInsert 0
|
||||
#define HostDelete 1
|
||||
|
||||
/* for ChangeAccessControl */
|
||||
|
||||
#define EnableAccess 1
|
||||
#define DisableAccess 0
|
||||
|
||||
/* Display classes used in opening the connection
|
||||
* Note that the statically allocated ones are even numbered and the
|
||||
* dynamically changeable ones are odd numbered */
|
||||
|
||||
#define StaticGray 0
|
||||
#define GrayScale 1
|
||||
#define StaticColor 2
|
||||
#define PseudoColor 3
|
||||
#define TrueColor 4
|
||||
#define DirectColor 5
|
||||
|
||||
|
||||
/* Byte order used in imageByteOrder and bitmapBitOrder */
|
||||
|
||||
#define LSBFirst 0
|
||||
#define MSBFirst 1
|
||||
|
||||
#if defined(MAC_OSX_TK)
|
||||
# undef Cursor
|
||||
# undef Region
|
||||
#endif
|
||||
|
||||
#endif /* X_H */
|
||||
79
xlib/X11/Xatom.h
Normal file
79
xlib/X11/Xatom.h
Normal file
@@ -0,0 +1,79 @@
|
||||
#ifndef XATOM_H
|
||||
#define XATOM_H 1
|
||||
|
||||
/* THIS IS A GENERATED FILE
|
||||
*
|
||||
* Do not change! Changing this file implies a protocol change!
|
||||
*/
|
||||
|
||||
#define XA_PRIMARY ((Atom) 1)
|
||||
#define XA_SECONDARY ((Atom) 2)
|
||||
#define XA_ARC ((Atom) 3)
|
||||
#define XA_ATOM ((Atom) 4)
|
||||
#define XA_BITMAP ((Atom) 5)
|
||||
#define XA_CARDINAL ((Atom) 6)
|
||||
#define XA_COLORMAP ((Atom) 7)
|
||||
#define XA_CURSOR ((Atom) 8)
|
||||
#define XA_CUT_BUFFER0 ((Atom) 9)
|
||||
#define XA_CUT_BUFFER1 ((Atom) 10)
|
||||
#define XA_CUT_BUFFER2 ((Atom) 11)
|
||||
#define XA_CUT_BUFFER3 ((Atom) 12)
|
||||
#define XA_CUT_BUFFER4 ((Atom) 13)
|
||||
#define XA_CUT_BUFFER5 ((Atom) 14)
|
||||
#define XA_CUT_BUFFER6 ((Atom) 15)
|
||||
#define XA_CUT_BUFFER7 ((Atom) 16)
|
||||
#define XA_DRAWABLE ((Atom) 17)
|
||||
#define XA_FONT ((Atom) 18)
|
||||
#define XA_INTEGER ((Atom) 19)
|
||||
#define XA_PIXMAP ((Atom) 20)
|
||||
#define XA_POINT ((Atom) 21)
|
||||
#define XA_RECTANGLE ((Atom) 22)
|
||||
#define XA_RESOURCE_MANAGER ((Atom) 23)
|
||||
#define XA_RGB_COLOR_MAP ((Atom) 24)
|
||||
#define XA_RGB_BEST_MAP ((Atom) 25)
|
||||
#define XA_RGB_BLUE_MAP ((Atom) 26)
|
||||
#define XA_RGB_DEFAULT_MAP ((Atom) 27)
|
||||
#define XA_RGB_GRAY_MAP ((Atom) 28)
|
||||
#define XA_RGB_GREEN_MAP ((Atom) 29)
|
||||
#define XA_RGB_RED_MAP ((Atom) 30)
|
||||
#define XA_STRING ((Atom) 31)
|
||||
#define XA_VISUALID ((Atom) 32)
|
||||
#define XA_WINDOW ((Atom) 33)
|
||||
#define XA_WM_COMMAND ((Atom) 34)
|
||||
#define XA_WM_HINTS ((Atom) 35)
|
||||
#define XA_WM_CLIENT_MACHINE ((Atom) 36)
|
||||
#define XA_WM_ICON_NAME ((Atom) 37)
|
||||
#define XA_WM_ICON_SIZE ((Atom) 38)
|
||||
#define XA_WM_NAME ((Atom) 39)
|
||||
#define XA_WM_NORMAL_HINTS ((Atom) 40)
|
||||
#define XA_WM_SIZE_HINTS ((Atom) 41)
|
||||
#define XA_WM_ZOOM_HINTS ((Atom) 42)
|
||||
#define XA_MIN_SPACE ((Atom) 43)
|
||||
#define XA_NORM_SPACE ((Atom) 44)
|
||||
#define XA_MAX_SPACE ((Atom) 45)
|
||||
#define XA_END_SPACE ((Atom) 46)
|
||||
#define XA_SUPERSCRIPT_X ((Atom) 47)
|
||||
#define XA_SUPERSCRIPT_Y ((Atom) 48)
|
||||
#define XA_SUBSCRIPT_X ((Atom) 49)
|
||||
#define XA_SUBSCRIPT_Y ((Atom) 50)
|
||||
#define XA_UNDERLINE_POSITION ((Atom) 51)
|
||||
#define XA_UNDERLINE_THICKNESS ((Atom) 52)
|
||||
#define XA_STRIKEOUT_ASCENT ((Atom) 53)
|
||||
#define XA_STRIKEOUT_DESCENT ((Atom) 54)
|
||||
#define XA_ITALIC_ANGLE ((Atom) 55)
|
||||
#define XA_X_HEIGHT ((Atom) 56)
|
||||
#define XA_QUAD_WIDTH ((Atom) 57)
|
||||
#define XA_WEIGHT ((Atom) 58)
|
||||
#define XA_POINT_SIZE ((Atom) 59)
|
||||
#define XA_RESOLUTION ((Atom) 60)
|
||||
#define XA_COPYRIGHT ((Atom) 61)
|
||||
#define XA_NOTICE ((Atom) 62)
|
||||
#define XA_FONT_NAME ((Atom) 63)
|
||||
#define XA_FAMILY_NAME ((Atom) 64)
|
||||
#define XA_FULL_NAME ((Atom) 65)
|
||||
#define XA_CAP_HEIGHT ((Atom) 66)
|
||||
#define XA_WM_CLASS ((Atom) 67)
|
||||
#define XA_WM_TRANSIENT_FOR ((Atom) 68)
|
||||
|
||||
#define XA_LAST_PREDEFINED ((Atom) 68)
|
||||
#endif /* XATOM_H */
|
||||
60
xlib/X11/Xfuncproto.h
Normal file
60
xlib/X11/Xfuncproto.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/* $XConsortium: Xfuncproto.h,v 1.7 91/05/13 20:49:21 rws Exp $ */
|
||||
/*
|
||||
* Copyright 1989, 1991 by the Massachusetts Institute of Technology
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation for any purpose and without fee is hereby granted, provided
|
||||
* that the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in advertising
|
||||
* or publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. M.I.T. makes no representations about the
|
||||
* suitability of this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
/* Definitions to make function prototypes manageable */
|
||||
|
||||
#ifndef _XFUNCPROTO_H_
|
||||
#define _XFUNCPROTO_H_
|
||||
|
||||
#ifndef NeedFunctionPrototypes
|
||||
#define NeedFunctionPrototypes 1
|
||||
#endif /* NeedFunctionPrototypes */
|
||||
|
||||
#ifndef NeedVarargsPrototypes
|
||||
#define NeedVarargsPrototypes 0
|
||||
#endif /* NeedVarargsPrototypes */
|
||||
|
||||
#if NeedFunctionPrototypes
|
||||
|
||||
#ifndef NeedNestedPrototypes
|
||||
#define NeedNestedPrototypes 1
|
||||
#endif /* NeedNestedPrototypes */
|
||||
|
||||
#ifndef _Xconst
|
||||
#define _Xconst const
|
||||
#endif /* _Xconst */
|
||||
|
||||
#ifndef NeedWidePrototypes
|
||||
#ifdef NARROWPROTO
|
||||
#define NeedWidePrototypes 0
|
||||
#else
|
||||
#define NeedWidePrototypes 1 /* default to make interropt. easier */
|
||||
#endif
|
||||
#endif /* NeedWidePrototypes */
|
||||
|
||||
#endif /* NeedFunctionPrototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define _XFUNCPROTOBEGIN extern "C" {
|
||||
#define _XFUNCPROTOEND }
|
||||
#endif
|
||||
|
||||
#ifndef _XFUNCPROTOBEGIN
|
||||
#define _XFUNCPROTOBEGIN
|
||||
#define _XFUNCPROTOEND
|
||||
#endif /* _XFUNCPROTOBEGIN */
|
||||
|
||||
#endif /* _XFUNCPROTO_H_ */
|
||||
1208
xlib/X11/Xlib.h
Normal file
1208
xlib/X11/Xlib.h
Normal file
File diff suppressed because it is too large
Load Diff
855
xlib/X11/Xutil.h
Normal file
855
xlib/X11/Xutil.h
Normal file
@@ -0,0 +1,855 @@
|
||||
/* $XConsortium: Xutil.h,v 11.73 91/07/30 16:21:37 rws Exp $ */
|
||||
|
||||
/***********************************************************
|
||||
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
|
||||
and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
|
||||
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
documentation for any purpose and without fee is hereby granted,
|
||||
provided that the above copyright notice appear in all copies and that
|
||||
both that copyright notice and this permission notice appear in
|
||||
supporting documentation, and that the names of Digital or MIT not be
|
||||
used in advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission.
|
||||
|
||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
||||
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
SOFTWARE.
|
||||
|
||||
******************************************************************/
|
||||
|
||||
#ifndef _XUTIL_H_
|
||||
#define _XUTIL_H_
|
||||
|
||||
/* You must include <X11/Xlib.h> before including this file */
|
||||
|
||||
#if defined(MAC_OSX_TK)
|
||||
# define Region XRegion
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Bitmask returned by XParseGeometry(). Each bit tells if the corresponding
|
||||
* value (x, y, width, height) was found in the parsed string.
|
||||
*/
|
||||
#define NoValue 0x0000
|
||||
#define XValue 0x0001
|
||||
#define YValue 0x0002
|
||||
#define WidthValue 0x0004
|
||||
#define HeightValue 0x0008
|
||||
#define AllValues 0x000F
|
||||
#define XNegative 0x0010
|
||||
#define YNegative 0x0020
|
||||
|
||||
/*
|
||||
* new version containing base_width, base_height, and win_gravity fields;
|
||||
* used with WM_NORMAL_HINTS.
|
||||
*/
|
||||
typedef struct {
|
||||
long flags; /* marks which fields in this structure are defined */
|
||||
int x, y; /* obsolete for new window mgrs, but clients */
|
||||
int width, height; /* should set so old wm's don't mess up */
|
||||
int min_width, min_height;
|
||||
int max_width, max_height;
|
||||
int width_inc, height_inc;
|
||||
struct {
|
||||
int x; /* numerator */
|
||||
int y; /* denominator */
|
||||
} min_aspect, max_aspect;
|
||||
int base_width, base_height; /* added by ICCCM version 1 */
|
||||
int win_gravity; /* added by ICCCM version 1 */
|
||||
} XSizeHints;
|
||||
|
||||
/*
|
||||
* The next block of definitions are for window manager properties that
|
||||
* clients and applications use for communication.
|
||||
*/
|
||||
|
||||
/* flags argument in size hints */
|
||||
#define USPosition (1L << 0) /* user specified x, y */
|
||||
#define USSize (1L << 1) /* user specified width, height */
|
||||
|
||||
#define PPosition (1L << 2) /* program specified position */
|
||||
#define PSize (1L << 3) /* program specified size */
|
||||
#define PMinSize (1L << 4) /* program specified minimum size */
|
||||
#define PMaxSize (1L << 5) /* program specified maximum size */
|
||||
#define PResizeInc (1L << 6) /* program specified resize increments */
|
||||
#define PAspect (1L << 7) /* program specified min and max aspect ratios */
|
||||
#define PBaseSize (1L << 8) /* program specified base for incrementing */
|
||||
#define PWinGravity (1L << 9) /* program specified window gravity */
|
||||
|
||||
/* obsolete */
|
||||
#define PAllHints (PPosition|PSize|PMinSize|PMaxSize|PResizeInc|PAspect)
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
long flags; /* marks which fields in this structure are defined */
|
||||
Bool input; /* does this application rely on the window manager to
|
||||
get keyboard input? */
|
||||
int initial_state; /* see below */
|
||||
Pixmap icon_pixmap; /* pixmap to be used as icon */
|
||||
Window icon_window; /* window to be used as icon */
|
||||
int icon_x, icon_y; /* initial position of icon */
|
||||
Pixmap icon_mask; /* icon mask bitmap */
|
||||
XID window_group; /* id of related window group */
|
||||
/* this structure may be extended in the future */
|
||||
} XWMHints;
|
||||
|
||||
/* definition for flags of XWMHints */
|
||||
|
||||
#define InputHint (1L << 0)
|
||||
#define StateHint (1L << 1)
|
||||
#define IconPixmapHint (1L << 2)
|
||||
#define IconWindowHint (1L << 3)
|
||||
#define IconPositionHint (1L << 4)
|
||||
#define IconMaskHint (1L << 5)
|
||||
#define WindowGroupHint (1L << 6)
|
||||
#define AllHints (InputHint|StateHint|IconPixmapHint|IconWindowHint| \
|
||||
IconPositionHint|IconMaskHint|WindowGroupHint)
|
||||
|
||||
/* definitions for initial window state */
|
||||
#define WithdrawnState 0 /* for windows that are not mapped */
|
||||
#define NormalState 1 /* most applications want to start this way */
|
||||
#define IconicState 3 /* application wants to start as an icon */
|
||||
|
||||
/*
|
||||
* Obsolete states no longer defined by ICCCM
|
||||
*/
|
||||
#define DontCareState 0 /* don't know or care */
|
||||
#define ZoomState 2 /* application wants to start zoomed */
|
||||
#define InactiveState 4 /* application believes it is seldom used; */
|
||||
/* some wm's may put it on inactive menu */
|
||||
|
||||
|
||||
/*
|
||||
* new structure for manipulating TEXT properties; used with WM_NAME,
|
||||
* WM_ICON_NAME, WM_CLIENT_MACHINE, and WM_COMMAND.
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned char *value; /* same as Property routines */
|
||||
Atom encoding; /* prop type */
|
||||
int format; /* prop data format: 8, 16, or 32 */
|
||||
unsigned long nitems; /* number of data items in value */
|
||||
} XTextProperty;
|
||||
|
||||
#define XNoMemory -1
|
||||
#define XLocaleNotSupported -2
|
||||
#define XConverterNotFound -3
|
||||
|
||||
typedef enum {
|
||||
XStringStyle, /* STRING */
|
||||
XCompoundTextStyle, /* COMPOUND_TEXT */
|
||||
XTextStyle, /* text in owner's encoding (current locale)*/
|
||||
XStdICCTextStyle /* STRING, else COMPOUND_TEXT */
|
||||
} XICCEncodingStyle;
|
||||
|
||||
typedef struct {
|
||||
int min_width, min_height;
|
||||
int max_width, max_height;
|
||||
int width_inc, height_inc;
|
||||
} XIconSize;
|
||||
|
||||
typedef struct {
|
||||
char *res_name;
|
||||
char *res_class;
|
||||
} XClassHint;
|
||||
|
||||
/*
|
||||
* These macros are used to give some sugar to the image routines so that
|
||||
* naive people are more comfortable with them.
|
||||
*/
|
||||
#define XDestroyImage(ximage) \
|
||||
((*((ximage)->f.destroy_image))((ximage)))
|
||||
#define XGetPixel(ximage, x, y) \
|
||||
((*((ximage)->f.get_pixel))((ximage), (x), (y)))
|
||||
#define XPutPixel(ximage, x, y, pixel) \
|
||||
((*((ximage)->f.put_pixel))((ximage), (x), (y), (pixel)))
|
||||
#define XSubImage(ximage, x, y, width, height) \
|
||||
((*((ximage)->f.sub_image))((ximage), (x), (y), (width), (height)))
|
||||
#define XAddPixel(ximage, value) \
|
||||
((*((ximage)->f.add_pixel))((ximage), (value)))
|
||||
|
||||
/*
|
||||
* Compose sequence status structure, used in calling XLookupString.
|
||||
*/
|
||||
typedef struct _XComposeStatus {
|
||||
XPointer compose_ptr; /* state table pointer */
|
||||
int chars_matched; /* match state */
|
||||
} XComposeStatus;
|
||||
|
||||
/*
|
||||
* Keysym macros, used on Keysyms to test for classes of symbols
|
||||
*/
|
||||
#define IsKeypadKey(keysym) \
|
||||
(((unsigned)(keysym) >= XK_KP_Space) && ((unsigned)(keysym) <= XK_KP_Equal))
|
||||
|
||||
#define IsCursorKey(keysym) \
|
||||
(((unsigned)(keysym) >= XK_Home) && ((unsigned)(keysym) < XK_Select))
|
||||
|
||||
#define IsPFKey(keysym) \
|
||||
(((unsigned)(keysym) >= XK_KP_F1) && ((unsigned)(keysym) <= XK_KP_F4))
|
||||
|
||||
#define IsFunctionKey(keysym) \
|
||||
(((unsigned)(keysym) >= XK_F1) && ((unsigned)(keysym) <= XK_F35))
|
||||
|
||||
#define IsMiscFunctionKey(keysym) \
|
||||
(((unsigned)(keysym) >= XK_Select) && ((unsigned)(keysym) <= XK_Break))
|
||||
|
||||
#define IsModifierKey(keysym) \
|
||||
((((unsigned)(keysym) >= XK_Shift_L) && ((unsigned)(keysym) <= XK_Hyper_R)) \
|
||||
|| ((unsigned)(keysym) == XK_Mode_switch) \
|
||||
|| ((unsigned)(keysym) == XK_Num_Lock))
|
||||
/*
|
||||
* opaque reference to Region data type
|
||||
*/
|
||||
typedef struct _XRegion *Region;
|
||||
|
||||
/* Return values from XRectInRegion() */
|
||||
|
||||
#define RectangleOut 0
|
||||
#define RectangleIn 1
|
||||
#define RectanglePart 2
|
||||
|
||||
|
||||
/*
|
||||
* Information used by the visual utility routines to find desired visual
|
||||
* type from the many visuals a display may support.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
Visual *visual;
|
||||
VisualID visualid;
|
||||
int screen;
|
||||
int depth;
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
int c_class; /* C++ */
|
||||
#else
|
||||
int class;
|
||||
#endif
|
||||
unsigned long red_mask;
|
||||
unsigned long green_mask;
|
||||
unsigned long blue_mask;
|
||||
int colormap_size;
|
||||
int bits_per_rgb;
|
||||
} XVisualInfo;
|
||||
|
||||
#define VisualNoMask 0x0
|
||||
#define VisualIDMask 0x1
|
||||
#define VisualScreenMask 0x2
|
||||
#define VisualDepthMask 0x4
|
||||
#define VisualClassMask 0x8
|
||||
#define VisualRedMaskMask 0x10
|
||||
#define VisualGreenMaskMask 0x20
|
||||
#define VisualBlueMaskMask 0x40
|
||||
#define VisualColormapSizeMask 0x80
|
||||
#define VisualBitsPerRGBMask 0x100
|
||||
#define VisualAllMask 0x1FF
|
||||
|
||||
/*
|
||||
* This defines a window manager property that clients may use to
|
||||
* share standard color maps of type RGB_COLOR_MAP:
|
||||
*/
|
||||
typedef struct {
|
||||
Colormap colormap;
|
||||
unsigned long red_max;
|
||||
unsigned long red_mult;
|
||||
unsigned long green_max;
|
||||
unsigned long green_mult;
|
||||
unsigned long blue_max;
|
||||
unsigned long blue_mult;
|
||||
unsigned long base_pixel;
|
||||
VisualID visualid; /* added by ICCCM version 1 */
|
||||
XID killid; /* added by ICCCM version 1 */
|
||||
} XStandardColormap;
|
||||
|
||||
#define ReleaseByFreeingColormap ((XID) 1L) /* for killid field above */
|
||||
|
||||
|
||||
/*
|
||||
* return codes for XReadBitmapFile and XWriteBitmapFile
|
||||
*/
|
||||
#define BitmapSuccess 0
|
||||
#define BitmapOpenFailed 1
|
||||
#define BitmapFileInvalid 2
|
||||
#define BitmapNoMemory 3
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Context Management
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
|
||||
/* Associative lookup table return codes */
|
||||
|
||||
#define XCSUCCESS 0 /* No error. */
|
||||
#define XCNOMEM 1 /* Out of memory */
|
||||
#define XCNOENT 2 /* No entry in table */
|
||||
|
||||
typedef int XContext;
|
||||
|
||||
#define XUniqueContext() ((XContext) XrmUniqueQuark())
|
||||
#define XStringToContext(string) ((XContext) XrmStringToQuark(string))
|
||||
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
/* The following declarations are alphabetized. */
|
||||
|
||||
extern XClassHint *XAllocClassHint (
|
||||
#if NeedFunctionPrototypes
|
||||
void
|
||||
#endif
|
||||
);
|
||||
|
||||
extern XIconSize *XAllocIconSize (
|
||||
#if NeedFunctionPrototypes
|
||||
void
|
||||
#endif
|
||||
);
|
||||
|
||||
extern XSizeHints *XAllocSizeHints (
|
||||
#if NeedFunctionPrototypes
|
||||
void
|
||||
#endif
|
||||
);
|
||||
|
||||
extern XStandardColormap *XAllocStandardColormap (
|
||||
#if NeedFunctionPrototypes
|
||||
void
|
||||
#endif
|
||||
);
|
||||
|
||||
extern XWMHints *XAllocWMHints (
|
||||
#if NeedFunctionPrototypes
|
||||
void
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XClipBox(
|
||||
#if NeedFunctionPrototypes
|
||||
Region /* r */,
|
||||
XRectangle* /* rect_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern Region XCreateRegion(
|
||||
#if NeedFunctionPrototypes
|
||||
void
|
||||
#endif
|
||||
);
|
||||
|
||||
extern char *XDefaultString(
|
||||
#if NeedFunctionPrototypes
|
||||
void
|
||||
#endif
|
||||
);
|
||||
|
||||
extern int XDeleteContext(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
XID /* rid */,
|
||||
XContext /* context */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XDestroyRegion(
|
||||
#if NeedFunctionPrototypes
|
||||
Region /* r */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern Bool XEmptyRegion(
|
||||
#if NeedFunctionPrototypes
|
||||
Region /* r */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern Bool XEqualRegion(
|
||||
#if NeedFunctionPrototypes
|
||||
Region /* r1 */,
|
||||
Region /* r2 */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern int XFindContext(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
XID /* rid */,
|
||||
XContext /* context */,
|
||||
XPointer* /* data_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern Status XGetClassHint(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XClassHint* /* class_hints_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern Status XGetIconSizes(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XIconSize** /* size_list_return */,
|
||||
int* /* count_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern Status XGetNormalHints(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XSizeHints* /* hints_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern Status XGetRGBColormaps(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XStandardColormap** /* stdcmap_return */,
|
||||
int* /* count_return */,
|
||||
Atom /* property */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern Status XGetSizeHints(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XSizeHints* /* hints_return */,
|
||||
Atom /* property */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern Status XGetStandardColormap(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XStandardColormap* /* colormap_return */,
|
||||
Atom /* property */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern Status XGetTextProperty(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* window */,
|
||||
XTextProperty* /* text_prop_return */,
|
||||
Atom /* property */
|
||||
#endif
|
||||
);
|
||||
|
||||
|
||||
extern Status XGetWMClientMachine(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XTextProperty* /* text_prop_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern XWMHints *XGetWMHints(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern Status XGetWMIconName(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XTextProperty* /* text_prop_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern Status XGetWMName(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XTextProperty* /* text_prop_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern Status XGetWMNormalHints(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XSizeHints* /* hints_return */,
|
||||
long* /* supplied_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern Status XGetWMSizeHints(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XSizeHints* /* hints_return */,
|
||||
long* /* supplied_return */,
|
||||
Atom /* property */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern Status XGetZoomHints(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XSizeHints* /* zhints_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XIntersectRegion(
|
||||
#if NeedFunctionPrototypes
|
||||
Region /* sra */,
|
||||
Region /* srb */,
|
||||
Region /* dr_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern int XLookupString(
|
||||
#if NeedFunctionPrototypes
|
||||
XKeyEvent* /* event_struct */,
|
||||
char* /* buffer_return */,
|
||||
int /* bytes_buffer */,
|
||||
KeySym* /* keysym_return */,
|
||||
XComposeStatus* /* status_in_out */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern Status XMatchVisualInfo(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
int /* screen */,
|
||||
int /* depth */,
|
||||
int /* class */,
|
||||
XVisualInfo* /* vinfo_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XOffsetRegion(
|
||||
#if NeedFunctionPrototypes
|
||||
Region /* r */,
|
||||
int /* dx */,
|
||||
int /* dy */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern Bool XPointInRegion(
|
||||
#if NeedFunctionPrototypes
|
||||
Region /* r */,
|
||||
int /* x */,
|
||||
int /* y */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern Region XPolygonRegion(
|
||||
#if NeedFunctionPrototypes
|
||||
XPoint* /* points */,
|
||||
int /* n */,
|
||||
int /* fill_rule */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern int XRectInRegion(
|
||||
#if NeedFunctionPrototypes
|
||||
Region /* r */,
|
||||
int /* x */,
|
||||
int /* y */,
|
||||
unsigned int /* width */,
|
||||
unsigned int /* height */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern int XSaveContext(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
XID /* rid */,
|
||||
XContext /* context */,
|
||||
_Xconst char* /* data */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XSetClassHint(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XClassHint* /* class_hints */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XSetIconSizes(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XIconSize* /* size_list */,
|
||||
int /* count */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XSetNormalHints(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XSizeHints* /* hints */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XSetRGBColormaps(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XStandardColormap* /* stdcmaps */,
|
||||
int /* count */,
|
||||
Atom /* property */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XSetSizeHints(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XSizeHints* /* hints */,
|
||||
Atom /* property */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XSetStandardProperties(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
_Xconst char* /* window_name */,
|
||||
_Xconst char* /* icon_name */,
|
||||
Pixmap /* icon_pixmap */,
|
||||
char** /* argv */,
|
||||
int /* argc */,
|
||||
XSizeHints* /* hints */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XSetTextProperty(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XTextProperty* /* text_prop */,
|
||||
Atom /* property */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XSetWMHints(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XWMHints* /* wm_hints */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XSetWMIconName(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XTextProperty* /* text_prop */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XSetWMName(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XTextProperty* /* text_prop */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XSetWMNormalHints(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XSizeHints* /* hints */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XSetWMProperties(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XTextProperty* /* window_name */,
|
||||
XTextProperty* /* icon_name */,
|
||||
char** /* argv */,
|
||||
int /* argc */,
|
||||
XSizeHints* /* normal_hints */,
|
||||
XWMHints* /* wm_hints */,
|
||||
XClassHint* /* class_hints */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XmbSetWMProperties(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
_Xconst char* /* window_name */,
|
||||
_Xconst char* /* icon_name */,
|
||||
char** /* argv */,
|
||||
int /* argc */,
|
||||
XSizeHints* /* normal_hints */,
|
||||
XWMHints* /* wm_hints */,
|
||||
XClassHint* /* class_hints */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XSetWMSizeHints(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XSizeHints* /* hints */,
|
||||
Atom /* property */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XSetRegion(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
GC /* gc */,
|
||||
Region /* r */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XSetStandardColormap(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XStandardColormap* /* colormap */,
|
||||
Atom /* property */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XSetZoomHints(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
Window /* w */,
|
||||
XSizeHints* /* zhints */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XShrinkRegion(
|
||||
#if NeedFunctionPrototypes
|
||||
Region /* r */,
|
||||
int /* dx */,
|
||||
int /* dy */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XSubtractRegion(
|
||||
#if NeedFunctionPrototypes
|
||||
Region /* sra */,
|
||||
Region /* srb */,
|
||||
Region /* dr_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern int XmbTextListToTextProperty(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
char** /* list */,
|
||||
int /* count */,
|
||||
XICCEncodingStyle /* style */,
|
||||
XTextProperty* /* text_prop_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern int XwcTextListToTextProperty(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
wchar_t** /* list */,
|
||||
int /* count */,
|
||||
XICCEncodingStyle /* style */,
|
||||
XTextProperty* /* text_prop_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XwcFreeStringList(
|
||||
#if NeedFunctionPrototypes
|
||||
wchar_t** /* list */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern Status XTextPropertyToStringList(
|
||||
#if NeedFunctionPrototypes
|
||||
XTextProperty* /* text_prop */,
|
||||
char*** /* list_return */,
|
||||
int* /* count_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern int XmbTextPropertyToTextList(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
XTextProperty* /* text_prop */,
|
||||
char*** /* list_return */,
|
||||
int* /* count_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern int XwcTextPropertyToTextList(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
XTextProperty* /* text_prop */,
|
||||
wchar_t*** /* list_return */,
|
||||
int* /* count_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XUnionRectWithRegion(
|
||||
#if NeedFunctionPrototypes
|
||||
XRectangle* /* rectangle */,
|
||||
Region /* src_region */,
|
||||
Region /* dest_region_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XUnionRegion(
|
||||
#if NeedFunctionPrototypes
|
||||
Region /* sra */,
|
||||
Region /* srb */,
|
||||
Region /* dr_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern int XWMGeometry(
|
||||
#if NeedFunctionPrototypes
|
||||
Display* /* display */,
|
||||
int /* screen_number */,
|
||||
_Xconst char* /* user_geometry */,
|
||||
_Xconst char* /* default_geometry */,
|
||||
unsigned int /* border_width */,
|
||||
XSizeHints* /* hints */,
|
||||
int* /* x_return */,
|
||||
int* /* y_return */,
|
||||
int* /* width_return */,
|
||||
int* /* height_return */,
|
||||
int* /* gravity_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void XXorRegion(
|
||||
#if NeedFunctionPrototypes
|
||||
Region /* sra */,
|
||||
Region /* srb */,
|
||||
Region /* dr_return */
|
||||
#endif
|
||||
);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#if defined(MAC_OSX_TK)
|
||||
# undef Region
|
||||
#endif
|
||||
|
||||
#endif /* _XUTIL_H_ */
|
||||
79
xlib/X11/cursorfont.h
Normal file
79
xlib/X11/cursorfont.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/* $XConsortium: cursorfont.h,v 1.2 88/09/06 16:44:27 jim Exp $ */
|
||||
#define XC_num_glyphs 154
|
||||
#define XC_X_cursor 0
|
||||
#define XC_arrow 2
|
||||
#define XC_based_arrow_down 4
|
||||
#define XC_based_arrow_up 6
|
||||
#define XC_boat 8
|
||||
#define XC_bogosity 10
|
||||
#define XC_bottom_left_corner 12
|
||||
#define XC_bottom_right_corner 14
|
||||
#define XC_bottom_side 16
|
||||
#define XC_bottom_tee 18
|
||||
#define XC_box_spiral 20
|
||||
#define XC_center_ptr 22
|
||||
#define XC_circle 24
|
||||
#define XC_clock 26
|
||||
#define XC_coffee_mug 28
|
||||
#define XC_cross 30
|
||||
#define XC_cross_reverse 32
|
||||
#define XC_crosshair 34
|
||||
#define XC_diamond_cross 36
|
||||
#define XC_dot 38
|
||||
#define XC_dotbox 40
|
||||
#define XC_double_arrow 42
|
||||
#define XC_draft_large 44
|
||||
#define XC_draft_small 46
|
||||
#define XC_draped_box 48
|
||||
#define XC_exchange 50
|
||||
#define XC_fleur 52
|
||||
#define XC_gobbler 54
|
||||
#define XC_gumby 56
|
||||
#define XC_hand1 58
|
||||
#define XC_hand2 60
|
||||
#define XC_heart 62
|
||||
#define XC_icon 64
|
||||
#define XC_iron_cross 66
|
||||
#define XC_left_ptr 68
|
||||
#define XC_left_side 70
|
||||
#define XC_left_tee 72
|
||||
#define XC_leftbutton 74
|
||||
#define XC_ll_angle 76
|
||||
#define XC_lr_angle 78
|
||||
#define XC_man 80
|
||||
#define XC_middlebutton 82
|
||||
#define XC_mouse 84
|
||||
#define XC_pencil 86
|
||||
#define XC_pirate 88
|
||||
#define XC_plus 90
|
||||
#define XC_question_arrow 92
|
||||
#define XC_right_ptr 94
|
||||
#define XC_right_side 96
|
||||
#define XC_right_tee 98
|
||||
#define XC_rightbutton 100
|
||||
#define XC_rtl_logo 102
|
||||
#define XC_sailboat 104
|
||||
#define XC_sb_down_arrow 106
|
||||
#define XC_sb_h_double_arrow 108
|
||||
#define XC_sb_left_arrow 110
|
||||
#define XC_sb_right_arrow 112
|
||||
#define XC_sb_up_arrow 114
|
||||
#define XC_sb_v_double_arrow 116
|
||||
#define XC_shuttle 118
|
||||
#define XC_sizing 120
|
||||
#define XC_spider 122
|
||||
#define XC_spraycan 124
|
||||
#define XC_star 126
|
||||
#define XC_target 128
|
||||
#define XC_tcross 130
|
||||
#define XC_top_left_arrow 132
|
||||
#define XC_top_left_corner 134
|
||||
#define XC_top_right_corner 136
|
||||
#define XC_top_side 138
|
||||
#define XC_top_tee 140
|
||||
#define XC_trek 142
|
||||
#define XC_ul_angle 144
|
||||
#define XC_umbrella 146
|
||||
#define XC_ur_angle 148
|
||||
#define XC_watch 150
|
||||
#define XC_xterm 152
|
||||
35
xlib/X11/keysym.h
Normal file
35
xlib/X11/keysym.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/* $XConsortium: keysym.h,v 1.13 91/03/13 20:09:49 rws Exp $ */
|
||||
|
||||
/***********************************************************
|
||||
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
|
||||
and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
|
||||
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
documentation for any purpose and without fee is hereby granted,
|
||||
provided that the above copyright notice appear in all copies and that
|
||||
both that copyright notice and this permission notice appear in
|
||||
supporting documentation, and that the names of Digital or MIT not be
|
||||
used in advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission.
|
||||
|
||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
||||
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
SOFTWARE.
|
||||
|
||||
******************************************************************/
|
||||
|
||||
/* default keysyms */
|
||||
#define XK_MISCELLANY
|
||||
#define XK_LATIN1
|
||||
#define XK_LATIN2
|
||||
#define XK_LATIN3
|
||||
#define XK_LATIN4
|
||||
#define XK_GREEK
|
||||
|
||||
#include <X11/keysymdef.h>
|
||||
1169
xlib/X11/keysymdef.h
Normal file
1169
xlib/X11/keysymdef.h
Normal file
File diff suppressed because it is too large
Load Diff
40
xlib/X11/license.terms
Normal file
40
xlib/X11/license.terms
Normal file
@@ -0,0 +1,40 @@
|
||||
This software is copyrighted by the Regents of the University of
|
||||
California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState
|
||||
Corporation, Apple Inc. and other parties. The following terms apply to
|
||||
all files associated with the software unless explicitly disclaimed in
|
||||
individual files.
|
||||
|
||||
The authors hereby grant permission to use, copy, modify, distribute,
|
||||
and license this software and its documentation for any purpose, provided
|
||||
that existing copyright notices are retained in all copies and that this
|
||||
notice is included verbatim in any distributions. No written agreement,
|
||||
license, or royalty fee is required for any of the authorized uses.
|
||||
Modifications to this software may be copyrighted by their authors
|
||||
and need not follow the licensing terms described here, provided that
|
||||
the new terms are clearly indicated on the first page of each file where
|
||||
they apply.
|
||||
|
||||
IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
|
||||
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
||||
ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
|
||||
DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
|
||||
IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
|
||||
NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
|
||||
MODIFICATIONS.
|
||||
|
||||
GOVERNMENT USE: If you are acquiring this software on behalf of the
|
||||
U.S. government, the Government shall have only "Restricted Rights"
|
||||
in the software and related documentation as defined in the Federal
|
||||
Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
|
||||
are acquiring the software on behalf of the Department of Defense, the
|
||||
software shall be classified as "Commercial Computer Software" and the
|
||||
Government shall have only "Restricted Rights" as defined in Clause
|
||||
252.227-7013 (b) (3) of DFARs. Notwithstanding the foregoing, the
|
||||
authors grant the U.S. Government and others acting in its behalf
|
||||
permission to use and distribute the software in accordance with the
|
||||
terms specified in this license.
|
||||
40
xlib/license.terms
Normal file
40
xlib/license.terms
Normal file
@@ -0,0 +1,40 @@
|
||||
This software is copyrighted by the Regents of the University of
|
||||
California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState
|
||||
Corporation, Apple Inc. and other parties. The following terms apply to
|
||||
all files associated with the software unless explicitly disclaimed in
|
||||
individual files.
|
||||
|
||||
The authors hereby grant permission to use, copy, modify, distribute,
|
||||
and license this software and its documentation for any purpose, provided
|
||||
that existing copyright notices are retained in all copies and that this
|
||||
notice is included verbatim in any distributions. No written agreement,
|
||||
license, or royalty fee is required for any of the authorized uses.
|
||||
Modifications to this software may be copyrighted by their authors
|
||||
and need not follow the licensing terms described here, provided that
|
||||
the new terms are clearly indicated on the first page of each file where
|
||||
they apply.
|
||||
|
||||
IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
|
||||
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
||||
ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
|
||||
DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
|
||||
IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
|
||||
NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
|
||||
MODIFICATIONS.
|
||||
|
||||
GOVERNMENT USE: If you are acquiring this software on behalf of the
|
||||
U.S. government, the Government shall have only "Restricted Rights"
|
||||
in the software and related documentation as defined in the Federal
|
||||
Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
|
||||
are acquiring the software on behalf of the Department of Defense, the
|
||||
software shall be classified as "Commercial Computer Software" and the
|
||||
Government shall have only "Restricted Rights" as defined in Clause
|
||||
252.227-7013 (b) (3) of DFARs. Notwithstanding the foregoing, the
|
||||
authors grant the U.S. Government and others acting in its behalf
|
||||
permission to use and distribute the software in accordance with the
|
||||
terms specified in this license.
|
||||
63
xlib/xbytes.h
Normal file
63
xlib/xbytes.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* xbytes.h --
|
||||
*
|
||||
* Declaration of table to reverse bit order of bytes.
|
||||
*
|
||||
* Copyright (c) 1995 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution of
|
||||
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#ifndef _XBYTES
|
||||
#define _XBYTES
|
||||
|
||||
/*
|
||||
* The bits in a byte can be reversed so the least significant becomes the
|
||||
* most significant by indexing xBitReverseTable with the byte to be reversed.
|
||||
*/
|
||||
|
||||
static unsigned char xBitReverseTable[256] = {
|
||||
0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
|
||||
0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
|
||||
0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
|
||||
0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
|
||||
0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
|
||||
0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
|
||||
0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
|
||||
0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
|
||||
0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
|
||||
0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
|
||||
0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
|
||||
0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
|
||||
0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
|
||||
0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
|
||||
0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
|
||||
0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
|
||||
0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
|
||||
0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
|
||||
0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
|
||||
0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
|
||||
0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
|
||||
0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
|
||||
0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
|
||||
0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
|
||||
0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
|
||||
0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
|
||||
0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
|
||||
0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
|
||||
0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
|
||||
0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
|
||||
0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
|
||||
0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff,
|
||||
};
|
||||
|
||||
#endif /* _XBYTES */
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: c
|
||||
* c-basic-offset: 4
|
||||
* fill-column: 78
|
||||
* End:
|
||||
*/
|
||||
438
xlib/xcolors.c
Normal file
438
xlib/xcolors.c
Normal file
@@ -0,0 +1,438 @@
|
||||
/*
|
||||
* xcolors.c --
|
||||
*
|
||||
* This file contains the routines used to map from X color names to RGB
|
||||
* and pixel values.
|
||||
*
|
||||
* Copyright (c) 1996 by Sun Microsystems, Inc.
|
||||
* Copyright (c) 2012 by Jan Nijtmans
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution of
|
||||
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#include "tkInt.h"
|
||||
|
||||
/*
|
||||
* Index array. For each of the characters 'a'-'y', this table gives the first
|
||||
* color starting with that character in the xColors table.
|
||||
*/
|
||||
|
||||
static const unsigned char az[] = {
|
||||
0, 5, 13, 21, 45, 46, 50, 60, 62, 65, 66,
|
||||
67, 91, 106, 109, 115, 126, 127, 130, 144, 149, 150, 152, 155, 156, 158
|
||||
};
|
||||
|
||||
/*
|
||||
* Define an array that defines the mapping from color names to RGB values.
|
||||
* Note that this array must be kept sorted alphabetically so that the
|
||||
* binary search used in XParseColor will succeed.
|
||||
*
|
||||
* Each color definition consists of exactly 32 characters, and starts with
|
||||
* the color name, but without its first character (that character can be
|
||||
* reproduced from the az index array). The last byte holds the number
|
||||
* of additional color variants. For example "azure1" up to "azure4" are
|
||||
* handled by the same table entry as "azure". From the last byte backwards,
|
||||
* each group of 3 bytes contain the rgb values of the main color and
|
||||
* the available variants.
|
||||
*
|
||||
* The colors gray and grey have more than 8 variants. gray1 up to gray8
|
||||
* are handled by this table, above that is handled especially.
|
||||
*/
|
||||
|
||||
typedef char elem[32];
|
||||
|
||||
static const elem xColors[] = {
|
||||
/* Colors starting with 'a' */
|
||||
"liceBlue\0 \360\370\377",
|
||||
"ntiqueWhite\0 \213\203\170\315\300\260\356\337\314\377\357\333\372\353\327\4",
|
||||
"qua\0 \000\377\377",
|
||||
"quamarine\0 \105\213\164\146\315\252\166\356\306\177\377\324\177\377\324\4",
|
||||
"zure\0 \203\213\213\301\315\315\340\356\356\360\377\377\360\377\377\4",
|
||||
/* Colors starting with 'b' */
|
||||
"eige\0 \365\365\334",
|
||||
"isque\0 \213\175\153\315\267\236\356\325\267\377\344\304\377\344\304\4",
|
||||
"lack\0 \000\000\000",
|
||||
"lanchedAlmond\0 \377\353\315",
|
||||
"lue\0 \000\000\213\000\000\315\000\000\356\000\000\377\000\000\377\4",
|
||||
"lueViolet\0 \212\053\342",
|
||||
"rown\0 \213\043\043\315\063\063\356\073\073\377\100\100\245\052\052\4",
|
||||
"urlywood\0 \213\163\125\315\252\175\356\305\221\377\323\233\336\270\207\4",
|
||||
/* Colors starting with 'c' */
|
||||
"adetBlue\0 \123\206\213\172\305\315\216\345\356\230\365\377\137\236\240\4",
|
||||
"hartreuse\0 \105\213\000\146\315\000\166\356\000\177\377\000\177\377\000\4",
|
||||
"hocolate\0 \213\105\023\315\146\035\356\166\041\377\177\044\322\151\036\4",
|
||||
"oral\0 \213\076\057\315\133\105\356\152\120\377\162\126\377\177\120\4",
|
||||
"ornflowerBlue\0 \144\225\355",
|
||||
"ornsilk\0 \213\210\170\315\310\261\356\350\315\377\370\334\377\370\334\4",
|
||||
"rimson\0 \334\024\074",
|
||||
"yan\0 \000\213\213\000\315\315\000\356\356\000\377\377\000\377\377\4",
|
||||
/* Colors starting with 'd' */
|
||||
"arkBlue\0 \000\000\213",
|
||||
"arkCyan\0 \000\213\213",
|
||||
"arkGoldenrod\0 \213\145\010\315\225\014\356\255\016\377\271\017\270\206\013\4",
|
||||
"arkGray\0 \251\251\251",
|
||||
"arkGreen\0 \000\144\000",
|
||||
"arkGrey\0 \251\251\251",
|
||||
"arkKhaki\0 \275\267\153",
|
||||
"arkMagenta\0 \213\000\213",
|
||||
"arkOliveGreen\0 \156\213\075\242\315\132\274\356\150\312\377\160\125\153\057\4",
|
||||
"arkOrange\0 \213\105\000\315\146\000\356\166\000\377\177\000\377\214\000\4",
|
||||
"arkOrchid\0 \150\042\213\232\062\315\262\072\356\277\076\377\231\062\314\4",
|
||||
"arkRed\0 \213\000\000",
|
||||
"arkSalmon\0 \351\226\172",
|
||||
"arkSeaGreen\0 \151\213\151\233\315\233\264\356\264\301\377\301\217\274\217\4",
|
||||
"arkSlateBlue\0 \110\075\213",
|
||||
"arkSlateGray\0 \122\213\213\171\315\315\215\356\356\227\377\377\057\117\117\4",
|
||||
"arkSlateGrey\0 \057\117\117",
|
||||
"arkTurquoise\0 \000\316\321",
|
||||
"arkViolet\0 \224\000\323",
|
||||
"eepPink\0 \213\012\120\315\020\166\356\022\211\377\024\223\377\024\223\4",
|
||||
"eepSkyBlue\0 \000\150\213\000\232\315\000\262\356\000\277\377\000\277\377\4",
|
||||
"imGray\0 \151\151\151",
|
||||
"imGrey\0 \151\151\151",
|
||||
"odgerBlue\0 \020\116\213\030\164\315\034\206\356\036\220\377\036\220\377\4",
|
||||
/* Colors starting with 'e' */
|
||||
"\377" /* placeholder */,
|
||||
/* Colors starting with 'f' */
|
||||
"irebrick\0 \213\032\032\315\046\046\356\054\054\377\060\060\262\042\042\4",
|
||||
"loralWhite\0 \377\372\360",
|
||||
"orestGreen\0 \042\213\042",
|
||||
"uchsia\0 \377\000\377",
|
||||
/* Colors starting with 'g' */
|
||||
"ainsboro\0 \334\334\334",
|
||||
"hostWhite\0 \370\370\377",
|
||||
"old\0 \213\165\000\315\255\000\356\311\000\377\327\000\377\327\000\4",
|
||||
"oldenrod\0 \213\151\024\315\233\035\356\264\042\377\301\045\332\245\040\4",
|
||||
"ray\0\024\024\024\022\022\022\017\017\017\015\015\015\012\012\012"
|
||||
"\010\010\010\005\005\005\003\003\003\200\200\200\10",
|
||||
"ray0\0 \000\000\000",
|
||||
"reen\0 \000\213\000\000\315\000\000\356\000\000\377\000\000\200\000\4",
|
||||
"reenYellow\0 \255\377\057",
|
||||
"rey\0\024\024\024\022\022\022\017\017\017\015\015\015\012\012\012"
|
||||
"\010\010\010\005\005\005\003\003\003\200\200\200\10",
|
||||
"rey0\0 \000\000\000",
|
||||
/* Colors starting with 'h' */
|
||||
"oneydew\0 \203\213\203\301\315\301\340\356\340\360\377\360\360\377\360\4",
|
||||
"otPink\0 \213\072\142\315\140\220\356\152\247\377\156\264\377\151\264\4",
|
||||
/* Colors starting with 'i' */
|
||||
"ndianRed\0 \213\072\072\315\125\125\356\143\143\377\152\152\315\134\134\4",
|
||||
"ndigo\0 \113\000\202",
|
||||
"vory\0 \213\213\203\315\315\301\356\356\340\377\377\360\377\377\360\4",
|
||||
/* Colors starting with 'j' */
|
||||
"\377" /* placeholder */,
|
||||
/* Colors starting with 'k' */
|
||||
"haki\0 \213\206\116\315\306\163\356\346\205\377\366\217\360\346\214\4",
|
||||
/* Colors starting with 'l' */
|
||||
"avender\0 \346\346\372",
|
||||
"avenderBlush\0 \213\203\206\315\301\305\356\340\345\377\360\365\377\360\365\4",
|
||||
"awnGreen\0 \174\374\000",
|
||||
"emonChiffon\0 \213\211\160\315\311\245\356\351\277\377\372\315\377\372\315\4",
|
||||
"ightBlue\0 \150\203\213\232\300\315\262\337\356\277\357\377\255\330\346\4",
|
||||
"ightCoral\0 \360\200\200",
|
||||
"ightCyan\0 \172\213\213\264\315\315\321\356\356\340\377\377\340\377\377\4",
|
||||
"ightGoldenrod\0 \213\201\114\315\276\160\356\334\202\377\354\213\356\335\202\4",
|
||||
"ightGoldenrodYellow\0 \372\372\322",
|
||||
"ightGray\0 \323\323\323",
|
||||
"ightGreen\0 \220\356\220",
|
||||
"ightGrey\0 \323\323\323",
|
||||
"ightPink\0 \213\137\145\315\214\225\356\242\255\377\256\271\377\266\301\4",
|
||||
"ightSalmon\0 \213\127\102\315\201\142\356\225\162\377\240\172\377\240\172\4",
|
||||
"ightSeaGreen\0 \040\262\252",
|
||||
"ightSkyBlue\0 \140\173\213\215\266\315\244\323\356\260\342\377\207\316\372\4",
|
||||
"ightSlateBlue\0 \204\160\377",
|
||||
"ightSlateGray\0 \167\210\231",
|
||||
"ightSlateGrey\0 \167\210\231",
|
||||
"ightSteelBlue\0 \156\173\213\242\265\315\274\322\356\312\341\377\260\304\336\4",
|
||||
"ightYellow\0 \213\213\172\315\315\264\356\356\321\377\377\340\377\377\340\4",
|
||||
"ime\0 \000\377\000",
|
||||
"imeGreen\0 \062\315\062",
|
||||
"inen\0 \372\360\346",
|
||||
/* Colors starting with 'm' */
|
||||
"agenta\0 \213\000\213\315\000\315\356\000\356\377\000\377\377\000\377\4",
|
||||
"aroon\0 \213\034\142\315\051\220\356\060\247\377\064\263\200\000\000\4",
|
||||
"ediumAquamarine\0 \146\315\252",
|
||||
"ediumBlue\0 \000\000\315",
|
||||
"ediumOrchid\0 \172\067\213\264\122\315\321\137\356\340\146\377\272\125\323\4",
|
||||
"ediumPurple\0 \135\107\213\211\150\315\237\171\356\253\202\377\223\160\333\4",
|
||||
"ediumSeaGreen\0 \074\263\161",
|
||||
"ediumSlateBlue\0 \173\150\356",
|
||||
"ediumSpringGreen\0 \000\372\232",
|
||||
"ediumTurquoise\0 \110\321\314",
|
||||
"ediumVioletRed\0 \307\025\205",
|
||||
"idnightBlue\0 \031\031\160",
|
||||
"intCream\0 \365\377\372",
|
||||
"istyRose\0 \213\175\173\315\267\265\356\325\322\377\344\341\377\344\341\4",
|
||||
"occasin\0 \377\344\265",
|
||||
/* Colors starting with 'n' */
|
||||
"avajoWhite\0 \213\171\136\315\263\213\356\317\241\377\336\255\377\336\255\4",
|
||||
"avy\0 \000\000\200",
|
||||
"avyBlue\0 \000\000\200",
|
||||
/* Colors starting with 'o' */
|
||||
"ldLace\0 \375\365\346",
|
||||
"live\0 \200\200\000",
|
||||
"liveDrab\0 \151\213\042\232\315\062\263\356\072\300\377\076\153\216\043\4",
|
||||
"range\0 \213\132\000\315\205\000\356\232\000\377\245\000\377\245\000\4",
|
||||
"rangeRed\0 \213\045\000\315\067\000\356\100\000\377\105\000\377\105\000\4",
|
||||
"rchid\0 \213\107\211\315\151\311\356\172\351\377\203\372\332\160\326\4",
|
||||
/* Colors starting with 'p' */
|
||||
"aleGoldenrod\0 \356\350\252",
|
||||
"aleGreen\0 \124\213\124\174\315\174\220\356\220\232\377\232\230\373\230\4",
|
||||
"aleTurquoise\0 \146\213\213\226\315\315\256\356\356\273\377\377\257\356\356\4",
|
||||
"aleVioletRed\0 \213\107\135\315\150\211\356\171\237\377\202\253\333\160\223\4",
|
||||
"apayaWhip\0 \377\357\325",
|
||||
"eachPuff\0 \213\167\145\315\257\225\356\313\255\377\332\271\377\332\271\4",
|
||||
"eru\0 \315\205\077",
|
||||
"ink\0 \213\143\154\315\221\236\356\251\270\377\265\305\377\300\313\4",
|
||||
"lum\0 \213\146\213\315\226\315\356\256\356\377\273\377\335\240\335\4",
|
||||
"owderBlue\0 \260\340\346",
|
||||
"urple\0 \125\032\213\175\046\315\221\054\356\233\060\377\200\000\200\4",
|
||||
/* Colors starting with 'q' */
|
||||
"\377" /* placeholder */,
|
||||
/* Colors starting with 'r' */
|
||||
"ed\0 \213\000\000\315\000\000\356\000\000\377\000\000\377\000\000\4",
|
||||
"osyBrown\0 \213\151\151\315\233\233\356\264\264\377\301\301\274\217\217\4",
|
||||
"oyalBlue\0 \047\100\213\072\137\315\103\156\356\110\166\377\101\151\341\4",
|
||||
/* Colors starting with 's' */
|
||||
"addleBrown\0 \213\105\023",
|
||||
"almon\0 \213\114\071\315\160\124\356\202\142\377\214\151\372\200\162\4",
|
||||
"andyBrown\0 \364\244\140",
|
||||
"eaGreen\0 \056\213\127\103\315\200\116\356\224\124\377\237\056\213\127\4",
|
||||
"eashell\0 \213\206\202\315\305\277\356\345\336\377\365\356\377\365\356\4",
|
||||
"ienna\0 \213\107\046\315\150\071\356\171\102\377\202\107\240\122\055\4",
|
||||
"ilver\0 \300\300\300",
|
||||
"kyBlue\0 \112\160\213\154\246\315\176\300\356\207\316\377\207\316\353\4",
|
||||
"lateBlue\0 \107\074\213\151\131\315\172\147\356\203\157\377\152\132\315\4",
|
||||
"lateGray\0 \154\173\213\237\266\315\271\323\356\306\342\377\160\200\220\4",
|
||||
"lateGrey\0 \160\200\220",
|
||||
"now\0 \213\211\211\315\311\311\356\351\351\377\372\372\377\372\372\4",
|
||||
"pringGreen\0 \000\213\105\000\315\146\000\356\166\000\377\177\000\377\177\4",
|
||||
"teelBlue\0 \066\144\213\117\224\315\134\254\356\143\270\377\106\202\264\4",
|
||||
/* Colors starting with 't' */
|
||||
"an\0 \213\132\053\315\205\077\356\232\111\377\245\117\322\264\214\4",
|
||||
"eal\0 \000\200\200",
|
||||
"histle\0 \213\173\213\315\265\315\356\322\356\377\341\377\330\277\330\4",
|
||||
"omato\0 \213\066\046\315\117\071\356\134\102\377\143\107\377\143\107\4",
|
||||
"urquoise\0 \000\206\213\000\305\315\000\345\356\000\365\377\100\340\320\4",
|
||||
/* Colors starting with 'u' */
|
||||
"\377" /* placeholder */,
|
||||
/* Colors starting with 'v' */
|
||||
"iolet\0 \356\202\356",
|
||||
"ioletRed\0 \213\042\122\315\062\170\356\072\214\377\076\226\320\040\220\4",
|
||||
/* Colors starting with 'w' */
|
||||
"heat\0 \213\176\146\315\272\226\356\330\256\377\347\272\365\336\263\4",
|
||||
"hite\0 \377\377\377",
|
||||
"hiteSmoke\0 \365\365\365",
|
||||
/* Colors starting with 'x' */
|
||||
"\377" /* placeholder */,
|
||||
/* Colors starting with 'y' */
|
||||
"ellow\0 \213\213\000\315\315\000\356\356\000\377\377\000\377\377\000\4",
|
||||
"ellowGreen\0 \232\315\062\0"
|
||||
};
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* XParseColor --
|
||||
*
|
||||
* Partial implementation of X color name parsing interface.
|
||||
*
|
||||
* Results:
|
||||
* Returns non-zero on success.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* This only handles hex-strings without 0x prefix. Luckily, that's just what
|
||||
* we need.
|
||||
*/
|
||||
|
||||
static Tcl_WideInt
|
||||
parseHex64bit(
|
||||
const char *spec,
|
||||
char **p)
|
||||
{
|
||||
Tcl_WideInt result = 0;
|
||||
char c;
|
||||
while ((c = *spec)) {
|
||||
if ((c >= '0') && (c <= '9')) {
|
||||
c -= '0';
|
||||
} else if ((c >= 'A') && (c <= 'F')) {
|
||||
c += (10 - 'A');
|
||||
} else if ((c >= 'a') && (c <= 'f')) {
|
||||
c += (10 - 'a');
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
result = (result << 4) + c;
|
||||
++spec;
|
||||
}
|
||||
*p = (char *) spec;
|
||||
return result;
|
||||
}
|
||||
|
||||
static int
|
||||
colorcmp(
|
||||
const char *spec,
|
||||
const char *pname,
|
||||
int *special)
|
||||
{
|
||||
int r;
|
||||
int c, d;
|
||||
int notequal = 0;
|
||||
int num = 0;
|
||||
|
||||
do {
|
||||
d = *pname++;
|
||||
c = (*spec == ' ');
|
||||
if (c) {
|
||||
spec++;
|
||||
}
|
||||
if ((unsigned)(d - 'A') <= (unsigned)('Z' - 'A')) {
|
||||
d += 'a' - 'A';
|
||||
} else if (c) {
|
||||
/*
|
||||
* A space doesn't match a lowercase, but we don't know yet
|
||||
* whether we should return a negative or positive number. That
|
||||
* depends on what follows.
|
||||
*/
|
||||
|
||||
notequal = 1;
|
||||
}
|
||||
c = *spec++;
|
||||
if ((unsigned)(c - 'A') <= (unsigned)('Z' - 'A')) {
|
||||
c += 'a' - 'A';
|
||||
} else if (((unsigned)(c - '1') <= (unsigned)('9' - '1'))) {
|
||||
if (d == '0') {
|
||||
d += 10;
|
||||
} else if (!d) {
|
||||
num = c - '0';
|
||||
while ((unsigned)((c = *spec++) - '0') <= (unsigned)('9' - '0')) {
|
||||
num = num * 10 + c - '0';
|
||||
}
|
||||
}
|
||||
}
|
||||
r = c - d;
|
||||
} while (!r && d);
|
||||
|
||||
if (!r && notequal) {
|
||||
/*
|
||||
* Strings are equal, but difference in spacings only. We should still
|
||||
* report not-equal, so "burly wood" is not a valid color.
|
||||
*/
|
||||
|
||||
r = 1;
|
||||
}
|
||||
*special = num;
|
||||
return r;
|
||||
}
|
||||
|
||||
#define RED(p) ((unsigned char) (p)[0])
|
||||
#define GREEN(p) ((unsigned char) (p)[1])
|
||||
#define BLUE(p) ((unsigned char) (p)[2])
|
||||
#define US(expr) ((unsigned short) (expr))
|
||||
|
||||
Status
|
||||
XParseColor(
|
||||
Display *display,
|
||||
Colormap map,
|
||||
const char *spec,
|
||||
XColor *colorPtr)
|
||||
{
|
||||
if (spec[0] == '#') {
|
||||
char *p;
|
||||
Tcl_WideInt value = parseHex64bit(++spec, &p);
|
||||
|
||||
switch ((int)(p-spec)) {
|
||||
case 3:
|
||||
colorPtr->red = US(((value >> 8) & 0xf) * 0x1111);
|
||||
colorPtr->green = US(((value >> 4) & 0xf) * 0x1111);
|
||||
colorPtr->blue = US((value & 0xf) * 0x1111);
|
||||
break;
|
||||
case 6:
|
||||
colorPtr->red = US(((value >> 16) & 0xff) | ((value >> 8) & 0xff00));
|
||||
colorPtr->green = US(((value >> 8) & 0xff) | (value & 0xff00));
|
||||
colorPtr->blue = US((value & 0xff) | (value << 8));
|
||||
break;
|
||||
case 9:
|
||||
colorPtr->red = US(((value >> 32) & 0xf) | ((value >> 20) & 0xfff0));
|
||||
colorPtr->green = US(((value >> 20) & 0xf) | ((value >> 8) & 0xfff0));
|
||||
colorPtr->blue = US(((value >> 8) & 0xf) | (value << 4));
|
||||
break;
|
||||
case 12:
|
||||
colorPtr->red = US(value >> 32);
|
||||
colorPtr->green = US(value >> 16);
|
||||
colorPtr->blue = US(value);
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* Perform a binary search on the sorted array of colors.
|
||||
* size = current size of search range
|
||||
* p = pointer to current element being considered.
|
||||
*/
|
||||
|
||||
int size, num;
|
||||
const elem *p;
|
||||
const char *q;
|
||||
int r = (spec[0] - 'A') & 0xdf;
|
||||
|
||||
if (r >= (int) sizeof(az) - 1) {
|
||||
return 0;
|
||||
}
|
||||
size = az[r + 1] - az[r];
|
||||
p = &xColors[(az[r + 1] + az[r]) >> 1];
|
||||
r = colorcmp(spec + 1, *p, &num);
|
||||
|
||||
while (r != 0) {
|
||||
if (r < 0) {
|
||||
size = (size >> 1);
|
||||
p -= ((size + 1) >> 1);
|
||||
} else {
|
||||
--size;
|
||||
size = (size >> 1);
|
||||
p += ((size + 2) >> 1);
|
||||
}
|
||||
if (!size) {
|
||||
return 0;
|
||||
}
|
||||
r = colorcmp(spec + 1, *p, &num);
|
||||
}
|
||||
if (num > (*p)[31]) {
|
||||
if (((*p)[31] != 8) || num > 100) {
|
||||
return 0;
|
||||
}
|
||||
num = (num * 255 + 50) / 100;
|
||||
if ((num == 230) || (num == 128)) {
|
||||
/*
|
||||
* Those two entries have a deviation i.r.t the table.
|
||||
*/
|
||||
|
||||
num--;
|
||||
}
|
||||
num |= (num << 8);
|
||||
colorPtr->red = colorPtr->green = colorPtr->blue = num;
|
||||
} else {
|
||||
q = *p + 28 - num * 3;
|
||||
colorPtr->red = ((RED(q) << 8) | RED(q));
|
||||
colorPtr->green = ((GREEN(q) << 8) | GREEN(q));
|
||||
colorPtr->blue = ((BLUE(q) << 8) | BLUE(q));
|
||||
}
|
||||
}
|
||||
colorPtr->pixel = TkpGetPixel(colorPtr);
|
||||
colorPtr->flags = DoRed|DoGreen|DoBlue;
|
||||
colorPtr->pad = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: c
|
||||
* c-basic-offset: 4
|
||||
* fill-column: 78
|
||||
* End:
|
||||
*/
|
||||
88
xlib/xdraw.c
Normal file
88
xlib/xdraw.c
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* xdraw.c --
|
||||
*
|
||||
* This file contains generic procedures related to X drawing primitives.
|
||||
*
|
||||
* Copyright (c) 1995 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution of
|
||||
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#include "tk.h"
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* XDrawLine --
|
||||
*
|
||||
* Draw a single line between two points in a given drawable.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* Draws a single line segment.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
XDrawLine(
|
||||
Display *display,
|
||||
Drawable d,
|
||||
GC gc,
|
||||
int x1, int y1,
|
||||
int x2, int y2) /* Coordinates of line segment. */
|
||||
{
|
||||
XPoint points[2];
|
||||
|
||||
points[0].x = x1;
|
||||
points[0].y = y1;
|
||||
points[1].x = x2;
|
||||
points[1].y = y2;
|
||||
return XDrawLines(display, d, gc, points, 2, CoordModeOrigin);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* XFillRectangle --
|
||||
*
|
||||
* Fills a rectangular area in the given drawable. This procedure is
|
||||
* implemented as a call to XFillRectangles.
|
||||
*
|
||||
* Results:
|
||||
* None
|
||||
*
|
||||
* Side effects:
|
||||
* Fills the specified rectangle.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
XFillRectangle(
|
||||
Display *display,
|
||||
Drawable d,
|
||||
GC gc,
|
||||
int x,
|
||||
int y,
|
||||
unsigned int width,
|
||||
unsigned int height)
|
||||
{
|
||||
XRectangle rectangle;
|
||||
rectangle.x = x;
|
||||
rectangle.y = y;
|
||||
rectangle.width = width;
|
||||
rectangle.height = height;
|
||||
return XFillRectangles(display, d, gc, &rectangle, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: c
|
||||
* c-basic-offset: 4
|
||||
* fill-column: 78
|
||||
* End:
|
||||
*/
|
||||
666
xlib/xgc.c
Normal file
666
xlib/xgc.c
Normal file
@@ -0,0 +1,666 @@
|
||||
/*
|
||||
* xgc.c --
|
||||
*
|
||||
* This file contains generic routines for manipulating X graphics
|
||||
* contexts.
|
||||
*
|
||||
* Copyright (c) 1995-1996 Sun Microsystems, Inc.
|
||||
* Copyright (c) 2002-2009 Daniel A. Steffen <das@users.sourceforge.net>
|
||||
* Copyright 2008-2009, Apple Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution of
|
||||
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#include "tkInt.h"
|
||||
|
||||
#if !defined(MAC_OSX_TK)
|
||||
# include <X11/Xlib.h>
|
||||
# define gcCacheSize 0
|
||||
# define TkpInitGCCache(gc)
|
||||
# define TkpFreeGCCache(gc)
|
||||
# define TkpGetGCCache(gc)
|
||||
#else
|
||||
# include <tkMacOSXInt.h>
|
||||
# include <X11/Xlib.h>
|
||||
# include <X11/X.h>
|
||||
# define Cursor XCursor
|
||||
# define Region XRegion
|
||||
# define gcCacheSize sizeof(TkpGCCache)
|
||||
#endif
|
||||
|
||||
#undef TkSetRegion
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* AllocClipMask --
|
||||
*
|
||||
* Static helper proc to allocate new or clear existing TkpClipMask.
|
||||
*
|
||||
* Results:
|
||||
* Returns ptr to the new/cleared TkpClipMask.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static TkpClipMask *AllocClipMask(GC gc) {
|
||||
TkpClipMask *clip_mask = (TkpClipMask*) gc->clip_mask;
|
||||
|
||||
if (clip_mask == None) {
|
||||
clip_mask = ckalloc(sizeof(TkpClipMask));
|
||||
gc->clip_mask = (Pixmap) clip_mask;
|
||||
#ifdef MAC_OSX_TK
|
||||
} else if (clip_mask->type == TKP_CLIP_REGION) {
|
||||
TkpReleaseRegion(clip_mask->value.region);
|
||||
#endif
|
||||
}
|
||||
return clip_mask;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FreeClipMask --
|
||||
*
|
||||
* Static helper proc to free TkpClipMask.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static void FreeClipMask(GC gc) {
|
||||
if (gc->clip_mask != None) {
|
||||
#ifdef MAC_OSX_TK
|
||||
if (((TkpClipMask*) gc->clip_mask)->type == TKP_CLIP_REGION) {
|
||||
TkpReleaseRegion(((TkpClipMask*) gc->clip_mask)->value.region);
|
||||
}
|
||||
#endif
|
||||
ckfree(gc->clip_mask);
|
||||
gc->clip_mask = None;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* XCreateGC --
|
||||
*
|
||||
* Allocate a new GC, and initialize the specified fields.
|
||||
*
|
||||
* Results:
|
||||
* Returns a newly allocated GC.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
GC
|
||||
XCreateGC(
|
||||
Display *display,
|
||||
Drawable d,
|
||||
unsigned long mask,
|
||||
XGCValues *values)
|
||||
{
|
||||
GC gp;
|
||||
|
||||
/*
|
||||
* In order to have room for a dash list, MAX_DASH_LIST_SIZE extra chars
|
||||
* are defined, which is invisible from the outside. The list is assumed
|
||||
* to end with a 0-char, so this must be set explicitely during
|
||||
* initialization.
|
||||
*/
|
||||
|
||||
#define MAX_DASH_LIST_SIZE 10
|
||||
|
||||
gp = ckalloc(sizeof(XGCValues) + MAX_DASH_LIST_SIZE + gcCacheSize);
|
||||
if (!gp) {
|
||||
return None;
|
||||
}
|
||||
|
||||
#define InitField(name,maskbit,default) \
|
||||
(gp->name = (mask & (maskbit)) ? values->name : (default))
|
||||
|
||||
InitField(function, GCFunction, GXcopy);
|
||||
InitField(plane_mask, GCPlaneMask, (unsigned long)(~0));
|
||||
InitField(foreground, GCForeground,
|
||||
BlackPixelOfScreen(DefaultScreenOfDisplay(display)));
|
||||
InitField(background, GCBackground,
|
||||
WhitePixelOfScreen(DefaultScreenOfDisplay(display)));
|
||||
InitField(line_width, GCLineWidth, 1);
|
||||
InitField(line_style, GCLineStyle, LineSolid);
|
||||
InitField(cap_style, GCCapStyle, 0);
|
||||
InitField(join_style, GCJoinStyle, 0);
|
||||
InitField(fill_style, GCFillStyle, FillSolid);
|
||||
InitField(fill_rule, GCFillRule, WindingRule);
|
||||
InitField(arc_mode, GCArcMode, ArcPieSlice);
|
||||
InitField(tile, GCTile, None);
|
||||
InitField(stipple, GCStipple, None);
|
||||
InitField(ts_x_origin, GCTileStipXOrigin, 0);
|
||||
InitField(ts_y_origin, GCTileStipYOrigin, 0);
|
||||
InitField(font, GCFont, None);
|
||||
InitField(subwindow_mode, GCSubwindowMode, ClipByChildren);
|
||||
InitField(graphics_exposures, GCGraphicsExposures, True);
|
||||
InitField(clip_x_origin, GCClipXOrigin, 0);
|
||||
InitField(clip_y_origin, GCClipYOrigin, 0);
|
||||
InitField(dash_offset, GCDashOffset, 0);
|
||||
InitField(dashes, GCDashList, 4);
|
||||
(&(gp->dashes))[1] = 0;
|
||||
|
||||
gp->clip_mask = None;
|
||||
if (mask & GCClipMask) {
|
||||
TkpClipMask *clip_mask = AllocClipMask(gp);
|
||||
|
||||
clip_mask->type = TKP_CLIP_PIXMAP;
|
||||
clip_mask->value.pixmap = values->clip_mask;
|
||||
}
|
||||
TkpInitGCCache(gp);
|
||||
|
||||
return gp;
|
||||
}
|
||||
|
||||
#ifdef MAC_OSX_TK
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TkpGetGCCache --
|
||||
*
|
||||
* Results:
|
||||
* Pointer to the TkpGCCache at the end of the GC.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
TkpGCCache*
|
||||
TkpGetGCCache(GC gc) {
|
||||
return (gc ? (TkpGCCache*)(((char*) gc) + sizeof(XGCValues) +
|
||||
MAX_DASH_LIST_SIZE) : NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* XChangeGC --
|
||||
*
|
||||
* Changes the GC components specified by valuemask for the specified GC.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* Updates the specified GC.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
XChangeGC(
|
||||
Display *d,
|
||||
GC gc,
|
||||
unsigned long mask,
|
||||
XGCValues *values)
|
||||
{
|
||||
#define ModifyField(name,maskbit) \
|
||||
if (mask & (maskbit)) { gc->name = values->name; }
|
||||
|
||||
ModifyField(function, GCFunction);
|
||||
ModifyField(plane_mask, GCPlaneMask);
|
||||
ModifyField(foreground, GCForeground);
|
||||
ModifyField(background, GCBackground);
|
||||
ModifyField(line_width, GCLineWidth);
|
||||
ModifyField(line_style, GCLineStyle);
|
||||
ModifyField(cap_style, GCCapStyle);
|
||||
ModifyField(join_style, GCJoinStyle);
|
||||
ModifyField(fill_style, GCFillStyle);
|
||||
ModifyField(fill_rule, GCFillRule);
|
||||
ModifyField(arc_mode, GCArcMode);
|
||||
ModifyField(tile, GCTile);
|
||||
ModifyField(stipple, GCStipple);
|
||||
ModifyField(ts_x_origin, GCTileStipXOrigin);
|
||||
ModifyField(ts_y_origin, GCTileStipYOrigin);
|
||||
ModifyField(font, GCFont);
|
||||
ModifyField(subwindow_mode, GCSubwindowMode);
|
||||
ModifyField(graphics_exposures, GCGraphicsExposures);
|
||||
ModifyField(clip_x_origin, GCClipXOrigin);
|
||||
ModifyField(clip_y_origin, GCClipYOrigin);
|
||||
ModifyField(dash_offset, GCDashOffset);
|
||||
if (mask & GCClipMask) {
|
||||
XSetClipMask(d, gc, values->clip_mask);
|
||||
}
|
||||
if (mask & GCDashList) {
|
||||
gc->dashes = values->dashes;
|
||||
(&(gc->dashes))[1] = 0;
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* XFreeGC --
|
||||
*
|
||||
* Deallocates the specified graphics context.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int XFreeGC(
|
||||
Display *d,
|
||||
GC gc)
|
||||
{
|
||||
if (gc != None) {
|
||||
FreeClipMask(gc);
|
||||
TkpFreeGCCache(gc);
|
||||
ckfree(gc);
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* XSetForeground, etc. --
|
||||
*
|
||||
* The following functions are simply accessor functions for the GC
|
||||
* slots.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* Each function sets some slot in the GC.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
XSetForeground(
|
||||
Display *display,
|
||||
GC gc,
|
||||
unsigned long foreground)
|
||||
{
|
||||
gc->foreground = foreground;
|
||||
return Success;
|
||||
}
|
||||
|
||||
int
|
||||
XSetBackground(
|
||||
Display *display,
|
||||
GC gc,
|
||||
unsigned long background)
|
||||
{
|
||||
gc->background = background;
|
||||
return Success;
|
||||
}
|
||||
|
||||
int
|
||||
XSetDashes(
|
||||
Display *display,
|
||||
GC gc,
|
||||
int dash_offset,
|
||||
_Xconst char *dash_list,
|
||||
int n)
|
||||
{
|
||||
char *p = &(gc->dashes);
|
||||
|
||||
#ifdef TkWinDeleteBrush
|
||||
TkWinDeleteBrush(gc->fgBrush);
|
||||
TkWinDeletePen(gc->fgPen);
|
||||
TkWinDeleteBrush(gc->bgBrush);
|
||||
TkWinDeletePen(gc->fgExtPen);
|
||||
#endif
|
||||
gc->dash_offset = dash_offset;
|
||||
if (n > MAX_DASH_LIST_SIZE) n = MAX_DASH_LIST_SIZE;
|
||||
while (n-- > 0) {
|
||||
*p++ = *dash_list++;
|
||||
}
|
||||
*p = 0;
|
||||
return Success;
|
||||
}
|
||||
|
||||
int
|
||||
XSetFunction(
|
||||
Display *display,
|
||||
GC gc,
|
||||
int function)
|
||||
{
|
||||
gc->function = function;
|
||||
return Success;
|
||||
}
|
||||
|
||||
int
|
||||
XSetFillRule(
|
||||
Display *display,
|
||||
GC gc,
|
||||
int fill_rule)
|
||||
{
|
||||
gc->fill_rule = fill_rule;
|
||||
return Success;
|
||||
}
|
||||
|
||||
int
|
||||
XSetFillStyle(
|
||||
Display *display,
|
||||
GC gc,
|
||||
int fill_style)
|
||||
{
|
||||
gc->fill_style = fill_style;
|
||||
return Success;
|
||||
}
|
||||
|
||||
int
|
||||
XSetTSOrigin(
|
||||
Display *display,
|
||||
GC gc,
|
||||
int x, int y)
|
||||
{
|
||||
gc->ts_x_origin = x;
|
||||
gc->ts_y_origin = y;
|
||||
return Success;
|
||||
}
|
||||
|
||||
int
|
||||
XSetFont(
|
||||
Display *display,
|
||||
GC gc,
|
||||
Font font)
|
||||
{
|
||||
gc->font = font;
|
||||
return Success;
|
||||
}
|
||||
|
||||
int
|
||||
XSetArcMode(
|
||||
Display *display,
|
||||
GC gc,
|
||||
int arc_mode)
|
||||
{
|
||||
gc->arc_mode = arc_mode;
|
||||
return Success;
|
||||
}
|
||||
|
||||
int
|
||||
XSetStipple(
|
||||
Display *display,
|
||||
GC gc,
|
||||
Pixmap stipple)
|
||||
{
|
||||
gc->stipple = stipple;
|
||||
return Success;
|
||||
}
|
||||
|
||||
int
|
||||
XSetLineAttributes(
|
||||
Display *display,
|
||||
GC gc,
|
||||
unsigned int line_width,
|
||||
int line_style,
|
||||
int cap_style,
|
||||
int join_style)
|
||||
{
|
||||
gc->line_width = line_width;
|
||||
gc->line_style = line_style;
|
||||
gc->cap_style = cap_style;
|
||||
gc->join_style = join_style;
|
||||
return Success;
|
||||
}
|
||||
|
||||
int
|
||||
XSetClipOrigin(
|
||||
Display *display,
|
||||
GC gc,
|
||||
int clip_x_origin,
|
||||
int clip_y_origin)
|
||||
{
|
||||
gc->clip_x_origin = clip_x_origin;
|
||||
gc->clip_y_origin = clip_y_origin;
|
||||
return Success;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TkSetRegion, XSetClipMask --
|
||||
*
|
||||
* Sets the clipping region/pixmap for a GC.
|
||||
*
|
||||
* Note that unlike the Xlib equivalent, it is not safe to delete the
|
||||
* region after setting it into the GC (except on Mac OS X). The only
|
||||
* uses of TkSetRegion are currently in DisplayFrame and in
|
||||
* ImgPhotoDisplay, which use the GC immediately.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* Allocates or dealloates a TkpClipMask.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
TkSetRegion(
|
||||
Display *display,
|
||||
GC gc,
|
||||
TkRegion r)
|
||||
{
|
||||
if (r == None) {
|
||||
Tcl_Panic("must not pass None to TkSetRegion for compatibility with X11; use XSetClipMask instead");
|
||||
} else {
|
||||
TkpClipMask *clip_mask = AllocClipMask(gc);
|
||||
|
||||
clip_mask->type = TKP_CLIP_REGION;
|
||||
clip_mask->value.region = r;
|
||||
#ifdef MAC_OSX_TK
|
||||
TkpRetainRegion(r);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
XSetClipMask(
|
||||
Display *display,
|
||||
GC gc,
|
||||
Pixmap pixmap)
|
||||
{
|
||||
if (pixmap == None) {
|
||||
FreeClipMask(gc);
|
||||
} else {
|
||||
TkpClipMask *clip_mask = AllocClipMask(gc);
|
||||
|
||||
clip_mask->type = TKP_CLIP_PIXMAP;
|
||||
clip_mask->value.pixmap = pixmap;
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
/*
|
||||
* Some additional dummy functions (hopefully implemented soon).
|
||||
*/
|
||||
|
||||
#if 0
|
||||
Cursor
|
||||
XCreateFontCursor(
|
||||
Display *display,
|
||||
unsigned int shape)
|
||||
{
|
||||
return (Cursor) 0;
|
||||
}
|
||||
|
||||
void
|
||||
XDrawImageString(
|
||||
Display *display,
|
||||
Drawable d,
|
||||
GC gc,
|
||||
int x,
|
||||
int y,
|
||||
_Xconst char *string,
|
||||
int length)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
XDrawPoint(
|
||||
Display *display,
|
||||
Drawable d,
|
||||
GC gc,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
XDrawLine(display, d, gc, x, y, x, y);
|
||||
}
|
||||
|
||||
void
|
||||
XDrawPoints(
|
||||
Display *display,
|
||||
Drawable d,
|
||||
GC gc,
|
||||
XPoint *points,
|
||||
int npoints,
|
||||
int mode)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0; i<npoints; i++) {
|
||||
XDrawLine(display, d, gc,
|
||||
points[i].x, points[i].y, points[i].x, points[i].y);
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(MAC_OSX_TK)
|
||||
void
|
||||
XDrawSegments(
|
||||
Display *display,
|
||||
Drawable d,
|
||||
GC gc,
|
||||
XSegment *segments,
|
||||
int nsegments)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
char *
|
||||
XFetchBuffer(
|
||||
Display *display,
|
||||
int *nbytes_return,
|
||||
int buffer)
|
||||
{
|
||||
return (char *) 0;
|
||||
}
|
||||
|
||||
Status
|
||||
XFetchName(
|
||||
Display *display,
|
||||
Window w,
|
||||
char **window_name_return)
|
||||
{
|
||||
return (Status) 0;
|
||||
}
|
||||
|
||||
Atom *
|
||||
XListProperties(
|
||||
Display* display,
|
||||
Window w,
|
||||
int *num_prop_return)
|
||||
{
|
||||
return (Atom *) 0;
|
||||
}
|
||||
|
||||
void
|
||||
XMapRaised(
|
||||
Display *display,
|
||||
Window w)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
XPutImage(
|
||||
Display *display,
|
||||
Drawable d,
|
||||
GC gc,
|
||||
XImage *image,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
unsigned int width,
|
||||
unsigned int height)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
XQueryTextExtents(
|
||||
Display *display,
|
||||
XID font_ID,
|
||||
_Xconst char *string,
|
||||
int nchars,
|
||||
int *direction_return,
|
||||
int *font_ascent_return,
|
||||
int *font_descent_return,
|
||||
XCharStruct *overall_return)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
XReparentWindow(
|
||||
Display *display,
|
||||
Window w,
|
||||
Window parent,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
XRotateBuffers(
|
||||
Display *display,
|
||||
int rotate)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
XStoreBuffer(
|
||||
Display *display,
|
||||
_Xconst char *bytes,
|
||||
int nbytes,
|
||||
int buffer)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
XUndefineCursor(
|
||||
Display *display,
|
||||
Window w)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: c
|
||||
* c-basic-offset: 4
|
||||
* fill-column: 78
|
||||
* End:
|
||||
*/
|
||||
69
xlib/ximage.c
Normal file
69
xlib/ximage.c
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* ximage.c --
|
||||
*
|
||||
* X bitmap and image routines.
|
||||
*
|
||||
* Copyright (c) 1995 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution of
|
||||
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#include "tkInt.h"
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* XCreateBitmapFromData --
|
||||
*
|
||||
* Construct a single plane pixmap from bitmap data.
|
||||
*
|
||||
* NOTE: This procedure has the correct behavior on Windows and the
|
||||
* Macintosh, but not on UNIX. This is probably because the emulation for
|
||||
* XPutImage on those platforms compensates for whatever is wrong here
|
||||
* :-)
|
||||
*
|
||||
* Results:
|
||||
* Returns a new Pixmap.
|
||||
*
|
||||
* Side effects:
|
||||
* Allocates a new bitmap and drawable.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
Pixmap
|
||||
XCreateBitmapFromData(
|
||||
Display *display,
|
||||
Drawable d,
|
||||
_Xconst char *data,
|
||||
unsigned int width,
|
||||
unsigned int height)
|
||||
{
|
||||
XImage *ximage;
|
||||
GC gc;
|
||||
Pixmap pix;
|
||||
|
||||
pix = Tk_GetPixmap(display, d, (int) width, (int) height, 1);
|
||||
gc = XCreateGC(display, pix, 0, NULL);
|
||||
if (gc == NULL) {
|
||||
return None;
|
||||
}
|
||||
ximage = XCreateImage(display, NULL, 1, XYBitmap, 0, (char*) data, width,
|
||||
height, 8, (width + 7) / 8);
|
||||
ximage->bitmap_bit_order = LSBFirst;
|
||||
_XInitImageFuncPtrs(ximage);
|
||||
TkPutImage(NULL, 0, display, pix, gc, ximage, 0, 0, 0, 0, width, height);
|
||||
ximage->data = NULL;
|
||||
XDestroyImage(ximage);
|
||||
XFreeGC(display, gc);
|
||||
return pix;
|
||||
}
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: c
|
||||
* c-basic-offset: 4
|
||||
* fill-column: 78
|
||||
* End:
|
||||
*/
|
||||
117
xlib/xutil.c
Normal file
117
xlib/xutil.c
Normal file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* xutil.c --
|
||||
*
|
||||
* This function contains generic X emulation routines.
|
||||
*
|
||||
* Copyright (c) 1995-1996 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution of
|
||||
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <tk.h>
|
||||
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* XInternAtom --
|
||||
*
|
||||
* This procedure simulates the XInternAtom function by calling Tk_Uid to
|
||||
* get a unique id for every atom. This is only a partial implementation,
|
||||
* since it doesn't work across applications.
|
||||
*
|
||||
* Results:
|
||||
* A new Atom.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
Atom
|
||||
XInternAtom(
|
||||
Display *display,
|
||||
_Xconst char *atom_name,
|
||||
Bool only_if_exists)
|
||||
{
|
||||
static Atom atom = XA_LAST_PREDEFINED;
|
||||
|
||||
display->request++;
|
||||
return ++atom;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* XGetVisualInfo --
|
||||
*
|
||||
* Returns information about the specified visual.
|
||||
*
|
||||
* Results:
|
||||
* Returns a newly allocated XVisualInfo structure.
|
||||
*
|
||||
* Side effects:
|
||||
* Allocates storage.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
XVisualInfo *
|
||||
XGetVisualInfo(
|
||||
Display *display,
|
||||
long vinfo_mask,
|
||||
XVisualInfo *vinfo_template,
|
||||
int *nitems_return)
|
||||
{
|
||||
XVisualInfo *info = ckalloc(sizeof(XVisualInfo));
|
||||
|
||||
info->visual = DefaultVisual(display, 0);
|
||||
info->visualid = info->visual->visualid;
|
||||
info->screen = 0;
|
||||
info->depth = info->visual->bits_per_rgb;
|
||||
info->class = info->visual->class;
|
||||
info->colormap_size = info->visual->map_entries;
|
||||
info->bits_per_rgb = info->visual->bits_per_rgb;
|
||||
info->red_mask = info->visual->red_mask;
|
||||
info->green_mask = info->visual->green_mask;
|
||||
info->blue_mask = info->visual->blue_mask;
|
||||
|
||||
if (((vinfo_mask & VisualIDMask)
|
||||
&& (vinfo_template->visualid != info->visualid))
|
||||
|| ((vinfo_mask & VisualScreenMask)
|
||||
&& (vinfo_template->screen != info->screen))
|
||||
|| ((vinfo_mask & VisualDepthMask)
|
||||
&& (vinfo_template->depth != info->depth))
|
||||
|| ((vinfo_mask & VisualClassMask)
|
||||
&& (vinfo_template->class != info->class))
|
||||
|| ((vinfo_mask & VisualColormapSizeMask)
|
||||
&& (vinfo_template->colormap_size != info->colormap_size))
|
||||
|| ((vinfo_mask & VisualBitsPerRGBMask)
|
||||
&& (vinfo_template->bits_per_rgb != info->bits_per_rgb))
|
||||
|| ((vinfo_mask & VisualRedMaskMask)
|
||||
&& (vinfo_template->red_mask != info->red_mask))
|
||||
|| ((vinfo_mask & VisualGreenMaskMask)
|
||||
&& (vinfo_template->green_mask != info->green_mask))
|
||||
|| ((vinfo_mask & VisualBlueMaskMask)
|
||||
&& (vinfo_template->blue_mask != info->blue_mask))
|
||||
) {
|
||||
ckfree(info);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*nitems_return = 1;
|
||||
return info;
|
||||
}
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: c
|
||||
* c-basic-offset: 4
|
||||
* fill-column: 78
|
||||
* End:
|
||||
*/
|
||||
Reference in New Issue
Block a user