1 /*  cssed (c) Iago Rubio 2003, 2005 - A tiny CSS editor.
2  *
3  *  This program is free software; you can redistribute it and/or modify
4  *  it under the terms of the GNU General Public License as published by
5  *  the Free Software Foundation; either version 2 of the License, or
6  *  (at your option) any later version.
7  *
8  *  This program is distributed in the hope that it will be useful,
9  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  *  GNU Library General Public License for more details.
12  *
13  *  You should have received a copy of the GNU General Public License
14  *  along with this program; if not, write to the Free Software
15  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16  */
17 
18 /* this is just eye candy to set the file type as data on
19    the menu item, to use the function cssed_file_type_menu_set_default_callback()
20    as menu item callback  */
21 #define cssed_file_type_menu_set_filetype(n, w) g_object_set_data(G_OBJECT(n), "filetype", w);
22 
23 CssedFileType*
24 cssed_file_type_new();
25 
26 void
27 cssed_file_type_free(CssedFileType* type);
28 
29 void
30 cssed_file_type_add_pattern_spec(CssedFileType* type, gchar* spec);
31 
32 
33 CssedFileTypeManager*
34 cssed_file_type_manager_new();
35 
36 void
37 cssed_file_type_manager_free( CssedFileTypeManager *manager );
38 
39 GSList*
40 cssed_file_type_manager_get_ids_from_filename (CssedFileTypeManager *manager, gchar *filename);
41 
42 CssedFileType*
43 cssed_file_type_manager_get_filetype_from_filename( CssedFileTypeManager *manager, gchar *filename );
44 
45 CssedFileType*
46 cssed_file_type_manager_get_filetype_from_id( CssedFileTypeManager *manager, CssedFileTypeId id );
47 
48 GSList*
49 cssed_file_type_manager_get_ids_from_pattern( CssedFileTypeManager *manager, gchar *pattern );
50 
51 CssedFileTypeId
52 cssed_file_type_manager_get_default_id_from_filename( CssedFileTypeManager *manager, gchar *filename );
53 
54 void
55 cssed_file_type_manager_add_pattern( CssedFileTypeManager *manager, gchar *pattern, CssedFileTypeId id );
56 
57 gboolean
58 cssed_file_type_manager_delete_pattern( CssedFileTypeManager *manager, gchar *pattern );
59 
60 gboolean
61 cssed_file_type_manager_pattern_exists( CssedFileTypeManager *manager, gchar *pattern );
62 
63 void
64 cssed_file_type_manager_add_filetype ( CssedFileTypeManager *manager, CssedFileType* type );
65 
66 // this is used as a callbak for the menu item that CssedFileType adds to the main menu
67 //void
68 //on_file_type_menu_activate (GtkMenuItem * menuitem, gpointer user_data);
69 
70 void
71 cssed_file_type_menu_set_default_callback(CssedWindow *window, GtkWidget *filetype_menu, CssedFileType *filetype);
72 
73