gtk_dumpDialogWidget

gtk_dumpDialogWidget — Defines a widget to export into different file formats.

Synopsis

#define             DUMP_DIALOG_TYPE
#define             DUMP_DIALOG                         (obj)
#define             DUMP_DIALOG_CLASS                   (klass)
#define             IS_DUMP_DIALOG                      (obj)
#define             IS_DUMP_DIALOG_CLASS                (klass)
#define             DUMP_DIALOG_GET_CLASS               (obj)
                    DumpDialog;
                    DumpDialogClass;
GType               dumpDialog_get_type                 (void);
GtkWidget*          dumpDialog_new                      (VisuData *dataObj,
                                                         GtkWindow *parent,
                                                         const gchar *suggestedFilename);
gchar*              dumpDialogGet_fileName              (DumpDialog *dialog);
VisuDump*           dumpDialogGet_dumpType              (DumpDialog *dialog);
ToolFileFormat*     dumpDialogGet_fileFormat            (DumpDialog *dialog);
GtkProgressBar*     dumpDialogGet_progressBar           (DumpDialog *dialog);
GtkButton*          dumpDialogGet_cancelButton          (DumpDialog *dialog);
gint                dumpDialogGet_widthValue            (DumpDialog *dialog);
gint                dumpDialogGet_heightValue           (DumpDialog *dialog);
void                dumpDialogStart                     (DumpDialog *dialog);
void                dumpDialogStop                      (DumpDialog *dialog);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBin
                                 +----GtkWindow
                                       +----GtkDialog
                                             +----DumpDialog

Implemented Interfaces

DumpDialog implements AtkImplementorIface and GtkBuildable.

Description

This widget is based on the GtkFileChooser in the save mode. It proposes the user to choose a file to save to. In addition, it automatically build a list of filters, corresponding to the available export routines in V_Sim. By default, the filter is set on 'auto', which means that the filter method is selected with the file extension. The dialog also has a progress bar.

This widget is also a dialog, and should be used with gtk_dialog_run(). After the response GTK_RESPONSE_ACCEPT has been recieved, one can grep the selected filename with dumpDialogGet_fileName(). The dialog does not call the exporting routine by itself, the calling method should take care of that. When doing it, the filechoosing part should be made insensitive, using dumpDialogStart() and the progress bar should be updated accordingly (get it with dumpDialogGet_progressBar()).

The user interface propose also to change the size (see dumpDialogGet_heightValue() and dumpDialogGet_widthValue()) and if some options are associated to a file format, these options are displayed.

Details

DUMP_DIALOG_TYPE

#define DUMP_DIALOG_TYPE         (dumpDialog_get_type ())

Return the associated GType to the DumpDialog objects.


DUMP_DIALOG()

#define DUMP_DIALOG(obj)         (G_TYPE_CHECK_INSTANCE_CAST ((obj), DUMP_DIALOG_TYPE, DumpDialog))

Cast the given object to a DumpDialog object.

obj :

the widget to cast.

DUMP_DIALOG_CLASS()

#define DUMP_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DUMP_DIALOG_TYPE, DumpDialogClass))

Cast the given class to a DumpDialogClass object.

klass :

the class to cast.

IS_DUMP_DIALOG()

#define IS_DUMP_DIALOG(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DUMP_DIALOG_TYPE))

Return if the given object is a valid DumpDialog object.

obj :

the object to test.

IS_DUMP_DIALOG_CLASS()

#define IS_DUMP_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DUMP_DIALOG_TYPE))

Return if the given class is a valid DumpDialogClass class.

klass :

the class to test.

DUMP_DIALOG_GET_CLASS()

#define DUMP_DIALOG_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS(obj, DUMP_DIALOG_TYPE, DumpDialogClass))

Get the class of the given object.

obj :

the widget to get the class of.

DumpDialog

typedef struct _DumpDialog DumpDialog;

Private structure to store informations of a DumpDialog object.


DumpDialogClass

typedef struct _DumpDialogClass DumpDialogClass;

Private structure to store informations of a DumpDialogClass object.


dumpDialog_get_type ()

GType               dumpDialog_get_type                 (void);

GType are unique numbers to identify objects.

Returns :

the GType associated with DumpDialog objects.

dumpDialog_new ()

GtkWidget*          dumpDialog_new                      (VisuData *dataObj,
                                                         GtkWindow *parent,
                                                         const gchar *suggestedFilename);

A DumpDialog widget is complete dialog window widget, but it is already prepared for dumping, proposing known file formats. It is usefull to get an filename to export to. It has also a progress bar that can illustrate the process. The given dataObj argument is used to initialize some values related to the data to be dumped (such as the default size).

dataObj :

a VisuData object (can be NULL) ;

parent :

the parent window ;

suggestedFilename :

a string or NULL.

Returns :

a newly created DumpDialog widget.

dumpDialogGet_fileName ()

gchar*              dumpDialogGet_fileName              (DumpDialog *dialog);

Retrieve the chosen filename.

dialog :

a DumpDialog object.

Returns :

a read-only string.

dumpDialogGet_dumpType ()

VisuDump*           dumpDialogGet_dumpType              (DumpDialog *dialog);

Retrieve the chosen VisuDump.

dialog :

a DumpDialog object.

Returns :

the selected format (ToolFileFormat and write method).

dumpDialogGet_fileFormat ()

ToolFileFormat*     dumpDialogGet_fileFormat            (DumpDialog *dialog);

Retrieve the chosen fileFormat.

dialog :

a DumpDialog object.

Returns :

the selected format, only ToolFileFormat.

dumpDialogGet_progressBar ()

GtkProgressBar*     dumpDialogGet_progressBar           (DumpDialog *dialog);

Retrieve interesting widget.

dialog :

a DumpDialog object.

Returns :

a pointer to the progress bar.

dumpDialogGet_cancelButton ()

GtkButton*          dumpDialogGet_cancelButton          (DumpDialog *dialog);

Retrieve interesting widget.

dialog :

a DumpDialog object.

Returns :

a pointer to the cancel button.

dumpDialogGet_widthValue ()

gint                dumpDialogGet_widthValue            (DumpDialog *dialog);

Retrieve request image size.

dialog :

a DumpDialog object.

Returns :

the width value.

dumpDialogGet_heightValue ()

gint                dumpDialogGet_heightValue           (DumpDialog *dialog);

Retrieve request image size.

dialog :

a DumpDialog object.

Returns :

the height value.

dumpDialogStart ()

void                dumpDialogStart                     (DumpDialog *dialog);

Make the file chooser part insensitive during dump, only the progress bar and the abort button are kept sensitive.

dialog :

a DumpDialog object.

dumpDialogStop ()

void                dumpDialogStop                      (DumpDialog *dialog);

Return the filechooser to a sensitive state.

dialog :

a DumpDialog object.