⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xlibint.h

📁 unix vnc 协议源码. VNC是一款远程控制工具软件.
💻 H
📖 第 1 页 / 共 3 页
字号:
/* $XFree86: xc/lib/X11/Xlibint.h,v 3.7 1996/12/23 05:59:50 dawes Exp $ *//* $XConsortium: Xlibint.h /main/114 1996/10/22 14:24:29 kaleb $ *//*Copyright (c) 1984, 1985, 1987, 1989  X ConsortiumPermission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:The above copyright notice and this permission notice shall be includedin all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OROTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OROTHER DEALINGS IN THE SOFTWARE.Except as contained in this notice, the name of the X Consortium shallnot be used in advertising or otherwise to promote the sale, use orother dealings in this Software without prior written authorizationfrom the X Consortium.*//* *	Xlibint.h - Header definition and support file for the internal *	support routines used by the C subroutine interface *	library (Xlib) to the X Window System. * *	Warning, there be dragons here.... */#include <X11/Xlib.h>#ifdef WIN32#define _XFlush _XFlushIt#endif/* * If your BytesReadable correctly detects broken connections, then * you should NOT define XCONN_CHECK_FREQ. */#ifndef XCONN_CHECK_FREQ#define XCONN_CHECK_FREQ 256#endifstruct _XGC{    XExtData *ext_data;	/* hook for extension to hang data */    GContext gid;	/* protocol ID for graphics context */    Bool rects;		/* boolean: TRUE if clipmask is list of rectangles */    Bool dashes;	/* boolean: TRUE if dash-list is really a list */    unsigned long dirty;/* cache dirty bits */    XGCValues values;	/* shadow structure of values */};struct _XDisplay{	XExtData *ext_data;	/* hook for extension to hang data */	struct _XFreeFuncs *free_funcs; /* internal free functions */	int fd;			/* Network socket. */	int conn_checker;         /* ugly thing used by _XEventsQueued */	int proto_major_version;/* maj. version of server's X protocol */	int proto_minor_version;/* minor version of server's X protocol */	char *vendor;		/* vendor of the server hardware */        XID resource_base;	/* resource ID base */	XID resource_mask;	/* resource ID mask bits */	XID resource_id;	/* allocator current ID */	int resource_shift;	/* allocator shift to correct bits */	XID (*resource_alloc)(	/* allocator function */#if NeedFunctionPrototypes		struct _XDisplay*#endif		);	int byte_order;		/* screen byte order, LSBFirst, MSBFirst */	int bitmap_unit;	/* padding and data requirements */	int bitmap_pad;		/* padding requirements on bitmaps */	int bitmap_bit_order;	/* LeastSignificant or MostSignificant */	int nformats;		/* number of pixmap formats in list */	ScreenFormat *pixmap_format;	/* pixmap format list */	int vnumber;		/* Xlib's X protocol version number. */	int release;		/* release of the server */	struct _XSQEvent *head, *tail;	/* Input event queue. */	int qlen;		/* Length of input event queue */	unsigned long last_request_read; /* seq number of last event read */	unsigned long request;	/* sequence number of last request. */	char *last_req;		/* beginning of last request, or dummy */	char *buffer;		/* Output buffer starting address. */	char *bufptr;		/* Output buffer index pointer. */	char *bufmax;		/* Output buffer maximum+1 address. */	unsigned max_request_size; /* maximum number 32 bit words in request*/	struct _XrmHashBucketRec *db;	int (*synchandler)(	/* Synchronization handler */#if NeedFunctionPrototypes		struct _XDisplay*#endif		);	char *display_name;	/* "host:display" string used on this connect*/	int default_screen;	/* default screen for operations */	int nscreens;		/* number of screens on this server*/	Screen *screens;	/* pointer to list of screens */	unsigned long motion_buffer;	/* size of motion buffer */	unsigned long flags;	   /* internal connection flags */	int min_keycode;	/* minimum defined keycode */	int max_keycode;	/* maximum defined keycode */	KeySym *keysyms;	/* This server's keysyms */	XModifierKeymap *modifiermap;	/* This server's modifier keymap */	int keysyms_per_keycode;/* number of rows */	char *xdefaults;	/* contents of defaults from server */	char *scratch_buffer;	/* place to hang scratch buffer */	unsigned long scratch_length;	/* length of scratch buffer */	int ext_number;		/* extension number on this display */	struct _XExten *ext_procs; /* extensions initialized on this display */	/*	 * the following can be fixed size, as the protocol defines how	 * much address space is available. 	 * While this could be done using the extension vector, there	 * may be MANY events processed, so a search through the extension	 * list to find the right procedure for each event might be	 * expensive if many extensions are being used.	 */	Bool (*event_vec[128])();  /* vector for wire to event */	Status (*wire_vec[128])(); /* vector for event to wire */	KeySym lock_meaning;	   /* for XLookupString */	struct _XLockInfo *lock;   /* multi-thread state, display lock */	struct _XInternalAsync *async_handlers; /* for internal async */	unsigned long bigreq_size; /* max size of big requests */	struct _XLockPtrs *lock_fns; /* pointers to threads functions */	void (*idlist_alloc)();	   /* XID list allocator function */	/* things above this line should not move, for binary compatibility */	struct _XKeytrans *key_bindings; /* for XLookupString */	Font cursor_font;	   /* for XCreateFontCursor */	struct _XDisplayAtoms *atoms; /* for XInternAtom */	unsigned int mode_switch;  /* keyboard group modifiers */	unsigned int num_lock;  /* keyboard numlock modifiers */	struct _XContextDB *context_db; /* context database */	Bool (**error_vec)();      /* vector for wire to error */	/*	 * Xcms information	 */	struct {	   XPointer defaultCCCs;  /* pointer to an array of default XcmsCCC */	   XPointer clientCmaps;  /* pointer to linked list of XcmsCmapRec */	   XPointer perVisualIntensityMaps;				  /* linked list of XcmsIntensityMap */	} cms;	struct _XIMFilter *im_filters;	struct _XSQEvent *qfree; /* unallocated event queue elements */	unsigned long next_event_serial_num; /* inserted into next queue elt */	struct _XExten *flushes; /* Flush hooks */	struct _XConnectionInfo *im_fd_info; /* _XRegisterInternalConnection */	int im_fd_length;	/* number of im_fd_info */	struct _XConnWatchInfo *conn_watchers; /* XAddConnectionWatch */	int watcher_count;	/* number of conn_watchers */	XPointer filedes;	/* struct pollfd cache for _XWaitForReadable */	int (*savedsynchandler)(); /* user synchandler when Xlib usurps */	XID resource_max;	/* allocator max ID */	int xcmisc_opcode;	/* major opcode for XC-MISC */	struct _XkbInfoRec *xkb_info; /* XKB info */	struct _XtransConnInfo *trans_conn; /* transport connection object */};#define XAllocIDs(dpy,ids,n) (*(dpy)->idlist_alloc)(dpy,ids,n)/* * define the following if you want the Data macro to be a procedure instead */#ifdef CRAY#define DataRoutineIsProcedure#endif /* CRAY */#ifndef _XEVENT_/* * _QEvent datatype for use in input queueing. */typedef struct _XSQEvent{    struct _XSQEvent *next;    XEvent event;    unsigned long qserial_num;	/* so multi-threaded code can find new ones */} _XQEvent;#endif#ifdef XTHREADS			/* for xReply */#define NEED_REPLIES#endif#if NeedFunctionPrototypes	/* prototypes require event type definitions */#define NEED_EVENTS#define NEED_REPLIES#endif#include <X11/Xproto.h>#ifdef __sgi#define _SGI_MP_SOURCE  /* turn this on to get MP safe errno */#endif#include <errno.h>#define _XBCOPYFUNC _Xbcopy#include <X11/Xfuncs.h>#include <X11/Xosdefs.h>/* Utek leaves kernel macros around in include files (bleah) */#ifdef dirty#undef dirty#endif#ifndef X_NOT_STDC_ENV#include <stdlib.h>#include <string.h>#elsechar *malloc(), *realloc(), *calloc();void exit();#ifdef SYSV#include <string.h>#else#include <strings.h>#endif#endif/* * The following definitions can be used for locking requests in multi-threaded * address spaces. */#ifdef XTHREADS/* Author: Stephen Gildea, MIT X Consortium * * declarations for C Threads locking */#include <X11/Xfuncproto.h>struct _XLockPtrs {    /* used by all, including extensions; do not move */    void (*lock_display)();    void (*unlock_display)();};typedef struct _LockInfoRec *LockInfoPtr;#if defined(WIN32) && !defined(_XLIBINT_)#define _XCreateMutex_fn (*_XCreateMutex_fn_p)#define _XFreeMutex_fn (*_XFreeMutex_fn_p)#define _XLockMutex_fn (*_XLockMutex_fn_p)#define _XUnlockMutex_fn (*_XUnlockMutex_fn_p)#define _Xglobal_lock (*_Xglobal_lock_p)#endif/* in XlibInt.c */extern void (*_XCreateMutex_fn)(#if NeedFunctionPrototypes    LockInfoPtr /* lock */#endif);extern void (*_XFreeMutex_fn)(#if NeedFunctionPrototypes    LockInfoPtr /* lock */#endif);extern void (*_XLockMutex_fn)(#if NeedFunctionPrototypes    LockInfoPtr	/* lock */#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)    , char * /* file */    , int /* line */#endif#endif);extern void (*_XUnlockMutex_fn)(#if NeedFunctionPrototypes    LockInfoPtr	/* lock */#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)    , char * /* file */    , int /* line */#endif#endif);extern LockInfoPtr _Xglobal_lock;#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)#define LockDisplay(d)	     if ((d)->lock_fns) (*(d)->lock_fns->lock_display)((d),__FILE__,__LINE__)#define UnlockDisplay(d)     if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)((d),__FILE__,__LINE__)#define _XLockMutex(lock)		if (_XLockMutex_fn) (*_XLockMutex_fn)(lock,__FILE__,__LINE__)#define _XUnlockMutex(lock)	if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock,__FILE__,__LINE__)#else/* used everywhere, so must be fast if not using threads */#define LockDisplay(d)	     if ((d)->lock_fns) (*(d)->lock_fns->lock_display)(d)#define UnlockDisplay(d)     if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)(d)#define _XLockMutex(lock)		if (_XLockMutex_fn) (*_XLockMutex_fn)(lock)#define _XUnlockMutex(lock)	if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock)#endif#define _XCreateMutex(lock)	if (_XCreateMutex_fn) (*_XCreateMutex_fn)(lock);#define _XFreeMutex(lock)	if (_XFreeMutex_fn) (*_XFreeMutex_fn)(lock);#else /* XTHREADS */#define LockDisplay(dis)#define _XLockMutex(lock)#define _XUnlockMutex(lock)#define UnlockDisplay(dis)#define _XCreateMutex(lock)#define _XFreeMutex(lock)#endif#define Xfree(ptr) free((ptr))/* * Note that some machines do not return a valid pointer for malloc(0), in * which case we provide an alternate under the control of the * define MALLOC_0_RETURNS_NULL.  This is necessary because some * Xlib code expects malloc(0) to return a valid pointer to storage. */#ifdef MALLOC_0_RETURNS_NULL# define Xmalloc(size) malloc(((size) == 0 ? 1 : (size)))# define Xrealloc(ptr, size) realloc((ptr), ((size) == 0 ? 1 : (size)))# define Xcalloc(nelem, elsize) calloc(((nelem) == 0 ? 1 : (nelem)), (elsize))#else# define Xmalloc(size) malloc((size))# define Xrealloc(ptr, size) realloc((ptr), (size))# define Xcalloc(nelem, elsize) calloc((nelem), (elsize))#endif#ifndef NULL#define NULL 0#endif#define LOCKED 1#define UNLOCKED 0#ifdef X_NOT_STDC_ENVextern int errno;			/* Internal system error number. */#endif#ifndef BUFSIZE#define BUFSIZE 2048			/* X output buffer size. */#endif#ifndef PTSPERBATCH#define PTSPERBATCH 1024		/* point batching */#endif#ifndef WLNSPERBATCH#define WLNSPERBATCH 50			/* wide line batching */#endif#ifndef ZLNSPERBATCH#define ZLNSPERBATCH 1024		/* thin line batching */#endif#ifndef WRCTSPERBATCH#define WRCTSPERBATCH 10		/* wide line rectangle batching */#endif#ifndef ZRCTSPERBATCH#define ZRCTSPERBATCH 256		/* thin line rectangle batching */#endif#ifndef FRCTSPERBATCH#define FRCTSPERBATCH 256		/* filled rectangle batching */#endif#ifndef FARCSPERBATCH#define FARCSPERBATCH 256		/* filled arc batching */#endif#ifndef CURSORFONT#define CURSORFONT "cursor"		/* standard cursor fonts */#endif/* * Display flags */#define XlibDisplayIOError	(1L << 0)#define XlibDisplayClosing	(1L << 1)#define XlibDisplayNoXkb	(1L << 2)#define XlibDisplayPrivSync	(1L << 3)#define XlibDisplayProcConni	(1L << 4) /* in _XProcessInternalConnection */#define XlibDisplayReadEvents	(1L << 5) /* in _XReadEvents */#define XlibDisplayReply	(1L << 5) /* in _XReply */#define XlibDisplayWriting	(1L << 6) /* in _XFlushInt, _XSend *//* * X Protocol packetizing macros. *//*   Need to start requests on 64 bit word boundaries *   on a CRAY computer so add a NoOp (127) if needed. *   A character pointer on a CRAY computer will be non-zero *   after shifting right 61 bits of it is not pointing to *   a word boundary. */#ifdef WORD64#define WORD64ALIGN if ((long)dpy->bufptr >> 61) {\           dpy->last_req = dpy->bufptr;\           *(dpy->bufptr)   = X_NoOperation;\           *(dpy->bufptr+1) =  0;\           *(dpy->bufptr+2) =  0;\           *(dpy->bufptr+3) =  1;\             dpy->request++;\             dpy->bufptr += 4;\         }#else /* else does not require alignment on 64-bit boundaries */#define WORD64ALIGN#endif /* WORD64 *//* * GetReq - Get the next available X request packet in the buffer and * return it.  * * "name" is the name of the request, e.g. CreatePixmap, OpenFont, etc. * "req" is the name of the request pointer. * */#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)#define GetReq(name, req) \

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -