/*
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/************************************************************************/
/* */
/* Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993 */
/* by Digital Equipment Corp., Maynard, MA */
/* */
/* 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 appear in all */
/* copies and that both that copyright notice and this permission */
/* notice appear in supporting documentation, and that the name of */
/* Digital not be used in advertising or publicity pertaining to */
/* distribution of the software without specific, written prior */
/* permission. */
/* */
/* DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, */
/* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND */
/* FITNESS, IN NO EVENT SHALL DIGITAL 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. */
/* */
/************************************************************************/
/* */
/* AccessX */
/* */
/* This module is intended to provide access features for people */
/* with physical disabilities. This is a Motif client that */
/* communicates with the AccessX server extension and allows us to */
/* get visual feedback regarding the state of the AccessX features.*/
/* */
/* Revision History: */
/* */
/* 11-Jun-1993 WDW & MEN */
/* Develop sample implementation. */
/* */
/* 14-Aug-1993 JMS & WEJ */
/* Redesign GUI */
/* */
/************************************************************************/
/* Special constants needed for the accessx extension */
#define NEED_EVENTS
#define NEED_REPLIES
/************************************************************************/
/* */
/* Include Files */
/* */
/************************************************************************/
/* Standard C Include Files */
#include <stdio.h>
#include <stdlib.h>
/* X Window System Include Files */
#include <X11/Intrinsic.h>
/* accessx Specific Include Files */
#include "AccessXlib.h"
#include "AccessXproto.h"
#include "accessx.btm"
/* XKB files */
/* Help related files */
#include <locale.h>
/* Motif Toolkit Include Files */
#include <Xm/MessageB.h>
#include <Xm/ToggleBG.h>
/************************************************************************/
/* */
/* Forward Declarations */
/* */
/************************************************************************/
#define P(s) s
#else
#define P(s) ()
#endif
void AccessXEventHandler P((XAccessXEvent *));
/* Conversion Related Functions */
float ConvertScaleValueToUnits P((int, short));
int ConvertUnitsToScaleValue P((float, short));
/* State-of-Widget related Functions */
void SetStateFromView P((void));
void SetStateFromViewXKB P((void));
void SetStateFromViewAX P((void));
void SetViewFromState P((void));
void SetViewFromStateXKB P((void));
void SetViewFromStateAX P((void));
void SetSettingsViewFromState P((AccessXStateRec));
void SetStickyStatusViewFromState P((void));
void SetStickyStatusViewFromStateXKB P((void));
void SetStickyStatusViewFromStateAX P((void));
void SetMouseStatusViewFromState P((void));
void SetMouseStatusViewFromStateXKB P((void));
void SetMouseStatusViewFromStateAX P((void));
void UpdateWidgetSensitivity P((void));
void DisplayStatusDialogsIfNeeded P((void));
void SetDefaults P((void));
void SetDefaultsXKB P((void));
void SetDefaultsAX P((void));
/* UIL Callback Functions */
void CreateProc P((Widget, int *, unsigned long));
/* Help Facility Functions */
int GetSizeOfHelpText P((int));
Bool AllocateHelpTextMemory P((int));
Bool SetHelpText P((int));
/* Creation-Destruction Status Windows Functions */
void InitializeInterface P((unsigned int, char **));
void CreateAndMapStickyStatusWindow P((void));
void UnmapStickyStatusWindow P((void));
void CreateAndMapMouseStatusWindow P((void));
void UnmapMouseStatusWindow P((void));
/* Load-Save Related Functions */
char *ResolveResourceFileName P((void));
void LoadSettingsFromFile P((void));
void SaveSettingsToFile P((void));
void StoreSettingsWindowToDatabase P((void));
void RestoreSettingsWindowFromDatabase P((void));
/* XKB related functions */
#undef P
/************************************************************************/
/* */
/* X11, Xt, and Other Global Variables */
/* */
/************************************************************************/
/* X11, Xt and General Widgets Global Variables */
/* XKB stuff */
int xkbEventBase;
/* Widgets Shells and Dialogs */
/* Global Flags and State */
/************************************************************************/
/* */
/* Mrm & Motif Global Variables */
/* */
/************************************************************************/
};
/* Motif String Global Variables */
/************************************************************************/
/* */
/* Help Global variables */
/* */
/************************************************************************/
/* used for debugging.
#define ACCESSXHELP_DIRECTORY "./locale/"
*/
/************************************************************************/
/* */
/* Constant Declarations */
/* */
/************************************************************************/
/* WIDGET INDEXING DECLARATIONS */
/* Toggle Widgets */
/* Scale Widgets */
/* Main Menu Push Button Items */
/* Help Related Widgets */
/* Settings Window Related Widgets */
/* Sticky Keys Status Widgets */
/* Mouse Keys Status Widgets */
/* Load-Save Dialog Widgets */
/* This Should Reflect Current Designs */
/* Application Class String */
/************************************************************************/
/* */
/* Macro Definitions */
/* */
/************************************************************************/
"",
"*EnableAccessXToggle.set",
"*SoundOnOffToggle.set",
"*TimeOutToggle.set",
"*StickyKeysToggle.set",
"*MouseKeysToggle.set",
"*ToggleKeysToggle.set",
"*RepeatKeysToggle.set",
"*SlowKeysToggle.set",
"*BounceKeysToggle.set",
"*StickyModSoundToggle.set",
"*StickyTwoKeysToggle.set",
"*SlowKeysOnPressToggle.set",
"*SlowKeysOnAcceptToggle.set",
"*TimeOutScale",
"*MouseMaxSpeedScale",
"*MouseTimeToMaxScale",
"*KRGRepeatDelayScale",
"*KRGRepeatRateScale",
"*KRGSlowKeysDelayScale",
"*KRGDebounceScale" };
"",
"AccessX*ToggleButtonGadget.XmCSet",
"AccessX*ToggleButtonGadget.XmCSet",
"AccessX*ToggleButtonGadget.XmCSet",
"AccessX*ToggleButtonGadget.XmCSet",
"AccessX*ToggleButtonGadget.XmCSet",
"AccessX*ToggleButtonGadget.XmCSet",
"AccessX*ToggleButtonGadget.XmCSet",
"AccessX*ToggleButtonGadget.XmCSet",
"AccessX*ToggleButtonGadget.XmCSet",
"AccessX*ToggleButtonGadget.XmCSet",
"AccessX*ToggleButtonGadget.XmCSet",
"AccessX*ToggleButtonGadget.XmCSet",
"AccessX*ToggleButtonGadget.XmCSet",
"AccessX*XmScale",
"AccessX*XmScale",
"AccessX*XmScale",
"AccessX*XmScale",
"AccessX*XmScale",
"AccessX*XmScale",
"AccessX*XmScale" };
0,
/************************************************************************/
/* */
/* Application Resources */
/* */
/************************************************************************/
typedef struct
{
} OptionsRec;
{
};
};
/* The fallback resources are used to define the default values for
*/
"*EnableAccessXToggle.set: True",
"*SoundOnOffToggle.set: True",
"*ShowStatusToggle.set: False",
"*TimeOutToggle.set: False",
"*TimeOutScale.minimum: 1",
"*TimeOutScale.maximum: 10",
"*TimeOutScale.decimalPoints: 0",
"*TimeOutScale.value: 2",
"*StickyKeysToggle.set: False",
"*MouseKeysToggle.set: False",
"*ToggleKeysToggle.set: False",
"*RepeatKeysToggle.set: True",
"*SlowKeysToggle.set: False",
"*BounceKeysToggle.set: False",
"*StickyTwoKeysToggle.set: True",
"*StickyModSoundToggle.set: True",
"*MouseMaxSpeedScale.minimum: 1",
"*MouseMaxSpeedScale.maximum: 500",
"*MouseMaxSpeedScale.decimalPoints: 0",
"*MouseMaxSpeedScale.value: 300",
"*MouseAccelScale.minimum: 1",
"*MouseAccelScale.maximum: 40",
"*MouseAccelScale.decimalPoints: 1",
"*MouseAccelScale.value: 20",
"*MouseDelayScale.minimum: 1",
"*MouseDelayScale.maximum: 40",
"*MouseDelayScale.decimalPoints: 1",
"*MouseDelayScale.value: 3",
"*KRGRepeatRateScale.minimum: 1",
"*KRGRepeatRateScale.maximum: 400",
"*KRGRepeatRateScale.decimalPoints: 2",
"*KRGRepeatRateScale.value: 5",
"*KRGRepeatDelayScale.minimum: 1",
"*KRGRepeatDelayScale.maximum: 400",
"*KRGRepeatDelayScale.decimalPoints: 2",
"*KRGRepeatDelayScale.value: 66",
"*SlowKeysOnPressToggle.set: True",
"*SlowKeysOnAcceptToggle.set: True",
"*KRGSlowKeysDelayScale.minimum: 1",
"*KRGSlowKeysDelayScale.maximum: 40",
"*KRGSlowKeysDelayScale.decimalPoints: 1",
"*KRGSlowKeysDelayScale.value: 3",
"*KRGDebounceScale.minimum: 0",
"*KRGDebounceScale.maximum: 40",
"*KRGDebounceScale.decimalPoints: 1",
"*KRGDebounceScale.value: 3",
};
/************************************************************************/
/* */
/* AccessXEventHandler */
/* */
/* DESCRIPTION: */
/* */
/* Handle all events generated by the AccessX server extension. */
/* */
/************************************************************************/
#else
void AccessXEventHandler(event)
#endif
{
case X_AccessXStickyKeysOn:
if (options.automaticPopup) {
}
/*[[[should put a check in for sounds]]]*/
break;
case X_AccessXStickyKeysOff:
if (options.automaticPopup) {
}
/*[[[should put a check in for sounds]]]*/
break;
case X_AccessXMouseKeysOn:
if (options.automaticPopup) {
}
/*[[[should put a check in for sounds]]]*/
break;
case X_AccessXMouseKeysOff:
if (options.automaticPopup) {
}
/*[[[should put a check in for sounds]]]*/
break;
case X_AccessXKRGWarning:
/*[[[should put a check in for sounds]]]*/
break;
case X_AccessXKRGOn:
}
}
/*[[[should put a check in for sounds]]]*/
break;
case X_AccessXKRGOff:
/*[[[should put a check in for sounds]]]*/
break;
case X_AccessXToggleKeysOn:
break;
case X_AccessXToggleKeysOff:
break;
case X_AccessXToggleKeyDown:
/*[[[should put a check in for sounds]]]*/
break;
case X_AccessXToggleKeyUp:
/*[[[should put a check in for sounds]]]*/
break;
case X_AccessXModifierLatch:
}
}
}
}
}
}
}
break;
case X_AccessXModifierUnlatch:
}
}
}
}
}
}
}
break;
case X_AccessXModifierLock:
}
}
}
}
}
}
}
break;
case X_AccessXModifierUnlock:
}
}
}
}
}
}
}
break;
case X_AccessXPressSlowKey:
/*[[[should put a check in for sounds]]]*/
break;
case X_AccessXAcceptSlowKey:
/*[[[should put a check in for sounds]]]*/
break;
switch (event->keyOrButton) {
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
}
if (widgets[CURRENT_BUTTON_LBL]) {
}
break;
case X_AccessXPressButton:
switch (event->keyOrButton) {
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
#endif
}
break;
case X_AccessXReleaseButton:
switch (event->keyOrButton) {
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
#endif
}
break;
case X_AccessXChangeGain:
{
break;
}
}
} /* AccessXEventHandler */
/************************************************************************/
/* */
/* ConvertScaleValueToUnits */
/* */
/* Take a scale reading and a decimal point reading and returns */
/* a floating point number which is the value the scale really */
/* represents. The purpose of this function is to easily convert */
/* between both representations independent of what the value */
/* actually represents. */
/* */
/************************************************************************/
#else
int value;
short decimalPoints;
#endif
{
int i, j;
j = 1;
for (i = 0; i < decimalPoints; i++) {
j *= 10;
}
return ((float)value / (float)j);
}
/************************************************************************/
/* */
/* ConvertUnitsToScaleValue */
/* */
/* Take a floating point value and a decimal points reading and */
/* returns an adjusted integer value which may be used as a value */
/* for a scale widget. The purpose of this function is to easily */
/* convert between both representation independent of what the */
/* value actually represents. */
/* */
/************************************************************************/
#else
float value;
short decimalPoints;
#endif
{
int i, j;
j = 1;
for (i = 0; i < decimalPoints; i++) {
j *= 10;
}
return ((int)(value * (float)j));
}
/************************************************************************/
/* */
/* SetStateFromView */
/* */
/* Sets the state of the extension according to the state of the */
/* widgets in the interface. */
/* */
/************************************************************************/
void SetStateFromView(void)
#else
void SetStateFromView()
#endif
{
if(XKBExtension)
else
} /* SetStateFromView */
void SetStateFromViewXKB(void)
#else
void SetStateFromViewXKB()
#endif
{
unsigned long which;
int scaleValue;
short decimalPoints;
/********************************************************************/
/* */
/* Global values: Enable AccessX, Beep on Feature Use, TimeOut */
/* */
/********************************************************************/
{
}
else
{
}
/********************************************************************/
/* */
/* Keyboard Control: StickyKeys, MouseKeys, ToggleKeys */
/* */
/********************************************************************/
{
}
{
}
/********************************************************************/
/* */
/* Keyboard Response: RepeatKeys, SlowKeys, BounceKeys */
/* */
/********************************************************************/
/********************************************************************/
/* */
/* StickyKeys Settings: Auto Off, Modifiers Beep */
/* */
/********************************************************************/
/********************************************************************/
/* */
/* MouseKeys Settings: Speed Delay, Max Speed */
/* */
/********************************************************************/
/********************************************************************/
/* */
/* RepeatKeys Settings: Delay, Rate */
/* */
/********************************************************************/
/********************************************************************/
/* */
/* SlowKeys Settings: Beep On Press, Beep on Accept, Delay */
/* */
/********************************************************************/
/********************************************************************/
/* */
/* BounceKeys Settings: Delay */
/* */
/********************************************************************/
/********************************************************************/
/* */
/* Set the values. */
/* */
/********************************************************************/
} /* SetStateFromViewXKB */
void SetStateFromViewAX(void)
#else
void SetStateFromViewAX()
#endif
{
int i;
int scaleValue;
short decimalPoints;
for (i = TOGGLE_WIDGETS_MIN; i <= TOGGLE_WIDGETS_MAX; i++) {
if (XmToggleButtonGadgetGetState(widgets[i])) {
}
}
/* Do a special case for the Time Out toggle */
/* The scale reads "minutes" and we want to give the extension
* A timeout value in seconds.
*/
}
else {
req.timeOutInterval = 0;
}
/* The only thing we want to do a GetValues on are the scale widgets,
* so we only need to set the argument list up once.
*/
/* The scale reads "seconds" and we want to give the extension a
* value in milliseconds.
*/
* value in milliseconds/key.
*/
/* The scale reads "seconds" and we want to give the extension a
* value in milliseconds.
*/
/* The scale reads "seconds" and we want to give the extension a
* value in milliseconds.
*/
/* The scale reads "seconds" and we want to give the extension a
* value in seconds.
*/
* value in milliseconds/pixel.
*/
} /* SetStateFromViewAX */
/************************************************************************/
/* */
/* SetDefaults */
/* */
/* Sets the state of the extension to the below values */
/* */
/************************************************************************/
void SetDefaults(void)
#else
void SetDefaults()
#endif
{
if(XKBExtension)
else
} /* SetDefaults */
void SetDefaultsXKB(void)
#else
void SetDefaultsXKB()
#endif
{
unsigned long which;
} /* SetDefaultsXKB */
void SetDefaultsAX(void)
#else
void SetDefaultsAX()
#endif
{
int i;
short decimalPoints;
/* We don't want to do it for TIME_OUT_TGL, but that's OK */
for (i = MAIN_TOGGLE_WIDGETS_MIN; i <= MAIN_TOGGLE_WIDGETS_MAX; i++) {
}
/*XmToggleButtonSetState(widgets[TIME_OUT_TGL], False, False);*/
for (i = SETTINGS_TOGGLE_WIDGETS_MIN; i<=SETTINGS_TOGGLE_WIDGETS_MAX; i++)
/* The scale reads pixels per movement. */
/* The scale reads "seconds" and the extension gives us time in seconds. */
in milliseconds/pixel. */
/* The scale reads "seconds" but the extension gives us time
* in milliseconds. */
* in milliseconds/key. */
/* The scale reads "seconds" but the extension gives us time
* in milliseconds. */
/* The scale reads "seconds" but the extension gives us time
* in milliseconds. */
} /* SetDefaultsAX */
/************************************************************************/
/* */
/* SetViewFromState */
/* */
/* Sets the user interface state from the state of the extension. */
/* */
/************************************************************************/
void SetViewFromState(void)
#else
void SetViewFromState()
#endif
{
if(XKBExtension)
else
}
void SetViewFromStateXKB(void)
#else
void SetViewFromStateXKB()
#endif
{
short decimalPoints;
/********************************************************************/
/* */
/* Global values: Enable AccessX, Beep on Feature Use, TimeOut */
/* */
/********************************************************************/
else
else
{
}
else
{
}
{
}
{
}
/********************************************************************/
/* */
/* Keyboard Control: StickyKeys, MouseKeys, ToggleKeys */
/* */
/********************************************************************/
else
else
else
/********************************************************************/
/* */
/* Keyboard Response: RepeatKeys, SlowKeys, BounceKeys */
/* */
/********************************************************************/
else
else
else
/********************************************************************/
/* */
/* StickyKeys Settings: Auto Off, Modifiers Beep */
/* */
/********************************************************************/
else
else
/********************************************************************/
/* */
/* MouseKeys Settings: Max Speed, Acceleration, Delay */
/* */
/********************************************************************/
{
}
{
}
{
}
{
}
{
}
{
}
/********************************************************************/
/* */
/* RepeatKeys Settings: Delay, Rate */
/* */
/********************************************************************/
scaleVal = ConvertUnitsToScaleValue(((float)1.0 / (float)MILLISTOSECS(desc->ctrls->repeat_interval)),
{
}
{
}
{
}
{
}
/********************************************************************/
/* */
/* SlowKeys Settings: Beep On Press, Beep on Accept, Delay */
/* */
/********************************************************************/
else
else
{
}
{
}
/********************************************************************/
/* */
/* BounceKeys Settings: Delay */
/* */
/********************************************************************/
{
}
{
}
}
void SetViewFromStateAX(void)
#else
void SetViewFromStateAX()
#endif
{
int i, minimum;
short decimalPoints;
/* We don't want to do it for TIME_OUT_TGL, but that's OK */
for (i = MAIN_TOGGLE_WIDGETS_MIN; i <= MAIN_TOGGLE_WIDGETS_MAX; i++) {
}
else {
}
}
/* The scale reads "minutes" but the extension gives us time
* in seconds.
*/
if (state.timeOutInterval) {
}
else {
}
} /* SetViewFromState */
/************************************************************************/
/* */
/* SetSettingsViewFromState */
/* */
/************************************************************************/
#else
#endif
{
int i;
short decimalPoints;
for (i = SETTINGS_TOGGLE_WIDGETS_MIN; i<=SETTINGS_TOGGLE_WIDGETS_MAX; i++) {
}
else {
}
}
/* The scale reads pixels per movement. */
/* The scale reads "seconds" and the extension gives us time in seconds. */
in milliseconds/pixel. */
ConvertUnitsToScaleValue((float)(1.0 /
/* The scale reads "seconds" but the extension gives us time
* in milliseconds. */
* in milliseconds/key. */
((float)1.0 /
/* The scale reads "seconds" but the extension gives us time
* in milliseconds. */
/* The scale reads "seconds" but the extension gives us time
* in milliseconds. */
}
/************************************************************************/
/* */
/* SetStickyStatusViewFromState */
/* */
/************************************************************************/
void SetStickyStatusViewFromState(void)
#else
void SetStickyStatusViewFromState()
#endif
{
if(XKBExtension)
else
}/* SetStickyStatusViewFromState */
void SetStickyStatusViewFromStateXKB(void)
#else
#endif
{
/* Emtpy all mod settings first */
/* Now set all the mods */
}
}
}
}
}
}
}
}
}
}
}
}
}
}/* SetStickyStatusViewFromStateXKB */
void SetStickyStatusViewFromStateAX(void)
#else
#endif
{
}
else {
}
}
else {
}
}
else {
}
}
else {
}
}
else {
}
}
else {
}
}
else {
}
}
else {
}
}
else {
}
}
else {
}
}
else {
}
}
else {
}
}
else {
}
}
else {
}
} /* SetStickyStatusViewFromStateAX */
/************************************************************************/
/* */
/* SetMouseStatusViewFromState */
/* */
/************************************************************************/
void SetMouseStatusViewFromState(void)
#else
void SetMouseStatusViewFromState()
#endif
{
if(XKBExtension)
else
} /* SetMouseStatusViewFromState */
void SetMouseStatusViewFromStateXKB(void)
#else
#endif
{
unsigned long mask;
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
}
if (currentButtonString != NULL) {
}
(unsigned int*)&mask);
if (mask & Button1Mask) {
}
else {
}
if (mask & Button2Mask) {
}
else {
}
if (mask & Button3Mask) {
}
else {
}
} /* SetMouseStatusViewFromStateXKB */
void SetMouseStatusViewFromStateAX(void)
#else
#endif
{
unsigned long mask;
switch (state.currentMouseButton) {
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
}
(unsigned int*)&mask);
if (mask & Button1Mask) {
}
else {
}
if (mask & Button2Mask) {
}
else {
}
if (mask & Button3Mask) {
}
else {
}
if (mask & Button4Mask) {
}
else {
}
if (mask & Button5Mask) {
}
else {
}
#endif
} /* SetMouseStatusViewFromStateAX */
/************************************************************************/
/* */
/* UpdateWidgetSensitivity */
/* */
/************************************************************************/
void UpdateWidgetSensitivity(void)
#else
void UpdateWidgetSensitivity()
#endif
{
int i;
/* If the enable toggle is turned of then grey out everything */
}
else {
}
for (i = TOGGLE_WIDGETS_MIN; i <= TOGGLE_WIDGETS_MAX; i++) {
if (i != ENABLE_ACCESSX_TGL) {
}
}
for (i = SCALE_WIDGETS_MIN; i <= SCALE_WIDGETS_MAX; i++) {
}
/* Toggle Sensitivity of TimeOut Scale based upon ENABLE_ACCESS
* as well as the TimeOut Toggle.
*/
}
else {
}
/* Always grey out the mouse delay scale with the old AccessX extension */
if(!XKBExtension) {
}
}
/************************************************************************/
/* */
/* CreateProc */
/* */
/* Procedure called when a widget is fetched from Mrm. */
/* */
/************************************************************************/
int *id,
unsigned long reason)
#else
int *id;
unsigned long reason;
#endif
{
} /* CreateProc */
/************************************************************************/
/* */
/* ActivateProc */
/* */
/* Procedure called when a widget is activated. [[[Right now it */
/* merely handles the pushbuttons in the interface. Things like */
/* saving the current state when bringing up a dialog box and */
/* restoring the prvious state when the user hits "Cancel" need */
/* to be added. In addition, the whole help mechanism needs to be */
/* defined.]]] */
/* */
/************************************************************************/
int *id,
#else
int *id;
#endif
{
switch (*id) {
case EXIT_BTN:
exit(0);
case LOAD_BTN:
break;
case SAVE_BTN:
break;
case SETTINGS_BTN:
break;
case SETTINGS_RESET_BTN:
break;
case SETTINGS_DEFAULTS_BTN:
SetDefaults();
break;
case SETTINGS_OK_BTN:
break;
case SETTINGS_CANCEL_BTN:
break;
case MOUSE_STATUS_BTN:
break;
case STICKY_STATUS_BTN:
break;
case MOUSE_CLOSE_BTN:
break;
case STICKY_CLOSE_BTN:
break;
case SAVE_DONE_OK_BTN:
case SAVE_DONE_CANCEL_BTN:
break;
case SAVE_ERR_OK_BTN:
case SAVE_ERR_CANCEL_BTN:
break;
case LOAD_DONE_OK_BTN:
case LOAD_DONE_CANCEL_BTN:
break;
case LOAD_ERR_OK_BTN:
case LOAD_ERR_CANCEL_BTN:
break;
case CLOSE_HELP_BTN:
break;
case GENERAL_HELP_BTN:
case STICKY_HELP_BTN:
case MOUSE_HELP_BTN:
case TOGGLE_HELP_BTN:
case REPEAT_HELP_BTN:
case SLOW_HELP_BTN:
case BOUNCE_HELP_BTN:
case SETTINGS_HELP_BTN:
if (!SetHelpText(*id)) {
break;
}
break;
}
} /* ActivateProc */
/************************************************************************/
/* */
/* GetSizeOfHelpText */
/* */
/************************************************************************/
#else
int GetSizeOfHelpText(type)
int type;
#endif
{
int size;
size = 0;
switch (type) {
case GENERAL_HELP_BTN:
break;
case STICKY_HELP_BTN:
break;
case MOUSE_HELP_BTN:
break;
case TOGGLE_HELP_BTN:
break;
case REPEAT_HELP_BTN:
break;
case SLOW_HELP_BTN:
break;
case BOUNCE_HELP_BTN:
break;
}
return(size);
} /* GetSizeOfHelpText */
/************************************************************************/
/* */
/* AllocateHelpTextMemory */
/* */
/************************************************************************/
#else
int size;
#endif
{
return(False);
}
return(True);
} /* AllocateHelpTextMemory */
/************************************************************************/
/* */
/* InitHelp */
/* */
/************************************************************************/
#else
#endif
{
char *helpfile;
Bool i;
if (!helpfile) {
return(False);
}
if (!helpfilefp) {
/* 4340632: accessx application should show C locale help
if localized help not available */
if (!helpfilefp) {
return(False);
}
}
i = ReadHelpFile(helpfilefp);
return(i);
}
/************************************************************************/
/* */
/* ReadHelpFile */
/* */
/************************************************************************/
#else
#endif
{
char *ptr;
int currentmemsize = 0;
/* char *getaline(); */
if (!ptr)
return(False);
if (!ptr)
return(False);
}
if (!generalHelpString) {
return(False);
}
generalHelpString[0] = '\0';
/* it is general help */
if (reallocsize >= currentmemsize) {
if (!generalHelpString) {
return(False);
}
}
if (!ptr) {
return(False);
}
}
/* remove the comment line */
if (!ptr) {
return(False);
}
if (!stickyHelpString) {
return(False);
}
stickyHelpString[0] = '\0';
/* it is Sticky Key help */
reallocsize = 1;
if (reallocsize >= currentmemsize) {
if (!stickyHelpString) {
return(False);
}
}
if (!ptr) {
return(False);
}
}
/* remove the comment line */
if (!ptr) {
return(False);
}
if (!mouseHelpString) {
return(False);
}
mouseHelpString[0] = '\0';
/* it is Mouse Key help */
reallocsize = 1;
if (reallocsize >= currentmemsize) {
if (!mouseHelpString) {
return(False);
}
}
if (!ptr) {
return(False);
}
}
/* remove the comment line */
if (!ptr) {
return(False);
}
if (!toggleHelpString) {
return(False);
}
toggleHelpString[0] = '\0';
/* it is Toggle Key help */
reallocsize = 1;
if (reallocsize >= currentmemsize) {
if (!toggleHelpString) {
return(False);
}
}
if (!ptr) {
return(False);
}
}
/* remove the comment line */
if (!ptr) {
return(False);
}
if (!repeatHelpString) {
return(False);
}
repeatHelpString[0] = '\0';
/* it is Repeat Key help */
reallocsize = 1;
if (reallocsize >= currentmemsize) {
if (!repeatHelpString) {
return(False);
}
}
if (!ptr) {
return(False);
}
}
/* remove the comment line */
if (!ptr) {
return(False);
}
if (!slowHelpString) {
return(False);
}
slowHelpString[0] = '\0';
/* it is Slow Key help */
reallocsize = 1;
if (reallocsize >= currentmemsize) {
if (!slowHelpString) {
return(False);
}
}
if (!ptr) {
return(False);
}
}
/* remove the comment line */
if (!ptr) {
return(False);
}
if (!bounceHelpString) {
return(False);
}
bounceHelpString[0] = '\0';
/* it is Bounce Key help */
reallocsize = 1;
if (reallocsize >= currentmemsize) {
if (!bounceHelpString) {
return(False);
}
}
if (!ptr) {
return(True);
}
}
return(True);
}
/************************************************************************/
/* */
/* SetHelpText */
/* */
/************************************************************************/
#else
int id;
#endif
{
int result;
if (!inited) {
"Please contact your system administrator\n");
return(False);
}
inited = 1;
}
if (id == SETTINGS_HELP_BTN) {
}
else {
}
if (!result) {
return(False);
}
switch (id) {
case GENERAL_HELP_BTN:
break;
case STICKY_HELP_BTN:
break;
case MOUSE_HELP_BTN:
break;
case TOGGLE_HELP_BTN:
break;
case REPEAT_HELP_BTN:
break;
case SLOW_HELP_BTN:
break;
case BOUNCE_HELP_BTN:
break;
case SETTINGS_HELP_BTN:
break;
}
return(True);
}
/************************************************************************/
/* */
/* SpaceAndSizeButtons */
/* */
/************************************************************************/
int numWidgets)
#else
int numWidgets;
#endif
{
int i;
int widest = 0;
/* Find the widest button.
*/
for (i = 0; i < numWidgets; i++)
{
}
/* Equally space the buttons.
*/
for (i = 0; i < numWidgets; i++)
{
}
} /* SpaceAndSizeButtons */
/************************************************************************/
/* */
/* CreateAndMapStickyStatusWindow */
/* */
/************************************************************************/
void CreateAndMapStickyStatusWindow(void)
#else
#endif
{
NULL );
} /* CreateAndMapStickyStatusWindow */
/************************************************************************/
/* */
/* UnmapStickyStatusWindow */
/* */
/************************************************************************/
void UnmapStickyStatusWindow(void)
#else
void UnmapStickyStatusWindow()
#endif
{
if (stickyTopLevel != NULL)
} /* UnmapStickyStatusWindow */
/************************************************************************/
/* */
/* CreateAndMapMouseStatusWindow */
/* */
/************************************************************************/
void CreateAndMapMouseStatusWindow(void)
#else
#endif
{
NULL );
} /* CreateAndMapMouseStatusWindow */
/************************************************************************/
/* */
/* UnmapMouseStatusWindow */
/* */
/************************************************************************/
void UnmapMouseStatusWindow(void)
#else
void UnmapMouseStatusWindow()
#endif
{
if (mouseTopLevel != NULL)
} /* UnmapMouseStatusWindow */
/************************************************************************/
/* */
/* ChangeControlProc */
/* */
/* Procedure called when one of the widgets indicating the AccessX */
/* state is activated. */
/* */
/************************************************************************/
int *id,
#else
int *id;
#endif
{
/* Before we do anything, make sure we emulate the radio behavior
of the SlowKeys and BounceKeys buttons. */
}
}
/* Set the repeat state and keysym mappings of the mouse keys if
this is the MouseKeys toggle buttons. */
if (*id == MOUSE_KEYS_TGL) {
if (callbackData->set) {
if (options.automaticPopup) {
}
}
else {
if (options.automaticPopup) {
}
}
}
/* Save To A File IF Needed */
} /* ChangeControlProc */
/************************************************************************/
/* */
/* ResolveResourceFileName */
/* */
/************************************************************************/
char *ResolveResourceFileName(void)
#else
char *ResolveResourceFileName()
#endif
{
return(NULL);
}
return(fullPath);
} /* ResolveResourceFileName */
/************************************************************************/
/* */
/* LoadSettingsFromFile */
/* */
/************************************************************************/
void LoadSettingsFromFile(void)
#else
void LoadSettingsFromFile()
#endif
{
int i, value;
short decimalPoints;
if (accessXDatabase == NULL) {
return;
}
for (i = TOGGLE_WIDGETS_MIN; i <= TOGGLE_WIDGETS_MAX; i++) {
&res, &resourceValue);
}
else {
}
}
for (i = SCALE_WIDGETS_MIN; i <= SCALE_WIDGETS_MAX; i++) {
&res, &resourceValue);
continue;
&res, &resourceValue);
continue;
}
/* XtManageChild(loadDoneDialog); */
} /* LoadSettingsFromFile */
/************************************************************************/
/* */
/* SaveSettingsToFile */
/* */
/************************************************************************/
void SaveSettingsToFile(void)
#else
void SaveSettingsToFile()
#endif
{
int i, scaleValue;
short decimalPoints;
char *fname;
for (i = TOGGLE_WIDGETS_MIN; i <= TOGGLE_WIDGETS_MAX; i++) {
if (XmToggleButtonGadgetGetState(widgets[i])) {
}
else {
}
}
for (i = SCALE_WIDGETS_MIN; i <= SCALE_WIDGETS_MAX; i++) {
}
return;
}
} /* SaveSettingsToFile */
/************************************************************************/
/* */
/* StoreSettingsWindowToDatabase */
/* */
/************************************************************************/
void StoreSettingsWindowToDatabase(void)
#else
#endif
{
int i, scaleValue;
short decimalPoints;
for (i = SETTINGS_TOGGLE_WIDGETS_MIN; i<=SETTINGS_TOGGLE_WIDGETS_MAX; i++) {
if (XmToggleButtonGadgetGetState(widgets[i])) {
}
else {
}
}
for (i = SCALE_WIDGETS_MIN; i <= SCALE_WIDGETS_MAX; i++) {
if (i == TIME_OUT_SCL) { /* special case the time out scale here */
continue;
}
}
} /* StoreSettingsWindowToDatabase */
/************************************************************************/
/* */
/* RestoreSettingsWindowFromDatabase */
/* */
/************************************************************************/
void RestoreSettingsWindowFromDatabase(void)
#else
#endif
{
int i, value;
short decimalPoints;
for (i = SETTINGS_TOGGLE_WIDGETS_MIN; i<=SETTINGS_TOGGLE_WIDGETS_MAX; i++) {
&res, &resourceValue);
}
else {
}
}
for (i = SCALE_WIDGETS_MIN; i <= SCALE_WIDGETS_MAX; i++) {
if (i == TIME_OUT_SCL) { /* special case the time out scale */
continue;
}
&res, &resourceValue);
}
} /* RestoreSettingsWindowFromDatabase */
/************************************************************************/
/* */
/* DisplayStatusDialogsIfNeeded */
/* */
/************************************************************************/
void DisplayStatusDialogsIfNeeded(void)
#else
void DisplayStatusDialogsIfNeeded()
#endif
{
if (!options.automaticPopup)
return;
}
}
} /* DisplayStatusDialogsIfNeeded */
/************************************************************************/
/* */
/* InitializeInterface */
/* */
/************************************************************************/
char *argv[])
#else
unsigned int argc;
char *argv[];
#endif
{
int n;
/* Initialize the toolkit and Mrm */
NULL, 0);
/* Find which extension to use */
/* Initialize widget array to all NULLS */
for (n = 0; n < NUM_WIDGETS; n++) {
}
if (options.iconifyMain) {
}
else {
}
!=MrmSUCCESS) {
printf("Could not open hierarchy.\n");
exit(1);
}
&mainWindow, &dummyClass);
&dummyClass);
&dummyClass);
&dummyClass);
&dummyClass);
n = 0;
"stickyTopLevel", argList, n);
n = 0;
"mouseTopLevel", argList, n);
&dummyClass);
&saveDoneBox, &dummyClass);
&dummyClass);
&dummyClass);
&dummyClass);
&dummyClass);
&dummyClass);
&dummyClass);
/* Realize the topLevel widget and Initialize the AccessX extension.
*/
/* Initialize the accessx extention */
if(!XKBExtension)
{
}
}
else {
}
} /* InitializeInterface */
/************************************************************************/
/* */
/* XkbEventHandler */
/* */
/* DESCRIPTION: */
/* */
/* Handles events generated by the Xkb server extension. */
/* */
/************************************************************************/
{
{
case XkbStateNotify:
break;
case XkbControlsNotify:
break;
default: break;
}
return True;
} /* XkbEventHandler */
/************************************************************************/
/* */
/* InitXkb */
/* */
/************************************************************************/
{
if (!XkbQueryExtension(theDisplay,
&opcode,
&major,
&minor))
return False;
return False;
return True;
} /* InitXkb */
/************************************************************************/
/* */
/* main */
/* */
/************************************************************************/
char *argv[])
#else
int argc;
char *argv[];
#endif
{
char *uidpathstr = "UIDPATH=/usr/share/X11/locale/%L/accessx/accessx.uid:/usr/share/X11/locale/C/accessx/accessx.uid";
char *xfilesearchpathstr = "XFILESEARCHPATH=/usr/dt/app-defaults/%L/%N:/usr/dt/app-defaults/C/%N:/usr/share/X11/app-defaults/%L/%N:/usr/share/X11/app-defaults/C/%N";
char *tmpstr;
(void)putenv(uidpathstr);
}
(void)putenv(xfilesearchpathstr);
}
/* set locale */
/* Initialize the Interface */
/* Automatically load the users settings */
/* First try initalizing XKB, if that fails then try the old AccessX extension. */
if(XKBExtension)
else
return(0L);
}