/*
 ============================================================================
 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 __PLUGINMANAGER_H 
#define __PLUGINMANAGER_H 

#include "Settings.h" 
#include "Menu/Menu.h" 

#include <vector> 
#include <string> 
#include <windows.h> 
#include <commdlg.h> 
#include <wininet.h> 

using namespace std;

typedef int (*beginPluginExFunc)(HINSTANCE, HWND);
typedef int (*beginPluginFunc)(HINSTANCE);
typedef int (*beginSlitPluginFunc)(HINSTANCE, HWND);
typedef int (*endPluginFunc)(HINSTANCE);
typedef LPCSTR (*pluginInfoFunc)(int);

typedef struct
{
        HMODULE hModule;
        char path[MAX_LINE_LENGTH];
        bool EnableDockToSlit;
        bool EnableDockToDesktop;
        bool UpdateAvailable;
} pluginItem;

typedef vector<pluginItem> PluginsVector;

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

class PluginManager
{
public:
        PluginManager(HINSTANCE);
        ~PluginManager();

        void loadPlugin(LPSTR pluginPath);
        bool startPlugin(HMODULE hModule, LPSTR pluginPath, bool EnableDockToSlit, bool EnableDockToDesktop);
        void unloadPlugin(LPSTR pluginPath, int pluginNumber);

        void updatePlugin(LPSTR pluginPath, int pluginNumber, bool forceUpdate);

        void aboutPlugins();
        LPCSTR getPluginInfo(int pluginNumber, int infoParam);
        bool writePluginsRC();
        void loadPluginDialog();

        PluginsVector pluginList;

        bool startupLock;
        char pluginName[MAX_LINE_LENGTH];

//private:
        HINSTANCE hModule;
        beginPluginExFunc beginPluginEx;
        beginPluginFunc beginPlugin;
        beginSlitPluginFunc beginSlitPlugin;
        endPluginFunc endPlugin;
        pluginInfoFunc pluginInfo;
};

void checkForUpdates(void *param);
void periodicCheckForUpdates(void *);

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

#endif /* __PLUGINMANAGER_H */ 





syntax highlighting by

w e b c p p
web c plus plus