#
#  $Id: GUI.py,v 1.2 1999/12/16 09:36:49 rob Exp $
#
#  Copyright 1999 Rob Tillotson <robt@debian.org>
#  All Rights Reserved
#
#  Permission to use, copy, modify, and distribute this software and
#  its documentation for any purpose and without fee or royalty is
#  hereby granted, provided that the above copyright notice appear in
#  all copies and that both the copyright notice and this permission
#  notice appear in supporting documentation or portions thereof,
#  including modifications, that you you make.
#
#  THE AUTHOR ROB TILLOTSON DISCLAIMS ALL WARRANTIES WITH REGARD TO
#  THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
#  AND FITNESS.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
#  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
#  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
#  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
#  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE!
#
"""
"""

__version__ = '$Id: GUI.py,v 1.2 1999/12/16 09:36:49 rob Exp $'

__copyright__ = 'Copyright 1999 Rob Tillotson <robt@debian.org>'

from Sulfur.Plugin import Plugin

system_names = ['tk']

def test_system(s):
    """Test for the existence of a particular GUI system.
    """

    if s == 'tk':
	try:
	    import Tkinter
	    return 1
	except:
	    pass

# everything else I have on my system...
#    elif s == 'pmw':
#	try:
#	    import Pmw
#	    return 1
#	except:
#	    pass

#    elif s == 'gtk':
#	try:
#	    import gtk
#	    return 1
#	except:
#	    pass

#   elif s == 'gnome':
#	try:
#	    import gnome
#	    return 1
#	except:
#	    pass
	
#    elif s == 'wxwin':
#	try:
#	    import wxPython
#	    return 1
#	except:
#	    pass

    return None


def test_systems(l):
    """Test for several GUI systems, and return the first match.
    """
    for s in l:
	if test_system(s): return s
	

# The GUI API
class GUISystem(Plugin):
    type = 'GUI'
    
