1 /* $XConsortium: DrPoly.c /main/6 1995/10/25 20:00:09 cde-sun $ */
2 /*
3 * Motif
4 *
5 * Copyright (c) 1987-2012, The Open Group. All rights reserved.
6 *
7 * These libraries and programs are free software; you can
8 * redistribute them and/or modify them under the terms of the GNU
9 * Lesser General Public License as published by the Free Software
10 * Foundation; either version 2 of the License, or (at your option)
11 * any later version.
12 *
13 * These libraries and programs are distributed in the hope that
14 * they will be useful, but WITHOUT ANY WARRANTY; without even the
15 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 * PURPOSE. See the GNU Lesser General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with these librararies and programs; if not, write
21 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
22 * Floor, Boston, MA 02110-1301 USA
23 *
24 */
25 /*
26 * HISTORY
27 */
28
29 #ifdef HAVE_CONFIG_H
30 #include <config.h>
31 #endif
32
33
34 #include <Xm/DrawP.h>
35 #include "RegionI.h"
36 #include "XmI.h"
37
38 /****************************XmeDrawPolygonShadow***************************/
39 void
XmeDrawPolygonShadow(Display * dpy,Drawable d,GC topGC,GC bottomGC,XPoint * points,int n_points,int shadowThickness,unsigned int shadowType)40 XmeDrawPolygonShadow (
41 Display *dpy,
42 Drawable d,
43 GC topGC,
44 GC bottomGC,
45 XPoint *points,
46 int n_points,
47 #if NeedWidePrototypes
48 int shadowThickness,
49 unsigned int shadowType)
50 #else
51 Dimension shadowThickness,
52 unsigned char shadowType)
53 #endif /* NeedWidePrototypes */
54 {
55 Region xregion;
56 XtAppContext app;
57
58 app = XtDisplayToApplicationContext(dpy);
59
60 _XmAppLock(app);
61 xregion = XPolygonRegion(points, n_points, /* FillRule */ WindingRule);
62
63 _XmRegionDrawShadow (dpy, d,
64 topGC, bottomGC,
65 (XmRegion)xregion,
66 /* border_width */ 0, shadowThickness,
67 shadowType);
68
69 XDestroyRegion(xregion);
70 _XmAppUnlock(app);
71 }
72