summaryrefslogtreecommitdiff
path: root/recordmydesktop/src/rectinsert.c
diff options
context:
space:
mode:
authorenselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-09-11 19:26:27 +0000
committerenselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-09-11 19:26:27 +0000
commit7487ea601384016ed6185e9083ea3e0d1b71fa46 (patch)
tree96ae8bc30fb07f7b06372c2780eeb2671af24e02 /recordmydesktop/src/rectinsert.c
parentf635b1be3ea9c3a3892936e95e9306b121d1bb5e (diff)
Started working towards a more clean include hierarchy and
distinguishable program modules. First step: move stuff from global headers that is only used in one source file to those source files. include/rmdfunc.h include/rmdmacro.h include/rmdtypes.h: Move stuff from here src/rmd_jack.c src/get_frame.c src/rmd_cache.c src/load_cache.c src/rectinsert.c src/cache_frame.c src/poll_events.c src/setbrwindow.c src/recordmydesktop.c: To here. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@508 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src/rectinsert.c')
-rw-r--r--recordmydesktop/src/rectinsert.c38
1 files changed, 29 insertions, 9 deletions
diff --git a/recordmydesktop/src/rectinsert.c b/recordmydesktop/src/rectinsert.c
index 1eaa9ef..8685fbb 100644
--- a/recordmydesktop/src/rectinsert.c
+++ b/recordmydesktop/src/rectinsert.c
@@ -26,15 +26,35 @@
#include <recordmydesktop.h>
-//return 1 and null if geom1 in geom2 ,2 and null if geom2 in geom1,
-//0 if they don't collide
-//-1 and two geoms if they collide and geom1 is broken.
-//-2 and one or two geoms if they collide and geom2 is broken.
-//-10 if group and replace is possible
-int CollideRects(WGeometry *wgeom1,
- WGeometry *wgeom2,
- WGeometry **wgeom_return,
- int *ngeoms){
+
+/**
+* Collide two rectangles and dictate most sane action for insertion,
+* as well as provide the updated rectangle(s)
+* \param wgeom1 resident rectangle
+*
+* \param wgeom2 New rectangle
+*
+* \param wgeom_return Pointer to rectangles to be inserted
+*
+* \param ngeoms number of entries in wgeom_return
+*
+* \retval 0 No collision
+*
+* \retval 1 wgeom1 is covered by wgeom2
+*
+* \retval 2 wgeom2 is covered by wgeom1
+*
+* \retval -1 wgeom1 was broken (new is picked up in wgeom_return)
+*
+* \retval -2 wgeom2 was broken (new is picked up in wgeom_return)
+*
+* \retval -10 Grouping the two geoms is possible
+*
+*/
+static int CollideRects(WGeometry *wgeom1,
+ WGeometry *wgeom2,
+ WGeometry **wgeom_return,
+ int *ngeoms) {
//1 fits in 2
if((wgeom1->x>=wgeom2->x)&&
(wgeom1->x+wgeom1->width<=wgeom2->x+wgeom2->width)&&
© All Rights Reserved