Initial revision

This commit is contained in:
Kaleb Keithley 2003-11-14 16:48:57 +00:00
parent ded6147bfb
commit 9508a382f8
982 changed files with 479777 additions and 0 deletions

793
GL/glx/g_disptab.c Normal file
View File

@ -0,0 +1,793 @@
/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab.c,v 1.3 2001/03/21 16:29:35 dawes Exp $ */
/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: This software was created using the
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
** not been independently verified as being compliant with the OpenGL(R)
** version 1.2.1 Specification.
*/
#include "glxserver.h"
#include "glxext.h"
#include "g_disptab.h"
__GLXdispatchSingleProcPtr __glXSingleTable[] = {
__glXNoSuchSingleOpcode,
__glXRender,
__glXRenderLarge,
__glXCreateContext,
__glXDestroyContext,
__glXMakeCurrent,
__glXIsDirect,
__glXQueryVersion,
__glXWaitGL,
__glXWaitX,
__glXCopyContext,
__glXSwapBuffers,
__glXUseXFont,
__glXCreateGLXPixmap,
__glXGetVisualConfigs,
__glXDestroyGLXPixmap,
__glXVendorPrivate,
__glXVendorPrivateWithReply,
__glXQueryExtensionsString,
__glXQueryServerString,
__glXClientInfo,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXDisp_NewList,
__glXDisp_EndList,
__glXDisp_DeleteLists,
__glXDisp_GenLists,
__glXDisp_FeedbackBuffer,
__glXDisp_SelectBuffer,
__glXDisp_RenderMode,
__glXDisp_Finish,
__glXDisp_PixelStoref,
__glXDisp_PixelStorei,
__glXDisp_ReadPixels,
__glXDisp_GetBooleanv,
__glXDisp_GetClipPlane,
__glXDisp_GetDoublev,
__glXDisp_GetError,
__glXDisp_GetFloatv,
__glXDisp_GetIntegerv,
__glXDisp_GetLightfv,
__glXDisp_GetLightiv,
__glXDisp_GetMapdv,
__glXDisp_GetMapfv,
__glXDisp_GetMapiv,
__glXDisp_GetMaterialfv,
__glXDisp_GetMaterialiv,
__glXDisp_GetPixelMapfv,
__glXDisp_GetPixelMapuiv,
__glXDisp_GetPixelMapusv,
__glXDisp_GetPolygonStipple,
__glXDisp_GetString,
__glXDisp_GetTexEnvfv,
__glXDisp_GetTexEnviv,
__glXDisp_GetTexGendv,
__glXDisp_GetTexGenfv,
__glXDisp_GetTexGeniv,
__glXDisp_GetTexImage,
__glXDisp_GetTexParameterfv,
__glXDisp_GetTexParameteriv,
__glXDisp_GetTexLevelParameterfv,
__glXDisp_GetTexLevelParameteriv,
__glXDisp_IsEnabled,
__glXDisp_IsList,
__glXDisp_Flush,
__glXDisp_AreTexturesResident,
__glXDisp_DeleteTextures,
__glXDisp_GenTextures,
__glXDisp_IsTexture,
__glXDisp_GetColorTable,
__glXDisp_GetColorTableParameterfv,
__glXDisp_GetColorTableParameteriv,
__glXDisp_GetConvolutionFilter,
__glXDisp_GetConvolutionParameterfv,
__glXDisp_GetConvolutionParameteriv,
__glXDisp_GetSeparableFilter,
__glXDisp_GetHistogram,
__glXDisp_GetHistogramParameterfv,
__glXDisp_GetHistogramParameteriv,
__glXDisp_GetMinmax,
__glXDisp_GetMinmaxParameterfv,
__glXDisp_GetMinmaxParameteriv,
};
__GLXdispatchRenderProcPtr __glXRenderTable[] = {
__glXNoSuchRenderOpcode,
__glXDisp_CallList,
__glXDisp_CallLists,
__glXDisp_ListBase,
__glXDisp_Begin,
__glXDisp_Bitmap,
__glXDisp_Color3bv,
__glXDisp_Color3dv,
__glXDisp_Color3fv,
__glXDisp_Color3iv,
__glXDisp_Color3sv,
__glXDisp_Color3ubv,
__glXDisp_Color3uiv,
__glXDisp_Color3usv,
__glXDisp_Color4bv,
__glXDisp_Color4dv,
__glXDisp_Color4fv,
__glXDisp_Color4iv,
__glXDisp_Color4sv,
__glXDisp_Color4ubv,
__glXDisp_Color4uiv,
__glXDisp_Color4usv,
__glXDisp_EdgeFlagv,
__glXDisp_End,
__glXDisp_Indexdv,
__glXDisp_Indexfv,
__glXDisp_Indexiv,
__glXDisp_Indexsv,
__glXDisp_Normal3bv,
__glXDisp_Normal3dv,
__glXDisp_Normal3fv,
__glXDisp_Normal3iv,
__glXDisp_Normal3sv,
__glXDisp_RasterPos2dv,
__glXDisp_RasterPos2fv,
__glXDisp_RasterPos2iv,
__glXDisp_RasterPos2sv,
__glXDisp_RasterPos3dv,
__glXDisp_RasterPos3fv,
__glXDisp_RasterPos3iv,
__glXDisp_RasterPos3sv,
__glXDisp_RasterPos4dv,
__glXDisp_RasterPos4fv,
__glXDisp_RasterPos4iv,
__glXDisp_RasterPos4sv,
__glXDisp_Rectdv,
__glXDisp_Rectfv,
__glXDisp_Rectiv,
__glXDisp_Rectsv,
__glXDisp_TexCoord1dv,
__glXDisp_TexCoord1fv,
__glXDisp_TexCoord1iv,
__glXDisp_TexCoord1sv,
__glXDisp_TexCoord2dv,
__glXDisp_TexCoord2fv,
__glXDisp_TexCoord2iv,
__glXDisp_TexCoord2sv,
__glXDisp_TexCoord3dv,
__glXDisp_TexCoord3fv,
__glXDisp_TexCoord3iv,
__glXDisp_TexCoord3sv,
__glXDisp_TexCoord4dv,
__glXDisp_TexCoord4fv,
__glXDisp_TexCoord4iv,
__glXDisp_TexCoord4sv,
__glXDisp_Vertex2dv,
__glXDisp_Vertex2fv,
__glXDisp_Vertex2iv,
__glXDisp_Vertex2sv,
__glXDisp_Vertex3dv,
__glXDisp_Vertex3fv,
__glXDisp_Vertex3iv,
__glXDisp_Vertex3sv,
__glXDisp_Vertex4dv,
__glXDisp_Vertex4fv,
__glXDisp_Vertex4iv,
__glXDisp_Vertex4sv,
__glXDisp_ClipPlane,
__glXDisp_ColorMaterial,
__glXDisp_CullFace,
__glXDisp_Fogf,
__glXDisp_Fogfv,
__glXDisp_Fogi,
__glXDisp_Fogiv,
__glXDisp_FrontFace,
__glXDisp_Hint,
__glXDisp_Lightf,
__glXDisp_Lightfv,
__glXDisp_Lighti,
__glXDisp_Lightiv,
__glXDisp_LightModelf,
__glXDisp_LightModelfv,
__glXDisp_LightModeli,
__glXDisp_LightModeliv,
__glXDisp_LineStipple,
__glXDisp_LineWidth,
__glXDisp_Materialf,
__glXDisp_Materialfv,
__glXDisp_Materiali,
__glXDisp_Materialiv,
__glXDisp_PointSize,
__glXDisp_PolygonMode,
__glXDisp_PolygonStipple,
__glXDisp_Scissor,
__glXDisp_ShadeModel,
__glXDisp_TexParameterf,
__glXDisp_TexParameterfv,
__glXDisp_TexParameteri,
__glXDisp_TexParameteriv,
__glXDisp_TexImage1D,
__glXDisp_TexImage2D,
__glXDisp_TexEnvf,
__glXDisp_TexEnvfv,
__glXDisp_TexEnvi,
__glXDisp_TexEnviv,
__glXDisp_TexGend,
__glXDisp_TexGendv,
__glXDisp_TexGenf,
__glXDisp_TexGenfv,
__glXDisp_TexGeni,
__glXDisp_TexGeniv,
__glXDisp_InitNames,
__glXDisp_LoadName,
__glXDisp_PassThrough,
__glXDisp_PopName,
__glXDisp_PushName,
__glXDisp_DrawBuffer,
__glXDisp_Clear,
__glXDisp_ClearAccum,
__glXDisp_ClearIndex,
__glXDisp_ClearColor,
__glXDisp_ClearStencil,
__glXDisp_ClearDepth,
__glXDisp_StencilMask,
__glXDisp_ColorMask,
__glXDisp_DepthMask,
__glXDisp_IndexMask,
__glXDisp_Accum,
__glXDisp_Disable,
__glXDisp_Enable,
__glXNoSuchRenderOpcode,
__glXDisp_PopAttrib,
__glXDisp_PushAttrib,
__glXDisp_Map1d,
__glXDisp_Map1f,
__glXDisp_Map2d,
__glXDisp_Map2f,
__glXDisp_MapGrid1d,
__glXDisp_MapGrid1f,
__glXDisp_MapGrid2d,
__glXDisp_MapGrid2f,
__glXDisp_EvalCoord1dv,
__glXDisp_EvalCoord1fv,
__glXDisp_EvalCoord2dv,
__glXDisp_EvalCoord2fv,
__glXDisp_EvalMesh1,
__glXDisp_EvalPoint1,
__glXDisp_EvalMesh2,
__glXDisp_EvalPoint2,
__glXDisp_AlphaFunc,
__glXDisp_BlendFunc,
__glXDisp_LogicOp,
__glXDisp_StencilFunc,
__glXDisp_StencilOp,
__glXDisp_DepthFunc,
__glXDisp_PixelZoom,
__glXDisp_PixelTransferf,
__glXDisp_PixelTransferi,
__glXDisp_PixelMapfv,
__glXDisp_PixelMapuiv,
__glXDisp_PixelMapusv,
__glXDisp_ReadBuffer,
__glXDisp_CopyPixels,
__glXDisp_DrawPixels,
__glXDisp_DepthRange,
__glXDisp_Frustum,
__glXDisp_LoadIdentity,
__glXDisp_LoadMatrixf,
__glXDisp_LoadMatrixd,
__glXDisp_MatrixMode,
__glXDisp_MultMatrixf,
__glXDisp_MultMatrixd,
__glXDisp_Ortho,
__glXDisp_PopMatrix,
__glXDisp_PushMatrix,
__glXDisp_Rotated,
__glXDisp_Rotatef,
__glXDisp_Scaled,
__glXDisp_Scalef,
__glXDisp_Translated,
__glXDisp_Translatef,
__glXDisp_Viewport,
__glXDisp_PolygonOffset,
__glXDisp_DrawArrays,
__glXDisp_Indexubv,
__glXDisp_ColorSubTable,
__glXDisp_CopyColorSubTable,
__glXDisp_ActiveTextureARB,
__glXDisp_MultiTexCoord1dvARB,
__glXDisp_MultiTexCoord1fvARB,
__glXDisp_MultiTexCoord1ivARB,
__glXDisp_MultiTexCoord1svARB,
__glXDisp_MultiTexCoord2dvARB,
__glXDisp_MultiTexCoord2fvARB,
__glXDisp_MultiTexCoord2ivARB,
__glXDisp_MultiTexCoord2svARB,
__glXDisp_MultiTexCoord3dvARB,
__glXDisp_MultiTexCoord3fvARB,
__glXDisp_MultiTexCoord3ivARB,
__glXDisp_MultiTexCoord3svARB,
__glXDisp_MultiTexCoord4dvARB,
__glXDisp_MultiTexCoord4fvARB,
__glXDisp_MultiTexCoord4ivARB,
__glXDisp_MultiTexCoord4svARB,
};
__GLXdispatchSingleProcPtr __glXSwapSingleTable[] = {
__glXNoSuchSingleOpcode,
__glXSwapRender,
__glXSwapRenderLarge,
__glXSwapCreateContext,
__glXSwapDestroyContext,
__glXSwapMakeCurrent,
__glXSwapIsDirect,
__glXSwapQueryVersion,
__glXSwapWaitGL,
__glXSwapWaitX,
__glXSwapCopyContext,
__glXSwapSwapBuffers,
__glXSwapUseXFont,
__glXSwapCreateGLXPixmap,
__glXSwapGetVisualConfigs,
__glXSwapDestroyGLXPixmap,
__glXSwapVendorPrivate,
__glXSwapVendorPrivateWithReply,
__glXSwapQueryExtensionsString,
__glXSwapQueryServerString,
__glXSwapClientInfo,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXDispSwap_NewList,
__glXDispSwap_EndList,
__glXDispSwap_DeleteLists,
__glXDispSwap_GenLists,
__glXDispSwap_FeedbackBuffer,
__glXDispSwap_SelectBuffer,
__glXDispSwap_RenderMode,
__glXDispSwap_Finish,
__glXDispSwap_PixelStoref,
__glXDispSwap_PixelStorei,
__glXDispSwap_ReadPixels,
__glXDispSwap_GetBooleanv,
__glXDispSwap_GetClipPlane,
__glXDispSwap_GetDoublev,
__glXDispSwap_GetError,
__glXDispSwap_GetFloatv,
__glXDispSwap_GetIntegerv,
__glXDispSwap_GetLightfv,
__glXDispSwap_GetLightiv,
__glXDispSwap_GetMapdv,
__glXDispSwap_GetMapfv,
__glXDispSwap_GetMapiv,
__glXDispSwap_GetMaterialfv,
__glXDispSwap_GetMaterialiv,
__glXDispSwap_GetPixelMapfv,
__glXDispSwap_GetPixelMapuiv,
__glXDispSwap_GetPixelMapusv,
__glXDispSwap_GetPolygonStipple,
__glXDispSwap_GetString,
__glXDispSwap_GetTexEnvfv,
__glXDispSwap_GetTexEnviv,
__glXDispSwap_GetTexGendv,
__glXDispSwap_GetTexGenfv,
__glXDispSwap_GetTexGeniv,
__glXDispSwap_GetTexImage,
__glXDispSwap_GetTexParameterfv,
__glXDispSwap_GetTexParameteriv,
__glXDispSwap_GetTexLevelParameterfv,
__glXDispSwap_GetTexLevelParameteriv,
__glXDispSwap_IsEnabled,
__glXDispSwap_IsList,
__glXDispSwap_Flush,
__glXDispSwap_AreTexturesResident,
__glXDispSwap_DeleteTextures,
__glXDispSwap_GenTextures,
__glXDispSwap_IsTexture,
__glXDispSwap_GetColorTable,
__glXDispSwap_GetColorTableParameterfv,
__glXDispSwap_GetColorTableParameteriv,
__glXDispSwap_GetConvolutionFilter,
__glXDispSwap_GetConvolutionParameterfv,
__glXDispSwap_GetConvolutionParameteriv,
__glXDispSwap_GetSeparableFilter,
__glXDispSwap_GetHistogram,
__glXDispSwap_GetHistogramParameterfv,
__glXDispSwap_GetHistogramParameteriv,
__glXDispSwap_GetMinmax,
__glXDispSwap_GetMinmaxParameterfv,
__glXDispSwap_GetMinmaxParameteriv,
};
__GLXdispatchRenderProcPtr __glXSwapRenderTable[] = {
__glXNoSuchRenderOpcode,
__glXDispSwap_CallList,
__glXDispSwap_CallLists,
__glXDispSwap_ListBase,
__glXDispSwap_Begin,
__glXDispSwap_Bitmap,
__glXDispSwap_Color3bv,
__glXDispSwap_Color3dv,
__glXDispSwap_Color3fv,
__glXDispSwap_Color3iv,
__glXDispSwap_Color3sv,
__glXDispSwap_Color3ubv,
__glXDispSwap_Color3uiv,
__glXDispSwap_Color3usv,
__glXDispSwap_Color4bv,
__glXDispSwap_Color4dv,
__glXDispSwap_Color4fv,
__glXDispSwap_Color4iv,
__glXDispSwap_Color4sv,
__glXDispSwap_Color4ubv,
__glXDispSwap_Color4uiv,
__glXDispSwap_Color4usv,
__glXDispSwap_EdgeFlagv,
__glXDispSwap_End,
__glXDispSwap_Indexdv,
__glXDispSwap_Indexfv,
__glXDispSwap_Indexiv,
__glXDispSwap_Indexsv,
__glXDispSwap_Normal3bv,
__glXDispSwap_Normal3dv,
__glXDispSwap_Normal3fv,
__glXDispSwap_Normal3iv,
__glXDispSwap_Normal3sv,
__glXDispSwap_RasterPos2dv,
__glXDispSwap_RasterPos2fv,
__glXDispSwap_RasterPos2iv,
__glXDispSwap_RasterPos2sv,
__glXDispSwap_RasterPos3dv,
__glXDispSwap_RasterPos3fv,
__glXDispSwap_RasterPos3iv,
__glXDispSwap_RasterPos3sv,
__glXDispSwap_RasterPos4dv,
__glXDispSwap_RasterPos4fv,
__glXDispSwap_RasterPos4iv,
__glXDispSwap_RasterPos4sv,
__glXDispSwap_Rectdv,
__glXDispSwap_Rectfv,
__glXDispSwap_Rectiv,
__glXDispSwap_Rectsv,
__glXDispSwap_TexCoord1dv,
__glXDispSwap_TexCoord1fv,
__glXDispSwap_TexCoord1iv,
__glXDispSwap_TexCoord1sv,
__glXDispSwap_TexCoord2dv,
__glXDispSwap_TexCoord2fv,
__glXDispSwap_TexCoord2iv,
__glXDispSwap_TexCoord2sv,
__glXDispSwap_TexCoord3dv,
__glXDispSwap_TexCoord3fv,
__glXDispSwap_TexCoord3iv,
__glXDispSwap_TexCoord3sv,
__glXDispSwap_TexCoord4dv,
__glXDispSwap_TexCoord4fv,
__glXDispSwap_TexCoord4iv,
__glXDispSwap_TexCoord4sv,
__glXDispSwap_Vertex2dv,
__glXDispSwap_Vertex2fv,
__glXDispSwap_Vertex2iv,
__glXDispSwap_Vertex2sv,
__glXDispSwap_Vertex3dv,
__glXDispSwap_Vertex3fv,
__glXDispSwap_Vertex3iv,
__glXDispSwap_Vertex3sv,
__glXDispSwap_Vertex4dv,
__glXDispSwap_Vertex4fv,
__glXDispSwap_Vertex4iv,
__glXDispSwap_Vertex4sv,
__glXDispSwap_ClipPlane,
__glXDispSwap_ColorMaterial,
__glXDispSwap_CullFace,
__glXDispSwap_Fogf,
__glXDispSwap_Fogfv,
__glXDispSwap_Fogi,
__glXDispSwap_Fogiv,
__glXDispSwap_FrontFace,
__glXDispSwap_Hint,
__glXDispSwap_Lightf,
__glXDispSwap_Lightfv,
__glXDispSwap_Lighti,
__glXDispSwap_Lightiv,
__glXDispSwap_LightModelf,
__glXDispSwap_LightModelfv,
__glXDispSwap_LightModeli,
__glXDispSwap_LightModeliv,
__glXDispSwap_LineStipple,
__glXDispSwap_LineWidth,
__glXDispSwap_Materialf,
__glXDispSwap_Materialfv,
__glXDispSwap_Materiali,
__glXDispSwap_Materialiv,
__glXDispSwap_PointSize,
__glXDispSwap_PolygonMode,
__glXDispSwap_PolygonStipple,
__glXDispSwap_Scissor,
__glXDispSwap_ShadeModel,
__glXDispSwap_TexParameterf,
__glXDispSwap_TexParameterfv,
__glXDispSwap_TexParameteri,
__glXDispSwap_TexParameteriv,
__glXDispSwap_TexImage1D,
__glXDispSwap_TexImage2D,
__glXDispSwap_TexEnvf,
__glXDispSwap_TexEnvfv,
__glXDispSwap_TexEnvi,
__glXDispSwap_TexEnviv,
__glXDispSwap_TexGend,
__glXDispSwap_TexGendv,
__glXDispSwap_TexGenf,
__glXDispSwap_TexGenfv,
__glXDispSwap_TexGeni,
__glXDispSwap_TexGeniv,
__glXDispSwap_InitNames,
__glXDispSwap_LoadName,
__glXDispSwap_PassThrough,
__glXDispSwap_PopName,
__glXDispSwap_PushName,
__glXDispSwap_DrawBuffer,
__glXDispSwap_Clear,
__glXDispSwap_ClearAccum,
__glXDispSwap_ClearIndex,
__glXDispSwap_ClearColor,
__glXDispSwap_ClearStencil,
__glXDispSwap_ClearDepth,
__glXDispSwap_StencilMask,
__glXDispSwap_ColorMask,
__glXDispSwap_DepthMask,
__glXDispSwap_IndexMask,
__glXDispSwap_Accum,
__glXDispSwap_Disable,
__glXDispSwap_Enable,
__glXNoSuchRenderOpcode,
__glXDispSwap_PopAttrib,
__glXDispSwap_PushAttrib,
__glXDispSwap_Map1d,
__glXDispSwap_Map1f,
__glXDispSwap_Map2d,
__glXDispSwap_Map2f,
__glXDispSwap_MapGrid1d,
__glXDispSwap_MapGrid1f,
__glXDispSwap_MapGrid2d,
__glXDispSwap_MapGrid2f,
__glXDispSwap_EvalCoord1dv,
__glXDispSwap_EvalCoord1fv,
__glXDispSwap_EvalCoord2dv,
__glXDispSwap_EvalCoord2fv,
__glXDispSwap_EvalMesh1,
__glXDispSwap_EvalPoint1,
__glXDispSwap_EvalMesh2,
__glXDispSwap_EvalPoint2,
__glXDispSwap_AlphaFunc,
__glXDispSwap_BlendFunc,
__glXDispSwap_LogicOp,
__glXDispSwap_StencilFunc,
__glXDispSwap_StencilOp,
__glXDispSwap_DepthFunc,
__glXDispSwap_PixelZoom,
__glXDispSwap_PixelTransferf,
__glXDispSwap_PixelTransferi,
__glXDispSwap_PixelMapfv,
__glXDispSwap_PixelMapuiv,
__glXDispSwap_PixelMapusv,
__glXDispSwap_ReadBuffer,
__glXDispSwap_CopyPixels,
__glXDispSwap_DrawPixels,
__glXDispSwap_DepthRange,
__glXDispSwap_Frustum,
__glXDispSwap_LoadIdentity,
__glXDispSwap_LoadMatrixf,
__glXDispSwap_LoadMatrixd,
__glXDispSwap_MatrixMode,
__glXDispSwap_MultMatrixf,
__glXDispSwap_MultMatrixd,
__glXDispSwap_Ortho,
__glXDispSwap_PopMatrix,
__glXDispSwap_PushMatrix,
__glXDispSwap_Rotated,
__glXDispSwap_Rotatef,
__glXDispSwap_Scaled,
__glXDispSwap_Scalef,
__glXDispSwap_Translated,
__glXDispSwap_Translatef,
__glXDispSwap_Viewport,
__glXDispSwap_PolygonOffset,
__glXDispSwap_DrawArrays,
__glXDispSwap_Indexubv,
__glXDispSwap_ColorSubTable,
__glXDispSwap_CopyColorSubTable,
__glXDispSwap_ActiveTextureARB,
__glXDispSwap_MultiTexCoord1dvARB,
__glXDispSwap_MultiTexCoord1fvARB,
__glXDispSwap_MultiTexCoord1ivARB,
__glXDispSwap_MultiTexCoord1svARB,
__glXDispSwap_MultiTexCoord2dvARB,
__glXDispSwap_MultiTexCoord2fvARB,
__glXDispSwap_MultiTexCoord2ivARB,
__glXDispSwap_MultiTexCoord2svARB,
__glXDispSwap_MultiTexCoord3dvARB,
__glXDispSwap_MultiTexCoord3fvARB,
__glXDispSwap_MultiTexCoord3ivARB,
__glXDispSwap_MultiTexCoord3svARB,
__glXDispSwap_MultiTexCoord4dvARB,
__glXDispSwap_MultiTexCoord4fvARB,
__glXDispSwap_MultiTexCoord4ivARB,
__glXDispSwap_MultiTexCoord4svARB,
};

632
GL/glx/g_disptab.h Normal file
View File

@ -0,0 +1,632 @@
/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab.h,v 1.3 2001/03/21 16:29:35 dawes Exp $ */
/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
#ifndef _GLX_g_disptab_h_
#define _GLX_g_disptab_h_
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: This software was created using the
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
** not been independently verified as being compliant with the OpenGL(R)
** version 1.2.1 Specification.
*/
extern int __glXRender(__GLXclientState*, GLbyte*);
extern int __glXRenderLarge(__GLXclientState*, GLbyte*);
extern int __glXCreateContext(__GLXclientState*, GLbyte*);
extern int __glXDestroyContext(__GLXclientState*, GLbyte*);
extern int __glXMakeCurrent(__GLXclientState*, GLbyte*);
extern int __glXIsDirect(__GLXclientState*, GLbyte*);
extern int __glXQueryVersion(__GLXclientState*, GLbyte*);
extern int __glXWaitGL(__GLXclientState*, GLbyte*);
extern int __glXWaitX(__GLXclientState*, GLbyte*);
extern int __glXCopyContext(__GLXclientState*, GLbyte*);
extern int __glXSwapBuffers(__GLXclientState*, GLbyte*);
extern int __glXUseXFont(__GLXclientState*, GLbyte*);
extern int __glXCreateGLXPixmap(__GLXclientState*, GLbyte*);
extern int __glXGetVisualConfigs(__GLXclientState*, GLbyte*);
extern int __glXDestroyGLXPixmap(__GLXclientState*, GLbyte*);
extern int __glXVendorPrivate(__GLXclientState*, GLbyte*);
extern int __glXVendorPrivateWithReply(__GLXclientState*, GLbyte*);
extern int __glXQueryExtensionsString(__GLXclientState*, GLbyte*);
extern int __glXQueryServerString(__GLXclientState*, GLbyte*);
extern int __glXClientInfo(__GLXclientState*, GLbyte*);
extern int __glXDisp_NewList(__GLXclientState*, GLbyte*);
extern int __glXDisp_EndList(__GLXclientState*, GLbyte*);
extern int __glXDisp_DeleteLists(__GLXclientState*, GLbyte*);
extern int __glXDisp_GenLists(__GLXclientState*, GLbyte*);
extern int __glXDisp_FeedbackBuffer(__GLXclientState*, GLbyte*);
extern int __glXDisp_SelectBuffer(__GLXclientState*, GLbyte*);
extern int __glXDisp_RenderMode(__GLXclientState*, GLbyte*);
extern int __glXDisp_Finish(__GLXclientState*, GLbyte*);
extern int __glXDisp_PixelStoref(__GLXclientState*, GLbyte*);
extern int __glXDisp_PixelStorei(__GLXclientState*, GLbyte*);
extern int __glXDisp_ReadPixels(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetBooleanv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetClipPlane(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetDoublev(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetError(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetFloatv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetIntegerv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetLightfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetLightiv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetMapdv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetMapfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetMapiv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetMaterialfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetMaterialiv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetPixelMapfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetPixelMapuiv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetPixelMapusv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetPolygonStipple(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetString(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexEnvfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexEnviv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexGendv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexGenfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexGeniv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexImage(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexLevelParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetTexLevelParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDisp_IsEnabled(__GLXclientState*, GLbyte*);
extern int __glXDisp_IsList(__GLXclientState*, GLbyte*);
extern int __glXDisp_Flush(__GLXclientState*, GLbyte*);
extern int __glXDisp_AreTexturesResident(__GLXclientState*, GLbyte*);
extern int __glXDisp_DeleteTextures(__GLXclientState*, GLbyte*);
extern int __glXDisp_GenTextures(__GLXclientState*, GLbyte*);
extern int __glXDisp_IsTexture(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetColorTable(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetColorTableParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetColorTableParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetConvolutionFilter(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetConvolutionParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetConvolutionParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetSeparableFilter(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetHistogram(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetHistogramParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetHistogramParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetMinmax(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetMinmaxParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDisp_GetMinmaxParameteriv(__GLXclientState*, GLbyte*);
extern void __glXDisp_CallList(GLbyte*);
extern void __glXDisp_CallLists(GLbyte*);
extern void __glXDisp_ListBase(GLbyte*);
extern void __glXDisp_Begin(GLbyte*);
extern void __glXDisp_Bitmap(GLbyte*);
extern void __glXDisp_Color3bv(GLbyte*);
extern void __glXDisp_Color3dv(GLbyte*);
extern void __glXDisp_Color3fv(GLbyte*);
extern void __glXDisp_Color3iv(GLbyte*);
extern void __glXDisp_Color3sv(GLbyte*);
extern void __glXDisp_Color3ubv(GLbyte*);
extern void __glXDisp_Color3uiv(GLbyte*);
extern void __glXDisp_Color3usv(GLbyte*);
extern void __glXDisp_Color4bv(GLbyte*);
extern void __glXDisp_Color4dv(GLbyte*);
extern void __glXDisp_Color4fv(GLbyte*);
extern void __glXDisp_Color4iv(GLbyte*);
extern void __glXDisp_Color4sv(GLbyte*);
extern void __glXDisp_Color4ubv(GLbyte*);
extern void __glXDisp_Color4uiv(GLbyte*);
extern void __glXDisp_Color4usv(GLbyte*);
extern void __glXDisp_EdgeFlagv(GLbyte*);
extern void __glXDisp_End(GLbyte*);
extern void __glXDisp_Indexdv(GLbyte*);
extern void __glXDisp_Indexfv(GLbyte*);
extern void __glXDisp_Indexiv(GLbyte*);
extern void __glXDisp_Indexsv(GLbyte*);
extern void __glXDisp_Normal3bv(GLbyte*);
extern void __glXDisp_Normal3dv(GLbyte*);
extern void __glXDisp_Normal3fv(GLbyte*);
extern void __glXDisp_Normal3iv(GLbyte*);
extern void __glXDisp_Normal3sv(GLbyte*);
extern void __glXDisp_RasterPos2dv(GLbyte*);
extern void __glXDisp_RasterPos2fv(GLbyte*);
extern void __glXDisp_RasterPos2iv(GLbyte*);
extern void __glXDisp_RasterPos2sv(GLbyte*);
extern void __glXDisp_RasterPos3dv(GLbyte*);
extern void __glXDisp_RasterPos3fv(GLbyte*);
extern void __glXDisp_RasterPos3iv(GLbyte*);
extern void __glXDisp_RasterPos3sv(GLbyte*);
extern void __glXDisp_RasterPos4dv(GLbyte*);
extern void __glXDisp_RasterPos4fv(GLbyte*);
extern void __glXDisp_RasterPos4iv(GLbyte*);
extern void __glXDisp_RasterPos4sv(GLbyte*);
extern void __glXDisp_Rectdv(GLbyte*);
extern void __glXDisp_Rectfv(GLbyte*);
extern void __glXDisp_Rectiv(GLbyte*);
extern void __glXDisp_Rectsv(GLbyte*);
extern void __glXDisp_TexCoord1dv(GLbyte*);
extern void __glXDisp_TexCoord1fv(GLbyte*);
extern void __glXDisp_TexCoord1iv(GLbyte*);
extern void __glXDisp_TexCoord1sv(GLbyte*);
extern void __glXDisp_TexCoord2dv(GLbyte*);
extern void __glXDisp_TexCoord2fv(GLbyte*);
extern void __glXDisp_TexCoord2iv(GLbyte*);
extern void __glXDisp_TexCoord2sv(GLbyte*);
extern void __glXDisp_TexCoord3dv(GLbyte*);
extern void __glXDisp_TexCoord3fv(GLbyte*);
extern void __glXDisp_TexCoord3iv(GLbyte*);
extern void __glXDisp_TexCoord3sv(GLbyte*);
extern void __glXDisp_TexCoord4dv(GLbyte*);
extern void __glXDisp_TexCoord4fv(GLbyte*);
extern void __glXDisp_TexCoord4iv(GLbyte*);
extern void __glXDisp_TexCoord4sv(GLbyte*);
extern void __glXDisp_Vertex2dv(GLbyte*);
extern void __glXDisp_Vertex2fv(GLbyte*);
extern void __glXDisp_Vertex2iv(GLbyte*);
extern void __glXDisp_Vertex2sv(GLbyte*);
extern void __glXDisp_Vertex3dv(GLbyte*);
extern void __glXDisp_Vertex3fv(GLbyte*);
extern void __glXDisp_Vertex3iv(GLbyte*);
extern void __glXDisp_Vertex3sv(GLbyte*);
extern void __glXDisp_Vertex4dv(GLbyte*);
extern void __glXDisp_Vertex4fv(GLbyte*);
extern void __glXDisp_Vertex4iv(GLbyte*);
extern void __glXDisp_Vertex4sv(GLbyte*);
extern void __glXDisp_ClipPlane(GLbyte*);
extern void __glXDisp_ColorMaterial(GLbyte*);
extern void __glXDisp_CullFace(GLbyte*);
extern void __glXDisp_Fogf(GLbyte*);
extern void __glXDisp_Fogfv(GLbyte*);
extern void __glXDisp_Fogi(GLbyte*);
extern void __glXDisp_Fogiv(GLbyte*);
extern void __glXDisp_FrontFace(GLbyte*);
extern void __glXDisp_Hint(GLbyte*);
extern void __glXDisp_Lightf(GLbyte*);
extern void __glXDisp_Lightfv(GLbyte*);
extern void __glXDisp_Lighti(GLbyte*);
extern void __glXDisp_Lightiv(GLbyte*);
extern void __glXDisp_LightModelf(GLbyte*);
extern void __glXDisp_LightModelfv(GLbyte*);
extern void __glXDisp_LightModeli(GLbyte*);
extern void __glXDisp_LightModeliv(GLbyte*);
extern void __glXDisp_LineStipple(GLbyte*);
extern void __glXDisp_LineWidth(GLbyte*);
extern void __glXDisp_Materialf(GLbyte*);
extern void __glXDisp_Materialfv(GLbyte*);
extern void __glXDisp_Materiali(GLbyte*);
extern void __glXDisp_Materialiv(GLbyte*);
extern void __glXDisp_PointSize(GLbyte*);
extern void __glXDisp_PolygonMode(GLbyte*);
extern void __glXDisp_PolygonStipple(GLbyte*);
extern void __glXDisp_Scissor(GLbyte*);
extern void __glXDisp_ShadeModel(GLbyte*);
extern void __glXDisp_TexParameterf(GLbyte*);
extern void __glXDisp_TexParameterfv(GLbyte*);
extern void __glXDisp_TexParameteri(GLbyte*);
extern void __glXDisp_TexParameteriv(GLbyte*);
extern void __glXDisp_TexImage1D(GLbyte*);
extern void __glXDisp_TexImage2D(GLbyte*);
extern void __glXDisp_TexEnvf(GLbyte*);
extern void __glXDisp_TexEnvfv(GLbyte*);
extern void __glXDisp_TexEnvi(GLbyte*);
extern void __glXDisp_TexEnviv(GLbyte*);
extern void __glXDisp_TexGend(GLbyte*);
extern void __glXDisp_TexGendv(GLbyte*);
extern void __glXDisp_TexGenf(GLbyte*);
extern void __glXDisp_TexGenfv(GLbyte*);
extern void __glXDisp_TexGeni(GLbyte*);
extern void __glXDisp_TexGeniv(GLbyte*);
extern void __glXDisp_InitNames(GLbyte*);
extern void __glXDisp_LoadName(GLbyte*);
extern void __glXDisp_PassThrough(GLbyte*);
extern void __glXDisp_PopName(GLbyte*);
extern void __glXDisp_PushName(GLbyte*);
extern void __glXDisp_DrawBuffer(GLbyte*);
extern void __glXDisp_Clear(GLbyte*);
extern void __glXDisp_ClearAccum(GLbyte*);
extern void __glXDisp_ClearIndex(GLbyte*);
extern void __glXDisp_ClearColor(GLbyte*);
extern void __glXDisp_ClearStencil(GLbyte*);
extern void __glXDisp_ClearDepth(GLbyte*);
extern void __glXDisp_StencilMask(GLbyte*);
extern void __glXDisp_ColorMask(GLbyte*);
extern void __glXDisp_DepthMask(GLbyte*);
extern void __glXDisp_IndexMask(GLbyte*);
extern void __glXDisp_Accum(GLbyte*);
extern void __glXDisp_Disable(GLbyte*);
extern void __glXDisp_Enable(GLbyte*);
extern void __glXDisp_PopAttrib(GLbyte*);
extern void __glXDisp_PushAttrib(GLbyte*);
extern void __glXDisp_Map1d(GLbyte*);
extern void __glXDisp_Map1f(GLbyte*);
extern void __glXDisp_Map2d(GLbyte*);
extern void __glXDisp_Map2f(GLbyte*);
extern void __glXDisp_MapGrid1d(GLbyte*);
extern void __glXDisp_MapGrid1f(GLbyte*);
extern void __glXDisp_MapGrid2d(GLbyte*);
extern void __glXDisp_MapGrid2f(GLbyte*);
extern void __glXDisp_EvalCoord1dv(GLbyte*);
extern void __glXDisp_EvalCoord1fv(GLbyte*);
extern void __glXDisp_EvalCoord2dv(GLbyte*);
extern void __glXDisp_EvalCoord2fv(GLbyte*);
extern void __glXDisp_EvalMesh1(GLbyte*);
extern void __glXDisp_EvalPoint1(GLbyte*);
extern void __glXDisp_EvalMesh2(GLbyte*);
extern void __glXDisp_EvalPoint2(GLbyte*);
extern void __glXDisp_AlphaFunc(GLbyte*);
extern void __glXDisp_BlendFunc(GLbyte*);
extern void __glXDisp_LogicOp(GLbyte*);
extern void __glXDisp_StencilFunc(GLbyte*);
extern void __glXDisp_StencilOp(GLbyte*);
extern void __glXDisp_DepthFunc(GLbyte*);
extern void __glXDisp_PixelZoom(GLbyte*);
extern void __glXDisp_PixelTransferf(GLbyte*);
extern void __glXDisp_PixelTransferi(GLbyte*);
extern void __glXDisp_PixelMapfv(GLbyte*);
extern void __glXDisp_PixelMapuiv(GLbyte*);
extern void __glXDisp_PixelMapusv(GLbyte*);
extern void __glXDisp_ReadBuffer(GLbyte*);
extern void __glXDisp_CopyPixels(GLbyte*);
extern void __glXDisp_DrawPixels(GLbyte*);
extern void __glXDisp_DepthRange(GLbyte*);
extern void __glXDisp_Frustum(GLbyte*);
extern void __glXDisp_LoadIdentity(GLbyte*);
extern void __glXDisp_LoadMatrixf(GLbyte*);
extern void __glXDisp_LoadMatrixd(GLbyte*);
extern void __glXDisp_MatrixMode(GLbyte*);
extern void __glXDisp_MultMatrixf(GLbyte*);
extern void __glXDisp_MultMatrixd(GLbyte*);
extern void __glXDisp_Ortho(GLbyte*);
extern void __glXDisp_PopMatrix(GLbyte*);
extern void __glXDisp_PushMatrix(GLbyte*);
extern void __glXDisp_Rotated(GLbyte*);
extern void __glXDisp_Rotatef(GLbyte*);
extern void __glXDisp_Scaled(GLbyte*);
extern void __glXDisp_Scalef(GLbyte*);
extern void __glXDisp_Translated(GLbyte*);
extern void __glXDisp_Translatef(GLbyte*);
extern void __glXDisp_Viewport(GLbyte*);
extern void __glXDisp_PolygonOffset(GLbyte*);
extern void __glXDisp_DrawArrays(GLbyte*);
extern void __glXDisp_Indexubv(GLbyte*);
extern void __glXDisp_ColorSubTable(GLbyte*);
extern void __glXDisp_CopyColorSubTable(GLbyte*);
extern void __glXDisp_ActiveTextureARB(GLbyte*);
extern void __glXDisp_MultiTexCoord1dvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord1fvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord1ivARB(GLbyte*);
extern void __glXDisp_MultiTexCoord1svARB(GLbyte*);
extern void __glXDisp_MultiTexCoord2dvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord2fvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord2ivARB(GLbyte*);
extern void __glXDisp_MultiTexCoord2svARB(GLbyte*);
extern void __glXDisp_MultiTexCoord3dvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord3fvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord3ivARB(GLbyte*);
extern void __glXDisp_MultiTexCoord3svARB(GLbyte*);
extern void __glXDisp_MultiTexCoord4dvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord4fvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord4ivARB(GLbyte*);
extern void __glXDisp_MultiTexCoord4svARB(GLbyte*);
extern int __glXSwapRender(__GLXclientState*, GLbyte*);
extern int __glXSwapRenderLarge(__GLXclientState*, GLbyte*);
extern int __glXSwapCreateContext(__GLXclientState*, GLbyte*);
extern int __glXSwapDestroyContext(__GLXclientState*, GLbyte*);
extern int __glXSwapMakeCurrent(__GLXclientState*, GLbyte*);
extern int __glXSwapIsDirect(__GLXclientState*, GLbyte*);
extern int __glXSwapQueryVersion(__GLXclientState*, GLbyte*);
extern int __glXSwapWaitGL(__GLXclientState*, GLbyte*);
extern int __glXSwapWaitX(__GLXclientState*, GLbyte*);
extern int __glXSwapCopyContext(__GLXclientState*, GLbyte*);
extern int __glXSwapSwapBuffers(__GLXclientState*, GLbyte*);
extern int __glXSwapUseXFont(__GLXclientState*, GLbyte*);
extern int __glXSwapCreateGLXPixmap(__GLXclientState*, GLbyte*);
extern int __glXSwapGetVisualConfigs(__GLXclientState*, GLbyte*);
extern int __glXSwapDestroyGLXPixmap(__GLXclientState*, GLbyte*);
extern int __glXSwapVendorPrivate(__GLXclientState*, GLbyte*);
extern int __glXSwapVendorPrivateWithReply(__GLXclientState*, GLbyte*);
extern int __glXSwapQueryExtensionsString(__GLXclientState*, GLbyte*);
extern int __glXSwapQueryServerString(__GLXclientState*, GLbyte*);
extern int __glXSwapClientInfo(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_NewList(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_EndList(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_DeleteLists(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GenLists(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_FeedbackBuffer(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_SelectBuffer(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_RenderMode(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_Finish(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_PixelStoref(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_PixelStorei(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_ReadPixels(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetBooleanv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetClipPlane(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetDoublev(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetError(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetFloatv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetIntegerv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetLightfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetLightiv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetMapdv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetMapfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetMapiv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetMaterialfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetMaterialiv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetPixelMapfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetPixelMapuiv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetPixelMapusv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetPolygonStipple(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetString(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexEnvfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexEnviv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexGendv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexGenfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexGeniv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexImage(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexLevelParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetTexLevelParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_IsEnabled(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_IsList(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_Flush(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_AreTexturesResident(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_DeleteTextures(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GenTextures(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_IsTexture(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetColorTable(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetColorTableParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetColorTableParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetConvolutionFilter(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetConvolutionParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetConvolutionParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetSeparableFilter(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetHistogram(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetHistogramParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetHistogramParameteriv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetMinmax(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetMinmaxParameterfv(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GetMinmaxParameteriv(__GLXclientState*, GLbyte*);
extern void __glXDispSwap_CallList(GLbyte*);
extern void __glXDispSwap_CallLists(GLbyte*);
extern void __glXDispSwap_ListBase(GLbyte*);
extern void __glXDispSwap_Begin(GLbyte*);
extern void __glXDispSwap_Bitmap(GLbyte*);
extern void __glXDispSwap_Color3bv(GLbyte*);
extern void __glXDispSwap_Color3dv(GLbyte*);
extern void __glXDispSwap_Color3fv(GLbyte*);
extern void __glXDispSwap_Color3iv(GLbyte*);
extern void __glXDispSwap_Color3sv(GLbyte*);
extern void __glXDispSwap_Color3ubv(GLbyte*);
extern void __glXDispSwap_Color3uiv(GLbyte*);
extern void __glXDispSwap_Color3usv(GLbyte*);
extern void __glXDispSwap_Color4bv(GLbyte*);
extern void __glXDispSwap_Color4dv(GLbyte*);
extern void __glXDispSwap_Color4fv(GLbyte*);
extern void __glXDispSwap_Color4iv(GLbyte*);
extern void __glXDispSwap_Color4sv(GLbyte*);
extern void __glXDispSwap_Color4ubv(GLbyte*);
extern void __glXDispSwap_Color4uiv(GLbyte*);
extern void __glXDispSwap_Color4usv(GLbyte*);
extern void __glXDispSwap_EdgeFlagv(GLbyte*);
extern void __glXDispSwap_End(GLbyte*);
extern void __glXDispSwap_Indexdv(GLbyte*);
extern void __glXDispSwap_Indexfv(GLbyte*);
extern void __glXDispSwap_Indexiv(GLbyte*);
extern void __glXDispSwap_Indexsv(GLbyte*);
extern void __glXDispSwap_Normal3bv(GLbyte*);
extern void __glXDispSwap_Normal3dv(GLbyte*);
extern void __glXDispSwap_Normal3fv(GLbyte*);
extern void __glXDispSwap_Normal3iv(GLbyte*);
extern void __glXDispSwap_Normal3sv(GLbyte*);
extern void __glXDispSwap_RasterPos2dv(GLbyte*);
extern void __glXDispSwap_RasterPos2fv(GLbyte*);
extern void __glXDispSwap_RasterPos2iv(GLbyte*);
extern void __glXDispSwap_RasterPos2sv(GLbyte*);
extern void __glXDispSwap_RasterPos3dv(GLbyte*);
extern void __glXDispSwap_RasterPos3fv(GLbyte*);
extern void __glXDispSwap_RasterPos3iv(GLbyte*);
extern void __glXDispSwap_RasterPos3sv(GLbyte*);
extern void __glXDispSwap_RasterPos4dv(GLbyte*);
extern void __glXDispSwap_RasterPos4fv(GLbyte*);
extern void __glXDispSwap_RasterPos4iv(GLbyte*);
extern void __glXDispSwap_RasterPos4sv(GLbyte*);
extern void __glXDispSwap_Rectdv(GLbyte*);
extern void __glXDispSwap_Rectfv(GLbyte*);
extern void __glXDispSwap_Rectiv(GLbyte*);
extern void __glXDispSwap_Rectsv(GLbyte*);
extern void __glXDispSwap_TexCoord1dv(GLbyte*);
extern void __glXDispSwap_TexCoord1fv(GLbyte*);
extern void __glXDispSwap_TexCoord1iv(GLbyte*);
extern void __glXDispSwap_TexCoord1sv(GLbyte*);
extern void __glXDispSwap_TexCoord2dv(GLbyte*);
extern void __glXDispSwap_TexCoord2fv(GLbyte*);
extern void __glXDispSwap_TexCoord2iv(GLbyte*);
extern void __glXDispSwap_TexCoord2sv(GLbyte*);
extern void __glXDispSwap_TexCoord3dv(GLbyte*);
extern void __glXDispSwap_TexCoord3fv(GLbyte*);
extern void __glXDispSwap_TexCoord3iv(GLbyte*);
extern void __glXDispSwap_TexCoord3sv(GLbyte*);
extern void __glXDispSwap_TexCoord4dv(GLbyte*);
extern void __glXDispSwap_TexCoord4fv(GLbyte*);
extern void __glXDispSwap_TexCoord4iv(GLbyte*);
extern void __glXDispSwap_TexCoord4sv(GLbyte*);
extern void __glXDispSwap_Vertex2dv(GLbyte*);
extern void __glXDispSwap_Vertex2fv(GLbyte*);
extern void __glXDispSwap_Vertex2iv(GLbyte*);
extern void __glXDispSwap_Vertex2sv(GLbyte*);
extern void __glXDispSwap_Vertex3dv(GLbyte*);
extern void __glXDispSwap_Vertex3fv(GLbyte*);
extern void __glXDispSwap_Vertex3iv(GLbyte*);
extern void __glXDispSwap_Vertex3sv(GLbyte*);
extern void __glXDispSwap_Vertex4dv(GLbyte*);
extern void __glXDispSwap_Vertex4fv(GLbyte*);
extern void __glXDispSwap_Vertex4iv(GLbyte*);
extern void __glXDispSwap_Vertex4sv(GLbyte*);
extern void __glXDispSwap_ClipPlane(GLbyte*);
extern void __glXDispSwap_ColorMaterial(GLbyte*);
extern void __glXDispSwap_CullFace(GLbyte*);
extern void __glXDispSwap_Fogf(GLbyte*);
extern void __glXDispSwap_Fogfv(GLbyte*);
extern void __glXDispSwap_Fogi(GLbyte*);
extern void __glXDispSwap_Fogiv(GLbyte*);
extern void __glXDispSwap_FrontFace(GLbyte*);
extern void __glXDispSwap_Hint(GLbyte*);
extern void __glXDispSwap_Lightf(GLbyte*);
extern void __glXDispSwap_Lightfv(GLbyte*);
extern void __glXDispSwap_Lighti(GLbyte*);
extern void __glXDispSwap_Lightiv(GLbyte*);
extern void __glXDispSwap_LightModelf(GLbyte*);
extern void __glXDispSwap_LightModelfv(GLbyte*);
extern void __glXDispSwap_LightModeli(GLbyte*);
extern void __glXDispSwap_LightModeliv(GLbyte*);
extern void __glXDispSwap_LineStipple(GLbyte*);
extern void __glXDispSwap_LineWidth(GLbyte*);
extern void __glXDispSwap_Materialf(GLbyte*);
extern void __glXDispSwap_Materialfv(GLbyte*);
extern void __glXDispSwap_Materiali(GLbyte*);
extern void __glXDispSwap_Materialiv(GLbyte*);
extern void __glXDispSwap_PointSize(GLbyte*);
extern void __glXDispSwap_PolygonMode(GLbyte*);
extern void __glXDispSwap_PolygonStipple(GLbyte*);
extern void __glXDispSwap_Scissor(GLbyte*);
extern void __glXDispSwap_ShadeModel(GLbyte*);
extern void __glXDispSwap_TexParameterf(GLbyte*);
extern void __glXDispSwap_TexParameterfv(GLbyte*);
extern void __glXDispSwap_TexParameteri(GLbyte*);
extern void __glXDispSwap_TexParameteriv(GLbyte*);
extern void __glXDispSwap_TexImage1D(GLbyte*);
extern void __glXDispSwap_TexImage2D(GLbyte*);
extern void __glXDispSwap_TexEnvf(GLbyte*);
extern void __glXDispSwap_TexEnvfv(GLbyte*);
extern void __glXDispSwap_TexEnvi(GLbyte*);
extern void __glXDispSwap_TexEnviv(GLbyte*);
extern void __glXDispSwap_TexGend(GLbyte*);
extern void __glXDispSwap_TexGendv(GLbyte*);
extern void __glXDispSwap_TexGenf(GLbyte*);
extern void __glXDispSwap_TexGenfv(GLbyte*);
extern void __glXDispSwap_TexGeni(GLbyte*);
extern void __glXDispSwap_TexGeniv(GLbyte*);
extern void __glXDispSwap_InitNames(GLbyte*);
extern void __glXDispSwap_LoadName(GLbyte*);
extern void __glXDispSwap_PassThrough(GLbyte*);
extern void __glXDispSwap_PopName(GLbyte*);
extern void __glXDispSwap_PushName(GLbyte*);
extern void __glXDispSwap_DrawBuffer(GLbyte*);
extern void __glXDispSwap_Clear(GLbyte*);
extern void __glXDispSwap_ClearAccum(GLbyte*);
extern void __glXDispSwap_ClearIndex(GLbyte*);
extern void __glXDispSwap_ClearColor(GLbyte*);
extern void __glXDispSwap_ClearStencil(GLbyte*);
extern void __glXDispSwap_ClearDepth(GLbyte*);
extern void __glXDispSwap_StencilMask(GLbyte*);
extern void __glXDispSwap_ColorMask(GLbyte*);
extern void __glXDispSwap_DepthMask(GLbyte*);
extern void __glXDispSwap_IndexMask(GLbyte*);
extern void __glXDispSwap_Accum(GLbyte*);
extern void __glXDispSwap_Disable(GLbyte*);
extern void __glXDispSwap_Enable(GLbyte*);
extern void __glXDispSwap_PopAttrib(GLbyte*);
extern void __glXDispSwap_PushAttrib(GLbyte*);
extern void __glXDispSwap_Map1d(GLbyte*);
extern void __glXDispSwap_Map1f(GLbyte*);
extern void __glXDispSwap_Map2d(GLbyte*);
extern void __glXDispSwap_Map2f(GLbyte*);
extern void __glXDispSwap_MapGrid1d(GLbyte*);
extern void __glXDispSwap_MapGrid1f(GLbyte*);
extern void __glXDispSwap_MapGrid2d(GLbyte*);
extern void __glXDispSwap_MapGrid2f(GLbyte*);
extern void __glXDispSwap_EvalCoord1dv(GLbyte*);
extern void __glXDispSwap_EvalCoord1fv(GLbyte*);
extern void __glXDispSwap_EvalCoord2dv(GLbyte*);
extern void __glXDispSwap_EvalCoord2fv(GLbyte*);
extern void __glXDispSwap_EvalMesh1(GLbyte*);
extern void __glXDispSwap_EvalPoint1(GLbyte*);
extern void __glXDispSwap_EvalMesh2(GLbyte*);
extern void __glXDispSwap_EvalPoint2(GLbyte*);
extern void __glXDispSwap_AlphaFunc(GLbyte*);
extern void __glXDispSwap_BlendFunc(GLbyte*);
extern void __glXDispSwap_LogicOp(GLbyte*);
extern void __glXDispSwap_StencilFunc(GLbyte*);
extern void __glXDispSwap_StencilOp(GLbyte*);
extern void __glXDispSwap_DepthFunc(GLbyte*);
extern void __glXDispSwap_PixelZoom(GLbyte*);
extern void __glXDispSwap_PixelTransferf(GLbyte*);
extern void __glXDispSwap_PixelTransferi(GLbyte*);
extern void __glXDispSwap_PixelMapfv(GLbyte*);
extern void __glXDispSwap_PixelMapuiv(GLbyte*);
extern void __glXDispSwap_PixelMapusv(GLbyte*);
extern void __glXDispSwap_ReadBuffer(GLbyte*);
extern void __glXDispSwap_CopyPixels(GLbyte*);
extern void __glXDispSwap_DrawPixels(GLbyte*);
extern void __glXDispSwap_DepthRange(GLbyte*);
extern void __glXDispSwap_Frustum(GLbyte*);
extern void __glXDispSwap_LoadIdentity(GLbyte*);
extern void __glXDispSwap_LoadMatrixf(GLbyte*);
extern void __glXDispSwap_LoadMatrixd(GLbyte*);
extern void __glXDispSwap_MatrixMode(GLbyte*);
extern void __glXDispSwap_MultMatrixf(GLbyte*);
extern void __glXDispSwap_MultMatrixd(GLbyte*);
extern void __glXDispSwap_Ortho(GLbyte*);
extern void __glXDispSwap_PopMatrix(GLbyte*);
extern void __glXDispSwap_PushMatrix(GLbyte*);
extern void __glXDispSwap_Rotated(GLbyte*);
extern void __glXDispSwap_Rotatef(GLbyte*);
extern void __glXDispSwap_Scaled(GLbyte*);
extern void __glXDispSwap_Scalef(GLbyte*);
extern void __glXDispSwap_Translated(GLbyte*);
extern void __glXDispSwap_Translatef(GLbyte*);
extern void __glXDispSwap_Viewport(GLbyte*);
extern void __glXDispSwap_PolygonOffset(GLbyte*);
extern void __glXDispSwap_DrawArrays(GLbyte*);
extern void __glXDispSwap_Indexubv(GLbyte*);
extern void __glXDispSwap_ColorSubTable(GLbyte*);
extern void __glXDispSwap_CopyColorSubTable(GLbyte*);
extern void __glXDispSwap_ActiveTextureARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord1dvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord1fvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord1ivARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord1svARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord2dvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord2fvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord2ivARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord2svARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord3dvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord3fvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord3ivARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord3svARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord4dvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord4fvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord4ivARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord4svARB(GLbyte*);
#define __GLX_MIN_GLXCMD_OPCODE 1
#define __GLX_MAX_GLXCMD_OPCODE 20
#define __GLX_MIN_RENDER_OPCODE 1
#define __GLX_MAX_RENDER_OPCODE 213
#define __GLX_MIN_SINGLE_OPCODE 1
#define __GLX_MAX_SINGLE_OPCODE 159
#define __GLX_SINGLE_TABLE_SIZE 160
#define __GLX_RENDER_TABLE_SIZE 214
extern __GLXdispatchRenderProcPtr __glXRenderTable[__GLX_RENDER_TABLE_SIZE];
extern __GLXdispatchSingleProcPtr __glXSingleTable[__GLX_SINGLE_TABLE_SIZE];
extern __GLXdispatchRenderProcPtr __glXSwapRenderTable[__GLX_RENDER_TABLE_SIZE];
extern __GLXdispatchSingleProcPtr __glXSwapSingleTable[__GLX_SINGLE_TABLE_SIZE];
#endif /* _GLX_g_disptab_h_ */

4195
GL/glx/g_disptab_EXT.c Normal file

File diff suppressed because it is too large Load Diff

118
GL/glx/g_disptab_EXT.h Normal file
View File

@ -0,0 +1,118 @@
/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab_EXT.h,v 1.3 2001/03/21 16:29:35 dawes Exp $ */
/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
#ifndef _GLX_g_disptab_EXT_h_
#define _GLX_g_disptab_EXT_h_
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: This software was created using the
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
** not been independently verified as being compliant with the OpenGL(R)
** version 1.2.1 Specification.
*/
extern int __glXDisp_AreTexturesResidentEXT(__GLXclientState*, GLbyte*);
extern int __glXDisp_DeleteTexturesEXT(__GLXclientState*, GLbyte*);
extern int __glXDisp_GenTexturesEXT(__GLXclientState*, GLbyte*);
extern int __glXDisp_IsTextureEXT(__GLXclientState*, GLbyte*);
extern void __glXDisp_ColorTable(GLbyte*);
extern void __glXDisp_ColorTableParameterfv(GLbyte*);
extern void __glXDisp_ColorTableParameteriv(GLbyte*);
extern void __glXDisp_CopyColorTable(GLbyte*);
extern void __glXDisp_BlendColor(GLbyte*);
extern void __glXDisp_BlendEquation(GLbyte*);
extern void __glXDisp_TexSubImage1D(GLbyte*);
extern void __glXDisp_TexSubImage2D(GLbyte*);
extern void __glXDisp_ConvolutionFilter1D(GLbyte*);
extern void __glXDisp_ConvolutionFilter2D(GLbyte*);
extern void __glXDisp_ConvolutionParameterf(GLbyte*);
extern void __glXDisp_ConvolutionParameterfv(GLbyte*);
extern void __glXDisp_ConvolutionParameteri(GLbyte*);
extern void __glXDisp_ConvolutionParameteriv(GLbyte*);
extern void __glXDisp_CopyConvolutionFilter1D(GLbyte*);
extern void __glXDisp_CopyConvolutionFilter2D(GLbyte*);
extern void __glXDisp_SeparableFilter2D(GLbyte*);
extern void __glXDisp_Histogram(GLbyte*);
extern void __glXDisp_Minmax(GLbyte*);
extern void __glXDisp_ResetHistogram(GLbyte*);
extern void __glXDisp_ResetMinmax(GLbyte*);
extern void __glXDisp_TexImage3D(GLbyte*);
extern void __glXDisp_TexSubImage3D(GLbyte*);
extern void __glXDisp_DrawArraysEXT(GLbyte*);
extern void __glXDisp_BindTexture(GLbyte*);
extern void __glXDisp_PrioritizeTextures(GLbyte*);
extern void __glXDisp_CopyTexImage1D(GLbyte*);
extern void __glXDisp_CopyTexImage2D(GLbyte*);
extern void __glXDisp_CopyTexSubImage1D(GLbyte*);
extern void __glXDisp_CopyTexSubImage2D(GLbyte*);
extern void __glXDisp_CopyTexSubImage3D(GLbyte*);
extern int __glXDispSwap_AreTexturesResidentEXT(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_DeleteTexturesEXT(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_GenTexturesEXT(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_IsTextureEXT(__GLXclientState*, GLbyte*);
extern void __glXDispSwap_ColorTable(GLbyte*);
extern void __glXDispSwap_ColorTableParameterfv(GLbyte*);
extern void __glXDispSwap_ColorTableParameteriv(GLbyte*);
extern void __glXDispSwap_CopyColorTable(GLbyte*);
extern void __glXDispSwap_BlendColor(GLbyte*);
extern void __glXDispSwap_BlendEquation(GLbyte*);
extern void __glXDispSwap_TexSubImage1D(GLbyte*);
extern void __glXDispSwap_TexSubImage2D(GLbyte*);
extern void __glXDispSwap_ConvolutionFilter1D(GLbyte*);
extern void __glXDispSwap_ConvolutionFilter2D(GLbyte*);
extern void __glXDispSwap_ConvolutionParameterf(GLbyte*);
extern void __glXDispSwap_ConvolutionParameterfv(GLbyte*);
extern void __glXDispSwap_ConvolutionParameteri(GLbyte*);
extern void __glXDispSwap_ConvolutionParameteriv(GLbyte*);
extern void __glXDispSwap_CopyConvolutionFilter1D(GLbyte*);
extern void __glXDispSwap_CopyConvolutionFilter2D(GLbyte*);
extern void __glXDispSwap_SeparableFilter2D(GLbyte*);
extern void __glXDispSwap_Histogram(GLbyte*);
extern void __glXDispSwap_Minmax(GLbyte*);
extern void __glXDispSwap_ResetHistogram(GLbyte*);
extern void __glXDispSwap_ResetMinmax(GLbyte*);
extern void __glXDispSwap_TexImage3D(GLbyte*);
extern void __glXDispSwap_TexSubImage3D(GLbyte*);
extern void __glXDispSwap_DrawArraysEXT(GLbyte*);
extern void __glXDispSwap_BindTexture(GLbyte*);
extern void __glXDispSwap_PrioritizeTextures(GLbyte*);
extern void __glXDispSwap_CopyTexImage1D(GLbyte*);
extern void __glXDispSwap_CopyTexImage2D(GLbyte*);
extern void __glXDispSwap_CopyTexSubImage1D(GLbyte*);
extern void __glXDispSwap_CopyTexSubImage2D(GLbyte*);
extern void __glXDispSwap_CopyTexSubImage3D(GLbyte*);
#define __GLX_MIN_RENDER_OPCODE_EXT 2053
#define __GLX_MAX_RENDER_OPCODE_EXT 4123
#define __GLX_MIN_VENDPRIV_OPCODE_EXT 11
#define __GLX_MAX_VENDPRIV_OPCODE_EXT 14
#define __GLX_VENDPRIV_TABLE_SIZE_EXT 4
#define __GLX_RENDER_TABLE_SIZE_EXT 2071
extern __GLXdispatchRenderProcPtr __glXRenderTable_EXT[__GLX_RENDER_TABLE_SIZE_EXT];
extern __GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[__GLX_VENDPRIV_TABLE_SIZE_EXT];
extern __GLXdispatchRenderProcPtr __glXSwapRenderTable_EXT[__GLX_RENDER_TABLE_SIZE_EXT];
extern __GLXdispatchVendorPrivProcPtr __glXSwapVendorPrivTable_EXT[__GLX_VENDPRIV_TABLE_SIZE_EXT];
#endif /* _GLX_g_disptab_EXT_h_ */

2077
GL/glx/g_render.c Normal file

File diff suppressed because it is too large Load Diff

3308
GL/glx/g_renderswap.c Normal file

File diff suppressed because it is too large Load Diff

1787
GL/glx/g_single.c Normal file

File diff suppressed because it is too large Load Diff

2204
GL/glx/g_singleswap.c Normal file

File diff suppressed because it is too large Load Diff

71
GL/glx/global.c Normal file
View File

@ -0,0 +1,71 @@
/* $XFree86: xc/programs/Xserver/GL/glx/global.c,v 1.3 2001/03/21 16:29:35 dawes Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#define NEED_REPLIES
#include "glxserver.h"
/*
** The last context used by the server. It is the context that is current
** from the server's perspective.
*/
__GLXcontext *__glXLastContext;
/*
** X resources.
*/
RESTYPE __glXContextRes;
RESTYPE __glXClientRes;
RESTYPE __glXPixmapRes;
/*
** Error codes with the extension error base already added in.
*/
int __glXBadContext, __glXBadContextState, __glXBadDrawable, __glXBadPixmap;
int __glXBadContextTag, __glXBadCurrentWindow;
int __glXBadRenderRequest, __glXBadLargeRequest;
int __glXUnsupportedPrivateRequest;
/*
** Reply for most singles.
*/
xGLXSingleReply __glXReply;
/*
** A set of state for each client. The 0th one is unused because client
** indices start at 1, not 0.
*/
__GLXclientState *__glXClients[MAXCLIENTS+1];

292
GL/glx/glxbuf.c Normal file
View File

@ -0,0 +1,292 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glxbuf.c,v 1.7 2001/10/31 22:50:26 tsi Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#include "glxserver.h"
#include "glxutil.h"
#include "glxbuf.h"
#include "glxfb.h"
#include "glxmem.h"
#include "glxpix.h"
void
__glXFBInitDrawable(__GLXdrawablePrivate *glxPriv, __GLcontextModes *modes)
{
__GLdrawablePrivate *glPriv;
GLint rgbBits;
GLint accumBits;
glPriv = &glxPriv->glPriv;
rgbBits = modes->rgbBits;
accumBits = modes->accumRedBits + modes->accumGreenBits +
modes->accumBlueBits + modes->accumAlphaBits;
#if defined(__GL_ALIGNED_BUFFERS)
/* initialize pixel alignments (for more details see context.h) */
glPriv->xAlignment = 1;
glPriv->yAlignment = 1;
#endif
glxPriv->swapBuffers = __glXFBMemSwapBuffers;
glPriv->yInverted = GL_TRUE; /* Y is upside-down */
if (modes->doubleBufferMode) {
if (modes->colorIndexMode) {
__glXInitFB(&glPriv->frontBuffer, glPriv, modes->indexBits);
__glXInitMem(&glPriv->backBuffer, glPriv, modes->indexBits);
} else {
__glXInitFB(&glPriv->frontBuffer, glPriv, rgbBits);
__glXInitMem(&glPriv->backBuffer, glPriv, rgbBits);
}
} else {
if (modes->colorIndexMode) {
__glXInitFB(&glPriv->frontBuffer, glPriv, modes->indexBits);
} else {
__glXInitFB(&glPriv->frontBuffer, glPriv, rgbBits);
}
}
#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
if (modes->maxAuxBuffers > 0) {
GLint i;
for (i=0; i < modes->maxAuxBuffers; i++) {
if (modes->colorIndexMode) {
__glXInitMem(&glPriv->auxBuffer[i], glPriv, modes->indexBits);
} else {
__glXInitMem(&glPriv->auxBuffer[i], glPriv, rgbBits);
}
}
}
#endif
if (modes->haveAccumBuffer) {
__glXInitMem(&glPriv->accumBuffer, glPriv, accumBits);
}
if (modes->haveDepthBuffer) {
__glXInitMem(&glPriv->depthBuffer, glPriv, modes->depthBits);
}
if (modes->haveStencilBuffer) {
__glXInitMem(&glPriv->stencilBuffer, glPriv, modes->stencilBits);
}
}
void
__glXPixInitDrawable(__GLXdrawablePrivate *glxPriv, __GLcontextModes *modes)
{
__GLdrawablePrivate *glPriv;
GLint rgbBits;
GLint accumBits;
assert(glxPriv->pGlxPixmap);
glPriv = &glxPriv->glPriv;
rgbBits = modes->rgbBits;
accumBits = modes->accumRedBits + modes->accumGreenBits +
modes->accumBlueBits + modes->accumAlphaBits;
#if defined(__GL_ALIGNED_BUFFERS)
/* initialize pixel alignments (for more details see context.h) */
glPriv->xAlignment = 1;
glPriv->yAlignment = 1;
#endif
glxPriv->swapBuffers = (GLboolean (*)(__GLXdrawablePrivate *))__glXNop;
glPriv->yInverted = GL_FALSE;
if (modes->doubleBufferMode) {
if (modes->colorIndexMode) {
__glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
glxPriv->drawId, glxPriv->pGlxPixmap);
__glXInitMem(&glPriv->backBuffer, glPriv, modes->indexBits);
} else {
__glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
glxPriv->drawId, glxPriv->pGlxPixmap);
__glXInitMem(&glPriv->backBuffer, glPriv, rgbBits);
}
} else {
if (modes->colorIndexMode) {
__glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
glxPriv->drawId, glxPriv->pGlxPixmap);
} else {
__glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
glxPriv->drawId, glxPriv->pGlxPixmap);
}
}
#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
if (modes->maxAuxBuffers > 0) {
GLint i;
for (i=0; i < modes->maxAuxBuffers; i++) {
if (modes->colorIndexMode) {
__glXInitMem(&glPriv->auxBuffer[i], glPriv, modes->indexBits);
} else {
__glXInitMem(&glPriv->auxBuffer[i], glPriv, rgbBits);
}
}
}
#endif
if (modes->haveAccumBuffer) {
__glXInitMem(&glPriv->accumBuffer, glPriv, accumBits);
}
if (modes->haveDepthBuffer) {
__glXInitMem(&glPriv->depthBuffer, glPriv, modes->depthBits);
}
if (modes->haveStencilBuffer) {
__glXInitMem(&glPriv->stencilBuffer, glPriv, modes->stencilBits);
}
}
#define __GLX_SET_ACCEL_BUFFER_MASK(bm) \
if (status == GL_FALSE) return GL_FALSE; \
if (status == GL_TRUE) accelBufferMask |= bm; \
/* for __GL_BUFFER_FALLBACK don't do anything */
GLboolean
__glXResizeBuffers(__GLdrawablePrivate *glPriv,
GLint x, GLint y, GLuint width, GLuint height)
{
__GLcontextModes *modes;
__GLdrawableRegion *glRegion;
GLboolean status;
GLuint accelBufferMask;
modes = glPriv->modes;
accelBufferMask = 0;
status = (*glPriv->frontBuffer.resize)(&glPriv->frontBuffer,
x, y, width, height, glPriv,
__GL_FRONT_BUFFER_MASK);
__GLX_SET_ACCEL_BUFFER_MASK(__GL_FRONT_BUFFER_MASK);
if (modes->doubleBufferMode) {
status = (*glPriv->backBuffer.resize)(&glPriv->backBuffer,
x, y, width, height, glPriv,
__GL_BACK_BUFFER_MASK);
__GLX_SET_ACCEL_BUFFER_MASK(__GL_BACK_BUFFER_MASK);
}
#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
if (modes->maxAuxBuffers > 0) {
GLint i;
for (i=0; i < modes->maxAuxBuffers; i++) {
status = (*glPriv->auxBuffers[i].resize)(&glPriv->auxBuffer[i],
x, y, width, height,
glPriv,
__GL_AUX_BUFFER_MASK(i));
__GLX_SET_ACCEL_BUFFER_MASK(__GL_AUX_BUFFER_MASK(i));
}
}
#endif
if (modes->haveAccumBuffer) {
status = (*glPriv->accumBuffer.resize)(&glPriv->accumBuffer,
x, y, width, height, glPriv,
__GL_ACCUM_BUFFER_MASK);
__GLX_SET_ACCEL_BUFFER_MASK(__GL_ACCUM_BUFFER_MASK);
}
if (modes->haveDepthBuffer) {
status = (*glPriv->depthBuffer.resize)(&glPriv->depthBuffer,
x, y, width, height, glPriv,
__GL_DEPTH_BUFFER_MASK);
__GLX_SET_ACCEL_BUFFER_MASK(__GL_DEPTH_BUFFER_MASK);
}
if (modes->haveStencilBuffer) {
status = (*glPriv->stencilBuffer.resize)(&glPriv->stencilBuffer,
x, y, width, height, glPriv,
__GL_STENCIL_BUFFER_MASK);
__GLX_SET_ACCEL_BUFFER_MASK(__GL_STENCIL_BUFFER_MASK);
}
glPriv->accelBufferMask = accelBufferMask;
/* finally, update the ownership region */
glRegion = &glPriv->ownershipRegion;
glRegion->numRects = 1;
glRegion->rects[0].x0 = 0;
glRegion->rects[0].y0 = 0;
glRegion->rects[0].x1 = width;
glRegion->rects[0].y1 = height;
return GL_TRUE;
}
void
__glXFreeBuffers(__GLXdrawablePrivate *glxPriv)
{
__GLdrawablePrivate *glPriv = &glxPriv->glPriv;
#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
__GLcontextModes *modes = glPriv->modes;
#endif
if (glPriv->frontBuffer.free) {
(*glPriv->frontBuffer.free)(&glPriv->frontBuffer, glPriv);
}
if (glPriv->backBuffer.free) {
(*glPriv->backBuffer.free)(&glPriv->backBuffer, glPriv);
}
#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
if (modes->maxAuxBuffers > 0) {
GLint i;
for (i=0; i < modes->maxAuxBuffers; i++) {
if (glPriv->auxBuffer[i].free) {
(*glPriv->auxBuffer[i].free)(&glPriv->auxBuffer[i], glPriv);
}
}
}
#endif
if (glPriv->accumBuffer.free) {
(*glPriv->accumBuffer.free)(&glPriv->accumBuffer, glPriv);
}
if (glPriv->depthBuffer.free) {
(*glPriv->depthBuffer.free)(&glPriv->depthBuffer, glPriv);
}
if (glPriv->stencilBuffer.free) {
(*glPriv->stencilBuffer.free)(&glPriv->stencilBuffer, glPriv);
}
}

53
GL/glx/glxbuf.h Normal file
View File

@ -0,0 +1,53 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glxbuf.h,v 1.3 2001/03/21 16:29:36 dawes Exp $ */
#ifndef _glxbuf_h_
#define _glxbuf_h_
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
extern void __glXFBInitDrawable(__GLXdrawablePrivate *glxPriv,
__GLcontextModes *modes);
extern void __glXPixInitDrawable(__GLXdrawablePrivate *glxPriv,
__GLcontextModes *modes);
extern GLboolean __glXResizeBuffers(__GLdrawablePrivate *glPriv,
GLint x, GLint y,
GLuint width, GLuint height);
extern void __glXFreeBuffers(__GLXdrawablePrivate *glxPriv);
extern void __glXUpdatePalette(__GLXdrawablePrivate *);
#endif /* _glxbuf_h_ */

1578
GL/glx/glxcmds.c Normal file

File diff suppressed because it is too large Load Diff

794
GL/glx/glxcmdsswap.c Normal file
View File

@ -0,0 +1,794 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glxcmdsswap.c,v 1.7 2002/01/14 22:47:08 tsi Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#define NEED_REPLIES
#define FONT_PCF
#include "glxserver.h"
#include "glxutil.h"
#include <GL/glxtokens.h>
#include <unpack.h>
#include <g_disptab.h>
#include <g_disptab_EXT.h>
#include <pixmapstr.h>
#include <windowstr.h>
#include "glxext.h"
#include "GL/glx_ansic.h"
/************************************************************************/
/*
** Byteswapping versions of GLX commands. In most cases they just swap
** the incoming arguments and then call the unswapped routine. For commands
** that have replies, a separate swapping routine for the reply is provided;
** it is called at the end of the unswapped routine.
*/
int __glXSwapCreateContext(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->visual);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->shareList);
return __glXCreateContext(cl, pc);
}
int __glXSwapDestroyContext(__GLXclientState *cl, GLbyte *pc)
{
xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
return __glXDestroyContext(cl, pc);
}
int __glXSwapMakeCurrent(__GLXclientState *cl, GLbyte *pc)
{
xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->drawable);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->oldContextTag);
return __glXMakeCurrent(cl, pc);
}
int __glXSwapIsDirect(__GLXclientState *cl, GLbyte *pc)
{
xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
return __glXIsDirect(cl, pc);
}
int __glXSwapQueryVersion(__GLXclientState *cl, GLbyte *pc)
{
xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->majorVersion);
__GLX_SWAP_INT(&req->minorVersion);
return __glXQueryVersion(cl, pc);
}
int __glXSwapWaitGL(__GLXclientState *cl, GLbyte *pc)
{
xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
return __glXWaitGL(cl, pc);
}
int __glXSwapWaitX(__GLXclientState *cl, GLbyte *pc)
{
xGLXWaitXReq *req = (xGLXWaitXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
return __glXWaitX(cl, pc);
}
int __glXSwapCopyContext(__GLXclientState *cl, GLbyte *pc)
{
xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->source);
__GLX_SWAP_INT(&req->dest);
__GLX_SWAP_INT(&req->mask);
return __glXCopyContext(cl, pc);
}
int __glXSwapGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
xGLXGetVisualConfigsReply reply;
__GLXscreenInfo *pGlxScreen;
__GLXvisualConfig *pGlxVisual;
CARD32 buf[__GLX_TOTAL_CONFIG];
unsigned int screen;
int i, p;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_INT(&req->screen);
screen = req->screen;
if (screen > screenInfo.numScreens) {
/* The client library must send a valid screen number. */
client->errorValue = screen;
return BadValue;
}
pGlxScreen = &__glXActiveScreens[screen];
reply.numVisuals = pGlxScreen->numUsableVisuals;
reply.numProps = __GLX_TOTAL_CONFIG;
reply.length = (pGlxScreen->numUsableVisuals * __GLX_SIZE_CARD32 *
__GLX_TOTAL_CONFIG) >> 2;
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
__GLX_SWAP_SHORT(&reply.sequenceNumber);
__GLX_SWAP_INT(&reply.length);
__GLX_SWAP_INT(&reply.numVisuals);
__GLX_SWAP_INT(&reply.numProps);
WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *)&reply);
for (i=0; i < pGlxScreen->numVisuals; i++) {
pGlxVisual = &pGlxScreen->pGlxVisual[i];
if (pGlxVisual->vid == 0) {
/* not a usable visual */
continue;
}
p = 0;
buf[p++] = pGlxVisual->vid;
buf[p++] = pGlxVisual->class;
buf[p++] = pGlxVisual->rgba;
buf[p++] = pGlxVisual->redSize;
buf[p++] = pGlxVisual->greenSize;
buf[p++] = pGlxVisual->blueSize;
buf[p++] = pGlxVisual->alphaSize;
buf[p++] = pGlxVisual->accumRedSize;
buf[p++] = pGlxVisual->accumGreenSize;
buf[p++] = pGlxVisual->accumBlueSize;
buf[p++] = pGlxVisual->accumAlphaSize;
buf[p++] = pGlxVisual->doubleBuffer;
buf[p++] = pGlxVisual->stereo;
buf[p++] = pGlxVisual->bufferSize;
buf[p++] = pGlxVisual->depthSize;
buf[p++] = pGlxVisual->stencilSize;
buf[p++] = pGlxVisual->auxBuffers;
buf[p++] = pGlxVisual->level;
/*
** Add token/value pairs for extensions.
*/
buf[p++] = GLX_VISUAL_CAVEAT_EXT;
buf[p++] = pGlxVisual->visualRating;
buf[p++] = GLX_TRANSPARENT_TYPE_EXT;
buf[p++] = pGlxVisual->transparentPixel;
buf[p++] = GLX_TRANSPARENT_RED_VALUE_EXT;
buf[p++] = pGlxVisual->transparentRed;
buf[p++] = GLX_TRANSPARENT_GREEN_VALUE_EXT;
buf[p++] = pGlxVisual->transparentGreen;
buf[p++] = GLX_TRANSPARENT_BLUE_VALUE_EXT;
buf[p++] = pGlxVisual->transparentBlue;
buf[p++] = GLX_TRANSPARENT_ALPHA_VALUE_EXT;
buf[p++] = pGlxVisual->transparentAlpha;
buf[p++] = GLX_TRANSPARENT_INDEX_VALUE_EXT;
buf[p++] = pGlxVisual->transparentIndex;
__GLX_SWAP_INT_ARRAY(buf, __GLX_TOTAL_CONFIG);
WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG,
(char *)buf);
}
return Success;
}
int __glXSwapCreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->visual);
__GLX_SWAP_INT(&req->pixmap);
__GLX_SWAP_INT(&req->glxpixmap);
return __glXCreateGLXPixmap(cl, pc);
}
int __glXSwapDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
{
xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->glxpixmap);
return __glXDestroyGLXPixmap(cl, pc);
}
int __glXSwapSwapBuffers(__GLXclientState *cl, GLbyte *pc)
{
xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
__GLX_SWAP_INT(&req->drawable);
return __glXSwapBuffers(cl, pc);
}
int __glXSwapUseXFont(__GLXclientState *cl, GLbyte *pc)
{
xGLXUseXFontReq *req = (xGLXUseXFontReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
__GLX_SWAP_INT(&req->font);
__GLX_SWAP_INT(&req->first);
__GLX_SWAP_INT(&req->count);
__GLX_SWAP_INT(&req->listBase);
return __glXUseXFont(cl, pc);
}
int __glXSwapQueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
{
xGLXQueryExtensionsStringReq *req = NULL;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen);
return __glXQueryExtensionsString(cl, pc);
}
int __glXSwapQueryServerString(__GLXclientState *cl, GLbyte *pc)
{
xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *)pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->name);
return __glXQueryServerString(cl, pc);
}
int __glXSwapClientInfo(__GLXclientState *cl, GLbyte *pc)
{
xGLXClientInfoReq *req = (xGLXClientInfoReq *)pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->major);
__GLX_SWAP_INT(&req->minor);
__GLX_SWAP_INT(&req->numbytes);
return __glXClientInfo(cl, pc);
}
int __glXSwapQueryContextInfoEXT(__GLXclientState *cl, char *pc)
{
xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
return __glXQueryContextInfoEXT(cl, (GLbyte *)pc);
}
/************************************************************************/
/*
** Swap replies.
*/
void __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReply *reply)
{
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->contextTag);
WriteToClient(client, sz_xGLXMakeCurrentReply, (char *)reply);
}
void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply *reply)
{
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
WriteToClient(client, sz_xGLXIsDirectReply, (char *)reply);
}
void __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply *reply)
{
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->majorVersion);
__GLX_SWAP_INT(&reply->minorVersion);
WriteToClient(client, sz_xGLXQueryVersionReply, (char *)reply);
}
void glxSwapQueryExtensionsStringReply(ClientPtr client,
xGLXQueryExtensionsStringReply *reply, char *buf)
{
int length = reply->length;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->n);
WriteToClient(client, sz_xGLXQueryExtensionsStringReply, (char *)reply);
__GLX_SWAP_INT_ARRAY((int *)buf, length);
WriteToClient(client, length << 2, buf);
}
void glxSwapQueryServerStringReply(ClientPtr client,
xGLXQueryServerStringReply *reply, char *buf)
{
int length = reply->length;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->n);
WriteToClient(client, sz_xGLXQueryServerStringReply, (char *)reply);
/** no swap is needed for an array of chars **/
/* __GLX_SWAP_INT_ARRAY((int *)buf, length); */
WriteToClient(client, length << 2, buf);
}
void __glXSwapQueryContextInfoEXTReply(ClientPtr client, xGLXQueryContextInfoEXTReply *reply, int *buf)
{
int length = reply->length;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->n);
WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)reply);
__GLX_SWAP_INT_ARRAY((int *)buf, length);
WriteToClient(client, length << 2, (char *)buf);
}
/************************************************************************/
/*
** Render and Renderlarge are not in the GLX API. They are used by the GLX
** client library to send batches of GL rendering commands.
*/
int __glXSwapRender(__GLXclientState *cl, GLbyte *pc)
{
xGLXRenderReq *req;
ClientPtr client= cl->client;
int left, cmdlen, error;
int commandsDone;
CARD16 opcode;
__GLXrenderHeader *hdr;
__GLXcontext *cx;
__GLX_DECLARE_SWAP_VARIABLES;
/*
** NOTE: much of this code also appears in the nonswapping version of this
** routine, __glXRender(). Any changes made here should also be
** duplicated there.
*/
req = (xGLXRenderReq *) pc;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
cx = __glXForceCurrent(cl, req->contextTag, &error);
if (!cx) {
return error;
}
commandsDone = 0;
pc += sz_xGLXRenderReq;
left = (req->length << 2) - sz_xGLXRenderReq;
while (left > 0) {
__GLXrenderSizeData *entry;
int extra;
void (* proc)(GLbyte *);
/*
** Verify that the header length and the overall length agree.
** Also, each command must be word aligned.
*/
hdr = (__GLXrenderHeader *) pc;
__GLX_SWAP_SHORT(&hdr->length);
__GLX_SWAP_SHORT(&hdr->opcode);
cmdlen = hdr->length;
opcode = hdr->opcode;
if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
(opcode <= __GLX_MAX_RENDER_OPCODE) ) {
entry = &__glXRenderSizeTable[opcode];
proc = __glXSwapRenderTable[opcode];
#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
} else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
(opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
entry = &__glXRenderSizeTable_EXT[index];
proc = __glXSwapRenderTable_EXT[index];
#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
} else {
client->errorValue = commandsDone;
return __glXBadRenderRequest;
}
if (!entry->bytes) {
/* unused opcode */
client->errorValue = commandsDone;
return __glXBadRenderRequest;
}
if (entry->varsize) {
/* variable size command */
extra = (*entry->varsize)(pc + __GLX_RENDER_HDR_SIZE, True);
if (extra < 0) {
extra = 0;
}
if (cmdlen != __GLX_PAD(entry->bytes + extra)) {
return BadLength;
}
} else {
/* constant size command */
if (cmdlen != __GLX_PAD(entry->bytes)) {
return BadLength;
}
}
if (left < cmdlen) {
return BadLength;
}
/*
** Skip over the header and execute the command. We allow the
** caller to trash the command memory. This is useful especially
** for things that require double alignment - they can just shift
** the data towards lower memory (trashing the header) by 4 bytes
** and achieve the required alignment.
*/
(*proc)(pc + __GLX_RENDER_HDR_SIZE);
pc += cmdlen;
left -= cmdlen;
commandsDone++;
}
__GLX_NOTE_UNFLUSHED_CMDS(cx);
return Success;
}
/*
** Execute a large rendering request (one that spans multiple X requests).
*/
int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc)
{
xGLXRenderLargeReq *req;
ClientPtr client= cl->client;
size_t dataBytes;
void (*proc)(GLbyte *);
__GLXrenderLargeHeader *hdr;
__GLXcontext *cx;
int error;
CARD16 opcode;
__GLX_DECLARE_SWAP_VARIABLES;
/*
** NOTE: much of this code also appears in the nonswapping version of this
** routine, __glXRenderLarge(). Any changes made here should also be
** duplicated there.
*/
req = (xGLXRenderLargeReq *) pc;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
__GLX_SWAP_INT(&req->dataBytes);
__GLX_SWAP_SHORT(&req->requestNumber);
__GLX_SWAP_SHORT(&req->requestTotal);
cx = __glXForceCurrent(cl, req->contextTag, &error);
if (!cx) {
/* Reset in case this isn't 1st request. */
__glXResetLargeCommandStatus(cl);
return error;
}
dataBytes = req->dataBytes;
/*
** Check the request length.
*/
if ((req->length << 2) != __GLX_PAD(dataBytes) + sz_xGLXRenderLargeReq) {
client->errorValue = req->length;
/* Reset in case this isn't 1st request. */
__glXResetLargeCommandStatus(cl);
return BadLength;
}
pc += sz_xGLXRenderLargeReq;
if (cl->largeCmdRequestsSoFar == 0) {
__GLXrenderSizeData *entry;
int extra;
size_t cmdlen;
/*
** This is the first request of a multi request command.
** Make enough space in the buffer, then copy the entire request.
*/
if (req->requestNumber != 1) {
client->errorValue = req->requestNumber;
return __glXBadLargeRequest;
}
hdr = (__GLXrenderLargeHeader *) pc;
__GLX_SWAP_INT(&hdr->length);
__GLX_SWAP_INT(&hdr->opcode);
cmdlen = hdr->length;
opcode = hdr->opcode;
if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
(opcode <= __GLX_MAX_RENDER_OPCODE) ) {
entry = &__glXRenderSizeTable[opcode];
proc = __glXSwapRenderTable[opcode];
#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
} else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
(opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
entry = &__glXRenderSizeTable_EXT[index];
proc = __glXSwapRenderTable_EXT[index];
#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
} else {
client->errorValue = opcode;
return __glXBadLargeRequest;
}
if (!entry->bytes) {
/* unused opcode */
client->errorValue = opcode;
return __glXBadLargeRequest;
}
if (entry->varsize) {
/*
** If it's a variable-size command (a command whose length must
** be computed from its parameters), all the parameters needed
** will be in the 1st request, so it's okay to do this.
*/
extra = (*entry->varsize)(pc + __GLX_RENDER_LARGE_HDR_SIZE, True);
if (extra < 0) {
extra = 0;
}
/* large command's header is 4 bytes longer, so add 4 */
if (cmdlen != __GLX_PAD(entry->bytes + 4 + extra)) {
return BadLength;
}
} else {
/* constant size command */
if (cmdlen != __GLX_PAD(entry->bytes + 4)) {
return BadLength;
}
}
/*
** Make enough space in the buffer, then copy the entire request.
*/
if (cl->largeCmdBufSize < cmdlen) {
if (!cl->largeCmdBuf) {
cl->largeCmdBuf = (GLbyte *) __glXMalloc(cmdlen);
} else {
cl->largeCmdBuf = (GLbyte *) __glXRealloc(cl->largeCmdBuf, cmdlen);
}
if (!cl->largeCmdBuf) {
return BadAlloc;
}
cl->largeCmdBufSize = cmdlen;
}
__glXMemcpy(cl->largeCmdBuf, pc, dataBytes);
cl->largeCmdBytesSoFar = dataBytes;
cl->largeCmdBytesTotal = cmdlen;
cl->largeCmdRequestsSoFar = 1;
cl->largeCmdRequestsTotal = req->requestTotal;
return Success;
} else {
/*
** We are receiving subsequent (i.e. not the first) requests of a
** multi request command.
*/
/*
** Check the request number and the total request count.
*/
if (req->requestNumber != cl->largeCmdRequestsSoFar + 1) {
client->errorValue = req->requestNumber;
__glXResetLargeCommandStatus(cl);
return __glXBadLargeRequest;
}
if (req->requestTotal != cl->largeCmdRequestsTotal) {
client->errorValue = req->requestTotal;
__glXResetLargeCommandStatus(cl);
return __glXBadLargeRequest;
}
/*
** Check that we didn't get too much data.
*/
if ((cl->largeCmdBytesSoFar + dataBytes) > cl->largeCmdBytesTotal) {
client->errorValue = dataBytes;
__glXResetLargeCommandStatus(cl);
return __glXBadLargeRequest;
}
__glXMemcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes);
cl->largeCmdBytesSoFar += dataBytes;
cl->largeCmdRequestsSoFar++;
if (req->requestNumber == cl->largeCmdRequestsTotal) {
/*
** This is the last request; it must have enough bytes to complete
** the command.
*/
/* NOTE: the two pad macros have been added below; they are needed
** because the client library pads the total byte count, but not
** the per-request byte counts. The Protocol Encoding says the
** total byte count should not be padded, so a proposal will be
** made to the ARB to relax the padding constraint on the total
** byte count, thus preserving backward compatibility. Meanwhile,
** the padding done below fixes a bug that did not allow
** large commands of odd sizes to be accepted by the server.
*/
if (__GLX_PAD(cl->largeCmdBytesSoFar) !=
__GLX_PAD(cl->largeCmdBytesTotal)) {
client->errorValue = dataBytes;
__glXResetLargeCommandStatus(cl);
return __glXBadLargeRequest;
}
hdr = (__GLXrenderLargeHeader *) cl->largeCmdBuf;
/*
** The opcode and length field in the header had already been
** swapped when the first request was received.
*/
/*
** Use the opcode to index into the procedure table.
*/
opcode = hdr->opcode;
if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
(opcode <= __GLX_MAX_RENDER_OPCODE) ) {
proc = __glXSwapRenderTable[opcode];
#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
} else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
(opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
proc = __glXSwapRenderTable_EXT[index];
#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
} else {
client->errorValue = opcode;
return __glXBadLargeRequest;
}
/*
** Skip over the header and execute the command.
*/
(*proc)(cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE);
__GLX_NOTE_UNFLUSHED_CMDS(cx);
/*
** Reset for the next RenderLarge series.
*/
__glXResetLargeCommandStatus(cl);
} else {
/*
** This is neither the first nor the last request.
*/
}
return Success;
}
}
/************************************************************************/
/*
** No support is provided for the vendor-private requests other than
** allocating these entry points in the dispatch table.
*/
int __glXSwapVendorPrivate(__GLXclientState *cl, GLbyte *pc)
{
xGLXVendorPrivateReq *req;
GLint vendorcode;
__GLX_DECLARE_SWAP_VARIABLES;
req = (xGLXVendorPrivateReq *) pc;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->vendorCode);
vendorcode = req->vendorCode;
if ((vendorcode >= __GLX_MIN_VENDPRIV_OPCODE_EXT) &&
(vendorcode <= __GLX_MAX_VENDPRIV_OPCODE_EXT)) {
(*__glXSwapVendorPrivTable_EXT[vendorcode-__GLX_MIN_VENDPRIV_OPCODE_EXT])(cl, (GLbyte*)req);
return Success;
}
cl->client->errorValue = req->vendorCode;
return __glXUnsupportedPrivateRequest;
}
int __glXSwapVendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc)
{
xGLXVendorPrivateWithReplyReq *req;
GLint vendorcode;
__GLX_DECLARE_SWAP_VARIABLES;
req = (xGLXVendorPrivateWithReplyReq *) pc;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->vendorCode);
vendorcode = req->vendorCode;
if ((vendorcode >= __GLX_MIN_VENDPRIV_OPCODE_EXT) &&
(vendorcode <= __GLX_MAX_VENDPRIV_OPCODE_EXT)) {
return (*__glXSwapVendorPrivTable_EXT[vendorcode-__GLX_MIN_VENDPRIV_OPCODE_EXT])(cl, (GLbyte*)req);
}
cl->client->errorValue = req->vendorCode;
return __glXUnsupportedPrivateRequest;
}

158
GL/glx/glxcontext.h Normal file
View File

@ -0,0 +1,158 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glxcontext.h,v 1.4 2002/02/22 21:45:07 dawes Exp $ */
#ifndef _GLX_context_h_
#define _GLX_context_h_
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
typedef struct __GLXcontextRec __GLXcontext;
/* XXX: should be defined somewhere globally */
#define CAPI
#include "GL/internal/glcore.h"
struct __GLXcontextRec {
/*
** list of context structs
*/
struct __GLXcontextRec *last;
struct __GLXcontextRec *next;
/*
** list of contexts bound to the same drawable
*/
struct __GLXcontextRec *nextPriv;
/*
** Opaque pointer the context object created by the GL that the
** server is bound with. Never dereferenced by this code, but used
** as a handle to feed to the routines in the screen info struct.
*/
__GLinterface *gc;
/*
** mode struct for this context
*/
__GLcontextModes *modes;
/*
** Pointer to screen info data for this context. This is set
** when the context is created.
*/
ScreenPtr pScreen;
__GLXscreenInfo *pGlxScreen;
/*
** This context is created with respect to this visual.
*/
VisualRec *pVisual;
__GLXvisualConfig *pGlxVisual;
/*
** The XID of this context.
*/
XID id;
/*
** The XID of the shareList context.
*/
XID share_id;
/*
** Visual id.
*/
VisualID vid;
/*
** screen number.
*/
GLint screen;
/*
** Whether this context's ID still exists.
*/
GLboolean idExists;
/*
** Whether this context is current for some client.
*/
GLboolean isCurrent;
/*
** Whether this context is a direct rendering context.
*/
GLboolean isDirect;
/*
** Window pending state
*/
GLuint pendingState;
/*
** This flag keeps track of whether there are unflushed GL commands.
*/
GLboolean hasUnflushedCommands;
/*
** Current rendering mode for this context.
*/
GLenum renderMode;
/*
** Buffers for feedback and selection.
*/
GLfloat *feedbackBuf;
GLint feedbackBufSize; /* number of elements allocated */
GLuint *selectBuf;
GLint selectBufSize; /* number of elements allocated */
/*
** Set only if current drawable is a glx pixmap.
*/
__GLXpixmap *pGlxPixmap;
/*
** The drawable private this context is bound to
*/
__GLXdrawablePrivate *glxPriv;
};
/* pending state defines */
#define __GLX_PENDING_RESIZE 0x1
#define __GLX_PENDING_DESTROY 0x2
#define __GLX_PENDING_SWAP 0x4
#endif /* !__GLX_context_h__ */

103
GL/glx/glxdrawable.h Normal file
View File

@ -0,0 +1,103 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glxdrawable.h,v 1.3 2001/03/21 16:29:36 dawes Exp $ */
#ifndef _GLX_drawable_h_
#define _GLX_drawable_h_
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
typedef struct {
DrawablePtr pDraw;
__GLXvisualConfig *pGlxVisual;
__GLXscreenInfo *pGlxScreen;
ScreenPtr pScreen;
Bool idExists;
int refcnt;
} __GLXpixmap;
struct __GLXdrawablePrivateRec {
/*
** list of drawable private structs
*/
struct __GLXdrawablePrivateRec *last;
struct __GLXdrawablePrivateRec *next;
DrawablePtr pDraw;
XID drawId;
__GLXpixmap *pGlxPixmap;
/*
** Either DRAWABLE_PIXMAP or DRAWABLE_WINDOW, copied from pDraw above.
** Needed by the resource freer because pDraw might already have been
** freed.
*/
int type;
/*
** Configuration of the visual to which this drawable was created.
*/
__GLXvisualConfig *pGlxVisual;
/*
** cached drawable size and origin
*/
GLint xorigin, yorigin;
GLint width, height;
/*
** list of contexts bound to this drawable
*/
struct __GLXcontextRec *glxc;
/*
** "methods" that the drawble should be able to respond to.
*/
void (*freeBuffers)(struct __GLXdrawablePrivateRec *);
void (*updatePalette)(struct __GLXdrawablePrivateRec *);
GLboolean (*swapBuffers)(struct __GLXdrawablePrivateRec *);
/*
** The GL drawable (information shared between GLX and the GL core)
*/
__GLdrawablePrivate glPriv;
/*
** reference count
*/
int refCount;
};
#endif /* !__GLX_drawable_h__ */

54
GL/glx/glxerror.h Normal file
View File

@ -0,0 +1,54 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glxerror.h,v 1.3 2001/03/21 16:29:36 dawes Exp $ */
#ifndef _GLX_error_h_
#define _GLX_error_h_
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
/*
** Error codes. These have the extension error base added to them
** when the extension initializes.
*/
extern int __glXBadContext;
extern int __glXBadContextState;
extern int __glXBadDrawable;
extern int __glXBadPixmap;
extern int __glXBadCurrentWindow;
extern int __glXBadContextTag;
extern int __glXBadRenderRequest;
extern int __glXBadLargeRequest;
extern int __glXUnsupportedPrivateRequest;
#endif

489
GL/glx/glxext.c Normal file
View File

@ -0,0 +1,489 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glxext.c,v 1.8 2001/08/23 18:25:40 alanh Exp $
** The contents of this file are subject to the GLX Public License Version 1.0
** (the "License"). You may not use this file except in compliance with the
** License. You may obtain a copy of the License at Silicon Graphics, Inc.,
** attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043
** or at http://www.sgi.com/software/opensource/glx/license.html.
**
** Software distributed under the License is distributed on an "AS IS"
** basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY
** IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR
** PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific
** language governing rights and limitations under the License.
**
** The Original Software is GLX version 1.2 source code, released February,
** 1999. The developer of the Original Software is Silicon Graphics, Inc.
** Those portions of the Subject Software created by Silicon Graphics, Inc.
** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved.
**
*/
#define NEED_REPLIES
#include "glxserver.h"
#include <windowstr.h>
#include <propertyst.h>
#include <os.h>
#include "g_disptab.h"
#include "unpack.h"
#include "glxutil.h"
#include "glxext.h"
#include "micmap.h"
extern __GLXextensionInfo __glDDXExtensionInfo;
__GLXextensionInfo *__glXExt = &__glDDXExtensionInfo;
/*
** Forward declarations.
*/
static int __glXSwapDispatch(ClientPtr);
static int __glXDispatch(ClientPtr);
/*
** Called when the extension is reset.
*/
static void ResetExtension(ExtensionEntry* extEntry)
{
__glXFlushContextCache();
(*__glXExt->resetExtension)();
__glXScreenReset();
}
/*
** Initialize the per-client context storage.
*/
static void ResetClientState(int clientIndex)
{
__GLXclientState *cl = __glXClients[clientIndex];
if (cl->returnBuf) __glXFree(cl->returnBuf);
if (cl->largeCmdBuf) __glXFree(cl->largeCmdBuf);
if (cl->currentContexts) __glXFree(cl->currentContexts);
__glXMemset(cl, 0, sizeof(__GLXclientState));
/*
** By default, assume that the client supports
** GLX major version 1 minor version 0 protocol.
*/
cl->GLClientmajorVersion = 1;
cl->GLClientminorVersion = 0;
if (cl->GLClientextensions) __glXFree(cl->GLClientextensions);
}
/*
** Reset state used to keep track of large (multi-request) commands.
*/
void __glXResetLargeCommandStatus(__GLXclientState *cl)
{
cl->largeCmdBytesSoFar = 0;
cl->largeCmdBytesTotal = 0;
cl->largeCmdRequestsSoFar = 0;
cl->largeCmdRequestsTotal = 0;
}
/*
** This procedure is called when the client who created the context goes
** away OR when glXDestroyContext is called. In either case, all we do is
** flag that the ID is no longer valid, and (maybe) free the context.
** use.
*/
static int ContextGone(__GLXcontext* cx, XID id)
{
cx->idExists = GL_FALSE;
if (!cx->isCurrent) {
__glXFreeContext(cx);
}
return True;
}
/*
** Free a client's state.
*/
static int ClientGone(int clientIndex, XID id)
{
__GLXcontext *cx;
__GLXclientState *cl = __glXClients[clientIndex];
int i;
if (cl) {
/*
** Free all the contexts that are current for this client.
*/
for (i=0; i < cl->numCurrentContexts; i++) {
cx = cl->currentContexts[i];
if (cx) {
__glXDeassociateContext(cx, cx->glxPriv);
cx->isCurrent = GL_FALSE;
if (!cx->idExists) {
__glXFreeContext(cx);
}
}
}
/*
** Re-initialize the client state structure. Don't free it because
** we'll probably get another client with this index and use the struct
** again. There is a maximum of MAXCLIENTS of these structures.
*/
ResetClientState(clientIndex);
}
return True;
}
/*
** Free a GLX Pixmap.
*/
static int PixmapGone(__GLXpixmap *pGlxPixmap, XID id)
{
PixmapPtr pPixmap = (PixmapPtr) pGlxPixmap->pDraw;
pGlxPixmap->idExists = False;
if (!pGlxPixmap->refcnt) {
/*
** The DestroyPixmap routine should decrement the refcount and free
** only if it's zero.
*/
(*pGlxPixmap->pScreen->DestroyPixmap)(pPixmap);
__glXFree(pGlxPixmap);
}
return True;
}
/*
** Free a context.
*/
GLboolean __glXFreeContext(__GLXcontext *cx)
{
if (cx->idExists || cx->isCurrent) return GL_FALSE;
if (!cx->isDirect) {
if ((*cx->gc->exports.destroyContext)((__GLcontext *)cx->gc) == GL_FALSE) {
return GL_FALSE;
}
}
if (cx->feedbackBuf) __glXFree(cx->feedbackBuf);
if (cx->selectBuf) __glXFree(cx->selectBuf);
__glXFree(cx);
if (cx == __glXLastContext) {
__glXFlushContextCache();
}
return GL_TRUE;
}
/************************************************************************/
/*
** These routines can be used to check whether a particular GL command
** has caused an error. Specifically, we use them to check whether a
** given query has caused an error, in which case a zero-length data
** reply is sent to the client.
*/
static GLboolean errorOccured = GL_FALSE;
/*
** The GL was will call this routine if an error occurs.
*/
void __glXErrorCallBack(__GLinterface *gc, GLenum code)
{
errorOccured = GL_TRUE;
}
/*
** Clear the error flag before calling the GL command.
*/
void __glXClearErrorOccured(void)
{
errorOccured = GL_FALSE;
}
/*
** Check if the GL command caused an error.
*/
GLboolean __glXErrorOccured(void)
{
return errorOccured;
}
/************************************************************************/
/*
** Initialize the GLX extension.
*/
void GlxExtensionInit(void)
{
ExtensionEntry *extEntry;
int i;
#ifdef X11R5
__glXContextRes = CreateNewResourceType(ContextGone);
__glXClientRes = CreateNewResourceType(ClientGone);
__glXPixmapRes = CreateNewResourceType(PixmapGone);
#else
__glXContextRes = CreateNewResourceType((DeleteType)ContextGone);
__glXClientRes = CreateNewResourceType((DeleteType)ClientGone);
__glXPixmapRes = CreateNewResourceType((DeleteType)PixmapGone);
#endif
/*
** Add extension to server extensions.
*/
extEntry = AddExtension(GLX_EXTENSION_NAME, __GLX_NUMBER_EVENTS,
__GLX_NUMBER_ERRORS, __glXDispatch,
__glXSwapDispatch, ResetExtension,
StandardMinorOpcode);
if (!extEntry) {
FatalError("__glXExtensionInit: AddExtensions failed\n");
return;
}
if (!AddExtensionAlias(GLX_EXTENSION_ALIAS, extEntry)) {
ErrorF("__glXExtensionInit: AddExtensionAlias failed\n");
return;
}
__glXBadContext = extEntry->errorBase + GLXBadContext;
__glXBadContextState = extEntry->errorBase + GLXBadContextState;
__glXBadDrawable = extEntry->errorBase + GLXBadDrawable;
__glXBadPixmap = extEntry->errorBase + GLXBadPixmap;
__glXBadContextTag = extEntry->errorBase + GLXBadContextTag;
__glXBadCurrentWindow = extEntry->errorBase + GLXBadCurrentWindow;
__glXBadRenderRequest = extEntry->errorBase + GLXBadRenderRequest;
__glXBadLargeRequest = extEntry->errorBase + GLXBadLargeRequest;
__glXUnsupportedPrivateRequest = extEntry->errorBase +
GLXUnsupportedPrivateRequest;
/*
** Initialize table of client state. There is never a client 0.
*/
for (i=1; i <= MAXCLIENTS; i++) {
__glXClients[i] = 0;
}
/*
** Initialize screen specific data.
*/
__glXScreenInit(screenInfo.numScreens);
}
/************************************************************************/
Bool __glXCoreType(void)
{
return __glXExt->type;
}
/************************************************************************/
void GlxSetVisualConfigs(int nconfigs,
__GLXvisualConfig *configs, void **privates)
{
(*__glXExt->setVisualConfigs)(nconfigs, configs, privates);
}
static miInitVisualsProcPtr saveInitVisualsProc;
Bool GlxInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
int *nvisualp, int *ndepthp,
int *rootDepthp, VisualID *defaultVisp,
unsigned long sizes, int bitsPerRGB,
int preferredVis)
{
Bool ret;
if (saveInitVisualsProc) {
ret = saveInitVisualsProc(visualp, depthp, nvisualp, ndepthp,
rootDepthp, defaultVisp, sizes, bitsPerRGB,
preferredVis);
if (!ret)
return False;
}
(*__glXExt->initVisuals)(visualp, depthp, nvisualp, ndepthp, rootDepthp,
defaultVisp, sizes, bitsPerRGB);
return True;
}
void
GlxWrapInitVisuals(miInitVisualsProcPtr *initVisProc)
{
saveInitVisualsProc = *initVisProc;
*initVisProc = GlxInitVisuals;
}
/************************************************************************/
void __glXFlushContextCache(void)
{
__glXLastContext = 0;
}
/*
** Make a context the current one for the GL (in this implementation, there
** is only one instance of the GL, and we use it to serve all GL clients by
** switching it between different contexts). While we are at it, look up
** a context by its tag and return its (__GLXcontext *).
*/
__GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag,
int *error)
{
__GLXcontext *cx;
/*
** See if the context tag is legal; it is managed by the extension,
** so if it's invalid, we have an implementation error.
*/
cx = (__GLXcontext *) __glXLookupContextByTag(cl, tag);
if (!cx) {
cl->client->errorValue = tag;
*error = __glXBadContextTag;
return 0;
}
if (!cx->isDirect) {
if (cx->glxPriv == NULL) {
/*
** The drawable has vanished. It must be a window, because only
** windows can be destroyed from under us; GLX pixmaps are
** refcounted and don't go away until no one is using them.
*/
*error = __glXBadCurrentWindow;
return 0;
}
}
if (cx == __glXLastContext) {
/* No need to re-bind */
return cx;
}
/* Make this context the current one for the GL. */
if (!cx->isDirect) {
if (!(*cx->gc->exports.forceCurrent)((__GLcontext *)cx->gc)) {
/* Bind failed, and set the error code. Bummer */
cl->client->errorValue = cx->id;
*error = __glXBadContextState;
return 0;
}
}
__glXLastContext = cx;
return cx;
}
/************************************************************************/
/*
** Top level dispatcher; all commands are executed from here down.
*/
static int __glXDispatch(ClientPtr client)
{
REQUEST(xGLXSingleReq);
CARD8 opcode;
int (*proc)(__GLXclientState *cl, GLbyte *pc);
__GLXclientState *cl;
opcode = stuff->glxCode;
cl = __glXClients[client->index];
if (!cl) {
cl = (__GLXclientState *) __glXMalloc(sizeof(__GLXclientState));
__glXClients[client->index] = cl;
if (!cl) {
return BadAlloc;
}
__glXMemset(cl, 0, sizeof(__GLXclientState));
}
if (!cl->inUse) {
/*
** This is first request from this client. Associate a resource
** with the client so we will be notified when the client dies.
*/
XID xid = FakeClientID(client->index);
if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) {
return BadAlloc;
}
ResetClientState(client->index);
cl->inUse = GL_TRUE;
cl->client = client;
}
/*
** Check for valid opcode.
*/
if (opcode >= __GLX_SINGLE_TABLE_SIZE) {
return BadRequest;
}
/*
** If we're expecting a glXRenderLarge request, this better be one.
*/
if ((cl->largeCmdRequestsSoFar != 0) && (opcode != X_GLXRenderLarge)) {
client->errorValue = stuff->glxCode;
return __glXBadLargeRequest;
}
/*
** Use the opcode to index into the procedure table.
*/
proc = __glXSingleTable[opcode];
return (*proc)(cl, (GLbyte *) stuff);
}
static int __glXSwapDispatch(ClientPtr client)
{
REQUEST(xGLXSingleReq);
CARD8 opcode;
int (*proc)(__GLXclientState *cl, GLbyte *pc);
__GLXclientState *cl;
opcode = stuff->glxCode;
cl = __glXClients[client->index];
if (!cl) {
cl = (__GLXclientState *) __glXMalloc(sizeof(__GLXclientState));
__glXClients[client->index] = cl;
if (!cl) {
return BadAlloc;
}
__glXMemset(cl, 0, sizeof(__GLXclientState));
}
if (!cl->inUse) {
/*
** This is first request from this client. Associate a resource
** with the client so we will be notified when the client dies.
*/
XID xid = FakeClientID(client->index);
if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) {
return BadAlloc;
}
ResetClientState(client->index);
cl->inUse = GL_TRUE;
cl->client = client;
}
/*
** Check for valid opcode.
*/
if (opcode >= __GLX_SINGLE_TABLE_SIZE) {
return BadRequest;
}
/*
** Use the opcode to index into the procedure table.
*/
proc = __glXSwapSingleTable[opcode];
return (*proc)(cl, (GLbyte *) stuff);
}
int __glXNoSuchSingleOpcode(__GLXclientState *cl, GLbyte *pc)
{
return BadRequest;
}
void __glXNoSuchRenderOpcode(GLbyte *pc)
{
return;
}

95
GL/glx/glxext.h Normal file
View File

@ -0,0 +1,95 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glxext.h,v 1.4 2001/03/21 16:29:36 dawes Exp $ */
#ifndef _glxext_h_
#define _glxext_h_
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
/*
* Added by VA Linux for XFree86 4.0.x
*/
typedef struct {
int type;
void (*resetExtension)(void);
Bool (*initVisuals)(
VisualPtr * visualp,
DepthPtr * depthp,
int * nvisualp,
int * ndepthp,
int * rootDepthp,
VisualID * defaultVisp,
unsigned long sizes,
int bitsPerRGB
);
void (*setVisualConfigs)(
int nconfigs,
__GLXvisualConfig *configs,
void **privates
);
} __GLXextensionInfo;
extern GLboolean __glXFreeContext(__GLXcontext *glxc);
extern void __glXFlushContextCache(void);
extern void __glXNoSuchRenderOpcode(GLbyte*);
extern int __glXNoSuchSingleOpcode(__GLXclientState*, GLbyte*);
extern void __glXErrorCallBack(__GLinterface *gc, GLenum code);
extern void __glXClearErrorOccured(void);
extern GLboolean __glXErrorOccured(void);
extern void __glXResetLargeCommandStatus(__GLXclientState*);
extern int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc);
extern int __glXSwapQueryContextInfoEXT(__GLXclientState *cl, char *pc);
extern void GlxExtensionInit(void);
extern Bool __glXCoreType(void);
extern int GlxInitVisuals(
#if NeedFunctionPrototypes
VisualPtr * visualp,
DepthPtr * depthp,
int * nvisualp,
int * ndepthp,
int * rootDepthp,
VisualID * defaultVisp,
unsigned long sizes,
int bitsPerRGB,
int preferredVis
#endif
);
#endif /* _glxext_h_ */

179
GL/glx/glxfb.c Normal file
View File

@ -0,0 +1,179 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glxfb.c,v 1.3 2001/03/21 16:29:36 dawes Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
/*
** An implementation of a buffer which is part of the front buffer
*/
#include "glxserver.h"
#include "glxutil.h"
#include "glxfb.h"
#include <gcstruct.h>
/* so we don't include glmath.h */
extern GLuint __glFloorLog2(GLuint);
typedef struct __GLFBbufferInfoRec {
GCPtr pGC;
} __GLFBbufferInfo;
extern PixmapPtr __glXPrivPixGetPtr(__GLdrawableBuffer *);
/* ---------------------------------------------------------- */
static GLboolean
Resize(__GLdrawableBuffer *buf,
GLint x, GLint y, GLuint width, GLuint height,
__GLdrawablePrivate *glPriv, GLuint bufferMask)
{
buf->width = width;
buf->height = height;
buf->byteWidth = width * buf->elementSize;
buf->outerWidth = width;
return GL_TRUE;
}
static void
Lock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
{
}
static void
Unlock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
{
}
/*
** Do a swap buffer with
** a memory surface as a back buffer
** a FB surface as a front buffer
*/
GLboolean
__glXFBMemSwapBuffers(__GLXdrawablePrivate *glxPriv)
{
__GLdrawablePrivate *glPriv = &glxPriv->glPriv;
__GLdrawableBuffer *front = &glPriv->frontBuffer;
__GLdrawableBuffer *back = &glPriv->backBuffer;
__GLFBbufferInfo *bufferInfo;
GCPtr pGC;
GLint width, height, depth, pad;
GLubyte *buf;
bufferInfo = (__GLFBbufferInfo *) front->other;
pGC = bufferInfo->pGC;
width = back->width;
height = back->height;
depth = back->depth;
buf = back->base;
pad = back->outerWidth - back->width; /* back buffer padding */
/* adjust buffer padding. X wants left, GL has right */
buf -= pad;
ValidateGC(glxPriv->pDraw, pGC);
(*pGC->ops->PutImage)(glxPriv->pDraw, pGC,
depth,
0, 0, width, height,
pad, ZPixmap,
(char *)buf);
return GL_TRUE;
}
static void
Free(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
{
__GLFBbufferInfo *bufferInfo;
bufferInfo = (__GLFBbufferInfo *) buf->other;
if (bufferInfo->pGC) {
FreeScratchGC(bufferInfo->pGC);
}
__glXFree(bufferInfo);
buf->other = NULL;
}
/*
** function to return the X GC of this buffer (to be used by DDX)
*/
GCPtr __glXFBGetGC(__GLdrawableBuffer *buf)
{
__GLFBbufferInfo *bufferInfo;
bufferInfo = (__GLFBbufferInfo *) buf->other;
if (bufferInfo) {
return bufferInfo->pGC;
} else {
return NULL;
}
}
void
__glXInitFB(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv, GLint bits)
{
__GLFBbufferInfo *bufferInfo;
__GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *) glPriv->other;
GCPtr pGC;
buf->depth = bits;
buf->width = buf->height = 0; /* to be filled during Update */
buf->handle = buf->base = NULL; /* to be filled during Update */
buf->size = 0;
buf->byteWidth = 0;
buf->elementSize = ((bits-1) / 8) + 1;
buf->elementSizeLog2 = __glFloorLog2(buf->elementSize);
buf->resize = Resize;
buf->lock = Lock;
buf->unlock = Unlock;
buf->fill = NULL;
buf->free = Free;
/* allocate local information */
bufferInfo = (__GLFBbufferInfo *) __glXMalloc(sizeof(__GLFBbufferInfo));
buf->other = (void *) bufferInfo;
pGC = CreateScratchGC(glxPriv->pDraw->pScreen,
glxPriv->pDraw->depth);
bufferInfo->pGC = pGC;
(*pGC->funcs->ChangeClip)(pGC, CT_NONE, NULL, 0);
}

48
GL/glx/glxfb.h Normal file
View File

@ -0,0 +1,48 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glxfb.h,v 1.3 2001/03/21 16:29:36 dawes Exp $ */
#ifndef _glxfb_h_
#define _glxfb_h_
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
extern void __glXInitFB(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
GLint bits);
extern GCPtr __glXFBGetGC(__GLdrawableBuffer *buf);
extern GLboolean __glXFBMemSwapBuffers(__GLXdrawablePrivate *glxPriv);
#endif /* _glxfb_h_ */

171
GL/glx/glximports.c Normal file
View File

@ -0,0 +1,171 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glximports.c,v 1.5 2001/03/21 16:29:36 dawes Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#include "glxserver.h"
#include "glxcontext.h"
#include "glximports.h"
#include "GL/glx_ansic.h"
void *__glXImpMalloc(__GLcontext *gc, size_t size)
{
void *addr;
if (size == 0) {
return NULL;
}
addr = xalloc(size);
if (addr == NULL) {
/* XXX: handle out of memory error */
return NULL;
}
return addr;
}
void *__glXImpCalloc(__GLcontext *gc, size_t numElements, size_t elementSize)
{
void *addr;
size_t size;
if ((numElements == 0) || (elementSize == 0)) {
return NULL;
}
size = numElements * elementSize;
addr = xalloc(size);
if (addr == NULL) {
/* XXX: handle out of memory error */
return NULL;
}
/* zero out memory */
__glXMemset(addr, 0, size);
return addr;
}
void __glXImpFree(__GLcontext *gc, void *addr)
{
if (addr) {
xfree(addr);
}
}
void *__glXImpRealloc(__GLcontext *gc, void *addr, size_t newSize)
{
void *newAddr;
if (addr) {
if (newSize == 0) {
xfree(addr);
return NULL;
}
newAddr = xrealloc(addr, newSize);
} else {
if (newSize == 0) {
return NULL;
}
newAddr = xalloc(newSize);
}
if (newAddr == NULL) {
return NULL; /* XXX: out of memory error */
}
return newAddr;
}
void __glXImpWarning(__GLcontext *gc, char *msg)
{
ErrorF((char *)msg);
}
void __glXImpFatal(__GLcontext *gc, char *msg)
{
ErrorF((char *)msg);
__glXAbort();
}
char *__glXImpGetenv(__GLcontext *gc, const char *var)
{
return __glXGetenv(var);
}
int __glXImpAtoi(__GLcontext *gc, const char *str)
{
return __glXAtoi(str);
}
int __glXImpSprintf(__GLcontext *gc, char *str, const char *fmt, ...)
{
va_list ap;
int ret;
/* have to deal with var args */
va_start(ap, fmt);
ret = __glXVsprintf(str, fmt, ap);
va_end(ap);
return ret;
}
void *__glXImpFopen(__GLcontext *gc, const char *path, const char *mode)
{
return (void *) __glXFopen(path, mode);
}
int __glXImpFclose(__GLcontext *gc, void *stream)
{
return __glXFclose((FILE *)stream);
}
int __glXImpFprintf(__GLcontext *gc, void *stream, const char *fmt, ...)
{
va_list ap;
int ret;
/* have to deal with var args */
va_start(ap, fmt);
ret = __glXVfprintf((FILE *)stream, fmt, ap);
va_end(ap);
return ret;
}
__GLdrawablePrivate *__glXImpGetDrawablePrivate(__GLcontext *gc)
{
__GLinterface *glci = (__GLinterface *) gc;
__GLXcontext *glrc = (__GLXcontext *) glci->imports.other;
return &glrc->glxPriv->glPriv;
}

61
GL/glx/glximports.h Normal file
View File

@ -0,0 +1,61 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glximports.h,v 1.3 2001/03/21 16:29:36 dawes Exp $ */
#ifndef _glximports_h_
#define _glximports_h_
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
extern void *__glXImpMalloc(__GLcontext *gc, size_t size);
extern void *__glXImpCalloc(__GLcontext *gc, size_t nElem, size_t eSize);
extern void *__glXImpRealloc(__GLcontext *gc, void *addr, size_t newSize);
extern void __glXImpFree(__GLcontext *gc, void *addr);
extern void __glXImpWarning(__GLcontext *gc, char *msg);
extern void __glXImpFatal(__GLcontext *gc, char *msg);
extern char *__glXImpGetenv(__GLcontext *gc, const char *var);
extern int __glXImpAtoi(__GLcontext *gc, const char *str);
extern int __glXImpSprintf(__GLcontext *gc, char *str, const char *fmt, ...);
extern void *__glXImpFopen(__GLcontext *gc, const char *path,
const char *mode);
extern int __glXImpFclose(__GLcontext *gc, void *stream);
extern int __glXImpFprintf(__GLcontext *gc, void *stream,
const char *fmt, ...);
extern __GLdrawablePrivate *__glXImpGetDrawablePrivate(__GLcontext *gc);
#endif /* _glximports_h_ */

147
GL/glx/glxmem.c Normal file
View File

@ -0,0 +1,147 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glxmem.c,v 1.7 2002/08/28 06:41:26 torrey Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
/*
** Implementation of a buffer in main memory
*/
#include "glxserver.h"
#include "glxmem.h"
#include "glxext.h"
#include "GL/internal/glcore.h"
/* don't want to include glmath.h */
extern GLuint __glFloorLog2(GLuint);
/* ---------------------------------------------------------- */
#define BUF_ALIGN 32 /* x86 cache alignment (used for assembly paths) */
#define BUF_ALIGN_MASK (BUF_ALIGN-1)
static GLboolean
Resize(__GLdrawableBuffer *buf,
GLint x, GLint y, GLuint width, GLuint height,
__GLdrawablePrivate *glPriv, GLuint bufferMask)
{
GLuint newSize;
void *ubase;
GLint pixelWidth;
GLint alignedWidth;
/*
** Note:
** buf->handle : unaligned base
** buf->base : aligned base
*/
pixelWidth = BUF_ALIGN / buf->elementSize;
alignedWidth = (width & ~(pixelWidth-1)) + pixelWidth;
newSize = alignedWidth * height * buf->elementSize;
/*
** Only allocate buffer space for the SGI core.
** Mesa and Aqua handle their own buffer allocations.
*/
#if defined(__GL_BUFFER_SIZE_TRACKS_WINDOW)
if (__glXCoreType() == GL_CORE_SGI) {
#else
if (newSize > buf->size && __glXCoreType() == GL_CORE_SGI) {
#endif
if (buf->handle) {
ubase = (*glPriv->realloc)(buf->handle, newSize + BUF_ALIGN_MASK);
if (ubase == NULL) {
return GL_FALSE;
}
} else {
ubase = (*glPriv->malloc)(newSize + BUF_ALIGN_MASK);
if (ubase == NULL) {
return GL_FALSE;
}
}
buf->size = newSize;
buf->handle = ubase;
buf->base = (void *)(((size_t)ubase + BUF_ALIGN_MASK) &
(unsigned int) ~BUF_ALIGN_MASK);
assert(((size_t)buf->base % BUF_ALIGN) == 0);
}
buf->width = width;
buf->height = height;
buf->byteWidth = alignedWidth * buf->elementSize;
buf->outerWidth = alignedWidth;
return GL_TRUE;
}
static void
Lock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
{
}
static void
Unlock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
{
}
static void
Free(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
{
if (buf->handle) {
(*glPriv->free)(buf->handle);
buf->handle = NULL;
}
}
void
__glXInitMem(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv, GLint bits)
{
buf->width = buf->height = 0; /* to be filled during Update */
buf->depth = bits;
buf->size = 0;
buf->handle = buf->base = NULL; /* to be filled during Update */
buf->byteWidth = 0;
buf->elementSize = ((bits - 1) / 8) + 1;
buf->elementSizeLog2 = __glFloorLog2(buf->elementSize);
buf->resize = Resize;
buf->lock = Lock;
buf->unlock = Unlock;
buf->fill = NULL;
buf->free = Free;
}

44
GL/glx/glxmem.h Normal file
View File

@ -0,0 +1,44 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glxmem.h,v 1.3 2001/03/21 16:29:36 dawes Exp $ */
#ifndef _glxmem_h_
#define _glxmem_h_
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
extern void __glXInitMem(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
GLint bits);
#endif /* _glxmem_h_ */

128
GL/glx/glxpix.c Normal file
View File

@ -0,0 +1,128 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glxpix.c,v 1.4 2001/03/21 16:29:36 dawes Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
/*
** An implementation of a glx pixmap buffer
*/
#include "glxserver.h"
#include "glxutil.h"
#include "glxpix.h"
#include <gcstruct.h>
/* don't want to include glmath.h */
extern GLuint __glFloorLog2(GLuint);
typedef struct __GLPixBufferInfoRec {
GCPtr pGC;
} __GLPixBufferInfo;
/* ---------------------------------------------------------- */
static GLboolean
Resize(__GLdrawableBuffer *buf,
GLint x, GLint y, GLuint width, GLuint height,
__GLdrawablePrivate *glPriv, GLuint bufferMask)
{
buf->width = width;
buf->height = width;
buf->byteWidth = width * buf->elementSize;
buf->outerWidth = width;
return GL_TRUE;
}
static void
Lock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
{
}
static void
Unlock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
{
}
static void
Free(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
{
__GLPixBufferInfo *bufferInfo;
if (LookupIDByType((XID)(long)buf->handle, __glXPixmapRes)) {
FreeResource((XID)(long)buf->handle, FALSE);
buf->handle = NULL;
}
bufferInfo = (__GLPixBufferInfo *) buf->other;
if (bufferInfo->pGC) {
FreeScratchGC(bufferInfo->pGC);
}
__glXFree(bufferInfo);
buf->other = NULL;
}
void
__glXInitPix(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
GLint bits, XID glxpixmapId, __GLXpixmap *pGlxPixmap)
{
__GLPixBufferInfo *bufferInfo;
buf->width = buf->height = 0; /* to be filled during Update */
buf->depth = bits;
buf->size = 0;
buf->base = NULL;
buf->byteWidth = 0;
buf->elementSize = ((bits-1) / 8) + 1;
buf->elementSizeLog2 = __glFloorLog2(buf->elementSize);
buf->handle = (void *)(long) glxpixmapId;
pGlxPixmap->refcnt++;
buf->resize = Resize;
buf->lock = Lock;
buf->unlock = Unlock;
buf->fill = NULL;
buf->free = Free;
/* allocate local information */
bufferInfo = (__GLPixBufferInfo *) __glXMalloc(sizeof(__GLPixBufferInfo));
buf->other = (void *) bufferInfo;
bufferInfo->pGC = CreateScratchGC(pGlxPixmap->pDraw->pScreen,
pGlxPixmap->pDraw->depth);
}

44
GL/glx/glxpix.h Normal file
View File

@ -0,0 +1,44 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glxpix.h,v 1.3 2001/03/21 16:29:36 dawes Exp $ */
#ifndef _glxpix_h_
#define _glxpix_h_
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
extern void __glXInitPix(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
GLint bits, XID glxpixmapId, __GLXpixmap *pGlxPixmap);
#endif /* _glxpix_h_ */

327
GL/glx/glxscreens.c Normal file
View File

@ -0,0 +1,327 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glxscreens.c,v 1.10 2002/04/04 14:05:36 eich Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#ifdef IN_MODULE
#include <xf86_ansic.h>
#else
#include <string.h>
#include <signal.h>
#endif
#include <windowstr.h>
#include "glxserver.h"
#include "glxutil.h"
static char GLServerExtensions[] =
"GL_ARB_imaging "
"GL_ARB_multitexture "
"GL_ARB_texture_border_clamp "
"GL_ARB_texture_cube_map "
"GL_ARB_texture_env_add "
"GL_ARB_texture_env_combine "
"GL_ARB_texture_env_dot3 "
"GL_ARB_transpose_matrix "
"GL_EXT_abgr "
"GL_EXT_blend_color "
"GL_EXT_blend_minmax "
"GL_EXT_blend_subtract "
"GL_EXT_texture_env_add "
"GL_EXT_texture_env_combine "
"GL_EXT_texture_env_dot3 "
"GL_EXT_texture_lod_bias "
;
/*
** We have made the simplifying assuption that the same extensions are
** supported across all screens in a multi-screen system.
*/
static char GLXServerVendorName[] = "SGI";
static char GLXServerVersion[] = "1.2";
static char GLXServerExtensions[] =
"GLX_EXT_visual_info "
"GLX_EXT_visual_rating "
"GLX_EXT_import_context "
;
/*
** This comes from the GL library that the server will link with. Right
** now, that is the DDX Sample OpenGL.
*/
extern __GLXscreenInfo __glDDXScreenInfo;
__GLXscreenInfo *__glXScreens[] = {
&__glDDXScreenInfo,
};
GLint __glXNumStaticScreens = (sizeof __glXScreens / sizeof __glXScreens[0]);
__GLXscreenInfo *__glXActiveScreens;
GLint __glXNumActiveScreens;
RESTYPE __glXDrawableRes;
static int
CountBits(unsigned long mask)
{
int count = 0;
while(mask) {
count += (mask&1);
mask >>= 1;
}
return count;
}
#if 0
/*
** A typical implementation would not probably not run through the screen's
** visuals to find ones that match the visual configs supplied by the DDX
** Sample OpenGL as we do here; we have done this to make this code easy to
** drop into an existing X server.
*/
static int matchVisuals(__GLXvisualConfig *pGlxVisual, int numVisuals,
int screen)
{
int i, j;
__GLXvisualConfig *pvis = pGlxVisual;
ScreenPtr pScreen = screenInfo.screens[screen];
VisualPtr pVisual;
int numMatchingVisuals = 0;
int *used;
used = (int *)__glXMalloc(pScreen->numVisuals*sizeof(int));
__glXMemset(used, 0, pScreen->numVisuals*sizeof(int));
for (i=0; i < numVisuals; i++, pvis++) {
/*
** Look through all the server's visuals to see which match.
*/
pvis->vid = 0;
pVisual = pScreen->visuals;
for (j=0; j < pScreen->numVisuals; j++, pVisual++) {
if (pvis->class == pVisual->class &&
pvis->bufferSize == pVisual->nplanes &&
!used[j]) {
int rBits, gBits, bBits, aBits;
/* count bits per rgb */
rBits = CountBits(pVisual->redMask);
gBits = CountBits(pVisual->greenMask);
bBits = CountBits(pVisual->blueMask);
aBits = 0;
if ((pvis->redSize == rBits) &&
(pvis->greenSize == gBits) &&
(pvis->blueSize == bBits) &&
(pvis->alphaSize == aBits)) {
/*
** We'll consider this a match.
*/
pvis->vid = pVisual->vid;
pvis->redMask = pVisual->redMask;
pvis->greenMask = pVisual->greenMask;
pvis->blueMask = pVisual->blueMask;
pvis->alphaMask = 0;
numMatchingVisuals++;
used[j] = 1;
break;
}
}
}
}
__glXFree(used);
return numMatchingVisuals;
}
#endif
/*
** Destroy routine that gets called when a drawable is freed. A drawable
** contains the ancillary buffers needed for rendering.
*/
static Bool DrawableGone(__GLXdrawablePrivate *glxPriv, XID xid)
{
__GLXcontext *cx, *cx1;
/*
** Use glxPriv->type to figure out what kind of drawable this is. Don't
** use glxPriv->pDraw->type because by the time this routine is called,
** the pDraw might already have been freed.
*/
if (glxPriv->type == DRAWABLE_WINDOW) {
/*
** When a window is destroyed, notify all context bound to
** it, that there are no longer bound to anything.
*/
for (cx = glxPriv->glxc; cx; cx = cx1) {
cx1 = cx->nextPriv;
cx->pendingState |= __GLX_PENDING_DESTROY;
}
}
/*
** set the size to 0, so that context that may still be using this
** drawable not do anything harmful
*/
glxPriv->xorigin = 0;
glxPriv->yorigin = 0;
glxPriv->width = 0;
glxPriv->height = 0;
__glXUnrefDrawablePrivate(glxPriv);
return True;
}
/*
** This hook gets called when a window moves or changes size.
*/
static Bool PositionWindow(WindowPtr pWin, int x, int y)
{
ScreenPtr pScreen;
__GLXcontext *glxc;
__GLXdrawablePrivate *glxPriv;
Bool ret;
/*
** Call wrapped position window routine
*/
pScreen = pWin->drawable.pScreen;
pScreen->PositionWindow =
__glXActiveScreens[pScreen->myNum].WrappedPositionWindow;
ret = (*pScreen->PositionWindow)(pWin, x, y);
pScreen->PositionWindow = PositionWindow;
/*
** Tell all contexts rendering into this window that the window size
** has changed.
*/
glxPriv = (__GLXdrawablePrivate *) LookupIDByType(pWin->drawable.id,
__glXDrawableRes);
if (glxPriv == NULL) {
/*
** This window is not being used by the OpenGL.
*/
return ret;
}
/*
** resize the drawable
*/
/* first change the drawable size */
if (__glXResizeDrawableBuffers(glxPriv) == GL_FALSE) {
/* resize failed! */
/* XXX: what can we possibly do here? */
ret = False;
}
/* mark contexts as needing resize */
glxc = NULL;
for (glxc = glxPriv->glxc; glxc; glxc = glxc->nextPriv) {
glxc->pendingState |= __GLX_PENDING_RESIZE;
}
return ret;
}
/*
** Wrap our own PositionWindow routine around the server's, so we can
** be notified when a window changes size
*/
static void wrapPositionWindow(int screen)
{
ScreenPtr pScreen = screenInfo.screens[screen];
__glXActiveScreens[screen].WrappedPositionWindow = pScreen->PositionWindow;
pScreen->PositionWindow = PositionWindow;
}
void __glXScreenInit(GLint numscreens)
{
GLint i,j;
/*
** This alloc has to work or else the server might as well core dump.
*/
__glXActiveScreens =
(__GLXscreenInfo *) __glXMalloc(sizeof(__GLXscreenInfo) * numscreens);
for (i=0; i < numscreens; i++) {
/*
** Probe each static screen to see which exists.
*/
for (j=0; j < __glXNumStaticScreens; j++) {
if ((*__glXScreens[j]->screenProbe)(i)) {
__glXActiveScreens[i] = *__glXScreens[j];
#if 0
/* we don't use this since matchVisuals doesn't allow alpha */
__glXActiveScreens[i].numUsableVisuals =
matchVisuals(__glXActiveScreens[i].pGlxVisual,
__glXActiveScreens[i].numVisuals, i);
#else
__glXActiveScreens[i].numUsableVisuals = __glXActiveScreens[i].numVisuals;
#endif
__glXActiveScreens[i].GLextensions = __glXStrdup(GLServerExtensions);
__glXActiveScreens[i].GLXvendor = __glXStrdup(GLXServerVendorName);
__glXActiveScreens[i].GLXversion = __glXStrdup(GLXServerVersion);
__glXActiveScreens[i].GLXextensions = __glXStrdup(GLXServerExtensions);
#ifdef X11R5
__glXDrawableRes = CreateNewResourceType(DrawableGone);
#else
__glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone);
#endif
wrapPositionWindow(i);
}
}
}
__glXNumActiveScreens = numscreens;
}
void __glXScreenReset(void)
{
int i;
for (i = 0; i < __glXNumActiveScreens; i++) {
__glXFree(__glXActiveScreens[i].GLXvendor);
__glXFree(__glXActiveScreens[i].GLXversion);
__glXFree(__glXActiveScreens[i].GLXextensions);
__glXFree(__glXActiveScreens[i].GLextensions);
}
xfree(__glXActiveScreens);
__glXActiveScreens = NULL;
__glXNumActiveScreens = 0;
}

95
GL/glx/glxscreens.h Normal file
View File

@ -0,0 +1,95 @@
#ifndef _GLX_screens_h_
#define _GLX_screens_h_
/* $XFree86: xc/programs/Xserver/GL/glx/glxscreens.h,v 1.5 2002/02/22 21:45:07 dawes Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
/* XXX: should be defined somewhere globally */
#define CAPI
#include "GL/internal/glcore.h"
/*
** Screen dependent data. These methods are the interface between the DIX
** and DDX layers of the GLX server extension. The methods provide an
** interface for context management on a screen.
*/
typedef struct {
/*
** Probe the screen and see if it supports GL rendering. It will
** return GL_FALSE if it doesn't, GL_TRUE otherwise.
*/
Bool (*screenProbe)(int screen);
/*
** Create a context using configuration information from modes.
** Use imports as callbacks back to the OS. Return an opaque handle
** on the context (NULL if failure).
*/
__GLinterface *(*createContext)(__GLimports *imports,
__GLcontextModes *modes,
__GLinterface *shareGC);
/*
** Create a buffer using information from glxPriv. This routine
** sets up any wrappers necessary to resize, swap or destroy the
** buffer.
*/
void (*createBuffer)(__GLXdrawablePrivate *glxPriv);
__GLXvisualConfig *pGlxVisual;
void **pVisualPriv;
GLint numVisuals;
GLint numUsableVisuals;
char *GLextensions;
char *GLXvendor;
char *GLXversion;
char *GLXextensions;
/*
** Things that are not statically set.
*/
Bool (*WrappedPositionWindow)(WindowPtr pWin, int x, int y);
} __GLXscreenInfo;
extern void __glXScreenInit(GLint);
extern void __glXScreenReset(void);
#endif /* !__GLX_screens_h__ */

282
GL/glx/glxserver.h Normal file
View File

@ -0,0 +1,282 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glxserver.h,v 1.4 2001/08/23 18:25:40 alanh Exp $ */
#ifndef _GLX_server_h_
#define _GLX_server_h_
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#include <X11/X.h>
#include <X11/Xproto.h>
#include <X11/Xmd.h>
#include <misc.h>
#include <dixstruct.h>
#include <pixmapstr.h>
#include <gcstruct.h>
#include <extnsionst.h>
#include <resource.h>
#include <scrnintstr.h>
#include "GL/glx_ansic.h"
/*
** The X header misc.h defines these math functions.
*/
#undef abs
#undef fabs
#define GL_GLEXT_PROTOTYPES /* we want prototypes */
#include <GL/gl.h>
#include <GL/glxproto.h>
#include <GL/glxint.h>
/* For glxscreens.h */
typedef struct __GLXdrawablePrivateRec __GLXdrawablePrivate;
#include "glxscreens.h"
#include "glxdrawable.h"
#include "glxcontext.h"
#include "glxerror.h"
#define GLX_SERVER_MAJOR_VERSION 1
#define GLX_SERVER_MINOR_VERSION 2
#ifndef True
#define True 1
#endif
#ifndef False
#define False 0
#endif
/*
** GLX resources.
*/
typedef XID GLXContextID;
typedef XID GLXPixmap;
typedef XID GLXDrawable;
typedef struct __GLXcontextRec *GLXContext;
typedef struct __GLXclientStateRec __GLXclientState;
extern __GLXscreenInfo *__glXActiveScreens;
extern GLint __glXNumActiveScreens;
/************************************************************************/
/*
** The last context used (from the server's persective) is cached.
*/
extern __GLXcontext *__glXLastContext;
extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*);
/*
** Macros to set, unset, and retrieve the flag that says whether a context
** has unflushed commands.
*/
#define __GLX_NOTE_UNFLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_TRUE
#define __GLX_NOTE_FLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_FALSE
#define __GLX_HAS_UNFLUSHED_CMDS(glxc) (glxc->hasUnflushedCommands)
/************************************************************************/
/*
** State kept per client.
*/
struct __GLXclientStateRec {
/*
** Whether this structure is currently being used to support a client.
*/
Bool inUse;
/*
** Buffer for returned data.
*/
GLbyte *returnBuf;
GLint returnBufSize;
/*
** Keep track of large rendering commands, which span multiple requests.
*/
GLint largeCmdBytesSoFar; /* bytes received so far */
GLint largeCmdBytesTotal; /* total bytes expected */
GLint largeCmdRequestsSoFar; /* requests received so far */
GLint largeCmdRequestsTotal; /* total requests expected */
GLbyte *largeCmdBuf;
GLint largeCmdBufSize;
/*
** Keep a list of all the contexts that are current for this client's
** threads.
*/
__GLXcontext **currentContexts;
GLint numCurrentContexts;
/* Back pointer to X client record */
ClientPtr client;
int GLClientmajorVersion;
int GLClientminorVersion;
char *GLClientextensions;
};
extern __GLXclientState *__glXClients[];
/************************************************************************/
/*
** Dispatch tables.
*/
typedef void (*__GLXdispatchRenderProcPtr)(GLbyte *);
typedef int (*__GLXdispatchSingleProcPtr)(__GLXclientState *, GLbyte *);
typedef int (*__GLXdispatchVendorPrivProcPtr)(__GLXclientState *, GLbyte *);
/*
* Dispatch for GLX commands.
*/
typedef int (*__GLXprocPtr)(__GLXclientState *, char *pc);
extern __GLXprocPtr __glXProcTable[];
/*
* Tables for computing the size of each rendering command.
*/
typedef struct {
int bytes;
int (*varsize)(GLbyte *pc, Bool swap);
} __GLXrenderSizeData;
extern __GLXrenderSizeData __glXRenderSizeTable[];
extern __GLXrenderSizeData __glXRenderSizeTable_EXT[];
/************************************************************************/
/*
** X resources.
*/
extern RESTYPE __glXContextRes;
extern RESTYPE __glXClientRes;
extern RESTYPE __glXPixmapRes;
extern RESTYPE __glXDrawableRes;
/************************************************************************/
/*
** Prototypes.
*/
extern char *__glXcombine_strings(const char *, const char *);
/*
** Routines for sending swapped replies.
*/
extern void __glXSwapMakeCurrentReply(ClientPtr client,
xGLXMakeCurrentReply *reply);
extern void __glXSwapIsDirectReply(ClientPtr client,
xGLXIsDirectReply *reply);
extern void __glXSwapQueryVersionReply(ClientPtr client,
xGLXQueryVersionReply *reply);
extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
xGLXQueryContextInfoEXTReply *reply,
int *buf);
extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
xGLXQueryExtensionsStringReply *reply, char *buf);
extern void glxSwapQueryServerStringReply(ClientPtr client,
xGLXQueryServerStringReply *reply, char *buf);
/*
* Routines for computing the size of variably-sized rendering commands.
*/
extern int __glXTypeSize(GLenum enm);
extern int __glXImageSize(GLenum format, GLenum type, GLsizei w, GLsizei h,
GLint rowLength, GLint skipRows, GLint alignment);
extern int __glXImage3DSize(GLenum format, GLenum type,
GLsizei w, GLsizei h, GLsizei d,
GLint imageHeight, GLint rowLength,
GLint skipImages, GLint skipRows,
GLint alignment);
extern int __glXCallListsReqSize(GLbyte *pc, Bool swap);
extern int __glXBitmapReqSize(GLbyte *pc, Bool swap);
extern int __glXFogfvReqSize(GLbyte *pc, Bool swap);
extern int __glXFogivReqSize(GLbyte *pc, Bool swap);
extern int __glXLightfvReqSize(GLbyte *pc, Bool swap);
extern int __glXLightivReqSize(GLbyte *pc, Bool swap);
extern int __glXLightModelfvReqSize(GLbyte *pc, Bool swap);
extern int __glXLightModelivReqSize(GLbyte *pc, Bool swap);
extern int __glXMaterialfvReqSize(GLbyte *pc, Bool swap);
extern int __glXMaterialivReqSize(GLbyte *pc, Bool swap);
extern int __glXTexParameterfvReqSize(GLbyte *pc, Bool swap);
extern int __glXTexParameterivReqSize(GLbyte *pc, Bool swap);
extern int __glXTexImage1DReqSize(GLbyte *pc, Bool swap);
extern int __glXTexImage2DReqSize(GLbyte *pc, Bool swap);
extern int __glXTexEnvfvReqSize(GLbyte *pc, Bool swap);
extern int __glXTexEnvivReqSize(GLbyte *pc, Bool swap);
extern int __glXTexGendvReqSize(GLbyte *pc, Bool swap);
extern int __glXTexGenfvReqSize(GLbyte *pc, Bool swap);
extern int __glXTexGenivReqSize(GLbyte *pc, Bool swap);
extern int __glXMap1dReqSize(GLbyte *pc, Bool swap);
extern int __glXMap1fReqSize(GLbyte *pc, Bool swap);
extern int __glXMap2dReqSize(GLbyte *pc, Bool swap);
extern int __glXMap2fReqSize(GLbyte *pc, Bool swap);
extern int __glXPixelMapfvReqSize(GLbyte *pc, Bool swap);
extern int __glXPixelMapuivReqSize(GLbyte *pc, Bool swap);
extern int __glXPixelMapusvReqSize(GLbyte *pc, Bool swap);
extern int __glXDrawPixelsReqSize(GLbyte *pc, Bool swap);
extern int __glXDrawArraysSize(GLbyte *pc, Bool swap);
extern int __glXPrioritizeTexturesReqSize(GLbyte *pc, Bool swap);
extern int __glXTexSubImage1DReqSize(GLbyte *pc, Bool swap);
extern int __glXTexSubImage2DReqSize(GLbyte *pc, Bool swap);
extern int __glXTexImage3DReqSize(GLbyte *pc, Bool swap );
extern int __glXTexSubImage3DReqSize(GLbyte *pc, Bool swap);
extern int __glXConvolutionFilter1DReqSize(GLbyte *pc, Bool swap);
extern int __glXConvolutionFilter2DReqSize(GLbyte *pc, Bool swap);
extern int __glXConvolutionParameterivReqSize(GLbyte *pc, Bool swap);
extern int __glXConvolutionParameterfvReqSize(GLbyte *pc, Bool swap);
extern int __glXSeparableFilter2DReqSize(GLbyte *pc, Bool swap);
extern int __glXColorTableReqSize(GLbyte *pc, Bool swap);
extern int __glXColorSubTableReqSize(GLbyte *pc, Bool swap);
extern int __glXColorTableParameterfvReqSize(GLbyte *pc, Bool swap);
extern int __glXColorTableParameterivReqSize(GLbyte *pc, Bool swap);
/*
* Routines for computing the size of returned data.
*/
extern int __glXConvolutionParameterivSize(GLenum pname);
extern int __glXConvolutionParameterfvSize(GLenum pname);
extern int __glXColorTableParameterfvSize(GLenum pname);
extern int __glXColorTableParameterivSize(GLenum pname);
#endif /* !__GLX_server_h__ */

527
GL/glx/glxutil.c Normal file
View File

@ -0,0 +1,527 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glxutil.c,v 1.5 2001/03/21 16:29:37 dawes Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#define NEED_REPLIES
#define FONT_PCF
#include "glxserver.h"
#include <GL/glxtokens.h>
#include <unpack.h>
#include <pixmapstr.h>
#include <windowstr.h>
#include "glxutil.h"
#include "glxbuf.h"
#include "GL/glx_ansic.h"
/************************************************************************/
void __glXNop(void) {}
/************************************************************************/
/* Memory Allocation for GLX */
void *
__glXMalloc(size_t size)
{
void *addr;
if (size == 0) {
return NULL;
}
addr = (void *) xalloc(size);
if (addr == NULL) {
/* XXX: handle out of memory error */
return NULL;
}
return addr;
}
void *
__glXCalloc(size_t numElements, size_t elementSize)
{
void *addr;
size_t size;
if ((numElements == 0) || (elementSize == 0)) {
return NULL;
}
size = numElements * elementSize;
addr = (void *) xalloc(size);
if (addr == NULL) {
/* XXX: handle out of memory error */
return NULL;
}
__glXMemset(addr, 0, size);
return addr;
}
void *
__glXRealloc(void *addr, size_t newSize)
{
void *newAddr;
if (addr) {
if (newSize == 0) {
xfree(addr);
return NULL;
} else {
newAddr = xrealloc(addr, newSize);
}
} else {
if (newSize == 0) {
return NULL;
} else {
newAddr = xalloc(newSize);
}
}
if (newAddr == NULL) {
return NULL; /* XXX: out of memory */
}
return newAddr;
}
void
__glXFree(void *addr)
{
if (addr) {
xfree(addr);
}
}
/************************************************************************/
/* Context stuff */
/*
** associate a context with a drawable
*/
void
__glXAssociateContext(__GLXcontext *glxc, __GLXdrawablePrivate *glxPriv)
{
glxc->nextPriv = glxPriv->glxc;
glxPriv->glxc = glxc;
__glXRefDrawablePrivate(glxPriv);
}
/*
** Deassociate a context from a drawable
*/
void
__glXDeassociateContext(__GLXcontext *glxc, __GLXdrawablePrivate *glxPriv)
{
__GLXcontext *glxc1, *glxc2;
glxc2 = NULL;
for (glxc1=glxPriv->glxc; glxc1; glxc2=glxc1, glxc1=glxc1->nextPriv) {
if (glxc1 == glxc) {
/* found context. Deassociate. */
if (glxc2 == NULL) {
glxPriv->glxc = glxc1->nextPriv;
} else {
glxc2->nextPriv = glxc1->nextPriv;
}
glxc1->nextPriv = NULL;
__glXUnrefDrawablePrivate(glxPriv);
break;
}
}
}
/************************************************************************/
void
__glXGetDrawableSize(__GLdrawablePrivate *glPriv,
GLint *x, GLint *y, GLuint *width, GLuint *height)
{
__GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other;
if (glxPriv) {
*x = glxPriv->xorigin;
*y = glxPriv->yorigin;
*width = glxPriv->width;
*height = glxPriv->height;
} else {
*x = *y = *width = *height = 0;
}
}
GLboolean
__glXResizeDrawable(__GLdrawablePrivate *glPriv)
{
/* nothing to be done here */
return GL_TRUE;
}
/************************************************************************/
void
__glXFormatGLModes(__GLcontextModes *modes, __GLXvisualConfig *config)
{
__glXMemset(modes, 0, sizeof(__GLcontextModes));
modes->rgbMode = (config->rgba != 0);
modes->colorIndexMode = !(modes->rgbMode);
modes->doubleBufferMode = (config->doubleBuffer != 0);
modes->stereoMode = (config->stereo != 0);
modes->haveAccumBuffer = ((config->accumRedSize +
config->accumGreenSize +
config->accumBlueSize +
config->accumAlphaSize) > 0);
modes->haveDepthBuffer = (config->depthSize > 0);
modes->haveStencilBuffer = (config->stencilSize > 0);
modes->redBits = config->redSize;
modes->greenBits = config->greenSize;
modes->blueBits = config->blueSize;
modes->alphaBits = config->alphaSize;
modes->redMask = config->redMask;
modes->greenMask = config->greenMask;
modes->blueMask = config->blueMask;
modes->alphaMask = config->alphaMask;
#if 0
modes->rgbBits = modes->redBits + modes->greenBits +
modes->blueBits + modes->alphaBits;
#endif
assert( !modes->rgbMode || ((config->bufferSize & 0x7) == 0) );
modes->rgbBits = config->bufferSize;
modes->indexBits = config->bufferSize;
modes->accumRedBits = config->accumRedSize;
modes->accumGreenBits = config->accumGreenSize;
modes->accumBlueBits = config->accumBlueSize;
modes->accumAlphaBits = config->accumAlphaSize;
modes->depthBits = config->depthSize;
modes->stencilBits = config->stencilSize;
modes->numAuxBuffers = 0; /* XXX: should be picked up from the visual */
modes->level = config->level;
}
/*****************************************************************************/
/* accessing the drawable private */
static void
LockDP(__GLdrawablePrivate *glPriv, __GLcontext *gc)
{
__GLinterface *glci = (__GLinterface *) gc;
__GLXcontext *glxc = (__GLXcontext *) glci->imports.other;
/* quick exit test */
if ((glxc->pendingState &
(__GLX_PENDING_RESIZE |
__GLX_PENDING_DESTROY |
__GLX_PENDING_SWAP)) == 0x0)
return;
/* some pending state. Deal with it */
if (glxc->pendingState & __GLX_PENDING_RESIZE) {
glxc->pendingState &= ~__GLX_PENDING_RESIZE;
(*glci->exports.notifyResize)(gc);
assert((glxc->pendingState & __GLX_PENDING_RESIZE) == 0x0);
}
if (glxc->pendingState & __GLX_PENDING_DESTROY) {
__GLXdrawablePrivate *glxPriv = glxc->glxPriv;
glxc->pendingState &= ~__GLX_PENDING_DESTROY;
assert(glxPriv->xorigin == 0);
assert(glxPriv->yorigin == 0);
assert(glxPriv->width == 0);
assert(glxPriv->height == 0);
(*glci->exports.notifyDestroy)(gc);
__glXDeassociateContext(glxc, glxPriv);
assert((glxc->pendingState & __GLX_PENDING_DESTROY) == 0x0);
}
if (glxc->pendingState & __GLX_PENDING_SWAP) {
glxc->pendingState &= ~__GLX_PENDING_SWAP;
(*glci->exports.notifySwapBuffers)(gc);
assert((glxc->pendingState & __GLX_PENDING_SWAP) == 0x0);
}
}
static void
UnlockDP(__GLdrawablePrivate *glPriv)
{
}
/*****************************************************************************/
/* Drawable private stuff */
void
__glXRefDrawablePrivate(__GLXdrawablePrivate *glxPriv)
{
glxPriv->refCount++;
}
void
__glXUnrefDrawablePrivate(__GLXdrawablePrivate *glxPriv)
{
glxPriv->refCount--;
if (glxPriv->refCount == 0) {
__glXDestroyDrawablePrivate(glxPriv);
}
}
__GLXdrawablePrivate *
__glXCreateDrawablePrivate(DrawablePtr pDraw, XID drawId,
__GLcontextModes *modes)
{
__GLXdrawablePrivate *glxPriv;
__GLdrawablePrivate *glPriv;
__GLXscreenInfo *pGlxScreen;
glxPriv = (__GLXdrawablePrivate *) __glXMalloc(sizeof(*glxPriv));
__glXMemset(glxPriv, 0, sizeof(__GLXdrawablePrivate));
glxPriv->type = pDraw->type;
glxPriv->pDraw = pDraw;
glxPriv->drawId = drawId;
/* if not a pixmap, lookup will fail, so pGlxPixmap will be NULL */
glxPriv->pGlxPixmap = (__GLXpixmap *)
LookupIDByType(drawId, __glXPixmapRes);
/* since we are creating the drawablePrivate, drawId should be new */
if (!AddResource(drawId, __glXDrawableRes, glxPriv)) {
/* oops! */
__glXFree(glxPriv);
return NULL;
}
/* fill up glPriv */
glPriv = &glxPriv->glPriv;
glPriv->modes = (__GLcontextModes *) __glXMalloc(sizeof(__GLcontextModes));
*glPriv->modes = *modes;
glPriv->malloc = __glXMalloc;
glPriv->calloc = __glXCalloc;
glPriv->realloc = __glXRealloc;
glPriv->free = __glXFree;
glPriv->addSwapRect = NULL;
glPriv->setClipRect = (void (*)(__GLdrawablePrivate *, GLint, GLint, GLsizei, GLsizei)) __glXNop;
glPriv->lockDP = LockDP;
glPriv->unlockDP = UnlockDP;
glPriv->getDrawableSize = __glXGetDrawableSize;
glPriv->resize = __glXResizeDrawable;
glPriv->other = glxPriv;
/* allocate a one-rect ownership region */
glPriv->ownershipRegion.rects =
(__GLregionRect *)__glXCalloc(1, sizeof(__GLregionRect));
glPriv->ownershipRegion.numRects = 1;
glxPriv->freeBuffers = __glXFreeBuffers;
glxPriv->updatePalette = (void (*)(__GLXdrawablePrivate *)) __glXNop;
pGlxScreen = &__glXActiveScreens[pDraw->pScreen->myNum];
/* allocate the buffers */
if (glxPriv->type == DRAWABLE_WINDOW) {
int i;
VisualID vid = wVisual((WindowPtr)pDraw);
__GLXvisualConfig *pGlxVisual = pGlxScreen->pGlxVisual;
for (i = 0; i < pGlxScreen->numVisuals; i++, pGlxVisual++) {
if (pGlxVisual->vid == vid) {
glxPriv->pGlxVisual = pGlxVisual;
break;
}
}
__glXFBInitDrawable(glxPriv, modes);
} else {
glxPriv->pGlxVisual = glxPriv->pGlxPixmap->pGlxVisual;
__glXPixInitDrawable(glxPriv, modes);
}
/* initialize the core's private buffer information */
(*pGlxScreen->createBuffer)(glxPriv);
return glxPriv;
}
GLboolean
__glXDestroyDrawablePrivate(__GLXdrawablePrivate *glxPriv)
{
__GLdrawablePrivate *glPriv = &glxPriv->glPriv;
/* remove the drawable from the drawable list */
FreeResourceByType(glxPriv->drawId, __glXDrawableRes, FALSE);
/* Have the core free any memory it may have attached to the drawable */
if (glPriv->freePrivate) {
(*glPriv->freePrivate)(glPriv);
}
/* Free any framebuffer memory attached to the drawable */
if (glxPriv->freeBuffers) {
(*glxPriv->freeBuffers)(glxPriv);
}
/* Free the drawable Private */
__glXFree(glxPriv->glPriv.modes);
__glXFree(glxPriv->glPriv.ownershipRegion.rects);
__glXFree(glxPriv);
return GL_TRUE;
}
__GLXdrawablePrivate *
__glXFindDrawablePrivate(XID drawId)
{
__GLXdrawablePrivate *glxPriv;
glxPriv = (__GLXdrawablePrivate *)LookupIDByType(drawId, __glXDrawableRes);
return glxPriv;
}
__GLXdrawablePrivate *
__glXGetDrawablePrivate(DrawablePtr pDraw, XID drawId,
__GLcontextModes *modes)
{
__GLXdrawablePrivate *glxPriv;
glxPriv = __glXFindDrawablePrivate(drawId);
if (glxPriv == NULL) {
glxPriv = __glXCreateDrawablePrivate(pDraw, drawId, modes);
if (glxPriv) {
__glXRefDrawablePrivate(glxPriv);
}
}
return glxPriv;
}
void
__glXCacheDrawableSize(__GLXdrawablePrivate *glxPriv)
{
if (glxPriv) {
if (glxPriv->pDraw) {
glxPriv->xorigin = glxPriv->pDraw->x;
glxPriv->yorigin = glxPriv->pDraw->y;
glxPriv->width = glxPriv->pDraw->width;
glxPriv->height = glxPriv->pDraw->height;
}
}
}
/*
** resize/move the drawable. Called during the actual resize callback
** to update the drawable side of the buffers
*/
GLboolean
__glXResizeDrawableBuffers(__GLXdrawablePrivate *glxPriv)
{
__GLdrawablePrivate *glPriv = &glxPriv->glPriv;
GLint x, y;
GLuint w, h;
#if defined(__GL_ALIGNED_BUFFERS)
GLint xAlignment, yAlignment;
GLint xOffset, yOffset;
GLint xStart, xEnd;
GLint yStart, yEnd;
GLuint xAlignedMask, yAlignedMask;
#endif
GLboolean status = GL_TRUE;
__glXCacheDrawableSize(glxPriv);
w = glxPriv->width;
h = glxPriv->height;
x = glxPriv->xorigin;
y = glxPriv->yorigin;
#if defined(__GL_ALIGNED_BUFFERS)
xAlignment = glPriv->xAlignment;
yAlignment = glPriv->yAlignment;
xOffset = x & (xAlignment-1);
yOffset = y & (yAlignment-1);
xAlignedMask = ~(xAlignment-1);
yAlignedMask = ~(yAlignment-1);
xStart = x; xEnd = x+w;
yStart = y; yEnd = y+h;
xStart &= xAlignedMask;
if (xEnd & ~xAlignedMask) {
xEnd = (xEnd&xAlignedMask) + xAlignment;
}
yStart &= yAlignedMask;
if (yEnd & ~yAlignedMask) {
yEnd = (yEnd&yAlignedMask) + yAlignment;
}
x = xStart; y = yStart;
w = xEnd-xStart; h = yEnd-yStart;
#endif
if ((x != glPriv->xOrigin) ||
(y != glPriv->yOrigin) ||
#if defined(__GL_ALIGNED_BUFFERS)
(xOffset != glPriv->xOffset) ||
(yOffset != glPriv->yOffset) ||
#endif
(w != glPriv->width) ||
(h != glPriv->height) ||
(!w && !h)) {
/* set up the glPriv info */
glPriv->width = w;
glPriv->height = h;
glPriv->xOrigin = x;
glPriv->yOrigin = y;
#if defined(__GL_ALIGNED_BUFFERS)
glPriv->xOffset = xOffset;
glPriv->yOffset = yOffset;
#endif
/* notify the buffers */
status = __glXResizeBuffers(glPriv, x, y, w, h);
}
return status;
}
/************************************************************************/

78
GL/glx/glxutil.h Normal file
View File

@ -0,0 +1,78 @@
/* $XFree86: xc/programs/Xserver/GL/glx/glxutil.h,v 1.3 2001/03/21 16:29:37 dawes Exp $ */
#ifndef _glxcmds_h_
#define _glxcmds_h_
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
extern void __glXNop(void);
/* memory management */
extern void *__glXMalloc(size_t size);
extern void *__glXCalloc(size_t numElements, size_t elementSize);
extern void *__glXRealloc(void *addr, size_t newSize);
extern void __glXFree(void *ptr);
/* relate contexts with drawables */
extern void __glXAssociateContext(__GLXcontext *glxc, __GLXdrawablePrivate *glxPriv);
extern void __glXDeassociateContext(__GLXcontext *glxc, __GLXdrawablePrivate *glxPriv);
/* drawable operation */
extern void __glXGetDrawableSize(__GLdrawablePrivate *glPriv,
GLint *x, GLint *y,
GLuint *width, GLuint *height);
extern GLboolean __glXResizeDrawable(__GLdrawablePrivate *glPriv);
extern GLboolean __glXResizeDrawableBuffers(__GLXdrawablePrivate *glxPriv);
extern void __glXFormatGLModes(__GLcontextModes *modes, __GLXvisualConfig *config);
/* drawable management */
extern void __glXRefDrawablePrivate(__GLXdrawablePrivate *glxPriv);
extern void __glXUnrefDrawablePrivate(__GLXdrawablePrivate *glxPriv);
extern __GLXdrawablePrivate *__glXCreateDrawablePrivate(DrawablePtr pDraw,
XID glxpixmapId,
__GLcontextModes *modes);
extern GLboolean __glXDestroyDrawablePrivate(__GLXdrawablePrivate *glxPriv);
extern __GLXdrawablePrivate *__glXFindDrawablePrivate(XID glxpixmapId);
extern __GLXdrawablePrivate *__glXGetDrawablePrivate(DrawablePtr pDraw,
XID glxpixmapId,
__GLcontextModes *modes);
extern void __glXCacheDrawableSize(__GLXdrawablePrivate *glxPriv);
/* context helper routines */
extern __GLXcontext *__glXLookupContextByTag(__GLXclientState*, GLXContextTag);
#endif /* _glxcmds_h_ */

70
GL/glx/impsize.h Normal file
View File

@ -0,0 +1,70 @@
/* $XFree86: xc/programs/Xserver/GL/glx/impsize.h,v 1.3 2001/03/21 16:29:37 dawes Exp $ */
#ifndef _impsize_h_
#define _impsize_h_
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
/*
** These are defined in libsampleGL.a. They are not technically part of
** the defined interface between libdixGL.a and libsampleGL.a (that interface
** being the functions in the __glXScreenInfo structure, plus the OpenGL API
** itself), but we thought it was better to call these routines than to
** replicate the code in here.
*/
extern int __glCallLists_size(GLsizei n, GLenum type);
extern int __glColorTableParameterfv_size(GLenum pname);
extern int __glColorTableParameteriv_size(GLenum pname);
extern int __glConvolutionParameterfv_size(GLenum pname);
extern int __glConvolutionParameteriv_size(GLenum pname);
extern int __glDrawPixels_size(GLenum format, GLenum type, GLsizei w,GLsizei h);
extern int __glFogfv_size(GLenum pname);
extern int __glFogiv_size(GLenum pname);
extern int __glLightModelfv_size(GLenum pname);
extern int __glLightModeliv_size(GLenum pname);
extern int __glLightfv_size(GLenum pname);
extern int __glLightiv_size(GLenum pname);
extern int __glMaterialfv_size(GLenum pname);
extern int __glMaterialiv_size(GLenum pname);
extern int __glTexEnvfv_size(GLenum e);
extern int __glTexEnviv_size(GLenum e);
extern int __glTexGendv_size(GLenum e);
extern int __glTexGenfv_size(GLenum e);
extern int __glTexGeniv_size(GLenum pname);
extern int __glTexParameterfv_size(GLenum e);
extern int __glTexParameteriv_size(GLenum e);
extern int __glEvalComputeK(GLenum target);
#endif /* _impsize_h_ */

245
GL/glx/render2.c Normal file
View File

@ -0,0 +1,245 @@
/* $XFree86: xc/programs/Xserver/GL/glx/render2.c,v 1.5 2001/03/21 16:29:37 dawes Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
/* #define NEED_REPLIES */
#include <glxserver.h>
#include "unpack.h"
#include "g_disptab.h"
#include "g_disptab_EXT.h"
extern GLint __glEvalComputeK(GLenum target);
void __glXDisp_Map1f(GLbyte *pc)
{
GLint order, k;
GLfloat u1, u2, *points;
GLenum target;
target = *(GLenum *)(pc + 0);
order = *(GLint *)(pc + 12);
u1 = *(GLfloat *)(pc + 4);
u2 = *(GLfloat *)(pc + 8);
points = (GLfloat *)(pc + 16);
k = __glEvalComputeK(target);
glMap1f(target, u1, u2, k, order, points);
}
void __glXDisp_Map2f(GLbyte *pc)
{
GLint uorder, vorder, ustride, vstride, k;
GLfloat u1, u2, v1, v2, *points;
GLenum target;
target = *(GLenum *)(pc + 0);
uorder = *(GLint *)(pc + 12);
vorder = *(GLint *)(pc + 24);
u1 = *(GLfloat *)(pc + 4);
u2 = *(GLfloat *)(pc + 8);
v1 = *(GLfloat *)(pc + 16);
v2 = *(GLfloat *)(pc + 20);
points = (GLfloat *)(pc + 28);
k = __glEvalComputeK(target);
ustride = vorder * k;
vstride = k;
glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
}
void __glXDisp_Map1d(GLbyte *pc)
{
GLint order, k, compsize;
GLenum target;
GLdouble u1, u2, *points;
target = *(GLenum*) (pc + 16);
order = *(GLint*) (pc + 20);
k = __glEvalComputeK(target);
if (order < 0 || k < 0) {
compsize = 0;
} else {
compsize = order * k;
}
__GLX_GET_DOUBLE(u1,pc);
__GLX_GET_DOUBLE(u2,pc+8);
pc += 24;
#ifdef __GLX_ALIGN64
if (((unsigned long)pc) & 7) {
/*
** Copy the doubles up 4 bytes, trashing the command but aligning
** the data in the process
*/
__GLX_MEM_COPY(pc-4, pc, compsize*8);
points = (GLdouble*) (pc - 4);
} else {
points = (GLdouble*) pc;
}
#else
points = (GLdouble*) pc;
#endif
glMap1d(target, u1, u2, k, order, points);
}
void __glXDisp_Map2d(GLbyte *pc)
{
GLdouble u1, u2, v1, v2, *points;
GLint uorder, vorder, ustride, vstride, k, compsize;
GLenum target;
target = *(GLenum *)(pc + 32);
uorder = *(GLint *)(pc + 36);
vorder = *(GLint *)(pc + 40);
k = __glEvalComputeK(target);
if (vorder < 0 || uorder < 0 || k < 0) {
compsize = 0;
} else {
compsize = uorder * vorder * k;
}
__GLX_GET_DOUBLE(u1,pc);
__GLX_GET_DOUBLE(u2,pc+8);
__GLX_GET_DOUBLE(v1,pc+16);
__GLX_GET_DOUBLE(v2,pc+24);
pc += 44;
ustride = vorder * k;
vstride = k;
#ifdef __GLX_ALIGN64
if (((unsigned long)pc) & 7) {
/*
** Copy the doubles up 4 bytes, trashing the command but aligning
** the data in the process
*/
__GLX_MEM_COPY(pc-4, pc, compsize*8);
points = (GLdouble*) (pc - 4);
} else {
points = (GLdouble*) pc;
}
#else
points = (GLdouble*) pc;
#endif
glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
}
void __glXDisp_CallLists(GLbyte *pc)
{
GLenum type;
GLsizei n;
type = *(GLenum *)(pc + 4);
n = *(GLsizei *)(pc + 0);
glCallLists(n, type, pc + 8);
}
void __glXDisp_DrawArrays(GLbyte *pc)
{
__GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc;
__GLXdispatchDrawArraysComponentHeader *compHeader;
GLint numVertexes = hdr->numVertexes;
GLint numComponents = hdr->numComponents;
GLenum primType = hdr->primType;
GLint stride = 0;
int i;
pc += sizeof(__GLXdispatchDrawArraysHeader);
compHeader = (__GLXdispatchDrawArraysComponentHeader *)pc;
/* compute stride (same for all component arrays) */
for (i = 0; i < numComponents; i++) {
GLenum datatype = compHeader[i].datatype;
GLint numVals = compHeader[i].numVals;
stride += __GLX_PAD(numVals * __glXTypeSize(datatype));
}
pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader);
/* set up component arrays */
for (i = 0; i < numComponents; i++) {
GLenum datatype = compHeader[i].datatype;
GLint numVals = compHeader[i].numVals;
GLenum component = compHeader[i].component;
switch (component) {
case GL_VERTEX_ARRAY:
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(numVals, datatype, stride, pc);
break;
case GL_NORMAL_ARRAY:
glEnableClientState(GL_NORMAL_ARRAY);
glNormalPointer(datatype, stride, pc);
break;
case GL_COLOR_ARRAY:
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(numVals, datatype, stride, pc);
break;
case GL_INDEX_ARRAY:
glEnableClientState(GL_INDEX_ARRAY);
glIndexPointer(datatype, stride, pc);
break;
case GL_TEXTURE_COORD_ARRAY:
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(numVals, datatype, stride, pc);
break;
case GL_EDGE_FLAG_ARRAY:
glEnableClientState(GL_EDGE_FLAG_ARRAY);
glEdgeFlagPointer(stride, (const GLboolean *)pc);
break;
default:
break;
}
pc += __GLX_PAD(numVals * __glXTypeSize(datatype));
}
glDrawArrays(primType, 0, numVertexes);
/* turn off anything we might have turned on */
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_INDEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_EDGE_FLAG_ARRAY);
}
void __glXDisp_DrawArraysEXT(GLbyte *pc)
{
#ifdef XXX_STUB
#endif /*XXX_STUB*/
}

391
GL/glx/render2swap.c Normal file
View File

@ -0,0 +1,391 @@
/* $XFree86: xc/programs/Xserver/GL/glx/render2swap.c,v 1.6 2002/01/14 22:47:08 tsi Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
/* #define NEED_REPLIES */
#include "glxserver.h"
#include "unpack.h"
#include "g_disptab.h"
#include "g_disptab_EXT.h"
extern GLint __glEvalComputeK(GLenum target);
void __glXDispSwap_Map1f(GLbyte *pc)
{
GLint order, k;
GLfloat u1, u2, *points;
GLenum target;
GLint compsize;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_INT(pc + 0);
__GLX_SWAP_INT(pc + 12);
__GLX_SWAP_FLOAT(pc + 4);
__GLX_SWAP_FLOAT(pc + 8);
target = *(GLenum *)(pc + 0);
order = *(GLint *)(pc + 12);
u1 = *(GLfloat *)(pc + 4);
u2 = *(GLfloat *)(pc + 8);
points = (GLfloat *)(pc + 16);
k = __glEvalComputeK(target);
if (order <= 0 || k < 0) {
/* Erroneous command. */
compsize = 0;
} else {
compsize = order * k;
}
__GLX_SWAP_FLOAT_ARRAY(points, compsize);
glMap1f(target, u1, u2, k, order, points);
}
void __glXDispSwap_Map2f(GLbyte *pc)
{
GLint uorder, vorder, ustride, vstride, k;
GLfloat u1, u2, v1, v2, *points;
GLenum target;
GLint compsize;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_INT(pc + 0);
__GLX_SWAP_INT(pc + 12);
__GLX_SWAP_INT(pc + 24);
__GLX_SWAP_FLOAT(pc + 4);
__GLX_SWAP_FLOAT(pc + 8);
__GLX_SWAP_FLOAT(pc + 16);
__GLX_SWAP_FLOAT(pc + 20);
target = *(GLenum *)(pc + 0);
uorder = *(GLint *)(pc + 12);
vorder = *(GLint *)(pc + 24);
u1 = *(GLfloat *)(pc + 4);
u2 = *(GLfloat *)(pc + 8);
v1 = *(GLfloat *)(pc + 16);
v2 = *(GLfloat *)(pc + 20);
points = (GLfloat *)(pc + 28);
k = __glEvalComputeK(target);
ustride = vorder * k;
vstride = k;
if (vorder <= 0 || uorder <= 0 || k < 0) {
/* Erroneous command. */
compsize = 0;
} else {
compsize = uorder * vorder * k;
}
__GLX_SWAP_FLOAT_ARRAY(points, compsize);
glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
}
void __glXDispSwap_Map1d(GLbyte *pc)
{
GLint order, k, compsize;
GLenum target;
GLdouble u1, u2, *points;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_DOUBLE(pc + 0);
__GLX_SWAP_DOUBLE(pc + 8);
__GLX_SWAP_INT(pc + 16);
__GLX_SWAP_INT(pc + 20);
target = *(GLenum*) (pc + 16);
order = *(GLint*) (pc + 20);
k = __glEvalComputeK(target);
if (order <= 0 || k < 0) {
/* Erroneous command. */
compsize = 0;
} else {
compsize = order * k;
}
__GLX_GET_DOUBLE(u1,pc);
__GLX_GET_DOUBLE(u2,pc+8);
__GLX_SWAP_DOUBLE_ARRAY(pc+24, compsize);
pc += 24;
#ifdef __GLX_ALIGN64
if (((unsigned long)pc) & 7) {
/*
** Copy the doubles up 4 bytes, trashing the command but aligning
** the data in the process
*/
__GLX_MEM_COPY(pc-4, pc, compsize*8);
points = (GLdouble*) (pc - 4);
} else {
points = (GLdouble*) pc;
}
#else
points = (GLdouble*) pc;
#endif
glMap1d(target, u1, u2, k, order, points);
}
void __glXDispSwap_Map2d(GLbyte *pc)
{
GLdouble u1, u2, v1, v2, *points;
GLint uorder, vorder, ustride, vstride, k, compsize;
GLenum target;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_DOUBLE(pc + 0);
__GLX_SWAP_DOUBLE(pc + 8);
__GLX_SWAP_DOUBLE(pc + 16);
__GLX_SWAP_DOUBLE(pc + 24);
__GLX_SWAP_INT(pc + 32);
__GLX_SWAP_INT(pc + 36);
__GLX_SWAP_INT(pc + 40);
target = *(GLenum *)(pc + 32);
uorder = *(GLint *)(pc + 36);
vorder = *(GLint *)(pc + 40);
k = __glEvalComputeK(target);
if (vorder <= 0 || uorder <= 0 || k < 0) {
/* Erroneous command. */
compsize = 0;
} else {
compsize = uorder * vorder * k;
}
__GLX_GET_DOUBLE(u1,pc);
__GLX_GET_DOUBLE(u2,pc+8);
__GLX_GET_DOUBLE(v1,pc+16);
__GLX_GET_DOUBLE(v2,pc+24);
__GLX_SWAP_DOUBLE_ARRAY(pc+44, compsize);
pc += 44;
ustride = vorder * k;
vstride = k;
#ifdef __GLX_ALIGN64
if (((unsigned long)pc) & 7) {
/*
** Copy the doubles up 4 bytes, trashing the command but aligning
** the data in the process
*/
__GLX_MEM_COPY(pc-4, pc, compsize*8);
points = (GLdouble*) (pc - 4);
} else {
points = (GLdouble*) pc;
}
#else
points = (GLdouble*) pc;
#endif
glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
}
void __glXDispSwap_CallLists(GLbyte *pc)
{
GLenum type;
GLsizei n;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_INT(pc + 4);
__GLX_SWAP_INT(pc + 0);
type = *(GLenum *)(pc + 4);
n = *(GLsizei *)(pc + 0);
switch (type) {
case GL_BYTE:
case GL_UNSIGNED_BYTE:
case GL_2_BYTES:
case GL_3_BYTES:
case GL_4_BYTES:
break;
case GL_SHORT:
case GL_UNSIGNED_SHORT:
__GLX_SWAP_SHORT_ARRAY(pc+8, n);
break;
case GL_INT:
case GL_UNSIGNED_INT:
__GLX_SWAP_INT_ARRAY(pc+8, n);
break;
case GL_FLOAT:
__GLX_SWAP_FLOAT_ARRAY(pc+8, n);
break;
}
glCallLists(n, type, pc+8);
}
static void swapArray(GLint numVals, GLenum datatype,
GLint stride, GLint numVertexes, GLbyte *pc)
{
int i,j;
__GLX_DECLARE_SWAP_VARIABLES;
switch (datatype) {
case GL_BYTE:
case GL_UNSIGNED_BYTE:
/* don't need to swap */
return;
case GL_SHORT:
case GL_UNSIGNED_SHORT:
for (i=0; i<numVertexes; i++) {
GLshort *pVal = (GLshort *) pc;
for (j=0; j<numVals; j++) {
__GLX_SWAP_SHORT(&pVal[j]);
}
pc += stride;
}
break;
case GL_INT:
case GL_UNSIGNED_INT:
for (i=0; i<numVertexes; i++) {
GLint *pVal = (GLint *) pc;
for (j=0; j<numVals; j++) {
__GLX_SWAP_INT(&pVal[j]);
}
pc += stride;
}
break;
case GL_FLOAT:
for (i=0; i<numVertexes; i++) {
GLfloat *pVal = (GLfloat *) pc;
for (j=0; j<numVals; j++) {
__GLX_SWAP_FLOAT(&pVal[j]);
}
pc += stride;
}
break;
case GL_DOUBLE:
for (i=0; i<numVertexes; i++) {
GLdouble *pVal = (GLdouble *) pc;
for (j=0; j<numVals; j++) {
__GLX_SWAP_DOUBLE(&pVal[j]);
}
pc += stride;
}
break;
default:
return;
}
}
void __glXDispSwap_DrawArrays(GLbyte *pc)
{
__GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc;
__GLXdispatchDrawArraysComponentHeader *compHeader;
GLint numVertexes = hdr->numVertexes;
GLint numComponents = hdr->numComponents;
GLenum primType = hdr->primType;
GLint stride = 0;
int i;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT(&numVertexes);
__GLX_SWAP_INT(&numComponents);
__GLX_SWAP_INT(&primType);
pc += sizeof(__GLXdispatchDrawArraysHeader);
compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc;
/* compute stride (same for all component arrays) */
for (i=0; i<numComponents; i++) {
GLenum datatype = compHeader[i].datatype;
GLint numVals = compHeader[i].numVals;
GLenum component = compHeader[i].component;
__GLX_SWAP_INT(&datatype);
__GLX_SWAP_INT(&numVals);
__GLX_SWAP_INT(&component);
stride += __GLX_PAD(numVals * __glXTypeSize(datatype));
}
pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader);
/* set up component arrays */
for (i=0; i<numComponents; i++) {
GLenum datatype = compHeader[i].datatype;
GLint numVals = compHeader[i].numVals;
GLenum component = compHeader[i].component;
swapArray(numVals, datatype, stride, numVertexes, pc);
switch (component) {
case GL_VERTEX_ARRAY:
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(numVals, datatype, stride, pc);
break;
case GL_NORMAL_ARRAY:
glEnableClientState(GL_NORMAL_ARRAY);
glNormalPointer(datatype, stride, pc);
break;
case GL_COLOR_ARRAY:
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(numVals, datatype, stride, pc);
break;
case GL_INDEX_ARRAY:
glEnableClientState(GL_INDEX_ARRAY);
glIndexPointer(datatype, stride, pc);
break;
case GL_TEXTURE_COORD_ARRAY:
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(numVals, datatype, stride, pc);
break;
case GL_EDGE_FLAG_ARRAY:
glEnableClientState(GL_EDGE_FLAG_ARRAY);
glEdgeFlagPointer(stride, (const GLboolean *)pc);
break;
default:
break;
}
pc += __GLX_PAD(numVals * __glXTypeSize(datatype));
}
glDrawArrays(primType, 0, numVertexes);
/* turn off anything we might have turned on */
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_INDEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_EDGE_FLAG_ARRAY);
}
void __glXDispSwap_DrawArraysEXT(GLbyte *pc)
{
#ifdef XXX_STUB
#endif /*XXX_STUB*/
}

307
GL/glx/renderpix.c Normal file
View File

@ -0,0 +1,307 @@
/* $XFree86: xc/programs/Xserver/GL/glx/renderpix.c,v 1.5 2001/03/21 16:29:37 dawes Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#define NEED_REPLIES
#include "glxserver.h"
#include "unpack.h"
#include "g_disptab.h"
#include "g_disptab_EXT.h"
void __glXDisp_PolygonStipple(GLbyte *pc)
{
__GLXpixelHeader *hdr = (__GLXpixelHeader *) pc;
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glPolygonStipple((GLubyte *)(hdr+1));
}
void __glXDisp_Bitmap(GLbyte *pc)
{
__GLXdispatchBitmapHeader *hdr = (__GLXdispatchBitmapHeader *) pc;
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glBitmap((GLsizei) hdr->width,
(GLsizei) hdr->height,
(GLfloat) hdr->xorig,
(GLfloat) hdr->yorig,
(GLfloat) hdr->xmove,
(GLfloat) hdr->ymove,
(GLubyte *)(hdr+1));
}
void __glXDisp_TexImage1D(GLbyte *pc)
{
__GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glTexImage1D(hdr->target,
(GLint) hdr->level,
(GLint) hdr->components,
(GLsizei) hdr->width,
(GLint) hdr->border,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDisp_TexImage2D(GLbyte *pc)
{
__GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glTexImage2D(hdr->target,
(GLint) hdr->level,
(GLint) hdr->components,
(GLsizei) hdr->width,
(GLsizei) hdr->height,
(GLint) hdr->border,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDisp_TexImage3D(GLbyte *pc)
{
__GLXdispatchTexImage3DHeader *hdr = (__GLXdispatchTexImage3DHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glTexImage3D(hdr->target, hdr->level, hdr->internalformat, hdr->width,
hdr->height, hdr->depth, hdr->border, hdr->format, hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDisp_DrawPixels(GLbyte *pc)
{
__GLXdispatchDrawPixelsHeader *hdr = (__GLXdispatchDrawPixelsHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glDrawPixels((GLsizei) hdr->width,
(GLsizei) hdr->height,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDisp_TexSubImage1D(GLbyte *pc)
{
__GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glTexSubImage1D(hdr->target,
(GLint) hdr->level,
(GLint) hdr->xoffset,
(GLsizei) hdr->width,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDisp_TexSubImage2D(GLbyte *pc)
{
__GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glTexSubImage2D(hdr->target,
(GLint) hdr->level,
(GLint) hdr->xoffset,
(GLint) hdr->yoffset,
(GLsizei) hdr->width,
(GLsizei) hdr->height,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDisp_TexSubImage3D(GLbyte *pc)
{
__GLXdispatchTexSubImage3DHeader *hdr =
(__GLXdispatchTexSubImage3DHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glTexSubImage3D(hdr->target, hdr->level, hdr->xoffset, hdr->yoffset,
hdr->zoffset, hdr->width, hdr->height, hdr->depth,
hdr->format, hdr->type, (GLvoid *)(hdr+1));
}
void __glXDisp_ColorTable(GLbyte *pc)
{
__GLXdispatchColorTableHeader *hdr =
(__GLXdispatchColorTableHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glColorTable(hdr->target, hdr->internalformat,
hdr->width, hdr->format, hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDisp_ColorSubTable(GLbyte *pc)
{
__GLXdispatchColorSubTableHeader *hdr =
(__GLXdispatchColorSubTableHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glColorSubTable(hdr->target, hdr->start, hdr->count, hdr->format,
hdr->type, (GLvoid *)(hdr+1));
}
void __glXDisp_ConvolutionFilter1D(GLbyte *pc)
{
__GLXdispatchConvolutionFilterHeader *hdr =
(__GLXdispatchConvolutionFilterHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glConvolutionFilter1D(hdr->target, hdr->internalformat,
hdr->width, hdr->format, hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDisp_ConvolutionFilter2D(GLbyte *pc)
{
__GLXdispatchConvolutionFilterHeader *hdr =
(__GLXdispatchConvolutionFilterHeader *) pc;
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glConvolutionFilter2D(hdr->target, hdr->internalformat,
hdr->width, hdr->height, hdr->format, hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDisp_SeparableFilter2D(GLbyte *pc)
{
__GLXdispatchConvolutionFilterHeader *hdr =
(__GLXdispatchConvolutionFilterHeader *) pc;
GLint hdrlen, image1len;
hdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_DISPATCH_HDR_SIZE);
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
/* XXX check this usage - internal code called
** a version without the packing parameters
*/
image1len = __glXImageSize(hdr->format, hdr->type, hdr->width, 1,
hdr->rowLength, hdr->skipRows, hdr->alignment);
image1len = __GLX_PAD(image1len);
glSeparableFilter2D(hdr->target, hdr->internalformat,
hdr->width, hdr->height, hdr->format, hdr->type,
((GLubyte *)hdr+hdrlen), ((GLubyte *)hdr+hdrlen+image1len));
}

550
GL/glx/renderpixswap.c Normal file
View File

@ -0,0 +1,550 @@
/* $XFree86: xc/programs/Xserver/GL/glx/renderpixswap.c,v 1.5 2001/03/21 16:29:37 dawes Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#define NEED_REPLIES
#include "glxserver.h"
#include "unpack.h"
#include "g_disptab.h"
#include "g_disptab_EXT.h"
void __glXDispSwap_PolygonStipple(GLbyte *pc)
{
__GLXpixelHeader *hdr = (__GLXpixelHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glPolygonStipple((GLubyte *)(hdr+1));
}
void __glXDispSwap_Bitmap(GLbyte *pc)
{
__GLXdispatchBitmapHeader *hdr = (__GLXdispatchBitmapHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->height);
__GLX_SWAP_FLOAT((GLbyte *)&hdr->xorig);
__GLX_SWAP_FLOAT((GLbyte *)&hdr->yorig);
__GLX_SWAP_FLOAT((GLbyte *)&hdr->xmove);
__GLX_SWAP_FLOAT((GLbyte *)&hdr->ymove);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glBitmap((GLsizei) hdr->width,
(GLsizei) hdr->height,
(GLfloat) hdr->xorig,
(GLfloat) hdr->yorig,
(GLfloat) hdr->xmove,
(GLfloat) hdr->ymove,
(GLubyte *)(hdr+1));
}
void __glXDispSwap_TexImage1D(GLbyte *pc)
{
__GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->level);
__GLX_SWAP_INT((GLbyte *)&hdr->components);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->height);
__GLX_SWAP_INT((GLbyte *)&hdr->border);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glTexImage1D(hdr->target,
(GLint) hdr->level,
(GLint) hdr->components,
(GLsizei) hdr->width,
(GLint) hdr->border,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDispSwap_TexImage2D(GLbyte *pc)
{
__GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->level);
__GLX_SWAP_INT((GLbyte *)&hdr->components);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->height);
__GLX_SWAP_INT((GLbyte *)&hdr->border);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glTexImage2D(hdr->target,
(GLint) hdr->level,
(GLint) hdr->components,
(GLsizei) hdr->width,
(GLsizei) hdr->height,
(GLint) hdr->border,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDispSwap_TexImage3D(GLbyte *pc)
{
__GLXdispatchTexImage3DHeader *hdr = (__GLXdispatchTexImage3DHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->imageHeight);
__GLX_SWAP_INT((GLbyte *)&hdr->imageDepth);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipImages);
__GLX_SWAP_INT((GLbyte *)&hdr->skipVolumes);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->level);
__GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->height);
__GLX_SWAP_INT((GLbyte *)&hdr->depth);
__GLX_SWAP_INT((GLbyte *)&hdr->size4d);
__GLX_SWAP_INT((GLbyte *)&hdr->border);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glTexImage3D(hdr->target, hdr->level, hdr->internalformat, hdr->width,
hdr->height, hdr->depth, hdr->border, hdr->format, hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDispSwap_DrawPixels(GLbyte *pc)
{
__GLXdispatchDrawPixelsHeader *hdr = (__GLXdispatchDrawPixelsHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->height);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glDrawPixels((GLsizei) hdr->width,
(GLsizei) hdr->height,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDispSwap_TexSubImage1D(GLbyte *pc)
{
__GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->level);
__GLX_SWAP_INT((GLbyte *)&hdr->xoffset);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glTexSubImage1D(hdr->target,
(GLint) hdr->level,
(GLint) hdr->xoffset,
(GLsizei) hdr->width,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDispSwap_TexSubImage2D(GLbyte *pc)
{
__GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->level);
__GLX_SWAP_INT((GLbyte *)&hdr->xoffset);
__GLX_SWAP_INT((GLbyte *)&hdr->yoffset);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->height);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
glTexSubImage2D(hdr->target,
(GLint) hdr->level,
(GLint) hdr->xoffset,
(GLint) hdr->yoffset,
(GLsizei) hdr->width,
(GLsizei) hdr->height,
hdr->format,
hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDispSwap_TexSubImage3D(GLbyte *pc)
{
__GLXdispatchTexSubImage3DHeader *hdr =
(__GLXdispatchTexSubImage3DHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->imageHeight);
__GLX_SWAP_INT((GLbyte *)&hdr->imageDepth);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipImages);
__GLX_SWAP_INT((GLbyte *)&hdr->skipVolumes);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->level);
__GLX_SWAP_INT((GLbyte *)&hdr->xoffset);
__GLX_SWAP_INT((GLbyte *)&hdr->yoffset);
__GLX_SWAP_INT((GLbyte *)&hdr->zoffset);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->height);
__GLX_SWAP_INT((GLbyte *)&hdr->depth);
__GLX_SWAP_INT((GLbyte *)&hdr->size4d);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glTexSubImage3D(hdr->target, hdr->level, hdr->xoffset, hdr->yoffset,
hdr->zoffset, hdr->width, hdr->height, hdr->depth,
hdr->format, hdr->type, (GLvoid *)(hdr+1));
}
void __glXDispSwap_ColorTable(GLbyte *pc)
{
__GLXdispatchColorTableHeader *hdr =
(__GLXdispatchColorTableHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glColorTable(hdr->target, hdr->internalformat,
hdr->width, hdr->format, hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDispSwap_ColorSubTable(GLbyte *pc)
{
__GLXdispatchColorSubTableHeader *hdr =
(__GLXdispatchColorSubTableHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->start);
__GLX_SWAP_INT((GLbyte *)&hdr->count);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glColorSubTable(hdr->target, hdr->start, hdr->count, hdr->format,
hdr->type, (GLvoid *)(hdr+1));
}
void __glXDispSwap_ConvolutionFilter1D(GLbyte *pc)
{
__GLXdispatchConvolutionFilterHeader *hdr =
(__GLXdispatchConvolutionFilterHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glConvolutionFilter2D(hdr->target, hdr->internalformat,
hdr->width, 1, hdr->format, hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDispSwap_ConvolutionFilter2D(GLbyte *pc)
{
__GLXdispatchConvolutionFilterHeader *hdr =
(__GLXdispatchConvolutionFilterHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->height);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
glConvolutionFilter2D(hdr->target, hdr->internalformat,
hdr->width, hdr->height, hdr->format, hdr->type,
(GLvoid *)(hdr+1));
}
void __glXDispSwap_SeparableFilter2D(GLbyte *pc)
{
__GLXdispatchConvolutionFilterHeader *hdr =
(__GLXdispatchConvolutionFilterHeader *) pc;
GLint hdrlen, image1len;
__GLX_DECLARE_SWAP_VARIABLES;
hdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_HDR_SIZE);
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
__GLX_SWAP_INT((GLbyte *)&hdr->target);
__GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
__GLX_SWAP_INT((GLbyte *)&hdr->width);
__GLX_SWAP_INT((GLbyte *)&hdr->height);
__GLX_SWAP_INT((GLbyte *)&hdr->format);
__GLX_SWAP_INT((GLbyte *)&hdr->type);
/*
** Just invert swapBytes flag; the GL will figure out if it needs to swap
** the pixel data.
*/
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
/* XXX check this usage - internal code called
** a version without the packing parameters
*/
image1len = __glXImageSize(hdr->format, hdr->type, hdr->width, 1,
hdr->rowLength, hdr->skipRows, hdr->alignment);
image1len = __GLX_PAD(image1len);
glSeparableFilter2D(hdr->target, hdr->internalformat,
hdr->width, hdr->height, hdr->format, hdr->type,
((GLubyte *)hdr+hdrlen), ((GLubyte *)hdr+hdrlen+image1len));
}

1000
GL/glx/rensize.c Normal file

File diff suppressed because it is too large Load Diff

2327
GL/glx/rensizetab.c Normal file

File diff suppressed because it is too large Load Diff

373
GL/glx/single2.c Normal file
View File

@ -0,0 +1,373 @@
/* $XFree86: xc/programs/Xserver/GL/glx/single2.c,v 1.6 2001/06/06 19:00:15 dawes Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#define NEED_REPLIES
#include "glxserver.h"
#include "glxutil.h"
#include "glxext.h"
#include "unpack.h"
#include "g_disptab.h"
#include "GL/glx_ansic.h"
int __glXDisp_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc)
{
GLsizei size;
GLenum type;
__GLXcontext *cx;
int error;
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
size = *(GLsizei *)(pc+0);
type = *(GLenum *)(pc+4);
if (cx->feedbackBufSize < size) {
cx->feedbackBuf = (GLfloat *) __glXRealloc(cx->feedbackBuf,
(size_t)size
* __GLX_SIZE_FLOAT32);
if (!cx->feedbackBuf) {
cl->client->errorValue = size;
return BadAlloc;
}
cx->feedbackBufSize = size;
}
glFeedbackBuffer(size, type, cx->feedbackBuf);
__GLX_NOTE_UNFLUSHED_CMDS(cx);
return Success;
}
int __glXDisp_SelectBuffer(__GLXclientState *cl, GLbyte *pc)
{
__GLXcontext *cx;
GLsizei size;
int error;
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
size = *(GLsizei *)(pc+0);
if (cx->selectBufSize < size) {
cx->selectBuf = (GLuint *) __glXRealloc(cx->selectBuf,
(size_t) size
* __GLX_SIZE_CARD32);
if (!cx->selectBuf) {
cl->client->errorValue = size;
return BadAlloc;
}
cx->selectBufSize = size;
}
glSelectBuffer(size, cx->selectBuf);
__GLX_NOTE_UNFLUSHED_CMDS(cx);
return Success;
}
int __glXDisp_RenderMode(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client;
xGLXRenderModeReply reply;
__GLXcontext *cx;
GLint nitems=0, retBytes=0, retval, newModeCheck;
GLubyte *retBuffer = NULL;
GLenum newMode;
int error;
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
newMode = *(GLenum*) pc;
retval = glRenderMode(newMode);
/* Check that render mode worked */
glGetIntegerv(GL_RENDER_MODE, &newModeCheck);
if (newModeCheck != newMode) {
/* Render mode change failed. Bail */
newMode = newModeCheck;
goto noChangeAllowed;
}
/*
** Render mode might have still failed if we get here. But in this
** case we can't really tell, nor does it matter. If it did fail, it
** will return 0, and thus we won't send any data across the wire.
*/
switch (cx->renderMode) {
case GL_RENDER:
cx->renderMode = newMode;
break;
case GL_FEEDBACK:
if (retval < 0) {
/* Overflow happened. Copy the entire buffer */
nitems = cx->feedbackBufSize;
} else {
nitems = retval;
}
retBytes = nitems * __GLX_SIZE_FLOAT32;
retBuffer = (GLubyte*) cx->feedbackBuf;
cx->renderMode = newMode;
break;
case GL_SELECT:
if (retval < 0) {
/* Overflow happened. Copy the entire buffer */
nitems = cx->selectBufSize;
} else {
GLuint *bp = cx->selectBuf;
GLint i;
/*
** Figure out how many bytes of data need to be sent. Parse
** the selection buffer to determine this fact as the
** return value is the number of hits, not the number of
** items in the buffer.
*/
nitems = 0;
i = retval;
while (--i >= 0) {
GLuint n;
/* Parse select data for this hit */
n = *bp;
bp += 3 + n;
}
nitems = bp - cx->selectBuf;
}
retBytes = nitems * __GLX_SIZE_CARD32;
retBuffer = (GLubyte*) cx->selectBuf;
cx->renderMode = newMode;
break;
}
/*
** First reply is the number of elements returned in the feedback or
** selection array, as per the API for glRenderMode itself.
*/
noChangeAllowed:;
client = cl->client;
reply.length = nitems;
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
reply.retval = retval;
reply.size = nitems;
reply.newMode = newMode;
WriteToClient(client, sz_xGLXRenderModeReply, (char *)&reply);
if (retBytes) {
WriteToClient(client, retBytes, (char *)retBuffer);
}
return Success;
}
int __glXDisp_Flush(__GLXclientState *cl, GLbyte *pc)
{
__GLXcontext *cx;
int error;
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
glFlush();
__GLX_NOTE_FLUSHED_CMDS(cx);
return Success;
}
int __glXDisp_Finish(__GLXclientState *cl, GLbyte *pc)
{
__GLXcontext *cx;
ClientPtr client;
int error;
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
/* Do a local glFinish */
glFinish();
__GLX_NOTE_FLUSHED_CMDS(cx);
/* Send empty reply packet to indicate finish is finished */
client = cl->client;
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
return Success;
}
#define SEPARATOR " "
char *__glXcombine_strings(const char *cext_string, const char *sext_string)
{
size_t clen, slen;
char *combo_string, *token, *s1;
const char *s2, *end;
/* safeguard to prevent potentially fatal errors in the string functions */
if (!cext_string)
cext_string = "";
if (!sext_string)
sext_string = "";
/*
** String can't be longer than min(cstring, sstring)
** pull tokens out of shortest string
** include space in combo_string for final separator and null terminator
*/
if ( (clen = __glXStrlen(cext_string)) > (slen = __glXStrlen(sext_string)) ) {
combo_string = (char *) __glXMalloc(slen + 2);
s1 = (char *) __glXMalloc(slen + 2); __glXStrcpy(s1, sext_string);
s2 = cext_string;
} else {
combo_string = (char *) __glXMalloc(clen + 2);
s1 = (char *) __glXMalloc(clen + 2); __glXStrcpy(s1, cext_string);
s2 = sext_string;
}
if (!combo_string || !s1) {
if (combo_string) __glXFree(combo_string);
if (s1) __glXFree(s1);
return NULL;
}
combo_string[0] = '\0';
/* Get first extension token */
token = __glXStrtok( s1, SEPARATOR);
while ( token != NULL ) {
/*
** if token in second string then save it
** beware of extension names which are prefixes of other extension names
*/
const char *p = s2;
end = p + __glXStrlen(p);
while (p < end) {
size_t n = __glXStrcspn(p, SEPARATOR);
if ((__glXStrlen(token) == n) && (__glXStrncmp(token, p, n) == 0)) {
combo_string = __glXStrcat( combo_string, token);
combo_string = __glXStrcat( combo_string, SEPARATOR);
}
p += (n + 1);
}
/* Get next extension token */
token = __glXStrtok( NULL, SEPARATOR);
}
__glXFree(s1);
return combo_string;
}
int __glXDisp_GetString(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client;
__GLXcontext *cx;
GLenum name;
const char *string;
int error;
char *buf = NULL, *buf1 = NULL;
GLint length = 0;
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
name = *(GLenum *)(pc + 0);
string = (const char *)glGetString(name);
client = cl->client;
/*
** Restrict extensions to those that are supported by both the
** implementation and the connection. That is, return the
** intersection of client, server, and core extension strings.
*/
if (name == GL_EXTENSIONS) {
buf1 = __glXcombine_strings(string,
cl->GLClientextensions);
buf = __glXcombine_strings(buf1,
cx->pGlxScreen->GLextensions);
if (buf1 != NULL) {
__glXFree(buf1);
}
string = buf;
}
if (string) {
length = __glXStrlen((const char *) string) + 1;
}
__GLX_BEGIN_REPLY(length);
__GLX_PUT_SIZE(length);
__GLX_SEND_HEADER();
WriteToClient(client, length, (char *) string);
if (buf != NULL) {
__glXFree(buf);
}
return Success;
}
int __glXDisp_GetClipPlane(__GLXclientState *cl, GLbyte *pc)
{
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
GLdouble answer[4];
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__glXClearErrorOccured();
glGetClipPlane(*(GLenum *)(pc + 0), answer);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(32);
__GLX_SEND_HEADER();
__GLX_SEND_DOUBLE_ARRAY(4);
}
return Success;
}

350
GL/glx/single2swap.c Normal file
View File

@ -0,0 +1,350 @@
/* $XFree86: xc/programs/Xserver/GL/glx/single2swap.c,v 1.7 2002/01/14 22:47:08 tsi Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#define NEED_REPLIES
#include "glxserver.h"
#include "glxutil.h"
#include "glxext.h"
#include "unpack.h"
#include "g_disptab.h"
#include "GL/glx_ansic.h"
int __glXDispSwap_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc)
{
GLsizei size;
GLenum type;
__GLX_DECLARE_SWAP_VARIABLES;
__GLXcontext *cx;
int error;
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc+0);
__GLX_SWAP_INT(pc+4);
size = *(GLsizei *)(pc+0);
type = *(GLenum *)(pc+4);
if (cx->feedbackBufSize < size) {
cx->feedbackBuf = (GLfloat *) __glXRealloc(cx->feedbackBuf,
(size_t) size
* __GLX_SIZE_FLOAT32);
if (!cx->feedbackBuf) {
cl->client->errorValue = size;
return BadAlloc;
}
cx->feedbackBufSize = size;
}
glFeedbackBuffer(size, type, cx->feedbackBuf);
__GLX_NOTE_UNFLUSHED_CMDS(cx);
return Success;
}
int __glXDispSwap_SelectBuffer(__GLXclientState *cl, GLbyte *pc)
{
__GLXcontext *cx;
GLsizei size;
__GLX_DECLARE_SWAP_VARIABLES;
int error;
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc+0);
size = *(GLsizei *)(pc+0);
if (cx->selectBufSize < size) {
cx->selectBuf = (GLuint *) __glXRealloc(cx->selectBuf,
(size_t) size
* __GLX_SIZE_CARD32);
if (!cx->selectBuf) {
cl->client->errorValue = size;
return BadAlloc;
}
cx->selectBufSize = size;
}
glSelectBuffer(size, cx->selectBuf);
__GLX_NOTE_UNFLUSHED_CMDS(cx);
return Success;
}
int __glXDispSwap_RenderMode(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client;
__GLXcontext *cx;
xGLXRenderModeReply reply;
GLint nitems=0, retBytes=0, retval, newModeCheck;
GLubyte *retBuffer = NULL;
GLenum newMode;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
int error;
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc);
newMode = *(GLenum*) pc;
retval = glRenderMode(newMode);
/* Check that render mode worked */
glGetIntegerv(GL_RENDER_MODE, &newModeCheck);
if (newModeCheck != newMode) {
/* Render mode change failed. Bail */
newMode = newModeCheck;
goto noChangeAllowed;
}
/*
** Render mode might have still failed if we get here. But in this
** case we can't really tell, nor does it matter. If it did fail, it
** will return 0, and thus we won't send any data across the wire.
*/
switch (cx->renderMode) {
case GL_RENDER:
cx->renderMode = newMode;
break;
case GL_FEEDBACK:
if (retval < 0) {
/* Overflow happened. Copy the entire buffer */
nitems = cx->feedbackBufSize;
} else {
nitems = retval;
}
retBytes = nitems * __GLX_SIZE_FLOAT32;
retBuffer = (GLubyte*) cx->feedbackBuf;
__GLX_SWAP_FLOAT_ARRAY((GLbyte *)retBuffer, nitems);
cx->renderMode = newMode;
break;
case GL_SELECT:
if (retval < 0) {
/* Overflow happened. Copy the entire buffer */
nitems = cx->selectBufSize;
} else {
GLuint *bp = cx->selectBuf;
GLint i;
/*
** Figure out how many bytes of data need to be sent. Parse
** the selection buffer to determine this fact as the
** return value is the number of hits, not the number of
** items in the buffer.
*/
nitems = 0;
i = retval;
while (--i >= 0) {
GLuint n;
/* Parse select data for this hit */
n = *bp;
bp += 3 + n;
}
nitems = bp - cx->selectBuf;
}
retBytes = nitems * __GLX_SIZE_CARD32;
retBuffer = (GLubyte*) cx->selectBuf;
__GLX_SWAP_INT_ARRAY((GLbyte *)retBuffer, nitems);
cx->renderMode = newMode;
break;
}
/*
** First reply is the number of elements returned in the feedback or
** selection array, as per the API for glRenderMode itself.
*/
noChangeAllowed:;
client = cl->client;
reply.length = nitems;
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
reply.retval = retval;
reply.size = nitems;
reply.newMode = newMode;
__GLX_SWAP_SHORT(&reply.sequenceNumber);
__GLX_SWAP_INT(&reply.length);
__GLX_SWAP_INT(&reply.retval);
__GLX_SWAP_INT(&reply.size);
__GLX_SWAP_INT(&reply.newMode);
WriteToClient(client, sz_xGLXRenderModeReply, (char *)&reply);
if (retBytes) {
WriteToClient(client, retBytes, (char *)retBuffer);
}
return Success;
}
int __glXDispSwap_Flush(__GLXclientState *cl, GLbyte *pc)
{
__GLXcontext *cx;
int error;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
glFlush();
__GLX_NOTE_FLUSHED_CMDS(cx);
return Success;
}
int __glXDispSwap_Finish(__GLXclientState *cl, GLbyte *pc)
{
__GLXcontext *cx;
ClientPtr client;
int error;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
/* Do a local glFinish */
glFinish();
__GLX_NOTE_FLUSHED_CMDS(cx);
/* Send empty reply packet to indicate finish is finished */
client = cl->client;
__GLX_BEGIN_REPLY(0);
__GLX_PUT_RETVAL(0);
__GLX_SWAP_REPLY_HEADER();
__GLX_SEND_HEADER();
return Success;
}
int __glXDispSwap_GetString(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client;
__GLXcontext *cx;
GLenum name;
const char *string;
__GLX_DECLARE_SWAP_VARIABLES;
int error;
char *buf = NULL, *buf1 = NULL;
GLint length = 0;
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc + 0);
name = *(GLenum *)(pc + 0);
string = (const char *)glGetString(name);
client = cl->client;
/*
** Restrict extensions to those that are supported by both the
** implementation and the connection. That is, return the
** intersection of client, server, and core extension strings.
*/
if (name == GL_EXTENSIONS) {
buf1 = __glXcombine_strings(string,
cl->GLClientextensions);
buf = __glXcombine_strings(buf1,
cx->pGlxScreen->GLextensions);
if (buf1 != NULL) {
__glXFree(buf1);
}
string = buf;
}
if (string) {
length = __glXStrlen((const char *) string) + 1;
}
__GLX_BEGIN_REPLY(length);
__GLX_PUT_SIZE(length);
__GLX_SWAP_REPLY_SIZE();
__GLX_SWAP_REPLY_HEADER();
__GLX_SEND_HEADER();
WriteToClient(client, length, (char *) string);
if (buf != NULL) {
__glXFree(buf);
}
return Success;
}
int __glXDispSwap_GetClipPlane(__GLXclientState *cl, GLbyte *pc)
{
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
GLdouble answer[4];
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc + 0);
__glXClearErrorOccured();
glGetClipPlane(*(GLenum *)(pc + 0), answer);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SWAP_REPLY_HEADER();
__GLX_SEND_HEADER();
} else {
__GLX_SWAP_DOUBLE_ARRAY((GLbyte *)answer, 4);
__GLX_BEGIN_REPLY(32);
__GLX_SWAP_REPLY_HEADER();
__GLX_SEND_HEADER();
__GLX_SEND_DOUBLE_ARRAY(4);
}
return Success;
}

458
GL/glx/singlepix.c Normal file
View File

@ -0,0 +1,458 @@
/* $XFree86: xc/programs/Xserver/GL/glx/singlepix.c,v 1.5 2001/03/21 16:29:37 dawes Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#define NEED_REPLIES
#include "glxserver.h"
#include "glxext.h"
#include "singlesize.h"
#include "unpack.h"
#include "g_disptab.h"
#include "g_disptab_EXT.h"
int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc)
{
GLsizei width, height;
GLenum format, type;
GLboolean swapBytes, lsbFirst;
GLint compsize;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
char *answer, answerBuffer[200];
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
width = *(GLsizei *)(pc + 8);
height = *(GLsizei *)(pc + 12);
format = *(GLenum *)(pc + 16);
type = *(GLenum *)(pc + 20);
swapBytes = *(GLboolean *)(pc + 24);
lsbFirst = *(GLboolean *)(pc + 25);
compsize = __glReadPixels_size(format,type,width,height);
if (compsize < 0) compsize = 0;
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glReadPixels(
*(GLint *)(pc + 0),
*(GLint *)(pc + 4),
*(GLsizei *)(pc + 8),
*(GLsizei *)(pc + 12),
*(GLenum *)(pc + 16),
*(GLenum *)(pc + 20),
answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDisp_GetTexImage(__GLXclientState *cl, GLbyte *pc)
{
GLint level, compsize;
GLenum format, type, target;
GLboolean swapBytes;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
char *answer, answerBuffer[200];
GLint width=0, height=0, depth=1;
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
level = *(GLint *)(pc + 4);
format = *(GLenum *)(pc + 8);
type = *(GLenum *)(pc + 12);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 16);
glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, &width);
glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, &height);
if ( target == GL_TEXTURE_3D) {
glGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, &depth);
}
/*
* The three queries above might fail if we're in a state where queries
* are illegal, but then width, height, and depth would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,level,format,type,width,height,depth);
if (compsize < 0) compsize = 0;
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetTexImage(
*(GLenum *)(pc + 0),
*(GLint *)(pc + 4),
*(GLenum *)(pc + 8),
*(GLenum *)(pc + 12),
answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
((xGLXGetTexImageReply *)&__glXReply)->width = width;
((xGLXGetTexImageReply *)&__glXReply)->height = height;
((xGLXGetTexImageReply *)&__glXReply)->depth = depth;
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDisp_GetPolygonStipple(__GLXclientState *cl, GLbyte *pc)
{
GLboolean lsbFirst;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
GLubyte answerBuffer[200];
char *answer;
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
lsbFirst = *(GLboolean *)(pc + 0);
glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
__GLX_GET_ANSWER_BUFFER(answer,cl,128,1);
__glXClearErrorOccured();
glGetPolygonStipple(
(GLubyte *) answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(128);
__GLX_SEND_HEADER();
__GLX_SEND_BYTE_ARRAY(128);
}
return Success;
}
int __glXDisp_GetSeparableFilter(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize, compsize2;
GLenum format, type, target;
GLboolean swapBytes;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
char *answer, answerBuffer[200];
GLint width=0, height=0;
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 12);
/* target must be SEPARABLE_2D, however I guess we can let the GL
barf on this one.... */
glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
/*
* The two queries above might fail if we're in a state where queries
* are illegal, but then width and height would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
compsize2 = __glGetTexImage_size(target,1,format,type,height,1,1);
if (compsize < 0) compsize = 0;
if (compsize2 < 0) compsize2 = 0;
compsize = __GLX_PAD(compsize);
compsize2 = __GLX_PAD(compsize2);
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize + compsize2,1);
__glXClearErrorOccured();
glGetSeparableFilter(
*(GLenum *)(pc + 0),
*(GLenum *)(pc + 4),
*(GLenum *)(pc + 8),
answer,
answer + compsize,
NULL
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize + compsize2);
((xGLXGetSeparableFilterReply *)&__glXReply)->width = width;
((xGLXGetSeparableFilterReply *)&__glXReply)->height = height;
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize + compsize2);
}
return Success;
}
int __glXDisp_GetConvolutionFilter(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize;
GLenum format, type, target;
GLboolean swapBytes;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
char *answer, answerBuffer[200];
GLint width=0, height=0;
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 12);
glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
if (target == GL_CONVOLUTION_1D) {
height = 1;
} else {
glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
}
/*
* The two queries above might fail if we're in a state where queries
* are illegal, but then width and height would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,1,format,type,width,height,1);
if (compsize < 0) compsize = 0;
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetConvolutionFilter(
*(GLenum *)(pc + 0),
*(GLenum *)(pc + 4),
*(GLenum *)(pc + 8),
answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
((xGLXGetConvolutionFilterReply *)&__glXReply)->width = width;
((xGLXGetConvolutionFilterReply *)&__glXReply)->height = height;
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDisp_GetHistogram(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize;
GLenum format, type, target;
GLboolean swapBytes, reset;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
char *answer, answerBuffer[200];
GLint width=0;
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 12);
reset = *(GLboolean *)(pc + 13);
glGetHistogramParameteriv(target, GL_HISTOGRAM_WIDTH, &width);
/*
* The one query above might fail if we're in a state where queries
* are illegal, but then width would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
if (compsize < 0) compsize = 0;
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetHistogram( target, reset, format, type, answer);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
((xGLXGetHistogramReply *)&__glXReply)->width = width;
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDisp_GetMinmax(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize;
GLenum format, type, target;
GLboolean swapBytes, reset;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
char *answer, answerBuffer[200];
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 12);
reset = *(GLboolean *)(pc + 13);
compsize = __glGetTexImage_size(target,1,format,type,2,1,1);
if (compsize < 0) compsize = 0;
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetMinmax( target, reset, format, type, answer);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDisp_GetColorTable(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize;
GLenum format, type, target;
GLboolean swapBytes;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
char *answer, answerBuffer[200];
GLint width=0;
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
target = *(GLenum *)(pc + 0);
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
swapBytes = *(GLboolean *)(pc + 12);
glGetColorTableParameteriv(target, GL_COLOR_TABLE_WIDTH, &width);
/*
* The one query above might fail if we're in a state where queries
* are illegal, but then width would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
if (compsize < 0) compsize = 0;
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetColorTable(
*(GLenum *)(pc + 0),
*(GLenum *)(pc + 4),
*(GLenum *)(pc + 8),
answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
((xGLXGetColorTableReply *)&__glXReply)->width = width;
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}

514
GL/glx/singlepixswap.c Normal file
View File

@ -0,0 +1,514 @@
/* $XFree86: xc/programs/Xserver/GL/glx/singlepixswap.c,v 1.6 2001/10/31 22:50:27 tsi Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#define NEED_REPLIES
#include "glxserver.h"
#include "glxext.h"
#include "singlesize.h"
#include "unpack.h"
#include "g_disptab.h"
#include "g_disptab_EXT.h"
int __glXDispSwap_ReadPixels(__GLXclientState *cl, GLbyte *pc)
{
GLsizei width, height;
GLenum format, type;
GLboolean swapBytes, lsbFirst;
GLint compsize;
__GLX_DECLARE_SWAP_VARIABLES;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
char *answer, answerBuffer[200];
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc+0);
__GLX_SWAP_INT(pc+4);
__GLX_SWAP_INT(pc+8);
__GLX_SWAP_INT(pc+12);
__GLX_SWAP_INT(pc+16);
__GLX_SWAP_INT(pc+20);
width = *(GLsizei *)(pc + 8);
height = *(GLsizei *)(pc + 12);
format = *(GLenum *)(pc + 16);
type = *(GLenum *)(pc + 20);
swapBytes = *(GLboolean *)(pc + 24);
lsbFirst = *(GLboolean *)(pc + 25);
compsize = __glReadPixels_size(format,type,width,height);
if (compsize < 0) compsize = 0;
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glReadPixels(
*(GLint *)(pc + 0),
*(GLint *)(pc + 4),
*(GLsizei *)(pc + 8),
*(GLsizei *)(pc + 12),
*(GLenum *)(pc + 16),
*(GLenum *)(pc + 20),
answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SWAP_REPLY_HEADER();
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
__GLX_SWAP_REPLY_HEADER();
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDispSwap_GetTexImage(__GLXclientState *cl, GLbyte *pc)
{
GLint level, compsize;
GLenum format, type, target;
GLboolean swapBytes;
__GLX_DECLARE_SWAP_VARIABLES;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
char *answer, answerBuffer[200];
GLint width=0, height=0, depth=1;
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc+0);
__GLX_SWAP_INT(pc+4);
__GLX_SWAP_INT(pc+8);
__GLX_SWAP_INT(pc+12);
level = *(GLint *)(pc + 4);
format = *(GLenum *)(pc + 8);
type = *(GLenum *)(pc + 12);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 16);
glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, &width);
glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, &height);
if ( target == GL_TEXTURE_3D) {
glGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, &depth);
}
/*
* The three queries above might fail if we're in a state where queries
* are illegal, but then width, height, and depth would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,level,format,type,width,height,depth);
if (compsize < 0) compsize = 0;
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetTexImage(
*(GLenum *)(pc + 0),
*(GLint *)(pc + 4),
*(GLenum *)(pc + 8),
*(GLenum *)(pc + 12),
answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SWAP_REPLY_HEADER();
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
__GLX_SWAP_REPLY_HEADER();
__GLX_SWAP_INT(&width);
__GLX_SWAP_INT(&height);
__GLX_SWAP_INT(&depth);
((xGLXGetTexImageReply *)&__glXReply)->width = width;
((xGLXGetTexImageReply *)&__glXReply)->height = height;
((xGLXGetTexImageReply *)&__glXReply)->depth = depth;
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDispSwap_GetPolygonStipple(__GLXclientState *cl, GLbyte *pc)
{
GLboolean lsbFirst;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
GLubyte answerBuffer[200];
char *answer;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
lsbFirst = *(GLboolean *)(pc + 0);
glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
__GLX_GET_ANSWER_BUFFER(answer,cl,128,1);
__glXClearErrorOccured();
glGetPolygonStipple(
(GLubyte *) answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SWAP_REPLY_HEADER();
__GLX_SEND_HEADER();
} else {
__GLX_BEGIN_REPLY(128);
__GLX_SWAP_REPLY_HEADER();
__GLX_SEND_HEADER();
__GLX_SEND_BYTE_ARRAY(128);
}
return Success;
}
int __glXDispSwap_GetSeparableFilter(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize, compsize2;
GLenum format, type, target;
GLboolean swapBytes;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
__GLX_DECLARE_SWAP_VARIABLES;
char *answer, answerBuffer[200];
GLint width=0, height=0;
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc+0);
__GLX_SWAP_INT(pc+4);
__GLX_SWAP_INT(pc+8);
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 12);
/* target must be SEPARABLE_2D, however I guess we can let the GL
barf on this one.... */
glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
/*
* The two queries above might fail if we're in a state where queries
* are illegal, but then width and height would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
compsize2 = __glGetTexImage_size(target,1,format,type,height,1,1);
if (compsize < 0) compsize = 0;
if (compsize2 < 0) compsize2 = 0;
compsize = __GLX_PAD(compsize);
compsize2 = __GLX_PAD(compsize2);
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize + compsize2,1);
__glXClearErrorOccured();
glGetSeparableFilter(
*(GLenum *)(pc + 0),
*(GLenum *)(pc + 4),
*(GLenum *)(pc + 8),
answer,
answer + compsize,
NULL
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SWAP_REPLY_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize + compsize2);
__GLX_SWAP_REPLY_HEADER();
__GLX_SWAP_INT(&width);
__GLX_SWAP_INT(&height);
((xGLXGetSeparableFilterReply *)&__glXReply)->width = width;
((xGLXGetSeparableFilterReply *)&__glXReply)->height = height;
__GLX_SEND_VOID_ARRAY(compsize + compsize2);
}
return Success;
}
int __glXDispSwap_GetConvolutionFilter(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize;
GLenum format, type, target;
GLboolean swapBytes;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
__GLX_DECLARE_SWAP_VARIABLES;
char *answer, answerBuffer[200];
GLint width=0, height=0;
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc+0);
__GLX_SWAP_INT(pc+4);
__GLX_SWAP_INT(pc+8);
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 12);
glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
if (target == GL_CONVOLUTION_2D) {
height = 1;
} else {
glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
}
/*
* The two queries above might fail if we're in a state where queries
* are illegal, but then width and height would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,1,format,type,width,height,1);
if (compsize < 0) compsize = 0;
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetConvolutionFilter(
*(GLenum *)(pc + 0),
*(GLenum *)(pc + 4),
*(GLenum *)(pc + 8),
answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SWAP_REPLY_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
__GLX_SWAP_REPLY_HEADER();
__GLX_SWAP_INT(&width);
__GLX_SWAP_INT(&height);
((xGLXGetConvolutionFilterReply *)&__glXReply)->width = width;
((xGLXGetConvolutionFilterReply *)&__glXReply)->height = height;
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDispSwap_GetHistogram(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize;
GLenum format, type, target;
GLboolean swapBytes, reset;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
__GLX_DECLARE_SWAP_VARIABLES;
char *answer, answerBuffer[200];
GLint width=0;
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc+0);
__GLX_SWAP_INT(pc+4);
__GLX_SWAP_INT(pc+8);
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 12);
reset = *(GLboolean *)(pc + 13);
glGetHistogramParameteriv(target, GL_HISTOGRAM_WIDTH, &width);
/*
* The one query above might fail if we're in a state where queries
* are illegal, but then width would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
if (compsize < 0) compsize = 0;
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetHistogram( target, reset, format, type, answer);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SWAP_REPLY_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
__GLX_SWAP_REPLY_HEADER();
__GLX_SWAP_INT(&width);
((xGLXGetHistogramReply *)&__glXReply)->width = width;
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDispSwap_GetMinmax(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize;
GLenum format, type, target;
GLboolean swapBytes, reset;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
__GLX_DECLARE_SWAP_VARIABLES;
char *answer, answerBuffer[200];
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc+0);
__GLX_SWAP_INT(pc+4);
__GLX_SWAP_INT(pc+8);
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 12);
reset = *(GLboolean *)(pc + 13);
compsize = __glGetTexImage_size(target,1,format,type,2,1,1);
if (compsize < 0) compsize = 0;
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetMinmax( target, reset, format, type, answer);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SWAP_REPLY_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
__GLX_SWAP_REPLY_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}
int __glXDispSwap_GetColorTable(__GLXclientState *cl, GLbyte *pc)
{
GLint compsize;
GLenum format, type, target;
GLboolean swapBytes;
__GLXcontext *cx;
ClientPtr client = cl->client;
int error;
__GLX_DECLARE_SWAP_VARIABLES;
char *answer, answerBuffer[200];
GLint width=0;
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_SINGLE_HDR_SIZE;
__GLX_SWAP_INT(pc+0);
__GLX_SWAP_INT(pc+4);
__GLX_SWAP_INT(pc+8);
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
target = *(GLenum *)(pc + 0);
swapBytes = *(GLboolean *)(pc + 12);
glGetColorTableParameteriv(target, GL_COLOR_TABLE_WIDTH, &width);
/*
* The one query above might fail if we're in a state where queries
* are illegal, but then width would still be zero anyway.
*/
compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
if (compsize < 0) compsize = 0;
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
glGetColorTable(
*(GLenum *)(pc + 0),
*(GLenum *)(pc + 4),
*(GLenum *)(pc + 8),
answer
);
if (__glXErrorOccured()) {
__GLX_BEGIN_REPLY(0);
__GLX_SWAP_REPLY_HEADER();
} else {
__GLX_BEGIN_REPLY(compsize);
__GLX_SWAP_REPLY_HEADER();
__GLX_SWAP_INT(&width);
((xGLXGetColorTableReply *)&__glXReply)->width = width;
__GLX_SEND_VOID_ARRAY(compsize);
}
return Success;
}

1133
GL/glx/singlesize.c Normal file

File diff suppressed because it is too large Load Diff

81
GL/glx/singlesize.h Normal file
View File

@ -0,0 +1,81 @@
/* $XFree86: xc/programs/Xserver/GL/glx/singlesize.h,v 1.3 2001/03/21 16:29:37 dawes Exp $ */
#ifndef _singlesize_h_
#define _singlesize_h_
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
extern GLint __glReadPixels_size(GLenum format, GLenum type,
GLint width, GLint height);
extern GLint __glGetTexEnvfv_size(GLenum pname);
extern GLint __glGetTexEnviv_size(GLenum pname);
extern GLint __glGetTexGenfv_size(GLenum pname);
extern GLint __glGetTexGendv_size(GLenum pname);
extern GLint __glGetTexGeniv_size(GLenum pname);
extern GLint __glGetTexParameterfv_size(GLenum pname);
extern GLint __glGetTexParameteriv_size(GLenum pname);
extern GLint __glGetLightfv_size(GLenum pname);
extern GLint __glGetLightiv_size(GLenum pname);
extern GLint __glGetMap_size(GLenum pname, GLenum query);
extern GLint __glGetMapdv_size(GLenum target, GLenum query);
extern GLint __glGetMapfv_size(GLenum target, GLenum query);
extern GLint __glGetMapiv_size(GLenum target, GLenum query);
extern GLint __glGetMaterialfv_size(GLenum pname);
extern GLint __glGetMaterialiv_size(GLenum pname);
extern GLint __glGetPixelMap_size(GLenum map);
extern GLint __glGetPixelMapfv_size(GLenum map);
extern GLint __glGetPixelMapuiv_size(GLenum map);
extern GLint __glGetPixelMapusv_size(GLenum map);
extern GLint __glGet_size(GLenum sq);
extern GLint __glGetDoublev_size(GLenum sq);
extern GLint __glGetFloatv_size(GLenum sq);
extern GLint __glGetIntegerv_size(GLenum sq);
extern GLint __glGetBooleanv_size(GLenum sq);
extern GLint __glGetTexLevelParameterfv_size(GLenum pname);
extern GLint __glGetTexLevelParameteriv_size(GLenum pname);
extern GLint __glGetTexImage_size(GLenum target, GLint level, GLenum format,
GLenum type, GLint width, GLint height,
GLint depth);
extern GLint __glGetColorTableParameterfv_size(GLenum pname);
extern GLint __glGetColorTableParameteriv_size(GLenum pname);
extern GLint __glGetConvolutionParameterfv_size(GLenum pname);
extern GLint __glGetConvolutionParameteriv_size(GLenum pname);
extern GLint __glGetHistogramParameterfv_size(GLenum pname);
extern GLint __glGetHistogramParameteriv_size(GLenum pname);
extern GLint __glGetMinmaxParameterfv_size(GLenum pname);
extern GLint __glGetMinmaxParameteriv_size(GLenum pname);
#endif /* _singlesize_h_ */

236
GL/glx/unpack.h Normal file
View File

@ -0,0 +1,236 @@
/* $XFree86: xc/programs/Xserver/GL/glx/unpack.h,v 1.5 2002/10/30 12:52:03 alanh Exp $ */
#ifndef __GLX_unpack_h__
#define __GLX_unpack_h__
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#define __GLX_PAD(s) (((s)+3) & (GLuint)~3)
/*
** Fetch the context-id out of a SingleReq request pointed to by pc.
*/
#define __GLX_GET_SINGLE_CONTEXT_TAG(pc) (((xGLXSingleReq*)pc)->contextTag)
#define __GLX_GET_VENDPRIV_CONTEXT_TAG(pc) (((xGLXVendorPrivateReq*)pc)->contextTag)
/*
** Fetch a double from potentially unaligned memory.
*/
#ifdef __GLX_ALIGN64
#define __GLX_MEM_COPY(dst,src,n) if (src && dst) memcpy(dst,src,n)
#define __GLX_GET_DOUBLE(dst,src) __GLX_MEM_COPY(&dst,src,8)
#else
#define __GLX_GET_DOUBLE(dst,src) (dst) = *((GLdouble*)(src))
#endif
extern void __glXMemInit(void);
extern xGLXSingleReply __glXReply;
#define __GLX_BEGIN_REPLY(size) \
__glXReply.length = __GLX_PAD(size) >> 2; \
__glXReply.type = X_Reply; \
__glXReply.sequenceNumber = client->sequence;
#define __GLX_SEND_HEADER() \
WriteToClient( client, sz_xGLXSingleReply, (char *)&__glXReply);
#define __GLX_PUT_RETVAL(a) \
__glXReply.retval = (a);
#define __GLX_PUT_SIZE(a) \
__glXReply.size = (a);
#define __GLX_PUT_RENDERMODE(m) \
__glXReply.pad3 = (m)
/*
** Get a buffer to hold returned data, with the given alignment. If we have
** to realloc, allocate size+align, in case the pointer has to be bumped for
** alignment. The answerBuffer should already be aligned.
**
** NOTE: the cast (long)res below assumes a long is large enough to hold a
** pointer.
*/
#define __GLX_GET_ANSWER_BUFFER(res,cl,size,align) \
if ((size) > sizeof(answerBuffer)) { \
int bump; \
if ((cl)->returnBufSize < (size)+(align)) { \
(cl)->returnBuf = (GLbyte*)Xrealloc((cl)->returnBuf, \
(size)+(align)); \
if (!(cl)->returnBuf) { \
return BadAlloc; \
} \
(cl)->returnBufSize = (size)+(align); \
} \
res = (char*)cl->returnBuf; \
bump = (long)(res) % (align); \
if (bump) res += (align) - (bump); \
} else { \
res = (char *)answerBuffer; \
}
#define __GLX_PUT_BYTE() \
*(GLbyte *)&__glXReply.pad3 = *(GLbyte *)answer
#define __GLX_PUT_SHORT() \
*(GLshort *)&__glXReply.pad3 = *(GLshort *)answer
#define __GLX_PUT_INT() \
*(GLint *)&__glXReply.pad3 = *(GLint *)answer
#define __GLX_PUT_FLOAT() \
*(GLfloat *)&__glXReply.pad3 = *(GLfloat *)answer
#define __GLX_PUT_DOUBLE() \
*(GLdouble *)&__glXReply.pad3 = *(GLdouble *)answer
#define __GLX_SEND_BYTE_ARRAY(len) \
WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), (char *)answer)
#define __GLX_SEND_SHORT_ARRAY(len) \
WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), (char *)answer)
#define __GLX_SEND_INT_ARRAY(len) \
WriteToClient(client, (len)*__GLX_SIZE_INT32, (char *)answer)
#define __GLX_SEND_FLOAT_ARRAY(len) \
WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, (char *)answer)
#define __GLX_SEND_DOUBLE_ARRAY(len) \
WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, (char *)answer)
#define __GLX_SEND_VOID_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len)
#define __GLX_SEND_UBYTE_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len)
#define __GLX_SEND_USHORT_ARRAY(len) __GLX_SEND_SHORT_ARRAY(len)
#define __GLX_SEND_UINT_ARRAY(len) __GLX_SEND_INT_ARRAY(len)
/*
** PERFORMANCE NOTE:
** Machine dependent optimizations abound here; these swapping macros can
** conceivably be replaced with routines that do the job faster.
*/
#define __GLX_DECLARE_SWAP_VARIABLES \
GLbyte sw
#define __GLX_DECLARE_SWAP_ARRAY_VARIABLES \
GLbyte *swapPC; \
GLbyte *swapEnd
#define __GLX_SWAP_INT(pc) \
sw = ((GLbyte *)(pc))[0]; \
((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[3]; \
((GLbyte *)(pc))[3] = sw; \
sw = ((GLbyte *)(pc))[1]; \
((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \
((GLbyte *)(pc))[2] = sw;
#define __GLX_SWAP_SHORT(pc) \
sw = ((GLbyte *)(pc))[0]; \
((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[1]; \
((GLbyte *)(pc))[1] = sw;
#define __GLX_SWAP_DOUBLE(pc) \
sw = ((GLbyte *)(pc))[0]; \
((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[7]; \
((GLbyte *)(pc))[7] = sw; \
sw = ((GLbyte *)(pc))[1]; \
((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[6]; \
((GLbyte *)(pc))[6] = sw; \
sw = ((GLbyte *)(pc))[2]; \
((GLbyte *)(pc))[2] = ((GLbyte *)(pc))[5]; \
((GLbyte *)(pc))[5] = sw; \
sw = ((GLbyte *)(pc))[3]; \
((GLbyte *)(pc))[3] = ((GLbyte *)(pc))[4]; \
((GLbyte *)(pc))[4] = sw;
#define __GLX_SWAP_FLOAT(pc) \
sw = ((GLbyte *)(pc))[0]; \
((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[3]; \
((GLbyte *)(pc))[3] = sw; \
sw = ((GLbyte *)(pc))[1]; \
((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \
((GLbyte *)(pc))[2] = sw;
#define __GLX_SWAP_INT_ARRAY(pc, count) \
swapPC = ((GLbyte *)(pc)); \
swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_INT32;\
while (swapPC < swapEnd) { \
__GLX_SWAP_INT(swapPC); \
swapPC += __GLX_SIZE_INT32; \
}
#define __GLX_SWAP_SHORT_ARRAY(pc, count) \
swapPC = ((GLbyte *)(pc)); \
swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_INT16;\
while (swapPC < swapEnd) { \
__GLX_SWAP_SHORT(swapPC); \
swapPC += __GLX_SIZE_INT16; \
}
#define __GLX_SWAP_DOUBLE_ARRAY(pc, count) \
swapPC = ((GLbyte *)(pc)); \
swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT64;\
while (swapPC < swapEnd) { \
__GLX_SWAP_DOUBLE(swapPC); \
swapPC += __GLX_SIZE_FLOAT64; \
}
#define __GLX_SWAP_FLOAT_ARRAY(pc, count) \
swapPC = ((GLbyte *)(pc)); \
swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT32;\
while (swapPC < swapEnd) { \
__GLX_SWAP_FLOAT(swapPC); \
swapPC += __GLX_SIZE_FLOAT32; \
}
#define __GLX_SWAP_REPLY_HEADER() \
__GLX_SWAP_SHORT(&__glXReply.sequenceNumber); \
__GLX_SWAP_INT(&__glXReply.length);
#define __GLX_SWAP_REPLY_RETVAL() \
__GLX_SWAP_INT(&__glXReply.retval)
#define __GLX_SWAP_REPLY_SIZE() \
__GLX_SWAP_INT(&__glXReply.size)
#endif /* !__GLX_unpack_h__ */

191
GL/glx/xfont.c Normal file
View File

@ -0,0 +1,191 @@
/* $XFree86: xc/programs/Xserver/GL/glx/xfont.c,v 1.3 2001/03/21 16:29:37 dawes Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#define NEED_REPLIES
#include "glxserver.h"
#include "glxutil.h"
#include "g_disptab.h"
#include <unpack.h>
#include <GL/gl.h>
#include <pixmapstr.h>
#include <windowstr.h>
#include <dixfontstr.h>
extern XID clientErrorValue; /* imported kludge from dix layer */
/*
** Make a single GL bitmap from a single X glyph
*/
static int __glXMakeBitmapFromGlyph(FontPtr font, CharInfoPtr pci)
{
int i, j;
int widthPadded; /* width of glyph in bytes, as padded by X */
int allocBytes; /* bytes to allocate to store bitmap */
int w; /* width of glyph in bits */
int h; /* height of glyph */
register unsigned char *pglyph;
register unsigned char *p;
unsigned char *allocbuf;
#define __GL_CHAR_BUF_SIZE 2048
unsigned char buf[__GL_CHAR_BUF_SIZE];
w = GLYPHWIDTHPIXELS(pci);
h = GLYPHHEIGHTPIXELS(pci);
widthPadded = GLYPHWIDTHBYTESPADDED(pci);
/*
** Use the local buf if possible, otherwise malloc.
*/
allocBytes = widthPadded * h;
if (allocBytes <= __GL_CHAR_BUF_SIZE) {
p = buf;
allocbuf = 0;
} else {
p = (unsigned char *) __glXMalloc(allocBytes);
if (!p)
return BadAlloc;
allocbuf = p;
}
/*
** We have to reverse the picture, top to bottom
*/
pglyph = FONTGLYPHBITS(FONTGLYPHS(font), pci) + (h-1)*widthPadded;
for (j=0; j < h; j++) {
for (i=0; i < widthPadded; i++) {
p[i] = pglyph[i];
}
pglyph -= widthPadded;
p += widthPadded;
}
glBitmap(w, h, -pci->metrics.leftSideBearing, pci->metrics.descent,
pci->metrics.characterWidth, 0, allocbuf ? allocbuf : buf);
if (allocbuf) {
__glXFree(allocbuf);
}
return Success;
#undef __GL_CHAR_BUF_SIZE
}
/*
** Create a GL bitmap for each character in the X font. The bitmap is stored
** in a display list.
*/
static int
MakeBitmapsFromFont(FontPtr pFont, int first, int count, int list_base)
{
unsigned long i, nglyphs;
CARD8 chs[2]; /* the font index we are going after */
CharInfoPtr pci;
int rv; /* return value */
int encoding = (FONTLASTROW(pFont) == 0) ? Linear16Bit : TwoD16Bit;
glPixelStorei(GL_UNPACK_SWAP_BYTES, FALSE);
glPixelStorei(GL_UNPACK_LSB_FIRST, BITMAP_BIT_ORDER == LSBFirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
glPixelStorei(GL_UNPACK_ALIGNMENT, GLYPHPADBYTES);
for (i=0; i < count; i++) {
chs[0] = (first + i) >> 8; /* high byte is first byte */
chs[1] = first + i;
(*pFont->get_glyphs)(pFont, 1, chs, (FontEncoding)encoding,
&nglyphs, &pci);
/*
** Define a display list containing just a glBitmap() call.
*/
glNewList(list_base + i, GL_COMPILE);
if (nglyphs ) {
rv = __glXMakeBitmapFromGlyph(pFont, pci);
if (rv) {
return rv;
}
}
glEndList();
}
return Success;
}
/************************************************************************/
int __glXUseXFont(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXUseXFontReq *req;
FontPtr pFont;
GC *pGC;
GLuint currentListIndex;
__GLXcontext *cx;
int error;
req = (xGLXUseXFontReq *) pc;
cx = __glXForceCurrent(cl, req->contextTag, &error);
if (!cx) {
return error;
}
glGetIntegerv(GL_LIST_INDEX, (GLint*) &currentListIndex);
if (currentListIndex != 0) {
/*
** A display list is currently being made. It is an error
** to try to make a font during another lists construction.
*/
client->errorValue = cx->id;
return __glXBadContextState;
}
/*
** Font can actually be either the ID of a font or the ID of a GC
** containing a font.
*/
pFont = (FontPtr)LookupIDByType(req->font, RT_FONT);
if (!pFont) {
pGC = (GC *)LookupIDByType(req->font, RT_GC);
if (!pGC) {
client->errorValue = req->font;
return BadFont;
}
pFont = pGC->font;
}
return MakeBitmapsFromFont(pFont, req->first, req->count,
req->listBase);
}

111
GL/include/GL/glx_ansic.h Normal file
View File

@ -0,0 +1,111 @@
#ifndef _glx_ansic_h_
#define _glx_ansic_h_
/* $XFree86: xc/programs/Xserver/GL/include/GL/glx_ansic.h,v 1.7 2002/04/04 14:05:36 eich Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
*/
/*
** this needs to check whether we're using XFree86 at all, and then
** which version we're using. Use these macros if version is 3.9+, else
** use normal commands below.
*/
/*
** turns out this include file only exists for XFree86 3.9+
** I notice that not having it is not an error and does not stop the build,
** but having it will allow opengl and glx to be built for 3.9+. We no longer
** need an explicit define in the Makefile, just point to the correct X source
** tree and all should be taken care of.
*/
#ifdef XFree86Server
#ifdef XFree86LOADER
#include "xf86_ansic.h"
#endif
#ifndef assert
#define assert(a)
#endif
#else
#if defined(Lynx) && defined(__assert_h)
#undef __assert_h
#endif
#ifdef assert
#undef assert
#endif
#include <assert.h>
#endif
#define GLX_STDOUT stdout
#define GLX_STDERR stderr
#define __glXPrintf printf
#define __glXFprintf fprintf
#define __glXSprintf sprintf
#define __glXVfprintf vfprintf
#define __glXVsprintf vsprintf
#define __glXFopen fopen
#define __glXFclose fclose
#define __glXCos(x) cos(x)
#define __glXSin(x) sin(x)
#define __glXAtan(x) atan(x)
#define __glXAbs(x) abs(x)
#define __glXLog(x) log(x)
#define __glXCeil(x) ceil(x)
#define __glXFloor(x) floor(x)
#define __glXSqrt(x) sqrt(x)
#define __glXPow(x, y) pow(x, y)
#define __glXMemmove(dest, src, n) memmove(dest, src, n)
#define __glXMemcpy(dest, src, n) memcpy(dest, src, n)
#define __glXMemset(s, c, n) memset(s, c, n)
#define __glXStrdup(str) xstrdup(str)
#define __glXStrcpy(dest, src) strcpy(dest, src)
#define __glXStrncpy(dest, src, n) strncpy(dest, src, n)
#define __glXStrcat(dest, src) strcat(dest, src)
#define __glXStrncat(dest, src, n) strncat(dest, src, n)
#define __glXStrcmp(s1, s2) strcmp(s1, s2)
#define __glXStrncmp(s1, s2, n) strncmp(s1, s2, n)
#define __glXStrlen(str) strlen(str)
#define __glXAbort() abort()
#define __glXStrtok(s, delim) strtok(s, delim)
#define __glXStrcspn(s, reject) strcspn(s, reject)
#define __glXGetenv(a) getenv(a)
#define __glXAtoi(a) atoi(a)
#endif /* _glx_ansic_h_ */

39
GL/include/GL/xf86glx.h Normal file
View File

@ -0,0 +1,39 @@
/* $XFree86: xc/programs/Xserver/GL/include/GL/xf86glx.h,v 1.4 2000/02/23 04:46:54 martin Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sub license, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice (including the
next paragraph) shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
/*
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
*
*/
#include "miscstruct.h"
#ifdef XFree86LOADER
#include "xf86_ansic.h"
#endif

184
XTrap/xtrapddmi.c Normal file
View File

@ -0,0 +1,184 @@
/* $XFree86: xc/programs/Xserver/XTrap/xtrapddmi.c,v 1.2 2002/01/23 03:31:39 dawes Exp $ */
/*****************************************************************************
Copyright 1987, 1988, 1989, 1990, 1991 by Digital Equipment Corp., Maynard, MA
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
*****************************************************************************/
/*
* ABSTRACT:
*
* This module is the platform-specific but conditionally independent
* code for the XTrap extension (usually I/O or platform setup).
* This is shared code and is subject to change only by team approval.
*
* CONTRIBUTORS:
*
* Dick Annicchiarico
* Robert Chesler
* Gene Durso
* Marc Evans
* Alan Jamison
* Mark Henry
* Ken Miller
*
*/
#ifndef EXTMODULE
#include <errno.h>
#include <X11/Xos.h>
#ifdef PC
# include "fcntl.h"
# include "io.h"
# define O_NDELAY 0L
#endif
#else
#include "xf86_ansic.h"
#endif
#define NEED_REPLIES
#define NEED_EVENTS
#include <X11/X.h> /* From library include environment */
#include "input.h" /* From server include env. (must be before Xlib.h!) */
#ifdef PC
# include "scrintst.h" /* Screen struct */
# include "extnsist.h"
#else
# include "extnsionst.h" /* Server ExtensionEntry definitions */
# include "scrnintstr.h" /* Screen struct */
#endif
#include <X11/extensions/xtrapdi.h>
#include <X11/extensions/xtrapddmi.h>
#include <X11/extensions/xtrapproto.h>
extern int XETrapErrorBase;
extern xXTrapGetAvailReply XETrap_avail;
extern DevicePtr XETrapKbdDev;
extern DevicePtr XETrapPtrDev;
/*
* DESCRIPTION:
*
* This function performs the platform specific setup for server
* extension implementations.
*/
void XETrapPlatformSetup()
{
}
#if !defined _XINPUT
/*
* DESCRIPTION:
*
* This routine processes the simulation of some input event.
*
*/
int XETrapSimulateXEvent(register xXTrapInputReq *request,
register ClientPtr client)
{
ScreenPtr pScr = NULL;
int status = Success;
xEvent xev;
register int x = request->input.x;
register int y = request->input.y;
DevicePtr keydev = LookupKeyboardDevice();
DevicePtr ptrdev = LookupPointerDevice();
if (request->input.screen < screenInfo.numScreens)
{
pScr = screenInfo.screens[request->input.screen];
}
else
{ /* Trying to play bogus events to this WS! */
#ifdef VERBOSE
ErrorF("%s: Trying to send events to screen %d!\n", XTrapExtName,
request->input.screen);
#endif
status = XETrapErrorBase + BadScreen;
}
/* Fill in the event structure with the information
* Note: root, event, child, eventX, eventY, state, and sameScreen
* are all updated by FixUpEventFromWindow() when the events
* are delivered via DeliverDeviceEvents() or whatever. XTrap
* needs to only concern itself with type, detail, time, rootX,
* and rootY.
*/
if (status == Success)
{
xev.u.u.type = request->input.type;
xev.u.u.detail = request->input.detail;
xev.u.keyButtonPointer.time = GetTimeInMillis();
xev.u.keyButtonPointer.rootX = x;
xev.u.keyButtonPointer.rootY = y;
if (request->input.type == MotionNotify)
{ /* Set new cursor position on screen */
XETrap_avail.data.cur_x = x;
XETrap_avail.data.cur_y = y;
NewCurrentScreen (pScr, x, y); /* fix from amnonc@mercury.co.il */
if (!(*pScr->SetCursorPosition)(pScr, x, y, xFalse))
{
status = BadImplementation;
}
}
}
if (status == Success)
{
switch(request->input.type)
{ /* Now process the event appropriately */
case KeyPress:
case KeyRelease:
(*XETrapKbdDev->realInputProc)(&xev,(DeviceIntPtr)keydev, 1L);
break;
case MotionNotify:
case ButtonPress:
case ButtonRelease:
(*XETrapPtrDev->realInputProc)(&xev,(DeviceIntPtr)ptrdev, 1L);
break;
default:
status = BadValue;
break;
}
}
return(status);
}
#endif /* _XINPUT */
#if defined vms && !defined LINKED_IN
/* Used by swapping code not visible from VMS (from main.c) */
#ifndef BLADE
void
NotImplemented()
{
FatalError("Not implemented");
}
#endif
int
#ifdef __STDC__
ProcBadRequest( ClientPtr client)
#else
ProcBadRequest(client)
ClientPtr client;
#endif
{
return (BadRequest);
}
#endif /* vms && ! LINKED_IN */

2147
XTrap/xtrapdi.c Normal file

File diff suppressed because it is too large Load Diff

1006
XTrap/xtrapdiswp.c Normal file

File diff suppressed because it is too large Load Diff

238
XTrap/xtrapditbl.c Normal file
View File

@ -0,0 +1,238 @@
/* $XFree86: xc/programs/Xserver/XTrap/xtrapditbl.c,v 1.1 2001/11/02 23:29:29 dawes Exp $ */
/****************************************************************************
Copyright 1987, 1988, 1989, 1990, 1991 by Digital Equipment Corp., Maynard, MA
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
*****************************************************************************/
/*
* ABSTRACT:
*
* This module is contains Vector tables used for swapping and general
* dispatch by the XTrap server extension.
*
* CONTRIBUTORS:
*
* Ken Miller
* Marc Evans
*
*/
/*-----------------*
* Include Files *
*-----------------*/
#include <X11/X.h>
#define NEED_REPLIES
#define NEED_EVENTS
#include <X11/Xproto.h>
#include <X11/Xprotostr.h>
#include <X11/extensions/xtrapdi.h>
#include "input.h" /* Server DevicePtr definitions */
#include "misc.h"
#include "dixstruct.h"
#ifdef PC
# include "extnsist.h"
#else
# include "extnsionst.h" /* Server ExtensionEntry definitions */
#endif
#include <X11/extensions/xtrapddmi.h>
#include <X11/extensions/xtrapproto.h>
globaldef void_function XETSwProcVector[256L] =
{
(void_function)ProcBadRequest,
XETSwCreateWindow,
XETSwChangeWindowAttributes,
XETSwResourceReq, /* GetWindowAttributes */
XETSwResourceReq, /* DestroyWindow */
XETSwResourceReq, /* 5 DestroySubwindows */
XETSwResourceReq, /* XETSwChangeSaveSet, */
XETSwReparentWindow,
XETSwResourceReq, /* MapWindow */
XETSwResourceReq, /* MapSubwindows */
XETSwResourceReq, /* 10 UnmapWindow */
XETSwResourceReq, /* UnmapSubwindows */
XETSwConfigureWindow,
XETSwResourceReq, /* XETSwCirculateWindow, */
XETSwResourceReq, /* GetGeometry */
XETSwResourceReq, /* 15 QueryTree */
XETSwInternAtom,
XETSwResourceReq, /* XETSwGetAtomName, */
XETSwChangeProperty,
XETSwDeleteProperty,
XETSwGetProperty, /* 20 */
XETSwResourceReq, /* XETSwListProperties, */
XETSwSetSelectionOwner,
XETSwResourceReq, /* XETSwGetSelectionOwner, */
XETSwConvertSelection,
XETSwSendEvent, /* 25 */
XETSwGrabPointer,
XETSwResourceReq, /* XETSwUngrabPointer, */
XETSwGrabButton,
XETSwUngrabButton,
XETSwChangeActivePointerGrab, /* 30 */
XETSwGrabKeyboard,
XETSwResourceReq, /* XETSwUngrabKeyboard, */
XETSwGrabKey,
XETSwUngrabKey,
XETSwResourceReq, /* 35 XETSwAllowEvents, */
XETSwSimpleReq, /* XETSwGrabServer, */
XETSwSimpleReq, /* XETSwUngrabServer, */
XETSwResourceReq, /* XETSwQueryPointer, */
XETSwGetMotionEvents,
XETSwTranslateCoords, /*40 */
XETSwWarpPointer,
XETSwSetInputFocus,
XETSwSimpleReq, /* XETSwGetInputFocus, */
XETSwSimpleReq, /* QueryKeymap, */
XETSwOpenFont, /* 45 */
XETSwResourceReq, /* XETSwCloseFont, */
XETSwResourceReq, /* XETSwQueryFont, */
XETSwResourceReq, /* XETSwQueryTextExtents, */
XETSwListFonts,
XETSwListFontsWithInfo, /* 50 */
XETSwSetFontPath,
XETSwSimpleReq, /* GetFontPath, */
XETSwCreatePixmap,
XETSwResourceReq, /* XETSwFreePixmap, */
XETSwCreateGC, /* 55 */
XETSwChangeGC,
XETSwCopyGC,
XETSwSetDashes,
XETSwSetClipRectangles,
XETSwResourceReq, /* 60 XETSwFreeGC, */
XETSwClearToBackground,
XETSwCopyArea,
XETSwCopyPlane,
XETSwPoly, /* PolyPoint, */
XETSwPoly, /* 65 PolyLine */
XETSwPoly, /* PolySegment, */
XETSwPoly, /* PolyRectangle, */
XETSwPoly, /* PolyArc, */
XETSwFillPoly,
XETSwPoly, /* 70 PolyFillRectangle */
XETSwPoly, /* PolyFillArc, */
XETSwPutImage,
XETSwGetImage,
XETSwPolyText,
XETSwPolyText, /* 75 */
XETSwImageText,
XETSwImageText,
XETSwCreateColormap,
XETSwResourceReq, /* XETSwFreeColormap, */
XETSwCopyColormapAndFree, /* 80 */
XETSwResourceReq, /* XETSwInstallColormap, */
XETSwResourceReq, /* XETSwUninstallColormap, */
XETSwResourceReq, /* XETSwListInstalledColormaps, */
XETSwAllocColor,
XETSwAllocNamedColor, /* 85 */
XETSwAllocColorCells,
XETSwAllocColorPlanes,
XETSwFreeColors,
XETSwStoreColors,
XETSwStoreNamedColor, /* 90 */
XETSwQueryColors,
XETSwLookupColor,
XETSwCreateCursor,
XETSwCreateGlyphCursor,
XETSwResourceReq, /* 95 XETSwFreeCursor, */
XETSwRecolorCursor,
XETSwQueryBestSize,
XETSwQueryExtension,
XETSwSimpleReq, /* ListExtensions, */
XETSwChangeKeyboardMapping, /* 100 */
XETSwSimpleReq, /* GetKeyboardMapping, */
XETSwChangeKeyboardControl,
XETSwSimpleReq, /* GetKeyboardControl, */
XETSwSimpleReq, /* Bell, */
XETSwChangePointerControl, /* 105 */
XETSwSimpleReq, /* GetPointerControl, */
XETSwSetScreenSaver,
XETSwSimpleReq, /* GetScreenSaver, */
XETSwChangeHosts,
XETSwSimpleReq, /* 110 ListHosts, */
XETSwSimpleReq, /* XETSwChangeAccessControl, */
XETSwSimpleReq, /* XETSwChangeCloseDownMode, */
XETSwResourceReq, /* XETSwKillClient, */
XETSwRotateProperties,
XETSwSimpleReq, /* 115 ForceScreenSaver */
XETSwSimpleReq, /* SetPointerMapping, */
XETSwSimpleReq, /* GetPointerMapping, */
XETSwSimpleReq, /* SetModifierMapping, */
XETSwSimpleReq, /* GetModifierMapping, */
NotImplemented, /* 120 */
NotImplemented,
NotImplemented,
NotImplemented,
NotImplemented,
NotImplemented, /* 125 */
NotImplemented,
XETSwNoOperation
};
/* NOTE: This array must align with the values of the constants used
* as minor_opcode values in the request structure. Failure to do this
* could result in random code paths.
*/
globaldef int_function XETrapDispatchVector[10L] =
{
XETrapReset, /* 0 XETrap_Reset */
XETrapGetAvailable, /* 1 XETrap_GetAvailable */
XETrapConfig, /* 2 XETrap_Config */
XETrapStartTrap, /* 3 XETrap_StartTrap */
XETrapStopTrap, /* 4 XETrap_StopTrap */
XETrapGetCurrent, /* 5 XETrap_GetCurrent */
XETrapGetStatistics, /* 6 XETrap_GetStatistics */
#ifndef _XINPUT
XETrapSimulateXEvent, /* 7 XETrap_SimulateXEvent */
#endif
XETrapGetVersion, /* 8 XETrap_GetVersion */
XETrapGetLastInpTime, /* 9 XETrap_GetLastInpTime */
};
/* NOTE: This array must align with the values of the constants used
* as minor_opcode values in the request structure. Failure to do this
* could result in random code paths.
*/
globaldef int_function XETSwDispatchVector[10L] =
{
sXETrapReset, /* 0 XETrap_Reset */
sXETrapGetAvailable, /* 1 XETrap_GetAvailable */
sXETrapConfig, /* 2 XETrap_Config */
sXETrapStartTrap, /* 3 XETrap_StartTrap */
sXETrapStopTrap, /* 4 XETrap_StopTrap */
sXETrapGetCurrent, /* 5 XETrap_GetCurrent */
sXETrapGetStatistics, /* 6 XETrap_GetStatistics */
#ifndef _XINPUT
sXETrapSimulateXEvent, /* 7 XETrap_SimulateXEvent */
#endif
sXETrapGetVersion, /* 8 XETrap_GetVersion */
sXETrapGetLastInpTime, /* 9 XETrap_GetLastInpTime */
};
/* ProcVector shadow vector */
globaldef int_function XETrapProcVector[256L] = {XETrapRequestVector};
/*
* Events are faked as if they're vectored since that's
* the way it'll eventually be (X11 R5?).
*/
#ifndef VECTORED_EVENTS
globaldef int_function EventProcVector[XETrapCoreEvents] = {NULL};
#endif
globaldef int_function XETrapEventProcVector[XETrapCoreEvents] = {NULL};

12
Xext/dpmsproc.h Normal file
View File

@ -0,0 +1,12 @@
/* $XFree86: xc/programs/Xserver/Xext/dpmsproc.h,v 1.3 2001/10/28 03:32:50 tsi Exp $ */
/* Prototypes for functions that the DDX must provide */
#ifndef _DPMSPROC_H_
#define _DPMSPROC_H_
void DPMSSet(int level);
int DPMSGet(int *level);
Bool DPMSSupported(void);
#endif

327
Xext/fontcache.c Normal file
View File

@ -0,0 +1,327 @@
/*-
* Copyright (c) 1998-1999 Shunsuke Akiyama <akiyama@jp.FreeBSD.org>.
* All rights reserved.
* Copyright (c) 1998-1999 X-TrueType Server Project, All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Id: fontcache.c,v 1.12 1999/01/31 13:47:45 akiyama Exp $
*/
/* $XFree86: xc/programs/Xserver/Xext/fontcache.c,v 1.5 2000/02/23 20:29:39 dawes Exp $ */
/* THIS IS NOT AN X CONSORTIUM STANDARD */
#define NEED_REPLIES
#define NEED_EVENTS
#include "X.h"
#include "Xproto.h"
#include "misc.h"
#include "dixstruct.h"
#include "extnsionst.h"
#include "scrnintstr.h"
#include "inputstr.h"
#include "servermd.h"
#define _FONTCACHE_SERVER_
#include "fontcacheP.h"
#include "fontcachstr.h"
#include "Xfuncproto.h"
#include "swaprep.h"
static int miscErrorBase;
static void FontCacheResetProc(
#if NeedFunctionPrototypes
ExtensionEntry* /* extEntry */
#endif
);
static DISPATCH_PROC(ProcFontCacheDispatch);
static DISPATCH_PROC(ProcFontCacheGetCacheSettings);
static DISPATCH_PROC(ProcFontCacheGetCacheStatistics);
static DISPATCH_PROC(ProcFontCacheQueryVersion);
static DISPATCH_PROC(ProcFontCacheChangeCacheSettings);
static DISPATCH_PROC(SProcFontCacheDispatch);
static DISPATCH_PROC(SProcFontCacheGetCacheSettings);
static DISPATCH_PROC(SProcFontCacheGetCacheStatistics);
static DISPATCH_PROC(SProcFontCacheQueryVersion);
static DISPATCH_PROC(SProcFontCacheChangeCacheSettings);
static unsigned char FontCacheReqCode = 0;
void
FontCacheExtensionInit()
{
ExtensionEntry* extEntry;
if (
(extEntry = AddExtension(FONTCACHENAME,
FontCacheNumberEvents,
FontCacheNumberErrors,
ProcFontCacheDispatch,
SProcFontCacheDispatch,
FontCacheResetProc,
StandardMinorOpcode))) {
FontCacheReqCode = (unsigned char)extEntry->base;
miscErrorBase = extEntry->errorBase;
}
}
/*ARGSUSED*/
static void
FontCacheResetProc (extEntry)
ExtensionEntry* extEntry;
{
}
static int
ProcFontCacheQueryVersion(client)
register ClientPtr client;
{
xFontCacheQueryVersionReply rep;
register int n;
REQUEST_SIZE_MATCH(xFontCacheQueryVersionReq);
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
rep.majorVersion = FONTCACHE_MAJOR_VERSION;
rep.minorVersion = FONTCACHE_MINOR_VERSION;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swaps(&rep.majorVersion, n);
swaps(&rep.minorVersion, n);
}
WriteToClient(client, SIZEOF(xFontCacheQueryVersionReply), (char *)&rep);
return (client->noClientException);
}
static int
ProcFontCacheGetCacheSettings(client)
register ClientPtr client;
{
xFontCacheGetCacheSettingsReply rep;
FontCacheSettings cinfo;
register int n;
REQUEST_SIZE_MATCH(xFontCacheGetCacheSettingsReq);
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.length = 0;
/* XXX */
FontCacheGetSettings(&cinfo);
rep.himark = cinfo.himark;
rep.lowmark = cinfo.lowmark;
rep.balance = cinfo.balance;
rep.reserve0 = 0;
rep.reserve1 = 0;
rep.reserve2 = 0;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.himark, n);
swapl(&rep.lowmark, n);
swapl(&rep.balance, n);
swapl(&rep.reserve0, n);
swapl(&rep.reserve1, n);
swapl(&rep.reserve2, n);
}
/* XXX */
WriteToClient(client, SIZEOF(xFontCacheGetCacheSettingsReply),
(char *)&rep);
return (client->noClientException);
}
static int
ProcFontCacheGetCacheStatistics(client)
register ClientPtr client;
{
xFontCacheGetCacheStatisticsReply rep;
FontCacheStatistics cstats;
register int n;
REQUEST_SIZE_MATCH(xFontCacheGetCacheStatisticsReq);
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.length = (sz_xFontCacheGetCacheStatisticsReply - 32) >> 2;
/* XXX */
FontCacheGetStatistics(&cstats);
rep.purge_runs = cstats.purge_runs;
rep.purge_stat = cstats.purge_stat;
rep.balance = cstats.balance;
rep.reserve0 = 0;
rep.f_hits = cstats.f.hits;
rep.f_misshits = cstats.f.misshits;
rep.f_purged = cstats.f.purged;
rep.f_usage = cstats.f.usage;
rep.f_reserve0 = 0;
rep.v_hits = cstats.v.hits;
rep.v_misshits = cstats.v.misshits;
rep.v_purged = cstats.v.purged;
rep.v_usage = cstats.v.usage;
rep.v_reserve0 = 0;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.purge_runs, n);
swapl(&rep.purge_stat, n);
swapl(&rep.balance, n);
swapl(&rep.reserve0, n);
swapl(&rep.f_hits, n);
swapl(&rep.f_misshits, n);
swapl(&rep.f_purged, n);
swapl(&rep.f_usage, n);
swapl(&rep.f_reserve0, n);
swapl(&rep.v_hits, n);
swapl(&rep.v_misshits, n);
swapl(&rep.v_purged, n);
swapl(&rep.v_usage, n);
swapl(&rep.v_reserve0, n);
}
/* XXX */
WriteToClient(client, SIZEOF(xFontCacheGetCacheStatisticsReply),
(char *)&rep);
return (client->noClientException);
}
static int
ProcFontCacheChangeCacheSettings(client)
register ClientPtr client;
{
FontCacheSettings cs;
REQUEST(xFontCacheChangeCacheSettingsReq);
REQUEST_SIZE_MATCH(xFontCacheChangeCacheSettingsReq);
/* XXX */
cs.himark = stuff->himark;
cs.lowmark = stuff->lowmark;
cs.balance = stuff->balance;
if (cs.himark < 0 || cs.lowmark < 0)
return BadValue;
if (cs.himark <= cs.lowmark)
return BadValue;
if (!(10 <= cs.balance && cs.balance <= 90))
return BadValue;
if (FontCacheChangeSettings(&cs) == 0)
return miscErrorBase + FontCacheCannotAllocMemory;
/* XXX */
return (client->noClientException);
}
static int
ProcFontCacheDispatch (client)
register ClientPtr client;
{
REQUEST(xReq);
switch (stuff->data)
{
case X_FontCacheQueryVersion:
return ProcFontCacheQueryVersion(client);
case X_FontCacheGetCacheSettings:
return ProcFontCacheGetCacheSettings(client);
case X_FontCacheGetCacheStatistics:
return ProcFontCacheGetCacheStatistics(client);
case X_FontCacheChangeCacheSettings:
return ProcFontCacheChangeCacheSettings(client);
default:
return miscErrorBase + FontCacheBadProtocol;
}
}
static int
SProcFontCacheQueryVersion(client)
register ClientPtr client;
{
register int n;
REQUEST(xFontCacheQueryVersionReq);
swaps(&stuff->length, n);
return ProcFontCacheQueryVersion(client);
}
static int
SProcFontCacheGetCacheSettings(client)
ClientPtr client;
{
register int n;
REQUEST(xFontCacheGetCacheSettingsReq);
swaps(&stuff->length, n);
REQUEST_SIZE_MATCH(xFontCacheGetCacheSettingsReq);
return ProcFontCacheGetCacheSettings(client);
}
static int
SProcFontCacheGetCacheStatistics(client)
ClientPtr client;
{
register int n;
REQUEST(xFontCacheGetCacheStatisticsReq);
swaps(&stuff->length, n);
REQUEST_SIZE_MATCH(xFontCacheGetCacheStatisticsReq);
return ProcFontCacheGetCacheStatistics(client);
}
static int
SProcFontCacheChangeCacheSettings(client)
ClientPtr client;
{
register int n;
REQUEST(xFontCacheChangeCacheSettingsReq);
swaps(&stuff->length, n);
REQUEST_SIZE_MATCH(xFontCacheChangeCacheSettingsReq);
/* XXX */
swapl(&stuff->himark, n);
swapl(&stuff->lowmark, n);
swapl(&stuff->balance, n);
/* XXX */
return ProcFontCacheChangeCacheSettings(client);
}
static int
SProcFontCacheDispatch (client)
register ClientPtr client;
{
REQUEST(xReq);
switch (stuff->data)
{
case X_FontCacheQueryVersion:
return SProcFontCacheQueryVersion(client);
case X_FontCacheGetCacheSettings:
return SProcFontCacheGetCacheSettings(client);
case X_FontCacheGetCacheStatistics:
return SProcFontCacheGetCacheStatistics(client);
case X_FontCacheChangeCacheSettings:
return SProcFontCacheChangeCacheSettings(client);
default:
return miscErrorBase + FontCacheBadProtocol;
}
}

101
Xext/panoramiX.h Normal file
View File

@ -0,0 +1,101 @@
/* $TOG: panoramiX.h /main/4 1998/03/17 06:51:02 kaleb $ */
/****************************************************************
* *
* Copyright (c) Digital Equipment Corporation, 1991, 1997 *
* *
* All Rights Reserved. Unpublished rights reserved under *
* the copyright laws of the United States. *
* *
* The software contained on this media is proprietary to *
* and embodies the confidential technology of Digital *
* Equipment Corporation. Possession, use, duplication or *
* dissemination of the software and media is authorized only *
* pursuant to a valid written license from Digital Equipment *
* Corporation. *
* *
* RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *
* by the U.S. Government is subject to restrictions as set *
* forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *
* or in FAR 52.227-19, as applicable. *
* *
*****************************************************************/
/* $XFree86: xc/programs/Xserver/Xext/panoramiX.h,v 1.5 2001/01/03 02:54:17 keithp Exp $ */
/* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */
/*
* PanoramiX definitions
*/
#ifndef _PANORAMIX_H_
#define _PANORAMIX_H_
#include "panoramiXext.h"
#include "gcstruct.h"
typedef struct _PanoramiXData {
int x;
int y;
int width;
int height;
} PanoramiXData;
typedef struct _PanoramiXInfo {
XID id ;
} PanoramiXInfo;
typedef struct {
PanoramiXInfo info[MAXSCREENS];
RESTYPE type;
union {
struct {
char visibility;
char class;
} win;
struct {
Bool shared;
} pix;
#ifdef RENDER
struct {
Bool root;
} pict;
#endif
char raw_data[4];
} u;
} PanoramiXRes;
#define FOR_NSCREENS_FORWARD(j) for(j = 0; j < PanoramiXNumScreens; j++)
#define FOR_NSCREENS_BACKWARD(j) for(j = PanoramiXNumScreens - 1; j >= 0; j--)
#define FOR_NSCREENS(j) FOR_NSCREENS_FORWARD(j)
#define BREAK_IF(a) if ((a)) break
#define IF_RETURN(a,b) if ((a)) return (b)
#define FORCE_ROOT(a) { \
int _j; \
for (_j = PanoramiXNumScreens - 1; _j; _j--) \
if ((a).root == WindowTable[_j]->drawable.id) \
break; \
(a).rootX += panoramiXdataPtr[_j].x; \
(a).rootY += panoramiXdataPtr[_j].y; \
(a).root = WindowTable[0]->drawable.id; \
}
#define FORCE_WIN(a) { \
if ((win = PanoramiXFindIDOnAnyScreen(XRT_WINDOW, a))) { \
(a) = win->info[0].id; /* Real ID */ \
} \
}
#define FORCE_CMAP(a) { \
if ((win = PanoramiXFindIDOnAnyScreen(XRT_COLORMAP, a))) { \
(a) = win->info[0].id; /* Real ID */ \
} \
}
#define IS_SHARED_PIXMAP(r) (((r)->type == XRT_PIXMAP) && (r)->u.pix.shared)
#define SKIP_FAKE_WINDOW(a) if(!LookupIDByType(a, XRT_WINDOW)) return
#endif /* _PANORAMIX_H_ */

44
Xext/panoramiXsrv.h Normal file
View File

@ -0,0 +1,44 @@
/* $XFree86: xc/programs/Xserver/Xext/panoramiXsrv.h,v 1.9 2001/08/11 21:00:06 mvojkovi Exp $ */
#ifndef _PANORAMIXSRV_H_
#define _PANORAMIXSRV_H_
#include "panoramiX.h"
extern int PanoramiXNumScreens;
extern PanoramiXData *panoramiXdataPtr;
extern int PanoramiXPixWidth;
extern int PanoramiXPixHeight;
extern RegionRec PanoramiXScreenRegion;
extern XID *PanoramiXVisualTable;
extern void PanoramiXConsolidate(void);
extern Bool PanoramiXCreateConnectionBlock(void);
extern PanoramiXRes * PanoramiXFindIDByScrnum(RESTYPE, XID, int);
extern PanoramiXRes * PanoramiXFindIDOnAnyScreen(RESTYPE, XID);
extern WindowPtr PanoramiXChangeWindow(int, WindowPtr);
extern Bool XineramaRegisterConnectionBlockCallback(void (*func)(void));
extern int XineramaDeleteResource(pointer, XID);
extern RegionRec XineramaScreenRegions[MAXSCREENS];
extern unsigned long XRC_DRAWABLE;
extern unsigned long XRT_WINDOW;
extern unsigned long XRT_PIXMAP;
extern unsigned long XRT_GC;
extern unsigned long XRT_COLORMAP;
extern void XineramaGetImageData(
DrawablePtr *pDrawables,
int left,
int top,
int width,
int height,
unsigned int format,
unsigned long planemask,
char *data,
int pitch,
Bool isRoot
);
#endif /* _PANORAMIXSRV_H_ */

1326
Xext/saver.c Normal file

File diff suppressed because it is too large Load Diff

47
Xext/sleepuntil.h Normal file
View File

@ -0,0 +1,47 @@
/* $XFree86: xc/programs/Xserver/Xext/sleepuntil.h,v 1.1 2001/08/01 00:44:44 tsi Exp $ */
/*
* Copyright (C) 2001 The XFree86 Project, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of the XFree86 Project shall
* not be used in advertising or otherwise to promote the sale, use or other
* dealings in this Software without prior written authorization from the
* XFree86 Project.
*/
#ifndef _SLEEPUNTIL_H_
#define _SLEEPUNTIL_H_ 1
#include "dix.h"
extern int ClientSleepUntil(
#if NeedFunctionPrototypes
ClientPtr client,
TimeStamp *revive,
void (*notifyFunc)(
#if NeedNestedPrototypes
ClientPtr /* client */,
pointer /* closure */
#endif
),
pointer Closure
#endif
);
#endif

760
Xext/xf86bigfont.c Normal file
View File

@ -0,0 +1,760 @@
/* $XFree86: xc/programs/Xserver/Xext/xf86bigfont.c,v 1.13 2001/06/30 22:41:44 tsi Exp $ */
/*
* BIGFONT extension for sharing font metrics between clients (if possible)
* and for transmitting font metrics to clients in a compressed form.
*
* Copyright (c) 1999-2000 Bruno Haible
* Copyright (c) 1999-2000 The XFree86 Project, Inc.
*/
/* THIS IS NOT AN X CONSORTIUM STANDARD */
/*
* Big fonts suffer from the following: All clients that have opened a
* font can access the complete glyph metrics array (the XFontStruct member
* `per_char') directly, without going through a macro. Moreover these
* glyph metrics are ink metrics, i.e. are not redundant even for a
* fixed-width font. For a Unicode font, the size of this array is 768 KB.
*
* Problems: 1. It eats a lot of memory in each client. 2. All this glyph
* metrics data is piped through the socket when the font is opened.
*
* This extension addresses these two problems for local clients, by using
* shared memory. It also addresses the second problem for non-local clients,
* by compressing the data before transmit by a factor of nearly 6.
*
* If you use this extension, your OS ought to nicely support shared memory.
* This means: Shared memory should be swappable to the swap, and the limits
* should be high enough (SHMMNI at least 64, SHMMAX at least 768 KB,
* SHMALL at least 48 MB). It is a plus if your OS allows shmat() calls
* on segments that have already been marked "removed", because it permits
* these segments to be cleaned up by the OS if the X server is killed with
* signal SIGKILL.
*
* This extension is transparently exploited by Xlib (functions XQueryFont,
* XLoadQueryFont).
*/
#include <sys/types.h>
#ifdef HAS_SHM
#if defined(linux) && (!defined(__GNU_LIBRARY__) || __GNU_LIBRARY__ < 2)
/* libc4 does not define __GNU_LIBRARY__, libc5 defines __GNU_LIBRARY__ as 1 */
/* Linux libc4 and libc5 only (because glibc doesn't include kernel headers):
Linux 2.0.x and 2.2.x define SHMLBA as PAGE_SIZE, but forget to define
PAGE_SIZE. It is defined in <asm/page.h>. */
#include <asm/page.h>
#endif
#ifdef SVR4
#include <sys/sysmacros.h>
#endif
#if defined(ISC) || defined(__CYGWIN__) || defined(SCO) || defined(SCO325)
#include <sys/param.h>
#include <sys/sysmacros.h>
#endif
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <errno.h>
#endif
#include "X.h"
#include "Xproto.h"
#include "misc.h"
#include "os.h"
#include "dixstruct.h"
#include "gcstruct.h"
#include "dixfontstr.h"
#include "extnsionst.h"
#define _XF86BIGFONT_SERVER_
#include "xf86bigfstr.h"
static void XF86BigfontResetProc(
#if NeedFunctionPrototypes
ExtensionEntry * /* extEntry */
#endif
);
static DISPATCH_PROC(ProcXF86BigfontDispatch);
static DISPATCH_PROC(ProcXF86BigfontQueryVersion);
static DISPATCH_PROC(ProcXF86BigfontQueryFont);
static DISPATCH_PROC(SProcXF86BigfontDispatch);
static DISPATCH_PROC(SProcXF86BigfontQueryVersion);
static DISPATCH_PROC(SProcXF86BigfontQueryFont);
static unsigned char XF86BigfontReqCode;
#ifdef HAS_SHM
/* A random signature, transmitted to the clients so they can verify that the
shared memory segment they are attaching to was really established by the
X server they are talking to. */
static CARD32 signature;
/* Index for additional information stored in a FontRec's devPrivates array. */
static int FontShmdescIndex;
static unsigned int pagesize;
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__)
#include <sys/signal.h>
static Bool badSysCall = FALSE;
static void
SigSysHandler(
int signo)
{
badSysCall = TRUE;
}
static Bool CheckForShmSyscall()
{
void (*oldHandler)();
int shmid = -1;
/* If no SHM support in the kernel, the bad syscall will generate SIGSYS */
oldHandler = signal(SIGSYS, SigSysHandler);
badSysCall = FALSE;
shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT);
/* Clean up */
if (shmid != -1) {
shmctl(shmid, IPC_RMID, (struct shmid_ds *)NULL);
}
signal(SIGSYS, oldHandler);
return (!badSysCall);
}
#define MUST_CHECK_FOR_SHM_SYSCALL
#endif
#endif
void
XFree86BigfontExtensionInit()
{
ExtensionEntry* extEntry;
if ((extEntry = AddExtension(XF86BIGFONTNAME,
XF86BigfontNumberEvents,
XF86BigfontNumberErrors,
ProcXF86BigfontDispatch,
SProcXF86BigfontDispatch,
XF86BigfontResetProc,
StandardMinorOpcode))) {
XF86BigfontReqCode = (unsigned char) extEntry->base;
#ifdef HAS_SHM
#ifdef MUST_CHECK_FOR_SHM_SYSCALL
if (!CheckForShmSyscall()) {
ErrorF(XF86BIGFONTNAME " extension disabled due to lack of shared memory support in the kernel\n");
return;
}
#endif
srand((unsigned int) time(NULL));
signature = ((unsigned int) (65536.0/(RAND_MAX+1.0) * rand()) << 16)
+ (unsigned int) (65536.0/(RAND_MAX+1.0) * rand());
/* fprintf(stderr, "signature = 0x%08X\n", signature); */
FontShmdescIndex = AllocateFontPrivateIndex();
#if !defined(CSRG_BASED) && !defined(__CYGWIN__)
pagesize = SHMLBA;
#else
# ifdef _SC_PAGESIZE
pagesize = sysconf(_SC_PAGESIZE);
# else
pagesize = getpagesize();
# endif
#endif
#endif
}
}
/* ========== Management of shared memory segments ========== */
#ifdef HAS_SHM
#ifdef __linux__
/* On Linux, shared memory marked as "removed" can still be attached.
Nice feature, because the kernel will automatically free the associated
storage when the server and all clients are gone. */
#define EARLY_REMOVE
#endif
typedef struct _ShmDesc {
struct _ShmDesc *next;
struct _ShmDesc **prev;
int shmid;
char *attach_addr;
} ShmDescRec, *ShmDescPtr;
static ShmDescPtr ShmList = (ShmDescPtr) NULL;
static ShmDescPtr
shmalloc(
unsigned int size)
{
ShmDescPtr pDesc;
int shmid;
char *addr;
#ifdef MUST_CHECK_FOR_SHM_SYSCALL
if (pagesize == 0)
return (ShmDescPtr) NULL;
#endif
/* On some older Linux systems, the number of shared memory segments
system-wide is 127. In Linux 2.4, it is 4095.
Therefore there is a tradeoff to be made between allocating a
shared memory segment on one hand, and allocating memory and piping
the glyph metrics on the other hand. If the glyph metrics size is
small, we prefer the traditional way. */
if (size < 3500)
return (ShmDescPtr) NULL;
pDesc = (ShmDescRec *) xalloc(sizeof(ShmDescRec));
if (!pDesc)
return (ShmDescPtr) NULL;
size = (size + pagesize-1) & -pagesize;
shmid = shmget(IPC_PRIVATE, size, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH);
if (shmid == -1) {
ErrorF(XF86BIGFONTNAME " extension: shmget() failed, size = %u, errno = %d\n",
size, errno);
xfree(pDesc);
return (ShmDescPtr) NULL;
}
if ((addr = shmat(shmid, 0, 0)) == (char *)-1) {
ErrorF(XF86BIGFONTNAME " extension: shmat() failed, size = %u, errno = %d\n",
size, errno);
shmctl(shmid, IPC_RMID, (void *) 0);
xfree(pDesc);
return (ShmDescPtr) NULL;
}
#ifdef EARLY_REMOVE
shmctl(shmid, IPC_RMID, (void *) 0);
#endif
pDesc->shmid = shmid;
pDesc->attach_addr = addr;
if (ShmList) ShmList->prev = &pDesc->next;
pDesc->next = ShmList;
pDesc->prev = &ShmList;
ShmList = pDesc;
return pDesc;
}
static void
shmdealloc(
ShmDescPtr pDesc)
{
#ifndef EARLY_REMOVE
shmctl(pDesc->shmid, IPC_RMID, (void *) 0);
#endif
shmdt(pDesc->attach_addr);
if (pDesc->next) pDesc->next->prev = pDesc->prev;
*pDesc->prev = pDesc->next;
xfree(pDesc);
}
#endif
/* Called when a font is closed. */
void
XF86BigfontFreeFontShm(
FontPtr pFont)
{
#ifdef HAS_SHM
ShmDescPtr pDesc;
/* If during shutdown of the server, XF86BigfontCleanup() has already
* called shmdealloc() for all segments, we don't need to do it here.
*/
if (!ShmList)
return;
pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex);
if (pDesc)
shmdealloc(pDesc);
#endif
}
/* Called upon fatal signal. */
void
XF86BigfontCleanup()
{
#ifdef HAS_SHM
while (ShmList)
shmdealloc(ShmList);
#endif
}
/* Called when a server generation dies. */
static void
XF86BigfontResetProc(
ExtensionEntry* extEntry)
{
/* This function is normally called from CloseDownExtensions(), called
* from main(). It will be followed by a call to FreeAllResources(),
* which will call XF86BigfontFreeFontShm() for each font. Thus it
* appears that we do not need to do anything in this function. --
* But I prefer to write robust code, and not keep shared memory lying
* around when it's not needed any more. (Someone might close down the
* extension without calling FreeAllResources()...)
*/
XF86BigfontCleanup();
}
/* ========== Handling of extension specific requests ========== */
static int
ProcXF86BigfontQueryVersion(
ClientPtr client)
{
xXF86BigfontQueryVersionReply reply;
REQUEST_SIZE_MATCH(xXF86BigfontQueryVersionReq);
reply.type = X_Reply;
reply.length = 0;
reply.sequenceNumber = client->sequence;
reply.majorVersion = XF86BIGFONT_MAJOR_VERSION;
reply.minorVersion = XF86BIGFONT_MINOR_VERSION;
reply.uid = geteuid();
reply.gid = getegid();
#ifdef HAS_SHM
reply.signature = signature;
#else
reply.signature = 0; /* This is redundant. Avoids uninitialized memory. */
#endif
reply.capabilities =
#ifdef HAS_SHM
(LocalClient(client) && !client->swapped ? XF86Bigfont_CAP_LocalShm : 0)
#else
0
#endif
; /* may add more bits here in future versions */
if (client->swapped) {
char tmp;
swaps(&reply.sequenceNumber, tmp);
swapl(&reply.length, tmp);
swaps(&reply.majorVersion, tmp);
swaps(&reply.minorVersion, tmp);
swapl(&reply.uid, tmp);
swapl(&reply.gid, tmp);
swapl(&reply.signature, tmp);
}
WriteToClient(client,
sizeof(xXF86BigfontQueryVersionReply), (char *)&reply);
return client->noClientException;
}
static void
swapCharInfo(
xCharInfo *pCI)
{
char tmp;
swaps(&pCI->leftSideBearing, tmp);
swaps(&pCI->rightSideBearing, tmp);
swaps(&pCI->characterWidth, tmp);
swaps(&pCI->ascent, tmp);
swaps(&pCI->descent, tmp);
swaps(&pCI->attributes, tmp);
}
/* static CARD32 hashCI (xCharInfo *p); */
#define hashCI(p) \
(CARD32)(((p->leftSideBearing << 27) + (p->leftSideBearing >> 5) + \
(p->rightSideBearing << 23) + (p->rightSideBearing >> 9) + \
(p->characterWidth << 16) + \
(p->ascent << 11) + (p->descent << 6)) ^ p->attributes)
static int
ProcXF86BigfontQueryFont(
ClientPtr client)
{
FontPtr pFont;
REQUEST(xXF86BigfontQueryFontReq);
CARD32 stuff_flags;
xCharInfo* pmax;
xCharInfo* pmin;
int nCharInfos;
int shmid;
#ifdef HAS_SHM
ShmDescPtr pDesc;
#else
#define pDesc 0
#endif
xCharInfo* pCI;
CARD16* pIndex2UniqIndex;
CARD16* pUniqIndex2Index;
CARD32 nUniqCharInfos;
#if 0
REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq);
#else
switch (client->req_len) {
case 2: /* client with version 1.0 libX11 */
stuff_flags = (LocalClient(client) && !client->swapped ? XF86Bigfont_FLAGS_Shm : 0);
break;
case 3: /* client with version 1.1 libX11 */
stuff_flags = stuff->flags;
break;
default:
return BadLength;
}
#endif
client->errorValue = stuff->id; /* EITHER font or gc */
pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT,
SecurityReadAccess);
if (!pFont) {
/* can't use VERIFY_GC because it might return BadGC */
GC *pGC = (GC *) SecurityLookupIDByType(client, stuff->id, RT_GC,
SecurityReadAccess);
if (!pGC) {
client->errorValue = stuff->id;
return BadFont; /* procotol spec says only error is BadFont */
}
pFont = pGC->font;
}
pmax = FONTINKMAX(pFont);
pmin = FONTINKMIN(pFont);
nCharInfos =
(pmax->rightSideBearing == pmin->rightSideBearing
&& pmax->leftSideBearing == pmin->leftSideBearing
&& pmax->descent == pmin->descent
&& pmax->ascent == pmin->ascent
&& pmax->characterWidth == pmin->characterWidth)
? 0 : N2dChars(pFont);
shmid = -1;
pCI = NULL;
pIndex2UniqIndex = NULL;
pUniqIndex2Index = NULL;
nUniqCharInfos = 0;
if (nCharInfos > 0) {
#ifdef HAS_SHM
pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex);
if (pDesc) {
pCI = (xCharInfo *) pDesc->attach_addr;
if (stuff_flags & XF86Bigfont_FLAGS_Shm)
shmid = pDesc->shmid;
} else {
if (stuff_flags & XF86Bigfont_FLAGS_Shm)
pDesc = shmalloc(nCharInfos * sizeof(xCharInfo)
+ sizeof(CARD32));
if (pDesc) {
pCI = (xCharInfo *) pDesc->attach_addr;
shmid = pDesc->shmid;
} else {
#endif
pCI = (xCharInfo *)
ALLOCATE_LOCAL(nCharInfos * sizeof(xCharInfo));
if (!pCI)
return BadAlloc;
#ifdef HAS_SHM
}
#endif
/* Fill nCharInfos starting at pCI. */
{
xCharInfo* prCI = pCI;
int ninfos = 0;
int ncols = pFont->info.lastCol - pFont->info.firstCol + 1;
int row;
for (row = pFont->info.firstRow;
row <= pFont->info.lastRow && ninfos < nCharInfos;
row++) {
unsigned char chars[512];
xCharInfo* tmpCharInfos[256];
unsigned long count;
int col;
unsigned long i;
i = 0;
for (col = pFont->info.firstCol;
col <= pFont->info.lastCol;
col++) {
chars[i++] = row;
chars[i++] = col;
}
(*pFont->get_metrics) (pFont, ncols, chars, TwoD16Bit,
&count, tmpCharInfos);
for (i = 0; i < count && ninfos < nCharInfos; i++) {
*prCI++ = *tmpCharInfos[i];
ninfos++;
}
}
}
#ifdef HAS_SHM
if (pDesc) {
*(CARD32 *)(pCI + nCharInfos) = signature;
if (!FontSetPrivate(pFont, FontShmdescIndex, pDesc)) {
shmdealloc(pDesc);
return BadAlloc;
}
}
}
#endif
if (shmid == -1) {
/* Cannot use shared memory, so remove-duplicates the xCharInfos
using a temporary hash table. */
/* Note that CARD16 is suitable as index type, because
nCharInfos <= 0x10000. */
CARD32 hashModulus;
CARD16* pHash2UniqIndex;
CARD16* pUniqIndex2NextUniqIndex;
CARD32 NextIndex;
CARD32 NextUniqIndex;
CARD16* tmp;
CARD32 i, j;
hashModulus = 67;
if (hashModulus > nCharInfos+1)
hashModulus = nCharInfos+1;
tmp = (CARD16*)
ALLOCATE_LOCAL((4*nCharInfos+1) * sizeof(CARD16));
if (!tmp) {
if (!pDesc) DEALLOCATE_LOCAL(pCI);
return BadAlloc;
}
pIndex2UniqIndex = tmp;
/* nCharInfos elements */
pUniqIndex2Index = tmp + nCharInfos;
/* max. nCharInfos elements */
pUniqIndex2NextUniqIndex = tmp + 2*nCharInfos;
/* max. nCharInfos elements */
pHash2UniqIndex = tmp + 3*nCharInfos;
/* hashModulus (<= nCharInfos+1) elements */
/* Note that we can use 0xffff as end-of-list indicator, because
even if nCharInfos = 0x10000, 0xffff can not occur as valid
entry before the last element has been inserted. And once the
last element has been inserted, we don't need the hash table
any more. */
for (j = 0; j < hashModulus; j++)
pHash2UniqIndex[j] = (CARD16)(-1);
NextUniqIndex = 0;
for (NextIndex = 0; NextIndex < nCharInfos; NextIndex++) {
xCharInfo* p = &pCI[NextIndex];
CARD32 hashCode = hashCI(p) % hashModulus;
for (i = pHash2UniqIndex[hashCode];
i != (CARD16)(-1);
i = pUniqIndex2NextUniqIndex[i]) {
j = pUniqIndex2Index[i];
if (pCI[j].leftSideBearing == p->leftSideBearing
&& pCI[j].rightSideBearing == p->rightSideBearing
&& pCI[j].characterWidth == p->characterWidth
&& pCI[j].ascent == p->ascent
&& pCI[j].descent == p->descent
&& pCI[j].attributes == p->attributes)
break;
}
if (i != (CARD16)(-1)) {
/* Found *p at Index j, UniqIndex i */
pIndex2UniqIndex[NextIndex] = i;
} else {
/* Allocate a new entry in the Uniq table */
if (hashModulus <= 2*NextUniqIndex
&& hashModulus < nCharInfos+1) {
/* Time to increate hash table size */
hashModulus = 2*hashModulus+1;
if (hashModulus > nCharInfos+1)
hashModulus = nCharInfos+1;
for (j = 0; j < hashModulus; j++)
pHash2UniqIndex[j] = (CARD16)(-1);
for (i = 0; i < NextUniqIndex; i++)
pUniqIndex2NextUniqIndex[i] = (CARD16)(-1);
for (i = 0; i < NextUniqIndex; i++) {
j = pUniqIndex2Index[i];
p = &pCI[j];
hashCode = hashCI(p) % hashModulus;
pUniqIndex2NextUniqIndex[i] = pHash2UniqIndex[hashCode];
pHash2UniqIndex[hashCode] = i;
}
p = &pCI[NextIndex];
hashCode = hashCI(p) % hashModulus;
}
i = NextUniqIndex++;
pUniqIndex2NextUniqIndex[i] = pHash2UniqIndex[hashCode];
pHash2UniqIndex[hashCode] = i;
pUniqIndex2Index[i] = NextIndex;
pIndex2UniqIndex[NextIndex] = i;
}
}
nUniqCharInfos = NextUniqIndex;
/* fprintf(stderr, "font metrics: nCharInfos = %d, nUniqCharInfos = %d, hashModulus = %d\n", nCharInfos, nUniqCharInfos, hashModulus); */
}
}
{
int nfontprops = pFont->info.nprops;
int rlength =
sizeof(xXF86BigfontQueryFontReply)
+ nfontprops * sizeof(xFontProp)
+ (nCharInfos > 0 && shmid == -1
? nUniqCharInfos * sizeof(xCharInfo)
+ (nCharInfos+1)/2 * 2 * sizeof(CARD16)
: 0);
xXF86BigfontQueryFontReply* reply =
(xXF86BigfontQueryFontReply *) ALLOCATE_LOCAL(rlength);
char* p;
if (!reply) {
if (nCharInfos > 0) {
if (shmid == -1) DEALLOCATE_LOCAL(pIndex2UniqIndex);
if (!pDesc) DEALLOCATE_LOCAL(pCI);
}
return BadAlloc;
}
reply->type = X_Reply;
reply->length = (rlength - sizeof(xGenericReply)) >> 2;
reply->sequenceNumber = client->sequence;
reply->minBounds = pFont->info.ink_minbounds;
reply->maxBounds = pFont->info.ink_maxbounds;
reply->minCharOrByte2 = pFont->info.firstCol;
reply->maxCharOrByte2 = pFont->info.lastCol;
reply->defaultChar = pFont->info.defaultCh;
reply->nFontProps = pFont->info.nprops;
reply->drawDirection = pFont->info.drawDirection;
reply->minByte1 = pFont->info.firstRow;
reply->maxByte1 = pFont->info.lastRow;
reply->allCharsExist = pFont->info.allExist;
reply->fontAscent = pFont->info.fontAscent;
reply->fontDescent = pFont->info.fontDescent;
reply->nCharInfos = nCharInfos;
reply->nUniqCharInfos = nUniqCharInfos;
reply->shmid = shmid;
reply->shmsegoffset = 0;
if (client->swapped) {
char tmp;
swaps(&reply->sequenceNumber, tmp);
swapl(&reply->length, tmp);
swapCharInfo(&reply->minBounds);
swapCharInfo(&reply->maxBounds);
swaps(&reply->minCharOrByte2, tmp);
swaps(&reply->maxCharOrByte2, tmp);
swaps(&reply->defaultChar, tmp);
swaps(&reply->nFontProps, tmp);
swaps(&reply->fontAscent, tmp);
swaps(&reply->fontDescent, tmp);
swapl(&reply->nCharInfos, tmp);
swapl(&reply->nUniqCharInfos, tmp);
swapl(&reply->shmid, tmp);
swapl(&reply->shmsegoffset, tmp);
}
p = (char*) &reply[1];
{
FontPropPtr pFP;
xFontProp* prFP;
int i;
for (i = 0, pFP = pFont->info.props, prFP = (xFontProp *) p;
i < nfontprops;
i++, pFP++, prFP++) {
prFP->name = pFP->name;
prFP->value = pFP->value;
if (client->swapped) {
char tmp;
swapl(&prFP->name, tmp);
swapl(&prFP->value, tmp);
}
}
p = (char*) prFP;
}
if (nCharInfos > 0 && shmid == -1) {
xCharInfo* pci;
CARD16* ps;
int i, j;
pci = (xCharInfo*) p;
for (i = 0; i < nUniqCharInfos; i++, pci++) {
*pci = pCI[pUniqIndex2Index[i]];
if (client->swapped)
swapCharInfo(pci);
}
ps = (CARD16*) pci;
for (j = 0; j < nCharInfos; j++, ps++) {
*ps = pIndex2UniqIndex[j];
if (client->swapped) {
char tmp;
swaps(ps, tmp);
}
}
}
WriteToClient(client, rlength, (char *)reply);
DEALLOCATE_LOCAL(reply);
if (nCharInfos > 0) {
if (shmid == -1) DEALLOCATE_LOCAL(pIndex2UniqIndex);
if (!pDesc) DEALLOCATE_LOCAL(pCI);
}
return (client->noClientException);
}
}
static int
ProcXF86BigfontDispatch(
ClientPtr client)
{
REQUEST(xReq);
switch (stuff->data) {
case X_XF86BigfontQueryVersion:
return ProcXF86BigfontQueryVersion(client);
case X_XF86BigfontQueryFont:
return ProcXF86BigfontQueryFont(client);
default:
return BadRequest;
}
}
static int
SProcXF86BigfontQueryVersion(
ClientPtr client)
{
REQUEST(xXF86BigfontQueryVersionReq);
char tmp;
swaps(&stuff->length, tmp);
return ProcXF86BigfontQueryVersion(client);
}
static int
SProcXF86BigfontQueryFont(
ClientPtr client)
{
REQUEST(xXF86BigfontQueryFontReq);
char tmp;
swaps(&stuff->length, tmp);
REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq);
swapl(&stuff->id, tmp);
return ProcXF86BigfontQueryFont(client);
}
static int
SProcXF86BigfontDispatch(
ClientPtr client)
{
REQUEST(xReq);
switch (stuff->data) {
case X_XF86BigfontQueryVersion:
return SProcXF86BigfontQueryVersion(client);
case X_XF86BigfontQueryFont:
return SProcXF86BigfontQueryFont(client);
default:
return BadRequest;
}
}

335
Xext/xres.c Normal file
View File

@ -0,0 +1,335 @@
/*
Copyright (c) 2002 XFree86 Inc
*/
/* $XFree86: xc/programs/Xserver/Xext/xres.c,v 1.5 2002/07/01 02:25:55 tsi Exp $ */
#define NEED_EVENTS
#define NEED_REPLIES
#include "X.h"
#include "Xproto.h"
#include "misc.h"
#include "os.h"
#include "dixstruct.h"
#include "extnsionst.h"
#include "swaprep.h"
#include "XResproto.h"
#include "pixmapstr.h"
extern RESTYPE lastResourceType;
extern RESTYPE TypeMask;
extern Atom *ResourceNames;
static int
ProcXResQueryVersion (ClientPtr client)
{
REQUEST(xXResQueryVersionReq);
xXResQueryVersionReply rep;
CARD16 client_major, client_minor; /* not used */
REQUEST_SIZE_MATCH (xXResQueryVersionReq);
client_major = stuff->client_major;
client_minor = stuff->client_minor;
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
rep.server_major = XRES_MAJOR_VERSION;
rep.server_minor = XRES_MINOR_VERSION;
if (client->swapped) {
int n;
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swaps(&rep.server_major, n);
swaps(&rep.server_minor, n);
}
WriteToClient(client, sizeof (xXResQueryVersionReply), (char *)&rep);
return (client->noClientException);
}
static int
ProcXResQueryClients (ClientPtr client)
{
/* REQUEST(xXResQueryClientsReq); */
xXResQueryClientsReply rep;
int *current_clients;
int i;
REQUEST_SIZE_MATCH(xXResQueryClientsReq);
current_clients = ALLOCATE_LOCAL((currentMaxClients - 1) * sizeof(int));
rep.num_clients = 0;
for(i = 1; i < currentMaxClients; i++) {
if(clients[i]) {
current_clients[rep.num_clients] = i;
rep.num_clients++;
}
}
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.length = rep.num_clients * sz_xXResClient >> 2;
if (client->swapped) {
int n;
swaps (&rep.sequenceNumber, n);
swapl (&rep.length, n);
swapl (&rep.num_clients, n);
}
WriteToClient (client, sizeof (xXResQueryClientsReply), (char *) &rep);
if(rep.num_clients) {
xXResClient scratch;
for(i = 0; i < rep.num_clients; i++) {
scratch.resource_base = clients[current_clients[i]]->clientAsMask;
scratch.resource_mask = RESOURCE_ID_MASK;
if(client->swapped) {
register int n;
swapl (&scratch.resource_base, n);
swapl (&scratch.resource_mask, n);
}
WriteToClient (client, sz_xXResClient, (char *) &scratch);
}
}
DEALLOCATE_LOCAL(current_clients);
return (client->noClientException);
}
static void
ResFindAllRes (pointer value, XID id, RESTYPE type, pointer cdata)
{
int *counts = (int *)cdata;
counts[(type & TypeMask) - 1]++;
}
static int
ProcXResQueryClientResources (ClientPtr client)
{
REQUEST(xXResQueryClientResourcesReq);
xXResQueryClientResourcesReply rep;
int i, clientID;
int *counts;
REQUEST_SIZE_MATCH(xXResQueryClientResourcesReq);
clientID = CLIENT_ID(stuff->xid);
/* we could remove the (clientID == 0) check if we wanted to allow
probing the X-server's resource usage */
if(!clientID || (clientID >= currentMaxClients) || !clients[clientID]) {
client->errorValue = stuff->xid;
return BadValue;
}
counts = ALLOCATE_LOCAL((lastResourceType + 1) * sizeof(int));
memset(counts, 0, (lastResourceType + 1) * sizeof(int));
FindAllClientResources(clients[clientID], ResFindAllRes, counts);
rep.num_types = 0;
for(i = 0; i <= lastResourceType; i++) {
if(counts[i]) rep.num_types++;
}
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.length = rep.num_types * sz_xXResType >> 2;
if (client->swapped) {
int n;
swaps (&rep.sequenceNumber, n);
swapl (&rep.length, n);
swapl (&rep.num_types, n);
}
WriteToClient (client,sizeof(xXResQueryClientResourcesReply),(char*)&rep);
if(rep.num_types) {
xXResType scratch;
for(i = 0; i < lastResourceType; i++) {
if(!counts[i]) continue;
if(!ResourceNames[i + 1]) {
char buf[40];
sprintf(buf, "Unregistered resource %i", i + 1);
RegisterResourceName(i + 1, buf);
}
scratch.resource_type = ResourceNames[i + 1];
scratch.count = counts[i];
if(client->swapped) {
register int n;
swapl (&scratch.resource_type, n);
swapl (&scratch.count, n);
}
WriteToClient (client, sz_xXResType, (char *) &scratch);
}
}
DEALLOCATE_LOCAL(counts);
return (client->noClientException);
}
static void
ResFindPixmaps (pointer value, XID id, pointer cdata)
{
unsigned long *bytes = (unsigned long *)cdata;
PixmapPtr pix = (PixmapPtr)value;
*bytes += (pix->devKind * pix->drawable.height);
}
static int
ProcXResQueryClientPixmapBytes (ClientPtr client)
{
REQUEST(xXResQueryClientPixmapBytesReq);
xXResQueryClientPixmapBytesReply rep;
int clientID;
unsigned long bytes;
REQUEST_SIZE_MATCH(xXResQueryClientPixmapBytesReq);
clientID = CLIENT_ID(stuff->xid);
/* we could remove the (clientID == 0) check if we wanted to allow
probing the X-server's resource usage */
if(!clientID || (clientID >= currentMaxClients) || !clients[clientID]) {
client->errorValue = stuff->xid;
return BadValue;
}
bytes = 0;
FindClientResourcesByType(clients[clientID], RT_PIXMAP, ResFindPixmaps,
(pointer)(&bytes));
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.length = 0;
rep.bytes = bytes;
#ifdef XSERVER64
rep.bytes_overflow = bytes >> 32;
#else
rep.bytes_overflow = 0;
#endif
if (client->swapped) {
int n;
swaps (&rep.sequenceNumber, n);
swapl (&rep.length, n);
swapl (&rep.bytes, n);
swapl (&rep.bytes_overflow, n);
}
WriteToClient (client,sizeof(xXResQueryClientPixmapBytesReply),(char*)&rep);
return (client->noClientException);
}
static void
ResResetProc (ExtensionEntry *extEntry) { }
static int
ProcResDispatch (ClientPtr client)
{
REQUEST(xReq);
switch (stuff->data) {
case X_XResQueryVersion:
return ProcXResQueryVersion(client);
case X_XResQueryClients:
return ProcXResQueryClients(client);
case X_XResQueryClientResources:
return ProcXResQueryClientResources(client);
case X_XResQueryClientPixmapBytes:
return ProcXResQueryClientPixmapBytes(client);
default: break;
}
return BadRequest;
}
static int
SProcXResQueryVersion (ClientPtr client)
{
REQUEST(xXResQueryVersionReq);
int n;
REQUEST_SIZE_MATCH (xXResQueryVersionReq);
swaps(&stuff->client_major,n);
swaps(&stuff->client_minor,n);
return ProcXResQueryVersion(client);
}
static int
SProcXResQueryClientResources (ClientPtr client)
{
REQUEST(xXResQueryClientResourcesReq);
int n;
REQUEST_SIZE_MATCH (xXResQueryClientResourcesReq);
swaps(&stuff->xid,n);
return ProcXResQueryClientResources(client);
}
static int
SProcXResQueryClientPixmapBytes (ClientPtr client)
{
REQUEST(xXResQueryClientPixmapBytesReq);
int n;
REQUEST_SIZE_MATCH (xXResQueryClientPixmapBytesReq);
swaps(&stuff->xid,n);
return ProcXResQueryClientPixmapBytes(client);
}
static int
SProcResDispatch (ClientPtr client)
{
REQUEST(xReq);
int n;
swaps(&stuff->length,n);
switch (stuff->data) {
case X_XResQueryVersion:
return SProcXResQueryVersion(client);
case X_XResQueryClients: /* nothing to swap */
return ProcXResQueryClients(client);
case X_XResQueryClientResources:
return SProcXResQueryClientResources(client);
case X_XResQueryClientPixmapBytes:
return SProcXResQueryClientPixmapBytes(client);
default: break;
}
return BadRequest;
}
void
ResExtensionInit(void)
{
ExtensionEntry *extEntry;
extEntry = AddExtension(XRES_NAME, 0, 0,
ProcResDispatch, SProcResDispatch,
ResResetProc, StandardMinorOpcode);
RegisterResourceName(RT_NONE, "NONE");
RegisterResourceName(RT_WINDOW, "WINDOW");
RegisterResourceName(RT_PIXMAP, "PIXMAP");
RegisterResourceName(RT_GC, "GC");
RegisterResourceName(RT_FONT, "FONT");
RegisterResourceName(RT_CURSOR, "CURSOR");
RegisterResourceName(RT_COLORMAP, "COLORMAP");
RegisterResourceName(RT_CMAPENTRY, "COLORMAP ENTRY");
RegisterResourceName(RT_OTHERCLIENT, "OTHER CLIENT");
RegisterResourceName(RT_PASSIVEGRAB, "PASSIVE GRAB");
}

151
Xext/xtest1dd.h Normal file
View File

@ -0,0 +1,151 @@
/* $XFree86: xc/programs/Xserver/Xext/xtest1dd.h,v 3.2 2001/08/01 00:44:44 tsi Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef XTEST1DD_H
#define XTEST1DD_H 1
extern short xtest_mousex;
extern short xtest_mousey;
extern int playback_on;
extern ClientPtr current_xtest_client;
extern ClientPtr playback_client;
extern KeyCode xtest_command_key;
extern void stop_stealing_input(
#if NeedFunctionPrototypes
void
#endif
);
extern void
steal_input(
#if NeedFunctionPrototypes
ClientPtr /* client */,
CARD32 /* mode */
#endif
);
extern void
flush_input_actions(
#if NeedFunctionPrototypes
void
#endif
);
extern void
XTestStealJumpData(
#if NeedFunctionPrototypes
int /* jx */,
int /* jy */,
int /* dev_type */
#endif
);
extern void
XTestStealMotionData(
#if NeedFunctionPrototypes
int /* dx */,
int /* dy */,
int /* dev_type */,
int /* mx */,
int /* my */
#endif
);
extern Bool
XTestStealKeyData(
#if NeedFunctionPrototypes
unsigned /* keycode */,
int /* keystate */,
int /* dev_type */,
int /* locx */,
int /* locy */
#endif
);
extern void
parse_fake_input(
#if NeedFunctionPrototypes
ClientPtr /* client */,
char * /* req */
#endif
);
extern void
XTestComputeWaitTime(
#if NeedFunctionPrototypes
struct timeval * /* waittime */
#endif
);
extern int
XTestProcessInputAction(
#if NeedFunctionPrototypes
int /* readable */,
struct timeval * /* waittime */
#endif
);
extern void
abort_play_back(
#if NeedFunctionPrototypes
void
#endif
);
extern void
return_input_array_size(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
extern void XTestGenerateEvent(
#if NeedFunctionPrototypes
int /* dev_type */,
int /* keycode */,
int /* keystate */,
int /* mousex */,
int /* mousey */
#endif
);
extern void XTestGetPointerPos(
#if NeedFunctionPrototypes
short * /* fmousex */,
short * /* fmousey */
#endif
);
extern void XTestJumpPointer(
#if NeedFunctionPrototypes
int /* jx */,
int /* jy */,
int /* dev_type */
#endif
);
#endif /* XTEST1DD_H */

2214
Xext/xvdisp.c Normal file

File diff suppressed because it is too large Load Diff

291
Xext/xvdix.h Normal file
View File

@ -0,0 +1,291 @@
/***********************************************************
Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Digital or MIT not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
/* $XFree86: xc/programs/Xserver/Xext/xvdix.h,v 1.8 2001/07/25 15:05:00 dawes Exp $ */
#ifndef XVDIX_H
#define XVDIX_H
/*
** File:
**
** xvdix.h --- Xv device independent header file
**
** Author:
**
** David Carver (Digital Workstation Engineering/Project Athena)
**
** Revisions:
**
** 29.08.91 Carver
** - removed UnrealizeWindow wrapper unrealizing windows no longer
** preempts video
**
** 11.06.91 Carver
** - changed SetPortControl to SetPortAttribute
** - changed GetPortControl to GetPortAttribute
** - changed QueryBestSize
**
** 15.05.91 Carver
** - version 2.0 upgrade
**
** 24.01.91 Carver
** - version 1.4 upgrade
**
*/
#include "scrnintstr.h"
#include "Xvproto.h"
extern int XvScreenIndex;
extern unsigned long XvExtensionGeneration;
extern unsigned long XvScreenGeneration;
extern unsigned long XvResourceGeneration;
extern int XvReqCode;
extern int XvEventBase;
extern int XvErrorBase;
extern unsigned long XvRTPort;
extern unsigned long XvRTEncoding;
extern unsigned long XvRTGrab;
extern unsigned long XvRTVideoNotify;
extern unsigned long XvRTVideoNotifyList;
extern unsigned long XvRTPortNotify;
typedef struct {
int numerator;
int denominator;
} XvRationalRec, *XvRationalPtr;
typedef struct {
char depth;
unsigned long visual;
} XvFormatRec, *XvFormatPtr;
typedef struct {
unsigned long id;
ClientPtr client;
} XvGrabRec, *XvGrabPtr;
typedef struct _XvVideoNotifyRec {
struct _XvVideoNotifyRec *next;
ClientPtr client;
unsigned long id;
unsigned long mask;
} XvVideoNotifyRec, *XvVideoNotifyPtr;
typedef struct _XvPortNotifyRec {
struct _XvPortNotifyRec *next;
ClientPtr client;
unsigned long id;
} XvPortNotifyRec, *XvPortNotifyPtr;
typedef struct {
int id;
ScreenPtr pScreen;
char *name;
unsigned short width, height;
XvRationalRec rate;
} XvEncodingRec, *XvEncodingPtr;
typedef struct _XvAttributeRec {
int flags;
int min_value;
int max_value;
char *name;
} XvAttributeRec, *XvAttributePtr;
typedef struct {
int id;
int type;
int byte_order;
char guid[16];
int bits_per_pixel;
int format;
int num_planes;
/* for RGB formats only */
int depth;
unsigned int red_mask;
unsigned int green_mask;
unsigned int blue_mask;
/* for YUV formats only */
unsigned int y_sample_bits;
unsigned int u_sample_bits;
unsigned int v_sample_bits;
unsigned int horz_y_period;
unsigned int horz_u_period;
unsigned int horz_v_period;
unsigned int vert_y_period;
unsigned int vert_u_period;
unsigned int vert_v_period;
char component_order[32];
int scanline_order;
} XvImageRec, *XvImagePtr;
typedef struct {
unsigned long base_id;
unsigned char type;
char *name;
int nEncodings;
XvEncodingPtr pEncodings;
int nFormats;
XvFormatPtr pFormats;
int nAttributes;
XvAttributePtr pAttributes;
int nImages;
XvImagePtr pImages;
int nPorts;
struct _XvPortRec *pPorts;
ScreenPtr pScreen;
int (* ddAllocatePort)(unsigned long, struct _XvPortRec*,
struct _XvPortRec**);
int (* ddFreePort)(struct _XvPortRec*);
int (* ddPutVideo)(ClientPtr, DrawablePtr,struct _XvPortRec*, GCPtr,
INT16, INT16, CARD16, CARD16,
INT16, INT16, CARD16, CARD16);
int (* ddPutStill)(ClientPtr, DrawablePtr,struct _XvPortRec*, GCPtr,
INT16, INT16, CARD16, CARD16,
INT16, INT16, CARD16, CARD16);
int (* ddGetVideo)(ClientPtr, DrawablePtr,struct _XvPortRec*, GCPtr,
INT16, INT16, CARD16, CARD16,
INT16, INT16, CARD16, CARD16);
int (* ddGetStill)(ClientPtr, DrawablePtr,struct _XvPortRec*, GCPtr,
INT16, INT16, CARD16, CARD16,
INT16, INT16, CARD16, CARD16);
int (* ddStopVideo)(ClientPtr, struct _XvPortRec*, DrawablePtr);
int (* ddSetPortAttribute)(ClientPtr, struct _XvPortRec*, Atom, INT32);
int (* ddGetPortAttribute)(ClientPtr, struct _XvPortRec*, Atom, INT32*);
int (* ddQueryBestSize)(ClientPtr, struct _XvPortRec*, CARD8,
CARD16, CARD16,CARD16, CARD16,
unsigned int*, unsigned int*);
int (* ddPutImage)(ClientPtr, DrawablePtr, struct _XvPortRec*, GCPtr,
INT16, INT16, CARD16, CARD16,
INT16, INT16, CARD16, CARD16,
XvImagePtr, unsigned char*, Bool,
CARD16, CARD16);
int (* ddQueryImageAttributes)(ClientPtr, struct _XvPortRec*, XvImagePtr,
CARD16*, CARD16*, int*, int*);
DevUnion devPriv;
} XvAdaptorRec, *XvAdaptorPtr;
typedef struct _XvPortRec {
unsigned long id;
XvAdaptorPtr pAdaptor;
XvPortNotifyPtr pNotify;
DrawablePtr pDraw;
ClientPtr client;
XvGrabRec grab;
TimeStamp time;
DevUnion devPriv;
} XvPortRec, *XvPortPtr;
#define LOOKUP_PORT(_id, client)\
((XvPortPtr)LookupIDByType(_id, XvRTPort))
#define LOOKUP_ENCODING(_id, client)\
((XvEncodingPtr)LookupIDByType(_id, XvRTEncoding))
#define LOOKUP_VIDEONOTIFY_LIST(_id, client)\
((XvVideoNotifyPtr)LookupIDByType(_id, XvRTVideoNotifyList))
#define LOOKUP_PORTNOTIFY_LIST(_id, client)\
((XvPortNotifyPtr)LookupIDByType(_id, XvRTPortNotifyList))
typedef struct {
int version, revision;
int nAdaptors;
XvAdaptorPtr pAdaptors;
DestroyWindowProcPtr DestroyWindow;
DestroyPixmapProcPtr DestroyPixmap;
CloseScreenProcPtr CloseScreen;
Bool (* ddCloseScreen)(int, ScreenPtr);
int (* ddQueryAdaptors)(ScreenPtr, XvAdaptorPtr*, int*);
DevUnion devPriv;
} XvScreenRec, *XvScreenPtr;
#define SCREEN_PROLOGUE(pScreen, field)\
((pScreen)->field = \
((XvScreenPtr) \
(pScreen)->devPrivates[XvScreenIndex].ptr)->field)
#define SCREEN_EPILOGUE(pScreen, field, wrapper)\
((pScreen)->field = wrapper)
/* Errors */
#define _XvBadPort (XvBadPort+XvErrorBase)
#define _XvBadEncoding (XvBadEncoding+XvErrorBase)
extern int ProcXvDispatch(ClientPtr);
extern int SProcXvDispatch(ClientPtr);
extern void XvExtensionInit(void);
extern int XvScreenInit(ScreenPtr);
extern int XvGetScreenIndex(void);
extern unsigned long XvGetRTPort(void);
extern int XvdiSendPortNotify(XvPortPtr, Atom, INT32);
extern int XvdiVideoStopped(XvPortPtr, int);
extern int XvdiPutVideo(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
INT16, INT16, CARD16, CARD16,
INT16, INT16, CARD16, CARD16);
extern int XvdiPutStill(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
INT16, INT16, CARD16, CARD16,
INT16, INT16, CARD16, CARD16);
extern int XvdiGetVideo(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
INT16, INT16, CARD16, CARD16,
INT16, INT16, CARD16, CARD16);
extern int XvdiGetStill(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
INT16, INT16, CARD16, CARD16,
INT16, INT16, CARD16, CARD16);
extern int XvdiPutImage(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
INT16, INT16, CARD16, CARD16,
INT16, INT16, CARD16, CARD16,
XvImagePtr, unsigned char*, Bool,
CARD16, CARD16);
extern int XvdiSelectVideoNotify(ClientPtr, DrawablePtr, BOOL);
extern int XvdiSelectPortNotify(ClientPtr, XvPortPtr, BOOL);
extern int XvdiSetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32);
extern int XvdiGetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32*);
extern int XvdiStopVideo(ClientPtr, XvPortPtr, DrawablePtr);
extern int XvdiPreemptVideo(ClientPtr, XvPortPtr, DrawablePtr);
extern int XvdiMatchPort(XvPortPtr, DrawablePtr);
extern int XvdiGrabPort(ClientPtr, XvPortPtr, Time, int *);
extern int XvdiUngrabPort( ClientPtr, XvPortPtr, Time);
#if !defined(UNIXCPP)
#define XVCALL(name) Xv##name
#else
#define XVCALL(name) Xv/**/name
#endif
#endif /* XVDIX_H */

1196
Xext/xvmain.c Normal file

File diff suppressed because it is too large Load Diff

674
Xext/xvmc.c Normal file
View File

@ -0,0 +1,674 @@
/* $XFree86: xc/programs/Xserver/Xext/xvmc.c,v 1.7 2001/11/18 23:55:48 mvojkovi Exp $ */
#define NEED_REPLIES
#define NEED_EVENTS
#include "X.h"
#include "Xproto.h"
#include "misc.h"
#include "os.h"
#include "dixstruct.h"
#include "resource.h"
#include "scrnintstr.h"
#include "extnsionst.h"
#include "servermd.h"
#include "Xfuncproto.h"
#include "xvdix.h"
#include "XvMC.h"
#include "Xvproto.h"
#include "XvMCproto.h"
#include "xvmcext.h"
int XvMCScreenIndex = -1;
unsigned long XvMCGeneration = 0;
int XvMCReqCode;
int XvMCEventBase;
int XvMCErrorBase;
unsigned long XvMCRTContext;
unsigned long XvMCRTSurface;
unsigned long XvMCRTSubpicture;
typedef struct {
int num_adaptors;
XvMCAdaptorPtr adaptors;
CloseScreenProcPtr CloseScreen;
} XvMCScreenRec, *XvMCScreenPtr;
#define XVMC_GET_PRIVATE(pScreen) \
(XvMCScreenPtr)((pScreen)->devPrivates[XvMCScreenIndex].ptr)
static int
XvMCDestroyContextRes(pointer data, XID id)
{
XvMCContextPtr pContext = (XvMCContextPtr)data;
pContext->refcnt--;
if(!pContext->refcnt) {
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
(*pScreenPriv->adaptors[pContext->adapt_num].DestroyContext)(pContext);
xfree(pContext);
}
return Success;
}
static int
XvMCDestroySurfaceRes(pointer data, XID id)
{
XvMCSurfacePtr pSurface = (XvMCSurfacePtr)data;
XvMCContextPtr pContext = pSurface->context;
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
(*pScreenPriv->adaptors[pContext->adapt_num].DestroySurface)(pSurface);
xfree(pSurface);
XvMCDestroyContextRes((pointer)pContext, pContext->context_id);
return Success;
}
static int
XvMCDestroySubpictureRes(pointer data, XID id)
{
XvMCSubpicturePtr pSubpict = (XvMCSubpicturePtr)data;
XvMCContextPtr pContext = pSubpict->context;
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
(*pScreenPriv->adaptors[pContext->adapt_num].DestroySubpicture)(pSubpict);
xfree(pSubpict);
XvMCDestroyContextRes((pointer)pContext, pContext->context_id);
return Success;
}
static void
XvMCResetProc (ExtensionEntry *extEntry)
{
}
static int
ProcXvMCQueryVersion(ClientPtr client)
{
xvmcQueryVersionReply rep;
/* REQUEST(xvmcQueryVersionReq); */
REQUEST_SIZE_MATCH(xvmcQueryVersionReq);
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.length = 0;
rep.major = XvMCVersion;
rep.minor = XvMCRevision;
WriteToClient(client, sizeof(xvmcQueryVersionReply), (char*)&rep);
return Success;
}
static int
ProcXvMCListSurfaceTypes(ClientPtr client)
{
XvPortPtr pPort;
int i;
XvMCScreenPtr pScreenPriv;
xvmcListSurfaceTypesReply rep;
xvmcSurfaceInfo info;
XvMCAdaptorPtr adaptor = NULL;
XvMCSurfaceInfoPtr surface;
REQUEST(xvmcListSurfaceTypesReq);
REQUEST_SIZE_MATCH(xvmcListSurfaceTypesReq);
if(!(pPort = LOOKUP_PORT(stuff->port, client))) {
client->errorValue = stuff->port;
return _XvBadPort;
}
if(XvMCScreenIndex >= 0) { /* any adaptors at all */
ScreenPtr pScreen = pPort->pAdaptor->pScreen;
if((pScreenPriv = XVMC_GET_PRIVATE(pScreen))) { /* any this screen */
for(i = 0; i < pScreenPriv->num_adaptors; i++) {
if(pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) {
adaptor = &(pScreenPriv->adaptors[i]);
break;
}
}
}
}
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.num = (adaptor) ? adaptor->num_surfaces : 0;
rep.length = rep.num * sizeof(xvmcSurfaceInfo) >> 2;
WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), (char*)&rep);
for(i = 0; i < rep.num; i++) {
surface = adaptor->surfaces[i];
info.surface_type_id = surface->surface_type_id;
info.chroma_format = surface->chroma_format;
info.max_width = surface->max_width;
info.max_height = surface->max_height;
info.subpicture_max_width = surface->subpicture_max_width;
info.subpicture_max_height = surface->subpicture_max_height;
info.mc_type = surface->mc_type;
info.flags = surface->flags;
WriteToClient(client, sizeof(xvmcSurfaceInfo), (char*)&info);
}
return Success;
}
static int
ProcXvMCCreateContext(ClientPtr client)
{
XvPortPtr pPort;
CARD32 *data = NULL;
int dwords = 0;
int i, result, adapt_num = -1;
ScreenPtr pScreen;
XvMCContextPtr pContext;
XvMCScreenPtr pScreenPriv;
XvMCAdaptorPtr adaptor = NULL;
XvMCSurfaceInfoPtr surface = NULL;
xvmcCreateContextReply rep;
REQUEST(xvmcCreateContextReq);
REQUEST_SIZE_MATCH(xvmcCreateContextReq);
if(!(pPort = LOOKUP_PORT(stuff->port, client))) {
client->errorValue = stuff->port;
return _XvBadPort;
}
pScreen = pPort->pAdaptor->pScreen;
if(XvMCScreenIndex < 0) /* no XvMC adaptors */
return BadMatch;
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen))) /* none this screen */
return BadMatch;
for(i = 0; i < pScreenPriv->num_adaptors; i++) {
if(pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) {
adaptor = &(pScreenPriv->adaptors[i]);
adapt_num = i;
break;
}
}
if(adapt_num < 0) /* none this port */
return BadMatch;
for(i = 0; i < adaptor->num_surfaces; i++) {
if(adaptor->surfaces[i]->surface_type_id == stuff->surface_type_id) {
surface = adaptor->surfaces[i];
break;
}
}
/* adaptor doesn't support this suface_type_id */
if(!surface) return BadMatch;
if((stuff->width > surface->max_width) ||
(stuff->height > surface->max_height))
return BadValue;
if(!(pContext = xalloc(sizeof(XvMCContextRec)))) {
return BadAlloc;
}
pContext->pScreen = pScreen;
pContext->adapt_num = adapt_num;
pContext->context_id = stuff->context_id;
pContext->surface_type_id = stuff->surface_type_id;
pContext->width = stuff->width;
pContext->height = stuff->height;
pContext->flags = stuff->flags;
pContext->refcnt = 1;
result = (*adaptor->CreateContext)(pPort, pContext, &dwords, &data);
if(result != Success) {
xfree(pContext);
return result;
}
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.width_actual = pContext->width;
rep.height_actual = pContext->height;
rep.flags_return = pContext->flags;
rep.length = dwords;
WriteToClient(client, sizeof(xvmcCreateContextReply), (char*)&rep);
if(dwords)
WriteToClient(client, dwords << 2, (char*)data);
AddResource(pContext->context_id, XvMCRTContext, pContext);
if(data)
xfree(data);
return Success;
}
static int
ProcXvMCDestroyContext(ClientPtr client)
{
REQUEST(xvmcDestroyContextReq);
REQUEST_SIZE_MATCH(xvmcDestroyContextReq);
if(!LookupIDByType(stuff->context_id, XvMCRTContext))
return (XvMCBadContext + XvMCErrorBase);
FreeResource(stuff->context_id, RT_NONE);
return Success;
}
static int
ProcXvMCCreateSurface(ClientPtr client)
{
CARD32 *data = NULL;
int dwords = 0;
int result;
XvMCContextPtr pContext;
XvMCSurfacePtr pSurface;
XvMCScreenPtr pScreenPriv;
xvmcCreateSurfaceReply rep;
REQUEST(xvmcCreateSurfaceReq);
REQUEST_SIZE_MATCH(xvmcCreateSurfaceReq);
if(!(pContext = LookupIDByType(stuff->context_id, XvMCRTContext)))
return (XvMCBadContext + XvMCErrorBase);
pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
if(!(pSurface = xalloc(sizeof(XvMCSurfaceRec))))
return BadAlloc;
pSurface->surface_id = stuff->surface_id;
pSurface->surface_type_id = pContext->surface_type_id;
pSurface->context = pContext;
result = (*pScreenPriv->adaptors[pContext->adapt_num].CreateSurface)(
pSurface, &dwords, &data);
if(result != Success) {
xfree(pSurface);
return result;
}
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.length = dwords;
WriteToClient(client, sizeof(xvmcCreateSurfaceReply), (char*)&rep);
if(dwords)
WriteToClient(client, dwords << 2, (char*)data);
AddResource(pSurface->surface_id, XvMCRTSurface, pSurface);
if(data)
xfree(data);
pContext->refcnt++;
return Success;
}
static int
ProcXvMCDestroySurface(ClientPtr client)
{
REQUEST(xvmcDestroySurfaceReq);
REQUEST_SIZE_MATCH(xvmcDestroySurfaceReq);
if(!LookupIDByType(stuff->surface_id, XvMCRTSurface))
return (XvMCBadSurface + XvMCErrorBase);
FreeResource(stuff->surface_id, RT_NONE);
return Success;
}
static int
ProcXvMCCreateSubpicture(ClientPtr client)
{
Bool image_supported = FALSE;
CARD32 *data = NULL;
int i, result, dwords = 0;
XvMCContextPtr pContext;
XvMCSubpicturePtr pSubpicture;
XvMCScreenPtr pScreenPriv;
xvmcCreateSubpictureReply rep;
XvMCAdaptorPtr adaptor;
XvMCSurfaceInfoPtr surface = NULL;
REQUEST(xvmcCreateSubpictureReq);
REQUEST_SIZE_MATCH(xvmcCreateSubpictureReq);
if(!(pContext = LookupIDByType(stuff->context_id, XvMCRTContext)))
return (XvMCBadContext + XvMCErrorBase);
pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
adaptor = &(pScreenPriv->adaptors[pContext->adapt_num]);
/* find which surface this context supports */
for(i = 0; i < adaptor->num_surfaces; i++) {
if(adaptor->surfaces[i]->surface_type_id == pContext->surface_type_id){
surface = adaptor->surfaces[i];
break;
}
}
if(!surface) return BadMatch;
/* make sure this surface supports that xvimage format */
if(!surface->compatible_subpictures) return BadMatch;
for(i = 0; i < surface->compatible_subpictures->num_xvimages; i++) {
if(surface->compatible_subpictures->xvimage_ids[i] == stuff->xvimage_id) {
image_supported = TRUE;
break;
}
}
if(!image_supported) return BadMatch;
/* make sure the size is OK */
if((stuff->width > surface->subpicture_max_width) ||
(stuff->height > surface->subpicture_max_height))
return BadValue;
if(!(pSubpicture = xalloc(sizeof(XvMCSubpictureRec))))
return BadAlloc;
pSubpicture->subpicture_id = stuff->subpicture_id;
pSubpicture->xvimage_id = stuff->xvimage_id;
pSubpicture->width = stuff->width;
pSubpicture->height = stuff->height;
pSubpicture->num_palette_entries = 0; /* overwritten by DDX */
pSubpicture->entry_bytes = 0; /* overwritten by DDX */
pSubpicture->component_order[0] = 0; /* overwritten by DDX */
pSubpicture->component_order[1] = 0;
pSubpicture->component_order[2] = 0;
pSubpicture->component_order[3] = 0;
pSubpicture->context = pContext;
result = (*pScreenPriv->adaptors[pContext->adapt_num].CreateSubpicture)(
pSubpicture, &dwords, &data);
if(result != Success) {
xfree(pSubpicture);
return result;
}
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.width_actual = pSubpicture->width;
rep.height_actual = pSubpicture->height;
rep.num_palette_entries = pSubpicture->num_palette_entries;
rep.entry_bytes = pSubpicture->entry_bytes;
rep.component_order[0] = pSubpicture->component_order[0];
rep.component_order[1] = pSubpicture->component_order[1];
rep.component_order[2] = pSubpicture->component_order[2];
rep.component_order[3] = pSubpicture->component_order[3];
rep.length = dwords;
WriteToClient(client, sizeof(xvmcCreateSubpictureReply), (char*)&rep);
if(dwords)
WriteToClient(client, dwords << 2, (char*)data);
AddResource(pSubpicture->subpicture_id, XvMCRTSubpicture, pSubpicture);
if(data)
xfree(data);
pContext->refcnt++;
return Success;
}
static int
ProcXvMCDestroySubpicture(ClientPtr client)
{
REQUEST(xvmcDestroySubpictureReq);
REQUEST_SIZE_MATCH(xvmcDestroySubpictureReq);
if(!LookupIDByType(stuff->subpicture_id, XvMCRTSubpicture))
return (XvMCBadSubpicture + XvMCErrorBase);
FreeResource(stuff->subpicture_id, RT_NONE);
return Success;
}
static int
ProcXvMCListSubpictureTypes(ClientPtr client)
{
XvPortPtr pPort;
xvmcListSubpictureTypesReply rep;
XvMCScreenPtr pScreenPriv;
ScreenPtr pScreen;
XvMCAdaptorPtr adaptor = NULL;
XvMCSurfaceInfoPtr surface = NULL;
xvImageFormatInfo info;
XvImagePtr pImage;
int i, j;
REQUEST(xvmcListSubpictureTypesReq);
REQUEST_SIZE_MATCH(xvmcListSubpictureTypesReq);
if(!(pPort = LOOKUP_PORT(stuff->port, client))) {
client->errorValue = stuff->port;
return _XvBadPort;
}
pScreen = pPort->pAdaptor->pScreen;
if(XvMCScreenIndex < 0) /* No XvMC adaptors */
return BadMatch;
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
return BadMatch; /* None this screen */
for(i = 0; i < pScreenPriv->num_adaptors; i++) {
if(pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) {
adaptor = &(pScreenPriv->adaptors[i]);
break;
}
}
if(!adaptor) return BadMatch;
for(i = 0; i < adaptor->num_surfaces; i++) {
if(adaptor->surfaces[i]->surface_type_id == stuff->surface_type_id) {
surface = adaptor->surfaces[i];
break;
}
}
if(!surface) return BadMatch;
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.num = 0;
if(surface->compatible_subpictures)
rep.num = surface->compatible_subpictures->num_xvimages;
rep.length = rep.num * sizeof(xvImageFormatInfo) >> 2;
WriteToClient(client, sizeof(xvmcListSubpictureTypesReply), (char*)&rep);
for(i = 0; i < rep.num; i++) {
pImage = NULL;
for(j = 0; j < adaptor->num_subpictures; j++) {
if(surface->compatible_subpictures->xvimage_ids[i] ==
adaptor->subpictures[j]->id)
{
pImage = adaptor->subpictures[j];
break;
}
}
if(!pImage) return BadImplementation;
info.id = pImage->id;
info.type = pImage->type;
info.byte_order = pImage->byte_order;
memcpy(&info.guid, pImage->guid, 16);
info.bpp = pImage->bits_per_pixel;
info.num_planes = pImage->num_planes;
info.depth = pImage->depth;
info.red_mask = pImage->red_mask;
info.green_mask = pImage->green_mask;
info.blue_mask = pImage->blue_mask;
info.format = pImage->format;
info.y_sample_bits = pImage->y_sample_bits;
info.u_sample_bits = pImage->u_sample_bits;
info.v_sample_bits = pImage->v_sample_bits;
info.horz_y_period = pImage->horz_y_period;
info.horz_u_period = pImage->horz_u_period;
info.horz_v_period = pImage->horz_v_period;
info.vert_y_period = pImage->vert_y_period;
info.vert_u_period = pImage->vert_u_period;
info.vert_v_period = pImage->vert_v_period;
memcpy(&info.comp_order, pImage->component_order, 32);
info.scanline_order = pImage->scanline_order;
WriteToClient(client, sizeof(xvImageFormatInfo), (char*)&info);
}
return Success;
}
int (*ProcXvMCVector[xvmcNumRequest])(ClientPtr) = {
ProcXvMCQueryVersion,
ProcXvMCListSurfaceTypes,
ProcXvMCCreateContext,
ProcXvMCDestroyContext,
ProcXvMCCreateSurface,
ProcXvMCDestroySurface,
ProcXvMCCreateSubpicture,
ProcXvMCDestroySubpicture,
ProcXvMCListSubpictureTypes
};
static int
ProcXvMCDispatch (ClientPtr client)
{
REQUEST(xReq);
if(stuff->data < xvmcNumRequest)
return (*ProcXvMCVector[stuff->data])(client);
else
return BadRequest;
}
static int
SProcXvMCDispatch (ClientPtr client)
{
/* We only support local */
return BadImplementation;
}
void
XvMCExtensionInit()
{
ExtensionEntry *extEntry;
if(XvMCScreenIndex < 0) /* nobody supports it */
return;
if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes)))
return;
if(!(XvMCRTSurface = CreateNewResourceType(XvMCDestroySurfaceRes)))
return;
if(!(XvMCRTSubpicture = CreateNewResourceType(XvMCDestroySubpictureRes)))
return;
extEntry = AddExtension(XvMCName, XvMCNumEvents, XvMCNumErrors,
ProcXvMCDispatch, SProcXvMCDispatch,
XvMCResetProc, StandardMinorOpcode);
if(!extEntry) return;
XvMCReqCode = extEntry->base;
XvMCEventBase = extEntry->eventBase;
XvMCErrorBase = extEntry->errorBase;
}
static Bool
XvMCCloseScreen (int i, ScreenPtr pScreen)
{
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pScreen);
pScreen->CloseScreen = pScreenPriv->CloseScreen;
xfree(pScreenPriv);
return (*pScreen->CloseScreen)(i, pScreen);
}
int
XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt)
{
XvMCScreenPtr pScreenPriv;
if(XvMCGeneration != serverGeneration) {
if((XvMCScreenIndex = AllocateScreenPrivateIndex()) < 0)
return BadAlloc;
XvMCGeneration = serverGeneration;
}
if(!(pScreenPriv = (XvMCScreenPtr)xalloc(sizeof(XvMCScreenRec))))
return BadAlloc;
pScreen->devPrivates[XvMCScreenIndex].ptr = (pointer)pScreenPriv;
pScreenPriv->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = XvMCCloseScreen;
pScreenPriv->num_adaptors = num;
pScreenPriv->adaptors = pAdapt;
return Success;
}
XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id)
{
XvImagePtr pImage = NULL;
ScreenPtr pScreen = pPort->pAdaptor->pScreen;
XvMCScreenPtr pScreenPriv;
XvMCAdaptorPtr adaptor = NULL;
int i;
if(XvMCScreenIndex < 0) return NULL;
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
return NULL;
for(i = 0; i < pScreenPriv->num_adaptors; i++) {
if(pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) {
adaptor = &(pScreenPriv->adaptors[i]);
break;
}
}
if(!adaptor) return NULL;
for(i = 0; i < adaptor->num_subpictures; i++) {
if(adaptor->subpictures[i]->id == id) {
pImage = adaptor->subpictures[i];
break;
}
}
return pImage;
}

109
Xext/xvmcext.h Normal file
View File

@ -0,0 +1,109 @@
/* $XFree86: xc/programs/Xserver/Xext/xvmcext.h,v 1.1 2001/04/07 11:04:21 alanh Exp $ */
#ifndef _XVMC_H
#define _XVMC_H
#include "Xv.h"
#include "xvdix.h"
typedef struct {
int num_xvimages;
int *xvimage_ids;
} XvMCImageIDList;
typedef struct {
int surface_type_id;
int chroma_format;
int color_description;
unsigned short max_width;
unsigned short max_height;
unsigned short subpicture_max_width;
unsigned short subpicture_max_height;
int mc_type;
int flags;
XvMCImageIDList *compatible_subpictures;
} XvMCSurfaceInfoRec, *XvMCSurfaceInfoPtr;
typedef struct {
XID context_id;
ScreenPtr pScreen;
int adapt_num;
int surface_type_id;
unsigned short width;
unsigned short height;
CARD32 flags;
int refcnt;
pointer port_priv;
pointer driver_priv;
} XvMCContextRec, *XvMCContextPtr;
typedef struct {
XID surface_id;
int surface_type_id;
XvMCContextPtr context;
pointer driver_priv;
} XvMCSurfaceRec, *XvMCSurfacePtr;
typedef struct {
XID subpicture_id;
int xvimage_id;
unsigned short width;
unsigned short height;
int num_palette_entries;
int entry_bytes;
char component_order[4];
XvMCContextPtr context;
pointer driver_priv;
} XvMCSubpictureRec, *XvMCSubpicturePtr;
typedef int (*XvMCCreateContextProcPtr) (
XvPortPtr port,
XvMCContextPtr context,
int *num_priv,
CARD32 **priv
);
typedef void (*XvMCDestroyContextProcPtr) (
XvMCContextPtr context
);
typedef int (*XvMCCreateSurfaceProcPtr) (
XvMCSurfacePtr surface,
int *num_priv,
CARD32 **priv
);
typedef void (*XvMCDestroySurfaceProcPtr) (
XvMCSurfacePtr surface
);
typedef int (*XvMCCreateSubpictureProcPtr) (
XvMCSubpicturePtr subpicture,
int *num_priv,
CARD32 **priv
);
typedef void (*XvMCDestroySubpictureProcPtr) (
XvMCSubpicturePtr subpicture
);
typedef struct {
XvAdaptorPtr xv_adaptor;
int num_surfaces;
XvMCSurfaceInfoPtr *surfaces;
int num_subpictures;
XvImagePtr *subpictures;
XvMCCreateContextProcPtr CreateContext;
XvMCDestroyContextProcPtr DestroyContext;
XvMCCreateSurfaceProcPtr CreateSurface;
XvMCDestroySurfaceProcPtr DestroySurface;
XvMCCreateSubpictureProcPtr CreateSubpicture;
XvMCDestroySubpictureProcPtr DestroySubpicture;
} XvMCAdaptorRec, *XvMCAdaptorPtr;
void XvMCExtensionInit(void);
int XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr adapt);
#endif /* _XVMC_H */

44
Xi/allowev.h Normal file
View File

@ -0,0 +1,44 @@
/* $XFree86: xc/programs/Xserver/Xi/allowev.h,v 3.1 1996/04/15 11:18:23 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef ALLOWEV_H
#define ALLOWEV_H 1
int
SProcXAllowDeviceEvents(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXAllowDeviceEvents(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
#endif /* ALLOWEV_H */

53
Xi/chgdctl.h Normal file
View File

@ -0,0 +1,53 @@
/* $XFree86: xc/programs/Xserver/Xi/chgdctl.h,v 3.1 1996/04/15 11:18:25 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef CHGDCTL_H
#define CHGDCTL_H 1
int
SProcXChangeDeviceControl(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXChangeDeviceControl(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
SRepXChangeDeviceControl (
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xChangeDeviceControlReply * /* rep */
#endif
);
#endif /* CHGDCTL_H */

110
Xi/chgfctl.h Normal file
View File

@ -0,0 +1,110 @@
/* $XFree86: xc/programs/Xserver/Xi/chgfctl.h,v 3.1 1996/04/15 11:18:26 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef CHGFCTL_H
#define CHGFCTL_H 1
int
SProcXChangeFeedbackControl(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXChangeFeedbackControl(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ChangeKbdFeedback (
#if NeedFunctionPrototypes
ClientPtr /* client */,
DeviceIntPtr /* dev */,
unsigned long /* mask */,
KbdFeedbackPtr /* k */,
xKbdFeedbackCtl * /* f */
#endif
);
int
ChangePtrFeedback (
#if NeedFunctionPrototypes
ClientPtr /* client */,
DeviceIntPtr /* dev */,
unsigned long /* mask */,
PtrFeedbackPtr /* p */,
xPtrFeedbackCtl * /* f */
#endif
);
int
ChangeIntegerFeedback (
#if NeedFunctionPrototypes
ClientPtr /* client */,
DeviceIntPtr /* dev */,
unsigned long /* mask */,
IntegerFeedbackPtr /* i */,
xIntegerFeedbackCtl * /* f */
#endif
);
int
ChangeStringFeedback (
#if NeedFunctionPrototypes
ClientPtr /* client */,
DeviceIntPtr /* dev */,
unsigned long /* mask */,
StringFeedbackPtr /* s */,
xStringFeedbackCtl * /* f */
#endif
);
int
ChangeBellFeedback (
#if NeedFunctionPrototypes
ClientPtr /* client */,
DeviceIntPtr /* dev */,
unsigned long /* mask */,
BellFeedbackPtr /* b */,
xBellFeedbackCtl * /* f */
#endif
);
int
ChangeLedFeedback (
#if NeedFunctionPrototypes
ClientPtr /* client */,
DeviceIntPtr /* dev */,
unsigned long /* mask */,
LedFeedbackPtr /* l */,
xLedFeedbackCtl * /* f */
#endif
);
#endif /* CHGFCTL_H */

54
Xi/chgkbd.h Normal file
View File

@ -0,0 +1,54 @@
/* $XFree86: xc/programs/Xserver/Xi/chgkbd.h,v 3.1 1996/04/15 11:18:27 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef CHGKBD_H
#define CHGKBD_H 1
int
SProcXChangeKeyboardDevice(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXChangeKeyboardDevice (
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
SRepXChangeKeyboardDevice (
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xChangeKeyboardDeviceReply * /* rep */
#endif
);
#endif /* CHGKBD_H */

44
Xi/chgkmap.h Normal file
View File

@ -0,0 +1,44 @@
/* $XFree86: xc/programs/Xserver/Xi/chgkmap.h,v 3.1 1996/04/15 11:18:28 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef CHGKMAP_H
#define CHGKMAP_H 1
int
SProcXChangeDeviceKeyMapping(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXChangeDeviceKeyMapping(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
#endif /* CHGKMAP_H */

44
Xi/chgprop.h Normal file
View File

@ -0,0 +1,44 @@
/* $XFree86: xc/programs/Xserver/Xi/chgprop.h,v 3.1 1996/04/15 11:18:29 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef CHGPROP_H
#define CHGPROP_H 1
int
SProcXChangeDeviceDontPropagateList (
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXChangeDeviceDontPropagateList (
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
#endif /* CHGPROP_H */

81
Xi/chgptr.h Normal file
View File

@ -0,0 +1,81 @@
/* $XFree86: xc/programs/Xserver/Xi/chgptr.h,v 3.1 1996/04/15 11:18:31 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef CHGPTR_H
#define CHGPTR_H 1
int
SProcXChangePointerDevice(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXChangePointerDevice (
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
DeleteFocusClassDeviceStruct(
#if NeedFunctionPrototypes
DeviceIntPtr /* dev */
#endif
);
void
SendEventToAllWindows (
#if NeedFunctionPrototypes
DeviceIntPtr /* dev */,
Mask /* mask */,
xEvent * /* ev */,
int /* count */
#endif
);
void
FindInterestedChildren ( /* FIXME: could be static? */
#if NeedFunctionPrototypes
DeviceIntPtr /* dev */,
WindowPtr /* p1 */,
Mask /* mask */,
xEvent * /* ev */,
int /* count */
#endif
);
void
SRepXChangePointerDevice (
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xChangePointerDeviceReply * /* rep */
#endif
);
#endif /* CHGPTR_H */

62
Xi/closedev.h Normal file
View File

@ -0,0 +1,62 @@
/* $XFree86: xc/programs/Xserver/Xi/closedev.h,v 3.1 1996/04/15 11:18:32 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef CLOSEDEV_H
#define CLOSEDEV_H 1
int
SProcXCloseDevice(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXCloseDevice(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
DeleteEventsFromChildren(
#if NeedFunctionPrototypes
DeviceIntPtr /* dev */,
WindowPtr /* p1 */,
ClientPtr /* client */
#endif
);
void
DeleteDeviceEvents (
#if NeedFunctionPrototypes
DeviceIntPtr /* dev */,
WindowPtr /* pWin */,
ClientPtr /* client */
#endif
);
#endif /* CLOSEDEV_H */

44
Xi/devbell.h Normal file
View File

@ -0,0 +1,44 @@
/* $XFree86: xc/programs/Xserver/Xi/devbell.h,v 3.1 1996/04/15 11:18:32 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef DEVBELL_H
#define DEVBELL_H 1
int
SProcXDeviceBell (
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXDeviceBell (
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
#endif /* DEVBELL_H */

76
Xi/exglobals.h Normal file
View File

@ -0,0 +1,76 @@
/* $XFree86: xc/programs/Xserver/Xi/exglobals.h,v 3.3 1998/12/05 14:39:57 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
/*****************************************************************
*
* Globals referenced elsewhere in the server.
*
*/
#ifndef EXGLOBALS_H
#define EXGLOBALS_H 1
extern int IReqCode;
extern int BadDevice;
extern int BadEvent;
extern int BadMode;
extern int DeviceBusy;
extern int BadClass;
extern Mask DevicePointerMotionMask;
extern Mask DevicePointerMotionHintMask;
extern Mask DeviceFocusChangeMask;
extern Mask DeviceStateNotifyMask;
extern Mask ChangeDeviceNotifyMask;
extern Mask DeviceMappingNotifyMask;
extern Mask DeviceOwnerGrabButtonMask;
extern Mask DeviceButtonGrabMask;
extern Mask DeviceButtonMotionMask;
extern Mask PropagateMask[];
extern int DeviceValuator;
extern int DeviceKeyPress;
extern int DeviceKeyRelease;
extern int DeviceButtonPress;
extern int DeviceButtonRelease;
extern int DeviceMotionNotify;
extern int DeviceFocusIn;
extern int DeviceFocusOut;
extern int ProximityIn;
extern int ProximityOut;
extern int DeviceStateNotify;
extern int DeviceKeyStateNotify;
extern int DeviceButtonStateNotify;
extern int DeviceMappingNotify;
extern int ChangeDeviceNotify;
extern int RT_INPUTCLIENT;
#if 0
/* FIXME: in dix */
extern InputInfo inputInfo;
#endif
#endif /* EXGLOBALS_H */

53
Xi/getbmap.h Normal file
View File

@ -0,0 +1,53 @@
/* $XFree86: xc/programs/Xserver/Xi/getbmap.h,v 3.1 1996/04/15 11:18:37 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef GETBMAP_H
#define GETBMAP_H 1
int
SProcXGetDeviceButtonMapping(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXGetDeviceButtonMapping (
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
SRepXGetDeviceButtonMapping (
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xGetDeviceButtonMappingReply * /* rep */
#endif
);
#endif /* GETBMAP_H */

63
Xi/getdctl.h Normal file
View File

@ -0,0 +1,63 @@
/* $XFree86: xc/programs/Xserver/Xi/getdctl.h,v 3.1 1996/04/15 11:18:38 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef GETDCTL_H
#define GETDCTL_H 1
int
SProcXGetDeviceControl (
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXGetDeviceControl (
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
CopySwapDeviceResolution (
#if NeedFunctionPrototypes
ClientPtr /* client */,
ValuatorClassPtr /* v */,
char * /* buf */,
int /* length */
#endif
);
void
SRepXGetDeviceControl (
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xGetDeviceControlReply * /* rep */
#endif
);
#endif /* GETDCTL_H */

107
Xi/getfctl.h Normal file
View File

@ -0,0 +1,107 @@
/* $XFree86: xc/programs/Xserver/Xi/getfctl.h,v 3.1 1996/04/15 11:18:39 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef GETFCTL_H
#define GETFCTL_H 1
int
SProcXGetFeedbackControl(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXGetFeedbackControl(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
CopySwapKbdFeedback (
#if NeedFunctionPrototypes
ClientPtr /* client */,
KbdFeedbackPtr /* k */,
char ** /* buf */
#endif
);
void
CopySwapPtrFeedback (
#if NeedFunctionPrototypes
ClientPtr /* client */,
PtrFeedbackPtr /* p */,
char ** /* buf */
#endif
);
void
CopySwapIntegerFeedback (
#if NeedFunctionPrototypes
ClientPtr /* client */,
IntegerFeedbackPtr /* i */,
char ** /* buf */
#endif
);
void
CopySwapStringFeedback (
#if NeedFunctionPrototypes
ClientPtr /* client */,
StringFeedbackPtr /* s */,
char ** /* buf */
#endif
);
void
CopySwapLedFeedback (
#if NeedFunctionPrototypes
ClientPtr /* client */,
LedFeedbackPtr /* l */,
char ** /* buf */
#endif
);
void
CopySwapBellFeedback (
#if NeedFunctionPrototypes
ClientPtr /* client */,
BellFeedbackPtr /* b */,
char ** /* buf */
#endif
);
void
SRepXGetFeedbackControl (
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xGetFeedbackControlReply * /* rep */
#endif
);
#endif /* GETFCTL_H */

53
Xi/getfocus.h Normal file
View File

@ -0,0 +1,53 @@
/* $XFree86: xc/programs/Xserver/Xi/getfocus.h,v 3.1 1996/04/15 11:18:40 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef GETFOCUS_H
#define GETFOCUS_H 1
int
SProcXGetDeviceFocus(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXGetDeviceFocus(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
SRepXGetDeviceFocus (
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xGetDeviceFocusReply * /* rep */
#endif
);
#endif /* GETFOCUS_H */

53
Xi/getkmap.h Normal file
View File

@ -0,0 +1,53 @@
/* $XFree86: xc/programs/Xserver/Xi/getkmap.h,v 3.1 1996/04/15 11:18:41 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef GETKMAP_H
#define GETKMAP_H 1
int
SProcXGetDeviceKeyMapping(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXGetDeviceKeyMapping(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
SRepXGetDeviceKeyMapping (
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xGetDeviceKeyMappingReply * /* rep */
#endif
);
#endif /* GETKMAP_H */

53
Xi/getmmap.h Normal file
View File

@ -0,0 +1,53 @@
/* $XFree86: xc/programs/Xserver/Xi/getmmap.h,v 3.1 1996/04/15 11:18:42 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef GETMMAP_H
#define GETMMAP_H 1
int
SProcXGetDeviceModifierMapping(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXGetDeviceModifierMapping(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
SRepXGetDeviceModifierMapping (
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xGetDeviceModifierMappingReply * /* rep */
#endif
);
#endif /* GETMMAP_H */

64
Xi/getprop.h Normal file
View File

@ -0,0 +1,64 @@
/* $XFree86: xc/programs/Xserver/Xi/getprop.h,v 3.1 1996/04/15 11:18:44 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef GETPROP_H
#define GETPROP_H 1
int
SProcXGetDeviceDontPropagateList(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXGetDeviceDontPropagateList (
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
XEventClass *
ClassFromMask (
#if NeedFunctionPrototypes
XEventClass * /* buf */,
Mask /* mask */,
int /* maskndx */,
CARD16 * /* count */,
int /* mode */
#endif
);
void
SRepXGetDeviceDontPropagateList (
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xGetDeviceDontPropagateListReply * /* rep */
#endif
);
#endif /* GETPROP_H */

53
Xi/getselev.h Normal file
View File

@ -0,0 +1,53 @@
/* $XFree86: xc/programs/Xserver/Xi/getselev.h,v 3.1 1996/04/15 11:18:49 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef GETSELEV_H
#define GETSELEV_H 1
int
SProcXGetSelectedExtensionEvents(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXGetSelectedExtensionEvents(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
SRepXGetSelectedExtensionEvents (
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xGetSelectedExtensionEventsReply * /* rep */
#endif
);
#endif /* GETSELEV_H */

53
Xi/getvers.h Normal file
View File

@ -0,0 +1,53 @@
/* $XFree86: xc/programs/Xserver/Xi/getvers.h,v 3.1 1996/04/15 11:18:50 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef GETVERS_H
#define GETVERS_H 1
int
SProcXGetExtensionVersion(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXGetExtensionVersion (
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
SRepXGetExtensionVersion (
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xGetExtensionVersionReply * /* rep */
#endif
);
#endif /* GETVERS_H */

65
Xi/grabdev.h Normal file
View File

@ -0,0 +1,65 @@
/* $XFree86: xc/programs/Xserver/Xi/grabdev.h,v 3.1 1996/04/15 11:18:51 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef GRABDEV_H
#define GRABDEV_H 1
int
SProcXGrabDevice(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXGrabDevice(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
CreateMaskFromList (
#if NeedFunctionPrototypes
ClientPtr /* client */,
XEventClass * /* list */,
int /* count */,
struct tmask /* mask */[],
DeviceIntPtr /* dev */,
int /* req */
#endif
);
void
SRepXGrabDevice (
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xGrabDeviceReply * /* rep */
#endif
);
#endif /* GRABDEV_H */

44
Xi/grabdevb.h Normal file
View File

@ -0,0 +1,44 @@
/* $XFree86: xc/programs/Xserver/Xi/grabdevb.h,v 3.1 1996/04/15 11:18:52 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef GRABDEVB_H
#define GRABDEVB_H 1
int
SProcXGrabDeviceButton(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXGrabDeviceButton(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
#endif /* GRABDEVB_H */

44
Xi/grabdevk.h Normal file
View File

@ -0,0 +1,44 @@
/* $XFree86: xc/programs/Xserver/Xi/grabdevk.h,v 3.1 1996/04/15 11:18:53 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef GRABDEVK_H
#define GRABDEVK_H 1
int
SProcXGrabDeviceKey(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXGrabDeviceKey(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
#endif /* GRABDEVK_H */

53
Xi/gtmotion.h Normal file
View File

@ -0,0 +1,53 @@
/* $XFree86: xc/programs/Xserver/Xi/gtmotion.h,v 3.1 1996/04/15 11:18:56 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef GTMOTION_H
#define GTMOTION_H 1
int
SProcXGetDeviceMotionEvents(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXGetDeviceMotionEvents(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
SRepXGetDeviceMotionEvents (
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xGetDeviceMotionEventsReply * /* rep */
#endif
);
#endif /* GTMOTION_H */

119
Xi/listdev.h Normal file
View File

@ -0,0 +1,119 @@
/* $XFree86: xc/programs/Xserver/Xi/listdev.h,v 3.1 1996/04/15 11:18:57 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef LISTDEV_H
#define LISTDEV_H 1
int
SProcXListInputDevices(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXListInputDevices (
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
SizeDeviceInfo (
#if NeedFunctionPrototypes
DeviceIntPtr /* d */,
int * /* namesize */,
int * /* size */
#endif
);
void
ListDeviceInfo (
#if NeedFunctionPrototypes
ClientPtr /* client */,
DeviceIntPtr /* d */,
xDeviceInfoPtr /* dev */,
char ** /* devbuf */,
char ** /* classbuf */,
char ** /* namebuf */
#endif
);
void
CopyDeviceName (
#if NeedFunctionPrototypes
char ** /* namebuf */,
char * /* name */
#endif
);
void
CopySwapDevice (
#if NeedFunctionPrototypes
ClientPtr /* client */,
DeviceIntPtr /* d */,
int /* num_classes */,
char ** /* buf */
#endif
);
void
CopySwapKeyClass (
#if NeedFunctionPrototypes
ClientPtr /* client */,
KeyClassPtr /* k */,
char ** /* buf */
#endif
);
void
CopySwapButtonClass (
#if NeedFunctionPrototypes
ClientPtr /* client */,
ButtonClassPtr /* b */,
char ** /* buf */
#endif
);
int
CopySwapValuatorClass (
#if NeedFunctionPrototypes
ClientPtr /* client */,
ValuatorClassPtr /* v */,
char ** /* buf */
#endif
);
void
SRepXListInputDevices (
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xListInputDevicesReply * /* rep */
#endif
);
#endif /* LISTDEV_H */

53
Xi/opendev.h Normal file
View File

@ -0,0 +1,53 @@
/* $XFree86: xc/programs/Xserver/Xi/opendev.h,v 3.1 1996/04/15 11:18:58 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef OPENDEV_H
#define OPENDEV_H 1
int
SProcXOpenDevice(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXOpenDevice(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
SRepXOpenDevice (
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xOpenDeviceReply * /* rep */
#endif
);
#endif /* OPENDEV_H */

53
Xi/queryst.h Normal file
View File

@ -0,0 +1,53 @@
/* $XFree86: xc/programs/Xserver/Xi/queryst.h,v 3.1 1996/04/15 11:19:00 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef QUERYST_H
#define QUERYST_H 1
int
SProcXQueryDeviceState(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXQueryDeviceState(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
SRepXQueryDeviceState (
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xQueryDeviceStateReply * /* rep */
#endif
);
#endif /* QUERYST_H */

44
Xi/selectev.h Normal file
View File

@ -0,0 +1,44 @@
/* $XFree86: xc/programs/Xserver/Xi/selectev.h,v 3.1 1996/04/15 11:19:01 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef SELECTEV_H
#define SELECTEV_H 1
int
SProcXSelectExtensionEvent (
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXSelectExtensionEvent (
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
#endif /* SELECTEV_H */

44
Xi/sendexev.h Normal file
View File

@ -0,0 +1,44 @@
/* $XFree86: xc/programs/Xserver/Xi/sendexev.h,v 3.1 1996/04/15 11:19:02 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef SENDEXEV_H
#define SENDEXEV_H 1
int
SProcXSendExtensionEvent(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXSendExtensionEvent(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
#endif /* SENDEXEV_H */

53
Xi/setbmap.h Normal file
View File

@ -0,0 +1,53 @@
/* $XFree86: xc/programs/Xserver/Xi/setbmap.h,v 3.1 1996/04/15 11:19:03 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef SETBMAP_H
#define SETBMAP_H 1
int
SProcXSetDeviceButtonMapping(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXSetDeviceButtonMapping(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
SRepXSetDeviceButtonMapping(
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xSetDeviceButtonMappingReply * /* rep */
#endif
);
#endif /* SETBMAP_H */

53
Xi/setdval.h Normal file
View File

@ -0,0 +1,53 @@
/* $XFree86: xc/programs/Xserver/Xi/setdval.h,v 3.1 1996/04/15 11:19:04 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef SETDVAL_H
#define SETDVAL_H 1
int
SProcXSetDeviceValuators(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXSetDeviceValuators(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
SRepXSetDeviceValuators(
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xSetDeviceValuatorsReply * /* rep */
#endif
);
#endif /* SETDVAL_H */

44
Xi/setfocus.h Normal file
View File

@ -0,0 +1,44 @@
/* $XFree86: xc/programs/Xserver/Xi/setfocus.h,v 3.1 1996/04/15 11:19:05 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef SETFOCUS_H
#define SETFOCUS_H 1
int
SProcXSetDeviceFocus(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXSetDeviceFocus(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
#endif /* SETFOCUS_H */

53
Xi/setmmap.h Normal file
View File

@ -0,0 +1,53 @@
/* $XFree86: xc/programs/Xserver/Xi/setmmap.h,v 3.1 1996/04/15 11:19:06 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef SETMMAP_H
#define SETMMAP_H 1
int
SProcXSetDeviceModifierMapping(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXSetDeviceModifierMapping(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
SRepXSetDeviceModifierMapping(
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xSetDeviceModifierMappingReply * /* rep */
#endif
);
#endif /* SETMMAP_H */

53
Xi/setmode.h Normal file
View File

@ -0,0 +1,53 @@
/* $XFree86: xc/programs/Xserver/Xi/setmode.h,v 3.1 1996/04/15 11:19:07 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef SETMODE_H
#define SETMODE_H 1
int
SProcXSetDeviceMode(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXSetDeviceMode(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
void
SRepXSetDeviceMode(
#if NeedFunctionPrototypes
ClientPtr /* client */,
int /* size */,
xSetDeviceModeReply * /* rep */
#endif
);
#endif /* SETMODE_H */

44
Xi/ungrdev.h Normal file
View File

@ -0,0 +1,44 @@
/* $XFree86: xc/programs/Xserver/Xi/ungrdev.h,v 3.1 1996/04/15 11:19:08 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef UNGRDEV_H
#define UNGRDEV_H 1
int
SProcXUngrabDevice(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
int
ProcXUngrabDevice(
#if NeedFunctionPrototypes
ClientPtr /* client */
#endif
);
#endif /* UNGRDEV_H */

Some files were not shown because too many files have changed in this diff Show More