home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-06-29 | 38.4 KB | 1,427 lines |
- *** tmAppInit.c Fri May 19 11:50:08 1995
- --- ../../tm-1-4.org/src/tmAppInit.c Mon Feb 27 19:38:24 1995
- ***************
- *** 119,127 ****
- }
-
- moatinterp = interp;
- ! #if defined(__sun__) && !defined(__sysv__)
- ! on_exit(cleanup,0);
- ! #else
- atexit(cleanup);
- #endif
-
- --- 119,125 ----
- }
-
- moatinterp = interp;
- ! #ifdef __STDC__
- atexit(cleanup);
- #endif
-
- ***************
- *** 140,145 ****
- tcl_RcFileName = "tmrc";
- return TCL_OK;
- }
- -
- -
- -
- --- 138,140 ----
- *** tmBasic.c Fri May 19 11:54:22 1995
- --- ../../tm-1-4.org/src/tmBasic.c Mon Feb 27 19:40:00 1995
- ***************
- *** 301,311 ****
- char *name;
- {
- Tm_Display *d;
- !
- ! if (NULL!=name)
- ! for(d = tm_display_list; NULL!=d; d = d->next)
- ! if(0 == strcmp(name,XDisplayString(d->display)))
- ! return d;
- return NULL;
- }
-
- --- 301,310 ----
- char *name;
- {
- Tm_Display *d;
- !
- ! for(d = tm_display_list; NULL!=d; d = d->next)
- ! if(0 == strcmp(name,XDisplayString(d->display)))
- ! return d;
- return NULL;
- }
-
- ***************
- *** 379,392 ****
- p->widget,XDisplayString(d->display));
- #endif
- for(i=0; i<d->numshellwidgets; ++i) {
- ! if(NULL!=d->shellwidgets[i]) {
- ! if(p==d->shellwidgets[i]) {
- ! d->shellwidgets[i] = NULL;
- ! if(cnt)
- ! return;
- ! } else
- ! ++cnt;
- ! }
- }
- if(!cnt) {
- Tm_Display *p = tm_display_list;
- --- 378,390 ----
- p->widget,XDisplayString(d->display));
- #endif
- for(i=0; i<d->numshellwidgets; ++i) {
- ! if(p==d->shellwidgets[i]) {
- ! d->shellwidgets[i] = NULL;
- ! if(cnt)
- ! return;
- ! } else
- ! if(NULL!=d->shellwidgets[i])
- ! ++cnt;
- }
- if(!cnt) {
- Tm_Display *p = tm_display_list;
- ***************
- *** 466,471 ****
- --- 464,487 ----
- Tcl_SplitList(interp, app_argv_str, &app_argc, &app_argv);
- old_app_argc = app_argc;
-
- + #if 0
- + /* don't copy - we don't free this after all! */
- + /* bug workaround */
- + for (n = 0; n < app_argc; n++) {
- + if (app_argv[n][0] == '-') {
- + if (strcmp(app_argv[n], "-geometry") == 0) {
- + /* the Intrinsics don't copy this resource (do they?)
- + so make our own copy, 'cos it gets freed later, trashing
- + the value
- + */
- + n++;
- + app_argv[n] = XtNewString(app_argv[n]);
- + }
- + }
- + }
- + #endif
- +
- +
- for (n = 1; n < argc; n++) {
- if (argv[n][0] == '-') {
- if (strcmp(argv[n], "-appContext") == 0) {
- ***************
- *** 553,558 ****
- --- 569,575 ----
- XtGetApplicationNameAndClass(XtDisplay(toplevel),
- &applicationname,&applicationclass);
-
- +
- wPtr = (Tm_Widget *) XtMalloc (sizeof (Tm_Widget));
- wPtr -> interp = interp;
- wPtr -> widget = toplevel;
- ***************
- *** 560,579 ****
- wPtr -> parent = "."; /* kludge to stop later breakages */
- wPtr -> displayInfo = displayInfo;
-
- ! Tcl_CreateCommand(interp, ".", Tm_RootCmd,
- ! (ClientData) wPtr, (void (*) ()) NULL);
- ! Tm_DisplayAddShell(displayInfo,wPtr);
- XtAddCallback(toplevel, XmNdestroyCallback, Tm_DestroyWidgetHandler, wPtr);
- Tm_RegisterConverters(interp, appContext);
-
- /* now try to create the "send" command */
- Tm_RegisterSendCmd(interp, app_argv[0], toplevel);
-
- ! /*
- ! * don't free this - the AppShell resource XmNargv points to the
- ! * set of strings contained in app_argv!
- ! free((char *) app_argv);
- ! */
-
- /* register the tear-off menu converter */
- # ifndef MOTIF11
- --- 577,598 ----
- wPtr -> parent = "."; /* kludge to stop later breakages */
- wPtr -> displayInfo = displayInfo;
-
- ! Tm_StoreWidgetInfo(".", wPtr, interp);
- !
- ! Tcl_CreateCommand (interp, ".", Tm_RootCmd,
- ! (ClientData) wPtr, (void (*) ()) NULL);
- !
- XtAddCallback(toplevel, XmNdestroyCallback, Tm_DestroyWidgetHandler, wPtr);
- +
- Tm_RegisterConverters(interp, appContext);
-
- /* now try to create the "send" command */
- Tm_RegisterSendCmd(interp, app_argv[0], toplevel);
-
- ! /* don't free this - the AppShell resource XmNargv points to the
- ! set of strings contained in app_argv!
- ! free((char *) app_argv);
- ! */
-
- /* register the tear-off menu converter */
- # ifndef MOTIF11
- ***************
- *** 616,624 ****
- static char initCmd[] =
- #if defined TMUSEINITFILE
- "if [file exists $tm_library/init_tclMotif.tcl] {\n\
- ! source $tm_library/init_tclMotif.tcl;\n\
- ! } elseif [file exists $tm_library/init_tclmotif.tcl] {\n\
- ! source $tm_library/init_tclmotif.tcl;\n\
- }";
- #else
- "global tclMotif_unknown\n\
- --- 635,641 ----
- static char initCmd[] =
- #if defined TMUSEINITFILE
- "if [file exists $tm_library/init_tclMotif.tcl] {\n\
- ! source $tm_library/init_tclMotif.tcl\n\
- }";
- #else
- "global tclMotif_unknown\n\
- ***************
- *** 631,655 ****
- \n\
- rename unknown $tclMotif_unknown\n\
- \n\
- ! proc unknown {args} {\n\
- global tclMotif_unknown\n\
- \n\
- - set name [lindex $args 0];\n\
- set cmds [info commands $name]\n\
- set len [llength $cmds]\n\
- if {$len == 0} {\n\
- # no match, pass to old unknown\n\
- ! return [uplevel 1 $tclMotif_unknown $args];\n\
- }\n\
- if {$len > 1} {\n\
- error \"non-unique command \\\"$name\\\" matches \\\"$cmds\\\"\"\n\
- }\n\
- \n\
- # unique abbreviation:\n\
- ! return [uplevel $cmds [lrange $args 1 end]]\n\
- }\n\
- ";
- ! #endif /* TMUSEINITFILE */
- char *libDir;
- char buf[32];
-
- --- 648,672 ----
- \n\
- rename unknown $tclMotif_unknown\n\
- \n\
- ! proc unknown {name args} {\n\
- global tclMotif_unknown\n\
- \n\
- set cmds [info commands $name]\n\
- set len [llength $cmds]\n\
- if {$len == 0} {\n\
- # no match, pass to old unknown\n\
- ! set cmd \"uplevel 1 $tclMotif_unknown $name $args\"\n\
- ! eval $cmd\n\
- }\n\
- if {$len > 1} {\n\
- error \"non-unique command \\\"$name\\\" matches \\\"$cmds\\\"\"\n\
- }\n\
- \n\
- # unique abbreviation:\n\
- ! return [uplevel $cmds $args]\n\
- }\n\
- ";
- ! #endif /* 0 */
- char *libDir;
- char buf[32];
-
- *** tmCommands.c Wed May 17 09:37:41 1995
- --- ../../tm-1-4.org/src/tmCommands.c Wed Mar 1 16:53:22 1995
- ***************
- *** 244,249 ****
- --- 244,252 ----
- if ((c == 'd') && (strcmp(argv[1], "destroyWidget") == 0)) {
- /* destroy - most stuff done in DestroyWidgetHandler */
- XtDestroyWidget(wPtr->widget);
- +
- + /* must delete tcl command now, though, so we can't use it again */
- + Tcl_DeleteCommand(interp, wPtr->pathName);
- } else
-
- #ifndef MOTIF11
- ***************
- *** 1254,1264 ****
- int filenum;
- char *end;
-
- - #if defined( VMS ) || defined( __vms__ )
- - sprintf(interp->result, "%s not supported under OVMS", argv[1]);
- - return TCL_ERROR;
- - #endif
- -
- if (argc < 4) {
- sprintf(interp->result, "wrong # args: should be \"%.50s fileID \
- permissions tcl_code", argv[0]);
- --- 1257,1262 ----
- ***************
- *** 1375,1381 ****
- char **largv;
- #if USE_UIL
- MrmHierarchy *hierarchy;
- - Cardinal mrm_res;
-
- if (argc < 3) {
- sprintf(interp->result,
- --- 1373,1378 ----
- ***************
- *** 1387,1421 ****
- hierarchy = &(wPtr->displayInfo->hierarchy);
-
- Tcl_SplitList(interp, argv[2], &largc, &largv);
- ! #if defined( VMS ) || defined( __vms__ )
- ! {
- ! int i;
- ! char **exp_files = malloc(sizeof(char*)*largc);
- ! Tcl_DString *dstrings = malloc(sizeof(Tcl_DString)*largc);
- ! for (i=0;i<largc;++i)
- ! exp_files[i] = Tcl_TildeSubst(interp,largv[i],&dstrings[i]);
- !
- ! mrm_res = MrmOpenHierarchyPerDisplay(XtDisplay(w), largc, exp_files,
- ! NULL, hierarchy);
- ! for (i=0;i<largc;++i)
- ! Tcl_DStringFree(&dstrings[i]);
- ! free(exp_files);
- ! free(dstrings);
- ! }
- ! #else
- ! mrm_res = MrmOpenHierarchyPerDisplay(XtDisplay(w), largc, largv,
- ! NULL, hierarchy);
- ! #endif
- ! if (mrm_res != MrmSUCCESS) {
- ! if (largv)
- ! free(largv);
- ! sprintf(interp->result,"failed to open Mrm hierarchy");
- return TCL_ERROR;
- }
- ! free(largv);
- return TCL_OK;
- #else
- ! sprintf(interp->result,"This version of moat not compiled with UIL support");
- return TCL_ERROR;
- #endif /* USE_UIL */
-
- --- 1384,1398 ----
- hierarchy = &(wPtr->displayInfo->hierarchy);
-
- Tcl_SplitList(interp, argv[2], &largc, &largv);
- ! if (MrmOpenHierarchyPerDisplay(XtDisplay(w), largc, largv, NULL, hierarchy) !=
- ! MrmSUCCESS) {
- ! sprintf(interp->result, "failed to open Mrm hierarchy");
- return TCL_ERROR;
- }
- ! free(argv);
- return TCL_OK;
- #else
- ! sprintf(interp->result, "This version of moat not compiled with UIL support");
- return TCL_ERROR;
- #endif /* USE_UIL */
-
- ***************
- *** 2926,2933 ****
-
- if (argc < 4) {
- sprintf(interp->result,
- ! "wrong # args: should be \"%.50s addWMProtocolCallback atom command... \"",
- ! argv[0]);
- return TCL_ERROR;
- }
-
- --- 2903,2910 ----
-
- if (argc < 4) {
- sprintf(interp->result,
- ! "wrong # args: should be \"%.50s addWMProtocolCallback atom command... \"",
- ! argv[0]);
- return TCL_ERROR;
- }
-
- *** tmConverters.c Mon Apr 3 08:58:52 1995
- --- ../../tm-1-4.org/src/tmConverters.c Mon Feb 27 21:48:03 1995
- ***************
- *** 19,25 ****
- * Abteilung fuer Wirtschaftsinformatik
- * Augasse 2-6,
- * A-1090 Vienna, Austria
- ! * neumannM(wu)-wien.ac.at, nusserM(wu)-wien.ac.at
-
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- --- 19,25 ----
- * Abteilung fuer Wirtschaftsinformatik
- * Augasse 2-6,
- * A-1090 Vienna, Austria
- ! * neumann@wu-wien.ac.at, nusser@wu-wien.ac.at
-
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- ***************
- *** 91,96 ****
- --- 91,97 ----
- #ifndef MOTIF11
- XmRepTypeId id;
- XmRepTypeList start, list;
- + int n;
-
- start = list = XmRepTypeGetRegistered();
-
- ***************
- *** 301,308 ****
- end = buf;
- for (n = 0; n < final_num_children; n++) {
- p = widgetNames[n];
- ! while ((*end++ = *p++))
- ! ;
- *(end - 1) = ',';
- *end++ = ' ';
- }
- --- 302,309 ----
- end = buf;
- for (n = 0; n < final_num_children; n++) {
- p = widgetNames[n];
- ! while (*end++ = *p++)
- ! ;
- *(end - 1) = ',';
- *end++ = ' ';
- }
- ***************
- *** 396,403 ****
- --- 397,406 ----
- char **argv, **argvv;
- int argc, argcc;
- int n;
- + static unsigned char status;
- static XmDropTransferEntryRec transferEntries[32];
- static XmDropTransferEntryRec *p;
- + Tm_Widget *wPtr;
- Tcl_Interp *interp = (Tcl_Interp *) args->addr;
-
- buf = (char *) (fromVal->addr);
- ***************
- *** 450,464 ****
- {
- XmStringContext context;
- static char *buf = NULL;
- ! char *p, *text = NULL;
- ! XmStringCharSet charset = (XmStringCharSet)NULL;
- XmStringDirection direction;
- int size;
- int current_len, segment_len;
- XmStringComponentType tag;
- XmStringComponentType u_tag;
- unsigned short u_length;
- ! unsigned char *u_value = NULL;
-
- /* whatever buf has grown to, or started from,
- make it a reasonable size
- --- 453,468 ----
- {
- XmStringContext context;
- static char *buf = NULL;
- ! char *p, *text;
- ! XmStringCharSet charset;
- XmStringDirection direction;
- + Boolean separator;
- int size;
- int current_len, segment_len;
- XmStringComponentType tag;
- XmStringComponentType u_tag;
- unsigned short u_length;
- ! unsigned char *u_value;
-
- /* whatever buf has grown to, or started from,
- make it a reasonable size
- ***************
- *** 495,501 ****
- strcpy(p, text);
- p += segment_len;
- XtFree(text);
- - text = NULL;
- break;
-
- case XmSTRING_COMPONENT_SEPARATOR:
- --- 499,504 ----
- ***************
- *** 512,536 ****
- default:
- break;
- }
- - if (text)
- - XtFree(text);
- - if (charset)
- - XtFree(charset);
- - if (u_value)
- - XtFree(u_value);
- - text = NULL;
- - charset = (XmStringCharSet)NULL;
- - u_value = NULL;
- }
- - if (text)
- - XtFree(text);
- - if (charset)
- - XtFree(charset);
- - if (u_value)
- - XtFree(u_value);
- - text = NULL;
- - charset = (XmStringCharSet)NULL;
- - u_value = NULL;
-
- #else /* 1 */
- while (XmStringGetNextSegment(context, &text, &charset,
- --- 515,521 ----
- ***************
- *** 670,675 ****
- --- 655,662 ----
- String *items;
- static String buf = NULL;
- int n, len, item_count;
- + char *p, *end;
- + char *dummy;
- XmString *xmstrs = *(XmString **) fromVal->addr;
- Arg arg;
- Widget w = *((Widget *) args[0].addr);
- ***************
- *** 738,743 ****
- --- 725,731 ----
- }
-
-
- +
- /*
- *--------------------------------------------------------------
- *
- ***************
- *** 950,961 ****
- XmString xm_dir;
- char *segPtr;
- char *ptr;
- ! int argc;
- char **argv;
- int n;
- Boolean segment_started = True;
-
- ! segPtr = segBuf = XtMalloc(strlen(inString) + 1);
-
- /* In Motif 2.0 the segment stuff will vanish, leaving
- the component stuff only
- --- 938,953 ----
- XmString xm_dir;
- char *segPtr;
- char *ptr;
- ! char *top;
- ! int len;
- ! char separator;
- ! int argc;
- char **argv;
- int n;
- Boolean segment_started = True;
-
- ! len = strlen(inString);
- ! segPtr = segBuf = XtMalloc(len + 1);
-
- /* In Motif 2.0 the segment stuff will vanish, leaving
- the component stuff only
- ***************
- *** 1015,1021 ****
- segPtr = segBuf;
- ptr++;
- if (*ptr == '{') {
- ! /* M(f){font-name} */
- ptr++;
- while (*ptr && *ptr != '}') {
- *segPtr++ = *ptr++;
- --- 1007,1013 ----
- segPtr = segBuf;
- ptr++;
- if (*ptr == '{') {
- ! /* @f{font-name} */
- ptr++;
- while (*ptr && *ptr != '}') {
- *segPtr++ = *ptr++;
- ***************
- *** 1024,1030 ****
- ptr++;
- } else
- if (*ptr == '(') {
- ! /* M(fXY) - 2 char font name XY */
- ptr++;
- if (ptr[0] && ptr[1]) {
- *segPtr++ = *ptr++;
- --- 1016,1022 ----
- ptr++;
- } else
- if (*ptr == '(') {
- ! /* @fXY - 2 char font name XY */
- ptr++;
- if (ptr[0] && ptr[1]) {
- *segPtr++ = *ptr++;
- ***************
- *** 1034,1040 ****
- *segPtr++ = 'X';
- }
- } else {
- ! /* M(fX) - 1 char font name X */
- *segPtr++ = *ptr ? *ptr : 'X';
- }
- *segPtr = '\0';
- --- 1026,1032 ----
- *segPtr++ = 'X';
- }
- } else {
- ! /* @fX - 1 char font name X */
- *segPtr++ = *ptr ? *ptr : 'X';
- }
- *segPtr = '\0';
- ***************
- *** 1188,1203 ****
- /* now make new font */
- ptr++;
- if (*ptr == '{') {
- ! /* M(f){font-name} */
- ptr[strlen(ptr) - 1] = '\0'; /* lose } */
- ptr++;
- } else
- if (*ptr == '(') {
- ! /* M(fXY) - 2 char font name XY */
- ptr++;
- ptr[2] = '\0'; /* should be anyway */
- } else {
- ! /* M(fX) - 1 char font name X */
- ptr[1] = '\0'; /* should be anyway */
- }
- xmstr = XmStringComponentCreate(XmSTRING_COMPONENT_TAG,
- --- 1180,1195 ----
- /* now make new font */
- ptr++;
- if (*ptr == '{') {
- ! /* @f{font-name} */
- ptr[strlen(ptr) - 1] = '\0'; /* lose } */
- ptr++;
- } else
- if (*ptr == '(') {
- ! /* @fXY - 2 char font name XY */
- ptr++;
- ptr[2] = '\0'; /* should be anyway */
- } else {
- ! /* @fX - 1 char font name X */
- ptr[1] = '\0'; /* should be anyway */
- }
- xmstr = XmStringComponentCreate(XmSTRING_COMPONENT_TAG,
- ***************
- *** 1219,1234 ****
- /* now make new font */
- ptr++;
- if (*ptr == '{') {
- ! /* M(f){font-name} */
- ptr[strlen(ptr) - 1] = '\0'; /* lose } */
- ptr++;
- } else
- if (*ptr == '(') {
- ! /* M(fXY) - 2 char font name XY */
- ptr++;
- ptr[2] = '\0'; /* should be anyway */
- } else {
- ! /* M(fX) - 1 char font name X */
- ptr[1] = '\0'; /* should be anyway */
- }
- xmstr = XmStringComponentCreate(
- --- 1211,1226 ----
- /* now make new font */
- ptr++;
- if (*ptr == '{') {
- ! /* @f{font-name} */
- ptr[strlen(ptr) - 1] = '\0'; /* lose } */
- ptr++;
- } else
- if (*ptr == '(') {
- ! /* @fXY - 2 char font name XY */
- ptr++;
- ptr[2] = '\0'; /* should be anyway */
- } else {
- ! /* @fX - 1 char font name X */
- ptr[1] = '\0'; /* should be anyway */
- }
- xmstr = XmStringComponentCreate(
- ***************
- *** 1251,1266 ****
- /* now make new font */
- ptr++;
- if (*ptr == '{') {
- ! /* M(f){font-name} */
- ptr[strlen(ptr) - 1] = '\0'; /* lose } */
- ptr++;
- } else
- if (*ptr == '(') {
- ! /* M(fXY) - 2 char font name XY */
- ptr++;
- ptr[2] = '\0'; /* should be anyway */
- } else {
- ! /* M(fX) - 1 char font name X */
- ptr[1] = '\0'; /* should be anyway */
- }
- xmstr = XmStringComponentCreate(
- --- 1243,1258 ----
- /* now make new font */
- ptr++;
- if (*ptr == '{') {
- ! /* @f{font-name} */
- ptr[strlen(ptr) - 1] = '\0'; /* lose } */
- ptr++;
- } else
- if (*ptr == '(') {
- ! /* @fXY - 2 char font name XY */
- ptr++;
- ptr[2] = '\0'; /* should be anyway */
- } else {
- ! /* @fX - 1 char font name X */
- ptr[1] = '\0'; /* should be anyway */
- }
- xmstr = XmStringComponentCreate(
- ***************
- *** 1391,1396 ****
- --- 1383,1389 ----
- XtPointer *destructor_data;
- {
- Tcl_Interp *interp = (Tcl_Interp *) args->addr;
- + Tm_Widget *info;
- char **argv;
- int argc;
- static XmStringTable tbl = NULL;
- ***************
- *** 1779,1784 ****
- --- 1772,1778 ----
- XtPointer *destructor_data;
- {
- static char *buf = NULL;
- + Pixel pixelVal;
- Screen *screen;
- Colormap colormap;
- XColor color;
- ***************
- *** 1866,1871 ****
- --- 1860,1866 ----
- extern Tm_Widget *Tm_HackDragWidgetPtr;
- Tm_Widget *wPtr = Tm_HackDragWidgetPtr;
- Widget w = *((Widget *) args[1].addr);
- + WidgetClass Class = *((WidgetClass *) args[2].addr);
- static XtConvertSelectionProc p = Tm_ConvertProcHandler;
-
- /* set our proc in widgets user data */
- ***************
- *** 1914,1919 ****
- --- 1909,1915 ----
- char *command;
- Tm_Widget *wPtr;
- Widget w = *((Widget *) args[1].addr);
- + WidgetClass Class = *((WidgetClass *) args[2].addr);
- static XtCallbackProc p = Tm_DropProcHandler;
-
- /* note these two hacks because XmRProc
- ***************
- *** 1971,1983 ****
- char *command;
- extern Tm_Widget *Tm_HackWidgetPtr;
- Tm_Widget *wPtr = Tm_HackWidgetPtr;
- static XtSelectionCallbackProc p = Tm_DropTransferHandler;
-
- ! /* set our proc in widgets user data */
- ! command = (char *) (fromVal->addr);
- ! wPtr->transferProc = XtNewString(command);
- ! done(&p, XtCallbackProc);
- ! return True;
- #endif
- }
-
- --- 1967,1990 ----
- char *command;
- extern Tm_Widget *Tm_HackWidgetPtr;
- Tm_Widget *wPtr = Tm_HackWidgetPtr;
- + Widget w = *((Widget *) args[1].addr);
- + WidgetClass Class = *((WidgetClass *) args[2].addr);
- static XtSelectionCallbackProc p = Tm_DropTransferHandler;
-
- ! /*
- ! if (Tm_SettingDropTransferResources) {
- ! */
- ! /* set our proc in widgets user data */
- ! command = (char *) (fromVal->addr);
- ! wPtr->transferProc = XtNewString(command);
- !
- ! done(&p, XtCallbackProc);
- !
- ! return True;
- ! /*
- ! }
- ! return False;
- ! */
- #endif
- }
-
- *** tmCreateWidget.c Fri May 19 11:54:52 1995
- --- ../../tm-1-4.org/src/tmCreateWidget.c Mon Feb 27 19:40:11 1995
- ***************
- *** 59,69 ****
- #include <Xm/TextF.h>
- #include <Xm/ToggleB.h>
- #endif /* MOTIF11 */
- - #if (XlibSpecificationRelease >= 5)
- - #if !defined( VMS ) && !defined( __vms__ )
- - #include <X11/Xmu/Editres.h>
- - #endif
- - #endif
-
- #if USE_UIL
- #include <Mrm/MrmPublic.h>
- --- 59,64 ----
- ***************
- *** 289,304 ****
- Tcl_CmdInfo parentInfo;
- int n;
-
- - /*
- - * Check if a widget with this name already exists and signal an error.
- - * Overriding an existing (widget-)command with a new one will cause core
- - * dumps when the widgets are destroyed from Xt...
- - */
- - if(Tcl_GetCommandInfo(interp,path,&parentInfo)) {
- - sprintf(interp->result,"widget %.70s already exists.",path);
- - return TCL_ERROR;
- - }
- -
- widgetCmdProc = (Tm_WidgetCmdProc) clientData;
-
- parent = Tm_ParentWidgetFromPath (interp, path);
- --- 284,289 ----
- ***************
- *** 373,378 ****
- --- 358,364 ----
- Tcl_GetCommandInfo(interp, wPtr->parent, &parentInfo);
- wPtr -> displayInfo = ((Tm_Widget *) parentInfo.clientData)->displayInfo;
-
- + Tm_StoreWidgetInfo(path, wPtr, interp);
- XtVaSetValues(new, XmNuserData, wPtr, NULL);
-
- Tcl_CreateCommand (interp, path, widgetCmdProc,
- ***************
- *** 433,438 ****
- --- 419,425 ----
- wPtr -> dropProc = NULL;
- wPtr -> displayInfo = ((Tm_Widget *) cmdInfo.clientData)->displayInfo;
-
- + Tm_StoreWidgetInfo(subobject_path, wPtr, interp);
- XtVaSetValues(w, XmNuserData, wPtr, NULL);
-
- /*
- ***************
- *** 903,908 ****
- --- 890,896 ----
- Tcl_GetCommandInfo(interp, wPtr->parent, &parentInfo);
- wPtr -> displayInfo = ((Tm_Widget *) parentInfo.clientData)->displayInfo;
-
- + Tm_StoreWidgetInfo(dialog_path, wPtr, interp);
- XtVaSetValues(XtParent(new), XmNuserData, wPtr, NULL);
-
- Tcl_CreateCommand (interp, dialog_path, Tm_AnyWidgetCmd,
- ***************
- *** 921,926 ****
- --- 909,915 ----
- wPtr -> dropProc = NULL;
- wPtr -> displayInfo = ((Tm_Widget *) parentInfo.clientData)->displayInfo;
-
- + Tm_StoreWidgetInfo(path, wPtr, interp);
- XtVaSetValues(new, XmNuserData, wPtr, NULL);
-
- Tcl_CreateCommand (interp, path, Tm_AnyWidgetCmd,
- ***************
- *** 1087,1092 ****
- --- 1076,1082 ----
- Tcl_GetCommandInfo(interp, wPtr->parent, &parentInfo);
- wPtr -> displayInfo = ((Tm_Widget *) parentInfo.clientData)->displayInfo;
-
- + Tm_StoreWidgetInfo(sw_path, wPtr, interp);
- XtVaSetValues(XtParent(new), XmNuserData, wPtr, NULL);
-
- Tcl_CreateCommand (interp, sw_path, Tm_AnyWidgetCmd,
- ***************
- *** 1105,1110 ****
- --- 1095,1101 ----
- wPtr -> dropProc = NULL;
- wPtr -> displayInfo = ((Tm_Widget *) parentInfo.clientData)->displayInfo;
-
- + Tm_StoreWidgetInfo(path, wPtr, interp);
- XtVaSetValues(new, XmNuserData, wPtr, NULL);
-
- Tcl_CreateCommand (interp, path, widgetCmdProc,
- ***************
- *** 1254,1259 ****
- --- 1245,1251 ----
- Tcl_GetCommandInfo(interp, wPtr->parent, &parentInfo);
- wPtr -> displayInfo = ((Tm_Widget *) parentInfo.clientData)->displayInfo;
-
- + Tm_StoreWidgetInfo(path, wPtr, interp);
- XtVaSetValues(new, XmNuserData, wPtr, NULL);
-
- Tcl_CreateCommand (interp, path, widgetCmdProc,
- ***************
- *** 1279,1284 ****
- --- 1271,1277 ----
- OptionMenuCreateChild(interp, path, new, "OptionLabel");
- OptionMenuCreateChild(interp, path, new, "OptionButton");
- }
- +
- return TCL_OK;
- }
-
- ***************
- *** 1379,1384 ****
- --- 1372,1378 ----
- Tcl_GetCommandInfo(interp, wPtr->parent, &parentInfo);
- wPtr -> displayInfo = ((Tm_Widget *) parentInfo.clientData)->displayInfo;
-
- + Tm_StoreWidgetInfo(path, wPtr, interp);
- XtVaSetValues(new, XmNuserData, wPtr, NULL);
-
- Tcl_CreateCommand (interp, path, widgetCmdProc,
- ***************
- *** 1542,1548 ****
-
-
- /* make this and its children into Tm widgets */
- ! path = XtMalloc(strlen(parent) + strlen(name) + 2);
- strcpy(path, parent);
- /* special case root widget `.' */
- if (strcmp(parent, ".") != 0) {
- --- 1536,1542 ----
-
-
- /* make this and its children into Tm widgets */
- ! path = XtMalloc(strlen(parent) + strlen(wname) + 2);
- strcpy(path, parent);
- /* special case root widget `.' */
- if (strcmp(parent, ".") != 0) {
- ***************
- *** 1608,1613 ****
- --- 1602,1609 ----
- widgetCmdProc = (Tm_WidgetCmdProc) clientData;
-
- parent = Tm_ParentWidgetFromPath (interp, path);
- + if (parent == NULL)
- + return TCL_ERROR;
-
- class = topLevelShellWidgetClass;
- argc -= 2;
- ***************
- *** 1617,1623 ****
- argv++;
- argc--;
- }
- !
- if (argc >= 1 && argv[0][0] != '-') {
- /* assume it is the display value */
- displayInfo = Tm_OpenDisplay(argv[0]);
- --- 1613,1619 ----
- argv++;
- argc--;
- }
- !
- if (argc >= 1 && argv[0][0] != '-') {
- /* assume it is the display value */
- displayInfo = Tm_OpenDisplay(argv[0]);
- ***************
- *** 1628,1647 ****
- argc--;
- argv++;
- parent = displayInfo->toplevel;
- - } else if (strcmp(path,".")==0) {
- - /* if one want's to open the default display again */
- - displayInfo = Tm_OpenDisplay(NULL);
- - if (NULL == displayInfo) {
- - sprintf(interp->result,"cannot open default display.");
- - return TCL_ERROR;
- - }
- - parent = displayInfo->toplevel;
- }
- ! if (parent == NULL)
- ! return TCL_ERROR;
- ! Tcl_ResetResult(interp);
- ! if (0==strcmp(path,"."))
- ! widgetCmdProc = (Tm_WidgetCmdProc)Tm_RootCmd;
-
- /* make sure class is initialized before using XtConvertAndStore */
- XtInitializeWidgetClass(class);
- --- 1624,1631 ----
- argc--;
- argv++;
- parent = displayInfo->toplevel;
- }
- !
-
- /* make sure class is initialized before using XtConvertAndStore */
- XtInitializeWidgetClass(class);
- ***************
- *** 1681,1693 ****
- wPtr -> displayInfo = ((Tm_Widget *) parentInfo.clientData)->displayInfo;
- }
- Tm_DisplayAddShell(wPtr->displayInfo,wPtr);
- XtVaSetValues(new, XmNuserData, wPtr, NULL);
- ! #if (XlibSpecificationRelease >= 5)
- ! #if !defined( VMS ) && !defined( __vms__ )
- ! /* Add support for editres protocol */
- ! XtAddEventHandler(new,(EventMask)0,True,_XEditResCheckMessages,NULL);
- ! #endif
- ! #endif
- Tcl_CreateCommand (interp, path, widgetCmdProc,
- (ClientData) wPtr, (void (*) ()) NULL);
-
- --- 1665,1673 ----
- wPtr -> displayInfo = ((Tm_Widget *) parentInfo.clientData)->displayInfo;
- }
- Tm_DisplayAddShell(wPtr->displayInfo,wPtr);
- + Tm_StoreWidgetInfo(path, wPtr, interp);
- XtVaSetValues(new, XmNuserData, wPtr, NULL);
- !
- Tcl_CreateCommand (interp, path, widgetCmdProc,
- (ClientData) wPtr, (void (*) ()) NULL);
-
- *** tmDrag.c Fri May 19 11:55:02 1995
- --- ../../tm-1-4.org/src/tmDrag.c Tue Feb 28 22:22:45 1995
- ***************
- *** 250,256 ****
- call_data.closure = (char *) closure;
-
- new_command = Tm_ExpandPercents(wPtr->pathName, w, NULL,
- ! (XtPointer)&call_data, command);
-
- if (Tcl_GlobalEval(interp, new_command) != TCL_OK) {
- msg = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY);
- --- 250,256 ----
- call_data.closure = (char *) closure;
-
- new_command = Tm_ExpandPercents(wPtr->pathName, w, NULL,
- ! &call_data, command);
-
- if (Tcl_GlobalEval(interp, new_command) != TCL_OK) {
- msg = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY);
- ***************
- *** 310,315 ****
- --- 310,317 ----
- dcPtr -> parent = NULL;
- dcPtr -> dropProc = NULL;
-
- + Tm_StoreWidgetInfo(dcPtr->pathName, dcPtr, dcPtr->interp);
- +
- Tcl_CreateCommand (dcPtr->interp, dcPtr->pathName, Tm_DragContextCmd,
- (ClientData) dcPtr, (void (*) ()) NULL);
-
- ***************
- *** 356,371 ****
- Arg args[];
- int *num_args;
- {
- - #if !defined( VMS ) && !defined( __vms__ )
- #ifdef DD_NAMES_CHANGED
- int num_resources = NumDSResources;
- #else
- int num_resources = _XmNumDSResources;
- #endif
- - #else
- - int num_resources = 0;
- - #endif /*! VMS*/
- -
- int num_values = 0;
- XtArgVal new_value;
- char *resource;
- --- 358,368 ----
- ***************
- *** 392,398 ****
- Tm_SettingDropProc = True;
- }
-
- - #if !defined( VMS ) && !defined( __vms__ )
- #ifdef DD_NAMES_CHANGED
- if (Tm_ConvertValueFromStringQuark(w, DSResources, num_resources,
- #else
- --- 389,394 ----
- ***************
- *** 401,410 ****
- resource, value, &new_value)) {
- XtSetArg(args[num_values], resource, new_value);
- num_values++;
- ! }
- ! else
- ! #endif /* !VMS */
- ! {
- fprintf(stderr, "Conversion from String to %s failed\n",
- resource);
- }
- --- 397,403 ----
- resource, value, &new_value)) {
- XtSetArg(args[num_values], resource, new_value);
- num_values++;
- ! } else {
- fprintf(stderr, "Conversion from String to %s failed\n",
- resource);
- }
- *** tmFuncs.h Fri May 19 13:39:18 1995
- --- ../../tm-1-4.org/src/tmFuncs.h Wed Mar 1 17:27:36 1995
- ***************
- *** 13,20 ****
- String appclass));
- extern Tm_Display *Tm_OpenDisplay _ANSI_ARGS_((char *dispname));
- extern Tm_Display *Tm_AllocateDisplay _ANSI_ARGS_((void));
- - extern void Tm_DisplayAddShell _ANSI_ARGS_ ((Tm_Display *d,Tm_Widget *p));
- - extern void Tm_DisplayRemoveShell _ANSI_ARGS_ ((Tm_Display *d,Tm_Widget *p));
-
- /* Widget creation functions */
- extern int Tm_AnyCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp,
- --- 13,18 ----
- ***************
- *** 126,134 ****
-
- /* resource free functions */
- extern void Tm_FreeResourceValues _ANSI_ARGS_((void));
- ! extern void Tm_InitFreeResourceList _ANSI_ARGS_((int size));
- ! extern void Tm_AddToFreeResourceList _ANSI_ARGS_((char *data,Tm_FreeProc free));
- ! extern void Tm_FreeResourceList _ANSI_ARGS_((void));
-
- /* other funcs */
- extern void Tm_LoadWidgetCommands _ANSI_ARGS_((Tcl_Interp *interp));
- --- 124,132 ----
-
- /* resource free functions */
- extern void Tm_FreeResourceValues _ANSI_ARGS_((void));
- ! extern void TmInitFreeResourceList _ANSI_ARGS_((int size));
- ! extern void Tm_AddToFreeResourceList _ANSI_ARGS_((char *data,
- ! Tm_FreeProc free));
-
- /* other funcs */
- extern void Tm_LoadWidgetCommands _ANSI_ARGS_((Tcl_Interp *interp));
- ***************
- *** 138,143 ****
- --- 136,143 ----
- char *path));
- extern char *Tm_HiddenParentPath _ANSI_ARGS_((char *path));
- extern char *Tm_ParentPath _ANSI_ARGS_((char *path));
- + extern void Tm_StoreWidgetInfo _ANSI_ARGS_((char *path, Tm_Widget *w,
- + Tcl_Interp *interp));
- extern char *Tm_GetGC _ANSI_ARGS_((char *pathName, Tcl_Interp *interp,
- Widget w, WidgetClass Class, char **argv, int argc));
- extern int Tm_GetValues _ANSI_ARGS_((char *pathName, Tcl_Interp *interp,
- ***************
- *** 177,182 ****
- --- 177,183 ----
- Widget w, char *name, Tm_Display *displayInfo));
-
-
- +
- /* Converter functions */
- extern Boolean Tm_CvtStringToWidget _ANSI_ARGS_((Display *display,
- XrmValuePtr args, Cardinal *num_args,
- ***************
- *** 194,206 ****
- extern Boolean Tm_ConvertValueFromStringQuark _ANSI_ARGS_((Widget w,
- XtResourceList resources, int num_resources,
- char * resource, char *orig_value, XtArgVal *new_value));
- - extern Boolean Tm_ConvertValueToString _ANSI_ARGS_((Widget w,
- - XtResourceList resources, int num_resources,
- - char *resource, char **new_value));
- - extern Boolean Tm_ConvertValue _ANSI_ARGS_((Widget w,char *fromType,
- - char *fromValue,unsigned int fromSize,
- - char *toType,XtArgVal *toValue,
- - unsigned int toSize));
-
- /* external widgets stuff */
-
- --- 195,200 ----
- *** tmMain.c Fri May 19 11:55:08 1995
- --- ../../tm-1-4.org/src/tmMain.c Mon Feb 27 19:38:25 1995
- ***************
- *** 301,306 ****
- --- 301,308 ----
- wPtr -> parent = "."; /* kludge to stop later breakages */
- wPtr -> displayInfo = &displayInfo;
-
- + Tm_StoreWidgetInfo(".", wPtr, interp);
- +
- Tcl_CreateCommand (interp, ".", Tm_AnyWidgetCmd,
- (ClientData) wPtr, (void (*) ()) NULL);
-
- *** tmResources.c Fri Mar 31 16:19:59 1995
- --- ../../tm-1-4.org/src/tmResources.c Thu Mar 16 23:28:03 1995
- ***************
- *** 21,27 ****
- #include <Xm/Text.h>
- #include <Xm/DialogS.h>
- #include <X11/Shell.h>
- - #include <memory.h>
-
- /* this is a hack because some converters need info about what
- types they are converting, and Xt does not give such info.
- --- 21,26 ----
- ***************
- *** 74,80 ****
- else if (size == sizeof(XtPointer)) *dst = (XtArgVal)*(XtPointer*)src;
- else if (size == sizeof(char*)) *dst = (XtArgVal)*(char**)src;
- else if (size == sizeof(XtArgVal)) *dst = *(XtArgVal*)src;
- ! else memcpy((char*)dst,(char*)src,(int)size);
- }
- }
-
- --- 73,79 ----
- else if (size == sizeof(XtPointer)) *dst = (XtArgVal)*(XtPointer*)src;
- else if (size == sizeof(char*)) *dst = (XtArgVal)*(char**)src;
- else if (size == sizeof(XtArgVal)) *dst = *(XtArgVal*)src;
- ! else bcopy((char*)src, (char*)dst, (int)size);
- }
- }
-
- ***************
- *** 230,246 ****
- *
- *--------------------------------------------------------------
- */
- - static void freestr(w,cd,ptr)
- - Widget w;
- - XtPointer cd;
- - XtPointer ptr;
- - {
- - if(NULL!=ptr)
- - XtFree(ptr);
- - }
-
- Boolean
- ! Tm_ConvertValue(w, fromType, fromValue, fromSize, toType, toValue, toSize)
- Widget w;
- char *fromType;
- char *fromValue;
- --- 229,238 ----
- *
- *--------------------------------------------------------------
- */
-
- Boolean
- ! Tm_ConvertValue(w, fromType, fromValue, fromSize,
- ! toType, toValue, toSize)
- Widget w;
- char *fromType;
- char *fromValue;
- ***************
- *** 256,267 ****
- /* do we have to copy the value so Xt dosen't stuff up? */
- for (n = 0; n < XtNumber(must_copy_resource); n++) {
- if (strcmp(Tm_Resource, must_copy_resource[n]) == 0) {
- ! char *cp = XtNewString(fromValue);
- ! XtAddCallback(w,XmNdestroyCallback,freestr,(XtPointer)cp);
- ! *toValue = (XtArgVal)cp;
- return True;
- }
- }
- *toValue = (XtArgVal) fromValue;
- return TRUE;
- }
- --- 248,258 ----
- /* do we have to copy the value so Xt dosen't stuff up? */
- for (n = 0; n < XtNumber(must_copy_resource); n++) {
- if (strcmp(Tm_Resource, must_copy_resource[n]) == 0) {
- ! *toValue = (XtArgVal) XtNewString(fromValue);
- return True;
- }
- }
- +
- *toValue = (XtArgVal) fromValue;
- return TRUE;
- }
- ***************
- *** 270,278 ****
- from.addr = fromValue;
- to.size = toSize;
- to.addr = XtMalloc(toSize);
-
- if (!XtConvertAndStore(w, fromType, &from, toType, &to)) {
- ! fprintf(stderr, "failed conversion %s to %s\n", fromType, toType);
- return FALSE;
- }
- *toValue = 0;
- --- 261,273 ----
- from.addr = fromValue;
- to.size = toSize;
- to.addr = XtMalloc(toSize);
- + /*
- + to.addr = NULL;
- + */
-
- if (!XtConvertAndStore(w, fromType, &from, toType, &to)) {
- ! fprintf(stderr, "failed conversion %s to %s\n",
- ! fromType, toType);
- return FALSE;
- }
- *toValue = 0;
- ***************
- *** 400,405 ****
- --- 395,409 ----
- }
- *new_value = 0;
- CopyToArg(converted.addr, new_value, converted.size);
- + /* for now
- + XtFree(converted.addr);
- + */
- + /*
- + bzero(new_value, sizeof(XtArgVal));
- + bcopy(converted.addr, new_value, converted.size);
- + *new_value = *(XtArgVal *) (converted.addr);
- + */
- +
- return TRUE;
- }
-
- ***************
- *** 510,517 ****
- XtFree(from.addr);
- return FALSE;
- }
- ! memset((char*)value,0,sizeof(XtArgVal));
- ! memcpy((char*)value,converted.addr,converted.size);
-
- XtFree(from.addr);
- return TRUE;
- --- 514,521 ----
- XtFree(from.addr);
- return FALSE;
- }
- ! bzero((char *) value, sizeof(XtArgVal));
- ! bcopy(converted.addr, (char *) value, converted.size);
-
- XtFree(from.addr);
- return TRUE;
- *** tmUtils.c Fri May 19 11:55:14 1995
- --- ../../tm-1-4.org/src/tmUtils.c Mon Feb 27 19:40:35 1995
- ***************
- *** 24,29 ****
- --- 24,62 ----
- /*
- *--------------------------------------------------------------
- *
- + * Tm_StoreWidgetInfo --
- + *
- + * create a hash table entry for a new widget, with useful
- + * info in it.
- + *
- + * Results:
- + *
- + * modifies hash table in "interp"
- + *
- + * Side effects:
- + *
- + *--------------------------------------------------------------
- + */
- +
- + void
- + Tm_StoreWidgetInfo(path, w, interp)
- + char *path;
- + Tm_Widget *w;
- + Tcl_Interp *interp;
- + {
- + /*
- + int new;
- + Tcl_HashEntry *hPtr;
- +
- + hPtr = Tcl_CreateHashEntry(&WidgetTable, path, &new);
- + Tcl_SetHashValue(hPtr, (ClientData) w);
- + */
- + }
- +
- +
- + /*
- + *--------------------------------------------------------------
- + *
- * Tm_NameFromPath --
- *
- * find the part of the path after the last '.'
- ***************
- *** 514,519 ****
- --- 547,553 ----
- wPtr -> dropProc = NULL;
- wPtr -> displayInfo = displayInfo;
-
- + Tm_StoreWidgetInfo(path, wPtr, interp);
- XtVaSetValues(w, XmNuserData, wPtr, NULL);
-
- /* create a different command for each widget type
- *** tmWidget.c Fri Mar 31 17:19:50 1995
- --- ../../tm-1-4.org/src/tmWidget.c Mon Feb 27 21:46:52 1995
- ***************
- *** 274,291 ****
- *--------------------------------------------------------------
- */
-
- ! static Boolean
- ! DestroyWidgetInfo(client_data)
- XtPointer client_data;
- {
- Tm_Widget *c_data = (Tm_Widget *) client_data;
-
- ! Tm_DisplayRemoveShell(c_data->displayInfo,c_data);
- ! Tcl_DeleteCommand(c_data->interp,c_data->pathName);
- ! XtFree(c_data->parent);
- ! XtFree(c_data->pathName);
- ! XtFree((char *)c_data);
- ! return True;
- }
-
- /*
- --- 274,298 ----
- *--------------------------------------------------------------
- */
-
- ! static void
- ! DestroyWidgetInfo(client_data, timer)
- XtPointer client_data;
- + XtIntervalId *timer;
- {
- Tm_Widget *c_data = (Tm_Widget *) client_data;
- + Tcl_Interp *interp;
- + char *path;
- + char *parent;
-
- ! interp = c_data->interp;
- ! path = c_data->pathName;
- ! parent = c_data->parent;
- !
- ! if(XtIsShell(c_data->widget))
- ! Tm_DisplayRemoveShell(c_data->displayInfo,c_data);
- ! XtFree(parent);
- ! XtFree(path);
- ! XtFree((char *) c_data);
- }
-
- /*
- ***************
- *** 312,318 ****
- XtPointer client_data;
- XtPointer call_data;
- {
- ! XtAppAddWorkProc(XtWidgetToApplicationContext(w),DestroyWidgetInfo,client_data);
- }
-
-
- --- 319,325 ----
- XtPointer client_data;
- XtPointer call_data;
- {
- ! XtAppAddTimeOut(XtWidgetToApplicationContext(w),0,DestroyWidgetInfo,client_data);
- }
-
-
-