NSPort.inc 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. { Parsed from Foundation.framework NSPort.h }
  2. {$ifdef TYPES}
  3. {$ifndef NSPORT_PAS_T}
  4. {$define NSPORT_PAS_T}
  5. { Types }
  6. type
  7. NSSocketNativeHandle = cint;
  8. NSSocketNativeHandlePtr = ^NSSocketNativeHandle;
  9. { Constants }
  10. const
  11. NSMachPortDeallocateNone = 0;
  12. NSMachPortDeallocateSendRight = 1 shl 0;
  13. NSMachPortDeallocateReceiveRight = 1 shl 1;
  14. {$endif}
  15. {$endif}
  16. {$ifdef RECORDS}
  17. {$ifndef NSPORT_PAS_R}
  18. {$define NSPORT_PAS_R}
  19. {$endif}
  20. {$endif}
  21. {$ifdef FUNCTIONS}
  22. {$ifndef NSPORT_PAS_F}
  23. {$define NSPORT_PAS_F}
  24. {$endif}
  25. {$endif}
  26. {$ifdef EXTERNAL_SYMBOLS}
  27. {$ifndef NSPORT_PAS_S}
  28. {$define NSPORT_PAS_S}
  29. { External string constants }
  30. var
  31. NSPortDidBecomeInvalidNotification: NSString; cvar; external;
  32. {$endif}
  33. {$endif}
  34. {$ifdef FORWARD}
  35. NSPortDelegateProtocol = objcprotocol;
  36. NSMachPortDelegateProtocol = objcprotocol;
  37. NSPort = objcclass;
  38. NSPortPointer = ^NSPort;
  39. NSPortPtr = NSPortPointer;
  40. NSMachPort = objcclass;
  41. NSMachPortPointer = ^NSMachPort;
  42. NSMachPortPtr = NSMachPortPointer;
  43. NSMessagePort = objcclass;
  44. NSMessagePortPointer = ^NSMessagePort;
  45. NSMessagePortPtr = NSMessagePortPointer;
  46. NSSocketPort = objcclass;
  47. NSSocketPortPointer = ^NSSocketPort;
  48. NSSocketPortPtr = NSSocketPortPointer;
  49. {$endif}
  50. {$ifdef CLASSES}
  51. {$ifndef NSPORT_PAS_C}
  52. {$define NSPORT_PAS_C}
  53. { NSPort }
  54. NSPort = objcclass external (NSObject, NSCopyingProtocol, NSCodingProtocol)
  55. public
  56. class function allocWithZone(zone_: NSZonePtr): id; message 'allocWithZone:';
  57. class function port: NSPort; message 'port';
  58. procedure invalidate; message 'invalidate';
  59. function isValid: Boolean; message 'isValid';
  60. procedure setDelegate(anObject: NSPortDelegateProtocol); message 'setDelegate:';
  61. function delegate: NSPortDelegateProtocol; message 'delegate';
  62. procedure scheduleInRunLoop_forMode(runLoop: NSRunLoop; mode: NSString); message 'scheduleInRunLoop:forMode:';
  63. procedure removeFromRunLoop_forMode(runLoop: NSRunLoop; mode: NSString); message 'removeFromRunLoop:forMode:';
  64. function reservedSpaceLength: NSUInteger; message 'reservedSpaceLength';
  65. function sendBeforeDate_components_from_reserved(limitDate: NSDate; components: NSMutableArray; receivePort: NSPort; headerSpaceReserved: NSUInteger): Boolean; message 'sendBeforeDate:components:from:reserved:';
  66. function sendBeforeDate_msgid_components_from_reserved(limitDate: NSDate; msgID: NSUInteger; components: NSMutableArray; receivePort: NSPort; headerSpaceReserved: NSUInteger): Boolean; message 'sendBeforeDate:msgid:components:from:reserved:';
  67. procedure addConnection_toRunLoop_forMode(conn: NSConnection; runLoop: NSRunLoop; mode: NSString); message 'addConnection:toRunLoop:forMode:';
  68. procedure removeConnection_fromRunLoop_forMode(conn: NSConnection; runLoop: NSRunLoop; mode: NSString); message 'removeConnection:fromRunLoop:forMode:';
  69. { Adopted Protocols }
  70. function copyWithZone(zone_: NSZonePtr): id;
  71. procedure encodeWithCoder(aCoder: NSCoder);
  72. function initWithCoder(aDecoder: NSCoder): id;
  73. end;
  74. { NSMachPort }
  75. NSMachPort = objcclass external (NSPort)
  76. private
  77. _delegate: id;
  78. _flags: NSUInteger;
  79. _machPort: cuint32;
  80. _reserved: NSUInteger;
  81. public
  82. class function portWithMachPort(machPort_: cuint32): NSPort; message 'portWithMachPort:';
  83. function initWithMachPort(machPort_: cuint32): id; message 'initWithMachPort:';
  84. procedure setDelegate(anObject: NSMachPortDelegateProtocol); message 'setDelegate:';
  85. function delegate: NSMachPortDelegateProtocol; message 'delegate';
  86. class function portWithMachPort_options(machPort_: cuint32; f: NSUInteger): NSPort; message 'portWithMachPort:options:';
  87. function initWithMachPort_options(machPort_: cuint32; f: NSUInteger): id; message 'initWithMachPort:options:';
  88. function machPort: cuint32; message 'machPort';
  89. procedure scheduleInRunLoop_forMode(runLoop: NSRunLoop; mode: NSString); message 'scheduleInRunLoop:forMode:';
  90. procedure removeFromRunLoop_forMode(runLoop: NSRunLoop; mode: NSString); message 'removeFromRunLoop:forMode:';
  91. end;
  92. { NSMessagePort }
  93. NSMessagePort = objcclass external (NSPort)
  94. private
  95. _port: Pointer; {garbage collector: __strong }
  96. _delegate: id;
  97. public
  98. end;
  99. { NSSocketPort }
  100. NSSocketPort = objcclass external (NSPort)
  101. private
  102. _receiver: Pointer; {garbage collector: __strong }
  103. _connectors: Pointer; {garbage collector: __strong }
  104. _loops: Pointer; {garbage collector: __strong }
  105. _data: Pointer; {garbage collector: __strong }
  106. _signature: id;
  107. _delegate: id;
  108. _lock: id;
  109. _maxSize: NSUInteger;
  110. _useCount: NSUInteger;
  111. _reserved: NSUInteger;
  112. public
  113. function init: id; message 'init';
  114. function initWithTCPPort(port_: cushort): id; message 'initWithTCPPort:';
  115. function initWithProtocolFamily_socketType_protocol_address(family: cint; type_: cint; protocol_: cint; address_: NSData): id; message 'initWithProtocolFamily:socketType:protocol:address:';
  116. function initWithProtocolFamily_socketType_protocol_socket(family: cint; type_: cint; protocol_: cint; sock: NSSocketNativeHandle): id; message 'initWithProtocolFamily:socketType:protocol:socket:';
  117. function initRemoteWithTCPPort_host(port_: cushort; hostName: NSString): id; message 'initRemoteWithTCPPort:host:';
  118. function initRemoteWithProtocolFamily_socketType_protocol_address(family: cint; type_: cint; protocol_: cint; address_: NSData): id; message 'initRemoteWithProtocolFamily:socketType:protocol:address:';
  119. function protocolFamily: cint; message 'protocolFamily';
  120. function socketType: cint; message 'socketType';
  121. function protocol: cint; message 'protocol';
  122. function address: NSData; message 'address';
  123. function socket: NSSocketNativeHandle; message 'socket';
  124. end;
  125. {$endif}
  126. {$endif}
  127. {$ifdef PROTOCOLS}
  128. {$ifndef NSPORT_PAS_P}
  129. {$define NSPORT_PAS_P}
  130. { NSPortDelegate Protocol }
  131. NSPortDelegateProtocol = objcprotocol external name 'NSPortDelegate'
  132. optional
  133. procedure handlePortMessage(message: NSPortMessage); message 'handlePortMessage:';
  134. end;
  135. { NSMachPortDelegate Protocol }
  136. NSMachPortDelegateProtocol = objcprotocol external name 'NSMachPortDelegate'
  137. optional
  138. procedure handleMachMessage(msg: Pointer); message 'handleMachMessage:';
  139. end;
  140. {$endif}
  141. {$endif}