Disable all code related to libXp
deprecated and mostly no longer included on current OSes
This commit is contained in:
@@ -39,7 +39,9 @@
|
||||
#define _DtPrint_h
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
#include <X11/extensions/Print.h>
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -182,7 +184,9 @@ typedef struct _DtPrintSetupData
|
||||
{
|
||||
String printer_name;
|
||||
Display *print_display;
|
||||
#ifdef PRINTING_SUPPORT
|
||||
XPContext print_context;
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
XtEnum destination;
|
||||
String dest_info;
|
||||
XtEnum messages_hint;
|
||||
|
||||
@@ -670,7 +670,9 @@ ClosePrintConnection(
|
||||
cbs.reason = DtPRINT_CR_CLOSE_PRINT_DISPLAY;
|
||||
psd.printer_name = old_printer_name;
|
||||
psd.print_display = PSUB_Display(psub);
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
psd.print_context = PSUB_Context(psub);
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
XtCallCallbackList((Widget)psub,
|
||||
PSUB_CloseDisplayCallback(psub),
|
||||
(XtPointer)&cbs);
|
||||
@@ -706,8 +708,10 @@ ClosePrintConnection(
|
||||
/*
|
||||
* destroy the print context
|
||||
*/
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
XpDestroyContext(PSUB_Display(psub), PSUB_Context(psub));
|
||||
PSUB_Context(psub) = (XPContext)NULL;
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
/*
|
||||
* close the print display
|
||||
*/
|
||||
@@ -1595,7 +1599,9 @@ EstablishPrinter(
|
||||
* set the new display and context in the widget
|
||||
*/
|
||||
PSUB_Display(psub) = psd->print_display;
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
PSUB_Context(psub) = psd->print_context;
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
/*
|
||||
* initialize the display for use with Xt
|
||||
*/
|
||||
@@ -1672,7 +1678,9 @@ EstablishPrinter(
|
||||
if(PSUB_PrintSetupMode(psub) == DtPRINT_SETUP_XP)
|
||||
{
|
||||
psd->print_display = PSUB_Display(psub);
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
psd->print_context = PSUB_Context(psub);
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1705,6 +1713,7 @@ static void
|
||||
GetPrintAttributes(
|
||||
DtPrintSetupBoxWidget psub)
|
||||
{
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
char* attr_value;
|
||||
XTextProperty text_prop;
|
||||
char** list;
|
||||
@@ -1802,6 +1811,7 @@ GetPrintAttributes(
|
||||
XtSetSensitive(copies_label, False);
|
||||
}
|
||||
}
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1866,7 +1876,9 @@ Initialize(
|
||||
*/
|
||||
PSUB_ModalPrinterSpec(new_w) = (String)NULL;
|
||||
PSUB_Display(new_w) = (Display*)NULL;
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
PSUB_Context(new_w) = (XPContext)NULL;
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
PSUB_TimeoutId(new_w) = (XtIntervalId)NULL;
|
||||
/*
|
||||
* retrieve the XpPrinterNameMode application resource for this
|
||||
@@ -2035,9 +2047,12 @@ static Boolean
|
||||
IsSetupRequired(
|
||||
DtPrintSetupBoxWidget psub)
|
||||
{
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
char* setup_proviso;
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
Boolean required = False;
|
||||
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
setup_proviso = XpGetOneAttribute(PSUB_Display(psub),
|
||||
PSUB_Context(psub),
|
||||
XPPrinterAttr,
|
||||
@@ -2081,6 +2096,7 @@ IsSetupRequired(
|
||||
}
|
||||
XFree(setup_proviso);
|
||||
}
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
return required;
|
||||
}
|
||||
|
||||
@@ -2482,8 +2498,10 @@ SetPrintAttributes(
|
||||
XmNposition, &PSUB_Copies(psub),
|
||||
NULL);
|
||||
sprintf(str, "*%s: %d\n", XpATTR_COPY_COUNT, PSUB_Copies(psub));
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
XpSetAttributes(PSUB_Display(psub), PSUB_Context(psub),
|
||||
XPDocAttr, str, XPAttrMerge);
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4440,7 +4458,9 @@ DtPrintCopySetupData(
|
||||
}
|
||||
|
||||
target->print_display = source->print_display;
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
target->print_context = source->print_context;
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
target->destination = source->destination;
|
||||
target->messages_hint = source->messages_hint;
|
||||
|
||||
@@ -4524,7 +4544,9 @@ XtEnum DtPrintFillSetupData(
|
||||
XtEnum status;
|
||||
String new_printer_spec;
|
||||
Display* new_display;
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
XPContext new_context;
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
/*
|
||||
* GUI-less printing; verify the printer name and establish the
|
||||
* print connection without involving the print setup box.
|
||||
@@ -4532,12 +4554,17 @@ XtEnum DtPrintFillSetupData(
|
||||
status = _DtPrintVerifyXPrinter(NULL,
|
||||
print_data->printer_name,
|
||||
&new_printer_spec,
|
||||
&new_display,
|
||||
&new_context);
|
||||
&new_display
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
,&new_context
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
);
|
||||
if(status == DtPRINT_SUCCESS)
|
||||
{
|
||||
print_data->print_display = new_display;
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
print_data->print_context = new_context;
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
}
|
||||
if(new_printer_spec != (String)NULL)
|
||||
{
|
||||
@@ -4743,7 +4770,9 @@ DtPrintResetConnection(
|
||||
* simply disavow knowledge of the X print connection
|
||||
*/
|
||||
PSUB_Display(psub) = (Display*)NULL;
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
PSUB_Context(psub) = (XPContext)NULL;
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
break;
|
||||
|
||||
case DtPRINT_CLOSE_CONNECTION:
|
||||
|
||||
@@ -172,7 +172,9 @@ typedef struct _DtPrintDefaultProcData
|
||||
int* printer_counts;
|
||||
int selected_printer;
|
||||
Display* select_printer_info_display;
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
XPContext select_printer_info_context;
|
||||
#endif /* PRINTING_SUPPORT */
|
||||
/*
|
||||
* printer info proc
|
||||
*/
|
||||
@@ -272,7 +274,9 @@ typedef struct
|
||||
*/
|
||||
String modal_printer_spec;
|
||||
Display* print_display;
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
XPContext print_context;
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
XtIntervalId timeout_id;
|
||||
/*
|
||||
* descendents
|
||||
@@ -344,8 +348,10 @@ typedef struct _DtPrintSetupBoxRec
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.cancel_callback)
|
||||
#define PSUB_CloseDisplayCallback(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.close_display_callback)
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
#define PSUB_Context(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.print_context)
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
#define PSUB_Copies(w) \
|
||||
(((DtPrintSetupBoxWidget) (w))->print_setup_box.copies)
|
||||
#define PSUB_CopiesControl(w) \
|
||||
|
||||
@@ -213,7 +213,9 @@ BuildPrinterLists(
|
||||
Display* display;
|
||||
int error_base;
|
||||
int event_base;
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
XPPrinterList xp_printer_list;
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
DtPrintSelectPrinterList printer_list;
|
||||
/*
|
||||
* clean up previous lists if needed
|
||||
@@ -245,11 +247,15 @@ BuildPrinterLists(
|
||||
display = XOpenDisplay(server_list[i]);
|
||||
if((Display*)NULL == display)
|
||||
continue;
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
if(!XpQueryExtension(display, &event_base, &error_base))
|
||||
{
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
XCloseDisplay(display);
|
||||
continue;
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
}
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
/*
|
||||
* add the server to the xp server list
|
||||
*/
|
||||
@@ -258,9 +264,11 @@ BuildPrinterLists(
|
||||
/*
|
||||
* get the printer list for the server
|
||||
*/
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
xp_printer_list =
|
||||
XpGetPrinterList(display, (char*)NULL,
|
||||
&dpd->printer_counts[dpd->xp_server_count]);
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
/*
|
||||
* save a copy of the compound text printer name and
|
||||
* string versions of the name and description for
|
||||
@@ -270,6 +278,7 @@ BuildPrinterLists(
|
||||
XtCalloc(dpd->printer_counts[dpd->xp_server_count],
|
||||
sizeof(DtPrintSelectPrinterRec));
|
||||
printer_list = dpd->printer_lists[dpd->xp_server_count];
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
for(j = 0; j < dpd->printer_counts[dpd->xp_server_count]; j++)
|
||||
{
|
||||
printer_list[j].printer_name_ct =
|
||||
@@ -282,6 +291,7 @@ BuildPrinterLists(
|
||||
(unsigned char*)xp_printer_list[j].desc);
|
||||
}
|
||||
XpFreePrinterList(xp_printer_list);
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
/*
|
||||
* sort the printer list
|
||||
*/
|
||||
@@ -424,12 +434,14 @@ CloseSelectPrinterInfoConnection(
|
||||
{
|
||||
if((Display*)NULL != dpd->select_printer_info_display)
|
||||
{
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
if((XPContext)None != dpd->select_printer_info_context)
|
||||
{
|
||||
XpDestroyContext(dpd->select_printer_info_display,
|
||||
dpd->select_printer_info_context);
|
||||
dpd->select_printer_info_context = (XPContext)None;
|
||||
}
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
XCloseDisplay(dpd->select_printer_info_display);
|
||||
dpd->select_printer_info_display = (Display*)NULL;
|
||||
}
|
||||
@@ -1800,8 +1812,11 @@ SelectPrinterInfoCB(
|
||||
_DtPrintVerifyXPrinter(psub,
|
||||
printer_spec,
|
||||
&new_printer_spec,
|
||||
&dpd->select_printer_info_display,
|
||||
&dpd->select_printer_info_context);
|
||||
&dpd->select_printer_info_display
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
,&dpd->select_printer_info_context
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
);
|
||||
if(status == DtPRINT_SUCCESS)
|
||||
{
|
||||
DtPrintSetupData psd;
|
||||
@@ -1809,7 +1824,9 @@ SelectPrinterInfoCB(
|
||||
memset(&psd, 0, sizeof(DtPrintSetupData));
|
||||
psd.printer_name = printer_spec;
|
||||
psd.print_display = dpd->select_printer_info_display;
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
psd.print_context = dpd->select_printer_info_context;
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
(*info_proc)(psub, &psd);
|
||||
}
|
||||
else
|
||||
@@ -1988,7 +2005,9 @@ _DtPrintDefProcInitialize(Widget w)
|
||||
dpd->printer_lists = (DtPrintSelectPrinterList*)NULL;
|
||||
dpd->selected_printer = 0;
|
||||
dpd->select_printer_info_display = (Display*)NULL;
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
dpd->select_printer_info_context = (XPContext)None;
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
dpd->printer_info_box = (Widget)NULL;
|
||||
|
||||
XtAddCallback(w, XmNdestroyCallback,
|
||||
@@ -2036,8 +2055,8 @@ _DtPrintSetupBoxXPrinterInfoProc(
|
||||
Widget wmshell_ancestor;
|
||||
Widget ctl;
|
||||
XmString label;
|
||||
char* attr_value_ct;
|
||||
String attr_value;
|
||||
char* attr_value_ct = NULL;
|
||||
String attr_value = NULL;
|
||||
XmString empty_label;
|
||||
Widget name_label_top;
|
||||
Position max_y, y;
|
||||
@@ -2077,10 +2096,12 @@ _DtPrintSetupBoxXPrinterInfoProc(
|
||||
*/
|
||||
ctl = XtNameToWidget(dpd->printer_info_box, "*Description");
|
||||
XtVaSetValues(ctl, XmNlabelString, empty_label, NULL);
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
attr_value_ct = XpGetOneAttribute(print_data->print_display,
|
||||
print_data->print_context,
|
||||
XPPrinterAttr,
|
||||
"descriptor");
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
if((char*)NULL != attr_value_ct)
|
||||
{
|
||||
attr_value =
|
||||
@@ -2119,10 +2140,12 @@ _DtPrintSetupBoxXPrinterInfoProc(
|
||||
*/
|
||||
ctl = XtNameToWidget(dpd->printer_info_box, "*Format");
|
||||
XtVaSetValues(ctl, XmNlabelString, empty_label, NULL);
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
attr_value = XpGetOneAttribute(print_data->print_display,
|
||||
print_data->print_context,
|
||||
XPDocAttr,
|
||||
"document-format");
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
if((String)NULL != attr_value)
|
||||
{
|
||||
char* format_start;
|
||||
@@ -2147,10 +2170,12 @@ _DtPrintSetupBoxXPrinterInfoProc(
|
||||
*/
|
||||
ctl = XtNameToWidget(dpd->printer_info_box, "*Model");
|
||||
XtVaSetValues(ctl, XmNlabelString, empty_label, NULL);
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
attr_value_ct = XpGetOneAttribute(print_data->print_display,
|
||||
print_data->print_context,
|
||||
XPPrinterAttr,
|
||||
"printer-model");
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
if((char*)NULL != attr_value_ct)
|
||||
{
|
||||
attr_value =
|
||||
@@ -2471,7 +2496,9 @@ _DtPrintSetupBoxVerifyXPrinterProc(
|
||||
XtEnum status;
|
||||
String new_printer_spec;
|
||||
Display* new_display;
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
XPContext new_context;
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
Widget wmshell_ancestor;
|
||||
|
||||
wmshell_ancestor = GetWMShellAncestor(w);
|
||||
@@ -2482,8 +2509,11 @@ _DtPrintSetupBoxVerifyXPrinterProc(
|
||||
status = _DtPrintVerifyXPrinter(w,
|
||||
psd->printer_name,
|
||||
&new_printer_spec,
|
||||
&new_display,
|
||||
&new_context);
|
||||
&new_display
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
,&new_context
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
);
|
||||
if(status == DtPRINT_SUCCESS)
|
||||
{
|
||||
/*
|
||||
@@ -2491,7 +2521,9 @@ _DtPrintSetupBoxVerifyXPrinterProc(
|
||||
* context
|
||||
*/
|
||||
psd->print_display = new_display;
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
psd->print_context = new_context;
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -183,6 +183,7 @@ OpenXPrinterOnDisplay(
|
||||
Display** new_display,
|
||||
char** ct_printer_name)
|
||||
{
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
Display* print_display;
|
||||
XPPrinterList printer_list;
|
||||
int error_base;
|
||||
@@ -242,6 +243,9 @@ OpenXPrinterOnDisplay(
|
||||
{
|
||||
return DtPRINT_INVALID_DISPLAY;
|
||||
}
|
||||
#else
|
||||
return DtPRINT_NO_PRINTER;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -692,6 +696,7 @@ _DtPrintGetXpServerList(
|
||||
/*
|
||||
* convert to a list of strings
|
||||
*/
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
if((Widget)NULL != w
|
||||
&&
|
||||
XpQueryExtension(XtDisplay(w), &event_base, &error_base))
|
||||
@@ -708,6 +713,7 @@ _DtPrintGetXpServerList(
|
||||
server_list = BuildStringList(xp_server_list, 0);
|
||||
}
|
||||
else
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
server_list = (String*)NULL;
|
||||
/*
|
||||
* default the display number to ":0" if needed
|
||||
@@ -1014,8 +1020,11 @@ _DtPrintVerifyXPrinter(
|
||||
Widget w,
|
||||
String printer_spec,
|
||||
String* new_printer_spec,
|
||||
Display** new_display,
|
||||
XPContext* new_context)
|
||||
Display** new_display
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
,XPContext* new_context
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
)
|
||||
{
|
||||
String default_printer;
|
||||
String printer_name;
|
||||
@@ -1156,6 +1165,7 @@ _DtPrintVerifyXPrinter(
|
||||
/*
|
||||
* initialize the print context
|
||||
*/
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
if((char*)NULL != ct_printer_name)
|
||||
{
|
||||
*new_context = XpCreateContext(print_display, ct_printer_name);
|
||||
@@ -1164,6 +1174,7 @@ _DtPrintVerifyXPrinter(
|
||||
else
|
||||
*new_context = XpCreateContext(print_display, printer_name);
|
||||
XpSetContext(print_display, *new_context);
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
/*
|
||||
* update the display return parm
|
||||
*/
|
||||
|
||||
@@ -86,8 +86,11 @@ XtEnum _DtPrintVerifyXPrinter(
|
||||
Widget w,
|
||||
String printer_spec,
|
||||
String* new_printer_spec,
|
||||
Display** new_display,
|
||||
XPContext* new_context);
|
||||
Display** new_display
|
||||
#if 0 && defined(PRINTING_SUPPORTED)
|
||||
,XPContext* new_context
|
||||
#endif /* PRINTING_SUPPORTED */
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user