![]() |
![]() |
![]() |
V_Sim API - Reference Manual | ![]() |
---|---|---|---|---|
int (*createGtkLoadWidgetFunc) (VisuData *data, GtkFileChooser **fileChooser, GtkWidget **fileWidget); createGtkLoadWidgetFunc gtkMainGet_renderingSpecificOpen (RenderingMethod *method); GList* gtkMainCreate_fileChooserFilter (GList *list, GtkWidget *fileChooser); void gtkMainSet_renderingSpecificMethods (RenderingMethod *method, createGtkWidgetFunc createLoadWidget, createGtkLoadWidgetFunc methodLoad); int gtkMainCreate_defaultFileChooser (VisuData *data, GtkFileChooser **fileChooser, GtkWidget **fileWidget); ToolPanel* (*subPanelInitFunc) (); GtkWidget* (*createGtkWidgetFunc) (void); char* getLastOpenDirectory (); void setLastOpenDirectory (char *directory); gchar* getSelectedDirectory (); gboolean loadAndRenderFileWithGtk (gpointer data); void raiseAlertDialog (char *message); void raiseAlertDialogWithScrollView (char *message); void visuHideWindow (GtkWindow *win); void visuShowWindow (GtkWindow *win); void setRememberPosition (int val); int getRememberPosition ();
int (*createGtkLoadWidgetFunc) (VisuData *data, GtkFileChooser **fileChooser, GtkWidget **fileWidget);
Methods that conform to this prototype is used to set filename(s) to be loaded when the 'load' button is pushed. It must creates a GtkWidget that will be destroy after use and it must also use a GtkFileChooser.
|
a VisuData to store the informations ; |
|
a pointer to store the created GtkFileChooser ; |
|
a pointer to store the created ancapsulating widget. |
Returns : |
0 if no filename as been set, 1 if the calling method should
call loadAndRenderFileWithGtk() with a g_idle_add method.
|
createGtkLoadWidgetFunc gtkMainGet_renderingSpecificOpen (RenderingMethod *method);
This method is used to retrieve the createGtkLoadWidgetFunc associate with
the specified method
.
|
a RenderingMethod object. |
Returns : |
a load method if one has been specified for method
or gtkMainCreate_defaultFileChooser() .
|
GList* gtkMainCreate_fileChooserFilter (GList *list, GtkWidget *fileChooser);
Create a list of GtkFileFilter created from the given list of file formats
and attach it to the given fileChooser
.
|
a GList of FileFormat ; |
|
a file chooser to associate filters with. |
Returns : |
a list of FileFilterCustom. This list should be freed after use. |
void gtkMainSet_renderingSpecificMethods (RenderingMethod *method, createGtkWidgetFunc createLoadWidget, createGtkLoadWidgetFunc methodLoad);
This function is used by a client to add gtk methods to a rendering method.
The methodLoad
argument is called to when the 'load' button is pushed.
|
a RenderingMethod object; |
|
a createGtkWidgetFunc method (can be NULL). |
|
a createGtkLoadWidgetFunc method (can be NULL). |
int gtkMainCreate_defaultFileChooser (VisuData *data, GtkFileChooser **fileChooser, GtkWidget **fileWidget);
This method is a default method to launch a file chooser that select
a single file, with the filters of the current RenderingMethod. It creates a
modal dialog (fileWidget
), and wait for its reponse. If OK is clicked, the selected
filename is stored. If Cancel is clicked, nothing is done. In all cases
the dialog is not destroyed and it can be retrieve via the fileWidget
argument.
|
an allocated VisuData to store the file names ; |
|
a pointer to store the created GtkFileChooser ; |
|
a pointer to store the created ancapsulating widget. |
Returns : |
0 if no file has been set, 1 if the calling method should
call loadAndRenderFileWithGtk() with a g_idle_add method.
|
GtkWidget* (*createGtkWidgetFunc) (void);
This prototype is used whenever a method is required to create a GtkWidget.
Returns : |
a newly created GtkWidget. |