91ed276194ce25992417787117a806b8e2172c01
larrym
  Tue Nov 22 15:40:32 2011 -0800
add tdbSetCartVisibility and use in hgTracks to fix #1666
diff --git src/hg/inc/trackDb.h src/hg/inc/trackDb.h
index 20a477a..801de68 100644
--- src/hg/inc/trackDb.h
+++ src/hg/inc/trackDb.h
@@ -1,32 +1,38 @@
 /* trackDb.h was originally generated by the autoSql program, which also
  * generated trackDb.c and trackDb.sql.  This header links the database and
  * the RAM representation of objects. */
 
 #ifndef TRACKDB_H
 #define TRACKDB_H
 
+struct trackDb;         // forward definition for use in cart.h
+
 #include "common.h"
 
 #ifndef JKSQL_H
 #include "jksql.h"
 #endif
 
 #ifndef LINEFILE_H
 #include "linefile.h"
 #endif
 
+#ifndef CART_H
+#include "cart.h"
+#endif
+
 #define TRACKDB_NUM_COLS 21
 
 // Forward definitions
 struct tdbExtras;
 
 struct trackDb
 /* This describes an annotation track. */
     {
     struct trackDb *next;  /* Next in singly linked list.  Next sibling in tree. */
     char *track; /* Symbolic ID of Track - used in cart. Is tableName in database historically. */
     char *table; /* Symbolic ID of Table - used in database. Same as track usually. */
     char *shortLabel;	/* Short label displayed on left */
     char *type;	/* Track type: bed, psl, genePred, etc. */
     char *longLabel;	/* Long label displayed in middle */
     unsigned char visibility;	/* 0=hide, 1=dense, 2=full, 3=pack, 4=squish */
@@ -547,30 +553,33 @@
 struct _membersForAll *tdbExtrasMembersForAll(struct trackDb *tdb);
 // Returns composite view/dimension members for all, else NULL.
 
 void tdbExtrasMembersForAllSet(struct trackDb *tdb, struct _membersForAll *membersForAll);
 // Sets the composite view/dimensions members for all for later retrieval.
 
 struct _membership *tdbExtrasMembership(struct trackDb *tdb);
 // Returns subtrack membership if already known, else NULL
 
 void tdbExtrasMembershipSet(struct trackDb *tdb,struct _membership *membership);
 // Sets the subtrack membership for later retrieval.
 
 char *tdbBigFileName(struct sqlConnection *conn, struct trackDb *tdb);
 // Return file name associated with bigWig.  Do a freeMem on returned string when done.
 
+void tdbSetCartVisibility(struct trackDb *tdb, struct cart *cart, char *vis);
+// Set visibility in the cart. Handles all the complications necessary for subtracks.
+
 // More INLINES which depend on what the definition of "is" is
 INLINE boolean tdbIsBigBed(struct trackDb *tdb)
 // Local test to see if something is big bed.  Handles hub tracks unlike hIsBigBed.
 {
 return startsWithWord("bigBed", tdb->type);
 }
 
 INLINE boolean tdbIsBigWig(struct trackDb *tdb)
 // Local test to see if something is big bed.  Handles hub tracks unlike hIsBigBed.
 {
 return startsWithWord("bigWig", tdb->type);
 }
 
 INLINE boolean tdbIsBam(struct trackDb *tdb)
 // Return TRUE if tdb corresponds to a BAM file.