Subversion Repositories filter_foundry

Rev

Rev 449 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
259 daniel-mar 1
/*
2
    This file is part of a common library
536 daniel-mar 3
    Copyright (C) 2002-2006 Toby Thain, toby@telegraphics.net
259 daniel-mar 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
 
439 daniel-mar 20
#ifndef CHOOSEFILE_H_
21
#define CHOOSEFILE_H_
259 daniel-mar 22
 
449 daniel-mar 23
#include "world.h"
24
 
259 daniel-mar 25
#ifdef macintosh
268 daniel-mar 26
        #ifdef __GNUC__ // FIXME: this isn't the right define
27
                typedef struct StandardFileReply {
28
                        Boolean         sfGood;
29
                        Boolean         sfReplacing;
30
                        OSType          sfType;
31
                        FSSpec          sfFile;
32
                        ScriptCode      sfScript;
33
                } StandardFileReply;
34
        #else
35
                #include <standardfile.h>
36
                #include <filetypesandcreators.h>
37
        #endif
259 daniel-mar 38
        #include <Navigation.h> // this header is not in CW Pro 1
39
#else
40
        #include "compat_win.h"
41
#endif
42
 
43
#ifndef __NAVIGATION__
44
        typedef struct NavReplyRecord {
268 daniel-mar 45
                ScriptCode keyScript;
259 daniel-mar 46
        } NavReplyRecord;
47
#endif
48
 
444 daniel-mar 49
#ifdef macintosh
50
    typedef StringPtr PString;
51
#else
52
    typedef LPCTSTR PString;
53
#endif
54
 
55
Boolean fileHasExtension(StandardFileReply* sfr, const TCHAR* extension);
536 daniel-mar 56
 
259 daniel-mar 57
Boolean customchoosefile_nav(FSSpec *fss,ScriptCode *script,
444 daniel-mar 58
                             OSType tlist[], PString extlist[],Boolean *premult);
259 daniel-mar 59
 
444 daniel-mar 60
Boolean choosefiletypes(PString prompt,StandardFileReply *sfr,NavReplyRecord *reply,
61
                        OSType types[],int ntypes,const TCHAR *lpstrFilter
268 daniel-mar 62
                        #ifdef _WIN32
63
                        ,HWND hwndOwner
64
                        #endif /* _WIN32 */
65
);
259 daniel-mar 66
 
444 daniel-mar 67
Boolean choosefile(PString prompt,StandardFileReply *sfr,
68
                   NavReplyRecord *reply,OSType type,const TCHAR *lpstrFilter
268 daniel-mar 69
                   #ifdef _WIN32
70
                   ,HWND hwndOwner
71
                   #endif /* _WIN32 */
72
);
259 daniel-mar 73
 
74
/* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/UserInput/CommonDialogBoxLibrary/CommonDialogBoxReference/CommonDialogBoxStructures/OPENFILENAME.asp
75
lpstrFilter
76
Pointer to a buffer containing pairs of null-terminated filter strings.
77
The last string in the buffer must be terminated by two NULL characters.
78
The first string in each pair is a display string that describes the filter
79
(for example, "Text Files"), and the second string specifies the filter pattern
80
(for example, "*.TXT"). To specify multiple filter patterns for a single display string,
81
use a semicolon to separate the patterns (for example, "*.TXT;*.DOC;*.BAK").
82
A pattern string can be a combination of valid file name characters
83
and the asterisk (*) wildcard character. Do not include spaces in the pattern string.
84
*/
85
 
444 daniel-mar 86
Boolean putfile(PString prompt, PString fname,OSType fileType,OSType fileCreator,
268 daniel-mar 87
                NavReplyRecord *reply,StandardFileReply *sfr,
444 daniel-mar 88
                const TCHAR *lpstrDefExt, const TCHAR *lpstrFilter,int nFilterIndex
268 daniel-mar 89
                #ifdef _WIN32
90
                ,HWND hwndOwner
91
                #endif /* _WIN32 */
92
);
93
 
259 daniel-mar 94
OSErr completesave(NavReplyRecord *reply);
95
 
444 daniel-mar 96
Boolean choosefile_sf(PString prompt,StandardFileReply *sfr,NavReplyRecord *reply,
97
                      OSType type,const TCHAR *lpstrFilter);
268 daniel-mar 98
 
444 daniel-mar 99
Boolean putfile_sf(PString prompt, PString fname,
268 daniel-mar 100
                   OSType fileType,OSType fileCreator,
101
                   NavReplyRecord *reply,StandardFileReply *sfr);
102
 
259 daniel-mar 103
OSErr completesave_sf(NavReplyRecord *reply);
104
 
105
Boolean customchoosefile_nav(FSSpec *fss,ScriptCode *script,
444 daniel-mar 106
                             OSType tlist[], PString extlist[],Boolean *premult);
268 daniel-mar 107
 
444 daniel-mar 108
Boolean choosefile_nav(PString prompt,StandardFileReply *sfr,NavReplyRecord *reply,
109
                       OSType type,const TCHAR *lpstrFilter);
268 daniel-mar 110
 
444 daniel-mar 111
Boolean putfile_nav(PString prompt, PString fname,
268 daniel-mar 112
                    OSType fileType,OSType fileCreator,
113
                    NavReplyRecord *reply,StandardFileReply *sfr);
114
 
259 daniel-mar 115
OSErr completesave_nav(NavReplyRecord *reply);
116
 
117
#endif