visu_gtk

visu_gtk — Basic GUI routines, standard dialogs...

Functions

Types and Values

Description

There are some common UI routines here. Error messages can be displayed via dialogs, see visu_ui_raiseWarning()...

Functions

VisuUiNewWidgetFunc ()

GtkWidget *
(*VisuUiNewWidgetFunc) (void);

This prototype is used whenever a method is required to create a GtkWidget.

Returns

a newly created GtkWidget.

[transfer full]


VisuUiInitWidgetFunc ()

void
(*VisuUiInitWidgetFunc) (GtkWindow **panel,
                         GtkWindow **renderWindow,
                         GtkWidget **renderArea);

This prototype is used whenever a method is required to initialise the GTK interface of V_Sim. panel must be set to point on the window of the command panel, renderWindow must point to the window containing the rendering area (can be the same than panel ) and renderArea contains the widget that does the OpenGL rendering.

Parameters

panel

a location for a GtkWindow describing the panel.

 

renderWindow

a location for a GtkWindow ;

 

renderArea

a location for a GtkWidget.

 

visu_ui_raiseWarning ()

void
visu_ui_raiseWarning (gchar *action,
                      gchar *message,
                      GtkWindow *window);

Raise a warning window with the action in bold and the message written underneath.

Parameters

action

a string ;

 

message

another string ;

 

window

the parent window to raise the warning on.

[allow-none]

visu_ui_raiseWarningLong ()

void
visu_ui_raiseWarningLong (gchar *action,
                          gchar *message,
                          GtkWindow *window);

Same as visu_ui_raiseWarning() except that the message is displayed in a text buffer, ideal for a log.

Parameters

action

a string ;

 

message

another string ;

 

window

the parent window to raise the warning on.

 

visu_ui_mainCreate ()

void
visu_ui_mainCreate (VisuUiInitWidgetFunc panelFunc);

It initializses the GTK part of V_Sim. During this initialisation, the panelFunc is called. It should create all the windows needed by V_Sim, like the command panel and the rendering area. The return widget is the widget returned itself by panelFunc . It must be the main widget: it is the command panel if used, the window containing the rendering area if no command panel or the rendering area itself if no container window.

Parameters

panelFunc

function to be called to create the different windows.

[scope call]

Returns

the main widget for V_Sim, returned itself by panelFunc .


visu_ui_runCommandLine ()

gboolean
visu_ui_runCommandLine (gpointer data);

Call the get routines from the command line module and deal with them. This method is not aware of the panels and is intended to be called only when the command panel is not used. In the opposite case, use visu_ui_main_runCommandLine() instead.

Parameters

data

a pointer to the command panel (see VisuUiMain).

 

Returns

FALSE always.


visu_ui_wait ()

void
visu_ui_wait (void);

It runs the Gtk event loop, flushing it before returning.


visu_ui_createFilter ()

GList *
visu_ui_createFilter (GList *list,
                      GtkWidget *fileChooser);

Create a list of GtkFileFilter created from the given list of file formats and attach it to the given fileChooser .

Parameters

list

a GList of ToolFileFormat ;.

[element-type ToolFileFormat*]

fileChooser

a file chooser to associate filters with.

 

Returns

a list of VisuUiFileFilter. This list should be freed after use.

[element-type VisuUiFileFilter][transfer full]


visu_ui_createPixbuf ()

GdkPixbuf *
visu_ui_createPixbuf (const gchar *filename);

Replace the create_pixbuf() routine from Glade. It looks only in the default pixmap directory of V_Sim to find the given file.

Parameters

filename

a file name (must be a base name).

[type filename]

Returns

a newly created GdkPixbuf on success.

[transfer full]


tool_color_get_stamp ()

GdkPixbuf *
tool_color_get_stamp (const ToolColor *color,
                      gboolean alpha);

This method is used by VisuUiColorCombobox object to create little stamps representing the color. If the pixbuf of such stamps are needed, use visu_ui_color_combobox_getPixbufFromColor() if the color is registered in an already existing VisuUiColorCombobox object or use this method to create a new stamp.

Parameters

color

a ToolColor object ;

 

alpha

a boolean.

 

Returns

a pixbuf pointer corresponding to the little image as shown on a colorComboBox (use g_object_unref() to free this pixbuf).

[transfer full]

Since: 3.7


visu_ui_storeRecent ()

void
visu_ui_storeRecent (const gchar *filename);

Add filename to the list of recent files.

Parameters

filename

a filename.

 

Since: 3.8


visu_ui_createInterface ()

void
visu_ui_createInterface (GtkWindow **panel,
                         GtkWindow **renderWindow,
                         GtkWidget **renderArea);

A convenient routine that creates a VisuUiRenderingWindow alone. To create also a command panel, visu_ui_main_class_createMain() should be used instead.

Parameters

panel

always NULL here.

 

renderWindow

a location for a GtkWindow ;

 

renderArea

a location for a GtkWidget.

 

visu_ui_buildRenderingWindow ()

GtkWidget *
visu_ui_buildRenderingWindow (VisuUiRenderingWindow *renderWindow);

Create a GtkWindow with V_sim render window icon and wmclass set to "V_Sim:v_sim_render". It also set the accelerators of renderWindow to the newly created window and pack renderWindow inside.

Parameters

renderWindow

a VisuUiRenderingWindow object.

 

Returns

a newly created GtkWindow.

[transfer full]

Since: 3.7


visu_ui_getPanel ()

GtkWindow *
visu_ui_getPanel (void);

A convenient function to get the command panel window.

Returns

a GtkWindow.

[transfer none]


visu_ui_getRenderWindow ()

GtkWindow *
visu_ui_getRenderWindow (void);

A convenient function to get the rendering area window.

Returns

a GtkWindow.

[transfer none]


visu_ui_getRenderWidget ()

GtkWidget *
visu_ui_getRenderWidget (void);

A convenient function to get the rendering area widget.

Returns

a GtkWidget.

[transfer none]


visu_ui_setRenderWidget ()

void
visu_ui_setRenderWidget (VisuUiRenderingWindow *render);

A convenient function to set the rendering area widget.

Parameters

render

a VisuUiRenderingWindow widget.

 

Since: 3.7

Types and Values

struct VisuUiFileFilter

struct VisuUiFileFilter {
  GtkFileFilter *gtkFilter;
  ToolFileFormat* visuFilter;
};

Structure used to associate the V_Sim way to store file filters with the Gtk way.

Members

GtkFileFilter *gtkFilter;

the GtkFileFilter associate to visuFilter .

 

ToolFileFormat *visuFilter;

a ToolFileFormat object.