[Redbutton-devel] SF.net SVN: redbutton: [126] redbutton-browser/trunk
Brought to you by:
skilvington
|
From: <ski...@us...> - 2006-06-28 16:27:42
|
Revision: 126 Author: skilvington Date: 2006-06-28 09:27:17 -0700 (Wed, 28 Jun 2006) ViewCVS: http://svn.sourceforge.net/redbutton/?rev=126&view=rev Log Message: ----------- add a mechanism for setting a clip rectangle on the overlay Modified Paths: -------------- redbutton-browser/trunk/MHEGDisplay.c redbutton-browser/trunk/MHEGDisplay.h Modified: redbutton-browser/trunk/MHEGDisplay.c =================================================================== --- redbutton-browser/trunk/MHEGDisplay.c 2006-06-27 16:21:54 UTC (rev 125) +++ redbutton-browser/trunk/MHEGDisplay.c 2006-06-28 16:27:17 UTC (rev 126) @@ -383,7 +383,42 @@ } /* + * set the clip rectangle for all subsequent drawing on the overlay * coords should be in the range 0-MHEG_XRES, 0-MHEG_YRES + */ + +void +MHEGDisplay_setClipRectangle(MHEGDisplay *d, XYPosition *pos, OriginalBoxSize *box) +{ + XRectangle clip; + + /* scale if fullscreen */ + clip.x = (pos->x_position * d->xres) / MHEG_XRES; + clip.y = (pos->y_position * d->yres) / MHEG_YRES; + clip.width = (box->x_length * d->xres) / MHEG_XRES; + clip.height = (box->y_length * d->yres) / MHEG_YRES; + +/* TODO */ +/* this will effect the XRenderComposite() call in _refresh() */ + XRenderSetPictureClipRectangles(d->dpy, d->overlay_pic, 0, 0, &clip, 1); + + return; +} + +/* + * remove the clip rectangle from the overlay + */ + +void +MHEGDisplay_unsetClipRectangle(MHEGDisplay *d) +{ + XRenderSetPictureClipRectangles(d->dpy, d->overlay_pic, 0, 0, NULL, 0); + + return; +} + +/* + * coords should be in the range 0-MHEG_XRES, 0-MHEG_YRES * width is the line width in pixels * style should be LineStyle_solid/dashed/dotted */ Modified: redbutton-browser/trunk/MHEGDisplay.h =================================================================== --- redbutton-browser/trunk/MHEGDisplay.h 2006-06-27 16:21:54 UTC (rev 125) +++ redbutton-browser/trunk/MHEGDisplay.h 2006-06-28 16:27:17 UTC (rev 126) @@ -60,6 +60,8 @@ void MHEGDisplay_refresh(MHEGDisplay *, XYPosition *, OriginalBoxSize *); /* drawing routines */ +void MHEGDisplay_setClipRectangle(MHEGDisplay *, XYPosition *, OriginalBoxSize *); +void MHEGDisplay_unsetClipRectangle(MHEGDisplay *); void MHEGDisplay_drawHoriLine(MHEGDisplay *, XYPosition *, unsigned int, int, int, MHEGColour *); void MHEGDisplay_drawVertLine(MHEGDisplay *, XYPosition *, unsigned int, int, int, MHEGColour *); void MHEGDisplay_fillTransparentRectangle(MHEGDisplay *, XYPosition *, OriginalBoxSize *); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |