1 /**
2 *
3 * $Header: /cvsroot/lesstif/lesstif/lib/Xm-2.1/PixConv.c,v 1.1 2004/08/28 19:22:44 dannybackx Exp $
4 *
5 * Copyright (C) 1997 Free Software Foundation, Inc.
6 * Copyright (C) 1997-2001 LessTif Development Team
7 *
8 * This file is part of the GNU LessTif Library.
9 *
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Library General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Library General Public License for more details.
19 *
20 * You should have received a copy of the GNU Library General Public
21 * License along with this library; if not, write to the Free
22 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 **/
25
26 static const char rcsid[] = "$Header: /cvsroot/lesstif/lesstif/lib/Xm-2.1/PixConv.c,v 1.1 2004/08/28 19:22:44 dannybackx Exp $";
27
28 #include <LTconfig.h>
29
30 #include <XmI/XmI.h>
31 #include <Xm/XmP.h>
32 #include <XmI/PixConvI.h> /* <--- just to see if we get any warnings */
33
34 #include <XmI/DebugUtil.h>
35
36 /*
37 MODULE: PixConv.c
38 DESCRIPTION:
39 Contains routines to do pixmap manipulations.
40 END:
41 */
42 /*
43 FUNCTION: _XmTopShadowPixmapDefault
44 SYNOPSIS: void _XmTopShadowPixmapDefault(Widget w, int offset, XrmValue *val)
45 DESCRIPTION:
46 This function is an internal Motif 2.0 function. It sets the default
47 top shadow pixmap. This routine is not implemented yet. It just returns
48 XmUNSPECIFIED_PIXMAP for the time being.
49 END:
50 */
51 void
_XmTopShadowPixmapDefault(Widget w,int offset,XrmValue * val)52 _XmTopShadowPixmapDefault(Widget w, int offset, XrmValue *val)
53 {
54 static Pixmap pmap;
55
56 /* FIXTHIS: This is not implemented yet. */
57 pmap = XmUNSPECIFIED_PIXMAP;
58 val->addr = (XPointer) &pmap;
59 }
60
61 /*
62 FUNCTION: _XmHighlightPixmapDefault
63 SYNOPSIS: void _XmHighlightPixmapDefault(Widget w, int offset, XrmValue *val)
64 DESCRIPTION:
65 This function is an internal Motif 2.0 function. It sets the default
66 highlight shadow pixmap. This routine is not implemented yet.
67 It just returns XmUNSPECIFIED_PIXMAP for the time being.
68 END:
69 */
70 void
_XmHighlightPixmapDefault(Widget w,int offset,XrmValue * val)71 _XmHighlightPixmapDefault(Widget w, int offset, XrmValue *val)
72 {
73 static Pixmap pmap;
74
75 /* FIXTHIS: This is not implemented yet. */
76 pmap = XmUNSPECIFIED_PIXMAP;
77 val->addr = (XPointer) &pmap;
78 }
79
80 /*
81 FUNCTION: _XmGetPixmapBasedGC
82 SYNOPSIS: GC _XmGetPixmapBasedGC(Widget w, Pixmap pmap, Pixel pix, XtGCMask mask, XGCValues *values)
83 DESCRIPTION:
84 This function is an internal Motif 2.0 function. This is a guess at what
85 it does since there is no documentation on it that I know of.
86 END:
87 */
88 GC
_XmGetPixmapBasedGC(Widget w,Pixmap pmap,Pixel pix,XtGCMask mask,XGCValues * values)89 _XmGetPixmapBasedGC(
90 Widget w,
91 Pixmap pmap,
92 Pixel pix,
93 XtGCMask mask,
94 XGCValues *values)
95 {
96 if(pmap != None
97 && pmap != XmUNSPECIFIED_PIXMAP)
98 {
99 /* we're dealing with a pixmap'ed bottom shadow*/
100 mask |= GCTile | GCFillStyle;
101
102 values->tile = pmap;
103 values->fill_style = FillTiled;
104 }
105 else
106 {
107 mask |= GCForeground | GCBackground;
108
109 values->foreground = pix;
110 values->background = XtBackground(w);
111 }
112
113 return XtGetGC(w, mask, values);
114 }
115