| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/drivers/GL/xmesa_xf86.h
Go to the documentation of this file.

    00001
    00002 /**************************************************************************
    00003
    00004 Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
    00005 All Rights Reserved.
    00006
    00007 Permission is hereby granted, free of charge, to any person obtaining a
    00008 copy of this software and associated documentation files (the
    00009 "Software"), to deal in the Software without restriction, including
    00010 without limitation the rights to use, copy, modify, merge, publish,
    00011 distribute, sub license, and/or sell copies of the Software, and to
    00012 permit persons to whom the Software is furnished to do so, subject to
    00013 the following conditions:
    00014
    00015 The above copyright notice and this permission notice (including the
    00016 next paragraph) shall be included in all copies or substantial portions
    00017 of the Software.
    00018
    00019 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
    00020 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    00021 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
    00022 IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
    00023 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
    00024 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
    00025 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    00026
    00027 **************************************************************************/
    00028
    00029 /*
    00030  * Authors:
    00031  *   Kevin E. Martin <kevin@precisioninsight.com>
    00032  *
    00033  * When we're building the XMesa driver for use in the X server (as the
    00034  * indirect render) we include this file when building the xm_*.c files.
    00035  * We need to define some types and macros differently when building
    00036  * in the Xserver vs. stand-alone Mesa.
    00037  */
    00038
    00039 #ifndef _XMESA_XF86_H_
    00040 #define _XMESA_XF86_H_
    00041
    00042 #include "scrnintstr.h"
    00043 #include "pixmapstr.h"
    00044
    00045 typedef struct _XMesaImageRec XMesaImage;
    00046
    00047 typedef ScreenRec   XMesaDisplay;
    00048 typedef PixmapPtr   XMesaPixmap;
    00049 typedef ColormapPtr XMesaColormap;
    00050 typedef DrawablePtr XMesaDrawable;
    00051 typedef WindowPtr   XMesaWindow;
    00052 typedef GCPtr       XMesaGC;
    00053 typedef VisualPtr   XMesaVisualInfo;
    00054 typedef DDXPointRec XMesaPoint;
    00055 typedef xColorItem  XMesaColor;
    00056
    00057 #define XMesaSetGeneric(__d,__gc,__val,__mask) \
    00058 do { \
    00059     CARD32 __v[1]; \
    00060     (void) __d; \
    00061     __v[0] = __val; \
    00062     dixChangeGC(NullClient, __gc, __mask, __v, NULL); \
    00063 } while (0)
    00064
    00065 #define XMesaSetGenericPtr(__d,__gc,__pval,__mask) \
    00066 do { \
    00067     ChangeGCVal __v[1]; \
    00068     (void) __d; \
    00069     __v[0].ptr = __pval; \
    00070     dixChangeGC(NullClient, __gc, __mask, NULL, __v); \
    00071 } while (0)
    00072
    00073 #define XMesaSetForeground(d,gc,v) XMesaSetGeneric(d,gc,v,GCForeground)
    00074 #define XMesaSetBackground(d,gc,v) XMesaSetGeneric(d,gc,v,GCBackground)
    00075 #define XMesaSetPlaneMask(d,gc,v)  XMesaSetGeneric(d,gc,v,GCPlaneMask)
    00076 #define XMesaSetFunction(d,gc,v)   XMesaSetGeneric(d,gc,v,GCFunction)
    00077 #define XMesaSetFillStyle(d,gc,v)  XMesaSetGeneric(d,gc,v,GCFillStyle)
    00078
    00079 #define XMesaSetTile(d,gc,v)       XMesaSetGenericPtr(d,gc,v,GCTile)
    00080
    00081 #define XMesaDrawPoint(__d,__b,__gc,__x,__y) \
    00082 do { \
    00083     XMesaPoint __p[1]; \
    00084     (void) __d; \
    00085     __p[0].x = __x; \
    00086     __p[0].y = __y; \
    00087     ValidateGC(__b, __gc); \
    00088     (*gc->ops->PolyPoint)(__b, __gc, CoordModeOrigin, 1, __p); \
    00089 } while (0)
    00090
    00091 #define XMesaDrawPoints(__d,__b,__gc,__p,__n,__m) \
    00092 do { \
    00093     (void) __d; \
    00094     ValidateGC(__b, __gc); \
    00095     (*gc->ops->PolyPoint)(__b, __gc, __m, __n, __p); \
    00096 } while (0)
    00097
    00098 #define XMesaDrawLine(__d, __b, __gc, __x0, __y0, __x1, __y1) \
    00099 do { \
    00100     XMesaPoint __p[2]; \
    00101     (void) __d; \
    00102     __p[0].x = __x0; \
    00103     __p[0].y = __y0; \
    00104     __p[1].x = __x1; \
    00105     __p[1].y = __y1; \
    00106     ValidateGC(__b, __gc); \
    00107     (*gc->ops->PolyLines)(__b, __gc, CoordModeOrigin, 2, __p); \
    00108 } while (0)
    00109
    00110 #define XMesaFillRectangle(__d,__b,__gc,__x,__y,__w,__h) \
    00111 do { \
    00112     xRectangle __r[1]; \
    00113     (void) __d; \
    00114     ValidateGC((DrawablePtr)__b, __gc); \
    00115     __r[0].x = __x; \
    00116     __r[0].y = __y; \
    00117     __r[0].width = __w; \
    00118     __r[0].height = __h; \
    00119     (*__gc->ops->PolyFillRect)((DrawablePtr)__b, __gc, 1, __r); \
    00120 } while (0)
    00121
    00122 #define XMesaPutImage(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h) \
    00123 do { \
    00124     /* Assumes: Images are always in ZPixmap format */ \
    00125     (void) __d; \
    00126     if (__sx || __sy) /* The non-trivial case */ \
    00127            XMesaPutImageHelper(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h); \
    00128     ValidateGC(__b, __gc); \
    00129     (*__gc->ops->PutImage)(__b, __gc, ((XMesaDrawable)(__b))->depth, \
    00130                                     __x, __y, __w, __h, 0, ZPixmap, \
    00131                                     ((XMesaImage *)(__i))->data); \
    00132 } while (0)
    00133
    00134 #define XMesaCopyArea(__d,__sb,__db,__gc,__sx,__sy,__w,__h,__x,__y) \
    00135 do { \
    00136     (void) __d; \
    00137     ValidateGC(__db, __gc); \
    00138     (*__gc->ops->CopyArea)((DrawablePtr)__sb, __db, __gc, \
    00139                                     __sx, __sy, __w, __h, __x, __y); \
    00140 } while (0)
    00141
    00142
    00143 /* CreatePixmap returns a PixmapPtr; so, it cannot be inside braces */
    00144 #define XMesaCreatePixmap(__d,__b,__w,__h,__depth) \
    00145     (*__d->CreatePixmap)(__d, __w, __h, __depth)
    00146
    00147 #define XMesaFreePixmap(__d,__b) \
    00148     (*__d->DestroyPixmap)(__b)
    00149
    00150 #define XMesaFreeGC(__d,__gc) \
    00151 do { \
    00152     (void) __d; \
    00153     FreeScratchGC(__gc); \
    00154 } while (0)
    00155
    00156 #define GET_COLORMAP_SIZE(__v)  __v->ColormapEntries
    00157 #define GET_REDMASK(__v)        __v->mesa_visual.redMask
    00158 #define GET_GREENMASK(__v)      __v->mesa_visual.greenMask
    00159 #define GET_BLUEMASK(__v)       __v->mesa_visual.blueMask
    00160 #define GET_VISUAL_DEPTH(__v)   __v->nplanes
    00161 #define GET_BLACK_PIXEL(__v)    __v->display->blackPixel
    00162 #define CHECK_BYTE_ORDER(__v)   GL_TRUE
    00163 #define CHECK_FOR_HPCR(__v)     GL_FALSE
    00164
    00165 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines