Subversion Repositories filter_foundry

Rev

Rev 239 | Rev 268 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. /*
  2.     This file is part of a common library
  3.     Copyright (C) 2002-6 Toby Thain, toby@telegraphics.com.au
  4.  
  5.     This program is free software; you can redistribute it and/or modify
  6.     it under the terms of the GNU General Public License as published by
  7.     the Free Software Foundation; either version 2 of the License, or
  8.     (at your option) any later version.
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.     GNU General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU General Public License
  16.     along with this program; if not, write to the Free Software
  17.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18. */
  19.  
  20. #ifndef CHOOSEFILE_H
  21. #define CHOOSEFILE_H
  22.  
  23. #ifdef macintosh
  24.  
  25.   #ifdef __GNUC__ // FIXME: this isn't the right define
  26.     typedef struct StandardFileReply {
  27.       Boolean             sfGood;
  28.       Boolean             sfReplacing;
  29.       OSType          sfType;
  30.       FSSpec              sfFile;
  31.       ScriptCode        sfScript;
  32.     } StandardFileReply;
  33.   #else
  34.         #include <standardfile.h>
  35.         #include <filetypesandcreators.h>
  36.   #endif
  37.         #include <Navigation.h> // this header is not in CW Pro 1
  38. #else
  39.         #include "compat_win.h"
  40. #endif
  41.  
  42. #ifndef __NAVIGATION__
  43.         typedef struct NavReplyRecord {
  44.           ScriptCode          keyScript;
  45.         } NavReplyRecord;
  46. #endif
  47.  
  48. Boolean customchoosefile_nav(FSSpec *fss,ScriptCode *script,
  49.                                                          OSType tlist[], StringPtr extlist[],Boolean *premult);
  50.  
  51. Boolean choosefiletypes(StringPtr prompt,StandardFileReply *sfr,NavReplyRecord *reply,
  52.                                                 OSType types[],int ntypes,const char *lpstrFilter
  53.                                                 #ifdef _WIN32
  54.                                                 ,HWND hwndOwner
  55.                                                 #endif /* _WIN32 */
  56.                                                 );
  57.  
  58. Boolean choosefile(StringPtr prompt,StandardFileReply *sfr,
  59.                                    NavReplyRecord *reply,OSType type,const char *lpstrFilter
  60.                                         #ifdef _WIN32
  61.                                         ,HWND hwndOwner
  62.                                         #endif /* _WIN32 */
  63.                                    );
  64.  
  65. /* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/UserInput/CommonDialogBoxLibrary/CommonDialogBoxReference/CommonDialogBoxStructures/OPENFILENAME.asp
  66. lpstrFilter
  67. Pointer to a buffer containing pairs of null-terminated filter strings.
  68. The last string in the buffer must be terminated by two NULL characters.
  69. The first string in each pair is a display string that describes the filter
  70. (for example, "Text Files"), and the second string specifies the filter pattern
  71. (for example, "*.TXT"). To specify multiple filter patterns for a single display string,
  72. use a semicolon to separate the patterns (for example, "*.TXT;*.DOC;*.BAK").
  73. A pattern string can be a combination of valid file name characters
  74. and the asterisk (*) wildcard character. Do not include spaces in the pattern string.
  75. */
  76.  
  77. Boolean putfile(StringPtr prompt,StringPtr fname,OSType fileType,OSType fileCreator,
  78.                                 NavReplyRecord *reply,StandardFileReply *sfr,
  79.                                 const char *lpstrDefExt, const char *lpstrFilter,int nFilterIndex
  80.                                 #ifdef _WIN32
  81.                                 ,HWND hwndOwner
  82.                                 #endif /* _WIN32 */
  83.                                 );
  84. OSErr completesave(NavReplyRecord *reply);
  85.  
  86. Boolean choosefile_sf(StringPtr prompt,StandardFileReply *sfr,NavReplyRecord *reply,
  87.                                           OSType type,const char *lpstrFilter);
  88. Boolean putfile_sf(StringPtr prompt,StringPtr fname,
  89.                                    OSType fileType,OSType fileCreator,
  90.                                    NavReplyRecord *reply,StandardFileReply *sfr);
  91. OSErr completesave_sf(NavReplyRecord *reply);
  92.  
  93. Boolean customchoosefile_nav(FSSpec *fss,ScriptCode *script,
  94.                                                          OSType tlist[], StringPtr extlist[],Boolean *premult);
  95. Boolean choosefile_nav(StringPtr prompt,StandardFileReply *sfr,NavReplyRecord *reply,
  96.                                            OSType type,const char *lpstrFilter);
  97. Boolean putfile_nav(StringPtr prompt,StringPtr fname,
  98.                                         OSType fileType,OSType fileCreator,
  99.                                         NavReplyRecord *reply,StandardFileReply *sfr);
  100. OSErr completesave_nav(NavReplyRecord *reply);
  101.  
  102. #endif
  103.