GIMP's base functionality as Clojure. The builders in
hive-gimp.verbs.{image,layer,selection,paint,path,io,display} are PURE:
each answers hive-gimp.py forms. This namespace composes them and is the
one BOUNDARY, sending a composed program to GIMP in ONE round trip through
py/eval-forms:
(require '[hive-gimp.verbs :as verbs]
'[hive-gimp.verbs.image :as image]
'[hive-gimp.verbs.layer :as layer])
(verbs/run g (image/get-by-name "logo.xcf")) ; Outcome, :value a Ref
(verbs/run g
(layer/new-layer img {:name "corpo v3" :as 'body})
(paint/edit-fill-colour 'body "#2a4b8d")
(layer/set-opacity 'body 80)) ; one round trip
(verbs/call g :layer/set-name ref "FRANCANA")
call goes through the catalogue: it checks the arguments against the
verb's :verb/args, runs it, and checks the answer against
:verb/answers, labelling the Outcome verb_<family>_<verb>.
GIMP's base functionality as Clojure. The builders in
`hive-gimp.verbs.{image,layer,selection,paint,path,io,display}` are PURE:
each answers hive-gimp.py forms. This namespace composes them and is the
one BOUNDARY, sending a composed program to GIMP in ONE round trip through
`py/eval-forms`:
(require '[hive-gimp.verbs :as verbs]
'[hive-gimp.verbs.image :as image]
'[hive-gimp.verbs.layer :as layer])
(verbs/run g (image/get-by-name "logo.xcf")) ; Outcome, :value a Ref
(verbs/run g
(layer/new-layer img {:name "corpo v3" :as 'body})
(paint/edit-fill-colour 'body "#2a4b8d")
(layer/set-opacity 'body 80)) ; one round trip
(verbs/call g :layer/set-name ref "FRANCANA")
`call` goes through the catalogue: it checks the arguments against the
verb's `:verb/args`, runs it, and checks the answer against
`:verb/answers`, labelling the `Outcome` `verb_<family>_<verb>`.(call target verb & args)Run catalogued verb on args in GIMP. An Outcome labelled
verb_<family>_<verb>; a refused verb or argument, or an answer outside
:verb/answers, is an :error Outcome, never a throw.
Run catalogued `verb` on `args` in GIMP. An `Outcome` labelled `verb_<family>_<verb>`; a refused verb or argument, or an answer outside `:verb/answers`, is an `:error` Outcome, never a throw.
(compose & programs)One program running programs in order; it answers the last one's value.
One program running `programs` in order; it answers the last one's value.
(program verb & args)The forms of verb applied to args.
The forms of `verb` applied to `args`.
(program-of {:keys [verb args]})The forms verb-call builds. Refuses (ex-info, :hive-gimp/reason)
an unknown verb, or arguments its :verb/args rejects.
The forms `verb-call` builds. Refuses (`ex-info`, `:hive-gimp/reason`) an unknown verb, or arguments its `:verb/args` rejects.
(run target & programs)Send the composition of programs to GIMP in one round trip. An Outcome
whose :value is the last program's answer as Clojure data.
Send the composition of `programs` to GIMP in one round trip. An `Outcome` whose `:value` is the last program's answer as Clojure data.
(run! target & programs)As run, answering the value and throwing on failure.
As `run`, answering the value and throwing on failure.
One verb applied to its arguments, as a value.
One verb applied to its arguments, as a value.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |