fboverlay.h revision 6747b715
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
284642e01fSmrg#include "privates.h"
294642e01fSmrg
306747b715Smrgextern _X_EXPORT DevPrivateKey fbOverlayGetScreenPrivateKey(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;
566747b715Smrg    miCopyProc		    CopyWindow;
5705b261ecSmrg    FbOverlayLayer	    layer[FB_OVERLAY_MAX];
5805b261ecSmrg} FbOverlayScrPrivRec, *FbOverlayScrPrivPtr;
5905b261ecSmrg
6005b261ecSmrg#define fbOverlayGetScrPriv(s) \
614642e01fSmrg    dixLookupPrivate(&(s)->devPrivates, fbOverlayGetScreenPrivateKey())
626747b715Smrgextern _X_EXPORT Bool
6305b261ecSmrgfbOverlayCreateWindow(WindowPtr pWin);
6405b261ecSmrg
656747b715Smrgextern _X_EXPORT Bool
6605b261ecSmrgfbOverlayCloseScreen (int iScreen, ScreenPtr pScreen);
6705b261ecSmrg
686747b715Smrgextern _X_EXPORT int
6905b261ecSmrgfbOverlayWindowLayer(WindowPtr pWin);
7005b261ecSmrg
716747b715Smrgextern _X_EXPORT Bool
7205b261ecSmrgfbOverlayCreateScreenResources(ScreenPtr pScreen);
7305b261ecSmrg
746747b715Smrgextern _X_EXPORT void
7505b261ecSmrgfbOverlayPaintKey (DrawablePtr	pDrawable,
7605b261ecSmrg		   RegionPtr	pRegion,
7705b261ecSmrg		   CARD32	pixel,
7805b261ecSmrg		   int		layer);
796747b715Smrgextern _X_EXPORT void
8005b261ecSmrgfbOverlayUpdateLayerRegion (ScreenPtr	pScreen,
8105b261ecSmrg			    int		layer,
8205b261ecSmrg			    RegionPtr	prgn);
8305b261ecSmrg
8405b261ecSmrg
856747b715Smrgextern _X_EXPORT void
8605b261ecSmrgfbOverlayCopyWindow(WindowPtr	pWin,
8705b261ecSmrg		    DDXPointRec	ptOldOrg,
8805b261ecSmrg		    RegionPtr	prgnSrc);
8905b261ecSmrg
906747b715Smrgextern _X_EXPORT void
9105b261ecSmrgfbOverlayWindowExposures (WindowPtr	pWin,
9205b261ecSmrg			  RegionPtr	prgn,
9305b261ecSmrg			  RegionPtr	other_exposed);
9405b261ecSmrg
956747b715Smrgextern _X_EXPORT Bool
9605b261ecSmrgfbOverlaySetupScreen(ScreenPtr	pScreen,
9705b261ecSmrg		     pointer	pbits1,
9805b261ecSmrg		     pointer	pbits2,
9905b261ecSmrg		     int	xsize,
10005b261ecSmrg		     int	ysize,
10105b261ecSmrg		     int	dpix,
10205b261ecSmrg		     int	dpiy,
10305b261ecSmrg		     int	width1,
10405b261ecSmrg		     int	width2,
10505b261ecSmrg		     int	bpp1,
10605b261ecSmrg		     int	bpp2);
10705b261ecSmrg
1086747b715Smrgextern _X_EXPORT Bool
10905b261ecSmrgfbOverlayFinishScreenInit(ScreenPtr	pScreen,
11005b261ecSmrg			  pointer	pbits1,
11105b261ecSmrg			  pointer	pbits2,
11205b261ecSmrg			  int		xsize,
11305b261ecSmrg			  int		ysize,
11405b261ecSmrg			  int		dpix,
11505b261ecSmrg			  int		dpiy,
11605b261ecSmrg			  int		width1,
11705b261ecSmrg			  int		width2,
11805b261ecSmrg			  int		bpp1,
11905b261ecSmrg			  int		bpp2,
12005b261ecSmrg			  int		depth1,
12105b261ecSmrg			  int		depth2);
12205b261ecSmrg
12305b261ecSmrg#endif /* _FBOVERLAY_H_ */
124