open-src/app/accessx/sun-src/AccessXlibint.h
author Alan Coopersmith <Alan.Coopersmith@Sun.COM>
Tue, 02 Mar 2010 13:31:46 -0800
changeset 919 425233ae7236
parent 551 8dab74c91c43
child 943 294f64612d23
permissions -rw-r--r--
6931307 Standardize Sun copyright & license notices in X gate on current format
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
551
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
     1
/*
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
     2
 * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
     3
 * Use is subject to license terms.
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
     4
 *
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
     5
 * Permission is hereby granted, free of charge, to any person obtaining a
919
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 551
diff changeset
     6
 * copy of this software and associated documentation files (the "Software"),
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 551
diff changeset
     7
 * to deal in the Software without restriction, including without limitation
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 551
diff changeset
     8
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 551
diff changeset
     9
 * and/or sell copies of the Software, and to permit persons to whom the
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 551
diff changeset
    10
 * Software is furnished to do so, subject to the following conditions:
551
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    11
 *
919
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 551
diff changeset
    12
 * The above copyright notice and this permission notice (including the next
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 551
diff changeset
    13
 * paragraph) shall be included in all copies or substantial portions of the
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 551
diff changeset
    14
 * Software.
551
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    15
 *
919
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 551
diff changeset
    16
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 551
diff changeset
    17
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 551
diff changeset
    18
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 551
diff changeset
    19
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 551
diff changeset
    20
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 551
diff changeset
    21
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 551
diff changeset
    22
 * DEALINGS IN THE SOFTWARE.
551
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    23
 */
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    24
/************************************************************************/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    25
/*									*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    26
/*		Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993	*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    27
/*		by Digital Equipment Corp., Maynard, MA			*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    28
/*									*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    29
/*	Permission to use, copy, modify, and distribute this software	*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    30
/*	and its documentation for any purpose and without fee is hereby	*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    31
/*	granted, provided that the above copyright notice appear in all	*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    32
/*	copies and that both that copyright notice and this permission 	*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    33
/*	notice appear in supporting documentation, and that the name of	*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    34
/*	Digital not be used in advertising or publicity pertaining to	*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    35
/*	distribution of the software without specific, written prior 	*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    36
/*	permission.  							*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    37
/*									*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    38
/*	DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,	*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    39
/*	INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 	*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    40
/*	FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL,	*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    41
/*	INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER 	*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    42
/*	RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 	*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    43
/*	ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 	*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    44
/*	ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 	*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    45
/*	OF THIS SOFTWARE.						*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    46
/*									*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    47
/************************************************************************/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    48
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    49
/************************************************************************/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    50
/*									*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    51
/* AccessXlibint   						        */
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    52
/* 									*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    53
/* 	This module provides private definitions for the client library */
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    54
/*	of the server extension.					*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    55
/*									*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    56
/* Revision History:							*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    57
/*									*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    58
/*	11-Jun-1993	WDW & MEN					*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    59
/*			Develop sample implementation.			*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    60
/*									*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    61
/************************************************************************/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    62
#ifndef ACCESSX_LIBINT_H
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    63
#define ACCESSX_LIBINT_H
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    64
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    65
#include "AccessXlib.h"
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    66
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    67
/* ExtGetReq
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    68
 *
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    69
 *   Very similar to GetReq in Xlibint.h, but sets the major and minor 
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    70
 *   opcodes the way an extension would do it.
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    71
 */
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    72
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    73
/*
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    74
#if __STDC__  && !defined(UNIXCPP)
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    75
*/
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    76
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    77
#define ExtGetReq(opcode, name, req) \
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    78
        WORD64ALIGN\
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    79
        if ((dpy->bufptr + SIZEOF(x##name##Req)) > dpy->bufmax)\
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    80
                _XFlush(dpy);\
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    81
        req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    82
        req->majorOpcode = opcode;\
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    83
        req->minorOpcode = X_##name;\
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    84
        req->length = (SIZEOF(x##name##Req))>>2;\
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    85
        dpy->bufptr += SIZEOF(x##name##Req);\
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    86
        dpy->request++
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    87
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    88
#if 0
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    89
/* #else */
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    90
/* non-ANSI C uses empty comment instead of "##" for token concatenation 
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    91
 */
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    92
#define ExtGetReq(opcode, name, req) \
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    93
        WORD64ALIGN\
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    94
        if ((dpy->bufptr + SIZEOF(x/**/name/**/Req)) > dpy->bufmax)\
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    95
                _XFlush(dpy);\
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    96
        req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    97
        req->majorOpcode = opcode;\
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    98
        req->minorOpcode = X_/**/name;\
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    99
        req->length = (SIZEOF(x/**/name/**/Req))>>2;\
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
   100
        dpy->bufptr += SIZEOF(x/**/name/**/Req);\
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
   101
        dpy->request++
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
   102
#endif
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
   103
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
   104
/* The following definitions can be used for locking requests in multi-threaded
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
   105
 * address spaces.
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
   106
 */
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
   107
#define LockDisplay(dis)
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
   108
#define UnlockDisplay(dis)
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
   109
8dab74c91c43 6740745 moving accessx to open-src and /usr/X11
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
   110
#endif /* ACCESSX_LIBINT_H */