1 1.1 mrg <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 2 1.1 mrg <html lang="en"> 3 1.1 mrg <HEAD> 4 1.1 mrg <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 5 1.1 mrg <TITLE>FAQ XPM</TITLE> 6 1.1 mrg </HEAD> 7 1.1 mrg 8 1.1 mrg <body> 9 1.1 mrg <h1 align="center">The XPM<br> 10 1.1 mrg Frequently Asked Questions</h1> 11 1.1 mrg <p> 12 1.1 mrg This article contains the answers to some Frequently Asked Questions about the 13 1.1 mrg XPM format and/or library. If you don't find the answer to your problem here, 14 1.1 mrg then you can mail either to lehors (a] sophia.inria.fr or to the mailing list 15 1.1 mrg xpm-talk (a] sophia.inria.fr. 16 1.1 mrg 17 1.1 mrg 18 1.1 mrg <h2>Contents</h2> 19 1.1 mrg 20 1.1 mrg <ol> 21 1.1 mrg <li><a href="#Q1">How do I convert my images to or from XPM ?</a> 22 1.1 mrg <li><a href="#Q2">Why are my XPM files said to be invalid ?</a> 23 1.1 mrg <li><a href="#Q3">Why does my program core dumps using XPM ?</a> 24 1.1 mrg <li><a href="#Q4">Why does my program core dumps using XPM with a widget ?</a> 25 1.1 mrg <li><a href="#Q5">How can I get a non rectangular icon using XPM ?</a> 26 1.1 mrg <li><a href="#Q6">What exactly triggers the creation of a mask when using XPM ?</a> 27 1.1 mrg <li><a href="#Q7">How should I use the mask ?</a> 28 1.1 mrg <li><a href="#Q8">Is there a string to pixmap converter somewhere ?</a> 29 1.1 mrg <li><a href="#Q9">How can I edit XPM icons ?</a> 30 1.1 mrg <li><a href="#Q10">Is there a collection of icons somewhere ?</a> 31 1.1 mrg <li><a href="#Q11">The documentation fails to print out. Why ?</a> 32 1.1 mrg <li><a href="#copy">Copyright</a> 33 1.1 mrg </ol> 34 1.1 mrg 35 1.1 mrg 36 1.1 mrg <h2><a name="Q1">1. How do I convert my images to or from XPM ?</a></h2> 37 1.1 mrg <p> 38 1.1 mrg Netpbm is surely the best image conversion package that I know of. It defines 39 1.1 mrg formats for color, gray and monochrome images and provides a set of filters. 40 1.1 mrg Thus a GIF image can be converted to XPM with something like: 41 1.1 mrg <p> 42 1.1 mrg $ giftoppm youricon.gif | ppmtoxpm > youricon.xpm 43 1.1 mrg <p> 44 1.1 mrg The latest release can be found at least from wuarchive.wustl.edu 45 1.1 mrg (128.252.135.4), directory /graphics/graphics/packages/NetPBM 46 1.1 mrg 47 1.1 mrg 48 1.1 mrg <h2><a name="Q2">2. Why are my XPM files said to be invalid ?</a></h2> 49 1.1 mrg <p> 50 1.1 mrg There are three official versions of the XPM format. The XPM library since 51 1.1 mrg version 3.3 can read all them but writes out only XPM 3. Also the small 52 1.1 mrg program called sxpm which is part of the XPM library package can be used to 53 1.1 mrg automatically translate XPM 1 and 2 files to XPM 3 with a command such as: 54 1.1 mrg <p> 55 1.1 mrg $ sxpm -nod yourxpm1or2file -o yourxpm3file 56 1.1 mrg <p> 57 1.1 mrg Also, the XPM format defines "None" to be the color name meaning 58 1.1 mrg "transparent", but IXI used to hack the XPM library in its early days to 59 1.1 mrg handle transparency as "#Transparent". This makes IXI format not compatible 60 1.1 mrg with the official XPM format, and so not readable neither by the official XPM 61 1.1 mrg library nor any of the programs built on top of it. 62 1.1 mrg <p> 63 1.1 mrg The only solutions are either to stick on IXI programs which can deal with 64 1.1 mrg their format or convert your files to the standard XPM format. This can be 65 1.1 mrg done simply by changing "#Transparent" to "None". 66 1.1 mrg 67 1.1 mrg 68 1.1 mrg <h2><a name="Q3">3. Why does my program core dumps using XPM ?</a></h2> 69 1.1 mrg <p> 70 1.1 mrg Be sure the XpmAttributes structure you pass by reference has a valid 71 1.1 mrg valuemask. You can give NULL instead if you don't want to use an 72 1.1 mrg XpmAttributes but if you do, you MUST initialize its valuemask component to 73 1.1 mrg some valid value, at least 0, otherwise unpredictable errors can occur. 74 1.1 mrg <p> 75 1.1 mrg So instead of doing something like: 76 1.1 mrg <pre> 77 1.1 mrg XpmAttributes attrib; 78 1.1 mrg 79 1.1 mrg XpmReadFileToPixmap(dpy, d, filename, &pixmap, &mask, &attrib); 80 1.1 mrg </pre> 81 1.1 mrg <p> 82 1.1 mrg you should do: 83 1.1 mrg <pre> 84 1.1 mrg XpmAttributes attrib; 85 1.1 mrg 86 1.1 mrg attrib.valuemask = 0; 87 1.1 mrg XpmReadFileToPixmap(dpy, d, filename, &pixmap, &mask, &attrib); 88 1.1 mrg </pre> 89 1.1 mrg 90 1.1 mrg 91 1.1 mrg <h2><a name="Q4">4. Why does my program core dumps using XPM with a widget ?</a></h2> 92 1.1 mrg <ul> 93 1.1 mrg <li>First the XPM library is Xlib level, so don't pass your widget as a 94 1.1 mrg Drawable parameter. A Drawable is either a Window or a Pixmap. The widget's 95 1.1 mrg window can do the job but: 96 1.1 mrg 97 1.1 mrg <li>Then a widget only gets a Window when realized, so passing XtWindow(widget) 98 1.1 mrg with a not yet realized widget is wrong. Either realize you widget first or 99 1.1 mrg use another window. Since the Drawable parameter is only used to specify 100 1.1 mrg the screen to which the pixmap must be created on, most of the time the 101 1.1 mrg default root window is just fine. 102 1.1 mrg </ul> 103 1.1 mrg 104 1.1 mrg 105 1.1 mrg <h2><a name="Q5">5. How can I get a non rectangular icon using XPM ?</a></h2> 106 1.1 mrg <p> 107 1.1 mrg The X Window System does not support transparent color. However there are 108 1.1 mrg several ways you can use to get the same visual effect using XPM: 109 1.1 mrg <ul> 110 1.1 mrg <li>First you can use the None color to get a shape mask and use it as 111 1.1 mrg explained below (question 7). 112 1.1 mrg 113 1.1 mrg <li>Second you can define a symbolic color name such as "mask" in the XPM 114 1.1 mrg format file, then use the color overriding mechanism to set this symbolic 115 1.1 mrg color to the color of the underlying object. Note that in this case the XPM 116 1.1 mrg library won't create a shape mask, and that if the color of the underlying 117 1.1 mrg object is changed then you'll have to create a new pixmap. 118 1.1 mrg </ul> 119 1.1 mrg 120 1.1 mrg 121 1.1 mrg <h2><a name="Q6">6. What exactly triggers the creation of a mask when using XPM ?</a></h2> 122 1.1 mrg <p> 123 1.1 mrg Basically a mask is created if "None" is used as one of the color of the 124 1.1 mrg pixmap. Be aware that this is not only true if it is used in the XPM of the 125 1.1 mrg pixmap since the colors can be overridden at load time. So a mask is created 126 1.1 mrg if the "None" color is used at load time, coming either from the XPM 127 1.1 mrg definition or the color overriding. 128 1.1 mrg 129 1.1 mrg 130 1.1 mrg <h2><a name="Q7">7. How should I use the mask ?</a></h2> 131 1.1 mrg <p> 132 1.1 mrg There are basically two ways of using the mask: 133 1.1 mrg <ul> 134 1.1 mrg <li>Use the mask as a shapemask with the X11 Nonrectangular Saphe Window 135 1.1 mrg Extension. Typically this is what should be done when the icon is used in a 136 1.1 mrg desktop. 137 1.1 mrg 138 1.1 mrg <li>Use the mask as a clipmask in the GC you pass to XCopyArea when drawing the 139 1.1 mrg pixmap. So the "transparent" pixels being not actually drawn will get the 140 1.1 mrg underlying pixels colors. 141 1.1 mrg </ul> 142 1.1 mrg 143 1.1 mrg 144 1.1 mrg <h2><a name="Q8">8. Is there a string to pixmap converter for Motif ?</a></h2> 145 1.1 mrg <p> 146 1.1 mrg Yes, Motif 2.0 or later does support XPM pixmaps as well as XBM bitmaps. 147 1.1 mrg 148 1.1 mrg 149 1.1 mrg <h2><a name="Q9">9. How can I edit XPM icons ?</a></h2> 150 1.1 mrg <p> 151 1.1 mrg As listed below several editors either commercial or not are supporting the 152 1.1 mrg XPM format. However, pixmap is the one I would recommend since it is freely 153 1.1 mrg available and, being fully dedicated to XPM, it allows to edit all the 154 1.1 mrg special things, such as the symbolic color names, which makes XPM different 155 1.1 mrg from all the other image formats. Pixmap can always be found by ftp from 156 1.1 mrg ftp.x.org (contrib) and avahi.inria.fr (pub/pixmap). 157 1.1 mrg <p> 158 1.1 mrg Last Update: 3 August 1994 159 1.1 mrg <table border=1> 160 1.1 mrg <caption>XPM Icon Editors</caption> 161 1.1 mrg <tr><th>Program<th>Infos<th>Source/Author<th>Platforms<th>SA<th>XPM<th>cost 162 1.1 mrg <tr><td>pixmap<td><ul> 163 1.1 mrg <li><a href="ftp://ftp.x.org/contrib/application/pixmap/pixmap2.6.tar.gz">ftp://ftp.x.org/contrib/application/pixmap/pixmap2.6.tar.gz</a> 164 1.1 mrg <li>requires 3.4 or higher revision of Xpm lib. 165 1.1 mrg <li>supports all XPM format features 166 1.1 mrg <li>current version doesn't work on 24-plane displays 167 1.1 mrg </ul> 168 1.1 mrg <td>Lionel Mallet<td>source<td>yes<td>3<td>NC 169 1.1 mrg 170 1.1 mrg <tr><td>pixt<td><ul> 171 1.1 mrg <li><a href="ftp://ftp.x.org/contrib/pixt.tar.Z">ftp://ftp.x.org/contrib/pixt.tar.Z</a> 172 1.1 mrg <li>doesn't work on 24-plane displays 173 1.1 mrg <li>last updated November 1991 174 1.1 mrg </ul> 175 1.1 mrg <td>J. Michael Flanery<td>source<td>yes<td>1<td>NC 176 1.1 mrg 177 1.1 mrg <tr><td>pixed<td><ul> 178 1.1 mrg <li>part of X.desktop 179 1.1 mrg <li>current version doesn't work on 24-plane displays 180 1.1 mrg </ul> 181 1.1 mrg <td>IXI<td>Many UNIX<td>no<td>3<td>N/A 182 1.1 mrg 183 1.1 mrg <tr><td>olpixmap<td><ul> 184 1.1 mrg <li>packaged with the OLIT (OpenLook) toolkit 185 1.1 mrg </ul> 186 1.1 mrg <td>USL<td>Sun, SVR4.2, UnixWare<td>no<td>1<td>N/A 187 1.1 mrg 188 1.1 mrg <tr><td>xfedor<td><ul> 189 1.1 mrg <li>only uses XLIB 190 1.1 mrg <li>doesn't work on 24-plane displays 191 1.1 mrg </ul> 192 1.1 mrg <td>Daniel Dardailler<td>source<td>yes<td>3<td>NC 193 1.1 mrg 194 1.1 mrg <tr><td>SCOpaint<td><ul> 195 1.1 mrg <li>included with the ODT package 196 1.1 mrg </ul> 197 1.1 mrg <td>SCO/Wing Eng<td>ODT<td>yes<td>2.8<td>N/A 198 1.1 mrg 199 1.1 mrg <tr><td>pme.icn<td><ul> 200 1.1 mrg <li>written in the Icon language 201 1.1 mrg </ul> 202 1.1 mrg <td>Icon Project<td>source<td>yes<td>3<td>NC 203 1.1 mrg 204 1.1 mrg <tr><td>PixEditT<td><ul> 205 1.1 mrg <li>there is currently no support for editing the colormap 206 1.1 mrg </ul> 207 1.1 mrg <td>Free Widget Foundation<td>source<td>yes<td>3<td>NC 208 1.1 mrg 209 1.1 mrg <tr><td>xscribble<td><ul> 210 1.1 mrg <li>requires the FWF, 8-bit pseudocolor 211 1.1 mrg <li><a href="ftp://ftp.cis.ufl.edu/pub/thoth">ftp://ftp.cis.ufl.edu/pub/thoth</a> 212 1.1 mrg <li>Alpha version (last updated April 1993) 213 1.1 mrg </ul> 214 1.1 mrg <td>Robert Forsman<td>source<td>yes<td>?<td>NC 215 1.1 mrg 216 1.1 mrg <tr><td>vueicon<td><ul> 217 1.1 mrg <li>included with Vue3.0 218 1.1 mrg </ul> 219 1.1 mrg <td>Hewlett-Packard<td>HP<td>yes<td>3<td>N/A 220 1.1 mrg 221 1.1 mrg <tr><td>iconedit V3<td> <td>SunSoft<td>Sparc/Sun3<td>yes<td>2<td>N/A 222 1.1 mrg 223 1.1 mrg <tr><td>Pixmap Editor<td><ul> 224 1.1 mrg <li>this is a Widget, not a complete program 225 1.1 mrg </ul> 226 1.1 mrg <td>ICS<td>?<td>yes<td>?<td>? 227 1.1 mrg 228 1.1 mrg <tr><td>ezX<td> <td>Sunrise Softwarey<td>?<td>?<td>?<td>N/A 229 1.1 mrg 230 1.1 mrg <tr><td>XPaint<td><ul> 231 1.1 mrg <li>full featured, works on all displays 232 1.1 mrg <li>current release is 2.1.1 (last update January 1994) 233 1.1 mrg </ul> 234 1.1 mrg <td>David Koblas<td>source<td>yes<td>3<td>NC 235 1.1 mrg 236 1.1 mrg <tr><td>Phoenix<td><ul> 237 1.1 mrg <li>full featured, 24-bit painting program, requires Motif. 238 1.1 mrg <li><a href="ftp://nic.funet.fi/pub/graphics/packages/phoenix">ftp://nic.funet.fi/pub/graphics/packages/phoenix</a> 239 1.1 mrg <li>Beta version (last updated September 1993) 240 1.1 mrg </ul> 241 1.1 mrg <td>ohtcolor (a] niksula.hut.fi<td>source<td>yes<td>3<td>NC 242 1.1 mrg 243 1.1 mrg <tr><td>pixed<td><ul> 244 1.1 mrg <li>pixed is part of the TeleUSE UIMS 245 1.1 mrg <li>More info is available from service (a] ignite.alsys.com 246 1.1 mrg </ul> 247 1.1 mrg <td>Alsys<td>Many UNIX<td>yes<td>3<td>N/A 248 1.1 mrg 249 1.1 mrg <tr><td>display<td><ul> 250 1.1 mrg <li><a href="ftp://ftp.x.org/contrib/application/ImageMagick/ImageMagick-3.2.tar.gz">ftp://ftp.x.org/contrib/application/ImageMagick/ImageMagick-3.2.tar.gz</a> 251 1.1 mrg <li>lots of image conversion and manipulation features 252 1.1 mrg </ul> 253 1.1 mrg <td>John Cristy<td>source<td>yes<td>3<td>NC 254 1.1 mrg </table> 255 1.1 mrg 256 1.1 mrg <p> 257 1.1 mrg SA - Stand Alone program<br> 258 1.1 mrg NC - No Charge (i.e. free); most programs are copyrighted.<br> 259 1.1 mrg XPM - XPM format supported<br> 260 1.1 mrg source - built from source code; likely works on all standard X platforms<br> 261 1.1 mrg N/A - icon editor is normally distributed with other software 262 1.1 mrg 263 1.1 mrg <p> 264 1.1 mrg Send updates, additions, corrections, etc. to <a 265 1.1 mrg href="mailto:dan (a] bristol.com">dan (a] bristol.com</a> 266 1.1 mrg 267 1.1 mrg 268 1.1 mrg <h2><a name="Q10">10. Is there a collection of icons somewhere ?</a></h2> 269 1.1 mrg <p> 270 1.1 mrg At least there is one freely available: Anthony's X Icon Library. You can 271 1.1 mrg found it on several ftp servers, such as <a href="ftp://server.berkeley.edu/pub/AIcons">server.berkeley.edu/pub/AIcons</a>. It 272 1.1 mrg contains only small icons (less than about 100x100 pixels in size) which are 273 1.1 mrg stored in groups in a logical way. Color icons are stored in XPM format and 274 1.1 mrg Black & White icons in XBM. 275 1.1 mrg 276 1.1 mrg 277 1.1 mrg <h2><a name="Q11">11. The documentation fails to print out. Why ?</a></h2> 278 1.1 mrg <p> 279 1.1 mrg The PostScript documentation file is formatted for US letter paper. Frame 280 1.1 mrg Maker tries very hard to ensure that you have the right paper and punts if 281 1.1 mrg you don't. However, you can easily work around this problem by applying the 282 1.1 mrg following patch. If for some reason applying the patch fails, you can still 283 1.1 mrg do it by hand. Just locate the corresponding block in the PS file and remove 284 1.1 mrg the lines with a leading '-' character. 285 1.1 mrg By the way, this applies to any doc generated by Frame Maker. The 286 1.1 mrg corresponding block might be slightly different depending on which version of 287 1.1 mrg Frame Maker was used, but it is still easy to locate. 288 1.1 mrg 289 1.1 mrg <pre> 290 1.1 mrg *** xpm.PS Wed Sep 11 15:47:43 1996 291 1.1 mrg --- xpm-A4.PS Thu Nov 21 09:27:28 1996 292 1.1 mrg *************** 293 1.1 mrg *** 647,668 **** 294 1.1.1.2 mrg 0 ne /edown exch def 295 1.1 mrg /yscale exch def 296 1.1 mrg /xscale exch def 297 1.1 mrg - FMLevel1 { 298 1.1 mrg - manualfeed {setmanualfeed} if 299 1.1.1.2 mrg - /FMdicttop countdictstack 1 add def 300 1.1.1.2 mrg - /FMoptop count def 301 1.1.1.2 mrg - setpapername 302 1.1.1.2 mrg - manualfeed {true} {papersize} ifelse 303 1.1.1.2 mrg - {manualpapersize} {false} ifelse 304 1.1.1.2 mrg - {desperatepapersize} {false} ifelse 305 1.1 mrg - { (Can't select requested paper size for Frame print job!) FMFAILURE } if 306 1.1 mrg - count -1 FMoptop {pop pop} for 307 1.1.1.2 mrg - countdictstack -1 FMdicttop {pop end} for 308 1.1 mrg - } 309 1.1 mrg - {{1 dict dup /PageSize [paperwidth paperheight]put setpagedevice}stopped 310 1.1 mrg - { (Can't select requested paper size for Frame print job!) FMFAILURE } if 311 1.1 mrg - {1 dict dup /ManualFeed manualfeed put setpagedevice } stopped pop } 312 1.1.1.2 mrg - ifelse 313 1.1.1.2 mrg 314 1.1 mrg FMPColor { 315 1.1 mrg currentcolorscreen 316 1.1 mrg --- 647,652 ---- 317 1.1 mrg </pre> 318 1.1 mrg 319 1.1 mrg 320 1.1 mrg <hr> 321 1.1 mrg <h2><a name="copy">Copyright (C) 1989-95 GROUPE BULL</a></h2> 322 1.1 mrg <p> 323 1.1 mrg Permission is hereby granted, free of charge, to any person obtaining a copy 324 1.1 mrg of this software and associated documentation files (the "Software"), to 325 1.1 mrg deal in the Software without restriction, including without limitation the 326 1.1 mrg rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 327 1.1 mrg sell copies of the Software, and to permit persons to whom the Software is 328 1.1 mrg furnished to do so, subject to the following conditions: 329 1.1 mrg <p> 330 1.1 mrg The above copyright notice and this permission notice shall be included in 331 1.1 mrg all copies or substantial portions of the Software. 332 1.1 mrg <p> 333 1.1 mrg THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 334 1.1 mrg IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 335 1.1 mrg FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 336 1.1 mrg GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 337 1.1 mrg AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 338 1.1 mrg CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 339 1.1 mrg <p> 340 1.1 mrg Except as contained in this notice, the name of GROUPE BULL shall not be 341 1.1 mrg used in advertising or otherwise to promote the sale, use or other dealings 342 1.1 mrg in this Software without prior written authorization from GROUPE BULL. 343 1.1 mrg </body> 344 1.1 mrg </html> 345