184d9c625SLionel Sambuc /*-
284d9c625SLionel Sambuc * Copyright (c) 1996
384d9c625SLionel Sambuc * Rob Zimmermann. All rights reserved.
484d9c625SLionel Sambuc * Copyright (c) 1996
584d9c625SLionel Sambuc * Keith Bostic. All rights reserved.
684d9c625SLionel Sambuc *
784d9c625SLionel Sambuc * See the LICENSE file for redistribution information.
884d9c625SLionel Sambuc */
984d9c625SLionel Sambuc
1084d9c625SLionel Sambuc #include "config.h"
1184d9c625SLionel Sambuc
12*0a6a1f1dSLionel Sambuc #include <sys/cdefs.h>
13*0a6a1f1dSLionel Sambuc #if 0
1484d9c625SLionel Sambuc #ifndef lint
1584d9c625SLionel Sambuc static const char sccsid[] = "Id: m_prompt.c,v 8.8 2003/11/05 17:10:00 skimo Exp (Berkeley) Date: 2003/11/05 17:10:00 ";
1684d9c625SLionel Sambuc #endif /* not lint */
17*0a6a1f1dSLionel Sambuc #else
18*0a6a1f1dSLionel Sambuc __RCSID("$NetBSD: m_prompt.c,v 1.2 2014/01/26 21:43:45 christos Exp $");
19*0a6a1f1dSLionel Sambuc #endif
2084d9c625SLionel Sambuc
2184d9c625SLionel Sambuc #include <sys/types.h>
2284d9c625SLionel Sambuc #include <sys/queue.h>
2384d9c625SLionel Sambuc
2484d9c625SLionel Sambuc #include <X11/X.h>
2584d9c625SLionel Sambuc #include <X11/Intrinsic.h>
2684d9c625SLionel Sambuc #include <Xm/MessageB.h>
2784d9c625SLionel Sambuc
2884d9c625SLionel Sambuc #include <bitstring.h>
2984d9c625SLionel Sambuc #include <stdio.h>
3084d9c625SLionel Sambuc #include <stdlib.h>
3184d9c625SLionel Sambuc #include <string.h>
3284d9c625SLionel Sambuc
3384d9c625SLionel Sambuc #undef LOCK_SUCCESS
3484d9c625SLionel Sambuc #include "../common/common.h"
3584d9c625SLionel Sambuc #include "../ipc/ip.h"
3684d9c625SLionel Sambuc #include "m_motif.h"
3784d9c625SLionel Sambuc
3884d9c625SLionel Sambuc
vi_fatal_message(Widget parent,String str)3984d9c625SLionel Sambuc void vi_fatal_message(Widget parent, String str)
4084d9c625SLionel Sambuc {
4184d9c625SLionel Sambuc Widget db = XmCreateErrorDialog( parent, "Fatal", NULL, 0 );
4284d9c625SLionel Sambuc XmString msg = XmStringCreateSimple( str );
4384d9c625SLionel Sambuc
4484d9c625SLionel Sambuc XtVaSetValues( XtParent(db),
4584d9c625SLionel Sambuc XmNtitle, "Fatal",
4684d9c625SLionel Sambuc 0
4784d9c625SLionel Sambuc );
4884d9c625SLionel Sambuc XtVaSetValues( db,
4984d9c625SLionel Sambuc XmNmessageString, msg,
5084d9c625SLionel Sambuc 0
5184d9c625SLionel Sambuc );
5284d9c625SLionel Sambuc XtAddCallback( XtParent(db), XmNpopdownCallback, __vi_cancel_cb, 0 );
5384d9c625SLionel Sambuc
5484d9c625SLionel Sambuc XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_CANCEL_BUTTON ) );
5584d9c625SLionel Sambuc XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_HELP_BUTTON ) );
5684d9c625SLionel Sambuc
5784d9c625SLionel Sambuc __vi_modal_dialog( db );
5884d9c625SLionel Sambuc
5984d9c625SLionel Sambuc exit(0);
6084d9c625SLionel Sambuc }
6184d9c625SLionel Sambuc
6284d9c625SLionel Sambuc
vi_info_message(Widget parent,String str)6384d9c625SLionel Sambuc void vi_info_message(Widget parent, String str)
6484d9c625SLionel Sambuc {
6584d9c625SLionel Sambuc static Widget db = NULL;
6684d9c625SLionel Sambuc XmString msg = XmStringCreateSimple( str );
6784d9c625SLionel Sambuc
6884d9c625SLionel Sambuc if ( db == NULL )
6984d9c625SLionel Sambuc db = XmCreateInformationDialog( parent, "Information", NULL, 0 );
7084d9c625SLionel Sambuc
7184d9c625SLionel Sambuc XtVaSetValues( XtParent(db),
7284d9c625SLionel Sambuc XmNtitle, "Information",
7384d9c625SLionel Sambuc 0
7484d9c625SLionel Sambuc );
7584d9c625SLionel Sambuc XtVaSetValues( db,
7684d9c625SLionel Sambuc XmNmessageString, msg,
7784d9c625SLionel Sambuc 0
7884d9c625SLionel Sambuc );
7984d9c625SLionel Sambuc XtAddCallback( XtParent(db), XmNpopdownCallback, __vi_cancel_cb, 0 );
8084d9c625SLionel Sambuc
8184d9c625SLionel Sambuc XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_CANCEL_BUTTON ) );
8284d9c625SLionel Sambuc XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_HELP_BUTTON ) );
8384d9c625SLionel Sambuc
8484d9c625SLionel Sambuc __vi_modal_dialog( db );
8584d9c625SLionel Sambuc }
86