diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2016-10-18 17:31:55 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2016-10-18 17:31:55 (GMT) |
commit | 39e34335fb6eb6eaf2b7ee51ccf172006dd46fbb (patch) | |
tree | 8e5374666c7f0b3017176ec9d6e6b6eae0dcabac /tk8.6/generic/tkFileFilter.h | |
parent | 066971b1e6e77991d9161bb0216a63ba94ea04f9 (diff) | |
parent | 6b095f3c8521ca7215e6ff5dcbada52b197ef7d0 (diff) | |
download | blt-39e34335fb6eb6eaf2b7ee51ccf172006dd46fbb.zip blt-39e34335fb6eb6eaf2b7ee51ccf172006dd46fbb.tar.gz blt-39e34335fb6eb6eaf2b7ee51ccf172006dd46fbb.tar.bz2 |
Merge commit '6b095f3c8521ca7215e6ff5dcbada52b197ef7d0' as 'tk8.6'
Diffstat (limited to 'tk8.6/generic/tkFileFilter.h')
-rw-r--r-- | tk8.6/generic/tkFileFilter.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/tk8.6/generic/tkFileFilter.h b/tk8.6/generic/tkFileFilter.h new file mode 100644 index 0000000..131e423 --- /dev/null +++ b/tk8.6/generic/tkFileFilter.h @@ -0,0 +1,78 @@ +/* + * tkFileFilter.h -- + * + * Declarations for the file filter processing routines needed by the + * file selection dialogs. + * + * Copyright (c) 1996 Sun Microsystems, Inc. + * + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. + */ + +#ifndef _TK_FILE_FILTER +#define _TK_FILE_FILTER + +#define OSType long + +typedef struct GlobPattern { + struct GlobPattern *next; /* Chains to the next glob pattern in a glob + * pattern list */ + char *pattern; /* String value of the pattern, such as + * "*.txt" or "*.*" */ +} GlobPattern; + +typedef struct MacFileType { + struct MacFileType *next; /* Chains to the next mac file type in a mac + * file type list */ + OSType type; /* Mac file type, such as 'TEXT' or 'GIFF' */ +} MacFileType; + +typedef struct FileFilterClause { + struct FileFilterClause *next; + /* Chains to the next clause in a clause + * list */ + GlobPattern *patterns; /* Head of glob pattern type list */ + GlobPattern *patternsTail; /* Tail of glob pattern type list */ + MacFileType *macTypes; /* Head of mac file type list */ + MacFileType *macTypesTail; /* Tail of mac file type list */ +} FileFilterClause; + +typedef struct FileFilter { + struct FileFilter *next; /* Chains to the next filter in a filter + * list */ + char *name; /* Name of the file filter, such as "Text + * Documents" */ + FileFilterClause *clauses; /* Head of the clauses list */ + FileFilterClause *clausesTail; + /* Tail of the clauses list */ +} FileFilter; + +/* + *---------------------------------------------------------------------- + * + * FileFilterList -- + * + * The routine TkGetFileFilters() translates the string value of the + * -filefilters option into a FileFilterList structure, which consists of + * a list of file filters. + * + * Each file filter consists of one or more clauses. Each clause has one + * or more glob patterns and/or one or more Mac file types + * + *---------------------------------------------------------------------- + */ + +typedef struct FileFilterList { + FileFilter *filters; /* Head of the filter list */ + FileFilter *filtersTail; /* Tail of the filter list */ + int numFilters; /* number of filters in the list */ +} FileFilterList; + +MODULE_SCOPE void TkFreeFileFilters(FileFilterList *flistPtr); +MODULE_SCOPE void TkInitFileFilters(FileFilterList *flistPtr); +MODULE_SCOPE int TkGetFileFilters(Tcl_Interp *interp, + FileFilterList *flistPtr, Tcl_Obj *valuePtr, + int isWindows); + +#endif /* _TK_FILE_FILTER */ |