# Stubs for "Test2"
#
# This file was automatically generated with ILU (version 2.0beta1) tools
# at Tue Sep 21 11:44:54 1999 by `nobody'
# running "c:/iluwin/bin/python-stubber.exe" of Tue Sep 21 10:50:35 1999
# on "C:/iluwin/examples/test1/Test2.isl" of Mon Sep 20 15:53:44 1999,
# and "C:/iluwin/examples/test1/Test1.isl" of Mon Sep 20 15:53:47 1999,
# and "c:/iluwin/interfaces/ilu.isl" of Mon Sep 20 15:51:47 1999.
#
# ILU is Copyright 1991-1999 Xerox Corporation, All Rights Reserved.
# ILU information:  ftp://ftp.parc.xerox.com/pub/ilu/ilu.html.

_imported_modules = {};
import iluRt ; _imported_modules['iluRt'] = iluRt; _imported_modules['ilu'] = iluRt;
iluRt.CheckStubConsistency('2.0beta1', 'v2 (post-2.0alpha12)');
_imported_modules['ilu__skel'] = iluRt
del iluRt
__types__={}

import Test1; _imported_modules['Test1'] = Test1; del Test1;
import iluRt

T1O3 = _imported_modules['Test1'].O3

__types__['T1O3'] = iluRt.RegisterAliasType(('Test2','T1O3',), None, 'ilut:elSuMj-IXsqZljGnWZRap7ZW64A', 'ilut:elSuMj-IXsqZljGnWZRap7ZW64A')
iluRt.NoteAlias('Test2.T1O3', 'ilut:elSuMj-IXsqZljGnWZRap7ZW64A', 'ilut:elSuMj-IXsqZljGnWZRap7ZW64A')

__types__['T1U3'] = iluRt.RegisterAliasType(('Test2','T1U3',), None, 'ilut:pJIIpHYTc0rbT9hGwYxGCgVtILs', 'ilut:pJIIpHYTc0rbT9hGwYxGCgVtILs')
iluRt.NoteAlias('Test2.T1U3', 'ilut:pJIIpHYTc0rbT9hGwYxGCgVtILs', 'ilut:pJIIpHYTc0rbT9hGwYxGCgVtILs')

__types__['T1U2'] = iluRt.RegisterAliasType(('Test2','T1U2',), None, 'ilut:e307vU+7+lJzWeAhohfUKh6UcD+', 'ilut:e307vU+7+lJzWeAhohfUKh6UcD+')
iluRt.NoteAlias('Test2.T1U2', 'ilut:e307vU+7+lJzWeAhohfUKh6UcD+', 'ilut:e307vU+7+lJzWeAhohfUKh6UcD+')

__types__['T1U'] = iluRt.RegisterAliasType(('Test2','T1U',), None, 'ilut:gaYVCP7Kh4DScQISCVDQNadiFPZ', 'ilut:gaYVCP7Kh4DScQISCVDQNadiFPZ')
iluRt.NoteAlias('Test2.T1U', 'ilut:gaYVCP7Kh4DScQISCVDQNadiFPZ', 'ilut:gaYVCP7Kh4DScQISCVDQNadiFPZ')

def _Input_U2(_call):
    _d = iluRt.InputUnion(_call, iluRt.TypeKind_enumeration)
    if _d == TheE.ev1:
	_value = (_d, iluRt.InputString(_call, 0))
    elif _d == TheE.ev3:
	_value = (_d, iluRt.InputObjectID(_call, iluRt.FALSE, _imported_modules['Test1'].TheO1))
    elif _d == TheE.ev7:
	_value = (_d, iluRt.InputObjectID(_call, iluRt.FALSE, P))
    else:
	raise TypeError
    iluRt.EndUnion(_call)
    return _value

def _Output_U2(_call, _value):
    _d = _value[0]
    _value = _value[1]
    iluRt.OutputUnion(_call, _d, iluRt.TypeKind_enumeration)
    if _d == TheE.ev1:
	iluRt.OutputString(_call, _value, 0)
    elif _d == TheE.ev3:
	iluRt.OutputObjectID(_call, _value, iluRt.FALSE, _imported_modules['Test1'].TheO1)
    elif _d == TheE.ev7:
	iluRt.OutputObjectID(_call, _value, iluRt.FALSE, P)
    else:
	raise TypeError
    iluRt.EndUnion(_call)

def _SizeOf_U2(_call, _value):
    _d = _value[0]
    _value = _value[1]
    _size = iluRt.SizeOfUnion(_call, _d, iluRt.TypeKind_enumeration)
    if _d == TheE.ev1:
	_size = _size + iluRt.SizeOfString(_call, _value, 0)
    elif _d == TheE.ev3:
	_size = _size + iluRt.SizeOfObjectID(_call, _value, iluRt.FALSE, _imported_modules['Test1'].TheO1)
    elif _d == TheE.ev7:
	_size = _size + iluRt.SizeOfObjectID(_call, _value, iluRt.FALSE, P)
    else:
	raise TypeError
    iluRt.EndUnion(_call)
    return _size

__types__['U2'] = iluRt.RegisterUnionType(('Test2','U2',), None, 'ilut:k9D0TKaDcn20tk1krOztWNiPPoV', 'ilut:krAAJGDr0mWg96aGb8cRAqq6LEh', iluRt.TypeKind_enumeration, 0, 0, (('', 'ilut:naKu7NwC1iaZkRZFKFBdxeuTiXv', ('ev1',)), ('', 'ilut:bGjdcettshy6cm6YOP2TDh6IVF4', ('ev3',)), ('', 'ilut:l7u1rIEjawMUE+GJiOmDMtz2QvS', ('ev7',))))
iluRt.RegisterIoFuncs('ilut:k9D0TKaDcn20tk1krOztWNiPPoV', _Input_U2, _Output_U2, _SizeOf_U2, 'Test2.U2')

class P(iluRt.IluObjSurr):
    _IluClass = iluRt.FormClassRecord(\
	'Test2.P',\
	'',\
	'ilut:l7u1rIEjawMUE+GJiOmDMtz2QvS',\
	None,\
	iluRt.FALSE,\
	iluRt.FALSE,\
	None,\
	(\
	    ('SR-to-I', 1, iluRt.FALSE, iluRt.FALSE, "ilut:ggrbg-q7UoqiAlNTWvqkwfZ4rlY", (('i', 0, 0, 'ilut:h9V4l47a8J5CGp2fg6ZpsYhXPSO'),), ()),\
	),\
	()\
	)

    def SR_to_I(_self, i):
	_result = None
	_call = iluRt.BeginCall(_self, P._IluClass, 1)
	try:
	    while 1:
	        iluRt.BeginRequest(_call,\
	          iluRt.SizeOfObjectID(_call, _self, iluRt.TRUE, P)\
	          + iluRt.SizeOfShortReal(_call, i))
	        iluRt.OutputObjectID(_call, _self, iluRt.TRUE, P)
	        iluRt.OutputShortReal(_call, i)
	        iluRt.FinishRequest(_call)
	        _ecode = iluRt.GetReply(_call)
	        if _ecode != iluRt.RetryCall: break
	    try:
	      if _ecode != 0:
		_CatchException(_call, P._IluClass, _ecode)
	      _result = iluRt.InputInteger(_call)
	    finally:
	      iluRt.ReplyRead(_call)
	finally:
	    iluRt.FinishCall(_call)
	return _result

__types__['P'] = iluRt.RegisterObjectType(P, ('Test2','P',), None, None)

class F:
    ev1 = 0;
    ev3 = 3;
    ev5 = 4;
    ev7 = 5;
    __image__ = {
          ev1 : 'ev1',
          ev3 : 'ev3',
          ev5 : 'ev5',
          ev7 : 'ev7'}

__types__['F'] = iluRt.RegisterAliasType(('Test2','F',), None, 'ilut:krAAJGDr0mWg96aGb8cRAqq6LEh', 'ilut:krAAJGDr0mWg96aGb8cRAqq6LEh')
iluRt.NoteAlias('Test2.F', 'ilut:krAAJGDr0mWg96aGb8cRAqq6LEh', 'ilut:krAAJGDr0mWg96aGb8cRAqq6LEh')

E1__ExcnID = 'ilu:Test2.E1'
E1 = E1__ExcnID

def _CatchException(_call, _IluClass, _ecode):
    _value = None
    _name = iluRt.ExceptionName(_call, _IluClass, _ecode)
    if _name == E1__ExcnID:
	_name = E1
	_value = _imported_modules['Test1']._Input_TheU(_call)
    raise _name, _value
