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

  1. =head1 NAME
  2.  
  3. Mac::StandardFile - Macintosh Toolbox Interface to the standard file dialogs.
  4.  
  5. =head1 SYNOPSIS
  6.  
  7.  
  8. =head1 DESCRIPTION
  9.  
  10. Access to Inside Macintosh is essential for proper use of these functions.
  11. Explanations of terms, processes and procedures are provided there.
  12. Any attempt to use these functions without guidance can cause severe errors in 
  13. your machine, including corruption of data. B<You have been warned.>
  14.  
  15. =cut
  16.     
  17. use strict;
  18.  
  19. package Mac::StandardFile;
  20.  
  21. BEGIN {
  22.     use Exporter   ();
  23.     use DynaLoader ();
  24.     
  25.     use vars qw(@ISA @EXPORT);
  26.     
  27.     @ISA = qw(Exporter DynaLoader);
  28.     @EXPORT = qw(
  29.         StandardPutFile
  30.         StandardGetFile
  31.         CustomPutFile
  32.         CustomGetFile
  33.         StandardOpenDialog
  34.     
  35.         putDlgID
  36.         putSave
  37.         putCancel
  38.         putEject
  39.         putDrive
  40.         putName
  41.         getDlgID
  42.         getOpen
  43.         getCancel
  44.         getEject
  45.         getDrive
  46.         getNmList
  47.         getScroll
  48.         sfPutDialogID
  49.         sfGetDialogID
  50.         sfItemOpenButton
  51.         sfItemCancelButton
  52.         sfItemBalloonHelp
  53.         sfItemVolumeUser
  54.         sfItemEjectButton
  55.         sfItemDesktopButton
  56.         sfItemFileListUser
  57.         sfItemPopUpMenuUser
  58.         sfItemDividerLinePict
  59.         sfItemFileNameTextEdit
  60.         sfItemPromptStaticText
  61.         sfItemNewFolderUser
  62.         sfHookFirstCall
  63.         sfHookCharOffset
  64.         sfHookNullEvent
  65.         sfHookRebuildList
  66.         sfHookFolderPopUp
  67.         sfHookOpenFolder
  68.         sfHookOpenAlias
  69.         sfHookGoToDesktop
  70.         sfHookGoToAliasTarget
  71.         sfHookGoToParent
  72.         sfHookGoToNextDrive
  73.         sfHookGoToPrevDrive
  74.         sfHookChangeSelection
  75.         sfHookSetActiveOffset
  76.         sfHookLastCall
  77.         sfMainDialogRefCon
  78.         sfNewFolderDialogRefCon
  79.         sfReplaceDialogRefCon
  80.         sfStatWarnDialogRefCon
  81.         sfLockWarnDialogRefCon
  82.         sfErrorDialogRefCon
  83.     );
  84. }
  85.  
  86. bootstrap Mac::StandardFile;
  87.  
  88. =head2 Constants
  89.  
  90. =over 4
  91.  
  92. =item putDlgID
  93.  
  94. =item putSave
  95.  
  96. =item putCancel
  97.  
  98. =item putEject
  99.  
  100. =item putDrive
  101.  
  102. =item putName
  103.  
  104. The old put dialog and its items.
  105.  
  106. =cut
  107. sub putDlgID ()                    {      -3999; }
  108. sub putSave ()                     {          1; }
  109. sub putCancel ()                   {          2; }
  110. sub putEject ()                    {          5; }
  111. sub putDrive ()                    {          6; }
  112. sub putName ()                     {          7; }
  113.  
  114.  
  115. =item getDlgID
  116.  
  117. =item getOpen
  118.  
  119. =item getCancel
  120.  
  121. =item getEject
  122.  
  123. =item getDrive
  124.  
  125. =item getNmList
  126.  
  127. =item getScroll
  128.  
  129. The old get dialog and its items.
  130.  
  131. =cut
  132. sub getDlgID ()                    {      -4000; }
  133. sub getOpen ()                     {          1; }
  134. sub getCancel ()                   {          3; }
  135. sub getEject ()                    {          5; }
  136. sub getDrive ()                    {          6; }
  137. sub getNmList ()                   {          7; }
  138. sub getScroll ()                   {          8; }
  139.  
  140.  
  141. =item sfPutDialogID
  142.  
  143. =cut
  144. sub sfPutDialogID ()               {      -6043; }
  145.  
  146.  
  147. =item sfGetDialogID
  148.  
  149. =item sfItemOpenButton
  150.  
  151. =item sfItemCancelButton
  152.  
  153. =item sfItemBalloonHelp
  154.  
  155. =item sfItemVolumeUser
  156.  
  157. =item sfItemEjectButton
  158.  
  159. =item sfItemDesktopButton
  160.  
  161. =item sfItemFileListUser
  162.  
  163. =item sfItemPopUpMenuUser
  164.  
  165. =item sfItemDividerLinePict
  166.  
  167. =item sfItemFileNameTextEdit
  168.  
  169. =item sfItemPromptStaticText
  170.  
  171. =item sfItemNewFolderUser
  172.  
  173. The new dialogs and their items.
  174.  
  175. =cut
  176. sub sfGetDialogID ()               {      -6042; }
  177. sub sfItemOpenButton ()            {          1; }
  178. sub sfItemCancelButton ()          {          2; }
  179. sub sfItemBalloonHelp ()           {          3; }
  180. sub sfItemVolumeUser ()            {          4; }
  181. sub sfItemEjectButton ()           {          5; }
  182. sub sfItemDesktopButton ()         {          6; }
  183. sub sfItemFileListUser ()          {          7; }
  184. sub sfItemPopUpMenuUser ()         {          8; }
  185. sub sfItemDividerLinePict ()       {          9; }
  186. sub sfItemFileNameTextEdit ()      {         10; }
  187. sub sfItemPromptStaticText ()      {         11; }
  188. sub sfItemNewFolderUser ()         {         12; }
  189.  
  190.  
  191. =item sfHookFirstCall
  192.  
  193. =item sfHookCharOffset
  194.  
  195. =item sfHookNullEvent
  196.  
  197. =item sfHookRebuildList
  198.  
  199. =item sfHookFolderPopUp
  200.  
  201. =item sfHookOpenFolder
  202.  
  203. =item sfHookOpenAlias
  204.  
  205. =item sfHookGoToDesktop
  206.  
  207. =item sfHookGoToAliasTarget
  208.  
  209. =item sfHookGoToParent
  210.  
  211. =item sfHookGoToNextDrive
  212.  
  213. =item sfHookGoToPrevDrive
  214.  
  215. =item sfHookChangeSelection
  216.  
  217. =item sfHookSetActiveOffset
  218.  
  219. =item sfHookLastCall
  220.  
  221. Pseudo-items for the dialog filters.
  222.  
  223. =cut
  224. sub sfHookFirstCall ()             {         -1; }
  225. sub sfHookCharOffset ()            {     0x1000; }
  226. sub sfHookNullEvent ()             {        100; }
  227. sub sfHookRebuildList ()           {        101; }
  228. sub sfHookFolderPopUp ()           {        102; }
  229. sub sfHookOpenFolder ()            {        103; }
  230. sub sfHookOpenAlias ()             {        104; }
  231. sub sfHookGoToDesktop ()           {        105; }
  232. sub sfHookGoToAliasTarget ()       {        106; }
  233. sub sfHookGoToParent ()            {        107; }
  234. sub sfHookGoToNextDrive ()         {        108; }
  235. sub sfHookGoToPrevDrive ()         {        109; }
  236. sub sfHookChangeSelection ()       {        110; }
  237. sub sfHookSetActiveOffset ()       {        200; }
  238. sub sfHookLastCall ()              {         -2; }
  239.  
  240.  
  241. =item sfMainDialogRefCon
  242.  
  243. =item sfNewFolderDialogRefCon
  244.  
  245. =item sfReplaceDialogRefCon
  246.  
  247. =item sfStatWarnDialogRefCon
  248.  
  249. =item sfLockWarnDialogRefCon
  250.  
  251. =item sfErrorDialogRefCon
  252.  
  253. Refcons to distinguish the dialogs.
  254.  
  255. =cut
  256. sub sfMainDialogRefCon ()          {     0x73746466; } # 'stdf'
  257. sub sfNewFolderDialogRefCon ()     {     0x6E666472; } # 'nfdr'
  258. sub sfReplaceDialogRefCon ()       {     0x72706C63; } # 'rplc'
  259. sub sfStatWarnDialogRefCon ()      {     0x73746174; } # 'stat'
  260. sub sfLockWarnDialogRefCon ()      {     0x6C6F636B; } # 'lock'
  261. sub sfErrorDialogRefCon ()         {     0x65727220; } # 'err '
  262.  
  263. =back
  264.  
  265. =include StandardFile.xs
  266.  
  267. =head1 BUGS/LIMITATIONS
  268.  
  269. =head1 FILES
  270.  
  271. =head1 AUTHOR(S)
  272.  
  273. Matthias Ulrich Neeracher <neeri@iis.ee.ethz.ch> 
  274.  
  275. =cut
  276.  
  277. 1;
  278.  
  279. __END__
  280.