home *** CD-ROM | disk | FTP | other *** search
/ CLIX - Fazer Clix Custa Nix / CLIX-CD.cdr / mac / lib / Mac / OSA.pm < prev    next >
Text File  |  1998-04-05  |  8KB  |  352 lines

  1. =head1 NAME
  2.  
  3. Mac::OSA - Provide interface to Open Scripting Architecture
  4.  
  5. =head1 SYNOPSIS
  6.  
  7.  
  8.     use Mac::OSA;
  9.     
  10.     use Mac::OSA qw(OSALoad OSAStore OSAExecute);
  11.  
  12. =head1 DESCRIPTION
  13.  
  14. Access to Inside Macintosh is essential for proper use of these functions.
  15. Explanations of terms, processes and procedures are provided there.
  16. Any attempt to use these functions without guidance can cause severe errors in 
  17. your machine, including corruption of data. B<You have been warned.>
  18.  
  19. =cut
  20.  
  21. use strict;
  22.  
  23. package Mac::OSA;
  24.  
  25. BEGIN {
  26.     use Exporter   ();
  27.     use DynaLoader ();
  28.     use Mac::AppleEvents;
  29.     
  30.     use vars qw(@ISA @EXPORT);
  31.     
  32.     @ISA = qw(Exporter DynaLoader);
  33.     @EXPORT = qw(
  34.         OSALoad
  35.         OSAStore
  36.         OSAExecute
  37.         OSADisplay
  38.         OSAScriptError
  39.         OSADispose
  40.         OSASetScriptInfo
  41.         OSAGetScriptInfo
  42.         OSAScriptingComponentName
  43.         OSACompile
  44.         OSACopyID
  45.         OSAGetSource
  46.         OSACoerceFromDesc
  47.         OSACoerceToDesc
  48.         OSASetDefaultTarget
  49.         OSAStartRecording
  50.         OSAStopRecording
  51.         OSALoadExecute
  52.         OSACompileExecute
  53.         OSADoScript
  54.         OSASetCurrentDialect
  55.         OSAGetCurrentDialect
  56.         OSAAvailableDialects
  57.         OSAGetDialectInfo
  58.         OSAAvailableDialectCodeList
  59.         OSAExecuteEvent
  60.         OSADoEvent
  61.         OSAMakeContext
  62.         OSAGetDefaultScriptingComponent
  63.         OSASetDefaultScriptingComponent
  64.         OSAGetScriptingComponent
  65.         OSAGetScriptingComponentFromStored
  66.         OSAGenericToRealID
  67.         OSARealToGenericID
  68.         
  69.         kOSAComponentType
  70.         kOSAGenericScriptingComponentSubtype
  71.         kOSAFileType
  72.         kOSASuite
  73.         kOSARecordedText
  74.         kOSAScriptIsModified
  75.         kOSAScriptIsTypeCompiledScript
  76.         kOSAScriptIsTypeScriptValue
  77.         kOSAScriptIsTypeScriptContext
  78.         kOSAScriptBestType
  79.         kOSACanGetSource
  80.         typeOSADialectInfo
  81.         keyOSADialectName
  82.         keyOSADialectCode
  83.         keyOSADialectLangCode
  84.         keyOSADialectScriptCode
  85.         kOSANullScript
  86.         kOSANullMode
  87.         kOSAModeNull
  88.         kOSASupportsCompiling
  89.         kOSASupportsGetSource
  90.         kOSASupportsAECoercion
  91.         kOSASupportsAESending
  92.         kOSASupportsRecording
  93.         kOSASupportsConvenience
  94.         kOSASupportsDialects
  95.         kOSASupportsEventHandling
  96.         kOSAModePreventGetSource
  97.         kOSAModeNeverInteract
  98.         kOSAModeCanInteract
  99.         kOSAModeAlwaysInteract
  100.         kOSAModeDontReconnect
  101.         kOSAModeCantSwitchLayer
  102.         kOSAModeDoRecord
  103.         kOSAModeCompileIntoContext
  104.         kOSAModeAugmentContext
  105.         kOSAModeDisplayForHumans
  106.         kOSAModeDontStoreParent
  107.         kOSAModeDispatchToDirectObject
  108.         kOSAModeDontGetDataForArguments
  109.         kOSAScriptResourceType
  110.         typeOSAGenericStorage
  111.         kOSAErrorNumber
  112.         kOSAErrorMessage
  113.         kOSAErrorBriefMessage
  114.         kOSAErrorApp
  115.         kOSAErrorPartialResult
  116.         kOSAErrorOffendingObject
  117.         kOSAErrorExpectedType
  118.         kOSAErrorRange
  119.         typeOSAErrorRange
  120.         keyOSASourceStart
  121.         keyOSASourceEnd
  122.         kOSAUseStandardDispatch
  123.         kOSANoDispatch
  124.         kOSADontUsePhac
  125.         kGenericComponentVersion
  126.     );
  127. }
  128.  
  129. bootstrap Mac::OSA;
  130.  
  131. =head2 Constants
  132.  
  133. =over 4
  134.  
  135. =item kOSAComponentType
  136.  
  137. =item kOSAGenericScriptingComponentSubtype
  138.  
  139. =item kOSAFileType
  140.  
  141. =item kOSASuite
  142.  
  143. =item kOSARecordedText
  144.  
  145. =item kOSAScriptIsModified
  146.  
  147. =item kOSAScriptIsTypeCompiledScript
  148.  
  149. =item kOSAScriptIsTypeScriptValue
  150.  
  151. =item kOSAScriptIsTypeScriptContext
  152.  
  153. =item kOSAScriptBestType
  154.  
  155. =item kOSACanGetSource
  156.  
  157. =item typeOSADialectInfo
  158.  
  159. =item keyOSADialectName
  160.  
  161. =item keyOSADialectCode
  162.  
  163. =item keyOSADialectLangCode
  164.  
  165. =item keyOSADialectScriptCode
  166.  
  167. =item kOSAScriptResourceType
  168.  
  169. =item typeOSAGenericStorage
  170.  
  171. Types and keywords.
  172.  
  173. =cut
  174. sub kOSAComponentType ()           {     'osa '; }
  175. sub kOSAGenericScriptingComponentSubtype () {     'scpt'; }
  176. sub kOSAFileType ()                {     'osas'; }
  177. sub kOSASuite ()                   {     'ascr'; }
  178. sub kOSARecordedText ()            {     'recd'; }
  179. sub kOSAScriptIsModified ()        {     'modi'; }
  180. sub kOSAScriptIsTypeCompiledScript () {     'cscr'; }
  181. sub kOSAScriptIsTypeScriptValue () {     'valu'; }
  182. sub kOSAScriptIsTypeScriptContext () {     'cntx'; }
  183. sub kOSAScriptBestType ()          {     'best'; }
  184. sub kOSACanGetSource ()            {     'gsrc'; }
  185. sub typeOSADialectInfo ()          {     'difo'; }
  186. sub keyOSADialectName ()           {     'dnam'; }
  187. sub keyOSADialectCode ()           {     'dcod'; }
  188. sub keyOSADialectLangCode ()       {     'dlcd'; }
  189. sub keyOSADialectScriptCode ()     {     'dscd'; }
  190. sub kOSAScriptResourceType ()      { kOSAGenericScriptingComponentSubtype; }
  191. sub typeOSAGenericStorage ()       { kOSAScriptResourceType; }
  192.  
  193.  
  194. =item kOSANullScript
  195.  
  196. =item kOSANullMode
  197.  
  198. =item kOSAModeNull
  199.  
  200. Default values.
  201.  
  202. =cut
  203. sub kOSANullScript ()              {          0; }
  204. sub kOSANullMode ()                {          0; }
  205. sub kOSAModeNull ()                {          0; }
  206.  
  207.  
  208. =item kOSASupportsCompiling
  209.  
  210. =item kOSASupportsGetSource
  211.  
  212. =item kOSASupportsAECoercion
  213.  
  214. =item kOSASupportsAESending
  215.  
  216. =item kOSASupportsRecording
  217.  
  218. =item kOSASupportsConvenience
  219.  
  220. =item kOSASupportsDialects
  221.  
  222. =item kOSASupportsEventHandling
  223.  
  224. Feature flags.
  225.  
  226. =cut
  227. sub kOSASupportsCompiling ()       {     0x0002; }
  228. sub kOSASupportsGetSource ()       {     0x0004; }
  229. sub kOSASupportsAECoercion ()      {     0x0008; }
  230. sub kOSASupportsAESending ()       {     0x0010; }
  231. sub kOSASupportsRecording ()       {     0x0020; }
  232. sub kOSASupportsConvenience ()     {     0x0040; }
  233. sub kOSASupportsDialects ()        {     0x0080; }
  234. sub kOSASupportsEventHandling ()   {     0x0100; }
  235.  
  236.  
  237. =item kOSAModePreventGetSource
  238.  
  239. =item kOSAModeNeverInteract
  240.  
  241. =item kOSAModeCanInteract
  242.  
  243. =item kOSAModeAlwaysInteract
  244.  
  245. =item kOSAModeDontReconnect
  246.  
  247. =item kOSAModeCantSwitchLayer
  248.  
  249. =item kOSAModeDoRecord
  250.  
  251. =item kOSAModeCompileIntoContext
  252.  
  253. =item kOSAModeAugmentContext
  254.  
  255. =item kOSAModeDisplayForHumans
  256.  
  257. =item kOSAModeDontStoreParent
  258.  
  259. =item kOSAModeDispatchToDirectObject
  260.  
  261. =item kOSAModeDontGetDataForArguments
  262.  
  263. Mode flags.
  264.  
  265. =cut
  266. sub kOSAModePreventGetSource ()    { 0x00000001; }
  267. sub kOSAModeNeverInteract ()       { kAENeverInteract; }
  268. sub kOSAModeCanInteract ()         { kAECanInteract; }
  269. sub kOSAModeAlwaysInteract ()      { kAEAlwaysInteract; }
  270. sub kOSAModeDontReconnect ()       { kAEDontReconnect; }
  271. sub kOSAModeCantSwitchLayer ()     { 0x00000040; }
  272. sub kOSAModeDoRecord ()            { 0x00001000; }
  273. sub kOSAModeCompileIntoContext ()  { 0x00000002; }
  274. sub kOSAModeAugmentContext ()      { 0x00000004; }
  275. sub kOSAModeDisplayForHumans ()    { 0x00000008; }
  276. sub kOSAModeDontStoreParent ()     { 0x00010000; }
  277. sub kOSAModeDispatchToDirectObject () { 0x00020000; }
  278. sub kOSAModeDontGetDataForArguments () { 0x00040000; }
  279.  
  280.  
  281. =item kOSAErrorNumber
  282.  
  283. =item kOSAErrorMessage
  284.  
  285. =item kOSAErrorBriefMessage
  286.  
  287. =item kOSAErrorApp
  288.  
  289. =item kOSAErrorPartialResult
  290.  
  291. =item kOSAErrorOffendingObject
  292.  
  293. =item kOSAErrorExpectedType
  294.  
  295. =item kOSAErrorRange
  296.  
  297. =item typeOSAErrorRange
  298.  
  299. =item keyOSASourceStart
  300.  
  301. =item keyOSASourceEnd
  302.  
  303. Error handling.
  304.  
  305. =cut
  306. sub kOSAErrorNumber ()             { keyErrorNumber; }
  307. sub kOSAErrorMessage ()            { keyErrorString; }
  308. sub kOSAErrorBriefMessage ()       {     'errb'; }
  309. sub kOSAErrorApp ()                {     'erap'; }
  310. sub kOSAErrorPartialResult ()      {     'ptlr'; }
  311. sub kOSAErrorOffendingObject ()    {     'erob'; }
  312. sub kOSAErrorExpectedType ()       {     'errt'; }
  313. sub kOSAErrorRange ()              {     'erng'; }
  314. sub typeOSAErrorRange ()           {     'erng'; }
  315. sub keyOSASourceStart ()           {     'srcs'; }
  316. sub keyOSASourceEnd ()             {     'srce'; }
  317.  
  318.  
  319. =item kOSAUseStandardDispatch
  320.  
  321. =item kOSANoDispatch
  322.  
  323. =item kOSADontUsePhac
  324.  
  325. =item kGenericComponentVersion
  326.  
  327. Dispatching flags
  328.  
  329. =cut
  330. sub kOSAUseStandardDispatch ()     { kAEUseStandardDispatch; }
  331. sub kOSANoDispatch ()              { kAENoDispatch; }
  332. sub kOSADontUsePhac ()             {     0x0001; }
  333. sub kGenericComponentVersion ()    {     0x0100; }
  334.  
  335. =back
  336.  
  337. =include OSA.xs
  338.  
  339. =head1 BUGS/LIMITATIONS
  340.  
  341. =head1 AUTHOR(S)
  342.  
  343. Matthias Ulrich Neeracher <neeri@iis.ee.ethz.ch> Author
  344.  
  345. Bob Dalgleish <bob.dalgleish@sasknet.sk.ca> Documenter
  346.  
  347. =cut
  348.  
  349. 1;
  350.  
  351. __END__
  352.