1/*
2
3Copyright 1988, 1998  The Open Group
4
5Permission to use, copy, modify, distribute, and sell this software and its
6documentation for any purpose is hereby granted without fee, provided that
7the above copyright notice appear in all copies and that both that
8copyright notice and this permission notice appear in supporting
9documentation.
10
11The above copyright notice and this permission notice shall be included
12in all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
18OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20OTHER DEALINGS IN THE SOFTWARE.
21
22Except as contained in this notice, the name of The Open Group shall
23not be used in advertising or otherwise to promote the sale, use or
24other dealings in this Software without prior written authorization
25from The Open Group.
26
27*/
28/*
29 * Copyright (c) 2006, Oracle and/or its affiliates.
30 *
31 * Permission is hereby granted, free of charge, to any person obtaining a
32 * copy of this software and associated documentation files (the "Software"),
33 * to deal in the Software without restriction, including without limitation
34 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
35 * and/or sell copies of the Software, and to permit persons to whom the
36 * Software is furnished to do so, subject to the following conditions:
37 *
38 * The above copyright notice and this permission notice (including the next
39 * paragraph) shall be included in all copies or substantial portions of the
40 * Software.
41 *
42 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
43 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
44 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
45 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
46 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
47 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
48 * DEALINGS IN THE SOFTWARE.
49 */
50
51/*
52 * xdm - display manager daemon
53 * Author:  Keith Packard, MIT X Consortium
54 */
55
56
57#ifndef _XtLogin_h
58# define _XtLogin_h
59
60/***********************************************************************
61 *
62 * Login Widget
63 *
64 ***********************************************************************/
65
66/* Parameters:
67
68 Name		     Class		RepType		Default Value
69 ----		     -----		-------		-------------
70 background	     Background		pixel		White
71 border		     BorderColor	pixel		Black
72 borderWidth	     BorderWidth	int		1
73 foreground	     Foreground		Pixel		Black
74 height		     Height		int		120
75 mappedWhenManaged   MappedWhenManaged	Boolean		True
76 width		     Width		int		120
77 x		     Position		int		0
78 y		     Position		int		0
79
80*/
81
82# define XtNgreeting		"greeting"
83# define XtNunsecureGreeting	"unsecureGreeting"
84# define XtNnamePrompt		"namePrompt"
85# define XtNpasswdPrompt	"passwdPrompt"
86# define XtNfail		"fail"
87# define XtNnotifyDone		"notifyDone"
88# define XtNpromptColor		"promptColor"
89# define XtNgreetColor		"greetColor"
90# define XtNfailColor		"failColor"
91# define XtNpromptFont		"promptFont"
92# define XtNgreetFont		"greetFont"
93# define XtNfailFont		"failFont"
94# define XtNpromptFace		"promptFace"
95# define XtNgreetFace		"greetFace"
96# define XtNfailFace		"failFace"
97# define XtNfailTimeout		"failTimeout"
98# define XtNsessionArgument	"sessionArgument"
99# define XtNsecureSession	"secureSession"
100# define XtNallowAccess		"allowAccess"
101# define XtNallowNullPasswd	"allowNullPasswd"
102# define XtNallowRootLogin	"allowRootLogin"
103# define XtNechoPasswd		"echoPasswd"
104# define XtNechoPasswdChar	"echoPasswdChar"
105
106# define XtNface 		"face"
107# define XtCFace		"Face"
108# define XtRXftFont		"XftFont"
109# define XtRXftColor		"XftColor"
110
111/* added by Amit Margalit Oct 1996 */
112# define XtNhiColor		"hiColor"
113# define XtNshdColor		"shdColor"
114# define XtNinpColor		"inpColor"
115# define XtNframeWidth		"frameWidth"
116# define XtCFrameWidth		"FrameWidth"
117# define XtNinnerFramesWidth	"innerFramesWidth"
118# define XtNsepWidth		"sepWidth"
119
120# ifdef DANCING
121/* caolan begin */
122#  define XtNlastEventTime	"lastEventTime"
123#  define XtCLastEventTime	"LastEventTime"
124/* caolan end */
125# endif /* DANCING */
126
127# ifdef XPM
128#  define XtNuseShape		"useShape"
129#  define XtCUseShape		"UseShape"
130#  define XtNlogoFileName	"logoFileName"
131#  define XtCLogoFileName	"LogoFileName"
132#  define XtNlogoPadding	"logoPadding"
133#  define XtCLogoPadding	"LogoPadding"
134# endif /* XPM */
135
136# define XtCGreeting		"Greeting"
137# define XtCNamePrompt		"NamePrompt"
138# define XtCPasswdPrompt	"PasswdPrompt"
139# define XtCFail		"Fail"
140# define XtCFailTimeout		"FailTimeout"
141# define XtCSessionArgument	"SessionArgument"
142# define XtCSecureSession	"SecureSession"
143# define XtCAllowAccess		"AllowAccess"
144# define XtCAllowNullPasswd	"AllowNullPasswd"
145# define XtCAllowRootLogin	"AllowRootLogin"
146# define XtCEchoPasswd		"EchoPasswd"
147# define XtCEchoPasswdChar	"EchoPasswdChar"
148
149# define XtNchangePasswdMessage	"changePasswdMessage"
150# define XtCChangePasswdMessage	"ChangePasswdMessage"
151
152/* notifyDone interface definition */
153
154# ifdef __OpenBSD__
155#  include <sys/param.h>
156# endif
157
158# include <pwd.h>
159# include <limits.h>
160
161# ifdef USE_PAM
162#  define NAME_LEN	PAM_MAX_RESP_SIZE
163#  define PASSWORD_LEN	PAM_MAX_RESP_SIZE
164# endif
165
166/* Defined to be in <limits.h> by SUSv2 */
167# if !defined(PASSWORD_LEN) && defined(PASS_MAX)
168#  define PASSWORD_LEN PASS_MAX
169# endif
170
171/* _PW_NAME_LEN is found in <pwd.h> on OpenBSD > 2.8 (200012) */
172# if !defined(NAME_LEN) && defined(_PW_NAME_LEN)
173#  define NAME_LEN	(_PW_NAME_LEN + 2)
174# endif
175
176/* _PASSWORD_LEN appears to come from 4.4BSD-Lite <pwd.h> */
177# if !defined(PASSWORD_LEN) && defined(_PASSWORD_LEN)
178#  define PASSWORD_LEN	(_PASSWORD_LEN + 2)
179# endif
180
181/* Fallbacks if no other definition found */
182# ifndef NAME_LEN
183#  define NAME_LEN	32
184# endif
185
186# ifndef PASSWORD_LEN
187#  define PASSWORD_LEN	32
188# endif
189
190typedef struct _LoginData {
191	char	name[NAME_LEN], passwd[PASSWORD_LEN];
192} LoginData;
193
194# define NOTIFY_OK	0
195# define NOTIFY_ABORT	1
196# define NOTIFY_RESTART	2
197# define NOTIFY_ABORT_DISPLAY	3
198
199typedef struct _LoginRec *LoginWidget;  /* completely defined in LoginPrivate.h */
200typedef struct _LoginClassRec *LoginWidgetClass;    /* completely defined in LoginPrivate.h */
201
202extern WidgetClass loginWidgetClass;
203
204extern void ErrorMessage(Widget ctx, const char *message, Bool timeout);
205extern void ShowChangePasswdMessage(Widget ctx);
206
207typedef enum {
208    LOGIN_PROMPT_NOT_SHOWN,	/* Neither prompt nor input shown */
209    LOGIN_PROMPT_ECHO_ON,	/* Both prompt and input shown */
210    LOGIN_PROMPT_ECHO_OFF,	/* Prompt shown, input accepted but not
211				   shown (bullets may be shown instead) */
212    LOGIN_TEXT_INFO		/* Prompt shown, no input area */
213} loginPromptState;
214
215/* Default prompt meanings for simple username/password auth systems */
216# define LOGIN_PROMPT_USERNAME 0
217# define LOGIN_PROMPT_PASSWORD 1
218
219extern int SetPrompt(Widget ctx, int promptId, const char *message,
220		     loginPromptState state, Boolean minimumTime);
221extern const char *GetPrompt(Widget ctx, int promptId);
222
223extern int SetValue(Widget ctx, int promptId, const char *value);
224extern const char *GetValue(Widget ctx, int promptId);
225
226#endif /* _XtLogin_h */
227/* DON'T ADD STUFF AFTER THIS #endif */
228