summaryrefslogtreecommitdiff
path: root/recordmydesktop
diff options
context:
space:
mode:
authorenselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-10-03 08:29:13 +0000
committerenselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-10-03 08:29:13 +0000
commitc97d974e56edbe32456740ac46cb067363568ca9 (patch)
treea98b1550445d841b5e23d0ab8652244223d5148a /recordmydesktop
parent1a926f3ab636d7eaaa8482d0b21219bbf43f5457 (diff)
src/rmd_setbrwindow.c: Make SetBRWindow() return a success-boolean,
i.e. TRUE for success and FALSE for failure. src/rmd.c: Adapt. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@564 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop')
-rw-r--r--recordmydesktop/src/rmd.c2
-rw-r--r--recordmydesktop/src/rmd_setbrwindow.c18
2 files changed, 10 insertions, 10 deletions
diff --git a/recordmydesktop/src/rmd.c b/recordmydesktop/src/rmd.c
index 98b3862..6c3edfa 100644
--- a/recordmydesktop/src/rmd.c
+++ b/recordmydesktop/src/rmd.c
@@ -96,7 +96,7 @@ int main(int argc,char **argv){
" color depth modes are currently supported.\n");
exit(10);
}
- if(SetBRWindow(pdata.dpy,&pdata.brwin,&pdata.specs,&pdata.args))
+ if (!SetBRWindow(pdata.dpy, &pdata.brwin, &pdata.specs, &pdata.args))
exit(11);
//check if we are under compiz or beryl,
diff --git a/recordmydesktop/src/rmd_setbrwindow.c b/recordmydesktop/src/rmd_setbrwindow.c
index 17b77bb..5261514 100644
--- a/recordmydesktop/src/rmd_setbrwindow.c
+++ b/recordmydesktop/src/rmd_setbrwindow.c
@@ -124,10 +124,10 @@ static void SizePack2_8_16(int *start, int *size, int limit) {
-int SetBRWindow(Display *dpy,
- BRWindow *brwin,
- DisplaySpecs *specs,
- ProgArgs *args){
+boolean SetBRWindow(Display *dpy,
+ BRWindow *brwin,
+ DisplaySpecs *specs,
+ ProgArgs *args) {
//before we start recording we have to make sure the ranges are valid
if(args->windowid==0){//root window
//first set it up
@@ -147,7 +147,7 @@ int SetBRWindow(Display *dpy,
fprintf(stderr,"Window size specification out of bounds!"
"(current resolution:%dx%d)\n",
specs->width,specs->height);
- return 1;
+ return FALSE;
}
}
else{
@@ -158,7 +158,7 @@ int SetBRWindow(Display *dpy,
XGetWindowAttributes(dpy,args->windowid,&attribs);
if((attribs.map_state==IsUnviewable)||(attribs.map_state==IsUnmapped)){
fprintf(stderr,"Window must be mapped and visible!\n");
- return 1;
+ return FALSE;
}
XTranslateCoordinates(dpy,
specs->root,
@@ -176,7 +176,7 @@ int SetBRWindow(Display *dpy,
if((brwin->geom.x+brwin->geom.width>specs->width)||
(brwin->geom.y+brwin->geom.height>specs->height)){
fprintf(stderr,"Window must be on visible screen area!\n");
- return 1;
+ return FALSE;
}
brwin->rgeom.x=brwin->geom.x+args->x;
@@ -188,7 +188,7 @@ int SetBRWindow(Display *dpy,
if((args->x+brwin->rgeom.width>brwin->geom.width)||
(args->y+brwin->rgeom.height>brwin->geom.height)){
fprintf(stderr,"Specified Area is larger than window!\n");
- return 1;
+ return FALSE;
}
}
fprintf(stderr, "Initial recording window is set to:\n"
@@ -209,5 +209,5 @@ int SetBRWindow(Display *dpy,
(((brwin->rgeom.height+15)>>4)<<4)*
((specs->depth==16)?2:4);
- return 0;
+ return TRUE;
}
© All Rights Reserved