|
From: Emilien K. <cur...@us...> - 2005-05-14 12:16:07
|
Update of /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15322/include/wxDevCenter Modified Files: Application.h Config.h DocView.h FileSystem.h FileSystemStandard.h FileTools.h Frame.h MainFrame.h Manager.h Plugin.h Project.h WorkBar.h setup.h Added Files: Element.h Log Message: Transition to the new feature/plugin system based on the Element class. Index: Project.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/Project.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Project.h 15 Apr 2005 15:41:36 -0000 1.6 --- Project.h 14 May 2005 12:15:55 -0000 1.7 *************** *** 46,52 **** * @warning Les classes de projets doivent impérativement être RTTI-dynamiques et leurs constructeurs ne peuvent prendre aucun paramètre. */ ! class WXDC_DLL_BASE Project : public wxEvtHandler, public InitializableInterface { ! DECLARE_DYNAMIC_CLASS(Project); // Données membres : protected: --- 46,52 ---- * @warning Les classes de projets doivent impérativement être RTTI-dynamiques et leurs constructeurs ne peuvent prendre aucun paramètre. */ ! class WXDC_DLL_BASE Project : public Element, public wxEvtHandler { ! DECLARE_DYNAMIC_CLASS(Project) // Données membres : protected: *************** *** 112,117 **** * - Les infos RTTI de la classe du projet. */ ! class WXDC_DLL_BASE ProjectTemplate : public ObjectTemplate<Project> { protected: /** Chemin relatif de son icone.*/ --- 112,118 ---- * - Les infos RTTI de la classe du projet. */ ! class WXDC_DLL_BASE ProjectTemplate : public ObjectTemplate<Project>, public wxObject { + DECLARE_DYNAMIC_CLASS(ProjectTemplate) protected: /** Chemin relatif de son icone.*/ *************** *** 158,162 **** /** Crée un objet projet. * Ne fait que allouer la mémoire et appeler le constructeur par défaut.*/ ! Project* CreateProject(){return CreateObject();} }; --- 159,163 ---- /** Crée un objet projet. * Ne fait que allouer la mémoire et appeler le constructeur par défaut.*/ ! Project* CreateProject(){return (Project*) CreateObject();} }; Index: Config.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/Config.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Config.h 7 Mar 2005 15:23:02 -0000 1.7 --- Config.h 14 May 2005 12:15:54 -0000 1.8 *************** *** 149,152 **** --- 149,156 ---- */ virtual wxString GetDataPath()=0; + /** Retourne le chemin racine des fonctionnalités. + * @return Chemin racine des fonctionnalités. + */ + virtual wxString GetFeaturesPath()=0; /** Retourne le chemin racine des pluggins. * @return Chemin racine des plugins. *************** *** 199,202 **** --- 203,207 ---- #define WXDC_CONF_KEYNAME_INSTALLDIR wxT("InstallDir") #define WXDC_CONF_KEYNAME_DATADIR wxT("DataDir") + #define WXDC_CONF_KEYNAME_FEATURESDIR wxT("FeatureDir") #define WXDC_CONF_KEYNAME_PLUGINSDIR wxT("PluginDir") #define WXDC_CONF_KEYNAME_CONFDIR wxT("ConfDir") Index: MainFrame.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/MainFrame.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MainFrame.h 4 Apr 2005 08:11:21 -0000 1.10 --- MainFrame.h 14 May 2005 12:15:54 -0000 1.11 *************** *** 178,181 **** --- 178,183 ---- /** @} */ + /** Force la mise à jour de la fenetre via les wxUpdateUIEvent.*/ + virtual void UpdateWindowUI(long flags = wxUPDATE_UI_NONE); }; Index: setup.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/setup.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** setup.h 18 Apr 2005 12:42:18 -0000 1.4 --- setup.h 14 May 2005 12:15:55 -0000 1.5 *************** *** 48,92 **** - #define WXUSINGDLL - - - #ifdef _WINDOWS ! #ifdef WXDEBUG ! /** Si mode debug, inclure les libs debug.*/ ! #pragma comment(lib, "wxbase26d.lib") ! #pragma comment(lib, "wxbase26d_net.lib") ! #pragma comment(lib, "wxmsw26d_core.lib") ! #pragma comment(lib, "wxmsw26d_adv.lib") ! ! #pragma comment(lib, "wxzlibd.lib") ! #pragma comment(lib, "wxregexd.lib") - #pragma comment(lib, "wxpngd.lib") - #pragma comment(lib, "wxjpegd.lib") - #pragma comment(lib, "wxtiffd.lib") - #pragma comment(lib, "wxmsw26d_stc.lib") - #pragma comment(lib, "wxmsw26d_fl.lib") - #else - /** Sinon mode debug, inclure les libs release.*/ - #pragma comment(lib, "wxbase26.lib") - #pragma comment(lib, "wxbase26_net.lib") - #pragma comment(lib, "wxmsw26_core.lib") - #pragma comment(lib, "wxmsw26_adv.lib") - #pragma comment(lib, "wxzlib.lib") - #pragma comment(lib, "wxregex.lib") ! #pragma comment(lib, "wxpng.lib") ! #pragma comment(lib, "wxjpeg.lib") ! #pragma comment(lib, "wxtiff.lib") ! #pragma comment(lib, "wxmsw26_stc.lib") ! #pragma comment(lib, "wxmsw26_fl.lib") - #endif - #endif #endif --- 48,86 ---- ! #if defined(__WINDOWS__) ! #pragma warning(disable : 4005 4996) ! #endif ! /** @name Paliatif au manque de definitions de macros de wxWidgets. ! * @{ */ ! // Chtite déclaration supplémentaire (comme wxDEPRECATED) pour les bouts de code de débugage. ! //#ifdef WXDEBUG ! #define wxDEBUG_CODE(code) code ! //#else ! //#define wxDEBUG_CODE(code) ! //#endif ! #define wxIMPLEMENT_CLASS_COMMON0(name, func) \ ! wxClassInfo name::ms_classInfo(wxT(#name), \ ! NULL, NULL, \ ! (int) sizeof(name), \ ! (wxObjectConstructorFn) func); \ ! \ ! wxClassInfo *name::GetClassInfo() const \ ! { return &name::ms_classInfo; } ! #define IMPLEMENT_DYNAMIC_CLASS0(name) \ ! wxIMPLEMENT_CLASS_COMMON0(name, name::wxCreateObject) \ ! wxObject* name::wxCreateObject() \ ! { return new name; } ! #define IMPLEMENT_ABSTRACT_CLASS0(name) \ ! wxIMPLEMENT_CLASS_COMMON0(name, NULL) ! #define IMPLEMENT_CLASS0 IMPLEMENT_ABSTRACT_CLASS0 ! /** @} */ #endif Index: WorkBar.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/WorkBar.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** WorkBar.h 15 Apr 2005 15:44:33 -0000 1.5 --- WorkBar.h 14 May 2005 12:15:55 -0000 1.6 *************** *** 36,40 **** * Dérivent de wxPanel pour faciliter l'intégration. */ ! class WXDC_DLL_BASE WorkBar : public wxPanel, public InitializableInterface { friend class WorkBarManager; --- 36,40 ---- * Dérivent de wxPanel pour faciliter l'intégration. */ ! class WXDC_DLL_BASE WorkBar : public wxPanel, virtual public Element { friend class WorkBarManager; *************** *** 50,53 **** --- 50,54 ---- /** Nom de la workbar.*/ wxString m_strName; + public: WorkBar(void); *************** *** 59,63 **** wxString GetName()const{return m_strName;} - /** Fonction de création effective de la fenetre. * @param Adresse de la fenetre parente.*/ --- 60,63 ---- *************** *** 65,71 **** }; /** Patron de workbar.*/ ! class WXDC_DLL_BASE WorkBarTemplate : public ObjectTemplate<WorkBar> { private: /** Donnée complémentaire pour spécialiser la WorkBar.*/ --- 65,73 ---- }; + /** Patron de workbar.*/ ! class WXDC_DLL_BASE WorkBarTemplate : public ObjectTemplate<WorkBar>, public wxObject { + DECLARE_CLASS(WorkBarTemplate) private: /** Donnée complémentaire pour spécialiser la WorkBar.*/ *************** *** 75,78 **** --- 77,81 ---- WorkBarTemplate(wxClassInfo* pClassInfo, wxString strName, wxString strDescript, wxObject* pExtraObj): ObjectTemplate<WorkBar>(pClassInfo, strName, strDescript), + wxObject(), m_pExtraObject(pExtraObj) {} *************** *** 80,83 **** --- 83,114 ---- /** Accesseur sur la donnée complémentaire.*/ wxObject* GetExtraObject(){return m_pExtraObject;} + + /** @name Surcharge des fonctions d'élément. + * @{ */ + virtual bool Initialize(); + virtual void Finalize(); + virtual bool Destroy(bool bForce=true); + virtual bool CanDestroy()const; + /** @} */ + }; + + /** Type de workbar. + * Patron autoenregistrable de workbar.*/ + class WXDC_DLL_BASE WorkBarType : public WorkBarTemplate + { + DECLARE_CLASS(WorkBarType) + public: + /** Constructeur.*/ + WorkBarType(wxClassInfo* pClassInfo, wxString strName, wxString strDescript=wxT(""), wxObject* pExtraObj=NULL): + WorkBarTemplate(pClassInfo, strName, strDescript, pExtraObj) + {} + + /** @name Surcharge des fonctions d'élément. + * @{ */ + virtual bool Initialize(); + virtual void Finalize(); + virtual bool Destroy(bool bForce=true); + virtual bool CanDestroy()const; + /** @} */ }; *************** *** 118,121 **** --- 149,160 ---- */ void RegisterWorkBar(wxClassInfo* pClassInfo, wxString strName, wxString strDescript, ::wxObject* pExtraObj=NULL); + /** Enregistre un type de workbar. + * @param pTempl Adresse d'un patron de workbar. + */ + void RegisterWorkBar(WorkBarTemplate* pTempl); + /** Désenregistre un type de workbar. + * @param pTempl Adresse d'un patron de workbar. + */ + void UnegisterWorkBar(WorkBarTemplate* pTempl); /** Désenregistre un type de barre. * @param pClassInfo Info RTTI de la barre à désenregistrer. Index: Frame.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/Frame.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Frame.h 4 Apr 2005 08:11:21 -0000 1.8 --- Frame.h 14 May 2005 12:15:54 -0000 1.9 *************** *** 35,38 **** --- 35,69 ---- { + // Definition des identifiants des menus standards : + #define IDM_FILE_NEW wxID_NEW + #define IDM_FILE_OPEN wxID_OPEN + #define IDM_FILE_SAVE wxID_SAVE + #define IDM_FILE_SAVEAS wxID_SAVEAS + #define IDM_FILE_CLOSE wxID_CLOSE + #define IDM_FILE_CLOSEALL 0x0005 + + #define IDM_PROJECT_OPEN 0x0100 + #define IDM_PROJECT_NEW 0x0101 + #define IDM_PROJECT_CLOSE 0x0102 + + #define IDM_WINDOW_CLONE 0x0200 + #define IDM_WINDOW_NEW 0x0201 + #define IDM_WINDOW_CLOSE 0x0202 + #define IDM_WINDOW_CLOSEALL 0x0203 + #define IDM_WINDOW_PREV 0x0204 + #define IDM_WINDOW_NEXT 0x0205 + #define IDM_WINDOW_FIRST 0x0210 + #define IDM_WINDOW_LAST 0x021F + + #define IDM_WINDOW_WORKBAR 0x0300 + #define IDM_WINDOW_WORKBAR_FIRST 0x0301 + #define IDM_WINDOW_WORKBAR_LAST 0x03FF + + #define IDM_HELP_ABOUT 0x0400 + #define IDM_HELP_INDEX 0x0401 + #define IDM_HELP_CONTENT 0x0402 + + + class WXDC_DLL_BASE TopFrame; class WXDC_DLL_BASE ViewFrame; *************** *** 180,183 **** --- 211,220 ---- virtual bool RemoveWorkBar(WorkBar* WXUNUSED(pWorkBar)){return false;} + /** Affiche/Cache une workbar. + * @param pWorkBar Adresse de la workbar à afficher. + * @param bShow Vrai si afficher et faux si cacher. + * @return True si l'action a été effectuée correctement.*/ + virtual bool ShowWorkBar(WorkBar* WXUNUSED(pWorkBar), bool WXUNUSED(bShow)){return false;} + /** Surcharge du processus de destruction. * Utilisé pour vider le cadre de ses WorkBar et la désenregistrer du WorkBarManager.*/ Index: Plugin.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/Plugin.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Plugin.h 7 Mar 2005 15:23:02 -0000 1.2 --- Plugin.h 14 May 2005 12:15:55 -0000 1.3 *************** *** 32,124 **** #include <wx/dynarray.h> namespace wxDevCenter { ! /** Classe de base de plugin. ! * A utiliser tel quel ou à dériver pour spécialiser le plugin. */ class WXDC_DLL_BASE Plugin : public wxObject { protected: wxString m_strName; wxString m_strDescript; public: ! Plugin(wxString strName=WXDC_PLUGIN_UNKOW_NAME, wxString strDescript=WXDC_PLUGIN_UNKOW_NAME); ! virtual ~Plugin(void); - /** @name Propriétés générales du plugin. - * Ces propritétés doivent être disponibles avant l'initialisation et après la finalisation du plugin. - * @{ */ - /** Retourne le nom du plugin. - * @return Nom du plugin.*/ - virtual wxString GetName()const; - /** Retourne la description du plugin. - * @return Description du plugin.*/ - virtual wxString GetDescription()const; /** Retourne une image représentant le logo du plugin. * @return Logo du plugin.*/ virtual wxBitmap GetLogo(wxSize sz); ! /** @} */ ! ! /** @name Initialisation/finalisation. ! * @{ */ ! /** Initialisation du plugin. ! * Fonction appelé au moment du chargement du plugin.*/ ! virtual void InitPlugin(); ! /** Finalisalisation du plugin. ! * Fonction appelé au moment du déchargement du plugin.*/ ! virtual void FinalPlugin(); ! /** @} */ ! ! /** Retourne un panneau "A propos de" du plugin. ! * @param pParent Adresse dela fenetre parent. ! * @param id Identifiant de filiation. ! * @return Adresse du panneau (peut etre nul si pas de panneau). ! */ ! virtual wxPanel* CreateAboutPanel(wxWindow* pParent, wxWindowID id); }; ! WX_DEFINE_USER_EXPORTED_ARRAY(Plugin*, PluginArray, class WXDC_DLL_BASE); ! /** Classe de gestion des plugins. */ ! class WXDC_DLL_BASE PluginManager : protected PluginArray { public: ! PluginManager(void); ! virtual ~PluginManager(void); ! /** Ajoute un plugin. ! * @param pPlugin Adresse du plugin à ajouter. ! */ ! void Add(Plugin* pPlugin); ! /** Compte le nombre de plugins. ! * @return Le nombre de plugins. */ ! unsigned int GetCount()const{return PluginArray::GetCount();} ! /** Retourne un plugin. ! * @param nIndex Indice du plugin. ! * @return Référence vers un plugin. */ ! Plugin& GetPlugin(unsigned int nIndex){return *Item(nIndex);} ! /** Retourne un plugin. ! * @param nIndex Indice du plugin. ! * @return Référence vers un plugin. */ ! Plugin& operator[](unsigned int nIndex){return *Item(nIndex);} - /** Initialise les plugins. */ - void InitPlugins(); - /** Finalise les plugins. */ - void FinalPlugins(); ! /** Dump des plugins.*/ ! void Dump(); }; ! } #endif --- 32,594 ---- #include <wx/dynarray.h> + #include <wx/dynlib.h> + #include <wx/xml/xml.h> + + #include <wxDevCenter/Element.h> + #include <wxDevCenter/Manager.h> namespace wxDevCenter { ! class WXDC_DLL_BASE BaseElementManager : public ObjectManager<Element> ! { ! }; ! ! ! namespace plugins ! { ! ! ! // Prédéclaration des classes : ! struct WXDC_DLL_BASE Version; ! class WXDC_DLL_BASE ModuleRefData; ! class WXDC_DLL_BASE Module; ! class WXDC_DLL_BASE Plugin; ! class WXDC_DLL_BASE Feature; ! class WXDC_DLL_BASE PluginLoader; ! ! class WXDC_DLL_BASE FeatureDescriptionFile; ! class WXDC_DLL_BASE PluginDescriptionFile; ! ! typedef ObjectManager<PluginItem> PluginItemManager; ! ! ! /** Structure représentant une version.*/ ! struct WXDC_DLL_BASE Version ! { ! unsigned short major; ! short minor; ! long patch; ! long release; ! ! bool operator==(const Version& v)const{return (major==v.major) && (minor==v.minor) && (patch==v.patch) && (release==v.release);} ! bool operator!=(const Version& v)const{return (major!=v.major) || (minor!=v.minor) || (patch!=v.patch) || (release!=v.release);} ! bool operator<(const Version& v)const ! { ! return (major<v.major) || ! ((major==v.major)&&(minor<v.minor)) || ! ((major==v.major)&&(minor==v.minor)&&(patch<v.patch)) || ! ((major==v.major)&&(minor==v.minor)&&(patch==v.patch)&&(release<v.release)); ! } ! bool operator<=(const Version& v)const ! { ! return (major<=v.major) || ! ((major==v.major)&&(minor<=v.minor)) || ! ((major==v.major)&&(minor==v.minor)&&(patch<=v.patch)) || ! ((major==v.major)&&(minor==v.minor)&&(patch==v.patch)&&(release<=v.release)); ! } ! bool operator>(const Version& v)const ! { ! return (major>v.major) || ! ((major==v.major)&&(minor>v.minor)) || ! ((major==v.major)&&(minor==v.minor)&&(patch>v.patch)) || ! ((major==v.major)&&(minor==v.minor)&&(patch==v.patch)&&(release>v.release)); ! } ! bool operator>=(const Version& v)const ! { ! return (major>=v.major) || ! ((major==v.major)&&(minor>=v.minor)) || ! ((major==v.major)&&(minor==v.minor)&&(patch>=v.patch)) || ! ((major==v.major)&&(minor==v.minor)&&(patch==v.patch)&&(release>=v.release)); ! } ! ! Version& operator=(wxString str) ! { ! wxString s; ! long l; ! s = str.BeforeFirst(wxT('.')); ! str = str.AfterFirst(wxT('.')); ! l = 0; s.ToULong((unsigned long*)&l); major = (unsigned short) l; ! s = str.BeforeFirst(wxT('.')); ! str = str.AfterFirst(wxT('.')); ! l = 0; s.ToLong(&l); minor = (short)l; ! s = str.BeforeFirst(wxT('.')); ! str = str.AfterFirst(wxT('.')); ! l = 0; s.ToLong(&l); patch = l; ! l = 0; str.ToLong(&l); release = l; ! return *this; ! } ! ! wxString operator()(wxString) ! { ! return wxString::Format("%hu.%hd.%d.%d", major, minor, patch, release); ! } ! ! wxString ToString()const ! { ! return wxString::Format("%hu.%hd.%d.%d", major, minor, patch, release); ! } ! }; ! ! ! /** Descriptif de module. ! * Objet référençable des modules.*/ ! class WXDC_DLL_BASE ModuleRefData : public wxObjectRefData ! { ! friend class Module; ! protected: ! /** Flag d'état du module.*/ ! unsigned short m_flagState; ! ! /** Chemin du module.*/ ! wxString m_strPath; ! ! /** Objet wx accédant à la dll/so.*/ ! wxDynamicLibrary m_DLL; ! ! /** Gestionnaire des éléments de plugins enregistrés.*/ ! BaseElementManager m_Elements; ! public: ! ModuleRefData(); ! virtual ~ModuleRefData(); ! ! /** Débugage : Dump du contenu. */ ! wxDEBUG_CODE(wxString Dump();) ! ! /** Charge le module. ! * @param strPath Chemin du module. ! * @return Vrai si chargement réussi.*/ ! bool Load(wxString strPath); ! /** Teste si le module est chargé. ! * @return Vrai si le module est chargé.*/ ! bool IsLoaded()const{return m_DLL.IsLoaded();} ! /** Teste si le module est initialisé. ! * @return Vrai si le module est initialisé.*/ ! bool IsInitialized()const{return (m_flagState&Initialized)!=0;} ! ! /** Décharge le module.*/ ! bool Unload(); ! /** Initialise le contenu du module.*/ ! bool Initialize(); ! /** Finalise le contenu du module.*/ ! bool Finalize(); ! ! /** Drapeaux d'états du module.*/ ! enum ModuleState ! { ! Initial = 0x0000, ! Registered = 0x0001, ! Loaded = 0x0002, ! Initialized = 0x0004, ! Error = 0xFFFF ! }; ! ! }; ! ! /** Classe de description d'un module. ! * Un module est une dll/so qui contient des objets enregistrables. ! */ ! class WXDC_DLL_BASE Module : public wxObject ! { ! friend class Plugin; ! DECLARE_CLASS(Module) ! protected: ! /** Accesseur sur la référence de module.*/ ! ModuleRefData* GetModuleRef()const {return (ModuleRefData*) GetRefData();} ! // create a new m_refData ! virtual wxObjectRefData *CreateRefData() const{return new ModuleRefData;} ! ! public: ! /** Constructeur.*/ ! Module(); ! /** Constructeur.*/ ! Module(const Module& module){Ref(module);} ! ! /** Débugage : Dump du contenu. */ ! wxDEBUG_CODE(wxString Dump();) ! ! /** Teste si le module est chargé.*/ ! bool IsLoaded()const; ! /** Teste si le module est initialisé.*/ ! bool IsInitialized()const; ! ! /** Charge le module et enregistre son contenu. ! * @param strPath Chemin absolu du module à charger.*/ ! bool Load(wxString strPath); ! /** Décharge le module.*/ ! bool Unload(); ! /** Initialise le contenu du module.*/ ! bool Initialize(); ! /** Finalise le contenu du module.*/ ! bool Finalize(); ! ! ! }; ! ! ! /** Classe de description d'un plugin. ! * Un plugin est un regroupement logique de modules (dll/so). */ class WXDC_DLL_BASE Plugin : public wxObject { + friend class Feature; + DECLARE_CLASS(Plugin) + public: + enum PluginStatusFlag + { + Initial = 0x0000, + PreLoaded = 0x0001, + Loaded = 0x0002, + Initialized = 0x0004, + Partial = 0x0010, + ErrBlocked = 0x0100, + ErrDescript = 0x0200, + WarningMask = 0x00F0, + ErrMask = 0x0F00 + }; protected: + /** Adresse du PluginLoader auquel la fonctionnalité est attachée.*/ + PluginLoader* m_pLoader; + /** Status du plugin.*/ + unsigned short m_Status; + + /** Nom de la fonctionnalité.*/ wxString m_strName; + /** Description de la fonctionnalité.*/ wxString m_strDescript; + /** Version de la fonctionnalité.*/ + Version m_Version; + /** Auteur du plugin.*/ + wxString m_strAuthor; + /** Licence du plugin.*/ + wxString m_strLicence; + /** Notes du plugin.*/ + wxString m_strNotes; + /** Url du plugin.*/ + wxString m_strURL; + /** Liste des modules du plugin.*/ + wxArrayString m_arrstrModules; + /** Liste des plugins dépendants.*/ + wxArrayString m_arrstrPlugins; public: ! /** Constructeur.*/ ! Plugin(); ! ! /** Débugage : Dump du contenu. */ ! wxDEBUG_CODE(wxString Dump();) ! ! /** Attache le chargeur de plugin.*/ ! void SetPluginLoader(PluginLoader* pLoader){m_pLoader = pLoader;} ! ! /** Teste si le plugin est chargé.*/ ! bool IsLoaded()const; ! /** Teste si le plugin est initialisé. ! * @return Vrai si le plugin est initialisé.*/ ! bool IsInitialized()const{return (m_Status&Initialized)!=0;} ! ! /** Acces sur le nom.*/ ! wxString GetName()const{return m_strName;} ! /** Acces sur la description.*/ ! wxString GetDescript()const{return m_strDescript;} ! /** Acces sur la version.*/ ! Version GetVersion()const{return m_Version;} ! ! /** Teste si le plugin peut être chargé.*/ ! bool CheckValidity(); ! /** Précharge la description du plugin. ! * @param strName Nom du plugin ! * @return Faux si le plugin est mal décrit.*/ ! bool PreLoad(wxString strName); ! /** Charge le plugin. ! * @param strName Nom du plugin.*/ ! bool Load(wxString strName); ! /** Décharge le plugin.*/ ! bool Unload(); ! /** Initialise le plugin.*/ ! bool Initialize(); ! /** Finalise le plugin.*/ ! bool Finalize(); ! }; ! ! ! /** Classe de description des fonctionnalités. ! * Une fonctionnalité est un regroupement de plugins. ! */ ! class WXDC_DLL_BASE Feature : public wxObject ! { ! DECLARE_CLASS(Feature) ! public: ! enum FeatureStatusFlag ! { ! Initial = 0x0000, ! PreLoaded = 0x0001, ! Loaded = 0x0002, ! Initialized = 0x0004, ! Partial = 0x0010, ! ErrBlocked = 0x0100, ! ErrDescript = 0x0200, ! WarningMask = 0x00F0, ! ErrFlag = 0x0F00 ! }; ! protected: ! /** Adresse du PluginLoader auquel la fonctionnalité est attachée.*/ ! PluginLoader* m_pLoader; ! /** Etat de la fonctionnalité.*/ ! unsigned short m_Status; ! ! /** Nom de la fonctionnalité.*/ ! wxString m_strName; ! /** Description de la fonctionnalité.*/ ! wxString m_strDescript; ! /** Version de la fonctionnalité.*/ ! Version m_Version; ! /** Auteur de la fonctionnalité.*/ ! wxString m_strAuthor; ! /** Licence de la fonctionnalité.*/ ! wxString m_strLicence; ! /** Notes de la fonctionnalité.*/ ! wxString m_strNotes; ! /** URL de la fonctionnalité.*/ ! wxString m_strURL; ! ! /** Liste des fonctionnalité dépendante.*/ ! wxArrayString m_arrstrFeatures; ! /** Liste des plugins attachés.*/ ! wxArrayString m_arrstrPlugins; ! ! public: ! /** Constructeur.*/ ! Feature(); ! ! /** Débugage : Dump du contenu. */ ! wxDEBUG_CODE(wxString Dump();) ! ! /** Attache le chargeur de plugin.*/ ! void SetPluginLoader(PluginLoader* pLoader){m_pLoader = pLoader;} ! ! /** Teste si la fonctionnalité peut être chargé.*/ ! bool CheckValidity(); ! /** Précharge la description de la fonctionnalité. ! * @param strName Nom de la fonctionnalité. ! * @return Faux si la fonctionnalité est mal décrite.*/ ! bool PreLoad(wxString strName); ! /** Teste si la fonctionnalité est chargée.*/ ! bool IsLoaded()const; ! /** Teste si le plugin est initialisé. ! * @return Vrai si le plugin est initialisé.*/ ! bool IsInitialized()const{return (m_Status&Initialized)!=0;} ! /** Charge la fonctionnalité. ! * @param strName Nom de la fonctionnalité.*/ ! bool Load(wxString strName); ! /** Décharge la fonctionnalité.*/ ! bool Unload(); ! /** Initialise la fonctionnalité.*/ ! bool Initialize(); ! /** Finalise la fonctionnalité.*/ ! bool Finalize(); ! ! /** Acces sur le nom.*/ ! wxString GetName()const{return m_strName;} ! /** Acces sur la description.*/ ! wxString GetDescript()const{return m_strDescript;} ! /** Acces sur la version.*/ ! Version GetVersion()const{return m_Version;} /** Retourne une image représentant le logo du plugin. * @return Logo du plugin.*/ virtual wxBitmap GetLogo(wxSize sz); ! /** Retourne les crédits de la fonctionnalité.*/ ! virtual wxString GetCredits()const; ! /** Retourne la licence de la fonctionnalité.*/ ! virtual wxString GetLicence()const; }; ! WX_DECLARE_STRING_HASH_MAP_WITH_DECL(Feature, FeatureMap, class WXDC_DLL_BASE); ! WX_DECLARE_STRING_HASH_MAP_WITH_DECL(Plugin, PluginMap, class WXDC_DLL_BASE); ! WX_DECLARE_STRING_HASH_MAP_WITH_DECL(Module, ModuleMap, class WXDC_DLL_BASE); ! ! /** Chargeur de plugins avec prise en charge des fonctionnalités. */ ! class WXDC_DLL_BASE PluginLoader : public wxObject { + DECLARE_CLASS(PluginLoader) + protected: + FeatureMap m_FeatureMap; /**> Fonctionnalité indéxé par son nom.*/ + PluginMap m_PluginMap; /**> Plugin indexé par son nom.*/ + ModuleMap m_ModuleMap; /**> Module indexé par son chemin.*/ + public: ! /** Constructeur.*/ ! PluginLoader(); ! /** Charge tous les plugins.*/ ! bool Load(); ! /** Charge un module à l'adresse spécifiée. ! * @param strPath Adrese du module. ! * @return Adresse du descripteur de module associé si chargé et NULL sinon..*/ ! Module* LoadModule(wxString strPath); ! ! /** Précharge la description des fonctionnalités et des plugins.*/ ! void PreLoadDescription(); ! ! /** Débugage : Dump du contenu. */ ! wxDEBUG_CODE(wxString Dump();) ! ! ! /** Précharge la description d'une fonctionnalité. ! * Le fichier "feature.xml" est parsé et analysé. ! * @param strName Nom de la fonctionnalité. ! * @return Adresse du descripteur de fonctionnalité si chargé, NULL sinon.*/ ! Feature* PreLoadFeature(wxString strName); ! ! /** Précharge la description d'un plugin. ! * Le fichier "plugin.xml" est parsé et analysé. ! * @param strName Nom du plugin. ! * @return Adrese du descripteur des plugins si chargé, NULL sinon.*/ ! Plugin* PreLoadPlugin(wxString strName); ! ! /** Charge un plugin ainsi que toutes ses dépendances. ! * Le plugin est recherché uniquement dans le répertoire des plugins. ! * @param strName Nom du plugin. ! * @return Adrese du descripteur des plugins si chargé, NULL sinon.*/ ! Plugin* LoadPlugin(wxString strName); ! ! /** Charge une fonctionnalité. ! * La fonctionnalité est recherchée uniquement dans le répertoire des fonctionnalité. ! * @param strName Nom de la fonctionnalité. ! * @return Adresse du descripteur de fonctionnalité si chargé, NULL sinon.*/ ! Feature* LoadFeature(wxString strName); ! ! /** Initialise un plugin ainsi que toutes ses dépendances. ! * @param strName Nom du plugin. ! * @return Vrai si le plugin est correctement initialisé. */ ! bool InitializePlugin(wxString strName); ! /** Initialise une fonctionnalité. ! * @param strName Nom de la fonctionnalité. ! * @return Vrai si la fonctionnalité est correctement initialisé. ! */ ! bool InitializeFeature(wxString strName); ! /** Initialise un module. ! * @param strName Nom du module. ! * @return Vrai si le module est correctement initialisé. ! */ ! bool InitializeModule(wxString strName); ! /** Initialise le contenu chargé. ! * Tente d'initialiser le contenu chargé avec succes en prenant en compte les dépendances. */ ! void Initialize(); ! /** Finalise le contenu chargé. ! * Finalise le contenu chargé en prenant en compte les dépendances. */ ! void Finalize(); ! }; ! class WXDC_DLL_BASE FeatureDescriptionFile : public wxObject ! { ! protected: ! wxXmlDocument m_Doc; ! bool m_bOk; ! wxString m_strIdent, ! m_strName, ! m_strDescript, ! m_strVersion, ! m_strAuthor, ! m_strLicence, ! m_strNotes, ! m_strURL; ! wxArrayString m_arrstrFeatures, m_arrstrPlugins; ! public: ! /** Constructeur. ! * @param strPath Chemin du fichier à lire.*/ ! FeatureDescriptionFile(wxString strPath); ! ! /** Destructeur.*/ ! ~FeatureDescriptionFile(); ! ! /** Parse le fichier xml.*/ ! void Parse(); ! ! /** Teste si le fichier de description est valide.*/ ! bool IsValid()const{return m_bOk;} ! ! /** Retourne l'identifiant de la fonctionnalité.*/ ! wxString GetIdent(){return m_strIdent;} ! /** Retourne le nom de la fonctionnalité.*/ ! wxString GetName(){return m_strName;} ! /** Retourne la description de la fonctionnalité.*/ ! wxString GetDescript(){return m_strDescript;} ! /** Retourne la version de la fonctionnalité.*/ ! wxString GetVersion(){return m_strVersion;} ! /** Retourne l'auteur de la fonctionnalité.*/ ! wxString GetAuthor(){return m_strAuthor;} ! /** Retourne la licence d'utilisation de la fonctionnalité.*/ ! wxString GetLicence(){return m_strLicence;} ! /** Retourne les notes à propos de la fonctionnalité.*/ ! wxString GetNotes(){return m_strNotes;} ! /** Retourne l'URL de la fonctionnalité.*/ ! wxString GetURL(){return m_strURL;} ! /** Remplit une liste de nom des fonctionnalités dépendantes.*/ ! void FillDependantFeatureArray(wxArrayString& array); ! /** Remplit une liste de nom des plugins dépendants.*/ ! void FillDependantPluginArray(wxArrayString& array); }; ! class WXDC_DLL_BASE PluginDescriptionFile : public wxObject ! { ! protected: ! wxXmlDocument m_Doc; ! bool m_bOk; ! wxString m_strIdent, ! m_strName, ! m_strDescript, ! m_strVersion, ! m_strAuthor, ! m_strLicence, ! m_strNotes, ! m_strURL; ! wxArrayString m_arrstrModules, m_arrstrPlugins; ! public: ! /** Constructeur. ! * @param strPath Chemin du fichier à lire.*/ ! PluginDescriptionFile(wxString strPath); ! ! /** Destructeur.*/ ! ~PluginDescriptionFile(); ! ! /** Parse le fichier xml.*/ ! void Parse(); ! ! /** Teste si le fichier de description est valide.*/ ! bool IsValid()const{return m_bOk;} ! ! /** Retourne l'identifiant du plugin.*/ ! wxString GetIdent(){return m_strIdent;} ! /** Retourne le nom du plugin.*/ ! wxString GetName(){return m_strName;} ! /** Retourne la description du plugin.*/ ! wxString GetDescript(){return m_strDescript;} ! /** Retourne la version du plugin.*/ ! wxString GetVersion(){return m_strVersion;} ! /** Retourne l'auteur du plugin.*/ ! wxString GetAuthor(){return m_strAuthor;} ! /** Retourne la licence d'utilisation du plugin.*/ ! wxString GetLicence(){return m_strLicence;} ! /** Retourne les notes à propos du plugin.*/ ! wxString GetNotes(){return m_strNotes;} ! /** Retourne l'URL du plugin.*/ ! wxString GetURL(){return m_strURL;} ! /** Remplit une liste de nom des plugins dépendants.*/ ! void FillDependantPluginArray(wxArrayString& array); ! /** Remplit une liste des chemins relatifs des modules à charger.*/ ! void FillModuleArray(wxArrayString& array); ! }; ! ! ! }} #endif Index: DocView.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/DocView.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** DocView.h 15 Apr 2005 15:41:35 -0000 1.14 --- DocView.h 14 May 2005 12:15:54 -0000 1.15 *************** *** 62,65 **** --- 62,67 ---- #include <wxDevCenter/Frame.h> + #include <wxDevCenter/Plugin.h> + namespace wxDevCenter { *************** *** 104,108 **** * Classe interface de vue pour la représentation visuelle des données des documents. */ ! class WXDC_DLL_BASE View : public wxPanel, public InitializableInterface { friend class Application; --- 106,110 ---- * Classe interface de vue pour la représentation visuelle des données des documents. */ ! class WXDC_DLL_BASE View : public wxPanel, virtual public Element { friend class Application; *************** *** 191,195 **** * Classe Interface de document à dériver pour créer des documents spécifiques. */ ! class WXDC_DLL_BASE Document : public wxEvtHandler, public InitializableInterface { friend class DocManager; --- 193,197 ---- * Classe Interface de document à dériver pour créer des documents spécifiques. */ ! class WXDC_DLL_BASE Document : public Element, public wxEvtHandler { friend class DocManager; *************** *** 197,201 **** friend class Application; /** Déclaration de classe dynamique. Déclare la classe comme pouvant être crée dynamiquement depuis ses infos RTTI de caractère.*/ ! DECLARE_DYNAMIC_CLASS(wxDevCenter::Document); /** Déclaration de la table d'interception des évènements.*/ DECLARE_EVENT_TABLE() --- 199,203 ---- friend class Application; /** Déclaration de classe dynamique. Déclare la classe comme pouvant être crée dynamiquement depuis ses infos RTTI de caractère.*/ ! DECLARE_DYNAMIC_CLASS(Document) /** Déclaration de la table d'interception des évènements.*/ DECLARE_EVENT_TABLE() *************** *** 490,493 **** --- 492,496 ---- friend class Application; friend class DocManager; + DECLARE_CLASS(DocTemplate) private: /** Gestionnaire de patron de vues.*/ *************** *** 506,509 **** --- 509,521 ---- ~DocTemplate(); + /** @name Fonctions d'interface de PluginItem. + * @{ */ + virtual bool Initialize(); + virtual void Finalize(); + virtual bool Destroy(bool bForce=true); + virtual bool CanDestroy()const; + /** @ */ + + /** @name Gestion des patrons de vues. * @{ */ *************** *** 558,562 **** private: /** Gestionnaire des vues.*/ ! InitializableObjectManager<View> m_ViewManager; protected: /** Fenêtre conteneur par défaut des vues.*/ --- 570,574 ---- private: /** Gestionnaire des vues.*/ ! ElementManager<View> m_ViewManager; protected: /** Fenêtre conteneur par défaut des vues.*/ *************** *** 708,712 **** { /** Déclaration de classe dynamique. Déclare la classe comme pouvant être crée dynamiquement depuis ses infos RTTI de caractère.*/ ! DECLARE_DYNAMIC_CLASS(wxDevCenter::ActionDocument); /** Déclaration de la table des évènements.*/ DECLARE_EVENT_TABLE() --- 720,724 ---- { /** Déclaration de classe dynamique. Déclare la classe comme pouvant être crée dynamiquement depuis ses infos RTTI de caractère.*/ ! DECLARE_DYNAMIC_CLASS(ActionDocument) /** Déclaration de la table des évènements.*/ DECLARE_EVENT_TABLE() Index: FileSystem.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/FileSystem.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FileSystem.h 17 Mar 2005 17:51:24 -0000 1.6 --- FileSystem.h 14 May 2005 12:15:54 -0000 1.7 *************** *** 111,116 **** * @see UnixStandardFileSystem */ ! class WXDC_DLL_BASE FileSystem : public wxEvtHandler, public InitializableInterface { DECLARE_EVENT_TABLE() public: --- 111,117 ---- * @see UnixStandardFileSystem */ ! class WXDC_DLL_BASE FileSystem : public wxEvtHandler, public Element { + DECLARE_CLASS(FileSystem) DECLARE_EVENT_TABLE() public: *************** *** 217,221 **** * Fait le lien entre les noms de fichiers, les systèmes de fichiers et les archives. */ ! class WXDC_DLL_BASE FileSystemManager : public InitializableObjectManager<FileSystem> { public: --- 218,222 ---- * Fait le lien entre les noms de fichiers, les systèmes de fichiers et les archives. */ ! class WXDC_DLL_BASE FileSystemManager : public ElementManager<FileSystem> { public: Index: Manager.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/Manager.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Manager.h 17 Mar 2005 14:37:41 -0000 1.3 --- Manager.h 14 May 2005 12:15:54 -0000 1.4 *************** *** 43,50 **** * Juste les opérations de base : Enregistrer/Désenregistrer, acces, compte ... * ! * @subsection InitializableObjectManager Gestionnaire d'objets initialisables. ! * Le wxDevCenter::InitializableObjectManager est un gestionnaire d'objets initialisables. ! * Toute classe utilisée comme objet de ce gestionnaire doit implémenter l'interface wxDevCenter::InitializableInterface. ! * Cette interface définit des fonctions virtuelles d'initialisation (wxDevCenter::InitializableInterface::Initialize) et de finalisation (wxDevCenter::InitializableInterface::Finalize) * appelées respectivement à l'enregistrement et au désenregistrement des objets dans le gestionnaire. * Cela permet de manipuler des objets plus ou moins dynamqiues. --- 43,50 ---- * Juste les opérations de base : Enregistrer/Désenregistrer, acces, compte ... * ! * @subsection ElementManager Gestionnaire d'objets initialisables. ! * Le wxDevCenter::ElementManager est un gestionnaire d'objets initialisables. ! * Toute classe utilisée comme objet de ce gestionnaire doit implémenter l'interface wxDevCenter::Element. ! * Cette interface définit des fonctions virtuelles d'initialisation (wxDevCenter::Element::Initialize) et de finalisation (wxDevCenter::Element::Finalize) * appelées respectivement à l'enregistrement et au désenregistrement des objets dans le gestionnaire. * Cela permet de manipuler des objets plus ou moins dynamqiues. *************** *** 54,58 **** * Ces objets doivent être RTTI-dynamiques (DECLARE_DYNAMIC_CLASS). ! * Pour cela, il faut que ces objets dérivent de wxDevCenter::ManagedObject qui est ni plmus ni moins qu'un wxDevCenter::InitializableInterface augmenté des infos RTTI. * Il faut aussi créer un patron d'objet (wxDevCenter::ObjectTemplate) qui contient les informations nécessaire à la création dynamique des objets. * Et enfin, créer le gestionnaire en question. --- 54,58 ---- * Ces objets doivent être RTTI-dynamiques (DECLARE_DYNAMIC_CLASS). ! * Pour cela, il faut que ces objets dérivent de wxDevCenter::ManagedObject qui est ni plmus ni moins qu'un wxDevCenter::Element augmenté des infos RTTI. * Il faut aussi créer un patron d'objet (wxDevCenter::ObjectTemplate) qui contient les informations nécessaire à la création dynamique des objets. * Et enfin, créer le gestionnaire en question. *************** *** 70,73 **** --- 70,77 ---- #define __WXDEVCENTER_MANAGER + + #include <wxDevCenter/Element.h> + #include <wxDevCenter/Plugin.h> + namespace wxDevCenter { *************** *** 206,223 **** - /** Classe interface des objets enregistrables [init/finit]ialisables. - * @ref Gestionnaires - */ - class WXDC_DLL_BASE InitializableInterface - { - public: - /** Initialise l'objet. - * Si l'initialisation rend faux alors l'objet ne sera pas enregistré. - * @return Status d'initialisation.*/ - virtual bool Initialize(){return true;} - /** Finalise l'objet.*/ - virtual void Finalize(){} - }; - /** Classe de base de gestionnaire d'objets initialisables. * Gestion d'objets enregistrés. --- 210,213 ---- *************** *** 225,233 **** */ template<class ItemType> ! class WXDC_DLL_BASE InitializableObjectManager : public ObjectManager<ItemType>, public InitializableInterface { public: /** Constructeur.*/ ! InitializableObjectManager():ObjectManager<ItemType>(){} /** @name Surcharge des fonctions de manipulations. * @{ */ --- 215,223 ---- */ template<class ItemType> ! class WXDC_DLL_BASE ElementManager : public ObjectManager<ItemType>, public Element { public: /** Constructeur.*/ ! ElementManager():ObjectManager<ItemType>(),Element(){} /** @name Surcharge des fonctions de manipulations. * @{ */ *************** *** 235,256 **** * @param pObj Adresse de l'objet. * @return Vrai si correctement enregistré.*/ ! bool Register(ItemType* pObj){if(pObj->Initialize())return ObjectManager<ItemType>::Register(pObj);else return false;} /** Enregistrement d'un objet. * @param Obj Objet à enregistrer. * @return Vrai si correctement enregistré.*/ ! bool Register(ItemType& Obj){if(Obj.Initialize())return ObjectManager<ItemType>::Register(Obj);else return false;} /** Désenregistrement d'un objet. * @param pObj Adresse de l'objet. * @return Faux si l'objet n'a pa été désenregistré.*/ ! bool Unregister(ItemType* pObj) ! { ! if(ObjectManager<ItemType>::Unregister(pObj)) ! { ! pObj->Finalize(); ! return true; ! } ! else ! return false; ! } /** Désenregistrement d'un objet. * @param Index Index de l'objet à supprimer.*/ --- 225,237 ---- * @param pObj Adresse de l'objet. * @return Vrai si correctement enregistré.*/ ! bool Register(ItemType* pObj){return ObjectManager<ItemType>::Register(pObj);} /** Enregistrement d'un objet. * @param Obj Objet à enregistrer. * @return Vrai si correctement enregistré.*/ ! bool Register(ItemType& Obj){return ObjectManager<ItemType>::Register(Obj);} /** Désenregistrement d'un objet. * @param pObj Adresse de l'objet. * @return Faux si l'objet n'a pa été désenregistré.*/ ! bool Unregister(ItemType* pObj){return ObjectManager<ItemType>::Unregister(pObj);} /** Désenregistrement d'un objet. * @param Index Index de l'objet à supprimer.*/ *************** *** 261,287 **** - - - /** Interface des objets manageables. - * Ces objets doivent être initialisables (wxDevCenter::InitializableInterface) - * et RTTI-dynamique (utilisant DECLARE_DYNAMIC_CLASS). - * @ref Gestionnaires - */ - class WXDC_DLL_BASE ManagedObject : public wxObject, public InitializableInterface - { - DECLARE_DYNAMIC_CLASS(ManagedObject); - public: - /** Constructeur.*/ - ManagedObject(): - wxObject() - {} - }; - - /** Patron d'objet manageable. * @ref Gestionnaires */ template<class ObjectType> ! class WXDC_DLL_BASE ObjectTemplate : public wxObject, public InitializableInterface { protected: --- 242,250 ---- /** Patron d'objet manageable. * @ref Gestionnaires */ template<class ObjectType> ! class WXDC_DLL_BASE ObjectTemplate : public Element { protected: *************** *** 296,300 **** /** Constructeur.*/ ObjectTemplate(wxClassInfo* pInfo, wxString strName, wxString strDescript): - wxObject(), m_pClassInfo(pInfo), m_strName(strName), --- 259,262 ---- *************** *** 307,311 **** ObjectType* CreateObject() { ! ObjectType* pObj =(ObjectType*) m_pClassInfo->CreateObject(); if(pObj!=NULL) if(!pObj->Initialize()) --- 269,273 ---- ObjectType* CreateObject() { ! ObjectType* pObj =(ObjectType*) (m_pClassInfo->CreateObject()); if(pObj!=NULL) if(!pObj->Initialize()) *************** *** 332,336 **** */ template<class ObjectType, class Template=ObjectTemplate<ObjectType> > ! class WXDC_DLL_BASE TemplateManager : private InitializableObjectManager<Template> { public: --- 294,298 ---- */ template<class ObjectType, class Template=ObjectTemplate<ObjectType> > ! class WXDC_DLL_BASE TemplateManager : private ElementManager<Template> { public: *************** *** 339,370 **** /** Retourne le nombre de patrons enregistrés. * @return Nombre de patrons enregistrés.*/ ! unsigned int GetTemplateCount()const{return InitializableObjectManager<Template>::GetCount();} /** Recherche d'un patron. * @param pTemplate Adresse du patron à rechercher. * @return Index du patron ou -1 si non trouvé.*/ ! int FindTemplate(const Template* pTemplate)const{return InitializableObjectManager<Template>::Find(pTemplate);} /** Accès à un patron. * @param nIndex Index du patron. * @return Référence du patron.*/ ! Template& GetTemplate(unsigned int nIndex){return InitializableObjectManager<Template>::Item(nIndex);} /** Accès constant à un patron. * @param nIndex Index du patron. * @return Référence du patron.*/ ! const Template& GetTemplate(unsigned int nIndex)const{return InitializableObjectManager<Template>::Item(nIndex);} /** Enregistrement d'un patron. * @param pTemplate Adresse du patron. * @return Vrai si correctement enregistré.*/ ! bool RegisterTemplate(Template* pTemplate){return InitializableObjectManager<Template>::Register(pTemplate);} /** Enregistrement d'un patron. * @param Templ Patron à enregistrer. * @return Vrai si correctement enregistré.*/ ! bool RegisterTemplate(Template& Templ){return InitializableObjectManager<Template>::Register(Templ);} /** Désenregistrement d'un patron. * @param pTempl Adresse du patron. * @return Faux si le patron n'a pa été désenregistré.*/ ! bool UnregisterTemplate(Template* pTempl){return InitializableObjectManager<Template>::Unregister(pTempl);} /** Désenregistrement d'un patron. * @param Index Index du patron à supprimer.*/ ! void UnregisterTemplate(unsigned int Index){InitializableObjectManager<Template>::Unregister(Index);} /** @} */ --- 301,332 ---- /** Retourne le nombre de patrons enregistrés. * @return Nombre de patrons enregistrés.*/ ! unsigned int GetTemplateCount()const{return ElementManager<Template>::GetCount();} /** Recherche d'un patron. * @param pTemplate Adresse du patron à rechercher. * @return Index du patron ou -1 si non trouvé.*/ ! int FindTemplate(const Template* pTemplate)const{return ElementManager<Template>::Find(pTemplate);} /** Accès à un patron. * @param nIndex Index du patron. * @return Référence du patron.*/ ! Template& GetTemplate(unsigned int nIndex){return ElementManager<Template>::Item(nIndex);} /** Accès constant à un patron. * @param nIndex Index du patron. * @return Référence du patron.*/ ! const Template& GetTemplate(unsigned int nIndex)const{return ElementManager<Template>::Item(nIndex);} /** Enregistrement d'un patron. * @param pTemplate Adresse du patron. * @return Vrai si correctement enregistré.*/ ! bool RegisterTemplate(Template* pTemplate){return ElementManager<Template>::Register(pTemplate);} /** Enregistrement d'un patron. * @param Templ Patron à enregistrer. * @return Vrai si correctement enregistré.*/ ! bool RegisterTemplate(Template& Templ){return ElementManager<Template>::Register(Templ);} /** Désenregistrement d'un patron. * @param pTempl Adresse du patron. * @return Faux si le patron n'a pa été désenregistré.*/ ! bool UnregisterTemplate(Template* pTempl){return ElementManager<Template>::Unregister(pTempl);} /** Désenregistrement d'un patron. * @param Index Index du patron à supprimer.*/ ! void UnregisterTemplate(unsigned int Index){ElementManager<Template>::Unregister(Index);} /** @} */ *************** *** 383,389 **** * Si l'initialisation rend faux alors l'objet ne sera pas enregistré. * @return Status d'initialisation.*/ ! virtual bool Initialize(){return InitializableObjectManager<Template>::Initialize();} /** Finalise l'objet.*/ ! virtual void Finalize(){InitializableObjectManager<Template>::Finalize();} /** @} */ }; --- 345,351 ---- * Si l'initialisation rend faux alors l'objet ne sera pas enregistré. * @return Status d'initialisation.*/ ! virtual bool Initialize(){return ElementManager<Template>::Initialize();} /** Finalise l'objet.*/ ! virtual void Finalize(){ElementManager<Template>::Finalize();} /** @} */ }; *************** *** 432,436 **** private: /** Gestionnaire interne des objets créés depuis les patrons.*/ ! InitializableObjectManager<ObjectType> m_ObjectManager; protected: /** Création d'un objet depuis un patron enregistré. --- 394,398 ---- private: /** Gestionnaire interne des objets créés depuis les patrons.*/ ! ElementManager<ObjectType> m_ObjectManager; protected: /** Création d'un objet depuis un patron enregistré. *************** *** 497,501 **** private: /** Gestionnaire interne des objets créés depuis les patrons.*/ ! InitializableObjectManager<ObjectType> m_ObjectManager; public: /** Constructeur.*/ --- 459,463 ---- private: /** Gestionnaire interne des objets créés depuis les patrons.*/ ! ElementManager<ObjectType> m_ObjectManager; public: /** Constructeur.*/ --- NEW FILE: Element.h --- (This appears to be a binary file; contents omitted.) Index: FileTools.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/FileTools.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FileTools.h 7 Mar 2005 15:23:02 -0000 1.5 --- FileTools.h 14 May 2005 12:15:54 -0000 1.6 *************** *** 48,52 **** FilePath(const char* psz, size_t nLength = wxSTRING_MAXLEN); FilePath(const unsigned char* psz, size_t nLength = wxSTRING_MAXLEN); - FilePath(const wchar_t* psz); /** Retourne le nom du fichier "titre.ext".*/ --- 48,51 ---- Index: FileSystemStandard.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/FileSystemStandard.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** FileSystemStandard.h 16 Mar 2005 14:27:36 -0000 1.10 --- FileSystemStandard.h 14 May 2005 12:15:54 -0000 1.11 *************** *** 61,65 **** public: virtual wxString GetFileSystemName()const{return WXDC_SYSTEM_STDFS_NAME;} ! virtual wxIconBundle GetIconBundle()const{return wxGetApp().LoadAppIconBundle("desktop");} wxString GetProtocoleName()const{return "file";} --- 61,65 ---- public: virtual wxString GetFileSystemName()const{return WXDC_SYSTEM_STDFS_NAME;} ! virtual wxIconBundle GetIconBundle()const{return Application::GetApp().LoadAppIconBundle("desktop");} wxString GetProtocoleName()const{return "file";} Index: Application.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/Application.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Application.h 4 Apr 2005 08:11:18 -0000 1.11 --- Application.h 14 May 2005 12:15:54 -0000 1.12 *************** *** 64,72 **** { DECLARE_EVENT_TABLE() protected : /** Gestionnaire de projets.*/ ProjectManager m_ProjectManager; - /** Gestionnaire des plugins.*/ - PluginManager m_PluginManager; /** Gestionnaire de types de documents et de vues.*/ DocManager m_DocManager; --- 64,76 ---- { DECLARE_EVENT_TABLE() + private: + /** The unique Application object.*/ + static Application* ms_pTheApp; protected : + /** Chargeur de plugins.*/ + plugins::PluginLoader m_PluginLoader; + /** Gestionnaire de projets.*/ ProjectManager m_ProjectManager; /** Gestionnaire de types de documents et de vues.*/ DocManager m_DocManager; *************** *** 114,117 **** --- 118,125 ---- /** Fenêtre principale.*/ MainFrame& GetMainFrame(){return *m_pMainFrame;} + + /** Acces sur l'application. + * @return Référence de l'application.*/ + static Application& GetApp(){return *ms_pTheApp;} /** @}*/ *************** *** 242,249 **** * Gestion des plugins. * @{*/ ! /** Chargement des plugins.*/ ! void LoadPlugins(); ! /** Retourne le gestionnaire de plugins.*/ ! PluginManager& GetPluginManager(){return m_PluginManager;} /** @}*/ --- 250,255 ---- * Gestion des plugins. * @{*/ ! /** Retourne le chargeur de plugins.*/ ! plugins::PluginLoader& GetPluginLoader(){return m_PluginLoader;} /** @}*/ *************** *** 259,263 **** /** Déclare un objet application global.*/ ! DECLARE_APP(WXDC_DLL_BASE wxDevCenter::Application) #endif --- 265,269 ---- /** Déclare un objet application global.*/ ! DECLARE_APP(WXDC_DLL_MAIN wxDevCenter::Application) #endif |