fboverlay.h revision 05b261ec
105b261ecSmrg/*
205b261ecSmrg *
305b261ecSmrg * Copyright © 2000 SuSE, Inc.
405b261ecSmrg *
505b261ecSmrg * Permission to use, copy, modify, distribute, and sell this software and its
605b261ecSmrg * documentation for any purpose is hereby granted without fee, provided that
705b261ecSmrg * the above copyright notice appear in all copies and that both that
805b261ecSmrg * copyright notice and this permission notice appear in supporting
905b261ecSmrg * documentation, and that the name of SuSE not be used in advertising or
1005b261ecSmrg * publicity pertaining to distribution of the software without specific,
1105b261ecSmrg * written prior permission.  SuSE makes no representations about the
1205b261ecSmrg * suitability of this software for any purpose.  It is provided "as is"
1305b261ecSmrg * without express or implied warranty.
1405b261ecSmrg *
1505b261ecSmrg * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
1605b261ecSmrg * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
1705b261ecSmrg * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1805b261ecSmrg * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
1905b261ecSmrg * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
2005b261ecSmrg * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2105b261ecSmrg *
2205b261ecSmrg * Author:  Keith Packard, SuSE, Inc.
2305b261ecSmrg */
2405b261ecSmrg
2505b261ecSmrg#ifndef _FBOVERLAY_H_
2605b261ecSmrg#define _FBOVERLAY_H_
2705b261ecSmrg
2805b261ecSmrgextern int	fbOverlayGeneration;
2905b261ecSmrgextern int	fbOverlayScreenPrivateIndex; /* XXX should be static */
3005b261ecSmrgextern int	fbOverlayGetScreenPrivateIndex(void);
3105b261ecSmrg
3205b261ecSmrg#ifndef FB_OVERLAY_MAX
3305b261ecSmrg#define FB_OVERLAY_MAX	2
3405b261ecSmrg#endif
3505b261ecSmrg
3605b261ecSmrgtypedef	void	(*fbOverlayPaintKeyProc) (DrawablePtr, RegionPtr, CARD32, int);
3705b261ecSmrg
3805b261ecSmrgtypedef struct _fbOverlayLayer {
3905b261ecSmrg    union {
4005b261ecSmrg	struct {
4105b261ecSmrg	    pointer	pbits;
4205b261ecSmrg	    int		width;
4305b261ecSmrg	    int		depth;
4405b261ecSmrg	} init;
4505b261ecSmrg	struct {
4605b261ecSmrg	    PixmapPtr	pixmap;
4705b261ecSmrg	    RegionRec	region;
4805b261ecSmrg	} run;
4905b261ecSmrg    } u;
5005b261ecSmrg    CARD32	key;	    /* special pixel value */
5105b261ecSmrg} FbOverlayLayer;
5205b261ecSmrg
5305b261ecSmrgtypedef struct _fbOverlayScrPriv {
5405b261ecSmrg    int			    nlayers;
5505b261ecSmrg    fbOverlayPaintKeyProc   PaintKey;
5605b261ecSmrg    fbCopyProc		    CopyWindow;
5705b261ecSmrg    FbOverlayLayer	    layer[FB_OVERLAY_MAX];
5805b261ecSmrg} FbOverlayScrPrivRec, *FbOverlayScrPrivPtr;
5905b261ecSmrg
6005b261ecSmrg#define fbOverlayGetScrPriv(s) \
6105b261ecSmrg    ((fbOverlayGetScreenPrivateIndex() != -1) ? \
6205b261ecSmrg     (s)->devPrivates[fbOverlayGetScreenPrivateIndex()].ptr : NULL)
6305b261ecSmrgBool
6405b261ecSmrgfbOverlayCreateWindow(WindowPtr pWin);
6505b261ecSmrg
6605b261ecSmrgBool
6705b261ecSmrgfbOverlayCloseScreen (int iScreen, ScreenPtr pScreen);
6805b261ecSmrg
6905b261ecSmrgint
7005b261ecSmrgfbOverlayWindowLayer(WindowPtr pWin);
7105b261ecSmrg
7205b261ecSmrgBool
7305b261ecSmrgfbOverlayCreateScreenResources(ScreenPtr pScreen);
7405b261ecSmrg
7505b261ecSmrgvoid
7605b261ecSmrgfbOverlayPaintKey (DrawablePtr	pDrawable,
7705b261ecSmrg		   RegionPtr	pRegion,
7805b261ecSmrg		   CARD32	pixel,
7905b261ecSmrg		   int		layer);
8005b261ecSmrgvoid
8105b261ecSmrgfbOverlayUpdateLayerRegion (ScreenPtr	pScreen,
8205b261ecSmrg			    int		layer,
8305b261ecSmrg			    RegionPtr	prgn);
8405b261ecSmrg
8505b261ecSmrg
8605b261ecSmrgvoid
8705b261ecSmrgfbOverlayCopyWindow(WindowPtr	pWin,
8805b261ecSmrg		    DDXPointRec	ptOldOrg,
8905b261ecSmrg		    RegionPtr	prgnSrc);
9005b261ecSmrg
9105b261ecSmrgvoid
9205b261ecSmrgfbOverlayWindowExposures (WindowPtr	pWin,
9305b261ecSmrg			  RegionPtr	prgn,
9405b261ecSmrg			  RegionPtr	other_exposed);
9505b261ecSmrg
9605b261ecSmrgvoid
9705b261ecSmrgfbOverlayPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);
9805b261ecSmrg
9905b261ecSmrg
10005b261ecSmrgBool
10105b261ecSmrgfbOverlaySetupScreen(ScreenPtr	pScreen,
10205b261ecSmrg		     pointer	pbits1,
10305b261ecSmrg		     pointer	pbits2,
10405b261ecSmrg		     int	xsize,
10505b261ecSmrg		     int	ysize,
10605b261ecSmrg		     int	dpix,
10705b261ecSmrg		     int	dpiy,
10805b261ecSmrg		     int	width1,
10905b261ecSmrg		     int	width2,
11005b261ecSmrg		     int	bpp1,
11105b261ecSmrg		     int	bpp2);
11205b261ecSmrg
11305b261ecSmrgBool
11405b261ecSmrgfbOverlayFinishScreenInit(ScreenPtr	pScreen,
11505b261ecSmrg			  pointer	pbits1,
11605b261ecSmrg			  pointer	pbits2,
11705b261ecSmrg			  int		xsize,
11805b261ecSmrg			  int		ysize,
11905b261ecSmrg			  int		dpix,
12005b261ecSmrg			  int		dpiy,
12105b261ecSmrg			  int		width1,
12205b261ecSmrg			  int		width2,
12305b261ecSmrg			  int		bpp1,
12405b261ecSmrg			  int		bpp2,
12505b261ecSmrg			  int		depth1,
12605b261ecSmrg			  int		depth2);
12705b261ecSmrg
12805b261ecSmrg#endif /* _FBOVERLAY_H_ */
129