Commit f152a5ff authored by claes's avatar claes

ldh function for display of mounted object's children

parent fcb3674a
......@@ -484,6 +484,37 @@ ldh_GetChild(ldh_tSession session, pwr_tOid oid, pwr_tOid *coid)
}
/* Get first child of an object. If MountObject, get child of mounted object */
pwr_tStatus
ldh_GetChildMnt(ldh_tSession session, pwr_tOid oid, pwr_tOid *coid)
{
wb_session *sp = (wb_session *)session;
wb_object o = sp->object(oid);
if (!o) return o.sts();
if ( o.cid() == pwr_eClass_MountObject) {
wb_attribute a(o.sts(), o, "SysBody", "Object");
if ( !a) return a.sts();
pwr_tOid moid;
a.value( &moid);
wb_object mo = sp->object(moid);
mo = mo.first();
if ( mo) {
*coid = mo.oid();
return mo.sts();
}
}
o = o.first();
if (!o) return o.sts();
*coid = o.oid();
return o.sts();
}
pwr_tStatus
ldh_GetClassBody(ldh_tSession session, pwr_tCid cid, char *bname, pwr_tCid *bcid, char **body, int *size)
{
......@@ -495,6 +526,9 @@ ldh_GetClassBody(ldh_tSession session, pwr_tCid cid, char *bname, pwr_tCid *bcid
if ( !o)
return o.sts();
if ( ((wb_orep *)o)->vrep()->type() == ldh_eVolRep_Db)
return LDH__NYI;
*bcid = o.cid();
*size = o.rbSize();
wb_attribute a = wb_attribute( o.sts(), o);
......
......@@ -554,6 +554,11 @@ pwr_tStatus ldh_GetChild (
pwr_tObjid object,
pwr_tObjid *new_object
);
pwr_tStatus ldh_GetChildMnt (
ldh_tSession Session,
pwr_tObjid object,
pwr_tObjid *new_object
);
pwr_tStatus ldh_GetClassBody (
ldh_tSession Session,
pwr_tClassId Class,
......
......@@ -81,7 +81,7 @@ WItemObject::WItemObject( WNav *wnav, pwr_tObjid item_objid,
dest, dest_code, (void *) this, 1, &node);
// Set pixmap
sts = ldh_GetChild( wnav->ldhses, objid, &child);
sts = ldh_GetChildMnt( wnav->ldhses, objid, &child);
if( ODD(sts))
brow_SetAnnotPixmap( node, 0, wnav->brow->pixmap_map);
else
......@@ -246,7 +246,7 @@ int WItemBaseObject::open_children( WNav *wnav, double x, double y)
brow_SetNodraw( wnav->brow->ctx);
child_exist = 0;
sts = ldh_GetChild( wnav->ldhses, objid, &child);
sts = ldh_GetChildMnt( wnav->ldhses, objid, &child);
while ( ODD(sts))
{
child_exist = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment