4 * Declarations for the file filter processing routines needed by
5 * the file selection dialogs.
7 * Copyright (c) 1996 Sun Microsystems, Inc.
9 * See the file "license.terms" for information on usage and redistribution
10 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
16 #ifndef _TK_FILE_FILTER
17 #define _TK_FILE_FILTER
20 #include <StandardFile.h>
26 # undef TCL_STORAGE_CLASS
27 # define TCL_STORAGE_CLASS DLLEXPORT
30 typedef struct GlobPattern {
31 struct GlobPattern * next; /* Chains to the next glob pattern
32 * in a glob pattern list */
33 char * pattern; /* String value of the pattern, such
38 typedef struct MacFileType {
39 struct MacFileType * next; /* Chains to the next mac file type
40 * in a mac file type list */
41 OSType type; /* Mac file type, such as 'TEXT' or
45 typedef struct FileFilterClause {
46 struct FileFilterClause * next; /* Chains to the next clause in
48 GlobPattern * patterns; /* Head of glob pattern type list */
49 GlobPattern * patternsTail; /* Tail of glob pattern type list */
50 MacFileType * macTypes; /* Head of mac file type list */
51 MacFileType * macTypesTail; /* Tail of mac file type list */
54 typedef struct FileFilter {
55 struct FileFilter * next; /* Chains to the next filter
57 char * name; /* Name of the file filter,
58 * such as "Text Documents" */
59 FileFilterClause * clauses; /* Head of the clauses list */
60 FileFilterClause * clausesTail; /* Tail of the clauses list */
63 /*----------------------------------------------------------------------
66 * The routine TkGetFileFilters() translates the string value of the
67 * -filefilters option into a FileFilterList structure, which consists
68 * of a list of file filters.
70 * Each file filter consists of one or more clauses. Each clause has
71 * one or more glob patterns and/or one or more Mac file types
72 *----------------------------------------------------------------------
75 typedef struct FileFilterList {
76 FileFilter * filters; /* Head of the filter list */
77 FileFilter * filtersTail; /* Tail of the filter list */
78 int numFilters; /* number of filters in the list */
81 EXTERN void TkFreeFileFilters _ANSI_ARGS_((
82 FileFilterList * flistPtr));
83 EXTERN void TkInitFileFilters _ANSI_ARGS_((
84 FileFilterList * flistPtr));
85 EXTERN int TkGetFileFilters _ANSI_ARGS_ ((Tcl_Interp *interp,
86 FileFilterList * flistPtr, char * string,
89 # undef TCL_STORAGE_CLASS
90 # define TCL_STORAGE_CLASS DLLIMPORT