Initial import of the CDE 2.1.30 sources from the Open Group.
This commit is contained in:
698
cde/programs/dtstyle/Audio.c
Normal file
698
cde/programs/dtstyle/Audio.c
Normal file
@@ -0,0 +1,698 @@
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Audio.c
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** Description: Controls the Dtstyle Audio dialog
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
/* $XConsortium: Audio.c /main/4 1995/10/30 13:07:24 rswiston $ */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include files */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <Xm/MwmUtil.h>
|
||||
|
||||
#include <Xm/XmP.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/PushBG.h>
|
||||
#include <Xm/Scale.h>
|
||||
#include <Xm/VendorSEP.h>
|
||||
#include <Xm/LabelG.h>
|
||||
|
||||
#include <Dt/DialogBox.h>
|
||||
#include <Dt/Icon.h>
|
||||
|
||||
#include <Dt/Message.h>
|
||||
#include <Dt/HourGlass.h>
|
||||
|
||||
#include "Help.h"
|
||||
#include "Main.h"
|
||||
#include "SaveRestore.h"
|
||||
#include "Protocol.h"
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include extern functions */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
#include "Audio.h"
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Local #defines */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
#define VOLUME_MAX 100
|
||||
#define SCALE_WIDTH 200
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Internal Functions */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
static Widget build_audioDlg( Widget shell) ;
|
||||
static void formLayoutCB ( Widget, XtPointer, XtPointer ) ;
|
||||
static void _DtmapCB_audioDlg ( Widget, XtPointer, XtPointer ) ;
|
||||
static int getValue ( Widget w) ;
|
||||
static void valueChangedCB ( Widget, XtPointer, XtPointer ) ;
|
||||
static void systemDefaultCB ( Widget, XtPointer, XtPointer ) ;
|
||||
static void ButtonCB ( Widget, XtPointer, XtPointer ) ;
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Internal Variables */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
typedef struct {
|
||||
Widget pictLabel;
|
||||
Widget systemDefault;
|
||||
Widget volLabGad;
|
||||
Widget toneLabGad;
|
||||
Widget durLabGad;
|
||||
Widget volScale;
|
||||
Widget toneScale;
|
||||
Widget durScale;
|
||||
Boolean systemDefaultFlag;
|
||||
XKeyboardState values;
|
||||
} Audio, *AudioPtr;
|
||||
|
||||
static Audio audio;
|
||||
static saveRestore save = {FALSE, 0, };
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* popup_audioBB */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
void
|
||||
popup_audioBB(
|
||||
Widget shell )
|
||||
{
|
||||
if (style.audioDialog == NULL) {
|
||||
_DtTurnOnHourGlass(shell);
|
||||
build_audioDlg(shell);
|
||||
XtManageChild(style.audioDialog);
|
||||
_DtTurnOffHourGlass(shell);
|
||||
}
|
||||
else
|
||||
{
|
||||
XtManageChild(style.audioDialog);
|
||||
raiseWindow(XtWindow(XtParent(style.audioDialog)));
|
||||
}
|
||||
audio.systemDefaultFlag = False;
|
||||
}
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* build__audioDlg */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static Widget
|
||||
build_audioDlg(
|
||||
Widget shell )
|
||||
{
|
||||
register int i, n;
|
||||
Arg args[MAX_ARGS];
|
||||
XmString button_string[NUM_LABELS];
|
||||
XmString string;
|
||||
Widget form;
|
||||
Pixmap audioPixmap;
|
||||
int count = 0;
|
||||
Widget widget_list[12];
|
||||
|
||||
/*get audio values for sliders*/
|
||||
XGetKeyboardControl(style.display, &audio.values);
|
||||
if(audio.values.bell_duration == 0)
|
||||
audio.values.bell_duration = 1;
|
||||
|
||||
/* Set up DialogBoxDialog button labels */
|
||||
button_string[0] = CMPSTR(_DtOkString);
|
||||
button_string[1] = CMPSTR(_DtCancelString);
|
||||
button_string[2] = CMPSTR(_DtHelpString);
|
||||
|
||||
/* Create toplevel DialogBox */
|
||||
/* saveRestore
|
||||
* Note that save.poscnt has been initialized elsewhere.
|
||||
* save.posArgs may contain information from restoreBeep().*/
|
||||
|
||||
XtSetArg(save.posArgs[save.poscnt], XmNbuttonCount, NUM_LABELS); save.poscnt++;
|
||||
XtSetArg(save.posArgs[save.poscnt], XmNbuttonLabelStrings, button_string); save.poscnt++;
|
||||
XtSetArg (save.posArgs[save.poscnt], XmNdefaultPosition, False);
|
||||
save.poscnt++;
|
||||
style.audioDialog =
|
||||
__DtCreateDialogBoxDialog(shell, "AudioDialog", save.posArgs, save.poscnt);
|
||||
XtAddCallback(style.audioDialog, XmNmapCallback, formLayoutCB, NULL);
|
||||
XtAddCallback(style.audioDialog, XmNmapCallback, _DtmapCB_audioDlg, shell);
|
||||
XtAddCallback(style.audioDialog, XmNcallback, ButtonCB, NULL);
|
||||
XtAddCallback(style.audioDialog, XmNhelpCallback,
|
||||
(XtCallbackProc)HelpRequestCB, (XtPointer)HELP_AUDIO_DIALOG);
|
||||
|
||||
XmStringFree(button_string[0]);
|
||||
XmStringFree(button_string[1]);
|
||||
XmStringFree(button_string[2]);
|
||||
|
||||
widget_list[0] = _DtDialogBoxGetButton(style.audioDialog,2);
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNautoUnmanage, False); n++;
|
||||
XtSetArg(args[n], XmNcancelButton, widget_list[0]); n++;
|
||||
XtSetValues (style.audioDialog, args, n);
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNtitle, ((char *)GETMESSAGE(6, 7, "Style Manager - Beep"))); n++;
|
||||
XtSetArg (args[n], XmNuseAsyncGeometry, True); n++;
|
||||
XtSetArg(args[n], XmNmwmFunctions, DIALOG_MWM_FUNC); n++;
|
||||
XtSetValues (XtParent(style.audioDialog), args, n);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNhorizontalSpacing, style.horizontalSpacing); n++;
|
||||
XtSetArg(args[n], XmNverticalSpacing, style.verticalSpacing); n++;
|
||||
XtSetArg(args[n], XmNallowOverlap, False); n++;
|
||||
XtSetArg(args[n], XmNchildType, XmWORK_AREA); n++;
|
||||
form = XmCreateForm(style.audioDialog, "audioForm", args, n);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNfillMode, XmFILL_SELF); n++;
|
||||
XtSetArg(args[n], XmNbehavior, XmICON_LABEL); n++;
|
||||
XtSetArg(args[n], XmNpixmapForeground, style.secBSCol); n++;
|
||||
XtSetArg(args[n], XmNpixmapBackground, style.secTSCol); n++;
|
||||
XtSetArg(args[n], XmNstring, NULL); n++;
|
||||
XtSetArg(args[n], XmNshadowThickness, 0); n++;
|
||||
XtSetArg(args[n], XmNimageName, BEEP_ICON); n++;
|
||||
XtSetArg(args[n], XmNtraversalOn, False); n++;
|
||||
widget_list[count++] =
|
||||
audio.pictLabel = _DtCreateIcon(form, "audiopictLabel", args, n);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNmarginHeight, LB_MARGIN_HEIGHT); n++;
|
||||
XtSetArg(args[n], XmNmarginWidth, LB_MARGIN_WIDTH); n++;
|
||||
string = CMPSTR(((char *)GETMESSAGE(6, 2, "Default")));
|
||||
XtSetArg(args[n], XmNlabelString, string); n++;
|
||||
widget_list[count++] =
|
||||
audio.systemDefault = XmCreatePushButtonGadget(form, "systemDefault", args, n);
|
||||
XmStringFree(string);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNalignment, XmALIGNMENT_END); n++;
|
||||
string = CMPSTR(((char *)GETMESSAGE(6, 3, "Volume")));
|
||||
XtSetArg(args[n], XmNlabelString, string); n++;
|
||||
XtSetArg(args[n], XmNmarginHeight, 0); n++;
|
||||
widget_list[count++] =
|
||||
audio.volLabGad= XmCreateLabelGadget(form,"volLabGad", args, n);
|
||||
XmStringFree(string);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNmaximum, VOLUME_MAX); n++;
|
||||
XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
|
||||
XtSetArg(args[n], XmNprocessingDirection, XmMAX_ON_RIGHT); n++;
|
||||
XtSetArg(args[n], XmNshowValue, True); n++;
|
||||
XtSetArg(args[n], XmNvalue,audio.values.bell_percent); n++;
|
||||
XtSetArg(args[n], XmNhighlightThickness, SCALE_HIGHLIGHT_THICKNESS); n++;
|
||||
XtSetArg(args[n], XmNscaleWidth, SCALE_WIDTH); n++;
|
||||
widget_list[count++] =
|
||||
audio.volScale= XmCreateScale(form,"volScale", args, n);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNalignment, XmALIGNMENT_END); n++;
|
||||
string = CMPSTR(((char *)GETMESSAGE(6, 4, "Tone")));
|
||||
XtSetArg(args[n], XmNlabelString, string); n++;
|
||||
XtSetArg(args[n], XmNmarginHeight, 0); n++;
|
||||
widget_list[count++] =
|
||||
audio.toneLabGad= XmCreateLabelGadget(form,"toneLabGad", args, n);
|
||||
XmStringFree(string);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
|
||||
XtSetArg(args[n], XmNprocessingDirection, XmMAX_ON_RIGHT); n++;
|
||||
XtSetArg(args[n], XmNshowValue, True); n++;
|
||||
XtSetArg(args[n], XmNhighlightThickness, SCALE_HIGHLIGHT_THICKNESS); n++;
|
||||
XtSetArg(args[n], XmNscaleWidth, SCALE_WIDTH); n++;
|
||||
XtSetArg(args[n], XmNvalue,audio.values.bell_pitch); n++;
|
||||
widget_list[count++] =
|
||||
audio.toneScale= XmCreateScale(form,"toneScale", args, n);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNalignment, XmALIGNMENT_END); n++;
|
||||
string = CMPSTR(((char *)GETMESSAGE(6, 5, "Duration")));
|
||||
XtSetArg(args[n], XmNlabelString, string); n++;
|
||||
XtSetArg(args[n], XmNmarginHeight, 0); n++;
|
||||
widget_list[count++] =
|
||||
audio.durLabGad= XmCreateLabelGadget(form,"durLabGad", args, n);
|
||||
XmStringFree(string);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNdecimalPoints, (short)1); n++;
|
||||
XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
|
||||
XtSetArg(args[n], XmNprocessingDirection, XmMAX_ON_RIGHT); n++;
|
||||
XtSetArg(args[n], XmNshowValue, True); n++;
|
||||
XtSetArg(args[n], XmNminimum, 1); n++;
|
||||
XtSetArg(args[n], XmNhighlightThickness, SCALE_HIGHLIGHT_THICKNESS); n++;
|
||||
XtSetArg(args[n], XmNvalue,(int)audio.values.bell_duration/100); n++;
|
||||
XtSetArg(args[n], XmNscaleWidth, SCALE_WIDTH); n++;
|
||||
widget_list[count++] =
|
||||
audio.durScale= XmCreateScale(form,"durationScale", args, n);
|
||||
|
||||
XtAddCallback(audio.systemDefault, XmNactivateCallback, systemDefaultCB, NULL);
|
||||
XtAddCallback(audio.volScale, XmNvalueChangedCallback, valueChangedCB, NULL);
|
||||
XtAddCallback(audio.toneScale, XmNvalueChangedCallback, valueChangedCB, NULL);
|
||||
XtAddCallback(audio.durScale, XmNvalueChangedCallback, valueChangedCB, NULL);
|
||||
|
||||
XtManageChild(form);
|
||||
XtManageChildren(widget_list,count);
|
||||
|
||||
return(style.audioDialog);
|
||||
}
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* formLayoutCB */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
formLayoutCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
int n;
|
||||
Arg args[MAX_ARGS];
|
||||
Dimension ScaleHeight;
|
||||
Dimension LabelHeight;
|
||||
Dimension volLabelWidth;
|
||||
Dimension toneLabelWidth;
|
||||
Dimension durLabelWidth;
|
||||
Dimension MaxLabelWidth;
|
||||
Dimension TopOffset;
|
||||
Dimension LeftOffset;
|
||||
|
||||
|
||||
/* get component sizes */
|
||||
|
||||
ScaleHeight = XtHeight(audio.volScale);
|
||||
LabelHeight = XtHeight(audio.volLabGad);
|
||||
|
||||
MaxLabelWidth = volLabelWidth = XtWidth(audio.volLabGad);
|
||||
|
||||
toneLabelWidth = XtWidth(audio.toneLabGad);
|
||||
if (toneLabelWidth > MaxLabelWidth)
|
||||
{
|
||||
MaxLabelWidth = toneLabelWidth;
|
||||
}
|
||||
|
||||
durLabelWidth = XtWidth(audio.durLabGad);
|
||||
if (durLabelWidth > MaxLabelWidth)
|
||||
{
|
||||
MaxLabelWidth = durLabelWidth;
|
||||
}
|
||||
|
||||
TopOffset = style.verticalSpacing + ScaleHeight - LabelHeight;
|
||||
|
||||
/* do form attachments */
|
||||
|
||||
/* Picture Label */
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNtopOffset, style.verticalSpacing); n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNleftOffset, style.horizontalSpacing); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_NONE); n++;
|
||||
XtSetValues (audio.pictLabel, args, n);
|
||||
|
||||
/* system Default */
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNtopOffset, style.verticalSpacing); n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNrightOffset, style.horizontalSpacing); n++;
|
||||
XtSetValues (audio.systemDefault, args, n);
|
||||
|
||||
/* Volume Label */
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, audio.pictLabel); n++;
|
||||
XtSetArg(args[n], XmNtopOffset, TopOffset); n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
|
||||
LeftOffset = style.horizontalSpacing + (MaxLabelWidth - volLabelWidth);
|
||||
XtSetArg(args[n], XmNleftOffset, LeftOffset); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_NONE); n++;
|
||||
XtSetValues (audio.volLabGad, args, n);
|
||||
|
||||
|
||||
/* Volume Scale */
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNbottomWidget, audio.volLabGad); n++;
|
||||
XtSetArg(args[n], XmNbottomOffset, 0); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNleftWidget, audio.volLabGad); n++;
|
||||
XtSetArg(args[n], XmNleftOffset, style.horizontalSpacing); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
|
||||
XtSetValues (audio.volScale, args, n);
|
||||
|
||||
/* Tone Label */
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, audio.volScale); n++;
|
||||
XtSetArg(args[n], XmNtopOffset, TopOffset); n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
|
||||
LeftOffset = style.horizontalSpacing + (MaxLabelWidth - toneLabelWidth);
|
||||
XtSetArg(args[n], XmNleftOffset, LeftOffset); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_NONE); n++;
|
||||
XtSetValues (audio.toneLabGad, args, n);
|
||||
|
||||
|
||||
/* Tone Scale */
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNbottomWidget, audio.toneLabGad); n++;
|
||||
XtSetArg(args[n], XmNbottomOffset, 0); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNleftWidget, audio.toneLabGad); n++;
|
||||
XtSetArg(args[n], XmNleftOffset, style.horizontalSpacing); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
|
||||
XtSetValues (audio.toneScale, args, n);
|
||||
|
||||
/* Duration Label */
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, audio.toneScale); n++;
|
||||
XtSetArg(args[n], XmNtopOffset, TopOffset); n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNbottomOffset, style.verticalSpacing); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
|
||||
LeftOffset = style.horizontalSpacing + (MaxLabelWidth - durLabelWidth);
|
||||
XtSetArg(args[n], XmNleftOffset, LeftOffset); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_NONE); n++;
|
||||
XtSetValues (audio.durLabGad, args, n);
|
||||
|
||||
|
||||
/* Duration Scale */
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNbottomWidget, audio.durLabGad); n++;
|
||||
XtSetArg(args[n], XmNbottomOffset, 0); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNleftWidget, audio.durLabGad); n++;
|
||||
XtSetArg(args[n], XmNleftOffset, style.horizontalSpacing); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
|
||||
XtSetValues (audio.durScale, args, n);
|
||||
|
||||
XtRemoveCallback(style.audioDialog, XmNmapCallback, formLayoutCB, NULL);
|
||||
}
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* _DtmapCB_audioDlg */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
_DtmapCB_audioDlg(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
|
||||
static int first_time = 1;
|
||||
int n;
|
||||
Arg args[MAX_ARGS];
|
||||
|
||||
|
||||
if (first_time)
|
||||
{
|
||||
DtWsmRemoveWorkspaceFunctions(style.display, XtWindow(XtParent(w)));
|
||||
|
||||
if (!save.restoreFlag)
|
||||
putDialog ((Widget)client_data, w);
|
||||
|
||||
first_time = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*get audio values for sliders*/
|
||||
XGetKeyboardControl(style.display, &audio.values);
|
||||
if(audio.values.bell_duration == 0)
|
||||
audio.values.bell_duration = 1;
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNvalue,audio.values.bell_percent); n++;
|
||||
XtSetValues(audio.volScale, args, n);
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNvalue,audio.values.bell_pitch); n++;
|
||||
XtSetValues(audio.toneScale, args, n);
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNvalue,(int)audio.values.bell_duration/100); n++;
|
||||
XtSetValues(audio.durScale, args, n);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
getValue(
|
||||
Widget w )
|
||||
{
|
||||
int n, value;
|
||||
Arg args[1];
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNvalue, &value); n++;
|
||||
XtGetValues(w, args, n);
|
||||
return(value);
|
||||
}
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* valueChangedCB */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
valueChangedCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
int n, value;
|
||||
Arg args[1];
|
||||
XKeyboardControl kbdControl;
|
||||
int kbdControlMask;
|
||||
|
||||
/*set audio parameters to val returned and ring audio*/
|
||||
|
||||
kbdControlMask = KBBellPercent | KBBellPitch | KBBellDuration;
|
||||
kbdControl.bell_percent = getValue(audio.volScale);
|
||||
kbdControl.bell_pitch = getValue(audio.toneScale);
|
||||
kbdControl.bell_duration = getValue(audio.durScale)*100;
|
||||
XChangeKeyboardControl(style.display, kbdControlMask, &kbdControl);
|
||||
|
||||
XBell(style.display,0);
|
||||
|
||||
audio.systemDefaultFlag = False;
|
||||
}
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* systemDefaultCB */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
systemDefaultCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
int n, value;
|
||||
Arg args[1];
|
||||
XKeyboardControl kbdControl;
|
||||
int kbdControlMask;
|
||||
XKeyboardState kbdState;
|
||||
|
||||
/*set audio parameters to val returned and ring bell*/
|
||||
|
||||
kbdControlMask = KBBellPercent | KBBellPitch | KBBellDuration;
|
||||
kbdControl.bell_percent = -1;
|
||||
kbdControl.bell_pitch = -1;
|
||||
kbdControl.bell_duration = -1;
|
||||
XChangeKeyboardControl(style.display, kbdControlMask, &kbdControl);
|
||||
|
||||
/*get audio values for sliders*/
|
||||
XGetKeyboardControl(style.display, &kbdState);
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNvalue,kbdState.bell_percent); n++;
|
||||
XtSetValues(audio.volScale, args, n);
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNvalue,kbdState.bell_pitch); n++;
|
||||
XtSetValues(audio.toneScale, args, n);
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNvalue,(int)kbdState.bell_duration/100); n++;
|
||||
XtSetValues(audio.durScale, args, n);
|
||||
|
||||
XBell(style.display,0);
|
||||
|
||||
audio.systemDefaultFlag = True;
|
||||
}
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* ButtonCB */
|
||||
/* callback for PushButtons in DialogBox */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
ButtonCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
int n;
|
||||
Arg args[MAX_ARGS];
|
||||
XKeyboardControl kbdControl;
|
||||
int kbdControlMask;
|
||||
DtDialogBoxCallbackStruct *cb = (DtDialogBoxCallbackStruct *) call_data;
|
||||
|
||||
switch (cb->button_position)
|
||||
{
|
||||
case OK_BUTTON:
|
||||
XtUnmanageChild (w);
|
||||
|
||||
/* if sendSetting is True send message to Session manager */
|
||||
|
||||
if(style.smState.smSendSettings)
|
||||
{
|
||||
if(audio.systemDefaultFlag)
|
||||
{
|
||||
SmDefaultAudioSettings();
|
||||
}
|
||||
else
|
||||
{
|
||||
SmNewAudioSettings(getValue(audio.volScale),
|
||||
getValue(audio.toneScale),
|
||||
getValue(audio.durScale) * 100);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case CANCEL_BUTTON:
|
||||
/* reset to incoming audio values */
|
||||
XtUnmanageChild(w);
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNvalue,audio.values.bell_percent);
|
||||
XtSetValues(audio.volScale, args, n);
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNvalue,audio.values.bell_pitch);
|
||||
XtSetValues(audio.toneScale, args, n);
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNvalue,(int)audio.values.bell_duration/100);
|
||||
XtSetValues(audio.durScale, args, n);
|
||||
|
||||
kbdControlMask = KBBellPercent | KBBellPitch | KBBellDuration;
|
||||
kbdControl.bell_percent = audio.values.bell_percent;
|
||||
kbdControl.bell_pitch = audio.values.bell_pitch;
|
||||
kbdControl.bell_duration = audio.values.bell_duration;
|
||||
XChangeKeyboardControl(style.display, kbdControlMask, &kbdControl);
|
||||
|
||||
XBell(style.display,0);
|
||||
break;
|
||||
|
||||
case HELP_BUTTON:
|
||||
XtCallCallbacks(style.audioDialog, XmNhelpCallback, (XtPointer)NULL);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* restoreAudio()
|
||||
*
|
||||
* restore any state information saved with saveAudio.
|
||||
* This is called from restoreSession with the application
|
||||
* shell and the special xrm database retrieved for restore.
|
||||
************************************************************************/
|
||||
void
|
||||
restoreAudio(
|
||||
Widget shell,
|
||||
XrmDatabase db )
|
||||
{
|
||||
XrmName xrm_name[5];
|
||||
XrmRepresentation rep_type;
|
||||
XrmValue value;
|
||||
|
||||
xrm_name [0] = XrmStringToQuark ("audioDlg");
|
||||
xrm_name [2] = NULL;
|
||||
|
||||
/* get x position */
|
||||
xrm_name [1] = XrmStringToQuark ("x");
|
||||
if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value)){
|
||||
XtSetArg (save.posArgs[save.poscnt], XmNx, atoi((char *)value.addr)); save.poscnt++;
|
||||
save.restoreFlag = True;
|
||||
}
|
||||
|
||||
/* get y position */
|
||||
xrm_name [1] = XrmStringToQuark ("y");
|
||||
if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value)){
|
||||
XtSetArg (save.posArgs[save.poscnt], XmNy, atoi((char *)value.addr)); save.poscnt++;
|
||||
}
|
||||
|
||||
xrm_name [1] = XrmStringToQuark ("ismapped");
|
||||
XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value);
|
||||
/* Are we supposed to be mapped? */
|
||||
if (strcmp(value.addr, "True") == 0)
|
||||
popup_audioBB(shell);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* saveAudio()
|
||||
*
|
||||
* This routine will write out to the passed file descriptor any state
|
||||
* information this dialog needs. It is called from saveSessionCB with the
|
||||
* file already opened.
|
||||
* All information is saved in xrm format. There is no restriction
|
||||
* on what can be saved. It doesn't have to be defined or be part of any
|
||||
* widget or Xt definition. Just name and save it here and recover it in
|
||||
* restoreBackdrop. The suggested minimum is whether you are mapped, and your
|
||||
* location.
|
||||
************************************************************************/
|
||||
void
|
||||
saveAudio(
|
||||
int fd )
|
||||
{
|
||||
Position x,y;
|
||||
char *bufr = style.tmpBigStr; /* size=[1024], make bigger if needed */
|
||||
XmVendorShellExtObject vendorExt;
|
||||
XmWidgetExtData extData;
|
||||
|
||||
if (style.audioDialog != NULL)
|
||||
{
|
||||
if (XtIsManaged(style.audioDialog))
|
||||
sprintf(bufr, "*audioDlg.ismapped: True\n");
|
||||
else
|
||||
sprintf(bufr, "*audioDlg.ismapped: False\n");
|
||||
|
||||
/* Get and write out the geometry info for our Window */
|
||||
x = XtX(XtParent(style.audioDialog));
|
||||
y = XtY(XtParent(style.audioDialog));
|
||||
|
||||
/* Modify x & y to take into account window mgr frames
|
||||
* This is pretty bogus, but I don't know a better way to do it.
|
||||
*/
|
||||
extData = _XmGetWidgetExtData(style.shell, XmSHELL_EXTENSION);
|
||||
vendorExt = (XmVendorShellExtObject)extData->widget;
|
||||
x -= vendorExt->vendor.xOffset;
|
||||
y -= vendorExt->vendor.yOffset;
|
||||
|
||||
sprintf(bufr, "%s*audioDlg.x: %d\n", bufr, x);
|
||||
sprintf(bufr, "%s*audioDlg.y: %d\n", bufr, y);
|
||||
write (fd, bufr, strlen(bufr));
|
||||
}
|
||||
}
|
||||
|
||||
32
cde/programs/dtstyle/Audio.h
Normal file
32
cde/programs/dtstyle/Audio.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/* $XConsortium: Audio.h /main/4 1995/10/30 13:07:37 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Audio.h
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** This file contains function definitions for the corresponding .c
|
||||
** file
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _audio_h
|
||||
#define _audio_h
|
||||
|
||||
/* External Interface */
|
||||
|
||||
|
||||
extern void popup_audioBB( Widget shell) ;
|
||||
extern void restoreAudio( Widget shell, XrmDatabase db) ;
|
||||
extern void saveAudio( int fd) ;
|
||||
|
||||
|
||||
|
||||
#endif /* _audio_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
1205
cde/programs/dtstyle/Backdrop.c
Normal file
1205
cde/programs/dtstyle/Backdrop.c
Normal file
File diff suppressed because it is too large
Load Diff
34
cde/programs/dtstyle/Backdrop.h
Normal file
34
cde/programs/dtstyle/Backdrop.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/* $XConsortium: Backdrop.h /main/4 1995/10/30 13:07:56 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Backdrop.h
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** This file contains function definitions for the corresponding .c
|
||||
** file
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _backdrop_h
|
||||
#define _backdrop_h
|
||||
|
||||
|
||||
/* External Interface */
|
||||
|
||||
|
||||
extern void BackdropDialog( Widget parent) ;
|
||||
extern void CheckWorkspace( void ) ;
|
||||
extern void restoreBackdrop( Widget shell, XrmDatabase db) ;
|
||||
extern void saveBackdrop( int fd) ;
|
||||
|
||||
|
||||
#endif /* _backdrop_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
|
||||
51
cde/programs/dtstyle/Backdrops.src
Normal file
51
cde/programs/dtstyle/Backdrops.src
Normal file
@@ -0,0 +1,51 @@
|
||||
! $XConsortium: Backdrops.src /main/3 1995/12/05 10:11:06 rswiston $
|
||||
!######################################################################
|
||||
!#
|
||||
!# Backdrops
|
||||
!#
|
||||
!# Common Desktop Environment (CDE)
|
||||
!#
|
||||
!# Backdrop file used for localization of backdrop names
|
||||
!#
|
||||
!# (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
!# (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
!# (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
!# (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary
|
||||
!# of Novell, Inc.
|
||||
!#
|
||||
!#
|
||||
!######################################################################
|
||||
|
||||
!###
|
||||
!#
|
||||
!# C backdrop names followed by message tags for the translated names
|
||||
!#
|
||||
!###
|
||||
|
||||
Backdrops*Ankh.desc: %|nls-1-|
|
||||
Backdrops*Background.desc: %|nls-2-|
|
||||
Backdrops*BrickWall.desc: %|nls-3-|
|
||||
Backdrops*Concave.desc: %|nls-4-|
|
||||
Backdrops*Convex.desc: %|nls-5-|
|
||||
Backdrops*Corduroy.desc: %|nls-6-|
|
||||
Backdrops*Crochet.desc: %|nls-7-|
|
||||
Backdrops*Foreground.desc: %|nls-8-|
|
||||
Backdrops*InlayColor.desc: %|nls-9-|
|
||||
Backdrops*InlayPlain.desc: %|nls-10-|
|
||||
Backdrops*KnitLight.desc: %|nls-11-|
|
||||
Backdrops*Lattice.desc: %|nls-12-|
|
||||
Backdrops*LatticeBig.desc: %|nls-13-|
|
||||
Backdrops*Leaves.desc: %|nls-14-|
|
||||
Backdrops*NoBackdrop.desc: %|nls-15-|
|
||||
Backdrops*OldChars.desc: %|nls-16-|
|
||||
Backdrops*Paver.desc: %|nls-17-|
|
||||
Backdrops*Pebbles.desc: %|nls-18-|
|
||||
Backdrops*PinStripe.desc: %|nls-19-|
|
||||
Backdrops*RakedSand.desc: %|nls-20-|
|
||||
Backdrops*RicePaper.desc: %|nls-21-|
|
||||
Backdrops*SkyDark.desc: %|nls-22-|
|
||||
Backdrops*SkyLight.desc: %|nls-23-|
|
||||
Backdrops*Sprinkles.desc: %|nls-24-|
|
||||
Backdrops*Toronto.desc: %|nls-25-|
|
||||
Backdrops*WaterDrops.desc: %|nls-26-|
|
||||
Backdrops*Wooly.desc: %|nls-27-|
|
||||
1666
cde/programs/dtstyle/ColorEdit.c
Normal file
1666
cde/programs/dtstyle/ColorEdit.c
Normal file
File diff suppressed because it is too large
Load Diff
82
cde/programs/dtstyle/ColorEdit.h
Normal file
82
cde/programs/dtstyle/ColorEdit.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/* $XConsortium: ColorEdit.h /main/4 1995/10/30 13:08:12 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: ColorEdit.h
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** This file contains function definitions for the corresponding .c
|
||||
** file
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _coloredit_h
|
||||
#define _coloredit_h
|
||||
|
||||
/* Global structure for Color Editor */
|
||||
|
||||
typedef struct _EditData {
|
||||
Widget DialogShell;
|
||||
Widget main_form;
|
||||
Widget sliderForm;
|
||||
Widget oldButton;
|
||||
Widget newButton;
|
||||
Widget grabColor;
|
||||
Widget redLabel;
|
||||
Widget greenLabel;
|
||||
Widget blueLabel;
|
||||
Widget hueLabel;
|
||||
Widget satLabel;
|
||||
Widget valLabel;
|
||||
Widget redScale;
|
||||
Widget greenScale;
|
||||
Widget blueScale;
|
||||
Widget hueScale;
|
||||
Widget satScale;
|
||||
Widget valScale;
|
||||
int current_scale;
|
||||
ColorSet *color_set;
|
||||
ColorSet oldButtonColor;
|
||||
XmColorProc calcRGB;
|
||||
Pixmap pixmap25;
|
||||
Pixmap pixmap75;
|
||||
|
||||
} EditData;
|
||||
|
||||
extern EditData edit;
|
||||
|
||||
/* External Interface */
|
||||
|
||||
|
||||
extern void ColorEditor(
|
||||
Widget parent,
|
||||
ColorSet *color_set) ;
|
||||
extern void RGBtoHSV(
|
||||
#if NeedWidePrototypes
|
||||
unsigned int r,
|
||||
unsigned int g,
|
||||
unsigned int b,
|
||||
#else
|
||||
unsigned short r,
|
||||
unsigned short g,
|
||||
unsigned short b,
|
||||
#endif
|
||||
int *h,
|
||||
int *s,
|
||||
int *v) ;
|
||||
extern void restoreColorEdit(
|
||||
Widget shell,
|
||||
XrmDatabase db) ;
|
||||
extern void saveColorEdit(
|
||||
int fd) ;
|
||||
|
||||
|
||||
|
||||
#endif /* _coloredit_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
1218
cde/programs/dtstyle/ColorFile.c
Normal file
1218
cde/programs/dtstyle/ColorFile.c
Normal file
File diff suppressed because it is too large
Load Diff
55
cde/programs/dtstyle/ColorFile.h
Normal file
55
cde/programs/dtstyle/ColorFile.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/* $XConsortium: ColorFile.h /main/4 1995/10/30 13:08:30 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: ColorFile.h
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** This file contains function definitions for the corresponding .c
|
||||
** file
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _colorfile_h
|
||||
#define _colorfile_h
|
||||
|
||||
/* External variables */
|
||||
|
||||
#define DT_PAL_DIR "/.dt/palettes/"
|
||||
/*
|
||||
extern char *DT_PAL_DIR = "/.dt/palettes/";
|
||||
*/
|
||||
|
||||
/* External Interface */
|
||||
|
||||
|
||||
extern void ReadPalette( char *directory,
|
||||
char *in_filename,
|
||||
#if NeedWidePrototypes
|
||||
int length );
|
||||
#else
|
||||
short length );
|
||||
#endif
|
||||
extern void AddSystemPath( void );
|
||||
extern void AddDirectories( char *text );
|
||||
extern void AddHomePath( void );
|
||||
#if NeedWidePrototypes
|
||||
extern Boolean ReadPaletteLoop( int startup );
|
||||
#else
|
||||
extern Boolean ReadPaletteLoop( Boolean startup );
|
||||
#endif
|
||||
extern void BackdropDialog( Widget parent) ;
|
||||
extern void CheckWorkspace( void ) ;
|
||||
extern void restoreBackdrop( Widget shell, XrmDatabase db) ;
|
||||
extern void saveBackdrop( int fd) ;
|
||||
extern void CheckFileType( void );
|
||||
|
||||
|
||||
#endif /* _colorfile_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
2833
cde/programs/dtstyle/ColorMain.c
Normal file
2833
cde/programs/dtstyle/ColorMain.c
Normal file
File diff suppressed because it is too large
Load Diff
141
cde/programs/dtstyle/ColorMain.h
Normal file
141
cde/programs/dtstyle/ColorMain.h
Normal file
@@ -0,0 +1,141 @@
|
||||
/* $XConsortium: ColorMain.h /main/5 1995/10/30 13:08:51 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: ColorMain.h
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** This file contains function definitions for the corresponding .c
|
||||
** file
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _colormain_h
|
||||
#define _colormain_h
|
||||
|
||||
#include <Xm/ColorObjP.h>
|
||||
|
||||
/* #defines */
|
||||
#define PALETTE_SUFFIX ".dp"
|
||||
|
||||
/* defines for foreground colors */
|
||||
#define DYNAMIC 0
|
||||
#define BLACK 1
|
||||
#define WHITE 2
|
||||
|
||||
/* selections */
|
||||
#define GET_TYPE_MONITOR 1
|
||||
#define GET_PALETTE_NAME 2
|
||||
#define GET_UPDATE 3
|
||||
|
||||
|
||||
/* typedef statements */
|
||||
|
||||
/* ColorSet data structure */
|
||||
|
||||
typedef struct {
|
||||
XColor fg;
|
||||
XColor bg;
|
||||
XColor ts;
|
||||
XColor bs;
|
||||
XColor sc;
|
||||
} ColorSet;
|
||||
|
||||
|
||||
/* Palette info */
|
||||
|
||||
typedef struct _palette {
|
||||
char *name;
|
||||
char *desc;
|
||||
char *directory;
|
||||
int item_position;
|
||||
int num_of_colors;
|
||||
ColorSet color[XmCO_MAX_NUM_COLORS];
|
||||
struct _palette *next;
|
||||
short active;
|
||||
short inactive;
|
||||
short primary;
|
||||
short secondary;
|
||||
} palette;
|
||||
|
||||
|
||||
/* External variable definitions */
|
||||
|
||||
/* Palettes exist in a linked list */
|
||||
|
||||
extern palette *pHeadPalette;
|
||||
extern palette *pCurrentPalette;
|
||||
extern palette *pOldPalette;
|
||||
|
||||
/* atoms used in selection communication with color server */
|
||||
|
||||
extern Atom XA_CUSTOMIZE;
|
||||
extern Atom XA_PALETTE_NAME;
|
||||
extern Atom XA_TYPE_MONITOR;
|
||||
extern Atom XA_UPDATE;
|
||||
|
||||
extern Widget modifyColorButton;
|
||||
extern int TypeOfMonitor;
|
||||
extern Bool UsePixmaps;
|
||||
extern int FgColor;
|
||||
extern Widget paletteList;
|
||||
extern char *defaultName;
|
||||
extern Bool WaitSelection;
|
||||
|
||||
extern int NumOfPalettes;
|
||||
extern XColor saved_color[2];
|
||||
|
||||
|
||||
/* External Interface */
|
||||
|
||||
|
||||
extern void _DtTurnOnHourGlass( Widget );
|
||||
extern void _DtTurnOffHourGlass( Widget );
|
||||
extern void Customize( Widget shell) ;
|
||||
extern void CreatePaletteButtons( Widget parent) ;
|
||||
extern Boolean InitializePaletteList(
|
||||
Widget shell,
|
||||
Widget list,
|
||||
#if NeedWidePrototypes
|
||||
int startup) ;
|
||||
#else
|
||||
Boolean startup) ;
|
||||
#endif
|
||||
extern void DeletePaletteFromLinkList( Widget list) ;
|
||||
extern void CopyPixel( ColorSet srcPixels[XmCO_MAX_NUM_COLORS],
|
||||
ColorSet dstPixels[XmCO_MAX_NUM_COLORS],
|
||||
int numOfColors) ;
|
||||
extern void SaveOrgPalette( void ) ;
|
||||
extern void RestoreOrgPalette( void ) ;
|
||||
extern void UpdateDefaultPalette( void ) ;
|
||||
extern void show_selection(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
Atom *selection,
|
||||
Atom *type,
|
||||
XtPointer value,
|
||||
unsigned long *length,
|
||||
int *format) ;
|
||||
extern void restoreColor( Widget shell, XrmDatabase db) ;
|
||||
extern void saveColor( int fd) ;
|
||||
extern void SameName(
|
||||
Widget w,
|
||||
struct _palette *tmpPalette,
|
||||
char *name) ;
|
||||
extern void InitializeAtoms( void ) ;
|
||||
extern void GetDefaultPal( Widget shell) ;
|
||||
extern void CreateDialogBoxD( Widget parent) ;
|
||||
extern void AddToDialogBox( void ) ;
|
||||
extern void CreateTopColor1( void ) ;
|
||||
extern void CreateTopColor2( void ) ;
|
||||
extern void CreateBottomColor( void ) ;
|
||||
|
||||
|
||||
#endif /* _colormain_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
209
cde/programs/dtstyle/ColorPalette.c
Normal file
209
cde/programs/dtstyle/ColorPalette.c
Normal file
@@ -0,0 +1,209 @@
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: ColorPalette.c
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** Description: Controls the Dtstyle Color Palette data
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
/* $XConsortium: ColorPalette.c /main/6 1995/10/30 13:08:58 rswiston $ */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include files */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
#include "Main.h"
|
||||
#include "ColorMain.h"
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include extern functions */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
#include "ColorPalette.h"
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Internal Variables */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
extern Pixmap BGPixmap;
|
||||
|
||||
/*************************************************************************
|
||||
** Allocate colors for the 8 color sets within a palette, if HIGH_COLOR.
|
||||
** Will have to do major checking for low color
|
||||
** moitors. Setting the allocated pixels to pCurrentPalette.
|
||||
**
|
||||
** NOTE: for now I am allocating them all, In future we will want to
|
||||
** be more careful about our allocations.
|
||||
**************************************************************************/
|
||||
Bool
|
||||
AllocatePaletteCells(
|
||||
Widget shell )
|
||||
{
|
||||
int i;
|
||||
int colorUse;
|
||||
XmPixelSet pixels[XmCO_MAX_NUM_COLORS];
|
||||
int j=0;
|
||||
XColor colors[XmCO_MAX_NUM_COLORS * 5];
|
||||
|
||||
if(style.count > 9)
|
||||
return;
|
||||
|
||||
XmeGetPixelData (style.screenNum, &colorUse, pixels,
|
||||
&(pCurrentPalette->active),
|
||||
&(pCurrentPalette->inactive),
|
||||
&(pCurrentPalette->primary),
|
||||
&(pCurrentPalette->secondary));
|
||||
|
||||
for(i = 0; i < XmCO_MAX_NUM_COLORS; i++)
|
||||
{
|
||||
pCurrentPalette->color[i].bg.pixel = pixels[i].bg;
|
||||
pCurrentPalette->color[i].sc.pixel = pixels[i].sc;
|
||||
pCurrentPalette->color[i].fg.pixel = pixels[i].fg;
|
||||
pCurrentPalette->color[i].ts.pixel = pixels[i].ts;
|
||||
pCurrentPalette->color[i].bs.pixel = pixels[i].bs;
|
||||
|
||||
if (style.dynamicColor)
|
||||
{
|
||||
pCurrentPalette->color[i].bg.flags = DoRed | DoGreen | DoBlue;
|
||||
pCurrentPalette->color[i].fg.flags = DoRed | DoGreen | DoBlue;
|
||||
pCurrentPalette->color[i].ts.flags = DoRed | DoGreen | DoBlue;
|
||||
pCurrentPalette->color[i].bs.flags = DoRed | DoGreen | DoBlue;
|
||||
pCurrentPalette->color[i].sc.flags = DoRed | DoGreen | DoBlue;
|
||||
|
||||
if(i < pCurrentPalette->num_of_colors)
|
||||
{
|
||||
colors[j++] = pCurrentPalette->color[i].bg;
|
||||
colors[j++] = pCurrentPalette->color[i].sc;
|
||||
|
||||
if(FgColor == DYNAMIC)
|
||||
colors[j++] = pCurrentPalette->color[i].fg;
|
||||
|
||||
if(!UsePixmaps)
|
||||
{
|
||||
colors[j++] = pCurrentPalette->color[i].ts;
|
||||
colors[j++] = pCurrentPalette->color[i].bs;
|
||||
}
|
||||
}
|
||||
} /* if(TypeOfMonitor != XmCO_BLACK_WHITE) */
|
||||
}
|
||||
|
||||
if (style.dynamicColor)
|
||||
XStoreColors(style.display, style.colormap, colors, j );
|
||||
|
||||
style.count++;
|
||||
return(True);
|
||||
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
** ReColorPalette changes to RGB values of the already allocated pixels
|
||||
** for the 8 color buttons. Each color button uses 5 pixels (at least
|
||||
** for now.)
|
||||
**
|
||||
** The palette passed has the colors the pixels are going to change to.
|
||||
**
|
||||
**************************************************************************/
|
||||
int
|
||||
ReColorPalette( void )
|
||||
{
|
||||
register int n;
|
||||
Arg args[MAX_ARGS];
|
||||
int i;
|
||||
int j=0;
|
||||
XColor colors[XmCO_MAX_NUM_COLORS * 5];
|
||||
|
||||
for(i = 0; i < XmCO_MAX_NUM_COLORS; i++)
|
||||
{
|
||||
pCurrentPalette->primary = pOldPalette->primary;
|
||||
pCurrentPalette->secondary = pOldPalette->secondary;
|
||||
pCurrentPalette->active = pOldPalette->active;
|
||||
pCurrentPalette->inactive = pOldPalette->inactive;
|
||||
|
||||
pCurrentPalette->color[i].bg.pixel =
|
||||
pOldPalette->color[i].bg.pixel;
|
||||
if(TypeOfMonitor != XmCO_BLACK_WHITE)
|
||||
{
|
||||
pCurrentPalette->color[i].bg.flags = DoRed | DoGreen | DoBlue;
|
||||
if(i < pCurrentPalette->num_of_colors)
|
||||
colors[j++] = pCurrentPalette->color[i].bg;
|
||||
}
|
||||
|
||||
pCurrentPalette->color[i].sc.pixel =
|
||||
pOldPalette->color[i].sc.pixel;
|
||||
if(TypeOfMonitor != XmCO_BLACK_WHITE)
|
||||
{
|
||||
pCurrentPalette->color[i].sc.flags = DoRed | DoGreen | DoBlue;
|
||||
if(i < pCurrentPalette->num_of_colors)
|
||||
colors[j++] = pCurrentPalette->color[i].sc;
|
||||
}
|
||||
|
||||
pCurrentPalette->color[i].fg.pixel =
|
||||
pOldPalette->color[i].fg.pixel;
|
||||
if(TypeOfMonitor != XmCO_BLACK_WHITE)
|
||||
{
|
||||
if(FgColor == DYNAMIC)
|
||||
{
|
||||
pCurrentPalette->color[i].fg.flags = DoRed | DoGreen | DoBlue;
|
||||
if(i < pCurrentPalette->num_of_colors)
|
||||
colors[j++] = pCurrentPalette->color[i].fg;
|
||||
}
|
||||
}
|
||||
|
||||
pCurrentPalette->color[i].ts.pixel =
|
||||
pOldPalette->color[i].ts.pixel;
|
||||
if(TypeOfMonitor != XmCO_BLACK_WHITE)
|
||||
{
|
||||
if(UsePixmaps == FALSE)
|
||||
{
|
||||
pCurrentPalette->color[i].ts.flags = DoRed | DoGreen | DoBlue;
|
||||
if(i < pCurrentPalette->num_of_colors)
|
||||
colors[j++] = pCurrentPalette->color[i].ts;
|
||||
}
|
||||
}
|
||||
|
||||
pCurrentPalette->color[i].bs.pixel =
|
||||
pOldPalette->color[i].bs.pixel;
|
||||
if(TypeOfMonitor != XmCO_BLACK_WHITE)
|
||||
{
|
||||
if(UsePixmaps == FALSE)
|
||||
{
|
||||
pCurrentPalette->color[i].bs.flags = DoRed | DoGreen | DoBlue;
|
||||
if(i < pCurrentPalette->num_of_colors)
|
||||
colors[j++] = pCurrentPalette->color[i].bs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (TypeOfMonitor != XmCO_BLACK_WHITE)
|
||||
XStoreColors(style.display, style.colormap, colors, j );
|
||||
|
||||
return(True);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
** CheckMonitor - querry color server for monitor type
|
||||
**************************************************************************/
|
||||
void
|
||||
CheckMonitor(
|
||||
Widget shell )
|
||||
{
|
||||
WaitSelection = TRUE;
|
||||
|
||||
XtGetSelectionValue(shell, XA_CUSTOMIZE, XA_TYPE_MONITOR, show_selection,
|
||||
(XtPointer)GET_TYPE_MONITOR, CurrentTime);
|
||||
|
||||
XFlush(style.display);
|
||||
|
||||
while(WaitSelection)
|
||||
XtAppProcessEvent (XtWidgetToApplicationContext(shell), XtIMAll);
|
||||
|
||||
}
|
||||
31
cde/programs/dtstyle/ColorPalette.h
Normal file
31
cde/programs/dtstyle/ColorPalette.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/* $XConsortium: ColorPalette.h /main/4 1995/10/30 13:09:05 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: ColorPalette.h
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** This file contains function definitions for the corresponding .c
|
||||
** file
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _colorpalette_h
|
||||
#define _colorpalette_h
|
||||
|
||||
/* External Interface */
|
||||
|
||||
|
||||
extern Bool AllocatePaletteCells( Widget shell) ;
|
||||
extern int ReColorPalette( void ) ;
|
||||
extern void CheckMonitor( Widget shell) ;
|
||||
|
||||
|
||||
#endif /* _colorpalette_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
80
cde/programs/dtstyle/Dtstyle.src
Normal file
80
cde/programs/dtstyle/Dtstyle.src
Normal file
@@ -0,0 +1,80 @@
|
||||
! $XConsortium: Dtstyle.src /main/4 1996/04/23 20:20:51 drk $
|
||||
!######################################################################
|
||||
!#
|
||||
!# Dtstyle
|
||||
!#
|
||||
!# Common Desktop Environment (CDE)
|
||||
!#
|
||||
!# Application Defaults for the Style Manager
|
||||
!#
|
||||
!# (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
!# (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
!# (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
!# (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary
|
||||
!# of Novell, Inc.
|
||||
!#
|
||||
!#
|
||||
!######################################################################
|
||||
|
||||
XCOMM include "Dt"
|
||||
|
||||
!###
|
||||
!#
|
||||
!# Main Window configuration
|
||||
!#
|
||||
!# Do not translate the following
|
||||
!###
|
||||
!# componentList specifies the buttons that appear in the Style Manager.
|
||||
!# The last button I18N is locale dependent.
|
||||
Dtstyle*componentList: Color Font Backdrop Keyboard Mouse Beep Screen Dtwm Startup %|nls-6-#I18N#|
|
||||
|
||||
!# The Style Manager may be oriented vertically by commenting out this line
|
||||
Dtstyle*mainRC.orientation: HORIZONTAL
|
||||
|
||||
!###
|
||||
!#
|
||||
!# Font Dialog
|
||||
!#
|
||||
!# Font resource values must be a valid interface font alias name.
|
||||
!#
|
||||
!# Font resource values must match exactly the default font resources
|
||||
!# specified in CDE_INSTALLATION_TOP/%L/sys.fonts.
|
||||
!#
|
||||
!# Do not translate the following
|
||||
!###
|
||||
|
||||
Dtstyle*NumFonts: %|nls-3-7^NumFonts|
|
||||
|
||||
%|nls-4-#Set of SystemFont#|
|
||||
|
||||
%|nls-5-#Set of UserFont#|
|
||||
|
||||
|
||||
!###
|
||||
!#
|
||||
!# Audio Dialog
|
||||
!#
|
||||
!# These resources specify the minimum and maximum tome for the bell,
|
||||
!# and the bell duration. Tones outside this range are hard to hear.
|
||||
!# The duration scale is in tenths of a second, 25 means 2.5 seconds.
|
||||
!#
|
||||
!# Do not translate the following
|
||||
!###
|
||||
Dtstyle*toneScale.maximum: 9000
|
||||
Dtstyle*toneScale.minimum: 82
|
||||
Dtstyle*durationScale.maximum: 25
|
||||
|
||||
|
||||
!###
|
||||
!#
|
||||
!# Accelerators
|
||||
!#
|
||||
!# Do not translate the following
|
||||
!###
|
||||
Dtstyle*fileMenu.exit.acceleratorText: %|nls-1-#Alt+F4#|
|
||||
Dtstyle*fileMenu.exit.accelerator: %|nls-2-#Alt<key>F4#|
|
||||
|
||||
!########################### eof ###########################
|
||||
|
||||
|
||||
|
||||
1089
cde/programs/dtstyle/Dtwm.c
Normal file
1089
cde/programs/dtstyle/Dtwm.c
Normal file
File diff suppressed because it is too large
Load Diff
31
cde/programs/dtstyle/Dtwm.h
Normal file
31
cde/programs/dtstyle/Dtwm.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/* $XConsortium: Dtwm.h /main/4 1995/10/30 13:09:24 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Screen.h
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** This file contains function definitions for the corresponding .c
|
||||
** file
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _screen_h
|
||||
#define _screen_h
|
||||
|
||||
/* External Interface */
|
||||
|
||||
|
||||
extern void popup_dtwmBB( Widget shell) ;
|
||||
extern void restoreDtwm( Widget shell, XrmDatabase db) ;
|
||||
extern void saveDtwm( int fd) ;
|
||||
|
||||
|
||||
#endif /* _screen_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
738
cde/programs/dtstyle/Font.c
Normal file
738
cde/programs/dtstyle/Font.c
Normal file
@@ -0,0 +1,738 @@
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Font.c
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** Description: Controls the Dtstyle Font dialog
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
/* $XConsortium: Font.c /main/7 1996/10/30 11:14:15 drk $ */
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include files */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <Xm/MwmUtil.h>
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/XmP.h>
|
||||
#include <Xm/MessageB.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/Frame.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/List.h>
|
||||
#include <Xm/Scale.h>
|
||||
#include <Xm/Text.h>
|
||||
#include <Xm/TextF.h>
|
||||
#include <Xm/VendorSEP.h>
|
||||
|
||||
#include <Dt/DialogBox.h>
|
||||
#include <Dt/Icon.h>
|
||||
#include <Dt/TitleBox.h>
|
||||
|
||||
#include <Dt/Message.h>
|
||||
#include <Dt/SessionM.h>
|
||||
#include <Dt/HourGlass.h>
|
||||
|
||||
#include <string.h>
|
||||
#include "Help.h"
|
||||
#include "Main.h"
|
||||
#include "SaveRestore.h"
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Local #defines */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
#define FONT_MSG ((char *)GETMESSAGE(5, 23, "Style Manager - Font"))
|
||||
#define PREVIEW ((char *)GETMESSAGE(5, 17, "Preview"))
|
||||
#define IMMEDIATE ((char *)GETMESSAGE(5, 18, "The changes to fonts will show up in some\napplications the next time they are started.\nOther applications, such as file manager and\napplication manager, will not show the font\nchanges until you Exit the desktop and then log\nback in."))
|
||||
#define LATER ((char *)GETMESSAGE(5, 19, "The selected font will be used when\n you restart this session."))
|
||||
#define INFO_MSG ((char *)GETMESSAGE(5, 24, "The font that is currently used for your desktop is not\navailable in the Size list. If a new font is selected and\napplied, you will not be able to return to the current font\nusing the Style Manager - Font dialog."))
|
||||
#define SYSTEM_MSG ((char *)GETMESSAGE(5, 20, "AaBbCcDdEeFfGg0123456789"))
|
||||
#define USER_MSG ((char *)GETMESSAGE(5, 21, "AaBbCcDdEeFfGg0123456789"))
|
||||
#define BLANK_MSG " "
|
||||
#define SIZE ((char *)GETMESSAGE(5, 22, "Size"))
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Internal Variables */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
typedef struct {
|
||||
Widget fontWkarea;
|
||||
Widget fontpictLabel;
|
||||
Widget previewTB;
|
||||
Widget previewForm;
|
||||
Widget systemLabel;
|
||||
Widget userText;
|
||||
Widget sizeTB;
|
||||
Widget sizeList;
|
||||
int originalFontIndex;
|
||||
int selectedFontIndex;
|
||||
String selectedFontStr;
|
||||
Boolean userTextChanged;
|
||||
} FontData;
|
||||
static FontData font;
|
||||
|
||||
static saveRestore save = {FALSE, 0, };
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Internal Functions */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
static void CreateFontDlg(
|
||||
Widget parent) ;
|
||||
static void _DtmapCB_fontBB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
static void ButtonCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
static void changeSampleFontCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
static void valueChangedCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* popup_fontBB */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
void
|
||||
popup_fontBB(
|
||||
Widget shell )
|
||||
{
|
||||
if (style.fontDialog == NULL) {
|
||||
_DtTurnOnHourGlass(shell);
|
||||
CreateFontDlg(shell);
|
||||
XtManageChild(style.fontDialog);
|
||||
_DtTurnOffHourGlass(shell);
|
||||
} else {
|
||||
XtManageChild(style.fontDialog);
|
||||
raiseWindow(XtWindow(XtParent(style.fontDialog)));
|
||||
}
|
||||
|
||||
/* If no font is found to match current Desktop
|
||||
font, pop up informative message */
|
||||
if (font.selectedFontIndex < 0)
|
||||
InfoDialog(INFO_MSG, style.shell, False);
|
||||
}
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* CreateFontDlg */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
CreateFontDlg(
|
||||
Widget parent )
|
||||
{
|
||||
|
||||
register int n;
|
||||
int i;
|
||||
Arg args[MAX_ARGS];
|
||||
Widget appTBox;
|
||||
Widget sizeMenuPlDn;
|
||||
XmString button_string[NUM_LABELS];
|
||||
XmString string;
|
||||
int count = 0;
|
||||
Widget widget_list[6];
|
||||
XmString *sizeItems;
|
||||
XmStringTable selectedSize;
|
||||
char sizeStr[111];
|
||||
Dimension fontheight;
|
||||
|
||||
|
||||
font.selectedFontStr = style.xrdb.systemFontStr;
|
||||
|
||||
/* Assume nothing is selected */
|
||||
font.selectedFontIndex = -1;
|
||||
|
||||
/*
|
||||
* The following flag is used to determine if the user has
|
||||
* entered anything into the sample user font field. If
|
||||
* he does, than when the font selection is changed, the
|
||||
* default message "aAbBcC..." won't be displayed overwriting
|
||||
* the user's text, only the fontlist will be changed.
|
||||
* This flag will be set in the valueChanged callback for the
|
||||
* font.sizeList widget.
|
||||
*/
|
||||
font.userTextChanged = FALSE;
|
||||
|
||||
/*
|
||||
* Look for the selectedFont in the fontChoice array and set
|
||||
* selectedFontIndex to that entry
|
||||
*/
|
||||
for (i=0; i<style.xrdb.numFonts; i++)
|
||||
if (strcmp (font.selectedFontStr,
|
||||
style.xrdb.fontChoice[i].sysStr) == 0)
|
||||
{
|
||||
font.selectedFontIndex = i;
|
||||
if (!style.xrdb.fontChoice[i].userFont)
|
||||
GetUserFontResource(i);
|
||||
if (!style.xrdb.fontChoice[i].sysFont)
|
||||
GetSysFontResource(i);
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Save the index of the originally selected font. If no
|
||||
* font is selected, this value will remain -1.
|
||||
*/
|
||||
font.originalFontIndex = font.selectedFontIndex;
|
||||
|
||||
/* Set up button labels. */
|
||||
button_string[0] = CMPSTR(_DtOkString);
|
||||
button_string[1] = CMPSTR(_DtCancelString);
|
||||
button_string[2] = CMPSTR(_DtHelpString);
|
||||
|
||||
/* Create toplevel DialogBox */
|
||||
/* saveRestore
|
||||
* Note that save.poscnt has been initialized elsewhere.
|
||||
* save.posArgs may contain information from restoreFont().
|
||||
*/
|
||||
|
||||
XtSetArg(save.posArgs[save.poscnt], XmNallowOverlap, False); save.poscnt++;
|
||||
XtSetArg(save.posArgs[save.poscnt], XmNdefaultPosition, False);
|
||||
save.poscnt++;
|
||||
XtSetArg(save.posArgs[save.poscnt], XmNbuttonCount, NUM_LABELS);
|
||||
save.poscnt++;
|
||||
XtSetArg(save.posArgs[save.poscnt], XmNbuttonLabelStrings, button_string);
|
||||
save.poscnt++;
|
||||
style.fontDialog =
|
||||
__DtCreateDialogBoxDialog(parent, "Fonts", save.posArgs, save.poscnt);
|
||||
XtAddCallback(style.fontDialog, XmNcallback, ButtonCB, NULL);
|
||||
XtAddCallback(style.fontDialog, XmNmapCallback, _DtmapCB_fontBB,
|
||||
(XtPointer)parent);
|
||||
XtAddCallback(style.fontDialog, XmNhelpCallback,
|
||||
(XtCallbackProc)HelpRequestCB, (XtPointer)HELP_FONT_DIALOG);
|
||||
|
||||
XmStringFree(button_string[0]);
|
||||
XmStringFree(button_string[1]);
|
||||
XmStringFree(button_string[2]);
|
||||
|
||||
widget_list[0] = _DtDialogBoxGetButton(style.fontDialog,2);
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNautoUnmanage, False); n++;
|
||||
XtSetArg(args[n], XmNcancelButton, widget_list[0]); n++;
|
||||
XtSetValues (style.fontDialog, args, n);
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNtitle, FONT_MSG); n++;
|
||||
XtSetArg (args[n], XmNuseAsyncGeometry, True); n++;
|
||||
XtSetArg(args[n], XmNmwmFunctions, DIALOG_MWM_FUNC); n++;
|
||||
XtSetValues (XtParent(style.fontDialog), args, n);
|
||||
|
||||
n = 0;
|
||||
XtSetArg (args[n], XmNchildType, XmWORK_AREA); n++;
|
||||
XtSetArg(args[n], XmNhorizontalSpacing, style.horizontalSpacing); n++;
|
||||
XtSetArg(args[n], XmNverticalSpacing, style.verticalSpacing); n++;
|
||||
XtSetArg(args[n], XmNallowOverlap, False); n++;
|
||||
font.fontWkarea = XmCreateForm(style.fontDialog, "fontWorkArea", args, n);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNtopOffset, style.verticalSpacing); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
|
||||
|
||||
XtSetArg(args[n], XmNfillMode, XmFILL_SELF); n++;
|
||||
XtSetArg(args[n], XmNbehavior, XmICON_LABEL); n++;
|
||||
XtSetArg(args[n], XmNpixmapForeground, style.secBSCol); n++;
|
||||
XtSetArg(args[n], XmNpixmapBackground, style.secTSCol); n++;
|
||||
XtSetArg(args[n], XmNstring, NULL); n++;
|
||||
XtSetArg(args[n], XmNshadowThickness, 0); n++;
|
||||
XtSetArg(args[n], XmNimageName, FONT_ICON); n++;
|
||||
XtSetArg(args[n], XmNtraversalOn, False); n++;
|
||||
widget_list[count++] = font.fontpictLabel =
|
||||
_DtCreateIcon(font.fontWkarea, "fontpictLabel", args, n);
|
||||
|
||||
/* Create a TitleBox and Scale/List to choose the font size */
|
||||
|
||||
n = 0;
|
||||
string = CMPSTR(SIZE);
|
||||
XtSetArg(args[n], XmNtitleString, string); n++;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, font.fontpictLabel); n++;
|
||||
XtSetArg(args[n], XmNtopOffset, style.verticalSpacing+5); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNleftOffset, style.horizontalSpacing); n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++;
|
||||
widget_list[count++] = font.sizeTB =
|
||||
_DtCreateTitleBox(font.fontWkarea, "sizeTB", args, n);
|
||||
XmStringFree(string);
|
||||
|
||||
/* calculate size for each of the fonts based on system font size */
|
||||
|
||||
sizeItems = (XmString *) XtMalloc(sizeof(XmString) * style.xrdb.numFonts);
|
||||
for (n=0; n<style.xrdb.numFonts; n++)
|
||||
{
|
||||
sprintf(sizeStr, "%d", (int)(n+1));
|
||||
sizeItems[n] = CMPSTR(sizeStr);
|
||||
style.xrdb.fontChoice[n].pointSize = CMPSTR(sizeStr);
|
||||
}
|
||||
|
||||
|
||||
n=0;
|
||||
XtSetArg (args[n], XmNselectionPolicy, XmBROWSE_SELECT); n++;
|
||||
XtSetArg (args[n], XmNautomaticSelection, True); n++;
|
||||
XtSetArg (args[n], XmNvisibleItemCount, 7); n++;
|
||||
XtSetArg (args[n], XmNitemCount, style.xrdb.numFonts); n++;
|
||||
XtSetArg (args[n], XmNitems, sizeItems); n++;
|
||||
|
||||
/*
|
||||
* If matching font was found for current selection,
|
||||
* display it as selected. Otherwise, don't select
|
||||
* anything.
|
||||
*/
|
||||
if (font.selectedFontIndex >=0) {
|
||||
selectedSize = &(style.xrdb.fontChoice[font.selectedFontIndex].pointSize);
|
||||
XtSetArg (args[n], XmNselectedItems, selectedSize); n++;
|
||||
XtSetArg (args[n], XmNselectedItemCount, 1); n++;
|
||||
}
|
||||
font.sizeList = XmCreateScrolledList(font.sizeTB,"sizeList",args,n);
|
||||
XtAddCallback(font.sizeList, XmNbrowseSelectionCallback,
|
||||
changeSampleFontCB, NULL);
|
||||
|
||||
/* If a font match was found and selected, then set it's point size. */
|
||||
if (font.selectedFontIndex >=0)
|
||||
XmListSetItem(font.sizeList,
|
||||
style.xrdb.fontChoice[font.selectedFontIndex].pointSize);
|
||||
XtFree((char *)sizeItems);
|
||||
|
||||
/* preview TitleBox */
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, font.fontpictLabel); n++;
|
||||
XtSetArg(args[n], XmNtopOffset, style.verticalSpacing+5); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNleftWidget, font.sizeTB); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNrightOffset, style.horizontalSpacing); n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNbottomOffset, style.verticalSpacing); n++;
|
||||
string = CMPSTR(PREVIEW);
|
||||
XtSetArg(args[n], XmNtitleString, string); n++;
|
||||
widget_list[count++] = font.previewTB =
|
||||
_DtCreateTitleBox(font.fontWkarea, "systemSample", args, n);
|
||||
XmStringFree(string);
|
||||
|
||||
/*form to contain preview font area*/
|
||||
n = 0;
|
||||
font.previewForm =
|
||||
XmCreateForm(font.previewTB, "previewForm", args, n);
|
||||
|
||||
/* sample system font */
|
||||
n = 0;
|
||||
|
||||
/*
|
||||
* If a font match was found and selected, then set the fontlist
|
||||
* and the sample string. Otherwise, output a blank message.
|
||||
*/
|
||||
if (font.selectedFontIndex >=0) {
|
||||
XtSetArg (args[n], XmNfontList,
|
||||
style.xrdb.fontChoice[font.selectedFontIndex].sysFont); n++;
|
||||
string = CMPSTR(SYSTEM_MSG);
|
||||
} else {
|
||||
string = CMPSTR(BLANK_MSG);
|
||||
}
|
||||
XtSetArg (args[n], XmNlabelString, string); n++;
|
||||
XtSetArg (args[n], XmNalignment, XmALIGNMENT_BEGINNING); n++;
|
||||
XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg (args[n], XmNtopOffset, 2 * style.verticalSpacing); n++;
|
||||
XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg (args[n], XmNbottomAttachment, XmATTACH_NONE); n++;
|
||||
font.systemLabel =
|
||||
XmCreateLabelGadget(font.previewForm, "systemSample", args, n);
|
||||
XmStringFree(string);
|
||||
|
||||
/* sample user font */
|
||||
n = 0;
|
||||
/*
|
||||
* If a font match was found and selected, then set the fontlist
|
||||
* and the sample string. Otherwise output a blank message.
|
||||
*/
|
||||
if (font.selectedFontIndex >=0) {
|
||||
XtSetArg (args[n], XmNfontList,
|
||||
style.xrdb.fontChoice[font.selectedFontIndex].userFont); n++;
|
||||
XtSetArg (args[n], XmNvalue, USER_MSG); n++;
|
||||
} else {
|
||||
XtSetArg (args[n], XmNvalue, NULL); n++;
|
||||
}
|
||||
|
||||
XtSetArg (args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg (args[n], XmNtopWidget, font.systemLabel); n++;
|
||||
XtSetArg (args[n], XmNtopOffset, 2 * style.verticalSpacing); n++;
|
||||
XtSetArg (args[n], XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg (args[n], XmNleftWidget, font.systemLabel); n++;
|
||||
XtSetArg (args[n], XmNbottomAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg (args[n], XmNrightAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg (args[n], XmNrightWidget, font.systemLabel); n++;
|
||||
font.userText =
|
||||
XmCreateText(font.previewForm, "userText", args, n);
|
||||
/* Add callback to determine if user changes text in sample field */
|
||||
XtAddCallback(font.userText, XmNvalueChangedCallback, valueChangedCB, NULL);
|
||||
|
||||
XtManageChild(font.systemLabel);
|
||||
XtManageChild(font.userText);
|
||||
XtManageChild(font.previewForm);
|
||||
XtManageChild(font.sizeList);
|
||||
XtManageChildren(widget_list,count);
|
||||
XtManageChild(font.fontWkarea);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* _DtmapCB_fontBB */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
_DtmapCB_fontBB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
|
||||
DtWsmRemoveWorkspaceFunctions(style.display, XtWindow(XtParent(w)));
|
||||
|
||||
if (!save.restoreFlag)
|
||||
putDialog ((Widget)client_data, w);
|
||||
|
||||
XmTextShowPosition(font.userText, 0);
|
||||
|
||||
XtRemoveCallback(style.fontDialog, XmNmapCallback, _DtmapCB_fontBB, NULL);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
/* ButtonCB */
|
||||
/* Process callback from PushButtons in DialogBox. */
|
||||
/*+++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
ButtonCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
DtDialogBoxCallbackStruct *cb
|
||||
= (DtDialogBoxCallbackStruct *) call_data;
|
||||
int n, len, items;
|
||||
char *str, *fntstr, *fntsetstr;
|
||||
Arg args[MAX_ARGS];
|
||||
char fontres[8192];
|
||||
|
||||
switch (cb->button_position)
|
||||
{
|
||||
/* Set the xrdb or pass to dtsession and close the window */
|
||||
case OK_BUTTON:
|
||||
/*
|
||||
* Need to test for the case where the Font dialog maps without
|
||||
* any fonts selected, and the user presses OK. Do this by
|
||||
* checking for number of items selected before changing
|
||||
* anything.
|
||||
*/
|
||||
XtVaGetValues (font.sizeList, XmNselectedItemCount, &items, NULL);
|
||||
|
||||
/* Post an info dialog explaining when the new fonts will appear */
|
||||
if ((font.selectedFontIndex != font.originalFontIndex) && (items > 0))
|
||||
{
|
||||
XtUnmanageChild(style.fontDialog);
|
||||
|
||||
if(style.xrdb.writeXrdbImmediate)
|
||||
{
|
||||
InfoDialog(IMMEDIATE, style.shell, False);
|
||||
}
|
||||
else
|
||||
{
|
||||
InfoDialog(LATER, style.shell, False);
|
||||
}
|
||||
|
||||
/*
|
||||
for *FontSet resource: find first font entry delimited by a ":"
|
||||
or an "=".
|
||||
*/
|
||||
len =strcspn(style.xrdb.fontChoice[font.selectedFontIndex].userStr,
|
||||
":=");
|
||||
fntsetstr = (char *) XtCalloc(1, len + 1);
|
||||
memcpy(fntsetstr,
|
||||
style.xrdb.fontChoice[font.selectedFontIndex].userStr,
|
||||
len);
|
||||
|
||||
/*
|
||||
Since the *Font and *FontSet resources may be used by old
|
||||
X applications, a fontlist of multiple fonts must be converted
|
||||
to Xt font set format (';'s converted to ','s since many old X
|
||||
apps don't understand ';' syntax.)
|
||||
*/
|
||||
str = strstr(fntsetstr,";");
|
||||
while (str) {
|
||||
*str = ',';
|
||||
str = strstr(str,";");
|
||||
}
|
||||
|
||||
/*
|
||||
for *Font resource: find first font entry delimited by a comma,
|
||||
a colon or an =
|
||||
*/
|
||||
len = strcspn(fntsetstr,",:=");
|
||||
fntstr = (char *) XtCalloc(1, len + 1);
|
||||
memcpy(fntstr,
|
||||
style.xrdb.fontChoice[font.selectedFontIndex].userStr,
|
||||
len);
|
||||
|
||||
/*
|
||||
for *FontSet resource: if we got a font (instead of a font set)
|
||||
from the first entry, then wildcard its charset fields
|
||||
*/
|
||||
len = strlen(fntsetstr);
|
||||
if (style.xrdb.fontChoice[font.selectedFontIndex].userStr[len]
|
||||
!= ':') {
|
||||
str = strchr(fntsetstr, '-');
|
||||
for (n = 1; n < 13 && str; n++)
|
||||
str = strchr(str + 1, '-');
|
||||
if (str)
|
||||
strcpy(str + 1, "*-*");
|
||||
}
|
||||
|
||||
/* create the font resource specs with the selected font for xrdb */
|
||||
sprintf(fontres,
|
||||
"*systemFont: %s\n*userFont: %s\n*FontList: %s\n*buttonFontList: %s\n*labelFontList: %s\n*textFontList: %s\n*XmText*FontList: %s\n*XmTextField*FontList: %s\n*DtEditor*textFontList: %s\n*Font: %s\n*FontSet: %s\n",
|
||||
style.xrdb.fontChoice[font.selectedFontIndex].sysStr,
|
||||
style.xrdb.fontChoice[font.selectedFontIndex].userStr,
|
||||
style.xrdb.fontChoice[font.selectedFontIndex].sysStr,
|
||||
style.xrdb.fontChoice[font.selectedFontIndex].sysStr,
|
||||
style.xrdb.fontChoice[font.selectedFontIndex].sysStr,
|
||||
style.xrdb.fontChoice[font.selectedFontIndex].userStr,
|
||||
style.xrdb.fontChoice[font.selectedFontIndex].userStr,
|
||||
style.xrdb.fontChoice[font.selectedFontIndex].userStr,
|
||||
style.xrdb.fontChoice[font.selectedFontIndex].userStr,
|
||||
fntstr, fntsetstr);
|
||||
|
||||
XtFree(fntstr);
|
||||
XtFree(fntsetstr);
|
||||
|
||||
/* if writeXrdbImmediate true write to Xrdb else send to session mgr */
|
||||
if(style.xrdb.writeXrdbImmediate)
|
||||
_DtAddToResource(style.display,fontres);
|
||||
|
||||
SmNewFontSettings(fontres);
|
||||
|
||||
font.originalFontIndex = font.selectedFontIndex;
|
||||
style.xrdb.systemFontStr = font.selectedFontStr;
|
||||
}
|
||||
|
||||
else
|
||||
XtUnmanageChild(style.fontDialog);
|
||||
|
||||
break;
|
||||
|
||||
case CANCEL_BUTTON:
|
||||
|
||||
/* reset preview area fonts to original and close the window*/
|
||||
|
||||
XtUnmanageChild(style.fontDialog);
|
||||
|
||||
if (font.originalFontIndex >= 0)
|
||||
XmListSelectPos(font.sizeList, font.originalFontIndex+1, True);
|
||||
else {
|
||||
/*
|
||||
* if no font was originally selected, need to undo any results
|
||||
* from selections that were made by user before pressing Cancel.
|
||||
*/
|
||||
XtVaSetValues (font.sizeList, XmNselectedItemCount, 0, NULL);
|
||||
XtVaSetValues (font.userText,
|
||||
XmNvalue, BLANK_MSG,
|
||||
XmNfontList, style.xrdb.userFont,
|
||||
NULL);
|
||||
XtVaSetValues (font.systemLabel,
|
||||
XmNlabelString, CMPSTR(BLANK_MSG),
|
||||
XmNfontList, style.xrdb.systemFont,
|
||||
NULL);
|
||||
font.userTextChanged = FALSE;
|
||||
font.selectedFontIndex = -1;
|
||||
}
|
||||
break;
|
||||
|
||||
case HELP_BUTTON:
|
||||
XtCallCallbacks(style.fontDialog, XmNhelpCallback, (XtPointer)NULL);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* changSampleFontCB */
|
||||
/* Change the font in the sample areas */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
changeSampleFontCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
int n;
|
||||
int pos;
|
||||
int hourGlassOn;
|
||||
Arg args[MAX_ARGS];
|
||||
XmListCallbackStruct *cb = (XmListCallbackStruct *) call_data;
|
||||
|
||||
pos = cb->item_position-1;
|
||||
|
||||
font.selectedFontIndex = pos;
|
||||
font.selectedFontStr = style.xrdb.fontChoice[pos].sysStr;
|
||||
|
||||
hourGlassOn = !style.xrdb.fontChoice[pos].userFont ||
|
||||
!style.xrdb.fontChoice[pos].sysFont;
|
||||
|
||||
if (hourGlassOn)
|
||||
_DtTurnOnHourGlass(style.fontDialog);
|
||||
|
||||
if (!style.xrdb.fontChoice[pos].userFont)
|
||||
GetUserFontResource(pos);
|
||||
if (!style.xrdb.fontChoice[pos].sysFont)
|
||||
GetSysFontResource(pos);
|
||||
|
||||
if (hourGlassOn)
|
||||
_DtTurnOffHourGlass(style.fontDialog);
|
||||
|
||||
/* Set the sample System Font string to different Font */
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNfontList, style.xrdb.fontChoice[pos].sysFont); n++;
|
||||
/* string_val = CMPSTR(SYSTEM_MSG);*/
|
||||
XtSetArg (args[n], XmNlabelString, CMPSTR(SYSTEM_MSG)); n++;
|
||||
XtSetValues (font.systemLabel, args, n);
|
||||
|
||||
/*
|
||||
* If the user didn't change the text field, output standard user
|
||||
* text message.
|
||||
*/
|
||||
n = 0;
|
||||
if (!font.userTextChanged)
|
||||
XtSetArg (args[n], XmNvalue, USER_MSG); n++;
|
||||
XtSetArg(args[n], XmNfontList, style.xrdb.fontChoice[pos].userFont); n++;
|
||||
XtSetValues (font.userText, args, n);
|
||||
XmTextShowPosition(font.userText, 0);
|
||||
}
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* valueChangedCB */
|
||||
/* Set flag indicating that the user */
|
||||
/* text field has been modified. */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
valueChangedCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
|
||||
{
|
||||
font.userTextChanged = TRUE;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* restoreFonts()
|
||||
*
|
||||
* restore any state information saved with saveFonts.
|
||||
* This is called from restoreSession with the application
|
||||
* shell and the special xrm database retrieved for restore.
|
||||
************************************************************************/
|
||||
void
|
||||
restoreFonts(
|
||||
Widget shell,
|
||||
XrmDatabase db )
|
||||
{
|
||||
XrmName xrm_name[5];
|
||||
XrmRepresentation rep_type;
|
||||
XrmValue value;
|
||||
|
||||
xrm_name [0] = XrmStringToQuark ("Fonts");
|
||||
xrm_name [2] = NULL;
|
||||
|
||||
/* get x position */
|
||||
xrm_name [1] = XrmStringToQuark ("x");
|
||||
if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value)){
|
||||
XtSetArg (save.posArgs[save.poscnt], XmNx, atoi((char *)value.addr));
|
||||
save.poscnt++;
|
||||
save.restoreFlag = True;
|
||||
}
|
||||
|
||||
/* get y position */
|
||||
xrm_name [1] = XrmStringToQuark ("y");
|
||||
if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value)){
|
||||
XtSetArg (save.posArgs[save.poscnt], XmNy, atoi((char *)value.addr));
|
||||
save.poscnt++;
|
||||
}
|
||||
|
||||
xrm_name [1] = XrmStringToQuark ("ismapped");
|
||||
XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value);
|
||||
/* Are we supposed to be mapped? */
|
||||
if (strcmp(value.addr, "True") == 0)
|
||||
popup_fontBB(shell);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* saveFonts()
|
||||
*
|
||||
* This routine will write out to the passed file descriptor any state
|
||||
* information this dialog needs. It is called from saveSessionCB with the
|
||||
* file already opened.
|
||||
* All information is saved in xrm format. There is no restriction
|
||||
* on what can be saved. It doesn't have to be defined or be part of any
|
||||
* widget or Xt definition. Just name and save it here and recover it in
|
||||
* restoreFonts. The suggested minimum is whether you are mapped, and your
|
||||
* location.
|
||||
************************************************************************/
|
||||
void
|
||||
saveFonts(
|
||||
int fd )
|
||||
{
|
||||
Position x,y;
|
||||
char *bufr = style.tmpBigStr; /* size=[1024], make bigger if needed */
|
||||
XmVendorShellExtObject vendorExt;
|
||||
XmWidgetExtData extData;
|
||||
|
||||
if (style.fontDialog != NULL) {
|
||||
if (XtIsManaged(style.fontDialog))
|
||||
sprintf(bufr, "*Fonts.ismapped: True\n");
|
||||
else
|
||||
sprintf(bufr, "*Fonts.ismapped: False\n");
|
||||
|
||||
/* Get and write out the geometry info for our Window */
|
||||
|
||||
x = XtX(XtParent(style.fontDialog));
|
||||
y = XtY(XtParent(style.fontDialog));
|
||||
|
||||
/* Modify x & y to take into account window mgr frames
|
||||
* This is pretty bogus, but I don't know a better way to do it.
|
||||
*/
|
||||
extData = _XmGetWidgetExtData(style.shell, XmSHELL_EXTENSION);
|
||||
vendorExt = (XmVendorShellExtObject)extData->widget;
|
||||
x -= vendorExt->vendor.xOffset;
|
||||
y -= vendorExt->vendor.yOffset;
|
||||
|
||||
sprintf(bufr, "%s*Fonts.x: %d\n", bufr, x);
|
||||
sprintf(bufr, "%s*Fonts.y: %d\n", bufr, y);
|
||||
|
||||
write (fd, bufr, strlen(bufr));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
41
cde/programs/dtstyle/Font.h
Normal file
41
cde/programs/dtstyle/Font.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/* $XConsortium: Font.h /main/4 1995/10/30 13:09:39 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Font.h
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** This file contains function definitions for the corresponding .c
|
||||
** file
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _font_h
|
||||
#define _font_h
|
||||
|
||||
/* typedef statements */
|
||||
|
||||
typedef struct {
|
||||
XmFontList sysFont;
|
||||
XmFontList userFont;
|
||||
String sysStr;
|
||||
String userStr;
|
||||
XmString pointSize;
|
||||
} Fontset;
|
||||
|
||||
/* External Interface */
|
||||
|
||||
|
||||
extern void popup_fontBB( Widget shell) ;
|
||||
extern void restoreFonts( Widget shell, XrmDatabase db) ;
|
||||
extern void saveFonts( int fd) ;
|
||||
|
||||
|
||||
#endif /* _font_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
158
cde/programs/dtstyle/Help.c
Normal file
158
cde/programs/dtstyle/Help.c
Normal file
@@ -0,0 +1,158 @@
|
||||
/* $XConsortium: Help.c /main/4 1995/10/30 13:09:47 rswiston $ */
|
||||
/****************************************************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: HelpCB.h
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** Description: Routines that create/cache the dialogs for Help
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990, 1991, 1992. All rights are
|
||||
** reserved. Copying or other reproduction of this program
|
||||
** except for archival purposes is prohibited without prior
|
||||
** written consent of Hewlett-Packard Company.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <Xm/DialogS.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/MwmUtil.h>
|
||||
#include <Dt/DtP.h>
|
||||
|
||||
#include <Dt/Help.h>
|
||||
#include <Dt/HelpDialog.h>
|
||||
|
||||
#include "Main.h"
|
||||
#include "Help.h"
|
||||
|
||||
static Widget
|
||||
GetHelpDialog( )
|
||||
{
|
||||
static HelpStruct *pHelpCache;
|
||||
|
||||
HelpStruct *pHelp;
|
||||
Arg args[5];
|
||||
int n;
|
||||
|
||||
if(pHelpCache == (HelpStruct *)NULL)
|
||||
{
|
||||
pHelp = pHelpCache = (HelpStruct *)XtMalloc(sizeof(HelpStruct));
|
||||
pHelp->pNext = (HelpStruct *)NULL;
|
||||
pHelp->pPrev = (HelpStruct *)NULL;
|
||||
pHelp->inUse = True;
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNtitle,
|
||||
((char *)GETMESSAGE(2, 7, "Style Manager - Help"))); n++;
|
||||
pHelp->dialog = DtCreateHelpDialog(style.shell, "helpDlg",
|
||||
args, n);
|
||||
|
||||
DtWsmRemoveWorkspaceFunctions(style.display,
|
||||
XtWindow(XtParent(pHelp->dialog)));
|
||||
XtAddCallback(pHelp->dialog, DtNhyperLinkCallback,
|
||||
(XtCallbackProc)HelpHyperlinkCB, NULL);
|
||||
XtAddCallback(pHelp->dialog, DtNcloseCallback,
|
||||
(XtCallbackProc)HelpCloseCB, pHelpCache);
|
||||
return pHelp->dialog;
|
||||
}
|
||||
else
|
||||
{
|
||||
for(pHelp = pHelpCache;
|
||||
pHelp != (HelpStruct *)NULL;
|
||||
pHelp = pHelp->pNext)
|
||||
{
|
||||
if(pHelp->inUse == False)
|
||||
{
|
||||
pHelp->inUse = True;
|
||||
return pHelp->dialog;
|
||||
}
|
||||
}
|
||||
pHelp = (HelpStruct *) XtMalloc(sizeof(HelpStruct));
|
||||
pHelpCache->pPrev = pHelp;
|
||||
pHelp->pNext = pHelpCache;
|
||||
pHelpCache = pHelp;
|
||||
pHelp->pPrev = (HelpStruct *)NULL;
|
||||
pHelp->inUse = True;
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNtitle,
|
||||
((char *)GETMESSAGE(2, 7, "Style Manager - Help"))); n++;
|
||||
pHelp->dialog = DtCreateHelpDialog(style.shell, "helpDlg",
|
||||
args, n);
|
||||
DtWsmRemoveWorkspaceFunctions(style.display,
|
||||
XtWindow(XtParent(pHelp->dialog)));
|
||||
XtAddCallback(pHelp->dialog, DtNhyperLinkCallback,
|
||||
(XtCallbackProc)HelpHyperlinkCB, NULL);
|
||||
XtAddCallback(pHelp->dialog, DtNcloseCallback,
|
||||
(XtCallbackProc)HelpCloseCB, pHelpCache);
|
||||
return pHelp->dialog;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
DisplayHelp(
|
||||
char *helpVolume,
|
||||
char *locationId)
|
||||
{
|
||||
Widget helpDialog;
|
||||
Arg args[10];
|
||||
int n;
|
||||
|
||||
helpDialog = GetHelpDialog();
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], DtNhelpType, DtHELP_TYPE_TOPIC); n++;
|
||||
XtSetArg(args[n], DtNhelpVolume, helpVolume); n++;
|
||||
XtSetArg(args[n], DtNlocationId, locationId); n++;
|
||||
XtSetValues(helpDialog, args, n);
|
||||
|
||||
XtManageChild(helpDialog);
|
||||
XtMapWidget(XtParent(helpDialog));
|
||||
}
|
||||
|
||||
void
|
||||
Help(
|
||||
char *helpVolume,
|
||||
char *locationId)
|
||||
{
|
||||
static Widget helpDialog = NULL;
|
||||
Arg args[10];
|
||||
int n;
|
||||
|
||||
if(helpDialog == NULL)
|
||||
{
|
||||
n = 0;
|
||||
XtSetArg(args[n], DtNhelpType, DtHELP_TYPE_TOPIC); n++;
|
||||
XtSetArg(args[n], DtNhelpVolume, helpVolume); n++;
|
||||
XtSetArg(args[n], DtNlocationId, locationId); n++;
|
||||
XtSetArg (args[n], XmNtitle,
|
||||
((char *)GETMESSAGE(2, 7, "Style Manager - Help"))); n++;
|
||||
helpDialog = DtCreateHelpDialog(style.shell, "helpDlg", args, n);
|
||||
|
||||
DtWsmRemoveWorkspaceFunctions(style.display,
|
||||
XtWindow(XtParent(helpDialog)));
|
||||
XtAddCallback(helpDialog, DtNhyperLinkCallback,
|
||||
(XtCallbackProc)HelpHyperlinkCB, NULL);
|
||||
XtAddCallback(helpDialog, DtNcloseCallback,
|
||||
(XtCallbackProc)HelpCloseCB, NULL);
|
||||
|
||||
XtManageChild(helpDialog);
|
||||
}
|
||||
else
|
||||
{
|
||||
n = 0;
|
||||
XtSetArg(args[n], DtNhelpType, DtHELP_TYPE_TOPIC); n++;
|
||||
XtSetArg(args[n], DtNhelpVolume, helpVolume); n++;
|
||||
XtSetArg(args[n], DtNlocationId, locationId); n++;
|
||||
XtSetValues(helpDialog, args, n);
|
||||
}
|
||||
|
||||
XtMapWidget(XtParent(helpDialog));
|
||||
}
|
||||
|
||||
217
cde/programs/dtstyle/Help.h
Normal file
217
cde/programs/dtstyle/Help.h
Normal file
@@ -0,0 +1,217 @@
|
||||
/* $XConsortium: Help.h /main/5 1996/03/25 00:51:20 pascale $ */
|
||||
/*
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Help.h
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** Description: header file for the help portion of Dtstyle
|
||||
**
|
||||
**
|
||||
****************************************************************************/
|
||||
/*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1990, 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
|
||||
#ifndef _help_h
|
||||
#define _help_h
|
||||
|
||||
/*
|
||||
* defines for help on the main window
|
||||
*/
|
||||
#define HELP_MAIN_WINDOW 40
|
||||
#define HELP_MAIN_WINDOW_STR "mainWindow"
|
||||
|
||||
/*
|
||||
* defines for help on the menubar
|
||||
*/
|
||||
#define HELP_MENUBAR 1
|
||||
#define HELP_MENUBAR_STR "menubar"
|
||||
|
||||
/*
|
||||
* defines for help on the menubar buttons
|
||||
*/
|
||||
#define HELP_FILE_BUTTON 2
|
||||
#define HELP_HELP_BUTTON 3
|
||||
|
||||
#define HELP_FILE_BUTTON_STR "fileButton"
|
||||
#define HELP_HELP_BUTTON_STR "helpButton"
|
||||
|
||||
/*
|
||||
* defines for help on the menu panes
|
||||
*/
|
||||
#define HELP_FILE_MENU 4
|
||||
#define HELP_HELP_MENU 5
|
||||
|
||||
#define HELP_FILE_MENU_STR "fileMenu"
|
||||
#define HELP_HELP_MENU_STR "helpMenu"
|
||||
|
||||
/*
|
||||
* defines for help on the File menu items
|
||||
*/
|
||||
#define HELP_EXIT 6
|
||||
#define HELP_EXIT_STR "exitMenu"
|
||||
|
||||
/*
|
||||
* defines for help on the Help menu items
|
||||
*/
|
||||
#define HELP_INTRODUCTION 7
|
||||
#define HELP_TASKS 8 /* unused */
|
||||
#define HELP_REFERENCE 9
|
||||
#define HELP_ITEM 10
|
||||
#define HELP_USING 11 /* unused */
|
||||
#define HELP_VERSION 12
|
||||
|
||||
#define HELP_USING_HELP_VOLUME "Help4Help"
|
||||
#define HELP_VOLUME "Stylemgr"
|
||||
|
||||
#define HELP_INTRODUCTION_STR "_homeTopic"
|
||||
#define HELP_TASKS_STR "tasks"
|
||||
#define HELP_REFERENCE_STR "reference"
|
||||
#define HELP_ITEM_STR "onItem"
|
||||
#define HELP_USING_STR "_hometopic"
|
||||
#define HELP_VERSION_STR "_copyright"
|
||||
|
||||
/*
|
||||
* defines for the Dtstyle main window buttons
|
||||
*/
|
||||
#define HELP_COLOR_BUTTON 14
|
||||
#define HELP_FONT_BUTTON 15
|
||||
#define HELP_BACKDROP_BUTTON 16
|
||||
#define HELP_KEYBOARD_BUTTON 17
|
||||
#define HELP_MOUSE_BUTTON 18
|
||||
#define HELP_AUDIO_BUTTON 19
|
||||
#define HELP_SCREEN_BUTTON 20
|
||||
#define HELP_DTWM_BUTTON 21
|
||||
#define HELP_STARTUP_BUTTON 22
|
||||
#define HELP_I18N_BUTTON 23
|
||||
|
||||
#define HELP_COLOR_BUTTON_STR "colorButton"
|
||||
#define HELP_FONT_BUTTON_STR "fontButton"
|
||||
#define HELP_BACKDROP_BUTTON_STR "backdropButton"
|
||||
#define HELP_KEYBOARD_BUTTON_STR "keyboardButton"
|
||||
#define HELP_MOUSE_BUTTON_STR "mouseButton"
|
||||
#define HELP_AUDIO_BUTTON_STR "audioButton"
|
||||
#define HELP_SCREEN_BUTTON_STR "screenButton"
|
||||
#define HELP_DTWM_BUTTON_STR "dtwmButton"
|
||||
#define HELP_STARTUP_BUTTON_STR "startupButton"
|
||||
#define HELP_I18N_BUTTON_STR "i18nButton"
|
||||
|
||||
/*
|
||||
* defines for help on the Color dialogs
|
||||
*/
|
||||
#define HELP_COLOR_DIALOG 24
|
||||
#define HELP_ADD_PALETTE_DIALOG 25
|
||||
#define HELP_ADD_PALETTE_WARNING_DIALOG 26
|
||||
#define HELP_DELETE_PALETTE_DIALOG 27
|
||||
#define HELP_DELETE_PALETTE_WARNING_DIALOG 28
|
||||
#define HELP_MODIFY_PALETTE_DIALOG 29
|
||||
#define HELP_COLOR_USE_DIALOG 30
|
||||
|
||||
#define HELP_COLOR_DIALOG_STR "colorDialog"
|
||||
#define HELP_ADD_PALETTE_DIALOG_STR "addPaletteDialog"
|
||||
#define HELP_ADD_PALETTE_WARNING_DIALOG_STR "addPaletteWarningDialog"
|
||||
#define HELP_DELETE_PALETTE_DIALOG_STR "deletePaletteDialog"
|
||||
#define HELP_DELETE_PALETTE_WARNING_DIALOG_STR "deletePaletteWarningDialog"
|
||||
#define HELP_MODIFY_PALETTE_DIALOG_STR "modifyPaletteDialog"
|
||||
#define HELP_COLOR_USE_DIALOG_STR "colorUseDialog"
|
||||
|
||||
/*
|
||||
* defines for help on the Font dialog
|
||||
*/
|
||||
#define HELP_FONT_DIALOG 31
|
||||
#define HELP_FONT_DIALOG_STR "fontDialog"
|
||||
|
||||
/*
|
||||
* defines for help on the Backdrop dialog
|
||||
*/
|
||||
#define HELP_BACKDROP_DIALOG 32
|
||||
#define HELP_BACKDROP_DIALOG_STR "backdropDialog"
|
||||
|
||||
/*
|
||||
* defines for help on the Keyboard dialog
|
||||
*/
|
||||
#define HELP_KEYBOARD_DIALOG 33
|
||||
#define HELP_KEYBOARD_DIALOG_STR "keyboardDialog"
|
||||
|
||||
/*
|
||||
* defines for help on the Mouse dialog
|
||||
*/
|
||||
#define HELP_MOUSE_DIALOG 34
|
||||
#define HELP_MOUSE_DIALOG_STR "mouseDialog"
|
||||
|
||||
/*
|
||||
* defines for help on the Audio dialog
|
||||
*/
|
||||
#define HELP_AUDIO_DIALOG 35
|
||||
#define HELP_AUDIO_DIALOG_STR "audioDialog"
|
||||
|
||||
/*
|
||||
* defines for help on the Screen dialog
|
||||
*/
|
||||
#define HELP_SCREEN_DIALOG 36
|
||||
#define HELP_SCREEN_DIALOG_STR "screenDialog"
|
||||
|
||||
/*
|
||||
* defines for help on the Dtwm dialog
|
||||
*/
|
||||
#define HELP_DTWM_DIALOG 37
|
||||
#define HELP_DTWM_DIALOG_STR "dtwmDialog"
|
||||
|
||||
/*
|
||||
* defines for help on the Startup dialog
|
||||
*/
|
||||
#define HELP_STARTUP_DIALOG 38
|
||||
#define HELP_STARTUP_DIALOG_STR "startupDialog"
|
||||
|
||||
/*
|
||||
* defines for help on the I18n dialog
|
||||
*/
|
||||
#define HELP_I18N_DIALOG 39
|
||||
#define HELP_I18N_DIALOG_STR "i18nDialog"
|
||||
|
||||
/* typedef statements */
|
||||
|
||||
typedef struct _helpStruct {
|
||||
struct _helpStruct *pNext;
|
||||
struct _helpStruct *pPrev;
|
||||
Widget dialog;
|
||||
Boolean inUse;
|
||||
} HelpStruct;
|
||||
|
||||
|
||||
/* External Interface */
|
||||
|
||||
|
||||
extern void HelpRequestCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data ) ;
|
||||
extern void QuickHelpRequestCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data ) ;
|
||||
extern void HelpModeCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data ) ;
|
||||
extern void HelpHyperlinkCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data ) ;
|
||||
extern void HelpCloseCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data ) ;
|
||||
|
||||
|
||||
#endif /* _font_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
|
||||
254
cde/programs/dtstyle/HelpCB.c
Normal file
254
cde/programs/dtstyle/HelpCB.c
Normal file
@@ -0,0 +1,254 @@
|
||||
/* $XConsortium: HelpCB.c /main/5 1996/03/25 00:51:28 pascale $ */
|
||||
/*
|
||||
****************************************************************************
|
||||
**
|
||||
** File: HelpCB.c
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** Description: Contains the callbacks for Help
|
||||
**
|
||||
**
|
||||
****************************************************************************/
|
||||
/*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1990, 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
|
||||
#include <Dt/HelpDialog.h>
|
||||
|
||||
#include "Main.h"
|
||||
#include "Help.h"
|
||||
|
||||
void
|
||||
HelpRequestCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data )
|
||||
{
|
||||
char *helpVolume, *locationId;
|
||||
int topic;
|
||||
|
||||
topic = (int) client_data;
|
||||
helpVolume = HELP_VOLUME;
|
||||
|
||||
switch (topic)
|
||||
{
|
||||
case HELP_MAIN_WINDOW:
|
||||
locationId = HELP_MAIN_WINDOW_STR;
|
||||
break;
|
||||
case HELP_MENUBAR:
|
||||
locationId = HELP_MENUBAR_STR;
|
||||
break;
|
||||
case HELP_FILE_BUTTON:
|
||||
locationId = HELP_FILE_BUTTON_STR;
|
||||
break;
|
||||
case HELP_HELP_BUTTON:
|
||||
locationId = HELP_HELP_BUTTON_STR;
|
||||
break;
|
||||
case HELP_FILE_MENU:
|
||||
locationId = HELP_FILE_MENU_STR;
|
||||
break;
|
||||
case HELP_HELP_MENU:
|
||||
locationId = HELP_HELP_MENU_STR;
|
||||
break;
|
||||
case HELP_EXIT:
|
||||
locationId = HELP_EXIT_STR;
|
||||
break;
|
||||
case HELP_INTRODUCTION:
|
||||
locationId = HELP_INTRODUCTION_STR;
|
||||
break;
|
||||
case HELP_TASKS:
|
||||
locationId = HELP_TASKS_STR;
|
||||
break;
|
||||
case HELP_REFERENCE:
|
||||
locationId = HELP_REFERENCE_STR;
|
||||
break;
|
||||
case HELP_ITEM:
|
||||
locationId = HELP_ITEM_STR;
|
||||
break;
|
||||
case HELP_USING:
|
||||
locationId = HELP_USING_STR;
|
||||
helpVolume = HELP_USING_HELP_VOLUME;
|
||||
break;
|
||||
case HELP_VERSION:
|
||||
locationId = HELP_VERSION_STR;
|
||||
break;
|
||||
case HELP_COLOR_BUTTON:
|
||||
locationId = HELP_COLOR_BUTTON_STR;
|
||||
break;
|
||||
case HELP_FONT_BUTTON:
|
||||
locationId = HELP_FONT_BUTTON_STR;
|
||||
break;
|
||||
case HELP_BACKDROP_BUTTON:
|
||||
locationId = HELP_BACKDROP_BUTTON_STR;
|
||||
break;
|
||||
case HELP_KEYBOARD_BUTTON:
|
||||
locationId = HELP_KEYBOARD_BUTTON_STR;
|
||||
break;
|
||||
case HELP_MOUSE_BUTTON:
|
||||
locationId = HELP_MOUSE_BUTTON_STR;
|
||||
break;
|
||||
case HELP_AUDIO_BUTTON:
|
||||
locationId = HELP_AUDIO_BUTTON_STR;
|
||||
break;
|
||||
case HELP_SCREEN_BUTTON:
|
||||
locationId = HELP_SCREEN_BUTTON_STR;
|
||||
break;
|
||||
case HELP_DTWM_BUTTON:
|
||||
locationId = HELP_DTWM_BUTTON_STR;
|
||||
break;
|
||||
case HELP_STARTUP_BUTTON:
|
||||
locationId = HELP_STARTUP_BUTTON_STR;
|
||||
break;
|
||||
case HELP_I18N_BUTTON:
|
||||
locationId = HELP_I18N_BUTTON_STR;
|
||||
break;
|
||||
case HELP_COLOR_DIALOG:
|
||||
locationId = HELP_COLOR_DIALOG_STR;
|
||||
break;
|
||||
case HELP_ADD_PALETTE_DIALOG:
|
||||
locationId = HELP_ADD_PALETTE_DIALOG_STR;
|
||||
break;
|
||||
case HELP_ADD_PALETTE_WARNING_DIALOG:
|
||||
locationId = HELP_ADD_PALETTE_WARNING_DIALOG_STR;
|
||||
break;
|
||||
case HELP_DELETE_PALETTE_DIALOG:
|
||||
locationId = HELP_DELETE_PALETTE_DIALOG_STR;
|
||||
break;
|
||||
case HELP_DELETE_PALETTE_WARNING_DIALOG:
|
||||
locationId = HELP_DELETE_PALETTE_WARNING_DIALOG_STR;
|
||||
break;
|
||||
case HELP_MODIFY_PALETTE_DIALOG:
|
||||
locationId = HELP_MODIFY_PALETTE_DIALOG_STR;
|
||||
break;
|
||||
case HELP_COLOR_USE_DIALOG:
|
||||
locationId = HELP_COLOR_USE_DIALOG_STR;
|
||||
break;
|
||||
case HELP_FONT_DIALOG:
|
||||
locationId = HELP_FONT_DIALOG_STR;
|
||||
break;
|
||||
case HELP_BACKDROP_DIALOG:
|
||||
locationId = HELP_BACKDROP_DIALOG_STR;
|
||||
break;
|
||||
case HELP_KEYBOARD_DIALOG:
|
||||
locationId = HELP_KEYBOARD_DIALOG_STR;
|
||||
break;
|
||||
case HELP_MOUSE_DIALOG:
|
||||
locationId = HELP_MOUSE_DIALOG_STR;
|
||||
break;
|
||||
case HELP_AUDIO_DIALOG:
|
||||
locationId = HELP_AUDIO_DIALOG_STR;
|
||||
break;
|
||||
case HELP_SCREEN_DIALOG:
|
||||
locationId = HELP_SCREEN_DIALOG_STR;
|
||||
break;
|
||||
case HELP_DTWM_DIALOG:
|
||||
locationId = HELP_DTWM_DIALOG_STR;
|
||||
break;
|
||||
case HELP_STARTUP_DIALOG:
|
||||
locationId = HELP_STARTUP_DIALOG_STR;
|
||||
break;
|
||||
case HELP_I18N_DIALOG:
|
||||
locationId = HELP_I18N_DIALOG_STR;
|
||||
break;
|
||||
}
|
||||
|
||||
Help(helpVolume, locationId);
|
||||
}
|
||||
|
||||
void
|
||||
QuickHelpRequestCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
HelpModeCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data )
|
||||
{
|
||||
Widget widget;
|
||||
|
||||
switch(DtHelpReturnSelectedWidgetId(style.shell, (Cursor)NULL, &widget))
|
||||
{
|
||||
/*
|
||||
* There are additional cases (e.g. user aborts request) but I
|
||||
* don't feel they warrant an error dialog.
|
||||
*/
|
||||
case DtHELP_SELECT_VALID:
|
||||
|
||||
while (!XtIsShell(widget))
|
||||
{
|
||||
if (XtHasCallbacks(widget, XmNhelpCallback) == XtCallbackHasSome)
|
||||
{
|
||||
XtCallCallbacks(widget, XmNhelpCallback, (XtPointer)NULL);
|
||||
return;
|
||||
}
|
||||
widget = XtParent(widget);
|
||||
}
|
||||
break;
|
||||
|
||||
case DtHELP_SELECT_INVALID:
|
||||
|
||||
ErrDialog((char *)GETMESSAGE(2, 8, "You must select an item\nwithin the Style Manager."), style.shell);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
HelpHyperlinkCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data )
|
||||
{
|
||||
DtHelpDialogCallbackStruct *pHyper =
|
||||
(DtHelpDialogCallbackStruct *) call_data;
|
||||
|
||||
switch(pHyper->hyperType)
|
||||
{
|
||||
case DtHELP_LINK_JUMP_NEW:
|
||||
DisplayHelp(pHyper->helpVolume, pHyper->locationId);
|
||||
break;
|
||||
default:
|
||||
;
|
||||
/* application defined link code goes here */
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
HelpCloseCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data )
|
||||
{
|
||||
|
||||
HelpStruct *pHelpCache = (HelpStruct *)client_data;
|
||||
HelpStruct *pHelp;
|
||||
|
||||
/*
|
||||
* empty for loop just marches pHelp to the right place
|
||||
*/
|
||||
for(pHelp = pHelpCache;
|
||||
pHelp != (HelpStruct *)NULL && pHelp->dialog != w;
|
||||
pHelp = pHelp->pNext);
|
||||
|
||||
if(pHelp != (HelpStruct *)NULL)
|
||||
{
|
||||
/* this should always happen */
|
||||
pHelp->inUse = False;
|
||||
}
|
||||
|
||||
XtUnmapWidget(XtParent(w));
|
||||
|
||||
}
|
||||
659
cde/programs/dtstyle/I18nEnv.c
Normal file
659
cde/programs/dtstyle/I18nEnv.c
Normal file
@@ -0,0 +1,659 @@
|
||||
/* $TOG: I18nEnv.c /main/4 1997/08/11 12:31:10 samborn $ */
|
||||
/*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: I18nEnv.c
|
||||
**
|
||||
** Description: Controls the Dtstyle I18N component interaction with
|
||||
** the environment.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include files */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
#include <pwd.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
#include <DtHelp/LocaleXlate.h> /* for locale equivalence between platforms */
|
||||
|
||||
#include "Main.h"
|
||||
#include "I18nEnv.h"
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include extern functions */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Local #defines */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Internal Functions */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
static int GetUserEnv(I18nEnv *env);
|
||||
static int FindCDELocaleName(UserEnv *uenv);
|
||||
static int GetUserIMSelectionFile(I18nEnv *env);
|
||||
static int GetUserFileName(I18nEnv *env);
|
||||
static int ReadImSelectionFile(FileSel *fsel, FILE *fp);
|
||||
static int GetImsList(I18nEnv *env, char *hostname);
|
||||
static void TimeOutProc(XtPointer client_data, XtIntervalId* timer);
|
||||
static void ReadPipe(XtPointer client_data, int *fd, XtInputId *id);
|
||||
static int ProcessBuf(char *savebuf, I18nEnv *env);
|
||||
static int CheckHostname(I18nEnv *env, char *hostname);
|
||||
static void PutSelectMode(FILE *fp, int start_mode);
|
||||
static void PutImsName(FILE *fp, char *im_name);
|
||||
static void PutHostname(FILE *fp, char *hostname);
|
||||
static void PutSelectionEntry(FILE *fp, char *tag, char *value);
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Internal Variables */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Global Variables */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
I18nEnv i18n_env;
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* strcasecmp */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
#ifdef NEED_STRCASECMP
|
||||
/*
|
||||
* In case strcasecmp is not provided by the system here is one
|
||||
* which does the trick.
|
||||
*/
|
||||
static int
|
||||
strcasecmp(register const char *s1,
|
||||
register const char *s2)
|
||||
{
|
||||
register int c1, c2;
|
||||
|
||||
while (*s1 && *s2) {
|
||||
c1 = isupper(*s1) ? tolower(*s1) : *s1;
|
||||
c2 = isupper(*s2) ? tolower(*s2) : *s2;
|
||||
if (c1 != c2)
|
||||
return (c1 - c2);
|
||||
s1++;
|
||||
s2++;
|
||||
}
|
||||
return (int) (*s1 - *s2);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* _DtI18nGetEnvValues */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
int
|
||||
_DtI18nGetEnvValues(
|
||||
I18nEnv *env
|
||||
)
|
||||
{
|
||||
int ret = NoError;
|
||||
|
||||
/* Get the user environment */
|
||||
env->user_env = (UserEnv *) XtMalloc(sizeof(UserEnv));
|
||||
ret = GetUserEnv(env);
|
||||
|
||||
/* Get the user selection stored in the IM Selection File */
|
||||
if (ret == NoError) {
|
||||
env->file_sel = (FileSel *) XtMalloc(sizeof(FileSel));
|
||||
ret = GetUserIMSelectionFile(env);
|
||||
}
|
||||
|
||||
/* Alloc the user selection */
|
||||
env->ims_sel = (ImsSel *) XtMalloc(sizeof(ImsSel));
|
||||
env->ims_sel->ims_list = NULL;
|
||||
env->ims_sel->ims_list_size = 0 ;
|
||||
env->ims_sel->host_name = NULL ;
|
||||
|
||||
/* Get the Input Method available on the selected host.
|
||||
* The selected host is the one stored in the IMS Selection File.
|
||||
*/
|
||||
if (ret == NoError)
|
||||
ret = _DtI18nGetImList(env, env->file_sel->hostname);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* GetUserEnv */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static int
|
||||
GetUserEnv(
|
||||
I18nEnv *env
|
||||
)
|
||||
{
|
||||
UserEnv *uenv = env->user_env ;
|
||||
int ret = NoError;
|
||||
char buf[BUFSIZ], *p;
|
||||
|
||||
/* get the host name */
|
||||
gethostname(buf, BUFSIZ);
|
||||
uenv->localhostname = XtNewString(buf);
|
||||
|
||||
/* get the user name */
|
||||
if ((p = getlogin()) == NULL) {
|
||||
struct passwd *pw;
|
||||
|
||||
pw = getpwuid(getuid());
|
||||
p = pw->pw_name;
|
||||
}
|
||||
|
||||
uenv->username = XtNewString(p);
|
||||
|
||||
/* get the display name */
|
||||
uenv->displayname = XtNewString(XDisplayString(XtDisplay(env->shell)));
|
||||
|
||||
/* get the locale */
|
||||
if ((p = getenv("LANG")) && *p)
|
||||
uenv->locale = XtNewString(p);
|
||||
else
|
||||
return ErrNoLocale;
|
||||
|
||||
/* find the CDE generic locale name */
|
||||
if (FindCDELocaleName(uenv) != NoError)
|
||||
return ErrNoCDELocale;
|
||||
|
||||
/* get the home directory */
|
||||
if ((p = getenv("HOME")) && *p)
|
||||
uenv->homedir = XtNewString(p);
|
||||
else
|
||||
ret = ErrNoHome;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
FindCDELocaleName(
|
||||
UserEnv *uenv
|
||||
)
|
||||
{
|
||||
_DtXlateDb db = NULL;
|
||||
int ret = NoError;
|
||||
char plat[_DtPLATFORM_MAX_LEN];
|
||||
int execver;
|
||||
int compver;
|
||||
|
||||
ret = _DtLcxOpenAllDbs(&db);
|
||||
|
||||
if (ret == NoError)
|
||||
ret = _DtXlateGetXlateEnv(db, plat, &execver, &compver);
|
||||
|
||||
if (ret == NoError)
|
||||
ret = _DtLcxXlateOpToStd(db, plat, compver, DtLCX_OPER_SETLOCALE,
|
||||
uenv->locale, &uenv->CDE_locale,
|
||||
NULL, NULL, NULL);
|
||||
if (ret == NoError)
|
||||
ret = _DtLcxCloseDb(&db);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
GetUserIMSelectionFile(
|
||||
I18nEnv *env
|
||||
)
|
||||
{
|
||||
int ret = NoError;
|
||||
FILE *fp;
|
||||
|
||||
ret = GetUserFileName(env);
|
||||
|
||||
if (ret == NoError) {
|
||||
/* Look if this file is readable */
|
||||
if ((fp = fopen(env->file_sel->fname, "r")) == NULL)
|
||||
env->file_sel->start_mode = -1;
|
||||
return ErrNoSelectionFile;
|
||||
}
|
||||
|
||||
start_tag_line(env->file_sel->fname);
|
||||
ret = ReadImSelectionFile(env->file_sel, fp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
GetUserFileName(
|
||||
I18nEnv *env
|
||||
)
|
||||
{
|
||||
int status, ret = NoError;
|
||||
char *path, *tmp_path;
|
||||
int len = 0;
|
||||
struct stat buf;
|
||||
|
||||
/* The user IMS Selection File should be of the following form:
|
||||
* $HOME/.dt/ims/[display-name]/CDE-locale
|
||||
*/
|
||||
|
||||
path = (char *) XtMalloc((MAXPATHLEN + 1) * sizeof(char));
|
||||
|
||||
strcpy(path, env->user_env->homedir);
|
||||
strcat(path, DtUSER_IMSFS_DIR);
|
||||
|
||||
/* Look if there is a display specific directory */
|
||||
|
||||
tmp_path = (char *) XtMalloc((MAXPATHLEN + 1) * sizeof(char));
|
||||
|
||||
strcpy(tmp_path, path);
|
||||
strcat(tmp_path, "/");
|
||||
strcat(tmp_path, env->user_env->displayname);
|
||||
|
||||
if ((status = stat (tmp_path, &buf)) == 0) {
|
||||
strcat(path, "/");
|
||||
strcat(path, env->user_env->displayname);
|
||||
}
|
||||
|
||||
XtFree(tmp_path);
|
||||
|
||||
/* Now add the CDE-specific locale name */
|
||||
|
||||
strcat(path, "/");
|
||||
strcat(path, env->user_env->CDE_locale);
|
||||
|
||||
env->file_sel->fname = path;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
ReadImSelectionFile(
|
||||
FileSel *fsel,
|
||||
FILE *fp
|
||||
)
|
||||
{
|
||||
int ret = NoError;
|
||||
char *lp, *valp, *vp, *p;
|
||||
int select_mode = 0;
|
||||
char *imsname, *hostname;
|
||||
int line_num, i;
|
||||
|
||||
imsname = hostname = NULL;
|
||||
|
||||
while ((line_num = read_tag_line(fp, &lp, &valp)) > 0) {
|
||||
if (!valp) {
|
||||
continue;
|
||||
}
|
||||
if (lp[0] != STR_PREFIX_CHAR) {
|
||||
continue;
|
||||
}
|
||||
if (strncmp(lp + 1, STR_SELECTMODE, 3) == 0) {
|
||||
if (str_to_int(valp, &i) && i >= 0)
|
||||
select_mode = i;
|
||||
} else if (strncmp(lp + 1, STR_IMSNAME, 4) == 0) {
|
||||
vp = valp; cut_field(valp);
|
||||
if (*vp) {
|
||||
XtFree(imsname);
|
||||
imsname = XtNewString(vp);
|
||||
}
|
||||
} else if (strncmp(lp + 1, STR_HOSTNAME, 4) == 0) {
|
||||
vp = valp; cut_field(valp);
|
||||
if (*vp) {
|
||||
XtFree(hostname);
|
||||
if (strcmp(vp, NAME_LOCAL))
|
||||
hostname = XtNewString(vp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fsel->im_name = imsname;
|
||||
fsel->hostname = hostname;
|
||||
fsel->start_mode = select_mode;
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
_DtI18nGetImList(
|
||||
I18nEnv *env,
|
||||
char *hostname )
|
||||
{
|
||||
int ret = NoError;
|
||||
int host_type = HOST_LOCAL;
|
||||
|
||||
if (hostname)
|
||||
host_type = CheckHostname(env, hostname);
|
||||
|
||||
switch (host_type) {
|
||||
case HOST_UNKNOWN:
|
||||
ret = ErrUnknownHost;
|
||||
break;
|
||||
|
||||
case HOST_REMOTE:
|
||||
/* Put the host name in the ImsSel structure */
|
||||
env->ims_sel->host_name = hostname;
|
||||
ret = GetImsList(env, hostname);
|
||||
break;
|
||||
|
||||
case HOST_LOCAL:
|
||||
if (hostname && strcasecmp(hostname, "local") != 0)
|
||||
env->ims_sel->host_name = hostname;
|
||||
ret = GetImsList(env, env->user_env->localhostname);
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
GetImsList(
|
||||
I18nEnv *env,
|
||||
char *hostname )
|
||||
{
|
||||
int ret = NoError;
|
||||
char pipe_command[255];
|
||||
FILE *fp;
|
||||
struct stat buf;
|
||||
unsigned long timeout;
|
||||
|
||||
/* First check if dtimsstart is installed correctly */
|
||||
|
||||
if ((ret = stat ("/usr/dt/bin/dtimsstart", &buf)) != NoError) {
|
||||
return ErrNoDtimsstart;
|
||||
}
|
||||
|
||||
sprintf(pipe_command, "/usr/dt/bin/dtimsstart -listname -hostname %s",
|
||||
hostname);
|
||||
|
||||
if (fp = popen(pipe_command, "r")) {
|
||||
|
||||
/* Set the sensitivity of the InputMethod Title Box to False until we
|
||||
* are done reading the new information. */
|
||||
_DtI18nSetSensitiveImTB(env, False);
|
||||
|
||||
/* Initialize the pipe record. */
|
||||
if (!(env->pipe_info))
|
||||
env->pipe_info = (PipeRec *) XtMalloc(sizeof(PipeRec));
|
||||
|
||||
env->pipe_info->pipe = fp; /* to close it */
|
||||
env->pipe_info->input_id = /* to remove it */
|
||||
XtAppAddInput (XtWidgetToApplicationContext(env->shell),
|
||||
fileno(fp), (XtPointer) XtInputReadMask,
|
||||
ReadPipe, (XtPointer) env);
|
||||
|
||||
/* Also add a timeout in case the pipe ain't talk */
|
||||
timeout = (unsigned long) (style.xrdb.pipeTimeOut) * 1000;
|
||||
env->pipe_info->timer_id =
|
||||
XtAppAddTimeOut(XtWidgetToApplicationContext(env->shell),
|
||||
timeout, TimeOutProc, (XtPointer)env);
|
||||
} else {
|
||||
ret = ErrNoPopen;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void TimeOutProc (XtPointer client_data,
|
||||
XtIntervalId* timer)
|
||||
{
|
||||
I18nEnv *env = (I18nEnv *) client_data;
|
||||
|
||||
/* the command is not fast enough, but calling pclose blocks
|
||||
and then print "Broken Pipe". I need to kill the child somehow
|
||||
pclose(env->pipe_info->pipe);*/
|
||||
|
||||
XtRemoveInput(env->pipe_info->input_id);
|
||||
|
||||
/* Set the sensitivity of the InputMethod Title Box back to True. */
|
||||
_DtI18nSetSensitiveImTB(env, True);
|
||||
|
||||
_DtI18nErrorDialog(ErrTimeOut) ;
|
||||
}
|
||||
|
||||
static void
|
||||
ReadPipe (
|
||||
XtPointer client_data,
|
||||
int *fd,
|
||||
XtInputId *id )
|
||||
|
||||
{
|
||||
char buf[512];
|
||||
int i, nbytes;
|
||||
int status = NoError;
|
||||
static char * savebuf = NULL;
|
||||
static int savebuf_bytes = 0 ;
|
||||
I18nEnv *env = (I18nEnv *) client_data;
|
||||
|
||||
nbytes = read (*fd, buf, 512);
|
||||
|
||||
if (nbytes) {
|
||||
savebuf = XtRealloc(savebuf, savebuf_bytes + nbytes);
|
||||
memcpy(savebuf+savebuf_bytes, buf, nbytes);
|
||||
savebuf_bytes += nbytes ;
|
||||
} else {
|
||||
if (savebuf)
|
||||
*(savebuf + savebuf_bytes) = '\0';
|
||||
status = ProcessBuf(savebuf, client_data);
|
||||
savebuf_bytes = 0;
|
||||
if (savebuf) {
|
||||
XtFree(savebuf);
|
||||
savebuf = NULL;
|
||||
}
|
||||
|
||||
pclose(env->pipe_info->pipe);
|
||||
XtRemoveInput(*id);
|
||||
|
||||
/* Set the sensitivity of the InputMethod Title Box back to True. */
|
||||
_DtI18nSetSensitiveImTB(env, True);
|
||||
|
||||
/* Remove timer too */
|
||||
XtRemoveTimeOut(env->pipe_info->timer_id);
|
||||
|
||||
if (status != NoError)
|
||||
_DtI18nErrorDialog(status) ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static int
|
||||
ProcessBuf(
|
||||
char *savebuf,
|
||||
I18nEnv *env )
|
||||
{
|
||||
int i, n = 0;
|
||||
int ret = NoError;
|
||||
ImsEnt *ims_ent;
|
||||
char * filename, * label ;
|
||||
|
||||
/* The dtimsstart execution gave back an empty buffer */
|
||||
if (!savebuf)
|
||||
return(ErrRemoteFailed);
|
||||
|
||||
/* parse savebuf: The lines have the following syntax:
|
||||
* [#](im_filename) im_label or
|
||||
* [#]im_filename im_label
|
||||
* where "#" if present means the default IM,
|
||||
* im_filename is the file name where all the IM info is stored,
|
||||
* im_label is the label to present to the user.
|
||||
*/
|
||||
while (*savebuf) {
|
||||
/* We're at the beginning of a new line */
|
||||
|
||||
/* grow the array */
|
||||
env->ims_sel->ims_list =
|
||||
(ImsEnt *) XtRealloc((char *) env->ims_sel->ims_list,
|
||||
sizeof(ImsEnt)*(n+1));
|
||||
|
||||
ims_ent = &(env->ims_sel->ims_list[n]);
|
||||
|
||||
/* Look to see if this is the default one. */
|
||||
if (*savebuf == '#') {
|
||||
ims_ent->im_default = 1;
|
||||
savebuf++;
|
||||
} else
|
||||
ims_ent->im_default = 0;
|
||||
|
||||
/* Look to see if it is not reachable. */
|
||||
if (*savebuf == '(') {
|
||||
ims_ent->inactive = 1;
|
||||
savebuf++ ;
|
||||
} else
|
||||
ims_ent->inactive = 0 ;
|
||||
|
||||
/* Mark begin of im filename */
|
||||
filename = savebuf ;
|
||||
/* Go to the end of it */
|
||||
while (!isspace(*savebuf++)) ;
|
||||
/* We're on the first space, mark the end of the im filename,
|
||||
* don't forget to count the ')' if inactive. */
|
||||
*(savebuf - ims_ent->inactive - 1) = '\0';
|
||||
|
||||
/* Mark the beginning of the im name */
|
||||
label = savebuf ;
|
||||
while (*savebuf != '\n') savebuf++ ;
|
||||
/* mark the end */
|
||||
*savebuf = '\0';
|
||||
savebuf++;
|
||||
|
||||
/* copy the string data here. it's gonna be freed after that */
|
||||
ims_ent->im_name = XtNewString(filename) ;
|
||||
ims_ent->im_label = XtNewString(label) ;
|
||||
n++;
|
||||
}
|
||||
|
||||
env->ims_sel->ims_list_size = n;
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
CheckHostname(
|
||||
I18nEnv *env,
|
||||
char *hostname
|
||||
)
|
||||
{
|
||||
int host_type = HOST_UNKNOWN;
|
||||
char *local = env->user_env->localhostname;
|
||||
struct hostent *hp;
|
||||
unsigned long addr = 0L;
|
||||
static unsigned long local_addr = 0L;
|
||||
|
||||
if (!hostname || !*hostname || strcasecmp(hostname, "local") == 0
|
||||
|| strcasecmp(hostname, local) == 0) {
|
||||
host_type = HOST_LOCAL;
|
||||
} else { /* compare inet address */
|
||||
if (!local_addr) {
|
||||
if ((hp = gethostbyname(local)) && hp->h_addrtype == AF_INET) {
|
||||
local_addr = *((unsigned long *) hp->h_addr_list[0]);
|
||||
} else {
|
||||
host_type = HOST_REMOTE;
|
||||
}
|
||||
}
|
||||
if (host_type == HOST_UNKNOWN) {
|
||||
if ((hp = gethostbyname(hostname)) && hp->h_addrtype == AF_INET) {
|
||||
addr = *((unsigned long *) hp->h_addr_list[0]);
|
||||
if (addr == local_addr)
|
||||
host_type = HOST_LOCAL;
|
||||
else
|
||||
host_type = HOST_REMOTE;
|
||||
} else {
|
||||
host_type = HOST_UNKNOWN;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return host_type;
|
||||
}
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* _DtI18nWriteImSelectionFile - writes */
|
||||
/* the values saved in the FileSel */
|
||||
/* structure to the IMS Selection File. */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
int
|
||||
_DtI18nWriteImSelectionFile(
|
||||
I18nEnv *env
|
||||
)
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
|
||||
/* Look if this file is writable */
|
||||
if ((fp = fopen(env->file_sel->fname, "w")) == NULL)
|
||||
return ErrFileCreate;
|
||||
|
||||
/* Write the select mode */
|
||||
PutSelectMode(fp, env->file_sel->start_mode);
|
||||
|
||||
/* Write the IM selected if not null */
|
||||
PutImsName(fp, env->file_sel->im_name);
|
||||
|
||||
/* Write the hostname if not null */
|
||||
PutHostname(fp, env->file_sel->hostname);
|
||||
|
||||
/* Close the file */
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
static void
|
||||
PutSelectMode(
|
||||
FILE *fp,
|
||||
int start_mode
|
||||
)
|
||||
{
|
||||
char val[20];
|
||||
|
||||
sprintf(val, "%ld", (long)start_mode);
|
||||
PutSelectionEntry(fp, STR_SELECTMODE, val);
|
||||
}
|
||||
|
||||
static void
|
||||
PutImsName(
|
||||
FILE *fp,
|
||||
char *im_name
|
||||
)
|
||||
{
|
||||
char *valp;
|
||||
|
||||
if ((valp = im_name) && *valp)
|
||||
PutSelectionEntry(fp, STR_IMSNAME, valp);
|
||||
}
|
||||
|
||||
static void
|
||||
PutHostname(
|
||||
FILE *fp,
|
||||
char *hostname
|
||||
)
|
||||
{
|
||||
char *valp;
|
||||
|
||||
if ((valp = hostname) && *valp)
|
||||
PutSelectionEntry(fp, STR_HOSTNAME, valp);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
PutSelectionEntry(
|
||||
FILE *fp,
|
||||
char *tag,
|
||||
char *value
|
||||
)
|
||||
{
|
||||
fprintf(fp, "%c%s%c\t%s\n", STR_PREFIX_CHAR, tag, TAG_END_CHAR, value);
|
||||
}
|
||||
147
cde/programs/dtstyle/I18nEnv.h
Normal file
147
cde/programs/dtstyle/I18nEnv.h
Normal file
@@ -0,0 +1,147 @@
|
||||
/* $XConsortium: I18nEnv.h /main/1 1996/03/25 00:51:43 pascale $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: I18nEnv.h
|
||||
**
|
||||
**
|
||||
** This file contains function definitions for the corresponding .c
|
||||
** file
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
/*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
|
||||
#ifndef _i18nEnv_h
|
||||
#define _i18nEnv_h
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
#define MAXPATHLEN 1024
|
||||
#endif
|
||||
|
||||
#define DtUSER_TMP_DIR "./dt/tmp"
|
||||
#define DtUSER_IMSFS_DIR "/.dt/ims"
|
||||
|
||||
#define NAME_NONE "none"
|
||||
#define NAME_LOCAL "local"
|
||||
#define NAME_BUILTIN "builtin"
|
||||
|
||||
#define STR_PREFIX_CHAR '@'
|
||||
#define STR_DEFAULTIMS "DefaultIms"
|
||||
#define STR_SELECTMODE "SelectMode"
|
||||
#define STR_IMSNAME "ImsName"
|
||||
#define STR_HOSTNAME "HostName"
|
||||
#define TAG_END_CHAR ':'
|
||||
|
||||
/* host type */
|
||||
#define HOST_LOCAL 0
|
||||
#define HOST_REMOTE 1
|
||||
#define HOST_UNKNOWN 2
|
||||
|
||||
typedef struct _FileSel {
|
||||
char *fname; /* IM selection file full path name */
|
||||
char *hostname; /* User selected hostname */
|
||||
char *im_name; /* User selected Input Method */
|
||||
int start_mode; /* User selected start mode */
|
||||
} FileSel;
|
||||
|
||||
typedef struct {
|
||||
int inactive; /* Status of the IM */
|
||||
char *im_name; /* File name of the IM as found in the locale
|
||||
entry file */
|
||||
char *im_label; /* Label to present to the user */
|
||||
Boolean im_default; /* Is this the default one? */
|
||||
} ImsEnt;
|
||||
|
||||
|
||||
typedef struct {
|
||||
char *host_name; /* hostname selected in the ComboBox */
|
||||
ImsEnt *ims_list ; /* list of IMS entities on this host */
|
||||
int ims_list_size ; /* number of IMS entities */
|
||||
} ImsSel;
|
||||
|
||||
typedef struct _UserEnv {
|
||||
char *localhostname; /* hostname the user has started dtstyle */
|
||||
char *username; /* user name */
|
||||
char *displayname; /* display dtstyle is running on */
|
||||
char *locale; /* system-specific locale from $LANG */
|
||||
char *CDE_locale; /* CDE generic locale name */
|
||||
char *homedir;
|
||||
} UserEnv;
|
||||
|
||||
typedef struct _PipeRec {
|
||||
FILE *pipe ;
|
||||
XtInputId input_id ;
|
||||
XtIntervalId timer_id ;
|
||||
} PipeRec;
|
||||
|
||||
typedef struct _I18nEnv {
|
||||
UserEnv *user_env; /* User environmnet */
|
||||
ImsSel *ims_sel; /* Available IMS */
|
||||
FileSel *file_sel; /* User IMS Selection File values */
|
||||
PipeRec *pipe_info; /* Info needed for the pipe execution */
|
||||
Widget shell;
|
||||
} I18nEnv;
|
||||
|
||||
|
||||
/* Error Codes */
|
||||
#define NO_ERROR 0
|
||||
|
||||
typedef enum {
|
||||
NoError = 0,
|
||||
ErrNoHome,
|
||||
ErrNoLocale,
|
||||
ErrNoCDELocale,
|
||||
|
||||
/* File I/O */
|
||||
ErrFileCreate,
|
||||
|
||||
/* Selection */
|
||||
ErrNoSelectionFile,
|
||||
ErrSaveSelection,
|
||||
|
||||
/* Remote */
|
||||
ErrUnknownHost,
|
||||
ErrNoDtimsstart,
|
||||
ErrRemoteFailed,
|
||||
|
||||
/* Pipe */
|
||||
ErrNoPopen,
|
||||
ErrTimeOut,
|
||||
ErrUnknown,
|
||||
|
||||
LastErrorCode
|
||||
} ximsError;
|
||||
|
||||
|
||||
/* External declarations */
|
||||
extern I18nEnv i18n_env;
|
||||
|
||||
extern int _DtI18nGetEnvValues(I18nEnv *env);
|
||||
extern int _DtI18nGetImList(I18nEnv *env, char *hostname);
|
||||
extern void _DtI18nSetSensitiveImTB(I18nEnv *env, Boolean sensitivity);
|
||||
extern int _DtI18nWriteImSelectionFile(I18nEnv *env);
|
||||
extern void _DtI18nErrorDialog(int err) ;
|
||||
|
||||
#include "I18nUtil.h"
|
||||
|
||||
#endif /* _i18nEnv_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
1492
cde/programs/dtstyle/I18nMain.c
Normal file
1492
cde/programs/dtstyle/I18nMain.c
Normal file
File diff suppressed because it is too large
Load Diff
36
cde/programs/dtstyle/I18nMain.h
Normal file
36
cde/programs/dtstyle/I18nMain.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/* $XConsortium: I18nMain.h /main/1 1996/03/25 00:51:57 pascale $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: I18nMain.h
|
||||
**
|
||||
**
|
||||
** This file contains function definitions for the corresponding .c
|
||||
** file
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
/*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
|
||||
#ifndef _i18nMain_h
|
||||
#define _i18nMain_h
|
||||
|
||||
|
||||
/* External Interface */
|
||||
|
||||
extern void popup_i18nBB( Widget shell) ;
|
||||
extern void restoreI18n( Widget shell, XrmDatabase db) ;
|
||||
extern void saveI18n( int fd) ;
|
||||
|
||||
|
||||
#endif /* _i18nMain_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
165
cde/programs/dtstyle/I18nUtil.c
Normal file
165
cde/programs/dtstyle/I18nUtil.c
Normal file
@@ -0,0 +1,165 @@
|
||||
/* $XConsortium: I18nUtil.c /main/1 1996/03/25 00:52:03 pascale $ */
|
||||
/*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: I18nEnv.c
|
||||
**
|
||||
** Description: Contains utility functions for the Dtstyle I18N component.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include files */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
#include "I18nUtil.h"
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include extern functions */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Local #defines */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
#define TAG_END_CHAR ':'
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Internal Functions */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
static char *trim_line (char * );
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Internal Variables */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
/* ******** file reading ******** */
|
||||
|
||||
static int tag_line_num = 0;
|
||||
static char *tag_linebuf = NULL;
|
||||
static char *tag_file = NULL;
|
||||
|
||||
|
||||
void start_tag_line(
|
||||
char *fname
|
||||
)
|
||||
{
|
||||
if (fname) {
|
||||
if (!tag_linebuf)
|
||||
tag_linebuf = (char *) XtCalloc(BUFSIZ, sizeof(char));
|
||||
tag_linebuf[0] = 0;
|
||||
tag_file = fname;
|
||||
} else {
|
||||
if (tag_linebuf)
|
||||
XtFree(tag_linebuf);
|
||||
tag_linebuf = tag_file = 0;
|
||||
}
|
||||
tag_line_num = 0;
|
||||
}
|
||||
|
||||
int read_tag_line(
|
||||
FILE *fp,
|
||||
char **tagp,
|
||||
char **valp
|
||||
)
|
||||
{
|
||||
char *lp, *lp2;
|
||||
|
||||
while (fgets(lp = tag_linebuf, BUFSIZ, fp)) {
|
||||
tag_line_num++;
|
||||
skip_white(lp); /* lp = trim_line(lp); */
|
||||
if (!*lp || *lp == '\n' || is_comment_char(*lp))
|
||||
continue;
|
||||
if (!(lp2 = strchr(lp, TAG_END_CHAR))) {
|
||||
continue;
|
||||
}
|
||||
*lp2++ = 0;
|
||||
lp2 = trim_line(lp2);
|
||||
|
||||
*tagp = lp;
|
||||
*valp = *lp2 ? lp2 : 0;
|
||||
return tag_line_num;
|
||||
}
|
||||
*tagp = *valp = 0;
|
||||
|
||||
return (ferror(fp)) ? -1 : 0;
|
||||
}
|
||||
|
||||
/* ******** string manupilation ******** */
|
||||
|
||||
static char *
|
||||
trim_line(
|
||||
char *ptr
|
||||
)
|
||||
{
|
||||
register char *lastp;
|
||||
|
||||
skip_white(ptr);
|
||||
for (lastp = ptr + strlen(ptr) - 1;
|
||||
lastp >= ptr && (is_white(*lastp) || *lastp == '\n'); lastp--) ;
|
||||
*(lastp + 1) = 0;
|
||||
return ptr; /* return lastp > ptr ? ptr : NULL; */
|
||||
}
|
||||
|
||||
int
|
||||
str_to_int(
|
||||
char *ptr,
|
||||
int *val
|
||||
)
|
||||
{
|
||||
int base;
|
||||
char *pp;
|
||||
|
||||
/* if (!ptr || !*ptr || !val) return(False); */
|
||||
*val = 0;
|
||||
base = ptr[0] == '0' ? (((ptr[1] & 0xdf) == 'X') ? 16 : 8) : 10;
|
||||
*val = strtol(ptr, &pp, base);
|
||||
if (!pp || *pp) return(False);
|
||||
return(True);
|
||||
}
|
||||
|
||||
|
||||
Bool
|
||||
str_to_bool(
|
||||
char *ptr,
|
||||
Bool def_val
|
||||
)
|
||||
{
|
||||
if (!ptr || !*ptr) return def_val;
|
||||
skip_white(ptr);
|
||||
|
||||
switch (*ptr) { /* true/false , 1/0 , yes/no , on/off */
|
||||
case '1':
|
||||
case 'T': case 't':
|
||||
case 'Y': case 'y':
|
||||
def_val = True; break;
|
||||
|
||||
case '0':
|
||||
case 'F': case 'f':
|
||||
case 'N': case 'n':
|
||||
def_val = False; break;
|
||||
|
||||
case 'O': case 'o':
|
||||
if (ptr[1] == 'N' || ptr[1] == 'n')
|
||||
def_val = True;
|
||||
else if (ptr[1] == 'F' || ptr[1] == 'f')
|
||||
def_val = False;
|
||||
break;
|
||||
}
|
||||
return def_val;
|
||||
}
|
||||
|
||||
50
cde/programs/dtstyle/I18nUtil.h
Normal file
50
cde/programs/dtstyle/I18nUtil.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/* $XConsortium: I18nUtil.h /main/1 1996/03/25 00:52:10 pascale $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: I18nUtil.h
|
||||
**
|
||||
**
|
||||
** This file contains function definitions for the corresponding .c
|
||||
** file
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
/*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
|
||||
#ifndef _i18nUtil_h
|
||||
#define _i18nUtil_h
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
|
||||
/* string */
|
||||
|
||||
#define COMMENT_CHAR '!'
|
||||
#define COMMENT_CHAR2 '#'
|
||||
|
||||
#define is_comment_char(c) ((c) == COMMENT_CHAR || (c) == COMMENT_CHAR2)
|
||||
#define is_white(c) ((c) == ' ' || (c) == '\t' || (c) == '\n')
|
||||
#define skip_white(p) while (is_white(*(p))) (p)++
|
||||
#define cut_field(p) \
|
||||
for ((p)++; *(p) && !is_white(*(p)); (p)++) ; *(p)++ = 0; skip_white(p)
|
||||
|
||||
|
||||
#endif /* _i18nUtil_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
46
cde/programs/dtstyle/Imakefile
Normal file
46
cde/programs/dtstyle/Imakefile
Normal file
@@ -0,0 +1,46 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/09/14 15:25:06 drk $
|
||||
|
||||
DEFINES = -DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\" \
|
||||
-DCDE_CONFIGURATION_TOP=\"$(CDE_CONFIGURATION_TOP)\"
|
||||
|
||||
INCLUDES = -I. -I$(DTHELPSRC)/..
|
||||
|
||||
DEPLIBS = DepDtClientLibs
|
||||
LOCAL_LIBRARIES = DtClientLibs
|
||||
SYS_LIBRARIES = DtClientSysLibs
|
||||
|
||||
#if defined(RsArchitecture)
|
||||
EXTRA_DEFINES = -DANSICPP -Aa -D_POSIX_SOURCE
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
EXTRA_SRC = OWsync.c
|
||||
EXTRA_OBJS = OWsync.o
|
||||
EXTRA_DEFINES = -D$(PROGRAMS)
|
||||
#endif
|
||||
|
||||
PROGRAMS = dtstyle
|
||||
|
||||
OBJS = Main.o version.o MainWin.o Font.o Audio.o \
|
||||
Startup.o Mouse.o SaveRestore.o Backdrop.o Screen.o \
|
||||
Keyboard.o ColorMain.o ColorPalette.o ColorFile.o ColorEdit.o \
|
||||
Resource.o Protocol.o Dtwm.o Help.o HelpCB.o I18nMain.o \
|
||||
I18nEnv.o I18nUtil.o $(EXTRA_OBJS)
|
||||
|
||||
SRCS = Main.c version.c MainWin.c Font.c Audio.c \
|
||||
Startup.c Mouse.c SaveRestore.c Backdrop.c Screen.c \
|
||||
Keyboard.c ColorMain.c ColorPalette.c ColorFile.c ColorEdit.c \
|
||||
Resource.c Protocol.c Dtwm.c Help.c HelpCB.c I18nMain.c \
|
||||
I18nEnv.c I18nUtil.c $(EXTRA_SRC)
|
||||
|
||||
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
LOCAL_CPP_DEFINES = -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP)
|
||||
|
||||
CppSourceFile(Dtstyle,Dtstyle.src,-Dhp_roman8 $(LOCAL_CPP_DEFINES),)
|
||||
CppSourceFile(Dtstyle.iso,Dtstyle.src,-Diso8859_1,)
|
||||
CppSourceFile(Backdrops,Backdrops.src,-Dhp_roman8 $(LOCAL_CPP_DEFINES),)
|
||||
CppSourceFile(Backdrops.iso,Backdrops.src,-Diso8859_1,)
|
||||
CppSourceFile(Palettes,Palettes.src,-Dhp_roman8 $(LOCAL_CPP_DEFINES),)
|
||||
CppSourceFile(Palettes.iso,Palettes.src,-Diso8859_1,)
|
||||
618
cde/programs/dtstyle/Keyboard.c
Normal file
618
cde/programs/dtstyle/Keyboard.c
Normal file
@@ -0,0 +1,618 @@
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Keyboard.c
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** Description: Controls the DtStyle keyboard dialog
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
/* $XConsortium: Keyboard.c /main/4 1995/10/30 13:10:18 rswiston $ */
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include files */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <Xm/MwmUtil.h>
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/XmP.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/PushBG.h>
|
||||
#include <Xm/Scale.h>
|
||||
#include <Xm/ToggleBG.h>
|
||||
#include <Xm/VendorSEP.h>
|
||||
|
||||
#include <Dt/DialogBox.h>
|
||||
#include <Dt/Icon.h>
|
||||
|
||||
#include <Dt/Message.h>
|
||||
#include <Dt/HourGlass.h>
|
||||
|
||||
#include "Help.h"
|
||||
#include "Main.h"
|
||||
#include "SaveRestore.h"
|
||||
#include "Protocol.h"
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include extern functions */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
#include "Keyboard.h"
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Local #defines */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
#define VOLUME_MAX 100
|
||||
#define SCALE_WIDTH 200
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Internal Functions */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
static Widget build_keyboardDlg( Widget shell) ;
|
||||
static void layoutCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
static void _DtmapCB_keyboardDlg(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
static int getValue( Widget w) ;
|
||||
static void valueChangedCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
static void autoRepeatToggleCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
static void systemDefaultCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
static void ButtonCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Internal Variables */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
typedef struct {
|
||||
Widget pictLabel;
|
||||
Widget systemDefault;
|
||||
Widget volumeLabGad;
|
||||
Widget volumeScale;
|
||||
Widget autoRepeatToggle;
|
||||
XKeyboardState values;
|
||||
int new_key_click_percent;
|
||||
int new_autoRepeat;
|
||||
Boolean systemDefaultFlag;
|
||||
} Kbd, *KdbPtr;
|
||||
|
||||
static Kbd kbd;
|
||||
static saveRestore save = {FALSE, 0, };
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* popup_kbdDialog */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
void
|
||||
popup_keyboardBB(
|
||||
Widget shell )
|
||||
{
|
||||
if (style.kbdDialog == NULL)
|
||||
{
|
||||
_DtTurnOnHourGlass(shell);
|
||||
build_keyboardDlg(shell);
|
||||
XtManageChild(style.kbdDialog);
|
||||
_DtTurnOffHourGlass(shell);
|
||||
}
|
||||
else
|
||||
{
|
||||
XtManageChild(style.kbdDialog);
|
||||
raiseWindow(XtWindow(XtParent(style.kbdDialog)));
|
||||
}
|
||||
}
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* build__keyboardDlg */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static Widget
|
||||
build_keyboardDlg(
|
||||
Widget shell )
|
||||
{
|
||||
register int i, n;
|
||||
Arg args[MAX_ARGS];
|
||||
Widget widget_list[12];
|
||||
int count = 0;
|
||||
Widget form;
|
||||
Pixel foreground, background;
|
||||
Boolean set;
|
||||
XmString button_string[NUM_LABELS];
|
||||
XmString string;
|
||||
|
||||
/* Set up DialogBoxDialog button labels */
|
||||
button_string[0] = CMPSTR(_DtOkString);
|
||||
button_string[1] = CMPSTR(_DtCancelString);
|
||||
button_string[2] = CMPSTR(_DtHelpString);
|
||||
|
||||
/* Create toplevel DialogBox */
|
||||
|
||||
/* saveRestore
|
||||
* Note that save.poscnt has been initialized elsewhere.
|
||||
* save.posArgs may contain information from restoreBeep().*/
|
||||
|
||||
XtSetArg(save.posArgs[save.poscnt], XmNbuttonCount, NUM_LABELS);
|
||||
save.poscnt++;
|
||||
XtSetArg(save.posArgs[save.poscnt], XmNbuttonLabelStrings, button_string);
|
||||
save.poscnt++;
|
||||
XtSetArg (save.posArgs[save.poscnt], XmNdefaultPosition, False);
|
||||
save.poscnt++;
|
||||
style.kbdDialog = __DtCreateDialogBoxDialog(shell, "KeyboardDialog", save.posArgs, save.poscnt);
|
||||
XtAddCallback(style.kbdDialog, XmNcallback, ButtonCB, NULL);
|
||||
XtAddCallback(style.kbdDialog, XmNhelpCallback,
|
||||
(XtCallbackProc)HelpRequestCB, (XtPointer)HELP_KEYBOARD_DIALOG);
|
||||
|
||||
XmStringFree(button_string[0]);
|
||||
XmStringFree(button_string[1]);
|
||||
XmStringFree(button_string[2]);
|
||||
|
||||
widget_list[0] = _DtDialogBoxGetButton(style.kbdDialog,2);
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNautoUnmanage, False); n++;
|
||||
XtSetArg(args[n], XmNcancelButton, widget_list[0]); n++;
|
||||
XtSetValues (style.kbdDialog, args, n);
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNtitle, ((char *)GETMESSAGE(13, 6, "Style Manager - Keyboard"))); n++;
|
||||
XtSetArg (args[n], XmNuseAsyncGeometry, True); n++;
|
||||
XtSetArg(args[n], XmNmwmFunctions, DIALOG_MWM_FUNC ); n++;
|
||||
XtSetValues (XtParent(style.kbdDialog), args, n);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNhorizontalSpacing, style.horizontalSpacing); n++;
|
||||
XtSetArg(args[n], XmNverticalSpacing, style.verticalSpacing); n++;
|
||||
XtSetArg(args[n], XmNallowOverlap, False); n++;
|
||||
XtSetArg(args[n], XmNchildType, XmWORK_AREA); n++;
|
||||
form = XmCreateForm(style.kbdDialog, "keyboardForm", args, n);
|
||||
|
||||
/* create keyboard pixmap */
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNfillMode, XmFILL_SELF); n++;
|
||||
XtSetArg(args[n], XmNbehavior, XmICON_LABEL); n++;
|
||||
XtSetArg(args[n], XmNpixmapForeground, style.secBSCol); n++;
|
||||
XtSetArg(args[n], XmNpixmapBackground, style.secTSCol); n++;
|
||||
XtSetArg(args[n], XmNstring, NULL); n++;
|
||||
XtSetArg(args[n], XmNshadowThickness, 0); n++;
|
||||
XtSetArg(args[n], XmNimageName, KEYBOARD_ICON); n++;
|
||||
XtSetArg(args[n], XmNtraversalOn, False); n++;
|
||||
widget_list[count++] =
|
||||
kbd.pictLabel= _DtCreateIcon(form, "keyboardpictLabel", args, n);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNmarginHeight, LB_MARGIN_HEIGHT); n++;
|
||||
XtSetArg(args[n], XmNmarginWidth, LB_MARGIN_WIDTH); n++;
|
||||
string = CMPSTR(((char *)GETMESSAGE(13, 2, "Default")));
|
||||
XtSetArg(args[n], XmNlabelString, string); n++;
|
||||
XtSetArg(args[n], XmNnavigationType, XmTAB_GROUP); n++;
|
||||
widget_list[count++] =
|
||||
kbd.systemDefault= XmCreatePushButtonGadget(form, "systemDefault", args, n);
|
||||
XmStringFree(string);
|
||||
|
||||
n = 0;
|
||||
set = (kbd.values.global_auto_repeat == AutoRepeatModeOn) ? True : False;
|
||||
XtSetArg(args[n], XmNset, set); n++;
|
||||
string = CMPSTR(((char *)GETMESSAGE(13, 3, "Auto Repeat")));
|
||||
XtSetArg(args[n], XmNlabelString, string); n++;
|
||||
XtSetArg(args[n], XmNnavigationType, XmTAB_GROUP); n++;
|
||||
widget_list[count++] =
|
||||
kbd.autoRepeatToggle= XmCreateToggleButtonGadget(form, "autoRepeatToggle", args, n);
|
||||
XmStringFree(string);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNalignment, XmALIGNMENT_END); n++;
|
||||
string = CMPSTR(((char *)GETMESSAGE(13, 4, "Click Volume")));
|
||||
XtSetArg(args[n], XmNmarginHeight, 0); n++;
|
||||
XtSetArg(args[n], XmNlabelString, string); n++;
|
||||
widget_list[count++] =
|
||||
kbd.volumeLabGad= XmCreateLabelGadget(form,"volumeLabGad", args, n);
|
||||
XmStringFree(string);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNmaximum, VOLUME_MAX); n++;
|
||||
XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
|
||||
XtSetArg(args[n], XmNprocessingDirection, XmMAX_ON_RIGHT); n++;
|
||||
XtSetArg(args[n], XmNshowValue, True); n++;
|
||||
XtSetArg(args[n], XmNhighlightThickness, SCALE_HIGHLIGHT_THICKNESS); n++;
|
||||
XtSetArg(args[n], XmNscaleWidth, SCALE_WIDTH); n++;
|
||||
widget_list[count++] =
|
||||
kbd.volumeScale= XmCreateScale(form,"volumeScale", args, n);
|
||||
|
||||
XtAddCallback(style.kbdDialog, XmNmapCallback, layoutCB, NULL);
|
||||
XtAddCallback(style.kbdDialog, XmNmapCallback, _DtmapCB_keyboardDlg, shell);
|
||||
XtAddCallback(kbd.systemDefault, XmNactivateCallback, systemDefaultCB, NULL);
|
||||
XtAddCallback(kbd.volumeScale, XmNvalueChangedCallback, valueChangedCB, NULL);
|
||||
XtAddCallback(kbd.autoRepeatToggle, XmNvalueChangedCallback, autoRepeatToggleCB, NULL);
|
||||
|
||||
XtManageChild(form);
|
||||
XtManageChildren(widget_list,count);
|
||||
|
||||
return(style.kbdDialog);
|
||||
}
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* layoutCB */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
layoutCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
int n;
|
||||
Arg args[MAX_ARGS];
|
||||
|
||||
/* Picture Label */
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNtopOffset, style.verticalSpacing); n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNleftOffset, style.horizontalSpacing); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_NONE); n++;
|
||||
XtSetValues (kbd.pictLabel, args, n);
|
||||
|
||||
/* system Default */
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNtopOffset, style.verticalSpacing); n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNrightOffset, style.horizontalSpacing); n++;
|
||||
XtSetValues (kbd.systemDefault, args, n);
|
||||
|
||||
/* auto repeat toggle */
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, kbd.pictLabel); n++;
|
||||
XtSetArg(args[n], XmNtopOffset, style.verticalSpacing); n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNleftOffset, style.horizontalSpacing); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_NONE); n++;
|
||||
XtSetValues (kbd.autoRepeatToggle, args, n);
|
||||
|
||||
/* Volume Label */
|
||||
n=0;
|
||||
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNbottomOffset, style.verticalSpacing); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNleftOffset, style.horizontalSpacing); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_NONE); n++;
|
||||
XtSetValues (kbd.volumeLabGad, args, n);
|
||||
|
||||
|
||||
/* Volume Scale */
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, kbd.autoRepeatToggle);n++;
|
||||
XtSetArg(args[n], XmNtopOffset, style.verticalSpacing);n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNbottomOffset, style.verticalSpacing); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNleftWidget, kbd.volumeLabGad); n++;
|
||||
XtSetArg(args[n], XmNleftOffset, style.horizontalSpacing); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
|
||||
XtSetValues (kbd.volumeScale, args, n);
|
||||
|
||||
XtRemoveCallback(style.kbdDialog, XmNmapCallback, layoutCB, NULL);
|
||||
}
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* _DtmapCB_keyboardDlg */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
_DtmapCB_keyboardDlg(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
static int first_time = 1;
|
||||
int n;
|
||||
Arg args[MAX_ARGS];
|
||||
Boolean set;
|
||||
|
||||
if (first_time)
|
||||
{
|
||||
DtWsmRemoveWorkspaceFunctions(style.display, XtWindow(XtParent(w)));
|
||||
|
||||
if (!save.restoreFlag)
|
||||
putDialog ((Widget)client_data, w);
|
||||
|
||||
first_time = 0;
|
||||
}
|
||||
|
||||
/* get keyboard values for click volume */
|
||||
XGetKeyboardControl(style.display, &kbd.values);
|
||||
kbd.new_key_click_percent = kbd.values.key_click_percent;
|
||||
kbd.new_autoRepeat = kbd.values.global_auto_repeat;
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNvalue, kbd.values.key_click_percent); n++;
|
||||
XtSetValues(kbd.volumeScale, args, n);
|
||||
|
||||
n=0;
|
||||
set = (kbd.values.global_auto_repeat == AutoRepeatModeOn) ? True : False;
|
||||
XtSetArg(args[n], XmNset, set); n++;
|
||||
XtSetValues(kbd.autoRepeatToggle, args, n);
|
||||
}
|
||||
|
||||
static int
|
||||
getValue(
|
||||
Widget w )
|
||||
{
|
||||
int n, value;
|
||||
Arg args[1];
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNvalue, &value); n++;
|
||||
XtGetValues(w, args, n);
|
||||
return(value);
|
||||
}
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* valueChangedCB */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
valueChangedCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
|
||||
XKeyboardControl kbdControl;
|
||||
int kbdControlMask;
|
||||
|
||||
/* set keyboard click volume to scale value */
|
||||
|
||||
kbdControlMask = KBKeyClickPercent;
|
||||
kbdControl.key_click_percent = kbd.new_key_click_percent =
|
||||
getValue(kbd.volumeScale);
|
||||
XChangeKeyboardControl(style.display, kbdControlMask, &kbdControl);
|
||||
kbd.systemDefaultFlag = False;
|
||||
}
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* autoRepeatToggleCB */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
autoRepeatToggleCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
|
||||
/* set auto repeat to new value */
|
||||
|
||||
if (((XmToggleButtonCallbackStruct *)call_data)->set)
|
||||
{
|
||||
XAutoRepeatOn(style.display);
|
||||
kbd.new_autoRepeat = AutoRepeatModeOn;
|
||||
}
|
||||
else
|
||||
{
|
||||
XAutoRepeatOff(style.display);
|
||||
kbd.new_autoRepeat = AutoRepeatModeOff;
|
||||
}
|
||||
kbd.systemDefaultFlag = False;
|
||||
}
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* systemDefaultCB */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
systemDefaultCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
int n;
|
||||
Arg args[MAX_ARGS];
|
||||
XKeyboardControl kbdControl;
|
||||
int kbdControlMask;
|
||||
XKeyboardState kbdState;
|
||||
Boolean set;
|
||||
|
||||
/* set keyboard click volume to system default value */
|
||||
|
||||
kbdControlMask = KBKeyClickPercent | KBAutoRepeatMode;
|
||||
kbdControl.key_click_percent = -1;
|
||||
kbdControl.auto_repeat_mode = AutoRepeatModeDefault;
|
||||
XChangeKeyboardControl(style.display, kbdControlMask, &kbdControl);
|
||||
|
||||
XGetKeyboardControl(style.display, &kbdState);
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNvalue, kbdState.key_click_percent); n++;
|
||||
XtSetValues(kbd.volumeScale, args, n);
|
||||
|
||||
n=0;
|
||||
set = (kbdState.global_auto_repeat == AutoRepeatModeOn) ? True : False;
|
||||
XtSetArg(args[n], XmNset, set); n++;
|
||||
XtSetValues(kbd.autoRepeatToggle, args, n);
|
||||
|
||||
kbd.systemDefaultFlag = True;
|
||||
}
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* ButtonCB */
|
||||
/* callback for PushButtons in DialogBox */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
ButtonCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
int n;
|
||||
Arg args[MAX_ARGS];
|
||||
XKeyboardControl kbdControl;
|
||||
int kbdControlMask;
|
||||
DtDialogBoxCallbackStruct *cb = (DtDialogBoxCallbackStruct *) call_data;
|
||||
|
||||
|
||||
switch (cb->button_position)
|
||||
{
|
||||
case OK_BUTTON:
|
||||
XtUnmanageChild (w);
|
||||
|
||||
/* if sendSettings is true send message to Session Manager */
|
||||
|
||||
if(style.smState.smSendSettings)
|
||||
{
|
||||
if(kbd.systemDefaultFlag)
|
||||
{
|
||||
SmDefaultKeyboardSettings();
|
||||
}
|
||||
else
|
||||
{
|
||||
SmNewKeyboardSettings( kbd.new_key_click_percent, /* 0-100 */
|
||||
kbd.new_autoRepeat); /* 0,1 */
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case CANCEL_BUTTON:
|
||||
/* reset to incoming keyboard values */
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNvalue, kbd.values.key_click_percent); n++;
|
||||
XtSetValues(kbd.volumeScale, args, n);
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNset, kbd.values.global_auto_repeat); n++;
|
||||
XtSetValues(kbd.autoRepeatToggle, args, n);
|
||||
|
||||
kbdControlMask = KBKeyClickPercent | KBAutoRepeatMode;
|
||||
kbdControl.key_click_percent = kbd.values.key_click_percent;
|
||||
kbdControl.auto_repeat_mode = kbd.values.global_auto_repeat;
|
||||
XChangeKeyboardControl(style.display, kbdControlMask, &kbdControl);
|
||||
|
||||
XtUnmanageChild(w);
|
||||
break;
|
||||
|
||||
case HELP_BUTTON:
|
||||
XtCallCallbacks(style.kbdDialog, XmNhelpCallback, (XtPointer)NULL);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* restoreKeybd()
|
||||
*
|
||||
* restore any state information saved with saveKeybd.
|
||||
* This is called from restoreSession with the application
|
||||
* shell and the special xrm database retrieved for restore.
|
||||
************************************************************************/
|
||||
void
|
||||
restoreKeybd(
|
||||
Widget shell,
|
||||
XrmDatabase db )
|
||||
{
|
||||
XrmName xrm_name[5];
|
||||
XrmRepresentation rep_type;
|
||||
XrmValue value;
|
||||
|
||||
xrm_name [0] = XrmStringToQuark ("keyboardDlg");
|
||||
xrm_name [2] = NULL;
|
||||
|
||||
/* get x position */
|
||||
xrm_name [1] = XrmStringToQuark ("x");
|
||||
if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value)){
|
||||
XtSetArg (save.posArgs[save.poscnt], XmNx, atoi((char *)value.addr)); save.poscnt++;
|
||||
save.restoreFlag = True;
|
||||
}
|
||||
|
||||
/* get y position */
|
||||
xrm_name [1] = XrmStringToQuark ("y");
|
||||
if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value)){
|
||||
XtSetArg (save.posArgs[save.poscnt], XmNy, atoi((char *)value.addr)); save.poscnt++;
|
||||
}
|
||||
|
||||
xrm_name [1] = XrmStringToQuark ("ismapped");
|
||||
XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value);
|
||||
/* Are we supposed to be mapped? */
|
||||
if (strcmp(value.addr, "True") == 0)
|
||||
popup_keyboardBB(shell);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* saveKeybd()
|
||||
*
|
||||
* This routine will write out to the passed file descriptor any state
|
||||
* information this dialog needs. It is called from saveSessionCB with the
|
||||
* file already opened.
|
||||
* All information is saved in xrm format. There is no restriction
|
||||
* on what can be saved. It doesn't have to be defined or be part of any
|
||||
* widget or Xt definition. Just name and save it here and recover it in
|
||||
* restoreBackdrop. The suggested minimum is whether you are mapped, and your
|
||||
* location.
|
||||
************************************************************************/
|
||||
void
|
||||
saveKeybd(
|
||||
int fd )
|
||||
{
|
||||
Position x,y;
|
||||
char *bufr = style.tmpBigStr; /* size=[1024], make bigger if needed */
|
||||
XmVendorShellExtObject vendorExt;
|
||||
XmWidgetExtData extData;
|
||||
|
||||
if (style.kbdDialog != NULL)
|
||||
{
|
||||
if (XtIsManaged(style.kbdDialog))
|
||||
sprintf(bufr, "*keyboardDlg.ismapped: True\n");
|
||||
else
|
||||
sprintf(bufr, "*keyboardDlg.ismapped: False\n");
|
||||
|
||||
/* Get and write out the geometry info for our Window */
|
||||
x = XtX(XtParent(style.kbdDialog));
|
||||
y = XtY(XtParent(style.kbdDialog));
|
||||
|
||||
/* Modify x & y to take into account window mgr frames
|
||||
* This is pretty bogus, but I don't know a better way to do it.
|
||||
*/
|
||||
extData = _XmGetWidgetExtData(style.shell, XmSHELL_EXTENSION);
|
||||
vendorExt = (XmVendorShellExtObject)extData->widget;
|
||||
x -= vendorExt->vendor.xOffset;
|
||||
y -= vendorExt->vendor.yOffset;
|
||||
|
||||
sprintf(bufr, "%s*keyboardDlg.x: %d\n", bufr, x);
|
||||
sprintf(bufr, "%s*keyboardDlg.y: %d\n", bufr, y);
|
||||
|
||||
write (fd, bufr, strlen(bufr));
|
||||
}
|
||||
}
|
||||
|
||||
31
cde/programs/dtstyle/Keyboard.h
Normal file
31
cde/programs/dtstyle/Keyboard.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/* $XConsortium: Keyboard.h /main/4 1995/10/30 13:10:26 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Keyboard.h
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** This file contains function definitions for the corresponding .c
|
||||
** file
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _keyboard_h
|
||||
#define _keyboard_h
|
||||
|
||||
/* External Interface */
|
||||
|
||||
|
||||
extern void popup_keyboardBB( Widget shell) ;
|
||||
extern void restoreKeybd( Widget shell, XrmDatabase db) ;
|
||||
extern void saveKeybd( int fd) ;
|
||||
|
||||
|
||||
#endif /* _keyboard_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
1057
cde/programs/dtstyle/Main.c
Normal file
1057
cde/programs/dtstyle/Main.c
Normal file
File diff suppressed because it is too large
Load Diff
250
cde/programs/dtstyle/Main.h
Normal file
250
cde/programs/dtstyle/Main.h
Normal file
@@ -0,0 +1,250 @@
|
||||
/* $XConsortium: Main.h /main/8 1996/10/15 08:02:10 pascale $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Main.h
|
||||
**
|
||||
** Project: SUI
|
||||
**
|
||||
** Description: defines and typedefs for DtStyle
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
/*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1990, 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
|
||||
#ifndef _main_h
|
||||
#define _main_h
|
||||
|
||||
/*
|
||||
* #include statements
|
||||
*/
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/XmP.h>
|
||||
#include "Font.h"
|
||||
#include <Dt/DtP.h>
|
||||
#include <Dt/SessionM.h>
|
||||
#include <Dt/SessionP.h>
|
||||
|
||||
/*
|
||||
* Copied from Xm/BaseClassI.h
|
||||
*/
|
||||
extern XmWidgetExtData _XmGetWidgetExtData(
|
||||
Widget widget,
|
||||
#if NeedWidePrototypes
|
||||
unsigned int extType) ;
|
||||
#else
|
||||
unsigned char extType) ;
|
||||
#endif /* NeedWidePrototypes */
|
||||
|
||||
/*
|
||||
* #define statements
|
||||
*/
|
||||
|
||||
#define MAX_ARGS 20
|
||||
#define CMPSTR(str) XmStringCreateLocalized (str)
|
||||
#define XMCLASS "Dtstyle"
|
||||
#define DIALOG_MWM_FUNC MWM_FUNC_MOVE | MWM_FUNC_CLOSE
|
||||
|
||||
#define COLOR "Color"
|
||||
#define FONT "Font"
|
||||
#define BACKDROP "Backdrop"
|
||||
#define KEYBOARD "Keyboard"
|
||||
#define MOUSE "Mouse"
|
||||
#define BEEP "Beep"
|
||||
#define SCREEN "Screen"
|
||||
#define DTWM "Dtwm"
|
||||
#define STARTUP "Startup"
|
||||
#define I18N "I18N"
|
||||
|
||||
#define COLOR_ICON "DtColor"
|
||||
#define FONT_ICON "DtFont"
|
||||
#define BACKDROP_ICON "DtBkdrp"
|
||||
#define KEYBOARD_ICON "DtKeybd"
|
||||
#define MOUSE_ICON "DtMouse"
|
||||
#define BEEP_ICON "DtBeep"
|
||||
#define SCREEN_ICON "DtScrn"
|
||||
#define DTWM_ICON "DtDtwm"
|
||||
#define STARTUP_ICON "DtStart"
|
||||
#define I18N_ICON "DtI18N"
|
||||
|
||||
|
||||
/* help files */
|
||||
#define KB_TRAV_HELP "vs_keys"
|
||||
#define BACKDROP_HELP "vs_back"
|
||||
#define AUDIO_HELP "vs_beep"
|
||||
#define PALETTE_HELP "vs_colo"
|
||||
#define COLOR_EDIT_HELP "vs_dtd"
|
||||
#define ADD_PALETTE_HELP "vs_coad"
|
||||
#define DELETE_PALETTE_HELP "vs_code"
|
||||
#define FONT_HELP "vs_font"
|
||||
#define HOST_HELP "vs_host"
|
||||
#define KEYBOARD_HELP "vs_keyb"
|
||||
#define MOUSE_HELP "vs_mous"
|
||||
#define PASSWORD_HELP "vs_pass"
|
||||
#define SCREEN_HELP "vs_scre"
|
||||
#define STARTUP_HELP "vs_star"
|
||||
#define I18N_HELP "vs_i18n"
|
||||
#define STYLE_HELP "vs_wind"
|
||||
|
||||
/* DialogBoxDialog label #defines */
|
||||
#define OK_BUTTON 1
|
||||
#define CANCEL_BUTTON 2
|
||||
#define HELP_BUTTON 3
|
||||
#define NUM_LABELS 3
|
||||
|
||||
/* geometry */
|
||||
#define LB_MARGIN_HEIGHT 2
|
||||
#define LB_MARGIN_WIDTH 12
|
||||
#define SCALE_HIGHLIGHT_THICKNESS (Dimension) 2
|
||||
|
||||
/*
|
||||
* typedef statements
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
int numFonts;
|
||||
XmFontList userFont,
|
||||
systemFont;
|
||||
String userFontStr,
|
||||
systemFontStr;
|
||||
Fontset fontChoice[10];
|
||||
String session,
|
||||
backdropDir,
|
||||
paletteDir,
|
||||
timeoutScale, lockoutScale;
|
||||
Boolean writeXrdbImmediate;
|
||||
Boolean writeXrdbColors;
|
||||
String componentList;
|
||||
XmStringTable imServerHosts;
|
||||
XmStringTable preeditType;
|
||||
int pipeTimeOut;
|
||||
} ApplicationData, *ApplicationDataPtr;
|
||||
|
||||
typedef struct {
|
||||
Boolean restoreFlag;
|
||||
int poscnt;
|
||||
Arg posArgs[MAX_ARGS];
|
||||
} saveRestore;
|
||||
|
||||
typedef struct {
|
||||
Display *display;
|
||||
Screen *screen;
|
||||
int screenNum;
|
||||
Window root;
|
||||
Colormap colormap;
|
||||
Boolean useMultiColorIcons;
|
||||
Pixel tgSelectColor,
|
||||
secSelectColor, /** for editable text bg **/
|
||||
primTSCol, primBSCol, /** TS and BS colors are **/
|
||||
secTSCol, secBSCol, /** for icon fg and bg **/
|
||||
secBgCol;
|
||||
ApplicationData xrdb;
|
||||
char *home;
|
||||
char *execName;
|
||||
SmStateInfo smState;
|
||||
SmSaverInfo smSaver;
|
||||
Boolean longfilename;
|
||||
Widget shell,
|
||||
mainWindow,
|
||||
colorDialog,
|
||||
backdropDialog,
|
||||
fontDialog,
|
||||
kbdDialog,
|
||||
mouseDialog,
|
||||
audioDialog,
|
||||
screenDialog,
|
||||
startupDialog,
|
||||
dtwmDialog,
|
||||
i18nDialog,
|
||||
buttonsForm;
|
||||
XmString tmpXmStr;
|
||||
Widget errDialog, errParent;
|
||||
char tmpBigStr[1024];
|
||||
int fontSize, timeoutscale;
|
||||
short count;
|
||||
Boolean colorSrv;
|
||||
Boolean dynamicColor;
|
||||
Boolean workProcs;
|
||||
int horizontalSpacing, verticalSpacing;
|
||||
} Style;
|
||||
|
||||
/*
|
||||
* External variables
|
||||
*/
|
||||
|
||||
extern Style style;
|
||||
extern char *progName;
|
||||
extern XrmDatabase sys_pl_DB;
|
||||
extern XrmDatabase adm_pl_DB;
|
||||
extern XrmDatabase hm_pl_DB;
|
||||
extern XrmDatabase pl_DB;
|
||||
|
||||
/*
|
||||
* External Interface
|
||||
*/
|
||||
|
||||
extern int local_xerror( Display *dpy, XErrorEvent *rep) ; /* defined in hostBB.c for
|
||||
historical reasons*/
|
||||
|
||||
|
||||
extern char *_DtGetMessage(
|
||||
char *filename,
|
||||
int set,
|
||||
int n,
|
||||
char *s );
|
||||
extern void raiseWindow(
|
||||
Window dialogWin) ;
|
||||
extern void CenterMsgCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
extern void ErrDialog(
|
||||
char *errString,
|
||||
Widget visualParent) ;
|
||||
extern void InfoDialog(
|
||||
char *infoString,
|
||||
Widget parent,
|
||||
Boolean unmapParent) ;
|
||||
extern void putDialog(
|
||||
Widget parent,
|
||||
Widget dialog) ;
|
||||
extern void smStateCB(
|
||||
DtString fields[],
|
||||
XtPointer client_data,
|
||||
int num_fields) ;
|
||||
extern void HandleStopMsg(
|
||||
DtString fields[],
|
||||
XtPointer client_data,
|
||||
int num_words) ;
|
||||
extern void LoadDatabase(void);
|
||||
|
||||
/*
|
||||
* macro to get message catalog strings
|
||||
*/
|
||||
#ifndef NO_MESSAGE_CATALOG
|
||||
# ifdef DT_LITE
|
||||
# define GETMESSAGE(set, number, string)\
|
||||
_DtGetMessage(set, number, "")
|
||||
# else /* DT_LITE*/
|
||||
# define CLIENT_MESSAGE_CAT_NAME "dtstyle"
|
||||
# define GETMESSAGE(set, number, string)\
|
||||
_DtGetMessage(CLIENT_MESSAGE_CAT_NAME, set, number, string)
|
||||
# endif /* DT_LITE */
|
||||
#else
|
||||
# define GETMESSAGE(set, number, string)\
|
||||
string
|
||||
#endif
|
||||
|
||||
#endif /* _main_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
|
||||
760
cde/programs/dtstyle/MainWin.c
Normal file
760
cde/programs/dtstyle/MainWin.c
Normal file
@@ -0,0 +1,760 @@
|
||||
/* $XConsortium: MainWin.c /main/8 1996/03/25 00:52:54 pascale $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: MainWin.c
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** Description: Controls the main Dtstyle dialog
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
/*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1990, 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include files */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <Xm/MwmUtil.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/XmP.h>
|
||||
#include <Xm/CascadeB.h>
|
||||
#include <Xm/ColorObjP.h>
|
||||
#include <Xm/MainW.h>
|
||||
#include <Xm/Frame.h>
|
||||
#include <Xm/PushB.h>
|
||||
#include <Xm/RowColumn.h>
|
||||
#include <Xm/SeparatoG.h>
|
||||
|
||||
/*
|
||||
#include <Dt/Box.h>
|
||||
*/
|
||||
#include <Dt/Control.h>
|
||||
#include <Dt/DialogBox.h>
|
||||
#include <Dt/Icon.h>
|
||||
#include <Dt/IconFile.h>
|
||||
|
||||
#include <Dt/HourGlass.h>
|
||||
#include <Dt/UserMsg.h>
|
||||
|
||||
#include "Main.h"
|
||||
#include "Help.h"
|
||||
#include "SaveRestore.h"
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include extern functions */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
#include "MainWin.h"
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Local #defines */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Internal Functions */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
static void _DtMapCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
static void build_mainWindow( Widget shell) ;
|
||||
static void activateCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
static void ProcessComponentList(
|
||||
Widget parent,
|
||||
Widget mainRC) ;
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Internal variables */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
static int colorUse = XmCO_BLACK_WHITE;
|
||||
static saveRestore save = {FALSE, 0, };
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
/* init_mainWindow */
|
||||
/* */
|
||||
/* build if needed, otherwise just manage the mainWindow. */
|
||||
/* Assumes shell has been created */
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
void
|
||||
init_mainWindow( Widget shell )
|
||||
{
|
||||
if (style.mainWindow == NULL) {
|
||||
build_mainWindow(shell);
|
||||
if (save.restoreFlag)
|
||||
XtAddCallback (shell, XtNpopupCallback, _DtMapCB, NULL);
|
||||
XtManageChild(style.mainWindow);
|
||||
XtPopup(shell, XtGrabNone);
|
||||
}
|
||||
else /* fix Shouldn't ever happen */
|
||||
XtManageChild(style.mainWindow);
|
||||
}
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
/* _DtMapCB */
|
||||
/* first time only, set correct sizing in case font */
|
||||
/* size has changed (if so, saved size is wrong) */
|
||||
/* remove callback after first time */
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
_DtMapCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
XSizeHints hints;
|
||||
|
||||
if (save.restoreFlag)
|
||||
{
|
||||
hints.min_width = XtWidth(w);
|
||||
hints.min_height = XtHeight(w);
|
||||
hints.max_width = XtWidth(w);
|
||||
hints.max_height = XtHeight(w);
|
||||
hints.flags = PMinSize | PMaxSize;
|
||||
XSetWMNormalHints (style.display, XtWindow(w), &hints);
|
||||
}
|
||||
|
||||
XtRemoveCallback(style.shell, XtNpopupCallback, _DtMapCB, NULL);
|
||||
}
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
/* build_mainWindow */
|
||||
/* */
|
||||
/* build the main window, but don't manage it. */
|
||||
/*+++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
build_mainWindow(
|
||||
Widget shell )
|
||||
{
|
||||
int count, n, n2;
|
||||
Arg args[MAX_ARGS];
|
||||
Widget WidgList[10];
|
||||
Widget frame;
|
||||
Widget mainMenu;
|
||||
Widget mainRC;
|
||||
Widget filePulldown;
|
||||
Widget helpPulldown;
|
||||
Widget exitBtn;
|
||||
char *mnemonic;
|
||||
char *tmpStr;
|
||||
Pixmap pixmap;
|
||||
XmString labelString;
|
||||
Pixmap ditherPix;
|
||||
XmPixelSet pixelSet[XmCO_NUM_COLORS];
|
||||
Pixel bg;
|
||||
short a,i,p,s;
|
||||
|
||||
|
||||
/* saveRestore
|
||||
* Note that save.poscnt has been initialized elsewhere.
|
||||
* save.posArgs may contain information from restoreAudio().*/
|
||||
|
||||
XtSetArg(save.posArgs[save.poscnt], XmNnoResize, True); save.poscnt++;
|
||||
XtSetArg(save.posArgs[save.poscnt], XmNresizePolicy, XmRESIZE_NONE); save.poscnt++;
|
||||
style.mainWindow= XmCreateMainWindow(shell,"mainWindow", save.posArgs, save.poscnt);
|
||||
XtAddCallback(style.mainWindow, XmNhelpCallback,
|
||||
(XtCallbackProc)HelpRequestCB, (XtPointer)HELP_MAIN_WINDOW);
|
||||
|
||||
n = 0;
|
||||
tmpStr = (char *)XtMalloc(strlen(GETMESSAGE(4, 1, "Style Manager"))+1);
|
||||
sprintf(tmpStr, GETMESSAGE(4, 1, "Style Manager"));
|
||||
XtSetArg(args[n], XmNtitle, tmpStr); n++;
|
||||
XtSetArg(args[n], XmNiconName,
|
||||
(char *)GETMESSAGE(4, 37, "Style")); n++;
|
||||
XtSetValues(XtParent(style.mainWindow), args, n);
|
||||
XtFree(tmpStr);
|
||||
|
||||
n = 0;
|
||||
mainMenu= XmCreateMenuBar(style.mainWindow,"mainMenu", args, n);
|
||||
XtAddCallback(mainMenu, XmNhelpCallback,
|
||||
(XtCallbackProc)HelpRequestCB, (XtPointer)HELP_MENUBAR);
|
||||
XtManageChild(mainMenu);
|
||||
|
||||
/* create the pulldown widgets */
|
||||
n = 0;
|
||||
filePulldown= XmCreatePulldownMenu(mainMenu,"fileMenu", args, n );
|
||||
XtAddCallback(filePulldown, XmNhelpCallback,
|
||||
(XtCallbackProc)HelpRequestCB, (XtPointer)HELP_FILE_MENU);
|
||||
|
||||
n = 0;
|
||||
helpPulldown= XmCreatePulldownMenu(mainMenu, "helpMenu" , args, n );
|
||||
XtAddCallback(helpPulldown, XmNhelpCallback,
|
||||
(XtCallbackProc)HelpRequestCB, (XtPointer)HELP_HELP_MENU);
|
||||
|
||||
/* create the cascade butons */
|
||||
count = 0;
|
||||
|
||||
n = 0;
|
||||
mnemonic = ((char *)GETMESSAGE(4, 2, "F"));
|
||||
XtSetArg(args[n], XmNmnemonic, mnemonic[0]); n++;
|
||||
labelString = CMPSTR((char *)GETMESSAGE(4, 3, "File"));
|
||||
XtSetArg(args[n], XmNlabelString, labelString); n++;
|
||||
XtSetArg(args[n], XmNsubMenuId, filePulldown); n++;
|
||||
XtSetArg (args[n], XmNmarginWidth, LB_MARGIN_WIDTH); n++;
|
||||
WidgList[count++]=
|
||||
XmCreateCascadeButton(mainMenu, "fileCascadeButton", args, n );
|
||||
XtAddCallback(WidgList[count-1], XmNhelpCallback,
|
||||
(XtCallbackProc)HelpRequestCB, (XtPointer)HELP_FILE_MENU);
|
||||
XmStringFree(labelString);
|
||||
|
||||
n = 0;
|
||||
mnemonic = ((char *)GETMESSAGE(4, 4, "H"));
|
||||
XtSetArg(args[n], XmNmnemonic, mnemonic[0]); n++;
|
||||
labelString = CMPSTR((char *)GETMESSAGE(4, 5, "Help"));
|
||||
XtSetArg(args[n], XmNlabelString, labelString); n++;
|
||||
XtSetArg(args[n], XmNsubMenuId, helpPulldown); n++;
|
||||
XtSetArg (args[n], XmNmarginWidth, 6); n++;
|
||||
WidgList[count++]=
|
||||
XmCreateCascadeButton(mainMenu, "helpCascadeButton", args, n );
|
||||
XtAddCallback(WidgList[count-1], XmNhelpCallback,
|
||||
(XtCallbackProc)HelpRequestCB, (XtPointer)HELP_HELP_MENU);
|
||||
XmStringFree(labelString);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNmenuHelpWidget, WidgList[count-1]); n++;
|
||||
XtSetValues (mainMenu, args, n);
|
||||
|
||||
XtManageChildren (WidgList, count);
|
||||
|
||||
/* create the File menu pane's buttons */
|
||||
n = 0;
|
||||
mnemonic = ((char *)GETMESSAGE(4, 53, "x"));
|
||||
XtSetArg(args[n], XmNmnemonic, mnemonic[0]); n++;
|
||||
labelString = CMPSTR((char *)GETMESSAGE(4, 7, "Exit"));
|
||||
XtSetArg(args[n], XmNlabelString, labelString); n++;
|
||||
exitBtn= XmCreatePushButton(filePulldown, "exit", args, n );
|
||||
XtAddCallback(exitBtn, XmNactivateCallback, activateCB_exitBtn, NULL);
|
||||
XtAddCallback(exitBtn, XmNhelpCallback,
|
||||
(XtCallbackProc)HelpRequestCB, (XtPointer)HELP_EXIT);
|
||||
XtManageChild(exitBtn);
|
||||
XmStringFree(labelString);
|
||||
|
||||
/* create the Help menu pane's buttons */
|
||||
count =0;
|
||||
|
||||
n = 0;
|
||||
mnemonic = ((char *)GETMESSAGE(4, 54, "v"));
|
||||
XtSetArg(args[n], XmNmnemonic, mnemonic[0]); n++;
|
||||
labelString = CMPSTR((char *)GETMESSAGE(4, 55, "Overview"));
|
||||
XtSetArg(args[n], XmNlabelString, labelString); n++;
|
||||
WidgList[count++]=
|
||||
XmCreatePushButton(helpPulldown, "overview", args, n );
|
||||
XtAddCallback(WidgList[count-1], XmNactivateCallback,
|
||||
(XtCallbackProc)HelpRequestCB, (XtPointer)HELP_INTRODUCTION);
|
||||
XmStringFree(labelString);
|
||||
|
||||
n = 0;
|
||||
WidgList[count++]=
|
||||
XmCreateSeparatorGadget(helpPulldown,"separator",args,n);
|
||||
|
||||
n = 0;
|
||||
mnemonic = ((char *)GETMESSAGE(4, 43, "T"));
|
||||
XtSetArg(args[n], XmNmnemonic, mnemonic[0]); n++;
|
||||
labelString = CMPSTR((char *)GETMESSAGE(4, 56, "Tasks"));
|
||||
XtSetArg(args[n], XmNlabelString, labelString); n++;
|
||||
WidgList[count++]= XmCreatePushButton(helpPulldown, "tasks", args, n );
|
||||
XtAddCallback(WidgList[count-1], XmNactivateCallback,
|
||||
(XtCallbackProc)HelpRequestCB, (XtPointer)HELP_TASKS);
|
||||
XmStringFree(labelString);
|
||||
|
||||
n = 0;
|
||||
mnemonic = ((char *)GETMESSAGE(4, 45, "R"));
|
||||
XtSetArg(args[n], XmNmnemonic, mnemonic[0]); n++;
|
||||
labelString = CMPSTR((char *)GETMESSAGE(4, 57, "Reference"));
|
||||
XtSetArg(args[n], XmNlabelString, labelString); n++;
|
||||
WidgList[count++]= XmCreatePushButton(helpPulldown, "reference", args, n );
|
||||
XtAddCallback(WidgList[count-1], XmNactivateCallback,
|
||||
(XtCallbackProc)HelpRequestCB, (XtPointer)HELP_REFERENCE);
|
||||
XmStringFree(labelString);
|
||||
|
||||
n = 0;
|
||||
mnemonic = ((char *)GETMESSAGE(4, 47, "O"));
|
||||
XtSetArg(args[n], XmNmnemonic, mnemonic[0]); n++;
|
||||
labelString = CMPSTR((char *)GETMESSAGE(4, 48, "On Item"));
|
||||
XtSetArg(args[n], XmNlabelString, labelString); n++;
|
||||
WidgList[count++]= XmCreatePushButton(helpPulldown, "onItem", args, n );
|
||||
XtAddCallback(WidgList[count-1], XmNactivateCallback,
|
||||
(XtCallbackProc)HelpModeCB, (XtPointer)NULL);
|
||||
XmStringFree(labelString);
|
||||
|
||||
n = 0;
|
||||
WidgList[count++] =
|
||||
XmCreateSeparatorGadget(helpPulldown,"separator",args,n);
|
||||
|
||||
n = 0;
|
||||
mnemonic = ((char *)GETMESSAGE(4, 49, "U"));
|
||||
XtSetArg(args[n], XmNmnemonic, mnemonic[0]); n++;
|
||||
labelString = CMPSTR((char *)GETMESSAGE(4, 58, "Using Help"));
|
||||
XtSetArg(args[n], XmNlabelString, labelString); n++;
|
||||
WidgList[count++]=
|
||||
XmCreatePushButton(helpPulldown, "usingHelp", args, n );
|
||||
XtAddCallback(WidgList[count-1], XmNactivateCallback,
|
||||
(XtCallbackProc)HelpRequestCB, (XtPointer)HELP_USING);
|
||||
XmStringFree(labelString);
|
||||
|
||||
n = 0;
|
||||
WidgList[count++] =
|
||||
XmCreateSeparatorGadget(helpPulldown,"separator",args,n);
|
||||
|
||||
n = 0;
|
||||
mnemonic = ((char *)GETMESSAGE(4, 59, "A"));
|
||||
XtSetArg(args[n], XmNmnemonic, mnemonic[0]); n++;
|
||||
labelString = CMPSTR((char *)GETMESSAGE(4, 60, "About Style Manager"));
|
||||
XtSetArg(args[n], XmNlabelString, labelString); n++;
|
||||
WidgList[count++]= XmCreatePushButton(helpPulldown, "stylemanager", args, n );
|
||||
XtAddCallback(WidgList[count-1], XmNactivateCallback,
|
||||
(XtCallbackProc)HelpRequestCB, (XtPointer)HELP_VERSION);
|
||||
XmStringFree(labelString);
|
||||
|
||||
XtManageChildren(WidgList, count);
|
||||
|
||||
/* create frame and row column for icon gadgets */
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNresizePolicy, XmRESIZE_NONE); n++;
|
||||
XtSetArg(args[n], XmNshadowType, XmSHADOW_OUT); n++;
|
||||
XtSetArg(args[n], XmNshadowThickness, 1); n++;
|
||||
frame = XmCreateFrame(style.mainWindow, "frame", args, n);
|
||||
XtManageChild(frame);
|
||||
|
||||
/* Save pixels for later use */
|
||||
/* primary top/bottom shadow -> fg/bg for pixmaps in primary areas */
|
||||
/* secondary top/bottom shadow -> fg/bg for pixmaps in secondary areas */
|
||||
/* secondary select color -> backgrounds of editable text areas */
|
||||
/* secondary foreground -> fill color on toggle indicators */
|
||||
|
||||
/* Get the primary colors to be used later */
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNbackground, &bg); n++;
|
||||
XtGetValues(style.mainWindow, args, n);
|
||||
|
||||
XmGetColors (style.screen, style.colormap, bg,
|
||||
NULL,
|
||||
&style.primTSCol,
|
||||
&style.primBSCol,
|
||||
NULL);
|
||||
|
||||
/* Get the secondary colors to be used later */
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNbackground, &style.secBgCol); n++;
|
||||
XtGetValues(exitBtn, args, n);
|
||||
|
||||
XmGetColors (style.screen, style.colormap, style.secBgCol,
|
||||
&style.tgSelectColor,
|
||||
&style.secTSCol,
|
||||
&style.secBSCol,
|
||||
&style.secSelectColor);
|
||||
|
||||
if ((style.secTSCol == style.secBSCol) || /* B_W or shadowPixmaps==True */
|
||||
(!style.useMultiColorIcons)) /* multiColorIcons turned off */
|
||||
{
|
||||
/* force TS = White, BS = Black */
|
||||
style.secTSCol = style.primTSCol = WhitePixelOfScreen(style.screen);
|
||||
style.secBSCol = style.primBSCol = BlackPixelOfScreen(style.screen);
|
||||
}
|
||||
|
||||
XmeGetPixelData(style.screenNum, &colorUse, pixelSet, &a, &i, &p, &s);
|
||||
|
||||
n = 0;
|
||||
if (colorUse == XmCO_BLACK_WHITE)
|
||||
{
|
||||
ditherPix = XmGetPixmap (style.screen, "50_foreground",
|
||||
style.primBSCol,style.primTSCol);
|
||||
XtSetArg(args[n], XmNbackgroundPixmap, ditherPix); n++;
|
||||
}
|
||||
XtSetArg(args[n], XmNallowOverlap, False); n++;
|
||||
XtSetArg(args[n], XmNadjustLast, False); n++;
|
||||
XtSetArg(args[n], XmNpacking, XmPACK_TIGHT); n++;
|
||||
XtSetArg(args[n], XmNspacing, style.horizontalSpacing); n++;
|
||||
mainRC = XmCreateRowColumn(frame, "mainRC", args, n);
|
||||
XtManageChild(mainRC);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNmenuBar, mainMenu); n++;
|
||||
XtSetArg(args[n], XmNcommandWindow, NULL); n++;
|
||||
XtSetArg(args[n], XmNworkWindow, frame); n++;
|
||||
XtSetValues (style.mainWindow, args, n);
|
||||
|
||||
ProcessComponentList (shell, mainRC);
|
||||
|
||||
}
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++
|
||||
* ProcessComponentList();
|
||||
*
|
||||
*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
static void
|
||||
ProcessComponentList(
|
||||
Widget parent,
|
||||
Widget mainRC )
|
||||
{
|
||||
int count=0;
|
||||
int j=0;
|
||||
int n, n2;
|
||||
Arg args[MAX_ARGS];
|
||||
Widget componentWidget;
|
||||
int s;
|
||||
char *string;
|
||||
char *resString, *resString2;
|
||||
XmString cmp_string;
|
||||
int helpTag;
|
||||
char *dtIcon;
|
||||
int len;
|
||||
|
||||
style.workProcs = False;
|
||||
if (style.xrdb.componentList == NULL) return;
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNalignment, XmALIGNMENT_CENTER); n++;
|
||||
XtSetArg(args[n], XmNpixmapPosition, XmPIXMAP_TOP); n++;
|
||||
XtSetArg(args[n], XmNshadowType, XmSHADOW_OUT); n++;
|
||||
n2 = 3; /* number of preset args for creating Icons */
|
||||
|
||||
resString = strdup (style.xrdb.componentList);
|
||||
resString2 = resString;
|
||||
len = strlen(resString);
|
||||
string = strtok(resString, " ");
|
||||
s = 0;
|
||||
while (string != NULL)
|
||||
{
|
||||
/* check for valid name, duplicate name *** */
|
||||
|
||||
/* create Icon in Dtstyle main window */
|
||||
|
||||
n = n2;
|
||||
XtSetArg(args[n], XmNfillMode, XmFILL_SELF); n++;
|
||||
if (colorUse == XmCO_BLACK_WHITE)
|
||||
{
|
||||
XtSetArg(args[n], XmNuseEmbossedText, False); n++;
|
||||
}
|
||||
XtSetArg(args[n], XmNpixmapForeground, style.primBSCol); n++;
|
||||
XtSetArg(args[n], XmNpixmapBackground, style.primTSCol); n++;
|
||||
if (strcmp(string, COLOR) == 0)
|
||||
{
|
||||
cmp_string = CMPSTR(GETMESSAGE(4, 27, "Color"));
|
||||
helpTag = HELP_COLOR_BUTTON;
|
||||
dtIcon = _DtGetIconFileName(style.screen, COLOR_ICON, NULL, NULL, NULL);
|
||||
style.workProcs = True;
|
||||
}
|
||||
else if (strcmp(string, FONT) == 0)
|
||||
{
|
||||
cmp_string = CMPSTR(GETMESSAGE(4, 28, "Font"));
|
||||
dtIcon = _DtGetIconFileName(style.screen, FONT_ICON, NULL, NULL, NULL);
|
||||
helpTag = HELP_FONT_BUTTON;
|
||||
}
|
||||
|
||||
else if (strcmp(string, BACKDROP) == 0)
|
||||
{
|
||||
cmp_string = CMPSTR(GETMESSAGE(4, 29, "Backdrop"));
|
||||
dtIcon = _DtGetIconFileName(style.screen, BACKDROP_ICON, NULL, NULL, NULL);
|
||||
helpTag = HELP_BACKDROP_BUTTON;
|
||||
}
|
||||
|
||||
else if (strcmp(string, KEYBOARD) == 0)
|
||||
{
|
||||
cmp_string = CMPSTR(GETMESSAGE(4, 30, "Keyboard"));
|
||||
dtIcon = _DtGetIconFileName(style.screen, KEYBOARD_ICON, NULL, NULL, NULL);
|
||||
helpTag = HELP_KEYBOARD_BUTTON;
|
||||
}
|
||||
|
||||
else if (strcmp(string, MOUSE) == 0)
|
||||
{
|
||||
cmp_string = CMPSTR(GETMESSAGE(4, 31, "Mouse"));
|
||||
dtIcon = _DtGetIconFileName(style.screen, MOUSE_ICON, NULL, NULL, NULL);
|
||||
helpTag = HELP_MOUSE_BUTTON;
|
||||
}
|
||||
|
||||
else if (strcmp(string, BEEP) == 0)
|
||||
{
|
||||
cmp_string = CMPSTR(GETMESSAGE(4, 32, "Beep"));
|
||||
dtIcon = _DtGetIconFileName(style.screen, BEEP_ICON, NULL, NULL, NULL);
|
||||
helpTag = HELP_AUDIO_BUTTON;
|
||||
}
|
||||
|
||||
else if (strcmp(string, SCREEN) == 0)
|
||||
{
|
||||
cmp_string = CMPSTR(GETMESSAGE(4, 33, "Screen"));
|
||||
dtIcon = _DtGetIconFileName(style.screen, SCREEN_ICON, NULL, NULL, NULL);
|
||||
helpTag = HELP_SCREEN_BUTTON;
|
||||
}
|
||||
|
||||
else if (strcmp(string, DTWM) == 0)
|
||||
{
|
||||
cmp_string = CMPSTR(GETMESSAGE(4, 38, "Window"));
|
||||
dtIcon = _DtGetIconFileName(style.screen, DTWM_ICON, NULL, NULL, NULL);
|
||||
helpTag = HELP_DTWM_BUTTON;
|
||||
}
|
||||
|
||||
else if (strcmp(string, STARTUP) == 0)
|
||||
{
|
||||
cmp_string = CMPSTR(GETMESSAGE(4, 35, "Startup"));
|
||||
dtIcon = _DtGetIconFileName(style.screen, STARTUP_ICON, NULL, NULL, NULL);
|
||||
helpTag = HELP_STARTUP_BUTTON;
|
||||
}
|
||||
else if (strcmp(string, I18N) == 0)
|
||||
{
|
||||
cmp_string = CMPSTR(GETMESSAGE(4, 34, "Intl'"));
|
||||
dtIcon = _DtGetIconFileName(style.screen, I18N_ICON, NULL, NULL, NULL);
|
||||
helpTag = HELP_I18N_BUTTON;
|
||||
}
|
||||
else
|
||||
{
|
||||
s += strlen(string) +1;
|
||||
if (resString+s >= resString2 + len)
|
||||
string = NULL;
|
||||
else
|
||||
string = strtok(resString+s, " ");
|
||||
continue;
|
||||
}
|
||||
XtSetArg(args[n], XmNimageName, dtIcon); n++;
|
||||
XtSetArg(args[n], XmNstring, cmp_string); n++;
|
||||
componentWidget = _DtCreateControl(mainRC, string, args, n);
|
||||
XtManageChild (componentWidget);
|
||||
XtAddCallback(componentWidget, XmNcallback, activateCB, string);
|
||||
XtAddCallback(componentWidget, XmNhelpCallback,
|
||||
(XtCallbackProc)HelpRequestCB, (XtPointer)helpTag);
|
||||
XmStringFree(cmp_string);
|
||||
XtFree(dtIcon);
|
||||
|
||||
s += strlen(string) +1;
|
||||
if (resString+s >= resString2 + len)
|
||||
string = NULL;
|
||||
else
|
||||
string = strtok(resString+s, " ");
|
||||
|
||||
} /* while */
|
||||
|
||||
}
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* cancel all the dialogs (for exit) */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
void
|
||||
callCancels( void )
|
||||
{
|
||||
DtDialogBoxCallbackStruct CancelBut;
|
||||
char dialogStates[60];
|
||||
static Boolean calledAlready = False;
|
||||
|
||||
if (!calledAlready) {
|
||||
dialogStates[0] = '\0';
|
||||
|
||||
if(style.colorDialog != NULL && XtIsManaged(style.colorDialog)) {
|
||||
CancelBut.button_position = CANCEL_BUTTON;
|
||||
XtCallCallbacks(style.colorDialog, XmNcallback, &CancelBut);
|
||||
}
|
||||
|
||||
if(style.fontDialog != NULL && XtIsManaged(style.fontDialog)) {
|
||||
CancelBut.button_position = CANCEL_BUTTON;
|
||||
XtCallCallbacks(style.fontDialog, XmNcallback, &CancelBut);
|
||||
}
|
||||
|
||||
if(style.audioDialog != NULL && XtIsManaged(style.audioDialog)) {
|
||||
CancelBut.button_position = CANCEL_BUTTON;
|
||||
XtCallCallbacks(style.audioDialog, XmNcallback, &CancelBut);
|
||||
}
|
||||
|
||||
if(style.kbdDialog != NULL && XtIsManaged(style.kbdDialog)) {
|
||||
CancelBut.button_position = CANCEL_BUTTON;
|
||||
XtCallCallbacks(style.kbdDialog, XmNcallback, &CancelBut);
|
||||
}
|
||||
|
||||
if(style.mouseDialog != NULL && XtIsManaged(style.mouseDialog)) {
|
||||
CancelBut.button_position = CANCEL_BUTTON;
|
||||
XtCallCallbacks(style.mouseDialog, XmNcallback, &CancelBut);
|
||||
}
|
||||
|
||||
if(style.screenDialog != NULL && XtIsManaged(style.screenDialog)) {
|
||||
CancelBut.button_position = CANCEL_BUTTON;
|
||||
XtCallCallbacks(style.screenDialog, XmNcallback, &CancelBut);
|
||||
}
|
||||
|
||||
if(style.startupDialog != NULL && XtIsManaged(style.startupDialog)) {
|
||||
CancelBut.button_position = CANCEL_BUTTON;
|
||||
XtCallCallbacks(style.startupDialog, XmNcallback, &CancelBut);
|
||||
}
|
||||
|
||||
if (dialogStates)
|
||||
_DtAddToResource(style.display, dialogStates);
|
||||
|
||||
calledAlready = True;
|
||||
}
|
||||
}
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Menu CallBacks */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
void
|
||||
activateCB_exitBtn(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
/*callCancels() remembers whether its been called so it won't get called*/
|
||||
/*twice on logout.*/
|
||||
callCancels();
|
||||
|
||||
XSync(style.display, 0);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* PushButton CallBacks */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* activateCB */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
static void
|
||||
activateCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
|
||||
DtControlCallbackStruct *cbs =
|
||||
(DtControlCallbackStruct *) call_data;
|
||||
char *cd;
|
||||
cd = (char *) client_data;
|
||||
|
||||
/* if any other event besides an activate
|
||||
event invokes this callback, don't invoke
|
||||
any dialogs. Just ignore the event.
|
||||
*/
|
||||
if (cbs->reason != XmCR_ACTIVATE) return;
|
||||
|
||||
if (strcmp(cd, COLOR) == 0)
|
||||
Customize(style.shell);
|
||||
|
||||
else if (strcmp(cd, FONT) == 0)
|
||||
popup_fontBB(style.shell);
|
||||
|
||||
else if (strcmp(cd, BACKDROP) == 0)
|
||||
BackdropDialog (style.shell);
|
||||
|
||||
else if (strcmp(cd, KEYBOARD) == 0)
|
||||
popup_keyboardBB(style.shell);
|
||||
|
||||
else if (strcmp(cd, MOUSE) == 0)
|
||||
popup_mouseBB(style.shell);
|
||||
|
||||
else if (strcmp(cd, BEEP) == 0)
|
||||
popup_audioBB(style.shell);
|
||||
|
||||
else if (strcmp(cd, SCREEN) == 0)
|
||||
popup_screenBB(style.shell);
|
||||
|
||||
else if (strcmp(cd, DTWM) == 0)
|
||||
popup_dtwmBB(style.shell);
|
||||
|
||||
else if (strcmp(cd, STARTUP) == 0)
|
||||
popup_startupBB(style.shell);
|
||||
|
||||
else if (strcmp(cd, I18N) == 0)
|
||||
popup_i18nBB(style.shell);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* restoreMain()
|
||||
*
|
||||
* restore any state information saved with saveMain.
|
||||
* This is called from restoreSession with the application
|
||||
* shell and the special xrm database retrieved for restore.
|
||||
************************************************************************/
|
||||
void
|
||||
restoreMain(
|
||||
Widget shell,
|
||||
XrmDatabase db )
|
||||
{
|
||||
XrmName xrm_name[5];
|
||||
XrmRepresentation rep_type;
|
||||
XrmValue value;
|
||||
|
||||
xrm_name [0] = XrmStringToQuark ("mainWindow");
|
||||
xrm_name [1] = XrmStringToQuark ("ismapped");
|
||||
xrm_name [2] = NULL;
|
||||
|
||||
if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value)) {
|
||||
/* Are we supposed to be mapped? */
|
||||
if (strcmp(value.addr, "True") == 0) {
|
||||
save.poscnt = 0;
|
||||
|
||||
/* get x position */
|
||||
xrm_name [1] = XrmStringToQuark ("x");
|
||||
if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value)) {
|
||||
XtSetArg (save.posArgs[save.poscnt], XmNx, atoi((char *)value.addr));
|
||||
save.poscnt++;
|
||||
}
|
||||
|
||||
/* get y position */
|
||||
xrm_name [1] = XrmStringToQuark ("y");
|
||||
if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value)) {
|
||||
XtSetArg (save.posArgs[save.poscnt], XmNy, atoi((char *)value.addr));
|
||||
save.poscnt++;
|
||||
}
|
||||
|
||||
save.restoreFlag = True;
|
||||
init_mainWindow(shell);
|
||||
}
|
||||
}
|
||||
else
|
||||
_DtSimpleError (progName, DtWarning, NULL, ((char *)GETMESSAGE(4,36,
|
||||
"No Dtstyle restore information available for current session")), NULL);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* saveMain()
|
||||
*
|
||||
* This routine will write out to the passed file descriptor any state
|
||||
* information this dialog needs. It is called from saveSessionCB with the
|
||||
* file already opened.
|
||||
* All information is saved in xrm format. There is no restriction
|
||||
* on what can be saved. It doesn't have to be defined or be part of any
|
||||
* widget or Xt definition. Just name and save it here and recover it in
|
||||
* restoreMain. The suggested minimum is whether you are mapped, and your
|
||||
* location.
|
||||
************************************************************************/
|
||||
void
|
||||
saveMain(
|
||||
int fd )
|
||||
{
|
||||
Position x,y;
|
||||
char *bufr = style.tmpBigStr; /* size=[1024], make bigger if needed */
|
||||
|
||||
if (style.mainWindow != NULL) {
|
||||
if (XtIsRealized(style.mainWindow))
|
||||
sprintf(bufr, "*mainWindow.ismapped: True\n");
|
||||
|
||||
/* Get and write out the geometry info for our Window */
|
||||
x = XtX(XtParent(style.mainWindow));
|
||||
y = XtY(XtParent(style.mainWindow));
|
||||
sprintf(bufr, "%s*mainWindow.x: %d\n", bufr, x);
|
||||
sprintf(bufr, "%s*mainWindow.y: %d\n", bufr, y);
|
||||
|
||||
write (fd, bufr, strlen(bufr));
|
||||
}
|
||||
}
|
||||
|
||||
40
cde/programs/dtstyle/MainWin.h
Normal file
40
cde/programs/dtstyle/MainWin.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/* $XConsortium: MainWin.h /main/4 1995/10/30 13:11:00 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: MainWin.h
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** This file contains function definitions for the corresponding .c
|
||||
** file
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _mainwin_h
|
||||
#define _mainwin_h
|
||||
|
||||
/* external variable definitions */
|
||||
|
||||
extern char * _dt_version;
|
||||
|
||||
/* External Interface */
|
||||
|
||||
|
||||
extern void init_mainWindow( Widget shell) ;
|
||||
extern void callCancels( void ) ;
|
||||
extern void activateCB_exitBtn(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
extern void restoreMain( Widget shell, XrmDatabase db) ;
|
||||
extern void saveMain( int fd) ;
|
||||
|
||||
|
||||
#endif /* _mainwin_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
1755
cde/programs/dtstyle/Mouse.c
Normal file
1755
cde/programs/dtstyle/Mouse.c
Normal file
File diff suppressed because it is too large
Load Diff
31
cde/programs/dtstyle/Mouse.h
Normal file
31
cde/programs/dtstyle/Mouse.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/* $XConsortium: Mouse.h /main/4 1995/10/30 13:11:19 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Mouse.h
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** This file contains function definitions for the corresponding .c
|
||||
** file
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _mouse_h
|
||||
#define _mouse_h
|
||||
|
||||
/* External Interface */
|
||||
|
||||
|
||||
extern void popup_mouseBB( Widget shell) ;
|
||||
extern void restoreMouse( Widget shell, XrmDatabase db) ;
|
||||
extern void saveMouse( int fd) ;
|
||||
|
||||
|
||||
#endif /* _mouse_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
124
cde/programs/dtstyle/OWsync.c
Normal file
124
cde/programs/dtstyle/OWsync.c
Normal file
@@ -0,0 +1,124 @@
|
||||
/* $XConsortium: OWsync.c /main/3 1996/05/08 20:12:08 drk $ */
|
||||
/*******************************************************************************
|
||||
**
|
||||
** OWsync.c
|
||||
**
|
||||
** Implements functions to synchronize CDE and OpenWindows resources.
|
||||
**
|
||||
** Copyright 1995 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <Dt/DtP.h>
|
||||
|
||||
/*
|
||||
* Include the appropriate header for the ColorSet structure
|
||||
*/
|
||||
#if defined(dtsession)
|
||||
#include "Srv.h"
|
||||
#elif defined(dtstyle)
|
||||
#include "ColorMain.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Sync OW Color resources with CDE color object values
|
||||
*/
|
||||
void
|
||||
OWsyncColorResources(
|
||||
Display * display,
|
||||
int monitorType,
|
||||
ColorSet * colors)
|
||||
{
|
||||
char colorRes[512];
|
||||
int winChip, dataChip, wsChip;
|
||||
|
||||
switch (monitorType) {
|
||||
case XmCO_HIGH_COLOR:
|
||||
winChip = 4; dataChip = 3; wsChip = 7;
|
||||
break;
|
||||
case XmCO_MEDIUM_COLOR:
|
||||
winChip = 1; dataChip = 3; wsChip = 1;
|
||||
break;
|
||||
case XmCO_LOW_COLOR:
|
||||
case XmCO_BLACK_WHITE:
|
||||
winChip = 1; dataChip = 1; wsChip = 1;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
sprintf(colorRes,
|
||||
"*background:\t#%04X%04X%04X\n\
|
||||
*foreground:\t#%04X%04X%04X\n\
|
||||
OpenWindows.WindowColor:\t#%04X%04X%04X\n\
|
||||
OpenWindows.WindowForeground:\t#%04X%04X%04X\n\
|
||||
OpenWindows.WorkspaceColor:\t#%04X%04X%04X\n\
|
||||
OpenWindows.DataBackground:\t#%04X%04X%04X\n\
|
||||
OpenWindows.DataForeground:\t#%04X%04X%04X\n\
|
||||
Window.Color.Background:\t#%04X%04X%04X\n\
|
||||
Window.Color.Foreground:\t#%04X%04X%04X\n",
|
||||
colors[winChip].bg.red,
|
||||
colors[winChip].bg.green,
|
||||
colors[winChip].bg.blue,
|
||||
colors[winChip].fg.red,
|
||||
colors[winChip].fg.green,
|
||||
colors[winChip].fg.blue,
|
||||
colors[winChip].bg.red,
|
||||
colors[winChip].bg.green,
|
||||
colors[winChip].bg.blue,
|
||||
colors[winChip].fg.red,
|
||||
colors[winChip].fg.green,
|
||||
colors[winChip].fg.blue,
|
||||
colors[wsChip].bg.red,
|
||||
colors[wsChip].bg.green,
|
||||
colors[wsChip].bg.blue,
|
||||
colors[dataChip].bg.red,
|
||||
colors[dataChip].bg.green,
|
||||
colors[dataChip].bg.blue,
|
||||
colors[dataChip].fg.red,
|
||||
colors[dataChip].fg.green,
|
||||
colors[dataChip].fg.blue,
|
||||
colors[dataChip].bg.red,
|
||||
colors[dataChip].bg.green,
|
||||
colors[dataChip].bg.blue,
|
||||
colors[dataChip].fg.red,
|
||||
colors[dataChip].fg.green,
|
||||
colors[dataChip].fg.blue);
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr,"OWsyncColorResource: setting\n%s\n",colorRes);
|
||||
#endif
|
||||
|
||||
_DtAddToResource(display, colorRes);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sync OW locale resources with CDE's use of the LANG environment variable
|
||||
*/
|
||||
void
|
||||
OWsyncLocaleResources(
|
||||
Display * display)
|
||||
{
|
||||
char localeRes[512];
|
||||
char * lang;
|
||||
|
||||
lang = getenv("LANG");
|
||||
if (lang == NULL || *lang == 0)
|
||||
lang = "C";
|
||||
|
||||
sprintf(localeRes,
|
||||
"OpenWindows.BasicLocale:\t%s\n\
|
||||
OpenWindows.InputLang:\t%s\n\
|
||||
OpenWindows.DisplayLang:\t%s\n\
|
||||
OpenWindows.TimeFormat:\t%s\n\
|
||||
OpenWindows.NumericFormat:\t%s\n",
|
||||
lang, lang, lang, lang, lang);
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr,"OWsyncLocaleResource: setting\n%s\n",localeRes);
|
||||
#endif
|
||||
|
||||
_DtAddToResource(display, localeRes);
|
||||
}
|
||||
23
cde/programs/dtstyle/OWsync.h
Normal file
23
cde/programs/dtstyle/OWsync.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/* $XConsortium: OWsync.h /main/2 1996/05/08 20:12:22 drk $ */
|
||||
/*******************************************************************************
|
||||
**
|
||||
** OWsync.h
|
||||
**
|
||||
** Defines functions to synchronize CDE and OpenWindows resources.
|
||||
**
|
||||
** Copyright 1995 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/*
|
||||
* External function declarations
|
||||
*/
|
||||
|
||||
extern void OWsyncColorResources(
|
||||
Display * display,
|
||||
int monitorType,
|
||||
ColorSet * colors);
|
||||
|
||||
extern void OWsyncLocaleResources(
|
||||
Display * display);
|
||||
|
||||
56
cde/programs/dtstyle/Palettes.src
Normal file
56
cde/programs/dtstyle/Palettes.src
Normal file
@@ -0,0 +1,56 @@
|
||||
! $XConsortium: Palettes.src /main/2 1995/07/20 12:05:51 drk $
|
||||
!######################################################################
|
||||
!#
|
||||
!# Palettes
|
||||
!#
|
||||
!# Common Desktop Environment (CDE)
|
||||
!#
|
||||
!# Palette file used for localization of backdrop names
|
||||
!#
|
||||
!# (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
!# (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
!# (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
!# (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary
|
||||
!# of Novell, Inc.
|
||||
!#
|
||||
!#
|
||||
!######################################################################
|
||||
|
||||
!###
|
||||
!#
|
||||
!# C palette names followed by message tags for the translated names
|
||||
!#
|
||||
!###
|
||||
|
||||
Palettes*Alpine.desc: %|nls-1-|
|
||||
Palettes*Arizona.desc: %|nls-2-|
|
||||
Palettes*Black.desc: %|nls-3-|
|
||||
Palettes*BlackWhite.desc: %|nls-4-|
|
||||
Palettes*Broica.desc: %|nls-5-|
|
||||
Palettes*Cabernet.desc: %|nls-6-|
|
||||
Palettes*Camouflage.desc: %|nls-7-|
|
||||
Palettes*Charcoal.desc: %|nls-8-|
|
||||
Palettes*Chocolate.desc: %|nls-9-|
|
||||
Palettes*Cinnamon.desc: %|nls-10-|
|
||||
Palettes*Clay.desc: %|nls-11-|
|
||||
Palettes*Default.desc: %|nls-12-|
|
||||
Palettes*Golden.desc: %|nls-13-|
|
||||
Palettes*GrayScale.desc: %|nls-14-|
|
||||
Palettes*Lilac.desc: %|nls-15-|
|
||||
Palettes*Mustard.desc: %|nls-16-|
|
||||
Palettes*Neptune.desc: %|nls-17-|
|
||||
Palettes*NorthernSky.desc: %|nls-18-|
|
||||
Palettes*Nutmeg.desc: %|nls-19-|
|
||||
Palettes*Olive.desc: %|nls-20-|
|
||||
Palettes*Orchid.desc: %|nls-21-|
|
||||
Palettes*Sand.desc: %|nls-22-|
|
||||
Palettes*SantaFe.desc: %|nls-23-|
|
||||
Palettes*Savannah.desc: %|nls-24-|
|
||||
Palettes*SeaFoam.desc: %|nls-25-|
|
||||
Palettes*SoftBlue.desc: %|nls-26-|
|
||||
Palettes*SouthWest.desc: %|nls-27-|
|
||||
Palettes*Tundra.desc: %|nls-28-|
|
||||
Palettes*Urchin.desc: %|nls-29-|
|
||||
Palettes*Wheat.desc: %|nls-30-|
|
||||
Palettes*White.desc: %|nls-31-|
|
||||
Palettes*WhiteBlack.desc: %|nls-32-|
|
||||
759
cde/programs/dtstyle/Protocol.c
Normal file
759
cde/programs/dtstyle/Protocol.c
Normal file
@@ -0,0 +1,759 @@
|
||||
/*$TOG: Protocol.c /main/6 1997/06/18 17:30:30 samborn $*/
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Protocol.c
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** Description: inter-client communication for Dtstyle
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
/*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1990, 1993, 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include files */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
#include <stdio.h>
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
#include <Xm/Protocols.h>
|
||||
|
||||
|
||||
#include <Dt/Connect.h>
|
||||
#include <Dt/SessionM.h>
|
||||
#include <Dt/SessionP.h>
|
||||
#include <Dt/Wsm.h>
|
||||
#include <Dt/WsmP.h>
|
||||
|
||||
#include "MainWin.h"
|
||||
#include "SaveRestore.h"
|
||||
#include "Main.h"
|
||||
|
||||
#include <Dt/Message.h>
|
||||
#include <Dt/UserMsg.h>
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include extern functions */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
#include "Protocol.h"
|
||||
|
||||
#ifndef CDE_INSTALLATION_TOP
|
||||
#define CDE_INSTALLATION_TOP "/opt/dt"
|
||||
#endif
|
||||
|
||||
#define WS_STARTUP_RETRY_COUNT 12
|
||||
#define WS_STARTUP_TIME 5000
|
||||
#define ERR1 ((char *)GETMESSAGE(2, 4, "Cannot communicate with the session\nmanager... Exiting."))
|
||||
#define ERR2 ((char *)GETMESSAGE(2, 9, "Could not obtain screen saver information\nfrom the session manager. Start up settings\nmay be incorrect."))
|
||||
|
||||
/*
|
||||
* Global variable definitions
|
||||
*/
|
||||
Window smWindow;
|
||||
|
||||
static Atom xaWmSaveYourself;
|
||||
static Atom xaWmDeleteWindow;
|
||||
|
||||
/* Atoms for client messages */
|
||||
static Atom xaSmStmProtocol;
|
||||
static Atom xaSmStateChange;
|
||||
static Atom xaSmRestoreDefault;
|
||||
static Atom xaSmLockChange;
|
||||
static Atom xaSmSaveToHome;
|
||||
|
||||
/* Atoms for window properties */
|
||||
static Atom xaDtSaveMode;
|
||||
static Atom xaDtSmAudioInfo;
|
||||
static Atom xaDtSmKeyboardInfo;
|
||||
static Atom xaDtSmPointerInfo;
|
||||
static Atom xaDtSmScreenInfo;
|
||||
static Atom xaDtSmFontInfo;
|
||||
static Atom xaDtSmPreeditInfo;
|
||||
|
||||
/* local function definitions */
|
||||
static void SmRestoreDefault(Atom);
|
||||
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* InitProtocol ()
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Handles interning of atoms for inter-client communication.
|
||||
* Color Server
|
||||
* Dtwm
|
||||
* Dtsession
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
void
|
||||
InitDtstyleProtocol( void )
|
||||
|
||||
{
|
||||
enum { XA_DT_SAVE_MODE, XA_WM_SAVE_YOURSELF, XA_WM_DELETE_WINDOW,
|
||||
XA_DT_SM_STM_PROTOCOL, XA_DT_SM_SAVE_TO_HOME,
|
||||
XA_DT_SM_STATE_CHANGE, XA_DT_SM_RESTORE_DEFAULT,
|
||||
XA_DT_SM_LOCK_CHANGE, XA_DT_SM_AUDIO_INFO,
|
||||
XA_DT_SM_SCREEN_INFO, XA_DT_SM_KEYBOARD_INFO,
|
||||
XA_DT_SM_POINTER_INFO, XA_DT_SM_FONT_INFO,
|
||||
XA_DT_SM_PREEDIT_INFO, NUM_ATOMS };
|
||||
static char *atom_names[] = {
|
||||
_XA_DT_SAVE_MODE, "WM_SAVE_YOURSELF", "WM_DELETE_WINDOW",
|
||||
_XA_DT_SM_STM_PROTOCOL, _XA_DT_SM_SAVE_TO_HOME,
|
||||
_XA_DT_SM_STATE_CHANGE, _XA_DT_SM_RESTORE_DEFAULT,
|
||||
_XA_DT_SM_LOCK_CHANGE, _XA_DT_SM_AUDIO_INFO,
|
||||
_XA_DT_SM_SCREEN_INFO, _XA_DT_SM_KEYBOARD_INFO,
|
||||
_XA_DT_SM_POINTER_INFO, _XA_DT_SM_FONT_INFO,
|
||||
_XA_DT_SM_PREEDIT_INFO };
|
||||
Atom atoms[XtNumber(atom_names)];
|
||||
|
||||
/* Get Session Manager Window ID for communication */
|
||||
|
||||
if (_DtGetSmWindow (style.display,
|
||||
XRootWindow(style.display,0),
|
||||
&smWindow) == Success)
|
||||
{
|
||||
if (_DtGetSmState (style.display, smWindow, &style.smState) != Success)
|
||||
{
|
||||
_DtSimpleError (progName, DtWarning, NULL, ERR1, NULL);
|
||||
exit(1);
|
||||
}
|
||||
if (_DtGetSmSaver (style.display, smWindow, &style.smSaver) != Success)
|
||||
_DtSimpleError (progName, DtWarning, NULL, ERR2, NULL);
|
||||
}
|
||||
else smWindow = 0;
|
||||
|
||||
|
||||
XInternAtoms(style.display, atom_names, XtNumber(atom_names), False, atoms);
|
||||
|
||||
xaDtSaveMode = atoms[XA_DT_SAVE_MODE];
|
||||
xaWmSaveYourself = atoms[XA_WM_SAVE_YOURSELF];
|
||||
xaWmDeleteWindow = atoms[XA_WM_DELETE_WINDOW];
|
||||
xaSmStmProtocol = atoms[XA_DT_SM_STM_PROTOCOL];
|
||||
xaSmSaveToHome = atoms[XA_DT_SM_SAVE_TO_HOME];
|
||||
xaSmStateChange = atoms[XA_DT_SM_STATE_CHANGE];
|
||||
xaSmRestoreDefault = atoms[XA_DT_SM_RESTORE_DEFAULT];
|
||||
xaSmLockChange = atoms[XA_DT_SM_LOCK_CHANGE];
|
||||
xaDtSmAudioInfo = atoms[XA_DT_SM_AUDIO_INFO];
|
||||
xaDtSmScreenInfo = atoms[XA_DT_SM_SCREEN_INFO];
|
||||
xaDtSmKeyboardInfo = atoms[XA_DT_SM_KEYBOARD_INFO];
|
||||
xaDtSmPointerInfo = atoms[XA_DT_SM_POINTER_INFO];
|
||||
xaDtSmFontInfo = atoms[XA_DT_SM_FONT_INFO];
|
||||
xaDtSmPreeditInfo = atoms[XA_DT_SM_PREEDIT_INFO];
|
||||
|
||||
}
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* SetWindowProperites ()
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Add the WM_DELETE_WINDOW and WM_SAVE_YOURSELF properties to the
|
||||
* dtstyle main window
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
void
|
||||
SetWindowProperties( void )
|
||||
{
|
||||
|
||||
/* Add WM_SAVE_YOURSELF property to the main window */
|
||||
XmAddWMProtocolCallback(style.shell, xaWmSaveYourself, saveSessionCB, NULL);
|
||||
|
||||
/* Add WM_DELETE_WINDOW property to the main window */
|
||||
XmAddWMProtocolCallback(style.shell, xaWmDeleteWindow, activateCB_exitBtn, NULL);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* HandleWorkspaceChange
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Do processing required when workspace changes. A DtWsmWsChangeProc.
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
static void
|
||||
HandleWorkspaceChange (
|
||||
Widget widget,
|
||||
Atom aWs,
|
||||
Pointer client_data)
|
||||
{
|
||||
CheckWorkspace (); /* Backdrop may need to update colors */
|
||||
}
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* ListenForWorkspaceChange ()
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
*
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
void
|
||||
ListenForWorkspaceChange( void )
|
||||
{
|
||||
|
||||
DtWsmAddCurrentWorkspaceCallback (style.shell,
|
||||
(DtWsmWsChangeProc) HandleWorkspaceChange, NULL);
|
||||
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* WorkspaceStartupTimer()
|
||||
*
|
||||
* Check to see if the workspace manager is ready
|
||||
************************************************************************/
|
||||
static void
|
||||
WorkspaceStartupTimer(
|
||||
XtPointer client_data,
|
||||
XtIntervalId *id)
|
||||
{
|
||||
Atom aWS;
|
||||
int count = (int) client_data;
|
||||
|
||||
if (DtWsmGetCurrentWorkspace (style.display, style.root, &aWS)
|
||||
== Success)
|
||||
{
|
||||
/*
|
||||
* OK, the workspace manager is ready. Get the
|
||||
* colors and redraw the bitmap.
|
||||
*/
|
||||
CheckWorkspace ();
|
||||
}
|
||||
else if (--count > 0)
|
||||
{
|
||||
/* wait a little longer for the workspace manager */
|
||||
client_data = (XtPointer) count;
|
||||
(void) XtAppAddTimeOut (XtWidgetToApplicationContext(style.shell),
|
||||
WS_STARTUP_TIME, WorkspaceStartupTimer, client_data);
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* ReparentNotify ()
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Dtstyle has been reparented.
|
||||
* The parenting happens twice when the window manager has been restarted.
|
||||
* First Dtstyle gets reparented to the root window, then reparented to
|
||||
* the window manager.
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
void
|
||||
MwmReparentNotify(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XEvent *event )
|
||||
{
|
||||
if ((event->type == ReparentNotify) &&
|
||||
(event->xreparent.parent != style.root))
|
||||
{
|
||||
if (style.backdropDialog && XtIsManaged(style.backdropDialog))
|
||||
{
|
||||
client_data = (XtPointer) WS_STARTUP_RETRY_COUNT;
|
||||
(void) XtAppAddTimeOut (XtWidgetToApplicationContext(style.shell),
|
||||
WS_STARTUP_TIME, WorkspaceStartupTimer, client_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* GetSessionSaveMode ()
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Get the session save mode from the Session Manager
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
void
|
||||
GetSessionSaveMode(
|
||||
unsigned char **mode )
|
||||
{
|
||||
|
||||
Atom actualType;
|
||||
int actualFormat;
|
||||
unsigned long nitems;
|
||||
unsigned long leftover;
|
||||
|
||||
XGetWindowProperty(style.display, RootWindow(style.display, 0),
|
||||
xaDtSaveMode,0L,
|
||||
(long)BUFSIZ,False,AnyPropertyType,&actualType,
|
||||
&actualFormat,&nitems,&leftover,
|
||||
mode);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* SmSaveHomeSession ()
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Tell Session Manager to save the home session
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
void
|
||||
SmSaveHomeSession(
|
||||
int origStartState,
|
||||
int origConfirmMode)
|
||||
{
|
||||
XClientMessageEvent stmToSmMessage;
|
||||
|
||||
if (smWindow != 0)
|
||||
{
|
||||
/*
|
||||
* Tell session manager save home state using current smStartState
|
||||
* and smConfirmMode. Note that the session state will retain the
|
||||
* original smStartState and smConfirmMode values.
|
||||
*/
|
||||
stmToSmMessage.type = ClientMessage;
|
||||
stmToSmMessage.window = smWindow;
|
||||
stmToSmMessage.message_type = xaSmStmProtocol;
|
||||
stmToSmMessage.format = 32;
|
||||
stmToSmMessage.data.l[0] = xaSmSaveToHome;
|
||||
stmToSmMessage.data.l[1] = style.smState.smStartState;
|
||||
stmToSmMessage.data.l[2] = style.smState.smConfirmMode;
|
||||
stmToSmMessage.data.l[3] = CurrentTime;
|
||||
XSendEvent(style.display, smWindow, False, NoEventMask,
|
||||
(XEvent *) &stmToSmMessage);
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* SmNewStartupSettings ()
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Tell Session Manager about new Startup settings
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
void
|
||||
SmNewStartupSettings( void )
|
||||
{
|
||||
SmStateInfo state;
|
||||
|
||||
if (smWindow != 0)
|
||||
{
|
||||
state.flags = SM_STATE_START | SM_STATE_CONFIRM;
|
||||
state.smStartState = style.smState.smStartState;
|
||||
state.smConfirmMode = style.smState.smConfirmMode;
|
||||
_DtSetSmState(style.display, smWindow, &state);
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* SmRestoreDefault ()
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Tell Session Manager to restore the default value to one of the settings
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
static void
|
||||
SmRestoreDefault(Atom toRestore)
|
||||
{
|
||||
XClientMessageEvent stmToSmMessage;
|
||||
|
||||
if (smWindow != 0)
|
||||
{
|
||||
stmToSmMessage.type = ClientMessage;
|
||||
stmToSmMessage.window = smWindow;
|
||||
stmToSmMessage.message_type = xaSmStmProtocol;
|
||||
stmToSmMessage.format = 32;
|
||||
stmToSmMessage.data.l[0] = xaSmRestoreDefault;
|
||||
stmToSmMessage.data.l[1] = toRestore;
|
||||
stmToSmMessage.data.l[2] = CurrentTime;
|
||||
XSendEvent(style.display, smWindow, False, NoEventMask,
|
||||
(XEvent *) &stmToSmMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* SmDefaultAudioSettings ()
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Tell Session Manager to set default Xserver audio settings
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
void
|
||||
SmDefaultAudioSettings( void )
|
||||
{
|
||||
if (smWindow != 0)
|
||||
{
|
||||
/* Delete the property to indicate default settings to SM */
|
||||
SmRestoreDefault(xaDtSmAudioInfo);
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* SmNewAudioSettings ()
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Tell Session Manager about new Xserver audio settings
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
void
|
||||
SmNewAudioSettings(
|
||||
int volume,
|
||||
int tone,
|
||||
int duration )
|
||||
{
|
||||
|
||||
PropDtSmAudioInfo audioProp;
|
||||
|
||||
if (smWindow != 0)
|
||||
{
|
||||
/*
|
||||
* Set the property on the Session Manager window
|
||||
* indicating the new screen saver settings
|
||||
*/
|
||||
|
||||
audioProp.flags = 0;
|
||||
audioProp.smBellPercent = (CARD32) volume;
|
||||
audioProp.smBellPitch = (CARD32) tone;
|
||||
audioProp.smBellDuration = (CARD32) duration;
|
||||
XChangeProperty (style.display, smWindow,
|
||||
xaDtSmAudioInfo,
|
||||
xaDtSmAudioInfo,
|
||||
32, PropModeReplace,
|
||||
(unsigned char *)&audioProp,
|
||||
PROP_DT_SM_AUDIO_INFO_ELEMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* SmDefaultScreenSettings ()
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Tell Session Manager to set default Xserver screen settings
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
void
|
||||
SmDefaultScreenSettings( void )
|
||||
{
|
||||
if (smWindow != 0)
|
||||
{
|
||||
/* Delete the property to indicate default settings to SM */
|
||||
SmRestoreDefault(xaDtSmScreenInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* SmNewScreenSettings ()
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Tell Session Manager about new Xserver screen settings
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
void
|
||||
SmNewScreenSettings(
|
||||
int timeout,
|
||||
int blanking,
|
||||
int interval,
|
||||
int exposures )
|
||||
|
||||
{
|
||||
|
||||
PropDtSmScreenInfo screenProp;
|
||||
|
||||
if (smWindow != 0)
|
||||
{
|
||||
/*
|
||||
* Set the property on the Session Manager window
|
||||
* indicating the new screen saver settings
|
||||
*/
|
||||
|
||||
screenProp.flags = 0;
|
||||
screenProp.smTimeout = (CARD32) timeout; /* 0-7200 */
|
||||
screenProp.smInterval = (CARD32) interval; /* -1 */
|
||||
screenProp.smPreferBlank = (CARD32) blanking; /* 0,1 */
|
||||
screenProp.smAllowExp = (CARD32) exposures;
|
||||
XChangeProperty (style.display, smWindow,
|
||||
xaDtSmScreenInfo,
|
||||
xaDtSmScreenInfo,
|
||||
32, PropModeReplace,
|
||||
(unsigned char *)&screenProp,
|
||||
PROP_DT_SM_SCREEN_INFO_ELEMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* SmNewSaverSettings ()
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Tell Session Manager about new saver settings:
|
||||
* saver timeout, lock timeout, cycle timeout, selected saver list
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
void
|
||||
SmNewSaverSettings(
|
||||
int saverTime,
|
||||
int lockTime,
|
||||
int cycleTime,
|
||||
char *selsaversList)
|
||||
{
|
||||
SmStateInfo state; /* structure that will contain new state info */
|
||||
SmSaverInfo saver; /* structure that will contain selected saver list */
|
||||
|
||||
int saverTime_change; /* saver timeout */
|
||||
int lockTime_change; /* lock timeout */
|
||||
int cycleTime_change; /* saver timeout */
|
||||
|
||||
if (smWindow != 0)
|
||||
{
|
||||
lockTime_change = (style.smState.smLockTimeout != lockTime);
|
||||
saverTime_change = (style.smState.smSaverTimeout != saverTime);
|
||||
cycleTime_change = (style.smState.smCycleTimeout != cycleTime);
|
||||
state.flags = (saverTime_change ? SM_STATE_SAVERTIMEOUT : 0) |
|
||||
(lockTime_change ? SM_STATE_LOCKTIMEOUT : 0) |
|
||||
(cycleTime_change ? SM_STATE_CYCLETIMEOUT : 0);
|
||||
|
||||
if (state.flags)
|
||||
{
|
||||
state.smSaverTimeout = saverTime;
|
||||
state.smLockTimeout = lockTime;
|
||||
state.smCycleTimeout = cycleTime;
|
||||
|
||||
_DtSetSmState(style.display, smWindow, &state);
|
||||
}
|
||||
saver.saverList = selsaversList;
|
||||
_DtSetSmSaver(style.display, smWindow, &saver);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* SmNewSaverTime()
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Tell Session Manager about new saver timeout
|
||||
* used for telling the session manager if it should run savers or not when
|
||||
* the user enables/disables saver toggle (or the savers toggle in no saver
|
||||
* extension mode) without having to press OK. A zero is sent to the session
|
||||
* manager when no savers should be run.
|
||||
*************************************<->***********************************/
|
||||
void
|
||||
SmNewSaverTime(int saverTime)
|
||||
{
|
||||
SmStateInfo state; /* structure that will contain new state info */
|
||||
|
||||
if (smWindow != 0)
|
||||
{
|
||||
state.flags = SM_STATE_SAVERTIMEOUT;
|
||||
state.smSaverTimeout = saverTime;
|
||||
_DtSetSmState(style.display, smWindow, &state);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* SmDefaultKeyboardSettings ()
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Tell Session Manager to set default Xserver Keyboard settings
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
void
|
||||
SmDefaultKeyboardSettings( void )
|
||||
{
|
||||
if (smWindow != 0)
|
||||
{
|
||||
/* Delete the property to indicate default settings to SM */
|
||||
SmRestoreDefault(xaDtSmKeyboardInfo);
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* SmNewKeyboardSettings ()
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Tell Session Manager about new Xserver Keyboard settings
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
void
|
||||
SmNewKeyboardSettings(
|
||||
int keyClickPercent,
|
||||
int autoRepeat)
|
||||
{
|
||||
|
||||
PropDtSmKeyboardInfo KeyboardProp;
|
||||
|
||||
if (smWindow != 0)
|
||||
{
|
||||
/*
|
||||
* Set the property on the Session Manager window
|
||||
* indicating the new screen saver settings
|
||||
*/
|
||||
|
||||
KeyboardProp.flags = 0;
|
||||
KeyboardProp.smKeyClickPercent = (CARD32) keyClickPercent;
|
||||
KeyboardProp.smGlobalAutoRepeat = (CARD32) autoRepeat;
|
||||
XChangeProperty (style.display, smWindow,
|
||||
xaDtSmKeyboardInfo,
|
||||
xaDtSmKeyboardInfo,
|
||||
32, PropModeReplace,
|
||||
(unsigned char *)&KeyboardProp,
|
||||
PROP_DT_SM_KEYBOARD_INFO_ELEMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* SmDefaultPointerSettings ()
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Tell Session Manager to set default Xserver Pointer settings
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
void
|
||||
SmDefaultPointerSettings( void )
|
||||
{
|
||||
if (smWindow != 0)
|
||||
{
|
||||
/* Delete the property to indicate default settings to SM */
|
||||
SmRestoreDefault(xaDtSmPointerInfo);
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* SmNewPointerSettings ()
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Tell Session Manager about new Xserver Pointer settings
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
void
|
||||
SmNewPointerSettings(
|
||||
char *pointerString)
|
||||
{
|
||||
|
||||
if (smWindow != 0)
|
||||
{
|
||||
/*
|
||||
* Set the property on the Session Manager window
|
||||
* indicating the new screen saver settings
|
||||
*/
|
||||
|
||||
XChangeProperty (style.display, smWindow,
|
||||
xaDtSmPointerInfo,
|
||||
XA_STRING,
|
||||
8, PropModeReplace,
|
||||
(unsigned char *)pointerString,
|
||||
strlen(pointerString));
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* SmNewPreeditSettings ()
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Tell Session Manager about new preeditType resources
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
void
|
||||
SmNewPreeditSettings(
|
||||
char *preeditResourceString)
|
||||
{
|
||||
|
||||
|
||||
if (smWindow != 0)
|
||||
{
|
||||
/*
|
||||
* Set the property on the Session Manager window
|
||||
* indicating the new font resource string
|
||||
*/
|
||||
|
||||
XChangeProperty (style.display, smWindow,
|
||||
xaDtSmPreeditInfo,
|
||||
XA_STRING,
|
||||
8, PropModeReplace,
|
||||
(unsigned char *)preeditResourceString,
|
||||
strlen(preeditResourceString));
|
||||
}
|
||||
}
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* SmNewFontSettings ()
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Tell Session Manager about new font resources
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
void
|
||||
SmNewFontSettings(
|
||||
char *fontResourceString)
|
||||
{
|
||||
|
||||
|
||||
if (smWindow != 0)
|
||||
{
|
||||
/*
|
||||
* Set the property on the Session Manager window
|
||||
* indicating the new font resource string
|
||||
*/
|
||||
|
||||
XChangeProperty (style.display, smWindow,
|
||||
xaDtSmFontInfo,
|
||||
XA_STRING,
|
||||
8, PropModeReplace,
|
||||
(unsigned char *)fontResourceString,
|
||||
strlen(fontResourceString));
|
||||
}
|
||||
}
|
||||
|
||||
75
cde/programs/dtstyle/Protocol.h
Normal file
75
cde/programs/dtstyle/Protocol.h
Normal file
@@ -0,0 +1,75 @@
|
||||
/* $XConsortium: Protocol.h /main/5 1996/03/25 00:53:06 pascale $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Protocol.h
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** This file contains function definitions for the corresponding .c
|
||||
** file
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
/*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1990, 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
|
||||
#ifndef _protocol_h
|
||||
#define _protocol_h
|
||||
|
||||
extern Window smWindow;
|
||||
|
||||
|
||||
/* External Interface */
|
||||
|
||||
|
||||
extern void MwmReparentNotify(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XEvent *event ) ;
|
||||
extern void InitDtstyleProtocol( void ) ;
|
||||
extern void GetSessionSaveMode( unsigned char **mode ) ;
|
||||
extern void SetWindowProperties( void ) ;
|
||||
extern void SmSaveHomeSession(
|
||||
int origStartState,
|
||||
int origConfirmMode);
|
||||
extern void SmDefaultAudioSettings( void ) ;
|
||||
extern void SmDefaultScreenSettings( void ) ;
|
||||
extern void SmDefaultKeyboardSettings( void ) ;
|
||||
extern void SmNewAudioSettings(
|
||||
int volume,
|
||||
int tone,
|
||||
int duration ) ;
|
||||
|
||||
extern void SmNewScreenSettings(
|
||||
int timeout,
|
||||
int blanking,
|
||||
int interval,
|
||||
int exposures ) ;
|
||||
extern void SmNewLockSettings(
|
||||
int lock,
|
||||
int cover ) ;
|
||||
|
||||
extern void SmNewKeyboardSettings(
|
||||
int keyClickPercent,
|
||||
int autoRepeat) ;
|
||||
extern void SmNewPointerSettings(
|
||||
char *pointerString) ;
|
||||
extern void SmNewStartupSettings( void ) ;
|
||||
extern void SmNewFontSettings(
|
||||
char *fontResourceString) ;
|
||||
|
||||
extern void SmNewPreeditSettings(
|
||||
char *preeditResourceString) ;
|
||||
|
||||
|
||||
#endif /* _protocol_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
313
cde/programs/dtstyle/Resource.c
Normal file
313
cde/programs/dtstyle/Resource.c
Normal file
@@ -0,0 +1,313 @@
|
||||
/* $XConsortium: Resource.c /main/6 1996/07/19 10:21:08 pascale $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Resource.c
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** Description: Controls the Dtstyle resources
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
/*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1990, 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include files */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/XmP.h>
|
||||
|
||||
#include "Main.h"
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include extern functions */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
#include "Resource.h"
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Local #defines */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
#define DEF_FONT "Fixed"
|
||||
|
||||
#ifndef CDE_INSTALLATION_TOP
|
||||
#define CDE_INSTALLATION_TOP "/opt/dt"
|
||||
#endif
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Internal Functions */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Internal Variables */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Application Resources */
|
||||
/*++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
XtResource sysFont_resources[] = {
|
||||
|
||||
{"systemFont1", "SystemFont1", XmRFontList, sizeof (XmFontList),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[0].sysFont), XmRString,
|
||||
"-adobe-helvetica-medium-r-normal--10-*-iso8859-1"
|
||||
},
|
||||
{"systemFont2", "SystemFont2", XmRFontList, sizeof (XmFontList),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[1].sysFont), XmRString,
|
||||
"-adobe-helvetica-medium-r-normal--12-*-iso8859-1"
|
||||
},
|
||||
{"systemFont3", "SystemFont3", XmRFontList, sizeof (XmFontList),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[2].sysFont), XmRString,
|
||||
"-adobe-helvetica-medium-r-normal--14-*-iso8859-1"
|
||||
},
|
||||
{"systemFont4", "SystemFont4", XmRFontList, sizeof (XmFontList),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[3].sysFont), XmRString,
|
||||
"-adobe-helvetica-medium-r-normal--17-*-iso8859-1"
|
||||
},
|
||||
{"systemFont5", "SystemFont5", XmRFontList, sizeof (XmFontList),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[4].sysFont), XmRString,
|
||||
"-adobe-helvetica-medium-r-normal--18-*-iso8859-1"
|
||||
},
|
||||
{"systemFont6", "SystemFont6", XmRFontList, sizeof (XmFontList),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[5].sysFont), XmRString,
|
||||
"-adobe-helvetica-medium-r-normal--20-*-iso8859-1"
|
||||
},
|
||||
{"systemFont7", "SystemFont7", XmRFontList, sizeof (XmFontList),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[6].sysFont), XmRString,
|
||||
"-adobe-helvetica-medium-r-normal--24-*-iso8859-1"
|
||||
},
|
||||
};
|
||||
|
||||
XtResource userFont_resources[] = {
|
||||
|
||||
{"userFont1", "UserFont1", XmRFontList, sizeof (XmFontList),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[0].userFont), XmRString,
|
||||
"-adobe-courier-medium-r-normal--10-*-iso8859-1"
|
||||
},
|
||||
{"userFont2", "UserFont2", XmRFontList, sizeof (XmFontList),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[1].userFont), XmRString,
|
||||
"-adobe-courier-medium-r-normal--12-*-iso8859-1"
|
||||
},
|
||||
{"userFont3", "UserFont3", XmRFontList, sizeof (XmFontList),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[2].userFont), XmRString,
|
||||
"-adobe-courier-medium-r-normal--14-*-iso8859-1"
|
||||
},
|
||||
{"userFont4", "UserFont4", XmRFontList, sizeof (XmFontList),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[3].userFont), XmRString,
|
||||
"-adobe-courier-medium-r-normal--17-*-iso8859-1"
|
||||
},
|
||||
{"userFont5", "UserFont5", XmRFontList, sizeof (XmFontList),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[4].userFont), XmRString,
|
||||
"-adobe-courier-medium-r-normal--18-*-iso8859-1"
|
||||
},
|
||||
{"userFont6", "UserFont6", XmRFontList, sizeof (XmFontList),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[5].userFont), XmRString,
|
||||
"-adobe-courier-medium-r-normal--20-*-iso8859-1"
|
||||
},
|
||||
{"userFont7", "UserFont7", XmRFontList, sizeof (XmFontList),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[6].userFont), XmRString,
|
||||
"-adobe-courier-medium-r-normal--24-*-iso8859-1"
|
||||
},
|
||||
};
|
||||
|
||||
XtResource sysStr_resources[] = {
|
||||
|
||||
{"systemFont1", "SystemFont1", XmRString, sizeof (XmString),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[0].sysStr), XmRString,
|
||||
"-adobe-helvetica-medium-r-normal--10-*-iso8859-1"
|
||||
},
|
||||
{"systemFont2", "SystemFont2", XmRString, sizeof (XmString),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[1].sysStr), XmRString,
|
||||
"-adobe-helvetica-medium-r-normal--12-*-iso8859-1"
|
||||
},
|
||||
{"systemFont3", "SystemFont3", XmRString, sizeof (XmString),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[2].sysStr), XmRString,
|
||||
"-adobe-helvetica-medium-r-normal--14-*-iso8859-1"
|
||||
},
|
||||
{"systemFont4", "SystemFont4", XmRString, sizeof (XmString),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[3].sysStr), XmRString,
|
||||
"-adobe-helvetica-medium-r-normal--17-*-iso8859-1"
|
||||
},
|
||||
{"systemFont5", "SystemFont5", XmRString, sizeof (XmString),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[4].sysStr), XmRString,
|
||||
"-adobe-helvetica-medium-r-normal--18-*-iso8859-1"
|
||||
},
|
||||
{"systemFont6", "SystemFont6", XmRString, sizeof (XmString),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[5].sysStr), XmRString,
|
||||
"-adobe-helvetica-medium-r-normal--20-*-iso8859-1"
|
||||
},
|
||||
{"systemFont7", "SystemFont7", XmRString, sizeof (XmString),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[6].sysStr), XmRString,
|
||||
"-adobe-helvetica-medium-r-normal--24-*-iso8859-1"
|
||||
},
|
||||
};
|
||||
|
||||
XtResource userStr_resources[] = {
|
||||
|
||||
{"userFont1", "UserFont1", XmRString, sizeof (XmString),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[0].userStr), XmRString,
|
||||
"-adobe-courier-medium-r-normal--10-*-iso8859-1"
|
||||
},
|
||||
{"userFont2", "UserFont2", XmRString, sizeof (XmString),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[1].userStr), XmRString,
|
||||
"-adobe-courier-medium-r-normal--12-*-iso8859-1"
|
||||
},
|
||||
{"userFont3", "UserFont3", XmRString, sizeof (XmString),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[2].userStr), XmRString,
|
||||
"-adobe-courier-medium-r-normal--14-*-iso8859-1"
|
||||
},
|
||||
{"userFont4", "UserFont4", XmRString, sizeof (XmString),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[3].userStr), XmRString,
|
||||
"-adobe-courier-medium-r-normal--17-*-iso8859-1"
|
||||
},
|
||||
{"userFont5", "UserFont5", XmRString, sizeof (XmString),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[4].userStr), XmRString,
|
||||
"-adobe-courier-medium-r-normal--18-*-iso8859-1"
|
||||
},
|
||||
{"userFont6", "UserFont6", XmRString, sizeof (XmString),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[5].userStr), XmRString,
|
||||
"-adobe-courier-medium-r-normal--20-*-iso8859-1"
|
||||
},
|
||||
{"userFont7", "UserFont7", XmRString, sizeof (XmString),
|
||||
XtOffset(ApplicationDataPtr, fontChoice[6].userStr), XmRString,
|
||||
"-adobe-courier-medium-r-normal--24-*-iso8859-1"
|
||||
},
|
||||
};
|
||||
|
||||
XtResource resources[] = {
|
||||
|
||||
{"numFonts", "NumFonts", XmRInt, sizeof (int),
|
||||
XtOffset(ApplicationDataPtr, numFonts), XmRImmediate, (caddr_t) 7
|
||||
},
|
||||
{"systemFont", "SystemFont", XmRFontList, sizeof (XmFontList),
|
||||
XtOffset(ApplicationDataPtr, systemFont), XmRString, "Fixed"
|
||||
},
|
||||
{"userFont", "UserFont", XmRFontList, sizeof (XmFontList),
|
||||
XtOffset(ApplicationDataPtr, userFont), XmRString, "Fixed"
|
||||
},
|
||||
{"systemFont", "SystemFont", XmRString, sizeof (XmString),
|
||||
XtOffset(ApplicationDataPtr, systemFontStr), XmRString, DEF_FONT
|
||||
},
|
||||
{"userFont", "UserFont", XmRString, sizeof (XmString),
|
||||
XtOffset(ApplicationDataPtr, userFontStr), XmRString, DEF_FONT
|
||||
},
|
||||
|
||||
{"session", "Session", XmRString, sizeof (char *),
|
||||
XtOffset (ApplicationDataPtr, session), XmRImmediate, (XtPointer)NULL,
|
||||
},
|
||||
{"backdropDirectories", "BackdropDirectories", XmRString, sizeof(char *),
|
||||
XtOffset(ApplicationDataPtr, backdropDir), XmRString, NULL
|
||||
},
|
||||
{"paletteDirectories", "PaletteDirectories", XmRString, sizeof(char *),
|
||||
XtOffset(ApplicationDataPtr, paletteDir), XmRString, NULL
|
||||
},
|
||||
{"timeoutScale", "TimeoutScale", XmRString, sizeof (String),
|
||||
XtOffset(ApplicationDataPtr, timeoutScale), XmRString, "10"
|
||||
},
|
||||
{"lockoutScale", "LockoutScale", XmRString, sizeof (String),
|
||||
XtOffset(ApplicationDataPtr, lockoutScale), XmRString, "30"
|
||||
},
|
||||
{"writeXrdbImmediate", "WriteXrdbImmediate", XmRBoolean, sizeof(Boolean) ,
|
||||
XtOffset(ApplicationDataPtr, writeXrdbImmediate), XmRImmediate, (XtPointer)True
|
||||
},
|
||||
{"writeXrdbColors", "WriteXrdbColors", XmRBoolean, sizeof(Boolean) ,
|
||||
XtOffset(ApplicationDataPtr, writeXrdbColors), XmRImmediate, (XtPointer)True
|
||||
},
|
||||
{"componentList", "ComponentList", XtRString, sizeof(String) ,
|
||||
XtOffset(ApplicationDataPtr, componentList), XmRImmediate,
|
||||
"Color Font Backdrop Keyboard Mouse Audio Screen Dtwm Startup"
|
||||
},
|
||||
{"imServerHosts", "ImServerHosts", XmRXmStringTable, sizeof(XmStringTable) ,
|
||||
XtOffset(ApplicationDataPtr, imServerHosts), XmRImmediate,
|
||||
NULL
|
||||
},
|
||||
{"preeditType", "PreeditType", XmRXmStringTable, sizeof(XmStringTable) ,
|
||||
XtOffset(ApplicationDataPtr, preeditType), XmRString,
|
||||
"OnTheSpot,OverTheSpot,OffTheSpot,Root"
|
||||
},
|
||||
{"pipeTimeOut", "PipeTimeOut", XmRInt, sizeof (int),
|
||||
XtOffset(ApplicationDataPtr, pipeTimeOut), XmRImmediate, (caddr_t) 100
|
||||
},
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
* GetSysFontResources
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* This function is used to retrieve the Dtstyle System Font resources
|
||||
************************************************************************/
|
||||
void
|
||||
GetSysFontResource(int i)
|
||||
{
|
||||
XtGetApplicationResources(style.shell, &style.xrdb,
|
||||
&sysFont_resources[i],
|
||||
1, NULL, 0);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* GetUserFontResources
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* This function is used to retrieve the Dtstyle User Font resources
|
||||
************************************************************************/
|
||||
void
|
||||
GetUserFontResource(int i)
|
||||
{
|
||||
XtGetApplicationResources(style.shell, &style.xrdb,
|
||||
&userFont_resources[i],
|
||||
1, NULL, 0);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* GetFontStrResources
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
************************************************************************/
|
||||
static void
|
||||
GetFontStrResources( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
XtGetApplicationResources(style.shell, &style.xrdb, sysStr_resources,
|
||||
XtNumber(sysStr_resources), NULL, 0);
|
||||
XtGetApplicationResources(style.shell, &style.xrdb, userStr_resources,
|
||||
XtNumber(userStr_resources), NULL, 0);
|
||||
for (i=0; i<style.xrdb.numFonts; i++) {
|
||||
style.xrdb.fontChoice[i].userFont = NULL;
|
||||
style.xrdb.fontChoice[i].sysFont = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* GetApplicationResources
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* This function is used to retrieve Dtstyle resources that are
|
||||
* not component-specific.
|
||||
************************************************************************/
|
||||
void
|
||||
GetApplicationResources( void )
|
||||
{
|
||||
XtGetApplicationResources(style.shell, &style.xrdb, resources,
|
||||
XtNumber(resources), NULL, 0);
|
||||
GetFontStrResources();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
33
cde/programs/dtstyle/Resource.h
Normal file
33
cde/programs/dtstyle/Resource.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/* $XConsortium: Resource.h /main/4 1995/10/30 13:12:06 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Resource.h
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** This file contains function definitions for the corresponding .c
|
||||
** file
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _resource_h
|
||||
#define _resource_h
|
||||
|
||||
/* External Interface */
|
||||
|
||||
|
||||
extern void GetUserFontResource(int);
|
||||
extern void GetSysFontResource(int);
|
||||
|
||||
extern void GetApplicationResources( void ) ;
|
||||
extern void AddResourceConverters( void ) ;
|
||||
|
||||
|
||||
#endif /* _resource_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
200
cde/programs/dtstyle/SaveRestore.c
Normal file
200
cde/programs/dtstyle/SaveRestore.c
Normal file
@@ -0,0 +1,200 @@
|
||||
/*$XConsortium: SaveRestore.c /main/5 1996/03/25 00:53:19 pascale $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: SaveRestore.c
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** Description: Controls the Dtstyle Save/Restore functionality
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
/*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1990, 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include files */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/XmP.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/PushBG.h>
|
||||
#include <Xm/Scale.h>
|
||||
|
||||
#include <Dt/DialogBox.h>
|
||||
|
||||
#include <Dt/HourGlass.h>
|
||||
#include <Dt/UserMsg.h>
|
||||
|
||||
#include "Main.h"
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include extern functions */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
#include "SaveRestore.h"
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Local #defines */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
#define MSG1 ((char *)GETMESSAGE(10, 1, "Check file permissions."))
|
||||
#define MSG2 ((char *)GETMESSAGE(10, 3, "%s is the file that would have been used to save your session\n"))
|
||||
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* saveSessionCB
|
||||
* Creates a file as a resource data base, and writes out all
|
||||
* info needed to save our current state. This info will be used
|
||||
* later by restoreSession to start up the help system in the exact
|
||||
* state in which we saved the session.
|
||||
*
|
||||
************************************************************************/
|
||||
void
|
||||
saveSessionCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
char *longpath, *name;
|
||||
int fd, n;
|
||||
char *xa_CommandStr[3];
|
||||
unsigned char *data = NULL;
|
||||
char *tmpStr;
|
||||
|
||||
#ifdef _SUN_OS
|
||||
char *noCommands = NULL;
|
||||
#endif /* _SUN_OS */
|
||||
|
||||
/* get the root window property of SaveMode */
|
||||
GetSessionSaveMode(&data );
|
||||
|
||||
/* if the property is "home" don't save dtstyle */
|
||||
if(strcmp((char *)data, "home") == 0)
|
||||
{
|
||||
#ifdef _SUN_OS /* Sun doesn't like "NULL" when expecting "char **" */
|
||||
XSetCommand(style.display, XtWindow(w), &noCommands, 0);
|
||||
#else
|
||||
XSetCommand(style.display, XtWindow(w), NULL, 0);
|
||||
#endif /* _SUN_OS */
|
||||
return;
|
||||
}
|
||||
|
||||
/* Xt may not pass a widget as advertised */
|
||||
if(!XtIsShell(w))
|
||||
DtSessionSavePath(XtParent(w), &longpath, &name);
|
||||
else
|
||||
DtSessionSavePath(w, &longpath, &name);
|
||||
|
||||
/* Create the session file */
|
||||
if ((fd = creat (longpath, S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP)) == -1)
|
||||
{
|
||||
tmpStr = (char *)XtMalloc(strlen(MSG2) + strlen(longpath)+ 1);
|
||||
sprintf(tmpStr, MSG2, longpath);
|
||||
_DtSimpleErrnoError(progName,DtError, MSG1, tmpStr, NULL);
|
||||
XtFree(tmpStr);
|
||||
XtFree ((char *)longpath);
|
||||
XtFree ((char *)name);
|
||||
return;
|
||||
}
|
||||
|
||||
/*write out each needed resource*/
|
||||
saveMain(fd);
|
||||
saveColor(fd);
|
||||
saveColorEdit(fd);
|
||||
saveFonts(fd);
|
||||
saveBackdrop(fd);
|
||||
saveKeybd(fd);
|
||||
saveMouse(fd);
|
||||
saveAudio(fd);
|
||||
saveScreen(fd);
|
||||
saveDtwm(fd);
|
||||
saveStartup(fd);
|
||||
saveI18n(fd);
|
||||
|
||||
close (fd);
|
||||
|
||||
/*If this is a session manager requested saveYrSlf, need to put dialogs in*/
|
||||
/*recoverable state, and make them consistent with server (etc) state.*/
|
||||
/*Have to do it before exit so SM gets corrected server state.*/
|
||||
callCancels();
|
||||
|
||||
n = 0;
|
||||
xa_CommandStr[n] = style.execName; n++;
|
||||
xa_CommandStr[n] = "-session"; n++;
|
||||
xa_CommandStr[n] = name; n++;
|
||||
|
||||
XSetCommand(style.display, XtWindow(w), xa_CommandStr, n);
|
||||
XtFree ((char *)longpath);
|
||||
XtFree ((char *)name);
|
||||
|
||||
/* Don't exit yet, SM needs time to get the new commandStr.*/
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* RestoreSession
|
||||
* Open the file as a resource data base, and use the data to
|
||||
* set the dialog position and (optionally) size.
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
Boolean
|
||||
restoreSession(
|
||||
Widget shell,
|
||||
char *name )
|
||||
{
|
||||
XrmDatabase db;
|
||||
char *tmpStr;
|
||||
char *longpath;
|
||||
Boolean status;
|
||||
|
||||
status = DtSessionRestorePath(shell, &longpath, name);
|
||||
if (!status)
|
||||
return(1);
|
||||
|
||||
/* Open the file as a resource database */
|
||||
if ((db = XrmGetFileDatabase (longpath)) == NULL) {
|
||||
tmpStr = (char *)XtMalloc(strlen(MSG2) + strlen(longpath)+ 1);
|
||||
sprintf(tmpStr, MSG2, longpath);
|
||||
_DtSimpleErrnoError(progName, DtError, MSG1, tmpStr, NULL);
|
||||
XtFree(tmpStr);
|
||||
XtFree(longpath);
|
||||
return(1);
|
||||
}
|
||||
|
||||
restoreMain(shell, db); /* Must happen first */
|
||||
|
||||
/* Now, Restore the dialogs */
|
||||
restoreColor(shell, db);
|
||||
restoreColorEdit(shell, db);
|
||||
restoreFonts(shell, db);
|
||||
restoreBackdrop(shell, db);
|
||||
restoreKeybd(shell, db);
|
||||
restoreMouse(shell, db);
|
||||
restoreAudio(shell, db);
|
||||
restoreScreen(shell, db);
|
||||
restoreDtwm(shell, db);
|
||||
restoreStartup(shell, db);
|
||||
restoreI18n(shell, db);
|
||||
|
||||
XrmDestroyDatabase(db);
|
||||
|
||||
XtFree(longpath);
|
||||
return(0);
|
||||
}
|
||||
66
cde/programs/dtstyle/SaveRestore.h
Normal file
66
cde/programs/dtstyle/SaveRestore.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/* $XConsortium: SaveRestore.h /main/5 1996/03/25 00:53:26 pascale $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: SaveRestore.h
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** This file contains function definitions for the corresponding .c
|
||||
** file
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
/*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1990, 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
|
||||
#ifndef _saverestore_h
|
||||
#define _saverestore_h
|
||||
|
||||
/* External Interface */
|
||||
|
||||
|
||||
extern void saveSessionCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
extern Boolean restoreSession(
|
||||
Widget shell,
|
||||
char *name) ;
|
||||
|
||||
extern void restoreFonts( Widget shell, XrmDatabase db) ;
|
||||
extern void saveFonts( int fd) ;
|
||||
extern void restoreMain( Widget shell, XrmDatabase db) ;
|
||||
extern void saveMain( int fd) ;
|
||||
extern void restoreMouse( Widget shell, XrmDatabase db) ;
|
||||
extern void saveMouse( int fd) ;
|
||||
extern void restoreAudio( Widget shell, XrmDatabase db) ;
|
||||
extern void saveAudio( int fd) ;
|
||||
extern void restoreScreen( Widget shell, XrmDatabase db) ;
|
||||
extern void saveScreen( int fd) ;
|
||||
extern void restoreColor( Widget shell, XrmDatabase db) ;
|
||||
extern void saveColor( int fd) ;
|
||||
extern void restoreColorEdit( Widget shell, XrmDatabase db) ;
|
||||
extern void saveColorEdit( int fd) ;
|
||||
extern void restoreKeybd( Widget shell, XrmDatabase db) ;
|
||||
extern void saveKeybd( int fd) ;
|
||||
extern void restoreStartup( Widget shell, XrmDatabase db) ;
|
||||
extern void saveStartup( int fd) ;
|
||||
extern void restoreBackdrop( Widget shell, XrmDatabase db) ;
|
||||
extern void saveBackdrop( int fd) ;
|
||||
extern void restoreI18n( Widget shell, XrmDatabase db) ;
|
||||
extern void saveI18n( int fd) ;
|
||||
|
||||
|
||||
#endif /* _saverestore_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
|
||||
|
||||
3143
cde/programs/dtstyle/Screen.c
Normal file
3143
cde/programs/dtstyle/Screen.c
Normal file
File diff suppressed because it is too large
Load Diff
31
cde/programs/dtstyle/Screen.h
Normal file
31
cde/programs/dtstyle/Screen.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/* $XConsortium: Screen.h /main/4 1995/10/30 13:12:42 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Screen.h
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** This file contains function definitions for the corresponding .c
|
||||
** file
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _screen_h
|
||||
#define _screen_h
|
||||
|
||||
/* External Interface */
|
||||
|
||||
|
||||
extern void popup_screenBB( Widget shell) ;
|
||||
extern void restoreScreen( Widget shell, XrmDatabase db) ;
|
||||
extern void saveScreen( int fd) ;
|
||||
|
||||
|
||||
#endif /* _screen_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
710
cde/programs/dtstyle/Startup.c
Normal file
710
cde/programs/dtstyle/Startup.c
Normal file
@@ -0,0 +1,710 @@
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Startup.c
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** Description: Controls the Dtstyle Startup dialog
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
/*$XConsortium: Startup.c /main/6 1995/12/22 15:23:38 barstow $*/
|
||||
/* +++++++++++++++++++++++++++++++++++++++*/
|
||||
/* include files */
|
||||
/* +++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <Xm/MwmUtil.h>
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/XmP.h>
|
||||
#include <Xm/DialogS.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/MessageB.h>
|
||||
#include <Xm/PushBG.h>
|
||||
#include <Xm/RowColumn.h>
|
||||
#include <Xm/Scale.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/ToggleBG.h>
|
||||
#include <Xm/VendorSEP.h>
|
||||
|
||||
#include <Dt/DialogBox.h>
|
||||
#include <Dt/Icon.h>
|
||||
#include <Dt/TitleBox.h>
|
||||
|
||||
#include <Dt/Message.h>
|
||||
#include <Dt/HourGlass.h>
|
||||
|
||||
#include "Help.h"
|
||||
#include "Main.h"
|
||||
#include "SaveRestore.h"
|
||||
#include "Protocol.h"
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Internal Functions */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
static void GetStartupValues( void ) ;
|
||||
static Widget BuildStartup( Widget shell) ;
|
||||
static void MapStartup(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
static void LayoutCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
static void SetCurrentCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XmToggleButtonCallbackStruct *call_data) ;
|
||||
static void SetHomeCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XmToggleButtonCallbackStruct *call_data) ;
|
||||
static void SetConfirmCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XmToggleButtonCallbackStruct *call_data) ;
|
||||
static void SetHomeSession(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
static void SaveHomeOk(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
static void ButtonCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Internal Variables */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
typedef struct {
|
||||
Widget startupForm;
|
||||
Widget resumeTgl;
|
||||
Widget homeTgl;
|
||||
Widget modeYesTgl;
|
||||
Widget modeNoTgl;
|
||||
Widget setHome;
|
||||
Widget dlg;
|
||||
int origStartState;
|
||||
int origConfirmMode;
|
||||
} Startup;
|
||||
static Startup startup;
|
||||
|
||||
|
||||
static saveRestore save = {FALSE, 0, };
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* popup_startupBB */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
void
|
||||
popup_startupBB(
|
||||
Widget shell )
|
||||
{
|
||||
|
||||
if (style.startupDialog == NULL)
|
||||
{
|
||||
if (smWindow != NULL)
|
||||
{
|
||||
if (style.smState.smCompatMode)
|
||||
{
|
||||
InfoDialog(((char *)GETMESSAGE(7, 13,
|
||||
"This session was started from an X Window System\n\
|
||||
startup script. Startup settings are not valid,\n\
|
||||
since the session cannot be restored.")),
|
||||
style.startupDialog ? style.startupDialog : style.shell, False);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
_DtTurnOnHourGlass(shell);
|
||||
GetStartupValues();
|
||||
BuildStartup(shell);
|
||||
XtManageChild(style.startupDialog);
|
||||
_DtTurnOffHourGlass(shell);
|
||||
}
|
||||
|
||||
else /* SM not running - post error dialog */
|
||||
{
|
||||
InfoDialog(((char *)GETMESSAGE(7, 15,
|
||||
"The Session Manager is not running.\n\
|
||||
Startup settings are not valid.")),
|
||||
style.startupDialog ? style.startupDialog : style.shell, False);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
XtManageChild(style.startupDialog);
|
||||
raiseWindow(XtWindow(XtParent(style.startupDialog)));
|
||||
}
|
||||
}
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++*/
|
||||
/* Get startup values ... used for cancel */
|
||||
/*++++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
GetStartupValues( void )
|
||||
{
|
||||
startup.origStartState = style.smState.smStartState;
|
||||
startup.origConfirmMode = style.smState.smConfirmMode;
|
||||
}
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++*/
|
||||
/* build__startupBB */
|
||||
/*++++++++++++++++++++++++++++++++++++++++*/
|
||||
static Widget
|
||||
BuildStartup(
|
||||
Widget shell )
|
||||
{
|
||||
register int n;
|
||||
Arg args[MAX_ARGS];
|
||||
XmString button_string[NUM_LABELS];
|
||||
XmString string;
|
||||
int count = 0;
|
||||
int count2 = 0;
|
||||
Widget widget_list[5],
|
||||
widget_list2[3],
|
||||
modeForm,
|
||||
shutdownRC;
|
||||
|
||||
startup.dlg = NULL;
|
||||
|
||||
/* Set up DialogBoxDialog button labels */
|
||||
button_string[0] = CMPSTR(_DtOkString);
|
||||
button_string[1] = CMPSTR(_DtCancelString);
|
||||
button_string[2] = CMPSTR(_DtHelpString);
|
||||
|
||||
/* Create toplevel DialogBox */
|
||||
/* saveRestore
|
||||
* Note that save.poscnt has been initialized elsewhere.
|
||||
* save.posArgs may contain information from restoreStartup().*/
|
||||
|
||||
XtSetArg(save.posArgs[save.poscnt], XmNbuttonCount, NUM_LABELS);
|
||||
save.poscnt++;
|
||||
XtSetArg(save.posArgs[save.poscnt], XmNbuttonLabelStrings, button_string);
|
||||
save.poscnt++;
|
||||
XtSetArg(save.posArgs[save.poscnt], XmNdefaultPosition, False);
|
||||
save.poscnt++;
|
||||
style.startupDialog =
|
||||
__DtCreateDialogBoxDialog(shell, "startupDlg", save.posArgs, save.poscnt);
|
||||
XtAddCallback(style.startupDialog, XmNcallback, ButtonCB, NULL);
|
||||
XtAddCallback(style.startupDialog, XmNhelpCallback,
|
||||
(XtCallbackProc)HelpRequestCB, (XtPointer)HELP_STARTUP_DIALOG);
|
||||
|
||||
XmStringFree(button_string[0]);
|
||||
XmStringFree(button_string[1]);
|
||||
XmStringFree(button_string[2]);
|
||||
|
||||
widget_list[0] = _DtDialogBoxGetButton(style.startupDialog,2);
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNautoUnmanage, False); n++;
|
||||
XtSetArg(args[n], XmNcancelButton, widget_list[0]); n++;
|
||||
XtSetValues (style.startupDialog, args, n);
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNtitle, ((char *)GETMESSAGE(7, 14, "Style Manager - Startup"))); n++;
|
||||
XtSetArg(args[n], XmNuseAsyncGeometry, True); n++;
|
||||
XtSetArg(args[n], XmNmwmFunctions, DIALOG_MWM_FUNC ); n++;
|
||||
XtSetValues (XtParent(style.startupDialog), args, n);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNhorizontalSpacing, style.horizontalSpacing); n++;
|
||||
XtSetArg(args[n], XmNverticalSpacing, style.verticalSpacing); n++;
|
||||
XtSetArg(args[n], XmNallowOverlap, False); n++;
|
||||
XtSetArg(args[n], XmNchildType, XmWORK_AREA); n++;
|
||||
startup.startupForm = XmCreateForm(style.startupDialog, "startupForm", args, n);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNfillMode, XmFILL_SELF); n++;
|
||||
XtSetArg(args[n], XmNbehavior, XmICON_LABEL); n++;
|
||||
XtSetArg(args[n], XmNpixmapForeground, style.secBSCol); n++;
|
||||
XtSetArg(args[n], XmNpixmapBackground, style.secTSCol); n++;
|
||||
XtSetArg(args[n], XmNstring, NULL); n++;
|
||||
XtSetArg(args[n], XmNshadowThickness, 0); n++;
|
||||
XtSetArg(args[n], XmNimageName, STARTUP_ICON); n++;
|
||||
XtSetArg(args[n], XmNtraversalOn, False); n++;
|
||||
widget_list[count++] =
|
||||
_DtCreateIcon(startup.startupForm, "startupPict", args, n);
|
||||
|
||||
if (style.smState.smDisplaySpecific)
|
||||
{
|
||||
char *pch1;
|
||||
char *pch2;
|
||||
|
||||
pch1 = (char *)GETMESSAGE(7, 16, "Display-specific session:");
|
||||
pch2 = XtMalloc(strlen (pch1) +
|
||||
strlen (XDisplayName (getenv("DISPLAY"))) + 3);
|
||||
|
||||
(void) sprintf(pch2, "%s\n%s", pch1, XDisplayName (getenv("DISPLAY")));
|
||||
|
||||
n = 0;
|
||||
string = CMPSTR(pch2);
|
||||
XtSetArg(args[n], XmNleftWidget, widget_list[count-1]); n++;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNmarginLeft, 80); n++;
|
||||
XtSetArg(args[n], XmNlabelString, string); n++;
|
||||
widget_list[count++] =
|
||||
XmCreateLabelGadget(startup.startupForm, "sessionLabel", args, n);
|
||||
XmStringFree(string);
|
||||
XtFree(pch2);
|
||||
}
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, widget_list[count-1]); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNmarginHeight, style.verticalSpacing); n++;
|
||||
XtSetArg(args[n], XmNmarginWidth, style.horizontalSpacing); n++;
|
||||
string = CMPSTR(((char *)GETMESSAGE(7, 3, "At Login:")));
|
||||
XtSetArg(args[n], XmNtitleString, string); n++;
|
||||
widget_list[count++] =
|
||||
_DtCreateTitleBox(startup.startupForm,"shutdownBox", args, n);
|
||||
XmStringFree(string);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNmarginHeight, 0); n++;
|
||||
XtSetArg(args[n], XmNmarginWidth, 0); n++;
|
||||
shutdownRC= XmCreateRadioBox(widget_list[count-1],"shutdownRC", args, n);
|
||||
|
||||
/*
|
||||
* For early versions of dtstyle, style.smState.smStartState could
|
||||
* be set to a value that is no longer supported. If this occurs,
|
||||
* no button will be selected, so initialize style.smState.smStartState
|
||||
* to a state that is supported.
|
||||
*/
|
||||
if (style.smState.smStartState != DtSM_CURRENT_STATE &&
|
||||
style.smState.smStartState != DtSM_HOME_STATE)
|
||||
style.smState.smStartState = DtSM_CURRENT_STATE;
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNalignment, XmALIGNMENT_BEGINNING); n++;
|
||||
string = CMPSTR(((char *)GETMESSAGE(7, 4, "Resume current session")));
|
||||
XtSetArg(args[n], XmNlabelString, string); n++;
|
||||
if (style.smState.smStartState == DtSM_CURRENT_STATE)
|
||||
{
|
||||
XtSetArg(args[n], XmNset, True); n++;
|
||||
}
|
||||
widget_list2[count2++] = startup.resumeTgl
|
||||
= XmCreateToggleButtonGadget(shutdownRC,"resumeTgl", args, n);
|
||||
XmStringFree(string);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNalignment, XmALIGNMENT_BEGINNING); n++;
|
||||
string = CMPSTR(((char *)GETMESSAGE(7, 5, "Return to Home session")));
|
||||
XtSetArg(args[n], XmNlabelString, string); n++;
|
||||
if (style.smState.smStartState == DtSM_HOME_STATE)
|
||||
{
|
||||
XtSetArg(args[n], XmNset, True); n++;
|
||||
}
|
||||
widget_list2[count2++] = startup.homeTgl
|
||||
= XmCreateToggleButtonGadget(shutdownRC,"homeTgl", args, n);
|
||||
XmStringFree(string);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, widget_list[count-1]); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNmarginHeight, style.verticalSpacing); n++;
|
||||
XtSetArg(args[n], XmNmarginWidth, style.horizontalSpacing); n++;
|
||||
string = CMPSTR(((char *)GETMESSAGE(7, 7, "Logout Confirmation Dialog:")));
|
||||
XtSetArg(args[n], XmNtitleString, string); n++;
|
||||
widget_list[count++] = _DtCreateTitleBox(startup.startupForm,"modeBox", args, n);
|
||||
XmStringFree(string);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNmarginHeight, 0); n++;
|
||||
XtSetArg(args[n], XmNmarginWidth, 0); n++;
|
||||
XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
|
||||
modeForm = XmCreateRadioBox(widget_list[count-1], "modeForm", args, n);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNalignment, XmALIGNMENT_BEGINNING); n++;
|
||||
string = CMPSTR(((char *)GETMESSAGE(7, 8, "On")));
|
||||
XtSetArg(args[n], XmNlabelString, string ); n++;
|
||||
if (style.smState.smConfirmMode == DtSM_VERBOSE_MODE)
|
||||
{
|
||||
XtSetArg(args[n], XmNset, True); n++;
|
||||
}
|
||||
else {
|
||||
XtSetArg(args[n], XmNset, False); n++;
|
||||
}
|
||||
startup.modeYesTgl= XmCreateToggleButtonGadget(modeForm,"modeYesTgl", args, n);
|
||||
XmStringFree(string);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNalignment, XmALIGNMENT_BEGINNING); n++;
|
||||
string = CMPSTR(((char *)GETMESSAGE(7, 9, "Off")));
|
||||
XtSetArg(args[n], XmNlabelString, string ); n++;
|
||||
if (style.smState.smConfirmMode != DtSM_VERBOSE_MODE)
|
||||
{
|
||||
XtSetArg(args[n], XmNset, True); n++;
|
||||
}
|
||||
else {
|
||||
XtSetArg(args[n], XmNset, False); n++;
|
||||
}
|
||||
startup.modeNoTgl= XmCreateToggleButtonGadget(modeForm,"modeNoTgl", args, n);
|
||||
XmStringFree(string);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, widget_list[count-1]); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNmarginHeight, LB_MARGIN_HEIGHT); n++;
|
||||
XtSetArg(args[n], XmNmarginWidth, LB_MARGIN_WIDTH); n++;
|
||||
XtSetArg(args[n], XmNnavigationType, XmTAB_GROUP); n++;
|
||||
string = CMPSTR(((char *)GETMESSAGE(7, 10, "Set Home Session ...")));
|
||||
XtSetArg(args[n], XmNlabelString, string); n++;
|
||||
widget_list[count++] = startup.setHome =
|
||||
XmCreatePushButtonGadget(startup.startupForm,"setPB", args, n);
|
||||
XmStringFree(string);
|
||||
|
||||
XtAddCallback(style.startupDialog, XmNmapCallback, MapStartup, shell);
|
||||
XtAddCallback(style.startupDialog, XmNmapCallback, LayoutCB, shell);
|
||||
XtAddCallback(startup.resumeTgl, XmNvalueChangedCallback,
|
||||
(XtCallbackProc)SetCurrentCB, NULL);
|
||||
XtAddCallback(startup.homeTgl, XmNvalueChangedCallback,
|
||||
(XtCallbackProc)SetHomeCB, NULL);
|
||||
XtAddCallback(startup.modeYesTgl, XmNvalueChangedCallback,
|
||||
(XtCallbackProc)SetConfirmCB, NULL);
|
||||
XtAddCallback( widget_list[count-1], XmNactivateCallback,
|
||||
SetHomeSession, style.startupDialog);
|
||||
|
||||
XtManageChild(modeForm);
|
||||
XtManageChild(startup.startupForm);
|
||||
XtManageChild(shutdownRC);
|
||||
XtManageChildren(widget_list2,count2);
|
||||
XtManageChild(startup.modeYesTgl);
|
||||
XtManageChild(startup.modeNoTgl);
|
||||
XtManageChildren(widget_list,count);
|
||||
|
||||
return(style.startupDialog);
|
||||
}
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* MapStartup */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
MapStartup(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
|
||||
DtWsmRemoveWorkspaceFunctions (style.display, XtWindow(XtParent(w)));
|
||||
|
||||
if (!save.restoreFlag)
|
||||
putDialog ((Widget)client_data, w);
|
||||
|
||||
XtRemoveCallback(style.startupDialog, XmNmapCallback, MapStartup, NULL);
|
||||
}
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* LayoutCB */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
LayoutCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
int n=0;
|
||||
Arg args[4];
|
||||
|
||||
if (XtWidth(startup.startupForm) < (Dimension) (XtWidth(startup.setHome) +
|
||||
(2*style.horizontalSpacing)))
|
||||
{
|
||||
n=0;
|
||||
XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++;
|
||||
XtSetValues(startup.setHome, args, n);
|
||||
}
|
||||
XtRemoveCallback(style.startupDialog, XmNmapCallback, LayoutCB, NULL);
|
||||
}
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* SetCurrentCB */
|
||||
/* tell SM to resume current session */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
SetCurrentCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XmToggleButtonCallbackStruct *call_data )
|
||||
{
|
||||
if (call_data->set)
|
||||
style.smState.smStartState = DtSM_CURRENT_STATE;
|
||||
}
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* SetHomeCB */
|
||||
/* tell SM to use home session */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
SetHomeCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XmToggleButtonCallbackStruct *call_data )
|
||||
{
|
||||
if (call_data->set)
|
||||
style.smState.smStartState = DtSM_HOME_STATE;
|
||||
}
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* SetConfirmCB */
|
||||
/* tell SM to be verbose or not */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
SetConfirmCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XmToggleButtonCallbackStruct *call_data )
|
||||
{
|
||||
int n;
|
||||
Arg args[2];
|
||||
Boolean mode;
|
||||
|
||||
if (call_data->set)
|
||||
style.smState.smConfirmMode = DtSM_VERBOSE_MODE;
|
||||
else
|
||||
{
|
||||
style.smState.smConfirmMode = DtSM_QUIET_MODE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* SaveHomeOk */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
SaveHomeOk(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
SmSaveHomeSession(startup.origStartState, startup.origConfirmMode);
|
||||
}
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* SetHomeSession */
|
||||
/* allow user to cancel out */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
SetHomeSession(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
int n=0;
|
||||
Arg args[6];
|
||||
Widget shell = (Widget) client_data;
|
||||
XmString string;
|
||||
XmString okstr, cancelstr;
|
||||
|
||||
if (startup.dlg == NULL)
|
||||
{
|
||||
string = CMPSTR(((char *)GETMESSAGE(7, 11, "This will replace your home session with\nthe current session.\n\n Continue?")));
|
||||
XtSetArg(args[n], XmNmessageString, string); n++;
|
||||
okstr = CMPSTR(_DtOkString);
|
||||
cancelstr = CMPSTR(_DtCancelString);
|
||||
XtSetArg(args[n], XmNokLabelString, okstr); n++;
|
||||
XtSetArg(args[n], XmNcancelLabelString, cancelstr); n++;
|
||||
XtSetArg(args[n], XmNmwmFunctions, DIALOG_MWM_FUNC ); n++;
|
||||
startup.dlg = XmCreateWarningDialog(shell, "QNotice", args, n);
|
||||
XtUnmanageChild (XmMessageBoxGetChild(startup.dlg, XmDIALOG_HELP_BUTTON));
|
||||
XtAddCallback(startup.dlg, XmNokCallback, SaveHomeOk, NULL);
|
||||
XmStringFree(string);
|
||||
XmStringFree(okstr);
|
||||
XmStringFree(cancelstr);
|
||||
|
||||
n=0;
|
||||
XtSetArg (args[n], XmNmwmInputMode,
|
||||
MWM_INPUT_PRIMARY_APPLICATION_MODAL); n++;
|
||||
XtSetArg(args[n], XmNtitle, ((char *)GETMESSAGE(7, 12, "Warning"))); n++;
|
||||
XtSetValues (XtParent(startup.dlg), args, n);
|
||||
}
|
||||
XtManageChild(startup.dlg);
|
||||
}
|
||||
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
/* ButtonCB */
|
||||
/* CB for OK, Cancel, Help in DialogBox */
|
||||
/*+++++++++++++++++++++++++++++++++++++++*/
|
||||
static void
|
||||
ButtonCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
Arg set[1], unset[1];
|
||||
DtDialogBoxCallbackStruct *cb = (DtDialogBoxCallbackStruct *) call_data;
|
||||
|
||||
switch (cb->button_position)
|
||||
{
|
||||
case OK_BUTTON:
|
||||
|
||||
XtUnmanageChild (w);
|
||||
if (XmToggleButtonGadgetGetState(startup.modeYesTgl))
|
||||
startup.origConfirmMode = DtSM_VERBOSE_MODE;
|
||||
else
|
||||
startup.origConfirmMode = DtSM_QUIET_MODE;
|
||||
|
||||
SmNewStartupSettings();
|
||||
break;
|
||||
|
||||
case CANCEL_BUTTON:
|
||||
|
||||
XmToggleButtonGadgetSetState(startup.resumeTgl, True, True);
|
||||
XmToggleButtonGadgetSetState(startup.resumeTgl, False, True);
|
||||
|
||||
XtSetArg(set[0], XmNset, True);
|
||||
XtSetArg(unset[0], XmNset, False);
|
||||
|
||||
if (startup.origStartState == DtSM_CURRENT_STATE)
|
||||
XmToggleButtonGadgetSetState(startup.resumeTgl, True, True);
|
||||
|
||||
else if (startup.origStartState == DtSM_HOME_STATE)
|
||||
XmToggleButtonGadgetSetState(startup.homeTgl, True, True);
|
||||
|
||||
else
|
||||
/*
|
||||
* Reasonable default?
|
||||
*/
|
||||
XmToggleButtonGadgetSetState(startup.resumeTgl, True, True);
|
||||
|
||||
if (startup.origConfirmMode == DtSM_VERBOSE_MODE)
|
||||
XmToggleButtonGadgetSetState(startup.modeYesTgl, True, True);
|
||||
else
|
||||
XmToggleButtonGadgetSetState(startup.modeNoTgl, True, True);
|
||||
|
||||
style.smState.smStartState = startup.origStartState;
|
||||
style.smState.smConfirmMode = startup.origConfirmMode;
|
||||
|
||||
XtUnmanageChild (w);
|
||||
break;
|
||||
|
||||
case HELP_BUTTON:
|
||||
XtCallCallbacks(style.startupDialog, XmNhelpCallback, (XtPointer)NULL);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* restoreStartup()
|
||||
*
|
||||
* restore any state information saved with saveStartup.
|
||||
* This is called from restoreSession with the application
|
||||
* shell and the special xrm database retrieved for restore.
|
||||
************************************************************************/
|
||||
void
|
||||
restoreStartup(
|
||||
Widget shell,
|
||||
XrmDatabase db )
|
||||
{
|
||||
XrmName xrm_name[5];
|
||||
XrmRepresentation rep_type;
|
||||
XrmValue value;
|
||||
|
||||
xrm_name [0] = XrmStringToQuark ("startupDlg");
|
||||
xrm_name [2] = NULL;
|
||||
|
||||
/* get x position */
|
||||
xrm_name [1] = XrmStringToQuark ("x");
|
||||
if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value)){
|
||||
XtSetArg (save.posArgs[save.poscnt], XmNx, atoi((char *)value.addr));
|
||||
save.poscnt++;
|
||||
save.restoreFlag = True;
|
||||
}
|
||||
|
||||
/* get y position */
|
||||
xrm_name [1] = XrmStringToQuark ("y");
|
||||
if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value)){
|
||||
XtSetArg (save.posArgs[save.poscnt], XmNy, atoi((char *)value.addr));
|
||||
save.poscnt++;
|
||||
}
|
||||
|
||||
xrm_name [1] = XrmStringToQuark ("ismapped");
|
||||
XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value);
|
||||
/* Are we supposed to be mapped? */
|
||||
if (strcmp(value.addr, "True") == 0)
|
||||
popup_startupBB(shell);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* saveStartup()
|
||||
*
|
||||
* This routine will write out to the passed file descriptor any state
|
||||
* information this dialog needs. It is called from saveSessionCB with the
|
||||
* file already opened.
|
||||
* All information is saved in xrm format. There is no restriction
|
||||
* on what can be saved. It doesn't have to be defined or be part of any
|
||||
* widget or Xt definition. Just name and save it here and recover it in
|
||||
* restoreStartup. The suggested minimum is whether you are mapped, and
|
||||
* your location.
|
||||
************************************************************************/
|
||||
void
|
||||
saveStartup(
|
||||
int fd )
|
||||
{
|
||||
Position x,y;
|
||||
char *bufr = style.tmpBigStr; /* size=[1024], make bigger if needed */
|
||||
XmVendorShellExtObject vendorExt;
|
||||
XmWidgetExtData extData;
|
||||
|
||||
if (style.startupDialog != NULL) {
|
||||
if (XtIsManaged(style.startupDialog))
|
||||
sprintf(bufr, "*startupDlg.ismapped: True\n");
|
||||
else
|
||||
sprintf(bufr, "*startupDlg.ismapped: False\n");
|
||||
|
||||
/* Get and write out the geometry info for our Window */
|
||||
x = XtX(XtParent(style.startupDialog));
|
||||
y = XtY(XtParent(style.startupDialog));
|
||||
|
||||
/* Modify x & y to take into account window mgr frames
|
||||
* This is pretty bogus, but I don't know a better way to do it.
|
||||
*/
|
||||
extData = _XmGetWidgetExtData(style.shell, XmSHELL_EXTENSION);
|
||||
vendorExt = (XmVendorShellExtObject)extData->widget;
|
||||
x -= vendorExt->vendor.xOffset;
|
||||
y -= vendorExt->vendor.yOffset;
|
||||
|
||||
sprintf(bufr, "%s*startupDlg.x: %d\n", bufr, x);
|
||||
sprintf(bufr, "%s*startupDlg.y: %d\n", bufr, y);
|
||||
|
||||
write (fd, bufr, strlen(bufr));
|
||||
}
|
||||
}
|
||||
|
||||
31
cde/programs/dtstyle/Startup.h
Normal file
31
cde/programs/dtstyle/Startup.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/* $XConsortium: Startup.h /main/4 1995/10/30 13:12:58 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Startup.h
|
||||
**
|
||||
** Project: DT 3.0
|
||||
**
|
||||
** This file contains function definitions for the corresponding .c
|
||||
** file
|
||||
**
|
||||
**
|
||||
** (c) Copyright Hewlett-Packard Company, 1990.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _startup_h
|
||||
#define _startup_h
|
||||
|
||||
/* External Interface */
|
||||
|
||||
|
||||
extern void popup_startupBB( Widget shell) ;
|
||||
extern void restoreStartup( Widget shell, XrmDatabase db) ;
|
||||
extern void saveStartup( int fd) ;
|
||||
|
||||
|
||||
#endif /* _startup_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
305
cde/programs/dtstyle/dtstyle.man
Normal file
305
cde/programs/dtstyle/dtstyle.man
Normal file
@@ -0,0 +1,305 @@
|
||||
.\" $XConsortium: dtstyle.man /main/2 1995/07/17 10:51:43 drk $
|
||||
.TH DTSTYLE 1X
|
||||
.ds ]W HP DT 3.0
|
||||
.SH NAME
|
||||
\fBdtstyle - HP DT Style Manager.\fP
|
||||
.sp 1
|
||||
.SH SYNOPSIS
|
||||
.B dtstyle
|
||||
.sp 1
|
||||
.SH DESCRIPTION
|
||||
\fIDtstyle\fP is the HP DT Style Manager application that provides
|
||||
an interactive method of customizing the visual elements and system behavior
|
||||
of HP DT. The Style Manager buttons represent customization tasks
|
||||
for the following:
|
||||
.sp 1
|
||||
.IP "\fBColor\fP"
|
||||
Select workspace colors and palettes.
|
||||
.IP "\fBFonts\fP"
|
||||
Select application font sizes.
|
||||
.IP "\fBBackdrop\fP"
|
||||
Select workspace backdrop patterns.
|
||||
.IP "\fBKeyboard\fP"
|
||||
Set key click volume or character repeat capability.
|
||||
.IP "\fBMouse\fP"
|
||||
Change mouse button order, double-click speed, pointer
|
||||
acceleration or pointer movement threshold.
|
||||
.IP "\fBAudio\fP"
|
||||
Change the beeper volume, tone, or duration.
|
||||
.IP "\fBScreen\fP"
|
||||
Choose the number of minutes before your screen times out or
|
||||
whether or not your screen is covered and locked at time out.
|
||||
.IP "\fBWindow\fP"
|
||||
Specify how a window aquires focus, if the window raises when it
|
||||
receives focus, or where window icons are placed.
|
||||
.IP "\fBStartup\fP"
|
||||
Specify how your session begins and ends.
|
||||
.sp 1
|
||||
.SH STYLE MANAGER SPECIFIC RESOURCES
|
||||
The following resources control the appearance and behavior of
|
||||
\fIStyle Manager\fP.
|
||||
.sp 1
|
||||
.TS
|
||||
center;
|
||||
cB sss
|
||||
lB lB lB lB
|
||||
l l l l.
|
||||
Style Manager Resources
|
||||
Name Class Type Default
|
||||
_
|
||||
componentList ComponentList string see below*
|
||||
paletteDirectories PaletteDirectories string NULL
|
||||
writeXrdbImmediate WriteXrdbImmeidate Boolean true
|
||||
.TE
|
||||
.sp 1
|
||||
.IP "\fBcomponentList\fP"
|
||||
Specifies the Style Manager components with a list of component keywords
|
||||
separated by spaces. Valid component keywords include:
|
||||
Color, Font, Backdrop, Keybaord, Mouse, Audio, Screen, Dtwm, and Startup.
|
||||
The default componentList value is: Color Font Backdrop Keyboard Mouse Audio
|
||||
Screen Dtwm Startup.
|
||||
The componentList resource for a Dtlite session is: Color Backdrop
|
||||
Font Dtwm.
|
||||
.sp 1
|
||||
.IP "\fBpaletteDirectories\fP"
|
||||
Specifies a list of the directories (separated by spaces) where additional
|
||||
color palettes are located.
|
||||
These palette files are used to generate the list of color
|
||||
palettes that a user may select from in the Color dialog.
|
||||
In addition to this list palettes are also searched for in
|
||||
/usr/dt/palettes and $HOME/.dt/palettes.
|
||||
.sp 1
|
||||
.IP "\fBwriteXrdbImmediate\fP"
|
||||
Controls when new font size or new mouse double-click time resources are
|
||||
used. If True, new resources are used when new clients start. If False,
|
||||
new resources are used at the next session (after logout, with "Resume
|
||||
Current Session" selected in the Startup dialog, and login).
|
||||
.sp 3
|
||||
.SH "COLOR AND BACKDROP RESOURCES: GLOBAL TO HP DT"
|
||||
The following resources are used by more than one HP DT component.
|
||||
The syntax for specifying global resources is:
|
||||
.EX
|
||||
\fB*\fIresource_id\fR
|
||||
.EE
|
||||
.sp 1
|
||||
.TS
|
||||
center;
|
||||
cB sss
|
||||
lB lB lB lB
|
||||
l l l l.
|
||||
Color and Backdrop Resources: Global
|
||||
Name Class Type Default
|
||||
_
|
||||
backdropDirectory BackdropDirectory string /usr/dt/icons/Dtbackdrops
|
||||
colorUse ColorUse int dynamic*
|
||||
dynamicColor DynamicColor Boolean true
|
||||
foregroundColor ForegroundColor int dynamic*
|
||||
shadowPixmaps ShadowPixmaps int dynamic*
|
||||
writeXrdbColors WriteXrdbColors Boolean true
|
||||
.TE
|
||||
.ps 7
|
||||
\h'50p'*The display type determines default.
|
||||
.ps
|
||||
.sp 1
|
||||
.IP "\fBbackdropDirectory\fP"
|
||||
Specifies the directory location for the backdrops listed
|
||||
in the backdrop dialog. This resource is also used
|
||||
by dtwm.
|
||||
.sp 1
|
||||
.IP "\fBcolorUse\fP"
|
||||
Specifies the number of colors to use for the user interface.
|
||||
The default value for this resource is determined by querying
|
||||
the X server for the number of color cells on the system.
|
||||
Valid values are:
|
||||
.RS
|
||||
.IP \(bu 3
|
||||
\fBB_W\fP \(em Specifies a black and white system.
|
||||
The color palettes use only Black and Whte (color cells 0 and 1) and
|
||||
icons are displayed as bitonal images.
|
||||
In this configuration four color palettes are available:
|
||||
Black, White, BlackWhite and WhiteBlack.
|
||||
These palettes do not dynamically change. To change a palette,
|
||||
the HP Dt session must be restarted.
|
||||
This resource value forces \fBshadowPixmaps\fP to True, and
|
||||
\fBforegroundColor\fP to either black or white depending on the palette
|
||||
chosen.
|
||||
.IP \(bu 3
|
||||
\fBLOW_COLOR\fP \(em Specifies a low color system.
|
||||
The color palettes use 2 color sets and icons are displayed as bitonal
|
||||
images.
|
||||
The number of color cells can be further reduced by using the resources
|
||||
\fBshadowPixmaps\fP and \fBforegroundColor\fP.
|
||||
.IP \(bu 3
|
||||
\fBMEDIUM_COLOR\fP \(em Specifies a medium color system.
|
||||
The color palettes use 4 color sets and icons are displayed as bitonal
|
||||
images.
|
||||
The number of color cells can be further reduced by using the resources
|
||||
\fBshadowPixmaps\fP and \fBforegroundColor\fP.
|
||||
.IP \(bu 3
|
||||
\fBHIGH_COLOR\fP \(em Specifies a high color system.
|
||||
The color palettes use 8 color sets and icons are displayed as
|
||||
multi-color images.
|
||||
The number of color cells can be reduced by using the resources
|
||||
\fBshadowPixmaps\fP and \fBforegroundColor\fP.
|
||||
.RE
|
||||
.sp 1
|
||||
.TS
|
||||
center;
|
||||
RC
|
||||
cB| Bc.
|
||||
planes ColorUse
|
||||
_
|
||||
2-3 B_W
|
||||
4 LOW_COLOR
|
||||
6 MEDIUM_COLOR
|
||||
8+ HIGH_COLOR
|
||||
.TE
|
||||
.sp 1
|
||||
|
||||
.IP "\fBdynamicColor\fP"
|
||||
This resource can have values of True or False. \fBdynamicColor\fP is
|
||||
used to reduce the number of color cells being used. Once a palette has
|
||||
been selected and it is not likely to be changed, \fBdynamicColor\fP can
|
||||
be set to False.
|
||||
If set to False colors cannot be dynamically changed using the DT
|
||||
style manager. A selected
|
||||
palette will take effect the next session.
|
||||
The next time the session comes up, the color server uses Read Only
|
||||
color cells that can be shared by all clients, thus reducing
|
||||
the number of color cells used.
|
||||
|
||||
.IP "\fBforegroundColor\fP"
|
||||
This resource can have values of White, Black or Dynamic.
|
||||
\fBforegroundColor\fP causes all text (foreground) to use either pixel 0
|
||||
or 1 (Black
|
||||
or White) or to have a color cell dedicated to foreground that changes in
|
||||
response to the background color (Dynamic) for each ColorSet.
|
||||
If set to White or Black, the number of color cells used per ColorSet is
|
||||
reduced by 1.
|
||||
.IP "\fBshadowPixmaps\fP"
|
||||
For color systems, this resource can have a value of True or False.
|
||||
If True, \fBtopShadowColor\fP and \fBbottomShadowColor\fP use the same
|
||||
pixel as background and \fBtopShadowPixmap\fP and
|
||||
\fBbottomShadowPixmap\fP are specified
|
||||
instead of solid color to create the 3D look.
|
||||
This reduces the number of color cells per ColorSet by 2.
|
||||
\fBshadowPixmaps\fP defaults to True for systems with 4 or less color planes
|
||||
(16 or less color cells),
|
||||
and False for systems with more than 4 color planes.
|
||||
.IP "\fBwriteXrdbColors\fP"
|
||||
This resource should only be used if you are running non HP Motif 1.1 clients
|
||||
that have color schemes that conflict with HP DT colors. This has no
|
||||
impact on clients linked with the Motif 1.1 library. This resource
|
||||
specifies whether color resource information should be written out.
|
||||
If set to False, \fBbackground\fP and \fBforeground\fP resources are not
|
||||
written out with the values of the current palette. This means that
|
||||
non HP Motif 1.1 clients do not get HP DT colors when they are started.
|
||||
The default value is True.
|
||||
.RE
|
||||
.sp 1
|
||||
.SH "COLOR RESOURCES: CLIENT SPECIFIC"
|
||||
The following resources are specified on a per client bases.
|
||||
The syntax for specifying client-specific resources is
|
||||
.EX
|
||||
\fB\fIclient_name_or_class\fB*\fIresource_id\fR
|
||||
.EE
|
||||
.sp 1
|
||||
.TS
|
||||
center;
|
||||
cB sss
|
||||
lB lB lB lB
|
||||
l l l l.
|
||||
Color Resource Set: Client Specific
|
||||
Name Class Type Default
|
||||
_
|
||||
primaryColorSetId PrimaryColorSetId int 3
|
||||
secondaryColorSetId SecondaryColorSetId int 4
|
||||
.TE
|
||||
.sp 1
|
||||
.RS
|
||||
.IP "\fBprimaryColorSetId\fP"
|
||||
This resource specifies the primary color for an application.
|
||||
The primary color is used for the main background areas of the application
|
||||
and all children of the main area.
|
||||
The value of this resource is a number from one to eight that represents
|
||||
a specific color set in a palette.
|
||||
.IP "\fBsecondaryColorSetId\fP"
|
||||
This resource specifies the secondary color for an application.
|
||||
The secondary color is used for the menubar and all menus and dialogs
|
||||
of the application.
|
||||
This allows dialogs on the screen to be visually associated with its parent
|
||||
application by matching the dialog color to the menubar.
|
||||
The value of this resource is a number from one to eight that represents
|
||||
a specific color set in a palette.
|
||||
.RE
|
||||
.sp 1
|
||||
.SH "COLOR RESOURCES: DTWM SPECIFIC"
|
||||
The following are Dtwm-specific resources.
|
||||
.sp 1
|
||||
.TS
|
||||
center;
|
||||
cB sss
|
||||
lB lB lB lB
|
||||
l l l l.
|
||||
Color Resource Set: Dtwm specific
|
||||
Name Class Type Default
|
||||
_
|
||||
activeColorSetId ActiveColorSetId int 1
|
||||
inactiveColorSetId InactiveColorSetId int 2
|
||||
.TE
|
||||
.sp 1
|
||||
.RS
|
||||
.IP "\fBactiveColorSetId\fP"
|
||||
Specifies the active frame color for \fIdtwm\fP. The value
|
||||
of this resource is a number from one to eight, which represents a specific
|
||||
color set in a palette.
|
||||
.IP "\fBinactiveColorSetId\fP"
|
||||
Specifies the inactive frame color for \fIdtwm\fP. The value
|
||||
of this resource is a number from one to eight, which represents a specific
|
||||
color set in a palette.
|
||||
.RE
|
||||
.sp2
|
||||
.TS
|
||||
center;
|
||||
cB sss
|
||||
lB lB lB lB
|
||||
l l l l.
|
||||
Font Resource Set
|
||||
Name Class Type Default
|
||||
_
|
||||
numFonts NumFonts int 7
|
||||
systemFont1 SystemFont1 FontList -bitstream-swiss*742-medium-r-normal--13-100-72-72-p-75-hp-roman8
|
||||
systemFont2 SystemFont2 FontList -bitstream-swiss*742-medium-r-normal--14-90-85-85-p-81-hp-roman8
|
||||
systemFont3 SystemFont3 FontList -bitstream-swiss*742-bold-r-normal--16-120-72-72-p-94-hp-roman8
|
||||
systemFont4 SystemFont4 FontList -bitstream-swiss*742-bold-r-normal--17-140-85-85-p-100-hp-roman8
|
||||
systemFont5 SystemFont5 FontList -bitstream-swiss*742-medium-r-normal--19-140-85-85-p-110-hp-roman8
|
||||
systemFont6 SystemFont6 FontList -bitstream-swiss*742-medium-r-normal--23-196-85-85-p-133-hp-roman8
|
||||
systemFont7 SystemFont7 FontList -bitstream-swiss*742-medium-r-normal--26-171-110-110-p-150-hp-roman8
|
||||
userFont1 UserFont1 FontList -adobe-courier-medium-r-normal--10-100-75-75-m-60-hp-roman8
|
||||
userFont2 UserFont2 FontList -adobe-courier-medium-r-normal--12-120-75-75-m-70-hp-roman8
|
||||
userFont3 UserFont3 FontList -bitstream-prestige-medium-r-normal--16-120-72-72-m-80-hp-roman8
|
||||
userFont4 UserFont4 FontList -bitstream-prestige-medium-r-normal--17-128-72-72-m-90-hp-roman8
|
||||
userFont5 UserFont5 FontList -bitstream-prestige-medium-r-normal--19-160-72-72-m-110-hp-roman8
|
||||
userFont6 UserFont6 FontList -bitstream-prestige-medium-r-normal--23-179-85-85-m-120-hp-roman8
|
||||
userFont7 UserFont7 FontList -bitstream-prestige-medium-r-normal--26-171-110-110-m-140-hp-roman8
|
||||
.TE
|
||||
.sp 1
|
||||
.RS
|
||||
.IP "\fBnumFonts\fP"
|
||||
Specifies the number of System/User Font pairs presented in the Font dialog.
|
||||
.IP "\fBsystemFont[1-7]\fP"
|
||||
Specifies a SystemFont for a particular font size that can be selected in
|
||||
the Font dialog.
|
||||
.IP "\fBuserFont[1-7]\fP"
|
||||
Specifies a UserFont for a particular font size that can be selected in
|
||||
the Font dialog.
|
||||
.RE
|
||||
.sp1
|
||||
.SH COPYRIGHT
|
||||
Copyright 1990 Hewlett-Packard Company.
|
||||
.sp1
|
||||
.SH ORIGIN
|
||||
Hewlett-Packard Company UTD-CV.
|
||||
.sp 1
|
||||
.SH SEE ALSO
|
||||
\fBX(1)\fP, \fBdtsession(1X)\fP, \fBdtwm(1X)\fP.
|
||||
706
cde/programs/dtstyle/dtstyle.msg
Normal file
706
cde/programs/dtstyle/dtstyle.msg
Normal file
@@ -0,0 +1,706 @@
|
||||
$ "$XConsortium: dtstyle.msg /main/6 1996/08/16 17:02:45 pascale $"
|
||||
|
||||
$ *************************************<+>*************************************
|
||||
$ *****************************************************************************
|
||||
$ **
|
||||
$ ** File: dtstyle.msg
|
||||
$ **
|
||||
$ ** Project: DT Style Manager
|
||||
$ **
|
||||
$ ** Description:
|
||||
$ ** -----------
|
||||
$ ** This file is the source for the message catalog for dtstyle
|
||||
$ **
|
||||
$ **
|
||||
$ *****************************************************************************
|
||||
$ **
|
||||
$ ** (c) Copyright 1996 Digital Equipment Corporation.
|
||||
$ ** (c) Copyright 1990, 1996 Hewlett-Packard Company.
|
||||
$ ** (c) Copyright 1996 International Business Machines Corp.
|
||||
$ ** (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
$ ** (c) Copyright 1996 Novell, Inc.
|
||||
$ ** (c) Copyright 1996 FUJITSU LIMITED.
|
||||
$ ** (c) Copyright 1996 Hitachi.
|
||||
$ **
|
||||
$ *****************************************************************************
|
||||
$ *****************************************************************************
|
||||
$
|
||||
$ ***** NOTE FOR MESSAGE CATALOG TRANSLATORS *****
|
||||
$
|
||||
$ There may be three types of messages in this file:
|
||||
$
|
||||
$ 1. Messages that appear in dialogs or are displayed to the user.
|
||||
$
|
||||
$ These messages are the default and they should ALL BE LOCALIZED.
|
||||
$ Note that these messages do NOT have any identification (see the
|
||||
$ comments for type 2 and 3 below).
|
||||
$
|
||||
$ 2. Messages that only appear in the DT error log file ($HOME/.dt/errorlog).
|
||||
$
|
||||
$ The localization of these messages is OPTIONAL. These messages are
|
||||
$ identified by the following:
|
||||
$
|
||||
$ MESSAGES xx-yy IN SET zz WILL ONLY APPEAR IN THE DT ERRORLOG FILE
|
||||
$
|
||||
$ 3. Messages that should not be localized.
|
||||
$
|
||||
$ These messages are identified by the following:
|
||||
$
|
||||
$ DO NOT TRANSLATE or CHANGE or LOCALIZE MESSAGES xx-yy from set zz
|
||||
$
|
||||
$ ***** END (NOTE FOR MESSAGE CATALOG TRANSLATORS) *****
|
||||
$
|
||||
$ ******************************************************************************
|
||||
$ *************************************<L>*************************************
|
||||
$ ** -----------------GENERAL LOCALIZATION NOTES SECTION---------------------
|
||||
$ * Comment lines begin with a $ except $set which indicates the start of a
|
||||
$ * new set.
|
||||
$ *
|
||||
$ * Do not delete any comments; you may add comments for your use.
|
||||
$ *
|
||||
$ *
|
||||
$ ** ----------------GENERAL LOCALIZATION NOTES SECTION END------------------
|
||||
$ *************************************<L>*************************************
|
||||
|
||||
$set 2
|
||||
$ Message 1 from set 2 was deleted from the message catalog
|
||||
|
||||
$ _DtMessage 2 is the title of all Information dialog boxes
|
||||
2 Notice
|
||||
$ _DtMessage 3 is the title of all Error dialog boxes
|
||||
3 Error
|
||||
$ _DtMessage 4 WILL ONLY APPEAR IN THE DT ERRORLOG FILE
|
||||
4 Cannot communicate with the session\n\
|
||||
manager... Exiting.
|
||||
|
||||
$ MESSAGES 5-6 IN SET 2 WILL ONLY APPEAR IN THE DT ERRORLOG FILE
|
||||
5 Style Manager is already running,\n\
|
||||
second attempt aborted.
|
||||
6 An X Toolkit error occurred...\n\
|
||||
Exiting.
|
||||
|
||||
$ _DtMessage 7 is the title of all Help dialog boxes
|
||||
7 Style Manager - Help
|
||||
|
||||
$ _DtMessage 8 is an error message that appears when you are using Itemh Help
|
||||
$ and select on something outside of the Style Manager
|
||||
8 You must select an item\n\
|
||||
within the Style Manager.
|
||||
|
||||
$ _DtMessage 9 WILL ONLY APPEAR IN THE DT ERRORLOG FILE
|
||||
9 Could not obtain screen saver information\n\
|
||||
from the session manager. Start up settings\n\
|
||||
may be incorrect.
|
||||
|
||||
|
||||
$set 4
|
||||
$ _DtMessage set 4 is for the Style Manager main window
|
||||
$ Messages 6,8-26,34,39 from set 4 were deleted from the message catalog
|
||||
|
||||
$ _DtMessage 1 is the title of the main dtstyle window
|
||||
1 Style Manager
|
||||
|
||||
$ mnemonic and label for the File menubar item.
|
||||
2 F
|
||||
3 File
|
||||
$ mnemonic and label for the Help menubar item.
|
||||
4 H
|
||||
5 Help
|
||||
|
||||
$ _DtMessage 7 is the label for the Exit button in the File pulldown
|
||||
$ the mnenomic for the Exit button is set 4 _DtMessage 40
|
||||
7 Exit
|
||||
|
||||
$ Messages 27-33,35 are the labels on the buttons in the dtstyle main window.
|
||||
27 Color
|
||||
28 Font
|
||||
29 Backdrop
|
||||
30 Keyboard
|
||||
31 Mouse
|
||||
32 Beep
|
||||
33 Screen
|
||||
35 Startup
|
||||
|
||||
$ MESSAGE 36 IN SET 4 WILL ONLY APPEAR IN THE DT ERRORLOG FILE
|
||||
36 No Dtstyle restore information available for current session
|
||||
|
||||
$ _DtMessage 37 is the label on the dtstyle icon
|
||||
37 Style
|
||||
|
||||
$ Message 38 is the label on the Window button in the dtstyle main window.
|
||||
38 Window
|
||||
|
||||
$ _DtMessage 40 is replaced with message 53
|
||||
$ 40 E
|
||||
|
||||
$ *
|
||||
$ * mnemonic and label for the Help menu items.
|
||||
$ *
|
||||
|
||||
$ Messages 41-42 have been replaced with messages 54-55
|
||||
$ Overview... menu item
|
||||
$ 41 I
|
||||
$ 42 Introduction...
|
||||
|
||||
$ Tasks... menu item
|
||||
43 T
|
||||
$ Message 44 has been replaced with messages 56
|
||||
$ 44 Tasks...
|
||||
|
||||
$ Reference... menu item
|
||||
$ 45 R
|
||||
$ Message 46 has been replaced with messages 57
|
||||
$ 46 Reference...
|
||||
|
||||
$ On Item menu item
|
||||
$ Keybaord menu item
|
||||
47 O
|
||||
48 On Item
|
||||
|
||||
$ Using Help... menu item
|
||||
49 U
|
||||
$ Message 50 has been replaced with messages 58
|
||||
$ 50 Using Help...
|
||||
|
||||
$ Messages 51-52 have been replaced with messages 59-60
|
||||
$ Overview menu item
|
||||
$ 51 V
|
||||
$ 52 Version...
|
||||
|
||||
$ Message 53 is replaced with message 40
|
||||
53 x
|
||||
|
||||
$ Messages 54-55 are replacements for messages 41-42
|
||||
54 v
|
||||
55 Overview
|
||||
|
||||
$ Message 56 is a replacement for messages 44
|
||||
56 Tasks
|
||||
|
||||
$ Message 57 is a replacement for messages 46
|
||||
57 Reference
|
||||
|
||||
$ Message 58 is a replacement for messages 50
|
||||
58 Using Help
|
||||
|
||||
$ Messages 59-60 are replacements for messages 51-52
|
||||
59 A
|
||||
60 About Style Manager
|
||||
|
||||
$set 5
|
||||
$ _DtMessage set 5 is for the Font dialog
|
||||
$ Messages 1-6, 7-16 from set 5 were deleted from the message catalog
|
||||
|
||||
$ _DtMessage 17 is the label of the titlebox of the preview font area
|
||||
17 Preview
|
||||
|
||||
$ _DtMessage 18 appears in a Notice dialog after the user selects a new font
|
||||
$ and presses Ok - when the resource *WriteXrdbImmediate is True
|
||||
18 The changes to fonts will show up in some\n\
|
||||
applications the next time they are started.\n\
|
||||
Other applications, such as file manager and\n\
|
||||
application manager, will not show the font\n\
|
||||
changes until you Exit the desktop and then log\n\
|
||||
back in.
|
||||
|
||||
$ _DtMessage 19 appears in a Notice dialog after the user selects a new font
|
||||
$ and presses Ok - when the resource *WriteXrdbImmediate is False
|
||||
19 The selected font will be used\n\
|
||||
when you restart this session.
|
||||
|
||||
$ _DtMessage 20 and 21 is the text that initially appears in the Font Preview
|
||||
$ area displaying sample user and system fonts.
|
||||
20 AaBbCcDdEeFfGg0123456789
|
||||
21 AaBbCcDdEeFfGg0123456789
|
||||
|
||||
$ _DtMessage 22 is the label of the titlebox containing the list of font sizes
|
||||
22 Size
|
||||
|
||||
$ _DtMessage 23 is the title of the Fonts dialog
|
||||
23 Style Manager - Font
|
||||
|
||||
$ _DtMessage 24 is an informative message used by the Fonts dialog
|
||||
24 The font that is currently used for your desktop is not\n\
|
||||
available in the Size list. If a new font is selected and\n\
|
||||
applied, you will not be able to return to the current font\n\
|
||||
using the Style Manager - Font dialog.
|
||||
|
||||
$set 6
|
||||
$ _DtMessage set 6 is for the Beep dialog
|
||||
$ _DtMessage 1,6 from set 6 have been deleted from the message catalog
|
||||
|
||||
$ Messages 2 through 5 are the default buttons and labels of the scales.
|
||||
2 Default
|
||||
3 Volume
|
||||
4 Tone
|
||||
5 Duration
|
||||
|
||||
$ _DtMessage 7 is the title of the Beep dialog box
|
||||
7 Style Manager - Beep
|
||||
|
||||
|
||||
$set 7
|
||||
$ _DtMessage set 7 is for the Startup dialog
|
||||
$ Messages 1-2 from set 7 have been deleted from the message catalog
|
||||
|
||||
$ Messages 3 through 9 are labels of the buttons and text visible in the
|
||||
$ Session Startup dialog box.
|
||||
3 At Login:
|
||||
4 Resume current session
|
||||
5 Return to Home session
|
||||
|
||||
$ Message 6 is obsolete - DO NOT localize message #6 from this set
|
||||
$ 6 Ask me at Logout
|
||||
|
||||
7 Logout Confirmation Dialog:
|
||||
8 On
|
||||
9 Off
|
||||
10 Set Home Session ...
|
||||
|
||||
$ _DtMessage 11 is a warning message when the user pushes Set Home Session...
|
||||
$ Notice the spaces before Continue .. the spaces make it centered.
|
||||
11 This will replace your home session with\n\
|
||||
the current session.\n\n \
|
||||
Continue?
|
||||
|
||||
$ _DtMessage 12 is the title of the warning dialog box when Set Home Session is
|
||||
$ pushed.
|
||||
12 Warning
|
||||
|
||||
$ _DtMessage 13 is an error message
|
||||
13 This session was started from an X Window System\n\
|
||||
startup script. Startup settings are not valid,\n\
|
||||
since the session cannot be restored.
|
||||
|
||||
$ _DtMessage 14 is the title of the Session Startup dialog box.
|
||||
14 Style Manager - Startup
|
||||
|
||||
$ _DtMessage 15 is an error message
|
||||
15 The Session Manager is not running.\n\
|
||||
Startup settings are not valid.
|
||||
|
||||
$ _DtMessage 16 is used in the Sessin Startup dialog. It is the
|
||||
$ string that appears to right of the Startup dialog icon IF
|
||||
$ the user selects a display-specfic session at the login screen.
|
||||
16 Display-specific session:
|
||||
|
||||
|
||||
$set 8
|
||||
$ All of the messages from set 8 have been deleted from the message catalog
|
||||
|
||||
|
||||
$set 9
|
||||
$ _DtMessage set 9 is for the Mouse dialog
|
||||
$ Message 7 from set 9 have been deleted from the message catalog
|
||||
|
||||
$ Messages 1-4 are labels of toggle buttons in the Mouse Dialog.
|
||||
1 Left
|
||||
2 Right
|
||||
3 Handedness:
|
||||
4 Button 2:
|
||||
$ _DtMessage 5 is the label of default button.
|
||||
5 Default
|
||||
|
||||
$ Messages 6,8,9 are labels of the scales.
|
||||
6 Double-Click
|
||||
8 Acceleration
|
||||
9 Threshold
|
||||
|
||||
$ MESSAGE 10 IN SET 9 WILL ONLY APPEAR IN THE DT ERRORLOG FILE
|
||||
10 ERROR: setting pointer mapping\n
|
||||
|
||||
11 Transfer
|
||||
12 Adjust
|
||||
|
||||
$ _DtMessage 13 appears in a Notice dialog after the user selects the
|
||||
$ left-handed or right-handed toggle
|
||||
13 The right and left mouse buttons will swap\n\
|
||||
functions immediately after you click on OK.\n\
|
||||
The `Test Double-Click' graphic in the Mouse\n\
|
||||
window shows the current handedness by the \n\
|
||||
positions of Button 1 and Button 3.
|
||||
|
||||
$ _DtMessage 14 appears in a Notice dialog after the user selects the
|
||||
$ transfer toggle to change the function of the middle mouse button.
|
||||
14 If you click on OK, mouse button 2 will be set\n\
|
||||
to `transfer' (drag) at your next session.
|
||||
|
||||
$ double-click time and presses Ok (and the resource
|
||||
$ *WriteXrdbImmediate is True)
|
||||
15 The new double-click time will take effect\n\
|
||||
as applications are restarted.
|
||||
|
||||
$ _DtMessage 16 appears in a Notice dialog after the user selects a new
|
||||
$ double-click time and presses Ok (and the resource
|
||||
$ *WriteXrdbImmediate is False)
|
||||
16 The new double-click time will take effect\n\
|
||||
at your next session.
|
||||
|
||||
$ _DtMessage 17 is the text below the mouse icon. Notice the two lines.
|
||||
17 Test\nDouble-Click
|
||||
|
||||
$ _DtMessage 18 is the Mouse Dialog title
|
||||
18 Style Manager - Mouse
|
||||
|
||||
$ _DtMessage 19 appears in a Notice dialog after the user selects the
|
||||
$ adjust toggle to change the function of the middle mouse button.
|
||||
19 If you click on OK, mouse button 2 will be set\n\
|
||||
to `adjust' at your next session. Button 2 may\n\
|
||||
be used to adjust text and list selections.\n\
|
||||
Transfer actions (drag) on text and lists will\n\
|
||||
require the use of Button 1.
|
||||
|
||||
$ _DtMessage 20 is the label used for the "Button 2" toggle on
|
||||
$ a two button mouse (ignored on a three button mouse)
|
||||
20 Menu
|
||||
|
||||
$set 10
|
||||
$ _DtMessage set 10 is for the SaveRestore functionality
|
||||
$ Messages 2,4 from set 10 have been deleted from the message catalog
|
||||
|
||||
$ MESSAGE 1,3 IN SET 10 WILL ONLY APPEAR IN THE DT ERRORLOG FILE
|
||||
$ Messages 1,3 make up one error message. Put together, they say
|
||||
$ "<filename> <_DtMessage 2> <_DtMessage 1>
|
||||
1 Check file permissions.
|
||||
3 %s is the file that would have been used to save your session\n
|
||||
|
||||
|
||||
$set 11
|
||||
$ _DtMessage set 11 is for the Backdrop dialog
|
||||
|
||||
$ MESSAGE 1 IN SET 11 WILL ONLY APPEAR IN THE DT ERRORLOG FILE
|
||||
|
||||
$ _DtMessage 1 - could not open a backdrop directory
|
||||
1 Could not open directory %s.
|
||||
$ _DtMessage 2 - error opening the backdrop files
|
||||
2 The backdrop portion of the Style Manager\n\
|
||||
will not operate because there are no backdrop\n\
|
||||
files available. Check $HOME/.dt/errorlog.
|
||||
|
||||
|
||||
$ _DtMessage 12 is the title of the Backdrop dialog box
|
||||
12 Style Manager - Backdrop
|
||||
|
||||
|
||||
$set 12
|
||||
$ _DtMessage set 12 is for the Screen dialog
|
||||
$ Message 2 from set 12 has been deleted from the message catalog
|
||||
|
||||
$ _DtMessage 1 is the title of the Screen dialog box.
|
||||
1 Style Manager - Screen
|
||||
|
||||
$ Messages 3-14 are the labels and buttons for the Screen dialog
|
||||
3 Default
|
||||
4 Screen Saver
|
||||
5 Start Saver
|
||||
6 Time Per Saver
|
||||
7 minutes
|
||||
8 Screen Lock
|
||||
$ Message 9 has been removed
|
||||
10 On
|
||||
11 Off
|
||||
12 Screen Saver:
|
||||
13 Screen Lock:
|
||||
14 Start Lock
|
||||
15 Auto Screen Blanking
|
||||
16 Screen Blanker:
|
||||
17 Start Blanking
|
||||
18 Front Panel Lock
|
||||
$ Message 19 has been replaced by message 21
|
||||
19 Use Lock Backgrounds
|
||||
20 Time Per Background
|
||||
$ Message 21 is a replacement for message 19
|
||||
21 Use Backgrounds For Lock
|
||||
22 Transparent Lock
|
||||
|
||||
$set 13
|
||||
$ _DtMessage set 13 is for the Keyboard dialog
|
||||
$ _DtMessage 1,5 from set 13 have been deleted from the message catalog
|
||||
|
||||
$ _DtMessage 2 through 4 are labels of scales, buttons, and text visible in the
|
||||
$ Keyboard dialog box.
|
||||
2 Default
|
||||
3 Auto Repeat
|
||||
4 Click Volume
|
||||
|
||||
$ _DtMessage 6 is the title of the Keyboard dialog box
|
||||
6 Style Manager - Keyboard
|
||||
|
||||
|
||||
$set 14
|
||||
$ _DtMessage set 14 is for the Color dialog
|
||||
$ _DtMessage 1-4,9,14-15,17,19,20,22,24 from set 14 have been deleted from the message catalog
|
||||
|
||||
$ Messages 5 through 8 are labels and buttons visible in the Color dialog
|
||||
5 Palettes
|
||||
6 Add...
|
||||
7 Delete...
|
||||
8 Modify...
|
||||
|
||||
$ _DtMessage 10 is the title above the text area in the Add Palette dialog box
|
||||
10 New palette name:
|
||||
|
||||
$ _DtMessage 11 is the title of the Add Palette dialog box.
|
||||
11 Add Palette
|
||||
|
||||
$ Messages 12 through 14 are error messages.
|
||||
12 The palette name cannot contain\n\
|
||||
these characters:\n\n\
|
||||
<space> * : ( ) [ ] { } < > ! | \" / \\
|
||||
$ LOCALIZERS: FOR 8 AND 16 BIT LANGUAGES YOU MAY WANT TO CHANGE THE MESSAGE
|
||||
$ TO SAY THE PALETTE NAME MUST BE 10 BYTES OR LESS
|
||||
13 The palette name must be\n10 characters or less.\n
|
||||
|
||||
$ _DtMessage 16 is the title of the Delete Palette dialog box. See screen 4a (2).
|
||||
16 Delete Palette
|
||||
|
||||
$ _DtMessage 18 appears in an information dialog.
|
||||
18 Can't delete the last palette.\n
|
||||
|
||||
$ _DtMessage 21 is an error message
|
||||
21 Warning
|
||||
|
||||
$ _DtMessage 23 appears in an information dialog
|
||||
23 Delete palette '%s'?\n
|
||||
|
||||
$ _DtMessage 25 is an error message that appears when you press the color
|
||||
$ button and the color server is not running for some reason.
|
||||
25 The color portion of the Style Manager\n\
|
||||
will not operate because the color server\n\
|
||||
is not running. Check $HOME/.dt/errorlog.
|
||||
|
||||
$ _DtMessage 26 can be caused by setting the resource *useColorObj to False
|
||||
$ and then running dtstyle and trying to post the Color Dialog.
|
||||
26 The color portion of the Style Manager\n\
|
||||
will not operate because the resource\n\
|
||||
'useColorObj' is set to False.
|
||||
|
||||
$ _DtMessage 27 is for the new ColorUse dialog when you press ok.
|
||||
27 The new Color Use value will take effect\n\
|
||||
at your next session.
|
||||
|
||||
$ _DtMessage 28 is a warning message that appears on Black and White systems
|
||||
28 The selected palette will take effect\n\
|
||||
at your next session.
|
||||
|
||||
$ _DtMessage 29 appears in a warning dialog
|
||||
29 A palette named '%s' aleady exists.\n\
|
||||
This new palette will overwrite the old one.\n\
|
||||
Is this what you want to do?
|
||||
|
||||
$ _DtMessage 30 is the title of the Color dialog box.
|
||||
30 Style Manager - Color
|
||||
|
||||
$ _DtMessage 31-33 are the ColorUse options
|
||||
$ 31 High Color
|
||||
$ 32 Medium Color
|
||||
$ 33 Low Color
|
||||
34 Black and White
|
||||
35 Default
|
||||
|
||||
$ Dt Message 36 has been replaced by message 39
|
||||
$ _DtMessage 36 is the title of the Color Use dialog
|
||||
$ 36 DT Color Use
|
||||
|
||||
$ Dt Message 37 has been replaced by message 40
|
||||
$ _DtMessage 37 is the Color Use button in the main Color Dialog
|
||||
$ 37 DT Color Use...
|
||||
|
||||
$ _DtMessage 38 is an error message that appears when you press the color
|
||||
$ button and there are no palette files to be found
|
||||
38 The color portion of the Style Manager\n\
|
||||
will not operate because there are no palette\n\
|
||||
files available. Check $HOME/.dt/errorlog.
|
||||
|
||||
$ DtMessage 39 is a replacement for DtMessage 36
|
||||
$ DtMessage 39 is the title of the Color Use dialog
|
||||
39 Number Of Colors To Use:
|
||||
|
||||
$ DtMessage 40 is a replacement for DtMessage 37
|
||||
$ DtMessage 40 is the title of the Color Use dialog
|
||||
40 Number Of Colors...
|
||||
|
||||
$ _DtMessages 41-43 are replacements for Dtmessages 31-33
|
||||
$ _DtMessage 41-43 are the ColorUse options
|
||||
41 More Colors for Desktop
|
||||
42 More Colors for Applications
|
||||
43 Most Colors for Applications
|
||||
|
||||
$set 15
|
||||
$ All of the messages from set 15 have been deleted from the message catalog
|
||||
|
||||
|
||||
$set 16
|
||||
$ _DtMessage set 16 is for the Color dialog
|
||||
$ _DtMessage 1-10,13-17 from set 16 have been deleted from the message catalog
|
||||
|
||||
$ _DtMessage 11-12 form one error message that appears in an error dialog
|
||||
11 Unable to delete '%s'.\n
|
||||
12 Check $HOME/.dt/errorlog for hints.
|
||||
|
||||
$ MESSAGE 18-21 IN SET 16 WILL ONLY APPEAR IN THE DT ERRORLOG FILE
|
||||
18 Warning, Too many directories listed in the resource paletteDirectories,\n\
|
||||
Maximum number is %d.
|
||||
$ _DtMessage 19 - could not open a palette directory
|
||||
19 Could not open directory %s.
|
||||
$ _DtMessage 20 - error opening the palette file
|
||||
20 Could not open %s.
|
||||
$ _DtMessage 21 - error reading a palette file
|
||||
21 %s is an invalid palette file.
|
||||
|
||||
|
||||
$set 17
|
||||
$ _DtMessage set 17 is for the Modify Color dialog
|
||||
$ Messages 1-3,13,16 from set 17 have been deleted from the message catalog
|
||||
|
||||
$ Messages 4 through 12 are labels, buttons, and text visible in the
|
||||
$ Modify Color dialog box
|
||||
4 Color Sample
|
||||
5 Old
|
||||
6 New
|
||||
7 Grab Color
|
||||
8 Color Editor
|
||||
9 Hue
|
||||
$ We recommend that you don't translate R,G,B which stands for Red, Green,
|
||||
$ Blue unless there are standard single letter acronyms in your language.
|
||||
10 R
|
||||
11 G
|
||||
12 B
|
||||
|
||||
$ MESSAGE 14-15 IN SET 17 WILL ONLY APPEAR IN THE DT ERRORLOG FILE
|
||||
14 Warning, couldn't grab pointer.\n
|
||||
15 Warning, couldn't grab Keyboard.\n
|
||||
|
||||
$ _DtMessage 16 is the title of the Modify Color dialog box.
|
||||
16 Style Manager - Modify Color
|
||||
|
||||
|
||||
$set 18
|
||||
$ _DtMessage set 18 is for the Window dialog
|
||||
$ _DtMessage 1 is the title of the Window dialog box
|
||||
1 Style Manager - Window
|
||||
|
||||
$ Messages 2 through 5 are labels on the Window dialog.
|
||||
2 Default
|
||||
3 Window Behavior
|
||||
4 Window Icons
|
||||
$ Messages 5-8 have been replaced by messages 13-16
|
||||
$ 5 Focus Follows Mouse
|
||||
$ 6 Click In Window For Focus
|
||||
$ 7 Raise Window With Focus
|
||||
$ 8 Opaque Move
|
||||
9 Use Icon Box
|
||||
10 Place On Workspace
|
||||
11 Allow Primary Windows On Top
|
||||
12 The workspace manager must be restarted in\n\
|
||||
order for your changes to take effect.\n\
|
||||
Press OK to restart the workspace manager\n\
|
||||
or Cancel to reset the changes.
|
||||
$ Messages 13-16 are replacements for messages 5-8
|
||||
13 Point In Window To Make Active
|
||||
14 Click In Window To Make Active
|
||||
15 Raise Window When Made Active
|
||||
16 Show Contents During Move
|
||||
|
||||
$set 19
|
||||
$ The set 19 contains messages for the I18N dialog
|
||||
|
||||
$
|
||||
$ Messsages 1 to 11 are labels displayed in the dialog.
|
||||
$
|
||||
|
||||
$ Message 1 is the title of the Dialog.
|
||||
1 Style Manager - Internationalization
|
||||
|
||||
$ Message 2 appears on the button used to reset the last saved values.
|
||||
2 Default
|
||||
|
||||
$ Message 3 appears as the title of the title box containing Input
|
||||
$ Methods information.
|
||||
3 Input Method
|
||||
|
||||
$ Message 4 appears as the title of the title box containing Input
|
||||
$ Method Start Mode choice.
|
||||
4 Input Method Start Mode
|
||||
|
||||
$ Message 5 appears as the title of the title box containing PreeditType
|
||||
$ information.
|
||||
5 Preedit Type
|
||||
|
||||
$ Message 6 is the label presenting the server host names
|
||||
6 Server Host :
|
||||
|
||||
$ Message 7 is the label presenting the Input Method list
|
||||
7 Input Methods
|
||||
|
||||
$ Message 8 and 9 are the toggle buttons for the start mode selection:
|
||||
$ "Ask at login" will cause dtimsstart to present the list of Input
|
||||
$ Methods at next login; "Resume Current Input Method" will cause
|
||||
$ dtimsstart to use the selected IM at next login, without asking the
|
||||
$ user.
|
||||
8 Ask at login
|
||||
9 Resume Current Input Method
|
||||
|
||||
$ Message 10 is the label displayed on the button used to move up a
|
||||
$ selected element in the preedit Type list (meaning at the previous
|
||||
$ position).
|
||||
10 Move Up
|
||||
|
||||
$ Message 11 is the label displayed on the button used to move down a
|
||||
$ selected element in the preedit Type list (meaning at the next
|
||||
$ position).
|
||||
11 Move Down
|
||||
|
||||
$
|
||||
$ Messages 20-21 are displayed in an warning dialog when the user
|
||||
$ hits the OK button.
|
||||
$
|
||||
|
||||
$ Message 20 appears when the user modifies the XmNpreeditType
|
||||
$ resource value, and the resource *writeXrdbImmediate is True.
|
||||
$ Do NOT localize the word XmNpreeditType.
|
||||
20 The new XmNpreeditType value will take effect\n\
|
||||
as applications are restarted.
|
||||
|
||||
$ Message 21 appears when the userselects a new Input Method Server,
|
||||
$ or modifies the IMS Start Mode, or modifies the XmNpreeditType
|
||||
$ resource value, and the resource *writeXrdbImmediate is False.
|
||||
21 Your selection will take effect\n\
|
||||
at your next session.
|
||||
|
||||
$
|
||||
$ Messages 30 to 41 appear as errors in Error Dialog.
|
||||
$
|
||||
|
||||
$ Do NOT localize the word HOME.
|
||||
30 The environment variable HOME is not defined.
|
||||
|
||||
$ Do NOT localize the word LANG.
|
||||
31 The environment variable LANG is not defined.
|
||||
|
||||
32 The desktop does not support this locale.
|
||||
33 Cannot create the user Input Method Selection file.
|
||||
34 Cannot find the user Input Method Selection file.
|
||||
35 Cannot save the user Input Method Selection file.
|
||||
36 Unknown host
|
||||
|
||||
$ Do NOT translate dtimsstart.
|
||||
37 dtimsstart was not found.\n\
|
||||
Perhaps the desktop environment\n\
|
||||
is not properly installed.
|
||||
|
||||
38 Remote execution failed on\n the selected host.
|
||||
39 Cannot initialize remote execution.
|
||||
40 Unable to get Input Method information from the selected host.
|
||||
41 Unknown error
|
||||
|
||||
|
||||
$set 99
|
||||
$ DO NOT TRANSLATE THESE MESSAGES
|
||||
$ DO NOT CHANGE THESE MESSAGES
|
||||
$ DO NOT LOCALIZE THESE MESSAGES
|
||||
$ These messages are used for the version information.
|
||||
1 @(#)version_goes_here
|
||||
2 \n@(#)_DtMessage catalog source $XConsortium: dtstyle.msg /main/6 1996/08/16 17:02:45 pascale $
|
||||
|
||||
|
||||
268
cde/programs/dtstyle/nlsMsgChk.txt
Normal file
268
cde/programs/dtstyle/nlsMsgChk.txt
Normal file
@@ -0,0 +1,268 @@
|
||||
# $XConsortium: nlsMsgChk.txt /main/2 1996/11/11 11:31:52 drk $
|
||||
1. Screendump file name: < 1.Z >
|
||||
|
||||
_DtMessage catalog set number:
|
||||
|
||||
_DtMessage number(s):
|
||||
|
||||
Instructions:
|
||||
|
||||
|
||||
General messages:
|
||||
(2,2) - Notice dialog titles
|
||||
(2,3) - Error dialog titles
|
||||
|
||||
Dtstyle dialogs
|
||||
================
|
||||
The numbering represents window dump numbers for localization.
|
||||
(*) - indicates there is no slide for the dialog or menu
|
||||
|
||||
1. Style Manager main dialog
|
||||
Screendump file: style-1
|
||||
_DtMessage numbers: set 4 (1-5,27-33,35-36,38)
|
||||
Instructions:
|
||||
- Select the Style Manager icon from the front panel
|
||||
. The Style Manager dialog should appear
|
||||
|
||||
1a.Minimize Dtstyle
|
||||
Screendump file: (*)
|
||||
_DtMessage numbers: set 4 (37)
|
||||
Instructions:
|
||||
- Click the Style Manager minimize button on the window frame
|
||||
. The Style manager should iconify - check the icon name
|
||||
- De-iconify the Style Manager icon by double-clicking the icon
|
||||
|
||||
1b.Help menu
|
||||
Screendump file: (*)
|
||||
_DtMessage numbers: set 4 (41-52)
|
||||
Instructions:
|
||||
- Pull down the Help menu using MB-1
|
||||
|
||||
1c.File menu
|
||||
Screendump file: (*)
|
||||
_DtMessage numbers: set 4 (7,40)
|
||||
Instructions:
|
||||
- Pull down the File menu using MB-1
|
||||
|
||||
|
||||
2. Color dialog
|
||||
Screendump file: style-2
|
||||
_DtMessage numbers: set 14 (5-8,30,37)
|
||||
Instructions:
|
||||
- Click on the Color icon in the Style Manager main window
|
||||
|
||||
2b. Modify Color dialog
|
||||
Screendump file: style-2b !! Color Use
|
||||
_DtMessage numbers: set 17 (4-12)
|
||||
Instructions:
|
||||
- Select Modify button
|
||||
|
||||
2c. Add Palette dialog
|
||||
Screendump file: style-2c
|
||||
_DtMessage numbers: set 14 (10,11)
|
||||
Instructions:
|
||||
- Select Add button
|
||||
|
||||
2d. Delete Palette dialog
|
||||
Screendump file: style-2d
|
||||
_DtMessage numbers: set 14 (16,23)
|
||||
Instructions:
|
||||
- Select Delete button
|
||||
|
||||
2e. Color Use dialog -
|
||||
Screendump file: style-2e !! Color Use
|
||||
_DtMessage numbers: set 14 (31-36))
|
||||
Instructions:
|
||||
- from the Color dialog press Color Use...
|
||||
|
||||
2f. Notice dialog -
|
||||
Screendump file: style-2f
|
||||
_DtMessage numbers: set 14 (27)
|
||||
Instructions:
|
||||
- make a selection from ColorUse dialog
|
||||
- chose Ok
|
||||
|
||||
2g. Warning Dialog - duplicate palette name
|
||||
Screendump file: style-2g
|
||||
_DtMessage numbers: set 14 (21,29)
|
||||
Instructions:
|
||||
- in Add Palette dialog type in a duplicate palette name
|
||||
|
||||
2h. Error Dialog - invalid character in palette name
|
||||
Screendump file: style-2h
|
||||
_DtMessage numbers: set 14 (12)
|
||||
Instructions:
|
||||
- In Add Palette dialog, type a * or # in the filename
|
||||
|
||||
2i. Information Dialog - can't delete the last palette
|
||||
Screendump file: style-2i
|
||||
_DtMessage numbers: set 14 (18)
|
||||
Instructions:
|
||||
- Delete the palettes one at a time. This will happen on the last one.
|
||||
|
||||
2j. Error Dialog - can't delete palette - see errorlog for details
|
||||
Screendump file: style-2j
|
||||
_DtMessage numbers: set 16 (11,12)
|
||||
Instructions:
|
||||
- Add a palette named foo.
|
||||
- change the permissions on the users $HOME/.dt/palettes directory
|
||||
to not writable.
|
||||
- Then try to delete palette foo.
|
||||
|
||||
2k. Information Dialog - palette will change next session
|
||||
Screendump file: style-2k
|
||||
_DtMessage numbers: set 14 (28)
|
||||
Instructions:
|
||||
- post Color Use dialog
|
||||
- select B_W
|
||||
- restart your session
|
||||
- Rerun dtstyle, and select a palette.
|
||||
- to undo this, post the Color Use dialog, select default
|
||||
and restart your session
|
||||
|
||||
2l. Error Dialog - can't use colors because useColorObj is false
|
||||
Screendump file: style-2m
|
||||
_DtMessage numbers: set 14 (26)
|
||||
Instructions:
|
||||
- In a terminal window
|
||||
xrdb -m <cr>
|
||||
Dtstyle*useColorObj: False" <cr>
|
||||
<Ctrl-d> <Ctrl-d>
|
||||
- run dtstyle and press the color icon.
|
||||
- to undo this, set "Dtstyle*useColorObj: False"
|
||||
|
||||
2m. Error Dialog - can't use colors because color server not running
|
||||
Screendump file: (*)
|
||||
_DtMessage numbers: set 14 (25)
|
||||
Instructions:
|
||||
- run dtstyle not in the DT environment
|
||||
|
||||
2n. Error Dialog - palette name must be 10 characters or less (short filenames)
|
||||
Screendump file: (*)
|
||||
_DtMessage numbers: set 14 (13)
|
||||
Instructions:
|
||||
- run Dtstyle on a short filename system.
|
||||
- Try to add a palette with a palette name of > 10 characters
|
||||
|
||||
|
||||
|
||||
3. Font dialog
|
||||
Screendump file: style-3
|
||||
_DtMessage numbers: set 5 (17,22,23)
|
||||
Instructions:
|
||||
- Click on the Fonts icon in the Style Manager main window
|
||||
|
||||
3a. Notice dialog - use selected font next executable
|
||||
Screendump file: style-3b
|
||||
_DtMessage numbers: set 5 (18)
|
||||
Instructions:
|
||||
- Change the Font Size selection and press Ok
|
||||
. a Notice dialog will appear.
|
||||
|
||||
3b. Notice dialog - use selected font next session
|
||||
Screendump file: style-3a
|
||||
_DtMessage numbers: set 5 (19)
|
||||
Instructions:
|
||||
- In a terminal window type
|
||||
xrdb -m <cr>
|
||||
*WriteXrdbImmediate: False" <cr>
|
||||
<Ctrl-d> <Ctrl-d>
|
||||
- Rerun dtstyle, select a new font size, press Ok
|
||||
. the Notice dialog will appear withe a different message.
|
||||
(combine this with 6b)
|
||||
|
||||
4. Backdrop dialog
|
||||
Screendump file: style-4
|
||||
_DtMessage numbers: set 11 (12)
|
||||
Instructions:
|
||||
- Click on the Backdrop icon in the Style Manager main window
|
||||
|
||||
4a. Error Dialog - no bitmaps in backdrop directory
|
||||
Screendump file: style-4a
|
||||
_DtMessage numbers: set 11 (11)
|
||||
Instructions:
|
||||
- In a terminal window type
|
||||
xrdb -m <cr>
|
||||
*backdropDirectory: /tmp/foo <cr>
|
||||
<ctrl-d> <ctrl-d>
|
||||
where /tmp/foo is an empty directory.
|
||||
- run dtstyle, press the Backdrop icon
|
||||
|
||||
4b. _DtMessage to errorlog - couldn't open bitmap directory
|
||||
Screendump file: no screen dump, message goes to errorlog
|
||||
_DtMessage numbers: set 11 (9)
|
||||
Instructions:
|
||||
- In a terminal window type
|
||||
xrdb -m <cr>
|
||||
*backdropDirectory: /tmp/foo <cr>
|
||||
<ctrl-d> <ctrl-d>
|
||||
where /tmp/foo does not exist
|
||||
- run dtstyle, press the Backdrop icon
|
||||
|
||||
5. Keyboard dialog
|
||||
Screendump file: style-5
|
||||
_DtMessage numbers: set 13 (2-4,6)
|
||||
Instructions:
|
||||
- Click on the Keyboard icon in the Style Manager main window
|
||||
|
||||
6. Mouse dialog
|
||||
Screendump file: style-6
|
||||
_DtMessage numbers: set 9 (1,2,5,6,8,9,17,18)
|
||||
Instructions:
|
||||
- Click on the Mouse icon in the Style Manager main window
|
||||
|
||||
6a. Notice dialog - change will happen next execution
|
||||
Screendump file: style-6b
|
||||
_DtMessage numbers: set 9 (15)
|
||||
Instructions:
|
||||
- Move the Double-Click slider, press OK
|
||||
. a Notice dialog will appear
|
||||
|
||||
6b. Notice dialog - change will happen next session
|
||||
Screendump file: style-6a
|
||||
_DtMessage numbers: set 9 (16)
|
||||
Instructions:
|
||||
- In a terminal window type "xrdb -m WriteXrdbImmediate: False".
|
||||
- run dtstyle, move the Double-Click slider, press OK
|
||||
. a Notice dialog will appear with a different message.
|
||||
(combine this with 3b)
|
||||
|
||||
7. Audio dialog
|
||||
Screendump file: style-7
|
||||
_DtMessage numbers: set 6 (2-5,7)
|
||||
Instructions:
|
||||
- Click on the Audio icon in the Style Manager main window
|
||||
|
||||
8. Screen dialog
|
||||
Screendump file: style-8
|
||||
_DtMessage numbers: set 12 (2,4,5,7-11)
|
||||
Instructions:
|
||||
- Click on the Screen icon in the Style Manager main window
|
||||
|
||||
9. Window dialog
|
||||
Screendump file: style-9
|
||||
_DtMessage numbers: set 18 (1-10)
|
||||
Instructions:
|
||||
- Click on the Window icon in the Style Manager main window
|
||||
|
||||
10. Startup dialog
|
||||
Screendump file: style-10
|
||||
_DtMessage numbers: set 7 (3-10,14)
|
||||
Instructions:
|
||||
- Click on the Startup icon in the Style Manager main window
|
||||
|
||||
10a. Warning Dialog - this will replace your home session
|
||||
Screendump file: style-10a
|
||||
_DtMessage numbers: set 7 (11,12)
|
||||
Instructions:
|
||||
- Select the Set Home Session... button
|
||||
|
||||
10b.(*) Information Dialog - can't change startup parameters when in
|
||||
Screendump file: style-2
|
||||
_DtMessage numbers: set 14 (5-8)
|
||||
Instructions:
|
||||
compatibility mode
|
||||
- See dtsession man page for how to set -norestore option.
|
||||
Will have to set this mode for session manager logout dialog also.
|
||||
|
||||
|
||||
103
cde/programs/dtstyle/nlsREADME.txt
Normal file
103
cde/programs/dtstyle/nlsREADME.txt
Normal file
@@ -0,0 +1,103 @@
|
||||
# $XConsortium: nlsREADME.txt /main/2 1996/11/11 11:32:08 drk $
|
||||
#############################################################################
|
||||
#
|
||||
# Component: dtstyle
|
||||
#
|
||||
############################################################################
|
||||
|
||||
|
||||
_DtMessage catalog source:
|
||||
|
||||
File name: dtstyle.msg
|
||||
|
||||
Target: /usr/dt/nls/%L/dtstyle.cat
|
||||
|
||||
App-defaults file:
|
||||
|
||||
File name: Dtstyle
|
||||
|
||||
Target: /usr/dt/app-defaults/%L/Dtstyle
|
||||
|
||||
NOTE: ONLY localize the font and accelerator resources in the
|
||||
Dtstyle app-defaults file. DO NOT localize any of the
|
||||
following resources:
|
||||
|
||||
Dtstyle*componentList:
|
||||
Dtstyle*mainRC.orientation:
|
||||
Dtstyle*toneScale.maximum: 9000
|
||||
Dtstyle*toneScale.minimum: 82
|
||||
Dtstyle*durationScale.maximum: 25
|
||||
|
||||
|
||||
|
||||
The Font resources may need to be localized if a character set
|
||||
other than the default hp-roman8 is needed. A set of iso8859-1
|
||||
Dt fonts are delivered with Dt. The iso8859-1 fonts can be
|
||||
used by replacing the last field in the font resource xlfd
|
||||
strings from "hp-roman8" to "iso8859-1" in the following files:
|
||||
|
||||
/usr/dt/app-defaults/%L/Dtstyle
|
||||
/usr/dt/config/%L/sys.fonts
|
||||
|
||||
Sample versions of these files localized for iso8859-1 are provided
|
||||
in:
|
||||
|
||||
/usr/dt/examples/%L/Dtstyle
|
||||
/usr/dt/examples/%L/sys.fonts
|
||||
|
||||
|
||||
To specify a localized set of fonts other than the delivered
|
||||
dt iso8859-1 fonts, modify the following resources:
|
||||
|
||||
NumFonts:
|
||||
|
||||
Specifies the number of different font sizes available.
|
||||
Each font size in the Dtstyle Font list actually represents
|
||||
2 fonts (a system and user font) for that size.
|
||||
|
||||
SystemFont[1-NumFonts]:
|
||||
UserFont[1-NumFonts]:
|
||||
|
||||
Specify xlfd strings for NumFont pairs of SystemFont and UserFont.
|
||||
|
||||
To allow the font dialog to present the user with an accurate
|
||||
point size for each font pair, the resource values must specify all
|
||||
14 field delimiters of the xlfd string. In addition,
|
||||
|
||||
Scalable font - must specify point size field
|
||||
Bitmap font - must specify pixel size field
|
||||
|
||||
If the point size cannot be calculated from the font resource, the
|
||||
font sizes will appear numbered 1,2,3,etc.... in the size list in
|
||||
the Font dialog.
|
||||
|
||||
Font resource values must match exactly the default font resources
|
||||
specified in /usr/dt/config/%L/sys.fonts. When choosing a default
|
||||
font to specify in the sys.fonts file, the font pair must be chosen
|
||||
from the list specified in the Dtstyle app-defaults file and the
|
||||
font strings must be identical.
|
||||
|
||||
|
||||
Example: localize fonts for Japanese using four font sizes.
|
||||
(There are probably the actual fonts that will be used - its just
|
||||
an example.)
|
||||
|
||||
- There is no separate user and system fonts so SystemFont# and UserFont#
|
||||
refer to the same font.
|
||||
|
||||
- The xlfd strings are used with all delimiters ("-")
|
||||
|
||||
|
||||
Dtstyle*numFonts: 4
|
||||
|
||||
Dtstyle*SystemFont1: -hp-fixed-medium-r-normal--14-140-75-75-c-70-hp-japanese15
|
||||
Dtstyle*SystemFont2: -hp-gothic-medium-r-normal--18-180-75-75-c-80-hp-japanese15
|
||||
Dtstyle*SystemFont3: -hp-mincho-medium-r-normal--24-240-75-75-c-120-hp-japanese15
|
||||
Dtstyle*SystemFont4: -hp-mincho-medium-r-normal--32-320-75-75-c-160-hp-japanese15
|
||||
|
||||
Dtstyle*UserFont1: -hp-fixed-medium-r-normal--14-140-75-75-c-70-hp-japanese15
|
||||
Dtstyle*UserFont2: -hp-gothic-medium-r-normal--18-180-75-75-c-80-hp-japanese15
|
||||
Dtstyle*UserFont3: -hp-mincho-medium-r-normal--24-240-75-75-c-120-hp-japanese15
|
||||
Dtstyle*UserFont4: -hp-mincho-medium-r-normal--32-320-75-75-c-160-hp-japanese15
|
||||
|
||||
|
||||
13
cde/programs/dtstyle/version.c
Normal file
13
cde/programs/dtstyle/version.c
Normal file
@@ -0,0 +1,13 @@
|
||||
/* $XConsortium: version.c /main/5 1996/08/30 15:35:36 drk $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1993,1994,1996 International Business Machines Corp.
|
||||
* (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1993,1994,1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
|
||||
#include <include/hpversion.h>
|
||||
version_tag("dtstyle: $XConsortium: version.c /main/5 1996/08/30 15:35:36 drk $")
|
||||
Reference in New Issue
Block a user