+} // static VOID PaintIcon()
+
+inline UINTN ComputeRow0PosX(VOID) {
+ return ((UGAHeight / 2) - ROW0_TILESIZE / 2);
+} // UINTN ComputeRow0PosX()
+
+// Display (or erase) the arrow icons to the left and right of an icon's row,
+// as appropriate.
+static VOID PaintArrows(SCROLL_STATE *State, UINTN PosX, UINTN PosY, UINTN row0Loaders) {
+ CHAR16 FileName[256];
+ EG_IMAGE *TempImage;
+ UINTN Width, Height, RightX, AdjPosY;
+
+ // NOTE: Assume that left and right arrows are of the same size....
+ Width = egemb_arrow_left.Width;
+ Height = egemb_arrow_left.Height;
+ RightX = (UGAWidth + (ROW0_TILESIZE + TILE_XSPACING) * State->MaxVisible) / 2 + TILE_XSPACING;
+ AdjPosY = PosY - (Height / 2);
+
+ // For PaintIcon() calls, the starting Y position is moved to the midpoint
+ // of the surrounding row; PaintIcon() adjusts this back up by half the
+ // icon's height to properly center it.
+ if ((State->FirstVisible > 0) && (!(GlobalConfig.HideUIFlags & HIDEUI_FLAG_ARROWS))) {
+ SPrint(FileName, 255, L"%s\\arrow_left.icns", GlobalConfig.IconsDir ? GlobalConfig.IconsDir : DEFAULT_ICONS_DIR);
+ PaintIcon(&egemb_arrow_left, FileName, PosX, PosY, ALIGN_RIGHT);
+ } else {
+ TempImage = egCropImage(GlobalConfig.ScreenBackground, PosX - Width, AdjPosY, Width, Height);
+ BltImage(TempImage, PosX - Width, AdjPosY);
+ egFreeImage(TempImage);
+ } // if/else
+
+ if ((State->LastVisible < (row0Loaders - 1)) && (!(GlobalConfig.HideUIFlags & HIDEUI_FLAG_ARROWS))) {
+ SPrint(FileName, 255, L"%s\\arrow_right.icns", GlobalConfig.IconsDir ? GlobalConfig.IconsDir : DEFAULT_ICONS_DIR);
+ PaintIcon(&egemb_arrow_right, FileName, RightX, PosY, ALIGN_LEFT);
+ } else {
+ TempImage = egCropImage(GlobalConfig.ScreenBackground, RightX, AdjPosY, Width, Height);
+ BltImage(TempImage, RightX, AdjPosY);
+ egFreeImage(TempImage);
+ } // if/else
+} // VOID PaintArrows()