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: #ifndef __DESKTOP_H 
    32: #define __DESKTOP_H 
    33: 
    34: #include "..\API\BBApi.h" 
    35: #include "..\Menu\MenuCommon.h" 
    36: #include "..\Settings\Settings.h" 
    37: #include "..\Sounds\Sounds.h" 
    38: #include "..\Toolbar\Taskbar.h" 
    39: #include "..\Toolbar\Toolbar.h" 
    40: #include "..\Workspaces\Workspaces.h" 
    41: 
    42: #define DESKTOP_UPDATE_TIMER 1 
    43: 
    44: //===========================================================================
    45: 
    46: class Desktop
    47: {
    48: public:
    49:     Desktop(HINSTANCE hInstance);
    50:     ~Desktop();
    51: 
    52:     friend LRESULT CALLBACK DesktopWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
    53: 
    54:     void UpdateDesktopWindow();
    55:     void GetDimensions();
    56: 
    57:     void LoadWallpaper(LPSTR imagePath);
    58:     void DrawWallpaper(HDC hdc);
    59: 
    60:     void CheckWidgetPlacement(Placement* widget);
    61: 
    62:     LRESULT MouseAndDropHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
    63: 
    64:     bool GetClockText(bool forceUpdate);
    65:     bool GetGreetingText(bool forceUpdate);
    66: 
    67:     void FullscreenDetected(bool fullscreen);
    68: 
    69:     //====================
    70: 
    71:     void ShadeWindow();
    72:     void WinShade(HWND hwnd, int listIndex, bool maximized);
    73:     void WinUnshade(HWND hwnd, int listIndex, bool maximized);
    74: 
    75:     void GrowWindowHeight();
    76:     void GrowWindowWidth();
    77:     void LowerWindow();
    78:     void RaiseWindow();
    79: 
    80:     //====================
    81: 
    82:     HINSTANCE hDesktopInstance;
    83:     HWND hBlackboxWnd, hDesktopWnd;
    84:     HDC cachedBackground;
    85: 
    86:     int DesktopX, DesktopY, DesktopWidth, DesktopHeight;
    87:     int DesktopCenterX, DesktopCenterY;
    88: 
    89:     wchar_t CurrentTime[32], CurrentWeekday[32], CurrentDate[MAX_LINE_LENGTH], CurrentGreeting[256];
    90:     int displayedMinute;
    91:     time_t systemTime;
    92:     struct tm localTime;
    93:     int currentHour, currentMinute;
    94: 
    95:     RECT clockRect, weekdayRect, dateRect, greetingRect;
    96: 
    97:     int numberOfDisplayMonitors;
    98: 
    99:     bool fullscreenDetected;
   100: 
   101:     typedef struct WallpaperStruct
   102:     {
   103:         char path[MAX_PATH];
   104:         HBITMAP bitmap;
   105:         bool argb;
   106:         int mode;
   107:         int width;
   108:         int height;
   109:         int left;
   110:         int top;
   111:         int right;
   112:         int bottom;
   113:     } WallpaperStruct;
   114: 
   115:     WallpaperStruct wallpaper;
   116: };
   117: 
   118: //===========================================================================
   119: 
   120: #endif /* __DESKTOP_H */ 
   121: