| 1 | |
| 2 | #ifndef __GTK_DIR_SEL_H__ |
| 3 | #define __GTK_DIR_SEL_H__ |
| 4 | |
| 5 | |
| 6 | #include <gdk/gdk.h> |
| 7 | #include <gtk/gtkdialog.h> |
| 8 | |
| 9 | |
| 10 | #ifdef __cplusplus |
| 11 | extern "C" { |
| 12 | #endif /* __cplusplus */ |
| 13 | |
| 14 | |
| 15 | #define GTK_TYPE_DIR_SELECTION (gtk_dir_selection_get_type ()) |
| 16 | #define GTK_DIR_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_DIR_SELECTION, GtkDirSelection)) |
| 17 | #define GTK_DIR_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_DIR_SELECTION, GtkDirSelectionClass)) |
| 18 | #define GTK_IS_DIR_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_DIR_SELECTION)) |
| 19 | #define GTK_IS_DIR_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DIR_SELECTION)) |
| 20 | #define GTK_DIR_SELECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_DIR_SELECTION, GtkDirSelectionClass)) |
| 21 | |
| 22 | |
| 23 | typedef struct _GtkDirSelection GtkDirSelection; |
| 24 | typedef struct _GtkDirSelectionClass GtkDirSelectionClass; |
| 25 | |
| 26 | struct _GtkDirSelection |
| 27 | { |
| 28 | GtkDialog parent_instance; |
| 29 | |
| 30 | GtkWidget *dir_list; |
| 31 | GtkWidget *file_list; |
| 32 | GtkWidget *selection_entry; |
| 33 | GtkWidget *selection_text; |
| 34 | GtkWidget *main_vbox; |
| 35 | GtkWidget *ok_button; |
| 36 | GtkWidget *cancel_button; |
| 37 | GtkWidget *help_button; |
| 38 | GtkWidget *history_pulldown; |
| 39 | GtkWidget *history_menu; |
| 40 | GList *history_list; |
| 41 | GtkWidget *fileop_dialog; |
| 42 | GtkWidget *fileop_entry; |
| 43 | gchar *fileop_file; |
| 44 | gpointer cmpl_state; |
| 45 | |
| 46 | GtkWidget *fileop_c_dir; |
| 47 | GtkWidget *fileop_del_file; |
| 48 | GtkWidget *fileop_ren_file; |
| 49 | |
| 50 | GtkWidget *button_area; |
| 51 | GtkWidget *action_area; |
| 52 | |
| 53 | GPtrArray *selected_names; |
| 54 | gchar *last_selected; |
| 55 | }; |
| 56 | |
| 57 | struct _GtkDirSelectionClass |
| 58 | { |
| 59 | GtkDialogClass parent_class; |
| 60 | |
| 61 | /* Padding for future expansion */ |
| 62 | void (*_gtk_reserved1) (void); |
| 63 | void (*_gtk_reserved2) (void); |
| 64 | void (*_gtk_reserved3) (void); |
| 65 | void (*_gtk_reserved4) (void); |
| 66 | }; |
| 67 | |
| 68 | |
| 69 | GType gtk_dir_selection_get_type (void) G_GNUC_CONST; |
| 70 | GtkWidget* gtk_dir_selection_new (const gchar *title); |
| 71 | void gtk_dir_selection_set_filename (GtkDirSelection *filesel, |
| 72 | const gchar *filename); |
| 73 | /* This function returns the selected filename in the C runtime's |
| 74 | * multibyte string encoding, which may or may not be the same as that |
| 75 | * used by GDK (UTF-8). To convert to UTF-8, call g_filename_to_utf8(). |
| 76 | * The returned string points to a statically allocated buffer and |
| 77 | * should be copied away. |
| 78 | */ |
| 79 | G_CONST_RETURN gchar* gtk_dir_selection_get_filename (GtkDirSelection *filesel); |
| 80 | |
| 81 | void gtk_dir_selection_complete (GtkDirSelection *filesel, |
| 82 | const gchar *pattern); |
| 83 | void gtk_dir_selection_show_fileop_buttons (GtkDirSelection *filesel); |
| 84 | void gtk_dir_selection_hide_fileop_buttons (GtkDirSelection *filesel); |
| 85 | |
| 86 | gchar** gtk_dir_selection_get_selections (GtkDirSelection *filesel); |
| 87 | const gchar * gtk_dir_selection_get_dir (GtkDirSelection *filesel); |
| 88 | void gtk_dir_selection_set_select_multiple (GtkDirSelection *filesel, |
| 89 | gboolean select_multiple); |
| 90 | gboolean gtk_dir_selection_get_select_multiple (GtkDirSelection *filesel); |
| 91 | |
| 92 | #ifdef __cplusplus |
| 93 | } |
| 94 | #endif /* __cplusplus */ |
| 95 | |
| 96 | |
| 97 | #endif /* __GTK_DIR_SEL_H__ */ |