1
/* $XConsortium: i18ninput.c /main/5 1995/07/15 20:45:37 drk $ */
3
* @OPENGROUP_COPYRIGHT@
5
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
6
* Copyright (c) 1996, 1997, 1998, 1999, 2000 The Open Group
7
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
8
* the full copyright text.
10
* This software is subject to an open license. It may only be
11
* used on, with or for operating systems which are themselves open
12
* source systems. You must contact The Open Group for a license
13
* allowing distribution and sublicensing of this software on, with,
14
* or for operating systems which are not Open Source programs.
16
* See http://www.opengroup.org/openmotif/license for full
17
* details of the license agreement. Any use, reproduction, or
18
* distribution of the program constitutes recipient's acceptance of
21
* EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
22
* PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23
* KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
24
* WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
25
* OR FITNESS FOR A PARTICULAR PURPOSE
27
* EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
28
* NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT,
29
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30
* DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED
31
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33
* ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
34
* EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
35
* POSSIBILITY OF SUCH DAMAGES.
47
#include <X11/Intrinsic.h>
50
static XtAppContext app_context;
52
static String fallback_reslist[] = {
53
"*font.label.labelString: Select font",
54
"*font*button1.labelString: Small",
55
"*font*button1.renderTable: *medium*-r-*--14*:",
56
"*font*button2.labelString: Medium",
57
"*font*button2.renderTable: *medium*-r-*--18*:",
58
"*font*button3.labelString: Large",
59
"*font*button3.renderTable: *medium*-r-*--24*:",
60
"*color.label.labelString: Select color",
61
"*color*button1.labelString: Red",
62
"*color*button1.foreground: #fe5151",
63
"*color*button2.labelString: Green",
64
"*color*button2.foreground: #00be51",
65
"*color*button3.labelString: Blue",
66
"*color*button3.foreground: #2aa1fd",
67
"*XmText.renderTable: *medium*-r-*--18*:",
68
"*XmTextField.renderTable: *medium*-r-*--18*:",
72
extern int dialog_init(int *argc, char **argv, Display *dpy);
74
/****************************************************************
76
****************************************************************/
77
static char *base(char *str)
79
static char basename[300];
82
if ((p = strrchr(str, '/')))
83
(void) strcpy(basename, p+1);
85
(void) strcpy(basename, str);
86
if ((p = strrchr(basename, '.')))
92
/**************************************************************
94
**************************************************************/
95
int main(int argc, char **argv)
100
(void) strncpy(name, base(argv[0]), 132);
102
/* Initialize the X Intrinsics */
103
XtToolkitInitialize();
105
/* Set up language environment for X */
106
XtSetLanguageProc(NULL, (XtLanguageProc)NULL, NULL);
108
/* Create application context */
109
app_context = XtCreateApplicationContext();
110
XtAppSetFallbackResources(app_context, fallback_reslist);
112
/* open up one display */
113
display = XtOpenDisplay(app_context,
115
name, "XmdI18nInput",
116
(XrmOptionDescRec *)NULL, 0,
119
(void) fprintf(stderr, "Unable to open display\n");
123
/* Call init functions. This creates the user interface
124
(placed in input.c) */
125
if (dialog_init(&argc, argv, display) != 0)
128
XtAppMainLoop(app_context);
130
return 0; /* make compiler happy */