1: /*
     2:  ============================================================================
     3:  xoblite™ -> an advanced "extended shell" for Microsoft® Windows® 11
     4:  Copyright © 2002-2026 Karl Henrik Henriksson [qwilk/@xoblite]
     5:  Copyright © 2001-2004 The Blackbox for Windows Development Team
     6:  http://xoblite.net/ + https://github.com/xoblite/
     7:  ============================================================================
     8: 
     9:   Blackbox for Windows is free software, released under the
    10:   GNU General Public License (GPL version 2 or later), with an extension
    11:   that allows linking of proprietary modules under a controlled interface.
    12:   What this means is that plugins etc. are allowed to be released
    13:   under any license the author wishes. Please note, however, that the
    14:   original Blackbox gradient math code used in Blackbox for Windows
    15:   is available under the BSD license.
    16: 
    17:   http://www.fsf.org/licenses/gpl.html
    18:   http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface
    19:   http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5
    20: 
    21:   This program is distributed in the hope that it will be useful,
    22:   but WITHOUT ANY WARRANTY; without even the implied warranty of
    23:   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    24:   GNU General Public License for more details.
    25: 
    26:   For additional license information, please read the included license.html.
    27: 
    28:  ============================================================================
    29: */
    30: 
    31: #include "BImage.h" 
    32: #include "..\Settings\Settings.h" 
    33: 
    34: extern Settings* pSettings;
    35: 
    36: //===========================================================================
    37: // Function: DrawGlyph
    38: // Purpose: ...
    39: //===========================================================================
    40: 
    41: void BImage::DrawGlyph(HDC hdc, RECT r, int glyph, COLORREF glyphColor)
    42: {
    43:     HPEN hPen = CreatePen(PS_SOLID, 1, glyphColor);
    44:     HPEN hOldPen = (HPEN) SelectObject(hdc, hPen);
    45:     SelectObject(hdc, GetStockObject(NULL_BRUSH)); // -> Do not automatically fill any drawn shapes below...
    46: 
    47:     int x = r.left, y = r.top;
    48:     RECT bulletRect;
    49:     switch (pSettings->scalingFactorHiDPI)
    50:     {
    51:         case 4: { SetRect(&bulletRect, x-10, y-10, x+10, y+10); break; }        // -> 20x20 pixel bullet
    52:         case 3: { SetRect(&bulletRect, x-7, y-7, x+8, y+8); break; }            // -> 15x15 pixel bullet
    53:         case 2: { SetRect(&bulletRect, x-5, y-5, x+5, y+5); break; }            // -> 10x10 pixel bullet
    54:         case 1: default: { SetRect(&bulletRect, x-2, y-2, x+3, y+3); break; }   // -> 5x5 pixel bullet
    55:     }
    56: 
    57:     //====================
    58: 
    59:     switch (glyph)
    60:     {
    61:         case GLYPH_MENU_SQUARE: // <-> MENU_BULLET_SQUARE
    62:         {
    63:             for (int n = 1; n <= pSettings->scalingFactorHiDPI; n++)
    64:             {
    65:                 Rectangle(hdc, bulletRect.left, bulletRect.top, bulletRect.right, bulletRect.bottom);
    66:                 InflateRect(&bulletRect, -1, -1);
    67:             }
    68:             break;
    69:         }
    70:         default: break;
    71:     }
    72: 
    73:     //====================
    74: 
    75:     SelectObject(hdc, hOldPen);
    76:     DeleteObject(hPen);
    77:     DeleteObject(hOldPen);
    78: }
    79: 
    80: //===========================================================================
    81: