1997-11-24 22:37:52 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2000-07-26 11:33:08 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1997-11-24 22:37:52 +00:00
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-07-26 11:33:08 +00:00
|
|
|
* Lesser General Public License for more details.
|
1997-11-24 22:37:52 +00:00
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
1998-04-13 02:02:47 +00:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
1997-11-24 22:37:52 +00:00
|
|
|
*/
|
1999-02-24 07:37:18 +00:00
|
|
|
|
|
|
|
/*
|
2000-07-26 11:33:08 +00:00
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
1999-02-24 07:37:18 +00:00
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
* files for a list of changes. These files are distributed with
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
*/
|
|
|
|
|
2007-01-27 05:34:05 +00:00
|
|
|
#ifndef GTK_DISABLE_DEPRECATED
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
#ifndef __GTK_FILESEL_H__
|
|
|
|
#define __GTK_FILESEL_H__
|
|
|
|
|
|
|
|
|
|
|
|
#include <gdk/gdk.h>
|
Derive from GtkDialog, and use stock buttons. Should be 100% source
2000-11-02 Havoc Pennington <hp@redhat.com>
* gtk/gtkfilesel.h, gtk/gtkfilesel.c: Derive from GtkDialog, and
use stock buttons. Should be 100% source compatible, appropriate
filesel fields now point to dialog->vbox and dialog->action_area.
On the bizarre side, dialog->action_area and filesel->action_area
are not the same widget.
(gtk_file_selection_init): Put some padding around the selection
entry, so it isn't touching the GtkDialog separator.
* gtk/gtkfontsel.h, gtk/gtkfontsel.c: Derive from GtkDialog,
use stock buttons, etc. Should also be source compatible.
Set the dialog default title in _init not _new().
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init):
Use stock buttons; don't put a button box inside the existing
dialog button box. Don't bother with push/pop colormap anymore.
* gtk/gtkdialog.h (GtkResponseType): Add a bunch of more
specific GTK_RESPONSE_* values. This is clearer than ACCEPT/REJECT
for message dialog, and necessary for the font selection and color
selection with help and apply buttons.
* gtk/gtkdialog.c (gtk_dialog_add_button): Return a pointer
to the created button widget. Set GTK_CAN_DEFAULT on the button.
(gtk_dialog_init): Default to GTK_BUTTONBOX_END, put less spacing
between buttons, put less padding around the action area.
(gtk_dialog_run): Exit on unmap rather than on destroy.
This will also exit the loop if the widget is hidden.
(gtk_dialog_delete_event_handler): Use GTK_RESPONSE_DELETE_EVENT
instead of GTK_RESPONSE_NONE; since we're already adding a bunch
of GTK_RESPONSE_* stuff, this seems cleaner, and lets you
special-case delete event.
* gtk/gtktexttagtable.c, gtk/gtktextview.c: Fix doc comment
formatting
2000-11-06 16:44:01 +00:00
|
|
|
#include <gtk/gtkdialog.h>
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
|
2005-06-21 05:35:43 +00:00
|
|
|
G_BEGIN_DECLS
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
|
1998-10-22 00:54:57 +00:00
|
|
|
#define GTK_TYPE_FILE_SELECTION (gtk_file_selection_get_type ())
|
2002-10-09 22:11:08 +00:00
|
|
|
#define GTK_FILE_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FILE_SELECTION, GtkFileSelection))
|
|
|
|
#define GTK_FILE_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_FILE_SELECTION, GtkFileSelectionClass))
|
|
|
|
#define GTK_IS_FILE_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FILE_SELECTION))
|
|
|
|
#define GTK_IS_FILE_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FILE_SELECTION))
|
|
|
|
#define GTK_FILE_SELECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FILE_SELECTION, GtkFileSelectionClass))
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct _GtkFileSelection GtkFileSelection;
|
|
|
|
typedef struct _GtkFileSelectionClass GtkFileSelectionClass;
|
|
|
|
|
|
|
|
struct _GtkFileSelection
|
|
|
|
{
|
2003-01-04 20:44:29 +00:00
|
|
|
/*< private >*/
|
Derive from GtkDialog, and use stock buttons. Should be 100% source
2000-11-02 Havoc Pennington <hp@redhat.com>
* gtk/gtkfilesel.h, gtk/gtkfilesel.c: Derive from GtkDialog, and
use stock buttons. Should be 100% source compatible, appropriate
filesel fields now point to dialog->vbox and dialog->action_area.
On the bizarre side, dialog->action_area and filesel->action_area
are not the same widget.
(gtk_file_selection_init): Put some padding around the selection
entry, so it isn't touching the GtkDialog separator.
* gtk/gtkfontsel.h, gtk/gtkfontsel.c: Derive from GtkDialog,
use stock buttons, etc. Should also be source compatible.
Set the dialog default title in _init not _new().
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init):
Use stock buttons; don't put a button box inside the existing
dialog button box. Don't bother with push/pop colormap anymore.
* gtk/gtkdialog.h (GtkResponseType): Add a bunch of more
specific GTK_RESPONSE_* values. This is clearer than ACCEPT/REJECT
for message dialog, and necessary for the font selection and color
selection with help and apply buttons.
* gtk/gtkdialog.c (gtk_dialog_add_button): Return a pointer
to the created button widget. Set GTK_CAN_DEFAULT on the button.
(gtk_dialog_init): Default to GTK_BUTTONBOX_END, put less spacing
between buttons, put less padding around the action area.
(gtk_dialog_run): Exit on unmap rather than on destroy.
This will also exit the loop if the widget is hidden.
(gtk_dialog_delete_event_handler): Use GTK_RESPONSE_DELETE_EVENT
instead of GTK_RESPONSE_NONE; since we're already adding a bunch
of GTK_RESPONSE_* stuff, this seems cleaner, and lets you
special-case delete event.
* gtk/gtktexttagtable.c, gtk/gtktextview.c: Fix doc comment
formatting
2000-11-06 16:44:01 +00:00
|
|
|
GtkDialog parent_instance;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2003-01-04 20:44:29 +00:00
|
|
|
/*< public >*/
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkWidget *dir_list;
|
|
|
|
GtkWidget *file_list;
|
|
|
|
GtkWidget *selection_entry;
|
|
|
|
GtkWidget *selection_text;
|
|
|
|
GtkWidget *main_vbox;
|
|
|
|
GtkWidget *ok_button;
|
|
|
|
GtkWidget *cancel_button;
|
|
|
|
GtkWidget *help_button;
|
1998-01-21 07:53:07 +00:00
|
|
|
GtkWidget *history_pulldown;
|
|
|
|
GtkWidget *history_menu;
|
|
|
|
GList *history_list;
|
|
|
|
GtkWidget *fileop_dialog;
|
|
|
|
GtkWidget *fileop_entry;
|
|
|
|
gchar *fileop_file;
|
|
|
|
gpointer cmpl_state;
|
1998-03-06 05:03:15 +00:00
|
|
|
|
|
|
|
GtkWidget *fileop_c_dir;
|
|
|
|
GtkWidget *fileop_del_file;
|
|
|
|
GtkWidget *fileop_ren_file;
|
|
|
|
|
|
|
|
GtkWidget *button_area;
|
|
|
|
GtkWidget *action_area;
|
2002-02-17 00:07:48 +00:00
|
|
|
|
2003-01-04 20:44:29 +00:00
|
|
|
/*< private >*/
|
2002-02-17 00:07:48 +00:00
|
|
|
GPtrArray *selected_names;
|
|
|
|
gchar *last_selected;
|
1997-11-24 22:37:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GtkFileSelectionClass
|
|
|
|
{
|
Derive from GtkDialog, and use stock buttons. Should be 100% source
2000-11-02 Havoc Pennington <hp@redhat.com>
* gtk/gtkfilesel.h, gtk/gtkfilesel.c: Derive from GtkDialog, and
use stock buttons. Should be 100% source compatible, appropriate
filesel fields now point to dialog->vbox and dialog->action_area.
On the bizarre side, dialog->action_area and filesel->action_area
are not the same widget.
(gtk_file_selection_init): Put some padding around the selection
entry, so it isn't touching the GtkDialog separator.
* gtk/gtkfontsel.h, gtk/gtkfontsel.c: Derive from GtkDialog,
use stock buttons, etc. Should also be source compatible.
Set the dialog default title in _init not _new().
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init):
Use stock buttons; don't put a button box inside the existing
dialog button box. Don't bother with push/pop colormap anymore.
* gtk/gtkdialog.h (GtkResponseType): Add a bunch of more
specific GTK_RESPONSE_* values. This is clearer than ACCEPT/REJECT
for message dialog, and necessary for the font selection and color
selection with help and apply buttons.
* gtk/gtkdialog.c (gtk_dialog_add_button): Return a pointer
to the created button widget. Set GTK_CAN_DEFAULT on the button.
(gtk_dialog_init): Default to GTK_BUTTONBOX_END, put less spacing
between buttons, put less padding around the action area.
(gtk_dialog_run): Exit on unmap rather than on destroy.
This will also exit the loop if the widget is hidden.
(gtk_dialog_delete_event_handler): Use GTK_RESPONSE_DELETE_EVENT
instead of GTK_RESPONSE_NONE; since we're already adding a bunch
of GTK_RESPONSE_* stuff, this seems cleaner, and lets you
special-case delete event.
* gtk/gtktexttagtable.c, gtk/gtktextview.c: Fix doc comment
formatting
2000-11-06 16:44:01 +00:00
|
|
|
GtkDialogClass parent_class;
|
2002-02-23 20:22:05 +00:00
|
|
|
|
|
|
|
/* Padding for future expansion */
|
|
|
|
void (*_gtk_reserved1) (void);
|
|
|
|
void (*_gtk_reserved2) (void);
|
|
|
|
void (*_gtk_reserved3) (void);
|
|
|
|
void (*_gtk_reserved4) (void);
|
1997-11-24 22:37:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-12-12 21:09:13 +00:00
|
|
|
#ifdef G_OS_WIN32
|
|
|
|
/* Reserve old names for DLL ABI backward compatibility */
|
|
|
|
#define gtk_file_selection_get_filename gtk_file_selection_get_filename_utf8
|
|
|
|
#define gtk_file_selection_set_filename gtk_file_selection_set_filename_utf8
|
|
|
|
#define gtk_file_selection_get_selections gtk_file_selection_get_selections_utf8
|
|
|
|
#endif
|
|
|
|
|
2002-10-09 22:11:08 +00:00
|
|
|
GType gtk_file_selection_get_type (void) G_GNUC_CONST;
|
1998-10-22 00:54:57 +00:00
|
|
|
GtkWidget* gtk_file_selection_new (const gchar *title);
|
|
|
|
void gtk_file_selection_set_filename (GtkFileSelection *filesel,
|
|
|
|
const gchar *filename);
|
2001-03-23 23:39:24 +00:00
|
|
|
G_CONST_RETURN gchar* gtk_file_selection_get_filename (GtkFileSelection *filesel);
|
2000-02-03 01:19:03 +00:00
|
|
|
|
1998-10-22 00:54:57 +00:00
|
|
|
void gtk_file_selection_complete (GtkFileSelection *filesel,
|
|
|
|
const gchar *pattern);
|
1998-03-06 05:03:15 +00:00
|
|
|
void gtk_file_selection_show_fileop_buttons (GtkFileSelection *filesel);
|
|
|
|
void gtk_file_selection_hide_fileop_buttons (GtkFileSelection *filesel);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2002-02-17 00:07:48 +00:00
|
|
|
gchar** gtk_file_selection_get_selections (GtkFileSelection *filesel);
|
|
|
|
|
|
|
|
void gtk_file_selection_set_select_multiple (GtkFileSelection *filesel,
|
|
|
|
gboolean select_multiple);
|
|
|
|
gboolean gtk_file_selection_get_select_multiple (GtkFileSelection *filesel);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2005-06-21 05:35:43 +00:00
|
|
|
|
|
|
|
G_END_DECLS
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* __GTK_FILESEL_H__ */
|
2007-01-27 05:34:05 +00:00
|
|
|
|
|
|
|
#endif /* GTK_DISABLE_DEPRECATED */
|