![]() |
![]() |
![]() |
V_Sim API - Reference Manual | ![]() |
---|---|---|---|---|
typedef GenericRenderingWindow; int visuRenderingWindowInit (char *windowRef, char *iconRef, char *window_name, char *class_name, int width, int height); void setObserveEventListener (GenericRenderingWindow window); void setInteractiveHandlers (GenericRenderingWindow window, VisuInteractive *inter); void setPickEventListener (GenericRenderingWindow window); void removeEventListener (GenericRenderingWindow window); void checkWindowSize (GenericRenderingWindow window, unsigned int *width, unsigned int *height); void raiseRenderWindow (GenericRenderingWindow window); void rename_window (GenericRenderingWindow window, char *nom); void visuRenderingWindowFree_backgroundImage (GenericRenderingWindow window, gpointer image); gpointer visuRenderingWindowGet_backgroundImage (GenericRenderingWindow window, guchar **rowData, gboolean *hasAlphaChannel, int *width, int *height); GenericRenderingWindow visuRenderingWindowGet_current (); void visuRenderingWindowGet_backgroundColor (GenericRenderingWindow window, float rgb[3]); VisuData* visuRenderingWindowGet_visuData (GenericRenderingWindow window); void visuRenderingWindowSet_visuData (GenericRenderingWindow window, VisuData *data); gboolean visuRenderingWindowDump (GenericRenderingWindow window, DumpType *format, char *fileName, gint width, gint height, GError **error, voidDataFunc functionWait, gpointer data);
typedef gpointer GenericRenderingWindow;
This is an alias to store a pointer to the object that represent the redering window. If the window is rendered by GTK, for instance, GenericRenderingWindow is equivalent to a RenderingWindow object.
int visuRenderingWindowInit (char *windowRef, char *iconRef, char *window_name, char *class_name, int width, int height);
This routine will call the backend windowing method to create a rendering window.
|
a title for the window ; |
|
a path to an icon (may be NULL) ; |
|
a string to identify the window inside a class of window ; |
|
a string to identify the class of the window ; |
|
the width ; |
|
the height. |
Returns : |
0 if everything went right. |
void setObserveEventListener (GenericRenderingWindow window);
Bring up the interactive mode listeners (clic, drag...) for observe mode
and connect then to the given methods pointed by userCallbacks
.
|
a pointer on a valid rendering window object (see RenderingWindow if GTK is used for rendering). |
void setInteractiveHandlers (GenericRenderingWindow window, VisuInteractive *inter);
Set the listeners needed for the inter
argument.
|
a pointer on a valid rendering window object (see RenderingWindow if GTK is used for rendering) ; |
|
an interactive descriptive session. |
void setPickEventListener (GenericRenderingWindow window);
Bring up the interactive mode listeners (clic, drag...) for pick mode
and connect then to the given methods pointed by userCallbacks
.
|
a pointer on a valid rendering window object (see RenderingWindow if GTK is used for rendering). |
void removeEventListener (GenericRenderingWindow window);
Remove all listeners responsible for the interactive mode.
|
a pointer on a valid rendering window object (see RenderingWindow if GTK is used for rendering). |
void checkWindowSize (GenericRenderingWindow window, unsigned int *width, unsigned int *height);
Get the rendering window size by asking the X server.
|
a pointer on a valid rendering window object (see RenderingWindow if GTK is used for rendering) ; |
|
a pointer to store the width of the window ; |
|
a pointer to store the height of the window. |
void raiseRenderWindow (GenericRenderingWindow window);
Ask the window manager to raise the given window.
|
a pointer on a valid rendering window object (see RenderingWindow if GTK is used for rendering). |
void rename_window (GenericRenderingWindow window, char *nom);
Change the nam of the given window.
|
a pointer on a valid rendering window object (see RenderingWindow if GTK is used for rendering). |
|
a string, null terminated. |
void visuRenderingWindowFree_backgroundImage (GenericRenderingWindow window, gpointer image);
Free loaded image.
|
a pointer on a valid rendering window object (see RenderingWindow if GTK is used for rendering) ; |
|
an opaque structure returned by visuRenderigWindowGet_backgroundImage() .
|
gpointer visuRenderingWindowGet_backgroundImage (GenericRenderingWindow 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.
|
a pointer on a valid rendering window object (see RenderingWindow if GTK is used for rendering) ; |
|
a pointer to be set on the data in memory ; |
|
a pointer to store if the loaded iage has an alpha channel ; |
|
store the width ; |
|
store the height. |
Returns : |
a pointer to an opaque structure that must be freed after use by a call to visuRenderigWindowFree_backgroundImage:(). |
GenericRenderingWindow visuRenderingWindowGet_current ();
Method used to get a pointer to the current active window.
Returns : |
a pointer to the current active window. |
void visuRenderingWindowGet_backgroundColor (GenericRenderingWindow window, float rgb[3]);
This method is used to retrieve the color of the rendering window, depending on its style (see v_sim.rc for example if the rendering window is monitored by GTK).
|
a pointer on a valid rendering window object (see RenderingWindow if GTK is used for rendering) ; |
|
an allocated array of three floating point values. |
VisuData* visuRenderingWindowGet_visuData (GenericRenderingWindow window);
This method is used to get the VisuData attached to a window.
|
a pointer on a valid rendering window object (see RenderingWindow if GTK is used for rendering). |
Returns : |
the VisuData attached to the window or NULL if none.
|
void visuRenderingWindowSet_visuData (GenericRenderingWindow 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.
|
a pointer on a valid rendering window object (see RenderingWindow if GTK is used for rendering) ; |
|
a VisuData to render in the given window .
|
gboolean visuRenderingWindowDump (GenericRenderingWindow window, DumpType *format, char *fileName, gint width, gint height, GError **error, voidDataFunc functionWait, gpointer data);
Call this method to dump the given window
to a file.
|
a pointer on a valid rendering window object (see RenderingWindow if GTK is used for rendering) ; |
|
a DumpType object, corresponding to the write method ; |
|
a string that defined the file to write to ; |
|
an integer ; |
|
an integer ; |
|
a location to store some error (not NULL) ; |
|
a method to call periodically during the dump ; |
|
some pointer on object to be passed to the wait function. |
Returns : |
TRUE if everything went right. |