/* *======================================================================= * * © 2000 Compaq Computer Corporation * * COMPAQ Registered in U.S. Patent and Trademark Office. * * Confidential computer software. Valid license from Compaq required for * possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial * Computer Software, Computer Software Documentation, and Technical Data for * Commercial Items are licensed to the U.S. Government under vendor's standard * commercial license. * *======================================================================= */ /******************************************************************************/ /* */ /* FACILITY: */ /* */ /* SVN -- Structured Visual Navigation Widget */ /* */ /* ABSTRACT: */ /* */ /* */ /* AUTHORS: */ /* */ /* */ /* CREATION DATE: */ /* */ /* MODIFICATION HISTORY: */ /* */ /* 011 DWD 25-Mar-1999 */ /* Added functions to delete references to reclaimed widgets */ /* 010 A. Napolitano 25-Jun-1990 */ /* Changes made so that only compound strings are supported */ /* instead of text strings and compound strings. */ /* 009 A. Napolitano 10-Apr-1990 */ /* Change entries initialization so that 2nd components, are */ /* compound strings instead of text strings. */ /* 008 S. Lavigne 27-Feb-1990 */ /* Remove the #include "Pane.h" line of code. */ /* 007 S. Lavigne 01-Feb-1990 */ /* Add #pragma standard lines to compile cleanly with /STAN=PORT.*/ /* 006 Will Walker 26-Jan-1990 */ /* Ultrix compatibility. */ /* 005 Will Walker 25-Jan-1990 */ /* Change DECwWsSvn*.h to DECwMSvn*.h. */ /* 004 Will Walker 23-Jan-1990 */ /* Convert Svn* constants to SvnK*. */ /* 003 S. Lavigne 23-Jan-1990 */ /* Change all BCSESVN references to SVN. Change SvnWidget */ /* type casting to Widget. */ /* 002 Will Walker 16-Jan-1990 */ /* Perform post-motif-port modifications. */ /* 001 S. Lavigne 05-Jan-1990 */ /* Run this module through the Motif converter DXM_PORT.COM */ /* and add a modification history. */ /* */ /* */ /******************************************************************************/ #ifdef VMS /*#pragma nostandard*/ #include "MainW.h" #include "PushB.h" #include "RowColumn.h" #include "Text.h" #include "TextP.h" /* Has MAXINT */ #include "XmP.h" /* Has XmVoidProc */ #include "MrmAppl.h" /* Has Intrinsics, etc. */ /*#pragma standard*/ #else #include #include #include #include #include #include #include #endif #include "DXmSvnP.h" #include "stdio.h" /******************************************************/ /* Local declarations needed for global definitions */ /******************************************************/ /* ** My local hierarchy storage structure */ typedef struct node { int level; /* level number of children */ int number; /* number of children */ XmString text; /* entry text */ struct node *sibling; /* pointer to sibling or NULL */ struct node *children; /* pointer to children or NULL */ Widget stext; /* stext widget for this entry */ Boolean opened; /* children are showing */ }_Node, *NodePtr; /* ** Forward routine declarations for callbacks */ void SvnAttach (); void SvnDetach (); void SvnGetEntry (); /*******************************************/ /* Global interface to the source module */ /*******************************************/ /* ** Global routines that return information about nodes. */ Boolean SourceIsNodeParent (); /* ** Global routines that perform actions for the test program */ void SourceToggleNode (); void SourceOpenNode (); void SourceCloseNode (); void SourceToggleEditable(); /* ** Global data declarations */ int SourceNumComps = 2; int SourceNumEntries = 0; Boolean Editable = 0; /* ** XtCallbackRec structures for "pure" source callbacks */ XtCallbackRec SvnAttachCB [2] = {{(XmVoidProc)SvnAttach ,NULL}}; XtCallbackRec SvnDetachCB [2] = {{(XmVoidProc)SvnDetach ,NULL}}; XtCallbackRec SvnGetEntryCB [2] = {{(XmVoidProc)SvnGetEntry,NULL}}; /* ** External widget declarations */ extern Widget Svn; extern Boolean announce; extern Boolean showing_3; extern Boolean showing_4; extern Boolean showing_5; extern XmFontList fontlist; /*****************************/ /* Local data declarations */ /*****************************/ /* ** Declarations used in building the pixmap */ #define pixmap_width 13 #define pixmap_height 13 static char parent_pixmap_bits[] = { 0x40, 0x00, 0xe0, 0x00, 0xf0, 0x01, 0x08, 0x02, 0xf4, 0x05, 0x16, 0x0d, 0x57, 0x1d, 0x16, 0x0d, 0xf4, 0x05, 0x08, 0x02, 0xf0, 0x01, 0xe0, 0x00, 0x40, 0x00}; static char child_pixmap_bits[] = { 0x40, 0x00, 0xa0, 0x00, 0x10, 0x01, 0x08, 0x02, 0x04, 0x04, 0x02, 0x08, 0x41, 0x10, 0x02, 0x08, 0x04, 0x04, 0x08, 0x02, 0x10, 0x01, 0xa0, 0x00, 0x40, 0x00}; /* ** Pixmap structures */ static Pixmap parent_pixmap = NULL; static Pixmap child_pixmap = NULL; /* ** Local data defining all of the nodes of the book. We will initialize ** the first three fields of the structures, namely level, number, and ** text. All of the remaining fields will be initialized in the local ** initialization routines. */ static _Node B = { 1, 7}; static _Node P1 = { 2, 7}; static _Node P2 = { 2, 3}; static _Node P3 = { 2, 3}; static _Node P4 = { 2, 4}; static _Node P5 = { 2, 5}; static _Node P6 = { 2, 6}; static _Node P7 = { 2, 0}; static _Node C11 = { 3, 0}; static _Node C12 = { 3, 2}; static _Node C13 = { 3, 3}; static _Node C14 = { 3, 2}; static _Node C15 = { 3, 0}; static _Node C16 = { 3, 3}; static _Node C17 = { 3, 0}; static _Node C21 = { 3, 2}; static _Node C22 = { 3, 3}; static _Node C23 = { 3, 4}; static _Node C31 = { 3, 9}; static _Node C32 = { 3, 4}; static _Node C33 = { 3, 7}; static _Node C41 = { 3, 2}; static _Node C42 = { 3, 4}; static _Node C43 = { 3, 3}; static _Node C44 = { 3, 0}; static _Node C51 = { 3, 0}; static _Node C52 = { 3, 3}; static _Node C53 = { 3, 7}; static _Node C54 = { 3, 0}; static _Node C55 = { 3, 3}; static _Node C61 = { 3, 0}; static _Node C62 = { 3, 9}; static _Node C63 = { 3, 0}; static _Node C64 = { 3, 0}; static _Node C65 = { 3, 0}; static _Node C66 = { 3, 0}; static _Node C70 = { 3, 0}; static _Node C121 = { 4, 0}; static _Node C122 = { 4, 0}; static _Node C131 = { 4, 0}; static _Node C132 = { 4, 0}; static _Node C133 = { 4, 0}; static _Node C141 = { 4, 0}; static _Node C142 = { 4, 0}; static _Node C161 = { 4, 0}; static _Node C162 = { 4, 0}; static _Node C163 = { 4, 0}; static _Node C211 = { 4, 0}; static _Node C212 = { 4, 0}; static _Node C221 = { 4, 0}; static _Node C222 = { 4, 0}; static _Node C223 = { 4, 0}; static _Node C231 = { 4, 0}; static _Node C232 = { 4, 0}; static _Node C233 = { 4, 0}; static _Node C234 = { 4, 0}; static _Node C311 = { 4, 0}; static _Node C312 = { 4, 0}; static _Node C313 = { 4, 0}; static _Node C314 = { 4, 0}; static _Node C315 = { 4, 0}; static _Node C316 = { 4, 0}; static _Node C317 = { 4, 0}; static _Node C318 = { 4, 0}; static _Node C319 = { 4, 0}; static _Node C321 = { 4, 0}; static _Node C322 = { 4, 0}; static _Node C323 = { 4, 0}; static _Node C324 = { 4, 0}; static _Node C331 = { 4, 0}; static _Node C332 = { 4, 0}; static _Node C333 = { 4, 0}; static _Node C334 = { 4, 0}; static _Node C335 = { 4, 0,}; static _Node C336 = { 4, 0}; static _Node C337 = { 4, 0}; static _Node C411 = { 4, 0}; static _Node C412 = { 4, 0}; static _Node C421 = { 4, 0}; static _Node C422 = { 4, 0}; static _Node C423 = { 4, 0}; static _Node C424 = { 4, 0}; static _Node C431 = { 4, 0}; static _Node C432 = { 4, 0}; static _Node C433 = { 4, 0}; static _Node C521 = { 4, 0}; static _Node C522 = { 4, 0}; static _Node C523 = { 4, 0}; static _Node C531 = { 4, 0}; static _Node C532 = { 4, 0}; static _Node C533 = { 4, 0}; static _Node C534 = { 4, 0}; static _Node C535 = { 4, 0}; static _Node C536 = { 4, 0}; static _Node C537 = { 4, 0}; static _Node C551 = { 4, 0}; static _Node C552 = { 4, 0}; static _Node C553 = { 4, 0}; static _Node C621 = { 4, 0}; static _Node C622 = { 4, 0}; static _Node C623 = { 4, 0}; static _Node C624 = { 4, 0}; static _Node C625 = { 4, 0}; static _Node C626 = { 4, 0}; static _Node C627 = { 4, 0}; static _Node C628 = { 4, 0}; static _Node C629 = { 4, 0}; /********************************/ /* Local routine declarations */ /********************************/ /* ** Forward routine declarations */ NodePtr LclGetNodePtr (); void LclCloseNode (); void LclInitializeList (); void LclSetUpPixmap (); /* ** Global routine that tells the caller if the given node has child nodes. */ Boolean SourceIsNodeParent (node_number, entry_tag) int node_number; unsigned int entry_tag; { /* ** Local data declarations */ NodePtr node; /* ** Get at the node (if needed) */ if (entry_tag == 0) node = LclGetNodePtr (node_number); else node = (NodePtr) entry_tag; /* ** Return TRUE or FALSE */ if (node->children == 0) return FALSE; else return TRUE; } /* ** AttachToSource callback routine */ void SvnAttach (svnw) Widget svnw; { /* ** Local data declarations */ unsigned int entry_tags [1]; /* ** Announce the routine on the debugging terminal */ if (announce) printf ("AttachToSource handler\n"); /* ** Initialize the book data structure */ LclInitializeList (); /* ** Make room for the books entries. I will pass the tag array here since I ** know that I have exactly one entry and its easy to figure out the tag. */ entry_tags[0] = (unsigned int) &B; DXmSvnAddEntries (svnw, 0, 1, 0, entry_tags, TRUE); /* ** Reflect this addition in the global count. */ SourceNumEntries = 1; } /* ** This callback routine is called when SVN is detaching from the source. */ void SvnDetach () { /* ** Announce the routine on the debugging terminal */ if (announce) printf ("DetachFromSource handler\n"); } /* ** This routine is called when the widget wants the Source module to set ** the information associated with a particular entry. */ void SvnGetEntry (svnw, unused_tag, data) Widget svnw; int unused_tag; DXmSvnCallbackStruct *data; { /* ** Local data declarations */ int i; NodePtr node; Arg args[10]; /* ** Announce the routine on the debugging terminal */ if (announce) printf ("GetEntry handler - entry_number = %d, entry_tag = %d\n", data->entry_number, data->entry_tag); /* ** Get at the node (if needed) */ if (data->entry_tag == 0) node = LclGetNodePtr (data->entry_number); else node = (NodePtr) data->entry_tag; /* ** Set up the pixmaps */ LclSetUpPixmap (svnw); /* ** Set the entry information that both children and parent nodes ** have in common. */ DXmSvnSetEntryNumComponents (svnw, data->entry_number, SourceNumComps); DXmSvnSetEntryTag (svnw, data->entry_number, node); /* ** Parent nodes are put in the index window */ if (node->number != 0) DXmSvnSetEntryIndexWindow (svnw, data->entry_number, TRUE); /* ** If we are editable, then create an editable widget if needed. */ if (Editable) if (node->stext == 0) { Widget primary_window; XtSetArg (args[0], DXmSvnNprimaryWindowWidget, &primary_window); XtGetValues (svnw, args, 1); XtSetArg (args[0], XmNvalue, node->text); XtSetArg (args[1], XmNcolumns, 50 ); XtSetArg (args[2], XmNrows, 1 ); XtSetArg (args[3], XmNwordWrap, FALSE ); node->stext = DXmCreateCSText(primary_window, "TextWidget", args, 4); }; /* ** The first component is different in parent/child nodes and always present. */ if (node->number == 0) DXmSvnSetComponentPixmap (svnw, data->entry_number, 1, 0, 0, child_pixmap, pixmap_width, pixmap_height); else DXmSvnSetComponentPixmap (svnw, data->entry_number, 1, 0, 0, parent_pixmap, pixmap_width, pixmap_height); /* ** The second component is the same in parent/child nodes and always present. */ if (Editable) DXmSvnSetComponentWidget (svnw, data->entry_number, 2, pixmap_width+4, 0, node->stext); else DXmSvnSetComponentText (svnw, data->entry_number, 2, pixmap_width+4, 0, node->text, fontlist); /* ** The rest of the components are not always present... We use the tag associated ** with the component to hold the text. */ for (i = 3; i <= SourceNumComps; i++) { char * comp_tag = (char *) DXmSvnGetComponentTag (svnw, i); DXmSvnSetComponentText (svnw, data->entry_number, i, pixmap_width+5+i, 0, comp_tag, fontlist); }; } /* ** Routine that maps a node_number into a node structure pointer. */ NodePtr LclGetNodePtr (node_number) int node_number; { /* ** Local routine data */ int i; NodePtr current_node = &B; /* ** Loop through until it's found. If we hit the end of the list, then ** we'll return a null pointer. */ if (node_number != 1) for (i = 2; i <= node_number; i++) if (current_node == NULL) break; else if (current_node->opened) current_node = current_node->children; else current_node = current_node->sibling; /* ** Return the node address */ return current_node; } /* ** Global routine that opens a closed node or closes an open node. */ void SourceToggleNode (node_number, entry_tag) int node_number; unsigned int entry_tag; { /* ** Local data declarations */ NodePtr node; /* ** Get at the node (if needed) */ if (entry_tag == 0) node = LclGetNodePtr (node_number); else node = (NodePtr) entry_tag; /* ** If it is opened, then close it. Otherwise open it. */ if (node->opened == TRUE) SourceCloseNode (node_number, entry_tag); else SourceOpenNode (node_number, entry_tag); } /* ** Global routine that changes the text in all the nodes to ** editable/non-editable. */ void SourceToggleEditable () { /* ** Local data declarations */ int node_number = 1; NodePtr node; /* ** If we weren't previously editable, simply change the editable flag and ** return. */ if (!Editable) { Editable = 1; } else Editable = 0; /* ** Traverse tree and unmanage all editable fields and invalidate ** the entries. */ while (node_number <= SourceNumEntries) { node = LclGetNodePtr (1); if (node->stext) XtUnmanageChild(node->stext); DXmSvnInvalidateEntry(Svn, node_number); node_number++; }; } /* ** Global routine that opens a node, given the node number */ void SourceOpenNode (node_number, entry_tag) int node_number; unsigned int entry_tag; { /* ** Local data declarations */ NodePtr node; NodePtr child_node; int i, x, y; /* ** Get at the node (if needed) */ if (entry_tag == 0) node = LclGetNodePtr (node_number); else node = (NodePtr) entry_tag; /* ** If it is already opened, then return. */ if (node->opened == TRUE) return; /* ** If it has no children, then return. */ if (node->number == 0) return; /* ** Mark the node as being opened */ node->opened = TRUE; /* ** Add the entries. This code does not yet use the entry_tags array. It also ** defaults the index window boolean to FALSE. */ DXmSvnAddEntries (Svn, node_number, node->number, node->level, NULL, FALSE); /* ** Get to the first child of this node */ child_node = node->children; /* ** For each child, call SetEntry if the child has children. Also set their ** positions in case we are in we have a UserDefined Tree Style. */ DXmSvnGetEntryPosition(Svn, node_number, FALSE, &x, &y); for (i = 1; i <= node->number; i++) { if (child_node->children != 0) DXmSvnSetEntry (Svn, node_number+i, 0, 0, 2, 1, 0, TRUE); child_node = child_node->sibling; x += 30; y += 30; DXmSvnSetEntryPosition(Svn, node_number+i, FALSE, x, y); }; /* ** Reflect this addition in the global count. */ SourceNumEntries = SourceNumEntries + node->number; } /* ** Global routine that closes a node, given the node number */ void SourceCloseNode (node_number, entry_tag) int node_number; unsigned int entry_tag; { /* ** Local data declarations */ NodePtr node; /* ** Get at the node (if needed) */ if (entry_tag == 0) node = LclGetNodePtr (node_number); else node = (NodePtr) entry_tag; /* ** Call the local recursive close routine. */ LclCloseNode (node, node_number); } /* ** Recursively close all nodes given a current node pointer ** and a current node number. */ void LclCloseNode (node, node_number) NodePtr node; int node_number; { /* ** Local data declarations */ int i; NodePtr child_node; /* ** If the current node is not opened, then return */ if (node->opened == FALSE) return; /* ** Get to the first child of this node */ child_node = node->children; /* ** For each child, call CloseNode on each child */ for (i=1; i<=node->number; i++) { LclCloseNode (child_node, node_number); child_node = child_node->sibling; }; /* ** Tell SVN to remove its children */ DXmSvnDeleteEntries (Svn, node_number, node->number); /* ** Mark the node closed */ node->opened = FALSE; if (node->stext != NULL) XtUnmanageChild(node->stext); /* ** Reflect this removal in the global count. */ SourceNumEntries = SourceNumEntries - node->number; } /* ** Initialization routine called to set up my hierarchical structure */ void LclInitializeList () { B.text = XmStringCreate("OSF/Motif Style Guide V1.1", XmSTRING_DEFAULT_CHARSET); P1.text = XmStringCreate("1. User Interface Design Principles", XmSTRING_DEFAULT_CHARSET); P2.text = XmStringCreate("2. Input and Navigation Models", XmSTRING_DEFAULT_CHARSET); P3.text = XmStringCreate("3. Selection and Component Activation", XmSTRING_DEFAULT_CHARSET); P4.text = XmStringCreate("4. Application Design Principles", XmSTRING_DEFAULT_CHARSET); P5.text = XmStringCreate("5. Window Manager Design Principles", XmSTRING_DEFAULT_CHARSET); P6.text = XmStringCreate("6. Designing for International Markets", XmSTRING_DEFAULT_CHARSET); P7.text = XmStringCreate("7. Controls, Groups, and Models Reference Pages", XmSTRING_DEFAULT_CHARSET); C11 .text = XmStringCreate("1.1 Adopt the User's Perspective", XmSTRING_DEFAULT_CHARSET); C12 .text = XmStringCreate("1.2 Give the User Control", XmSTRING_DEFAULT_CHARSET); C13 .text = XmStringCreate("1.3 User Real-World Metaphors", XmSTRING_DEFAULT_CHARSET); C14 .text = XmStringCreate("1.4 Keep Interfaces Natural", XmSTRING_DEFAULT_CHARSET); C15 .text = XmStringCreate("1.5. Keep Interfaces Consistent", XmSTRING_DEFAULT_CHARSET); C16 .text = XmStringCreate("1.6 Communicate Application Actions to the User", XmSTRING_DEFAULT_CHARSET); C17 .text = XmStringCreate("1.7 Avoid Common Design Pitfalls", XmSTRING_DEFAULT_CHARSET); C21 .text = XmStringCreate("2.1 The Keyboard Focus Model", XmSTRING_DEFAULT_CHARSET); C22 .text = XmStringCreate("2.2 The Input Device Model", XmSTRING_DEFAULT_CHARSET); C23.text = XmStringCreate("2.3 The Navigation Model", XmSTRING_DEFAULT_CHARSET); C31.text = XmStringCreate("3.1 Selection Models", XmSTRING_DEFAULT_CHARSET); C32.text = XmStringCreate("3.2 Selection Actions", XmSTRING_DEFAULT_CHARSET); C33.text = XmStringCreate("3.3 Component Activation", XmSTRING_DEFAULT_CHARSET); C41.text = XmStringCreate("4.1 Choosing Components", XmSTRING_DEFAULT_CHARSET); C42.text = XmStringCreate("4.2 Layout", XmSTRING_DEFAULT_CHARSET); C43.text = XmStringCreate("4.3 Interaction", XmSTRING_DEFAULT_CHARSET); C44.text = XmStringCreate("4.4 Component Design", XmSTRING_DEFAULT_CHARSET); C51.text = XmStringCreate("5.1 Configurability", XmSTRING_DEFAULT_CHARSET); C52.text = XmStringCreate("5.2 Window Support", XmSTRING_DEFAULT_CHARSET); C53.text = XmStringCreate("5.3 Window Decorations", XmSTRING_DEFAULT_CHARSET); C54.text = XmStringCreate("5.4 Window Navigation", XmSTRING_DEFAULT_CHARSET); C55.text = XmStringCreate("5.5 Icons", XmSTRING_DEFAULT_CHARSET); C61.text = XmStringCreate("6.1 Collating Sequences", XmSTRING_DEFAULT_CHARSET); C62.text = XmStringCreate("6.2 Country-Specific Data Formats", XmSTRING_DEFAULT_CHARSET); C63.text = XmStringCreate("6.3 Icons, Symbols, and Pointer Shapes", XmSTRING_DEFAULT_CHARSET); C64.text = XmStringCreate("6.4 Scanning Direction", XmSTRING_DEFAULT_CHARSET); C65.text = XmStringCreate("6.5 Designing Modularized Software", XmSTRING_DEFAULT_CHARSET); C66.text = XmStringCreate("6.6 Translation Screen Text", XmSTRING_DEFAULT_CHARSET); C121.text = XmStringCreate("1.2.1 Keep Interfaces Flexible", XmSTRING_DEFAULT_CHARSET); C122.text = XmStringCreate("1.2.2 Use Progressive Disclosure", XmSTRING_DEFAULT_CHARSET); C131.text = XmStringCreate("1.3.1 Allow Direct Manipulation", XmSTRING_DEFAULT_CHARSET); C132.text = XmStringCreate("1.3.2 Provide Rapid Response", XmSTRING_DEFAULT_CHARSET); C133.text = XmStringCreate("1.3.3 Provide Output as Input", XmSTRING_DEFAULT_CHARSET); C141.text = XmStringCreate("1.4.1 Make Navigation Easy", XmSTRING_DEFAULT_CHARSET); C142.text = XmStringCreate("1.4.2 Provide Natural Shades and Colors", XmSTRING_DEFAULT_CHARSET); C161.text = XmStringCreate("1.6.1 Give the User Feedback", XmSTRING_DEFAULT_CHARSET); C162.text = XmStringCreate("1.6.2 Anticipate Errors", XmSTRING_DEFAULT_CHARSET); C163.text = XmStringCreate("1.6.3 Use Explicit Destruction", XmSTRING_DEFAULT_CHARSET); C211.text = XmStringCreate("2.1.1 Implicit Focus", XmSTRING_DEFAULT_CHARSET); C212.text = XmStringCreate("2.1.2 Explicit Focus", XmSTRING_DEFAULT_CHARSET); C221.text = XmStringCreate("2.2.1 Pointing Devices", XmSTRING_DEFAULT_CHARSET); C222.text = XmStringCreate("2.2.2 Pointer Shapes", XmSTRING_DEFAULT_CHARSET); C223.text = XmStringCreate("2.2.3 Warp Pointer Only If Explicitly Enabled", XmSTRING_DEFAULT_CHARSET); C231.text = XmStringCreate("2.3.1 Mouse-Based Navigation", XmSTRING_DEFAULT_CHARSET); C232.text = XmStringCreate("2.3.2 Keyboard-Based Navigation", XmSTRING_DEFAULT_CHARSET); C233.text = XmStringCreate("2.3.3 Menu Traversal", XmSTRING_DEFAULT_CHARSET); C234.text = XmStringCreate("2.3.4 Scrollable Component Navigation", XmSTRING_DEFAULT_CHARSET); C311.text = XmStringCreate("3.1.1 Mouse-Based Single Selection", XmSTRING_DEFAULT_CHARSET); C312.text = XmStringCreate("3.1.2 Mouse-Based Browse Selection", XmSTRING_DEFAULT_CHARSET); C313.text = XmStringCreate("3.1.3 Mouse-Based Multiple Selection", XmSTRING_DEFAULT_CHARSET); C314.text = XmStringCreate("3.1.4 Mouse-Based Range Selection", XmSTRING_DEFAULT_CHARSET); C315.text = XmStringCreate("3.1.5 Mouse-Based Discontiguous Selection", XmSTRING_DEFAULT_CHARSET); C316.text = XmStringCreate("3.1.6 Keyboard Selection", XmSTRING_DEFAULT_CHARSET); C317.text = XmStringCreate("3.1.7 Canceling a Selection", XmSTRING_DEFAULT_CHARSET); C318.text = XmStringCreate("3.1.8 Selecting and Deselecting All Elements", XmSTRING_DEFAULT_CHARSET); C319.text = XmStringCreate("3.1.9 Using Mnemonics for Elements", XmSTRING_DEFAULT_CHARSET); C321.text = XmStringCreate("3.2.1 the Drag-and-Drop Model", XmSTRING_DEFAULT_CHARSET); C322.text = XmStringCreate("3.2.2 Using Primary Selection", XmSTRING_DEFAULT_CHARSET); C323.text = XmStringCreate("3.2.3 Using Quick Transfer", XmSTRING_DEFAULT_CHARSET); C324.text = XmStringCreate("3.2.4 Using Keyboard Clipboard Selection Actions and Deletion", XmSTRING_DEFAULT_CHARSET); C331.text = XmStringCreate("3.3.1 Basic Activation", XmSTRING_DEFAULT_CHARSET); C332.text = XmStringCreate("3.3.2 Accelerators", XmSTRING_DEFAULT_CHARSET); C333.text = XmStringCreate("3.3.3 Mnemonics", XmSTRING_DEFAULT_CHARSET); C334.text = XmStringCreate("3.3.4 Help Activation", XmSTRING_DEFAULT_CHARSET); C335.text = XmStringCreate("3.3.5 Default Activation", XmSTRING_DEFAULT_CHARSET); C336.text = XmStringCreate("3.3.6 Expert Activation", XmSTRING_DEFAULT_CHARSET); C337.text = XmStringCreate("3.3.7 Previewing and Autorepeat", XmSTRING_DEFAULT_CHARSET); C411.text = XmStringCreate("4.1.1 Guidelines for Choosing a Main Component Group", XmSTRING_DEFAULT_CHARSET); C412.text = XmStringCreate("4.1.2 Guidelines for Choosing Interactive Methods", XmSTRING_DEFAULT_CHARSET); C421.text = XmStringCreate("4.2.1 Common Client Areas", XmSTRING_DEFAULT_CHARSET); C422.text = XmStringCreate("4.2.2 Grouping Components", XmSTRING_DEFAULT_CHARSET); C423.text = XmStringCreate("4.2.3 Menu Design", XmSTRING_DEFAULT_CHARSET); C424.text = XmStringCreate("4.2.4 DialogBox Design" , XmSTRING_DEFAULT_CHARSET); C431.text = XmStringCreate("4.3.1 Supplying Indications of Actions", XmSTRING_DEFAULT_CHARSET); C432.text = XmStringCreate("4.3.2 Providing Feedback", XmSTRING_DEFAULT_CHARSET); C433.text = XmStringCreate("4.3.3 Allowing User Flexibility", XmSTRING_DEFAULT_CHARSET); C521.text = XmStringCreate("5.2.1 Primary Window", XmSTRING_DEFAULT_CHARSET); C522.text = XmStringCreate("5.2.2 Secondary Windows (Dialog)", XmSTRING_DEFAULT_CHARSET); C523.text = XmStringCreate("5.2.3 Menu Windows", XmSTRING_DEFAULT_CHARSET); C531.text = XmStringCreate("5.3.1 Client Area", XmSTRING_DEFAULT_CHARSET); C532.text = XmStringCreate("5.3.2 Title Area", XmSTRING_DEFAULT_CHARSET); C533.text = XmStringCreate("5.3.3 Maximize Button", XmSTRING_DEFAULT_CHARSET); C534.text = XmStringCreate("5.3.4 Minimize Button", XmSTRING_DEFAULT_CHARSET); C535.text = XmStringCreate("5.3.5 Other Buttons", XmSTRING_DEFAULT_CHARSET); C536.text = XmStringCreate("5.3.6 Resize Buttons", XmSTRING_DEFAULT_CHARSET); C537.text = XmStringCreate("5.3.7 Window Menu", XmSTRING_DEFAULT_CHARSET); C551.text = XmStringCreate("5.5.1 Icon Decoration", XmSTRING_DEFAULT_CHARSET); C552.text = XmStringCreate("5.5.2 Icon Menu", XmSTRING_DEFAULT_CHARSET); C553.text = XmStringCreate("5.5.3 Icon Box", XmSTRING_DEFAULT_CHARSET); C621.text = XmStringCreate("6.2.1 Thousands Separtors", XmSTRING_DEFAULT_CHARSET); C622.text = XmStringCreate("6.2.2 Decimal Separators", XmSTRING_DEFAULT_CHARSET); C623.text = XmStringCreate("6.2.3 Grouping Separators", XmSTRING_DEFAULT_CHARSET); C624.text = XmStringCreate("6.2.4 Positive and Negative Values", XmSTRING_DEFAULT_CHARSET); C625.text = XmStringCreate("6.2.5 Currency", XmSTRING_DEFAULT_CHARSET); C626.text = XmStringCreate("6.2.6 Date Formats", XmSTRING_DEFAULT_CHARSET); C627.text = XmStringCreate("6.2.7 Time Formats", XmSTRING_DEFAULT_CHARSET); C628.text = XmStringCreate("6.2.8 Telephone Numbers", XmSTRING_DEFAULT_CHARSET); C629.text = XmStringCreate("6.2.9 Proper Names and Addresses", XmSTRING_DEFAULT_CHARSET); /* ** Fill in the child pointers for the book, parts, and chapters */ B.children = &P1; P1.children = &C11; P2.children = &C21; P3.children = &C31; P4.children = &C41; P5.children = &C51; P6.children = &C61; P7.children = NULL; C11.children = NULL; C12.children = &C121; C13.children = &C131; C14.children = &C141; C15.children = NULL; C16.children = &C161; C17.children = NULL; C21.children = &C211; C22.children = &C221; C23.children = &C231; C31.children = &C311; C32.children = &C321; C33.children = &C331; C41.children = &C411; C42.children = &C421; C43.children = &C431; C44.children = NULL; C51.children = NULL; C52.children = &C521; C53.children = &C531; C54.children = NULL; C55.children = &C551; C61.children = NULL; C62.children = &C621; C63.children = NULL; C64.children = NULL; C65.children = NULL; C66.children = NULL; /* ** Fill in the sibling pointers for the book */ B.sibling = NULL; /* ** Fill in the sibling pointers for the parts */ P1.sibling = &P2; P2.sibling = &P3; P3.sibling = &P4; P4.sibling = &P5; P5.sibling = &P6; P6.sibling = &P7; P7.sibling = NULL; /* ** Fill in the sibling pointers for the chapters */ C11.sibling = &C12; C12.sibling = &C13; C13.sibling = &C14; C14.sibling = &C15; C15.sibling = &C16; C16.sibling = &C17; C17.sibling = &P2; C21.sibling = &C22; C22.sibling = &C23; C23.sibling = &P3; C31.sibling = &C32; C32.sibling = &C33; C33.sibling = &P4; C41.sibling = &C42; C42.sibling = &C43; C43.sibling = &C44; C44.sibling = &P5; C51.sibling = &C52; C52.sibling = &C53; C53.sibling = &C54; C54.sibling = &C55; C55.sibling = &P6; C61.sibling = &C62; C62.sibling = &C63; C63.sibling = &C64; C64.sibling = &C65; C65.sibling = &C66; C66.sibling = &P7; /* ** Fill in the sibling pointers for the sections of chapter 1 */ C121.sibling = &C122; C122.sibling = &C13; C131.sibling = &C132; C132.sibling = &C133; C133.sibling = &C14; C141.sibling = &C142; C142.sibling = &C15; C161.sibling = &C162; C162.sibling = &C163; C163.sibling = &C17; /* ** Fill in the sibling pointers for the sections of chapter 2 */ C211.sibling = &C212; C212.sibling = &C22; C221.sibling = &C222; C222.sibling = &C223; C223.sibling = &C23; C231.sibling = &C232; C232.sibling = &C233; C233.sibling = &C234; C234.sibling = &P3; /* ** Fill in the sibling pointers for the sections of chapter 3 */ C311.sibling = &C312; C312.sibling = &C313; C313.sibling = &C314; C314.sibling = &C315; C315.sibling = &C316; C316.sibling = &C317; C317.sibling = &C318; C318.sibling = &C319; C319.sibling = &C32; C321.sibling = &C322; C322.sibling = &C323; C323.sibling = &C324; C324.sibling = &C33; C331.sibling = &C332; C332.sibling = &C333; C333.sibling = &C334; C334.sibling = &C335; C335.sibling = &C336; C336.sibling = &C337; C337.sibling = &P4; /* ** Fill in the sibling pointers for the sections of chapter 4 */ C411.sibling = &C412; C412.sibling = &C42; C421.sibling = &C422; C422.sibling = &C423; C423.sibling = &C424; C424.sibling = &C43; C431.sibling = &C432; C432.sibling = &C433; C433.sibling = &C44; /* ** Fill in the sibling pointers for the sections of chapter 5 */ C521.sibling = &C522; C522.sibling = &C523; C523.sibling = &C53; C531.sibling = &C532; C532.sibling = &C533; C533.sibling = &C534; C534.sibling = &C535; C535.sibling = &C536; C536.sibling = &C537; C537.sibling = &C54; C551.sibling = &C552; C552.sibling = &C553; C553.sibling = &P6; /* ** Fill in the sibling pointers for the sections of chapter 6 */ C621.sibling = &C622; C622.sibling = &C623; C623.sibling = &C624; C624.sibling = &C625; C625.sibling = &C626; C626.sibling = &C627; C627.sibling = &C628; C628.sibling = &C629; C629.sibling = &C63; } void LclSetUpPixmap (svnw) Widget svnw; { /* ** Local data declarations */ Screen *screen = XtScreen(svnw); Display *display = DisplayOfScreen (screen); Pixel background_pixel; Pixel foreground_pixel; Arg args [2]; /* ** If we've already done this, then return. */ if (parent_pixmap != NULL) return; /* ** Get the foreground/background colors of Svn */ XtSetArg (args[0], XmNforeground, &foreground_pixel); XtSetArg (args[1], XmNbackground, &background_pixel); XtGetValues (svnw, args, 2); /* ** Create the pixmap. */ parent_pixmap = XCreatePixmapFromBitmapData ( display, /* (IN) display */ XDefaultRootWindow(display), /* (IN) drawable */ parent_pixmap_bits, /* (IN) bitmap data */ pixmap_width, /* (IN) width */ pixmap_height, /* (IN) height */ foreground_pixel, /* (IN) foreground pixel */ background_pixel, /* (IN) background pixel */ DefaultDepthOfScreen (screen)); /* (IN) pixmap depth */ child_pixmap = XCreatePixmapFromBitmapData ( display, /* (IN) display */ XDefaultRootWindow(display), /* (IN) drawable */ child_pixmap_bits, /* (IN) bitmap data */ pixmap_width, /* (IN) width */ pixmap_height, /* (IN) height */ foreground_pixel, /* (IN) foreground pixel */ background_pixel, /* (IN) background pixel */ DefaultDepthOfScreen (screen)); /* (IN) pixmap depth */ } /* ** This function traverses the node tree deleting references ** to the stext widget. */ static void LclRecursivelyResetNodes (NodePtr node) { if (!node) return; node->stext = NULL; LclRecursivelyResetNodes (node->children); LclRecursivelyResetNodes (node->sibling); } /* ** This function is called to remove any references to an svn ** widget. It is called before the widget is about to be destroyed. */ void LclResetNodes() { LclRecursivelyResetNodes (&B); }