Initial import of the CDE 2.1.30 sources from the Open Group.
This commit is contained in:
168
cde/lib/DtPrint/DtPrint.msg
Normal file
168
cde/lib/DtPrint/DtPrint.msg
Normal file
@@ -0,0 +1,168 @@
|
||||
$ *************************************<+>*************************************
|
||||
$ *****************************************************************************
|
||||
$ **
|
||||
$ ** File: DtPrint.msg
|
||||
$ **
|
||||
$ ** Project: DT
|
||||
$ **
|
||||
$ ** Description:
|
||||
$ ** -----------
|
||||
$ ** This file is the source for the message catalog for the Dt Print
|
||||
$ ** library.
|
||||
$ **
|
||||
$ **
|
||||
$ *****************************************************************************
|
||||
$ **
|
||||
$ ** (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 Digital Equipment Corporation.
|
||||
$ ** (c) Copyright 1996 FUJITSU LIMITED.
|
||||
$ ** (c) Copyright 1996 Hitachi.
|
||||
$ **
|
||||
$ *****************************************************************************
|
||||
$ **
|
||||
$ **
|
||||
$ ** $XConsortium: DtPrint.msg /main/18 1996/10/31 02:08:59 cde-hp $
|
||||
$ *****************************************************************************
|
||||
$ *****************************************************************************
|
||||
|
||||
$ *****************************************************************************
|
||||
$
|
||||
$ ***** 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) *****
|
||||
$
|
||||
$ ******************************************************************************
|
||||
|
||||
$quote "
|
||||
|
||||
$set 1
|
||||
$ *************************************************************
|
||||
$ ** **
|
||||
$ ** PrintSetupBox messages and labels **
|
||||
$ ** **
|
||||
$ *************************************************************
|
||||
$ Warning messages
|
||||
$ Note: do not localize the chars %s
|
||||
$
|
||||
$quote
|
||||
1 Invalid workAreaLocation resource setting.
|
||||
|
||||
$ Label values
|
||||
$
|
||||
2 More Printers...
|
||||
3 Print to File
|
||||
4 Select File...
|
||||
5 Cancel
|
||||
6 Copies:
|
||||
7 Help
|
||||
8 Print
|
||||
9 Printer Name:
|
||||
10 Setup...
|
||||
11 Printer Description:
|
||||
|
||||
$ Warning messages
|
||||
$ Note: do not localize the chars %s
|
||||
12 Copy count out of range.
|
||||
13 Invalid print setup mode.
|
||||
14 Print setup mode cannot be changed.
|
||||
|
||||
$ Label values
|
||||
$
|
||||
15 Info...
|
||||
|
||||
$ Warning messages
|
||||
$ Note: do not localize the chars %s
|
||||
16 Invalid Printer
|
||||
17 Printer %s not found on print server %s
|
||||
18 Unable to connect to print server %s
|
||||
19 X server %s does not support printing
|
||||
20 A default printer could not be determined
|
||||
21 An X print server for %s could not be found
|
||||
22 Printer name missing from specifier: %s
|
||||
23 Invalid print destination.
|
||||
24 Unable to convert from compound text.
|
||||
25 Arguments not needed for resource conversion.
|
||||
|
||||
$ Label values
|
||||
$
|
||||
26 Select Printer Error
|
||||
|
||||
$ Warning messages
|
||||
$ Note: do not localize the chars %s
|
||||
27 Unable to find any printers.
|
||||
|
||||
$ Label values
|
||||
$
|
||||
28 description unavailable
|
||||
29 Select File
|
||||
30 Printer Information
|
||||
31 Format:
|
||||
32 Printer Model:
|
||||
33 Printers:
|
||||
34 More Printers
|
||||
35 Print to Printer
|
||||
36 File Name:
|
||||
37 Print Setup - Help
|
||||
|
||||
$set 2
|
||||
$ *************************************************************
|
||||
$ ** **
|
||||
$ ** _DtPrint Frame GUI messages **
|
||||
$ ** **
|
||||
$ *************************************************************
|
||||
$
|
||||
$quote "
|
||||
|
||||
$ Label values for Margin Frame
|
||||
$
|
||||
1 "Margins"
|
||||
2 "Top:"
|
||||
3 "Right:"
|
||||
4 "Bottom:"
|
||||
5 "Left:"
|
||||
$
|
||||
$ Label values for Header/Footer Frame
|
||||
$
|
||||
6 "Headers and Footers"
|
||||
7 "Top Left:"
|
||||
8 "Top Right:"
|
||||
9 "Bottom Left:"
|
||||
10 "Bottom Right:"
|
||||
|
||||
$set 3
|
||||
$ *************************************************************
|
||||
$ ** **
|
||||
$ ** Dt Print Dialog Manager Job Options GUI messages **
|
||||
$ ** **
|
||||
$ *************************************************************
|
||||
$
|
||||
$quote
|
||||
|
||||
$ Label values for Margin Frame
|
||||
1 Send Mail When Done
|
||||
2 Banner Page Title:
|
||||
3 Print Command Options:
|
||||
49
cde/lib/DtPrint/Imakefile
Normal file
49
cde/lib/DtPrint/Imakefile
Normal file
@@ -0,0 +1,49 @@
|
||||
XCOMM $XConsortium: Imakefile /main/11 1996/10/31 02:09:04 cde-hp $
|
||||
#define DoNormalLib NormalLibDtPrint
|
||||
#define DoSharedLib SharedLibDtPrint
|
||||
#define DoDebugLib DebugLibDtPrint
|
||||
#define DoProfileLib ProfileLibDtPrint
|
||||
#define LibName DtPrint
|
||||
#define SoRev SODTPRINTREV
|
||||
#define IncSubdir Dt
|
||||
|
||||
#ifndef DtPrintDefines
|
||||
# define DtPrintDefines -DXK_MISCELLANY -DMULTIBYTE -DI18N_MSG
|
||||
#endif
|
||||
DEFINES = DtPrintDefines
|
||||
INCLUDES = -I.
|
||||
|
||||
#ifdef SharedDtPrintReqs
|
||||
REQUIREDLIBS = SharedDtPrintReqs
|
||||
#endif
|
||||
|
||||
HEADERS = \
|
||||
PrintMsgsP.h \
|
||||
PrintDlgMgrP.h \
|
||||
Print.h \
|
||||
PrintI.h \
|
||||
PrintOptionsP.h \
|
||||
PrintSetupBP.h \
|
||||
PsubDefProcI.h \
|
||||
PsubUtilI.h \
|
||||
dtpdmd.h
|
||||
|
||||
SRCS = \
|
||||
PrintMsgs.c \
|
||||
PrintDlgMgr.c \
|
||||
PrintOptions.c \
|
||||
PrintSetupB.c \
|
||||
PsubDefProc.c \
|
||||
PsubUtil.c
|
||||
|
||||
OBJS = \
|
||||
PrintMsgs.o \
|
||||
PrintDlgMgr.o \
|
||||
PrintOptions.o \
|
||||
PrintSetupB.o \
|
||||
PsubDefProc.o \
|
||||
PsubUtil.o
|
||||
|
||||
#include <Library.tmpl>
|
||||
|
||||
DependTarget()
|
||||
211
cde/lib/DtPrint/Print.h
Normal file
211
cde/lib/DtPrint/Print.h
Normal file
@@ -0,0 +1,211 @@
|
||||
/* $XConsortium: Print.h /main/13 1996/10/31 02:09:08 cde-hp $ */
|
||||
/*
|
||||
* DtPrint/Print.h
|
||||
*/
|
||||
/* (c) Copyright 1990, 1991, 1992, 1993, 1994 OPEN SOFTWARE FOUNDATION, INC.
|
||||
* ALL RIGHTS RESERVED
|
||||
* (c) Copyright 1989, 1996 DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
|
||||
* (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1995, 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 _DtPrint_h
|
||||
#define _DtPrint_h
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <X11/extensions/Print.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Class record constants
|
||||
*/
|
||||
externalref WidgetClass dtPrintSetupBoxWidgetClass;
|
||||
|
||||
typedef struct _DtPrintSetupBoxClassRec * DtPrintSetupBoxWidgetClass;
|
||||
typedef struct _DtPrintSetupBoxRec * DtPrintSetupBoxWidget;
|
||||
|
||||
|
||||
#ifndef DtIsPrintSetupBox
|
||||
#define DtIsPrintSetupBox(w) (XtIsSubclass (w, dtPrintSetupBoxWidgetClass))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Resource Names
|
||||
*/
|
||||
#define DtNcancelCallback "cancelCallback"
|
||||
#define DtNclosePrintDisplayCallback "closePrintDisplayCallback"
|
||||
#define DtNcopies "copies"
|
||||
#define DtNdescription "description"
|
||||
#define DtNdestroyContextCallback "destroyContextCallback"
|
||||
#define DtNfileName "fileName"
|
||||
#ifndef DtNminimizeButtons
|
||||
# define DtNminimizeButtons "minimizeButtons"
|
||||
#endif
|
||||
#define DtNoptionCount "optionCount"
|
||||
#define DtNoptions "options"
|
||||
#define DtNprintCallback "printCallback"
|
||||
#define DtNprintDestination "printDestination"
|
||||
#define DtNprinterInfoProc "printerInfoProc"
|
||||
#define DtNprinterName "printerName"
|
||||
#define DtNprintSetupMode "printSetupMode"
|
||||
#define DtNselectFileProc "selectFileProc"
|
||||
#define DtNselectPrinterProc "selectPrinterProc"
|
||||
#define DtNsetupCallback "setupCallback"
|
||||
#define DtNverifyPrinterProc "verifyPrinterProc"
|
||||
#define DtNworkAreaLocation "workAreaLocation"
|
||||
|
||||
#define DtCCancelCallback "CancelCallback"
|
||||
#define DtCClosePrintDisplayCallback "ClosePrintDisplayCallback"
|
||||
#define DtCCopies "Copies"
|
||||
#define DtCDescription "Description"
|
||||
#define DtCDestroyContextCallback "DestroyContextCallback"
|
||||
#define DtCFileName "FileName"
|
||||
#ifndef DtCMinimizeButtons
|
||||
# define DtCMinimizeButtons "MinimizeButtons"
|
||||
#endif
|
||||
#define DtCOptionCount "OptionCount"
|
||||
#define DtCOptions "Options"
|
||||
#define DtCPrintCallback "PrintCallback"
|
||||
#define DtCPrintDestination "PrintDestination"
|
||||
#define DtCPrinterInfoProc "PrinterInfoProc"
|
||||
#define DtCPrinterName "PrinterName"
|
||||
#define DtCPrintSetupMode "PrintSetupMode"
|
||||
#define DtCSelectFileProc "SelectFileProc"
|
||||
#define DtCSelectPrinterProc "SelectPrinterProc"
|
||||
#define DtCSetupCallback "SetupCallback"
|
||||
#define DtCVerifyPrinterProc "VerifyPrinterProc"
|
||||
#define DtCWorkAreaLocation "WorkAreaLocation"
|
||||
|
||||
#define DtRPrintSetupProc "PrintSetupProc"
|
||||
|
||||
/*
|
||||
* DtNsetupMode Resource Values
|
||||
*/
|
||||
enum {
|
||||
DtPRINT_SETUP_PLAIN,
|
||||
DtPRINT_SETUP_XP
|
||||
};
|
||||
|
||||
/*
|
||||
* DtNworkAreaLocation Resource Values
|
||||
*/
|
||||
enum {
|
||||
DtWORK_AREA_NONE,
|
||||
DtWORK_AREA_TOP,
|
||||
DtWORK_AREA_TOP_AND_BOTTOM,
|
||||
DtWORK_AREA_BOTTOM
|
||||
};
|
||||
|
||||
/*
|
||||
* DtNprintDestination Resource Values
|
||||
*/
|
||||
enum { DtPRINT_NO_DESTINATION, DtPRINT_TO_PRINTER, DtPRINT_TO_FILE };
|
||||
|
||||
/*
|
||||
* DtNprinterNameMode Resource Values
|
||||
*/
|
||||
enum { DtSHORT_NAME, DtMEDIUM_NAME, DtLONG_NAME };
|
||||
|
||||
/*
|
||||
* Mode values for DtPrintSetupBoxResetConnection()
|
||||
*/
|
||||
typedef enum {
|
||||
DtPRINT_CLOSE_CONNECTION,
|
||||
DtPRINT_RELEASE_CONNECTION
|
||||
} DtPrintResetConnectionMode;
|
||||
|
||||
/*
|
||||
* Callback Reasons
|
||||
*/
|
||||
enum {
|
||||
DtPRINT_CR_NONE,
|
||||
DtPRINT_CR_CANCEL,
|
||||
DtPRINT_CR_CLOSE_PRINT_DISPLAY,
|
||||
DtPRINT_CR_PRINT,
|
||||
DtPRINT_CR_SETUP
|
||||
};
|
||||
|
||||
/*
|
||||
* DtPrint proecdure return values
|
||||
*/
|
||||
enum {
|
||||
DtPRINT_SUCCESS,
|
||||
DtPRINT_BAD_PARM,
|
||||
DtPRINT_FAILURE,
|
||||
DtPRINT_INVALID_DISPLAY,
|
||||
DtPRINT_NOT_XP_DISPLAY,
|
||||
DtPRINT_NO_CONNECTION,
|
||||
DtPRINT_NO_DEFAULT,
|
||||
DtPRINT_NO_DEFAULT_DISPLAY,
|
||||
DtPRINT_NO_PRINTER,
|
||||
DtPRINT_PRINTER_MISSING
|
||||
};
|
||||
|
||||
enum {
|
||||
DtPRINT_HINT_MESSAGES_OK,
|
||||
DtPRINT_HINT_NO_MESSAGES
|
||||
};
|
||||
|
||||
/*
|
||||
* PrintSetupBox Callback Structure Definition
|
||||
*/
|
||||
typedef struct _DtPrintSetupData
|
||||
{
|
||||
String printer_name;
|
||||
Display *print_display;
|
||||
XPContext print_context;
|
||||
XtEnum destination;
|
||||
String dest_info;
|
||||
XtEnum messages_hint;
|
||||
} DtPrintSetupData;
|
||||
|
||||
typedef struct _DtPrintSetupCallbackStruct
|
||||
{
|
||||
int reason;
|
||||
XEvent *event;
|
||||
DtPrintSetupData *print_data;
|
||||
} DtPrintSetupCallbackStruct;
|
||||
|
||||
/*
|
||||
* PrintSetupBox Procedure Resource Type Definition
|
||||
*/
|
||||
typedef XtEnum (*DtPrintSetupProc)(Widget, DtPrintSetupData*);
|
||||
|
||||
/*
|
||||
* Public Function Declarations
|
||||
*/
|
||||
extern Widget DtCreatePrintSetupBox(
|
||||
Widget p,
|
||||
String name,
|
||||
ArgList args,
|
||||
Cardinal n) ;
|
||||
extern Widget DtCreatePrintSetupDialog(
|
||||
Widget ds_p,
|
||||
String name,
|
||||
ArgList sb_args,
|
||||
Cardinal sb_n) ;
|
||||
extern DtPrintSetupData* DtPrintCopySetupData(
|
||||
DtPrintSetupData* target,
|
||||
const DtPrintSetupData* source);
|
||||
extern XtEnum DtPrintFillSetupData(
|
||||
Widget psub,
|
||||
DtPrintSetupData* print_data);
|
||||
extern void DtPrintFreeSetupData(
|
||||
DtPrintSetupData* target);
|
||||
extern XtEnum DtPrintResetConnection(
|
||||
Widget psub,
|
||||
DtPrintResetConnectionMode m);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _DtPrint_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
160
cde/lib/DtPrint/PrintDlgMgr.c
Normal file
160
cde/lib/DtPrint/PrintDlgMgr.c
Normal file
@@ -0,0 +1,160 @@
|
||||
/* $XConsortium: PrintDlgMgr.c /main/7 1996/08/12 18:40:50 cde-hp $ */
|
||||
/*
|
||||
* DtPrint/PrintDlgMgr.c
|
||||
*/
|
||||
/*
|
||||
* (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.
|
||||
*/
|
||||
#include <Dt/PrintDlgMgrP.h>
|
||||
#include <Dt/PrintMsgsP.h>
|
||||
|
||||
#include <Xm/XmAll.h>
|
||||
|
||||
#define SEND_MAIL_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintDlgMgrSet, DTPDM_SEND_MAIL_LABEL, _DtPrMsgPrintDlgMgr_0000)
|
||||
#define BANNER_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintDlgMgrSet, DTPDM_BANNER_LABEL, _DtPrMsgPrintDlgMgr_0001)
|
||||
#define SPOOL_OPTS_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintDlgMgrSet, DTPDM_SPOOL_OPTS_LABEL, _DtPrMsgPrintDlgMgr_0002)
|
||||
|
||||
Widget _DtCreatePDMJobSetup(Widget parent)
|
||||
{
|
||||
Widget manager;
|
||||
Widget send_mail, banner_label, banner, spool_opts_label, spool_opts;
|
||||
XmString label;
|
||||
Dimension banner_label_width, banner_label_height;
|
||||
Dimension banner_height;
|
||||
Dimension spool_opts_label_width, spool_opts_label_height;
|
||||
Dimension spool_opts_height;
|
||||
Position offset; /* vertical offset between text fields and their labels */
|
||||
Dimension vspace = 10; /* space between the "rows" */
|
||||
/*
|
||||
* create the manager for the Job Setup Box
|
||||
*/
|
||||
manager =
|
||||
XtVaCreateManagedWidget("JobSetup", xmFormWidgetClass, parent,
|
||||
XmNallowOverlap, False,
|
||||
NULL);
|
||||
/*
|
||||
* send mail control
|
||||
*/
|
||||
label = XmStringCreateLocalized(SEND_MAIL_LABEL);
|
||||
send_mail =
|
||||
XmVaCreateSimpleCheckBox(manager, "SendMail", NULL,
|
||||
XmVaCHECKBUTTON, label, NULL, NULL, NULL,
|
||||
NULL);
|
||||
XmStringFree(label);
|
||||
XtManageChild(send_mail);
|
||||
/*
|
||||
* banner page title
|
||||
*/
|
||||
label = XmStringCreateLocalized(BANNER_LABEL);
|
||||
banner_label =
|
||||
XtVaCreateManagedWidget("BannerLabel",
|
||||
xmLabelWidgetClass,
|
||||
manager,
|
||||
XmNlabelString, label,
|
||||
XmNalignment, XmALIGNMENT_END,
|
||||
NULL);
|
||||
XmStringFree(label);
|
||||
banner =
|
||||
XtVaCreateManagedWidget("Banner",
|
||||
xmTextFieldWidgetClass,
|
||||
manager,
|
||||
NULL);
|
||||
/*
|
||||
* spooler command options
|
||||
*/
|
||||
label = XmStringCreateLocalized(SPOOL_OPTS_LABEL);
|
||||
spool_opts_label =
|
||||
XtVaCreateManagedWidget("OptionsLabel",
|
||||
xmLabelWidgetClass,
|
||||
manager,
|
||||
XmNlabelString, label,
|
||||
XmNalignment, XmALIGNMENT_END,
|
||||
NULL);
|
||||
XmStringFree(label);
|
||||
spool_opts =
|
||||
XtVaCreateManagedWidget("Options",
|
||||
xmTextFieldWidgetClass,
|
||||
manager,
|
||||
NULL);
|
||||
/*
|
||||
* retrieve various dimensions of form children
|
||||
*/
|
||||
XtVaGetValues(banner_label,
|
||||
XmNwidth, &banner_label_width,
|
||||
XmNheight, &banner_label_height,
|
||||
NULL);
|
||||
XtVaGetValues(banner,
|
||||
XmNheight, &banner_height,
|
||||
NULL);
|
||||
XtVaGetValues(spool_opts_label,
|
||||
XmNwidth, &spool_opts_label_width,
|
||||
XmNheight, &spool_opts_label_height,
|
||||
NULL);
|
||||
XtVaGetValues(spool_opts,
|
||||
XmNheight, &spool_opts_height,
|
||||
NULL);
|
||||
/*
|
||||
* set the width of the shorter text field to match the longest
|
||||
*/
|
||||
if(banner_label_width < spool_opts_label_width)
|
||||
XtVaSetValues(banner_label,
|
||||
XmNwidth, spool_opts_label_width,
|
||||
XmNrecomputeSize, False,
|
||||
NULL);
|
||||
else
|
||||
XtVaSetValues(spool_opts_label,
|
||||
XmNwidth, banner_label_width,
|
||||
XmNrecomputeSize, False,
|
||||
NULL);
|
||||
/*
|
||||
* layout the form children
|
||||
*/
|
||||
XtVaSetValues(send_mail,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
offset = ((Position)banner_height - (Position)banner_label_height) / 2;
|
||||
XtVaSetValues(banner_label,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, send_mail,
|
||||
XmNtopOffset, vspace + (offset > 0 ? offset : 0),
|
||||
NULL);
|
||||
XtVaSetValues(banner,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, banner_label,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNtopWidget, banner_label,
|
||||
XmNtopOffset, -offset,
|
||||
NULL);
|
||||
offset =
|
||||
((Position)spool_opts_height - (Position)spool_opts_label_height) / 2;
|
||||
XtVaSetValues(spool_opts_label,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, banner_label,
|
||||
XmNtopOffset, vspace + (offset > 0 ? offset : 0),
|
||||
NULL);
|
||||
XtVaSetValues(spool_opts,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, spool_opts_label,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNtopWidget, spool_opts_label,
|
||||
XmNtopOffset, -offset,
|
||||
NULL);
|
||||
/*
|
||||
* return the new Job Setup Box
|
||||
*/
|
||||
return manager;
|
||||
}
|
||||
30
cde/lib/DtPrint/PrintDlgMgrP.h
Normal file
30
cde/lib/DtPrint/PrintDlgMgrP.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/* $XConsortium: PrintDlgMgrP.h /main/3 1996/08/12 18:40:55 cde-hp $ */
|
||||
/*
|
||||
* DtPrint/PrintDlgMgrP.h
|
||||
*/
|
||||
/*
|
||||
* (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 _PrintDlgMgrP_h
|
||||
#define _PrintDlgMgrP_h
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern Widget _DtCreatePDMJobSetup(Widget Parent);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _DtPrintDlgMgrP_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
50
cde/lib/DtPrint/PrintI.h
Normal file
50
cde/lib/DtPrint/PrintI.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/* $XConsortium: PrintI.h /main/1 1996/10/31 11:19:07 drk $
|
||||
*
|
||||
* (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 _DtPrintI_h
|
||||
#define _DtPrintI_h
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******** Conditionally defined macros for thread safe DtPrint ******/
|
||||
#ifdef XTHREADS
|
||||
|
||||
#define _DtPrintWidgetToAppContext(w) \
|
||||
XtAppContext app = XtWidgetToApplicationContext(w)
|
||||
|
||||
#define _DtPrintDisplayToAppContext(d) \
|
||||
XtAppContext app = XtDisplayToApplicationContext(d)
|
||||
|
||||
#define _DtPrintAppLock(app) XtAppLock(app)
|
||||
#define _DtPrintAppUnlock(app) XtAppUnlock(app)
|
||||
#define _DtPrintProcessLock() XtProcessLock()
|
||||
#define _DtPrintProcessUnlock() XtProcessUnlock()
|
||||
|
||||
#else /* XTHREADS */
|
||||
|
||||
#define _DtPrintWidgetToAppContext(w)
|
||||
#define _DtPrintDisplayToAppContext(d)
|
||||
#define _DtPrintAppLock(app)
|
||||
#define _DtPrintAppUnlock(app)
|
||||
#define _DtPrintProcessLock()
|
||||
#define _DtPrintProcessUnlock()
|
||||
|
||||
#endif /* XTHREADS */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _DtPrintI_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
261
cde/lib/DtPrint/PrintMsgs.c
Normal file
261
cde/lib/DtPrint/PrintMsgs.c
Normal file
@@ -0,0 +1,261 @@
|
||||
/* $TOG: PrintMsgs.c /main/14 1999/10/14 13:54:53 mgreess $ */
|
||||
/*
|
||||
* DtPrint/PrintMsgs.c
|
||||
*/
|
||||
/*
|
||||
* (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.
|
||||
*/
|
||||
|
||||
#ifdef I18N_MSG
|
||||
|
||||
#include <stdio.h>
|
||||
#include <nl_types.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <Dt/PrintI.h>
|
||||
|
||||
#if !defined(NL_CAT_LOCALE)
|
||||
#define NL_CAT_LOCALE 0
|
||||
#endif
|
||||
|
||||
#define _DTPRINT_CAT_NAME "DtPrint"
|
||||
|
||||
#endif /* I18N_MSG */
|
||||
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
* PrintSetupB module messages
|
||||
*/
|
||||
const char _DtPrMsgPrintSetupBox_0000[] =
|
||||
"Invalid workAreaLocation resource setting.";
|
||||
const char _DtPrMsgPrintSetupBox_0001[] =
|
||||
"More Printers...";
|
||||
const char _DtPrMsgPrintSetupBox_0002[] =
|
||||
"Print to File";
|
||||
const char _DtPrMsgPrintSetupBox_0003[] =
|
||||
"Select File...";
|
||||
const char _DtPrMsgPrintSetupBox_0004[] =
|
||||
"Cancel";
|
||||
const char _DtPrMsgPrintSetupBox_0005[] =
|
||||
"Copies:";
|
||||
const char _DtPrMsgPrintSetupBox_0006[] =
|
||||
"Help";
|
||||
const char _DtPrMsgPrintSetupBox_0007[] =
|
||||
"Print";
|
||||
const char _DtPrMsgPrintSetupBox_0008[] =
|
||||
"Printer Name:";
|
||||
const char _DtPrMsgPrintSetupBox_0009[] =
|
||||
"Setup...";
|
||||
const char _DtPrMsgPrintSetupBox_0010[] =
|
||||
"Printer Description:";
|
||||
const char _DtPrMsgPrintSetupBox_0011[] =
|
||||
"Copy count out of range.";
|
||||
const char _DtPrMsgPrintSetupBox_0012[] =
|
||||
"Invalid print setup mode.";
|
||||
const char _DtPrMsgPrintSetupBox_0013[] =
|
||||
"Print setup mode cannot be changed.";
|
||||
const char _DtPrMsgPrintSetupBox_0014[] =
|
||||
"Printer Info...";
|
||||
const char _DtPrMsgPrintSetupBox_0015[] =
|
||||
"Invalid Printer";
|
||||
const char _DtPrMsgPrintSetupBox_0016[] =
|
||||
"Printer %s not found on X print server %s";
|
||||
const char _DtPrMsgPrintSetupBox_0017[] =
|
||||
"Unable to connect to X print server %s";
|
||||
const char _DtPrMsgPrintSetupBox_0018[] =
|
||||
"X server %s does not support printing";
|
||||
const char _DtPrMsgPrintSetupBox_0019[] =
|
||||
"A default printer could not be determined";
|
||||
const char _DtPrMsgPrintSetupBox_0020[] =
|
||||
"An X print server for %s could not be found";
|
||||
const char _DtPrMsgPrintSetupBox_0021[] =
|
||||
"Printer name missing from specifier: %s";
|
||||
const char _DtPrMsgPrintSetupBox_0022[] =
|
||||
"Invalid print destination.";
|
||||
const char _DtPrMsgPrintSetupBox_0023[] =
|
||||
"Unable to convert from compound text.";
|
||||
const char _DtPrMsgPrintSetupBox_0024[] =
|
||||
"Arguments not needed for resource conversion.";
|
||||
const char _DtPrMsgPrintSetupBox_0025[] =
|
||||
"Select Printer Error";
|
||||
const char _DtPrMsgPrintSetupBox_0026[] =
|
||||
"Unable to find any printers.";
|
||||
const char _DtPrMsgPrintSetupBox_0027[] =
|
||||
"description unavailable";
|
||||
const char _DtPrMsgPrintSetupBox_0028[] =
|
||||
"Select File";
|
||||
const char _DtPrMsgPrintSetupBox_0029[] =
|
||||
"Printer Information";
|
||||
const char _DtPrMsgPrintSetupBox_0030[] =
|
||||
"Format:";
|
||||
const char _DtPrMsgPrintSetupBox_0031[] =
|
||||
"Printer Model:";
|
||||
const char _DtPrMsgPrintSetupBox_0032[] =
|
||||
"Printers:";
|
||||
const char _DtPrMsgPrintSetupBox_0033[] =
|
||||
"More Printers";
|
||||
const char _DtPrMsgPrintSetupBox_0034[] =
|
||||
"Print to Printer";
|
||||
const char _DtPrMsgPrintSetupBox_0035[] =
|
||||
"File Name:";
|
||||
const char _DtPrMsgPrintSetupBox_0036[] =
|
||||
"Print Setup - Help";
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
* _DtPrint Frame widget messages
|
||||
*/
|
||||
const char _DtPrMsgPrintOption_0000[] = "Margins";
|
||||
const char _DtPrMsgPrintOption_0001[] = "Top:";
|
||||
const char _DtPrMsgPrintOption_0002[] = "Right:";
|
||||
const char _DtPrMsgPrintOption_0003[] = "Bottom:";
|
||||
const char _DtPrMsgPrintOption_0004[] = "Left:";
|
||||
|
||||
const char _DtPrMsgPrintOption_0005[] = "Headers and Footers";
|
||||
const char _DtPrMsgPrintOption_0006[] = "Top Left:";
|
||||
const char _DtPrMsgPrintOption_0007[] = "Top Right:";
|
||||
const char _DtPrMsgPrintOption_0008[] = "Bottom Left:";
|
||||
const char _DtPrMsgPrintOption_0009[] = "Bottom Right:";
|
||||
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
* Dt Print Dialog Manager module messages
|
||||
*/
|
||||
const char _DtPrMsgPrintDlgMgr_0000[] = "Send Mail When Done";
|
||||
const char _DtPrMsgPrintDlgMgr_0001[] = "Banner Page Title:";
|
||||
const char _DtPrMsgPrintDlgMgr_0002[] = "Print Command Options:";
|
||||
|
||||
#if defined(I18N_MSG)
|
||||
|
||||
#if defined(hpV4)
|
||||
/*
|
||||
* Wrapper around catgets -- this makes sure the message string is saved
|
||||
* in a safe location; so repeated calls to catgets() do not overwrite
|
||||
* the catgets() internal buffer. This has been a problem on HP systems.
|
||||
*/
|
||||
static char *catgets_cached(nl_catd catd, int set, int num, char *dflt)
|
||||
{
|
||||
#define INITIAL_NMSGS_PER_SET 300
|
||||
#define INITIAL_NSETS 50
|
||||
|
||||
/* array to hold messages from catalog */
|
||||
static char ***cached_msgs = NULL;
|
||||
static int nmsgs_per_set = INITIAL_NMSGS_PER_SET;
|
||||
static int nsets = INITIAL_NSETS;
|
||||
|
||||
char **setptr;
|
||||
int i, multiplier;
|
||||
Cardinal size;
|
||||
|
||||
char* message;
|
||||
|
||||
/* convert to a zero based index */
|
||||
int setIdx = set - 1;
|
||||
int numIdx = num - 1;
|
||||
|
||||
_DtPrintProcessLock();
|
||||
|
||||
if (NULL == cached_msgs)
|
||||
{
|
||||
size = sizeof(char**) * nsets;
|
||||
cached_msgs = (char***) XtMalloc(size);
|
||||
memset((char*) cached_msgs, 0, size);
|
||||
}
|
||||
else if (setIdx >= nsets)
|
||||
{
|
||||
for (multiplier=2; setIdx > multiplier*nsets; multiplier++) {}
|
||||
size = sizeof(char**) * nsets;
|
||||
cached_msgs = (char***) XtRealloc((char*) cached_msgs, multiplier * size);
|
||||
memset((char*) (cached_msgs + size), 0, multiplier * size);
|
||||
nsets *= multiplier;
|
||||
}
|
||||
|
||||
if (NULL == cached_msgs[setIdx])
|
||||
{
|
||||
size = sizeof(char*) * nmsgs_per_set;
|
||||
cached_msgs[setIdx] = (char**) XtMalloc(size);
|
||||
memset((char*) cached_msgs[setIdx], 0, size);
|
||||
}
|
||||
else if (numIdx >= nmsgs_per_set)
|
||||
{
|
||||
for (multiplier=2; numIdx > multiplier*nsets; multiplier++) {}
|
||||
size = sizeof(char*) * nmsgs_per_set;
|
||||
|
||||
for (i=0; i<nmsgs_per_set; i++)
|
||||
{
|
||||
if (NULL != cached_msgs[i])
|
||||
{
|
||||
cached_msgs[i] =
|
||||
(char**) XtRealloc((char*) cached_msgs[i], multiplier * size);
|
||||
memset((char*) (cached_msgs[i] + size), 0, multiplier * size);
|
||||
}
|
||||
}
|
||||
nmsgs_per_set *= multiplier;
|
||||
}
|
||||
|
||||
setptr = cached_msgs[setIdx];
|
||||
if (NULL == setptr[numIdx])
|
||||
setptr[numIdx] = strdup(catgets(catd, set, num, dflt));
|
||||
|
||||
message = setptr[numIdx];
|
||||
|
||||
_DtPrintProcessUnlock();
|
||||
|
||||
return message;
|
||||
}
|
||||
#endif /* hpV4 */
|
||||
|
||||
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
* Name: _DtPrintGetMessage
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* int set - The message catalog set number.
|
||||
*
|
||||
* int n - The message number.
|
||||
*
|
||||
* char *s - The default message if the message is not
|
||||
* retrieved from a message catalog.
|
||||
*
|
||||
* Returns: the string for set 'set' and number 'n'.
|
||||
*/
|
||||
char *
|
||||
_DtPrintGetMessage(
|
||||
int set,
|
||||
int n,
|
||||
char * s)
|
||||
{
|
||||
char *msg;
|
||||
nl_catd catopen();
|
||||
char *catgets();
|
||||
static int first = 1;
|
||||
static nl_catd nlmsg_fd;
|
||||
|
||||
if(first)
|
||||
{
|
||||
_DtPrintProcessLock();
|
||||
if(first)
|
||||
{
|
||||
first = 0;
|
||||
nlmsg_fd = catopen(_DTPRINT_CAT_NAME, NL_CAT_LOCALE);
|
||||
}
|
||||
_DtPrintProcessUnlock();
|
||||
}
|
||||
#if defined(hpV4)
|
||||
msg=catgets_cached(nlmsg_fd,set,n,s);
|
||||
#else
|
||||
msg=catgets(nlmsg_fd,set,n,s);
|
||||
#endif
|
||||
return (msg);
|
||||
|
||||
}
|
||||
#endif /* I18N_MSG */
|
||||
181
cde/lib/DtPrint/PrintMsgsP.h
Normal file
181
cde/lib/DtPrint/PrintMsgsP.h
Normal file
@@ -0,0 +1,181 @@
|
||||
/* $XConsortium: PrintMsgsP.h /main/9 1996/08/19 17:12:12 cde-hp $ */
|
||||
/*
|
||||
* DtPrint/PrintMsgsP.h
|
||||
*/
|
||||
/*
|
||||
* (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 _DtPrintMsgsP_h
|
||||
#define _DtPrintMsgsP_h
|
||||
|
||||
#ifdef I18N_MSG
|
||||
#include <nl_types.h>
|
||||
#define DTPRINT_GETMESSAGE(set, number, string) \
|
||||
_DtPrintGetMessage(set, number, string)
|
||||
|
||||
#else /* I18N_MSG */
|
||||
#define DTPRINT_GETMESSAGE(set, number, string) string
|
||||
#endif /* I18N_MSG */
|
||||
|
||||
/*** const causes the HP compiler to complain. Remove reference until ***
|
||||
*** the build and integration people can figure out how to get this to ***
|
||||
*** work. ***/
|
||||
|
||||
/* #define CONST const */
|
||||
#define CONST
|
||||
|
||||
|
||||
/*
|
||||
* extern declarations for PrintSetupBox widget messages
|
||||
*/
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0000[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0001[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0002[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0003[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0004[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0005[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0006[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0007[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0008[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0009[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0010[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0011[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0012[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0013[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0014[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0015[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0016[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0017[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0018[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0019[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0020[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0021[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0022[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0023[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0024[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0025[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0026[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0027[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0028[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0029[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0030[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0031[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0032[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0033[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0034[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0035[];
|
||||
extern CONST char _DtPrMsgPrintSetupBox_0036[];
|
||||
|
||||
/*
|
||||
* Message set for PrintSetupBox widget
|
||||
*/
|
||||
#define MS_PrintSetupBox 1
|
||||
|
||||
/* Message IDs for PrintSetupBox */
|
||||
#define PSUB_WARN_WA_LOCATION 1
|
||||
#define PSUB_SELECT_PRINTER 2
|
||||
#define PSUB_PRINT_TO_FILE 3
|
||||
#define PSUB_SELECT_FILE 4
|
||||
#define PSUB_CANCEL 5
|
||||
#define PSUB_COPIES 6
|
||||
#define PSUB_HELP 7
|
||||
#define PSUB_PRINT 8
|
||||
#define PSUB_PRINTER_NAME 9
|
||||
#define PSUB_SETUP 10
|
||||
#define PSUB_DESCRIPTION 11
|
||||
#define PSUB_WARN_COPY_COUNT 12
|
||||
#define PSUB_WARN_SETUP_MODE 13
|
||||
#define PSUB_WARN_SETUP_MODE_CHANGE 14
|
||||
#define PSUB_PRINTER_INFO 15
|
||||
#define PSUB_INVALID_PRINTER_TITLE 16
|
||||
#define PSUB_INVALID_PRINTER_MESSAGE 17
|
||||
#define PSUB_INVALID_DISPLAY_MESSAGE 18
|
||||
#define PSUB_NOT_XP_DISPLAY_MESSAGE 19
|
||||
#define PSUB_NO_DEFAULT_MESSAGE 20
|
||||
#define PSUB_NO_DEFAULT_DISPLAY_MESSAGE 21
|
||||
#define PSUB_PRINTER_MISSING_MESSAGE 22
|
||||
#define PSUB_WARN_PRINT_DESTINATION 23
|
||||
#define PSUB_WARN_CT_CONVERSION 24
|
||||
#define PSUB_WARN_CONVERSION_ARGS 25
|
||||
#define PSUB_PRLIST_ERROR_TITLE 26
|
||||
#define PSUB_NO_PRINTERS_MESSAGE 27
|
||||
#define PSUB_DESC_UNAVAILABLE 28
|
||||
#define PSUB_SELECT_FILE_TITLE 29
|
||||
#define PSUB_PRINTER_INFO_TITLE 30
|
||||
#define PSUB_FORMAT_LABEL 31
|
||||
#define PSUB_MODEL_LABEL 32
|
||||
#define PSUB_PRINTER_LIST_LABEL 33
|
||||
#define PSUB_MORE_PRINTERS_TITLE 34
|
||||
#define PSUB_PRINT_TO_PRINTER 35
|
||||
#define PSUB_FILE_NAME 36
|
||||
#define PSUB_HELP_DLG_TITLE 37
|
||||
|
||||
/*
|
||||
* extern declarations for _DtPrint frame widgets
|
||||
*/
|
||||
extern CONST char _DtPrMsgPrintOption_0000[];
|
||||
extern CONST char _DtPrMsgPrintOption_0001[];
|
||||
extern CONST char _DtPrMsgPrintOption_0002[];
|
||||
extern CONST char _DtPrMsgPrintOption_0003[];
|
||||
extern CONST char _DtPrMsgPrintOption_0004[];
|
||||
extern CONST char _DtPrMsgPrintOption_0005[];
|
||||
extern CONST char _DtPrMsgPrintOption_0006[];
|
||||
extern CONST char _DtPrMsgPrintOption_0007[];
|
||||
extern CONST char _DtPrMsgPrintOption_0008[];
|
||||
extern CONST char _DtPrMsgPrintOption_0009[];
|
||||
|
||||
/*
|
||||
* Message set for _DtPrint frame widgets
|
||||
*/
|
||||
#define MS_PrintOptionsSet 2
|
||||
|
||||
/*
|
||||
* Message IDs for _DtPrint frame widgets
|
||||
*/
|
||||
#define DTPO_MARGINS 1
|
||||
#define DTPO_TOP 2
|
||||
#define DTPO_RIGHT 3
|
||||
#define DTPO_BOTTOM 4
|
||||
#define DTPO_LEFT 5
|
||||
|
||||
#define DTPO_HEADERS_N_FOOTERS 6
|
||||
#define DTPO_TOP_LEFT 7
|
||||
#define DTPO_TOP_RIGHT 8
|
||||
#define DTPO_BOTTOM_LEFT 9
|
||||
#define DTPO_BOTTOM_RIGHT 10
|
||||
|
||||
/*
|
||||
* extern declarations for PrintDlgMgr module
|
||||
*/
|
||||
extern CONST char _DtPrMsgPrintDlgMgr_0000[];
|
||||
extern CONST char _DtPrMsgPrintDlgMgr_0001[];
|
||||
extern CONST char _DtPrMsgPrintDlgMgr_0002[];
|
||||
|
||||
/*
|
||||
* Message set for PrintDlgMgr module
|
||||
*/
|
||||
#define MS_PrintDlgMgrSet 3
|
||||
|
||||
/*
|
||||
* Message IDs for PrintDlgMgr module
|
||||
*/
|
||||
#define DTPDM_SEND_MAIL_LABEL 1
|
||||
#define DTPDM_BANNER_LABEL 2
|
||||
#define DTPDM_SPOOL_OPTS_LABEL 3
|
||||
|
||||
|
||||
#ifdef I18N_MSG
|
||||
extern char * _DtPrintGetMessage(
|
||||
int set,
|
||||
int n,
|
||||
char * s);
|
||||
|
||||
#endif /* I18N_MSG */
|
||||
|
||||
#endif /* _DtPrintMsgsP_h */
|
||||
832
cde/lib/DtPrint/PrintOptions.c
Normal file
832
cde/lib/DtPrint/PrintOptions.c
Normal file
@@ -0,0 +1,832 @@
|
||||
/* $XConsortium: PrintOptions.c /main/4 1996/04/29 17:12:37 rswiston $ */
|
||||
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* $:$
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1994 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
/*
|
||||
* Common Desktop Environment
|
||||
*
|
||||
* (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company
|
||||
* (c) Copyright 1993, 1994, 1995 International Business Machines Corp.
|
||||
* (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1993, 1994, 1995 Novell, Inc.
|
||||
* (c) Copyright 1995 Digital Equipment Corp.
|
||||
* (c) Copyright 1995 Fujitsu Limited
|
||||
* (c) Copyright 1995 Hitachi, Ltd.
|
||||
*
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND
|
||||
*
|
||||
* Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
* restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
|
||||
* Technical Data and Computer Software clause in DFARS 252.227-7013. Rights
|
||||
* for non-DOD U.S. Government Departments and Agencies are as set forth in
|
||||
* FAR 52.227-19(c)(1,2).
|
||||
*
|
||||
* Hewlett-Packard Company, 3000 Hanover Street, Palo Alto, CA 94304 U.S.A.
|
||||
* International Business Machines Corp., Route 100, Somers, NY 10589 U.S.A.
|
||||
* Sun Microsystems, Inc., 2550 Garcia Avenue, Mountain View, CA 94043 U.S.A.
|
||||
* Novell, Inc., 190 River Road, Summit, NJ 07901 U.S.A.
|
||||
* Digital Equipment Corp., 111 Powdermill Road, Maynard, MA 01754, U.S.A.
|
||||
* Fujitsu Limited, 1015, Kamikodanaka Nakahara-Ku, Kawasaki 211, Japan
|
||||
* Hitachi, Ltd., 6, Kanda Surugadai 4-Chome, Chiyoda-ku, Tokyo 101, Japan
|
||||
*/
|
||||
|
||||
#include <Xm/XmAll.h>
|
||||
#include "Dt/Print.h"
|
||||
#include "PrintMsgsP.h"
|
||||
#include "PrintOptionsP.h"
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Static functions
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
_DtPrintDestroyHdrFtrFrameCB(
|
||||
Widget frame,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data
|
||||
);
|
||||
static void
|
||||
_DtPrintDestroyMarginFrameCB(
|
||||
Widget frame,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data
|
||||
);
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* _DtPrint Header/Footer API
|
||||
*
|
||||
******************************************************************************/
|
||||
typedef struct dtpo_header_footer_spec
|
||||
{
|
||||
Widget button;
|
||||
void *data;
|
||||
char *string;
|
||||
} DtpoHdrFtrSpec;
|
||||
|
||||
typedef struct dtpo_header_footer_frame
|
||||
{
|
||||
Widget frame,
|
||||
label,
|
||||
form,
|
||||
menu,
|
||||
top_left,
|
||||
top_right,
|
||||
bottom_left,
|
||||
bottom_right;
|
||||
|
||||
int nspecs;
|
||||
DtpoHdrFtrSpec *specs;
|
||||
} DtpoHdrFtrFrame;
|
||||
|
||||
static void
|
||||
_DtPrintDestroyHdrFtrFrameCB(
|
||||
Widget frame,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data
|
||||
)
|
||||
{
|
||||
DtpoHdrFtrFrame *info = (DtpoHdrFtrFrame *) client_data;
|
||||
|
||||
if (info == NULL) return;
|
||||
if (info->specs != NULL)
|
||||
XtFree((char*) info->specs);
|
||||
XtFree((char*) info);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Function: _DtPrintCreateHdrFtrFrame
|
||||
*
|
||||
* Creates a frame for specifying the contents of page headers and footers.
|
||||
* The frame contains four option menus, one for each _DtPrintHdrFtrEnum.
|
||||
* The pulldown menus for the option menu are constructed from the .string
|
||||
* field in the array of _DtPrintHdrFtrSpec in "specs".
|
||||
*
|
||||
* _DtPrintCreateHdrFtrFrame copies the pointer to the array of
|
||||
* _DtPrintHdrFtrSpec. IT DOES NOT COPY THE ELEMENTS OF THE ARRAY.
|
||||
*
|
||||
* parent - specifies the parent of the frame.
|
||||
* nspecs - specifies the number of entries in the specs array.
|
||||
* specs - array of header/footer specifiers. The .string
|
||||
* field is used to construct labels in the GUI.
|
||||
* The .data field is returned in calls to
|
||||
* _DtPrintGetHdrFtrSpec.
|
||||
*
|
||||
* Returns the widget id for the frame.
|
||||
*/
|
||||
Widget
|
||||
_DtPrintCreateHdrFtrFrame(
|
||||
Widget parent,
|
||||
int nspecs,
|
||||
char **spec_strings,
|
||||
void **spec_data
|
||||
)
|
||||
{
|
||||
DtpoHdrFtrFrame *info;
|
||||
Arg args[16];
|
||||
int n;
|
||||
int i;
|
||||
XmString xms;
|
||||
|
||||
info = (DtpoHdrFtrFrame *) XtMalloc( sizeof(DtpoHdrFtrFrame) );
|
||||
info->nspecs = nspecs;
|
||||
info->specs = (DtpoHdrFtrSpec *) XtMalloc(nspecs*sizeof(DtpoHdrFtrSpec));
|
||||
for (i=0; i<nspecs; i++)
|
||||
{
|
||||
info->specs[i].string = spec_strings[i];
|
||||
if (spec_data != (void*) NULL)
|
||||
info->specs[i].data = spec_data[i];
|
||||
else
|
||||
info->specs[i].data = (void*) NULL;
|
||||
info->specs[i].button = (Widget) NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Create the frame and attach add a destroyCallback to clean up
|
||||
* memory allocated for this object.
|
||||
*/
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNchildHorizontalAlignment, XmALIGNMENT_BEGINNING); n++;
|
||||
XtSetArg(args[n], XmNchildVerticalAlignment, XmALIGNMENT_CENTER); n++;
|
||||
XtSetArg(args[n], XmNuserData, info); n++;
|
||||
info->frame = XmCreateFrame(parent, "HdrFtrFrame", args, n);
|
||||
XtAddCallback(
|
||||
info->frame,
|
||||
XmNdestroyCallback,
|
||||
_DtPrintDestroyHdrFtrFrameCB,
|
||||
(XtPointer) info
|
||||
);
|
||||
|
||||
/*
|
||||
* Create a label child for the frame
|
||||
*/
|
||||
xms = XmStringCreateLocalized(DTPO_HEADERFOOTER_FRAME_LABEL);
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNchildType, XmFRAME_TITLE_CHILD); n++;
|
||||
XtSetArg(args[n], XmNchildHorizontalAlignment, XmALIGNMENT_BEGINNING); n++;
|
||||
XtSetArg(args[n], XmNchildVerticalAlignment, XmALIGNMENT_CENTER); n++;
|
||||
XtSetArg(args[n], XmNlabelString, xms); n++;
|
||||
info->label = XmCreateLabel(info->frame, "HdrFtrLabel", args, n);
|
||||
XtManageChild(info->label);
|
||||
XmStringFree(xms);
|
||||
|
||||
/*
|
||||
* Create a form work area child which will be populated by the
|
||||
* OptionMenu's.
|
||||
*/
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNallowOverlap, False); n++;
|
||||
XtSetArg(args[n], XmNfractionBase, 2); n++;
|
||||
info->form = XmCreateForm(info->frame, "HdrFtrForm", args, n);
|
||||
|
||||
/*
|
||||
* Create the pulldown menu for the option menus.
|
||||
* Store the button index in the userData resource of each button.
|
||||
*/
|
||||
info->menu = XmCreatePulldownMenu(parent, "HdrFtrMenu", NULL, 0);
|
||||
for (i=0; i<info->nspecs; i++)
|
||||
{
|
||||
static char button_label[32];
|
||||
|
||||
sprintf(button_label, "Button%d", i);
|
||||
xms = XmStringCreateLocalized(info->specs[i].string);
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNlabelString, xms); n++;
|
||||
XtSetArg(args[n], XmNuserData, i); n++;
|
||||
info->specs[i].button =
|
||||
XmCreatePushButtonGadget(info->menu, button_label, args, n);
|
||||
XmStringFree(xms);
|
||||
XtManageChild(info->specs[i].button);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Create the option menus using the menu created above.
|
||||
*/
|
||||
xms = XmStringCreateLocalized(DTPO_HEADERFOOTER_FRAME_TOP_LEFT_LABEL);
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNsubMenuId, info->menu); n++;
|
||||
XtSetArg(args[n], XmNlabelString, xms); n++;
|
||||
XtSetArg(args[n], XmNuserData, info); n++;
|
||||
XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION); n++;
|
||||
XtSetArg(args[n], XmNrightPosition, 1); n++;
|
||||
XtSetArg(args[n], XmNrightOffset, 5); n++;
|
||||
|
||||
info->top_left = XmCreateOptionMenu(
|
||||
info->form,
|
||||
"PageHeaderLeftOM",
|
||||
args, n
|
||||
);
|
||||
XmStringFree(xms);
|
||||
XtManageChild(info->top_left);
|
||||
|
||||
xms = XmStringCreateLocalized(DTPO_HEADERFOOTER_FRAME_TOP_RIGHT_LABEL);
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNsubMenuId, info->menu); n++;
|
||||
XtSetArg(args[n], XmNlabelString, xms); n++;
|
||||
XtSetArg(args[n], XmNuserData, info); n++;
|
||||
XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, info->top_left); n++;
|
||||
XtSetArg(args[n], XmNtopOffset, 0); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
|
||||
|
||||
info->top_right = XmCreateOptionMenu(
|
||||
info->form,
|
||||
"PageHeaderRightOM",
|
||||
args, n
|
||||
);
|
||||
XmStringFree(xms);
|
||||
XtManageChild(info->top_right);
|
||||
|
||||
xms = XmStringCreateLocalized(DTPO_HEADERFOOTER_FRAME_BOTTOM_LEFT_LABEL);
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNsubMenuId, info->menu); n++;
|
||||
XtSetArg(args[n], XmNlabelString, xms); n++;
|
||||
XtSetArg(args[n], XmNuserData, info); n++;
|
||||
XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, info->top_left); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNrightWidget, info->top_left); n++;
|
||||
XtSetArg(args[n], XmNrightOffset, 0); n++;
|
||||
|
||||
info->bottom_left = XmCreateOptionMenu(
|
||||
info->form,
|
||||
"PageFooterLeftOM",
|
||||
args, n
|
||||
);
|
||||
XmStringFree(xms);
|
||||
XtManageChild(info->bottom_left);
|
||||
|
||||
xms = XmStringCreateLocalized(DTPO_HEADERFOOTER_FRAME_BOTTOM_RIGHT_LABEL);
|
||||
|
||||
n=0;
|
||||
XtSetArg(args[n], XmNsubMenuId, info->menu); n++;
|
||||
XtSetArg(args[n], XmNlabelString, xms); n++;
|
||||
XtSetArg(args[n], XmNuserData, info); n++;
|
||||
XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, info->bottom_left); n++;
|
||||
XtSetArg(args[n], XmNtopOffset, 0); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNrightWidget, info->top_right); n++;
|
||||
XtSetArg(args[n], XmNrightOffset, 0); n++;
|
||||
|
||||
info->bottom_right = XmCreateOptionMenu(
|
||||
info->form,
|
||||
"PageFooterRightOM",
|
||||
args, n
|
||||
);
|
||||
XmStringFree(xms);
|
||||
XtManageChild(info->bottom_right);
|
||||
|
||||
XtManageChild(info->form);
|
||||
return info->frame;
|
||||
}
|
||||
|
||||
/*
|
||||
* Function: _DtPrintHdrFtrFrameEnumToWidget
|
||||
*
|
||||
* Returns the widget id of the option menu corresponding the specified
|
||||
* header or footer.
|
||||
*
|
||||
* frame - specifies the HdrFtr frame
|
||||
* which - specifies the particular header or footer in "frame".
|
||||
*
|
||||
* Returns the widget id of the option menu for "which"
|
||||
*/
|
||||
Widget
|
||||
_DtPrintHdrFtrFrameEnumToWidget(
|
||||
Widget frame,
|
||||
_DtPrintHdrFtrEnum which
|
||||
)
|
||||
{
|
||||
DtpoHdrFtrFrame *info;
|
||||
Widget widget = NULL;
|
||||
|
||||
XtVaGetValues(frame, XmNuserData, &info, NULL);
|
||||
if (info == NULL)
|
||||
return widget;
|
||||
|
||||
switch (which)
|
||||
{
|
||||
case DTPRINT_OPTION_HEADER_LEFT:
|
||||
widget = info->top_left; break;
|
||||
case DTPRINT_OPTION_HEADER_RIGHT:
|
||||
widget = info->top_right; break;
|
||||
case DTPRINT_OPTION_FOOTER_LEFT:
|
||||
widget = info->bottom_left; break;
|
||||
case DTPRINT_OPTION_FOOTER_RIGHT:
|
||||
widget = info->bottom_right; break;
|
||||
default:
|
||||
widget = NULL;
|
||||
}
|
||||
|
||||
return widget;
|
||||
}
|
||||
|
||||
/*
|
||||
* Function: _DtPrintHdrFtrFrameMenuWidgets
|
||||
*
|
||||
* widget -specifies the option menu
|
||||
*
|
||||
* Returns the widgets which make up the pulldown menu.
|
||||
*/
|
||||
void
|
||||
_DtPrintHdrFtrFrameMenuWidgets(
|
||||
Widget frame,
|
||||
Widget *menu,
|
||||
int *nmenu_buttons,
|
||||
Widget **menu_buttons
|
||||
)
|
||||
{
|
||||
int i;
|
||||
DtpoHdrFtrFrame *info;
|
||||
Widget widget = NULL;
|
||||
|
||||
if (frame == NULL) return;
|
||||
|
||||
XtVaGetValues(frame, XmNuserData, &info, NULL);
|
||||
if (info == NULL) return;
|
||||
|
||||
if (menu != NULL)
|
||||
*menu = info->menu;
|
||||
|
||||
if (nmenu_buttons != NULL)
|
||||
*nmenu_buttons = info->nspecs;
|
||||
|
||||
if (menu_buttons != NULL)
|
||||
{
|
||||
if (*menu_buttons == NULL)
|
||||
*menu_buttons = (Widget *) XtMalloc( info->nspecs * sizeof(Widget) );
|
||||
|
||||
for (i=0; i<info->nspecs; i++)
|
||||
(*menu_buttons)[i] = info->specs[i].button;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Function: _DtPrintGetHdrFtrIndex
|
||||
*
|
||||
* option - specifies the HdrFtr option menu
|
||||
*
|
||||
* Returns the index of the active menu option of the specified
|
||||
* option menu.
|
||||
*/
|
||||
int
|
||||
_DtPrintGetHdrFtrIndex(
|
||||
Widget option
|
||||
)
|
||||
{
|
||||
int index = -1;
|
||||
Widget selected;
|
||||
|
||||
if (! option) return index;
|
||||
|
||||
XtVaGetValues(option, XmNmenuHistory, &selected, NULL);
|
||||
XtVaGetValues(selected, XmNuserData, &index, NULL);
|
||||
return index;
|
||||
}
|
||||
|
||||
/*
|
||||
* Function: _DtPrintGetHdrFtrData
|
||||
*
|
||||
* option - specifies the HdrFtr option menu
|
||||
*
|
||||
* Returns the data associated with the active menu option of the specified
|
||||
* option menu.
|
||||
*/
|
||||
void *
|
||||
_DtPrintGetHdrFtrData(
|
||||
Widget option
|
||||
)
|
||||
{
|
||||
int index = 0;
|
||||
DtpoHdrFtrFrame *info = NULL;
|
||||
|
||||
if (! option) return (void*) NULL;
|
||||
XtVaGetValues(option, XmNuserData, &info, NULL);
|
||||
if (info == NULL) return;
|
||||
|
||||
index = _DtPrintGetHdrFtrIndex(option);
|
||||
return info->specs[index].data;
|
||||
}
|
||||
|
||||
/*
|
||||
* Function: _DtPrintGetHdrFtrString
|
||||
*
|
||||
* option - specifies the HdrFtr option menu
|
||||
*
|
||||
* Returns the string associated with the active menu option of the specified
|
||||
* option menu.
|
||||
*/
|
||||
char *
|
||||
_DtPrintGetHdrFtrString(
|
||||
Widget option
|
||||
)
|
||||
{
|
||||
int index = 0;
|
||||
DtpoHdrFtrFrame *info = NULL;
|
||||
|
||||
if (! option) return (void*) NULL;
|
||||
XtVaGetValues(option, XmNuserData, &info, NULL);
|
||||
if (info == NULL) return;
|
||||
|
||||
index = _DtPrintGetHdrFtrIndex(option);
|
||||
return info->specs[index].string;
|
||||
}
|
||||
|
||||
/*
|
||||
* Function: _DtPrintSetHdrFtrByData
|
||||
*
|
||||
* Displays the specified menu item as the currently active option.
|
||||
*
|
||||
* option - specifies the HdrFtr option menu
|
||||
* data - data associated with the option to be displayed.
|
||||
*/
|
||||
void
|
||||
_DtPrintSetHdrFtrByData(
|
||||
Widget option,
|
||||
void *data
|
||||
)
|
||||
{
|
||||
int i;
|
||||
DtpoHdrFtrFrame *info;
|
||||
|
||||
if (option == NULL) return;
|
||||
XtVaGetValues(option, XmNuserData, &info, NULL);
|
||||
if (info == NULL) return;
|
||||
|
||||
for (i=0; i<info->nspecs; i++)
|
||||
if (info->specs[i].data == data)
|
||||
{
|
||||
XtVaSetValues(option, XmNmenuHistory, info->specs[i].button, NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Function: _DtPrintSetHdrFtrByIndex
|
||||
*
|
||||
* Displays the specified menu item as the currently active option.
|
||||
*
|
||||
* option - specifies the HdrFtr option menu
|
||||
* index - specifies the option to be displayed.
|
||||
*/
|
||||
void
|
||||
_DtPrintSetHdrFtrByIndex(
|
||||
Widget option,
|
||||
int index
|
||||
)
|
||||
{
|
||||
DtpoHdrFtrFrame *info;
|
||||
|
||||
if (option == NULL) return;
|
||||
XtVaGetValues(option, XmNuserData, &info, NULL);
|
||||
if (info == NULL) return;
|
||||
|
||||
XtVaSetValues(option, XmNmenuHistory, info->specs[index].button, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Function: _DtPrintSetHdrFtrByString
|
||||
*
|
||||
* Displays the specified menu item as the currently active option.
|
||||
*
|
||||
* option - specifies the HdrFtr option menu
|
||||
* string - string associated with the option to be displayed.
|
||||
*/
|
||||
void
|
||||
_DtPrintSetHdrFtrByString(
|
||||
Widget option,
|
||||
char *string
|
||||
)
|
||||
{
|
||||
int i;
|
||||
DtpoHdrFtrFrame *info;
|
||||
|
||||
if (option == NULL) return;
|
||||
XtVaGetValues(option, XmNuserData, &info, NULL);
|
||||
if (info == NULL) return;
|
||||
|
||||
for (i=0; i<info->nspecs; i++)
|
||||
if (strcmp(info->specs[i].string,string) == 0)
|
||||
{
|
||||
XtVaSetValues(option, XmNmenuHistory, info->specs[i].button, NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* _DtPrint Margin API
|
||||
*
|
||||
******************************************************************************/
|
||||
typedef struct dtpo_margin_frame
|
||||
{
|
||||
Widget frame,
|
||||
label,
|
||||
form,
|
||||
|
||||
top,
|
||||
right,
|
||||
bottom,
|
||||
left,
|
||||
|
||||
top_label,
|
||||
right_label,
|
||||
bottom_label,
|
||||
left_label;
|
||||
} DtpoMarginFrame;
|
||||
|
||||
static void
|
||||
_DtPrintDestroyMarginFrameCB(
|
||||
Widget frame,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data
|
||||
)
|
||||
{
|
||||
DtpoHdrFtrFrame *info = (DtpoHdrFtrFrame *) client_data;
|
||||
Widget widget;
|
||||
|
||||
if (info == NULL) return;
|
||||
XtFree((char*) info);
|
||||
}
|
||||
|
||||
/*
|
||||
* Function: _DtPrintCreateMarginFrame
|
||||
*
|
||||
* Creates a frame for specifying margins. The frame contains four text
|
||||
* fields, one for each _DtPrintMarginEnum.
|
||||
*
|
||||
* parent - specifies the parent of the frame.
|
||||
*
|
||||
* Returns the widget id of the frame.
|
||||
*/
|
||||
Widget
|
||||
_DtPrintCreateMarginFrame(
|
||||
Widget parent
|
||||
)
|
||||
{
|
||||
DtpoMarginFrame
|
||||
*info;
|
||||
Arg args[16];
|
||||
int n;
|
||||
XmString xms;
|
||||
int i;
|
||||
|
||||
info = (DtpoMarginFrame *) XtMalloc( sizeof(DtpoMarginFrame) );
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNchildHorizontalAlignment, XmALIGNMENT_BEGINNING); n++;
|
||||
XtSetArg(args[n], XmNchildVerticalAlignment, XmALIGNMENT_CENTER); n++;
|
||||
XtSetArg(args[n], XmNuserData, info); n++;
|
||||
info->frame = XmCreateFrame(parent, "MarginFrame", args, n);
|
||||
XtAddCallback(
|
||||
info->frame,
|
||||
XmNdestroyCallback,
|
||||
_DtPrintDestroyMarginFrameCB,
|
||||
(XtPointer) info
|
||||
);
|
||||
|
||||
xms = XmStringCreateLocalized(DTPO_MARGIN_FRAME_LABEL);
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNchildType, XmFRAME_TITLE_CHILD); n++;
|
||||
XtSetArg(args[n], XmNchildHorizontalAlignment, XmALIGNMENT_BEGINNING); n++;
|
||||
XtSetArg(args[n], XmNchildVerticalAlignment, XmALIGNMENT_CENTER); n++;
|
||||
XtSetArg(args[n], XmNlabelString, xms); n++;
|
||||
info->label = XmCreateLabel(info->frame, "MarginLabel", args, n);
|
||||
XtManageChild(info->label);
|
||||
XmStringFree(xms);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNallowOverlap, False); n++;
|
||||
XtSetArg(args[n], XmNfractionBase, 2); n++;
|
||||
info->form = XmCreateForm(info->frame, "MarginForm", args, n);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION); n++;
|
||||
XtSetArg(args[n], XmNrightPosition, 1); n++;
|
||||
XtSetArg(args[n], XmNrightOffset, 5); n++;
|
||||
info->top = XmCreateTextField(info->form, "MarginTopText", args, n);
|
||||
XtManageChild(info->top);
|
||||
|
||||
xms = XmStringCreateLocalized(DTPO_MARGIN_FRAME_TOP_MARGIN_LABEL);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNlabelString, xms); n++;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, info->top); n++;
|
||||
XtSetArg(args[n], XmNtopOffset, 0); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNrightWidget, info->top); n++;
|
||||
XtSetArg(args[n], XmNrightOffset, 3); n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNbottomWidget, info->top); n++;
|
||||
XtSetArg(args[n], XmNbottomOffset, 0); n++;
|
||||
info->top_label =
|
||||
XmCreateLabelGadget(info->form, "MarginTopLabel", args, n);
|
||||
XmStringFree(xms);
|
||||
XtManageChild(info->top_label);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, info->top); n++;
|
||||
XtSetArg(args[n], XmNtopOffset, 0); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
|
||||
info->right = XmCreateTextField(info->form, "MarginRightText", args, n);
|
||||
XtManageChild(info->right);
|
||||
|
||||
xms = XmStringCreateLocalized(DTPO_MARGIN_FRAME_RIGHT_MARGIN_LABEL);
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNlabelString, xms); n++;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, info->right); n++;
|
||||
XtSetArg(args[n], XmNtopOffset, 0); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNrightWidget, info->right); n++;
|
||||
XtSetArg(args[n], XmNrightOffset, 3); n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNbottomWidget, info->right); n++;
|
||||
XtSetArg(args[n], XmNbottomOffset, 0); n++;
|
||||
info->right_label =
|
||||
XmCreateLabelGadget(info->form, "MarginRightLabel", args, n);
|
||||
XmStringFree(xms);
|
||||
XtManageChild(info->right_label);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, info->top); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNrightWidget, info->top); n++;
|
||||
XtSetArg(args[n], XmNrightOffset, 0); n++;
|
||||
info->bottom = XmCreateTextField(info->form, "MarginBottomText", args, n);
|
||||
XtManageChild(info->bottom);
|
||||
|
||||
xms = XmStringCreateLocalized(DTPO_MARGIN_FRAME_BOTTOM_MARGIN_LABEL);
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNlabelString, xms); n++;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, info->bottom); n++;
|
||||
XtSetArg(args[n], XmNtopOffset, 0); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNrightWidget, info->bottom); n++;
|
||||
XtSetArg(args[n], XmNrightOffset, 3); n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNbottomWidget, info->bottom); n++;
|
||||
XtSetArg(args[n], XmNbottomOffset, 0); n++;
|
||||
info->bottom_label =
|
||||
XmCreateLabelGadget(info->form, "MarginBottomLabel", args, n);
|
||||
XmStringFree(xms);
|
||||
XtManageChild(info->bottom_label);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, info->bottom); n++;
|
||||
XtSetArg(args[n], XmNtopOffset, 0); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNrightWidget, info->right); n++;
|
||||
XtSetArg(args[n], XmNrightOffset, 0); n++;
|
||||
info->left = XmCreateTextField(info->form, "MarginLeftText", args, n);
|
||||
XtManageChild(info->left);
|
||||
|
||||
xms = XmStringCreateLocalized(DTPO_MARGIN_FRAME_LEFT_MARGIN_LABEL);
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNlabelString, xms); n++;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNtopWidget, info->left); n++;
|
||||
XtSetArg(args[n], XmNtopOffset, 0); n++;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNrightWidget, info->left); n++;
|
||||
XtSetArg(args[n], XmNrightOffset, 3); n++;
|
||||
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
|
||||
XtSetArg(args[n], XmNbottomWidget, info->left); n++;
|
||||
XtSetArg(args[n], XmNbottomOffset, 0); n++;
|
||||
info->left_label =
|
||||
XmCreateLabelGadget(info->form, "MarginLeftLabel", args, n);
|
||||
XmStringFree(xms);
|
||||
XtManageChild(info->left_label);
|
||||
|
||||
XtManageChild(info->form);
|
||||
return info->frame;
|
||||
}
|
||||
|
||||
/*
|
||||
* Function: _DtPrintMarginFrameEnumToWidget
|
||||
*
|
||||
* frame - specifies the HdrFtr frame
|
||||
* which - specifies the particular margin in "frame".
|
||||
*
|
||||
* Returns the widget id of the textfield for "which"
|
||||
*/
|
||||
Widget
|
||||
_DtPrintMarginFrameEnumToWidget(
|
||||
Widget frame,
|
||||
_DtPrintMarginEnum which
|
||||
)
|
||||
{
|
||||
DtpoMarginFrame *info;
|
||||
Widget widget = NULL;
|
||||
|
||||
XtVaGetValues(frame, XmNuserData, &info, NULL);
|
||||
if (info == NULL)
|
||||
return widget;
|
||||
|
||||
switch (which)
|
||||
{
|
||||
case DTPRINT_OPTION_MARGIN_TOP:
|
||||
widget = info->top; break;
|
||||
case DTPRINT_OPTION_MARGIN_RIGHT:
|
||||
widget = info->right; break;
|
||||
case DTPRINT_OPTION_MARGIN_BOTTOM:
|
||||
widget = info->bottom; break;
|
||||
case DTPRINT_OPTION_MARGIN_LEFT:
|
||||
widget = info->left; break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return widget;
|
||||
}
|
||||
|
||||
/*
|
||||
* Function: _DtPrintGetMarginSpec
|
||||
*
|
||||
* margin - specifies the margin widget.
|
||||
*
|
||||
* Returns a copy of the contents of the specified margin.
|
||||
* The calling function should free this string when done with it.
|
||||
*/
|
||||
char*
|
||||
_DtPrintGetMarginSpec(
|
||||
Widget margin
|
||||
)
|
||||
{
|
||||
char *spec = NULL;
|
||||
|
||||
if (margin)
|
||||
spec = XmTextFieldGetString(margin);
|
||||
|
||||
return spec;
|
||||
}
|
||||
|
||||
/*
|
||||
* Function: _DtPrintSetMarginSpec
|
||||
*
|
||||
* margin -specifies the margin widget.
|
||||
* spec - specifies the string to be displayed in the GUI.
|
||||
*
|
||||
*/
|
||||
void
|
||||
_DtPrintSetMarginSpec(
|
||||
Widget margin,
|
||||
char *spec
|
||||
)
|
||||
{
|
||||
if (margin)
|
||||
XmTextFieldSetString(margin, spec);
|
||||
}
|
||||
177
cde/lib/DtPrint/PrintOptionsP.h
Normal file
177
cde/lib/DtPrint/PrintOptionsP.h
Normal file
@@ -0,0 +1,177 @@
|
||||
/* $XConsortium: PrintOptionsP.h /main/2 1996/03/12 09:28:04 drk $ */
|
||||
|
||||
#ifndef _DT_PRINT_OPTIONSP_H
|
||||
#define _DT_PRINT_OPTIONSP_H
|
||||
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* $:$
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1994 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
/*
|
||||
|
||||
Common Desktop Environment
|
||||
|
||||
(c) Copyright 1993, 1994, 1995 Hewlett-Packard Company
|
||||
(c) Copyright 1993, 1994, 1995 International Business Machines Corp.
|
||||
(c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.
|
||||
(c) Copyright 1993, 1994, 1995 Novell, Inc.
|
||||
(c) Copyright 1995 Digital Equipment Corp.
|
||||
(c) Copyright 1995 Fujitsu Limited
|
||||
(c) Copyright 1995 Hitachi, Ltd.
|
||||
|
||||
|
||||
RESTRICTED RIGHTS LEGEND
|
||||
|
||||
Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
|
||||
Technical Data and Computer Software clause in DFARS 252.227-7013. Rights
|
||||
for non-DOD U.S. Government Departments and Agencies are as set forth in
|
||||
FAR 52.227-19(c)(1,2).
|
||||
|
||||
Hewlett-Packard Company, 3000 Hanover Street, Palo Alto, CA 94304 U.S.A.
|
||||
International Business Machines Corp., Route 100, Somers, NY 10589 U.S.A.
|
||||
Sun Microsystems, Inc., 2550 Garcia Avenue, Mountain View, CA 94043 U.S.A.
|
||||
Novell, Inc., 190 River Road, Summit, NJ 07901 U.S.A.
|
||||
Digital Equipment Corp., 111 Powdermill Road, Maynard, Massachusetts 01754, U.S.A.
|
||||
Fujitsu Limited, 1015, Kamikodanaka Nakahara-Ku, Kawasaki 211, Japan
|
||||
Hitachi, Ltd., 6, Kanda Surugadai 4-Chome, Chiyoda-ku, Tokyo 101, Japan
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Message Catalog Lookup
|
||||
*/
|
||||
#define DTPO_MARGIN_FRAME_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintOptionsSet, DTPO_MARGINS, _DtPrMsgPrintOption_0000)
|
||||
#define DTPO_MARGIN_FRAME_TOP_MARGIN_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintOptionsSet, DTPO_TOP, _DtPrMsgPrintOption_0001)
|
||||
#define DTPO_MARGIN_FRAME_RIGHT_MARGIN_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintOptionsSet, DTPO_RIGHT, _DtPrMsgPrintOption_0002)
|
||||
#define DTPO_MARGIN_FRAME_BOTTOM_MARGIN_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintOptionsSet, DTPO_BOTTOM, _DtPrMsgPrintOption_0003)
|
||||
#define DTPO_MARGIN_FRAME_LEFT_MARGIN_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintOptionsSet, DTPO_LEFT, _DtPrMsgPrintOption_0004)
|
||||
|
||||
#define DTPO_HEADERFOOTER_FRAME_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintOptionsSet, DTPO_HEADERS_N_FOOTERS, _DtPrMsgPrintOption_0005)
|
||||
#define DTPO_HEADERFOOTER_FRAME_TOP_LEFT_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintOptionsSet, DTPO_TOP_LEFT, _DtPrMsgPrintOption_0006)
|
||||
#define DTPO_HEADERFOOTER_FRAME_TOP_RIGHT_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintOptionsSet, DTPO_TOP_RIGHT, _DtPrMsgPrintOption_0007)
|
||||
#define DTPO_HEADERFOOTER_FRAME_BOTTOM_LEFT_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintOptionsSet, DTPO_BOTTOM_LEFT, _DtPrMsgPrintOption_0008)
|
||||
#define DTPO_HEADERFOOTER_FRAME_BOTTOM_RIGHT_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintOptionsSet, DTPO_BOTTOM_RIGHT, _DtPrMsgPrintOption_0009)
|
||||
|
||||
|
||||
/*
|
||||
* Header/Footer Frame API
|
||||
*/
|
||||
typedef enum {
|
||||
DTPRINT_OPTION_HEADER_LEFT,
|
||||
DTPRINT_OPTION_HEADER_RIGHT,
|
||||
DTPRINT_OPTION_FOOTER_LEFT,
|
||||
DTPRINT_OPTION_FOOTER_RIGHT
|
||||
} _DtPrintHdrFtrEnum;
|
||||
|
||||
extern Widget _DtPrintCreateHdrFtrFrame(
|
||||
Widget parent,
|
||||
int nspecs,
|
||||
char **spec_strings,
|
||||
void **spec_data
|
||||
);
|
||||
|
||||
extern Widget _DtPrintHdrFtrFrameEnumToWidget(
|
||||
Widget frame,
|
||||
_DtPrintHdrFtrEnum which
|
||||
);
|
||||
|
||||
extern void _DtPrintHdrFtrFrameMenuWidgets(
|
||||
Widget frame,
|
||||
Widget *menu,
|
||||
int *nmenu_buttons,
|
||||
Widget **menu_buttons
|
||||
);
|
||||
|
||||
extern void *_DtPrintGetHdrFtrData(
|
||||
Widget widget
|
||||
);
|
||||
|
||||
extern int _DtPrintGetHdrFtrIndex(
|
||||
Widget widget
|
||||
);
|
||||
|
||||
extern char *_DtPrintGetHdrFtrString(
|
||||
Widget widget
|
||||
);
|
||||
|
||||
extern void _DtPrintSetHdrFtrByData(
|
||||
Widget widget,
|
||||
void *data
|
||||
);
|
||||
|
||||
extern void _DtPrintSetHdrFtrByIndex(
|
||||
Widget widget,
|
||||
int index
|
||||
);
|
||||
|
||||
extern void _DtPrintSetHdrFtrByString(
|
||||
Widget widget,
|
||||
char *string
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* Margin Frame API
|
||||
*/
|
||||
typedef enum {
|
||||
DTPRINT_OPTION_MARGIN_TOP,
|
||||
DTPRINT_OPTION_MARGIN_RIGHT,
|
||||
DTPRINT_OPTION_MARGIN_BOTTOM,
|
||||
DTPRINT_OPTION_MARGIN_LEFT
|
||||
} _DtPrintMarginEnum;
|
||||
|
||||
extern Widget _DtPrintCreateMarginFrame(
|
||||
Widget parent
|
||||
);
|
||||
|
||||
extern Widget _DtPrintMarginFrameEnumToWidget(
|
||||
Widget frame,
|
||||
_DtPrintMarginEnum which
|
||||
);
|
||||
|
||||
extern char* _DtPrintGetMarginSpec(
|
||||
Widget margin
|
||||
);
|
||||
|
||||
extern void _DtPrintSetMarginSpec(
|
||||
Widget margin,
|
||||
char *spec
|
||||
);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _DT_PRINT_OPTIONSP_H */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
4739
cde/lib/DtPrint/PrintSetupB.c
Normal file
4739
cde/lib/DtPrint/PrintSetupB.c
Normal file
File diff suppressed because it is too large
Load Diff
508
cde/lib/DtPrint/PrintSetupBP.h
Normal file
508
cde/lib/DtPrint/PrintSetupBP.h
Normal file
@@ -0,0 +1,508 @@
|
||||
/* $XConsortium: PrintSetupBP.h /main/16 1996/11/01 15:00:02 cde-hp $ */
|
||||
/*
|
||||
* DtPrint/PrintSetupBP.h
|
||||
*/
|
||||
/* (c) Copyright 1990, 1991, 1992, 1993, 1994 OPEN SOFTWARE FOUNDATION, INC.
|
||||
* ALL RIGHTS RESERVED
|
||||
* (c) Copyright 1989, 1996 DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
|
||||
* (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1995, 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 _DtPrintSetupBP_h
|
||||
#define _DtPrintSetupBP_h
|
||||
|
||||
#include <Xm/BulletinBP.h>
|
||||
#include <Dt/Print.h>
|
||||
#include <Dt/PrintMsgsP.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
* Constant Definitions
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* Message Catalog Lookup
|
||||
*/
|
||||
#define WARN_WORK_AREA_LOCATION DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_WARN_WA_LOCATION, _DtPrMsgPrintSetupBox_0000)
|
||||
#define SELECT_PRINTER_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_SELECT_PRINTER, _DtPrMsgPrintSetupBox_0001)
|
||||
#define PRINT_TO_FILE_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_PRINT_TO_FILE, _DtPrMsgPrintSetupBox_0002)
|
||||
#define SELECT_FILE_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_SELECT_FILE, _DtPrMsgPrintSetupBox_0003)
|
||||
#define CANCEL_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_CANCEL, _DtPrMsgPrintSetupBox_0004)
|
||||
#define COPIES_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_COPIES, _DtPrMsgPrintSetupBox_0005)
|
||||
#define HELP_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_HELP, _DtPrMsgPrintSetupBox_0006)
|
||||
#define PRINT_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_PRINT, _DtPrMsgPrintSetupBox_0007)
|
||||
#define PRINTER_NAME_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_PRINTER_NAME, _DtPrMsgPrintSetupBox_0008)
|
||||
#define SETUP_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_SETUP, _DtPrMsgPrintSetupBox_0009)
|
||||
#define DESCRIPTION_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_DESCRIPTION, _DtPrMsgPrintSetupBox_0010)
|
||||
#define WARN_COPY_COUNT DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_WARN_COPY_COUNT, _DtPrMsgPrintSetupBox_0011)
|
||||
#define WARN_SETUP_MODE DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_WARN_SETUP_MODE, _DtPrMsgPrintSetupBox_0012)
|
||||
#define WARN_SETUP_MODE_CHANGE DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_WARN_SETUP_MODE_CHANGE, _DtPrMsgPrintSetupBox_0013)
|
||||
#define PRINTER_INFO_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_PRINTER_INFO, _DtPrMsgPrintSetupBox_0014)
|
||||
#define INVALID_PRINTER_TITLE DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_INVALID_PRINTER_TITLE, _DtPrMsgPrintSetupBox_0015)
|
||||
#define INVALID_PRINTER_MESSAGE DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_INVALID_PRINTER_MESSAGE, _DtPrMsgPrintSetupBox_0016)
|
||||
#define INVALID_DISPLAY_MESSAGE DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_INVALID_DISPLAY_MESSAGE, _DtPrMsgPrintSetupBox_0017)
|
||||
#define NOT_XP_DISPLAY_MESSAGE DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_NOT_XP_DISPLAY_MESSAGE, _DtPrMsgPrintSetupBox_0018)
|
||||
#define NO_DEFAULT_MESSAGE DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_NO_DEFAULT_MESSAGE, _DtPrMsgPrintSetupBox_0019)
|
||||
#define NO_DEFAULT_DISPLAY_MESSAGE DTPRINT_GETMESSAGE(MS_PrintSetupBox, \
|
||||
PSUB_NO_DEFAULT_DISPLAY_MESSAGE, _DtPrMsgPrintSetupBox_0020)
|
||||
#define PRINTER_MISSING_MESSAGE DTPRINT_GETMESSAGE(MS_PrintSetupBox, \
|
||||
PSUB_PRINTER_MISSING_MESSAGE, _DtPrMsgPrintSetupBox_0021)
|
||||
#define WARN_PRINT_DESTINATION DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_WARN_PRINT_DESTINATION, _DtPrMsgPrintSetupBox_0022)
|
||||
#define WARN_CT_CONVERSION DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_WARN_CT_CONVERSION, _DtPrMsgPrintSetupBox_0023)
|
||||
#define WARN_CONVERSION_ARGS DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_WARN_CONVERSION_ARGS, _DtPrMsgPrintSetupBox_0024)
|
||||
#define PRLIST_ERROR_TITLE DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_PRLIST_ERROR_TITLE, _DtPrMsgPrintSetupBox_0025)
|
||||
#define NO_PRINTERS_MESSAGE DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_NO_PRINTERS_MESSAGE, _DtPrMsgPrintSetupBox_0026)
|
||||
#define DESC_UNAVAILABLE DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_DESC_UNAVAILABLE, _DtPrMsgPrintSetupBox_0027)
|
||||
#define SELECT_FILE_TITLE DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_SELECT_FILE_TITLE, _DtPrMsgPrintSetupBox_0028)
|
||||
#define PRINTER_INFO_TITLE DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_PRINTER_INFO_TITLE, _DtPrMsgPrintSetupBox_0029)
|
||||
#define FORMAT_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_FORMAT_LABEL, _DtPrMsgPrintSetupBox_0030)
|
||||
#define MODEL_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_MODEL_LABEL, _DtPrMsgPrintSetupBox_0031)
|
||||
#define PRINTER_LIST_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_PRINTER_LIST_LABEL, _DtPrMsgPrintSetupBox_0032)
|
||||
#define MORE_PRINTERS_TITLE DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_MORE_PRINTERS_TITLE, _DtPrMsgPrintSetupBox_0033)
|
||||
#define PRINT_TO_PRINTER_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_PRINT_TO_PRINTER, _DtPrMsgPrintSetupBox_0034)
|
||||
#define FILE_NAME_LABEL DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_FILE_NAME, _DtPrMsgPrintSetupBox_0035)
|
||||
#define HELP_DLG_TITLE DTPRINT_GETMESSAGE( \
|
||||
MS_PrintSetupBox, PSUB_HELP_DLG_TITLE, _DtPrMsgPrintSetupBox_0036)
|
||||
#
|
||||
/*
|
||||
* Constants for Use in Allocation Geometry Matrix.
|
||||
*/
|
||||
#define DtPSUB_MAX_WIDGETS_VERT 12
|
||||
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
* Type Definitions
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* data private to default resource procedures
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
String printer_name_ct;
|
||||
String printer_name;
|
||||
String description;
|
||||
} DtPrintSelectPrinterRec, *DtPrintSelectPrinterList;
|
||||
|
||||
typedef struct _DtPrintDefaultProcData
|
||||
{
|
||||
/*
|
||||
* common data
|
||||
*/
|
||||
Widget error_message_box;
|
||||
XtEnum messages_hint;
|
||||
Widget help_dialog;
|
||||
/*
|
||||
* select file proc
|
||||
*/
|
||||
Widget file_selection_box;
|
||||
/*
|
||||
* select printer proc
|
||||
*/
|
||||
Widget printer_selection_box;
|
||||
Widget printer_list_box;
|
||||
String* xp_server_list;
|
||||
int xp_server_count;
|
||||
DtPrintSelectPrinterList* printer_lists;
|
||||
int* printer_counts;
|
||||
int selected_printer;
|
||||
Display* select_printer_info_display;
|
||||
XPContext select_printer_info_context;
|
||||
/*
|
||||
* printer info proc
|
||||
*/
|
||||
Widget printer_info_box;
|
||||
|
||||
} DtPrintDefaultProcData;
|
||||
|
||||
/*
|
||||
* verify state
|
||||
*/
|
||||
typedef enum {
|
||||
DtPRINT_VERIFIED,
|
||||
DtPRINT_IN_VERIFY,
|
||||
DtPRINT_NOT_VERIFIED
|
||||
} DtPrintVerifyState;
|
||||
|
||||
/*
|
||||
* Constraint part record for PrintSetupBox widget
|
||||
*/
|
||||
typedef struct _DtPrintSetupBoxConstraintPart
|
||||
{
|
||||
char unused;
|
||||
} DtPrintSetupBoxConstraintPart, * DtPrintSetupBoxConstraint;
|
||||
/*
|
||||
* New fields for the PrintSetupBox widget class record
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
XtCallbackProc list_callback ;
|
||||
XtPointer extension; /* Pointer to extension record */
|
||||
} DtPrintSetupBoxClassPart;
|
||||
/*
|
||||
* Full class record declaration
|
||||
*/
|
||||
typedef struct _DtPrintSetupBoxClassRec
|
||||
{
|
||||
CoreClassPart core_class;
|
||||
CompositeClassPart composite_class;
|
||||
ConstraintClassPart constraint_class;
|
||||
XmManagerClassPart manager_class;
|
||||
XmBulletinBoardClassPart bulletin_board_class;
|
||||
DtPrintSetupBoxClassPart print_setup_box_class;
|
||||
} DtPrintSetupBoxClassRec;
|
||||
|
||||
externalref DtPrintSetupBoxClassRec dtPrintSetupBoxClassRec;
|
||||
|
||||
/*
|
||||
* New fields for the PrintSetupBox widget record
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
/*
|
||||
* synthetic resources
|
||||
*/
|
||||
String file_name;
|
||||
String printer_name;
|
||||
XmString description_string;
|
||||
int copies;
|
||||
/*
|
||||
* flag resources
|
||||
*/
|
||||
Boolean minimize_buttons;
|
||||
XtEnum print_destination;
|
||||
XtEnum print_setup_mode;
|
||||
XtEnum work_area_location;
|
||||
/*
|
||||
* procedure resources
|
||||
*/
|
||||
DtPrintSetupProc printer_info_proc;
|
||||
DtPrintSetupProc select_file_proc;
|
||||
DtPrintSetupProc select_printer_proc;
|
||||
DtPrintSetupProc verify_printer_proc;
|
||||
/*
|
||||
* callback resources
|
||||
*/
|
||||
XtCallbackList cancel_callback;
|
||||
XtCallbackList close_display_callback;
|
||||
XtCallbackList print_callback;
|
||||
XtCallbackList setup_callback;
|
||||
/*
|
||||
* other resources
|
||||
*/
|
||||
XrmOptionDescList options;
|
||||
Cardinal option_count;
|
||||
/*
|
||||
* Xp standard resources
|
||||
*/
|
||||
XtEnum xp_printer_name_mode;
|
||||
/*
|
||||
* internal flags
|
||||
*/
|
||||
Boolean adding_sel_widgets;
|
||||
DtPrintVerifyState verify_printer_state;
|
||||
Boolean copy_count_supported;
|
||||
/*
|
||||
* internal data
|
||||
*/
|
||||
String modal_printer_spec;
|
||||
Display* print_display;
|
||||
XPContext print_context;
|
||||
XtIntervalId timeout_id;
|
||||
/*
|
||||
* descendents
|
||||
*/
|
||||
Widget bottom_separator;
|
||||
Widget bottom_work_area;
|
||||
Widget button_separator;
|
||||
Widget copies_control;
|
||||
Widget copies_spin_box;
|
||||
Widget description;
|
||||
Widget description_label;
|
||||
Widget destination_radio_box;
|
||||
Widget file_name_label;
|
||||
Widget file_name_text;
|
||||
Widget help_button;
|
||||
Widget print_button;
|
||||
Widget printer_info_button;
|
||||
Widget printer_name_label;
|
||||
Widget printer_name_text;
|
||||
Widget printer_name_combo;
|
||||
Widget select_file_button;
|
||||
Widget select_printer_button;
|
||||
Widget setup_button;
|
||||
Widget top_separator;
|
||||
Widget top_work_area;
|
||||
/*
|
||||
* data private to the default resource procedures
|
||||
*/
|
||||
DtPrintDefaultProcData default_proc_data;
|
||||
|
||||
} DtPrintSetupBoxPart;
|
||||
|
||||
/*
|
||||
* Full instance record declaration
|
||||
*/
|
||||
typedef struct _DtPrintSetupBoxRec
|
||||
{
|
||||
CorePart core;
|
||||
CompositePart composite;
|
||||
ConstraintPart constraint;
|
||||
XmManagerPart manager;
|
||||
XmBulletinBoardPart bulletin_board;
|
||||
DtPrintSetupBoxPart print_setup_box;
|
||||
} DtPrintSetupBoxRec;
|
||||
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
* Macro Definitions
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* Instance Record Access
|
||||
*/
|
||||
#define PSUB_AddingSelWidgets(w) \
|
||||
(((DtPrintSetupBoxWidget) w)->print_setup_box.adding_sel_widgets)
|
||||
#define PSUB_AutoUnmanage(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->bulletin_board.auto_unmanage)
|
||||
#define PSUB_BottomSeparator(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.bottom_separator)
|
||||
#define PSUB_BottomWorkArea(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.bottom_work_area)
|
||||
#define PSUB_ButtonSeparator(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.button_separator)
|
||||
#define PSUB_ButtonFontList(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->bulletin_board.button_font_list)
|
||||
#define PSUB_CancelButton(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->bulletin_board.cancel_button)
|
||||
#define PSUB_CancelCallback(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.cancel_callback)
|
||||
#define PSUB_CloseDisplayCallback(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.close_display_callback)
|
||||
#define PSUB_Context(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.print_context)
|
||||
#define PSUB_Copies(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.copies)
|
||||
#define PSUB_CopiesControl(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.copies_control)
|
||||
#define PSUB_CopiesSpinBox(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.copies_spin_box)
|
||||
#define PSUB_CopyCountSupported(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.copy_count_supported)
|
||||
#define PSUB_DefaultButton(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->bulletin_board.default_button)
|
||||
#define PSUB_DefaultProcData(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.default_proc_data)
|
||||
#define PSUB_Description(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.description)
|
||||
#define PSUB_DescriptionLabel(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.description_label)
|
||||
#define PSUB_DescriptionString(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.description_string)
|
||||
#define PSUB_DestinationRadioBox(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.destination_radio_box)
|
||||
#define PSUB_Display(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.print_display)
|
||||
#define PSUB_FileName(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.file_name)
|
||||
#define PSUB_FileNameLabel(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.file_name_label)
|
||||
#define PSUB_FileNameText(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.file_name_text)
|
||||
#define PSUB_HelpButton(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.help_button)
|
||||
#define PSUB_LabelFontList(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->bulletin_board.label_font_list)
|
||||
#define PSUB_MarginHeight(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->bulletin_board.margin_height)
|
||||
#define PSUB_MarginWidth(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->bulletin_board.margin_width)
|
||||
#define PSUB_MinimizeButtons(w) \
|
||||
(((DtPrintSetupBoxWidget) w)->print_setup_box.minimize_buttons)
|
||||
#define PSUB_ModalPrinterSpec(w) \
|
||||
(((DtPrintSetupBoxWidget) w)->print_setup_box.modal_printer_spec)
|
||||
#define PSUB_MustMatch(w) \
|
||||
(((DtPrintSetupBoxWidget) w)->print_setup_box.must_match)
|
||||
#define PSUB_OptionCount(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.option_count)
|
||||
#define PSUB_Options(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.options)
|
||||
#define PSUB_PrintButton(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.print_button)
|
||||
#define PSUB_PrintCallback(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.print_callback)
|
||||
#define PSUB_PrintDestination(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.print_destination)
|
||||
#define PSUB_PrinterInfoButton(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.printer_info_button)
|
||||
#define PSUB_PrinterInfoProc(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.printer_info_proc)
|
||||
#define PSUB_PrinterName(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.printer_name)
|
||||
#define PSUB_PrinterNameText(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.printer_name_text)
|
||||
#define PSUB_PrinterNameCombo(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.printer_name_combo)
|
||||
#define PSUB_PrinterNameLabel(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.printer_name_label)
|
||||
#define PSUB_PrintSetupMode(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.print_setup_mode)
|
||||
#define PSUB_SelectFileButton(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.select_file_button)
|
||||
#define PSUB_SelectFileProc(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.select_file_proc)
|
||||
#define PSUB_SelectPrinterButton(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.select_printer_button)
|
||||
#define PSUB_SelectPrinterProc(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.select_printer_proc)
|
||||
#define PSUB_SetupButton(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.setup_button)
|
||||
#define PSUB_SetupCallback(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.setup_callback)
|
||||
#define PSUB_Shell(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->bulletin_board.shell)
|
||||
#define PSUB_StringDirection(w) \
|
||||
(((DtPrintSetupBoxWidget)(w))->manager.string_direction)
|
||||
#define PSUB_Text(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.text)
|
||||
#define PSUB_TextColumns(w) \
|
||||
(((DtPrintSetupBoxWidget) w)->print_setup_box.text_columns)
|
||||
#define PSUB_TextFontList(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->bulletin_board.text_font_list)
|
||||
#define PSUB_TimeoutId(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.timeout_id)
|
||||
#define PSUB_TopSeparator(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.top_separator)
|
||||
#define PSUB_TopWorkArea(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.top_work_area)
|
||||
#define PSUB_VerifyPrinterProc(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.verify_printer_proc)
|
||||
#define PSUB_VerifyPrinterState(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.verify_printer_state)
|
||||
#define PSUB_WorkAreaLocation(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.work_area_location)
|
||||
#define PSUB_XpPrinterNameMode(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.xp_printer_name_mode)
|
||||
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
* Private Function Declarations
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* Child Widget Creation Functions
|
||||
*/
|
||||
extern void _DtPrintSetupBoxCreateButtonSeparator(
|
||||
DtPrintSetupBoxWidget psub);
|
||||
extern void _DtPrintSetupBoxCreateBottomSeparator(
|
||||
DtPrintSetupBoxWidget psub);
|
||||
extern void _DtPrintSetupBoxCreateCancelButton(
|
||||
DtPrintSetupBoxWidget psub);
|
||||
extern void _DtPrintSetupBoxCreateCopiesControl(
|
||||
DtPrintSetupBoxWidget psub);
|
||||
extern void _DtPrintSetupBoxCreateDescription(
|
||||
DtPrintSetupBoxWidget psub);
|
||||
extern void _DtPrintSetupBoxCreateDescriptionLabel(
|
||||
DtPrintSetupBoxWidget psub);
|
||||
extern void _DtPrintSetupBoxCreateDestinationRadioBox(
|
||||
DtPrintSetupBoxWidget psub);
|
||||
extern void _DtPrintSetupBoxCreateFileNameLabel(
|
||||
DtPrintSetupBoxWidget psub);
|
||||
extern void _DtPrintSetupBoxCreateFileNameText(
|
||||
DtPrintSetupBoxWidget psub);
|
||||
extern void _DtPrintSetupBoxCreateHelpButton(
|
||||
DtPrintSetupBoxWidget psub);
|
||||
extern void _DtPrintSetupBoxCreatePrintButton(
|
||||
DtPrintSetupBoxWidget psub);
|
||||
extern void _DtPrintSetupBoxCreatePrinterInfoButton(
|
||||
DtPrintSetupBoxWidget psub);
|
||||
extern void _DtPrintSetupBoxCreatePrinterNameLabel(
|
||||
DtPrintSetupBoxWidget psub);
|
||||
extern void _DtPrintSetupBoxCreatePrinterNameCombo(
|
||||
DtPrintSetupBoxWidget psub);
|
||||
extern void _DtPrintSetupBoxCreateSelectFileButton(
|
||||
DtPrintSetupBoxWidget psub);
|
||||
extern void _DtPrintSetupBoxCreateSelectPrinterButton(
|
||||
DtPrintSetupBoxWidget psub);
|
||||
extern void _DtPrintSetupBoxCreateSetupButton(
|
||||
DtPrintSetupBoxWidget psub);
|
||||
extern void _DtPrintSetupBoxCreateTopSeparator(
|
||||
DtPrintSetupBoxWidget psub);
|
||||
/*
|
||||
* Synthetic resource internal->external conversion functions
|
||||
*/
|
||||
extern void _DtPrintSetupBoxGetCopies(
|
||||
Widget wid,
|
||||
int resource_offset,
|
||||
XtArgVal *value);
|
||||
extern void _DtPrintSetupBoxGetDescription(
|
||||
Widget wid,
|
||||
int resource_offset,
|
||||
XtArgVal *value);
|
||||
extern void _DtPrintSetupBoxGetFileName(
|
||||
Widget wid,
|
||||
int resource_offset,
|
||||
XtArgVal *value);
|
||||
extern void _DtPrintSetupBoxGetPrinterName(
|
||||
Widget wid,
|
||||
int resource_offset,
|
||||
XtArgVal *value);
|
||||
/*
|
||||
* Geometry Management
|
||||
*/
|
||||
extern XmGeoMatrix _DtPrintSetupBoxGeoMatrixCreate(
|
||||
Widget wid,
|
||||
Widget instigator,
|
||||
XtWidgetGeometry *desired);
|
||||
extern Boolean _DtPrintSetupBoxNoGeoRequest(
|
||||
XmGeoMatrix geoSpec);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _DtPrintSetupBP_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
2514
cde/lib/DtPrint/PsubDefProc.c
Normal file
2514
cde/lib/DtPrint/PsubDefProc.c
Normal file
File diff suppressed because it is too large
Load Diff
53
cde/lib/DtPrint/PsubDefProcI.h
Normal file
53
cde/lib/DtPrint/PsubDefProcI.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/* $XConsortium: PsubDefProcI.h /main/10 1996/11/01 15:00:46 cde-hp $ */
|
||||
/*
|
||||
* DtPrint/PsubDefProcI.h
|
||||
*/
|
||||
/*
|
||||
* (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 _DtPsubDefProcI_h
|
||||
#define _DtPsubDefProcI_h
|
||||
|
||||
#include <Dt/Print.h>
|
||||
#include <Dt/PrintMsgsP.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
* Private Function Declarations
|
||||
*
|
||||
*/
|
||||
extern void _DtPrintDefProcInitialize(Widget w);
|
||||
extern void _DtPrintDefProcManageErrorBox(DtPrintDefaultProcData* dpd);
|
||||
|
||||
/*
|
||||
* Procedure Resource Defaults
|
||||
*/
|
||||
extern XtEnum _DtPrintSetupBoxXPrinterInfoProc(
|
||||
Widget w,
|
||||
DtPrintSetupData* print_data);
|
||||
extern XtEnum _DtPrintSetupBoxSelectFileProc(
|
||||
Widget w,
|
||||
DtPrintSetupData* print_data);
|
||||
extern XtEnum _DtPrintSetupBoxSelectXPrinterProc(
|
||||
Widget w,
|
||||
DtPrintSetupData* print_data);
|
||||
extern XtEnum _DtPrintSetupBoxVerifyXPrinterProc(
|
||||
Widget w,
|
||||
DtPrintSetupData* print_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _DtPsubDefProcI_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
1199
cde/lib/DtPrint/PsubUtil.c
Normal file
1199
cde/lib/DtPrint/PsubUtil.c
Normal file
File diff suppressed because it is too large
Load Diff
77
cde/lib/DtPrint/PsubUtilI.h
Normal file
77
cde/lib/DtPrint/PsubUtilI.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/* $XConsortium: PsubUtilI.h /main/3 1996/08/12 18:41:41 cde-hp $ */
|
||||
/*
|
||||
* DtPrint/PsubUtilI.h
|
||||
*/
|
||||
/*
|
||||
* (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 _DtPsubUtilI_h
|
||||
#define _DtPsubUtilI_h
|
||||
|
||||
#include <Dt/Print.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
* Type Definitions
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
DtPRINT_DEC_NET,
|
||||
DtPRINT_TCP_IPC,
|
||||
DtPRINT_NET_UNSPECIFIED
|
||||
} DtPrintSpecNet;
|
||||
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
* Private Function Declarations
|
||||
*
|
||||
*/
|
||||
String _DtPrintCreateXPrinterSpecifier(
|
||||
String printer_name,
|
||||
String host_name,
|
||||
DtPrintSpecNet spec_net,
|
||||
int display_num,
|
||||
int screen_num);
|
||||
void _DtPrintFreeStringList(
|
||||
String* string_list);
|
||||
String _DtPrintGetDefaultXPrinterName(
|
||||
Widget w);
|
||||
String* _DtPrintGetXpPrinterList(
|
||||
Widget w);
|
||||
String* _DtPrintGetXpServerList(
|
||||
Widget w);
|
||||
void _DtPrintParseXDisplaySpecifier(
|
||||
const String display_spec,
|
||||
String* host_name,
|
||||
DtPrintSpecNet* spec_net,
|
||||
int* display_num,
|
||||
int* screen_num);
|
||||
void _DtPrintParseXPrinterSpecifier(
|
||||
const String specifier,
|
||||
String* printer_name,
|
||||
String* display_spec);
|
||||
XtEnum _DtPrintVerifyXPrinter(
|
||||
Widget w,
|
||||
String printer_spec,
|
||||
String* new_printer_spec,
|
||||
Display** new_display,
|
||||
XPContext* new_context);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _DtPsubUtilI_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
60
cde/lib/DtPrint/dtpdmd.h
Normal file
60
cde/lib/DtPrint/dtpdmd.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/* $XConsortium: dtpdmd.h /main/4 1996/08/12 18:41:45 cde-hp $ */
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
**
|
||||
** File: dtpdmd.h
|
||||
**
|
||||
** Description: Header file for the "dtpdmd/dtpdm protocol" which
|
||||
** consists of a standard command line dtpdmd->dtpdm
|
||||
** and starndard exit codes dtpdm->dtpdmd.
|
||||
**
|
||||
** Other dtpdmd header stuff lives here too.
|
||||
**
|
||||
** (c) Copyright 1995, 1996, Hewlett-Packard Company, all rights reserved.
|
||||
**
|
||||
******************************************************************************
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (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.
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Standard command line parameters for any PDM which
|
||||
* will become a child of dtpdmd via fork/exec.
|
||||
*
|
||||
* generic_pdm [dt-pdm-command options] [dtpdmd options]
|
||||
*
|
||||
* where [dt-pdm-command options] is:
|
||||
* - any additional options that were specified along with
|
||||
* the dt-pdm-command attribute from the X Print Server.
|
||||
*
|
||||
* where [dtpdmd options] is any of:
|
||||
* -display dpy Specified the display connection to the Video X-Server.
|
||||
* -window vwid Specified the window id on dpy.
|
||||
* -pdisplay pdpy Specified the display connection to the Print X-Server.
|
||||
* -pcontext pcid Specified the print context id on pdpy.
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Standard exit() codes for any PDM which is a child of dtpdmd.
|
||||
*/
|
||||
#define PDM_EXIT_NONE None
|
||||
#define PDM_EXIT_OK 191 /* "OK" */
|
||||
#define PDM_EXIT_CANCEL 192 /* "CANCEL" */
|
||||
#define PDM_EXIT_VXAUTH 193 /* no print display authorization */
|
||||
#define PDM_EXIT_PXAUTH 194 /* no video display authorization */
|
||||
#define PDM_EXIT_ERROR 195 /* all other error reasons */
|
||||
|
||||
/*
|
||||
* Misc information.
|
||||
*/
|
||||
#define DEFAULT_PDM_EXECUTABLE "dtpdm"
|
||||
|
||||
150
cde/lib/DtPrint/libDtPrint.elist
Normal file
150
cde/lib/DtPrint/libDtPrint.elist
Normal file
@@ -0,0 +1,150 @@
|
||||
/* $XConsortium: libDtPrint.elist /main/15 1996/08/19 17:12:44 cde-hp $ */
|
||||
|
||||
/*************************************************************************
|
||||
* Export list for libDtPrint
|
||||
* This list *must* be updated whenever a change is made to the library API.
|
||||
*
|
||||
* The syntax for the symbol declarations in this list is as follows:
|
||||
* public sym => Public C symbol, i.e., publicized API
|
||||
* publicC++ sym => Public C++ symbol, i.e., publicized API
|
||||
* private sym => Private C symbol, i.e., unpublicized API
|
||||
* privateC++ sym => Private C++ symbol, i.e., unpublicized API
|
||||
* internal sym => Internal C symbol, i.e., not part of API
|
||||
* internalC++ sym => Internal C++ symbol, i.e., not part of API
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
* Public symbols -- available to everyone
|
||||
********************************************************************/
|
||||
|
||||
public DtCreatePrintSetupBox
|
||||
public DtCreatePrintSetupDialog
|
||||
public DtPrintCopySetupData
|
||||
public DtPrintFillSetupData
|
||||
public DtPrintFreeSetupData
|
||||
public DtPrintResetConnection
|
||||
public dtPrintSetupBoxWidgetClass
|
||||
|
||||
|
||||
/********************************************************************
|
||||
* Private symbols -- Undocumented APIs that are exported for B.C.
|
||||
* or because privileged applications may need used them.
|
||||
********************************************************************/
|
||||
|
||||
private _DtCreatePDMJobSetup
|
||||
private _DtPrintGetMessage
|
||||
private _DtPrintSetupBoxCreateBottomSeparator
|
||||
private _DtPrintSetupBoxCreateButtonSeparator
|
||||
private _DtPrintSetupBoxCreateCancelButton
|
||||
private _DtPrintSetupBoxCreateCopiesControl
|
||||
private _DtPrintSetupBoxCreateDescription
|
||||
private _DtPrintSetupBoxCreateDescriptionLabel
|
||||
private _DtPrintSetupBoxCreateDestinationRadioBox
|
||||
private _DtPrintSetupBoxCreateFileNameLabel
|
||||
private _DtPrintSetupBoxCreateFileNameText
|
||||
private _DtPrintSetupBoxCreateHelpButton
|
||||
private _DtPrintSetupBoxCreatePrintButton
|
||||
private _DtPrintSetupBoxCreatePrinterInfoButton
|
||||
private _DtPrintSetupBoxCreatePrinterNameCombo
|
||||
private _DtPrintSetupBoxCreatePrinterNameLabel
|
||||
private _DtPrintSetupBoxCreateSelectFileButton
|
||||
private _DtPrintSetupBoxCreateSelectPrinterButton
|
||||
private _DtPrintSetupBoxCreateSetupButton
|
||||
private _DtPrintSetupBoxCreateTopSeparator
|
||||
private _DtPrintSetupBoxGeoMatrixCreate
|
||||
private _DtPrintSetupBoxGetCopies
|
||||
private _DtPrintSetupBoxGetDescription
|
||||
private _DtPrintSetupBoxGetFileName
|
||||
private _DtPrintSetupBoxGetPrinterName
|
||||
private _DtPrintSetupBoxNoGeoRequest
|
||||
private dtPrintSetupBoxClassRec
|
||||
|
||||
private _DtPrintCreateHdrFtrFrame
|
||||
private _DtPrintHdrFtrFrameEnumToWidget
|
||||
private _DtPrintHdrFtrFrameMenuWidgets
|
||||
private _DtPrintGetHdrFtrData
|
||||
private _DtPrintGetHdrFtrIndex
|
||||
private _DtPrintGetHdrFtrString
|
||||
private _DtPrintSetHdrFtrByData
|
||||
private _DtPrintSetHdrFtrByIndex
|
||||
private _DtPrintSetHdrFtrByString
|
||||
|
||||
private _DtPrintCreateMarginFrame
|
||||
private _DtPrintMarginFrameEnumToWidget
|
||||
private _DtPrintGetMarginSpec
|
||||
private _DtPrintSetMarginSpec
|
||||
|
||||
|
||||
/********************************************************************
|
||||
* Internal symbols -- not to be used outside the library.
|
||||
********************************************************************/
|
||||
|
||||
internal _DtPrMsgPrintSetupBox_0000
|
||||
internal _DtPrMsgPrintSetupBox_0001
|
||||
internal _DtPrMsgPrintSetupBox_0002
|
||||
internal _DtPrMsgPrintSetupBox_0003
|
||||
internal _DtPrMsgPrintSetupBox_0004
|
||||
internal _DtPrMsgPrintSetupBox_0005
|
||||
internal _DtPrMsgPrintSetupBox_0006
|
||||
internal _DtPrMsgPrintSetupBox_0007
|
||||
internal _DtPrMsgPrintSetupBox_0008
|
||||
internal _DtPrMsgPrintSetupBox_0009
|
||||
internal _DtPrMsgPrintSetupBox_0010
|
||||
internal _DtPrMsgPrintSetupBox_0011
|
||||
internal _DtPrMsgPrintSetupBox_0012
|
||||
internal _DtPrMsgPrintSetupBox_0013
|
||||
internal _DtPrMsgPrintSetupBox_0014
|
||||
internal _DtPrMsgPrintSetupBox_0015
|
||||
internal _DtPrMsgPrintSetupBox_0016
|
||||
internal _DtPrMsgPrintSetupBox_0017
|
||||
internal _DtPrMsgPrintSetupBox_0018
|
||||
internal _DtPrMsgPrintSetupBox_0019
|
||||
internal _DtPrMsgPrintSetupBox_0020
|
||||
internal _DtPrMsgPrintSetupBox_0021
|
||||
internal _DtPrMsgPrintSetupBox_0022
|
||||
internal _DtPrMsgPrintSetupBox_0023
|
||||
internal _DtPrMsgPrintSetupBox_0024
|
||||
internal _DtPrMsgPrintSetupBox_0025
|
||||
internal _DtPrMsgPrintSetupBox_0026
|
||||
internal _DtPrMsgPrintSetupBox_0027
|
||||
internal _DtPrMsgPrintSetupBox_0028
|
||||
internal _DtPrMsgPrintSetupBox_0029
|
||||
internal _DtPrMsgPrintSetupBox_0030
|
||||
internal _DtPrMsgPrintSetupBox_0031
|
||||
internal _DtPrMsgPrintSetupBox_0032
|
||||
internal _DtPrMsgPrintSetupBox_0033
|
||||
internal _DtPrMsgPrintSetupBox_0034
|
||||
internal _DtPrMsgPrintSetupBox_0035
|
||||
internal _DtPrMsgPrintSetupBox_0036
|
||||
|
||||
internal _DtPrMsgPrintOption_0000
|
||||
internal _DtPrMsgPrintOption_0001
|
||||
internal _DtPrMsgPrintOption_0002
|
||||
internal _DtPrMsgPrintOption_0003
|
||||
internal _DtPrMsgPrintOption_0004
|
||||
internal _DtPrMsgPrintOption_0005
|
||||
internal _DtPrMsgPrintOption_0006
|
||||
internal _DtPrMsgPrintOption_0007
|
||||
internal _DtPrMsgPrintOption_0008
|
||||
internal _DtPrMsgPrintOption_0009
|
||||
|
||||
internal _DtPrMsgPrintDlgMgr_0000
|
||||
internal _DtPrMsgPrintDlgMgr_0001
|
||||
internal _DtPrMsgPrintDlgMgr_0002
|
||||
|
||||
internal _DtPrintCreateXPrinterSpecifier
|
||||
internal _DtPrintDefProcInitialize
|
||||
internal _DtPrintDefProcManageErrorBox
|
||||
internal _DtPrintFreeStringList
|
||||
internal _DtPrintGetDefaultXPrinterName
|
||||
internal _DtPrintGetXpPrinterList
|
||||
internal _DtPrintGetXpServerList
|
||||
internal _DtPrintParseXDisplaySpecifier
|
||||
internal _DtPrintParseXPrinterSpecifier
|
||||
internal _DtPrintSetupBoxSelectFileProc
|
||||
internal _DtPrintSetupBoxSelectXPrinterProc
|
||||
internal _DtPrintSetupBoxVerifyXPrinterProc
|
||||
internal _DtPrintSetupBoxXPrinterInfoProc
|
||||
internal _DtPrintVerifyXPrinter
|
||||
Reference in New Issue
Block a user