e7b2da51ba638fe7f6f4379c6c9470321ac0a88e
tdreszer
Thu Dec 22 11:20:00 2011 -0800
Removed old ifdefs. No functional change here.
diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index 915da71..a5a6db8 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -1326,43 +1326,41 @@
hvGfxUnclip(hvg);
return y;
}
static void doLabelNextItemButtons(struct track *track, struct track *parentTrack, struct hvGfx *hvg, MgFont *font, int y,
int trackPastTabX, int trackPastTabWidth, int fontHeight,
int insideHeight, Color labelColor)
/* If the track allows label next-item buttons (next gene), draw them. */
/* The button will cause hgTracks to run again with the additional CGI */
/* vars nextItem=trackName or prevItem=trackName, which will then */
/* signal the browser to find the next thing on the track before it */
/* does anything else. */
{
int portWidth = insideWidth;
int portX = insideX;
-#ifdef IMAGEv2_DRAG_SCROLL
// If a portal was established, then set the portal dimensions
int portalStart,chromStart;
double basesPerPixel;
if (theImgBox && imgBoxPortalDimensions(theImgBox,&chromStart,NULL,NULL,NULL,&portalStart,NULL,&portWidth,&basesPerPixel))
{
portX = (int)((portalStart - chromStart) / basesPerPixel);
portX += gfxBorder;
if (withLeftLabels)
portX += tl.leftLabelWidth + gfxBorder;
portWidth = portWidth-gfxBorder-insideX;
}
-#endif//def IMAGEv2_DRAG_SCROLL
int arrowWidth = insideHeight;
int arrowButtonWidth = arrowWidth + 2 * NEXT_ITEM_ARROW_BUFFER;
int rightButtonX = portX + portWidth - arrowButtonWidth - 1;
char buttonText[256];
Color fillColor = lightGrayIndex();
labelColor = blackIndex();
hvGfxNextItemButton(hvg, rightButtonX + NEXT_ITEM_ARROW_BUFFER, y, arrowWidth, arrowWidth, labelColor, fillColor, TRUE);
hvGfxNextItemButton(hvg, portX + NEXT_ITEM_ARROW_BUFFER, y, arrowWidth, arrowWidth, labelColor, fillColor, FALSE);
safef(buttonText, ArraySize(buttonText), "hgt.prevItem=%s", track->track);
mapBoxReinvoke(hvg, portX, y + 1, arrowButtonWidth, insideHeight, track, FALSE,
NULL, 0, 0, (revCmplDisp ? "Next item" : "Prev item"), buttonText);
#ifdef IMAGEv2_SHORT_TOGGLE
char *label = (theImgBox ? track->longLabel : parentTrack->longLabel);
int width = portWidth - (2 * arrowButtonWidth);
int x = portX + arrowButtonWidth;
@@ -1953,39 +1951,37 @@
int sliceWidth[stMaxSliceTypes]; // Just being explicit
int sliceOffsetX[stMaxSliceTypes];
int sliceHeight = 0;
int sliceOffsetY = 0;
char *rulerTtl = NULL;
if(theImgBox)
// theImgBox is a global for now to avoid huge rewrite of hgTracks. It is started
// prior to this in doTrackForm()
{
rulerTtl = "drag select or click to zoom";
hPrintf("\n", database);
hPrintf("\n", chromName);
hPrintf("\n", winStart);
hPrintf("\n", winEnd);
hPrintf("\n", tl.picWidth);
- #ifdef IMAGEv2_DRAG_SCROLL
// If a portal was established, then set the global dimensions to the entire image size
if(imgBoxPortalDimensions(theImgBox,&winStart,&winEnd,&(tl.picWidth),NULL,NULL,NULL,NULL,NULL))
{
pixWidth = tl.picWidth;
winBaseCount = winEnd - winStart;
insideWidth = tl.picWidth-gfxBorder-insideX;
}
- #endif//def IMAGEv2_DRAG_SCROLL
memset((char *)sliceWidth, 0,sizeof(sliceWidth));
memset((char *)sliceOffsetX,0,sizeof(sliceOffsetX));
if (withLeftLabels)
{
sliceWidth[stButton] = trackTabWidth + 1;
sliceWidth[stSide] = leftLabelWidth - sliceWidth[stButton] + 1;
sliceOffsetX[stSide] = (revCmplDisp? (tl.picWidth - sliceWidth[stSide] - sliceWidth[stButton]) : sliceWidth[stButton]);
sliceOffsetX[stButton] = (revCmplDisp? (tl.picWidth - sliceWidth[stButton]) : 0);
}
sliceOffsetX[stData] = (revCmplDisp?0:sliceWidth[stSide] + sliceWidth[stButton]);
sliceWidth[stData] = tl.picWidth - (sliceWidth[stSide] + sliceWidth[stButton]);
}
struct flatTracks *flatTracks = NULL;
struct flatTracks *flatTrack = NULL;
@@ -2586,44 +2582,42 @@
if(fd == NULL)
// fail some other way (e.g. HTTP 500)?
errAbort("Couldn't open png for reading");
while(TRUE)
{
size_t n = fread(buf, 1, sizeof(buf), fd);
if(n)
fwrite(buf, 1, n, stdout);
else
break;
}
fclose(fd);
unlink(file);
return;
}
-#endif
+#endif///def SUPPORT_CONTENT_TYPE
if(theImgBox)
{
imageBoxDraw(theImgBox);
- #ifdef IMAGEv2_DRAG_SCROLL
// If a portal was established, then set the global dimensions back to the portal size
if(imgBoxPortalDimensions(theImgBox,NULL,NULL,NULL,NULL,&winStart,&winEnd,&(tl.picWidth),NULL))
{
pixWidth = tl.picWidth;
winBaseCount = winEnd - winStart;
insideWidth = tl.picWidth-gfxBorder-insideX;
}
- #endif//def IMAGEv2_DRAG_SCROLL
imgBoxFree(&theImgBox);
}
else
{
char *titleAttr = "title='click or drag mouse in base position track to zoom in'";
hPrintf("
\n");
}
flatTracksFree(&flatTracks);
}
static void appendLink(struct hotLink **links, char *url, char *name, char *id)
{
// append to list of links for later printing and/or communication with javascript client
@@ -4748,38 +4742,36 @@
/* Before loading items, deal with the next/prev item arrow buttons if pressed. */
if (cgiVarExists("hgt.nextItem"))
doNextPrevItem(TRUE, cgiUsualString("hgt.nextItem", NULL));
else if (cgiVarExists("hgt.prevItem"))
doNextPrevItem(FALSE, cgiUsualString("hgt.prevItem", NULL));
if(!psOutput && !cartUsualBoolean(cart, "hgt.imageV1", FALSE))
{
// Start an imagebox (global for now to avoid huge rewrite of hgTracks)
// Set up imgBox dimensions
int sideSliceWidth = 0; // Just being explicit
if (withLeftLabels)
sideSliceWidth = (insideX - gfxBorder*3) + 2;
theImgBox = imgBoxStart(database,chromName,winStart,winEnd,(!revCmplDisp),sideSliceWidth,tl.picWidth);
- #ifdef IMAGEv2_DRAG_SCROLL
// Define a portal with a default expansion size, then set the global dimensions to the full image size
if(imgBoxPortalDefine(theImgBox,&winStart,&winEnd,&(tl.picWidth),0))
{
winBaseCount = winEnd - winStart;
insideWidth = tl.picWidth-gfxBorder-insideX;
}
- #endif//def IMAGEv2_DRAG_SCROLL
}
char *jsCommand = cartCgiUsualString(cart, hgtJsCommand, "");
if (!isEmpty(jsCommand))
{
cartRemove(cart, hgtJsCommand);
jsCommandDispatch(jsCommand, trackList);
}
/* adjust visibility */
for (track = trackList; track != NULL; track = track->next)
{
/* adjust track visibility based on supertrack just before load loop */
if (tdbIsSuperTrackChild(track->tdb))
@@ -4855,41 +4847,39 @@
for (group = groupList; group != NULL; group = group->next)
{
if (group->trackList != NULL)
{
int looper;
for(looper=1;looper<=2;looper++)
{
boolean isOpen = !isCollapsedGroup(group);
char buf[1000];
safef(buf, sizeof(buf), "\n", collapseGroupVar(group->name), collapseGroupVar(group->name), looper, isOpen ? "0" : "1");
dyStringAppend(looper == 1 ? trackGroupsHidden1 : trackGroupsHidden2, buf);
}
}
}
-#ifdef IMAGEv2_DRAG_SCROLL
if(theImgBox)
{
// If a portal was established, then set the global dimensions back to the portal size
if(imgBoxPortalDimensions(theImgBox,NULL,NULL,NULL,NULL,&winStart,&winEnd,&(tl.picWidth),NULL))
{
winBaseCount = winEnd - winStart;
insideWidth = tl.picWidth-gfxBorder-insideX;
}
}
-#endif//def IMAGEv2_DRAG_SCROLL
/* Center everything from now on. */
hPrintf("
<<<\n"); hPrintf(" | <<\n"); hPrintf(" | <\n"); @@ -5063,31 +5053,31 @@ hPrintf(" | > <\n"); hPrintf(" | >> <<\n"); hPrintf(" | >>> <<<\n"); hPrintf(" | >base<\n"); hPrintf(" | \n"); // Without 'width=' this cell expand to table with, forcing other cells to the sides. hPrintf(" | < >\n"); hPrintf(" | << >>\n"); hPrintf(" | <<< >>>\n"); hPrintf(" | \n"); // Without 'width=' this cell expand to table with, forcing other cells to the sides. hPrintf(" | >\n"); hPrintf(" | >>\n"); hPrintf(" | >>>\n"); hPrintf(" |