Re: GtkFileChooser filter API



On Thu, Jul 17, 2003 at 04:50:20PM -0400, Owen Taylor wrote:
 
> One possible variation is to to make GtkFileFilter an abstract
> base class:
> 
> ====
> GtkFileFilter *gtk_file_filter_pattern_new (const gchar *pattern);
> GtkFileFilter *gtk_file_filter_mime_new    (const gchar *mime_type);
> GtkFileFilter *gtk_file_filter_multi_new   (void);
> void           gtk_file_filter_multi_add_filter (GtkFileFilterMulti *filter_multi,
>                                                  GtkFileFilter
> *filter);

Seems too complicated to me.

> gboolean (*GtkFileFilterFunc) (const gchar *filename,
>                                const gchar *uri,
>                                const gchar *mime_type,
>                                gpointer     data);
> 
> void gtk_file_filter_add_custom (GtkFileFilter    *filter,
>                                  GtkFileFilterFunc func,
>                                  gointer           data,
>                                  GDestroyNotify    notify);

My .02 vote is for this one. Maybe the filter func should take some
kind of struct or object for an argument, with filename/uri/mimetype
fields? Then you could extend with more info about the file in the
future.

Havoc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]