gtk_main

gtk_main — The command panel definition.

Functions

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── GtkBin
                    ╰── GtkWindow
                        ╰── VisuUiMain

Implemented Interfaces

VisuUiMain implements AtkImplementorIface and GtkBuildable.

Description

This is the main interface in V_Sim. It hosts the common action buttons, like open a file, save resources, switch to interactive session... It also hosts the different panels.

Functions

VisuUiMainInitFunc ()

void
(*VisuUiMainInitFunc) (VisuUiMain *ui);

These methods are used by V_Sim to initialise some part of the interface. They are called once on start-up.

Parameters

ui

the VisuUiMain object.

 

Since: 3.8


visu_ui_main_new ()

GtkWidget *
visu_ui_main_new (gboolean oneWindow);

Create the command panel window and is dependencies, such as the associated rendering window... WARNING: some part are still currently static, so only once instance can be created at a time. If oneWindow argument is TRUE, then the rendering area is creating in the same GtkWindow on the right of the panel.

Parameters

oneWindow

a boolean.

 

Returns

a newly create command panel.


visu_ui_main_quit ()

void
visu_ui_main_quit (VisuUiMain *main,
                   gboolean force);

Quit the program. If the preference to have a confirm dialog is set, then it raises the little warning window before quiting (or not).

Parameters

main

a pointer to the main interface.

 

force

if TRUE, override the preference of a quiting dialog and quit.

 

visu_ui_main_buildInteractiveDialog ()

void
visu_ui_main_buildInteractiveDialog (VisuUiMain *main);

Create the mouse action dialog window (if not already done).

Parameters

main

a VisuUiMain object.

 

visu_ui_main_runCommandLine ()

gboolean
visu_ui_main_runCommandLine (gpointer data);

Call the get routines from the command line module and associate the different tasks to the different panels. For a version that do not use the panels, call visu_ui_runCommandLine() instead.

Parameters

data

a pointer on a VisuUiMain object.

 

Returns

always FALSE.


visu_ui_main_initPanels ()

gboolean
visu_ui_main_initPanels (gpointer data);

Call the init routines for the different panels.

Parameters

data

a pointer on a VisuUiMain object.

 

Returns

always FALSE.


visu_ui_main_getRendering ()

VisuUiRenderingWindow *
visu_ui_main_getRendering (VisuUiMain *main);

Retrieve the rendering window controlled by main .

Parameters

main

a VisuUiMain object.

 

Returns

the VisuUiRenderingWindow controled by this main panel.

[transfer none]

Since: 3.8


visu_ui_main_class_setRememberPosition ()

void
visu_ui_main_class_setRememberPosition
                               (gboolean val);

V_Sim can try to remember the position of its main windows, then open them again will result in a positioning on screen equivalent to previous position.

Parameters

val

an boolean.

 

visu_ui_main_class_getRememberPosition ()

gboolean
visu_ui_main_class_getRememberPosition
                               ();

V_Sim can store the position of its main windows. Use this routine to get the status of this capability.

Returns

TRUE if set.


visu_ui_main_getLastOpenDirectory ()

const gchar *
visu_ui_main_getLastOpenDirectory (VisuUiMain *main);

V_Sim stores the last open directory to set the file chooser to this one the next time it will come. Use visu_ui_main_setLastOpenDirectory() to store it after a GTK_RESPONSE_OK has been returned by a file chooser and then initialise each new with this routine.

Parameters

main

a VisuUiMain object.

 

Returns

a string owned by V_Sim.

[transfer none]


visu_ui_main_setLastOpenDirectory ()

void
visu_ui_main_setLastOpenDirectory (VisuUiMain *main,
                                   const char *directory,
                                   VisuUiDirectoryType type);

V_Sim stores the last open directory to set the file chooser to this one the next time it will come. Use this routine each time a file chooser returns GTK_RESPONSE_OK. The given string will be copied and can be freed after use.

Parameters

main

a VisuUiMain object.

 

directory

a full path to a directory ;

 

type

the kind of directory to set the remember flag on.

 

visu_ui_main_getSelectedDirectory ()

gchar **
visu_ui_main_getSelectedDirectory (VisuUiMain *main,
                                   GtkWindow *parent,
                                   gboolean multiple,
                                   const gchar *dir);

General procedure to get the location of one or more directories. In the multiple case, all selected directories shares a common ancestor since the selection is done through the same selector that for single directory but with multiple selection activated. If dir is NULL the last opened (and stored) directory is used (see visu_ui_main_getLastOpenDirectory() and visu_ui_main_setLastOpenDirectory()).

Parameters

main

a VisuUiMain object.

 

parent

if NULL, the command panel window is used ;.

[allow-none]

multiple

if TRUE, multiple directories can be selected ;

 

dir

if not NULL, give the opening directory.

[allow-none]

Returns

a newly allocated array of paths, NULL terminated. Use g_strfreev() to free it after use. If no directory is selected, then NULL is returned.

[array zero-terminated=1][transfer full]


visu_ui_main_class_getCurrentPanel ()

VisuUiMain *
visu_ui_main_class_getCurrentPanel ();

This routine can be used to get the command panel, everywhere from V_Sim.

Returns

the command Panel.

[transfer none]


visu_ui_main_class_setCurrentPanel ()

void
visu_ui_main_class_setCurrentPanel (VisuUiMain *main);

After having created the command panel with visu_ui_main_new(), use this routine to declare it as the current command panel.

Parameters

main

a command panel.

 

visu_ui_main_class_createMain ()

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

A convenience routine to create a command panel, a rendering window and links them together.

Parameters

panel

a location for a VisuUiMain panel ;

 

renderWindow

a location for a GtkWindow ;

 

renderArea

a location for a GtkWidget.

 

visu_ui_main_class_getDefaultRendering ()

VisuUiRenderingWindow *
visu_ui_main_class_getDefaultRendering
                               ();

Get the rendering window of V_Sim.

Returns

the rendering window.

[transfer none]

Types and Values

VisuUiMain_private

typedef struct VisuUiMain_private_struct VisuUiMain_private;

Private fields for VisuUiMain objects.


struct VisuUiMain

struct VisuUiMain;

Structure to describe the main interface of V_Sim.


enum VisuUiDirectoryType

V_Sim remembers the last open directory when presenting a new file selector. This enum is used to specify different kind of directories. Like that saving a configuration file in a given directory will not affect the prefered directory for browsing a list of files.

Members

VISU_UI_DIR_FILE

default kind of directory ;

 

VISU_UI_DIR_SURFACE

directory for surfaces ;

 

VISU_UI_DIR_DATAFILE

directory for data files ;

 

VISU_UI_DIR_CONF

directory for configuration files ;

 

VISU_UI_DIR_BROWSER

directory used in the browser.

 

VISU_UI_DIR_N_VALUES

private.

 

VisuUiMainClass

typedef struct _VisuUiMainClass VisuUiMainClass;

A short way to identify _VisuUiMainClass structure.

Signal Details

The “DataFocused” signal

void
user_function (VisuUiMain *ui,
               VisuData   *dataObj,
               gpointer    user_data)

This signal is emitted when dataObj has been displayed on the rendering window and is ready for use.

Parameters

ui

the object which received the signal ;

 

dataObj

the newly associated VisuData object.

 

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks

Since: 3.7


The “DirectoryChanged” signal

void
user_function (VisuUiMain *ui,
               guint       kind,
               gpointer    user_data)

The current directory has been changed. The kind of directory is defined by kind (see #).

Parameters

ui

the object emitting the signal.

 

kind

a flag.

 

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks

Since: 3.6