1 /*****************************************************************
2  * gmerlin - a general purpose multimedia framework and applications
3  *
4  * Copyright (c) 2001 - 2011 Members of the Gmerlin project
5  * gmerlin-general@lists.sourceforge.net
6  * http://gmerlin.sourceforge.net
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20  * *****************************************************************/
21 
22 
23 typedef struct bg_gtk_filesel_s bg_gtk_filesel_t;
24 
25 /* Create fileselector with callback */
26 
27 bg_gtk_filesel_t *
28 bg_gtk_filesel_create(const char * title,
29                       void (*add_file)(char ** files, const char * plugin,
30                                        int prefer_edl,
31                                        void * data),
32                       void (*close_notify)(bg_gtk_filesel_t *,
33                                            void * data),
34                       void * user_data,
35                       GtkWidget * parent_window,
36                       bg_plugin_registry_t * plugin_reg, int type_mask,
37                       int flag_mask);
38 
39 /* Create directory selector (for addig directories to the tree) */
40 
41 bg_gtk_filesel_t *
42 bg_gtk_dirsel_create(const char * title,
43                      void (*add_dir)(char * dir, int recursive,
44                                      int subdirs_as_subalbums,
45                                      int watch,
46                                      const char * plugin,
47                                      int prefer_edl,
48                                      void * data),
49                      void (*close_notify)(bg_gtk_filesel_t *,
50                                           void * data),
51                      void * user_data,
52                      GtkWidget * parent_window,
53                      bg_plugin_registry_t * plugin_reg, int type_mask, int flag_mask);
54 
55 
56 /* Destroy fileselector */
57 
58 void bg_gtk_filesel_destroy(bg_gtk_filesel_t * filesel);
59 
60 /* Show the window */
61 
62 /* A non modal window will destroy itself when it's closed */
63 
64 void bg_gtk_filesel_run(bg_gtk_filesel_t * filesel, int modal);
65 
66 /* Get the current working directory */
67 
68 const char * bg_gtk_filesel_get_directory(bg_gtk_filesel_t * filesel);
69 void bg_gtk_filesel_set_directory(bg_gtk_filesel_t * filesel,
70                                   const char * dir);
71 
72 /*
73  *  Create a temporary fileselector and ask
74  *  for a file to save something
75  *
76  *  Return value should be freed with free();
77  */
78 
79 char * bg_gtk_get_filename_write(const char * title,
80                                  char ** directory,
81                                  int ask_overwrite, GtkWidget * parent);
82 
83 char * bg_gtk_get_filename_read(const char * title,
84                                 char ** directory, GtkWidget * parent);
85