SYNOPSIS:
#include <Xm/GPhigsW.h>
DESCRIPTION:
GPhigsW is a widget that creates a workstation in the sense of a GPHIGS environment. It permits graphics in a manner transparent to the user, as well as locator and pick interaction. Some aspects of widget creation are to be considered:
RESOURCES:
Widget resources are:
XmNwsid:
GPHIGS workstation number.
Resource type: integer (int).
Default value: 1.
An identifier with which the user accesses the workstation, used by the function popen_ws (1,2,3,...).
XmNwidthWs:
Width of the GPHIGS workstation (graphic window).
Resource type: integer (int)
Default value: 50 (minimum value)
The width of the graphic window used by GPHIGS for display. This value may be greater than the width of the widget itself (given by the resource XmNwidth). In this case, the widget automatically manages a scrolled window, making it possible to move a sub-window within the graphic area.
XmNheightWs:
Height of the GPHIGS workstation (graphic window).
Resource type: integer (int)
Default value: 50 (minimum value)
Same characteristics as the XmNwidthXs resource.
Locator device number.
Resource type: integer (int)
Default value: 1
This resource is used by GPHIGS to determine the type of locator device used. The value of this number depends on G5G's PHIGS implementation.
XmNpickdev:
Pick device number.
Resource type: integer (int)
Default value: 1
XmNnumButton:
Button number for locator or pick validation.
Resource type: integer (int)
Default value: 1
This value (1, 2, 3, or any combination) corresponds to the mouse button number:
1 - left button
2 - centre button
3 - right button
Note: It is possible to use several buttons for validation.
Example: Validation using any of the three buttons.
XtSetArg(arg[n], XmNnumButton, 123);
Example: Using 2 buttons, 2 and 3.
XtSetArg(arg[n], XmNnumButton, 23);
XmNpressButton:
Moment of button validation (press/release)
Possible values: XmGPHIGS_PRESS (default)
XmGPHIGS_RELEASE.
XmNdepthPick:
Pick search depth.
Resource type: integer (int)
Default value: 0
XmNresizeWs:
Graphic window resize flag. This flag manages the behaviour of the graphic window when the GPhigsW widget is resized. By default this resource is set to XmGPHIGS_NOT_RESIZE_WS, meaning that the graphic window will not change size. Possible values are XmGPHIGS_NOT_RESIZE_WS and XmGPHIGS_RESIZE_WS.
Three types of behaviour are possible:
The widget does not possess a scrolled window and the graphic zone
(drawing area) follows all widget resizes. The resource XmGPHIGS_RESIZE_WS is
used and the size of the graphic zone must not be given, that is, must not be
set by XmNwidthWs and XmNheightWs. It is, however, possible to give an initial
size to the widget.
The widget possesses a scrolled window but its graphic zone is a
fixed size. The resource XmGPHIGS_NOT_RESIZE_WS is used and the size of the
graphic zone is given, i.e. set by XmNwidthWs and XmNheightWs.
The widget possesses a scrolled window and a graphic zone of a
given size. This graphic zone follows the widget resizes but may not be
smaller than the initial size. The scrolled window will be used if necessary.
The resource XmGPHIGS_RESIZE_WS is used and the size of the graphic zone is
given.
This resource may be used to choose the output driver. The widget makes it possible to choose the output type and thus adapt for maximum use of the machine's capabilities, as in other parts of GPHIGS. Possible choices include :
8887 (X11) default value
7177 GL
8384 Starbase
8871 Xgl
8069 PEX structure
8070 PEX immediate
7971 OpenGL
XmNlocatorCallback:
Activation by callback of GPHIGS locator.
Information returned:
typedef struct {
Pint wsid;
Pint GPhigsViewIndex;
Ppoint GPhigsLocator;
XButtonEvent *GPhigsEvent;
} XmGPhigsLocatorStruct;
GPhigsViewIndex: view index
GPhigsLocator: coordinates (x,y) of view points
XmNpickCallback:
Activation by callback of pick.
Information returned:
typedef struct {
Pint wsid;
Pin_status GPhigsStatus;
Ppick_path GPhigsPick;
XButtonEvent *GPhigsEvent;
} XmGPhigsPickStruct;
GPhigsStatus: Pick status.
GPhigsPick: The depth of the path that was found and the path, consisting of the structure number, the pick identifier and the element number.
typedef struct {
Pint depth;
Ppick_path_el *path;
} Ppick_path;
typedef enum{
PIN_STATUS_NONE
PIN_STATUS_OK,
PIN_STATUS_NO_IN
} Pin_status;
typedef struct {
Pint struct_id;
Pint pick_id;
Pint elem_pos;
} Ppick_path_el;
XmNcreateDACallback:
This callback informs the user that the window is mapped. It may now display graphics and post structures. This callback facilitates construction of the CSS and display of the first image. This callback can be used for opening a PHIGURE workstation (see also 2.5. Using Widget with PHIGURE).
Note: This callback is only called once - when the widget is created.
XmNexposeDACallback:
This callback informs the user that an expose occurred for the display window. This procedure is called for all expose events as the widget no longer handles them.
XmNresizeDACallback:
This callback informs the user that display window has been resized, returning the workstation number as the widget no longer handles such events.
XmNphigureWs:
This resource is available if you have PHIGURE(TM), G5G's high-level graphics library. When you want to use the widget with PHIGURE, you must set the resource to XmPHIGURE_WS. The default is XmGPHIGS_WS.
XmNwidgetDA:
This resource may be used for adding an event in the drawing area widget of the GPHIGS widget, e.g. with XtAddEventHandler. With XtGetValues function this resource return a widget identifier, and you can put your EventHandler on this widget.