1 /* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2003-2004 Xiangxiu Yang
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License Version 2 as
6 * published by the Free Software Foundation;
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 General Public License for more details.
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,
20 #ifndef __GTK_DIR_SEL_H__
21 #define __GTK_DIR_SEL_H__
25 #include <gtk/gtkdialog.h>
30 #endif /* __cplusplus */
33 #define GTK_TYPE_DIR_SELECTION (gtk_dir_selection_get_type ())
34 #define GTK_DIR_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_DIR_SELECTION, GtkDirSelection))
35 #define GTK_DIR_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_DIR_SELECTION, GtkDirSelectionClass))
36 #define GTK_IS_DIR_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_DIR_SELECTION))
37 #define GTK_IS_DIR_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DIR_SELECTION))
38 #define GTK_DIR_SELECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_DIR_SELECTION, GtkDirSelectionClass))
41 typedef struct _GtkDirSelection GtkDirSelection
;
42 typedef struct _GtkDirSelectionClass GtkDirSelectionClass
;
44 struct _GtkDirSelection
46 GtkDialog parent_instance
;
50 GtkWidget
*selection_entry
;
51 GtkWidget
*selection_text
;
54 GtkWidget
*cancel_button
;
55 GtkWidget
*help_button
;
56 GtkWidget
*history_pulldown
;
57 GtkWidget
*history_menu
;
59 GtkWidget
*fileop_dialog
;
60 GtkWidget
*fileop_entry
;
64 GtkWidget
*fileop_c_dir
;
65 GtkWidget
*fileop_del_file
;
66 GtkWidget
*fileop_ren_file
;
68 GtkWidget
*button_area
;
69 GtkWidget
*action_area
;
71 GPtrArray
*selected_names
;
75 struct _GtkDirSelectionClass
77 GtkDialogClass parent_class
;
79 /* Padding for future expansion */
80 void (*_gtk_reserved1
) (void);
81 void (*_gtk_reserved2
) (void);
82 void (*_gtk_reserved3
) (void);
83 void (*_gtk_reserved4
) (void);
87 GType
gtk_dir_selection_get_type (void) G_GNUC_CONST
;
88 GtkWidget
* gtk_dir_selection_new (const gchar
*title
);
89 void gtk_dir_selection_set_filename (GtkDirSelection
*filesel
,
90 const gchar
*filename
);
91 /* This function returns the selected filename in the C runtime's
92 * multibyte string encoding, which may or may not be the same as that
93 * used by GDK (UTF-8). To convert to UTF-8, call g_filename_to_utf8().
94 * The returned string points to a statically allocated buffer and
95 * should be copied away.
97 G_CONST_RETURN gchar
* gtk_dir_selection_get_filename (GtkDirSelection
*filesel
);
99 void gtk_dir_selection_complete (GtkDirSelection
*filesel
,
100 const gchar
*pattern
);
101 void gtk_dir_selection_show_fileop_buttons (GtkDirSelection
*filesel
);
102 void gtk_dir_selection_hide_fileop_buttons (GtkDirSelection
*filesel
);
104 gchar
** gtk_dir_selection_get_selections (GtkDirSelection
*filesel
);
105 const gchar
* gtk_dir_selection_get_dir (GtkDirSelection
*filesel
);
106 void gtk_dir_selection_set_select_multiple (GtkDirSelection
*filesel
,
107 gboolean select_multiple
);
108 gboolean
gtk_dir_selection_get_select_multiple (GtkDirSelection
*filesel
);
112 #endif /* __cplusplus */
115 #endif /* __GTK_DIR_SEL_H__ */