home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / tclMotif-1.4 / tm1.4patch2 < prev   
Encoding:
Text File  |  1995-06-29  |  38.4 KB  |  1,427 lines

  1. *** tmAppInit.c    Fri May 19 11:50:08 1995
  2. --- ../../tm-1-4.org/src/tmAppInit.c    Mon Feb 27 19:38:24 1995
  3. ***************
  4. *** 119,127 ****
  5.       }
  6.   
  7.        moatinterp = interp;
  8. ! #if defined(__sun__) && !defined(__sysv__)
  9. !     on_exit(cleanup,0);
  10. ! #else
  11.        atexit(cleanup);
  12.   #endif
  13.   
  14. --- 119,125 ----
  15.       }
  16.   
  17.        moatinterp = interp;
  18. ! #ifdef __STDC__
  19.        atexit(cleanup);
  20.   #endif
  21.   
  22. ***************
  23. *** 140,145 ****
  24.       tcl_RcFileName = "tmrc";
  25.       return TCL_OK;
  26.   }
  27. --- 138,140 ----
  28. *** tmBasic.c    Fri May 19 11:54:22 1995
  29. --- ../../tm-1-4.org/src/tmBasic.c    Mon Feb 27 19:40:00 1995
  30. ***************
  31. *** 301,311 ****
  32.       char *name;
  33.   {
  34.       Tm_Display *d;
  35. !     if (NULL!=name)
  36. !     for(d = tm_display_list; NULL!=d; d = d->next)
  37. !         if(0 == strcmp(name,XDisplayString(d->display)))
  38. !         return d;
  39.       return NULL;
  40.   }
  41.   
  42. --- 301,310 ----
  43.       char *name;
  44.   {
  45.       Tm_Display *d;
  46. !     
  47. !     for(d = tm_display_list; NULL!=d; d = d->next)
  48. !       if(0 == strcmp(name,XDisplayString(d->display)))
  49. !           return d;
  50.       return NULL;
  51.   }
  52.   
  53. ***************
  54. *** 379,392 ****
  55.           p->widget,XDisplayString(d->display));
  56.   #endif
  57.       for(i=0; i<d->numshellwidgets; ++i) {
  58. !     if(NULL!=d->shellwidgets[i]) {
  59. !         if(p==d->shellwidgets[i]) {
  60. !         d->shellwidgets[i] = NULL;
  61. !         if(cnt)
  62. !             return;
  63. !         } else
  64. !         ++cnt;
  65. !     }
  66.       }
  67.       if(!cnt) {
  68.       Tm_Display *p = tm_display_list;
  69. --- 378,390 ----
  70.           p->widget,XDisplayString(d->display));
  71.   #endif
  72.       for(i=0; i<d->numshellwidgets; ++i) {
  73. !       if(p==d->shellwidgets[i]) {
  74. !           d->shellwidgets[i] = NULL;
  75. !           if(cnt)
  76. !               return;
  77. !       } else
  78. !           if(NULL!=d->shellwidgets[i])
  79. !               ++cnt;
  80.       }
  81.       if(!cnt) {
  82.       Tm_Display *p = tm_display_list;
  83. ***************
  84. *** 466,471 ****
  85. --- 464,487 ----
  86.       Tcl_SplitList(interp, app_argv_str, &app_argc, &app_argv);
  87.       old_app_argc = app_argc;
  88.   
  89. + #if 0
  90. +     /* don't copy - we don't free this after all! */
  91. +     /* bug workaround */
  92. +     for (n = 0; n < app_argc; n++) {
  93. +     if (app_argv[n][0] == '-') {
  94. +         if (strcmp(app_argv[n], "-geometry") == 0) {
  95. +         /* the Intrinsics don't copy this resource (do they?)
  96. +            so make our own copy, 'cos it gets freed later, trashing
  97. +            the value
  98. +          */
  99. +         n++;
  100. +         app_argv[n] = XtNewString(app_argv[n]);
  101. +         }
  102. +     }
  103. +     }
  104. + #endif
  105.       for (n = 1; n < argc; n++) {
  106.       if (argv[n][0] == '-') {
  107.           if (strcmp(argv[n], "-appContext") == 0) {
  108. ***************
  109. *** 553,558 ****
  110. --- 569,575 ----
  111.       XtGetApplicationNameAndClass(XtDisplay(toplevel),
  112.                                  &applicationname,&applicationclass);
  113.   
  114.       wPtr = (Tm_Widget *) XtMalloc (sizeof (Tm_Widget));
  115.       wPtr -> interp = interp;
  116.       wPtr -> widget = toplevel;
  117. ***************
  118. *** 560,579 ****
  119.       wPtr -> parent = ".";    /* kludge to stop later breakages */
  120.       wPtr -> displayInfo = displayInfo;
  121.   
  122. !     Tcl_CreateCommand(interp, ".", Tm_RootCmd,
  123. !               (ClientData) wPtr, (void (*) ()) NULL);
  124. !     Tm_DisplayAddShell(displayInfo,wPtr);
  125.       XtAddCallback(toplevel, XmNdestroyCallback, Tm_DestroyWidgetHandler, wPtr);
  126.       Tm_RegisterConverters(interp, appContext);
  127.   
  128.       /* now try to create the "send" command */
  129.       Tm_RegisterSendCmd(interp, app_argv[0], toplevel);
  130.   
  131. !     /*
  132. !      * don't free this - the AppShell resource XmNargv points to the
  133. !      * set of strings contained in app_argv!
  134. !      free((char *) app_argv);
  135. !      */
  136.   
  137.       /* register the tear-off menu converter */
  138.   #   ifndef MOTIF11
  139. --- 577,598 ----
  140.       wPtr -> parent = ".";    /* kludge to stop later breakages */
  141.       wPtr -> displayInfo = displayInfo;
  142.   
  143. !     Tm_StoreWidgetInfo(".", wPtr, interp);
  144. !     Tcl_CreateCommand (interp, ".", Tm_RootCmd,
  145. !                  (ClientData) wPtr, (void (*) ()) NULL);
  146.       XtAddCallback(toplevel, XmNdestroyCallback, Tm_DestroyWidgetHandler, wPtr);
  147.       Tm_RegisterConverters(interp, appContext);
  148.   
  149.       /* now try to create the "send" command */
  150.       Tm_RegisterSendCmd(interp, app_argv[0], toplevel);
  151.   
  152. !     /* don't free this - the AppShell resource XmNargv points to the
  153. !        set of strings contained in app_argv!
  154. !     free((char *) app_argv);
  155. !     */
  156.   
  157.       /* register the tear-off menu converter */
  158.   #   ifndef MOTIF11
  159. ***************
  160. *** 616,624 ****
  161.       static char initCmd[] =
  162.   #if defined TMUSEINITFILE
  163.           "if [file exists $tm_library/init_tclMotif.tcl] {\n\
  164. !             source  $tm_library/init_tclMotif.tcl;\n\
  165. !         } elseif [file exists $tm_library/init_tclmotif.tcl] {\n\
  166. !             source  $tm_library/init_tclmotif.tcl;\n\
  167.           }";
  168.   #else
  169.       "global tclMotif_unknown\n\
  170. --- 635,641 ----
  171.       static char initCmd[] =
  172.   #if defined TMUSEINITFILE
  173.           "if [file exists $tm_library/init_tclMotif.tcl] {\n\
  174. !             source  $tm_library/init_tclMotif.tcl\n\
  175.           }";
  176.   #else
  177.       "global tclMotif_unknown\n\
  178. ***************
  179. *** 631,655 ****
  180.       \n\
  181.       rename unknown $tclMotif_unknown\n\
  182.       \n\
  183. !     proc unknown {args} {\n\
  184.           global tclMotif_unknown\n\
  185.       \n\
  186. -         set name [lindex $args 0];\n\
  187.           set cmds [info commands $name]\n\
  188.           set len [llength $cmds]\n\
  189.           if {$len == 0} {\n\
  190.           # no match, pass to old unknown\n\
  191. !         return [uplevel 1 $tclMotif_unknown $args];\n\
  192.           }\n\
  193.           if {$len > 1} {\n\
  194.           error \"non-unique command \\\"$name\\\" matches \\\"$cmds\\\"\"\n\
  195.           }\n\
  196.       \n\
  197.           # unique abbreviation:\n\
  198. !         return [uplevel $cmds [lrange $args 1 end]]\n\
  199.       }\n\
  200.   ";
  201. ! #endif /* TMUSEINITFILE */
  202.       char *libDir;
  203.       char buf[32];
  204.   
  205. --- 648,672 ----
  206.       \n\
  207.       rename unknown $tclMotif_unknown\n\
  208.       \n\
  209. !     proc unknown {name args} {\n\
  210.           global tclMotif_unknown\n\
  211.       \n\
  212.           set cmds [info commands $name]\n\
  213.           set len [llength $cmds]\n\
  214.           if {$len == 0} {\n\
  215.           # no match, pass to old unknown\n\
  216. !         set cmd \"uplevel 1 $tclMotif_unknown $name $args\"\n\
  217. !         eval $cmd\n\
  218.           }\n\
  219.           if {$len > 1} {\n\
  220.           error \"non-unique command \\\"$name\\\" matches \\\"$cmds\\\"\"\n\
  221.           }\n\
  222.       \n\
  223.           # unique abbreviation:\n\
  224. !         return [uplevel $cmds $args]\n\
  225.       }\n\
  226.   ";
  227. ! #endif /* 0 */
  228.       char *libDir;
  229.       char buf[32];
  230.   
  231. *** tmCommands.c    Wed May 17 09:37:41 1995
  232. --- ../../tm-1-4.org/src/tmCommands.c    Wed Mar  1 16:53:22 1995
  233. ***************
  234. *** 244,249 ****
  235. --- 244,252 ----
  236.       if ((c == 'd') && (strcmp(argv[1], "destroyWidget") == 0)) {
  237.       /* destroy - most stuff done in DestroyWidgetHandler */
  238.       XtDestroyWidget(wPtr->widget);
  239. +         /* must delete tcl command now, though, so we can't use it again */
  240. +         Tcl_DeleteCommand(interp, wPtr->pathName);
  241.       } else
  242.   
  243.   #ifndef MOTIF11
  244. ***************
  245. *** 1254,1264 ****
  246.       int filenum;
  247.       char *end;
  248.   
  249. - #if defined( VMS ) || defined( __vms__ )
  250. -     sprintf(interp->result, "%s not supported under OVMS", argv[1]);
  251. -     return TCL_ERROR;
  252. - #endif
  253.       if (argc < 4) {
  254.           sprintf(interp->result, "wrong # args: should be \"%.50s fileID \
  255.   permissions tcl_code", argv[0]);
  256. --- 1257,1262 ----
  257. ***************
  258. *** 1375,1381 ****
  259.       char **largv;
  260.   #if USE_UIL
  261.       MrmHierarchy *hierarchy;
  262. -     Cardinal     mrm_res;
  263.   
  264.           if (argc < 3) {
  265.               sprintf(interp->result,
  266. --- 1373,1378 ----
  267. ***************
  268. *** 1387,1421 ****
  269.       hierarchy = &(wPtr->displayInfo->hierarchy);
  270.   
  271.       Tcl_SplitList(interp, argv[2], &largc, &largv);
  272. ! #if defined( VMS ) || defined( __vms__ )
  273. !     {
  274. !         int        i;
  275. !         char        **exp_files = malloc(sizeof(char*)*largc);
  276. !         Tcl_DString *dstrings   = malloc(sizeof(Tcl_DString)*largc);
  277. !         for (i=0;i<largc;++i)
  278. !         exp_files[i] = Tcl_TildeSubst(interp,largv[i],&dstrings[i]);
  279. !         
  280. !         mrm_res = MrmOpenHierarchyPerDisplay(XtDisplay(w), largc, exp_files,
  281. !                          NULL, hierarchy);
  282. !         for (i=0;i<largc;++i)
  283. !         Tcl_DStringFree(&dstrings[i]);
  284. !         free(exp_files);
  285. !         free(dstrings);
  286. !     }
  287. ! #else
  288. !     mrm_res = MrmOpenHierarchyPerDisplay(XtDisplay(w), largc, largv,
  289. !                          NULL, hierarchy);
  290. ! #endif
  291. !     if (mrm_res != MrmSUCCESS) {
  292. !         if (largv)
  293. !         free(largv);
  294. !         sprintf(interp->result,"failed to open Mrm hierarchy");
  295.           return TCL_ERROR;
  296.       }
  297. !     free(largv);
  298.       return TCL_OK;
  299.   #else
  300. !     sprintf(interp->result,"This version of moat not compiled with UIL support");
  301.       return TCL_ERROR;
  302.   #endif /* USE_UIL */
  303.   
  304. --- 1384,1398 ----
  305.       hierarchy = &(wPtr->displayInfo->hierarchy);
  306.   
  307.       Tcl_SplitList(interp, argv[2], &largc, &largv);
  308. !     if (MrmOpenHierarchyPerDisplay(XtDisplay(w), largc, largv, NULL, hierarchy) !=
  309. !         MrmSUCCESS) {
  310. !         sprintf(interp->result, "failed to open Mrm hierarchy");
  311.           return TCL_ERROR;
  312.       }
  313. !     free(argv);
  314.       return TCL_OK;
  315.   #else
  316. !     sprintf(interp->result, "This version of moat not compiled with UIL support");
  317.       return TCL_ERROR;
  318.   #endif /* USE_UIL */
  319.   
  320. ***************
  321. *** 2926,2933 ****
  322.   
  323.       if (argc < 4) {
  324.           sprintf(interp->result,
  325. !             "wrong # args: should be \"%.50s addWMProtocolCallback atom command... \"",
  326. !             argv[0]);
  327.           return TCL_ERROR;
  328.       }
  329.   
  330. --- 2903,2910 ----
  331.   
  332.       if (argc < 4) {
  333.           sprintf(interp->result,
  334. !             "wrong # args: should be \"%.50s addWMProtocolCallback atom command... \"",
  335. !             argv[0]);
  336.           return TCL_ERROR;
  337.       }
  338.   
  339. *** tmConverters.c    Mon Apr  3 08:58:52 1995
  340. --- ../../tm-1-4.org/src/tmConverters.c    Mon Feb 27 21:48:03 1995
  341. ***************
  342. *** 19,25 ****
  343.    *      Abteilung fuer Wirtschaftsinformatik
  344.    *      Augasse 2-6, 
  345.    *      A-1090 Vienna, Austria
  346. !  *      neumannM(wu)-wien.ac.at, nusserM(wu)-wien.ac.at
  347.   
  348.    * Permission to use, copy, modify, and distribute this software and its
  349.    * documentation for any purpose and without fee is hereby granted, provided
  350. --- 19,25 ----
  351.    *      Abteilung fuer Wirtschaftsinformatik
  352.    *      Augasse 2-6, 
  353.    *      A-1090 Vienna, Austria
  354. !  *      neumann@wu-wien.ac.at, nusser@wu-wien.ac.at
  355.   
  356.    * Permission to use, copy, modify, and distribute this software and its
  357.    * documentation for any purpose and without fee is hereby granted, provided
  358. ***************
  359. *** 91,96 ****
  360. --- 91,97 ----
  361.   #ifndef MOTIF11
  362.       XmRepTypeId id;
  363.       XmRepTypeList start, list;
  364. +     int n;
  365.   
  366.       start = list = XmRepTypeGetRegistered();
  367.   
  368. ***************
  369. *** 301,308 ****
  370.       end = buf;
  371.       for (n = 0; n < final_num_children; n++) {
  372.           p = widgetNames[n];
  373. !         while ((*end++ = *p++))
  374. !         ;
  375.           *(end - 1) = ',';
  376.           *end++ = ' ';
  377.       }
  378. --- 302,309 ----
  379.       end = buf;
  380.       for (n = 0; n < final_num_children; n++) {
  381.           p = widgetNames[n];
  382. !         while (*end++ = *p++)
  383. !         ;
  384.           *(end - 1) = ',';
  385.           *end++ = ' ';
  386.       }
  387. ***************
  388. *** 396,403 ****
  389. --- 397,406 ----
  390.       char **argv, **argvv;
  391.       int argc, argcc;
  392.       int n;
  393. +     static unsigned char status;
  394.       static XmDropTransferEntryRec transferEntries[32];
  395.       static XmDropTransferEntryRec *p;
  396. +     Tm_Widget *wPtr;
  397.       Tcl_Interp *interp = (Tcl_Interp *) args->addr;
  398.   
  399.       buf = (char *) (fromVal->addr);
  400. ***************
  401. *** 450,464 ****
  402.   {
  403.       XmStringContext context;
  404.       static char *buf = NULL;
  405. !     char *p, *text = NULL;
  406. !     XmStringCharSet charset = (XmStringCharSet)NULL;
  407.       XmStringDirection direction;
  408.       int size;
  409.       int current_len, segment_len;
  410.       XmStringComponentType tag;
  411.       XmStringComponentType u_tag;
  412.       unsigned short u_length;
  413. !     unsigned char *u_value = NULL;
  414.   
  415.       /* whatever buf has grown to, or started from, 
  416.          make it a reasonable size
  417. --- 453,468 ----
  418.   {
  419.       XmStringContext context;
  420.       static char *buf = NULL;
  421. !     char *p, *text;
  422. !     XmStringCharSet charset;
  423.       XmStringDirection direction;
  424. +     Boolean separator;
  425.       int size;
  426.       int current_len, segment_len;
  427.       XmStringComponentType tag;
  428.       XmStringComponentType u_tag;
  429.       unsigned short u_length;
  430. !     unsigned char *u_value;
  431.   
  432.       /* whatever buf has grown to, or started from, 
  433.          make it a reasonable size
  434. ***************
  435. *** 495,501 ****
  436.               strcpy(p, text);
  437.               p += segment_len;
  438.           XtFree(text);
  439. -         text = NULL;
  440.           break;
  441.   
  442.           case XmSTRING_COMPONENT_SEPARATOR:
  443. --- 499,504 ----
  444. ***************
  445. *** 512,536 ****
  446.           default:
  447.           break;
  448.       }
  449. -     if (text)
  450. -         XtFree(text);
  451. -     if (charset)
  452. -         XtFree(charset);
  453. -     if (u_value)
  454. -         XtFree(u_value);
  455. -     text = NULL;
  456. -     charset = (XmStringCharSet)NULL;
  457. -     u_value = NULL;
  458.       }
  459. -     if (text)
  460. -     XtFree(text);
  461. -     if (charset)
  462. -     XtFree(charset);
  463. -     if (u_value)
  464. -     XtFree(u_value);
  465. -     text = NULL;
  466. -     charset = (XmStringCharSet)NULL;
  467. -     u_value = NULL;
  468.   
  469.   #else /* 1 */
  470.       while (XmStringGetNextSegment(context, &text, &charset,
  471. --- 515,521 ----
  472. ***************
  473. *** 670,675 ****
  474. --- 655,662 ----
  475.       String *items;
  476.       static String buf = NULL;
  477.       int n, len, item_count;
  478. +     char *p, *end;
  479. +     char *dummy;
  480.       XmString *xmstrs = *(XmString **) fromVal->addr;
  481.       Arg arg;
  482.       Widget w = *((Widget *) args[0].addr);
  483. ***************
  484. *** 738,743 ****
  485. --- 725,731 ----
  486.   }
  487.   
  488.   
  489.   /*
  490.    *--------------------------------------------------------------
  491.    *
  492. ***************
  493. *** 950,961 ****
  494.       XmString           xm_dir;
  495.       char              *segPtr;
  496.       char              *ptr;
  497. !     int              argc;
  498.       char          **argv;
  499.       int              n;
  500.       Boolean          segment_started = True;
  501.   
  502. !     segPtr = segBuf =  XtMalloc(strlen(inString) + 1);
  503.   
  504.       /* In Motif 2.0 the segment stuff will vanish, leaving
  505.          the component stuff only
  506. --- 938,953 ----
  507.       XmString           xm_dir;
  508.       char              *segPtr;
  509.       char              *ptr;
  510. !     char              *top;
  511. !     int              len;
  512. !     char          separator;
  513. !     int           argc;
  514.       char          **argv;
  515.       int              n;
  516.       Boolean          segment_started = True;
  517.   
  518. !     len = strlen(inString); 
  519. !     segPtr = segBuf =  XtMalloc(len + 1);
  520.   
  521.       /* In Motif 2.0 the segment stuff will vanish, leaving
  522.          the component stuff only
  523. ***************
  524. *** 1015,1021 ****
  525.               segPtr = segBuf;
  526.               ptr++;
  527.               if (*ptr == '{') {
  528. !             /* M(f){font-name} */
  529.               ptr++;
  530.               while (*ptr && *ptr != '}') {
  531.                   *segPtr++ = *ptr++;
  532. --- 1007,1013 ----
  533.               segPtr = segBuf;
  534.               ptr++;
  535.               if (*ptr == '{') {
  536. !             /* @f{font-name} */
  537.               ptr++;
  538.               while (*ptr && *ptr != '}') {
  539.                   *segPtr++ = *ptr++;
  540. ***************
  541. *** 1024,1030 ****
  542.                   ptr++;
  543.               } else
  544.               if (*ptr == '(') {
  545. !             /* M(fXY) - 2 char font name XY */
  546.               ptr++;
  547.               if (ptr[0] && ptr[1]) {
  548.                   *segPtr++ = *ptr++;
  549. --- 1016,1022 ----
  550.                   ptr++;
  551.               } else
  552.               if (*ptr == '(') {
  553. !             /* @fXY - 2 char font name XY */
  554.               ptr++;
  555.               if (ptr[0] && ptr[1]) {
  556.                   *segPtr++ = *ptr++;
  557. ***************
  558. *** 1034,1040 ****
  559.                   *segPtr++ = 'X';
  560.               }
  561.               } else {
  562. !             /* M(fX) - 1 char font name X */
  563.               *segPtr++ = *ptr ? *ptr : 'X';
  564.               }
  565.               *segPtr = '\0';
  566. --- 1026,1032 ----
  567.                   *segPtr++ = 'X';
  568.               }
  569.               } else {
  570. !             /* @fX - 1 char font name X */
  571.               *segPtr++ = *ptr ? *ptr : 'X';
  572.               }
  573.               *segPtr = '\0';
  574. ***************
  575. *** 1188,1203 ****
  576.               /* now make new font */
  577.               ptr++;
  578.               if (*ptr == '{') {
  579. !             /* M(f){font-name} */
  580.               ptr[strlen(ptr) - 1] = '\0'; /* lose } */
  581.               ptr++;
  582.               } else
  583.               if (*ptr == '(') {
  584. !             /* M(fXY) - 2 char font name XY */
  585.               ptr++;
  586.               ptr[2] = '\0'; /* should be anyway */
  587.               } else {
  588. !             /* M(fX) - 1 char font name X */
  589.               ptr[1] = '\0'; /* should be anyway */
  590.               }
  591.               xmstr = XmStringComponentCreate(XmSTRING_COMPONENT_TAG,
  592. --- 1180,1195 ----
  593.               /* now make new font */
  594.               ptr++;
  595.               if (*ptr == '{') {
  596. !             /* @f{font-name} */
  597.               ptr[strlen(ptr) - 1] = '\0'; /* lose } */
  598.               ptr++;
  599.               } else
  600.               if (*ptr == '(') {
  601. !             /* @fXY - 2 char font name XY */
  602.               ptr++;
  603.               ptr[2] = '\0'; /* should be anyway */
  604.               } else {
  605. !             /* @fX - 1 char font name X */
  606.               ptr[1] = '\0'; /* should be anyway */
  607.               }
  608.               xmstr = XmStringComponentCreate(XmSTRING_COMPONENT_TAG,
  609. ***************
  610. *** 1219,1234 ****
  611.               /* now make new font */
  612.               ptr++;
  613.               if (*ptr == '{') {
  614. !             /* M(f){font-name} */
  615.               ptr[strlen(ptr) - 1] = '\0'; /* lose } */
  616.               ptr++;
  617.               } else
  618.               if (*ptr == '(') {
  619. !             /* M(fXY) - 2 char font name XY */
  620.               ptr++;
  621.               ptr[2] = '\0'; /* should be anyway */
  622.               } else {
  623. !             /* M(fX) - 1 char font name X */
  624.               ptr[1] = '\0'; /* should be anyway */
  625.               }
  626.               xmstr = XmStringComponentCreate(
  627. --- 1211,1226 ----
  628.               /* now make new font */
  629.               ptr++;
  630.               if (*ptr == '{') {
  631. !             /* @f{font-name} */
  632.               ptr[strlen(ptr) - 1] = '\0'; /* lose } */
  633.               ptr++;
  634.               } else
  635.               if (*ptr == '(') {
  636. !             /* @fXY - 2 char font name XY */
  637.               ptr++;
  638.               ptr[2] = '\0'; /* should be anyway */
  639.               } else {
  640. !             /* @fX - 1 char font name X */
  641.               ptr[1] = '\0'; /* should be anyway */
  642.               }
  643.               xmstr = XmStringComponentCreate(
  644. ***************
  645. *** 1251,1266 ****
  646.               /* now make new font */
  647.               ptr++;
  648.               if (*ptr == '{') {
  649. !             /* M(f){font-name} */
  650.               ptr[strlen(ptr) - 1] = '\0'; /* lose } */
  651.               ptr++;
  652.               } else
  653.               if (*ptr == '(') {
  654. !             /* M(fXY) - 2 char font name XY */
  655.               ptr++;
  656.               ptr[2] = '\0'; /* should be anyway */
  657.               } else {
  658. !             /* M(fX) - 1 char font name X */
  659.               ptr[1] = '\0'; /* should be anyway */
  660.               }
  661.               xmstr = XmStringComponentCreate(
  662. --- 1243,1258 ----
  663.               /* now make new font */
  664.               ptr++;
  665.               if (*ptr == '{') {
  666. !             /* @f{font-name} */
  667.               ptr[strlen(ptr) - 1] = '\0'; /* lose } */
  668.               ptr++;
  669.               } else
  670.               if (*ptr == '(') {
  671. !             /* @fXY - 2 char font name XY */
  672.               ptr++;
  673.               ptr[2] = '\0'; /* should be anyway */
  674.               } else {
  675. !             /* @fX - 1 char font name X */
  676.               ptr[1] = '\0'; /* should be anyway */
  677.               }
  678.               xmstr = XmStringComponentCreate(
  679. ***************
  680. *** 1391,1396 ****
  681. --- 1383,1389 ----
  682.       XtPointer *destructor_data;
  683.   {
  684.       Tcl_Interp *interp = (Tcl_Interp *) args->addr;
  685. +     Tm_Widget *info;
  686.       char **argv;
  687.       int argc;
  688.       static XmStringTable tbl = NULL;
  689. ***************
  690. *** 1779,1784 ****
  691. --- 1772,1778 ----
  692.       XtPointer *destructor_data;
  693.   {
  694.       static char *buf = NULL;
  695. +     Pixel pixelVal;
  696.       Screen *screen;
  697.       Colormap colormap;
  698.       XColor color;
  699. ***************
  700. *** 1866,1871 ****
  701. --- 1860,1866 ----
  702.       extern Tm_Widget *Tm_HackDragWidgetPtr;
  703.       Tm_Widget *wPtr = Tm_HackDragWidgetPtr;
  704.       Widget w = *((Widget *) args[1].addr);
  705. +     WidgetClass Class = *((WidgetClass *) args[2].addr);
  706.       static XtConvertSelectionProc p = Tm_ConvertProcHandler;
  707.   
  708.       /* set our proc in widgets user data */
  709. ***************
  710. *** 1914,1919 ****
  711. --- 1909,1915 ----
  712.       char *command;
  713.       Tm_Widget *wPtr;
  714.       Widget w = *((Widget *) args[1].addr);
  715. +     WidgetClass Class = *((WidgetClass *) args[2].addr);
  716.       static XtCallbackProc p = Tm_DropProcHandler;
  717.   
  718.      /* note these two hacks because XmRProc
  719. ***************
  720. *** 1971,1983 ****
  721.       char *command;
  722.       extern Tm_Widget *Tm_HackWidgetPtr;
  723.       Tm_Widget *wPtr = Tm_HackWidgetPtr;
  724.       static XtSelectionCallbackProc p = Tm_DropTransferHandler;
  725.   
  726. !     /* set our proc in widgets user data */
  727. !     command = (char *) (fromVal->addr);
  728. !     wPtr->transferProc = XtNewString(command);
  729. !     done(&p, XtCallbackProc);
  730. !     return True;
  731.   #endif
  732.   }
  733.   
  734. --- 1967,1990 ----
  735.       char *command;
  736.       extern Tm_Widget *Tm_HackWidgetPtr;
  737.       Tm_Widget *wPtr = Tm_HackWidgetPtr;
  738. +     Widget w = *((Widget *) args[1].addr);
  739. +     WidgetClass Class = *((WidgetClass *) args[2].addr);
  740.       static XtSelectionCallbackProc p = Tm_DropTransferHandler;
  741.   
  742. ! /*
  743. !     if (Tm_SettingDropTransferResources) {
  744. ! */
  745. !         /* set our proc in widgets user data */
  746. !         command = (char *) (fromVal->addr);
  747. !         wPtr->transferProc = XtNewString(command);
  748. !     
  749. !         done(&p, XtCallbackProc);
  750. !         return True;
  751. ! /*
  752. !     }
  753. !     return False;
  754. ! */
  755.   #endif
  756.   }
  757.   
  758. *** tmCreateWidget.c    Fri May 19 11:54:52 1995
  759. --- ../../tm-1-4.org/src/tmCreateWidget.c    Mon Feb 27 19:40:11 1995
  760. ***************
  761. *** 59,69 ****
  762.   #include <Xm/TextF.h>
  763.   #include <Xm/ToggleB.h>
  764.   #endif  /* MOTIF11 */
  765. - #if (XlibSpecificationRelease >= 5)
  766. - #if !defined( VMS ) && !defined( __vms__ )
  767. - #include <X11/Xmu/Editres.h>
  768. - #endif
  769. - #endif
  770.   
  771.   #if USE_UIL
  772.   #include <Mrm/MrmPublic.h>
  773. --- 59,64 ----
  774. ***************
  775. *** 289,304 ****
  776.       Tcl_CmdInfo parentInfo;
  777.       int n;
  778.    
  779. -     /*
  780. -      * Check if a widget with this name already exists and signal an error.
  781. -      * Overriding an existing (widget-)command with a new one will cause core
  782. -      * dumps when the widgets are destroyed from Xt...
  783. -      */
  784. -     if(Tcl_GetCommandInfo(interp,path,&parentInfo)) {
  785. -     sprintf(interp->result,"widget %.70s already exists.",path);
  786. -     return TCL_ERROR;
  787. -     }
  788.       widgetCmdProc = (Tm_WidgetCmdProc) clientData;
  789.   
  790.       parent = Tm_ParentWidgetFromPath (interp, path);
  791. --- 284,289 ----
  792. ***************
  793. *** 373,378 ****
  794. --- 358,364 ----
  795.       Tcl_GetCommandInfo(interp, wPtr->parent, &parentInfo);
  796.       wPtr -> displayInfo = ((Tm_Widget *) parentInfo.clientData)->displayInfo;
  797.   
  798. +     Tm_StoreWidgetInfo(path, wPtr, interp);
  799.       XtVaSetValues(new, XmNuserData, wPtr, NULL);
  800.   
  801.       Tcl_CreateCommand (interp, path, widgetCmdProc,
  802. ***************
  803. *** 433,438 ****
  804. --- 419,425 ----
  805.       wPtr -> dropProc = NULL;
  806.       wPtr -> displayInfo = ((Tm_Widget *) cmdInfo.clientData)->displayInfo;
  807.   
  808. +     Tm_StoreWidgetInfo(subobject_path, wPtr, interp);
  809.       XtVaSetValues(w, XmNuserData, wPtr, NULL);
  810.   
  811.       /* 
  812. ***************
  813. *** 903,908 ****
  814. --- 890,896 ----
  815.       Tcl_GetCommandInfo(interp, wPtr->parent, &parentInfo);
  816.       wPtr -> displayInfo = ((Tm_Widget *) parentInfo.clientData)->displayInfo;
  817.   
  818. +     Tm_StoreWidgetInfo(dialog_path, wPtr, interp);
  819.       XtVaSetValues(XtParent(new), XmNuserData, wPtr, NULL);
  820.   
  821.       Tcl_CreateCommand (interp, dialog_path, Tm_AnyWidgetCmd,
  822. ***************
  823. *** 921,926 ****
  824. --- 909,915 ----
  825.       wPtr -> dropProc = NULL;
  826.       wPtr -> displayInfo = ((Tm_Widget *) parentInfo.clientData)->displayInfo;
  827.   
  828. +     Tm_StoreWidgetInfo(path, wPtr, interp);
  829.       XtVaSetValues(new, XmNuserData, wPtr, NULL);
  830.   
  831.       Tcl_CreateCommand (interp, path, Tm_AnyWidgetCmd,
  832. ***************
  833. *** 1087,1092 ****
  834. --- 1076,1082 ----
  835.       Tcl_GetCommandInfo(interp, wPtr->parent, &parentInfo);
  836.       wPtr -> displayInfo = ((Tm_Widget *) parentInfo.clientData)->displayInfo;
  837.   
  838. +     Tm_StoreWidgetInfo(sw_path, wPtr, interp);
  839.       XtVaSetValues(XtParent(new), XmNuserData, wPtr, NULL);
  840.   
  841.       Tcl_CreateCommand (interp, sw_path, Tm_AnyWidgetCmd,
  842. ***************
  843. *** 1105,1110 ****
  844. --- 1095,1101 ----
  845.       wPtr -> dropProc = NULL;
  846.       wPtr -> displayInfo = ((Tm_Widget *) parentInfo.clientData)->displayInfo;
  847.   
  848. +     Tm_StoreWidgetInfo(path, wPtr, interp);
  849.       XtVaSetValues(new, XmNuserData, wPtr, NULL);
  850.   
  851.       Tcl_CreateCommand (interp, path, widgetCmdProc,
  852. ***************
  853. *** 1254,1259 ****
  854. --- 1245,1251 ----
  855.       Tcl_GetCommandInfo(interp, wPtr->parent, &parentInfo);
  856.       wPtr -> displayInfo = ((Tm_Widget *) parentInfo.clientData)->displayInfo;
  857.   
  858. +     Tm_StoreWidgetInfo(path, wPtr, interp);
  859.       XtVaSetValues(new, XmNuserData, wPtr, NULL);
  860.   
  861.       Tcl_CreateCommand (interp, path, widgetCmdProc,
  862. ***************
  863. *** 1279,1284 ****
  864. --- 1271,1277 ----
  865.       OptionMenuCreateChild(interp, path, new, "OptionLabel");
  866.       OptionMenuCreateChild(interp, path, new, "OptionButton");
  867.       }
  868.       return TCL_OK;
  869.   }
  870.   
  871. ***************
  872. *** 1379,1384 ****
  873. --- 1372,1378 ----
  874.       Tcl_GetCommandInfo(interp, wPtr->parent, &parentInfo);
  875.       wPtr -> displayInfo = ((Tm_Widget *) parentInfo.clientData)->displayInfo;
  876.   
  877. +     Tm_StoreWidgetInfo(path, wPtr, interp);
  878.       XtVaSetValues(new, XmNuserData, wPtr, NULL);
  879.   
  880.       Tcl_CreateCommand (interp, path, widgetCmdProc,
  881. ***************
  882. *** 1542,1548 ****
  883.   
  884.   
  885.       /* make this and its children into Tm widgets */
  886. !     path = XtMalloc(strlen(parent) + strlen(name) + 2);
  887.       strcpy(path, parent);
  888.       /* special case root widget `.' */
  889.       if (strcmp(parent, ".") != 0) {
  890. --- 1536,1542 ----
  891.   
  892.   
  893.       /* make this and its children into Tm widgets */
  894. !     path = XtMalloc(strlen(parent) + strlen(wname) + 2);
  895.       strcpy(path, parent);
  896.       /* special case root widget `.' */
  897.       if (strcmp(parent, ".") != 0) {
  898. ***************
  899. *** 1608,1613 ****
  900. --- 1602,1609 ----
  901.       widgetCmdProc = (Tm_WidgetCmdProc) clientData;
  902.   
  903.       parent = Tm_ParentWidgetFromPath (interp, path);
  904. +     if (parent == NULL)
  905. +     return TCL_ERROR;
  906.   
  907.       class = topLevelShellWidgetClass;
  908.       argc -= 2;
  909. ***************
  910. *** 1617,1623 ****
  911.       argv++;
  912.       argc--;
  913.       }
  914. !     
  915.       if (argc >= 1 && argv[0][0] != '-') {
  916.       /* assume it is the display value */
  917.       displayInfo = Tm_OpenDisplay(argv[0]);
  918. --- 1613,1619 ----
  919.       argv++;
  920.       argc--;
  921.       }
  922.       if (argc >= 1 && argv[0][0] != '-') {
  923.       /* assume it is the display value */
  924.       displayInfo = Tm_OpenDisplay(argv[0]);
  925. ***************
  926. *** 1628,1647 ****
  927.           argc--;
  928.           argv++;
  929.           parent = displayInfo->toplevel;
  930. -     } else if (strcmp(path,".")==0) {
  931. -     /* if one want's to open the default display again */
  932. -     displayInfo = Tm_OpenDisplay(NULL);
  933. -         if (NULL == displayInfo) {
  934. -         sprintf(interp->result,"cannot open default display.");
  935. -         return TCL_ERROR;
  936. -         }
  937. -         parent = displayInfo->toplevel;
  938.       }
  939. !     if (parent == NULL)
  940. !     return TCL_ERROR;
  941. !     Tcl_ResetResult(interp);
  942. !     if (0==strcmp(path,"."))
  943. !     widgetCmdProc = (Tm_WidgetCmdProc)Tm_RootCmd;
  944.   
  945.       /* make sure class is initialized before using XtConvertAndStore */
  946.       XtInitializeWidgetClass(class);
  947. --- 1624,1631 ----
  948.           argc--;
  949.           argv++;
  950.           parent = displayInfo->toplevel;
  951.       }
  952.   
  953.       /* make sure class is initialized before using XtConvertAndStore */
  954.       XtInitializeWidgetClass(class);
  955. ***************
  956. *** 1681,1693 ****
  957.           wPtr -> displayInfo = ((Tm_Widget *) parentInfo.clientData)->displayInfo;
  958.       }
  959.       Tm_DisplayAddShell(wPtr->displayInfo,wPtr);
  960.       XtVaSetValues(new, XmNuserData, wPtr, NULL);
  961. ! #if (XlibSpecificationRelease >= 5)
  962. ! #if !defined( VMS ) && !defined( __vms__ )
  963. !     /* Add support for editres protocol */
  964. !     XtAddEventHandler(new,(EventMask)0,True,_XEditResCheckMessages,NULL);
  965. ! #endif
  966. ! #endif
  967.       Tcl_CreateCommand (interp, path, widgetCmdProc,
  968.            (ClientData) wPtr, (void (*) ()) NULL);
  969.   
  970. --- 1665,1673 ----
  971.           wPtr -> displayInfo = ((Tm_Widget *) parentInfo.clientData)->displayInfo;
  972.       }
  973.       Tm_DisplayAddShell(wPtr->displayInfo,wPtr);
  974. +     Tm_StoreWidgetInfo(path, wPtr, interp);
  975.       XtVaSetValues(new, XmNuserData, wPtr, NULL);
  976.       Tcl_CreateCommand (interp, path, widgetCmdProc,
  977.            (ClientData) wPtr, (void (*) ()) NULL);
  978.   
  979. *** tmDrag.c    Fri May 19 11:55:02 1995
  980. --- ../../tm-1-4.org/src/tmDrag.c    Tue Feb 28 22:22:45 1995
  981. ***************
  982. *** 250,256 ****
  983.       call_data.closure = (char *) closure;
  984.   
  985.       new_command = Tm_ExpandPercents(wPtr->pathName, w, NULL,
  986. !                     (XtPointer)&call_data, command);
  987.   
  988.       if (Tcl_GlobalEval(interp, new_command) != TCL_OK) {
  989.           msg = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY);
  990. --- 250,256 ----
  991.       call_data.closure = (char *) closure;
  992.   
  993.       new_command = Tm_ExpandPercents(wPtr->pathName, w, NULL,
  994. !                 &call_data, command);
  995.   
  996.       if (Tcl_GlobalEval(interp, new_command) != TCL_OK) {
  997.           msg = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY);
  998. ***************
  999. *** 310,315 ****
  1000. --- 310,317 ----
  1001.       dcPtr -> parent = NULL;
  1002.       dcPtr -> dropProc = NULL;
  1003.   
  1004. +     Tm_StoreWidgetInfo(dcPtr->pathName, dcPtr, dcPtr->interp);
  1005.       Tcl_CreateCommand (dcPtr->interp, dcPtr->pathName, Tm_DragContextCmd,
  1006.                    (ClientData) dcPtr, (void (*) ()) NULL);
  1007.   
  1008. ***************
  1009. *** 356,371 ****
  1010.       Arg args[];
  1011.       int *num_args;
  1012.   {
  1013. - #if !defined( VMS ) && !defined( __vms__ )
  1014.   #ifdef DD_NAMES_CHANGED
  1015.       int num_resources = NumDSResources;
  1016.   #else
  1017.       int num_resources = _XmNumDSResources;
  1018.   #endif
  1019. - #else
  1020. -     int num_resources = 0;
  1021. - #endif /*! VMS*/
  1022.       int num_values = 0;
  1023.       XtArgVal new_value;
  1024.       char *resource;
  1025. --- 358,368 ----
  1026. ***************
  1027. *** 392,398 ****
  1028.           Tm_SettingDropProc = True;
  1029.       }
  1030.   
  1031. - #if !defined( VMS ) && !defined( __vms__ )
  1032.   #ifdef DD_NAMES_CHANGED
  1033.           if (Tm_ConvertValueFromStringQuark(w, DSResources, num_resources,
  1034.   #else
  1035. --- 389,394 ----
  1036. ***************
  1037. *** 401,410 ****
  1038.           resource, value, &new_value)) {
  1039.               XtSetArg(args[num_values], resource, new_value);
  1040.           num_values++;
  1041. !     } 
  1042. !     else 
  1043. ! #endif /* !VMS */
  1044. !     {
  1045.           fprintf(stderr, "Conversion from String to %s failed\n",
  1046.                   resource);
  1047.       }
  1048. --- 397,403 ----
  1049.           resource, value, &new_value)) {
  1050.               XtSetArg(args[num_values], resource, new_value);
  1051.           num_values++;
  1052. !     } else {
  1053.           fprintf(stderr, "Conversion from String to %s failed\n",
  1054.                   resource);
  1055.       }
  1056. *** tmFuncs.h    Fri May 19 13:39:18 1995
  1057. --- ../../tm-1-4.org/src/tmFuncs.h    Wed Mar  1 17:27:36 1995
  1058. ***************
  1059. *** 13,20 ****
  1060.           String appclass));
  1061.   extern Tm_Display *Tm_OpenDisplay _ANSI_ARGS_((char *dispname));
  1062.   extern Tm_Display *Tm_AllocateDisplay _ANSI_ARGS_((void));
  1063. - extern void Tm_DisplayAddShell _ANSI_ARGS_ ((Tm_Display *d,Tm_Widget *p));
  1064. - extern void Tm_DisplayRemoveShell _ANSI_ARGS_ ((Tm_Display *d,Tm_Widget *p));
  1065.   
  1066.   /* Widget creation functions */
  1067.   extern int Tm_AnyCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp,
  1068. --- 13,18 ----
  1069. ***************
  1070. *** 126,134 ****
  1071.   
  1072.   /* resource free functions */
  1073.   extern void Tm_FreeResourceValues _ANSI_ARGS_((void));
  1074. ! extern void Tm_InitFreeResourceList _ANSI_ARGS_((int size));
  1075. ! extern void Tm_AddToFreeResourceList _ANSI_ARGS_((char *data,Tm_FreeProc free));
  1076. ! extern void Tm_FreeResourceList _ANSI_ARGS_((void));
  1077.   
  1078.   /* other funcs */
  1079.   extern void Tm_LoadWidgetCommands _ANSI_ARGS_((Tcl_Interp *interp));
  1080. --- 124,132 ----
  1081.   
  1082.   /* resource free functions */
  1083.   extern void Tm_FreeResourceValues _ANSI_ARGS_((void));
  1084. ! extern void TmInitFreeResourceList _ANSI_ARGS_((int size));
  1085. ! extern void Tm_AddToFreeResourceList _ANSI_ARGS_((char *data,
  1086. !          Tm_FreeProc free));
  1087.   
  1088.   /* other funcs */
  1089.   extern void Tm_LoadWidgetCommands _ANSI_ARGS_((Tcl_Interp *interp));
  1090. ***************
  1091. *** 138,143 ****
  1092. --- 136,143 ----
  1093.            char *path));
  1094.   extern char *Tm_HiddenParentPath _ANSI_ARGS_((char *path));
  1095.   extern char *Tm_ParentPath _ANSI_ARGS_((char *path));
  1096. + extern void Tm_StoreWidgetInfo _ANSI_ARGS_((char *path, Tm_Widget *w,
  1097. +          Tcl_Interp *interp));
  1098.   extern char *Tm_GetGC _ANSI_ARGS_((char *pathName, Tcl_Interp *interp,    
  1099.            Widget w, WidgetClass Class, char **argv, int argc));
  1100.   extern int Tm_GetValues _ANSI_ARGS_((char *pathName, Tcl_Interp *interp,    
  1101. ***************
  1102. *** 177,182 ****
  1103. --- 177,183 ----
  1104.                Widget w, char *name, Tm_Display *displayInfo));
  1105.   
  1106.   
  1107.   /* Converter functions */
  1108.   extern Boolean Tm_CvtStringToWidget _ANSI_ARGS_((Display *display,
  1109.             XrmValuePtr args, Cardinal *num_args,
  1110. ***************
  1111. *** 194,206 ****
  1112.   extern Boolean Tm_ConvertValueFromStringQuark _ANSI_ARGS_((Widget w, 
  1113.                 XtResourceList resources, int num_resources,
  1114.                 char * resource, char *orig_value, XtArgVal *new_value));
  1115. - extern Boolean Tm_ConvertValueToString _ANSI_ARGS_((Widget w,
  1116. -           XtResourceList resources, int num_resources,
  1117. -               char *resource, char **new_value));
  1118. - extern Boolean Tm_ConvertValue _ANSI_ARGS_((Widget w,char *fromType,
  1119. -                         char *fromValue,unsigned int fromSize,
  1120. -                         char *toType,XtArgVal *toValue,
  1121. -                         unsigned int toSize));
  1122.   
  1123.   /* external widgets stuff */
  1124.   
  1125. --- 195,200 ----
  1126. *** tmMain.c    Fri May 19 11:55:08 1995
  1127. --- ../../tm-1-4.org/src/tmMain.c    Mon Feb 27 19:38:25 1995
  1128. ***************
  1129. *** 301,306 ****
  1130. --- 301,308 ----
  1131.       wPtr -> parent = ".";    /* kludge to stop later breakages */
  1132.       wPtr -> displayInfo = &displayInfo;
  1133.   
  1134. +     Tm_StoreWidgetInfo(".", wPtr, interp);
  1135.       Tcl_CreateCommand (interp, ".", Tm_AnyWidgetCmd,
  1136.                    (ClientData) wPtr, (void (*) ()) NULL);
  1137.   
  1138. *** tmResources.c    Fri Mar 31 16:19:59 1995
  1139. --- ../../tm-1-4.org/src/tmResources.c    Thu Mar 16 23:28:03 1995
  1140. ***************
  1141. *** 21,27 ****
  1142.   #include <Xm/Text.h>
  1143.   #include <Xm/DialogS.h>
  1144.   #include <X11/Shell.h>
  1145. - #include <memory.h>
  1146.   
  1147.   /* this is a hack because some converters need info about what
  1148.      types they are converting, and Xt does not give such info.
  1149. --- 21,26 ----
  1150. ***************
  1151. *** 74,80 ****
  1152.           else if (size == sizeof(XtPointer)) *dst = (XtArgVal)*(XtPointer*)src;
  1153.           else if (size == sizeof(char*))    *dst = (XtArgVal)*(char**)src;
  1154.           else if (size == sizeof(XtArgVal)) *dst = *(XtArgVal*)src;
  1155. !         else memcpy((char*)dst,(char*)src,(int)size);
  1156.       }
  1157.   } 
  1158.   
  1159. --- 73,79 ----
  1160.           else if (size == sizeof(XtPointer)) *dst = (XtArgVal)*(XtPointer*)src;
  1161.           else if (size == sizeof(char*))    *dst = (XtArgVal)*(char**)src;
  1162.           else if (size == sizeof(XtArgVal)) *dst = *(XtArgVal*)src;
  1163. !         else bcopy((char*)src, (char*)dst, (int)size);
  1164.       }
  1165.   } 
  1166.   
  1167. ***************
  1168. *** 230,246 ****
  1169.    *
  1170.    *--------------------------------------------------------------
  1171.    */
  1172. - static void freestr(w,cd,ptr)
  1173. -     Widget w;
  1174. -     XtPointer cd;
  1175. -     XtPointer ptr;
  1176. - {
  1177. -     if(NULL!=ptr)
  1178. -     XtFree(ptr);
  1179. - }
  1180.   
  1181.   Boolean
  1182. ! Tm_ConvertValue(w, fromType, fromValue, fromSize, toType, toValue, toSize)
  1183.       Widget w;
  1184.       char *fromType;
  1185.       char *fromValue;
  1186. --- 229,238 ----
  1187.    *
  1188.    *--------------------------------------------------------------
  1189.    */
  1190.   
  1191.   Boolean
  1192. ! Tm_ConvertValue(w, fromType, fromValue, fromSize,
  1193. !            toType, toValue, toSize)
  1194.       Widget w;
  1195.       char *fromType;
  1196.       char *fromValue;
  1197. ***************
  1198. *** 256,267 ****
  1199.       /* do we have to copy the value so Xt dosen't stuff up? */
  1200.       for (n = 0; n < XtNumber(must_copy_resource); n++) {
  1201.           if (strcmp(Tm_Resource, must_copy_resource[n]) == 0) {
  1202. !         char *cp = XtNewString(fromValue);
  1203. !         XtAddCallback(w,XmNdestroyCallback,freestr,(XtPointer)cp);
  1204. !         *toValue = (XtArgVal)cp;
  1205.           return True;
  1206.           }
  1207.       }
  1208.       *toValue = (XtArgVal) fromValue;
  1209.       return TRUE;
  1210.       }
  1211. --- 248,258 ----
  1212.       /* do we have to copy the value so Xt dosen't stuff up? */
  1213.       for (n = 0; n < XtNumber(must_copy_resource); n++) {
  1214.           if (strcmp(Tm_Resource, must_copy_resource[n]) == 0) {
  1215. !         *toValue = (XtArgVal) XtNewString(fromValue);
  1216.           return True;
  1217.           }
  1218.       }
  1219.       *toValue = (XtArgVal) fromValue;
  1220.       return TRUE;
  1221.       }
  1222. ***************
  1223. *** 270,278 ****
  1224.       from.addr = fromValue;
  1225.       to.size = toSize;
  1226.       to.addr = XtMalloc(toSize);
  1227.   
  1228.       if (!XtConvertAndStore(w, fromType, &from, toType, &to))  {
  1229. !     fprintf(stderr, "failed conversion %s to %s\n", fromType, toType);
  1230.       return FALSE;
  1231.       }
  1232.       *toValue = 0;
  1233. --- 261,273 ----
  1234.       from.addr = fromValue;
  1235.       to.size = toSize;
  1236.       to.addr = XtMalloc(toSize);
  1237. + /*
  1238. +     to.addr = NULL;
  1239. + */
  1240.   
  1241.       if (!XtConvertAndStore(w, fromType, &from, toType, &to))  {
  1242. !     fprintf(stderr, "failed conversion %s to %s\n",
  1243. !                 fromType, toType);
  1244.       return FALSE;
  1245.       }
  1246.       *toValue = 0;
  1247. ***************
  1248. *** 400,405 ****
  1249. --- 395,409 ----
  1250.       }
  1251.       *new_value = 0;
  1252.       CopyToArg(converted.addr, new_value, converted.size);
  1253. + /* for now
  1254. +     XtFree(converted.addr);
  1255. + */
  1256. + /*
  1257. +     bzero(new_value, sizeof(XtArgVal));
  1258. +     bcopy(converted.addr, new_value, converted.size);
  1259. +     *new_value = *(XtArgVal *) (converted.addr);
  1260. + */
  1261. +     
  1262.       return TRUE;
  1263.   }
  1264.           
  1265. ***************
  1266. *** 510,517 ****
  1267.       XtFree(from.addr);
  1268.       return FALSE;
  1269.       }
  1270. !     memset((char*)value,0,sizeof(XtArgVal));
  1271. !     memcpy((char*)value,converted.addr,converted.size);
  1272.       
  1273.       XtFree(from.addr);
  1274.       return TRUE;
  1275. --- 514,521 ----
  1276.       XtFree(from.addr);
  1277.       return FALSE;
  1278.       }
  1279. !     bzero((char *) value, sizeof(XtArgVal));
  1280. !     bcopy(converted.addr, (char *) value, converted.size);
  1281.       
  1282.       XtFree(from.addr);
  1283.       return TRUE;
  1284. *** tmUtils.c    Fri May 19 11:55:14 1995
  1285. --- ../../tm-1-4.org/src/tmUtils.c    Mon Feb 27 19:40:35 1995
  1286. ***************
  1287. *** 24,29 ****
  1288. --- 24,62 ----
  1289.   /*
  1290.    *--------------------------------------------------------------
  1291.    *
  1292. +  * Tm_StoreWidgetInfo --
  1293. +  *
  1294. +  *    create a hash table entry for a new widget, with useful
  1295. +  *    info in it.
  1296. +  *
  1297. +  * Results:
  1298. +  *
  1299. +  *    modifies hash table in "interp"
  1300. +  *
  1301. +  * Side effects:
  1302. +  *
  1303. +  *--------------------------------------------------------------
  1304. +  */
  1305. + void
  1306. + Tm_StoreWidgetInfo(path, w, interp)
  1307. +     char *path;
  1308. +     Tm_Widget *w;
  1309. +     Tcl_Interp *interp;
  1310. + {
  1311. + /*
  1312. +     int new;
  1313. +     Tcl_HashEntry *hPtr;
  1314. +     hPtr = Tcl_CreateHashEntry(&WidgetTable, path, &new);
  1315. +     Tcl_SetHashValue(hPtr, (ClientData) w);
  1316. + */
  1317. + }
  1318. + /*
  1319. +  *--------------------------------------------------------------
  1320. +  *
  1321.    * Tm_NameFromPath --
  1322.    *
  1323.    *    find the part of the path after the last '.'
  1324. ***************
  1325. *** 514,519 ****
  1326. --- 547,553 ----
  1327.       wPtr -> dropProc = NULL;
  1328.       wPtr -> displayInfo = displayInfo;
  1329.   
  1330. +     Tm_StoreWidgetInfo(path, wPtr, interp);
  1331.       XtVaSetValues(w, XmNuserData, wPtr, NULL);
  1332.   
  1333.       /* create a different command for each widget type
  1334. *** tmWidget.c    Fri Mar 31 17:19:50 1995
  1335. --- ../../tm-1-4.org/src/tmWidget.c    Mon Feb 27 21:46:52 1995
  1336. ***************
  1337. *** 274,291 ****
  1338.    *--------------------------------------------------------------
  1339.    */
  1340.   
  1341. ! static Boolean
  1342. ! DestroyWidgetInfo(client_data)
  1343.       XtPointer client_data;
  1344.   {
  1345.       Tm_Widget *c_data = (Tm_Widget *) client_data;
  1346.   
  1347. !     Tm_DisplayRemoveShell(c_data->displayInfo,c_data);
  1348. !     Tcl_DeleteCommand(c_data->interp,c_data->pathName);
  1349. !     XtFree(c_data->parent);
  1350. !     XtFree(c_data->pathName);
  1351. !     XtFree((char *)c_data);
  1352. !     return True;
  1353.   }
  1354.   
  1355.   /*
  1356. --- 274,298 ----
  1357.    *--------------------------------------------------------------
  1358.    */
  1359.   
  1360. ! static void
  1361. ! DestroyWidgetInfo(client_data, timer)
  1362.       XtPointer client_data;
  1363. +     XtIntervalId *timer;
  1364.   {
  1365.       Tm_Widget *c_data = (Tm_Widget *) client_data;
  1366. +     Tcl_Interp *interp;
  1367. +     char *path;
  1368. +     char *parent;
  1369.   
  1370. !     interp = c_data->interp;
  1371. !     path = c_data->pathName;
  1372. !     parent = c_data->parent;
  1373. !     if(XtIsShell(c_data->widget))
  1374. !     Tm_DisplayRemoveShell(c_data->displayInfo,c_data);
  1375. !     XtFree(parent);
  1376. !     XtFree(path);
  1377. !     XtFree((char *) c_data);
  1378.   }
  1379.   
  1380.   /*
  1381. ***************
  1382. *** 312,318 ****
  1383.       XtPointer client_data;
  1384.       XtPointer call_data;
  1385.   {
  1386. !     XtAppAddWorkProc(XtWidgetToApplicationContext(w),DestroyWidgetInfo,client_data);
  1387.   }
  1388.   
  1389.   
  1390. --- 319,325 ----
  1391.       XtPointer client_data;
  1392.       XtPointer call_data;
  1393.   {
  1394. !     XtAppAddTimeOut(XtWidgetToApplicationContext(w),0,DestroyWidgetInfo,client_data);
  1395.   }
  1396.   
  1397.   
  1398.