Artifact
81a0afd8141cdbfd71b0e417221f999c640c2153 :
File
net2o-notify.fs
— part of check-in
[6d1158f544]
at
2018-02-01 19:54:58
on branch trunk
— Use opengl in Linux, too
(user:
bernd
size: 2867)
File
notify.fs
— part of check-in
[2c969be80c]
at
2018-03-26 20:37:02
on branch trunk
— Remove needless net2o- prefix from files
(user:
bernd
size: 2867)
0000: 5c 20 6e 65 74 32 6f 20 74 65 6d 70 6c 61 74 65 \ net2o template
0010: 20 66 6f 72 20 6e 65 77 20 66 69 6c 65 73 0a 0a for new files..
0020: 5c 20 43 6f 70 79 72 69 67 68 74 20 28 43 29 20 \ Copyright (C)
0030: 32 30 31 35 20 20 20 42 65 72 6e 64 20 50 61 79 2015 Bernd Pay
0040: 73 61 6e 0a 0a 5c 20 54 68 69 73 20 70 72 6f 67 san..\ This prog
0050: 72 61 6d 20 69 73 20 66 72 65 65 20 73 6f 66 74 ram is free soft
0060: 77 61 72 65 3a 20 79 6f 75 20 63 61 6e 20 72 65 ware: you can re
0070: 64 69 73 74 72 69 62 75 74 65 20 69 74 20 61 6e distribute it an
0080: 64 2f 6f 72 20 6d 6f 64 69 66 79 0a 5c 20 69 74 d/or modify.\ it
0090: 20 75 6e 64 65 72 20 74 68 65 20 74 65 72 6d 73 under the terms
00a0: 20 6f 66 20 74 68 65 20 47 4e 55 20 41 66 66 65 of the GNU Affe
00b0: 72 6f 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 ro General Publi
00c0: 63 20 4c 69 63 65 6e 73 65 20 61 73 20 70 75 62 c License as pub
00d0: 6c 69 73 68 65 64 20 62 79 0a 5c 20 74 68 65 20 lished by.\ the
00e0: 46 72 65 65 20 53 6f 66 74 77 61 72 65 20 46 6f Free Software Fo
00f0: 75 6e 64 61 74 69 6f 6e 2c 20 65 69 74 68 65 72 undation, either
0100: 20 76 65 72 73 69 6f 6e 20 33 20 6f 66 20 74 68 version 3 of th
0110: 65 20 4c 69 63 65 6e 73 65 2c 20 6f 72 0a 5c 20 e License, or.\
0120: 28 61 74 20 79 6f 75 72 20 6f 70 74 69 6f 6e 29 (at your option)
0130: 20 61 6e 79 20 6c 61 74 65 72 20 76 65 72 73 69 any later versi
0140: 6f 6e 2e 0a 0a 5c 20 54 68 69 73 20 70 72 6f 67 on...\ This prog
0150: 72 61 6d 20 69 73 20 64 69 73 74 72 69 62 75 74 ram is distribut
0160: 65 64 20 69 6e 20 74 68 65 20 68 6f 70 65 20 74 ed in the hope t
0170: 68 61 74 20 69 74 20 77 69 6c 6c 20 62 65 20 75 hat it will be u
0180: 73 65 66 75 6c 2c 0a 5c 20 62 75 74 20 57 49 54 seful,.\ but WIT
0190: 48 4f 55 54 20 41 4e 59 20 57 41 52 52 41 4e 54 HOUT ANY WARRANT
01a0: 59 3b 20 77 69 74 68 6f 75 74 20 65 76 65 6e 20 Y; without even
01b0: 74 68 65 20 69 6d 70 6c 69 65 64 20 77 61 72 72 the implied warr
01c0: 61 6e 74 79 20 6f 66 0a 5c 20 4d 45 52 43 48 41 anty of.\ MERCHA
01d0: 4e 54 41 42 49 4c 49 54 59 20 6f 72 20 46 49 54 NTABILITY or FIT
01e0: 4e 45 53 53 20 46 4f 52 20 41 20 50 41 52 54 49 NESS FOR A PARTI
01f0: 43 55 4c 41 52 20 50 55 52 50 4f 53 45 2e 20 20 CULAR PURPOSE.
0200: 53 65 65 20 74 68 65 0a 5c 20 47 4e 55 20 41 66 See the.\ GNU Af
0210: 66 65 72 6f 20 47 65 6e 65 72 61 6c 20 50 75 62 fero General Pub
0220: 6c 69 63 20 4c 69 63 65 6e 73 65 20 66 6f 72 20 lic License for
0230: 6d 6f 72 65 20 64 65 74 61 69 6c 73 2e 0a 0a 5c more details...\
0240: 20 59 6f 75 20 73 68 6f 75 6c 64 20 68 61 76 65 You should have
0250: 20 72 65 63 65 69 76 65 64 20 61 20 63 6f 70 79 received a copy
0260: 20 6f 66 20 74 68 65 20 47 4e 55 20 41 66 66 65 of the GNU Affe
0270: 72 6f 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 ro General Publi
0280: 63 20 4c 69 63 65 6e 73 65 0a 5c 20 61 6c 6f 6e c License.\ alon
0290: 67 20 77 69 74 68 20 74 68 69 73 20 70 72 6f 67 g with this prog
02a0: 72 61 6d 2e 20 20 49 66 20 6e 6f 74 2c 20 73 65 ram. If not, se
02b0: 65 20 3c 68 74 74 70 3a 2f 2f 77 77 77 2e 67 6e e <http://www.gn
02c0: 75 2e 6f 72 67 2f 6c 69 63 65 6e 73 65 73 2f 3e u.org/licenses/>
02d0: 2e 0a 0a 5c 20 6e 6f 74 69 66 69 63 61 74 69 6f ...\ notificatio
02e0: 6e 73 20 28 6f 6e 20 61 6e 64 72 6f 69 64 20 6f ns (on android o
02f0: 6e 6c 79 20 6e 6f 77 29 0a 0a 36 34 23 30 20 36 nly now)..64#0 6
0300: 34 56 61 6c 75 65 20 6c 61 73 74 2d 6e 6f 74 69 4Value last-noti
0310: 66 79 0a 36 34 23 30 20 36 34 56 61 6c 75 65 20 fy.64#0 64Value
0320: 6c 61 74 65 73 74 2d 6e 6f 74 69 66 79 0a 0a 73 latest-notify..s
0330: 63 6f 70 65 7b 20 63 6f 6e 66 69 67 0a 32 56 61 cope{ config.2Va
0340: 72 69 61 62 6c 65 20 64 65 6c 74 61 2d 6e 6f 74 riable delta-not
0350: 69 66 79 26 20 23 36 30 2e 30 30 30 2e 30 30 30 ify& #60.000.000
0360: 2e 30 30 30 20 64 65 6c 74 61 2d 6e 6f 74 69 66 .000 delta-notif
0370: 79 26 20 32 21 20 5c 20 6f 6e 65 20 6e 6f 74 69 y& 2! \ one noti
0380: 66 69 63 61 74 69 6f 6e 20 70 65 72 20 6d 69 6e fication per min
0390: 75 74 65 20 69 73 20 65 6e 6f 75 67 68 0a 56 61 ute is enough.Va
03a0: 72 69 61 62 6c 65 20 6e 6f 74 69 66 79 2d 6d 6f riable notify-mo
03b0: 64 65 23 20 33 20 6e 6f 74 69 66 79 2d 6d 6f 64 de# 3 notify-mod
03c0: 65 23 20 21 0a 56 61 72 69 61 62 6c 65 20 6e 6f e# !.Variable no
03d0: 74 69 66 79 2d 72 67 62 23 20 24 46 46 46 46 30 tify-rgb# $FFFF0
03e0: 30 20 6e 6f 74 69 66 79 2d 72 67 62 23 20 21 0a 0 notify-rgb# !.
03f0: 56 61 72 69 61 62 6c 65 20 6e 6f 74 69 66 79 2d Variable notify-
0400: 6f 6e 23 20 35 30 30 20 6e 6f 74 69 66 79 2d 6f on# 500 notify-o
0410: 6e 23 20 21 0a 56 61 72 69 61 62 6c 65 20 6e 6f n# !.Variable no
0420: 74 69 66 79 2d 6f 66 66 23 20 34 35 30 30 20 6e tify-off# 4500 n
0430: 6f 74 69 66 79 2d 6f 66 66 23 20 21 0a 56 61 72 otify-off# !.Var
0440: 69 61 62 6c 65 20 6e 6f 74 69 66 79 2d 74 65 78 iable notify-tex
0450: 74 23 20 6e 6f 74 69 66 79 2d 74 65 78 74 23 20 t# notify-text#
0460: 6f 6e 0a 56 61 72 69 61 62 6c 65 20 6e 6f 74 69 on.Variable noti
0470: 66 79 3f 23 20 2d 32 20 6e 6f 74 69 66 79 3f 23 fy?# -2 notify?#
0480: 20 21 20 5c 20 64 65 66 61 75 6c 74 3a 20 6e 6f ! \ default: no
0490: 20 6e 6f 74 69 66 69 63 61 74 69 6f 6e 20 77 68 notification wh
04a0: 65 6e 20 61 63 74 69 76 65 0a 7d 73 63 6f 70 65 en active.}scope
04b0: 0a 0a 3a 20 74 69 63 6b 2d 6e 6f 74 69 66 79 3f ..: tick-notify?
04c0: 20 28 20 2d 2d 20 66 6c 61 67 20 29 0a 20 20 20 ( -- flag ).
04d0: 20 74 69 63 6b 73 20 6c 61 73 74 2d 6e 6f 74 69 ticks last-noti
04e0: 66 79 20 36 34 2d 20 63 6f 6e 66 69 67 3a 64 65 fy 64- config:de
04f0: 6c 74 61 2d 6e 6f 74 69 66 79 26 20 32 40 20 64 lta-notify& 2@ d
0500: 3e 36 34 20 36 34 3c 20 3b 0a 0a 56 61 72 69 61 >64 64< ;..Varia
0510: 62 6c 65 20 6e 6f 74 69 66 79 24 0a 56 61 72 69 ble notify$.Vari
0520: 61 62 6c 65 20 70 65 6e 64 69 6e 67 2d 6e 6f 74 able pending-not
0530: 69 66 69 63 61 74 69 6f 6e 73 0a 0a 3a 20 6e 6f ifications..: no
0540: 74 69 66 79 2d 20 28 20 2d 2d 20 29 0a 20 20 20 tify- ( -- ).
0550: 20 70 65 6e 64 69 6e 67 2d 6e 6f 74 69 66 69 63 pending-notific
0560: 61 74 69 6f 6e 73 20 6f 66 66 0a 20 20 20 20 6c ations off. l
0570: 61 74 65 73 74 2d 6e 6f 74 69 66 79 20 74 6f 20 atest-notify to
0580: 6c 61 73 74 2d 6e 6f 74 69 66 79 20 3b 0a 0a 53 last-notify ;..S
0590: 65 6d 61 20 6e 6f 74 69 66 79 2d 73 65 6d 61 0a ema notify-sema.
05a0: 3a 20 6e 6f 74 69 66 79 3b 20 6e 69 70 20 28 3b : notify; nip (;
05b0: 5d 29 20 5d 5d 20 6e 6f 74 69 66 79 2d 73 65 6d ]) ]] notify-sem
05c0: 61 20 63 2d 73 65 63 74 69 6f 6e 20 3b 20 5b 5b a c-section ; [[
05d0: 20 3b 0a 3a 20 6e 6f 74 69 66 79 3e 20 63 6f 6d ;.: notify> com
05e0: 70 2d 5b 3a 20 5b 27 5d 20 6e 6f 74 69 66 79 3b p-[: ['] notify;
05f0: 20 63 6f 6c 6f 6e 2d 73 79 73 2d 78 74 2d 6f 66 colon-sys-xt-of
0600: 66 73 65 74 20 73 74 69 63 6b 20 3b 20 69 6d 6d fset stick ; imm
0610: 65 64 69 61 74 65 0a 3a 20 6e 6f 74 69 66 79 2b ediate.: notify+
0620: 20 28 20 61 64 64 72 20 75 20 2d 2d 20 29 20 20 ( addr u -- )
0630: 6e 6f 74 69 66 79 3e 20 6e 6f 74 69 66 79 24 20 notify> notify$
0640: 24 2b 21 20 3b 0a 3a 20 6e 6f 74 69 66 79 21 20 $+! ;.: notify!
0650: 28 20 61 64 64 72 20 75 20 2d 2d 20 29 20 20 6e ( addr u -- ) n
0660: 6f 74 69 66 79 3e 20 6e 6f 74 69 66 79 24 20 24 otify> notify$ $
0670: 21 20 3b 0a 0a 3a 20 6e 6f 74 69 66 79 2d 74 69 ! ;..: notify-ti
0680: 74 6c 65 20 28 20 2d 2d 20 29 0a 20 20 20 20 2e tle ( -- ). .
0690: 22 20 6e 65 74 32 6f 3a 20 22 20 70 65 6e 64 69 " net2o: " pendi
06a0: 6e 67 2d 6e 6f 74 69 66 69 63 61 74 69 6f 6e 73 ng-notifications
06b0: 20 40 20 64 75 70 20 2e 0a 20 20 20 20 2e 22 20 @ dup .. ."
06c0: 4d 65 73 73 61 67 65 22 20 31 20 3e 20 49 46 20 Message" 1 > IF
06d0: 2e 22 20 73 22 20 20 54 48 45 4e 20 3b 0a 0a 5b ." s" THEN ;..[
06e0: 49 46 44 45 46 5d 20 61 6e 64 72 6f 69 64 0a 20 IFDEF] android.
06f0: 20 20 20 72 65 71 75 69 72 65 20 61 6e 64 72 6f require andro
0700: 69 64 2f 6e 6f 74 69 66 79 2e 66 73 0a 5b 45 4c id/notify.fs.[EL
0710: 53 45 5d 0a 20 20 20 20 5b 49 46 44 45 46 5d 20 SE]. [IFDEF]
0720: 6c 69 6e 75 78 0a 09 72 65 71 75 69 72 65 20 6c linux..require l
0730: 69 6e 75 78 2f 6e 6f 74 69 66 79 2e 66 73 0a 09 inux/notify.fs..
0740: 5b 49 46 55 4e 44 45 46 5d 20 72 65 6e 64 65 72 [IFUNDEF] render
0750: 69 6e 67 0a 09 20 20 20 20 72 65 71 75 69 72 65 ing.. require
0760: 20 6d 69 6e 6f 73 32 2f 67 6c 2d 68 65 6c 70 65 minos2/gl-helpe
0770: 72 2e 66 73 0a 09 5b 54 48 45 4e 5d 0a 20 20 20 r.fs..[THEN].
0780: 20 5b 54 48 45 4e 5d 0a 09 0a 20 20 20 20 3a 20 [THEN]... :
0790: 73 68 6f 77 2d 6e 6f 74 69 66 69 63 61 74 69 6f show-notificatio
07a0: 6e 20 28 20 2d 2d 20 29 0a 09 31 20 70 65 6e 64 n ( -- )..1 pend
07b0: 69 6e 67 2d 6e 6f 74 69 66 69 63 61 74 69 6f 6e ing-notification
07c0: 73 20 2b 21 0a 09 5b 49 46 44 45 46 5d 20 6c 69 s +!..[IFDEF] li
07d0: 6e 75 78 2d 6e 6f 74 69 66 69 63 61 74 69 6f 6e nux-notification
07e0: 0a 09 20 20 20 20 6c 69 6e 75 78 2d 6e 6f 74 69 .. linux-noti
07f0: 66 69 63 61 74 69 6f 6e 0a 09 5b 54 48 45 4e 5d fication..[THEN]
0800: 20 3b 0a 20 20 20 20 3a 20 6d 73 67 2d 62 75 69 ;. : msg-bui
0810: 6c 64 65 72 20 3b 0a 20 20 20 20 5b 49 46 55 4e lder ;. [IFUN
0820: 44 45 46 5d 20 72 65 6e 64 65 72 69 6e 67 0a 09 DEF] rendering..
0830: 56 61 72 69 61 62 6c 65 20 72 65 6e 64 65 72 69 Variable renderi
0840: 6e 67 20 20 2d 31 20 72 65 6e 64 65 72 69 6e 67 ng -1 rendering
0850: 20 21 0a 20 20 20 20 5b 54 48 45 4e 5d 0a 20 20 !. [THEN].
0860: 20 20 61 6c 73 6f 20 61 6c 73 6f 0a 5b 54 48 45 also also.[THE
0870: 4e 5d 0a 0a 3a 20 6d 73 67 2d 6e 6f 74 69 66 79 N]..: msg-notify
0880: 20 28 20 2d 2d 20 29 20 6e 6f 74 69 66 79 3e 0a ( -- ) notify>.
0890: 20 20 20 20 74 69 63 6b 73 20 74 6f 20 6c 61 74 ticks to lat
08a0: 65 73 74 2d 6e 6f 74 69 66 79 0a 20 20 20 20 72 est-notify. r
08b0: 65 6e 64 65 72 69 6e 67 20 40 20 63 6f 6e 66 69 endering @ confi
08c0: 67 3a 6e 6f 74 69 66 79 3f 23 20 40 20 3c 3d 20 g:notify?# @ <=
08d0: 64 75 70 20 49 46 0a 09 6e 6f 74 69 66 79 2d 0a dup IF..notify-.
08e0: 20 20 20 20 54 48 45 4e 0a 20 20 20 20 74 69 63 THEN. tic
08f0: 6b 2d 6e 6f 74 69 66 79 3f 20 6f 72 20 30 3d 20 k-notify? or 0=
0900: 49 46 0a 09 5b 49 46 44 45 46 5d 20 62 75 69 6c IF..[IFDEF] buil
0910: 64 2d 6e 6f 74 69 66 69 63 61 74 69 6f 6e 0a 09 d-notification..
0920: 20 20 20 20 62 75 69 6c 64 2d 6e 6f 74 69 66 69 build-notifi
0930: 63 61 74 69 6f 6e 20 73 68 6f 77 2d 6e 6f 74 69 cation show-noti
0940: 66 69 63 61 74 69 6f 6e 0a 09 5b 54 48 45 4e 5d fication..[THEN]
0950: 0a 09 6c 61 74 65 73 74 2d 6e 6f 74 69 66 79 20 ..latest-notify
0960: 74 6f 20 6c 61 73 74 2d 6e 6f 74 69 66 79 0a 20 to last-notify.
0970: 20 20 20 54 48 45 4e 20 20 6e 6f 74 69 66 79 24 THEN notify$
0980: 20 24 6f 66 66 20 3b 0a 0a 70 72 65 76 69 6f 75 $off ;..previou
0990: 73 20 70 72 65 76 69 6f 75 73 0a 0a 30 20 5b 49 s previous..0 [I
09a0: 46 5d 0a 4c 6f 63 61 6c 20 56 61 72 69 61 62 6c F].Local Variabl
09b0: 65 73 3a 0a 66 6f 72 74 68 2d 6c 6f 63 61 6c 2d es:.forth-local-
09c0: 77 6f 72 64 73 3a 0a 20 20 20 20 28 0a 20 20 20 words:. (.
09d0: 20 20 28 28 22 6e 65 74 32 6f 3a 22 20 22 2b 6e (("net2o:" "+n
09e0: 65 74 32 6f 3a 22 29 20 64 65 66 69 6e 69 74 69 et2o:") definiti
09f0: 6f 6e 2d 73 74 61 72 74 65 72 20 28 66 6f 6e 74 on-starter (font
0a00: 2d 6c 6f 63 6b 2d 6b 65 79 77 6f 72 64 2d 66 61 -lock-keyword-fa
0a10: 63 65 20 2e 20 31 29 0a 20 20 20 20 20 20 22 5b ce . 1). "[
0a20: 20 5c 74 5c 6e 5d 22 20 74 20 6e 61 6d 65 20 28 \t\n]" t name (
0a30: 66 6f 6e 74 2d 6c 6f 63 6b 2d 66 75 6e 63 74 69 font-lock-functi
0a40: 6f 6e 2d 6e 61 6d 65 2d 66 61 63 65 20 2e 20 33 on-name-face . 3
0a50: 29 29 0a 20 20 20 20 20 28 22 5b 61 2d 7a 30 2d )). ("[a-z0-
0a60: 39 5d 2b 28 22 20 69 6d 6d 65 64 69 61 74 65 20 9]+(" immediate
0a70: 28 66 6f 6e 74 2d 6c 6f 63 6b 2d 63 6f 6d 6d 65 (font-lock-comme
0a80: 6e 74 2d 66 61 63 65 20 2e 20 31 29 0a 20 20 20 nt-face . 1).
0a90: 20 20 20 22 29 22 20 6e 69 6c 20 63 6f 6d 6d 65 ")" nil comme
0aa0: 6e 74 20 28 66 6f 6e 74 2d 6c 6f 63 6b 2d 63 6f nt (font-lock-co
0ab0: 6d 6d 65 6e 74 2d 66 61 63 65 20 2e 20 31 29 29 mment-face . 1))
0ac0: 0a 20 20 20 20 29 0a 66 6f 72 74 68 2d 6c 6f 63 . ).forth-loc
0ad0: 61 6c 2d 69 6e 64 65 6e 74 2d 77 6f 72 64 73 3a al-indent-words:
0ae0: 0a 20 20 20 20 28 0a 20 20 20 20 20 28 28 22 6e . (. (("n
0af0: 65 74 32 6f 3a 22 20 22 2b 6e 65 74 32 6f 3a 22 et2o:" "+net2o:"
0b00: 29 20 28 30 20 2e 20 32 29 20 28 30 20 2e 20 32 ) (0 . 2) (0 . 2
0b10: 29 20 6e 6f 6e 2d 69 6d 6d 65 64 69 61 74 65 29 ) non-immediate)
0b20: 0a 20 20 20 20 29 0a 45 6e 64 3a 0a 5b 54 48 45 . ).End:.[THE
0b30: 4e 5d 0a N].