Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

layerutil.h File Reference

#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xmd.h>

Go to the source code of this file.


Data Structures

struct  _OverlayInfo
struct  _XLayerVisualInfo

Defines

#define TransparentPixel   1
#define TransparentMask   2
#define VisualLayerMask   0x200
#define VisualTransparentType   0x400
#define VisualTransparentValue   0x800
#define VisualAllLayerMask   0xFFF

Typedefs

typedef _XLayerVisualInfo XLayerVisualInfo
typedef _OverlayInfo OverlayInfo

Functions

int __glutGetTransparentPixel (Display *, XVisualInfo *)
XLayerVisualInfo__glutXGetLayerVisualInfo (Display *, long, XLayerVisualInfo *, int *)
Status __glutXMatchLayerVisualInfo (Display *, int, int, int, int, XLayerVisualInfo *)

Define Documentation

#define TransparentMask   2
 

Definition at line 19 of file layerutil.h.

#define TransparentPixel   1
 

Definition at line 18 of file layerutil.h.

Referenced by __glutGetTransparentPixel(), and getOverlayVisualInfoCI().

#define VisualAllLayerMask   0xFFF
 

Definition at line 25 of file layerutil.h.

#define VisualLayerMask   0x200
 

Definition at line 22 of file layerutil.h.

Referenced by __glutXGetLayerVisualInfo(), getOverlayVisualInfoCI(), and menuVisualSetup().

#define VisualTransparentType   0x400
 

Definition at line 23 of file layerutil.h.

Referenced by __glutXGetLayerVisualInfo(), and getOverlayVisualInfoCI().

#define VisualTransparentValue   0x800
 

Definition at line 24 of file layerutil.h.

Referenced by __glutXGetLayerVisualInfo().


Typedef Documentation

typedef struct _OverlayInfo OverlayInfo
 

typedef struct _XLayerVisualInfo XLayerVisualInfo
 


Function Documentation

int __glutGetTransparentPixel Display *   ,
XVisualInfo *   
 

Definition at line 67 of file layerutil.c.

References dpy, findServerOverlayVisualsInfo(), i, numOverlaysPerScreen, _OverlayInfo::overlay_visual, _OverlayInfo::transparent_type, TransparentPixel, and _OverlayInfo::value.

Referenced by associateNewColormap(), and glutEstablishOverlay().

00068 {
00069   int i, screen = vinfo->screen;
00070   OverlayInfo *overlayInfo;
00071 
00072   findServerOverlayVisualsInfo(dpy);
00073   if (layersRead) {
00074     for (i = 0; i < numOverlaysPerScreen[screen]; i++) {
00075       overlayInfo = &overlayInfoPerScreen[screen][i];
00076       if (vinfo->visualid == overlayInfo->overlay_visual) {
00077         if (overlayInfo->transparent_type == TransparentPixel) {
00078           return (int) overlayInfo->value;
00079         } else {
00080           return -1;
00081         }
00082       }
00083     }
00084   }
00085   return -1;
00086 }

XLayerVisualInfo* __glutXGetLayerVisualInfo Display *   ,
long   ,
XLayerVisualInfo  ,
int *   
 

Definition at line 89 of file layerutil.c.

References dpy, findServerOverlayVisualsInfo(), i, _OverlayInfo::layer, _XLayerVisualInfo::layer, malloc, numOverlaysPerScreen, _OverlayInfo::overlay_visual, _OverlayInfo::transparent_type, _XLayerVisualInfo::type, _OverlayInfo::value, _XLayerVisualInfo::value, _XLayerVisualInfo::vinfo, VisualLayerMask, VisualTransparentType, and VisualTransparentValue.

Referenced by getOverlayVisualInfoCI(), and menuVisualSetup().

00091 {
00092   XVisualInfo *vinfo;
00093   XLayerVisualInfo *layerInfo;
00094   int numVisuals, count, i, j;
00095 
00096   vinfo = XGetVisualInfo(dpy, lvinfo_mask & VisualAllMask,
00097     &lvinfo_template->vinfo, nitems_return);
00098   if (vinfo == NULL)
00099     return NULL;
00100   numVisuals = *nitems_return;
00101   findServerOverlayVisualsInfo(dpy);
00102   layerInfo = (XLayerVisualInfo *)
00103     malloc(numVisuals * sizeof(XLayerVisualInfo));
00104   if (layerInfo == NULL) {
00105     XFree(vinfo);
00106     return NULL;
00107   }
00108   count = 0;
00109   for (i = 0; i < numVisuals; i++) {
00110     XVisualInfo *pVinfo = &vinfo[i];
00111     int screen = pVinfo->screen;
00112     OverlayInfo *overlayInfo = NULL;
00113 
00114     overlayInfo = NULL;
00115     if (layersRead) {
00116       for (j = 0; j < numOverlaysPerScreen[screen]; j++)
00117         if (pVinfo->visualid ==
00118           overlayInfoPerScreen[screen][j].overlay_visual) {
00119           overlayInfo = &overlayInfoPerScreen[screen][j];
00120           break;
00121         }
00122     }
00123     if (lvinfo_mask & VisualLayerMask)
00124       if (overlayInfo == NULL) {
00125         if (lvinfo_template->layer != 0)
00126           continue;
00127       } else if (lvinfo_template->layer != overlayInfo->layer)
00128         continue;
00129     if (lvinfo_mask & VisualTransparentType)
00130       if (overlayInfo == NULL) {
00131         if (lvinfo_template->type != None)
00132           continue;
00133       } else if (lvinfo_template->type !=
00134         overlayInfo->transparent_type)
00135         continue;
00136     if (lvinfo_mask & VisualTransparentValue)
00137       if (overlayInfo == NULL)
00138         /* non-overlay visuals have no sense of
00139            TransparentValue */
00140         continue;
00141       else if (lvinfo_template->value != overlayInfo->value)
00142         continue;
00143     layerInfo[count].vinfo = *pVinfo;
00144     if (overlayInfo == NULL) {
00145       layerInfo[count].layer = 0;
00146       layerInfo[count].type = None;
00147       layerInfo[count].value = 0;  /* meaningless */
00148     } else {
00149       layerInfo[count].layer = overlayInfo->layer;
00150       layerInfo[count].type = overlayInfo->transparent_type;
00151       layerInfo[count].value = overlayInfo->value;
00152     }
00153     count++;
00154   }
00155   XFree(vinfo);
00156   *nitems_return = count;
00157   if (count == 0) {
00158     XFree(layerInfo);
00159     return NULL;
00160   } else
00161     return layerInfo;
00162 }

Status __glutXMatchLayerVisualInfo Display *   ,
int   ,
int   ,
int   ,
int   ,
XLayerVisualInfo  
 

 

Powered by Plone

This site conforms to the following standards: