<commit_before>
USING: kernel namespaces math quotations arrays hashtables sequences threads
       opengl
       opengl.gl
       colors
       ui
       ui.gestures
       ui.gadgets
       ui.gadgets.slate
       ui.gadgets.labels
       ui.gadgets.buttons
       ui.gadgets.frames
       ui.gadgets.packs
       ui.gadgets.grids
       ui.gadgets.theme
       ui.gadgets.handler
       accessors
       namespaces.lib assocs.lib vars
       rewrite-closures automata math.geometry.rect newfx ;

IN: automata.ui

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

: draw-point ( y x value -- ) 1 = [ swap glVertex2i ] [ 2drop ] if ;

: draw-line ( y line -- ) 0 swap [ >r 2dup r> draw-point 1+ ] each 2drop ;

: (draw-bitmap) ( bitmap -- ) 0 swap [ >r dup r> draw-line 1+ ] each drop ;

: draw-bitmap ( bitmap -- ) GL_POINTS glBegin (draw-bitmap) glEnd ;

: display ( -- ) black gl-color bitmap> draw-bitmap ;

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

VAR: slate

! Call a 'model' quotation with the current 'view'.

: with-view ( quot -- )
slate> rect-dim first >width
slate> rect-dim second >height
call
slate> relayout-1 ;

! Create a quotation that is appropriate for buttons and gesture handler.

: view-action ( quot -- quot ) [ drop [ ] with-view ] make* closed-quot ;
<commit_msg>automata.ui: Use color objects<commit_after>
USING: kernel namespaces math quotations arrays hashtables sequences threads
       opengl
       opengl.gl
       colors
       ui
       ui.gestures
       ui.gadgets
       ui.gadgets.slate
       ui.gadgets.labels
       ui.gadgets.buttons
       ui.gadgets.frames
       ui.gadgets.packs
       ui.gadgets.grids
       ui.gadgets.theme
       ui.gadgets.handler
       accessors
       namespaces.lib assocs.lib vars
       rewrite-closures automata math.geometry.rect newfx ;

IN: automata.ui

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

: draw-point ( y x value -- ) 1 = [ swap glVertex2i ] [ 2drop ] if ;

: draw-line ( y line -- ) 0 swap [ >r 2dup r> draw-point 1+ ] each 2drop ;

: (draw-bitmap) ( bitmap -- ) 0 swap [ >r dup r> draw-line 1+ ] each drop ;

: draw-bitmap ( bitmap -- ) GL_POINTS glBegin (draw-bitmap) glEnd ;

: display ( -- ) black set-color bitmap> draw-bitmap ;

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

VAR: slate

! Call a 'model' quotation with the current 'view'.

: with-view ( quot -- )
slate> rect-dim first >width
slate> rect-dim second >height
call
slate> relayout-1 ;

! Create a quotation that is appropriate for buttons and gesture handler.

: view-action ( quot -- quot ) [ drop [ ] with-view ] make* closed-quot ;

{'fraction_non_alphanumeric': 0.19985250737463126, 'fraction_numerical': 0.007374631268436578, 'mean_word_length': 2.7215363511659807, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3799755', 'n_tokens_mistral': 918, 'n_tokens_neox': 867, 'n_words': 239}