| 1 | /*********************************************************** |
| 2 | |
| 3 | Copyright 1987, 1998 The Open Group |
| 4 | |
| 5 | Permission to use, copy, modify, distribute, and sell this software and its |
| 6 | documentation for any purpose is hereby granted without fee, provided that |
| 7 | the above copyright notice appear in all copies and that both that |
| 8 | copyright notice and this permission notice appear in supporting |
| 9 | documentation. |
| 10 | |
| 11 | The above copyright notice and this permission notice shall be included in |
| 12 | all copies or substantial portions of the Software. |
| 13 | |
| 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 17 | OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
| 18 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 19 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 20 | |
| 21 | Except as contained in this notice, the name of The Open Group shall not be |
| 22 | used in advertising or otherwise to promote the sale, use or other dealings |
| 23 | in this Software without prior written authorization from The Open Group. |
| 24 | |
| 25 | Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. |
| 26 | |
| 27 | All Rights Reserved |
| 28 | |
| 29 | Permission to use, copy, modify, and distribute this software and its |
| 30 | documentation for any purpose and without fee is hereby granted, |
| 31 | provided that the above copyright notice appear in all copies and that |
| 32 | both that copyright notice and this permission notice appear in |
| 33 | supporting documentation, and that the name of Digital not be |
| 34 | used in advertising or publicity pertaining to distribution of the |
| 35 | software without specific, written prior permission. |
| 36 | |
| 37 | DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING |
| 38 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL |
| 39 | DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR |
| 40 | ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, |
| 41 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, |
| 42 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS |
| 43 | SOFTWARE. |
| 44 | |
| 45 | ******************************************************************/ |
| 46 | |
| 47 | #ifndef GC_H |
| 48 | #define GC_H |
| 49 | |
| 50 | #include <X11/X.h> /* for GContext, Mask */ |
| 51 | #include <X11/Xdefs.h> /* for Bool */ |
| 52 | #include <X11/Xproto.h> |
| 53 | #include "screenint.h" /* for ScreenPtr */ |
| 54 | #include "pixmap.h" /* for DrawablePtr */ |
| 55 | |
| 56 | /* clientClipType field in GC */ |
| 57 | #define CT_NONE 0 |
| 58 | #define CT_PIXMAP 1 |
| 59 | #define CT_REGION 2 |
| 60 | #define CT_UNSORTED 6 |
| 61 | #define CT_YSORTED 10 |
| 62 | #define CT_YXSORTED 14 |
| 63 | #define CT_YXBANDED 18 |
| 64 | |
| 65 | #define GCQREASON_VALIDATE 1 |
| 66 | #define GCQREASON_CHANGE 2 |
| 67 | #define GCQREASON_COPY_SRC 3 |
| 68 | #define GCQREASON_COPY_DST 4 |
| 69 | #define GCQREASON_DESTROY 5 |
| 70 | |
| 71 | #define GC_CHANGE_SERIAL_BIT (((unsigned long)1)<<31) |
| 72 | #define GC_CALL_VALIDATE_BIT (1L<<30) |
| 73 | #define GCExtensionInterest (1L<<29) |
| 74 | |
| 75 | #define DRAWABLE_SERIAL_BITS (~(GC_CHANGE_SERIAL_BIT)) |
| 76 | |
| 77 | #define MAX_SERIAL_NUM (1L<<28) |
| 78 | |
| 79 | #define NEXT_SERIAL_NUMBER ((++globalSerialNumber) > MAX_SERIAL_NUM ? \ |
| 80 | (globalSerialNumber = 1): globalSerialNumber) |
| 81 | |
| 82 | typedef struct _GCInterest *GCInterestPtr; |
| 83 | typedef struct _GC *GCPtr; |
| 84 | typedef struct _GCOps *GCOpsPtr; |
| 85 | |
| 86 | extern _X_EXPORT void ValidateGC(DrawablePtr /*pDraw */ , |
| 87 | GCPtr /*pGC */ ); |
| 88 | |
| 89 | typedef union { |
| 90 | CARD32 val; |
| 91 | pointer ptr; |
| 92 | } ChangeGCVal, *ChangeGCValPtr; |
| 93 | |
| 94 | extern int ChangeGCXIDs(ClientPtr /*client */ , |
| 95 | GCPtr /*pGC */ , |
| 96 | BITS32 /*mask */ , |
| 97 | CARD32 * /*pval */ ); |
| 98 | |
| 99 | extern _X_EXPORT int ChangeGC(ClientPtr /*client */ , |
| 100 | GCPtr /*pGC */ , |
| 101 | BITS32 /*mask */ , |
| 102 | ChangeGCValPtr /*pCGCV */ ); |
| 103 | |
| 104 | extern _X_EXPORT GCPtr CreateGC(DrawablePtr /*pDrawable */ , |
| 105 | BITS32 /*mask */ , |
| 106 | XID * /*pval */ , |
| 107 | int * /*pStatus */ , |
| 108 | XID /*gcid */ , |
| 109 | ClientPtr /*client */ ); |
| 110 | |
| 111 | extern _X_EXPORT int CopyGC(GCPtr /*pgcSrc */ , |
| 112 | GCPtr /*pgcDst */ , |
| 113 | BITS32 /*mask */ ); |
| 114 | |
| 115 | extern _X_EXPORT int FreeGC(pointer /*pGC */ , |
| 116 | XID /*gid */ ); |
| 117 | |
| 118 | extern _X_EXPORT void FreeGCperDepth(int /*screenNum */ ); |
| 119 | |
| 120 | extern _X_EXPORT Bool CreateGCperDepth(int /*screenNum */ ); |
| 121 | |
| 122 | extern _X_EXPORT Bool CreateDefaultStipple(int /*screenNum */ ); |
| 123 | |
| 124 | extern _X_EXPORT void FreeDefaultStipple(int /*screenNum */ ); |
| 125 | |
| 126 | extern _X_EXPORT int SetDashes(GCPtr /*pGC */ , |
| 127 | unsigned /*offset */ , |
| 128 | unsigned /*ndash */ , |
| 129 | unsigned char * /*pdash */ ); |
| 130 | |
| 131 | extern _X_EXPORT int VerifyRectOrder(int /*nrects */ , |
| 132 | xRectangle * /*prects */ , |
| 133 | int /*ordering */ ); |
| 134 | |
| 135 | extern _X_EXPORT int SetClipRects(GCPtr /*pGC */ , |
| 136 | int /*xOrigin */ , |
| 137 | int /*yOrigin */ , |
| 138 | int /*nrects */ , |
| 139 | xRectangle * /*prects */ , |
| 140 | int /*ordering */ ); |
| 141 | |
| 142 | extern _X_EXPORT GCPtr GetScratchGC(unsigned /*depth */ , |
| 143 | ScreenPtr /*pScreen */ ); |
| 144 | |
| 145 | extern _X_EXPORT void FreeScratchGC(GCPtr /*pGC */ ); |
| 146 | |
| 147 | #endif /* GC_H */ |