\section{gtksavebox.c File Reference}
\label{gtksavebox_8c}\index{gtksavebox.c@{gtksavebox.c}}
Drag and drop saving widget for GTK+. 

{\tt \#include \char`\"{}rox-clib.h\char`\"{}}\par
{\tt \#include $<$unistd.h$>$}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include $<$errno.h$>$}\par
{\tt \#include \char`\"{}gdk/gdkkeysyms.h\char`\"{}}\par
{\tt \#include \char`\"{}gtksavebox.h\char`\"{}}\par
{\tt \#include \char`\"{}gtk/gtkwidget.h\char`\"{}}\par
{\tt \#include \char`\"{}gtk/gtkalignment.h\char`\"{}}\par
{\tt \#include \char`\"{}gtk/gtkdnd.h\char`\"{}}\par
{\tt \#include \char`\"{}gtk/gtkbutton.h\char`\"{}}\par
{\tt \#include \char`\"{}gtk/gtksignal.h\char`\"{}}\par
{\tt \#include \char`\"{}gtk/gtkhbox.h\char`\"{}}\par
{\tt \#include \char`\"{}gtk/gtkhbbox.h\char`\"{}}\par
{\tt \#include \char`\"{}gtk/gtkeventbox.h\char`\"{}}\par
{\tt \#include \char`\"{}gtk/gtkentry.h\char`\"{}}\par
{\tt \#include \char`\"{}gtk/gtkmessagedialog.h\char`\"{}}\par
{\tt \#include \char`\"{}gtk/gtkhseparator.h\char`\"{}}\par
{\tt \#include \char`\"{}gtk/gtkvbox.h\char`\"{}}\par
{\tt \#include \char`\"{}gtk/gtkdialog.h\char`\"{}}\par
{\tt \#include \char`\"{}gtk/gtklabel.h\char`\"{}}\par
{\tt \#include \char`\"{}gtk/gtkimage.h\char`\"{}}\par
{\tt \#include \char`\"{}gtk/gtkstock.h\char`\"{}}\par
{\tt \#include \char`\"{}global.h\char`\"{}}\par
{\tt \#include \char`\"{}rox\_\-path.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
GType {\bf gtk\_\-savebox\_\-get\_\-type} (void)
\item 
Gtk\-Widget $\ast$ {\bf gtk\_\-savebox\_\-new} (const gchar $\ast$action)
\item 
void {\bf gtk\_\-savebox\_\-set\_\-icon} ({\bf Gtk\-Savebox} $\ast$savebox, Gdk\-Pixbuf $\ast$pixbuf)
\item 
void {\bf gtk\_\-savebox\_\-set\_\-pathname} ({\bf Gtk\-Savebox} $\ast$savebox, const gchar $\ast$pathname)
\item 
void {\bf gtk\_\-savebox\_\-set\_\-has\_\-discard} ({\bf Gtk\-Savebox} $\ast$savebox, gboolean setting)
\item 
Gtk\-Widget $\ast$ {\bf gtk\_\-savebox\_\-get\_\-extension\_\-area} ({\bf Gtk\-Savebox} $\ast$savebox)
\end{CompactItemize}


\subsection{Detailed Description}
Drag and drop saving widget for GTK+. 

This version has been altered for inclusion in ROX-CLib. If it makes it into Gtk+ then it will be removed from ROX-CLib.

Behaviour:

\begin{itemize}
\item Clicking Save or pressing Return:\begin{itemize}
\item Emits 'save\_\-to\_\-file',\item Emits 'saved\_\-to\_\-uri' (with the same pathname),\item Destroys the widget.\end{itemize}
\end{itemize}


\begin{itemize}
\item Clicking Cancel or pressing Escape:\begin{itemize}
\item Destroys the widget.\end{itemize}
\end{itemize}


\begin{itemize}
\item Dragging the data somewhere:\begin{itemize}
\item Will either emit 'save\_\-to\_\-file' or get the selection,\item Emits 'saved\_\-to\_\-uri' (possibly with a {\tt NULL} URI),\item Destroys the widget.\end{itemize}
\end{itemize}


\begin{itemize}
\item Clicking Discard:\begin{itemize}
\item Emits 'saved\_\-to\_\-uri' with a {\tt NULL} URI,\item Destroys the widget.\end{itemize}
\end{itemize}


To clarify: 'saved\_\-to\_\-uri' indicates that the save was successful. A {\tt NULL} URI just means that the data was saved to another application rather than a fixed address. Data should only be marked unmodified when saved\_\-to\_\-uri is called with a non-{\tt NULL} URI.

Discard is a bit like a successful save to a null device. The data should be discarded when saved\_\-to\_\-uri is called, whatever URI is set to.

Signals:

gint save\_\-to\_\-file (Gtk\-Savebox $\ast$savebox, const gchar $\ast$pathname) Save the data to disk using this pathname. Return {\tt GTK\_\-XDS\_\-SAVED} on success, or {\tt GTK\_\-XDS\_\-SAVE\_\-ERROR} on failure (and report the error to the user somehow). DO NOT mark the data unmodified or change the pathname for the file - this might be a scrap file transfer.

void saved\_\-to\_\-uri (Gtk\-Savebox $\ast$savebox, const gchar $\ast$uri) The data is saved. If 'uri' is non-{\tt NULL}, mark the file as unmodified and update the pathname/uri for the file to the one given.

\begin{Desc}
\item[Author:]Thomas Leonard \end{Desc}
\begin{Desc}
\item[Version:]\begin{Desc}
\item[Id]\doxyref{gtksavebox.c}{p.}{gtksavebox_8c},v 1.5 2005/12/07 11:43:12 stephen Exp \end{Desc}
based on \doxyref{gtksavebox.c}{p.}{gtksavebox_8c},v 1.28 2002/05/12 16:28:42 tal197 from ROX-Filer 1.3.5 \end{Desc}


\subsection{Function Documentation}
\index{gtksavebox.c@{gtksavebox.c}!gtk_savebox_get_extension_area@{gtk\_\-savebox\_\-get\_\-extension\_\-area}}
\index{gtk_savebox_get_extension_area@{gtk\_\-savebox\_\-get\_\-extension\_\-area}!gtksavebox.c@{gtksavebox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Gtk\-Widget$\ast$ gtk\_\-savebox\_\-get\_\-extension\_\-area ({\bf Gtk\-Savebox} $\ast$ {\em savebox})}\label{gtksavebox_8c_5544fdd4a8f7ae8b5c7b16783fd3aa82}


Return the extension area, a vbox just above the buttons where additional widgets may be placed.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[\mbox{$\leftrightarrow$} {\em savebox}]Save box widget \end{description}
\end{Desc}
\index{gtksavebox.c@{gtksavebox.c}!gtk_savebox_get_type@{gtk\_\-savebox\_\-get\_\-type}}
\index{gtk_savebox_get_type@{gtk\_\-savebox\_\-get\_\-type}!gtksavebox.c@{gtksavebox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}GType gtk\_\-savebox\_\-get\_\-type (void)}\label{gtksavebox_8c_c9d75e7daf50160657883c3b15a72c1a}


\begin{Desc}
\item[Returns:]type code for Gtk\-Savebox \end{Desc}
\index{gtksavebox.c@{gtksavebox.c}!gtk_savebox_new@{gtk\_\-savebox\_\-new}}
\index{gtk_savebox_new@{gtk\_\-savebox\_\-new}!gtksavebox.c@{gtksavebox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Gtk\-Widget$\ast$ gtk\_\-savebox\_\-new (const gchar $\ast$ {\em action})}\label{gtksavebox_8c_6a7ef018bafc145f094d0d0c0aeacd78}


Create and return a new Gtk\-Savebox widget.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[\mbox{$\leftarrow$} {\em action}]Label to use in the Save button \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]pointer to the widget \end{Desc}
\index{gtksavebox.c@{gtksavebox.c}!gtk_savebox_set_has_discard@{gtk\_\-savebox\_\-set\_\-has\_\-discard}}
\index{gtk_savebox_set_has_discard@{gtk\_\-savebox\_\-set\_\-has\_\-discard}!gtksavebox.c@{gtksavebox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void gtk\_\-savebox\_\-set\_\-has\_\-discard ({\bf Gtk\-Savebox} $\ast$ {\em savebox}, gboolean {\em setting})}\label{gtksavebox_8c_94ed6aeceb4e2514179948c0b05eb573}


Set whether the discard area is show. Normally this is hidden but contains a single \char`\"{}Discard\char`\"{} button.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[\mbox{$\leftrightarrow$} {\em savebox}]Save box widget \item[\mbox{$\leftarrow$} {\em setting}]non-zero to show discard area \end{description}
\end{Desc}
\index{gtksavebox.c@{gtksavebox.c}!gtk_savebox_set_icon@{gtk\_\-savebox\_\-set\_\-icon}}
\index{gtk_savebox_set_icon@{gtk\_\-savebox\_\-set\_\-icon}!gtksavebox.c@{gtksavebox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void gtk\_\-savebox\_\-set\_\-icon ({\bf Gtk\-Savebox} $\ast$ {\em savebox}, Gdk\-Pixbuf $\ast$ {\em pixbuf})}\label{gtksavebox_8c_8b06c7ad7c2d389caf3382278db91f2c}


Set the icon used for dragging the file.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[\mbox{$\leftrightarrow$} {\em savebox}]Save box widget \item[\mbox{$\leftarrow$} {\em pixbuf}]image to use for icon \end{description}
\end{Desc}
\index{gtksavebox.c@{gtksavebox.c}!gtk_savebox_set_pathname@{gtk\_\-savebox\_\-set\_\-pathname}}
\index{gtk_savebox_set_pathname@{gtk\_\-savebox\_\-set\_\-pathname}!gtksavebox.c@{gtksavebox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void gtk\_\-savebox\_\-set\_\-pathname ({\bf Gtk\-Savebox} $\ast$ {\em savebox}, const gchar $\ast$ {\em pathname})}\label{gtksavebox_8c_08d93a64cbe9932fcbf55a8fafe46976}


Set the initial path to show in the widget.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[\mbox{$\leftrightarrow$} {\em savebox}]Save box widget \item[\mbox{$\leftarrow$} {\em pathname}]path to use \end{description}
\end{Desc}
