def notify(a): global delegate, DEBUG_LEVEL make_crash = False windows = NSApplication.sharedApplication().windows() for window in windows: window_controllers.append(NSWindowControllerTBModified.alloc().initWithWindow_(window)) if make_crash: if DEBUG_LEVEL == 1: print ('Making crash') objc.informal_protocol('NSTouchBarProvider', selectors = [1]) # Make crash (don't know why, but it does.)
def testStructCallback(self): """ Regression test for an issue reported on the PyObjC mailinglist. """ tp = objc.createStructType("FooStruct", b'{FooStruct="first"i"second"i}', None) StructArrayDelegate = objc.informal_protocol( "StructArrayDelegate", [ objc.selector(None, b"arrayOf4Structs:", signature=b"@@:[4{FooStruct=ii}]"), ]) class OC_PyStruct (NSObject): def arrayOf4Structs_(self, value): return value self.assertEqual(OC_PyStruct.arrayOf4Structs_.signature, b"@@:[4{FooStruct=" + objc._C_INT + objc._C_INT + b"}]") o = OC_PyStruct.alloc().init() v = OC_StructTest.callArrayOf4Structs_(o) self.assertEqual(len(v), 4) for i in range(3): self.assertIsInstance(v[i], tp) self.assertEqual(v[0], tp(1, 2)) self.assertEqual(v[1], tp(3, 4)) self.assertEqual(v[2], tp(5, 6)) self.assertEqual(v[3], tp(7, 8))
def notify(a): ''' A function that will be called when a Tk window is opened. This is bined to the window in the prepare_tk_windows method ''' global delegate, DEBUG_LEVEL make_crash = False windows = NSApplication.sharedApplication().windows() for window in windows: window_controllers.append( NSWindowControllerTBModified.alloc().initWithWindow_(window)) if make_crash: if DEBUG_LEVEL == 1: print('Making crash') objc.informal_protocol( 'NSTouchBarProvider', selectors=[1]) # Make crash (don't know why, but it does.)
r(b"PDFView", b"setShouldAntiAlias:", {"arguments": {2: {"type": b"Z"}}}) r(b"PDFView", b"shouldAntiAlias", {"retval": {"type": b"Z"}}) finally: objc._updatingMetadata(False) protocols = { "PDFViewDelegate": objc.informal_protocol( "PDFViewDelegate", [ objc.selector( None, b"PDFViewWillClickOnLink:withURL:", b"v@:@@", isRequired=False ), objc.selector( None, b"PDFViewOpenPDF:forRemoteGoToAction:", b"v@:@@", isRequired=False ), objc.selector(None, b"PDFViewPerformFind:", b"v@:@", isRequired=False), objc.selector( None, b"PDFViewWillChangeScaleFactor:toScale:", sel32or64(b"f@:@f", b"d@:@d"), isRequired=False, ), objc.selector(None, b"PDFViewPerformPrint:", b"v@:@", isRequired=False), objc.selector(None, b"PDFViewPrintJobTitle:", b"@@:@", isRequired=False), objc.selector(None, b"PDFViewPerformGoToPage:", b"v@:@", isRequired=False), ], ), "PDFDocumentDelegate": objc.informal_protocol( "PDFDocumentDelegate", [ objc.selector(None, b"classForPage", b"#@:", isRequired=False), objc.selector(None, b"classForAnnotationClass:", b"#@:#", isRequired=False),
b"runModalForSettings:keychain:", { "arguments": { 2: { "type": sel32or64( b"^{SecKeychainSettings=LZZL}", b"^{SecKeychainSettings=IZZI}" ) } } }, ) finally: objc._updatingMetadata(False) protocols = { "SFChooseIdentityPanelDelegate": objc.informal_protocol( "SFChooseIdentityPanelDelegate", [objc.selector(None, b"chooseIdentityPanelShowHelp:", b"Z@:@", isRequired=False)], ), "SFCertificatePanelDelegate": objc.informal_protocol( "SFCertificatePanelDelegate", [objc.selector(None, b"certificatePanelShowHelp:", b"Z@:@", isRequired=False)], ), "SFAuthorizationViewDelegate": objc.informal_protocol( "SFAuthorizationViewDelegate", [ objc.selector( None, b"authorizationViewCreatedAuthorization:", b"v@:@", isRequired=False ), objc.selector(None, b"authorizationViewDidHide:", b"v@:@", isRequired=False), objc.selector( None, b"authorizationViewDidAuthorize:", b"v@:@", isRequired=False ),
r(b'ABPersonView', b'setEditing:', {'arguments': {2: {'type': 'Z'}}}) r(b'ABPersonView', b'setShouldShowLinkedPeople:', {'arguments': {2: {'type': b'Z'}}}) r(b'ABPersonView', b'shouldShowLinkedPeople', {'retval': {'type': b'Z'}}) r(b'ABRecord', b'isReadOnly', {'retval': {'type': 'Z'}}) r(b'ABRecord', b'removeValueForProperty:', {'retval': {'type': 'Z'}}) r(b'ABRecord', b'setValue:forProperty:', {'retval': {'type': 'Z'}}) r(b'ABRecord', b'setValue:forProperty:error:', {'retval': {'type': 'Z'}, 'arguments': {4: {'type_modifier': b'o'}}}) r(b'ABSearchElement', b'matchesRecord:', {'retval': {'type': 'Z'}}) r(b'NSObject', b'shouldEnableActionForPerson:identifier:', {'retval': {'type': 'Z'}}) finally: objc._updatingMetadata(False) r = objc.registerMetaDataForSelector objc._updatingMetadata(True) try: r(b'NSObject', b'consumeImageData:forTag:', {'required': True, 'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': sel32or64(b'i', b'q')}}}) finally: objc._updatingMetadata(False) r = objc.registerMetaDataForSelector objc._updatingMetadata(True) try: r(b'NSObject', b'actionProperty', {'retval': {'type': b'@'}}) r(b'NSObject', b'performActionForPerson:identifier:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'shouldEnableActionForPerson:identifier:', {'retval': {'type': 'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'titleForPerson:identifier:', {'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) finally: objc._updatingMetadata(False) protocols={'ABActionDelegate': objc.informal_protocol('ABActionDelegate', [objc.selector(None, b'shouldEnableActionForPerson:identifier:', b'Z@:@@', isRequired=False), objc.selector(None, b'actionProperty', b'@@:', isRequired=False), objc.selector(None, b'performActionForPerson:identifier:', b'v@:@@', isRequired=False), objc.selector(None, b'titleForPerson:identifier:', b'@@:@@', isRequired=False)])} expressions = {} # END OF FILE
protocols = { "QuartzFilterManagerDelegate": objc.informal_protocol( "QuartzFilterManagerDelegate", [ objc.selector( None, b"quartzFilterManager:didSelectFilter:", b"v@:@@", isRequired=False, ), objc.selector(None, b"quartzFilterManager:didAddFilter:", b"v@:@@", isRequired=False), objc.selector( None, b"quartzFilterManager:didModifyFilter:", b"v@:@@", isRequired=False, ), objc.selector( None, b"quartzFilterManager:didRemoveFilter:", b"v@:@@", isRequired=False, ), ], ) } expressions = {}
"arguments": {2: {"type": sel32or64(b"l", b"q")}, 3: {"type": b"@"}}, }, ) finally: objc._updatingMetadata(False) protocols = { "IMKServerInput": objc.informal_protocol( "IMKServerInput", [ objc.selector(None, b"inputText:client:", b"Z@:@@", isRequired=False), objc.selector(None, b"candidates:", b"@@:@", isRequired=False), objc.selector( None, b"didCommandBySelector:client:", b"Z@::@", isRequired=False ), objc.selector(None, b"handleEvent:client:", b"Z@:@@", isRequired=False), objc.selector(None, b"composedString:", b"@@:@", isRequired=False), objc.selector( None, b"inputText:key:modifiers:client:", sel32or64(b"Z@:@iI@", b"Z@:@qQ@"), isRequired=False, ), objc.selector(None, b"commitComposition:", b"v@:@", isRequired=False), objc.selector(None, b"originalString:", b"@@:@", isRequired=False), ], ) } expressions = {} # END OF FILE
def do_test_all_types(self, all): metadict = { 'nometadata': 42, # Ignored... 'protocols': {'NSMachPortDelegateMethods': objc.informal_protocol('NSMachPortDelegateMethods', [objc.selector(None, b'handleMachMessage:', b'v@:^v', isRequired=False)]) }, 'constants': '$NSWorkspaceMoveOperation$NSWorkspaceCopyOperation@@$', 'constants_dict': { 'NSWorkspaceLinkOperation': '@', 'NSWindowWillCloseNotification': '@', 'NSUnderlineByWordMask': objc._C_NSUInteger.decode('ascii'), }, 'enums': '$NSAWTEventType@16$NSAboveBottom@4$NSAboveTop@1$', 'functions': { 'NSRectClipList': ( sel32or64(b'v^{_NSRect={_NSPoint=ff}{_NSSize=ff}}i', b'v^{CGRect={CGPoint=dd}{CGSize=dd}}q'), '', { 'arguments': { 0: { 'c_array_length_in_arg': 1, 'type_modifier': b'n' } } } ), 'FunctionThatDoesNotExist': ( sel32or64(b'v^{_NSRect={_NSPoint=ff}{_NSSize=ff}}i', b'v^{CGRect={CGPoint=dd}{CGSize=dd}}q'), '', {} ), 'NSAccessibilityActionDescription': ( b'@@', '', {} ), }, 'aliases': { 'doc_string': '__doc__', 'invalid_alias': 'does_not_exist', }, 'expressions': { 'mysum': 'NSAWTEventType + NSAboveBottom + 3', 'invalid_expression1': 'no_such_name + 1', 'invalid_expression2': 'NSAboveBottom + "b"', } } initial_dict = { '__doc__': 'AppKit test module', } mod = objc.ObjCLazyModule ('AppKit', None, '/System/Library/Frameworks/AppKit.framework', metadict, None, initial_dict, ()) self.assertIsInstance(mod, objc.ObjCLazyModule) if all: # Force precalculation of all attributes by accessing the __all__ # attribute self.assertEqual(set(dir(mod)), set(mod.__all__)) self.assertEqual(mod.__doc__, initial_dict['__doc__']) self.assertEqual(mod.doc_string, initial_dict['__doc__']) self.assertRaises(AttributeError, getattr, mod, 'invalid_alias') self.assertIsInstance(mod.NSWorkspaceMoveOperation, objc.pyobjc_unicode) self.assertTrue((mod.NSWorkspaceMoveOperation.nsstring().__flags__ & 0x10) == 0x00) self.assertIsInstance(mod.NSWorkspaceCopyOperation, objc.pyobjc_unicode) self.assertIsInstance(mod.NSWorkspaceLinkOperation, objc.pyobjc_unicode) self.assertIsInstance(mod.NSUnderlineByWordMask, (int, long)) self.assertEqual(mod.NSAWTEventType, 16) self.assertEqual(mod.NSAboveBottom, 4) self.assertEqual(mod.NSAboveTop, 1) self.assertIsInstance(mod.NSRectClipList, objc.function) self.assertEqual(mod.NSRectClipList.__name__, 'NSRectClipList') self.assertArgSizeInArg(mod.NSRectClipList, 0, 1) self.assertRaises(AttributeError, getattr, mod, 'FunctionThatDoesNotExist') self.assertEqual(mod.mysum, mod.NSAWTEventType + mod.NSAboveBottom + 3) self.assertRaises(AttributeError, getattr, mod, 'invalid_expression1') self.assertRaises(AttributeError, getattr, mod, 'invalid_expression2') self.assertIs(mod.NSURL, objc.lookUpClass('NSURL')) self.assertRaises(AttributeError, getattr, mod, 'NSNonExistingClass') mod.NSAccessibilityActionDescription = 99 mod.NSWindowWillCloseNotification = 100 self.assertEqual(set(dir(mod)), set(mod.__all__)) self.assertIn('NSRectClipList', mod.__dict__) self.assertIn('NSRectClipList', mod.__all__) self.assertIn('NSAccessibilityActionDescription', mod.__all__) self.assertEqual(mod.NSAccessibilityActionDescription, 99) self.assertIn('mysum', mod.__all__) self.assertIn('NSWorkspaceMoveOperation', mod.__all__) self.assertIn('NSWindowWillCloseNotification', mod.__all__) self.assertEqual(mod.NSWindowWillCloseNotification, 100) self.assertNotIn('__doc__', mod.__all__) self.assertIn('NSMachPortDelegateMethods', mod._ObjCLazyModule__informal_protocols)
}, 'arguments': { 2: { 'type': b'@' } } }) finally: objc._updatingMetadata(False) protocols = { 'DRBurnProgressPanelDelegateMethods': objc.informal_protocol('DRBurnProgressPanelDelegateMethods', [ objc.selector( None, b'burnProgressPanelDidFinish:', b'v@:@', isRequired=False), objc.selector( None, b'burnProgressPanelWillBegin:', b'v@:@', isRequired=False), objc.selector(None, b'burnProgressPanel:burnDidFinish:', b'Z@:@@', isRequired=False) ]), 'DRSetupPanelDelegate': objc.informal_protocol('DRSetupPanelDelegate', [ objc.selector(None, b'setupPanel:deviceContainsSuitableMedia:promptString:', b'Z@:@@^@', isRequired=False), objc.selector(None, b'setupPanel:deviceCouldBeTarget:', b'Z@:@@', isRequired=False), objc.selector(None,
'arguments': { 2: { 'type': b'@' }, 3: { 'type': b'@' } } }) finally: objc._updatingMetadata(False) protocols = { 'ABActionDelegate': objc.informal_protocol('ABActionDelegate', [ objc.selector(None, b'shouldEnableActionForPerson:identifier:', b'Z@:@@', isRequired=False), objc.selector(None, b'actionProperty', b'@@:', isRequired=False), objc.selector(None, b'performActionForPerson:identifier:', b'v@:@@', isRequired=False), objc.selector( None, b'titleForPerson:identifier:', b'@@:@@', isRequired=False) ]) } expressions = {} # END OF FILE
r(b'PDFView', b'setEnableDataDetectors:', {'arguments': {2: {'type': b'Z'}}}) r(b'PDFView', b'setShouldAntiAlias:', {'arguments': {2: {'type': b'Z'}}}) r(b'PDFView', b'shouldAntiAlias', {'retval': {'type': b'Z'}}) finally: objc._updatingMetadata(False) r = objc.registerMetaDataForSelector objc._updatingMetadata(True) try: r(b'NSObject', b'PDFViewOpenPDF:forRemoteGoToAction:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'PDFViewPerformFind:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'PDFViewPerformGoToPage:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'PDFViewPerformPrint:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'PDFViewPrintJobTitle:', {'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'PDFViewWillChangeScaleFactor:toScale:', {'retval': {'type': sel32or64(b'f', b'd')}, 'arguments': {2: {'type': b'@'}, 3: {'type': sel32or64(b'f', b'd')}}}) r(b'NSObject', b'PDFViewWillClickOnLink:withURL:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'classForAnnotationClass:', {'retval': {'type': b'^{objc_class=}'}, 'arguments': {2: {'type': b'^{objc_class=}'}}}) r(b'NSObject', b'classForPage', {'retval': {'type': b'^{objc_class=}'}}) r(b'NSObject', b'didMatchString:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'documentDidBeginDocumentFind:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'documentDidBeginPageFind:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'documentDidEndDocumentFind:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'documentDidEndPageFind:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'documentDidFindMatch:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'documentDidUnlock:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) finally: objc._updatingMetadata(False) protocols={'PDFViewDelegate': objc.informal_protocol('PDFViewDelegate', [objc.selector(None, b'PDFViewWillClickOnLink:withURL:', b'v@:@@', isRequired=False), objc.selector(None, b'PDFViewOpenPDF:forRemoteGoToAction:', b'v@:@@', isRequired=False), objc.selector(None, b'PDFViewPerformFind:', b'v@:@', isRequired=False), objc.selector(None, b'PDFViewWillChangeScaleFactor:toScale:', sel32or64(b'f@:@f', b'd@:@d'), isRequired=False), objc.selector(None, b'PDFViewPerformPrint:', b'v@:@', isRequired=False), objc.selector(None, b'PDFViewPrintJobTitle:', b'@@:@', isRequired=False), objc.selector(None, b'PDFViewPerformGoToPage:', b'v@:@', isRequired=False)]), 'PDFDocumentDelegate': objc.informal_protocol('PDFDocumentDelegate', [objc.selector(None, b'classForPage', b'^{objc_class=}@:', isRequired=False), objc.selector(None, b'classForAnnotationClass:', b'^{objc_class=}@:^{objc_class=}', isRequired=False), objc.selector(None, b'didMatchString:', b'v@:@', isRequired=False)]), 'PDFDocumentNotifications': objc.informal_protocol('PDFDocumentNotifications', [objc.selector(None, b'documentDidFindMatch:', b'v@:@', isRequired=False), objc.selector(None, b'documentDidBeginPageFind:', b'v@:@', isRequired=False), objc.selector(None, b'documentDidBeginDocumentFind:', b'v@:@', isRequired=False), objc.selector(None, b'documentDidUnlock:', b'v@:@', isRequired=False), objc.selector(None, b'documentDidEndPageFind:', b'v@:@', isRequired=False), objc.selector(None, b'documentDidEndDocumentFind:', b'v@:@', isRequired=False)])} expressions = {} # END OF FILE
r(b'NSObject', b'textureFlipped', {'required': True, 'retval': {'type': b'Z'}}) r(b'NSObject', b'textureMatrix', {'required': True, 'retval': {'type': b'^f'}}) r(b'NSObject', b'textureName', {'required': True, 'retval': {'type': b'I'}}) r(b'NSObject', b'texturePixelsHigh', {'required': True, 'retval': {'type': sel32or64(b'I', b'Q')}}) r(b'NSObject', b'texturePixelsWide', {'required': True, 'retval': {'type': sel32or64(b'I', b'Q')}}) r(b'NSObject', b'textureTarget', {'required': True, 'retval': {'type': b'I'}}) r(b'NSObject', b'unbindTextureRepresentationFromCGLContext:textureUnit:', {'required': True, 'retval': {'type': b'v'}, 'arguments': {2: {'type': b'^{_CGLContextObject=}'}, 3: {'type': b'I'}}}) r(b'NSObject', b'unlockBufferRepresentation', {'required': True, 'retval': {'type': b'v'}}) r(b'NSObject', b'unlockTextureRepresentation', {'required': True, 'retval': {'type': b'v'}}) r(b'NSObject', b'userInfo', {'required': True, 'retval': {'type': b'@'}}) r(b'NSObject', b'userInfo', {'required': True, 'retval': {'type': b'@'}}) r(b'NSObject', b'valueForInputKey:', {'required': True, 'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'valueForOutputKey:', {'required': True, 'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'valueForOutputKey:ofType:', {'required': True, 'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) finally: objc._updatingMetadata(False) r = objc.registerMetaDataForSelector objc._updatingMetadata(True) try: r(b'NSObject', b'compositionParameterView:didChangeParameterWithKey:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'compositionParameterView:shouldDisplayParameterWithKey:attributes:', {'retval': {'type': b'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}, 4: {'type': b'@'}}}) r(b'NSObject', b'compositionPickerView:didSelectComposition:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'compositionPickerViewDidStartAnimating:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'compositionPickerViewWillStopAnimating:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) finally: objc._updatingMetadata(False) protocols={'QCCompositionPickerViewDelegate': objc.informal_protocol('QCCompositionPickerViewDelegate', [objc.selector(None, b'compositionPickerView:didSelectComposition:', b'v@:@@', isRequired=False), objc.selector(None, b'compositionPickerViewWillStopAnimating:', b'v@:@', isRequired=False), objc.selector(None, b'compositionPickerViewDidStartAnimating:', b'v@:@', isRequired=False)]), 'QCCompositionParameterViewDelegate': objc.informal_protocol('QCCompositionParameterViewDelegate', [objc.selector(None, b'compositionParameterView:didChangeParameterWithKey:', b'v@:@@', isRequired=False), objc.selector(None, b'compositionParameterView:shouldDisplayParameterWithKey:attributes:', b'Z@:@@@', isRequired=False)])} expressions = {} # END OF FILE
b"NSObject", b"feed:didRemoveEntriesWithIdentifiers:", {"retval": {"type": b"v"}, "arguments": {2: {"type": b"@"}, 3: {"type": b"@"}}}, ) r( b"NSObject", b"feed:didUpdateEntries:", {"retval": {"type": b"v"}, "arguments": {2: {"type": b"@"}, 3: {"type": b"@"}}}, ) r(b"NSObject", b"feedDidBeginRefresh:", {"retval": {"type": b"v"}, "arguments": {2: {"type": b"@"}}}) r(b"NSObject", b"feedDidEndRefresh:", {"retval": {"type": b"v"}, "arguments": {2: {"type": b"@"}}}) finally: objc._updatingMetadata(False) protocols = { "PSClientDelegate": objc.informal_protocol( "PSClientDelegate", [ objc.selector(None, b"feed:didUpdateEntries:", b"v@:@@", isRequired=False), objc.selector(None, b"feedDidBeginRefresh:", b"v@:@", isRequired=False), objc.selector(None, b"enclosure:downloadStateDidChange:", b"v@:@i", isRequired=False), objc.selector(None, b"feed:didRemoveEntriesWithIdentifiers:", b"v@:@@", isRequired=False), objc.selector(None, b"feedDidEndRefresh:", b"v@:@", isRequired=False), objc.selector(None, b"feed:didAddEntries:", b"v@:@@", isRequired=False), objc.selector(None, b"feed:didChangeFlagsInEntries:", b"v@:@@", isRequired=False), ], ) } expressions = {} # END OF FILE
import objc objc.loadBundle("WiiRemote", globals(), bundle_path="WiiRemote.framework") from Foundation import * from AppKit import * from PyObjCTools import AppHelper wd = WiiRemoteDiscovery.new().init() IRData = objc.createStructType("IRData", "iii", ["x", "y", "s"]) WiiRemoteDiscoveryDelegate = objc.informal_protocol( "WiiRemoteDiscoveryDelegate", [ objc.selector(None,selector="WiiRemoteDiscovered:",signature="v@:@",isRequired=0), objc.selector(None, selector="WiiRemoteDiscoveryError:",signature="v@:i",isRequired=0) ]) WiiRemoteDelegate = objc.informal_protocol( "WiiRemoteDelegate", [ objc.selector(None, selector="irPointMovedX:",signature="v@:ff@", isRequired=False), objc.selector(None, selector="rawIRData:",signature="v@:[4{IRData=iii}]@", isRequired=False), objc.selector(None, selector="buttonChanged:",signature="v@:Sc@", isRequired=False), objc.selector(None, selector="accelerationChanged:",signature="v@:SCCC@", isRequired=False), objc.selector(None, selector="joyStickChanged:",signature="v@:SCC@", isRequired=False), objc.selector(None, selector="analogButtonChanged:",signature="v@:SI@", isRequired=False), objc.selector(None, selector="wiiRemoteDisconnected:",signature="v@:@", isRequired=False), ])
_load(__name__, globals()) from Foundation import * from AppKit import * from hip_pos_display import * WiiRemoteDiscoveryDelegate = objc.informal_protocol( "WiiRemoteDiscoveryDelegate", [ # (void) WiiRemoteDiscovered:(WiiRemote*)wiimote; objc.selector( None, selector='WiiRemoteDiscovered:', signature='v@:@', isRequired=0, ), # (void) WiiRemoteDiscoveryError:(int)code; objc.selector( None, selector='WiiRemoteDiscoveryError:', signature='v@:i', isRequired=0, ), ] ) class wii_remote_discovery_delegate(NSObject): def WiiRemoteDiscovered_(self, wiiRemote): self.wiiRemote=wiiRemote print "discovered" def WiiRemoteDiscoveryError_(self, returnCode): print "not discovered"
b"NSObject", b"quartzFilterManager:didModifyFilter:", {"retval": {"type": b"v"}, "arguments": {2: {"type": b"@"}, 3: {"type": b"@"}}}, ) r( b"NSObject", b"quartzFilterManager:didRemoveFilter:", {"retval": {"type": b"v"}, "arguments": {2: {"type": b"@"}, 3: {"type": b"@"}}}, ) r( b"NSObject", b"quartzFilterManager:didSelectFilter:", {"retval": {"type": b"v"}, "arguments": {2: {"type": b"@"}, 3: {"type": b"@"}}}, ) finally: objc._updatingMetadata(False) protocols = { "QuartzFilterManagerDelegate": objc.informal_protocol( "QuartzFilterManagerDelegate", [ objc.selector(None, b"quartzFilterManager:didSelectFilter:", b"v@:@@", isRequired=False), objc.selector(None, b"quartzFilterManager:didAddFilter:", b"v@:@@", isRequired=False), objc.selector(None, b"quartzFilterManager:didModifyFilter:", b"v@:@@", isRequired=False), objc.selector(None, b"quartzFilterManager:didRemoveFilter:", b"v@:@@", isRequired=False), ], ) } expressions = {} # END OF FILE
r(b'AMBundleAction', b'hasView', {'retval': {'type': 'Z'}}) r(b'AMBundleAction', b'initWithDefinition:fromArchive:', {'arguments': {3: {'type': 'Z'}}}) r(b'AMShellScriptAction', b'remapLineEndings', {'retval': {'type': 'Z'}}) r(b'AMWorkflow', b'initWithContentsOfURL:error:', {'arguments': {3: {'type_modifier': b'o'}}}) r(b'AMWorkflow', b'runWorkflowAtURL:withInput:error:', {'arguments': {4: {'type_modifier': b'o'}}}) r(b'AMWorkflow', b'setValue:forVariableWithName:', {'retval': {'type': 'Z'}}) r(b'AMWorkflow', b'writeToURL:error:', {'retval': {'type': 'Z'}, 'arguments': {3: {'type_modifier': b'o'}}}) r(b'AMWorkflowController', b'canRun', {'retval': {'type': 'Z'}}) r(b'AMWorkflowController', b'isPaused', {'retval': {'type': 'Z'}}) r(b'AMWorkflowController', b'isRunning', {'retval': {'type': 'Z'}}) r(b'AMWorkflowView', b'isEditable', {'retval': {'type': 'Z'}}) r(b'AMWorkflowView', b'setEditable:', {'arguments': {2: {'type': 'Z'}}}) finally: objc._updatingMetadata(False) r = objc.registerMetaDataForSelector objc._updatingMetadata(True) try: r(b'NSObject', b'workflowController:didError:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'workflowController:didRunAction:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'workflowController:willRunAction:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'workflowControllerDidRun:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'workflowControllerDidStop:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'workflowControllerWillRun:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'workflowControllerWillStop:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) finally: objc._updatingMetadata(False) protocols={'AMWorkflowControllerDelegate': objc.informal_protocol('AMWorkflowControllerDelegate', [objc.selector(None, b'workflowControllerDidStop:', b'v@:@', isRequired=False), objc.selector(None, b'workflowControllerWillRun:', b'v@:@', isRequired=False), objc.selector(None, b'workflowController:willRunAction:', b'v@:@@', isRequired=False), objc.selector(None, b'workflowControllerDidRun:', b'v@:@', isRequired=False), objc.selector(None, b'workflowController:didRunAction:', b'v@:@@', isRequired=False), objc.selector(None, b'workflowControllerWillStop:', b'v@:@', isRequired=False), objc.selector(None, b'workflowController:didError:', b'v@:@@', isRequired=False)])} expressions = {} # END OF FILE
r(b"NSObject", b"documentDidBeginDocumentFind:", {"retval": {"type": b"v"}, "arguments": {2: {"type": b"@"}}}) r(b"NSObject", b"documentDidBeginPageFind:", {"retval": {"type": b"v"}, "arguments": {2: {"type": b"@"}}}) r(b"NSObject", b"documentDidEndDocumentFind:", {"retval": {"type": b"v"}, "arguments": {2: {"type": b"@"}}}) r(b"NSObject", b"documentDidEndPageFind:", {"retval": {"type": b"v"}, "arguments": {2: {"type": b"@"}}}) r(b"NSObject", b"documentDidFindMatch:", {"retval": {"type": b"v"}, "arguments": {2: {"type": b"@"}}}) r(b"NSObject", b"documentDidUnlock:", {"retval": {"type": b"v"}, "arguments": {2: {"type": b"@"}}}) finally: objc._updatingMetadata(False) protocols = { "PDFViewDelegate": objc.informal_protocol( "PDFViewDelegate", [ objc.selector(None, b"PDFViewWillClickOnLink:withURL:", b"v@:@@", isRequired=False), objc.selector(None, b"PDFViewOpenPDF:forRemoteGoToAction:", b"v@:@@", isRequired=False), objc.selector(None, b"PDFViewPerformFind:", b"v@:@", isRequired=False), objc.selector( None, b"PDFViewWillChangeScaleFactor:toScale:", sel32or64(b"f@:@f", b"d@:@d"), isRequired=False ), objc.selector(None, b"PDFViewPerformPrint:", b"v@:@", isRequired=False), objc.selector(None, b"PDFViewPrintJobTitle:", b"@@:@", isRequired=False), objc.selector(None, b"PDFViewPerformGoToPage:", b"v@:@", isRequired=False), ], ), "PDFDocumentDelegate": objc.informal_protocol( "PDFDocumentDelegate", [ objc.selector(None, b"classForPage", b"#@:", isRequired=False), objc.selector(None, b"classForAnnotationClass:", b"#@:#", isRequired=False), objc.selector(None, b"didMatchString:", b"v@:@", isRequired=False), ], ), "PDFDocumentNotifications": objc.informal_protocol(
def sel32or64(a, b): return a if sys.byteorder == 'little': def littleOrBig(a, b): return a else: def littleOrBig(a, b): return b misc = { } constants = '''$NSStackTraceKey$NSUncaughtRuntimeErrorException$NSUncaughtSystemExceptionException$''' enums = '''$NSHandleOtherExceptionMask@512$NSHandleTopLevelExceptionMask@128$NSHandleUncaughtExceptionMask@2$NSHandleUncaughtRuntimeErrorMask@32$NSHandleUncaughtSystemExceptionMask@8$NSHangOnOtherExceptionMask@16$NSHangOnTopLevelExceptionMask@8$NSHangOnUncaughtExceptionMask@1$NSHangOnUncaughtRuntimeErrorMask@4$NSHangOnUncaughtSystemExceptionMask@2$NSLogOtherExceptionMask@256$NSLogTopLevelExceptionMask@64$NSLogUncaughtExceptionMask@1$NSLogUncaughtRuntimeErrorMask@16$NSLogUncaughtSystemExceptionMask@4$''' misc.update({}) functions={'NSExceptionHandlerResume': (b'v',)} r = objc.registerMetaDataForSelector objc._updatingMetadata(True) try: r(b'NSObject', b'exceptionHandler:shouldHandleException:mask:', {'retval': {'type': 'Z'}}) r(b'NSObject', b'exceptionHandler:shouldLogException:mask:', {'retval': {'type': 'Z'}}) finally: objc._updatingMetadata(False) r = objc.registerMetaDataForSelector objc._updatingMetadata(True) try: r(b'NSObject', b'exceptionHandler:shouldHandleException:mask:', {'retval': {'type': 'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}, 4: {'type': sel32or64(b'I', b'Q')}}}) r(b'NSObject', b'exceptionHandler:shouldLogException:mask:', {'retval': {'type': 'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}, 4: {'type': sel32or64(b'I', b'Q')}}}) finally: objc._updatingMetadata(False) protocols={'NSExceptionHandlerDelegate': objc.informal_protocol('NSExceptionHandlerDelegate', [objc.selector(None, b'exceptionHandler:shouldLogException:mask:', sel32or64(b'Z@:@@I', b'Z@:@@Q'), isRequired=False), objc.selector(None, b'exceptionHandler:shouldHandleException:mask:', sel32or64(b'Z@:@@I', b'Z@:@@Q'), isRequired=False)])} expressions = {'NSHangOnEveryExceptionMask': '(NSHangOnUncaughtExceptionMask|NSHangOnUncaughtSystemExceptionMask|NSHangOnUncaughtRuntimeErrorMask|NSHangOnTopLevelExceptionMask|NSHangOnOtherExceptionMask)', 'NSLogAndHandleEveryExceptionMask': '(NSLogUncaughtExceptionMask|NSLogUncaughtSystemExceptionMask|NSLogUncaughtRuntimeErrorMask|NSHandleUncaughtExceptionMask|NSHandleUncaughtSystemExceptionMask|NSHandleUncaughtRuntimeErrorMask|NSLogTopLevelExceptionMask|NSHandleTopLevelExceptionMask|NSLogOtherExceptionMask|NSHandleOtherExceptionMask)'} # END OF FILE
'type': b'v' }, 'arguments': { 2: { 'type': b'@' } } }) finally: objc._updatingMetadata(False) protocols = { 'XGAuthenticatorDelegate': objc.informal_protocol('XGAuthenticatorDelegate', [ objc.selector(None, b'authenticatorDidNotAuthenticate:', b'v@:@', isRequired=False), objc.selector( None, b'authenticatorDidAuthenticate:', b'v@:@', isRequired=False) ]), 'XGFileDownloadDelegate': objc.informal_protocol('XGFileDownloadDelegate', [ objc.selector(None, b'fileDownload:decideDestinationWithSuggestedPath:', b'v@:@@', isRequired=False), objc.selector(None, b'fileDownload:didReceiveAttributes:', b'v@:@@', isRequired=False), objc.selector( None, b'fileDownloadDidFinish:', b'v@:@', isRequired=False),
r(b'XGActionMonitor', b'actionDidSucceed', {'retval': {'type': 'Z'}}) r(b'XGConnection', b'isClosed', {'retval': {'type': 'Z'}}) r(b'XGConnection', b'isOpened', {'retval': {'type': 'Z'}}) r(b'XGFileDownload', b'setDestination:allowOverwrite:', {'arguments': {3: {'type': 'Z'}}}) r(b'XGGrid', b'isDefault', {'retval': {'type': 'Z'}}) r(b'XGResource', b'isUpdated', {'retval': {'type': 'Z'}}) r(b'XGResource', b'isUpdating', {'retval': {'type': 'Z'}}) finally: objc._updatingMetadata(False) r = objc.registerMetaDataForSelector objc._updatingMetadata(True) try: r(b'NSObject', b'authenticatorDidAuthenticate:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'authenticatorDidNotAuthenticate:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'connectionDidClose:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'connectionDidNotOpen:withError:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'connectionDidOpen:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'fileDownload:decideDestinationWithSuggestedPath:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'fileDownload:didCreateDestination:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'fileDownload:didFailWithError:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'fileDownload:didReceiveAttributes:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'fileDownload:didReceiveData:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'fileDownloadDidBegin:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'fileDownloadDidFinish:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) finally: objc._updatingMetadata(False) protocols={'XGAuthenticatorDelegate': objc.informal_protocol('XGAuthenticatorDelegate', [objc.selector(None, b'authenticatorDidNotAuthenticate:', b'v@:@', isRequired=False), objc.selector(None, b'authenticatorDidAuthenticate:', b'v@:@', isRequired=False)]), 'XGFileDownloadDelegate': objc.informal_protocol('XGFileDownloadDelegate', [objc.selector(None, b'fileDownload:decideDestinationWithSuggestedPath:', b'v@:@@', isRequired=False), objc.selector(None, b'fileDownload:didReceiveAttributes:', b'v@:@@', isRequired=False), objc.selector(None, b'fileDownloadDidFinish:', b'v@:@', isRequired=False), objc.selector(None, b'fileDownload:didFailWithError:', b'v@:@@', isRequired=False), objc.selector(None, b'fileDownload:didReceiveData:', b'v@:@@', isRequired=False), objc.selector(None, b'fileDownloadDidBegin:', b'v@:@', isRequired=False), objc.selector(None, b'fileDownload:didCreateDestination:', b'v@:@@', isRequired=False)]), 'XGConnectionDelegate': objc.informal_protocol('XGConnectionDelegate', [objc.selector(None, b'connectionDidOpen:', b'v@:@', isRequired=False), objc.selector(None, b'connectionDidClose:', b'v@:@', isRequired=False), objc.selector(None, b'connectionDidNotOpen:withError:', b'v@:@@', isRequired=False)])} expressions = {} # END OF FILE
'arguments': { 2: { 'type': sel32or64(b'{_NSSize=ff}', b'{CGSize=dd}') } } }) finally: objc._updatingMetadata(False) protocols = { 'IKImageBrowserItem': objc.informal_protocol('IKImageBrowserItem', [ objc.selector(None, b'imageTitle', b'@@:', isRequired=False), objc.selector(None, b'imageSubtitle', b'@@:', isRequired=False), objc.selector( None, b'imageRepresentationType', b'@@:', isRequired=False), objc.selector(None, b'imageUID', b'@@:', isRequired=False), objc.selector(None, b'isSelectable', b'Z@:', isRequired=False), objc.selector( None, b'imageVersion', sel32or64(b'I@:', b'Q@:'), isRequired=False), objc.selector(None, b'imageRepresentation', b'@@:', isRequired=False) ]), 'IKImageBrowserDataSourceDeprecated': objc.informal_protocol('IKImageBrowserDataSourceDeprecated', [ objc.selector(None, b'imageBrowser:moveCellsAtIndexes:toIndex:', sel32or64(b'Z@:@@I', b'Z@:@@L'), isRequired=False), objc.selector(None, b'imageBrowser:cellAtIndex:', sel32or64(b'@@:@I', b'@@:@L'), isRequired=False),
r(b'IBPlugin', b'pasteboardObjectsForDraggedLibraryView:', {'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}}}) r(b'IBPlugin', b'preferencesView', {'retval': {'type': b'@'}}) r(b'IBPlugin', b'requiredFrameworks', {'retval': {'type': b'@'}}) r(b'IBPlugin', b'sharedInstance', {'retval': {'type': b'@'}}) r(b'IBPlugin', b'willUnload', {'retval': {'type': b'v'}}) r(b'NSObject', b'ibAwakeInDesignableDocument:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'ibDefaultChildren', {'retval': {'type': b'@'}}) r(b'NSObject', b'ibDefaultImage', {'retval': {'type': b'@'}}) r(b'NSObject', b'ibDefaultLabel', {'retval': {'type': b'@'}}) r(b'NSObject', b'ibDidAddToDesignableDocument:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'ibDidRemoveFromDesignableDocument:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'ibIsChildInitiallySelectable:', {'retval': {'type': b'Z'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'ibRemoveChildren:', {'retval': {'type': b'Z'}}) r(b'NSObject', b'ibIsChildViewUserMovable:', {'retval': {'type': b'Z'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'ibIsChildViewUserSizable:', {'retval': {'type': b'Z'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'ibObjectAtLocation:inWindowController:', {'retval': {'type': b'@'}, 'arguments': {2: {'type': sel32or64(b'{_NSPoint=ff}', b'{CGPoint=dd}')}, 3: {'type': b'@'}}}) r(b'NSObject', b'ibPopulateAttributeInspectorClasses:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'ibPopulateKeyPaths:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'ibRectForChild:inWindowController:', {'retval': {'type': sel32or64(b'{_NSRect={_NSPoint=ff}{_NSSize=ff}}', b'{CGRect={CGPoint=dd}{CGSize=dd}}')}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSView', b'ibBaselineAtIndex:', {'retval': {'type': b'f'}, 'arguments': {2: {'type': b'i'}}}) r(b'NSView', b'ibBaselineCount', {'retval': {'type': b'i'}}) r(b'NSView', b'ibDesignableContentView', {'retval': {'type': b'@'}}) r(b'NSView', b'ibLayoutInset', {'retval': {'type': b'{IBInsetTag=ffff}'}}) r(b'NSView', b'ibMaximumSize', {'retval': {'type': sel32or64(b'{_NSSize=ff}', b'{CGSize=dd}')}}) r(b'NSView', b'ibMinimumSize', {'retval': {'type': sel32or64(b'{_NSSize=ff}', b'{CGSize=dd}')}}) r(b'NSView', b'ibPreferredDesignSize', {'retval': {'type': sel32or64(b'{_NSSize=ff}', b'{CGSize=dd}')}}) r(b'NSView', b'ibPreferredResizeDirection', {'retval': {'type': b'i'}}) finally: objc._updatingMetadata(False) protocols={'IBObjectIntegration': objc.informal_protocol('IBObjectIntegration', [objc.selector(None, b'ibAwakeInDesignableDocument:', b'v@:@', isRequired=False), objc.selector(None, b'ibDefaultChildren', b'@@:', isRequired=False), objc.selector(None, b'ibDefaultImage', b'@@:', isRequired=False), objc.selector(None, b'ibDefaultLabel', b'@@:', isRequired=False), objc.selector(None, b'ibRemoveChildren:', b'Z@:@', isRequired=False), objc.selector(None, b'ibDidAddToDesignableDocument:', b'v@:@', isRequired=False), objc.selector(None, b'ibDidRemoveFromDesignableDocument:', b'v@:@', isRequired=False), objc.selector(None, b'ibIsChildInitiallySelectable:', b'Z@:@', isRequired=False), objc.selector(None, b'ibIsChildViewUserMovable:', b'Z@:@', isRequired=False), objc.selector(None, b'ibIsChildViewUserSizable:', b'Z@:@', isRequired=False), objc.selector(None, b'ibObjectAtLocation:inWindowController:', sel32or64(b'@@:{_NSPoint=ff}@', b'@@:{CGPoint=dd}@'), isRequired=False), objc.selector(None, b'ibPopulateAttributeInspectorClasses:', b'v@:@', isRequired=False), objc.selector(None, b'ibPopulateKeyPaths:', b'v@:@', isRequired=False), objc.selector(None, b'ibRectForChild:inWindowController:', sel32or64(b'{_NSRect={_NSPoint=ff}{_NSSize=ff}}@:@@', b'{CGRect={CGPoint=dd}{CGSize=dd}}@:@@'), isRequired=False)])}
r(b'PDFView', b'canGoToLastPage', {'retval': {'type': b'Z'}}) r(b'PDFView', b'canGoToNextPage', {'retval': {'type': b'Z'}}) r(b'PDFView', b'canGoToPreviousPage', {'retval': {'type': b'Z'}}) r(b'PDFView', b'canZoomIn', {'retval': {'type': b'Z'}}) r(b'PDFView', b'canZoomOut', {'retval': {'type': b'Z'}}) r(b'PDFView', b'displaysAsBook', {'retval': {'type': b'Z'}}) r(b'PDFView', b'displaysPageBreaks', {'retval': {'type': b'Z'}}) r(b'PDFView', b'displaysRTL', {'retval': {'type': 'Z'}}) r(b'PDFView', b'enableDataDetectors', {'retval': {'type': b'Z'}}) r(b'PDFView', b'enablePageShadows:', {'arguments': {2: {'type': b'Z'}}}) r(b'PDFView', b'pageForPoint:nearest:', {'arguments': {3: {'type': b'Z'}}}) r(b'PDFView', b'pageShadowsEnabled', {'retval': {'type': b'Z'}}) r(b'PDFView', b'printWithInfo:autoRotate:', {'arguments': {3: {'type': b'Z'}}}) r(b'PDFView', b'printWithInfo:autoRotate:pageScaling:', {'arguments': {3: {'type': b'Z'}}}) r(b'PDFView', b'setAcceptsDraggedFiles:', {'arguments': {2: {'type': 'Z'}}}) r(b'PDFView', b'setAllowsDragging:', {'arguments': {2: {'type': b'Z'}}}) r(b'PDFView', b'setAutoScales:', {'arguments': {2: {'type': b'Z'}}}) r(b'PDFView', b'setCurrentSelection:animate:', {'arguments': {3: {'type': b'Z'}}}) r(b'PDFView', b'setDisplaysAsBook:', {'arguments': {2: {'type': b'Z'}}}) r(b'PDFView', b'setDisplaysPageBreaks:', {'arguments': {2: {'type': b'Z'}}}) r(b'PDFView', b'setDisplaysRTL:', {'arguments': {2: {'type': 'Z'}}}) r(b'PDFView', b'setEnableDataDetectors:', {'arguments': {2: {'type': b'Z'}}}) r(b'PDFView', b'setShouldAntiAlias:', {'arguments': {2: {'type': b'Z'}}}) r(b'PDFView', b'shouldAntiAlias', {'retval': {'type': b'Z'}}) finally: objc._updatingMetadata(False) protocols={'PDFViewDelegate': objc.informal_protocol('PDFViewDelegate', [objc.selector(None, b'PDFViewWillClickOnLink:withURL:', b'v@:@@', isRequired=False), objc.selector(None, b'PDFViewOpenPDF:forRemoteGoToAction:', b'v@:@@', isRequired=False), objc.selector(None, b'PDFViewPerformFind:', b'v@:@', isRequired=False), objc.selector(None, b'PDFViewWillChangeScaleFactor:toScale:', sel32or64(b'f@:@f', b'd@:@d'), isRequired=False), objc.selector(None, b'PDFViewPerformPrint:', b'v@:@', isRequired=False), objc.selector(None, b'PDFViewPrintJobTitle:', b'@@:@', isRequired=False), objc.selector(None, b'PDFViewPerformGoToPage:', b'v@:@', isRequired=False)]), 'PDFDocumentDelegate': objc.informal_protocol('PDFDocumentDelegate', [objc.selector(None, b'classForPage', b'#@:', isRequired=False), objc.selector(None, b'classForAnnotationClass:', b'#@:#', isRequired=False), objc.selector(None, b'didMatchString:', b'v@:@', isRequired=False)]), 'PDFDocumentNotifications': objc.informal_protocol('PDFDocumentNotifications', [objc.selector(None, b'documentDidFindMatch:', b'v@:@', isRequired=False), objc.selector(None, b'documentDidBeginPageFind:', b'v@:@', isRequired=False), objc.selector(None, b'documentDidBeginDocumentFind:', b'v@:@', isRequired=False), objc.selector(None, b'documentDidUnlock:', b'v@:@', isRequired=False), objc.selector(None, b'documentDidEndPageFind:', b'v@:@', isRequired=False), objc.selector(None, b'documentDidEndDocumentFind:', b'v@:@', isRequired=False)])} expressions = {} # END OF FILE
finally: objc._updatingMetadata(False) r = objc.registerMetaDataForSelector objc._updatingMetadata(True) try: r(b'NSObject', b'numberOfPreviewItemsInPreviewPanel:', {'required': True, 'retval': {'type': sel32or64(b'i', b'l')}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'previewItemDisplayState', {'retval': {'type': b'@'}}) r(b'NSObject', b'previewItemTitle', {'retval': {'type': b'@'}}) r(b'NSObject', b'previewItemURL', {'retval': {'type': b'@'}}) r(b'NSObject', b'previewPanel:handleEvent:', {'required': False, 'retval': {'type': b'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'previewPanel:previewItemAtIndex:', {'required': True, 'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}, 3: {'type': sel32or64(b'i', b'l')}}}) r(b'NSObject', b'previewPanel:sourceFrameOnScreenForPreviewItem:', {'required': False, 'retval': {'type': sel32or64(b'{_NSRect={_NSPoint=ff}{_NSSize=ff}}', b'{CGRect={CGPoint=dd}{CGSize=dd}}')}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'previewPanel:transitionImageForPreviewItem:contentRect:', {'required': False, 'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}, 4: {'type': sel32or64(b'^{_NSRect={_NSPoint=ff}{_NSSize=ff}}', b'^{CGRect={CGPoint=dd}{CGSize=dd}}')}}}) r(b'NSObject', b'setPreviewItemDisplayState:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'setPreviewItemTitle:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'setPreviewItemURL:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) finally: objc._updatingMetadata(False) r = objc.registerMetaDataForSelector objc._updatingMetadata(True) try: r(b'NSObject', b'acceptsPreviewPanelControl:', {'retval': {'type': b'Z'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'beginPreviewPanelControl:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'endPreviewPanelControl:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) finally: objc._updatingMetadata(False) protocols={'QLPreviewPanelController': objc.informal_protocol('QLPreviewPanelController', [objc.selector(None, b'beginPreviewPanelControl:', b'v@:@', isRequired=False), objc.selector(None, b'acceptsPreviewPanelControl:', b'Z@:@', isRequired=False), objc.selector(None, b'endPreviewPanelControl:', b'v@:@', isRequired=False)])} expressions = {} # END OF FILE
r(b'NSObject', b'imageBrowser:backgroundWasRightClickedWithEvent:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'imageBrowser:cellAtIndex:', {'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}, 3: {'type': sel32or64(b'I', b'L')}}}) r(b'NSObject', b'imageBrowser:cellWasDoubleClickedAtIndex:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': sel32or64(b'I', b'L')}}}) r(b'NSObject', b'imageBrowser:cellWasRightClickedAtIndex:withEvent:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': sel32or64(b'I', b'L')}, 4: {'type': b'@'}}}) r(b'NSObject', b'imageBrowser:groupAtIndex:', {'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}, 3: {'type': sel32or64(b'I', b'L')}}}) r(b'NSObject', b'imageBrowser:itemAtIndex:', {'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}, 3: {'type': sel32or64(b'I', b'L')}}}) r(b'NSObject', b'imageBrowser:moveCellsAtIndexes:toIndex:', {'retval': {'type': b'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}, 4: {'type': sel32or64(b'I', b'L')}}}) r(b'NSObject', b'imageBrowser:moveItemsAtIndexes:toIndex:', {'retval': {'type': b'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}, 4: {'type': sel32or64(b'I', b'L')}}}) r(b'NSObject', b'imageBrowser:removeCellsAtIndexes:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'imageBrowser:removeItemsAtIndexes:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'imageBrowser:writeCellsAtIndexes:toPasteboard:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}, 4: {'type': b'@'}}}) r(b'NSObject', b'imageBrowser:writeItemsAtIndexes:toPasteboard:', {'retval': {'type': sel32or64(b'I', b'L')}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}, 4: {'type': b'@'}}}) r(b'NSObject', b'imageBrowserSelectionDidChange:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'imageRepresentation', {'retval': {'type': b'@'}}) r(b'NSObject', b'imageRepresentationType', {'retval': {'type': b'@'}}) r(b'NSObject', b'imageSubtitle', {'retval': {'type': b'@'}}) r(b'NSObject', b'imageTitle', {'retval': {'type': b'@'}}) r(b'NSObject', b'imageUID', {'retval': {'type': b'@'}}) r(b'NSObject', b'imageVersion', {'retval': {'type': sel32or64(b'I', b'L')}}) r(b'NSObject', b'isSelectable', {'retval': {'type': b'Z'}}) r(b'NSObject', b'numberOfCellsInImageBrowser:', {'retval': {'type': sel32or64(b'I', b'L')}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'numberOfGroupsInImageBrowser:', {'retval': {'type': sel32or64(b'I', b'L')}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'numberOfItemsInImageBrowser:', {'retval': {'type': sel32or64(b'I', b'L')}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'saveOptions:shouldShowUTType:', {'retval': {'type': b'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) finally: objc._updatingMetadata(False) protocols={'IKImageBrowserItem': objc.informal_protocol('IKImageBrowserItem', [objc.selector(None, b'imageTitle', b'@@:', isRequired=False), objc.selector(None, b'imageSubtitle', b'@@:', isRequired=False), objc.selector(None, b'imageRepresentationType', b'@@:', isRequired=False), objc.selector(None, b'imageUID', b'@@:', isRequired=False), objc.selector(None, b'isSelectable', b'Z@:', isRequired=False), objc.selector(None, b'imageVersion', sel32or64(b'I@:', b'L@:'), isRequired=False), objc.selector(None, b'imageRepresentation', b'@@:', isRequired=False)]), 'IKImageBrowserDataSourceDeprecated': objc.informal_protocol('IKImageBrowserDataSourceDeprecated', [objc.selector(None, b'imageBrowser:moveCellsAtIndexes:toIndex:', sel32or64(b'Z@:@@I', b'Z@:@@L'), isRequired=False), objc.selector(None, b'imageBrowser:cellAtIndex:', sel32or64(b'@@:@I', b'@@:@L'), isRequired=False), objc.selector(None, b'numberOfCellsInImageBrowser:', sel32or64(b'I@:@', b'L@:@'), isRequired=False), objc.selector(None, b'imageBrowser:writeCellsAtIndexes:toPasteboard:', b'v@:@@@', isRequired=False), objc.selector(None, b'imageBrowser:removeCellsAtIndexes:', b'v@:@@', isRequired=False)]), 'IKSaveOptionsDelegate': objc.informal_protocol('IKSaveOptionsDelegate', [objc.selector(None, b'saveOptions:shouldShowUTType:', b'Z@:@@', isRequired=False)]), 'IKImageBrowserDelegate': objc.informal_protocol('IKImageBrowserDelegate', [objc.selector(None, b'imageBrowser:cellWasRightClickedAtIndex:withEvent:', sel32or64(b'v@:@I@', b'v@:@L@'), isRequired=False), objc.selector(None, b'imageBrowserSelectionDidChange:', b'v@:@', isRequired=False), objc.selector(None, b'imageBrowser:cellWasDoubleClickedAtIndex:', sel32or64(b'v@:@I', b'v@:@L'), isRequired=False), objc.selector(None, b'imageBrowser:backgroundWasRightClickedWithEvent:', b'v@:@@', isRequired=False)]), 'IKImageBrowserDataSource': objc.informal_protocol('IKImageBrowserDataSource', [objc.selector(None, b'imageBrowser:groupAtIndex:', sel32or64(b'@@:@I', b'@@:@L'), isRequired=False), objc.selector(None, b'numberOfItemsInImageBrowser:', sel32or64(b'I@:@', b'L@:@'), isRequired=False), objc.selector(None, b'imageBrowser:moveItemsAtIndexes:toIndex:', sel32or64(b'Z@:@@I', b'Z@:@@L'), isRequired=False), objc.selector(None, b'numberOfGroupsInImageBrowser:', sel32or64(b'I@:@', b'L@:@'), isRequired=False), objc.selector(None, b'imageBrowser:itemAtIndex:', sel32or64(b'@@:@I', b'@@:@L'), isRequired=False), objc.selector(None, b'imageBrowser:removeItemsAtIndexes:', b'v@:@@', isRequired=False), objc.selector(None, b'imageBrowser:writeItemsAtIndexes:toPasteboard:', sel32or64(b'I@:@@@', b'L@:@@@'), isRequired=False)])} expressions = {} # END OF FILE
protocols = { "IMVideoDataSource": objc.informal_protocol( "IMVideoDataSource", [ objc.selector( None, b"renderIntoPixelBuffer:forTime:", sel32or64( b"Z@:^{__CVBuffer=}^{_CVTimeStamp=IiqQdq{CVSMPTETime=ssLLLssss}QQ}", b"Z@:^{__CVBuffer=}^{_CVTimeStamp=IiqQdq{CVSMPTETime=ssIIIssss}QQ}", ), isRequired=False, ), objc.selector(None, b"getPixelBufferPixelFormat:", b"v@:^I", isRequired=False), objc.selector( None, b"getOpenGLBufferContext:pixelFormat:", b"v@:^^{_CGLContextObject=}^^{_CGLPixelFormatObject=}", isRequired=False, ), objc.selector( None, b"renderIntoOpenGLBuffer:onScreen:forTime:", sel32or64( b"Z@:^{__CVBuffer=}^i^{_CVTimeStamp=IiqQdq{CVSMPTETime=ssLLLssss}QQ}", b"Z@:^{__CVBuffer=}^i^{_CVTimeStamp=IiqQdq{CVSMPTETime=ssIIIssss}QQ}", ), isRequired=False, ), ], ) }
}, }, ) finally: objc._updatingMetadata(False) protocols = { "NSExceptionHandlerDelegate": objc.informal_protocol( "NSExceptionHandlerDelegate", [ objc.selector( None, b"exceptionHandler:shouldLogException:mask:", sel32or64(b"Z@:@@I", b"Z@:@@Q"), isRequired=False, ), objc.selector( None, b"exceptionHandler:shouldHandleException:mask:", sel32or64(b"Z@:@@I", b"Z@:@@Q"), isRequired=False, ), ], ) } expressions = { "NSHangOnEveryExceptionMask": "(NSHangOnUncaughtExceptionMask|NSHangOnUncaughtSystemExceptionMask|NSHangOnUncaughtRuntimeErrorMask|NSHangOnTopLevelExceptionMask|NSHangOnOtherExceptionMask)", "NSLogAndHandleEveryExceptionMask": "(NSLogUncaughtExceptionMask|NSLogUncaughtSystemExceptionMask|NSLogUncaughtRuntimeErrorMask|NSHandleUncaughtExceptionMask|NSHandleUncaughtSystemExceptionMask|NSHandleUncaughtRuntimeErrorMask|NSLogTopLevelExceptionMask|NSHandleTopLevelExceptionMask|NSLogOtherExceptionMask|NSHandleOtherExceptionMask)", }
try: r(b'NSObject', b'attributedStringForIdentityPropertiesWithNames:inRecord:comparisonRecords:firstLineAttributes:secondLineAttributes:', {'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}, 4: {'type': b'@'}, 5: {'type': b'@'}, 6: {'type': b'@'}}}) r(b'NSObject', b'attributedStringForPropertiesWithNames:inRecord:comparisonRecords:defaultAttributes:', {'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}, 4: {'type': b'@'}, 5: {'type': b'@'}}}) r(b'NSObject', b'changedRecordsForEntityName:moreComing:error:', {'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}, 3: {'type': '^Z', 'type_modifier': b'o'}, 4: {'type': '^@', 'type_modifier': b'o'}}}) r(b'NSObject', b'changesForEntityName:moreComing:error:', {'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}, 3: {'type': '^Z', 'type_modifier': b'o'}, 4: {'type': '^@', 'type_modifier': b'o'}}}) r(b'NSObject', b'entityNamesToPull', {'retval': {'type': b'@'}}) r(b'NSObject', b'entityNamesToSync', {'retval': {'type': b'@'}}) r(b'NSObject', b'identifiersForRecordsToDeleteForEntityName:moreComing:error:', {'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}, 3: {'type': '^Z', 'type_modifier': b'o'}, 4: {'type': '^@', 'type_modifier': b'o'}}}) r(b'NSObject', b'lastAnchorForEntityName:', {'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'nextAnchorForEntityName:', {'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'sessionBeginTimeout', {'retval': {'type': b'd'}}) r(b'NSObject', b'sessionDriver:didNegotiateAndReturnError:', {'retval': {'type': 'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': '^@', 'type_modifier': b'o'}}}) r(b'NSObject', b'sessionDriver:didPullAndReturnError:', {'retval': {'type': 'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': '^@', 'type_modifier': b'o'}}}) r(b'NSObject', b'sessionDriver:didPushAndReturnError:', {'retval': {'type': 'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': '^@', 'type_modifier': b'o'}}}) r(b'NSObject', b'sessionDriver:didReceiveSyncAlertAndReturnError:', {'retval': {'type': 'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': '^@', 'type_modifier': b'o'}}}) r(b'NSObject', b'sessionDriver:didRegisterClientAndReturnError:', {'retval': {'type': 'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': '^@', 'type_modifier': b'o'}}}) r(b'NSObject', b'sessionDriver:willFinishSessionAndReturnError:', {'retval': {'type': 'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': '^@', 'type_modifier': b'o'}}}) r(b'NSObject', b'sessionDriver:willNegotiateAndReturnError:', {'retval': {'type': 'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': '^@', 'type_modifier': b'o'}}}) r(b'NSObject', b'sessionDriver:willPullAndReturnError:', {'retval': {'type': 'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': '^@', 'type_modifier': b'o'}}}) r(b'NSObject', b'sessionDriver:willPushAndReturnError:', {'retval': {'type': 'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': '^@', 'type_modifier': b'o'}}}) r(b'NSObject', b'sessionDriverDidCancelSession:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'sessionDriverDidFinishSession:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'sessionDriverWillCancelSession:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'sessionPullChangesTimeout', {'retval': {'type': b'd'}}) finally: objc._updatingMetadata(False) protocols={'ISyncSessionDriverDelegate': objc.informal_protocol('ISyncSessionDriverDelegate', [objc.selector(None, b'sessionDriver:willPullAndReturnError:', b'Z@:@^@', isRequired=False), objc.selector(None, b'sessionDriver:willPushAndReturnError:', b'Z@:@^@', isRequired=False), objc.selector(None, b'sessionDriver:didRegisterClientAndReturnError:', b'Z@:@^@', isRequired=False), objc.selector(None, b'sessionDriver:willFinishSessionAndReturnError:', b'Z@:@^@', isRequired=False), objc.selector(None, b'sessionDriver:willNegotiateAndReturnError:', b'Z@:@^@', isRequired=False), objc.selector(None, b'sessionDriver:didPullAndReturnError:', b'Z@:@^@', isRequired=False), objc.selector(None, b'sessionDriverDidFinishSession:', b'v@:@', isRequired=False), objc.selector(None, b'sessionDriver:didNegotiateAndReturnError:', b'Z@:@^@', isRequired=False), objc.selector(None, b'sessionDriver:didPushAndReturnError:', b'Z@:@^@', isRequired=False), objc.selector(None, b'sessionDriver:didReceiveSyncAlertAndReturnError:', b'Z@:@^@', isRequired=False), objc.selector(None, b'sessionDriverWillCancelSession:', b'v@:@', isRequired=False), objc.selector(None, b'sessionDriverDidCancelSession:', b'v@:@', isRequired=False)]), 'ISyncSessionDriverDataSourceOptionalMethods': objc.informal_protocol('ISyncSessionDriverDataSourceOptionalMethods', [objc.selector(None, b'entityNamesToSync', b'@@:', isRequired=False), objc.selector(None, b'sessionPullChangesTimeout', b'd@:', isRequired=False), objc.selector(None, b'sessionBeginTimeout', b'd@:', isRequired=False), objc.selector(None, b'nextAnchorForEntityName:', b'@@:@', isRequired=False), objc.selector(None, b'changesForEntityName:moreComing:error:', b'@@:@^Z^@', isRequired=False), objc.selector(None, b'changedRecordsForEntityName:moreComing:error:', b'@@:@^Z^@', isRequired=False), objc.selector(None, b'identifiersForRecordsToDeleteForEntityName:moreComing:error:', b'@@:@^Z^@', isRequired=False), objc.selector(None, b'entityNamesToPull', b'@@:', isRequired=False), objc.selector(None, b'lastAnchorForEntityName:', b'@@:@', isRequired=False)]), 'SyncUIHelperInformalProtocol': objc.informal_protocol('SyncUIHelperInformalProtocol', [objc.selector(None, b'attributedStringForIdentityPropertiesWithNames:inRecord:comparisonRecords:firstLineAttributes:secondLineAttributes:', b'@@:@@@@@', isRequired=False), objc.selector(None, b'attributedStringForPropertiesWithNames:inRecord:comparisonRecords:defaultAttributes:', b'@@:@@@@', isRequired=False)])} expressions = {} # END OF FILE
from PyObjCTools.TestSupport import * from PyObjCTest.protocol import OC_TestProtocol import objc import warnings import platform import sys # Most useful systems will at least have 'NSObject'. NSObject = objc.lookUpClass('NSObject') MyProto3 = objc.informal_protocol("MyProto3", ( objc.selector(None, selector=b"testMethod", signature=b"I@:", isRequired=1), objc.selector(None, selector=b"testMethod2:", signature=b"v@:i", isRequired=0) )) class Test3InformalProtocols(TestCase): def testOptional(self): class ProtoClass3 (NSObject, protocols=[MyProto3]): def testMethod(self): pass if (sys.maxsize < 2 ** 32) or (platform.mac_ver()[0] >= '10.7'): EmptyProtocol3 = objc.formal_protocol("EmptyProtocol3", None, ()) MyProtocol3 = objc.formal_protocol("MyProtocol3", None, ( objc.selector(None, selector=b"protoMethod", signature=b"I@:"),
l.append(1 + i * i) l.append(-4 - i * i * i) self.assertEqual(a[0], l[0]) self.assertEqual(a[1], l[1]) self.assertEqual(a[2], l[2]) self.assertEqual(a[3], l[3]) self.assertEqual(a[4], l[4]) self.assertEqual(a[5], l[5]) self.assertEqual(a[6], l[6]) self.assertEqual(a[7], l[7]) StructArrayDelegate = objc.informal_protocol( "ArrayDelegate", [ objc.selector(None, b"arrayOf4Ints:", signature=b"@@:[4i]", isRequired=0), objc.selector(None, b"arrayOf4IntsOut:", signature=b"v@:o[4i]", isRequired=False), objc.selector(None, b"arrayOf4Structs:", signature=b"@@:[4{FooStruct=ii}]", isRequired=False), objc.selector(None, b"arrayOf4StructsOut:", signature=b"v@:o[4{FooStruct=ii}]", isRequired=False), ] ) class OC_TestArrayInt_In (NSObject): def arrayOf4Ints_(self, array): return array class OC_TestArrayInt_Out (NSObject): def arrayOf4IntsOut_(self, array): if array is None: return [ 99, 100, 98, 101 ] class OC_TestArrayStruct_Out (NSObject):
objc.informal_protocol('IBObjectIntegration', [ objc.selector( None, 'ibAwakeInDesignableDocument:', 'v@:@', isRequired=False), objc.selector(None, 'ibDefaultChildren', '@@:', isRequired=False), objc.selector(None, 'ibDefaultImage', '@@:', isRequired=False), objc.selector(None, 'ibDefaultLabel', '@@:', isRequired=False), objc.selector(None, 'ibRemoveChildren:', 'Z@:@', isRequired=False), objc.selector( None, 'ibDidAddToDesignableDocument:', 'v@:@', isRequired=False), objc.selector(None, 'ibDidRemoveFromDesignableDocument:', 'v@:@', isRequired=False), objc.selector( None, 'ibIsChildInitiallySelectable:', 'Z@:@', isRequired=False), objc.selector( None, 'ibIsChildViewUserMovable:', 'Z@:@', isRequired=False), objc.selector( None, 'ibIsChildViewUserSizable:', 'Z@:@', isRequired=False), objc.selector(None, 'ibObjectAtLocation:inWindowController:', sel32or64('@@:{_NSPoint=ff}@', '@@:{CGPoint=dd}@'), isRequired=False), objc.selector(None, 'ibPopulateAttributeInspectorClasses:', 'v@:@', isRequired=False), objc.selector(None, 'ibPopulateKeyPaths:', 'v@:@', isRequired=False), objc.selector(None, 'ibRectForChild:inWindowController:', sel32or64('{_NSRect={_NSPoint=ff}{_NSSize=ff}}@:@@', '{CGRect={CGPoint=dd}{CGSize=dd}}@:@@'), isRequired=False) ])
def parseBridgeSupport(xmldata, globals, frameworkName, dylib_path=None, inlineTab=None): if dylib_path: lib = ctypes.cdll.LoadLibrary(dylib_path) _libraries.append(lib) objc._updatingMetadata(True) try: prs = _BridgeSupportParser(xmldata, frameworkName) globals.update(prs.values) for entry in prs.cftypes: tp = objc.registerCFSignature(*entry) globals[entry[0]] = tp for name, typestr in prs.opaque: globals[name] = objc.createOpaquePointerType(name, typestr) for name, typestr, alias in prs.structs: if alias is not None: globals[name] = alias objc.createStructAlias(name, typestr, alias) else: globals[name] = value = objc.createStructType(name, typestr, None) for name, typestr, magic in prs.constants: try: value = objc._loadConstant(name, typestr, magic) except AttributeError: continue globals[name] = value for class_name, sel_name, is_class in prs.meta: objc.registerMetaDataForSelector(class_name, sel_name, prs.meta[(class_name, sel_name, is_class)]) for name, method_list in prs.informal_protocols: proto = objc.informal_protocol(name, method_list) # XXX: protocols submodule should be deprecated if "protocols" not in globals: mod_name = "%s.protocols"%(frameworkName,) m = globals["protocols"] = type(objc)(mod_name) sys.modules[mod_name] = m else: m = globals["protocols"] setattr(m, name, proto) if prs.functions: objc.loadBundleFunctions(None, globals, prs.functions) if inlineTab is not None: objc.loadFunctionList(inlineTab, globals, prs.functions) for name, orig in prs.func_aliases: try: globals[name] = globals[orig] except KeyError: pass finally: objc._updatingMetadata(False)
MGScopeBarDataSource = objc.informal_protocol( "MGScopeBarDataSource", [ objc.selector( None, selector="numberOfGroupsInScopeBar:", signature="i@:@", isRequired=1, ), objc.selector( None, selector="scopeBar:itemIdentifiersForGroup:", signature="@@:@i", isRequired=1, ), objc.selector( None, selector="scopeBar:labelForGroup:", signature="@@:@i", isRequired=1, ), objc.selector( None, selector="scopeBar:selectionModeForGroup:", signature="i@:@i", isRequired=1, ), objc.selector( None, selector="scopeBar:titleOfItem:inGroup:", signature="@@:@@i", isRequired=1, ), objc.selector( None, selector="scopeBar:showSeparatorBeforeGroup:", signature="B@:@i", isRequired=0, ), objc.selector( None, selector="scopeBar:imageForItem:inGroup:", signature="@@:@@i", isRequired=0, ), objc.selector( None, selector="accessoryViewForScopeBar:", signature="@@:@", isRequired=0, ), ] )
}, 'arguments': { 2: { 'type': b'@' } } }) finally: objc._updatingMetadata(False) protocols = { 'IMKServerInput': objc.informal_protocol('IMKServerInput', [ objc.selector(None, b'inputText:client:', b'Z@:@@', isRequired=False), objc.selector(None, b'candidates:', b'@@:@', isRequired=False), objc.selector( None, b'didCommandBySelector:client:', b'Z@::@', isRequired=False), objc.selector(None, b'handleEvent:client:', b'Z@:@@', isRequired=False), objc.selector(None, b'composedString:', b'@@:@', isRequired=False), objc.selector(None, b'inputText:key:modifiers:client:', sel32or64(b'Z@:@iI@', b'Z@:@qQ@'), isRequired=False), objc.selector(None, b'commitComposition:', b'v@:@', isRequired=False), objc.selector(None, b'originalString:', b'@@:@', isRequired=False) ]) } expressions = {} # END OF FILE
r(b'NSObject', b'setBeginTime:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'd'}}}) r(b'NSObject', b'setDuration:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'd'}}}) r(b'NSObject', b'setFillMode:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'setRepeatCount:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'f'}}}) r(b'NSObject', b'setRepeatDuration:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'd'}}}) r(b'NSObject', b'setSpeed:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'f'}}}) r(b'NSObject', b'setTimeOffset:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'd'}}}) r(b'NSObject', b'speed', {'retval': {'type': b'f'}}) r(b'NSObject', b'timeOffset', {'retval': {'type': b'd'}}) finally: objc._updatingMetadata(False) r = objc.registerMetaDataForSelector objc._updatingMetadata(True) try: r(b'NSObject', b'actionForLayer:forKey:', {'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'animationDidStart:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'animationDidStop:finished:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'Z'}}}) r(b'NSObject', b'displayLayer:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'drawLayer:inContext:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'^{CGContext=}'}}}) r(b'NSObject', b'invalidateLayoutOfLayer:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'layoutSublayersOfLayer:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'layoutSublayersOfLayer:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'preferredSizeOfLayer:', {'retval': {'type': sel32or64(b'{CGSize=ff}', b'{CGSize=dd}')}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'provideImageData:bytesPerRow:origin::size::userInfo:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'^v', 'type_modifier': b'o', 'c_array_of_variable_length': True}, 3: {'type': b'L'}, 4: {'type': b'L'}, 5: {'type': b'L'}, 6: {'type': b'L'}, 7: {'type': b'L'}, 8: {'type': b'@'}}}) finally: objc._updatingMetadata(False) protocols={'CAAnimationDelegate': objc.informal_protocol('CAAnimationDelegate', [objc.selector(None, b'animationDidStart:', b'v@:@', isRequired=False), objc.selector(None, b'animationDidStop:finished:', b'v@:@Z', isRequired=False)]), 'CALayerDelegate': objc.informal_protocol('CALayerDelegate', [objc.selector(None, b'drawLayer:inContext:', b'v@:@^{CGContext=}', isRequired=False), objc.selector(None, b'actionForLayer:forKey:', b'@@:@@', isRequired=False), objc.selector(None, b'displayLayer:', b'v@:@', isRequired=False), objc.selector(None, b'layoutSublayersOfLayer:', b'v@:@', isRequired=False)]), 'CIImageProvider': objc.informal_protocol('CIImageProvider', [objc.selector(None, b'provideImageData:bytesPerRow:origin::size::userInfo:', b'v@:^vLLLLL@', isRequired=False)]), 'CALayoutManager': objc.informal_protocol('CALayoutManager', [objc.selector(None, b'preferredSizeOfLayer:', sel32or64(b'{CGSize=ff}@:@', b'{CGSize=dd}@:@'), isRequired=False), objc.selector(None, b'layoutSublayersOfLayer:', b'v@:@', isRequired=False), objc.selector(None, b'invalidateLayoutOfLayer:', b'v@:@', isRequired=False)])} expressions = {} # END OF FILE
} } }) finally: objc._updatingMetadata(False) protocols = { 'PSClientDelegate': objc.informal_protocol('PSClientDelegate', [ objc.selector( None, b'feed:didUpdateEntries:', b'v@:@@', isRequired=False), objc.selector(None, b'feedDidBeginRefresh:', b'v@:@', isRequired=False), objc.selector(None, b'enclosure:downloadStateDidChange:', b'v@:@i', isRequired=False), objc.selector(None, b'feed:didRemoveEntriesWithIdentifiers:', b'v@:@@', isRequired=False), objc.selector(None, b'feedDidEndRefresh:', b'v@:@', isRequired=False), objc.selector(None, b'feed:didAddEntries:', b'v@:@@', isRequired=False), objc.selector( None, b'feed:didChangeFlagsInEntries:', b'v@:@@', isRequired=False) ]) } expressions = {} # END OF FILE
try: r(b'NSObject', b'activateServer:', {'required': True, 'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'deactivateServer:', {'required': True, 'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'modes:', {'required': True, 'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'mouseDownOnCharacterIndex:coordinate:withModifier:continueTracking:client:', {'required': True, 'retval': {'type': 'Z'}, 'arguments': {2: {'type': sel32or64(b'I', b'Q')}, 3: {'type': sel32or64(b'{_NSPoint=ff}', b'{CGPoint=dd}')}, 4: {'type': sel32or64(b'I', b'Q')}, 5: {'type': '^Z', 'type_modifier': b'o'}, 6: {'type': b'@'}}}) r(b'NSObject', b'mouseMovedOnCharacterIndex:coordinate:withModifier:client:', {'required': True, 'retval': {'type': 'Z'}, 'arguments': {2: {'type': sel32or64(b'I', b'Q')}, 3: {'type': sel32or64(b'{_NSPoint=ff}', b'{CGPoint=dd}')}, 4: {'type': sel32or64(b'I', b'Q')}, 5: {'type': b'@'}}}) r(b'NSObject', b'mouseUpOnCharacterIndex:coordinate:withModifier:client:', {'required': True, 'retval': {'type': 'Z'}, 'arguments': {2: {'type': sel32or64(b'I', b'Q')}, 3: {'type': sel32or64(b'{_NSPoint=ff}', b'{CGPoint=dd}')}, 4: {'type': sel32or64(b'I', b'Q')}, 5: {'type': b'@'}}}) r(b'NSObject', b'recognizedEvents:', {'required': True, 'retval': {'type': sel32or64(b'I', b'Q')}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'setValue:forTag:client:', {'required': True, 'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}, 3: {'type': sel32or64(b'l', b'q')}, 4: {'type': b'@'}}}) r(b'NSObject', b'showPreferences:', {'required': True, 'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'valueForTag:client:', {'required': True, 'retval': {'type': b'@'}, 'arguments': {2: {'type': sel32or64(b'l', b'q')}, 3: {'type': b'@'}}}) finally: objc._updatingMetadata(False) r = objc.registerMetaDataForSelector objc._updatingMetadata(True) try: r(b'NSObject', b'candidates:', {'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'commitComposition:', {'retval': {'type': b'v'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'composedString:', {'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}}}) r(b'NSObject', b'didCommandBySelector:client:', {'retval': {'type': 'Z'}, 'arguments': {2: {'type': ':'}, 3: {'type': b'@'}}}) r(b'NSObject', b'handleEvent:client:', {'retval': {'type': 'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'inputText:client:', {'retval': {'type': 'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': b'@'}}}) r(b'NSObject', b'inputText:key:modifiers:client:', {'retval': {'type': 'Z'}, 'arguments': {2: {'type': b'@'}, 3: {'type': sel32or64(b'i', b'q')}, 4: {'type': sel32or64(b'I', b'Q')}, 5: {'type': b'@'}}}) r(b'NSObject', b'originalString:', {'retval': {'type': b'@'}, 'arguments': {2: {'type': b'@'}}}) finally: objc._updatingMetadata(False) protocols={'IMKServerInput': objc.informal_protocol('IMKServerInput', [objc.selector(None, b'inputText:client:', b'Z@:@@', isRequired=False), objc.selector(None, b'candidates:', b'@@:@', isRequired=False), objc.selector(None, b'didCommandBySelector:client:', b'Z@::@', isRequired=False), objc.selector(None, b'handleEvent:client:', b'Z@:@@', isRequired=False), objc.selector(None, b'composedString:', b'@@:@', isRequired=False), objc.selector(None, b'inputText:key:modifiers:client:', sel32or64(b'Z@:@iI@', b'Z@:@qQ@'), isRequired=False), objc.selector(None, b'commitComposition:', b'v@:@', isRequired=False), objc.selector(None, b'originalString:', b'@@:@', isRequired=False)])} expressions = {} # END OF FILE
r(b'QLPreviewPanel', b'isInFullScreenMode', {'retval': {'type': b'Z'}}) r(b'QLPreviewPanel', b'sharedPreviewPanelExists', {'retval': { 'type': b'Z' }}) r(b'QLPreviewView', b'autostarts', {'retval': {'type': b'Z'}}) r(b'QLPreviewView', b'setAutostarts:', {'arguments': {2: {'type': b'Z'}}}) r(b'QLPreviewView', b'setShouldCloseWithWindow:', {'arguments': { 2: { 'type': b'Z' } }}) r(b'QLPreviewView', b'shouldCloseWithWindow', {'retval': {'type': b'Z'}}) finally: objc._updatingMetadata(False) protocols = { 'QLPreviewPanelController': objc.informal_protocol('QLPreviewPanelController', [ objc.selector( None, b'beginPreviewPanelControl:', b'v@:@', isRequired=False), objc.selector( None, b'acceptsPreviewPanelControl:', b'Z@:@', isRequired=False), objc.selector( None, b'endPreviewPanelControl:', b'v@:@', isRequired=False) ]) } expressions = {} # END OF FILE
) r(b"QLPreviewPanel", b"isInFullScreenMode", {"retval": {"type": b"Z"}}) r(b"QLPreviewPanel", b"sharedPreviewPanelExists", {"retval": {"type": b"Z"}}) r(b"QLPreviewView", b"autostarts", {"retval": {"type": b"Z"}}) r(b"QLPreviewView", b"setAutostarts:", {"arguments": {2: {"type": b"Z"}}}) r( b"QLPreviewView", b"setShouldCloseWithWindow:", {"arguments": {2: {"type": b"Z"}}}, ) r(b"QLPreviewView", b"shouldCloseWithWindow", {"retval": {"type": b"Z"}}) finally: objc._updatingMetadata(False) protocols = { "QLPreviewPanelController": objc.informal_protocol( "QLPreviewPanelController", [ objc.selector( None, b"beginPreviewPanelControl:", b"v@:@", isRequired=False ), objc.selector( None, b"acceptsPreviewPanelControl:", b"Z@:@", isRequired=False ), objc.selector(None, b"endPreviewPanelControl:", b"v@:@", isRequired=False), ], ) } expressions = {} # END OF FILE
def do_test_all_types(self, all): metadict = { "nometadata": 42, # Ignored... "protocols": { "NSMachPortDelegateMethods": objc.informal_protocol( "NSMachPortDelegateMethods", [ objc.selector(None, b"handleMachMessage:", b"v@:^v", isRequired=False) ], ) }, "constants": "$NSWorkspaceMoveOperation$NSWorkspaceCopyOperation@@$", "constants_dict": { "NSWorkspaceLinkOperation": "@", "NSWindowWillCloseNotification": "@", "NSUnderlineByWordMask": objc._C_NSUInteger.decode("ascii"), }, "enums": "$NSAWTEventType@16$NSAboveBottom@4$NSAboveTop@1$", "functions": { "NSRectClipList": ( sel32or64( b"v^{_NSRect={_NSPoint=ff}{_NSSize=ff}}i", b"v^{CGRect={CGPoint=dd}{CGSize=dd}}q", ), "", { "arguments": { 0: { "c_array_length_in_arg": 1, "type_modifier": b"n" } } }, ), "FunctionThatDoesNotExist": ( sel32or64( b"v^{_NSRect={_NSPoint=ff}{_NSSize=ff}}i", b"v^{CGRect={CGPoint=dd}{CGSize=dd}}q", ), "", {}, ), "NSAccessibilityActionDescription": (b"@@", "", {}), }, "aliases": { "doc_string": "__doc__", "invalid_alias": "does_not_exist" }, "expressions": { "mysum": "NSAWTEventType + NSAboveBottom + 3", "invalid_expression1": "no_such_name + 1", "invalid_expression2": 'NSAboveBottom + "b"', }, } initial_dict = {"__doc__": "AppKit test module"} mod = objc.ObjCLazyModule( "AppKit", None, "/System/Library/Frameworks/AppKit.framework", metadict, None, initial_dict, (), ) self.assertIsInstance(mod, objc.ObjCLazyModule) self.assertRaises(AttributeError, getattr, mod, "Foo(") self.assertRaises(AttributeError, getattr, mod, "Foo)") self.assertRaises(AttributeError, getattr, mod, "42") if all: # Force precalculation of all attributes by accessing the __all__ # attribute self.assertEqual(set(dir(mod)), set(mod.__all__)) self.assertEqual(mod.__doc__, initial_dict["__doc__"]) self.assertEqual(mod.doc_string, initial_dict["__doc__"]) self.assertRaises(AttributeError, getattr, mod, "invalid_alias") self.assertIsInstance(mod.NSWorkspaceMoveOperation, objc.pyobjc_unicode) self.assertTrue((mod.NSWorkspaceMoveOperation.nsstring().__flags__ & 0x10) == 0x00) self.assertIsInstance(mod.NSWorkspaceCopyOperation, objc.pyobjc_unicode) self.assertIsInstance(mod.NSWorkspaceLinkOperation, objc.pyobjc_unicode) self.assertIsInstance(mod.NSUnderlineByWordMask, (int, long)) self.assertEqual(mod.NSAWTEventType, 16) self.assertEqual(mod.NSAboveBottom, 4) self.assertEqual(mod.NSAboveTop, 1) self.assertIsInstance(mod.NSRectClipList, objc.function) self.assertEqual(mod.NSRectClipList.__name__, "NSRectClipList") self.assertArgSizeInArg(mod.NSRectClipList, 0, 1) self.assertRaises(AttributeError, getattr, mod, "FunctionThatDoesNotExist") self.assertEqual(mod.mysum, mod.NSAWTEventType + mod.NSAboveBottom + 3) self.assertRaises(AttributeError, getattr, mod, "invalid_expression1") self.assertRaises(AttributeError, getattr, mod, "invalid_expression2") self.assertIs(mod.NSURL, objc.lookUpClass("NSURL")) self.assertRaises(AttributeError, getattr, mod, "NSNonExistingClass") mod.NSAccessibilityActionDescription = 99 mod.NSWindowWillCloseNotification = 100 self.assertEqual(set(dir(mod)), set(mod.__all__)) self.assertIn("NSRectClipList", mod.__dict__) self.assertIn("NSRectClipList", mod.__all__) self.assertIn("NSAccessibilityActionDescription", mod.__all__) self.assertEqual(mod.NSAccessibilityActionDescription, 99) self.assertIn("mysum", mod.__all__) self.assertIn("NSWorkspaceMoveOperation", mod.__all__) self.assertIn("NSWindowWillCloseNotification", mod.__all__) self.assertEqual(mod.NSWindowWillCloseNotification, 100) self.assertNotIn("__doc__", mod.__all__) self.assertIn("NSMachPortDelegateMethods", mod._ObjCLazyModule__informal_protocols)
{"retval": {"type": b"v"}, "arguments": {2: {"type": b"@"}}}, ) r( b"NSObject", b"fileDownloadDidFinish:", {"retval": {"type": b"v"}, "arguments": {2: {"type": b"@"}}}, ) finally: objc._updatingMetadata(False) protocols = { "XGAuthenticatorDelegate": objc.informal_protocol( "XGAuthenticatorDelegate", [ objc.selector( None, b"authenticatorDidNotAuthenticate:", b"v@:@", isRequired=False ), objc.selector( None, b"authenticatorDidAuthenticate:", b"v@:@", isRequired=False ), ], ), "XGFileDownloadDelegate": objc.informal_protocol( "XGFileDownloadDelegate", [ objc.selector( None, b"fileDownload:decideDestinationWithSuggestedPath:", b"v@:@@", isRequired=False, ), objc.selector(
} }) finally: objc._updatingMetadata(False) protocols = { 'AMWorkflowControllerDelegate': objc.informal_protocol('AMWorkflowControllerDelegate', [ objc.selector( None, b'workflowControllerDidStop:', b'v@:@', isRequired=False), objc.selector( None, b'workflowControllerWillRun:', b'v@:@', isRequired=False), objc.selector(None, b'workflowController:willRunAction:', b'v@:@@', isRequired=False), objc.selector( None, b'workflowControllerDidRun:', b'v@:@', isRequired=False), objc.selector(None, b'workflowController:didRunAction:', b'v@:@@', isRequired=False), objc.selector( None, b'workflowControllerWillStop:', b'v@:@', isRequired=False), objc.selector( None, b'workflowController:didError:', b'v@:@@', isRequired=False) ]) } expressions = {} # END OF FILE
objc.informal_protocol('ISyncSessionDriverDelegate', [ objc.selector(None, b'sessionDriver:willPullAndReturnError:', b'Z@:@^@', isRequired=False), objc.selector(None, b'sessionDriver:willPushAndReturnError:', b'Z@:@^@', isRequired=False), objc.selector(None, b'sessionDriver:didRegisterClientAndReturnError:', b'Z@:@^@', isRequired=False), objc.selector(None, b'sessionDriver:willFinishSessionAndReturnError:', b'Z@:@^@', isRequired=False), objc.selector(None, b'sessionDriver:willNegotiateAndReturnError:', b'Z@:@^@', isRequired=False), objc.selector(None, b'sessionDriver:didPullAndReturnError:', b'Z@:@^@', isRequired=False), objc.selector( None, b'sessionDriverDidFinishSession:', b'v@:@', isRequired=False), objc.selector(None, b'sessionDriver:didNegotiateAndReturnError:', b'Z@:@^@', isRequired=False), objc.selector(None, b'sessionDriver:didPushAndReturnError:', b'Z@:@^@', isRequired=False), objc.selector(None, b'sessionDriver:didReceiveSyncAlertAndReturnError:', b'Z@:@^@', isRequired=False), objc.selector(None, b'sessionDriverWillCancelSession:', b'v@:@', isRequired=False), objc.selector( None, b'sessionDriverDidCancelSession:', b'v@:@', isRequired=False) ]),
2: { 'type': b'Z' } }}) r(b'QCView', b'startRendering', {'retval': {'type': b'Z'}}) finally: objc._updatingMetadata(False) protocols = { 'QCCompositionPickerViewDelegate': objc.informal_protocol('QCCompositionPickerViewDelegate', [ objc.selector(None, b'compositionPickerView:didSelectComposition:', b'v@:@@', isRequired=False), objc.selector(None, b'compositionPickerViewWillStopAnimating:', b'v@:@', isRequired=False), objc.selector(None, b'compositionPickerViewDidStartAnimating:', b'v@:@', isRequired=False) ]), 'QCCompositionParameterViewDelegate': objc.informal_protocol('QCCompositionParameterViewDelegate', [ objc.selector(None, b'compositionParameterView:didChangeParameterWithKey:', b'v@:@@', isRequired=False), objc.selector( None, b'compositionParameterView:shouldDisplayParameterWithKey:attributes:',
}, ) finally: objc._updatingMetadata(False) protocols = { "ABActionDelegate": objc.informal_protocol( "ABActionDelegate", [ objc.selector( None, b"shouldEnableActionForPerson:identifier:", b"Z@:@@", isRequired=False, ), objc.selector(None, b"actionProperty", b"@@:", isRequired=False), objc.selector(None, b"performActionForPerson:identifier:", b"v@:@@", isRequired=False), objc.selector(None, b"titleForPerson:identifier:", b"@@:@@", isRequired=False), ], ) } expressions = {} # END OF FILE
'type': b'@' }, 4: { 'type': sel32or64(b'I', b'Q') } } }) finally: objc._updatingMetadata(False) protocols = { 'NSExceptionHandlerDelegate': objc.informal_protocol('NSExceptionHandlerDelegate', [ objc.selector(None, b'exceptionHandler:shouldLogException:mask:', sel32or64(b'Z@:@@I', b'Z@:@@Q'), isRequired=False), objc.selector(None, b'exceptionHandler:shouldHandleException:mask:', sel32or64(b'Z@:@@I', b'Z@:@@Q'), isRequired=False) ]) } expressions = { 'NSHangOnEveryExceptionMask': '(NSHangOnUncaughtExceptionMask|NSHangOnUncaughtSystemExceptionMask|NSHangOnUncaughtRuntimeErrorMask|NSHangOnTopLevelExceptionMask|NSHangOnOtherExceptionMask)', 'NSLogAndHandleEveryExceptionMask': '(NSLogUncaughtExceptionMask|NSLogUncaughtSystemExceptionMask|NSLogUncaughtRuntimeErrorMask|NSHandleUncaughtExceptionMask|NSHandleUncaughtSystemExceptionMask|NSHandleUncaughtRuntimeErrorMask|NSLogTopLevelExceptionMask|NSHandleTopLevelExceptionMask|NSLogOtherExceptionMask|NSHandleOtherExceptionMask)' } # END OF FILE
from PyObjCTools.TestSupport import * import objc import warnings import sys import platform # Most useful systems will at least have 'NSObject'. NSObject = objc.lookUpClass('NSObject') from PyObjCTest.protocol import OC_TestProtocol MyProto = objc.informal_protocol( "MyProto", (objc.selector( None, selector=b"testMethod", signature=b"I@:", isRequired=1), objc.selector( None, selector=b"testMethod2:", signature=b"v@:i", isRequired=0))) class TestInformalProtocols(TestCase): def testMissingProto(self): class ProtoClass1(NSObject): def testMethod(self): pass self.assertEqual(ProtoClass1.testMethod.signature, b"I@:") def doIncompleteClass(self): class ProtoClass2(NSObject, MyProto): def testMethod2_(self, x): pass
} }, }, ) r(b"null", b"saveOptions:shouldShowUTType:", {"retval": {"type": b"Z"}}) finally: objc._updatingMetadata(False) protocols = { "IKImageBrowserItem": objc.informal_protocol( "IKImageBrowserItem", [ objc.selector(None, b"imageTitle", b"@@:", isRequired=False), objc.selector(None, b"imageSubtitle", b"@@:", isRequired=False), objc.selector( None, b"imageRepresentationType", b"@@:", isRequired=False), objc.selector(None, b"imageUID", b"@@:", isRequired=False), objc.selector(None, b"isSelectable", b"Z@:", isRequired=False), objc.selector(None, b"imageVersion", b"Q@:", isRequired=False), objc.selector( None, b"imageRepresentation", b"@@:", isRequired=False), ], ), "IKImageBrowserDataSourceDeprecated": objc.informal_protocol( "IKImageBrowserDataSourceDeprecated", [ objc.selector(None, b"numberOfCellsInImageBrowser:", b"L@:@", isRequired=False), objc.selector(
objc.informal_protocol( "IMVideoDataSource", [ objc.selector( None, b"renderIntoPixelBuffer:forTime:", sel32or64( b"Z@:^{__CVBuffer=}^{_CVTimeStamp=IiqQdq{CVSMPTETime=ssLLLssss}QQ}", b"Z@:^{__CVBuffer=}^{_CVTimeStamp=IiqQdq{CVSMPTETime=ssIIIssss}QQ}", ), isRequired=False, ), objc.selector(None, b"getPixelBufferPixelFormat:", b"v@:^I", isRequired=False), objc.selector( None, b"getOpenGLBufferContext:pixelFormat:", b"v@:^^{_CGLContextObject=}^^{_CGLPixelFormatObject=}", isRequired=False, ), objc.selector( None, b"renderIntoOpenGLBuffer:onScreen:forTime:", sel32or64( b"Z@:^{__CVBuffer=}^i^{_CVTimeStamp=IiqQdq{CVSMPTETime=ssLLLssss}QQ}", b"Z@:^{__CVBuffer=}^i^{_CVTimeStamp=IiqQdq{CVSMPTETime=ssIIIssss}QQ}", ), isRequired=False, ), ], )
# import objc def loadbundle(nm, fn): objc.loadBundle(nm, globals(), bundle_path = objc.pathForFramework(fn)) loadbundle('WiiRemote', u'/Library/Frameworks/WiiRemote.framework') #loadbundle('WiiRemote', u'WiiRemote.framework') IRData = objc.createStructType("IRData", "iii", ["x", "y", "s"]) WiiRemoteDiscoveryDelegate = objc.informal_protocol( "WiiRemoteDiscoveryDelegate", [ objc.selector(None, selector="willStartWiimoteConnections",signature="v@:",isRequired=0), objc.selector(None, selector="WiiRemoteDiscovered:",signature="v@:@",isRequired=0), objc.selector(None, selector="WiiRemoteDiscoveryError:",signature="v@:i",isRequired=0) ]) WiiRemoteDelegate = objc.informal_protocol( "WiiRemoteDelegate", [ objc.selector(None, selector="irPointMovedX:Y:", signature="v@:ff", isRequired=False), objc.selector(None, selector="rawIRData:", signature="v@:n^[4{IRData=iii}]", isRequired=False), objc.selector(None,