/*
 ============================================================================
 xoblite -> an alternative shell based on Blackbox for Windows
 Copyright  2002-2005 Karl-Henrik Henriksson [qwilk]
 Copyright  2001-2004 The Blackbox for Windows Development Team
 http://xoblite.net/ - #bb4win on irc.freenode.net
 ============================================================================

  Blackbox for Windows is free software, released under the
  GNU General Public License (GPL version 2 or later), with an extension
  that allows linking of proprietary modules under a controlled interface.
  What this means is that plugins etc. are allowed to be released
  under any license the author wishes. Please note, however, that the
  original Blackbox gradient math code used in Blackbox for Windows
  is available under the BSD license.

  http://www.fsf.org/licenses/gpl.html
  http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface
  http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU General Public License for more details.

  For additional license information, please read the included license.html

 ============================================================================
*/

#pragma warning(disable: 4786) // STL naming warnings 

#ifndef __SYSTEMBAR_H 
#define __SYSTEMBAR_H 

#ifndef _WIN32_IE 
#define _WIN32_IE               0x0500  // Enables all the needed define's in ShellAPI.h
#endif 

#ifndef _WIN32_DCOM 
#define _WIN32_DCOM 
#endif 

#include "BBApi.h" 
#include "BImage.h" 
#include "Desk.h" 
#include "Settings.h" 
#include "Toolbar.h" 
#include "TrayManager.h" 
#include "Menu/MenuMaker.h" 
#include "Desk.h" 
#include "Workspaces.h" 
#include "Slit.h" 

#include <windows.h> 
#include <string> 
#include <shlwapi.h> 
#include <docobj.h>                             // Needed for OLE stuff... 
#include <shlobj.h> 

#ifndef WM_MOUSEWHEEL 
#define WM_MOUSEWHEEL 0x020A 
#endif 
#ifndef GET_WHEEL_DELTA_WPARAM 
#define GET_WHEEL_DELTA_WPARAM(wParam) ((short)HIWORD(wParam)) 
#endif 

#ifndef NIN_BALLOONSHOW 
#define NIN_BALLOONSHOW     (WM_USER + 2) 
#endif 
#ifndef NIN_BALLOONHIDE 
#define NIN_BALLOONHIDE     (WM_USER + 3) 
#endif 
#ifndef NIN_BALLOONTIMEOUT 
#define NIN_BALLOONTIMEOUT  (WM_USER + 4) 
#endif 
#ifndef NIN_BALLOONUSERCLICK 
#define NIN_BALLOONUSERCLICK (WM_USER + 5) 
#endif 

#define SYSTEMBAR_XOBLOON_TIMER 1 

//===========================================================================

typedef struct TaskButton
{
        HWND Window;
        bool Active;
        RECT r;
} TaskButton;

//====================

class Systembar
{
public:
        Systembar(HINSTANCE hInstance, bool DisableTray);
        ~Systembar();

        void Initialize();
        friend LRESULT CALLBACK SystembarWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);

        bool MouseButtonOnTaskbar(HWND hwnd, unsigned int message, WPARAM wParam, LPARAM lParam);

        int DrawSysTray(HDC hdc);
        void DrawTaskbar(HDC hdc, int iconPos, RECT taskbarRect);
        int DrawTaskButtons();
        void DrawSatHueIcon(HDC hdc, HICON icon, int size, RECT r, bool trayIcon, bool activeTask);

        void GetSettings();
        void UpdatePosition();
        void ToggleAlwaysOnTop();
        void ChangeTaskbarMode(int mode);
        void ToggleSysTray();
        void ToggleCurrentOnly();

        void AddWindow(HWND newWindow);
        void RemoveWindow(HWND oldWindow);
        void CleanWindows();
        void MinimizeAllWindows();
        void RestoreAllWindows();
        HWND GetCurrentWindow();
        friend BOOL CALLBACK WinEnumerator(HWND Window, LPARAM Main);

        void SetToolTip(unsigned int tipID, RECT tipRect, char tipText[MAX_LINE_LENGTH]);
        void DeleteToolTip(unsigned int tipID);
        void UpdateToolTipPositions();
        void CreateTooltipsWindow();
        void ToggleTooltips();

        //====================

        HINSTANCE hSystembarInstance;
        HWND hBlackboxWnd; // Blackbox window handle
        HWND hSystembarWnd; // Systembar window handle
        HWND hToolTips;

        bool SysTrayDisabled;

        int ScreenWidth, ScreenHeight;
        int SystembarX, SystembarY, SystembarWidth, SystembarHeight;
        bool SystembarHidden;
        RECT TrayRect;
        RECT ToggleTrayButtonRect;

        bool SystembarPosInProgress;

        BYTE red, green, blue, greyscale;
        COLORREF pixel, hueColor;
        int invsat, invhue;

        HDC cachedBackground;
        bool cachedBackgroundExists;

        HDC cachedTaskButtonActive;
        HDC cachedTaskButtonInactive;
        bool cachedTaskButtonsExist;

        bool saveWidthOnRestart;

        bool DockedToSlit;

        //====================

        #define ICON_SIZE 16
        #define TASKICON_SIZE 14

        HDC MainDC;
        RECT MainRect;

        RECT ThisButton;
        HWND ThisButtonWnd;
        HICON ThisButtonIcon;
        char ThisButtonWindowText[MAX_LINE_LENGTH];

        int iconSize;
        RECT iconRect;

        int TaskWidth, TaskWidthMinusPadding, TaskHeight;

        int NumberOfTasks, WinEnumeratorCount, CurrentOnlyCount;
        TaskButton WindowList[255];
        HWND flashingHwnd;

        bool blockNextMouseClick;
};

//===========================================================================

#endif /* __SYSTEMBAR_H */ 





syntax highlighting by

w e b c p p
web c plus plus