tkFileFilter.h
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:3k
源码类别:

通讯编程

开发平台:

Visual C++

  1. /*
  2.  * tkFileFilter.h --
  3.  *
  4.  * Declarations for the file filter processing routines needed by
  5.  * the file selection dialogs.
  6.  *
  7.  * Copyright (c) 1996 Sun Microsystems, Inc.
  8.  *
  9.  * See the file "license.terms" for information on usage and redistribution
  10.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  11.  *
  12.  * RCS: @(#) $Id: tkFileFilter.h,v 1.4 1998/09/14 18:23:10 stanton Exp $
  13.  *
  14.  */
  15. #ifndef _TK_FILE_FILTER
  16. #define _TK_FILE_FILTER
  17. #ifdef MAC_TCL
  18. #include <StandardFile.h>
  19. #else
  20. #define OSType long
  21. #endif
  22. #ifdef BUILD_tk
  23. # undef TCL_STORAGE_CLASS
  24. # define TCL_STORAGE_CLASS DLLEXPORT
  25. #endif
  26. typedef struct GlobPattern {
  27.     struct GlobPattern * next; /* Chains to the next glob pattern
  28.  * in a glob pattern list */
  29.     char * pattern; /* String value of the pattern, such
  30.  * as "*.txt" or "*.*"
  31.  */
  32. } GlobPattern;
  33. typedef struct MacFileType {
  34.     struct MacFileType * next; /* Chains to the next mac file type
  35.  * in a mac file type list */
  36.     OSType type; /* Mac file type, such as 'TEXT' or
  37.  * 'GIFF' */
  38. } MacFileType;
  39. typedef struct FileFilterClause {
  40.     struct FileFilterClause * next; /* Chains to the next clause in
  41.  * a clause list */
  42.     GlobPattern * patterns; /* Head of glob pattern type list */
  43.     GlobPattern * patternsTail; /* Tail of glob pattern type list */
  44.     MacFileType * macTypes; /* Head of mac file type list */
  45.     MacFileType * macTypesTail; /* Tail of mac file type list */
  46. } FileFilterClause;
  47. typedef struct FileFilter {
  48.     struct FileFilter * next; /* Chains to the next filter
  49.  * in a filter list */
  50.     char * name; /* Name of the file filter,
  51.  * such as "Text Documents" */
  52.     FileFilterClause * clauses; /* Head of the clauses list */
  53.     FileFilterClause * clausesTail; /* Tail of the clauses list */
  54. } FileFilter;
  55. /*----------------------------------------------------------------------
  56.  * FileFilterList --
  57.  *
  58.  * The routine TkGetFileFilters() translates the string value of the
  59.  * -filefilters option into a FileFilterList structure, which consists
  60.  * of a list of file filters.
  61.  *
  62.  * Each file filter consists of one or more clauses. Each clause has
  63.  * one or more glob patterns and/or one or more Mac file types
  64.  *----------------------------------------------------------------------
  65.  */
  66. typedef struct FileFilterList {
  67.     FileFilter * filters; /* Head of the filter list */
  68.     FileFilter * filtersTail; /* Tail of the filter list */
  69.     int numFilters; /* number of filters in the list */
  70. } FileFilterList;
  71. EXTERN void TkFreeFileFilters _ANSI_ARGS_((
  72.     FileFilterList * flistPtr));
  73. EXTERN void TkInitFileFilters _ANSI_ARGS_((
  74.     FileFilterList * flistPtr));
  75. EXTERN int TkGetFileFilters _ANSI_ARGS_ ((Tcl_Interp *interp,
  76.          FileFilterList * flistPtr, char * string,
  77.     int isWindows));
  78. # undef TCL_STORAGE_CLASS
  79. # define TCL_STORAGE_CLASS DLLIMPORT
  80. #endif