]> git.decadent.org.uk Git - ion3.git/blobdiff - ioncore/groupedpholder.c
[svn-upgrade] Integrating new upstream version, ion3 (20070506)
[ion3.git] / ioncore / groupedpholder.c
index ac3b6924d751ebb7ddf416c369cc454f816a3268..cce1a16cc4dd75bbd672c2ca995dce769a428f88 100644 (file)
@@ -1,12 +1,9 @@
 /*
  * ion/ioncore/groupedpholder.c
  *
- * Copyright (c) Tuomo Valkonen 2005-2006
+ * Copyright (c) Tuomo Valkonen 2005-2007
  *
- * Ion is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
+ * See the included file LICENSE for details.
  */
 
 #include <libtu/objp.h>
@@ -127,7 +124,7 @@ WRegion *groupedpholder_do_attach(WGroupedPHolder *ph, int flags,
     data2.u.n.fn=grouped_handler;
     data2.u.n.param=data;
         
-    return pholder_attach_(ph->cont, flags, &data2);
+    return pholder_do_attach(ph->cont, flags, &data2);
 }
 
 
@@ -139,19 +136,32 @@ WRegion *groupedpholder_do_attach(WGroupedPHolder *ph, int flags,
 
 bool groupedpholder_do_goto(WGroupedPHolder *ph)
 {
-    if(ph->cont!=NULL)
-        return pholder_goto(ph->cont);
-    
-    return FALSE;
+    return (ph->cont!=NULL
+            ? pholder_goto(ph->cont)
+            : FALSE);
 }
 
 
 WRegion *groupedpholder_do_target(WGroupedPHolder *ph)
 {
-    if(ph->cont!=NULL)
-        return pholder_target(ph->cont);
+    return (ph->cont!=NULL
+            ? pholder_target(ph->cont)
+            : NULL);
+}
+
+
+WPHolder *groupedpholder_do_root(WGroupedPHolder *ph)
+{
+    WPHolder *root;
+    
+    if(ph->cont==NULL)
+        return NULL;
+    
+    root=pholder_root(ph->cont);
     
-    return NULL;
+    return (root!=ph->cont 
+            ? root
+            : &ph->ph);
 }
 
 
@@ -170,6 +180,9 @@ static DynFunTab groupedpholder_dynfuntab[]={
 
     {(DynFun*)pholder_do_target, 
      (DynFun*)groupedpholder_do_target},
+     
+    {(DynFun*)pholder_do_root, 
+     (DynFun*)groupedpholder_do_root},
     
     END_DYNFUNTAB
 };