diff options
author | Roland Mainz <roland.mainz@nrubsig.org> | 2005-01-03 01:06:36 +0000 |
---|---|---|
committer | Roland Mainz <roland.mainz@nrubsig.org> | 2005-01-03 01:06:36 +0000 |
commit | 4e68accbec58b7ce53fe5ece785d262586570555 (patch) | |
tree | f838a614a30fd4df24d7f1a14730565f8c96f8b1 | |
parent | 2d88d7ce6abfd54a78ee44ef2e4da08b1bfec416 (diff) |
xc/lib/XprintAppUtil/xpapputil.csco_port_update-baseXORG-6_8_99_903XORG-6_8_99_902XORG-6_8_99_901XORG-6_8_99_900XORG-6_8_99_9XORG-6_8_99_8XORG-6_8_99_7XORG-6_8_99_6XORG-6_8_99_5XORG-6_8_99_4XORG-6_8_99_3XORG-6_8_99_2XORG-6_8_99_16XORG-6_8_99_15XORG-6_8_99_14XORG-6_8_99_13XORG-6_8_99_12XORG-6_8_99_11XORG-6_8_99_10XORG-6_8_99_1
xc/lib/XprintAppUtil/xpapputil.h
xc/lib/XprintUtil/xprintutil.c
xc/lib/XprintUtil/xprintutil.h
xc/programs/glxgears/glxgears.c
xc/programs/xdbedizzy/xdbedizzy.c
xc/programs/xedit/Xedit-xprint.ad
xc/programs/xedit/commands.c
xc/programs/xlogo/print.c
xc/programs/xlsfonts/xlsfonts.c
xc/programs/xlsfonts/xlsfonts.man
xc/programs/xlsfonts/xlsfonts.sgml
xc/programs/xman/Xman-xprint.ad
xc/programs/xman/handler.c
xc/programs/xman/print.c
xc/programs/xman/print.h
xc/programs/xmore/XMore.ad
xc/programs/xmore/print.c
xc/programs/xmore/print.h
xc/programs/xmore/printdialog.c
xc/programs/xmore/printdialog.h
xc/programs/xmore/printdialogprivates.h
xc/programs/xmore/xmore.c
xc/programs/xphelloworld/xpawhelloworld/xpawhelloworld.c
xc/programs/xphelloworld/xphelloworld/xphelloworld.c
xc/programs/xphelloworld/xpsimplehelloworld/xpsimplehelloworld.c
xc/programs/xphelloworld/xpxmhelloworld/xpxmhelloworld.c
xc/programs/xphelloworld/xpxthelloworld/xpxthelloworld.c
xc/programs/xplsprinters/xplsprinters.c
//bugs.freedesktop.org/show_bug.cgi?id=1706) attachment #1615
(https://bugs.freedesktop.org/attachment.cgi?id=1615): XprintUtils
2004/Q3 update. This adds various new features to the XprintUtils
library including support for page resolutions where
X_resolution!=Y_resolution, listfonts-mode control and initial
framework for the COLORSPACE extension. Patch by Roland Mainz
<roland.mainz@nrubsig.org> and Julien Lafon <julien.lafon@gmail.com>.
-rw-r--r-- | xplsprinters.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/xplsprinters.c b/xplsprinters.c index d29a6fd..5b63fa8 100644 --- a/xplsprinters.c +++ b/xplsprinters.c @@ -115,15 +115,10 @@ void print_medium_sizes( Display *pdpy, XPContext pcontext ) static void print_resolutions( Display *pdpy, XPContext pcontext ) { - long dpi; XpuResolutionList list; int list_count; int i; - - if( XpuGetResolution(pdpy, pcontext, &dpi) == 1 ) - { - printf("\tdefault-printer-resolution=%ld\n", dpi); - } + char *defresname; /* name of default resolution */ list = XpuGetResolutionList(pdpy, pcontext, &list_count); if( !list ) @@ -132,10 +127,26 @@ void print_resolutions( Display *pdpy, XPContext pcontext ) return; } + defresname = XpGetOneAttribute(pdpy, pcontext, XPDocAttr, "default-printer-resolution"); + if( defresname ) + { + XpuResolutionRec *res = XpuFindResolutionByName(list, list_count, defresname); + if( res ) + { + printf("\tdefault-printer-resolution=%s (%ldx%ld)\n", res->name, res->x_dpi, res->y_dpi); + } + else + { + fprintf(stderr, "XpuFindResolutionByName() returned no match for default resolution '%s'\n", + defresname); + } + XFree(defresname); + } + for( i = 0 ; i < list_count ; i++ ) { XpuResolutionRec *curr = &list[i]; - printf("\tresolution=%ld\n", curr->dpi); + printf("\tresolution=%s (%ldx%ld)\n", curr->name, curr->x_dpi, curr->y_dpi); } XpuFreeResolutionList(list); @@ -236,10 +247,6 @@ void print_detailed_printer_info(XPPrinterRec *xp_rec, int detailLevel) static void print_printer_info(XPPrinterRec *xp_rec, int detailLevel) { - Display *pdpy; /* X connection */ - XPContext pcontext; /* Xprint context */ - long dpi; - printf("printer: %s\n", xp_rec->name); if( detailLevel < 1 ) |