]> gitweb.factorcode.org Git - factor.git/commitdiff
Update USING:
authorDave Carlton <davec@mac.com>
Sat, 17 Sep 2022 12:06:04 +0000 (07:06 -0500)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 19 Sep 2022 21:54:45 +0000 (14:54 -0700)
Changes to get USE: skov to compile

32 files changed:
extra/skov/basis/classes/parser/parser.factor
extra/skov/basis/code/code.factor
extra/skov/basis/code/execution/execution.factor
extra/skov/basis/code/factor-abstraction/factor-abstraction.factor
extra/skov/basis/code/import-export/import-export.factor
extra/skov/basis/fonts/authors.txt [deleted file]
extra/skov/basis/fonts/fonts-docs.factor [deleted file]
extra/skov/basis/fonts/fonts.factor
extra/skov/basis/fonts/summary.txt [deleted file]
extra/skov/basis/fonts/tags.txt [deleted file]
extra/skov/basis/help/help-docs.factor
extra/skov/basis/help/help.factor
extra/skov/basis/help/markup/markup.factor
extra/skov/basis/math/constants/constants.factor
extra/skov/basis/ui/commands/commands.factor
extra/skov/basis/ui/gadgets/buttons/activate/activate.factor
extra/skov/basis/ui/gadgets/buttons/round/round.factor
extra/skov/basis/ui/gadgets/pens/gradient-rounded/gradient-rounded.factor
extra/skov/basis/ui/gadgets/pens/title-gradient/title-gradient.factor
extra/skov/basis/ui/gadgets/sliders/sliders.factor
extra/skov/basis/ui/images/images.factor
extra/skov/basis/ui/pens/gradient-rounded/gradient-rounded.factor
extra/skov/basis/ui/pens/image/image.factor
extra/skov/basis/ui/pens/title-gradient/title-gradient.factor [new file with mode: 0755]
extra/skov/basis/ui/tools/browser/browser.factor
extra/skov/basis/ui/tools/environment/cell/cell.factor
extra/skov/basis/ui/tools/environment/environment.factor
extra/skov/basis/ui/tools/environment/navigation/dot-pattern/dot-pattern.factor
extra/skov/basis/ui/tools/environment/navigation/navigation.factor
extra/skov/basis/ui/tools/environment/theme/theme.factor
extra/skov/basis/ui/tools/environment/tree/tree.factor
extra/skov/skov.factor

index 99e44e9a5de439dd5e3c7e62dc7e7df2fd22884b..5ebaa78fe593159d245e30970489acc3c59bff75 100644 (file)
@@ -1,5 +1,5 @@
 USING: classes kernel parser words ;
-IN: classes.parser
+IN: skov.basis.classes.parser
 
 : create-class ( string vocab -- word )
     create-word dup t "defining-class" set-word-prop
index d2148862ccb3e0c2aac919a1f62dea772ad6d96f..6746546dd5900e63e134164bdba651fd5756e769 100644 (file)
@@ -8,7 +8,7 @@ sequences.deep sequences.extras sets splitting strings
 ui.gadgets vectors vocabs.parser definitions ;
 QUALIFIED: vocabs
 QUALIFIED: words
-IN: code
+IN: skov.basis.code
 
 TUPLE: element < identity-tuple  name parent contents default-name target ;
 
index 33176782c0248da2e1b97696f8d95864b2cca8ba..a937b6f12165fa24c8ee84df0c6a6b3b25dd4fd4 100644 (file)
@@ -1,15 +1,16 @@
 ! Copyright (C) 2015-2016 Nicolas Pénet.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs classes.parser classes.tuple code
+USING: accessors arrays assocs classes.parser classes.tuple 
 combinators combinators.smart compiler.units debugger effects io
 io.streams.string kernel listener locals locals.rewrite
 locals.types math math.statistics namespaces quotations
-sequences sequences.deep sets splitting ui.gadgets.panes
-vocabs.parser ;
-FROM: code => call ;
+sequences sequences.deep sets skov.basis.code splitting
+ui.gadgets.panes vocabs.parser ;
+
+FROM: skov.basis.code => call ;
 QUALIFIED: words
 QUALIFIED: vocabs
-IN: code.execution
+IN: skov.basis.code.execution
 
 : effect ( def -- effect )
     [ introduces [ name>> empty? ] reject ] [ returns ] bi
index 49c4dc0c96b3bfbb948a7b022febecebbda98b92..3c13e60d29c1cbfbb08097ff4c5c87c8a2ceed9c 100644 (file)
@@ -4,7 +4,7 @@ USING: accessors code combinators combinators.smart effects
 kernel locals math math.parser quotations sequences splitting
 stack-checker strings vectors words ;
 FROM: code => call word ;
-IN: code.factor-abstraction
+IN: skov.basis.code.factor-abstraction
 
 :: call-from-factor ( factor-word -- call )
     call new factor-word name>> >>name factor-word >>target ;
index f6cef8d3d56fbced81b70cbf56e2db0d94c51187..ebfabf28f0c327c3d9a04f2d340af514d7454141 100644 (file)
@@ -1,11 +1,12 @@
 ! Copyright (C) 2016 Nicolas Pénet.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays classes combinators combinators.smart
-eval io io.directories io.encodings.utf8 io.files io.files.info
-io.pathnames kernel locals math namespaces prettyprint prettyprint.config
-sequences code system ui.gadgets code.execution ;
-FROM: code => call ;
-IN: code.import-export
+USING: accessors arrays classes combinators
+combinators.smart eval io io.directories io.encodings.utf8
+io.files io.files.info io.pathnames kernel locals math
+namespaces prettyprint prettyprint.config sequences
+skov.basis.code skov.basis.code.execution system ui.gadgets ;
+FROM: skov.basis.code => call ;
+IN: skov.basis.code.import-export
 
 SYMBOL: skov-version
 
diff --git a/extra/skov/basis/fonts/authors.txt b/extra/skov/basis/fonts/authors.txt
deleted file mode 100644 (file)
index 1901f27..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
diff --git a/extra/skov/basis/fonts/fonts-docs.factor b/extra/skov/basis/fonts/fonts-docs.factor
deleted file mode 100644 (file)
index 3b30713..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-! Copyright (C) 2009 Slava Pestov
-! See http://factorcode.org/license.txt for BSD license.
-USING: help.markup help.syntax kernel colors ;
-IN: fonts
-
-HELP: <font>
-{ $values { "font" font } }
-{ $description "Creates a new font." } ;
-
-HELP: font
-{ $class-description "The class of fonts." } ;
-
-HELP: font-with-background
-{ $values
-     { "font" font } { "color" color }
-     { "font'" font }
-}
-{ $description "Creates a new font equal to the given font, except with a different " { $slot "background" } " slot." } ;
-
-HELP: font-with-foreground
-{ $values
-     { "font" font } { "color" color }
-     { "font'" font }
-}
-{ $description "Creates a new font equal to the given font, except with a different " { $slot "foreground" } " slot." } ;
-
-ARTICLE: "fonts" "Fonts"
-"The " { $vocab-link "fonts" } " vocabulary implements a data type for fonts that other vocabularies, for example " { $link "ui" } ", can use. A font combines a font name, size, style, and color information into a single object."
-{ $subsections
-    font
-    <font>
-}
-"Modifying fonts:"
-{ $subsections
-    font-with-foreground
-    font-with-background
-}
-"Useful constants:"
-{ $subsections
-    monospace-font
-    sans-serif-font
-    serif-font
-}
-"A data type for font metrics. The " { $vocab-link "fonts" } " vocabulary does not provide any means of computing font metrics, it simply defines a common data type that other vocabularies, such as " { $vocab-link "ui.text" } " may use:"
-{ $subsections metrics } ;
-
-ABOUT: "fonts"
index 794637775f5bb6564039a560ab31acc347d2e361..28cbb2b07a2c7ab3f297dc292164aa39544d43cd 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors colors combinators kernel math namespaces ;
-IN: fonts
+IN: skov.basis.fonts
 
 CONSTANT: default-serif-font-name "serif"
 CONSTANT: default-sans-serif-font-name "Linux Biolinum O" inline
diff --git a/extra/skov/basis/fonts/summary.txt b/extra/skov/basis/fonts/summary.txt
deleted file mode 100644 (file)
index c2cf825..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Fonts as a first-class data type
diff --git a/extra/skov/basis/fonts/tags.txt b/extra/skov/basis/fonts/tags.txt
deleted file mode 100644 (file)
index 00550c5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-fonts
index 75b2cf5e23ca0e2f378ba3157603c377bd4255c1..ee3074560c534c8be83d960a9675f1513ff00ead 100644 (file)
@@ -1,7 +1,7 @@
 USING: arrays help.crossref help.lint help.markup
 help.stylesheet help.syntax help.topics io kernel math
 prettyprint quotations see sequences strings summary vocabs ;
-IN: help
+IN: skov.basis.help
 
 ARTICLE: "printing-elements" "Printing markup elements"
 "When writing documentation, it is useful to be able to print markup elements for testing purposes. Markup elements which are strings or arrays of elements are printed in the obvious way. Markup elements of the form " { $snippet "{ $directive content... }" } " are printed by executing the " { $snippet "$directive" } " word with the element content on the stack."
index 4cd1b0cbefa88520b48564d461dae6741c2e4c56..a0e754e05cf1686574da60d9837f6151dd8da9fb 100644 (file)
@@ -5,7 +5,7 @@ combinators.short-circuit continuations debugger effects fry
 generic help.crossref help.markup help.stylesheet help.topics io
 io.styles kernel make namespaces prettyprint sequences sets
 sorting vocabs words words.alias words.symbol ;
-IN: help
+IN: skov.basis.help
 
 GENERIC: word-help* ( word -- content )
 
index c17d3f9573ef731869dc15cc89af27f2a4d95b3a..b940f7e98ae620f12f78aa23557700ecfece3c1b 100644 (file)
@@ -7,7 +7,7 @@ prettyprint.stylesheet quotations see sequences
 sequences.private sets sorting splitting strings urls vocabs
 words words.symbol ; 
 FROM: prettyprint.sections => with-pprint ;
-IN: help.markup
+IN: skov.basis.help.markup
 
 PREDICATE: simple-element < array
     [ t ] [ first word? not ] if-empty ;
index a204cb09f4becd091b6f775d7ee96f4ce93f2422..2a45d2b770b78779bfe95c7300132fe1cd9a8e36 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2004, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USE: math
-IN: math.constants
+IN: skov.basis.math.constants
 
 : e ( -- e ) 2.7182818284590452354 ; inline
 : euler ( -- gamma ) 0.57721566490153286060 ; inline
index b9caee8e7a2929d56f12b28554b5646680ef6da2..73b5f1fb85d99ac521d90ba2949f2a4712d2ed51 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs help.markup kernel make quotations
 sequences splitting tr ui.gestures unicode words ;
-IN: ui.commands
+IN: skov.basis.ui.commands
 
 SYMBOL: +nullary+
 SYMBOL: +listener+
index 82fe5559aad1310b7131be966fdaeb175ee60bb8..37bfef803cca5396826ec0c2ce1224dd0a523665 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2016 Nicolas Pénet.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors code.execution combinators.smart help.topics
-kernel locals models ui.gadgets ui.gadgets.buttons.round
-ui.gadgets.packs ui.tools.environment.theme vocabs words ;
-IN: ui.gadgets.buttons.activate
+USING: accessors skov.basis.code.execution combinators.smart help.topics
+kernel locals models ui.gadgets skov.basis.ui.gadgets.buttons.round
+ui.gadgets.packs skov.basis.ui.tools.environment.theme vocabs words ;
+IN: skov.basis.ui.gadgets.buttons.activate
 
 : vocab/word? ( obj -- ? )
     [ vocab? ] [ [ link? ] [ name>> word? ] [ drop f ] smart-if ] bi or ;
index bae038e30f2c3e7c3f7676be8846b96229c0f98b..8cea11aebded1c5b979e4564d353f83e84863b6e 100644 (file)
@@ -2,8 +2,9 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays colors colors.gray kernel locals math
 math.order sequences ui.gadgets ui.gadgets.buttons combinators.smart
-ui.pens.gradient-rounded ui.tools.environment.theme ;
-IN: ui.gadgets.buttons.round
+skov.basis.ui.pens.gradient-rounded
+skov.basis.ui.tools.environment.theme ;
+IN: skov.basis.ui.gadgets.buttons.round
 
 TUPLE: round-button < button ;
 
index 0a77432376eaf2c36a7c8a174c2d5453e9d2ba14..175493ff77d4e9d433aaa3f8356af0f769a69e07 100755 (executable)
@@ -2,8 +2,8 @@ USING: accessors arrays assocs colors combinators
 combinators.short-circuit combinators.smart kernel locals math
 math.functions math.order math.ranges math.vectors opengl.gl
 sequences ui.gadgets ui.gadgets.packs ui.pens ui.pens.caching
-ui.pens.gradient system ;
-IN: ui.pens.gradient-rounded
+skov.basis.ui.pens.gradient system ;
+IN: skov.basis.ui.pens.gradient-rounded
 
 TUPLE: gradient-shape < caching-pen  colors foreground shape last-vertices last-colors ;
 TUPLE: gradient-squircle < gradient-shape ;
index 0c14173d7dbb4687907028c040b051949ec718f9..f3bd497803574eba8c19b1ef9ec643ed5425cde8 100755 (executable)
@@ -1,6 +1,6 @@
 USING: accessors colors kernel locals math opengl opengl.gl
-sequences ui.pens ui.tools.environment.theme system ;
-IN: ui.pens.title-gradient
+sequences ui.pens skov.basis.ui.tools.environment.theme system ;
+IN: skov.basis.ui.pens.title-gradient
 
 TUPLE: title-gradient  colors foreground selected? ;
 
index a67a54e6ec3930634f68d680e004ea179afa16e7..988291b9a9431f3fdd92613528f32274740c770a 100644 (file)
@@ -4,7 +4,7 @@ USING: accessors assocs combinators fry kernel math math.order
 math.vectors models models.range ui.gadgets ui.gadgets.buttons
 ui.gadgets.icons ui.gadgets.tracks ui.gestures ui.pens
 ui.pens.image ui.pens.tile ui.theme.images ;
-IN: ui.gadgets.sliders
+IN: skov.basis.ui.gadgets.sliders
 
 TUPLE: slider < track elevator thumb saved line ;
 
index 5da8db80cdbe849bd22dee2ad5d213a903ea365a..6040d12d76788afeaf88c09cee50f78b8a938214 100644 (file)
@@ -3,7 +3,7 @@
 USING: accessors assocs cache combinators images images.loader
 kernel math namespaces opengl opengl.textures sequences
 splitting system ui.gadgets.worlds vocabs math.vectors colors ;
-IN: ui.images
+IN: skov.basis.ui.images
 
 TUPLE: image-name path ;
 
index e57dc65c503023f4f2153c1f090bba68f46882d5..c50fe42b524bc6589c34e03efbfa216a55bdf7b2 100755 (executable)
@@ -3,7 +3,7 @@ combinators.short-circuit combinators.smart kernel locals math
 math.functions math.order ranges math.vectors opengl.gl
 sequences ui.gadgets ui.gadgets.packs ui.pens ui.pens.caching
 ui.pens.gradient system ;
-IN: ui.pens.gradient-rounded
+IN: skov.basis.ui.pens.gradient-rounded
 
 TUPLE: gradient-shape < caching-pen  colors foreground shape last-vertices last-colors ;
 TUPLE: gradient-squircle < gradient-shape ;
index 87cdea8702653ae88f70e1a50aed6d902ab5d2ce..138a0726009be51a32245a37dc85047d771b330e 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors kernel math opengl sequences ui.images ui.pens colors ;
-IN: ui.pens.image
+IN: skov.basis.ui.pens.image
 
 ! Image pen
 TUPLE: image-pen image fill? ;
diff --git a/extra/skov/basis/ui/pens/title-gradient/title-gradient.factor b/extra/skov/basis/ui/pens/title-gradient/title-gradient.factor
new file mode 100755 (executable)
index 0000000..0749447
--- /dev/null
@@ -0,0 +1,56 @@
+USING: accessors colors kernel math opengl opengl.gl sequences
+skov.basis.ui.tools.environment.theme ui.pens ;
+IN: skov.basis.ui.pens.title-gradient
+
+TUPLE: title-gradient  colors foreground selected? ;
+
+: <title-gradient> ( colors foreground selected? -- gradient )
+    title-gradient new swap >>selected? swap >>foreground swap >>colors ;
+
+:: draw-gradient ( dim gradient -- )
+    GL_QUADS glBegin
+        gradient first >rgba-components glColor4f
+        0.0 0.0 glVertex2f
+        dim first 0.0 glVertex2f
+        gradient second >rgba-components glColor4f
+        dim first2 glVertex2f
+        0.0 dim second glVertex2f
+    glEnd ;
+
+:: draw-underline ( dim gradient -- )
+    1 gl-scale glLineWidth
+    GL_LINES glBegin
+        gradient first >rgba-components glColor4f
+        0.0 dim second glVertex2f
+        dim first2 glVertex2f
+    glEnd ;
+    
+CONSTANT: shadow-width 20.0
+
+:: draw-shadows ( dim -- )
+    GL_QUADS glBegin
+        content-background-colour >rgba-components glColor4f
+        0.0 0.0 glVertex2f
+        0.0 dim second 1 + glVertex2f
+        content-background-colour >rgba-components drop 0.0 glColor4f
+        shadow-width dim second 1 + glVertex2f
+        shadow-width 0.0 glVertex2f
+        content-background-colour >rgba-components glColor4f
+        dim first 0.0 glVertex2f
+        dim first dim second 1 + glVertex2f
+        content-background-colour >rgba-components drop 0.0 glColor4f
+        dim first shadow-width - dim second 1 + glVertex2f
+        dim first shadow-width - 0.0 glVertex2f
+    glEnd ;
+
+: draw-title ( dim gradient -- )
+    [ draw-gradient ] [ draw-underline ] [ drop draw-shadows ] 2tri ;
+
+M: title-gradient draw-interior
+    [ dim>> ] dip colors>> draw-title ;
+
+M: title-gradient pen-background
+     2drop transparent ;
+
+M: title-gradient pen-foreground
+    nip foreground>> ;
index 98da30ccec37417ec42d129ce9e355c971e5ef0b..201b9a1e1cf830f550337fb589fabee21a41ce8d 100644 (file)
@@ -10,8 +10,8 @@ ui.gadgets.glass ui.gadgets.panes ui.gadgets.scrollers
 ui.gadgets.status-bar ui.gadgets.toolbar ui.gadgets.tracks
 ui.gadgets.viewports ui.gadgets.worlds ui.gestures ui.pens.solid
 ui.theme ui.tools.browser.history ui.tools.browser.popups
-ui.tools.common unicode vocabs ui.gadgets.buttons.activate ;
-IN: ui.tools.browser
+ui.tools.common unicode vocabs skov.basis.ui.gadgets.buttons.activate ;
+IN: skov.basis.ui.tools.browser
 
 TUPLE: browser-gadget < tool history scroller search-field popup ;
 
index 7ab5789868efbd2cd3aa8576183d5fa554a37cca..35bd30a8911c46cad43411118b24899fb7bd2a6e 100644 (file)
@@ -1,19 +1,16 @@
 ! Copyright (C) 2015-2017 Nicolas Pénet.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays code code.execution colors 
-combinators combinators.short-circuit combinators.smart fry
-kernel listener locals locals math math.order math.statistics
-math.vectors models namespaces sequences splitting system
-ui.commands ui.gadgets ui.gadgets.borders
-ui.gadgets.buttons.round ui.gadgets.editors
-ui.gadgets.editors.private ui.gadgets.frames ui.gadgets.grids
-ui.gadgets.labels ui.gadgets.packs ui.gadgets.worlds ui.gestures
-ui.pens.gradient-rounded ui.pens.solid ui.pens.tile
-ui.pens.title-gradient ui.render ui.text ui.tools.browser
-ui.tools.environment.theme ;
-FROM: code => call ;
+USING: accessors arrays colors combinators combinators.short-circuit
+combinators.smart kernel listener math models sequences
+skov.basis.code skov.basis.code.execution
+skov.basis.ui.gadgets.buttons.round
+skov.basis.ui.pens.gradient-rounded skov.basis.ui.pens.title-gradient
+skov.basis.ui.tools.browser skov.basis.ui.tools.environment.theme
+ui.commands ui.gadgets ui.gadgets.borders ui.gadgets.editors
+ui.gadgets.labels ui.gadgets.packs ui.gestures ;
+FROM: skov.basis.code => call ;
 FROM: models => change-model ;
-IN: ui.tools.environment.cell
+IN: skov.basis.ui.tools.environment.cell
 
 CONSTANT: cell-height 24
 CONSTANT: min-cell-width 30
index 8f9f7001640e082522522bbd9108d6d22c448fbf..1a19c61853f162e89c6ff46de09e485b6c0bdd2c 100644 (file)
@@ -1,11 +1,14 @@
 ! Copyright (C) 2015-2017 Nicolas Pénet.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors kernel memory models namespaces ui ui.gadgets
+USING: accessors kernel memory models namespaces skov.basis.code
+skov.basis.code.import-export skov.basis.ui.tools.browser
+skov.basis.ui.tools.environment.navigation
+skov.basis.ui.tools.environment.theme ui ui.gadgets
 ui.gadgets.scrollers ui.gadgets.status-bar ui.gadgets.tracks
-ui.gadgets.worlds ui.gestures ui.pixel-formats ui.tools.browser
-ui.tools.common ;
+ui.gadgets.worlds ui.gestures ui.pixel-formats ui.tools.common ;
+
 FROM: models => change-model ;
-IN: ui.tools.environment
+IN: skov.basis.ui.tools.environment
 
 TUPLE: environment < tool ;
 
index 5a1a415a4e66e970d9ca6d043711493b0c63bbb9..ca761f8e94fc1f1d5163c21469f5fb7614a562fb 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2015-2017 Nicolas Pénet.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: arrays accessors colors kernel locals math math.constants
-math.functions opengl.gl sequences ui.gadgets system
-ui.render ui.tools.environment.theme ;
-IN: ui.tools.environment.navigation.dot-pattern
+USING: accessors arrays colors kernel math math.functions opengl.gl
+sequences skov.basis.ui.pens.gradient-rounded.private
+skov.basis.ui.tools.environment.theme system ui.gadgets ui.render ;
+IN: skov.basis.ui.tools.environment.navigation.dot-pattern
 
 TUPLE: dot-pattern < gadget ;
 
index 999933738e77993b30e1d92915d7af29c0b221ec..63a6a05398a12e07eed27d01ea71b1b623fc081b 100644 (file)
@@ -1,15 +1,15 @@
 ! Copyright (C) 2015-2017 Nicolas Pénet.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors code code.execution colors combinators
-combinators.smart kernel locals models sequences system
-ui.gadgets ui.gadgets.borders ui.gadgets.buttons
-ui.gadgets.buttons.round ui.gadgets.icons ui.gadgets.labels
-ui.gadgets.packs ui.gestures ui.pens.gradient-rounded
-ui.pens.tile ui.tools.environment.cell ui.tools.environment.tree 
-ui.tools.environment.navigation.dot-pattern
-ui.tools.environment.theme ui.tools.environment ;
+USING: accessors combinators combinators.smart kernel models sequences
+skov.basis.code skov.basis.code.execution
+skov.basis.ui.pens.gradient-rounded
+skov.basis.ui.tools.environment.cell
+skov.basis.ui.tools.environment.navigation.dot-pattern
+skov.basis.ui.tools.environment.theme
+skov.basis.ui.tools.environment.tree ui.gadgets ui.gadgets.borders
+ui.gadgets.labels ui.gadgets.packs ui.gestures ;
 FROM: models => change-model ;
-IN: ui.tools.environment.navigation
+IN: skov.basis.ui.tools.environment.navigation
 
 TUPLE: navigation < pack ;
 
index a13d19ac031da91876553ba842bb7f042b04b7eb..f29d5413e9545682a7224eadd8b2af5e29bc4681 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs colors kernel math math.parser sequences
 sorting sorting.human ui.pens.solid ;
-IN: ui.tools.environment.theme
+IN: skov.basis.ui.tools.environment.theme
 
 CONSTANT: content-background-colour COLOR: #002b36
 
index 0eb94e0934f04225cf578efc23839e86d97d9ac6..5d91dc904c8efb841ea24fc785c71f0675588c5d 100644 (file)
@@ -1,14 +1,17 @@
 ! Copyright (C) 2015-2017 Nicolas Pénet.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays code combinators.short-circuit kernel
-locals math math.order math.vectors models sequences splitting
-ui.gadgets ui.gadgets.borders ui.gadgets.buttons.round
-ui.gadgets.labels ui.gadgets.packs ui.gadgets.packs.private
-ui.gestures ui.pens.gradient-rounded ui.pens.solid
-ui.tools.environment.cell ui.tools.environment.tree ui.tools.environment.theme ;
-FROM: code => call ;
+USING: accessors arrays skov.basis.code combinators.short-circuit kernel
+locals math math.order math.vectors models sequences
+skov.basis.ui.tools.environment.cell
+skov.basis.ui.tools.environment.theme
+skov.basis.ui.tools.environment.tree splitting ui.gadgets
+ui.gadgets.borders skov.basis.ui.gadgets.buttons.round ui.gadgets.labels
+ui.gadgets.packs ui.gadgets.packs.private ui.gestures
+skov.basis.ui.pens.gradient-rounded ui.pens.solid
+skov.basis.ui.tools.environment.theme ;
+FROM: skov.basis.code => call ;
 FROM: models => change-model ;
-IN: ui.tools.environment.tree
+IN: skov.basis.ui.tools.environment.tree
 
 TUPLE: tree < pack ;
 TUPLE: tree-control < pack ;
index 3a499c84e69fd7552bb49c0f9486681f7a48b941..04eaf1f23ab9299332dd0170afd514d78abee4ea 100644 (file)
 ! Description: Code for skov
 ! Copyright (C) 2016 Nicolas Pénet.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: combinators.smart help.topics
-kernel locals models ui.gadgets 
-ui.gadgets.packs vocabs words
-skov.basis.code.execution
-skov.basis.ui.tools.environment ;
-IN: ui.gadgets.buttons.activate
+USING: accessors arrays assocs colors colors.gray combinators
+combinators.short-circuit combinators.smart help.topics kernel math
+math.functions math.order math.vectors models models.range opengl
+opengl.gl sequences skov.basis.code.execution
+skov.basis.ui.gadgets.buttons.round
+skov.basis.ui.pens.gradient-rounded
+skov.basis.ui.tools.environment.theme ui.gadgets ui.gadgets.buttons
+ui.gadgets.packs ui.pens ui.pens.caching vocabs words ;
+IN: skov
 
-: vocab/word? ( obj -- ? )
-    [ vocab? ] [ [ link? ] [ name>> word? ] [ drop f ] smart-if ] bi or ;
-
-: vocab-name ( obj -- str )
-    name>> [ word? ] [ vocabulary>> ] smart-when ;
-
-:: <activate-button> ( model -- gadget )
-    model value>> vocab-name :> name
-    name interactive?
-    [ blue-background "Active"
-      [ drop name remove-interactive-vocab model notify-connections ]
-      <round-button> "Deactivate this vocabulary" >>tooltip ]
-    [ dark-background "Inactive"
-      [ drop name add-interactive-vocab model notify-connections ]
-      <round-button> "Activate this vocabulary" >>tooltip ] if ;
-
-TUPLE: active/inactive < pack ;
-
-: <active/inactive> ( model -- gadget )
-    active/inactive new swap >>model ;
-
-M: active/inactive model-changed
-    dup clear-gadget swap
-    [ value>> vocab/word? ] [ <activate-button> add-gadget ] smart-when* drop ;
-
-IN: ui.gadgets.buttons.round
-
-TUPLE: round-button < button ;
-
-M: round-button pref-dim*
-    gadget-child [ text>> length 1 > ]
-    [ pref-dim first2 [ 15 + ] dip [ 20 max ] bi@ 2array ]
-    [ { 20 20 } ] smart-if* ;
-
-:: <round-button> ( colors label quot -- button )
-    label quot round-button new-button
-    colors dup first >gray gray>> 0.5 < light-text-colour dark-text-colour ?
-    <gradient-squircle> >>interior
-    dup gadget-child
-    [ t >>bold? 13 >>size transparent >>background ] change-font drop ;
-
-IN: ui.pens.gradient-rounded
-
-TUPLE: gradient-shape < caching-pen  colors foreground shape last-vertices last-colors ;
-TUPLE: gradient-squircle < gradient-shape ;
-TUPLE: gradient-arrow < gradient-shape ;
-TUPLE: gradient-pointy < gradient-shape ;
-TUPLE: gradient-dynamic-shape < gradient-shape  selected? ;
-
-: <gradient-squircle> ( colors foreground -- gradient )
-    gradient-squircle new swap >>foreground swap >>colors ;
-
-: <gradient-arrow> ( colors foreground -- gradient )
-    gradient-arrow new swap >>foreground swap >>colors ;
-
-: <gradient-pointy> ( colors foreground -- gradient )
-    gradient-pointy new swap >>foreground swap >>colors ;
-
-: <gradient-dynamic-shape> ( colors foreground selected? -- gradient )
-    gradient-dynamic-shape new swap >>selected? swap >>foreground swap >>colors ;
-
-<PRIVATE
-
-CONSTANT: tau 6.283185307179586
-CONSTANT: points 100
-
-: squircle-point ( theta -- xy )
-    [ cos ] [ sin ] bi [ [ abs sqrt ] [ sgn ] bi * 0.5 * 0.5 + ] bi@ 2array ;
-
-:: tan-point ( y slope -- xy )
-    y tau * 4 / tan 300 / 0.5 min y slope / + y 2array ;
-
-:: squircle ( -- seq )
-    1/4 tau * 3/4 tau * 1/2 tau * points / <range> [ squircle-point ] map ;
-
-:: arrow ( -- seq )
-    { { -0.25 1 } { 0 0.5 } { -0.25 0 } } ;
-
-:: wide-narrow ( slope -- seq )
-    0.0 1.0 1 points / <range> [ slope tan-point ] map reverse ;
-
-: narrow-wide ( slope -- seq )
-    wide-narrow unzip [ reverse ] dip zip ;
-
-:: wide-narrow-wide ( slope -- seq )
-    slope wide-narrow unzip drop slope narrow-wide unzip [ [ min ] 2map ] dip zip ;
-
-:: narrow-wide-narrow ( slope -- seq )
-    slope wide-narrow unzip drop slope narrow-wide unzip [ [ max ] 2map ] dip zip ;
-
-:: vertices ( dim left-shape right-shape symmetric? -- seq )
-    dim first2 :> ( x y )
-    left-shape right-shape [ call( -- seq ) [ y v*n ] map ] bi@
-    reverse symmetric? [ [ first2 [ neg ] dip 2array ] map ] unless
-    [ first2 swap x swap - swap 2array ] map append
-    x 2 / y 2 / 2array prefix dup second suffix ;
-
-:: interp-color ( x colors -- seq )
-    colors [ >rgba-components 4array ] map first2 zip [ first2 dupd - x * - ] map ;
-
-:: vertices-colors ( dim seq colors -- seq )
-    seq [ second dim second / colors interp-color ] map ;
-
-: draw-triangle-fan ( vertices colors -- )
-    GL_TRIANGLE_FAN glBegin
-    [ first3 glColor3f first2 glVertex2f ] 2each
-    glEnd ;
-
-:: gradient-start ( edge center -- s )
-    center first2 :> ( xc yc )
-    edge first2 :> ( xe ye )
-    8 xe xc - sq ye yc - sq + sqrt / :> alpha
-    xe xe xc - alpha * -
-    ye ye yc - alpha * - 8 max 16 min 2array ;
-
-: draw-triangle-fan-selected ( vertices -- )
-    unclip dupd [ gradient-start ] curry map
-    GL_TRIANGLE_STRIP glBegin
-    [ 1.0 1.0 1.0 0.0 glColor4f first2 glVertex2f
-      1.0 1.0 1.0 0.6 glColor4f first2 glVertex2f ] 2each
-    glEnd ;
-
-: left ( gadget -- dim )  screen-loc first ;
-: right ( gadget -- dim )  [ screen-loc first ] [ dim>> first ] bi + ;
-
-: default-value ( side -- x )
-    \ left = 10000 0 ? ;
-
-: compare ( x y side -- ? )
-    \ left = [ 3 - < ] [ 3 + > ] if ;
-
-:: above ( gadget side -- dim )
-    gadget parent>> gadget-child children>> [ empty? not ]
-    [ side \ left = [ first ] [ last ] if children>> second side execute( x -- x ) ]
-    [ side default-value ] smart-if* ;
-
-:: below ( gadget side -- dim )
-    gadget parent>> parent>>
-    [ dup parent>> children>> { [ length 1 > nip ] [ second = not ] } 2&& ]
-    [ parent>> children>> second side execute( x -- x ) ]
-    [ side default-value ] smart-if* ;
-
-:: above-wider? ( gadget side -- ? )
-    gadget [ side above ] [ side execute( x -- x ) ] bi side compare ;
-
-:: below-wider? ( gadget side -- ? )
-    gadget [ side below ] [ side execute( x -- x ) ] bi side compare ;
-
-:: find-half-shape ( gadget side -- shape )  {
-        { [ gadget left 10 < ] [ [ squircle ] ] }
-        { [ gadget side above-wider? gadget side below-wider? and ] [ [ 6 wide-narrow-wide ] ] }
-        { [ gadget side above-wider? gadget side below-wider? not and ] [ [ 6 wide-narrow ] ] }
-        { [ gadget side above-wider? not gadget side below-wider? and ] [ [ 6 narrow-wide ] ] }
-        { [ gadget side above-wider? not gadget side below-wider? not and ] [ [ 6 narrow-wide-narrow ] ] }
-    } cond ;
-
-: find-shape ( gadget -- left-shape right-shape )
-    [ \ left find-half-shape ] [ \ right find-half-shape ] bi ;
-
-:: (recompute-pen) ( gadget gradient left-shape right-shape symmetric? -- )
-    gadget dim>> dup left-shape right-shape symmetric? vertices dup gradient last-vertices<<
-    gradient colors>> vertices-colors gradient last-colors<< ;
-
-M: gradient-squircle recompute-pen ( gadget gradient -- )
-    [ squircle ] dup t (recompute-pen) ;
-
-M: gradient-arrow recompute-pen ( gadget gradient -- )
-    [ arrow ] dup f (recompute-pen) ;
-
-M: gradient-pointy recompute-pen ( gadget gradient -- )
-    [ 1.5 narrow-wide-narrow ] dup t (recompute-pen) ;
-
-M:: gradient-dynamic-shape recompute-pen ( gadget gradient -- )
-    gadget gradient gadget find-shape t (recompute-pen) ;
-
-PRIVATE>
-
-M: gradient-shape draw-interior
-    [ compute-pen ]
-    [ last-vertices>> ]
-    [ last-colors>> draw-triangle-fan ] tri ;
-
-M: gradient-shape pen-background
-     2drop transparent ;
-
-M: gradient-shape pen-foreground
-    nip foreground>> ;
-
-M: gradient-dynamic-shape draw-interior
-    [ call-next-method ]
-    [ selected?>> ]
-    [ last-vertices>> ] tri
-    [ draw-triangle-fan-selected ] curry when ;
-
-IN: ui.pens.title-gradient
-
-TUPLE: title-gradient  colors foreground selected? ;
-
-: <title-gradient> ( colors foreground selected? -- gradient )
-    title-gradient new swap >>selected? swap >>foreground swap >>colors ;
-
-:: draw-gradient ( dim gradient -- )
-    GL_QUADS glBegin
-        gradient first >rgba-components glColor4f
-        0.0 0.0 glVertex2f
-        dim first 0.0 glVertex2f
-        gradient second >rgba-components glColor4f
-        dim first2 glVertex2f
-        0.0 dim second glVertex2f
-    glEnd ;
-
-:: draw-underline ( dim gradient -- )
-    1 gl-scale glLineWidth
-    GL_LINES glBegin
-        gradient first >rgba-components glColor4f
-        0.0 dim second glVertex2f
-        dim first2 glVertex2f
-    glEnd ;
-    
-CONSTANT: shadow-width 20.0
-
-:: draw-shadows ( dim -- )
-    GL_QUADS glBegin
-        content-background-colour >rgba-components glColor4f
-        0.0 0.0 glVertex2f
-        0.0 dim second 1 + glVertex2f
-        content-background-colour >rgba-components drop 0.0 glColor4f
-        shadow-width dim second 1 + glVertex2f
-        shadow-width 0.0 glVertex2f
-        content-background-colour >rgba-components glColor4f
-        dim first 0.0 glVertex2f
-        dim first dim second 1 + glVertex2f
-        content-background-colour >rgba-components drop 0.0 glColor4f
-        dim first shadow-width - dim second 1 + glVertex2f
-        dim first shadow-width - 0.0 glVertex2f
-    glEnd ;
-
-: draw-title ( dim gradient -- )
-    [ draw-gradient ] [ draw-underline ] [ drop draw-shadows ] 2tri ;
-
-M: title-gradient draw-interior
-    [ dim>> ] dip colors>> draw-title ;
-
-M: title-gradient pen-background
-     2drop transparent ;
-
-M: title-gradient pen-foreground
-    nip foreground>> ;