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