'\"! tbl | mmdoc '\"macro stdmacro .ie n \{\ . ds Cr \fB . ds Cb \fB .\} .el \{\ . ds Cr \f7 . ds Cb \f8 .\} .TH SoXt(3IV) .SH NAME SoXt \(em routines for Inventor/Xt compatibility. .SH INHERITS FROM SoXt .SH SYNOPSIS .ps -1 \*(Cr#include .sp .in 1i \f1Methods from class SoXt: .in 0.5i .sp .ta 21m .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic Widget .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbinit\*(Cr(const char *appName, const char *className = "Inventor") .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbinit\*(Cr(Widget topLevelWidget) .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbmainLoop\*(Cr() .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbnextEvent\*(Cr(XtAppContext appContext, XEvent *event) .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic Boolean .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbdispatchEvent\*(Cr(XEvent *event) .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic XtAppContext .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetAppContext\*(Cr() .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic Display * .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetDisplay\*(Cr() .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic Widget .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetTopLevelWidget\*(Cr() .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbshow\*(Cr(Widget widget) .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbhide\*(Cr(Widget widget) .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic XmString .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbencodeString\*(Cr(char *s) .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic char * .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbdecodeString\*(Cr(XmString xs) .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetWidgetSize\*(Cr(Widget w, const SbVec2s &size) .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic SbVec2s .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetWidgetSize\*(Cr(Widget w) .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic Widget .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetShellWidget\*(Cr(Widget w) .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbcreateSimpleErrorDialog\*(Cr(Widget widget, char *dialogTitle, char *errorStr1, char *errorStr2 = NULL) .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetPopupArgs\*(Cr(Display *d, int scr, ArgList args, int *n) .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbregisterColormapLoad\*(Cr(Widget widget, Widget shell) .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbaddColormapToShell\*(Cr(Widget widget, Widget shell) .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbremoveColormapFromShell\*(Cr(Widget widget, Widget shell) .sp .SH DESCRIPTION The SoXt class initializes Inventor for use with the Xt toolkit and Motif. \*(CbSoXt::init()\f1 must be called in order for Inventor to work properly with Xt. \*(CbSoXt::mainLoop()\f1 must be called in order for extension device events to be passed \&to Inventor render areas. The other methods are convenience functions. .sp Refer to the \*(CbSoXtComponent\f1 man pages for examples on how this class should be used when using Inventor Xt components. .SH METHODS .ta 21m .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic Widget .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbinit\*(Cr(const char *appName, const char *className = "Inventor") .br .in 1i \f1This is called to initialize Inventor and Xt, and bind Inventor with Xt event handling so that Inventor sensors will work correctly. This returns the top level shell widget. This method will call \*(CbSoDB::init()\f1, \*(CbSoNodeKit::init()\f1, \*(CbSoInteraction::init()\f1 and \f3XtAppInitialize()\f1. .sp .in 0.5i .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbinit\*(Cr(Widget topLevelWidget) .br .in 1i \f1This alternate form of init allows the application to initialize Xt. The passed widget should be the top level shell widget returned from the Xt initializiation. This method will call \*(CbSoDB::init()\f1, \*(CbSoNodeKit::init()\f1, \*(CbSoInteraction::init()\f1 and \f3XtAppInitialize()\f1. .sp .in 0.5i .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbmainLoop\*(Cr() .br .in 1i \f1This retrieves and dispatches events (loops forever). Unlike Xt which ignores extension devices (i.e. any device besides mouse and keyboard), this main loop will dispatch events from input extension devices \&like the spaceball. It calls \*(CbSoXt::nextEvent()\f1 and \*(CbSoXt::dispatchEvent()\f1 to do this. If only the mouse and keyboard devices are used, this is equivalent to calling \f3XtAppMainLoop()\f1. .sp .in 0.5i .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbnextEvent\*(Cr(XtAppContext appContext, XEvent *event) .br .in 1i \f1Get the nextEvent by calling \f3XtAppNextEvent()\f1. The \*(CbappContext\f1 can be had by calling \*(CbSoXt::getAppContext()\f1. .sp .in 0.5i .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic Boolean .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbdispatchEvent\*(Cr(XEvent *event) .br .in 1i \f1Dispatch the passed event to a handler. Mouse and keyboard events are dispatched by calling \f3XtDispatchEvent()\f1. Events from input extension devices are dispatched by code implemented in this routine. This returns True if \&a handler was found, else it returns False. .sp .in 0.5i .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic XtAppContext .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetAppContext\*(Cr() .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic Display * .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetDisplay\*(Cr() .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic Widget .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetTopLevelWidget\*(Cr() .br .in 1i \f1These return information based on the top level widget returned by or passed to init. .sp .in 0.5i .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbshow\*(Cr(Widget widget) .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbhide\*(Cr(Widget widget) .br .in 1i \f1Convenience routines to show and hide the passed widget. .sp For a shell widget, this is equivalent to calling \f3RealizeWidget()\f1 + \f3XMapWindow()\f1 or \f3XMapRaised()\f1 if window already exists (raise and de-iconify). \*(Cbhide()\f1 will then call \f3XUnmapWindow()\f1. .sp For a subwidget, those \&simply calls \f3XtManageChild()\f1 and \f3XtUnmanageChild()\f1. .sp .in 0.5i .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic XmString .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbencodeString\*(Cr(char *s) .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic char * .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbdecodeString\*(Cr(XmString xs) .br .in 1i \f1These are convenience routines for encoding a character string as an \*(CbXmString\f1, and decoding an \*(CbXmString\f1 back to a character string. (\*(CbXmString\f1 is a Motif string). The application is responsible for freeing up the memory pointed \&to by these return values. Use \f3XmStringFree()\f1 to free an \*(CbXmString\f1, and \f3free()\f1 to free a character pointer. .sp .in 0.5i .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetWidgetSize\*(Cr(Widget w, const SbVec2s &size) .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic SbVec2s .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetWidgetSize\*(Cr(Widget w) .br .in 1i \f1Convenience routines to set/get the size of the given widget. Those are equivalent to calling \f3XtSetValues()\f1 and \f3XtGetValues()\f1 on \f3XtNheight\f1 and \f3XtNwidth\f1 widget resources. .sp .in 0.5i .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic Widget .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetShellWidget\*(Cr(Widget w) .br .in 1i \f1Convenience routine which will return the ShellWidget containing the given widget. The widget tree is traversed up until a shell widget is found using \f3XtIsShell()\f1. .sp .in 0.5i .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbcreateSimpleErrorDialog\*(Cr(Widget widget, char *dialogTitle, char *errorStr1, char *errorStr2 = NULL) .br .in 1i \f1Convenience routine which brings a simple motif error dialog box displaying the given error string(s) and window title. The OK button, which destroys the dialog, is the only button displayed. The widget \&argument is used to create and center the dialog ( using \f3XmCreateErrorDialog()\f1). .sp .in 0.5i .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetPopupArgs\*(Cr(Display *d, int scr, ArgList args, int *n) .br .in 1i \f1Convenience routine which gets visual args for the popup planes. These args can then be passed in to \f3XmCreatePulldownMenu()\f1 or \f3XmCreatePopupMenu()\f1 to create menus in the popup planes. \*(CbregisterColormapLoad()\f1 must be called for each pulldown menu to properly load/unload \&the overlay color map on the shell when needed. .sp .in 0.5i .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbregisterColormapLoad\*(Cr(Widget widget, Widget shell) .br .in 1i \f1Convenience routine which will register map/unmap callbacks to load and unload the pulldown menu color map right before the menu is about to be posted. This should be called when creating pulldown or \&popup menus in the overlays. This will make sure that the right color map is loaded into the shell widget (to make the pulldown/popup look right) and remove it when no longer needed (to make sure the \&OpenGL overlay widget color map is correctly loaded for 8 bit machines). .sp .in 0.5i .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbaddColormapToShell\*(Cr(Widget widget, Widget shell) .br .in 1i+21n .ti 0.5i .ta 21m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=21n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbremoveColormapFromShell\*(Cr(Widget widget, Widget shell) .br .in 1i \f1Convenience routine to insert/remove the given widget colormap onto the supplied shell widget. This will not replace the existing installed colormaps (or list of windows), but instead insert the new colormap \&first into the existing list using \f3XGetWMColormapWindows()\f1 and \f3XSetWMColormapWindows()\f1. .sp .in 0.5i .SH SEE ALSO \*(CbSoXtComponent