1 /*------------------------------------------------------------\
2 |                                                             |
3 | This file is part of the Alliance CAD System Copyright      |
4 | (C) Laboratoire LIP6 - D�partement ASIM Universite P&M Curie|
5 |                                                             |
6 | Home page      : http://www-asim.lip6.fr/alliance/          |
7 | E-mail         : mailto:alliance-users@asim.lip6.fr       |
8 |                                                             |
9 | This progam is  free software; you can redistribute it      |
10 | and/or modify it under the  terms of the GNU General Public |
11 | License as  published by the Free Software Foundation;      |
12 | either version 2 of the License, or (at your option) any    |
13 | later version.                                              |
14 |                                                             |
15 | Alliance VLSI  CAD System  is distributed  in the hope that |
16 | it  will be useful, but WITHOUT  ANY WARRANTY;              |
17 | without even the  implied warranty of MERCHANTABILITY or    |
18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General       |
19 | Public License for more details.                            |
20 |                                                             |
21 | You should have received a copy  of the GNU General Public  |
22 | License along with the GNU C Library; see the file COPYING. |
23 | If not, write to the Free Software Foundation, Inc.,        |
24 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.                     |
25 |                                                             |
26 \------------------------------------------------------------*/
27 
28 /*------------------------------------------------------------\
29 |                                                             |
30 | Tool    :                   GRAAL                           |
31 |                                                             |
32 | File    :                  Pixmap.c                         |
33 |                                                             |
34 | Author  :                Jacomme Ludovic                    |
35 |                                                             |
36 | Date    :                  28.03.95                         |
37 |                                                             |
38 \------------------------------------------------------------*/
39 
40 # include <Xm/Xm.h>
41 # include <X11/Intrinsic.h>
42 # include "mut.h"
43 # include "rds.h"
44 # include "GTB.h"
45 
46 # include "GTB_pixmap.h"
47 
48 /*------------------------------------------------------------\
49 |                                                             |
50 |                         Include Files                       |
51 |                                                             |
52 \------------------------------------------------------------*/
53 /*------------------------------------------------------------\
54 |                                                             |
55 |                           Constants                         |
56 |                                                             |
57 \------------------------------------------------------------*/
58 /*------------------------------------------------------------\
59 |                                                             |
60 |                            Types                            |
61 |                                                             |
62 \------------------------------------------------------------*/
63 /*------------------------------------------------------------\
64 |                                                             |
65 |                          Variables                          |
66 |                                                             |
67 \------------------------------------------------------------*/
68 /*------------------------------------------------------------\
69 |                                                             |
70 |                          Functions                          |
71 |                                                             |
72 \------------------------------------------------------------*/
73 /*------------------------------------------------------------\
74 |                                                             |
75 |                     GraalCreatePixmap                       |
76 |                                                             |
77 \------------------------------------------------------------*/
78 
GraalCreatePixmap(MainWidget,IconBits,IconWidth,IconHeight)79 Pixmap GraalCreatePixmap( MainWidget, IconBits, IconWidth, IconHeight )
80 
81        Widget  MainWidget;
82        char   *IconBits;
83        int     IconWidth;
84        int     IconHeight;
85 {
86   Pixel  Foreground;
87   Pixel  Background;
88   Pixmap IconPixmap;
89 
90   rdsbegin();
91 
92   XtVaGetValues( MainWidget, XmNforeground, &Foreground,
93                              XmNbackground, &Background, NULL );
94 
95   IconPixmap = XCreatePixmapFromBitmapData( XtDisplay( MainWidget ),
96                                             RootWindowOfScreen( XtScreen( MainWidget ) ),
97                                             IconBits, IconWidth, IconHeight,
98                                             Foreground, Background,
99                                             DefaultDepthOfScreen( XtScreen( MainWidget ) ) );
100 
101   rdsend();
102   return( IconPixmap );
103 }
104 
105