-
-// ---------------------------------------------------------------------------
-// wxClassLibrary (this class is used to access the internal class)
-// ---------------------------------------------------------------------------
-
-wxClassLibrary::wxClassLibrary(void)
-{
-}
-
-wxClassLibrary::~wxClassLibrary(void)
-{
- uint i;
-
- for (i=0;i<m_list.Count();i++)
- delete (m_list[i]);
-}
-
-void wxClassLibrary::RegisterClass(wxClassInfo *class_info,
- const wxString& path)
-{
- wxClassLibInfo *info = new wxClassLibInfo;
-
- info->class_info = class_info;
- info->path = path;
- m_list.Add(info);
-}
-
-void wxClassLibrary::UnregisterClass(wxClassInfo *class_info)
-{
- uint i = 0;
-
- while (i < m_list.Count()) {
- if (m_list[i]->class_info == class_info) {
- delete (m_list[i]);
- m_list.Remove(i);
- return;
- }
- i++;
- }
-}
-
-bool wxClassLibrary::CreateObjects(const wxString& path,
- wxArrayClassInfo& objs)
-{
- wxClassLibInfo *info;
- uint i = 0;
-
- while (i < m_list.Count()) {
- info = m_list[i];
- if (wxMatchWild(path, info->path))
- objs.Add(info->class_info);
- i++;
- }
- return (i > 0);
-}
-
-bool wxClassLibrary::FetchInfos(const wxString& path,
- wxArrayClassLibInfo& infos)
-{
- wxClassLibInfo *info;
- uint i = 0;
-
- while (i < m_list.Count()) {
- info = m_list[i];
- if (wxMatchWild(path, info->path)) {
- wxClassLibInfo *inf = new wxClassLibInfo;
- *inf = *info;
- infos.Add(inf);
- }
- i++;
- }
- return (i > 0);
-}
-
-wxObject *wxClassLibrary::CreateObject(const wxString& path)
-{
- wxClassLibInfo *info;
- uint i = 0;
-
- while (i < m_list.Count()) {
- info = m_list[i];
- if (wxMatchWild(path, info->path))
- return info->class_info->CreateObject();
- i++;
- }
- return NULL;
-}