5b97c90762187cf1993742fe8c422308e08d082c tdreszer Wed Jul 11 17:08:55 2012 -0700 Next batch of many checkins as dictated by Jim. Formatting if and limiting lines to 100 chars. Changes limited to lines last touched by tdreszer (git blame) so as not to ruin history. None of these changes should affect executables in any way. diff --git src/hg/hgTracks/hgTracks.h src/hg/hgTracks/hgTracks.h index 832bdd9..d5931c9 100644 --- src/hg/hgTracks/hgTracks.h +++ src/hg/hgTracks/hgTracks.h @@ -195,31 +195,32 @@ struct itemAttrTbl *itemAttrTbl; /* relational attributes for specific items (color) */ /* fill in left label drawing area */ Color labelColor; /* Fixed color for the track label (optional) */ void (*drawLeftLabels)(struct track *tg, int seqStart, int seqEnd, struct hvGfx *hvg, int xOff, int yOff, int width, int height, boolean withCenterLabels, MgFont *font, Color color, enum trackVisibility vis); struct track *subtracks; /* list of subsidiary tracks that are loaded and drawn by this track. This is used for "composite" tracks, such as "mafWiggle */ struct track *parent; /* Parent track if any */ - struct track *prevTrack; /* if not NULL, points to track immediately above in the image. Needed by ConditionalCenterLabel logic */ + struct track *prevTrack; // if not NULL, points to track immediately above in the image. + // Needed by ConditionalCenterLabel logic void (*nextPrevExon)(struct track *tg, struct hvGfx *hvg, void *item, int x, int y, int w, int h, boolean next); /* Function will draw the button on a track item and assign a map */ /* box to it as well, so that a click will move the browser window */ /* to the next (or previous if next==FALSE) item. This is meant to */ /* jump to parts of an item already partially in the window but is */ /* hanging off the edge... e.g. the next exon in a gene. */ void (*nextPrevItem)(struct track *tg, boolean next); /* If this function is given, it can dictate where the browser loads */ /* up based on whether a next-item button on the longLabel line of */ /* the track was pressed (as opposed to the next-item buttons on the */ /* track items themselves... see nextPrevExon() ). This is meant for */ /* going to the next/previous item currently unseen in the browser, */ /* e.g. the next gene. SO FAR THIS IS UNIMPLEMENTED. */ @@ -372,31 +373,31 @@ extern int winEnd; /* End of window in sequence. */ extern int maxItemsInFullTrack; /* Maximum number of items displayed in full */ extern char *position; /* Name of position. */ extern int leftLabelWidthDefaultChars; /* default number of characters allowed for left label */ extern int leftLabelWidthChars; /* number of characters allowed for left label */ extern int trackTabWidth; extern int gfxBorder; /* Width of graphics border. */ extern int insideWidth; /* Width of area to draw tracks in in pixels. */ extern int insideX; /* Start of area to draw track in in pixels. */ extern int leftLabelX; /* Start of area to draw left labels on. */ extern int leftLabelWidth; /* Width of area to draw left labels on. */ extern boolean withLeftLabels; /* Display left labels? */ extern boolean withCenterLabels; /* Display center labels? */ extern boolean withGuidelines; /* Display guidelines? */ extern boolean withNextExonArrows; /* Display next exon navigation buttons near center labels? */ -extern struct hvGfx *hvgSide; // An extra pointer to a side label image that can be built if needed +extern struct hvGfx *hvgSide; // An extra pointer to side label image that can be built if needed extern int seqBaseCount; /* Number of bases in sequence. */ extern int winBaseCount; /* Number of bases in window. */ extern float basesPerPixel; /* bases covered by a pixel; a measure of zoom */ extern boolean zoomedToBaseLevel; /* TRUE if zoomed so we can draw bases. */ extern boolean zoomedToCodonLevel; /* TRUE if zoomed so we can print codon text in genePreds*/ extern boolean zoomedToCdsColorLevel; /* TRUE if zoomed so we cancolor each codon*/ extern char *ctFileName; /* Custom track file. */ extern struct customTrack *ctList; /* Custom tracks. */ extern struct slName *browserLines; /* Custom track "browser" lines. */ extern int rulerMode; /* on, off, full */ extern boolean withLeftLabels; /* Display left labels? */ extern boolean withCenterLabels; /* Display center labels? */ @@ -624,47 +625,47 @@ /* Draw generic item list. Features must be fixed height * and tg->drawItemAt has to be filled in. */ void bedDrawSimpleAt(struct track *tg, void *item, struct hvGfx *hvg, int xOff, int y, double scale, MgFont *font, Color color, enum trackVisibility vis); /* Draw a single simple bed item at position. */ void bedDrawSimple(struct track *tg, int seqStart, int seqEnd, struct hvGfx *hvg, int xOff, int yOff, int width, MgFont *font, Color color, enum trackVisibility vis); /* Draw simple Bed items. */ typedef struct slList *(*ItemLoader)(char **row); -void bedLoadItemByQuery(struct track *tg, char *table, - char *query, ItemLoader loader); +void bedLoadItemByQuery(struct track *tg, char *table, char *query, ItemLoader loader); /* Generic tg->item loader. If query is NULL use generic hRangeQuery(). */ void bedLoadItem(struct track *tg, char *table, ItemLoader loader); /* Generic tg->item loader. */ void simpleBedNextPrevEdge(struct track *tg, struct hvGfx *hvg, void *item, int x, int y, int w, int h, boolean next); /* Like linkedFeaturesNextPrevItem, but for simple bed which has no block structure so * this simply zaps us to the right/left edge of the feature. Arrows have already been * drawn; here we figure out coords and draw a mapBox. */ void loadLinkedFeaturesWithLoaders(struct track *tg, struct slList *(*itemLoader)(char **row), struct linkedFeatures *(*lfFromWhatever)(struct slList *item), - char *scoreColumn, char *moreWhere, boolean (*itemFilter)(struct slList *item)); + char *scoreColumn, char *moreWhere, + boolean (*itemFilter)(struct slList *item)); /* Make a linkedFeatures loader by providing three functions: (1) a regular */ /* item loader found in all autoSql modules, (2) a custom myStruct->linkedFeatures */ /* translating function, and (3) a function to free the thing loaded in (1). */ struct linkedFeatures *bedMungToLinkedFeatures(struct bed **pBed, struct trackDb *tdb, int fieldCount, int scoreMin, int scoreMax, boolean useItemRgb); /* Convert bed to a linkedFeature, destroying bed in the process. */ struct bigBedInterval *bigBedSelectRange(struct track *track, char *chrom, int start, int end, struct lm *lm); /* Return list of intervals in range. */ void bigBedAddLinkedFeaturesFrom(struct track *track, char *chrom, int start, int end, int scoreMin, int scoreMax, boolean useItemRgb, int fieldCount, struct linkedFeatures **pLfList); @@ -1057,31 +1058,32 @@ void linkedFeaturesSeriesDraw(struct track *tg, int seqStart, int seqEnd, struct hvGfx *hvg, int xOff, int yOff, int width, MgFont *font, Color color, enum trackVisibility vis); /* Draw linked features series items. */ struct linkedFeaturesSeries *lfsFromColoredExonBed(struct bed *bed); /* Convert a single BED 14 thing into a special linkedFeaturesSeries */ /* where each linkedFeatures is a colored block. */ void makeRedGreenShades(struct hvGfx *hvg); /* Makes some colors for the typical red/green microarray spectrum. */ void linkedFeaturesSeriesMethods(struct track *tg); -void lfsMapItemName(struct track *tg, struct hvGfx *hvg, void *item, char *itemName, char *mapItemName, int start, int end, +void lfsMapItemName(struct track *tg, struct hvGfx *hvg, void *item, char *itemName, + char *mapItemName, int start, int end, int x, int y, int width, int height); void drawScaledBoxSample(struct hvGfx *hvg, int chromStart, int chromEnd, double scale, int xOff, int y, int height, Color color, int score); /* Draw a box scaled from chromosome to window coordinates. */ struct track *trackFromTrackDb(struct trackDb *tdb); /* Create a track based on the tdb */ int spreadStringCharWidth(int width, int count); Color getOrangeColor(); /* Return color used for insert indicators in multiple alignments */ @@ -1161,37 +1163,39 @@ /* Construct track subtrack list from trackDb entry for container tracks. */ bool isSubtrackVisible(struct track *tg); /* Should this subtrack be displayed? */ void compositeTrackVis(struct track *track); /* set visibilities of subtracks */ boolean isWithCenterLabels(struct track *track); /* Special cases: inhibit center labels of subtracks in dense mode, and * of composite track in non-dense mode. * BUT if track->tdb has a centerLabelDense setting, let subtracks go with * the default and inhibit composite track center labels in all modes. * Otherwise use the global boolean withCenterLabels. */ -#define isCenterLabelConditional(track) ((limitVisibility(track) == tvDense) && tdbIsCompositeChild((track)->tdb)) +#define isCenterLabelConditional(track) \ + ((limitVisibility(track) == tvDense) && tdbIsCompositeChild((track)->tdb)) // dense subtracks have conditional centerLabels boolean isCenterLabelConditionallySeen(struct track *track); // returns FALSE if track and prevTrack have same parent, and are both dense subtracks -#define isCenterLabelIncluded(track) (isWithCenterLabels(track) && (theImgBox || isCenterLabelConditionallySeen(track))) +#define isCenterLabelIncluded(track) \ + (isWithCenterLabels(track) && (theImgBox || isCenterLabelConditionallySeen(track))) // Center labels may be conditionally included void affyTxnPhase2Methods(struct track *track); /* Methods for dealing with a composite transcriptome tracks. */ void loadGenePred(struct track *tg); /* Convert gene pred in window to linked feature. */ boolean highlightItem(struct track *tg, void *item); /* Should this item be highlighted? */ void linkedFeaturesSeriesDrawAt(struct track *tg, void *item, struct hvGfx *hvg, int xOff, int y, double scale, MgFont *font, Color color, enum trackVisibility vis); /* Draw a linked features series item at position. */