1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
22 * file for a list of people on the GTK+ Team. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
27 #ifndef __GTK_SAVEBOX_H__
28 #define __GTK_SAVEBOX_H__
32 #include <gtk/gtkwindow.h>
33 #include <gtk/gtkselection.h>
38 #endif /* __cplusplus */
40 /* This is for the 'info' value of the GtkTargetList.
41 * It's for the XdndDirectSave0 target - ignore requests for this target
42 * because they're handled internally by the widget. Don't use this
43 * value for anything else!
45 #define GTK_TARGET_XDS 0x584453
47 #define GTK_TYPE_SAVEBOX (gtk_savebox_get_type ())
49 #define GTK_SAVEBOX(obj) \
50 (GTK_CHECK_CAST ((obj), GTK_TYPE_SAVEBOX, GtkSavebox))
52 #define GTK_SAVEBOX_CLASS(klass) \
53 (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_SAVEBOX, GtkSaveboxClass))
55 #define GTK_IS_SAVEBOX(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_SAVEBOX))
57 #define GTK_IS_SAVEBOX_CLASS(klass) \
58 (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SAVEBOX))
61 typedef struct _GtkSavebox GtkSavebox
;
62 typedef struct _GtkSaveboxClass GtkSaveboxClass
;
63 typedef struct _GtkSaveboxButton GtkSaveboxButton
;
66 GTK_XDS_SAVED
, /* Done the save - no problem */
67 GTK_XDS_SAVE_ERROR
, /* Error during save - reported */
68 GTK_XDS_NO_HANDLER
, /* Used internally (sanity checking) */
75 GtkWidget
*drag_box
; /* Event box - contains pixmap, or NULL */
76 GtkWidget
*icon
; /* The pixmap widget */
77 GtkWidget
*entry
; /* Where the pathname goes */
78 GtkWidget
*vbox
; /* Append extra buttons here */
80 GtkTargetList
*targets
; /* Formats that we can save in */
81 gboolean using_xds
; /* Have we sent XDS reply 'S' or 'F' yet? */
82 gboolean data_sent
; /* Did we send any data at all this drag? */
85 struct _GtkSaveboxClass
87 GtkWindowClass parent_class
;
89 gint (*save_to_file
) (GtkSavebox
*savebox
, guchar
*pathname
);
90 void (*saved_to_uri
) (GtkSavebox
*savebox
, guchar
*uri
);
91 void (*save_done
) (GtkSavebox
*savebox
);
95 GtkType
gtk_savebox_get_type (void);
96 GtkWidget
* gtk_savebox_new (void);
97 void gtk_savebox_set_icon (GtkSavebox
*savebox
,
98 GdkPixmap
*pixmap
, GdkPixmap
*mask
);
99 void gtk_savebox_set_pathname (GtkSavebox
*savebox
,
100 const gchar
*pathname
);
105 #endif /* __cplusplus */
108 #endif /* __GTK_SAVEBOX_H__ */