1 /* -*-c-*- */
2 
3 #ifndef FVWMLIB_PICTURE_H
4 #define FVWMLIB_PICTURE_H
5 
6 #include "PictureBase.h"
7 #include "PictureImageLoader.h"
8 
9 /** Manipulating FvwmPictures **/
10 
11 /**
12  * For PGetFvwmPicture() and PCacheFvwmPicture(), setting
13  * ImagePath to NULL means "search the default image path".
14  **/
15 
16 /* <pubfunc>PGetFvwmPicture
17  * <description>
18  * Return an FvwmPicture loaded from the file pictureName found in the
19  * ImagePath.. If ImagePath is NULL the default image path is used.
20  * </description>
21  */
22 FvwmPicture* PGetFvwmPicture(
23 	Display* dpy, Window win, char* ImagePath, const char* pictureName,
24 	FvwmPictureAttributes fpa);
25 
26 /* <pubfunc>PFreeFvwmPictureData
27  * <description>
28  * Just free the data allocated by PGetFvwmPicture. This function does not
29  * Free the pixmaps for example.
30  * </description>
31  */
32 void PFreeFvwmPictureData(FvwmPicture *p);
33 
34 /* <pubfunc>PCacheFvwmPicture
35  * <description>
36  * Return the FvwmPicture loaded from the file pictureName found in the
37  * ImagePath. Fisrt the picture is searched in the FvwmPicture cache (so
38  * if this picture has been already loaded it is not loaded again and a
39  * weight is added to the found picture). If the picture is not in the cache
40  * it is loaded from the file and added to the FvwmPicture cache.
41  * If ImagePath is NULL the default image path is used.
42  * </description>
43  */
44 FvwmPicture* PCacheFvwmPicture(
45 	Display *dpy, Window win, char* ImagePath, const char* pictureName,
46 	FvwmPictureAttributes fpa);
47 
48 /* <pubfunc>PLoadFvwmPictureFromPixmap
49  * <description>
50  * Return a FvwmPicture from the given data.
51  * </description>
52  */
53 FvwmPicture *PLoadFvwmPictureFromPixmap(
54 	Display *dpy, Window win, char *name, Pixmap pixmap, Pixmap mask,
55 	Pixmap alpha, int width, int height, int nalloc_pixels,
56 	Pixel *alloc_pixels, int no_limit);
57 
58 /* <pubfunc>PDestroyFvwmPicture
59  * <description>
60  * Return a FvwmPicture from the given data. The picture is added to the
61  * FvwmPicture cache. This is not really useful as it is not possible
62  * to really cache a picture from the given data.
63  * </description>
64  */
65 FvwmPicture *PCacheFvwmPictureFromPixmap(
66 	Display *dpy, Window win, char *name, Pixmap pixmap,
67 	Pixmap mask, Pixmap alpha, int width, int height, int nalloc_pixels,
68 	Pixel *alloc_pixels, int no_limit);
69 
70 /* <pubfunc>PDestroyFvwmPicture
71  * <description>
72  * Remove a weight to the FvwmPicture p from the FvwmPicture cache.
73  * If the weight is zero the allocated datas from p are freed
74  * </description>
75  */
76 void PDestroyFvwmPicture(Display *dpy, FvwmPicture *p);
77 
78 /* <pubfunc>PCloneFvwmPicture
79  * <description>
80  * Duplicate an already allocated FvwmPicture in the FvwmPicture cache
81  * (a weight is added to the picture).
82  * </description>
83  */
84 FvwmPicture *PCloneFvwmPicture(FvwmPicture *pic);
85 
86 
87 void PicturePrintImageCache(int verbose);
88 
89 #endif
90