9 #define XRenderSupport 1
11 #define XRenderSupport 0
27 extern Visual
*Pvisual
;
28 extern Colormap Pcmap
;
29 extern unsigned int Pdepth
;
30 extern Display
*Pdpy
; /* Save area for display pointer */
31 extern Bool PUseDynamicColors
;
40 } PictureColorLimitOption
;
43 * Set a colon-separated path, with environment variable expansions.
44 * Expand '+' to be the value of the previous path.
47 * p_path pointer to the path variable
48 * newpath new value for *p_path
49 * free_old_path set true if we should free the memory pointed to
52 * The value of newpath is copied into a newly-allocated place, to which
53 * '*p_path' will point to upon return. The memory region pointed to by
54 * '*p_path' upon entry will be freed if 'free_old_path' is true.
57 void setPath(char** p_path
, const char* newpath
, int free_old_path
);
60 * Search along colon-separated path for filename, with optional suffix.
63 * path colon-separated path of directory names
64 * filename basename of file to search for
65 * suffix if non-NULL, filename may have this suffix
66 * type mode sought for file
68 * For each DIR in the path, search for DIR/filename then
69 * DIR/<filename><suffix> (if suffix is non-NULL). Return the full path of
72 * The parameter type is a mask consisting of one or more of R_OK, W_OK, X_OK
73 * and F_OK. R_OK, W_OK and X_OK request checking whether the file exists and
74 * has read, write and execute permissions, respectively. F_OK just requests
75 * checking for the existence of the file.
77 * Returns: full pathname of sought-after file, or NULL. The return value
78 * points to allocated memory that the caller must free.
82 const char* path
, const char* filename
, const char* suffix
, int type
);
84 /* This routine called during modules initialization. Fvwm has its own code
86 void PictureInitCMap(Display
*dpy
);
88 /* as above but force to use the default visual. If use_my_color_limit is True
89 * also enable color limitation (independent than the fvwm one). */
90 void PictureInitCMapRoot(
91 Display
*dpy
, Bool init_color_limit
, PictureColorLimitOption
*opt
,
92 Bool use_my_color_limit
, Bool init_dither
);
94 /* Analogue of the Xlib WhitePixel and BlackPixel functions but use the
96 Pixel
PictureWhitePixel(void);
97 Pixel
PictureBlackPixel(void);
99 /* for initialization of the white and black pixel (for fvwm as PictureInitCMap*
101 void PictureSetupWhiteAndBlack(void);
103 /* Analogue of the Xlib DefaultGC function but take care of the Pdepth:
104 - If Pdepth == DefaultDepth return the DefaultGC
105 - If Pdepth != DefaultDepth and first call create a static gc with the win
107 - If Pdepth != DefaultDepth and already called return the static gc */
108 GC
PictureDefaultGC(Display
*dpy
, Window win
);
110 /* these can be used to switch visuals before calling GetPicture */
111 /* do NOT use with CachePicture */
112 void PictureUseDefaultVisual(void);
113 void PictureUseFvwmVisual(void);
114 void PictureSaveFvwmVisual(void);
116 /** Returns current setting of the image path **/
117 char* PictureGetImagePath(void);
120 /** Sets image path to newpath. Environment variables are expanded, and '+'
121 is expanded to previous value of imagepath. The new path is in
122 newly-allocated memory, so newpath may be freed or re-used. **/
123 void PictureSetImagePath(const char* newpath
);
126 /** Search for file along pathlist. If pathlist is NULL, will use the current
127 imagepath setting. If filename is not found, but filename.gz is found,
128 will return the latter. Mode is typically R_OK. See searchPath() for
130 char* PictureFindImageFile(
131 const char* filename
, const char* pathlist
, int mode
);
133 typedef struct FvwmPictureThing
135 struct FvwmPictureThing
*next
;
137 unsigned long stamp
; /* should be FileStamp */
138 unsigned long fpa_mask
;
154 unsigned alloc_pixels
: 1;
157 #define FPAM_NO_ALLOC_PIXELS (1) /* do not return the allocated pixels
158 * this is used only if PUseDynamicColors,
159 * if not the allocated pixels are never
161 #define FPAM_NO_COLOR_LIMIT (1 << 1) /* do not use color limitation */
162 #define FPAM_NO_ALPHA (1 << 2) /* do not return the alpha channel */
163 #define FPAM_DITHER (1 << 3) /* dither the image */
164 #define FPAM_TINT (1 << 4) /* tint the image */
171 } FvwmPictureAttributes
;
173 /* tint no yet implemented */
174 #define PICTURE_FPA_AGREE(p,fpa) (p->fpa_mask == fpa.mask)
176 #define FRAM_HAVE_ADDED_ALPHA (1)
177 #define FRAM_HAVE_TINT (1 << 1)
178 #define FRAM_HAVE_UNIFORM_COLOR (1 << 2)
179 #define FRAM_DEST_IS_A_WINDOW (1 << 3)
180 #define FRAM_HAVE_ICON_CSET (1 << 4)
182 #include "Colorset.h"
187 int added_alpha_percent
;
191 colorset_t
*colorset
;
192 } FvwmRenderAttributes
;
194 #define PICTURE_HAS_ALPHA(picture,cset) \
195 ((picture && picture->alpha != None) || \
196 (cset >= 0 && Colorset[cset].icon_alpha_percent < 100))
197 /* alpha limit if we cannot use the alpha channel */
198 #define PICTURE_ALPHA_LIMIT 130
206 unsigned long *pixels_table
;
207 int pixels_table_size
;
208 } PictureImageColorAllocator
;
210 #endif /* Picture_Base_H */