#-----------------------------------------------------------------------------
# Name:        wxNamespace.py
# Purpose:
#
# Author:      Riaan Booysen
#
# Created:     2001
# RCS-ID:      $Id: wxNamespace.py,v 1.10 2005/05/18 13:21:11 riaan Exp $
# Copyright:   (c) 2001 - 2005
# Licence:     GPL
#-----------------------------------------------------------------------------
import Preferences as _Prefs

import wx
import wx.html
import wx.calendar
import wx.grid
import wx.stc
import wx.gizmos
import wx.wizard

def getWxClass(name):
    return getWxObjPath(name)

##def getNamesOfType(aType):
##    res = []
##    for k, v in globals().items():
##        if type(v) == aType:
##            if _Prefs.ccFilterWxPtrNames and k[-3:] == 'Ptr':
##                continue
##            res.append(k)
##    return res

def getWxObjPath(objPath):
    pathSegs = objPath.split('.')
    if pathSegs[0] != 'wx':
        return None
    obj = wx
    for name in pathSegs[1:]:
        if hasattr(obj, name):
            obj = getattr(obj, name)
        else:
            return None
    return obj

def getWxNamespaceForObjPath(objPath):
    obj = getWxObjPath(objPath)
    if obj:
        return dir(obj)
    else:
        return []

