dtinfo subtree dtinfo
[oweals/cde.git] / cde / programs / dtinfo / dtinfo / src / Other / XpmLib.hh
1 // $XConsortium: XpmLib.hh /main/3 1996/06/11 16:30:35 cde-hal $
2 /*      Copyright (c) 1994 FUJITSU LIMITED      */
3 /*      All Rights Reserved                     */
4
5
6 #ifndef XPMLIB_HH
7 #define XPMLIB_HH
8
9 #include <dlfcn.h>
10 #include <X11/xpm.h>
11
12 class XpmLib
13 {
14 public:
15
16   XpmLib(const char* = 0, int = RTLD_LAZY);
17   ~XpmLib();
18
19   bool is_open() { return f_handle ? TRUE : FALSE; } // if library opened properly
20
21   int CreatePixmapFromData(Display*, Drawable, char**, Pixmap*, Pixmap*, XpmAttributes*);
22
23   int CreatePixmapFromBuffer(Display*, Drawable, char*, Pixmap*, Pixmap*, XpmAttributes*);
24
25   int ReadFileToPixmap(Display*, Drawable, char*, Pixmap*, Pixmap*, XpmAttributes*);
26
27   static XpmLib& xpm_lib() { return *f_xpm_lib; }
28
29 private:
30
31   void* f_handle;
32
33   static XpmLib* f_xpm_lib;
34
35   void* symbol(const char*);
36 };
37
38 inline XpmLib& xpm_lib()
39 {
40   return XpmLib::xpm_lib();
41 }
42
43 #endif