--- /dev/null
+#!/usr/athena/bin/perl
+
+while ($_ = <STDIN>) {
+ if (/^\s/) {
+ $members{$who} = $members{$who} . $_;
+ $mcount{$who}++;
+ next;
+ }
+ ($f,$f,$who,$own) = split(/\s+/, $_);
+ $data{$who} = $_;
+}
+
+# Do system:authuser@cell groups
+for (keys %data) {
+ next unless ($data{$_} =~ /^system:authuser@/);
+ ($name, $attr, $id, $oid, $cid) = split(/\s+/, $data{$_});
+ ($flags, $mcount) = split(/\//, $attr);
+ $mcount += $mcount{$_};
+ print "$name $flags/$mcount $id $oid $cid\n";
+ delete $data{$_};
+}
+
+# Do users
+for (keys %data) {
+ next if ($_ < 0);
+ print $data{$_};
+ delete $data{$_};
+}
+
+# Now do all the lists
+$x = 1;
+while ((@keys = keys %data)+0 && $x) {
+ $x = 0;
+ for $key (keys %data) {
+ ($f,$f,$who,$own) = split(/\s+/, $data{$key});
+ next if ($who!=$own && $data{$own});
+ $x = 1;
+ print $data{$key};
+ print $members{$key} if ($members{$key});
+ delete $data{$key};
+ delete $members{$key} if ($members{$key});
+ }
+}
+if (@keys+0) {
+ print STDERR "Unprocessed:\n";
+ for (keys %data) {
+ $f = split(/\s+/, $data{$_});
+ print STDERR "\t$f ($_)\n";
+ }
+}
--- /dev/null
+#!/moira/bin/perl
+
+$host = "maeander";
+$ptdump = "/var/local/ptdump";
+$skip_to_members = 0;
+
+# make sure process is unlimited
+`csh -fc 'limit datasize'` =~ /datasize\s*(\w*) kbytes/;
+if ($1 < 10000) {
+ die "Must 'unlimit' before running this script!\n";
+}
+
+&startquel;
+&quelcmd("set autocommit on");
+
+if (!$skip_to_members) {
+ptdumpagain:
+open(AUSERS, "rsh $host $ptdump 2>&1 |") || die "Couldn't get to $host\n";
+
+while (<AUSERS>) {
+ if (/Ubik Version number changed during execution/) {
+ close AUSERS;
+ undef %AUSERS;
+ print "AFS database changed, trying again.\n";
+ goto ptdumpagain;
+ }
+ if (/Name: (\w*) ID: (\d*)/ && $2<32767) {
+ $AUSERS{$1} = $2;
+ }
+}
+
+close(AUSERS);
+print "Got the users from AFS\n";
+
+$AUSERS{"nobody"} = 32767;
+delete $AUSERS{"anonymous"};
+#$AUSERS{"CLU"} = 60;
+#delete $AUSERS{"clu"};
+#$AUSERS{"Saltzer"} = 994;
+#delete $AUSERS{"saltzer"};
+
+@VAL = &quelcmd("select login, uid from users where status=1 or status=2");
+printf("Got %d users from Moira\n", scalar(@VAL));
+
+open(OUT, ">user.add") || die "Couldn't open output file\n";
+
+while ($_ = shift @VAL) {
+ tr/A-Z/a-z/;
+ if ($_ =~ /\|(\w*)\s*\|\s*(\d*)\|/) {
+ if ($AUSERS{$1} == $2) {
+ delete $AUSERS{$1};
+ } else {
+ print OUT "/moira/bin/pts createuser -name $1 -id $2\n";
+ }
+ }
+}
+
+close OUT;
+open(OUT, ">user.del") || die "Couldn't open output file\n";
+
+foreach $login (keys %AUSERS) {
+ print OUT "/moira/bin/pts delete $login\n";
+}
+
+close OUT;
+undef @VAL;
+undef %AUSERS;
+print "Done processing users\n";
+
+groupagain:
+open(AGROUP, "rsh $host $ptdump -g 2>&1 |") || die "Couldn't get to $host\n";
+
+while (<AGROUP>) {
+ if (/Ubik Version number changed during execution/) {
+ close AGROUP;
+ undef %AGROUP;
+ print "AFS database changed, trying again.\n";
+ goto groupagain;
+ }
+ if (/Name: system:(\w*) ID: -(\d*)/ && $2<32767) {
+ $AGROUP{$1} = $2;
+ }
+}
+
+close(AGROUP);
+print "Got the groups from AFS\n";
+
+$AGROUP{"mit"} = 101;
+delete $AGROUP{"anyuser"};
+#$AGROUP{"CLU"} = 184;
+#delete $AGROUP{"clu"};
+#$AGROUP{"Saltzer"} = 185;
+#delete $AGROUP{"saltzer"};
+
+@VAL = &quelcmd("select name, gid from list where active=1 and grouplist=1");
+printf("Got %d groups from Moira\n", scalar(@VAL));
+open(OUT, ">group.add") || die "Couldn't open output file\n";
+
+while ($_ = shift @VAL) {
+ tr/A-Z/a-z/;
+ if ($_ =~ /\|(\w*)\s*\|\s*(\d*)\|/) {
+ if ($AGROUP{$1} == $2) {
+ delete $AGROUP{$1};
+ } else {
+ print OUT "/moira/bin/pts creategroup -name system:$1 -owner system:administrators -id -$2\n";
+ }
+ }
+}
+
+close OUT;
+open(OUT, ">group.del") || die "Couldn't open output file\n";
+
+foreach $group (keys %AGROUP) {
+ print OUT "/moira/bin/pts delete system:$group\n";
+}
+close OUT;
+
+undef @VAL;
+undef %AGROUP;
+print "Done processing groups\n";
+}
+
+memberagain:
+open(AMEM, "rsh $host $ptdump -g -c 2>&1 |") || die "Couldn't get to $host\n";
+
+while (<AMEM>) {
+ if (/Ubik Version number changed during execution/) {
+ close AMEM;
+ undef @AMEM;
+ print "AFS database changed, trying again.\n";
+ goto memberagain;
+ }
+ if (/Group: system:([^\s]*)/) {
+ $list = $1;
+ } elsif (/Group: /) {
+ $list = "";
+ } elsif (/Member: ([^\s.]*)$/) {
+ if ($list) {
+ push(@AMEM, $list . " " . $1);
+ }
+ } elsif (/Member\(co\): ([^\s.]*)$/) {
+ if ($list) {
+ push(@AMEM, $list . " " . $1);
+ }
+ }
+}
+
+close(AMEM);
+printf("Got %d members from AFS\n", scalar(@AMEM));
+
+@VAL = &quelcmd("select l.name, u.login from list l, users u, imembers m where l.list_id=m.list_id and u.users_id=m.member_id and m.member_type='USER' and l.grouplist=1 and l.active=1 and (u.status=1 or u.status=2)");
+printf("Got %d members from Moira\n", scalar(@VAL));
+
+while ($_ = shift @VAL) {
+ tr/A-Z/a-z/;
+ if ($_ =~ /\|([^\s\|]*)\s*\|([^\s\|]*)\s*\|/) {
+ push(@MMEM, $1 . " " . $2);
+ }
+}
+
+# throw away column headings
+pop @MMEM;
+undef @VAL;
+@AMEM1 = sort @AMEM;
+@MMEM1 = sort @MMEM;
+
+open(OUT, ">member.del") || die "Couldn't open output file\n";
+open(OUT1, ">member.add") || die "Couldn't open output file\n";
+
+while ($#AMEM1 + $#MMEM1 > 0) {
+ if ($AMEM1[0] eq $MMEM1[0]) {
+ shift @AMEM1;
+ shift @MMEM1;
+ } elsif ($AMEM1[0] lt $MMEM1[0] && $#AMEM1 > 0) {
+ ($list, $user) = split(/ /, shift @AMEM1);
+ print OUT "/moira/bin/pts removeuser -user $user -group system:$list\n";
+ } elsif ($MMEM1[0] lt $AMEM1[0] && $#MMEM1 > 0) {
+ ($list, $user) = split(/ /, shift @MMEM1);
+ if (($user eq "login" && $list eq "name") || $user eq "root") {
+ next;
+ }
+ print OUT1 "/moira/bin/pts adduser -user $user -group system:$list\n";
+ } else {
+ last;
+ }
+}
+
+close OUT;
+close OUT1;
+
+print "Done processing members.\n";
+
+system("cat member.del group.del user.del user.add group.add member.add > fixit");
+
+&stopquel;
+exit 0;
+
+
+sub startquel {
+ $SIG{'INT'} = $SIG{'TERM'} = $SIG{'HUP'} = 'handler';
+ $ENV{"TERM"} = "glass";
+ pipe(CREAD, QUELIN);
+ pipe(QUELOUT, COUT);
+ select(QUELIN), $|=1;
+ select(STDOUT);
+ $quelpid = fork;
+ if (! $quelpid) {
+ select(COUT), $|=1;
+ open(STDOUT, ">&COUT");
+ open(STDERR, ">/dev/null");
+ open(STDIN, "<&CREAD");
+ exec "sql moira";
+ exit(1);
+ }
+ close(CREAD);
+ close(COUT);
+}
+
+sub quelcmd {
+ local (@RETVAL);
+ print QUELIN $_[0], "\\g\n";
+ while (($_ = <QUELOUT>) !~ /Executing \. \. \./) { next; }
+ while (($_ = <QUELOUT>) !~ /^continue$/) { push(@RETVAL, $_); }
+ return @RETVAL;
+}
+
+sub stopquel {
+ print QUELIN "\\q\n";
+ close QUELIN;
+ close QUELOUT;
+}
+
+sub handler {
+ local($sig) = @_;
+ &stopquel;
+ kill "HUP", $quelpid;
+ print("Caught a signal $sig\n");
+ exit(1);
+}
--- /dev/null
+#!/bin/csh
+
+set path=(. /bin /usr/bin ~rtingres/bin)
+
+if ($user != smsdba) then
+ echo "This script must be run as smsdba"
+ exit 1
+endif
+
+createdb smstemp
+if ($status) then
+ echo "unable to create database"
+ exit 2
+endif
+
+cd /mit/smsdev/backup
+
+ingres smstemp < dodbbuild
+
+smsrestore
+
+ingres smstemp < dodbopt
+
+sysmod smstemp
+
+echo "When you are satisfied that this is correct, rename the smstemp database"
+echo "to sms by renaming directories under ~rtingres/data/default, then run"
+echo "'finddbs -r' to fix the ingres database database."
+
+exit 0
--- /dev/null
+/*
+** Copyright (c) 1990 David E. Smyth
+**
+** Redistribution and use in source and binary forms are permitted
+** provided that the above copyright notice and this paragraph are
+** duplicated in all such forms and that any documentation, advertising
+** materials, and other materials related to such distribution and use
+** acknowledge that the software was developed by David E. Smyth. The
+** name of David E. Smyth may not be used to endorse or promote products
+** derived from this software without specific prior written permission.
+** THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+** WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+*/
+
+/*
+* SCCS_data: @(#)AriRegAll.c 1.0 ( 19 June 1990 )
+*
+* Subsystem_group:
+*
+* Widget Creation Library - Athena Resource Interpreter
+*
+* Module_description:
+*
+* This module contains registration routine for all Athena
+* widget constructors and classes.
+*
+* Module_interface_summary:
+*
+* void AriRegisterAthena ( XtAppContext app )
+*
+* Module_history:
+*
+* mm/dd/yy initials function action
+* -------- -------- -------- ---------------------------------------------
+* 06/19/90 D.Smyth all create.
+*
+* Design_notes:
+*
+*******************************************************************************
+*/
+/*
+*******************************************************************************
+* Include_files.
+*******************************************************************************
+*/
+
+#include <X11/Xatom.h>
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Box.h>
+#include <X11/Xaw/Clock.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Dialog.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Grip.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/List.h>
+#include "MList.h"
+#include <X11/Xaw/Logo.h>
+#include <X11/Xaw/MenuButton.h>
+#include <X11/Xaw/Scrollbar.h>
+#include <X11/Xaw/SimpleMenu.h>
+#include <X11/Xaw/SmeBSB.h>
+#include <X11/Xaw/SmeLine.h>
+#include <X11/Xaw/StripChart.h>
+#include <X11/Xaw/Paned.h>
+#include <X11/Xaw/Toggle.h>
+#include <X11/Xaw/Viewport.h>
+
+#include <X11/Xaw/Cardinals.h>
+
+void AriRegisterAthena ( app )
+ XtAppContext app;
+{
+
+#define RCN( name, class ) WcRegisterClassName ( app, name, class );
+#define RCP( name, class ) WcRegisterClassPtr ( app, name, class );
+
+ /* -- register all Athena widget classes */
+ /* Simple Widgets (Chapt 3) */
+ RCN("Command", commandWidgetClass );
+ RCP("commandWidgetClass", commandWidgetClass );
+ RCN("Grip", gripWidgetClass );
+ RCP("gripWidgetClass", gripWidgetClass );
+ RCN("Label", labelWidgetClass );
+ RCP("labelWidgetClass", labelWidgetClass );
+ RCN("List", listWidgetClass );
+ RCP("listWidgetClass", listWidgetClass );
+ RCN("MList", mlistWidgetClass );
+ RCP("mlistWidgetClass", mlistWidgetClass );
+ RCN("Scrollbar", scrollbarWidgetClass );
+ RCP("scrollbarWidgetClass", scrollbarWidgetClass );
+ RCN("Simple", simpleWidgetClass );
+ RCP("simpleWidgetClass", simpleWidgetClass );
+ RCN("StripChart", stripChartWidgetClass );
+ RCP("stripChartWidgetClass", stripChartWidgetClass );
+ RCN("Toggle", toggleWidgetClass );
+ RCP("toggleWidgetClass", toggleWidgetClass );
+
+ /* Menus (Chapt 4) */
+ RCN("SimpleMenu", simpleMenuWidgetClass );
+ RCP("simpleMenuWidgetClass", simpleMenuWidgetClass );
+ RCN("SmeBSB", smeBSBObjectClass );
+ RCP("smeBSBObjectClass", smeBSBObjectClass );
+ RCN("SmeLine", smeLineObjectClass );
+ RCP("smeLineObjectClass", smeLineObjectClass );
+ RCN("Sme", smeObjectClass );
+ RCP("smeObjectClass", smeObjectClass );
+ RCN("MenuButton", menuButtonWidgetClass );
+ RCP("menuButtonWidgetClass", menuButtonWidgetClass );
+
+ /* Text Widgets (Chapt 5) */
+ RCN("AsciiText", asciiTextWidgetClass ); /* NB name */
+ RCP("asciiTextWidgetClass", asciiTextWidgetClass );
+ RCN("AsciiSrc", asciiSrcObjectClass );
+ RCP("asciiSrcObjectClass", asciiSrcObjectClass );
+ RCN("AsciiSink", asciiSinkObjectClass );
+ RCP("asciiSinkObjectClass", asciiSinkObjectClass );
+ RCN("Text", textWidgetClass );
+ RCP("textWidgetClass", textWidgetClass );
+
+ /* Composite and Constraint Widgets (Chapt 6) */
+ RCN("Box", boxWidgetClass );
+ RCP("boxWidgetClass", boxWidgetClass );
+ RCN("Dialog", dialogWidgetClass );
+ RCP("dialogWidgetClass", dialogWidgetClass );
+ RCN("Form", formWidgetClass );
+ RCP("formWidgetClass", formWidgetClass );
+ RCN("Paned", panedWidgetClass );
+ RCP("panedWidgetClass", panedWidgetClass );
+ RCN("Viewport", viewportWidgetClass );
+ RCP("viewportWidgetClass", viewportWidgetClass );
+
+ /* Other Interestng Widgets (not in ref manual) */
+ RCN("ClockWidget", clockWidgetClass );
+ RCP("clockWidgetClass", clockWidgetClass );
+ RCN("LogoWidget", logoWidgetClass );
+ RCP("logoWidgetClass", logoWidgetClass );
+
+#undef RCN
+#undef RCP
+}
--- /dev/null
+#if ( !defined(lint) && !defined(SABER))
+ static char Xrcs_id[] = "$XConsortium: MList.c,v 1.29 90/05/08 15:16:32 converse Exp $";
+#endif
+
+/*
+ * Copyright 1989 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. M.I.T. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+/*
+ * MList.c - MList widget
+ *
+ * This is the MList widget, it is useful to display a list, without the
+ * overhead of having a widget for each item in the list. It allows
+ * the user to select an item in a list and notifies the application through
+ * a callback function.
+ *
+ * Created: 8/13/88
+ * By: Chris D. Peterson
+ * MIT X Consortium
+ */
+
+#include <stdio.h>
+#include <ctype.h>
+
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+
+#include <X11/Xmu/Drawing.h>
+
+#include <X11/Xaw/XawInit.h>
+#include "MListP.h"
+
+
+/*
+ * Default Translation table.
+ */
+
+static char defaultTranslations[] =
+ "<Btn1Down>: Set()\n\
+ <Btn1Up>: Notify()";
+
+/****************************************************************
+ *
+ * Full class record constant
+ *
+ ****************************************************************/
+
+/* Private Data */
+
+#define offset(field) XtOffset(MListWidget, field)
+
+static XtResource resources[] = {
+ {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
+ offset(list.foreground), XtRString, "XtDefaultForeground"},
+ {XtNcursor, XtCCursor, XtRCursor, sizeof(Cursor),
+ offset(simple.cursor), XtRString, "left_ptr"},
+ {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *),
+ offset(list.font),XtRString, "XtDefaultFont"},
+ {XtNlist, XtCMList, XtRPointer, sizeof(char **),
+ offset(list.list), XtRString, NULL},
+ {XtNdefaultColumns, XtCColumns, XtRInt, sizeof(int),
+ offset(list.default_cols), XtRImmediate, (caddr_t)2},
+ {XtNlongest, XtCLongest, XtRInt, sizeof(int),
+ offset(list.longest), XtRImmediate, (caddr_t)0},
+ {XtNnumberStrings, XtCNumberStrings, XtRInt, sizeof(int),
+ offset(list.nitems), XtRImmediate, (caddr_t)0},
+ {XtNpasteBuffer, XtCBoolean, XtRBoolean, sizeof(Boolean),
+ offset(list.paste), XtRString, (caddr_t) "False"},
+ {XtNforceColumns, XtCColumns, XtRBoolean, sizeof(Boolean),
+ offset(list.force_cols), XtRString, (caddr_t) "False"},
+ {XtNverticalList, XtCBoolean, XtRBoolean, sizeof(Boolean),
+ offset(list.vertical_cols), XtRString, (caddr_t) "False"},
+ {XtNinternalWidth, XtCWidth, XtRDimension, sizeof(Dimension),
+ offset(list.internal_width), XtRImmediate, (caddr_t)4},
+ {XtNinternalHeight, XtCHeight, XtRDimension, sizeof(Dimension),
+ offset(list.internal_height), XtRImmediate, (caddr_t)2},
+ {XtNcolumnSpacing, XtCSpacing, XtRDimension, sizeof(Dimension),
+ offset(list.column_space), XtRImmediate, (caddr_t)6},
+ {XtNrowSpacing, XtCSpacing, XtRDimension, sizeof(Dimension),
+ offset(list.row_space), XtRImmediate, (caddr_t)2},
+ {XtNcallback, XtCCallback, XtRCallback, sizeof(caddr_t),
+ offset(list.callback), XtRCallback, NULL},
+};
+
+static void Initialize();
+static void ChangeSize();
+static void Resize();
+static void Redisplay();
+static Boolean Layout();
+static XtGeometryResult PreferredGeom();
+static Boolean SetValues();
+static void Notify(), Set(), Unset();
+
+static XtActionsRec actions[] = {
+ {"Notify", Notify},
+ {"Set", Set},
+ {"Unset", Unset},
+};
+
+MListClassRec mlistClassRec = {
+ {
+/* core_class fields */
+#define superclass (&simpleClassRec)
+ /* superclass */ (WidgetClass) superclass,
+ /* class_name */ "MList",
+ /* widget_size */ sizeof(MListRec),
+ /* class_initialize */ XawInitializeWidgetSet,
+ /* class_part_initialize */ NULL,
+ /* class_inited */ FALSE,
+ /* initialize */ Initialize,
+ /* initialize_hook */ NULL,
+ /* realize */ XtInheritRealize,
+ /* actions */ actions,
+ /* num_actions */ XtNumber(actions),
+ /* resources */ resources,
+ /* num_resources */ XtNumber(resources),
+ /* xrm_class */ NULLQUARK,
+ /* compress_motion */ TRUE,
+ /* compress_exposure */ FALSE,
+ /* compress_enterleave */ TRUE,
+ /* visible_interest */ FALSE,
+ /* destroy */ NULL,
+ /* resize */ Resize,
+ /* expose */ Redisplay,
+ /* set_values */ SetValues,
+ /* set_values_hook */ NULL,
+ /* set_values_almost */ XtInheritSetValuesAlmost,
+ /* get_values_hook */ NULL,
+ /* accept_focus */ NULL,
+ /* version */ XtVersion,
+ /* callback_private */ NULL,
+ /* tm_table */ defaultTranslations,
+ /* query_geometry */ PreferredGeom,
+ },
+/* Simple class fields initialization */
+ {
+ /* change_sensitive */ XtInheritChangeSensitive
+ }
+};
+
+WidgetClass mlistWidgetClass = (WidgetClass)&mlistClassRec;
+
+/****************************************************************
+ *
+ * Private Procedures
+ *
+ ****************************************************************/
+
+static void GetGCs(w)
+Widget w;
+{
+ XGCValues values;
+ MListWidget lw = (MListWidget) w;
+
+ values.foreground = lw->list.foreground;
+ values.font = lw->list.font->fid;
+ lw->list.normgc = XtGetGC(w, (unsigned) GCForeground | GCFont,
+ &values);
+
+ values.foreground = lw->core.background_pixel;
+ lw->list.revgc = XtGetGC(w, (unsigned) GCForeground | GCFont,
+ &values);
+
+ values.tile = XmuCreateStippledPixmap(XtScreen(w),
+ lw->list.foreground,
+ lw->core.background_pixel,
+ lw->core.depth);
+ values.fill_style = FillTiled;
+
+ lw->list.graygc = XtGetGC(w, (unsigned) GCFont | GCTile | GCFillStyle,
+ &values);
+}
+
+/* Function Name: ResetMList
+ * Description: Resets the new list when important things change.
+ * Arguments: w - the widget.
+ * changex, changey - allow the height or width to change?
+ * Returns: none.
+ */
+
+static void
+ResetMList(w, changex, changey)
+Widget w;
+Boolean changex, changey;
+{
+ MListWidget lw = (MListWidget) w;
+ Dimension width = w->core.width;
+ Dimension height = w->core.height;
+ register int i, len;
+
+/*
+ * If list is NULL then the list will just be the name of the widget.
+ */
+
+ if (lw->list.list == NULL) {
+ lw->list.list = &(lw->core.name);
+ lw->list.nitems = 1;
+ }
+
+ if (lw->list.nitems == 0) /* Get number of items. */
+ for ( ; lw->list.list[lw->list.nitems] != NULL ; lw->list.nitems++);
+
+ if (lw->list.longest == 0) /* Get column width. */
+ for ( i = 0 ; i < lw->list.nitems; i++) {
+ len = XTextWidth(lw->list.font, lw->list.list[i],
+ strlen(lw->list.list[i]));
+ if (len > lw->list.longest)
+ lw->list.longest = len;
+ }
+
+ lw->list.col_width = lw->list.longest + lw->list.column_space;
+
+ if (Layout(w, changex, changey, &width, &height))
+ ChangeSize(w, width, height);
+}
+
+/* Function Name: ChangeSize.
+ * Description: Laysout the widget.
+ * Arguments: w - the widget to try change the size of.
+ * Returns: none.
+ */
+
+static void
+ChangeSize(w, width, height)
+Widget w;
+Dimension width, height;
+{
+ XtWidgetGeometry request, reply;
+
+ request.request_mode = CWWidth | CWHeight;
+ request.width = width;
+ request.height = height;
+
+ switch ( XtMakeGeometryRequest(w, &request, &reply) ) {
+ case XtGeometryYes:
+ case XtGeometryNo:
+ break;
+ case XtGeometryAlmost:
+ Layout(w, (request.height != reply.height),
+ (request.width != reply.width),
+ &(reply.width), &(reply.height));
+ request = reply;
+ switch (XtMakeGeometryRequest(w, &request, &reply) ) {
+ case XtGeometryYes:
+ case XtGeometryNo:
+ break;
+ case XtGeometryAlmost:
+ request = reply;
+ if (Layout(w, FALSE, FALSE,
+ &(request.width), &(request.height))) {
+ char buf[BUFSIZ];
+ sprintf(buf, "MList Widget: %s %s",
+ "Size Changed when it shouldn't have",
+ "when computing layout");
+ XtAppWarning(XtWidgetToApplicationContext(w), buf);
+ }
+ request.request_mode = CWWidth | CWHeight;
+ XtMakeGeometryRequest(w, &request, &reply);
+ break;
+ default:
+ XtAppWarning(XtWidgetToApplicationContext(w),
+ "MList Widget: Unknown geometry return.");
+ break;
+ }
+ break;
+ default:
+ XtAppWarning(XtWidgetToApplicationContext(w),
+ "MList Widget: Unknown geometry return.");
+ break;
+ }
+}
+
+/* Function Name: Initialize
+ * Description: Function that initilizes the widget instance.
+ * Arguments: junk - NOT USED.
+ * new - the new widget.
+ * Returns: none
+ */
+
+/* ARGSUSED */
+static void
+Initialize(junk, new)
+Widget junk, new;
+{
+ MListWidget lw = (MListWidget) new;
+
+/*
+ * Initialize all private resources.
+ */
+
+ GetGCs(new);
+
+ /* Set row height. */
+ lw->list.row_height = lw->list.font->max_bounds.ascent
+ + lw->list.font->max_bounds.descent
+ + lw->list.row_space;
+
+ ResetMList(new, (new->core.width == 0), (new->core.height == 0));
+
+ lw->list.highlight = NO_HIGHLIGHT;
+ lw->list.nhighlighted = 0;
+ lw->list.is_highlighted = (int *) malloc(0);
+
+} /* Initialize */
+
+
+
+/*
+ * Determine if the specified item is selected
+ */
+
+static Boolean
+IsHighlit(lw, item)
+MListWidget lw;
+int item;
+{
+ int i;
+
+ for (i = 0; i < lw->list.nhighlighted; i++) {
+ if (lw->list.is_highlighted[i] == item)
+ return True;
+ }
+ return False;
+}
+
+
+/* Function Name: CvtToItem
+ * Description: Converts Xcoord to item number of item containing that
+ * point.
+ * Arguments: w - the list widget.
+ * xloc, yloc - x location, and y location.
+ * Returns: the item number.
+ */
+
+static int
+CvtToItem(w, xloc, yloc, item)
+Widget w;
+int xloc, yloc;
+int *item;
+{
+ int one, another;
+ MListWidget lw = (MListWidget) w;
+ int ret_val = OKAY;
+
+ if (lw->list.vertical_cols) {
+ one = lw->list.nrows * ((xloc - (int) lw->list.internal_width)
+ / lw->list.col_width);
+ another = (yloc - (int) lw->list.internal_height)
+ / lw->list.row_height;
+ /* If out of range, return minimum possible value. */
+ if (another >= lw->list.nrows) {
+ another = lw->list.nrows - 1;
+ ret_val = OUT_OF_RANGE;
+ }
+ }
+ else {
+ one = (lw->list.ncols * ((yloc - (int) lw->list.internal_height)
+ / lw->list.row_height)) ;
+ /* If in right margin handle things right. */
+ another = (xloc - (int) lw->list.internal_width) / lw->list.col_width;
+ if (another >= lw->list.ncols) {
+ another = lw->list.ncols - 1;
+ ret_val = OUT_OF_RANGE;
+ }
+ }
+ if ((xloc < 0) || (yloc < 0))
+ ret_val = OUT_OF_RANGE;
+ if (one < 0) one = 0;
+ if (another < 0) another = 0;
+ *item = one + another;
+ if (*item >= lw->list.nitems) return(OUT_OF_RANGE);
+ return(ret_val);
+}
+
+/* Function Name: FindCornerItems.
+ * Description: Find the corners of the rectangle in item space.
+ * Arguments: w - the list widget.
+ * event - the event structure that has the rectangle it it.
+ * ul_ret, lr_ret - the corners ** RETURNED **.
+ * Returns: none.
+ */
+
+static FindCornerItems(w, event, ul_ret, lr_ret)
+Widget w;
+XEvent * event;
+int *ul_ret, *lr_ret;
+{
+ int xloc, yloc;
+
+ xloc = event->xexpose.x;
+ yloc = event->xexpose.y;
+ CvtToItem(w, xloc, yloc, ul_ret);
+ xloc += event->xexpose.width;
+ yloc += event->xexpose.height;
+ CvtToItem(w, xloc, yloc, lr_ret);
+}
+
+/* Function Name: ItemInRectangle
+ * Description: returns TRUE if the item passed is in the given rectangle.
+ * Arguments: w - the list widget.
+ * ul, lr - corners of the rectangle in item space.
+ * item - item to check.
+ * Returns: TRUE if the item passed is in the given rectangle.
+ */
+
+static ItemInRectangle(w, ul, lr, item)
+Widget w;
+int ul, lr, item;
+{
+ MListWidget lw = (MListWidget) w;
+ register int mod_item;
+ int things;
+
+ if (item < ul || item > lr)
+ return(FALSE);
+ if (lw->list.vertical_cols)
+ things = lw->list.nrows;
+ else
+ things = lw->list.ncols;
+
+ mod_item = item % things;
+ if ( (mod_item >= ul % things) && (mod_item <= lr % things ) )
+ return(TRUE);
+ return(FALSE);
+}
+
+/* Function Name: HighlightBackground
+ * Description: paints the color of the background for the given item.
+ * Arguments: w - the widget.
+ * x, y - ul corner of the area item occupies.
+ * item - the item we are dealing with.
+ * gc - the gc that is used to paint this rectangle
+ * Returns:
+ */
+
+static HighlightBackground(w, x, y, item, gc)
+Widget w;
+int x, y, item;
+GC gc;
+{
+ MListWidget lw = (MListWidget) w;
+ int hl_x, hl_y, width, height;
+
+ hl_x = x - lw->list.column_space/2;
+ width = XTextWidth(lw->list.font, lw->list.list[item],
+ strlen(lw->list.list[item])) + lw->list.column_space;
+ hl_y = y - lw->list.row_space/2;
+ height = lw->list.row_height + lw->list.row_space;
+
+ XFillRectangle(XtDisplay(w), XtWindow(w), gc, hl_x, hl_y, width, height);
+}
+
+/* Function Name: PaintItemName
+ * Description: paints the name of the item in the appropriate location.
+ * Arguments: w - the list widget.
+ * item - the item to draw.
+ * Returns: none.
+ *
+ * NOTE: no action taken on an unrealized widget.
+ */
+
+static PaintItemName(w, item)
+Widget w;
+int item;
+{
+ char * str;
+ GC gc;
+ int x, y, str_y;
+ MListWidget lw = (MListWidget) w;
+
+ if (!XtIsRealized(w)) return; /* Just in case... */
+
+ if (lw->list.vertical_cols) {
+ x = lw->list.col_width * (item / lw->list.nrows)
+ + lw->list.internal_width;
+ y = lw->list.row_height * (item % lw->list.nrows)
+ + lw->list.internal_height;
+ }
+ else {
+ x = lw->list.col_width * (item % lw->list.ncols)
+ + lw->list.internal_width;
+ y = lw->list.row_height * (item / lw->list.ncols)
+ + lw->list.internal_height;
+ }
+
+ str_y = y + lw->list.font->max_bounds.ascent;
+
+ if (IsHighlit(lw, item)) {
+ gc = lw->list.revgc;
+ HighlightBackground(w, x, y, item, lw->list.normgc);
+ }
+ else {
+ if (XtIsSensitive(w))
+ gc = lw->list.normgc;
+ else
+ gc = lw->list.graygc;
+ HighlightBackground(w, x, y, item, lw->list.revgc);
+ }
+
+ str = lw->list.list[item]; /* draw it */
+ XDrawString(XtDisplay(w), XtWindow(w), gc, x, str_y, str, strlen(str));
+}
+
+/* Function Name: Redisplay
+ * Description: Repaints the widget window on expose events.
+ * Arguments: w - the list widget.
+ * event - the expose event for this repaint.
+ * junk - NOT USED.
+ * Returns:
+ */
+
+/* ARGSUSED */
+static void
+Redisplay(w, event, junk)
+Widget w;
+XEvent *event;
+Region junk;
+{
+ int item; /* an item to work with. */
+ int ul_item, lr_item; /* corners of items we need to paint. */
+ MListWidget lw = (MListWidget) w;
+
+ if (event == NULL) { /* repaint all. */
+ ul_item = 0;
+ lr_item = lw->list.nrows * lw->list.ncols - 1;
+ XClearWindow(XtDisplay(w), XtWindow(w));
+ }
+ else
+ FindCornerItems(w, event, &ul_item, &lr_item);
+
+ for (item = ul_item; (item <= lr_item && item < lw->list.nitems) ; item++)
+ if (ItemInRectangle(w, ul_item, lr_item, item))
+ PaintItemName(w, item);
+}
+
+/* Function Name: PreferredGeom
+ * Description: This tells the parent what size we would like to be
+ * given certain constraints.
+ * Arguments: w - the widget.
+ * intended - what the parent intends to do with us.
+ * requested - what we want to happen.
+ * Returns: none.
+ */
+
+static XtGeometryResult
+PreferredGeom(w, intended, requested)
+Widget w;
+XtWidgetGeometry *intended, *requested;
+{
+ Dimension new_width, new_height;
+ Boolean change, width_req, height_req;
+
+ width_req = intended->request_mode & CWWidth;
+ height_req = intended->request_mode & CWHeight;
+
+ if (width_req)
+ new_width = intended->width;
+ else
+ new_width = w->core.width;
+
+ if (height_req)
+ new_height = intended->height;
+ else
+ new_height = w->core.height;
+
+ requested->request_mode = 0;
+
+/*
+ * We only care about our height and width.
+ */
+
+ if ( !width_req && !height_req)
+ return(XtGeometryYes);
+
+ change = Layout(w, !width_req, !height_req, &new_width, &new_height);
+
+ requested->request_mode |= CWWidth;
+ requested->width = new_width;
+ requested->request_mode |= CWHeight;
+ requested->height = new_height;
+
+ if (change)
+ return(XtGeometryAlmost);
+ return(XtGeometryYes);
+}
+
+/* Function Name: Resize
+ * Description: resizes the widget, by changing the number of rows and
+ * columns.
+ * Arguments: w - the widget.
+ * Returns: none.
+ */
+
+static void
+Resize(w)
+Widget w;
+{
+ Dimension width, height;
+
+ width = w->core.width;
+ height = w->core.height;
+
+ if (Layout(w, FALSE, FALSE, &width, &height))
+ XtAppWarning(XtWidgetToApplicationContext(w),
+ "MList Widget: Size changed when it shouldn't have when resising.");
+}
+
+/* Function Name: Layout
+ * Description: lays out the item in the list.
+ * Arguments: w - the widget.
+ * xfree, yfree - TRUE if we are free to resize the widget in
+ * this direction.
+ * width, height - the is the current width and height that
+ * we are going to layout the list widget to,
+ * depending on xfree and yfree of course.
+ *
+ * Returns: TRUE if width or height have been changed.
+ */
+
+static Boolean
+Layout(w, xfree, yfree, width, height)
+Widget w;
+Boolean xfree, yfree;
+Dimension *width, *height;
+{
+ MListWidget lw = (MListWidget) w;
+ Boolean change = FALSE;
+
+/*
+ * If force columns is set then always use number of columns specified
+ * by default_cols.
+ */
+
+ if (lw->list.force_cols) {
+ lw->list.ncols = lw->list.default_cols;
+ if (lw->list.ncols <= 0) lw->list.ncols = 1;
+ /* 12/3 = 4 and 10/3 = 4, but 9/3 = 3 */
+ lw->list.nrows = ( ( lw->list.nitems - 1) / lw->list.ncols) + 1 ;
+ if (xfree) { /* If allowed resize width. */
+ *width = lw->list.ncols * lw->list.col_width
+ + 2 * lw->list.internal_width;
+ change = TRUE;
+ }
+ if (yfree) { /* If allowed resize height. */
+ *height = (lw->list.nrows * lw->list.row_height)
+ + 2 * lw->list.internal_height;
+ change = TRUE;
+ }
+ return(change);
+ }
+
+/*
+ * If both width and height are free to change the use default_cols
+ * to determine the number columns and set new width and height to
+ * just fit the window.
+ */
+
+ if (xfree && yfree) {
+ lw->list.ncols = lw->list.default_cols;
+ if (lw->list.ncols <= 0) lw->list.ncols = 1;
+ lw->list.nrows = ( ( lw->list.nitems - 1) / lw->list.ncols) + 1 ;
+ *width = lw->list.ncols * lw->list.col_width
+ + 2 * lw->list.internal_width;
+ *height = (lw->list.nrows * lw->list.row_height)
+ + 2 * lw->list.internal_height;
+ change = TRUE;
+ }
+/*
+ * If the width is fixed then use it to determine the number of columns.
+ * If the height is free to move (width still fixed) then resize the height
+ * of the widget to fit the current list exactly.
+ */
+ else if (!xfree) {
+ lw->list.ncols = ( (*width - 2 * lw->list.internal_width)
+ / lw->list.col_width);
+ if (lw->list.ncols <= 0) lw->list.ncols = 1;
+ lw->list.nrows = ( ( lw->list.nitems - 1) / lw->list.ncols) + 1 ;
+ if ( yfree ) {
+ *height = (lw->list.nrows * lw->list.row_height)
+ + 2 * lw->list.internal_height;
+ change = TRUE;
+ }
+ }
+/*
+ * The last case is xfree and !yfree we use the height to determine
+ * the number of rows and then set the width to just fit the resulting
+ * number of columns.
+ */
+ else if (!yfree) { /* xfree must be TRUE. */
+ lw->list.nrows = (*height - 2 * lw->list.internal_height)
+ / lw->list.row_height;
+ if (lw->list.nrows <= 0) lw->list.nrows = 1;
+ lw->list.ncols = (( lw->list.nitems - 1 ) / lw->list.nrows) + 1;
+ *width = lw->list.ncols * lw->list.col_width
+ + 2 * lw->list.internal_width;
+ change = TRUE;
+ }
+ return(change);
+}
+
+/* Function Name: Notify
+ * Description: Notifies the user that a button has been pressed, and
+ * calles the callback, if the XtNpasteBuffer resource
+ * is true then the name of the item is also put in the
+ * X cut buffer ( buf (0) ).
+ * Arguments: w - the widget that the notify occured in.
+ * event - event that caused this notification.
+ * params, num_params - not used.
+ * Returns: none.
+ */
+
+/* ARGSUSED */
+static void
+Notify(w, event, params, num_params)
+Widget w;
+XEvent * event;
+String * params;
+Cardinal *num_params;
+{
+ MListWidget lw = ( MListWidget ) w;
+ int item, item_len;
+ XawMListReturnStruct ret_value;
+
+/*
+ * Find item and if out of range then unhighlight and return.
+ *
+ * If the current item is unhighlighted then the user has aborted the
+ * notify, so unhighlight and return.
+ */
+
+ if ( ((CvtToItem(w, event->xbutton.x, event->xbutton.y, &item))
+ == OUT_OF_RANGE) || (lw->list.highlight != item) ) {
+ XawMListUnhighlight(w, lw->list.highlight);
+ lw->list.highlight = NO_HIGHLIGHT;
+ return;
+ }
+ lw->list.highlight = NO_HIGHLIGHT;
+
+ item_len = strlen(lw->list.list[item]);
+
+ if ( lw->list.paste ) /* if XtNpasteBuffer set then paste it. */
+ XStoreBytes(XtDisplay(w), lw->list.list[item], item_len);
+
+/*
+ * Call Callback function.
+ */
+
+ ret_value.string = lw->list.list[item];
+ ret_value.list_index = item;
+
+ XtCallCallbacks( w, XtNcallback, (caddr_t) &ret_value);
+}
+
+/* Function Name: Unset
+ * Description: unhighlights the current element.
+ * Arguments: w - the widget that the event occured in.
+ * event - not used.
+ * params, num_params - not used.
+ * Returns: none.
+ */
+
+/* ARGSUSED */
+static void
+Unset(w, event, params, num_params)
+Widget w;
+XEvent * event;
+String * params;
+Cardinal *num_params;
+{
+ MListWidget lw = (MListWidget) w;
+
+ XawMListUnhighlight(w, lw->list.highlight);
+}
+
+/* Function Name: Set
+ * Description: Highlights the current element.
+ * Arguments: w - the widget that the event occured in.
+ * event - event that caused this notification.
+ * params, num_params - not used.
+ * Returns: none.
+ */
+
+/* ARGSUSED */
+static void
+Set(w, event, params, num_params)
+Widget w;
+XEvent * event;
+String * params;
+Cardinal *num_params;
+{
+ int item;
+ MListWidget lw = (MListWidget) w;
+
+ if ( (CvtToItem(w, event->xbutton.x, event->xbutton.y, &item))
+ == OUT_OF_RANGE)
+ return;
+
+ if (IsHighlit(lw, item))
+ (void) XawMListUnhighlight(w, item);
+ else {
+ (void) XawMListHighlight(w, item);
+ lw->list.highlight = item;
+ }
+}
+
+/*
+ * Set specified arguments into widget
+ */
+
+static Boolean
+SetValues(current, request, new)
+Widget current, request, new;
+{
+ MListWidget cl = (MListWidget) current;
+ MListWidget rl = (MListWidget) request;
+ MListWidget nl = (MListWidget) new;
+ Boolean redraw = FALSE;
+
+ if ((cl->list.foreground != rl->list.foreground) ||
+ (cl->core.background_pixel != rl->core.background_pixel) ||
+ (cl->list.font != rl->list.font) ) {
+ XtDestroyGC(cl->list.normgc);
+ XtDestroyGC(cl->list.graygc);
+ XtDestroyGC(cl->list.revgc);
+ GetGCs(new);
+ redraw = TRUE;
+ }
+
+ /* Reset row height. */
+
+ if ((cl->list.row_space != rl->list.row_space) ||
+ (cl->list.font != rl->list.font))
+ nl->list.row_height = nl->list.font->max_bounds.ascent
+ + nl->list.font->max_bounds.descent
+ + nl->list.row_space;
+
+ if ((cl->core.width != rl->core.width) ||
+ (cl->core.height != rl->core.height) ||
+ (cl->list.internal_width != rl->list.internal_width) ||
+ (cl->list.internal_height != rl->list.internal_height) ||
+ (cl->list.column_space != rl->list.column_space) ||
+ (cl->list.row_space != rl->list.row_space) ||
+ (cl->list.default_cols != rl->list.default_cols) ||
+ ( (cl->list.force_cols != rl->list.force_cols) &&
+ (rl->list.force_cols != rl->list.ncols) ) ||
+ (cl->list.vertical_cols != rl->list.vertical_cols) ||
+ (cl->list.longest != rl->list.longest) ||
+ (cl->list.nitems != rl->list.nitems) ||
+ (cl->list.font != rl->list.font) ||
+ (cl->list.list != rl->list.list) ) {
+
+ ResetMList(new, TRUE, TRUE);
+ redraw = TRUE;
+ }
+
+ if (cl->list.list != rl->list.list)
+ nl->list.highlight = NO_HIGHLIGHT;
+
+ if ((cl->core.sensitive != rl->core.sensitive) ||
+ (cl->core.ancestor_sensitive != rl->core.ancestor_sensitive)) {
+ nl->list.highlight = NO_HIGHLIGHT;
+ redraw = TRUE;
+ }
+
+ if (!XtIsRealized(current))
+ return(FALSE);
+
+ return(redraw);
+}
+
+/* Exported Functions */
+
+/* Function Name: XawMListChange.
+ * Description: Changes the list being used and shown.
+ * Arguments: w - the list widget.
+ * list - the new list.
+ * nitems - the number of items in the list.
+ * longest - the length (in Pixels) of the longest element
+ * in the list.
+ * resize - if TRUE the the list widget will
+ * try to resize itself.
+ * Returns: none.
+ * NOTE: If nitems of longest are <= 0 then they will be calculated.
+ * If nitems is <= 0 then the list needs to be NULL terminated.
+ */
+
+void
+#if NeedFunctionPrototypes
+XawMListChange(Widget w, char ** list, int nitems, int longest,
+#if NeedWidePrototypes
+ int resize_it)
+#else
+ Boolean resize_it)
+#endif
+#else
+XawMListChange(w, list, nitems, longest, resize_it)
+Widget w;
+char ** list;
+int nitems, longest;
+Boolean resize_it;
+#endif
+{
+ MListWidget lw = (MListWidget) w;
+
+ lw->list.list = list;
+
+ if (nitems <= 0) nitems = 0;
+ lw->list.nitems = nitems;
+ if (longest <= 0) longest = 0;
+ lw->list.longest = longest;
+
+ ResetMList(w, resize_it, resize_it);
+/* lw->list.is_highlighted = */
+ lw->list.highlight = NO_HIGHLIGHT;
+ if ( XtIsRealized(w) )
+ Redisplay(w, NULL, NULL);
+}
+
+/* Function Name: XawMListUnhighlight
+ * Description: unlights the current highlighted element.
+ * Arguments: w - the widget, item - the element to unhighlight
+ * Returns: none.
+ */
+
+void
+#if NeedFunctionPrototypes
+XawMListUnhighlight(Widget w, int item)
+#else
+XawMListUnhighlight(w, item)
+Widget w;
+int item;
+#endif
+{
+ int i;
+ MListWidget lw = (MListWidget) w;
+
+ if (IsHighlit(w, item)) {
+ for (i = 0; i < lw->list.nhighlighted; i++)
+ if (lw->list.is_highlighted[i] == item) break;
+ lw->list.nhighlighted--;
+ lw->list.is_highlighted[i] =
+ lw->list.is_highlighted[lw->list.nhighlighted];
+ lw->list.is_highlighted = (int *)
+ realloc((char *)lw->list.is_highlighted,
+ sizeof(int) * lw->list.nhighlighted);
+ PaintItemName(w, item); /* unhighlight this one. */
+ }
+}
+
+/* Function Name: XawMListHighlight
+ * Description: Highlights the given item.
+ * Arguments: w - the list widget.
+ * item - the item to hightlight.
+ * Returns: none.
+ */
+
+void
+#if NeedFunctionPrototypes
+XawMListHighlight(Widget w, int item)
+#else
+XawMListHighlight(w, item)
+Widget w;
+int item;
+#endif
+{
+ MListWidget lw = ( MListWidget ) w;
+
+ if (XtIsSensitive(w)) {
+ if (!IsHighlit(lw, item)) {
+ lw->list.is_highlighted = (int *)
+ realloc((char *)lw->list.is_highlighted,
+ sizeof(int) * (lw->list.nhighlighted + 1));
+ lw->list.is_highlighted[lw->list.nhighlighted] = item;
+ lw->list.nhighlighted++;
+ }
+ PaintItemName(w, item); /* HIGHLIGHT this one. */
+ }
+}
+
+/* Function Name: XawMListShowCurrent
+ * Description: returns the currently highlighted object.
+ * Arguments: w - the list widget.
+ * Returns: the info about the currently highlighted object.
+ */
+
+XawMListReturnStruct *
+#if NeedFunctionPrototypes
+XawMListShowCurrent(Widget w, int *numselected)
+#else
+XawMListShowCurrent(w, numselected)
+Widget w;
+int *numselected;
+#endif
+{
+ MListWidget lw = ( MListWidget ) w;
+ XawMListReturnStruct * ret_val;
+ int i;
+
+ *numselected = lw->list.nhighlighted;
+ ret_val = (XawMListReturnStruct *)
+ XtMalloc (sizeof(XawMListReturnStruct) * lw->list.nhighlighted);
+
+ for (i = 0; i < lw->list.nhighlighted; i++) {
+ ret_val[i].list_index = lw->list.is_highlighted[i];
+ ret_val[i].string = lw->list.list[ ret_val->list_index ];
+ }
+
+ return(ret_val);
+}
+
--- /dev/null
+/*
+ * $XConsortium: MList.h,v 1.17 90/05/08 15:18:37 converse Exp $
+ *
+ * Copyright 1989 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. M.I.T. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* This is the MList widget, it is useful to display a list, without the
+ * overhead of having a widget for each item in the list. It allows
+ * the user to select an item in a list and notifies the application through
+ * a callback function.
+ *
+ * Created: 8/13/88
+ * By: Chris D. Peterson
+ * MIT X Consortium
+ */
+
+#ifndef _XawMList_h
+#define _XawMList_h
+
+/***********************************************************************
+ *
+ * MList Widget
+ *
+ ***********************************************************************/
+
+#include <X11/Xaw/Simple.h>
+
+/* Resources:
+
+ Name Class RepType Default Value
+ ---- ----- ------- -------------
+ background Background Pixel XtDefaultBackground
+ border BorderColor Pixel XtDefaultForeground
+ borderWidth BorderWidth Dimension 1
+ callback Callback XtCallbackMList NULL **6
+ columnSpacing Spacing Dimension 6
+ cursor Cursor Cursor left_ptr
+ defaultColumns Columns int 2 **5
+ destroyCallback Callback Pointer NULL
+ font Font XFontStruct* XtDefaultFont
+ forceColumns Columns Boolean False **5
+ foreground Foreground Pixel XtDefaultForeground
+ height Height Dimension 0 **1
+ insensitiveBorder Insensitive Pixmap Gray
+ internalHeight Height Dimension 2
+ internalWidth Width Dimension 4
+ list MList String * NULL **2
+ longest Longest int 0 **3 **4
+ mappedWhenManaged MappedWhenManaged Boolean True
+ numberStrings NumberStrings int 0 **4
+ pasteBuffer Boolean Boolean False
+ rowSpacing Spacing Dimension 4
+ sensitive Sensitive Boolean True
+ verticalMList Boolean Boolean False
+ width Width Dimension 0 **1
+ x Position Position 0
+ y Position Position 0
+
+ **1 - If the Width or Height of the list widget is zero (0) then the value
+ is set to the minimum size necessay to fit the entire list.
+
+ If both Width and Height are zero then they are adjusted to fit the
+ entire list that is created width the number of default columns
+ specified in the defaultColumns resource.
+
+ **2 - This is an array of strings the specify elements of the list.
+ This resource must be specified.
+ (What good is a list widget without a list?? :-)
+
+ **3 - Longest is the length of the widest string in pixels.
+
+ **4 - If either of these values are zero (0) then the list widget calculates
+ the correct value.
+
+ (This allows you to make startup faster if you already have
+ this information calculated)
+
+ NOTE: If the numberStrings value is zero the list must
+ be NULL terminated.
+
+ **5 - By setting the MList.Columns resource you can force the application to
+ have a given number of columns.
+
+ **6 - This returns the name and index of the item selected in an
+ XawMListReturnStruct that is pointed to by the client_data
+ in the CallbackProc.
+
+*/
+
+
+/*
+ * Value returned when there are no highlighted objects.
+ */
+
+#define XAW_LIST_NONE -1
+
+#define XtCMList "MList"
+#define XtCSpacing "Spacing"
+#define XtCColumns "Columns"
+#define XtCLongest "Longest"
+#define XtCNumberStrings "NumberStrings"
+
+#define XtNcursor "cursor"
+#define XtNcolumnSpacing "columnSpacing"
+#define XtNdefaultColumns "defaultColumns"
+#define XtNforceColumns "forceColumns"
+#define XtNlist "list"
+#define XtNlongest "longest"
+#define XtNnumberStrings "numberStrings"
+#define XtNpasteBuffer "pasteBuffer"
+#define XtNrowSpacing "rowSpacing"
+#define XtNverticalList "verticalList"
+
+/* Class record constants */
+
+extern WidgetClass mlistWidgetClass;
+
+typedef struct _MListClassRec *MListWidgetClass;
+typedef struct _MListRec *MListWidget;
+
+/* The list return structure. */
+
+typedef struct _XawMListReturnStruct {
+ String string;
+ int list_index;
+} XawMListReturnStruct;
+#ifdef XAW_BC
+/*************************************************************
+ * For Compatibility only. */
+
+#define XtMListReturnStruct XawMListReturnStruct
+
+#define XT_LIST_NONE XAW_LIST_NONE
+
+#define XtMListChange XawMListChange
+#define XtMListUnhighlight XawMListUnhighlight
+#define XtMListHighlight XawMListHighlight
+#define XtMListShowCurrent XawMListShowCurrent
+
+/*************************************************************/
+#endif /* XAW_BC */
+
+/******************************************************************
+ *
+ * Exported Functions
+ *
+ *****************************************************************/
+
+#ifdef __cplusplus
+extern "C" { /* for C++ V2.0 */
+#endif
+
+/* Function Name: XawMListChange.
+ * Description: Changes the list being used and shown.
+ * Arguments: w - the list widget.
+ * list - the new list.
+ * nitems - the number of items in the list.
+ * longest - the length (in Pixels) of the longest element
+ * in the list.
+ * resize - if TRUE the the list widget will
+ * try to resize itself.
+ * Returns: none.
+ * NOTE: If nitems of longest are <= 0 then they will be caluculated.
+ * If nitems is <= 0 then the list needs to be NULL terminated.
+ */
+
+extern void XawMListChange(
+#if NeedFunctionPrototypes
+ Widget /* w */,
+ String* /* list */,
+ int /* nitems */,
+ int /* longest */,
+#if NeedWidePrototypes
+ /* Boolean */ int /* resize */
+#else
+ Boolean /* resize */
+#endif
+#endif
+);
+
+/* Function Name: XawMListUnhighlight
+ * Description: unlights the current highlighted element.
+ * Arguments: w - the widget.
+ * Returns: none.
+ */
+
+extern void XawMListUnhighlight(
+#if NeedFunctionPrototypes
+ Widget, /* w */
+ int /* item */
+#endif
+);
+
+/* Function Name: XawMListHighlight
+ * Description: Highlights the given item.
+ * Arguments: w - the list widget.
+ * item - the item to highlight.
+ * Returns: none.
+ */
+
+extern void XawMListHighlight(
+#if NeedFunctionPrototypes
+ Widget /* w */,
+ int /* item */
+#endif
+);
+
+
+/* Function Name: XawMListShowCurrent
+ * Description: returns the currently highlighted object.
+ * Arguments: w - the list widget.
+ * numselected - for return value
+ * Returns: the info about the currently highlighted objects.
+ * numselected - the number of objects returned.
+ */
+
+extern XawMListReturnStruct * XawMListShowCurrent(
+#if NeedFunctionPrototypes
+ Widget /* w */
+ int * /* numselected */
+#endif
+);
+
+#ifdef __cplusplus
+} /* for C++ V2.0 */
+#endif
+
+#endif /* _XawMList_h */
+/* DON'T ADD STUFF AFTER THIS #endif */
--- /dev/null
+/*
+ * $XConsortium: MListP.h,v 1.12 89/12/11 15:09:04 kit Exp $
+ *
+ * Copyright 1989 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. M.I.T. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Chris D. Peterson, MIT X Consortium
+ */
+
+
+/*
+ * MListP.h - Private definitions for MList widget
+ *
+ * This is the MList widget, it is useful to display a list, without the
+ * overhead of having a widget for each item in the list. It allows
+ * the user to select an item in a list and notifies the application through
+ * a callback function.
+ *
+ * Created: 8/13/88
+ * By: Chris D. Peterson
+ * MIT - Project Athena
+ */
+
+#ifndef _XawMListP_h
+#define _XawMListP_h
+
+/***********************************************************************
+ *
+ * MList Widget Private Data
+ *
+ ***********************************************************************/
+
+#include <X11/Xaw/SimpleP.h>
+#include "MList.h"
+
+#define NO_HIGHLIGHT XAW_LIST_NONE
+#define OUT_OF_RANGE -1
+#define OKAY 0
+
+/* New fields for the MList widget class record */
+
+typedef struct {int foo;} MListClassPart;
+
+/* Full class record declaration */
+typedef struct _MListClassRec {
+ CoreClassPart core_class;
+ SimpleClassPart simple_class;
+ MListClassPart list_class;
+} MListClassRec;
+
+extern MListClassRec mlistClassRec;
+
+/* New fields for the MList widget record */
+typedef struct {
+ /* resources */
+ Pixel foreground;
+ Dimension internal_width,
+ internal_height,
+ column_space,
+ row_space;
+ int default_cols;
+ Boolean force_cols,
+ paste,
+ vertical_cols;
+ int longest;
+ int nitems; /* number of items in the list. */
+ XFontStruct *font;
+ String * list;
+ XtCallbackList callback;
+
+ /* private state */
+
+ int *is_highlighted,/* set to the items currently highlighted. */
+ nhighlighted, /* number of items hightlighted */
+ highlight, /*set to the item that should be highlighted.*/
+ col_width, /* width of each column. */
+ row_height, /* height of each row. */
+ nrows, /* number of rows in the list. */
+ ncols; /* number of columns in the list. */
+ GC normgc, /* a couple o' GC's. */
+ revgc,
+ graygc; /* used when inactive. */
+
+} MListPart;
+
+
+/****************************************************************
+ *
+ * Full instance record declaration
+ *
+ ****************************************************************/
+
+typedef struct _MListRec {
+ CorePart core;
+ SimplePart simple;
+ MListPart list;
+} MListRec;
+
+#endif /* _XawMListP_h */
--- /dev/null
+/*
+** Copyright (c) 1990 David E. Smyth
+**
+** This file was derived from work performed by Martin Brunecky at
+** Auto-trol Technology Corporation, Denver, Colorado, under the
+** following copyright:
+**
+*******************************************************************************
+* Copyright 1990 by Auto-trol Technology Corporation, Denver, Colorado.
+*
+* All Rights Reserved
+*
+* Permission to use, copy, modify, and distribute this software and its
+* documentation for any purpose and without fee is hereby granted, provided
+* that the above copyright notice appears on all copies and that both the
+* copyright and this permission notice appear in supporting documentation
+* and that the name of Auto-trol not be used in advertising or publicity
+* pertaining to distribution of the software without specific, prior written
+* permission.
+*
+* Auto-trol disclaims all warranties with regard to this software, including
+* all implied warranties of merchantability and fitness, in no event shall
+* Auto-trol be liable for any special, indirect or consequential damages or
+* any damages whatsoever resulting from loss of use, data or profits, whether
+* in an action of contract, negligence or other tortious action, arising out
+* of or in connection with the use or performance of this software.
+*******************************************************************************
+**
+** Redistribution and use in source and binary forms are permitted
+** provided that the above copyright notice and this paragraph are
+** duplicated in all such forms and that any documentation, advertising
+** materials, and other materials related to such distribution and use
+** acknowledge that the software was developed by David E. Smyth. The
+** name of David E. Smyth may not be used to endorse or promote products
+** derived from this software without specific prior written permission.
+** THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+** WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+*/
+
+/*
+* SCCS_data: @(#)MriRegAll.c 1.0 ( 19 June 1990 )
+*
+* This module contains registration routine for all Motif
+* widget/gadget constructors and classes.
+*
+* Module_interface_summary:
+*
+* void MriRegisterMotif ( XtAppContext app )
+*
+*******************************************************************************
+*/
+
+#include <Xm/Xm.h>
+
+#include <Xm/ArrowB.h>
+#include <Xm/ArrowBG.h>
+#include <Xm/BulletinB.h>
+#include <Xm/CascadeB.h>
+#include <Xm/CascadeBG.h>
+#include <Xm/Command.h>
+#include <Xm/DialogS.h>
+#include <Xm/DrawingA.h>
+#include <Xm/DrawnB.h>
+#include <Xm/FileSB.h>
+#include <Xm/Form.h>
+#include <Xm/Frame.h>
+#include <Xm/Label.h>
+#include <Xm/LabelG.h>
+#include <Xm/List.h>
+#include <Xm/MainW.h>
+#include <Xm/MenuShell.h>
+#include <Xm/MessageB.h>
+#include <Xm/PanedW.h>
+#include <Xm/PushB.h>
+#include <Xm/PushBG.h>
+#include <Xm/RowColumn.h>
+#include <Xm/Scale.h>
+#include <Xm/ScrollBar.h>
+#include <Xm/ScrolledW.h>
+#include <Xm/SelectioB.h>
+#include <Xm/SeparatoG.h>
+#include <Xm/Separator.h>
+#include <Xm/Text.h>
+#include <Xm/ToggleB.h>
+#include <Xm/ToggleBG.h>
+
+void MriRegisterMotif ( app )
+ XtAppContext app;
+{
+#define RCO( name, func ) WcRegisterConstructor ( app, name, func )
+#define RCN( name, class ) WcRegisterClassName ( app, name, class )
+#define RCP( name, class ) WcRegisterClassPtr ( app, name, class )
+
+/* -- register all Motif constructors */
+ RCO( "XmCreateArrowButton", XmCreateArrowButton );
+ RCO( "XmCreateArrowButtonGadget", XmCreateArrowButtonGadget );
+ RCO( "XmCreateBulletinBoard", XmCreateBulletinBoard );
+ RCO( "XmCreateBulletinBoardDialog", XmCreateBulletinBoardDialog );
+ RCO( "XmCreateCascadeButton", XmCreateCascadeButton );
+ RCO( "XmCreateCascadeButtonGadget", XmCreateCascadeButtonGadget );
+ RCO( "XmCreateCommand", XmCreateCommand );
+ RCO( "XmCreateDialogShell", XmCreateDialogShell );
+ RCO( "XmCreateDrawingArea", XmCreateDrawingArea );
+ RCO( "XmCreateDrawnButton", XmCreateDrawnButton );
+ RCO( "XmCreateErrorDialog", XmCreateErrorDialog );
+ RCO( "XmCreateFileSelectionBox", XmCreateFileSelectionBox );
+ RCO( "XmCreateFileSelectionDialog", XmCreateFileSelectionDialog );
+ RCO( "XmCreateForm", XmCreateForm );
+ RCO( "XmCreateFormDialog", XmCreateFormDialog );
+ RCO( "XmCreateFrame", XmCreateFrame );
+ RCO( "XmCreateInformationDialog", XmCreateInformationDialog );
+ RCO( "XmCreateLabel", XmCreateLabel );
+ RCO( "XmCreateLabelGadget", XmCreateLabelGadget );
+ RCO( "XmCreateList", XmCreateList );
+ RCO( "XmCreateMainWindow", XmCreateMainWindow );
+ RCO( "XmCreateMenuBar", XmCreateMenuBar );
+ RCO( "XmCreateMenuShell", XmCreateMenuShell );
+ RCO( "XmCreateMessageBox", XmCreateMessageBox );
+ RCO( "XmCreateMessageDialog", XmCreateMessageDialog );
+ RCO( "XmCreateOptionMenu", XmCreateOptionMenu );
+ RCO( "XmCreatePanedWindow", XmCreatePanedWindow );
+ RCO( "XmCreatePopupMenu", XmCreatePopupMenu );
+ RCO( "XmCreatePromptDialog", XmCreatePromptDialog );
+ RCO( "XmCreatePulldownMenu", XmCreatePulldownMenu );
+ RCO( "XmCreatePushButton", XmCreatePushButton );
+ RCO( "XmCreatePushButtonGadget", XmCreatePushButtonGadget );
+ RCO( "XmCreateQuestionDialog", XmCreateQuestionDialog );
+ RCO( "XmCreateRadioBox", XmCreateRadioBox );
+ RCO( "XmCreateRowColumn", XmCreateRowColumn );
+ RCO( "XmCreateScale", XmCreateScale );
+ RCO( "XmCreateScrollBar", XmCreateScrollBar );
+ RCO( "XmCreateScrolledList", XmCreateScrolledList );
+ RCO( "XmCreateScrolledText", XmCreateScrolledText );
+ RCO( "XmCreateScrolledWindow", XmCreateScrolledWindow );
+ RCO( "XmCreateSelectionBox", XmCreateSelectionBox );
+ RCO( "XmCreateSelectionDialog", XmCreateSelectionDialog );
+ RCO( "XmCreateSeparator", XmCreateSeparator );
+ RCO( "XmCreateSeparatorGadget", XmCreateSeparatorGadget );
+ RCO( "XmCreateText", XmCreateText );
+ RCO( "XmCreateToggleButton", XmCreateToggleButton );
+ RCO( "XmCreateToggleButtonGadget", XmCreateToggleButtonGadget );
+ RCO( "XmCreateWarningDialog", XmCreateWarningDialog );
+ RCO( "XmCreateWorkingDialog", XmCreateWorkingDialog );
+
+/* -- register Motif widget classes */
+ RCP("xmArrowButtonWidgetClass", xmArrowButtonWidgetClass );
+ RCN("XmArrowButton", xmArrowButtonWidgetClass );
+ RCP("xmArrowButtonGadgetClass", xmArrowButtonGadgetClass );
+ RCN("XmArrowButtonGadget", xmArrowButtonGadgetClass );
+ RCP("xmBulletinBoardWidgetClass", xmBulletinBoardWidgetClass );
+ RCN("XmBulletinBoard", xmBulletinBoardWidgetClass );
+ RCP("xmCascadeButtonWidgetClass", xmCascadeButtonWidgetClass );
+ RCN("XmCascadeButton", xmCascadeButtonWidgetClass );
+ RCP("xmCascadeButtonGadgetClass", xmCascadeButtonGadgetClass );
+ RCN("XmCascadeButtonGadget", xmCascadeButtonGadgetClass );
+ RCP("xmCommandWidgetClass", xmCommandWidgetClass );
+ RCN("XmCommand", xmCommandWidgetClass );
+ RCP("xmDialogShellWidgetClass", xmDialogShellWidgetClass );
+ RCN("XmDialogShell", xmDialogShellWidgetClass );
+ RCP("xmDrawingAreaWidgetClass", xmDrawingAreaWidgetClass );
+ RCN("XmDrawingArea", xmDrawingAreaWidgetClass );
+ RCP("xmDrawnButtonWidgetClass", xmDrawnButtonWidgetClass );
+ RCN("XmDrawnButton", xmDrawnButtonWidgetClass );
+ RCP("xmFileSelectionBoxWidgetClass", xmFileSelectionBoxWidgetClass );
+ RCN("XmFileSelectionBox", xmFileSelectionBoxWidgetClass );
+ RCP("xmFormWidgetClass", xmFormWidgetClass );
+ RCN("XmForm", xmFormWidgetClass );
+ RCP("xmFrameWidgetClass", xmFrameWidgetClass );
+ RCN("XmFrame", xmFrameWidgetClass );
+ RCP("xmGadgetClass", xmGadgetClass );
+ RCN("XmGadget", xmGadgetClass );
+ RCP("xmLabelWidgetClass", xmLabelWidgetClass );
+ RCN("XmLabel", xmLabelWidgetClass );
+ RCP("xmLabelGadgetClass", xmLabelGadgetClass );
+ RCN("XmLabelGadget", xmLabelGadgetClass );
+ RCP("xmListWidgetClass", xmListWidgetClass );
+ RCN("XmList", xmListWidgetClass );
+ RCP("xmMainWindowWidgetClass", xmMainWindowWidgetClass );
+ RCN("XmMainWindow", xmMainWindowWidgetClass );
+ RCP("xmManagerWidgetClass", xmManagerWidgetClass );
+ RCN("XmManager", xmManagerWidgetClass );
+ RCP("xmMenuShellWidgetClass", xmMenuShellWidgetClass );
+ RCN("XmMenuShell", xmMenuShellWidgetClass );
+ RCP("xmMessageBoxWidgetClass", xmMessageBoxWidgetClass );
+ RCN("XmMessageBox", xmMessageBoxWidgetClass );
+ RCP("xmPanedWindowWidgetClass", xmPanedWindowWidgetClass );
+ RCN("XmPanedWindow", xmPanedWindowWidgetClass );
+ RCP("xmPrimitiveWidgetClass", xmPrimitiveWidgetClass );
+ RCN("XmPrimitive", xmPrimitiveWidgetClass );
+ RCP("xmPushButtonWidgetClass", xmPushButtonWidgetClass );
+ RCN("XmPushButton", xmPushButtonWidgetClass );
+ RCP("xmPushButtonGadgetClass", xmPushButtonGadgetClass );
+ RCN("XmPushButtonGadget", xmPushButtonGadgetClass );
+ RCP("xmRowColumnWidgetClass", xmRowColumnWidgetClass );
+ RCN("XmRowColumn", xmRowColumnWidgetClass );
+ RCP("xmScaleWidgetClass", xmScaleWidgetClass );
+ RCN("XmScale", xmScaleWidgetClass );
+ RCP("xmScrollBarWidgetClass", xmScrollBarWidgetClass );
+ RCN("XmScrollBar", xmScrollBarWidgetClass );
+ RCP("xmScrolledWindowWidgetClass", xmScrolledWindowWidgetClass );
+ RCN("XmScrolledWindow", xmScrolledWindowWidgetClass );
+ RCP("xmSelectionBoxWidgetClass", xmSelectionBoxWidgetClass );
+ RCN("XmSelectionBox", xmSelectionBoxWidgetClass );
+ RCP("xmSeparatorWidgetClass", xmSeparatorWidgetClass );
+ RCN("XmSeparator", xmSeparatorWidgetClass );
+ RCP("xmSeparatorGadgetClass", xmSeparatorGadgetClass );
+ RCN("XmSeparatorGadget", xmSeparatorGadgetClass );
+ RCP("xmTextWidgetClass", xmTextWidgetClass );
+ RCN("XmText", xmTextWidgetClass );
+ RCP("xmToggleButtonWidgetClass", xmToggleButtonWidgetClass );
+ RCN("XmToggleButton", xmToggleButtonWidgetClass );
+ RCP("xmToggleButtonGadgetClass", xmToggleButtonGadgetClass );
+ RCN("XmToggleButtonGadget", xmToggleButtonGadgetClass );
+
+#undef RCO
+#undef RCN
+#undef RCP
+}
--- /dev/null
+# $Header$
+#
+# Copyright 1993 by the Massachusetts Institute of Technology.
+#
+# For copying and distribution information,
+# please see the file <mit-copyright.h>.
+#
+# Imakefile for server directory.
+#
+
+SRCS = util.c moddiff.c ca.c passwd.c zephyr.c aliases.c hesiod.c \
+ nfs.c mailhub.c mitdir.c prlogger.c stats.c sis.c pobox.c \
+ letter.c
+OBJS = util.o moddiff.o ca.o passwd.o zephyr.o aliases.o hesiod.o \
+ nfs.o mailhub.o mitdir.o prlogger.o stats.o sis.o pobox.o \
+ letter.o
+CODE = util.c moddiff.dc ca.dc passwd.dc zephyr.dc aliases.dc hesiod.dc \
+ nfs.dc mailhub.dc mitdir.dc prlogger.dc stats.dc sis.dc pobox.dc \
+ letter.dc
+LIBS = -L/usr/athena/lib ../lib/libmoira.a -lcom_err -lzephyr \
+ ../server/libmrglue.a /mit/gdss/`machtype`/libgdss.a \
+ -lkrb -ldes -lhesiod ${SQL_LIB}
+SRCDIR = $(SRCTOP)/gen
+DEFINES = -I/mit/gdss/include
+sqlrule()
+
+program(ca.gen, ca.o util.o moddiff.o,${MR_LIBDEP},${LIBS},${PROGDIR})
+sqlfile(moddiff)
+sqlfile(ca)
+program(passwd.gen, passwd.o util.o moddiff.o,${MR_LIBDEP},${LIBS},${PROGDIR})
+sqlfile(passwd)
+program(zephyr.gen, zephyr.o util.o moddiff.o,${MR_LIBDEP},${LIBS},${PROGDIR})
+sqlfile(zephyr)
+program(aliases.gen, aliases.o util.o moddiff.o,${MR_LIBDEP},${LIBS},${PROGDIR})
+sqlfile(aliases)
+program(hesiod.gen, hesiod.o util.o moddiff.o,${MR_LIBDEP},${LIBS},${PROGDIR})
+sqlfile(hesiod)
+program(nfs.gen, nfs.o util.o moddiff.o,${MR_LIBDEP},${LIBS},${PROGDIR})
+sqlfile(nfs)
+program(mailhub.gen, mailhub.o util.o moddiff.o,${MR_LIBDEP},${LIBS},${PROGDIR})
+sqlfile(mailhub)
+program(mitdir.gen, mitdir.o util.o moddiff.o,${MR_LIBDEP},${LIBS},${PROGDIR})
+sqlfile(mitdir)
+program(prlogger.gen, prlogger.o util.o moddiff.o,${MR_LIBDEP},${LIBS},${PROGDIR})
+sqlfile(prlogger)
+program(stats.gen, stats.o util.o moddiff.o,${MR_LIBDEP},${LIBS},${PROGDIR})
+sqlfile(stats)
+program(sis.gen, sis.o util.o moddiff.o,${MR_LIBDEP},${LIBS},${PROGDIR})
+sqlfile(sis)
+program(pobox.gen, pobox.o util.o moddiff.o,${MR_LIBDEP},${LIBS},${PROGDIR})
+sqlfile(pobox)
+program(letter.gen, letter.o util.o moddiff.o,${MR_LIBDEP},${LIBS},${PROGDIR})
+sqlfile(letter)
--- /dev/null
+# $Header$
+
+AFSDIR = /mit/afsdev/bld/dest
+AFSLIBS=$(AFSDIR)/lib/afs/libprot.a $(AFSDIR)/lib/afs/libauth.a \
+ $(AFSDIR)/lib/libubik.a $(AFSDIR)/lib/afs/util.a \
+ $(AFSDIR)/lib/librxkad.a $(AFSDIR)/lib/afs/libsys.a \
+ $(AFSDIR)/lib/librx.a $(AFSDIR)/lib/liblwp.a
+
+SRCS = afs.c ksrvtgt.c
+CODE = $(SRCS)
+DEBUG = -O
+CFLAGS = -I../include -I$(AFSDIR)/include -I/usr/athena/include $(DEBUG)
+LIBS = -L../lib -L/usr/athena/lib -lmoira -lzephyr -lmrgdb -lcom_err -lhesiod -lkrb -ldes
+SRCDIR = $(SRCTOP)/incremental
+
+program(afs.incr,afs.o,,${AFSLIBS} ${LIBS},${PROGDIR})
+program(ksrvtgt,ksrvtgt.o,,${LIBS},${PROGDIR})