/*
 ============================================================================
 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

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

#ifndef __MENUMAKER_H 
#define __MENUMAKER_H 

#include "../BBApi.h" 
#include "../Settings.h" 
#include "../PluginManager.h" 

#include "Menu.h" 
#include "MenuItem.h" 
#include "FolderItem.h" 
#include "CommandItem.h" 
#include "StringItem.h" 
#include "SpecialFolder.h" 
#include "ConfigMenu.h" 
#include "DesktopMenu.h" 
#include "ToolbarMenu.h" 
#include "SystembarMenu.h" 
#include "SlitMenu.h" 
#include "StylesMenu.h" 
#include "ThemesMenu.h" 
#include "PluginMenu.h" 
#include "Painter.h" 

#include <io.h> 
#include <shlwapi.h> 

using namespace std;

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

class MenuMaker
{
public:

        MenuMaker();
        ~MenuMaker();

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

        void Initialize(HINSTANCE hInst);
        void ReadConfig();
        void ParseMenu();
        void ParseFolder(FILE *pMenu, Menu *pRoot);
        bool ParseLine(FILE *pMenu, Menu *pRoot, char *pszLine);

        void AddHeaderItem(Menu* pMenu, LPSTR pszTitle);
        void AddBottomItem(Menu* pMenu);

        Menu *LoadFolder(LPSTR pszTitle, LPSTR pszFolder, int menuType);
        void InsertFolder(Menu *pMenu, LPSTR pszFolder, bool includeSubFolders, bool themesMenu);

        void Show(int index = 0);
        void Hide(int index = 0);

        void ShowRootMenu();
        void ShowDesktopMenu();
        void ShowToolbarMenu();
        void ShowSystembarMenu();
        void ShowSlitMenu();
        void ShowStylesMenu();
        void ShowThemesMenu();

        Painter* MakePainter(DWORD dwColor, DWORD dwGradColor, int nType, bool bInterlaced, int, int, int);

        MenuItem* CreateMenuItem(Menu *pMenu, char* pszCommand, char* pszArgument, char* pszTitle, bool isSelected);

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

        vector<Menu *> m_RootMenus;
        vector<Painter*> m_Painters;

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

        HINSTANCE hInst;

//      #define MAX_RC_STRING 256

        char m_szHotListName[256];

        DWORD m_nGradientTitle;
        DWORD m_nGradientEntry;
        DWORD m_nGradientSelEntry;

        int m_nTitleHeight;
        int m_nSubmenuHeight;
        int m_nBottomHeight;
        int m_nSeparatorHeight;

        COLORREF m_nBorderColor;
        int m_nBorderWidth;

        Menu *m_pRoot;
        Menu *m_pDesktopMenu;
        Menu *m_pToolbarMenu;
        Menu *m_pSystembarMenu;
        Menu *m_pSlitMenu;
        Menu *m_pStylesMenu;
        Menu *m_pThemesMenu;
        Menu *m_pPluginMenu;

        Painter* m_pTitle;
        Painter* m_pEntry;
        Painter* m_pSelEntry;
        Painter* m_pBottom;

        HFONT m_hDefaultFont;
        HFONT m_hEntryFont;
};

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

#endif /* __MENUMAKER_H */ 





syntax highlighting by

w e b c p p
web c plus plus