home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / Xm / SgGraph.z / SgGraph
Encoding:
Text File  |  2002-10-03  |  86.5 KB  |  1,585 lines

  1.  
  2.  
  3.  
  4.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           SSSSggggGGGGrrrraaaapppphhhh - An OSF/Motif-compatible graph widget.
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           #include <Xm/Xm.h> #include <Sgm/Graph.h>
  13.  
  14.      VVVVEEEERRRRSSSSIIIIOOOONNNN
  15.           This page documents the version of Sgm that accompanies
  16.           Motif 2.1.
  17.  
  18.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.           The SgGraph widget provides the application developer with
  20.           the ability to display any group of widgets as a graph, with
  21.           each widget representing a node. The graph can be
  22.           disconnected, as well as contain cycles.  The arcs used to
  23.           connect the nodes are instances of an SgArc widget,
  24.           developed specifically for use with the SgGraph widget. Arcs
  25.           may be undirected, directed, or bidirected. Note that the
  26.           SgGraph widget does not understand the semantics of arc
  27.           direction, ie. for layout and editing purposes, an arc will
  28.           always have a parent and a child regardless of its
  29.           direction.  The SgGraph widget has the ability to arrange
  30.           all nodes either horizontally or vertically according to an
  31.           internal layout algorithm, and supports an edit mode in
  32.           which arcs and nodes may be interactively repositioned as
  33.           well as created. There is also a read-only mode in which all
  34.           events are passed directly to the children of the Graph
  35.           widget. In edit mode, the SgGraph takes over all device
  36.           events for editing commands.
  37.  
  38.         CCCCLLLLAAAASSSSSSSSEEEESSSS
  39.           The SgGraph widget inherits behavior and resources from the
  40.           Core, Composite, Constraint and XmManager classes.
  41.  
  42.           The class pointer is ssssggggGGGGrrrraaaapppphhhhWWWWiiiiddddggggeeeettttCCCCllllaaaassssssss
  43.  
  44.           The class name is SSSSggggGGGGrrrraaaapppphhhh.
  45.  
  46.         NNNNEEEEWWWW RRRREEEESSSSOOOOUUUURRRRCCCCEEEESSSS
  47.           The Graph widget defines a set of resource types used by the
  48.           programmer to specify the data for the graph.  The
  49.           programmer can also set the values for the Core, Composite,
  50.           and Constraint widget classes to set attributes for this
  51.           widget. The following table contains the set of resources
  52.           defined by Graph. To reference a resource by name or by
  53.           class in a .Xdefaults file, remove the XXXXmmmmNNNN or XXXXmmmmCCCC prefix and
  54.           use the remaining letters.  To specify one of the defined
  55.           values for a resource in a .Xdefaults file, remove the XXXXmmmm
  56.           prefix and use the remaining letters (in either lower case
  57.           or upper case, but include any underscores between words).
  58.           The codes in the access column indicate if the given
  59.           resource can be set at creation time (CCCC), set by using
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 10/3/02)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  71.  
  72.  
  73.  
  74.           XXXXttttSSSSeeeettttVVVVaaaalllluuuueeeessss (SSSS), retrieved by using XXXXttttGGGGeeeettttVVVVaaaalllluuuueeeessss (GGGG), or is
  75.           not applicable (NNNN////AAAA).
  76.                                                   SSSSggggGGGGrrrraaaapppphhhh RRRReeeessssoooouuuurrrrcccceeee SSSSeeeetttt
  77.      NNNNaaaammmmeeee                         CCCCllllaaaassssssss                        TTTTyyyyppppeeee                DDDDeeeeffffaaaauuuulllltttt                   AAAAcccccccceeeessssssss
  78.      ______________________________________________________________________________________________________________
  79.      XmNeditable                  XmCEditable                  Boolean             False                     CSG
  80.      XmNallowMultipleSelections   XmCAllowMultipleSelections   Boolean             True                      CSG
  81.      XmNautoLayoutMode            XmCAutoLayoutMode            XmRAutoLayoutType   XmNEVER                   CSG
  82.      XmNlayoutProc                XmCLayoutProc                XmRPointer          DoLayout                  CSG
  83.      XmNarcDrawMode               XmCArcDrawMode               String              XmPOSITION_RELATIVE       CSG
  84.      XmNdoubleClickInterval       XmCDoubleClickInterval       XmRInt              250                       CSG
  85.      XmNdefaultNodeClass          XmCDefaultNodeClass          XmRInt              xmPushButtonGadgetClass   CSG
  86.      XmNinteractiveArcDirection   XmCInteractiveArcDirection   unsigned char       XmUNDIRECTED              CSG
  87.      XmNmovableNodes              XmCMovableNodes              XmRBoolean          TRUE                      CSG
  88.      XmNtwinsVisible              XmCTwinsVisible              Boolean             True                      CSG
  89.      XmNreorient                  XmCReorient                  Boolean             False                     CSG
  90.      XmNreLayout                  XmCReLayout                  Boolean             False                     CSG
  91.      XmNorientation               XmCOrientation               XmROrientation      XmHORIZONTAL              CSG
  92.      XmNchildSpacing              XmCChildSpacing              short               40                        CSG
  93.      XmNsiblingSpacing            XmCSiblingSpacing            short               30                        CSG
  94.      XmNnewArcCallback            XmCCallback                  Pointer             NULL                      C
  95.      XmNnewNodeCallback           XmCCallback                  Pointer             NULL                      C
  96.      XmNnodeMovedCallback         XmCCallback                  Pointer             NULL                      C
  97.      XmNarcMovedCallback          XmCCallback                  Pointer             NULL                      C
  98.      XmNdefaultActionCallback     XmCCallback                  Pointer             NULL                      C
  99.      XmNselectNodeCallback        XmCCallback                  Pointer             NULL                      C
  100.      XmNselectArcCallback         XmCCallback                  Pointer             NULL                      C
  101.      XmNdeselectCallback          XmCCallback                  Pointer             NULL                      C
  102.      XmNselectSubgraphCallback    XmCCallback                  Pointer             NULL                      C
  103.      XmNgraphTooBigCallback       XmCCallback                  Pointer             NULL                      C
  104.      XmNgraphChangedCallback      XmCCallback                  Pointer             NULL                      C
  105.      XmNuserButtonCallback        XmCCallback                  Pointer             NULL                      C
  106.      XmNptrCursor                 XmCCursor                    XmRCursor           "left_ptr"                CSG
  107.      XmNmotionCursor              XmCCursor                    XmRCursor           "fleur"                   CSG
  108.      XmNindicateCursor            XmCCursor                    XmRCursor           "crossshair"              CSG
  109.      XmNindicateChildCursor       XmCCursor                    XmRCursor           internal "C"              CSG
  110.      XmNindicateParentCursor      XmCCursor                    XmRCursor           internal "P"              CSG
  111.      XmNincrement                 XmCIncrement                 XmRInt              10                        CSG
  112.      XmNokToAdd                   XmCOkToAdd                   XmRBoolean          TRUE                      CSG
  113.      XmNeditableArcs              XmCEditableArcs              Boolean             TRUE                      CSG
  114.      XmNselectableArcs            XmCSelectableArcs            Boolean             TRUE                      CSG
  115.      XmNlayoutStyle               XmCLayoutStyle               XmRLayoutStyle      XmGRAPH                   CSG
  116.      XmNhighlightColor            XmCHighlightColor            XmRPixel            white                     CSG
  117.      XmNoverviewLineColor         XmCoverviewLineColor         XmRPixel            black                     CSG
  118.      XmNoverviewNodeColor         XmCoverviewNodeColor         XmRPixel            black                     CSG
  119.      XmNshowOverviewArcs          XmShowOverviewArcs           XmRBoolean          TRUE                      CSG
  120.      XmNskewOverviewScale         XmSkewOverviewScale          XmRBoolean          FALSE                     CSG
  121.      XmNshowCrossingArcs          XmShowCrossingArcs           XmRBoolean          TRUE                      CSG
  122.      XmNlayoutKey                 XmCLayoutKey                 XmRAtom             NULL                      CSG
  123.  
  124.  
  125.           XXXXmmmmNNNNeeeeddddiiiittttaaaabbbblllleeee
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 10/3/02)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  137.  
  138.  
  139.  
  140.                When this resource is TRUE, the Graph widget is in edit
  141.                mode. The user can interactively reposition individual
  142.                and multiple nodes and arcs, add new nodes and arcs,
  143.                and change the connections of arcs to nodes.  (See
  144.                Translations)
  145.  
  146.  
  147.           XXXXmmmmNNNNaaaalllllllloooowwwwMMMMuuuullllttttiiiipppplllleeeeSSSSeeeelllleeeeccccttttiiiioooonnnnssss
  148.                When this resource is TRUE, (the default), multiple
  149.                nodes and arcs can be selected, either by sweeping out
  150.                a region on the screen with the mouse, or by holding
  151.                down the SHIFT key in conjunction with mouse Button1,
  152.                or by selecting a subtree using <Ctrl> Button1. If this
  153.                resource is FALSE, all these operations are disabled.
  154.  
  155.  
  156.           XXXXmmmmNNNNaaaauuuuttttooooLLLLaaaayyyyoooouuuuttttMMMMooooddddeeee
  157.                This resource controls if and when the graph is relayed
  158.                out as new arcs and nodes are added. This resource can
  159.                take on the values XmNEVER, XmALWAYS, XmARCS_ONLY,
  160.                XmNODES_ONLY, or XmPARTIAL, which behave in the
  161.                following ways:
  162.                  XXXXmmmmNNNNEEEEVVVVEEEERRRR: When XmNautoLayoutMode is XmNEVER, the graph
  163.                  widget never automatically lays out the graph. A new
  164.                  layout of the entire graph can be triggered by
  165.                  calling SgGraphLayout() or an relayout of a subpart
  166.                  of the graph can be triggered by calling
  167.                  XmRelaySubGraph(). A complete relayout can also be
  168.                  triggered by setting the XmNrelayout resource to
  169.                  TRUE.
  170.                  XXXXmmmmAAAALLLLWWWWAAAAYYYYSSSS: When XmNautoLayoutMode is XmALWAYS, the
  171.                  graph widget triggers a relayout whenever a new node
  172.                  or arc is managed, or when a arc is moved from one
  173.                  node to another. This happens regardless of whether
  174.                  or not the change is made interactively or
  175.                  programatically.
  176.                  XXXXmmmmAAAARRRRCCCCSSSS____OOOONNNNLLLLYYYY: When XmNautoLayoutMode is XmARCS_ONLY,
  177.                  the graph widget triggers a complete relayout
  178.                  whenever an arc is added or moved.
  179.                  XXXXmmmmNNNNOOOODDDDEEEESSSS____OOOONNNNLLLLYYYY: When XmNautoLayoutMode is XmNEVER, the
  180.                  graph widget triggers a complete relayout whenever a
  181.                  node is _i_n_t_e_r_a_c_t_i_v_e_l_y added.
  182.                  XXXXmmmmPPPPAAAARRRRTTTTIIIIAAAALLLL: When XmNautoLayoutMode is XmNEVER, the
  183.                  graph widget triggers a partial relayout whenever an
  184.                  arc is added or moved. The relayout is performed by
  185.                  calling XmRelaySubgraph, using the value of the arc's
  186.                  XmNfrom resource as the root of a subgraph.
  187.                It is not expected that any of these approaches will
  188.                perform optimally according to the users expectations,
  189.                but may be useful in some cases.  Be careful about
  190.                setting these before building a graph.  For fastest
  191.                startup time, set XmNautoLayoutMode to XmNEVER.
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 10/3/02)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  203.  
  204.  
  205.  
  206.                Otherwise, if nodes and/or arcs are added one at a
  207.                time, the layout algorithm may be called for each node
  208.                and/or arc created. The default value is XmNEVER.
  209.  
  210.  
  211.           XXXXmmmmNNNNaaaarrrrccccDDDDrrrraaaawwwwMMMMooooddddeeee
  212.                The value of this resource determines how all arcs in
  213.                the graph are drawn.  If XmNarcDrawMode is
  214.                XmPOSITION_RELATIVE (the default), arcs are drawn from
  215.                the center of the parent node to the center of the
  216.                child node (without actually overlapping the node
  217.                widgets). If XmNarcDrawMode is XmPOSITION_FIXED, the
  218.                arcs will be drawn from the middle bottom of the parent
  219.                to the middle top of the child if XmNorientation is
  220.                XmVERTICAL, and from the middle right of the parent to
  221.                the middle left of the child if XmNorientation is
  222.                XmHORIZONTAL.
  223.  
  224.                If arcDrawMode is set to XmPOSITION_PROPORTIONAL, then
  225.                the graph draws connecting arcs according to the value
  226.                of the XmNfromSide, XmNtoSide, XmNfromPosition, and
  227.                amNtoPosition resources supported by each arc widget.
  228.                This mode allows applications to have fine control over
  229.                the location of the arcs at each connecting point. See
  230.                SgArc(3) for details.
  231.  
  232.  
  233.           XXXXmmmmNNNNddddoooouuuubbbblllleeeeCCCClllliiiicccckkkkIIIInnnntttteeeerrrrvvvvaaaallll
  234.                The timer interval between mouse clicks recognized as a
  235.                double click by the graph widget.
  236.  
  237.  
  238.           XXXXmmmmNNNNddddeeeeffffaaaauuuullllttttNNNNooooddddeeeeCCCCllllaaaassssssss
  239.                When XmNeditable is TRUE, the user can add new nodes
  240.                interactively to the graph. The value of this resource
  241.                determines what type of widget is created and must be a
  242.                class pointer to a valid widget class.  The default is
  243.                an XmPushButtonGadget.
  244.  
  245.  
  246.           XXXXmmmmNNNNiiiinnnntttteeeerrrraaaaccccttttiiiivvvveeeeAAAArrrrccccDDDDiiiirrrreeeeccccttttiiiioooonnnn
  247.                When an arc is drawn interactively, this resource
  248.                determines whether the arc is undirected, bidirected,
  249.                or directed.
  250.  
  251.  
  252.           XXXXmmmmNNNNmmmmoooovvvvaaaabbbblllleeeeNNNNooooddddeeeessss
  253.                If TRUE, nodes can be moved interactively when the
  254.                graph is in edit mode.  When false, nodes cannot be
  255.                repositioned.
  256.  
  257.  
  258.  
  259.  
  260.  
  261.      Page 4                                          (printed 10/3/02)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  269.  
  270.  
  271.  
  272.           XXXXmmmmNNNNttttwwwwiiiinnnnssssVVVViiiissssiiiibbbblllleeee
  273.                When this resource is FALSE (the default), arcs that
  274.                extend between the same 2 nodes will be drawn on top of
  275.                the other, in arbitrary order. When this resource is
  276.                TRUE, 1 arc is drawn as a straight line and the rest
  277.                are drawn as non-overlapping curves between the same 2
  278.                points.
  279.  
  280.  
  281.           XXXXmmmmNNNNoooorrrriiiieeeennnnttttaaaattttiiiioooonnnn
  282.                If this resource is XmHORIZONTAL the graph horizontal
  283.                (left to right) layout algorithm is invoked on the
  284.                graph widget, otherwise if its value is XmVERTICAL the
  285.                graph vertical (top to bottom) layout algorithm is
  286.                invoked.  Also, see under XmNarcDrawMode for the effect
  287.                of this resource on how arcs are drawn.
  288.  
  289.  
  290.           XXXXmmmmNNNNrrrreeeeoooorrrriiiieeeennnntttt
  291.                Any time this resource is set to TRUE, regardless of
  292.                its current value, the graph widget is re-laid out
  293.                vertically if its direction is currently XmHORIZONTAL,
  294.                or horizontally otherwise.
  295.  
  296.  
  297.           XXXXmmmmNNNNrrrreeeeLLLLaaaayyyyoooouuuutttt
  298.                Any time this resource is set to TRUE, regardless of
  299.                its current value, the graph widget is re-laid out in
  300.                the current direction.
  301.  
  302.  
  303.           XXXXmmmmNNNNoooorrrriiiieeeennnnttttaaaattttiiiioooonnnn
  304.                This resource determines whether the graph is laid out
  305.                vertically (XmVERTICAL) or horizontally (XmHORIZONTAL).
  306.                The default is XMHORIZONTAL.
  307.  
  308.  
  309.           XXXXmmmmNNNNcccchhhhiiiillllddddSSSSppppaaaacccciiiinnnngggg aaaannnndddd XXXXmmmmNNNNssssiiiibbbblllliiiinnnnggggSSSSppppaaaacccciiiinnnngggg
  310.                These 2 resources determine the space the layout
  311.                algorithm will leave between parent and child
  312.                (childSpacing) and between children of the same node
  313.                (siblingSpacing). The value of these resources is
  314.                interpreted in terms of the current value of the
  315.                XmNunitType resource.
  316.  
  317.  
  318.           XXXXmmmmNNNNnnnneeeewwwwAAAArrrrccccCCCCaaaallllllllbbbbaaaacccckkkk aaaannnndddd XXXXmmmmNNNNnnnneeeewwwwNNNNooooddddeeeeCCCCaaaallllllllbbbbaaaacccckkkk
  319.                This callback list is invoked when a new arc or node is
  320.                created interactively by the user. The arc or node is
  321.                automatically created by the system and positioned
  322.                according to the users instructions. In the case of a
  323.                node, the default node is a XmPushButtonGadget.  The
  324.  
  325.  
  326.  
  327.      Page 5                                          (printed 10/3/02)
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  335.  
  336.  
  337.  
  338.                application's XmNnewNodeCallback or XmNnewArcCallback
  339.                is called before the arc or node is managed, with the
  340.                node or arc as the widget member of the call data
  341.                struct, allowing the application to create or set
  342.                whatever information the arc or node represents and to
  343.                modify the widgets resources. The reason member of the
  344.                call data structure is XmCR_NEW_ARC or XmCR_NEW_NODE,
  345.                respectively.
  346.  
  347.  
  348.           XXXXmmmmNNNNaaaarrrrccccMMMMoooovvvveeeeddddCCCCaaaallllllllbbbbaaaacccckkkk aaaannnndddd XXXXmmmmNNNNnnnnooooddddeeeeMMMMoooovvvveeeeddddCCCCaaaallllllllbbbbaaaacccckkkk
  349.                These callback lists are invoked when an arc or node is
  350.                moved interactively by the user. When a node is being
  351.                moved, the node is first positioned according to the
  352.                user's instructions and then the application's callback
  353.                is called. When an arc is moved, the callback is
  354.                invoked before the arc is moved to give the programmer
  355.                the opportunity to disallow the move (See Callbacks).
  356.                The argument list to the callbacks includes the the arc
  357.                widget, and the node widget respectively.  The _r_e_a_s_o_n
  358.                member of the callback struct is XmCR_ARC_MOVED or
  359.                XmCR_NODE_MOVED, respectively. If multiple nodes are
  360.                moved (because multiple nodes are selected, and the one
  361.                of the selected nodes are moved), the reason will be
  362.                XmCR_NODES_MOVED, and the _w_i_d_g_e_t member of the call
  363.                data struct will indicate the first widget in the list
  364.                of selected nodes, and the complete list of moved nodes
  365.                will be given in the _s_e_l_e_c_t_e_d__n_o_d_e_s.
  366.  
  367.  
  368.           XXXXmmmmNNNNddddeeeeffffaaaauuuullllttttAAAAccccttttiiiioooonnnnCCCCaaaallllllllbbbbaaaacccckkkk
  369.                This callback is invoked when the user double clicks on
  370.                a node or arc when the graph is in edit mode.
  371.  
  372.  
  373.      XXXXmmmmNNNNsssseeeelllleeeeccccttttNNNNooooddddeeeeCCCCaaaallllllllbbbbaaaacccckkkk
  374.           XXXXmmmmNNNNsssseeeelllleeeeccccttttSSSSuuuubbbbggggrrrraaaapppphhhhCCCCaaaallllllllbbbbaaaacccckkkk,,,, XXXXmmmmNNNNsssseeeelllleeeeccccttttAAAArrrrccccCCCCaaaallllllllbbbbaaaacccckkkk aaaannnndddd
  375.                These callback lists are invoked when an arc, subgraph,
  376.                or node is selected.  The argument list to the
  377.                callbacks includes the widget of the subgraph root, the
  378.                arc widget, and the node widget respectively. The
  379.                reasons are XmCR_SELECT_SUBGRAPH, XmCR_SELECT_ARC, and
  380.                XmCR_SELECT_NODE, respectively.  If multiple arcs
  381.                and/or nodes are selected simultaneously (by sweeping
  382.                out a region with the mouse), the reason is given as
  383.                XmCR_SELECT_ARCS, XmCR_SELECT_NODES, or
  384.                XmCR_SELECT_ARCS_AND_NODES. In this case, the _w_i_d_g_e_t
  385.                member of the call data struct will indicate the first
  386.                widget in the list of selected nodes or arcs, and the
  387.                complete list of selected arcs and/or nodes will be
  388.                given in the _s_e_l_e_c_t_e_d__a_r_c_s and _s_e_l_e_c_t_e_d__n_o_d_e_s lists.
  389.  
  390.  
  391.  
  392.  
  393.      Page 6                                          (printed 10/3/02)
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  401.  
  402.  
  403.  
  404.           XXXXmmmmNNNNddddeeeesssseeeelllleeeeccccttttCCCCaaaallllllllbbbbaaaacccckkkk
  405.                This callback is called when any arc or node is
  406.                deselected.
  407.  
  408.  
  409.           XXXXmmmmNNNNggggrrrraaaapppphhhhTTTTooooooooBBBBiiiiggggCCCCaaaallllllllbbbbaaaacccckkkk
  410.                This callback is called when the graph window would
  411.                have to exceed the maximum size of an X window to
  412.                display the graph.
  413.  
  414.  
  415.           XXXXmmmmNNNNggggrrrraaaapppphhhhCCCChhhhaaaannnnggggeeeeddddCCCCaaaallllllllbbbbaaaacccckkkk
  416.                This callback is called when any child of the graph
  417.                widget moves or the graph strucure is changed in
  418.                anyway.
  419.  
  420.  
  421.           XXXXmmmmNNNNuuuusssseeeerrrrBBBBuuuuttttttttoooonnnnCCCCaaaallllllllbbbbaaaacccckkkk
  422.                This callback is called when mouse button 3 is pressed,
  423.                as a hook for pop up menus.
  424.  
  425.  
  426.           XXXXmmmmNNNNppppttttrrrrCCCCuuuurrrrssssoooorrrr
  427.                The "normal" cursor. If a new cursor is installed, the
  428.                Graph widget frees the previous cursor, regardless of
  429.                who created the cursor.
  430.  
  431.  
  432.           XXXXmmmmNNNNmmmmoooottttiiiioooonnnnCCCCuuuurrrrssssoooorrrr
  433.                The cursor shown when a node is being moved. If a new
  434.                cursor is installed, the Graph widget frees the
  435.                previous cursor, regardless of who created the cursor.
  436.  
  437.  
  438.           XXXXmmmmNNNNiiiinnnnddddiiiiccccaaaatttteeeeCCCCuuuurrrrssssoooorrrr
  439.                The cursor shown when selecting an arc or node, while
  440.                the mouse button is depressed.  If a new cursor is
  441.                installed, the Graph widget frees the previous cursor,
  442.                regardless of who created the cursor.
  443.  
  444.  
  445.           XXXXmmmmNNNNiiiinnnnddddiiiiccccaaaatttteeeeCCCChhhhiiiillllddddCCCCuuuurrrrssssoooorrrr
  446.                The cursor shown when an arc is being moved if the end
  447.                being edited is the "to" or child end. If the arc is
  448.                being created, this cursor will be displayed only after
  449.                the sprite is moved out of the parent node.  If a new
  450.                cursor is installed, the Graph widget frees the
  451.                previous cursor, regardless of who created the cursor.
  452.  
  453.  
  454.           XXXXmmmmNNNNiiiinnnnddddiiiiccccaaaatttteeeePPPPaaaarrrreeeennnnttttCCCCuuuurrrrssssoooorrrr
  455.                The cursor shown when an arc is being moved if the end
  456.  
  457.  
  458.  
  459.      Page 7                                          (printed 10/3/02)
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  467.  
  468.  
  469.  
  470.                being edited is the "from" or parent end. When a new
  471.                arc is being created, the initial node under the sprite
  472.                is assumed to be the parent, and the
  473.                XmNindicateParentCursor is displayed until the sprite
  474.                is moved out of the parent node. If a new cursor is
  475.                installed, the Graph widget frees the previous cursor,
  476.                regardless of who created the cursor.
  477.  
  478.  
  479.           XXXXmmmmNNNNiiiinnnnccccrrrreeeemmmmeeeennnntttt
  480.  
  481.                Controls the number of pixels the graph scrolls when
  482.                scrolled in individual increments. See XmScrollBar(3).
  483.  
  484.  
  485.           XXXXmmmmNNNNooookkkkTTTTooooAAAAdddddddd
  486.  
  487.                If this resource is TRUE, widgets and arcs can be added
  488.                interactively to a graph.
  489.  
  490.  
  491.           XXXXmmmmNNNNeeeeddddiiiittttaaaabbbblllleeeeAAAArrrrccccssss
  492.  
  493.                If this resource is TRUE, arcs can be added
  494.                interactively to a graph and existing arcs can be
  495.                edited to point to and from different nodes.
  496.  
  497.  
  498.           XXXXmmmmNNNNsssseeeelllleeeeccccttttaaaabbbblllleeeeAAAArrrrccccssss
  499.  
  500.                If this resource is TRUE, arcs can be selected and
  501.                respond to double-clicks.
  502.  
  503.  
  504.           XXXXmmmmNNNNllllaaaayyyyoooouuuuttttSSSSttttyyyylllleeee
  505.  
  506.                This resource works with the internal layout algorithm
  507.                to produce a "normal" graph layout or a "butterfly"
  508.                layout. Possible values are XmGRAPH (the default) or
  509.                XmBUTTERFLY.
  510.  
  511.  
  512.           XXXXmmmmNNNNhhhhiiiigggghhhhlllliiiigggghhhhttttCCCCoooolllloooorrrr
  513.  
  514.                The color used to highlight arcs when they are
  515.                selected.
  516.  
  517.  
  518.           XXXXmmmmNNNNoooovvvveeeerrrrvvvviiiieeeewwwwLLLLiiiinnnneeeeCCCCoooolllloooorrrr
  519.  
  520.                The color used to draw arcs in the overview.
  521.  
  522.  
  523.  
  524.  
  525.      Page 8                                          (printed 10/3/02)
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  533.  
  534.  
  535.  
  536.           XXXXmmmmNNNNoooovvvveeeerrrrvvvviiiieeeewwwwNNNNooooddddeeeeCCCCoooolllloooorrrr
  537.  
  538.                The color used to draw unselected nodes in the
  539.                overview.
  540.  
  541.  
  542.           XXXXmmmmNNNNsssshhhhoooowwwwOOOOvvvveeeerrrrvvvviiiieeeewwwwAAAArrrrccccssss
  543.  
  544.                If TRUE, arcs are drawn in the overview window. If
  545.                FALSE, only nodes are drawn.
  546.  
  547.  
  548.           XXXXmmmmNNNNsssskkkkeeeewwwwOOOOvvvveeeerrrrvvvviiiieeeewwwwSSSSccccaaaalllleeee
  549.  
  550.                If TRUE, the overview will be scaled to fill the
  551.                overview in both directions. If FALSE, the overview
  552.                will maintain the true proportion of the graph.
  553.  
  554.  
  555.           XXXXmmmmNNNNsssshhhhoooowwwwCCCCrrrroooossssssssiiiinnnnggggAAAArrrrccccssss
  556.  
  557.                If TRUE, display all arcs in the graph even if neither
  558.                connecting node is visible. If FALSE, the graph prunes
  559.                away arcs that simply cross the screen. The result is a
  560.                cleaner looking and faster scrolling display, but at
  561.                the cost of some accuracy and some disconcerting
  562.                flutter as arcs come and go in some graphs.
  563.  
  564.  
  565.           XXXXmmmmNNNNaaaalllllllloooowwwwGGGGrrrraaaannnnddddCCCChhhhiiiillllddddIIIInnnnppppuuuutttt
  566.  
  567.                WHen in edit mode, the graph widget steals input from
  568.                all nodes. If a node is a complex graph hierarchy, it
  569.                may at times be desirable to have the graph grab events
  570.                from all children of the complex node, and at other
  571.                times to only grab events from the top-most widget in a
  572.                node, allowing children to receive input. If this
  573.                resource is TRUE, children of direct children of the
  574.                graph will handle their own events.  Otherwise, the
  575.                graph grabs all input. The default value is TRUE.
  576.  
  577.  
  578.         IIIInnnnhhhheeeerrrriiiitttteeeedddd RRRReeeessssoooouuuurrrrcccceeeessss
  579.           SgGraph inherits behavior and resources from the following
  580.           superclasses.  For a complete description of these
  581.           resources, refer to the man page for that superclass.
  582.                              XXXXmmmmMMMMaaaannnnaaaaggggeeeerrrr RRRReeeessssoooouuuurrrrcccceeee SSSSeeeetttt
  583.       NNNNaaaammmmeeee              CCCCllllaaaassssssss           TTTTyyyyppppeeee             DDDDeeeeffffaaaauuuulllltttt    AAAAcccccccceeeessssssss
  584.       ____________________________________________________________________
  585.       XmNforeground     XmCForeground   Pixel            dynamic    CSG
  586.  
  587.  
  588.  
  589.  
  590.  
  591.      Page 9                                          (printed 10/3/02)
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  599.  
  600.  
  601.  
  602.       XmNhelpCallback   XmCCallback     XtCallbackList   NULL       C
  603.       XmNunitType       XmCUnitType     unsigned char    XmPIXELS   CSG
  604.       XmNuserData       XmCUserData     caddr_t NULL     CSG
  605.  
  606.                                           CCCCoooorrrreeee RRRReeeessssoooouuuurrrrcccceeee SSSSeeeetttt
  607.              NNNNaaaammmmeeee                  CCCCllllaaaassssssss                TTTTyyyyppppeeee              DDDDeeeeffffaaaauuuulllltttt          AAAAcccccccceeeessssssss
  608.      ____________________________________________________________________________________________
  609.      XmNaccelerators        XmCAccelerators        XtTranslations   NULL                   CSG
  610.      XmNancestorSensitive   XmCSensitive           Boolean          True                   G
  611.      XmNbackground          XmCBackground          Pixel            dynamic                CSG
  612.      XmNbackgroundPixmap    XmCPixmap              Pixmap           XmUNSPECIFIED_PIXMAP   CSG
  613.      XmNborderColor         XmCBorderColor         Pixel            Black                  CSG
  614.      XmNborderPixmap        XmCPixmap              Pixmap           XmUNSPECIFIED_PIXMAP   CSG
  615.      XmNborderWidth         XmCBorderWidth         Dimension        0                      CSG
  616.      XmNcolormap            XmCColormap            Colormap         XtCopyFromParent       CG
  617.      XmNdepth               XmCDepth               int              XtCopyFromParent       CG
  618.      XmNdestroyCallback     XmCCallback            XtCallbackList   NULL                   C
  619.      XmNheight              XmCHeight              Dimension        0                      CSG
  620.      XmNmappedWhenManaged   XmCMappedWhenManaged   Boolean          True                   CSG
  621.      XmNscreen              XmCScreen              Pointer          XtCopyScreen           CG
  622.      XmNsensitive           XmCSensitive           Boolean          True                   CSG
  623.      XmNtranslations        XmCTranslations        XtTranslations   NULL                   CSG
  624.      XmNarcWidth            XmCArcWidth            Int              0                      CSG
  625.      XmNx                   XmCPosition            Position         0                      CSG
  626.      XmNy                   XmCPosition            Position         0                      CSG
  627.  
  628.  
  629.         CCCCaaaallllllllbbbbaaaacccckkkk IIIInnnnffffoooorrrrmmmmaaaattttiiiioooonnnn
  630.           The following structure is returned with each callback.
  631.  
  632.           ttttyyyyppppeeeeddddeeeeffff ssssttttrrrruuuucccctttt {
  633.               iiiinnnntttt          _r_e_a_s_o_n;
  634.               XXXXEEEEvvvveeeennnntttt       *_e_v_e_n_t;
  635.               BBBBoooooooolllleeeeaaaannnn      _i_n_t_e_r_a_c_t_i_v_e;
  636.               WWWWiiiiddddggggeeeettttLLLLiiiisssstttt   _s_e_l_e_c_t_e_d__w_i_d_g_e_t_s;
  637.                iiiinnnntttt         _n_u_m__s_e_l_e_c_t_e_d__w_i_d_g_e_t_s;
  638.               WWWWiiiiddddggggeeeettttLLLLiiiisssstttt   _s_e_l_e_c_t_e_d__a_r_c_s;
  639.               iiiinnnntttt          _n_u_m__s_e_l_e_c_t_e_d__a_r_c_s
  640.               WWWWiiiiddddggggeeeetttt       _w_i_d_g_e_t;
  641.               WWWWiiiiddddggggeeeetttt       _o_l_d__t_o, _o_l_d__f_r_o_m, _n_e_w__t_o, _n_e_w__f_r_o_m;
  642.               BBBBoooooooolllleeeeaaaannnn      _d_o_i_t;
  643.           } SSSSggggGGGGrrrraaaapppphhhhCCCCaaaallllllllbbbbaaaacccckkkkSSSSttttrrrruuuucccctttt;
  644.  
  645.  
  646.           _r_e_a_s_o_n Indicates why the callback was invoked. Possible
  647.                  reasons are:
  648.  
  649.                  XmCR_NEW_ARC: A new arc has been created.
  650.                  XmCR_NEW_NODE: A new arc has been created.
  651.                  XmCR_NODE_MOVED: One node has been moved.
  652.                  XmCR_NODES_MOVED: Multiple nodes have been moved.
  653.                  XmCR_ARC_MOVED: An arc has been moved. This implies
  654.  
  655.  
  656.  
  657.      Page 10                                         (printed 10/3/02)
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  665.  
  666.  
  667.  
  668.                  the arc has changed the nodes it points to, not a
  669.                  physical change in the location of the arcs. This
  670.                  would be indicated by a XmNnodeMovedCallback.
  671.                  XmCR_SELECT_NODE: A node has been selected.
  672.                  XmCR_SELECT_NODES: Multiple nodes have been selected.
  673.                  XmCR_SELECT_ARC: An arc has been selected.
  674.                  XmCR_SELECT_ARCS: Multiple nodes have been selected.
  675.                  XmCR_SELECT_ARCS_AND_NODES: Multiple nodes and arcs
  676.                  have been selected.
  677.                  XmCR_SELECT_SUBGRAPH: A subgraph has been selected.
  678.                  XmCR_NODE_DOUBLE_CLICK: A double click on a node.
  679.                  XmCR_ARC_DOUBLE_CLICK: A double click on an Arc
  680.                  widget.
  681.                  XmCR_DOUBLE_CLICK:  A double click not over a node or
  682.                  arc has occurred.
  683.                  XmCR_DESELECT_ARC:      One or more arcs has been
  684.                  deselected.
  685.                  XmCR_DESELECT_NODE:      One or more  nodes has been
  686.                  deselected.
  687.                  XmCR_OVERVIEW_MARK_CHANGED: The mark resource color
  688.                  on a node has changed. This information is reported
  689.                  by the XmNgraphChangedCallback, which is used
  690.                  primarily by the graph widget overview window.
  691.                  XmCR_SIZE_CHANGED: The size of the graph (i.e. the
  692.                  width or height of a rectangle enclosing all nodes
  693.                  and arcs) has changed. This information is reported
  694.                  by the XmNgraphChangedCallback, which is used
  695.                  primarily by the graph widget overview window.
  696.                  XmCR_LAYOUT_CHANGED: The layout of the nodes in the
  697.                  graph has changed.  This information is reported by
  698.                  the XmNgraphChangedCallback, which is used primarily
  699.                  by the graph widget overview window.
  700.                  XmCR_GRAPH_SCROLLED: The graph has been scrolled.
  701.                  This information is reported by the
  702.                  XmNgraphChangedCallback, which is used primarily by
  703.                  the graph widget overview window.
  704.                  XmCR_BUTTON_OVER_GADGET: The user has pressed the
  705.                  mouse "user" button over a gadget used as a graph
  706.                  node while in edit mode. This value is used by the
  707.                  XmNuserButtonCallback callback, which is meant to
  708.                  support popup menus.
  709.                  XmCR_BUTTON_OVER_WIDGET: The user has pressed the
  710.                  mouse "user" button over a widget used as a graph
  711.                  node while in edit mode. This value is used by the
  712.                  XmNuserButtonCallback callback, which is meant to
  713.                  support popup.
  714.                  XmCR_BUTTON_OVER_GRAPH: The user has pressed the
  715.                  mouse "user button" over the gadget window. This
  716.                  value is used by the XmNuserButtonCallback callback,
  717.                  which is meant to support popup
  718.  
  719.           _e_v_e_n_t  Points to the XXXXEEEEvvvveeeennnntttt that triggered the callback.
  720.  
  721.  
  722.  
  723.      Page 11                                         (printed 10/3/02)
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  731.  
  732.  
  733.  
  734.           _w_i_d_g_e_t Indicates the current arc or node widget associated
  735.                  with this callback.
  736.  
  737.           _i_n_t_e_r_a_c_t_i_v_e
  738.                  TRUE if the callback was invoked as a result of a
  739.                  user action. In the current Graph, this is always
  740.                  TRUE. This field will probably dissapear soon. At
  741.                  this point, all relevant callbacks are interactive.
  742.  
  743.           _s_e_l_e_c_t_e_d__w_i_d_g_e_t_s
  744.                  Always indicates the list of currently selected nodes
  745.                  in an array containing num_selected_widgets.  This
  746.                  list belongs the the Graph and MUST be treated as
  747.                  READ-ONLY.
  748.  
  749.           _n_u_m__s_e_l_e_c_t_e_d__w_i_d_g_e_t_s
  750.                  The number of selected node widgets.
  751.  
  752.           _s_e_l_e_c_t_e_d__a_r_c_s
  753.                  Always indicates the list of currently selected arcs,
  754.                  in an array containing num_selected_arcs.  This list
  755.                  belongs the the Graph and MUST be treated as READ-
  756.                  ONLY.
  757.  
  758.           _n_u_m__s_e_l_e_c_t_e_d__a_r_c_s
  759.                  The number of selected arc widgets.
  760.  
  761.           _o_l_d__t_o, _o_l_d__f_r_o_m, _n_e_w__t_o, _n_e_w__f_r_o_m
  762.                  If an arc has been moved, the nodes the arc formerly
  763.                  connected, and the nodes the arc will now connect.
  764.                  Only valid for XmNarcEditedCallback and
  765.                  XmNarcMovedCallback.
  766.  
  767.           _d_o_i_t   This member is initialized to TRUE. If the
  768.                  application wishes to terminate or disallow certain
  769.                  operations, this field can be set to FALSE before the
  770.                  callback returns. An example of how this might be
  771.                  used is if the application wishes to create a
  772.                  different type of node widget than the default. If
  773.                  this member is set to FALSE in an XmNnewNodeCallback,
  774.                  the Graph widget will destroy the node widget it has
  775.                  created. The application can them create a new node
  776.                  at the position of the interactively created widget.
  777.                  Only used with XmNarcEditedCallback,
  778.                  XmNarcMovedCallback, XmNnewNodeCallback, and
  779.                  XmNnewArcCallback lists.
  780.  
  781.  
  782.           LLLLaaaayyyyoooouuuutttt AAAAllllggggoooorrrriiiitttthhhhmmmm
  783.                  The current Graph layout algorithm is a simple and
  784.                  efficient tree layout algorithm adapted to handle
  785.                  forests of nodes. It works as follows: It first
  786.  
  787.  
  788.  
  789.      Page 12                                         (printed 10/3/02)
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  797.  
  798.  
  799.  
  800.                  compiles a list of "roots" by looking for, in order,:
  801.                  (1) a unique node of each subgraph selected by the
  802.                  user via the _S_g_G_r_a_p_h_I_n_s_e_r_t_R_o_o_t_s function, (2) any
  803.                  node without a parent, (3) of those ssssttttrrrroooonnnnggggllllyyyy
  804.                  ccccoooonnnnnnnneeeecccctttteeeedddd components of the graph (a strongly
  805.                  connected component is a subgraph in which any node
  806.                  can reach all other nodes) which cannot be reached by
  807.                  a root chosen previously, a node is chosen at random.
  808.                  The algorithm then traverses the subgraphs rooted at
  809.                  each node in the "roots" list, converting each in
  810.                  turn into a tree. If a node belongs to more than one
  811.                  of these subgraphs, it will be placed in the tree
  812.                  where its deepest parent belongs.  The algorithm then
  813.                  performs the actual layout, and finally reconverts
  814.                  the subtrees back to the original graph.  The nodes
  815.                  in the "roots" list will be laid out, at the same
  816.                  level, as the topmost (vertical layout) or rightmost
  817.                  (horizontal layout) widgets in their respective
  818.                  subgraph, while the rest of the nodes will be placed
  819.                  under (to the right of) them. If any of the subgraphs
  820.                  have cycles the layout algorithm will arbitrarily
  821.                  "break" them for layout purposes only.
  822.  
  823.  
  824.  
  825.         BBBBeeeehhhhaaaavvvviiiioooorrrr
  826.           SgGraph behavior is summarized below.
  827.  
  828.                None <Btn1Down>:         Indicate() Arm()
  829.                Ctrl <Btn1Down>:        AddIndicate()
  830.                Shift <Btn1Down>:         IndicateSubtree()
  831.                None <Btn2Down>:         SelectForMotion()
  832.                Shift<Btn2Down>:          StartAddNode()
  833.                None <Btn1Up>:           EndButtonAction() Activate()
  834.                Ctrl <Btn1Up>:          EndButtonAction()
  835.                Shift <Btn1Up>:           EndButtonAction()
  836.                None <Btn2Up>:           EndButtonAction()
  837.                Shift <Btn2Up>:          EndButtonAction()
  838.                Ctrl <Btn2Up>:           EndButtonAction()
  839.                <Btn1Motion>:            HandleMotion()
  840.                EnterLeaveMotion()
  841.                <Btn2Motion>:            HandleMotion()
  842.                <EnterWindow>:         Enter()
  843.                <FocusIn>:          FocusIn()
  844.                <FocusOut>:         FocusOut()
  845.                <Key>F1:            Help()
  846.  
  847.  
  848.      AAAACCCCTTTTIIIIOOOONNNNSSSS
  849.           IIIInnnnddddiiiiccccaaaatttteeee:::: If in edit mode, and the mouse is on a node widget
  850.           or over an arc, it highlights that node or arc and begins a
  851.           selection process. If the mouse is not over a node it also
  852.  
  853.  
  854.  
  855.      Page 13                                         (printed 10/3/02)
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  863.  
  864.  
  865.  
  866.           begins a rubberbanding selection process. See HandleMotion()
  867.           and EndButtonAction().
  868.  
  869.           AAAAddddddddIIIInnnnddddiiiiccccaaaatttteeee:::: If in edit mode, and the mouse is on a node
  870.           widget or over an arc, it highlights that node or arc and
  871.           begins a selection process without deselecting already
  872.           selected arcs or nodes. See HandleMotion() and
  873.           EndButtonAction().
  874.  
  875.           IIIInnnnddddiiiiccccaaaatttteeeeSSSSuuuubbbbttttrrrreeeeeeee:::: If in edit mode, and the mouse is on a node
  876.           widget, it highlights the subtree whose root is that node
  877.           and begins a selection process.  See HandleMotion() and
  878.           EndButtonAction().
  879.  
  880.           SSSSttttaaaarrrrttttAAAAddddddddAAAArrrrccccOOOOrrrrNNNNooooddddeeee:::: If in edit mode, and the sprite is not
  881.           over any existing node, displays a rubberband box to prompt
  882.           the user to position a new node widget. If over a node,
  883.           prompts the user with a rubberband line to position the
  884.           other end of a new arc.
  885.  
  886.           HHHHaaaannnnddddlllleeeeMMMMoooottttiiiioooonnnn(((()))):::: Handles all mouse motion depending on a
  887.           state variable set by the button down action. Conceptually,
  888.           this action can be one of:
  889.             CCCCaaaannnncccceeeellll(((()))): If in edit mode, moving out of the indicated
  890.             widget unhighlights the indicated widget. However, moving
  891.             back into the widget without releasing the mouse button,
  892.             re-highlights the indicated widget.  Thus a selection can
  893.             be terminated by moving out of the widget before releasing
  894.             the mouse button.
  895.  
  896.             CCCCaaaannnncccceeeellllSSSSuuuubbbbttttrrrreeeeeeee(((()))): If in edit mode, moving out of the
  897.             indicated widget unhighlights the indicated subtree.
  898.             However, moving back into the widget without releasing the
  899.             mouse button, re-highlights the indicated subtree.  Thus a
  900.             selection can be terminated by moving out of the widget
  901.             before releasing the mouse button.
  902.  
  903.             MMMMoooottttiiiioooonnnn:::: Moves a node or arc to a new position.
  904.  
  905.           EEEEnnnnddddBBBBuuuuttttttttoooonnnnAAAAccccttttiiiioooonnnn(((()))):::: Handles all mouse button up events
  906.           depending on a state variable set by the button down action.
  907.           Conceptually, this action can be one of:
  908.  
  909.             SSSSeeeelllleeeecccctttt:::: If in edit mode and the mouse is on a node or arc
  910.             widget The node is persistantly highlighted and added to
  911.             the list of selected widgets, after unhighlighting any
  912.             previously selected widgets and removing them from the
  913.             list. The XmNselectNodeCallback or XmNSelecttArcCallback
  914.             are invoked.
  915.  
  916.             AAAAddddddddSSSSeeeelllleeeecccctttt:::: If in edit mode and the mouse is on a node or
  917.             arc widget, the node is persistantly highlighted and added
  918.  
  919.  
  920.  
  921.      Page 14                                         (printed 10/3/02)
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  929.  
  930.  
  931.  
  932.             to the list of selected widgets. Previously selected
  933.             widgets remain selected.  The XmNselectNodeCallback or
  934.             XmNSelecttArcCallback are invoked, with the newly selected
  935.             widget indicated by the _w_i_d_g_e_t member of the calldata, and
  936.             the entire set of selected widgets indicated by the
  937.             selected_widgets and selected_arcs members.
  938.  
  939.             SSSSeeeelllleeeeccccttttTTTTrrrreeeeeeee:::: If in edit mode and the mouse is on a node,
  940.             the subtree whose root is that node is persistantly
  941.             highlighted and added to the list of selected widgets,
  942.             after unhighlighting any previously selected widgets and
  943.             removing them from the list. The XmNselectNodeCallback or
  944.             XmNSelecttArcCallback are invoked.
  945.  
  946.             EEEEnnnnddddAAAAddddddddAAAArrrrccccOOOOrrrrNNNNooooddddeeee:::: If a new node is being created, calls the
  947.             XmNnewNodeCallback list. If the value of the _d_o_i_t member
  948.             of the calldata parameter is not FALSE when the callback
  949.             returns, a new node is created.  If a new arc is being
  950.             created, the XmNnewArcCallback callback list is invoked.
  951.             If the value of the _d_o_i_t member of the calldata parameter
  952.             is not FALSE when the callback returns, a new arc is
  953.             created.
  954.  
  955.             EEEEnnnnddddMMMMoooottttiiiioooonnnn: Ends the movement of an arc or node.  Nodes are
  956.             simply moved physically, and the XmNnodeMovedCallback is
  957.             invoked.  If the sprite is not over a valid node when this
  958.             procedure is called, the move is terminated.  If an arc is
  959.             moved, the XmNarcEditedCallback is invoked on the arc, and
  960.             the XmNarcMovedCallback is invoked on the graph widget,
  961.             with the arc as the _w_i_d_g_e_t member.  The _o_l_d__t_o and
  962.             _o_l_d__f_r_o_m members of the calldata indicate the original
  963.             nodes to which the arc was connected, while the _n_e_w__t_o and
  964.             _n_e_w__f_r_o_m indicate the nodes to which the user has
  965.             indicated the arc should be connected.  If the _d_o_i_t member
  966.             of the calldata is not set to FALSE when either callback
  967.             returns, the arc is actually moved.
  968.  
  969.  
  970.  
  971.      EEEEDDDDIIIITTTT MMMMOOOODDDDEEEE
  972.           The translations discussed above are only valid while in
  973.           edit mode, that is when XmNeditable is TRUE. While not in
  974.           edit mode, the graph widget acts as a layout manager only,
  975.           and passes all events on to its children without
  976.           interference.
  977.  
  978.  
  979.      UUUUTTTTIIIILLLLIIIITTTTYYYY FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
  980.           Widget SSSSggggCCCCrrrreeeeaaaatttteeeeGGGGrrrraaaapppphhhh (_p_a_r_e_n_t, _n_a_m_e, _a_r_g_l_i_s_t, _a_r_g_c_o_u_n_t)
  981.             Widget    _p_a_r_e_n_t;
  982.             char      *_n_a_m_e;
  983.             ArgList   _a_r_g_l_i_s_t;
  984.  
  985.  
  986.  
  987.      Page 15                                         (printed 10/3/02)
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  995.  
  996.  
  997.  
  998.             Cardinal  _a_r_g_c_o_u_n_t;
  999.  
  1000.  
  1001.           SSSSggggCCCCrrrreeeeaaaatttteeeeGGGGrrrraaaapppphhhh creates an unmanaged instance of a Graph
  1002.           widget and returns the associated widget ID.
  1003.  
  1004.  
  1005.           Widget SSSSggggCCCCrrrreeeeaaaatttteeeeMMMMaaaannnnaaaaggggeeeeddddGGGGrrrraaaapppphhhh (_p_a_r_e_n_t, _n_a_m_e, _a_r_g_l_i_s_t,
  1006.           _a_r_g_c_o_u_n_t)
  1007.             Widget    _p_a_r_e_n_t;
  1008.             char      *_n_a_m_e;
  1009.             ArgList   _a_r_g_l_i_s_t;
  1010.             Cardinal  _a_r_g_c_o_u_n_t;
  1011.  
  1012.  
  1013.  
  1014.           SSSSggggCCCCrrrreeeeaaaatttteeeeMMMMaaaannnnaaaaggggeeeeddddGGGGrrrraaaapppphhhh creates a managed instance of a Graph
  1015.           widget and returns the associated widget ID.
  1016.  
  1017.           Widget SSSSggggCCCCrrrreeeeaaaatttteeeeSSSSccccrrrroooolllllllleeeeddddGGGGrrrraaaapppphhhh (_p_a_r_e_n_t, _n_a_m_e, _a_r_g_l_i_s_t,
  1018.           _a_r_g_c_o_u_n_t)
  1019.             Widget    _p_a_r_e_n_t;
  1020.             char      *_n_a_m_e;
  1021.             ArgList   _a_r_g_l_i_s_t;
  1022.             Cardinal  _a_r_g_c_o_u_n_t;
  1023.  
  1024.           SSSSggggCCCCrrrreeeeaaaatttteeeeSSSSccccrrrroooolllllllleeeeddddGGGGrrrraaaapppphhhh creates an instance of a Graph widget
  1025.           as a child of an XmScrolledWindow widget and returns the
  1026.           widget ID of the Graph widget. Notice that this function
  1027.           uses the AUTOMATIC scrollbar mode of the XmScrolledWindow
  1028.           widget. This creates a ScrolledWindowClipWindow widget,
  1029.           which becomes the parent of the SgGraph widget. So the
  1030.           widget hierarchy of an SgGraph widget named "graph" created
  1031.           with SgCreateScrolledGraph() becomes "graphSW-
  1032.           >ScrolledWindowClipWindow->graph". Programmers who do not
  1033.           want these settings for the ScrolledWindow widget can create
  1034.           their own instead of using the convenience function.
  1035.           However, the Graph widget does extensive optimizations based
  1036.           on the existence of the ScrolledWindow's clipWindow.
  1037.           Changing the way in which the ScrolledWindow is configured
  1038.           will eliminate these optimizations.
  1039.  
  1040.  
  1041.           WWWWiiiiddddggggeeeettttLLLLiiiisssstttt SSSSggggGGGGrrrraaaapppphhhhGGGGeeeettttAAAArrrrccccssssBBBBeeeettttwwwweeeeeeeennnnNNNNooooddddeeeessss (_g_r_a_p_h, _f_r_o_m, _t_o,
  1042.           _n_u_m_A_r_c_s)
  1043.               SgGraphWidget  _g_r_a_p_h;
  1044.               Widget          _f_r_o_m;
  1045.               Widget          _t_o;
  1046.               int*            _n_u_m_A_r_c_s;
  1047.  
  1048.  
  1049.           SSSSggggGGGGrrrraaaapppphhhhGGGGeeeettttAAAArrrrccccssssBBBBeeeettttwwwweeeeeeeennnnNNNNooooddddeeeessss returns a list of all SgArc
  1050.  
  1051.  
  1052.  
  1053.      Page 16                                         (printed 10/3/02)
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  1061.  
  1062.  
  1063.  
  1064.           widgets that extend from _f_r_o_m to _t_o. If no such arc exists,
  1065.           returns NULL.  This list must be treated as read-only.
  1066.  
  1067.  
  1068.           Boolean SSSSggggGGGGrrrraaaapppphhhhRRRReeeemmmmoooovvvveeeeAAAArrrrccccBBBBeeeettttwwwweeeeeeeennnnNNNNooooddddeeeessss (_g_r_a_p_h, _w_i_d_g_e_t_1,
  1069.           _w_i_d_g_e_t_2)
  1070.             SgGraphWidget  _g_r_a_p_h;
  1071.             Widget       _w_i_d_g_e_t_1;
  1072.             Widget       _w_i_d_g_e_t_2;
  1073.  
  1074.           SSSSggggGGGGrrrraaaapppphhhhRRRReeeemmmmoooovvvveeeeAAAArrrrccccBBBBeeeettttwwwweeeeeeeennnnNNNNooooddddeeeessss destroys all arcs between
  1075.           _w_i_d_g_e_t_1, and _w_i_d_g_e_t_2 which must be node widgets in _g_r_a_p_h.
  1076.           Returns True if successful, False otherwise.
  1077.  
  1078.  
  1079.           Boolean SSSSggggGGGGrrrraaaapppphhhhMMMMoooovvvveeeeAAAArrrrcccc (_g_r_a_p_h, _a_r_c, _f_r_o_m, _t_o)
  1080.             SgGraphWidget  _g_r_a_p_h;
  1081.             ArcWidget       _a_r_c;
  1082.             Widget         _f_r_o_m, _t_o;
  1083.  
  1084.           XXXXmmmmMMMMoooovvvveeeeAAAArrrrcccc changes the end nodes of _a_r_c from the current
  1085.           nodes to the given from and to nodes. Returns True if
  1086.           successful, False otherwise.
  1087.  
  1088.           void SSSSggggGGGGrrrraaaapppphhhhNNNNuuuummmmNNNNooooddddeeeeAAAArrrrccccssss (_g_r_a_p_h, _n_o_d_e, _n__f_r_o_m, _n__t_o)
  1089.             SgGraphWidget   _g_r_a_p_h;
  1090.             Widget           _n_o_d_e;
  1091.             int              *_n__f_r_o_m, *_n__t_o;
  1092.  
  1093.           SSSSggggGGGGrrrraaaapppphhhhNNNNuuuummmmNNNNooooddddeeeeAAAArrrrccccssss assigns to _n__f_r_o_m and _n__t_o the number of
  1094.           arcs associated with _n_o_d_e. _n_o_d_e must be a node widget in
  1095.           _g_r_a_p_h.
  1096.  
  1097.           void SSSSggggGGGGrrrraaaapppphhhhGGGGeeeettttNNNNooooddddeeeeAAAArrrrccccssss (_g_r_a_p_h, _n_o_d_e, _f_r_o_m, _t_o, _n__f_r_o_m,
  1098.           _n__t_o)
  1099.             SgGraphWidget  _g_r_a_p_h;
  1100.             Widget          _n_o_d_e;
  1101.             WidgetList       *_f_r_o_m, *_t_o;
  1102.             int              *_n__f_r_o_m, *_n__t_o;
  1103.  
  1104.           SSSSggggGGGGrrrraaaapppphhhhGGGGeeeettttNNNNooooddddeeeeAAAArrrrccccssss will put in the _f_r_o_m and _t_o WidgetLists
  1105.           the arcs associated with the given node widget. _f_r_o_m and _t_o
  1106.           must be treated as read-only.  _n__f_r_o_m and _n__t_o return the
  1107.           number of arcs. _n_o_d_e must be a node widget in _g_r_a_p_h.
  1108.  
  1109.           void SSSSggggGGGGrrrraaaapppphhhhGGGGeeeettttAAAArrrrccccNNNNooooddddeeeessss (_g_r_a_p_h, _a_r_c, _f_r_o_m, _t_o)
  1110.             SgGraphWidget  _g_r_a_p_h;
  1111.             ArcWidget       _a_r_c;
  1112.             Widget          *_f_r_o_m, *_t_o;
  1113.  
  1114.           SSSSggggGGGGrrrraaaapppphhhhGGGGeeeettttAAAArrrrccccNNNNooooddddeeeessss will store in the _f_r_o_m and _t_o widgets the
  1115.           nodes associated with _a_r_c.
  1116.  
  1117.  
  1118.  
  1119.      Page 17                                         (printed 10/3/02)
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  1127.  
  1128.  
  1129.  
  1130.           void SSSSggggGGGGrrrraaaapppphhhhSSSSeeeelllleeeeccccttttAAAArrrrccccssss (_g_r_a_p_h, _a_r_c_s, _n__a_r_c_s, _n_o_t_i_f_y)
  1131.             SgGraphWidget  _g_r_a_p_h;
  1132.             WidgetList       _a_r_c_s;
  1133.             int              _n__a_r_c_s;
  1134.             Boolean         _n_o_t_i_f_y;
  1135.  
  1136.           SSSSggggGGGGrrrraaaapppphhhhSSSSeeeelllleeeeccccttttAAAArrrrccccssss adds to the selected_arcs list of _g_r_a_p_h
  1137.           the first _n__a_r_c_s in the WidgetList _a_r_c_s. If _n_o_t_i_f_y is true,
  1138.           the XmNselectArcCallback list is invoked.
  1139.  
  1140.           void SSSSggggGGGGrrrraaaapppphhhhSSSSeeeelllleeeeccccttttAAAArrrrcccc (_g_r_a_p_h, _a_r_c, _n_o_t_i_f_y)
  1141.             SgGraphWidget  _g_r_a_p_h;
  1142.             Widget       _a_r_c;
  1143.             Boolean         _n_o_t_i_f_y;
  1144.  
  1145.           SSSSggggGGGGrrrraaaapppphhhhSSSSeeeelllleeeeccccttttAAAArrrrcccc adds to the selected_arcs list of _g_r_a_p_h the
  1146.           given _a_r_c. _a_r_c must be a child of _g_r_a_p_h. If _n_o_t_i_f_y is true,
  1147.           the XmNselectArcCallback list is invoked.
  1148.  
  1149.           void SSSSggggGGGGrrrraaaapppphhhhUUUUnnnnsssseeeelllleeeeccccttttAAAArrrrccccssss (_g_r_a_p_h, _a_r_c_s, _n__a_r_c_s, _n_o_t_i_f_y)
  1150.             SgGraphWidget  _g_r_a_p_h;
  1151.             WidgetList       _a_r_c_s;
  1152.             int              _n__a_r_c_s;
  1153.             Boolean         _n_o_t_i_f_y;
  1154.  
  1155.           SSSSggggGGGGrrrraaaapppphhhhUUUUnnnnsssseeeelllleeeeccccttttAAAArrrrccccssss removes from the selected_arcs list of
  1156.           _g_r_a_p_h the first _n__a_r_c_s in the WidgetList _a_r_c_s. If _n_o_t_i_f_y is
  1157.           true, the XmNdeselectCallback list is invoked.
  1158.  
  1159.           void SSSSggggGGGGrrrraaaapppphhhhUUUUnnnnsssseeeelllleeeeccccttttAAAArrrrcccc (_g_r_a_p_h, _a_r_c, _n_o_t_i_f_y)
  1160.             SgGraphWidget  _g_r_a_p_h;
  1161.             Widget      _a_r_c;
  1162.             Boolean         _n_o_t_i_f_y;
  1163.  
  1164.           SSSSggggGGGGrrrraaaapppphhhhUUUUnnnnsssseeeelllleeeeccccttttAAAArrrrcccc removes _a_r_c from the selected_arcs list
  1165.           of _g_r_a_p_h. If _n_o_t_i_f_y is true, the XmNdeselectCallback list is
  1166.           invoked.
  1167.  
  1168.           int SSSSggggGGGGrrrraaaapppphhhhNNNNuuuummmmSSSSeeeelllleeeecccctttteeeeddddAAAArrrrccccssss (_g_r_a_p_h)
  1169.             SgGraphWidget  _g_r_a_p_h;
  1170.  
  1171.           SSSSggggGGGGrrrraaaapppphhhhNNNNuuuummmmSSSSeeeelllleeeecccctttteeeeddddAAAArrrrccccssss returns the number of arcs in the
  1172.           selected_arcs list of _g_r_a_p_h.
  1173.  
  1174.           WidgetList SSSSggggGGGGrrrraaaapppphhhhGGGGeeeettttSSSSeeeelllleeeecccctttteeeeddddAAAArrrrccccssss (_g_r_a_p_h, _a_r_c_s, _n__a_r_c_s)
  1175.             SgGraphWidget  _g_r_a_p_h;
  1176.             int            *_n__a_r_c_s;
  1177.  
  1178.           SSSSggggGGGGrrrraaaapppphhhhGGGGeeeettttSSSSeeeelllleeeecccctttteeeeddddAAAArrrrccccssss will return a WidgetList _a_r_c_s
  1179.           containing all currently selected arcs. This list must be
  1180.           treated as read-only.
  1181.  
  1182.  
  1183.  
  1184.  
  1185.      Page 18                                         (printed 10/3/02)
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  1193.  
  1194.  
  1195.  
  1196.           Boolean SSSSggggGGGGrrrraaaapppphhhhIIIIssssSSSSeeeelllleeeecccctttteeeeddddAAAArrrrcccc (_g_r_a_p_h, _a_r_c)
  1197.             SgGraphWidget  _g_r_a_p_h;
  1198.             Widget       _a_r_c;
  1199.  
  1200.           SSSSggggGGGGrrrraaaapppphhhhIIIIssssSSSSeeeelllleeeecccctttteeeeddddAAAArrrrcccc returns TRUE of the given _a_r_c is
  1201.           currently selected.
  1202.  
  1203.           int SSSSggggGGGGrrrraaaapppphhhhNNNNuuuummmmAAAArrrrccccssss (_g_r_a_p_h)
  1204.             SgGraphWidget   _g_r_a_p_h;
  1205.  
  1206.           SSSSggggGGGGrrrraaaapppphhhhNNNNuuuummmmAAAArrrrccccssss returns the number of arc widgets in _g_r_a_p_h.
  1207.  
  1208.           WidgetList XXXXmmmmGGGGeeeettttGGGGrrrraaaapppphhhhAAAArrrrccccssss (_g_r_a_p_h, _a_r_c_s, _n_u_m__a_r_c_s)
  1209.             SgGraphWidget  _g_r_a_p_h;
  1210.             int       *_n_u_m__a_r_c_s;
  1211.  
  1212.           SSSSggggGGGGrrrraaaapppphhhhGGGGeeeettttAAAArrrrccccssss will return a WidgetList containing all arc
  1213.           widgets in _g_r_a_p_h. This list must be treated as read-only.
  1214.  
  1215.           WidgetList XXXXmmmmGGGGeeeettttGGGGrrrraaaapppphhhhNNNNooooddddeeeessss (_g_r_a_p_h, _a_r_c_s, _n_u_m__n_o_d_e_s)
  1216.             SgGraphWidget  _g_r_a_p_h;
  1217.             int       *_n_u_m__n_o_d_e_s;
  1218.  
  1219.           XXXXmmmmGGGGeeeettttGGGGrrrraaaapppphhhhNNNNooooddddeeeessss will return a WidgetList containing all node
  1220.           widgets in _g_r_a_p_h. This list must be treated as read-only.
  1221.  
  1222.           int SSSSggggGGGGrrrraaaapppphhhhNNNNuuuummmmSSSSeeeelllleeeecccctttteeeeddddNNNNooooddddeeeessss (_g_r_a_p_h)
  1223.             SgGraphWidget  _g_r_a_p_h;
  1224.  
  1225.           SSSSggggGGGGrrrraaaapppphhhhNNNNuuuummmmSSSSeeeelllleeeecccctttteeeeddddNNNNooooddddeeeessss returns the number of node widgets
  1226.           in the selected_nodes list of _g_r_a_p_h.
  1227.  
  1228.           Boolean SSSSggggGGGGrrrraaaapppphhhhMMMMoooovvvveeeeNNNNooooddddeeee (_g_r_a_p_h, _n_o_d_e, _x, _y)
  1229.             SgGraphWidget  _g_r_a_p_h;
  1230.             Widget          _n_o_d_e;
  1231.             Position         _x, _y;
  1232.  
  1233.           SSSSggggGGGGrrrraaaapppphhhhMMMMoooovvvveeeeNNNNooooddddeeee changes the position of _n_o_d_e to _x, and _y.
  1234.           _n_o_d_e must be a node widget in _g_r_a_p_h.  Returns True if
  1235.           successful, False otherwise.
  1236.  
  1237.           void SSSSggggGGGGrrrraaaapppphhhhGGGGeeeettttSSSSeeeelllleeeecccctttteeeeddddNNNNooooddddeeeessss (_g_r_a_p_h, _n_o_d_e_s, _n__n_o_d_e_s)
  1238.             SgGraphWidget  _g_r_a_p_h;
  1239.             WidgetList       _n_o_d_e_s;
  1240.             int            *_n__n_o_d_e_s;
  1241.  
  1242.           SSSSggggGGGGrrrraaaapppphhhhGGGGeeeettttSSSSeeeelllleeeecccctttteeeeddddNNNNooooddddeeeessss will return a WidgetList containing
  1243.           all node widgets in the selected_nodes list of _g_r_a_p_h. This
  1244.           list is owned by the widget instance and must be treated as
  1245.           read-only.  This list will be overwritten when
  1246.           SSSSggggGGGGrrrraaaapppphhhhGGGGeeeettttSSSSeeeelllleeeecccctttteeeeddddNNNNooooddddeeeessss or SSSSggggGGGGrrrraaaapppphhhhGGGGeeeettttRRRRoooooooottttssss are called.
  1247.  
  1248.  
  1249.  
  1250.  
  1251.      Page 19                                         (printed 10/3/02)
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  1259.  
  1260.  
  1261.  
  1262.           Widget SSSSggggGGGGrrrraaaapppphhhhIIIInnnnppppuuuuttttOOOOvvvveeeerrrrAAAArrrrcccc (_g_r_a_p_h, _x, _y)
  1263.             SgGraphWidget  _g_r_a_p_h;
  1264.             Position      _x, _y;
  1265.  
  1266.           SSSSggggGGGGrrrraaaapppphhhhIIIInnnnppppuuuuttttOOOOvvvveeeerrrrAAAArrrrcccc  returns an SgArc widget that contains
  1267.           the point (x, y). If no such arc exists, SSSSggggGGGGrrrraaaapppphhhhIIIInnnnppppuuuuttttOOOOvvvveeeerrrrAAAArrrrcccc
  1268.           returns NULL.
  1269.  
  1270.           void SSSSggggGGGGrrrraaaapppphhhhSSSSeeeelllleeeeccccttttNNNNooooddddeeeessss (_g_r_a_p_h, _n_o_d_e_s, _n__n_o_d_e_s, _n_o_t_i_f_y)
  1271.             SgGraphWidget  _g_r_a_p_h;
  1272.             WidgetList       _n_o_d_e_s;
  1273.             int              _n__n_o_d_e_s;
  1274.             Boolean         _n_o_t_i_f_y;;
  1275.  
  1276.           SSSSggggGGGGrrrraaaapppphhhhSSSSeeeelllleeeeccccttttNNNNooooddddeeeessss adds to the selected_nodes list of _g_r_a_p_h
  1277.           the first _n__n_o_d_e_s in the WidgetList _n_o_d_e_s. If _n_o_t_i_f_y is
  1278.           true, the XmNselectNodeCallback list is invoked.
  1279.  
  1280.           void SSSSggggGGGGrrrraaaapppphhhhSSSSeeeelllleeeeccccttttNNNNooooddddeeee (_g_r_a_p_h, _n_o_d_e, _n_o_t_i_f_y)
  1281.             SgGraphWidget  _g_r_a_p_h;
  1282.             Widget       _n_o_d_e;
  1283.             Boolean       _n_o_t_i_f_y;
  1284.  
  1285.           SSSSggggGGGGrrrraaaapppphhhhSSSSeeeelllleeeeccccttttNNNNooooddddeeee adds _n_o_d_e to the selected_nodes list of
  1286.           _g_r_a_p_h.  _n_o_d_e must be a child of _g_r_a_p_h. If _n_o_t_i_f_y is true,
  1287.           the XmNselectNodeCallback list is invoked.
  1288.  
  1289.           void SSSSggggGGGGrrrraaaapppphhhhDDDDeeeessssttttrrrrooooyyyySSSSeeeelllleeeecccctttteeeeddddAAAArrrrccccssssOOOOrrrrNNNNooooddddeeeessss (_g_r_a_p_h)
  1290.             SgGraphWidget  _g_r_a_p_h;
  1291.  
  1292.           SSSSggggGGGGrrrraaaapppphhhhDDDDeeeessssttttrrrrooooyyyySSSSeeeelllleeeecccctttteeeeddddAAAArrrrccccssssOOOOrrrrNNNNooooddddeeeessss calls XtDestroyWidget on
  1293.           all selected arcs or nodes.
  1294.  
  1295.           void SSSSggggGGGGrrrraaaapppphhhhDDDDeeeessssttttrrrrooooyyyyAAAAllllllllAAAArrrrccccssss (_g_r_a_p_h)
  1296.           SgGraphWidget  _g_r_a_p_h;
  1297.  
  1298.           SSSSggggGGGGrrrraaaapppphhhhDDDDeeeessssttttrrrrooooyyyyAAAAllllllllAAAArrrrccccssss calls XtDestroyWidget on all arcs.
  1299.  
  1300.           void SSSSggggGGGGrrrraaaapppphhhhDDDDeeeessssttttrrrrooooyyyyAAAAllllllllNNNNooooddddeeeessss (_g_r_a_p_h)
  1301.             SgGraphWidget  _g_r_a_p_h;
  1302.  
  1303.           SSSSggggGGGGrrrraaaapppphhhhDDDDeeeessssttttrrrrooooyyyyAAAAllllllllNNNNooooddddeeeessss calls XtDestroyWidget on all node
  1304.           widgets.
  1305.  
  1306.           void SSSSggggGGGGrrrraaaapppphhhhIIIIssssSSSSeeeelllleeeecccctttteeeeddddNNNNooooddddeeee (_g_r_a_p_h, _n_o_d_e)
  1307.             SgGraphWidget  _g_r_a_p_h;
  1308.             Widget      _n_o_d_e;
  1309.  
  1310.           SSSSggggGGGGrrrraaaapppphhhhIIIIssssSSSSeeeelllleeeecccctttteeeeddddNNNNooooddddeeee returns TRUE of the given _n_o_d_e is
  1311.           currently selected.
  1312.  
  1313.           void XXXXmmmmUUUUnnnnsssseeeelllleeeeccccttttNNNNooooddddeeeessss (_g_r_a_p_h, _n_o_d_e_s, _n__n_o_d_e_s, _n_o_t_i_f_y)
  1314.  
  1315.  
  1316.  
  1317.      Page 20                                         (printed 10/3/02)
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  1325.  
  1326.  
  1327.  
  1328.             SgGraphWidget  _g_r_a_p_h;
  1329.             WidgetList       _n_o_d_e_s;
  1330.             int              _n__n_o_d_e_s;
  1331.             Boolean          _n_o_t_i_f_y;
  1332.  
  1333.           SSSSggggGGGGrrrraaaapppphhhhUUUUnnnnsssseeeelllleeeeccccttttNNNNooooddddeeeessss removes from the selected_nodes list of
  1334.           _g_r_a_p_h the first _n__n_o_d_e_s in the WidgetList _n_o_d_e_s. If _n_o_t_i_f_y
  1335.           is true, the XmNdeselectCallback list is invoked.
  1336.  
  1337.           void SSSSggggGGGGrrrraaaapppphhhhUUUUnnnnsssseeeelllleeeeccccttttNNNNooooddddeeee (_g_r_a_p_h, _n_o_d_e, _n_o_t_i_f_y)
  1338.             SgGraphWidget  _g_r_a_p_h;
  1339.             Widget       _n_o_d_e;
  1340.             Boolean          _n_o_t_i_f_y;
  1341.  
  1342.  
  1343.           SSSSggggGGGGrrrraaaapppphhhhUUUUnnnnsssseeeelllleeeeccccttttNNNNooooddddeeee removes node from the selected_nodes
  1344.           list of _g_r_a_p_h. If _n_o_t_i_f_y is true, the XmNdeselectCallback
  1345.           list is invoked.
  1346.  
  1347.           void SSSSggggGGGGrrrraaaapppphhhhNNNNuuuummmmNNNNooooddddeeeessss (_g_r_a_p_h)
  1348.             SgGraphWidget   _g_r_a_p_h;
  1349.  
  1350.           SSSSggggGGGGrrrraaaapppphhhhNNNNuuuummmmNNNNooooddddeeeessss returns the number of node widgets in _g_r_a_p_h,
  1351.           not including the dummy node created by the graph.
  1352.  
  1353.           void SSSSggggGGGGrrrraaaapppphhhhGGGGeeeettttNNNNooooddddeeeessss (_g_r_a_p_h, _n_o_d_e_s)
  1354.             SgGraphWidget  _g_r_a_p_h;
  1355.             WidgetList       _n_o_d_e_s;
  1356.  
  1357.           SSSSggggGGGGrrrraaaapppphhhhGGGGeeeettttNNNNooooddddeeeessss will return a WidgetList containing all node
  1358.           widgets in _g_r_a_p_h.  This list is owned by the widget instance
  1359.           and must be treated as read-only.
  1360.  
  1361.  
  1362.           WidgetList SSSSggggGGGGrrrraaaapppphhhhGGGGeeeettttRRRRoooooooottttssss (_g_r_a_p_h, _n_u_m__n_o_d_e_s)
  1363.             SgGraphWidget  _g_r_a_p_h;
  1364.             int          *_n_u_m__n_o_d_e_s;
  1365.  
  1366.           SSSSggggGGGGrrrraaaapppphhhhGGGGeeeettttRRRRoooooooottttssss will return a WidgetList containing all
  1367.           widgets in the user_roots list of _g_r_a_p_h. This list is owned
  1368.           by the widget instance and must be treated as read-only.
  1369.           This list will be overwritten when SSSSggggGGGGrrrraaaapppphhhhGGGGeeeettttSSSSeeeelllleeeecccctttteeeeddddNNNNooooddddeeeessss
  1370.           or SSSSggggGGGGrrrraaaapppphhhhGGGGeeeettttRRRRoooooooottttssss are called.
  1371.  
  1372.           void SSSSggggGGGGrrrraaaapppphhhhIIIInnnnsssseeeerrrrttttRRRRoooooooottttssss (_g_r_a_p_h, _n_o_d_e_s, _n__n_o_d_e_s)
  1373.             SgGraphWidget  _g_r_a_p_h;
  1374.             WidgetList       _n_o_d_e_s;
  1375.             int              _n__n_o_d_e_s;
  1376.  
  1377.           SSSSggggGGGGrrrraaaapppphhhhIIIInnnnsssseeeerrrrttttRRRRoooooooottttssss adds to the user_roots list of _g_r_a_p_h the
  1378.           first _n__n_o_d_e_s in the WidgetList _n_o_d_e_s.
  1379.  
  1380.  
  1381.  
  1382.  
  1383.      Page 21                                         (printed 10/3/02)
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  1391.  
  1392.  
  1393.  
  1394.           void SSSSggggGGGGrrrraaaapppphhhhRRRReeeemmmmoooovvvveeeeRRRRoooooooottttssss (_g_r_a_p_h, _n_o_d_e_s, _n__n_o_d_e_s)
  1395.             SgGraphWidget  _g_r_a_p_h;
  1396.             WidgetList       _n_o_d_e_s;
  1397.             int              _n__n_o_d_e_s;
  1398.  
  1399.           SSSSggggGGGGrrrraaaapppphhhhRRRReeeemmmmoooovvvveeeeRRRRoooooooottttssss removes from the user_roots list of _g_r_a_p_h
  1400.           the first _n__n_o_d_e_s in the WidgetList _n_o_d_e_s.
  1401.  
  1402.           void SSSSggggGGGGrrrraaaapppphhhhNNNNuuuummmmRRRRoooooooottttssss (_g_r_a_p_h)
  1403.             SgGraphWidget   _g_r_a_p_h;
  1404.  
  1405.           SSSSggggGGGGrrrraaaapppphhhhNNNNuuuummmmRRRRoooooooottttssss returns the number of node widgets in the
  1406.           user_roots list of _g_r_a_p_h.
  1407.  
  1408.           void SSSSggggGGGGrrrraaaapppphhhhLLLLaaaayyyyoooouuuutttt (_g_r_a_p_h)
  1409.             SgGraphWidget   _g_r_a_p_h;
  1410.  
  1411.           SSSSggggGGGGrrrraaaapppphhhhLLLLaaaayyyyoooouuuutttt forces a relayout of the entire graph.
  1412.  
  1413.           extern SSSSggggGGGGrrrraaaapppphhhhRRRReeeellllaaaayyyySSSSuuuubbbbggggrrrraaaapppphhhh (_g_r_a_p_h, _n_o_d_e)
  1414.             SgGraphWidget   _g_r_a_p_h;
  1415.             Widget          _n_o_d_e;
  1416.  
  1417.           SSSSggggGGGGrrrraaaapppphhhhRRRReeeellllaaaayyyySSSSuuuubbbbggggrrrraaaapppphhhh relays the subgraph rooted at the node
  1418.           widget _n_o_d_e.
  1419.  
  1420.           extern SSSSggggGGGGrrrraaaapppphhhhCCCCeeeennnntttteeeerrrrAAAArrrroooouuuunnnnddddWWWWiiiiddddggggeeeetttt (_g_r_a_p_h, _n_o_d_e)
  1421.             SgGraphWidget   _g_r_a_p_h;
  1422.             Widget          _n_o_d_e;
  1423.  
  1424.           SSSSggggGGGGrrrraaaapppphhhhCCCCeeeennnntttteeeerrrrAAAArrrroooouuuunnnnddddWWWWiiiiddddggggeeeetttt attempts to scroll a scrolled
  1425.           graph to make _n_o_d_e appear in the center of the screen.
  1426.  
  1427.           extern SSSSggggGGGGrrrraaaapppphhhhMMMMaaaakkkkeeeeWWWWiiiiddddggggeeeettttVVVViiiissssiiiibbbblllleeee (_g_r_a_p_h, _n_o_d_e)
  1428.             SgGraphWidget   _g_r_a_p_h;
  1429.             Widget          _n_o_d_e;
  1430.  
  1431.           SSSSggggGGGGrrrraaaapppphhhhMMMMaaaakkkkeeeeWWWWiiiiddddggggeeeettttVVVViiiissssiiiibbbblllleeee attempts to scroll a scrolled graph
  1432.           to make _n_o_d_e appear in the center of the screen, unless the
  1433.           widget is already visible.
  1434.  
  1435.           extern Widget SgGraphCreateOverView (Widget graph, Widget
  1436.           parent);
  1437.  
  1438.           Creates a small, view-only version of the contents of the
  1439.           given graph, as a child of the provided parent. Typically,
  1440.           this is a popup shell, providing an optional overview of a
  1441.           large graph. The overview is drawn in an XmDrawingArea
  1442.           widget, which is returned by this function. The drawing area
  1443.           widget is not managed.
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.      Page 22                                         (printed 10/3/02)
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  1457.  
  1458.  
  1459.  
  1460.           extern void SgGraphSetButterflyRoot(Widget graph, Widget
  1461.           node);
  1462.  
  1463.           When the value of XmNlayoutStyle is XmBUTTERFLY, the graph
  1464.           widget arranges a set of children acording to the parents
  1465.           and children of one node. This function allows that node to
  1466.           be specified. The given node will be centered in the graph,
  1467.           with the parents of that node to the left, and its children
  1468.           to the right.
  1469.  
  1470.  
  1471.           extern void SgGraphZoom(Widget graph, float factor);
  1472.  
  1473.           This function allows programs to simulate a crude form of
  1474.           zooming by applying a scale factor to the spacing between
  1475.           arcs and nodes. It is a shortcut for setting the
  1476.           XmNchildSpacing and XmNsiblingSpacing resources. This
  1477.           function also forces a relayout.
  1478.  
  1479.           extern void SgGraphDontAdjustSize(Widget graph);
  1480.  
  1481.           If called, this function function prevents the graph widget
  1482.           from attempting any further size adjustments, such as may
  1483.           occur when the graph is layed out, or nodes are added. This
  1484.           function can be used to prevent excessive flashing when
  1485.           performing a group of operations. This function should be
  1486.           called in matching pairs with SgGraphAdjustSize()
  1487.  
  1488.           extern void SgGraphAdjustSize(Widget graph);
  1489.  
  1490.           This function function recomputes the size of the graph,
  1491.           updating scrollbars, the optional overview window, and so
  1492.           on. It is meant to be called after SgGraphDontAdjustSize()
  1493.           to restore the normal graph behavior as nodes are added, the
  1494.           graph is layed out, and so on.
  1495.  
  1496.           extern void SgGraphUnmanageAll(Widget graph);
  1497.  
  1498.           This convenience function unmanages all widgets currently
  1499.           managed by the graph.
  1500.  
  1501.  
  1502.            extern void SgGraphManageAll(Widget graph);
  1503.  
  1504.           This convenience function manages all widgets curently
  1505.           managed by a graph widget.
  1506.  
  1507.           extern void SgGraphShowCoverWindow(Widget graph);
  1508.  
  1509.           This function displays an X window that completely covers
  1510.           the graph widget. When performing extensive updates on the
  1511.           graph, it can be less visually distracting to the user for
  1512.  
  1513.  
  1514.  
  1515.      Page 23                                         (printed 10/3/02)
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.      SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV               SSSSggggGGGGrrrraaaapppphhhh((((3333XXXX))))
  1523.  
  1524.  
  1525.  
  1526.           the graph to simply go blank, and then be shown in its new
  1527.           state, than to see the changes as they occur. Bracketting
  1528.           sections of code that perform updates with calls to
  1529.           SgGraphShowCoverWindow and SgGraphHideCoverWindow can give
  1530.           the user a smoother perception of the process.
  1531.  
  1532.           extern void SgGraphHideCoverWindow(Widget);
  1533.  
  1534.           Removes the cover window displayed by
  1535.           ShGraphShowCoverWindow().
  1536.  
  1537.           extern Boolean SgGraphPrint(Widget graph,  char *fileName);
  1538.  
  1539.           This function saves the current graph as a postscript print
  1540.           file. The postscript processing leaves _m_u_c_h to be desired.
  1541.  
  1542.           extern void  SgGraphSelectSubtree(Widget graph, Widget
  1543.           target);
  1544.  
  1545.           Select all nodes below the given target.
  1546.  
  1547.      BBBBUUUUGGGGSSSS
  1548.           Performance begins to break down at around 2000 nodes if
  1549.           gadgets are used as nodes, far less if widgets are used as
  1550.           nodes. The performance falls off much more rapidly with a
  1551.           large number of arcs, particularly if the graph is not
  1552.           "well-behaved".
  1553.  
  1554.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  1555.           Core(3X), Composite(3X), Constraint(3X), Manager(3X),
  1556.           SgArc(3x)
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.      Page 24                                         (printed 10/3/02)
  1582.  
  1583.  
  1584.  
  1585.