190b17f1bSmrg/***************************************************************************** 290b17f1bSmrg * driDrawable.h: Lean Version of DRI utilities. 390b17f1bSmrg * 490b17f1bSmrg * Copyright (c) 2005 Thomas Hellstrom. All rights reserved. 590b17f1bSmrg * 690b17f1bSmrg * Permission is hereby granted, free of charge, to any person obtaining a 790b17f1bSmrg * copy of this software and associated documentation files (the "Software"), 890b17f1bSmrg * to deal in the Software without restriction, including without limitation 990b17f1bSmrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 1090b17f1bSmrg * and/or sell copies of the Software, and to permit persons to whom the 1190b17f1bSmrg * Software is furnished to do so, subject to the following conditions: 1290b17f1bSmrg * 1390b17f1bSmrg * The above copyright notice and this permission notice shall be included in 1490b17f1bSmrg * all copies or substantial portions of the Software. 1590b17f1bSmrg * 1690b17f1bSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1790b17f1bSmrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1890b17f1bSmrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 1990b17f1bSmrg * AUTHOR(S) OR COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 2090b17f1bSmrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 2190b17f1bSmrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 2290b17f1bSmrg * DEALINGS IN THE SOFTWARE. 2390b17f1bSmrg */ 2490b17f1bSmrg 2590b17f1bSmrg#ifndef _DRIDRAWABLE_H 2690b17f1bSmrg#define _DRIDRAWABLE_H 2790b17f1bSmrg 2890b17f1bSmrgtypedef struct _drawableInfo 2990b17f1bSmrg{ 3090b17f1bSmrg drm_drawable_t drmDraw; 3190b17f1bSmrg unsigned stamp; 3290b17f1bSmrg unsigned index; 3390b17f1bSmrg drm_clip_rect_t *clipFront; 3490b17f1bSmrg drm_clip_rect_t *clipBack; 3590b17f1bSmrg int x; 3690b17f1bSmrg int y; 3790b17f1bSmrg int w; 3890b17f1bSmrg int h; 3990b17f1bSmrg int backX; 4090b17f1bSmrg int backY; 4190b17f1bSmrg int numClipFront; 4290b17f1bSmrg int numClipBack; 4390b17f1bSmrg Bool touched; 4490b17f1bSmrg} drawableInfo; 4590b17f1bSmrg 4690b17f1bSmrg/* 4790b17f1bSmrg * Get updated info about the drawable "draw". The drawableInfo record returned is malloced 4890b17f1bSmrg * and administrated internally. Never free it unless you know exactly what you are doing. 4990b17f1bSmrg * The drm hash table "drawHash" needs to be initialized externally. 5090b17f1bSmrg */ 5190b17f1bSmrg 5290b17f1bSmrgextern int 5390b17f1bSmrggetDRIDrawableInfoLocked(void *drawHash, Display * display, int screen, 5490b17f1bSmrg Drawable draw, unsigned lockFlags, int drmFD, drm_context_t drmContext, 5590b17f1bSmrg drmAddress sarea, Bool updateInfo, drawableInfo ** info, 5690b17f1bSmrg unsigned long infoSize); 5790b17f1bSmrg 5890b17f1bSmrg/* 5990b17f1bSmrg * Free all resources created by the above function. Typically done on exit. 6090b17f1bSmrg */ 6190b17f1bSmrg 6290b17f1bSmrgextern void driDestroyHashContents(void *drawHash); 6390b17f1bSmrg 6490b17f1bSmrg#endif 65