6724993.patch revision 1408
0N/A--- src/Makefile.am 2008-08-26 09:58:57.225299000 -0700
0N/A+++ src/Makefile.am.new 2008-08-26 10:08:24.257125000 -0700
0N/A@@ -17,6 +17,7 @@ libXp_la_SOURCES = \
0N/A XpPrinter.c \
407N/A XpPutData.c \
0N/A XpScreens.c \
0N/A+ XpDpi.c \
0N/A \
0N/A XpExtUtil.h
0N/A
0N/A--- src/XpDpi.c 1969-12-31 16:00:00.000000000 -0800
0N/A+++ src/XpDpi.c.new 2008-08-26 13:44:31.473701000 -0700
0N/A@@ -0,0 +1,101 @@
0N/A+/* $XConsortium: XpDpi.c /main/4 1996/12/04 10:24:31 lehors $ */
0N/A+/******************************************************************************
0N/A+ ******************************************************************************
0N/A+ **
0N/A+ ** (c) Copyright 1996 Hewlett-Packard Company
0N/A+ ** (c) Copyright 1996 International Business Machines Corp.
0N/A+ ** (c) Copyright 1996, Oracle and/or its affiliates. All rights reserved.
154N/A+ ** (c) Copyright 1996 Novell, Inc.
0N/A+ ** (c) Copyright 1996 Digital Equipment Corp.
0N/A+ ** (c) Copyright 1996 Fujitsu Limited
0N/A+ ** (c) Copyright 1996 Hitachi, Ltd.
0N/A+ **
154N/A+ ** Permission is hereby granted, free of charge, to any person obtaining a copy
159N/A+ ** of this software and associated documentation files (the "Software"), to deal
154N/A+ ** in the Software without restriction, including without limitation the rights
292N/A+ ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
292N/A+ ** copies of the Software, and to permit persons to whom the Software is
159N/A+ ** furnished to do so, subject to the following conditions:
154N/A+ **
154N/A+ ** The above copyright notice and this permission notice shall be included in
605N/A+ ** all copies or substantial portions of the Software.
434N/A+ **
434N/A+ ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
259N/A+ ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
89N/A+ ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
0N/A+ ** COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
0N/A+ ** IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0N/A+ ** CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0N/A+ **
456N/A+ ** Except as contained in this notice, the names of the copyright holders shall
92N/A+ ** not be used in advertising or otherwise to promote the sale, use or other
92N/A+ ** dealings in this Software without prior written authorization from said
92N/A+ ** copyright holders.
92N/A+ **
92N/A+ ******************************************************************************
92N/A+ *****************************************************************************/
154N/A+#ifdef HAVE_CONFIG_H
456N/A+#include <config.h>
456N/A+#endif
456N/A+#include <X11/extensions/Printstr.h>
456N/A+#include "XpExtUtil.h"
345N/A+#include <X11/Xlibint.h>
0N/A+#include <X11/Xos.h>
345N/A+#include <limits.h>
0N/A+#ifndef WIN32
0N/A+#define X_INCLUDE_PWD_H
92N/A+#define XOS_USE_XLIB_LOCKING
92N/A+#include <X11/Xos_r.h>
92N/A+#endif
92N/A+#include <limits.h>
92N/A+
92N/A+
92N/A+Bool
92N/A+XpClientDPI (
92N/A+ Display *dpy,
345N/A+ int client_dpi
92N/A+)
92N/A+{
345N/A+ xPrintClientDpiReq *req;
0N/A+ xPrintClientDpiReply rep;
0N/A+ XExtDisplayInfo *info = (XExtDisplayInfo *) xp_find_display (dpy);
92N/A+ short dpi = (short)client_dpi;
92N/A+
92N/A+ XPContext context;
92N/A+
345N/A+ if (XpCheckExtInit(dpy, XP_SECOND_RELEASE) == -1)
92N/A+ return (False); /* NoSuchExtension */
92N/A+
92N/A+ LockDisplay (dpy);
92N/A+
92N/A+ GetReq(PrintClientDpi,req);
345N/A+ req->reqType = info->codes->major_opcode;
92N/A+ req->printReqType = X_PrintClientDpi;
439N/A+ req->clientDPI = (CARD16) dpi;
345N/A+
92N/A+ if (! _XReply (dpy, (xReply *) &rep, 0, xTrue)) {
345N/A+ UnlockDisplay (dpy);
92N/A+ SyncHandle ();
92N/A+ return (False);
92N/A+ }
154N/A+
92N/A+ UnlockDisplay(dpy);
92N/A+ SyncHandle ();
92N/A+
345N/A+ return ( rep.status );
92N/A+}
154N/A+
345N/A+/*
92N/A+ * Bug 4402782: Add Sun specific propietary call until X.Org takes the
92N/A+ * change.
92N/A+ */
92N/A+#ifdef SUNSOFT
92N/A+Bool
92N/A+XpClientDPI_SUNW (
92N/A+ Display *dpy,
92N/A+ int client_dpi
92N/A+)
92N/A+{
92N/A+ return XpClientDPI(dpy, client_dpi);
92N/A+}
345N/A+#endif
92N/A