Disable all code related to libXp

deprecated and mostly no longer included on current OSes
This commit is contained in:
Peter Howkins
2016-04-20 20:17:22 +01:00
parent b251a15844
commit 2ea057d511
54 changed files with 302 additions and 127 deletions

View File

@@ -235,14 +235,16 @@ static void
PdmJobBoxGetAttr(PdmSetupBox* me, PdmXp* pdm_xp)
{
PdmJobBoxData* data = (PdmJobBoxData*)me->subclass_data;
PdmOidList* job_attrs_supported;
const char* strval;
PdmOidList* job_attrs_supported = NULL;
const char* strval = NULL;
/*
* job attributes supported
*/
#if 0 && defined(PRINTING_SUPPORTED)
strval = PdmXpGetStringValue(pdm_xp, XPPrinterAttr,
pdmoid_att_job_attributes_supported);
#endif /* PRINTING_SUPPORTED */
job_attrs_supported = PdmOidListNew(strval);
/*
* job options
@@ -251,9 +253,11 @@ PdmJobBoxGetAttr(PdmSetupBox* me, PdmXp* pdm_xp)
pdmoid_att_xp_spooler_command_options))
{
data->job_options_supported = True;
#if 0 && defined(PRINTING_SUPPORTED)
data->job_options =
PdmXpGetStringValue(pdm_xp, XPJobAttr,
pdmoid_att_xp_spooler_command_options);
#endif /* PRINTING_SUPPORTED */
}
/*
* job name (banner)
@@ -261,16 +265,20 @@ PdmJobBoxGetAttr(PdmSetupBox* me, PdmXp* pdm_xp)
if(PdmOidListHasOid(job_attrs_supported, pdmoid_att_job_name))
{
data->job_name_supported = True;
#if 0 && defined(PRINTING_SUPPORTED)
data->job_name =
PdmXpGetStringValue(pdm_xp, XPJobAttr, pdmoid_att_job_name);
#endif /* PRINTING_SUPPORTED */
}
/*
* notification profile (send mail)
*/
if(PdmOidListHasOid(job_attrs_supported, pdmoid_att_notification_profile))
{
#if 0 && defined(PRINTING_SUPPORTED)
strval = PdmXpGetStringValue(pdm_xp, XPJobAttr,
pdmoid_att_notification_profile);
#endif /* PRINTING_SUPPORTED */
data->notification_profile = PdmOidNotifyParse(strval);
if(data->notification_profile != PDMOID_NOTIFY_UNSUPPORTED)
data->notification_profile_supported = True;
@@ -301,15 +309,19 @@ PdmJobBoxSetAttr(PdmSetupBox* me, PdmXp* pdm_xp)
{
String value;
XtVaGetValues(data->job_options_text, XmNvalue, &value, NULL);
#if 0 && defined(PRINTING_SUPPORTED)
PdmXpSetStringValue(pdm_xp, XPJobAttr,
pdmoid_att_xp_spooler_command_options, value);
#endif /* PRINTING_SUPPORTED */
XtFree(value);
}
if(data->job_name_supported)
{
String value;
XtVaGetValues(data->job_name_text, XmNvalue, &value, NULL);
#if 0 && defined(PRINTING_SUPPORTED)
PdmXpSetStringValue(pdm_xp, XPJobAttr, pdmoid_att_job_name, value);
#endif /* PRINTING_SUPPORTED */
XtFree(value);
}
if(data->notification_profile_supported)
@@ -317,11 +329,13 @@ PdmJobBoxSetAttr(PdmSetupBox* me, PdmXp* pdm_xp)
Boolean set;
set = XmToggleButtonGadgetGetState(data->notify_toggle);
#if 0 && defined(PRINTING_SUPPORTED)
PdmXpSetStringValue(pdm_xp, XPJobAttr,
pdmoid_att_notification_profile,
PdmOidNotifyString(set
? PDMOID_NOTIFY_EMAIL
: PDMOID_NOTIFY_NONE));
#endif /* PRINTING_SUPPORTED */
}
}

View File

@@ -289,12 +289,14 @@ PdmMainWinGetAttributes(PdmMainWin* me)
/*
* get attributes for the main window
*/
#if 0 && defined(PRINTING_SUPPORTED)
me->printer_descriptor = PdmXpGetStringValue(me->pdm_xp,
XPPrinterAttr,
pdmoid_att_descriptor);
me->printer_name = PdmXpGetStringValue(me->pdm_xp,
XPPrinterAttr,
pdmoid_att_printer_name);
#endif /* PRINTING_SUPPORTED */
/*
* call the get attributes proc for each setup box child
*/

View File

@@ -50,7 +50,9 @@ typedef enum {
*/
static const char* PdmXpGetQualifier(PdmXp* me);
static char* PdmXpBuildResourceName(PdmXp* me, PdmOid id_att);
#if 0 && defined(PRINTING_SUPPORTED)
static XrmDatabase PdmXpLoadPool(PdmXp* me, XPAttributes type);
#endif /* PRINTING_SUPPORTED */
/*
@@ -129,6 +131,7 @@ PdmXpOpen(PdmXp* me,
/*
* check to see if the display is a print server
*/
#if 0 && defined(PRINTING_SUPPORTED)
if(XpQueryExtension(me->display, &event_base, &error_base))
{
/*
@@ -142,9 +145,12 @@ PdmXpOpen(PdmXp* me,
}
else
{
#endif /* PRINTING_SUPPORTED */
XCloseDisplay(me->display);
me->display = (Display*)NULL;
#if 0 && defined(PRINTING_SUPPORTED)
}
#endif /* PRINTING_SUPPORTED */
}
return me->display;
@@ -180,7 +186,9 @@ PdmXpClose(PdmXp* me)
}
XCloseDisplay(me->display);
me->display = NULL;
#if 0 && defined(PRINTING_SUPPORTED)
me->context = (XPContext)NULL;
#endif /* PRINTING_SUPPORTED */
}
}
@@ -197,6 +205,7 @@ PdmXpClose(PdmXp* me)
*
*
*/
#if 0 && defined(PRINTING_SUPPORTED)
static XrmDatabase
PdmXpLoadPool(PdmXp* me, XPAttributes type)
{
@@ -248,6 +257,7 @@ PdmXpLoadPool(PdmXp* me, XPAttributes type)
return me->pool[i];
}
#endif /* PRINTING_SUPPORTED */
/*
* ------------------------------------------------------------------------
@@ -266,6 +276,7 @@ PdmXpGetQualifier(PdmXp* me)
{
if(me->qualifier == (char*)NULL)
{
#if 0 && defined(PRINTING_SUPPORTED)
if(PdmXpLoadPool(me, XPPrinterAttr) != (XrmDatabase)NULL)
{
char* str_type;
@@ -278,6 +289,7 @@ PdmXpGetQualifier(PdmXp* me)
me->qualifier_len = strlen(me->qualifier);
}
}
#endif /* PRINTING_SUPPORTED */
}
return me->qualifier;
}
@@ -341,6 +353,7 @@ PdmXpBuildResourceName(PdmXp* me, PdmOid id_att)
* pdmoid_none if the attribute value is not found.
*
*/
#if 0 && defined(PRINTING_SUPPORTED)
PdmOid
PdmXpGetValue(PdmXp* me,
XPAttributes type,
@@ -352,6 +365,7 @@ PdmXpGetValue(PdmXp* me,
return PdmOidFromString(value);
}
#endif /* PRINTING_SUPPORTED */
/*
* ------------------------------------------------------------------------
@@ -367,6 +381,7 @@ PdmXpGetValue(PdmXp* me,
* representation type is not a string.
*
*/
#if 0 && defined(PRINTING_SUPPORTED)
const char*
PdmXpGetStringValue(PdmXp* me,
XPAttributes type,
@@ -395,6 +410,7 @@ PdmXpGetStringValue(PdmXp* me,
else
return (const char*)NULL;
}
#endif /* PRINTING_SUPPORTED */
/*
* ------------------------------------------------------------------------
@@ -409,6 +425,7 @@ PdmXpGetStringValue(PdmXp* me,
*
*
*/
#if 0 && defined(PRINTING_SUPPORTED)
void
PdmXpSetValue(PdmXp* me,
XPAttributes type,
@@ -417,6 +434,7 @@ PdmXpSetValue(PdmXp* me,
{
PdmXpSetStringValue(me, type, id_att, PdmOidString(id_val));
}
#endif /* PRINTING_SUPPORTED */
/*
* ------------------------------------------------------------------------
@@ -431,6 +449,7 @@ PdmXpSetValue(PdmXp* me,
*
*
*/
#if 0 && defined(PRINTING_SUPPORTED)
void
PdmXpSetStringValue(PdmXp* me,
XPAttributes type,
@@ -449,6 +468,8 @@ PdmXpSetStringValue(PdmXp* me,
XrmPutStringResource(&pool, res_name, (char*)str_val);
XtFree(res_name);
}
#endif /* PRINTING_SUPPORTED */
/*
* ------------------------------------------------------------------------
@@ -466,6 +487,7 @@ PdmXpSetStringValue(PdmXp* me,
void
PdmXpUpdateAttributes(PdmXp* me)
{
#if 0 && defined(PRINTING_SUPPORTED)
char fname[L_tmpnam];
if(tmpnam(fname))
@@ -541,4 +563,5 @@ PdmXpUpdateAttributes(PdmXp* me)
}
XtFree(data);
}
#endif /* PRINTING_SUPPORTED */
}

View File

@@ -36,7 +36,9 @@
#ifndef _PdmXp_h
#define _PdmXp_h
#if 0 && defined(PRINTING_SUPPORTED)
#include <X11/extensions/Print.h>
#endif /* PRINTING_SUPPORTED */
#include "PdmOid.h"
@@ -51,7 +53,9 @@ typedef struct _PdmXp
* print server connection info
*/
Display* display;
#if 0 && defined(PRINTING_SUPPORTED)
XPContext context;
#endif /* PRINTING_SUPPORTED */
/*
* printing attribute pools
*/
@@ -73,6 +77,7 @@ extern Display* PdmXpOpen(PdmXp* me,
char* context_str);
extern void PdmXpClose(PdmXp* me);
extern void PdmXpDelete(PdmXp* me);
#if 0 && defined(PRINTING_SUPPORTED)
extern PdmOid PdmXpGetValue(PdmXp* me,
XPAttributes type,
PdmOid id_att);
@@ -87,6 +92,7 @@ extern void PdmXpSetStringValue(PdmXp* me,
XPAttributes type,
PdmOid id_att,
const char* str_val);
#endif /* PRINTING_SUPPORTED */
extern void PdmXpUpdateAttributes(PdmXp* me);

View File

@@ -530,7 +530,8 @@ PdmPrinterBoxGetAttr(PdmSetupBox* me, PdmXp* pdm_xp)
PdmPrinterBoxData* data = (PdmPrinterBoxData*)me->subclass_data;
const char* strval;
PdmOidMediumSS* medium_ss_supported;
PdmOidTrayMediumList* input_trays_medium;
PdmOidTrayMediumList* input_trays_medium = NULL;
#if 0 && defined(PRINTING_SUPPORTED)
/*
* printer model description
*/
@@ -542,19 +543,23 @@ PdmPrinterBoxGetAttr(PdmSetupBox* me, PdmXp* pdm_xp)
strval = PdmXpGetStringValue(pdm_xp, XPDocAttr,
pdmoid_att_document_format);
data->document_format = PdmOidDocumentFormatParse(strval);
#endif /* PRINTING_SUPPORTED */
if((char*)NULL == data->document_format)
{
/*
* document format not specified, try to obtain
* document-formats-supported, and obtain up the default from it
*/
#if 0 && defined(PRINTING_SUPPORTED)
strval = PdmXpGetStringValue(pdm_xp, XPPrinterAttr,
pdmoid_att_document_formats_supported);
data->document_format = PdmOidDocumentFormatDefault(strval);
#endif /* PRINTING_SUPPORTED */
}
/*
* document attributes supported
*/
#if 0 && defined(PRINTING_SUPPORTED)
strval = PdmXpGetStringValue(pdm_xp, XPPrinterAttr,
pdmoid_att_document_attributes_supported);
data->document_attrs_supported = PdmOidListNew(strval);
@@ -612,6 +617,7 @@ PdmPrinterBoxGetAttr(PdmSetupBox* me, PdmXp* pdm_xp)
*/
PdmOidMediumSSDelete(medium_ss_supported);
PdmOidTrayMediumListDelete(input_trays_medium);
#endif /* PRINTING_SUPPORTED */
}
/*
@@ -630,6 +636,7 @@ PdmPrinterBoxGetAttr(PdmSetupBox* me, PdmXp* pdm_xp)
static void
PdmPrinterBoxSetAttr(PdmSetupBox* me, PdmXp* pdm_xp)
{
#if 0 && defined(PRINTING_SUPPORTED)
PdmPrinterBoxData* data = (PdmPrinterBoxData*)me->subclass_data;
/*
* orientation
@@ -651,6 +658,7 @@ PdmPrinterBoxSetAttr(PdmSetupBox* me, PdmXp* pdm_xp)
*/
PdmXpSetValue(pdm_xp, XPDocAttr, pdmoid_att_default_input_tray,
TrayCtlGetTray(data->tray_ctl));
#endif /* PRINTING_SUPPORTED */
}
/*