-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathEstyle.fs
49 lines (39 loc) · 1.37 KB
/
Estyle.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
\ Enlightenment style 14feb01py
\ This style uses Imlib 14feb01py
\needs imlib include imlib.fs
\needs xconst | import xconst
also DOS also Memory also imlib also xconst also X11 also MINOS also
: get-imdata ( dpy -- imdata )
dup ImlibInit >r
dup DefaultScreen DefaultDepth
dup 24 >= IF drop 4 ELSE
15 < IF \ 0" colors.rgb" r@ ImlibLoadColors drop
3 ELSE 5 THEN THEN
r@ ImlibSetRenderType drop r> ;
xresource implements
: open ( string -- )
XOpenDisplay dup dpy ! get-imdata imdata ! ;
\ There should be a close method, but there
\ is no such thing in Imlib
class;
screen xrc dpy @ get-imdata screen xrc imdata !
\ read icons with imlib 14feb98py
\ make a awful pink the default background
| Create bgcol struct ImColor allot
$FE bgcol ImColor r !
$00 bgcol ImColor g !
$FF bgcol ImColor b !
: (read-imicon ( addr u -- image )
s" .icn" suffix? IF read-icn pause EXIT THEN
dup 1+ NewPtr dup >r place r@ c>0"
r@ >path.file
screen xrc imdata @ ImlibLoadImage
bgcol over Image shape_color sizeof ImColor move
r> DisposPtr ;
: >pswh ( image --- pixmap1 pixmap2 w h ) >r
r@ Image pixmap @
r@ Image shape_mask @
r@ Image width @
r> Image height @ ;
: read-imicon (read-imicon >pswh ;
\ ' read-imicon IS read-icon