~ubuntu-branches/ubuntu/trusty/miwm/trusty

« back to all changes in this revision

Viewing changes to mipix.cc

  • Committer: Bazaar Package Importer
  • Author(s): Jari Aalto
  • Date: 2010-01-04 15:25:34 UTC
  • Revision ID: james.westby@ubuntu.com-20100104152534-l3fdvt162le460cv
Tags: upstream-1.1
ImportĀ upstreamĀ versionĀ 1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//-*-c++-*-
 
2
// ----------------------------------------------
 
3
// RCS data:
 
4
// $Date: 2003/06/23 14:47:23 $
 
5
// $Revision: 1.1.1.1 $
 
6
// $Source: /cvsroot/miwm/miwm/miwm/mipix.cc,v $
 
7
// $Id: mipix.cc,v 1.1.1.1 2003/06/23 14:47:23 bwise837 Exp $
 
8
// $RCSfile: mipix.cc,v $
 
9
// ----------------------------------------------
 
10
// Copyright by Ben Paul Wise.
 
11
// -------------------------------------------
 
12
// This program is free software; you can redistribute it and/or modify
 
13
// it under the terms of the GNU General Public License as published by
 
14
// the Free Software Foundation; either version 2 of the License, or
 
15
// (at your option) any later version.
 
16
// 
 
17
// This program is distributed in the hope that it will be useful,
 
18
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
19
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
20
// GNU General Public License for more details.
 
21
// 
 
22
// You should have received a copy of the GNU General Public License
 
23
// along with this program; if not, write to the Free Software
 
24
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
25
// ----------------------------------------------
 
26
 
 
27
#include "miwm.h"
 
28
#include "mipix.h"
 
29
 
 
30
// ----------------------------------------------
 
31
 
 
32
// returns a Pixmap, loaded from the given data, relative to the
 
33
// display of the given Widget. The closest colours are used. Exit
 
34
// is called given an error 
 
35
void loadPixmap(char **dname, Pixmap *xpm) {
 
36
#ifdef USE_PIXMAPS
 
37
        int status;
 
38
        XpmAttributes attr;
 
39
        Pixmap mask;
 
40
 
 
41
        attr.valuemask = XpmReturnPixels | XpmCloseness;
 
42
        attr.closeness = 20000;
 
43
        status = XpmCreatePixmapFromData(dpy, root,
 
44
                                         dname,xpm,&mask,&attr);
 
45
        if (status != XpmSuccess)
 
46
        {
 
47
                        fprintf(stderr,"Pixmap error: %s\n",XpmGetErrorString(status));
 
48
                        exit(1);
 
49
        }
 
50
#endif
 
51
        return;
 
52
}
 
53
 
 
54
 
 
55
// ----------------------------------------------
 
56
// end of mipix.cc
 
57
// ----------------------------------------------
 
58