|
GLG Toolkit, C / C++ API Library
Version 4.6
|
This group contains methods used to load, set up and display a GLG drawing. More...
This group contains methods used to load, set up and display a GLG drawing.
Functions | |
| GlgObjectC (char *filename) | |
| Constructor: Loads an object from a file. More... | |
| GlgObjectC (void *image, GlgLong size) | |
| Constructor: loads an object from a generated memory image. More... | |
| void | DialogInitialDraw (GlgObjectC &parent) |
| Displays a GLG drawing as a floating dialog for the first time after it has been created or loaded. More... | |
| void | DialogSetupHierarchy (GlgObjectC &parent) |
| Provides an explicit request to set up the object hierarchy of a drawing displayed in a dialog window. More... | |
| void | InitialDraw (void) |
| Draws a GLG viewport object for the first time after it has been created or loaded. More... | |
| GlgBoolean | Load (char *filename, char *resource_name=NULL) |
| Loads an object from a file or a URL, replacing the previously stored object. More... | |
| GlgBoolean | Load (void *image, GlgLong size, char *resource_name=NULL) |
| Loads an object from a generated memory image, replacing the previously stored object. More... | |
| void | LoadNullObject (void) |
| Releases the stored object. More... | |
| GlgBoolean | LoadWidget (char *filename) |
| Loads a GLG widget from a file or a URL. More... | |
| GlgBoolean | LoadWidget (GlgObjectC &parent) |
| Extracts a GLG widget contained inside another object. More... | |
| GlgBoolean | LoadWidget (void *image, GlgLong size) |
| Loads a GLG widget from a generated memory image. More... | |
| GlgBoolean | Reset (void) |
| Reinitializes the drawing by resetting the drawing hierarchy, then setting it up again and rendering the drawing. More... | |
| void | ResetHierarchy (void) |
| Resets the object hierarchy. More... | |
| void | SetupHierarchy (void) |
| Provides an explicit request to set up the object hierarchy without rendering the object. More... | |
| GlgBoolean | Sync (void) |
| Flushes the windowing system output for this viewport to the display. More... | |
| GlgBoolean | Update (void) |
| Updates a drawing to show new resource values. More... | |
| GlgObjectC | ( | char * | filename | ) |
Constructor: Loads an object from a file.
This is a wrapper for GlgLoadObject.
| filename | Specifies the file or the URL to load an object from. For details of using URLs on Linux, see GlgGetURLCB. |
| GlgObjectC | ( | void * | image, |
| GlgLong | size | ||
| ) |
Constructor: loads an object from a generated memory image.
| image | Specifies the address of the drawing image generated by the GLG Code Generation Utility gcodegen. |
| size | Specifies the image size. This is also generated by gcodegen. |
This is a wrapper for GlgLoadObjectFromImage, see GlgLoadObjectFromImage for more information.
| void DialogInitialDraw | ( | GlgObjectC & | parent | ) |
Displays a GLG drawing as a floating dialog for the first time after it has been created or loaded.
This is a wrapper for GlgDialogInitialDraw.
| parent | Specifies the viewport of the main drawing the dialog will be a child of. |
This method is similar to InitialDraw, with the only difference that the drawing will be displayed as a child dialog of the main drawing specified by the parent parameter.
GlgConfigureWindow may be used to set the dialog's size and position.
| void DialogSetupHierarchy | ( | GlgObjectC & | parent | ) |
Provides an explicit request to set up the object hierarchy of a drawing displayed in a dialog window.
This is a wrapper for GlgDialogSetupHierarchy.
| parent | Specifies the viewport of the main drawing the dialog will be a child of. |
This method similar to SetupHierarchy, with the only difference that the drawing will be set up as a child dialog of the main drawing specified by the parent parameter.
This method needs to be invoked only on the initial draw of the dialog. After the dialog has been set up, a generic SetupHierarchy method may be used for all objects, including the dialog.
| void InitialDraw | ( | void | ) |
Draws a GLG viewport object for the first time after it has been created or loaded.
This is a wrapper for GlgInitialDraw.
The method displays a viewport's drawing in a platform-independent way on both Windows and Linux/Unix, and is part of the GLG Generic API.
The method creates a top level window and renders the viewport's drawing in it. Depending on the used version of the GLG library and the configuration settings, different rendering engines may be used for rendering graphics:
If GlgWrapperC or GtkmmGlgWidget widgets are used on Linux/Unix, or the GlgControlC control is used on Windows, this method is invoked automatically, and need not be explicitly called.
InitialDraw is equivalent to the following sequence:
See Generic API Application Example for a cross-platform example of using this method.
| GlgBoolean Load | ( | char * | filename, |
| char * | resource_name = NULL |
||
| ) |
Loads an object from a file or a URL, replacing the previously stored object.
This is a wrapper for GlgLoadObject.
| filename | Specifies the file or the URL to load the object from. For details of using URLs on Linux, see GlgGetURLCB. |
| resource_name | An optional resource path.
|
| GlgBoolean Load | ( | void * | image, |
| GlgLong | size, | ||
| char * | resource_name = NULL |
||
| ) |
Loads an object from a generated memory image, replacing the previously stored object.
| image | Specifies the address of the drawing image generated by the GLG Code Generation Utility gcodegen. |
| size | Specifies the image size. This is also generated by gcodegen. |
| resource_name | An optional resource path.
|
This is a wrapper for GlgLoadObjectFromImage, see GlgLoadObjectFromImage for more information.
| void LoadNullObject | ( | void | ) |
Releases the stored object.
Replaces the currently loaded object with a null object.
| GlgBoolean LoadWidget | ( | char * | filename | ) |
Loads a GLG widget from a file or a URL.
Loads the "$Widget" viewport from a GLG drawing file or a URL, replacing the previously stored object. This is a wrapper for GlgLoadWidgetFromFile.
| filename | Specifies the name of the widget's drawing file or the URL. For details of using URLs on Linux, see GlgGetURLCB. |
| GlgBoolean LoadWidget | ( | GlgObjectC & | parent | ) |
Extracts a GLG widget contained inside another object.
Finds the "$Widget"viewport inside the parent object, and stores it, replacing the previously stored object. This is a wrapper for GlgLoadWidgetFromObject.
| parent | The parent object containing the "$Widget" viewport. |
| GlgBoolean LoadWidget | ( | void * | image, |
| GlgLong | size | ||
| ) |
Loads a GLG widget from a generated memory image.
Loads the "$Widget" viewport from a generated memory image, replacing the previously stored object.
| image | Specifies the address of the drawing image generated by the GLG Code Generation Utility gcodegen. |
| size | Specifies the image size. This is also generated by gcodegen. |
This is a wrapper for GlgLoadWidgetFromImage, see GlgLoadWidgetFromImage for more information.
| GlgBoolean Reset | ( | void | ) |
Reinitializes the drawing by resetting the drawing hierarchy, then setting it up again and rendering the drawing.
This is a wrapper for GlgReset.
Calling Reset restores all volatile resource changes to the values the resources had when the widget was first drawn. It also discards currently displayed chart data, unless the chart Persistent attribute is set to True.
The method should be invoked only for the top-level viewports, not the child viewports.
| void ResetHierarchy | ( | void | ) |
Resets the object hierarchy.
This is a wrapper for GlgResetHierarchy.
Resets the object hierarchy of a top-level viewport or drawing. If the object was displayed using the Generic API, this method must be called before the top-level object is destroyed.
This method should not be called for the top-level viewports used in the integrated GLG widgets, such as the GlgWrapperC or GlgControlC.
Warning: Do not confuse this method with the Reset method, which is used to redraw a displayed drawing and to regenerate the object hierarchy.
| void SetupHierarchy | ( | void | ) |
Provides an explicit request to set up the object hierarchy without rendering the object.
This is a wrapper for GlgSetupHierarchy.
When invoked on a drawing which has been loaded but not yet displayed, the method sets up the drawing's object hierarchy to prepare the drawing for rendering. The drawing should contain either a top-level viewport object, or a group containing several top-level viewports.
After the initial draw (when the object hierarchy has already been set up), the method can be used to set up any type of object after its resources were changed. Unlike Update, SetupHierarchy sets up the object without repainting it
| GlgBoolean Sync | ( | void | ) |
Flushes the windowing system output for this viewport to the display.
If OpenGL is used, it also flushes OpenGL buffers. In X11, it also waits for all requests to be processed. This is a wrapper for GlgSync.
| GlgBoolean Update | ( | void | ) |
Updates a drawing to show new resource values.
If this object is a light viewport, an update of its parent viewport will be performed. All resource changes are held until the Update method is called or until the viewport's window receives an expose event. (That is, it must be redrawn because another window that was obscuring a part of the viewport's window has been moved. This causes the viewport to redraw itself, using its new data.)
Note: Some drawing resources affect the object hierarchy of the drawing. For example, the Factor attribute of a series object controls the number of template instances that will be created by the series. If a number of instances is increased by setting the series' Factor, the new instances will be created and their resources can be accessed only after the Update or SetupHierarchy method is invoked. If the series object is not persistent, any change (either increase or decrease) of its Factor attribute recreates its instances, and either the Update or SetupHierarchy method should be called before accessing resources of the series' instances.