Miscellany
public c v1 · immutable#define ICON(icon_file, icon_name) \ group { \ name: icon_name; \ images { \ image: icon_file COMP; \ image: "text_bg.png" COMP; \ } \ parts { \ part { \ name: "icon"; \ type: IMAGE; \ mouse_events: 0; \ description { \ state: "default" 0.0; \ aspect: 1.0 1.0; \ aspect_preference: BOTH; \ image.normal: icon_file; \ rel1.relative: 0 0; \ rel1.offset: 8 8; \ rel2.relative: 1 0; \ rel2.offset: -7 -7; \ rel2.to_y: "text"; \ align: 0.5 0.5; \ } \ description { \ state: "down" 0.0; \ inherit: "default" 0.0; \ color: 255 255 255 128; \ } \ } \ part { \ name: "text_bg"; \ type: IMAGE; \ mouse_events: 0; \ description { \ state: "default" 0.0; \ rel1.to: "text"; \ rel1.offset: -4 -4; \ rel2.to: "text"; \ rel2.offset: 3 3; \ image.normal: "text_bg.png"; \ image.border: 5 5 5 5; \ } \ description { \ state: "down" 0.0; \ inherit: "default" 0.0; \ color: 255 255 255 128; \ } \ } \ part { \ name: "text"; \ type: TEXT; \ mouse_events: 0; \ description { \ state: "default" 0.0; \ color: 255 255 255 255; \ rel1.relative: 0.0 1.0; \ rel1.offset: 0 -7; \ rel2.relative: 1.0 1.0; \ rel2.offset: 0 -7; \ align: 0.5 1.0; \ fixed: 1 1; \ text { \ font: "Sans"; \ size: 12; \ text: icon_name; \ min: 1 1; \ max: 1 1; \ } \ } \ description { \ state: "down" 0.0; \ inherit: "default" 0.0; \ color: 0 0 0 128; \ } \ } \ part { \ name: "events"; \ type: RECT; \ mouse_events: 1; \ description { \ state: "default" 0.0; \ color: 0 0 0 0; \ visible: 1; \ } \ } \ } \ programs { \ program { \ name: "mouse_down"; \ signal: "mouse,down,1"; \ source: "events"; \ action: STATE_SET "down" 0.0; \ transition: LINEAR 1.0; \ target: "icon"; \ target: "text_bg"; \ target: "text"; \ } \ program { \ name: "mouse_up"; \ signal: "mouse,up,1"; \ source: "events"; \ action: STATE_SET "default" 0.0; \ transition: LINEAR 1.0; \ target: "icon"; \ target: "text_bg"; \ target: "text"; \ } \ } \ } \collections { images { image: "bg.jpg" COMP; image: "bg_tile.png" COMP; } group { name: "interface"; parts { /* Rectangle Noir */ part { name: "Rectangle"; type: RECT; description { state: "default" 0.0; color: 0 0 0 255; } } part { name: "Fond"; type: IMAGE; description { state: "default" 0.0; image.normal: "bg.jpg"; } } part { name: "Hachage"; type: IMAGE; description { state: "default" 0.0; image.normal: "bg_tile.png"; fill { size { relative: 0.0 0.0; offset: 20 20; } } } } } } group { name: "table"; parts { part { name : "table_description"; type : TABLE; description { state : "default" 0.0; fixed: 1 1; table { homogeneous: TABLE; padding: 0 0; } } table { items { item { type: GROUP; source: "video"; position: 0 0; } item { type: GROUP; source: "meteo"; position: 0 1; } item { type: GROUP; source: "calc"; position: 0 2; } item { type: GROUP; source: "music"; position: 1 0; } item { type: GROUP; source: "calendar"; position: 1 1; } item { type: GROUP; source: "mail"; position: 1 2; } item { type: GROUP; source: "rss"; position: 2 0; } } } } } } ICON("video.png", "video"); ICON("meteo.png", "meteo"); ICON("calc.png", "calc"); ICON("music.png", "music"); ICON("calendar.png", "calendar"); ICON("mail.png", "mail"); ICON("rss.png", "rss");}