1 #ifndef ASGTKIMAGEDIR_H_HEADER_INCLUDED 2 #define ASGTKIMAGEDIR_H_HEADER_INCLUDED 3 4 5 #define ASGTK_TYPE_IMAGE_DIR (asgtk_image_dir_get_type ()) 6 #define ASGTK_IMAGE_DIR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ASGTK_TYPE_IMAGE_DIR, ASGtkImageDir)) 7 #define ASGTK_IMAGE_DIR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ASGTK_TYPE_IMAGE_DIR, ASGtkImageDirClass)) 8 #define ASGTK_IS_IMAGE_DIR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ASGTK_TYPE_IMAGE_DIR)) 9 #define ASGTK_IS_IMAGE_DIR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ASGTK_TYPE_IMAGE_DIR)) 10 #define ASGTK_IMAGE_DIR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ASGTK_TYPE_IMAGE_DIR, ASGtkImageDir)) 11 12 13 struct ASImageListEntry; 14 struct ASImage; 15 struct _ASGtkImageDir; 16 17 typedef void (*_ASGtkImageDir_sel_handler)(struct _ASGtkImageDir *id, gpointer user_data); 18 19 20 typedef struct _ASGtkImageDir 21 { 22 GtkScrolledWindow parent_instance; 23 /* flags : */ 24 /* mask of what columns to show : */ 25 #define ASGTK_ImageDir_Col_Name_No 0 26 #define ASGTK_ImageDir_Col_Name (0x01<<0) 27 #define ASGTK_ImageDir_Col_Type_No 1 28 #define ASGTK_ImageDir_Col_Type (0x01<<ASGTK_ImageDir_Col_Type_No) 29 #define ASGTK_ImageDir_Col_Size_No 2 30 #define ASGTK_ImageDir_Col_Size (0x01<<ASGTK_ImageDir_Col_Size_No) 31 #define ASGTK_ImageDir_Col_Date_No 3 32 #define ASGTK_ImageDir_Col_Date (0x01<<ASGTK_ImageDir_Col_Date_No) 33 #define ASGTK_ImageDir_Col_Perms_No 4 34 #define ASGTK_ImageDir_Col_Perms (0x01<<ASGTK_ImageDir_Col_Perms_No) 35 #define ASGTK_ImageDir_Cols 5 /* count of the above items */ 36 #define ASGTK_ImageDir_Cols_All (ASGTK_ImageDir_Col_Name|ASGTK_ImageDir_Col_Type| \ 37 ASGTK_ImageDir_Col_Size|ASGTK_ImageDir_Col_Date| \ 38 ASGTK_ImageDir_Col_Perms) 39 /* other flags : */ 40 #define ASGTK_ImageDir_ListAll (0x01<<16) /* otherwise only the known types of files */ 41 /* defaults : */ 42 #define ASGTK_ImageDir_DefaultFlags (ASGTK_ImageDir_Col_Name) 43 ASFlagType flags ; 44 char *fulldirname ; 45 char *mini_extension ; 46 struct ASImageListEntry *entries; 47 struct ASImageListEntry *curr_selection; 48 49 GtkTreeView *tree_view; 50 GtkTreeModel *tree_model; 51 GtkTreeViewColumn *columns[ASGTK_ImageDir_Cols]; 52 53 /* screw GTK signals - hate its guts */ 54 _ASGtkImageDir_sel_handler sel_change_handler; 55 gpointer sel_change_user_data; 56 57 }ASGtkImageDir; 58 59 typedef struct _ASGtkImageDirClass 60 { 61 GtkScrolledWindowClass parent_class; 62 63 }ASGtkImageDirClass; 64 65 66 GType asgtk_image_dir_get_type (void) G_GNUC_CONST; 67 68 GtkWidget * asgtk_image_dir_new (); 69 70 void asgtk_image_dir_set_path( ASGtkImageDir *id, char *fulldirname ); 71 void asgtk_image_dir_set_mini( ASGtkImageDir *id, char *mini_extension ); 72 void asgtk_image_dir_set_title( ASGtkImageDir *id, const gchar *title ); 73 void asgtk_image_dir_set_sel_handler( ASGtkImageDir *id, _ASGtkImageDir_sel_handler sel_change_handler, gpointer user_data ); 74 struct ASImageListEntry *asgtk_image_dir_get_selection( ASGtkImageDir *id ); 75 void asgtk_image_dir_refresh( ASGtkImageDir *id ); 76 Bool asgtk_image_dir_make_mini_names( ASGtkImageDir *id, const char *name, char **name_return, char **fullname_return ); 77 78 void asgtk_image_dir_set_columns( ASGtkImageDir *id, ASFlagType columns ); 79 void asgtk_image_dir_set_list_all( ASGtkImageDir *id, Bool enable ); 80 81 /* standard selection handler linking dir to ASGTKImageView window : */ 82 void asgtk_image_dir2view_sel_handler(ASGtkImageDir *id, gpointer user_data); 83 FILE *open_xml_file_in_dir( ASGtkImageDir *id, const char *name, Bool mini ); 84 Bool make_xml_from_string( ASGtkImageDir *id, const char*name, const char *str, Bool mini ); 85 Bool make_mini_for_image_entry(ASGtkImageDir *id, struct ASImageListEntry *entry, const char *mini_fullfilename); 86 87 88 89 90 #endif /* ASGTKIMAGEDIR_H_HEADER_INCLUDED */ 91