summaryrefslogtreecommitdiff
path: root/recordmydesktop/src/rmd_setbrwindow.c
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-11-22 16:39:04 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-11-22 16:39:04 +0000
commit46974eec6744f1c6a61e493dcdfe2471aec87c00 (patch)
treef34517b0871593801a9e7785777ab598eb297163 /recordmydesktop/src/rmd_setbrwindow.c
parentc1776d202b1f88b6856a4bbab4afc53bcc8b86e0 (diff)
src/rmd_cache.c, src/rmd_cache_frame.c, src/rmd_get_frame.c,
src/rmd_init_encoder.c, src/rmd_poll_events.c, src/rmd_rectinsert.c, src/rmd_rectinsert.h, src/rmd_rescue.c, src/rmd_setbrwindow.c, src/rmd_specsfile.c, src/rmd_types.h, src/rmd_update_image.c, src/test-rectinsert-data.c, src/test-rectinsert-types.h, src/test-rectinsert.c: Replaced the custom WGeometry struct-type with the Xlib-provided XRectangle type. Since XRectangle has unsigned width and height, any places in the code where -1 was used in these members of WGeometry to denote invalid rects, where changed to 0 ( zero width or height rects are also considered invalid, wherever met). Also, the following variable renames happened : wgeom => xrect, rgeom => rrect, geom => rect and so on. Some other minor changes in this commit are all related to this type change and also the fact that WGeometry had members of type int, while XRectangle is comprised of short members. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@580 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src/rmd_setbrwindow.c')
-rw-r--r--recordmydesktop/src/rmd_setbrwindow.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/recordmydesktop/src/rmd_setbrwindow.c b/recordmydesktop/src/rmd_setbrwindow.c
index 5261514..431ff43 100644
--- a/recordmydesktop/src/rmd_setbrwindow.c
+++ b/recordmydesktop/src/rmd_setbrwindow.c
@@ -43,7 +43,7 @@
*
* \note This is called separately for width and height.
*/
-static void SizePack2_8_16(int *start, int *size, int limit) {
+static void SizePack2_8_16(short *start, unsigned short *size, unsigned short limit) {
int octoffset,hexoffset;
//align in two
@@ -132,18 +132,18 @@ boolean SetBRWindow(Display *dpy,
if(args->windowid==0){//root window
//first set it up
brwin->windowid=specs->root;
- brwin->geom.x=brwin->geom.y=0;
- brwin->geom.width=specs->width;
- brwin->geom.height=specs->height;
- brwin->rgeom.x=args->x;
- brwin->rgeom.y=args->y;
- brwin->rgeom.width=((args->width)?
- args->width:specs->width-brwin->rgeom.x);
- brwin->rgeom.height=((args->height)?
- args->height:specs->height-brwin->rgeom.y);
+ brwin->rect.x=brwin->rect.y=0;
+ brwin->rect.width=specs->width;
+ brwin->rect.height=specs->height;
+ brwin->rrect.x=args->x;
+ brwin->rrect.y=args->y;
+ brwin->rrect.width=((args->width)?
+ args->width:specs->width-brwin->rrect.x);
+ brwin->rrect.height=((args->height)?
+ args->height:specs->height-brwin->rrect.y);
//and then check validity
- if((brwin->rgeom.x+brwin->rgeom.width>specs->width)||
- (brwin->rgeom.y+brwin->rgeom.height>specs->height)){
+ if((brwin->rrect.x+brwin->rrect.width>specs->width)||
+ (brwin->rrect.y+brwin->rrect.height>specs->height)){
fprintf(stderr,"Window size specification out of bounds!"
"(current resolution:%dx%d)\n",
specs->width,specs->height);
@@ -169,44 +169,44 @@ boolean SetBRWindow(Display *dpy,
&transl_y,
&wchid);
- brwin->geom.x=attribs.x-transl_x;
- brwin->geom.y=attribs.y-transl_y;
- brwin->geom.width=attribs.width;
- brwin->geom.height=attribs.height;
- if((brwin->geom.x+brwin->geom.width>specs->width)||
- (brwin->geom.y+brwin->geom.height>specs->height)){
+ brwin->rect.x=attribs.x-transl_x;
+ brwin->rect.y=attribs.y-transl_y;
+ brwin->rect.width=attribs.width;
+ brwin->rect.height=attribs.height;
+ if((brwin->rect.x+brwin->rect.width>specs->width)||
+ (brwin->rect.y+brwin->rect.height>specs->height)){
fprintf(stderr,"Window must be on visible screen area!\n");
return FALSE;
}
- brwin->rgeom.x=brwin->geom.x+args->x;
- brwin->rgeom.y=brwin->geom.y+args->y;
- brwin->rgeom.width=((args->width)?
- args->width:brwin->geom.width-args->x);
- brwin->rgeom.height=((args->height)?
- args->height:brwin->geom.height-args->y);
- if((args->x+brwin->rgeom.width>brwin->geom.width)||
- (args->y+brwin->rgeom.height>brwin->geom.height)){
+ brwin->rrect.x=brwin->rect.x+args->x;
+ brwin->rrect.y=brwin->rect.y+args->y;
+ brwin->rrect.width=((args->width)?
+ args->width:brwin->rect.width-args->x);
+ brwin->rrect.height=((args->height)?
+ args->height:brwin->rect.height-args->y);
+ if((args->x+brwin->rrect.width>brwin->rect.width)||
+ (args->y+brwin->rrect.height>brwin->rect.height)){
fprintf(stderr,"Specified Area is larger than window!\n");
return FALSE;
}
}
fprintf(stderr, "Initial recording window is set to:\n"
"X:%d Y:%d Width:%d Height:%d\n",
- brwin->rgeom.x,brwin->rgeom.y,
- brwin->rgeom.width,brwin->rgeom.height);
- SizePack2_8_16(&brwin->rgeom.x,&brwin->rgeom.width,specs->width);
- SizePack2_8_16(&brwin->rgeom.y,&brwin->rgeom.height,specs->height);
+ brwin->rrect.x,brwin->rrect.y,
+ brwin->rrect.width,brwin->rrect.height);
+ SizePack2_8_16(&brwin->rrect.x,&brwin->rrect.width,specs->width);
+ SizePack2_8_16(&brwin->rrect.y,&brwin->rrect.height,specs->height);
fprintf(stderr, "Adjusted recording window is set to:\n"
"X:%d Y:%d Width:%d Height:%d\n",
- brwin->rgeom.x,brwin->rgeom.y,
- brwin->rgeom.width,brwin->rgeom.height);
+ brwin->rrect.x,brwin->rrect.y,
+ brwin->rrect.width,brwin->rrect.height);
- brwin->nbytes=(((brwin->rgeom.width+15)>>4)<<4)*
- (((brwin->rgeom.height+15)>>4)<<4)*
+ brwin->nbytes=(((brwin->rrect.width+15)>>4)<<4)*
+ (((brwin->rrect.height+15)>>4)<<4)*
((specs->depth==16)?2:4);
return TRUE;
© All Rights Reserved