cvsimport
[fvwm-themes.git] / menu-system / fvwm_themes.h.in
blobd233fc7b92ca6215c14fbdd2eeb848990d620679
1 # the following file contains the functions:
2 # ftGetSectionIcon, ftFindIconByList, ftIsWmIcons, ftGetSectionIconForApp
3 # used below
4 !include fvwm_themes_data.h
6 # the following function try to find the "system" icons in a "standar place".
7 # Where debian and others distrib put the icons? the system-menu doc say
8 # in /usr/X11R6/include/X11/{pixmaps,bitmaps} but we can find icons of
9 # any size in these diectory (e.g., 32x32)?
10 # mandrake: /usr/share/icons/mini is ok!
11 # debian: ?
12 # other distro. based on debian ?
14 # So, Return nothing by default
15 function ftFindSystemMiniIcon($n) = ""
17 # here an example for a Linux-Mandrake 7.x distro, in any case the icon should
18 # be returned with its complet path
19 #function ftFindSystemMiniIcon($n)= \
20 # ifeqelse($n, "", "", \
21 # ifelsefile("/usr/share/icons/mini/" $n, \
22 # "/usr/share/icons/mini/" $n, "")))
24 # these functions try to found a transformed kde2 or gnome mini icons produced
25 # by fvwm-themes-images
27 function ftFindTrMiniIconMatch($n)= \
28 ifeqelse($n, "", "", \
29 ifelsefile("xFT_DATADIRx/tr-images/16x16-gnome/" $n, \
30 "xFT_DATADIRx/tr-images/16x16-gnome/" $n, \
31 ifelsefile("xFT_DATADIRx/tr-images/16x16-kde2/" $n, \
32 "xFT_DATADIRx/tr-images/16x16-kde2/" $n,\
33 "")))
35 function ftFindTrMiniIcon($i,$c,$t,$p)=\
36 ifeqelse(ftFindTrMiniIconMatch($i), "",\
37 ifeqelse(ftFindTrMiniIconMatch($c".xpm"), "",\
38 ifeqelse(ftFindTrMiniIconMatch($t".xpm"), "",\
39 ifeqelse(ftFindTrMiniIconMatch($p".xpm"), "",\
40 "",\
41 ftFindTrMiniIconMatch($p".xpm")),\
42 ftFindTrMiniIconMatch($t".xpm")),\
43 ftFindTrMiniIconMatch($c".xpm")),\
44 ftFindTrMiniIconMatch($i))
46 # return the best possible section ($f) icon by using the following
47 # preference order:
48 # 1. the wm-icons associated to a standard menu system section ($s)
49 # 2. the menu system icon ($i) if it is a wm-icons
50 # 3. the "system" mini icon (ftFindSystemMiniIcon should be edited)
51 # 4. the wm-icons associated to a standard section if the section is a
52 # subsection of a standard one
53 # 5. $f folder.xpm
54 # That you may want is to change this order
55 function ftFindBestSectionIcon($s,$i,$f)= \
56 ifeqelse(ftGetSectionIcon($s),"",\
57 ifeqelse(ftIsWmIcons($i,$f),"",\
58 ifeqelse(ftFindSystemMiniIcon($i),"",\
59 ifeqelse(ftGetSectionIcon(parent($s)),"",\
60 ifeqelse(ftGetSectionIcon(parent(parent($s))),"",\
61 $f "folder.xpm",\
62 $f ftGetSectionIcon(parent(parent($s)))),\
63 $f ftGetSectionIcon(parent($s))),\
64 ftFindSystemMiniIcon($i)),\
65 ftIsWmIcons($i,$f)),\
66 $f ftGetSectionIcon($s))
68 # return the best possible application ($f) icon by using the following
69 # preference order:
70 # 1. the menu system icon ($i) if it is a wm-icons
71 # 2. A wm-icons associated to the package ($p), or command ($c) or title ($t)
72 # via the ftFindIconByList function
73 # 3. As above but try to found a kde2 or gnome icons produced by
74 # fvwm-themes-images
75 # 4. the "system" mini icon (ftFindSystemMiniIcon should be edited)
76 # 5. the wm-icons associated to a standard section if the app is in
77 # such a section (or a subsection of such a section)
78 # 6. $f item.xpm
79 # That you may want is to change this order
80 function ftFindBestIcon($i,$p,$s,$c,$t,$f)= \
81 ifeqelse(ftIsWmIcons($i,$f),"",\
82 ifeqelse(ftFindIconByList($p,$c,$t,$f),"",\
83 ifeqelse(ftFindTrMiniIcon($i,$c,$t,$p),"",\
84 ifeqelse(ftFindSystemMiniIcon($i),"",\
85 ifeqelse(ftGetSectionIconForApp($s,$f),"",\
86 $f "item.xpm",\
87 ftGetSectionIconForApp($s,$f)),\
88 ftFindSystemMiniIcon($i)),\
89 ftFindTrMiniIcon($i,$c,$t,$p)),\
90 ftFindIconByList($p,$c,$t,$f)),\
91 ftIsWmIcons($i,$f))