r4888: Don't try to thumbnail zero-byte files. They're either empty, or special and
[rox-filer/translations.git] / ROX-Filer / src / gtksavebox.h
blob04e16b488c7dad72fc17141b9a8f120d633baca1
1 /*
2 * SaveBox widget for the ROX desktop project
3 * By Thomas Leonard, <tal197@users.sourceforge.net>.
4 */
6 #ifndef __GTK_SAVEBOX_H__
7 #define __GTK_SAVEBOX_H__
10 #include <gdk/gdk.h>
11 #include <gtk/gtkdialog.h>
12 #include <gtk/gtkselection.h>
15 #ifdef __cplusplus
16 extern "C" {
17 #endif /* __cplusplus */
19 /* This is for the 'info' value of the GtkTargetList.
20 * It's for the XdndDirectSave0 target - ignore requests for this target
21 * because they're handled internally by the widget. Don't use this
22 * value for anything else!
24 #define GTK_TARGET_XDS 0x584453
26 #define GTK_TYPE_SAVEBOX (gtk_savebox_get_type ())
28 #define GTK_SAVEBOX(obj) \
29 (GTK_CHECK_CAST ((obj), GTK_TYPE_SAVEBOX, GtkSavebox))
31 #define GTK_SAVEBOX_CLASS(klass) \
32 (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_SAVEBOX, GtkSaveboxClass))
34 #define GTK_IS_SAVEBOX(obj) \
35 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SAVEBOX))
37 #define GTK_IS_SAVEBOX_CLASS(klass) \
38 (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SAVEBOX))
41 typedef struct _GtkSavebox GtkSavebox;
42 typedef struct _GtkSaveboxClass GtkSaveboxClass;
43 typedef struct _GtkSaveboxButton GtkSaveboxButton;
45 enum {
46 GTK_XDS_SAVED, /* Done the save - no problem */
47 GTK_XDS_SAVE_ERROR, /* Error during save - reported */
48 GTK_XDS_NO_HANDLER, /* Used internally (sanity checking) */
51 struct _GtkSavebox
53 GtkDialog dialog;
55 GtkWidget *discard_area; /* Normally hidden */
56 GtkWidget *drag_box; /* Event box - contains pixmap, or NULL */
57 GtkWidget *icon; /* The pixmap widget */
58 GtkWidget *entry; /* Where the pathname goes */
60 GtkTargetList *targets; /* Formats that we can save in */
61 gboolean using_xds; /* Have we sent XDS reply 'S' or 'F' yet? */
62 gboolean data_sent; /* Did we send any data at all this drag? */
64 GdkDragAction dnd_action;
67 struct _GtkSaveboxClass
69 GtkDialogClass parent_class;
71 gint (*save_to_file) (GtkSavebox *savebox, guchar *pathname);
72 void (*saved_to_uri) (GtkSavebox *savebox, guchar *uri);
76 GType gtk_savebox_get_type (void);
77 GtkWidget* gtk_savebox_new (const gchar *action);
78 void gtk_savebox_set_icon (GtkSavebox *savebox,
79 GdkPixbuf *pixbuf);
80 void gtk_savebox_set_pathname (GtkSavebox *savebox,
81 const gchar *pathname);
82 void gtk_savebox_set_has_discard (GtkSavebox *savebox, gboolean setting);
83 void gtk_savebox_set_action (GtkSavebox *savebox,
84 GdkDragAction action);
87 #ifdef __cplusplus
89 #endif /* __cplusplus */
92 #endif /* __GTK_SAVEBOX_H__ */