Check-in [49c98efa7e]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix dark mode qr scan
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 49c98efa7e8cf21f0d2f4674ed123b33e4012c0c
User & Date: bernd 2020-01-03 13:31:04
Context
2020-01-06
21:59
light/dark-mode check-in: a2d9044788 user: bernd tags: trunk
2020-01-03
13:31
Fix dark mode qr scan check-in: 49c98efa7e user: bernd tags: trunk
2020-01-02
18:05
Bump version number check-in: 9770e8f0b9 user: bernd tags: trunk, 0.9.5-20200102
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to gui.fs.

636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
...
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
	fdup f2* to border
	fnegate fdup to borderl fdup to borderv to bordert
    ELSE
	fdup f2* to border
	0e to borderl fnegate f2* to bordert 0e to borderv
    THEN o o> ;
: add-dtms ( ticks -- )
    \small blackish
    1n fm* >day { day } day last-day <> IF
	{{
	    x-color { f: xc }
	    glue*l day-color x-color slide-frame dup .button1
	    xc to x-color
	    \bold day ['] .day $tmp }}text 25%b \regular
	}}z /center msgs-box .child+
................................................................................
' re-log#-token is update-log

: new-msg-par ( -- )
    {{ }}p "msg-par" name!
    dup .subbox box[] drop box[] cbl >bl
    dup .subbox "msg-box" name!
    to msg-box to msg-par
    \script cbl re-green log-mask @ +log#-date-token msg-box .child+
    \normal cbl ;
:noname { d: pk -- o }
    pk key| to msg:id$  pk startdate@ to msg:timestamp
    pk [: .simple-id ." : " ;] $tmp notify-nick!
    pk key| pkc over str= { me? }
    pk enddate@ otr? { otr }
    pk key| last-bubble-pk $@ str= otr last-otr? = and







|







 







|







636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
...
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
	fdup f2* to border
	fnegate fdup to borderl fdup to borderv to bordert
    ELSE
	fdup f2* to border
	0e to borderl fnegate f2* to bordert 0e to borderv
    THEN o o> ;
: add-dtms ( ticks -- )
    \sans \small blackish
    1n fm* >day { day } day last-day <> IF
	{{
	    x-color { f: xc }
	    glue*l day-color x-color slide-frame dup .button1
	    xc to x-color
	    \bold day ['] .day $tmp }}text 25%b \regular
	}}z /center msgs-box .child+
................................................................................
' re-log#-token is update-log

: new-msg-par ( -- )
    {{ }}p "msg-par" name!
    dup .subbox box[] drop box[] cbl >bl
    dup .subbox "msg-box" name!
    to msg-box to msg-par
    \sans \script cbl re-green log-mask @ +log#-date-token msg-box .child+
    \normal cbl ;
:noname { d: pk -- o }
    pk key| to msg:id$  pk startdate@ to msg:timestamp
    pk [: .simple-id ." : " ;] $tmp notify-nick!
    pk key| pkc over str= { me? }
    pk enddate@ otr? { otr }
    pk key| last-bubble-pk $@ str= otr last-otr? = and

Changes to qrscan.fs.

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
...
297
298
299
300
301
302
303














304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
...
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
\ replace some tools available under net2o

[IFUNDEF] qr(
    debug: qr(
    debug: health(
    debug: msg(
    +db qr( \ turn it on )
    +db msg( \ turn it on )
[THEN]

[IFUNDEF] xtype
    : hex[ ]] [: [[ ; immediate
    : ]hex ]] ;] $10 base-execute [[ ; immediate
    : xtype ( addr u -- )  hex[
	bounds ?DO  I c@ 0 <# # # #> type  LOOP  ]hex ;
................................................................................
p3 2 cells + Constant px

: min²! ( x y addr -- ) >r
    over dup * over dup * +
    r@ 2@ dup * swap dup * + u< IF
	r> 2!  EXIT
    THEN  2drop rdrop ;















: search-corners ( -- )
    init-xy p0 !  p0 p0 cell+ 7 cells cmove \ fill all with the same contents
    scan-buf0 $@ drop
    scan-w dup negate DO
	scan-w dup negate DO
	    dup rgb? dup 4 and IF  3 and 2 xor
		2* cells p0 + I J rot min²!
	    ELSE
		drop
	    THEN
	    rgba+
	LOOP
    LOOP  drop
    qr( msg( p0 2@ . . space p1 2@ . . space p2 2@ . . space p3 2@ . . cr ) )
;

: ?legit ( -- flag )
    p0 2@ init-xy dup d<>
    p1 2@ init-xy dup d<> and
................................................................................
	    THEN
	LOOP
    ELSE
	msg( ." not ?legit" cr  save-png0 1 +to scan# )
    THEN  false ;

: scan-its ( -- )
    85 80 DO
	I s>f to x-scansize
	85 80 DO
	    I s>f to y-scansize
	    scan-it IF  true
		UNLOOP UNLOOP
		EXIT  THEN
	2 +LOOP
    2 +LOOP  false ;








|







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>




|
|
<
<
<
<
<
|
|







 







|

|







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
...
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323





324
325
326
327
328
329
330
331
332
...
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
\ replace some tools available under net2o

[IFUNDEF] qr(
    debug: qr(
    debug: health(
    debug: msg(
    +db qr( \ turn it on )
    -db msg( \ turn it on )
[THEN]

[IFUNDEF] xtype
    : hex[ ]] [: [[ ; immediate
    : ]hex ]] ;] $10 base-execute [[ ; immediate
    : xtype ( addr u -- )  hex[
	bounds ?DO  I c@ 0 <# # # #> type  LOOP  ]hex ;
................................................................................
p3 2 cells + Constant px

: min²! ( x y addr -- ) >r
    over dup * over dup * +
    r@ 2@ dup * swap dup * + u< IF
	r> 2!  EXIT
    THEN  2drop rdrop ;

: rgb?-min ( addr x y -- addr ) 2>r
    dup rgb? dup 4 and IF
	over rgba+ rgb? over = IF
	    over scan-w 3 lshift + rgb? over = IF
		over rgba+ scan-w 3 lshift + rgb? over = IF
		    3 and 2 xor
		    2* cells p0 + 2r> rot min²!
		    EXIT
		THEN
	    THEN
	THEN
    THEN
    drop 2rdrop ;

: search-corners ( -- )
    init-xy p0 !  p0 p0 cell+ 7 cells cmove \ fill all with the same contents
    scan-buf0 $@ drop
    scan-w 1- dup invert DO
	scan-w 1- dup invert DO





	    i j rgb?-min rgba+
	LOOP  rgba+
    LOOP  drop
    qr( msg( p0 2@ . . space p1 2@ . . space p2 2@ . . space p3 2@ . . cr ) )
;

: ?legit ( -- flag )
    p0 2@ init-xy dup d<>
    p1 2@ init-xy dup d<> and
................................................................................
	    THEN
	LOOP
    ELSE
	msg( ." not ?legit" cr  save-png0 1 +to scan# )
    THEN  false ;

: scan-its ( -- )
    85 82 DO
	I s>f to x-scansize
	85 82 DO
	    I s>f to y-scansize
	    scan-it IF  true
		UNLOOP UNLOOP
		EXIT  THEN
	2 +LOOP
    2 +LOOP  false ;