## gtk_renderingWindowWidget

gtk_renderingWindowWidget — Defines a complex widget used to render files and print information.

## Synopsis

    #define             RENDERING_WINDOW_TYPE
    #define             RENDERING_WINDOW                    (obj)
    #define             RENDERING_WINDOW_CLASS              (klass)
    #define             IS_RENDERING_WINDOW                 (obj)
    #define             IS_RENDERING_WINDOW_CLASS           (klass)
    #define             RENDERING_WINDOW_GET_CLASS          (obj)
                        VisuRenderingWindow;
                        VisuRenderingWindowClass;
    GType               visu_rendering_window_get_type      (void);
    #define             RENDERING_WINDOW_ID
    GtkWidget*          visu_rendering_window_new           (int width,
                                                             int height,
                                                             gboolean withFrame,
                                                             gboolean withToolBar);
    GtkWidget*          visu_rendering_window_newEmbedded   (int width,
                                                             int height);
    void                renderingWindowPush_message         (VisuRenderingWindow *window,
                                                             gchar *message);
    void                renderingWindowPop_message          (VisuRenderingWindow *window);
    GdkPixbuf*          renderingWindowGet_backgroundImage  (VisuRenderingWindow *window,
                                                             guchar **rowData,
                                                             gboolean *hasAlphaChannel,
                                                             int *width,
                                                             int *height);
    void                renderingWindowFree_backgroundImage (VisuRenderingWindow *window);
    void                visu_rendering_window_setData       (VisuRenderingWindow *window,
                                                             VisuData *data);
    VisuData*           visu_rendering_window_getVisuData   (VisuRenderingWindow *window);
    void                visu_rendering_window_loadFile      (VisuRenderingWindow *window,
                                                             VisuData *data,
                                                             guint iSet);
    void                renderingWindowOpen_file            (VisuRenderingWindow *window,
                                                             GtkWindow *parent);
    gboolean            visu_rendering_window_dump          (VisuRenderingWindow *window,
                                                             VisuDump *format,
                                                             const char *fileName,
                                                             gint width,
                                                             gint height,
                                                             GError **error,
                                                             ToolVoidDataFunc functionWait,
                                                             gpointer data);
    void                renderingWindowRedraw               (VisuRenderingWindow *window,
                                                             gboolean forceRedraw);
    void                renderingWindowSet_current          (VisuRenderingWindow *window,
                                                             gboolean force);
    void                renderingWindowPush_interactive     (VisuRenderingWindow *window,
                                                             VisuInteractive *inter);
    void                renderingWindowPop_interactive      (VisuRenderingWindow *window,
                                                             VisuInteractive *inter);
    VisuMarks*          visu_rendering_window_getMarks      (VisuRenderingWindow *window);
    VisuInteractive*    renderingWindowClassGet_interactive ();
    gboolean            visu_rendering_window_setDisplayCoordinatesInReduce
                                                            (gboolean status);
    gboolean            visu_rendering_window_getDisplayCoordinatesInReduce
                                                            ();
    gboolean            visu_rendering_window_setAutoAdjust (gboolean status);
    gboolean            visu_rendering_window_getAutoAdjust ();

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkWidget
                         +----GtkContainer
                               +----GtkBox
                                     +----GtkVBox
                                           +----VisuRenderingWindow

## Implemented Interfaces

VisuRenderingWindow implements AtkImplementorIface, GtkBuildable and GtkOrientable.

## Signals

      "export"                                         : Run Last / Action
      "open"                                           : Run Last / Action
      "reload"                                         : Run Last / Action
      "show-action-dialog"                             : Run Last / No Recursion / Action / No Hooks
      "show-main-panel"                                : Run Last / No Recursion / Action / No Hooks

## Description

This is a complex widget, inheriting from GtkWindow, with a rendering area and a status bar area. A VisuData is always attached to this widget, see `visu_rendering_window_setData()`. If not the V_Sim logo is displayed.

The rendering area can receive keyboard or mouse events, see `renderingWindowSet_pickEventListener()` or `renderingWindowSet_observeEventListener()`. Then, callbacks are defined using `renderingWindowSet_interactiveHandlers()`.

The status bar area has different buttons to load or export a file. It also display some usefull information like the number of rendered nodes. It has also a real status bar location displaying tips about current available actions. One can add news using `renderingWindowPush_message()`.

## Details

### RENDERING_WINDOW_TYPE

    #define RENDERING_WINDOW_TYPE         (visu_rendering_window_get_type())

Return the associated GType to the Renderingwindow objects.

### RENDERING_WINDOW()

    #define RENDERING_WINDOW(obj)         (G_TYPE_CHECK_INSTANCE_CAST((obj), RENDERING_WINDOW_TYPE, VisuRenderingWindow))

Cast the given object to a VisuRenderingWindow object.

`obj` : | the widget to cast.

### RENDERING_WINDOW_CLASS()

    #define RENDERING_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), RENDERING_WINDOW_TYPE, VisuRenderingWindowClass))

Cast the given class to a VisuRenderingWindowClass object.

`klass` : | the class to cast.

### IS_RENDERING_WINDOW()

    #define IS_RENDERING_WINDOW(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), RENDERING_WINDOW_TYPE))

Return if the given object is a valid VisuRenderingWindow object.

`obj` : | the object to test.

### IS_RENDERING_WINDOW_CLASS()

    #define IS_RENDERING_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), RENDERING_WINDOW_TYPE))

Return if the given class is a valid VisuRenderingWindowClass class.

`klass` : | the class to test.

### RENDERING_WINDOW_GET_CLASS()

    #define RENDERING_WINDOW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS(obj, RENDERING_WINDOW_TYPE, VisuRenderingWindowClass))

It returns the class of the given `obj`.

`obj` : | a GObject to get the class of.

### VisuRenderingWindow

    typedef struct _VisuRenderingWindow VisuRenderingWindow;

Short form for a VisuRenderingWindow_struct structure.

### VisuRenderingWindowClass

    typedef struct _VisuRenderingWindowClass VisuRenderingWindowClass;

Short form for a VisuRenderingWindowClass_struct structure.

### visu_rendering_window_get_type ()

    GType               visu_rendering_window_get_type      (void);

GType are unique numbers to identify objects.

Returns : | the GType associated with VisuRenderingWindow objects.

### RENDERING_WINDOW_ID

    #define RENDERING_WINDOW_ID "ContainerWindow"

The key to get the embedding GtkWindow of a given VisuRenderingWindow widget, if any. See `visu_rendering_window_newEmbedded()`.

### visu_rendering_window_new ()

    GtkWidget*          visu_rendering_window_new           (int width,
                                                             int height,
                                                             gboolean withFrame,
                                                             gboolean withToolBar);

A VisuRenderingWindow widget is a GtkWindow that have an area for OpenGL drawing and a statusBar with many stuff like action buttons, real status bar for notifications, ... The rendering area can be drawn with a frame or not. With this routine, only the VisuRenderingWindow widget is created. To embed it into a window automatically, use `visu_rendering_window_newEmbedded()` instead.

`width` : | its desired width ;
`height` : | its desired height ;
`withFrame` : | a boolean ;
`withToolBar` : | a boolean.
Returns : | a newly created VisuRenderingWindow widget.

### visu_rendering_window_newEmbedded ()

    GtkWidget*          visu_rendering_window_newEmbedded   (int width,
                                                             int height);

Like `visu_rendering_window_new()` but create also a GtkWindow to go around. This widget is reachable using `g_object_get_data()` with the key RENDERING_WINDOW_ID. In that case, no frame is drawn around the rendering area.

`width` : | its desired width ;
`height` : | its desired height.
Returns : | a newly created VisuRenderingWindow widget.. transfer full.

### renderingWindowPush_message ()

    void                renderingWindowPush_message         (VisuRenderingWindow *window,
                                                             gchar *message);

Use this method to add some informations on the status bar.

`window` : | a valid VisuRenderingWindow object ;
`message` : | an UTF8 string to print on the status bar.

### renderingWindowPop_message ()

    void                renderingWindowPop_message          (VisuRenderingWindow *window);

Remove the last message.

`window` : | a valid VisuRenderingWindow object.

### renderingWindowGet_backgroundImage ()

    GdkPixbuf*          renderingWindowGet_backgroundImage  (VisuRenderingWindow *window,
                                                             guchar **rowData,
                                                             gboolean *hasAlphaChannel,
                                                             int *width,
                                                             int *height);

Use this method to load an image in memory (according to GdkPixbuf specification) and retrieve the row data in memory.

`window` : | a valid VisuRenderingWindow object ;
`rowData` : | a pointer to be set on the data in memory ;
`hasAlphaChannel` : | a pointer to store if the loaded iage has an alpha channel ;
`width` : | store the width ;
`height` : | store the height.
Returns : | a pointer to GdkPixbuf that is own by the `window` object. his image stay in memory until a call to `renderigWindowFree_backgroundImage()` occurs.

### renderingWindowFree_backgroundImage ()

    void                renderingWindowFree_backgroundImage (VisuRenderingWindow *window);

Free loaded background image if exists.

`window` : | a valid VisuRenderingWindow object.

### visu_rendering_window_setData ()

    void                visu_rendering_window_setData       (VisuRenderingWindow *window,
                                                             VisuData *data);

This method is used to attach a VisuData object to a given window. When, `data` is not NULL, this method emit the dataReadyForRendering signal, and all modules that needs to draw something should catch this signal and draw in the rendering window. If `data` is NULL, the dataNotReadyForRendering is emitted instead.

`window` : | a valid VisuRenderingWindow object ;
`data` : | a VisuData to render in the given `window` (can be NULL).

### visu_rendering_window_getVisuData ()

    VisuData*           visu_rendering_window_getVisuData   (VisuRenderingWindow *window);

This method is used to get the VisuData attached to a window.

`window` : | a valid VisuRenderingWindow object.
Returns : | the VisuData attached to the `window` or NULL if none.. transfer none.

### visu_rendering_window_loadFile ()

    void                visu_rendering_window_loadFile      (VisuRenderingWindow *window,
                                                             VisuData *data,
                                                             guint iSet);

This method calls the general function to load data from file and deals with errors with gtkDialogs. The filenames must have already been set into `data` using `visu_data_addFile()`.

`window` : | a valid VisuRenderingWindow object.
`data` : | the VisuData to be loaded.
`iSet` : | the id of `data` to load.

### renderingWindowOpen_file ()

    void                renderingWindowOpen_file            (VisuRenderingWindow *window,
                                                             GtkWindow *parent);

Do as if the load button has been pushed, i.e. open a filechooser dialog on the `parent` window, and load the resulting file, refreshing the view if necessary.

`window` : | the window the file will by rendered on ;
`parent` : | the parent window for the filechooser dialog.

### visu_rendering_window_dump ()

    gboolean            visu_rendering_window_dump          (VisuRenderingWindow *window,
                                                             VisuDump *format,
                                                             const char *fileName,
                                                             gint width,
                                                             gint height,
                                                             GError **error,
                                                             ToolVoidDataFunc functionWait,
                                                             gpointer data);

Call this method to dump the given `window` to a file.

`window` : | a valid VisuRenderingWindow object ;
`format` : | a VisuDump object, corresponding to the write method ;
`fileName` : | a string that defined the file to write to ;
`width` : | an integer ;
`height` : | an integer ;
`error` : | a location to store some error (not NULL) ;. allow-none.
`functionWait` : | a method to call periodically during the dump ;. scope call
`data` : | some pointer on object to be passed to the wait function.. closure
Returns : | TRUE if everything went right.

### renderingWindowRedraw ()

    void                renderingWindowRedraw               (VisuRenderingWindow *window,
                                                             gboolean forceRedraw);

Update the OpenGL area of the rendering window if the opengl option is set to immediate. If not, use `forceRedraw` to redraw.

`window` : | a valid VisuRenderingWindow object ;
`forceRedraw` : | a boolean.

### renderingWindowSet_current ()

    void                renderingWindowSet_current          (VisuRenderingWindow *window,
                                                             gboolean force);

Set the OpenGL area as the current rendering area. If `force` is TRUE then the context is switched whatever buffered value.

`window` : | a valid VisuRenderingWindow object ;
`force` : | a boolean.

Since 3.5

### renderingWindowPush_interactive ()

    void                renderingWindowPush_interactive     (VisuRenderingWindow *window,
                                                             VisuInteractive *inter);

It adds `inter` to the stack of interactive sessions currently attached to `window` and launch it.

`window` : | a VisuRenderingWindow object.
`inter` : | a VisuInteractive object.

Since 3.6

### renderingWindowPop_interactive ()

    void                renderingWindowPop_interactive      (VisuRenderingWindow *window,
                                                             VisuInteractive *inter);

It removes `inter` from the stack of interactive sessions currently attached to `window`. If `inter` was first on the stack, the next session is launched.

`window` : | a VisuRenderingWindow object.
`inter` : | a VisuInteractive object.

Since 3.6

### visu_rendering_window_getMarks ()

    VisuMarks*          visu_rendering_window_getMarks      (VisuRenderingWindow *window);

Get the VisuMarks of the given `window`.

`window` : | a VisuRenderingWindow object ;
Returns : | a VisuMarks object owned by V_Sim. . transfer none.

Since 3.6

### renderingWindowClassGet_interactive ()

    VisuInteractive*    renderingWindowClassGet_interactive ();

The user actions on the rendering area are handled by a VisuInteractive object.

Returns : | the VisuInteractive object used by the rendering window of V_Sim. This object is owned by V_Sim.

Since 3.6

### visu_rendering_window_setDisplayCoordinatesInReduce ()

    gboolean            visu_rendering_window_setDisplayCoordinatesInReduce
                                                            (gboolean status);

If set, the coordinates of picked nodes are displayed in reduced values.

`status` : | a boolean.
Returns : | TRUE if the value has been changed.

Since 3.6

### visu_rendering_window_getDisplayCoordinatesInReduce ()

    gboolean            visu_rendering_window_getDisplayCoordinatesInReduce
                                                            ();

Picked nodes have their coordinates displayed in the status bar of the rendering window. This methods retrieves if they are printed in reduced values or not.

Returns : | TRUE if the coordinates are displayed in reduced values.

Since 3.6

### visu_rendering_window_setAutoAdjust ()

    gboolean            visu_rendering_window_setAutoAdjust (gboolean status);

If set, the camera auto adjust its zoom capability for the data to be full size at zoom level 1.

`status` : | a boolean.
Returns : | TRUE if the value has been changed.

Since 3.6

### visu_rendering_window_getAutoAdjust ()

    gboolean            visu_rendering_window_getAutoAdjust ();

The camera can be set to auto adjust its zoom capability for the data to be full size at zoom level 1.

Returns : | TRUE if the camera auto adjust on data loading.

Since 3.6

## Signal Details

### The `"export"` signal

    void                user_function                      (VisuRenderingWindow *window,
                                                            gpointer             user_data)      : Run Last / Action

Signal emitted when the user ask for data export.

`window` : | the object emitting the signal.
`user_data` : | user data set when the signal handler was connected.

Since 3.6

### The `"open"` signal

    void                user_function                      (VisuRenderingWindow *window,
                                                            gpointer             user_data)      : Run Last / Action

Signal emitted when the user ask to open new data.

`window` : | the object emitting the signal.
`user_data` : | user data set when the signal handler was connected.

Since 3.6

### The `"reload"` signal

    void                user_function                      (VisuRenderingWindow *window,
                                                            gpointer             user_data)      : Run Last / Action

Signal emitted when the user ask to reload current data.

`window` : | the object emitting the signal.
`user_data` : | user data set when the signal handler was connected.

Since 3.6

### The `"show-action-dialog"` signal

    void                user_function                      (VisuRenderingWindow *window,
                                                            gpointer             user_data)      : Run Last / No Recursion / Action / No Hooks

Signal emitted when the user ask to show the action dialog.

`window` : | the object emitting the signal.
`user_data` : | user data set when the signal handler was connected.

Since 3.6

### The `"show-main-panel"` signal

    void                user_function                      (VisuRenderingWindow *window,
                                                            gpointer             user_data)      : Run Last / No Recursion / Action / No Hooks

Signal emitted when the user ask to raise the main panel.

`window` : | the object emitting the signal.
`user_data` : | user data set when the signal handler was connected.

Since 3.6