From 889264a52a6cf9882b010de55d555c877dd216f3 Mon Sep 17 00:00:00 2001 From: Gaetan Nadon Date: Fri, 26 Mar 2010 19:20:56 -0400 Subject: xprint: remove conditional code regarding xprint feature xprint has been removed from X Window System Signed-off-by: Gaetan Nadon --- xdpyinfo.c | 140 ------------------------------------------------------------- 1 file changed, 140 deletions(-) diff --git a/xdpyinfo.c b/xdpyinfo.c index dc9829a..cf5e14c 100644 --- a/xdpyinfo.c +++ b/xdpyinfo.c @@ -80,10 +80,6 @@ in this Software without prior written authorization from The Open Group. # define DMX # endif -# if HAVE_X11_EXTENSIONS_PRINT_H -# define INCLUDE_XPRINT_SUPPORT -# endif - #endif #include @@ -140,9 +136,6 @@ in this Software without prior written authorization from The Open Group. #ifdef DMX #include #endif -#ifdef INCLUDE_XPRINT_SUPPORT -#include -#endif /* INCLUDE_XPRINT_SUPPORT */ #include #include #include @@ -433,33 +426,6 @@ Bool hasExtension(Display *dpy, char *extname) return i != num_extensions; } -#ifdef INCLUDE_XPRINT_SUPPORT -/* xc/programs/twm/twm.c has a copy of |IsPrintScreen()|, please - * keep both versions in sync... */ -static -Bool IsPrintScreen(Screen *s) -{ - Display *dpy = XDisplayOfScreen(s); - int i; - - /* Check whether this is a screen of a print DDX */ - if (hasExtension(dpy, XP_PRINTNAME)) { - Screen **pscreens; - int pscrcount; - - pscreens = XpQueryScreens(dpy, &pscrcount); - for( i = 0 ; (i < pscrcount) && pscreens ; i++ ) { - if (s == pscreens[i]) { - XFree(pscreens); - return True; - } - } - XFree(pscreens); - } - return False; -} -#endif /* INCLUDE_XPRINT_SUPPORT */ - static void print_screen_info(Display *dpy, int scr) { @@ -491,12 +457,6 @@ print_screen_info(Display *dpy, int scr) printf ("\n"); printf ("screen #%d:\n", scr); -#ifdef INCLUDE_XPRINT_SUPPORT - /* Check whether this is a screen of a print DDX */ - isPrintScreen = IsPrintScreen(s); - printf (" print screen: %s\n", isPrintScreen?"yes":"no"); -#endif /* INCLUDE_XPRINT_SUPPORT */ - if (isPrintScreen) { /* Print resolution is set on a per-printer basis (per-document * or per-page), the screen itself has no "default" resolution */ @@ -1350,103 +1310,6 @@ static int print_dmx_info(Display *dpy, char *extname) #endif /* DMX */ -#ifdef INCLUDE_XPRINT_SUPPORT -static -void print_xprint_attrpool(const char *name, const char *attrpool) -{ - int c; - const char *s = attrpool; - - printf(" %s:\n ", name); - - while( (c = *s++) != '\0' ) - { - if (c == '\n') { - printf("\n "); - } - else - { - fputc(c, stdout); - } - } - fputc('\n', stdout); -} - -static int -print_xprint_info(Display *dpy, char *extname) -{ - - short majorrev, - minorrev; - int xp_event_base, - xp_error_base; - XPPrinterList printerlist; - Screen **pscreens; - int plcount, - pscrcount, - i; - - if (XpQueryVersion(dpy, &majorrev, &minorrev) == False) { - return 0; - } - - print_standard_extension_info(dpy, extname, majorrev, minorrev); - - if (XpQueryExtension(dpy, &xp_event_base, &xp_error_base) == False) { - printf(" XpQueryExtension() failed.\n"); - return 0; - } - - /* Print event info */ - printf(" xp_event_base=%d, xp_error_base=%d\n", xp_event_base, xp_error_base); - - /* Print info which screens support the Xprint extension */ - printf(" Print screens = {"); - pscreens = XpQueryScreens(dpy, &pscrcount); - for( i = 0 ; i < pscrcount ; i++ ) { - printf("%s%d", ((i > 0)?(", "):("")), (int)XScreenNumberOfScreen(pscreens[i])); - } - XFree(pscreens); - printf("}\n"); - - /* Enumerate the list of printers */ - printerlist = XpGetPrinterList(dpy, NULL, &plcount); - /* Print number of printers, then each printer name and description */ - printf(" Found %d printers on this server.\n", plcount); - for( i = 0 ; i < plcount ; i++) { - printf(" printer %d: name='%s', descr='%s'\n", - i, NULLSTR(printerlist[i].name), NULLSTR(printerlist[i].desc)); - } - - /* Enumerate the list of printers with details */ - for( i = 0 ; i < plcount ; i++) { - char *printername = printerlist[i].name; - XPContext pcontext; - char *s; - - printf(" Attributes of printer '%s':\n", NULLSTR(printername)); - - pcontext = XpCreateContext(dpy, printername); - if (pcontext == None) { - printf(" Error: Could not open printer.\n"); - continue; - } - - s=XpGetAttributes(dpy, pcontext, XPJobAttr); print_xprint_attrpool("XPJobAttr", s); XFree(s); - s=XpGetAttributes(dpy, pcontext, XPDocAttr); print_xprint_attrpool("XPDocAttr", s); XFree(s); - s=XpGetAttributes(dpy, pcontext, XPPageAttr); print_xprint_attrpool("XPPageAttr", s); XFree(s); - s=XpGetAttributes(dpy, pcontext, XPPrinterAttr); print_xprint_attrpool("XPPrinterAttr", s); XFree(s); - s=XpGetAttributes(dpy, pcontext, XPServerAttr); print_xprint_attrpool("XPServerAttr", s); XFree(s); - - XpDestroyContext(dpy, pcontext); - } - - XpFreePrinterList(printerlist); - - return 1; -} -#endif /* INCLUDE_XPRINT_SUPPORT */ - /* utilities to manage the list of recognized extensions */ @@ -1500,9 +1363,6 @@ static ExtensionPrintInfo known_extensions[] = #ifdef DMX {"DMX", print_dmx_info, False}, #endif -#ifdef INCLUDE_XPRINT_SUPPORT - {XP_PRINTNAME, print_xprint_info, False}, -#endif /* INCLUDE_XPRINT_SUPPORT */ /* add new extensions here */ }; -- cgit v1.2.3