From c97d974e56edbe32456740ac46cb067363568ca9 Mon Sep 17 00:00:00 2001
From: enselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a>
Date: Fri, 3 Oct 2008 08:29:13 +0000
Subject: 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
---
 recordmydesktop/src/rmd.c             |  2 +-
 recordmydesktop/src/rmd_setbrwindow.c | 18 +++++++++---------
 2 files changed, 10 insertions(+), 10 deletions(-)

(limited to 'recordmydesktop')

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;
 }
-- 
cgit v1.2.3